monday-cli 0.2.0 → 0.4.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 +675 -2
- package/README.md +223 -31
- package/dist/api/assets.d.ts +326 -0
- package/dist/api/assets.d.ts.map +1 -0
- package/dist/api/assets.js +519 -0
- package/dist/api/assets.js.map +1 -0
- package/dist/api/board-favorites.d.ts +329 -0
- package/dist/api/board-favorites.d.ts.map +1 -0
- package/dist/api/board-favorites.js +353 -0
- package/dist/api/board-favorites.js.map +1 -0
- package/dist/api/board-mutation-result.d.ts +9 -5
- package/dist/api/board-mutation-result.d.ts.map +1 -1
- package/dist/api/board-mutation-result.js +9 -5
- package/dist/api/board-mutation-result.js.map +1 -1
- package/dist/api/board-relation-validation.d.ts +161 -0
- package/dist/api/board-relation-validation.d.ts.map +1 -0
- package/dist/api/board-relation-validation.js +317 -0
- package/dist/api/board-relation-validation.js.map +1 -0
- package/dist/api/cache.d.ts +14 -5
- package/dist/api/cache.d.ts.map +1 -1
- package/dist/api/cache.js +8 -10
- package/dist/api/cache.js.map +1 -1
- package/dist/api/column-mapping.js +2 -2
- package/dist/api/column-mapping.js.map +1 -1
- package/dist/api/column-mutation-result.d.ts +9 -5
- package/dist/api/column-mutation-result.d.ts.map +1 -1
- package/dist/api/column-mutation-result.js +9 -5
- package/dist/api/column-mutation-result.js.map +1 -1
- package/dist/api/column-types.d.ts +37 -14
- package/dist/api/column-types.d.ts.map +1 -1
- package/dist/api/column-types.js +47 -6
- package/dist/api/column-types.js.map +1 -1
- package/dist/api/column-values.d.ts +234 -31
- package/dist/api/column-values.d.ts.map +1 -1
- package/dist/api/column-values.js +560 -124
- package/dist/api/column-values.js.map +1 -1
- package/dist/api/cross-board-search.d.ts +501 -0
- package/dist/api/cross-board-search.d.ts.map +1 -0
- package/dist/api/cross-board-search.js +547 -0
- package/dist/api/cross-board-search.js.map +1 -0
- package/dist/api/dev-conventions.d.ts +1038 -0
- package/dist/api/dev-conventions.d.ts.map +1 -0
- package/dist/api/dev-conventions.js +1556 -0
- package/dist/api/dev-conventions.js.map +1 -0
- package/dist/api/documents.d.ts +519 -0
- package/dist/api/documents.d.ts.map +1 -0
- package/dist/api/documents.js +586 -0
- package/dist/api/documents.js.map +1 -0
- package/dist/api/dry-run.d.ts +32 -5
- package/dist/api/dry-run.d.ts.map +1 -1
- package/dist/api/dry-run.js +149 -32
- package/dist/api/dry-run.js.map +1 -1
- package/dist/api/errors.d.ts.map +1 -1
- package/dist/api/errors.js +28 -7
- package/dist/api/errors.js.map +1 -1
- package/dist/api/group-mutation-result.d.ts +9 -5
- package/dist/api/group-mutation-result.d.ts.map +1 -1
- package/dist/api/group-mutation-result.js +9 -5
- package/dist/api/group-mutation-result.js.map +1 -1
- package/dist/api/item-history-projection.d.ts +919 -0
- package/dist/api/item-history-projection.d.ts.map +1 -0
- package/dist/api/item-history-projection.js +1104 -0
- package/dist/api/item-history-projection.js.map +1 -0
- package/dist/api/item-mutation-execute.d.ts +82 -0
- package/dist/api/item-mutation-execute.d.ts.map +1 -0
- package/dist/api/item-mutation-execute.js +199 -0
- package/dist/api/item-mutation-execute.js.map +1 -0
- package/dist/api/item-watch.d.ts +263 -0
- package/dist/api/item-watch.d.ts.map +1 -0
- package/dist/api/item-watch.js +709 -0
- package/dist/api/item-watch.js.map +1 -0
- package/dist/api/multipart-transport.d.ts +223 -0
- package/dist/api/multipart-transport.d.ts.map +1 -0
- package/dist/api/multipart-transport.js +274 -0
- package/dist/api/multipart-transport.js.map +1 -0
- package/dist/api/notifications.d.ts +156 -0
- package/dist/api/notifications.d.ts.map +1 -0
- package/dist/api/notifications.js +215 -0
- package/dist/api/notifications.js.map +1 -0
- package/dist/api/oauth-test-helper.d.ts +64 -0
- package/dist/api/oauth-test-helper.d.ts.map +1 -0
- package/dist/api/oauth-test-helper.js +179 -0
- package/dist/api/oauth-test-helper.js.map +1 -0
- package/dist/api/oauth.d.ts +198 -0
- package/dist/api/oauth.d.ts.map +1 -0
- package/dist/api/oauth.js +471 -0
- package/dist/api/oauth.js.map +1 -0
- package/dist/api/parallel-dispatch.d.ts +155 -0
- package/dist/api/parallel-dispatch.d.ts.map +1 -0
- package/dist/api/parallel-dispatch.js +243 -0
- package/dist/api/parallel-dispatch.js.map +1 -0
- package/dist/api/partial-success-bulk.d.ts +480 -0
- package/dist/api/partial-success-bulk.d.ts.map +1 -0
- package/dist/api/partial-success-bulk.js +436 -0
- package/dist/api/partial-success-bulk.js.map +1 -0
- package/dist/api/partial-success-mutation.d.ts +13 -1
- package/dist/api/partial-success-mutation.d.ts.map +1 -1
- package/dist/api/partial-success-mutation.js +5 -1
- package/dist/api/partial-success-mutation.js.map +1 -1
- package/dist/api/people.d.ts +54 -1
- package/dist/api/people.d.ts.map +1 -1
- package/dist/api/people.js +27 -3
- package/dist/api/people.js.map +1 -1
- package/dist/api/probes.d.ts +487 -0
- package/dist/api/probes.d.ts.map +1 -0
- package/dist/api/probes.js +881 -0
- package/dist/api/probes.js.map +1 -0
- package/dist/api/raw-document.d.ts.map +1 -1
- package/dist/api/raw-document.js +2 -2
- package/dist/api/raw-document.js.map +1 -1
- package/dist/api/raw-write.d.ts +12 -4
- package/dist/api/raw-write.d.ts.map +1 -1
- package/dist/api/raw-write.js +32 -14
- package/dist/api/raw-write.js.map +1 -1
- package/dist/api/resolution-context.d.ts +23 -11
- package/dist/api/resolution-context.d.ts.map +1 -1
- package/dist/api/resolution-context.js +53 -12
- package/dist/api/resolution-context.js.map +1 -1
- package/dist/api/resolution-pass.d.ts +30 -1
- package/dist/api/resolution-pass.d.ts.map +1 -1
- package/dist/api/resolution-pass.js +36 -1
- package/dist/api/resolution-pass.js.map +1 -1
- package/dist/api/resolve-client.d.ts +22 -0
- package/dist/api/resolve-client.d.ts.map +1 -1
- package/dist/api/resolve-client.js +9 -1
- package/dist/api/resolve-client.js.map +1 -1
- package/dist/api/response-root.d.ts +92 -46
- package/dist/api/response-root.d.ts.map +1 -1
- package/dist/api/response-root.js +93 -41
- package/dist/api/response-root.js.map +1 -1
- package/dist/api/tag-directory.d.ts +154 -0
- package/dist/api/tag-directory.d.ts.map +1 -0
- package/dist/api/tag-directory.js +325 -0
- package/dist/api/tag-directory.js.map +1 -0
- package/dist/api/time-tracking.d.ts +165 -0
- package/dist/api/time-tracking.d.ts.map +1 -0
- package/dist/api/time-tracking.js +135 -0
- package/dist/api/time-tracking.js.map +1 -0
- package/dist/api/transport.js +3 -3
- package/dist/api/transport.js.map +1 -1
- package/dist/api/usage.d.ts +190 -0
- package/dist/api/usage.d.ts.map +1 -0
- package/dist/api/usage.js +194 -0
- package/dist/api/usage.js.map +1 -0
- package/dist/api/users-fan-out-mutation.d.ts.map +1 -1
- package/dist/api/users-fan-out-mutation.js +10 -5
- package/dist/api/users-fan-out-mutation.js.map +1 -1
- package/dist/api/webhooks.d.ts +357 -0
- package/dist/api/webhooks.d.ts.map +1 -0
- package/dist/api/webhooks.js +333 -0
- package/dist/api/webhooks.js.map +1 -0
- package/dist/cli/envelope-out.d.ts +18 -1
- package/dist/cli/envelope-out.d.ts.map +1 -1
- package/dist/cli/envelope-out.js +16 -2
- package/dist/cli/envelope-out.js.map +1 -1
- package/dist/cli/program.d.ts.map +1 -1
- package/dist/cli/program.js +120 -1
- package/dist/cli/program.js.map +1 -1
- package/dist/cli/run.d.ts +32 -0
- package/dist/cli/run.d.ts.map +1 -1
- package/dist/cli/run.js +3 -0
- package/dist/cli/run.js.map +1 -1
- package/dist/commands/account/tags.d.ts +37 -0
- package/dist/commands/account/tags.d.ts.map +1 -0
- package/dist/commands/account/tags.js +84 -0
- package/dist/commands/account/tags.js.map +1 -0
- package/dist/commands/auth/login.d.ts +14 -0
- package/dist/commands/auth/login.d.ts.map +1 -0
- package/dist/commands/auth/login.js +314 -0
- package/dist/commands/auth/login.js.map +1 -0
- package/dist/commands/auth/logout.d.ts +28 -0
- package/dist/commands/auth/logout.d.ts.map +1 -0
- package/dist/commands/auth/logout.js +94 -0
- package/dist/commands/auth/logout.js.map +1 -0
- package/dist/commands/board/archive.d.ts.map +1 -1
- package/dist/commands/board/archive.js +14 -14
- package/dist/commands/board/archive.js.map +1 -1
- package/dist/commands/board/column-create.d.ts +9 -8
- package/dist/commands/board/column-create.d.ts.map +1 -1
- package/dist/commands/board/column-create.js +61 -51
- package/dist/commands/board/column-create.js.map +1 -1
- package/dist/commands/board/column-delete.d.ts.map +1 -1
- package/dist/commands/board/column-delete.js +15 -16
- package/dist/commands/board/column-delete.js.map +1 -1
- package/dist/commands/board/column-update.d.ts.map +1 -1
- package/dist/commands/board/column-update.js +23 -22
- package/dist/commands/board/column-update.js.map +1 -1
- package/dist/commands/board/create.d.ts.map +1 -1
- package/dist/commands/board/create.js +14 -17
- package/dist/commands/board/create.js.map +1 -1
- package/dist/commands/board/delete.d.ts.map +1 -1
- package/dist/commands/board/delete.js +12 -15
- package/dist/commands/board/delete.js.map +1 -1
- package/dist/commands/board/describe.d.ts.map +1 -1
- package/dist/commands/board/describe.js +30 -0
- package/dist/commands/board/describe.js.map +1 -1
- package/dist/commands/board/duplicate.d.ts.map +1 -1
- package/dist/commands/board/duplicate.js +12 -13
- package/dist/commands/board/duplicate.js.map +1 -1
- package/dist/commands/board/favorites.d.ts +33 -0
- package/dist/commands/board/favorites.d.ts.map +1 -0
- package/dist/commands/board/favorites.js +74 -0
- package/dist/commands/board/favorites.js.map +1 -0
- package/dist/commands/board/find.d.ts +1 -1
- package/dist/commands/board/group-archive.d.ts.map +1 -1
- package/dist/commands/board/group-archive.js +12 -16
- package/dist/commands/board/group-archive.js.map +1 -1
- package/dist/commands/board/group-create.d.ts.map +1 -1
- package/dist/commands/board/group-create.js +9 -19
- package/dist/commands/board/group-create.js.map +1 -1
- package/dist/commands/board/group-delete.d.ts.map +1 -1
- package/dist/commands/board/group-delete.js +12 -16
- package/dist/commands/board/group-delete.js.map +1 -1
- package/dist/commands/board/group-duplicate.d.ts.map +1 -1
- package/dist/commands/board/group-duplicate.js +12 -16
- package/dist/commands/board/group-duplicate.js.map +1 -1
- package/dist/commands/board/group-update.d.ts.map +1 -1
- package/dist/commands/board/group-update.js +12 -11
- package/dist/commands/board/group-update.js.map +1 -1
- package/dist/commands/board/list.d.ts +1 -1
- package/dist/commands/board/update.d.ts.map +1 -1
- package/dist/commands/board/update.js +16 -11
- package/dist/commands/board/update.js.map +1 -1
- package/dist/commands/cache/list.d.ts +2 -0
- package/dist/commands/cache/list.d.ts.map +1 -1
- package/dist/commands/cache/list.js +2 -2
- package/dist/commands/cache/list.js.map +1 -1
- package/dist/commands/completion.d.ts +188 -0
- package/dist/commands/completion.d.ts.map +1 -0
- package/dist/commands/completion.js +418 -0
- package/dist/commands/completion.js.map +1 -0
- package/dist/commands/dev/_shared.d.ts +40 -0
- package/dist/commands/dev/_shared.d.ts.map +1 -0
- package/dist/commands/dev/_shared.js +104 -0
- package/dist/commands/dev/_shared.js.map +1 -0
- package/dist/commands/dev/configure.d.ts +36 -0
- package/dist/commands/dev/configure.d.ts.map +1 -0
- package/dist/commands/dev/configure.js +145 -0
- package/dist/commands/dev/configure.js.map +1 -0
- package/dist/commands/dev/discover.d.ts +34 -0
- package/dist/commands/dev/discover.d.ts.map +1 -0
- package/dist/commands/dev/discover.js +117 -0
- package/dist/commands/dev/discover.js.map +1 -0
- package/dist/commands/dev/doctor.d.ts +39 -0
- package/dist/commands/dev/doctor.d.ts.map +1 -0
- package/dist/commands/dev/doctor.js +91 -0
- package/dist/commands/dev/doctor.js.map +1 -0
- package/dist/commands/dev/epic/items.d.ts +24 -0
- package/dist/commands/dev/epic/items.d.ts.map +1 -0
- package/dist/commands/dev/epic/items.js +103 -0
- package/dist/commands/dev/epic/items.js.map +1 -0
- package/dist/commands/dev/epic/list.d.ts +36 -0
- package/dist/commands/dev/epic/list.d.ts.map +1 -0
- package/dist/commands/dev/epic/list.js +120 -0
- package/dist/commands/dev/epic/list.js.map +1 -0
- package/dist/commands/dev/release/list.d.ts +21 -0
- package/dist/commands/dev/release/list.d.ts.map +1 -0
- package/dist/commands/dev/release/list.js +73 -0
- package/dist/commands/dev/release/list.js.map +1 -0
- package/dist/commands/dev/sprint/current.d.ts +24 -0
- package/dist/commands/dev/sprint/current.d.ts.map +1 -0
- package/dist/commands/dev/sprint/current.js +90 -0
- package/dist/commands/dev/sprint/current.js.map +1 -0
- package/dist/commands/dev/sprint/items.d.ts +34 -0
- package/dist/commands/dev/sprint/items.d.ts.map +1 -0
- package/dist/commands/dev/sprint/items.js +118 -0
- package/dist/commands/dev/sprint/items.js.map +1 -0
- package/dist/commands/dev/sprint/list.d.ts +41 -0
- package/dist/commands/dev/sprint/list.d.ts.map +1 -0
- package/dist/commands/dev/sprint/list.js +104 -0
- package/dist/commands/dev/sprint/list.js.map +1 -0
- package/dist/commands/dev/task/block.d.ts +29 -0
- package/dist/commands/dev/task/block.d.ts.map +1 -0
- package/dist/commands/dev/task/block.js +106 -0
- package/dist/commands/dev/task/block.js.map +1 -0
- package/dist/commands/dev/task/done.d.ts +30 -0
- package/dist/commands/dev/task/done.d.ts.map +1 -0
- package/dist/commands/dev/task/done.js +113 -0
- package/dist/commands/dev/task/done.js.map +1 -0
- package/dist/commands/dev/task/list.d.ts +42 -0
- package/dist/commands/dev/task/list.d.ts.map +1 -0
- package/dist/commands/dev/task/list.js +227 -0
- package/dist/commands/dev/task/list.js.map +1 -0
- package/dist/commands/dev/task/start.d.ts +29 -0
- package/dist/commands/dev/task/start.d.ts.map +1 -0
- package/dist/commands/dev/task/start.js +90 -0
- package/dist/commands/dev/task/start.js.map +1 -0
- package/dist/commands/doc/get.d.ts +46 -0
- package/dist/commands/doc/get.d.ts.map +1 -0
- package/dist/commands/doc/get.js +95 -0
- package/dist/commands/doc/get.js.map +1 -0
- package/dist/commands/doc/list.d.ts +83 -0
- package/dist/commands/doc/list.d.ts.map +1 -0
- package/dist/commands/doc/list.js +248 -0
- package/dist/commands/doc/list.js.map +1 -0
- package/dist/commands/emit.d.ts.map +1 -1
- package/dist/commands/emit.js +5 -3
- package/dist/commands/emit.js.map +1 -1
- package/dist/commands/index.d.ts.map +1 -1
- package/dist/commands/index.js +141 -0
- package/dist/commands/index.js.map +1 -1
- package/dist/commands/item/archive.d.ts.map +1 -1
- package/dist/commands/item/archive.js +11 -0
- package/dist/commands/item/archive.js.map +1 -1
- package/dist/commands/item/clear.d.ts.map +1 -1
- package/dist/commands/item/clear.js +15 -0
- package/dist/commands/item/clear.js.map +1 -1
- package/dist/commands/item/create.d.ts.map +1 -1
- package/dist/commands/item/create.js +41 -8
- package/dist/commands/item/create.js.map +1 -1
- package/dist/commands/item/delete.d.ts.map +1 -1
- package/dist/commands/item/delete.js +11 -0
- package/dist/commands/item/delete.js.map +1 -1
- package/dist/commands/item/duplicate.d.ts.map +1 -1
- package/dist/commands/item/duplicate.js +12 -0
- package/dist/commands/item/duplicate.js.map +1 -1
- package/dist/commands/item/history.d.ts +60 -0
- package/dist/commands/item/history.d.ts.map +1 -0
- package/dist/commands/item/history.js +309 -0
- package/dist/commands/item/history.js.map +1 -0
- package/dist/commands/item/list.d.ts.map +1 -1
- package/dist/commands/item/list.js +16 -13
- package/dist/commands/item/list.js.map +1 -1
- package/dist/commands/item/move.d.ts.map +1 -1
- package/dist/commands/item/move.js +41 -7
- package/dist/commands/item/move.js.map +1 -1
- package/dist/commands/item/search.d.ts +99 -15
- package/dist/commands/item/search.d.ts.map +1 -1
- package/dist/commands/item/search.js +480 -36
- package/dist/commands/item/search.js.map +1 -1
- package/dist/commands/item/set.d.ts.map +1 -1
- package/dist/commands/item/set.js +52 -8
- package/dist/commands/item/set.js.map +1 -1
- package/dist/commands/item/time-track/start.d.ts +61 -0
- package/dist/commands/item/time-track/start.d.ts.map +1 -0
- package/dist/commands/item/time-track/start.js +138 -0
- package/dist/commands/item/time-track/start.js.map +1 -0
- package/dist/commands/item/time-track/stop.d.ts +32 -0
- package/dist/commands/item/time-track/stop.d.ts.map +1 -0
- package/dist/commands/item/time-track/stop.js +97 -0
- package/dist/commands/item/time-track/stop.js.map +1 -0
- package/dist/commands/item/update.d.ts +2 -0
- package/dist/commands/item/update.d.ts.map +1 -1
- package/dist/commands/item/update.js +164 -113
- package/dist/commands/item/update.js.map +1 -1
- package/dist/commands/item/upload.d.ts +108 -0
- package/dist/commands/item/upload.d.ts.map +1 -0
- package/dist/commands/item/upload.js +370 -0
- package/dist/commands/item/upload.js.map +1 -0
- package/dist/commands/item/upsert.d.ts.map +1 -1
- package/dist/commands/item/upsert.js +48 -1
- package/dist/commands/item/upsert.js.map +1 -1
- package/dist/commands/item/watch.d.ts +90 -0
- package/dist/commands/item/watch.d.ts.map +1 -0
- package/dist/commands/item/watch.js +342 -0
- package/dist/commands/item/watch.js.map +1 -0
- package/dist/commands/notification/send.d.ts +60 -0
- package/dist/commands/notification/send.d.ts.map +1 -0
- package/dist/commands/notification/send.js +147 -0
- package/dist/commands/notification/send.js.map +1 -0
- package/dist/commands/parse-argv.d.ts.map +1 -1
- package/dist/commands/parse-argv.js +14 -4
- package/dist/commands/parse-argv.js.map +1 -1
- package/dist/commands/raw/index.d.ts.map +1 -1
- package/dist/commands/raw/index.js +13 -15
- package/dist/commands/raw/index.js.map +1 -1
- package/dist/commands/run-by-id-lookup.d.ts.map +1 -1
- package/dist/commands/run-by-id-lookup.js +2 -2
- package/dist/commands/run-by-id-lookup.js.map +1 -1
- package/dist/commands/schema/index.d.ts +2 -0
- package/dist/commands/schema/index.d.ts.map +1 -1
- package/dist/commands/status.d.ts +120 -0
- package/dist/commands/status.d.ts.map +1 -0
- package/dist/commands/status.js +365 -0
- package/dist/commands/status.js.map +1 -0
- package/dist/commands/update/body-source.d.ts.map +1 -1
- package/dist/commands/update/body-source.js +2 -2
- package/dist/commands/update/body-source.js.map +1 -1
- package/dist/commands/update/create.d.ts +2 -3
- package/dist/commands/update/create.d.ts.map +1 -1
- package/dist/commands/update/create.js +15 -3
- package/dist/commands/update/create.js.map +1 -1
- package/dist/commands/update/delete.d.ts.map +1 -1
- package/dist/commands/update/delete.js +11 -0
- package/dist/commands/update/delete.js.map +1 -1
- package/dist/commands/update/edit.d.ts.map +1 -1
- package/dist/commands/update/edit.js +11 -0
- package/dist/commands/update/edit.js.map +1 -1
- package/dist/commands/update/list.d.ts.map +1 -1
- package/dist/commands/update/list.js +15 -12
- package/dist/commands/update/list.js.map +1 -1
- package/dist/commands/update/reply.d.ts.map +1 -1
- package/dist/commands/update/reply.js +11 -0
- package/dist/commands/update/reply.js.map +1 -1
- package/dist/commands/update/toggle.d.ts.map +1 -1
- package/dist/commands/update/toggle.js +13 -0
- package/dist/commands/update/toggle.js.map +1 -1
- package/dist/commands/update/upload.d.ts +69 -0
- package/dist/commands/update/upload.d.ts.map +1 -0
- package/dist/commands/update/upload.js +235 -0
- package/dist/commands/update/upload.js.map +1 -0
- package/dist/commands/usage.d.ts +58 -0
- package/dist/commands/usage.d.ts.map +1 -0
- package/dist/commands/usage.js +94 -0
- package/dist/commands/usage.js.map +1 -0
- package/dist/commands/webhook/create.d.ts +74 -0
- package/dist/commands/webhook/create.d.ts.map +1 -0
- package/dist/commands/webhook/create.js +150 -0
- package/dist/commands/webhook/create.js.map +1 -0
- package/dist/commands/webhook/delete.d.ts +46 -0
- package/dist/commands/webhook/delete.d.ts.map +1 -0
- package/dist/commands/webhook/delete.js +141 -0
- package/dist/commands/webhook/delete.js.map +1 -0
- package/dist/commands/webhook/list.d.ts +23 -0
- package/dist/commands/webhook/list.d.ts.map +1 -0
- package/dist/commands/webhook/list.js +68 -0
- package/dist/commands/webhook/list.js.map +1 -0
- package/dist/commands/workspace/create.d.ts.map +1 -1
- package/dist/commands/workspace/create.js +16 -0
- package/dist/commands/workspace/create.js.map +1 -1
- package/dist/commands/workspace/delete.d.ts.map +1 -1
- package/dist/commands/workspace/delete.js +13 -13
- package/dist/commands/workspace/delete.js.map +1 -1
- package/dist/commands/workspace/list.d.ts +1 -1
- package/dist/commands/workspace/update.d.ts.map +1 -1
- package/dist/commands/workspace/update.js +15 -15
- package/dist/commands/workspace/update.js.map +1 -1
- package/dist/config/credentials.d.ts +189 -0
- package/dist/config/credentials.d.ts.map +1 -0
- package/dist/config/credentials.js +300 -0
- package/dist/config/credentials.js.map +1 -0
- package/dist/config/profiles.d.ts +125 -0
- package/dist/config/profiles.d.ts.map +1 -0
- package/dist/config/profiles.js +227 -0
- package/dist/config/profiles.js.map +1 -0
- package/dist/types/global-flags.d.ts +1 -1
- package/dist/types/global-flags.d.ts.map +1 -1
- package/dist/types/global-flags.js +28 -16
- package/dist/types/global-flags.js.map +1 -1
- package/dist/types/ids.d.ts +4 -0
- package/dist/types/ids.d.ts.map +1 -1
- package/dist/types/ids.js +12 -3
- package/dist/types/ids.js.map +1 -1
- package/dist/utils/errors.d.ts +57 -3
- package/dist/utils/errors.d.ts.map +1 -1
- package/dist/utils/errors.js +69 -2
- package/dist/utils/errors.js.map +1 -1
- package/dist/utils/fs.d.ts +35 -0
- package/dist/utils/fs.d.ts.map +1 -0
- package/dist/utils/fs.js +36 -0
- package/dist/utils/fs.js.map +1 -0
- package/dist/utils/json.d.ts +60 -0
- package/dist/utils/json.d.ts.map +1 -0
- package/dist/utils/json.js +86 -0
- package/dist/utils/json.js.map +1 -0
- package/dist/utils/mime.d.ts +24 -0
- package/dist/utils/mime.d.ts.map +1 -0
- package/dist/utils/mime.js +64 -0
- package/dist/utils/mime.js.map +1 -0
- package/dist/utils/output/envelope.d.ts +30 -0
- package/dist/utils/output/envelope.d.ts.map +1 -1
- package/dist/utils/output/envelope.js +26 -0
- package/dist/utils/output/envelope.js.map +1 -1
- package/dist/utils/output/ndjson.d.ts +90 -3
- package/dist/utils/output/ndjson.d.ts.map +1 -1
- package/dist/utils/output/ndjson.js +33 -0
- package/dist/utils/output/ndjson.js.map +1 -1
- package/dist/utils/redact.d.ts.map +1 -1
- package/dist/utils/redact.js +31 -0
- package/dist/utils/redact.js.map +1 -1
- package/dist/utils/signal.d.ts +42 -0
- package/dist/utils/signal.d.ts.map +1 -0
- package/dist/utils/signal.js +45 -0
- package/dist/utils/signal.js.map +1 -0
- package/package.json +2 -1
- package/dist/commands/account/client-helper.d.ts +0 -37
- package/dist/commands/account/client-helper.d.ts.map +0 -1
- package/dist/commands/account/client-helper.js +0 -55
- package/dist/commands/account/client-helper.js.map +0 -1
|
@@ -0,0 +1,436 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Bulk per-item partial-success path for the v0.3-M25
|
|
3
|
+
* `item update --continue-on-error` flag (`cli-design.md` §6.4
|
|
4
|
+
* "Bulk per-item partial-success" sub-section).
|
|
5
|
+
*
|
|
6
|
+
* **What this module owns.** A thin wrapper around the selected
|
|
7
|
+
* per-target dispatcher — {@link dispatchSequential} from
|
|
8
|
+
* `src/api/partial-success-mutation.ts` (default / M25 path) OR
|
|
9
|
+
* {@link dispatchParallel} from `src/api/parallel-dispatch.ts`
|
|
10
|
+
* (v0.4-M30 `--concurrency > 1` path) — that drives the matched-
|
|
11
|
+
* item-ID list through one wire call per item, capturing per-
|
|
12
|
+
* item failures into the result records rather than aborting
|
|
13
|
+
* the loop. The wrapper sits BETWEEN the bulk command-action
|
|
14
|
+
* orchestrator (`src/commands/item/update.ts:runBulk`) and the
|
|
15
|
+
* shared dispatcher — the action body owns the matched-item-
|
|
16
|
+
* walk + column-resolution pre-pass + confirmation gate, then
|
|
17
|
+
* hands the resolved `SelectedMutation` + matched-item IDs to
|
|
18
|
+
* this wrapper, which fans them out + projects the partial-
|
|
19
|
+
* success envelope's `data.results[]` records.
|
|
20
|
+
*
|
|
21
|
+
* **Why a separate module rather than folding into update.ts.**
|
|
22
|
+
* Three reasons:
|
|
23
|
+
*
|
|
24
|
+
* 1. **Single-source-of-truth for the partial-success contract
|
|
25
|
+
* surface.** M13 `update clear-all`, M14 `workspace
|
|
26
|
+
* add-users` / `remove-users`, M15 `board add-users`, and
|
|
27
|
+
* M25 `item update --continue-on-error` all share the
|
|
28
|
+
* `{<id_field>, ok, error?}` per-record shape backed by
|
|
29
|
+
* `dispatchSequential`. Keeping M25's wrapper next to its
|
|
30
|
+
* family in `src/api/` (rather than buried in a command
|
|
31
|
+
* file) keeps the family discoverable + makes future M27
|
|
32
|
+
* bulk-write extensions (notification fan-out?) lift
|
|
33
|
+
* cleanly into the same module.
|
|
34
|
+
*
|
|
35
|
+
* 2. **Action-body size budget.** `src/commands/item/update.ts`
|
|
36
|
+
* already runs ~1100 LOC carrying both single-item +
|
|
37
|
+
* v0.1 fail-fast bulk paths; adding the partial-success
|
|
38
|
+
* branch inline would push it past 1300 and bury the
|
|
39
|
+
* `dispatchSequential` integration. The action layer
|
|
40
|
+
* branches on `parsed.continueOnError` and dispatches into
|
|
41
|
+
* this module's `runPartialSuccessBulkUpdate` instead.
|
|
42
|
+
*
|
|
43
|
+
* 3. **Test surface ergonomics.** Per-item partial-success
|
|
44
|
+
* tests (mock `client.raw` with a routing predicate that
|
|
45
|
+
* flips success/failure per item-ID) read cleaner against
|
|
46
|
+
* the wrapper's seam than against the action body's
|
|
47
|
+
* branched control flow.
|
|
48
|
+
*
|
|
49
|
+
* **What stays at the action layer.** Argv-parse, column
|
|
50
|
+
* resolution, items_page walk, confirmation gate, dry-run path,
|
|
51
|
+
* source aggregation seed, and the universal-partial-success
|
|
52
|
+
* `ok: true` envelope assembly (via `emitMutation`). The
|
|
53
|
+
* wrapper returns the `data.results[]` array + the per-item
|
|
54
|
+
* source-leg fold; the action body wires that into the
|
|
55
|
+
* envelope it would have emitted on the v0.1 fail-fast bulk
|
|
56
|
+
* path's success branch.
|
|
57
|
+
*
|
|
58
|
+
* **Shipped at M25 IMPL (`fe15181`).** Pre-flight contract
|
|
59
|
+
* diff (`d5839a9`) pinned the module signatures + per-item
|
|
60
|
+
* result schema + pure-helper bodies; the M25 IMPL feat fills
|
|
61
|
+
* the runtime body of `runPartialSuccessBulkUpdate` + drops
|
|
62
|
+
* the `c8 ignore start/stop` block-wraps that surrounded both
|
|
63
|
+
* the wrapper body and the action-body routing branch at
|
|
64
|
+
* `src/commands/item/update.ts:runBulk`. The `executeMutation`
|
|
65
|
+
* lift to `src/api/item-mutation-execute.ts` (renamed
|
|
66
|
+
* `executeItemMutation`) shipped ahead at `78889df` (R-NEW-29
|
|
67
|
+
* 3-consumer trigger: single-item + fail-fast bulk + M25
|
|
68
|
+
* partial-success bulk).
|
|
69
|
+
*
|
|
70
|
+
* **v0.4-M30 extension.** Adds the `concurrency` input slot +
|
|
71
|
+
* the routing branch to {@link dispatchParallel} (new module
|
|
72
|
+
* `src/api/parallel-dispatch.ts` — runtime body landed at M30
|
|
73
|
+
* IMPL). When the caller passes `concurrency > 1`, the runtime
|
|
74
|
+
* fans out per-target dispatches via a bounded async-pool;
|
|
75
|
+
* absent or `concurrency === 1` preserves the M25 sequential
|
|
76
|
+
* path verbatim. The per-target dispatch closure is hoisted to
|
|
77
|
+
* a named local so both routes share the same
|
|
78
|
+
* `executeItemMutation` + `foldAndRemap` body — keeps the
|
|
79
|
+
* R-NEW-28 6-axis behavioral-equivalence audit straightforward.
|
|
80
|
+
* The M30 IMPL also threads an optional `signal?: AbortSignal`
|
|
81
|
+
* through both dispatchers (axis-6 scheduler short-circuit).
|
|
82
|
+
*
|
|
83
|
+
* **Per-item dispatch wiring.** Runtime body routes between
|
|
84
|
+
* {@link dispatchSequential} (default — `concurrency` absent /
|
|
85
|
+
* `=== 1`) and {@link dispatchParallel} (v0.4-M30 —
|
|
86
|
+
* `concurrency > 1`) over `matchedItemIds` with id-field
|
|
87
|
+
* `'item_id'`. The per-target dispatch callback (shared between
|
|
88
|
+
* routes verbatim) fires one `executeItemMutation` call.
|
|
89
|
+
* Successes populate `results[i].item` with the `ProjectedItem`
|
|
90
|
+
* via a side-map fold; failures land in
|
|
91
|
+
* `results[i].error: {code, message}` via the dispatcher's
|
|
92
|
+
* built-in error decoration. `internal_error` codes re-throw
|
|
93
|
+
* as whole-call (M14 round-2 F1 precedent — schema-drift in
|
|
94
|
+
* the response MUST NOT be papered over as a per-item failure).
|
|
95
|
+
*
|
|
96
|
+
* **`data.summary.failed_count` invariant.** The action body
|
|
97
|
+
* derives `failed_count` from the result records
|
|
98
|
+
* (`results.filter((r) => !r.ok).length`); the wrapper does
|
|
99
|
+
* NOT compute it directly because the summary slot also
|
|
100
|
+
* carries `matched_count` + `applied_count` + `board_id` —
|
|
101
|
+
* shapes the action body already owns from the walker + the
|
|
102
|
+
* matched-item-walk + the argv. Keeping the summary
|
|
103
|
+
* assembly at the action layer prevents wrapper-vs-action
|
|
104
|
+
* drift on the partial-success contract's per-summary shape.
|
|
105
|
+
*/
|
|
106
|
+
import { z } from 'zod';
|
|
107
|
+
import { ApiError, MondayCliError } from '../utils/errors.js';
|
|
108
|
+
import { projectedItemSchema } from './item-projection.js';
|
|
109
|
+
import { dispatchSequential, } from './partial-success-mutation.js';
|
|
110
|
+
import { dispatchParallel } from './parallel-dispatch.js';
|
|
111
|
+
import { executeItemMutation } from './item-mutation-execute.js';
|
|
112
|
+
import { foldAndRemap } from './resolver-error-fold.js';
|
|
113
|
+
/**
|
|
114
|
+
* Per-item result schema for the partial-success bulk envelope's
|
|
115
|
+
* `data.results[]` slot. Each record carries `item_id` + `ok` +
|
|
116
|
+
* either `item` (on success) or `error` (on failure). The two
|
|
117
|
+
* branches share the discriminator `ok: boolean` — agents read
|
|
118
|
+
* `r.ok ? r.item : r.error` to dispatch on outcome.
|
|
119
|
+
*
|
|
120
|
+
* The `item` slot on success records is the §6.2 `ProjectedItem`
|
|
121
|
+
* shape (same projection single-item `item update` emits as
|
|
122
|
+
* `data`). The `error` slot on failure records carries
|
|
123
|
+
* `{code, message}` populated from the selected dispatcher's
|
|
124
|
+
* per-target error decoration (`dispatchSequential` or
|
|
125
|
+
* `dispatchParallel` — same shape per the R-NEW-28 axis-1
|
|
126
|
+
* equivalence).
|
|
127
|
+
*
|
|
128
|
+
* `z.discriminatedUnion` would be the natural shape but the
|
|
129
|
+
* dispatchers' result records carry a dynamic id-field key
|
|
130
|
+
* (`{item_id: ..., ok, error?}`) — modelling that as a
|
|
131
|
+
* per-record union complicates the schema and downstream
|
|
132
|
+
* consumers' type-narrowing. The flatter shape below carries
|
|
133
|
+
* `item` + `error` as optionals; the action body's projection
|
|
134
|
+
* + the wrapper's per-item dispatch enforce the
|
|
135
|
+
* mutual-exclusion invariant at runtime.
|
|
136
|
+
*/
|
|
137
|
+
export const partialSuccessBulkUpdateResultSchema = z.object({
|
|
138
|
+
item_id: z.string().min(1),
|
|
139
|
+
ok: z.boolean(),
|
|
140
|
+
item: projectedItemSchema.optional(),
|
|
141
|
+
error: z
|
|
142
|
+
.object({
|
|
143
|
+
code: z.string().min(1),
|
|
144
|
+
message: z.string().min(1),
|
|
145
|
+
})
|
|
146
|
+
.optional(),
|
|
147
|
+
});
|
|
148
|
+
/**
|
|
149
|
+
* Output `data` shape for the partial-success bulk envelope.
|
|
150
|
+
* `data.operation` is the literal `"item_update"` (mirrors M14's
|
|
151
|
+
* add-users / remove-users discriminator at `data.operation`;
|
|
152
|
+
* agents switch on it to confirm which verb produced the
|
|
153
|
+
* envelope).
|
|
154
|
+
*
|
|
155
|
+
* `data.summary` extends the v0.1 fail-fast bulk-summary with
|
|
156
|
+
* `failed_count` — items whose per-item dispatch failed under
|
|
157
|
+
* the `--continue-on-error` path. The invariant
|
|
158
|
+
* `matched_count === applied_count + failed_count` holds for
|
|
159
|
+
* every M25 success envelope.
|
|
160
|
+
*/
|
|
161
|
+
export const partialSuccessBulkUpdateDataSchema = z.object({
|
|
162
|
+
operation: z.literal('item_update'),
|
|
163
|
+
summary: z.object({
|
|
164
|
+
matched_count: z.number().int().nonnegative(),
|
|
165
|
+
applied_count: z.number().int().nonnegative(),
|
|
166
|
+
failed_count: z.number().int().nonnegative(),
|
|
167
|
+
board_id: z.string().min(1),
|
|
168
|
+
}),
|
|
169
|
+
results: z.array(partialSuccessBulkUpdateResultSchema),
|
|
170
|
+
});
|
|
171
|
+
/**
|
|
172
|
+
* Constant source signal the partial-success bulk dispatch
|
|
173
|
+
* contributes to the action layer's `SourceAggregator`. Always
|
|
174
|
+
* `'live'` post-dispatch — every Monday mutation counts as a
|
|
175
|
+
* `live` leg. Exported so the action layer's
|
|
176
|
+
* `sourceAgg.record(...)` call site reads against a named
|
|
177
|
+
* constant rather than a bare string literal.
|
|
178
|
+
*/
|
|
179
|
+
export const PARTIAL_SUCCESS_BULK_DISPATCH_SOURCE = 'live';
|
|
180
|
+
/**
|
|
181
|
+
* Drives the per-item dispatch loop under `--continue-on-error`.
|
|
182
|
+
*
|
|
183
|
+
* Implementation (M25 impl `78889df` refactor + this commit;
|
|
184
|
+
* extended at v0.4-M30 pre-flight with the `concurrency` routing
|
|
185
|
+
* branch):
|
|
186
|
+
*
|
|
187
|
+
* 1. Loop {@link dispatchSequential} (default / M25 path) OR
|
|
188
|
+
* {@link dispatchParallel} (v0.4-M30 `--concurrency > 1`
|
|
189
|
+
* path; runtime body landed at M30 IMPL) over
|
|
190
|
+
* `matchedItemIds` with id-field `'item_id'`.
|
|
191
|
+
* 2. Per-item dispatch callback fires
|
|
192
|
+
* {@link executeItemMutation} against the resolved
|
|
193
|
+
* `SelectedMutation`. On a {@link MondayCliError} catch,
|
|
194
|
+
* run {@link foldAndRemap} with `resolverWarnings` +
|
|
195
|
+
* `remapColumnIds` + `env` + `noCache` + `resolutionSource`
|
|
196
|
+
* from the inputs BEFORE re-throwing into the selected
|
|
197
|
+
* dispatcher (`dispatchSequential` or `dispatchParallel`).
|
|
198
|
+
* This makes the per-record `error.code` in
|
|
199
|
+
* `data.results[]` carry the SAME stable code
|
|
200
|
+
* (`column_archived` after a stale-cache
|
|
201
|
+
* `validation_failed` remap) that the v0.1 fail-fast
|
|
202
|
+
* path would have surfaced at the top level — Codex
|
|
203
|
+
* round-1 P1-1 contract requirement (cli-design §6.5
|
|
204
|
+
* stable-code rule applies uniformly across the bulk
|
|
205
|
+
* fail-modes).
|
|
206
|
+
* 3. On success, capture the `ProjectedItem` into a side
|
|
207
|
+
* map keyed by `item_id`.
|
|
208
|
+
* 4. After the loop, walk the result rows (from whichever
|
|
209
|
+
* dispatcher fired — `dispatchSequential` by default;
|
|
210
|
+
* {@link dispatchParallel} when `concurrency > 1`) and
|
|
211
|
+
* fold the per-item `ProjectedItem` from the side
|
|
212
|
+
* map into each `results[i].item` slot via
|
|
213
|
+
* {@link foldPartialSuccessBulkResult}. Failure records
|
|
214
|
+
* already carry `error: {code, message}` (with the
|
|
215
|
+
* foldAndRemap-applied code) via the dispatcher's built-in
|
|
216
|
+
* error decoration (both routes share the same per-target
|
|
217
|
+
* error capture contract).
|
|
218
|
+
* 5. Return `{results}` — the action layer folds the
|
|
219
|
+
* constant `'live'` dispatch source via
|
|
220
|
+
* `sourceAgg.record(PARTIAL_SUCCESS_BULK_DISPATCH_SOURCE,
|
|
221
|
+
* null)` and emits the envelope.
|
|
222
|
+
*
|
|
223
|
+
* **`internal_error` re-throw escape hatch.** Per M14 round-2
|
|
224
|
+
* F1 / round-3 F1, both dispatchers re-throw `internal_error`
|
|
225
|
+
* whole-call so schema-drift in the response surfaces as
|
|
226
|
+
* top-level `ok: false` rather than per-record — papering over
|
|
227
|
+
* `internal_error` would hide the malformed-response signal
|
|
228
|
+
* agents need to know about. The wrapper inherits this
|
|
229
|
+
* behaviour by NOT wrapping the dispatcher's re-throw —
|
|
230
|
+
* `foldAndRemap` only ever runs against {@link MondayCliError}
|
|
231
|
+
* instances, and it NEVER converts a non-internal_error into
|
|
232
|
+
* internal_error, so the re-throw path through the selected
|
|
233
|
+
* dispatcher remains the canonical schema-drift surface (axis
|
|
234
|
+
* 2 of the R-NEW-28 6-axis equivalence — identical between
|
|
235
|
+
* `dispatchSequential` and `dispatchParallel`).
|
|
236
|
+
*
|
|
237
|
+
* **Non-`MondayCliError` re-throw.** Programmer-bug exceptions
|
|
238
|
+
* (TypeError, RangeError, etc.) raised by the executor or by
|
|
239
|
+
* `foldAndRemap`'s refresh probe propagate through the selected
|
|
240
|
+
* dispatcher's non-CliError re-throw branch unchanged, surfacing
|
|
241
|
+
* as whole-call `internal_error` via the runner's catch-all
|
|
242
|
+
* (mirrors M14's pattern at `users-fan-out-mutation.ts` and the
|
|
243
|
+
* documented behaviour at `partial-success-mutation.ts` —
|
|
244
|
+
* R-NEW-28 axis 3, also identical across both routes).
|
|
245
|
+
*/
|
|
246
|
+
export const runPartialSuccessBulkUpdate = async (inputs) => {
|
|
247
|
+
const { client, boardId, matchedItemIds, mutation, createLabelsIfMissing, resolverWarnings, remapColumnIds, env, noCache, resolutionSource, concurrency, signal, } = inputs;
|
|
248
|
+
const projectedById = new Map();
|
|
249
|
+
// Per-target dispatch closure shared between the sequential
|
|
250
|
+
// (v0.3-M25 default) and parallel (v0.4-M30 `--concurrency > 1`)
|
|
251
|
+
// routes. Both dispatch helpers contract on the same
|
|
252
|
+
// {@link DispatchOneTargetInputs}-shaped callback so the closure
|
|
253
|
+
// body is byte-equivalent across routes — only the OUTER call
|
|
254
|
+
// (dispatchSequential vs dispatchParallel) changes. This keeps the
|
|
255
|
+
// R-NEW-28 6-axis behavioral-equivalence audit straightforward:
|
|
256
|
+
// every per-target outcome (success projection capture; `MondayCliError`
|
|
257
|
+
// foldAndRemap + re-throw; non-CliError re-throw) is shared verbatim.
|
|
258
|
+
const perTargetDispatch = async ({ targetId }) => {
|
|
259
|
+
try {
|
|
260
|
+
const result = await executeItemMutation(client, {
|
|
261
|
+
mutation,
|
|
262
|
+
itemId: targetId,
|
|
263
|
+
boardId,
|
|
264
|
+
createLabelsIfMissing,
|
|
265
|
+
});
|
|
266
|
+
projectedById.set(targetId, result.projected);
|
|
267
|
+
}
|
|
268
|
+
catch (err) {
|
|
269
|
+
if (err instanceof MondayCliError) {
|
|
270
|
+
// Codex pre-flight round-1 P1-1: thread the remap
|
|
271
|
+
// context through so per-item failures inherit the
|
|
272
|
+
// SAME `validation_failed` → `column_archived`
|
|
273
|
+
// stale-cache remap the v0.1 fail-fast path applies.
|
|
274
|
+
// Without this, archived-column failures would
|
|
275
|
+
// surface as `validation_failed` in `data.results[]`
|
|
276
|
+
// even though the v0.1 path surfaces `column_archived`
|
|
277
|
+
// for the same root cause (cli-design §6.5 stable-
|
|
278
|
+
// code rule). foldAndRemap NEVER converts a non-
|
|
279
|
+
// internal_error into internal_error, so the selected
|
|
280
|
+
// dispatcher's internal_error re-throw escape hatch
|
|
281
|
+
// (M14 round-2 F1) stays intact across both routes.
|
|
282
|
+
const remapped = await foldAndRemap({
|
|
283
|
+
err,
|
|
284
|
+
warnings: resolverWarnings,
|
|
285
|
+
client,
|
|
286
|
+
boardId,
|
|
287
|
+
columnIds: remapColumnIds,
|
|
288
|
+
env,
|
|
289
|
+
noCache,
|
|
290
|
+
resolutionSource,
|
|
291
|
+
});
|
|
292
|
+
throw remapped;
|
|
293
|
+
}
|
|
294
|
+
// Non-MondayCliError — programmer bug. Re-throw through
|
|
295
|
+
// dispatchSequential / dispatchParallel's non-CliError branch
|
|
296
|
+
// so the runner's catch-all surfaces it as internal_error
|
|
297
|
+
// (whole-call, not per-record). Mirrors users-fan-out-mutation.ts
|
|
298
|
+
// and is the documented partial-success contract.
|
|
299
|
+
throw err;
|
|
300
|
+
}
|
|
301
|
+
};
|
|
302
|
+
// v0.4-M30 routing: `--concurrency <N>` with N > 1 routes through
|
|
303
|
+
// {@link dispatchParallel} (bounded async-pool); absent / N === 1
|
|
304
|
+
// routes through the unchanged {@link dispatchSequential} path.
|
|
305
|
+
// Both dispatchers thread the optional `signal` so SIGINT-aware
|
|
306
|
+
// callers see consistent cooperative abort semantics across routes
|
|
307
|
+
// (R-NEW-28 axis 6).
|
|
308
|
+
let dispatchResults;
|
|
309
|
+
if (concurrency !== undefined && concurrency > 1) {
|
|
310
|
+
dispatchResults = await dispatchParallel(matchedItemIds, 'item_id', perTargetDispatch, concurrency, signal);
|
|
311
|
+
}
|
|
312
|
+
else {
|
|
313
|
+
dispatchResults = await dispatchSequential(matchedItemIds, 'item_id', perTargetDispatch, signal);
|
|
314
|
+
}
|
|
315
|
+
const results = dispatchResults.map((row) => {
|
|
316
|
+
// Side-map lookup requires the item_id string from the row;
|
|
317
|
+
// foldPartialSuccessBulkResult also enforces the same
|
|
318
|
+
// invariant + throws internal_error if the id-field is
|
|
319
|
+
// missing or non-string (both dispatchers populate the
|
|
320
|
+
// id-field slot for every result row per the partial-
|
|
321
|
+
// success contract).
|
|
322
|
+
const itemIdSlot = row.item_id;
|
|
323
|
+
const projected = typeof itemIdSlot === 'string'
|
|
324
|
+
? projectedById.get(itemIdSlot)
|
|
325
|
+
: undefined;
|
|
326
|
+
return foldPartialSuccessBulkResult(row, projected);
|
|
327
|
+
});
|
|
328
|
+
return { results };
|
|
329
|
+
};
|
|
330
|
+
/**
|
|
331
|
+
* Pure helper — folds a per-target result row produced by the
|
|
332
|
+
* selected dispatcher (`dispatchSequential` or
|
|
333
|
+
* `dispatchParallel`) + a `ProjectedItem` side-map entry into
|
|
334
|
+
* the partial-success-bulk per-item record shape this module
|
|
335
|
+
* emits to the action layer. Both dispatchers populate the row
|
|
336
|
+
* with the same `{item_id, ok, error?}` shape (axis 1 of the
|
|
337
|
+
* R-NEW-28 6-axis equivalence) so the fold is route-agnostic.
|
|
338
|
+
*
|
|
339
|
+
* The helper is **shipped as a real implementation** (not a
|
|
340
|
+
* stub) so the pre-flight Codex review can verify the
|
|
341
|
+
* projection shape against the contract pinned in cli-design
|
|
342
|
+
* §6.4 inline. M25 implementation reuses the helper unchanged.
|
|
343
|
+
*
|
|
344
|
+
* `record` is the row produced by the selected dispatcher with
|
|
345
|
+
* id-field `'item_id'` — carries `{item_id, ok, error?}` per
|
|
346
|
+
* the partial-success contract. `projectedItem` is the
|
|
347
|
+
* `ProjectedItem` the per-item dispatch callback captured on
|
|
348
|
+
* success (`undefined` on failure).
|
|
349
|
+
*
|
|
350
|
+
* Returns the per-item shape with `item` populated only when
|
|
351
|
+
* the dispatch succeeded; `error` populated only when it
|
|
352
|
+
* failed. The mutual-exclusion invariant is enforced at the
|
|
353
|
+
* boundary: success records never carry `error`, failure
|
|
354
|
+
* records never carry `item`.
|
|
355
|
+
*/
|
|
356
|
+
export const foldPartialSuccessBulkResult = (record, projectedItem) => {
|
|
357
|
+
// Dot-access: the selected dispatcher (`dispatchSequential` or
|
|
358
|
+
// `dispatchParallel`) builds the record with the dynamic
|
|
359
|
+
// id-field key (`'item_id'`) carrying the target ID. The
|
|
360
|
+
// dot-access narrows the unknown index-signature value to a
|
|
361
|
+
// string via the runtime guard below; the helper throws
|
|
362
|
+
// `internal_error` if the shape doesn't match (which would be
|
|
363
|
+
// a programmer bug — both dispatchers contract on populating
|
|
364
|
+
// the id-field slot for every result row).
|
|
365
|
+
const itemIdSlot = record.item_id;
|
|
366
|
+
if (typeof itemIdSlot !== 'string' || itemIdSlot.length === 0) {
|
|
367
|
+
throw new ApiError('internal_error', 'partial-success bulk result row is missing the `item_id` field — dispatcher contract violation.', {
|
|
368
|
+
details: {
|
|
369
|
+
record_keys: Object.keys(record),
|
|
370
|
+
},
|
|
371
|
+
});
|
|
372
|
+
}
|
|
373
|
+
if (record.ok) {
|
|
374
|
+
if (projectedItem === undefined) {
|
|
375
|
+
throw new ApiError('internal_error', `partial-success bulk result row for item_id ${itemIdSlot} reported ok: true but no ProjectedItem was captured — wrapper-layer side-map miss.`, {
|
|
376
|
+
details: {
|
|
377
|
+
item_id: itemIdSlot,
|
|
378
|
+
},
|
|
379
|
+
});
|
|
380
|
+
}
|
|
381
|
+
return {
|
|
382
|
+
item_id: itemIdSlot,
|
|
383
|
+
ok: true,
|
|
384
|
+
item: projectedItem,
|
|
385
|
+
};
|
|
386
|
+
}
|
|
387
|
+
// Failure path — both dispatchers populate `error` on every
|
|
388
|
+
// non-`ok` row (R-NEW-28 axis 1); the schema's `.optional()`
|
|
389
|
+
// declarations narrow defensively here.
|
|
390
|
+
if (record.error === undefined) {
|
|
391
|
+
throw new ApiError('internal_error', `partial-success bulk result row for item_id ${itemIdSlot} reported ok: false but no error payload was captured — dispatcher contract violation.`, {
|
|
392
|
+
details: {
|
|
393
|
+
item_id: itemIdSlot,
|
|
394
|
+
},
|
|
395
|
+
});
|
|
396
|
+
}
|
|
397
|
+
return {
|
|
398
|
+
item_id: itemIdSlot,
|
|
399
|
+
ok: false,
|
|
400
|
+
error: {
|
|
401
|
+
code: record.error.code,
|
|
402
|
+
message: record.error.message,
|
|
403
|
+
},
|
|
404
|
+
};
|
|
405
|
+
};
|
|
406
|
+
/**
|
|
407
|
+
* Pure helper — derives the `data.summary` slot from the
|
|
408
|
+
* matched-item count + the per-item results array. The
|
|
409
|
+
* `matched_count === applied_count + failed_count` invariant
|
|
410
|
+
* is enforced here; a mismatch throws `internal_error` since
|
|
411
|
+
* it would indicate a wrapper-layer bug (some matched item
|
|
412
|
+
* neither succeeded nor failed). Shipped as a real
|
|
413
|
+
* implementation so the pre-flight Codex review can verify the
|
|
414
|
+
* shape against cli-design §6.4 inline.
|
|
415
|
+
*/
|
|
416
|
+
export const buildPartialSuccessBulkSummary = ({ matchedCount, boardId, results, }) => {
|
|
417
|
+
const appliedCount = results.filter((r) => r.ok).length;
|
|
418
|
+
const failedCount = results.filter((r) => !r.ok).length;
|
|
419
|
+
if (appliedCount + failedCount !== matchedCount) {
|
|
420
|
+
throw new ApiError('internal_error', `partial-success bulk summary invariant violated — matched_count (${String(matchedCount)}) !== applied_count (${String(appliedCount)}) + failed_count (${String(failedCount)}).`, {
|
|
421
|
+
details: {
|
|
422
|
+
matched_count: matchedCount,
|
|
423
|
+
applied_count: appliedCount,
|
|
424
|
+
failed_count: failedCount,
|
|
425
|
+
board_id: boardId,
|
|
426
|
+
},
|
|
427
|
+
});
|
|
428
|
+
}
|
|
429
|
+
return {
|
|
430
|
+
matched_count: matchedCount,
|
|
431
|
+
applied_count: appliedCount,
|
|
432
|
+
failed_count: failedCount,
|
|
433
|
+
board_id: boardId,
|
|
434
|
+
};
|
|
435
|
+
};
|
|
436
|
+
//# sourceMappingURL=partial-success-bulk.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"partial-success-bulk.js","sourceRoot":"","sources":["../../src/api/part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QAC3B,YAAY,EAAE,WAAW;QACzB,QAAQ,EAAE,OAAO;KAClB,CAAC;AACJ,CAAC,CAAC"}
|
|
@@ -20,9 +20,21 @@ export interface PartialSuccessEnvelopeData {
|
|
|
20
20
|
* Errors thrown that aren't `MondayCliError` propagate up — those are
|
|
21
21
|
* programmer bugs, not Monday-side failures, and the runner's catch-
|
|
22
22
|
* all maps them to `internal_error`.
|
|
23
|
+
*
|
|
24
|
+
* **v0.4-M30 — optional `signal` parameter.** When the caller passes
|
|
25
|
+
* an `AbortSignal`, the loop checks `signal.aborted` between
|
|
26
|
+
* iterations and re-throws the signal's reason whole-call (mirrors
|
|
27
|
+
* `dispatchParallel`'s axis-6 behaviour for the R-NEW-28
|
|
28
|
+
* behavioural-equivalence audit). In-flight wire calls abort via the
|
|
29
|
+
* existing `MondayClient.signal` configured at construction time
|
|
30
|
+
* (the client threads its signal into every fetch); the dispatcher-
|
|
31
|
+
* level check stops the loop from scheduling NEW work after the
|
|
32
|
+
* abort fires. Omitting the signal preserves the v0.3-M25 behaviour
|
|
33
|
+
* verbatim — existing callers that don't pass a signal are
|
|
34
|
+
* byte-equivalent to pre-M30.
|
|
23
35
|
*/
|
|
24
36
|
export interface DispatchOneTargetInputs<TargetId extends string> {
|
|
25
37
|
readonly targetId: TargetId;
|
|
26
38
|
}
|
|
27
|
-
export declare const dispatchSequential: <TargetId extends string>(targets: readonly TargetId[], idField: string, dispatch: (inputs: DispatchOneTargetInputs<TargetId>) => Promise<void
|
|
39
|
+
export declare const dispatchSequential: <TargetId extends string>(targets: readonly TargetId[], idField: string, dispatch: (inputs: DispatchOneTargetInputs<TargetId>) => Promise<void>, signal?: AbortSignal) => Promise<readonly PartialSuccessResult[]>;
|
|
28
40
|
//# sourceMappingURL=partial-success-mutation.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"partial-success-mutation.d.ts","sourceRoot":"","sources":["../../src/api/partial-success-mutation.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"partial-success-mutation.d.ts","sourceRoot":"","sources":["../../src/api/partial-success-mutation.ts"],"names":[],"mappings":"AAwBA,wDAAwD;AACxD,MAAM,WAAW,oBAAoB;IACnC,QAAQ,CAAC,EAAE,EAAE,OAAO,CAAC;IACrB,QAAQ,CAAC,KAAK,CAAC,EAAE;QACf,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC;QACtB,QAAQ,CAAC,OAAO,EAAE,MAAM,CAAC;KAC1B,CAAC;IAIF,QAAQ,EAAE,GAAG,EAAE,MAAM,GAAG,OAAO,CAAC;CACjC;AAED,MAAM,WAAW,0BAA0B;IACzC,QAAQ,CAAC,OAAO,EAAE,SAAS,oBAAoB,EAAE,CAAC;CACnD;AAED;;;;;;;;;;;;;;;;;;;;;;GAsBG;AACH,MAAM,WAAW,uBAAuB,CAAC,QAAQ,SAAS,MAAM;IAC9D,QAAQ,CAAC,QAAQ,EAAE,QAAQ,CAAC;CAC7B;AAED,eAAO,MAAM,kBAAkB,GAAU,QAAQ,SAAS,MAAM,EAC9D,SAAS,SAAS,QAAQ,EAAE,EAC5B,SAAS,MAAM,EACf,UAAU,CAAC,MAAM,EAAE,uBAAuB,CAAC,QAAQ,CAAC,KAAK,OAAO,CAAC,IAAI,CAAC,EACtE,SAAS,WAAW,KACnB,OAAO,CAAC,SAAS,oBAAoB,EAAE,CAwCzC,CAAC"}
|
|
@@ -20,9 +20,13 @@
|
|
|
20
20
|
* reads `data.results` to determine outcomes.
|
|
21
21
|
*/
|
|
22
22
|
import { MondayCliError } from '../utils/errors.js';
|
|
23
|
-
|
|
23
|
+
import { extractSignalReason } from '../utils/signal.js';
|
|
24
|
+
export const dispatchSequential = async (targets, idField, dispatch, signal) => {
|
|
24
25
|
const results = [];
|
|
25
26
|
for (const targetId of targets) {
|
|
27
|
+
if (signal?.aborted === true) {
|
|
28
|
+
throw extractSignalReason(signal);
|
|
29
|
+
}
|
|
26
30
|
try {
|
|
27
31
|
await dispatch({ targetId });
|
|
28
32
|
// Build the result with the dynamic id-field name. Property
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"partial-success-mutation.js","sourceRoot":"","sources":["../../src/api/partial-success-mutation.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;GAoBG;AACH,OAAO,EAAE,cAAc,EAAE,MAAM,oBAAoB,CAAC;
|
|
1
|
+
{"version":3,"file":"partial-success-mutation.js","sourceRoot":"","sources":["../../src/api/partial-success-mutation.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;GAoBG;AACH,OAAO,EAAE,cAAc,EAAE,MAAM,oBAAoB,CAAC;AACpD,OAAO,EAAE,mBAAmB,EAAE,MAAM,oBAAoB,CAAC;AA8CzD,MAAM,CAAC,MAAM,kBAAkB,GAAG,KAAK,EACrC,OAA4B,EAC5B,OAAe,EACf,QAAsE,EACtE,MAAoB,EACsB,EAAE;IAC5C,MAAM,OAAO,GAA2B,EAAE,CAAC;IAC3C,KAAK,MAAM,QAAQ,IAAI,OAAO,EAAE,CAAC;QAC/B,IAAI,MAAM,EAAE,OAAO,KAAK,IAAI,EAAE,CAAC;YAC7B,MAAM,mBAAmB,CAAC,MAAM,CAAC,CAAC;QACpC,CAAC;QACD,IAAI,CAAC;YACH,MAAM,QAAQ,CAAC,EAAE,QAAQ,EAAE,CAAC,CAAC;YAC7B,4DAA4D;YAC5D,gEAAgE;YAChE,oDAAoD;YACpD,MAAM,EAAE,GAAyB;gBAC/B,CAAC,OAAO,CAAC,EAAE,QAAQ;gBACnB,EAAE,EAAE,IAAI;aACT,CAAC;YACF,OAAO,CAAC,IAAI,CAAC,EAAE,CAAC,CAAC;QACnB,CAAC;QAAC,OAAO,GAAY,EAAE,CAAC;YACtB,IAAI,GAAG,YAAY,cAAc,EAAE,CAAC;gBAClC,0DAA0D;gBAC1D,0DAA0D;gBAC1D,wDAAwD;gBACxD,yDAAyD;gBACzD,yDAAyD;gBACzD,wDAAwD;gBACxD,6CAA6C;gBAC7C,IAAI,GAAG,CAAC,IAAI,KAAK,gBAAgB;oBAAE,MAAM,GAAG,CAAC;gBAC7C,MAAM,MAAM,GAAyB;oBACnC,CAAC,OAAO,CAAC,EAAE,QAAQ;oBACnB,EAAE,EAAE,KAAK;oBACT,KAAK,EAAE,EAAE,IAAI,EAAE,GAAG,CAAC,IAAI,EAAE,OAAO,EAAE,GAAG,CAAC,OAAO,EAAE;iBAChD,CAAC;gBACF,OAAO,CAAC,IAAI,CAAC,MAAM,CAAC,CAAC;gBACrB,SAAS;YACX,CAAC;YACD,gEAAgE;YAChE,+BAA+B;YAC/B,MAAM,GAAG,CAAC;QACZ,CAAC;IACH,CAAC;IACD,OAAO,OAAO,CAAC;AACjB,CAAC,CAAC;AAEF,sEAAsE;AACtE,gEAAgE;AAChE,sEAAsE;AACtE,gEAAgE;AAChE,+CAA+C"}
|
package/dist/api/people.d.ts
CHANGED
|
@@ -56,6 +56,7 @@
|
|
|
56
56
|
* passes; consolidating the source of truth prevents the next
|
|
57
57
|
* drift outright.
|
|
58
58
|
*/
|
|
59
|
+
import { type EnvelopeSource } from './source-aggregator.js';
|
|
59
60
|
/**
|
|
60
61
|
* Wire payload shape for a `people` column. Matches Monday's
|
|
61
62
|
* `change_column_value(value: JSON!)` JSON scalar:
|
|
@@ -105,8 +106,34 @@ export interface PeopleResolutionContext {
|
|
|
105
106
|
* translator forwards the verbatim email so the unmatched-email
|
|
106
107
|
* detail in any thrown `user_not_found` echoes what the agent
|
|
107
108
|
* typed.
|
|
109
|
+
*
|
|
110
|
+
* **M19→M20 cleanup-window widening.** Pre-widening the callback
|
|
111
|
+
* returned just the `id` string and the people translator emitted
|
|
112
|
+
* `translatorResolution: null`, which meant `--set Owner=alice@x`
|
|
113
|
+
* against a cache-hit user-directory lookup surfaced
|
|
114
|
+
* `meta.source: "live"` because the email-resolution leg's source
|
|
115
|
+
* never reached the envelope-level aggregate. Post-widening, the
|
|
116
|
+
* callback returns the full `userByEmail` provenance (`source` +
|
|
117
|
+
* `cacheAgeSeconds`) and the translator threads it into
|
|
118
|
+
* `translatorResolution` for envelope-level merge — same shape the
|
|
119
|
+
* M19 tags translator uses for its `resolveTags` callback (see
|
|
120
|
+
* `TagResolutionContext.resolveTags` in `column-values.ts`).
|
|
108
121
|
*/
|
|
109
|
-
readonly resolveEmail: (email: string) => Promise<
|
|
122
|
+
readonly resolveEmail: (email: string) => Promise<ResolveEmailResult>;
|
|
123
|
+
}
|
|
124
|
+
/**
|
|
125
|
+
* Per-email resolution result returned by `PeopleResolutionContext.
|
|
126
|
+
* resolveEmail`. Mirrors `userByEmail`'s public shape one-for-one
|
|
127
|
+
* (same field names, same union for `source`) so the
|
|
128
|
+
* `buildResolutionContexts` closure is a transparent passthrough.
|
|
129
|
+
*/
|
|
130
|
+
export interface ResolveEmailResult {
|
|
131
|
+
/** Resolved Monday user ID (decimal non-negative integer string). */
|
|
132
|
+
readonly id: string;
|
|
133
|
+
/** `'cache'` when the directory cache served the email; `'live'` after a network refresh. */
|
|
134
|
+
readonly source: 'cache' | 'live';
|
|
135
|
+
/** Cache age in seconds for `source: 'cache'`; `null` after a live refresh. */
|
|
136
|
+
readonly cacheAgeSeconds: number | null;
|
|
110
137
|
}
|
|
111
138
|
/**
|
|
112
139
|
* Token-by-token resolution echo the dry-run engine renders as
|
|
@@ -144,6 +171,32 @@ export interface ParsedPeopleInput {
|
|
|
144
171
|
* a v0.1-plan §3 M5a spec gap for cli-design backfill.
|
|
145
172
|
*/
|
|
146
173
|
readonly resolution: PeopleResolution;
|
|
174
|
+
/**
|
|
175
|
+
* Aggregated source across every resolution leg this call fired —
|
|
176
|
+
* one leg per non-empty token. `me` tokens record `'live'` (the
|
|
177
|
+
* `me { id }` query is always a network call; the per-call
|
|
178
|
+
* `cachedMe` memo amortises N `me` tokens to one network round-
|
|
179
|
+
* trip but the leg itself is live). Email tokens record the
|
|
180
|
+
* `userByEmail` callback's `source` verbatim. `mergeSource`'s rule
|
|
181
|
+
* promotes `cache` + `live` → `mixed`. Always populated; empty
|
|
182
|
+
* input throws before this slot is built.
|
|
183
|
+
*
|
|
184
|
+
* Threaded into `translatorResolution.source` by `translatePeople`
|
|
185
|
+
* so the envelope-level `meta.source` aggregate reflects the
|
|
186
|
+
* email-resolution leg (M19→M20 cleanup-window parity fix per
|
|
187
|
+
* v0.3-plan §11 post-mortem).
|
|
188
|
+
*/
|
|
189
|
+
readonly source: EnvelopeSource;
|
|
190
|
+
/**
|
|
191
|
+
* Worst-case staleness across legs that hit cache (the OLDEST
|
|
192
|
+
* `cacheAgeSeconds` seen). `null` when no leg hit cache (every
|
|
193
|
+
* email resolved live AND no leg contributed an age). Threaded
|
|
194
|
+
* into `translatorResolution.cacheAgeSeconds` by `translatePeople`
|
|
195
|
+
* so the envelope-level `meta.cache_age_seconds` reflects the
|
|
196
|
+
* worst-case staleness across the column-resolution leg + the
|
|
197
|
+
* people-resolution leg.
|
|
198
|
+
*/
|
|
199
|
+
readonly cacheAgeSeconds: number | null;
|
|
147
200
|
}
|
|
148
201
|
/**
|
|
149
202
|
* Parses a `people` column input per cli-design.md §5.3 step 3.
|
package/dist/api/people.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"people.d.ts","sourceRoot":"","sources":["../../src/api/people.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAyDG;
|
|
1
|
+
{"version":3,"file":"people.d.ts","sourceRoot":"","sources":["../../src/api/people.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAyDG;AAKH,OAAO,EAAoB,KAAK,cAAc,EAAE,MAAM,wBAAwB,CAAC;AAE/E;;;;;;;;;;;;;;;;GAgBG;AACH,MAAM,WAAW,aAAa;IAC5B,QAAQ,CAAC,eAAe,EAAE,SAAS,kBAAkB,EAAE,CAAC;CACzD;AAED,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gB,GAC3B,KAAK,MAAM,EACX,UAAU,MAAM,EAChB,KAAK,uBAAuB,KAC3B,OAAO,CAAC,iBAAiB,CA6D3B,CAAC"}
|
package/dist/api/people.js
CHANGED
|
@@ -59,6 +59,7 @@
|
|
|
59
59
|
import { ApiError, UsageError } from '../utils/errors.js';
|
|
60
60
|
import { DECIMAL_USER_ID_PATTERN } from '../types/ids.js';
|
|
61
61
|
import { isMeToken } from './me-token.js';
|
|
62
|
+
import { SourceAggregator } from './source-aggregator.js';
|
|
62
63
|
/**
|
|
63
64
|
* Parses a `people` column input per cli-design.md §5.3 step 3.
|
|
64
65
|
*
|
|
@@ -107,6 +108,15 @@ export const parsePeopleInput = async (raw, columnId, ctx) => {
|
|
|
107
108
|
cachedMe ??= await ctx.resolveMe();
|
|
108
109
|
return cachedMe;
|
|
109
110
|
};
|
|
111
|
+
// Source/cache-age aggregator for the envelope-level meta.source
|
|
112
|
+
// pathway (M19→M20 cleanup-window parity fix). Each token records
|
|
113
|
+
// one leg: `me` always 'live' (`me { id }` is a network call —
|
|
114
|
+
// the per-call cachedMe memo amortises duplicates but the leg is
|
|
115
|
+
// still live), email tokens forward the userByEmail callback's
|
|
116
|
+
// {source, cacheAgeSeconds} verbatim. Translated downstream by
|
|
117
|
+
// translatePeople into translatorResolution; the envelope-level
|
|
118
|
+
// mergeSource rule promotes cache + live → mixed.
|
|
119
|
+
const sourceAgg = new SourceAggregator();
|
|
110
120
|
const entries = [];
|
|
111
121
|
const resolutionTokens = [];
|
|
112
122
|
for (const token of tokens) {
|
|
@@ -117,15 +127,29 @@ export const parsePeopleInput = async (raw, columnId, ctx) => {
|
|
|
117
127
|
// gap in v0.1-plan.md §3 M5a.
|
|
118
128
|
throw numericPeopleTokenError(columnId, token, raw);
|
|
119
129
|
}
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
130
|
+
let id;
|
|
131
|
+
if (isMeToken(token)) {
|
|
132
|
+
id = await resolveMeOnce();
|
|
133
|
+
sourceAgg.record('live', null);
|
|
134
|
+
}
|
|
135
|
+
else {
|
|
136
|
+
const resolved = await ctx.resolveEmail(token);
|
|
137
|
+
id = resolved.id;
|
|
138
|
+
sourceAgg.record(resolved.source, resolved.cacheAgeSeconds);
|
|
139
|
+
}
|
|
123
140
|
entries.push({ id: idStringToNumber(id, columnId, token), kind: 'person' });
|
|
124
141
|
resolutionTokens.push({ input: token, resolved_id: id });
|
|
125
142
|
}
|
|
143
|
+
// tokens.length > 0 guaranteed (empty input throws above), so the
|
|
144
|
+
// aggregator always has at least one leg recorded; `result()`'s
|
|
145
|
+
// fallback is unreachable here but the default ('live') stays as
|
|
146
|
+
// a defensive seed for the type narrowing.
|
|
147
|
+
const aggregate = sourceAgg.result();
|
|
126
148
|
return {
|
|
127
149
|
payload: { personsAndTeams: entries },
|
|
128
150
|
resolution: { tokens: resolutionTokens },
|
|
151
|
+
source: aggregate.source,
|
|
152
|
+
cacheAgeSeconds: aggregate.cacheAgeSeconds,
|
|
129
153
|
};
|
|
130
154
|
};
|
|
131
155
|
/**
|