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,133 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Shared item-command helpers (R9, surfaced post-M4 in
|
|
3
|
+
* `v0.1-plan.md` §17; lifted as the M5b opening move).
|
|
4
|
+
*
|
|
5
|
+
* The five M4 item-read commands (`get` / `list` / `find` / `search`
|
|
6
|
+
* / `subitems`) and M5a's dry-run engine all spell the same item
|
|
7
|
+
* GraphQL projection and the same per-command scaffolding:
|
|
8
|
+
*
|
|
9
|
+
* - The `column_values { id type text value column { title } }`
|
|
10
|
+
* selection appeared 10× across the five item commands plus once
|
|
11
|
+
* in `api/dry-run.ts`. A future contract change (a new column-
|
|
12
|
+
* side field landing on `cli-design.md` §6.2) would otherwise
|
|
13
|
+
* require a 12-touch sweep.
|
|
14
|
+
* - The full item-shape selection (id / name / state / url /
|
|
15
|
+
* created_at / updated_at / board { id } / group { id title } /
|
|
16
|
+
* parent_item { id } / column_values { ... }) appears in `get`,
|
|
17
|
+
* `list` (3×), `find` (3×), `search` (2×), `subitems`, and
|
|
18
|
+
* `dry-run.ts`. Same one-touch contract argument.
|
|
19
|
+
* - `resolveMeFactory`, `collectColumnHeads`, `titleMap`, and the
|
|
20
|
+
* parse-then-project closure for collection commands were each
|
|
21
|
+
* duplicated verbatim across `list.ts` and `search.ts`.
|
|
22
|
+
*
|
|
23
|
+
* Lifting them here gives M5b's mutation surface (`item set` / `item
|
|
24
|
+
* clear` / `item update`) and any future bulk path one place to
|
|
25
|
+
* import from instead of copy-pasting from `commands/item/list.ts`.
|
|
26
|
+
*
|
|
27
|
+
* **Contract surface.** Adding a field to `COLUMN_VALUES_FRAGMENT`
|
|
28
|
+
* (or `ITEM_FIELDS_FRAGMENT`) widens what `cli-design.md` §6.2 /
|
|
29
|
+
* §6.3 surface — bumps the envelope shape across every consumer in
|
|
30
|
+
* lockstep, which is the point. Do not introduce per-command
|
|
31
|
+
* divergence; if a single command needs more fields, extend the
|
|
32
|
+
* fragment and accept the cross-consumer change.
|
|
33
|
+
*/
|
|
34
|
+
import type { ColumnHead } from '../utils/output/envelope.js';
|
|
35
|
+
import { type ProjectedItem, type RawItem } from './item-projection.js';
|
|
36
|
+
import type { MondayClient } from './client.js';
|
|
37
|
+
/**
|
|
38
|
+
* The `column_values { ... }` selection Monday returns under every
|
|
39
|
+
* item shape in the v0.1 read surface. Inlined as a string because
|
|
40
|
+
* Monday's GraphQL surface accepts only inline expansion at the
|
|
41
|
+
* points the v0.1 commands use it (no `fragment ... on Item`
|
|
42
|
+
* registration is necessary).
|
|
43
|
+
*
|
|
44
|
+
* Indentation matches the spots every existing consumer interpolated
|
|
45
|
+
* — keeping the rendered query bytes identical post-lift means
|
|
46
|
+
* cassettes that hash on the query text continue to match without
|
|
47
|
+
* re-recording.
|
|
48
|
+
*/
|
|
49
|
+
export declare const COLUMN_VALUES_FRAGMENT = "column_values {\n id\n type\n text\n value\n column { title }\n }";
|
|
50
|
+
/**
|
|
51
|
+
* The full item-shape selection — every scalar field the v0.1
|
|
52
|
+
* `cli-design.md` §6.2 contract surfaces, plus the
|
|
53
|
+
* `COLUMN_VALUES_FRAGMENT` expansion. Used by `item get` / `list` /
|
|
54
|
+
* `find` / `search` / `subitems` and by the M5a dry-run engine.
|
|
55
|
+
*
|
|
56
|
+
* Indentation lands at the column the hand-rolled queries used so
|
|
57
|
+
* cassette / query-text diffs stay clean post-lift.
|
|
58
|
+
*/
|
|
59
|
+
export declare const ITEM_FIELDS_FRAGMENT = "id\n name\n state\n url\n created_at\n updated_at\n board { id }\n group { id title }\n parent_item { id }\n column_values {\n id\n type\n text\n value\n column { title }\n }";
|
|
60
|
+
/**
|
|
61
|
+
* Builds the `meta.columns` consolidation slot per `cli-design.md`
|
|
62
|
+
* §6.3 from board metadata. Same shape every collection-list
|
|
63
|
+
* command emits — the per-row `title` lands in the consolidated
|
|
64
|
+
* map, so per-cell title repeats drop from each row.
|
|
65
|
+
*
|
|
66
|
+
* Pure / synchronous; no I/O.
|
|
67
|
+
*/
|
|
68
|
+
export declare const collectColumnHeads: (metadata: {
|
|
69
|
+
readonly columns: readonly {
|
|
70
|
+
readonly id: string;
|
|
71
|
+
readonly type: string;
|
|
72
|
+
readonly title: string;
|
|
73
|
+
}[];
|
|
74
|
+
}) => Readonly<Record<string, ColumnHead>>;
|
|
75
|
+
/**
|
|
76
|
+
* Builds a title-by-id map for the `projectItem` projector — the
|
|
77
|
+
* canonical fallback when `column.title` on the wire could drift
|
|
78
|
+
* (M3 metadata loader's NFC + cache rules are the source of truth).
|
|
79
|
+
*
|
|
80
|
+
* Pure / synchronous; no I/O.
|
|
81
|
+
*/
|
|
82
|
+
export declare const titleMap: (metadata: {
|
|
83
|
+
readonly columns: readonly {
|
|
84
|
+
readonly id: string;
|
|
85
|
+
readonly title: string;
|
|
86
|
+
}[];
|
|
87
|
+
}) => ReadonlyMap<string, string>;
|
|
88
|
+
/**
|
|
89
|
+
* Builds the `me`-token resolver every people-aware filter / search
|
|
90
|
+
* command needs. The factory closes over the client; the returned
|
|
91
|
+
* function fires `client.whoami()` on demand. Callers memo-cache the
|
|
92
|
+
* resolved ID per build call to keep `--where Owner=me` cheap.
|
|
93
|
+
*
|
|
94
|
+
* Throws `UsageError` when the token is not associated with a
|
|
95
|
+
* Monday user (guest token, etc.). Defensive — the transport layer
|
|
96
|
+
* surfaces token-association failures as `unauthorized` before this
|
|
97
|
+
* resolver runs.
|
|
98
|
+
*/
|
|
99
|
+
export declare const resolveMeFactory: (client: MondayClient) => (() => Promise<string>);
|
|
100
|
+
/**
|
|
101
|
+
* Parses a raw GraphQL item-shape into a `RawItem` with the R18
|
|
102
|
+
* parse-boundary wrap: malformed payloads surface as
|
|
103
|
+
* `ApiError(internal_error)` with `details.issues` rather than a
|
|
104
|
+
* bare ZodError that loses the failing field path.
|
|
105
|
+
*
|
|
106
|
+
* Per `validation.md` "Never bubble raw ZodError out of a parse
|
|
107
|
+
* boundary". Mirrors the dry-run engine's per-id wrap (`api/dry-
|
|
108
|
+
* run.ts fetchItem`) and `userByEmail` (`api/resolvers.ts`) — same
|
|
109
|
+
* pattern across every parse boundary.
|
|
110
|
+
*
|
|
111
|
+
* Optional `details` are merged into the error envelope (e.g.
|
|
112
|
+
* `{ item_id: '123' }`) so consumers in `item get` / `find` /
|
|
113
|
+
* `subitems` can scope the failure to the specific item being
|
|
114
|
+
* parsed.
|
|
115
|
+
*/
|
|
116
|
+
export declare const parseRawItem: (raw: unknown, details?: Readonly<Record<string, unknown>>) => RawItem;
|
|
117
|
+
/**
|
|
118
|
+
* Parses one raw GraphQL item-shape and projects it into the §6.2 /
|
|
119
|
+
* §6.3 `ProjectedItem`. A thin wrapper around
|
|
120
|
+
* `parseRawItem + projectItem` so the collection commands (`list`,
|
|
121
|
+
* `search`) spell the same call once.
|
|
122
|
+
*
|
|
123
|
+
* `omitColumnTitles: true` is the §6.3 same-board-collection rule —
|
|
124
|
+
* per-cell `title` drops out of each column entry (consolidated
|
|
125
|
+
* into `meta.columns`). Single-resource paths (`item get`) skip
|
|
126
|
+
* this helper because they keep titles inline (`item-projection.ts`
|
|
127
|
+
* `projectItem` directly).
|
|
128
|
+
*/
|
|
129
|
+
export declare const projectFromRaw: (raw: unknown, titles: ReadonlyMap<string, string>, options: {
|
|
130
|
+
readonly omitColumnTitles: boolean;
|
|
131
|
+
}) => ProjectedItem;
|
|
132
|
+
export type { RawItem, ProjectedItem };
|
|
133
|
+
//# sourceMappingURL=item-helpers.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"item-helpers.d.ts","sourceRoot":"","sources":["../../src/api/item-helpers.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAgCG;AACH,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,6BAA6B,CAAC;AAG9D,OAAO,EAGL,KAAK,aAAa,EAClB,KAAK,OAAO,EACb,MAAM,sBAAsB,CAAC;AAC9B,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,aAAa,CAAC;AAEhD;;;;;;;;;;;GAWG;AACH,eAAO,MAAM,sBAAsB,sIAMvB,CAAC;AAEb;;;;;;;;GAQG;AACH,eAAO,MAAM,oBAAoB,oUASG,CAAC;AAErC;;;;;;;GAOG;AACH,eAAO,MAAM,kBAAkB,GAC7B,UAAU;IACR,QAAQ,CAAC,OAAO,EAAE,SAAS;QAAE,QAAQ,CAAC,EAAE,EAAE,MAAM,CAAC;QAAC,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC;QAAC,QAAQ,CAAC,KAAK,EAAE,MAAM,CAAA;KAAE,EAAE,CAAC;CACrG,KACA,QAAQ,CAAC,MAAM,CAAC,MAAM,EAAE,UAAU,CAAC,CAMrC,CAAC;AAEF;;;;;;GAMG;AACH,eAAO,MAAM,QAAQ,GACnB,UAAU;IACR,QAAQ,CAAC,OAAO,EAAE,SAAS;QAAE,QAAQ,CAAC,EAAE,EAAE,MAAM,CAAC;QAAC,QAAQ,CAAC,KAAK,EAAE,MAAM,CAAA;KAAE,EAAE,CAAC;CAC9E,KACA,WAAW,CAAC,MAAM,EAAE,MAAM,CAM5B,CAAC;AAEF;;;;;;;;;;GAUG;AACH,eAAO,MAAM,gBAAgB,GAC3B,QAAQ,YAAY,KACnB,CAAC,MAAM,OAAO,CAAC,MAAM,CAAC,CAexB,CAAC;AAEF;;;;;;;;;;;;;;;GAeG;AACH,eAAO,MAAM,YAAY,GACvB,KAAK,OAAO,EACZ,UAAU,QAAQ,CAAC,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC,KAC1C,OAQC,CAAC;AAEL;;;;;;;;;;;GAWG;AACH,eAAO,MAAM,cAAc,GACzB,KAAK,OAAO,EACZ,QAAQ,WAAW,CAAC,MAAM,EAAE,MAAM,CAAC,EACnC,SAAS;IAAE,QAAQ,CAAC,gBAAgB,EAAE,OAAO,CAAA;CAAE,KAC9C,aAOF,CAAC;AAEF,YAAY,EAAE,OAAO,EAAE,aAAa,EAAE,CAAC"}
|
|
@@ -0,0 +1,139 @@
|
|
|
1
|
+
import { UsageError } from '../utils/errors.js';
|
|
2
|
+
import { unwrapOrThrow } from '../utils/parse-boundary.js';
|
|
3
|
+
import { projectItem, rawItemSchema, } from './item-projection.js';
|
|
4
|
+
/**
|
|
5
|
+
* The `column_values { ... }` selection Monday returns under every
|
|
6
|
+
* item shape in the v0.1 read surface. Inlined as a string because
|
|
7
|
+
* Monday's GraphQL surface accepts only inline expansion at the
|
|
8
|
+
* points the v0.1 commands use it (no `fragment ... on Item`
|
|
9
|
+
* registration is necessary).
|
|
10
|
+
*
|
|
11
|
+
* Indentation matches the spots every existing consumer interpolated
|
|
12
|
+
* — keeping the rendered query bytes identical post-lift means
|
|
13
|
+
* cassettes that hash on the query text continue to match without
|
|
14
|
+
* re-recording.
|
|
15
|
+
*/
|
|
16
|
+
export const COLUMN_VALUES_FRAGMENT = `column_values {
|
|
17
|
+
id
|
|
18
|
+
type
|
|
19
|
+
text
|
|
20
|
+
value
|
|
21
|
+
column { title }
|
|
22
|
+
}`;
|
|
23
|
+
/**
|
|
24
|
+
* The full item-shape selection — every scalar field the v0.1
|
|
25
|
+
* `cli-design.md` §6.2 contract surfaces, plus the
|
|
26
|
+
* `COLUMN_VALUES_FRAGMENT` expansion. Used by `item get` / `list` /
|
|
27
|
+
* `find` / `search` / `subitems` and by the M5a dry-run engine.
|
|
28
|
+
*
|
|
29
|
+
* Indentation lands at the column the hand-rolled queries used so
|
|
30
|
+
* cassette / query-text diffs stay clean post-lift.
|
|
31
|
+
*/
|
|
32
|
+
export const ITEM_FIELDS_FRAGMENT = `id
|
|
33
|
+
name
|
|
34
|
+
state
|
|
35
|
+
url
|
|
36
|
+
created_at
|
|
37
|
+
updated_at
|
|
38
|
+
board { id }
|
|
39
|
+
group { id title }
|
|
40
|
+
parent_item { id }
|
|
41
|
+
${COLUMN_VALUES_FRAGMENT}`;
|
|
42
|
+
/**
|
|
43
|
+
* Builds the `meta.columns` consolidation slot per `cli-design.md`
|
|
44
|
+
* §6.3 from board metadata. Same shape every collection-list
|
|
45
|
+
* command emits — the per-row `title` lands in the consolidated
|
|
46
|
+
* map, so per-cell title repeats drop from each row.
|
|
47
|
+
*
|
|
48
|
+
* Pure / synchronous; no I/O.
|
|
49
|
+
*/
|
|
50
|
+
export const collectColumnHeads = (metadata) => {
|
|
51
|
+
const out = {};
|
|
52
|
+
for (const c of metadata.columns) {
|
|
53
|
+
out[c.id] = { id: c.id, type: c.type, title: c.title };
|
|
54
|
+
}
|
|
55
|
+
return out;
|
|
56
|
+
};
|
|
57
|
+
/**
|
|
58
|
+
* Builds a title-by-id map for the `projectItem` projector — the
|
|
59
|
+
* canonical fallback when `column.title` on the wire could drift
|
|
60
|
+
* (M3 metadata loader's NFC + cache rules are the source of truth).
|
|
61
|
+
*
|
|
62
|
+
* Pure / synchronous; no I/O.
|
|
63
|
+
*/
|
|
64
|
+
export const titleMap = (metadata) => {
|
|
65
|
+
const out = new Map();
|
|
66
|
+
for (const c of metadata.columns) {
|
|
67
|
+
out.set(c.id, c.title);
|
|
68
|
+
}
|
|
69
|
+
return out;
|
|
70
|
+
};
|
|
71
|
+
/**
|
|
72
|
+
* Builds the `me`-token resolver every people-aware filter / search
|
|
73
|
+
* command needs. The factory closes over the client; the returned
|
|
74
|
+
* function fires `client.whoami()` on demand. Callers memo-cache the
|
|
75
|
+
* resolved ID per build call to keep `--where Owner=me` cheap.
|
|
76
|
+
*
|
|
77
|
+
* Throws `UsageError` when the token is not associated with a
|
|
78
|
+
* Monday user (guest token, etc.). Defensive — the transport layer
|
|
79
|
+
* surfaces token-association failures as `unauthorized` before this
|
|
80
|
+
* resolver runs.
|
|
81
|
+
*/
|
|
82
|
+
export const resolveMeFactory = (client) => {
|
|
83
|
+
return async () => {
|
|
84
|
+
const response = await client.whoami();
|
|
85
|
+
const me = response.data.me;
|
|
86
|
+
/* c8 ignore next 5 — defensive: Monday's me field is null only
|
|
87
|
+
when the token is invalid / belongs to a guest, which the
|
|
88
|
+
transport layer surfaces as `unauthorized` before this
|
|
89
|
+
resolver runs. The guard exists for type narrowing. */
|
|
90
|
+
if (me === null) {
|
|
91
|
+
throw new UsageError('cannot resolve `me` — token is not associated with a Monday user');
|
|
92
|
+
}
|
|
93
|
+
return me.id;
|
|
94
|
+
};
|
|
95
|
+
};
|
|
96
|
+
/**
|
|
97
|
+
* Parses a raw GraphQL item-shape into a `RawItem` with the R18
|
|
98
|
+
* parse-boundary wrap: malformed payloads surface as
|
|
99
|
+
* `ApiError(internal_error)` with `details.issues` rather than a
|
|
100
|
+
* bare ZodError that loses the failing field path.
|
|
101
|
+
*
|
|
102
|
+
* Per `validation.md` "Never bubble raw ZodError out of a parse
|
|
103
|
+
* boundary". Mirrors the dry-run engine's per-id wrap (`api/dry-
|
|
104
|
+
* run.ts fetchItem`) and `userByEmail` (`api/resolvers.ts`) — same
|
|
105
|
+
* pattern across every parse boundary.
|
|
106
|
+
*
|
|
107
|
+
* Optional `details` are merged into the error envelope (e.g.
|
|
108
|
+
* `{ item_id: '123' }`) so consumers in `item get` / `find` /
|
|
109
|
+
* `subitems` can scope the failure to the specific item being
|
|
110
|
+
* parsed.
|
|
111
|
+
*/
|
|
112
|
+
export const parseRawItem = (raw, details) => unwrapOrThrow(rawItemSchema.safeParse(raw), {
|
|
113
|
+
context: 'Monday returned a malformed item response',
|
|
114
|
+
...(details === undefined ? {} : { details }),
|
|
115
|
+
hint: 'this is a data-integrity error in Monday\'s response (or a ' +
|
|
116
|
+
'rawItemSchema drift); verify the response shape and update ' +
|
|
117
|
+
'the schema if Monday\'s contract has changed.',
|
|
118
|
+
});
|
|
119
|
+
/**
|
|
120
|
+
* Parses one raw GraphQL item-shape and projects it into the §6.2 /
|
|
121
|
+
* §6.3 `ProjectedItem`. A thin wrapper around
|
|
122
|
+
* `parseRawItem + projectItem` so the collection commands (`list`,
|
|
123
|
+
* `search`) spell the same call once.
|
|
124
|
+
*
|
|
125
|
+
* `omitColumnTitles: true` is the §6.3 same-board-collection rule —
|
|
126
|
+
* per-cell `title` drops out of each column entry (consolidated
|
|
127
|
+
* into `meta.columns`). Single-resource paths (`item get`) skip
|
|
128
|
+
* this helper because they keep titles inline (`item-projection.ts`
|
|
129
|
+
* `projectItem` directly).
|
|
130
|
+
*/
|
|
131
|
+
export const projectFromRaw = (raw, titles, options) => {
|
|
132
|
+
const parsed = parseRawItem(raw);
|
|
133
|
+
return projectItem({
|
|
134
|
+
raw: parsed,
|
|
135
|
+
columnTitles: titles,
|
|
136
|
+
omitColumnTitles: options.omitColumnTitles,
|
|
137
|
+
});
|
|
138
|
+
};
|
|
139
|
+
//# sourceMappingURL=item-helpers.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"item-helpers.js","sourceRoot":"","sources":["../../src/api/item-helpers.ts"],"names":[],"mappings":"AAkCA,OAAO,EAAE,UAAU,EAAE,MAAM,oBAAoB,CAAC;AAChD,OAAO,EAAE,aAAa,EAAE,MAAM,4BAA4B,CAAC;AAC3D,OAAO,EACL,WAAW,EACX,aAAa,GAGd,MAAM,sBAAsB,CAAC;AAG9B;;;;;;;;;;;GAWG;AACH,MAAM,CAAC,MAAM,sBAAsB,GAAG;;;;;;YAM1B,CAAC;AAEb;;;;;;;;GAQG;AACH,MAAM,CAAC,MAAM,oBAAoB,GAAG;;;;;;;;;YASxB,sBAAsB,EAAE,CAAC;AAErC;;;;;;;GAOG;AACH,MAAM,CAAC,MAAM,kBAAkB,GAAG,CAChC,QAEC,EACqC,EAAE;IACxC,MAAM,GAAG,GAA+B,EAAE,CAAC;IAC3C,KAAK,MAAM,CAAC,IAAI,QAAQ,CAAC,OAAO,EAAE,CAAC;QACjC,GAAG,CAAC,CAAC,CAAC,EAAE,CAAC,GAAG,EAAE,EAAE,EAAE,CAAC,CAAC,EAAE,EAAE,IAAI,EAAE,CAAC,CAAC,IAAI,EAAE,KAAK,EAAE,CAAC,CAAC,KAAK,EAAE,CAAC;IACzD,CAAC;IACD,OAAO,GAAG,CAAC;AACb,CAAC,CAAC;AAEF;;;;;;GAMG;AACH,MAAM,CAAC,MAAM,QAAQ,GAAG,CACtB,QAEC,EAC4B,EAAE;IAC/B,MAAM,GAAG,GAAG,IAAI,GAAG,EAAkB,CAAC;IACtC,KAAK,MAAM,CAAC,IAAI,QAAQ,CAAC,OAAO,EAAE,CAAC;QACjC,GAAG,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,KAAK,CAAC,CAAC;IACzB,CAAC;IACD,OAAO,GAAG,CAAC;AACb,CAAC,CAAC;AAEF;;;;;;;;;;GAUG;AACH,MAAM,CAAC,MAAM,gBAAgB,GAAG,CAC9B,MAAoB,EACK,EAAE;IAC3B,OAAO,KAAK,IAAI,EAAE;QAChB,MAAM,QAAQ,GAAG,MAAM,MAAM,CAAC,MAAM,EAAE,CAAC;QACvC,MAAM,EAAE,GAAG,QAAQ,CAAC,IAAI,CAAC,EAAE,CAAC;QAC5B;;;iEAGyD;QACzD,IAAI,EAAE,KAAK,IAAI,EAAE,CAAC;YAChB,MAAM,IAAI,UAAU,CAClB,kEAAkE,CACnE,CAAC;QACJ,CAAC;QACD,OAAO,EAAE,CAAC,EAAE,CAAC;IACf,CAAC,CAAC;AACJ,CAAC,CAAC;AAEF;;;;;;;;;;;;;;;GAeG;AACH,MAAM,CAAC,MAAM,YAAY,GAAG,CAC1B,GAAY,EACZ,OAA2C,EAClC,EAAE,CACX,aAAa,CAAC,aAAa,CAAC,SAAS,CAAC,GAAG,CAAC,EAAE;IAC1C,OAAO,EAAE,2CAA2C;IACpD,GAAG,CAAC,OAAO,KAAK,SAAS,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,EAAE,OAAO,EAAE,CAAC;IAC7C,IAAI,EACF,6DAA6D;QAC7D,6DAA6D;QAC7D,+CAA+C;CAClD,CAAC,CAAC;AAEL;;;;;;;;;;;GAWG;AACH,MAAM,CAAC,MAAM,cAAc,GAAG,CAC5B,GAAY,EACZ,MAAmC,EACnC,OAA+C,EAChC,EAAE;IACjB,MAAM,MAAM,GAAY,YAAY,CAAC,GAAG,CAAC,CAAC;IAC1C,OAAO,WAAW,CAAC;QACjB,GAAG,EAAE,MAAM;QACX,YAAY,EAAE,MAAM;QACpB,gBAAgB,EAAE,OAAO,CAAC,gBAAgB;KAC3C,CAAC,CAAC;AACL,CAAC,CAAC"}
|
|
@@ -0,0 +1,60 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Live-mutation null-result projection — every item-shaped mutation
|
|
3
|
+
* (M5b's `change_simple_column_value` / `change_column_value` /
|
|
4
|
+
* `change_multiple_column_values` plus M10's `archive_item` /
|
|
5
|
+
* `delete_item` / `duplicate_item`) returns the post-mutation `Item`
|
|
6
|
+
* directly, and every consumer guards against a null result with the
|
|
7
|
+
* same shape: a typed throw carrying `details.item_id`, then
|
|
8
|
+
* `parseRawItem + projectItem` to surface the §6.4 mutation
|
|
9
|
+
* envelope's `data: <projected snapshot>`.
|
|
10
|
+
*
|
|
11
|
+
* Lifted from six sites — see v0.2-plan §14 R28:
|
|
12
|
+
* - `commands/item/set.ts` (M5b — local `projectMutationItem`)
|
|
13
|
+
* - `commands/item/clear.ts` (M5b — local `projectMutationItem`)
|
|
14
|
+
* - `commands/item/update.ts` (M5b — local `projectMutationItem`)
|
|
15
|
+
* - `commands/item/archive.ts` (M10 — inline)
|
|
16
|
+
* - `commands/item/delete.ts` (M10 — inline)
|
|
17
|
+
* - `commands/item/duplicate.ts` (M10 — inline)
|
|
18
|
+
*
|
|
19
|
+
* **Why parameterised on `errorCode` + `errorMessage`.** The two
|
|
20
|
+
* cohorts diverge in error semantics. M5b chose `internal_error` with
|
|
21
|
+
* "Monday returned no item payload from the mutation for id ..."
|
|
22
|
+
* (the mutation succeeded server-side but Monday returned an empty
|
|
23
|
+
* payload — server-side glitch, abnormal). M10 chose `not_found` with
|
|
24
|
+
* "Monday returned no item from <op_name> for id ..." (Monday's
|
|
25
|
+
* idiomatic null-for-missing-or-no-access response — a typed agent-
|
|
26
|
+
* recovery story). Both are correct for their semantics, both are
|
|
27
|
+
* pinned by integration tests, and both must survive the lift
|
|
28
|
+
* byte-for-byte. The helper owns the boilerplate (null check,
|
|
29
|
+
* `details: { item_id }` envelope, `parseRawItem + projectItem` chain);
|
|
30
|
+
* each call site supplies its own typed error parts.
|
|
31
|
+
*
|
|
32
|
+
* **What stays at the call site.** The post-projection error
|
|
33
|
+
* decoration (resolver-warning fold, validation_failed → column_
|
|
34
|
+
* archived remap, bulk `applied_count` / `applied_to` /
|
|
35
|
+
* `failed_at_item` attachment in update.ts's bulk path) lives at the
|
|
36
|
+
* call site. The helper's null-throw bubbles into the surrounding
|
|
37
|
+
* try/catch unchanged; callers compose the helper with their own
|
|
38
|
+
* `foldAndRemap` arms exactly as before. M11's `item move` + M14/M15
|
|
39
|
+
* board archive / delete will inherit this seam too.
|
|
40
|
+
*/
|
|
41
|
+
import { type ErrorCode } from '../utils/errors.js';
|
|
42
|
+
import { type ProjectedItem } from './item-projection.js';
|
|
43
|
+
/**
|
|
44
|
+
* Parses + projects a live-mutation `Item` payload, throwing the
|
|
45
|
+
* supplied typed error on null/undefined. Caller owns the error code +
|
|
46
|
+
* message so M5b's `internal_error` / "no item payload" and M10's
|
|
47
|
+
* `not_found` / "no item from <op_name>" both survive the lift
|
|
48
|
+
* byte-for-byte.
|
|
49
|
+
*
|
|
50
|
+
* `details: { item_id }` is supplied by the helper so every consumer
|
|
51
|
+
* carries the same envelope shape — agents key off `details.item_id`
|
|
52
|
+
* regardless of which verb threw (cli-design §6.5).
|
|
53
|
+
*/
|
|
54
|
+
export declare const projectMutationItem: ({ raw, itemId, errorCode, errorMessage, }: {
|
|
55
|
+
readonly raw: unknown;
|
|
56
|
+
readonly itemId: string;
|
|
57
|
+
readonly errorCode: ErrorCode;
|
|
58
|
+
readonly errorMessage: string;
|
|
59
|
+
}) => ProjectedItem;
|
|
60
|
+
//# sourceMappingURL=item-mutation-result.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"item-mutation-result.d.ts","sourceRoot":"","sources":["../../src/api/item-mutation-result.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAuCG;AAEH,OAAO,EAAY,KAAK,SAAS,EAAE,MAAM,oBAAoB,CAAC;AAE9D,OAAO,EAAe,KAAK,aAAa,EAAE,MAAM,sBAAsB,CAAC;AAEvE;;;;;;;;;;GAUG;AACH,eAAO,MAAM,mBAAmB,GAAI,2CAKjC;IACD,QAAQ,CAAC,GAAG,EAAE,OAAO,CAAC;IACtB,QAAQ,CAAC,MAAM,EAAE,MAAM,CAAC;IACxB,QAAQ,CAAC,SAAS,EAAE,SAAS,CAAC;IAC9B,QAAQ,CAAC,YAAY,EAAE,MAAM,CAAC;CAC/B,KAAG,aAOH,CAAC"}
|
|
@@ -0,0 +1,63 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Live-mutation null-result projection — every item-shaped mutation
|
|
3
|
+
* (M5b's `change_simple_column_value` / `change_column_value` /
|
|
4
|
+
* `change_multiple_column_values` plus M10's `archive_item` /
|
|
5
|
+
* `delete_item` / `duplicate_item`) returns the post-mutation `Item`
|
|
6
|
+
* directly, and every consumer guards against a null result with the
|
|
7
|
+
* same shape: a typed throw carrying `details.item_id`, then
|
|
8
|
+
* `parseRawItem + projectItem` to surface the §6.4 mutation
|
|
9
|
+
* envelope's `data: <projected snapshot>`.
|
|
10
|
+
*
|
|
11
|
+
* Lifted from six sites — see v0.2-plan §14 R28:
|
|
12
|
+
* - `commands/item/set.ts` (M5b — local `projectMutationItem`)
|
|
13
|
+
* - `commands/item/clear.ts` (M5b — local `projectMutationItem`)
|
|
14
|
+
* - `commands/item/update.ts` (M5b — local `projectMutationItem`)
|
|
15
|
+
* - `commands/item/archive.ts` (M10 — inline)
|
|
16
|
+
* - `commands/item/delete.ts` (M10 — inline)
|
|
17
|
+
* - `commands/item/duplicate.ts` (M10 — inline)
|
|
18
|
+
*
|
|
19
|
+
* **Why parameterised on `errorCode` + `errorMessage`.** The two
|
|
20
|
+
* cohorts diverge in error semantics. M5b chose `internal_error` with
|
|
21
|
+
* "Monday returned no item payload from the mutation for id ..."
|
|
22
|
+
* (the mutation succeeded server-side but Monday returned an empty
|
|
23
|
+
* payload — server-side glitch, abnormal). M10 chose `not_found` with
|
|
24
|
+
* "Monday returned no item from <op_name> for id ..." (Monday's
|
|
25
|
+
* idiomatic null-for-missing-or-no-access response — a typed agent-
|
|
26
|
+
* recovery story). Both are correct for their semantics, both are
|
|
27
|
+
* pinned by integration tests, and both must survive the lift
|
|
28
|
+
* byte-for-byte. The helper owns the boilerplate (null check,
|
|
29
|
+
* `details: { item_id }` envelope, `parseRawItem + projectItem` chain);
|
|
30
|
+
* each call site supplies its own typed error parts.
|
|
31
|
+
*
|
|
32
|
+
* **What stays at the call site.** The post-projection error
|
|
33
|
+
* decoration (resolver-warning fold, validation_failed → column_
|
|
34
|
+
* archived remap, bulk `applied_count` / `applied_to` /
|
|
35
|
+
* `failed_at_item` attachment in update.ts's bulk path) lives at the
|
|
36
|
+
* call site. The helper's null-throw bubbles into the surrounding
|
|
37
|
+
* try/catch unchanged; callers compose the helper with their own
|
|
38
|
+
* `foldAndRemap` arms exactly as before. M11's `item move` + M14/M15
|
|
39
|
+
* board archive / delete will inherit this seam too.
|
|
40
|
+
*/
|
|
41
|
+
import { ApiError } from '../utils/errors.js';
|
|
42
|
+
import { parseRawItem } from './item-helpers.js';
|
|
43
|
+
import { projectItem } from './item-projection.js';
|
|
44
|
+
/**
|
|
45
|
+
* Parses + projects a live-mutation `Item` payload, throwing the
|
|
46
|
+
* supplied typed error on null/undefined. Caller owns the error code +
|
|
47
|
+
* message so M5b's `internal_error` / "no item payload" and M10's
|
|
48
|
+
* `not_found` / "no item from <op_name>" both survive the lift
|
|
49
|
+
* byte-for-byte.
|
|
50
|
+
*
|
|
51
|
+
* `details: { item_id }` is supplied by the helper so every consumer
|
|
52
|
+
* carries the same envelope shape — agents key off `details.item_id`
|
|
53
|
+
* regardless of which verb threw (cli-design §6.5).
|
|
54
|
+
*/
|
|
55
|
+
export const projectMutationItem = ({ raw, itemId, errorCode, errorMessage, }) => {
|
|
56
|
+
if (raw === null || raw === undefined) {
|
|
57
|
+
throw new ApiError(errorCode, errorMessage, {
|
|
58
|
+
details: { item_id: itemId },
|
|
59
|
+
});
|
|
60
|
+
}
|
|
61
|
+
return projectItem({ raw: parseRawItem(raw, { item_id: itemId }) });
|
|
62
|
+
};
|
|
63
|
+
//# sourceMappingURL=item-mutation-result.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"item-mutation-result.js","sourceRoot":"","sources":["../../src/api/item-mutation-result.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAuCG;AAEH,OAAO,EAAE,QAAQ,EAAkB,MAAM,oBAAoB,CAAC;AAC9D,OAAO,EAAE,YAAY,EAAE,MAAM,mBAAmB,CAAC;AACjD,OAAO,EAAE,WAAW,EAAsB,MAAM,sBAAsB,CAAC;AAEvE;;;;;;;;;;GAUG;AACH,MAAM,CAAC,MAAM,mBAAmB,GAAG,CAAC,EAClC,GAAG,EACH,MAAM,EACN,SAAS,EACT,YAAY,GAMb,EAAiB,EAAE;IAClB,IAAI,GAAG,KAAK,IAAI,IAAI,GAAG,KAAK,SAAS,EAAE,CAAC;QACtC,MAAM,IAAI,QAAQ,CAAC,SAAS,EAAE,YAAY,EAAE;YAC1C,OAAO,EAAE,EAAE,OAAO,EAAE,MAAM,EAAE;SAC7B,CAAC,CAAC;IACL,CAAC;IACD,OAAO,WAAW,CAAC,EAAE,GAAG,EAAE,YAAY,CAAC,GAAG,EAAE,EAAE,OAAO,EAAE,MAAM,EAAE,CAAC,EAAE,CAAC,CAAC;AACtE,CAAC,CAAC"}
|
|
@@ -0,0 +1,165 @@
|
|
|
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 declare const rawColumnValueSchema: z.ZodObject<{
|
|
29
|
+
id: z.ZodString;
|
|
30
|
+
type: z.ZodString;
|
|
31
|
+
text: z.ZodNullable<z.ZodString>;
|
|
32
|
+
value: z.ZodNullable<z.ZodString>;
|
|
33
|
+
column: z.ZodOptional<z.ZodNullable<z.ZodObject<{
|
|
34
|
+
title: z.ZodString;
|
|
35
|
+
}, z.core.$strip>>>;
|
|
36
|
+
}, z.core.$strict>;
|
|
37
|
+
export type RawColumnValue = z.infer<typeof rawColumnValueSchema>;
|
|
38
|
+
export declare const rawItemSchema: z.ZodObject<{
|
|
39
|
+
id: z.ZodString;
|
|
40
|
+
name: z.ZodString;
|
|
41
|
+
state: z.ZodNullable<z.ZodString>;
|
|
42
|
+
url: z.ZodNullable<z.ZodString>;
|
|
43
|
+
created_at: z.ZodNullable<z.ZodString>;
|
|
44
|
+
updated_at: z.ZodNullable<z.ZodString>;
|
|
45
|
+
board: z.ZodNullable<z.ZodObject<{
|
|
46
|
+
id: z.ZodString;
|
|
47
|
+
}, z.core.$strip>>;
|
|
48
|
+
group: z.ZodOptional<z.ZodNullable<z.ZodObject<{
|
|
49
|
+
id: z.ZodString;
|
|
50
|
+
title: z.ZodNullable<z.ZodString>;
|
|
51
|
+
}, z.core.$strip>>>;
|
|
52
|
+
parent_item: z.ZodOptional<z.ZodNullable<z.ZodObject<{
|
|
53
|
+
id: z.ZodString;
|
|
54
|
+
}, z.core.$strip>>>;
|
|
55
|
+
creator_id: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
56
|
+
column_values: z.ZodArray<z.ZodObject<{
|
|
57
|
+
id: z.ZodString;
|
|
58
|
+
type: z.ZodString;
|
|
59
|
+
text: z.ZodNullable<z.ZodString>;
|
|
60
|
+
value: z.ZodNullable<z.ZodString>;
|
|
61
|
+
column: z.ZodOptional<z.ZodNullable<z.ZodObject<{
|
|
62
|
+
title: z.ZodString;
|
|
63
|
+
}, z.core.$strip>>>;
|
|
64
|
+
}, z.core.$strict>>;
|
|
65
|
+
}, z.core.$strict>;
|
|
66
|
+
export type RawItem = z.infer<typeof rawItemSchema>;
|
|
67
|
+
/**
|
|
68
|
+
* Single-column projected shape per §6.2. Carries the base shape
|
|
69
|
+
* (`id, type, title, text, value`) plus a few typed fields for the
|
|
70
|
+
* v0.1-writable status / date / people types. Mirror / formula /
|
|
71
|
+
* dependency columns surface as the base shape — `text` is the
|
|
72
|
+
* source of truth there because the typed payload isn't writable
|
|
73
|
+
* and Monday's wire shape varies.
|
|
74
|
+
*/
|
|
75
|
+
export declare const projectedColumnSchema: z.ZodObject<{
|
|
76
|
+
id: z.ZodString;
|
|
77
|
+
type: z.ZodString;
|
|
78
|
+
title: z.ZodOptional<z.ZodString>;
|
|
79
|
+
text: z.ZodNullable<z.ZodString>;
|
|
80
|
+
value: z.ZodUnknown;
|
|
81
|
+
label: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
82
|
+
index: z.ZodOptional<z.ZodNullable<z.ZodNumber>>;
|
|
83
|
+
date: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
84
|
+
time: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
85
|
+
people: z.ZodOptional<z.ZodArray<z.ZodObject<{
|
|
86
|
+
id: z.ZodString;
|
|
87
|
+
kind: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
88
|
+
}, z.core.$loose>>>;
|
|
89
|
+
}, z.core.$loose>;
|
|
90
|
+
export type ProjectedColumn = z.infer<typeof projectedColumnSchema>;
|
|
91
|
+
export declare const projectedItemSchema: z.ZodObject<{
|
|
92
|
+
id: z.ZodString;
|
|
93
|
+
name: z.ZodString;
|
|
94
|
+
board_id: z.ZodNullable<z.ZodString>;
|
|
95
|
+
group_id: z.ZodNullable<z.ZodString>;
|
|
96
|
+
parent_item_id: z.ZodNullable<z.ZodString>;
|
|
97
|
+
state: z.ZodNullable<z.ZodString>;
|
|
98
|
+
url: z.ZodNullable<z.ZodString>;
|
|
99
|
+
created_at: z.ZodNullable<z.ZodString>;
|
|
100
|
+
updated_at: z.ZodNullable<z.ZodString>;
|
|
101
|
+
columns: z.ZodRecord<z.ZodString, z.ZodObject<{
|
|
102
|
+
id: z.ZodString;
|
|
103
|
+
type: z.ZodString;
|
|
104
|
+
title: z.ZodOptional<z.ZodString>;
|
|
105
|
+
text: z.ZodNullable<z.ZodString>;
|
|
106
|
+
value: z.ZodUnknown;
|
|
107
|
+
label: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
108
|
+
index: z.ZodOptional<z.ZodNullable<z.ZodNumber>>;
|
|
109
|
+
date: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
110
|
+
time: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
111
|
+
people: z.ZodOptional<z.ZodArray<z.ZodObject<{
|
|
112
|
+
id: z.ZodString;
|
|
113
|
+
kind: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
114
|
+
}, z.core.$loose>>>;
|
|
115
|
+
}, z.core.$loose>>;
|
|
116
|
+
}, z.core.$strict>;
|
|
117
|
+
export type ProjectedItem = z.infer<typeof projectedItemSchema>;
|
|
118
|
+
/**
|
|
119
|
+
* Parses a Monday `value` string. Monday encodes structured column
|
|
120
|
+
* values as JSON strings; the projector decodes once at the boundary
|
|
121
|
+
* so consumers can read the structured field without re-parsing.
|
|
122
|
+
*
|
|
123
|
+
* Errors are swallowed: a malformed JSON string surfaces as `null`
|
|
124
|
+
* (with `text` still carrying the human form). Defensive — Monday
|
|
125
|
+
* occasionally returns an unparseable string for read-only column
|
|
126
|
+
* types, and we don't want one weird column to fail the whole emit.
|
|
127
|
+
*/
|
|
128
|
+
export declare const parseColumnValue: (raw: string | null) => unknown;
|
|
129
|
+
/**
|
|
130
|
+
* Projects one column-value into the §6.2 shape. Pure — no I/O.
|
|
131
|
+
* The board-metadata `title` is preferred over the wire-side
|
|
132
|
+
* `column.title` because the metadata loader's NFC + cache rules
|
|
133
|
+
* are the canonical source; `column.title` is only the fallback for
|
|
134
|
+
* cross-board lists where a single board metadata isn't loaded.
|
|
135
|
+
*/
|
|
136
|
+
export declare const projectColumnValue: (raw: RawColumnValue, fallbackTitle: string | undefined) => ProjectedColumn;
|
|
137
|
+
/**
|
|
138
|
+
* Reads `id` off a raw GraphQL item shape — the cursor walker
|
|
139
|
+
* needs a string for the per-page sort. Production cassettes always
|
|
140
|
+
* carry a string id (Monday's schema guarantees it); the
|
|
141
|
+
* structural-typing read keeps the walker honest if a future
|
|
142
|
+
* fixture drifts.
|
|
143
|
+
*/
|
|
144
|
+
export declare const idFromRawItem: (item: unknown) => string;
|
|
145
|
+
export interface ProjectItemInputs {
|
|
146
|
+
readonly raw: RawItem;
|
|
147
|
+
/**
|
|
148
|
+
* Per-board column titles, keyed by column ID. When supplied, the
|
|
149
|
+
* projector uses these in preference to the wire-side
|
|
150
|
+
* `column.title` (per §6.3 — the per-board view is canonical).
|
|
151
|
+
* Cross-board lists (`item find` walking multiple boards in
|
|
152
|
+
* theory) leave this undefined and fall back to the wire title.
|
|
153
|
+
*/
|
|
154
|
+
readonly columnTitles?: ReadonlyMap<string, string>;
|
|
155
|
+
/**
|
|
156
|
+
* §6.3 title de-duplication for same-board collections. When
|
|
157
|
+
* `true`, per-cell `title` is dropped from each column-value
|
|
158
|
+
* payload — the caller carries the canonical titles in
|
|
159
|
+
* `meta.columns` instead. Default `false` so single-resource calls
|
|
160
|
+
* (`item get`) keep titles inline (§6.2).
|
|
161
|
+
*/
|
|
162
|
+
readonly omitColumnTitles?: boolean;
|
|
163
|
+
}
|
|
164
|
+
export declare const projectItem: (inputs: ProjectItemInputs) => ProjectedItem;
|
|
165
|
+
//# sourceMappingURL=item-projection.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"item-projection.d.ts","sourceRoot":"","sources":["../../src/api/item-projection.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;GAyBG;AAEH,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAExB,eAAO,MAAM,oBAAoB;;;;;;;;kBAWtB,CAAC;AAEZ,MAAM,MAAM,cAAc,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,oBAAoB,CAAC,CAAC;AAElE,eAAO,MAAM,aAAa;;;;;;;;;;;;;;;;;;;;;;;;;;;kBAoBf,CAAC;AAEZ,MAAM,MAAM,OAAO,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,aAAa,CAAC,CAAC;AAEpD;;;;;;;GAOG;AACH,eAAO,MAAM,qBAAqB;;;;;;;;;;;;;;iBA0BxB,CAAC;AAEX,MAAM,MAAM,eAAe,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,qBAAqB,CAAC,CAAC;AAEpE,eAAO,MAAM,mBAAmB;;;;;;;;;;;;;;;;;;;;;;;;;kBAarB,CAAC;AAEZ,MAAM,MAAM,aAAa,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,mBAAmB,CAAC,CAAC;AAEhE;;;;;;;;;GASG;AACH,eAAO,MAAM,gBAAgB,GAAI,KAAK,MAAM,GAAG,IAAI,KAAG,OAOrD,CAAC;AAsCF;;;;;;GAMG;AACH,eAAO,MAAM,kBAAkB,GAC7B,KAAK,cAAc,EACnB,eAAe,MAAM,GAAG,SAAS,KAChC,eAqBF,CAAC;AAEF;;;;;;GAMG;AAIH,eAAO,MAAM,aAAa,GAAI,MAAM,OAAO,KAAG,MAI7C,CAAC;AAEF,MAAM,WAAW,iBAAiB;IAChC,QAAQ,CAAC,GAAG,EAAE,OAAO,CAAC;IACtB;;;;;;OAMG;IACH,QAAQ,CAAC,YAAY,CAAC,EAAE,WAAW,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;IACpD;;;;;;OAMG;IACH,QAAQ,CAAC,gBAAgB,CAAC,EAAE,OAAO,CAAC;CACrC;AAED,eAAO,MAAM,WAAW,GAAI,QAAQ,iBAAiB,KAAG,aA0BvD,CAAC"}
|