monday-cli 0.4.0 → 0.5.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/CHANGELOG.md +368 -0
- package/README.md +112 -34
- package/dist/api/column-types.d.ts +3 -1
- package/dist/api/column-types.d.ts.map +1 -1
- package/dist/api/column-types.js +3 -1
- package/dist/api/column-types.js.map +1 -1
- package/dist/api/column-values.d.ts +5 -4
- package/dist/api/column-values.d.ts.map +1 -1
- package/dist/api/column-values.js +6 -5
- package/dist/api/column-values.js.map +1 -1
- package/dist/api/documents.d.ts +1136 -3
- package/dist/api/documents.d.ts.map +1 -1
- package/dist/api/documents.js +1828 -3
- package/dist/api/documents.js.map +1 -1
- package/dist/api/raw-write.d.ts +6 -5
- package/dist/api/raw-write.d.ts.map +1 -1
- package/dist/api/raw-write.js +7 -6
- package/dist/api/raw-write.js.map +1 -1
- package/dist/api/teams.d.ts +657 -0
- package/dist/api/teams.d.ts.map +1 -0
- package/dist/api/teams.js +880 -0
- package/dist/api/teams.js.map +1 -0
- package/dist/commands/doc/append-markdown.d.ts +117 -0
- package/dist/commands/doc/append-markdown.d.ts.map +1 -0
- package/dist/commands/doc/append-markdown.js +253 -0
- package/dist/commands/doc/append-markdown.js.map +1 -0
- package/dist/commands/doc/block-create.d.ts +114 -0
- package/dist/commands/doc/block-create.d.ts.map +1 -0
- package/dist/commands/doc/block-create.js +206 -0
- package/dist/commands/doc/block-create.js.map +1 -0
- package/dist/commands/doc/block-delete.d.ts +72 -0
- package/dist/commands/doc/block-delete.d.ts.map +1 -0
- package/dist/commands/doc/block-delete.js +161 -0
- package/dist/commands/doc/block-delete.js.map +1 -0
- package/dist/commands/doc/block-update.d.ts +75 -0
- package/dist/commands/doc/block-update.d.ts.map +1 -0
- package/dist/commands/doc/block-update.js +162 -0
- package/dist/commands/doc/block-update.js.map +1 -0
- package/dist/commands/doc/create-in-workspace.d.ts +76 -0
- package/dist/commands/doc/create-in-workspace.d.ts.map +1 -0
- package/dist/commands/doc/create-in-workspace.js +164 -0
- package/dist/commands/doc/create-in-workspace.js.map +1 -0
- package/dist/commands/doc/create-on-column.d.ts +71 -0
- package/dist/commands/doc/create-on-column.d.ts.map +1 -0
- package/dist/commands/doc/create-on-column.js +146 -0
- package/dist/commands/doc/create-on-column.js.map +1 -0
- package/dist/commands/doc/delete.d.ts +68 -0
- package/dist/commands/doc/delete.d.ts.map +1 -0
- package/dist/commands/doc/delete.js +146 -0
- package/dist/commands/doc/delete.js.map +1 -0
- package/dist/commands/doc/duplicate.d.ts +101 -0
- package/dist/commands/doc/duplicate.d.ts.map +1 -0
- package/dist/commands/doc/duplicate.js +191 -0
- package/dist/commands/doc/duplicate.js.map +1 -0
- package/dist/commands/doc/import-html.d.ts +125 -0
- package/dist/commands/doc/import-html.d.ts.map +1 -0
- package/dist/commands/doc/import-html.js +273 -0
- package/dist/commands/doc/import-html.js.map +1 -0
- package/dist/commands/doc/list.d.ts +6 -3
- package/dist/commands/doc/list.d.ts.map +1 -1
- package/dist/commands/doc/list.js +17 -48
- package/dist/commands/doc/list.js.map +1 -1
- package/dist/commands/doc/rename.d.ts +60 -0
- package/dist/commands/doc/rename.d.ts.map +1 -0
- package/dist/commands/doc/rename.js +135 -0
- package/dist/commands/doc/rename.js.map +1 -0
- package/dist/commands/index.d.ts.map +1 -1
- package/dist/commands/index.js +116 -0
- package/dist/commands/index.js.map +1 -1
- package/dist/commands/item/create.js +2 -2
- package/dist/commands/update/create.d.ts.map +1 -1
- package/dist/commands/update/create.js +6 -4
- package/dist/commands/update/create.js.map +1 -1
- package/dist/commands/update/edit.d.ts +4 -2
- package/dist/commands/update/edit.d.ts.map +1 -1
- package/dist/commands/update/edit.js +10 -6
- package/dist/commands/update/edit.js.map +1 -1
- package/dist/commands/update/reply.d.ts +4 -2
- package/dist/commands/update/reply.d.ts.map +1 -1
- package/dist/commands/update/reply.js +10 -6
- package/dist/commands/update/reply.js.map +1 -1
- package/dist/commands/user/_team-membership.d.ts +10 -0
- package/dist/commands/user/_team-membership.d.ts.map +1 -0
- package/dist/commands/user/_team-membership.js +88 -0
- package/dist/commands/user/_team-membership.js.map +1 -0
- package/dist/commands/user/team-add-members.d.ts +81 -0
- package/dist/commands/user/team-add-members.d.ts.map +1 -0
- package/dist/commands/user/team-add-members.js +186 -0
- package/dist/commands/user/team-add-members.js.map +1 -0
- package/dist/commands/user/team-create.d.ts +82 -0
- package/dist/commands/user/team-create.d.ts.map +1 -0
- package/dist/commands/user/team-create.js +206 -0
- package/dist/commands/user/team-create.js.map +1 -0
- package/dist/commands/user/team-delete.d.ts +56 -0
- package/dist/commands/user/team-delete.d.ts.map +1 -0
- package/dist/commands/user/team-delete.js +137 -0
- package/dist/commands/user/team-delete.js.map +1 -0
- package/dist/commands/user/team-get.d.ts +41 -0
- package/dist/commands/user/team-get.d.ts.map +1 -0
- package/dist/commands/user/team-get.js +87 -0
- package/dist/commands/user/team-get.js.map +1 -0
- package/dist/commands/user/team-list.d.ts +39 -0
- package/dist/commands/user/team-list.d.ts.map +1 -0
- package/dist/commands/user/team-list.js +90 -0
- package/dist/commands/user/team-list.js.map +1 -0
- package/dist/commands/user/team-remove-members.d.ts +71 -0
- package/dist/commands/user/team-remove-members.d.ts.map +1 -0
- package/dist/commands/user/team-remove-members.js +176 -0
- package/dist/commands/user/team-remove-members.js.map +1 -0
- package/dist/types/ids.d.ts +6 -0
- package/dist/types/ids.d.ts.map +1 -1
- package/dist/types/ids.js +46 -5
- package/dist/types/ids.js.map +1 -1
- package/dist/utils/parse-brand-list.d.ts +95 -0
- package/dist/utils/parse-brand-list.d.ts.map +1 -0
- package/dist/utils/parse-brand-list.js +96 -0
- package/dist/utils/parse-brand-list.js.map +1 -0
- package/dist/utils/source-content.d.ts +93 -0
- package/dist/utils/source-content.d.ts.map +1 -0
- package/dist/utils/source-content.js +120 -0
- package/dist/utils/source-content.js.map +1 -0
- package/package.json +1 -1
|
@@ -0,0 +1,137 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* `monday user team-delete <tid> --yes [--dry-run]` — delete
|
|
3
|
+
* an existing team (`cli-design.md` §4.3 USER section + §13
|
|
4
|
+
* v0.5 entry; `v0.5-plan.md` §3 M34).
|
|
5
|
+
*
|
|
6
|
+
* **Confirmation gate** (cli-design §3.1 #7 + §10.2 + M10
|
|
7
|
+
* round-1 P2 invariant). `--yes` is mandatory for the live
|
|
8
|
+
* path; without `--yes` (and without `--dry-run`) the command
|
|
9
|
+
* fails fast with `confirmation_required` (exit 1) carrying
|
|
10
|
+
* `details.team_id`. The gate fires BEFORE `resolveClient()`
|
|
11
|
+
* so a missing token doesn't mask `confirmation_required` as
|
|
12
|
+
* `config_error` (same shape — and same gate-before-resolve
|
|
13
|
+
* ordering — as M14 `workspace delete` / M10 `item delete` /
|
|
14
|
+
* `update delete`).
|
|
15
|
+
*
|
|
16
|
+
* **Wire shape.** Single round-trip via `delete_team(team_id:
|
|
17
|
+
* <tid>)` against `mutation DeleteTeam` with `operationName:
|
|
18
|
+
* 'DeleteTeam'` (R-NEW-37 W2 audit-point). Monday returns the
|
|
19
|
+
* deleted `Team` so the envelope's `data` is the full
|
|
20
|
+
* projection — agents see the final state (name + member
|
|
21
|
+
* list) at the moment of deletion. A null `delete_team`
|
|
22
|
+
* payload surfaces `not_found` — same convention as M14
|
|
23
|
+
* `workspace delete` ("id was bogus / already deleted by a
|
|
24
|
+
* concurrent caller").
|
|
25
|
+
*
|
|
26
|
+
* **Admin-permission-sensitive.** Non-admin callers surface
|
|
27
|
+
* `forbidden` (mapped from Monday's PERMISSION_DENIED
|
|
28
|
+
* extension).
|
|
29
|
+
*
|
|
30
|
+
* **Dry-run shape** per cli-design §6.4 mutation-dry-run
|
|
31
|
+
* variant: minimal `{operation: "delete_team", team_id}`. No
|
|
32
|
+
* preflight read fires; the dry-run is purely argv-derived.
|
|
33
|
+
* `meta.source: 'none'`. Mirrors `workspace delete` —
|
|
34
|
+
* destructive-no-read pattern is uniform across `item delete`
|
|
35
|
+
* / `update delete` / `workspace delete` / `team delete`.
|
|
36
|
+
*
|
|
37
|
+
* **Idempotent: false.** Re-running surfaces `not_found` past
|
|
38
|
+
* the first call. Same rationale as `workspace delete` —
|
|
39
|
+
* agents can't safely retry without verifying the id still
|
|
40
|
+
* names the same record.
|
|
41
|
+
*
|
|
42
|
+
* **Runtime body landed at v0.5-M34 IMPL.** Destructive gate
|
|
43
|
+
* fires BEFORE `resolveClient` (M10 round-1 P2 invariant);
|
|
44
|
+
* dry-run path emits minimal `{operation, team_id}` (no wire
|
|
45
|
+
* call); live path dispatches {@link deleteTeam} + projects via
|
|
46
|
+
* `emitMutation`.
|
|
47
|
+
*/
|
|
48
|
+
import { z } from 'zod';
|
|
49
|
+
import { ensureSubcommand } from '../types.js';
|
|
50
|
+
import { parseArgv } from '../parse-argv.js';
|
|
51
|
+
import { parseGlobalFlags } from '../../types/global-flags.js';
|
|
52
|
+
import { enforceDestructiveGate } from '../../api/destructive-gate.js';
|
|
53
|
+
import { emitDryRun, emitMutation } from '../emit.js';
|
|
54
|
+
import { resolveClient } from '../../api/resolve-client.js';
|
|
55
|
+
import { TeamIdSchema } from '../../types/ids.js';
|
|
56
|
+
import { deleteTeam, teamDeleteOutputSchema, } from '../../api/teams.js';
|
|
57
|
+
const inputSchema = z.object({ teamId: TeamIdSchema }).strict();
|
|
58
|
+
export const teamDeleteCommand = {
|
|
59
|
+
name: 'user.team-delete',
|
|
60
|
+
summary: 'Delete a team — --yes required',
|
|
61
|
+
examples: [
|
|
62
|
+
'monday user team-delete 12345 --yes',
|
|
63
|
+
'monday user team-delete 12345 --dry-run',
|
|
64
|
+
'monday user team-delete 12345 --yes --json',
|
|
65
|
+
],
|
|
66
|
+
// Re-deleting an already-deleted team surfaces `not_found`;
|
|
67
|
+
// re-running with the same `<tid>` after an interim
|
|
68
|
+
// `team-create` would target a different record (Monday
|
|
69
|
+
// mints new TeamIds on create). Mark non-idempotent.
|
|
70
|
+
idempotent: false,
|
|
71
|
+
inputSchema,
|
|
72
|
+
outputSchema: teamDeleteOutputSchema,
|
|
73
|
+
attach: (program, ctx) => {
|
|
74
|
+
const noun = ensureSubcommand(program, 'user', 'User commands');
|
|
75
|
+
noun
|
|
76
|
+
.command('team-delete <teamId>')
|
|
77
|
+
.description(teamDeleteCommand.summary)
|
|
78
|
+
.addHelpText('after', ['', 'Examples:', ...teamDeleteCommand.examples.map((e) => ` ${e}`), ''].join('\n'))
|
|
79
|
+
.action(async (teamId) => {
|
|
80
|
+
const parsed = parseArgv(teamDeleteCommand.inputSchema, { teamId });
|
|
81
|
+
// Gate BEFORE `resolveClient()` — M10 round-1 P2 invariant.
|
|
82
|
+
// A missing `--yes` must surface as `confirmation_required`
|
|
83
|
+
// per cli-design §3.1 #7's unconditional contract, never
|
|
84
|
+
// masked by `config_error` when no token is configured.
|
|
85
|
+
const preGateGlobalFlags = parseGlobalFlags(program.opts(), ctx.env);
|
|
86
|
+
enforceDestructiveGate({
|
|
87
|
+
globalFlags: preGateGlobalFlags,
|
|
88
|
+
verb: 'user team-delete',
|
|
89
|
+
target: parsed.teamId,
|
|
90
|
+
detailKey: 'team_id',
|
|
91
|
+
action: 'delete the team',
|
|
92
|
+
hint: 'delete is destructive — Monday\'s wire surface offers no ' +
|
|
93
|
+
'restore mutation for teams; agents needing reversal must ' +
|
|
94
|
+
'recreate via `monday user team-create` (lossy: new id, ' +
|
|
95
|
+
'membership must be re-added).',
|
|
96
|
+
});
|
|
97
|
+
if (preGateGlobalFlags.dryRun) {
|
|
98
|
+
// Minimal dry-run shape — no preflight read fires. Per
|
|
99
|
+
// cli-design §6.4 mutation-dry-run variant: `operation:
|
|
100
|
+
// "delete_team"`, `team_id`, nothing else. `meta.source:
|
|
101
|
+
// 'none'` because no API call fires; live surfaces
|
|
102
|
+
// `not_found` for missing ids on its own. Mirrors
|
|
103
|
+
// workspace-delete cadence.
|
|
104
|
+
const { apiVersion } = resolveClient(ctx, program.opts());
|
|
105
|
+
emitDryRun({
|
|
106
|
+
ctx,
|
|
107
|
+
programOpts: program.opts(),
|
|
108
|
+
plannedChanges: [
|
|
109
|
+
{
|
|
110
|
+
operation: 'delete_team',
|
|
111
|
+
team_id: parsed.teamId,
|
|
112
|
+
},
|
|
113
|
+
],
|
|
114
|
+
source: 'none',
|
|
115
|
+
cacheAgeSeconds: null,
|
|
116
|
+
warnings: [],
|
|
117
|
+
apiVersion,
|
|
118
|
+
});
|
|
119
|
+
return;
|
|
120
|
+
}
|
|
121
|
+
const { client, apiVersion } = resolveClient(ctx, program.opts());
|
|
122
|
+
const result = await deleteTeam({ client, teamId: parsed.teamId });
|
|
123
|
+
emitMutation({
|
|
124
|
+
ctx,
|
|
125
|
+
data: result.team,
|
|
126
|
+
schema: teamDeleteCommand.outputSchema,
|
|
127
|
+
programOpts: program.opts(),
|
|
128
|
+
warnings: [],
|
|
129
|
+
source: result.source,
|
|
130
|
+
cacheAgeSeconds: result.cacheAgeSeconds,
|
|
131
|
+
complexity: result.complexity,
|
|
132
|
+
apiVersion,
|
|
133
|
+
});
|
|
134
|
+
});
|
|
135
|
+
},
|
|
136
|
+
};
|
|
137
|
+
//# sourceMappingURL=team-delete.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"team-delete.js","sourceRoot":"","sources":["../../../src/commands/user/team-delete.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA8CG;AACH,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AACxB,OAAO,EAAE,gBAAgB,EAAsB,MAAM,aAAa,CAAC;AACnE,OAAO,EAAE,SAAS,EAAE,MAAM,kBAAkB,CAAC;AAC7C,OAAO,EAAE,gBAAgB,EAAE,MAAM,6BAA6B,CAAC;AAC/D,OAAO,EAAE,sBAAsB,EAAE,MAAM,+BAA+B,CAAC;AACvE,OAAO,EAAE,UAAU,EAAE,YAAY,EAAE,MAAM,YAAY,CAAC;AACtD,OAAO,EAAE,aAAa,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;gBACZ,MAAM,EAAE,MAAM,CAAC,MAAM;gBACrB,eAAe,EAAE,MAAM,CAAC,eAAe;gBACvC,UAAU,EAAE,MAAM,CAAC,UAAU;gBAC7B,UAAU;aACX,CAAC,CAAC;QACL,CAAC,CAAC,CAAC;IACP,CAAC;CACF,CAAC"}
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* `monday user team-get <tid>` — read a single team by ID
|
|
3
|
+
* (`cli-design.md` §4.3 USER section + §13 v0.5 entry;
|
|
4
|
+
* `v0.5-plan.md` §3 M34).
|
|
5
|
+
*
|
|
6
|
+
* **Wire shape.** Single `Query.teams(ids: [<tid>])` round-trip
|
|
7
|
+
* via {@link getTeam} against `query GetTeam` with
|
|
8
|
+
* `operationName: 'GetTeam'` (R-NEW-37 W2 audit-point). Monday
|
|
9
|
+
* returns `[Team]` (an array even for a single-id query); the
|
|
10
|
+
* fetcher extracts index 0. Empty array → `not_found` with
|
|
11
|
+
* `details.team_id` (Monday's wire surface collapses
|
|
12
|
+
* "doesn't exist" + "exists but inaccessible to token" into
|
|
13
|
+
* the same shape; the CLI can't distinguish them — same
|
|
14
|
+
* convention as M32 doc-get D8).
|
|
15
|
+
*
|
|
16
|
+
* **Output envelope.** Direct unwrap of the Team — `data:
|
|
17
|
+
* <Team with users + owners hydrated>`. Mirrors read-one-verb
|
|
18
|
+
* convention (`monday board get <bid>` returns `data: <Board>`,
|
|
19
|
+
* `monday user get <uid>` returns `data: <User>`). The Team's
|
|
20
|
+
* own `id` field is the echoed input; no separate `team_id`
|
|
21
|
+
* slot needed.
|
|
22
|
+
*
|
|
23
|
+
* **Teams are live-only at v0.5-M34** per cli-design §8 cache
|
|
24
|
+
* scope. Output `meta.source: "live"`, `meta.cache_age_
|
|
25
|
+
* seconds: null`.
|
|
26
|
+
*
|
|
27
|
+
* **Idempotent: yes** (pure read).
|
|
28
|
+
*
|
|
29
|
+
* **Runtime body landed at v0.5-M34 IMPL.** A thin wrapper
|
|
30
|
+
* around {@link getTeam} — branded `<teamId>` → fetcher →
|
|
31
|
+
* direct-unwrap envelope.
|
|
32
|
+
*/
|
|
33
|
+
import { z } from 'zod';
|
|
34
|
+
import { type CommandModule } from '../types.js';
|
|
35
|
+
import { type TeamGetOutput } from '../../api/teams.js';
|
|
36
|
+
declare const inputSchema: z.ZodObject<{
|
|
37
|
+
teamId: z.core.$ZodBranded<z.ZodString, "TeamId", "out">;
|
|
38
|
+
}, z.core.$strict>;
|
|
39
|
+
export declare const teamGetCommand: CommandModule<z.infer<typeof inputSchema>, TeamGetOutput>;
|
|
40
|
+
export {};
|
|
41
|
+
//# sourceMappingURL=team-get.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"team-get.d.ts","sourceRoot":"","sources":["../../../src/commands/user/team-get.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA+BG;AACH,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AACxB,OAAO,EAAoB,KAAK,aAAa,EAAE,MAAM,aAAa,CAAC;AAKnE,OAAO,EAGL,KAAK,aAAa,EACnB,MAAM,oBAAoB,CAAC;AAE5B,QAAA,MAAM,WAAW;;kBAA8C,CAAC;AAEhE,eAAO,MAAM,cAAc,EAAE,aAAa,CACxC,CAAC,CAAC,KAAK,CAAC,OAAO,WAAW,CAAC,EAC3B,aAAa,CAkDd,CAAC"}
|
|
@@ -0,0 +1,87 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* `monday user team-get <tid>` — read a single team by ID
|
|
3
|
+
* (`cli-design.md` §4.3 USER section + §13 v0.5 entry;
|
|
4
|
+
* `v0.5-plan.md` §3 M34).
|
|
5
|
+
*
|
|
6
|
+
* **Wire shape.** Single `Query.teams(ids: [<tid>])` round-trip
|
|
7
|
+
* via {@link getTeam} against `query GetTeam` with
|
|
8
|
+
* `operationName: 'GetTeam'` (R-NEW-37 W2 audit-point). Monday
|
|
9
|
+
* returns `[Team]` (an array even for a single-id query); the
|
|
10
|
+
* fetcher extracts index 0. Empty array → `not_found` with
|
|
11
|
+
* `details.team_id` (Monday's wire surface collapses
|
|
12
|
+
* "doesn't exist" + "exists but inaccessible to token" into
|
|
13
|
+
* the same shape; the CLI can't distinguish them — same
|
|
14
|
+
* convention as M32 doc-get D8).
|
|
15
|
+
*
|
|
16
|
+
* **Output envelope.** Direct unwrap of the Team — `data:
|
|
17
|
+
* <Team with users + owners hydrated>`. Mirrors read-one-verb
|
|
18
|
+
* convention (`monday board get <bid>` returns `data: <Board>`,
|
|
19
|
+
* `monday user get <uid>` returns `data: <User>`). The Team's
|
|
20
|
+
* own `id` field is the echoed input; no separate `team_id`
|
|
21
|
+
* slot needed.
|
|
22
|
+
*
|
|
23
|
+
* **Teams are live-only at v0.5-M34** per cli-design §8 cache
|
|
24
|
+
* scope. Output `meta.source: "live"`, `meta.cache_age_
|
|
25
|
+
* seconds: null`.
|
|
26
|
+
*
|
|
27
|
+
* **Idempotent: yes** (pure read).
|
|
28
|
+
*
|
|
29
|
+
* **Runtime body landed at v0.5-M34 IMPL.** A thin wrapper
|
|
30
|
+
* around {@link getTeam} — branded `<teamId>` → fetcher →
|
|
31
|
+
* direct-unwrap envelope.
|
|
32
|
+
*/
|
|
33
|
+
import { z } from 'zod';
|
|
34
|
+
import { ensureSubcommand } from '../types.js';
|
|
35
|
+
import { parseArgv } from '../parse-argv.js';
|
|
36
|
+
import { emitSuccess } from '../emit.js';
|
|
37
|
+
import { resolveClient } from '../../api/resolve-client.js';
|
|
38
|
+
import { TeamIdSchema } from '../../types/ids.js';
|
|
39
|
+
import { getTeam, teamGetOutputSchema, } from '../../api/teams.js';
|
|
40
|
+
const inputSchema = z.object({ teamId: TeamIdSchema }).strict();
|
|
41
|
+
export const teamGetCommand = {
|
|
42
|
+
name: 'user.team-get',
|
|
43
|
+
summary: 'Read a single team by ID (includes member + owner lists)',
|
|
44
|
+
examples: [
|
|
45
|
+
'monday user team-get 12345',
|
|
46
|
+
'monday user team-get 12345 --json',
|
|
47
|
+
],
|
|
48
|
+
idempotent: true,
|
|
49
|
+
inputSchema,
|
|
50
|
+
outputSchema: teamGetOutputSchema,
|
|
51
|
+
attach: (program, ctx) => {
|
|
52
|
+
const noun = ensureSubcommand(program, 'user', 'User commands');
|
|
53
|
+
noun
|
|
54
|
+
.command('team-get <teamId>')
|
|
55
|
+
.description(teamGetCommand.summary)
|
|
56
|
+
.addHelpText('after', [
|
|
57
|
+
'',
|
|
58
|
+
'Examples:',
|
|
59
|
+
...teamGetCommand.examples.map((e) => ` ${e}`),
|
|
60
|
+
'',
|
|
61
|
+
'Notes:',
|
|
62
|
+
' - Output carries the full Team plus `users: [User]` (members) + `owners: [User]` (managers).',
|
|
63
|
+
' - Non-existent + inaccessible teams both surface `not_found` (Monday\'s wire collapses both cases).',
|
|
64
|
+
'',
|
|
65
|
+
].join('\n'))
|
|
66
|
+
.action(async (teamIdArg) => {
|
|
67
|
+
const parsed = parseArgv(teamGetCommand.inputSchema, {
|
|
68
|
+
teamId: teamIdArg,
|
|
69
|
+
});
|
|
70
|
+
const { client, apiVersion } = resolveClient(ctx, program.opts());
|
|
71
|
+
const result = await getTeam({ client, teamId: parsed.teamId });
|
|
72
|
+
emitSuccess({
|
|
73
|
+
ctx,
|
|
74
|
+
data: result.team,
|
|
75
|
+
schema: teamGetCommand.outputSchema,
|
|
76
|
+
programOpts: program.opts(),
|
|
77
|
+
kind: 'single',
|
|
78
|
+
warnings: [],
|
|
79
|
+
source: result.source,
|
|
80
|
+
cacheAgeSeconds: result.cacheAgeSeconds,
|
|
81
|
+
complexity: result.complexity,
|
|
82
|
+
apiVersion,
|
|
83
|
+
});
|
|
84
|
+
});
|
|
85
|
+
},
|
|
86
|
+
};
|
|
87
|
+
//# sourceMappingURL=team-get.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"team-get.js","sourceRoot":"","sources":["../../../src/commands/user/team-get.ts"],"names":[],"mappings":"AAAA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B,EAAE,EAAE;YACnC,MAAM,MAAM,GAAG,SAAS,CAAC,cAAc,CAAC,WAAW,EAAE;gBACnD,MAAM,EAAE,SAAS;aAClB,CAAC,CAAC;YAEH,MAAM,EAAE,MAAM,EAAE,UAAU,EAAE,GAAG,aAAa,CAAC,GAAG,EAAE,OAAO,CAAC,IAAI,EAAE,CAAC,CAAC;YAClE,MAAM,MAAM,GAAG,MAAM,OAAO,CAAC,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,CAAC,MAAM,EAAE,CAAC,CAAC;YAChE,WAAW,CAAC;gBACV,GAAG;gBACH,IAAI,EAAE,MAAM,CAAC,IAAI;gBACjB,MAAM,EAAE,cAAc,CAAC,YAAY;gBACnC,WAAW,EAAE,OAAO,CAAC,IAAI,EAAE;gBAC3B,IAAI,EAAE,QAAQ;gBACd,QAAQ,EAAE,EAAE;gBACZ,MAAM,EAAE,MAAM,CAAC,MAAM;gBACrB,eAAe,EAAE,MAAM,CAAC,eAAe;gBACvC,UAAU,EAAE,MAAM,CAAC,UAAU;gBAC7B,UAAU;aACX,CAAC,CAAC;QACL,CAAC,CAAC,CAAC;IACP,CAAC;CACF,CAAC"}
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* `monday user team-list` — list every team visible to the
|
|
3
|
+
* token (`cli-design.md` §4.3 USER section + §13 v0.5 entry;
|
|
4
|
+
* `v0.5-plan.md` §3 M34).
|
|
5
|
+
*
|
|
6
|
+
* **Wire shape.** Single `Query.teams` round-trip via
|
|
7
|
+
* {@link listTeams} against `query ListTeams` with
|
|
8
|
+
* `operationName: 'ListTeams'` (R-NEW-37 W2 audit-point). No
|
|
9
|
+
* pagination — Monday's `Query.teams` surface has neither
|
|
10
|
+
* `limit:` / `page:` nor cursor (D6 closure); returns every
|
|
11
|
+
* visible team in one shot. Account-size cap on team count is
|
|
12
|
+
* the only natural limit.
|
|
13
|
+
*
|
|
14
|
+
* **Argv shape.** No flags — `team-list` is argv-empty.
|
|
15
|
+
*
|
|
16
|
+
* **Output envelope.** Wrapped record `data: { teams:
|
|
17
|
+
* [Team], returned_count }` mirroring M22 `monday usage` +
|
|
18
|
+
* M32 `doc list` wrapped-record cadence. No `has_more` /
|
|
19
|
+
* cursor slot (D6 — wire has no pagination).
|
|
20
|
+
*
|
|
21
|
+
* **Teams are live-only at v0.5-M34** per cli-design §8 cache
|
|
22
|
+
* scope. Output `meta.source: "live"`, `meta.cache_age_
|
|
23
|
+
* seconds: null`. Team membership churns frequently; the
|
|
24
|
+
* stale-cache risk outweighs the cache-hit value.
|
|
25
|
+
*
|
|
26
|
+
* **Idempotent: yes** (pure read).
|
|
27
|
+
*
|
|
28
|
+
* **Runtime body landed at v0.5-M34 IMPL.** A single wire
|
|
29
|
+
* round-trip via {@link listTeams} populates the wrapped
|
|
30
|
+
* record envelope; `returned_count` is the cached
|
|
31
|
+
* `teams.length` for agent ergonomics.
|
|
32
|
+
*/
|
|
33
|
+
import { z } from 'zod';
|
|
34
|
+
import { type CommandModule } from '../types.js';
|
|
35
|
+
import { type TeamListOutput } from '../../api/teams.js';
|
|
36
|
+
declare const inputSchema: z.ZodObject<{}, z.core.$strict>;
|
|
37
|
+
export declare const teamListCommand: CommandModule<z.infer<typeof inputSchema>, TeamListOutput>;
|
|
38
|
+
export {};
|
|
39
|
+
//# sourceMappingURL=team-list.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"team-list.d.ts","sourceRoot":"","sources":["../../../src/commands/user/team-list.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA+BG;AACH,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AACxB,OAAO,EAAoB,KAAK,aAAa,EAAE,MAAM,aAAa,CAAC;AAInE,OAAO,EAGL,KAAK,cAAc,EACpB,MAAM,oBAAoB,CAAC;AAE5B,QAAA,MAAM,WAAW,iCAAwB,CAAC;AAE1C,eAAO,MAAM,eAAe,EAAE,aAAa,CACzC,CAAC,CAAC,KAAK,CAAC,OAAO,WAAW,CAAC,EAC3B,cAAc,CAsDf,CAAC"}
|
|
@@ -0,0 +1,90 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* `monday user team-list` — list every team visible to the
|
|
3
|
+
* token (`cli-design.md` §4.3 USER section + §13 v0.5 entry;
|
|
4
|
+
* `v0.5-plan.md` §3 M34).
|
|
5
|
+
*
|
|
6
|
+
* **Wire shape.** Single `Query.teams` round-trip via
|
|
7
|
+
* {@link listTeams} against `query ListTeams` with
|
|
8
|
+
* `operationName: 'ListTeams'` (R-NEW-37 W2 audit-point). No
|
|
9
|
+
* pagination — Monday's `Query.teams` surface has neither
|
|
10
|
+
* `limit:` / `page:` nor cursor (D6 closure); returns every
|
|
11
|
+
* visible team in one shot. Account-size cap on team count is
|
|
12
|
+
* the only natural limit.
|
|
13
|
+
*
|
|
14
|
+
* **Argv shape.** No flags — `team-list` is argv-empty.
|
|
15
|
+
*
|
|
16
|
+
* **Output envelope.** Wrapped record `data: { teams:
|
|
17
|
+
* [Team], returned_count }` mirroring M22 `monday usage` +
|
|
18
|
+
* M32 `doc list` wrapped-record cadence. No `has_more` /
|
|
19
|
+
* cursor slot (D6 — wire has no pagination).
|
|
20
|
+
*
|
|
21
|
+
* **Teams are live-only at v0.5-M34** per cli-design §8 cache
|
|
22
|
+
* scope. Output `meta.source: "live"`, `meta.cache_age_
|
|
23
|
+
* seconds: null`. Team membership churns frequently; the
|
|
24
|
+
* stale-cache risk outweighs the cache-hit value.
|
|
25
|
+
*
|
|
26
|
+
* **Idempotent: yes** (pure read).
|
|
27
|
+
*
|
|
28
|
+
* **Runtime body landed at v0.5-M34 IMPL.** A single wire
|
|
29
|
+
* round-trip via {@link listTeams} populates the wrapped
|
|
30
|
+
* record envelope; `returned_count` is the cached
|
|
31
|
+
* `teams.length` for agent ergonomics.
|
|
32
|
+
*/
|
|
33
|
+
import { z } from 'zod';
|
|
34
|
+
import { ensureSubcommand } from '../types.js';
|
|
35
|
+
import { parseArgv } from '../parse-argv.js';
|
|
36
|
+
import { emitSuccess } from '../emit.js';
|
|
37
|
+
import { resolveClient } from '../../api/resolve-client.js';
|
|
38
|
+
import { listTeams, teamListOutputSchema, } from '../../api/teams.js';
|
|
39
|
+
const inputSchema = z.object({}).strict();
|
|
40
|
+
export const teamListCommand = {
|
|
41
|
+
name: 'user.team-list',
|
|
42
|
+
summary: 'List every team visible to the token (no pagination on Monday\'s wire)',
|
|
43
|
+
examples: [
|
|
44
|
+
'monday user team-list',
|
|
45
|
+
'monday user team-list --json',
|
|
46
|
+
],
|
|
47
|
+
idempotent: true,
|
|
48
|
+
inputSchema,
|
|
49
|
+
outputSchema: teamListOutputSchema,
|
|
50
|
+
attach: (program, ctx) => {
|
|
51
|
+
const noun = ensureSubcommand(program, 'user', 'User commands');
|
|
52
|
+
noun
|
|
53
|
+
.command('team-list')
|
|
54
|
+
.description(teamListCommand.summary)
|
|
55
|
+
.addHelpText('after', [
|
|
56
|
+
'',
|
|
57
|
+
'Examples:',
|
|
58
|
+
...teamListCommand.examples.map((e) => ` ${e}`),
|
|
59
|
+
'',
|
|
60
|
+
'Notes:',
|
|
61
|
+
' - Monday\'s `Query.teams` exposes no pagination — every visible team returns in one call.',
|
|
62
|
+
' - Each team carries `users` (members) + `owners` (managers) lists slim-projected to {id, name, email}.',
|
|
63
|
+
'',
|
|
64
|
+
].join('\n'))
|
|
65
|
+
.action(async (opts) => {
|
|
66
|
+
// Argv is empty for team-list; parseArgv still fires to
|
|
67
|
+
// verify "no unknown flags" at the parse boundary.
|
|
68
|
+
parseArgv(teamListCommand.inputSchema, opts ?? {});
|
|
69
|
+
const { client, apiVersion } = resolveClient(ctx, program.opts());
|
|
70
|
+
const result = await listTeams({ client });
|
|
71
|
+
const returnedCount = result.teams.length;
|
|
72
|
+
emitSuccess({
|
|
73
|
+
ctx,
|
|
74
|
+
data: {
|
|
75
|
+
teams: [...result.teams],
|
|
76
|
+
returned_count: returnedCount,
|
|
77
|
+
},
|
|
78
|
+
schema: teamListCommand.outputSchema,
|
|
79
|
+
programOpts: program.opts(),
|
|
80
|
+
kind: 'single',
|
|
81
|
+
warnings: [],
|
|
82
|
+
source: result.source,
|
|
83
|
+
cacheAgeSeconds: result.cacheAgeSeconds,
|
|
84
|
+
complexity: result.complexity,
|
|
85
|
+
apiVersion,
|
|
86
|
+
});
|
|
87
|
+
});
|
|
88
|
+
},
|
|
89
|
+
};
|
|
90
|
+
//# sourceMappingURL=team-list.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"team-list.js","sourceRoot":"","sources":["../../../src/commands/user/team-list.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA+BG;AACH,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AACxB,OAAO,EAAE,gBAAgB,EAAsB,MAAM,aAAa,CAAC;AACnE,OAAO,EAAE,SAAS,EAAE,MAAM,kBAAkB,CAAC;AAC7C,OAAO,EAAE,WAAW,EAAE,MAAM,YAAY,CAAC;AACzC,OAAO,EAAE,aAAa,EAAE,MAAM,6BAA6B,CAAC;AAC5D,OAAO,EACL,SAAS,EACT,oBAAoB,GAErB,MAAM,oBAAoB,CAAC;AAE5B,MAAM,WAAW,GAAG,CAAC,CAAC,MAAM,CAAC,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC;AAE1C,MAAM,CAAC,MAAM,eAAe,GAGxB;IACF,IAAI,EAAE,gBAAgB;IACtB,OAAO,EAAE,wEAAwE;IACjF,QAAQ,EAAE;QACR,uBAAuB;QACvB,8BAA8B;KAC/B;IACD,UAAU,EAAE,IAAI;IAChB,WAAW;IACX,YAAY,EAAE,oBAAoB;IAClC,MAAM,EAAE,CAAC,OAAO,EAAE,GAAG,EAAE,EAAE;QACvB,MAAM,IAAI,GAAG,gBAAgB,CAAC,OAAO,EAAE,MAAM,EAAE,eAAe,CAAC,CAAC;QAChE,IAAI;aACD,OAAO,C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remove-members <tid> --users <id,...>
|
|
3
|
+
* [--dry-run]` — remove one or more users from a team
|
|
4
|
+
* (`cli-design.md` §4.3 USER section + §13 v0.5 entry;
|
|
5
|
+
* `v0.5-plan.md` §3 M34).
|
|
6
|
+
*
|
|
7
|
+
* **Wire shape.** Single `remove_users_from_team(team_id,
|
|
8
|
+
* user_ids)` round-trip via {@link removeUsersFromTeam}
|
|
9
|
+
* against `mutation RemoveUsersFromTeam` with `operationName:
|
|
10
|
+
* 'RemoveUsersFromTeam'` (R-NEW-37 W2 audit-point). Monday
|
|
11
|
+
* returns `ChangeTeamMembershipsResult { failed_users:
|
|
12
|
+
* [User!], successful_users: [User!] }` — same wire-level
|
|
13
|
+
* partial-success envelope as add-members. The action body
|
|
14
|
+
* wraps this into the §6.1 universal partial-success shape
|
|
15
|
+
* `data: { operation: "remove_users_from_team", team_id,
|
|
16
|
+
* results: [{ok, user_id, ...}] }` (D5 closure).
|
|
17
|
+
*
|
|
18
|
+
* **Argv shape.**
|
|
19
|
+
*
|
|
20
|
+
* - `<teamId>` — positional `TeamId`. Required, brand-
|
|
21
|
+
* validated at parse boundary.
|
|
22
|
+
* - `--users <id,...>` — required, comma-separated numeric
|
|
23
|
+
* user IDs (maps to wire `user_ids: [ID!]!`). Each entry
|
|
24
|
+
* brand-validated via {@link UserIdSchema} through the
|
|
25
|
+
* lifted {@link parseBrandedListArg} helper (R-NEW-70
|
|
26
|
+
* consumer #4 post-lift).
|
|
27
|
+
*
|
|
28
|
+
* **Output envelope.** Same shape as
|
|
29
|
+
* {@link teamAddMembersCommand} but with `operation:
|
|
30
|
+
* 'remove_users_from_team'` so agents that key off the
|
|
31
|
+
* operation literal can dispatch the right post-mutation
|
|
32
|
+
* recovery flow.
|
|
33
|
+
*
|
|
34
|
+
* **Wire-vs-CLI semantics asymmetry.** Same generic-
|
|
35
|
+
* `membership_failed`-code asymmetry as team-add-members; see
|
|
36
|
+
* `teamMembershipResultSchema` JSDoc in `src/api/teams.ts` for
|
|
37
|
+
* the canonical note + cross-link to `docs/architecture.md`'s
|
|
38
|
+
* "Wire-vs-CLI semantics documentation conventions" section.
|
|
39
|
+
*
|
|
40
|
+
* **Dry-run shape** per cli-design §6.4 mutation-dry-run
|
|
41
|
+
* variant. SINGLE planned operation entry `{operation:
|
|
42
|
+
* 'remove_users_from_team', team_id, user_ids: [...]}` with
|
|
43
|
+
* `user_ids` echoing the input argv order — Monday's wire is
|
|
44
|
+
* a single-shot bulk call (`remove_users_from_team(team_id,
|
|
45
|
+
* user_ids: [ID!]!)`), NOT a per-user fan-out like
|
|
46
|
+
* `monday workspace remove-users`. No preflight read fires;
|
|
47
|
+
* argv-derived. `meta.source: 'none'`.
|
|
48
|
+
*
|
|
49
|
+
* **Idempotent: yes** — Monday is no-op on a re-remove (the
|
|
50
|
+
* user already being out of the team surfaces in
|
|
51
|
+
* `successful_users[]` per Monday's wire convention).
|
|
52
|
+
*
|
|
53
|
+
* **Admin-permission-sensitive.** Non-admin callers surface
|
|
54
|
+
* `forbidden`.
|
|
55
|
+
*
|
|
56
|
+
* **Runtime body landed at v0.5-M34 IMPL.** Mirrors the
|
|
57
|
+
* `team-add-members` cadence verbatim modulo the `operation`
|
|
58
|
+
* literal — argv + `--users` parse → resolveClient → dry-run
|
|
59
|
+
* or live dispatch via {@link removeUsersFromTeam} → shared
|
|
60
|
+
* {@link projectMembershipResults} → `emitMutation`.
|
|
61
|
+
*/
|
|
62
|
+
import { z } from 'zod';
|
|
63
|
+
import { type CommandModule } from '../types.js';
|
|
64
|
+
import { type TeamRemoveMembersOutput } from '../../api/teams.js';
|
|
65
|
+
declare const inputSchema: z.ZodObject<{
|
|
66
|
+
teamId: z.core.$ZodBranded<z.ZodString, "TeamId", "out">;
|
|
67
|
+
users: z.ZodString;
|
|
68
|
+
}, z.core.$strict>;
|
|
69
|
+
export declare const teamRemoveMembersCommand: CommandModule<z.infer<typeof inputSchema>, TeamRemoveMembersOutput>;
|
|
70
|
+
export {};
|
|
71
|
+
//# sourceMappingURL=team-remove-members.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"team-remove-members.d.ts","sourceRoot":"","sources":["../../../src/commands/user/team-remove-members.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA4DG;AACH,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AACxB,OAAO,EAAoB,KAAK,aAAa,EAAE,MAAM,aAAa,CAAC;AAMnE,OAAO,EAGL,KAAK,uBAAuB,EAC7B,MAAM,oBAAoB,CAAC;AAG5B,QAAA,MAAM,WAAW;;;kBAKN,CAAC;AAEZ,eAAO,MAAM,wBAAwB,EAAE,aAAa,CAClD,CAAC,CAAC,KAAK,CAAC,OAAO,WAAW,CAAC,EAC3B,uBAAuB,CAiHxB,CAAC"}
|