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,90 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Complexity selection + extraction (`v0.1-plan.md` §3 M2,
|
|
3
|
+
* `cli-design.md` §6.1).
|
|
4
|
+
*
|
|
5
|
+
* Two halves:
|
|
6
|
+
*
|
|
7
|
+
* - **Injection.** When `--verbose` is on, every Monday GraphQL
|
|
8
|
+
* request gets a `complexity { used remaining reset_in_seconds }`
|
|
9
|
+
* selection appended at the operation root. This costs ~1
|
|
10
|
+
* complexity point per call but lets the CLI surface the budget
|
|
11
|
+
* in `meta.complexity` without a separate query. Without
|
|
12
|
+
* `--verbose`, `meta.complexity` is `null` per §6.1.
|
|
13
|
+
*
|
|
14
|
+
* - **Extraction.** Reads the `complexity` field off the response
|
|
15
|
+
* body and projects the SDK's three integer fields (`query`,
|
|
16
|
+
* `after`, `reset_in_x_seconds`) onto the CLI's stable shape
|
|
17
|
+
* (`used`, `remaining`, `reset_in_seconds`). The CLI re-spells
|
|
18
|
+
* Monday's field names so a future API renaming doesn't ripple
|
|
19
|
+
* through every command's output schema.
|
|
20
|
+
*
|
|
21
|
+
* The injector lives at the *string* level rather than via an AST
|
|
22
|
+
* because:
|
|
23
|
+
* - `graphql-request` ships no AST helper at the SDK we depend on;
|
|
24
|
+
* pulling in `graphql/parser` for one selection is a heavy cost.
|
|
25
|
+
* - The transformation is mechanical and bounded: locate the first
|
|
26
|
+
* top-level `query`/`mutation`/`{` and inject the field at the
|
|
27
|
+
* end of its outermost selection set. Edge cases (operation
|
|
28
|
+
* name, variable declarations, fragments) leave the injection
|
|
29
|
+
* site unchanged.
|
|
30
|
+
*
|
|
31
|
+
* The implementation is conservative: if the query string is not
|
|
32
|
+
* recognised as a single top-level operation, the injector returns
|
|
33
|
+
* the input unchanged and the caller proceeds without complexity
|
|
34
|
+
* tracking. That trades absolute coverage for resilience — `monday
|
|
35
|
+
* raw` accepts arbitrary GraphQL, and we'd rather lose verbose
|
|
36
|
+
* complexity on a custom multi-operation document than break the
|
|
37
|
+
* query.
|
|
38
|
+
*/
|
|
39
|
+
import type { Complexity } from '../utils/output/envelope.js';
|
|
40
|
+
export interface ComplexityInjectionOptions {
|
|
41
|
+
/**
|
|
42
|
+
* The selection to append. Defaults to the documented v0.1 set;
|
|
43
|
+
* tests can override to assert on the wire shape, but commands
|
|
44
|
+
* should leave it on the default so the field stays consistent
|
|
45
|
+
* across the surface.
|
|
46
|
+
*/
|
|
47
|
+
readonly selection?: string;
|
|
48
|
+
}
|
|
49
|
+
export interface ComplexityInjectionResult {
|
|
50
|
+
/** The (possibly modified) GraphQL document. */
|
|
51
|
+
readonly query: string;
|
|
52
|
+
/**
|
|
53
|
+
* True if a `complexity { ... }` selection was added by this
|
|
54
|
+
* call. False when the document already contained one (no-op) or
|
|
55
|
+
* when the injector couldn't find a single recognisable operation
|
|
56
|
+
* body. Callers use this to know whether to strip the field from
|
|
57
|
+
* the response (it was theirs to add) or leave it (it was the
|
|
58
|
+
* caller's own selection — e.g. `account complexity` directly
|
|
59
|
+
* queries the field as its only payload).
|
|
60
|
+
*/
|
|
61
|
+
readonly injected: boolean;
|
|
62
|
+
}
|
|
63
|
+
/**
|
|
64
|
+
* Returns `query` (possibly modified) plus a flag indicating
|
|
65
|
+
* whether the injector actually appended the selection. If the
|
|
66
|
+
* document doesn't have a single top-level operation we can
|
|
67
|
+
* identify, returns the input unchanged with `injected: false`.
|
|
68
|
+
*/
|
|
69
|
+
export declare const injectComplexity: (query: string, options?: ComplexityInjectionOptions) => ComplexityInjectionResult;
|
|
70
|
+
/**
|
|
71
|
+
* Reads the `complexity` field from a Monday GraphQL response body,
|
|
72
|
+
* shaping it into the CLI's `meta.complexity` contract.
|
|
73
|
+
*
|
|
74
|
+
* - `used` ← Monday's `query` field (cost of the query).
|
|
75
|
+
* - `remaining`← Monday's `after` (budget left after this call).
|
|
76
|
+
* - `reset_in_seconds` ← Monday's `reset_in_x_seconds`.
|
|
77
|
+
*
|
|
78
|
+
* Returns `null` (not undefined) when the response carries no
|
|
79
|
+
* `complexity` block, matching `cli-design.md` §6.1's rule that
|
|
80
|
+
* `meta.complexity` is always present and either an object or `null`.
|
|
81
|
+
*
|
|
82
|
+
* The function is permissive about which shape gets handed in:
|
|
83
|
+
* - `body` may be the entire response body (`{ data: { complexity }
|
|
84
|
+
* }`), the `data` object, or just the `complexity` object itself.
|
|
85
|
+
* - Numeric fields that aren't finite numbers fall back through the
|
|
86
|
+
* chain so a partial response (Monday's reverse-proxy returning
|
|
87
|
+
* half the fields) still produces something usable.
|
|
88
|
+
*/
|
|
89
|
+
export declare const parseComplexity: (body: unknown) => Complexity | null;
|
|
90
|
+
//# sourceMappingURL=complexity.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"complexity.d.ts","sourceRoot":"","sources":["../../src/api/complexity.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAqCG;AAEH,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,6BAA6B,CAAC;AAE9D,MAAM,WAAW,0BAA0B;IACzC;;;;;OAKG;IACH,QAAQ,CAAC,SAAS,CAAC,EAAE,MAAM,CAAC;CAC7B;AA2ED,MAAM,WAAW,yBAAyB;IACxC,gDAAgD;IAChD,QAAQ,CAAC,KAAK,EAAE,MAAM,CAAC;IACvB;;;;;;;;OAQG;IACH,QAAQ,CAAC,QAAQ,EAAE,OAAO,CAAC;CAC5B;AAED;;;;;GAKG;AACH,eAAO,MAAM,gBAAgB,GAC3B,OAAO,MAAM,EACb,UAAS,0BAA+B,KACvC,yBAiBF,CAAC;AAEF;;;;;;;;;;;;;;;;;;GAkBG;AACH,eAAO,MAAM,eAAe,GAAI,MAAM,OAAO,KAAG,UAAU,GAAG,IAmD5D,CAAC"}
|
|
@@ -0,0 +1,194 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Complexity selection + extraction (`v0.1-plan.md` §3 M2,
|
|
3
|
+
* `cli-design.md` §6.1).
|
|
4
|
+
*
|
|
5
|
+
* Two halves:
|
|
6
|
+
*
|
|
7
|
+
* - **Injection.** When `--verbose` is on, every Monday GraphQL
|
|
8
|
+
* request gets a `complexity { used remaining reset_in_seconds }`
|
|
9
|
+
* selection appended at the operation root. This costs ~1
|
|
10
|
+
* complexity point per call but lets the CLI surface the budget
|
|
11
|
+
* in `meta.complexity` without a separate query. Without
|
|
12
|
+
* `--verbose`, `meta.complexity` is `null` per §6.1.
|
|
13
|
+
*
|
|
14
|
+
* - **Extraction.** Reads the `complexity` field off the response
|
|
15
|
+
* body and projects the SDK's three integer fields (`query`,
|
|
16
|
+
* `after`, `reset_in_x_seconds`) onto the CLI's stable shape
|
|
17
|
+
* (`used`, `remaining`, `reset_in_seconds`). The CLI re-spells
|
|
18
|
+
* Monday's field names so a future API renaming doesn't ripple
|
|
19
|
+
* through every command's output schema.
|
|
20
|
+
*
|
|
21
|
+
* The injector lives at the *string* level rather than via an AST
|
|
22
|
+
* because:
|
|
23
|
+
* - `graphql-request` ships no AST helper at the SDK we depend on;
|
|
24
|
+
* pulling in `graphql/parser` for one selection is a heavy cost.
|
|
25
|
+
* - The transformation is mechanical and bounded: locate the first
|
|
26
|
+
* top-level `query`/`mutation`/`{` and inject the field at the
|
|
27
|
+
* end of its outermost selection set. Edge cases (operation
|
|
28
|
+
* name, variable declarations, fragments) leave the injection
|
|
29
|
+
* site unchanged.
|
|
30
|
+
*
|
|
31
|
+
* The implementation is conservative: if the query string is not
|
|
32
|
+
* recognised as a single top-level operation, the injector returns
|
|
33
|
+
* the input unchanged and the caller proceeds without complexity
|
|
34
|
+
* tracking. That trades absolute coverage for resilience — `monday
|
|
35
|
+
* raw` accepts arbitrary GraphQL, and we'd rather lose verbose
|
|
36
|
+
* complexity on a custom multi-operation document than break the
|
|
37
|
+
* query.
|
|
38
|
+
*/
|
|
39
|
+
const DEFAULT_COMPLEXITY_SELECTION = 'complexity { before after query reset_in_x_seconds }';
|
|
40
|
+
/**
|
|
41
|
+
* Returns true when `query` already declares a top-level
|
|
42
|
+
* `complexity` selection — we don't want to inject a duplicate.
|
|
43
|
+
*
|
|
44
|
+
* Match is intentionally narrow: a literal `complexity {` outside a
|
|
45
|
+
* variable declaration. Arguments named `complexity:` (rare, but
|
|
46
|
+
* possible in mutation inputs) won't match because the regex
|
|
47
|
+
* insists on the `{` delimiter immediately after.
|
|
48
|
+
*/
|
|
49
|
+
const hasComplexitySelection = (query) => /\bcomplexity\s*\{/u.test(query);
|
|
50
|
+
/**
|
|
51
|
+
* Locates the closing `}` of the *outermost* selection set inside the
|
|
52
|
+
* GraphQL document — i.e. the operation body. Returns the index of
|
|
53
|
+
* that `}` on success, or undefined if the document doesn't have a
|
|
54
|
+
* recognisable single-operation shape.
|
|
55
|
+
*
|
|
56
|
+
* The scan walks brace depth: the first `{` is the operation body's
|
|
57
|
+
* opener; we count up/down until we land back at depth 0. String
|
|
58
|
+
* literals (block strings or quoted strings inside arguments) are
|
|
59
|
+
* skipped to avoid mis-counting braces buried in `description: "{"`.
|
|
60
|
+
*/
|
|
61
|
+
const findOperationBodyClose = (query) => {
|
|
62
|
+
let firstBrace = -1;
|
|
63
|
+
let depth = 0;
|
|
64
|
+
let inBlockString = false;
|
|
65
|
+
let inString = false;
|
|
66
|
+
for (let i = 0; i < query.length; i++) {
|
|
67
|
+
const ch = query[i];
|
|
68
|
+
if (inBlockString) {
|
|
69
|
+
if (ch === '"' && query.slice(i, i + 3) === '"""') {
|
|
70
|
+
inBlockString = false;
|
|
71
|
+
i += 2;
|
|
72
|
+
}
|
|
73
|
+
continue;
|
|
74
|
+
}
|
|
75
|
+
if (inString) {
|
|
76
|
+
if (ch === '\\' && i + 1 < query.length) {
|
|
77
|
+
i++;
|
|
78
|
+
continue;
|
|
79
|
+
}
|
|
80
|
+
if (ch === '"')
|
|
81
|
+
inString = false;
|
|
82
|
+
continue;
|
|
83
|
+
}
|
|
84
|
+
if (ch === '"' && query.slice(i, i + 3) === '"""') {
|
|
85
|
+
inBlockString = true;
|
|
86
|
+
i += 2;
|
|
87
|
+
continue;
|
|
88
|
+
}
|
|
89
|
+
if (ch === '"') {
|
|
90
|
+
inString = true;
|
|
91
|
+
continue;
|
|
92
|
+
}
|
|
93
|
+
if (ch === '{') {
|
|
94
|
+
if (firstBrace === -1)
|
|
95
|
+
firstBrace = i;
|
|
96
|
+
depth++;
|
|
97
|
+
}
|
|
98
|
+
else if (ch === '}') {
|
|
99
|
+
depth--;
|
|
100
|
+
if (depth === 0 && firstBrace !== -1) {
|
|
101
|
+
return i;
|
|
102
|
+
}
|
|
103
|
+
if (depth < 0) {
|
|
104
|
+
return undefined;
|
|
105
|
+
}
|
|
106
|
+
}
|
|
107
|
+
}
|
|
108
|
+
return undefined;
|
|
109
|
+
};
|
|
110
|
+
/**
|
|
111
|
+
* Returns `query` (possibly modified) plus a flag indicating
|
|
112
|
+
* whether the injector actually appended the selection. If the
|
|
113
|
+
* document doesn't have a single top-level operation we can
|
|
114
|
+
* identify, returns the input unchanged with `injected: false`.
|
|
115
|
+
*/
|
|
116
|
+
export const injectComplexity = (query, options = {}) => {
|
|
117
|
+
if (hasComplexitySelection(query)) {
|
|
118
|
+
return { query, injected: false };
|
|
119
|
+
}
|
|
120
|
+
const selection = options.selection ?? DEFAULT_COMPLEXITY_SELECTION;
|
|
121
|
+
const close = findOperationBodyClose(query);
|
|
122
|
+
if (close === undefined) {
|
|
123
|
+
return { query, injected: false };
|
|
124
|
+
}
|
|
125
|
+
// Insert before the closing `}` with surrounding whitespace so the
|
|
126
|
+
// result still parses cleanly. Don't try to indent — Monday's
|
|
127
|
+
// server doesn't care, and aligning to existing whitespace would
|
|
128
|
+
// double the cost of this function for no observable difference.
|
|
129
|
+
return {
|
|
130
|
+
query: `${query.slice(0, close)} ${selection} ${query.slice(close)}`,
|
|
131
|
+
injected: true,
|
|
132
|
+
};
|
|
133
|
+
};
|
|
134
|
+
/**
|
|
135
|
+
* Reads the `complexity` field from a Monday GraphQL response body,
|
|
136
|
+
* shaping it into the CLI's `meta.complexity` contract.
|
|
137
|
+
*
|
|
138
|
+
* - `used` ← Monday's `query` field (cost of the query).
|
|
139
|
+
* - `remaining`← Monday's `after` (budget left after this call).
|
|
140
|
+
* - `reset_in_seconds` ← Monday's `reset_in_x_seconds`.
|
|
141
|
+
*
|
|
142
|
+
* Returns `null` (not undefined) when the response carries no
|
|
143
|
+
* `complexity` block, matching `cli-design.md` §6.1's rule that
|
|
144
|
+
* `meta.complexity` is always present and either an object or `null`.
|
|
145
|
+
*
|
|
146
|
+
* The function is permissive about which shape gets handed in:
|
|
147
|
+
* - `body` may be the entire response body (`{ data: { complexity }
|
|
148
|
+
* }`), the `data` object, or just the `complexity` object itself.
|
|
149
|
+
* - Numeric fields that aren't finite numbers fall back through the
|
|
150
|
+
* chain so a partial response (Monday's reverse-proxy returning
|
|
151
|
+
* half the fields) still produces something usable.
|
|
152
|
+
*/
|
|
153
|
+
export const parseComplexity = (body) => {
|
|
154
|
+
if (body === null || typeof body !== 'object') {
|
|
155
|
+
return null;
|
|
156
|
+
}
|
|
157
|
+
const obj = body;
|
|
158
|
+
// Try to peel back the wrappings: `{data: {complexity: ...}}` →
|
|
159
|
+
// `{complexity: ...}` → the leaf object.
|
|
160
|
+
let leaf;
|
|
161
|
+
if ('complexity' in obj &&
|
|
162
|
+
typeof obj.complexity === 'object' &&
|
|
163
|
+
obj.complexity !== null) {
|
|
164
|
+
leaf = obj.complexity;
|
|
165
|
+
}
|
|
166
|
+
else if ('data' in obj &&
|
|
167
|
+
typeof obj.data === 'object' &&
|
|
168
|
+
obj.data !== null) {
|
|
169
|
+
const data = obj.data;
|
|
170
|
+
if ('complexity' in data &&
|
|
171
|
+
typeof data.complexity === 'object' &&
|
|
172
|
+
data.complexity !== null) {
|
|
173
|
+
leaf = data.complexity;
|
|
174
|
+
}
|
|
175
|
+
}
|
|
176
|
+
else if ('query' in obj || 'after' in obj || 'reset_in_x_seconds' in obj) {
|
|
177
|
+
leaf = obj;
|
|
178
|
+
}
|
|
179
|
+
if (leaf === undefined) {
|
|
180
|
+
return null;
|
|
181
|
+
}
|
|
182
|
+
const finiteNumber = (v) => typeof v === 'number' && Number.isFinite(v) ? v : undefined;
|
|
183
|
+
const used = finiteNumber(leaf.query) ?? finiteNumber(leaf.used) ?? 0;
|
|
184
|
+
const remaining = finiteNumber(leaf.after) ?? finiteNumber(leaf.remaining) ?? 0;
|
|
185
|
+
const resetInSeconds = finiteNumber(leaf.reset_in_x_seconds) ??
|
|
186
|
+
finiteNumber(leaf.reset_in_seconds) ??
|
|
187
|
+
0;
|
|
188
|
+
return {
|
|
189
|
+
used,
|
|
190
|
+
remaining,
|
|
191
|
+
reset_in_seconds: resetInSeconds,
|
|
192
|
+
};
|
|
193
|
+
};
|
|
194
|
+
//# sourceMappingURL=complexity.js.map
|
|
@@ -0,0 +1 @@
|
|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AAC,CAAU,EAAsB,EAAE,CACtD,OAAO,CAAC,KAAK,QAAQ,IAAI,MAAM,CAAC,QAAQ,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,SAAS,CAAC;IAE9D,MAAM,IAAI,GAAG,YAAY,CAAC,IAAI,CAAC,KAAK,CAAC,IAAI,YAAY,CAAC,IAAI,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;IACtE,MAAM,SAAS,GACb,YAAY,CAAC,IAAI,CAAC,KAAK,CAAC,IAAI,YAAY,CAAC,IAAI,CAAC,SAAS,CAAC,IAAI,CAAC,CAAC;IAChE,MAAM,cAAc,GAClB,YAAY,CAAC,IAAI,CAAC,kBAAkB,CAAC;QACrC,YAAY,CAAC,IAAI,CAAC,gBAAgB,CAAC;QACnC,CAAC,CAAC;IAEJ,OAAO;QACL,IAAI;QACJ,SAAS;QACT,gBAAgB,EAAE,cAAc;KACjC,CAAC;AACJ,CAAC,CAAC"}
|
|
@@ -0,0 +1,150 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Pure date-resolution helpers for the `date` column-value
|
|
3
|
+
* translator (`cli-design.md` §5.3 step 3 + the
|
|
4
|
+
* "Relative dates and timezone" subsection).
|
|
5
|
+
*
|
|
6
|
+
* Two surfaces:
|
|
7
|
+
*
|
|
8
|
+
* - `parseDateInput` — accepts every input shape `cli-design.md`
|
|
9
|
+
* §5.3 step 3 enumerates: ISO date (`YYYY-MM-DD`), ISO date+time
|
|
10
|
+
* (`YYYY-MM-DDTHH:MM[:SS]`), and the relative-token set
|
|
11
|
+
* (`today`, `tomorrow`, `+Nd`, `-Nw`, `+Nh`). Returns the
|
|
12
|
+
* Monday wire payload (`{date}` or `{date, time}`) plus the
|
|
13
|
+
* `resolvedFrom` echo `cli-design.md` §6.4 puts on the
|
|
14
|
+
* dry-run envelope.
|
|
15
|
+
* - `formatNowInTimezone` — used internally to format an
|
|
16
|
+
* instant in an IANA timezone for the `resolvedFrom.now`
|
|
17
|
+
* echo. Exported because the dry-run engine (M5a follow-up)
|
|
18
|
+
* will need the same shape for non-date columns' `now`
|
|
19
|
+
* timestamp.
|
|
20
|
+
*
|
|
21
|
+
* **Why a separate module.** column-values.ts owns translator
|
|
22
|
+
* *dispatch* — the switch over WritableColumnType, the
|
|
23
|
+
* mutation-selection helper, and the ApiError builder. The date
|
|
24
|
+
* translator's machinery is ~150 LOC of regex + Intl
|
|
25
|
+
* gymnastics with no dispatch concerns. Splitting keeps
|
|
26
|
+
* column-values.ts at one screen of dispatch logic and the date
|
|
27
|
+
* machinery isolated for unit testing.
|
|
28
|
+
*
|
|
29
|
+
* **No external dep.** Uses only `Intl.DateTimeFormat` for tz
|
|
30
|
+
* formatting + `Date` arithmetic. The CLI rules forbid pulling
|
|
31
|
+
* in luxon / date-fns / dayjs for stdlib-doable work; Node 22
|
|
32
|
+
* ships full ICU and `longOffset` tz formatting, which covers
|
|
33
|
+
* everything `cli-design.md` §5.3 needs.
|
|
34
|
+
*/
|
|
35
|
+
/**
|
|
36
|
+
* Wire payload shape for a `date` column. Matches Monday's
|
|
37
|
+
* `change_column_value(value: JSON!)` JSON scalar:
|
|
38
|
+
* - date-only input → `{date: "YYYY-MM-DD"}`
|
|
39
|
+
* - date+time input → `{date: "YYYY-MM-DD", time: "HH:MM:SS"}`
|
|
40
|
+
*
|
|
41
|
+
* `time` is always `HH:MM:SS` (24-hour, padded). Inputs that
|
|
42
|
+
* omit seconds default to `:00` so the wire shape stays
|
|
43
|
+
* consistent — Monday's API accepts `:30` as `:30:00` already
|
|
44
|
+
* but pinning the format here means the round-trip diff in
|
|
45
|
+
* dry-run output stays stable.
|
|
46
|
+
*/
|
|
47
|
+
export type DatePayload = {
|
|
48
|
+
readonly date: string;
|
|
49
|
+
} | {
|
|
50
|
+
readonly date: string;
|
|
51
|
+
readonly time: string;
|
|
52
|
+
};
|
|
53
|
+
/**
|
|
54
|
+
* The `resolved_from` echo `cli-design.md` §5.3 lines 783-786 +
|
|
55
|
+
* §6.4 prescribe for the dry-run envelope. Returned by
|
|
56
|
+
* `parseDateInput` for relative-token inputs (where the agent
|
|
57
|
+
* benefits from seeing the absolute date the CLI computed) and
|
|
58
|
+
* `null` for explicit ISO inputs (which need no resolution).
|
|
59
|
+
*
|
|
60
|
+
* Shape is a struct, not a string blob, because the dry-run
|
|
61
|
+
* engine (M5a follow-up) reads `timezone` to decide whether
|
|
62
|
+
* to emit a `MONDAY_TIMEZONE not set` warning when the system
|
|
63
|
+
* tz was used as a fallback.
|
|
64
|
+
*/
|
|
65
|
+
export interface DateResolution {
|
|
66
|
+
/** The literal input the agent passed (e.g. `+1w`). */
|
|
67
|
+
readonly input: string;
|
|
68
|
+
/** IANA timezone string used for resolution (e.g. `Europe/London`). */
|
|
69
|
+
readonly timezone: string;
|
|
70
|
+
/**
|
|
71
|
+
* The instant "now" was sampled at, formatted as a local-time
|
|
72
|
+
* ISO string with offset (e.g. `2026-04-25T14:00:00+01:00`).
|
|
73
|
+
* cli-design §5.3 sample at line 786 pins this format.
|
|
74
|
+
*/
|
|
75
|
+
readonly now: string;
|
|
76
|
+
}
|
|
77
|
+
export interface DateResolutionContext {
|
|
78
|
+
/**
|
|
79
|
+
* Source of "now" for relative-date resolution. Defaults to
|
|
80
|
+
* `() => new Date()`. Tests inject a deterministic clock to
|
|
81
|
+
* pin DST-boundary behaviour without wall-clock waits — same
|
|
82
|
+
* pattern as `pagination.ts`'s cursor clock (M4 §14
|
|
83
|
+
* post-mortem prophylactic).
|
|
84
|
+
*/
|
|
85
|
+
readonly now?: () => Date;
|
|
86
|
+
/**
|
|
87
|
+
* IANA timezone string for relative-date resolution. Defaults
|
|
88
|
+
* to the system timezone via
|
|
89
|
+
* `Intl.DateTimeFormat().resolvedOptions().timeZone` per
|
|
90
|
+
* cli-design §5.3 line 766. M5b's command layer plumbs
|
|
91
|
+
* `MONDAY_TIMEZONE` env override through this slot.
|
|
92
|
+
*/
|
|
93
|
+
readonly timezone?: string;
|
|
94
|
+
}
|
|
95
|
+
export interface ParsedDateInput {
|
|
96
|
+
readonly payload: DatePayload;
|
|
97
|
+
/**
|
|
98
|
+
* `null` for explicit ISO inputs — the input *is* the
|
|
99
|
+
* resolved value; nothing to echo. A struct for relative
|
|
100
|
+
* tokens — the dry-run envelope shows the agent what the
|
|
101
|
+
* CLI computed against which tz at which clock instant.
|
|
102
|
+
*/
|
|
103
|
+
readonly resolvedFrom: DateResolution | null;
|
|
104
|
+
}
|
|
105
|
+
/**
|
|
106
|
+
* Parses a `date` column input per cli-design §5.3 step 3.
|
|
107
|
+
*
|
|
108
|
+
* Accepted inputs:
|
|
109
|
+
* - **ISO date** `YYYY-MM-DD` → `{date}` payload, no
|
|
110
|
+
* resolution echo.
|
|
111
|
+
* - **ISO date+time** `YYYY-MM-DDTHH:MM` or
|
|
112
|
+
* `YYYY-MM-DDTHH:MM:SS` → `{date, time}` payload, no
|
|
113
|
+
* resolution echo. Seconds default to `:00`.
|
|
114
|
+
* - **Relative tokens**:
|
|
115
|
+
* - `today` → today's date in `ctx.timezone`.
|
|
116
|
+
* - `tomorrow` → today + 1 day in `ctx.timezone`.
|
|
117
|
+
* - `+Nd` / `-Nd` (days), `+Nw` / `-Nw` (weeks) →
|
|
118
|
+
* date-only output, calendar arithmetic in `ctx.timezone`.
|
|
119
|
+
* - `+Nh` / `-Nh` (hours) → date+time output, instant
|
|
120
|
+
* arithmetic (UTC offset preserved across DST per
|
|
121
|
+
* industry standard — `+24h` from a GMT instant lands
|
|
122
|
+
* at the same UTC instant +24h, which may shift the
|
|
123
|
+
* wall-clock time by an hour on a DST boundary day).
|
|
124
|
+
*
|
|
125
|
+
* Throws `usage_error` with a structured `details` shape for
|
|
126
|
+
* unrecognised input. The error message lists the supported
|
|
127
|
+
* forms so an agent's debug log shows the right shape to
|
|
128
|
+
* paste-and-edit.
|
|
129
|
+
*
|
|
130
|
+
* @param raw - The raw user-supplied value (post-`--set`
|
|
131
|
+
* parsing).
|
|
132
|
+
* @param columnId - Column ID for error messages.
|
|
133
|
+
* @param ctx - Resolution context. Defaults to system clock +
|
|
134
|
+
* system tz when omitted; M5b's command layer plumbs the
|
|
135
|
+
* `MONDAY_TIMEZONE` env override.
|
|
136
|
+
*/
|
|
137
|
+
export declare const parseDateInput: (raw: string, columnId: string, ctx?: DateResolutionContext) => ParsedDateInput;
|
|
138
|
+
/**
|
|
139
|
+
* Formats an instant as a local-time ISO string with UTC
|
|
140
|
+
* offset, e.g. `2026-04-25T14:00:00+01:00`. cli-design §5.3
|
|
141
|
+
* line 786 sample pins this exact shape.
|
|
142
|
+
*
|
|
143
|
+
* Uses Intl's `longOffset` token (Node 22+ ICU full data) for
|
|
144
|
+
* the offset suffix; falls back to `+00:00` if the runtime's
|
|
145
|
+
* Intl reports an unparseable form. Exported for the dry-run
|
|
146
|
+
* engine which uses the same formatter for non-date columns'
|
|
147
|
+
* `now` echo.
|
|
148
|
+
*/
|
|
149
|
+
export declare const formatNowInTimezone: (instant: Date, timezone: string) => string;
|
|
150
|
+
//# sourceMappingURL=dates.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"dates.d.ts","sourceRoot":"","sources":["../../src/api/dates.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAiCG;AAIH;;;;;;;;;;;GAWG;AACH,MAAM,MAAM,WAAW,GACnB;IAAE,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAA;CAAE,GACzB;IAAE,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC;IAAC,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAA;CAAE,CAAC;AAErD;;;;;;;;;;;GAWG;AACH,MAAM,WAAW,cAAc;IAC7B,uDAAuD;IACvD,QAAQ,CAAC,KAAK,EAAE,MAAM,CAAC;IACvB,uEAAuE;IACvE,QAAQ,CAAC,QAAQ,EAAE,MAAM,CAAC;IAC1B;;;;OAIG;IACH,QAAQ,CAAC,GAAG,EAAE,MAAM,CAAC;CACtB;AAED,MAAM,WAAW,qBAAqB;IACpC;;;;;;OAMG;IACH,QAAQ,CAAC,GAAG,CAAC,EAAE,MAAM,IAAI,CAAC;IAC1B;;;;;;OAMG;IACH,QAAQ,CAAC,QAAQ,CAAC,EAAE,MAAM,CAAC;CAC5B;AAED,MAAM,WAAW,eAAe;IAC9B,QAAQ,CAAC,OAAO,EAAE,WAAW,CAAC;IAC9B;;;;;OAKG;IACH,QAAQ,CAAC,YAAY,EAAE,cAAc,GAAG,IAAI,CAAC;CAC9C;AAED;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA+BG;AACH,eAAO,MAAM,cAAc,GACzB,KAAK,MAAM,EACX,UAAU,MAAM,EAChB,MAAK,qBAA0B,KAC9B,eAyBF,CAAC;AAyWF;;;;;;;;;;GAUG;AACH,eAAO,MAAM,mBAAmB,GAAI,SAAS,IAAI,EAAE,UAAU,MAAM,KAAG,MAOrE,CAAC"}
|