@kindgi/cli 0.1.8-rc.0 → 0.1.9-rc.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 +59 -2
- package/dist/api-address.d.ts +104 -12
- package/dist/api-address.d.ts.map +1 -1
- package/dist/api-address.js +169 -30
- package/dist/api-address.js.map +1 -1
- package/dist/cli.js +12 -2
- package/dist/cli.js.map +1 -1
- package/dist/commands/approvals.d.ts.map +1 -1
- package/dist/commands/approvals.js +15 -3
- package/dist/commands/approvals.js.map +1 -1
- package/dist/commands/auth.d.ts.map +1 -1
- package/dist/commands/auth.js +27 -0
- package/dist/commands/auth.js.map +1 -1
- package/dist/commands/build.d.ts +18 -0
- package/dist/commands/build.d.ts.map +1 -1
- package/dist/commands/build.js +118 -13
- package/dist/commands/build.js.map +1 -1
- package/dist/commands/conversations.d.ts.map +1 -1
- package/dist/commands/conversations.js +13 -3
- package/dist/commands/conversations.js.map +1 -1
- package/dist/commands/deploy.d.ts.map +1 -1
- package/dist/commands/deploy.js +235 -53
- package/dist/commands/deploy.js.map +1 -1
- package/dist/commands/deployments.d.ts +3 -0
- package/dist/commands/deployments.d.ts.map +1 -0
- package/dist/commands/deployments.js +196 -0
- package/dist/commands/deployments.js.map +1 -0
- package/dist/commands/doctor.d.ts +1 -5
- package/dist/commands/doctor.d.ts.map +1 -1
- package/dist/commands/doctor.js +42 -22
- package/dist/commands/doctor.js.map +1 -1
- package/dist/commands/egress.d.ts +9 -0
- package/dist/commands/egress.d.ts.map +1 -0
- package/dist/commands/egress.js +40 -0
- package/dist/commands/egress.js.map +1 -0
- package/dist/commands/env-scoped.d.ts +5 -0
- package/dist/commands/env-scoped.d.ts.map +1 -1
- package/dist/commands/env-scoped.js +64 -19
- package/dist/commands/env-scoped.js.map +1 -1
- package/dist/commands/env.d.ts.map +1 -1
- package/dist/commands/env.js +91 -30
- package/dist/commands/env.js.map +1 -1
- package/dist/commands/environments.d.ts +6 -0
- package/dist/commands/environments.d.ts.map +1 -0
- package/dist/commands/environments.js +166 -0
- package/dist/commands/environments.js.map +1 -0
- package/dist/commands/exports.d.ts.map +1 -1
- package/dist/commands/exports.js +118 -3
- package/dist/commands/exports.js.map +1 -1
- package/dist/commands/feedback.d.ts +1 -2
- package/dist/commands/feedback.d.ts.map +1 -1
- package/dist/commands/feedback.js +55 -24
- package/dist/commands/feedback.js.map +1 -1
- package/dist/commands/helpers.d.ts +6 -0
- package/dist/commands/helpers.d.ts.map +1 -1
- package/dist/commands/helpers.js +8 -0
- package/dist/commands/helpers.js.map +1 -1
- package/dist/commands/index.d.ts.map +1 -1
- package/dist/commands/index.js +12 -0
- package/dist/commands/index.js.map +1 -1
- package/dist/commands/license.d.ts +3 -0
- package/dist/commands/license.d.ts.map +1 -1
- package/dist/commands/license.js +1 -1
- package/dist/commands/license.js.map +1 -1
- package/dist/commands/people.d.ts.map +1 -1
- package/dist/commands/people.js +105 -10
- package/dist/commands/people.js.map +1 -1
- package/dist/commands/projects.d.ts.map +1 -1
- package/dist/commands/projects.js +133 -11
- package/dist/commands/projects.js.map +1 -1
- package/dist/commands/promote.d.ts +38 -0
- package/dist/commands/promote.d.ts.map +1 -0
- package/dist/commands/promote.js +371 -0
- package/dist/commands/promote.js.map +1 -0
- package/dist/commands/proposals.d.ts.map +1 -1
- package/dist/commands/proposals.js +2 -1
- package/dist/commands/proposals.js.map +1 -1
- package/dist/commands/providers.d.ts.map +1 -1
- package/dist/commands/providers.js +29 -5
- package/dist/commands/providers.js.map +1 -1
- package/dist/commands/schedules.d.ts.map +1 -1
- package/dist/commands/schedules.js +30 -2
- package/dist/commands/schedules.js.map +1 -1
- package/dist/commands/secrets.d.ts.map +1 -1
- package/dist/commands/secrets.js +65 -40
- package/dist/commands/secrets.js.map +1 -1
- package/dist/commands/sign-in.d.ts +3 -0
- package/dist/commands/sign-in.d.ts.map +1 -0
- package/dist/commands/sign-in.js +61 -0
- package/dist/commands/sign-in.js.map +1 -0
- package/dist/commands/sites.d.ts +3 -0
- package/dist/commands/sites.d.ts.map +1 -0
- package/dist/commands/sites.js +244 -0
- package/dist/commands/sites.js.map +1 -0
- package/dist/commands/tools.d.ts.map +1 -1
- package/dist/commands/tools.js +2 -2
- package/dist/commands/tools.js.map +1 -1
- package/dist/commands/types.d.ts +11 -0
- package/dist/commands/types.d.ts.map +1 -1
- package/dist/commands/webhooks.d.ts.map +1 -1
- package/dist/commands/webhooks.js +38 -2
- package/dist/commands/webhooks.js.map +1 -1
- package/dist/config.d.ts +13 -0
- package/dist/config.d.ts.map +1 -1
- package/dist/config.js +20 -7
- package/dist/config.js.map +1 -1
- package/dist/context.d.ts +38 -2
- package/dist/context.d.ts.map +1 -1
- package/dist/context.js +12 -1
- package/dist/context.js.map +1 -1
- package/dist/deploy/defaults.d.ts.map +1 -1
- package/dist/deploy/defaults.js +7 -1
- package/dist/deploy/defaults.js.map +1 -1
- package/dist/deploy/pack-service-text.d.ts +29 -0
- package/dist/deploy/pack-service-text.d.ts.map +1 -0
- package/dist/deploy/pack-service-text.js +72 -0
- package/dist/deploy/pack-service-text.js.map +1 -0
- package/dist/deploy/post.d.ts +17 -4
- package/dist/deploy/post.d.ts.map +1 -1
- package/dist/deploy/post.js +177 -60
- package/dist/deploy/post.js.map +1 -1
- package/dist/deploy/promotion-path.d.ts +44 -0
- package/dist/deploy/promotion-path.d.ts.map +1 -0
- package/dist/deploy/promotion-path.js +86 -0
- package/dist/deploy/promotion-path.js.map +1 -0
- package/dist/deploy/response.d.ts +3 -0
- package/dist/deploy/response.d.ts.map +1 -1
- package/dist/deploy/response.js +66 -12
- package/dist/deploy/response.js.map +1 -1
- package/dist/deploy/runners.d.ts +99 -5
- package/dist/deploy/runners.d.ts.map +1 -1
- package/dist/dev/java-builder.d.ts.map +1 -1
- package/dist/dev/java-builder.js +19 -3
- package/dist/dev/java-builder.js.map +1 -1
- package/dist/dev/python-builder.d.ts.map +1 -1
- package/dist/dev/python-builder.js +18 -3
- package/dist/dev/python-builder.js.map +1 -1
- package/dist/dev/runtime-container.d.ts +28 -3
- package/dist/dev/runtime-container.d.ts.map +1 -1
- package/dist/dev/runtime-container.js +103 -36
- package/dist/dev/runtime-container.js.map +1 -1
- package/dist/dev/runtime-image.d.ts +1 -1
- package/dist/dev/runtime-image.js +1 -1
- package/dist/dev/scala-builder.d.ts.map +1 -1
- package/dist/dev/scala-builder.js +55 -21
- package/dist/dev/scala-builder.js.map +1 -1
- package/dist/dev/shared-watch.d.ts +30 -0
- package/dist/dev/shared-watch.d.ts.map +1 -1
- package/dist/dev/shared-watch.js +46 -1
- package/dist/dev/shared-watch.js.map +1 -1
- package/dist/env/pack-env-hint.d.ts +52 -0
- package/dist/env/pack-env-hint.d.ts.map +1 -0
- package/dist/env/pack-env-hint.js +57 -0
- package/dist/env/pack-env-hint.js.map +1 -0
- package/dist/env/pack-env-plan.d.ts +2 -0
- package/dist/env/pack-env-plan.d.ts.map +1 -1
- package/dist/env/pack-env-plan.js +2 -1
- package/dist/env/pack-env-plan.js.map +1 -1
- package/dist/env-projects.d.ts +23 -0
- package/dist/env-projects.d.ts.map +1 -0
- package/dist/env-projects.js +28 -0
- package/dist/env-projects.js.map +1 -0
- package/dist/exports/create.d.ts +71 -0
- package/dist/exports/create.d.ts.map +1 -0
- package/dist/exports/create.js +576 -0
- package/dist/exports/create.js.map +1 -0
- package/dist/exports/plan.d.ts +69 -0
- package/dist/exports/plan.d.ts.map +1 -0
- package/dist/exports/plan.js +496 -0
- package/dist/exports/plan.js.map +1 -0
- package/dist/exports/reader.d.ts +48 -0
- package/dist/exports/reader.d.ts.map +1 -0
- package/dist/exports/reader.js +181 -0
- package/dist/exports/reader.js.map +1 -0
- package/dist/feedback/entries.d.ts +53 -0
- package/dist/feedback/entries.d.ts.map +1 -0
- package/dist/feedback/entries.js +173 -0
- package/dist/feedback/entries.js.map +1 -0
- package/dist/feedback/intake.d.ts +37 -0
- package/dist/feedback/intake.d.ts.map +1 -0
- package/dist/feedback/intake.js +101 -0
- package/dist/feedback/intake.js.map +1 -0
- package/dist/feedback/protocol.d.ts +111 -0
- package/dist/feedback/protocol.d.ts.map +1 -0
- package/dist/feedback/protocol.js +143 -0
- package/dist/feedback/protocol.js.map +1 -0
- package/dist/feedback/redact.d.ts +34 -0
- package/dist/feedback/redact.d.ts.map +1 -0
- package/dist/feedback/redact.js +258 -0
- package/dist/feedback/redact.js.map +1 -0
- package/dist/feedback/report.d.ts +51 -0
- package/dist/feedback/report.d.ts.map +1 -0
- package/dist/feedback/report.js +122 -0
- package/dist/feedback/report.js.map +1 -0
- package/dist/feedback/run.d.ts +21 -0
- package/dist/feedback/run.d.ts.map +1 -0
- package/dist/feedback/run.js +578 -0
- package/dist/feedback/run.js.map +1 -0
- package/dist/feedback/store.d.ts +24 -0
- package/dist/feedback/store.d.ts.map +1 -0
- package/dist/feedback/store.js +117 -0
- package/dist/feedback/store.js.map +1 -0
- package/dist/main.d.ts +6 -0
- package/dist/main.d.ts.map +1 -1
- package/dist/main.js +86 -5
- package/dist/main.js.map +1 -1
- package/dist/node-version.d.ts +13 -0
- package/dist/node-version.d.ts.map +1 -0
- package/dist/node-version.js +37 -0
- package/dist/node-version.js.map +1 -0
- package/dist/parse.d.ts +8 -2
- package/dist/parse.d.ts.map +1 -1
- package/dist/parse.js +7 -2
- package/dist/parse.js.map +1 -1
- package/dist/project-ref.d.ts +44 -0
- package/dist/project-ref.d.ts.map +1 -0
- package/dist/project-ref.js +69 -0
- package/dist/project-ref.js.map +1 -0
- package/dist/sdk-skills/kindgi-authoring-agents/SKILL.md +15 -2
- package/dist/sdk-skills/kindgi-authoring-flows/SKILL.md +1 -1
- package/dist/sdk-skills/kindgi-authoring-guardrails/SKILL.md +44 -7
- package/dist/sdk-skills/kindgi-authoring-mcp-servers/SKILL.md +11 -2
- package/dist/sdk-skills/kindgi-authoring-providers/SKILL.md +60 -13
- package/dist/sdk-skills/kindgi-authoring-tools/SKILL.md +19 -2
- package/dist/sdk-skills/kindgi-framework-feedback/SKILL.md +82 -3
- package/dist/sdk-skills/kindgi-getting-started/SKILL.md +1 -1
- package/dist/sdk-skills/kindgi-java-authoring-agents/SKILL.md +17 -3
- package/dist/sdk-skills/kindgi-java-authoring-flows/SKILL.md +1 -1
- package/dist/sdk-skills/kindgi-java-authoring-guardrails/SKILL.md +43 -6
- package/dist/sdk-skills/kindgi-java-authoring-tools/SKILL.md +19 -2
- package/dist/sdk-skills/kindgi-java-getting-started/SKILL.md +1 -1
- package/dist/sdk-skills/kindgi-python-authoring-agents/SKILL.md +17 -3
- package/dist/sdk-skills/kindgi-python-authoring-flows/SKILL.md +1 -1
- package/dist/sdk-skills/kindgi-python-authoring-guardrails/SKILL.md +49 -13
- package/dist/sdk-skills/kindgi-python-authoring-tools/SKILL.md +27 -3
- package/dist/sdk-skills/kindgi-python-getting-started/SKILL.md +1 -1
- package/dist/sdk-skills/kindgi-scala-authoring-agents/SKILL.md +17 -3
- package/dist/sdk-skills/kindgi-scala-authoring-flows/SKILL.md +1 -1
- package/dist/sdk-skills/kindgi-scala-authoring-guardrails/SKILL.md +43 -6
- package/dist/sdk-skills/kindgi-scala-authoring-tools/SKILL.md +19 -2
- package/dist/sdk-skills/kindgi-scala-getting-started/SKILL.md +1 -1
- package/dist/sdk-skills/kindgi-using/SKILL.md +1 -1
- package/dist/slug.d.ts +18 -0
- package/dist/slug.d.ts.map +1 -0
- package/dist/slug.js +29 -0
- package/dist/slug.js.map +1 -0
- package/dist/templates/drupal/AGENTS.md +2 -0
- package/dist/templates/java/AGENTS.md +2 -0
- package/dist/templates/minimal/AGENTS.md +2 -0
- package/dist/templates/python/AGENTS.md +2 -0
- package/dist/templates/sample/AGENTS.md +2 -0
- package/dist/templates/scala/AGENTS.md +2 -0
- package/dist/templates/woocommerce/AGENTS.md +11 -4
- package/dist/templates/woocommerce/README.md.tmpl +47 -4
- package/dist/templates/woocommerce/agents/store-agent/index.test.ts.tmpl +13 -0
- package/dist/templates/woocommerce/agents/store-agent/index.ts.tmpl +11 -1
- package/dist/templates/woocommerce/tools/publish-product/index.ts.tmpl +7 -1
- package/dist/templates/woocommerce/tools/refund/index.ts.tmpl +7 -2
- package/dist/templates/woocommerce/tools/refund-large/index.ts.tmpl +8 -2
- package/dist/templates/woocommerce/tools/set-price/index.ts.tmpl +6 -0
- package/dist/value-target.d.ts +139 -0
- package/dist/value-target.d.ts.map +1 -0
- package/dist/value-target.js +231 -0
- package/dist/value-target.js.map +1 -0
- package/package.json +13 -13
package/dist/commands/people.js
CHANGED
|
@@ -8,7 +8,10 @@ import { integerFlag, requiredPositional, runSdk, runSdkRendered, stringFlag, }
|
|
|
8
8
|
* tenant member: they can read the tenant's settings), gives them a role
|
|
9
9
|
* (a project or team membership, or tenant admin with
|
|
10
10
|
* `kindgi people grant <id> --tenant-admin`) and mints their first key:
|
|
11
|
-
* `kindgi tokens create --for=user:<id>`.
|
|
11
|
+
* `kindgi tokens create --for=user:<id>`. A person added with an email is
|
|
12
|
+
* invited where the runtime invites people: they sign in before the
|
|
13
|
+
* invitation expires, or a tenant admin sends it again
|
|
14
|
+
* (`kindgi people invite <id>`).
|
|
12
15
|
*/
|
|
13
16
|
const TABLE = {
|
|
14
17
|
rows: (page) => page.data,
|
|
@@ -16,6 +19,7 @@ const TABLE = {
|
|
|
16
19
|
{ header: 'ID', get: (u) => String(u.userId) },
|
|
17
20
|
{ header: 'NAME', get: (u) => u.displayName ?? '' },
|
|
18
21
|
{ header: 'EMAIL', get: (u) => u.primaryEmail ?? '' },
|
|
22
|
+
{ header: 'STATE', get: (u) => u.invite?.state ?? '' },
|
|
19
23
|
{ header: 'ADDED', get: (u) => String(u.createdAt) },
|
|
20
24
|
],
|
|
21
25
|
};
|
|
@@ -30,40 +34,119 @@ const TABLE_WITH_REMOVED = {
|
|
|
30
34
|
},
|
|
31
35
|
],
|
|
32
36
|
};
|
|
37
|
+
/**
|
|
38
|
+
* What became of an invitation's email, in a line, for a person who has
|
|
39
|
+
* one open; nothing for a runtime that doesn't invite, or no invitation.
|
|
40
|
+
*/
|
|
41
|
+
function inviteLine(person, email) {
|
|
42
|
+
if (email === undefined)
|
|
43
|
+
return '';
|
|
44
|
+
const resend = `kindgi people invite ${String(person.userId)}`;
|
|
45
|
+
const until = person.invite !== undefined ? ` before it expires (${String(person.invite.expiresAt)})` : '';
|
|
46
|
+
if (email.sent) {
|
|
47
|
+
return `The invitation went to ${person.primaryEmail ?? 'their email'}: they sign in with it${until}.\n`;
|
|
48
|
+
}
|
|
49
|
+
switch (email.reason) {
|
|
50
|
+
case 'no-email':
|
|
51
|
+
return 'No invitation: they have no email.\n';
|
|
52
|
+
case 'not-requested':
|
|
53
|
+
return `Invited, not emailed (--no-invite): tell them to sign in with ${person.primaryEmail ?? 'their email'}${until}.\n`;
|
|
54
|
+
case 'not-configured':
|
|
55
|
+
return `Invited, but this deployment sends no email: tell them to sign in through a provider with ${person.primaryEmail ?? 'their email'}${until}.\n`;
|
|
56
|
+
case 'capped':
|
|
57
|
+
return `Invited, but the tenant's invitations for today are used up: send it later (${resend}), or tell them to sign in${until}.\n`;
|
|
58
|
+
default:
|
|
59
|
+
return `Invited, but the invitation email didn't go out: send it again (${resend}), or tell them to sign in${until}.\n`;
|
|
60
|
+
}
|
|
61
|
+
}
|
|
33
62
|
const add = {
|
|
34
63
|
kind: 'leaf',
|
|
35
64
|
name: 'add',
|
|
36
|
-
description: "Add a person to the tenant; prints their id. They can read the tenant's settings at once; give them a project role to work on its agents and runs, and their first key (`kindgi tokens create --for=user:<id>`). Tenant admins only.",
|
|
37
|
-
usage: 'kindgi people add --name=<display-name> [--email=<email>]',
|
|
65
|
+
description: "Add a person to the tenant; prints their id. They can read the tenant's settings at once; give them a project role to work on its agents and runs, and their first key (`kindgi tokens create --for=user:<id>`). Where the runtime invites people, one added with an email is invited, and the invitation emailed unless `--no-invite`; it says whether it was. Tenant admins only.",
|
|
66
|
+
usage: 'kindgi people add --name=<display-name> [--email=<email>] [--no-invite]',
|
|
38
67
|
optionSpec: {
|
|
39
68
|
name: { type: 'string', description: 'Their name, as people see it.' },
|
|
40
69
|
email: { type: 'string', description: "Their email; unique among the tenant's people." },
|
|
70
|
+
'no-invite': {
|
|
71
|
+
type: 'boolean',
|
|
72
|
+
description: "Don't email the invitation: you tell them. They're still invited.",
|
|
73
|
+
},
|
|
41
74
|
},
|
|
42
75
|
run: (ctx) => runSdkRendered(ctx, 'people add', async () => {
|
|
43
76
|
const displayName = stringFlag(ctx, 'name');
|
|
44
77
|
if (displayName === undefined)
|
|
45
78
|
throw new UsageError('--name is required');
|
|
46
79
|
const email = stringFlag(ctx, 'email');
|
|
47
|
-
const
|
|
80
|
+
const created = await ctx.client().users.create({
|
|
48
81
|
displayName,
|
|
49
82
|
...(email !== undefined && { email }),
|
|
83
|
+
...(ctx.options['no-invite'] === true && { sendInvite: false }),
|
|
50
84
|
});
|
|
51
|
-
const added = {
|
|
85
|
+
const added = {
|
|
86
|
+
userId: created.userId,
|
|
87
|
+
displayName,
|
|
88
|
+
...(email !== undefined && { email }),
|
|
89
|
+
...(created.invite !== undefined && { invite: created.invite }),
|
|
90
|
+
...(created.inviteEmail !== undefined && { inviteEmail: created.inviteEmail }),
|
|
91
|
+
};
|
|
52
92
|
return {
|
|
53
93
|
stdout: renderJson(added, ctx.globals.format).stdout,
|
|
54
94
|
stderr: ctx.globals.format === 'quiet'
|
|
55
95
|
? ''
|
|
56
|
-
: `Added to the tenant: they can read its settings. Give them a project role to work on its agents and runs, then their first key: kindgi tokens create --for=user:${String(userId)}\n`,
|
|
96
|
+
: `Added to the tenant: they can read its settings. Give them a project role to work on its agents and runs, then their first key: kindgi tokens create --for=user:${String(created.userId)}\n${inviteLine(created, created.inviteEmail)}`,
|
|
97
|
+
};
|
|
98
|
+
}),
|
|
99
|
+
};
|
|
100
|
+
const invite = {
|
|
101
|
+
kind: 'leaf',
|
|
102
|
+
name: 'invite',
|
|
103
|
+
description: "Send a person's invitation again, for one who hasn't signed in yet: it gets a new expiry, and is emailed where the deployment sends email (it says whether it was). Refused for someone who has joined or was never invited. Tenant admins only.",
|
|
104
|
+
usage: 'kindgi people invite <user-id>',
|
|
105
|
+
run: (ctx) => runSdkRendered(ctx, 'people invite', async () => {
|
|
106
|
+
const id = requiredPositional(ctx, 0, 'user-id');
|
|
107
|
+
const renewed = await ctx.client().users.resendInvite(id);
|
|
108
|
+
return {
|
|
109
|
+
stdout: renderJson(renewed, ctx.globals.format).stdout,
|
|
110
|
+
stderr: ctx.globals.format === 'quiet' ? '' : inviteLine(renewed.user, renewed.inviteEmail),
|
|
111
|
+
};
|
|
112
|
+
}),
|
|
113
|
+
};
|
|
114
|
+
const secondFactor = {
|
|
115
|
+
kind: 'leaf',
|
|
116
|
+
name: 'second-factor',
|
|
117
|
+
description: 'Whether a person has a second factor set up (an authenticator app), since when, how many recovery codes they have left, and whether the workspace requires one. Tenant admins only.',
|
|
118
|
+
usage: 'kindgi people second-factor <user-id>',
|
|
119
|
+
run: (ctx) => runSdk(ctx, 'people second-factor', async () => ctx.client().users.secondFactor(requiredPositional(ctx, 0, 'user-id'))),
|
|
120
|
+
};
|
|
121
|
+
const resetSecondFactor = {
|
|
122
|
+
kind: 'leaf',
|
|
123
|
+
name: 'reset-second-factor',
|
|
124
|
+
description: "Remove a person's second factor, for a lost phone or lost recovery codes: they're told by email where the deployment sends it, and it's audited. Their sessions stay. Where the workspace requires one, they set one up again at their next sign-in. Tenant admins only, for anyone but themselves: your own you take off on My access, with a code from it.",
|
|
125
|
+
usage: 'kindgi people reset-second-factor <user-id>',
|
|
126
|
+
run: (ctx) => runSdkRendered(ctx, 'people reset-second-factor', async () => {
|
|
127
|
+
const id = requiredPositional(ctx, 0, 'user-id');
|
|
128
|
+
const reset = await ctx.client().users.removeSecondFactor(id);
|
|
129
|
+
return {
|
|
130
|
+
stdout: renderJson(reset, ctx.globals.format).stdout,
|
|
131
|
+
stderr: ctx.globals.format === 'quiet'
|
|
132
|
+
? ''
|
|
133
|
+
: reset.removed
|
|
134
|
+
? `Removed ${id}'s second factor: they set one up again at their next sign-in where the workspace requires one.\n`
|
|
135
|
+
: `${id} had no second factor set up: nothing changed.\n`,
|
|
57
136
|
};
|
|
58
137
|
}),
|
|
59
138
|
};
|
|
60
139
|
const list = {
|
|
61
140
|
kind: 'leaf',
|
|
62
141
|
name: 'list',
|
|
63
|
-
description: "List the tenant's people; `--query` matches the start of a name. People who were removed are left out unless `--include-removed`.",
|
|
64
|
-
usage: 'kindgi people list [--query=<name-prefix>] [--include-removed] [--limit=<n>] [--cursor=<c>] [--table]',
|
|
142
|
+
description: "List the tenant's people; `--query` matches the start of a name, `--pending` keeps the people invited who haven't signed in yet (STATE: pending or expired). People who were removed are left out unless `--include-removed`.",
|
|
143
|
+
usage: 'kindgi people list [--query=<name-prefix>] [--pending] [--include-removed] [--limit=<n>] [--cursor=<c>] [--table]',
|
|
65
144
|
optionSpec: {
|
|
66
145
|
query: { type: 'string', description: 'Only names starting with this.' },
|
|
146
|
+
pending: {
|
|
147
|
+
type: 'boolean',
|
|
148
|
+
description: "Only the people invited who haven't signed in yet (`invite`).",
|
|
149
|
+
},
|
|
67
150
|
'include-removed': {
|
|
68
151
|
type: 'boolean',
|
|
69
152
|
description: 'People who were removed too, with when (`unregisteredAt`).',
|
|
@@ -79,6 +162,7 @@ const list = {
|
|
|
79
162
|
...(query !== undefined && { query }),
|
|
80
163
|
...(limit !== undefined && { limit }),
|
|
81
164
|
...(cursor !== undefined && { cursor: cursor }),
|
|
165
|
+
...(ctx.options.pending === true && { pending: true }),
|
|
82
166
|
...(ctx.options['include-removed'] === true && { includeUnregistered: true }),
|
|
83
167
|
});
|
|
84
168
|
}, ctx.options['include-removed'] === true ? TABLE_WITH_REMOVED : TABLE),
|
|
@@ -160,7 +244,18 @@ const remove = {
|
|
|
160
244
|
export const peopleCommand = {
|
|
161
245
|
kind: 'group',
|
|
162
246
|
name: 'people',
|
|
163
|
-
description: "The tenant's people: add one, list, get, their grants, tenant admin given or taken (grant / ungrant), and remove one.",
|
|
164
|
-
subcommands: [
|
|
247
|
+
description: "The tenant's people: add one, send their invitation again, list, get, their grants, tenant admin given or taken (grant / ungrant), their second factor (read, or reset for a lost phone), and remove one.",
|
|
248
|
+
subcommands: [
|
|
249
|
+
add,
|
|
250
|
+
invite,
|
|
251
|
+
list,
|
|
252
|
+
get,
|
|
253
|
+
grants,
|
|
254
|
+
grant,
|
|
255
|
+
ungrant,
|
|
256
|
+
secondFactor,
|
|
257
|
+
resetSecondFactor,
|
|
258
|
+
remove,
|
|
259
|
+
],
|
|
165
260
|
};
|
|
166
261
|
//# sourceMappingURL=people.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"people.js","sourceRoot":"","sources":["../../src/commands/people.ts"],"names":[],"mappings":"AAAA,sCAAsC;AACtC,iCAAiC;AAKjC,OAAO,EAAE,UAAU,EAAE,MAAM,cAAc,CAAC;AAC1C,OAAO,EAAE,UAAU,EAAE,MAAM,cAAc,CAAC;AAC1C,OAAO,EAEL,WAAW,EACX,kBAAkB,EAClB,MAAM,EACN,cAAc,EACd,UAAU,GACX,MAAM,cAAc,CAAC;AAGtB
|
|
1
|
+
{"version":3,"file":"people.js","sourceRoot":"","sources":["../../src/commands/people.ts"],"names":[],"mappings":"AAAA,sCAAsC;AACtC,iCAAiC;AAKjC,OAAO,EAAE,UAAU,EAAE,MAAM,cAAc,CAAC;AAC1C,OAAO,EAAE,UAAU,EAAE,MAAM,cAAc,CAAC;AAC1C,OAAO,EAEL,WAAW,EACX,kBAAkB,EAClB,MAAM,EACN,cAAc,EACd,UAAU,GACX,MAAM,cAAc,CAAC;AAGtB;;;;;;;;;GASG;AAEH,MAAM,KAAK,GAAoC;IAC7C,IAAI,EAAE,CAAC,IAAI,EAAE,EAAE,CAAC,IAAI,CAAC,IAAI;IACzB,OAAO,EAAE;QACP,EAAE,MAAM,EAAE,IAAI,EAAE,GAAG,EAAE,CAAC,CAAC,EAAE,EAAE,CAAC,MAAM,CAAC,CAAC,CAAC,MAAM,CAAC,EAAE;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1
|
-
{"version":3,"file":"projects.d.ts","sourceRoot":"","sources":["../../src/commands/projects.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"projects.d.ts","sourceRoot":"","sources":["../../src/commands/projects.ts"],"names":[],"mappings":"AAsBA,OAAO,KAAK,EAAE,OAAO,EAA8B,MAAM,YAAY,CAAC;AAiQtE,eAAO,MAAM,eAAe,EAAE,OAM7B,CAAC"}
|
|
@@ -2,6 +2,7 @@
|
|
|
2
2
|
// Copyright (C) 2026 Kindgi Inc.
|
|
3
3
|
import { UsageError, extractKindgiError } from '../errors.js';
|
|
4
4
|
import { renderJson } from '../output.js';
|
|
5
|
+
import { SLUG, slugOf } from '../slug.js';
|
|
5
6
|
import { commandResultFromThrown, integerFlag, requiredPositional, runSdk, stringFlag, } from './helpers.js';
|
|
6
7
|
const list = {
|
|
7
8
|
kind: 'leaf',
|
|
@@ -41,6 +42,119 @@ const get = {
|
|
|
41
42
|
return await ctx.client().projects.get(id);
|
|
42
43
|
}),
|
|
43
44
|
};
|
|
45
|
+
/**
|
|
46
|
+
* A flag's value, trimmed, or `undefined` when it isn't given. Given empty
|
|
47
|
+
* (`--org=$ORG` with `ORG` unset) is a usage error, never the same as not
|
|
48
|
+
* given: a project in no org, or a slug nobody chose, would be made.
|
|
49
|
+
*/
|
|
50
|
+
function givenFlag(ctx, name) {
|
|
51
|
+
const raw = ctx.options[name];
|
|
52
|
+
if (raw === undefined)
|
|
53
|
+
return undefined;
|
|
54
|
+
const value = typeof raw === 'string' ? raw.trim() : '';
|
|
55
|
+
if (value === '')
|
|
56
|
+
throw new UsageError(`--${name} takes a value`);
|
|
57
|
+
return value;
|
|
58
|
+
}
|
|
59
|
+
/**
|
|
60
|
+
* The project, as `projects get` prints it. The change went through before
|
|
61
|
+
* this read, so a read that fails prints its id and says so, rather than
|
|
62
|
+
* read as a change that failed (run again, it would meet its own slug).
|
|
63
|
+
*/
|
|
64
|
+
async function printProject(ctx, projectId, done) {
|
|
65
|
+
try {
|
|
66
|
+
const project = await ctx.client().projects.get(projectId);
|
|
67
|
+
return { kind: 'ok', rendered: renderJson(project, ctx.globals.format) };
|
|
68
|
+
}
|
|
69
|
+
catch (err) {
|
|
70
|
+
const why = extractKindgiError(err)?.message ?? (err instanceof Error ? err.message : String(err));
|
|
71
|
+
return {
|
|
72
|
+
kind: 'ok',
|
|
73
|
+
rendered: {
|
|
74
|
+
stdout: renderJson({ id: projectId }, ctx.globals.format).stdout,
|
|
75
|
+
stderr: `${done}, but couldn't read it back: ${why}. \`kindgi projects get ${projectId}\` shows it.\n`,
|
|
76
|
+
},
|
|
77
|
+
};
|
|
78
|
+
}
|
|
79
|
+
}
|
|
80
|
+
function checkSlug(slug) {
|
|
81
|
+
if (!SLUG.test(slug)) {
|
|
82
|
+
throw new UsageError(`--slug=${slug}: lowercase letters, digits and hyphens, starting with a letter or digit, at most 63 characters`);
|
|
83
|
+
}
|
|
84
|
+
return slug;
|
|
85
|
+
}
|
|
86
|
+
const create = {
|
|
87
|
+
kind: 'leaf',
|
|
88
|
+
name: 'create',
|
|
89
|
+
description: 'Make a project. Prints it, with its id for the `--project=<id>` flags. For tenant admins.',
|
|
90
|
+
usage: 'kindgi projects create --name=<name> [--slug=<slug>] [--description=<text>] [--org=<org-id>]',
|
|
91
|
+
optionSpec: {
|
|
92
|
+
name: { type: 'string', description: 'What people see, e.g. `Support bot`. Required.' },
|
|
93
|
+
slug: {
|
|
94
|
+
type: 'string',
|
|
95
|
+
description: "The project's short name, unique in its org (or among projects in none); `kindgi deploy --project <id|slug>` takes it. Defaults to the name as a slug: `Support bot` is `support-bot`.",
|
|
96
|
+
},
|
|
97
|
+
description: { type: 'string', description: 'What the project is for.' },
|
|
98
|
+
org: { type: 'string', description: 'The org it belongs to, by id. Without it, none.' },
|
|
99
|
+
},
|
|
100
|
+
run: async (ctx) => {
|
|
101
|
+
try {
|
|
102
|
+
const name = givenFlag(ctx, 'name');
|
|
103
|
+
if (name === undefined)
|
|
104
|
+
throw new UsageError('--name=<name> is required');
|
|
105
|
+
const given = givenFlag(ctx, 'slug');
|
|
106
|
+
const slug = given !== undefined ? checkSlug(given) : slugOf(name);
|
|
107
|
+
if (slug === '') {
|
|
108
|
+
throw new UsageError(`"${name}" has no letters or digits to make a slug of: give --slug=<slug>`);
|
|
109
|
+
}
|
|
110
|
+
const description = givenFlag(ctx, 'description');
|
|
111
|
+
const orgId = givenFlag(ctx, 'org');
|
|
112
|
+
const made = await ctx.client().projects.create({
|
|
113
|
+
name,
|
|
114
|
+
slug,
|
|
115
|
+
...(description !== undefined && { description }),
|
|
116
|
+
...(orgId !== undefined && { orgId }),
|
|
117
|
+
});
|
|
118
|
+
return await printProject(ctx, made.id, `Made project ${made.id}`);
|
|
119
|
+
}
|
|
120
|
+
catch (err) {
|
|
121
|
+
return projectRefusal(err, ctx, 'kindgi projects create');
|
|
122
|
+
}
|
|
123
|
+
},
|
|
124
|
+
};
|
|
125
|
+
const rename = {
|
|
126
|
+
kind: 'leaf',
|
|
127
|
+
name: 'rename',
|
|
128
|
+
description: "Change a project's name, its slug, or both. Prints the project. `kindgi deploy --project <id|slug>` then takes the new slug, not the old one. For the project's admins (an admin of its org, or a tenant admin, is one).",
|
|
129
|
+
usage: 'kindgi projects rename <project-id> [--name=<name>] [--slug=<slug>]',
|
|
130
|
+
optionSpec: {
|
|
131
|
+
name: { type: 'string', description: 'The new name.' },
|
|
132
|
+
slug: {
|
|
133
|
+
type: 'string',
|
|
134
|
+
description: 'The new slug, unique in its org (or among projects in none).',
|
|
135
|
+
},
|
|
136
|
+
},
|
|
137
|
+
run: async (ctx) => {
|
|
138
|
+
try {
|
|
139
|
+
const projectId = requiredPositional(ctx, 0, 'project-id');
|
|
140
|
+
const name = givenFlag(ctx, 'name');
|
|
141
|
+
const slug = givenFlag(ctx, 'slug');
|
|
142
|
+
if (name === undefined && slug === undefined) {
|
|
143
|
+
throw new UsageError('Give --name, --slug, or both');
|
|
144
|
+
}
|
|
145
|
+
if (slug !== undefined)
|
|
146
|
+
checkSlug(slug);
|
|
147
|
+
await ctx.client().projects.update(projectId, {
|
|
148
|
+
...(name !== undefined && { name }),
|
|
149
|
+
...(slug !== undefined && { slug }),
|
|
150
|
+
});
|
|
151
|
+
return await printProject(ctx, projectId, `Changed project ${projectId}`);
|
|
152
|
+
}
|
|
153
|
+
catch (err) {
|
|
154
|
+
return projectRefusal(err, ctx, 'kindgi projects rename');
|
|
155
|
+
}
|
|
156
|
+
},
|
|
157
|
+
};
|
|
44
158
|
const PRODUCTION_ACTIONS = ['on', 'off', 'status'];
|
|
45
159
|
const production = {
|
|
46
160
|
kind: 'leaf',
|
|
@@ -60,7 +174,7 @@ const production = {
|
|
|
60
174
|
};
|
|
61
175
|
}
|
|
62
176
|
catch (err) {
|
|
63
|
-
return
|
|
177
|
+
return projectRefusal(err, ctx, 'kindgi projects production');
|
|
64
178
|
}
|
|
65
179
|
},
|
|
66
180
|
};
|
|
@@ -86,27 +200,35 @@ function productionText(state) {
|
|
|
86
200
|
/**
|
|
87
201
|
* The refusals named by the server's own code, since the client's families
|
|
88
202
|
* would mislead: `production-not-allowed` and `permission-denied` (not a
|
|
89
|
-
* tenant admin) are 403s, filed under `auth`,
|
|
90
|
-
* message says what lets the tenant in
|
|
91
|
-
* names it); `tenant-not-found
|
|
203
|
+
* tenant admin, or not the project's admin) are 403s, filed under `auth`,
|
|
204
|
+
* and `production-not-allowed`'s message says what lets the tenant in
|
|
205
|
+
* (`details.next`, when the runtime names it); `tenant-not-found`,
|
|
206
|
+
* `project-not-found` and `org-not-found` are 404s, filed under
|
|
207
|
+
* `not-found`. The 409s (`slug-conflict`, the slug taken in that org;
|
|
208
|
+
* `project-default-already-exists`) need nothing here: a conflict's line
|
|
209
|
+
* already names its reason.
|
|
92
210
|
*/
|
|
93
|
-
const
|
|
211
|
+
const PROJECT_REFUSALS = new Set([
|
|
94
212
|
'production-not-allowed',
|
|
95
213
|
'permission-denied',
|
|
96
214
|
'tenant-not-found',
|
|
215
|
+
'project-not-found',
|
|
216
|
+
'org-not-found',
|
|
97
217
|
]);
|
|
98
|
-
function
|
|
218
|
+
function projectRefusal(err, ctx, commandLabel) {
|
|
99
219
|
const wire = extractKindgiError(err);
|
|
100
220
|
const code = wire !== null && 'serverCode' in wire ? wire.serverCode : undefined;
|
|
101
|
-
if (wire !== null && code !== undefined &&
|
|
102
|
-
|
|
221
|
+
if (wire !== null && code !== undefined && PROJECT_REFUSALS.has(code)) {
|
|
222
|
+
// As every refusal's line: with `--verbose`, the whole error (its requestId too).
|
|
223
|
+
const detail = ctx.globals.verbose ? `\n${JSON.stringify(wire, null, 2)}` : '';
|
|
224
|
+
return { kind: 'error', stderr: `Error [${code}]: ${wire.message}${detail}\n`, exitCode: 1 };
|
|
103
225
|
}
|
|
104
|
-
return commandResultFromThrown(err, ctx,
|
|
226
|
+
return commandResultFromThrown(err, ctx, commandLabel);
|
|
105
227
|
}
|
|
106
228
|
export const projectsCommand = {
|
|
107
229
|
kind: 'group',
|
|
108
230
|
name: 'projects',
|
|
109
|
-
description: 'Find projects, for the commands that take `--project=<id>` (list / get-default / get), and put one in production (production).',
|
|
110
|
-
subcommands: [list, getDefault, get, production],
|
|
231
|
+
description: 'Find projects, for the commands that take `--project=<id>` (list / get-default / get), make and rename them (create / rename), and put one in production (production).',
|
|
232
|
+
subcommands: [list, getDefault, get, create, rename, production],
|
|
111
233
|
};
|
|
112
234
|
//# sourceMappingURL=projects.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"projects.js","sourceRoot":"","sources":["../../src/commands/projects.ts"],"names":[],"mappings":"AAAA,sCAAsC;AACtC,iCAAiC;
|
|
1
|
+
{"version":3,"file":"projects.js","sourceRoot":"","sources":["../../src/commands/projects.ts"],"names":[],"mappings":"AAAA,sCAAsC;AACtC,iCAAiC;AAWjC,OAAO,EAAE,UAAU,EAAE,kBAAkB,EAAE,MAAM,cAAc,CAAC;AAC9D,OAAO,EAAE,UAAU,EAAE,MAAM,cAAc,CAAC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C,CAAC,EAAE,CAAC,CAAC,CAAC,EAAE,CAAC;QAC/E,OAAO,EAAE,IAAI,EAAE,OAAO,EAAE,MAAM,EAAE,UAAU,IAAI,MAAM,IAAI,CAAC,OAAO,GAAG,MAAM,IAAI,EAAE,QAAQ,EAAE,CAAC,EAAE,CAAC;IAC/F,CAAC;IACD,OAAO,uBAAuB,CAAC,GAAG,EAAE,GAAG,EAAE,YAAY,CAAC,CAAC;AACzD,CAAC;AAED,MAAM,CAAC,MAAM,eAAe,GAAY;IACtC,IAAI,EAAE,OAAO;IACb,IAAI,EAAE,UAAU;IAChB,WAAW,EACT,wKAAwK;IAC1K,WAAW,EAAE,CAAC,IAAI,EAAE,UAAU,EAAE,GAAG,EAAE,MAAM,EAAE,MAAM,EAAE,UAAU,CAAC;CACjE,CAAC"}
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
import type { DeploymentPromotion, DeploymentPromotionCheck, KindgiClient } from '@kindgi/client';
|
|
2
|
+
import type { Command } from './types.js';
|
|
3
|
+
type DeploymentValue = DeploymentPromotionCheck['values'][number];
|
|
4
|
+
type Moves = DeploymentPromotionCheck['moves'];
|
|
5
|
+
type LeftBehind = NonNullable<DeploymentPromotionCheck['leftBehind']>;
|
|
6
|
+
/**
|
|
7
|
+
* Where a promotion goes from and to, and the runtime it goes to. `from`
|
|
8
|
+
* and `to`: the pack config's environment names, or outside a pack the
|
|
9
|
+
* project ids or slugs given.
|
|
10
|
+
*/
|
|
11
|
+
interface Route {
|
|
12
|
+
readonly from: string;
|
|
13
|
+
readonly to: string;
|
|
14
|
+
readonly fromProjectId: string;
|
|
15
|
+
readonly toProjectId: string;
|
|
16
|
+
readonly packId: string | undefined;
|
|
17
|
+
/** In a pack: the deployment it takes is this pack's. */
|
|
18
|
+
readonly inPack: boolean;
|
|
19
|
+
readonly client: KindgiClient;
|
|
20
|
+
}
|
|
21
|
+
/** What moves, and what stays behind: the lines `kindgi promote` prints before anything moves. */
|
|
22
|
+
export declare function movesText(moves: Moves, leftBehind: LeftBehind | undefined, route: Pick<Route, 'from' | 'to'>): string;
|
|
23
|
+
/**
|
|
24
|
+
* Where the target's values are set: its name (`label`), the env they're
|
|
25
|
+
* read under, and its project.
|
|
26
|
+
*/
|
|
27
|
+
interface ValueTarget {
|
|
28
|
+
readonly label: string;
|
|
29
|
+
readonly env: string;
|
|
30
|
+
readonly projectId: string;
|
|
31
|
+
}
|
|
32
|
+
/** The values not ready in the target, a line each with how to set it. */
|
|
33
|
+
export declare function valuesText(values: readonly DeploymentValue[], target: ValueTarget): string;
|
|
34
|
+
/** The deployment the target got. */
|
|
35
|
+
export declare function resultText(result: DeploymentPromotion, to: string): string;
|
|
36
|
+
export declare const promoteCommand: Command;
|
|
37
|
+
export {};
|
|
38
|
+
//# sourceMappingURL=promote.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"promote.d.ts","sourceRoot":"","sources":["../../src/commands/promote.ts"],"names":[],"mappings":"AA+BA,OAAO,KAAK,EAEV,mBAAmB,EACnB,wBAAwB,EACxB,YAAY,EACb,MAAM,gBAAgB,CAAC;AAWxB,OAAO,KAAK,EAAE,OAAO,EAAe,MAAM,YAAY,CAAC;AAGvD,KAAK,eAAe,GAAG,wBAAwB,CAAC,QAAQ,CAAC,CAAC,MAAM,CAAC,CAAC;AAClE,KAAK,KAAK,GAAG,wBAAwB,CAAC,OAAO,CAAC,CAAC;AAC/C,KAAK,UAAU,GAAG,WAAW,CAAC,wBAAwB,CAAC,YAAY,CAAC,CAAC,CAAC;AAEtE;;;;GAIG;AACH,UAAU,KAAK;IACb,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC;IACtB,QAAQ,CAAC,EAAE,EAAE,MAAM,CAAC;IACpB,QAAQ,CAAC,aAAa,EAAE,MAAM,CAAC;IAC/B,QAAQ,CAAC,WAAW,EAAE,MAAM,CAAC;IAC7B,QAAQ,CAAC,MAAM,EAAE,MAAM,GAAG,SAAS,CAAC;IACpC,yDAAyD;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