@tokenoftrust/cli 7.8.1 → 7.9.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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@tokenoftrust/cli",
3
- "version": "7.8.1",
3
+ "version": "7.9.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",
@@ -417,10 +417,16 @@ export async function runAdmin(argv, ctx, deps = {}) {
417
417
  if (verb === "install" || verb === "rotate") return renderCredential(verb, data, args.json, out, err);
418
418
  if (verb === "update") {
419
419
  if (args.json) out(JSON.stringify(data));
420
- else out(`✓ updated ${data?.install?.installId ?? "the install"} (${data?.install?.appId ?? "app"} ${data?.install?.appVersion ?? ""}, ${data?.install?.env ?? ""})`.replace(/ ,/g, ","));
420
+ else {
421
+ const i = data?.install;
422
+ out(`✓ updated ${i?.installId ?? "the install"} (${i?.appId ?? "app"} ${i?.appVersion ?? ""}, ${i?.env ?? ""})`.replace(/ ,/g, ","));
423
+ if (args.webhookEndpoint === null) {
424
+ err(` Note: --webhook-endpoint none also unbinds the preview processor; re-run \`tot app test-order bind ${i?.installId ?? args.positional[0]} [--location <id>]\` after setting a new endpoint.`);
425
+ }
426
+ }
421
427
  return 0;
422
428
  }
423
- if (verb === "test-order") return renderTestOrder(data, args, out);
429
+ if (verb === "test-order") return renderTestOrder(data, args, out, err);
424
430
  if (verb === "suspend" || verb === "resume" || verb === "uninstall") {
425
431
  if (args.json) out(JSON.stringify(data));
426
432
  else {
@@ -546,7 +552,7 @@ function renderCredential(verb, data, json, out, err) {
546
552
  return 0;
547
553
  }
548
554
 
549
- function renderTestOrder(data, args, out) {
555
+ function renderTestOrder(data, args, out, err) {
550
556
  if (args.json) { out(JSON.stringify(data)); return 0; }
551
557
  const action = args.positional[0];
552
558
  if (action === "bind") {
@@ -558,6 +564,9 @@ function renderTestOrder(data, args, out) {
558
564
  } else {
559
565
  const order = data?.order;
560
566
  out(`✓ ${TEST_ORDER_TRANSITIONS.get(action)} ${order?.orderId ?? args.positional[1]} (${order?.fulfillment ?? ""}, assigned to ${order?.assignedInstallId ?? "no install"})`);
567
+ if (action === "release" && !order?.assignedInstallId && typeof err === "function") {
568
+ err(" → next: bind a preview processor first with `tot app test-order bind <installId> [--location <id>]`");
569
+ }
561
570
  }
562
571
  return 0;
563
572
  }