automate.ax 0.1.3
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/LICENSE +21 -0
- package/README.md +119 -0
- package/dist/automation/actions.d.ts +200 -0
- package/dist/automation/actions.d.ts.map +1 -0
- package/dist/automation/actions.js +286 -0
- package/dist/automation/automation.d.ts +16 -0
- package/dist/automation/automation.d.ts.map +1 -0
- package/dist/automation/automation.js +10 -0
- package/dist/automation/integrations.d.ts +63 -0
- package/dist/automation/integrations.d.ts.map +1 -0
- package/dist/automation/integrations.js +58 -0
- package/dist/automation/runtime.d.ts +73 -0
- package/dist/automation/runtime.d.ts.map +1 -0
- package/dist/automation/runtime.js +92 -0
- package/dist/automation/signal.d.ts +58 -0
- package/dist/automation/signal.d.ts.map +1 -0
- package/dist/automation/signal.js +80 -0
- package/dist/automation/subscribe.d.ts +10 -0
- package/dist/automation/subscribe.d.ts.map +1 -0
- package/dist/automation/subscribe.js +16 -0
- package/dist/cli/command-names.d.ts +46 -0
- package/dist/cli/command-names.d.ts.map +1 -0
- package/dist/cli/command-names.js +46 -0
- package/dist/cli/commands/accept.d.ts +20 -0
- package/dist/cli/commands/accept.d.ts.map +1 -0
- package/dist/cli/commands/accept.js +42 -0
- package/dist/cli/commands/debug.d.ts +4 -0
- package/dist/cli/commands/debug.d.ts.map +1 -0
- package/dist/cli/commands/debug.js +52 -0
- package/dist/cli/commands/deploy.d.ts +24 -0
- package/dist/cli/commands/deploy.d.ts.map +1 -0
- package/dist/cli/commands/deploy.js +292 -0
- package/dist/cli/commands/login.d.ts +20 -0
- package/dist/cli/commands/login.d.ts.map +1 -0
- package/dist/cli/commands/login.js +145 -0
- package/dist/cli/commands/logout.d.ts +4 -0
- package/dist/cli/commands/logout.d.ts.map +1 -0
- package/dist/cli/commands/logout.js +32 -0
- package/dist/cli/commands/me.d.ts +4 -0
- package/dist/cli/commands/me.d.ts.map +1 -0
- package/dist/cli/commands/me.js +48 -0
- package/dist/cli/commands/org-api-key-create.d.ts +26 -0
- package/dist/cli/commands/org-api-key-create.d.ts.map +1 -0
- package/dist/cli/commands/org-api-key-create.js +51 -0
- package/dist/cli/commands/org-api-key-delete.d.ts +33 -0
- package/dist/cli/commands/org-api-key-delete.d.ts.map +1 -0
- package/dist/cli/commands/org-api-key-delete.js +57 -0
- package/dist/cli/commands/org-api-key-list.d.ts +16 -0
- package/dist/cli/commands/org-api-key-list.d.ts.map +1 -0
- package/dist/cli/commands/org-api-key-list.js +58 -0
- package/dist/cli/commands/org-api-key-rename.d.ts +32 -0
- package/dist/cli/commands/org-api-key-rename.d.ts.map +1 -0
- package/dist/cli/commands/org-api-key-rename.js +54 -0
- package/dist/cli/commands/org-api-key.d.ts +2 -0
- package/dist/cli/commands/org-api-key.d.ts.map +1 -0
- package/dist/cli/commands/org-api-key.js +18 -0
- package/dist/cli/commands/org-billing.d.ts +16 -0
- package/dist/cli/commands/org-billing.d.ts.map +1 -0
- package/dist/cli/commands/org-billing.js +78 -0
- package/dist/cli/commands/org-create.d.ts +20 -0
- package/dist/cli/commands/org-create.d.ts.map +1 -0
- package/dist/cli/commands/org-create.js +64 -0
- package/dist/cli/commands/org-delete.d.ts +27 -0
- package/dist/cli/commands/org-delete.d.ts.map +1 -0
- package/dist/cli/commands/org-delete.js +53 -0
- package/dist/cli/commands/org-invite.d.ts +39 -0
- package/dist/cli/commands/org-invite.d.ts.map +1 -0
- package/dist/cli/commands/org-invite.js +66 -0
- package/dist/cli/commands/org-leave.d.ts +27 -0
- package/dist/cli/commands/org-leave.d.ts.map +1 -0
- package/dist/cli/commands/org-leave.js +56 -0
- package/dist/cli/commands/org-list.d.ts +4 -0
- package/dist/cli/commands/org-list.d.ts.map +1 -0
- package/dist/cli/commands/org-list.js +36 -0
- package/dist/cli/commands/org-remove.d.ts +33 -0
- package/dist/cli/commands/org-remove.d.ts.map +1 -0
- package/dist/cli/commands/org-remove.js +66 -0
- package/dist/cli/commands/org-rename.d.ts +26 -0
- package/dist/cli/commands/org-rename.d.ts.map +1 -0
- package/dist/cli/commands/org-rename.js +58 -0
- package/dist/cli/commands/org-show.d.ts +16 -0
- package/dist/cli/commands/org-show.d.ts.map +1 -0
- package/dist/cli/commands/org-show.js +48 -0
- package/dist/cli/commands/org-upgrade.d.ts +42 -0
- package/dist/cli/commands/org-upgrade.d.ts.map +1 -0
- package/dist/cli/commands/org-upgrade.js +171 -0
- package/dist/cli/commands/org.d.ts +2 -0
- package/dist/cli/commands/org.d.ts.map +1 -0
- package/dist/cli/commands/org.js +32 -0
- package/dist/cli/commands/project-create.d.ts +27 -0
- package/dist/cli/commands/project-create.d.ts.map +1 -0
- package/dist/cli/commands/project-create.js +61 -0
- package/dist/cli/commands/project-delete.d.ts +27 -0
- package/dist/cli/commands/project-delete.d.ts.map +1 -0
- package/dist/cli/commands/project-delete.js +55 -0
- package/dist/cli/commands/project-list.d.ts +17 -0
- package/dist/cli/commands/project-list.d.ts.map +1 -0
- package/dist/cli/commands/project-list.js +89 -0
- package/dist/cli/commands/project-rename.d.ts +26 -0
- package/dist/cli/commands/project-rename.d.ts.map +1 -0
- package/dist/cli/commands/project-rename.js +60 -0
- package/dist/cli/commands/project-show.d.ts +16 -0
- package/dist/cli/commands/project-show.d.ts.map +1 -0
- package/dist/cli/commands/project-show.js +37 -0
- package/dist/cli/commands/project.d.ts +2 -0
- package/dist/cli/commands/project.d.ts.map +1 -0
- package/dist/cli/commands/project.js +20 -0
- package/dist/cli/index.d.ts +19 -0
- package/dist/cli/index.d.ts.map +1 -0
- package/dist/cli/index.js +63 -0
- package/dist/cli/lib/api-client.d.ts +3 -0
- package/dist/cli/lib/api-client.d.ts.map +1 -0
- package/dist/cli/lib/api-client.js +14 -0
- package/dist/cli/lib/auth-client.d.ts +80 -0
- package/dist/cli/lib/auth-client.d.ts.map +1 -0
- package/dist/cli/lib/auth-client.js +61 -0
- package/dist/cli/lib/automation-build.d.ts +30 -0
- package/dist/cli/lib/automation-build.d.ts.map +1 -0
- package/dist/cli/lib/automation-build.js +90 -0
- package/dist/cli/lib/config-dir.d.ts +47 -0
- package/dist/cli/lib/config-dir.d.ts.map +1 -0
- package/dist/cli/lib/config-dir.js +146 -0
- package/dist/cli/lib/detail-block.d.ts +16 -0
- package/dist/cli/lib/detail-block.d.ts.map +1 -0
- package/dist/cli/lib/detail-block.js +25 -0
- package/dist/cli/lib/env.d.ts +4 -0
- package/dist/cli/lib/env.d.ts.map +1 -0
- package/dist/cli/lib/env.js +7 -0
- package/dist/cli/lib/hijack-clack-logger.d.ts +2 -0
- package/dist/cli/lib/hijack-clack-logger.d.ts.map +1 -0
- package/dist/cli/lib/hijack-clack-logger.js +8 -0
- package/dist/cli/lib/io.d.ts +19 -0
- package/dist/cli/lib/io.d.ts.map +1 -0
- package/dist/cli/lib/io.js +87 -0
- package/dist/cli/lib/json-output.d.ts +9 -0
- package/dist/cli/lib/json-output.d.ts.map +1 -0
- package/dist/cli/lib/json-output.js +12 -0
- package/dist/cli/lib/organization-detail-block.d.ts +30 -0
- package/dist/cli/lib/organization-detail-block.d.ts.map +1 -0
- package/dist/cli/lib/organization-detail-block.js +72 -0
- package/dist/cli/lib/project-config.d.ts +10 -0
- package/dist/cli/lib/project-config.d.ts.map +1 -0
- package/dist/cli/lib/project-config.js +21 -0
- package/dist/cli/lib/spinner.d.ts +18 -0
- package/dist/cli/lib/spinner.d.ts.map +1 -0
- package/dist/cli/lib/spinner.js +111 -0
- package/dist/cli/usage.d.ts +9 -0
- package/dist/cli/usage.d.ts.map +1 -0
- package/dist/cli/usage.js +468 -0
- package/dist/cli/utils.d.ts +291 -0
- package/dist/cli/utils.d.ts.map +1 -0
- package/dist/cli/utils.js +561 -0
- package/dist/cli.d.ts +3 -0
- package/dist/cli.d.ts.map +1 -0
- package/dist/cli.js +5 -0
- package/dist/config.d.ts +11 -0
- package/dist/config.d.ts.map +1 -0
- package/dist/config.js +9 -0
- package/dist/index.d.ts +8 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +7 -0
- package/package.json +92 -0
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
import { log } from "@clack/prompts";
|
|
2
|
+
import { defineCommand } from "citty";
|
|
3
|
+
import { commandNames } from "../command-names.js";
|
|
4
|
+
import { apiClient } from "../lib/api-client.js";
|
|
5
|
+
import { accent, dimmed } from "../lib/io.js";
|
|
6
|
+
import { clearSpinner, startSpinner } from "../lib/spinner.js";
|
|
7
|
+
import { createCommandRun, ORG_OPT, orgOptsSchema, output, promptableOption, REASONABLE_NAME_SCHEMA, requireAuthenticatedSession, safelyPromptTextWithValidation, sessionIntro, useOrganization, } from "../utils.js";
|
|
8
|
+
/** Validates options before an API key secret can be issued. */
|
|
9
|
+
const createApiKeyOptsSchema = orgOptsSchema.extend({
|
|
10
|
+
name: promptableOption(REASONABLE_NAME_SCHEMA, "--name"),
|
|
11
|
+
});
|
|
12
|
+
export const orgApiKeyCreateCommand = defineCommand({
|
|
13
|
+
meta: {
|
|
14
|
+
name: commandNames.org.apiKey.create,
|
|
15
|
+
description: "Create an organization API key",
|
|
16
|
+
},
|
|
17
|
+
args: {
|
|
18
|
+
...ORG_OPT,
|
|
19
|
+
name: {
|
|
20
|
+
type: "string",
|
|
21
|
+
description: "Name for the API key",
|
|
22
|
+
alias: ["n"],
|
|
23
|
+
},
|
|
24
|
+
},
|
|
25
|
+
run: createCommandRun(createApiKeyOptsSchema, createOrganizationApiKey),
|
|
26
|
+
});
|
|
27
|
+
/**
|
|
28
|
+
* Creates an organization API key and prints its one-time secret.
|
|
29
|
+
*
|
|
30
|
+
* @param opts - Organization selector and API key name.
|
|
31
|
+
*/
|
|
32
|
+
export async function createOrganizationApiKey(opts) {
|
|
33
|
+
const session = await requireAuthenticatedSession("create an organization API key");
|
|
34
|
+
output.normal(() => sessionIntro(session));
|
|
35
|
+
const organization = await useOrganization(opts);
|
|
36
|
+
const name = opts.name ??
|
|
37
|
+
(await safelyPromptTextWithValidation({ message: "What should we name the API key?" }, REASONABLE_NAME_SCHEMA, "--name"));
|
|
38
|
+
startSpinner("Creating API key");
|
|
39
|
+
const apiKey = await apiClient.apiKey.create({
|
|
40
|
+
name,
|
|
41
|
+
organizationId: organization.id,
|
|
42
|
+
});
|
|
43
|
+
clearSpinner();
|
|
44
|
+
output
|
|
45
|
+
.normal(() => {
|
|
46
|
+
log.success(`Created ${accent(name)} ${dimmed(apiKey.id)}`);
|
|
47
|
+
log.warn("Copy this API key now. It will not be shown again.");
|
|
48
|
+
log.message(accent(apiKey.key));
|
|
49
|
+
})
|
|
50
|
+
.json(apiKey);
|
|
51
|
+
}
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
import z from "zod";
|
|
2
|
+
/** Validates API key selection and destructive confirmation options. */
|
|
3
|
+
declare const deleteApiKeyOptsSchema: z.ZodObject<{
|
|
4
|
+
org: z.ZodOptional<z.ZodString>;
|
|
5
|
+
key: z.ZodOptional<z.ZodString>;
|
|
6
|
+
yes: z.ZodDefault<z.ZodBoolean>;
|
|
7
|
+
}, z.core.$strip>;
|
|
8
|
+
export declare const orgApiKeyDeleteCommand: import("citty").CommandDef<{
|
|
9
|
+
readonly yes: {
|
|
10
|
+
readonly type: "boolean";
|
|
11
|
+
readonly description: "Skip confirmation prompt";
|
|
12
|
+
readonly alias: ["y"];
|
|
13
|
+
readonly default: false;
|
|
14
|
+
};
|
|
15
|
+
readonly org: {
|
|
16
|
+
type: "string";
|
|
17
|
+
description: string;
|
|
18
|
+
alias: string[];
|
|
19
|
+
};
|
|
20
|
+
readonly key: {
|
|
21
|
+
type: "string";
|
|
22
|
+
description: string;
|
|
23
|
+
alias: string[];
|
|
24
|
+
};
|
|
25
|
+
}>;
|
|
26
|
+
/**
|
|
27
|
+
* Permanently revokes an organization API key after confirmation.
|
|
28
|
+
*
|
|
29
|
+
* @param opts - Organization, API key, and confirmation options.
|
|
30
|
+
*/
|
|
31
|
+
export declare function deleteOrganizationApiKey(opts: z.infer<typeof deleteApiKeyOptsSchema>): Promise<void>;
|
|
32
|
+
export {};
|
|
33
|
+
//# sourceMappingURL=org-api-key-delete.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"org-api-key-delete.d.ts","sourceRoot":"","sources":["../../../src/cli/commands/org-api-key-delete.ts"],"names":[],"mappings":"AAEA,OAAO,CAAC,MAAM,KAAK,CAAA;AAkBnB,wEAAwE;AACxE,QAAA,MAAM,sBAAsB;;;;iBAE1B,CAAA;AAEF,eAAO,MAAM,sBAAsB;;;;;;;;;;;;;;;;;EAgBjC,CAAA;AAEF;;;;GAIG;AACH,wBAAsB,wBAAwB,CAC5C,IAAI,EAAE,CAAC,CAAC,KAAK,CAAC,OAAO,sBAAsB,CAAC,iBAsC7C"}
|
|
@@ -0,0 +1,57 @@
|
|
|
1
|
+
import { confirm, log } from "@clack/prompts";
|
|
2
|
+
import { defineCommand } from "citty";
|
|
3
|
+
import z from "zod";
|
|
4
|
+
import { commandNames } from "../command-names.js";
|
|
5
|
+
import { apiClient } from "../lib/api-client.js";
|
|
6
|
+
import { accent, dimmed } from "../lib/io.js";
|
|
7
|
+
import { clearSpinner, startSpinner } from "../lib/spinner.js";
|
|
8
|
+
import { API_KEY_OPT, apiKeyOptsSchema, createCommandRun, ORG_OPT, output, requireAuthenticatedSession, safelyPrompt, sessionIntro, useOrganization, useOrganizationApiKey, } from "../utils.js";
|
|
9
|
+
/** Validates API key selection and destructive confirmation options. */
|
|
10
|
+
const deleteApiKeyOptsSchema = apiKeyOptsSchema.extend({
|
|
11
|
+
yes: z.boolean().default(false),
|
|
12
|
+
});
|
|
13
|
+
export const orgApiKeyDeleteCommand = defineCommand({
|
|
14
|
+
meta: {
|
|
15
|
+
name: commandNames.org.apiKey.delete,
|
|
16
|
+
description: "Delete an organization API key",
|
|
17
|
+
},
|
|
18
|
+
args: {
|
|
19
|
+
...API_KEY_OPT,
|
|
20
|
+
...ORG_OPT,
|
|
21
|
+
yes: {
|
|
22
|
+
type: "boolean",
|
|
23
|
+
description: "Skip confirmation prompt",
|
|
24
|
+
alias: ["y"],
|
|
25
|
+
default: false,
|
|
26
|
+
},
|
|
27
|
+
},
|
|
28
|
+
run: createCommandRun(deleteApiKeyOptsSchema, deleteOrganizationApiKey),
|
|
29
|
+
});
|
|
30
|
+
/**
|
|
31
|
+
* Permanently revokes an organization API key after confirmation.
|
|
32
|
+
*
|
|
33
|
+
* @param opts - Organization, API key, and confirmation options.
|
|
34
|
+
*/
|
|
35
|
+
export async function deleteOrganizationApiKey(opts) {
|
|
36
|
+
const session = await requireAuthenticatedSession("delete an organization API key");
|
|
37
|
+
output.normal(() => sessionIntro(session));
|
|
38
|
+
const organization = await useOrganization(opts);
|
|
39
|
+
const apiKey = await useOrganizationApiKey(organization.id, opts);
|
|
40
|
+
if (!opts.yes &&
|
|
41
|
+
!(await safelyPrompt(() => confirm({
|
|
42
|
+
message: `Are you sure you want to delete ${accent(apiKey.name ?? apiKey.start ?? apiKey.id)}? This cannot be undone.`,
|
|
43
|
+
initialValue: false,
|
|
44
|
+
}), "--yes"))) {
|
|
45
|
+
output.json({ cancelled: true });
|
|
46
|
+
return;
|
|
47
|
+
}
|
|
48
|
+
startSpinner("Deleting API key");
|
|
49
|
+
await apiClient.apiKey.delete({
|
|
50
|
+
keyId: apiKey.id,
|
|
51
|
+
organizationId: organization.id,
|
|
52
|
+
});
|
|
53
|
+
clearSpinner();
|
|
54
|
+
output
|
|
55
|
+
.normal(() => log.success(`Deleted ${accent(apiKey.name ?? "API key")} ${dimmed(apiKey.id)}`))
|
|
56
|
+
.json({ apiKey, deleted: true });
|
|
57
|
+
}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import z from "zod";
|
|
2
|
+
import { orgOptsSchema } from "../utils.js";
|
|
3
|
+
export declare const orgApiKeyListCommand: import("citty").CommandDef<{
|
|
4
|
+
readonly org: {
|
|
5
|
+
type: "string";
|
|
6
|
+
description: string;
|
|
7
|
+
alias: string[];
|
|
8
|
+
};
|
|
9
|
+
}>;
|
|
10
|
+
/**
|
|
11
|
+
* Lists the API keys owned by one organization.
|
|
12
|
+
*
|
|
13
|
+
* @param opts - Organization selector.
|
|
14
|
+
*/
|
|
15
|
+
export declare function listOrganizationApiKeys(opts: z.infer<typeof orgOptsSchema>): Promise<void>;
|
|
16
|
+
//# sourceMappingURL=org-api-key-list.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"org-api-key-list.d.ts","sourceRoot":"","sources":["../../../src/cli/commands/org-api-key-list.ts"],"names":[],"mappings":"AAEA,OAAO,CAAC,MAAM,KAAK,CAAA;AAKnB,OAAO,EAGL,aAAa,EAMd,oBAAgB;AAEjB,eAAO,MAAM,oBAAoB;;;;;;EAS/B,CAAA;AAEF;;;;GAIG;AACH,wBAAsB,uBAAuB,CAC3C,IAAI,EAAE,CAAC,CAAC,KAAK,CAAC,OAAO,aAAa,CAAC,iBA8CpC"}
|
|
@@ -0,0 +1,58 @@
|
|
|
1
|
+
import { log } from "@clack/prompts";
|
|
2
|
+
import { defineCommand } from "citty";
|
|
3
|
+
import { commandNames } from "../command-names.js";
|
|
4
|
+
import { apiClient } from "../lib/api-client.js";
|
|
5
|
+
import { accent, dimmed, renderTable } from "../lib/io.js";
|
|
6
|
+
import { clearSpinner, startSpinner } from "../lib/spinner.js";
|
|
7
|
+
import { createCommandRun, ORG_OPT, orgOptsSchema, output, pluralize, requireAuthenticatedSession, sessionIntro, useOrganization, } from "../utils.js";
|
|
8
|
+
export const orgApiKeyListCommand = defineCommand({
|
|
9
|
+
meta: {
|
|
10
|
+
name: commandNames.org.apiKey.list,
|
|
11
|
+
description: "List organization API keys",
|
|
12
|
+
},
|
|
13
|
+
args: {
|
|
14
|
+
...ORG_OPT,
|
|
15
|
+
},
|
|
16
|
+
run: createCommandRun(orgOptsSchema, listOrganizationApiKeys),
|
|
17
|
+
});
|
|
18
|
+
/**
|
|
19
|
+
* Lists the API keys owned by one organization.
|
|
20
|
+
*
|
|
21
|
+
* @param opts - Organization selector.
|
|
22
|
+
*/
|
|
23
|
+
export async function listOrganizationApiKeys(opts) {
|
|
24
|
+
const session = await requireAuthenticatedSession("list organization API keys");
|
|
25
|
+
output.normal(() => sessionIntro(session));
|
|
26
|
+
const organization = await useOrganization(opts);
|
|
27
|
+
startSpinner("Fetching API keys");
|
|
28
|
+
const apiKeys = await apiClient.apiKey.list({
|
|
29
|
+
organizationId: organization.id,
|
|
30
|
+
});
|
|
31
|
+
clearSpinner();
|
|
32
|
+
output
|
|
33
|
+
.normal(() => {
|
|
34
|
+
if (apiKeys.length === 0) {
|
|
35
|
+
log.warn(`No API keys for ${accent(organization.name)}.`);
|
|
36
|
+
return;
|
|
37
|
+
}
|
|
38
|
+
log.message(`${accent(String(apiKeys.length))} ${pluralize(apiKeys.length, "API key")}`);
|
|
39
|
+
console.log(renderTable({
|
|
40
|
+
columns: [
|
|
41
|
+
{
|
|
42
|
+
header: "API key",
|
|
43
|
+
cell: (apiKey) => `${apiKey.name ?? "Unnamed"}\n${dimmed(apiKey.id)}`,
|
|
44
|
+
},
|
|
45
|
+
{
|
|
46
|
+
header: "Prefix",
|
|
47
|
+
cell: (apiKey) => apiKey.start,
|
|
48
|
+
},
|
|
49
|
+
{
|
|
50
|
+
header: "Created",
|
|
51
|
+
cell: (apiKey) => new Date(apiKey.createdAt).toLocaleDateString(),
|
|
52
|
+
},
|
|
53
|
+
],
|
|
54
|
+
rows: apiKeys,
|
|
55
|
+
}));
|
|
56
|
+
})
|
|
57
|
+
.json(apiKeys);
|
|
58
|
+
}
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
import z from "zod";
|
|
2
|
+
/** Validates API key selection and replacement name options. */
|
|
3
|
+
declare const renameApiKeyOptsSchema: z.ZodObject<{
|
|
4
|
+
org: z.ZodOptional<z.ZodString>;
|
|
5
|
+
key: z.ZodOptional<z.ZodString>;
|
|
6
|
+
name: z.ZodPrefault<z.ZodNullable<z.ZodString>>;
|
|
7
|
+
}, z.core.$strip>;
|
|
8
|
+
export declare const orgApiKeyRenameCommand: import("citty").CommandDef<{
|
|
9
|
+
readonly name: {
|
|
10
|
+
readonly type: "string";
|
|
11
|
+
readonly description: "New name for the API key";
|
|
12
|
+
readonly alias: ["n"];
|
|
13
|
+
};
|
|
14
|
+
readonly org: {
|
|
15
|
+
type: "string";
|
|
16
|
+
description: string;
|
|
17
|
+
alias: string[];
|
|
18
|
+
};
|
|
19
|
+
readonly key: {
|
|
20
|
+
type: "string";
|
|
21
|
+
description: string;
|
|
22
|
+
alias: string[];
|
|
23
|
+
};
|
|
24
|
+
}>;
|
|
25
|
+
/**
|
|
26
|
+
* Renames an organization API key.
|
|
27
|
+
*
|
|
28
|
+
* @param opts - Organization, API key, and replacement name options.
|
|
29
|
+
*/
|
|
30
|
+
export declare function renameOrganizationApiKey(opts: z.infer<typeof renameApiKeyOptsSchema>): Promise<void>;
|
|
31
|
+
export {};
|
|
32
|
+
//# sourceMappingURL=org-api-key-rename.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"org-api-key-rename.d.ts","sourceRoot":"","sources":["../../../src/cli/commands/org-api-key-rename.ts"],"names":[],"mappings":"AAEA,OAAO,CAAC,MAAM,KAAK,CAAA;AAoBnB,gEAAgE;AAChE,QAAA,MAAM,sBAAsB;;;;iBAE1B,CAAA;AAEF,eAAO,MAAM,sBAAsB;;;;;;;;;;;;;;;;EAejC,CAAA;AAEF;;;;GAIG;AACH,wBAAsB,wBAAwB,CAC5C,IAAI,EAAE,CAAC,CAAC,KAAK,CAAC,OAAO,sBAAsB,CAAC,iBAiC7C"}
|
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
import { log } from "@clack/prompts";
|
|
2
|
+
import { defineCommand } from "citty";
|
|
3
|
+
import { commandNames } from "../command-names.js";
|
|
4
|
+
import { apiClient } from "../lib/api-client.js";
|
|
5
|
+
import { accent, dimmed } from "../lib/io.js";
|
|
6
|
+
import { clearSpinner, startSpinner } from "../lib/spinner.js";
|
|
7
|
+
import { API_KEY_OPT, apiKeyOptsSchema, createCommandRun, ORG_OPT, output, promptableOption, REASONABLE_NAME_SCHEMA, requireAuthenticatedSession, safelyPromptTextWithValidation, sessionIntro, useOrganization, useOrganizationApiKey, } from "../utils.js";
|
|
8
|
+
/** Validates API key selection and replacement name options. */
|
|
9
|
+
const renameApiKeyOptsSchema = apiKeyOptsSchema.extend({
|
|
10
|
+
name: promptableOption(REASONABLE_NAME_SCHEMA, "--name"),
|
|
11
|
+
});
|
|
12
|
+
export const orgApiKeyRenameCommand = defineCommand({
|
|
13
|
+
meta: {
|
|
14
|
+
name: commandNames.org.apiKey.rename,
|
|
15
|
+
description: "Rename an organization API key",
|
|
16
|
+
},
|
|
17
|
+
args: {
|
|
18
|
+
...API_KEY_OPT,
|
|
19
|
+
...ORG_OPT,
|
|
20
|
+
name: {
|
|
21
|
+
type: "string",
|
|
22
|
+
description: "New name for the API key",
|
|
23
|
+
alias: ["n"],
|
|
24
|
+
},
|
|
25
|
+
},
|
|
26
|
+
run: createCommandRun(renameApiKeyOptsSchema, renameOrganizationApiKey),
|
|
27
|
+
});
|
|
28
|
+
/**
|
|
29
|
+
* Renames an organization API key.
|
|
30
|
+
*
|
|
31
|
+
* @param opts - Organization, API key, and replacement name options.
|
|
32
|
+
*/
|
|
33
|
+
export async function renameOrganizationApiKey(opts) {
|
|
34
|
+
const session = await requireAuthenticatedSession("rename an organization API key");
|
|
35
|
+
output.normal(() => sessionIntro(session));
|
|
36
|
+
const organization = await useOrganization(opts);
|
|
37
|
+
const apiKey = await useOrganizationApiKey(organization.id, opts);
|
|
38
|
+
const newName = opts.name ??
|
|
39
|
+
(await safelyPromptTextWithValidation({
|
|
40
|
+
message: "What should the new API key name be?",
|
|
41
|
+
initialValue: apiKey.name ?? undefined,
|
|
42
|
+
}, REASONABLE_NAME_SCHEMA, "--name"));
|
|
43
|
+
startSpinner("Renaming API key");
|
|
44
|
+
// Retain the normalized API response until the spinner has cleared.
|
|
45
|
+
const renamed = await apiClient.apiKey.update({
|
|
46
|
+
keyId: apiKey.id,
|
|
47
|
+
name: newName,
|
|
48
|
+
organizationId: organization.id,
|
|
49
|
+
});
|
|
50
|
+
clearSpinner();
|
|
51
|
+
output
|
|
52
|
+
.normal(() => log.success(`Renamed to ${accent(newName)} ${dimmed(apiKey.id)}`))
|
|
53
|
+
.json(renamed);
|
|
54
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"org-api-key.d.ts","sourceRoot":"","sources":["../../../src/cli/commands/org-api-key.ts"],"names":[],"mappings":"AAOA,eAAO,MAAM,gBAAgB,qDAW3B,CAAA"}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import { defineCommand } from "citty";
|
|
2
|
+
import { commandNames } from "../command-names.js";
|
|
3
|
+
import { orgApiKeyCreateCommand } from "./org-api-key-create.js";
|
|
4
|
+
import { orgApiKeyDeleteCommand } from "./org-api-key-delete.js";
|
|
5
|
+
import { orgApiKeyListCommand } from "./org-api-key-list.js";
|
|
6
|
+
import { orgApiKeyRenameCommand } from "./org-api-key-rename.js";
|
|
7
|
+
export const orgApiKeyCommand = defineCommand({
|
|
8
|
+
meta: {
|
|
9
|
+
name: commandNames.org.apiKey.root,
|
|
10
|
+
description: "Manage organization API keys",
|
|
11
|
+
},
|
|
12
|
+
subCommands: {
|
|
13
|
+
[commandNames.org.apiKey.create]: orgApiKeyCreateCommand,
|
|
14
|
+
[commandNames.org.apiKey.delete]: orgApiKeyDeleteCommand,
|
|
15
|
+
[commandNames.org.apiKey.list]: orgApiKeyListCommand,
|
|
16
|
+
[commandNames.org.apiKey.rename]: orgApiKeyRenameCommand,
|
|
17
|
+
},
|
|
18
|
+
});
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import z from "zod";
|
|
2
|
+
import { orgOptsSchema } from "../utils.js";
|
|
3
|
+
export declare const orgBillingCommand: import("citty").CommandDef<{
|
|
4
|
+
readonly org: {
|
|
5
|
+
type: "string";
|
|
6
|
+
description: string;
|
|
7
|
+
alias: string[];
|
|
8
|
+
};
|
|
9
|
+
}>;
|
|
10
|
+
/**
|
|
11
|
+
* Opens Stripe Billing Portal for the resolved organization.
|
|
12
|
+
*
|
|
13
|
+
* @param opts - Validated options selecting the organization.
|
|
14
|
+
*/
|
|
15
|
+
export declare function openBillingPortal(opts: z.infer<typeof orgOptsSchema>): Promise<void>;
|
|
16
|
+
//# sourceMappingURL=org-billing.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"org-billing.d.ts","sourceRoot":"","sources":["../../../src/cli/commands/org-billing.ts"],"names":[],"mappings":"AAGA,OAAO,CAAC,MAAM,KAAK,CAAA;AAInB,OAAO,EAGL,aAAa,EAKd,oBAAgB;AAOjB,eAAO,MAAM,iBAAiB;;;;;;EAS5B,CAAA;AAEF;;;;GAIG;AACH,wBAAsB,iBAAiB,CAAC,IAAI,EAAE,CAAC,CAAC,KAAK,CAAC,OAAO,aAAa,CAAC,iBA8D1E"}
|
|
@@ -0,0 +1,78 @@
|
|
|
1
|
+
import { log } from "@clack/prompts";
|
|
2
|
+
import { defineCommand } from "citty";
|
|
3
|
+
import open from "open";
|
|
4
|
+
import { commandNames } from "../command-names.js";
|
|
5
|
+
import { authClient } from "../lib/auth-client.js";
|
|
6
|
+
import { env } from "../lib/env.js";
|
|
7
|
+
import { createCommandRun, ORG_OPT, orgOptsSchema, output, sessionIntro, requireAuthenticatedSession, useOrganization, } from "../utils.js";
|
|
8
|
+
import { dimmed } from "../lib/io.js";
|
|
9
|
+
import { isJsonOutput } from "../lib/json-output.js";
|
|
10
|
+
import { clearSpinner, startSpinner } from "../lib/spinner.js";
|
|
11
|
+
import { printEnterpriseContact, upgradeOrganization } from "./org-upgrade.js";
|
|
12
|
+
import { blue } from "ansis";
|
|
13
|
+
export const orgBillingCommand = defineCommand({
|
|
14
|
+
meta: {
|
|
15
|
+
name: commandNames.org.billing,
|
|
16
|
+
description: "Open the billing portal for an organization",
|
|
17
|
+
},
|
|
18
|
+
args: {
|
|
19
|
+
...ORG_OPT,
|
|
20
|
+
},
|
|
21
|
+
run: createCommandRun(orgOptsSchema, openBillingPortal),
|
|
22
|
+
});
|
|
23
|
+
/**
|
|
24
|
+
* Opens Stripe Billing Portal for the resolved organization.
|
|
25
|
+
*
|
|
26
|
+
* @param opts - Validated options selecting the organization.
|
|
27
|
+
*/
|
|
28
|
+
export async function openBillingPortal(opts) {
|
|
29
|
+
const session = await requireAuthenticatedSession("manage organization billing");
|
|
30
|
+
output.normal(() => sessionIntro(session));
|
|
31
|
+
const org = await useOrganization(opts);
|
|
32
|
+
startSpinner("Fetching billing details");
|
|
33
|
+
const activeSubscription = (await authClient.subscription.list({
|
|
34
|
+
query: {
|
|
35
|
+
referenceId: org.id,
|
|
36
|
+
customerType: "organization",
|
|
37
|
+
},
|
|
38
|
+
})).find((subscription) => subscription.status === "active" || subscription.status === "trialing") ?? null;
|
|
39
|
+
clearSpinner();
|
|
40
|
+
if (activeSubscription?.plan === "enterprise") {
|
|
41
|
+
printEnterpriseContact(org);
|
|
42
|
+
return;
|
|
43
|
+
}
|
|
44
|
+
if (!activeSubscription) {
|
|
45
|
+
await upgradeOrganization({
|
|
46
|
+
org: org.id,
|
|
47
|
+
plan: "pro",
|
|
48
|
+
}, { printSessionIntro: false });
|
|
49
|
+
return;
|
|
50
|
+
}
|
|
51
|
+
startSpinner("Opening billing portal");
|
|
52
|
+
const portalSession = await authClient.subscription.billingPortal({
|
|
53
|
+
customerType: "organization",
|
|
54
|
+
disableRedirect: true,
|
|
55
|
+
referenceId: org.id,
|
|
56
|
+
returnUrl: appUrl("/billing/cli/done?status=portal"),
|
|
57
|
+
});
|
|
58
|
+
clearSpinner();
|
|
59
|
+
output
|
|
60
|
+
.normal(() => {
|
|
61
|
+
log.success("Billing portal ready");
|
|
62
|
+
log.message(`${dimmed `URL:`} ${blue.underline.link(portalSession.url, "Open billing portal")}`, {
|
|
63
|
+
symbol: blue `↗`,
|
|
64
|
+
});
|
|
65
|
+
})
|
|
66
|
+
.json({ url: portalSession.url, organization: org });
|
|
67
|
+
if (isJsonOutput())
|
|
68
|
+
return;
|
|
69
|
+
await open(portalSession.url, { wait: false }).catch(() => null);
|
|
70
|
+
}
|
|
71
|
+
/**
|
|
72
|
+
* Resolves an application-relative path against the configured app origin.
|
|
73
|
+
*
|
|
74
|
+
* @param path - Application path to resolve.
|
|
75
|
+
*/
|
|
76
|
+
function appUrl(path) {
|
|
77
|
+
return new URL(path, env.APP_ORIGIN).toString();
|
|
78
|
+
}
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import z from "zod";
|
|
2
|
+
/** Arguments accepted by the organization creation command. */
|
|
3
|
+
declare const createOrgOptsSchema: z.ZodObject<{
|
|
4
|
+
name: z.ZodPrefault<z.ZodNullable<z.ZodString>>;
|
|
5
|
+
}, z.core.$strip>;
|
|
6
|
+
export declare const orgCreateCommand: import("citty").CommandDef<{
|
|
7
|
+
readonly name: {
|
|
8
|
+
readonly type: "string";
|
|
9
|
+
readonly description: "The name of the organization";
|
|
10
|
+
readonly alias: ["n"];
|
|
11
|
+
};
|
|
12
|
+
}>;
|
|
13
|
+
/**
|
|
14
|
+
* Creates an organization for the authenticated user.
|
|
15
|
+
*
|
|
16
|
+
* @param opts - Validated options containing an optional organization name.
|
|
17
|
+
*/
|
|
18
|
+
export declare function createOrganization(opts: z.infer<typeof createOrgOptsSchema>): Promise<void>;
|
|
19
|
+
export {};
|
|
20
|
+
//# sourceMappingURL=org-create.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"org-create.d.ts","sourceRoot":"","sources":["../../../src/cli/commands/org-create.ts"],"names":[],"mappings":"AAEA,OAAO,CAAC,MAAM,KAAK,CAAA;AAenB,+DAA+D;AAC/D,QAAA,MAAM,mBAAmB;;iBAEvB,CAAA;AAEF,eAAO,MAAM,gBAAgB;;;;;;EAa3B,CAAA;AAEF;;;;GAIG;AACH,wBAAsB,kBAAkB,CACtC,IAAI,EAAE,CAAC,CAAC,KAAK,CAAC,OAAO,mBAAmB,CAAC,iBAwB1C"}
|
|
@@ -0,0 +1,64 @@
|
|
|
1
|
+
import { log } from "@clack/prompts";
|
|
2
|
+
import { defineCommand } from "citty";
|
|
3
|
+
import z from "zod";
|
|
4
|
+
import { commandNames } from "../command-names.js";
|
|
5
|
+
import { apiClient } from "../lib/api-client.js";
|
|
6
|
+
import { createCommandRun, output, promptableOption, REASONABLE_NAME_SCHEMA, requireAuthenticatedSession, safelyPromptTextWithValidation, sessionIntro, } from "../utils.js";
|
|
7
|
+
import { accent, dimmed } from "../lib/io.js";
|
|
8
|
+
import { clearSpinner, startSpinner } from "../lib/spinner.js";
|
|
9
|
+
/** Arguments accepted by the organization creation command. */
|
|
10
|
+
const createOrgOptsSchema = z.object({
|
|
11
|
+
name: promptableOption(REASONABLE_NAME_SCHEMA, "--name"),
|
|
12
|
+
});
|
|
13
|
+
export const orgCreateCommand = defineCommand({
|
|
14
|
+
meta: {
|
|
15
|
+
name: commandNames.org.create,
|
|
16
|
+
description: "Create a new organization",
|
|
17
|
+
},
|
|
18
|
+
args: {
|
|
19
|
+
name: {
|
|
20
|
+
type: "string",
|
|
21
|
+
description: "The name of the organization",
|
|
22
|
+
alias: ["n"],
|
|
23
|
+
},
|
|
24
|
+
},
|
|
25
|
+
run: createCommandRun(createOrgOptsSchema, createOrganization),
|
|
26
|
+
});
|
|
27
|
+
/**
|
|
28
|
+
* Creates an organization for the authenticated user.
|
|
29
|
+
*
|
|
30
|
+
* @param opts - Validated options containing an optional organization name.
|
|
31
|
+
*/
|
|
32
|
+
export async function createOrganization(opts) {
|
|
33
|
+
const session = await requireAuthenticatedSession("create an organization");
|
|
34
|
+
output.normal(() => sessionIntro(session));
|
|
35
|
+
let name = opts.name;
|
|
36
|
+
if (name == null) {
|
|
37
|
+
name = await promptName(session.user.name &&
|
|
38
|
+
!session.user.isAnonymous &&
|
|
39
|
+
!z.email().safeParse(session.user.name).success
|
|
40
|
+
? session.user.name
|
|
41
|
+
: null);
|
|
42
|
+
}
|
|
43
|
+
startSpinner("Creating organization");
|
|
44
|
+
const org = await apiClient.org.create({ name });
|
|
45
|
+
clearSpinner();
|
|
46
|
+
output
|
|
47
|
+
.normal(() => log.success(`Created ${accent(org.name)} ${dimmed(org.id)}`))
|
|
48
|
+
.json(org);
|
|
49
|
+
}
|
|
50
|
+
/**
|
|
51
|
+
* Prompts for an organization name and validates the response.
|
|
52
|
+
*
|
|
53
|
+
* @param userName - User name used to derive the suggested organization name.
|
|
54
|
+
*/
|
|
55
|
+
async function promptName(userName) {
|
|
56
|
+
const defaultName = userName
|
|
57
|
+
? `${userName}'s Organization`
|
|
58
|
+
: "My Organization";
|
|
59
|
+
return await safelyPromptTextWithValidation({
|
|
60
|
+
message: "What should we name the organization?",
|
|
61
|
+
placeholder: defaultName,
|
|
62
|
+
defaultValue: defaultName,
|
|
63
|
+
}, REASONABLE_NAME_SCHEMA, "--name");
|
|
64
|
+
}
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
import z from "zod";
|
|
2
|
+
/** Arguments accepted by the organization deletion command. */
|
|
3
|
+
declare const deleteOrgOptsSchema: z.ZodObject<{
|
|
4
|
+
org: z.ZodOptional<z.ZodString>;
|
|
5
|
+
yes: z.ZodDefault<z.ZodBoolean>;
|
|
6
|
+
}, z.core.$strip>;
|
|
7
|
+
export declare const orgDeleteCommand: import("citty").CommandDef<{
|
|
8
|
+
readonly yes: {
|
|
9
|
+
readonly type: "boolean";
|
|
10
|
+
readonly description: "Skip confirmation prompt";
|
|
11
|
+
readonly alias: ["y"];
|
|
12
|
+
readonly default: false;
|
|
13
|
+
};
|
|
14
|
+
readonly org: {
|
|
15
|
+
type: "string";
|
|
16
|
+
description: string;
|
|
17
|
+
alias: string[];
|
|
18
|
+
};
|
|
19
|
+
}>;
|
|
20
|
+
/**
|
|
21
|
+
* Deletes an organization after confirmation.
|
|
22
|
+
*
|
|
23
|
+
* @param opts - Validated organization selector and confirmation options.
|
|
24
|
+
*/
|
|
25
|
+
export declare function deleteOrganization(opts: z.infer<typeof deleteOrgOptsSchema>): Promise<void>;
|
|
26
|
+
export {};
|
|
27
|
+
//# sourceMappingURL=org-delete.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"org-delete.d.ts","sourceRoot":"","sources":["../../../src/cli/commands/org-delete.ts"],"names":[],"mappings":"AAEA,OAAO,CAAC,MAAM,KAAK,CAAA;AAgBnB,+DAA+D;AAC/D,QAAA,MAAM,mBAAmB;;;iBAEvB,CAAA;AAEF,eAAO,MAAM,gBAAgB;;;;;;;;;;;;EAe3B,CAAA;AAEF;;;;GAIG;AACH,wBAAsB,kBAAkB,CACtC,IAAI,EAAE,CAAC,CAAC,KAAK,CAAC,OAAO,mBAAmB,CAAC,iBA6B1C"}
|
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
import { confirm, log } from "@clack/prompts";
|
|
2
|
+
import { defineCommand } from "citty";
|
|
3
|
+
import z from "zod";
|
|
4
|
+
import { commandNames } from "../command-names.js";
|
|
5
|
+
import { apiClient } from "../lib/api-client.js";
|
|
6
|
+
import { accent, dimmed } from "../lib/io.js";
|
|
7
|
+
import { clearSpinner, startSpinner } from "../lib/spinner.js";
|
|
8
|
+
import { ORG_OPT, createCommandRun, orgOptsSchema, output, safelyPrompt, sessionIntro, useOrganization, useSession, } from "../utils.js";
|
|
9
|
+
/** Arguments accepted by the organization deletion command. */
|
|
10
|
+
const deleteOrgOptsSchema = orgOptsSchema.extend({
|
|
11
|
+
yes: z.boolean().default(false),
|
|
12
|
+
});
|
|
13
|
+
export const orgDeleteCommand = defineCommand({
|
|
14
|
+
meta: {
|
|
15
|
+
name: commandNames.org.delete,
|
|
16
|
+
description: "Delete an organization",
|
|
17
|
+
},
|
|
18
|
+
args: {
|
|
19
|
+
...ORG_OPT,
|
|
20
|
+
yes: {
|
|
21
|
+
type: "boolean",
|
|
22
|
+
description: "Skip confirmation prompt",
|
|
23
|
+
alias: ["y"],
|
|
24
|
+
default: false,
|
|
25
|
+
},
|
|
26
|
+
},
|
|
27
|
+
run: createCommandRun(deleteOrgOptsSchema, deleteOrganization),
|
|
28
|
+
});
|
|
29
|
+
/**
|
|
30
|
+
* Deletes an organization after confirmation.
|
|
31
|
+
*
|
|
32
|
+
* @param opts - Validated organization selector and confirmation options.
|
|
33
|
+
*/
|
|
34
|
+
export async function deleteOrganization(opts) {
|
|
35
|
+
const session = await useSession();
|
|
36
|
+
output.normal(() => sessionIntro(session));
|
|
37
|
+
const org = await useOrganization(opts);
|
|
38
|
+
if (!opts.yes) {
|
|
39
|
+
if (!(await safelyPrompt(() => confirm({
|
|
40
|
+
message: `Are you sure you want to delete ${accent(org.name)}? This cannot be undone.`,
|
|
41
|
+
initialValue: false,
|
|
42
|
+
}), "--yes"))) {
|
|
43
|
+
output.json({ cancelled: true });
|
|
44
|
+
return;
|
|
45
|
+
}
|
|
46
|
+
}
|
|
47
|
+
startSpinner("Deleting organization");
|
|
48
|
+
await apiClient.org.delete({ organizationId: org.id });
|
|
49
|
+
clearSpinner();
|
|
50
|
+
output
|
|
51
|
+
.normal(() => log.success(`Deleted ${accent(org.name)} ${dimmed(org.id)}`))
|
|
52
|
+
.json({ deleted: true, organization: org });
|
|
53
|
+
}
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
import z from "zod";
|
|
2
|
+
/** Arguments accepted by the organization invitation command. */
|
|
3
|
+
declare const inviteOrgOptsSchema: z.ZodObject<{
|
|
4
|
+
org: z.ZodOptional<z.ZodString>;
|
|
5
|
+
email: z.ZodPrefault<z.ZodNullable<z.ZodEmail>>;
|
|
6
|
+
role: z.ZodDefault<z.ZodEnum<{
|
|
7
|
+
member: "member";
|
|
8
|
+
admin: "admin";
|
|
9
|
+
owner: "owner";
|
|
10
|
+
}>>;
|
|
11
|
+
}, z.core.$strip>;
|
|
12
|
+
export declare const orgInviteCommand: import("citty").CommandDef<{
|
|
13
|
+
readonly org: {
|
|
14
|
+
type: "string";
|
|
15
|
+
description: string;
|
|
16
|
+
alias: string[];
|
|
17
|
+
};
|
|
18
|
+
readonly email: {
|
|
19
|
+
readonly type: "positional";
|
|
20
|
+
readonly description: "Email address to invite";
|
|
21
|
+
readonly required: false;
|
|
22
|
+
};
|
|
23
|
+
readonly role: {
|
|
24
|
+
readonly type: "enum";
|
|
25
|
+
readonly options: ["member", "admin", "owner"];
|
|
26
|
+
readonly description: `Role to assign (${string})`;
|
|
27
|
+
readonly alias: ["r"];
|
|
28
|
+
readonly default: "member";
|
|
29
|
+
};
|
|
30
|
+
}>;
|
|
31
|
+
/**
|
|
32
|
+
* Invites a user to the resolved organization by email.
|
|
33
|
+
*
|
|
34
|
+
* @param opts - Validated organization, email, and role options.
|
|
35
|
+
* @throws When the organization's seat limit has been reached.
|
|
36
|
+
*/
|
|
37
|
+
export declare function inviteMember(opts: z.infer<typeof inviteOrgOptsSchema>): Promise<void>;
|
|
38
|
+
export {};
|
|
39
|
+
//# sourceMappingURL=org-invite.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"org-invite.d.ts","sourceRoot":"","sources":["../../../src/cli/commands/org-invite.ts"],"names":[],"mappings":"AAEA,OAAO,CAAC,MAAM,KAAK,CAAA;AAoBnB,iEAAiE;AACjE,QAAA,MAAM,mBAAmB;;;;;;;;iBAGvB,CAAA;AAEF,eAAO,MAAM,gBAAgB;;;;;;;;;;;;;;;;;;EAqB3B,CAAA;AAEF;;;;;GAKG;AACH,wBAAsB,YAAY,CAAC,IAAI,EAAE,CAAC,CAAC,KAAK,CAAC,OAAO,mBAAmB,CAAC,iBA4C3E"}
|