@01.software/cli 0.19.5 → 0.20.1
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.js +105 -1
- package/dist/index.js.map +1 -1
- package/package.json +7 -7
package/dist/index.js
CHANGED
|
@@ -15,6 +15,7 @@ import {
|
|
|
15
15
|
|
|
16
16
|
// ../../internal/http-contracts/src/index.ts
|
|
17
17
|
var operationBrand = /* @__PURE__ */ Symbol("sdk-http-operation");
|
|
18
|
+
var CREDENTIAL_ROTATION_DEADLINE_HEADER = "X-01-Credential-Rotation-Deadline";
|
|
18
19
|
var operation = (collection, method, path2, errorFamily) => Object.freeze({
|
|
19
20
|
[operationBrand]: true,
|
|
20
21
|
collection,
|
|
@@ -176,17 +177,52 @@ var portOneStandardActionCapabilityOperations = /* @__PURE__ */ new Set([
|
|
|
176
177
|
]);
|
|
177
178
|
var MEMBERSHIP_ENDPOINT_OPERATIONS = {
|
|
178
179
|
subscribe: operation(null, "post", "/memberships/subscribe"),
|
|
180
|
+
billingCustody: operation(null, "post", "/memberships/billing-custody"),
|
|
179
181
|
cancel: operation(null, "post", "/memberships/:id/cancel"),
|
|
180
182
|
me: operation(null, "get", "/memberships/me"),
|
|
181
183
|
chargeResult: operation(null, "post", "/memberships/:id/charge-result"),
|
|
182
184
|
refundResult: operation(null, "post", "/memberships/:id/refund-result"),
|
|
183
185
|
revoke: operation(null, "post", "/memberships/:id/revoke")
|
|
184
186
|
};
|
|
187
|
+
var EXTERNAL_EFFECT_CLAIM_ENDPOINT_OPERATIONS = {
|
|
188
|
+
claim: operation(null, "post", "/external-effect-claims/claim"),
|
|
189
|
+
get: operation(null, "post", "/external-effect-claims/get"),
|
|
190
|
+
arm: operation(null, "post", "/external-effect-claims/arm"),
|
|
191
|
+
release: operation(null, "post", "/external-effect-claims/release"),
|
|
192
|
+
report: operation(null, "post", "/external-effect-claims/report"),
|
|
193
|
+
recovery: operation(null, "post", "/external-effect-claims/recovery")
|
|
194
|
+
};
|
|
195
|
+
var INSTALLATION_CREDENTIAL_ENDPOINT_OPERATIONS = {
|
|
196
|
+
create: operation(null, "post", "/installation-credentials/create"),
|
|
197
|
+
get: operation(null, "post", "/installation-credentials/get"),
|
|
198
|
+
replace: operation(null, "post", "/installation-credentials/replace"),
|
|
199
|
+
dispose: operation(null, "post", "/installation-credentials/dispose")
|
|
200
|
+
};
|
|
201
|
+
var EXTERNAL_CUSTOMER_LINK_ENDPOINT_OPERATIONS = {
|
|
202
|
+
connect: operation("customers", "post", "/external-links/connect"),
|
|
203
|
+
get: operation("customers", "post", "/external-links/get"),
|
|
204
|
+
list: operation("customers", "post", "/external-links/list"),
|
|
205
|
+
unlink: operation("customers", "post", "/external-links/unlink"),
|
|
206
|
+
capturePreviousState: operation(
|
|
207
|
+
"customers",
|
|
208
|
+
"post",
|
|
209
|
+
"/external-links/capture-previous-state"
|
|
210
|
+
),
|
|
211
|
+
clearPreviousState: operation(
|
|
212
|
+
"customers",
|
|
213
|
+
"post",
|
|
214
|
+
"/external-links/clear-previous-state"
|
|
215
|
+
)
|
|
216
|
+
};
|
|
185
217
|
var CUSTOMER_GROUP_ENDPOINT_OPERATIONS = {
|
|
186
218
|
members: operation("customer-groups", "get", "/:id/members"),
|
|
187
219
|
grant: operation("customer-groups", "post", "/:id/members/grant"),
|
|
188
220
|
revoke: operation("customer-groups", "post", "/:id/members/revoke")
|
|
189
221
|
};
|
|
222
|
+
var CUSTOMER_AUTH_ENDPOINT_OPERATIONS = {
|
|
223
|
+
revokeRefresh: operation("customers", "post", "/revoke-refresh"),
|
|
224
|
+
withdraw: operation("customers", "post", "/withdraw")
|
|
225
|
+
};
|
|
190
226
|
var EMBEDDED_ADMIN_ENDPOINT_OPERATIONS = {
|
|
191
227
|
show: operation("tenants", "get", "/embedded-admin-app"),
|
|
192
228
|
configure: operation("tenants", "patch", "/embedded-admin-app"),
|
|
@@ -210,6 +246,14 @@ var COMMUNITY_ENDPOINT_OPERATIONS = {
|
|
|
210
246
|
detail: operation("posts", "get", "/detail")
|
|
211
247
|
}
|
|
212
248
|
};
|
|
249
|
+
var GALLERY_ENDPOINT_OPERATIONS = {
|
|
250
|
+
items: {
|
|
251
|
+
storefront: operation("gallery-items", "get", "/storefront")
|
|
252
|
+
}
|
|
253
|
+
};
|
|
254
|
+
var VIDEO_ENDPOINT_OPERATIONS = {
|
|
255
|
+
playback: operation("videos", "post", "/:id/playback")
|
|
256
|
+
};
|
|
213
257
|
function resolveOperationTemplate(descriptor) {
|
|
214
258
|
return descriptor.collection ? `/api/${descriptor.collection}${descriptor.path}` : `/api${descriptor.path}`;
|
|
215
259
|
}
|
|
@@ -959,6 +1003,7 @@ function withDoctorActionTranslations(translations) {
|
|
|
959
1003
|
return translations;
|
|
960
1004
|
}
|
|
961
1005
|
var CLI_I18N_KO = withDoctorActionTranslations({
|
|
1006
|
+
CredentialRotationDeadline: "\uACBD\uACE0: \uC774 \uC790\uACA9 \uC99D\uBA85\uC740 {{deadline}} \uC804\uC5D0 \uD68C\uC804\uD574\uC57C \uD569\uB2C8\uB2E4. `01 login`\uC73C\uB85C MFA \uC778\uC99D \uD6C4 \uB2E4\uC2DC \uBC1C\uAE09\uD558\uC138\uC694. \uC6B4\uC601 \uC2A4\uD06C\uB9BD\uD2B8\xB7CI\xB7MCP\uC5D0 \uC800\uC7A5\uB41C \uC790\uACA9 \uC99D\uBA85\uC740 \uAD00\uB9AC\uC790\uC640 \uD568\uAED8 \uAD50\uCCB4\uD558\uC138\uC694.",
|
|
962
1007
|
// CLI-surface microcopy
|
|
963
1008
|
AuthenticationRequired: "\uC778\uC99D\uC774 \uD544\uC694\uD569\uB2C8\uB2E4",
|
|
964
1009
|
RunLoginToAuthenticate: "`01 login` \uBA85\uB839\uC73C\uB85C \uBE0C\uB77C\uC6B0\uC800 \uC778\uC99D\uC744 \uC9C4\uD589\uD558\uAC70\uB098,",
|
|
@@ -1012,6 +1057,7 @@ var CLI_I18N_KO = withDoctorActionTranslations({
|
|
|
1012
1057
|
unknown: "\uC54C \uC218 \uC5C6\uB294 \uC624\uB958"
|
|
1013
1058
|
});
|
|
1014
1059
|
var CLI_I18N_EN = {
|
|
1060
|
+
CredentialRotationDeadline: "Warning: rotate this credential before {{deadline}}. Run `01 login` and complete MFA to obtain a replacement. Coordinate with an administrator to replace credentials stored in scripts, CI and MCP clients.",
|
|
1015
1061
|
AuthenticationRequired: "Authentication required",
|
|
1016
1062
|
RunLoginToAuthenticate: "Run `01 login` to authenticate via browser, or",
|
|
1017
1063
|
PassApiKey: "pass `--api-key <token>`, or",
|
|
@@ -1266,6 +1312,31 @@ function resolveClient(apiKeyFlag) {
|
|
|
1266
1312
|
}
|
|
1267
1313
|
}
|
|
1268
1314
|
|
|
1315
|
+
// src/lib/credential-rotation-warning.ts
|
|
1316
|
+
var installed = /* @__PURE__ */ new WeakSet();
|
|
1317
|
+
function installCredentialRotationWarning() {
|
|
1318
|
+
const original = globalThis.fetch;
|
|
1319
|
+
if (installed.has(original)) return;
|
|
1320
|
+
const warned = /* @__PURE__ */ new Set();
|
|
1321
|
+
const observing = async (...args) => {
|
|
1322
|
+
const response = await original(...args);
|
|
1323
|
+
const deadline = response.headers.get(CREDENTIAL_ROTATION_DEADLINE_HEADER);
|
|
1324
|
+
if (response.ok && deadline && /^\d{4}-\d{2}-\d{2}T\d{2}:\d{2}:\d{2}\.\d{3}Z$/.test(deadline)) {
|
|
1325
|
+
const instant = Date.parse(deadline);
|
|
1326
|
+
if (Number.isFinite(instant) && new Date(instant).toISOString() === deadline && !warned.has(deadline)) {
|
|
1327
|
+
warned.add(deadline);
|
|
1328
|
+
process.stderr.write(
|
|
1329
|
+
`${t("CredentialRotationDeadline", { deadline })}
|
|
1330
|
+
`
|
|
1331
|
+
);
|
|
1332
|
+
}
|
|
1333
|
+
}
|
|
1334
|
+
return response;
|
|
1335
|
+
};
|
|
1336
|
+
installed.add(observing);
|
|
1337
|
+
globalThis.fetch = observing;
|
|
1338
|
+
}
|
|
1339
|
+
|
|
1269
1340
|
// src/commands/crud.ts
|
|
1270
1341
|
import { readFileSync as readFileSync2 } from "fs";
|
|
1271
1342
|
import { basename } from "path";
|
|
@@ -2288,6 +2359,18 @@ var updateCartAttributesBodySchema = z4.object({
|
|
|
2288
2359
|
var updateCartAttributesParamsSchema = updateCartAttributesBodySchema.extend({
|
|
2289
2360
|
idempotencyKey: commerceIdempotencyKeySchema
|
|
2290
2361
|
});
|
|
2362
|
+
var serverAddItemBodySchema = addItemBodySchema.extend({
|
|
2363
|
+
customerToken: commerceCustomerTokenSchema.optional()
|
|
2364
|
+
});
|
|
2365
|
+
var serverAddItemParamsSchema = serverAddItemBodySchema.extend({
|
|
2366
|
+
idempotencyKey: commerceIdempotencyKeySchema
|
|
2367
|
+
});
|
|
2368
|
+
var serverUpdateItemBodySchema = updateItemBodySchema.extend({
|
|
2369
|
+
customerToken: commerceCustomerTokenSchema.optional()
|
|
2370
|
+
});
|
|
2371
|
+
var serverUpdateItemParamsSchema = serverUpdateItemBodySchema.extend({
|
|
2372
|
+
idempotencyKey: commerceIdempotencyKeySchema
|
|
2373
|
+
});
|
|
2291
2374
|
|
|
2292
2375
|
// ../../internal/contracts/src/ecommerce/checkout.ts
|
|
2293
2376
|
import { z as z6 } from "zod";
|
|
@@ -2383,6 +2466,14 @@ function providerDiscriminatedUnion(schemas) {
|
|
|
2383
2466
|
var createPaymentSessionBodySchema = providerDiscriminatedUnion(
|
|
2384
2467
|
createPaymentSessionBodySchemasByProvider
|
|
2385
2468
|
);
|
|
2469
|
+
var createServerPaymentSessionBodySchema = providerDiscriminatedUnion({
|
|
2470
|
+
toss: createTossPaymentSessionBodySchema.extend({
|
|
2471
|
+
customerToken: commerceCustomerTokenSchema.optional()
|
|
2472
|
+
}),
|
|
2473
|
+
portone: createPortOnePaymentSessionBodySchema.extend({
|
|
2474
|
+
customerToken: commerceCustomerTokenSchema.optional()
|
|
2475
|
+
})
|
|
2476
|
+
});
|
|
2386
2477
|
var createPaymentSessionParamsSchemasByProvider = {
|
|
2387
2478
|
toss: createTossPaymentSessionBodySchema.extend({
|
|
2388
2479
|
idempotencyKey: commerceIdempotencyKeySchema
|
|
@@ -2394,6 +2485,16 @@ var createPaymentSessionParamsSchemasByProvider = {
|
|
|
2394
2485
|
var createPaymentSessionParamsSchema = providerDiscriminatedUnion(
|
|
2395
2486
|
createPaymentSessionParamsSchemasByProvider
|
|
2396
2487
|
);
|
|
2488
|
+
var createServerPaymentSessionParamsSchema = providerDiscriminatedUnion({
|
|
2489
|
+
toss: createTossPaymentSessionBodySchema.extend({
|
|
2490
|
+
customerToken: commerceCustomerTokenSchema.optional(),
|
|
2491
|
+
idempotencyKey: commerceIdempotencyKeySchema
|
|
2492
|
+
}),
|
|
2493
|
+
portone: createPortOnePaymentSessionBodySchema.extend({
|
|
2494
|
+
customerToken: commerceCustomerTokenSchema.optional(),
|
|
2495
|
+
idempotencyKey: commerceIdempotencyKeySchema
|
|
2496
|
+
})
|
|
2497
|
+
});
|
|
2397
2498
|
var retrieveBrowserPaymentSessionParamsSchema = z5.object({
|
|
2398
2499
|
paymentSessionId: commerceResourceIdSchema,
|
|
2399
2500
|
checkoutToken: commerceCapabilitySchema
|
|
@@ -2457,7 +2558,8 @@ var customPaymentIdentitySchema = z5.string().trim().min(1);
|
|
|
2457
2558
|
var customPaymentCurrencyInputSchema = z5.string().trim().min(1).regex(/^[A-Za-z]{3}$/, "currency must be a three-letter ISO 4217 code").transform((currency) => currency.toUpperCase());
|
|
2458
2559
|
var createCustomPaymentSessionBodySchema = z5.object({
|
|
2459
2560
|
provider: customPaymentProviderSchema,
|
|
2460
|
-
checkoutToken: commerceCapabilitySchema
|
|
2561
|
+
checkoutToken: commerceCapabilitySchema,
|
|
2562
|
+
customerToken: commerceCustomerTokenSchema.optional()
|
|
2461
2563
|
}).strict();
|
|
2462
2564
|
var createCustomPaymentSessionParamsSchema = createCustomPaymentSessionBodySchema.extend({
|
|
2463
2565
|
idempotencyKey: commerceIdempotencyKeySchema
|
|
@@ -2989,6 +3091,7 @@ var createCheckoutParamsSchema = createCheckoutBodySchema.extend({
|
|
|
2989
3091
|
idempotencyKey: commerceIdempotencyKeySchema
|
|
2990
3092
|
});
|
|
2991
3093
|
var createServerCheckoutBodySchema = createCheckoutBodySchema.safeExtend({
|
|
3094
|
+
customerToken: commerceCustomerTokenSchema.optional(),
|
|
2992
3095
|
clientReferenceId: commerceResourceIdSchema.optional(),
|
|
2993
3096
|
integrationMetadata: integrationMetadataSchema.optional()
|
|
2994
3097
|
}).strict();
|
|
@@ -6187,6 +6290,7 @@ function createCliProgram() {
|
|
|
6187
6290
|
program.hook("preAction", () => {
|
|
6188
6291
|
const lang = program.opts().lang;
|
|
6189
6292
|
if (lang === "ko" || lang === "en") setLocale(lang);
|
|
6293
|
+
installCredentialRotationWarning();
|
|
6190
6294
|
const format = program.opts().format;
|
|
6191
6295
|
if (format) process.env.OUTPUT_FORMAT = format;
|
|
6192
6296
|
});
|