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.
Files changed (122) hide show
  1. package/CHANGELOG.md +368 -0
  2. package/README.md +112 -34
  3. package/dist/api/column-types.d.ts +3 -1
  4. package/dist/api/column-types.d.ts.map +1 -1
  5. package/dist/api/column-types.js +3 -1
  6. package/dist/api/column-types.js.map +1 -1
  7. package/dist/api/column-values.d.ts +5 -4
  8. package/dist/api/column-values.d.ts.map +1 -1
  9. package/dist/api/column-values.js +6 -5
  10. package/dist/api/column-values.js.map +1 -1
  11. package/dist/api/documents.d.ts +1136 -3
  12. package/dist/api/documents.d.ts.map +1 -1
  13. package/dist/api/documents.js +1828 -3
  14. package/dist/api/documents.js.map +1 -1
  15. package/dist/api/raw-write.d.ts +6 -5
  16. package/dist/api/raw-write.d.ts.map +1 -1
  17. package/dist/api/raw-write.js +7 -6
  18. package/dist/api/raw-write.js.map +1 -1
  19. package/dist/api/teams.d.ts +657 -0
  20. package/dist/api/teams.d.ts.map +1 -0
  21. package/dist/api/teams.js +880 -0
  22. package/dist/api/teams.js.map +1 -0
  23. package/dist/commands/doc/append-markdown.d.ts +117 -0
  24. package/dist/commands/doc/append-markdown.d.ts.map +1 -0
  25. package/dist/commands/doc/append-markdown.js +253 -0
  26. package/dist/commands/doc/append-markdown.js.map +1 -0
  27. package/dist/commands/doc/block-create.d.ts +114 -0
  28. package/dist/commands/doc/block-create.d.ts.map +1 -0
  29. package/dist/commands/doc/block-create.js +206 -0
  30. package/dist/commands/doc/block-create.js.map +1 -0
  31. package/dist/commands/doc/block-delete.d.ts +72 -0
  32. package/dist/commands/doc/block-delete.d.ts.map +1 -0
  33. package/dist/commands/doc/block-delete.js +161 -0
  34. package/dist/commands/doc/block-delete.js.map +1 -0
  35. package/dist/commands/doc/block-update.d.ts +75 -0
  36. package/dist/commands/doc/block-update.d.ts.map +1 -0
  37. package/dist/commands/doc/block-update.js +162 -0
  38. package/dist/commands/doc/block-update.js.map +1 -0
  39. package/dist/commands/doc/create-in-workspace.d.ts +76 -0
  40. package/dist/commands/doc/create-in-workspace.d.ts.map +1 -0
  41. package/dist/commands/doc/create-in-workspace.js +164 -0
  42. package/dist/commands/doc/create-in-workspace.js.map +1 -0
  43. package/dist/commands/doc/create-on-column.d.ts +71 -0
  44. package/dist/commands/doc/create-on-column.d.ts.map +1 -0
  45. package/dist/commands/doc/create-on-column.js +146 -0
  46. package/dist/commands/doc/create-on-column.js.map +1 -0
  47. package/dist/commands/doc/delete.d.ts +68 -0
  48. package/dist/commands/doc/delete.d.ts.map +1 -0
  49. package/dist/commands/doc/delete.js +146 -0
  50. package/dist/commands/doc/delete.js.map +1 -0
  51. package/dist/commands/doc/duplicate.d.ts +101 -0
  52. package/dist/commands/doc/duplicate.d.ts.map +1 -0
  53. package/dist/commands/doc/duplicate.js +191 -0
  54. package/dist/commands/doc/duplicate.js.map +1 -0
  55. package/dist/commands/doc/import-html.d.ts +125 -0
  56. package/dist/commands/doc/import-html.d.ts.map +1 -0
  57. package/dist/commands/doc/import-html.js +273 -0
  58. package/dist/commands/doc/import-html.js.map +1 -0
  59. package/dist/commands/doc/list.d.ts +6 -3
  60. package/dist/commands/doc/list.d.ts.map +1 -1
  61. package/dist/commands/doc/list.js +17 -48
  62. package/dist/commands/doc/list.js.map +1 -1
  63. package/dist/commands/doc/rename.d.ts +60 -0
  64. package/dist/commands/doc/rename.d.ts.map +1 -0
  65. package/dist/commands/doc/rename.js +135 -0
  66. package/dist/commands/doc/rename.js.map +1 -0
  67. package/dist/commands/index.d.ts.map +1 -1
  68. package/dist/commands/index.js +116 -0
  69. package/dist/commands/index.js.map +1 -1
  70. package/dist/commands/item/create.js +2 -2
  71. package/dist/commands/update/create.d.ts.map +1 -1
  72. package/dist/commands/update/create.js +6 -4
  73. package/dist/commands/update/create.js.map +1 -1
  74. package/dist/commands/update/edit.d.ts +4 -2
  75. package/dist/commands/update/edit.d.ts.map +1 -1
  76. package/dist/commands/update/edit.js +10 -6
  77. package/dist/commands/update/edit.js.map +1 -1
  78. package/dist/commands/update/reply.d.ts +4 -2
  79. package/dist/commands/update/reply.d.ts.map +1 -1
  80. package/dist/commands/update/reply.js +10 -6
  81. package/dist/commands/update/reply.js.map +1 -1
  82. package/dist/commands/user/_team-membership.d.ts +10 -0
  83. package/dist/commands/user/_team-membership.d.ts.map +1 -0
  84. package/dist/commands/user/_team-membership.js +88 -0
  85. package/dist/commands/user/_team-membership.js.map +1 -0
  86. package/dist/commands/user/team-add-members.d.ts +81 -0
  87. package/dist/commands/user/team-add-members.d.ts.map +1 -0
  88. package/dist/commands/user/team-add-members.js +186 -0
  89. package/dist/commands/user/team-add-members.js.map +1 -0
  90. package/dist/commands/user/team-create.d.ts +82 -0
  91. package/dist/commands/user/team-create.d.ts.map +1 -0
  92. package/dist/commands/user/team-create.js +206 -0
  93. package/dist/commands/user/team-create.js.map +1 -0
  94. package/dist/commands/user/team-delete.d.ts +56 -0
  95. package/dist/commands/user/team-delete.d.ts.map +1 -0
  96. package/dist/commands/user/team-delete.js +137 -0
  97. package/dist/commands/user/team-delete.js.map +1 -0
  98. package/dist/commands/user/team-get.d.ts +41 -0
  99. package/dist/commands/user/team-get.d.ts.map +1 -0
  100. package/dist/commands/user/team-get.js +87 -0
  101. package/dist/commands/user/team-get.js.map +1 -0
  102. package/dist/commands/user/team-list.d.ts +39 -0
  103. package/dist/commands/user/team-list.d.ts.map +1 -0
  104. package/dist/commands/user/team-list.js +90 -0
  105. package/dist/commands/user/team-list.js.map +1 -0
  106. package/dist/commands/user/team-remove-members.d.ts +71 -0
  107. package/dist/commands/user/team-remove-members.d.ts.map +1 -0
  108. package/dist/commands/user/team-remove-members.js +176 -0
  109. package/dist/commands/user/team-remove-members.js.map +1 -0
  110. package/dist/types/ids.d.ts +6 -0
  111. package/dist/types/ids.d.ts.map +1 -1
  112. package/dist/types/ids.js +46 -5
  113. package/dist/types/ids.js.map +1 -1
  114. package/dist/utils/parse-brand-list.d.ts +95 -0
  115. package/dist/utils/parse-brand-list.d.ts.map +1 -0
  116. package/dist/utils/parse-brand-list.js +96 -0
  117. package/dist/utils/parse-brand-list.js.map +1 -0
  118. package/dist/utils/source-content.d.ts +93 -0
  119. package/dist/utils/source-content.d.ts.map +1 -0
  120. package/dist/utils/source-content.js +120 -0
  121. package/dist/utils/source-content.js.map +1 -0
  122. package/package.json +1 -1
@@ -0,0 +1,186 @@
1
+ /**
2
+ * `monday user team-add-members <tid> --users <id,...>
3
+ * [--dry-run]` — add one or more users to a team (`cli-design.md`
4
+ * §4.3 USER section + §13 v0.5 entry; `v0.5-plan.md` §3 M34).
5
+ *
6
+ * **Wire shape.** Single `add_users_to_team(team_id, user_ids)`
7
+ * round-trip via {@link addUsersToTeam} against `mutation
8
+ * AddUsersToTeam` with `operationName: 'AddUsersToTeam'`
9
+ * (R-NEW-37 W2 audit-point). Monday returns
10
+ * `ChangeTeamMembershipsResult { failed_users: [User!],
11
+ * successful_users: [User!] }` — a wire-level partial-success
12
+ * envelope. The action body wraps this into the §6.1
13
+ * universal partial-success shape `data: { operation:
14
+ * "add_users_to_team", team_id, results: [{ok, user_id, ...}]
15
+ * }` at the verb boundary (D5 closure).
16
+ *
17
+ * **Argv shape.**
18
+ *
19
+ * - `<teamId>` — positional `TeamId`. Required, brand-
20
+ * validated at parse boundary.
21
+ * - `--users <id,...>` — required, comma-separated numeric
22
+ * user IDs (maps to wire `user_ids: [ID!]!`). Each entry
23
+ * brand-validated via {@link UserIdSchema} through the
24
+ * lifted {@link parseBrandedListArg} helper (R-NEW-70
25
+ * consumer #3 post-lift).
26
+ *
27
+ * **Output envelope.** Per cli-design §6.1 universal partial-
28
+ * success shape — emits one `ok: true` envelope with
29
+ * `data: { operation: "add_users_to_team", team_id, results:
30
+ * [{user_id, ok, user?, error?}] }`. The wire's
31
+ * `failed_users[]` projects to `{ok: false, user_id, error:
32
+ * {code: "membership_failed", message: <generic>}}` records;
33
+ * the wire's `successful_users[]` projects to `{ok: true,
34
+ * user_id, user: {id, name, email}}` records. Result order
35
+ * mirrors the input `--users <id,...>` order (input ID echoed
36
+ * into `user_id` for correlation; wire User object hydrated
37
+ * into `user` slot when successful).
38
+ *
39
+ * **Wire-vs-CLI semantics asymmetry.** See
40
+ * `teamMembershipResultSchema` JSDoc in `src/api/teams.ts` for
41
+ * the canonical note + cross-link to `docs/architecture.md`'s
42
+ * "Wire-vs-CLI semantics documentation conventions" section
43
+ * (R-NEW-41 4th consumer trigger).
44
+ *
45
+ * **Dry-run shape** per cli-design §6.4 mutation-dry-run
46
+ * variant. SINGLE planned operation entry `{operation:
47
+ * 'add_users_to_team', team_id, user_ids: [...]}` with
48
+ * `user_ids` echoing the input argv order — Monday's wire
49
+ * is a single-shot bulk call (`add_users_to_team(team_id,
50
+ * user_ids: [ID!]!)`), NOT a per-user fan-out like
51
+ * `monday workspace add-users` (which dispatches sequentially
52
+ * one wire call per user). No preflight read fires; argv-
53
+ * derived. `meta.source: 'none'`.
54
+ *
55
+ * **Idempotent: yes** — Monday is no-op on a re-add (the
56
+ * user already being in the team surfaces as `successful_
57
+ * users[]` regardless). Same idempotency story as
58
+ * `workspace add-users`.
59
+ *
60
+ * **Admin-permission-sensitive.** Non-admin callers surface
61
+ * `forbidden` (mapped from Monday's PERMISSION_DENIED
62
+ * extension).
63
+ *
64
+ * **Runtime body landed at v0.5-M34 IMPL.** Argv + `--users`
65
+ * parse run BEFORE `resolveClient` (usage-error-before-config-
66
+ * error precedence). Dry-run path emits the minimal planned
67
+ * shape; live path dispatches {@link addUsersToTeam} and
68
+ * projects `failed_users[]` / `successful_users[]` into the
69
+ * universal §6.1 partial-success envelope via
70
+ * {@link projectMembershipResults} (input order preserved).
71
+ */
72
+ import { z } from 'zod';
73
+ import { ensureSubcommand } from '../types.js';
74
+ import { parseArgv } from '../parse-argv.js';
75
+ import { emitDryRun, emitMutation } from '../emit.js';
76
+ import { resolveClient } from '../../api/resolve-client.js';
77
+ import { TeamIdSchema, UserIdSchema } from '../../types/ids.js';
78
+ import { parseBrandedListArg } from '../../utils/parse-brand-list.js';
79
+ import { addUsersToTeam, teamAddMembersOutputSchema, } from '../../api/teams.js';
80
+ import { projectMembershipResults } from './_team-membership.js';
81
+ const inputSchema = z
82
+ .object({
83
+ teamId: TeamIdSchema,
84
+ users: z.string().min(1, '--users must not be empty'),
85
+ })
86
+ .strict();
87
+ export const teamAddMembersCommand = {
88
+ name: 'user.team-add-members',
89
+ summary: 'Add users to a team (partial-success envelope)',
90
+ examples: [
91
+ 'monday user team-add-members 12345 --users 67890',
92
+ 'monday user team-add-members 12345 --users 67890,67891',
93
+ 'monday user team-add-members 12345 --users 67890 --dry-run --json',
94
+ ],
95
+ // Re-adding an existing team member is a no-op on Monday's
96
+ // wire (the user surfaces as `successful_users[]`); mark
97
+ // idempotent so agents can retry on transient failure.
98
+ idempotent: true,
99
+ inputSchema,
100
+ outputSchema: teamAddMembersOutputSchema,
101
+ attach: (program, ctx) => {
102
+ const noun = ensureSubcommand(program, 'user', 'User commands');
103
+ noun
104
+ .command('team-add-members <teamId>')
105
+ .description(teamAddMembersCommand.summary)
106
+ .requiredOption('--users <list>', 'Comma-separated numeric user IDs to add (maps to wire `user_ids: [ID!]!`).')
107
+ .addHelpText('after', [
108
+ '',
109
+ 'Examples:',
110
+ ...teamAddMembersCommand.examples.map((e) => ` ${e}`),
111
+ '',
112
+ 'Notes:',
113
+ ' - Envelope is per-cli-design §6.1 partial-success (`results: [{user_id, ok, ...}]`).',
114
+ ' - Re-adding an existing member is a no-op (surfaces as `successful_users[]`).',
115
+ '',
116
+ ].join('\n'))
117
+ .action(async (teamIdArg, opts) => {
118
+ const parsed = parseArgv(teamAddMembersCommand.inputSchema, {
119
+ teamId: teamIdArg,
120
+ ...opts,
121
+ });
122
+ // Parse `--users` once at the boundary so a malformed
123
+ // user ID surfaces `usage_error` ahead of any wire call.
124
+ // Lifted helper at R-NEW-70 (consumer #3 post-lift).
125
+ const userIds = parseBrandedListArg(parsed.users, UserIdSchema, {
126
+ flagName: '--users',
127
+ entryDescription: 'numeric user ID',
128
+ hint: 'user IDs are numeric (e.g. 67890)',
129
+ emptyEntryHint: 'e.g. --users 67890,67891 — no leading, trailing, or ' +
130
+ 'duplicate commas',
131
+ });
132
+ const { client, globalFlags, apiVersion } = resolveClient(ctx, program.opts());
133
+ if (globalFlags.dryRun) {
134
+ // Minimal dry-run shape per cli-design §6.4 — single
135
+ // planned operation echoing what the live wire call
136
+ // would send. No preflight read fires; `meta.source:
137
+ // 'none'`.
138
+ emitDryRun({
139
+ ctx,
140
+ programOpts: program.opts(),
141
+ plannedChanges: [
142
+ {
143
+ operation: 'add_users_to_team',
144
+ team_id: parsed.teamId,
145
+ user_ids: [...userIds],
146
+ },
147
+ ],
148
+ source: 'none',
149
+ cacheAgeSeconds: null,
150
+ warnings: [],
151
+ apiVersion,
152
+ });
153
+ return;
154
+ }
155
+ const result = await addUsersToTeam({
156
+ client,
157
+ teamId: parsed.teamId,
158
+ userIds,
159
+ });
160
+ const results = projectMembershipResults({
161
+ inputUserIds: userIds,
162
+ failedUsers: result.failedUsers,
163
+ successfulUsers: result.successfulUsers,
164
+ operation: 'add_users_to_team',
165
+ teamId: parsed.teamId,
166
+ });
167
+ const data = {
168
+ operation: 'add_users_to_team',
169
+ team_id: parsed.teamId,
170
+ results: [...results],
171
+ };
172
+ emitMutation({
173
+ ctx,
174
+ data,
175
+ schema: teamAddMembersCommand.outputSchema,
176
+ programOpts: program.opts(),
177
+ warnings: [],
178
+ source: result.source,
179
+ cacheAgeSeconds: result.cacheAgeSeconds,
180
+ complexity: result.complexity,
181
+ apiVersion,
182
+ });
183
+ });
184
+ },
185
+ };
186
+ //# sourceMappingURL=team-add-members.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"team-add-members.js","sourceRoot":"","sources":["../../../src/commands/user/team-add-members.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;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I;oBACrB,QAAQ,EAAE,EAAE;oBACZ,UAAU;iBACX,CAAC,CAAC;gBACH,OAAO;YACT,CAAC;YAED,MAAM,MAAM,GAAG,MAAM,cAAc,CAAC;gBAClC,MAAM;gBACN,MAAM,EAAE,MAAM,CAAC,MAAM;gBACrB,OAAO;aACR,CAAC,CAAC;YACH,MAAM,OAAO,GAAG,wBAAwB,CAAC;gBACvC,YAAY,EAAE,OAAO;gBACrB,WAAW,EAAE,MAAM,CAAC,WAAW;gBAC/B,eAAe,EAAE,MAAM,CAAC,eAAe;gBACvC,SAAS,EAAE,mBAAmB;gBAC9B,MAAM,EAAE,MAAM,CAAC,MAAM;aACtB,CAAC,CAAC;YACH,MAAM,IAAI,GAAyB;gBACjC,SAAS,EAAE,mBAAmB;gBAC9B,OAAO,EAAE,MAAM,CAAC,MAAM;gBACtB,OAAO,EAAE,CAAC,GAAG,OAAO,CAAC;aACtB,CAAC;YACF,YAAY,CAAC;gBACX,GAAG;gBACH,IAAI;gBACJ,MAAM,EAAE,qBAAqB,CAAC,YAAY;gBAC1C,WAAW,EAAE,OAAO,CAAC,IAAI,EAAE;gBAC3B,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,82 @@
1
+ /**
2
+ * `monday user team-create --name <n> [--users <id,...>]
3
+ * [--guest-team] [--allow-empty] [--dry-run]` — create a new
4
+ * team (`cli-design.md` §4.3 USER section + §13 v0.5 entry;
5
+ * `v0.5-plan.md` §3 M34).
6
+ *
7
+ * **Wire shape.** Single `create_team(input, options)` round-
8
+ * trip via {@link createTeam} against `mutation CreateTeam`
9
+ * with `operationName: 'CreateTeam'` (R-NEW-37 W2 audit-point).
10
+ * Returns the created `Team` with `id` populated post-create
11
+ * + any `--users <id,...>` hydrated into the `users` slot.
12
+ *
13
+ * **Argv shape.**
14
+ *
15
+ * - `--name <n>` — required (Monday's `CreateTeamAttributes
16
+ * Input.name` is `String!`). Empty string rejects at the
17
+ * parse boundary.
18
+ * - `--users <id,...>` — optional, comma-separated numeric
19
+ * user IDs (maps to wire `subscriber_ids: [ID!]`). Each
20
+ * entry brand-validated via {@link UserIdSchema} through
21
+ * the lifted {@link parseBrandedListArg} helper (R-NEW-70
22
+ * consumer #2 post-lift). Wire description: "Must not be
23
+ * empty, unless allow_empty_team is set"; the CLI
24
+ * surface forwards a non-empty list when supplied, OR
25
+ * omits the variable entirely when `--users` is absent.
26
+ * - `--guest-team` — optional boolean (maps to wire
27
+ * `is_guest_team: Boolean`). Absent → omitted (Monday's
28
+ * server-side default applies).
29
+ * - `--allow-empty` — optional boolean (maps to wire
30
+ * `options.allow_empty_team: Boolean`). Absent → omitted.
31
+ *
32
+ * **Out-of-scope flags carried forward from probe findings:**
33
+ *
34
+ * - `--parent <ptid>` (wire slot exists via
35
+ * `CreateTeamAttributesInput.parent_team_id`) — D3
36
+ * deferral; agent-UX hierarchical-team semantics
37
+ * unclear today. Flag deferred to v0.5.x.
38
+ * - `--description` (no wire-side persistence; `Team`
39
+ * object carries no `description` field) — D1 closure;
40
+ * dropped from v0.4 cli-design row.
41
+ *
42
+ * **Output envelope.** Direct unwrap of the created Team —
43
+ * `data: <Team>`. Mirrors M14 `workspace create` cadence.
44
+ *
45
+ * **Dry-run shape** per cli-design §6.4 mutation-dry-run variant.
46
+ * Minimal envelope listing the planned `create_team` operation
47
+ * + the resolved input fields (`name`, optional `is_guest_team`,
48
+ * optional `subscriber_ids`, optional `allow_empty_team`). No
49
+ * preflight read fires; the dry-run is purely argv-derived.
50
+ * `meta.source: 'none'`. Mirrors M14 `workspace create` cadence —
51
+ * the create-no-read pattern is uniform across non-destructive
52
+ * write verbs (`workspace create` / `board create` / now
53
+ * `user team-create`).
54
+ *
55
+ * **Idempotent: false.** Re-running `team-create --name foo`
56
+ * creates a SECOND team with the same name (Monday allows
57
+ * duplicate team names). Agents that need idempotency must
58
+ * pair with a `team-list` lookup first.
59
+ *
60
+ * **Admin-permission-sensitive.** Non-admin tokens surface
61
+ * `forbidden` (mapped from Monday's PERMISSION_DENIED
62
+ * extension).
63
+ *
64
+ * **Runtime body landed at v0.5-M34 IMPL.** Argv parsing +
65
+ * `--users` comma-split run BEFORE `resolveClient` so a
66
+ * malformed `--users` surfaces `usage_error` ahead of any
67
+ * missing-token `config_error`. Dry-run path emits minimal
68
+ * planned changes (no wire call fires); live path dispatches
69
+ * {@link createTeam} + projects via `emitMutation`.
70
+ */
71
+ import { z } from 'zod';
72
+ import { type CommandModule } from '../types.js';
73
+ import { type TeamCreateOutput } from '../../api/teams.js';
74
+ declare const inputSchema: z.ZodObject<{
75
+ name: z.ZodString;
76
+ users: z.ZodOptional<z.ZodString>;
77
+ guestTeam: z.ZodOptional<z.ZodBoolean>;
78
+ allowEmpty: z.ZodOptional<z.ZodBoolean>;
79
+ }, z.core.$strict>;
80
+ export declare const teamCreateCommand: CommandModule<z.infer<typeof inputSchema>, TeamCreateOutput>;
81
+ export {};
82
+ //# sourceMappingURL=team-create.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"team-create.d.ts","sourceRoot":"","sources":["../../../src/commands/user/team-create.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAqEG;AACH,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AACxB,OAAO,EAAoB,KAAK,aAAa,EAAE,MAAM,aAAa,CAAC;AAMnE,OAAO,EAGL,KAAK,gBAAgB,EACtB,MAAM,oBAAoB,CAAC;AAE5B,QAAA,MAAM,WAAW;;;;;kBAeN,CAAC;AAEZ,eAAO,MAAM,iBAAiB,EAAE,aAAa,CAC3C,CAAC,CAAC,KAAK,CAAC,OAAO,WAAW,CAAC,EAC3B,gBAAgB,CAiIjB,CAAC"}
@@ -0,0 +1,206 @@
1
+ /**
2
+ * `monday user team-create --name <n> [--users <id,...>]
3
+ * [--guest-team] [--allow-empty] [--dry-run]` — create a new
4
+ * team (`cli-design.md` §4.3 USER section + §13 v0.5 entry;
5
+ * `v0.5-plan.md` §3 M34).
6
+ *
7
+ * **Wire shape.** Single `create_team(input, options)` round-
8
+ * trip via {@link createTeam} against `mutation CreateTeam`
9
+ * with `operationName: 'CreateTeam'` (R-NEW-37 W2 audit-point).
10
+ * Returns the created `Team` with `id` populated post-create
11
+ * + any `--users <id,...>` hydrated into the `users` slot.
12
+ *
13
+ * **Argv shape.**
14
+ *
15
+ * - `--name <n>` — required (Monday's `CreateTeamAttributes
16
+ * Input.name` is `String!`). Empty string rejects at the
17
+ * parse boundary.
18
+ * - `--users <id,...>` — optional, comma-separated numeric
19
+ * user IDs (maps to wire `subscriber_ids: [ID!]`). Each
20
+ * entry brand-validated via {@link UserIdSchema} through
21
+ * the lifted {@link parseBrandedListArg} helper (R-NEW-70
22
+ * consumer #2 post-lift). Wire description: "Must not be
23
+ * empty, unless allow_empty_team is set"; the CLI
24
+ * surface forwards a non-empty list when supplied, OR
25
+ * omits the variable entirely when `--users` is absent.
26
+ * - `--guest-team` — optional boolean (maps to wire
27
+ * `is_guest_team: Boolean`). Absent → omitted (Monday's
28
+ * server-side default applies).
29
+ * - `--allow-empty` — optional boolean (maps to wire
30
+ * `options.allow_empty_team: Boolean`). Absent → omitted.
31
+ *
32
+ * **Out-of-scope flags carried forward from probe findings:**
33
+ *
34
+ * - `--parent <ptid>` (wire slot exists via
35
+ * `CreateTeamAttributesInput.parent_team_id`) — D3
36
+ * deferral; agent-UX hierarchical-team semantics
37
+ * unclear today. Flag deferred to v0.5.x.
38
+ * - `--description` (no wire-side persistence; `Team`
39
+ * object carries no `description` field) — D1 closure;
40
+ * dropped from v0.4 cli-design row.
41
+ *
42
+ * **Output envelope.** Direct unwrap of the created Team —
43
+ * `data: <Team>`. Mirrors M14 `workspace create` cadence.
44
+ *
45
+ * **Dry-run shape** per cli-design §6.4 mutation-dry-run variant.
46
+ * Minimal envelope listing the planned `create_team` operation
47
+ * + the resolved input fields (`name`, optional `is_guest_team`,
48
+ * optional `subscriber_ids`, optional `allow_empty_team`). No
49
+ * preflight read fires; the dry-run is purely argv-derived.
50
+ * `meta.source: 'none'`. Mirrors M14 `workspace create` cadence —
51
+ * the create-no-read pattern is uniform across non-destructive
52
+ * write verbs (`workspace create` / `board create` / now
53
+ * `user team-create`).
54
+ *
55
+ * **Idempotent: false.** Re-running `team-create --name foo`
56
+ * creates a SECOND team with the same name (Monday allows
57
+ * duplicate team names). Agents that need idempotency must
58
+ * pair with a `team-list` lookup first.
59
+ *
60
+ * **Admin-permission-sensitive.** Non-admin tokens surface
61
+ * `forbidden` (mapped from Monday's PERMISSION_DENIED
62
+ * extension).
63
+ *
64
+ * **Runtime body landed at v0.5-M34 IMPL.** Argv parsing +
65
+ * `--users` comma-split run BEFORE `resolveClient` so a
66
+ * malformed `--users` surfaces `usage_error` ahead of any
67
+ * missing-token `config_error`. Dry-run path emits minimal
68
+ * planned changes (no wire call fires); live path dispatches
69
+ * {@link createTeam} + projects via `emitMutation`.
70
+ */
71
+ import { z } from 'zod';
72
+ import { ensureSubcommand } from '../types.js';
73
+ import { parseArgv } from '../parse-argv.js';
74
+ import { emitDryRun, emitMutation } from '../emit.js';
75
+ import { resolveClient } from '../../api/resolve-client.js';
76
+ import { UserIdSchema } from '../../types/ids.js';
77
+ import { parseBrandedListArg } from '../../utils/parse-brand-list.js';
78
+ import { createTeam, teamCreateOutputSchema, } from '../../api/teams.js';
79
+ const inputSchema = z
80
+ .object({
81
+ name: z.string().min(1, '--name must not be empty'),
82
+ /**
83
+ * Raw comma-separated user IDs (e.g. `"67890,67891"`). Split
84
+ * + brand-validated inside the action body via
85
+ * {@link parseBrandedListArg} so the per-entry parse boundary
86
+ * fires AFTER the top-level argv parse — keeps the error
87
+ * envelope's `details.issues[].path` pointing at the
88
+ * `--users` argv slot rather than a per-entry index.
89
+ */
90
+ users: z.string().min(1, '--users must not be empty').optional(),
91
+ guestTeam: z.boolean().optional(),
92
+ allowEmpty: z.boolean().optional(),
93
+ })
94
+ .strict();
95
+ export const teamCreateCommand = {
96
+ name: 'user.team-create',
97
+ summary: 'Create a new team (--name required; optional initial members + flags)',
98
+ examples: [
99
+ 'monday user team-create --name "Backend Eng"',
100
+ 'monday user team-create --name "Backend Eng" --users 67890,67891',
101
+ 'monday user team-create --name "Empty Bootstrap" --allow-empty',
102
+ 'monday user team-create --name "Vendor Access" --guest-team --users 67890',
103
+ 'monday user team-create --name "Backend Eng" --users 67890 --dry-run --json',
104
+ ],
105
+ // Re-running creates a duplicate-named team — Monday's wire
106
+ // does NOT dedupe by name. Mark non-idempotent so agents
107
+ // don't naively retry on transient failures.
108
+ idempotent: false,
109
+ inputSchema,
110
+ outputSchema: teamCreateOutputSchema,
111
+ attach: (program, ctx) => {
112
+ const noun = ensureSubcommand(program, 'user', 'User commands');
113
+ noun
114
+ .command('team-create')
115
+ .description(teamCreateCommand.summary)
116
+ .requiredOption('--name <n>', 'team name (Monday\'s `String!` — must not be empty)')
117
+ .option('--users <list>', 'Comma-separated numeric user IDs for initial team membership (maps to wire `subscriber_ids: [ID!]`).')
118
+ .option('--guest-team', 'mark the team as a guest team (maps to wire `is_guest_team: true`)')
119
+ .option('--allow-empty', 'allow team creation with no initial members (maps to wire `options.allow_empty_team: true`)')
120
+ .addHelpText('after', [
121
+ '',
122
+ 'Examples:',
123
+ ...teamCreateCommand.examples.map((e) => ` ${e}`),
124
+ '',
125
+ 'Notes:',
126
+ ' - Monday allows duplicate team names; this verb is non-idempotent.',
127
+ ' - `--dry-run` emits the planned `create_team` operation + resolved input fields (no wire call fires; `meta.source: "none"`).',
128
+ ' - `--parent <ptid>` is deferred to v0.5.x (hierarchical-team UX TBD).',
129
+ ' - No `--description` slot — Monday\'s Team object carries no description field.',
130
+ '',
131
+ ].join('\n'))
132
+ .action(async (opts) => {
133
+ const parsed = parseArgv(teamCreateCommand.inputSchema, opts);
134
+ // Parse `--users` once at the boundary so a malformed
135
+ // user ID surfaces `usage_error` ahead of any wire call.
136
+ // Empty entries (trailing comma, double comma) reject
137
+ // with a clear hint; non-numeric entries reject via the
138
+ // UserIdSchema brand. Lifted helper at R-NEW-70 (consumer
139
+ // #2 post-lift).
140
+ const userIds = parsed.users === undefined
141
+ ? undefined
142
+ : parseBrandedListArg(parsed.users, UserIdSchema, {
143
+ flagName: '--users',
144
+ entryDescription: 'numeric user ID',
145
+ hint: 'user IDs are numeric (e.g. 67890)',
146
+ emptyEntryHint: 'e.g. --users 67890,67891 — no leading, trailing, or ' +
147
+ 'duplicate commas',
148
+ });
149
+ const { client, globalFlags, apiVersion } = resolveClient(ctx, program.opts());
150
+ if (globalFlags.dryRun) {
151
+ // Minimal dry-run shape per cli-design §6.4 mutation-
152
+ // dry-run variant — argv-derived, no preflight read.
153
+ // Only supplied input slots land in the planned payload
154
+ // (mirrors the wire-side omit-vs-null discipline the live
155
+ // path uses; agents see exactly what the live mutation
156
+ // would send).
157
+ const planned = {
158
+ operation: 'create_team',
159
+ name: parsed.name,
160
+ };
161
+ if (userIds !== undefined) {
162
+ planned.subscriber_ids = [...userIds];
163
+ }
164
+ if (parsed.guestTeam !== undefined) {
165
+ planned.is_guest_team = parsed.guestTeam;
166
+ }
167
+ if (parsed.allowEmpty !== undefined) {
168
+ planned.allow_empty_team = parsed.allowEmpty;
169
+ }
170
+ emitDryRun({
171
+ ctx,
172
+ programOpts: program.opts(),
173
+ plannedChanges: [planned],
174
+ source: 'none',
175
+ cacheAgeSeconds: null,
176
+ warnings: [],
177
+ apiVersion,
178
+ });
179
+ return;
180
+ }
181
+ const result = await createTeam({
182
+ client,
183
+ name: parsed.name,
184
+ ...(userIds === undefined ? {} : { subscriberIds: userIds }),
185
+ ...(parsed.guestTeam === undefined
186
+ ? {}
187
+ : { isGuestTeam: parsed.guestTeam }),
188
+ ...(parsed.allowEmpty === undefined
189
+ ? {}
190
+ : { allowEmptyTeam: parsed.allowEmpty }),
191
+ });
192
+ emitMutation({
193
+ ctx,
194
+ data: result.team,
195
+ schema: teamCreateCommand.outputSchema,
196
+ programOpts: program.opts(),
197
+ warnings: [],
198
+ source: result.source,
199
+ cacheAgeSeconds: result.cacheAgeSeconds,
200
+ complexity: result.complexity,
201
+ apiVersion,
202
+ });
203
+ });
204
+ },
205
+ };
206
+ //# sourceMappingURL=team-create.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"team-create.js","sourceRoot":"","sources":["../../../src/commands/user/team-create.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAqEG;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,UAAU,EAAE,YAAY,EAAE,MAAM,YAAY,CAAC;AACtD,OAAO,EAAE,aAAa,EAAE,MAAM,6BAA6B,CAAC;AAC5D,OAAO,EAAE,YAAY,EAAE,MAAM,oBAAoB,CAAC;AAClD,OAAO,EAAE,mBAAmB,EAAE,MAAM,iCAAiC,CAAC;AACtE,OAAO,EACL,UAAU,EACV,sBAAsB,GAEvB,MAAM,oBAAoB,CAAC;AAE5B,MAAM,WAAW,GAAG,CAAC;KAClB,MAAM,CAAC;IACN,IAAI,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,GAAG,CAAC,CAAC,EAAE,0BAA0B,CAAC;IACnD;;;;;;;OAOG;IACH,KAAK,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,GAAG,CAAC,CAAC,EAAE,2BAA2B,CAAC,CAAC,QAAQ,EAAE;IAChE,SAAS,EAAE,CAAC,C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,MAAM,EAAE,MAAM;oBACd,eAAe,EAAE,IAAI;oBACrB,QAAQ,EAAE,EAAE;oBACZ,UAAU;iBACX,CAAC,CAAC;gBACH,OAAO;YACT,CAAC;YAED,MAAM,MAAM,GAAG,MAAM,UAAU,CAAC;gBAC9B,MAAM;gBACN,IAAI,EAAE,MAAM,CAAC,IAAI;gBACjB,GAAG,CAAC,OAAO,KAAK,SAAS,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,EAAE,aAAa,EAAE,OAAO,EAAE,CAAC;gBAC5D,GAAG,CAAC,MAAM,CAAC,SAAS,KAAK,SAAS;oBAChC,CAAC,CAAC,EAAE;oBACJ,CAAC,CAAC,EAAE,WAAW,EAAE,MAAM,CAAC,SAAS,EAAE,CAAC;gBACtC,GAAG,CAAC,MAAM,CAAC,UAAU,KAAK,SAAS;oBACjC,CAAC,CAAC,EAAE;oBACJ,CAAC,CAAC,EAAE,cAAc,EAAE,MAAM,CAAC,UAAU,EAAE,CAAC;aAC3C,CAAC,CAAC;YACH,YAAY,CAAC;gBACX,GAAG;gBACH,IAAI,EAAE,MAAM,CAAC,IAAI;gBACjB,MAAM,EAAE,iBAAiB,CAAC,YAAY;gBACtC,WAAW,EAAE,OAAO,CAAC,IAAI,EAAE;gBAC3B,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,56 @@
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 { type CommandModule } from '../types.js';
50
+ import { type TeamDeleteOutput } from '../../api/teams.js';
51
+ declare const inputSchema: z.ZodObject<{
52
+ teamId: z.core.$ZodBranded<z.ZodString, "TeamId", "out">;
53
+ }, z.core.$strict>;
54
+ export declare const teamDeleteCommand: CommandModule<z.infer<typeof inputSchema>, TeamDeleteOutput>;
55
+ export {};
56
+ //# sourceMappingURL=team-delete.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"team-delete.d.ts","sourceRoot":"","sources":["../../../src/commands/user/team-delete.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA8CG;AACH,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AACxB,OAAO,EAAoB,KAAK,aAAa,EAAE,MAAM,aAAa,CAAC;AAOnE,OAAO,EAGL,KAAK,gBAAgB,EACtB,MAAM,oBAAoB,CAAC;AAE5B,QAAA,MAAM,WAAW;;kBAA8C,CAAC;AAEhE,eAAO,MAAM,iBAAiB,EAAE,aAAa,CAC3C,CAAC,CAAC,KAAK,CAAC,OAAO,WAAW,CAAC,EAC3B,gBAAgB,CAsFjB,CAAC"}