@settlemint/dalp-cli 3.1.32-main.42593324632 → 3.1.32-main.42600267094

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@settlemint/dalp-cli",
3
- "version": "3.1.32-main.42593324632",
3
+ "version": "3.1.32-main.42600267094",
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.32-main.42593324632",
53
+ "@settlemint/dalp-sdk": "3.1.32-main.42600267094",
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.32-main.42593324632",
60
- "@tools/typescript-config": "3.1.32-main.42593324632",
59
+ "@testkit/effect-bun-test": "3.1.32-main.42600267094",
60
+ "@tools/typescript-config": "3.1.32-main.42600267094",
61
61
  "@types/bun": "1.4.4",
62
62
  "publint": "0.3.25"
63
63
  },
@@ -78,6 +78,17 @@ const CLI_API_KEY_EXPIRES_IN_SECONDS = 90 * 24 * 60 * 60;
78
78
 
79
79
  const DEVICE_CLIENT_ID = "dalp-cli";
80
80
 
81
+ const SERVER_API_KEY_NAME_MAX_LENGTH = 32;
82
+
83
+ const cliApiKeyName = (machine: string): string => {
84
+ const name = `${DEVICE_CLIENT_ID} (${machine})`;
85
+ if (name.length <= SERVER_API_KEY_NAME_MAX_LENGTH) {
86
+ return name;
87
+ }
88
+ const room = SERVER_API_KEY_NAME_MAX_LENGTH - `${DEVICE_CLIENT_ID} (…)`.length;
89
+ return `${DEVICE_CLIENT_ID} (${machine.slice(0, room)}…)`;
90
+ };
91
+
81
92
  const isLoopbackHost = (host: string) =>
82
93
  host === "localhost" || host === "127.0.0.1" || host === "::1" || host === "[::1]";
83
94
 
@@ -348,7 +359,7 @@ export const loginCommand = Cli.create("login", {
348
359
 
349
360
  const { walletFactor } = c.options;
350
361
  const walletCode = await readWalletCode(walletFactor, c.env.DALP_WALLET_CODE, c.agent === true);
351
- const apiKeyName = `dalp-cli (${hostname()})`;
362
+ const apiKeyName = cliApiKeyName(hostname());
352
363
  const apiKeyResponse = await postJson(
353
364
  `${baseUrl}/api/auth/api-key/create`,
354
365
  {