@skrr-ai/cli 0.1.47 → 0.1.48

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 (274) hide show
  1. package/README.md +1 -1
  2. package/dist/base-command.d.ts +18 -0
  3. package/dist/base-command.js +61 -1
  4. package/dist/commands/agents/chat.d.ts +21 -0
  5. package/dist/commands/agents/chat.js +26 -9
  6. package/dist/commands/balance/usage/breakdown.d.ts +14 -0
  7. package/dist/commands/balance/usage/breakdown.js +68 -0
  8. package/dist/commands/balance/usage.js +24 -0
  9. package/dist/commands/commerce/entitlements/explain.d.ts +22 -0
  10. package/dist/commands/commerce/entitlements/explain.js +40 -0
  11. package/dist/commands/commerce/incidents/audit.d.ts +20 -0
  12. package/dist/commands/commerce/incidents/audit.js +37 -0
  13. package/dist/commands/commerce/incidents/list.d.ts +22 -0
  14. package/dist/commands/commerce/incidents/list.js +49 -0
  15. package/dist/commands/commerce/incidents/resolve.d.ts +23 -0
  16. package/dist/commands/commerce/incidents/resolve.js +45 -0
  17. package/dist/commands/commerce/incidents/retry.d.ts +22 -0
  18. package/dist/commands/commerce/incidents/retry.js +45 -0
  19. package/dist/commands/commerce/incidents/show.d.ts +13 -0
  20. package/dist/commands/commerce/incidents/show.js +30 -0
  21. package/dist/commands/commerce/offers/approve.d.ts +17 -0
  22. package/dist/commands/commerce/offers/approve.js +33 -0
  23. package/dist/commands/commerce/offers/create.d.ts +18 -0
  24. package/dist/commands/commerce/offers/create.js +34 -0
  25. package/dist/commands/commerce/offers/publish.d.ts +13 -0
  26. package/dist/commands/commerce/offers/publish.js +28 -0
  27. package/dist/commands/commerce/offers/retire.d.ts +17 -0
  28. package/dist/commands/commerce/offers/retire.js +32 -0
  29. package/dist/commands/commerce/offers/validate.d.ts +18 -0
  30. package/dist/commands/commerce/offers/validate.js +33 -0
  31. package/dist/commands/commerce/products/create.d.ts +10 -0
  32. package/dist/commands/commerce/products/create.js +25 -0
  33. package/dist/commands/commerce/promotions/redeem.d.ts +13 -0
  34. package/dist/commands/commerce/promotions/redeem.js +32 -0
  35. package/dist/commands/commerce/terms/accept.d.ts +18 -0
  36. package/dist/commands/commerce/terms/accept.js +39 -0
  37. package/dist/commands/commerce/terms/show.d.ts +10 -0
  38. package/dist/commands/commerce/terms/show.js +34 -0
  39. package/dist/commands/commerce/trials/conversion-preview.d.ts +18 -0
  40. package/dist/commands/commerce/trials/conversion-preview.js +39 -0
  41. package/dist/commands/commerce/trials/start.d.ts +23 -0
  42. package/dist/commands/commerce/trials/start.js +58 -0
  43. package/dist/commands/commitments/accounting.d.ts +39 -0
  44. package/dist/commands/commitments/accounting.js +116 -0
  45. package/dist/commands/commitments/action-history.d.ts +1 -0
  46. package/dist/commands/commitments/action-history.js +8 -1
  47. package/dist/commands/commitments/case.d.ts +1 -0
  48. package/dist/commands/commitments/case.js +19 -3
  49. package/dist/commands/commitments/cases.d.ts +1 -0
  50. package/dist/commands/commitments/cases.js +11 -1
  51. package/dist/commands/commitments/checks.d.ts +1 -0
  52. package/dist/commands/commitments/checks.js +5 -1
  53. package/dist/commands/commitments/cost.d.ts +62 -0
  54. package/dist/commands/commitments/cost.js +130 -0
  55. package/dist/commands/commitments/create.js +1 -1
  56. package/dist/commands/commitments/delete.d.ts +1 -0
  57. package/dist/commands/commitments/delete.js +56 -6
  58. package/dist/commands/commitments/feedback.js +9 -1
  59. package/dist/commands/commitments/handover.js +16 -0
  60. package/dist/commands/commitments/hypotheses.d.ts +1 -0
  61. package/dist/commands/commitments/hypotheses.js +17 -2
  62. package/dist/commands/commitments/links/list.js +4 -1
  63. package/dist/commands/commitments/liveness.d.ts +18 -0
  64. package/dist/commands/commitments/liveness.js +80 -0
  65. package/dist/commands/commitments/metrics.d.ts +1 -0
  66. package/dist/commands/commitments/metrics.js +8 -1
  67. package/dist/commands/commitments/next-tick.d.ts +39 -0
  68. package/dist/commands/commitments/next-tick.js +122 -0
  69. package/dist/commands/commitments/observations.d.ts +1 -0
  70. package/dist/commands/commitments/observations.js +19 -2
  71. package/dist/commands/commitments/pause.js +12 -0
  72. package/dist/commands/commitments/receipt.d.ts +2 -0
  73. package/dist/commands/commitments/receipt.js +16 -2
  74. package/dist/commands/commitments/remediation-proposal.js +6 -2
  75. package/dist/commands/commitments/remediation-proposals.js +5 -1
  76. package/dist/commands/commitments/restore.d.ts +25 -0
  77. package/dist/commands/commitments/restore.js +46 -0
  78. package/dist/commands/commitments/show.js +32 -0
  79. package/dist/commands/commitments/trigger-status.js +33 -0
  80. package/dist/commands/commitments/update.d.ts +1 -0
  81. package/dist/commands/commitments/update.js +31 -5
  82. package/dist/commands/commitments/wake-capabilities.d.ts +0 -1
  83. package/dist/commands/commitments/wake-capabilities.js +8 -4
  84. package/dist/commands/enterprise/budgets/create.d.ts +11 -0
  85. package/dist/commands/enterprise/budgets/create.js +27 -0
  86. package/dist/commands/enterprise/budgets/evaluate.d.ts +17 -0
  87. package/dist/commands/enterprise/budgets/evaluate.js +32 -0
  88. package/dist/commands/enterprise/budgets/publish.d.ts +14 -0
  89. package/dist/commands/enterprise/budgets/publish.js +30 -0
  90. package/dist/commands/enterprise/contracts/activate.d.ts +14 -0
  91. package/dist/commands/enterprise/contracts/activate.js +30 -0
  92. package/dist/commands/enterprise/contracts/create.d.ts +14 -0
  93. package/dist/commands/enterprise/contracts/create.js +32 -0
  94. package/dist/commands/enterprise/contracts/issue.d.ts +18 -0
  95. package/dist/commands/enterprise/contracts/issue.js +34 -0
  96. package/dist/commands/enterprise/domains/begin.d.ts +20 -0
  97. package/dist/commands/enterprise/domains/begin.js +39 -0
  98. package/dist/commands/enterprise/domains/verify.d.ts +14 -0
  99. package/dist/commands/enterprise/domains/verify.js +32 -0
  100. package/dist/commands/enterprise/external-config/activate.d.ts +22 -0
  101. package/dist/commands/enterprise/external-config/activate.js +49 -0
  102. package/dist/commands/enterprise/external-config/set.d.ts +25 -0
  103. package/dist/commands/enterprise/external-config/set.js +123 -0
  104. package/dist/commands/enterprise/external-config/show.d.ts +12 -0
  105. package/dist/commands/enterprise/external-config/show.js +39 -0
  106. package/dist/commands/enterprise/external-config/suspend.d.ts +13 -0
  107. package/dist/commands/enterprise/external-config/suspend.js +41 -0
  108. package/dist/commands/enterprise/finance/close-snapshot.d.ts +11 -0
  109. package/dist/commands/enterprise/finance/close-snapshot.js +28 -0
  110. package/dist/commands/enterprise/finance/record-document.d.ts +18 -0
  111. package/dist/commands/enterprise/finance/record-document.js +35 -0
  112. package/dist/commands/enterprise/profile.d.ts +20 -0
  113. package/dist/commands/enterprise/profile.js +38 -0
  114. package/dist/commands/login.d.ts +13 -0
  115. package/dist/commands/login.js +77 -0
  116. package/dist/commands/machines/dedicated/index.js +3 -0
  117. package/dist/commands/machines/dedicated/service/apply.d.ts +23 -0
  118. package/dist/commands/machines/dedicated/service/apply.js +99 -0
  119. package/dist/commands/machines/dedicated/service/approve.d.ts +23 -0
  120. package/dist/commands/machines/dedicated/service/approve.js +52 -0
  121. package/dist/commands/machines/dedicated/service/create.d.ts +55 -0
  122. package/dist/commands/machines/dedicated/service/create.js +222 -0
  123. package/dist/commands/machines/dedicated/service/edit.d.ts +30 -0
  124. package/dist/commands/machines/dedicated/service/edit.js +146 -0
  125. package/dist/commands/machines/dedicated/service/exec.d.ts +26 -0
  126. package/dist/commands/machines/dedicated/service/exec.js +92 -0
  127. package/dist/commands/machines/dedicated/service/export.d.ts +29 -0
  128. package/dist/commands/machines/dedicated/service/export.js +106 -0
  129. package/dist/commands/machines/dedicated/service/index.d.ts +14 -0
  130. package/dist/commands/machines/dedicated/service/index.js +49 -0
  131. package/dist/commands/machines/dedicated/service/logs.d.ts +33 -0
  132. package/dist/commands/machines/dedicated/service/logs.js +148 -0
  133. package/dist/commands/machines/dedicated/service/ls.d.ts +20 -0
  134. package/dist/commands/machines/dedicated/service/ls.js +80 -0
  135. package/dist/commands/machines/dedicated/service/restart.d.ts +14 -0
  136. package/dist/commands/machines/dedicated/service/restart.js +29 -0
  137. package/dist/commands/machines/dedicated/service/rm.d.ts +20 -0
  138. package/dist/commands/machines/dedicated/service/rm.js +33 -0
  139. package/dist/commands/machines/dedicated/service/secret/index.d.ts +14 -0
  140. package/dist/commands/machines/dedicated/service/secret/index.js +25 -0
  141. package/dist/commands/machines/dedicated/service/secret/rm.d.ts +22 -0
  142. package/dist/commands/machines/dedicated/service/secret/rm.js +54 -0
  143. package/dist/commands/machines/dedicated/service/secret/set.d.ts +22 -0
  144. package/dist/commands/machines/dedicated/service/secret/set.js +93 -0
  145. package/dist/commands/machines/dedicated/service/start.d.ts +14 -0
  146. package/dist/commands/machines/dedicated/service/start.js +29 -0
  147. package/dist/commands/machines/dedicated/service/status.d.ts +21 -0
  148. package/dist/commands/machines/dedicated/service/status.js +85 -0
  149. package/dist/commands/machines/dedicated/service/stop.d.ts +20 -0
  150. package/dist/commands/machines/dedicated/service/stop.js +35 -0
  151. package/dist/commands/machines/dedicated/service/top.d.ts +22 -0
  152. package/dist/commands/machines/dedicated/service/top.js +120 -0
  153. package/dist/commands/machines/dedicated/sign-in-status.d.ts +22 -0
  154. package/dist/commands/machines/dedicated/sign-in-status.js +79 -0
  155. package/dist/commands/machines/dedicated/ssh-config.d.ts +28 -0
  156. package/dist/commands/machines/dedicated/ssh-config.js +66 -0
  157. package/dist/commands/machines/dedicated/ssh-proxy.d.ts +22 -0
  158. package/dist/commands/machines/dedicated/ssh-proxy.js +62 -0
  159. package/dist/commands/machines/dedicated/ssh.d.ts +29 -0
  160. package/dist/commands/machines/dedicated/ssh.js +121 -0
  161. package/dist/commands/native/allow-all.d.ts +14 -0
  162. package/dist/commands/native/allow-all.js +25 -0
  163. package/dist/commands/native/allow.d.ts +24 -0
  164. package/dist/commands/native/allow.js +45 -0
  165. package/dist/commands/native/deny.d.ts +24 -0
  166. package/dist/commands/native/deny.js +43 -0
  167. package/dist/commands/native/disable.d.ts +17 -0
  168. package/dist/commands/native/disable.js +28 -0
  169. package/dist/commands/native/enable.d.ts +12 -0
  170. package/dist/commands/native/enable.js +29 -0
  171. package/dist/commands/native/list-apps.d.ts +19 -0
  172. package/dist/commands/native/list-apps.js +30 -0
  173. package/dist/commands/native/restrict-to.d.ts +22 -0
  174. package/dist/commands/native/restrict-to.js +41 -0
  175. package/dist/commands/native/status.d.ts +19 -0
  176. package/dist/commands/native/status.js +33 -0
  177. package/dist/commands/native.d.ts +39 -0
  178. package/dist/commands/native.js +76 -0
  179. package/dist/commands/service/index.d.ts +14 -0
  180. package/dist/commands/service/index.js +31 -0
  181. package/dist/commands/service/logs.d.ts +18 -0
  182. package/dist/commands/service/logs.js +53 -0
  183. package/dist/commands/service/ls.d.ts +13 -0
  184. package/dist/commands/service/ls.js +48 -0
  185. package/dist/commands/service/propose.d.ts +34 -0
  186. package/dist/commands/service/propose.js +113 -0
  187. package/dist/commands/service/status.d.ts +17 -0
  188. package/dist/commands/service/status.js +56 -0
  189. package/dist/commands/spaces/auto-executor/runs.d.ts +13 -0
  190. package/dist/commands/spaces/auto-executor/runs.js +56 -0
  191. package/dist/commands/store/governance/artifacts.d.ts +25 -0
  192. package/dist/commands/store/governance/artifacts.js +55 -0
  193. package/dist/commands/store/governance/assign.d.ts +16 -0
  194. package/dist/commands/store/governance/assign.js +54 -0
  195. package/dist/commands/store/governance/create-license.d.ts +18 -0
  196. package/dist/commands/store/governance/create-license.js +35 -0
  197. package/dist/commands/store/governance/install-plan.d.ts +25 -0
  198. package/dist/commands/store/governance/install-plan.js +56 -0
  199. package/dist/commands/store/governance/license-policy.d.ts +30 -0
  200. package/dist/commands/store/governance/license-policy.js +69 -0
  201. package/dist/commands/store/governance/policy.d.ts +25 -0
  202. package/dist/commands/store/governance/policy.js +65 -0
  203. package/dist/commands/store/governance/publish-release.d.ts +17 -0
  204. package/dist/commands/store/governance/publish-release.js +34 -0
  205. package/dist/commands/tasks/deliverable/add.d.ts +15 -0
  206. package/dist/commands/tasks/deliverable/add.js +174 -0
  207. package/dist/commands/tasks/deliverable/archive.d.ts +35 -0
  208. package/dist/commands/tasks/deliverable/archive.js +205 -0
  209. package/dist/commands/tasks/labels/detach.js +3 -0
  210. package/dist/commands/tasks/labels/suggest.d.ts +24 -0
  211. package/dist/commands/tasks/labels/suggest.js +69 -0
  212. package/dist/commands/tasks/list.d.ts +16 -2
  213. package/dist/commands/tasks/list.js +100 -24
  214. package/dist/commands/tasks/show.d.ts +23 -0
  215. package/dist/commands/tasks/show.js +51 -1
  216. package/dist/commands/wiki/rm.d.ts +22 -1
  217. package/dist/commands/wiki/rm.js +52 -3
  218. package/dist/lib/agentic-stream.js +10 -2
  219. package/dist/lib/balance.d.ts +6 -1
  220. package/dist/lib/balance.js +15 -0
  221. package/dist/lib/commerce-command.d.ts +48 -0
  222. package/dist/lib/commerce-command.js +70 -0
  223. package/dist/lib/commerce.d.ts +93 -0
  224. package/dist/lib/commerce.js +129 -0
  225. package/dist/lib/commitment-product.js +1 -1
  226. package/dist/lib/commitments.d.ts +202 -29
  227. package/dist/lib/commitments.js +300 -33
  228. package/dist/lib/dedicated-lease-command.js +10 -0
  229. package/dist/lib/dedicated-machines.d.ts +37 -0
  230. package/dist/lib/dedicated-machines.js +47 -0
  231. package/dist/lib/dedicated-service-command.d.ts +60 -0
  232. package/dist/lib/dedicated-service-command.js +182 -0
  233. package/dist/lib/dedicated-service.d.ts +342 -0
  234. package/dist/lib/dedicated-service.js +741 -0
  235. package/dist/lib/dedicated-ssh.d.ts +136 -0
  236. package/dist/lib/dedicated-ssh.js +387 -0
  237. package/dist/lib/delegated-cli.js +51 -13
  238. package/dist/lib/enterprise-commerce.d.ts +67 -0
  239. package/dist/lib/enterprise-commerce.js +112 -0
  240. package/dist/lib/enterprise-external-configuration.d.ts +60 -0
  241. package/dist/lib/enterprise-external-configuration.js +58 -0
  242. package/dist/lib/first-party-harness.js +17 -3
  243. package/dist/lib/governed-store.d.ts +110 -0
  244. package/dist/lib/governed-store.js +79 -0
  245. package/dist/lib/guest-service-command.d.ts +16 -0
  246. package/dist/lib/guest-service-command.js +32 -0
  247. package/dist/lib/guest-service.d.ts +67 -0
  248. package/dist/lib/guest-service.js +112 -0
  249. package/dist/lib/prompt.d.ts +1 -0
  250. package/dist/lib/prompt.js +1 -0
  251. package/dist/lib/task-asset-upload.d.ts +20 -0
  252. package/dist/lib/task-asset-upload.js +30 -8
  253. package/dist/lib/task-extras.d.ts +23 -0
  254. package/dist/lib/task-extras.js +6 -0
  255. package/dist/node_modules/@skrr-ai/auth-core/dist/cjs/daemonScopes.d.ts +9 -3
  256. package/dist/node_modules/@skrr-ai/auth-core/dist/cjs/daemonScopes.js +10 -3
  257. package/dist/node_modules/@skrr-ai/auth-core/dist/cjs/index.d.ts +1 -1
  258. package/dist/node_modules/@skrr-ai/auth-core/dist/cjs/index.js +6 -5
  259. package/dist/node_modules/@skrr-ai/auth-core/dist/cjs/messages.d.ts +16 -0
  260. package/dist/node_modules/@skrr-ai/auth-core/dist/cjs/messages.js +21 -4
  261. package/dist/node_modules/@skrr-ai/auth-core/dist/cjs/spawnEnv.d.ts +1 -1
  262. package/dist/node_modules/@skrr-ai/auth-core/dist/cjs/spawnEnv.js +24 -2
  263. package/dist/node_modules/@skrr-ai/auth-core/dist/esm/daemonScopes.d.ts +9 -3
  264. package/dist/node_modules/@skrr-ai/auth-core/dist/esm/daemonScopes.js +10 -3
  265. package/dist/node_modules/@skrr-ai/auth-core/dist/esm/index.d.ts +1 -1
  266. package/dist/node_modules/@skrr-ai/auth-core/dist/esm/index.js +1 -1
  267. package/dist/node_modules/@skrr-ai/auth-core/dist/esm/messages.d.ts +16 -0
  268. package/dist/node_modules/@skrr-ai/auth-core/dist/esm/messages.js +20 -4
  269. package/dist/node_modules/@skrr-ai/auth-core/dist/esm/spawnEnv.d.ts +1 -1
  270. package/dist/node_modules/@skrr-ai/auth-core/dist/esm/spawnEnv.js +24 -2
  271. package/dist/node_modules/@skrr-ai/auth-core/package.json +1 -1
  272. package/dist/node_modules/@skrr-ai/data-provider/index.js +5060 -4827
  273. package/oclif.manifest.json +37416 -31416
  274. package/package.json +43 -1
@@ -0,0 +1,45 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ const core_1 = require("@oclif/core");
4
+ const base_command_1 = require("../../../base-command");
5
+ const commerce_1 = require("../../../lib/commerce");
6
+ const commerce_command_1 = require("../../../lib/commerce-command");
7
+ /**
8
+ * `skrr commerce incidents retry` — run a fulfillment reconciliation again.
9
+ *
10
+ * The id is a 64-char hex digest on the server, not an opaque row id: the
11
+ * reconciliation is addressed by WHAT it reconciles, which is what makes a
12
+ * retry idempotent rather than a second attempt at a different thing. The CLI
13
+ * does not validate the shape — a wrong id should be refused by the authority
14
+ * that owns the format, with its own message.
15
+ */
16
+ class CommerceIncidentsRetry extends base_command_1.BaseCommand {
17
+ static description = 'Retry a marketplace fulfillment reconciliation (admin). Running the work again — not a statement that somebody judged it; for that see `commerce incidents resolve`.';
18
+ static examples = [
19
+ '<%= config.bin %> commerce incidents retry <reconciliation-id>',
20
+ '<%= config.bin %> commerce incidents retry <reconciliation-id> --file ./retry.json',
21
+ ];
22
+ static args = {
23
+ reconciliation: core_1.Args.string({
24
+ description: 'Fulfillment reconciliation id',
25
+ required: true,
26
+ ignoreStdin: true,
27
+ }),
28
+ };
29
+ static flags = { ...commerce_command_1.jsonBodyFlags };
30
+ async run() {
31
+ this.requireAuth();
32
+ const { args, flags } = await this.parse(CommerceIncidentsRetry);
33
+ const body = await (0, commerce_command_1.jsonBodyFrom)(this, flags.file, { required: false });
34
+ let result;
35
+ try {
36
+ result = await (0, commerce_1.retryFulfillmentReconciliation)(args.reconciliation, body);
37
+ }
38
+ catch (error) {
39
+ this.handleApiError(error);
40
+ return;
41
+ }
42
+ this.log(JSON.stringify(result, null, 2));
43
+ }
44
+ }
45
+ exports.default = CommerceIncidentsRetry;
@@ -0,0 +1,13 @@
1
+ import { BaseCommand } from '../../../base-command';
2
+ export default class CommerceIncidentsShow extends BaseCommand {
3
+ static description: string;
4
+ static examples: string[];
5
+ static args: {
6
+ kind: import("@oclif/core/lib/interfaces").Arg<string, Record<string, unknown>>;
7
+ incident: import("@oclif/core/lib/interfaces").Arg<string, Record<string, unknown>>;
8
+ };
9
+ static flags: {
10
+ json: import("@oclif/core/lib/interfaces").BooleanFlag<boolean>;
11
+ };
12
+ run(): Promise<void>;
13
+ }
@@ -0,0 +1,30 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ const core_1 = require("@oclif/core");
4
+ const base_command_1 = require("../../../base-command");
5
+ const commerce_1 = require("../../../lib/commerce");
6
+ class CommerceIncidentsShow extends base_command_1.BaseCommand {
7
+ static description = 'Show one marketplace incident (admin).';
8
+ static examples = ['<%= config.bin %> commerce incidents show integrity <incident-id>'];
9
+ static args = {
10
+ kind: core_1.Args.string({ description: 'Incident kind', required: true, ignoreStdin: true }),
11
+ incident: core_1.Args.string({ description: 'Incident id', required: true, ignoreStdin: true }),
12
+ };
13
+ static flags = {
14
+ json: core_1.Flags.boolean({ description: 'Output as JSON' }),
15
+ };
16
+ async run() {
17
+ this.requireAuth();
18
+ const { args } = await this.parse(CommerceIncidentsShow);
19
+ let result;
20
+ try {
21
+ result = await (0, commerce_1.getMarketplaceIncident)(args.kind, args.incident);
22
+ }
23
+ catch (error) {
24
+ this.handleApiError(error);
25
+ return;
26
+ }
27
+ this.log(JSON.stringify(result, null, 2));
28
+ }
29
+ }
30
+ exports.default = CommerceIncidentsShow;
@@ -0,0 +1,17 @@
1
+ import { BaseCommand } from '../../../base-command';
2
+ /**
3
+ * Step 2: somebody signs off. The server records WHO from the credential, so
4
+ * there is no `--actor` here — an approval a caller could attribute to someone
5
+ * else is not an approval.
6
+ */
7
+ export default class CommerceOffersApprove extends BaseCommand {
8
+ static description: string;
9
+ static examples: string[];
10
+ static args: {
11
+ offer: import("@oclif/core/lib/interfaces").Arg<string, Record<string, unknown>>;
12
+ };
13
+ static flags: {
14
+ json: import("@oclif/core/lib/interfaces").BooleanFlag<boolean>;
15
+ };
16
+ run(): Promise<void>;
17
+ }
@@ -0,0 +1,33 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ const core_1 = require("@oclif/core");
4
+ const base_command_1 = require("../../../base-command");
5
+ const commerce_1 = require("../../../lib/commerce");
6
+ /**
7
+ * Step 2: somebody signs off. The server records WHO from the credential, so
8
+ * there is no `--actor` here — an approval a caller could attribute to someone
9
+ * else is not an approval.
10
+ */
11
+ class CommerceOffersApprove extends base_command_1.BaseCommand {
12
+ static description = 'Approve an offer version (admin). Recorded against you, from your credential — it still is not buyable until it is published.';
13
+ static examples = ['<%= config.bin %> commerce offers approve <offer-version-id>'];
14
+ static args = {
15
+ offer: core_1.Args.string({ description: 'Offer version id', required: true, ignoreStdin: true }),
16
+ };
17
+ static flags = { json: core_1.Flags.boolean({ description: 'Output as JSON' }) };
18
+ async run() {
19
+ this.requireAuth();
20
+ const { args } = await this.parse(CommerceOffersApprove);
21
+ let result;
22
+ try {
23
+ result = await (0, commerce_1.approveCommerceOffer)(args.offer);
24
+ }
25
+ catch (error) {
26
+ this.handleApiError(error);
27
+ return;
28
+ }
29
+ this.log(JSON.stringify(result, null, 2));
30
+ this.log('\nApproved, not published. Next: `commerce offers publish <offer-version-id>`.');
31
+ }
32
+ }
33
+ exports.default = CommerceOffersApprove;
@@ -0,0 +1,18 @@
1
+ import { BaseCommand } from '../../../base-command';
2
+ /**
3
+ * `skrr commerce offers create` — draft an offer VERSION.
4
+ *
5
+ * A version, not an offer: what gets validated, approved, published and
6
+ * retired is one immutable version, and the noun in the command matches the
7
+ * noun in the lifecycle so the four verbs below plainly apply to the thing
8
+ * this one made.
9
+ */
10
+ export default class CommerceOffersCreate extends BaseCommand {
11
+ static description: string;
12
+ static examples: string[];
13
+ static flags: {
14
+ file: import("@oclif/core/lib/interfaces").OptionFlag<string | undefined, import("@oclif/core/lib/interfaces").CustomOptions>;
15
+ json: import("@oclif/core/lib/interfaces").BooleanFlag<boolean>;
16
+ };
17
+ run(): Promise<void>;
18
+ }
@@ -0,0 +1,34 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ const base_command_1 = require("../../../base-command");
4
+ const commerce_1 = require("../../../lib/commerce");
5
+ const commerce_command_1 = require("../../../lib/commerce-command");
6
+ /**
7
+ * `skrr commerce offers create` — draft an offer VERSION.
8
+ *
9
+ * A version, not an offer: what gets validated, approved, published and
10
+ * retired is one immutable version, and the noun in the command matches the
11
+ * noun in the lifecycle so the four verbs below plainly apply to the thing
12
+ * this one made.
13
+ */
14
+ class CommerceOffersCreate extends base_command_1.BaseCommand {
15
+ static description = 'Create an offer version (admin). It is a draft: nothing is buyable until it has been validated, approved and published.';
16
+ static examples = ['<%= config.bin %> commerce offers create --file ./offer.json'];
17
+ static flags = { ...commerce_command_1.jsonBodyFlags };
18
+ async run() {
19
+ this.requireAuth();
20
+ const { flags } = await this.parse(CommerceOffersCreate);
21
+ const body = await (0, commerce_command_1.jsonBodyFrom)(this, flags.file);
22
+ let result;
23
+ try {
24
+ result = await (0, commerce_1.createCommerceOfferVersion)(body);
25
+ }
26
+ catch (error) {
27
+ this.handleApiError(error);
28
+ return;
29
+ }
30
+ this.log(JSON.stringify(result, null, 2));
31
+ this.log('\nDraft only. Next: `commerce offers validate <offer-version-id>`.');
32
+ }
33
+ }
34
+ exports.default = CommerceOffersCreate;
@@ -0,0 +1,13 @@
1
+ import { BaseCommand } from '../../../base-command';
2
+ /** Step 3: it becomes buyable. The first step in the pipeline a customer can see. */
3
+ export default class CommerceOffersPublish extends BaseCommand {
4
+ static description: string;
5
+ static examples: string[];
6
+ static args: {
7
+ offer: import("@oclif/core/lib/interfaces").Arg<string, Record<string, unknown>>;
8
+ };
9
+ static flags: {
10
+ json: import("@oclif/core/lib/interfaces").BooleanFlag<boolean>;
11
+ };
12
+ run(): Promise<void>;
13
+ }
@@ -0,0 +1,28 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ const core_1 = require("@oclif/core");
4
+ const base_command_1 = require("../../../base-command");
5
+ const commerce_1 = require("../../../lib/commerce");
6
+ /** Step 3: it becomes buyable. The first step in the pipeline a customer can see. */
7
+ class CommerceOffersPublish extends base_command_1.BaseCommand {
8
+ static description = 'Publish an approved offer version (admin) — from here it is buyable.';
9
+ static examples = ['<%= config.bin %> commerce offers publish <offer-version-id>'];
10
+ static args = {
11
+ offer: core_1.Args.string({ description: 'Offer version id', required: true, ignoreStdin: true }),
12
+ };
13
+ static flags = { json: core_1.Flags.boolean({ description: 'Output as JSON' }) };
14
+ async run() {
15
+ this.requireAuth();
16
+ const { args } = await this.parse(CommerceOffersPublish);
17
+ let result;
18
+ try {
19
+ result = await (0, commerce_1.publishCommerceOffer)(args.offer);
20
+ }
21
+ catch (error) {
22
+ this.handleApiError(error);
23
+ return;
24
+ }
25
+ this.log(JSON.stringify(result, null, 2));
26
+ }
27
+ }
28
+ exports.default = CommerceOffersPublish;
@@ -0,0 +1,17 @@
1
+ import { BaseCommand } from '../../../base-command';
2
+ /**
3
+ * The exit. Retiring stops an offer version being sold; it says nothing about
4
+ * what was already bought under it, which keeps existing entitlements the
5
+ * ledger's business rather than this command's.
6
+ */
7
+ export default class CommerceOffersRetire extends BaseCommand {
8
+ static description: string;
9
+ static examples: string[];
10
+ static args: {
11
+ offer: import("@oclif/core/lib/interfaces").Arg<string, Record<string, unknown>>;
12
+ };
13
+ static flags: {
14
+ json: import("@oclif/core/lib/interfaces").BooleanFlag<boolean>;
15
+ };
16
+ run(): Promise<void>;
17
+ }
@@ -0,0 +1,32 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ const core_1 = require("@oclif/core");
4
+ const base_command_1 = require("../../../base-command");
5
+ const commerce_1 = require("../../../lib/commerce");
6
+ /**
7
+ * The exit. Retiring stops an offer version being sold; it says nothing about
8
+ * what was already bought under it, which keeps existing entitlements the
9
+ * ledger's business rather than this command's.
10
+ */
11
+ class CommerceOffersRetire extends base_command_1.BaseCommand {
12
+ static description = 'Retire an offer version (admin) — it stops being buyable. Entitlements already granted under it are unaffected.';
13
+ static examples = ['<%= config.bin %> commerce offers retire <offer-version-id>'];
14
+ static args = {
15
+ offer: core_1.Args.string({ description: 'Offer version id', required: true, ignoreStdin: true }),
16
+ };
17
+ static flags = { json: core_1.Flags.boolean({ description: 'Output as JSON' }) };
18
+ async run() {
19
+ this.requireAuth();
20
+ const { args } = await this.parse(CommerceOffersRetire);
21
+ let result;
22
+ try {
23
+ result = await (0, commerce_1.retireCommerceOffer)(args.offer);
24
+ }
25
+ catch (error) {
26
+ this.handleApiError(error);
27
+ return;
28
+ }
29
+ this.log(JSON.stringify(result, null, 2));
30
+ }
31
+ }
32
+ exports.default = CommerceOffersRetire;
@@ -0,0 +1,18 @@
1
+ import { BaseCommand } from '../../../base-command';
2
+ /**
3
+ * Step 1 of the offer pipeline: is it READY to be approved?
4
+ *
5
+ * A read that writes — it records the readiness check against the version —
6
+ * and the safe one to run repeatedly. It does not approve anything.
7
+ */
8
+ export default class CommerceOffersValidate extends BaseCommand {
9
+ static description: string;
10
+ static examples: string[];
11
+ static args: {
12
+ offer: import("@oclif/core/lib/interfaces").Arg<string, Record<string, unknown>>;
13
+ };
14
+ static flags: {
15
+ json: import("@oclif/core/lib/interfaces").BooleanFlag<boolean>;
16
+ };
17
+ run(): Promise<void>;
18
+ }
@@ -0,0 +1,33 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ const core_1 = require("@oclif/core");
4
+ const base_command_1 = require("../../../base-command");
5
+ const commerce_1 = require("../../../lib/commerce");
6
+ /**
7
+ * Step 1 of the offer pipeline: is it READY to be approved?
8
+ *
9
+ * A read that writes — it records the readiness check against the version —
10
+ * and the safe one to run repeatedly. It does not approve anything.
11
+ */
12
+ class CommerceOffersValidate extends base_command_1.BaseCommand {
13
+ static description = 'Check whether an offer version is ready to be approved (admin). Records the readiness check; approves nothing.';
14
+ static examples = ['<%= config.bin %> commerce offers validate <offer-version-id>'];
15
+ static args = {
16
+ offer: core_1.Args.string({ description: 'Offer version id', required: true, ignoreStdin: true }),
17
+ };
18
+ static flags = { json: core_1.Flags.boolean({ description: 'Output as JSON' }) };
19
+ async run() {
20
+ this.requireAuth();
21
+ const { args } = await this.parse(CommerceOffersValidate);
22
+ let result;
23
+ try {
24
+ result = await (0, commerce_1.validateCommerceOffer)(args.offer);
25
+ }
26
+ catch (error) {
27
+ this.handleApiError(error);
28
+ return;
29
+ }
30
+ this.log(JSON.stringify(result, null, 2));
31
+ }
32
+ }
33
+ exports.default = CommerceOffersValidate;
@@ -0,0 +1,10 @@
1
+ import { BaseCommand } from '../../../base-command';
2
+ export default class CommerceProductsCreate extends BaseCommand {
3
+ static description: string;
4
+ static examples: string[];
5
+ static flags: {
6
+ file: import("@oclif/core/lib/interfaces").OptionFlag<string | undefined, import("@oclif/core/lib/interfaces").CustomOptions>;
7
+ json: import("@oclif/core/lib/interfaces").BooleanFlag<boolean>;
8
+ };
9
+ run(): Promise<void>;
10
+ }
@@ -0,0 +1,25 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ const base_command_1 = require("../../../base-command");
4
+ const commerce_1 = require("../../../lib/commerce");
5
+ const commerce_command_1 = require("../../../lib/commerce-command");
6
+ class CommerceProductsCreate extends base_command_1.BaseCommand {
7
+ static description = 'Create a commerce product (admin) — the thing offer versions are priced against.';
8
+ static examples = ['<%= config.bin %> commerce products create --file ./product.json'];
9
+ static flags = { ...commerce_command_1.jsonBodyFlags };
10
+ async run() {
11
+ this.requireAuth();
12
+ const { flags } = await this.parse(CommerceProductsCreate);
13
+ const body = await (0, commerce_command_1.jsonBodyFrom)(this, flags.file);
14
+ let result;
15
+ try {
16
+ result = await (0, commerce_1.createCommerceProduct)(body);
17
+ }
18
+ catch (error) {
19
+ this.handleApiError(error);
20
+ return;
21
+ }
22
+ this.log(JSON.stringify(result, null, 2));
23
+ }
24
+ }
25
+ exports.default = CommerceProductsCreate;
@@ -0,0 +1,13 @@
1
+ import { BaseCommand } from '../../../base-command';
2
+ /** Redeems against the calling account; the subject is never a field. */
3
+ export default class CommercePromotionsRedeem extends BaseCommand {
4
+ static description: string;
5
+ static examples: string[];
6
+ static args: {
7
+ offer: import("@oclif/core/lib/interfaces").Arg<string, Record<string, unknown>>;
8
+ };
9
+ static flags: {
10
+ json: import("@oclif/core/lib/interfaces").BooleanFlag<boolean>;
11
+ };
12
+ run(): Promise<void>;
13
+ }
@@ -0,0 +1,32 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ const core_1 = require("@oclif/core");
4
+ const base_command_1 = require("../../../base-command");
5
+ const commerce_1 = require("../../../lib/commerce");
6
+ /** Redeems against the calling account; the subject is never a field. */
7
+ class CommercePromotionsRedeem extends base_command_1.BaseCommand {
8
+ static description = 'Redeem a promotional offer version, for the account you are signed in as.';
9
+ static examples = ['<%= config.bin %> commerce promotions redeem <offer-version-id>'];
10
+ static args = {
11
+ offer: core_1.Args.string({
12
+ description: 'Promotional offer version id',
13
+ required: true,
14
+ ignoreStdin: true,
15
+ }),
16
+ };
17
+ static flags = { json: core_1.Flags.boolean({ description: 'Output as JSON' }) };
18
+ async run() {
19
+ this.requireAuth();
20
+ const { args } = await this.parse(CommercePromotionsRedeem);
21
+ let result;
22
+ try {
23
+ result = await (0, commerce_1.redeemCommercePromotion)(args.offer);
24
+ }
25
+ catch (error) {
26
+ this.handleApiError(error);
27
+ return;
28
+ }
29
+ this.log(JSON.stringify(result, null, 2));
30
+ }
31
+ }
32
+ exports.default = CommercePromotionsRedeem;
@@ -0,0 +1,18 @@
1
+ import { BaseCommand } from '../../../base-command';
2
+ /**
3
+ * `skrr commerce terms accept` — record that you accept the terms in force.
4
+ *
5
+ * The receipt names the exact terms VERSION and its content hash, so what it
6
+ * proves is that somebody accepted a specific document. That is why this
7
+ * command takes no version: you accept what is in force now, and
8
+ * `commerce terms show` is how you read it first.
9
+ */
10
+ export default class CommerceTermsAccept extends BaseCommand {
11
+ static description: string;
12
+ static examples: string[];
13
+ static flags: {
14
+ scope: import("@oclif/core/lib/interfaces").OptionFlag<string, import("@oclif/core/lib/interfaces").CustomOptions>;
15
+ json: import("@oclif/core/lib/interfaces").BooleanFlag<boolean>;
16
+ };
17
+ run(): Promise<void>;
18
+ }
@@ -0,0 +1,39 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ const core_1 = require("@oclif/core");
4
+ const base_command_1 = require("../../../base-command");
5
+ const commerce_1 = require("../../../lib/commerce");
6
+ /**
7
+ * `skrr commerce terms accept` — record that you accept the terms in force.
8
+ *
9
+ * The receipt names the exact terms VERSION and its content hash, so what it
10
+ * proves is that somebody accepted a specific document. That is why this
11
+ * command takes no version: you accept what is in force now, and
12
+ * `commerce terms show` is how you read it first.
13
+ */
14
+ class CommerceTermsAccept extends base_command_1.BaseCommand {
15
+ static description = 'Accept the marketplace terms currently in force. Records a receipt naming the exact version and content hash you accepted.';
16
+ static examples = ['<%= config.bin %> commerce terms accept --scope publisher'];
17
+ static flags = {
18
+ scope: core_1.Flags.string({
19
+ description: 'Which side you are accepting as',
20
+ options: ['buyer', 'publisher'],
21
+ required: true,
22
+ }),
23
+ json: core_1.Flags.boolean({ description: 'Output as JSON' }),
24
+ };
25
+ async run() {
26
+ this.requireAuth();
27
+ const { flags } = await this.parse(CommerceTermsAccept);
28
+ let result;
29
+ try {
30
+ result = await (0, commerce_1.acceptMarketplaceTerms)(flags.scope);
31
+ }
32
+ catch (error) {
33
+ this.handleApiError(error);
34
+ return;
35
+ }
36
+ this.log(JSON.stringify(result, null, 2));
37
+ }
38
+ }
39
+ exports.default = CommerceTermsAccept;
@@ -0,0 +1,10 @@
1
+ import { BaseCommand } from '../../../base-command';
2
+ export default class CommerceTermsShow extends BaseCommand {
3
+ static description: string;
4
+ static examples: string[];
5
+ static flags: {
6
+ scope: import("@oclif/core/lib/interfaces").OptionFlag<string, import("@oclif/core/lib/interfaces").CustomOptions>;
7
+ json: import("@oclif/core/lib/interfaces").BooleanFlag<boolean>;
8
+ };
9
+ run(): Promise<void>;
10
+ }
@@ -0,0 +1,34 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ const core_1 = require("@oclif/core");
4
+ const base_command_1 = require("../../../base-command");
5
+ const commerce_1 = require("../../../lib/commerce");
6
+ class CommerceTermsShow extends base_command_1.BaseCommand {
7
+ static description = 'Show the marketplace terms currently in force for one side of a deal.';
8
+ static examples = [
9
+ '<%= config.bin %> commerce terms show --scope buyer',
10
+ '<%= config.bin %> commerce terms show --scope publisher',
11
+ ];
12
+ static flags = {
13
+ scope: core_1.Flags.string({
14
+ description: 'Which side you are asking about',
15
+ options: ['buyer', 'publisher'],
16
+ required: true,
17
+ }),
18
+ json: core_1.Flags.boolean({ description: 'Output as JSON' }),
19
+ };
20
+ async run() {
21
+ this.requireAuth();
22
+ const { flags } = await this.parse(CommerceTermsShow);
23
+ let result;
24
+ try {
25
+ result = await (0, commerce_1.getMarketplaceTerms)(flags.scope);
26
+ }
27
+ catch (error) {
28
+ this.handleApiError(error);
29
+ return;
30
+ }
31
+ this.log(JSON.stringify(result, null, 2));
32
+ }
33
+ }
34
+ exports.default = CommerceTermsShow;
@@ -0,0 +1,18 @@
1
+ import { BaseCommand } from '../../../base-command';
2
+ /**
3
+ * What converting this trial would cost, before it converts itself.
4
+ *
5
+ * A pure read, and the one thing anybody in a trial actually wants to know.
6
+ * The subject comes from the credential, so it previews YOUR enrollment.
7
+ */
8
+ export default class CommerceTrialsConversionPreview extends BaseCommand {
9
+ static description: string;
10
+ static examples: string[];
11
+ static args: {
12
+ enrollment: import("@oclif/core/lib/interfaces").Arg<string, Record<string, unknown>>;
13
+ };
14
+ static flags: {
15
+ json: import("@oclif/core/lib/interfaces").BooleanFlag<boolean>;
16
+ };
17
+ run(): Promise<void>;
18
+ }
@@ -0,0 +1,39 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ const core_1 = require("@oclif/core");
4
+ const base_command_1 = require("../../../base-command");
5
+ const commerce_1 = require("../../../lib/commerce");
6
+ /**
7
+ * What converting this trial would cost, before it converts itself.
8
+ *
9
+ * A pure read, and the one thing anybody in a trial actually wants to know.
10
+ * The subject comes from the credential, so it previews YOUR enrollment.
11
+ */
12
+ class CommerceTrialsConversionPreview extends base_command_1.BaseCommand {
13
+ static description = 'Preview what converting a trial would cost, without converting it.';
14
+ static examples = [
15
+ '<%= config.bin %> commerce trials conversion-preview <enrollment-id>',
16
+ ];
17
+ static args = {
18
+ enrollment: core_1.Args.string({
19
+ description: 'Trial enrollment id',
20
+ required: true,
21
+ ignoreStdin: true,
22
+ }),
23
+ };
24
+ static flags = { json: core_1.Flags.boolean({ description: 'Output as JSON' }) };
25
+ async run() {
26
+ this.requireAuth();
27
+ const { args } = await this.parse(CommerceTrialsConversionPreview);
28
+ let result;
29
+ try {
30
+ result = await (0, commerce_1.previewCommerceTrialConversion)(args.enrollment);
31
+ }
32
+ catch (error) {
33
+ this.handleApiError(error);
34
+ return;
35
+ }
36
+ this.log(JSON.stringify(result, null, 2));
37
+ }
38
+ }
39
+ exports.default = CommerceTrialsConversionPreview;
@@ -0,0 +1,23 @@
1
+ import { BaseCommand } from '../../../base-command';
2
+ /**
3
+ * `skrr commerce trials start` — enrol in a trial.
4
+ *
5
+ * Enrols YOU. The server takes the subject from the credential and there is no
6
+ * flag for it, so this command cannot start a trial on somebody else's
7
+ * account — which is the only property here worth protecting.
8
+ *
9
+ * `--file` carries the optional conversion consent, a structured object with
10
+ * its own id and timestamp. Consent is exactly the kind of thing that must not
11
+ * be assembled from loose flags: it is a record of what somebody agreed to.
12
+ */
13
+ export default class CommerceTrialsStart extends BaseCommand {
14
+ static description: string;
15
+ static examples: string[];
16
+ static flags: {
17
+ 'offer-version': import("@oclif/core/lib/interfaces").OptionFlag<string, import("@oclif/core/lib/interfaces").CustomOptions>;
18
+ 'payment-method-evidence': import("@oclif/core/lib/interfaces").OptionFlag<string | undefined, import("@oclif/core/lib/interfaces").CustomOptions>;
19
+ file: import("@oclif/core/lib/interfaces").OptionFlag<string | undefined, import("@oclif/core/lib/interfaces").CustomOptions>;
20
+ json: import("@oclif/core/lib/interfaces").BooleanFlag<boolean>;
21
+ };
22
+ run(): Promise<void>;
23
+ }