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,141 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Live-mutation null-result projection for the M17 group lifecycle
|
|
3
|
+
* cluster (`v0.2-plan.md` §22 R48 lift).
|
|
4
|
+
*
|
|
5
|
+
* Five M17 verbs share a near-verbatim shape: null-check the wire
|
|
6
|
+
* payload, throw a typed ApiError on null carrying both
|
|
7
|
+
* `details.board_id` and `details.group_id` (the group-mutation
|
|
8
|
+
* wire signature is two-tuple — `create_group` carries `board_id`
|
|
9
|
+
* only pre-id, but the read-side projection always pairs the two),
|
|
10
|
+
* then parse through `groupProjectionSchema` to surface the §6.4
|
|
11
|
+
* mutation envelope's `data: <projected snapshot>`.
|
|
12
|
+
*
|
|
13
|
+
* Lifted alongside the first M17 group verb commit (mirroring R45's
|
|
14
|
+
* "ship the projection helper alongside the first new mutation
|
|
15
|
+
* rather than as a follow-up R-class" precedent — same precedent
|
|
16
|
+
* R39 originally established). The five M17 verbs land in the same
|
|
17
|
+
* milestone, so adopting the helper from day one avoids five
|
|
18
|
+
* parallel inline implementations of the same shape. cf. R28
|
|
19
|
+
* (`projectMutationItem`), R37 (`projectMutationUpdate`), R43
|
|
20
|
+
* (`projectMutationBoard`), R45 (`projectMutationColumn`); R48
|
|
21
|
+
* ships the fifth per-noun helper at the firmest 5-consumer trigger
|
|
22
|
+
* any projection-helper lift has had to date (R39 fired at 3, R45
|
|
23
|
+
* at 3, R48 at 5).
|
|
24
|
+
*
|
|
25
|
+
* **Why parameterised on `errorCode` + `errorMessage`.** Like
|
|
26
|
+
* R28 / R37 / R43 / R45, the M17 verbs diverge in error semantics:
|
|
27
|
+
* - `group-create` chose `internal_error` (every successful call
|
|
28
|
+
* returns a Group — a null payload means Monday glitched
|
|
29
|
+
* server-side, abnormal); the `details` carry `board_id` +
|
|
30
|
+
* `name` (no group_id yet).
|
|
31
|
+
* - `group-update`, `group-archive`, `group-duplicate`,
|
|
32
|
+
* `group-delete` chose `not_found` (Monday's idiomatic null-
|
|
33
|
+
* for-missing-or-no-access response — a typed agent-recovery
|
|
34
|
+
* story); all four carry `board_id` + `group_id`.
|
|
35
|
+
* The helper owns the boilerplate (null check, `details: {board_id,
|
|
36
|
+
* [idKey]: idValue}` envelope, the `unwrapOrThrow` schema parse);
|
|
37
|
+
* each call site supplies its own typed error parts.
|
|
38
|
+
*
|
|
39
|
+
* **`GROUP_FIELDS_FRAGMENT` + `groupProjectionSchema` co-ship.**
|
|
40
|
+
* Mirrors R39's `WORKSPACE_FIELDS_FRAGMENT` + `workspaceProjection
|
|
41
|
+
* Schema`, R43's `BOARD_FIELDS_FRAGMENT` + `boardProjectionSchema`,
|
|
42
|
+
* and R45's `COLUMN_FIELDS_FRAGMENT` + `columnProjectionSchema`
|
|
43
|
+
* patterns. The schema mirrors the `groupSchema` already in
|
|
44
|
+
* `src/api/board-metadata.ts` (the read-side cache projection) but
|
|
45
|
+
* exists as an exported strict projection schema so M17's five
|
|
46
|
+
* mutation verbs share one source of truth for the on-the-wire
|
|
47
|
+
* Group shape. The field set covers the full Group metadata —
|
|
48
|
+
* every Group field except `items_page`, which is the group's
|
|
49
|
+
* items rather than group metadata and is out of scope for the
|
|
50
|
+
* mutation envelope's `data` slot (M17 pre-flight load-bearing
|
|
51
|
+
* finding).
|
|
52
|
+
*
|
|
53
|
+
* **What stays at the call site.** The wire-shape parse of the full
|
|
54
|
+
* mutation response (`responseSchema.safeParse(response.data)`)
|
|
55
|
+
* stays inline because each verb's response root key (`create_
|
|
56
|
+
* group` / `update_group` / `archive_group` / `duplicate_group` /
|
|
57
|
+
* `delete_group`) is per-verb. The missing-root-key check (schema-
|
|
58
|
+
* drift → `internal_error` with a `hint`) stays inline too —
|
|
59
|
+
* that's Codex M15 implementation round-2 F1's distinction between
|
|
60
|
+
* schema-drift and null-payload, deliberately preserved at each
|
|
61
|
+
* site. R42 would unify the missing-root-key check across all
|
|
62
|
+
* pre-M14 mutation verbs once scheduled.
|
|
63
|
+
*/
|
|
64
|
+
import { z } from 'zod';
|
|
65
|
+
import { ApiError } from '../utils/errors.js';
|
|
66
|
+
import { unwrapOrThrow } from '../utils/parse-boundary.js';
|
|
67
|
+
/**
|
|
68
|
+
* Shared GraphQL selection set for the M17 group projection. 6-space
|
|
69
|
+
* continuation indent matches the column every consumer interpolates
|
|
70
|
+
* `${GROUP_FIELDS_FRAGMENT}` at, so rendered query bytes stay stable
|
|
71
|
+
* across consumers. Mirrors `BOARD_FIELDS_FRAGMENT` (R43),
|
|
72
|
+
* `WORKSPACE_FIELDS_FRAGMENT` (R39), and `COLUMN_FIELDS_FRAGMENT`
|
|
73
|
+
* (R45).
|
|
74
|
+
*
|
|
75
|
+
* Field set tracks `boardMetadataSchema.groups[*]` (the read-side
|
|
76
|
+
* cache projection) so a `board describe` after a successful group
|
|
77
|
+
* mutation returns the same JSON shape the mutation envelope did.
|
|
78
|
+
* `items_page` is deliberately excluded — that's the group's items,
|
|
79
|
+
* not group metadata, and is out of scope for the mutation
|
|
80
|
+
* envelope's `data` slot.
|
|
81
|
+
*/
|
|
82
|
+
export const GROUP_FIELDS_FRAGMENT = `id
|
|
83
|
+
title
|
|
84
|
+
color
|
|
85
|
+
position
|
|
86
|
+
archived
|
|
87
|
+
deleted`;
|
|
88
|
+
/**
|
|
89
|
+
* Strict zod schema for the group projection — the exact shape
|
|
90
|
+
* `GROUP_FIELDS_FRAGMENT` selects from the wire. Shared by all
|
|
91
|
+
* five M17 group verbs; each verb's `CommandModule.outputSchema`
|
|
92
|
+
* aliases this so the schema-export pipeline emits one canonical
|
|
93
|
+
* shape.
|
|
94
|
+
*
|
|
95
|
+
* Mirrors `boardMetadataSchema.groups[*]` in `board-metadata.ts`
|
|
96
|
+
* verbatim — same fields, same nullability — so a `board describe`
|
|
97
|
+
* after a successful group mutation reads the same JSON shape the
|
|
98
|
+
* mutation envelope wrote.
|
|
99
|
+
*/
|
|
100
|
+
export const groupProjectionSchema = z
|
|
101
|
+
.object({
|
|
102
|
+
id: z.string().min(1),
|
|
103
|
+
title: z.string(),
|
|
104
|
+
color: z.string().nullable(),
|
|
105
|
+
position: z.string().nullable(),
|
|
106
|
+
archived: z.boolean().nullable(),
|
|
107
|
+
deleted: z.boolean().nullable(),
|
|
108
|
+
})
|
|
109
|
+
.strict();
|
|
110
|
+
/**
|
|
111
|
+
* Parses + projects a live-mutation `Group` payload, throwing the
|
|
112
|
+
* supplied typed error on null/undefined. Caller owns the error
|
|
113
|
+
* code + message so create's `internal_error` / "no group payload
|
|
114
|
+
* from create_group for board <X> name <Y>" and update's /
|
|
115
|
+
* archive's / duplicate's / delete's `not_found` / "no group
|
|
116
|
+
* payload from <op> for board <X> group <Y>" all survive the lift
|
|
117
|
+
* byte-for-byte.
|
|
118
|
+
*
|
|
119
|
+
* `details: { board_id, [idKey]: idValue }` is supplied by the
|
|
120
|
+
* helper so every consumer carries the same envelope shape —
|
|
121
|
+
* agents key off `details.board_id` + `details.group_id` (or
|
|
122
|
+
* `details.name` on create's pre-id path) regardless of which verb
|
|
123
|
+
* threw (cli-design §6.5).
|
|
124
|
+
*/
|
|
125
|
+
export const projectMutationGroup = ({ raw, errorCode, errorMessage, boardId, idKey, idValue, }) => {
|
|
126
|
+
const details = {
|
|
127
|
+
board_id: boardId,
|
|
128
|
+
[idKey]: idValue,
|
|
129
|
+
};
|
|
130
|
+
if (raw === null || raw === undefined) {
|
|
131
|
+
throw new ApiError(errorCode, errorMessage, { details });
|
|
132
|
+
}
|
|
133
|
+
const subjectPhrase = idKey === 'name'
|
|
134
|
+
? `board ${boardId} name ${JSON.stringify(idValue)}`
|
|
135
|
+
: `board ${boardId} group ${idValue}`;
|
|
136
|
+
return unwrapOrThrow(groupProjectionSchema.safeParse(raw), {
|
|
137
|
+
context: `Monday returned a malformed group payload for ${subjectPhrase}`,
|
|
138
|
+
details,
|
|
139
|
+
});
|
|
140
|
+
};
|
|
141
|
+
//# sourceMappingURL=group-mutation-result.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"group-mutation-result.js","sourceRoot":"","sources":["../../src/api/group-mutation-result.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA8DG;AAEH,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AACxB,OAAO,EAAE,QAAQ,EAAkB,MAAM,oBAAoB,CAAC;AAC9D,OAAO,EAAE,aAAa,EAAE,MAAM,4BAA4B,CAAC;AAE3D;;;;;;;;;;;;;;GAcG;AACH,MAAM,CAAC,MAAM,qBAAqB,GAAG;;;;;cAKvB,CAAC;AAEf;;;;;;;;;;;GAWG;AACH,MAAM,CAAC,MAAM,qBAAqB,GAAG,CAAC;KACnC,MAAM,CAAC;IACN,EAAE,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,GAAG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Source-of-truth
|
|
4
|
+
* lifted into its own module so the data + the membership test stay
|
|
5
|
+
* one import away from `phones.ts` without bloating that file's
|
|
6
|
+
* grammar concerns.
|
|
7
|
+
*
|
|
8
|
+
* **Why a frozen list rather than `Intl`.** Node's `Intl` exposes
|
|
9
|
+
* `Intl.supportedValuesOf('region')` (Node 18+), which returns the
|
|
10
|
+
* full ISO 3166-1 alpha-2 code set the runtime knows about. The
|
|
11
|
+
* problem: the set the runtime knows about is ICU-version-dependent,
|
|
12
|
+
* so a CLI that builds against Node 22 may accept a code on a
|
|
13
|
+
* developer's machine and reject it on a CI runner. A frozen
|
|
14
|
+
* allowlist is reproducible across runtimes and the file is
|
|
15
|
+
* regenerated by hand when ISO publishes a new code (rare — the
|
|
16
|
+
* 3166-1 list grows by ~one entry per decade).
|
|
17
|
+
*
|
|
18
|
+
* **Source of the list.** ISO 3166-1 alpha-2 as of 2025-01 (vendored
|
|
19
|
+
* from Wikipedia's "ISO 3166-1 alpha-2" article cross-checked with
|
|
20
|
+
* the ISO online browsing platform). Officially-assigned codes only
|
|
21
|
+
* — exceptionally-reserved (`UK`, `EU`), transitional (`CS`), and
|
|
22
|
+
* user-assigned (`AA`, `OO`) ranges are excluded. Monday's phone
|
|
23
|
+
* validation accepts officially-assigned codes only per the
|
|
24
|
+
* developer-portal phone-column reference.
|
|
25
|
+
*/
|
|
26
|
+
/**
|
|
27
|
+
* Officially-assigned ISO 3166-1 alpha-2 country codes (uppercase).
|
|
28
|
+
* Used by `parsePhoneInput` to validate the `<country>` segment of
|
|
29
|
+
* the pipe-form `<phone>|<country>` input. Frozen `as const` so the
|
|
30
|
+
* type narrows to a finite literal-string union; the `Set` form
|
|
31
|
+
* below provides O(1) membership lookup.
|
|
32
|
+
*
|
|
33
|
+
* 249 codes (ISO 3166-1 alpha-2 list count, 2025-01).
|
|
34
|
+
*/
|
|
35
|
+
export declare const ISO_3166_1_ALPHA_2_CODES: readonly ["AD", "AE", "AF", "AG", "AI", "AL", "AM", "AO", "AQ", "AR", "AS", "AT", "AU", "AW", "AX", "AZ", "BA", "BB", "BD", "BE", "BF", "BG", "BH", "BI", "BJ", "BL", "BM", "BN", "BO", "BQ", "BR", "BS", "BT", "BV", "BW", "BY", "BZ", "CA", "CC", "CD", "CF", "CG", "CH", "CI", "CK", "CL", "CM", "CN", "CO", "CR", "CU", "CV", "CW", "CX", "CY", "CZ", "DE", "DJ", "DK", "DM", "DO", "DZ", "EC", "EE", "EG", "EH", "ER", "ES", "ET", "FI", "FJ", "FK", "FM", "FO", "FR", "GA", "GB", "GD", "GE", "GF", "GG", "GH", "GI", "GL", "GM", "GN", "GP", "GQ", "GR", "GS", "GT", "GU", "GW", "GY", "HK", "HM", "HN", "HR", "HT", "HU", "ID", "IE", "IL", "IM", "IN", "IO", "IQ", "IR", "IS", "IT", "JE", "JM", "JO", "JP", "KE", "KG", "KH", "KI", "KM", "KN", "KP", "KR", "KW", "KY", "KZ", "LA", "LB", "LC", "LI", "LK", "LR", "LS", "LT", "LU", "LV", "LY", "MA", "MC", "MD", "ME", "MF", "MG", "MH", "MK", "ML", "MM", "MN", "MO", "MP", "MQ", "MR", "MS", "MT", "MU", "MV", "MW", "MX", "MY", "MZ", "NA", "NC", "NE", "NF", "NG", "NI", "NL", "NO", "NP", "NR", "NU", "NZ", "OM", "PA", "PE", "PF", "PG", "PH", "PK", "PL", "PM", "PN", "PR", "PS", "PT", "PW", "PY", "QA", "RE", "RO", "RS", "RU", "RW", "SA", "SB", "SC", "SD", "SE", "SG", "SH", "SI", "SJ", "SK", "SL", "SM", "SN", "SO", "SR", "SS", "ST", "SV", "SX", "SY", "SZ", "TC", "TD", "TF", "TG", "TH", "TJ", "TK", "TL", "TM", "TN", "TO", "TR", "TT", "TV", "TW", "TZ", "UA", "UG", "UM", "US", "UY", "UZ", "VA", "VC", "VE", "VG", "VI", "VN", "VU", "WF", "WS", "YE", "YT", "ZA", "ZM", "ZW"];
|
|
36
|
+
export type IsoCountryCode = (typeof ISO_3166_1_ALPHA_2_CODES)[number];
|
|
37
|
+
/**
|
|
38
|
+
* Membership test against the frozen allowlist. Case-sensitive —
|
|
39
|
+
* Monday's phone-column validation expects uppercase, so the caller
|
|
40
|
+
* uppercases before calling. The narrowing to `IsoCountryCode` lets
|
|
41
|
+
* downstream code that wants to enumerate codes use the literal
|
|
42
|
+
* union without re-validating.
|
|
43
|
+
*/
|
|
44
|
+
export declare const isIsoCountryCode: (code: string) => code is IsoCountryCode;
|
|
45
|
+
//# sourceMappingURL=iso-country-codes.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"iso-country-codes.d.ts","sourceRoot":"","sources":["../../src/api/iso-country-codes.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;GAwBG;AAEH;;;;;;;;GAQG;AACH,eAAO,MAAM,wBAAwB,i+CA0B3B,CAAC;AAEX,MAAM,MAAM,cAAc,GAAG,CAAC,OAAO,wBAAwB,CAAC,CAAC,MAAM,CAAC,CAAC;AAMvE;;;;;;GAMG;AACH,eAAO,MAAM,gBAAgB,GAAI,MAAM,MAAM,KAAG,IAAI,IAAI,cAChC,CAAC"}
|
|
@@ -0,0 +1,71 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Frozen ISO 3166-1 alpha-2 country code allowlist for the `phone`
|
|
3
|
+
* column-value translator (`v0.2-plan.md` §3 M8). Source-of-truth
|
|
4
|
+
* lifted into its own module so the data + the membership test stay
|
|
5
|
+
* one import away from `phones.ts` without bloating that file's
|
|
6
|
+
* grammar concerns.
|
|
7
|
+
*
|
|
8
|
+
* **Why a frozen list rather than `Intl`.** Node's `Intl` exposes
|
|
9
|
+
* `Intl.supportedValuesOf('region')` (Node 18+), which returns the
|
|
10
|
+
* full ISO 3166-1 alpha-2 code set the runtime knows about. The
|
|
11
|
+
* problem: the set the runtime knows about is ICU-version-dependent,
|
|
12
|
+
* so a CLI that builds against Node 22 may accept a code on a
|
|
13
|
+
* developer's machine and reject it on a CI runner. A frozen
|
|
14
|
+
* allowlist is reproducible across runtimes and the file is
|
|
15
|
+
* regenerated by hand when ISO publishes a new code (rare — the
|
|
16
|
+
* 3166-1 list grows by ~one entry per decade).
|
|
17
|
+
*
|
|
18
|
+
* **Source of the list.** ISO 3166-1 alpha-2 as of 2025-01 (vendored
|
|
19
|
+
* from Wikipedia's "ISO 3166-1 alpha-2" article cross-checked with
|
|
20
|
+
* the ISO online browsing platform). Officially-assigned codes only
|
|
21
|
+
* — exceptionally-reserved (`UK`, `EU`), transitional (`CS`), and
|
|
22
|
+
* user-assigned (`AA`, `OO`) ranges are excluded. Monday's phone
|
|
23
|
+
* validation accepts officially-assigned codes only per the
|
|
24
|
+
* developer-portal phone-column reference.
|
|
25
|
+
*/
|
|
26
|
+
/**
|
|
27
|
+
* Officially-assigned ISO 3166-1 alpha-2 country codes (uppercase).
|
|
28
|
+
* Used by `parsePhoneInput` to validate the `<country>` segment of
|
|
29
|
+
* the pipe-form `<phone>|<country>` input. Frozen `as const` so the
|
|
30
|
+
* type narrows to a finite literal-string union; the `Set` form
|
|
31
|
+
* below provides O(1) membership lookup.
|
|
32
|
+
*
|
|
33
|
+
* 249 codes (ISO 3166-1 alpha-2 list count, 2025-01).
|
|
34
|
+
*/
|
|
35
|
+
export const ISO_3166_1_ALPHA_2_CODES = [
|
|
36
|
+
'AD', 'AE', 'AF', 'AG', 'AI', 'AL', 'AM', 'AO', 'AQ', 'AR',
|
|
37
|
+
'AS', 'AT', 'AU', 'AW', 'AX', 'AZ', 'BA', 'BB', 'BD', 'BE',
|
|
38
|
+
'BF', 'BG', 'BH', 'BI', 'BJ', 'BL', 'BM', 'BN', 'BO', 'BQ',
|
|
39
|
+
'BR', 'BS', 'BT', 'BV', 'BW', 'BY', 'BZ', 'CA', 'CC', 'CD',
|
|
40
|
+
'CF', 'CG', 'CH', 'CI', 'CK', 'CL', 'CM', 'CN', 'CO', 'CR',
|
|
41
|
+
'CU', 'CV', 'CW', 'CX', 'CY', 'CZ', 'DE', 'DJ', 'DK', 'DM',
|
|
42
|
+
'DO', 'DZ', 'EC', 'EE', 'EG', 'EH', 'ER', 'ES', 'ET', 'FI',
|
|
43
|
+
'FJ', 'FK', 'FM', 'FO', 'FR', 'GA', 'GB', 'GD', 'GE', 'GF',
|
|
44
|
+
'GG', 'GH', 'GI', 'GL', 'GM', 'GN', 'GP', 'GQ', 'GR', 'GS',
|
|
45
|
+
'GT', 'GU', 'GW', 'GY', 'HK', 'HM', 'HN', 'HR', 'HT', 'HU',
|
|
46
|
+
'ID', 'IE', 'IL', 'IM', 'IN', 'IO', 'IQ', 'IR', 'IS', 'IT',
|
|
47
|
+
'JE', 'JM', 'JO', 'JP', 'KE', 'KG', 'KH', 'KI', 'KM', 'KN',
|
|
48
|
+
'KP', 'KR', 'KW', 'KY', 'KZ', 'LA', 'LB', 'LC', 'LI', 'LK',
|
|
49
|
+
'LR', 'LS', 'LT', 'LU', 'LV', 'LY', 'MA', 'MC', 'MD', 'ME',
|
|
50
|
+
'MF', 'MG', 'MH', 'MK', 'ML', 'MM', 'MN', 'MO', 'MP', 'MQ',
|
|
51
|
+
'MR', 'MS', 'MT', 'MU', 'MV', 'MW', 'MX', 'MY', 'MZ', 'NA',
|
|
52
|
+
'NC', 'NE', 'NF', 'NG', 'NI', 'NL', 'NO', 'NP', 'NR', 'NU',
|
|
53
|
+
'NZ', 'OM', 'PA', 'PE', 'PF', 'PG', 'PH', 'PK', 'PL', 'PM',
|
|
54
|
+
'PN', 'PR', 'PS', 'PT', 'PW', 'PY', 'QA', 'RE', 'RO', 'RS',
|
|
55
|
+
'RU', 'RW', 'SA', 'SB', 'SC', 'SD', 'SE', 'SG', 'SH', 'SI',
|
|
56
|
+
'SJ', 'SK', 'SL', 'SM', 'SN', 'SO', 'SR', 'SS', 'ST', 'SV',
|
|
57
|
+
'SX', 'SY', 'SZ', 'TC', 'TD', 'TF', 'TG', 'TH', 'TJ', 'TK',
|
|
58
|
+
'TL', 'TM', 'TN', 'TO', 'TR', 'TT', 'TV', 'TW', 'TZ', 'UA',
|
|
59
|
+
'UG', 'UM', 'US', 'UY', 'UZ', 'VA', 'VC', 'VE', 'VG', 'VI',
|
|
60
|
+
'VN', 'VU', 'WF', 'WS', 'YE', 'YT', 'ZA', 'ZM', 'ZW',
|
|
61
|
+
];
|
|
62
|
+
const ISO_CODE_SET = new Set(ISO_3166_1_ALPHA_2_CODES);
|
|
63
|
+
/**
|
|
64
|
+
* Membership test against the frozen allowlist. Case-sensitive —
|
|
65
|
+
* Monday's phone-column validation expects uppercase, so the caller
|
|
66
|
+
* uppercases before calling. The narrowing to `IsoCountryCode` lets
|
|
67
|
+
* downstream code that wants to enumerate codes use the literal
|
|
68
|
+
* union without re-validating.
|
|
69
|
+
*/
|
|
70
|
+
export const isIsoCountryCode = (code) => ISO_CODE_SET.has(code);
|
|
71
|
+
//# sourceMappingURL=iso-country-codes.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"iso-country-codes.js","sourceRoot":"","sources":["../../src/api/iso-country-codes.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;GAwBG;AAEH;;;;;;;;GAQG;AACH,MAAM,CAAC,MAAM,wBAAwB,GAAG;IACtC,IAAI,EAAE,IAAI,EAAE,IAAI,EAAE,IAAI,EAAE,IAAI,EAAE,IAAI,EAAE,IAAI,EAAE,IAAI,EAAE,IAAI,EAAE,IAAI;IAC1D,IAAI,EAAE,IAAI,EAAE,IAAI,EAAE,IAAI,EAAE,IAAI,EAAE,IAAI,EAAE,IAAI,EAAE,IAAI,EAAE,IAAI,EAAE,IAAI;IAC1D,IAAI,EAAE,IAAI,EAAE,IAAI,EAAE,IAAI,EAAE,IAAI,EAAE,IAAI,EAAE,IAAI,EAAE,IAAI,EAAE,IAAI,EAAE,IAAI;IAC1D,IAAI,EAAE,IAAI,EAAE,IAAI,EAAE,IAAI,EAAE,IAAI,EAAE,IAAI,EAAE,IAAI,EAAE,IAAI,EAAE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AAE,IAAI,EAAE,IAAI,EAAE,IAAI,EAAE,IAAI,EAAE,IAAI,EAAE,IAAI,EAAE,IAAI,EAAE,IAAI;CAC5C,CAAC;AAIX,MAAM,YAAY,GAAwB,IAAI,GAAG,CAC/C,wBAAwB,CACzB,CAAC;AAEF;;;;;;GAMG;AACH,MAAM,CAAC,MAAM,gBAAgB,GAAG,CAAC,IAAY,EAA0B,EAAE,CACvE,YAAY,CAAC,GAAG,CAAC,IAAI,CAAC,CAAC"}
|
|
@@ -0,0 +1,86 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Item-board lookup — shared GraphQL query + parse boundary + the
|
|
3
|
+
* `--board <bid> ?? lookup` resolver every item-mutation surface needs.
|
|
4
|
+
*
|
|
5
|
+
* Lifted from four sites (`set.ts`, `clear.ts`, `update.ts`, `create.ts`)
|
|
6
|
+
* — see v0.2-plan §12 R23. Each had the same triple: a verbatim
|
|
7
|
+
* `ItemBoardLookup` query, a `boardLookupResponseSchema` zod parse
|
|
8
|
+
* (defence-in-depth on item-id + board-id shapes per validation.md
|
|
9
|
+
* "Never bubble raw ZodError out of a parse boundary" + M5b parse-1
|
|
10
|
+
* F3), and a `resolveBoardId(client, itemId, explicit)` helper with
|
|
11
|
+
* `not_found` for both missing-item and null-board paths.
|
|
12
|
+
*
|
|
13
|
+
* Two query shapes:
|
|
14
|
+
* - `ITEM_BOARD_LOOKUP_QUERY` — `items.id, items.board.id` (M5b).
|
|
15
|
+
* Used by `set` / `clear` / `update` / `create`'s
|
|
16
|
+
* `--relative-to` verification.
|
|
17
|
+
* - `ITEM_PARENT_LOOKUP_QUERY` — adds `board.hierarchy_type` (M9).
|
|
18
|
+
* Used by `create`'s `--parent` lookup so the multi-level
|
|
19
|
+
* classic-only gate fires pre-mutation per cli-design §5.8.
|
|
20
|
+
*
|
|
21
|
+
* Error labels are caller-supplied so the disambiguation between
|
|
22
|
+
* "Item N", "Parent item N", and "--relative-to item N" stays in
|
|
23
|
+
* the consumer's voice. Defaults match the M5b set/clear/update
|
|
24
|
+
* messages.
|
|
25
|
+
*/
|
|
26
|
+
import { z } from 'zod';
|
|
27
|
+
import type { MondayClient } from './client.js';
|
|
28
|
+
export declare const ITEM_BOARD_LOOKUP_QUERY = "\n query ItemBoardLookup($ids: [ID!]!) {\n items(ids: $ids) {\n id\n board { id }\n }\n }\n";
|
|
29
|
+
export declare const ITEM_PARENT_LOOKUP_QUERY = "\n query ItemParentLookup($ids: [ID!]!) {\n items(ids: $ids) {\n id\n board {\n id\n hierarchy_type\n }\n }\n }\n";
|
|
30
|
+
export declare const boardLookupResponseSchema: z.ZodObject<{
|
|
31
|
+
items: z.ZodNullable<z.ZodArray<z.ZodObject<{
|
|
32
|
+
id: z.core.$ZodBranded<z.ZodString, "ItemId", "out">;
|
|
33
|
+
board: z.ZodNullable<z.ZodObject<{
|
|
34
|
+
id: z.core.$ZodBranded<z.ZodString, "BoardId", "out">;
|
|
35
|
+
}, z.core.$strip>>;
|
|
36
|
+
}, z.core.$strip>>>;
|
|
37
|
+
}, z.core.$loose>;
|
|
38
|
+
export declare const parentLookupResponseSchema: z.ZodObject<{
|
|
39
|
+
items: z.ZodNullable<z.ZodArray<z.ZodObject<{
|
|
40
|
+
id: z.core.$ZodBranded<z.ZodString, "ItemId", "out">;
|
|
41
|
+
board: z.ZodNullable<z.ZodObject<{
|
|
42
|
+
id: z.core.$ZodBranded<z.ZodString, "BoardId", "out">;
|
|
43
|
+
hierarchy_type: z.ZodNullable<z.ZodString>;
|
|
44
|
+
}, z.core.$strip>>;
|
|
45
|
+
}, z.core.$strip>>>;
|
|
46
|
+
}, z.core.$loose>;
|
|
47
|
+
interface LookupInputs {
|
|
48
|
+
readonly client: MondayClient;
|
|
49
|
+
readonly itemId: string;
|
|
50
|
+
/** Defaults to `Item` — overridden by callers like `Parent item` or `--relative-to item`. */
|
|
51
|
+
readonly label?: string;
|
|
52
|
+
/** Defaults to `item_id` — overridden to `parent_item_id` / `relative_to_id`. */
|
|
53
|
+
readonly detailKey?: string;
|
|
54
|
+
}
|
|
55
|
+
/**
|
|
56
|
+
* Looks up the item's board via `ITEM_BOARD_LOOKUP_QUERY`. Throws
|
|
57
|
+
* `not_found` for both missing-item and null-board paths so callers
|
|
58
|
+
* key off the stable code per cli-design §6.5.
|
|
59
|
+
*/
|
|
60
|
+
export declare const lookupItemBoard: (inputs: LookupInputs) => Promise<{
|
|
61
|
+
readonly itemId: string;
|
|
62
|
+
readonly boardId: string;
|
|
63
|
+
}>;
|
|
64
|
+
/**
|
|
65
|
+
* Variant of `lookupItemBoard` that also returns `hierarchy_type`,
|
|
66
|
+
* driving M9's classic-only subitem gate. SDK 14.0.0 doesn't type
|
|
67
|
+
* `hierarchy_type` on `Board` (cli-design §2.8), so the raw escape
|
|
68
|
+
* hatch is the M9 work-around.
|
|
69
|
+
*/
|
|
70
|
+
export declare const lookupItemBoardWithHierarchy: (inputs: LookupInputs) => Promise<{
|
|
71
|
+
readonly itemId: string;
|
|
72
|
+
readonly boardId: string;
|
|
73
|
+
readonly hierarchyType: string | null;
|
|
74
|
+
}>;
|
|
75
|
+
/**
|
|
76
|
+
* `--board <bid>` is authoritative; without it, Monday is queried.
|
|
77
|
+
* Per cli-design §5.3 step 1 — "Implicit (preferred): `--board <bid>`
|
|
78
|
+
* skips a lookup and is authoritative."
|
|
79
|
+
*/
|
|
80
|
+
export declare const resolveBoardId: (inputs: {
|
|
81
|
+
readonly client: MondayClient;
|
|
82
|
+
readonly itemId: string;
|
|
83
|
+
readonly explicit: string | undefined;
|
|
84
|
+
}) => Promise<string>;
|
|
85
|
+
export {};
|
|
86
|
+
//# sourceMappingURL=item-board-lookup.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"item-board-lookup.d.ts","sourceRoot":"","sources":["../../src/api/item-board-lookup.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;GAwBG;AAEH,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAIx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|
+
* `--board <bid> ?? lookup` resolver every item-mutation surface needs.
|
|
4
|
+
*
|
|
5
|
+
* Lifted from four sites (`set.ts`, `clear.ts`, `update.ts`, `create.ts`)
|
|
6
|
+
* — see v0.2-plan §12 R23. Each had the same triple: a verbatim
|
|
7
|
+
* `ItemBoardLookup` query, a `boardLookupResponseSchema` zod parse
|
|
8
|
+
* (defence-in-depth on item-id + board-id shapes per validation.md
|
|
9
|
+
* "Never bubble raw ZodError out of a parse boundary" + M5b parse-1
|
|
10
|
+
* F3), and a `resolveBoardId(client, itemId, explicit)` helper with
|
|
11
|
+
* `not_found` for both missing-item and null-board paths.
|
|
12
|
+
*
|
|
13
|
+
* Two query shapes:
|
|
14
|
+
* - `ITEM_BOARD_LOOKUP_QUERY` — `items.id, items.board.id` (M5b).
|
|
15
|
+
* Used by `set` / `clear` / `update` / `create`'s
|
|
16
|
+
* `--relative-to` verification.
|
|
17
|
+
* - `ITEM_PARENT_LOOKUP_QUERY` — adds `board.hierarchy_type` (M9).
|
|
18
|
+
* Used by `create`'s `--parent` lookup so the multi-level
|
|
19
|
+
* classic-only gate fires pre-mutation per cli-design §5.8.
|
|
20
|
+
*
|
|
21
|
+
* Error labels are caller-supplied so the disambiguation between
|
|
22
|
+
* "Item N", "Parent item N", and "--relative-to item N" stays in
|
|
23
|
+
* the consumer's voice. Defaults match the M5b set/clear/update
|
|
24
|
+
* messages.
|
|
25
|
+
*/
|
|
26
|
+
import { z } from 'zod';
|
|
27
|
+
import { ApiError } from '../utils/errors.js';
|
|
28
|
+
import { unwrapOrThrow } from '../utils/parse-boundary.js';
|
|
29
|
+
import { BoardIdSchema, ItemIdSchema } from '../types/ids.js';
|
|
30
|
+
export const ITEM_BOARD_LOOKUP_QUERY = `
|
|
31
|
+
query ItemBoardLookup($ids: [ID!]!) {
|
|
32
|
+
items(ids: $ids) {
|
|
33
|
+
id
|
|
34
|
+
board { id }
|
|
35
|
+
}
|
|
36
|
+
}
|
|
37
|
+
`;
|
|
38
|
+
export const ITEM_PARENT_LOOKUP_QUERY = `
|
|
39
|
+
query ItemParentLookup($ids: [ID!]!) {
|
|
40
|
+
items(ids: $ids) {
|
|
41
|
+
id
|
|
42
|
+
board {
|
|
43
|
+
id
|
|
44
|
+
hierarchy_type
|
|
45
|
+
}
|
|
46
|
+
}
|
|
47
|
+
}
|
|
48
|
+
`;
|
|
49
|
+
export const boardLookupResponseSchema = z
|
|
50
|
+
.object({
|
|
51
|
+
items: z
|
|
52
|
+
.array(z.object({
|
|
53
|
+
id: ItemIdSchema,
|
|
54
|
+
board: z.object({ id: BoardIdSchema }).nullable(),
|
|
55
|
+
}))
|
|
56
|
+
.nullable(),
|
|
57
|
+
})
|
|
58
|
+
.loose();
|
|
59
|
+
export const parentLookupResponseSchema = z
|
|
60
|
+
.object({
|
|
61
|
+
items: z
|
|
62
|
+
.array(z.object({
|
|
63
|
+
id: ItemIdSchema,
|
|
64
|
+
board: z
|
|
65
|
+
.object({
|
|
66
|
+
id: BoardIdSchema,
|
|
67
|
+
hierarchy_type: z.string().nullable(),
|
|
68
|
+
})
|
|
69
|
+
.nullable(),
|
|
70
|
+
}))
|
|
71
|
+
.nullable(),
|
|
72
|
+
})
|
|
73
|
+
.loose();
|
|
74
|
+
/**
|
|
75
|
+
* Looks up the item's board via `ITEM_BOARD_LOOKUP_QUERY`. Throws
|
|
76
|
+
* `not_found` for both missing-item and null-board paths so callers
|
|
77
|
+
* key off the stable code per cli-design §6.5.
|
|
78
|
+
*/
|
|
79
|
+
export const lookupItemBoard = async (inputs) => {
|
|
80
|
+
const { client, itemId, label = 'Item', detailKey = 'item_id' } = inputs;
|
|
81
|
+
const response = await client.raw(ITEM_BOARD_LOOKUP_QUERY, { ids: [itemId] }, { operationName: 'ItemBoardLookup' });
|
|
82
|
+
const data = unwrapOrThrow(boardLookupResponseSchema.safeParse(response.data), {
|
|
83
|
+
context: `Monday returned a malformed ItemBoardLookup response for id ${itemId}`,
|
|
84
|
+
details: { [detailKey]: itemId },
|
|
85
|
+
hint: "this is a data-integrity error in Monday's response; verify " +
|
|
86
|
+
'the response shape and update boardLookupResponseSchema if ' +
|
|
87
|
+
"Monday's contract has changed.",
|
|
88
|
+
});
|
|
89
|
+
const first = data.items?.[0];
|
|
90
|
+
if (first === undefined) {
|
|
91
|
+
throw new ApiError('not_found', `${label} ${itemId} does not exist or the token has no read access.`, { details: { [detailKey]: itemId } });
|
|
92
|
+
}
|
|
93
|
+
if (first.board === null) {
|
|
94
|
+
throw new ApiError('not_found', `${label} ${itemId} has no readable board; the token may not have ` +
|
|
95
|
+
`permission on its board, or the board is deleted.`, { details: { [detailKey]: itemId } });
|
|
96
|
+
}
|
|
97
|
+
return { itemId: first.id, boardId: first.board.id };
|
|
98
|
+
};
|
|
99
|
+
/**
|
|
100
|
+
* Variant of `lookupItemBoard` that also returns `hierarchy_type`,
|
|
101
|
+
* driving M9's classic-only subitem gate. SDK 14.0.0 doesn't type
|
|
102
|
+
* `hierarchy_type` on `Board` (cli-design §2.8), so the raw escape
|
|
103
|
+
* hatch is the M9 work-around.
|
|
104
|
+
*/
|
|
105
|
+
export const lookupItemBoardWithHierarchy = async (inputs) => {
|
|
106
|
+
const { client, itemId, label = 'Item', detailKey = 'item_id' } = inputs;
|
|
107
|
+
const response = await client.raw(ITEM_PARENT_LOOKUP_QUERY, { ids: [itemId] }, { operationName: 'ItemParentLookup' });
|
|
108
|
+
const data = unwrapOrThrow(parentLookupResponseSchema.safeParse(response.data), {
|
|
109
|
+
context: `Monday returned a malformed ItemParentLookup response for id ${itemId}`,
|
|
110
|
+
details: { [detailKey]: itemId },
|
|
111
|
+
});
|
|
112
|
+
const first = data.items?.[0];
|
|
113
|
+
if (first === undefined) {
|
|
114
|
+
throw new ApiError('not_found', `${label} ${itemId} does not exist or the token has no read access.`, { details: { [detailKey]: itemId } });
|
|
115
|
+
}
|
|
116
|
+
if (first.board === null) {
|
|
117
|
+
throw new ApiError('not_found', `${label} ${itemId} has no readable board; the token may not have ` +
|
|
118
|
+
`permission on its board, or the board is deleted.`, { details: { [detailKey]: itemId } });
|
|
119
|
+
}
|
|
120
|
+
return {
|
|
121
|
+
itemId: first.id,
|
|
122
|
+
boardId: first.board.id,
|
|
123
|
+
hierarchyType: first.board.hierarchy_type,
|
|
124
|
+
};
|
|
125
|
+
};
|
|
126
|
+
/**
|
|
127
|
+
* `--board <bid>` is authoritative; without it, Monday is queried.
|
|
128
|
+
* Per cli-design §5.3 step 1 — "Implicit (preferred): `--board <bid>`
|
|
129
|
+
* skips a lookup and is authoritative."
|
|
130
|
+
*/
|
|
131
|
+
export const resolveBoardId = async (inputs) => {
|
|
132
|
+
if (inputs.explicit !== undefined)
|
|
133
|
+
return inputs.explicit;
|
|
134
|
+
const result = await lookupItemBoard({
|
|
135
|
+
client: inputs.client,
|
|
136
|
+
itemId: inputs.itemId,
|
|
137
|
+
});
|
|
138
|
+
return result.boardId;
|
|
139
|
+
};
|
|
140
|
+
//# sourceMappingURL=item-board-lookup.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"item-board-lookup.js","sourceRoot":"","sources":["../../src/api/item-board-lookup.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;GAwBG;AAEH,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AACxB,OAAO,EAAE,QAAQ,EAAE,MAAM,oBAAoB,CAAC;AAC9C,OAAO,EAAE,aAAa,EAAE,MAAM,4BAA4B,CAAC;AAC3D,OAAO,EAAE,aAAa,EAAE,YAAY,EAAE,MAAM,iBAAiB,CAAC;AAG9D,MAAM,CAAC,MAAM,uBAAuB,GAAG;;;;;;;CAOtC,CAAC;AAEF,MAAM,CAAC,MAAM,wBAAwB,GAAG;;;;;;;;;;CAUvC,CAAC;AAEF,MAAM,CAAC,MAAM,yBAAyB,GAAG,CAAC;KACvC,MAAM,CAAC;IACN,KAAK,EAAE,CAAC;SACL,KAAK,CACJ,CAAC,CAAC,MAAM,CAAC;QACP,EAAE,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