monday-cli 0.3.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 +719 -0
- package/README.md +208 -36
- package/dist/api/assets.d.ts +326 -0
- package/dist/api/assets.d.ts.map +1 -0
- package/dist/api/assets.js +519 -0
- package/dist/api/assets.js.map +1 -0
- package/dist/api/column-types.d.ts +13 -7
- package/dist/api/column-types.d.ts.map +1 -1
- package/dist/api/column-types.js +7 -3
- package/dist/api/column-types.js.map +1 -1
- package/dist/api/column-values.d.ts +8 -1
- package/dist/api/column-values.d.ts.map +1 -1
- package/dist/api/column-values.js +16 -6
- package/dist/api/column-values.js.map +1 -1
- package/dist/api/documents.d.ts +1652 -0
- package/dist/api/documents.d.ts.map +1 -0
- package/dist/api/documents.js +2411 -0
- package/dist/api/documents.js.map +1 -0
- package/dist/api/item-watch.d.ts +263 -0
- package/dist/api/item-watch.d.ts.map +1 -0
- package/dist/api/item-watch.js +709 -0
- package/dist/api/item-watch.js.map +1 -0
- package/dist/api/multipart-transport.d.ts +223 -0
- package/dist/api/multipart-transport.d.ts.map +1 -0
- package/dist/api/multipart-transport.js +274 -0
- package/dist/api/multipart-transport.js.map +1 -0
- package/dist/api/parallel-dispatch.d.ts +155 -0
- package/dist/api/parallel-dispatch.d.ts.map +1 -0
- package/dist/api/parallel-dispatch.js +243 -0
- package/dist/api/parallel-dispatch.js.map +1 -0
- package/dist/api/partial-success-bulk.d.ts +118 -60
- package/dist/api/partial-success-bulk.d.ts.map +1 -1
- package/dist/api/partial-success-bulk.js +137 -79
- package/dist/api/partial-success-bulk.js.map +1 -1
- package/dist/api/partial-success-mutation.d.ts +13 -1
- package/dist/api/partial-success-mutation.d.ts.map +1 -1
- package/dist/api/partial-success-mutation.js +5 -1
- package/dist/api/partial-success-mutation.js.map +1 -1
- package/dist/api/raw-write.d.ts +13 -4
- package/dist/api/raw-write.d.ts.map +1 -1
- package/dist/api/raw-write.js +22 -11
- package/dist/api/raw-write.js.map +1 -1
- package/dist/api/resolve-client.d.ts +11 -0
- package/dist/api/resolve-client.d.ts.map +1 -1
- package/dist/api/resolve-client.js +9 -1
- package/dist/api/resolve-client.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/cli/run.d.ts +20 -0
- package/dist/cli/run.d.ts.map +1 -1
- package/dist/cli/run.js +1 -0
- package/dist/cli/run.js.map +1 -1
- package/dist/commands/board/column-create.d.ts +6 -5
- package/dist/commands/board/column-create.d.ts.map +1 -1
- package/dist/commands/board/column-create.js +9 -6
- package/dist/commands/board/column-create.js.map +1 -1
- package/dist/commands/completion.d.ts +188 -0
- package/dist/commands/completion.d.ts.map +1 -0
- package/dist/commands/completion.js +418 -0
- package/dist/commands/completion.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/get.d.ts +46 -0
- package/dist/commands/doc/get.d.ts.map +1 -0
- package/dist/commands/doc/get.js +95 -0
- package/dist/commands/doc/get.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 +86 -0
- package/dist/commands/doc/list.d.ts.map +1 -0
- package/dist/commands/doc/list.js +217 -0
- package/dist/commands/doc/list.js.map +1 -0
- 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 +162 -0
- package/dist/commands/index.js.map +1 -1
- package/dist/commands/item/create.js +2 -2
- package/dist/commands/item/update.d.ts +1 -0
- package/dist/commands/item/update.d.ts.map +1 -1
- package/dist/commands/item/update.js +61 -0
- package/dist/commands/item/update.js.map +1 -1
- package/dist/commands/item/upload.d.ts +108 -0
- package/dist/commands/item/upload.d.ts.map +1 -0
- package/dist/commands/item/upload.js +370 -0
- package/dist/commands/item/upload.js.map +1 -0
- package/dist/commands/item/watch.d.ts +90 -0
- package/dist/commands/item/watch.d.ts.map +1 -0
- package/dist/commands/item/watch.js +342 -0
- package/dist/commands/item/watch.js.map +1 -0
- 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 +69 -0
- package/dist/commands/update/upload.d.ts.map +1 -0
- package/dist/commands/update/upload.js +235 -0
- package/dist/commands/update/upload.js.map +1 -0
- 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 +8 -0
- package/dist/types/ids.d.ts.map +1 -1
- package/dist/types/ids.js +53 -5
- package/dist/types/ids.js.map +1 -1
- package/dist/utils/mime.d.ts +24 -0
- package/dist/utils/mime.d.ts.map +1 -0
- package/dist/utils/mime.js +64 -0
- package/dist/utils/mime.js.map +1 -0
- package/dist/utils/output/envelope.d.ts +30 -0
- package/dist/utils/output/envelope.d.ts.map +1 -1
- package/dist/utils/output/envelope.js +26 -0
- package/dist/utils/output/envelope.js.map +1 -1
- package/dist/utils/output/ndjson.d.ts +25 -0
- package/dist/utils/output/ndjson.d.ts.map +1 -1
- package/dist/utils/output/ndjson.js +12 -0
- package/dist/utils/output/ndjson.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/signal.d.ts +42 -0
- package/dist/utils/signal.d.ts.map +1 -0
- package/dist/utils/signal.js +45 -0
- package/dist/utils/signal.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
package/README.md
CHANGED
|
@@ -49,41 +49,91 @@ Requires **Node.js ≥ 22**.
|
|
|
49
49
|
# Get one at https://<your-org>.monday.com/admin/integrations/api
|
|
50
50
|
#
|
|
51
51
|
# OAuth login (`monday auth login`) is registered but deferred in
|
|
52
|
-
# v0.
|
|
52
|
+
# v0.5.0 — the verb surfaces a clear `usage_error.details.reason:
|
|
53
53
|
# oauth_unregistered` pointing here. Authenticate via the env var.
|
|
54
54
|
export MONDAY_API_TOKEN="<your-token>"
|
|
55
55
|
|
|
56
56
|
# 2. Smoke test — confirm the token works.
|
|
57
57
|
monday account whoami --json
|
|
58
58
|
|
|
59
|
-
# 3.
|
|
60
|
-
|
|
61
|
-
|
|
59
|
+
# 3. Install shell completion (v0.4-M33 — bash / zsh / fish).
|
|
60
|
+
# The default mode emits raw script bytes on stdout (so the redirect
|
|
61
|
+
# works); `--json` opts INTO the §6 envelope.
|
|
62
|
+
monday completion bash >> ~/.bashrc # or .zshrc / config.fish
|
|
62
63
|
|
|
63
|
-
# 4.
|
|
64
|
+
# 4. Is everything wired up? (v0.3 diagnostics cluster)
|
|
65
|
+
monday status --json # 7-probe DNS/TCP/TLS/auth/cache matrix
|
|
66
|
+
monday usage --json # remaining daily Monday API operations
|
|
67
|
+
|
|
68
|
+
# 5. List a board's items (replace 12345 with your board ID)
|
|
64
69
|
monday item list --board 12345 --json
|
|
65
70
|
|
|
66
|
-
#
|
|
71
|
+
# 6. File a new task (v0.2)
|
|
67
72
|
monday item create --board 12345 --name "Refactor login" \
|
|
68
73
|
--set status=Backlog --set 'Due date'=+1w --json
|
|
69
74
|
|
|
70
|
-
#
|
|
71
|
-
#
|
|
72
|
-
#
|
|
75
|
+
# 7. Long-poll for activity on an item (v0.4-M29 — NDJSON stream).
|
|
76
|
+
# Per-event NDJSON record + a `{"_meta": {...}}` trailer carrying
|
|
77
|
+
# the session counters. Use `--once` to drain backlog without
|
|
78
|
+
# polling further; SIGINT (Ctrl-C) drains gracefully and exits 130.
|
|
79
|
+
monday item watch 67890 --once # or --max-events 50 --max-duration 1h
|
|
80
|
+
|
|
81
|
+
# 8. Upload a file to a column or update (v0.4-M31 — multipart wire).
|
|
82
|
+
# `add_file_to_column` for item columns; `add_file_to_update` for
|
|
83
|
+
# comment attachments. Both surface `--dry-run` for an envelope
|
|
84
|
+
# preview without the multipart round-trip.
|
|
85
|
+
monday item upload 67890 --column 'Attachments' ./screenshot.png --json
|
|
86
|
+
monday update upload <update-id> ./diagram.png --json
|
|
87
|
+
|
|
88
|
+
# 9. Parallel partial-success bulk updates (v0.4-M30).
|
|
89
|
+
# `--concurrency <N>` (range 1..32) opts into parallel dispatch on
|
|
90
|
+
# the M25 partial-success path. Envelope is byte-equivalent to the
|
|
91
|
+
# sequential `--concurrency 1` default; input order is preserved
|
|
92
|
+
# in `data.results[]` regardless of completion order.
|
|
93
|
+
monday item update --where status=Backlog --set status='Working on it' \
|
|
94
|
+
--board 12345 --yes --continue-on-error --concurrency 4 --json
|
|
95
|
+
|
|
96
|
+
# 10. Browse the workdocs surface (v0.4-M32 — read-only at v0.4).
|
|
97
|
+
monday doc list --workspace 5 --order-by used_at --limit 10 --json
|
|
98
|
+
monday doc get 88001 --json # full Document with blocks
|
|
99
|
+
|
|
100
|
+
# 11. Workdocs CRUD (v0.5-M35 + v0.5-M36 + v0.5-M37 — the full
|
|
101
|
+
# mutation surface deferred at v0.4-M32 D8 closure).
|
|
102
|
+
# Doc-level CRUD (M35): create / rename / delete / duplicate.
|
|
103
|
+
monday doc create-in-workspace --workspace 5 --name "Design notes" --json
|
|
104
|
+
monday doc rename 88001 --name "Design notes (v2)" --json
|
|
105
|
+
monday doc duplicate 88001 --with-updates --json
|
|
106
|
+
monday doc delete 88001 --yes --json
|
|
107
|
+
# Doc-block CRUD (M36): block-create / block-update / block-delete.
|
|
108
|
+
# 16-value `DocBlockContentType` enum for `--type`.
|
|
109
|
+
monday doc block-create 88001 --type normal_text --content '{"text":"hi"}' --json
|
|
110
|
+
# Bulk import from HTML / markdown (M37): no per-block round-trips.
|
|
111
|
+
monday doc import-html --workspace 5 --html ./page.html --title "Imported" --json
|
|
112
|
+
monday doc append-markdown 88001 --markdown ./notes.md --json
|
|
113
|
+
|
|
114
|
+
# 12. Team writers (v0.5-M34 — deferred from v0.4 at the post-M33
|
|
115
|
+
# candidate-selection session). Six new verbs under `monday user`.
|
|
116
|
+
monday user team-list --json
|
|
117
|
+
monday user team-create --name "Platform" --users 7,9 --json
|
|
118
|
+
monday user team-add-members <tid> --users 11,13 --json
|
|
119
|
+
|
|
120
|
+
# 13. Find-or-create with idempotent matching (v0.2)
|
|
121
|
+
# Re-running with the same args is safe — 0/1/2+ matches route to
|
|
122
|
+
# create / update / `ambiguous_match` (one of the 29 stable error codes).
|
|
73
123
|
monday item upsert --board 12345 --name "Refactor login" \
|
|
74
124
|
--match-by name --set status='Working on it' --json
|
|
75
125
|
|
|
76
|
-
#
|
|
126
|
+
# 14. Move a ticket forward, then comment on it
|
|
77
127
|
monday item set 67890 status=Done --json
|
|
78
128
|
monday update create 67890 --body "Shipped in PR #1234" --json
|
|
79
129
|
|
|
80
|
-
#
|
|
81
|
-
#
|
|
82
|
-
monday dev discover --apply --json
|
|
83
|
-
monday dev sprint current --json
|
|
84
|
-
monday dev task list --mine --json
|
|
130
|
+
# 15. Monday Dev convention layer (v0.3 — sprint/epic/release/task)
|
|
131
|
+
# First-time setup auto-detects boards by Monday's stock template names.
|
|
132
|
+
monday dev discover --apply --json # writes ~/.monday-cli/config.toml
|
|
133
|
+
monday dev sprint current --json # the active sprint
|
|
134
|
+
monday dev task list --mine --json # my open tasks
|
|
85
135
|
|
|
86
|
-
#
|
|
136
|
+
# 16. Outbound writes (v0.3 — webhooks + notifications)
|
|
87
137
|
monday webhook list 12345 --json
|
|
88
138
|
monday notification send --user 7 --target 67890 \
|
|
89
139
|
--target-type item --text "PTAL" --json
|
|
@@ -152,7 +202,7 @@ Every JSON response uses the same universal envelope:
|
|
|
152
202
|
"meta": {
|
|
153
203
|
"schema_version": "1",
|
|
154
204
|
"api_version": "2026-01",
|
|
155
|
-
"cli_version": "0.
|
|
205
|
+
"cli_version": "0.5.0",
|
|
156
206
|
"request_id": "0e6f1a7b-...",
|
|
157
207
|
"source": "live",
|
|
158
208
|
"cache_age_seconds": null,
|
|
@@ -252,7 +302,38 @@ See [`.env.example`](./.env.example) for all supported variables
|
|
|
252
302
|
|
|
253
303
|
## Scope
|
|
254
304
|
|
|
255
|
-
**v0.
|
|
305
|
+
**v0.5.0 (current — `monday-cli@0.5.0` on npm):**
|
|
306
|
+
the v0.4 surface PLUS the full team-writer surface
|
|
307
|
+
(`monday user team-list/get/create/delete/add-members/remove-members`),
|
|
308
|
+
the full Monday workdocs CRUD mutation surface — doc-level
|
|
309
|
+
(`monday doc create-in-workspace/create-on-column/rename/delete/duplicate`),
|
|
310
|
+
doc-block (`monday doc block-create/block-update/block-delete`),
|
|
311
|
+
and doc-content import (`monday doc import-html/append-markdown`) —
|
|
312
|
+
closing the v0.4-M32 workdocs-mutation deferral. **16 new CLI
|
|
313
|
+
verbs across 9 wire mutations.** **No breaking changes vs v0.4.0**
|
|
314
|
+
— every v0.5 surface is additive. Built incrementally across
|
|
315
|
+
M34–M37. See [CHANGELOG.md](./CHANGELOG.md) for the full
|
|
316
|
+
per-milestone release notes.
|
|
317
|
+
|
|
318
|
+
**OAuth deferral (unchanged from v0.4.0).** `monday auth login` is
|
|
319
|
+
registered but the canonical Monday OAuth app is not registered in
|
|
320
|
+
v0.5.0; the verb surfaces a clear `usage_error.details.reason:
|
|
321
|
+
oauth_unregistered` pointing at `MONDAY_API_TOKEN`. Multi-profile
|
|
322
|
+
config + per-profile credentials cache work fully against API
|
|
323
|
+
tokens; OAuth registration revisits in v0.5.x / v0.6 contingent on
|
|
324
|
+
user demand.
|
|
325
|
+
|
|
326
|
+
**v0.4.0 (the previous release):**
|
|
327
|
+
the v0.3 surface PLUS long-poll item activity streaming
|
|
328
|
+
(`monday item watch <iid>` — NDJSON), parallel bulk dispatch
|
|
329
|
+
(`monday item update --where ... --concurrency <N>`), asset uploads
|
|
330
|
+
(`monday item upload` / `monday update upload` — multipart wire),
|
|
331
|
+
Monday workdocs reads (`monday doc list` / `monday doc get` — full
|
|
332
|
+
workdocs CRUD mutation surface deferred to v0.5; shipped at v0.5),
|
|
333
|
+
and shell completion (`monday completion bash|zsh|fish`). Built
|
|
334
|
+
incrementally across M29–M33.
|
|
335
|
+
|
|
336
|
+
**v0.3.0 (the prior release):**
|
|
256
337
|
the v0.2 mutating core PLUS the Monday Dev convention layer
|
|
257
338
|
(`monday dev` namespace — sprint / epic / release / task workflow
|
|
258
339
|
shortcuts on top of standard board CRUD), multi-profile auth
|
|
@@ -266,17 +347,8 @@ outbound writes (`monday webhook list/create/delete` +
|
|
|
266
347
|
(`tags`, `board_relation`, `dependency`) closing the v0.2
|
|
267
348
|
tentative-row carryover. **No breaking changes vs v0.2.0** — every
|
|
268
349
|
v0.3 surface is additive. Built incrementally across M19–M28.
|
|
269
|
-
See [CHANGELOG.md](./CHANGELOG.md) for the full per-milestone
|
|
270
|
-
release notes.
|
|
271
|
-
|
|
272
|
-
**OAuth deferral.** `monday auth login` is registered but the
|
|
273
|
-
canonical Monday OAuth app is not registered in v0.3.0; the verb
|
|
274
|
-
surfaces a clear `usage_error.details.reason: oauth_unregistered`
|
|
275
|
-
pointing at `MONDAY_API_TOKEN`. Multi-profile config + per-profile
|
|
276
|
-
credentials cache work fully against API tokens; OAuth registration
|
|
277
|
-
revisits in v0.3.x / v0.4 contingent on user demand.
|
|
278
350
|
|
|
279
|
-
**v0.2.0 (the
|
|
351
|
+
**v0.2.0 (the foundation-of-mutations release):**
|
|
280
352
|
the v0.1 read-only core + safe-mutations surface PLUS the full
|
|
281
353
|
mutation surface (item lifecycle, update mutations, workspace
|
|
282
354
|
lifecycle, board lifecycle, board columns + groups). Built
|
|
@@ -461,15 +533,113 @@ row `tags`, `board_relation`, `dependency`.
|
|
|
461
533
|
deferred out of v0.3 per Decision 11 (Monday's `sub_items_board`
|
|
462
534
|
carries no `subtasks` column at API `2026-01`).
|
|
463
535
|
|
|
464
|
-
**v0.4
|
|
465
|
-
|
|
466
|
-
|
|
536
|
+
**What v0.4 added (M29–M33; full per-milestone narrative in
|
|
537
|
+
[CHANGELOG.md](./CHANGELOG.md)):**
|
|
538
|
+
|
|
539
|
+
- **M29** — `monday item watch <iid>` long-polls `boards.activity_
|
|
540
|
+
logs(item_ids:)` for per-item event streaming. NDJSON output:
|
|
541
|
+
one event record per emitted activity-log row + a trailing
|
|
542
|
+
`{"_meta": {...}}` record carrying the seven session counters
|
|
543
|
+
(`events_emitted` / `polls_made` / `failed_polls` /
|
|
544
|
+
`last_seen_event_id` / `circuit_broken_at` / `exit_reason` /
|
|
545
|
+
`watch_duration_seconds`). `--once` drains backlog and exits
|
|
546
|
+
without polling further; `--max-events` / `--max-duration`
|
|
547
|
+
ceilings exit cleanly; SIGINT drains gracefully + exits 130.
|
|
548
|
+
Circuit-breaker trips after 5 consecutive `complexity_exceeded`
|
|
549
|
+
polls.
|
|
550
|
+
- **M30** — `monday item update --where ... --concurrency <N>`
|
|
551
|
+
(range 1..32; default 1) opts into bounded parallel dispatch on
|
|
552
|
+
the M25 partial-success path. Envelope is byte-equivalent to the
|
|
553
|
+
sequential default; input order is preserved in `data.results[]`
|
|
554
|
+
regardless of completion order. `--concurrency 1` routes through
|
|
555
|
+
`dispatchSequential`; `> 1` routes through `dispatchParallel`.
|
|
556
|
+
- **M31** — `monday item upload <iid> --column <col> <file>` +
|
|
557
|
+
`monday update upload <update-id> <file>` ship the first multipart
|
|
558
|
+
wire surface (`add_file_to_column` / `add_file_to_update`). Both
|
|
559
|
+
surface `--dry-run` for a planned-change envelope preview without
|
|
560
|
+
the multipart round-trip. Uploads are non-idempotent (each
|
|
561
|
+
successful call mints a fresh `Asset` ID); cache invalidation
|
|
562
|
+
fires single-leg on success. Read-side `item assets` / `update
|
|
563
|
+
assets` verbs deferred to v0.4.x per M31 Decision D6.
|
|
564
|
+
- **M32** — `monday doc list [--workspace <wid>,...] [--order-by
|
|
565
|
+
<created_at|used_at>] [--limit <n>] [--page <n>]` + `monday doc
|
|
566
|
+
get <did>` ship read-only access to Monday's workdocs surface
|
|
567
|
+
(`Query.docs(...)`). Page/limit pagination (no cursor on this
|
|
568
|
+
Monday surface). The full workdocs CRUD mutation surface (9
|
|
569
|
+
mutations: `create_doc` / `update_doc_name` / `delete_doc` /
|
|
570
|
+
`duplicate_doc` / `import_doc_from_html` / `add_content_to_doc_
|
|
571
|
+
from_markdown` / `create_doc_block` / `update_doc_block` /
|
|
572
|
+
`delete_doc_block`) is deferred to v0.5.
|
|
573
|
+
- **M33** — `monday completion <bash|zsh|fish>` ships shell
|
|
574
|
+
completion script generation. The default mode emits raw script
|
|
575
|
+
bytes on stdout regardless of TTY/pipe context (so `monday
|
|
576
|
+
completion bash >> ~/.bashrc` works as a sourceable file —
|
|
577
|
+
cli-design §3.1 #2 raw-bytes carve-out); `--json` opts INTO the
|
|
578
|
+
§6 envelope with `data: { shell, script }`. Hand-rolled per-shell
|
|
579
|
+
templates (commander 14.0.3 ships no built-in completion
|
|
580
|
+
machinery, verified by empirical probe at M33 pre-flight).
|
|
581
|
+
|
|
582
|
+
**What v0.5 added (M34–M37; full per-milestone narrative in
|
|
583
|
+
[CHANGELOG.md](./CHANGELOG.md)):**
|
|
584
|
+
|
|
585
|
+
- **M34** — `monday user team-list/get/create/delete/add-members/
|
|
586
|
+
remove-members` ship the full team-writer surface. The two read
|
|
587
|
+
verbs (`team-list` / `team-get`) close the v0.4-M33 candidate-
|
|
588
|
+
selection deferral; the four mutations introduce a new partial-
|
|
589
|
+
success projection for `team-add-members` / `team-remove-members`
|
|
590
|
+
(Monday's `change_team_memberships` returns `failed_users` +
|
|
591
|
+
`successful_users` lists; the CLI projects to the universal §6.1
|
|
592
|
+
`results: [{user_id, ok, ...}]` shape with input-order preserved
|
|
593
|
+
+ failed-bucket-priority discipline).
|
|
594
|
+
- **M35** — `monday doc create-in-workspace/create-on-column/rename/
|
|
595
|
+
delete/duplicate` ship the doc-level CRUD writer surface. Two
|
|
596
|
+
create variants (per D7) — `create-in-workspace` (`--workspace`
|
|
597
|
+
required + optional `--folder` / `--kind`) vs `create-on-column`
|
|
598
|
+
(`--item` + `--column` against an existing file-shaped column).
|
|
599
|
+
`rename` (`update_doc_name`), `delete --yes` (`delete_doc` — the
|
|
600
|
+
destructive verb in the cluster), and `duplicate [--with-updates]`
|
|
601
|
+
(`duplicate_doc`) round out the lifecycle. Backed by 4 Monday
|
|
602
|
+
wire mutations.
|
|
603
|
+
- **M36** — `monday doc block-create/block-update/block-delete`
|
|
604
|
+
ship the doc-block CRUD surface. `--type <DocBlockContentType>`
|
|
605
|
+
takes one of 16 enum values (`normal_text` / `large_title` /
|
|
606
|
+
`quote` / `bulleted_list` / `check_list` / `code` / `divider` /
|
|
607
|
+
…) per D10 closure. `--content <json>` (parsed via the M27-lifted
|
|
608
|
+
`parseJsonArg` helper). Per-type content payload shapes
|
|
609
|
+
documented in `docs/output-shapes.md` "Per-block content shapes"
|
|
610
|
+
reference table — 7 cassette-pinned variants + 9 TBD / inferred
|
|
611
|
+
variants awaiting follow-up cassettes per D11.
|
|
612
|
+
- **M37** — `monday doc import-html/append-markdown` ship bulk
|
|
613
|
+
doc-content import in a single wire round-trip (no per-block
|
|
614
|
+
loop). `import-html` creates a new doc from an HTML payload;
|
|
615
|
+
`append-markdown` appends blocks to an existing doc from a
|
|
616
|
+
markdown payload. Both surface mutex argv sources
|
|
617
|
+
(`--html <file|-> | --html-string <s>` /
|
|
618
|
+
`--markdown <file|-> | --markdown-string <s>`) backed by the new
|
|
619
|
+
generic `readSourceContent` helper at `src/utils/source-content.ts`
|
|
620
|
+
(R-v0.5-NEW-18 lifted ahead-of-feat from M13's `readUpdateBody`
|
|
621
|
+
— 5 consumers post-lift). Wire-side payload cap pre-empted at
|
|
622
|
+
parse boundary via `MAX_DOC_IMPORT_PAYLOAD_BYTES = 256_000` per
|
|
623
|
+
D13 empirical-probe pinning (rejected at 500KB, OK at 250KB on
|
|
624
|
+
both surfaces).
|
|
625
|
+
|
|
626
|
+
**v0.6 (next):** multi-level subitems remain conditional on
|
|
627
|
+
Monday's data model surfacing them (slipped from v0.4 → v0.5 →
|
|
628
|
+
v0.6 across two consecutive release-preps — Monday's
|
|
629
|
+
`sub_items_board` still carries no `subtasks` column at API
|
|
630
|
+
`2026-01`); cross-board `item move` value-overrides (Monday's
|
|
631
|
+
`ColumnMappingInput` still carries no value slot — slipped twice
|
|
632
|
+
for the same reason); resumable cross-board cursor pagination
|
|
633
|
+
(per-board cursor-lifetime under aggregation needs design work);
|
|
634
|
+
files-shaped friendly column writes (`--set <file-col>=<path>` and
|
|
635
|
+
`--set-raw <file-col>=<json>` — `monday item upload` from v0.4-M31
|
|
636
|
+
is the verb-shaped alternative path agents should use today).
|
|
467
637
|
|
|
468
638
|
See [`docs/cli-design.md`](./docs/cli-design.md) §13 for the
|
|
469
|
-
full roadmap, [`docs/v0.
|
|
470
|
-
v0.
|
|
471
|
-
[`docs/v0.
|
|
472
|
-
|
|
639
|
+
full roadmap, [`docs/v0.5-plan.md`](./docs/v0.5-plan.md) for the
|
|
640
|
+
v0.5 milestone history, [`docs/v0.4-plan.md`](./docs/v0.4-plan.md)
|
|
641
|
+
for v0.4, [`docs/v0.3-plan.md`](./docs/v0.3-plan.md) for v0.3, and
|
|
642
|
+
[`docs/v0.2-plan.md`](./docs/v0.2-plan.md) for v0.2.
|
|
473
643
|
|
|
474
644
|
See [CHANGELOG.md](./CHANGELOG.md) for the per-release contract.
|
|
475
645
|
|
|
@@ -513,7 +683,9 @@ The full dev workflow + how to add a new command is in
|
|
|
513
683
|
- **No `any`** (lint-enforced).
|
|
514
684
|
- **Parse at every boundary** with zod.
|
|
515
685
|
- **Mock at the network boundary, not internal modules.**
|
|
516
|
-
- **Branch coverage 95
|
|
686
|
+
- **Branch coverage 95.45% floor** for branches; 95% floor for
|
|
687
|
+
statements / functions / lines (v0.3-M22 ratcheted branches
|
|
688
|
+
from 94% via an OAuth coverage-push session — see
|
|
517
689
|
`vitest.config.ts`).
|
|
518
690
|
- **Atomic commits, Conventional Commits.**
|
|
519
691
|
|
|
@@ -0,0 +1,326 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Asset upload surface for the v0.4-M31 `monday item upload` +
|
|
3
|
+
* `monday update upload` verbs (`cli-design.md` §2.2 + §4.3 + §6.4
|
|
4
|
+
* + §13 v0.4 entry; `v0.4-plan.md` §3 M31).
|
|
5
|
+
*
|
|
6
|
+
* **Wire surface (empirical probe 2026-05-13, API `2026-01`).** Two
|
|
7
|
+
* Monday GraphQL multipart mutations land here:
|
|
8
|
+
*
|
|
9
|
+
* - `Mutation.add_file_to_column(column_id: String!, file: File!,
|
|
10
|
+
* item_id: ID!) → Asset` — attaches a file to a `file`-typed
|
|
11
|
+
* column on a specific item. Note **`column_id` is `String!`
|
|
12
|
+
* not `ID!`** (the SDK's column-id surface is consistently
|
|
13
|
+
* `String!` because column IDs are user-defined-looking tokens
|
|
14
|
+
* like `'files'` / `'attachments_3'` rather than numeric).
|
|
15
|
+
* - `Mutation.add_file_to_update(file: File!, update_id: ID!) →
|
|
16
|
+
* Asset` — attaches a file to an Update (comment) record. Item
|
|
17
|
+
* ID is implicit (the update's parent item).
|
|
18
|
+
*
|
|
19
|
+
* Both mutations cross the wire via `multipart/form-data` per the
|
|
20
|
+
* standard GraphQL multipart-request specification (jaydenseric).
|
|
21
|
+
* The `File` scalar is Monday's own (NOT the spec-standard `Upload`);
|
|
22
|
+
* the multipart envelope is otherwise spec-compliant — `operations`
|
|
23
|
+
* + `map` JSON parts + the file part keyed by index `0`.
|
|
24
|
+
*
|
|
25
|
+
* **Asset object — 10 fields.** `id` (ID, non-null), `name` (String,
|
|
26
|
+
* non-null — the multipart `filename` parameter), `url` (String,
|
|
27
|
+
* non-null — direct download), `public_url` (String, non-null —
|
|
28
|
+
* sharable), `file_extension` (String, non-null), `file_size` (Int,
|
|
29
|
+
* non-null — bytes), `created_at` (Date, nullable), `uploaded_by`
|
|
30
|
+
* (User, non-null — the token's owner; projected to the slim
|
|
31
|
+
* `{id, name}` shape for envelope compactness), `original_geometry`
|
|
32
|
+
* (String, nullable — image dimensions like `'1920x1080'`),
|
|
33
|
+
* `url_thumbnail` (String, nullable — image thumbnails only).
|
|
34
|
+
*
|
|
35
|
+
* **R-NEW-41 3rd consumer fires here.** Asset upload is the third
|
|
36
|
+
* site (after M27 `Webhook.config` JSON/String asymmetry + M27
|
|
37
|
+
* `NotificationTargetType` collapse) where the wire-vs-CLI semantics
|
|
38
|
+
* carry a documented asymmetry. This module's transport choice
|
|
39
|
+
* (sibling multipart module, NOT extension of `transport.ts`) is
|
|
40
|
+
* itself the load-bearing asymmetry shape — the JSON envelope's
|
|
41
|
+
* `body: JSON.stringify(...)` invariant doesn't compose with
|
|
42
|
+
* multipart/form-data's `FormData`-driven boundary parameter, so
|
|
43
|
+
* the two transports live in sibling modules with parallel
|
|
44
|
+
* interfaces. See `docs/architecture.md` "Wire-vs-CLI semantics
|
|
45
|
+
* documentation conventions" for the canonical writeup.
|
|
46
|
+
*
|
|
47
|
+
* **No new ERROR_CODES (29 stays).** Asset-upload failures route
|
|
48
|
+
* through the existing codes:
|
|
49
|
+
*
|
|
50
|
+
* - `usage_error` — file path doesn't exist / not readable
|
|
51
|
+
* (`details.reason: 'file_not_readable'`); file is empty
|
|
52
|
+
* (`details.reason: 'file_empty'`); upload exceeded Monday's
|
|
53
|
+
* per-file size limit (Monday surfaces this server-side;
|
|
54
|
+
* `details.reason: 'file_too_large'` rewrap).
|
|
55
|
+
* - `unsupported_column_type` — `--column <col>` resolves to a
|
|
56
|
+
* non-`file` column type. Hint points back at the §5.3 writer
|
|
57
|
+
* surface (Monday writes files via `add_file_to_column` for
|
|
58
|
+
* `file` columns only; other column types route via
|
|
59
|
+
* `change_column_value`).
|
|
60
|
+
* - `not_found` — item / update / column doesn't exist or isn't
|
|
61
|
+
* visible to the token.
|
|
62
|
+
* - `validation_failed` — Monday-side rejection of the upload
|
|
63
|
+
* payload (malformed filename, server-side virus scan flag,
|
|
64
|
+
* etc.).
|
|
65
|
+
* - `forbidden` / `unauthorized` — token lacks asset-write scope.
|
|
66
|
+
*
|
|
67
|
+
* Monday's per-file size cap is plan-tier-dependent and NOT exposed
|
|
68
|
+
* via the schema (verified at M31 pre-flight probe — `Plan` +
|
|
69
|
+
* `Account` carry no file-quota fields). The CLI does NOT pre-check
|
|
70
|
+
* file size against a hardcoded ceiling; Monday's runtime rejection
|
|
71
|
+
* (typically `FILE_SIZE_LIMIT_EXCEEDED` or a generic 413) is rewrapped
|
|
72
|
+
* as `usage_error` with `details.reason: 'file_too_large'` +
|
|
73
|
+
* `details.file_size_bytes` (the local `fs.stat()` measurement
|
|
74
|
+
* captured at upload time — Monday's wire rejection may not surface
|
|
75
|
+
* a size field, but the CLI already has the local size from the
|
|
76
|
+
* read leg and threads it for a stable agent-keyed envelope).
|
|
77
|
+
*
|
|
78
|
+
* **Idempotency: NO.** Each successful upload mints a new Asset
|
|
79
|
+
* with a new ID — re-running `item upload` with the same args
|
|
80
|
+
* uploads the file a second time. Agents needing register-once
|
|
81
|
+
* semantics dedupe on the CLI side (e.g., read `Item.assets` first
|
|
82
|
+
* and skip the upload if a matching `Asset.name` exists).
|
|
83
|
+
*
|
|
84
|
+
* **Status: runtime body shipped at v0.4-M31 IMPL.** Both fetchers
|
|
85
|
+
* dispatch via `inputs.multipart.request(...)` wrapped in
|
|
86
|
+
* `withRetry(...)` per cli-design §2.5; the response-parse boundary
|
|
87
|
+
* uses `mapResponse` (mirroring `MondayClient.raw`'s discipline) +
|
|
88
|
+
* `assertResponseFieldPresent` for the schema-drift / null-payload
|
|
89
|
+
* distinction + `assetSchema.safeParse(...)` via `unwrapOrThrow`
|
|
90
|
+
* for the per-field shape. Server-side size-cap rewrap fires at
|
|
91
|
+
* the error-mapping layer below.
|
|
92
|
+
*/
|
|
93
|
+
import { z } from 'zod';
|
|
94
|
+
import type { MondayClient } from './client.js';
|
|
95
|
+
import type { MultipartTransport } from './multipart-transport.js';
|
|
96
|
+
import type { Complexity } from '../utils/output/envelope.js';
|
|
97
|
+
/**
|
|
98
|
+
* Slim projection of Monday's `User` for the `Asset.uploaded_by`
|
|
99
|
+
* slot. Monday's full User type is ~30 fields; the envelope echoes
|
|
100
|
+
* only `id` + `name` (matching the M19 `User`-projection cadence
|
|
101
|
+
* elsewhere in the CLI — `account_tags`, `board describe`'s
|
|
102
|
+
* subscribers, etc.). Future verbs that need wider User detail
|
|
103
|
+
* (`user get <uid>`) read against the full type.
|
|
104
|
+
*/
|
|
105
|
+
export declare const uploadedBySchema: z.ZodObject<{
|
|
106
|
+
id: z.ZodString;
|
|
107
|
+
name: z.ZodString;
|
|
108
|
+
}, z.core.$strict>;
|
|
109
|
+
export type UploadedBy = z.infer<typeof uploadedBySchema>;
|
|
110
|
+
/**
|
|
111
|
+
* Asset read-projection shape — surfaces Monday's full 10-field
|
|
112
|
+
* `Asset` object (per `scripts/probe/m31-asset-upload.ts` 2026-05-13,
|
|
113
|
+
* API `2026-01`). The output envelope echoes this verbatim so an
|
|
114
|
+
* agent reading the upload result has every field a follow-up
|
|
115
|
+
* `Query.assets(ids:)` read would surface, plus the inputs the CLI
|
|
116
|
+
* sent (echoed by the caller, not this module).
|
|
117
|
+
*
|
|
118
|
+
* `original_geometry` + `url_thumbnail` are image-only; nullable
|
|
119
|
+
* for non-image uploads. `created_at` is nullable in Monday's
|
|
120
|
+
* schema even though every successful upload sets it (the
|
|
121
|
+
* nullability is preserved for fidelity against the introspected
|
|
122
|
+
* type).
|
|
123
|
+
*/
|
|
124
|
+
export declare const assetSchema: z.ZodObject<{
|
|
125
|
+
id: z.ZodString;
|
|
126
|
+
name: z.ZodString;
|
|
127
|
+
url: z.ZodString;
|
|
128
|
+
public_url: z.ZodString;
|
|
129
|
+
file_extension: z.ZodString;
|
|
130
|
+
file_size: z.ZodNumber;
|
|
131
|
+
created_at: z.ZodNullable<z.ZodString>;
|
|
132
|
+
uploaded_by: z.ZodObject<{
|
|
133
|
+
id: z.ZodString;
|
|
134
|
+
name: z.ZodString;
|
|
135
|
+
}, z.core.$strict>;
|
|
136
|
+
original_geometry: z.ZodNullable<z.ZodString>;
|
|
137
|
+
url_thumbnail: z.ZodNullable<z.ZodString>;
|
|
138
|
+
}, z.core.$strict>;
|
|
139
|
+
export type Asset = z.infer<typeof assetSchema>;
|
|
140
|
+
/**
|
|
141
|
+
* Output shape for `monday item upload <iid> --column <col> <file>`.
|
|
142
|
+
* Echoes the wire `Asset` record plus the agent-supplied inputs
|
|
143
|
+
* (`item_id`, `column_id`, `filename`, `file_size_bytes`) so one
|
|
144
|
+
* envelope read carries the full upload context.
|
|
145
|
+
*
|
|
146
|
+
* `file_size_bytes` is the CLI-measured size at upload time (from
|
|
147
|
+
* the local file's `fs.stat()`); `asset.file_size` is Monday's
|
|
148
|
+
* server-stored size (usually identical to `file_size_bytes` but
|
|
149
|
+
* preserved separately for asymmetric-storage-encoding fidelity).
|
|
150
|
+
*
|
|
151
|
+
* `asset` is the canonical wire record; future field additions
|
|
152
|
+
* land additively per the §6.1 envelope evolution rules.
|
|
153
|
+
*/
|
|
154
|
+
export declare const itemUploadOutputSchema: z.ZodObject<{
|
|
155
|
+
operation: z.ZodLiteral<"add_file_to_column">;
|
|
156
|
+
item_id: z.ZodString;
|
|
157
|
+
column_id: z.ZodString;
|
|
158
|
+
filename: z.ZodString;
|
|
159
|
+
file_size_bytes: z.ZodNumber;
|
|
160
|
+
asset: z.ZodObject<{
|
|
161
|
+
id: z.ZodString;
|
|
162
|
+
name: z.ZodString;
|
|
163
|
+
url: z.ZodString;
|
|
164
|
+
public_url: z.ZodString;
|
|
165
|
+
file_extension: z.ZodString;
|
|
166
|
+
file_size: z.ZodNumber;
|
|
167
|
+
created_at: z.ZodNullable<z.ZodString>;
|
|
168
|
+
uploaded_by: z.ZodObject<{
|
|
169
|
+
id: z.ZodString;
|
|
170
|
+
name: z.ZodString;
|
|
171
|
+
}, z.core.$strict>;
|
|
172
|
+
original_geometry: z.ZodNullable<z.ZodString>;
|
|
173
|
+
url_thumbnail: z.ZodNullable<z.ZodString>;
|
|
174
|
+
}, z.core.$strict>;
|
|
175
|
+
}, z.core.$strict>;
|
|
176
|
+
export type ItemUploadOutput = z.infer<typeof itemUploadOutputSchema>;
|
|
177
|
+
/**
|
|
178
|
+
* Output shape for `monday update upload <uid> <file>`. Same general
|
|
179
|
+
* shape as `itemUploadOutputSchema` but carries `update_id` instead
|
|
180
|
+
* of `item_id` + `column_id` (an Update record is the target;
|
|
181
|
+
* Monday's `Update.assets` collection grows by one on success).
|
|
182
|
+
*/
|
|
183
|
+
export declare const updateUploadOutputSchema: z.ZodObject<{
|
|
184
|
+
operation: z.ZodLiteral<"add_file_to_update">;
|
|
185
|
+
update_id: z.ZodString;
|
|
186
|
+
filename: z.ZodString;
|
|
187
|
+
file_size_bytes: z.ZodNumber;
|
|
188
|
+
asset: z.ZodObject<{
|
|
189
|
+
id: z.ZodString;
|
|
190
|
+
name: z.ZodString;
|
|
191
|
+
url: z.ZodString;
|
|
192
|
+
public_url: z.ZodString;
|
|
193
|
+
file_extension: z.ZodString;
|
|
194
|
+
file_size: z.ZodNumber;
|
|
195
|
+
created_at: z.ZodNullable<z.ZodString>;
|
|
196
|
+
uploaded_by: z.ZodObject<{
|
|
197
|
+
id: z.ZodString;
|
|
198
|
+
name: z.ZodString;
|
|
199
|
+
}, z.core.$strict>;
|
|
200
|
+
original_geometry: z.ZodNullable<z.ZodString>;
|
|
201
|
+
url_thumbnail: z.ZodNullable<z.ZodString>;
|
|
202
|
+
}, z.core.$strict>;
|
|
203
|
+
}, z.core.$strict>;
|
|
204
|
+
export type UpdateUploadOutput = z.infer<typeof updateUploadOutputSchema>;
|
|
205
|
+
/**
|
|
206
|
+
* Mutation document for `add_file_to_column`. Operation name is
|
|
207
|
+
* pinned literally to `AddFileToColumn` and matches the wire
|
|
208
|
+
* `operationName` payload (R-NEW-37 W2 audit-point — caller-
|
|
209
|
+
* overridable operationName slots were closed at M27 IMPL round-1
|
|
210
|
+
* P2-1).
|
|
211
|
+
*
|
|
212
|
+
* `$file: File!` — Monday's own scalar (NOT the spec-standard
|
|
213
|
+
* `Upload!`); the multipart wire dispatcher (`assets.ts`'s caller
|
|
214
|
+
* via `MultipartTransport`) populates this slot via the spec-
|
|
215
|
+
* compliant `map` JSON pointing the file part at `variables.file`.
|
|
216
|
+
*
|
|
217
|
+
* Returns the full 10-field `Asset` selection so the output
|
|
218
|
+
* envelope captures Monday's complete view of the upload in one
|
|
219
|
+
* round-trip (no follow-up `Query.assets(ids:)` re-read needed).
|
|
220
|
+
*/
|
|
221
|
+
export declare const ADD_FILE_TO_COLUMN_MUTATION = "\n mutation AddFileToColumn(\n $itemId: ID!,\n $columnId: String!,\n $file: File!\n ) {\n add_file_to_column(\n item_id: $itemId,\n column_id: $columnId,\n file: $file\n ) {\n id\n name\n url\n public_url\n file_extension\n file_size\n created_at\n uploaded_by { id name }\n original_geometry\n url_thumbnail\n }\n }\n";
|
|
222
|
+
/**
|
|
223
|
+
* Mutation document for `add_file_to_update`. Operation name pinned
|
|
224
|
+
* to `AddFileToUpdate` (R-NEW-37 W2). No `column_id` — Updates
|
|
225
|
+
* carry attachments directly via `Update.assets`.
|
|
226
|
+
*/
|
|
227
|
+
export declare const ADD_FILE_TO_UPDATE_MUTATION = "\n mutation AddFileToUpdate(\n $updateId: ID!,\n $file: File!\n ) {\n add_file_to_update(\n update_id: $updateId,\n file: $file\n ) {\n id\n name\n url\n public_url\n file_extension\n file_size\n created_at\n uploaded_by { id name }\n original_geometry\n url_thumbnail\n }\n }\n";
|
|
228
|
+
export interface AddFileToColumnInputs {
|
|
229
|
+
readonly client: MondayClient;
|
|
230
|
+
readonly multipart: MultipartTransport;
|
|
231
|
+
readonly itemId: string;
|
|
232
|
+
readonly columnId: string;
|
|
233
|
+
readonly file: Blob;
|
|
234
|
+
readonly filename: string;
|
|
235
|
+
/**
|
|
236
|
+
* **Required** AbortSignal threaded into the multipart wire
|
|
237
|
+
* dispatch via `MultipartTransportRequest.signal` at IMPL.
|
|
238
|
+
* Callers MUST pass the runner's combined signal (`ctx.signal`)
|
|
239
|
+
* explicitly — `MondayClient.signal` is private + multipart
|
|
240
|
+
* dispatch bypasses `MondayClient.raw`, so no implicit fallback
|
|
241
|
+
* exists. Abort propagation follows the standard
|
|
242
|
+
* `--timeout` / SIGINT plumbing (`src/api/transport.ts`'s
|
|
243
|
+
* `combineSignals` mirrors the multipart-transport's own
|
|
244
|
+
* combined-signal logic at IMPL).
|
|
245
|
+
*
|
|
246
|
+
* **Retry semantics pinned (cli-design §2.5).** Asset upload
|
|
247
|
+
* honors the global `--retry <n>` contract: the IMPL session
|
|
248
|
+
* wraps `multipart.request(...)` in `withRetry(...)` using the
|
|
249
|
+
* `retries` value threaded from `client.config`'s retry slot.
|
|
250
|
+
* Re-readability is safe — Web `Blob.stream()` returns a fresh
|
|
251
|
+
* `ReadableStream` per call, so multipart payload assembly can
|
|
252
|
+
* re-execute on each retry attempt without buffering.
|
|
253
|
+
* Retryable conditions match the JSON transport's set
|
|
254
|
+
* (`rate_limited` / `complexity_exceeded` /
|
|
255
|
+
* `concurrency_exceeded` / `ip_rate_limited` /
|
|
256
|
+
* `resource_locked` / `network_error`); non-retryable
|
|
257
|
+
* conditions (`forbidden`, `not_found`, `validation_failed`,
|
|
258
|
+
* `usage_error` with `file_too_large`) surface immediately.
|
|
259
|
+
*/
|
|
260
|
+
readonly signal: AbortSignal;
|
|
261
|
+
/**
|
|
262
|
+
* Maximum retry count for transient failures (default
|
|
263
|
+
* `--retry 3`, range `[0, ...]`). Threaded through to
|
|
264
|
+
* `withRetry(...)` at IMPL — same retry layer the JSON
|
|
265
|
+
* transport uses (cli-design §2.5).
|
|
266
|
+
*/
|
|
267
|
+
readonly retries: number;
|
|
268
|
+
}
|
|
269
|
+
export interface AddFileToColumnResult {
|
|
270
|
+
readonly asset: Asset;
|
|
271
|
+
readonly source: 'live';
|
|
272
|
+
readonly cacheAgeSeconds: null;
|
|
273
|
+
readonly complexity: Complexity | null;
|
|
274
|
+
}
|
|
275
|
+
export interface AddFileToUpdateInputs {
|
|
276
|
+
readonly client: MondayClient;
|
|
277
|
+
readonly multipart: MultipartTransport;
|
|
278
|
+
readonly updateId: string;
|
|
279
|
+
readonly file: Blob;
|
|
280
|
+
readonly filename: string;
|
|
281
|
+
/**
|
|
282
|
+
* **Required** — same semantics as
|
|
283
|
+
* {@link AddFileToColumnInputs.signal}. Callers MUST pass
|
|
284
|
+
* `ctx.signal` explicitly (no implicit fallback from
|
|
285
|
+
* `client`).
|
|
286
|
+
*/
|
|
287
|
+
readonly signal: AbortSignal;
|
|
288
|
+
/**
|
|
289
|
+
* Same semantics as {@link AddFileToColumnInputs.retries} —
|
|
290
|
+
* threaded into `withRetry(...)` around the multipart
|
|
291
|
+
* dispatch at IMPL.
|
|
292
|
+
*/
|
|
293
|
+
readonly retries: number;
|
|
294
|
+
}
|
|
295
|
+
export interface AddFileToUpdateResult {
|
|
296
|
+
readonly asset: Asset;
|
|
297
|
+
readonly source: 'live';
|
|
298
|
+
readonly cacheAgeSeconds: null;
|
|
299
|
+
readonly complexity: Complexity | null;
|
|
300
|
+
}
|
|
301
|
+
/**
|
|
302
|
+
* Fires Monday's `add_file_to_column` mutation via the multipart
|
|
303
|
+
* transport (operationName `AddFileToColumn`, pinned literally per
|
|
304
|
+
* R-NEW-37 W2 — NOT caller-overridable). Builds the operations
|
|
305
|
+
* payload with the `file: null` placeholder per the GraphQL
|
|
306
|
+
* multipart-request spec, dispatches through `inputs.multipart` +
|
|
307
|
+
* `withRetry(...)`, parses the response — null `add_file_to_column`
|
|
308
|
+
* → `not_found` with `details.{item_id, column_id}`; non-Asset
|
|
309
|
+
* shape → `internal_error` via `assetSchema.safeParse + unwrapOr
|
|
310
|
+
* Throw`. Server-side size rejections rewrap as `usage_error` with
|
|
311
|
+
* `details.reason: 'file_too_large'` + `details.file_size_bytes`
|
|
312
|
+
* from the caller-supplied local `fs.stat()` measurement (D3).
|
|
313
|
+
*
|
|
314
|
+
* Not idempotent — re-running mints a new `Asset` ID.
|
|
315
|
+
*/
|
|
316
|
+
export declare const addFileToColumn: (inputs: AddFileToColumnInputs) => Promise<AddFileToColumnResult>;
|
|
317
|
+
/**
|
|
318
|
+
* Fires Monday's `add_file_to_update` mutation via the multipart
|
|
319
|
+
* transport (operationName `AddFileToUpdate`, pinned literally per
|
|
320
|
+
* R-NEW-37 W2). Mirrors {@link addFileToColumn}'s shape minus the
|
|
321
|
+
* `column_id` slot — Updates carry attachments via `Update.assets`
|
|
322
|
+
* directly. Same response-parse boundary, same `file_too_large`
|
|
323
|
+
* rewrap, same idempotency caveat (re-running mints a new Asset).
|
|
324
|
+
*/
|
|
325
|
+
export declare const addFileToUpdate: (inputs: AddFileToUpdateInputs) => Promise<AddFileToUpdateResult>;
|
|
326
|
+
//# sourceMappingURL=assets.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"assets.d.ts","sourceRoot":"","sources":["../../src/api/assets.ts"],"names":[],"mappings":"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"}
|