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
|
@@ -0,0 +1,1652 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Workdocs read + mutation surface for the v0.4-M32 `monday doc
|
|
3
|
+
* list/get` verbs, the v0.5-M35 doc-level CRUD verbs, the v0.5-M36
|
|
4
|
+
* per-block CRUD verbs, and the v0.5-M37 doc-content import verbs
|
|
5
|
+
* (`cli-design.md` §2.7 + §4.3 + §13 v0.4/v0.5 entries;
|
|
6
|
+
* `v0.4-plan.md` §3 M32; `v0.5-plan.md` §3 M35 + §8 D7-D9;
|
|
7
|
+
* `v0.5-plan.md` §3 M36 + §8 D10-D11; `v0.5-plan.md` §3 M37 + §8
|
|
8
|
+
* D12-D13).
|
|
9
|
+
*
|
|
10
|
+
* **Wire surface (empirical probe 2026-05-14, API `2026-01`).** Two
|
|
11
|
+
* Monday GraphQL operations land here, both against `Query.docs(...)`:
|
|
12
|
+
*
|
|
13
|
+
* - **List variant** — `Query.docs(workspace_ids: [ID],
|
|
14
|
+
* order_by: DocsOrderBy, limit: Int, page: Int) → [Document]`.
|
|
15
|
+
* Page/limit pagination (NOT cursor — Monday's workdocs surface
|
|
16
|
+
* has no `items_page`-style cursor). Default `limit: 25` on the
|
|
17
|
+
* wire side; CLI caps `--limit` at `MAX_DOC_LIST_LIMIT = 100`
|
|
18
|
+
* to keep response sizes bounded (each Document is rich-text
|
|
19
|
+
* plus metadata, and a `--limit 500` request could blow past
|
|
20
|
+
* Monday's complexity budget on doc-heavy accounts). `--page`
|
|
21
|
+
* is 1-based.
|
|
22
|
+
* - **Get variant** — `Query.docs(ids: [ID!]) → [Document]` with
|
|
23
|
+
* the per-doc `blocks` selection hydrated. Returns at most one
|
|
24
|
+
* Document (single-id list). The CLI extracts the singleton
|
|
25
|
+
* index 0; an empty array surfaces `not_found` (D8 — Monday's
|
|
26
|
+
* wire collapses doesn't-exist + not-accessible into the same
|
|
27
|
+
* shape), while a null `docs` root surfaces `internal_error`
|
|
28
|
+
* with a drift hint (Monday's documented shape is `[Document]`,
|
|
29
|
+
* possibly empty, never null — null indicates wire-shape
|
|
30
|
+
* regression worth surfacing loudly). The
|
|
31
|
+
* `Document.blocks: [DocumentBlock]` selection adds significant
|
|
32
|
+
* payload, which is why `doc list` ships WITHOUT `blocks` and
|
|
33
|
+
* `doc get` is the per-doc body-hydrating path.
|
|
34
|
+
*
|
|
35
|
+
* **`Document` object — 14 fields.** Per the M32 empirical probe:
|
|
36
|
+
* `id` (ID!), `object_id` (ID!), `blocks` ([DocumentBlock]; null
|
|
37
|
+
* unless hydrated), `created_at` (Date, nullable), `created_by`
|
|
38
|
+
* (User, nullable — projected to the slim `{id, name}` shape for
|
|
39
|
+
* envelope compactness), `doc_folder_id` (ID, nullable),
|
|
40
|
+
* `doc_kind` (BoardKind!, returning `'public'`/`'private'`/
|
|
41
|
+
* `'share'` per the DocKind probe at API `2026-01` — non-null on
|
|
42
|
+
* the wire; the standalone `DocKind` enum exists but isn't
|
|
43
|
+
* returned by `Document.doc_kind`), `name` (String!),
|
|
44
|
+
* `relative_url` (String, nullable),
|
|
45
|
+
* `settings` (JSON, nullable), `updated_at` (Date, nullable),
|
|
46
|
+
* `url` (String, nullable absolute URL), `workspace` (Workspace,
|
|
47
|
+
* nullable — projected to `{id, name}`), `workspace_id` (ID,
|
|
48
|
+
* nullable). The `object_id` is Monday's internal opaque object
|
|
49
|
+
* identifier (distinct from `id`); both flow through verbatim.
|
|
50
|
+
*
|
|
51
|
+
* **BoardKind reuse for `Document.doc_kind`.** Monday's wire schema
|
|
52
|
+
* types `Document.doc_kind` as `BoardKind!` (NOT `DocKind!`) — the
|
|
53
|
+
* `BoardKind` enum is reused across `Board.kind` and
|
|
54
|
+
* `Document.doc_kind`, returning the same three string values
|
|
55
|
+
* (`public`/`private`/`share`). The standalone `DocKind` enum exists
|
|
56
|
+
* on the schema but isn't returned by `Document.doc_kind`; it's a
|
|
57
|
+
* wire-side detail with no agent-visible asymmetry (the CLI surface
|
|
58
|
+
* mirrors the wire string values verbatim). Not a new R-NEW-41
|
|
59
|
+
* consumer — the wire-vs-CLI projection is symmetric.
|
|
60
|
+
*
|
|
61
|
+
* **`DocumentBlock` — 9 fields.** Per the M32 probe: `id` (String!),
|
|
62
|
+
* `type` (String, nullable — block type like `'text'` / `'heading'`
|
|
63
|
+
* / `'list'` / etc., values stay verbatim from Monday's wire),
|
|
64
|
+
* `content` (JSON, nullable — block payload), `position` (Float,
|
|
65
|
+
* nullable — fractional ordering within doc), `parent_block_id`
|
|
66
|
+
* (String, nullable — for nested blocks), `doc_id` (ID, nullable),
|
|
67
|
+
* `created_at` (Date, nullable), `created_by` (User, nullable —
|
|
68
|
+
* projected to slim `{id, name}`), `updated_at` (Date, nullable).
|
|
69
|
+
* Block-content schema validity is NOT cross-checked by the CLI;
|
|
70
|
+
* Monday's wire is the source of truth for what blocks look like.
|
|
71
|
+
*
|
|
72
|
+
* **`DocsOrderBy` enum — 2 values.** `created_at` (most-recently-
|
|
73
|
+
* created first; Monday's documented `desc` ordering) and `used_at`
|
|
74
|
+
* (most-recently-viewed-by-current-user first; also `desc`). No
|
|
75
|
+
* ascending variant on Monday's wire — agents that need ascending
|
|
76
|
+
* sort the projection client-side. Default CLI behaviour: `created_
|
|
77
|
+
* at` (matches Monday's wire default at API `2026-01`).
|
|
78
|
+
*
|
|
79
|
+
* **No new ERROR_CODES (29 stays — D8 closure).** Doc-read failures
|
|
80
|
+
* route through existing codes:
|
|
81
|
+
*
|
|
82
|
+
* - `not_found` — `doc get <did>` against a non-existent or
|
|
83
|
+
* inaccessible doc ID. Monday's wire returns an empty `docs`
|
|
84
|
+
* array for both "doesn't exist" and "exists but token can't
|
|
85
|
+
* read it"; the CLI surfaces both as `not_found` with
|
|
86
|
+
* `details.doc_id`.
|
|
87
|
+
* - `usage_error` — argv-parse rejections (out-of-range `--limit`
|
|
88
|
+
* / `--page`, malformed `--workspace`, unknown `--order-by`).
|
|
89
|
+
* Caught at parse boundary BEFORE any wire call.
|
|
90
|
+
* - `validation_failed` — Monday-side rejection (very rare for
|
|
91
|
+
* reads; included for completeness).
|
|
92
|
+
* - `forbidden` / `unauthorized` — token lacks workdoc read scope.
|
|
93
|
+
*
|
|
94
|
+
* **Docs are live-only at v0.4-M32.** Per cli-design §8 cache scope,
|
|
95
|
+
* workdocs aren't cached — the `doc list` + `doc get` paths emit
|
|
96
|
+
* `meta.source: "live"` with `cache_age_seconds: null`. Workdocs
|
|
97
|
+
* are content-heavy + frequently human-edited, so caching would
|
|
98
|
+
* regularly surface stale prose. Mirrors `monday usage` (M22) +
|
|
99
|
+
* `monday status` (M22) + webhook list (M27) — diagnostics /
|
|
100
|
+
* volatile surfaces don't cache.
|
|
101
|
+
*
|
|
102
|
+
* **Runtime bodies landed at v0.4-M32 IMPL.** `listDocuments` +
|
|
103
|
+
* `getDocument` each issue a single `client.raw` round-trip with
|
|
104
|
+
* `operationName: 'ListDocs'` / `'GetDoc'` pinned literally at the
|
|
105
|
+
* fetcher boundary (R-NEW-37 W2 audit-point — operationNames are
|
|
106
|
+
* NOT caller-overridable). Responses parse through
|
|
107
|
+
* {@link documentSchema} / {@link documentWithBlocksSchema} via
|
|
108
|
+
* `unwrapOrThrow`, so payload drift surfaces `internal_error` with
|
|
109
|
+
* `details.issues`. The `doc get` empty-array case rewraps to
|
|
110
|
+
* `not_found` with `details.doc_id` per D8 (Monday's wire collapses
|
|
111
|
+
* "doesn't exist" + "not visible to token" into the same shape).
|
|
112
|
+
*
|
|
113
|
+
* **v0.5-M35 mutation surface (empirical probe 2026-05-15, API
|
|
114
|
+
* `2026-01`; v0.5 kickoff rounds 1-3).** Five CLI verbs land here
|
|
115
|
+
* at v0.5-M35, backed by four Monday GraphQL mutations —
|
|
116
|
+
* `create_doc` (2 CLI verbs because Monday's `CreateDocInput` is
|
|
117
|
+
* mutually-exclusive `board` vs `workspace` per D7) +
|
|
118
|
+
* `update_doc_name` + `delete_doc` + `duplicate_doc`. All four
|
|
119
|
+
* wire mutations are synchronous on Monday's wire — the v0.4-W1
|
|
120
|
+
* `dispatchPollingLoop` watch-item DOES NOT fire here.
|
|
121
|
+
*
|
|
122
|
+
* - **Create-in-workspace variant** — `create_doc(location:
|
|
123
|
+
* CreateDocInput!) → Document` with `location: { workspace:
|
|
124
|
+
* CreateDocWorkspaceInput { workspace_id!, name!, kind?:
|
|
125
|
+
* BoardKind, folder_id? } }`. CLI envelope OMITS the wire's
|
|
126
|
+
* `blocks` slot entirely (the base 13-field
|
|
127
|
+
* {@link documentSchema} M32 pin is the create projection).
|
|
128
|
+
* Monday returns `blocks: null` on a fresh create — agents
|
|
129
|
+
* needing block hydration (rare on a fresh create — usually
|
|
130
|
+
* the next step is content authoring) call `monday doc get
|
|
131
|
+
* <new-doc-id>` per the M32 read cadence.
|
|
132
|
+
* - **Create-on-column variant** — `create_doc(location:
|
|
133
|
+
* CreateDocInput!) → Document` with `location: { board:
|
|
134
|
+
* CreateDocBoardInput { column_id!, item_id! } }`.
|
|
135
|
+
* - **Rename variant** — `update_doc_name(docId: ID!,
|
|
136
|
+
* name: String!) → JSON` (opaque scalar). Returns wire-side
|
|
137
|
+
* opaque payload; the CLI projects to flat `{ doc_id: <input>,
|
|
138
|
+
* success: true }` envelope at the fetcher boundary per D9.
|
|
139
|
+
* The agent contract is the projected envelope shape, NOT the
|
|
140
|
+
* opaque Monday return value.
|
|
141
|
+
* - **Delete variant** — `delete_doc(docId: ID!) → JSON`
|
|
142
|
+
* (opaque). Same `{ doc_id, success }` projection per D9.
|
|
143
|
+
* Destructive gate per cli-design §3.1 (M35 verb requires
|
|
144
|
+
* `--yes`).
|
|
145
|
+
* - **Duplicate variant** — `duplicate_doc(docId: ID!,
|
|
146
|
+
* duplicateType?: DuplicateType) → JSON` (opaque). Same
|
|
147
|
+
* `{ doc_id, success }` projection per D9. `--with-updates`
|
|
148
|
+
* argv flag flips wire `duplicateType` from
|
|
149
|
+
* `duplicate_doc_with_content` (default) to
|
|
150
|
+
* `duplicate_doc_with_content_and_updates`. **No `--name <n>`
|
|
151
|
+
* rename slot per D8** — Monday's `duplicate_doc` mutation
|
|
152
|
+
* carries no name-override arg on the wire, so the CLI defers
|
|
153
|
+
* the rename-on-duplicate UX (an agent that needs a renamed
|
|
154
|
+
* duplicate pairs the verb with a follow-up `monday doc
|
|
155
|
+
* rename <new-id> --name <n>` call).
|
|
156
|
+
*
|
|
157
|
+
* **`CreateDocInput` is mutually-exclusive on Monday's wire.**
|
|
158
|
+
* Per Finding 6 + round-3 nested-inputs probe, supplying both
|
|
159
|
+
* `board` AND `workspace` slots fails server-side. The CLI's
|
|
160
|
+
* two-verb split (`monday doc create-in-workspace` vs `monday doc
|
|
161
|
+
* create-on-column`) flows the mutual-exclusion into the argv
|
|
162
|
+
* boundary — each verb's input schema declares the slot it
|
|
163
|
+
* supports, and there's no way to set both via the CLI surface.
|
|
164
|
+
* Single verb with `--workspace` / `--board` choosers was the
|
|
165
|
+
* D7 alternative; pre-flight ratified the two-verb shape per the
|
|
166
|
+
* agent-UX principle of "fewer ambiguous flags is clearer than
|
|
167
|
+
* one verb with mutually-exclusive choosers" (mirrors how the
|
|
168
|
+
* v0.4 cli-design ships separate `monday item upload` /
|
|
169
|
+
* `monday update upload` verbs for the same multipart wire path).
|
|
170
|
+
*
|
|
171
|
+
* **camelCase vs snake_case asymmetry across the doc-mutation
|
|
172
|
+
* surface (Finding 7).** Monday's `update_doc_name` /
|
|
173
|
+
* `delete_doc` / `duplicate_doc` mutations use **camelCase** arg
|
|
174
|
+
* names (`docId`, `duplicateType`) on the wire — distinct from
|
|
175
|
+
* the snake_case `doc_id` Monday uses for `Document` field names
|
|
176
|
+
* elsewhere on the schema. The fetcher boundary uses the wire's
|
|
177
|
+
* camelCase variable shape verbatim; the CLI argv stays kebab-case
|
|
178
|
+
* throughout (`--name <n>`, `--with-updates`); the error envelope
|
|
179
|
+
* `details.*` keys stay snake_case per cli-design §6.5 (e.g.
|
|
180
|
+
* `details.doc_id`). The asymmetry is wire-side and stays at the
|
|
181
|
+
* fetcher boundary; agents see camelCase nowhere. Cross-link to
|
|
182
|
+
* `docs/architecture.md` "Wire-vs-CLI semantics documentation
|
|
183
|
+
* conventions" — 4th supporting site for R-NEW-41 (camelCase vs
|
|
184
|
+
* snake_case arg-name asymmetry; R-v0.5-NEW-3 graduation candidate
|
|
185
|
+
* at v0.5-plan §22).
|
|
186
|
+
*
|
|
187
|
+
* **Opaque-JSON return shape (D9 closure).** 3 of 4 M35 mutations
|
|
188
|
+
* return Monday's `JSON` scalar — an untyped wire payload whose
|
|
189
|
+
* exact shape isn't pinned by introspection. The CLI projects to
|
|
190
|
+
* a flat `{ doc_id: string, success: true }` envelope at the
|
|
191
|
+
* fetcher boundary so agents read a uniform shape across rename /
|
|
192
|
+
* delete / duplicate; `success` is pinned literal-`true` because
|
|
193
|
+
* Monday surfaces failure via GraphQL `errors[]` (mapped to typed
|
|
194
|
+
* `ApiError`s upstream), not via a wire-side success flag.
|
|
195
|
+
*
|
|
196
|
+
* Per-fetcher null-payload semantics ARE asymmetric (round-1 P2-1
|
|
197
|
+
* closure):
|
|
198
|
+
*
|
|
199
|
+
* - **`renameDoc` (`update_doc_name`)** — present-but-null
|
|
200
|
+
* payload → success envelope. Monday's probe description
|
|
201
|
+
* carries NO "returns X" prose, so null is plausibly an
|
|
202
|
+
* empty-success indicator.
|
|
203
|
+
* - **`deleteDoc` (`delete_doc`)** — present-but-null payload
|
|
204
|
+
* → `not_found`. Probe description: "Returns success status
|
|
205
|
+
* and the deleted document ID" — null indicates the source
|
|
206
|
+
* doc was bogus or already-deleted.
|
|
207
|
+
* - **`duplicateDoc` (`duplicate_doc`)** — present-but-null
|
|
208
|
+
* payload → `not_found`. Probe description: "Returns the new
|
|
209
|
+
* document's ID on success" — null indicates the source
|
|
210
|
+
* wasn't duplicable.
|
|
211
|
+
*
|
|
212
|
+
* Missing-root-key cases for all three uniformly throw
|
|
213
|
+
* `internal_error` via `assertResponseFieldPresent` (schema
|
|
214
|
+
* drift). For `duplicate_doc`, the projected `doc_id` is the
|
|
215
|
+
* **NEWLY-CREATED doc's id** extracted from the opaque JSON via
|
|
216
|
+
* {@link extractDuplicateDocId} — defensive across multiple
|
|
217
|
+
* plausible wire shapes (bare string / number / record-with-`id`
|
|
218
|
+
* / `doc_id` / `new_doc_id`). Capturing a live duplicate-doc wire
|
|
219
|
+
* response would let a future revision narrow the helper's
|
|
220
|
+
* accepted shapes; today's helper is constructed against the
|
|
221
|
+
* read-only probe + Monday's wire description, not a live wire
|
|
222
|
+
* response.
|
|
223
|
+
*
|
|
224
|
+
* **No new ERROR_CODES at M35.** Existing codes route doc-mutation
|
|
225
|
+
* failures: `not_found` (rename/delete/duplicate against a
|
|
226
|
+
* non-existent or inaccessible doc), `usage_error` (argv-parse
|
|
227
|
+
* rejections — bad DocId, missing `--name`, unknown `--kind`),
|
|
228
|
+
* `validation_failed` (Monday-side rejection, e.g. workspace
|
|
229
|
+
* lacks doc-create permission), `forbidden`/`unauthorized` (token
|
|
230
|
+
* lacks workdoc write scope), `confirmation_required` (destructive
|
|
231
|
+
* gate on `doc delete` missing `--yes`).
|
|
232
|
+
*
|
|
233
|
+
* **Doc mutations are live-only at v0.5-M35.** Pure-mutation
|
|
234
|
+
* surfaces don't cache by definition (cli-design §8); `meta.source:
|
|
235
|
+
* "live"`. Dry-run paths emit `meta.source: "none"` per §6.4
|
|
236
|
+
* mutation-dry-run discipline.
|
|
237
|
+
*
|
|
238
|
+
* **Runtime bodies landed at v0.5-M35 IMPL.** All five fetchers
|
|
239
|
+
* issue a single `client.raw` round-trip with their pinned
|
|
240
|
+
* `operationName`; responses parse through the wrapping schemas
|
|
241
|
+
* via `unwrapOrThrow` + `assertResponseFieldPresent`, then either
|
|
242
|
+
* unwrap the per-Document payload (create variants) or project
|
|
243
|
+
* the opaque JSON return to the flat `{ doc_id, success: true }`
|
|
244
|
+
* envelope (rename / delete / duplicate per D9). The
|
|
245
|
+
* `duplicate_doc` projection extracts the new doc id from the
|
|
246
|
+
* opaque JSON via {@link extractDuplicateDocId} — defensive
|
|
247
|
+
* across common wire shapes (bare string, `{id}`, `{doc_id}`,
|
|
248
|
+
* `{new_doc_id}`); unrecognised shapes surface `internal_error`
|
|
249
|
+
* with a re-probe hint.
|
|
250
|
+
*
|
|
251
|
+
* **R-NEW-76 discipline preserved** across all 5 M35 command
|
|
252
|
+
* action bodies — `parseArgv` fires BEFORE `resolveClient` on
|
|
253
|
+
* every verb so invalid argv surfaces `usage_error` from the
|
|
254
|
+
* parse boundary, ahead of any `config_error` from a missing
|
|
255
|
+
* token. `doc delete` additionally calls `parseGlobalFlags` +
|
|
256
|
+
* `enforceDestructiveGate` BEFORE `resolveClient` (the gate
|
|
257
|
+
* needs the parsed global flags to check `--yes`; M10 round-1
|
|
258
|
+
* P2 invariant); the other four verbs let `resolveClient` parse
|
|
259
|
+
* global flags internally before `loadConfig` runs. M35 verbs
|
|
260
|
+
* do not consume comma-separated brand-list flags
|
|
261
|
+
* (`parseBrandedListArg` is an M34 team-writer / M32 `doc list
|
|
262
|
+
* --workspace` helper); the M35
|
|
263
|
+
* surface doesn't need it.
|
|
264
|
+
*/
|
|
265
|
+
import { z } from 'zod';
|
|
266
|
+
import type { MondayClient } from './client.js';
|
|
267
|
+
import type { Complexity } from '../utils/output/envelope.js';
|
|
268
|
+
/**
|
|
269
|
+
* Inclusive range for the `--limit` argv slot on `monday doc list`.
|
|
270
|
+
* Default `25` matches Monday's wire-side default at API `2026-01`
|
|
271
|
+
* (per the M32 empirical probe `Query.docs.args.limit.description`:
|
|
272
|
+
* "Number of items to get, the default is 25"); ceiling `100` keeps
|
|
273
|
+
* worst-case response sizes bounded for doc-heavy accounts (a
|
|
274
|
+
* `--limit 500` request would multiply payload across 500 rich-text
|
|
275
|
+
* Document records, easily blowing Monday's complexity budget).
|
|
276
|
+
*/
|
|
277
|
+
export declare const MIN_DOC_LIST_LIMIT = 1;
|
|
278
|
+
export declare const MAX_DOC_LIST_LIMIT = 100;
|
|
279
|
+
export declare const DEFAULT_DOC_LIST_LIMIT = 25;
|
|
280
|
+
/**
|
|
281
|
+
* Monday's `DocsOrderBy` enum vocabulary (empirical probe 2026-05-14,
|
|
282
|
+
* API `2026-01`; 2 values). Pinned at M32 pre-flight as a closed
|
|
283
|
+
* literal-union enum so unknown `--order-by` values reject at parse
|
|
284
|
+
* boundary with `usage_error`.
|
|
285
|
+
*
|
|
286
|
+
* Both values sort `desc` on Monday's wire (most-recent first); no
|
|
287
|
+
* ascending variant is exposed. Adding a third value to Monday's
|
|
288
|
+
* enum is a minor (additive) bump for the CLI — extend this list +
|
|
289
|
+
* the per-command flag help.
|
|
290
|
+
*/
|
|
291
|
+
export declare const DOCS_ORDER_BY: readonly ["created_at", "used_at"];
|
|
292
|
+
export type DocsOrderBy = (typeof DOCS_ORDER_BY)[number];
|
|
293
|
+
export declare const docsOrderBySchema: z.ZodEnum<{
|
|
294
|
+
created_at: "created_at";
|
|
295
|
+
used_at: "used_at";
|
|
296
|
+
}>;
|
|
297
|
+
export declare const DEFAULT_DOCS_ORDER_BY: DocsOrderBy;
|
|
298
|
+
/**
|
|
299
|
+
* Slim projection of Monday's `User` for the `Document.created_by` +
|
|
300
|
+
* `DocumentBlock.created_by` slots. Mirrors the M19 `account_tags`
|
|
301
|
+
* + M31 `Asset.uploaded_by` slim-User cadence: `{id, name}` only,
|
|
302
|
+
* keeping envelope size bounded. Full-User reads route through
|
|
303
|
+
* `monday user get <uid>`.
|
|
304
|
+
*/
|
|
305
|
+
export declare const docUserSchema: z.ZodObject<{
|
|
306
|
+
id: z.ZodString;
|
|
307
|
+
name: z.ZodString;
|
|
308
|
+
}, z.core.$strict>;
|
|
309
|
+
export type DocUser = z.infer<typeof docUserSchema>;
|
|
310
|
+
/**
|
|
311
|
+
* Slim projection of Monday's `Workspace` for the `Document.workspace`
|
|
312
|
+
* slot. Same `{id, name}` shape as {@link docUserSchema}. Full-
|
|
313
|
+
* Workspace reads route through `monday workspace get <wid>`.
|
|
314
|
+
*/
|
|
315
|
+
export declare const docWorkspaceSchema: z.ZodObject<{
|
|
316
|
+
id: z.ZodString;
|
|
317
|
+
name: z.ZodString;
|
|
318
|
+
}, z.core.$strict>;
|
|
319
|
+
export type DocWorkspace = z.infer<typeof docWorkspaceSchema>;
|
|
320
|
+
/**
|
|
321
|
+
* `doc_kind` literal-union enum (3 values per the M32 probe + the
|
|
322
|
+
* DocKind introspection result). Monday's wire types this field as
|
|
323
|
+
* `BoardKind!` — see the module header's "BoardKind reuse" note for
|
|
324
|
+
* the wire-side type-name aliasing. The CLI surface mirrors the
|
|
325
|
+
* three string values verbatim with no projection drift.
|
|
326
|
+
*/
|
|
327
|
+
export declare const DOC_KIND_VALUES: readonly ["public", "private", "share"];
|
|
328
|
+
export type DocKind = (typeof DOC_KIND_VALUES)[number];
|
|
329
|
+
export declare const docKindSchema: z.ZodEnum<{
|
|
330
|
+
public: "public";
|
|
331
|
+
private: "private";
|
|
332
|
+
share: "share";
|
|
333
|
+
}>;
|
|
334
|
+
/**
|
|
335
|
+
* DocumentBlock projection — Monday's 9-field block shape per the
|
|
336
|
+
* M32 probe. `content` is `JSON` on the wire (block payload — schema
|
|
337
|
+
* varies per `type`); the CLI passes it through unmodified as
|
|
338
|
+
* `unknown` so agents introspect the per-block-type payload
|
|
339
|
+
* themselves (Monday's wire is the source of truth for the per-
|
|
340
|
+
* block-type schema).
|
|
341
|
+
*
|
|
342
|
+
* Only surfaces under `doc get` envelopes (the per-doc body-hydrating
|
|
343
|
+
* path); `doc list` envelopes ship Documents WITHOUT `blocks` per
|
|
344
|
+
* the D6 list-row-projection closure.
|
|
345
|
+
*/
|
|
346
|
+
export declare const documentBlockSchema: z.ZodObject<{
|
|
347
|
+
id: z.ZodString;
|
|
348
|
+
type: z.ZodNullable<z.ZodString>;
|
|
349
|
+
content: z.ZodUnknown & z.ZodType<{} | null, unknown, z.core.$ZodTypeInternals<{} | null, unknown>>;
|
|
350
|
+
position: z.ZodNullable<z.ZodNumber>;
|
|
351
|
+
parent_block_id: z.ZodNullable<z.ZodString>;
|
|
352
|
+
doc_id: z.ZodNullable<z.ZodString>;
|
|
353
|
+
created_at: z.ZodNullable<z.ZodString>;
|
|
354
|
+
created_by: z.ZodNullable<z.ZodObject<{
|
|
355
|
+
id: z.ZodString;
|
|
356
|
+
name: z.ZodString;
|
|
357
|
+
}, z.core.$strict>>;
|
|
358
|
+
updated_at: z.ZodNullable<z.ZodString>;
|
|
359
|
+
}, z.core.$strict>;
|
|
360
|
+
export type DocumentBlock = z.infer<typeof documentBlockSchema>;
|
|
361
|
+
/**
|
|
362
|
+
* Base Document projection (13 fields — all of Monday's 14 minus
|
|
363
|
+
* `blocks`). Used as the list-row shape under `doc list` envelopes;
|
|
364
|
+
* appended with the required `blocks: [DocumentBlock]` slot for
|
|
365
|
+
* `doc get` envelopes via {@link documentWithBlocksSchema} (the
|
|
366
|
+
* extension makes `blocks` mandatory — `doc get` always hydrates
|
|
367
|
+
* the rich-text body per D6).
|
|
368
|
+
*
|
|
369
|
+
* `settings` is `JSON` on the wire (per-doc display/sharing config)
|
|
370
|
+
* — passed through as `unknown` for the same reason
|
|
371
|
+
* `DocumentBlock.content` is. Agents that need a specific settings
|
|
372
|
+
* key destructure client-side.
|
|
373
|
+
*/
|
|
374
|
+
export declare const documentSchema: z.ZodObject<{
|
|
375
|
+
id: z.ZodString;
|
|
376
|
+
object_id: z.ZodString;
|
|
377
|
+
name: z.ZodString;
|
|
378
|
+
doc_kind: z.ZodEnum<{
|
|
379
|
+
public: "public";
|
|
380
|
+
private: "private";
|
|
381
|
+
share: "share";
|
|
382
|
+
}>;
|
|
383
|
+
url: z.ZodNullable<z.ZodString>;
|
|
384
|
+
relative_url: z.ZodNullable<z.ZodString>;
|
|
385
|
+
workspace_id: z.ZodNullable<z.ZodString>;
|
|
386
|
+
workspace: z.ZodNullable<z.ZodObject<{
|
|
387
|
+
id: z.ZodString;
|
|
388
|
+
name: z.ZodString;
|
|
389
|
+
}, z.core.$strict>>;
|
|
390
|
+
doc_folder_id: z.ZodNullable<z.ZodString>;
|
|
391
|
+
created_at: z.ZodNullable<z.ZodString>;
|
|
392
|
+
created_by: z.ZodNullable<z.ZodObject<{
|
|
393
|
+
id: z.ZodString;
|
|
394
|
+
name: z.ZodString;
|
|
395
|
+
}, z.core.$strict>>;
|
|
396
|
+
updated_at: z.ZodNullable<z.ZodString>;
|
|
397
|
+
settings: z.ZodUnknown & z.ZodType<{} | null, unknown, z.core.$ZodTypeInternals<{} | null, unknown>>;
|
|
398
|
+
}, z.core.$strict>;
|
|
399
|
+
export type Document = z.infer<typeof documentSchema>;
|
|
400
|
+
/**
|
|
401
|
+
* `doc get` projection — base Document + the `blocks` slot hydrated.
|
|
402
|
+
* Same shape as {@link documentSchema} with `blocks:
|
|
403
|
+
* [DocumentBlock]` appended (Monday's wire returns the block array
|
|
404
|
+
* directly under `Document.blocks`; the CLI surfaces it verbatim).
|
|
405
|
+
*
|
|
406
|
+
* `blocks` is non-null on the wire when the selection is requested;
|
|
407
|
+
* an empty doc surfaces `blocks: []` rather than `null`. The schema
|
|
408
|
+
* pins non-null for envelope predictability — an unexpected null
|
|
409
|
+
* surfaces `internal_error` at the IMPL parse boundary.
|
|
410
|
+
*/
|
|
411
|
+
export declare const documentWithBlocksSchema: z.ZodObject<{
|
|
412
|
+
id: z.ZodString;
|
|
413
|
+
object_id: z.ZodString;
|
|
414
|
+
name: z.ZodString;
|
|
415
|
+
doc_kind: z.ZodEnum<{
|
|
416
|
+
public: "public";
|
|
417
|
+
private: "private";
|
|
418
|
+
share: "share";
|
|
419
|
+
}>;
|
|
420
|
+
url: z.ZodNullable<z.ZodString>;
|
|
421
|
+
relative_url: z.ZodNullable<z.ZodString>;
|
|
422
|
+
workspace_id: z.ZodNullable<z.ZodString>;
|
|
423
|
+
workspace: z.ZodNullable<z.ZodObject<{
|
|
424
|
+
id: z.ZodString;
|
|
425
|
+
name: z.ZodString;
|
|
426
|
+
}, z.core.$strict>>;
|
|
427
|
+
doc_folder_id: z.ZodNullable<z.ZodString>;
|
|
428
|
+
created_at: z.ZodNullable<z.ZodString>;
|
|
429
|
+
created_by: z.ZodNullable<z.ZodObject<{
|
|
430
|
+
id: z.ZodString;
|
|
431
|
+
name: z.ZodString;
|
|
432
|
+
}, z.core.$strict>>;
|
|
433
|
+
updated_at: z.ZodNullable<z.ZodString>;
|
|
434
|
+
settings: z.ZodUnknown & z.ZodType<{} | null, unknown, z.core.$ZodTypeInternals<{} | null, unknown>>;
|
|
435
|
+
blocks: z.ZodArray<z.ZodObject<{
|
|
436
|
+
id: z.ZodString;
|
|
437
|
+
type: z.ZodNullable<z.ZodString>;
|
|
438
|
+
content: z.ZodUnknown & z.ZodType<{} | null, unknown, z.core.$ZodTypeInternals<{} | null, unknown>>;
|
|
439
|
+
position: z.ZodNullable<z.ZodNumber>;
|
|
440
|
+
parent_block_id: z.ZodNullable<z.ZodString>;
|
|
441
|
+
doc_id: z.ZodNullable<z.ZodString>;
|
|
442
|
+
created_at: z.ZodNullable<z.ZodString>;
|
|
443
|
+
created_by: z.ZodNullable<z.ZodObject<{
|
|
444
|
+
id: z.ZodString;
|
|
445
|
+
name: z.ZodString;
|
|
446
|
+
}, z.core.$strict>>;
|
|
447
|
+
updated_at: z.ZodNullable<z.ZodString>;
|
|
448
|
+
}, z.core.$strict>>;
|
|
449
|
+
}, z.core.$strict>;
|
|
450
|
+
export type DocumentWithBlocks = z.infer<typeof documentWithBlocksSchema>;
|
|
451
|
+
/**
|
|
452
|
+
* Output shape for `monday doc list [--workspace <wid>,...]
|
|
453
|
+
* [--order-by <created_at|used_at>] [--limit <n>] [--page <n>]`.
|
|
454
|
+
* Wrapped record (NOT bare array) because page/limit pagination
|
|
455
|
+
* surfaces pagination context inline rather than via `meta.cursor`
|
|
456
|
+
* (cli-design §6.1 cursor slot is for items_page-style surfaces;
|
|
457
|
+
* the workdocs wire has no cursor).
|
|
458
|
+
*
|
|
459
|
+
* `documents` — Monday's wire-ordered array (server-applied
|
|
460
|
+
* `created_at desc` or `used_at desc` per `--order-by`).
|
|
461
|
+
* `page` / `limit` — echoed inputs confirming what the wire saw.
|
|
462
|
+
* `returned_count` — `documents.length` cached for agent ergonomics.
|
|
463
|
+
* `has_more` — heuristic `returned_count === limit`; Monday's wire
|
|
464
|
+
* doesn't surface a total count, so "exactly `limit` rows returned"
|
|
465
|
+
* is the only signal that a follow-up page exists. Agents
|
|
466
|
+
* pessimistically re-fetch with `page + 1` if `has_more: true`.
|
|
467
|
+
*/
|
|
468
|
+
export declare const docListOutputSchema: z.ZodObject<{
|
|
469
|
+
documents: z.ZodArray<z.ZodObject<{
|
|
470
|
+
id: z.ZodString;
|
|
471
|
+
object_id: z.ZodString;
|
|
472
|
+
name: z.ZodString;
|
|
473
|
+
doc_kind: z.ZodEnum<{
|
|
474
|
+
public: "public";
|
|
475
|
+
private: "private";
|
|
476
|
+
share: "share";
|
|
477
|
+
}>;
|
|
478
|
+
url: z.ZodNullable<z.ZodString>;
|
|
479
|
+
relative_url: z.ZodNullable<z.ZodString>;
|
|
480
|
+
workspace_id: z.ZodNullable<z.ZodString>;
|
|
481
|
+
workspace: z.ZodNullable<z.ZodObject<{
|
|
482
|
+
id: z.ZodString;
|
|
483
|
+
name: z.ZodString;
|
|
484
|
+
}, z.core.$strict>>;
|
|
485
|
+
doc_folder_id: z.ZodNullable<z.ZodString>;
|
|
486
|
+
created_at: z.ZodNullable<z.ZodString>;
|
|
487
|
+
created_by: z.ZodNullable<z.ZodObject<{
|
|
488
|
+
id: z.ZodString;
|
|
489
|
+
name: z.ZodString;
|
|
490
|
+
}, z.core.$strict>>;
|
|
491
|
+
updated_at: z.ZodNullable<z.ZodString>;
|
|
492
|
+
settings: z.ZodUnknown & z.ZodType<{} | null, unknown, z.core.$ZodTypeInternals<{} | null, unknown>>;
|
|
493
|
+
}, z.core.$strict>>;
|
|
494
|
+
page: z.ZodNumber;
|
|
495
|
+
limit: z.ZodNumber;
|
|
496
|
+
returned_count: z.ZodNumber;
|
|
497
|
+
has_more: z.ZodBoolean;
|
|
498
|
+
}, z.core.$strict>;
|
|
499
|
+
export type DocListOutput = z.infer<typeof docListOutputSchema>;
|
|
500
|
+
/**
|
|
501
|
+
* Output shape for `monday doc get <did>`. Direct unwrap of the
|
|
502
|
+
* single Document (with blocks hydrated) — matches the convention
|
|
503
|
+
* for read-one verbs (`monday board get <bid>` returns `data:
|
|
504
|
+
* <Board>`, `monday user get <uid>` returns `data: <User>`).
|
|
505
|
+
*
|
|
506
|
+
* The Document's own `id` field is the echoed input — no separate
|
|
507
|
+
* `doc_id` slot needed.
|
|
508
|
+
*/
|
|
509
|
+
export declare const docGetOutputSchema: z.ZodObject<{
|
|
510
|
+
id: z.ZodString;
|
|
511
|
+
object_id: z.ZodString;
|
|
512
|
+
name: z.ZodString;
|
|
513
|
+
doc_kind: z.ZodEnum<{
|
|
514
|
+
public: "public";
|
|
515
|
+
private: "private";
|
|
516
|
+
share: "share";
|
|
517
|
+
}>;
|
|
518
|
+
url: z.ZodNullable<z.ZodString>;
|
|
519
|
+
relative_url: z.ZodNullable<z.ZodString>;
|
|
520
|
+
workspace_id: z.ZodNullable<z.ZodString>;
|
|
521
|
+
workspace: z.ZodNullable<z.ZodObject<{
|
|
522
|
+
id: z.ZodString;
|
|
523
|
+
name: z.ZodString;
|
|
524
|
+
}, z.core.$strict>>;
|
|
525
|
+
doc_folder_id: z.ZodNullable<z.ZodString>;
|
|
526
|
+
created_at: z.ZodNullable<z.ZodString>;
|
|
527
|
+
created_by: z.ZodNullable<z.ZodObject<{
|
|
528
|
+
id: z.ZodString;
|
|
529
|
+
name: z.ZodString;
|
|
530
|
+
}, z.core.$strict>>;
|
|
531
|
+
updated_at: z.ZodNullable<z.ZodString>;
|
|
532
|
+
settings: z.ZodUnknown & z.ZodType<{} | null, unknown, z.core.$ZodTypeInternals<{} | null, unknown>>;
|
|
533
|
+
blocks: z.ZodArray<z.ZodObject<{
|
|
534
|
+
id: z.ZodString;
|
|
535
|
+
type: z.ZodNullable<z.ZodString>;
|
|
536
|
+
content: z.ZodUnknown & z.ZodType<{} | null, unknown, z.core.$ZodTypeInternals<{} | null, unknown>>;
|
|
537
|
+
position: z.ZodNullable<z.ZodNumber>;
|
|
538
|
+
parent_block_id: z.ZodNullable<z.ZodString>;
|
|
539
|
+
doc_id: z.ZodNullable<z.ZodString>;
|
|
540
|
+
created_at: z.ZodNullable<z.ZodString>;
|
|
541
|
+
created_by: z.ZodNullable<z.ZodObject<{
|
|
542
|
+
id: z.ZodString;
|
|
543
|
+
name: z.ZodString;
|
|
544
|
+
}, z.core.$strict>>;
|
|
545
|
+
updated_at: z.ZodNullable<z.ZodString>;
|
|
546
|
+
}, z.core.$strict>>;
|
|
547
|
+
}, z.core.$strict>;
|
|
548
|
+
export type DocGetOutput = DocumentWithBlocks;
|
|
549
|
+
/**
|
|
550
|
+
* GraphQL query document for `Query.docs(...)` listing variant.
|
|
551
|
+
* Operation name pinned literally to `ListDocs` and matches the
|
|
552
|
+
* wire `operationName` payload (R-NEW-37 W2 audit-point — caller-
|
|
553
|
+
* overridable operationName slots were closed at M27 IMPL round-1
|
|
554
|
+
* P2-1; M32 maintains the safely-by-construction shape).
|
|
555
|
+
*
|
|
556
|
+
* Selects every list-row field (no `blocks` selection — list rows
|
|
557
|
+
* project the 13-field base shape per D6). `workspace_ids:` typed
|
|
558
|
+
* as `[ID]` to mirror Monday's wire signature (the inner ID is
|
|
559
|
+
* nullable on Monday's side — an empirical-probe finding that
|
|
560
|
+
* doesn't show up in the contract today but stays preserved for
|
|
561
|
+
* future-proofing).
|
|
562
|
+
*/
|
|
563
|
+
export declare const LIST_DOCS_QUERY = "\n query ListDocs(\n $workspaceIds: [ID],\n $orderBy: DocsOrderBy,\n $limit: Int,\n $page: Int\n ) {\n docs(\n workspace_ids: $workspaceIds,\n order_by: $orderBy,\n limit: $limit,\n page: $page\n ) {\n id\n object_id\n name\n doc_kind\n url\n relative_url\n workspace_id\n workspace { id name }\n doc_folder_id\n created_at\n created_by { id name }\n updated_at\n settings\n }\n }\n";
|
|
564
|
+
/**
|
|
565
|
+
* GraphQL query document for `Query.docs(ids:)` single-id read
|
|
566
|
+
* variant. Operation name pinned to `GetDoc` (R-NEW-37 W2). Selects
|
|
567
|
+
* all base Document fields plus the `blocks` selection (the per-doc
|
|
568
|
+
* body-hydrating leg).
|
|
569
|
+
*
|
|
570
|
+
* Single-id wire shape — Monday returns `[Document]` (an array even
|
|
571
|
+
* for one id); the fetcher extracts index 0. An empty array
|
|
572
|
+
* (Monday's response for "doc not found" or "doc not visible to
|
|
573
|
+
* token") surfaces `not_found` with `details.doc_id`.
|
|
574
|
+
*/
|
|
575
|
+
export declare const GET_DOC_QUERY = "\n query GetDoc($ids: [ID!]!) {\n docs(ids: $ids) {\n id\n object_id\n name\n doc_kind\n url\n relative_url\n workspace_id\n workspace { id name }\n doc_folder_id\n created_at\n created_by { id name }\n updated_at\n settings\n blocks {\n id\n type\n content\n position\n parent_block_id\n doc_id\n created_at\n created_by { id name }\n updated_at\n }\n }\n }\n";
|
|
576
|
+
export interface ListDocumentsInputs {
|
|
577
|
+
readonly client: MondayClient;
|
|
578
|
+
/**
|
|
579
|
+
* Workspace ID filter slot — maps to wire `workspace_ids: [ID]`.
|
|
580
|
+
* Optional; absent → unfiltered (every visible doc across the
|
|
581
|
+
* account). Inaccessible workspace IDs surface as empty filter
|
|
582
|
+
* results (Monday's wire silently drops them — no resolver
|
|
583
|
+
* warning fires per D4 closure).
|
|
584
|
+
*/
|
|
585
|
+
readonly workspaceIds?: readonly string[];
|
|
586
|
+
/**
|
|
587
|
+
* Order slot — maps to wire `order_by: DocsOrderBy`. Defaults
|
|
588
|
+
* to `'created_at'` per Monday's wire default. Both values sort
|
|
589
|
+
* `desc` server-side.
|
|
590
|
+
*/
|
|
591
|
+
readonly orderBy?: DocsOrderBy;
|
|
592
|
+
/**
|
|
593
|
+
* Page size — `[1, 100]`, default `25`. Mirrors Monday's wire-
|
|
594
|
+
* side default; ceiling pins worst-case payload size per D3.
|
|
595
|
+
*/
|
|
596
|
+
readonly limit?: number;
|
|
597
|
+
/**
|
|
598
|
+
* 1-based page number. Default `1`. Page/limit pagination is the
|
|
599
|
+
* only mechanism the workdocs surface exposes (no cursor).
|
|
600
|
+
*/
|
|
601
|
+
readonly page?: number;
|
|
602
|
+
}
|
|
603
|
+
export interface ListDocumentsResult {
|
|
604
|
+
readonly documents: readonly Document[];
|
|
605
|
+
/**
|
|
606
|
+
* Echoed page input (defaults to `1` when caller omits). Surfaces
|
|
607
|
+
* into `data.page` so the agent sees what Monday actually
|
|
608
|
+
* received.
|
|
609
|
+
*/
|
|
610
|
+
readonly page: number;
|
|
611
|
+
/**
|
|
612
|
+
* Echoed limit input (defaults to {@link DEFAULT_DOC_LIST_LIMIT}
|
|
613
|
+
* when caller omits). Surfaces into `data.limit`.
|
|
614
|
+
*/
|
|
615
|
+
readonly limit: number;
|
|
616
|
+
readonly source: 'live';
|
|
617
|
+
readonly cacheAgeSeconds: null;
|
|
618
|
+
readonly complexity: Complexity | null;
|
|
619
|
+
}
|
|
620
|
+
/**
|
|
621
|
+
* Fetches the workdocs visible to the token via a single
|
|
622
|
+
* `Query.docs(...)` round-trip with `operationName: 'ListDocs'`
|
|
623
|
+
* (R-NEW-37 W2). Source is always `'live'` per cli-design §8 cache
|
|
624
|
+
* scope; workdocs aren't cached at v0.4 per D7.
|
|
625
|
+
*
|
|
626
|
+
* Variables map to Monday's wire `Query.docs(...)` args:
|
|
627
|
+
* `workspaceIds` → `workspace_ids: [ID]`; `orderBy` →
|
|
628
|
+
* `order_by: DocsOrderBy`; `limit` → `limit: Int`; `page` →
|
|
629
|
+
* `page: Int`. Omitted inputs drop the corresponding `$variable`
|
|
630
|
+
* so Monday's per-arg server-side default applies (rather than
|
|
631
|
+
* threading an explicit `null` that the wire treats as "field
|
|
632
|
+
* present").
|
|
633
|
+
*
|
|
634
|
+
* Echoed `page` / `limit` carry Monday's defaults when the caller
|
|
635
|
+
* omits them ({@link DEFAULT_DOC_LIST_LIMIT} for limit, `1` for
|
|
636
|
+
* page) so the envelope's pagination-invariant `.superRefine`
|
|
637
|
+
* sees consistent values regardless of which inputs the verb
|
|
638
|
+
* received.
|
|
639
|
+
*
|
|
640
|
+
* A null `docs` root surfaces `internal_error` (Monday's documented
|
|
641
|
+
* shape is `[Document]` even for empty accounts — the array, never
|
|
642
|
+
* null at this layer). Schema drift in the per-doc shape rewraps to
|
|
643
|
+
* `internal_error` with `details.issues` via `unwrapOrThrow`.
|
|
644
|
+
*/
|
|
645
|
+
export declare const listDocuments: (inputs: ListDocumentsInputs) => Promise<ListDocumentsResult>;
|
|
646
|
+
export interface GetDocumentInputs {
|
|
647
|
+
readonly client: MondayClient;
|
|
648
|
+
readonly docId: string;
|
|
649
|
+
}
|
|
650
|
+
export interface GetDocumentResult {
|
|
651
|
+
readonly document: DocumentWithBlocks;
|
|
652
|
+
readonly source: 'live';
|
|
653
|
+
readonly cacheAgeSeconds: null;
|
|
654
|
+
readonly complexity: Complexity | null;
|
|
655
|
+
}
|
|
656
|
+
/**
|
|
657
|
+
* Fetches a single workdoc by ID via a single `Query.docs(ids:)`
|
|
658
|
+
* round-trip with `operationName: 'GetDoc'` (R-NEW-37 W2). Returns
|
|
659
|
+
* the Document with `blocks` hydrated. Source is always `'live'`
|
|
660
|
+
* per cli-design §8 cache scope.
|
|
661
|
+
*
|
|
662
|
+
* Empty wire response (Monday's shape for "doc doesn't exist" OR
|
|
663
|
+
* "doc not visible to token") surfaces `not_found` with
|
|
664
|
+
* `details.doc_id` — no `forbidden` rewrap, because Monday's wire
|
|
665
|
+
* collapses the two cases into one shape and the CLI can't
|
|
666
|
+
* distinguish them per D8.
|
|
667
|
+
*
|
|
668
|
+
* A multi-element wire response (which Monday's `docs(ids:)`
|
|
669
|
+
* shouldn't return for a single-id query) surfaces `internal_error`
|
|
670
|
+
* as a defensive guard — the CLI assumes one doc per id and a
|
|
671
|
+
* count mismatch indicates a wire-shape regression worth surfacing
|
|
672
|
+
* loudly rather than silently dropping entries.
|
|
673
|
+
*/
|
|
674
|
+
export declare const getDocument: (inputs: GetDocumentInputs) => Promise<GetDocumentResult>;
|
|
675
|
+
/**
|
|
676
|
+
* Monday's `DuplicateType` enum vocabulary (empirical probe 2026-05-15,
|
|
677
|
+
* API `2026-01`; 2 values). Pinned at M35 pre-flight as a closed
|
|
678
|
+
* literal-union so unknown values reject at the parse boundary with
|
|
679
|
+
* `usage_error`.
|
|
680
|
+
*
|
|
681
|
+
* - `duplicate_doc_with_content` — clone the doc body only; comments
|
|
682
|
+
* and update history are NOT copied. Wire-side default when
|
|
683
|
+
* `duplicateType` is omitted.
|
|
684
|
+
* - `duplicate_doc_with_content_and_updates` — clone the doc body
|
|
685
|
+
* AND every comment / update thread attached to the source doc.
|
|
686
|
+
* Picks up Monday's "full backup" duplicate semantics.
|
|
687
|
+
*
|
|
688
|
+
* Maps to the CLI's boolean `--with-updates` flag at the M35
|
|
689
|
+
* `monday doc duplicate` argv boundary: absent → wire default
|
|
690
|
+
* (`duplicate_doc_with_content`, content-only); present → wire
|
|
691
|
+
* `duplicate_doc_with_content_and_updates`. The two-value enum
|
|
692
|
+
* stays internal to the fetcher — agents see a boolean opt-in, not
|
|
693
|
+
* the wire enum name.
|
|
694
|
+
*
|
|
695
|
+
* Adding a third value to Monday's enum is a minor (additive) bump
|
|
696
|
+
* for the CLI — extend this list + the fetcher mapping; the
|
|
697
|
+
* boolean argv stays.
|
|
698
|
+
*/
|
|
699
|
+
export declare const DUPLICATE_TYPE_VALUES: readonly ["duplicate_doc_with_content", "duplicate_doc_with_content_and_updates"];
|
|
700
|
+
export type DuplicateType = (typeof DUPLICATE_TYPE_VALUES)[number];
|
|
701
|
+
export declare const duplicateTypeSchema: z.ZodEnum<{
|
|
702
|
+
duplicate_doc_with_content: "duplicate_doc_with_content";
|
|
703
|
+
duplicate_doc_with_content_and_updates: "duplicate_doc_with_content_and_updates";
|
|
704
|
+
}>;
|
|
705
|
+
/**
|
|
706
|
+
* Projected envelope shape for the three opaque-JSON mutation
|
|
707
|
+
* results (`update_doc_name` / `delete_doc` / `duplicate_doc`).
|
|
708
|
+
* Per D9 closure, the CLI surfaces a flat `{ doc_id: string,
|
|
709
|
+
* success: true }` envelope so agents read a uniform shape across
|
|
710
|
+
* mutations — Monday's wire returns an opaque `JSON` scalar whose
|
|
711
|
+
* exact shape isn't pinned by introspection (the v0.5 doc-CRUD
|
|
712
|
+
* probe was read-only — no live mutation response was captured).
|
|
713
|
+
* The projection insulates agents from any wire-side shape drift;
|
|
714
|
+
* the runtime accepts plausible-defensive shapes today, and a
|
|
715
|
+
* future live wire response would narrow what the helper accepts.
|
|
716
|
+
*
|
|
717
|
+
* `success` is pinned to literal `true` because Monday surfaces
|
|
718
|
+
* failure via GraphQL `errors[]` (mapped to typed `ApiError`s at
|
|
719
|
+
* the transport layer); a JSON return that reaches this projection
|
|
720
|
+
* is by construction the success path. If Monday ever flips to a
|
|
721
|
+
* `success/error` result OBJECT shape for these mutations (mirroring
|
|
722
|
+
* `import_doc_from_html` / `add_content_to_doc_from_markdown` per
|
|
723
|
+
* Finding 6), the projection widens to a discriminated union — for
|
|
724
|
+
* today the literal-`true` form keeps the shape pinned.
|
|
725
|
+
*
|
|
726
|
+
* `doc_id` semantics differ per mutation:
|
|
727
|
+
*
|
|
728
|
+
* - `rename` / `delete` — echoes the input id (the operation
|
|
729
|
+
* targets that specific doc; success means it was renamed /
|
|
730
|
+
* deleted).
|
|
731
|
+
* - `duplicate` — emits the **NEWLY-CREATED** doc's id (Monday's
|
|
732
|
+
* `duplicate_doc` description: "Returns the new document's ID
|
|
733
|
+
* on success"; the fetcher extracts the new id from the
|
|
734
|
+
* opaque JSON via {@link extractDuplicateDocId}, which is
|
|
735
|
+
* defensive across plausible wire shapes today). The original
|
|
736
|
+
* source-doc id stays available via the argv positional.
|
|
737
|
+
*/
|
|
738
|
+
export declare const docMutationResultSchema: z.ZodObject<{
|
|
739
|
+
doc_id: z.ZodString;
|
|
740
|
+
success: z.ZodLiteral<true>;
|
|
741
|
+
}, z.core.$strict>;
|
|
742
|
+
export type DocMutationResult = z.infer<typeof docMutationResultSchema>;
|
|
743
|
+
/**
|
|
744
|
+
* Output shape for `monday doc create-in-workspace --workspace
|
|
745
|
+
* <wid> --name <n> [--folder <fid>] [--kind public|private|share]`.
|
|
746
|
+
* Direct unwrap of the created Document — `data: <Document>` per
|
|
747
|
+
* cli-design §6.1 single-record convention. The envelope OMITS
|
|
748
|
+
* the `blocks` slot entirely (the base {@link documentSchema} M32
|
|
749
|
+
* pin is the 13-field projection without `blocks`).
|
|
750
|
+
*
|
|
751
|
+
* **Rationale for the omit.** Monday's wire returns
|
|
752
|
+
* `blocks: null` on a fresh `create_doc` because a freshly-
|
|
753
|
+
* created doc has no rich-text body yet (Monday hasn't
|
|
754
|
+
* materialised it). Surfacing a constant-null `blocks` slot on
|
|
755
|
+
* every create envelope would add agent-noise — every caller
|
|
756
|
+
* has to ignore it. Agents that need block hydration (rare on a
|
|
757
|
+
* fresh create — usually the next step is content authoring)
|
|
758
|
+
* call `monday doc get <new-doc-id>` per the M32 read cadence.
|
|
759
|
+
* The omit is a contract decision, not a schema-flexibility
|
|
760
|
+
* artifact.
|
|
761
|
+
*/
|
|
762
|
+
export declare const docCreateInWorkspaceOutputSchema: z.ZodObject<{
|
|
763
|
+
id: z.ZodString;
|
|
764
|
+
object_id: z.ZodString;
|
|
765
|
+
name: z.ZodString;
|
|
766
|
+
doc_kind: z.ZodEnum<{
|
|
767
|
+
public: "public";
|
|
768
|
+
private: "private";
|
|
769
|
+
share: "share";
|
|
770
|
+
}>;
|
|
771
|
+
url: z.ZodNullable<z.ZodString>;
|
|
772
|
+
relative_url: z.ZodNullable<z.ZodString>;
|
|
773
|
+
workspace_id: z.ZodNullable<z.ZodString>;
|
|
774
|
+
workspace: z.ZodNullable<z.ZodObject<{
|
|
775
|
+
id: z.ZodString;
|
|
776
|
+
name: z.ZodString;
|
|
777
|
+
}, z.core.$strict>>;
|
|
778
|
+
doc_folder_id: z.ZodNullable<z.ZodString>;
|
|
779
|
+
created_at: z.ZodNullable<z.ZodString>;
|
|
780
|
+
created_by: z.ZodNullable<z.ZodObject<{
|
|
781
|
+
id: z.ZodString;
|
|
782
|
+
name: z.ZodString;
|
|
783
|
+
}, z.core.$strict>>;
|
|
784
|
+
updated_at: z.ZodNullable<z.ZodString>;
|
|
785
|
+
settings: z.ZodUnknown & z.ZodType<{} | null, unknown, z.core.$ZodTypeInternals<{} | null, unknown>>;
|
|
786
|
+
}, z.core.$strict>;
|
|
787
|
+
export type DocCreateInWorkspaceOutput = Document;
|
|
788
|
+
/**
|
|
789
|
+
* Output shape for `monday doc create-on-column --item <iid>
|
|
790
|
+
* --column <cid>`. Same shape as
|
|
791
|
+
* {@link docCreateInWorkspaceOutputSchema} — Monday's wire returns
|
|
792
|
+
* the full Document regardless of placement; the two-verb split
|
|
793
|
+
* (per D7) lives at the argv layer, not the response shape.
|
|
794
|
+
*/
|
|
795
|
+
export declare const docCreateOnColumnOutputSchema: z.ZodObject<{
|
|
796
|
+
id: z.ZodString;
|
|
797
|
+
object_id: z.ZodString;
|
|
798
|
+
name: z.ZodString;
|
|
799
|
+
doc_kind: z.ZodEnum<{
|
|
800
|
+
public: "public";
|
|
801
|
+
private: "private";
|
|
802
|
+
share: "share";
|
|
803
|
+
}>;
|
|
804
|
+
url: z.ZodNullable<z.ZodString>;
|
|
805
|
+
relative_url: z.ZodNullable<z.ZodString>;
|
|
806
|
+
workspace_id: z.ZodNullable<z.ZodString>;
|
|
807
|
+
workspace: z.ZodNullable<z.ZodObject<{
|
|
808
|
+
id: z.ZodString;
|
|
809
|
+
name: z.ZodString;
|
|
810
|
+
}, z.core.$strict>>;
|
|
811
|
+
doc_folder_id: z.ZodNullable<z.ZodString>;
|
|
812
|
+
created_at: z.ZodNullable<z.ZodString>;
|
|
813
|
+
created_by: z.ZodNullable<z.ZodObject<{
|
|
814
|
+
id: z.ZodString;
|
|
815
|
+
name: z.ZodString;
|
|
816
|
+
}, z.core.$strict>>;
|
|
817
|
+
updated_at: z.ZodNullable<z.ZodString>;
|
|
818
|
+
settings: z.ZodUnknown & z.ZodType<{} | null, unknown, z.core.$ZodTypeInternals<{} | null, unknown>>;
|
|
819
|
+
}, z.core.$strict>;
|
|
820
|
+
export type DocCreateOnColumnOutput = Document;
|
|
821
|
+
/**
|
|
822
|
+
* Output shape for `monday doc rename <doc-id> --name <n>`.
|
|
823
|
+
* Projected from Monday's opaque `JSON` scalar return per D9 — the
|
|
824
|
+
* fetcher emits `{ doc_id: <echoed>, success: true }`. Agents key
|
|
825
|
+
* off `ok: true` for retry/idempotency reasoning; the literal
|
|
826
|
+
* `success: true` slot exists for envelope-snapshot stability and
|
|
827
|
+
* future-proofing (if Monday ever surfaces a wire-side success
|
|
828
|
+
* flag, the schema widens to read the wire value rather than
|
|
829
|
+
* always emitting `true`).
|
|
830
|
+
*/
|
|
831
|
+
export declare const docRenameOutputSchema: z.ZodObject<{
|
|
832
|
+
doc_id: z.ZodString;
|
|
833
|
+
success: z.ZodLiteral<true>;
|
|
834
|
+
}, z.core.$strict>;
|
|
835
|
+
export type DocRenameOutput = DocMutationResult;
|
|
836
|
+
/**
|
|
837
|
+
* Output shape for `monday doc delete <doc-id> --yes`. Same
|
|
838
|
+
* `{ doc_id: <echoed>, success: true }` projection as rename per
|
|
839
|
+
* D9. The destructive-gate envelope sits at the action body —
|
|
840
|
+
* `confirmation_required` fires BEFORE this output schema is
|
|
841
|
+
* referenced (cli-design §3.1 #6).
|
|
842
|
+
*/
|
|
843
|
+
export declare const docDeleteOutputSchema: z.ZodObject<{
|
|
844
|
+
doc_id: z.ZodString;
|
|
845
|
+
success: z.ZodLiteral<true>;
|
|
846
|
+
}, z.core.$strict>;
|
|
847
|
+
export type DocDeleteOutput = DocMutationResult;
|
|
848
|
+
/**
|
|
849
|
+
* Output shape for `monday doc duplicate <doc-id> [--with-updates]`.
|
|
850
|
+
* Same flat `{ doc_id, success: true }` projection per D9, BUT the
|
|
851
|
+
* `doc_id` slot carries the **newly-created duplicate's id** — NOT
|
|
852
|
+
* the source-doc id. The verb's positional argv is the source-doc
|
|
853
|
+
* id; the wire returns the new id in its JSON payload, which
|
|
854
|
+
* {@link extractDuplicateDocId} pulls out (defensive across
|
|
855
|
+
* plausible shapes today; a future live wire response would
|
|
856
|
+
* narrow what the helper accepts).
|
|
857
|
+
*
|
|
858
|
+
* **No `--name <n>` slot per D8** — Monday's `duplicate_doc`
|
|
859
|
+
* mutation carries no rename-on-duplicate arg. Agents needing a
|
|
860
|
+
* renamed duplicate pair with a follow-up `monday doc rename
|
|
861
|
+
* <new-id> --name <n>` call.
|
|
862
|
+
*/
|
|
863
|
+
export declare const docDuplicateOutputSchema: z.ZodObject<{
|
|
864
|
+
doc_id: z.ZodString;
|
|
865
|
+
success: z.ZodLiteral<true>;
|
|
866
|
+
}, z.core.$strict>;
|
|
867
|
+
export type DocDuplicateOutput = DocMutationResult;
|
|
868
|
+
/**
|
|
869
|
+
* GraphQL mutation document for `create_doc(location: {workspace:
|
|
870
|
+
* ...})`. Operation name pinned to `CreateDocInWorkspace`
|
|
871
|
+
* (R-NEW-37 W2 audit-point — operationNames NOT caller-overridable).
|
|
872
|
+
* Selects every base-Document field per the M32 cadence; `blocks`
|
|
873
|
+
* deliberately omitted (Monday's wire returns `blocks: null` on a
|
|
874
|
+
* fresh create — see the module header's create-variant note).
|
|
875
|
+
*
|
|
876
|
+
* `$input: CreateDocInput!` carries the mutually-exclusive wire
|
|
877
|
+
* shape; the verb's action body composes
|
|
878
|
+
* `{ workspace: { workspace_id, name, folder_id?, kind? } }` from
|
|
879
|
+
* the parsed argv. The `board` slot stays unset at the wire — the
|
|
880
|
+
* two-verb CLI split (per D7) makes the mutual-exclusion safely-
|
|
881
|
+
* by-construction.
|
|
882
|
+
*/
|
|
883
|
+
export declare const CREATE_DOC_IN_WORKSPACE_MUTATION = "\n mutation CreateDocInWorkspace($input: CreateDocInput!) {\n create_doc(location: $input) {\n id\n object_id\n name\n doc_kind\n url\n relative_url\n workspace_id\n workspace { id name }\n doc_folder_id\n created_at\n created_by { id name }\n updated_at\n settings\n }\n }\n";
|
|
884
|
+
/**
|
|
885
|
+
* GraphQL mutation document for `create_doc(location: {board: ...})`.
|
|
886
|
+
* Operation name pinned to `CreateDocOnColumn` (R-NEW-37 W2). Same
|
|
887
|
+
* Document selection as {@link CREATE_DOC_IN_WORKSPACE_MUTATION};
|
|
888
|
+
* `$input: CreateDocInput!` is composed as `{ board: { column_id,
|
|
889
|
+
* item_id } }` at the action body. Distinct named operation per
|
|
890
|
+
* verb so the wire-side `operationName` payload mirrors the CLI
|
|
891
|
+
* verb name verbatim (agents tracing wire traffic can identify the
|
|
892
|
+
* verb without parsing the doc body).
|
|
893
|
+
*/
|
|
894
|
+
export declare const CREATE_DOC_ON_COLUMN_MUTATION = "\n mutation CreateDocOnColumn($input: CreateDocInput!) {\n create_doc(location: $input) {\n id\n object_id\n name\n doc_kind\n url\n relative_url\n workspace_id\n workspace { id name }\n doc_folder_id\n created_at\n created_by { id name }\n updated_at\n settings\n }\n }\n";
|
|
895
|
+
/**
|
|
896
|
+
* GraphQL mutation document for `update_doc_name(docId, name) →
|
|
897
|
+
* JSON`. Operation name pinned to `UpdateDocName` (R-NEW-37 W2).
|
|
898
|
+
* The wire return type is the opaque `JSON` scalar — no selection
|
|
899
|
+
* set per GraphQL grammar (scalars are leaves). The CLI projects
|
|
900
|
+
* the opaque value to the flat `{ doc_id, success }` envelope at
|
|
901
|
+
* the fetcher boundary per D9.
|
|
902
|
+
*
|
|
903
|
+
* `docId` + `name` are camelCase on Monday's wire per Finding 7;
|
|
904
|
+
* the variable names mirror the wire shape verbatim. CLI argv is
|
|
905
|
+
* `<doc-id>` positional + `--name <n>` flag (kebab-case throughout).
|
|
906
|
+
*/
|
|
907
|
+
export declare const UPDATE_DOC_NAME_MUTATION = "\n mutation UpdateDocName($docId: ID!, $name: String!) {\n update_doc_name(docId: $docId, name: $name)\n }\n";
|
|
908
|
+
/**
|
|
909
|
+
* GraphQL mutation document for `delete_doc(docId) → JSON`.
|
|
910
|
+
* Operation name pinned to `DeleteDoc` (R-NEW-37 W2). Wire return
|
|
911
|
+
* is opaque JSON — same projection cadence as
|
|
912
|
+
* {@link UPDATE_DOC_NAME_MUTATION}.
|
|
913
|
+
*
|
|
914
|
+
* **Destructive-gate ordering.** The verb's action body MUST call
|
|
915
|
+
* `enforceDestructiveGate` BEFORE this fetcher per the M10 round-1
|
|
916
|
+
* P2 invariant. A missing `--yes` surfaces as
|
|
917
|
+
* `confirmation_required` from the action layer, never masked by
|
|
918
|
+
* `config_error` when no token is configured.
|
|
919
|
+
*/
|
|
920
|
+
export declare const DELETE_DOC_MUTATION = "\n mutation DeleteDoc($docId: ID!) {\n delete_doc(docId: $docId)\n }\n";
|
|
921
|
+
/**
|
|
922
|
+
* GraphQL mutation document for `duplicate_doc(docId,
|
|
923
|
+
* duplicateType?) → JSON`. Operation name pinned to `DuplicateDoc`
|
|
924
|
+
* (R-NEW-37 W2). `duplicateType` is the optional 2-value enum
|
|
925
|
+
* (see {@link DUPLICATE_TYPE_VALUES}); when omitted at the variable
|
|
926
|
+
* boundary, Monday's wire-side default (`duplicate_doc_with_content`,
|
|
927
|
+
* content-only) applies.
|
|
928
|
+
*
|
|
929
|
+
* The verb's `--with-updates` boolean argv maps to:
|
|
930
|
+
* absent → omit the variable entirely (wire default applies);
|
|
931
|
+
* present → `duplicateType: 'duplicate_doc_with_content_and_updates'`.
|
|
932
|
+
* The omit-vs-null discipline mirrors M34 `team-create`'s
|
|
933
|
+
* `is_guest_team` handling — Monday treats a `null` variable as
|
|
934
|
+
* "field present with null value" rather than "field omitted".
|
|
935
|
+
*
|
|
936
|
+
* Wire return is opaque JSON — same projection cadence as the
|
|
937
|
+
* rename + delete mutations.
|
|
938
|
+
*/
|
|
939
|
+
export declare const DUPLICATE_DOC_MUTATION = "\n mutation DuplicateDoc($docId: ID!, $duplicateType: DuplicateType) {\n duplicate_doc(docId: $docId, duplicateType: $duplicateType)\n }\n";
|
|
940
|
+
export interface CreateDocInWorkspaceInputs {
|
|
941
|
+
readonly client: MondayClient;
|
|
942
|
+
readonly workspaceId: string;
|
|
943
|
+
readonly name: string;
|
|
944
|
+
readonly folderId?: string;
|
|
945
|
+
readonly kind?: DocKind;
|
|
946
|
+
}
|
|
947
|
+
export interface CreateDocInWorkspaceResult {
|
|
948
|
+
readonly document: Document;
|
|
949
|
+
readonly source: 'live';
|
|
950
|
+
readonly cacheAgeSeconds: null;
|
|
951
|
+
readonly complexity: Complexity | null;
|
|
952
|
+
}
|
|
953
|
+
/**
|
|
954
|
+
* Creates a workspace-scoped workdoc via `create_doc(location:
|
|
955
|
+
* { workspace: {...} })` with `operationName:
|
|
956
|
+
* 'CreateDocInWorkspace'` (R-NEW-37 W2). Returns the created
|
|
957
|
+
* Document with `id` populated post-create.
|
|
958
|
+
*
|
|
959
|
+
* The fetcher composes `location: { workspace: { workspace_id,
|
|
960
|
+
* name, folder_id?, kind? } }` from the inputs; `folderId` /
|
|
961
|
+
* `kind` are omitted entirely from the wire payload when unset
|
|
962
|
+
* (Monday's per-arg server-side defaults apply — null would be
|
|
963
|
+
* treated as "field present" rather than "field omitted",
|
|
964
|
+
* mirroring M34 `createTeam`'s discipline).
|
|
965
|
+
*
|
|
966
|
+
* A missing-key wire response surfaces `internal_error` via
|
|
967
|
+
* `assertResponseFieldPresent`; a null payload surfaces
|
|
968
|
+
* `internal_error` too — a successful `create_doc` mutation must
|
|
969
|
+
* return the created Document per Monday's documented contract.
|
|
970
|
+
*/
|
|
971
|
+
export declare const createDocInWorkspace: (inputs: CreateDocInWorkspaceInputs) => Promise<CreateDocInWorkspaceResult>;
|
|
972
|
+
export interface CreateDocOnColumnInputs {
|
|
973
|
+
readonly client: MondayClient;
|
|
974
|
+
readonly itemId: string;
|
|
975
|
+
readonly columnId: string;
|
|
976
|
+
}
|
|
977
|
+
export interface CreateDocOnColumnResult {
|
|
978
|
+
readonly document: Document;
|
|
979
|
+
readonly source: 'live';
|
|
980
|
+
readonly cacheAgeSeconds: null;
|
|
981
|
+
readonly complexity: Complexity | null;
|
|
982
|
+
}
|
|
983
|
+
/**
|
|
984
|
+
* Creates an item-scoped workdoc via `create_doc(location:
|
|
985
|
+
* { board: {...} })` with `operationName: 'CreateDocOnColumn'`
|
|
986
|
+
* (R-NEW-37 W2). Returns the created Document; the doc is
|
|
987
|
+
* embedded into the named column of the named item.
|
|
988
|
+
*
|
|
989
|
+
* The fetcher composes `location: { board: { column_id, item_id
|
|
990
|
+
* } }` from the inputs. Both slots are required on Monday's wire
|
|
991
|
+
* (`CreateDocBoardInput.column_id!` + `CreateDocBoardInput.
|
|
992
|
+
* item_id!`); the CLI verb's `--item <iid>` + `--column <cid>`
|
|
993
|
+
* flags are both required at the parse boundary.
|
|
994
|
+
*
|
|
995
|
+
* Failure modes mirror the workspace variant: missing-key
|
|
996
|
+
* response → `internal_error`; null payload → `internal_error`;
|
|
997
|
+
* column not configured for docs → `validation_failed` (Monday-
|
|
998
|
+
* side rejection — the CLI doesn't pre-check column-type
|
|
999
|
+
* compatibility, mirroring M8's `change_column_value` cadence).
|
|
1000
|
+
*/
|
|
1001
|
+
export declare const createDocOnColumn: (inputs: CreateDocOnColumnInputs) => Promise<CreateDocOnColumnResult>;
|
|
1002
|
+
export interface RenameDocInputs {
|
|
1003
|
+
readonly client: MondayClient;
|
|
1004
|
+
readonly docId: string;
|
|
1005
|
+
readonly name: string;
|
|
1006
|
+
}
|
|
1007
|
+
export interface RenameDocResult {
|
|
1008
|
+
readonly result: DocMutationResult;
|
|
1009
|
+
readonly source: 'live';
|
|
1010
|
+
readonly cacheAgeSeconds: null;
|
|
1011
|
+
readonly complexity: Complexity | null;
|
|
1012
|
+
}
|
|
1013
|
+
/**
|
|
1014
|
+
* Renames a workdoc via `update_doc_name(docId, name)` with
|
|
1015
|
+
* `operationName: 'UpdateDocName'` (R-NEW-37 W2). Projects
|
|
1016
|
+
* Monday's opaque JSON return into the flat
|
|
1017
|
+
* `{ doc_id: <echoed>, success: true }` envelope per D9.
|
|
1018
|
+
*
|
|
1019
|
+
* Failure modes:
|
|
1020
|
+
*
|
|
1021
|
+
* - **Missing `update_doc_name` key** → `internal_error` via
|
|
1022
|
+
* `assertResponseFieldPresent` (schema drift — Monday's
|
|
1023
|
+
* response shape regressed).
|
|
1024
|
+
* - **Present-but-null payload** → projected as success (the
|
|
1025
|
+
* `{doc_id, success: true}` envelope). Monday's probe
|
|
1026
|
+
* description for `update_doc_name` carries NO "returns X"
|
|
1027
|
+
* prose (unlike `delete_doc` which promises "success status
|
|
1028
|
+
* and the deleted document ID"), so a null wire payload is a
|
|
1029
|
+
* plausible empty-success indicator. If Monday returns a
|
|
1030
|
+
* typed error for non-existent doc IDs, that bubbles via
|
|
1031
|
+
* GraphQL `errors[]` (mapped to typed `ApiError`s upstream) —
|
|
1032
|
+
* a present-but-null JSON return reaching this projection is
|
|
1033
|
+
* by construction the success path. Distinct from
|
|
1034
|
+
* `deleteDoc` + `duplicateDoc` cadence which DO treat null
|
|
1035
|
+
* as `not_found` because their probe descriptions explicitly
|
|
1036
|
+
* promise a non-null return payload on success.
|
|
1037
|
+
* - **Typed Monday errors** (forbidden / not_found from a wire-
|
|
1038
|
+
* side `errors[]`) → bubble through the transport's error-
|
|
1039
|
+
* mapping layer.
|
|
1040
|
+
*/
|
|
1041
|
+
export declare const renameDoc: (inputs: RenameDocInputs) => Promise<RenameDocResult>;
|
|
1042
|
+
export interface DeleteDocInputs {
|
|
1043
|
+
readonly client: MondayClient;
|
|
1044
|
+
readonly docId: string;
|
|
1045
|
+
}
|
|
1046
|
+
export interface DeleteDocResult {
|
|
1047
|
+
readonly result: DocMutationResult;
|
|
1048
|
+
readonly source: 'live';
|
|
1049
|
+
readonly cacheAgeSeconds: null;
|
|
1050
|
+
readonly complexity: Complexity | null;
|
|
1051
|
+
}
|
|
1052
|
+
/**
|
|
1053
|
+
* Deletes a workdoc by ID via `delete_doc(docId)` with
|
|
1054
|
+
* `operationName: 'DeleteDoc'` (R-NEW-37 W2). Projects Monday's
|
|
1055
|
+
* opaque JSON return into the flat `{ doc_id: <echoed>,
|
|
1056
|
+
* success: true }` envelope per D9.
|
|
1057
|
+
*
|
|
1058
|
+
* A null `delete_doc` payload surfaces `not_found` — same
|
|
1059
|
+
* cadence as M34 team-delete + M14 workspace-delete. A missing
|
|
1060
|
+
* key surfaces `internal_error`.
|
|
1061
|
+
*
|
|
1062
|
+
* **Destructive-gate ordering.** The verb's action body MUST
|
|
1063
|
+
* call `enforceDestructiveGate` BEFORE this fetcher per the
|
|
1064
|
+
* M10 round-1 P2 invariant. A missing `--yes` surfaces as
|
|
1065
|
+
* `confirmation_required` from the action layer, never masked
|
|
1066
|
+
* by `config_error` when no token is configured.
|
|
1067
|
+
*/
|
|
1068
|
+
export declare const deleteDoc: (inputs: DeleteDocInputs) => Promise<DeleteDocResult>;
|
|
1069
|
+
export interface DuplicateDocInputs {
|
|
1070
|
+
readonly client: MondayClient;
|
|
1071
|
+
readonly docId: string;
|
|
1072
|
+
readonly duplicateType?: DuplicateType;
|
|
1073
|
+
}
|
|
1074
|
+
export interface DuplicateDocResult {
|
|
1075
|
+
readonly result: DocMutationResult;
|
|
1076
|
+
readonly source: 'live';
|
|
1077
|
+
readonly cacheAgeSeconds: null;
|
|
1078
|
+
readonly complexity: Complexity | null;
|
|
1079
|
+
}
|
|
1080
|
+
/**
|
|
1081
|
+
* Duplicates a workdoc by ID via `duplicate_doc(docId,
|
|
1082
|
+
* duplicateType?)` with `operationName: 'DuplicateDoc'`
|
|
1083
|
+
* (R-NEW-37 W2). Projects Monday's opaque JSON return into the
|
|
1084
|
+
* flat `{ doc_id: <NEW>, success: true }` envelope per D9 — the
|
|
1085
|
+
* `doc_id` slot carries the **newly-created duplicate's id**,
|
|
1086
|
+
* NOT the input source-doc id (the source id stays accessible
|
|
1087
|
+
* via the verb's positional argv).
|
|
1088
|
+
*
|
|
1089
|
+
* The fetcher omits the `duplicateType` variable entirely when
|
|
1090
|
+
* `inputs.duplicateType` is unset so Monday's wire-side default
|
|
1091
|
+
* applies (the M34 `team-create` omit-vs-null discipline). A
|
|
1092
|
+
* null `duplicate_doc` payload surfaces `not_found` (source
|
|
1093
|
+
* doc id bogus or inaccessible); missing key surfaces
|
|
1094
|
+
* `internal_error`. The new-id extraction tolerates several
|
|
1095
|
+
* common shapes Monday's opaque JSON might carry (bare string,
|
|
1096
|
+
* `{id}`, `{doc_id}`, `{new_doc_id}`) — anything else surfaces
|
|
1097
|
+
* `internal_error` with a re-probe hint.
|
|
1098
|
+
*/
|
|
1099
|
+
export declare const duplicateDoc: (inputs: DuplicateDocInputs) => Promise<DuplicateDocResult>;
|
|
1100
|
+
/**
|
|
1101
|
+
* Monday's `DocBlockContentType` enum vocabulary (empirical probe
|
|
1102
|
+
* 2026-05-15, API `2026-01`; 16 closed values per Finding 8). Pinned
|
|
1103
|
+
* at M36 pre-flight as a closed literal-union enum so unknown
|
|
1104
|
+
* `--type` values reject at the argv-parse boundary with
|
|
1105
|
+
* `usage_error.details.issues[]` (D10 closure).
|
|
1106
|
+
*
|
|
1107
|
+
* Adding a 17th value to Monday's enum is a minor (additive) bump
|
|
1108
|
+
* for the CLI — extend this list + the per-command flag help; the
|
|
1109
|
+
* per-block content schema documentation in `docs/output-shapes.md`
|
|
1110
|
+
* "Per-block content shapes" reference table gains a new row for
|
|
1111
|
+
* the new variant once a live cassette pins its shape (extending
|
|
1112
|
+
* the table is additive at any future v0.5.x patch).
|
|
1113
|
+
*/
|
|
1114
|
+
export declare const DOC_BLOCK_CONTENT_TYPE_VALUES: readonly ["bulleted_list", "check_list", "code", "divider", "image", "large_title", "layout", "medium_title", "normal_text", "notice_box", "numbered_list", "page_break", "quote", "small_title", "table", "video"];
|
|
1115
|
+
export type DocBlockContentType = (typeof DOC_BLOCK_CONTENT_TYPE_VALUES)[number];
|
|
1116
|
+
export declare const docBlockContentTypeSchema: z.ZodEnum<{
|
|
1117
|
+
code: "code";
|
|
1118
|
+
table: "table";
|
|
1119
|
+
bulleted_list: "bulleted_list";
|
|
1120
|
+
check_list: "check_list";
|
|
1121
|
+
divider: "divider";
|
|
1122
|
+
image: "image";
|
|
1123
|
+
large_title: "large_title";
|
|
1124
|
+
layout: "layout";
|
|
1125
|
+
medium_title: "medium_title";
|
|
1126
|
+
normal_text: "normal_text";
|
|
1127
|
+
notice_box: "notice_box";
|
|
1128
|
+
numbered_list: "numbered_list";
|
|
1129
|
+
page_break: "page_break";
|
|
1130
|
+
quote: "quote";
|
|
1131
|
+
small_title: "small_title";
|
|
1132
|
+
video: "video";
|
|
1133
|
+
}>;
|
|
1134
|
+
/**
|
|
1135
|
+
* `DocumentBlockIdOnly` projection — Monday's `delete_doc_block`
|
|
1136
|
+
* mutation return shape per the v0.5 empirical probe. Single-field
|
|
1137
|
+
* OBJECT carrying only the deleted block's id; the wire description
|
|
1138
|
+
* is "A monday.com doc block" but introspection pins exactly one
|
|
1139
|
+
* field. Mirrors `DocumentBlock.id`'s `String!` shape (non-empty,
|
|
1140
|
+
* opaque).
|
|
1141
|
+
*/
|
|
1142
|
+
export declare const documentBlockIdOnlySchema: z.ZodObject<{
|
|
1143
|
+
id: z.ZodString;
|
|
1144
|
+
}, z.core.$strict>;
|
|
1145
|
+
export type DocumentBlockIdOnly = z.infer<typeof documentBlockIdOnlySchema>;
|
|
1146
|
+
/**
|
|
1147
|
+
* Output shape for `monday doc block-create <doc-id> --type <t>
|
|
1148
|
+
* --content <json> [--after <bid>] [--parent <bid>]`. Direct unwrap
|
|
1149
|
+
* of the created DocumentBlock — `data: <DocumentBlock>` per cli-
|
|
1150
|
+
* design §6.1 single-record convention. The 9-field `DocumentBlock`
|
|
1151
|
+
* schema reused from {@link documentBlockSchema} (M32's `doc get`
|
|
1152
|
+
* blocks-hydration leg).
|
|
1153
|
+
*/
|
|
1154
|
+
export declare const docBlockCreateOutputSchema: z.ZodObject<{
|
|
1155
|
+
id: z.ZodString;
|
|
1156
|
+
type: z.ZodNullable<z.ZodString>;
|
|
1157
|
+
content: z.ZodUnknown & z.ZodType<{} | null, unknown, z.core.$ZodTypeInternals<{} | null, unknown>>;
|
|
1158
|
+
position: z.ZodNullable<z.ZodNumber>;
|
|
1159
|
+
parent_block_id: z.ZodNullable<z.ZodString>;
|
|
1160
|
+
doc_id: z.ZodNullable<z.ZodString>;
|
|
1161
|
+
created_at: z.ZodNullable<z.ZodString>;
|
|
1162
|
+
created_by: z.ZodNullable<z.ZodObject<{
|
|
1163
|
+
id: z.ZodString;
|
|
1164
|
+
name: z.ZodString;
|
|
1165
|
+
}, z.core.$strict>>;
|
|
1166
|
+
updated_at: z.ZodNullable<z.ZodString>;
|
|
1167
|
+
}, z.core.$strict>;
|
|
1168
|
+
export type DocBlockCreateOutput = DocumentBlock;
|
|
1169
|
+
/**
|
|
1170
|
+
* Output shape for `monday doc block-update <block-id> --content
|
|
1171
|
+
* <json>`. Same 9-field `DocumentBlock` shape as block-create —
|
|
1172
|
+
* Monday's wire returns the updated block with content / type /
|
|
1173
|
+
* position / parent_block_id all reflecting post-update state.
|
|
1174
|
+
*/
|
|
1175
|
+
export declare const docBlockUpdateOutputSchema: z.ZodObject<{
|
|
1176
|
+
id: z.ZodString;
|
|
1177
|
+
type: z.ZodNullable<z.ZodString>;
|
|
1178
|
+
content: z.ZodUnknown & z.ZodType<{} | null, unknown, z.core.$ZodTypeInternals<{} | null, unknown>>;
|
|
1179
|
+
position: z.ZodNullable<z.ZodNumber>;
|
|
1180
|
+
parent_block_id: z.ZodNullable<z.ZodString>;
|
|
1181
|
+
doc_id: z.ZodNullable<z.ZodString>;
|
|
1182
|
+
created_at: z.ZodNullable<z.ZodString>;
|
|
1183
|
+
created_by: z.ZodNullable<z.ZodObject<{
|
|
1184
|
+
id: z.ZodString;
|
|
1185
|
+
name: z.ZodString;
|
|
1186
|
+
}, z.core.$strict>>;
|
|
1187
|
+
updated_at: z.ZodNullable<z.ZodString>;
|
|
1188
|
+
}, z.core.$strict>;
|
|
1189
|
+
export type DocBlockUpdateOutput = DocumentBlock;
|
|
1190
|
+
/**
|
|
1191
|
+
* Output shape for `monday doc block-delete <block-id> --yes`.
|
|
1192
|
+
* Single-field `{id: <echoed-block-id>}` projection from Monday's
|
|
1193
|
+
* `DocumentBlockIdOnly` wire return — agents key off the echoed id
|
|
1194
|
+
* for retry/idempotency reasoning. Envelope is intentionally
|
|
1195
|
+
* narrower than the create/update variants because Monday's
|
|
1196
|
+
* `delete_doc_block` wire only returns the id (NOT the full
|
|
1197
|
+
* pre-delete block); the agent contract doesn't gain from
|
|
1198
|
+
* speculatively rehydrating the block on the way out.
|
|
1199
|
+
*/
|
|
1200
|
+
export declare const docBlockDeleteOutputSchema: z.ZodObject<{
|
|
1201
|
+
id: z.ZodString;
|
|
1202
|
+
}, z.core.$strict>;
|
|
1203
|
+
export type DocBlockDeleteOutput = DocumentBlockIdOnly;
|
|
1204
|
+
/**
|
|
1205
|
+
* GraphQL mutation document for `create_doc_block(doc_id, type,
|
|
1206
|
+
* content, after_block_id?, parent_block_id?) → DocumentBlock`.
|
|
1207
|
+
* Operation name pinned literally to `CreateDocBlock` (R-NEW-37
|
|
1208
|
+
* W2 audit-point — operationNames NOT caller-overridable). Wire
|
|
1209
|
+
* args are snake_case (Finding 7); variable names are camelCase
|
|
1210
|
+
* (TS convention).
|
|
1211
|
+
*
|
|
1212
|
+
* Selects every `DocumentBlock` field per the M32 probe. The 9-
|
|
1213
|
+
* field selection matches the `doc get` blocks-hydration leg so a
|
|
1214
|
+
* future create-then-get pipeline can compare envelopes byte-for-
|
|
1215
|
+
* byte.
|
|
1216
|
+
*/
|
|
1217
|
+
export declare const CREATE_DOC_BLOCK_MUTATION = "\n mutation CreateDocBlock(\n $docId: ID!,\n $type: DocBlockContentType!,\n $content: JSON!,\n $afterBlockId: String,\n $parentBlockId: String\n ) {\n create_doc_block(\n doc_id: $docId,\n type: $type,\n content: $content,\n after_block_id: $afterBlockId,\n parent_block_id: $parentBlockId\n ) {\n id\n type\n content\n position\n parent_block_id\n doc_id\n created_at\n created_by { id name }\n updated_at\n }\n }\n";
|
|
1218
|
+
/**
|
|
1219
|
+
* GraphQL mutation document for `update_doc_block(block_id,
|
|
1220
|
+
* content) → DocumentBlock`. Operation name pinned to
|
|
1221
|
+
* `UpdateDocBlock` (R-NEW-37 W2). Same 9-field `DocumentBlock`
|
|
1222
|
+
* selection as the create variant — Monday's wire returns the
|
|
1223
|
+
* full post-update block, not just a delta.
|
|
1224
|
+
*
|
|
1225
|
+
* No `--type` slot on `update_doc_block` (Monday's wire signature
|
|
1226
|
+
* has no `type` arg); agents that need to switch a block's content
|
|
1227
|
+
* type must `block-delete` + `block-create` (lossy: new id, new
|
|
1228
|
+
* position). The CLI surface mirrors the wire constraint exactly
|
|
1229
|
+
* — no client-side "change type" shim that papers over the
|
|
1230
|
+
* destructive recreate.
|
|
1231
|
+
*/
|
|
1232
|
+
export declare const UPDATE_DOC_BLOCK_MUTATION = "\n mutation UpdateDocBlock($blockId: String!, $content: JSON!) {\n update_doc_block(block_id: $blockId, content: $content) {\n id\n type\n content\n position\n parent_block_id\n doc_id\n created_at\n created_by { id name }\n updated_at\n }\n }\n";
|
|
1233
|
+
/**
|
|
1234
|
+
* GraphQL mutation document for `delete_doc_block(block_id) →
|
|
1235
|
+
* DocumentBlockIdOnly`. Operation name pinned to `DeleteDocBlock`
|
|
1236
|
+
* (R-NEW-37 W2). Single-field selection — Monday's wire return is
|
|
1237
|
+
* `DocumentBlockIdOnly` (`{id: String!}`).
|
|
1238
|
+
*
|
|
1239
|
+
* **Destructive-gate ordering.** The verb's action body MUST call
|
|
1240
|
+
* `enforceDestructiveGate` BEFORE this fetcher per the M10 round-1
|
|
1241
|
+
* P2 invariant. A missing `--yes` surfaces as
|
|
1242
|
+
* `confirmation_required` from the action layer, never masked by
|
|
1243
|
+
* `config_error` when no token is configured.
|
|
1244
|
+
*/
|
|
1245
|
+
export declare const DELETE_DOC_BLOCK_MUTATION = "\n mutation DeleteDocBlock($blockId: String!) {\n delete_doc_block(block_id: $blockId) {\n id\n }\n }\n";
|
|
1246
|
+
export interface CreateDocBlockInputs {
|
|
1247
|
+
readonly client: MondayClient;
|
|
1248
|
+
readonly docId: string;
|
|
1249
|
+
readonly type: DocBlockContentType;
|
|
1250
|
+
/**
|
|
1251
|
+
* Per-block content payload. Shape varies per
|
|
1252
|
+
* {@link DocBlockContentType} value — Monday's wire is the source
|
|
1253
|
+
* of truth for what each variant accepts; the CLI passes the JS
|
|
1254
|
+
* value through to the wire `JSON` scalar unmodified. Per-type
|
|
1255
|
+
* structure pinned by `docs/output-shapes.md` "Per-block content
|
|
1256
|
+
* shapes" reference table (cassette-sourced rows + TBD / inferred
|
|
1257
|
+
* rows pending live-probe cassettes).
|
|
1258
|
+
*/
|
|
1259
|
+
readonly content: unknown;
|
|
1260
|
+
/**
|
|
1261
|
+
* Optional anchor block — newly-created block lands immediately
|
|
1262
|
+
* after `afterBlockId` in the doc body order. Absent → block
|
|
1263
|
+
* inserted at the document head (Monday's `create_doc_block`
|
|
1264
|
+
* default per probe description: "If not provided, will be
|
|
1265
|
+
* inserted first in the document").
|
|
1266
|
+
*/
|
|
1267
|
+
readonly afterBlockId?: string;
|
|
1268
|
+
/**
|
|
1269
|
+
* Optional parent block — newly-created block nests under
|
|
1270
|
+
* `parentBlockId` (for layout / nested-list variants where
|
|
1271
|
+
* Monday supports parent/child block relationships per
|
|
1272
|
+
* `DocumentBlock.parent_block_id`). Absent → block lands at the
|
|
1273
|
+
* document root level.
|
|
1274
|
+
*/
|
|
1275
|
+
readonly parentBlockId?: string;
|
|
1276
|
+
}
|
|
1277
|
+
export interface CreateDocBlockResult {
|
|
1278
|
+
readonly block: DocumentBlock;
|
|
1279
|
+
readonly source: 'live';
|
|
1280
|
+
readonly cacheAgeSeconds: null;
|
|
1281
|
+
readonly complexity: Complexity | null;
|
|
1282
|
+
}
|
|
1283
|
+
/**
|
|
1284
|
+
* Creates a per-doc rich-text block via `create_doc_block(doc_id,
|
|
1285
|
+
* type, content, after_block_id?, parent_block_id?)` with
|
|
1286
|
+
* `operationName: 'CreateDocBlock'` (R-NEW-37 W2). Two-stage parse
|
|
1287
|
+
* mirrors M34 / M35 cadence: the loose wrapping schema tolerates
|
|
1288
|
+
* Monday's side-band debug keys, then the inner OBJECT pins via
|
|
1289
|
+
* {@link documentBlockSchema} so per-field drift surfaces with
|
|
1290
|
+
* structured `details.issues`.
|
|
1291
|
+
*
|
|
1292
|
+
* Failure modes:
|
|
1293
|
+
*
|
|
1294
|
+
* - **Missing `create_doc_block` key** → `internal_error` via
|
|
1295
|
+
* `assertResponseFieldPresent` (Monday's response shape
|
|
1296
|
+
* regressed).
|
|
1297
|
+
* - **Present-but-null payload** → `internal_error` (a successful
|
|
1298
|
+
* `create_doc_block` mutation must return the created block per
|
|
1299
|
+
* Monday's documented contract — null indicates a wire-shape
|
|
1300
|
+
* regression worth surfacing loudly; distinct from
|
|
1301
|
+
* {@link updateDocBlock} / {@link deleteDocBlock} which treat
|
|
1302
|
+
* null as `not_found` per their probe-description-derived
|
|
1303
|
+
* contracts at R-v0.5-NEW-11).
|
|
1304
|
+
* - **Inner OBJECT drift** → `internal_error` via `unwrapOrThrow`
|
|
1305
|
+
* on {@link documentBlockSchema} (per-field shape regression).
|
|
1306
|
+
*
|
|
1307
|
+
* Omits `afterBlockId` / `parentBlockId` variables when unset so
|
|
1308
|
+
* Monday's wire-side defaults apply (the M34 / M35 omit-vs-null
|
|
1309
|
+
* discipline — undefined-keyed JSON serialises to a missing key,
|
|
1310
|
+
* NOT `null`).
|
|
1311
|
+
*/
|
|
1312
|
+
export declare const createDocBlock: (inputs: CreateDocBlockInputs) => Promise<CreateDocBlockResult>;
|
|
1313
|
+
export interface UpdateDocBlockInputs {
|
|
1314
|
+
readonly client: MondayClient;
|
|
1315
|
+
readonly blockId: string;
|
|
1316
|
+
/**
|
|
1317
|
+
* Per-block content payload. Same shape contract as
|
|
1318
|
+
* {@link CreateDocBlockInputs.content} — opaque JS value passed
|
|
1319
|
+
* through to Monday's wire `JSON` scalar. Per-type structure
|
|
1320
|
+
* pinned by `docs/output-shapes.md` "Per-block content shapes"
|
|
1321
|
+
* reference table from M36 IMPL cassettes.
|
|
1322
|
+
*/
|
|
1323
|
+
readonly content: unknown;
|
|
1324
|
+
}
|
|
1325
|
+
export interface UpdateDocBlockResult {
|
|
1326
|
+
readonly block: DocumentBlock;
|
|
1327
|
+
readonly source: 'live';
|
|
1328
|
+
readonly cacheAgeSeconds: null;
|
|
1329
|
+
readonly complexity: Complexity | null;
|
|
1330
|
+
}
|
|
1331
|
+
/**
|
|
1332
|
+
* Updates a per-doc rich-text block's content via
|
|
1333
|
+
* `update_doc_block(block_id, content)` with `operationName:
|
|
1334
|
+
* 'UpdateDocBlock'` (R-NEW-37 W2). No type-switching slot on the
|
|
1335
|
+
* wire — agents needing to change a block's content type
|
|
1336
|
+
* `block-delete` + `block-create` (lossy: new id, new position).
|
|
1337
|
+
*
|
|
1338
|
+
* Failure modes:
|
|
1339
|
+
*
|
|
1340
|
+
* - **Missing `update_doc_block` key** → `internal_error` via
|
|
1341
|
+
* `assertResponseFieldPresent` (schema drift).
|
|
1342
|
+
* - **Present-but-null payload** → `not_found` (the probe
|
|
1343
|
+
* description "Update a document block" promises the updated
|
|
1344
|
+
* block on success, so null reads as missing-record — block
|
|
1345
|
+
* bogus or not visible to the token; per R-v0.5-NEW-11
|
|
1346
|
+
* per-fetcher null-payload discipline).
|
|
1347
|
+
* - **Inner OBJECT drift** → `internal_error` via `unwrapOrThrow`
|
|
1348
|
+
* on {@link documentBlockSchema}.
|
|
1349
|
+
*/
|
|
1350
|
+
export declare const updateDocBlock: (inputs: UpdateDocBlockInputs) => Promise<UpdateDocBlockResult>;
|
|
1351
|
+
export interface DeleteDocBlockInputs {
|
|
1352
|
+
readonly client: MondayClient;
|
|
1353
|
+
readonly blockId: string;
|
|
1354
|
+
}
|
|
1355
|
+
export interface DeleteDocBlockResult {
|
|
1356
|
+
readonly block: DocumentBlockIdOnly;
|
|
1357
|
+
readonly source: 'live';
|
|
1358
|
+
readonly cacheAgeSeconds: null;
|
|
1359
|
+
readonly complexity: Complexity | null;
|
|
1360
|
+
}
|
|
1361
|
+
/**
|
|
1362
|
+
* Deletes a per-doc rich-text block via `delete_doc_block(block_id)`
|
|
1363
|
+
* with `operationName: 'DeleteDocBlock'` (R-NEW-37 W2). Wire return
|
|
1364
|
+
* is `DocumentBlockIdOnly` (`{id: String!}`).
|
|
1365
|
+
*
|
|
1366
|
+
* Failure modes:
|
|
1367
|
+
*
|
|
1368
|
+
* - **Missing `delete_doc_block` key** → `internal_error` via
|
|
1369
|
+
* `assertResponseFieldPresent` (schema drift).
|
|
1370
|
+
* - **Present-but-null payload** → `not_found` (id bogus or
|
|
1371
|
+
* block already deleted by a concurrent caller; mirrors M14
|
|
1372
|
+
* workspace-delete + M34 team-delete + M35 doc-delete cadence;
|
|
1373
|
+
* `delete_doc_block`'s probe description "Delete a document
|
|
1374
|
+
* block" promises confirmation on success).
|
|
1375
|
+
* - **Inner OBJECT drift** → `internal_error` via `unwrapOrThrow`
|
|
1376
|
+
* on {@link documentBlockIdOnlySchema}.
|
|
1377
|
+
*
|
|
1378
|
+
* The action body's destructive gate fires BEFORE this fetcher per
|
|
1379
|
+
* the M10 round-1 P2 invariant.
|
|
1380
|
+
*/
|
|
1381
|
+
export declare const deleteDocBlock: (inputs: DeleteDocBlockInputs) => Promise<DeleteDocBlockResult>;
|
|
1382
|
+
/**
|
|
1383
|
+
* Maximum byte-size for the inline `--html-string` / `--markdown-string`
|
|
1384
|
+
* payload at the argv-parse boundary (empirical probe 2026-05-17, API
|
|
1385
|
+
* `2026-01`; `scripts/probe/v0.5-m37-size-limits.report.txt`). Set
|
|
1386
|
+
* conservatively at the LAST-KNOWN-GOOD probe size (250KB) — the wire's
|
|
1387
|
+
* first-known-rejection sits at 500KB, so 250KB leaves the agent contract
|
|
1388
|
+
* comfortably below the threshold without leaving room for the wire-side
|
|
1389
|
+
* `INTERNAL_SERVER_ERROR` surprise.
|
|
1390
|
+
*
|
|
1391
|
+
* Bytes (NOT UTF-16 code units) — the parse-boundary check measures the
|
|
1392
|
+
* payload via `Buffer.byteLength(payload, 'utf8')` so multi-byte
|
|
1393
|
+
* characters in the payload count toward the limit the same way Monday's
|
|
1394
|
+
* transport layer sees them.
|
|
1395
|
+
*
|
|
1396
|
+
* Raising this constant is a contract bump: any agent that relied on
|
|
1397
|
+
* being rejected at the old limit might now silently succeed with a
|
|
1398
|
+
* larger payload (additive change). Lowering it is a tighter rejection
|
|
1399
|
+
* surface (potentially breaking — fold into a Codex review at the v0.6+
|
|
1400
|
+
* pre-flight that touches doc-content import). Future API versions may
|
|
1401
|
+
* shift Monday's wire threshold; re-running the probe at any v0.5.x or
|
|
1402
|
+
* v0.6 pre-flight that re-opens this surface pins the new threshold.
|
|
1403
|
+
*/
|
|
1404
|
+
export declare const MAX_DOC_IMPORT_PAYLOAD_BYTES = 256000;
|
|
1405
|
+
/**
|
|
1406
|
+
* Inner OBJECT schema for `import_doc_from_html`'s
|
|
1407
|
+
* `ImportDocFromHtmlResult` wire return shape — 3 fields per the
|
|
1408
|
+
* v0.5 introspection probe (`scripts/probe/v0.5-inputs-and-results.
|
|
1409
|
+
* report.txt`):
|
|
1410
|
+
*
|
|
1411
|
+
* - `success: Boolean!` — discriminator; pinned NON_NULL per
|
|
1412
|
+
* introspection.
|
|
1413
|
+
* - `doc_id: String` — nullable; populated on `success: true`,
|
|
1414
|
+
* null on `success: false` per Monday's documented contract.
|
|
1415
|
+
* Note Monday's wire types this slot as `String` (NOT `ID`!)
|
|
1416
|
+
* despite the value being a doc-id-shaped reference. The CLI
|
|
1417
|
+
* surfaces it as a brand-untyped string at the wire layer; the
|
|
1418
|
+
* CLI projection envelope re-brands via {@link DocIdSchema} on
|
|
1419
|
+
* the way out so agents read a `DocId`-shaped slot.
|
|
1420
|
+
* - `error: String` — nullable; populated on `success: false`,
|
|
1421
|
+
* null on `success: true`. Wire-side rejection reason (invalid
|
|
1422
|
+
* HTML, payload-too-large, etc.).
|
|
1423
|
+
*
|
|
1424
|
+
* `.strict()` mode — Monday's wire OBJECT shape is documented at
|
|
1425
|
+
* exactly 3 fields; an unknown key would indicate wire-shape
|
|
1426
|
+
* regression worth catching loudly (the wrapping `loose()` schema
|
|
1427
|
+
* tolerates side-band debug keys at the response root, not at the
|
|
1428
|
+
* inner OBJECT layer).
|
|
1429
|
+
*/
|
|
1430
|
+
export declare const importDocFromHtmlResultSchema: z.ZodObject<{
|
|
1431
|
+
success: z.ZodBoolean;
|
|
1432
|
+
doc_id: z.ZodNullable<z.ZodString>;
|
|
1433
|
+
error: z.ZodNullable<z.ZodString>;
|
|
1434
|
+
}, z.core.$strict>;
|
|
1435
|
+
export type ImportDocFromHtmlResult = z.infer<typeof importDocFromHtmlResultSchema>;
|
|
1436
|
+
/**
|
|
1437
|
+
* Inner OBJECT schema for `add_content_to_doc_from_markdown`'s
|
|
1438
|
+
* `DocBlocksFromMarkdownResult` wire return shape — 3 fields per the
|
|
1439
|
+
* v0.5 introspection probe:
|
|
1440
|
+
*
|
|
1441
|
+
* - `success: Boolean!` — discriminator; NON_NULL.
|
|
1442
|
+
* - `block_ids: [String!]` — nullable LIST of NON_NULL strings;
|
|
1443
|
+
* populated on `success: true` with the newly-created block
|
|
1444
|
+
* ids (one per parsed markdown block); null on `success:
|
|
1445
|
+
* false`. EMPTY array on success is plausible for non-empty
|
|
1446
|
+
* markdown that Monday parses to zero convertible blocks (e.g.
|
|
1447
|
+
* comments-only input); the schema accepts empty. Empty /
|
|
1448
|
+
* whitespace-only `--markdown-string` rejects at the parse /
|
|
1449
|
+
* read boundary as `usage_error` and never reaches the wire.
|
|
1450
|
+
* - `error: String` — nullable; populated on `success: false`,
|
|
1451
|
+
* null on `success: true`.
|
|
1452
|
+
*
|
|
1453
|
+
* `.strict()` mode for the same reason as
|
|
1454
|
+
* {@link importDocFromHtmlResultSchema}.
|
|
1455
|
+
*/
|
|
1456
|
+
export declare const docBlocksFromMarkdownResultSchema: z.ZodObject<{
|
|
1457
|
+
success: z.ZodBoolean;
|
|
1458
|
+
block_ids: z.ZodNullable<z.ZodArray<z.ZodString>>;
|
|
1459
|
+
error: z.ZodNullable<z.ZodString>;
|
|
1460
|
+
}, z.core.$strict>;
|
|
1461
|
+
export type DocBlocksFromMarkdownResult = z.infer<typeof docBlocksFromMarkdownResultSchema>;
|
|
1462
|
+
/**
|
|
1463
|
+
* CLI projection envelope for `monday doc import-html` — flat
|
|
1464
|
+
* `{ doc_id, success: true }` shape mirroring M35's
|
|
1465
|
+
* {@link docMutationResultSchema} cadence so agents read a uniform
|
|
1466
|
+
* `{ doc_id, success }` shape across every doc-mutation success
|
|
1467
|
+
* envelope (rename / delete / duplicate / import-html). `doc_id`
|
|
1468
|
+
* carries the **NEWLY-CREATED** doc's id; `success` is literal-
|
|
1469
|
+
* `true` because failure paths throw typed `ApiError`s
|
|
1470
|
+
* (`validation_failed` for `success: false + error` per D12 / null
|
|
1471
|
+
* for wire regression) BEFORE this projection schema is referenced.
|
|
1472
|
+
*
|
|
1473
|
+
* No `error` slot — failures don't reach this envelope. Agents read
|
|
1474
|
+
* `error.code` + `error.details.error` from the failure envelope
|
|
1475
|
+
* instead.
|
|
1476
|
+
*/
|
|
1477
|
+
export declare const docImportHtmlOutputSchema: z.ZodObject<{
|
|
1478
|
+
doc_id: z.ZodString;
|
|
1479
|
+
success: z.ZodLiteral<true>;
|
|
1480
|
+
}, z.core.$strict>;
|
|
1481
|
+
export type DocImportHtmlOutput = z.infer<typeof docImportHtmlOutputSchema>;
|
|
1482
|
+
/**
|
|
1483
|
+
* CLI projection envelope for `monday doc append-markdown` —
|
|
1484
|
+
* `{ doc_id (echoed input), block_ids, success: true }`. Echoes
|
|
1485
|
+
* the input source-doc id so agents that pipe the append envelope
|
|
1486
|
+
* into a follow-up call (e.g. a `monday doc get <doc-id>` to verify
|
|
1487
|
+
* post-append state) have the parent doc context inline.
|
|
1488
|
+
* `block_ids` carries the wire's full list of NEWLY-CREATED block
|
|
1489
|
+
* ids (one per parsed markdown block) preserved in markdown-source
|
|
1490
|
+
* order. Empty array IS a valid success shape for non-empty markdown
|
|
1491
|
+
* that Monday parses to zero convertible blocks (e.g. comments-only
|
|
1492
|
+
* input); empty / whitespace-only `--markdown-string` rejects at the
|
|
1493
|
+
* parse / read boundary as `usage_error` and never reaches the wire.
|
|
1494
|
+
*
|
|
1495
|
+
* `success` is literal-`true` for the same reason as
|
|
1496
|
+
* {@link docImportHtmlOutputSchema}.
|
|
1497
|
+
*/
|
|
1498
|
+
export declare const docAppendMarkdownOutputSchema: z.ZodObject<{
|
|
1499
|
+
doc_id: z.ZodString;
|
|
1500
|
+
block_ids: z.ZodArray<z.ZodString>;
|
|
1501
|
+
success: z.ZodLiteral<true>;
|
|
1502
|
+
}, z.core.$strict>;
|
|
1503
|
+
export type DocAppendMarkdownOutput = z.infer<typeof docAppendMarkdownOutputSchema>;
|
|
1504
|
+
/**
|
|
1505
|
+
* GraphQL mutation document for `import_doc_from_html(html,
|
|
1506
|
+
* workspaceId, kind?, folderId?, title?) → ImportDocFromHtmlResult`.
|
|
1507
|
+
* Operation name pinned literally to `ImportDocFromHtml` (R-NEW-37
|
|
1508
|
+
* W2 audit-point — operationNames NOT caller-overridable). All wire
|
|
1509
|
+
* args are camelCase (Finding 7); variable names match the wire
|
|
1510
|
+
* shape verbatim.
|
|
1511
|
+
*
|
|
1512
|
+
* Selects every `ImportDocFromHtmlResult` field per the introspection
|
|
1513
|
+
* probe — the 3-field selection lets the fetcher project the
|
|
1514
|
+
* discriminator + payload + error in a single round-trip.
|
|
1515
|
+
*/
|
|
1516
|
+
export declare const IMPORT_DOC_FROM_HTML_MUTATION = "\n mutation ImportDocFromHtml(\n $html: String!,\n $workspaceId: ID!,\n $kind: DocKind,\n $folderId: ID,\n $title: String\n ) {\n import_doc_from_html(\n html: $html,\n workspaceId: $workspaceId,\n kind: $kind,\n folderId: $folderId,\n title: $title\n ) {\n success\n doc_id\n error\n }\n }\n";
|
|
1517
|
+
/**
|
|
1518
|
+
* GraphQL mutation document for `add_content_to_doc_from_markdown(
|
|
1519
|
+
* docId, markdown, afterBlockId?) → DocBlocksFromMarkdownResult`.
|
|
1520
|
+
* Operation name pinned to `AddContentToDocFromMarkdown` (R-NEW-37
|
|
1521
|
+
* W2). camelCase wire arg names (Finding 7).
|
|
1522
|
+
*
|
|
1523
|
+
* `afterBlockId` is the optional opaque block-id positional anchor —
|
|
1524
|
+
* Monday inserts the parsed markdown blocks immediately after the
|
|
1525
|
+
* named block; absent → blocks land at the document tail (append-end
|
|
1526
|
+
* semantics, NOT append-head; Monday's probe description: "Use this
|
|
1527
|
+
* to append content to the end of a document or insert content after
|
|
1528
|
+
* a specific block").
|
|
1529
|
+
*/
|
|
1530
|
+
export declare const ADD_CONTENT_TO_DOC_FROM_MARKDOWN_MUTATION = "\n mutation AddContentToDocFromMarkdown(\n $docId: ID!,\n $markdown: String!,\n $afterBlockId: String\n ) {\n add_content_to_doc_from_markdown(\n docId: $docId,\n markdown: $markdown,\n afterBlockId: $afterBlockId\n ) {\n success\n block_ids\n error\n }\n }\n";
|
|
1531
|
+
export interface ImportDocFromHtmlInputs {
|
|
1532
|
+
readonly client: MondayClient;
|
|
1533
|
+
readonly html: string;
|
|
1534
|
+
readonly workspaceId: string;
|
|
1535
|
+
/**
|
|
1536
|
+
* Optional doc-kind enum (`public` / `private` / `share`) — maps
|
|
1537
|
+
* to wire `kind: DocKind`. Absent → omitted from the wire payload
|
|
1538
|
+
* (Monday's wire-side default "public" applies per the probe
|
|
1539
|
+
* description: "Defaults to 'public' if not specified").
|
|
1540
|
+
*/
|
|
1541
|
+
readonly kind?: DocKind;
|
|
1542
|
+
/**
|
|
1543
|
+
* Optional folder id — maps to wire `folderId: ID`. Absent →
|
|
1544
|
+
* omitted; Monday creates the doc at the workspace root level per
|
|
1545
|
+
* the probe description: "If not provided, the document will be
|
|
1546
|
+
* created at the root level of the workspace".
|
|
1547
|
+
*/
|
|
1548
|
+
readonly folderId?: string;
|
|
1549
|
+
/**
|
|
1550
|
+
* Optional title — maps to wire `title: String`. Absent → omitted;
|
|
1551
|
+
* Monday infers the title from the HTML content per the probe
|
|
1552
|
+
* description: "If not provided, the title will be inferred from
|
|
1553
|
+
* the HTML content".
|
|
1554
|
+
*/
|
|
1555
|
+
readonly title?: string;
|
|
1556
|
+
}
|
|
1557
|
+
export interface ImportDocFromHtmlActionResult {
|
|
1558
|
+
readonly result: DocImportHtmlOutput;
|
|
1559
|
+
readonly source: 'live';
|
|
1560
|
+
readonly cacheAgeSeconds: null;
|
|
1561
|
+
readonly complexity: Complexity | null;
|
|
1562
|
+
}
|
|
1563
|
+
/**
|
|
1564
|
+
* Imports an HTML payload as a new workdoc via
|
|
1565
|
+
* `import_doc_from_html(html, workspaceId, kind?, folderId?, title?)`
|
|
1566
|
+
* with `operationName: 'ImportDocFromHtml'` (R-NEW-37 W2 — pinned
|
|
1567
|
+
* literally at the call site; NOT a caller-overridable input slot).
|
|
1568
|
+
*
|
|
1569
|
+
* Two-stage parse: the loose {@link importDocFromHtmlResponseSchema}
|
|
1570
|
+
* wrapping schema tolerates side-band keys at the response root;
|
|
1571
|
+
* `assertResponseFieldPresent` rewraps a missing key as
|
|
1572
|
+
* `internal_error`; the inner OBJECT pins via
|
|
1573
|
+
* {@link importDocFromHtmlResultSchema} (`.strict()` — drift surfaces
|
|
1574
|
+
* `internal_error` with structured `details.issues`).
|
|
1575
|
+
*
|
|
1576
|
+
* Custom-OBJECT projection per D12 (5 branches):
|
|
1577
|
+
*
|
|
1578
|
+
* - `success: true + doc_id present` → flat envelope
|
|
1579
|
+
* `{doc_id, success: true}` (mirrors M35
|
|
1580
|
+
* {@link docMutationResultSchema} cadence).
|
|
1581
|
+
* - `success: false + populated error` → throw `validation_failed`
|
|
1582
|
+
* with `details: {workspace_id, error, hint}` (Monday-side
|
|
1583
|
+
* rejection — invalid HTML, payload too large, etc.).
|
|
1584
|
+
* - `success: false + empty/null error` → throw `internal_error`
|
|
1585
|
+
* with a wire-regression hint (Monday's contract: `error` is
|
|
1586
|
+
* populated when `success: false`).
|
|
1587
|
+
* - `success: true + missing doc_id` → throw `internal_error`
|
|
1588
|
+
* (per-fetcher null-payload contract derived from Monday's probe
|
|
1589
|
+
* description "Returns the ID of the newly created document on
|
|
1590
|
+
* success" per R-v0.5-NEW-11).
|
|
1591
|
+
* - `success: true + null doc_id` → same as missing — wire-side
|
|
1592
|
+
* regression on the documented payload promise.
|
|
1593
|
+
*
|
|
1594
|
+
* Omits optional variables (`kind` / `folderId` / `title`) entirely
|
|
1595
|
+
* when unset so Monday's per-arg server-side defaults apply (the M34 /
|
|
1596
|
+
* M35 / M36 omit-vs-null discipline — undefined-keyed JSON serialises
|
|
1597
|
+
* to a missing key, NOT `null`).
|
|
1598
|
+
*/
|
|
1599
|
+
export declare const importDocFromHtml: (inputs: ImportDocFromHtmlInputs) => Promise<ImportDocFromHtmlActionResult>;
|
|
1600
|
+
export interface AddContentToDocFromMarkdownInputs {
|
|
1601
|
+
readonly client: MondayClient;
|
|
1602
|
+
readonly docId: string;
|
|
1603
|
+
readonly markdown: string;
|
|
1604
|
+
/**
|
|
1605
|
+
* Optional opaque block-id anchor — Monday inserts the parsed
|
|
1606
|
+
* markdown blocks immediately after `afterBlockId` in the doc body
|
|
1607
|
+
* order. Absent → blocks land at the document tail (append-end
|
|
1608
|
+
* semantics per Monday's probe description).
|
|
1609
|
+
*/
|
|
1610
|
+
readonly afterBlockId?: string;
|
|
1611
|
+
}
|
|
1612
|
+
export interface AddContentToDocFromMarkdownActionResult {
|
|
1613
|
+
readonly result: DocAppendMarkdownOutput;
|
|
1614
|
+
readonly source: 'live';
|
|
1615
|
+
readonly cacheAgeSeconds: null;
|
|
1616
|
+
readonly complexity: Complexity | null;
|
|
1617
|
+
}
|
|
1618
|
+
/**
|
|
1619
|
+
* Appends parsed-markdown blocks to an existing workdoc via
|
|
1620
|
+
* `add_content_to_doc_from_markdown(docId, markdown, afterBlockId?)`
|
|
1621
|
+
* with `operationName: 'AddContentToDocFromMarkdown'` (R-NEW-37 W2).
|
|
1622
|
+
*
|
|
1623
|
+
* Two-stage parse: the loose
|
|
1624
|
+
* {@link addContentToDocFromMarkdownResponseSchema} wrapping schema
|
|
1625
|
+
* tolerates side-band keys; `assertResponseFieldPresent` rewraps a
|
|
1626
|
+
* missing key as `internal_error`; the inner OBJECT pins via
|
|
1627
|
+
* {@link docBlocksFromMarkdownResultSchema}.
|
|
1628
|
+
*
|
|
1629
|
+
* Custom-OBJECT projection per D12 (5 branches):
|
|
1630
|
+
*
|
|
1631
|
+
* - `success: true + block_ids present (incl. EMPTY array)` →
|
|
1632
|
+
* success envelope `{doc_id (echoed), block_ids, success: true}`.
|
|
1633
|
+
* Empty `block_ids: []` IS a valid success shape per probe
|
|
1634
|
+
* finding — for non-empty markdown that Monday parses to zero
|
|
1635
|
+
* convertible blocks (e.g. comments-only payload Monday
|
|
1636
|
+
* collapses to zero structural blocks). Empty / whitespace-only
|
|
1637
|
+
* input is rejected at the parse / read boundary by
|
|
1638
|
+
* {@link readSourceContent}, so it can never reach this fetcher.
|
|
1639
|
+
* - `success: false + populated error` → throw `validation_failed`
|
|
1640
|
+
* with `details: {doc_id, error, hint}`.
|
|
1641
|
+
* - `success: false + empty/null error` → throw `internal_error`
|
|
1642
|
+
* with wire-regression hint.
|
|
1643
|
+
* - `success: true + null block_ids` → throw `internal_error`
|
|
1644
|
+
* (per-fetcher null-payload contract per R-v0.5-NEW-11 — Monday's
|
|
1645
|
+
* probe description "Returns the IDs of the newly created blocks
|
|
1646
|
+
* on success" promises a non-null array).
|
|
1647
|
+
*
|
|
1648
|
+
* Omits `afterBlockId` when undefined (M34 / M35 / M36 omit-vs-null
|
|
1649
|
+
* discipline).
|
|
1650
|
+
*/
|
|
1651
|
+
export declare const addContentToDocFromMarkdown: (inputs: AddContentToDocFromMarkdownInputs) => Promise<AddContentToDocFromMarkdownActionResult>;
|
|
1652
|
+
//# sourceMappingURL=documents.d.ts.map
|