@certen.io/cli 0.4.0 → 0.7.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.
Files changed (87) hide show
  1. package/CHANGELOG.md +440 -0
  2. package/README.md +232 -160
  3. package/dist/chains.d.ts +67 -0
  4. package/dist/chains.js +242 -0
  5. package/dist/chains.js.map +1 -0
  6. package/dist/commands/admin.js +49 -4
  7. package/dist/commands/admin.js.map +1 -1
  8. package/dist/commands/auth.js +145 -12
  9. package/dist/commands/auth.js.map +1 -1
  10. package/dist/commands/billing.d.ts +2 -0
  11. package/dist/commands/billing.js +782 -0
  12. package/dist/commands/billing.js.map +1 -0
  13. package/dist/commands/call.d.ts +2 -0
  14. package/dist/commands/call.js +168 -0
  15. package/dist/commands/call.js.map +1 -0
  16. package/dist/commands/chains.d.ts +2 -0
  17. package/dist/commands/chains.js +123 -0
  18. package/dist/commands/chains.js.map +1 -0
  19. package/dist/commands/doctor.d.ts +2 -0
  20. package/dist/commands/doctor.js +171 -0
  21. package/dist/commands/doctor.js.map +1 -0
  22. package/dist/commands/errors-catalogue.d.ts +2 -0
  23. package/dist/commands/errors-catalogue.js +83 -0
  24. package/dist/commands/errors-catalogue.js.map +1 -0
  25. package/dist/commands/identity.js +269 -19
  26. package/dist/commands/identity.js.map +1 -1
  27. package/dist/commands/init.d.ts +2 -0
  28. package/dist/commands/init.js +307 -0
  29. package/dist/commands/init.js.map +1 -0
  30. package/dist/commands/keys.js +2 -0
  31. package/dist/commands/keys.js.map +1 -1
  32. package/dist/commands/oauth-clients.d.ts +2 -0
  33. package/dist/commands/oauth-clients.js +131 -0
  34. package/dist/commands/oauth-clients.js.map +1 -0
  35. package/dist/commands/orgs.d.ts +2 -0
  36. package/dist/commands/orgs.js +117 -0
  37. package/dist/commands/orgs.js.map +1 -0
  38. package/dist/commands/pending.js +13 -1
  39. package/dist/commands/pending.js.map +1 -1
  40. package/dist/commands/portfolio.js +34 -1
  41. package/dist/commands/portfolio.js.map +1 -1
  42. package/dist/commands/proof.d.ts +2 -0
  43. package/dist/commands/proof.js +400 -0
  44. package/dist/commands/proof.js.map +1 -0
  45. package/dist/commands/signup.d.ts +14 -0
  46. package/dist/commands/signup.js +271 -0
  47. package/dist/commands/signup.js.map +1 -0
  48. package/dist/commands/transaction.js +144 -21
  49. package/dist/commands/transaction.js.map +1 -1
  50. package/dist/commands/webhooks.d.ts +2 -0
  51. package/dist/commands/webhooks.js +200 -0
  52. package/dist/commands/webhooks.js.map +1 -0
  53. package/dist/commands/whoami.d.ts +16 -0
  54. package/dist/commands/whoami.js +98 -0
  55. package/dist/commands/whoami.js.map +1 -0
  56. package/dist/config.d.ts +56 -0
  57. package/dist/config.js +51 -0
  58. package/dist/config.js.map +1 -1
  59. package/dist/errors.d.ts +14 -1
  60. package/dist/errors.js +15 -1
  61. package/dist/errors.js.map +1 -1
  62. package/dist/funding-guard.d.ts +40 -0
  63. package/dist/funding-guard.js +120 -0
  64. package/dist/funding-guard.js.map +1 -0
  65. package/dist/help-root.d.ts +2 -0
  66. package/dist/help-root.js +94 -0
  67. package/dist/help-root.js.map +1 -0
  68. package/dist/index.js +40 -8
  69. package/dist/index.js.map +1 -1
  70. package/dist/output.d.ts +23 -0
  71. package/dist/output.js +90 -0
  72. package/dist/output.js.map +1 -1
  73. package/dist/passphrase.d.ts +18 -0
  74. package/dist/passphrase.js +35 -3
  75. package/dist/passphrase.js.map +1 -1
  76. package/dist/payment-uri.d.ts +76 -0
  77. package/dist/payment-uri.js +135 -0
  78. package/dist/payment-uri.js.map +1 -0
  79. package/dist/signer.js +6 -3
  80. package/dist/signer.js.map +1 -1
  81. package/dist/solidity-args.d.ts +31 -0
  82. package/dist/solidity-args.js +111 -0
  83. package/dist/solidity-args.js.map +1 -0
  84. package/dist/wait.d.ts +79 -0
  85. package/dist/wait.js +168 -0
  86. package/dist/wait.js.map +1 -0
  87. package/package.json +5 -4
package/dist/wait.js ADDED
@@ -0,0 +1,168 @@
1
+ import { CliError, UsageError, EXIT } from './errors.js';
2
+ import { human, isJsonMode } from './output.js';
3
+ /**
4
+ * Waiting for asynchronous work to finish.
5
+ *
6
+ * Two of this product's central operations return before they are usable — `POST /v1/identity`
7
+ * answers 202 while provisioning continues, and a transaction intent takes a 60–110 second proof
8
+ * cycle to reach a terminal state. Every document in the repo warns about both. The CLI
9
+ * nonetheless printed the interim response and exited, leaving each user to write the same poll
10
+ * loop, and leaving anyone who did not write one holding an identity that fails at the last step
11
+ * of every flow with an error that never mentions provisioning.
12
+ *
13
+ * The polling shape here is lifted from `certen fund`, which got it right first: speak only when
14
+ * something changes, treat a timeout as neither success nor failure, and never exit 0 on an
15
+ * outcome a script would misread as done.
16
+ */
17
+ /** `certen fund`'s defaults are 60 min / 5 s; these are per-operation because the work differs. */
18
+ export const IDENTITY_WAIT = { timeoutMin: 5, intervalSec: 3 };
19
+ /**
20
+ * A proof cycle is 60–110 seconds of real validator work and `execute.wait()` budgets 360s. Seven
21
+ * minutes leaves room for a queue without being an unbounded hang. Do NOT shorten this to make a
22
+ * test faster — it is not a tunable delay.
23
+ */
24
+ export const TX_WAIT = { timeoutMin: 7, intervalSec: 8 };
25
+ const sleep = (ms) => new Promise((r) => { setTimeout(r, ms); });
26
+ /**
27
+ * Should this invocation wait?
28
+ *
29
+ * Human mode waits by default, because "it is not ready yet" is an implementation detail nobody
30
+ * asked to manage. JSON mode does NOT, because scripts already written against the old
31
+ * fire-and-forget behaviour must not silently start blocking for minutes. Either default is
32
+ * overridden by saying so explicitly.
33
+ *
34
+ * Read from `process.argv` rather than commander's parsed value: declaring `--no-wait` makes
35
+ * commander default `opts.wait` to true, which erases the distinction between "defaulted" and
36
+ * "asked for" — and that distinction is the whole rule.
37
+ */
38
+ export function resolveWait(argv = process.argv) {
39
+ if (argv.includes('--no-wait'))
40
+ return false;
41
+ if (argv.includes('--wait'))
42
+ return true;
43
+ return !isJsonMode();
44
+ }
45
+ /**
46
+ * Validate `--timeout` and `--poll-interval` BEFORE any network call.
47
+ *
48
+ * Checking after would mean a typo'd timeout had already opened an intent that the user then has
49
+ * to wait out or abandon — the same reasoning `certen fund` applies to its own options.
50
+ */
51
+ export function parseWaitBudget(timeout, pollInterval, defaults) {
52
+ const timeoutMin = timeout === undefined ? defaults.timeoutMin : Number(timeout);
53
+ if (!Number.isFinite(timeoutMin) || timeoutMin <= 0) {
54
+ throw new UsageError('--timeout must be a positive number of minutes', 'INVALID_TIMEOUT');
55
+ }
56
+ const intervalSec = pollInterval === undefined ? defaults.intervalSec : Number(pollInterval);
57
+ if (!Number.isFinite(intervalSec) || intervalSec <= 0) {
58
+ throw new UsageError('--poll-interval must be a positive number of seconds', 'INVALID_POLL_INTERVAL');
59
+ }
60
+ return { timeoutMs: timeoutMin * 60_000, intervalMs: intervalSec * 1_000 };
61
+ }
62
+ /**
63
+ * Statuses `POST /v1/identity` provisioning settles into.
64
+ *
65
+ * The gateway writes `active` or `error` (identity.orchestrator.ts). Anything else is treated as
66
+ * still in flight, which is the safe direction: waiting longer for an unrecognised status costs
67
+ * time, whereas calling it terminal would report an identity ready that never became one.
68
+ */
69
+ const IDENTITY_IN_FLIGHT = ['provisioning', 'pending', 'creating'];
70
+ function isTerminalIdentityStatus(status) {
71
+ return !IDENTITY_IN_FLIGHT.includes(status);
72
+ }
73
+ /** Say it once, when it changes — a five-minute wait should not be a wall of identical lines. */
74
+ function progress() {
75
+ let last = '';
76
+ return (message) => {
77
+ if (isJsonMode() || message === last)
78
+ return;
79
+ last = message;
80
+ human(` ${message}`);
81
+ };
82
+ }
83
+ /**
84
+ * Poll an identity until it is genuinely usable.
85
+ *
86
+ * "Usable" is `status` terminal AND `can_sign === true`, and those are two separate conditions
87
+ * that fail for different reasons:
88
+ *
89
+ * - `can_sign === false` — provisioning finished but the key on the on-chain key page is not
90
+ * yours. The identity exists, consumes quota, and can never sign.
91
+ * - `can_sign === null` — the key page could not be READ. That is unknown, not a soft yes; an
92
+ * Accumulate outage is exactly when this distinction matters most. Reporting it as ready would
93
+ * be the one wrong answer, so this keeps polling and, if the budget runs out, says plainly that
94
+ * it could not determine the answer.
95
+ */
96
+ export async function waitForIdentity(client, id, budget) {
97
+ const say = progress();
98
+ const deadline = Date.now() + budget.timeoutMs;
99
+ let last;
100
+ say('Provisioning. This takes a minute or two on Accumulate.');
101
+ while (Date.now() < deadline) {
102
+ // The response IS the identity — the gateway no longer nests it under an `identity` key.
103
+ const identity = await client.identity.get(id);
104
+ last = identity;
105
+ say(`Status: ${identity.status}.`);
106
+ if (isTerminalIdentityStatus(identity.status)) {
107
+ if (identity.can_sign === true)
108
+ return identity;
109
+ if (identity.can_sign === false) {
110
+ throw new CliError(`Identity ${id} finished provisioning as "${identity.status}" but cannot sign — its key `
111
+ + 'page is not held by your key. It will fail at the signing step of every flow.'
112
+ + (identity.error_message ? ` Gateway said: ${identity.error_message}` : ''), 'IDENTITY_CANNOT_SIGN', EXIT.FAILED);
113
+ }
114
+ if (identity.status === 'error') {
115
+ throw new CliError(`Identity ${id} failed to provision.`
116
+ + (identity.error_message ? ` ${identity.error_message}` : ' The gateway gave no reason.'), 'IDENTITY_PROVISIONING_FAILED', EXIT.FAILED);
117
+ }
118
+ // Terminal status, can_sign null: the key page could not be read. Keep asking — this is
119
+ // usually transient — and fall through to the unknown-answer error if it never resolves.
120
+ say(`Status: ${identity.status}, waiting on the key page to confirm it holds your key.`);
121
+ }
122
+ await sleep(budget.intervalMs);
123
+ }
124
+ const minutes = Math.round(budget.timeoutMs / 60_000);
125
+ if (last && isTerminalIdentityStatus(last.status) && last.can_sign == null) {
126
+ throw new CliError(`Identity ${id} is "${last.status}" but whether it can sign could not be determined — the `
127
+ + 'on-chain key page was unreadable for the whole wait. The identity may be fine; Accumulate '
128
+ + `may not be. Check again: certen identity get ${id}`, 'IDENTITY_CAN_SIGN_UNKNOWN', EXIT.FAILED);
129
+ }
130
+ // Neither success nor failure: provisioning may still complete. Say which it is, and do not
131
+ // exit 0 — a script must not read "still working" as "ready".
132
+ throw new CliError(`Identity ${id} is still "${last?.status ?? 'unknown'}" after ${minutes} min. It may yet `
133
+ + `finish. Check with: certen identity get ${id}`, 'IDENTITY_WAIT_TIMEOUT', EXIT.FAILED);
134
+ }
135
+ /**
136
+ * Poll a transaction intent to a terminal state.
137
+ *
138
+ * Delegates to the SDK's `execute.wait()` rather than re-implementing the loop, so the CLI and an
139
+ * SDK caller agree on which statuses are terminal. The SDK signals both failure and timeout by
140
+ * throwing a plain `Error`; those are translated here into typed CLI errors so the exit code and
141
+ * the `--json` envelope carry a code a caller can branch on.
142
+ */
143
+ export async function waitForTransaction(client, intentId, budget) {
144
+ const say = progress();
145
+ say('Waiting for the proof cycle. This is 60-110 seconds of real validator work.');
146
+ try {
147
+ const result = await client.execute.wait(intentId, {
148
+ timeoutMs: budget.timeoutMs,
149
+ intervalMs: budget.intervalMs,
150
+ onPoll: (tx) => {
151
+ const status = tx.status;
152
+ if (status)
153
+ say(`Status: ${status}.`);
154
+ },
155
+ });
156
+ return result;
157
+ }
158
+ catch (err) {
159
+ const message = err instanceof Error ? err.message : String(err);
160
+ // "still <status> after <n>ms" is the SDK's timeout wording. A timeout is not a failed intent
161
+ // — it may still complete — and conflating the two would tell a user their work was lost.
162
+ const timedOut = /still .* after \d+ms/.test(message);
163
+ throw new CliError(timedOut
164
+ ? `${message.replace(/^certen: /, '')}. It may yet complete. Check with: certen tx status ${intentId}`
165
+ : message.replace(/^certen: /, ''), timedOut ? 'TX_WAIT_TIMEOUT' : 'TX_FAILED', EXIT.FAILED);
166
+ }
167
+ }
168
+ //# sourceMappingURL=wait.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"wait.js","sourceRoot":"","sources":["../src/wait.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,QAAQ,EAAE,UAAU,EAAE,IAAI,EAAE,MAAM,aAAa,CAAC;AACzD,OAAO,EAAE,KAAK,EAAE,UAAU,EAAE,MAAM,aAAa,CAAC;AAEhD;;;;;;;;;;;;;GAaG;AAEH,mGAAmG;AAC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uD,QAAQ,EAAE;YACtG,CAAC,CAAC,OAAO,CAAC,OAAO,CAAC,WAAW,EAAE,EAAE,CAAC,EACpC,QAAQ,CAAC,CAAC,CAAC,iBAAiB,CAAC,CAAC,CAAC,WAAW,EAC1C,IAAI,CAAC,MAAM,CACZ,CAAC;IACJ,CAAC;AACH,CAAC"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@certen.io/cli",
3
- "version": "0.4.0",
3
+ "version": "0.7.0",
4
4
  "description": "Command line for the CERTEN Gateway API",
5
5
  "license": "MIT",
6
6
  "type": "module",
@@ -33,19 +33,20 @@
33
33
  "LICENSE"
34
34
  ],
35
35
  "scripts": {
36
- "build": "tsc",
36
+ "build": "node ../../scripts/build-package.mjs",
37
37
  "test": "vitest run",
38
38
  "typecheck": "tsc --noEmit",
39
39
  "//prepack": "Build before packing so the published bin can never point at a missing dist/index.js.",
40
40
  "prepack": "npm run build",
41
- "prepublishOnly": "npm run build && npm test"
41
+ "prepublishOnly": "node ../../scripts/prepublish-check.mjs",
42
+ "//build": "dist/ is gitignored and tsc does not prune outputs whose source was deleted, so a stale artifact survives forever locally and ships on a local publish. CI never sees it. Clean first so both produce the same tarball."
42
43
  },
43
44
  "publishConfig": {
44
45
  "access": "public"
45
46
  },
46
47
  "//dependencies": "@certen.io/sdk MUST be a version range, not file:../sdk. A published package carrying a file: dependency installs and then fails to resolve on the consumer's machine, because that path does not exist there. Local development uses `npm link` or a workspace instead.",
47
48
  "dependencies": {
48
- "@certen.io/sdk": "^0.4.0",
49
+ "@certen.io/sdk": "^0.7.0",
49
50
  "commander": "^12.0.0"
50
51
  },
51
52
  "devDependencies": {