monday-cli 0.2.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 +439 -0
- package/LICENSE +21 -0
- package/README.md +431 -0
- package/dist/api/board-child-finder.d.ts +95 -0
- package/dist/api/board-child-finder.d.ts.map +1 -0
- package/dist/api/board-child-finder.js +89 -0
- package/dist/api/board-child-finder.js.map +1 -0
- package/dist/api/board-metadata.d.ts +162 -0
- package/dist/api/board-metadata.d.ts.map +1 -0
- package/dist/api/board-metadata.js +238 -0
- package/dist/api/board-metadata.js.map +1 -0
- package/dist/api/board-mutation-invalidation.d.ts +153 -0
- package/dist/api/board-mutation-invalidation.d.ts.map +1 -0
- package/dist/api/board-mutation-invalidation.js +136 -0
- package/dist/api/board-mutation-invalidation.js.map +1 -0
- package/dist/api/board-mutation-result.d.ts +97 -0
- package/dist/api/board-mutation-result.d.ts.map +1 -0
- package/dist/api/board-mutation-result.js +99 -0
- package/dist/api/board-mutation-result.js.map +1 -0
- package/dist/api/board-projection.d.ts +68 -0
- package/dist/api/board-projection.d.ts.map +1 -0
- package/dist/api/board-projection.js +79 -0
- package/dist/api/board-projection.js.map +1 -0
- package/dist/api/cache.d.ts +150 -0
- package/dist/api/cache.d.ts.map +1 -0
- package/dist/api/cache.js +418 -0
- package/dist/api/cache.js.map +1 -0
- package/dist/api/client.d.ts +162 -0
- package/dist/api/client.d.ts.map +1 -0
- package/dist/api/client.js +205 -0
- package/dist/api/client.js.map +1 -0
- package/dist/api/column-mapping.d.ts +68 -0
- package/dist/api/column-mapping.d.ts.map +1 -0
- package/dist/api/column-mapping.js +117 -0
- package/dist/api/column-mapping.js.map +1 -0
- package/dist/api/column-mutation-result.d.ts +136 -0
- package/dist/api/column-mutation-result.d.ts.map +1 -0
- package/dist/api/column-mutation-result.js +130 -0
- package/dist/api/column-mutation-result.js.map +1 -0
- package/dist/api/column-types.d.ts +215 -0
- package/dist/api/column-types.d.ts.map +1 -0
- package/dist/api/column-types.js +195 -0
- package/dist/api/column-types.js.map +1 -0
- package/dist/api/column-values.d.ts +446 -0
- package/dist/api/column-values.d.ts.map +1 -0
- package/dist/api/column-values.js +795 -0
- package/dist/api/column-values.js.map +1 -0
- package/dist/api/columns.d.ts +205 -0
- package/dist/api/columns.d.ts.map +1 -0
- package/dist/api/columns.js +343 -0
- package/dist/api/columns.js.map +1 -0
- package/dist/api/complexity.d.ts +90 -0
- package/dist/api/complexity.d.ts.map +1 -0
- package/dist/api/complexity.js +194 -0
- package/dist/api/complexity.js.map +1 -0
- package/dist/api/dates.d.ts +150 -0
- package/dist/api/dates.d.ts.map +1 -0
- package/dist/api/dates.js +490 -0
- package/dist/api/dates.js.map +1 -0
- package/dist/api/destructive-gate.d.ts +107 -0
- package/dist/api/destructive-gate.d.ts.map +1 -0
- package/dist/api/destructive-gate.js +19 -0
- package/dist/api/destructive-gate.js.map +1 -0
- package/dist/api/dry-run.d.ts +338 -0
- package/dist/api/dry-run.d.ts.map +1 -0
- package/dist/api/dry-run.js +607 -0
- package/dist/api/dry-run.js.map +1 -0
- package/dist/api/emails.d.ts +60 -0
- package/dist/api/emails.d.ts.map +1 -0
- package/dist/api/emails.js +113 -0
- package/dist/api/emails.js.map +1 -0
- package/dist/api/errors.d.ts +82 -0
- package/dist/api/errors.d.ts.map +1 -0
- package/dist/api/errors.js +434 -0
- package/dist/api/errors.js.map +1 -0
- package/dist/api/filters.d.ts +198 -0
- package/dist/api/filters.d.ts.map +1 -0
- package/dist/api/filters.js +328 -0
- package/dist/api/filters.js.map +1 -0
- package/dist/api/group-color.d.ts +33 -0
- package/dist/api/group-color.d.ts.map +1 -0
- package/dist/api/group-color.js +80 -0
- package/dist/api/group-color.js.map +1 -0
- package/dist/api/group-mutation-result.d.ts +150 -0
- package/dist/api/group-mutation-result.d.ts.map +1 -0
- package/dist/api/group-mutation-result.js +141 -0
- package/dist/api/group-mutation-result.js.map +1 -0
- package/dist/api/iso-country-codes.d.ts +45 -0
- package/dist/api/iso-country-codes.d.ts.map +1 -0
- package/dist/api/iso-country-codes.js +71 -0
- package/dist/api/iso-country-codes.js.map +1 -0
- package/dist/api/item-board-lookup.d.ts +86 -0
- package/dist/api/item-board-lookup.d.ts.map +1 -0
- package/dist/api/item-board-lookup.js +140 -0
- package/dist/api/item-board-lookup.js.map +1 -0
- package/dist/api/item-helpers.d.ts +133 -0
- package/dist/api/item-helpers.d.ts.map +1 -0
- package/dist/api/item-helpers.js +139 -0
- package/dist/api/item-helpers.js.map +1 -0
- package/dist/api/item-mutation-result.d.ts +60 -0
- package/dist/api/item-mutation-result.d.ts.map +1 -0
- package/dist/api/item-mutation-result.js +63 -0
- package/dist/api/item-mutation-result.js.map +1 -0
- package/dist/api/item-projection.d.ts +165 -0
- package/dist/api/item-projection.d.ts.map +1 -0
- package/dist/api/item-projection.js +235 -0
- package/dist/api/item-projection.js.map +1 -0
- package/dist/api/item-source-read.d.ts +45 -0
- package/dist/api/item-source-read.d.ts.map +1 -0
- package/dist/api/item-source-read.js +57 -0
- package/dist/api/item-source-read.js.map +1 -0
- package/dist/api/items-page-walker.d.ts +126 -0
- package/dist/api/items-page-walker.d.ts.map +1 -0
- package/dist/api/items-page-walker.js +256 -0
- package/dist/api/items-page-walker.js.map +1 -0
- package/dist/api/links.d.ts +70 -0
- package/dist/api/links.d.ts.map +1 -0
- package/dist/api/links.js +128 -0
- package/dist/api/links.js.map +1 -0
- package/dist/api/me-token.d.ts +52 -0
- package/dist/api/me-token.d.ts.map +1 -0
- package/dist/api/me-token.js +55 -0
- package/dist/api/me-token.js.map +1 -0
- package/dist/api/pagination.d.ts +201 -0
- package/dist/api/pagination.d.ts.map +1 -0
- package/dist/api/pagination.js +223 -0
- package/dist/api/pagination.js.map +1 -0
- package/dist/api/partial-success-mutation.d.ts +28 -0
- package/dist/api/partial-success-mutation.d.ts.map +1 -0
- package/dist/api/partial-success-mutation.js +68 -0
- package/dist/api/partial-success-mutation.js.map +1 -0
- package/dist/api/people.d.ts +182 -0
- package/dist/api/people.d.ts.map +1 -0
- package/dist/api/people.js +260 -0
- package/dist/api/people.js.map +1 -0
- package/dist/api/phones.d.ts +74 -0
- package/dist/api/phones.d.ts.map +1 -0
- package/dist/api/phones.js +167 -0
- package/dist/api/phones.js.map +1 -0
- package/dist/api/raw-document.d.ts +53 -0
- package/dist/api/raw-document.d.ts.map +1 -0
- package/dist/api/raw-document.js +177 -0
- package/dist/api/raw-document.js.map +1 -0
- package/dist/api/raw-write.d.ts +127 -0
- package/dist/api/raw-write.d.ts.map +1 -0
- package/dist/api/raw-write.js +233 -0
- package/dist/api/raw-write.js.map +1 -0
- package/dist/api/resolution-context.d.ts +32 -0
- package/dist/api/resolution-context.d.ts.map +1 -0
- package/dist/api/resolution-context.js +42 -0
- package/dist/api/resolution-context.js.map +1 -0
- package/dist/api/resolution-pass.d.ts +163 -0
- package/dist/api/resolution-pass.d.ts.map +1 -0
- package/dist/api/resolution-pass.js +254 -0
- package/dist/api/resolution-pass.js.map +1 -0
- package/dist/api/resolve-client.d.ts +69 -0
- package/dist/api/resolve-client.d.ts.map +1 -0
- package/dist/api/resolve-client.js +70 -0
- package/dist/api/resolve-client.js.map +1 -0
- package/dist/api/resolver-error-fold.d.ts +176 -0
- package/dist/api/resolver-error-fold.d.ts.map +1 -0
- package/dist/api/resolver-error-fold.js +230 -0
- package/dist/api/resolver-error-fold.js.map +1 -0
- package/dist/api/resolvers.d.ts +131 -0
- package/dist/api/resolvers.d.ts.map +1 -0
- package/dist/api/resolvers.js +262 -0
- package/dist/api/resolvers.js.map +1 -0
- package/dist/api/response-root.d.ts +65 -0
- package/dist/api/response-root.d.ts.map +1 -0
- package/dist/api/response-root.js +61 -0
- package/dist/api/response-root.js.map +1 -0
- package/dist/api/retry.d.ts +112 -0
- package/dist/api/retry.d.ts.map +1 -0
- package/dist/api/retry.js +181 -0
- package/dist/api/retry.js.map +1 -0
- package/dist/api/set-expression.d.ts +23 -0
- package/dist/api/set-expression.d.ts.map +1 -0
- package/dist/api/set-expression.js +31 -0
- package/dist/api/set-expression.js.map +1 -0
- package/dist/api/sort.d.ts +59 -0
- package/dist/api/sort.d.ts.map +1 -0
- package/dist/api/sort.js +73 -0
- package/dist/api/sort.js.map +1 -0
- package/dist/api/source-aggregator.d.ts +94 -0
- package/dist/api/source-aggregator.d.ts.map +1 -0
- package/dist/api/source-aggregator.js +111 -0
- package/dist/api/source-aggregator.js.map +1 -0
- package/dist/api/transport.d.ts +58 -0
- package/dist/api/transport.d.ts.map +1 -0
- package/dist/api/transport.js +190 -0
- package/dist/api/transport.js.map +1 -0
- package/dist/api/update-mutation-result.d.ts +133 -0
- package/dist/api/update-mutation-result.d.ts.map +1 -0
- package/dist/api/update-mutation-result.js +145 -0
- package/dist/api/update-mutation-result.js.map +1 -0
- package/dist/api/users-fan-out-mutation.d.ts +124 -0
- package/dist/api/users-fan-out-mutation.d.ts.map +1 -0
- package/dist/api/users-fan-out-mutation.js +331 -0
- package/dist/api/users-fan-out-mutation.js.map +1 -0
- package/dist/api/walk-pages.d.ts +91 -0
- package/dist/api/walk-pages.d.ts.map +1 -0
- package/dist/api/walk-pages.js +84 -0
- package/dist/api/walk-pages.js.map +1 -0
- package/dist/api/workspace-projection.d.ts +64 -0
- package/dist/api/workspace-projection.d.ts.map +1 -0
- package/dist/api/workspace-projection.js +83 -0
- package/dist/api/workspace-projection.js.map +1 -0
- package/dist/cli/envelope-out.d.ts +128 -0
- package/dist/cli/envelope-out.d.ts.map +1 -0
- package/dist/cli/envelope-out.js +146 -0
- package/dist/cli/envelope-out.js.map +1 -0
- package/dist/cli/index.d.ts +3 -0
- package/dist/cli/index.d.ts.map +1 -0
- package/dist/cli/index.js +27 -0
- package/dist/cli/index.js.map +1 -0
- package/dist/cli/program.d.ts +29 -0
- package/dist/cli/program.d.ts.map +1 -0
- package/dist/cli/program.js +109 -0
- package/dist/cli/program.js.map +1 -0
- package/dist/cli/run.d.ts +108 -0
- package/dist/cli/run.d.ts.map +1 -0
- package/dist/cli/run.js +105 -0
- package/dist/cli/run.js.map +1 -0
- package/dist/commands/account/client-helper.d.ts +37 -0
- package/dist/commands/account/client-helper.d.ts.map +1 -0
- package/dist/commands/account/client-helper.js +55 -0
- package/dist/commands/account/client-helper.js.map +1 -0
- package/dist/commands/account/complexity.d.ts +29 -0
- package/dist/commands/account/complexity.d.ts.map +1 -0
- package/dist/commands/account/complexity.js +70 -0
- package/dist/commands/account/complexity.js.map +1 -0
- package/dist/commands/account/info.d.ts +36 -0
- package/dist/commands/account/info.d.ts.map +1 -0
- package/dist/commands/account/info.js +74 -0
- package/dist/commands/account/info.js.map +1 -0
- package/dist/commands/account/version.d.ts +44 -0
- package/dist/commands/account/version.d.ts.map +1 -0
- package/dist/commands/account/version.js +98 -0
- package/dist/commands/account/version.js.map +1 -0
- package/dist/commands/account/whoami.d.ts +34 -0
- package/dist/commands/account/whoami.d.ts.map +1 -0
- package/dist/commands/account/whoami.js +77 -0
- package/dist/commands/account/whoami.js.map +1 -0
- package/dist/commands/board/add-users.d.ts +60 -0
- package/dist/commands/board/add-users.d.ts.map +1 -0
- package/dist/commands/board/add-users.js +133 -0
- package/dist/commands/board/add-users.js.map +1 -0
- package/dist/commands/board/archive.d.ts +64 -0
- package/dist/commands/board/archive.d.ts.map +1 -0
- package/dist/commands/board/archive.js +226 -0
- package/dist/commands/board/archive.js.map +1 -0
- package/dist/commands/board/column-create.d.ts +146 -0
- package/dist/commands/board/column-create.d.ts.map +1 -0
- package/dist/commands/board/column-create.js +564 -0
- package/dist/commands/board/column-create.js.map +1 -0
- package/dist/commands/board/column-delete.d.ts +76 -0
- package/dist/commands/board/column-delete.d.ts.map +1 -0
- package/dist/commands/board/column-delete.js +224 -0
- package/dist/commands/board/column-delete.js.map +1 -0
- package/dist/commands/board/column-update.d.ts +92 -0
- package/dist/commands/board/column-update.d.ts.map +1 -0
- package/dist/commands/board/column-update.js +364 -0
- package/dist/commands/board/column-update.js.map +1 -0
- package/dist/commands/board/columns.d.ts +30 -0
- package/dist/commands/board/columns.d.ts.map +1 -0
- package/dist/commands/board/columns.js +102 -0
- package/dist/commands/board/columns.js.map +1 -0
- package/dist/commands/board/create.d.ts +67 -0
- package/dist/commands/board/create.d.ts.map +1 -0
- package/dist/commands/board/create.js +226 -0
- package/dist/commands/board/create.js.map +1 -0
- package/dist/commands/board/delete.d.ts +60 -0
- package/dist/commands/board/delete.d.ts.map +1 -0
- package/dist/commands/board/delete.js +192 -0
- package/dist/commands/board/delete.js.map +1 -0
- package/dist/commands/board/describe.d.ts +68 -0
- package/dist/commands/board/describe.d.ts.map +1 -0
- package/dist/commands/board/describe.js +241 -0
- package/dist/commands/board/describe.js.map +1 -0
- package/dist/commands/board/doctor.d.ts +108 -0
- package/dist/commands/board/doctor.d.ts.map +1 -0
- package/dist/commands/board/doctor.js +417 -0
- package/dist/commands/board/doctor.js.map +1 -0
- package/dist/commands/board/duplicate.d.ts +85 -0
- package/dist/commands/board/duplicate.d.ts.map +1 -0
- package/dist/commands/board/duplicate.js +281 -0
- package/dist/commands/board/duplicate.js.map +1 -0
- package/dist/commands/board/find.d.ts +47 -0
- package/dist/commands/board/find.d.ts.map +1 -0
- package/dist/commands/board/find.js +153 -0
- package/dist/commands/board/find.js.map +1 -0
- package/dist/commands/board/get.d.ts +41 -0
- package/dist/commands/board/get.d.ts.map +1 -0
- package/dist/commands/board/get.js +66 -0
- package/dist/commands/board/get.js.map +1 -0
- package/dist/commands/board/group-archive.d.ts +83 -0
- package/dist/commands/board/group-archive.d.ts.map +1 -0
- package/dist/commands/board/group-archive.js +264 -0
- package/dist/commands/board/group-archive.js.map +1 -0
- package/dist/commands/board/group-create.d.ts +118 -0
- package/dist/commands/board/group-create.d.ts.map +1 -0
- package/dist/commands/board/group-create.js +239 -0
- package/dist/commands/board/group-create.js.map +1 -0
- package/dist/commands/board/group-delete.d.ts +79 -0
- package/dist/commands/board/group-delete.d.ts.map +1 -0
- package/dist/commands/board/group-delete.js +222 -0
- package/dist/commands/board/group-delete.js.map +1 -0
- package/dist/commands/board/group-duplicate.d.ts +70 -0
- package/dist/commands/board/group-duplicate.d.ts.map +1 -0
- package/dist/commands/board/group-duplicate.js +219 -0
- package/dist/commands/board/group-duplicate.js.map +1 -0
- package/dist/commands/board/group-update.d.ts +145 -0
- package/dist/commands/board/group-update.d.ts.map +1 -0
- package/dist/commands/board/group-update.js +341 -0
- package/dist/commands/board/group-update.js.map +1 -0
- package/dist/commands/board/groups.d.ts +28 -0
- package/dist/commands/board/groups.d.ts.map +1 -0
- package/dist/commands/board/groups.js +85 -0
- package/dist/commands/board/groups.js.map +1 -0
- package/dist/commands/board/list.d.ts +39 -0
- package/dist/commands/board/list.d.ts.map +1 -0
- package/dist/commands/board/list.js +135 -0
- package/dist/commands/board/list.js.map +1 -0
- package/dist/commands/board/subscribers.d.ts +24 -0
- package/dist/commands/board/subscribers.d.ts.map +1 -0
- package/dist/commands/board/subscribers.js +89 -0
- package/dist/commands/board/subscribers.js.map +1 -0
- package/dist/commands/board/update.d.ts +82 -0
- package/dist/commands/board/update.d.ts.map +1 -0
- package/dist/commands/board/update.js +328 -0
- package/dist/commands/board/update.js.map +1 -0
- package/dist/commands/cache/clear.d.ts +34 -0
- package/dist/commands/cache/clear.d.ts.map +1 -0
- package/dist/commands/cache/clear.js +113 -0
- package/dist/commands/cache/clear.js.map +1 -0
- package/dist/commands/cache/list.d.ts +50 -0
- package/dist/commands/cache/list.d.ts.map +1 -0
- package/dist/commands/cache/list.js +77 -0
- package/dist/commands/cache/list.js.map +1 -0
- package/dist/commands/cache/stats.d.ts +22 -0
- package/dist/commands/cache/stats.d.ts.map +1 -0
- package/dist/commands/cache/stats.js +56 -0
- package/dist/commands/cache/stats.js.map +1 -0
- package/dist/commands/config/path.d.ts +22 -0
- package/dist/commands/config/path.d.ts.map +1 -0
- package/dist/commands/config/path.js +74 -0
- package/dist/commands/config/path.js.map +1 -0
- package/dist/commands/config/show.d.ts +61 -0
- package/dist/commands/config/show.d.ts.map +1 -0
- package/dist/commands/config/show.js +137 -0
- package/dist/commands/config/show.js.map +1 -0
- package/dist/commands/emit.d.ts +156 -0
- package/dist/commands/emit.d.ts.map +1 -0
- package/dist/commands/emit.js +212 -0
- package/dist/commands/emit.js.map +1 -0
- package/dist/commands/index.d.ts +5 -0
- package/dist/commands/index.d.ts.map +1 -0
- package/dist/commands/index.js +195 -0
- package/dist/commands/index.js.map +1 -0
- package/dist/commands/item/archive.d.ts +81 -0
- package/dist/commands/item/archive.d.ts.map +1 -0
- package/dist/commands/item/archive.js +187 -0
- package/dist/commands/item/archive.js.map +1 -0
- package/dist/commands/item/clear.d.ts +140 -0
- package/dist/commands/item/clear.d.ts.map +1 -0
- package/dist/commands/item/clear.js +748 -0
- package/dist/commands/item/clear.js.map +1 -0
- package/dist/commands/item/create.d.ts +77 -0
- package/dist/commands/item/create.d.ts.map +1 -0
- package/dist/commands/item/create.js +802 -0
- package/dist/commands/item/create.js.map +1 -0
- package/dist/commands/item/delete.d.ts +82 -0
- package/dist/commands/item/delete.d.ts.map +1 -0
- package/dist/commands/item/delete.js +179 -0
- package/dist/commands/item/delete.js.map +1 -0
- package/dist/commands/item/duplicate.d.ts +117 -0
- package/dist/commands/item/duplicate.d.ts.map +1 -0
- package/dist/commands/item/duplicate.js +238 -0
- package/dist/commands/item/duplicate.js.map +1 -0
- package/dist/commands/item/find.d.ts +55 -0
- package/dist/commands/item/find.d.ts.map +1 -0
- package/dist/commands/item/find.js +231 -0
- package/dist/commands/item/find.js.map +1 -0
- package/dist/commands/item/get.d.ts +47 -0
- package/dist/commands/item/get.d.ts.map +1 -0
- package/dist/commands/item/get.js +66 -0
- package/dist/commands/item/get.js.map +1 -0
- package/dist/commands/item/list.d.ts +73 -0
- package/dist/commands/item/list.d.ts.map +1 -0
- package/dist/commands/item/list.js +284 -0
- package/dist/commands/item/list.js.map +1 -0
- package/dist/commands/item/move.d.ts +181 -0
- package/dist/commands/item/move.d.ts.map +1 -0
- package/dist/commands/item/move.js +560 -0
- package/dist/commands/item/move.js.map +1 -0
- package/dist/commands/item/search.d.ts +67 -0
- package/dist/commands/item/search.d.ts.map +1 -0
- package/dist/commands/item/search.js +322 -0
- package/dist/commands/item/search.js.map +1 -0
- package/dist/commands/item/set.d.ts +88 -0
- package/dist/commands/item/set.d.ts.map +1 -0
- package/dist/commands/item/set.js +387 -0
- package/dist/commands/item/set.js.map +1 -0
- package/dist/commands/item/subitems.d.ts +50 -0
- package/dist/commands/item/subitems.d.ts.map +1 -0
- package/dist/commands/item/subitems.js +86 -0
- package/dist/commands/item/subitems.js.map +1 -0
- package/dist/commands/item/update.d.ts +99 -0
- package/dist/commands/item/update.d.ts.map +1 -0
- package/dist/commands/item/update.js +884 -0
- package/dist/commands/item/update.js.map +1 -0
- package/dist/commands/item/upsert.d.ts +105 -0
- package/dist/commands/item/upsert.d.ts.map +1 -0
- package/dist/commands/item/upsert.js +998 -0
- package/dist/commands/item/upsert.js.map +1 -0
- package/dist/commands/parse-argv.d.ts +20 -0
- package/dist/commands/parse-argv.d.ts.map +1 -0
- package/dist/commands/parse-argv.js +40 -0
- package/dist/commands/parse-argv.js.map +1 -0
- package/dist/commands/raw/index.d.ts +23 -0
- package/dist/commands/raw/index.d.ts.map +1 -0
- package/dist/commands/raw/index.js +416 -0
- package/dist/commands/raw/index.js.map +1 -0
- package/dist/commands/run-by-id-lookup.d.ts +72 -0
- package/dist/commands/run-by-id-lookup.d.ts.map +1 -0
- package/dist/commands/run-by-id-lookup.js +58 -0
- package/dist/commands/run-by-id-lookup.js.map +1 -0
- package/dist/commands/schema/index.d.ts +104 -0
- package/dist/commands/schema/index.d.ts.map +1 -0
- package/dist/commands/schema/index.js +183 -0
- package/dist/commands/schema/index.js.map +1 -0
- package/dist/commands/types.d.ts +66 -0
- package/dist/commands/types.d.ts.map +1 -0
- package/dist/commands/types.js +15 -0
- package/dist/commands/types.js.map +1 -0
- package/dist/commands/update/body-source.d.ts +38 -0
- package/dist/commands/update/body-source.d.ts.map +1 -0
- package/dist/commands/update/body-source.js +80 -0
- package/dist/commands/update/body-source.js.map +1 -0
- package/dist/commands/update/clear-all.d.ts +67 -0
- package/dist/commands/update/clear-all.d.ts.map +1 -0
- package/dist/commands/update/clear-all.js +281 -0
- package/dist/commands/update/clear-all.js.map +1 -0
- package/dist/commands/update/create.d.ts +51 -0
- package/dist/commands/update/create.d.ts.map +1 -0
- package/dist/commands/update/create.js +167 -0
- package/dist/commands/update/create.js.map +1 -0
- package/dist/commands/update/delete.d.ts +53 -0
- package/dist/commands/update/delete.d.ts.map +1 -0
- package/dist/commands/update/delete.js +148 -0
- package/dist/commands/update/delete.js.map +1 -0
- package/dist/commands/update/edit.d.ts +37 -0
- package/dist/commands/update/edit.d.ts.map +1 -0
- package/dist/commands/update/edit.js +129 -0
- package/dist/commands/update/edit.js.map +1 -0
- package/dist/commands/update/get.d.ts +37 -0
- package/dist/commands/update/get.d.ts.map +1 -0
- package/dist/commands/update/get.js +92 -0
- package/dist/commands/update/get.js.map +1 -0
- package/dist/commands/update/like.d.ts +17 -0
- package/dist/commands/update/like.d.ts.map +1 -0
- package/dist/commands/update/like.js +23 -0
- package/dist/commands/update/like.js.map +1 -0
- package/dist/commands/update/list.d.ts +58 -0
- package/dist/commands/update/list.d.ts.map +1 -0
- package/dist/commands/update/list.js +322 -0
- package/dist/commands/update/list.js.map +1 -0
- package/dist/commands/update/pin.d.ts +17 -0
- package/dist/commands/update/pin.d.ts.map +1 -0
- package/dist/commands/update/pin.js +23 -0
- package/dist/commands/update/pin.js.map +1 -0
- package/dist/commands/update/reply.d.ts +47 -0
- package/dist/commands/update/reply.d.ts.map +1 -0
- package/dist/commands/update/reply.js +149 -0
- package/dist/commands/update/reply.js.map +1 -0
- package/dist/commands/update/toggle.d.ts +70 -0
- package/dist/commands/update/toggle.d.ts.map +1 -0
- package/dist/commands/update/toggle.js +118 -0
- package/dist/commands/update/toggle.js.map +1 -0
- package/dist/commands/update/unlike.d.ts +17 -0
- package/dist/commands/update/unlike.d.ts.map +1 -0
- package/dist/commands/update/unlike.js +22 -0
- package/dist/commands/update/unlike.js.map +1 -0
- package/dist/commands/update/unpin.d.ts +17 -0
- package/dist/commands/update/unpin.d.ts.map +1 -0
- package/dist/commands/update/unpin.js +21 -0
- package/dist/commands/update/unpin.js.map +1 -0
- package/dist/commands/user/get.d.ts +31 -0
- package/dist/commands/user/get.d.ts.map +1 -0
- package/dist/commands/user/get.js +81 -0
- package/dist/commands/user/get.js.map +1 -0
- package/dist/commands/user/list.d.ts +61 -0
- package/dist/commands/user/list.d.ts.map +1 -0
- package/dist/commands/user/list.js +148 -0
- package/dist/commands/user/list.js.map +1 -0
- package/dist/commands/user/me.d.ts +17 -0
- package/dist/commands/user/me.d.ts.map +1 -0
- package/dist/commands/user/me.js +49 -0
- package/dist/commands/user/me.js.map +1 -0
- package/dist/commands/workspace/add-users.d.ts +76 -0
- package/dist/commands/workspace/add-users.d.ts.map +1 -0
- package/dist/commands/workspace/add-users.js +154 -0
- package/dist/commands/workspace/add-users.js.map +1 -0
- package/dist/commands/workspace/create.d.ts +59 -0
- package/dist/commands/workspace/create.d.ts.map +1 -0
- package/dist/commands/workspace/create.js +163 -0
- package/dist/commands/workspace/create.js.map +1 -0
- package/dist/commands/workspace/delete.d.ts +67 -0
- package/dist/commands/workspace/delete.d.ts.map +1 -0
- package/dist/commands/workspace/delete.js +182 -0
- package/dist/commands/workspace/delete.js.map +1 -0
- package/dist/commands/workspace/folders.d.ts +40 -0
- package/dist/commands/workspace/folders.d.ts.map +1 -0
- package/dist/commands/workspace/folders.js +124 -0
- package/dist/commands/workspace/folders.js.map +1 -0
- package/dist/commands/workspace/get.d.ts +35 -0
- package/dist/commands/workspace/get.d.ts.map +1 -0
- package/dist/commands/workspace/get.js +62 -0
- package/dist/commands/workspace/get.js.map +1 -0
- package/dist/commands/workspace/list.d.ts +57 -0
- package/dist/commands/workspace/list.d.ts.map +1 -0
- package/dist/commands/workspace/list.js +125 -0
- package/dist/commands/workspace/list.js.map +1 -0
- package/dist/commands/workspace/remove-users.d.ts +47 -0
- package/dist/commands/workspace/remove-users.d.ts.map +1 -0
- package/dist/commands/workspace/remove-users.js +122 -0
- package/dist/commands/workspace/remove-users.js.map +1 -0
- package/dist/commands/workspace/update.d.ts +68 -0
- package/dist/commands/workspace/update.d.ts.map +1 -0
- package/dist/commands/workspace/update.js +237 -0
- package/dist/commands/workspace/update.js.map +1 -0
- package/dist/config/load.d.ts +33 -0
- package/dist/config/load.d.ts.map +1 -0
- package/dist/config/load.js +81 -0
- package/dist/config/load.js.map +1 -0
- package/dist/index.d.ts +3 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +4 -0
- package/dist/index.js.map +1 -0
- package/dist/types/global-flags.d.ts +69 -0
- package/dist/types/global-flags.d.ts.map +1 -0
- package/dist/types/global-flags.js +170 -0
- package/dist/types/global-flags.js.map +1 -0
- package/dist/types/ids.d.ts +38 -0
- package/dist/types/ids.d.ts.map +1 -0
- package/dist/types/ids.js +51 -0
- package/dist/types/ids.js.map +1 -0
- package/dist/types/json.d.ts +60 -0
- package/dist/types/json.d.ts.map +1 -0
- package/dist/types/json.js +33 -0
- package/dist/types/json.js.map +1 -0
- package/dist/utils/errors.d.ts +121 -0
- package/dist/utils/errors.d.ts.map +1 -0
- package/dist/utils/errors.js +264 -0
- package/dist/utils/errors.js.map +1 -0
- package/dist/utils/logger.d.ts +39 -0
- package/dist/utils/logger.d.ts.map +1 -0
- package/dist/utils/logger.js +49 -0
- package/dist/utils/logger.js.map +1 -0
- package/dist/utils/output/envelope.d.ts +140 -0
- package/dist/utils/output/envelope.d.ts.map +1 -0
- package/dist/utils/output/envelope.js +120 -0
- package/dist/utils/output/envelope.js.map +1 -0
- package/dist/utils/output/json.d.ts +10 -0
- package/dist/utils/output/json.d.ts.map +1 -0
- package/dist/utils/output/json.js +12 -0
- package/dist/utils/output/json.js.map +1 -0
- package/dist/utils/output/ndjson.d.ts +92 -0
- package/dist/utils/output/ndjson.d.ts.map +1 -0
- package/dist/utils/output/ndjson.js +33 -0
- package/dist/utils/output/ndjson.js.map +1 -0
- package/dist/utils/output/select.d.ts +22 -0
- package/dist/utils/output/select.d.ts.map +1 -0
- package/dist/utils/output/select.js +47 -0
- package/dist/utils/output/select.js.map +1 -0
- package/dist/utils/output/table.d.ts +32 -0
- package/dist/utils/output/table.d.ts.map +1 -0
- package/dist/utils/output/table.js +133 -0
- package/dist/utils/output/table.js.map +1 -0
- package/dist/utils/output/text.d.ts +5 -0
- package/dist/utils/output/text.d.ts.map +1 -0
- package/dist/utils/output/text.js +32 -0
- package/dist/utils/output/text.js.map +1 -0
- package/dist/utils/parse-boundary.d.ts +53 -0
- package/dist/utils/parse-boundary.d.ts.map +1 -0
- package/dist/utils/parse-boundary.js +62 -0
- package/dist/utils/parse-boundary.js.map +1 -0
- package/dist/utils/redact.d.ts +54 -0
- package/dist/utils/redact.d.ts.map +1 -0
- package/dist/utils/redact.js +154 -0
- package/dist/utils/redact.js.map +1 -0
- package/dist/utils/request-id.d.ts +17 -0
- package/dist/utils/request-id.d.ts.map +1 -0
- package/dist/utils/request-id.js +26 -0
- package/dist/utils/request-id.js.map +1 -0
- package/package.json +87 -0
|
@@ -0,0 +1,235 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Shared item projection helpers (`v0.1-plan.md` §3 M4,
|
|
3
|
+
* `cli-design.md` §6.2).
|
|
4
|
+
*
|
|
5
|
+
* Every M4 read command (`item get` / `list` / `find` / `search` /
|
|
6
|
+
* `subitems`) emits the same single-resource Item shape. Centralising
|
|
7
|
+
* here means the projection lives in one file and the per-command
|
|
8
|
+
* action body stays focused on the GraphQL call + envelope mapping.
|
|
9
|
+
*
|
|
10
|
+
* Column-value projection notes:
|
|
11
|
+
*
|
|
12
|
+
* - Each column carries `{id, type, title, text, value}` per §6.2.
|
|
13
|
+
* `value` is the *parsed* JSON Monday stored — Monday returns it
|
|
14
|
+
* as a JSON-encoded string on the wire and we decode at this
|
|
15
|
+
* boundary so JSON consumers can read structured payloads
|
|
16
|
+
* without re-parsing.
|
|
17
|
+
* - For known-write column types (status / date / people), a
|
|
18
|
+
* handful of *typed* fields are surfaced inline (matching the
|
|
19
|
+
* §6.2 worked example). Unknown / read-only types only carry
|
|
20
|
+
* the base shape; agents inspect `value` for structured access.
|
|
21
|
+
* - The richer per-type projection is deferred to M5a's
|
|
22
|
+
* `column-values.ts` (the writer needs the same shape and the
|
|
23
|
+
* reader can reuse it). Until then, this module hosts the
|
|
24
|
+
* read-only inline projection so the v0.1 contract surface is
|
|
25
|
+
* stable.
|
|
26
|
+
*/
|
|
27
|
+
import { z } from 'zod';
|
|
28
|
+
export const rawColumnValueSchema = z
|
|
29
|
+
.object({
|
|
30
|
+
id: z.string().min(1),
|
|
31
|
+
type: z.string().min(1),
|
|
32
|
+
text: z.string().nullable(),
|
|
33
|
+
value: z.string().nullable(),
|
|
34
|
+
column: z
|
|
35
|
+
.object({ title: z.string() })
|
|
36
|
+
.nullable()
|
|
37
|
+
.optional(),
|
|
38
|
+
})
|
|
39
|
+
.strict();
|
|
40
|
+
export const rawItemSchema = z
|
|
41
|
+
.object({
|
|
42
|
+
id: z.string().min(1),
|
|
43
|
+
name: z.string(),
|
|
44
|
+
state: z.string().nullable(),
|
|
45
|
+
url: z.string().nullable(),
|
|
46
|
+
created_at: z.string().nullable(),
|
|
47
|
+
updated_at: z.string().nullable(),
|
|
48
|
+
board: z.object({ id: z.string() }).nullable(),
|
|
49
|
+
group: z
|
|
50
|
+
.object({ id: z.string(), title: z.string().nullable() })
|
|
51
|
+
.nullable()
|
|
52
|
+
.optional(),
|
|
53
|
+
parent_item: z
|
|
54
|
+
.object({ id: z.string() })
|
|
55
|
+
.nullable()
|
|
56
|
+
.optional(),
|
|
57
|
+
creator_id: z.string().nullable().optional(),
|
|
58
|
+
column_values: z.array(rawColumnValueSchema),
|
|
59
|
+
})
|
|
60
|
+
.strict();
|
|
61
|
+
/**
|
|
62
|
+
* Single-column projected shape per §6.2. Carries the base shape
|
|
63
|
+
* (`id, type, title, text, value`) plus a few typed fields for the
|
|
64
|
+
* v0.1-writable status / date / people types. Mirror / formula /
|
|
65
|
+
* dependency columns surface as the base shape — `text` is the
|
|
66
|
+
* source of truth there because the typed payload isn't writable
|
|
67
|
+
* and Monday's wire shape varies.
|
|
68
|
+
*/
|
|
69
|
+
export const projectedColumnSchema = z
|
|
70
|
+
.object({
|
|
71
|
+
id: z.string().min(1),
|
|
72
|
+
type: z.string().min(1),
|
|
73
|
+
// §6.3: per-cell title is dropped in same-board collections and
|
|
74
|
+
// consolidated into `meta.columns`. Single-resource calls keep
|
|
75
|
+
// it inline per §6.2. The schema therefore makes it optional —
|
|
76
|
+
// emit-time the projector either includes it or leaves it
|
|
77
|
+
// undefined.
|
|
78
|
+
title: z.string().optional(),
|
|
79
|
+
text: z.string().nullable(),
|
|
80
|
+
value: z.unknown(),
|
|
81
|
+
// Typed fields (optional — only set per type)
|
|
82
|
+
label: z.string().nullable().optional(),
|
|
83
|
+
index: z.number().int().nullable().optional(),
|
|
84
|
+
date: z.string().nullable().optional(),
|
|
85
|
+
time: z.string().nullable().optional(),
|
|
86
|
+
people: z
|
|
87
|
+
.array(z.object({
|
|
88
|
+
id: z.string(),
|
|
89
|
+
kind: z.string().nullable().optional(),
|
|
90
|
+
}).loose())
|
|
91
|
+
.optional(),
|
|
92
|
+
})
|
|
93
|
+
.loose();
|
|
94
|
+
export const projectedItemSchema = z
|
|
95
|
+
.object({
|
|
96
|
+
id: z.string().min(1),
|
|
97
|
+
name: z.string(),
|
|
98
|
+
board_id: z.string().nullable(),
|
|
99
|
+
group_id: z.string().nullable(),
|
|
100
|
+
parent_item_id: z.string().nullable(),
|
|
101
|
+
state: z.string().nullable(),
|
|
102
|
+
url: z.string().nullable(),
|
|
103
|
+
created_at: z.string().nullable(),
|
|
104
|
+
updated_at: z.string().nullable(),
|
|
105
|
+
columns: z.record(z.string(), projectedColumnSchema),
|
|
106
|
+
})
|
|
107
|
+
.strict();
|
|
108
|
+
/**
|
|
109
|
+
* Parses a Monday `value` string. Monday encodes structured column
|
|
110
|
+
* values as JSON strings; the projector decodes once at the boundary
|
|
111
|
+
* so consumers can read the structured field without re-parsing.
|
|
112
|
+
*
|
|
113
|
+
* Errors are swallowed: a malformed JSON string surfaces as `null`
|
|
114
|
+
* (with `text` still carrying the human form). Defensive — Monday
|
|
115
|
+
* occasionally returns an unparseable string for read-only column
|
|
116
|
+
* types, and we don't want one weird column to fail the whole emit.
|
|
117
|
+
*/
|
|
118
|
+
export const parseColumnValue = (raw) => {
|
|
119
|
+
if (raw === null || raw.length === 0)
|
|
120
|
+
return null;
|
|
121
|
+
try {
|
|
122
|
+
return JSON.parse(raw);
|
|
123
|
+
}
|
|
124
|
+
catch {
|
|
125
|
+
return null;
|
|
126
|
+
}
|
|
127
|
+
};
|
|
128
|
+
const projectStatus = (value) => {
|
|
129
|
+
if (typeof value !== 'object' || value === null) {
|
|
130
|
+
return { label: null, index: null };
|
|
131
|
+
}
|
|
132
|
+
const v = value;
|
|
133
|
+
const label = typeof v.label === 'string' ? v.label : null;
|
|
134
|
+
const index = typeof v.index === 'number' ? v.index : null;
|
|
135
|
+
return { label, index };
|
|
136
|
+
};
|
|
137
|
+
const projectDate = (value) => {
|
|
138
|
+
if (typeof value !== 'object' || value === null) {
|
|
139
|
+
return { date: null, time: null };
|
|
140
|
+
}
|
|
141
|
+
const v = value;
|
|
142
|
+
const date = typeof v.date === 'string' ? v.date : null;
|
|
143
|
+
const time = typeof v.time === 'string' ? v.time : null;
|
|
144
|
+
return { date, time };
|
|
145
|
+
};
|
|
146
|
+
const projectPeople = (value) => {
|
|
147
|
+
if (typeof value !== 'object' || value === null) {
|
|
148
|
+
return { people: [] };
|
|
149
|
+
}
|
|
150
|
+
const v = value;
|
|
151
|
+
const persons = Array.isArray(v.personsAndTeams) ? v.personsAndTeams : [];
|
|
152
|
+
const people = persons.flatMap((p) => {
|
|
153
|
+
if (typeof p !== 'object' || p === null)
|
|
154
|
+
return [];
|
|
155
|
+
const pp = p;
|
|
156
|
+
const id = typeof pp.id === 'number' ? String(pp.id) : typeof pp.id === 'string' ? pp.id : '';
|
|
157
|
+
if (id.length === 0)
|
|
158
|
+
return [];
|
|
159
|
+
return [{ id, ...(typeof pp.kind === 'string' ? { kind: pp.kind } : {}) }];
|
|
160
|
+
});
|
|
161
|
+
return { people };
|
|
162
|
+
};
|
|
163
|
+
/**
|
|
164
|
+
* Projects one column-value into the §6.2 shape. Pure — no I/O.
|
|
165
|
+
* The board-metadata `title` is preferred over the wire-side
|
|
166
|
+
* `column.title` because the metadata loader's NFC + cache rules
|
|
167
|
+
* are the canonical source; `column.title` is only the fallback for
|
|
168
|
+
* cross-board lists where a single board metadata isn't loaded.
|
|
169
|
+
*/
|
|
170
|
+
export const projectColumnValue = (raw, fallbackTitle) => {
|
|
171
|
+
const value = parseColumnValue(raw.value);
|
|
172
|
+
const title = fallbackTitle ?? (raw.column?.title ?? raw.id);
|
|
173
|
+
const base = {
|
|
174
|
+
id: raw.id,
|
|
175
|
+
type: raw.type,
|
|
176
|
+
title,
|
|
177
|
+
text: raw.text,
|
|
178
|
+
value,
|
|
179
|
+
};
|
|
180
|
+
switch (raw.type) {
|
|
181
|
+
case 'status':
|
|
182
|
+
return { ...base, ...projectStatus(value) };
|
|
183
|
+
case 'date':
|
|
184
|
+
return { ...base, ...projectDate(value) };
|
|
185
|
+
case 'people':
|
|
186
|
+
return { ...base, ...projectPeople(value) };
|
|
187
|
+
default:
|
|
188
|
+
return base;
|
|
189
|
+
}
|
|
190
|
+
};
|
|
191
|
+
/**
|
|
192
|
+
* Reads `id` off a raw GraphQL item shape — the cursor walker
|
|
193
|
+
* needs a string for the per-page sort. Production cassettes always
|
|
194
|
+
* carry a string id (Monday's schema guarantees it); the
|
|
195
|
+
* structural-typing read keeps the walker honest if a future
|
|
196
|
+
* fixture drifts.
|
|
197
|
+
*/
|
|
198
|
+
/* c8 ignore next 5 — defensive: Monday returns numeric-string `id`
|
|
199
|
+
on every item; the malformed branches exist to stop the walker
|
|
200
|
+
crashing if a fixture / future schema misbehaves. */
|
|
201
|
+
export const idFromRawItem = (item) => {
|
|
202
|
+
if (typeof item !== 'object' || item === null)
|
|
203
|
+
return '';
|
|
204
|
+
const v = item.id;
|
|
205
|
+
return typeof v === 'string' ? v : '';
|
|
206
|
+
};
|
|
207
|
+
export const projectItem = (inputs) => {
|
|
208
|
+
const titles = inputs.columnTitles;
|
|
209
|
+
const omitTitles = inputs.omitColumnTitles === true;
|
|
210
|
+
const columns = {};
|
|
211
|
+
for (const cv of inputs.raw.column_values) {
|
|
212
|
+
const fallback = titles?.get(cv.id);
|
|
213
|
+
const projected = projectColumnValue(cv, fallback);
|
|
214
|
+
if (omitTitles) {
|
|
215
|
+
const { title: _title, ...rest } = projected;
|
|
216
|
+
columns[cv.id] = rest;
|
|
217
|
+
}
|
|
218
|
+
else {
|
|
219
|
+
columns[cv.id] = projected;
|
|
220
|
+
}
|
|
221
|
+
}
|
|
222
|
+
return {
|
|
223
|
+
id: inputs.raw.id,
|
|
224
|
+
name: inputs.raw.name,
|
|
225
|
+
board_id: inputs.raw.board?.id ?? null,
|
|
226
|
+
group_id: inputs.raw.group?.id ?? null,
|
|
227
|
+
parent_item_id: inputs.raw.parent_item?.id ?? null,
|
|
228
|
+
state: inputs.raw.state,
|
|
229
|
+
url: inputs.raw.url,
|
|
230
|
+
created_at: inputs.raw.created_at,
|
|
231
|
+
updated_at: inputs.raw.updated_at,
|
|
232
|
+
columns,
|
|
233
|
+
};
|
|
234
|
+
};
|
|
235
|
+
//# sourceMappingURL=item-projection.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"item-projection.js","sourceRoot":"","sources":["../../src/api/item-projection.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;GAyBG;AAEH,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAExB,MAAM,CAAC,MAAM,oBAAoB,GAAG,CAAC;KAClC,MAAM,CA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G,CAAC,EAAE,CAAC,EAAE,CAAC,CAAC;QACpC,MAAM,SAAS,GAAG,kBAAkB,CAAC,EAAE,EAAE,QAAQ,CAAC,CAAC;QACnD,IAAI,UAAU,EAAE,CAAC;YACf,MAAM,EAAE,KAAK,EAAE,MAAM,EAAE,GAAG,IAAI,EAAE,GAAG,SAAS,CAAC;YAC7C,OAAO,CAAC,EAAE,CAAC,EAAE,CAAC,GAAG,IAAI,CAAC;QACxB,CAAC;aAAM,CAAC;YACN,OAAO,CAAC,EAAE,CAAC,EAAE,CAAC,GAAG,SAAS,CAAC;QAC7B,CAAC;IACH,CAAC;IACD,OAAO;QACL,EAAE,EAAE,MAAM,CAAC,GAAG,CAAC,EAAE;QACjB,IAAI,EAAE,MAAM,CAAC,GAAG,CAAC,IAAI;QACrB,QAAQ,EAAE,MAAM,CAAC,GAAG,CAAC,KAAK,EAAE,EAAE,IAAI,IAAI;QACtC,QAAQ,EAAE,MAAM,CAAC,GAAG,CAAC,KAAK,EAAE,EAAE,IAAI,IAAI;QACtC,cAAc,EAAE,MAAM,CAAC,GAAG,CAAC,WAAW,EAAE,EAAE,IAAI,IAAI;QAClD,KAAK,EAAE,MAAM,CAAC,GAAG,CAAC,KAAK;QACvB,GAAG,EAAE,MAAM,CAAC,GAAG,CAAC,GAAG;QACnB,UAAU,EAAE,MAAM,CAAC,GAAG,CAAC,UAAU;QACjC,UAAU,EAAE,MAAM,CAAC,GAAG,CAAC,UAAU;QACjC,OAAO;KACR,CAAC;AACJ,CAAC,CAAC"}
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Source-item dry-run reader — the M10 lifecycle verbs (`archive` /
|
|
3
|
+
* `delete` / `duplicate`) all share the same `--dry-run` preflight: a
|
|
4
|
+
* single-item read against `ITEM_FIELDS_FRAGMENT`, a null-result throw
|
|
5
|
+
* with `details.item_id`, then `parseRawItem + projectItem` to surface
|
|
6
|
+
* the §6.4 dry-run envelope's `item: <projected snapshot>` slot.
|
|
7
|
+
*
|
|
8
|
+
* Lifted from three sites — see v0.2-plan §14 R27:
|
|
9
|
+
* - `commands/item/archive.ts` action — dry-run path
|
|
10
|
+
* - `commands/item/delete.ts` action — dry-run path
|
|
11
|
+
* - `commands/item/duplicate.ts` action — dry-run path
|
|
12
|
+
*
|
|
13
|
+
* The query body is byte-identical across the three M10 verbs (just
|
|
14
|
+
* `items(ids:) { ${ITEM_FIELDS_FRAGMENT} }`); only the operation name
|
|
15
|
+
* differs (`ItemArchiveRead` / `ItemDeleteRead` / `ItemDuplicateRead`).
|
|
16
|
+
* The op-name divergence exists for fixture cassettes + Monday's
|
|
17
|
+
* request-log telemetry (so wire calls are distinguishable per verb),
|
|
18
|
+
* so the helper takes it as a required parameter rather than
|
|
19
|
+
* collapsing it. M11's `item move` will pass `ItemMoveRead` and
|
|
20
|
+
* inherit the helper rather than copying the pattern.
|
|
21
|
+
*
|
|
22
|
+
* **Why not also for the live-mutation null-handling.** The live
|
|
23
|
+
* mutation returns the post-mutation item directly; the parsing +
|
|
24
|
+
* projection shape is shared with R28's
|
|
25
|
+
* `projectMutationItem`, but the error semantics diverge (live
|
|
26
|
+
* mutations throw `not_found` with a mutation-name-bearing message
|
|
27
|
+
* while this helper throws `not_found` with the read-side phrasing).
|
|
28
|
+
* Two helpers, one per concern.
|
|
29
|
+
*/
|
|
30
|
+
import { type ProjectedItem } from './item-projection.js';
|
|
31
|
+
import type { MondayClient } from './client.js';
|
|
32
|
+
/**
|
|
33
|
+
* Reads the source item for an M10 lifecycle dry-run preview, returns
|
|
34
|
+
* the §6.2 / §6.3 projected snapshot. Null/missing → typed
|
|
35
|
+
* `not_found` with `details.item_id` so agents key off the stable
|
|
36
|
+
* code per cli-design §6.5 (mirrors the live-path null-handling so
|
|
37
|
+
* the error shape stays identical regardless of which path the agent
|
|
38
|
+
* took).
|
|
39
|
+
*/
|
|
40
|
+
export declare const readSourceItemForDryRun: ({ client, itemId, operationName, }: {
|
|
41
|
+
readonly client: MondayClient;
|
|
42
|
+
readonly itemId: string;
|
|
43
|
+
readonly operationName: string;
|
|
44
|
+
}) => Promise<ProjectedItem>;
|
|
45
|
+
//# sourceMappingURL=item-source-read.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"item-source-read.d.ts","sourceRoot":"","sources":["../../src/api/item-source-read.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA4BG;AAOH,OAAO,EAEL,KAAK,aAAa,EACnB,MAAM,sBAAsB,CAAC;AAC9B,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,aAAa,CAAC;AAMhD;;;;;;;GAOG;AACH,eAAO,MAAM,uBAAuB,GAAU,oCAI3C;IACD,QAAQ,CAAC,MAAM,EAAE,YAAY,CAAC;IAC9B,QAAQ,CAAC,MAAM,EAAE,MAAM,CAAC;IACxB,QAAQ,CAAC,aAAa,EAAE,MAAM,CAAC;CAChC,KAAG,OAAO,CAAC,aAAa,CAuBxB,CAAC"}
|
|
@@ -0,0 +1,57 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Source-item dry-run reader — the M10 lifecycle verbs (`archive` /
|
|
3
|
+
* `delete` / `duplicate`) all share the same `--dry-run` preflight: a
|
|
4
|
+
* single-item read against `ITEM_FIELDS_FRAGMENT`, a null-result throw
|
|
5
|
+
* with `details.item_id`, then `parseRawItem + projectItem` to surface
|
|
6
|
+
* the §6.4 dry-run envelope's `item: <projected snapshot>` slot.
|
|
7
|
+
*
|
|
8
|
+
* Lifted from three sites — see v0.2-plan §14 R27:
|
|
9
|
+
* - `commands/item/archive.ts` action — dry-run path
|
|
10
|
+
* - `commands/item/delete.ts` action — dry-run path
|
|
11
|
+
* - `commands/item/duplicate.ts` action — dry-run path
|
|
12
|
+
*
|
|
13
|
+
* The query body is byte-identical across the three M10 verbs (just
|
|
14
|
+
* `items(ids:) { ${ITEM_FIELDS_FRAGMENT} }`); only the operation name
|
|
15
|
+
* differs (`ItemArchiveRead` / `ItemDeleteRead` / `ItemDuplicateRead`).
|
|
16
|
+
* The op-name divergence exists for fixture cassettes + Monday's
|
|
17
|
+
* request-log telemetry (so wire calls are distinguishable per verb),
|
|
18
|
+
* so the helper takes it as a required parameter rather than
|
|
19
|
+
* collapsing it. M11's `item move` will pass `ItemMoveRead` and
|
|
20
|
+
* inherit the helper rather than copying the pattern.
|
|
21
|
+
*
|
|
22
|
+
* **Why not also for the live-mutation null-handling.** The live
|
|
23
|
+
* mutation returns the post-mutation item directly; the parsing +
|
|
24
|
+
* projection shape is shared with R28's
|
|
25
|
+
* `projectMutationItem`, but the error semantics diverge (live
|
|
26
|
+
* mutations throw `not_found` with a mutation-name-bearing message
|
|
27
|
+
* while this helper throws `not_found` with the read-side phrasing).
|
|
28
|
+
* Two helpers, one per concern.
|
|
29
|
+
*/
|
|
30
|
+
import { ApiError } from '../utils/errors.js';
|
|
31
|
+
import { ITEM_FIELDS_FRAGMENT, parseRawItem, } from './item-helpers.js';
|
|
32
|
+
import { projectItem, } from './item-projection.js';
|
|
33
|
+
/**
|
|
34
|
+
* Reads the source item for an M10 lifecycle dry-run preview, returns
|
|
35
|
+
* the §6.2 / §6.3 projected snapshot. Null/missing → typed
|
|
36
|
+
* `not_found` with `details.item_id` so agents key off the stable
|
|
37
|
+
* code per cli-design §6.5 (mirrors the live-path null-handling so
|
|
38
|
+
* the error shape stays identical regardless of which path the agent
|
|
39
|
+
* took).
|
|
40
|
+
*/
|
|
41
|
+
export const readSourceItemForDryRun = async ({ client, itemId, operationName, }) => {
|
|
42
|
+
const query = `
|
|
43
|
+
query ${operationName}($ids: [ID!]!) {
|
|
44
|
+
items(ids: $ids) {
|
|
45
|
+
${ITEM_FIELDS_FRAGMENT}
|
|
46
|
+
}
|
|
47
|
+
}
|
|
48
|
+
`;
|
|
49
|
+
const response = await client.raw(query, { ids: [itemId] }, { operationName });
|
|
50
|
+
const items = response.data.items;
|
|
51
|
+
const first = Array.isArray(items) ? items[0] : undefined;
|
|
52
|
+
if (first === undefined || first === null) {
|
|
53
|
+
throw new ApiError('not_found', `Monday returned no item for id ${itemId}`, { details: { item_id: itemId } });
|
|
54
|
+
}
|
|
55
|
+
return projectItem({ raw: parseRawItem(first, { item_id: itemId }) });
|
|
56
|
+
};
|
|
57
|
+
//# sourceMappingURL=item-source-read.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"item-source-read.js","sourceRoot":"","sources":["../../src/api/item-source-read.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA4BG;AAEH,OAAO,EAAE,QAAQ,EAAE,MAAM,oBAAoB,CAAC;AAC9C,OAAO,EACL,oBAAoB,EACpB,YAAY,GACb,MAAM,mBAAmB,CAAC;AAC3B,OAAO,EACL,WAAW,GAEZ,MAAM,sBAAsB,CAAC;AAO9B;;;;;;;GAOG;AACH,MAAM,CAAC,MAAM,uBAAuB,GAAG,KAAK,EAAE,EAC5C,MAAM,EACN,MAAM,EACN,aAAa,GAKd,EAA0B,EAAE;IAC3B,MAAM,KAAK,GAAG;YACJ,aAAa;;UAEf,oBAAoB;;;GAG3B,CAAC;IACF,MAAM,QAAQ,GAAG,MAAM,MAAM,CAAC,GAAG,CAC/B,KAAK,EACL,EAAE,GAAG,EAAE,CAAC,MAAM,CAAC,EAAE,EACjB,EAAE,aAAa,EAAE,CAClB,CAAC;IACF,MAAM,KAAK,GAAG,QAAQ,CAAC,IAAI,CAAC,KAAK,CAAC;IAClC,MAAM,KAAK,GAAY,KAAK,CAAC,OAAO,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,SAAS,CAAC;IACnE,IAAI,KAAK,KAAK,SAAS,IAAI,KAAK,KAAK,IAAI,EAAE,CAAC;QAC1C,MAAM,IAAI,QAAQ,CAChB,WAAW,EACX,kCAAkC,MAAM,EAAE,EAC1C,EAAE,OAAO,EAAE,EAAE,OAAO,EAAE,MAAM,EAAE,EAAE,CACjC,CAAC;IACJ,CAAC;IACD,OAAO,WAAW,CAAC,EAAE,GAAG,EAAE,YAAY,CAAC,KAAK,EAAE,EAAE,OAAO,EAAE,MAAM,EAAE,CAAC,EAAE,CAAC,CAAC;AACxE,CAAC,CAAC"}
|
|
@@ -0,0 +1,126 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* `items_page` GraphQL helper — single-page fetcher pair
|
|
3
|
+
* (`v0.2-plan.md` §18 R34).
|
|
4
|
+
*
|
|
5
|
+
* Lifted from five sites that all hand-rolled the same
|
|
6
|
+
* `query Foo($boardId: ID!, $limit: Int!, $queryParams: ItemsQuery)
|
|
7
|
+
* { boards(ids: [$boardId]) { items_page(...) { cursor items {...} } } }`
|
|
8
|
+
* shape with per-site item-field projection + per-site
|
|
9
|
+
* `unwrapOrThrow`-wrapped malformed-response handling. The shared
|
|
10
|
+
* surface is:
|
|
11
|
+
*
|
|
12
|
+
* - GraphQL string assembly (operation name + optional group-filter
|
|
13
|
+
* wrapper + caller-supplied item-fields fragment).
|
|
14
|
+
* - Response parse boundary — `boards[0]` (and `groups[0]` for the
|
|
15
|
+
* group-filtered variant) → `items_page.{cursor, items[]}` with
|
|
16
|
+
* the matching malformed-response context message.
|
|
17
|
+
*
|
|
18
|
+
* **Operation name as a parameter**, not a constant. The SDK threads
|
|
19
|
+
* `operationName` to Monday's request-log telemetry so a `bulk item
|
|
20
|
+
* update --where` walk is distinguishable from a `bulk item clear
|
|
21
|
+
* --where` walk in Monday's logs. Same reason §18 R33 stays deferred:
|
|
22
|
+
* collapsing operations under one name breaks attribution.
|
|
23
|
+
*
|
|
24
|
+
* **Item-fields fragment as a string**, not a typed projection. Three
|
|
25
|
+
* projections in scope today: `id` (clear / update bulk walkers),
|
|
26
|
+
* `id\n name` (upsert lookup), `${ITEM_FIELDS_FRAGMENT}`
|
|
27
|
+
* (item list). Projections are inlined verbatim into the query
|
|
28
|
+
* source — the per-call response zod schema validates that the rows
|
|
29
|
+
* Monday returned actually match.
|
|
30
|
+
*
|
|
31
|
+
* **Group-filter variant** (`item list --group <gid>`) wraps an extra
|
|
32
|
+
* `groups(ids: [$groupId])` selection between `boards` and
|
|
33
|
+
* `items_page`. The helper switches the query shape and the response
|
|
34
|
+
* schema based on the optional `groupId` input — both the wire shape
|
|
35
|
+
* and Monday's accepted variable set diverge between the two queries
|
|
36
|
+
* (the top-level `items_page` doesn't accept `group_id` inside
|
|
37
|
+
* `query_params`, so the group-aware path is structurally distinct).
|
|
38
|
+
*
|
|
39
|
+
* **The cursor walker stays in `pagination.ts`.** All bulk consumers
|
|
40
|
+
* (item list, item update --where, item clear --where) thread these
|
|
41
|
+
* single-page fetchers through `paginate.ts`'s `fetchInitial` /
|
|
42
|
+
* `fetchNext` closures. That preserves the §3.1 #8 per-page
|
|
43
|
+
* ascending-by-ID sort and the §5.6 `stale_cursor` enrichment
|
|
44
|
+
* (`cursor_age_seconds` / `items_returned_so_far` / `last_item_id`)
|
|
45
|
+
* across every site post-lift. Codex round-1 F1 + F2 caught the
|
|
46
|
+
* variant where a thin generator dropped both — pure refactor must
|
|
47
|
+
* match pre-lift behavior, not just pre-lift error code.
|
|
48
|
+
*
|
|
49
|
+
* **stale_cursor fail-fast.** `cli-design.md` §5.6 — Monday's cursor
|
|
50
|
+
* lifetime is 60 min, expired cursors return `INVALID_CURSOR_EXCEPTION`
|
|
51
|
+
* which `api/errors.ts` maps to `error.code === 'stale_cursor'`. The
|
|
52
|
+
* helper bubbles the error unchanged so `paginate.ts` can layer its
|
|
53
|
+
* §5.6 details enrichment on top.
|
|
54
|
+
*/
|
|
55
|
+
import { z } from 'zod';
|
|
56
|
+
import type { MondayClient, MondayResponse } from './client.js';
|
|
57
|
+
/**
|
|
58
|
+
* Inputs for a single `items_page(query_params:)` call. The `groupId`
|
|
59
|
+
* slot switches the query shape to the `boards.groups.items_page`
|
|
60
|
+
* variant; absent it the top-level `boards.items_page` is used.
|
|
61
|
+
*/
|
|
62
|
+
export interface ItemsPageInputs<T> {
|
|
63
|
+
readonly client: MondayClient;
|
|
64
|
+
/**
|
|
65
|
+
* Operation name threaded to Monday for telemetry / error
|
|
66
|
+
* attribution (e.g. `'ItemsPage'`, `'ItemsPageByGroup'`,
|
|
67
|
+
* `'ItemUpsertLookup'`). Per-call-site naming preserves Monday's
|
|
68
|
+
* request-log triage even when the underlying GraphQL is identical.
|
|
69
|
+
*/
|
|
70
|
+
readonly operationName: string;
|
|
71
|
+
readonly boardId: string;
|
|
72
|
+
/** Group-filter variant when defined; top-level `items_page` otherwise. */
|
|
73
|
+
readonly groupId?: string;
|
|
74
|
+
readonly limit: number;
|
|
75
|
+
readonly queryParams: Readonly<Record<string, unknown>> | undefined;
|
|
76
|
+
/**
|
|
77
|
+
* Inner-fragment GraphQL string for the per-row projection — e.g.
|
|
78
|
+
* `'id'`, `'id\n name'`, or `${ITEM_FIELDS_FRAGMENT}`.
|
|
79
|
+
* Inlined verbatim into the query source.
|
|
80
|
+
*/
|
|
81
|
+
readonly itemFields: string;
|
|
82
|
+
/** Per-row zod schema. The helper wraps it in the items_page envelope. */
|
|
83
|
+
readonly itemSchema: z.ZodType<T>;
|
|
84
|
+
}
|
|
85
|
+
/**
|
|
86
|
+
* Inputs for a single `next_items_page(cursor:)` continuation call.
|
|
87
|
+
* No `boardId` / `groupId` / `queryParams` — the cursor encodes the
|
|
88
|
+
* server-side filter state.
|
|
89
|
+
*/
|
|
90
|
+
export interface NextItemsPageInputs<T> {
|
|
91
|
+
readonly client: MondayClient;
|
|
92
|
+
readonly operationName: string;
|
|
93
|
+
readonly cursor: string;
|
|
94
|
+
readonly limit: number;
|
|
95
|
+
readonly itemFields: string;
|
|
96
|
+
readonly itemSchema: z.ZodType<T>;
|
|
97
|
+
}
|
|
98
|
+
/**
|
|
99
|
+
* Single-page response payload after parse — `MondayResponse.data`
|
|
100
|
+
* is re-typed to the parsed `{items, cursor}` shape. The wider
|
|
101
|
+
* response (complexity, stats) passes through unchanged so callers
|
|
102
|
+
* driving `paginate.ts`'s rich walker can lift `complexity` /
|
|
103
|
+
* request id off the same envelope they get today.
|
|
104
|
+
*/
|
|
105
|
+
export interface ItemsPagePayload<T> {
|
|
106
|
+
readonly items: readonly T[];
|
|
107
|
+
readonly cursor: string | null;
|
|
108
|
+
}
|
|
109
|
+
/**
|
|
110
|
+
* Fires one `items_page(query_params:)` query and returns the parsed
|
|
111
|
+
* `{items, cursor}` payload as `MondayResponse.data`. The wider
|
|
112
|
+
* `MondayResponse` shape (complexity, stats) passes through untouched
|
|
113
|
+
* so callers can spread it into `toEmit(response)` for `meta`.
|
|
114
|
+
*
|
|
115
|
+
* Malformed responses surface as typed `internal_error` carrying
|
|
116
|
+
* `details.issues` (per-field zod failure path) — same parse-boundary
|
|
117
|
+
* contract as the standalone `unwrapOrThrow` helper.
|
|
118
|
+
*/
|
|
119
|
+
export declare const fetchItemsPage: <T>(inputs: ItemsPageInputs<T>) => Promise<MondayResponse<ItemsPagePayload<T>>>;
|
|
120
|
+
/**
|
|
121
|
+
* Fires one `next_items_page(cursor:)` continuation and returns the
|
|
122
|
+
* parsed `{items, cursor}` payload. Same parse-boundary contract as
|
|
123
|
+
* {@link fetchItemsPage}.
|
|
124
|
+
*/
|
|
125
|
+
export declare const fetchNextItemsPage: <T>(inputs: NextItemsPageInputs<T>) => Promise<MondayResponse<ItemsPagePayload<T>>>;
|
|
126
|
+
//# sourceMappingURL=items-page-walker.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"items-page-walker.d.ts","sourceRoot":"","sources":["../../src/api/items-page-walker.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAqDG;AAEH,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAGxB,OAAO,KAAK,EAAE,YAAY,EAAE,cAAc,EAAE,MAAM,aAAa,CAAC;AAEhE;;;;GAIG;AACH,MAAM,WAAW,eAAe,CAAC,CAA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