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,748 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* `monday item clear` — column-clear with single-item + bulk shapes.
|
|
3
|
+
* (cli-design.md §4.3 line 489 + §10.2; v0.1-plan.md §3 M5b for the
|
|
4
|
+
* single-item path, v0.2-plan.md §3 M12 for bulk `--where`).
|
|
5
|
+
*
|
|
6
|
+
* The dedicated "clear" verb. Per cli-design §5.3 step 3 + the
|
|
7
|
+
* dropdown empty-input rejection in `column-values.ts`, `--set X=`
|
|
8
|
+
* does NOT mean "clear" — it means "set to the empty-string value"
|
|
9
|
+
* which is type-dependent (e.g. `{label: ""}` for status). The
|
|
10
|
+
* dedicated verb is the documented escape and produces the per-type
|
|
11
|
+
* "clear" wire payload:
|
|
12
|
+
*
|
|
13
|
+
* - `text` / `long_text` / `numbers` → simple bare empty string
|
|
14
|
+
* (`change_simple_column_value(value: "")`).
|
|
15
|
+
* - `status` / `dropdown` / `date` / `people` → empty JSON object
|
|
16
|
+
* `{}` via `change_column_value(value: JSON!)`. Monday's
|
|
17
|
+
* "clear all column values" pattern.
|
|
18
|
+
*
|
|
19
|
+
* Two argv shapes:
|
|
20
|
+
*
|
|
21
|
+
* 1. **Single-item** (M5b): `monday item clear <iid> <col>
|
|
22
|
+
* [--board <bid>]`. Positional `<iid>` plus required `<col>`.
|
|
23
|
+
* `--board` skips the implicit item-board lookup.
|
|
24
|
+
*
|
|
25
|
+
* 2. **Bulk** (M12): `monday item clear --board <bid> <col>
|
|
26
|
+
* (--where <c>=<v>... | --filter-json <json>) [--yes]
|
|
27
|
+
* [--dry-run]`. No positional `<iid>` — page-walks `items_page`
|
|
28
|
+
* with the supplied filter and clears the named column on every
|
|
29
|
+
* matched item. Mirrors `item update --where`'s shape: bulk
|
|
30
|
+
* mutations without `--yes` (and without `--dry-run`) surface
|
|
31
|
+
* `confirmation_required` per cli-design §10.2.
|
|
32
|
+
*
|
|
33
|
+
* **Two paths.** `--dry-run` orchestrates `api/dry-run.ts planClear`
|
|
34
|
+
* (single-token shape — symmetric with planChanges' multi-token shape
|
|
35
|
+
* but one token in / one PlannedChange out). Live writes resolve the
|
|
36
|
+
* column + build the clear payload + select the mutation + fire.
|
|
37
|
+
*
|
|
38
|
+
* **Resolver-warning preservation + cache-stale archived remap.**
|
|
39
|
+
* Identical pattern to `item set` (R19 lift) — translator failures
|
|
40
|
+
* and live `validation_failed` after cache-sourced resolution flow
|
|
41
|
+
* through `foldResolverWarningsIntoError` +
|
|
42
|
+
* `maybeRemapValidationFailedToArchived`. clear has no value-side
|
|
43
|
+
* translator (the payload is `""` / `{}` per type, no user-supplied
|
|
44
|
+
* value to interpret), so the only typed failure path on the live
|
|
45
|
+
* side is Monday's mutation-time rejection — which still benefits
|
|
46
|
+
* from the F4 cache-archived remap.
|
|
47
|
+
*
|
|
48
|
+
* Idempotent: yes — clearing an already-empty cell is a no-op write.
|
|
49
|
+
*/
|
|
50
|
+
import { z } from 'zod';
|
|
51
|
+
import { ensureSubcommand } from '../types.js';
|
|
52
|
+
import { emitDryRun, emitMutation } from '../emit.js';
|
|
53
|
+
import { resolveClient } from '../../api/resolve-client.js';
|
|
54
|
+
import { BoardIdSchema, ItemIdSchema } from '../../types/ids.js';
|
|
55
|
+
import { parseArgv } from '../parse-argv.js';
|
|
56
|
+
import { ApiError, ConfirmationRequiredError, MondayCliError, UsageError, } from '../../utils/errors.js';
|
|
57
|
+
import { resolveColumnWithRefresh, } from '../../api/columns.js';
|
|
58
|
+
import { selectMutation, translateColumnClear, } from '../../api/column-values.js';
|
|
59
|
+
import { foldAndRemap, foldResolverWarningsIntoError, } from '../../api/resolver-error-fold.js';
|
|
60
|
+
import { planClear } from '../../api/dry-run.js';
|
|
61
|
+
import { resolveBoardId } from '../../api/item-board-lookup.js';
|
|
62
|
+
import { buildColumnArchivedError } from '../../api/resolution-pass.js';
|
|
63
|
+
import { ITEM_FIELDS_FRAGMENT, resolveMeFactory } from '../../api/item-helpers.js';
|
|
64
|
+
import { projectMutationItem as projectMutationItemShared } from '../../api/item-mutation-result.js';
|
|
65
|
+
import { projectedItemSchema, } from '../../api/item-projection.js';
|
|
66
|
+
import { SourceAggregator } from '../../api/source-aggregator.js';
|
|
67
|
+
import { buildQueryParams } from '../../api/filters.js';
|
|
68
|
+
import { loadBoardMetadata, refreshBoardMetadata, } from '../../api/board-metadata.js';
|
|
69
|
+
import { DEFAULT_PAGE_SIZE, paginate, } from '../../api/pagination.js';
|
|
70
|
+
import { fetchItemsPage, fetchNextItemsPage, } from '../../api/items-page-walker.js';
|
|
71
|
+
// Same GraphQL surface as item set (cli-design §5.3 step 5).
|
|
72
|
+
// Operation names diverge (`ItemClearSimple` / `ItemClearRich`) so
|
|
73
|
+
// fixture cassettes + Monday's request-log telemetry can distinguish
|
|
74
|
+
// the source verb. The mutation bodies themselves are identical
|
|
75
|
+
// because Monday's `change_simple_column_value` /
|
|
76
|
+
// `change_column_value` accept the same arguments regardless of
|
|
77
|
+
// which CLI verb originated the call.
|
|
78
|
+
const CHANGE_SIMPLE_COLUMN_VALUE_MUTATION = `
|
|
79
|
+
mutation ItemClearSimple(
|
|
80
|
+
$itemId: ID!
|
|
81
|
+
$boardId: ID!
|
|
82
|
+
$columnId: String!
|
|
83
|
+
$value: String!
|
|
84
|
+
) {
|
|
85
|
+
change_simple_column_value(
|
|
86
|
+
item_id: $itemId
|
|
87
|
+
board_id: $boardId
|
|
88
|
+
column_id: $columnId
|
|
89
|
+
value: $value
|
|
90
|
+
) {
|
|
91
|
+
${ITEM_FIELDS_FRAGMENT}
|
|
92
|
+
}
|
|
93
|
+
}
|
|
94
|
+
`;
|
|
95
|
+
const CHANGE_COLUMN_VALUE_MUTATION = `
|
|
96
|
+
mutation ItemClearRich(
|
|
97
|
+
$itemId: ID!
|
|
98
|
+
$boardId: ID!
|
|
99
|
+
$columnId: String!
|
|
100
|
+
$value: JSON!
|
|
101
|
+
) {
|
|
102
|
+
change_column_value(
|
|
103
|
+
item_id: $itemId
|
|
104
|
+
board_id: $boardId
|
|
105
|
+
column_id: $columnId
|
|
106
|
+
value: $value
|
|
107
|
+
) {
|
|
108
|
+
${ITEM_FIELDS_FRAGMENT}
|
|
109
|
+
}
|
|
110
|
+
}
|
|
111
|
+
`;
|
|
112
|
+
/**
|
|
113
|
+
* Wrapped data shape for the bulk-clear-live success envelope. Same
|
|
114
|
+
* shape `item update --where` ships — `summary` carries
|
|
115
|
+
* `matched_count` / `applied_count` / `board_id`; `items` is the
|
|
116
|
+
* per-item projected list. Defined here at module top so it's
|
|
117
|
+
* available to the union output schema below.
|
|
118
|
+
*/
|
|
119
|
+
const bulkLiveDataSchema = z.object({
|
|
120
|
+
summary: z.object({
|
|
121
|
+
matched_count: z.number().int().nonnegative(),
|
|
122
|
+
applied_count: z.number().int().nonnegative(),
|
|
123
|
+
board_id: z.string(),
|
|
124
|
+
}),
|
|
125
|
+
items: z.array(projectedItemSchema),
|
|
126
|
+
});
|
|
127
|
+
/**
|
|
128
|
+
* `item clear`'s `data` is a discriminated union — single-item path
|
|
129
|
+
* emits the §6.2 projected item; bulk path emits `{summary, items}`.
|
|
130
|
+
* `monday schema item.clear` reads this schema, so agents can plan
|
|
131
|
+
* against either shape without surprises (Codex round-1 F4 — pre-fix
|
|
132
|
+
* the schema only described the single-item shape, leaving the bulk
|
|
133
|
+
* surface invisible to schema-driven agents).
|
|
134
|
+
*/
|
|
135
|
+
export const itemClearOutputSchema = z.union([
|
|
136
|
+
projectedItemSchema,
|
|
137
|
+
bulkLiveDataSchema,
|
|
138
|
+
]);
|
|
139
|
+
/**
|
|
140
|
+
* Input shape — supports both single-item and bulk shapes.
|
|
141
|
+
*
|
|
142
|
+
* - Single-item: `itemId` positional required; `where` empty.
|
|
143
|
+
* - Bulk: `itemId` positional omitted; `where` non-empty
|
|
144
|
+
* AND `board` required.
|
|
145
|
+
*
|
|
146
|
+
* Schema accepts both shapes; the dispatch lives in
|
|
147
|
+
* `validateInputShape` below so the action layer reads the
|
|
148
|
+
* discriminator and dispatches.
|
|
149
|
+
*/
|
|
150
|
+
const inputSchema = z
|
|
151
|
+
.object({
|
|
152
|
+
itemId: ItemIdSchema.optional(),
|
|
153
|
+
column: z.string().min(1),
|
|
154
|
+
board: BoardIdSchema.optional(),
|
|
155
|
+
where: z.array(z.string()).default([]),
|
|
156
|
+
// Empty `--filter-json ''` would slip through `buildQueryParams`
|
|
157
|
+
// as "no filter" while still tripping `validateInputShape`'s "bulk
|
|
158
|
+
// mode" discriminator (`filterJson !== undefined`) — net effect, a
|
|
159
|
+
// whole-board clear an agent likely thought was filtered. Reject
|
|
160
|
+
// at the schema boundary so no network call fires. Same pattern
|
|
161
|
+
// M5b's bulk `item update` ships.
|
|
162
|
+
filterJson: z
|
|
163
|
+
.string()
|
|
164
|
+
.refine((s) => s.trim().length > 0, '--filter-json must be a non-empty JSON object')
|
|
165
|
+
.optional(),
|
|
166
|
+
})
|
|
167
|
+
.strict();
|
|
168
|
+
const validateInputShape = (parsed) => {
|
|
169
|
+
const hasItemId = parsed.itemId !== undefined;
|
|
170
|
+
const hasFilter = parsed.where.length > 0 || parsed.filterJson !== undefined;
|
|
171
|
+
if (hasItemId && hasFilter) {
|
|
172
|
+
throw new UsageError('item clear accepts either a positional <itemId> OR --where / ' +
|
|
173
|
+
'--filter-json (bulk shape), not both. Pick one.', {
|
|
174
|
+
details: {
|
|
175
|
+
item_id: parsed.itemId,
|
|
176
|
+
where_count: parsed.where.length,
|
|
177
|
+
...(parsed.filterJson === undefined
|
|
178
|
+
? {}
|
|
179
|
+
: { filter_json: parsed.filterJson }),
|
|
180
|
+
},
|
|
181
|
+
});
|
|
182
|
+
}
|
|
183
|
+
if (!hasItemId && !hasFilter) {
|
|
184
|
+
throw new UsageError('item clear requires either a positional <itemId> or --where / ' +
|
|
185
|
+
'--filter-json for the bulk shape.', { details: {} });
|
|
186
|
+
}
|
|
187
|
+
if (hasFilter && parsed.board === undefined) {
|
|
188
|
+
throw new UsageError('item clear --where / --filter-json requires --board <bid>. The ' +
|
|
189
|
+
'bulk shape walks Monday\'s items_page on the named board.', { details: { where_count: parsed.where.length } });
|
|
190
|
+
}
|
|
191
|
+
if (hasItemId) {
|
|
192
|
+
/* c8 ignore next 4 — defensive: hasItemId === true means
|
|
193
|
+
parsed.itemId is non-undefined; the type guard exists for TS. */
|
|
194
|
+
if (parsed.itemId === undefined) {
|
|
195
|
+
throw new UsageError('item clear: itemId narrowing failed');
|
|
196
|
+
}
|
|
197
|
+
return { kind: 'single', itemId: parsed.itemId };
|
|
198
|
+
}
|
|
199
|
+
return { kind: 'bulk' };
|
|
200
|
+
};
|
|
201
|
+
export const itemClearCommand = {
|
|
202
|
+
name: 'item.clear',
|
|
203
|
+
summary: 'Clear a column value on an item (single or bulk via --where)',
|
|
204
|
+
examples: [
|
|
205
|
+
'monday item clear 12345 status',
|
|
206
|
+
'monday item clear 12345 status --board 67890',
|
|
207
|
+
'monday item clear 12345 due --dry-run',
|
|
208
|
+
"monday item clear status --board 67890 --where 'status=Done' --yes",
|
|
209
|
+
"monday item clear status --board 67890 --where 'status=Done' --dry-run",
|
|
210
|
+
],
|
|
211
|
+
idempotent: true,
|
|
212
|
+
inputSchema,
|
|
213
|
+
outputSchema: itemClearOutputSchema,
|
|
214
|
+
attach: (program, ctx) => {
|
|
215
|
+
const noun = ensureSubcommand(program, 'item', 'Item commands');
|
|
216
|
+
noun
|
|
217
|
+
// Two-positional declaration with the second optional. When
|
|
218
|
+
// both are present, the first is the itemId and the second is
|
|
219
|
+
// the column (single-item shape). When only one is present,
|
|
220
|
+
// it's the column (bulk shape; --board + --where required).
|
|
221
|
+
// The action body normalises the positionals before dispatch.
|
|
222
|
+
.command('clear <arg1> [arg2]')
|
|
223
|
+
.description(itemClearCommand.summary)
|
|
224
|
+
.option('--board <bid>', 'board ID (required for bulk; skip lookup for single-item)')
|
|
225
|
+
.option('--where <expr>', 'repeatable bulk filter (cli-design §10.2): <col><op><val>', (value, prev) => [...prev, value], [])
|
|
226
|
+
.option('--filter-json <json>', 'literal Monday query_params for bulk')
|
|
227
|
+
.addHelpText('after', ['', 'Examples:', ...itemClearCommand.examples.map((e) => ` ${e}`), ''].join('\n'))
|
|
228
|
+
.action(async (arg1, arg2, opts) => {
|
|
229
|
+
// Normalise positionals: one positional → bulk shape
|
|
230
|
+
// (arg1=column); two positionals → single-item shape
|
|
231
|
+
// (arg1=itemId, arg2=column). Defer empty / type checks to
|
|
232
|
+
// zod by passing through verbatim.
|
|
233
|
+
const positional = arg2 === undefined
|
|
234
|
+
? { itemId: undefined, column: arg1 }
|
|
235
|
+
: { itemId: arg1, column: arg2 };
|
|
236
|
+
const parsed = parseArgv(itemClearCommand.inputSchema, {
|
|
237
|
+
...(positional.itemId === undefined
|
|
238
|
+
? {}
|
|
239
|
+
: { itemId: positional.itemId }),
|
|
240
|
+
column: positional.column,
|
|
241
|
+
...opts,
|
|
242
|
+
});
|
|
243
|
+
const { client, globalFlags, apiVersion, toEmit } = resolveClient(ctx, program.opts());
|
|
244
|
+
const dispatch = validateInputShape(parsed);
|
|
245
|
+
if (dispatch.kind === 'bulk') {
|
|
246
|
+
await runBulk({
|
|
247
|
+
parsed,
|
|
248
|
+
client,
|
|
249
|
+
globalFlags,
|
|
250
|
+
apiVersion,
|
|
251
|
+
ctx,
|
|
252
|
+
programOpts: program.opts(),
|
|
253
|
+
});
|
|
254
|
+
return;
|
|
255
|
+
}
|
|
256
|
+
const boardId = await resolveBoardId({
|
|
257
|
+
client,
|
|
258
|
+
itemId: dispatch.itemId,
|
|
259
|
+
explicit: parsed.board,
|
|
260
|
+
});
|
|
261
|
+
if (globalFlags.dryRun) {
|
|
262
|
+
const result = await planClear({
|
|
263
|
+
client,
|
|
264
|
+
boardId,
|
|
265
|
+
itemId: dispatch.itemId,
|
|
266
|
+
token: parsed.column,
|
|
267
|
+
env: ctx.env,
|
|
268
|
+
noCache: globalFlags.noCache,
|
|
269
|
+
});
|
|
270
|
+
emitDryRun({
|
|
271
|
+
ctx,
|
|
272
|
+
programOpts: program.opts(),
|
|
273
|
+
plannedChanges: result.plannedChanges,
|
|
274
|
+
source: result.source,
|
|
275
|
+
cacheAgeSeconds: result.cacheAgeSeconds,
|
|
276
|
+
warnings: result.warnings,
|
|
277
|
+
apiVersion,
|
|
278
|
+
});
|
|
279
|
+
return;
|
|
280
|
+
}
|
|
281
|
+
// Live clear path. Resolution + clear-payload build + mutation.
|
|
282
|
+
const resolution = await resolveColumnWithRefresh({
|
|
283
|
+
client,
|
|
284
|
+
boardId,
|
|
285
|
+
token: parsed.column,
|
|
286
|
+
includeArchived: true,
|
|
287
|
+
env: ctx.env,
|
|
288
|
+
noCache: globalFlags.noCache,
|
|
289
|
+
});
|
|
290
|
+
const resolverWarnings = resolution.warnings;
|
|
291
|
+
if (resolution.match.column.archived === true) {
|
|
292
|
+
throw foldResolverWarningsIntoError(buildColumnArchivedError({
|
|
293
|
+
columnId: resolution.match.column.id,
|
|
294
|
+
columnTitle: resolution.match.column.title,
|
|
295
|
+
columnType: resolution.match.column.type,
|
|
296
|
+
boardId,
|
|
297
|
+
}), resolverWarnings);
|
|
298
|
+
}
|
|
299
|
+
let mutationResult;
|
|
300
|
+
try {
|
|
301
|
+
const translated = translateColumnClear({
|
|
302
|
+
id: resolution.match.column.id,
|
|
303
|
+
type: resolution.match.column.type,
|
|
304
|
+
});
|
|
305
|
+
const mutation = selectMutation([translated]);
|
|
306
|
+
mutationResult = await executeMutation(client, {
|
|
307
|
+
mutation,
|
|
308
|
+
itemId: dispatch.itemId,
|
|
309
|
+
boardId,
|
|
310
|
+
});
|
|
311
|
+
}
|
|
312
|
+
catch (err) {
|
|
313
|
+
/* c8 ignore next 4 — defensive: every error from the SDK
|
|
314
|
+
transport is wrapped in MondayCliError; the
|
|
315
|
+
non-MondayCliError fallthrough is reserved for
|
|
316
|
+
transport-layer bugs. */
|
|
317
|
+
if (!(err instanceof MondayCliError)) {
|
|
318
|
+
throw err;
|
|
319
|
+
}
|
|
320
|
+
throw await foldAndRemap({
|
|
321
|
+
err,
|
|
322
|
+
warnings: resolverWarnings,
|
|
323
|
+
client,
|
|
324
|
+
boardId,
|
|
325
|
+
columnIds: [resolution.match.column.id],
|
|
326
|
+
env: ctx.env,
|
|
327
|
+
noCache: globalFlags.noCache,
|
|
328
|
+
resolutionSource: resolution.source,
|
|
329
|
+
});
|
|
330
|
+
}
|
|
331
|
+
const warnings = resolverWarnings;
|
|
332
|
+
emitMutation({
|
|
333
|
+
ctx,
|
|
334
|
+
data: mutationResult.projected,
|
|
335
|
+
schema: itemClearCommand.outputSchema,
|
|
336
|
+
programOpts: program.opts(),
|
|
337
|
+
warnings,
|
|
338
|
+
...toEmit(mutationResult.response),
|
|
339
|
+
source: resolution.source === 'cache' ? 'mixed' : resolution.source,
|
|
340
|
+
cacheAgeSeconds: resolution.cacheAgeSeconds,
|
|
341
|
+
// cli-design §5.3 step 2: echo resolved column ID per
|
|
342
|
+
// agent input token. Same shape `item set` uses.
|
|
343
|
+
resolvedIds: { [parsed.column]: resolution.match.column.id },
|
|
344
|
+
});
|
|
345
|
+
});
|
|
346
|
+
},
|
|
347
|
+
};
|
|
348
|
+
const executeMutation = async (client, inputs) => {
|
|
349
|
+
const { mutation, itemId, boardId } = inputs;
|
|
350
|
+
if (mutation.kind === 'change_simple_column_value') {
|
|
351
|
+
const response = await client.raw(CHANGE_SIMPLE_COLUMN_VALUE_MUTATION, {
|
|
352
|
+
itemId,
|
|
353
|
+
boardId,
|
|
354
|
+
columnId: mutation.columnId,
|
|
355
|
+
value: mutation.value,
|
|
356
|
+
}, { operationName: 'ItemClearSimple' });
|
|
357
|
+
return {
|
|
358
|
+
projected: projectMutationItem(response.data.change_simple_column_value, itemId),
|
|
359
|
+
response,
|
|
360
|
+
};
|
|
361
|
+
}
|
|
362
|
+
/* c8 ignore start — defensive: selectMutation only emits the
|
|
363
|
+
multi kind for >1 translated values; clear is single-column by
|
|
364
|
+
argv shape, so the multi fallthrough is unreachable. The branch
|
|
365
|
+
conditional below is wrapped in the same c8 ignore so the false
|
|
366
|
+
arm doesn't drag branch coverage either. */
|
|
367
|
+
if (mutation.kind !== 'change_column_value') {
|
|
368
|
+
throw new ApiError('internal_error', `item clear selected ${mutation.kind} but only the single-column ` +
|
|
369
|
+
`mutations are supported here.`, { details: { mutation_kind: mutation.kind, item_id: itemId } });
|
|
370
|
+
}
|
|
371
|
+
/* c8 ignore stop */
|
|
372
|
+
const response = await client.raw(CHANGE_COLUMN_VALUE_MUTATION, {
|
|
373
|
+
itemId,
|
|
374
|
+
boardId,
|
|
375
|
+
columnId: mutation.columnId,
|
|
376
|
+
value: mutation.value,
|
|
377
|
+
}, { operationName: 'ItemClearRich' });
|
|
378
|
+
return {
|
|
379
|
+
projected: projectMutationItem(response.data.change_column_value, itemId),
|
|
380
|
+
response,
|
|
381
|
+
};
|
|
382
|
+
};
|
|
383
|
+
// Thin wrapper around `api/item-mutation-result.ts projectMutationItem`
|
|
384
|
+
// (R28). M5b's `internal_error` + "no item payload" semantics for an
|
|
385
|
+
// empty-payload mutation success are preserved; the wrapper keeps the
|
|
386
|
+
// existing `(raw, itemId)` call signature so the executeMutation arms
|
|
387
|
+
// stay untouched.
|
|
388
|
+
const projectMutationItem = (raw, itemId) => projectMutationItemShared({
|
|
389
|
+
raw,
|
|
390
|
+
itemId,
|
|
391
|
+
errorCode: 'internal_error',
|
|
392
|
+
errorMessage: `Monday returned no item payload from the mutation for id ${itemId}.`,
|
|
393
|
+
});
|
|
394
|
+
// ============================================================
|
|
395
|
+
// Bulk path (cli-design §10.2 — `--where` / `--filter-json`).
|
|
396
|
+
// Mirrors `item update --where`'s runBulk shape verbatim — same
|
|
397
|
+
// items_page walker (lifted into `api/items-page-walker.ts` per
|
|
398
|
+
// §18 R34 post-M12), same confirmation gate, same per-item failure
|
|
399
|
+
// decoration. The single-column scope keeps the pipeline thinner
|
|
400
|
+
// (one column to resolve, one clear payload to build, one mutation
|
|
401
|
+
// per item) but the orchestration shape is identical.
|
|
402
|
+
// ============================================================
|
|
403
|
+
// Tight per-row schema. The shared walker wraps it in the
|
|
404
|
+
// `items_page` envelope; schema drift surfaces as `internal_error`
|
|
405
|
+
// with the failing field path on `details.issues` rather than
|
|
406
|
+
// collapsing to a silent "0 matched, 0 applied" success.
|
|
407
|
+
const bulkItemSchema = z.object({ id: ItemIdSchema }).loose();
|
|
408
|
+
/**
|
|
409
|
+
* Bulk clear orchestrator (cli-design §10.2). Walks `items_page` to
|
|
410
|
+
* collect every matched item, then dispatches the same way bulk
|
|
411
|
+
* `item update --where` does:
|
|
412
|
+
*
|
|
413
|
+
* 1. Without `--yes` AND without `--dry-run` → throw
|
|
414
|
+
* `confirmation_required` with the matched count.
|
|
415
|
+
* 2. With `--dry-run` → per-item `planClear` → emit N-element
|
|
416
|
+
* `planned_changes` array.
|
|
417
|
+
* 3. With `--yes` (and not `--dry-run`) → per-item live mutation.
|
|
418
|
+
* Fail-fast on first error; the error envelope's
|
|
419
|
+
* `details.applied_to` lists IDs of items cleared before the
|
|
420
|
+
* failure.
|
|
421
|
+
*
|
|
422
|
+
* **Sequential execution.** cli-design §9.3 mandates one-at-a-time
|
|
423
|
+
* requests in v0.1-v0.3; the per-item loop respects that.
|
|
424
|
+
*/
|
|
425
|
+
const runBulk = async (inputs) => {
|
|
426
|
+
const { parsed, client, globalFlags, apiVersion, ctx, programOpts } = inputs;
|
|
427
|
+
/* c8 ignore next 6 — defensive: validateInputShape guarantees
|
|
428
|
+
parsed.board is non-undefined when shape is bulk; the type guard
|
|
429
|
+
exists for TS. */
|
|
430
|
+
if (parsed.board === undefined) {
|
|
431
|
+
throw new UsageError('item clear bulk path: --board is required');
|
|
432
|
+
}
|
|
433
|
+
const boardId = parsed.board;
|
|
434
|
+
// 1) Load board metadata (cache-aware, refresh on column-not-found
|
|
435
|
+
// during filter parsing per §5.3 step 5). The per-item planClear
|
|
436
|
+
// / resolveColumnWithRefresh calls reuse the populated cache.
|
|
437
|
+
const meta = await loadBoardMetadata({
|
|
438
|
+
client,
|
|
439
|
+
boardId,
|
|
440
|
+
env: ctx.env,
|
|
441
|
+
noCache: globalFlags.noCache,
|
|
442
|
+
});
|
|
443
|
+
const onColumnNotFound = meta.source === 'cache'
|
|
444
|
+
? async () => {
|
|
445
|
+
const refreshed = await refreshBoardMetadata({
|
|
446
|
+
client,
|
|
447
|
+
boardId,
|
|
448
|
+
env: ctx.env,
|
|
449
|
+
});
|
|
450
|
+
return refreshed.metadata;
|
|
451
|
+
}
|
|
452
|
+
: undefined;
|
|
453
|
+
const filterResult = await buildQueryParams({
|
|
454
|
+
metadata: meta.metadata,
|
|
455
|
+
resolveMe: resolveMeFactory(client),
|
|
456
|
+
whereClauses: parsed.where,
|
|
457
|
+
filterJson: parsed.filterJson,
|
|
458
|
+
...(onColumnNotFound === undefined ? {} : { onColumnNotFound }),
|
|
459
|
+
});
|
|
460
|
+
// 2) Walk items_page collecting matched item IDs. The §18 R34
|
|
461
|
+
// helper (`fetchItemsPage` / `fetchNextItemsPage`) supplies the
|
|
462
|
+
// GraphQL + parse boundary; `paginate.ts` keeps the §3.1 #8
|
|
463
|
+
// per-page sort + §5.6 `stale_cursor` enrichment. Same pattern
|
|
464
|
+
// `item list` uses post-lift.
|
|
465
|
+
const matchedItemIds = [];
|
|
466
|
+
await paginate({
|
|
467
|
+
fetchInitial: () => fetchItemsPage({
|
|
468
|
+
client,
|
|
469
|
+
operationName: 'ItemsPage',
|
|
470
|
+
boardId,
|
|
471
|
+
limit: DEFAULT_PAGE_SIZE,
|
|
472
|
+
queryParams: filterResult.queryParams,
|
|
473
|
+
itemFields: 'id',
|
|
474
|
+
itemSchema: bulkItemSchema,
|
|
475
|
+
}),
|
|
476
|
+
fetchNext: (cursor) => fetchNextItemsPage({
|
|
477
|
+
client,
|
|
478
|
+
operationName: 'NextItemsPage',
|
|
479
|
+
cursor,
|
|
480
|
+
limit: DEFAULT_PAGE_SIZE,
|
|
481
|
+
itemFields: 'id',
|
|
482
|
+
itemSchema: bulkItemSchema,
|
|
483
|
+
}),
|
|
484
|
+
now: ctx.clock,
|
|
485
|
+
extractPage: (r) => r.data,
|
|
486
|
+
getId: (item) => item.id,
|
|
487
|
+
all: true,
|
|
488
|
+
onItem: (item) => {
|
|
489
|
+
matchedItemIds.push(item.id);
|
|
490
|
+
},
|
|
491
|
+
});
|
|
492
|
+
// 3) Empty match set — both dry-run and live are clean no-ops.
|
|
493
|
+
// Same handling as bulk update — emit a success envelope before
|
|
494
|
+
// the confirmation gate fires (`--yes` shouldn't be required to
|
|
495
|
+
// confirm "no items matched"). Filter warnings still surface.
|
|
496
|
+
const emptyEnvelopeSource = meta.source === 'cache' ? 'mixed' : 'live';
|
|
497
|
+
if (matchedItemIds.length === 0) {
|
|
498
|
+
if (globalFlags.dryRun) {
|
|
499
|
+
emitDryRun({
|
|
500
|
+
ctx,
|
|
501
|
+
programOpts,
|
|
502
|
+
plannedChanges: [],
|
|
503
|
+
source: emptyEnvelopeSource,
|
|
504
|
+
cacheAgeSeconds: meta.cacheAgeSeconds,
|
|
505
|
+
warnings: filterResult.warnings,
|
|
506
|
+
apiVersion,
|
|
507
|
+
});
|
|
508
|
+
return;
|
|
509
|
+
}
|
|
510
|
+
emitMutation({
|
|
511
|
+
ctx,
|
|
512
|
+
data: {
|
|
513
|
+
summary: { matched_count: 0, applied_count: 0, board_id: boardId },
|
|
514
|
+
items: [],
|
|
515
|
+
},
|
|
516
|
+
schema: itemClearOutputSchema,
|
|
517
|
+
programOpts,
|
|
518
|
+
warnings: filterResult.warnings,
|
|
519
|
+
source: emptyEnvelopeSource,
|
|
520
|
+
cacheAgeSeconds: meta.cacheAgeSeconds,
|
|
521
|
+
apiVersion,
|
|
522
|
+
});
|
|
523
|
+
return;
|
|
524
|
+
}
|
|
525
|
+
// 4) Confirmation gate. Bulk clears without --yes (and without
|
|
526
|
+
// --dry-run) surface `confirmation_required` per §3.1 #7 +
|
|
527
|
+
// §6.5. Same shape bulk update uses.
|
|
528
|
+
if (!globalFlags.dryRun && !globalFlags.yes) {
|
|
529
|
+
throw new ConfirmationRequiredError(`Bulk item clear would mutate ${String(matchedItemIds.length)} ` +
|
|
530
|
+
`matched item(s). Re-run with --yes to confirm, or --dry-run to ` +
|
|
531
|
+
`preview.`, {
|
|
532
|
+
details: {
|
|
533
|
+
board_id: boardId,
|
|
534
|
+
matched_count: matchedItemIds.length,
|
|
535
|
+
where_clauses: parsed.where,
|
|
536
|
+
...(parsed.filterJson === undefined
|
|
537
|
+
? {}
|
|
538
|
+
: { filter_json: parsed.filterJson }),
|
|
539
|
+
hint: 'Use --dry-run to inspect the planned_changes for every ' +
|
|
540
|
+
'matched item before applying.',
|
|
541
|
+
},
|
|
542
|
+
});
|
|
543
|
+
}
|
|
544
|
+
// 5) Dry-run path: per-item planClear. Same shape bulk update's
|
|
545
|
+
// dry-run uses — N planned_changes aggregated into one array,
|
|
546
|
+
// deduped warnings, source aggregated across legs.
|
|
547
|
+
if (globalFlags.dryRun) {
|
|
548
|
+
const allPlanned = [];
|
|
549
|
+
const aggregatedWarnings = [...filterResult.warnings];
|
|
550
|
+
const sourceAgg = new SourceAggregator({
|
|
551
|
+
source: meta.source,
|
|
552
|
+
cacheAgeSeconds: meta.cacheAgeSeconds,
|
|
553
|
+
});
|
|
554
|
+
for (const itemId of matchedItemIds) {
|
|
555
|
+
const result = await planClear({
|
|
556
|
+
client,
|
|
557
|
+
boardId,
|
|
558
|
+
itemId,
|
|
559
|
+
token: parsed.column,
|
|
560
|
+
env: ctx.env,
|
|
561
|
+
noCache: globalFlags.noCache,
|
|
562
|
+
});
|
|
563
|
+
for (const plan of result.plannedChanges) {
|
|
564
|
+
allPlanned.push(plan);
|
|
565
|
+
}
|
|
566
|
+
for (const w of result.warnings) {
|
|
567
|
+
aggregatedWarnings.push(w);
|
|
568
|
+
}
|
|
569
|
+
sourceAgg.record(result.source, result.cacheAgeSeconds);
|
|
570
|
+
}
|
|
571
|
+
emitDryRun({
|
|
572
|
+
ctx,
|
|
573
|
+
programOpts,
|
|
574
|
+
plannedChanges: allPlanned,
|
|
575
|
+
...sourceAgg.result(),
|
|
576
|
+
warnings: dedupeWarnings(aggregatedWarnings),
|
|
577
|
+
apiVersion,
|
|
578
|
+
});
|
|
579
|
+
return;
|
|
580
|
+
}
|
|
581
|
+
// 6) Live path: resolve the column once + per-item clear. The
|
|
582
|
+
// column resolves against the shared metadata view; the
|
|
583
|
+
// archived-column gate fires before any mutation.
|
|
584
|
+
const resolution = await resolveColumnWithRefresh({
|
|
585
|
+
client,
|
|
586
|
+
boardId,
|
|
587
|
+
token: parsed.column,
|
|
588
|
+
includeArchived: true,
|
|
589
|
+
env: ctx.env,
|
|
590
|
+
noCache: globalFlags.noCache,
|
|
591
|
+
});
|
|
592
|
+
const resolverWarnings = resolution.warnings;
|
|
593
|
+
if (resolution.match.column.archived === true) {
|
|
594
|
+
throw foldResolverWarningsIntoError(buildColumnArchivedError({
|
|
595
|
+
columnId: resolution.match.column.id,
|
|
596
|
+
columnTitle: resolution.match.column.title,
|
|
597
|
+
columnType: resolution.match.column.type,
|
|
598
|
+
boardId,
|
|
599
|
+
}), resolverWarnings);
|
|
600
|
+
}
|
|
601
|
+
// SourceAggregator seeds with the metadata leg + records the
|
|
602
|
+
// resolution leg + the per-item mutations (always live). Mirrors
|
|
603
|
+
// bulk update's aggregation shape.
|
|
604
|
+
const sourceAgg = new SourceAggregator({
|
|
605
|
+
source: meta.source,
|
|
606
|
+
cacheAgeSeconds: meta.cacheAgeSeconds,
|
|
607
|
+
});
|
|
608
|
+
sourceAgg.record(resolution.source, resolution.cacheAgeSeconds);
|
|
609
|
+
const translated = translateColumnClear({
|
|
610
|
+
id: resolution.match.column.id,
|
|
611
|
+
type: resolution.match.column.type,
|
|
612
|
+
});
|
|
613
|
+
const mutation = selectMutation([translated]);
|
|
614
|
+
const appliedItems = [];
|
|
615
|
+
const remapColumnIds = [resolution.match.column.id];
|
|
616
|
+
for (const itemId of matchedItemIds) {
|
|
617
|
+
try {
|
|
618
|
+
const result = await executeMutation(client, {
|
|
619
|
+
mutation,
|
|
620
|
+
itemId,
|
|
621
|
+
boardId,
|
|
622
|
+
});
|
|
623
|
+
appliedItems.push(result.projected);
|
|
624
|
+
}
|
|
625
|
+
catch (err) {
|
|
626
|
+
/* c8 ignore next 4 — defensive: every error from the SDK
|
|
627
|
+
transport is wrapped in MondayCliError; the non-MondayCliError
|
|
628
|
+
fallthrough is reserved for transport-layer bugs. */
|
|
629
|
+
if (!(err instanceof MondayCliError)) {
|
|
630
|
+
throw err;
|
|
631
|
+
}
|
|
632
|
+
// Same fold + remap shape bulk update uses (Codex M5b
|
|
633
|
+
// finding #3 + pass-1 F3). column_archived remap, then
|
|
634
|
+
// bulk-progress decoration.
|
|
635
|
+
{
|
|
636
|
+
const remapped = await foldAndRemap({
|
|
637
|
+
err,
|
|
638
|
+
warnings: resolverWarnings,
|
|
639
|
+
client,
|
|
640
|
+
boardId,
|
|
641
|
+
columnIds: remapColumnIds,
|
|
642
|
+
env: ctx.env,
|
|
643
|
+
noCache: globalFlags.noCache,
|
|
644
|
+
resolutionSource: resolution.source,
|
|
645
|
+
});
|
|
646
|
+
/* c8 ignore next — defensive: foldAndRemap copies the
|
|
647
|
+
original error's details unchanged when the remap
|
|
648
|
+
preconditions don't fire; details is therefore always a
|
|
649
|
+
defined record. The fallback covers the contrived no-
|
|
650
|
+
details edge case. */
|
|
651
|
+
const existing = remapped.details ?? {};
|
|
652
|
+
/* c8 ignore next 12 — defensive: foldAndRemap only emits
|
|
653
|
+
usage_error for a translator-side argv mismatch (e.g.
|
|
654
|
+
--set X=bad alongside --set-raw X={...}); bulk clear has
|
|
655
|
+
no --set / --set-raw values to translate (it operates on
|
|
656
|
+
the resolved column ID + the per-type clear payload). The
|
|
657
|
+
branch is kept symmetric with bulk update's per-item
|
|
658
|
+
failure handling so the two surfaces stay diff-able. */
|
|
659
|
+
if (remapped.code === 'usage_error') {
|
|
660
|
+
throw new UsageError(remapped.message, {
|
|
661
|
+
...(remapped.cause === undefined ? {} : { cause: remapped.cause }),
|
|
662
|
+
details: {
|
|
663
|
+
...existing,
|
|
664
|
+
applied_count: appliedItems.length,
|
|
665
|
+
applied_to: appliedItems.map((i) => i.id),
|
|
666
|
+
failed_at_item: itemId,
|
|
667
|
+
matched_count: matchedItemIds.length,
|
|
668
|
+
},
|
|
669
|
+
});
|
|
670
|
+
}
|
|
671
|
+
// Conditional spreads mirror bulk update's MondayCliError →
|
|
672
|
+
// ApiError reconstruction. Each `?? :` carries metadata only
|
|
673
|
+
// when present on the source error; the per-Monday-error
|
|
674
|
+
// permutations (httpStatus / mondayCode / requestId /
|
|
675
|
+
// retryAfterSeconds set or unset) come from Monday's error
|
|
676
|
+
// shape and aren't all exercised by a single fixture.
|
|
677
|
+
/* c8 ignore start */
|
|
678
|
+
throw new ApiError(remapped.code, remapped.message, {
|
|
679
|
+
...(remapped.cause === undefined ? {} : { cause: remapped.cause }),
|
|
680
|
+
...(remapped.httpStatus === undefined ? {} : { httpStatus: remapped.httpStatus }),
|
|
681
|
+
...(remapped.mondayCode === undefined ? {} : { mondayCode: remapped.mondayCode }),
|
|
682
|
+
...(remapped.requestId === undefined ? {} : { requestId: remapped.requestId }),
|
|
683
|
+
retryable: remapped.retryable,
|
|
684
|
+
...(remapped.retryAfterSeconds === undefined ? {} : { retryAfterSeconds: remapped.retryAfterSeconds }),
|
|
685
|
+
details: {
|
|
686
|
+
...existing,
|
|
687
|
+
applied_count: appliedItems.length,
|
|
688
|
+
applied_to: appliedItems.map((i) => i.id),
|
|
689
|
+
failed_at_item: itemId,
|
|
690
|
+
matched_count: matchedItemIds.length,
|
|
691
|
+
},
|
|
692
|
+
});
|
|
693
|
+
/* c8 ignore stop */
|
|
694
|
+
}
|
|
695
|
+
}
|
|
696
|
+
}
|
|
697
|
+
// Per-item mutations always fire live; record one terminal `live`
|
|
698
|
+
// leg so cache-served metadata + live mutations collapse to
|
|
699
|
+
// `mixed`. Mirrors bulk update's tail record pattern.
|
|
700
|
+
sourceAgg.record('live', null);
|
|
701
|
+
const aggregatedWarnings = [
|
|
702
|
+
...filterResult.warnings,
|
|
703
|
+
...resolverWarnings,
|
|
704
|
+
];
|
|
705
|
+
emitMutation({
|
|
706
|
+
ctx,
|
|
707
|
+
data: {
|
|
708
|
+
summary: {
|
|
709
|
+
matched_count: matchedItemIds.length,
|
|
710
|
+
applied_count: appliedItems.length,
|
|
711
|
+
board_id: boardId,
|
|
712
|
+
},
|
|
713
|
+
items: appliedItems,
|
|
714
|
+
},
|
|
715
|
+
schema: itemClearOutputSchema,
|
|
716
|
+
programOpts,
|
|
717
|
+
warnings: aggregatedWarnings,
|
|
718
|
+
...sourceAgg.result(),
|
|
719
|
+
apiVersion,
|
|
720
|
+
resolvedIds: { [parsed.column]: resolution.match.column.id },
|
|
721
|
+
});
|
|
722
|
+
};
|
|
723
|
+
/**
|
|
724
|
+
* Bulk dry-run aggregates per-item resolver warnings — the same
|
|
725
|
+
* `stale_cache_refreshed` / `column_token_collision` signals fire
|
|
726
|
+
* once per item the first time they're triggered (subsequent items
|
|
727
|
+
* hit the now-warm cache). De-duplicates by `code + message +
|
|
728
|
+
* details.token` so an agent reading the dry-run envelope sees each
|
|
729
|
+
* unique warning once. Order-preserving: the first occurrence wins.
|
|
730
|
+
*
|
|
731
|
+
* Same shape bulk update's dedupeWarnings uses.
|
|
732
|
+
*/
|
|
733
|
+
const dedupeWarnings = (warnings) => {
|
|
734
|
+
const seen = new Set();
|
|
735
|
+
const out = [];
|
|
736
|
+
for (const w of warnings) {
|
|
737
|
+
const tokenKey = typeof w.details?.token === 'string'
|
|
738
|
+
? w.details.token
|
|
739
|
+
: '';
|
|
740
|
+
const key = `${w.code}|${w.message}|${tokenKey}`;
|
|
741
|
+
if (seen.has(key))
|
|
742
|
+
continue;
|
|
743
|
+
seen.add(key);
|
|
744
|
+
out.push(w);
|
|
745
|
+
}
|
|
746
|
+
return out;
|
|
747
|
+
};
|
|
748
|
+
//# sourceMappingURL=clear.js.map
|