@ariestools/cli 0.1.11 → 0.1.13
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +6 -4
- package/dist/bin/aries.mjs +13510 -462
- package/dist/bin/daemons/dapp-server.mjs +4 -1
- package/dist/bin/daemons/datalake-dev.mjs +906 -451
- package/dist/node/datalake.d.ts +6 -1
- package/dist/node/datalake.mjs +28 -13
- package/package.json +7 -7
package/dist/node/datalake.d.ts
CHANGED
|
@@ -1,6 +1,10 @@
|
|
|
1
1
|
/** Programmatic datalake client API shipped with @ariestools/cli (bundled). */
|
|
2
2
|
|
|
3
|
-
export
|
|
3
|
+
export interface AuthTokenRequest {
|
|
4
|
+
audience: string
|
|
5
|
+
}
|
|
6
|
+
export type AuthTokenSupplier = (request: AuthTokenRequest) => Promise<string>
|
|
7
|
+
export type AuthTokenSource = string | AuthTokenSupplier
|
|
4
8
|
export type PayloadsAuthTokenSource = AuthTokenSource
|
|
5
9
|
|
|
6
10
|
export type DatalakeRole = 'viewer' | 'runner'
|
|
@@ -114,6 +118,7 @@ export interface CreateDatalakeClientOptions {
|
|
|
114
118
|
|
|
115
119
|
export interface RestDatalakeClientOptions {
|
|
116
120
|
authToken: AuthTokenSource
|
|
121
|
+
audience?: string
|
|
117
122
|
baseUrl: string
|
|
118
123
|
fetchImpl?: typeof fetch
|
|
119
124
|
}
|
package/dist/node/datalake.mjs
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { chmodSync, existsSync, mkdirSync, readFileSync, unlinkSync, writeFileSync } from "node:fs";
|
|
2
2
|
import path from "node:path";
|
|
3
3
|
import { homedir } from "node:os";
|
|
4
|
-
//#region ../datalake-core/dist/
|
|
4
|
+
//#region ../datalake-core/dist/browser/browser.mjs
|
|
5
5
|
var DatalakeApiError = class extends Error {
|
|
6
6
|
code;
|
|
7
7
|
requestId;
|
|
@@ -55,6 +55,18 @@ function datalakePlaneClearPath(id) {
|
|
|
55
55
|
function datalakePlaneUsagePath(id) {
|
|
56
56
|
return `${datalakePlaneResourcePath(id)}/usage`;
|
|
57
57
|
}
|
|
58
|
+
var DATALAKE_CONTROL_OPERATIONS = [
|
|
59
|
+
"datalake:create",
|
|
60
|
+
"datalake:describe",
|
|
61
|
+
"datalake:list"
|
|
62
|
+
];
|
|
63
|
+
var DATALAKE_DATA_OPERATIONS = [
|
|
64
|
+
"payload:append",
|
|
65
|
+
"payload:read",
|
|
66
|
+
"usage:read"
|
|
67
|
+
];
|
|
68
|
+
DATALAKE_CONTROL_OPERATIONS.join(" ");
|
|
69
|
+
DATALAKE_DATA_OPERATIONS.join(" ");
|
|
58
70
|
//#endregion
|
|
59
71
|
//#region ../datalake-client/dist/node/index.mjs
|
|
60
72
|
function getAriesHome() {
|
|
@@ -226,12 +238,17 @@ var LocalDatalakeClient = class {
|
|
|
226
238
|
return datalake;
|
|
227
239
|
}
|
|
228
240
|
};
|
|
241
|
+
async function resolveAuthToken(source, audience) {
|
|
242
|
+
return typeof source === "function" ? await source({ audience }) : source;
|
|
243
|
+
}
|
|
229
244
|
var RestDatalakeClient = class {
|
|
245
|
+
audience;
|
|
230
246
|
authToken;
|
|
231
247
|
baseUrl;
|
|
232
248
|
fetchImpl;
|
|
233
249
|
constructor(options) {
|
|
234
250
|
this.baseUrl = options.baseUrl.replace(/\/$/, "");
|
|
251
|
+
this.audience = options.audience ?? "aries-datalake-control";
|
|
235
252
|
this.authToken = options.authToken;
|
|
236
253
|
this.fetchImpl = options.fetchImpl ?? fetch;
|
|
237
254
|
}
|
|
@@ -282,11 +299,13 @@ var RestDatalakeClient = class {
|
|
|
282
299
|
const method = options.method ?? "GET";
|
|
283
300
|
const headers = {
|
|
284
301
|
accept: "application/json",
|
|
285
|
-
authorization: `Bearer ${await this.
|
|
302
|
+
authorization: `Bearer ${await resolveAuthToken(this.authToken, this.audience)}`
|
|
286
303
|
};
|
|
287
304
|
const init = {
|
|
305
|
+
credentials: "omit",
|
|
306
|
+
headers,
|
|
288
307
|
method,
|
|
289
|
-
|
|
308
|
+
redirect: "error"
|
|
290
309
|
};
|
|
291
310
|
if (options.body !== void 0) {
|
|
292
311
|
headers["content-type"] = "application/json";
|
|
@@ -299,15 +318,12 @@ var RestDatalakeClient = class {
|
|
|
299
318
|
if (!response.ok) {
|
|
300
319
|
const errorBody = isApiErrorBody(payload) ? payload : {
|
|
301
320
|
code: "internal",
|
|
302
|
-
message: `Unexpected ${response.status} response from ${method}
|
|
321
|
+
message: `Unexpected ${response.status} response from ${method} control plane`
|
|
303
322
|
};
|
|
304
323
|
throw new DatalakeApiError(response.status, errorBody);
|
|
305
324
|
}
|
|
306
325
|
return payload;
|
|
307
326
|
}
|
|
308
|
-
async resolveAuthToken() {
|
|
309
|
-
return typeof this.authToken === "function" ? await this.authToken() : this.authToken;
|
|
310
|
-
}
|
|
311
327
|
};
|
|
312
328
|
function isApiErrorBody(value) {
|
|
313
329
|
if (typeof value !== "object" || value === null) return false;
|
|
@@ -423,11 +439,13 @@ var RestPayloadsClient = class {
|
|
|
423
439
|
const method = options.method ?? "GET";
|
|
424
440
|
const headers = {
|
|
425
441
|
accept: "application/json",
|
|
426
|
-
authorization: `Bearer ${await this.
|
|
442
|
+
authorization: `Bearer ${await resolveAuthToken(this.authToken, this.datalakeId)}`
|
|
427
443
|
};
|
|
428
444
|
const init = {
|
|
445
|
+
credentials: "omit",
|
|
446
|
+
headers,
|
|
429
447
|
method,
|
|
430
|
-
|
|
448
|
+
redirect: "error"
|
|
431
449
|
};
|
|
432
450
|
if (options.body !== void 0) {
|
|
433
451
|
headers["content-type"] = "application/json";
|
|
@@ -443,7 +461,7 @@ var RestPayloadsClient = class {
|
|
|
443
461
|
if (!response.ok) {
|
|
444
462
|
const errorBody = isApiErrorBody2(payload) ? payload : {
|
|
445
463
|
code: "internal",
|
|
446
|
-
message: `Unexpected ${response.status} response from ${method}
|
|
464
|
+
message: `Unexpected ${response.status} response from ${method} data plane`
|
|
447
465
|
};
|
|
448
466
|
throw new DatalakeApiError(response.status, errorBody);
|
|
449
467
|
}
|
|
@@ -452,9 +470,6 @@ var RestPayloadsClient = class {
|
|
|
452
470
|
headers: response.headers
|
|
453
471
|
};
|
|
454
472
|
}
|
|
455
|
-
async resolveAuthToken() {
|
|
456
|
-
return typeof this.authToken === "function" ? await this.authToken() : this.authToken;
|
|
457
|
-
}
|
|
458
473
|
};
|
|
459
474
|
function readInsertSummary(headers) {
|
|
460
475
|
const duplicatesRaw = headers.get(DATALAKE_HEADER_DUPLICATES);
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@ariestools/cli",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.13",
|
|
4
4
|
"description": "Aries Tools CLI - A suite of tools by Arie Trouw",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"ariestools",
|
|
@@ -45,9 +45,9 @@
|
|
|
45
45
|
"sharp": "~0.35.3",
|
|
46
46
|
"sharp-phash": "~2.2.0",
|
|
47
47
|
"zod": "~4.4.3",
|
|
48
|
-
"@ariestools/aries-dapp-
|
|
49
|
-
"@ariestools/aries-dapp-
|
|
50
|
-
"@xyo-network/wallet-xl1-cli": "~0.1.
|
|
48
|
+
"@ariestools/aries-dapp-core": "~0.1.13",
|
|
49
|
+
"@ariestools/aries-dapp-serve": "~0.1.13",
|
|
50
|
+
"@xyo-network/wallet-xl1-cli": "~0.1.13"
|
|
51
51
|
},
|
|
52
52
|
"devDependencies": {
|
|
53
53
|
"@ariestools/sdk": "~8.1.3",
|
|
@@ -56,15 +56,15 @@
|
|
|
56
56
|
"@metamask/json-rpc-engine": "~10.5.0",
|
|
57
57
|
"@types/node": "~26.1.1",
|
|
58
58
|
"@xyo-network/sdk": "~7.2.1",
|
|
59
|
-
"@xyo-network/xl1-sdk": "~4.5.
|
|
59
|
+
"@xyo-network/xl1-sdk": "~4.5.3",
|
|
60
60
|
"eslint": "~10.7.0",
|
|
61
61
|
"rolldown": "~1.2.0",
|
|
62
62
|
"tsx": "~4.23.1",
|
|
63
63
|
"typescript": "~6.0.3",
|
|
64
64
|
"vite": "~8.1.5",
|
|
65
65
|
"vitest": "~4.1.10",
|
|
66
|
-
"@ariestools/aries-datalake-client": "~0.1.
|
|
67
|
-
"@ariestools/cli-lib": "~0.1.
|
|
66
|
+
"@ariestools/aries-datalake-client": "~0.1.13",
|
|
67
|
+
"@ariestools/cli-lib": "~0.1.13"
|
|
68
68
|
},
|
|
69
69
|
"engines": {
|
|
70
70
|
"node": ">=18.17.1"
|