@work-shape/catalyst-cli 0.8.0-rc.26 → 0.8.0-rc.28
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/index.d.ts +8 -8
- package/dist/index.js +20 -11
- package/package.json +4 -4
package/dist/index.d.ts
CHANGED
|
@@ -29011,7 +29011,7 @@ declare const personalApiKeyOperations: {
|
|
|
29011
29011
|
keyPrefix: z.ZodString;
|
|
29012
29012
|
scopes: z.ZodArray<z.ZodString>;
|
|
29013
29013
|
createdAt: z.ZodISODateTime;
|
|
29014
|
-
expiresAt: z.ZodISODateTime
|
|
29014
|
+
expiresAt: z.ZodOptional<z.ZodISODateTime>;
|
|
29015
29015
|
revokedAt: z.ZodOptional<z.ZodISODateTime>;
|
|
29016
29016
|
lastUsedAt: z.ZodOptional<z.ZodISODateTime>;
|
|
29017
29017
|
}, z.core.$strip>>;
|
|
@@ -29037,7 +29037,7 @@ declare const personalApiKeyOperations: {
|
|
|
29037
29037
|
readonly body: z.ZodObject<{
|
|
29038
29038
|
name: z.ZodString;
|
|
29039
29039
|
scopes: z.ZodArray<z.ZodString>;
|
|
29040
|
-
expiresAt: z.ZodISODateTime
|
|
29040
|
+
expiresAt: z.ZodNullable<z.ZodISODateTime>;
|
|
29041
29041
|
}, z.core.$strip>;
|
|
29042
29042
|
readonly response: {
|
|
29043
29043
|
readonly kind: "json";
|
|
@@ -29050,7 +29050,7 @@ declare const personalApiKeyOperations: {
|
|
|
29050
29050
|
keyPrefix: z.ZodString;
|
|
29051
29051
|
scopes: z.ZodArray<z.ZodString>;
|
|
29052
29052
|
createdAt: z.ZodISODateTime;
|
|
29053
|
-
expiresAt: z.ZodISODateTime
|
|
29053
|
+
expiresAt: z.ZodOptional<z.ZodISODateTime>;
|
|
29054
29054
|
revokedAt: z.ZodOptional<z.ZodISODateTime>;
|
|
29055
29055
|
lastUsedAt: z.ZodOptional<z.ZodISODateTime>;
|
|
29056
29056
|
}, z.core.$strip>;
|
|
@@ -29086,7 +29086,7 @@ declare const personalApiKeyOperations: {
|
|
|
29086
29086
|
keyPrefix: z.ZodString;
|
|
29087
29087
|
scopes: z.ZodArray<z.ZodString>;
|
|
29088
29088
|
createdAt: z.ZodISODateTime;
|
|
29089
|
-
expiresAt: z.ZodISODateTime
|
|
29089
|
+
expiresAt: z.ZodOptional<z.ZodISODateTime>;
|
|
29090
29090
|
revokedAt: z.ZodOptional<z.ZodISODateTime>;
|
|
29091
29091
|
lastUsedAt: z.ZodOptional<z.ZodISODateTime>;
|
|
29092
29092
|
}, z.core.$strip>;
|
|
@@ -29263,7 +29263,7 @@ declare const personalApiKeyOperations: {
|
|
|
29263
29263
|
readonly body: z.ZodObject<{
|
|
29264
29264
|
name: z.ZodString;
|
|
29265
29265
|
scopes: z.ZodArray<z.ZodString>;
|
|
29266
|
-
expiresAt: z.ZodISODateTime
|
|
29266
|
+
expiresAt: z.ZodNullable<z.ZodISODateTime>;
|
|
29267
29267
|
}, z.core.$strip>;
|
|
29268
29268
|
readonly response: {
|
|
29269
29269
|
readonly kind: "json";
|
|
@@ -29458,7 +29458,7 @@ declare const personalApiKeyOperations: {
|
|
|
29458
29458
|
keyPrefix: z.ZodString;
|
|
29459
29459
|
scopes: z.ZodArray<z.ZodString>;
|
|
29460
29460
|
createdAt: z.ZodISODateTime;
|
|
29461
|
-
expiresAt: z.ZodISODateTime
|
|
29461
|
+
expiresAt: z.ZodOptional<z.ZodISODateTime>;
|
|
29462
29462
|
revokedAt: z.ZodOptional<z.ZodISODateTime>;
|
|
29463
29463
|
lastUsedAt: z.ZodOptional<z.ZodISODateTime>;
|
|
29464
29464
|
}, z.core.$strip>;
|
|
@@ -29493,7 +29493,7 @@ declare const personalApiKeyOperations: {
|
|
|
29493
29493
|
keyPrefix: z.ZodString;
|
|
29494
29494
|
scopes: z.ZodArray<z.ZodString>;
|
|
29495
29495
|
createdAt: z.ZodISODateTime;
|
|
29496
|
-
expiresAt: z.ZodISODateTime
|
|
29496
|
+
expiresAt: z.ZodOptional<z.ZodISODateTime>;
|
|
29497
29497
|
revokedAt: z.ZodOptional<z.ZodISODateTime>;
|
|
29498
29498
|
lastUsedAt: z.ZodOptional<z.ZodISODateTime>;
|
|
29499
29499
|
}, z.core.$strip>>;
|
|
@@ -29525,7 +29525,7 @@ declare const personalApiKeyOperations: {
|
|
|
29525
29525
|
keyPrefix: z.ZodString;
|
|
29526
29526
|
scopes: z.ZodArray<z.ZodString>;
|
|
29527
29527
|
createdAt: z.ZodISODateTime;
|
|
29528
|
-
expiresAt: z.ZodISODateTime
|
|
29528
|
+
expiresAt: z.ZodOptional<z.ZodISODateTime>;
|
|
29529
29529
|
revokedAt: z.ZodOptional<z.ZodISODateTime>;
|
|
29530
29530
|
lastUsedAt: z.ZodOptional<z.ZodISODateTime>;
|
|
29531
29531
|
}, z.core.$strip>;
|
package/dist/index.js
CHANGED
|
@@ -2806,7 +2806,7 @@ import { z as z68 } from "zod";
|
|
|
2806
2806
|
// ../api-contract/package.json
|
|
2807
2807
|
var package_default = {
|
|
2808
2808
|
name: "@work-shape/catalyst-api-contract",
|
|
2809
|
-
version: "0.8.0-rc.
|
|
2809
|
+
version: "0.8.0-rc.28",
|
|
2810
2810
|
license: "MIT",
|
|
2811
2811
|
repository: {
|
|
2812
2812
|
type: "git",
|
|
@@ -12205,15 +12205,16 @@ var personalApiKeySchema = z59.object({
|
|
|
12205
12205
|
keyPrefix: z59.string(),
|
|
12206
12206
|
scopes: z59.array(personalApiKeyScopeSchema),
|
|
12207
12207
|
createdAt: timestampSchema,
|
|
12208
|
-
|
|
12208
|
+
/** Absent for a key that never expires; it acts until it is revoked. */
|
|
12209
|
+
expiresAt: timestampSchema.optional(),
|
|
12209
12210
|
revokedAt: timestampSchema.optional(),
|
|
12210
12211
|
lastUsedAt: timestampSchema.optional()
|
|
12211
12212
|
});
|
|
12212
12213
|
var keyFieldsSchema = z59.object({
|
|
12213
12214
|
name: z59.string().trim().min(1).max(100),
|
|
12214
12215
|
scopes: z59.array(personalApiKeyScopeSchema).min(1).max(64),
|
|
12215
|
-
/** At most a year ahead. */
|
|
12216
|
-
expiresAt: timestampSchema
|
|
12216
|
+
/** At most a year ahead, or `null` for a key that never expires and acts until revoked. */
|
|
12217
|
+
expiresAt: timestampSchema.nullable()
|
|
12217
12218
|
});
|
|
12218
12219
|
var createPersonalApiKeyRequestSchema = keyFieldsSchema;
|
|
12219
12220
|
var createPersonalApiKeyResponseSchema = z59.object({
|
|
@@ -15257,7 +15258,7 @@ function isCredentialFile(value) {
|
|
|
15257
15258
|
return false;
|
|
15258
15259
|
}
|
|
15259
15260
|
return Object.values(value.instances).every(
|
|
15260
|
-
(entry) => typeof entry === "object" && entry !== null && "apiKey" in entry && typeof entry.apiKey === "string" && "keyId" in entry && typeof entry.keyId === "string" && "name" in entry && typeof entry.name === "string" && "expiresAt" in entry
|
|
15261
|
+
(entry) => typeof entry === "object" && entry !== null && "apiKey" in entry && typeof entry.apiKey === "string" && "keyId" in entry && typeof entry.keyId === "string" && "name" in entry && typeof entry.name === "string" && (!("expiresAt" in entry) || typeof entry.expiresAt === "string") && "savedAt" in entry && typeof entry.savedAt === "string"
|
|
15261
15262
|
);
|
|
15262
15263
|
}
|
|
15263
15264
|
|
|
@@ -16373,7 +16374,7 @@ async function loginCommand(options) {
|
|
|
16373
16374
|
options,
|
|
16374
16375
|
[
|
|
16375
16376
|
`Logged in to ${credentialOrigin(url)} with the key '${key2.name}' (${key2.keyPrefix}\u2026).`,
|
|
16376
|
-
`It may: ${key2.scopes.join(", ")}, as far as your rights reach, until ${
|
|
16377
|
+
`It may: ${key2.scopes.join(", ")}, as far as your rights reach, until ${keyEnd(key2.expiresAt)}.`,
|
|
16377
16378
|
`Saved in ${key2.path}. See and revoke it at ${apiKeysAddress(url)}.`
|
|
16378
16379
|
].join("\n")
|
|
16379
16380
|
);
|
|
@@ -16413,14 +16414,14 @@ async function loginByConnectCode(options, url, clientLabel, openUrl, asksUseLev
|
|
|
16413
16414
|
keyId: answer.key.id,
|
|
16414
16415
|
name: answer.key.name,
|
|
16415
16416
|
scopes: answer.key.scopes,
|
|
16416
|
-
|
|
16417
|
+
...expiryOf(answer.key.expiresAt),
|
|
16417
16418
|
savedAt: (/* @__PURE__ */ new Date()).toISOString()
|
|
16418
16419
|
});
|
|
16419
16420
|
return {
|
|
16420
16421
|
name: answer.key.name,
|
|
16421
16422
|
keyPrefix: answer.key.keyPrefix,
|
|
16422
16423
|
scopes: answer.key.scopes,
|
|
16423
|
-
|
|
16424
|
+
...expiryOf(answer.key.expiresAt),
|
|
16424
16425
|
path
|
|
16425
16426
|
};
|
|
16426
16427
|
}
|
|
@@ -16468,6 +16469,12 @@ async function call(request) {
|
|
|
16468
16469
|
function formatTime(iso) {
|
|
16469
16470
|
return new Date(iso).toLocaleString();
|
|
16470
16471
|
}
|
|
16472
|
+
function keyEnd(expiresAt) {
|
|
16473
|
+
return expiresAt === void 0 ? "it is revoked" : formatTime(expiresAt);
|
|
16474
|
+
}
|
|
16475
|
+
function expiryOf(expiresAt) {
|
|
16476
|
+
return expiresAt === void 0 ? {} : { expiresAt };
|
|
16477
|
+
}
|
|
16471
16478
|
|
|
16472
16479
|
// src/doctor.ts
|
|
16473
16480
|
var help = `Diagnostics:
|
|
@@ -20049,7 +20056,7 @@ async function setupCommand(options) {
|
|
|
20049
20056
|
const saved = await workingSavedKey(options, url);
|
|
20050
20057
|
let keyLine;
|
|
20051
20058
|
if (saved) {
|
|
20052
|
-
keyLine = `Kept the saved key '${saved.name}'${scopesOf(saved.scopes)}, valid until ${
|
|
20059
|
+
keyLine = `Kept the saved key '${saved.name}'${scopesOf(saved.scopes)}, valid until ${keyEnd(saved.expiresAt)}.`;
|
|
20053
20060
|
} else {
|
|
20054
20061
|
const key2 = await loginByConnectCode(
|
|
20055
20062
|
options,
|
|
@@ -20067,7 +20074,7 @@ async function setupCommand(options) {
|
|
|
20067
20074
|
);
|
|
20068
20075
|
return 1;
|
|
20069
20076
|
}
|
|
20070
|
-
keyLine = `Logged in with the key '${key2.name}'${scopesOf(key2.scopes)}, valid until ${
|
|
20077
|
+
keyLine = `Logged in with the key '${key2.name}'${scopesOf(key2.scopes)}, valid until ${keyEnd(key2.expiresAt)}.`;
|
|
20071
20078
|
}
|
|
20072
20079
|
const path = catalystSkillPath(options.tool, readConfigCliEnv(options.env));
|
|
20073
20080
|
const skill = await renderCatalystSkill();
|
|
@@ -20140,7 +20147,9 @@ function isMissing(error) {
|
|
|
20140
20147
|
}
|
|
20141
20148
|
async function workingSavedKey(options, url) {
|
|
20142
20149
|
const saved = await readStoredCredential(readConfigCliEnv(options.env), url);
|
|
20143
|
-
if (saved === void 0 || Date.parse(saved.expiresAt) <= Date.now())
|
|
20150
|
+
if (saved === void 0 || saved.expiresAt !== void 0 && Date.parse(saved.expiresAt) <= Date.now()) {
|
|
20151
|
+
return void 0;
|
|
20152
|
+
}
|
|
20144
20153
|
try {
|
|
20145
20154
|
const api = await createConfigApi({
|
|
20146
20155
|
baseUrl: url,
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@work-shape/catalyst-cli",
|
|
3
|
-
"version": "0.8.0-rc.
|
|
3
|
+
"version": "0.8.0-rc.28",
|
|
4
4
|
"license": "MIT",
|
|
5
5
|
"repository": {
|
|
6
6
|
"type": "git",
|
|
@@ -40,9 +40,9 @@
|
|
|
40
40
|
"@types/node": "^24.13.1",
|
|
41
41
|
"tsup": "^8.5.1",
|
|
42
42
|
"typescript": "^6.0.3",
|
|
43
|
-
"@work-shape/catalyst-api-
|
|
44
|
-
"@work-shape/catalyst-asset-schemas": "0.8.0-rc.
|
|
45
|
-
"@work-shape/catalyst-api-
|
|
43
|
+
"@work-shape/catalyst-api-client": "0.8.0-rc.28",
|
|
44
|
+
"@work-shape/catalyst-asset-schemas": "0.8.0-rc.28",
|
|
45
|
+
"@work-shape/catalyst-api-contract": "0.8.0-rc.28"
|
|
46
46
|
},
|
|
47
47
|
"scripts": {
|
|
48
48
|
"build": "tsup",
|