@usenaive-sdk/cli 0.12.2 → 0.13.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +76 -5
- package/dist/client.d.ts +74 -1
- package/dist/client.js +351 -17
- package/dist/client.js.map +1 -1
- package/dist/commands/aeo.js +69 -27
- package/dist/commands/aeo.js.map +1 -1
- package/dist/commands/app-data.js +29 -11
- package/dist/commands/app-data.js.map +1 -1
- package/dist/commands/apps.d.ts +7 -0
- package/dist/commands/apps.js +255 -18
- package/dist/commands/apps.js.map +1 -1
- package/dist/commands/audio.d.ts +9 -0
- package/dist/commands/audio.js +391 -0
- package/dist/commands/audio.js.map +1 -0
- package/dist/commands/auth.d.ts +31 -0
- package/dist/commands/auth.js +403 -0
- package/dist/commands/auth.js.map +1 -0
- package/dist/commands/billing.js +12 -12
- package/dist/commands/billing.js.map +1 -1
- package/dist/commands/brain.d.ts +2 -0
- package/dist/commands/brain.js +1255 -0
- package/dist/commands/brain.js.map +1 -0
- package/dist/commands/browser.js +35 -8
- package/dist/commands/browser.js.map +1 -1
- package/dist/commands/business.js +117 -16
- package/dist/commands/business.js.map +1 -1
- package/dist/commands/clone.d.ts +2 -0
- package/dist/commands/clone.js +203 -0
- package/dist/commands/clone.js.map +1 -0
- package/dist/commands/companies.d.ts +8 -0
- package/dist/commands/companies.js +137 -47
- package/dist/commands/companies.js.map +1 -1
- package/dist/commands/company-data.d.ts +2 -0
- package/dist/commands/company-data.js +168 -0
- package/dist/commands/company-data.js.map +1 -0
- package/dist/commands/compute.js +10 -3
- package/dist/commands/compute.js.map +1 -1
- package/dist/commands/config.d.ts +2 -0
- package/dist/commands/config.js +36 -0
- package/dist/commands/config.js.map +1 -0
- package/dist/commands/connections.d.ts +6 -0
- package/dist/commands/connections.js +29 -1
- package/dist/commands/connections.js.map +1 -1
- package/dist/commands/domains.js +1 -1
- package/dist/commands/ecommerce.js +19 -9
- package/dist/commands/ecommerce.js.map +1 -1
- package/dist/commands/email.js +56 -9
- package/dist/commands/email.js.map +1 -1
- package/dist/commands/env.d.ts +3 -3
- package/dist/commands/env.js +68 -4
- package/dist/commands/env.js.map +1 -1
- package/dist/commands/formation.js +3 -3
- package/dist/commands/identity.js +4 -3
- package/dist/commands/identity.js.map +1 -1
- package/dist/commands/images.js +87 -13
- package/dist/commands/images.js.map +1 -1
- package/dist/commands/init.d.ts +3 -0
- package/dist/commands/init.js +39 -36
- package/dist/commands/init.js.map +1 -1
- package/dist/commands/jobs.js +1 -0
- package/dist/commands/jobs.js.map +1 -1
- package/dist/commands/keys.js +26 -3
- package/dist/commands/keys.js.map +1 -1
- package/dist/commands/legacy-auth.d.ts +27 -0
- package/dist/commands/legacy-auth.js +64 -0
- package/dist/commands/legacy-auth.js.map +1 -0
- package/dist/commands/llm.js +13 -0
- package/dist/commands/llm.js.map +1 -1
- package/dist/commands/login.js +2 -0
- package/dist/commands/login.js.map +1 -1
- package/dist/commands/loops.d.ts +2 -0
- package/dist/commands/loops.js +260 -0
- package/dist/commands/loops.js.map +1 -0
- package/dist/commands/media.js +3 -3
- package/dist/commands/media.js.map +1 -1
- package/dist/commands/mobile.d.ts +4 -0
- package/dist/commands/mobile.js +382 -0
- package/dist/commands/mobile.js.map +1 -0
- package/dist/commands/payments.d.ts +2 -0
- package/dist/commands/payments.js +131 -0
- package/dist/commands/payments.js.map +1 -0
- package/dist/commands/people.d.ts +2 -0
- package/dist/commands/people.js +193 -0
- package/dist/commands/people.js.map +1 -0
- package/dist/commands/phone.js +3 -3
- package/dist/commands/phone.js.map +1 -1
- package/dist/commands/projects.d.ts +13 -0
- package/dist/commands/projects.js +220 -0
- package/dist/commands/projects.js.map +1 -0
- package/dist/commands/register.js +16 -8
- package/dist/commands/register.js.map +1 -1
- package/dist/commands/sandbox.d.ts +2 -0
- package/dist/commands/sandbox.js +245 -0
- package/dist/commands/sandbox.js.map +1 -0
- package/dist/commands/search.js +26 -12
- package/dist/commands/search.js.map +1 -1
- package/dist/commands/seo.js +16 -8
- package/dist/commands/seo.js.map +1 -1
- package/dist/commands/sessions.d.ts +6 -0
- package/dist/commands/sessions.js +109 -0
- package/dist/commands/sessions.js.map +1 -0
- package/dist/commands/social-data.d.ts +2 -0
- package/dist/commands/social-data.js +244 -0
- package/dist/commands/social-data.js.map +1 -0
- package/dist/commands/social.js +8 -6
- package/dist/commands/social.js.map +1 -1
- package/dist/commands/teams.d.ts +69 -0
- package/dist/commands/teams.js +503 -0
- package/dist/commands/teams.js.map +1 -0
- package/dist/commands/up.d.ts +150 -0
- package/dist/commands/up.js +415 -15
- package/dist/commands/up.js.map +1 -1
- package/dist/commands/usage.js +15 -4
- package/dist/commands/usage.js.map +1 -1
- package/dist/commands/use.d.ts +9 -0
- package/dist/commands/use.js +76 -11
- package/dist/commands/use.js.map +1 -1
- package/dist/commands/users.d.ts +8 -0
- package/dist/commands/users.js +28 -9
- package/dist/commands/users.js.map +1 -1
- package/dist/commands/vault.js +28 -1
- package/dist/commands/vault.js.map +1 -1
- package/dist/commands/video.js +190 -270
- package/dist/commands/video.js.map +1 -1
- package/dist/commands/voice.d.ts +2 -0
- package/dist/commands/voice.js +516 -0
- package/dist/commands/voice.js.map +1 -0
- package/dist/commands/wallet.d.ts +2 -0
- package/dist/commands/wallet.js +244 -0
- package/dist/commands/wallet.js.map +1 -0
- package/dist/commands/whoami.js +17 -1
- package/dist/commands/whoami.js.map +1 -1
- package/dist/config.d.ts +24 -1
- package/dist/config.js +36 -7
- package/dist/config.js.map +1 -1
- package/dist/index.d.ts +2 -1
- package/dist/index.js +290 -20
- package/dist/index.js.map +1 -1
- package/dist/lib/brain-select.d.ts +193 -0
- package/dist/lib/brain-select.js +403 -0
- package/dist/lib/brain-select.js.map +1 -0
- package/dist/lib/cli-validation.d.ts +12 -0
- package/dist/lib/cli-validation.js +46 -0
- package/dist/lib/cli-validation.js.map +1 -0
- package/dist/lib/deprecation.d.ts +158 -0
- package/dist/lib/deprecation.js +140 -0
- package/dist/lib/deprecation.js.map +1 -0
- package/dist/lib/duration.d.ts +8 -0
- package/dist/lib/duration.js +11 -0
- package/dist/lib/duration.js.map +1 -0
- package/dist/lib/http-response.d.ts +11 -0
- package/dist/lib/http-response.js +96 -0
- package/dist/lib/http-response.js.map +1 -0
- package/dist/lib/pricing.d.ts +132 -0
- package/dist/lib/pricing.js +148 -0
- package/dist/lib/pricing.js.map +1 -0
- package/dist/lib/stream-frames.d.ts +114 -0
- package/dist/lib/stream-frames.js +169 -0
- package/dist/lib/stream-frames.js.map +1 -0
- package/dist/lib/teams-catalog.d.ts +141 -0
- package/dist/lib/teams-catalog.js +765 -0
- package/dist/lib/teams-catalog.js.map +1 -0
- package/dist/lib/unknown-command.d.ts +57 -0
- package/dist/lib/unknown-command.js +93 -0
- package/dist/lib/unknown-command.js.map +1 -0
- package/dist/lib/version-check.d.ts +26 -0
- package/dist/lib/version-check.js +21 -0
- package/dist/lib/version-check.js.map +1 -0
- package/dist/output.d.ts +119 -10
- package/dist/output.js +309 -15
- package/dist/output.js.map +1 -1
- package/dist/prompt.d.ts +17 -0
- package/dist/prompt.js +70 -0
- package/dist/prompt.js.map +1 -0
- package/package.json +11 -6
- package/dist/commands/billing-client.d.ts +0 -2
- package/dist/commands/billing-client.js +0 -271
- package/dist/commands/billing-client.js.map +0 -1
- package/dist/commands/crm-app.d.ts +0 -2
- package/dist/commands/crm-app.js +0 -306
- package/dist/commands/crm-app.js.map +0 -1
- package/dist/commands/crm.d.ts +0 -2
- package/dist/commands/crm.js +0 -319
- package/dist/commands/crm.js.map +0 -1
- package/dist/commands/integrations.d.ts +0 -2
- package/dist/commands/integrations.js +0 -199
- package/dist/commands/integrations.js.map +0 -1
- package/dist/commands/link.d.ts +0 -3
- package/dist/commands/link.js +0 -91
- package/dist/commands/link.js.map +0 -1
- package/dist/commands/operators.d.ts +0 -11
- package/dist/commands/operators.js +0 -120
- package/dist/commands/operators.js.map +0 -1
package/dist/commands/link.js
DELETED
|
@@ -1,91 +0,0 @@
|
|
|
1
|
-
import { Command } from "commander";
|
|
2
|
-
import { apiRequest, handleApiError } from "../client.js";
|
|
3
|
-
import { saveConfig } from "../config.js";
|
|
4
|
-
import { agentOutput } from "../output.js";
|
|
5
|
-
export const linkCmd = new Command("link")
|
|
6
|
-
.description("Link to an existing Naive account via email verification (passwordless)")
|
|
7
|
-
.requiredOption("--email <email>", "Account email address to link")
|
|
8
|
-
.addHelpText("after", `
|
|
9
|
-
Examples:
|
|
10
|
-
$ naive link --email alex@company.com
|
|
11
|
-
# Check your email for 6-digit code, then:
|
|
12
|
-
$ naive verify --email alex@company.com --code 123456
|
|
13
|
-
|
|
14
|
-
What this does:
|
|
15
|
-
1. Sends a 6-digit verification code to the provided email
|
|
16
|
-
2. After verifying, creates an API agent linked to your account
|
|
17
|
-
3. Returns an API key for the linked account
|
|
18
|
-
|
|
19
|
-
When to use this:
|
|
20
|
-
- You have a Naive account but prefer passwordless login
|
|
21
|
-
- You created your account through a social provider (Google, etc.)
|
|
22
|
-
- You want to link a second machine/agent to an existing account
|
|
23
|
-
|
|
24
|
-
Flow:
|
|
25
|
-
naive link --email ... → check email → naive verify --email ... --code ...
|
|
26
|
-
`)
|
|
27
|
-
.action(async (opts) => {
|
|
28
|
-
const resp = await apiRequest("POST", "/v1/auth/link", { email: opts.email }, { noAuth: true });
|
|
29
|
-
handleApiError("link", resp);
|
|
30
|
-
agentOutput({
|
|
31
|
-
action: "link",
|
|
32
|
-
result: {
|
|
33
|
-
status: "verification_sent",
|
|
34
|
-
email: opts.email,
|
|
35
|
-
},
|
|
36
|
-
next_steps: [
|
|
37
|
-
{ command: `naive verify --email ${opts.email} --code <6-digit-code>`, description: "Complete verification with the code from your email" },
|
|
38
|
-
],
|
|
39
|
-
hints: [
|
|
40
|
-
"A 6-digit code has been sent to your email",
|
|
41
|
-
"The code expires in 10 minutes",
|
|
42
|
-
"Check spam folder if you don't see it",
|
|
43
|
-
],
|
|
44
|
-
related_commands: ["naive verify", "naive login", "naive register"],
|
|
45
|
-
help_markdown: "### Verification Code Sent\n\nCheck the inbox for `" + opts.email + "` and use the 6-digit code to complete linking:\n\n```\nnaive verify --email " + opts.email + " --code <CODE>\n```",
|
|
46
|
-
});
|
|
47
|
-
});
|
|
48
|
-
export const verifyCmd = new Command("verify")
|
|
49
|
-
.description("Complete account linking with the emailed verification code")
|
|
50
|
-
.requiredOption("--email <email>", "Account email (same as used in 'naive link')")
|
|
51
|
-
.requiredOption("--code <code>", "6-digit verification code from email")
|
|
52
|
-
.addHelpText("after", `
|
|
53
|
-
Examples:
|
|
54
|
-
$ naive verify --email alex@company.com --code 482910
|
|
55
|
-
|
|
56
|
-
What this does:
|
|
57
|
-
1. Validates the code against the pending verification
|
|
58
|
-
2. Creates an API agent linked to the verified account
|
|
59
|
-
3. Saves the API key to ~/.naive/config.json
|
|
60
|
-
|
|
61
|
-
Prerequisites:
|
|
62
|
-
- Must have run 'naive link --email ...' first
|
|
63
|
-
- Code must not be expired (10 minute window)
|
|
64
|
-
`)
|
|
65
|
-
.action(async (opts) => {
|
|
66
|
-
const resp = await apiRequest("POST", "/v1/auth/verify", {
|
|
67
|
-
email: opts.email,
|
|
68
|
-
code: opts.code,
|
|
69
|
-
}, { noAuth: true });
|
|
70
|
-
handleApiError("verify", resp);
|
|
71
|
-
const data = resp.data;
|
|
72
|
-
saveConfig({ api_key: data.api_key, agent_id: data.agent_id, company_id: data.company_id, company_name: data.company_name });
|
|
73
|
-
agentOutput({
|
|
74
|
-
action: "verify",
|
|
75
|
-
result: {
|
|
76
|
-
agent_id: data.agent_id,
|
|
77
|
-
companies: data.companies,
|
|
78
|
-
credentials_saved: "~/.naive/config.json",
|
|
79
|
-
},
|
|
80
|
-
next_steps: [
|
|
81
|
-
{ command: "naive status", description: "Verify account and check credits" },
|
|
82
|
-
{ command: "naive identity", description: "See resources available in this account" },
|
|
83
|
-
...(data.companies?.length > 1
|
|
84
|
-
? [{ command: "naive companies select <id>", description: "Choose which company to operate under" }]
|
|
85
|
-
: []),
|
|
86
|
-
],
|
|
87
|
-
hints: ["Account linked successfully. All future commands use the saved API key."],
|
|
88
|
-
related_commands: ["naive whoami", "naive companies", "naive status"],
|
|
89
|
-
});
|
|
90
|
-
});
|
|
91
|
-
//# sourceMappingURL=link.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"link.js","sourceRoot":"","sources":["../../src/commands/link.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AACpC,OAAO,EAAE,UAAU,EAAE,cAAc,EAAE,MAAM,cAAc,CAAC;AAC1D,OAAO,EAAE,UAAU,EAAE,MAAM,cAAc,CAAC;AAC1C,OAAO,EAAE,WAAW,EAAE,MAAM,cAAc,CAAC;AAE3C,MAAM,CAAC,MAAM,OAAO,GAAG,IAAI,OAAO,CAAC,MAAM,CAAC;KACvC,WAAW,CAAC,yEAAyE,CAAC;KACtF,cAAc,CAAC,iBAAiB,EAAE,+BAA+B,CAAC;KAClE,WAAW,CAAC,OAAO,EAAE;;;;;;;;;;;;;;;;;;CAkBvB,CAAC;KACC,MAAM,CAAC,KAAK,EAAE,IAAI,EAAE,EAAE;IACrB,MAAM,IAAI,GAAG,MAAM,UAAU,CAAC,MAAM,EAAE,eAAe,EAAE,EAAE,KAAK,EAAE,IAAI,CAAC,KAAK,EAAE,EAAE,EAAE,MAAM,EAAE,IAAI,EAAE,CAAC,CAAC;IAChG,cAAc,CAAC,MAAM,EAAE,IAAI,CAAC,CAAC;IAE7B,WAAW,CAAC;QACV,MAAM,EAAE,MAAM;QACd,MAAM,EAAE;YACN,MAAM,EAAE,mBAAmB;YAC3B,KAAK,EAAE,IAAI,CAAC,KAAK;SAClB;QACD,UAAU,EAAE;YACV,EAAE,OAAO,EAAE,wBAAwB,IAAI,CAAC,KAAK,wBAAwB,EAAE,WAAW,EAAE,qDAAqD,EAAE;SAC5I;QACD,KAAK,EAAE;YACL,4CAA4C;YAC5C,gCAAgC;YAChC,uCAAuC;S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EAAE;YAC5E,EAAE,OAAO,EAAE,gBAAgB,EAAE,WAAW,EAAE,yCAAyC,EAAE;YACrF,GAAG,CAAC,IAAI,CAAC,SAAS,EAAE,MAAM,GAAG,CAAC;gBAC5B,CAAC,CAAC,CAAC,EAAE,OAAO,EAAE,6BAA6B,EAAE,WAAW,EAAE,uCAAuC,EAAE,CAAC;gBACpG,CAAC,CAAC,EAAE,CAAC;SACR;QACD,KAAK,EAAE,CAAC,yEAAyE,CAAC;QAClF,gBAAgB,EAAE,CAAC,cAAc,EAAE,iBAAiB,EAAE,cAAc,CAAC;KACtE,CAAC,CAAC;AACL,CAAC,CAAC,CAAC"}
|
|
@@ -1,11 +0,0 @@
|
|
|
1
|
-
import { Command } from "commander";
|
|
2
|
-
/**
|
|
3
|
-
* Operators — the per-tenant governed real-world bundle (identity, money, comms,
|
|
4
|
-
* runtime), governed on every action and instantly revocable.
|
|
5
|
-
*/
|
|
6
|
-
export declare const operatorsCmd: Command;
|
|
7
|
-
/**
|
|
8
|
-
* Top-level `naive revoke` sugar — revoke an operator (or, with --tenant, the
|
|
9
|
-
* operator for that tenant).
|
|
10
|
-
*/
|
|
11
|
-
export declare const revokeCmd: Command;
|
|
@@ -1,120 +0,0 @@
|
|
|
1
|
-
import { Command } from "commander";
|
|
2
|
-
import { apiRequest, handleApiError, activeUserId } from "../client.js";
|
|
3
|
-
import { agentOutput } from "../output.js";
|
|
4
|
-
/**
|
|
5
|
-
* Operators — the per-tenant governed real-world bundle (identity, money, comms,
|
|
6
|
-
* runtime), governed on every action and instantly revocable.
|
|
7
|
-
*/
|
|
8
|
-
export const operatorsCmd = new Command("operators")
|
|
9
|
-
.alias("operator")
|
|
10
|
-
.description("Provision & govern a real-world operator per tenant (identity, card, comms, runtime)");
|
|
11
|
-
operatorsCmd
|
|
12
|
-
.command("provision")
|
|
13
|
-
.description("Provision a governed operator for a tenant from a template")
|
|
14
|
-
.argument("<template>", "Template name (registered via naive.config.ts / naive up)")
|
|
15
|
-
.option("--user <id>", "Tenant id to provision the operator for (defaults to the active/default user)")
|
|
16
|
-
.option("--idempotency-key <key>", "Idempotency key — a retried provision resumes the same operator")
|
|
17
|
-
.option("--overrides <json>", "JSON overrides applied on top of the template (legalName, domain, …)")
|
|
18
|
-
.action(async (template, opts) => {
|
|
19
|
-
const user = opts.user ?? activeUserId() ?? "default";
|
|
20
|
-
let overrides;
|
|
21
|
-
if (opts.overrides) {
|
|
22
|
-
try {
|
|
23
|
-
overrides = JSON.parse(opts.overrides);
|
|
24
|
-
}
|
|
25
|
-
catch {
|
|
26
|
-
agentOutput({
|
|
27
|
-
action: "operators.provision",
|
|
28
|
-
result: { error: "invalid --overrides JSON" },
|
|
29
|
-
next_steps: [{ command: "naive operators provision <template> --overrides '{\"identity\":{\"legalName\":\"Acme\"}}'", description: "Valid JSON" }],
|
|
30
|
-
});
|
|
31
|
-
return;
|
|
32
|
-
}
|
|
33
|
-
}
|
|
34
|
-
const resp = await apiRequest("POST", `/v1/users/${user}/operators`, {
|
|
35
|
-
template,
|
|
36
|
-
idempotency_key: opts.idempotencyKey,
|
|
37
|
-
overrides,
|
|
38
|
-
});
|
|
39
|
-
handleApiError("operators.provision", resp);
|
|
40
|
-
const op = resp.data;
|
|
41
|
-
agentOutput({
|
|
42
|
-
action: "operators.provision",
|
|
43
|
-
result: resp.data,
|
|
44
|
-
next_steps: [
|
|
45
|
-
{ command: `naive operators get ${op.id ?? "<id>"}`, description: "Check provisioning status" },
|
|
46
|
-
{ command: `naive operators revoke ${op.id ?? "<id>"}`, description: "Absolute revoke (freeze card, halt sends)" },
|
|
47
|
-
],
|
|
48
|
-
hints: [
|
|
49
|
-
"Pull the operator's governed tools with @usenaive/server: const tools = await op.tools().",
|
|
50
|
-
"Run the agent on your own runtime (Eve / AgentCore / LangGraph) — governance is constant.",
|
|
51
|
-
],
|
|
52
|
-
});
|
|
53
|
-
});
|
|
54
|
-
operatorsCmd
|
|
55
|
-
.command("list")
|
|
56
|
-
.description("List provisioned operators")
|
|
57
|
-
.action(async () => {
|
|
58
|
-
const resp = await apiRequest("GET", `/v1/operators`);
|
|
59
|
-
handleApiError("operators.list", resp);
|
|
60
|
-
agentOutput({
|
|
61
|
-
action: "operators.list",
|
|
62
|
-
result: resp.data,
|
|
63
|
-
next_steps: [{ command: "naive operators get <id>", description: "Inspect one operator" }],
|
|
64
|
-
});
|
|
65
|
-
});
|
|
66
|
-
operatorsCmd
|
|
67
|
-
.command("get")
|
|
68
|
-
.description("Get an operator's status")
|
|
69
|
-
.argument("<id>", "Operator id")
|
|
70
|
-
.action(async (id) => {
|
|
71
|
-
const resp = await apiRequest("GET", `/v1/operators/${id}`);
|
|
72
|
-
handleApiError("operators.get", resp);
|
|
73
|
-
agentOutput({
|
|
74
|
-
action: "operators.get",
|
|
75
|
-
result: resp.data,
|
|
76
|
-
next_steps: [{ command: `naive operators revoke ${id}`, description: "Absolute revoke" }],
|
|
77
|
-
});
|
|
78
|
-
});
|
|
79
|
-
operatorsCmd
|
|
80
|
-
.command("revoke")
|
|
81
|
-
.description("Absolute revoke — freeze the card, halt sends, tear down runtime")
|
|
82
|
-
.argument("<id>", "Operator id")
|
|
83
|
-
.action(async (id) => {
|
|
84
|
-
const resp = await apiRequest("POST", `/v1/operators/${id}/revoke`);
|
|
85
|
-
handleApiError("operators.revoke", resp);
|
|
86
|
-
agentOutput({
|
|
87
|
-
action: "operators.revoke",
|
|
88
|
-
result: resp.data,
|
|
89
|
-
next_steps: [{ command: "naive operators list", description: "Confirm the operator is revoked" }],
|
|
90
|
-
hints: ["Revoke is absolute: the governance gateway denies all further tool calls for this operator."],
|
|
91
|
-
});
|
|
92
|
-
});
|
|
93
|
-
/**
|
|
94
|
-
* Top-level `naive revoke` sugar — revoke an operator (or, with --tenant, the
|
|
95
|
-
* operator for that tenant).
|
|
96
|
-
*/
|
|
97
|
-
export const revokeCmd = new Command("revoke")
|
|
98
|
-
.description("Absolute revoke of an operator (sugar for `naive operators revoke`)")
|
|
99
|
-
.argument("[id]", "Operator id")
|
|
100
|
-
.option("--operator <id>", "Operator id")
|
|
101
|
-
.option("--tenant <id>", "Tenant id (its operator id equals the tenant id)")
|
|
102
|
-
.action(async (idArg, opts) => {
|
|
103
|
-
const id = idArg ?? opts.operator ?? opts.tenant;
|
|
104
|
-
if (!id) {
|
|
105
|
-
agentOutput({
|
|
106
|
-
action: "revoke",
|
|
107
|
-
result: { error: "missing operator id" },
|
|
108
|
-
next_steps: [{ command: "naive revoke <operator_id>", description: "Provide an operator id" }],
|
|
109
|
-
});
|
|
110
|
-
return;
|
|
111
|
-
}
|
|
112
|
-
const resp = await apiRequest("POST", `/v1/operators/${id}/revoke`);
|
|
113
|
-
handleApiError("revoke", resp);
|
|
114
|
-
agentOutput({
|
|
115
|
-
action: "revoke",
|
|
116
|
-
result: resp.data,
|
|
117
|
-
next_steps: [{ command: "naive operators list", description: "Confirm revoked" }],
|
|
118
|
-
});
|
|
119
|
-
});
|
|
120
|
-
//# sourceMappingURL=operators.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"operators.js","sourceRoot":"","sources":["../../src/commands/operators.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AACpC,OAAO,EAAE,UAAU,EAAE,cAAc,EAAE,YAAY,EAAE,MAAM,cAAc,CAAC;AACxE,OAAO,EAAE,WAAW,EAAE,MAAM,cAAc,CAAC;AAE3C;;;GAGG;AACH,MAAM,CAAC,MAAM,YAAY,GAAG,IAAI,OAAO,CAAC,WAAW,CAAC;KACjD,KAAK,CAAC,UAAU,CAAC;KACjB,WAAW,CAAC,sFAAsF,CAAC,CAAC;AAEvG,YAAY;KACT,OAAO,CAAC,WAAW,CAAC;KACpB,WAAW,CAAC,4DAA4D,CAAC;KACzE,QAAQ,CAAC,YAAY,EAAE,2DAA2D,CAAC;KACnF,MAAM,CAAC,aAAa,EAAE,+EAA+E,CAAC;KACtG,MAAM,CAAC,yBAAyB,EAAE,iEAAi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