@settlemint/dalp-cli 3.1.33-main.43086447888 → 3.1.33-main.43111071501
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/dist/dalp.js +16 -35
- package/dist/dalp.js.map +11 -11
- package/package.json +4 -4
- package/src/lib/api-client.ts +1 -21
- package/src/main.ts +1 -4
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@settlemint/dalp-cli",
|
|
3
|
-
"version": "3.1.33-main.
|
|
3
|
+
"version": "3.1.33-main.43111071501",
|
|
4
4
|
"private": false,
|
|
5
5
|
"description": "CLI for the Digital Asset Lifecycle Platform — manage tokens, identities, compliance, and more from the command line.",
|
|
6
6
|
"homepage": "https://settlemint.com",
|
|
@@ -50,14 +50,14 @@
|
|
|
50
50
|
},
|
|
51
51
|
"dependencies": {
|
|
52
52
|
"@modelcontextprotocol/server": "2.4.0",
|
|
53
|
-
"@settlemint/dalp-sdk": "3.1.33-main.
|
|
53
|
+
"@settlemint/dalp-sdk": "3.1.33-main.43111071501",
|
|
54
54
|
"incur": "0.7.1",
|
|
55
55
|
"zod": "4.6.7"
|
|
56
56
|
},
|
|
57
57
|
"devDependencies": {
|
|
58
58
|
"@arethetypeswrong/cli": "0.18.5",
|
|
59
|
-
"@testkit/effect-bun-test": "3.1.33-main.
|
|
60
|
-
"@tools/typescript-config": "3.1.33-main.
|
|
59
|
+
"@testkit/effect-bun-test": "3.1.33-main.43111071501",
|
|
60
|
+
"@tools/typescript-config": "3.1.33-main.43111071501",
|
|
61
61
|
"@types/bun": "1.4.4",
|
|
62
62
|
"publint": "0.3.25"
|
|
63
63
|
},
|
package/src/lib/api-client.ts
CHANGED
|
@@ -4,7 +4,6 @@ import { CLI_USER_AGENT } from "./vars.ts";
|
|
|
4
4
|
|
|
5
5
|
export interface CliGeneratedClientOptions {
|
|
6
6
|
readonly fetch?: typeof globalThis.fetch;
|
|
7
|
-
readonly organizationId?: string;
|
|
8
7
|
}
|
|
9
8
|
|
|
10
9
|
const withCliUserAgent = (fetchImpl: typeof globalThis.fetch): typeof globalThis.fetch =>
|
|
@@ -17,33 +16,14 @@ const withCliUserAgent = (fetchImpl: typeof globalThis.fetch): typeof globalThis
|
|
|
17
16
|
return fetchImpl(new Request(request, { headers }), transportInit);
|
|
18
17
|
}, fetchImpl);
|
|
19
18
|
|
|
20
|
-
export function resolveActiveOrganizationId(
|
|
21
|
-
credentials: StoredCredentials,
|
|
22
|
-
defaultOrg?: string,
|
|
23
|
-
override?: string
|
|
24
|
-
): string | undefined {
|
|
25
|
-
if (override !== undefined && override.trim() !== "") {
|
|
26
|
-
return override;
|
|
27
|
-
}
|
|
28
|
-
if (credentials.activeOrgId !== undefined && credentials.activeOrgId.trim() !== "") {
|
|
29
|
-
return credentials.activeOrgId;
|
|
30
|
-
}
|
|
31
|
-
if (defaultOrg !== undefined && defaultOrg.trim() !== "") {
|
|
32
|
-
return defaultOrg;
|
|
33
|
-
}
|
|
34
|
-
return undefined;
|
|
35
|
-
}
|
|
36
|
-
|
|
37
19
|
export function makeCliClient(
|
|
38
20
|
apiUrl: string,
|
|
39
21
|
credentials: StoredCredentials,
|
|
40
|
-
options: CliGeneratedClientOptions
|
|
22
|
+
options: CliGeneratedClientOptions = {}
|
|
41
23
|
): DalpClient {
|
|
42
|
-
const organizationId = resolveActiveOrganizationId(credentials, options.defaultOrg, options.organizationId);
|
|
43
24
|
return createDalpClient({
|
|
44
25
|
apiKey: credentials.apiKey,
|
|
45
26
|
baseUrl: apiUrl,
|
|
46
|
-
context: organizationId === undefined ? {} : { organizationId },
|
|
47
27
|
fetch: withCliUserAgent(options.fetch ?? globalThis.fetch),
|
|
48
28
|
runtime: "server",
|
|
49
29
|
});
|
package/src/main.ts
CHANGED
|
@@ -64,10 +64,7 @@ export const makeCli = (): Cli.Cli<Record<string, never>, typeof cliVars> => {
|
|
|
64
64
|
});
|
|
65
65
|
}
|
|
66
66
|
|
|
67
|
-
const
|
|
68
|
-
const client = makeCliClient(credentials.apiUrl, credentials, {
|
|
69
|
-
defaultOrg: config.defaultOrg,
|
|
70
|
-
});
|
|
67
|
+
const client = makeCliClient(credentials.apiUrl, credentials);
|
|
71
68
|
c.set("apiUrl", credentials.apiUrl);
|
|
72
69
|
c.set("credentials", credentials);
|
|
73
70
|
c.set("client", client);
|