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,884 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* `monday item update <iid> [--name <n>] [--set <col>=<val>]...` —
|
|
3
|
+
* multi-column atomic update + optional rename.
|
|
4
|
+
* (`cli-design.md` §4.3 line 490, §5.3, `v0.1-plan.md` §3 M5b).
|
|
5
|
+
*
|
|
6
|
+
* Two argv shapes:
|
|
7
|
+
*
|
|
8
|
+
* 1. **Single-item** (this commit): positional `<itemId>` +
|
|
9
|
+
* repeatable `--set <col>=<val>` + optional `--name <n>`.
|
|
10
|
+
* Multi-`--set` (≥2) bundles into one
|
|
11
|
+
* `change_multiple_column_values` mutation (atomic on Monday's
|
|
12
|
+
* side per §5.3 step 5). `--name` rolls into the same multi
|
|
13
|
+
* mutation when columns are also present, otherwise fires a
|
|
14
|
+
* dedicated `change_simple_column_value(column_id: "name", ...)`.
|
|
15
|
+
*
|
|
16
|
+
* 2. **Bulk** (next commit): `--where <expr>` repeatable + no
|
|
17
|
+
* positional `<itemId>` — applies the same `--set` / `--name`
|
|
18
|
+
* bundle to every matching item via Monday's `items_page`
|
|
19
|
+
* walker. `confirmation_required` fires without `--yes` (and
|
|
20
|
+
* without `--dry-run`) per cli-design §10.2.
|
|
21
|
+
*
|
|
22
|
+
* **`--name` + `--set` atomicity.** Per cli-design §5.3 step 5, the
|
|
23
|
+
* design promises atomicity for multi-column updates. Bundling the
|
|
24
|
+
* name into the multi mutation keeps the same atomicity guarantee
|
|
25
|
+
* for `--name + --set`. Monday's
|
|
26
|
+
* `change_multiple_column_values(column_values: JSON!)` accepts
|
|
27
|
+
* `name` as a special key in the map. The dry-run engine produces
|
|
28
|
+
* a single `PlannedChange` whose `diff` includes both column keys
|
|
29
|
+
* and a `name` key when both are passed.
|
|
30
|
+
*
|
|
31
|
+
* **`--name` only.** Single field → `change_simple_column_value(
|
|
32
|
+
* column_id: "name", value: <n>)`. Atomic by default (single
|
|
33
|
+
* mutation).
|
|
34
|
+
*
|
|
35
|
+
* **`--create-labels-if-missing`** (cli-design §4.3) — passes
|
|
36
|
+
* through to Monday's `change_*_column_value(create_labels_if_missing:
|
|
37
|
+
* true)`. Tells Monday to auto-create unknown status / dropdown
|
|
38
|
+
* labels rather than rejecting with `validation_failed`. Off by
|
|
39
|
+
* default; agents who want labels-on-demand pass the flag
|
|
40
|
+
* explicitly.
|
|
41
|
+
*
|
|
42
|
+
* Idempotent: yes — `change_*` mutations are idempotent. Multi-set
|
|
43
|
+
* is also idempotent (re-running with the same args produces the
|
|
44
|
+
* same item state).
|
|
45
|
+
*/
|
|
46
|
+
import { z } from 'zod';
|
|
47
|
+
import { ensureSubcommand } from '../types.js';
|
|
48
|
+
import { emitDryRun, emitMutation } from '../emit.js';
|
|
49
|
+
import { resolveClient } from '../../api/resolve-client.js';
|
|
50
|
+
import { BoardIdSchema, ItemIdSchema } from '../../types/ids.js';
|
|
51
|
+
import { parseArgv } from '../parse-argv.js';
|
|
52
|
+
import { ApiError, MondayCliError, UsageError } from '../../utils/errors.js';
|
|
53
|
+
import { selectMutation, } from '../../api/column-values.js';
|
|
54
|
+
import { parseSetRawExpression, } from '../../api/raw-write.js';
|
|
55
|
+
import { splitSetExpression } from '../../api/set-expression.js';
|
|
56
|
+
import { buildResolutionContexts } from '../../api/resolution-context.js';
|
|
57
|
+
import { resolveBoardId } from '../../api/item-board-lookup.js';
|
|
58
|
+
import { SourceAggregator } from '../../api/source-aggregator.js';
|
|
59
|
+
import { resolveAndTranslate } from '../../api/resolution-pass.js';
|
|
60
|
+
import { foldAndRemap } from '../../api/resolver-error-fold.js';
|
|
61
|
+
import { planChanges } from '../../api/dry-run.js';
|
|
62
|
+
import { buildQueryParams } from '../../api/filters.js';
|
|
63
|
+
import { loadBoardMetadata, refreshBoardMetadata, } from '../../api/board-metadata.js';
|
|
64
|
+
import { DEFAULT_PAGE_SIZE, paginate, } from '../../api/pagination.js';
|
|
65
|
+
import { fetchItemsPage, fetchNextItemsPage, } from '../../api/items-page-walker.js';
|
|
66
|
+
import { ConfirmationRequiredError, } from '../../utils/errors.js';
|
|
67
|
+
import { ITEM_FIELDS_FRAGMENT, resolveMeFactory, } from '../../api/item-helpers.js';
|
|
68
|
+
import { projectMutationItem as projectMutationItemShared } from '../../api/item-mutation-result.js';
|
|
69
|
+
import { projectedItemSchema, } from '../../api/item-projection.js';
|
|
70
|
+
const CHANGE_SIMPLE_COLUMN_VALUE_MUTATION = `
|
|
71
|
+
mutation ItemUpdateSimple(
|
|
72
|
+
$itemId: ID!
|
|
73
|
+
$boardId: ID!
|
|
74
|
+
$columnId: String!
|
|
75
|
+
$value: String!
|
|
76
|
+
$createLabelsIfMissing: Boolean
|
|
77
|
+
) {
|
|
78
|
+
change_simple_column_value(
|
|
79
|
+
item_id: $itemId
|
|
80
|
+
board_id: $boardId
|
|
81
|
+
column_id: $columnId
|
|
82
|
+
value: $value
|
|
83
|
+
create_labels_if_missing: $createLabelsIfMissing
|
|
84
|
+
) {
|
|
85
|
+
${ITEM_FIELDS_FRAGMENT}
|
|
86
|
+
}
|
|
87
|
+
}
|
|
88
|
+
`;
|
|
89
|
+
const CHANGE_COLUMN_VALUE_MUTATION = `
|
|
90
|
+
mutation ItemUpdateRich(
|
|
91
|
+
$itemId: ID!
|
|
92
|
+
$boardId: ID!
|
|
93
|
+
$columnId: String!
|
|
94
|
+
$value: JSON!
|
|
95
|
+
$createLabelsIfMissing: Boolean
|
|
96
|
+
) {
|
|
97
|
+
change_column_value(
|
|
98
|
+
item_id: $itemId
|
|
99
|
+
board_id: $boardId
|
|
100
|
+
column_id: $columnId
|
|
101
|
+
value: $value
|
|
102
|
+
create_labels_if_missing: $createLabelsIfMissing
|
|
103
|
+
) {
|
|
104
|
+
${ITEM_FIELDS_FRAGMENT}
|
|
105
|
+
}
|
|
106
|
+
}
|
|
107
|
+
`;
|
|
108
|
+
const CHANGE_MULTIPLE_COLUMN_VALUES_MUTATION = `
|
|
109
|
+
mutation ItemUpdateMulti(
|
|
110
|
+
$itemId: ID!
|
|
111
|
+
$boardId: ID!
|
|
112
|
+
$columnValues: JSON!
|
|
113
|
+
$createLabelsIfMissing: Boolean
|
|
114
|
+
) {
|
|
115
|
+
change_multiple_column_values(
|
|
116
|
+
item_id: $itemId
|
|
117
|
+
board_id: $boardId
|
|
118
|
+
column_values: $columnValues
|
|
119
|
+
create_labels_if_missing: $createLabelsIfMissing
|
|
120
|
+
) {
|
|
121
|
+
${ITEM_FIELDS_FRAGMENT}
|
|
122
|
+
}
|
|
123
|
+
}
|
|
124
|
+
`;
|
|
125
|
+
export const itemUpdateOutputSchema = projectedItemSchema;
|
|
126
|
+
/**
|
|
127
|
+
* Input shape — supports both single-item and bulk shapes.
|
|
128
|
+
*
|
|
129
|
+
* - Single-item: `itemId` positional required; `where` empty.
|
|
130
|
+
* - Bulk: `itemId` positional omitted; `where` non-empty
|
|
131
|
+
* AND `board` required.
|
|
132
|
+
*
|
|
133
|
+
* The split lives in `validateInputShape` (action body) so the zod
|
|
134
|
+
* schema captures the union without the per-shape conditional logic
|
|
135
|
+
* — the action layer reads the discriminator and dispatches.
|
|
136
|
+
*/
|
|
137
|
+
const inputSchema = z
|
|
138
|
+
.object({
|
|
139
|
+
itemId: ItemIdSchema.optional(),
|
|
140
|
+
set: z.array(z.string()).default([]),
|
|
141
|
+
// M8: --set-raw <col>=<json>... repeatable raw escape hatch.
|
|
142
|
+
// Mutually exclusive per-column with --set; the duplicate-ID
|
|
143
|
+
// check fires in the dry-run engine + selectMutation per
|
|
144
|
+
// cli-design §5.3 line 961-972 (resolution-time, not parse-time).
|
|
145
|
+
setRaw: z.array(z.string()).default([]),
|
|
146
|
+
name: z.string().min(1).optional(),
|
|
147
|
+
board: BoardIdSchema.optional(),
|
|
148
|
+
where: z.array(z.string()).default([]),
|
|
149
|
+
// Empty `--filter-json ''` would slip through `buildQueryParams`
|
|
150
|
+
// as "no filter" (`hasFilterJson` is gated on `length > 0`) while
|
|
151
|
+
// still tripping `validateInputShape`'s "bulk mode" discriminator
|
|
152
|
+
// (`filterJson !== undefined`) — net effect, a whole-board mutation
|
|
153
|
+
// an agent likely thought was filtered. Reject at the schema
|
|
154
|
+
// boundary so no network call fires. Codex pass-3 of the §10.2
|
|
155
|
+
// backfill PR caught this — see v0.1-plan §3 M5b session 4.
|
|
156
|
+
//
|
|
157
|
+
// `.refine(trim)` rather than `.min(1)` so a whitespace-only
|
|
158
|
+
// `--filter-json ' '` is also caught at the schema boundary;
|
|
159
|
+
// pre-fix it slipped past `.min(1)` and only failed inside
|
|
160
|
+
// `parseFilterJson` AFTER board metadata loaded — same
|
|
161
|
+
// ultimate `usage_error`, but a wasted network call (Codex
|
|
162
|
+
// pass-1 of this fix).
|
|
163
|
+
filterJson: z
|
|
164
|
+
.string()
|
|
165
|
+
.refine((s) => s.trim().length > 0, '--filter-json must be a non-empty JSON object')
|
|
166
|
+
.optional(),
|
|
167
|
+
createLabelsIfMissing: z.boolean().optional(),
|
|
168
|
+
})
|
|
169
|
+
.strict()
|
|
170
|
+
// At least one of --set / --set-raw / --name must be provided. An
|
|
171
|
+
// empty call (`monday item update 12345`) is meaningless and would
|
|
172
|
+
// produce a zero-mutation envelope that surprises agents. M8 widens
|
|
173
|
+
// the rule to include --set-raw.
|
|
174
|
+
.refine((v) => v.set.length > 0 || v.setRaw.length > 0 || v.name !== undefined, {
|
|
175
|
+
message: 'item update requires at least one of --set / --set-raw / --name',
|
|
176
|
+
path: ['set'],
|
|
177
|
+
});
|
|
178
|
+
const validateInputShape = (parsed) => {
|
|
179
|
+
const hasItemId = parsed.itemId !== undefined;
|
|
180
|
+
const hasFilter = parsed.where.length > 0 || parsed.filterJson !== undefined;
|
|
181
|
+
if (hasItemId && hasFilter) {
|
|
182
|
+
throw new UsageError('item update accepts either a positional <itemId> OR --where / ' +
|
|
183
|
+
'--filter-json (bulk shape), not both. Pick one.', { details: { item_id: parsed.itemId, where_count: parsed.where.length } });
|
|
184
|
+
}
|
|
185
|
+
if (!hasItemId && !hasFilter) {
|
|
186
|
+
throw new UsageError('item update requires either a positional <itemId> or --where / ' +
|
|
187
|
+
'--filter-json for the bulk shape.', { details: {} });
|
|
188
|
+
}
|
|
189
|
+
if (hasFilter && parsed.board === undefined) {
|
|
190
|
+
throw new UsageError('item update --where / --filter-json requires --board <bid>. The ' +
|
|
191
|
+
'bulk shape walks Monday\'s items_page on the named board.', { details: { where_count: parsed.where.length } });
|
|
192
|
+
}
|
|
193
|
+
if (hasItemId) {
|
|
194
|
+
/* c8 ignore next 4 — defensive: hasItemId === true means
|
|
195
|
+
parsed.itemId is non-undefined; the type guard exists for TS. */
|
|
196
|
+
if (parsed.itemId === undefined) {
|
|
197
|
+
throw new UsageError('item update: itemId narrowing failed');
|
|
198
|
+
}
|
|
199
|
+
return { kind: 'single', itemId: parsed.itemId };
|
|
200
|
+
}
|
|
201
|
+
return { kind: 'bulk' };
|
|
202
|
+
};
|
|
203
|
+
export const itemUpdateCommand = {
|
|
204
|
+
name: 'item.update',
|
|
205
|
+
summary: 'Update one or more columns on an item (atomic)',
|
|
206
|
+
examples: [
|
|
207
|
+
'monday item update 12345 --set status=Done',
|
|
208
|
+
'monday item update 12345 --set status=Done --set owner=alice@example.com',
|
|
209
|
+
'monday item update 12345 --name "New title"',
|
|
210
|
+
'monday item update 12345 --name "New title" --set status=Done',
|
|
211
|
+
'monday item update 12345 --set tags=Backend,Frontend --create-labels-if-missing',
|
|
212
|
+
'monday item update 12345 --set status=Done --dry-run --json',
|
|
213
|
+
"monday item update 12345 --set-raw status='{\"label\":\"Done\"}'",
|
|
214
|
+
"monday item update 12345 --set status=Done --set-raw tags_1='{\"tag_ids\":[1,2]}'",
|
|
215
|
+
],
|
|
216
|
+
idempotent: true,
|
|
217
|
+
inputSchema,
|
|
218
|
+
outputSchema: itemUpdateOutputSchema,
|
|
219
|
+
attach: (program, ctx) => {
|
|
220
|
+
const noun = ensureSubcommand(program, 'item', 'Item commands');
|
|
221
|
+
noun
|
|
222
|
+
.command('update [itemId]')
|
|
223
|
+
.description(itemUpdateCommand.summary)
|
|
224
|
+
.option('--set <expr>', 'repeatable <col>=<val> column write', (value, prev) => [...prev, value], [])
|
|
225
|
+
.option('--set-raw <expr>', 'repeatable <col>=<json> raw write (escape hatch — bypasses friendly translator)', (value, prev) => [...prev, value], [])
|
|
226
|
+
.option('--name <n>', 'rename the item')
|
|
227
|
+
.option('--board <bid>', 'board ID (required for bulk; skip lookup for single-item)')
|
|
228
|
+
.option('--where <expr>', 'repeatable bulk filter (cli-design §10.2): <col><op><val>', (value, prev) => [...prev, value], [])
|
|
229
|
+
.option('--filter-json <json>', 'literal Monday query_params for bulk')
|
|
230
|
+
// `--yes` is a GLOBAL flag (`src/cli/program.ts`); read it via
|
|
231
|
+
// `globalFlags.yes` rather than redeclaring on this subcommand
|
|
232
|
+
// so the flag stays single-source-of-truth across every M5b /
|
|
233
|
+
// M6 mutation surface (and so commander doesn't dispatch the
|
|
234
|
+
// value to a per-subcommand slot that diverges from the
|
|
235
|
+
// global one).
|
|
236
|
+
.option('--create-labels-if-missing', 'auto-create unknown status / dropdown labels (Monday flag)')
|
|
237
|
+
.addHelpText('after', ['', 'Examples:', ...itemUpdateCommand.examples.map((e) => ` ${e}`), ''].join('\n'))
|
|
238
|
+
.action(async (itemId, opts) => {
|
|
239
|
+
const parsed = parseArgv(itemUpdateCommand.inputSchema, {
|
|
240
|
+
...(itemId === undefined ? {} : { itemId }),
|
|
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
|
+
// Argv-parse-time failures fire BEFORE board lookup / metadata
|
|
257
|
+
// fetch. Splits + JSON parse run on pure strings; surfacing here
|
|
258
|
+
// means a malformed --set or --set-raw fails fast without
|
|
259
|
+
// burning an `ItemBoardLookup` round-trip when `--board` was
|
|
260
|
+
// omitted (Codex M8 finding #4 — pre-fix this parse ran AFTER
|
|
261
|
+
// resolveBoardId, contradicting the argv-boundary contract used
|
|
262
|
+
// by `item set` and the bulk path).
|
|
263
|
+
const setEntries = parsed.set.map(splitSetExpression);
|
|
264
|
+
const rawEntries = parsed.setRaw.map(parseSetRawExpression);
|
|
265
|
+
const boardId = await resolveBoardId({
|
|
266
|
+
client,
|
|
267
|
+
itemId: dispatch.itemId,
|
|
268
|
+
explicit: parsed.board,
|
|
269
|
+
});
|
|
270
|
+
const { dateResolution, peopleResolution } = buildResolutionContexts({ client, ctx, globalFlags });
|
|
271
|
+
if (globalFlags.dryRun) {
|
|
272
|
+
const result = await planChanges({
|
|
273
|
+
client,
|
|
274
|
+
boardId,
|
|
275
|
+
itemId: dispatch.itemId,
|
|
276
|
+
setEntries,
|
|
277
|
+
...(rawEntries.length === 0 ? {} : { rawEntries }),
|
|
278
|
+
...(parsed.name === undefined ? {} : { nameChange: parsed.name }),
|
|
279
|
+
dateResolution,
|
|
280
|
+
peopleResolution,
|
|
281
|
+
env: ctx.env,
|
|
282
|
+
noCache: globalFlags.noCache,
|
|
283
|
+
});
|
|
284
|
+
emitDryRun({
|
|
285
|
+
ctx,
|
|
286
|
+
programOpts: program.opts(),
|
|
287
|
+
plannedChanges: result.plannedChanges,
|
|
288
|
+
source: result.source,
|
|
289
|
+
cacheAgeSeconds: result.cacheAgeSeconds,
|
|
290
|
+
warnings: result.warnings,
|
|
291
|
+
apiVersion,
|
|
292
|
+
});
|
|
293
|
+
return;
|
|
294
|
+
}
|
|
295
|
+
// Live update path — three-pass resolution + translation
|
|
296
|
+
// through the shared helper (R20 lift).
|
|
297
|
+
const resolutionResult = await resolveAndTranslate({
|
|
298
|
+
client,
|
|
299
|
+
boardId,
|
|
300
|
+
setEntries,
|
|
301
|
+
rawEntries,
|
|
302
|
+
dateResolution,
|
|
303
|
+
peopleResolution,
|
|
304
|
+
env: ctx.env,
|
|
305
|
+
noCache: globalFlags.noCache,
|
|
306
|
+
});
|
|
307
|
+
const collectedWarnings = [
|
|
308
|
+
...resolutionResult.warnings,
|
|
309
|
+
];
|
|
310
|
+
const resolvedIds = resolutionResult.resolvedIds;
|
|
311
|
+
const sourceAgg = new SourceAggregator();
|
|
312
|
+
if (resolutionResult.source !== undefined) {
|
|
313
|
+
sourceAgg.record(resolutionResult.source, resolutionResult.cacheAgeSeconds);
|
|
314
|
+
}
|
|
315
|
+
const translated = resolutionResult.translated;
|
|
316
|
+
// Build the final SelectedMutation. When `--name` is set,
|
|
317
|
+
// a synthetic translated value (columnId: "name",
|
|
318
|
+
// columnType: "text") joins the array so `selectMutation`
|
|
319
|
+
// dispatches uniformly: name-only → simple; columns + name
|
|
320
|
+
// (or ≥2 columns) → multi.
|
|
321
|
+
const allTranslated = parsed.name === undefined
|
|
322
|
+
? translated
|
|
323
|
+
: [
|
|
324
|
+
{
|
|
325
|
+
columnId: 'name',
|
|
326
|
+
columnType: 'text',
|
|
327
|
+
rawInput: parsed.name,
|
|
328
|
+
payload: { format: 'simple', value: parsed.name },
|
|
329
|
+
resolvedFrom: null,
|
|
330
|
+
peopleResolution: null,
|
|
331
|
+
},
|
|
332
|
+
...translated,
|
|
333
|
+
];
|
|
334
|
+
let mutationResult;
|
|
335
|
+
try {
|
|
336
|
+
const mutation = selectMutation(allTranslated);
|
|
337
|
+
mutationResult = await executeMutation(client, {
|
|
338
|
+
mutation,
|
|
339
|
+
itemId: dispatch.itemId,
|
|
340
|
+
boardId,
|
|
341
|
+
createLabelsIfMissing: parsed.createLabelsIfMissing,
|
|
342
|
+
});
|
|
343
|
+
}
|
|
344
|
+
catch (err) {
|
|
345
|
+
if (err instanceof MondayCliError) {
|
|
346
|
+
// F4 remap: cache-sourced resolution + Monday rejecting
|
|
347
|
+
// as validation_failed → check live archived state.
|
|
348
|
+
// Codex M5b finding #3: pass every translated column ID so
|
|
349
|
+
// a multi-column update where a LATER target was archived
|
|
350
|
+
// (post stale-cache read) still remaps.
|
|
351
|
+
// Codex pass-1 F2: pass the actual aggregated resolution
|
|
352
|
+
// source (live / cache / mixed) so plain cache hits
|
|
353
|
+
// without `stale_cache_refreshed` warnings still trigger
|
|
354
|
+
// the remap.
|
|
355
|
+
throw await foldAndRemap({
|
|
356
|
+
err,
|
|
357
|
+
warnings: collectedWarnings,
|
|
358
|
+
client,
|
|
359
|
+
boardId,
|
|
360
|
+
columnIds: translated.map((t) => t.columnId),
|
|
361
|
+
env: ctx.env,
|
|
362
|
+
noCache: globalFlags.noCache,
|
|
363
|
+
resolutionSource: resolutionResult.source ?? 'live',
|
|
364
|
+
});
|
|
365
|
+
}
|
|
366
|
+
throw err;
|
|
367
|
+
}
|
|
368
|
+
const warnings = collectedWarnings;
|
|
369
|
+
// The mutation leg is always live — fold it into the
|
|
370
|
+
// aggregator so a cache-served resolution + live mutation
|
|
371
|
+
// surfaces as `mixed`. Mirrors the bulk path's terminal
|
|
372
|
+
// `record('live', null)` (Codex M5b finding #2; the
|
|
373
|
+
// warning-only inference pre-fix missed plain cache hits).
|
|
374
|
+
sourceAgg.record('live', null);
|
|
375
|
+
emitMutation({
|
|
376
|
+
ctx,
|
|
377
|
+
data: mutationResult.projected,
|
|
378
|
+
schema: itemUpdateCommand.outputSchema,
|
|
379
|
+
programOpts: program.opts(),
|
|
380
|
+
warnings,
|
|
381
|
+
...toEmit(mutationResult.response),
|
|
382
|
+
...sourceAgg.result(),
|
|
383
|
+
// resolved_ids — same shape as `item set`. The synthetic
|
|
384
|
+
// `name` field doesn't appear here because the slot only
|
|
385
|
+
// echoes RESOLVED tokens (those that went through the
|
|
386
|
+
// column resolver); `name` skipped that step.
|
|
387
|
+
resolvedIds,
|
|
388
|
+
});
|
|
389
|
+
});
|
|
390
|
+
},
|
|
391
|
+
};
|
|
392
|
+
const executeMutation = async (client, inputs) => {
|
|
393
|
+
const { mutation, itemId, boardId, createLabelsIfMissing } = inputs;
|
|
394
|
+
const labelsFlag = createLabelsIfMissing ?? false;
|
|
395
|
+
if (mutation.kind === 'change_simple_column_value') {
|
|
396
|
+
const response = await client.raw(CHANGE_SIMPLE_COLUMN_VALUE_MUTATION, {
|
|
397
|
+
itemId,
|
|
398
|
+
boardId,
|
|
399
|
+
columnId: mutation.columnId,
|
|
400
|
+
value: mutation.value,
|
|
401
|
+
createLabelsIfMissing: labelsFlag,
|
|
402
|
+
}, { operationName: 'ItemUpdateSimple' });
|
|
403
|
+
return {
|
|
404
|
+
projected: projectMutationItem(response.data.change_simple_column_value, itemId),
|
|
405
|
+
response,
|
|
406
|
+
};
|
|
407
|
+
}
|
|
408
|
+
if (mutation.kind === 'change_column_value') {
|
|
409
|
+
const response = await client.raw(CHANGE_COLUMN_VALUE_MUTATION, {
|
|
410
|
+
itemId,
|
|
411
|
+
boardId,
|
|
412
|
+
columnId: mutation.columnId,
|
|
413
|
+
value: mutation.value,
|
|
414
|
+
createLabelsIfMissing: labelsFlag,
|
|
415
|
+
}, { operationName: 'ItemUpdateRich' });
|
|
416
|
+
return {
|
|
417
|
+
projected: projectMutationItem(response.data.change_column_value, itemId),
|
|
418
|
+
response,
|
|
419
|
+
};
|
|
420
|
+
}
|
|
421
|
+
// change_multiple_column_values — multi-`--set` or `--set + --name`.
|
|
422
|
+
const response = await client.raw(CHANGE_MULTIPLE_COLUMN_VALUES_MUTATION, {
|
|
423
|
+
itemId,
|
|
424
|
+
boardId,
|
|
425
|
+
columnValues: mutation.columnValues,
|
|
426
|
+
createLabelsIfMissing: labelsFlag,
|
|
427
|
+
}, { operationName: 'ItemUpdateMulti' });
|
|
428
|
+
return {
|
|
429
|
+
projected: projectMutationItem(response.data.change_multiple_column_values, itemId),
|
|
430
|
+
response,
|
|
431
|
+
};
|
|
432
|
+
};
|
|
433
|
+
// Thin wrapper around `api/item-mutation-result.ts projectMutationItem`
|
|
434
|
+
// (R28). M5b's `internal_error` + "no item payload" semantics for an
|
|
435
|
+
// empty-payload mutation success are preserved; the wrapper keeps the
|
|
436
|
+
// existing `(raw, itemId)` call signature so the executeMutation arms
|
|
437
|
+
// + the bulk per-item dispatch site stay untouched.
|
|
438
|
+
const projectMutationItem = (raw, itemId) => projectMutationItemShared({
|
|
439
|
+
raw,
|
|
440
|
+
itemId,
|
|
441
|
+
errorCode: 'internal_error',
|
|
442
|
+
errorMessage: `Monday returned no item payload from the mutation for id ${itemId}.`,
|
|
443
|
+
});
|
|
444
|
+
/**
|
|
445
|
+
* Bulk dry-run aggregates per-item resolver warnings — the same
|
|
446
|
+
* `stale_cache_refreshed` / `column_token_collision` signals fire
|
|
447
|
+
* once per item the first time they're triggered (subsequent items
|
|
448
|
+
* hit the now-warm cache). De-duplicates by `code + message +
|
|
449
|
+
* details.token` so an agent reading the dry-run envelope sees
|
|
450
|
+
* each unique warning once rather than N copies. Order-preserving:
|
|
451
|
+
* the first occurrence wins.
|
|
452
|
+
*/
|
|
453
|
+
const dedupeWarnings = (warnings) => {
|
|
454
|
+
const seen = new Set();
|
|
455
|
+
const out = [];
|
|
456
|
+
for (const w of warnings) {
|
|
457
|
+
const tokenKey = typeof w.details?.token === 'string'
|
|
458
|
+
? w.details.token
|
|
459
|
+
: '';
|
|
460
|
+
const key = `${w.code}|${w.message}|${tokenKey}`;
|
|
461
|
+
if (seen.has(key))
|
|
462
|
+
continue;
|
|
463
|
+
seen.add(key);
|
|
464
|
+
out.push(w);
|
|
465
|
+
}
|
|
466
|
+
return out;
|
|
467
|
+
};
|
|
468
|
+
// ============================================================
|
|
469
|
+
// Bulk path (cli-design §10.2 — `--where` / `--filter-json`).
|
|
470
|
+
// items_page walker lifted into `api/items-page-walker.ts` per §18
|
|
471
|
+
// R34 (post-M12) — the helper builds the GraphQL queries inline +
|
|
472
|
+
// parses the response with the per-row schema below, surfacing
|
|
473
|
+
// schema drift as `internal_error` with the failing field path on
|
|
474
|
+
// `details.issues` rather than collapsing to a silent "0 matched,
|
|
475
|
+
// 0 applied" success (the F6 pass-2 hardening lifts to all four
|
|
476
|
+
// items_page consumers automatically).
|
|
477
|
+
// ============================================================
|
|
478
|
+
const bulkItemSchema = z.object({ id: ItemIdSchema }).loose();
|
|
479
|
+
/**
|
|
480
|
+
* Wrapped data shape for the bulk-live success envelope. cli-design
|
|
481
|
+
* §10.2 doesn't pin a specific shape for `data`, so we fold the
|
|
482
|
+
* matched / applied counts into a `summary` slot alongside the
|
|
483
|
+
* per-item projected list. Agents read `data.applied_count` for the
|
|
484
|
+
* "did it work?" probe and `data.items` for the post-mutation state.
|
|
485
|
+
*/
|
|
486
|
+
const bulkLiveDataSchema = z.object({
|
|
487
|
+
summary: z.object({
|
|
488
|
+
matched_count: z.number().int().nonnegative(),
|
|
489
|
+
applied_count: z.number().int().nonnegative(),
|
|
490
|
+
board_id: z.string(),
|
|
491
|
+
}),
|
|
492
|
+
items: z.array(projectedItemSchema),
|
|
493
|
+
});
|
|
494
|
+
/**
|
|
495
|
+
* Bulk path orchestrator (cli-design §10.2). Walks `items_page` to
|
|
496
|
+
* collect every matched item, then dispatches:
|
|
497
|
+
*
|
|
498
|
+
* 1. Without `--yes` AND without `--dry-run` → throw
|
|
499
|
+
* `confirmation_required` with the matched count. Per
|
|
500
|
+
* cli-design §3.1 #7: "destructive ops without `--yes` fail
|
|
501
|
+
* fast." Bulk multi-item mutations qualify.
|
|
502
|
+
* 2. With `--dry-run` → per-item `planChanges` → emit N-element
|
|
503
|
+
* `planned_changes`. cli-design §10.2 line 1456-1457: "both
|
|
504
|
+
* single-item and bulk forms use the same envelope".
|
|
505
|
+
* 3. With `--yes` (and not `--dry-run`) → per-item live mutation
|
|
506
|
+
* via `executeMutation`. Fail-fast on first error; the error
|
|
507
|
+
* envelope's `details.applied_to` lists IDs of items that
|
|
508
|
+
* successfully mutated before the failure.
|
|
509
|
+
*
|
|
510
|
+
* **Why per-item planChanges / executeMutation rather than a
|
|
511
|
+
* single bulk mutation.** Monday has no true bulk-update mutation
|
|
512
|
+
* in 2026-01; the CLI walks items + fires N `change_*` calls. The
|
|
513
|
+
* column resolution + translation work is done once, then reused
|
|
514
|
+
* across every per-item mutation.
|
|
515
|
+
*
|
|
516
|
+
* **Sequential execution.** cli-design §9.3 mandates one-at-a-time
|
|
517
|
+
* requests in v0.1-v0.3; the per-item loop respects that. v0.4's
|
|
518
|
+
* `--concurrency` flag is the future extension point.
|
|
519
|
+
*/
|
|
520
|
+
const runBulk = async (inputs) => {
|
|
521
|
+
const { parsed, client, globalFlags, apiVersion, ctx, programOpts } = inputs;
|
|
522
|
+
/* c8 ignore next 6 — defensive: validateInputShape guarantees
|
|
523
|
+
parsed.board is non-undefined when shape is bulk; the type
|
|
524
|
+
guard exists for TS. */
|
|
525
|
+
if (parsed.board === undefined) {
|
|
526
|
+
throw new UsageError('item update bulk path: --board is required');
|
|
527
|
+
}
|
|
528
|
+
const boardId = parsed.board;
|
|
529
|
+
// 0) Argv-parse-time failures before any network call. Splits +
|
|
530
|
+
// JSON parse run on pure strings; surfacing here means a
|
|
531
|
+
// malformed --set or malformed --set-raw fails fast without
|
|
532
|
+
// burning a board-metadata fetch + items_page walk + the
|
|
533
|
+
// confirmation prompt. M8 finding from review pass: pre-fix the
|
|
534
|
+
// parse ran AFTER the walk, so a malformed JSON paid two
|
|
535
|
+
// GraphQL round-trips before the agent saw the parse error.
|
|
536
|
+
const setEntries = parsed.set.map(splitSetExpression);
|
|
537
|
+
const rawEntries = parsed.setRaw.map(parseSetRawExpression);
|
|
538
|
+
// 1) Load board metadata (cache-aware, refresh on column-not-found
|
|
539
|
+
// during filter parsing per §5.3 step 5).
|
|
540
|
+
const meta = await loadBoardMetadata({
|
|
541
|
+
client,
|
|
542
|
+
boardId,
|
|
543
|
+
env: ctx.env,
|
|
544
|
+
noCache: globalFlags.noCache,
|
|
545
|
+
});
|
|
546
|
+
const onColumnNotFound = meta.source === 'cache'
|
|
547
|
+
? async () => {
|
|
548
|
+
const refreshed = await refreshBoardMetadata({
|
|
549
|
+
client,
|
|
550
|
+
boardId,
|
|
551
|
+
env: ctx.env,
|
|
552
|
+
});
|
|
553
|
+
return refreshed.metadata;
|
|
554
|
+
}
|
|
555
|
+
: undefined;
|
|
556
|
+
const filterResult = await buildQueryParams({
|
|
557
|
+
metadata: meta.metadata,
|
|
558
|
+
resolveMe: resolveMeFactory(client),
|
|
559
|
+
whereClauses: parsed.where,
|
|
560
|
+
filterJson: parsed.filterJson,
|
|
561
|
+
...(onColumnNotFound === undefined ? {} : { onColumnNotFound }),
|
|
562
|
+
});
|
|
563
|
+
// 2) Walk items_page collecting matched item IDs. The §18 R34
|
|
564
|
+
// helper (`fetchItemsPage` / `fetchNextItemsPage`) supplies the
|
|
565
|
+
// GraphQL + parse boundary; `paginate.ts` keeps the §3.1 #8
|
|
566
|
+
// per-page sort + §5.6 `stale_cursor` enrichment.
|
|
567
|
+
const matchedItemIds = [];
|
|
568
|
+
await paginate({
|
|
569
|
+
fetchInitial: () => fetchItemsPage({
|
|
570
|
+
client,
|
|
571
|
+
operationName: 'ItemsPage',
|
|
572
|
+
boardId,
|
|
573
|
+
limit: DEFAULT_PAGE_SIZE,
|
|
574
|
+
queryParams: filterResult.queryParams,
|
|
575
|
+
itemFields: 'id',
|
|
576
|
+
itemSchema: bulkItemSchema,
|
|
577
|
+
}),
|
|
578
|
+
fetchNext: (cursor) => fetchNextItemsPage({
|
|
579
|
+
client,
|
|
580
|
+
operationName: 'NextItemsPage',
|
|
581
|
+
cursor,
|
|
582
|
+
limit: DEFAULT_PAGE_SIZE,
|
|
583
|
+
itemFields: 'id',
|
|
584
|
+
itemSchema: bulkItemSchema,
|
|
585
|
+
}),
|
|
586
|
+
now: ctx.clock,
|
|
587
|
+
extractPage: (r) => r.data,
|
|
588
|
+
getId: (item) => item.id,
|
|
589
|
+
all: true,
|
|
590
|
+
onItem: (item) => {
|
|
591
|
+
matchedItemIds.push(item.id);
|
|
592
|
+
},
|
|
593
|
+
});
|
|
594
|
+
// 3) Empty match set — both dry-run and live are clean no-ops.
|
|
595
|
+
// Emit a success envelope before the confirmation gate fires
|
|
596
|
+
// (Codex pass-1 F1: `--yes` shouldn't be required to confirm
|
|
597
|
+
// "no items matched"). Filter warnings still surface so the
|
|
598
|
+
// agent sees `column_token_collision` / `stale_cache_refreshed`
|
|
599
|
+
// if the empty result was filter-resolved post-refresh.
|
|
600
|
+
//
|
|
601
|
+
// Codex pass-2: source / cacheAgeSeconds aggregate from the metadata
|
|
602
|
+
// load + the items_page walk (always live). Cache-sourced metadata
|
|
603
|
+
// + live walk → `mixed`; pure-cache metadata stays `cache` only on
|
|
604
|
+
// the impossible no-walk path. The live items_page walk forces the
|
|
605
|
+
// aggregate to `mixed` when metadata was cache-served.
|
|
606
|
+
const emptyEnvelopeSource = meta.source === 'cache' ? 'mixed' : 'live';
|
|
607
|
+
if (matchedItemIds.length === 0) {
|
|
608
|
+
if (globalFlags.dryRun) {
|
|
609
|
+
emitDryRun({
|
|
610
|
+
ctx,
|
|
611
|
+
programOpts,
|
|
612
|
+
plannedChanges: [],
|
|
613
|
+
source: emptyEnvelopeSource,
|
|
614
|
+
cacheAgeSeconds: meta.cacheAgeSeconds,
|
|
615
|
+
warnings: filterResult.warnings,
|
|
616
|
+
apiVersion,
|
|
617
|
+
});
|
|
618
|
+
return;
|
|
619
|
+
}
|
|
620
|
+
emitMutation({
|
|
621
|
+
ctx,
|
|
622
|
+
data: {
|
|
623
|
+
summary: { matched_count: 0, applied_count: 0, board_id: boardId },
|
|
624
|
+
items: [],
|
|
625
|
+
},
|
|
626
|
+
schema: bulkLiveDataSchema,
|
|
627
|
+
programOpts,
|
|
628
|
+
warnings: filterResult.warnings,
|
|
629
|
+
source: emptyEnvelopeSource,
|
|
630
|
+
cacheAgeSeconds: meta.cacheAgeSeconds,
|
|
631
|
+
apiVersion,
|
|
632
|
+
});
|
|
633
|
+
return;
|
|
634
|
+
}
|
|
635
|
+
// 4) Confirmation gate. Bulk mutations without --yes (and without
|
|
636
|
+
// --dry-run) surface `confirmation_required` per §3.1 #7 +
|
|
637
|
+
// §6.5. Agents read the matched-item count and re-run with
|
|
638
|
+
// --yes after reviewing. `--yes` is a global flag (program.ts).
|
|
639
|
+
if (!globalFlags.dryRun && !globalFlags.yes) {
|
|
640
|
+
throw new ConfirmationRequiredError(`Bulk item update would mutate ${String(matchedItemIds.length)} ` +
|
|
641
|
+
`matched item(s). Re-run with --yes to confirm, or --dry-run to ` +
|
|
642
|
+
`preview.`, {
|
|
643
|
+
details: {
|
|
644
|
+
board_id: boardId,
|
|
645
|
+
matched_count: matchedItemIds.length,
|
|
646
|
+
where_clauses: parsed.where,
|
|
647
|
+
...(parsed.filterJson === undefined
|
|
648
|
+
? {}
|
|
649
|
+
: { filter_json: parsed.filterJson }),
|
|
650
|
+
hint: 'Use --dry-run to inspect the planned_changes for every ' +
|
|
651
|
+
'matched item before applying.',
|
|
652
|
+
},
|
|
653
|
+
});
|
|
654
|
+
}
|
|
655
|
+
// setEntries + rawEntries pre-parsed at the top of runBulk for the
|
|
656
|
+
// fail-fast invariant. (See step 0 above — moving the parse there
|
|
657
|
+
// means a malformed --set / --set-raw doesn't pay for the metadata
|
|
658
|
+
// load + items_page walk first.)
|
|
659
|
+
const { dateResolution, peopleResolution } = buildResolutionContexts({ client, ctx, globalFlags });
|
|
660
|
+
// 5) Dry-run path: per-item planChanges. Column resolution is
|
|
661
|
+
// cached after the first call; per-item state read fires per
|
|
662
|
+
// item (no item-state cache in v0.1).
|
|
663
|
+
//
|
|
664
|
+
// Codex pass-1 F4: aggregate per-item warnings + source + cache
|
|
665
|
+
// age across the batch. Pre-fix, bulk dry-run dropped per-item
|
|
666
|
+
// results' `warnings` and hardcoded `source: 'mixed'`, losing
|
|
667
|
+
// `column_token_collision` / `stale_cache_refreshed` signals
|
|
668
|
+
// the resolver-warning preservation pattern is meant to keep.
|
|
669
|
+
if (globalFlags.dryRun) {
|
|
670
|
+
const allPlanned = [];
|
|
671
|
+
const aggregatedWarnings = [...filterResult.warnings];
|
|
672
|
+
const sourceAgg = new SourceAggregator({
|
|
673
|
+
source: meta.source,
|
|
674
|
+
cacheAgeSeconds: meta.cacheAgeSeconds,
|
|
675
|
+
});
|
|
676
|
+
for (const itemId of matchedItemIds) {
|
|
677
|
+
const result = await planChanges({
|
|
678
|
+
client,
|
|
679
|
+
boardId,
|
|
680
|
+
itemId,
|
|
681
|
+
setEntries,
|
|
682
|
+
...(rawEntries.length === 0 ? {} : { rawEntries }),
|
|
683
|
+
...(parsed.name === undefined ? {} : { nameChange: parsed.name }),
|
|
684
|
+
dateResolution,
|
|
685
|
+
peopleResolution,
|
|
686
|
+
env: ctx.env,
|
|
687
|
+
noCache: globalFlags.noCache,
|
|
688
|
+
});
|
|
689
|
+
for (const plan of result.plannedChanges) {
|
|
690
|
+
allPlanned.push(plan);
|
|
691
|
+
}
|
|
692
|
+
// Resolver warnings can fire per item (the cache-miss-refresh
|
|
693
|
+
// dance is per-token). Most fire on the first item only (cache
|
|
694
|
+
// populated for subsequent items), but the helper deduplicates
|
|
695
|
+
// by code+message+token below for compactness.
|
|
696
|
+
for (const w of result.warnings) {
|
|
697
|
+
aggregatedWarnings.push(w);
|
|
698
|
+
}
|
|
699
|
+
sourceAgg.record(result.source, result.cacheAgeSeconds);
|
|
700
|
+
}
|
|
701
|
+
emitDryRun({
|
|
702
|
+
ctx,
|
|
703
|
+
programOpts,
|
|
704
|
+
plannedChanges: allPlanned,
|
|
705
|
+
...sourceAgg.result(),
|
|
706
|
+
warnings: dedupeWarnings(aggregatedWarnings),
|
|
707
|
+
apiVersion,
|
|
708
|
+
});
|
|
709
|
+
return;
|
|
710
|
+
}
|
|
711
|
+
// 5) Live path: per-item mutation. Resolve columns once, translate
|
|
712
|
+
// once, then fire the same SelectedMutation against every
|
|
713
|
+
// matched item.
|
|
714
|
+
//
|
|
715
|
+
// Three-pass resolution (Codex M8 finding #2): resolve every token
|
|
716
|
+
// first, run the cross-token duplicate-resolved-ID check, then
|
|
717
|
+
// translate. Pre-fix, translation ran inline, so a `--set X=bad`
|
|
718
|
+
// alongside a `--set-raw X={...}` could surface the translation
|
|
719
|
+
// `usage_error` instead of the mutual-exclusion `usage_error` per
|
|
720
|
+
// cli-design §5.3 line 961-972.
|
|
721
|
+
//
|
|
722
|
+
// Three-pass resolution + translation through the shared helper
|
|
723
|
+
// (R20 lift). The board-metadata leg's source / cacheAge seed the
|
|
724
|
+
// aggregator so a cache-served metadata fetch promotes the final
|
|
725
|
+
// envelope source to `mixed` when subsequent resolution legs hit
|
|
726
|
+
// live (Codex M8 finding #3).
|
|
727
|
+
//
|
|
728
|
+
// `collectedWarnings` is the union of filter warnings + resolver
|
|
729
|
+
// warnings, surfaced on the success envelope. `resolverWarnings`
|
|
730
|
+
// is the narrowed subset used by foldResolverWarningsIntoError —
|
|
731
|
+
// the helper's contract is to fold collision / stale_cache_refreshed
|
|
732
|
+
// signals, not generic Warning types.
|
|
733
|
+
const resolutionResult = await resolveAndTranslate({
|
|
734
|
+
client,
|
|
735
|
+
boardId,
|
|
736
|
+
setEntries,
|
|
737
|
+
rawEntries,
|
|
738
|
+
dateResolution,
|
|
739
|
+
peopleResolution,
|
|
740
|
+
env: ctx.env,
|
|
741
|
+
noCache: globalFlags.noCache,
|
|
742
|
+
initialSource: meta.source,
|
|
743
|
+
initialCacheAgeSeconds: meta.cacheAgeSeconds,
|
|
744
|
+
});
|
|
745
|
+
const collectedWarnings = [
|
|
746
|
+
...filterResult.warnings,
|
|
747
|
+
...resolutionResult.warnings,
|
|
748
|
+
];
|
|
749
|
+
const resolverWarnings = [...resolutionResult.warnings];
|
|
750
|
+
const resolvedIds = resolutionResult.resolvedIds;
|
|
751
|
+
// resolveAndTranslate was seeded with meta.source / meta.cacheAge
|
|
752
|
+
// above, so resolutionResult.source is always defined post-helper.
|
|
753
|
+
// The `?? meta.source` fallback preserves the pre-R30 c8-ignored
|
|
754
|
+
// defensive widening; flow then folds the per-item mutation legs
|
|
755
|
+
// (always live) at emit time via `sourceAgg.record('live', null)`.
|
|
756
|
+
const sourceAgg = new SourceAggregator();
|
|
757
|
+
/* c8 ignore next 3 — defensive: initialSource seeded above so
|
|
758
|
+
resolutionResult.source is always defined post-helper. */
|
|
759
|
+
const remapSource = resolutionResult.source ?? meta.source;
|
|
760
|
+
sourceAgg.record(remapSource, resolutionResult.cacheAgeSeconds);
|
|
761
|
+
const translated = resolutionResult.translated;
|
|
762
|
+
const allTranslated = parsed.name === undefined
|
|
763
|
+
? translated
|
|
764
|
+
: [
|
|
765
|
+
{
|
|
766
|
+
columnId: 'name',
|
|
767
|
+
columnType: 'text',
|
|
768
|
+
rawInput: parsed.name,
|
|
769
|
+
payload: { format: 'simple', value: parsed.name },
|
|
770
|
+
resolvedFrom: null,
|
|
771
|
+
peopleResolution: null,
|
|
772
|
+
},
|
|
773
|
+
...translated,
|
|
774
|
+
];
|
|
775
|
+
const mutation = selectMutation(allTranslated);
|
|
776
|
+
const appliedItems = [];
|
|
777
|
+
// Codex pass-1 F3: F4's `validation_failed` → `column_archived`
|
|
778
|
+
// remap must fire on bulk per-item failures too — agents key off
|
|
779
|
+
// the stable `column_archived` code regardless of whether the
|
|
780
|
+
// mutation came from item set / item update single / item update
|
|
781
|
+
// bulk. Pre-fix, bulk failures only ran the resolver-warning
|
|
782
|
+
// fold + bulk-progress decoration; the remap was missing.
|
|
783
|
+
// Codex M5b finding #3: probe every translated column id, not
|
|
784
|
+
// just the first, so a multi-column bulk update where a LATER
|
|
785
|
+
// target was archived after a stale cache read still surfaces
|
|
786
|
+
// `column_archived`. Single-column bulk passes a one-element
|
|
787
|
+
// array, same as before.
|
|
788
|
+
const remapColumnIds = translated.map((t) => t.columnId);
|
|
789
|
+
for (const itemId of matchedItemIds) {
|
|
790
|
+
try {
|
|
791
|
+
const result = await executeMutation(client, {
|
|
792
|
+
mutation,
|
|
793
|
+
itemId,
|
|
794
|
+
boardId,
|
|
795
|
+
createLabelsIfMissing: parsed.createLabelsIfMissing,
|
|
796
|
+
});
|
|
797
|
+
appliedItems.push(result.projected);
|
|
798
|
+
}
|
|
799
|
+
catch (err) {
|
|
800
|
+
if (err instanceof MondayCliError) {
|
|
801
|
+
// Apply fold + F4 remap before bulk-progress decoration. The
|
|
802
|
+
// remap returns the original error unchanged when its
|
|
803
|
+
// preconditions aren't met (non-validation_failed, live
|
|
804
|
+
// source, refresh failure, post-refresh column still
|
|
805
|
+
// active). When it DOES fire, the remapped error keeps the
|
|
806
|
+
// resolver_warnings slot we just folded in.
|
|
807
|
+
const remapped = await foldAndRemap({
|
|
808
|
+
err,
|
|
809
|
+
warnings: resolverWarnings,
|
|
810
|
+
client,
|
|
811
|
+
boardId,
|
|
812
|
+
columnIds: remapColumnIds,
|
|
813
|
+
env: ctx.env,
|
|
814
|
+
noCache: globalFlags.noCache,
|
|
815
|
+
resolutionSource: remapSource,
|
|
816
|
+
});
|
|
817
|
+
// Decorate with bulk-progress details so agents can see how
|
|
818
|
+
// many items mutated successfully before the failure.
|
|
819
|
+
const existing = remapped.details ?? {};
|
|
820
|
+
if (remapped.code === 'usage_error') {
|
|
821
|
+
throw new UsageError(remapped.message, {
|
|
822
|
+
...(remapped.cause === undefined ? {} : { cause: remapped.cause }),
|
|
823
|
+
details: {
|
|
824
|
+
...existing,
|
|
825
|
+
applied_count: appliedItems.length,
|
|
826
|
+
applied_to: appliedItems.map((i) => i.id),
|
|
827
|
+
failed_at_item: itemId,
|
|
828
|
+
matched_count: matchedItemIds.length,
|
|
829
|
+
},
|
|
830
|
+
});
|
|
831
|
+
}
|
|
832
|
+
throw new ApiError(remapped.code, remapped.message, {
|
|
833
|
+
...(remapped.cause === undefined ? {} : { cause: remapped.cause }),
|
|
834
|
+
...(remapped.httpStatus === undefined ? {} : { httpStatus: remapped.httpStatus }),
|
|
835
|
+
...(remapped.mondayCode === undefined ? {} : { mondayCode: remapped.mondayCode }),
|
|
836
|
+
...(remapped.requestId === undefined ? {} : { requestId: remapped.requestId }),
|
|
837
|
+
retryable: remapped.retryable,
|
|
838
|
+
...(remapped.retryAfterSeconds === undefined ? {} : { retryAfterSeconds: remapped.retryAfterSeconds }),
|
|
839
|
+
details: {
|
|
840
|
+
...existing,
|
|
841
|
+
applied_count: appliedItems.length,
|
|
842
|
+
applied_to: appliedItems.map((i) => i.id),
|
|
843
|
+
failed_at_item: itemId,
|
|
844
|
+
matched_count: matchedItemIds.length,
|
|
845
|
+
},
|
|
846
|
+
});
|
|
847
|
+
}
|
|
848
|
+
throw err;
|
|
849
|
+
}
|
|
850
|
+
}
|
|
851
|
+
// Codex pass-2: aggregate `meta.source` + `cache_age_seconds`
|
|
852
|
+
// properly per cli-design §6.1. Pre-fix, source was inferred from
|
|
853
|
+
// warning presence — a plain cache hit (no warning) on metadata
|
|
854
|
+
// would surface as `live` even though the resolver served from
|
|
855
|
+
// cache. M4 pinned this exact regression for read commands; the
|
|
856
|
+
// bulk write path replicated the bug.
|
|
857
|
+
//
|
|
858
|
+
// The items_page walk and per-item mutations always fire live —
|
|
859
|
+
// record one terminal `live` leg so a fully-cached metadata +
|
|
860
|
+
// column-resolution path still surfaces as `mixed` (cache-served
|
|
861
|
+
// metadata + live wire calls). N per-item mutations collapse to
|
|
862
|
+
// one `record('live', null)` because mergeSource is idempotent
|
|
863
|
+
// for a constant second leg. Mirrors the empty-match no-op
|
|
864
|
+
// path's `emptyEnvelopeSource` derivation.
|
|
865
|
+
sourceAgg.record('live', null);
|
|
866
|
+
emitMutation({
|
|
867
|
+
ctx,
|
|
868
|
+
data: {
|
|
869
|
+
summary: {
|
|
870
|
+
matched_count: matchedItemIds.length,
|
|
871
|
+
applied_count: appliedItems.length,
|
|
872
|
+
board_id: boardId,
|
|
873
|
+
},
|
|
874
|
+
items: appliedItems,
|
|
875
|
+
},
|
|
876
|
+
schema: bulkLiveDataSchema,
|
|
877
|
+
programOpts,
|
|
878
|
+
warnings: collectedWarnings,
|
|
879
|
+
...sourceAgg.result(),
|
|
880
|
+
apiVersion,
|
|
881
|
+
resolvedIds,
|
|
882
|
+
});
|
|
883
|
+
};
|
|
884
|
+
//# sourceMappingURL=update.js.map
|