monday-cli 0.4.0 → 0.6.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 +645 -0
- package/README.md +173 -34
- package/dist/api/column-types.d.ts +48 -17
- package/dist/api/column-types.d.ts.map +1 -1
- package/dist/api/column-types.js +25 -9
- package/dist/api/column-types.js.map +1 -1
- package/dist/api/column-values.d.ts +17 -9
- package/dist/api/column-values.d.ts.map +1 -1
- package/dist/api/column-values.js +33 -18
- 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/file-column-set.d.ts +507 -0
- package/dist/api/file-column-set.d.ts.map +1 -0
- package/dist/api/file-column-set.js +510 -0
- package/dist/api/file-column-set.js.map +1 -0
- package/dist/api/raw-write.d.ts +27 -16
- package/dist/api/raw-write.d.ts.map +1 -1
- package/dist/api/raw-write.js +40 -24
- package/dist/api/raw-write.js.map +1 -1
- package/dist/api/resolver-error-fold.d.ts +25 -0
- package/dist/api/resolver-error-fold.d.ts.map +1 -1
- package/dist/api/resolver-error-fold.js +56 -0
- package/dist/api/resolver-error-fold.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/board/column-create.d.ts +8 -3
- package/dist/commands/board/column-create.d.ts.map +1 -1
- package/dist/commands/board/column-create.js +16 -8
- package/dist/commands/board/column-create.js.map +1 -1
- 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.d.ts.map +1 -1
- package/dist/commands/item/create.js +131 -33
- package/dist/commands/item/create.js.map +1 -1
- package/dist/commands/item/set.d.ts +33 -3
- package/dist/commands/item/set.d.ts.map +1 -1
- package/dist/commands/item/set.js +193 -15
- package/dist/commands/item/set.js.map +1 -1
- package/dist/commands/item/update.d.ts +34 -3
- package/dist/commands/item/update.d.ts.map +1 -1
- package/dist/commands/item/update.js +346 -67
- package/dist/commands/item/update.js.map +1 -1
- package/dist/commands/item/upload.d.ts.map +1 -1
- package/dist/commands/item/upload.js +16 -69
- package/dist/commands/item/upload.js.map +1 -1
- 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/update/upload.d.ts.map +1 -1
- package/dist/commands/update/upload.js +9 -59
- package/dist/commands/update/upload.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/file-source.d.ts +93 -0
- package/dist/utils/file-source.d.ts.map +1 -0
- package/dist/utils/file-source.js +140 -0
- package/dist/utils/file-source.js.map +1 -0
- 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,657 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Team writer + reader surface for the v0.5-M34 `monday user
|
|
3
|
+
* team-*` verbs (`cli-design.md` §4.3 USER section + §13 v0.5
|
|
4
|
+
* entry; `v0.5-plan.md` §3 M34).
|
|
5
|
+
*
|
|
6
|
+
* **Wire surface (empirical probe 2026-05-15, API `2026-01`).** Six
|
|
7
|
+
* Monday GraphQL operations land here — two reads against
|
|
8
|
+
* `Query.teams(...)` + four writes covering the v0.5 team-CRUD
|
|
9
|
+
* frame:
|
|
10
|
+
*
|
|
11
|
+
* - **List variant** — `Query.teams { id name picture_url
|
|
12
|
+
* is_guest users { id name email } owners { id name email } }`.
|
|
13
|
+
* NO pagination at the wire (D6 closure — `Query.teams` has no
|
|
14
|
+
* `limit:` / `page:` / cursor; returns every team visible to
|
|
15
|
+
* the token in one shot). Account-size cap on team count is
|
|
16
|
+
* the only natural limit.
|
|
17
|
+
* - **Get variant** — `Query.teams(ids: [<tid>])` with the same
|
|
18
|
+
* selection set. Single-id wire shape — Monday returns
|
|
19
|
+
* `[Team]` (an array even for one id); the fetcher extracts
|
|
20
|
+
* index 0. Empty array → `not_found` with `details.team_id`
|
|
21
|
+
* (Monday's wire collapses "doesn't exist" + "exists but not
|
|
22
|
+
* visible to token" into the same shape, same convention as
|
|
23
|
+
* M32 doc-get D8 closure).
|
|
24
|
+
* - **Create variant** — `create_team(input:
|
|
25
|
+
* CreateTeamAttributesInput!, options: CreateTeamOptionsInput)
|
|
26
|
+
* → Team`. Two input objects: `input` is required (`name!`,
|
|
27
|
+
* `is_guest_team?`, `parent_team_id?`, `subscriber_ids?:
|
|
28
|
+
* [ID!]`); `options` is optional (`allow_empty_team?`). M34
|
|
29
|
+
* surfaces `--name`, `--users <id,...>`, `--guest-team`,
|
|
30
|
+
* `--allow-empty` flags; `--parent <ptid>` deferred per D3.
|
|
31
|
+
* - **Delete variant** — `delete_team(team_id: ID!) → Team`.
|
|
32
|
+
* Returns the deleted Team verbatim. Destructive gate per
|
|
33
|
+
* cli-design §3.1 (M34 verb requires `--yes`).
|
|
34
|
+
* - **Add-members variant** — `add_users_to_team(team_id: ID!,
|
|
35
|
+
* user_ids: [ID!]!) → ChangeTeamMembershipsResult { failed_
|
|
36
|
+
* users: [User!], successful_users: [User!] }`. Wire-level
|
|
37
|
+
* partial-success envelope; the action body wraps this into
|
|
38
|
+
* the §6.1 universal `data.results: [{ ok, user_id, ... }]`
|
|
39
|
+
* shape (D5 closure).
|
|
40
|
+
* - **Remove-members variant** — `remove_users_from_team(team_
|
|
41
|
+
* id: ID!, user_ids: [ID!]!) → ChangeTeamMembershipsResult`.
|
|
42
|
+
* Same envelope shape as add-members.
|
|
43
|
+
*
|
|
44
|
+
* **`Team` object — 6 fields.** Per the v0.5 kickoff probe: `id`
|
|
45
|
+
* (ID!), `name` (String!), `picture_url` (String, nullable),
|
|
46
|
+
* `is_guest` (Boolean, nullable), `users` ([User], nullable —
|
|
47
|
+
* projected to slim `{id, name, email}` per the M19 / M32 slim-
|
|
48
|
+
* User convention), `owners` ([User!]!, non-null wire-side; same
|
|
49
|
+
* slim projection). **No `description` field on the wire** — D1
|
|
50
|
+
* closure drops the speculative `--description` flag the v0.4
|
|
51
|
+
* cli-design row pencilled. **No `update_team` mutation exists**
|
|
52
|
+
* — D2 closure drops a `team-update` verb from v0.5 scope (no
|
|
53
|
+
* rename / re-describe surface on the wire).
|
|
54
|
+
*
|
|
55
|
+
* **`CreateTeamAttributesInput` — 4 input fields.** Per the
|
|
56
|
+
* round-2 probe: `name` (String!), `is_guest_team` (Boolean,
|
|
57
|
+
* nullable), `parent_team_id` (ID, nullable), `subscriber_ids`
|
|
58
|
+
* ([ID!], nullable — must not be empty unless
|
|
59
|
+
* `allow_empty_team: true` per the description). Hierarchical
|
|
60
|
+
* teams exist via `parent_team_id`; v0.5-M34 surfaces the wire
|
|
61
|
+
* slot in the docstring but does NOT ship a `--parent <ptid>`
|
|
62
|
+
* argv flag (D3 deferral — agent-UX hierarchical-team semantics
|
|
63
|
+
* unclear; flag deferred to v0.5.x if user demand surfaces).
|
|
64
|
+
*
|
|
65
|
+
* **`CreateTeamOptionsInput` — 1 input field.** `allow_empty_
|
|
66
|
+
* team` (Boolean, nullable). Maps to the M34 `--allow-empty`
|
|
67
|
+
* argv flag.
|
|
68
|
+
*
|
|
69
|
+
* **`ChangeTeamMembershipsResult` — 2 fields.** Per the round-2
|
|
70
|
+
* probe: `failed_users: [User!]` + `successful_users: [User!]`.
|
|
71
|
+
* Wire returns the User objects (not just IDs); the M34 action
|
|
72
|
+
* body projects to slim `{id, name, email}` then wraps into the
|
|
73
|
+
* §6.1 partial-success envelope per D5.
|
|
74
|
+
*
|
|
75
|
+
* **No new ERROR_CODES at M34.** Existing codes route team-verb
|
|
76
|
+
* failures: `not_found` (team-get against missing/inaccessible
|
|
77
|
+
* tid), `usage_error` (argv-parse rejections — bad TeamId, empty
|
|
78
|
+
* `--users`, etc.), `forbidden` / `unauthorized` (token lacks
|
|
79
|
+
* team-write scope), `confirmation_required` (destructive gate
|
|
80
|
+
* on team-delete missing `--yes`), `validation_failed` (Monday-
|
|
81
|
+
* side rejection, e.g. duplicate team name).
|
|
82
|
+
*
|
|
83
|
+
* **Teams are live-only at v0.5-M34.** Per cli-design §8 cache
|
|
84
|
+
* scope, teams aren't cached — the `team-list` / `team-get` paths
|
|
85
|
+
* emit `meta.source: "live"` with `cache_age_seconds: null`.
|
|
86
|
+
* Team membership churns frequently in organisations and the
|
|
87
|
+
* stale-cache risk outweighs the cache-hit value (mirrors
|
|
88
|
+
* `monday user list` cadence — no cache).
|
|
89
|
+
*
|
|
90
|
+
* **Runtime bodies landed at v0.5-M34 IMPL.** All six fetchers
|
|
91
|
+
* issue a single `client.raw` round-trip with literal-pinned
|
|
92
|
+
* operationNames (`ListTeams` / `GetTeam` / `CreateTeam` /
|
|
93
|
+
* `DeleteTeam` / `AddUsersToTeam` / `RemoveUsersFromTeam`;
|
|
94
|
+
* R-NEW-37 W2 audit-point — operationNames pinned at the
|
|
95
|
+
* fetcher boundary, NOT caller-overridable). Read responses
|
|
96
|
+
* parse via wrapping `*ResponseSchema` shapes through
|
|
97
|
+
* `unwrapOrThrow`, so payload drift surfaces `internal_error`
|
|
98
|
+
* with `details.issues`. `getTeam`'s empty-array case rewraps
|
|
99
|
+
* to `not_found` per the M32 doc-get D8 cadence (Monday's wire
|
|
100
|
+
* collapses "doesn't exist" + "not visible to token"). Wire
|
|
101
|
+
* Team objects thread through {@link projectTeam} which filters
|
|
102
|
+
* null entries out of `users` before the agent-facing
|
|
103
|
+
* {@link teamSchema} sees the value — wire-vs-output split per
|
|
104
|
+
* round-2 P2-1 + R-v0.5-NEW-4 discipline.
|
|
105
|
+
*
|
|
106
|
+
* **Out of M34 scope** (probe-surfaced + carried forward):
|
|
107
|
+
*
|
|
108
|
+
* - `assign_team_owners` / `remove_team_owners` (owner-vs-member
|
|
109
|
+
* surface) — D4 deferral; tangential to the v0.5 "team CRUD"
|
|
110
|
+
* frame; revisit at v0.5.x candidate-selection.
|
|
111
|
+
* - `add_teams_to_board` / `delete_teams_from_board` (board
|
|
112
|
+
* subscription) — D4 deferral; tangential.
|
|
113
|
+
* - `add_teams_to_workspace` / `delete_teams_from_workspace`
|
|
114
|
+
* (workspace subscription) — D4 deferral; tangential.
|
|
115
|
+
* - `--parent <ptid>` on team-create — D3 deferral.
|
|
116
|
+
* - `monday user teams <uid>` per-user team-list — wire path
|
|
117
|
+
* exists via `User.teams`; deferred to v0.5.x.
|
|
118
|
+
*/
|
|
119
|
+
import { z } from 'zod';
|
|
120
|
+
import type { MondayClient } from './client.js';
|
|
121
|
+
import type { Complexity } from '../utils/output/envelope.js';
|
|
122
|
+
/**
|
|
123
|
+
* Slim projection of Monday's `User` for the `Team.users` +
|
|
124
|
+
* `Team.owners` slots + the `ChangeTeamMembershipsResult.{failed_,
|
|
125
|
+
* successful_}users` slots. Mirrors the M19 `account_tags` + M31
|
|
126
|
+
* `Asset.uploaded_by` + M32 `Document.created_by` slim-User
|
|
127
|
+
* cadence: `{id, name, email}` is the smallest agent-useful
|
|
128
|
+
* projection (email is the canonical resolver token for team
|
|
129
|
+
* membership ops).
|
|
130
|
+
*
|
|
131
|
+
* Full-User reads still route through `monday user get <uid>`.
|
|
132
|
+
*/
|
|
133
|
+
export declare const teamUserSchema: z.ZodObject<{
|
|
134
|
+
id: z.ZodString;
|
|
135
|
+
name: z.ZodString;
|
|
136
|
+
email: z.ZodString;
|
|
137
|
+
}, z.core.$strict>;
|
|
138
|
+
export type TeamUser = z.infer<typeof teamUserSchema>;
|
|
139
|
+
/**
|
|
140
|
+
* Wire-parse Team projection — Monday's 6-field wire shape per
|
|
141
|
+
* the v0.5 kickoff probe (rounds 1 + 2; `scripts/probe/v0.5-team-
|
|
142
|
+
* mutations.ts` 2026-05-15, API `2026-01`). Fetcher-internal;
|
|
143
|
+
* NOT the agent-facing output schema (see {@link teamSchema}).
|
|
144
|
+
*
|
|
145
|
+
* Wire-side nullability per the probe:
|
|
146
|
+
*
|
|
147
|
+
* - `id: ID!` — non-null
|
|
148
|
+
* - `name: String!` — non-null
|
|
149
|
+
* - `picture_url: String` — nullable
|
|
150
|
+
* - `is_guest: Boolean` — nullable (NOT `Boolean!` despite the
|
|
151
|
+
* conceptual non-null shape; pin the wire's actual nullable
|
|
152
|
+
* surface so a `null` from a non-guest-aware org doesn't
|
|
153
|
+
* fault the schema-parse)
|
|
154
|
+
* - `users: [User]` — nullable container AND nullable entries
|
|
155
|
+
* per the wire signature (the probe-formatter renders
|
|
156
|
+
* `LIST/<wrapped>[OBJECT/User]` — no inner `NON_NULL` wrap on
|
|
157
|
+
* the entries; compare to `ChangeTeamMembershipsResult.
|
|
158
|
+
* successful_users -> LIST/<wrapped>[NON_NULL/<wrapped>]<OBJECT/
|
|
159
|
+
* User>` from the round-2 probe which DOES carry the inner
|
|
160
|
+
* non-null marker). The wire schema accepts `users: null` for
|
|
161
|
+
* the container AND `[user1, null, user2]` for sparse entries
|
|
162
|
+
* so a wire-shape variant doesn't surface as `internal_error`
|
|
163
|
+
* from the response-parse boundary (Monday surfaces null
|
|
164
|
+
* entries when a team member's User record was tombstoned
|
|
165
|
+
* post-team-creation; verify at M34 IMPL cassette).
|
|
166
|
+
* - `owners: [User!]!` — non-null wire-side per the round-1
|
|
167
|
+
* probe `NON_NULL/<wrapped>[LIST/<wrapped>]` outer wrapper.
|
|
168
|
+
* The probe-formatter truncates the inner detail beyond the
|
|
169
|
+
* LIST wrapper so the inner non-null is inferred from the
|
|
170
|
+
* description (owners is conceptually a non-empty set of
|
|
171
|
+
* User objects); if M34 IMPL cassette surfaces a null entry,
|
|
172
|
+
* widen to `z.array(teamUserSchema.nullable())` here.
|
|
173
|
+
*/
|
|
174
|
+
export declare const teamWireSchema: z.ZodObject<{
|
|
175
|
+
id: z.ZodString;
|
|
176
|
+
name: z.ZodString;
|
|
177
|
+
picture_url: z.ZodNullable<z.ZodString>;
|
|
178
|
+
is_guest: z.ZodNullable<z.ZodBoolean>;
|
|
179
|
+
users: z.ZodNullable<z.ZodArray<z.ZodNullable<z.ZodObject<{
|
|
180
|
+
id: z.ZodString;
|
|
181
|
+
name: z.ZodString;
|
|
182
|
+
email: z.ZodString;
|
|
183
|
+
}, z.core.$strict>>>>;
|
|
184
|
+
owners: z.ZodArray<z.ZodObject<{
|
|
185
|
+
id: z.ZodString;
|
|
186
|
+
name: z.ZodString;
|
|
187
|
+
email: z.ZodString;
|
|
188
|
+
}, z.core.$strict>>;
|
|
189
|
+
}, z.core.$strict>;
|
|
190
|
+
export type TeamWire = z.infer<typeof teamWireSchema>;
|
|
191
|
+
/**
|
|
192
|
+
* Agent-facing Team projection — the exported output schema
|
|
193
|
+
* reused by `teamListOutputSchema` / `teamGetOutputSchema` /
|
|
194
|
+
* `teamCreateOutputSchema` / `teamDeleteOutputSchema`. Mirrors
|
|
195
|
+
* {@link teamWireSchema}'s field shape EXCEPT for the `users`
|
|
196
|
+
* entries which are pinned non-null at this boundary.
|
|
197
|
+
*
|
|
198
|
+
* **Wire-vs-CLI projection.** M34 IMPL fetcher bodies parse the
|
|
199
|
+
* wire response via {@link teamWireSchema}, then filter null
|
|
200
|
+
* entries out of `Team.users` before constructing the
|
|
201
|
+
* `outputSchema.parse(...)` call. Agents see a clean array;
|
|
202
|
+
* `monday schema user.team-list` exports a non-null
|
|
203
|
+
* entries shape; `emitSuccess` then enforces the output schema
|
|
204
|
+
* for free at the action boundary (`outputSchema.parse(data)`
|
|
205
|
+
* would reject a leaked null otherwise — defence-in-depth
|
|
206
|
+
* against a missed projection-layer filter at IMPL).
|
|
207
|
+
*
|
|
208
|
+
* Splitting wire-parse from output-projection — the discipline
|
|
209
|
+
* Codex flagged at M34 pre-flight round-2 P2-1 — keeps the
|
|
210
|
+
* agent contract narrow while the wire-parse boundary stays
|
|
211
|
+
* permissive enough to absorb wire-shape variations. Mirrors
|
|
212
|
+
* v0.3-M22 `monday usage` cadence (loose wire schema, strict
|
|
213
|
+
* output projection) at a sub-field granularity.
|
|
214
|
+
*/
|
|
215
|
+
export declare const teamSchema: z.ZodObject<{
|
|
216
|
+
id: z.ZodString;
|
|
217
|
+
name: z.ZodString;
|
|
218
|
+
picture_url: z.ZodNullable<z.ZodString>;
|
|
219
|
+
is_guest: z.ZodNullable<z.ZodBoolean>;
|
|
220
|
+
users: z.ZodNullable<z.ZodArray<z.ZodObject<{
|
|
221
|
+
id: z.ZodString;
|
|
222
|
+
name: z.ZodString;
|
|
223
|
+
email: z.ZodString;
|
|
224
|
+
}, z.core.$strict>>>;
|
|
225
|
+
owners: z.ZodArray<z.ZodObject<{
|
|
226
|
+
id: z.ZodString;
|
|
227
|
+
name: z.ZodString;
|
|
228
|
+
email: z.ZodString;
|
|
229
|
+
}, z.core.$strict>>;
|
|
230
|
+
}, z.core.$strict>;
|
|
231
|
+
export type Team = z.infer<typeof teamSchema>;
|
|
232
|
+
/**
|
|
233
|
+
* Output shape for `monday user team-list`. Wrapped record (NOT
|
|
234
|
+
* bare array) so the envelope leaves headroom for a future
|
|
235
|
+
* `meta.team_count` or per-team-state aggregate without breaking
|
|
236
|
+
* the agent contract — mirrors M22 `monday usage` + M32 `doc
|
|
237
|
+
* list` wrapped-record convention.
|
|
238
|
+
*
|
|
239
|
+
* Monday's `Query.teams` exposes no pagination slot (D6); the
|
|
240
|
+
* shape pins a flat `teams: [Team]` array with no `has_more` /
|
|
241
|
+
* cursor / page slot. Agents fetch the entire visible-team set
|
|
242
|
+
* in one call.
|
|
243
|
+
*/
|
|
244
|
+
export declare const teamListOutputSchema: z.ZodObject<{
|
|
245
|
+
teams: z.ZodArray<z.ZodObject<{
|
|
246
|
+
id: z.ZodString;
|
|
247
|
+
name: z.ZodString;
|
|
248
|
+
picture_url: z.ZodNullable<z.ZodString>;
|
|
249
|
+
is_guest: z.ZodNullable<z.ZodBoolean>;
|
|
250
|
+
users: z.ZodNullable<z.ZodArray<z.ZodObject<{
|
|
251
|
+
id: z.ZodString;
|
|
252
|
+
name: z.ZodString;
|
|
253
|
+
email: z.ZodString;
|
|
254
|
+
}, z.core.$strict>>>;
|
|
255
|
+
owners: z.ZodArray<z.ZodObject<{
|
|
256
|
+
id: z.ZodString;
|
|
257
|
+
name: z.ZodString;
|
|
258
|
+
email: z.ZodString;
|
|
259
|
+
}, z.core.$strict>>;
|
|
260
|
+
}, z.core.$strict>>;
|
|
261
|
+
returned_count: z.ZodNumber;
|
|
262
|
+
}, z.core.$strict>;
|
|
263
|
+
export type TeamListOutput = z.infer<typeof teamListOutputSchema>;
|
|
264
|
+
/**
|
|
265
|
+
* Output shape for `monday user team-get <tid>`. Direct unwrap
|
|
266
|
+
* of the single Team — mirrors the read-one-verb convention
|
|
267
|
+
* (`monday user get <uid>` returns `data: <User>`).
|
|
268
|
+
*/
|
|
269
|
+
export declare const teamGetOutputSchema: z.ZodObject<{
|
|
270
|
+
id: z.ZodString;
|
|
271
|
+
name: z.ZodString;
|
|
272
|
+
picture_url: z.ZodNullable<z.ZodString>;
|
|
273
|
+
is_guest: z.ZodNullable<z.ZodBoolean>;
|
|
274
|
+
users: z.ZodNullable<z.ZodArray<z.ZodObject<{
|
|
275
|
+
id: z.ZodString;
|
|
276
|
+
name: z.ZodString;
|
|
277
|
+
email: z.ZodString;
|
|
278
|
+
}, z.core.$strict>>>;
|
|
279
|
+
owners: z.ZodArray<z.ZodObject<{
|
|
280
|
+
id: z.ZodString;
|
|
281
|
+
name: z.ZodString;
|
|
282
|
+
email: z.ZodString;
|
|
283
|
+
}, z.core.$strict>>;
|
|
284
|
+
}, z.core.$strict>;
|
|
285
|
+
export type TeamGetOutput = Team;
|
|
286
|
+
/**
|
|
287
|
+
* Output shape for `monday user team-create`. Direct unwrap of
|
|
288
|
+
* the created Team — Monday returns the full `Team` object
|
|
289
|
+
* post-create with `id` populated + any `subscriber_ids` already
|
|
290
|
+
* hydrated into the `users` slot.
|
|
291
|
+
*/
|
|
292
|
+
export declare const teamCreateOutputSchema: z.ZodObject<{
|
|
293
|
+
id: z.ZodString;
|
|
294
|
+
name: z.ZodString;
|
|
295
|
+
picture_url: z.ZodNullable<z.ZodString>;
|
|
296
|
+
is_guest: z.ZodNullable<z.ZodBoolean>;
|
|
297
|
+
users: z.ZodNullable<z.ZodArray<z.ZodObject<{
|
|
298
|
+
id: z.ZodString;
|
|
299
|
+
name: z.ZodString;
|
|
300
|
+
email: z.ZodString;
|
|
301
|
+
}, z.core.$strict>>>;
|
|
302
|
+
owners: z.ZodArray<z.ZodObject<{
|
|
303
|
+
id: z.ZodString;
|
|
304
|
+
name: z.ZodString;
|
|
305
|
+
email: z.ZodString;
|
|
306
|
+
}, z.core.$strict>>;
|
|
307
|
+
}, z.core.$strict>;
|
|
308
|
+
export type TeamCreateOutput = Team;
|
|
309
|
+
/**
|
|
310
|
+
* Output shape for `monday user team-delete`. Direct unwrap of
|
|
311
|
+
* the deleted Team — mirrors the M14 `workspace delete` cadence.
|
|
312
|
+
* Monday returns the deleted team verbatim so agents see the
|
|
313
|
+
* final state (name + member list) at the moment of deletion.
|
|
314
|
+
*/
|
|
315
|
+
export declare const teamDeleteOutputSchema: z.ZodObject<{
|
|
316
|
+
id: z.ZodString;
|
|
317
|
+
name: z.ZodString;
|
|
318
|
+
picture_url: z.ZodNullable<z.ZodString>;
|
|
319
|
+
is_guest: z.ZodNullable<z.ZodBoolean>;
|
|
320
|
+
users: z.ZodNullable<z.ZodArray<z.ZodObject<{
|
|
321
|
+
id: z.ZodString;
|
|
322
|
+
name: z.ZodString;
|
|
323
|
+
email: z.ZodString;
|
|
324
|
+
}, z.core.$strict>>>;
|
|
325
|
+
owners: z.ZodArray<z.ZodObject<{
|
|
326
|
+
id: z.ZodString;
|
|
327
|
+
name: z.ZodString;
|
|
328
|
+
email: z.ZodString;
|
|
329
|
+
}, z.core.$strict>>;
|
|
330
|
+
}, z.core.$strict>;
|
|
331
|
+
export type TeamDeleteOutput = Team;
|
|
332
|
+
/**
|
|
333
|
+
* Per-target result record for the `team-add-members` /
|
|
334
|
+
* `team-remove-members` partial-success envelope (cli-design
|
|
335
|
+
* §6.1 universal partial-success shape; D5 closure). Mirrors
|
|
336
|
+
* the v0.2-M14 `workspace add-users` / M15 `board add-users`
|
|
337
|
+
* shape verbatim — `user_id` is the input numeric ID (echoed
|
|
338
|
+
* for correlation against the `--users <id,...>` argv slot),
|
|
339
|
+
* `ok` is the per-user success bit, `error` carries an optional
|
|
340
|
+
* `{code, message}` reason when the wire reported a failed-
|
|
341
|
+
* user entry.
|
|
342
|
+
*
|
|
343
|
+
* **Wire-vs-CLI semantics asymmetry note.** Monday's
|
|
344
|
+
* `ChangeTeamMembershipsResult` returns `failed_users: [User]`
|
|
345
|
+
* — a list of User objects, NOT a list of `{user_id, error_
|
|
346
|
+
* code, error_message}` triples. The CLI projects the wire
|
|
347
|
+
* shape into the universal envelope at the action body: every
|
|
348
|
+
* `successful_users[]` entry surfaces as `{ok: true, user_id,
|
|
349
|
+
* user: {...}}`; every `failed_users[]` entry surfaces as
|
|
350
|
+
* `{ok: false, user_id, error: {code: 'membership_failed',
|
|
351
|
+
* message: <wire-supplied or generic>}}`. The wire's
|
|
352
|
+
* `failed_users[]` carries the User object but NO per-user
|
|
353
|
+
* reason — the CLI emits a generic `membership_failed` message
|
|
354
|
+
* (verify at IMPL cassette whether Monday surfaces a reason
|
|
355
|
+
* elsewhere in the response or via the `errors[]` extension).
|
|
356
|
+
*
|
|
357
|
+
* **Wire-vs-CLI semantics convention.** This asymmetry extends
|
|
358
|
+
* `docs/architecture.md`'s "Wire-vs-CLI semantics documentation
|
|
359
|
+
* conventions" section (R-NEW-41 4th consumer trigger — see
|
|
360
|
+
* also v0.5-plan §22 R-v0.5-NEW-3). Per-verb docstrings at
|
|
361
|
+
* `src/commands/user/team-add-members.ts` +
|
|
362
|
+
* `src/commands/user/team-remove-members.ts` cross-link this
|
|
363
|
+
* note + the architecture section for the canonical convention.
|
|
364
|
+
*/
|
|
365
|
+
export declare const teamMembershipResultSchema: z.ZodObject<{
|
|
366
|
+
user_id: z.ZodString;
|
|
367
|
+
ok: z.ZodBoolean;
|
|
368
|
+
user: z.ZodOptional<z.ZodObject<{
|
|
369
|
+
id: z.ZodString;
|
|
370
|
+
name: z.ZodString;
|
|
371
|
+
email: z.ZodString;
|
|
372
|
+
}, z.core.$strict>>;
|
|
373
|
+
error: z.ZodOptional<z.ZodObject<{
|
|
374
|
+
code: z.ZodString;
|
|
375
|
+
message: z.ZodString;
|
|
376
|
+
}, z.core.$strict>>;
|
|
377
|
+
}, z.core.$strict>;
|
|
378
|
+
export type TeamMembershipResult = z.infer<typeof teamMembershipResultSchema>;
|
|
379
|
+
/**
|
|
380
|
+
* Output shape for `monday user team-add-members <tid> --users
|
|
381
|
+
* <id,...>`. Universal partial-success envelope per cli-design
|
|
382
|
+
* §6.1 — `operation: 'add_users_to_team'`, `team_id` echoed
|
|
383
|
+
* input, `results: [{user_id, ok, ...}]` one record per input
|
|
384
|
+
* user (whether resolved as `ok: true` post-wire-success or
|
|
385
|
+
* `ok: false` if Monday's `failed_users[]` includes the user).
|
|
386
|
+
*/
|
|
387
|
+
export declare const teamAddMembersOutputSchema: z.ZodObject<{
|
|
388
|
+
operation: z.ZodLiteral<"add_users_to_team">;
|
|
389
|
+
team_id: z.ZodString;
|
|
390
|
+
results: z.ZodArray<z.ZodObject<{
|
|
391
|
+
user_id: z.ZodString;
|
|
392
|
+
ok: z.ZodBoolean;
|
|
393
|
+
user: z.ZodOptional<z.ZodObject<{
|
|
394
|
+
id: z.ZodString;
|
|
395
|
+
name: z.ZodString;
|
|
396
|
+
email: z.ZodString;
|
|
397
|
+
}, z.core.$strict>>;
|
|
398
|
+
error: z.ZodOptional<z.ZodObject<{
|
|
399
|
+
code: z.ZodString;
|
|
400
|
+
message: z.ZodString;
|
|
401
|
+
}, z.core.$strict>>;
|
|
402
|
+
}, z.core.$strict>>;
|
|
403
|
+
}, z.core.$strict>;
|
|
404
|
+
export type TeamAddMembersOutput = z.infer<typeof teamAddMembersOutputSchema>;
|
|
405
|
+
/**
|
|
406
|
+
* Output shape for `monday user team-remove-members <tid> --users
|
|
407
|
+
* <id,...>`. Same envelope shape as
|
|
408
|
+
* {@link teamAddMembersOutputSchema} but with `operation:
|
|
409
|
+
* 'remove_users_from_team'` so agents that key off the operation
|
|
410
|
+
* literal can dispatch the right post-mutation recovery flow.
|
|
411
|
+
*/
|
|
412
|
+
export declare const teamRemoveMembersOutputSchema: z.ZodObject<{
|
|
413
|
+
operation: z.ZodLiteral<"remove_users_from_team">;
|
|
414
|
+
team_id: z.ZodString;
|
|
415
|
+
results: z.ZodArray<z.ZodObject<{
|
|
416
|
+
user_id: z.ZodString;
|
|
417
|
+
ok: z.ZodBoolean;
|
|
418
|
+
user: z.ZodOptional<z.ZodObject<{
|
|
419
|
+
id: z.ZodString;
|
|
420
|
+
name: z.ZodString;
|
|
421
|
+
email: z.ZodString;
|
|
422
|
+
}, z.core.$strict>>;
|
|
423
|
+
error: z.ZodOptional<z.ZodObject<{
|
|
424
|
+
code: z.ZodString;
|
|
425
|
+
message: z.ZodString;
|
|
426
|
+
}, z.core.$strict>>;
|
|
427
|
+
}, z.core.$strict>>;
|
|
428
|
+
}, z.core.$strict>;
|
|
429
|
+
export type TeamRemoveMembersOutput = z.infer<typeof teamRemoveMembersOutputSchema>;
|
|
430
|
+
/**
|
|
431
|
+
* GraphQL query document for `Query.teams` listing variant.
|
|
432
|
+
* Operation name pinned literally to `ListTeams` and matches the
|
|
433
|
+
* wire `operationName` payload (R-NEW-37 W2 audit-point —
|
|
434
|
+
* caller-overridable operationName slots were closed at M27 IMPL
|
|
435
|
+
* round-1 P2-1; M34 maintains the safely-by-construction shape).
|
|
436
|
+
*
|
|
437
|
+
* No variables — Monday's `Query.teams` exposes only the `ids:`
|
|
438
|
+
* filter (which the list verb omits) + no pagination slots
|
|
439
|
+
* (D6 closure). The query returns every team visible to the
|
|
440
|
+
* token.
|
|
441
|
+
*/
|
|
442
|
+
export declare const LIST_TEAMS_QUERY = "\n query ListTeams {\n teams {\n \n id\n name\n picture_url\n is_guest\n users { id name email }\n owners { id name email }\n\n }\n }\n";
|
|
443
|
+
/**
|
|
444
|
+
* GraphQL query document for `Query.teams(ids:)` single-id read
|
|
445
|
+
* variant. Operation name pinned to `GetTeam` (R-NEW-37 W2).
|
|
446
|
+
*
|
|
447
|
+
* Single-id wire shape — Monday returns `[Team]` (an array even
|
|
448
|
+
* for one id); the fetcher extracts index 0. An empty array
|
|
449
|
+
* surfaces `not_found` with `details.team_id` (Monday's wire
|
|
450
|
+
* collapses "doesn't exist" + "not visible to token" into the
|
|
451
|
+
* same shape per D8-equivalent — mirrors M32 doc-get).
|
|
452
|
+
*/
|
|
453
|
+
export declare const GET_TEAM_QUERY = "\n query GetTeam($ids: [ID!]!) {\n teams(ids: $ids) {\n \n id\n name\n picture_url\n is_guest\n users { id name email }\n owners { id name email }\n\n }\n }\n";
|
|
454
|
+
/**
|
|
455
|
+
* GraphQL mutation document for `create_team(input, options)`.
|
|
456
|
+
* Operation name pinned to `CreateTeam` (R-NEW-37 W2). The
|
|
457
|
+
* `options:` arg is optional on the wire; the fetcher omits the
|
|
458
|
+
* variable entirely when callers don't supply `allowEmptyTeam`
|
|
459
|
+
* (rather than threading an explicit `null` which Monday treats
|
|
460
|
+
* as "field present").
|
|
461
|
+
*/
|
|
462
|
+
export declare const CREATE_TEAM_MUTATION = "\n mutation CreateTeam(\n $input: CreateTeamAttributesInput!,\n $options: CreateTeamOptionsInput\n ) {\n create_team(input: $input, options: $options) {\n \n id\n name\n picture_url\n is_guest\n users { id name email }\n owners { id name email }\n\n }\n }\n";
|
|
463
|
+
/**
|
|
464
|
+
* GraphQL mutation document for `delete_team(team_id)`. Operation
|
|
465
|
+
* name pinned to `DeleteTeam` (R-NEW-37 W2). Returns the deleted
|
|
466
|
+
* `Team` so agents see the final state at the moment of
|
|
467
|
+
* deletion.
|
|
468
|
+
*/
|
|
469
|
+
export declare const DELETE_TEAM_MUTATION = "\n mutation DeleteTeam($teamId: ID!) {\n delete_team(team_id: $teamId) {\n \n id\n name\n picture_url\n is_guest\n users { id name email }\n owners { id name email }\n\n }\n }\n";
|
|
470
|
+
/**
|
|
471
|
+
* GraphQL mutation document for `add_users_to_team(team_id,
|
|
472
|
+
* user_ids)`. Operation name pinned to `AddUsersToTeam` (R-NEW-37
|
|
473
|
+
* W2). Returns a `ChangeTeamMembershipsResult` with two User
|
|
474
|
+
* lists — `failed_users` + `successful_users`. The CLI projects
|
|
475
|
+
* the wire shape to the universal §6.1 partial-success envelope
|
|
476
|
+
* at the action body per D5.
|
|
477
|
+
*/
|
|
478
|
+
export declare const ADD_USERS_TO_TEAM_MUTATION = "\n mutation AddUsersToTeam($teamId: ID!, $userIds: [ID!]!) {\n add_users_to_team(team_id: $teamId, user_ids: $userIds) {\n failed_users { id name email }\n successful_users { id name email }\n }\n }\n";
|
|
479
|
+
/**
|
|
480
|
+
* GraphQL mutation document for `remove_users_from_team(team_id,
|
|
481
|
+
* user_ids)`. Operation name pinned to `RemoveUsersFromTeam`
|
|
482
|
+
* (R-NEW-37 W2). Same `ChangeTeamMembershipsResult` return shape
|
|
483
|
+
* as add-members; the action body wraps into the universal
|
|
484
|
+
* partial-success envelope with `operation:
|
|
485
|
+
* 'remove_users_from_team'`.
|
|
486
|
+
*/
|
|
487
|
+
export declare const REMOVE_USERS_FROM_TEAM_MUTATION = "\n mutation RemoveUsersFromTeam($teamId: ID!, $userIds: [ID!]!) {\n remove_users_from_team(team_id: $teamId, user_ids: $userIds) {\n failed_users { id name email }\n successful_users { id name email }\n }\n }\n";
|
|
488
|
+
export interface ListTeamsInputs {
|
|
489
|
+
readonly client: MondayClient;
|
|
490
|
+
}
|
|
491
|
+
export interface ListTeamsResult {
|
|
492
|
+
readonly teams: readonly Team[];
|
|
493
|
+
readonly source: 'live';
|
|
494
|
+
readonly cacheAgeSeconds: null;
|
|
495
|
+
readonly complexity: Complexity | null;
|
|
496
|
+
}
|
|
497
|
+
/**
|
|
498
|
+
* Fetches every team visible to the token via a single
|
|
499
|
+
* `Query.teams` round-trip with `operationName: 'ListTeams'`
|
|
500
|
+
* (R-NEW-37 W2). Source is always `'live'` per cli-design §8
|
|
501
|
+
* cache scope; teams aren't cached at v0.5.
|
|
502
|
+
*
|
|
503
|
+
* A null `teams` root surfaces `internal_error` with a drift
|
|
504
|
+
* hint — Monday's documented shape is `[Team]` (an array,
|
|
505
|
+
* possibly empty), never null at this layer. Each wire team
|
|
506
|
+
* threads through {@link projectTeam} so the agent-facing
|
|
507
|
+
* {@link teamSchema} sees a clean (non-nullable-entries) `users`
|
|
508
|
+
* array.
|
|
509
|
+
*/
|
|
510
|
+
export declare const listTeams: (inputs: ListTeamsInputs) => Promise<ListTeamsResult>;
|
|
511
|
+
export interface GetTeamInputs {
|
|
512
|
+
readonly client: MondayClient;
|
|
513
|
+
readonly teamId: string;
|
|
514
|
+
}
|
|
515
|
+
export interface GetTeamResult {
|
|
516
|
+
readonly team: Team;
|
|
517
|
+
readonly source: 'live';
|
|
518
|
+
readonly cacheAgeSeconds: null;
|
|
519
|
+
readonly complexity: Complexity | null;
|
|
520
|
+
}
|
|
521
|
+
/**
|
|
522
|
+
* Fetches a single team by ID via a single `Query.teams(ids:)`
|
|
523
|
+
* round-trip with `operationName: 'GetTeam'` (R-NEW-37 W2).
|
|
524
|
+
*
|
|
525
|
+
* Empty wire response (Monday's shape for "team doesn't exist"
|
|
526
|
+
* OR "team not visible to token") surfaces `not_found` with
|
|
527
|
+
* `details.team_id` — same wire-shape collapse as M32 doc-get.
|
|
528
|
+
* A null `teams` root surfaces `internal_error` with a drift
|
|
529
|
+
* hint (distinct from the empty-array case); a multi-element
|
|
530
|
+
* response surfaces `internal_error` defensively (a single-id
|
|
531
|
+
* query shouldn't return more than one team).
|
|
532
|
+
*/
|
|
533
|
+
export declare const getTeam: (inputs: GetTeamInputs) => Promise<GetTeamResult>;
|
|
534
|
+
export interface CreateTeamInputs {
|
|
535
|
+
readonly client: MondayClient;
|
|
536
|
+
readonly name: string;
|
|
537
|
+
readonly subscriberIds?: readonly string[];
|
|
538
|
+
readonly isGuestTeam?: boolean;
|
|
539
|
+
readonly allowEmptyTeam?: boolean;
|
|
540
|
+
}
|
|
541
|
+
export interface CreateTeamResult {
|
|
542
|
+
readonly team: Team;
|
|
543
|
+
readonly source: 'live';
|
|
544
|
+
readonly cacheAgeSeconds: null;
|
|
545
|
+
readonly complexity: Complexity | null;
|
|
546
|
+
}
|
|
547
|
+
/**
|
|
548
|
+
* Creates a new team via `create_team(input, options)` with
|
|
549
|
+
* `operationName: 'CreateTeam'` (R-NEW-37 W2). Returns the
|
|
550
|
+
* created `Team` with `id` populated post-create + any
|
|
551
|
+
* `subscriberIds` hydrated into the `users` slot.
|
|
552
|
+
*
|
|
553
|
+
* The fetcher composes `input` from `name` + `subscriberIds` +
|
|
554
|
+
* `isGuestTeam` and omits the `options` variable entirely when
|
|
555
|
+
* `allowEmptyTeam` is unset (Monday's wire `options:` arg is
|
|
556
|
+
* optional and a `null` value would be treated as "field
|
|
557
|
+
* present" rather than "field omitted"). The same omit-vs-null
|
|
558
|
+
* discipline applies to each nullable `input.*` slot — only
|
|
559
|
+
* supplied fields land in the wire payload.
|
|
560
|
+
*
|
|
561
|
+
* A missing-key wire response surfaces `internal_error` via
|
|
562
|
+
* `assertResponseFieldPresent` (R42 helper); a null payload
|
|
563
|
+
* surfaces `internal_error` too — a successful `create_team`
|
|
564
|
+
* mutation must return the created Team (a non-existent team
|
|
565
|
+
* after a 200 response indicates a Monday-side regression).
|
|
566
|
+
*/
|
|
567
|
+
export declare const createTeam: (inputs: CreateTeamInputs) => Promise<CreateTeamResult>;
|
|
568
|
+
export interface DeleteTeamInputs {
|
|
569
|
+
readonly client: MondayClient;
|
|
570
|
+
readonly teamId: string;
|
|
571
|
+
}
|
|
572
|
+
export interface DeleteTeamResult {
|
|
573
|
+
readonly team: Team;
|
|
574
|
+
readonly source: 'live';
|
|
575
|
+
readonly cacheAgeSeconds: null;
|
|
576
|
+
readonly complexity: Complexity | null;
|
|
577
|
+
}
|
|
578
|
+
/**
|
|
579
|
+
* Deletes a team by ID via `delete_team(team_id)` with
|
|
580
|
+
* `operationName: 'DeleteTeam'` (R-NEW-37 W2). Returns the
|
|
581
|
+
* deleted Team verbatim.
|
|
582
|
+
*
|
|
583
|
+
* A null `delete_team` payload surfaces `not_found` —
|
|
584
|
+
* mirrors the M14 `workspace delete` cadence (id was bogus
|
|
585
|
+
* OR team already deleted by a concurrent caller). A missing
|
|
586
|
+
* `delete_team` key surfaces `internal_error` per the R42
|
|
587
|
+
* helper's "key absent" branch (schema drift).
|
|
588
|
+
*
|
|
589
|
+
* **Destructive-gate ordering.** The verb's action body MUST
|
|
590
|
+
* call `enforceDestructiveGate` BEFORE this fetcher per the
|
|
591
|
+
* M10 round-1 P2 invariant. A missing `--yes` surfaces as
|
|
592
|
+
* `confirmation_required` from the action layer, never
|
|
593
|
+
* masked by `config_error` when no token is configured.
|
|
594
|
+
*/
|
|
595
|
+
export declare const deleteTeam: (inputs: DeleteTeamInputs) => Promise<DeleteTeamResult>;
|
|
596
|
+
export interface AddUsersToTeamInputs {
|
|
597
|
+
readonly client: MondayClient;
|
|
598
|
+
readonly teamId: string;
|
|
599
|
+
readonly userIds: readonly string[];
|
|
600
|
+
}
|
|
601
|
+
export interface AddUsersToTeamResult {
|
|
602
|
+
readonly failedUsers: readonly TeamUser[];
|
|
603
|
+
readonly successfulUsers: readonly TeamUser[];
|
|
604
|
+
readonly source: 'live';
|
|
605
|
+
readonly cacheAgeSeconds: null;
|
|
606
|
+
readonly complexity: Complexity | null;
|
|
607
|
+
}
|
|
608
|
+
/**
|
|
609
|
+
* Adds a list of users to a team via `add_users_to_team(team_id,
|
|
610
|
+
* user_ids)` with `operationName: 'AddUsersToTeam'` (R-NEW-37
|
|
611
|
+
* W2). Returns Monday's `ChangeTeamMembershipsResult` split into
|
|
612
|
+
* `failedUsers` + `successfulUsers` — the action body wraps
|
|
613
|
+
* this into the §6.1 universal partial-success envelope at the
|
|
614
|
+
* verb boundary (D5 closure).
|
|
615
|
+
*
|
|
616
|
+
* **Wire returns User objects, not error reasons.** Monday's
|
|
617
|
+
* `failed_users[]` carries the User who failed but NO per-user
|
|
618
|
+
* reason on the wire today. The CLI action body emits a generic
|
|
619
|
+
* `membership_failed` error code per failed user. The IMPL
|
|
620
|
+
* cassette suite covers the single-shot non-partial happy case
|
|
621
|
+
* + the partial-success failed/successful split; no per-user
|
|
622
|
+
* reason key surfaced on Monday's wire today (verified via
|
|
623
|
+
* round-2 probe introspection of `ChangeTeamMembershipsResult`
|
|
624
|
+
* — 2 fields only, no reason / error / message slot).
|
|
625
|
+
*
|
|
626
|
+
* A null `add_users_to_team` payload surfaces `internal_error`
|
|
627
|
+
* — the wire returns the result envelope even when every
|
|
628
|
+
* supplied user fails (failures go into `failed_users[]`, not
|
|
629
|
+
* the root). A null root indicates a wire-shape regression.
|
|
630
|
+
*/
|
|
631
|
+
export declare const addUsersToTeam: (inputs: AddUsersToTeamInputs) => Promise<AddUsersToTeamResult>;
|
|
632
|
+
export interface RemoveUsersFromTeamInputs {
|
|
633
|
+
readonly client: MondayClient;
|
|
634
|
+
readonly teamId: string;
|
|
635
|
+
readonly userIds: readonly string[];
|
|
636
|
+
}
|
|
637
|
+
export interface RemoveUsersFromTeamResult {
|
|
638
|
+
readonly failedUsers: readonly TeamUser[];
|
|
639
|
+
readonly successfulUsers: readonly TeamUser[];
|
|
640
|
+
readonly source: 'live';
|
|
641
|
+
readonly cacheAgeSeconds: null;
|
|
642
|
+
readonly complexity: Complexity | null;
|
|
643
|
+
}
|
|
644
|
+
/**
|
|
645
|
+
* Removes a list of users from a team via
|
|
646
|
+
* `remove_users_from_team(team_id, user_ids)` with
|
|
647
|
+
* `operationName: 'RemoveUsersFromTeam'` (R-NEW-37 W2). Same
|
|
648
|
+
* `ChangeTeamMembershipsResult` return shape as
|
|
649
|
+
* {@link addUsersToTeam}; the action body wraps into the
|
|
650
|
+
* universal partial-success envelope with `operation:
|
|
651
|
+
* 'remove_users_from_team'`.
|
|
652
|
+
*
|
|
653
|
+
* Same null-root → `internal_error` contract as
|
|
654
|
+
* {@link addUsersToTeam}.
|
|
655
|
+
*/
|
|
656
|
+
export declare const removeUsersFromTeam: (inputs: RemoveUsersFromTeamInputs) => Promise<RemoveUsersFromTeamResult>;
|
|
657
|
+
//# sourceMappingURL=teams.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"teams.d.ts","sourceRoot":"","sources":["../../src/api/teams.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAqHG;AAEH,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAIxB,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,aAAa,CAAC;AAChD,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,6BAA6B,CAAC;AAE9D;;;;;;;;;;GAUG;AACH,eAAO,MAAM,cAAc;;;;kBAMhB,CAAC;AAEZ,MAAM,MAAM,QAAQ,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,cAAc,CAAC,CAAC;AAEtD;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAkCG;AACH,eAAO,MAAM,cAAc;;;;;;;;;;;;;;;kBAShB,CAAC;AAEZ,MAAM,MAAM,QAAQ,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,cAAc,CAAC,CAAC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