Skip to content

Commit 9d414fb

Browse files
authored
Update Super Admin Service Dependencies (canada-ca#1941)
* update dependencies * update files to work with dependency updates
1 parent 2e2007e commit 9d414fb

10 files changed

Lines changed: 3125 additions & 3233 deletions

services/super-admin/package-lock.json

Lines changed: 3101 additions & 3209 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

services/super-admin/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313
"author": "",
1414
"license": "MIT",
1515
"dependencies": {
16-
"arango-tools": "0.2.3",
16+
"arango-tools": "0.3.0",
1717
"bcryptjs": "^2.4.3",
1818
"dotenv-safe": "^8.2.0"
1919
},

services/super-admin/src/__tests__/create-super-admin-account.test.js

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -56,10 +56,10 @@ describe('given the createSuperAdminAccount function', () => {
5656
})
5757
})
5858
describe('given an unsuccessful creation', () => {
59-
describe('transaction run error occurs', () => {
59+
describe('transaction step error occurs', () => {
6060
it('throws an error', async () => {
6161
const mockedTransaction = jest.fn().mockReturnValueOnce({
62-
run() {
62+
step() {
6363
throw new Error('Database error occurred.')
6464
},
6565
commit() {
@@ -76,7 +76,7 @@ describe('given the createSuperAdminAccount function', () => {
7676
} catch (err) {
7777
expect(err).toEqual(
7878
new Error(
79-
'Transaction run error occurred while creating new super admin account: Error: Database error occurred.',
79+
'Transaction step error occurred while creating new super admin account: Error: Database error occurred.',
8080
),
8181
)
8282
}
@@ -85,7 +85,7 @@ describe('given the createSuperAdminAccount function', () => {
8585
describe('transaction commit error occurs', () => {
8686
it('throws an error', async () => {
8787
const mockedTransaction = jest.fn().mockReturnValueOnce({
88-
run() {
88+
step() {
8989
return 'string'
9090
},
9191
commit() {

services/super-admin/src/__tests__/create-super-admin-affiliation.test.js

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -61,10 +61,10 @@ describe('given the createSuperAdminAffiliation function', () => {
6161
})
6262
})
6363
describe('given an unsuccessful creation', () => {
64-
describe('transaction run error occurs', () => {
64+
describe('transaction step error occurs', () => {
6565
it('throws an error', async () => {
6666
const mockedTransaction = jest.fn().mockReturnValueOnce({
67-
run() {
67+
step() {
6868
throw new Error('Database error occurred.')
6969
},
7070
commit() {
@@ -89,7 +89,7 @@ describe('given the createSuperAdminAffiliation function', () => {
8989
} catch (err) {
9090
expect(err).toEqual(
9191
new Error(
92-
'Transaction run error occurred while creating new super admin affiliation: Error: Database error occurred.',
92+
'Transaction step error occurred while creating new super admin affiliation: Error: Database error occurred.',
9393
),
9494
)
9595
}
@@ -98,7 +98,7 @@ describe('given the createSuperAdminAffiliation function', () => {
9898
describe('transaction commit error occurs', () => {
9999
it('throws an error', async () => {
100100
const mockedTransaction = jest.fn().mockReturnValueOnce({
101-
run() {
101+
step() {
102102
return 'string'
103103
},
104104
commit() {

services/super-admin/src/__tests__/create-super-admin-org.test.js

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -54,10 +54,10 @@ describe('given the createSuperAdminOrg function', () => {
5454
})
5555
})
5656
describe('given an unsuccessful creation', () => {
57-
describe('transaction run error occurs', () => {
57+
describe('transaction step error occurs', () => {
5858
it('throws an error', async () => {
5959
const mockedTransaction = jest.fn().mockReturnValueOnce({
60-
run() {
60+
step() {
6161
throw new Error('Database error occurred.')
6262
},
6363
commit() {
@@ -73,7 +73,7 @@ describe('given the createSuperAdminOrg function', () => {
7373
} catch (err) {
7474
expect(err).toEqual(
7575
new Error(
76-
'Transaction run error occurred while creating new super admin org: Error: Database error occurred.',
76+
'Transaction step error occurred while creating new super admin org: Error: Database error occurred.',
7777
),
7878
)
7979
}
@@ -82,7 +82,7 @@ describe('given the createSuperAdminOrg function', () => {
8282
describe('transaction commit error occurs', () => {
8383
it('throws an error', async () => {
8484
const mockedTransaction = jest.fn().mockReturnValueOnce({
85-
run() {
85+
step() {
8686
return 'string'
8787
},
8888
commit() {

services/super-admin/src/__tests__/remove-super-admin-affiliation.test.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,7 @@ describe('given the removeSuperAdminAffiliation function', () => {
6262
describe('database error occurs', () => {
6363
it('throws an error', async () => {
6464
const mockedTransaction = jest.fn().mockReturnValueOnce({
65-
run() {
65+
step() {
6666
throw new Error('Database error occurred.')
6767
},
6868
commit() {
@@ -79,7 +79,7 @@ describe('given the removeSuperAdminAffiliation function', () => {
7979
} catch (err) {
8080
expect(err).toEqual(
8181
new Error(
82-
'Transaction run error occurred well removing super admin affiliation: Error: Database error occurred.',
82+
'Transaction step error occurred well removing super admin affiliation: Error: Database error occurred.',
8383
),
8484
)
8585
}
@@ -88,7 +88,7 @@ describe('given the removeSuperAdminAffiliation function', () => {
8888
describe('cursor error occurs', () => {
8989
it('throws an error', async () => {
9090
const mockedTransaction = jest.fn().mockReturnValueOnce({
91-
run() {
91+
step() {
9292
return 'string'
9393
},
9494
commit() {

services/super-admin/src/database/create-super-admin-account.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ const createSuperAdminAccount = async ({
2121

2222
let user
2323
try {
24-
await trx.run(async () => {
24+
await trx.step(async () => {
2525
user = await collections.users.save({
2626
displayName: SA_USER_DISPLAY_NAME,
2727
userName: SA_USER_USERNAME,
@@ -35,7 +35,7 @@ const createSuperAdminAccount = async ({
3535
})
3636
} catch (err) {
3737
throw new Error(
38-
`Transaction run error occurred while creating new super admin account: ${err}`,
38+
`Transaction step error occurred while creating new super admin account: ${err}`,
3939
)
4040
}
4141

services/super-admin/src/database/create-super-admin-affiliation.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ const createSuperAdminAffiliation = async ({
1515

1616
let affiliation
1717
try {
18-
await trx.run(async () => {
18+
await trx.step(async () => {
1919
affiliation = await collections.affiliations.save({
2020
_from: org._id,
2121
_to: admin._id,
@@ -25,7 +25,7 @@ const createSuperAdminAffiliation = async ({
2525
})
2626
} catch (err) {
2727
throw new Error(
28-
`Transaction run error occurred while creating new super admin affiliation: ${err}`,
28+
`Transaction step error occurred while creating new super admin affiliation: ${err}`,
2929
)
3030
}
3131

services/super-admin/src/database/create-super-admin-org.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ const createSuperAdminOrg = async ({ collections, transaction }) => {
2929

3030
let org
3131
try {
32-
await trx.run(async () => {
32+
await trx.step(async () => {
3333
org = await collections.organizations.save({
3434
verified: false,
3535
orgDetails: {
@@ -58,7 +58,7 @@ const createSuperAdminOrg = async ({ collections, transaction }) => {
5858
})
5959
} catch (err) {
6060
throw new Error(
61-
`Transaction run error occurred while creating new super admin org: ${err}`,
61+
`Transaction step error occurred while creating new super admin org: ${err}`,
6262
)
6363
}
6464

services/super-admin/src/database/remove-super-admin-affiliation.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ const removeSuperAdminAffiliation = async ({
1313
const trx = await transaction(collectionStrings)
1414

1515
try {
16-
await trx.run(async () => {
16+
await trx.step(async () => {
1717
await query`
1818
FOR affiliation IN affiliations
1919
FILTER affiliation.defaultSA == true
@@ -23,7 +23,7 @@ const removeSuperAdminAffiliation = async ({
2323
})
2424
} catch (err) {
2525
throw new Error(
26-
`Transaction run error occurred well removing super admin affiliation: ${err}`,
26+
`Transaction step error occurred well removing super admin affiliation: ${err}`,
2727
)
2828
}
2929

0 commit comments

Comments
 (0)