monday-cli 0.2.0 → 0.4.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 +675 -2
- package/README.md +223 -31
- 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/board-favorites.d.ts +329 -0
- package/dist/api/board-favorites.d.ts.map +1 -0
- package/dist/api/board-favorites.js +353 -0
- package/dist/api/board-favorites.js.map +1 -0
- package/dist/api/board-mutation-result.d.ts +9 -5
- package/dist/api/board-mutation-result.d.ts.map +1 -1
- package/dist/api/board-mutation-result.js +9 -5
- package/dist/api/board-mutation-result.js.map +1 -1
- package/dist/api/board-relation-validation.d.ts +161 -0
- package/dist/api/board-relation-validation.d.ts.map +1 -0
- package/dist/api/board-relation-validation.js +317 -0
- package/dist/api/board-relation-validation.js.map +1 -0
- package/dist/api/cache.d.ts +14 -5
- package/dist/api/cache.d.ts.map +1 -1
- package/dist/api/cache.js +8 -10
- package/dist/api/cache.js.map +1 -1
- package/dist/api/column-mapping.js +2 -2
- package/dist/api/column-mapping.js.map +1 -1
- package/dist/api/column-mutation-result.d.ts +9 -5
- package/dist/api/column-mutation-result.d.ts.map +1 -1
- package/dist/api/column-mutation-result.js +9 -5
- package/dist/api/column-mutation-result.js.map +1 -1
- package/dist/api/column-types.d.ts +37 -14
- package/dist/api/column-types.d.ts.map +1 -1
- package/dist/api/column-types.js +47 -6
- package/dist/api/column-types.js.map +1 -1
- package/dist/api/column-values.d.ts +234 -31
- package/dist/api/column-values.d.ts.map +1 -1
- package/dist/api/column-values.js +560 -124
- package/dist/api/column-values.js.map +1 -1
- package/dist/api/cross-board-search.d.ts +501 -0
- package/dist/api/cross-board-search.d.ts.map +1 -0
- package/dist/api/cross-board-search.js +547 -0
- package/dist/api/cross-board-search.js.map +1 -0
- package/dist/api/dev-conventions.d.ts +1038 -0
- package/dist/api/dev-conventions.d.ts.map +1 -0
- package/dist/api/dev-conventions.js +1556 -0
- package/dist/api/dev-conventions.js.map +1 -0
- package/dist/api/documents.d.ts +519 -0
- package/dist/api/documents.d.ts.map +1 -0
- package/dist/api/documents.js +586 -0
- package/dist/api/documents.js.map +1 -0
- package/dist/api/dry-run.d.ts +32 -5
- package/dist/api/dry-run.d.ts.map +1 -1
- package/dist/api/dry-run.js +149 -32
- package/dist/api/dry-run.js.map +1 -1
- package/dist/api/errors.d.ts.map +1 -1
- package/dist/api/errors.js +28 -7
- package/dist/api/errors.js.map +1 -1
- package/dist/api/group-mutation-result.d.ts +9 -5
- package/dist/api/group-mutation-result.d.ts.map +1 -1
- package/dist/api/group-mutation-result.js +9 -5
- package/dist/api/group-mutation-result.js.map +1 -1
- package/dist/api/item-history-projection.d.ts +919 -0
- package/dist/api/item-history-projection.d.ts.map +1 -0
- package/dist/api/item-history-projection.js +1104 -0
- package/dist/api/item-history-projection.js.map +1 -0
- package/dist/api/item-mutation-execute.d.ts +82 -0
- package/dist/api/item-mutation-execute.d.ts.map +1 -0
- package/dist/api/item-mutation-execute.js +199 -0
- package/dist/api/item-mutation-execute.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/notifications.d.ts +156 -0
- package/dist/api/notifications.d.ts.map +1 -0
- package/dist/api/notifications.js +215 -0
- package/dist/api/notifications.js.map +1 -0
- package/dist/api/oauth-test-helper.d.ts +64 -0
- package/dist/api/oauth-test-helper.d.ts.map +1 -0
- package/dist/api/oauth-test-helper.js +179 -0
- package/dist/api/oauth-test-helper.js.map +1 -0
- package/dist/api/oauth.d.ts +198 -0
- package/dist/api/oauth.d.ts.map +1 -0
- package/dist/api/oauth.js +471 -0
- package/dist/api/oauth.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 +480 -0
- package/dist/api/partial-success-bulk.d.ts.map +1 -0
- package/dist/api/partial-success-bulk.js +436 -0
- package/dist/api/partial-success-bulk.js.map +1 -0
- 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/people.d.ts +54 -1
- package/dist/api/people.d.ts.map +1 -1
- package/dist/api/people.js +27 -3
- package/dist/api/people.js.map +1 -1
- package/dist/api/probes.d.ts +487 -0
- package/dist/api/probes.d.ts.map +1 -0
- package/dist/api/probes.js +881 -0
- package/dist/api/probes.js.map +1 -0
- package/dist/api/raw-document.d.ts.map +1 -1
- package/dist/api/raw-document.js +2 -2
- package/dist/api/raw-document.js.map +1 -1
- package/dist/api/raw-write.d.ts +12 -4
- package/dist/api/raw-write.d.ts.map +1 -1
- package/dist/api/raw-write.js +32 -14
- package/dist/api/raw-write.js.map +1 -1
- package/dist/api/resolution-context.d.ts +23 -11
- package/dist/api/resolution-context.d.ts.map +1 -1
- package/dist/api/resolution-context.js +53 -12
- package/dist/api/resolution-context.js.map +1 -1
- package/dist/api/resolution-pass.d.ts +30 -1
- package/dist/api/resolution-pass.d.ts.map +1 -1
- package/dist/api/resolution-pass.js +36 -1
- package/dist/api/resolution-pass.js.map +1 -1
- package/dist/api/resolve-client.d.ts +22 -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/response-root.d.ts +92 -46
- package/dist/api/response-root.d.ts.map +1 -1
- package/dist/api/response-root.js +93 -41
- package/dist/api/response-root.js.map +1 -1
- package/dist/api/tag-directory.d.ts +154 -0
- package/dist/api/tag-directory.d.ts.map +1 -0
- package/dist/api/tag-directory.js +325 -0
- package/dist/api/tag-directory.js.map +1 -0
- package/dist/api/time-tracking.d.ts +165 -0
- package/dist/api/time-tracking.d.ts.map +1 -0
- package/dist/api/time-tracking.js +135 -0
- package/dist/api/time-tracking.js.map +1 -0
- package/dist/api/transport.js +3 -3
- package/dist/api/transport.js.map +1 -1
- package/dist/api/usage.d.ts +190 -0
- package/dist/api/usage.d.ts.map +1 -0
- package/dist/api/usage.js +194 -0
- package/dist/api/usage.js.map +1 -0
- package/dist/api/users-fan-out-mutation.d.ts.map +1 -1
- package/dist/api/users-fan-out-mutation.js +10 -5
- package/dist/api/users-fan-out-mutation.js.map +1 -1
- package/dist/api/webhooks.d.ts +357 -0
- package/dist/api/webhooks.d.ts.map +1 -0
- package/dist/api/webhooks.js +333 -0
- package/dist/api/webhooks.js.map +1 -0
- package/dist/cli/envelope-out.d.ts +18 -1
- package/dist/cli/envelope-out.d.ts.map +1 -1
- package/dist/cli/envelope-out.js +16 -2
- package/dist/cli/envelope-out.js.map +1 -1
- package/dist/cli/program.d.ts.map +1 -1
- package/dist/cli/program.js +120 -1
- package/dist/cli/program.js.map +1 -1
- package/dist/cli/run.d.ts +32 -0
- package/dist/cli/run.d.ts.map +1 -1
- package/dist/cli/run.js +3 -0
- package/dist/cli/run.js.map +1 -1
- package/dist/commands/account/tags.d.ts +37 -0
- package/dist/commands/account/tags.d.ts.map +1 -0
- package/dist/commands/account/tags.js +84 -0
- package/dist/commands/account/tags.js.map +1 -0
- package/dist/commands/auth/login.d.ts +14 -0
- package/dist/commands/auth/login.d.ts.map +1 -0
- package/dist/commands/auth/login.js +314 -0
- package/dist/commands/auth/login.js.map +1 -0
- package/dist/commands/auth/logout.d.ts +28 -0
- package/dist/commands/auth/logout.d.ts.map +1 -0
- package/dist/commands/auth/logout.js +94 -0
- package/dist/commands/auth/logout.js.map +1 -0
- package/dist/commands/board/archive.d.ts.map +1 -1
- package/dist/commands/board/archive.js +14 -14
- package/dist/commands/board/archive.js.map +1 -1
- package/dist/commands/board/column-create.d.ts +9 -8
- package/dist/commands/board/column-create.d.ts.map +1 -1
- package/dist/commands/board/column-create.js +61 -51
- package/dist/commands/board/column-create.js.map +1 -1
- package/dist/commands/board/column-delete.d.ts.map +1 -1
- package/dist/commands/board/column-delete.js +15 -16
- package/dist/commands/board/column-delete.js.map +1 -1
- package/dist/commands/board/column-update.d.ts.map +1 -1
- package/dist/commands/board/column-update.js +23 -22
- package/dist/commands/board/column-update.js.map +1 -1
- package/dist/commands/board/create.d.ts.map +1 -1
- package/dist/commands/board/create.js +14 -17
- package/dist/commands/board/create.js.map +1 -1
- package/dist/commands/board/delete.d.ts.map +1 -1
- package/dist/commands/board/delete.js +12 -15
- package/dist/commands/board/delete.js.map +1 -1
- package/dist/commands/board/describe.d.ts.map +1 -1
- package/dist/commands/board/describe.js +30 -0
- package/dist/commands/board/describe.js.map +1 -1
- package/dist/commands/board/duplicate.d.ts.map +1 -1
- package/dist/commands/board/duplicate.js +12 -13
- package/dist/commands/board/duplicate.js.map +1 -1
- package/dist/commands/board/favorites.d.ts +33 -0
- package/dist/commands/board/favorites.d.ts.map +1 -0
- package/dist/commands/board/favorites.js +74 -0
- package/dist/commands/board/favorites.js.map +1 -0
- package/dist/commands/board/find.d.ts +1 -1
- package/dist/commands/board/group-archive.d.ts.map +1 -1
- package/dist/commands/board/group-archive.js +12 -16
- package/dist/commands/board/group-archive.js.map +1 -1
- package/dist/commands/board/group-create.d.ts.map +1 -1
- package/dist/commands/board/group-create.js +9 -19
- package/dist/commands/board/group-create.js.map +1 -1
- package/dist/commands/board/group-delete.d.ts.map +1 -1
- package/dist/commands/board/group-delete.js +12 -16
- package/dist/commands/board/group-delete.js.map +1 -1
- package/dist/commands/board/group-duplicate.d.ts.map +1 -1
- package/dist/commands/board/group-duplicate.js +12 -16
- package/dist/commands/board/group-duplicate.js.map +1 -1
- package/dist/commands/board/group-update.d.ts.map +1 -1
- package/dist/commands/board/group-update.js +12 -11
- package/dist/commands/board/group-update.js.map +1 -1
- package/dist/commands/board/list.d.ts +1 -1
- package/dist/commands/board/update.d.ts.map +1 -1
- package/dist/commands/board/update.js +16 -11
- package/dist/commands/board/update.js.map +1 -1
- package/dist/commands/cache/list.d.ts +2 -0
- package/dist/commands/cache/list.d.ts.map +1 -1
- package/dist/commands/cache/list.js +2 -2
- package/dist/commands/cache/list.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/dev/_shared.d.ts +40 -0
- package/dist/commands/dev/_shared.d.ts.map +1 -0
- package/dist/commands/dev/_shared.js +104 -0
- package/dist/commands/dev/_shared.js.map +1 -0
- package/dist/commands/dev/configure.d.ts +36 -0
- package/dist/commands/dev/configure.d.ts.map +1 -0
- package/dist/commands/dev/configure.js +145 -0
- package/dist/commands/dev/configure.js.map +1 -0
- package/dist/commands/dev/discover.d.ts +34 -0
- package/dist/commands/dev/discover.d.ts.map +1 -0
- package/dist/commands/dev/discover.js +117 -0
- package/dist/commands/dev/discover.js.map +1 -0
- package/dist/commands/dev/doctor.d.ts +39 -0
- package/dist/commands/dev/doctor.d.ts.map +1 -0
- package/dist/commands/dev/doctor.js +91 -0
- package/dist/commands/dev/doctor.js.map +1 -0
- package/dist/commands/dev/epic/items.d.ts +24 -0
- package/dist/commands/dev/epic/items.d.ts.map +1 -0
- package/dist/commands/dev/epic/items.js +103 -0
- package/dist/commands/dev/epic/items.js.map +1 -0
- package/dist/commands/dev/epic/list.d.ts +36 -0
- package/dist/commands/dev/epic/list.d.ts.map +1 -0
- package/dist/commands/dev/epic/list.js +120 -0
- package/dist/commands/dev/epic/list.js.map +1 -0
- package/dist/commands/dev/release/list.d.ts +21 -0
- package/dist/commands/dev/release/list.d.ts.map +1 -0
- package/dist/commands/dev/release/list.js +73 -0
- package/dist/commands/dev/release/list.js.map +1 -0
- package/dist/commands/dev/sprint/current.d.ts +24 -0
- package/dist/commands/dev/sprint/current.d.ts.map +1 -0
- package/dist/commands/dev/sprint/current.js +90 -0
- package/dist/commands/dev/sprint/current.js.map +1 -0
- package/dist/commands/dev/sprint/items.d.ts +34 -0
- package/dist/commands/dev/sprint/items.d.ts.map +1 -0
- package/dist/commands/dev/sprint/items.js +118 -0
- package/dist/commands/dev/sprint/items.js.map +1 -0
- package/dist/commands/dev/sprint/list.d.ts +41 -0
- package/dist/commands/dev/sprint/list.d.ts.map +1 -0
- package/dist/commands/dev/sprint/list.js +104 -0
- package/dist/commands/dev/sprint/list.js.map +1 -0
- package/dist/commands/dev/task/block.d.ts +29 -0
- package/dist/commands/dev/task/block.d.ts.map +1 -0
- package/dist/commands/dev/task/block.js +106 -0
- package/dist/commands/dev/task/block.js.map +1 -0
- package/dist/commands/dev/task/done.d.ts +30 -0
- package/dist/commands/dev/task/done.d.ts.map +1 -0
- package/dist/commands/dev/task/done.js +113 -0
- package/dist/commands/dev/task/done.js.map +1 -0
- package/dist/commands/dev/task/list.d.ts +42 -0
- package/dist/commands/dev/task/list.d.ts.map +1 -0
- package/dist/commands/dev/task/list.js +227 -0
- package/dist/commands/dev/task/list.js.map +1 -0
- package/dist/commands/dev/task/start.d.ts +29 -0
- package/dist/commands/dev/task/start.d.ts.map +1 -0
- package/dist/commands/dev/task/start.js +90 -0
- package/dist/commands/dev/task/start.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/list.d.ts +83 -0
- package/dist/commands/doc/list.d.ts.map +1 -0
- package/dist/commands/doc/list.js +248 -0
- package/dist/commands/doc/list.js.map +1 -0
- package/dist/commands/emit.d.ts.map +1 -1
- package/dist/commands/emit.js +5 -3
- package/dist/commands/emit.js.map +1 -1
- package/dist/commands/index.d.ts.map +1 -1
- package/dist/commands/index.js +141 -0
- package/dist/commands/index.js.map +1 -1
- package/dist/commands/item/archive.d.ts.map +1 -1
- package/dist/commands/item/archive.js +11 -0
- package/dist/commands/item/archive.js.map +1 -1
- package/dist/commands/item/clear.d.ts.map +1 -1
- package/dist/commands/item/clear.js +15 -0
- package/dist/commands/item/clear.js.map +1 -1
- package/dist/commands/item/create.d.ts.map +1 -1
- package/dist/commands/item/create.js +41 -8
- package/dist/commands/item/create.js.map +1 -1
- package/dist/commands/item/delete.d.ts.map +1 -1
- package/dist/commands/item/delete.js +11 -0
- package/dist/commands/item/delete.js.map +1 -1
- package/dist/commands/item/duplicate.d.ts.map +1 -1
- package/dist/commands/item/duplicate.js +12 -0
- package/dist/commands/item/duplicate.js.map +1 -1
- package/dist/commands/item/history.d.ts +60 -0
- package/dist/commands/item/history.d.ts.map +1 -0
- package/dist/commands/item/history.js +309 -0
- package/dist/commands/item/history.js.map +1 -0
- package/dist/commands/item/list.d.ts.map +1 -1
- package/dist/commands/item/list.js +16 -13
- package/dist/commands/item/list.js.map +1 -1
- package/dist/commands/item/move.d.ts.map +1 -1
- package/dist/commands/item/move.js +41 -7
- package/dist/commands/item/move.js.map +1 -1
- package/dist/commands/item/search.d.ts +99 -15
- package/dist/commands/item/search.d.ts.map +1 -1
- package/dist/commands/item/search.js +480 -36
- package/dist/commands/item/search.js.map +1 -1
- package/dist/commands/item/set.d.ts.map +1 -1
- package/dist/commands/item/set.js +52 -8
- package/dist/commands/item/set.js.map +1 -1
- package/dist/commands/item/time-track/start.d.ts +61 -0
- package/dist/commands/item/time-track/start.d.ts.map +1 -0
- package/dist/commands/item/time-track/start.js +138 -0
- package/dist/commands/item/time-track/start.js.map +1 -0
- package/dist/commands/item/time-track/stop.d.ts +32 -0
- package/dist/commands/item/time-track/stop.d.ts.map +1 -0
- package/dist/commands/item/time-track/stop.js +97 -0
- package/dist/commands/item/time-track/stop.js.map +1 -0
- package/dist/commands/item/update.d.ts +2 -0
- package/dist/commands/item/update.d.ts.map +1 -1
- package/dist/commands/item/update.js +164 -113
- 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/upsert.d.ts.map +1 -1
- package/dist/commands/item/upsert.js +48 -1
- package/dist/commands/item/upsert.js.map +1 -1
- 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/notification/send.d.ts +60 -0
- package/dist/commands/notification/send.d.ts.map +1 -0
- package/dist/commands/notification/send.js +147 -0
- package/dist/commands/notification/send.js.map +1 -0
- package/dist/commands/parse-argv.d.ts.map +1 -1
- package/dist/commands/parse-argv.js +14 -4
- package/dist/commands/parse-argv.js.map +1 -1
- package/dist/commands/raw/index.d.ts.map +1 -1
- package/dist/commands/raw/index.js +13 -15
- package/dist/commands/raw/index.js.map +1 -1
- package/dist/commands/run-by-id-lookup.d.ts.map +1 -1
- package/dist/commands/run-by-id-lookup.js +2 -2
- package/dist/commands/run-by-id-lookup.js.map +1 -1
- package/dist/commands/schema/index.d.ts +2 -0
- package/dist/commands/schema/index.d.ts.map +1 -1
- package/dist/commands/status.d.ts +120 -0
- package/dist/commands/status.d.ts.map +1 -0
- package/dist/commands/status.js +365 -0
- package/dist/commands/status.js.map +1 -0
- package/dist/commands/update/body-source.d.ts.map +1 -1
- package/dist/commands/update/body-source.js +2 -2
- package/dist/commands/update/body-source.js.map +1 -1
- package/dist/commands/update/create.d.ts +2 -3
- package/dist/commands/update/create.d.ts.map +1 -1
- package/dist/commands/update/create.js +15 -3
- package/dist/commands/update/create.js.map +1 -1
- package/dist/commands/update/delete.d.ts.map +1 -1
- package/dist/commands/update/delete.js +11 -0
- package/dist/commands/update/delete.js.map +1 -1
- package/dist/commands/update/edit.d.ts.map +1 -1
- package/dist/commands/update/edit.js +11 -0
- package/dist/commands/update/edit.js.map +1 -1
- package/dist/commands/update/list.d.ts.map +1 -1
- package/dist/commands/update/list.js +15 -12
- package/dist/commands/update/list.js.map +1 -1
- package/dist/commands/update/reply.d.ts.map +1 -1
- package/dist/commands/update/reply.js +11 -0
- package/dist/commands/update/reply.js.map +1 -1
- package/dist/commands/update/toggle.d.ts.map +1 -1
- package/dist/commands/update/toggle.js +13 -0
- package/dist/commands/update/toggle.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/usage.d.ts +58 -0
- package/dist/commands/usage.d.ts.map +1 -0
- package/dist/commands/usage.js +94 -0
- package/dist/commands/usage.js.map +1 -0
- package/dist/commands/webhook/create.d.ts +74 -0
- package/dist/commands/webhook/create.d.ts.map +1 -0
- package/dist/commands/webhook/create.js +150 -0
- package/dist/commands/webhook/create.js.map +1 -0
- package/dist/commands/webhook/delete.d.ts +46 -0
- package/dist/commands/webhook/delete.d.ts.map +1 -0
- package/dist/commands/webhook/delete.js +141 -0
- package/dist/commands/webhook/delete.js.map +1 -0
- package/dist/commands/webhook/list.d.ts +23 -0
- package/dist/commands/webhook/list.d.ts.map +1 -0
- package/dist/commands/webhook/list.js +68 -0
- package/dist/commands/webhook/list.js.map +1 -0
- package/dist/commands/workspace/create.d.ts.map +1 -1
- package/dist/commands/workspace/create.js +16 -0
- package/dist/commands/workspace/create.js.map +1 -1
- package/dist/commands/workspace/delete.d.ts.map +1 -1
- package/dist/commands/workspace/delete.js +13 -13
- package/dist/commands/workspace/delete.js.map +1 -1
- package/dist/commands/workspace/list.d.ts +1 -1
- package/dist/commands/workspace/update.d.ts.map +1 -1
- package/dist/commands/workspace/update.js +15 -15
- package/dist/commands/workspace/update.js.map +1 -1
- package/dist/config/credentials.d.ts +189 -0
- package/dist/config/credentials.d.ts.map +1 -0
- package/dist/config/credentials.js +300 -0
- package/dist/config/credentials.js.map +1 -0
- package/dist/config/profiles.d.ts +125 -0
- package/dist/config/profiles.d.ts.map +1 -0
- package/dist/config/profiles.js +227 -0
- package/dist/config/profiles.js.map +1 -0
- package/dist/types/global-flags.d.ts +1 -1
- package/dist/types/global-flags.d.ts.map +1 -1
- package/dist/types/global-flags.js +28 -16
- package/dist/types/global-flags.js.map +1 -1
- package/dist/types/ids.d.ts +4 -0
- package/dist/types/ids.d.ts.map +1 -1
- package/dist/types/ids.js +12 -3
- package/dist/types/ids.js.map +1 -1
- package/dist/utils/errors.d.ts +57 -3
- package/dist/utils/errors.d.ts.map +1 -1
- package/dist/utils/errors.js +69 -2
- package/dist/utils/errors.js.map +1 -1
- package/dist/utils/fs.d.ts +35 -0
- package/dist/utils/fs.d.ts.map +1 -0
- package/dist/utils/fs.js +36 -0
- package/dist/utils/fs.js.map +1 -0
- package/dist/utils/json.d.ts +60 -0
- package/dist/utils/json.d.ts.map +1 -0
- package/dist/utils/json.js +86 -0
- package/dist/utils/json.js.map +1 -0
- 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 +90 -3
- package/dist/utils/output/ndjson.d.ts.map +1 -1
- package/dist/utils/output/ndjson.js +33 -0
- package/dist/utils/output/ndjson.js.map +1 -1
- package/dist/utils/redact.d.ts.map +1 -1
- package/dist/utils/redact.js +31 -0
- package/dist/utils/redact.js.map +1 -1
- 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/package.json +2 -1
- package/dist/commands/account/client-helper.d.ts +0 -37
- package/dist/commands/account/client-helper.d.ts.map +0 -1
- package/dist/commands/account/client-helper.js +0 -55
- package/dist/commands/account/client-helper.js.map +0 -1
|
@@ -0,0 +1,586 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Workdocs read surface for the v0.4-M32 `monday doc list/get` verbs
|
|
3
|
+
* (`cli-design.md` §2.7 + §4.3 + §13 v0.4 entry; `v0.4-plan.md` §3
|
|
4
|
+
* M32).
|
|
5
|
+
*
|
|
6
|
+
* **Wire surface (empirical probe 2026-05-14, API `2026-01`).** Two
|
|
7
|
+
* Monday GraphQL operations land here, both against `Query.docs(...)`:
|
|
8
|
+
*
|
|
9
|
+
* - **List variant** — `Query.docs(workspace_ids: [ID],
|
|
10
|
+
* order_by: DocsOrderBy, limit: Int, page: Int) → [Document]`.
|
|
11
|
+
* Page/limit pagination (NOT cursor — Monday's workdocs surface
|
|
12
|
+
* has no `items_page`-style cursor). Default `limit: 25` on the
|
|
13
|
+
* wire side; CLI caps `--limit` at `MAX_DOC_LIST_LIMIT = 100`
|
|
14
|
+
* to keep response sizes bounded (each Document is rich-text
|
|
15
|
+
* plus metadata, and a `--limit 500` request could blow past
|
|
16
|
+
* Monday's complexity budget on doc-heavy accounts). `--page`
|
|
17
|
+
* is 1-based.
|
|
18
|
+
* - **Get variant** — `Query.docs(ids: [ID!]) → [Document]` with
|
|
19
|
+
* the per-doc `blocks` selection hydrated. Returns at most one
|
|
20
|
+
* Document (single-id list). The CLI extracts the singleton
|
|
21
|
+
* index 0; an empty array surfaces `not_found` (D8 — Monday's
|
|
22
|
+
* wire collapses doesn't-exist + not-accessible into the same
|
|
23
|
+
* shape), while a null `docs` root surfaces `internal_error`
|
|
24
|
+
* with a drift hint (Monday's documented shape is `[Document]`,
|
|
25
|
+
* possibly empty, never null — null indicates wire-shape
|
|
26
|
+
* regression worth surfacing loudly). The
|
|
27
|
+
* `Document.blocks: [DocumentBlock]` selection adds significant
|
|
28
|
+
* payload, which is why `doc list` ships WITHOUT `blocks` and
|
|
29
|
+
* `doc get` is the per-doc body-hydrating path.
|
|
30
|
+
*
|
|
31
|
+
* **`Document` object — 14 fields.** Per the M32 empirical probe:
|
|
32
|
+
* `id` (ID!), `object_id` (ID!), `blocks` ([DocumentBlock]; null
|
|
33
|
+
* unless hydrated), `created_at` (Date, nullable), `created_by`
|
|
34
|
+
* (User, nullable — projected to the slim `{id, name}` shape for
|
|
35
|
+
* envelope compactness), `doc_folder_id` (ID, nullable),
|
|
36
|
+
* `doc_kind` (BoardKind!, returning `'public'`/`'private'`/
|
|
37
|
+
* `'share'` per the DocKind probe at API `2026-01` — non-null on
|
|
38
|
+
* the wire; the standalone `DocKind` enum exists but isn't
|
|
39
|
+
* returned by `Document.doc_kind`), `name` (String!),
|
|
40
|
+
* `relative_url` (String, nullable),
|
|
41
|
+
* `settings` (JSON, nullable), `updated_at` (Date, nullable),
|
|
42
|
+
* `url` (String, nullable absolute URL), `workspace` (Workspace,
|
|
43
|
+
* nullable — projected to `{id, name}`), `workspace_id` (ID,
|
|
44
|
+
* nullable). The `object_id` is Monday's internal opaque object
|
|
45
|
+
* identifier (distinct from `id`); both flow through verbatim.
|
|
46
|
+
*
|
|
47
|
+
* **BoardKind reuse for `Document.doc_kind`.** Monday's wire schema
|
|
48
|
+
* types `Document.doc_kind` as `BoardKind!` (NOT `DocKind!`) — the
|
|
49
|
+
* `BoardKind` enum is reused across `Board.kind` and
|
|
50
|
+
* `Document.doc_kind`, returning the same three string values
|
|
51
|
+
* (`public`/`private`/`share`). The standalone `DocKind` enum exists
|
|
52
|
+
* on the schema but isn't returned by `Document.doc_kind`; it's a
|
|
53
|
+
* wire-side detail with no agent-visible asymmetry (the CLI surface
|
|
54
|
+
* mirrors the wire string values verbatim). Not a new R-NEW-41
|
|
55
|
+
* consumer — the wire-vs-CLI projection is symmetric.
|
|
56
|
+
*
|
|
57
|
+
* **`DocumentBlock` — 9 fields.** Per the M32 probe: `id` (String!),
|
|
58
|
+
* `type` (String, nullable — block type like `'text'` / `'heading'`
|
|
59
|
+
* / `'list'` / etc., values stay verbatim from Monday's wire),
|
|
60
|
+
* `content` (JSON, nullable — block payload), `position` (Float,
|
|
61
|
+
* nullable — fractional ordering within doc), `parent_block_id`
|
|
62
|
+
* (String, nullable — for nested blocks), `doc_id` (ID, nullable),
|
|
63
|
+
* `created_at` (Date, nullable), `created_by` (User, nullable —
|
|
64
|
+
* projected to slim `{id, name}`), `updated_at` (Date, nullable).
|
|
65
|
+
* Block-content schema validity is NOT cross-checked by the CLI;
|
|
66
|
+
* Monday's wire is the source of truth for what blocks look like.
|
|
67
|
+
*
|
|
68
|
+
* **`DocsOrderBy` enum — 2 values.** `created_at` (most-recently-
|
|
69
|
+
* created first; Monday's documented `desc` ordering) and `used_at`
|
|
70
|
+
* (most-recently-viewed-by-current-user first; also `desc`). No
|
|
71
|
+
* ascending variant on Monday's wire — agents that need ascending
|
|
72
|
+
* sort the projection client-side. Default CLI behaviour: `created_
|
|
73
|
+
* at` (matches Monday's wire default at API `2026-01`).
|
|
74
|
+
*
|
|
75
|
+
* **No new ERROR_CODES (29 stays — D8 closure).** Doc-read failures
|
|
76
|
+
* route through existing codes:
|
|
77
|
+
*
|
|
78
|
+
* - `not_found` — `doc get <did>` against a non-existent or
|
|
79
|
+
* inaccessible doc ID. Monday's wire returns an empty `docs`
|
|
80
|
+
* array for both "doesn't exist" and "exists but token can't
|
|
81
|
+
* read it"; the CLI surfaces both as `not_found` with
|
|
82
|
+
* `details.doc_id`.
|
|
83
|
+
* - `usage_error` — argv-parse rejections (out-of-range `--limit`
|
|
84
|
+
* / `--page`, malformed `--workspace`, unknown `--order-by`).
|
|
85
|
+
* Caught at parse boundary BEFORE any wire call.
|
|
86
|
+
* - `validation_failed` — Monday-side rejection (very rare for
|
|
87
|
+
* reads; included for completeness).
|
|
88
|
+
* - `forbidden` / `unauthorized` — token lacks workdoc read scope.
|
|
89
|
+
*
|
|
90
|
+
* **Docs are live-only at v0.4-M32.** Per cli-design §8 cache scope,
|
|
91
|
+
* workdocs aren't cached — the `doc list` + `doc get` paths emit
|
|
92
|
+
* `meta.source: "live"` with `cache_age_seconds: null`. Workdocs
|
|
93
|
+
* are content-heavy + frequently human-edited, so caching would
|
|
94
|
+
* regularly surface stale prose. Mirrors `monday usage` (M22) +
|
|
95
|
+
* `monday status` (M22) + webhook list (M27) — diagnostics /
|
|
96
|
+
* volatile surfaces don't cache.
|
|
97
|
+
*
|
|
98
|
+
* **Runtime bodies landed at v0.4-M32 IMPL.** `listDocuments` +
|
|
99
|
+
* `getDocument` each issue a single `client.raw` round-trip with
|
|
100
|
+
* `operationName: 'ListDocs'` / `'GetDoc'` pinned literally at the
|
|
101
|
+
* fetcher boundary (R-NEW-37 W2 audit-point — operationNames are
|
|
102
|
+
* NOT caller-overridable). Responses parse through
|
|
103
|
+
* {@link documentSchema} / {@link documentWithBlocksSchema} via
|
|
104
|
+
* `unwrapOrThrow`, so payload drift surfaces `internal_error` with
|
|
105
|
+
* `details.issues`. The `doc get` empty-array case rewraps to
|
|
106
|
+
* `not_found` with `details.doc_id` per D8 (Monday's wire collapses
|
|
107
|
+
* "doesn't exist" + "not visible to token" into the same shape).
|
|
108
|
+
*/
|
|
109
|
+
import { z } from 'zod';
|
|
110
|
+
import { ApiError } from '../utils/errors.js';
|
|
111
|
+
import { unwrapOrThrow } from '../utils/parse-boundary.js';
|
|
112
|
+
/**
|
|
113
|
+
* Schema for a required JSON-scalar slot — the key must be present
|
|
114
|
+
* on the parsed object, but the value can be any JSON shape Monday
|
|
115
|
+
* surfaces (object / array / string / number / boolean / null).
|
|
116
|
+
*
|
|
117
|
+
* Bare `z.unknown()` treats a missing key as "present with value
|
|
118
|
+
* `undefined`", so a wire response that omits `Document.settings`
|
|
119
|
+
* or `DocumentBlock.content` would still pass the strict schema —
|
|
120
|
+
* silently weakening the 13-field / 9-field contract. The
|
|
121
|
+
* `.refine` rejects `undefined` explicitly so a missing key
|
|
122
|
+
* surfaces as a typed parse error at the IMPL response-parse
|
|
123
|
+
* boundary (will fold into `internal_error` via `unwrapOrThrow`),
|
|
124
|
+
* matching every other field's "present-but-typed" semantics.
|
|
125
|
+
*
|
|
126
|
+
* Mirrors the M27 `Webhook.config: z.string().nullable()` pin
|
|
127
|
+
* (config is always present, value can be null) but for JSON-
|
|
128
|
+
* shaped slots whose payload shape varies per surface.
|
|
129
|
+
*/
|
|
130
|
+
const requiredJsonValueSchema = z.unknown().refine((v) => v !== undefined, {
|
|
131
|
+
message: 'required JSON value (may be null, but the key must be present)',
|
|
132
|
+
});
|
|
133
|
+
/**
|
|
134
|
+
* Inclusive range for the `--limit` argv slot on `monday doc list`.
|
|
135
|
+
* Default `25` matches Monday's wire-side default at API `2026-01`
|
|
136
|
+
* (per the M32 empirical probe `Query.docs.args.limit.description`:
|
|
137
|
+
* "Number of items to get, the default is 25"); ceiling `100` keeps
|
|
138
|
+
* worst-case response sizes bounded for doc-heavy accounts (a
|
|
139
|
+
* `--limit 500` request would multiply payload across 500 rich-text
|
|
140
|
+
* Document records, easily blowing Monday's complexity budget).
|
|
141
|
+
*/
|
|
142
|
+
export const MIN_DOC_LIST_LIMIT = 1;
|
|
143
|
+
export const MAX_DOC_LIST_LIMIT = 100;
|
|
144
|
+
export const DEFAULT_DOC_LIST_LIMIT = 25;
|
|
145
|
+
/**
|
|
146
|
+
* Monday's `DocsOrderBy` enum vocabulary (empirical probe 2026-05-14,
|
|
147
|
+
* API `2026-01`; 2 values). Pinned at M32 pre-flight as a closed
|
|
148
|
+
* literal-union enum so unknown `--order-by` values reject at parse
|
|
149
|
+
* boundary with `usage_error`.
|
|
150
|
+
*
|
|
151
|
+
* Both values sort `desc` on Monday's wire (most-recent first); no
|
|
152
|
+
* ascending variant is exposed. Adding a third value to Monday's
|
|
153
|
+
* enum is a minor (additive) bump for the CLI — extend this list +
|
|
154
|
+
* the per-command flag help.
|
|
155
|
+
*/
|
|
156
|
+
export const DOCS_ORDER_BY = ['created_at', 'used_at'];
|
|
157
|
+
export const docsOrderBySchema = z.enum(DOCS_ORDER_BY);
|
|
158
|
+
export const DEFAULT_DOCS_ORDER_BY = 'created_at';
|
|
159
|
+
/**
|
|
160
|
+
* Slim projection of Monday's `User` for the `Document.created_by` +
|
|
161
|
+
* `DocumentBlock.created_by` slots. Mirrors the M19 `account_tags`
|
|
162
|
+
* + M31 `Asset.uploaded_by` slim-User cadence: `{id, name}` only,
|
|
163
|
+
* keeping envelope size bounded. Full-User reads route through
|
|
164
|
+
* `monday user get <uid>`.
|
|
165
|
+
*/
|
|
166
|
+
export const docUserSchema = z
|
|
167
|
+
.object({
|
|
168
|
+
id: z.string().min(1),
|
|
169
|
+
name: z.string().min(1),
|
|
170
|
+
})
|
|
171
|
+
.strict();
|
|
172
|
+
/**
|
|
173
|
+
* Slim projection of Monday's `Workspace` for the `Document.workspace`
|
|
174
|
+
* slot. Same `{id, name}` shape as {@link docUserSchema}. Full-
|
|
175
|
+
* Workspace reads route through `monday workspace get <wid>`.
|
|
176
|
+
*/
|
|
177
|
+
export const docWorkspaceSchema = z
|
|
178
|
+
.object({
|
|
179
|
+
id: z.string().min(1),
|
|
180
|
+
name: z.string().min(1),
|
|
181
|
+
})
|
|
182
|
+
.strict();
|
|
183
|
+
/**
|
|
184
|
+
* `doc_kind` literal-union enum (3 values per the M32 probe + the
|
|
185
|
+
* DocKind introspection result). Monday's wire types this field as
|
|
186
|
+
* `BoardKind!` — see the module header's "BoardKind reuse" note for
|
|
187
|
+
* the wire-side type-name aliasing. The CLI surface mirrors the
|
|
188
|
+
* three string values verbatim with no projection drift.
|
|
189
|
+
*/
|
|
190
|
+
export const DOC_KIND_VALUES = ['public', 'private', 'share'];
|
|
191
|
+
export const docKindSchema = z.enum(DOC_KIND_VALUES);
|
|
192
|
+
/**
|
|
193
|
+
* DocumentBlock projection — Monday's 9-field block shape per the
|
|
194
|
+
* M32 probe. `content` is `JSON` on the wire (block payload — schema
|
|
195
|
+
* varies per `type`); the CLI passes it through unmodified as
|
|
196
|
+
* `unknown` so agents introspect the per-block-type payload
|
|
197
|
+
* themselves (Monday's wire is the source of truth for the per-
|
|
198
|
+
* block-type schema).
|
|
199
|
+
*
|
|
200
|
+
* Only surfaces under `doc get` envelopes (the per-doc body-hydrating
|
|
201
|
+
* path); `doc list` envelopes ship Documents WITHOUT `blocks` per
|
|
202
|
+
* the D6 list-row-projection closure.
|
|
203
|
+
*/
|
|
204
|
+
export const documentBlockSchema = z
|
|
205
|
+
.object({
|
|
206
|
+
id: z.string().min(1),
|
|
207
|
+
type: z.string().nullable(),
|
|
208
|
+
content: requiredJsonValueSchema,
|
|
209
|
+
position: z.number().nullable(),
|
|
210
|
+
parent_block_id: z.string().nullable(),
|
|
211
|
+
doc_id: z.string().nullable(),
|
|
212
|
+
created_at: z.string().nullable(),
|
|
213
|
+
created_by: docUserSchema.nullable(),
|
|
214
|
+
updated_at: z.string().nullable(),
|
|
215
|
+
})
|
|
216
|
+
.strict();
|
|
217
|
+
/**
|
|
218
|
+
* Base Document projection (13 fields — all of Monday's 14 minus
|
|
219
|
+
* `blocks`). Used as the list-row shape under `doc list` envelopes;
|
|
220
|
+
* appended with the required `blocks: [DocumentBlock]` slot for
|
|
221
|
+
* `doc get` envelopes via {@link documentWithBlocksSchema} (the
|
|
222
|
+
* extension makes `blocks` mandatory — `doc get` always hydrates
|
|
223
|
+
* the rich-text body per D6).
|
|
224
|
+
*
|
|
225
|
+
* `settings` is `JSON` on the wire (per-doc display/sharing config)
|
|
226
|
+
* — passed through as `unknown` for the same reason
|
|
227
|
+
* `DocumentBlock.content` is. Agents that need a specific settings
|
|
228
|
+
* key destructure client-side.
|
|
229
|
+
*/
|
|
230
|
+
export const documentSchema = z
|
|
231
|
+
.object({
|
|
232
|
+
id: z.string().min(1),
|
|
233
|
+
object_id: z.string().min(1),
|
|
234
|
+
name: z.string().min(1),
|
|
235
|
+
doc_kind: docKindSchema,
|
|
236
|
+
url: z.string().nullable(),
|
|
237
|
+
relative_url: z.string().nullable(),
|
|
238
|
+
workspace_id: z.string().nullable(),
|
|
239
|
+
workspace: docWorkspaceSchema.nullable(),
|
|
240
|
+
doc_folder_id: z.string().nullable(),
|
|
241
|
+
created_at: z.string().nullable(),
|
|
242
|
+
created_by: docUserSchema.nullable(),
|
|
243
|
+
updated_at: z.string().nullable(),
|
|
244
|
+
settings: requiredJsonValueSchema,
|
|
245
|
+
})
|
|
246
|
+
.strict();
|
|
247
|
+
/**
|
|
248
|
+
* `doc get` projection — base Document + the `blocks` slot hydrated.
|
|
249
|
+
* Same shape as {@link documentSchema} with `blocks:
|
|
250
|
+
* [DocumentBlock]` appended (Monday's wire returns the block array
|
|
251
|
+
* directly under `Document.blocks`; the CLI surfaces it verbatim).
|
|
252
|
+
*
|
|
253
|
+
* `blocks` is non-null on the wire when the selection is requested;
|
|
254
|
+
* an empty doc surfaces `blocks: []` rather than `null`. The schema
|
|
255
|
+
* pins non-null for envelope predictability — an unexpected null
|
|
256
|
+
* surfaces `internal_error` at the IMPL parse boundary.
|
|
257
|
+
*/
|
|
258
|
+
export const documentWithBlocksSchema = documentSchema
|
|
259
|
+
.extend({
|
|
260
|
+
blocks: z.array(documentBlockSchema),
|
|
261
|
+
})
|
|
262
|
+
.strict();
|
|
263
|
+
/**
|
|
264
|
+
* Output shape for `monday doc list [--workspace <wid>,...]
|
|
265
|
+
* [--order-by <created_at|used_at>] [--limit <n>] [--page <n>]`.
|
|
266
|
+
* Wrapped record (NOT bare array) because page/limit pagination
|
|
267
|
+
* surfaces pagination context inline rather than via `meta.cursor`
|
|
268
|
+
* (cli-design §6.1 cursor slot is for items_page-style surfaces;
|
|
269
|
+
* the workdocs wire has no cursor).
|
|
270
|
+
*
|
|
271
|
+
* `documents` — Monday's wire-ordered array (server-applied
|
|
272
|
+
* `created_at desc` or `used_at desc` per `--order-by`).
|
|
273
|
+
* `page` / `limit` — echoed inputs confirming what the wire saw.
|
|
274
|
+
* `returned_count` — `documents.length` cached for agent ergonomics.
|
|
275
|
+
* `has_more` — heuristic `returned_count === limit`; Monday's wire
|
|
276
|
+
* doesn't surface a total count, so "exactly `limit` rows returned"
|
|
277
|
+
* is the only signal that a follow-up page exists. Agents
|
|
278
|
+
* pessimistically re-fetch with `page + 1` if `has_more: true`.
|
|
279
|
+
*/
|
|
280
|
+
export const docListOutputSchema = z
|
|
281
|
+
.object({
|
|
282
|
+
documents: z.array(documentSchema),
|
|
283
|
+
page: z.number().int().min(1),
|
|
284
|
+
limit: z
|
|
285
|
+
.number()
|
|
286
|
+
.int()
|
|
287
|
+
.min(MIN_DOC_LIST_LIMIT)
|
|
288
|
+
.max(MAX_DOC_LIST_LIMIT),
|
|
289
|
+
returned_count: z.number().int().min(0),
|
|
290
|
+
has_more: z.boolean(),
|
|
291
|
+
})
|
|
292
|
+
.strict()
|
|
293
|
+
// Pagination-invariant cross-field check (round-2 P2-1 fix +
|
|
294
|
+
// round-3 P2-1 guard). The schema-level field types/ranges don't
|
|
295
|
+
// enforce the documented invariants between `returned_count` /
|
|
296
|
+
// `documents.length` / `limit` / `has_more` — an IMPL bug could
|
|
297
|
+
// emit inconsistent pagination data and still pass output
|
|
298
|
+
// validation, then bleed agent-visible drift into the envelope.
|
|
299
|
+
// Pin the two invariants here so the unwrap-or-throw boundary
|
|
300
|
+
// catches violations at parse time:
|
|
301
|
+
//
|
|
302
|
+
// 1. `returned_count === documents.length` — the count field is
|
|
303
|
+
// the cached array length, not an independent counter.
|
|
304
|
+
// 2. `has_more === (returned_count === limit)` — Monday's wire
|
|
305
|
+
// surface doesn't expose a total-count, so "exactly `limit`
|
|
306
|
+
// rows returned" is the only signal that a follow-up page
|
|
307
|
+
// may exist (D9 closure).
|
|
308
|
+
//
|
|
309
|
+
// **Round-3 P2-1 fix — early-return guard.** Zod's `.superRefine`
|
|
310
|
+
// still runs even when scalar range checks above have produced
|
|
311
|
+
// "dirty" issues. Without this guard, a malformed input like
|
|
312
|
+
// `{ limit: 0, returned_count: 0, has_more: false }` would emit
|
|
313
|
+
// BOTH the legitimate `limit` range-floor violation AND a
|
|
314
|
+
// misleading `has_more` invariant violation (because `has_more
|
|
315
|
+
// === (returned_count === limit)` evaluates against the invalid
|
|
316
|
+
// limit value). Short-circuit when participating scalars are
|
|
317
|
+
// out-of-range so the user sees only the underlying range
|
|
318
|
+
// violation, not a derived inconsistency error stacked on top.
|
|
319
|
+
.superRefine((value, ctx) => {
|
|
320
|
+
if (value.limit < MIN_DOC_LIST_LIMIT ||
|
|
321
|
+
value.limit > MAX_DOC_LIST_LIMIT ||
|
|
322
|
+
value.returned_count < 0 ||
|
|
323
|
+
!Number.isInteger(value.limit) ||
|
|
324
|
+
!Number.isInteger(value.returned_count)) {
|
|
325
|
+
return;
|
|
326
|
+
}
|
|
327
|
+
if (value.returned_count !== value.documents.length) {
|
|
328
|
+
ctx.addIssue({
|
|
329
|
+
code: 'custom',
|
|
330
|
+
path: ['returned_count'],
|
|
331
|
+
message: `returned_count (${String(value.returned_count)}) must equal ` +
|
|
332
|
+
`documents.length (${String(value.documents.length)})`,
|
|
333
|
+
});
|
|
334
|
+
}
|
|
335
|
+
const expectedHasMore = value.returned_count === value.limit;
|
|
336
|
+
if (value.has_more !== expectedHasMore) {
|
|
337
|
+
ctx.addIssue({
|
|
338
|
+
code: 'custom',
|
|
339
|
+
path: ['has_more'],
|
|
340
|
+
message: `has_more (${String(value.has_more)}) must equal ` +
|
|
341
|
+
`(returned_count === limit) which is ${String(expectedHasMore)}`,
|
|
342
|
+
});
|
|
343
|
+
}
|
|
344
|
+
});
|
|
345
|
+
/**
|
|
346
|
+
* Output shape for `monday doc get <did>`. Direct unwrap of the
|
|
347
|
+
* single Document (with blocks hydrated) — matches the convention
|
|
348
|
+
* for read-one verbs (`monday board get <bid>` returns `data:
|
|
349
|
+
* <Board>`, `monday user get <uid>` returns `data: <User>`).
|
|
350
|
+
*
|
|
351
|
+
* The Document's own `id` field is the echoed input — no separate
|
|
352
|
+
* `doc_id` slot needed.
|
|
353
|
+
*/
|
|
354
|
+
export const docGetOutputSchema = documentWithBlocksSchema;
|
|
355
|
+
/**
|
|
356
|
+
* GraphQL query document for `Query.docs(...)` listing variant.
|
|
357
|
+
* Operation name pinned literally to `ListDocs` and matches the
|
|
358
|
+
* wire `operationName` payload (R-NEW-37 W2 audit-point — caller-
|
|
359
|
+
* overridable operationName slots were closed at M27 IMPL round-1
|
|
360
|
+
* P2-1; M32 maintains the safely-by-construction shape).
|
|
361
|
+
*
|
|
362
|
+
* Selects every list-row field (no `blocks` selection — list rows
|
|
363
|
+
* project the 13-field base shape per D6). `workspace_ids:` typed
|
|
364
|
+
* as `[ID]` to mirror Monday's wire signature (the inner ID is
|
|
365
|
+
* nullable on Monday's side — an empirical-probe finding that
|
|
366
|
+
* doesn't show up in the contract today but stays preserved for
|
|
367
|
+
* future-proofing).
|
|
368
|
+
*/
|
|
369
|
+
export const LIST_DOCS_QUERY = `
|
|
370
|
+
query ListDocs(
|
|
371
|
+
$workspaceIds: [ID],
|
|
372
|
+
$orderBy: DocsOrderBy,
|
|
373
|
+
$limit: Int,
|
|
374
|
+
$page: Int
|
|
375
|
+
) {
|
|
376
|
+
docs(
|
|
377
|
+
workspace_ids: $workspaceIds,
|
|
378
|
+
order_by: $orderBy,
|
|
379
|
+
limit: $limit,
|
|
380
|
+
page: $page
|
|
381
|
+
) {
|
|
382
|
+
id
|
|
383
|
+
object_id
|
|
384
|
+
name
|
|
385
|
+
doc_kind
|
|
386
|
+
url
|
|
387
|
+
relative_url
|
|
388
|
+
workspace_id
|
|
389
|
+
workspace { id name }
|
|
390
|
+
doc_folder_id
|
|
391
|
+
created_at
|
|
392
|
+
created_by { id name }
|
|
393
|
+
updated_at
|
|
394
|
+
settings
|
|
395
|
+
}
|
|
396
|
+
}
|
|
397
|
+
`;
|
|
398
|
+
/**
|
|
399
|
+
* GraphQL query document for `Query.docs(ids:)` single-id read
|
|
400
|
+
* variant. Operation name pinned to `GetDoc` (R-NEW-37 W2). Selects
|
|
401
|
+
* all base Document fields plus the `blocks` selection (the per-doc
|
|
402
|
+
* body-hydrating leg).
|
|
403
|
+
*
|
|
404
|
+
* Single-id wire shape — Monday returns `[Document]` (an array even
|
|
405
|
+
* for one id); the fetcher extracts index 0. An empty array
|
|
406
|
+
* (Monday's response for "doc not found" or "doc not visible to
|
|
407
|
+
* token") surfaces `not_found` with `details.doc_id`.
|
|
408
|
+
*/
|
|
409
|
+
export const GET_DOC_QUERY = `
|
|
410
|
+
query GetDoc($ids: [ID!]!) {
|
|
411
|
+
docs(ids: $ids) {
|
|
412
|
+
id
|
|
413
|
+
object_id
|
|
414
|
+
name
|
|
415
|
+
doc_kind
|
|
416
|
+
url
|
|
417
|
+
relative_url
|
|
418
|
+
workspace_id
|
|
419
|
+
workspace { id name }
|
|
420
|
+
doc_folder_id
|
|
421
|
+
created_at
|
|
422
|
+
created_by { id name }
|
|
423
|
+
updated_at
|
|
424
|
+
settings
|
|
425
|
+
blocks {
|
|
426
|
+
id
|
|
427
|
+
type
|
|
428
|
+
content
|
|
429
|
+
position
|
|
430
|
+
parent_block_id
|
|
431
|
+
doc_id
|
|
432
|
+
created_at
|
|
433
|
+
created_by { id name }
|
|
434
|
+
updated_at
|
|
435
|
+
}
|
|
436
|
+
}
|
|
437
|
+
}
|
|
438
|
+
`;
|
|
439
|
+
/**
|
|
440
|
+
* Wrapping response schema for the `ListDocs` operation. Monday's
|
|
441
|
+
* documented wire shape is `[Document]` (an array, possibly empty)
|
|
442
|
+
* — never null. The wrapper accepts `null` defensively so a wire-
|
|
443
|
+
* shape regression parses cleanly and is rewrapped by the fetcher
|
|
444
|
+
* as `internal_error` with a drift hint (rather than faulting the
|
|
445
|
+
* parse with a confusing zod issue path). Both fetchers reject a
|
|
446
|
+
* null root post-parse; null is NEVER a `not_found` rewrap target
|
|
447
|
+
* — that's the empty-array D8 case in `getDocument`.
|
|
448
|
+
*
|
|
449
|
+
* `.loose()` mirrors the M27 `listWebhooksResponseSchema` cadence —
|
|
450
|
+
* Monday occasionally returns side-band debug keys (`extensions`,
|
|
451
|
+
* `account_id`) alongside the documented data root; the loose
|
|
452
|
+
* mode lets them pass without faulting the parse.
|
|
453
|
+
*/
|
|
454
|
+
const listDocsResponseSchema = z
|
|
455
|
+
.object({
|
|
456
|
+
docs: z.array(documentSchema).nullable(),
|
|
457
|
+
})
|
|
458
|
+
.loose();
|
|
459
|
+
/**
|
|
460
|
+
* Wrapping response schema for the `GetDoc` operation. Same shape
|
|
461
|
+
* as the list variant but with `blocks` hydrated on every entry.
|
|
462
|
+
*/
|
|
463
|
+
const getDocResponseSchema = z
|
|
464
|
+
.object({
|
|
465
|
+
docs: z.array(documentWithBlocksSchema).nullable(),
|
|
466
|
+
})
|
|
467
|
+
.loose();
|
|
468
|
+
/**
|
|
469
|
+
* Fetches the workdocs visible to the token via a single
|
|
470
|
+
* `Query.docs(...)` round-trip with `operationName: 'ListDocs'`
|
|
471
|
+
* (R-NEW-37 W2). Source is always `'live'` per cli-design §8 cache
|
|
472
|
+
* scope; workdocs aren't cached at v0.4 per D7.
|
|
473
|
+
*
|
|
474
|
+
* Variables map to Monday's wire `Query.docs(...)` args:
|
|
475
|
+
* `workspaceIds` → `workspace_ids: [ID]`; `orderBy` →
|
|
476
|
+
* `order_by: DocsOrderBy`; `limit` → `limit: Int`; `page` →
|
|
477
|
+
* `page: Int`. Omitted inputs drop the corresponding `$variable`
|
|
478
|
+
* so Monday's per-arg server-side default applies (rather than
|
|
479
|
+
* threading an explicit `null` that the wire treats as "field
|
|
480
|
+
* present").
|
|
481
|
+
*
|
|
482
|
+
* Echoed `page` / `limit` carry Monday's defaults when the caller
|
|
483
|
+
* omits them ({@link DEFAULT_DOC_LIST_LIMIT} for limit, `1` for
|
|
484
|
+
* page) so the envelope's pagination-invariant `.superRefine`
|
|
485
|
+
* sees consistent values regardless of which inputs the verb
|
|
486
|
+
* received.
|
|
487
|
+
*
|
|
488
|
+
* A null `docs` root surfaces `internal_error` (Monday's documented
|
|
489
|
+
* shape is `[Document]` even for empty accounts — the array, never
|
|
490
|
+
* null at this layer). Schema drift in the per-doc shape rewraps to
|
|
491
|
+
* `internal_error` with `details.issues` via `unwrapOrThrow`.
|
|
492
|
+
*/
|
|
493
|
+
export const listDocuments = async (inputs) => {
|
|
494
|
+
const variables = {};
|
|
495
|
+
if (inputs.workspaceIds !== undefined) {
|
|
496
|
+
variables.workspaceIds = inputs.workspaceIds;
|
|
497
|
+
}
|
|
498
|
+
if (inputs.orderBy !== undefined) {
|
|
499
|
+
variables.orderBy = inputs.orderBy;
|
|
500
|
+
}
|
|
501
|
+
if (inputs.limit !== undefined) {
|
|
502
|
+
variables.limit = inputs.limit;
|
|
503
|
+
}
|
|
504
|
+
if (inputs.page !== undefined) {
|
|
505
|
+
variables.page = inputs.page;
|
|
506
|
+
}
|
|
507
|
+
const response = await inputs.client.raw(LIST_DOCS_QUERY, variables, { operationName: 'ListDocs' });
|
|
508
|
+
const parsed = unwrapOrThrow(listDocsResponseSchema.safeParse(response.data), {
|
|
509
|
+
context: 'Monday `Query.docs(ListDocs)` response',
|
|
510
|
+
hint: 'Monday may have amended the `Document` selection — re-probe and amend `src/api/documents.ts` if so',
|
|
511
|
+
});
|
|
512
|
+
if (parsed.docs === null) {
|
|
513
|
+
throw new ApiError('internal_error', 'Monday returned a null `docs` payload from ListDocs', {
|
|
514
|
+
details: {
|
|
515
|
+
hint: 'Monday\'s documented shape is `[Document]` (an array, possibly empty) — ' +
|
|
516
|
+
'a null root indicates a wire change that needs re-probing',
|
|
517
|
+
},
|
|
518
|
+
});
|
|
519
|
+
}
|
|
520
|
+
return {
|
|
521
|
+
documents: parsed.docs,
|
|
522
|
+
page: inputs.page ?? 1,
|
|
523
|
+
limit: inputs.limit ?? DEFAULT_DOC_LIST_LIMIT,
|
|
524
|
+
source: 'live',
|
|
525
|
+
cacheAgeSeconds: null,
|
|
526
|
+
complexity: response.complexity,
|
|
527
|
+
};
|
|
528
|
+
};
|
|
529
|
+
/**
|
|
530
|
+
* Fetches a single workdoc by ID via a single `Query.docs(ids:)`
|
|
531
|
+
* round-trip with `operationName: 'GetDoc'` (R-NEW-37 W2). Returns
|
|
532
|
+
* the Document with `blocks` hydrated. Source is always `'live'`
|
|
533
|
+
* per cli-design §8 cache scope.
|
|
534
|
+
*
|
|
535
|
+
* Empty wire response (Monday's shape for "doc doesn't exist" OR
|
|
536
|
+
* "doc not visible to token") surfaces `not_found` with
|
|
537
|
+
* `details.doc_id` — no `forbidden` rewrap, because Monday's wire
|
|
538
|
+
* collapses the two cases into one shape and the CLI can't
|
|
539
|
+
* distinguish them per D8.
|
|
540
|
+
*
|
|
541
|
+
* A multi-element wire response (which Monday's `docs(ids:)`
|
|
542
|
+
* shouldn't return for a single-id query) surfaces `internal_error`
|
|
543
|
+
* as a defensive guard — the CLI assumes one doc per id and a
|
|
544
|
+
* count mismatch indicates a wire-shape regression worth surfacing
|
|
545
|
+
* loudly rather than silently dropping entries.
|
|
546
|
+
*/
|
|
547
|
+
export const getDocument = async (inputs) => {
|
|
548
|
+
const response = await inputs.client.raw(GET_DOC_QUERY, { ids: [inputs.docId] }, { operationName: 'GetDoc' });
|
|
549
|
+
const parsed = unwrapOrThrow(getDocResponseSchema.safeParse(response.data), {
|
|
550
|
+
context: 'Monday `Query.docs(GetDoc)` response',
|
|
551
|
+
details: { doc_id: inputs.docId },
|
|
552
|
+
hint: 'Monday may have amended the `Document` / `DocumentBlock` selection — re-probe and amend `src/api/documents.ts` if so',
|
|
553
|
+
});
|
|
554
|
+
if (parsed.docs === null) {
|
|
555
|
+
throw new ApiError('internal_error', `Monday returned a null \`docs\` payload from GetDoc(${inputs.docId})`, {
|
|
556
|
+
details: {
|
|
557
|
+
doc_id: inputs.docId,
|
|
558
|
+
hint: 'Monday\'s documented shape is `[Document]` (an array, possibly empty) — ' +
|
|
559
|
+
'a null root indicates a wire change that needs re-probing',
|
|
560
|
+
},
|
|
561
|
+
});
|
|
562
|
+
}
|
|
563
|
+
if (parsed.docs.length === 0) {
|
|
564
|
+
throw new ApiError('not_found', `workdoc ${inputs.docId} not found (does not exist or not visible to token)`, { details: { doc_id: inputs.docId } });
|
|
565
|
+
}
|
|
566
|
+
if (parsed.docs.length > 1) {
|
|
567
|
+
throw new ApiError('internal_error', `Monday returned ${String(parsed.docs.length)} docs for a single-id GetDoc query`, {
|
|
568
|
+
details: {
|
|
569
|
+
doc_id: inputs.docId,
|
|
570
|
+
hint: 'wire shape regression — re-probe `Query.docs(ids:)`',
|
|
571
|
+
},
|
|
572
|
+
});
|
|
573
|
+
}
|
|
574
|
+
const [document] = parsed.docs;
|
|
575
|
+
/* c8 ignore next 6 */
|
|
576
|
+
if (document === undefined) {
|
|
577
|
+
throw new ApiError('internal_error', `Monday returned a sparse docs array for GetDoc(${inputs.docId})`, { details: { doc_id: inputs.docId } });
|
|
578
|
+
}
|
|
579
|
+
return {
|
|
580
|
+
document,
|
|
581
|
+
source: 'live',
|
|
582
|
+
cacheAgeSeconds: null,
|
|
583
|
+
complexity: response.complexity,
|
|
584
|
+
};
|
|
585
|
+
};
|
|
586
|
+
//# sourceMappingURL=documents.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"documents.js","sourceRoot":"","sources":["../../src/api/documents.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA2GG;AAEH,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AACxB,OAAO,EAAE,QAAQ,EAAE,MAAM,oBAAoB,CAAC;AAC9C,OAAO,EAAE,aAAa,EAAE,MAAM,4BAA4B,CAAC;AAI3D;;;;;;;;;;;;;;;;;GAiBG;AACH,MAAM,uBAAuB,GAAG,CAAC,CAAC,OAAO,EAAE,CAAC,MAAM,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,KAA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source of truth. The `operation` field in each
|
|
36
36
|
* `PlannedChange` reflects what the live call would issue.
|
|
37
37
|
*
|
|
38
|
-
* **Resolved-from echoes.**
|
|
38
|
+
* **Resolved-from echoes.** Four slots, one per kind (mutually
|
|
39
|
+
* exclusive — `assertEchoExclusivity` enforces; populating two
|
|
40
|
+
* surfaces `internal_error`):
|
|
39
41
|
* - **Date** — relative tokens carry a `DateResolution`
|
|
40
42
|
* (`{input, timezone, now}`) on the translated value. Rendered
|
|
41
43
|
* as `details.resolved_from` on the diff cell.
|
|
@@ -43,15 +45,25 @@
|
|
|
43
45
|
* `PeopleResolution` (`{tokens: [{input, resolved_id}, ...]}`)
|
|
44
46
|
* pairing each input token with its resolved Monday user ID.
|
|
45
47
|
* Rendered as `details.resolved_from` on people diff cells.
|
|
48
|
+
* - **Tags (M19)** — the tags translator emits a `TagResolution`
|
|
49
|
+
* (same `{tokens: [{input, resolved_id}, ...]}` shape as
|
|
50
|
+
* people) pairing each input tag-name with its resolved Monday
|
|
51
|
+
* tag ID.
|
|
52
|
+
* - **Relation (M19)** — `board_relation` and `dependency`
|
|
53
|
+
* translators emit a `RelationResolution` (`{context,
|
|
54
|
+
* allowed_boards, items: [{input, resolved_board_id}, ...]}`)
|
|
55
|
+
* surfacing the validator's per-item home-board mapping
|
|
56
|
+
* alongside the column's allowed-board list.
|
|
46
57
|
*
|
|
47
|
-
* Other types (status / dropdown / text / long_text / numbers
|
|
48
|
-
* non-relative dates) emit no `details`
|
|
49
|
-
* resolve beyond what's already visible
|
|
58
|
+
* Other types (status / dropdown / text / long_text / numbers /
|
|
59
|
+
* link / email / phone and non-relative dates) emit no `details`
|
|
60
|
+
* block — there's nothing to resolve beyond what's already visible
|
|
61
|
+
* in the wire payload.
|
|
50
62
|
*/
|
|
51
63
|
import type { MondayClient } from './client.js';
|
|
52
64
|
import type { JsonValue } from '../types/json.js';
|
|
53
65
|
import { type ResolverWarning } from './columns.js';
|
|
54
|
-
import { type DateResolutionContext, type PeopleResolutionContext } from './column-values.js';
|
|
66
|
+
import { type DateResolutionContext, type PeopleResolutionContext, type RelationResolutionContext, type TagResolutionContext } from './column-values.js';
|
|
55
67
|
import type { ParsedSetRawExpression } from './raw-write.js';
|
|
56
68
|
/**
|
|
57
69
|
* One agent-supplied `--set <token>=<value>` pair, pre-split by the
|
|
@@ -110,6 +122,19 @@ export interface PlanChangesInputs {
|
|
|
110
122
|
* `translateColumnValueAsync` raises `internal_error` if missing.
|
|
111
123
|
*/
|
|
112
124
|
readonly peopleResolution?: PeopleResolutionContext;
|
|
125
|
+
/**
|
|
126
|
+
* Tag-resolution context — `resolveTags` (M19+). Required when
|
|
127
|
+
* any `--set` pair targets a `tags` column;
|
|
128
|
+
* `translateColumnValueAsync` raises `internal_error` if missing.
|
|
129
|
+
*/
|
|
130
|
+
readonly tagResolution?: TagResolutionContext;
|
|
131
|
+
/**
|
|
132
|
+
* Relation-resolution context — `validateItems` (M19+). Required
|
|
133
|
+
* when any `--set` pair targets a `board_relation` or `dependency`
|
|
134
|
+
* column; `translateColumnValueAsync` raises `internal_error`
|
|
135
|
+
* if missing.
|
|
136
|
+
*/
|
|
137
|
+
readonly relationResolution?: RelationResolutionContext;
|
|
113
138
|
/** Cache root + tz from process.env; defaults to `process.env`. */
|
|
114
139
|
readonly env?: NodeJS.ProcessEnv;
|
|
115
140
|
/** `--no-cache`: skip the column-metadata cache entirely. */
|
|
@@ -260,6 +285,8 @@ export interface PlanCreateInputs {
|
|
|
260
285
|
readonly rawEntries?: readonly ParsedSetRawExpression[];
|
|
261
286
|
readonly dateResolution?: DateResolutionContext;
|
|
262
287
|
readonly peopleResolution?: PeopleResolutionContext;
|
|
288
|
+
readonly tagResolution?: TagResolutionContext;
|
|
289
|
+
readonly relationResolution?: RelationResolutionContext;
|
|
263
290
|
readonly env?: NodeJS.ProcessEnv;
|
|
264
291
|
readonly noCache?: boolean;
|
|
265
292
|
}
|