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,167 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Pure phone-resolution helpers for the `phone` column-value translator
|
|
3
|
+
* (`cli-design.md` §5.3 step 3 v0.2 expansion, `v0.2-plan.md` §3 M8).
|
|
4
|
+
*
|
|
5
|
+
* Surface:
|
|
6
|
+
* - `parsePhoneInput` — accepts the **mandatory** pipe-form
|
|
7
|
+
* `<phone>|<country>` cli-design §5.3 enumerates. E.164-loose
|
|
8
|
+
* phone validation; ISO 3166-1 alpha-2 country code validated
|
|
9
|
+
* against a frozen allowlist (`iso-country-codes.ts`).
|
|
10
|
+
*
|
|
11
|
+
* **Why pipe form is mandatory.** Monday's phone-column validation
|
|
12
|
+
* requires both the number AND the 2-letter country code AND verifies
|
|
13
|
+
* they match (per Monday's phone-validation changelog). The friendly
|
|
14
|
+
* translator can't safely default `countryShortName: ""` — Monday
|
|
15
|
+
* would reject the mutation as `validation_failed`. Agents who need
|
|
16
|
+
* to write a phone with no country (Monday allows it for some legacy
|
|
17
|
+
* fixtures) use `--set-raw`.
|
|
18
|
+
*
|
|
19
|
+
* **E.164-loose validation.** The phone segment matches `+?\d{6,15}`
|
|
20
|
+
* — leading `+` optional, 6-15 digits otherwise. E.164's strict rule
|
|
21
|
+
* is "1-15 digits" but the CLI insists on at least 6 to catch
|
|
22
|
+
* obvious typos (`--set Mobile=+1|US` would silently land at Monday
|
|
23
|
+
* and fail server-side). The bound is a sanity check, not a
|
|
24
|
+
* complete E.164 validator — Monday is the validator of last resort.
|
|
25
|
+
*
|
|
26
|
+
* **No internal whitespace, no dashes.** `+1 555 123 4567` and
|
|
27
|
+
* `+1-555-123-4567` are rejected. cli-design doesn't pin this
|
|
28
|
+
* explicitly but Monday's API expects bare digits + an optional
|
|
29
|
+
* leading `+`. Agents who paste a formatted phone strip the
|
|
30
|
+
* separators in the shell pipeline (`tr -d ' -'`).
|
|
31
|
+
*
|
|
32
|
+
* **Why a separate module.** Same template `links.ts` / `dates.ts`
|
|
33
|
+
* follow — column-values.ts owns translator dispatch; the per-type
|
|
34
|
+
* grammar machinery lives one module deeper. The ISO allowlist is
|
|
35
|
+
* larger again (`iso-country-codes.ts`) so the layering keeps
|
|
36
|
+
* column-values.ts at one screen of dispatch logic.
|
|
37
|
+
*/
|
|
38
|
+
import { UsageError } from '../utils/errors.js';
|
|
39
|
+
import { isIsoCountryCode } from './iso-country-codes.js';
|
|
40
|
+
const PHONE_PATTERN = /^\+?\d{6,15}$/u;
|
|
41
|
+
/**
|
|
42
|
+
* Parses a `phone` column input per cli-design.md §5.3 step 3 v0.2
|
|
43
|
+
* expansion.
|
|
44
|
+
*
|
|
45
|
+
* Accepted input — pipe form is **mandatory**:
|
|
46
|
+
* - `<phone>|<country>` → `{phone, countryShortName}`. Both
|
|
47
|
+
* segments trimmed; pipe-split max 1. Country code uppercased
|
|
48
|
+
* before allowlist check (so `us` and `US` both work).
|
|
49
|
+
*
|
|
50
|
+
* Rejected (all `usage_error`):
|
|
51
|
+
* - **Single segment** (`+15551234567` without `|US`) — Monday
|
|
52
|
+
* requires both. Agents who need an empty country use
|
|
53
|
+
* `--set-raw`. cli-design §5.3 line 819-827.
|
|
54
|
+
* - **Phone fails E.164-loose** (`+?\d{6,15}` after trim).
|
|
55
|
+
* - **Country fails ISO allowlist** (after uppercase).
|
|
56
|
+
* - **Empty leader / trailer** (`|US` or `+1555|`).
|
|
57
|
+
* - **Empty input** after trim.
|
|
58
|
+
*
|
|
59
|
+
* @param raw - The raw user-supplied value (post-`--set` parsing).
|
|
60
|
+
* @param columnId - Column ID for error messages.
|
|
61
|
+
*/
|
|
62
|
+
export const parsePhoneInput = (raw, columnId) => {
|
|
63
|
+
const trimmedRaw = raw.trim();
|
|
64
|
+
if (trimmedRaw.length === 0) {
|
|
65
|
+
throw emptyPhoneInputError(columnId, raw);
|
|
66
|
+
}
|
|
67
|
+
const pipeIdx = trimmedRaw.indexOf('|');
|
|
68
|
+
if (pipeIdx === -1) {
|
|
69
|
+
// Single-segment input — rejected. Monday requires both phone +
|
|
70
|
+
// country, and the friendly translator won't paper over the
|
|
71
|
+
// mismatch by silently defaulting `countryShortName: ""`.
|
|
72
|
+
throw new UsageError(`Phone column "${columnId}" requires the pipe form ` +
|
|
73
|
+
`<phone>|<country> (got "${raw}"). Monday's phone-column ` +
|
|
74
|
+
`validation needs both the number and a 2-letter ISO 3166-1 ` +
|
|
75
|
+
`alpha-2 country code AND verifies they match — the friendly ` +
|
|
76
|
+
`translator can't safely default the country. Use --set-raw to ` +
|
|
77
|
+
`write a phone with no country if Monday's legacy behaviour ` +
|
|
78
|
+
`permits it.`, {
|
|
79
|
+
details: {
|
|
80
|
+
column_id: columnId,
|
|
81
|
+
column_type: 'phone',
|
|
82
|
+
raw_input: raw,
|
|
83
|
+
hint: `pass --set ${columnId}='+15551234567|US'. The country code ` +
|
|
84
|
+
`is uppercase ISO 3166-1 alpha-2 (e.g. US, GB, JP). To write ` +
|
|
85
|
+
`with empty country: --set-raw ${columnId}=` +
|
|
86
|
+
`'{"phone":"+15551234567","countryShortName":""}'.`,
|
|
87
|
+
},
|
|
88
|
+
});
|
|
89
|
+
}
|
|
90
|
+
const phoneSegment = trimmedRaw.slice(0, pipeIdx).trim();
|
|
91
|
+
const countrySegment = trimmedRaw.slice(pipeIdx + 1).trim();
|
|
92
|
+
if (phoneSegment.length === 0) {
|
|
93
|
+
throw new UsageError(`Phone column "${columnId}" got an empty phone segment ("${raw}"). ` +
|
|
94
|
+
`The friendly translator requires a non-empty number before "|".`, {
|
|
95
|
+
details: {
|
|
96
|
+
column_id: columnId,
|
|
97
|
+
column_type: 'phone',
|
|
98
|
+
raw_input: raw,
|
|
99
|
+
hint: `pass --set ${columnId}='+15551234567|US' with the phone ` +
|
|
100
|
+
`before the "|" and the ISO 3166-1 alpha-2 country after.`,
|
|
101
|
+
},
|
|
102
|
+
});
|
|
103
|
+
}
|
|
104
|
+
if (countrySegment.length === 0) {
|
|
105
|
+
throw new UsageError(`Phone column "${columnId}" got an empty country segment ("${raw}"). ` +
|
|
106
|
+
`Monday requires a 2-letter ISO 3166-1 alpha-2 country code after ` +
|
|
107
|
+
`the "|". Use --set-raw to write a phone with no country.`, {
|
|
108
|
+
details: {
|
|
109
|
+
column_id: columnId,
|
|
110
|
+
column_type: 'phone',
|
|
111
|
+
raw_input: raw,
|
|
112
|
+
hint: `pass --set ${columnId}='+15551234567|US'. To write with ` +
|
|
113
|
+
`empty country: --set-raw ${columnId}=` +
|
|
114
|
+
`'{"phone":"+15551234567","countryShortName":""}'.`,
|
|
115
|
+
},
|
|
116
|
+
});
|
|
117
|
+
}
|
|
118
|
+
if (!PHONE_PATTERN.test(phoneSegment)) {
|
|
119
|
+
throw new UsageError(`Phone column "${columnId}" got invalid phone "${phoneSegment}". ` +
|
|
120
|
+
`The friendly translator accepts E.164-loose digits with an ` +
|
|
121
|
+
`optional leading "+" (6-15 digits, no whitespace, no dashes). ` +
|
|
122
|
+
`Strip separators before --set, or use --set-raw with Monday's ` +
|
|
123
|
+
`documented wire shape.`, {
|
|
124
|
+
details: {
|
|
125
|
+
column_id: columnId,
|
|
126
|
+
column_type: 'phone',
|
|
127
|
+
raw_input: raw,
|
|
128
|
+
phone_segment: phoneSegment,
|
|
129
|
+
hint: `strip whitespace and dashes — pass --set ${columnId}=` +
|
|
130
|
+
`'+15551234567|US' (not "+1 555 123 4567|US"). The shell ` +
|
|
131
|
+
`pipeline can do this with \`tr -d ' -'\`.`,
|
|
132
|
+
},
|
|
133
|
+
});
|
|
134
|
+
}
|
|
135
|
+
const countryUpper = countrySegment.toUpperCase();
|
|
136
|
+
if (!isIsoCountryCode(countryUpper)) {
|
|
137
|
+
throw new UsageError(`Phone column "${columnId}" got invalid country code ` +
|
|
138
|
+
`"${countrySegment}". Monday requires a 2-letter ISO 3166-1 ` +
|
|
139
|
+
`alpha-2 code (e.g. US, GB, JP). The CLI checks against a ` +
|
|
140
|
+
`frozen 249-code allowlist; exceptionally-reserved (UK, EU), ` +
|
|
141
|
+
`transitional, and user-assigned codes are excluded.`, {
|
|
142
|
+
details: {
|
|
143
|
+
column_id: columnId,
|
|
144
|
+
column_type: 'phone',
|
|
145
|
+
raw_input: raw,
|
|
146
|
+
country_segment: countrySegment,
|
|
147
|
+
hint: `pass an ISO 3166-1 alpha-2 code (US, GB, JP, etc.). The ` +
|
|
148
|
+
`code is uppercased before validation, so "us" works the ` +
|
|
149
|
+
`same as "US". The full list is at ` +
|
|
150
|
+
`https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2.`,
|
|
151
|
+
},
|
|
152
|
+
});
|
|
153
|
+
}
|
|
154
|
+
return { phone: phoneSegment, countryShortName: countryUpper };
|
|
155
|
+
};
|
|
156
|
+
const emptyPhoneInputError = (columnId, raw) => new UsageError(`Phone column "${columnId}" needs <phone>|<country> input. Got ` +
|
|
157
|
+
`"${raw}". To clear a phone column, use \`monday item clear ` +
|
|
158
|
+
`<iid> ${columnId} [--board <bid>]\` instead.`, {
|
|
159
|
+
details: {
|
|
160
|
+
column_id: columnId,
|
|
161
|
+
column_type: 'phone',
|
|
162
|
+
raw_input: raw,
|
|
163
|
+
hint: `pass --set ${columnId}='+15551234567|US'. The country code ` +
|
|
164
|
+
`is uppercase ISO 3166-1 alpha-2 (e.g. US, GB, JP).`,
|
|
165
|
+
},
|
|
166
|
+
});
|
|
167
|
+
//# sourceMappingURL=phones.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"phones.js","sourceRoot":"","sources":["../../src/api/phones.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAoCG;AAEH,OAAO,EAAE,UAAU,EAAE,MAAM,oBAAoB,CAAC;AAChD,OAAO,EAAE,gBAAgB,EAAE,MAAM,wBAAwB,CAAC;AAiB1D,MAAM,aAAa,GAAG,gBAAgB,CAAC;AAEvC;;;;;;;;;;;;;;;;;;;;GAoBG;AACH,MAAM,CAAC,MAAM,eAAe,GAAG,CAC7B,GAAW,EACX,QAAgB,EACF,EAAE;IAChB,MAAM,UAAU,GAAG,GAAG,CAAC,IAAI,EAAE,CAAC;IAC9B,IAAI,UAAU,CAAC,MAAM,KAAK,CAAC,EAAE,CAAC;QAC5B,MAAM,oBAAoB,CAAC,QAAQ,EAAE,GAAG,CAAC,CAAC;IAC5C,CAAC;IAED,MAAM,OAAO,GAAG,UAAU,CAAC,OAAO,CAAC,GAAG,CAAC,CAAC;IACxC,IAAI,OAAO,KAAK,CAAC,CAAC,EAAE,CAAC;QACnB,gEAAgE;QAChE,4DAA4D;QAC5D,0DAA0D;QAC1D,MAAM,IAAI,UAAU,CAClB,iBAAiB,QAAQ,2BAA2B;YAClD,2BAA2B,GAAG,4BAA4B;YAC1D,6DAA6D;YAC7D,8DAA8D;YAC9D,gEAAgE;YAChE,6DAA6D;YAC7D,aAA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@@
|
|
|
1
|
+
export interface RawDocumentAnalysis {
|
|
2
|
+
/**
|
|
3
|
+
* The `operationName` to send on the wire. `undefined` when the
|
|
4
|
+
* document has exactly one anonymous operation (Monday picks it).
|
|
5
|
+
*/
|
|
6
|
+
readonly operationName: string | undefined;
|
|
7
|
+
/**
|
|
8
|
+
* The kind of the *selected* operation — the one Monday will
|
|
9
|
+
* actually execute. For 1-op docs this is the only operation's
|
|
10
|
+
* kind; for N-op docs `--operation-name` picks one and that
|
|
11
|
+
* pick's kind lands here. Callers gating on "is the executed
|
|
12
|
+
* op a mutation?" (e.g. raw's `--dry-run` branch — Codex M6
|
|
13
|
+
* pass-5 P2) should key off this, NOT off `hasMutation`, since
|
|
14
|
+
* a mixed doc selecting a query operation should be treated as
|
|
15
|
+
* read-only at execution time.
|
|
16
|
+
*/
|
|
17
|
+
readonly selectedOperationKind: 'query' | 'mutation' | 'subscription';
|
|
18
|
+
/** `true` when at least one operation in the doc is a mutation. */
|
|
19
|
+
readonly hasMutation: boolean;
|
|
20
|
+
/** `true` when at least one operation is a subscription. */
|
|
21
|
+
readonly hasSubscription: boolean;
|
|
22
|
+
/**
|
|
23
|
+
* One entry per operation in input order — used for error details
|
|
24
|
+
* and tests so the caller can confirm the parser saw what it
|
|
25
|
+
* expected.
|
|
26
|
+
*/
|
|
27
|
+
readonly operations: readonly {
|
|
28
|
+
readonly operation: 'query' | 'mutation' | 'subscription';
|
|
29
|
+
readonly name: string | undefined;
|
|
30
|
+
}[];
|
|
31
|
+
}
|
|
32
|
+
export interface AnalyzeRawDocumentInputs {
|
|
33
|
+
readonly query: string;
|
|
34
|
+
/**
|
|
35
|
+
* Caller-supplied `--operation-name`. Required when the document
|
|
36
|
+
* has more than one operation; optional otherwise (used as a
|
|
37
|
+
* sanity check — must match one of the operation names if set).
|
|
38
|
+
*/
|
|
39
|
+
readonly explicitOperationName: string | undefined;
|
|
40
|
+
/**
|
|
41
|
+
* `true` when `--allow-mutation` is set. Mutations and
|
|
42
|
+
* subscriptions are rejected with `usage_error` when this is
|
|
43
|
+
* `false`.
|
|
44
|
+
*/
|
|
45
|
+
readonly allowMutation: boolean;
|
|
46
|
+
}
|
|
47
|
+
/**
|
|
48
|
+
* Parses the GraphQL document and applies the two raw-command
|
|
49
|
+
* contract gates: mutation rejection (unless allowed) and
|
|
50
|
+
* `operationName` selection.
|
|
51
|
+
*/
|
|
52
|
+
export declare const analyzeRawDocument: (inputs: AnalyzeRawDocumentInputs) => RawDocumentAnalysis;
|
|
53
|
+
//# sourceMappingURL=raw-document.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"raw-document.d.ts","sourceRoot":"","sources":["../../src/api/raw-document.ts"],"names":[],"mappings":"AAuCA,MAAM,WAAW,mBAAmB;IAClC;;;OAGG;IACH,QAAQ,CAAC,aAAa,EAAE,MAAM,GAAG,SAAS,CAAC;IAC3C;;;;;;;;;OASG;IACH,QAAQ,CAAC,qBAAqB,EAAE,OAAO,GAAG,UAAU,GAAG,cAAc,CAAC;IACtE,mEAAmE;IACnE,QAAQ,CAAC,WAAW,EAAE,OAAO,CAAC;IAC9B,4DAA4D;IAC5D,QAAQ,CAAC,eAAe,EAAE,OAAO,CAAC;IAClC;;;;OAIG;IACH,QAAQ,CAAC,UAAU,EAAE,SAAS;QAC5B,QAAQ,CAAC,SAAS,EAAE,OAAO,GAAG,UAAU,GAAG,cAAc,CAAC;QAC1D,QAAQ,CAAC,IAAI,EAAE,MAAM,GAAG,SAAS,CAAC;KACnC,EAAE,CAAC;CACL;AAED,MAAM,WAAW,wBAAwB;IACvC,QAAQ,CAAC,KAAK,EAAE,MAAM,CAAC;IACvB;;;;OAIG;IACH,QAAQ,CAAC,qBAAqB,EAAE,MAAM,GAAG,SAAS,CAAC;IACnD;;;;OAIG;IACH,QAAQ,CAAC,aAAa,EAAE,OAAO,CAAC;CACjC;AAED;;;;GAIG;AACH,eAAO,MAAM,kBAAkB,GAC7B,QAAQ,wBAAwB,KAC/B,mBAsLF,CAAC"}
|
|
@@ -0,0 +1,177 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* GraphQL document analysis for `monday raw` (M6 close, P1 fix).
|
|
3
|
+
*
|
|
4
|
+
* `monday raw` accepts an arbitrary GraphQL document. Two contract
|
|
5
|
+
* decisions ride on what the document actually contains, and neither
|
|
6
|
+
* can be answered by a string sniff:
|
|
7
|
+
*
|
|
8
|
+
* 1. **Mutation gate.** The CLI rejects `mutation` / `subscription`
|
|
9
|
+
* operations unless `--allow-mutation` is passed. Read paths
|
|
10
|
+
* stay safe-by-default; an agent that meant to mutate has to
|
|
11
|
+
* say so explicitly (`cli-design.md` §10.5). A naive
|
|
12
|
+
* `query.includes('mutation')` regex matches the comment
|
|
13
|
+
* `# uses the mutation api` and the field `mutation_test` —
|
|
14
|
+
* neither is an actual mutation operation.
|
|
15
|
+
* 2. **`operationName` selection.** GraphQL servers use
|
|
16
|
+
* `operationName` to pick which operation to execute when a
|
|
17
|
+
* document has multiple. Hard-coding `'MondayRaw'` (the
|
|
18
|
+
* pre-fix M6 behaviour) breaks every document that doesn't
|
|
19
|
+
* happen to be named `MondayRaw` — Monday's server returns a
|
|
20
|
+
* "Unknown operation" error instead of executing the only
|
|
21
|
+
* operation present. The right answer:
|
|
22
|
+
* - 0 ops: `usage_error` ("no operations").
|
|
23
|
+
* - 1 op, anonymous: omit `operationName` from the wire
|
|
24
|
+
* request so Monday picks the only operation.
|
|
25
|
+
* - 1 op, named: pass that name.
|
|
26
|
+
* - N ops: require explicit `--operation-name <n>` and
|
|
27
|
+
* confirm it matches one of the operation names.
|
|
28
|
+
*
|
|
29
|
+
* The `graphql` reference parser does both jobs by walking the AST
|
|
30
|
+
* — comments, fragment names, string literals can't fool it.
|
|
31
|
+
*
|
|
32
|
+
* Errors thrown are `UsageError`s carrying the error code
|
|
33
|
+
* `usage_error` (cli-design §6.5). The fix landed alongside the
|
|
34
|
+
* `--allow-mutation` and `--operation-name` flags on the `raw`
|
|
35
|
+
* command in M6 close.
|
|
36
|
+
*/
|
|
37
|
+
import { parse, Kind, OperationTypeNode } from 'graphql';
|
|
38
|
+
import { UsageError } from '../utils/errors.js';
|
|
39
|
+
/**
|
|
40
|
+
* Parses the GraphQL document and applies the two raw-command
|
|
41
|
+
* contract gates: mutation rejection (unless allowed) and
|
|
42
|
+
* `operationName` selection.
|
|
43
|
+
*/
|
|
44
|
+
export const analyzeRawDocument = (inputs) => {
|
|
45
|
+
let ast;
|
|
46
|
+
try {
|
|
47
|
+
ast = parse(inputs.query);
|
|
48
|
+
}
|
|
49
|
+
catch (err) {
|
|
50
|
+
throw new UsageError(`monday raw: GraphQL document failed to parse (${err instanceof Error ? err.message : String(err)}).`, {
|
|
51
|
+
cause: err,
|
|
52
|
+
details: { hint: 'check the document for syntax errors' },
|
|
53
|
+
});
|
|
54
|
+
}
|
|
55
|
+
const operations = ast.definitions.filter((d) => d.kind === Kind.OPERATION_DEFINITION);
|
|
56
|
+
if (operations.length === 0) {
|
|
57
|
+
throw new UsageError('monday raw: GraphQL document has no executable operations ' +
|
|
58
|
+
'(found only fragments / type definitions). Pass a document ' +
|
|
59
|
+
'with at least one query or mutation.', {
|
|
60
|
+
details: {
|
|
61
|
+
definition_kinds: ast.definitions.map((d) => d.kind),
|
|
62
|
+
},
|
|
63
|
+
});
|
|
64
|
+
}
|
|
65
|
+
const opSummaries = operations.map((op) => ({
|
|
66
|
+
operation: op.operation,
|
|
67
|
+
name: op.name?.value,
|
|
68
|
+
}));
|
|
69
|
+
const hasMutation = opSummaries.some((o) => o.operation === OperationTypeNode.MUTATION);
|
|
70
|
+
const hasSubscription = opSummaries.some((o) => o.operation === OperationTypeNode.SUBSCRIPTION);
|
|
71
|
+
// Subscriptions never work over Monday's HTTP endpoint and the
|
|
72
|
+
// CLI's transport doesn't speak websockets, so reject them
|
|
73
|
+
// unconditionally — `--allow-mutation` doesn't unlock them.
|
|
74
|
+
if (hasSubscription) {
|
|
75
|
+
throw new UsageError('monday raw: GraphQL `subscription` operations are not supported ' +
|
|
76
|
+
'(the CLI transport is HTTP, not websocket). Rewrite the ' +
|
|
77
|
+
'document as a query.', {
|
|
78
|
+
details: {
|
|
79
|
+
operations: opSummaries,
|
|
80
|
+
},
|
|
81
|
+
});
|
|
82
|
+
}
|
|
83
|
+
if (hasMutation && !inputs.allowMutation) {
|
|
84
|
+
const mutationNames = opSummaries
|
|
85
|
+
.filter((o) => o.operation === OperationTypeNode.MUTATION)
|
|
86
|
+
.map((o) => o.name ?? '<anonymous>');
|
|
87
|
+
throw new UsageError('monday raw: GraphQL `mutation` operations are blocked by default. ' +
|
|
88
|
+
'Pass `--allow-mutation` if you intend to write through the ' +
|
|
89
|
+
'escape hatch (the friendly verbs — `item set`, `item update`, ' +
|
|
90
|
+
'`update create` — are preferred for the v0.1-modelled writes).', {
|
|
91
|
+
details: {
|
|
92
|
+
mutation_operations: mutationNames,
|
|
93
|
+
hint: '--allow-mutation acknowledges the write intent',
|
|
94
|
+
},
|
|
95
|
+
});
|
|
96
|
+
}
|
|
97
|
+
// Operation-name selection. Three cases keyed off operation count.
|
|
98
|
+
if (operations.length === 1) {
|
|
99
|
+
const only = opSummaries[0];
|
|
100
|
+
/* c8 ignore next 5 — defensive: length === 1 means index 0 is
|
|
101
|
+
defined; the branch exists to satisfy noUncheckedIndexedAccess
|
|
102
|
+
without a non-null assertion. */
|
|
103
|
+
if (only === undefined) {
|
|
104
|
+
throw new UsageError('monday raw: internal — operation index 0 missing.');
|
|
105
|
+
}
|
|
106
|
+
if (inputs.explicitOperationName !== undefined &&
|
|
107
|
+
only.name !== undefined &&
|
|
108
|
+
inputs.explicitOperationName !== only.name) {
|
|
109
|
+
throw new UsageError(`monday raw: --operation-name ${JSON.stringify(inputs.explicitOperationName)} doesn't match the document's only operation ` +
|
|
110
|
+
`${JSON.stringify(only.name)}. Drop --operation-name or ` +
|
|
111
|
+
`correct the value.`, {
|
|
112
|
+
details: {
|
|
113
|
+
requested: inputs.explicitOperationName,
|
|
114
|
+
available: [only.name],
|
|
115
|
+
},
|
|
116
|
+
});
|
|
117
|
+
}
|
|
118
|
+
if (inputs.explicitOperationName !== undefined &&
|
|
119
|
+
only.name === undefined) {
|
|
120
|
+
throw new UsageError(`monday raw: --operation-name ${JSON.stringify(inputs.explicitOperationName)} was passed but the document's single operation is ` +
|
|
121
|
+
`anonymous (no name). Either drop --operation-name or name ` +
|
|
122
|
+
`the operation in the document.`, {
|
|
123
|
+
details: {
|
|
124
|
+
requested: inputs.explicitOperationName,
|
|
125
|
+
available: [],
|
|
126
|
+
},
|
|
127
|
+
});
|
|
128
|
+
}
|
|
129
|
+
return {
|
|
130
|
+
operationName: only.name,
|
|
131
|
+
selectedOperationKind: only.operation,
|
|
132
|
+
hasMutation,
|
|
133
|
+
hasSubscription,
|
|
134
|
+
operations: opSummaries,
|
|
135
|
+
};
|
|
136
|
+
}
|
|
137
|
+
// Multi-operation: caller MUST disambiguate.
|
|
138
|
+
const namedOps = opSummaries
|
|
139
|
+
.map((o) => o.name)
|
|
140
|
+
.filter((n) => n !== undefined);
|
|
141
|
+
if (inputs.explicitOperationName === undefined) {
|
|
142
|
+
throw new UsageError(`monday raw: document has ${String(operations.length)} operations ` +
|
|
143
|
+
`(${namedOps.length === 0 ? '<all anonymous>' : namedOps.join(', ')}); ` +
|
|
144
|
+
`pass --operation-name <name> to select one.`, {
|
|
145
|
+
details: {
|
|
146
|
+
operations: opSummaries,
|
|
147
|
+
available: namedOps,
|
|
148
|
+
},
|
|
149
|
+
});
|
|
150
|
+
}
|
|
151
|
+
if (!namedOps.includes(inputs.explicitOperationName)) {
|
|
152
|
+
throw new UsageError(`monday raw: --operation-name ${JSON.stringify(inputs.explicitOperationName)} doesn't match any operation in the document.`, {
|
|
153
|
+
details: {
|
|
154
|
+
requested: inputs.explicitOperationName,
|
|
155
|
+
available: namedOps,
|
|
156
|
+
},
|
|
157
|
+
});
|
|
158
|
+
}
|
|
159
|
+
// Multi-op: pull the selected op's kind out of opSummaries by
|
|
160
|
+
// matching on name (length === namedOps.length when we land here
|
|
161
|
+
// because the inclusion check above passed).
|
|
162
|
+
const selected = opSummaries.find((o) => o.name === inputs.explicitOperationName);
|
|
163
|
+
/* c8 ignore next 5 — defensive: the inclusion check above
|
|
164
|
+
guarantees a match exists. The branch satisfies
|
|
165
|
+
noUncheckedIndexedAccess without a non-null assertion. */
|
|
166
|
+
if (selected === undefined) {
|
|
167
|
+
throw new UsageError('monday raw: internal — selected operation missing.');
|
|
168
|
+
}
|
|
169
|
+
return {
|
|
170
|
+
operationName: inputs.explicitOperationName,
|
|
171
|
+
selectedOperationKind: selected.operation,
|
|
172
|
+
hasMutation,
|
|
173
|
+
hasSubscription,
|
|
174
|
+
operations: opSummaries,
|
|
175
|
+
};
|
|
176
|
+
};
|
|
177
|
+
//# sourceMappingURL=raw-document.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"raw-document.js","sourceRoot":"","sources":["../../src/api/raw-document.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAmCG;AACH,OAAO,EAAE,KAAK,EAAE,IAAI,EAAE,iBAAiB,EAAmD,MAAM,SAAS,CAAC;AAC1G,OAAO,EAAE,UAAU,EAAE,MAAM,oBAAoB,CAAC;AAkDhD;;;;GAIG;AACH,MAAM,CAAC,MAAM,kBAAkB,GAAG,CAChC,MAAgC,EACX,EAAE;IACvB,IAAI,GAAiB,CAAC;IACtB,IAAI,CAAC;QACH,GAAG,GAAG,KAAK,CAAC,MAAM,CAAC,KAAK,CAAC,CAAC;IAC5B,CAAC;IAAC,OAAO,GAAY,EAAE,CAAC;QACtB,MAAM,IAAI,UAAU,CAClB,iDACE,GAAG,YAAY,KAAK,CAAC,CAAC,CAAC,GAAG,CAAC,OAAO,CAAC,CAAC,CAAC,MAAM,CAAC,GAAG,CACjD,IAAI,EACJ;YACE,KAAK,EAAE,GAAG;YACV,OAAO,EAAE,EAAE,IAAI,EAAE,sCAAsC,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C,SAAS,EAAE,QAAQ;aACpB;SACF,CACF,CAAC;IACJ,CAAC;IACD,8DAA8D;IAC9D,iEAAiE;IACjE,6CAA6C;IAC7C,MAAM,QAAQ,GAAG,WAAW,CAAC,IAAI,CAC/B,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,IAAI,KAAK,MAAM,CAAC,qBAAqB,CAC/C,CAAC;IACF;;gEAE4D;IAC5D,IAAI,QAAQ,KAAK,SAAS,EAAE,CAAC;QAC3B,MAAM,IAAI,UAAU,CAAC,oDAAoD,CAAC,CAAC;IAC7E,CAAC;IACD,OAAO;QACL,aAAa,EAAE,MAAM,CAAC,qBAAqB;QAC3C,qBAAqB,EAAE,QAAQ,CAAC,SAAS;QACzC,WAAW;QACX,eAAe;QACf,UAAU,EAAE,WAAW;KACxB,CAAC;AACJ,CAAC,CAAC"}
|
|
@@ -0,0 +1,127 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* `--set-raw <col>=<json>` escape-hatch helpers (`cli-design.md` §5.3
|
|
3
|
+
* escape-hatch contract, `v0.2-plan.md` §3 M8).
|
|
4
|
+
*
|
|
5
|
+
* Two surfaces split across argv-parse vs. post-resolution:
|
|
6
|
+
*
|
|
7
|
+
* - `parseSetRawExpression` — argv-parse-time. Splits `<col>=<json>`
|
|
8
|
+
* on the first `=`, then parses the JSON segment via `JSON.parse`
|
|
9
|
+
* and validates the result is a JsonObject (string / number /
|
|
10
|
+
* array / null at the top level rejected). Malformed JSON or
|
|
11
|
+
* non-object JSON surfaces as `usage_error` with the parse error
|
|
12
|
+
* in `details` per cli-design §5.3 line 949-960. Cheap-fail —
|
|
13
|
+
* no network call fires for an obviously-broken `<json>`.
|
|
14
|
+
*
|
|
15
|
+
* - `translateRawColumnValue` — post-resolution. Takes the resolved
|
|
16
|
+
* column + the pre-parsed JsonObject and runs the two reject
|
|
17
|
+
* lists per cli-design §5.3 escape-hatch contract:
|
|
18
|
+
* * **Read-only-forever** (`mirror` / `formula` / etc.) →
|
|
19
|
+
* `unsupported_column_type` with `read_only: true`. Monday
|
|
20
|
+
* never accepts writes against these regardless of payload,
|
|
21
|
+
* so accepting a raw payload would just shift the failure
|
|
22
|
+
* from CLI-time to Monday-time with no new information.
|
|
23
|
+
* * **`files`-shaped** (`file`, anything else where Monday
|
|
24
|
+
* uses `add_file_to_column` rather than `change_column_value`)
|
|
25
|
+
* → `unsupported_column_type` with `deferred_to: "v0.4"`.
|
|
26
|
+
* The `--set-raw` payload reaches `change_column_value` /
|
|
27
|
+
* `change_multiple_column_values` only; files-shaped types
|
|
28
|
+
* can't be written through that wire surface.
|
|
29
|
+
* Otherwise builds a `TranslatedColumnValue` with `payload:
|
|
30
|
+
* { format: 'rich', value: <parsed> }` so the existing
|
|
31
|
+
* `selectMutation` dispatcher handles it uniformly.
|
|
32
|
+
*
|
|
33
|
+
* **Why the split.** The argv-parse-time JSON validation lets the
|
|
34
|
+
* CLI fail fast on malformed input without a network round-trip; the
|
|
35
|
+
* post-resolution type gate needs the resolved column's `type`,
|
|
36
|
+
* which is only known after `resolveColumnWithRefresh` (the resolver
|
|
37
|
+
* needs board metadata, which comes from the network or cache). The
|
|
38
|
+
* caller threads parsed → resolved → translated; each step has one
|
|
39
|
+
* concern.
|
|
40
|
+
*
|
|
41
|
+
* **No type-shape validation.** Per cli-design §5.3 line 949-960:
|
|
42
|
+
* "the CLI does not validate the parsed object against any per-type
|
|
43
|
+
* schema; Monday's server-side rejection surfaces as
|
|
44
|
+
* `validation_failed` with Monday's message." The whole point of
|
|
45
|
+
* `--set-raw` is to bypass the friendly translator's grammar; the
|
|
46
|
+
* user owns wire-shape correctness. The CLI's contract here is
|
|
47
|
+
* narrower: parse the JSON, gate on the column's category, build
|
|
48
|
+
* a `TranslatedColumnValue`.
|
|
49
|
+
*
|
|
50
|
+
* **Mutual exclusion with `--set` is the caller's concern.** The
|
|
51
|
+
* cli-design §5.3 contract pins resolution-time enforcement (after
|
|
52
|
+
* both flags' tokens resolve to column IDs). This module doesn't see
|
|
53
|
+
* `--set` translations — the command layer collects all translated
|
|
54
|
+
* values and passes them to `selectMutation`, which raises
|
|
55
|
+
* `usage_error` on duplicate column IDs. The escape-hatch contract
|
|
56
|
+
* is upheld by reusing `selectMutation`'s existing duplicate-ID
|
|
57
|
+
* check rather than introducing a separate pre-flight check here.
|
|
58
|
+
*/
|
|
59
|
+
import type { JsonObject } from '../types/json.js';
|
|
60
|
+
import type { TranslatedColumnValue } from './column-values.js';
|
|
61
|
+
export interface ParsedSetRawExpression {
|
|
62
|
+
/** The raw column token agent typed (`status`, `id:status_4`, `External link`). */
|
|
63
|
+
readonly token: string;
|
|
64
|
+
/**
|
|
65
|
+
* The pre-parsed JSON object the agent supplied. Validated as a
|
|
66
|
+
* JsonObject at parse-time per cli-design §5.3 line 949-960 —
|
|
67
|
+
* malformed JSON / non-object JSON rejected with `usage_error`
|
|
68
|
+
* before the call reaches `translateRawColumnValue`.
|
|
69
|
+
*/
|
|
70
|
+
readonly value: JsonObject;
|
|
71
|
+
/** The original `<json>` string — preserved for error contexts only. */
|
|
72
|
+
readonly rawJson: string;
|
|
73
|
+
}
|
|
74
|
+
/**
|
|
75
|
+
* Splits `--set-raw <col>=<json>` on the FIRST `=` per cli-design
|
|
76
|
+
* §5.3 step 2 (matching `--set`'s split rule). Tokens with `=` in
|
|
77
|
+
* the title need shell quoting plus the explicit `id:` / `title:`
|
|
78
|
+
* prefix, same as `--set`.
|
|
79
|
+
*
|
|
80
|
+
* Then parses the `<json>` segment via `JSON.parse` and validates
|
|
81
|
+
* the result is a JsonObject (per cli-design §5.3 line 949-952:
|
|
82
|
+
* "verifies it is a JSON object — malformed JSON or non-object JSON
|
|
83
|
+
* (string / number / array / null at the top level) returns
|
|
84
|
+
* usage_error").
|
|
85
|
+
*
|
|
86
|
+
* **Throws** `UsageError(usage_error)`:
|
|
87
|
+
* - empty token, missing `=`, or empty value;
|
|
88
|
+
* - `JSON.parse` throws SyntaxError;
|
|
89
|
+
* - parsed JSON is not an object (string / number / boolean /
|
|
90
|
+
* null / array at the top level).
|
|
91
|
+
*/
|
|
92
|
+
export declare const parseSetRawExpression: (raw: string) => ParsedSetRawExpression;
|
|
93
|
+
/**
|
|
94
|
+
* Builds a `TranslatedColumnValue` for an already-resolved column +
|
|
95
|
+
* a pre-parsed JsonObject payload. Runs the two reject lists per
|
|
96
|
+
* cli-design §5.3 escape-hatch contract before constructing the
|
|
97
|
+
* translated value:
|
|
98
|
+
*
|
|
99
|
+
* - **Read-only-forever** → `unsupported_column_type` with
|
|
100
|
+
* `read_only: true`. Monday computes these server-side; no
|
|
101
|
+
* payload (raw or friendly) is ever accepted.
|
|
102
|
+
* - **`files`-shaped** → `unsupported_column_type` with
|
|
103
|
+
* `deferred_to: "v0.4"`. Monday writes via `add_file_to_column`
|
|
104
|
+
* (multipart upload), not `change_column_value`; the raw
|
|
105
|
+
* payload can't reach the right wire surface.
|
|
106
|
+
*
|
|
107
|
+
* Anything else (writable + tentative-slipped + future where the API
|
|
108
|
+
* accepts `change_column_value`) is accepted — the user took the
|
|
109
|
+
* escape hatch and owns wire-shape correctness; Monday's server-side
|
|
110
|
+
* rejection surfaces as `validation_failed` with Monday's message.
|
|
111
|
+
*
|
|
112
|
+
* **`columnType` slot.** The translated value carries the resolved
|
|
113
|
+
* column's actual type string (`column.type`) cast through the
|
|
114
|
+
* `WritableColumnType` union via `as`. The cast is structural —
|
|
115
|
+
* `--set-raw` accepts types outside `WRITABLE_COLUMN_TYPES`, so the
|
|
116
|
+
* runtime value may be any non-rejected type string. Downstream
|
|
117
|
+
* consumers (`selectMutation`, the dry-run engine) use `columnType`
|
|
118
|
+
* for the `long_text` re-wrap branch only; that branch doesn't fire
|
|
119
|
+
* for raw payloads (`payload.format` is always `'rich'`), so the
|
|
120
|
+
* cast is safe by construction.
|
|
121
|
+
*/
|
|
122
|
+
export declare const translateRawColumnValue: (column: {
|
|
123
|
+
readonly id: string;
|
|
124
|
+
readonly type: string;
|
|
125
|
+
}, value: JsonObject, rawJson: string) => TranslatedColumnValue;
|
|
126
|
+
export type { JsonObject } from '../types/json.js';
|
|
127
|
+
//# sourceMappingURL=raw-write.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"raw-write.d.ts","sourceRoot":"","sources":["../../src/api/raw-write.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAyDG;AAOH,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,kBAAkB,CAAC;AACnD,OAAO,KAAK,EAAE,qBAAqB,EAAE,MAAM,oBAAoB,CAAC;AAEhE,MAAM,WAAW,sBAAsB;IACrC,mFAAmF;IACnF,QAAQ,CAAC,KAAK,EAAE,MAAM,CAAC;IACvB;;;;;OAKG;IACH,QAAQ,CAAC,KAAK,EAAE,UAAU,CAAC;IAC3B,wEAAwE;IACxE,QAAQ,CAAC,OAAO,EAAE,MAAM,CAAC;CAC1B;AAED;;;;;;;;;;;;;;;;;GAiBG;AACH,eAAO,MAAM,qBAAqB,GAAI,KAAK,MAAM,KAAG,sBA8DnD,CAAC;AAEF;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA4BG;AACH,eAAO,MAAM,uBAAuB,GAClC,QAAQ;IAAE,QAAQ,CAAC,EAAE,EAAE,MAAM,CAAC;IAAC,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAA;CAAE,EACtD,OAAO,UAAU,EACjB,SAAS,MAAM,KACd,qBA+DF,CAAC;AAsBF,YAAY,EAAE,UAAU,EAAE,MAAM,kBAAkB,CAAC"}
|