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,72 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Shared get-by-id action helper (R7, surfaced post-M3 in
|
|
3
|
+
* `v0.1-plan.md` §15).
|
|
4
|
+
*
|
|
5
|
+
* Six v0.1 commands share a near-identical action shape:
|
|
6
|
+
*
|
|
7
|
+
* 1. `parseArgv` against the per-command input schema (positional
|
|
8
|
+
* ID arg).
|
|
9
|
+
* 2. `resolveClient(ctx, program.opts())`.
|
|
10
|
+
* 3. `client.raw<{ <plural>: unknown[] | null }>(QUERY, {ids:[id]},
|
|
11
|
+
* {operationName})`.
|
|
12
|
+
* 4. Extract `first = data.<plural>?.[0]` and raise `not_found` if
|
|
13
|
+
* undefined / null.
|
|
14
|
+
* 5. Project (`schema.parse(first)` or a custom projector — `item
|
|
15
|
+
* get` injects the column-value projection here).
|
|
16
|
+
* 6. `emitSuccess({...toEmit(response)})`.
|
|
17
|
+
*
|
|
18
|
+
* The helper compresses steps 2-6 so each command's action body is
|
|
19
|
+
* `parseArgv → runByIdLookup`. Per the trigger in §15, M4's
|
|
20
|
+
* `item get` was the 6th example — the helper's project-callback
|
|
21
|
+
* shape was the only design knob `item get` exercised that the M3
|
|
22
|
+
* five didn't. Item get fits cleanly via the optional `project`
|
|
23
|
+
* callback; the other five commands omit it (defaulting to
|
|
24
|
+
* `schema.parse`).
|
|
25
|
+
*
|
|
26
|
+
* Scoped narrowly to the get-by-id sub-shape; list / find /
|
|
27
|
+
* describe / page-walking commands stay explicit. The broader
|
|
28
|
+
* `defineNetworkCommand` factory (M2.5 R4) remains deferred — R7's
|
|
29
|
+
* narrower scope is the genuinely-identical cluster, and the wider
|
|
30
|
+
* factory would freeze the wrong abstraction at this milestone.
|
|
31
|
+
*/
|
|
32
|
+
import type { z } from 'zod';
|
|
33
|
+
import type { RunContext } from '../cli/run.js';
|
|
34
|
+
export interface RunByIdLookupInputs<O> {
|
|
35
|
+
readonly ctx: RunContext;
|
|
36
|
+
/** `program.opts()` from the commander action body. */
|
|
37
|
+
readonly programOpts: unknown;
|
|
38
|
+
readonly query: string;
|
|
39
|
+
readonly operationName: string;
|
|
40
|
+
/**
|
|
41
|
+
* Plural collection name in Monday's response shape:
|
|
42
|
+
* `'workspaces'`, `'boards'`, `'users'`, `'updates'`, `'items'`.
|
|
43
|
+
* Picked by string-key rather than a typed projector to keep the
|
|
44
|
+
* helper untyped on the response field — the per-command schema
|
|
45
|
+
* already validates the element shape.
|
|
46
|
+
*/
|
|
47
|
+
readonly collectionKey: string;
|
|
48
|
+
/** The branded ID to send in `ids: [<id>]`. */
|
|
49
|
+
readonly id: string;
|
|
50
|
+
/**
|
|
51
|
+
* snake_case detail key on the `not_found` envelope's `details`,
|
|
52
|
+
* matching the resource (`workspace_id`, `item_id`, etc.).
|
|
53
|
+
* Documented per command in `cli-design.md` §6.5.
|
|
54
|
+
*/
|
|
55
|
+
readonly errorDetailKey: string;
|
|
56
|
+
/**
|
|
57
|
+
* Singular kind name used in the `not_found` message
|
|
58
|
+
* (`workspace`, `item`, …). Stylistic — agents key off `code`,
|
|
59
|
+
* but humans read the message.
|
|
60
|
+
*/
|
|
61
|
+
readonly kind: string;
|
|
62
|
+
readonly schema: z.ZodType<O>;
|
|
63
|
+
/**
|
|
64
|
+
* Optional projector. Defaults to `schema.parse`. `item get` wires
|
|
65
|
+
* this to a parse-then-project step — the raw GraphQL element
|
|
66
|
+
* goes through `rawItemSchema.parse` first, then `projectItem` to
|
|
67
|
+
* derive the §6.2 typed column shape.
|
|
68
|
+
*/
|
|
69
|
+
readonly project?: (raw: unknown) => O;
|
|
70
|
+
}
|
|
71
|
+
export declare const runByIdLookup: <O>(inputs: RunByIdLookupInputs<O>) => Promise<void>;
|
|
72
|
+
//# sourceMappingURL=run-by-id-lookup.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"run-by-id-lookup.d.ts","sourceRoot":"","sources":["../../src/commands/run-by-id-lookup.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA8BG;AAEH,OAAO,KAAK,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAC7B,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,eAAe,CAAC;AAKhD,MAAM,WAAW,mBAAmB,CAAC,CAAC;IACpC,QAAQ,CAAC,GAAG,EAAE,UAAU,CAAC;IACzB,uDAAuD;IACvD,QAAQ,CAAC,WAAW,EAAE,OAAO,CAAC;IAC9B,QAAQ,CAAC,KAAK,EAAE,MAAM,CAAC;IACvB,QAAQ,CAAC,aAAa,EAAE,MAAM,CAAC;IAC/B;;;;;;OAMG;IACH,QAAQ,CAAC,aAAa,EAAE,MAAM,CAAC;IAC/B,+CAA+C;IAC/C,QAAQ,CAAC,EAAE,EAAE,MAAM,CAAC;IACpB;;;;OAIG;IACH,QAAQ,CAAC,cAAc,EAAE,MAAM,CAAC;IAChC;;;;OAIG;IACH,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC;IACtB,QAAQ,CAAC,MAAM,EAAE,CAAC,CAAC,OAAO,CAAC,CAAC,CAAC,CAAC;IAC9B;;;;;OAKG;IACH,QAAQ,CAAC,OAAO,CAAC,EAAE,CAAC,GAAG,EAAE,OAAO,KAAK,CAAC,CAAC;CACxC;AAKD,eAAO,MAAM,aAAa,GAAU,CAAC,EACnC,QAAQ,mBAAmB,CAAC,CAAC,CAAC,KAC7B,OAAO,CAAC,IAAI,CA8Bd,CAAC"}
|
|
@@ -0,0 +1,58 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Shared get-by-id action helper (R7, surfaced post-M3 in
|
|
3
|
+
* `v0.1-plan.md` §15).
|
|
4
|
+
*
|
|
5
|
+
* Six v0.1 commands share a near-identical action shape:
|
|
6
|
+
*
|
|
7
|
+
* 1. `parseArgv` against the per-command input schema (positional
|
|
8
|
+
* ID arg).
|
|
9
|
+
* 2. `resolveClient(ctx, program.opts())`.
|
|
10
|
+
* 3. `client.raw<{ <plural>: unknown[] | null }>(QUERY, {ids:[id]},
|
|
11
|
+
* {operationName})`.
|
|
12
|
+
* 4. Extract `first = data.<plural>?.[0]` and raise `not_found` if
|
|
13
|
+
* undefined / null.
|
|
14
|
+
* 5. Project (`schema.parse(first)` or a custom projector — `item
|
|
15
|
+
* get` injects the column-value projection here).
|
|
16
|
+
* 6. `emitSuccess({...toEmit(response)})`.
|
|
17
|
+
*
|
|
18
|
+
* The helper compresses steps 2-6 so each command's action body is
|
|
19
|
+
* `parseArgv → runByIdLookup`. Per the trigger in §15, M4's
|
|
20
|
+
* `item get` was the 6th example — the helper's project-callback
|
|
21
|
+
* shape was the only design knob `item get` exercised that the M3
|
|
22
|
+
* five didn't. Item get fits cleanly via the optional `project`
|
|
23
|
+
* callback; the other five commands omit it (defaulting to
|
|
24
|
+
* `schema.parse`).
|
|
25
|
+
*
|
|
26
|
+
* Scoped narrowly to the get-by-id sub-shape; list / find /
|
|
27
|
+
* describe / page-walking commands stay explicit. The broader
|
|
28
|
+
* `defineNetworkCommand` factory (M2.5 R4) remains deferred — R7's
|
|
29
|
+
* narrower scope is the genuinely-identical cluster, and the wider
|
|
30
|
+
* factory would freeze the wrong abstraction at this milestone.
|
|
31
|
+
*/
|
|
32
|
+
import { ApiError } from '../utils/errors.js';
|
|
33
|
+
import { resolveClient } from '../api/resolve-client.js';
|
|
34
|
+
import { emitSuccess } from './emit.js';
|
|
35
|
+
const isObject = (v) => typeof v === 'object' && v !== null && !Array.isArray(v);
|
|
36
|
+
export const runByIdLookup = async (inputs) => {
|
|
37
|
+
const { client, toEmit } = resolveClient(inputs.ctx, inputs.programOpts);
|
|
38
|
+
const response = await client.raw(inputs.query, { ids: [inputs.id] }, { operationName: inputs.operationName });
|
|
39
|
+
const data = response.data;
|
|
40
|
+
// The response shape is `{ <plural>: unknown[] | null }`; we read
|
|
41
|
+
// structurally so the helper can serve every command without a
|
|
42
|
+
// separately-typed RawXxx interface per noun.
|
|
43
|
+
const collection = isObject(data) ? data[inputs.collectionKey] : null;
|
|
44
|
+
const first = Array.isArray(collection) ? collection[0] : undefined;
|
|
45
|
+
if (first === undefined || first === null) {
|
|
46
|
+
throw new ApiError('not_found', `Monday returned no ${inputs.kind} for id ${inputs.id}`, { details: { [inputs.errorDetailKey]: inputs.id } });
|
|
47
|
+
}
|
|
48
|
+
const project = inputs.project ?? ((raw) => inputs.schema.parse(raw));
|
|
49
|
+
const projected = project(first);
|
|
50
|
+
emitSuccess({
|
|
51
|
+
ctx: inputs.ctx,
|
|
52
|
+
data: projected,
|
|
53
|
+
schema: inputs.schema,
|
|
54
|
+
programOpts: inputs.programOpts,
|
|
55
|
+
...toEmit(response),
|
|
56
|
+
});
|
|
57
|
+
};
|
|
58
|
+
//# sourceMappingURL=run-by-id-lookup.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"run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AC;QAC1C,MAAM,IAAI,QAAQ,CAChB,WAAW,EACX,sBAAsB,MAAM,CAAC,IAAI,WAAW,MAAM,CAAC,EAAE,EAAE,EACvD,EAAE,OAAO,EAAE,EAAE,CAAC,MAAM,CAAC,cAAc,CAAC,EAAE,MAAM,CAAC,EAAE,EAAE,EAAE,CACpD,CAAC;IACJ,CAAC;IACD,MAAM,OAAO,GACX,MAAM,CAAC,OAAO,IAAI,CAAC,CAAC,GAAY,EAAK,EAAE,CAAC,MAAM,CAAC,MAAM,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC,CAAC;IACpE,MAAM,SAAS,GAAG,OAAO,CAAC,KAAK,CAAC,CAAC;IACjC,WAAW,CAAC;QACV,GAAG,EAAE,MAAM,CAAC,GAAG;QACf,IAAI,EAAE,SAAS;QACf,MAAM,EAAE,MAAM,CAAC,MAAM;QACrB,WAAW,EAAE,MAAM,CAAC,WAAW;QAC/B,GAAG,MAAM,CAAC,QAAQ,CAAC;KACpB,CAAC,CAAC;AACL,CAAC,CAAC"}
|
|
@@ -0,0 +1,104 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* `monday schema [<command>]` — emits the CLI surface as JSON Schema
|
|
3
|
+
* 2020-12 (`cli-design.md` §11.1).
|
|
4
|
+
*
|
|
5
|
+
* Two consumers:
|
|
6
|
+
*
|
|
7
|
+
* - **Agents.** Ingest `monday schema --json` once per session;
|
|
8
|
+
* every command's input flags + output shape are described
|
|
9
|
+
* machine-readably. No `--help` scraping, no doc parsing,
|
|
10
|
+
* no English-message dependence. The error-code list is
|
|
11
|
+
* embedded so agents key off `code` against the same source
|
|
12
|
+
* of truth this CLI does.
|
|
13
|
+
*
|
|
14
|
+
* - **The CLI itself.** Every command's `outputSchema` is the
|
|
15
|
+
* same zod schema the `emitSuccess` drift-catch reads. The
|
|
16
|
+
* schema command and the runtime contract can never diverge
|
|
17
|
+
* because there's only one schema.
|
|
18
|
+
*
|
|
19
|
+
* `z.toJSONSchema` (zod v4 native) handles brand / refinement /
|
|
20
|
+
* coercion round-trips that earlier zod-to-JSON-Schema libs got
|
|
21
|
+
* wrong. Sharp-edge note: brands erase to their wrapped type in
|
|
22
|
+
* the JSON Schema output (a `BoardId` becomes a `string` with
|
|
23
|
+
* the regex), which is the right behaviour for an external
|
|
24
|
+
* consumer — they validate against the wire shape, not the brand.
|
|
25
|
+
*
|
|
26
|
+
* Idempotent: yes — pure read.
|
|
27
|
+
*
|
|
28
|
+
* The command lives at the top of the namespace (`monday schema`),
|
|
29
|
+
* not as a verb under a noun, because it describes the entire
|
|
30
|
+
* surface, not a Monday concept.
|
|
31
|
+
*/
|
|
32
|
+
import { z } from 'zod';
|
|
33
|
+
import type { CommandModule } from '../types.js';
|
|
34
|
+
export declare const schemaOutputSchema: z.ZodObject<{
|
|
35
|
+
schema_version: z.ZodLiteral<"1">;
|
|
36
|
+
api_version: z.ZodString;
|
|
37
|
+
cli_version: z.ZodString;
|
|
38
|
+
commands: z.ZodRecord<z.ZodString, z.ZodObject<{
|
|
39
|
+
name: z.ZodString;
|
|
40
|
+
summary: z.ZodString;
|
|
41
|
+
examples: z.ZodArray<z.ZodString>;
|
|
42
|
+
idempotent: z.ZodBoolean;
|
|
43
|
+
input: z.ZodType<unknown, unknown, z.core.$ZodTypeInternals<unknown, unknown>>;
|
|
44
|
+
output: z.ZodType<unknown, unknown, z.core.$ZodTypeInternals<unknown, unknown>>;
|
|
45
|
+
}, z.core.$strict>>;
|
|
46
|
+
error_codes: z.ZodArray<z.ZodObject<{
|
|
47
|
+
code: z.ZodEnum<{
|
|
48
|
+
usage_error: "usage_error";
|
|
49
|
+
confirmation_required: "confirmation_required";
|
|
50
|
+
not_found: "not_found";
|
|
51
|
+
ambiguous_name: "ambiguous_name";
|
|
52
|
+
ambiguous_column: "ambiguous_column";
|
|
53
|
+
ambiguous_match: "ambiguous_match";
|
|
54
|
+
column_not_found: "column_not_found";
|
|
55
|
+
user_not_found: "user_not_found";
|
|
56
|
+
unsupported_column_type: "unsupported_column_type";
|
|
57
|
+
column_archived: "column_archived";
|
|
58
|
+
unauthorized: "unauthorized";
|
|
59
|
+
forbidden: "forbidden";
|
|
60
|
+
rate_limited: "rate_limited";
|
|
61
|
+
complexity_exceeded: "complexity_exceeded";
|
|
62
|
+
daily_limit_exceeded: "daily_limit_exceeded";
|
|
63
|
+
concurrency_exceeded: "concurrency_exceeded";
|
|
64
|
+
ip_rate_limited: "ip_rate_limited";
|
|
65
|
+
resource_locked: "resource_locked";
|
|
66
|
+
validation_failed: "validation_failed";
|
|
67
|
+
stale_cursor: "stale_cursor";
|
|
68
|
+
config_error: "config_error";
|
|
69
|
+
cache_error: "cache_error";
|
|
70
|
+
network_error: "network_error";
|
|
71
|
+
timeout: "timeout";
|
|
72
|
+
dev_not_configured: "dev_not_configured";
|
|
73
|
+
dev_board_misconfigured: "dev_board_misconfigured";
|
|
74
|
+
internal_error: "internal_error";
|
|
75
|
+
}>;
|
|
76
|
+
exit_code: z.ZodUnion<readonly [z.ZodLiteral<0>, z.ZodLiteral<1>, z.ZodLiteral<2>, z.ZodLiteral<3>, z.ZodLiteral<130>]>;
|
|
77
|
+
retryable: z.ZodBoolean;
|
|
78
|
+
typical_http_status: z.ZodNullable<z.ZodNumber>;
|
|
79
|
+
}, z.core.$strict>>;
|
|
80
|
+
exit_codes: z.ZodArray<z.ZodObject<{
|
|
81
|
+
code: z.ZodNumber;
|
|
82
|
+
meaning: z.ZodString;
|
|
83
|
+
}, z.core.$strict>>;
|
|
84
|
+
}, z.core.$strict>;
|
|
85
|
+
export type SchemaOutput = z.infer<typeof schemaOutputSchema>;
|
|
86
|
+
declare const inputSchema: z.ZodObject<{
|
|
87
|
+
command: z.ZodOptional<z.ZodString>;
|
|
88
|
+
}, z.core.$strict>;
|
|
89
|
+
export interface BuildSchemaOptions {
|
|
90
|
+
readonly modules: readonly CommandModule[];
|
|
91
|
+
readonly apiVersion: string;
|
|
92
|
+
readonly cliVersion: string;
|
|
93
|
+
/** When set, narrow `commands` to just this dotted name. */
|
|
94
|
+
readonly only?: string;
|
|
95
|
+
}
|
|
96
|
+
/**
|
|
97
|
+
* Pure builder so unit tests can validate the emitted shape against
|
|
98
|
+
* a JSON Schema validator without spawning commander / running an
|
|
99
|
+
* envelope through emit.
|
|
100
|
+
*/
|
|
101
|
+
export declare const buildSchemaOutput: (options: BuildSchemaOptions) => SchemaOutput;
|
|
102
|
+
export declare const schemaCommand: CommandModule<z.infer<typeof inputSchema>, SchemaOutput>;
|
|
103
|
+
export {};
|
|
104
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/commands/schema/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA8BG;AACH,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AASxB,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,aAAa,CAAC;AAiDjD,eAAO,MAAM,kBAAkB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;kBASpB,CAAC;AAEZ,MAAM,MAAM,YAAY,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,kBAAkB,CAAC,CAAC;AAE9D,QAAA,MAAM,WAAW;;kBAIN,CAAC;AAUZ,MAAM,WAAW,kBAAkB;IACjC,QAAQ,CAAC,OAAO,EAAE,SAAS,aAAa,EAAE,CAAC;IAC3C,QAAQ,CAAC,UAAU,EAAE,MAAM,CAAC;IAC5B,QAAQ,CAAC,UAAU,EAAE,MAAM,CAAC;IAC5B,4DAA4D;IAC5D,QAAQ,CAAC,IAAI,CAAC,EAAE,MAAM,CAAC;CACxB;AAaD;;;;GAIG;AACH,eAAO,MAAM,iBAAiB,GAAI,SAAS,kBAAkB,KAAG,YAoC/D,CAAC;AAEF,eAAO,MAAM,aAAa,EAAE,aAAa,CACvC,CAAC,CAAC,KAAK,CAAC,OAAO,WAAW,CAAC,EAC3B,YAAY,CA0Cb,CAAC"}
|
|
@@ -0,0 +1,183 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* `monday schema [<command>]` — emits the CLI surface as JSON Schema
|
|
3
|
+
* 2020-12 (`cli-design.md` §11.1).
|
|
4
|
+
*
|
|
5
|
+
* Two consumers:
|
|
6
|
+
*
|
|
7
|
+
* - **Agents.** Ingest `monday schema --json` once per session;
|
|
8
|
+
* every command's input flags + output shape are described
|
|
9
|
+
* machine-readably. No `--help` scraping, no doc parsing,
|
|
10
|
+
* no English-message dependence. The error-code list is
|
|
11
|
+
* embedded so agents key off `code` against the same source
|
|
12
|
+
* of truth this CLI does.
|
|
13
|
+
*
|
|
14
|
+
* - **The CLI itself.** Every command's `outputSchema` is the
|
|
15
|
+
* same zod schema the `emitSuccess` drift-catch reads. The
|
|
16
|
+
* schema command and the runtime contract can never diverge
|
|
17
|
+
* because there's only one schema.
|
|
18
|
+
*
|
|
19
|
+
* `z.toJSONSchema` (zod v4 native) handles brand / refinement /
|
|
20
|
+
* coercion round-trips that earlier zod-to-JSON-Schema libs got
|
|
21
|
+
* wrong. Sharp-edge note: brands erase to their wrapped type in
|
|
22
|
+
* the JSON Schema output (a `BoardId` becomes a `string` with
|
|
23
|
+
* the regex), which is the right behaviour for an external
|
|
24
|
+
* consumer — they validate against the wire shape, not the brand.
|
|
25
|
+
*
|
|
26
|
+
* Idempotent: yes — pure read.
|
|
27
|
+
*
|
|
28
|
+
* The command lives at the top of the namespace (`monday schema`),
|
|
29
|
+
* not as a verb under a noun, because it describes the entire
|
|
30
|
+
* surface, not a Monday concept.
|
|
31
|
+
*/
|
|
32
|
+
import { z } from 'zod';
|
|
33
|
+
import { CODE_RETRYABLE_DEFAULT, CODE_TYPICAL_HTTP_STATUS, ERROR_CODES, exitCodeForError, UsageError, } from '../../utils/errors.js';
|
|
34
|
+
import { getCommandRegistry } from '../index.js';
|
|
35
|
+
import { emitSuccess } from '../emit.js';
|
|
36
|
+
const jsonSchemaSchema = z.unknown();
|
|
37
|
+
const commandEntrySchema = z
|
|
38
|
+
.object({
|
|
39
|
+
name: z.string().min(1),
|
|
40
|
+
summary: z.string().min(1),
|
|
41
|
+
examples: z.array(z.string()),
|
|
42
|
+
idempotent: z.boolean(),
|
|
43
|
+
input: jsonSchemaSchema,
|
|
44
|
+
output: jsonSchemaSchema,
|
|
45
|
+
})
|
|
46
|
+
.strict();
|
|
47
|
+
const errorCodeEntrySchema = z
|
|
48
|
+
.object({
|
|
49
|
+
code: z.enum(ERROR_CODES),
|
|
50
|
+
exit_code: z.union([
|
|
51
|
+
z.literal(0),
|
|
52
|
+
z.literal(1),
|
|
53
|
+
z.literal(2),
|
|
54
|
+
z.literal(3),
|
|
55
|
+
z.literal(130),
|
|
56
|
+
]),
|
|
57
|
+
/**
|
|
58
|
+
* Default retry policy per `cli-design.md` §6.5. Per-instance
|
|
59
|
+
* `error.retryable` may override (e.g. a Monday rate-limit
|
|
60
|
+
* response with a custom Retry-After) — agents check the live
|
|
61
|
+
* envelope first, fall back to this hint.
|
|
62
|
+
*/
|
|
63
|
+
retryable: z.boolean(),
|
|
64
|
+
/**
|
|
65
|
+
* Typical HTTP status when this code originates from Monday's
|
|
66
|
+
* API. `null` for codes with no fixed expectation (config /
|
|
67
|
+
* cache / usage failures, anything originating local).
|
|
68
|
+
*/
|
|
69
|
+
typical_http_status: z.number().int().nullable(),
|
|
70
|
+
})
|
|
71
|
+
.strict();
|
|
72
|
+
const exitCodeEntrySchema = z
|
|
73
|
+
.object({
|
|
74
|
+
code: z.number().int(),
|
|
75
|
+
meaning: z.string().min(1),
|
|
76
|
+
})
|
|
77
|
+
.strict();
|
|
78
|
+
export const schemaOutputSchema = z
|
|
79
|
+
.object({
|
|
80
|
+
schema_version: z.literal('1'),
|
|
81
|
+
api_version: z.string().min(1),
|
|
82
|
+
cli_version: z.string().min(1),
|
|
83
|
+
commands: z.record(z.string(), commandEntrySchema),
|
|
84
|
+
error_codes: z.array(errorCodeEntrySchema),
|
|
85
|
+
exit_codes: z.array(exitCodeEntrySchema),
|
|
86
|
+
})
|
|
87
|
+
.strict();
|
|
88
|
+
const inputSchema = z
|
|
89
|
+
.object({
|
|
90
|
+
command: z.string().min(1).optional(),
|
|
91
|
+
})
|
|
92
|
+
.strict();
|
|
93
|
+
const EXIT_CODES = [
|
|
94
|
+
{ code: 0, meaning: 'success' },
|
|
95
|
+
{ code: 1, meaning: 'usage error (bad flags, missing required args)' },
|
|
96
|
+
{ code: 2, meaning: 'API or local-resource error (network, cache, validation)' },
|
|
97
|
+
{ code: 3, meaning: 'config error (missing/invalid token)' },
|
|
98
|
+
{ code: 130, meaning: 'aborted by SIGINT' },
|
|
99
|
+
];
|
|
100
|
+
const toCommandEntry = (mod) => ({
|
|
101
|
+
name: mod.name,
|
|
102
|
+
summary: mod.summary,
|
|
103
|
+
examples: [...mod.examples],
|
|
104
|
+
idempotent: mod.idempotent,
|
|
105
|
+
input: z.toJSONSchema(mod.inputSchema),
|
|
106
|
+
output: z.toJSONSchema(mod.outputSchema),
|
|
107
|
+
});
|
|
108
|
+
/**
|
|
109
|
+
* Pure builder so unit tests can validate the emitted shape against
|
|
110
|
+
* a JSON Schema validator without spawning commander / running an
|
|
111
|
+
* envelope through emit.
|
|
112
|
+
*/
|
|
113
|
+
export const buildSchemaOutput = (options) => {
|
|
114
|
+
let modules;
|
|
115
|
+
if (options.only !== undefined) {
|
|
116
|
+
const found = options.modules.find((m) => m.name === options.only);
|
|
117
|
+
if (found === undefined) {
|
|
118
|
+
const available = options.modules.map((m) => m.name).sort();
|
|
119
|
+
throw new UsageError(`unknown command "${options.only}"`, {
|
|
120
|
+
details: { hint: 'see `monday schema` for the full list', available },
|
|
121
|
+
});
|
|
122
|
+
}
|
|
123
|
+
modules = [found];
|
|
124
|
+
}
|
|
125
|
+
else {
|
|
126
|
+
modules = options.modules;
|
|
127
|
+
}
|
|
128
|
+
// Lexicographic order so two runs in different registration order
|
|
129
|
+
// produce byte-equal output — agents diff `monday schema --json`
|
|
130
|
+
// across versions to spot contract changes.
|
|
131
|
+
const sorted = [...modules].sort((a, b) => a.name.localeCompare(b.name));
|
|
132
|
+
const commands = Object.fromEntries(sorted.map((m) => [m.name, toCommandEntry(m)]));
|
|
133
|
+
return {
|
|
134
|
+
schema_version: '1',
|
|
135
|
+
api_version: options.apiVersion,
|
|
136
|
+
cli_version: options.cliVersion,
|
|
137
|
+
commands,
|
|
138
|
+
error_codes: ERROR_CODES.map((code) => ({
|
|
139
|
+
code,
|
|
140
|
+
exit_code: exitCodeForError(code),
|
|
141
|
+
retryable: CODE_RETRYABLE_DEFAULT[code],
|
|
142
|
+
typical_http_status: CODE_TYPICAL_HTTP_STATUS[code],
|
|
143
|
+
})),
|
|
144
|
+
exit_codes: [...EXIT_CODES],
|
|
145
|
+
};
|
|
146
|
+
};
|
|
147
|
+
export const schemaCommand = {
|
|
148
|
+
name: 'schema',
|
|
149
|
+
summary: 'Emit the CLI command surface as JSON Schema 2020-12',
|
|
150
|
+
examples: [
|
|
151
|
+
'monday schema --json',
|
|
152
|
+
'monday schema config.show --json',
|
|
153
|
+
],
|
|
154
|
+
idempotent: true,
|
|
155
|
+
inputSchema,
|
|
156
|
+
outputSchema: schemaOutputSchema,
|
|
157
|
+
attach: (program, ctx) => {
|
|
158
|
+
program
|
|
159
|
+
.command('schema')
|
|
160
|
+
.argument('[command]', 'narrow output to a single command (dotted name, e.g. config.show)')
|
|
161
|
+
.description(schemaCommand.summary)
|
|
162
|
+
.addHelpText('after', ['', 'Examples:', ...schemaCommand.examples.map((e) => ` ${e}`), ''].join('\n'))
|
|
163
|
+
.action((commandArg, opts) => {
|
|
164
|
+
const parsed = schemaCommand.inputSchema.parse({
|
|
165
|
+
...(commandArg === undefined ? {} : { command: commandArg }),
|
|
166
|
+
...opts,
|
|
167
|
+
});
|
|
168
|
+
const data = buildSchemaOutput({
|
|
169
|
+
modules: getCommandRegistry(),
|
|
170
|
+
apiVersion: ctx.env.MONDAY_API_VERSION ?? '2026-01',
|
|
171
|
+
cliVersion: ctx.cliVersion,
|
|
172
|
+
...(parsed.command === undefined ? {} : { only: parsed.command }),
|
|
173
|
+
});
|
|
174
|
+
emitSuccess({
|
|
175
|
+
ctx,
|
|
176
|
+
data,
|
|
177
|
+
schema: schemaCommand.outputSchema,
|
|
178
|
+
programOpts: program.opts(),
|
|
179
|
+
});
|
|
180
|
+
});
|
|
181
|
+
},
|
|
182
|
+
};
|
|
183
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/commands/schema/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA8BG;AACH,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AACxB,OAAO,EACL,sBAAsB,EACtB,wBAAwB,EACxB,WAAW,EACX,gBAAgB,EAChB,UAAU,GACX,MAAM,uBAAuB,CAAC;AAC/B,OAAO,EAAE,kBAAkB,EAAE,MAAM,aAAa,CAAC;AAEjD,OAAO,EAAE,WAAW,EAAE,MAAM,YAAY,CAAC;AAEzC,MAAM,gBAAgB,GAAc,CAAC,CAAC,OAAO,EAAE,CAAC;AAEhD,MAAM,kBAAkB,GAAG,CAAC;KACzB,MAAM,CAAC;IACN,IAAI,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,GAAG,CAAC,CAAC,CAAC;IACvB,OAAO,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,GAAG,CAAC,CAAC,CAAC;IAC1B,QAAQ,EAAE,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,MAAM,EAAE,CAAC;IAC7B,UAAU,EAAE,CAAC,CAAC,OAAO,EAAE;IACvB,KAAK,EAAE,gBAAgB;IACvB,MAAM,EAAE,gBAAgB;CACzB,CAAC;KACD,MAAM,EAAE,CAAC;AAEZ,MAAM,oBAAoB,GAAG,CAAC;KAC3B,MAAM,CAAC;IACN,IAAI,EAAE,CAA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CAAC;gBACV,GAAG;gBACH,IAAI;gBACJ,MAAM,EAAE,aAAa,CAAC,YAAY;gBAClC,WAAW,EAAE,OAAO,CAAC,IAAI,EAAE;aAC5B,CAAC,CAAC;QACL,CAAC,CAAC,CAAC;IACP,CAAC;CACF,CAAC"}
|
|
@@ -0,0 +1,66 @@
|
|
|
1
|
+
import type { Command } from 'commander';
|
|
2
|
+
import type { z } from 'zod';
|
|
3
|
+
import type { RunContext } from '../cli/run.js';
|
|
4
|
+
/**
|
|
5
|
+
* A registered CLI command (`v0.1-plan.md` §4 DoD #2).
|
|
6
|
+
*
|
|
7
|
+
* Every command — top-level (`schema`) or noun-verb (`config show`)
|
|
8
|
+
* — exports one of these. The static `commandRegistry`
|
|
9
|
+
* (`src/commands/index.ts`) collects them; `run()` walks the registry
|
|
10
|
+
* once per invocation to wire commander, and `monday schema` walks
|
|
11
|
+
* the same registry to emit JSON Schema.
|
|
12
|
+
*
|
|
13
|
+
* The contract is:
|
|
14
|
+
*
|
|
15
|
+
* - `name` is the dotted path from `monday`: `"config.show"`,
|
|
16
|
+
* `"cache.clear"`, `"schema"`. Used as the JSON Schema key and the
|
|
17
|
+
* `monday schema <command>` argument.
|
|
18
|
+
* - `inputSchema` validates the parsed argv at the action boundary
|
|
19
|
+
* (per `validation.md` "parse, don't validate"). It's the source
|
|
20
|
+
* of truth for `monday schema`'s input description.
|
|
21
|
+
* - `outputSchema` describes the `data` payload the success envelope
|
|
22
|
+
* will carry — it's executable, so the integration tests can
|
|
23
|
+
* `outputSchema.parse(data)` to catch drift, and `monday schema`
|
|
24
|
+
* emits it via `z.toJSONSchema`.
|
|
25
|
+
* - `attach(program, ctx)` wires the command onto commander. It owns
|
|
26
|
+
* parent-noun creation (`ensureSubcommand`), positional / flag
|
|
27
|
+
* declarations, the `addHelpText('after', ...)` example, and the
|
|
28
|
+
* action body. The action: parses argv via `inputSchema`, calls
|
|
29
|
+
* the command's logic, validates via `outputSchema`, and emits
|
|
30
|
+
* via `emitSuccess`.
|
|
31
|
+
*
|
|
32
|
+
* Why a generic interface and not a concrete class: per-command
|
|
33
|
+
* differences (positional vs flag-only, single-resource vs
|
|
34
|
+
* collection, accepts-stdin or not) are best captured as code in
|
|
35
|
+
* `attach` rather than ferried through shared options that grow
|
|
36
|
+
* unbounded as the surface expands.
|
|
37
|
+
*/
|
|
38
|
+
export interface CommandModule<I = unknown, O = unknown> {
|
|
39
|
+
readonly name: string;
|
|
40
|
+
/** One-line summary used as `description()` on commander. */
|
|
41
|
+
readonly summary: string;
|
|
42
|
+
/**
|
|
43
|
+
* Usage examples emitted via `addHelpText('after', ...)`. Per the
|
|
44
|
+
* `cli.md` rule, every command has at least one. Lines should
|
|
45
|
+
* start with `monday <cmd>` (no `$` prefix — the dollar-sign hurts
|
|
46
|
+
* copy-paste).
|
|
47
|
+
*/
|
|
48
|
+
readonly examples: readonly string[];
|
|
49
|
+
/**
|
|
50
|
+
* Documented per command (`v0.1-plan.md` §4 DoD #6). Read-only
|
|
51
|
+
* commands are trivially idempotent; mutations document explicitly
|
|
52
|
+
* whether re-running with the same args is safe.
|
|
53
|
+
*/
|
|
54
|
+
readonly idempotent: boolean;
|
|
55
|
+
readonly inputSchema: z.ZodType<I>;
|
|
56
|
+
readonly outputSchema: z.ZodType<O>;
|
|
57
|
+
readonly attach: (program: Command, ctx: RunContext) => void;
|
|
58
|
+
}
|
|
59
|
+
/**
|
|
60
|
+
* Idempotently finds-or-creates a noun-level command on `program`.
|
|
61
|
+
* Multiple verb commands share the same parent (`monday config show`,
|
|
62
|
+
* `monday config path`); each `attach` calls this so the parent is
|
|
63
|
+
* registered exactly once regardless of registration order.
|
|
64
|
+
*/
|
|
65
|
+
export declare const ensureSubcommand: (program: Command, name: string, summary: string) => Command;
|
|
66
|
+
//# sourceMappingURL=types.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../src/commands/types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AACzC,OAAO,KAAK,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAC7B,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,eAAe,CAAC;AAEhD;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAiCG;AACH,MAAM,WAAW,aAAa,CAAC,CAAC,GAAG,OAAO,EAAE,CAAC,GAAG,OAAO;IACrD,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC;IACtB,6DAA6D;IAC7D,QAAQ,CAAC,OAAO,EAAE,MAAM,CAAC;IACzB;;;;;OAKG;IACH,QAAQ,CAAC,QAAQ,EAAE,SAAS,MAAM,EAAE,CAAC;IACrC;;;;OAIG;IACH,QAAQ,CAAC,UAAU,EAAE,OAAO,CAAC;IAC7B,QAAQ,CAAC,WAAW,EAAE,CAAC,CAAC,OAAO,CAAC,CAAC,CAAC,CAAC;IACnC,QAAQ,CAAC,YAAY,EAAE,CAAC,CAAC,OAAO,CAAC,CAAC,CAAC,CAAC;IACpC,QAAQ,CAAC,MAAM,EAAE,CAAC,OAAO,EAAE,OAAO,EAAE,GAAG,EAAE,UAAU,KAAK,IAAI,CAAC;CAC9D;AAED;;;;;GAKG;AACH,eAAO,MAAM,gBAAgB,GAC3B,SAAS,OAAO,EAChB,MAAM,MAAM,EACZ,SAAS,MAAM,KACd,OAOF,CAAC"}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Idempotently finds-or-creates a noun-level command on `program`.
|
|
3
|
+
* Multiple verb commands share the same parent (`monday config show`,
|
|
4
|
+
* `monday config path`); each `attach` calls this so the parent is
|
|
5
|
+
* registered exactly once regardless of registration order.
|
|
6
|
+
*/
|
|
7
|
+
export const ensureSubcommand = (program, name, summary) => {
|
|
8
|
+
const existing = program.commands.find((c) => c.name() === name);
|
|
9
|
+
if (existing !== undefined) {
|
|
10
|
+
return existing;
|
|
11
|
+
}
|
|
12
|
+
const child = program.command(name).description(summary);
|
|
13
|
+
return child;
|
|
14
|
+
};
|
|
15
|
+
//# sourceMappingURL=types.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"types.js","sourceRoot":"","sources":["../../src/commands/types.ts"],"names":[],"mappings":"AA4DA;;;;;GAKG;AACH,MAAM,CAAC,MAAM,gBAAgB,GAAG,CAC9B,OAAgB,EAChB,IAAY,EACZ,OAAe,EACN,EAAE;IACX,MAAM,QAAQ,GAAG,OAAO,CAAC,QAAQ,CAAC,IAAI,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,IAAI,EAAE,KAAK,IAAI,CAAC,CAAC;IACjE,IAAI,QAAQ,KAAK,SAAS,EAAE,CAAC;QAC3B,OAAO,QAAQ,CAAC;IAClB,CAAC;IACD,MAAM,KAAK,GAAG,OAAO,CAAC,OAAO,CAAC,IAAI,CAAC,CAAC,WAAW,CAAC,OAAO,CAAC,CAAC;IACzD,OAAO,KAAK,CAAC;AACf,CAAC,CAAC"}
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Shared body-source resolver for the comment-cluster verbs (`update
|
|
3
|
+
* create` / `update reply` / `update edit`). Lifted out of M5b's
|
|
4
|
+
* `update create` when the third consumer arrived — `update edit`
|
|
5
|
+
* (M13) — per the v0.1-plan §17 R-timing rule ("lift on the third
|
|
6
|
+
* consumer").
|
|
7
|
+
*
|
|
8
|
+
* Reads the markdown body from one of the three accepted sources:
|
|
9
|
+
*
|
|
10
|
+
* 1. `--body <md>` (`inlineBody`) — inline.
|
|
11
|
+
* 2. `--body-file <path>` (`bodyFile`) — from disk.
|
|
12
|
+
* 3. `--body-file -` — from stdin (`ctx.stdin`).
|
|
13
|
+
*
|
|
14
|
+
* Throws `usage_error` for:
|
|
15
|
+
* - Both `--body` and `--body-file` set (mutually exclusive).
|
|
16
|
+
* - Neither set (no source).
|
|
17
|
+
* - `--body-file -` with no `ctx.stdin` available (programmer
|
|
18
|
+
* wiring bug; should not happen via the binary).
|
|
19
|
+
* - Empty (or whitespace-only) result after read (Monday rejects
|
|
20
|
+
* empty body strings; surface up-front rather than wait for
|
|
21
|
+
* `validation_failed`).
|
|
22
|
+
*/
|
|
23
|
+
export interface ReadBodyInputs {
|
|
24
|
+
/** `--body <md>` value (per-command flag). */
|
|
25
|
+
readonly inlineBody: string | undefined;
|
|
26
|
+
/** `--body-file <path>` value (global flag — see `types/global-flags.ts`). */
|
|
27
|
+
readonly bodyFile: string | undefined;
|
|
28
|
+
/** `ctx.stdin` from the runner — needed for `--body-file -`. */
|
|
29
|
+
readonly stdin: NodeJS.ReadableStream | undefined;
|
|
30
|
+
/**
|
|
31
|
+
* Verb name for the "no source" error message (e.g. "monday update
|
|
32
|
+
* reply requires either --body <md> or ..."). Defaults to a generic
|
|
33
|
+
* phrasing if omitted.
|
|
34
|
+
*/
|
|
35
|
+
readonly verbHint?: string;
|
|
36
|
+
}
|
|
37
|
+
export declare const readUpdateBody: (inputs: ReadBodyInputs) => Promise<string>;
|
|
38
|
+
//# sourceMappingURL=body-source.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"body-source.d.ts","sourceRoot":"","sources":["../../../src/commands/update/body-source.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;GAqBG;AAKH,MAAM,WAAW,cAAc;IAC7B,8CAA8C;IAC9C,QAAQ,CAAC,UAAU,EAAE,MAAM,GAAG,SAAS,CAAC;IACxC,8EAA8E;IAC9E,QAAQ,CAAC,QAAQ,EAAE,MAAM,GAAG,SAAS,CAAC;IACtC,gEAAgE;IAChE,QAAQ,CAAC,KAAK,EAAE,MAAM,CAAC,cAAc,GAAG,SAAS,CAAC;IAClD;;;;OAIG;IACH,QAAQ,CAAC,QAAQ,CAAC,EAAE,MAAM,CAAC;CAC5B;AAMD,eAAO,MAAM,cAAc,GACzB,QAAQ,cAAc,KACrB,OAAO,CAAC,MAAM,CAuEhB,CAAC"}
|
|
@@ -0,0 +1,80 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Shared body-source resolver for the comment-cluster verbs (`update
|
|
3
|
+
* create` / `update reply` / `update edit`). Lifted out of M5b's
|
|
4
|
+
* `update create` when the third consumer arrived — `update edit`
|
|
5
|
+
* (M13) — per the v0.1-plan §17 R-timing rule ("lift on the third
|
|
6
|
+
* consumer").
|
|
7
|
+
*
|
|
8
|
+
* Reads the markdown body from one of the three accepted sources:
|
|
9
|
+
*
|
|
10
|
+
* 1. `--body <md>` (`inlineBody`) — inline.
|
|
11
|
+
* 2. `--body-file <path>` (`bodyFile`) — from disk.
|
|
12
|
+
* 3. `--body-file -` — from stdin (`ctx.stdin`).
|
|
13
|
+
*
|
|
14
|
+
* Throws `usage_error` for:
|
|
15
|
+
* - Both `--body` and `--body-file` set (mutually exclusive).
|
|
16
|
+
* - Neither set (no source).
|
|
17
|
+
* - `--body-file -` with no `ctx.stdin` available (programmer
|
|
18
|
+
* wiring bug; should not happen via the binary).
|
|
19
|
+
* - Empty (or whitespace-only) result after read (Monday rejects
|
|
20
|
+
* empty body strings; surface up-front rather than wait for
|
|
21
|
+
* `validation_failed`).
|
|
22
|
+
*/
|
|
23
|
+
import { readFile } from 'node:fs/promises';
|
|
24
|
+
import { UsageError } from '../../utils/errors.js';
|
|
25
|
+
const DEFAULT_NO_SOURCE_VERB = 'monday update create / reply / edit requires either --body <md> or ' +
|
|
26
|
+
'--body-file <path>. Use --body-file - to read from stdin.';
|
|
27
|
+
export const readUpdateBody = async (inputs) => {
|
|
28
|
+
const { inlineBody, bodyFile, stdin } = inputs;
|
|
29
|
+
const verbHint = inputs.verbHint ?? DEFAULT_NO_SOURCE_VERB;
|
|
30
|
+
if (inlineBody !== undefined && bodyFile !== undefined) {
|
|
31
|
+
throw new UsageError('--body and --body-file are mutually exclusive; pick one.', { details: { has_inline_body: true, body_file: bodyFile } });
|
|
32
|
+
}
|
|
33
|
+
if (inlineBody !== undefined) {
|
|
34
|
+
if (inlineBody.trim().length === 0) {
|
|
35
|
+
// Empty-after-trim must reject too — `--body " "` shouldn't
|
|
36
|
+
// sneak past and surface as Monday's `validation_failed`
|
|
37
|
+
// post-mutation. Same trim policy the file / stdin branches
|
|
38
|
+
// apply.
|
|
39
|
+
throw new UsageError('--body cannot be empty (or whitespace-only). Pass markdown ' +
|
|
40
|
+
'content or use --body-file <path> to read from disk / stdin.');
|
|
41
|
+
}
|
|
42
|
+
return inlineBody;
|
|
43
|
+
}
|
|
44
|
+
if (bodyFile === undefined) {
|
|
45
|
+
throw new UsageError(verbHint);
|
|
46
|
+
}
|
|
47
|
+
if (bodyFile === '-') {
|
|
48
|
+
if (stdin === undefined) {
|
|
49
|
+
throw new UsageError('--body-file - requested stdin, but no stdin is wired into ' +
|
|
50
|
+
'the runner. This is a programmer wiring bug.');
|
|
51
|
+
}
|
|
52
|
+
const chunks = [];
|
|
53
|
+
for await (const chunk of stdin) {
|
|
54
|
+
chunks.push(Buffer.from(chunk));
|
|
55
|
+
}
|
|
56
|
+
const body = Buffer.concat(chunks).toString('utf8').trimEnd();
|
|
57
|
+
if (body.length === 0) {
|
|
58
|
+
throw new UsageError('stdin produced an empty body. Pipe non-empty content into ' +
|
|
59
|
+
'--body-file - or pass --body <md> inline.', { details: { body_file: '-' } });
|
|
60
|
+
}
|
|
61
|
+
return body;
|
|
62
|
+
}
|
|
63
|
+
// File on disk. UTF-8 always; binary content would corrupt the
|
|
64
|
+
// markdown anyway. Trim trailing whitespace so a trailing newline
|
|
65
|
+
// from `cat foo.md` doesn't surface as a literal `\n` in the
|
|
66
|
+
// posted comment.
|
|
67
|
+
const raw = await readFile(bodyFile, 'utf8').catch((err) => {
|
|
68
|
+
throw new UsageError(`--body-file: failed to read ${JSON.stringify(bodyFile)} (${err instanceof Error ? err.message : String(err)}).`, {
|
|
69
|
+
cause: err,
|
|
70
|
+
details: { body_file: bodyFile },
|
|
71
|
+
});
|
|
72
|
+
});
|
|
73
|
+
const body = raw.trimEnd();
|
|
74
|
+
if (body.length === 0) {
|
|
75
|
+
throw new UsageError(`--body-file: ${JSON.stringify(bodyFile)} is empty (after trim). ` +
|
|
76
|
+
`Monday rejects empty comment bodies.`, { details: { body_file: bodyFile } });
|
|
77
|
+
}
|
|
78
|
+
return body;
|
|
79
|
+
};
|
|
80
|
+
//# sourceMappingURL=body-source.js.map
|