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,230 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Resolver-error-folding helpers (`v0.1-plan.md` §17 R19).
|
|
3
|
+
*
|
|
4
|
+
* Two-helper module that consolidates the resolver-warning preservation
|
|
5
|
+
* pattern + the cache-sourced `validation_failed` → `column_archived`
|
|
6
|
+
* remap pattern. Lifted in M5b session 2 (2026-04-30) before
|
|
7
|
+
* `item clear` / `item update` could copy them.
|
|
8
|
+
*
|
|
9
|
+
* **Why a shared module.** Both helpers were born inside
|
|
10
|
+
* `commands/item/set.ts` (M5b session 1, Codex pass-1 findings F2/F4),
|
|
11
|
+
* and the dry-run engine carried an inline shape of the resolver-
|
|
12
|
+
* warning fold for its own `column_archived` throw path. M5b's
|
|
13
|
+
* `item clear` / `item update` would each need the same two helpers
|
|
14
|
+
* verbatim — copying the ~80 LOC three more times would set the next
|
|
15
|
+
* Codex pass up to flag drift between copies. R7 / R8 timing rule:
|
|
16
|
+
* extract on the THIRD example, not the second; M5b session 2 lands
|
|
17
|
+
* the third (item update) and the fourth (item clear) in the same
|
|
18
|
+
* session, so the helper's shape absorbs both new examples in this
|
|
19
|
+
* commit.
|
|
20
|
+
*
|
|
21
|
+
* **Scope.** Two exports, both pure functions:
|
|
22
|
+
* - `foldResolverWarningsIntoError` — folds resolver warnings into a
|
|
23
|
+
* thrown `MondayCliError`'s `details.resolver_warnings` slot. Used
|
|
24
|
+
* by every typed post-resolution failure across the M5b mutation
|
|
25
|
+
* surfaces (translator `UsageError`s, `ApiError(unsupported_column_
|
|
26
|
+
* type)` / `user_not_found`, mutation-time `validation_failed`,
|
|
27
|
+
* `column_archived` from the dry-run engine).
|
|
28
|
+
* - `maybeRemapValidationFailedToArchived` — async helper that
|
|
29
|
+
* inspects a thrown `validation_failed` after a cache-sourced
|
|
30
|
+
* resolution and, if a forced metadata refresh confirms the
|
|
31
|
+
* column is archived, remaps the error to `column_archived` so
|
|
32
|
+
* agents key off the stable code.
|
|
33
|
+
*
|
|
34
|
+
* **Why not inside `api/columns.ts`.** Already 533 lines and owns the
|
|
35
|
+
* read-side resolver. The fold helpers are write-side concerns
|
|
36
|
+
* (consumed by command actions + the dry-run engine, not by the
|
|
37
|
+
* resolver itself) and `columns.ts` shouldn't import from
|
|
38
|
+
* `board-metadata.ts`'s refresh path beyond what the resolver needs.
|
|
39
|
+
* A separate module also gives the helpers their own unit-test surface
|
|
40
|
+
* without dragging the resolver's full test fixture.
|
|
41
|
+
*/
|
|
42
|
+
import { ApiError, MondayCliError, UsageError } from '../utils/errors.js';
|
|
43
|
+
import { refreshBoardMetadata } from './board-metadata.js';
|
|
44
|
+
/**
|
|
45
|
+
* Folds resolver warnings (`column_token_collision` /
|
|
46
|
+
* `stale_cache_refreshed`) into a thrown error's
|
|
47
|
+
* `details.resolver_warnings` slot. Returns a NEW error of the same
|
|
48
|
+
* code with merged details; the original is discarded.
|
|
49
|
+
*
|
|
50
|
+
* **No-op fast path.** When `resolverWarnings` is empty, the original
|
|
51
|
+
* error passes through unchanged — no allocation, same identity.
|
|
52
|
+
*
|
|
53
|
+
* **Class preservation.** The fold reconstructs the error via the
|
|
54
|
+
* concrete typed-error constructor matching `err.code` so the new
|
|
55
|
+
* error stays the same class:
|
|
56
|
+
* - `usage_error` → `UsageError`
|
|
57
|
+
* - `config_error` / `cache_error` → `MondayCliError` base class
|
|
58
|
+
* (no specific class for these in v0.1, though the contract
|
|
59
|
+
* covers them so a future `ConfigError` / `CacheError` lift
|
|
60
|
+
* would just need one more branch).
|
|
61
|
+
* - everything else (the Monday-API surface) → `ApiError`.
|
|
62
|
+
*
|
|
63
|
+
* Pre-fix, `commands/item/set.ts` only handled `ApiError` — a
|
|
64
|
+
* `UsageError` translator failure (date / dropdown / people invalid
|
|
65
|
+
* input) would bypass the fold and lose the resolver context (Codex
|
|
66
|
+
* pass-1 finding F2). Lifted shape covers every `MondayCliError`
|
|
67
|
+
* subclass.
|
|
68
|
+
*/
|
|
69
|
+
export const foldResolverWarningsIntoError = (err, resolverWarnings) => {
|
|
70
|
+
if (resolverWarnings.length === 0)
|
|
71
|
+
return err;
|
|
72
|
+
const detailWarnings = resolverWarnings.map((w) => ({
|
|
73
|
+
code: w.code,
|
|
74
|
+
message: w.message,
|
|
75
|
+
details: w.details,
|
|
76
|
+
}));
|
|
77
|
+
const merged = mergeDetails(err, detailWarnings);
|
|
78
|
+
if (err.code === 'usage_error') {
|
|
79
|
+
return new UsageError(err.message, merged);
|
|
80
|
+
}
|
|
81
|
+
if (err.code === 'config_error' || err.code === 'cache_error') {
|
|
82
|
+
return new MondayCliError(err.code, err.message, merged);
|
|
83
|
+
}
|
|
84
|
+
return new ApiError(err.code, err.message, merged);
|
|
85
|
+
};
|
|
86
|
+
const mergeDetails = (err, detailWarnings) => ({
|
|
87
|
+
cause: err.cause,
|
|
88
|
+
...(err.httpStatus === undefined ? {} : { httpStatus: err.httpStatus }),
|
|
89
|
+
...(err.mondayCode === undefined ? {} : { mondayCode: err.mondayCode }),
|
|
90
|
+
...(err.requestId === undefined ? {} : { requestId: err.requestId }),
|
|
91
|
+
retryable: err.retryable,
|
|
92
|
+
...(err.retryAfterSeconds === undefined
|
|
93
|
+
? {}
|
|
94
|
+
: { retryAfterSeconds: err.retryAfterSeconds }),
|
|
95
|
+
details: {
|
|
96
|
+
...(err.details ?? {}),
|
|
97
|
+
resolver_warnings: detailWarnings,
|
|
98
|
+
},
|
|
99
|
+
});
|
|
100
|
+
/**
|
|
101
|
+
* Inspects a thrown `validation_failed` after a cache-sourced
|
|
102
|
+
* resolution and remaps it to `column_archived` if a forced-fresh
|
|
103
|
+
* metadata refresh confirms ANY of the translated columns is
|
|
104
|
+
* archived.
|
|
105
|
+
*
|
|
106
|
+
* Codex pass-1 finding F4: the archived-column guarantee was
|
|
107
|
+
* cache-stale in one direction — when cached metadata said active
|
|
108
|
+
* but Monday had since archived the column, the live mutation fired
|
|
109
|
+
* and surfaced as `validation_failed`, not the stable
|
|
110
|
+
* `column_archived` code agents key off (cli-design §6.5). This
|
|
111
|
+
* helper closes that gap.
|
|
112
|
+
*
|
|
113
|
+
* **Multi-column probe** (Codex M5b finding #3). Callers pass every
|
|
114
|
+
* translated real column ID; the helper scans them in input order
|
|
115
|
+
* and remaps to the first archived one. Single-column callers pass
|
|
116
|
+
* a one-element array. Multi-column updates pass every column they
|
|
117
|
+
* tried to write so a later-archived column is still caught.
|
|
118
|
+
*
|
|
119
|
+
* **Resolver warnings preserved.** When the caller has already
|
|
120
|
+
* folded resolver warnings (via `foldResolverWarningsIntoError`)
|
|
121
|
+
* into the original error's `details.resolver_warnings`, the
|
|
122
|
+
* remapped error inherits the slot via `details: { ...existing,
|
|
123
|
+
* ... }` so a stale-cache-then-archived flow doesn't drop the
|
|
124
|
+
* refresh signal.
|
|
125
|
+
*
|
|
126
|
+
* **Identity preservation.** Returns the original error unchanged
|
|
127
|
+
* when the code isn't `validation_failed`, when the resolution was
|
|
128
|
+
* live-sourced, when `columnIds` is empty, or when the post-refresh
|
|
129
|
+
* scan finds no archived target. The cache write that
|
|
130
|
+
* `refreshBoardMetadata` performs is a useful side-effect — agents
|
|
131
|
+
* retrying after the failure see the corrected metadata.
|
|
132
|
+
*/
|
|
133
|
+
export const maybeRemapValidationFailedToArchived = async (err, inputs) => {
|
|
134
|
+
if (err.code !== 'validation_failed')
|
|
135
|
+
return err;
|
|
136
|
+
if (inputs.resolutionSource === 'live')
|
|
137
|
+
return err;
|
|
138
|
+
if (inputs.columnIds.length === 0)
|
|
139
|
+
return err;
|
|
140
|
+
let refreshed;
|
|
141
|
+
try {
|
|
142
|
+
refreshed = await refreshBoardMetadata({
|
|
143
|
+
client: inputs.client,
|
|
144
|
+
boardId: inputs.boardId,
|
|
145
|
+
env: inputs.env,
|
|
146
|
+
noCache: inputs.noCache,
|
|
147
|
+
});
|
|
148
|
+
}
|
|
149
|
+
catch {
|
|
150
|
+
// Refresh failed — propagate the original validation_failed
|
|
151
|
+
// unchanged rather than masking with an unrelated refresh
|
|
152
|
+
// error. The agent's retry loop will hit the same path.
|
|
153
|
+
return err;
|
|
154
|
+
}
|
|
155
|
+
// Walk `columnIds` in input order; first archived match wins.
|
|
156
|
+
// Pre-fix this only checked `inputs.columnIds[0]` (then named
|
|
157
|
+
// `columnId`), missing later-archived columns in multi-column
|
|
158
|
+
// updates — Codex M5b finding #3.
|
|
159
|
+
let archived;
|
|
160
|
+
for (const columnId of inputs.columnIds) {
|
|
161
|
+
const live = refreshed.metadata.columns.find((c) => c.id === columnId);
|
|
162
|
+
if (live?.archived === true) {
|
|
163
|
+
archived = { id: columnId, title: live.title, type: live.type };
|
|
164
|
+
break;
|
|
165
|
+
}
|
|
166
|
+
}
|
|
167
|
+
if (archived === undefined)
|
|
168
|
+
return err;
|
|
169
|
+
// Confirmed archived. Build a column_archived error preserving
|
|
170
|
+
// the original error's resolver_warnings slot.
|
|
171
|
+
const existing = err.details ?? {};
|
|
172
|
+
return new ApiError('column_archived', `Column ${JSON.stringify(archived.id)} on board ` +
|
|
173
|
+
`${inputs.boardId} is archived (Monday rejected the mutation as ` +
|
|
174
|
+
`validation_failed; a forced metadata refresh confirmed the ` +
|
|
175
|
+
`archived state). Un-archive the column in Monday or pick a ` +
|
|
176
|
+
`different target.`, {
|
|
177
|
+
cause: err,
|
|
178
|
+
details: {
|
|
179
|
+
...existing,
|
|
180
|
+
column_id: archived.id,
|
|
181
|
+
column_title: archived.title,
|
|
182
|
+
column_type: archived.type,
|
|
183
|
+
board_id: inputs.boardId,
|
|
184
|
+
remapped_from: 'validation_failed',
|
|
185
|
+
hint: 'cache-sourced resolution missed the archived flag; the CLI ' +
|
|
186
|
+
'forced a live refresh after the mutation failed and confirmed ' +
|
|
187
|
+
'the column is now archived. Resolver warnings (if any) carry ' +
|
|
188
|
+
'the pre-refresh state.',
|
|
189
|
+
},
|
|
190
|
+
});
|
|
191
|
+
};
|
|
192
|
+
/**
|
|
193
|
+
* The post-mutation catch-arm pattern lifted from five sites
|
|
194
|
+
* (`set.ts`, `clear.ts`, `update.ts` single + bulk, `create.ts`)
|
|
195
|
+
* — see v0.2-plan §12 R26.
|
|
196
|
+
*
|
|
197
|
+
* Each site did the same two steps in order:
|
|
198
|
+
* 1. Fold resolver warnings into the thrown error so a
|
|
199
|
+
* stale-cache-then-failure flow keeps the refresh signal.
|
|
200
|
+
* 2. Probe the F4 cache-sourced-archived remap so a
|
|
201
|
+
* `validation_failed` after stale-cache resolution surfaces
|
|
202
|
+
* as `column_archived` (the stable code agents key off per
|
|
203
|
+
* cli-design §6.5).
|
|
204
|
+
*
|
|
205
|
+
* Bulk's per-item-progress decoration stays a bulk-specific
|
|
206
|
+
* concern: callers do `foldAndRemap` first, then attach the
|
|
207
|
+
* `applied_count` / `applied_to` / `failed_at_item` /
|
|
208
|
+
* `matched_count` slot before re-throwing.
|
|
209
|
+
*
|
|
210
|
+
* The Codex M9 P1 finding (cache-stale archived columns surfacing
|
|
211
|
+
* as `validation_failed` from `item create`) was caused by the
|
|
212
|
+
* create path skipping this exact catch arm. Lifting reduces the
|
|
213
|
+
* surface where a future command can forget to wire it — M10's
|
|
214
|
+
* three new mutation commands inherit `foldAndRemap` rather than
|
|
215
|
+
* copy the pattern a 6th-7th-8th time.
|
|
216
|
+
*/
|
|
217
|
+
export const foldAndRemap = async (inputs) => {
|
|
218
|
+
const folded = foldResolverWarningsIntoError(inputs.err, inputs.warnings);
|
|
219
|
+
if (inputs.columnIds.length === 0)
|
|
220
|
+
return folded;
|
|
221
|
+
return maybeRemapValidationFailedToArchived(folded, {
|
|
222
|
+
client: inputs.client,
|
|
223
|
+
boardId: inputs.boardId,
|
|
224
|
+
columnIds: inputs.columnIds,
|
|
225
|
+
env: inputs.env,
|
|
226
|
+
noCache: inputs.noCache,
|
|
227
|
+
resolutionSource: inputs.resolutionSource,
|
|
228
|
+
});
|
|
229
|
+
};
|
|
230
|
+
//# sourceMappingURL=resolver-error-fold.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"resolver-error-fold.js","sourceRoot":"","sources":["../../src/api/resolver-error-fold.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAwCG;AAEH,OAAO,EAAE,QAAQ,EAAE,cAAc,EAAE,UAAU,EAAE,MAAM,oBAAoB,CAAC;AAE1E,OAAO,EAAE,oBAAoB,EAAE,MAAM,qBAAqB,CAAC;AAS3D;;;;;;;;;;;;;;;;;;;;;;;;GAwBG;AACH,MAAM,CAAC,MAAM,6BAA6B,GAAG,CAC3C,GAAmB,EACnB,gBAA4C,EAC5B,EAAE;IAClB,IAAI,gBAAgB,CAAC,MAAM,KAAK,CAAC;QAAE,OAAO,GAAG,CAAC;IAC9C,MAAM,cAAc,GAAqC,gBAAgB,CAAC,GAAG,CAC3E,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC;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M,EAAE;QAClD,MAAM,EAAE,MAAM,CAAC,MAAM;QACrB,OAAO,EAAE,MAAM,CAAC,OAAO;QACvB,SAAS,EAAE,MAAM,CAAC,SAAS;QAC3B,GAAG,EAAE,MAAM,CAAC,GAAG;QACf,OAAO,EAAE,MAAM,CAAC,OAAO;QACvB,gBAAgB,EAAE,MAAM,CAAC,gBAAgB;KAC1C,CAAC,CAAC;AACL,CAAC,CAAC"}
|
|
@@ -0,0 +1,131 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Name-resolution helpers (`v0.1-plan.md` §3 M3, `cli-design.md` §5.7).
|
|
3
|
+
*
|
|
4
|
+
* Two surfaces:
|
|
5
|
+
*
|
|
6
|
+
* - `findOne(scope, name)` — single-source-of-truth for the
|
|
7
|
+
* `find` verb. Returns the unique match; raises
|
|
8
|
+
* `ambiguous_name` with `details.candidates` on a multi-match;
|
|
9
|
+
* `not_found` on zero. `--first` opts into "lowest ID wins"
|
|
10
|
+
* (rarely the right call for agents; humans use it). M3 wires
|
|
11
|
+
* `monday board find`; M4 wires `monday item find`. The matching
|
|
12
|
+
* logic is intentionally NFC-aware + case-fold to match §5.3's
|
|
13
|
+
* column rules — agents learning one rule shouldn't have to
|
|
14
|
+
* learn a different one for names.
|
|
15
|
+
*
|
|
16
|
+
* - `userByEmail(client, email)` — directory lookup with a
|
|
17
|
+
* `users(emails: [...])` fallback. M3 doesn't actually call
|
|
18
|
+
* this from a command (read-only `user list/get/me` operate by
|
|
19
|
+
* ID or whoami), but the function is needed by M5a's
|
|
20
|
+
* `--set Owner=alice@example.com` value translator. Lives here
|
|
21
|
+
* because email→ID resolution is the same lookup users make from
|
|
22
|
+
* two different feature surfaces. The user-directory cache
|
|
23
|
+
* (`api/cache.ts users` key) ships alongside.
|
|
24
|
+
*
|
|
25
|
+
* **NFC + case-fold for names.** Same rule as §5.3 step 2: NFC
|
|
26
|
+
* normalise, trim, collapse internal whitespace, case-fold (Unicode-
|
|
27
|
+
* aware, locale-independent). Keeps "Status" / "Status " /
|
|
28
|
+
* "STATUS" / "Café" / "Café" all matching the same target.
|
|
29
|
+
*/
|
|
30
|
+
import { z } from 'zod';
|
|
31
|
+
import type { MondayClient } from './client.js';
|
|
32
|
+
import { type UserId } from '../types/ids.js';
|
|
33
|
+
export interface FindOneCandidate<T> {
|
|
34
|
+
readonly id: string;
|
|
35
|
+
readonly name: string;
|
|
36
|
+
readonly resource: T;
|
|
37
|
+
}
|
|
38
|
+
export interface FindOneOptions {
|
|
39
|
+
/**
|
|
40
|
+
* On multiple matches, return the candidate with the lexicographically
|
|
41
|
+
* lowest ID (numeric IDs string-compare correctly because both sides
|
|
42
|
+
* are decimal strings of the same length when from the same kind).
|
|
43
|
+
* Default false — multi-match raises `ambiguous_name` with
|
|
44
|
+
* `details.candidates`.
|
|
45
|
+
*/
|
|
46
|
+
readonly first?: boolean;
|
|
47
|
+
/**
|
|
48
|
+
* Display name for the resource kind in error messages
|
|
49
|
+
* (`"board"`, `"item"`, …). Default `"resource"`.
|
|
50
|
+
*/
|
|
51
|
+
readonly kind?: string;
|
|
52
|
+
}
|
|
53
|
+
export interface FindOneResult<T> {
|
|
54
|
+
readonly resource: T;
|
|
55
|
+
/**
|
|
56
|
+
* `true` when `--first` selected one of multiple matches.
|
|
57
|
+
* Commands surface this as a `warnings: [{ code: 'first_of_many' }]`
|
|
58
|
+
* entry so the caller knows the resolution was non-unique.
|
|
59
|
+
*/
|
|
60
|
+
readonly firstOfMany: boolean;
|
|
61
|
+
/**
|
|
62
|
+
* The full candidate set. Useful for the warning payload and for
|
|
63
|
+
* future debug output; not normally rendered.
|
|
64
|
+
*/
|
|
65
|
+
readonly candidates: readonly FindOneCandidate<T>[];
|
|
66
|
+
}
|
|
67
|
+
/**
|
|
68
|
+
* Picks the single resource whose name matches `query`. Pure
|
|
69
|
+
* function — caller passes in the haystack (e.g. all visible
|
|
70
|
+
* boards) and the projector that extracts `{id, name}` from each.
|
|
71
|
+
*
|
|
72
|
+
* Three matching passes, exactly mirroring §5.3 step 2:
|
|
73
|
+
* 1. NFC-normalised exact name.
|
|
74
|
+
* 2. NFC + case-fold name.
|
|
75
|
+
* Step 1 wins over step 2; multiple matches in either pass raise
|
|
76
|
+
* `ambiguous_name` (unless `--first` is set).
|
|
77
|
+
*/
|
|
78
|
+
export declare const findOne: <T>(haystack: readonly T[], query: string, project: (t: T) => {
|
|
79
|
+
readonly id: string;
|
|
80
|
+
readonly name: string;
|
|
81
|
+
}, options?: FindOneOptions) => FindOneResult<T>;
|
|
82
|
+
/**
|
|
83
|
+
* User-directory entry shape. The `id` field is constrained to a
|
|
84
|
+
* decimal non-negative integer string (`0`, `42`, `1234567`) — not
|
|
85
|
+
* just any non-empty string — because callers (M5a's people
|
|
86
|
+
* translator, future commands) eventually convert it to a JS number
|
|
87
|
+
* for wire payloads. Loose `z.string().min(1)` would let `"0x2a"` /
|
|
88
|
+
* `"1e3"` / `"42 "` into the directory cache where they'd silently
|
|
89
|
+
* corrupt every later consumer's `Number(id)` conversion.
|
|
90
|
+
*
|
|
91
|
+
* The validating regex (`DECIMAL_USER_ID_PATTERN`, `src/types/
|
|
92
|
+
* ids.ts`) is also imported by `api/people.ts`'s `idStringToNumber`
|
|
93
|
+
* for a defence-in-depth check at the translator boundary — same
|
|
94
|
+
* rule, two layers (R16 consolidated the two prior verbatim copies
|
|
95
|
+
* onto a single source of truth).
|
|
96
|
+
*/
|
|
97
|
+
declare const userDirectoryEntrySchema: z.ZodObject<{
|
|
98
|
+
id: z.ZodString;
|
|
99
|
+
name: z.ZodString;
|
|
100
|
+
email: z.ZodString;
|
|
101
|
+
}, z.core.$strict>;
|
|
102
|
+
export type UserDirectoryEntry = z.infer<typeof userDirectoryEntrySchema>;
|
|
103
|
+
export interface UserByEmailInputs {
|
|
104
|
+
readonly client: MondayClient;
|
|
105
|
+
readonly email: string;
|
|
106
|
+
readonly env?: NodeJS.ProcessEnv;
|
|
107
|
+
readonly noCache?: boolean;
|
|
108
|
+
}
|
|
109
|
+
export interface UserByEmailResult {
|
|
110
|
+
readonly user: UserDirectoryEntry;
|
|
111
|
+
readonly source: 'cache' | 'live';
|
|
112
|
+
readonly cacheAgeSeconds: number | null;
|
|
113
|
+
}
|
|
114
|
+
/**
|
|
115
|
+
* Looks up a user by email. Prefers the local user-directory cache;
|
|
116
|
+
* on miss, calls `users(emails: [...])` and folds the result back
|
|
117
|
+
* into the cache. Unknown email → `user_not_found` with the
|
|
118
|
+
* unmatched email in `details`.
|
|
119
|
+
*
|
|
120
|
+
* Email matching is NFC + case-fold so `Alice@Example.COM` and
|
|
121
|
+
* `alice@example.com` resolve identically.
|
|
122
|
+
*/
|
|
123
|
+
export declare const userByEmail: (inputs: UserByEmailInputs) => Promise<UserByEmailResult>;
|
|
124
|
+
/**
|
|
125
|
+
* Cast a `string` to a `UserId`. Used by callers that hold a
|
|
126
|
+
* directory-projected ID and need the branded form for downstream
|
|
127
|
+
* APIs. Validates via the same regex as the schema brand.
|
|
128
|
+
*/
|
|
129
|
+
export declare const userIdFromString: (id: string) => UserId;
|
|
130
|
+
export {};
|
|
131
|
+
//# sourceMappingURL=resolvers.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"resolvers.d.ts","sourceRoot":"","sources":["../../src/api/resolvers.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA4BG;AAEH,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAQxB,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,aAAa,CAAC;AAChD,OAAO,EAA2B,KAAK,MAAM,EAAE,MAAM,iBAAiB,CAAC;AASvE,MAAM,WAAW,gBAAgB,CAAC,CAAC;IACjC,QAAQ,CAAC,EAAE,EAAE,MAAM,CAAC;IACpB,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC;IACtB,QAAQ,CAAC,QAAQ,EAAE,CAAC,CAAC;CACtB;AAED,MAAM,WAAW,cAAc;IAC7B;;;;;;OAMG;I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;;;;;;;;GAQG;AACH,eAAO,MAAM,WAAW,GACtB,QAAQ,iBAAiB,KACxB,OAAO,CAAC,iBAAiB,CAwE3B,CAAC;AAEF;;;;GAIG;AACH,eAAO,MAAM,gBAAgB,GAAI,IAAI,MAAM,KAAG,MAQ7C,CAAC"}
|
|
@@ -0,0 +1,262 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Name-resolution helpers (`v0.1-plan.md` §3 M3, `cli-design.md` §5.7).
|
|
3
|
+
*
|
|
4
|
+
* Two surfaces:
|
|
5
|
+
*
|
|
6
|
+
* - `findOne(scope, name)` — single-source-of-truth for the
|
|
7
|
+
* `find` verb. Returns the unique match; raises
|
|
8
|
+
* `ambiguous_name` with `details.candidates` on a multi-match;
|
|
9
|
+
* `not_found` on zero. `--first` opts into "lowest ID wins"
|
|
10
|
+
* (rarely the right call for agents; humans use it). M3 wires
|
|
11
|
+
* `monday board find`; M4 wires `monday item find`. The matching
|
|
12
|
+
* logic is intentionally NFC-aware + case-fold to match §5.3's
|
|
13
|
+
* column rules — agents learning one rule shouldn't have to
|
|
14
|
+
* learn a different one for names.
|
|
15
|
+
*
|
|
16
|
+
* - `userByEmail(client, email)` — directory lookup with a
|
|
17
|
+
* `users(emails: [...])` fallback. M3 doesn't actually call
|
|
18
|
+
* this from a command (read-only `user list/get/me` operate by
|
|
19
|
+
* ID or whoami), but the function is needed by M5a's
|
|
20
|
+
* `--set Owner=alice@example.com` value translator. Lives here
|
|
21
|
+
* because email→ID resolution is the same lookup users make from
|
|
22
|
+
* two different feature surfaces. The user-directory cache
|
|
23
|
+
* (`api/cache.ts users` key) ships alongside.
|
|
24
|
+
*
|
|
25
|
+
* **NFC + case-fold for names.** Same rule as §5.3 step 2: NFC
|
|
26
|
+
* normalise, trim, collapse internal whitespace, case-fold (Unicode-
|
|
27
|
+
* aware, locale-independent). Keeps "Status" / "Status " /
|
|
28
|
+
* "STATUS" / "Café" / "Café" all matching the same target.
|
|
29
|
+
*/
|
|
30
|
+
import { z } from 'zod';
|
|
31
|
+
import { ApiError, UsageError } from '../utils/errors.js';
|
|
32
|
+
import { readEntry, resolveCacheRoot, writeEntry, DEFAULT_CACHE_TTL_SECONDS, } from './cache.js';
|
|
33
|
+
import { DECIMAL_USER_ID_PATTERN } from '../types/ids.js';
|
|
34
|
+
const normalise = (s) => s.normalize('NFC').trim().replace(/\s+/gu, ' ');
|
|
35
|
+
const caseFold = (s) => s.toLocaleLowerCase('und');
|
|
36
|
+
const normaliseFold = (s) => caseFold(normalise(s));
|
|
37
|
+
/**
|
|
38
|
+
* Picks the single resource whose name matches `query`. Pure
|
|
39
|
+
* function — caller passes in the haystack (e.g. all visible
|
|
40
|
+
* boards) and the projector that extracts `{id, name}` from each.
|
|
41
|
+
*
|
|
42
|
+
* Three matching passes, exactly mirroring §5.3 step 2:
|
|
43
|
+
* 1. NFC-normalised exact name.
|
|
44
|
+
* 2. NFC + case-fold name.
|
|
45
|
+
* Step 1 wins over step 2; multiple matches in either pass raise
|
|
46
|
+
* `ambiguous_name` (unless `--first` is set).
|
|
47
|
+
*/
|
|
48
|
+
export const findOne = (haystack, query, project, options = {}) => {
|
|
49
|
+
const kind = options.kind ?? 'resource';
|
|
50
|
+
const target = normalise(query);
|
|
51
|
+
if (target.length === 0) {
|
|
52
|
+
throw new UsageError(`find ${kind}: query must be a non-empty name`);
|
|
53
|
+
}
|
|
54
|
+
const projected = haystack.map((t) => {
|
|
55
|
+
const p = project(t);
|
|
56
|
+
return { id: p.id, name: p.name, resource: t };
|
|
57
|
+
});
|
|
58
|
+
const exact = projected.filter((c) => normalise(c.name) === target);
|
|
59
|
+
if (exact.length === 1) {
|
|
60
|
+
const [only] = exact;
|
|
61
|
+
if (only !== undefined) {
|
|
62
|
+
return { resource: only.resource, firstOfMany: false, candidates: exact };
|
|
63
|
+
}
|
|
64
|
+
}
|
|
65
|
+
if (exact.length > 1) {
|
|
66
|
+
return resolveMulti(exact, query, kind, options.first ?? false);
|
|
67
|
+
}
|
|
68
|
+
const folded = caseFold(target);
|
|
69
|
+
const fuzzy = projected.filter((c) => caseFold(normalise(c.name)) === folded);
|
|
70
|
+
if (fuzzy.length === 1) {
|
|
71
|
+
const [only] = fuzzy;
|
|
72
|
+
if (only !== undefined) {
|
|
73
|
+
return { resource: only.resource, firstOfMany: false, candidates: fuzzy };
|
|
74
|
+
}
|
|
75
|
+
}
|
|
76
|
+
if (fuzzy.length > 1) {
|
|
77
|
+
return resolveMulti(fuzzy, query, kind, options.first ?? false);
|
|
78
|
+
}
|
|
79
|
+
throw new ApiError('not_found', `No ${kind} matches name ${JSON.stringify(query)}`, { details: { query, kind } });
|
|
80
|
+
};
|
|
81
|
+
const resolveMulti = (matches, query, kind, first) => {
|
|
82
|
+
if (first) {
|
|
83
|
+
// Lowest ID wins — string-compares fine for same-kind numeric
|
|
84
|
+
// IDs because both sides are decimal strings of equal length.
|
|
85
|
+
// Fall back to localeCompare on length-mismatched IDs so we
|
|
86
|
+
// pick a deterministic winner even when the assumption breaks.
|
|
87
|
+
const sorted = [...matches].sort((a, b) => a.id.length === b.id.length
|
|
88
|
+
? a.id.localeCompare(b.id)
|
|
89
|
+
: a.id.length - b.id.length);
|
|
90
|
+
const [winner] = sorted;
|
|
91
|
+
/* c8 ignore next 8 — defensive: caller passes non-empty `matches`,
|
|
92
|
+
so `sorted[0]` is always defined. Guard exists for
|
|
93
|
+
`noUncheckedIndexedAccess` narrowing. */
|
|
94
|
+
if (winner === undefined) {
|
|
95
|
+
throw new ApiError('not_found', `No ${kind} matches name ${JSON.stringify(query)}`, { details: { query, kind } });
|
|
96
|
+
}
|
|
97
|
+
return {
|
|
98
|
+
resource: winner.resource,
|
|
99
|
+
firstOfMany: true,
|
|
100
|
+
candidates: matches,
|
|
101
|
+
};
|
|
102
|
+
}
|
|
103
|
+
throw new ApiError('ambiguous_name', `Name ${JSON.stringify(query)} matches ${String(matches.length)} ${kind}s; ` +
|
|
104
|
+
`pass --first to pick the lowest-ID match or call \`${kind} get <id>\`.`, {
|
|
105
|
+
details: {
|
|
106
|
+
query,
|
|
107
|
+
kind,
|
|
108
|
+
candidates: matches.map((c) => ({ id: c.id, name: c.name })),
|
|
109
|
+
},
|
|
110
|
+
});
|
|
111
|
+
};
|
|
112
|
+
// ---------------------------------------------------------------------
|
|
113
|
+
// userByEmail — directory cache + users(emails:) fallback
|
|
114
|
+
// ---------------------------------------------------------------------
|
|
115
|
+
/**
|
|
116
|
+
* User-directory entry shape. The `id` field is constrained to a
|
|
117
|
+
* decimal non-negative integer string (`0`, `42`, `1234567`) — not
|
|
118
|
+
* just any non-empty string — because callers (M5a's people
|
|
119
|
+
* translator, future commands) eventually convert it to a JS number
|
|
120
|
+
* for wire payloads. Loose `z.string().min(1)` would let `"0x2a"` /
|
|
121
|
+
* `"1e3"` / `"42 "` into the directory cache where they'd silently
|
|
122
|
+
* corrupt every later consumer's `Number(id)` conversion.
|
|
123
|
+
*
|
|
124
|
+
* The validating regex (`DECIMAL_USER_ID_PATTERN`, `src/types/
|
|
125
|
+
* ids.ts`) is also imported by `api/people.ts`'s `idStringToNumber`
|
|
126
|
+
* for a defence-in-depth check at the translator boundary — same
|
|
127
|
+
* rule, two layers (R16 consolidated the two prior verbatim copies
|
|
128
|
+
* onto a single source of truth).
|
|
129
|
+
*/
|
|
130
|
+
const userDirectoryEntrySchema = z
|
|
131
|
+
.object({
|
|
132
|
+
id: z.string().regex(DECIMAL_USER_ID_PATTERN, {
|
|
133
|
+
message: 'user id must be a decimal non-negative integer string',
|
|
134
|
+
}),
|
|
135
|
+
name: z.string(),
|
|
136
|
+
email: z.string(),
|
|
137
|
+
})
|
|
138
|
+
.strict();
|
|
139
|
+
const userDirectorySchema = z.array(userDirectoryEntrySchema);
|
|
140
|
+
const USERS_BY_EMAIL_QUERY = `
|
|
141
|
+
query UsersByEmail($emails: [String!]) {
|
|
142
|
+
users(emails: $emails, limit: 100) {
|
|
143
|
+
id
|
|
144
|
+
name
|
|
145
|
+
email
|
|
146
|
+
}
|
|
147
|
+
}
|
|
148
|
+
`;
|
|
149
|
+
const readDirectoryCache = async (env) => {
|
|
150
|
+
const root = resolveCacheRoot({ env });
|
|
151
|
+
try {
|
|
152
|
+
const hit = await readEntry(root, { kind: 'users' }, (raw) => userDirectorySchema.parse(raw), { ttlSeconds: DEFAULT_CACHE_TTL_SECONDS });
|
|
153
|
+
if (hit === undefined)
|
|
154
|
+
return undefined;
|
|
155
|
+
return { entries: hit.data, ageSeconds: hit.ageSeconds };
|
|
156
|
+
}
|
|
157
|
+
catch {
|
|
158
|
+
return undefined;
|
|
159
|
+
}
|
|
160
|
+
};
|
|
161
|
+
const writeDirectoryCache = async (env, entries) => {
|
|
162
|
+
const root = resolveCacheRoot({ env });
|
|
163
|
+
try {
|
|
164
|
+
await writeEntry(root, { kind: 'users' }, entries);
|
|
165
|
+
}
|
|
166
|
+
catch {
|
|
167
|
+
// Best-effort — cache write failures don't block the lookup.
|
|
168
|
+
}
|
|
169
|
+
};
|
|
170
|
+
const upsertCache = async (env, fresh) => {
|
|
171
|
+
const existing = await readDirectoryCache(env);
|
|
172
|
+
const byId = new Map();
|
|
173
|
+
for (const entry of existing?.entries ?? []) {
|
|
174
|
+
byId.set(entry.id, entry);
|
|
175
|
+
}
|
|
176
|
+
for (const entry of fresh) {
|
|
177
|
+
byId.set(entry.id, entry);
|
|
178
|
+
}
|
|
179
|
+
await writeDirectoryCache(env, [...byId.values()]);
|
|
180
|
+
};
|
|
181
|
+
const matchInCache = (entries, email) => {
|
|
182
|
+
const target = normaliseFold(email);
|
|
183
|
+
return entries.find((e) => normaliseFold(e.email) === target);
|
|
184
|
+
};
|
|
185
|
+
/**
|
|
186
|
+
* Looks up a user by email. Prefers the local user-directory cache;
|
|
187
|
+
* on miss, calls `users(emails: [...])` and folds the result back
|
|
188
|
+
* into the cache. Unknown email → `user_not_found` with the
|
|
189
|
+
* unmatched email in `details`.
|
|
190
|
+
*
|
|
191
|
+
* Email matching is NFC + case-fold so `Alice@Example.COM` and
|
|
192
|
+
* `alice@example.com` resolve identically.
|
|
193
|
+
*/
|
|
194
|
+
export const userByEmail = async (inputs) => {
|
|
195
|
+
/* c8 ignore next — defensive fallback; tests always pass `env`. */
|
|
196
|
+
const env = inputs.env ?? process.env;
|
|
197
|
+
const noCache = inputs.noCache ?? false;
|
|
198
|
+
if (!noCache) {
|
|
199
|
+
const cached = await readDirectoryCache(env);
|
|
200
|
+
if (cached !== undefined) {
|
|
201
|
+
const hit = matchInCache(cached.entries, inputs.email);
|
|
202
|
+
if (hit !== undefined) {
|
|
203
|
+
return { user: hit, source: 'cache', cacheAgeSeconds: cached.ageSeconds };
|
|
204
|
+
}
|
|
205
|
+
}
|
|
206
|
+
}
|
|
207
|
+
const response = await inputs.client.raw(USERS_BY_EMAIL_QUERY, { emails: [inputs.email] }, { operationName: 'UsersByEmail' });
|
|
208
|
+
const users = response.data.users ?? [];
|
|
209
|
+
// R17: parse-then-wrap. Per `validation.md`'s "Never bubble raw
|
|
210
|
+
// ZodError out of a parse boundary" rule, malformed Monday
|
|
211
|
+
// responses (e.g. a future tenant where `id` is a hex string)
|
|
212
|
+
// surface as a typed `internal_error` carrying `details.issues`
|
|
213
|
+
// rather than a bare ZodError. Pre-R17, the raw ZodError reached
|
|
214
|
+
// the runner's catch-all which DID map to `internal_error` (the
|
|
215
|
+
// right semantic code) but lost the issues array — agents
|
|
216
|
+
// debugging a malformed Monday response saw only the bare
|
|
217
|
+
// message. The newly-tightened `id` regex (R-people pass-2 F4)
|
|
218
|
+
// makes this surface more reachable: every malformed ID from
|
|
219
|
+
// Monday now hits this boundary instead of silently caching.
|
|
220
|
+
const parsed = userDirectorySchema.safeParse(users);
|
|
221
|
+
if (!parsed.success) {
|
|
222
|
+
const issues = parsed.error.issues.map((i) => ({
|
|
223
|
+
path: i.path.join('.'),
|
|
224
|
+
message: i.message,
|
|
225
|
+
code: i.code,
|
|
226
|
+
}));
|
|
227
|
+
throw new ApiError('internal_error', `Monday returned a malformed users response for email ` +
|
|
228
|
+
`${JSON.stringify(inputs.email)} — the directory schema rejected ` +
|
|
229
|
+
`the payload at ${issues.length} ` +
|
|
230
|
+
`issue${issues.length === 1 ? '' : 's'}.`, {
|
|
231
|
+
cause: parsed.error,
|
|
232
|
+
details: {
|
|
233
|
+
email: inputs.email,
|
|
234
|
+
issues,
|
|
235
|
+
hint: 'this is a data-integrity error in Monday\'s response (or a ' +
|
|
236
|
+
'directory-schema drift); verify the response shape and update ' +
|
|
237
|
+
'userDirectoryEntrySchema if Monday\'s contract has changed.',
|
|
238
|
+
},
|
|
239
|
+
});
|
|
240
|
+
}
|
|
241
|
+
const fresh = parsed.data;
|
|
242
|
+
if (!noCache && fresh.length > 0) {
|
|
243
|
+
await upsertCache(env, fresh);
|
|
244
|
+
}
|
|
245
|
+
const match = matchInCache(fresh, inputs.email);
|
|
246
|
+
if (match !== undefined) {
|
|
247
|
+
return { user: match, source: 'live', cacheAgeSeconds: null };
|
|
248
|
+
}
|
|
249
|
+
throw new ApiError('user_not_found', `No Monday user matches email ${JSON.stringify(inputs.email)}`, { details: { email: inputs.email } });
|
|
250
|
+
};
|
|
251
|
+
/**
|
|
252
|
+
* Cast a `string` to a `UserId`. Used by callers that hold a
|
|
253
|
+
* directory-projected ID and need the branded form for downstream
|
|
254
|
+
* APIs. Validates via the same regex as the schema brand.
|
|
255
|
+
*/
|
|
256
|
+
export const userIdFromString = (id) => {
|
|
257
|
+
if (!/^\d+$/u.test(id)) {
|
|
258
|
+
throw new ApiError('internal_error', `Monday returned a non-numeric user id: ${JSON.stringify(id)}`);
|
|
259
|
+
}
|
|
260
|
+
return id;
|
|
261
|
+
};
|
|
262
|
+
//# sourceMappingURL=resolvers.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"resolvers.js","sourceRoot":"","sources":["../../src/api/resolvers.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA4BG;AAEH,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC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