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,182 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Pure people-resolution helpers for the `people` column-value
|
|
3
|
+
* translator (`cli-design.md` §5.3 step 3, the people grammar
|
|
4
|
+
* line 728-734 + the `me` token rule line 704-707).
|
|
5
|
+
*
|
|
6
|
+
* Surface:
|
|
7
|
+
*
|
|
8
|
+
* - `parsePeopleInput` — accepts the comma-split email list +
|
|
9
|
+
* `me` token sugar `cli-design.md` §5.3 step 3 enumerates and
|
|
10
|
+
* returns the Monday wire payload (`{personsAndTeams: [...]}`).
|
|
11
|
+
* Async because email→ID resolution can hit the network; the
|
|
12
|
+
* caller injects a `PeopleResolutionContext` carrying
|
|
13
|
+
* `resolveMe` + `resolveEmail` callbacks so this module stays
|
|
14
|
+
* pure (no `client` imports — same inversion `filters.ts` uses
|
|
15
|
+
* for its `me` plumbing).
|
|
16
|
+
*
|
|
17
|
+
* **Why a separate module.** column-values.ts owns translator
|
|
18
|
+
* *dispatch* — the switch over WritableColumnType, the
|
|
19
|
+
* mutation-selection helper, and the ApiError builder. The people
|
|
20
|
+
* translator's machinery is a small async function with regex
|
|
21
|
+
* shape-checks + token classification + safe-integer conversion;
|
|
22
|
+
* splitting keeps column-values.ts at one screen of dispatch logic
|
|
23
|
+
* and the people-specific concerns isolated for unit testing —
|
|
24
|
+
* same template `dates.ts` followed in the previous M5a session.
|
|
25
|
+
*
|
|
26
|
+
* **Why the `me` callback shape mirrors filters.ts.** `filters.ts`
|
|
27
|
+
* already takes `resolveMe: () => Promise<string>` for its `me`
|
|
28
|
+
* sugar on people-style columns. M5b's command layer plumbs the
|
|
29
|
+
* same callback through both surfaces — agents learning one `me`
|
|
30
|
+
* rule for read filters don't need to learn a different one for
|
|
31
|
+
* `--set`. A second callback (`resolveEmail`) handles the email
|
|
32
|
+
* branch; M5b will wire it to `resolvers.userByEmail` (which owns
|
|
33
|
+
* the directory cache + `users(emails:)` fallback).
|
|
34
|
+
*
|
|
35
|
+
* **No `kind: 'team'` support in v0.1.** cli-design.md §5.3 step 3
|
|
36
|
+
* line 730 prescribes `{id, kind: 'person'}` only. Monday's API
|
|
37
|
+
* accepts `kind: 'team'` for team assignments but the design
|
|
38
|
+
* defers teams to a v0.2 candidate. Logged as a spec gap in
|
|
39
|
+
* v0.1-plan.md §3 M5a.
|
|
40
|
+
*
|
|
41
|
+
* **Numeric tokens rejected.** cli-design.md §5.3 step 3 only
|
|
42
|
+
* lists emails + `me`. Numeric tokens (`--set Owner=12345`) are
|
|
43
|
+
* rejected with a `usage_error`. Agents with a raw user ID either
|
|
44
|
+
* look up the email and use the email form, or use the M8
|
|
45
|
+
* `--set-raw <col>=<json>` escape hatch with the literal Monday
|
|
46
|
+
* wire shape. cli-design doesn't say either way; logged as a spec
|
|
47
|
+
* gap.
|
|
48
|
+
*
|
|
49
|
+
* **Shared seams.** `isMeToken` lives in `src/api/me-token.ts`
|
|
50
|
+
* (R15) — same helper backs `--where Owner=me` (filters.ts) and
|
|
51
|
+
* `item search --where Owner=me` (commands/item/search.ts).
|
|
52
|
+
* `DECIMAL_USER_ID_PATTERN` lives in `src/types/ids.ts` (R16) —
|
|
53
|
+
* same regex backs the resolver-side `userDirectoryEntrySchema`
|
|
54
|
+
* brand in resolvers.ts. Both lifts replaced verbatim copies that
|
|
55
|
+
* had drifted independently across the people-session Codex
|
|
56
|
+
* passes; consolidating the source of truth prevents the next
|
|
57
|
+
* drift outright.
|
|
58
|
+
*/
|
|
59
|
+
/**
|
|
60
|
+
* Wire payload shape for a `people` column. Matches Monday's
|
|
61
|
+
* `change_column_value(value: JSON!)` JSON scalar:
|
|
62
|
+
* `{personsAndTeams: [{id: <number>, kind: 'person'}, ...]}`
|
|
63
|
+
*
|
|
64
|
+
* cli-design.md §5.3 step 3 line 730 pins the shape exactly:
|
|
65
|
+
* - `id` is an integer (number, not string — Monday's user IDs
|
|
66
|
+
* are auto-incremented integers and the JSON scalar serialises
|
|
67
|
+
* a number as a number).
|
|
68
|
+
* - `kind` is the literal string `'person'` (singular `person`
|
|
69
|
+
* is deprecated; `personsAndTeams` is the plural canonical
|
|
70
|
+
* wire-shape key — Monday's per-column blob spelling).
|
|
71
|
+
*
|
|
72
|
+
* Frozen to one-of-two shapes by the literal type on `kind` so
|
|
73
|
+
* any future "send `team`" branch fails type-checking until the
|
|
74
|
+
* union is widened intentionally.
|
|
75
|
+
*/
|
|
76
|
+
export interface PeoplePayload {
|
|
77
|
+
readonly personsAndTeams: readonly PeoplePayloadEntry[];
|
|
78
|
+
}
|
|
79
|
+
export interface PeoplePayloadEntry {
|
|
80
|
+
readonly id: number;
|
|
81
|
+
readonly kind: 'person';
|
|
82
|
+
}
|
|
83
|
+
export interface PeopleResolutionContext {
|
|
84
|
+
/**
|
|
85
|
+
* Resolves the `me` token to the current user's ID. Async because
|
|
86
|
+
* the production path issues a `me { id }` query; tests stub it
|
|
87
|
+
* synchronously. Mirrors `filters.ts`'s `resolveMe` slot one-to-one
|
|
88
|
+
* so the same M5b wiring resolves `me` for both `--where owner=me`
|
|
89
|
+
* (filter) and `--set Owner=me` (write).
|
|
90
|
+
*
|
|
91
|
+
* Called at most once per `parsePeopleInput` call regardless of
|
|
92
|
+
* how many `me` tokens appear in the input — same caching shape
|
|
93
|
+
* `filters.ts` uses.
|
|
94
|
+
*/
|
|
95
|
+
readonly resolveMe: () => Promise<string>;
|
|
96
|
+
/**
|
|
97
|
+
* Resolves an email to a Monday user ID. Throws
|
|
98
|
+
* `ApiError(user_not_found)` for unknown emails — the translator
|
|
99
|
+
* surfaces this verbatim per cli-design.md §5.3 step 3 line 733.
|
|
100
|
+
* M5b wires this to `resolvers.userByEmail` (which owns the
|
|
101
|
+
* directory cache + `users(emails:)` fallback).
|
|
102
|
+
*
|
|
103
|
+
* Email matching is the callback's responsibility — `userByEmail`
|
|
104
|
+
* already does NFC + case-fold per its own contract. The
|
|
105
|
+
* translator forwards the verbatim email so the unmatched-email
|
|
106
|
+
* detail in any thrown `user_not_found` echoes what the agent
|
|
107
|
+
* typed.
|
|
108
|
+
*/
|
|
109
|
+
readonly resolveEmail: (email: string) => Promise<string>;
|
|
110
|
+
}
|
|
111
|
+
/**
|
|
112
|
+
* Token-by-token resolution echo the dry-run engine renders as
|
|
113
|
+
* `details.resolved_from` per cli-design §6.4 (the people-column
|
|
114
|
+
* analogue of `DateResolution` from `dates.ts`). Each entry pairs
|
|
115
|
+
* the verbatim input token (post-trim) with its resolved Monday
|
|
116
|
+
* user ID — agents reading dry-run output see exactly which
|
|
117
|
+
* email/`me` resolved to which ID without having to re-derive the
|
|
118
|
+
* mapping from the `personsAndTeams` array.
|
|
119
|
+
*
|
|
120
|
+
* cli-design.md doesn't pin the shape (the §6.4 sample only shows
|
|
121
|
+
* the date case); logged as a v0.1-plan §3 M5a spec gap.
|
|
122
|
+
*/
|
|
123
|
+
export interface PeopleResolution {
|
|
124
|
+
readonly tokens: readonly PeopleResolutionToken[];
|
|
125
|
+
}
|
|
126
|
+
export interface PeopleResolutionToken {
|
|
127
|
+
/** The verbatim input token (post-trim, pre-resolution). */
|
|
128
|
+
readonly input: string;
|
|
129
|
+
/**
|
|
130
|
+
* The resolved Monday user ID (string form, decimal non-negative).
|
|
131
|
+
* Matches the directory schema's shape — string here so the echo
|
|
132
|
+
* round-trips through `JSON.stringify` without losing precision
|
|
133
|
+
* for IDs in the high range.
|
|
134
|
+
*/
|
|
135
|
+
readonly resolved_id: string;
|
|
136
|
+
}
|
|
137
|
+
export interface ParsedPeopleInput {
|
|
138
|
+
readonly payload: PeoplePayload;
|
|
139
|
+
/**
|
|
140
|
+
* Per-token resolution echo for the dry-run engine. Always
|
|
141
|
+
* populated (one entry per non-empty input token); empty input
|
|
142
|
+
* throws `usage_error` before reaching this slot. cli-design
|
|
143
|
+
* §5.3 step 3 lists the input grammar; the echo shape itself is
|
|
144
|
+
* a v0.1-plan §3 M5a spec gap for cli-design backfill.
|
|
145
|
+
*/
|
|
146
|
+
readonly resolution: PeopleResolution;
|
|
147
|
+
}
|
|
148
|
+
/**
|
|
149
|
+
* Parses a `people` column input per cli-design.md §5.3 step 3.
|
|
150
|
+
*
|
|
151
|
+
* Accepted inputs:
|
|
152
|
+
* - **Single email** `alice@example.com` → one-element
|
|
153
|
+
* `personsAndTeams` payload.
|
|
154
|
+
* - **Multiple emails** `alice@example.com,bob@example.com` →
|
|
155
|
+
* comma-split, per-segment trimmed, empty segments dropped;
|
|
156
|
+
* each email resolved through `ctx.resolveEmail`.
|
|
157
|
+
* - **`me` token** (case-insensitive) `me` / `ME` / `Me` →
|
|
158
|
+
* resolved through `ctx.resolveMe` to the connected user's ID.
|
|
159
|
+
* - **Mixed** `me,alice@example.com` → both resolve, ordered.
|
|
160
|
+
*
|
|
161
|
+
* Throws `usage_error` (UsageError):
|
|
162
|
+
* - empty input after trim+filter (no labels, no IDs);
|
|
163
|
+
* - numeric token (`--set Owner=12345`) — friendly form only
|
|
164
|
+
* accepts emails / `me`. Agents with a raw user ID look up
|
|
165
|
+
* the email, or use the M8 `--set-raw` escape hatch with
|
|
166
|
+
* the literal Monday wire shape.
|
|
167
|
+
* - resolved user ID exceeds `Number.MAX_SAFE_INTEGER` (2^53 - 1)
|
|
168
|
+
* — defensive guard against a future Monday user-ID range
|
|
169
|
+
* expansion. Same shape as the status / dropdown safe-integer
|
|
170
|
+
* guards.
|
|
171
|
+
*
|
|
172
|
+
* Throws `ApiError(user_not_found)` (bubbled from
|
|
173
|
+
* `ctx.resolveEmail`) for unknown emails per cli-design.md §5.3
|
|
174
|
+
* step 3 line 733.
|
|
175
|
+
*
|
|
176
|
+
* @param raw - The raw user-supplied value (post-`--set` parsing).
|
|
177
|
+
* @param columnId - Column ID for error messages.
|
|
178
|
+
* @param ctx - Resolution context; the caller wires `resolveMe`
|
|
179
|
+
* to a whoami query and `resolveEmail` to `userByEmail`.
|
|
180
|
+
*/
|
|
181
|
+
export declare const parsePeopleInput: (raw: string, columnId: string, ctx: PeopleResolutionContext) => Promise<ParsedPeopleInput>;
|
|
182
|
+
//# sourceMappingURL=people.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"people.d.ts","sourceRoot":"","sources":["../../src/api/people.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAyDG;AAMH;;;;;;;;;;;;;;;;GAgBG;AACH,MAAM,WAAW,aAAa;IAC5B,QAAQ,CAAC,eAAe,EAAE,SAAS,kBAAkB,EAAE,CAAC;CACzD;AAED,MAAM,WAAW,kBAAkB;IACjC,QAAQ,CAAC,EAAE,EAAE,MAAM,CAAC;IACpB,QAAQ,CAAC,IAAI,EAAE,QAAQ,CAAC;CACzB;AAED,MAAM,WAAW,uBAAuB;IACtC;;;;;;;;;;OAUG;IACH,QAAQ,CAAC,SAAS,EAAE,MAAM,OAAO,CAAC,MAAM,CAAC,CAAC;IAC1C;;;;;;;;;;;;OAYG;IACH,QAAQ,CAAC,YAAY,EAAE,CAAC,KAAK,EAAE,MAAM,KAAK,OAAO,CAAC,MAAM,CAAC,CAAC;CAC3D;AAED;;;;;;;;;;;GAWG;AACH,MAAM,WAAW,gBAAgB;IAC/B,QAAQ,CAAC,MAAM,EAAE,SAAS,qBAAqB,EAAE,CAAC;CACnD;AAED,MAAM,WAAW,qBAAqB;IACpC,4DAA4D;IAC5D,QAAQ,CAAC,KAAK,EAAE,MAAM,CAAC;IACvB;;;;;OAKG;IACH,QAAQ,CAAC,WAAW,EAAE,MAAM,CAAC;CAC9B;AAED,MAAM,WAAW,iBAAiB;IAChC,QAAQ,CAAC,OAAO,EAAE,aAAa,CAAC;IAChC;;;;;;OAMG;IACH,QAAQ,CAAC,UAAU,EAAE,gBAAgB,CAAC;CACvC;AAED;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAgCG;AACH,eAAO,MAAM,gBAAgB,GAC3B,KAAK,MAAM,EACX,UAAU,MAAM,EAChB,KAAK,uBAAuB,KAC3B,OAAO,CAAC,iBAAiB,CAuC3B,CAAC"}
|
|
@@ -0,0 +1,260 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Pure people-resolution helpers for the `people` column-value
|
|
3
|
+
* translator (`cli-design.md` §5.3 step 3, the people grammar
|
|
4
|
+
* line 728-734 + the `me` token rule line 704-707).
|
|
5
|
+
*
|
|
6
|
+
* Surface:
|
|
7
|
+
*
|
|
8
|
+
* - `parsePeopleInput` — accepts the comma-split email list +
|
|
9
|
+
* `me` token sugar `cli-design.md` §5.3 step 3 enumerates and
|
|
10
|
+
* returns the Monday wire payload (`{personsAndTeams: [...]}`).
|
|
11
|
+
* Async because email→ID resolution can hit the network; the
|
|
12
|
+
* caller injects a `PeopleResolutionContext` carrying
|
|
13
|
+
* `resolveMe` + `resolveEmail` callbacks so this module stays
|
|
14
|
+
* pure (no `client` imports — same inversion `filters.ts` uses
|
|
15
|
+
* for its `me` plumbing).
|
|
16
|
+
*
|
|
17
|
+
* **Why a separate module.** column-values.ts owns translator
|
|
18
|
+
* *dispatch* — the switch over WritableColumnType, the
|
|
19
|
+
* mutation-selection helper, and the ApiError builder. The people
|
|
20
|
+
* translator's machinery is a small async function with regex
|
|
21
|
+
* shape-checks + token classification + safe-integer conversion;
|
|
22
|
+
* splitting keeps column-values.ts at one screen of dispatch logic
|
|
23
|
+
* and the people-specific concerns isolated for unit testing —
|
|
24
|
+
* same template `dates.ts` followed in the previous M5a session.
|
|
25
|
+
*
|
|
26
|
+
* **Why the `me` callback shape mirrors filters.ts.** `filters.ts`
|
|
27
|
+
* already takes `resolveMe: () => Promise<string>` for its `me`
|
|
28
|
+
* sugar on people-style columns. M5b's command layer plumbs the
|
|
29
|
+
* same callback through both surfaces — agents learning one `me`
|
|
30
|
+
* rule for read filters don't need to learn a different one for
|
|
31
|
+
* `--set`. A second callback (`resolveEmail`) handles the email
|
|
32
|
+
* branch; M5b will wire it to `resolvers.userByEmail` (which owns
|
|
33
|
+
* the directory cache + `users(emails:)` fallback).
|
|
34
|
+
*
|
|
35
|
+
* **No `kind: 'team'` support in v0.1.** cli-design.md §5.3 step 3
|
|
36
|
+
* line 730 prescribes `{id, kind: 'person'}` only. Monday's API
|
|
37
|
+
* accepts `kind: 'team'` for team assignments but the design
|
|
38
|
+
* defers teams to a v0.2 candidate. Logged as a spec gap in
|
|
39
|
+
* v0.1-plan.md §3 M5a.
|
|
40
|
+
*
|
|
41
|
+
* **Numeric tokens rejected.** cli-design.md §5.3 step 3 only
|
|
42
|
+
* lists emails + `me`. Numeric tokens (`--set Owner=12345`) are
|
|
43
|
+
* rejected with a `usage_error`. Agents with a raw user ID either
|
|
44
|
+
* look up the email and use the email form, or use the M8
|
|
45
|
+
* `--set-raw <col>=<json>` escape hatch with the literal Monday
|
|
46
|
+
* wire shape. cli-design doesn't say either way; logged as a spec
|
|
47
|
+
* gap.
|
|
48
|
+
*
|
|
49
|
+
* **Shared seams.** `isMeToken` lives in `src/api/me-token.ts`
|
|
50
|
+
* (R15) — same helper backs `--where Owner=me` (filters.ts) and
|
|
51
|
+
* `item search --where Owner=me` (commands/item/search.ts).
|
|
52
|
+
* `DECIMAL_USER_ID_PATTERN` lives in `src/types/ids.ts` (R16) —
|
|
53
|
+
* same regex backs the resolver-side `userDirectoryEntrySchema`
|
|
54
|
+
* brand in resolvers.ts. Both lifts replaced verbatim copies that
|
|
55
|
+
* had drifted independently across the people-session Codex
|
|
56
|
+
* passes; consolidating the source of truth prevents the next
|
|
57
|
+
* drift outright.
|
|
58
|
+
*/
|
|
59
|
+
import { ApiError, UsageError } from '../utils/errors.js';
|
|
60
|
+
import { DECIMAL_USER_ID_PATTERN } from '../types/ids.js';
|
|
61
|
+
import { isMeToken } from './me-token.js';
|
|
62
|
+
/**
|
|
63
|
+
* Parses a `people` column input per cli-design.md §5.3 step 3.
|
|
64
|
+
*
|
|
65
|
+
* Accepted inputs:
|
|
66
|
+
* - **Single email** `alice@example.com` → one-element
|
|
67
|
+
* `personsAndTeams` payload.
|
|
68
|
+
* - **Multiple emails** `alice@example.com,bob@example.com` →
|
|
69
|
+
* comma-split, per-segment trimmed, empty segments dropped;
|
|
70
|
+
* each email resolved through `ctx.resolveEmail`.
|
|
71
|
+
* - **`me` token** (case-insensitive) `me` / `ME` / `Me` →
|
|
72
|
+
* resolved through `ctx.resolveMe` to the connected user's ID.
|
|
73
|
+
* - **Mixed** `me,alice@example.com` → both resolve, ordered.
|
|
74
|
+
*
|
|
75
|
+
* Throws `usage_error` (UsageError):
|
|
76
|
+
* - empty input after trim+filter (no labels, no IDs);
|
|
77
|
+
* - numeric token (`--set Owner=12345`) — friendly form only
|
|
78
|
+
* accepts emails / `me`. Agents with a raw user ID look up
|
|
79
|
+
* the email, or use the M8 `--set-raw` escape hatch with
|
|
80
|
+
* the literal Monday wire shape.
|
|
81
|
+
* - resolved user ID exceeds `Number.MAX_SAFE_INTEGER` (2^53 - 1)
|
|
82
|
+
* — defensive guard against a future Monday user-ID range
|
|
83
|
+
* expansion. Same shape as the status / dropdown safe-integer
|
|
84
|
+
* guards.
|
|
85
|
+
*
|
|
86
|
+
* Throws `ApiError(user_not_found)` (bubbled from
|
|
87
|
+
* `ctx.resolveEmail`) for unknown emails per cli-design.md §5.3
|
|
88
|
+
* step 3 line 733.
|
|
89
|
+
*
|
|
90
|
+
* @param raw - The raw user-supplied value (post-`--set` parsing).
|
|
91
|
+
* @param columnId - Column ID for error messages.
|
|
92
|
+
* @param ctx - Resolution context; the caller wires `resolveMe`
|
|
93
|
+
* to a whoami query and `resolveEmail` to `userByEmail`.
|
|
94
|
+
*/
|
|
95
|
+
export const parsePeopleInput = async (raw, columnId, ctx) => {
|
|
96
|
+
const tokens = raw
|
|
97
|
+
.split(',')
|
|
98
|
+
.map((segment) => segment.trim())
|
|
99
|
+
.filter((segment) => segment.length > 0);
|
|
100
|
+
if (tokens.length === 0) {
|
|
101
|
+
throw emptyPeopleInputError(columnId, raw);
|
|
102
|
+
}
|
|
103
|
+
// Cache `me` resolution within the call — same shape filters.ts
|
|
104
|
+
// uses. An input like `me,me,me` resolves once.
|
|
105
|
+
let cachedMe;
|
|
106
|
+
const resolveMeOnce = async () => {
|
|
107
|
+
cachedMe ??= await ctx.resolveMe();
|
|
108
|
+
return cachedMe;
|
|
109
|
+
};
|
|
110
|
+
const entries = [];
|
|
111
|
+
const resolutionTokens = [];
|
|
112
|
+
for (const token of tokens) {
|
|
113
|
+
if (NON_NEGATIVE_INTEGER.test(token)) {
|
|
114
|
+
// Numeric tokens aren't in cli-design's people grammar. Reject
|
|
115
|
+
// with a hint pointing at the email form first and the M8
|
|
116
|
+
// `--set-raw` escape as the path for raw IDs. Logged as a spec
|
|
117
|
+
// gap in v0.1-plan.md §3 M5a.
|
|
118
|
+
throw numericPeopleTokenError(columnId, token, raw);
|
|
119
|
+
}
|
|
120
|
+
const id = isMeToken(token)
|
|
121
|
+
? await resolveMeOnce()
|
|
122
|
+
: await ctx.resolveEmail(token);
|
|
123
|
+
entries.push({ id: idStringToNumber(id, columnId, token), kind: 'person' });
|
|
124
|
+
resolutionTokens.push({ input: token, resolved_id: id });
|
|
125
|
+
}
|
|
126
|
+
return {
|
|
127
|
+
payload: { personsAndTeams: entries },
|
|
128
|
+
resolution: { tokens: resolutionTokens },
|
|
129
|
+
};
|
|
130
|
+
};
|
|
131
|
+
/**
|
|
132
|
+
* Non-negative integer: matches `0`, `42`, `1234567` but not `-1`,
|
|
133
|
+
* `0.5`, `1e3`. Used to gate numeric-token rejection on people
|
|
134
|
+
* input. Same regex `column-values.ts` uses for status indexes /
|
|
135
|
+
* dropdown IDs — pin via local copy because importing from
|
|
136
|
+
* `column-values.ts` would create a circular import (column-values
|
|
137
|
+
* imports parsePeopleInput).
|
|
138
|
+
*/
|
|
139
|
+
const NON_NEGATIVE_INTEGER = /^\d+$/u;
|
|
140
|
+
/**
|
|
141
|
+
* Converts a string user ID (Monday's directory shape) to a
|
|
142
|
+
* number for the `personsAndTeams[].id` wire field. Two layers
|
|
143
|
+
* of validation, both required:
|
|
144
|
+
*
|
|
145
|
+
* 1. **Decimal-shape regex** (`DECIMAL_USER_ID_PATTERN` from
|
|
146
|
+
* `src/types/ids.ts`, R16-shared). `Number()`
|
|
147
|
+
* alone accepts hex (`"0x2a"` → 42), scientific notation
|
|
148
|
+
* (`"1e3"` → 1000), empty strings (`""` → 0), and signed
|
|
149
|
+
* forms (`"-1"` → -1) — none of which are valid Monday user
|
|
150
|
+
* IDs but all of which would silently land at Monday as the
|
|
151
|
+
* wrong number. Codex review pass-1 finding: caller's
|
|
152
|
+
* `userByEmail` validates only `z.string().min(1)`, so the
|
|
153
|
+
* translator must defend its own boundary. Throws
|
|
154
|
+
* `internal_error` (data corruption from the resolver, not
|
|
155
|
+
* user-input fault).
|
|
156
|
+
* 2. **Safe-integer guard.** Defensive against a future Monday
|
|
157
|
+
* user-ID range expansion that would silently round through
|
|
158
|
+
* `Number()` and corrupt the wire payload. Throws
|
|
159
|
+
* `usage_error` (consistent with the status / dropdown
|
|
160
|
+
* safe-integer guards — agent-actionable).
|
|
161
|
+
*
|
|
162
|
+
* `token` is included in error details so the agent's debug log
|
|
163
|
+
* shows which email/me-token resolved to the unsafe ID.
|
|
164
|
+
*/
|
|
165
|
+
const idStringToNumber = (id, columnId, token) => {
|
|
166
|
+
if (!DECIMAL_USER_ID_PATTERN.test(id)) {
|
|
167
|
+
// Resolver returned something that isn't a decimal non-negative
|
|
168
|
+
// integer string. This is a data-integrity problem with the
|
|
169
|
+
// directory, not a user-input fault — surface as internal_error
|
|
170
|
+
// with enough context for an agent to file a bug, but don't
|
|
171
|
+
// pretend the user can fix it by editing their --set value.
|
|
172
|
+
throw new ApiError('internal_error', `People column "${columnId}" resolved token "${token}" to a ` +
|
|
173
|
+
`non-decimal user ID ${JSON.stringify(id)}. Monday's user IDs ` +
|
|
174
|
+
`are decimal non-negative integers; the resolver returned an ` +
|
|
175
|
+
`unexpected shape.`, {
|
|
176
|
+
details: {
|
|
177
|
+
column_id: columnId,
|
|
178
|
+
column_type: 'people',
|
|
179
|
+
token,
|
|
180
|
+
resolved_id: id,
|
|
181
|
+
hint: 'this is a data-integrity error in the user directory or ' +
|
|
182
|
+
'the resolver wiring; verify the directory cache and the ' +
|
|
183
|
+
'shape of the response from `users(emails:)`.',
|
|
184
|
+
},
|
|
185
|
+
});
|
|
186
|
+
}
|
|
187
|
+
const parsed = Number(id);
|
|
188
|
+
if (!Number.isSafeInteger(parsed)) {
|
|
189
|
+
throw new UsageError(`People column "${columnId}" got a resolved user ID "${id}" ` +
|
|
190
|
+
`(from token "${token}") that exceeds JavaScript's safe-integer ` +
|
|
191
|
+
`range (2^53 - 1, i.e. 9007199254740991). Number(id) would lose ` +
|
|
192
|
+
`precision, corrupting the personsAndTeams wire payload. Use ` +
|
|
193
|
+
`--set-raw <col>=<json> with the literal Monday wire shape ` +
|
|
194
|
+
`instead.`, {
|
|
195
|
+
details: {
|
|
196
|
+
column_id: columnId,
|
|
197
|
+
column_type: 'people',
|
|
198
|
+
token,
|
|
199
|
+
resolved_id: id,
|
|
200
|
+
hint: 'this user ID exceeds JS safe-integer range; the friendly ' +
|
|
201
|
+
"translator can't round-trip it. Use --set-raw <col>=<json> " +
|
|
202
|
+
'with the literal Monday wire shape (e.g. --set-raw ' +
|
|
203
|
+
`${columnId}='{"personsAndTeams":[{"id":${id},"kind":"person"}]}').`,
|
|
204
|
+
},
|
|
205
|
+
});
|
|
206
|
+
}
|
|
207
|
+
return parsed;
|
|
208
|
+
};
|
|
209
|
+
/**
|
|
210
|
+
* Builds the `usage_error` for empty input — no emails, no `me`,
|
|
211
|
+
* nothing left after trim+filter (`--set Owner=""` or
|
|
212
|
+
* `--set Owner=" , "` etc.). Mirrors the dropdown empty-input
|
|
213
|
+
* branch's shape so an agent that handles one details payload
|
|
214
|
+
* handles them all. Pointing at `monday item clear` keeps `--set`
|
|
215
|
+
* and the dedicated clear verb non-overlapping per cli-design.md
|
|
216
|
+
* §5.3 (clear is the verb that empties a column; `--set` is the
|
|
217
|
+
* verb that writes a new value).
|
|
218
|
+
*/
|
|
219
|
+
const emptyPeopleInputError = (columnId, raw) => new UsageError(`People column "${columnId}" needs at least one email or the \`me\` ` +
|
|
220
|
+
`token. Got "${raw}". To clear a people column, use ` +
|
|
221
|
+
`\`monday item clear <iid> ${columnId} [--board <bid>]\` instead.`, {
|
|
222
|
+
details: {
|
|
223
|
+
column_id: columnId,
|
|
224
|
+
column_type: 'people',
|
|
225
|
+
raw_input: raw,
|
|
226
|
+
hint: 'pass a comma-separated list of emails (e.g. --set ' +
|
|
227
|
+
`${columnId}=alice@example.com,bob@example.com), or ` +
|
|
228
|
+
`--set ${columnId}=me. The --set-raw escape hatch accepts ` +
|
|
229
|
+
'the literal Monday wire shape if email resolution is not ' +
|
|
230
|
+
'an option.',
|
|
231
|
+
},
|
|
232
|
+
});
|
|
233
|
+
/**
|
|
234
|
+
* Builds the `usage_error` for a numeric token that the translator
|
|
235
|
+
* doesn't accept. cli-design.md §5.3 step 3 only lists emails and
|
|
236
|
+
* `me` for the people grammar — numeric tokens are an explicit
|
|
237
|
+
* grammar gap. Agents with a raw user ID either look up the
|
|
238
|
+
* email, or use the `--set-raw <col>=<json>` escape hatch (M8)
|
|
239
|
+
* with the literal Monday wire shape.
|
|
240
|
+
*
|
|
241
|
+
* `raw` is included alongside `token` because the failing token
|
|
242
|
+
* may be one of many in a comma list (`alice@example.com,12345`)
|
|
243
|
+
* and the agent's debug log benefits from seeing both.
|
|
244
|
+
*/
|
|
245
|
+
const numericPeopleTokenError = (columnId, token, raw) => new UsageError(`People column "${columnId}" got numeric token "${token}", which ` +
|
|
246
|
+
`is not in the people grammar (cli-design.md §5.3 step 3 only ` +
|
|
247
|
+
`lists emails and \`me\`). Look up the user's email and use the ` +
|
|
248
|
+
`email form, or use --set-raw <col>=<json> with the literal ` +
|
|
249
|
+
`Monday wire shape.`, {
|
|
250
|
+
details: {
|
|
251
|
+
column_id: columnId,
|
|
252
|
+
column_type: 'people',
|
|
253
|
+
token,
|
|
254
|
+
raw_input: raw,
|
|
255
|
+
hint: `pass the user's email instead (e.g. --set ${columnId}=` +
|
|
256
|
+
`alice@example.com), or use --set-raw ${columnId}=` +
|
|
257
|
+
`'{"personsAndTeams":[{"id":${token},"kind":"person"}]}'.`,
|
|
258
|
+
},
|
|
259
|
+
});
|
|
260
|
+
//# sourceMappingURL=people.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"people.js","sourceRoot":"","sources":["../../src/api/people.ts"],"names":[],"mappings":"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"}
|
|
@@ -0,0 +1,74 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Pure phone-resolution helpers for the `phone` column-value translator
|
|
3
|
+
* (`cli-design.md` §5.3 step 3 v0.2 expansion, `v0.2-plan.md` §3 M8).
|
|
4
|
+
*
|
|
5
|
+
* Surface:
|
|
6
|
+
* - `parsePhoneInput` — accepts the **mandatory** pipe-form
|
|
7
|
+
* `<phone>|<country>` cli-design §5.3 enumerates. E.164-loose
|
|
8
|
+
* phone validation; ISO 3166-1 alpha-2 country code validated
|
|
9
|
+
* against a frozen allowlist (`iso-country-codes.ts`).
|
|
10
|
+
*
|
|
11
|
+
* **Why pipe form is mandatory.** Monday's phone-column validation
|
|
12
|
+
* requires both the number AND the 2-letter country code AND verifies
|
|
13
|
+
* they match (per Monday's phone-validation changelog). The friendly
|
|
14
|
+
* translator can't safely default `countryShortName: ""` — Monday
|
|
15
|
+
* would reject the mutation as `validation_failed`. Agents who need
|
|
16
|
+
* to write a phone with no country (Monday allows it for some legacy
|
|
17
|
+
* fixtures) use `--set-raw`.
|
|
18
|
+
*
|
|
19
|
+
* **E.164-loose validation.** The phone segment matches `+?\d{6,15}`
|
|
20
|
+
* — leading `+` optional, 6-15 digits otherwise. E.164's strict rule
|
|
21
|
+
* is "1-15 digits" but the CLI insists on at least 6 to catch
|
|
22
|
+
* obvious typos (`--set Mobile=+1|US` would silently land at Monday
|
|
23
|
+
* and fail server-side). The bound is a sanity check, not a
|
|
24
|
+
* complete E.164 validator — Monday is the validator of last resort.
|
|
25
|
+
*
|
|
26
|
+
* **No internal whitespace, no dashes.** `+1 555 123 4567` and
|
|
27
|
+
* `+1-555-123-4567` are rejected. cli-design doesn't pin this
|
|
28
|
+
* explicitly but Monday's API expects bare digits + an optional
|
|
29
|
+
* leading `+`. Agents who paste a formatted phone strip the
|
|
30
|
+
* separators in the shell pipeline (`tr -d ' -'`).
|
|
31
|
+
*
|
|
32
|
+
* **Why a separate module.** Same template `links.ts` / `dates.ts`
|
|
33
|
+
* follow — column-values.ts owns translator dispatch; the per-type
|
|
34
|
+
* grammar machinery lives one module deeper. The ISO allowlist is
|
|
35
|
+
* larger again (`iso-country-codes.ts`) so the layering keeps
|
|
36
|
+
* column-values.ts at one screen of dispatch logic.
|
|
37
|
+
*/
|
|
38
|
+
/**
|
|
39
|
+
* Wire payload shape for a `phone` column. Matches Monday's
|
|
40
|
+
* `change_column_value(value: JSON!)` JSON scalar:
|
|
41
|
+
* `{phone: <phone>, countryShortName: <country>}`
|
|
42
|
+
*
|
|
43
|
+
* cli-design.md §5.3 step 3 v0.2 expansion line 815-827 pins the
|
|
44
|
+
* shape. `countryShortName` is the uppercase 2-letter ISO 3166-1
|
|
45
|
+
* alpha-2 code; the field name spelling is Monday's choice
|
|
46
|
+
* (camelCase, no trailing `code`).
|
|
47
|
+
*/
|
|
48
|
+
export interface PhonePayload {
|
|
49
|
+
readonly phone: string;
|
|
50
|
+
readonly countryShortName: string;
|
|
51
|
+
}
|
|
52
|
+
/**
|
|
53
|
+
* Parses a `phone` column input per cli-design.md §5.3 step 3 v0.2
|
|
54
|
+
* expansion.
|
|
55
|
+
*
|
|
56
|
+
* Accepted input — pipe form is **mandatory**:
|
|
57
|
+
* - `<phone>|<country>` → `{phone, countryShortName}`. Both
|
|
58
|
+
* segments trimmed; pipe-split max 1. Country code uppercased
|
|
59
|
+
* before allowlist check (so `us` and `US` both work).
|
|
60
|
+
*
|
|
61
|
+
* Rejected (all `usage_error`):
|
|
62
|
+
* - **Single segment** (`+15551234567` without `|US`) — Monday
|
|
63
|
+
* requires both. Agents who need an empty country use
|
|
64
|
+
* `--set-raw`. cli-design §5.3 line 819-827.
|
|
65
|
+
* - **Phone fails E.164-loose** (`+?\d{6,15}` after trim).
|
|
66
|
+
* - **Country fails ISO allowlist** (after uppercase).
|
|
67
|
+
* - **Empty leader / trailer** (`|US` or `+1555|`).
|
|
68
|
+
* - **Empty input** after trim.
|
|
69
|
+
*
|
|
70
|
+
* @param raw - The raw user-supplied value (post-`--set` parsing).
|
|
71
|
+
* @param columnId - Column ID for error messages.
|
|
72
|
+
*/
|
|
73
|
+
export declare const parsePhoneInput: (raw: string, columnId: string) => PhonePayload;
|
|
74
|
+
//# sourceMappingURL=phones.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"phones.d.ts","sourceRoot":"","sources":["../../src/api/phones.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAoCG;AAKH;;;;;;;;;GASG;AACH,MAAM,WAAW,YAAY;IAC3B,QAAQ,CAAC,KAAK,EAAE,MAAM,CAAC;IACvB,QAAQ,CAAC,gBAAgB,EAAE,MAAM,CAAC;CACnC;AAID;;;;;;;;;;;;;;;;;;;;GAoBG;AACH,eAAO,MAAM,eAAe,GAC1B,KAAK,MAAM,EACX,UAAU,MAAM,KACf,YAuHF,CAAC"}
|