@skrr-ai/cli 0.1.47 → 0.1.49
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/README.md +1 -1
- package/dist/base-command.d.ts +18 -0
- package/dist/base-command.js +61 -1
- package/dist/commands/agent-worker.d.ts +12 -0
- package/dist/commands/agent-worker.js +140 -0
- package/dist/commands/agents/chat.d.ts +21 -0
- package/dist/commands/agents/chat.js +26 -9
- package/dist/commands/balance/usage/breakdown.d.ts +14 -0
- package/dist/commands/balance/usage/breakdown.js +68 -0
- package/dist/commands/balance/usage.js +24 -0
- package/dist/commands/commerce/entitlements/explain.d.ts +22 -0
- package/dist/commands/commerce/entitlements/explain.js +40 -0
- package/dist/commands/commerce/incidents/audit.d.ts +20 -0
- package/dist/commands/commerce/incidents/audit.js +37 -0
- package/dist/commands/commerce/incidents/list.d.ts +22 -0
- package/dist/commands/commerce/incidents/list.js +49 -0
- package/dist/commands/commerce/incidents/resolve.d.ts +23 -0
- package/dist/commands/commerce/incidents/resolve.js +45 -0
- package/dist/commands/commerce/incidents/retry.d.ts +22 -0
- package/dist/commands/commerce/incidents/retry.js +45 -0
- package/dist/commands/commerce/incidents/show.d.ts +13 -0
- package/dist/commands/commerce/incidents/show.js +30 -0
- package/dist/commands/commerce/offers/approve.d.ts +17 -0
- package/dist/commands/commerce/offers/approve.js +33 -0
- package/dist/commands/commerce/offers/create.d.ts +18 -0
- package/dist/commands/commerce/offers/create.js +34 -0
- package/dist/commands/commerce/offers/publish.d.ts +13 -0
- package/dist/commands/commerce/offers/publish.js +28 -0
- package/dist/commands/commerce/offers/retire.d.ts +17 -0
- package/dist/commands/commerce/offers/retire.js +32 -0
- package/dist/commands/commerce/offers/validate.d.ts +18 -0
- package/dist/commands/commerce/offers/validate.js +33 -0
- package/dist/commands/commerce/products/create.d.ts +10 -0
- package/dist/commands/commerce/products/create.js +25 -0
- package/dist/commands/commerce/promotions/redeem.d.ts +13 -0
- package/dist/commands/commerce/promotions/redeem.js +32 -0
- package/dist/commands/commerce/terms/accept.d.ts +18 -0
- package/dist/commands/commerce/terms/accept.js +39 -0
- package/dist/commands/commerce/terms/show.d.ts +10 -0
- package/dist/commands/commerce/terms/show.js +34 -0
- package/dist/commands/commerce/trials/conversion-preview.d.ts +18 -0
- package/dist/commands/commerce/trials/conversion-preview.js +39 -0
- package/dist/commands/commerce/trials/start.d.ts +23 -0
- package/dist/commands/commerce/trials/start.js +58 -0
- package/dist/commands/commitments/accounting.d.ts +39 -0
- package/dist/commands/commitments/accounting.js +116 -0
- package/dist/commands/commitments/action-history.d.ts +1 -0
- package/dist/commands/commitments/action-history.js +8 -1
- package/dist/commands/commitments/case.d.ts +1 -0
- package/dist/commands/commitments/case.js +19 -3
- package/dist/commands/commitments/cases.d.ts +1 -0
- package/dist/commands/commitments/cases.js +11 -1
- package/dist/commands/commitments/checks.d.ts +1 -0
- package/dist/commands/commitments/checks.js +5 -1
- package/dist/commands/commitments/cost.d.ts +62 -0
- package/dist/commands/commitments/cost.js +130 -0
- package/dist/commands/commitments/create.js +1 -1
- package/dist/commands/commitments/delete.d.ts +1 -0
- package/dist/commands/commitments/delete.js +56 -6
- package/dist/commands/commitments/feedback.js +9 -1
- package/dist/commands/commitments/handover.js +16 -0
- package/dist/commands/commitments/hypotheses.d.ts +1 -0
- package/dist/commands/commitments/hypotheses.js +17 -2
- package/dist/commands/commitments/links/list.js +4 -1
- package/dist/commands/commitments/liveness.d.ts +18 -0
- package/dist/commands/commitments/liveness.js +80 -0
- package/dist/commands/commitments/metrics.d.ts +1 -0
- package/dist/commands/commitments/metrics.js +8 -1
- package/dist/commands/commitments/next-tick.d.ts +39 -0
- package/dist/commands/commitments/next-tick.js +122 -0
- package/dist/commands/commitments/observations.d.ts +1 -0
- package/dist/commands/commitments/observations.js +19 -2
- package/dist/commands/commitments/pause.js +12 -0
- package/dist/commands/commitments/receipt.d.ts +2 -0
- package/dist/commands/commitments/receipt.js +16 -2
- package/dist/commands/commitments/remediation-proposal.js +6 -2
- package/dist/commands/commitments/remediation-proposals.js +5 -1
- package/dist/commands/commitments/restore.d.ts +25 -0
- package/dist/commands/commitments/restore.js +46 -0
- package/dist/commands/commitments/show.js +32 -0
- package/dist/commands/commitments/trigger-status.js +33 -0
- package/dist/commands/commitments/update.d.ts +1 -0
- package/dist/commands/commitments/update.js +31 -5
- package/dist/commands/commitments/wake-capabilities.d.ts +0 -1
- package/dist/commands/commitments/wake-capabilities.js +8 -4
- package/dist/commands/enterprise/budgets/create.d.ts +11 -0
- package/dist/commands/enterprise/budgets/create.js +27 -0
- package/dist/commands/enterprise/budgets/evaluate.d.ts +17 -0
- package/dist/commands/enterprise/budgets/evaluate.js +32 -0
- package/dist/commands/enterprise/budgets/publish.d.ts +14 -0
- package/dist/commands/enterprise/budgets/publish.js +30 -0
- package/dist/commands/enterprise/contracts/activate.d.ts +14 -0
- package/dist/commands/enterprise/contracts/activate.js +30 -0
- package/dist/commands/enterprise/contracts/create.d.ts +14 -0
- package/dist/commands/enterprise/contracts/create.js +32 -0
- package/dist/commands/enterprise/contracts/issue.d.ts +18 -0
- package/dist/commands/enterprise/contracts/issue.js +34 -0
- package/dist/commands/enterprise/domains/begin.d.ts +20 -0
- package/dist/commands/enterprise/domains/begin.js +39 -0
- package/dist/commands/enterprise/domains/verify.d.ts +14 -0
- package/dist/commands/enterprise/domains/verify.js +32 -0
- package/dist/commands/enterprise/external-config/activate.d.ts +22 -0
- package/dist/commands/enterprise/external-config/activate.js +49 -0
- package/dist/commands/enterprise/external-config/set.d.ts +25 -0
- package/dist/commands/enterprise/external-config/set.js +123 -0
- package/dist/commands/enterprise/external-config/show.d.ts +12 -0
- package/dist/commands/enterprise/external-config/show.js +39 -0
- package/dist/commands/enterprise/external-config/suspend.d.ts +13 -0
- package/dist/commands/enterprise/external-config/suspend.js +41 -0
- package/dist/commands/enterprise/finance/close-snapshot.d.ts +11 -0
- package/dist/commands/enterprise/finance/close-snapshot.js +28 -0
- package/dist/commands/enterprise/finance/record-document.d.ts +18 -0
- package/dist/commands/enterprise/finance/record-document.js +35 -0
- package/dist/commands/enterprise/profile.d.ts +20 -0
- package/dist/commands/enterprise/profile.js +38 -0
- package/dist/commands/login.d.ts +13 -0
- package/dist/commands/login.js +77 -0
- package/dist/commands/machines/dedicated/index.js +3 -0
- package/dist/commands/machines/dedicated/service/apply.d.ts +23 -0
- package/dist/commands/machines/dedicated/service/apply.js +99 -0
- package/dist/commands/machines/dedicated/service/approve.d.ts +23 -0
- package/dist/commands/machines/dedicated/service/approve.js +52 -0
- package/dist/commands/machines/dedicated/service/create.d.ts +55 -0
- package/dist/commands/machines/dedicated/service/create.js +222 -0
- package/dist/commands/machines/dedicated/service/edit.d.ts +30 -0
- package/dist/commands/machines/dedicated/service/edit.js +146 -0
- package/dist/commands/machines/dedicated/service/exec.d.ts +26 -0
- package/dist/commands/machines/dedicated/service/exec.js +92 -0
- package/dist/commands/machines/dedicated/service/export.d.ts +29 -0
- package/dist/commands/machines/dedicated/service/export.js +106 -0
- package/dist/commands/machines/dedicated/service/index.d.ts +14 -0
- package/dist/commands/machines/dedicated/service/index.js +49 -0
- package/dist/commands/machines/dedicated/service/logs.d.ts +33 -0
- package/dist/commands/machines/dedicated/service/logs.js +148 -0
- package/dist/commands/machines/dedicated/service/ls.d.ts +20 -0
- package/dist/commands/machines/dedicated/service/ls.js +80 -0
- package/dist/commands/machines/dedicated/service/restart.d.ts +14 -0
- package/dist/commands/machines/dedicated/service/restart.js +29 -0
- package/dist/commands/machines/dedicated/service/rm.d.ts +20 -0
- package/dist/commands/machines/dedicated/service/rm.js +33 -0
- package/dist/commands/machines/dedicated/service/secret/index.d.ts +14 -0
- package/dist/commands/machines/dedicated/service/secret/index.js +25 -0
- package/dist/commands/machines/dedicated/service/secret/rm.d.ts +22 -0
- package/dist/commands/machines/dedicated/service/secret/rm.js +54 -0
- package/dist/commands/machines/dedicated/service/secret/set.d.ts +22 -0
- package/dist/commands/machines/dedicated/service/secret/set.js +93 -0
- package/dist/commands/machines/dedicated/service/start.d.ts +14 -0
- package/dist/commands/machines/dedicated/service/start.js +29 -0
- package/dist/commands/machines/dedicated/service/status.d.ts +21 -0
- package/dist/commands/machines/dedicated/service/status.js +85 -0
- package/dist/commands/machines/dedicated/service/stop.d.ts +20 -0
- package/dist/commands/machines/dedicated/service/stop.js +35 -0
- package/dist/commands/machines/dedicated/service/top.d.ts +22 -0
- package/dist/commands/machines/dedicated/service/top.js +120 -0
- package/dist/commands/machines/dedicated/sign-in-status.d.ts +22 -0
- package/dist/commands/machines/dedicated/sign-in-status.js +79 -0
- package/dist/commands/machines/dedicated/ssh-config.d.ts +28 -0
- package/dist/commands/machines/dedicated/ssh-config.js +66 -0
- package/dist/commands/machines/dedicated/ssh-proxy.d.ts +22 -0
- package/dist/commands/machines/dedicated/ssh-proxy.js +62 -0
- package/dist/commands/machines/dedicated/ssh.d.ts +29 -0
- package/dist/commands/machines/dedicated/ssh.js +121 -0
- package/dist/commands/native/allow-all.d.ts +14 -0
- package/dist/commands/native/allow-all.js +25 -0
- package/dist/commands/native/allow.d.ts +24 -0
- package/dist/commands/native/allow.js +45 -0
- package/dist/commands/native/deny.d.ts +24 -0
- package/dist/commands/native/deny.js +43 -0
- package/dist/commands/native/disable.d.ts +17 -0
- package/dist/commands/native/disable.js +28 -0
- package/dist/commands/native/enable.d.ts +12 -0
- package/dist/commands/native/enable.js +29 -0
- package/dist/commands/native/list-apps.d.ts +19 -0
- package/dist/commands/native/list-apps.js +30 -0
- package/dist/commands/native/restrict-to.d.ts +22 -0
- package/dist/commands/native/restrict-to.js +41 -0
- package/dist/commands/native/status.d.ts +19 -0
- package/dist/commands/native/status.js +33 -0
- package/dist/commands/native.d.ts +39 -0
- package/dist/commands/native.js +76 -0
- package/dist/commands/service/index.d.ts +14 -0
- package/dist/commands/service/index.js +31 -0
- package/dist/commands/service/logs.d.ts +18 -0
- package/dist/commands/service/logs.js +53 -0
- package/dist/commands/service/ls.d.ts +13 -0
- package/dist/commands/service/ls.js +48 -0
- package/dist/commands/service/propose.d.ts +34 -0
- package/dist/commands/service/propose.js +113 -0
- package/dist/commands/service/status.d.ts +17 -0
- package/dist/commands/service/status.js +56 -0
- package/dist/commands/spaces/auto-executor/runs.d.ts +13 -0
- package/dist/commands/spaces/auto-executor/runs.js +56 -0
- package/dist/commands/store/governance/artifacts.d.ts +25 -0
- package/dist/commands/store/governance/artifacts.js +55 -0
- package/dist/commands/store/governance/assign.d.ts +16 -0
- package/dist/commands/store/governance/assign.js +54 -0
- package/dist/commands/store/governance/create-license.d.ts +18 -0
- package/dist/commands/store/governance/create-license.js +35 -0
- package/dist/commands/store/governance/install-plan.d.ts +25 -0
- package/dist/commands/store/governance/install-plan.js +56 -0
- package/dist/commands/store/governance/license-policy.d.ts +30 -0
- package/dist/commands/store/governance/license-policy.js +69 -0
- package/dist/commands/store/governance/policy.d.ts +25 -0
- package/dist/commands/store/governance/policy.js +65 -0
- package/dist/commands/store/governance/publish-release.d.ts +17 -0
- package/dist/commands/store/governance/publish-release.js +34 -0
- package/dist/commands/tasks/deliverable/add.d.ts +15 -0
- package/dist/commands/tasks/deliverable/add.js +174 -0
- package/dist/commands/tasks/deliverable/archive.d.ts +35 -0
- package/dist/commands/tasks/deliverable/archive.js +205 -0
- package/dist/commands/tasks/labels/detach.js +3 -0
- package/dist/commands/tasks/labels/suggest.d.ts +24 -0
- package/dist/commands/tasks/labels/suggest.js +69 -0
- package/dist/commands/tasks/list.d.ts +16 -2
- package/dist/commands/tasks/list.js +100 -24
- package/dist/commands/tasks/show.d.ts +23 -0
- package/dist/commands/tasks/show.js +51 -1
- package/dist/commands/wiki/rm.d.ts +22 -1
- package/dist/commands/wiki/rm.js +52 -3
- package/dist/lib/agentic-stream.js +10 -2
- package/dist/lib/balance.d.ts +6 -1
- package/dist/lib/balance.js +15 -0
- package/dist/lib/commerce-command.d.ts +48 -0
- package/dist/lib/commerce-command.js +70 -0
- package/dist/lib/commerce.d.ts +93 -0
- package/dist/lib/commerce.js +129 -0
- package/dist/lib/commitment-product.js +1 -1
- package/dist/lib/commitments.d.ts +202 -29
- package/dist/lib/commitments.js +300 -33
- package/dist/lib/daemon-installer.d.ts +6 -5
- package/dist/lib/daemon-installer.js +4 -17
- package/dist/lib/dedicated-lease-command.js +10 -0
- package/dist/lib/dedicated-machines.d.ts +37 -0
- package/dist/lib/dedicated-machines.js +47 -0
- package/dist/lib/dedicated-service-command.d.ts +60 -0
- package/dist/lib/dedicated-service-command.js +182 -0
- package/dist/lib/dedicated-service.d.ts +342 -0
- package/dist/lib/dedicated-service.js +741 -0
- package/dist/lib/dedicated-ssh.d.ts +136 -0
- package/dist/lib/dedicated-ssh.js +387 -0
- package/dist/lib/delegated-cli.js +51 -13
- package/dist/lib/enterprise-commerce.d.ts +67 -0
- package/dist/lib/enterprise-commerce.js +112 -0
- package/dist/lib/enterprise-external-configuration.d.ts +60 -0
- package/dist/lib/enterprise-external-configuration.js +58 -0
- package/dist/lib/first-party-harness.js +17 -3
- package/dist/lib/governed-store.d.ts +110 -0
- package/dist/lib/governed-store.js +79 -0
- package/dist/lib/guest-service-command.d.ts +16 -0
- package/dist/lib/guest-service-command.js +32 -0
- package/dist/lib/guest-service.d.ts +67 -0
- package/dist/lib/guest-service.js +112 -0
- package/dist/lib/prompt.d.ts +1 -0
- package/dist/lib/prompt.js +1 -0
- package/dist/lib/task-asset-upload.d.ts +20 -0
- package/dist/lib/task-asset-upload.js +30 -8
- package/dist/lib/task-extras.d.ts +23 -0
- package/dist/lib/task-extras.js +6 -0
- package/dist/node_modules/@skrr-ai/auth-core/dist/cjs/daemonScopes.d.ts +9 -3
- package/dist/node_modules/@skrr-ai/auth-core/dist/cjs/daemonScopes.js +10 -3
- package/dist/node_modules/@skrr-ai/auth-core/dist/cjs/firstPartyHarness.d.ts +1 -1
- package/dist/node_modules/@skrr-ai/auth-core/dist/cjs/firstPartyHarness.js +1 -1
- package/dist/node_modules/@skrr-ai/auth-core/dist/cjs/index.d.ts +2 -2
- package/dist/node_modules/@skrr-ai/auth-core/dist/cjs/index.js +8 -5
- package/dist/node_modules/@skrr-ai/auth-core/dist/cjs/messages.d.ts +16 -0
- package/dist/node_modules/@skrr-ai/auth-core/dist/cjs/messages.js +21 -4
- package/dist/node_modules/@skrr-ai/auth-core/dist/cjs/releaseManifest.d.ts +38 -0
- package/dist/node_modules/@skrr-ai/auth-core/dist/cjs/releaseManifest.js +66 -1
- package/dist/node_modules/@skrr-ai/auth-core/dist/cjs/spawnEnv.d.ts +1 -1
- package/dist/node_modules/@skrr-ai/auth-core/dist/cjs/spawnEnv.js +24 -2
- package/dist/node_modules/@skrr-ai/auth-core/dist/esm/daemonScopes.d.ts +9 -3
- package/dist/node_modules/@skrr-ai/auth-core/dist/esm/daemonScopes.js +10 -3
- package/dist/node_modules/@skrr-ai/auth-core/dist/esm/firstPartyHarness.d.ts +1 -1
- package/dist/node_modules/@skrr-ai/auth-core/dist/esm/firstPartyHarness.js +1 -1
- package/dist/node_modules/@skrr-ai/auth-core/dist/esm/index.d.ts +2 -2
- package/dist/node_modules/@skrr-ai/auth-core/dist/esm/index.js +2 -2
- package/dist/node_modules/@skrr-ai/auth-core/dist/esm/messages.d.ts +16 -0
- package/dist/node_modules/@skrr-ai/auth-core/dist/esm/messages.js +20 -4
- package/dist/node_modules/@skrr-ai/auth-core/dist/esm/releaseManifest.d.ts +38 -0
- package/dist/node_modules/@skrr-ai/auth-core/dist/esm/releaseManifest.js +64 -0
- package/dist/node_modules/@skrr-ai/auth-core/dist/esm/spawnEnv.d.ts +1 -1
- package/dist/node_modules/@skrr-ai/auth-core/dist/esm/spawnEnv.js +24 -2
- package/dist/node_modules/@skrr-ai/auth-core/package.json +1 -1
- package/dist/node_modules/@skrr-ai/data-provider/index.js +5060 -4827
- package/oclif.manifest.json +35194 -29157
- package/package.json +43 -1
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import { BaseCommand } from '../../../base-command';
|
|
2
|
+
/**
|
|
3
|
+
* `skrr commerce incidents list <kind>` — the marketplace incident queue.
|
|
4
|
+
*
|
|
5
|
+
* `kind` stays a free positional rather than an enum here: the server owns the
|
|
6
|
+
* set of incident kinds, and hard-coding it in the CLI is the second
|
|
7
|
+
* declaration that drifts. An unknown kind is refused by the API with its own
|
|
8
|
+
* message, which is more useful than a stale list of options.
|
|
9
|
+
*/
|
|
10
|
+
export default class CommerceIncidentsList extends BaseCommand {
|
|
11
|
+
static description: string;
|
|
12
|
+
static examples: string[];
|
|
13
|
+
static args: {
|
|
14
|
+
kind: import("@oclif/core/lib/interfaces").Arg<string, Record<string, unknown>>;
|
|
15
|
+
};
|
|
16
|
+
static flags: {
|
|
17
|
+
status: import("@oclif/core/lib/interfaces").OptionFlag<string | undefined, import("@oclif/core/lib/interfaces").CustomOptions>;
|
|
18
|
+
limit: import("@oclif/core/lib/interfaces").OptionFlag<number | undefined, import("@oclif/core/lib/interfaces").CustomOptions>;
|
|
19
|
+
json: import("@oclif/core/lib/interfaces").BooleanFlag<boolean>;
|
|
20
|
+
};
|
|
21
|
+
run(): Promise<void>;
|
|
22
|
+
}
|
|
@@ -0,0 +1,49 @@
|
|
|
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 incidents list <kind>` — the marketplace incident queue.
|
|
8
|
+
*
|
|
9
|
+
* `kind` stays a free positional rather than an enum here: the server owns the
|
|
10
|
+
* set of incident kinds, and hard-coding it in the CLI is the second
|
|
11
|
+
* declaration that drifts. An unknown kind is refused by the API with its own
|
|
12
|
+
* message, which is more useful than a stale list of options.
|
|
13
|
+
*/
|
|
14
|
+
class CommerceIncidentsList extends base_command_1.BaseCommand {
|
|
15
|
+
static description = 'List marketplace incidents of one kind — the queue an operator triages (admin).';
|
|
16
|
+
static examples = [
|
|
17
|
+
'<%= config.bin %> commerce incidents list integrity',
|
|
18
|
+
'<%= config.bin %> commerce incidents list fulfillment --limit 50',
|
|
19
|
+
];
|
|
20
|
+
static args = {
|
|
21
|
+
kind: core_1.Args.string({
|
|
22
|
+
description: 'Incident kind, as the API defines it (e.g. integrity, fulfillment)',
|
|
23
|
+
required: true,
|
|
24
|
+
ignoreStdin: true,
|
|
25
|
+
}),
|
|
26
|
+
};
|
|
27
|
+
static flags = {
|
|
28
|
+
status: core_1.Flags.string({ description: 'Filter by status, when the API supports one' }),
|
|
29
|
+
limit: core_1.Flags.integer({ description: 'Maximum rows to return' }),
|
|
30
|
+
json: core_1.Flags.boolean({ description: 'Output as JSON' }),
|
|
31
|
+
};
|
|
32
|
+
async run() {
|
|
33
|
+
this.requireAuth();
|
|
34
|
+
const { args, flags } = await this.parse(CommerceIncidentsList);
|
|
35
|
+
let result;
|
|
36
|
+
try {
|
|
37
|
+
result = await (0, commerce_1.listMarketplaceIncidents)(args.kind, {
|
|
38
|
+
status: flags.status,
|
|
39
|
+
limit: flags.limit,
|
|
40
|
+
});
|
|
41
|
+
}
|
|
42
|
+
catch (error) {
|
|
43
|
+
this.handleApiError(error);
|
|
44
|
+
return;
|
|
45
|
+
}
|
|
46
|
+
this.log(JSON.stringify(result, null, 2));
|
|
47
|
+
}
|
|
48
|
+
}
|
|
49
|
+
exports.default = CommerceIncidentsList;
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import { BaseCommand } from '../../../base-command';
|
|
2
|
+
/**
|
|
3
|
+
* `skrr commerce incidents resolve` — close an INTEGRITY incident.
|
|
4
|
+
*
|
|
5
|
+
* Integrity only, and not a flag on a generic verb. A fulfillment problem is
|
|
6
|
+
* RETRIED — the work runs again and the system decides. An integrity incident
|
|
7
|
+
* is RESOLVED — a person looked and stated a conclusion. Those are different
|
|
8
|
+
* acts with different evidence behind them, and a single `incidents fix` that
|
|
9
|
+
* chose between them by inspecting the kind would let a retry be recorded as a
|
|
10
|
+
* human judgement.
|
|
11
|
+
*/
|
|
12
|
+
export default class CommerceIncidentsResolve extends BaseCommand {
|
|
13
|
+
static description: string;
|
|
14
|
+
static examples: string[];
|
|
15
|
+
static args: {
|
|
16
|
+
incident: import("@oclif/core/lib/interfaces").Arg<string, Record<string, unknown>>;
|
|
17
|
+
};
|
|
18
|
+
static flags: {
|
|
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
|
+
}
|
|
@@ -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 resolve` — close an INTEGRITY incident.
|
|
9
|
+
*
|
|
10
|
+
* Integrity only, and not a flag on a generic verb. A fulfillment problem is
|
|
11
|
+
* RETRIED — the work runs again and the system decides. An integrity incident
|
|
12
|
+
* is RESOLVED — a person looked and stated a conclusion. Those are different
|
|
13
|
+
* acts with different evidence behind them, and a single `incidents fix` that
|
|
14
|
+
* chose between them by inspecting the kind would let a retry be recorded as a
|
|
15
|
+
* human judgement.
|
|
16
|
+
*/
|
|
17
|
+
class CommerceIncidentsResolve extends base_command_1.BaseCommand {
|
|
18
|
+
static description = 'Resolve an integrity incident with a stated resolution (admin). For a fulfillment problem use `commerce incidents retry` — running the work again is not the same act as somebody deciding.';
|
|
19
|
+
static examples = [
|
|
20
|
+
'<%= config.bin %> commerce incidents resolve <incident-id> --file ./resolution.json',
|
|
21
|
+
];
|
|
22
|
+
static args = {
|
|
23
|
+
incident: core_1.Args.string({
|
|
24
|
+
description: 'Integrity incident 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(CommerceIncidentsResolve);
|
|
33
|
+
const body = await (0, commerce_command_1.jsonBodyFrom)(this, flags.file);
|
|
34
|
+
let result;
|
|
35
|
+
try {
|
|
36
|
+
result = await (0, commerce_1.resolveIntegrityIncident)(args.incident, 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 = CommerceIncidentsResolve;
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import { BaseCommand } from '../../../base-command';
|
|
2
|
+
/**
|
|
3
|
+
* `skrr commerce incidents retry` — run a fulfillment reconciliation again.
|
|
4
|
+
*
|
|
5
|
+
* The id is a 64-char hex digest on the server, not an opaque row id: the
|
|
6
|
+
* reconciliation is addressed by WHAT it reconciles, which is what makes a
|
|
7
|
+
* retry idempotent rather than a second attempt at a different thing. The CLI
|
|
8
|
+
* does not validate the shape — a wrong id should be refused by the authority
|
|
9
|
+
* that owns the format, with its own message.
|
|
10
|
+
*/
|
|
11
|
+
export default class CommerceIncidentsRetry extends BaseCommand {
|
|
12
|
+
static description: string;
|
|
13
|
+
static examples: string[];
|
|
14
|
+
static args: {
|
|
15
|
+
reconciliation: import("@oclif/core/lib/interfaces").Arg<string, Record<string, unknown>>;
|
|
16
|
+
};
|
|
17
|
+
static flags: {
|
|
18
|
+
file: import("@oclif/core/lib/interfaces").OptionFlag<string | undefined, import("@oclif/core/lib/interfaces").CustomOptions>;
|
|
19
|
+
json: import("@oclif/core/lib/interfaces").BooleanFlag<boolean>;
|
|
20
|
+
};
|
|
21
|
+
run(): Promise<void>;
|
|
22
|
+
}
|
|
@@ -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
|
+
}
|