Skip to content

Commit 7628b96

Browse files
authored
Update to the latest version of arango-tools (canada-ca#1592)
Arangojs renamed methods on the cursor and transaction objects, which where returned by Arango-tools. Given code makes some extensive use of those methods, Arango-tools now returns a proxy object that translates the old calls (cursor.each and transaction.run) to the new calls (cursor.forEach and transaction.step). cursor.hasNext was changed from a function to a boolean so this was fixed by a simple search and replace. Details: https://arangodb.github.io/arangojs/CHANGELOG#cursor-api-1
1 parent fbf0273 commit 7628b96

26 files changed

Lines changed: 41 additions & 203 deletions

api-js/package-lock.json

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

api-js/package.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@
1111
"build": "npm run clean && babel ./src --out-dir dist/src --ignore 'src/**/*.spec.js','src/**/*.test.js' && babel index.js migrations.js --out-dir dist/",
1212
"start": "node ./dist/index.js",
1313
"dev": "nodemon --exec babel-node index.js",
14+
"dbg": "node --inspect-brk node_modules/.bin/jest --runInBand --no-cache",
1415
"clean": "rm -rf ./dist && mkdir dist",
1516
"test": "jest",
1617
"test-coverage": "jest --coverage",
@@ -24,7 +25,7 @@
2425
"@lingui/core": "^3.4.0",
2526
"apollo-server": "^2.19.2",
2627
"apollo-server-express": "^2.19.2",
27-
"arango-tools": "^0.0.9",
28+
"arango-tools": "^0.2.3",
2829
"arangojs": "^7.2.0",
2930
"bcryptjs": "^2.4.3",
3031
"cors": "^2.8.5",

api-js/src/affiliation/loaders/__tests__/load-affiliations-by-key.test.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -148,7 +148,7 @@ describe('given a affiliationLoaderByKey dataloader', () => {
148148
RETURN MERGE(affiliation, { id: affiliation._key, orgKey: orgKey, userKey: userKey, _type: "affiliation" })
149149
`
150150

151-
while (expectedCursor.hasNext()) {
151+
while (expectedCursor.hasNext) {
152152
const tempAff = await expectedCursor.next()
153153
affiliationIds.push(tempAff._key)
154154
expectedAffiliations.push(tempAff)
@@ -265,7 +265,7 @@ describe('given a affiliationLoaderByKey dataloader', () => {
265265
RETURN MERGE(affiliation, { id: affiliation._key, orgKey: orgKey, userKey: userKey, _type: "affiliation" })
266266
`
267267

268-
while (expectedCursor.hasNext()) {
268+
while (expectedCursor.hasNext) {
269269
const tempAff = await expectedCursor.next()
270270
affiliationIds.push(tempAff._key)
271271
expectedAffiliations.push(tempAff)

api-js/src/dmarc-summaries/loaders/__tests__/load-dmarc-summary-by-key.test.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -100,7 +100,7 @@ describe('given the dmarcSumLoaderByKey dataloader', () => {
100100
}
101101
`
102102

103-
while (expectedCursor.hasNext()) {
103+
while (expectedCursor.hasNext) {
104104
const temp = await expectedCursor.next()
105105
summaryKeys.push(temp._key)
106106
expectedSummaries.push(temp)

api-js/src/domain/loaders/__tests__/load-domain-by-domain.test.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,7 @@ describe('given a domainLoaderByDomain dataloader', () => {
6161
RETURN MERGE({ id: domain._key, _type: "domain" }, domain)
6262
`
6363

64-
while (expectedCursor.hasNext()) {
64+
while (expectedCursor.hasNext) {
6565
const tempDomain = await expectedCursor.next()
6666
domainDomains.push(tempDomain.domain)
6767
expectedDomains.push(tempDomain)

api-js/src/domain/loaders/__tests__/load-domain-by-key.test.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,7 @@ describe('given a domainLoaderByKey dataloader', () => {
6363
RETURN MERGE({ id: domain._key, _type: "domain" }, domain)
6464
`
6565

66-
while (expectedCursor.hasNext()) {
66+
while (expectedCursor.hasNext) {
6767
const tempDomain = await expectedCursor.next()
6868
domainIds.push(tempDomain._key)
6969
expectedDomains.push(tempDomain)

api-js/src/email-scan/loaders/__tests__/load-dkim-by-key.test.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -71,7 +71,7 @@ describe('given the dkimLoaderByKey function', () => {
7171
RETURN MERGE({ id: dkimScan._key, _type: "dkim" }, dkimScan)
7272
`
7373

74-
while (expectedCursor.hasNext()) {
74+
while (expectedCursor.hasNext) {
7575
const tempDkim = await expectedCursor.next()
7676
dkimKeys.push(tempDkim._key)
7777
expectedDkimScans.push(tempDkim)

api-js/src/email-scan/loaders/__tests__/load-dkim-result-by-key.test.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -71,7 +71,7 @@ describe('given the dkimResultLoaderByKey function', () => {
7171
RETURN MERGE({ id: dkimResult._key, _type: "dkimResult" }, dkimResult)
7272
`
7373

74-
while (expectedCursor.hasNext()) {
74+
while (expectedCursor.hasNext) {
7575
const tempDkimResult = await expectedCursor.next()
7676
dkimResultKeys.push(tempDkimResult._key)
7777
expectedDkimResults.push(tempDkimResult)

api-js/src/email-scan/loaders/__tests__/load-dmarc-by-key.test.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -69,7 +69,7 @@ describe('given the dmarcLoaderByKey function', () => {
6969
RETURN MERGE({ id: dmarcScan._key, _type: "dmarc" }, dmarcScan)
7070
`
7171

72-
while (expectedCursor.hasNext()) {
72+
while (expectedCursor.hasNext) {
7373
const tempDmarc = await expectedCursor.next()
7474
dmarcKeys.push(tempDmarc._key)
7575
expectedDkimScans.push(tempDmarc)

api-js/src/email-scan/loaders/__tests__/load-spf-by-key.test.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -70,7 +70,7 @@ describe('given the spfLoaderByKey function', () => {
7070
RETURN MERGE({ id: spfScan._key, _type: "spf" }, spfScan)
7171
`
7272

73-
while (expectedCursor.hasNext()) {
73+
while (expectedCursor.hasNext) {
7474
const tempSpf = await expectedCursor.next()
7575
spfKeys.push(tempSpf._key)
7676
expectedSpfScans.push(tempSpf)

0 commit comments

Comments
 (0)