Skip to content

Commit 5347ea2

Browse files
committed
fix(arango): update arangojs and token CLI
1 parent d11f03a commit 5347ea2

35 files changed

Lines changed: 427 additions & 428 deletions

File tree

common.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@ services:
2020
INSPECT: ${INSPECT---inspect=0.0.0.0:9229}
2121
DEBUG: ${DEBUG-*}
2222
PINO_LEVEL: ${PINO_LEVEL-debug}
23+
PROM_HOST: '::'
2324
DEBUG_HIDE_DATE: ~
2425
DEBUG_COLORS: ~
2526
DEBUG_DEPTH: ~

eslint.config.mjs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,4 +18,3 @@
1818
// @ts-check
1919

2020
export * from './oada/eslint.config.mjs';
21-

oada/libs/lib-arangodb/package.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,7 @@
5959
"@oada/models": "workspace:^",
6060
"@oada/oadaify": "^2.1.0",
6161
"@oada/types": "^4.0.0",
62-
"arangojs": "^8.8.1",
62+
"arangojs": "^9.0.0",
6363
"bcryptjs": "^2.4.3",
6464
"debug": "^4.3.6",
6565
"deep-equal": "^2.2.3",
@@ -75,7 +75,7 @@
7575
"@types/deep-equal": "^1.0.4",
7676
"@types/flat": "^5.0.5",
7777
"@types/json-pointer": "^1.0.34",
78-
"@types/node": "^22.0.0",
78+
"@types/node": "^22.0.2",
7979
"ava": "6.1.3",
8080
"type-fest": "^4.23.0"
8181
},

oada/libs/lib-arangodb/src/config.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -19,8 +19,8 @@
1919

2020
import libConfig from '@oada/lib-config';
2121

22-
import type { CreateCollectionOptions } from 'arangojs/collection.js';
23-
import type { EdgeDefinitionOptions } from 'arangojs/graph.js';
22+
import type { CreateCollectionOptions } from 'arangojs/collection';
23+
import type { EdgeDefinitionOptions } from 'arangojs/graph';
2424

2525
export interface Collection {
2626
name: string;
@@ -165,7 +165,7 @@ export const { config, schema } = await libConfig({
165165
default: {
166166
name: 'deviceCodes',
167167
indexes: ['deviceCode', 'userCode'],
168-
defaults: './libs/exampledocs/codes.js',
168+
// Defaults: './libs/exampledocs/deviceCodes.js',
169169
},
170170
},
171171
resources: {

oada/libs/lib-arangodb/src/db.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,9 +21,9 @@ import { config } from './config.js';
2121

2222
import { ArangoError, ArangoErrorCode } from './libs/errors.js';
2323

24-
import type { AqlQuery } from 'arangojs/aql.js';
24+
import type { AqlQuery } from 'arangojs/aql';
2525
import { Database } from 'arangojs';
26-
import type { QueryOptions } from 'arangojs/database.js';
26+
import type { QueryOptions } from 'arangojs/database';
2727
import debug from 'debug';
2828

2929
const error = debug('arangodb#aql:error');

oada/libs/lib-arangodb/src/libs/deviceCodes.ts

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -61,12 +61,14 @@ export async function findByUserCode(
6161
export async function save(
6262
deviceCode: DeviceCode,
6363
): Promise<DeviceCode | undefined> {
64-
const { new: saved } = await deviceCodes.save(deviceCode, { returnNew: true });
64+
const { new: saved } = await deviceCodes.save(deviceCode, {
65+
returnNew: true,
66+
});
6567
return saved;
6668
}
6769

6870
export async function redeem(deviceCode: string) {
69-
const cursor = await database.query<{ redeemed: boolean, code?: DeviceCode }>(
71+
const cursor = await database.query<{ redeemed: boolean; code?: DeviceCode }>(
7072
aql`
7173
LET code = (
7274
FOR c IN ${deviceCodes}
@@ -83,6 +85,7 @@ export async function redeem(deviceCode: string) {
8385
redeemed: LENGTH(clear) == 1,
8486
code: FIRST(code),
8587
}
86-
`);
88+
`,
89+
);
8790
return (await cursor.next())!;
8891
}

oada/libs/lib-arangodb/src/libs/errors.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@
2626

2727
// TODO: Add more of the error codes from above link
2828

29-
export { ArangoError } from 'arangojs/error.js';
29+
export { ArangoError } from 'arangojs/error';
3030

3131
/**
3232
* Error codes for ArangoErrorCode

oada/libs/lib-arangodb/src/libs/users.ts

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -15,11 +15,10 @@
1515
* limitations under the License.
1616
*/
1717

18-
import type { CollectionReadOptions } from 'arangojs/collection.js';
18+
import type { CollectionReadOptions } from 'arangojs/collection';
1919
import { aql } from 'arangojs';
2020
import bcrypt from 'bcryptjs';
2121
import debug from 'debug';
22-
import { flatten } from 'flat';
2322

2423
import type { Selector } from '../util.js';
2524
import { config } from '../config.js';
@@ -167,10 +166,6 @@ export async function update(
167166
return sanitizeResult(u.new);
168167
}
169168

170-
export async function like(u: Partial<User>): Promise<AsyncIterable<User>> {
171-
return users.byExample(flatten(u));
172-
}
173-
174169
export async function hashPw(pw: string): Promise<string> {
175170
return bcrypt.hash(pw, roundsOrSalt);
176171
}

oada/libs/lib-config/src/index.ts

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -188,7 +188,6 @@ export default async function loadConfig<S>(
188188
// Allow extra items
189189
allowed: 'warn',
190190
// Do not actually output warnings about extra items?
191-
192191
output() {},
193192
});
194193

oada/libs/lib-kafka/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@
4848
"@ava/typescript": "^5.0.0",
4949
"@types/convict": "^6.1.6",
5050
"@types/debug": "^4.1.12",
51-
"@types/node": "^22.0.0",
51+
"@types/node": "^22.0.2",
5252
"@types/uuid": "^10.0.0",
5353
"ava": "6.1.3"
5454
},

0 commit comments

Comments
 (0)