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
package/dist/index.js
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,4EAA4E;AAC5E,4EAA4E;AAE5E,OAAO,EAAE,UAAU,EAAE,MAAM,kBAAkB,CAAC"}
|
|
@@ -0,0 +1,69 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
export declare const OUTPUT_FORMATS: readonly ["json", "table", "text", "ndjson"];
|
|
3
|
+
export type OutputFormat = (typeof OUTPUT_FORMATS)[number];
|
|
4
|
+
/**
|
|
5
|
+
* Commander's raw option shape after `program.parse(...)`. Boolean
|
|
6
|
+
* flags default to `undefined` if not passed; we normalise them via
|
|
7
|
+
* zod defaults below so the consumer-facing object has stable
|
|
8
|
+
* presence.
|
|
9
|
+
*/
|
|
10
|
+
export declare const globalFlagsRawSchema: z.ZodObject<{
|
|
11
|
+
output: z.ZodOptional<z.ZodEnum<{
|
|
12
|
+
text: "text";
|
|
13
|
+
json: "json";
|
|
14
|
+
table: "table";
|
|
15
|
+
ndjson: "ndjson";
|
|
16
|
+
}>>;
|
|
17
|
+
json: z.ZodDefault<z.ZodBoolean>;
|
|
18
|
+
table: z.ZodDefault<z.ZodBoolean>;
|
|
19
|
+
full: z.ZodDefault<z.ZodBoolean>;
|
|
20
|
+
width: z.ZodOptional<z.ZodCoercedNumber<unknown>>;
|
|
21
|
+
columns: z.ZodOptional<z.ZodString>;
|
|
22
|
+
minimal: z.ZodDefault<z.ZodBoolean>;
|
|
23
|
+
quiet: z.ZodDefault<z.ZodBoolean>;
|
|
24
|
+
verbose: z.ZodDefault<z.ZodBoolean>;
|
|
25
|
+
color: z.ZodDefault<z.ZodBoolean>;
|
|
26
|
+
cache: z.ZodDefault<z.ZodBoolean>;
|
|
27
|
+
profile: z.ZodOptional<z.ZodString>;
|
|
28
|
+
apiVersion: z.ZodOptional<z.ZodString>;
|
|
29
|
+
timeout: z.ZodOptional<z.ZodCoercedNumber<unknown>>;
|
|
30
|
+
retry: z.ZodDefault<z.ZodCoercedNumber<unknown>>;
|
|
31
|
+
dryRun: z.ZodDefault<z.ZodBoolean>;
|
|
32
|
+
yes: z.ZodDefault<z.ZodBoolean>;
|
|
33
|
+
bodyFile: z.ZodOptional<z.ZodString>;
|
|
34
|
+
}, z.core.$strict>;
|
|
35
|
+
export type GlobalFlagsRaw = z.infer<typeof globalFlagsRawSchema>;
|
|
36
|
+
/**
|
|
37
|
+
* The normalised shape every command consumes. `noCache` /
|
|
38
|
+
* `noColor` are inverted from commander's `cache`/`color` so command
|
|
39
|
+
* code reads the way the flags do. `columns` is split. `profile` is
|
|
40
|
+
* narrowed to its v0.1 acceptable value (or absent).
|
|
41
|
+
*/
|
|
42
|
+
export interface GlobalFlags {
|
|
43
|
+
readonly output: OutputFormat | undefined;
|
|
44
|
+
readonly json: boolean;
|
|
45
|
+
readonly table: boolean;
|
|
46
|
+
readonly full: boolean;
|
|
47
|
+
readonly width: number | undefined;
|
|
48
|
+
readonly columns: readonly string[] | undefined;
|
|
49
|
+
readonly minimal: boolean;
|
|
50
|
+
readonly quiet: boolean;
|
|
51
|
+
readonly verbose: boolean;
|
|
52
|
+
readonly noColor: boolean;
|
|
53
|
+
readonly noCache: boolean;
|
|
54
|
+
readonly profile: 'default' | undefined;
|
|
55
|
+
readonly apiVersion: string | undefined;
|
|
56
|
+
readonly timeout: number | undefined;
|
|
57
|
+
readonly retry: number;
|
|
58
|
+
readonly dryRun: boolean;
|
|
59
|
+
readonly yes: boolean;
|
|
60
|
+
readonly bodyFile: string | undefined;
|
|
61
|
+
}
|
|
62
|
+
/**
|
|
63
|
+
* Parses commander's raw global-options object into the normalised
|
|
64
|
+
* `GlobalFlags` shape. Throws `UsageError` (with structured
|
|
65
|
+
* `details.issues` / `details.hint` where useful) on any failure —
|
|
66
|
+
* the runner catch-all maps that to exit 1 + envelope.
|
|
67
|
+
*/
|
|
68
|
+
export declare const parseGlobalFlags: (rawOpts: unknown, env?: NodeJS.ProcessEnv) => GlobalFlags;
|
|
69
|
+
//# sourceMappingURL=global-flags.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"global-flags.d.ts","sourceRoot":"","sources":["../../src/types/global-flags.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AA2CxB,eAAO,MAAM,cAAc,8CAA+C,CAAC;AAC3E,MAAM,MAAM,YAAY,GAAG,CAAC,OAAO,cAAc,CAAC,CAAC,MAAM,CAAC,CAAC;AAE3D;;;;;GAKG;AACH,eAAO,MAAM,oBAAoB;;;;;;;;;;;;;;;;;;;;;;;;kBAyC7B,CAAC;AAEL,MAAM,MAAM,cAAc,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,oBAAoB,CAAC,CAA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ags every command accepts.
|
|
7
|
+
* Commander parses argv into a loose `Record<string, unknown>`;
|
|
8
|
+
* this module coerces / refines / normalises before the value
|
|
9
|
+
* crosses into `commands/*` — the parse-at-the-edge rule from
|
|
10
|
+
* `validation.md`.
|
|
11
|
+
*
|
|
12
|
+
* Two layers, deliberately separated:
|
|
13
|
+
*
|
|
14
|
+
* - **`globalFlagsRawSchema`** — accepts commander's raw output
|
|
15
|
+
* shape exactly as it lands. `--no-cache` becomes `{cache:false}`
|
|
16
|
+
* (not `{noCache:true}`); `--no-color` becomes `{color:false}`;
|
|
17
|
+
* `--columns id,name` is the single string `"id,name"` (commander
|
|
18
|
+
* doesn't auto-split). String→number coercion happens here too
|
|
19
|
+
* because commander hands `--timeout 5000` over as `"5000"`.
|
|
20
|
+
*
|
|
21
|
+
* - **`parseGlobalFlags(rawOpts, env)`** — parses through the raw
|
|
22
|
+
* schema, then projects into the normalised `GlobalFlags` shape
|
|
23
|
+
* the rest of the codebase consumes (`noCache`, `noColor`,
|
|
24
|
+
* `columns: string[]`). Also resolves `--profile` against
|
|
25
|
+
* `MONDAY_PROFILE` env per the §8 decision-5 deferral
|
|
26
|
+
* (accept absent or `default`; anything else is `usage_error`).
|
|
27
|
+
*
|
|
28
|
+
* Codex review §4–§6 caught the original schema's drift — it
|
|
29
|
+
* declared `noCache: boolean` and `columns: string[]` and tested
|
|
30
|
+
* against hand-shaped objects rather than real commander output.
|
|
31
|
+
* This rewrite uses commander's actual shape on the input boundary
|
|
32
|
+
* and produces the consumer-friendly shape on the output boundary.
|
|
33
|
+
*/
|
|
34
|
+
const PROFILE_V03_HINT = 'Multi-profile support lands in v0.3 (`monday auth login`). ' +
|
|
35
|
+
'For now, omit --profile/MONDAY_PROFILE or set them to `default`.';
|
|
36
|
+
const apiVersionSchema = z
|
|
37
|
+
.string()
|
|
38
|
+
.regex(/^\d{4}-\d{2}$/u, { message: 'expected YYYY-MM' });
|
|
39
|
+
export const OUTPUT_FORMATS = ['json', 'table', 'text', 'ndjson'];
|
|
40
|
+
/**
|
|
41
|
+
* Commander's raw option shape after `program.parse(...)`. Boolean
|
|
42
|
+
* flags default to `undefined` if not passed; we normalise them via
|
|
43
|
+
* zod defaults below so the consumer-facing object has stable
|
|
44
|
+
* presence.
|
|
45
|
+
*/
|
|
46
|
+
export const globalFlagsRawSchema = z
|
|
47
|
+
.object({
|
|
48
|
+
output: z.enum(OUTPUT_FORMATS).optional(),
|
|
49
|
+
json: z.boolean().default(false),
|
|
50
|
+
table: z.boolean().default(false),
|
|
51
|
+
full: z.boolean().default(false),
|
|
52
|
+
width: z.coerce.number().int().positive().optional(),
|
|
53
|
+
/** Commander emits the literal string; we split on `,` later. */
|
|
54
|
+
columns: z.string().min(1).optional(),
|
|
55
|
+
minimal: z.boolean().default(false),
|
|
56
|
+
quiet: z.boolean().default(false),
|
|
57
|
+
verbose: z.boolean().default(false),
|
|
58
|
+
/** `--no-color`: commander sets `color: false`. Default `true`. */
|
|
59
|
+
color: z.boolean().default(true),
|
|
60
|
+
/** `--no-cache`: commander sets `cache: false`. Default `true`. */
|
|
61
|
+
cache: z.boolean().default(true),
|
|
62
|
+
profile: z.string().optional(),
|
|
63
|
+
apiVersion: apiVersionSchema.optional(),
|
|
64
|
+
timeout: z.coerce.number().int().positive().optional(),
|
|
65
|
+
retry: z.coerce.number().int().nonnegative().default(3),
|
|
66
|
+
dryRun: z.boolean().default(false),
|
|
67
|
+
yes: z.boolean().default(false),
|
|
68
|
+
/** Long-form text body source (per-command, but global flag in §4.4). */
|
|
69
|
+
bodyFile: z.string().min(1).optional(),
|
|
70
|
+
})
|
|
71
|
+
.strict()
|
|
72
|
+
.refine((v) => !(v.json && v.table), {
|
|
73
|
+
message: '--json and --table are mutually exclusive',
|
|
74
|
+
path: ['json'],
|
|
75
|
+
})
|
|
76
|
+
.refine((v) => !(v.quiet && v.verbose), {
|
|
77
|
+
message: '--quiet and --verbose are mutually exclusive',
|
|
78
|
+
path: ['quiet'],
|
|
79
|
+
})
|
|
80
|
+
.refine((v) => !(v.full && v.json), {
|
|
81
|
+
message: '--full has no effect with --json (JSON output is never truncated)',
|
|
82
|
+
path: ['full'],
|
|
83
|
+
});
|
|
84
|
+
const splitColumns = (raw) => {
|
|
85
|
+
if (raw === undefined) {
|
|
86
|
+
return undefined;
|
|
87
|
+
}
|
|
88
|
+
const parts = raw
|
|
89
|
+
.split(',')
|
|
90
|
+
.map((s) => s.trim())
|
|
91
|
+
.filter((s) => s.length > 0);
|
|
92
|
+
return parts.length === 0 ? undefined : parts;
|
|
93
|
+
};
|
|
94
|
+
/**
|
|
95
|
+
* `--profile` deferral (`v0.1-plan.md` §8 decision 5). Accept absent
|
|
96
|
+
* or the literal `default`; anything else is `usage_error` with a
|
|
97
|
+
* v0.3 hint. `MONDAY_PROFILE` env is treated identically — flag and
|
|
98
|
+
* env must agree if both are set.
|
|
99
|
+
*/
|
|
100
|
+
const resolveProfile = (flagValue, envValue) => {
|
|
101
|
+
const fromFlag = flagValue !== undefined && flagValue.length > 0
|
|
102
|
+
? flagValue
|
|
103
|
+
: undefined;
|
|
104
|
+
const fromEnv = envValue !== undefined && envValue.length > 0
|
|
105
|
+
? envValue
|
|
106
|
+
: undefined;
|
|
107
|
+
if (fromFlag !== undefined && fromEnv !== undefined && fromFlag !== fromEnv) {
|
|
108
|
+
throw new UsageError(`--profile (${fromFlag}) conflicts with MONDAY_PROFILE (${fromEnv})`, {
|
|
109
|
+
details: {
|
|
110
|
+
hint: 'set --profile and MONDAY_PROFILE to the same value, or omit one',
|
|
111
|
+
},
|
|
112
|
+
});
|
|
113
|
+
}
|
|
114
|
+
const chosen = fromFlag ?? fromEnv;
|
|
115
|
+
if (chosen === undefined) {
|
|
116
|
+
return undefined;
|
|
117
|
+
}
|
|
118
|
+
if (chosen !== 'default') {
|
|
119
|
+
throw new UsageError(`profile "${chosen}" is not supported in v0.1`, { details: { hint: PROFILE_V03_HINT } });
|
|
120
|
+
}
|
|
121
|
+
return 'default';
|
|
122
|
+
};
|
|
123
|
+
const formatZodIssues = (err) => {
|
|
124
|
+
const issues = err.issues.map((issue) => ({
|
|
125
|
+
path: issue.path.join('.'),
|
|
126
|
+
message: issue.message,
|
|
127
|
+
}));
|
|
128
|
+
const summary = issues
|
|
129
|
+
.map((i) => (i.path ? `${i.path}: ${i.message}` : i.message))
|
|
130
|
+
.join('; ');
|
|
131
|
+
return { summary, issues };
|
|
132
|
+
};
|
|
133
|
+
/**
|
|
134
|
+
* Parses commander's raw global-options object into the normalised
|
|
135
|
+
* `GlobalFlags` shape. Throws `UsageError` (with structured
|
|
136
|
+
* `details.issues` / `details.hint` where useful) on any failure —
|
|
137
|
+
* the runner catch-all maps that to exit 1 + envelope.
|
|
138
|
+
*/
|
|
139
|
+
export const parseGlobalFlags = (rawOpts, env = {}) => {
|
|
140
|
+
const result = globalFlagsRawSchema.safeParse(rawOpts);
|
|
141
|
+
if (!result.success) {
|
|
142
|
+
const { summary, issues } = formatZodIssues(result.error);
|
|
143
|
+
throw new UsageError(`invalid global flags: ${summary}`, {
|
|
144
|
+
cause: result.error,
|
|
145
|
+
details: { issues },
|
|
146
|
+
});
|
|
147
|
+
}
|
|
148
|
+
const raw = result.data;
|
|
149
|
+
return {
|
|
150
|
+
output: raw.output,
|
|
151
|
+
json: raw.json,
|
|
152
|
+
table: raw.table,
|
|
153
|
+
full: raw.full,
|
|
154
|
+
width: raw.width,
|
|
155
|
+
columns: splitColumns(raw.columns),
|
|
156
|
+
minimal: raw.minimal,
|
|
157
|
+
quiet: raw.quiet,
|
|
158
|
+
verbose: raw.verbose,
|
|
159
|
+
noColor: !raw.color,
|
|
160
|
+
noCache: !raw.cache,
|
|
161
|
+
profile: resolveProfile(raw.profile, env.MONDAY_PROFILE),
|
|
162
|
+
apiVersion: raw.apiVersion,
|
|
163
|
+
timeout: raw.timeout,
|
|
164
|
+
retry: raw.retry,
|
|
165
|
+
dryRun: raw.dryRun,
|
|
166
|
+
yes: raw.yes,
|
|
167
|
+
bodyFile: raw.bodyFile,
|
|
168
|
+
};
|
|
169
|
+
};
|
|
170
|
+
//# sourceMappingURL=global-flags.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"global-flags.js","sourceRoot":"","sources":["../../src/types/global-flags.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AACxB,OAAO,EAAE,UAAU,EAAE,MAAM,oBAAoB,CAAC;AAEhD;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA8BG;AAEH,MAAM,gBAAgB,GACpB,6DAA6D;IAC7D,kEAAkE,CAAC;AAErE,MAAM,gBAAgB,GAAG,CAAC;KACvB,MAAM,EAAE;KACR,KAAK,CAAC,gBAAgB,EAAE,EAAE,OAAO,EAAE,kBAAkB,EAAE,CAAC,CAAC;AAE5D,MAAM,CAAC,MAAM,cAAc,GAAG,CAAC,MAAM,EAAE,OAAO,EAAE,MAAM,EAAE,QAAQ,CAAU,CAAC;AAG3E;;;;;GAKG;AACH,MAAM,CAAC,MAAM,oBAAoB,GAAG,CAAC;KAClC,MAAM,CAAC;IACN,MAAM,EAAE,CAAC,CAAC,IAAI,CAAC,cAAc,CAAC,CAAC,QAAQ,EAAE;IACzC,IAAI,EAAE,CAAC,CAAC,OAAO,EAAE,CAAC,OAAO,CAAC,KAAK,CAAC;IAChC,KAAK,EAAE,CAAC,CAAC,OAAO,EAAE,CAAC,OAAO,CAAC,KAAK,CAAC;IACjC,IAAI,EAAE,CAAC,CAAC,OAAO,EAAE,CAAC,OAAO,CAAC,KAAK,CAAC;IAChC,KAAK,EAAE,CAAC,CAAC,MAAM,CAAC,MAAM,EAAE,CAAC,GAAG,EAAE,CAAC,QAAQ,EAAE,CAAC,QAAQ,EAAE;IACpD,iEAAiE;IACjE,OAAO,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,QAAQ,EAAE;IAErC,OAAO,EAAE,CAAC,CAAC,OAAO,EAAE,CAAC,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|
+
* `1234567`. Rejects `"-1"` (signed), `"0x2a"` (hex), `"1e3"`
|
|
5
|
+
* (scientific), `""` (empty), `"01"` (leading zeros), `"42 "`
|
|
6
|
+
* (trailing whitespace).
|
|
7
|
+
*
|
|
8
|
+
* Stricter than the numeric-ID brand regex (`/^\d+$/u`, which
|
|
9
|
+
* accepts `"00042"`) because this regex is the **resolver-output
|
|
10
|
+
* validator** for user IDs that get converted to JS numbers for
|
|
11
|
+
* Monday wire payloads. The directory should never produce
|
|
12
|
+
* leading-zero IDs for a real user — if it does, the resolver is
|
|
13
|
+
* misbehaving and we want to surface it as `internal_error`
|
|
14
|
+
* rather than silently letting `Number()` corrupt the payload.
|
|
15
|
+
*
|
|
16
|
+
* Two consumers: `src/api/people.ts`'s `idStringToNumber`
|
|
17
|
+
* defence-in-depth check + `src/api/resolvers.ts`'s
|
|
18
|
+
* `userDirectoryEntrySchema` shape (the source-of-truth pin on
|
|
19
|
+
* what the directory cache stores). Pre-consolidation, both
|
|
20
|
+
* carried a copy of this regex — same rule, two copies. R16
|
|
21
|
+
* landed both onto this single export.
|
|
22
|
+
*/
|
|
23
|
+
export declare const DECIMAL_USER_ID_PATTERN: RegExp;
|
|
24
|
+
export declare const BoardIdSchema: z.core.$ZodBranded<z.ZodString, "BoardId", "out">;
|
|
25
|
+
export declare const ItemIdSchema: z.core.$ZodBranded<z.ZodString, "ItemId", "out">;
|
|
26
|
+
export declare const UserIdSchema: z.core.$ZodBranded<z.ZodString, "UserId", "out">;
|
|
27
|
+
export declare const WorkspaceIdSchema: z.core.$ZodBranded<z.ZodString, "WorkspaceId", "out">;
|
|
28
|
+
export declare const UpdateIdSchema: z.core.$ZodBranded<z.ZodString, "UpdateId", "out">;
|
|
29
|
+
export declare const ColumnIdSchema: z.core.$ZodBranded<z.ZodString, "ColumnId", "out">;
|
|
30
|
+
export declare const GroupIdSchema: z.core.$ZodBranded<z.ZodString, "GroupId", "out">;
|
|
31
|
+
export type BoardId = z.infer<typeof BoardIdSchema>;
|
|
32
|
+
export type ItemId = z.infer<typeof ItemIdSchema>;
|
|
33
|
+
export type ColumnId = z.infer<typeof ColumnIdSchema>;
|
|
34
|
+
export type GroupId = z.infer<typeof GroupIdSchema>;
|
|
35
|
+
export type UserId = z.infer<typeof UserIdSchema>;
|
|
36
|
+
export type WorkspaceId = z.infer<typeof WorkspaceIdSchema>;
|
|
37
|
+
export type UpdateId = z.infer<typeof UpdateIdSchema>;
|
|
38
|
+
//# sourceMappingURL=ids.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ids.d.ts","sourceRoot":"","sources":["../../src/types/ids.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAsBxB;;;;;;;;;;;;;;;;;;;;GAoBG;AACH,eAAO,MAAM,uBAAuB,QAAoB,CAAC;AAEzD,eAAO,MAAM,aAAa,mDAAqC,CAAC;AAChE,eAAO,MAAM,YAAY,kDAAoC,CAAC;AAC9D,eAAO,MAAM,YAAY,kDAAoC,CAAC;AAC9D,eAAO,MAAM,iBAAiB,uDAAyC,CAAC;AACxE,eAAO,MAAM,cAAc,oDAAsC,CAAC;AAIlE,eAAO,MAAM,cAAc,oDAAmC,CAAC;AAC/D,eAAO,MAAM,aAAa,mDAAkC,CAAC;AAE7D,MAAM,MAAM,OAAO,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,aAAa,CAAC,CAAC;AACpD,MAAM,MAAM,MAAM,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,YAAY,CAAC,CAAC;AAClD,MAAM,MAAM,QAAQ,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,cAAc,CAAC,CAAC;AACtD,MAAM,MAAM,OAAO,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,aAAa,CAAC,CAAC;AACpD,MAAM,MAAM,MAAM,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,YAAY,CAAC,CAAC;AAClD,MAAM,MAAM,WAAW,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,iBAAiB,CAAC,CAAC;AAC5D,MAAM,MAAM,QAAQ,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,cAAc,CAAC,CAAC"}
|
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
/**
|
|
3
|
+
* Branded zod schemas for the seven ID kinds Monday surfaces. Brands
|
|
4
|
+
* make `BoardId`/`ItemId`/etc. nominally distinct at the type level
|
|
5
|
+
* even though they're all numeric strings on the wire — passing a
|
|
6
|
+
* `BoardId` where an `ItemId` is wanted becomes a compile error,
|
|
7
|
+
* which is the whole point.
|
|
8
|
+
*
|
|
9
|
+
* Monday's numeric IDs exceed `Number.MAX_SAFE_INTEGER` for older
|
|
10
|
+
* accounts, so we keep them as decimal strings everywhere — argv
|
|
11
|
+
* already arrives as strings, GraphQL responses already arrive as
|
|
12
|
+
* strings, and the wire format stays stable through the CLI.
|
|
13
|
+
*/
|
|
14
|
+
const numericIdSchema = z
|
|
15
|
+
.string()
|
|
16
|
+
.regex(/^\d+$/u, { message: 'expected a numeric ID' });
|
|
17
|
+
const slugIdSchema = z.string().min(1, {
|
|
18
|
+
message: 'expected a non-empty ID',
|
|
19
|
+
});
|
|
20
|
+
/**
|
|
21
|
+
* Decimal non-negative integer string: matches `0`, `42`,
|
|
22
|
+
* `1234567`. Rejects `"-1"` (signed), `"0x2a"` (hex), `"1e3"`
|
|
23
|
+
* (scientific), `""` (empty), `"01"` (leading zeros), `"42 "`
|
|
24
|
+
* (trailing whitespace).
|
|
25
|
+
*
|
|
26
|
+
* Stricter than the numeric-ID brand regex (`/^\d+$/u`, which
|
|
27
|
+
* accepts `"00042"`) because this regex is the **resolver-output
|
|
28
|
+
* validator** for user IDs that get converted to JS numbers for
|
|
29
|
+
* Monday wire payloads. The directory should never produce
|
|
30
|
+
* leading-zero IDs for a real user — if it does, the resolver is
|
|
31
|
+
* misbehaving and we want to surface it as `internal_error`
|
|
32
|
+
* rather than silently letting `Number()` corrupt the payload.
|
|
33
|
+
*
|
|
34
|
+
* Two consumers: `src/api/people.ts`'s `idStringToNumber`
|
|
35
|
+
* defence-in-depth check + `src/api/resolvers.ts`'s
|
|
36
|
+
* `userDirectoryEntrySchema` shape (the source-of-truth pin on
|
|
37
|
+
* what the directory cache stores). Pre-consolidation, both
|
|
38
|
+
* carried a copy of this regex — same rule, two copies. R16
|
|
39
|
+
* landed both onto this single export.
|
|
40
|
+
*/
|
|
41
|
+
export const DECIMAL_USER_ID_PATTERN = /^(0|[1-9]\d*)$/u;
|
|
42
|
+
export const BoardIdSchema = numericIdSchema.brand();
|
|
43
|
+
export const ItemIdSchema = numericIdSchema.brand();
|
|
44
|
+
export const UserIdSchema = numericIdSchema.brand();
|
|
45
|
+
export const WorkspaceIdSchema = numericIdSchema.brand();
|
|
46
|
+
export const UpdateIdSchema = numericIdSchema.brand();
|
|
47
|
+
// Column and group IDs are stable lower-snake-case slugs ("status_4",
|
|
48
|
+
// "topics") — not numeric. Validate as non-empty strings only.
|
|
49
|
+
export const ColumnIdSchema = slugIdSchema.brand();
|
|
50
|
+
export const GroupIdSchema = slugIdSchema.brand();
|
|
51
|
+
//# sourceMappingURL=ids.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ids.js","sourceRoot":"","sources":["../../src/types/ids.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAExB;;;;;;;;;;;GAWG;AACH,MAAM,eAAe,GAAG,CAAC;KACtB,MAAM,EAAE;KACR,KAAK,CAAC,QAAQ,EAAE,EAAE,OAAO,EAAE,uBAAuB,EAAE,CAAC,CAAC;AAEzD,MAAM,YAAY,GAAG,CAAC,CAAC,MAAM,EAAE,CAAC,GAAG,CAAC,CAAC,EAAE;IACrC,OAAO,EAAE,yBAAyB;CACnC,CAAC,CAAC;AAEH;;;;;;;;;;;;;;;;;;;;GAoBG;AACH,MAAM,CAAC,MAAM,uBAAuB,GAAG,iBAAiB,CAAC;AAEzD,MAAM,CAAC,MAAM,aAAa,GAAG,eAAe,CAAC,KAAK,EAAa,CAAC;AAChE,MAAM,CAAC,MAAM,YAAY,GAAG,eAAe,CAAC,KAAK,EAAY,CAAC;AAC9D,MAAM,CAAC,MAAM,YAAY,GAAG,eAAe,CAAC,KAAK,EAAY,CAAC;AAC9D,MAAM,CAAC,MAAM,iBAAiB,GAAG,eAAe,CAAC,KAAK,EAAiB,CAAC;AACxE,MAAM,CAAC,MAAM,cAAc,GAAG,eAAe,CAAC,KAAK,EAAc,CAAC;AAElE,sEAAsE;AACtE,+DAA+D;AAC/D,MAAM,CAAC,MAAM,cAAc,GAAG,YAAY,CAAC,KAAK,EAAc,CAAC;AAC/D,MAAM,CAAC,MAAM,aAAa,GAAG,YAAY,CAAC,KAAK,EAAa,CAAC"}
|
|
@@ -0,0 +1,60 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Tight typing for the Monday `JSON` scalar payload shape
|
|
3
|
+
* (R-JsonValue, M5a follow-up to Codex review pass-1 on the
|
|
4
|
+
* status/dropdown commit, deferred until the people translator
|
|
5
|
+
* exercised the first translator with a nested array of objects
|
|
6
|
+
* with mixed primitive types).
|
|
7
|
+
*
|
|
8
|
+
* `Readonly<Record<string, unknown>>` (the previous slot type)
|
|
9
|
+
* admits `undefined` values, symbols, functions, and class
|
|
10
|
+
* instances — none of which `JSON.stringify` round-trips. Mostly
|
|
11
|
+
* benign in practice (the translator builds payloads from typed
|
|
12
|
+
* inputs), but a future contributor who pipes through a less-
|
|
13
|
+
* disciplined source could land a non-JSON value at Monday's
|
|
14
|
+
* wire boundary and see a silent corruption.
|
|
15
|
+
*
|
|
16
|
+
* This module narrows the type toward what the JSON scalar
|
|
17
|
+
* accepts — catching the common non-JSON-shaped values at
|
|
18
|
+
* compile time with no runtime cost. The narrowing is
|
|
19
|
+
* structural, not semantic: see "What this does NOT prevent"
|
|
20
|
+
* on `JsonValue` below for the shapes TypeScript can't catch
|
|
21
|
+
* (NaN/Infinity, cycles, symbol-keyed properties, BigInt).
|
|
22
|
+
*
|
|
23
|
+
* **Closed-type-literal caveat.** TypeScript treats closed object
|
|
24
|
+
* types (interfaces / type literals) as not implicitly satisfying
|
|
25
|
+
* open index signatures, even when their values are all
|
|
26
|
+
* structurally compatible. A typed payload like
|
|
27
|
+
* `{personsAndTeams: readonly {id: number; kind: 'person'}[]}` is
|
|
28
|
+
* structurally a JsonObject but doesn't assign without a cast at
|
|
29
|
+
* the boundary. The cast site comments call this out so a future
|
|
30
|
+
* refactor doesn't waste time trying to remove the cast.
|
|
31
|
+
*/
|
|
32
|
+
/**
|
|
33
|
+
* The full `JSON` scalar value type. Models the JSON grammar
|
|
34
|
+
* RFC 8259 prescribes — string / number / boolean / null /
|
|
35
|
+
* arrays / objects — minus `undefined` (`JSON.stringify({x:
|
|
36
|
+
* undefined})` drops the key, which is silent payload
|
|
37
|
+
* corruption — the type system catches it instead).
|
|
38
|
+
*
|
|
39
|
+
* **What this does NOT prevent.** TypeScript's `number` type
|
|
40
|
+
* includes `NaN` and `±Infinity`, both of which `JSON.stringify`
|
|
41
|
+
* silently maps to `null`. JsonValue can't exclude them
|
|
42
|
+
* structurally; callers that build payloads from arithmetic
|
|
43
|
+
* results should validate at the boundary. Codex pass-1 nit on
|
|
44
|
+
* the R-JsonValue refactor; documented here so a future
|
|
45
|
+
* contributor doesn't assume "JsonValue = JSON.stringify-safe"
|
|
46
|
+
* unconditionally.
|
|
47
|
+
*/
|
|
48
|
+
export type JsonValue = string | number | boolean | null | readonly JsonValue[] | JsonObject;
|
|
49
|
+
/**
|
|
50
|
+
* The JSON-object branch of `JsonValue` — used for rich payload
|
|
51
|
+
* shapes the translator builds (status / dropdown / date /
|
|
52
|
+
* people). Values must themselves be `JsonValue`s; keys are
|
|
53
|
+
* always strings. Index signature is open (callers pass
|
|
54
|
+
* type-narrowed shapes through `as JsonObject` casts at the
|
|
55
|
+
* boundary).
|
|
56
|
+
*/
|
|
57
|
+
export interface JsonObject {
|
|
58
|
+
readonly [key: string]: JsonValue;
|
|
59
|
+
}
|
|
60
|
+
//# sourceMappingURL=json.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"json.d.ts","sourceRoot":"","sources":["../../src/types/json.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA8BG;AAEH;;;;;;;;;;;;;;;GAeG;AACH,MAAM,MAAM,SAAS,GACjB,MAAM,GACN,MAAM,GACN,OAAO,GACP,IAAI,GACJ,SAAS,SAAS,EAAE,GACpB,UAAU,CAAC;AAEf;;;;;;;GAOG;AACH,MAAM,WAAW,UAAU;IACzB,QAAQ,EAAE,GAAG,EAAE,MAAM,GAAG,SAAS,CAAC;CACnC"}
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Tight typing for the Monday `JSON` scalar payload shape
|
|
3
|
+
* (R-JsonValue, M5a follow-up to Codex review pass-1 on the
|
|
4
|
+
* status/dropdown commit, deferred until the people translator
|
|
5
|
+
* exercised the first translator with a nested array of objects
|
|
6
|
+
* with mixed primitive types).
|
|
7
|
+
*
|
|
8
|
+
* `Readonly<Record<string, unknown>>` (the previous slot type)
|
|
9
|
+
* admits `undefined` values, symbols, functions, and class
|
|
10
|
+
* instances — none of which `JSON.stringify` round-trips. Mostly
|
|
11
|
+
* benign in practice (the translator builds payloads from typed
|
|
12
|
+
* inputs), but a future contributor who pipes through a less-
|
|
13
|
+
* disciplined source could land a non-JSON value at Monday's
|
|
14
|
+
* wire boundary and see a silent corruption.
|
|
15
|
+
*
|
|
16
|
+
* This module narrows the type toward what the JSON scalar
|
|
17
|
+
* accepts — catching the common non-JSON-shaped values at
|
|
18
|
+
* compile time with no runtime cost. The narrowing is
|
|
19
|
+
* structural, not semantic: see "What this does NOT prevent"
|
|
20
|
+
* on `JsonValue` below for the shapes TypeScript can't catch
|
|
21
|
+
* (NaN/Infinity, cycles, symbol-keyed properties, BigInt).
|
|
22
|
+
*
|
|
23
|
+
* **Closed-type-literal caveat.** TypeScript treats closed object
|
|
24
|
+
* types (interfaces / type literals) as not implicitly satisfying
|
|
25
|
+
* open index signatures, even when their values are all
|
|
26
|
+
* structurally compatible. A typed payload like
|
|
27
|
+
* `{personsAndTeams: readonly {id: number; kind: 'person'}[]}` is
|
|
28
|
+
* structurally a JsonObject but doesn't assign without a cast at
|
|
29
|
+
* the boundary. The cast site comments call this out so a future
|
|
30
|
+
* refactor doesn't waste time trying to remove the cast.
|
|
31
|
+
*/
|
|
32
|
+
export {};
|
|
33
|
+
//# sourceMappingURL=json.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"json.js","sourceRoot":"","sources":["../../src/types/json.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA8BG"}
|
|
@@ -0,0 +1,121 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Typed errors for the CLI. Every thrown error carries a stable
|
|
3
|
+
* `code` from `cli-design.md` §6.5 — agents key off the code, never
|
|
4
|
+
* the English `message`. v0.1 froze 26 codes; `ambiguous_match` ships
|
|
5
|
+
* in v0.2 M12 (`item upsert` with 2+ matches), bringing the count to
|
|
6
|
+
* 27. `dev_*` codes ship in v0.3 but are listed here so the M5b agent
|
|
7
|
+
* doesn't need to backfill the type.
|
|
8
|
+
*/
|
|
9
|
+
export declare const ERROR_CODES: readonly ["usage_error", "confirmation_required", "not_found", "ambiguous_name", "ambiguous_column", "ambiguous_match", "column_not_found", "user_not_found", "unsupported_column_type", "column_archived", "unauthorized", "forbidden", "rate_limited", "complexity_exceeded", "daily_limit_exceeded", "concurrency_exceeded", "ip_rate_limited", "resource_locked", "validation_failed", "stale_cursor", "config_error", "cache_error", "network_error", "timeout", "dev_not_configured", "dev_board_misconfigured", "internal_error"];
|
|
10
|
+
export type ErrorCode = (typeof ERROR_CODES)[number];
|
|
11
|
+
/**
|
|
12
|
+
* The CLI's exit code surface (`cli-design.md` §3.1 #5).
|
|
13
|
+
* Agents key off these too; never reuse a number for a different meaning.
|
|
14
|
+
*/
|
|
15
|
+
export type ExitCode = 0 | 1 | 2 | 3 | 130;
|
|
16
|
+
export interface MondayCliErrorOptions {
|
|
17
|
+
readonly httpStatus?: number;
|
|
18
|
+
readonly mondayCode?: string;
|
|
19
|
+
readonly requestId?: string;
|
|
20
|
+
readonly retryable?: boolean;
|
|
21
|
+
readonly retryAfterSeconds?: number;
|
|
22
|
+
readonly details?: Readonly<Record<string, unknown>>;
|
|
23
|
+
readonly cause?: unknown;
|
|
24
|
+
}
|
|
25
|
+
/**
|
|
26
|
+
* Base class for everything thrown out of `commands/` and `api/`.
|
|
27
|
+
* The shape mirrors `cli-design.md` §6.5 one-to-one — the runner
|
|
28
|
+
* builds the JSON envelope by reading these fields.
|
|
29
|
+
*/
|
|
30
|
+
export declare class MondayCliError extends Error {
|
|
31
|
+
readonly code: ErrorCode;
|
|
32
|
+
readonly httpStatus: number | undefined;
|
|
33
|
+
readonly mondayCode: string | undefined;
|
|
34
|
+
readonly requestId: string | undefined;
|
|
35
|
+
readonly retryable: boolean;
|
|
36
|
+
readonly retryAfterSeconds: number | undefined;
|
|
37
|
+
readonly details: Readonly<Record<string, unknown>> | undefined;
|
|
38
|
+
constructor(code: ErrorCode, message: string, options?: MondayCliErrorOptions);
|
|
39
|
+
}
|
|
40
|
+
/**
|
|
41
|
+
* `cli-design.md` §6.5 retryable column. Defaults only — callers
|
|
42
|
+
* override when Monday's response says otherwise (e.g. a `cache_error`
|
|
43
|
+
* that's auto-retried without cache becomes non-retryable to the user).
|
|
44
|
+
*
|
|
45
|
+
* Exported because `monday schema` surfaces this per code so agents
|
|
46
|
+
* can decide retry strategy without consuming a real error envelope
|
|
47
|
+
* first (Codex review §3). Frozen so a future import can't mutate
|
|
48
|
+
* the table out from under the schema emitter (the runtime view of
|
|
49
|
+
* the contract should be the same one across the process lifetime).
|
|
50
|
+
*/
|
|
51
|
+
export declare const CODE_RETRYABLE_DEFAULT: Readonly<Record<ErrorCode, boolean>>;
|
|
52
|
+
/**
|
|
53
|
+
* Best-effort hint for the HTTP status the user would observe when
|
|
54
|
+
* this error originates from Monday. Most Monday application errors
|
|
55
|
+
* arrive with `200 OK` and a GraphQL `errors[]` payload, so a
|
|
56
|
+
* `null` here means "no fixed expectation; check the live envelope's
|
|
57
|
+
* `http_status` field". Surfaced via `monday schema` so agents can
|
|
58
|
+
* pre-build retry / backoff logic without observing an error first.
|
|
59
|
+
*
|
|
60
|
+
* Frozen for the same reason as `CODE_RETRYABLE_DEFAULT`.
|
|
61
|
+
*/
|
|
62
|
+
export declare const CODE_TYPICAL_HTTP_STATUS: Readonly<Record<ErrorCode, number | null>>;
|
|
63
|
+
/** Bad flag / missing positional / mutually exclusive inputs. */
|
|
64
|
+
export declare class UsageError extends MondayCliError {
|
|
65
|
+
constructor(message: string, options?: MondayCliErrorOptions);
|
|
66
|
+
}
|
|
67
|
+
/** Destructive op without `--yes` (`cli-design.md` §3.1 #7). */
|
|
68
|
+
export declare class ConfirmationRequiredError extends MondayCliError {
|
|
69
|
+
constructor(message: string, options?: MondayCliErrorOptions);
|
|
70
|
+
}
|
|
71
|
+
/** Missing/invalid token, malformed config. Exit code 3. */
|
|
72
|
+
export declare class ConfigError extends MondayCliError {
|
|
73
|
+
constructor(message: string, options?: MondayCliErrorOptions);
|
|
74
|
+
}
|
|
75
|
+
/** Local cache I/O failure — auto-retried without cache. */
|
|
76
|
+
export declare class CacheError extends MondayCliError {
|
|
77
|
+
constructor(message: string, options?: MondayCliErrorOptions);
|
|
78
|
+
}
|
|
79
|
+
/**
|
|
80
|
+
* Anything originating from the Monday API or transport layer —
|
|
81
|
+
* the API client (M2) maps GraphQL/HTTP/network failures to a
|
|
82
|
+
* specific code via `new ApiError(code, ...)`.
|
|
83
|
+
*/
|
|
84
|
+
export declare class ApiError extends MondayCliError {
|
|
85
|
+
}
|
|
86
|
+
/** Last-resort code for unknown errors — comes with a "report this" hint. */
|
|
87
|
+
export declare class InternalError extends MondayCliError {
|
|
88
|
+
constructor(message: string, options?: MondayCliErrorOptions);
|
|
89
|
+
}
|
|
90
|
+
/**
|
|
91
|
+
* Abort reasons. The runner attaches one of these to the wrapper
|
|
92
|
+
* AbortController's `signal.reason`; the API client / transport
|
|
93
|
+
* inspects it so timeouts and SIGINT don't collapse onto a single
|
|
94
|
+
* exit code (see `v0.1-plan.md` risk register).
|
|
95
|
+
*/
|
|
96
|
+
export type AbortReason = {
|
|
97
|
+
readonly kind: 'timeout';
|
|
98
|
+
readonly afterMs: number;
|
|
99
|
+
} | {
|
|
100
|
+
readonly kind: 'sigint';
|
|
101
|
+
} | {
|
|
102
|
+
readonly kind: 'cancel';
|
|
103
|
+
readonly reason?: string;
|
|
104
|
+
};
|
|
105
|
+
/**
|
|
106
|
+
* Maps an error code to the exit code documented in `cli-design.md`
|
|
107
|
+
* §3.1 #5. Note `confirmation_required` is *not* exit 1 — it's a
|
|
108
|
+
* usage-style error that still wants a non-zero exit, but the design
|
|
109
|
+
* explicitly groups everything that's "the CLI rejected the call"
|
|
110
|
+
* under exit 1.
|
|
111
|
+
*/
|
|
112
|
+
export declare const exitCodeForError: (code: ErrorCode) => ExitCode;
|
|
113
|
+
/**
|
|
114
|
+
* Maps an `AbortReason` to its surfaced error. SIGINT bypasses the
|
|
115
|
+
* envelope entirely (exit 130, no JSON on stderr — agents reading
|
|
116
|
+
* exit codes from `kill` already know why); timeouts are an `ApiError`
|
|
117
|
+
* with `code: "timeout"`; explicit `cancel` is whatever the caller
|
|
118
|
+
* decided when they aborted.
|
|
119
|
+
*/
|
|
120
|
+
export declare const errorForAbortReason: (reason: AbortReason) => MondayCliError;
|
|
121
|
+
//# sourceMappingURL=errors.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"errors.d.ts","sourceRoot":"","sources":["../../src/utils/errors.ts"],"names":[],"mappings":"AAAA;;;;;;;GAO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