@tokenoftrust/cli 6.17.1 → 7.1.0
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/bin/tot.mjs +1 -0
- package/package.json +1 -1
- package/src/commands/app/admin.mjs +11 -0
- package/src/commands/app/index.mjs +1 -0
package/bin/tot.mjs
CHANGED
|
@@ -86,6 +86,7 @@ const COMMANDS = [
|
|
|
86
86
|
{ invocation: "app test-order bind <installId> | create | release <orderId>", blurb: "synthetic preview orders bound to your test install (preview host)" },
|
|
87
87
|
{ invocation: "app candidate", blurb: "stage a production candidate (pending_approval) for owner approval" },
|
|
88
88
|
{ invocation: "app candidate status", blurb: "your store's candidates and their status" },
|
|
89
|
+
{ invocation: "app candidate withdraw <candidateId>", blurb: "withdraw a pending production candidate" },
|
|
89
90
|
{ invocation: "app suspend <installId>", blurb: "disable an install's tokens, webhooks and widgets (reversible)" },
|
|
90
91
|
{ invocation: "app resume <installId>", blurb: "bring a suspended install back to active" },
|
|
91
92
|
{ invocation: "app uninstall <installId>", blurb: "revoke an install's credentials and clear its placements" },
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@tokenoftrust/cli",
|
|
3
|
-
"version": "
|
|
3
|
+
"version": "7.1.0",
|
|
4
4
|
"description": "Token of Trust developer CLI — clone a tenant store, run it locally with save→reload, and submit it for preview. Installs the `tot` command.",
|
|
5
5
|
"license": "Apache-2.0",
|
|
6
6
|
"author": "Token of Trust",
|
|
@@ -47,6 +47,8 @@ export const ADMIN_USAGE = `tot app — manage Private App installs on your stor
|
|
|
47
47
|
(test orders always act on the store's preview stage, at
|
|
48
48
|
${DEFAULT_STOREFRONT_ORIGIN}/<tenant>; no --url needed)
|
|
49
49
|
tot app candidate status this store's candidates: id, app, version, status
|
|
50
|
+
tot app candidate withdraw <candidateId>
|
|
51
|
+
withdraw a pending production candidate
|
|
50
52
|
tot app candidate [--app <dir>] [--jwks-uri <url> | --jwks <file>] [--request-consent] [--webhook-endpoint <url>]
|
|
51
53
|
stage a production candidate (pending_approval) for owner approval;
|
|
52
54
|
keys come from --jwks-uri, --jwks, or the manifest's clientAuth
|
|
@@ -238,6 +240,10 @@ export async function runAdmin(argv, ctx, deps = {}) {
|
|
|
238
240
|
request = { method: "POST", path: `/api/apps/admin/${verb}`, body: { installId } };
|
|
239
241
|
} else if (verb === "candidate" && args.positional[0] === "status") {
|
|
240
242
|
request = { method: "GET", path: "/api/apps/admin/candidates" };
|
|
243
|
+
} else if (verb === "candidate" && args.positional[0] === "withdraw") {
|
|
244
|
+
const candidateId = args.positional[1];
|
|
245
|
+
if (!candidateId) return fail("no candidate to withdraw", "tot app candidate withdraw <candidateId> (find it with `tot app candidate status`)");
|
|
246
|
+
request = { method: "POST", path: "/api/apps/admin/candidates", body: { action: "withdraw", candidateId } };
|
|
241
247
|
} else if (verb === "candidate") {
|
|
242
248
|
const loaded = loadManifest(args.app, ctx);
|
|
243
249
|
if (!loaded.ok) return fail(loaded.message, loaded.next);
|
|
@@ -321,6 +327,11 @@ export async function runAdmin(argv, ctx, deps = {}) {
|
|
|
321
327
|
return 0;
|
|
322
328
|
}
|
|
323
329
|
if (verb === "candidate" && args.positional[0] === "status") return renderCandidates(data, args.json, out);
|
|
330
|
+
if (verb === "candidate" && args.positional[0] === "withdraw") {
|
|
331
|
+
if (args.json) out(JSON.stringify(data));
|
|
332
|
+
else out(`✓ withdrew candidate ${data?.candidateId ?? args.positional[1]} (${data?.appId ?? "app"} ${data?.appVersion ?? ""}, status ${data?.status ?? "rejected"})`.replace(/ ,/g, ","));
|
|
333
|
+
return 0;
|
|
334
|
+
}
|
|
324
335
|
if (verb === "candidate") {
|
|
325
336
|
if (args.json) out(JSON.stringify(data));
|
|
326
337
|
else {
|
|
@@ -22,6 +22,7 @@ const USAGE = `tot app — build and install a Storefront Private App
|
|
|
22
22
|
tot app suspend|resume|uninstall <installId> lifecycle of an install on your store
|
|
23
23
|
tot app validate [<manifest>] lint tot-app.json offline (invalid_manifest on refusal)
|
|
24
24
|
tot app candidate status your store's candidates and their status
|
|
25
|
+
tot app candidate withdraw <candidateId> withdraw a pending production candidate
|
|
25
26
|
tot app candidate stage a production candidate (pending_approval) for owner approval
|
|
26
27
|
|
|
27
28
|
Run \`tot app <command> --help\` for options. Online commands use your \`tot login\` session.`;
|