@columnus/sdk 0.0.0-stage → 0.3.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/dist/blocknote-editor-547WFBXP.js +7 -0
- package/dist/blocknote-editor-547WFBXP.js.map +1 -0
- package/dist/blocknote-editor-YZEFMXLC.css +47 -0
- package/dist/blocknote-editor-YZEFMXLC.css.map +1 -0
- package/dist/blocknote-preview-6WRENQZD.css +47 -0
- package/dist/blocknote-preview-6WRENQZD.css.map +1 -0
- package/dist/blocknote-preview-CTMNUSYX.js +7 -0
- package/dist/blocknote-preview-CTMNUSYX.js.map +1 -0
- package/dist/chunk-5IPH2A64.js +23337 -0
- package/dist/chunk-5IPH2A64.js.map +1 -0
- package/dist/chunk-BQCD5MEV.js +225 -0
- package/dist/chunk-BQCD5MEV.js.map +1 -0
- package/dist/chunk-BXTTCBIK.js +11 -0
- package/dist/chunk-BXTTCBIK.js.map +1 -0
- package/dist/chunk-ICKWVUW7.js +134 -0
- package/dist/chunk-ICKWVUW7.js.map +1 -0
- package/dist/chunk-IMYSQX2X.js +58 -0
- package/dist/chunk-IMYSQX2X.js.map +1 -0
- package/dist/chunk-JYSABU33.js +494 -0
- package/dist/chunk-JYSABU33.js.map +1 -0
- package/dist/chunk-PX6F3LHL.js +37 -0
- package/dist/chunk-PX6F3LHL.js.map +1 -0
- package/dist/chunk-QPQRNIKG.js +142 -0
- package/dist/chunk-QPQRNIKG.js.map +1 -0
- package/dist/chunk-SKE2RDD2.js +4217 -0
- package/dist/chunk-SKE2RDD2.js.map +1 -0
- package/dist/chunk-XWMTXQF3.js +18727 -0
- package/dist/chunk-XWMTXQF3.js.map +1 -0
- package/dist/chunk-ZTWPGA37.js +68 -0
- package/dist/chunk-ZTWPGA37.js.map +1 -0
- package/dist/cms/builder/diff-view.js +70 -0
- package/dist/cms/builder/diff-view.js.map +1 -0
- package/dist/cms/builder/panel.js +1316 -0
- package/dist/cms/builder/panel.js.map +1 -0
- package/dist/cms/convex/index.css +47 -0
- package/dist/cms/convex/index.css.map +1 -0
- package/dist/cms/convex/index.js +370 -0
- package/dist/cms/convex/index.js.map +1 -0
- package/dist/cms/index.css +47 -0
- package/dist/cms/index.css.map +1 -0
- package/dist/cms/index.js +9 -0
- package/dist/cms/index.js.map +1 -0
- package/dist/cms/server/index.js +5 -0
- package/dist/cms/server/index.js.map +1 -0
- package/dist/cms/tables/tables-dialog.css +47 -0
- package/dist/cms/tables/tables-dialog.css.map +1 -0
- package/dist/cms/tables/tables-dialog.js +590 -0
- package/dist/cms/tables/tables-dialog.js.map +1 -0
- package/dist/cms/tailwind.css +4 -0
- package/dist/editor-543ARQ6S.js +427 -0
- package/dist/editor-543ARQ6S.js.map +1 -0
- package/dist/editor-54UG7BSP.css +47 -0
- package/dist/editor-54UG7BSP.css.map +1 -0
- package/dist/mcp-cli.js +61218 -0
- package/dist/primitives.css +143 -0
- package/dist/rich-text-editor/blocknote-preview-studio.css +54 -0
- package/dist/richtext.css +4 -0
- package/dist/types/cms/src/adapters/default-richtext.d.ts +24 -0
- package/dist/types/cms/src/adapters/projected-fields-adapter.d.ts +22 -0
- package/dist/types/cms/src/adapters/table-rows-context.d.ts +4 -0
- package/dist/types/cms/src/adapters/table-rows-richtext.d.ts +8 -0
- package/dist/types/cms/src/builder/annotate.d.ts +13 -0
- package/dist/types/cms/src/builder/diff-view.d.ts +10 -0
- package/dist/types/cms/src/builder/inspect.d.ts +32 -0
- package/dist/types/cms/src/builder/panel.d.ts +11 -0
- package/dist/types/cms/src/builder/sessions-menu.d.ts +37 -0
- package/dist/types/cms/src/builder/sidecar-json.d.ts +2 -0
- package/dist/types/cms/src/cache/html-cache.d.ts +12 -0
- package/dist/types/cms/src/chrome/changes-view.d.ts +15 -0
- package/dist/types/cms/src/chrome/confirm-panel.d.ts +10 -0
- package/dist/types/cms/src/chrome/floating-toolbar.d.ts +25 -0
- package/dist/types/cms/src/chrome/icons.d.ts +13 -0
- package/dist/types/cms/src/chrome/overlay-styles.d.ts +38 -0
- package/dist/types/cms/src/chrome/resolve-dialog.d.ts +26 -0
- package/dist/types/cms/src/chrome/session-storage.d.ts +3 -0
- package/dist/types/cms/src/convex/cms-convex-proposals.d.ts +19 -0
- package/dist/types/cms/src/convex/cms-convex-shell.d.ts +8 -0
- package/dist/types/cms/src/convex/cms-host-refs.d.ts +15 -0
- package/dist/types/cms/src/convex/index.d.ts +7 -0
- package/dist/types/cms/src/convex/proposal-refs.d.ts +20 -0
- package/dist/types/cms/src/convex/use-cms-display-fields-adapter.d.ts +17 -0
- package/dist/types/cms/src/convex/use-cms-display-values.d.ts +12 -0
- package/dist/types/cms/src/convex/use-cms-editor-auth.d.ts +12 -0
- package/dist/types/cms/src/convex/use-cms-storage-display.d.ts +19 -0
- package/dist/types/cms/src/convex/use-cms-storage-fields-adapter.d.ts +63 -0
- package/dist/types/cms/src/convex/use-fields-adapter-host.d.ts +4 -0
- package/dist/types/cms/src/create/compound-create.d.ts +56 -0
- package/dist/types/cms/src/draft/merge-draft.d.ts +31 -0
- package/dist/types/cms/src/edit/cms-compound-create.d.ts +12 -0
- package/dist/types/cms/src/edit/cms-create-button.d.ts +9 -0
- package/dist/types/cms/src/edit/edit-surface.d.ts +16 -0
- package/dist/types/cms/src/edit/field-editor-dialog.d.ts +22 -0
- package/dist/types/cms/src/edit/inplace-field-editor.d.ts +21 -0
- package/dist/types/cms/src/edit/inplace-switch-modal.d.ts +5 -0
- package/dist/types/cms/src/edit/insert-row-dialog.d.ts +20 -0
- package/dist/types/cms/src/index.d.ts +35 -0
- package/dist/types/cms/src/list/build-insert-draft.d.ts +13 -0
- package/dist/types/cms/src/manifest-index.d.ts +5 -0
- package/dist/types/cms/src/nav/content-ref-integrity.d.ts +18 -0
- package/dist/types/cms/src/nav/content-ref.d.ts +6 -0
- package/dist/types/cms/src/nav/infer-navigation-table.d.ts +20 -0
- package/dist/types/cms/src/nav/slugify-de.d.ts +4 -0
- package/dist/types/cms/src/pages/login-page.d.ts +5 -0
- package/dist/types/cms/src/profile/propose-gates.d.ts +12 -0
- package/dist/types/cms/src/profile/readable-tables.d.ts +13 -0
- package/dist/types/cms/src/projection/cms-projection.d.ts +63 -0
- package/dist/types/cms/src/proposals/types.d.ts +59 -0
- package/dist/types/cms/src/provider/builder-draft.d.ts +14 -0
- package/dist/types/cms/src/provider/cms-provider.d.ts +240 -0
- package/dist/types/cms/src/rich-doc/cms-rich-doc-view.d.ts +4 -0
- package/dist/types/cms/src/server/cookie.d.ts +11 -0
- package/dist/types/cms/src/server/index.d.ts +2 -0
- package/dist/types/cms/src/server/session.d.ts +53 -0
- package/dist/types/cms/src/stamps/attrs.d.ts +17 -0
- package/dist/types/cms/src/stamps/related.d.ts +11 -0
- package/dist/types/cms/src/stamps/resolve-display.d.ts +41 -0
- package/dist/types/cms/src/stamps/row.d.ts +41 -0
- package/dist/types/cms/src/stamps/stamp-media-drop.d.ts +23 -0
- package/dist/types/cms/src/stamps/stamp.d.ts +44 -0
- package/dist/types/cms/src/stamps/storage-display.d.ts +4 -0
- package/dist/types/cms/src/stamps/use-cms-projected-field.d.ts +6 -0
- package/dist/types/cms/src/stamps/use-cms-projected-table.d.ts +7 -0
- package/dist/types/cms/src/stamps/use-cms-related-row.d.ts +2 -0
- package/dist/types/cms/src/tables/tables-dialog.d.ts +6 -0
- package/dist/types/cms/src/tables/use-cms-grid.d.ts +78 -0
- package/dist/types/cms/src/tables/use-draft-commands.d.ts +35 -0
- package/dist/types/data-grid/src/components/balanced-preview-columns.d.ts +7 -0
- package/dist/types/data-grid/src/components/cell-formula-bar.d.ts +40 -0
- package/dist/types/data-grid/src/components/cell-renderer.d.ts +10 -0
- package/dist/types/data-grid/src/components/cell-selection.d.ts +72 -0
- package/dist/types/data-grid/src/components/column-filter-popover.d.ts +29 -0
- package/dist/types/data-grid/src/components/context-menu-selection.d.ts +24 -0
- package/dist/types/data-grid/src/components/data-grid-table.d.ts +49 -0
- package/dist/types/data-grid/src/components/delete-confirm-copy.d.ts +6 -0
- package/dist/types/data-grid/src/components/display-search-scope-notice.d.ts +4 -0
- package/dist/types/data-grid/src/components/draft-rows.d.ts +14 -0
- package/dist/types/data-grid/src/components/field-condition-editor.d.ts +71 -0
- package/dist/types/data-grid/src/components/fill-handle.d.ts +22 -0
- package/dist/types/data-grid/src/components/grid-action-bar.d.ts +8 -0
- package/dist/types/data-grid/src/components/grid-body-layout.d.ts +27 -0
- package/dist/types/data-grid/src/components/grid-body-row.d.ts +83 -0
- package/dist/types/data-grid/src/components/grid-editing.d.ts +158 -0
- package/dist/types/data-grid/src/components/grid-event-utils.d.ts +10 -0
- package/dist/types/data-grid/src/components/grid-filter-search-chips.d.ts +7 -0
- package/dist/types/data-grid/src/components/grid-filter-search-context.d.ts +135 -0
- package/dist/types/data-grid/src/components/grid-filter-search.d.ts +6 -0
- package/dist/types/data-grid/src/components/grid-row-menu.d.ts +23 -0
- package/dist/types/data-grid/src/components/grid-seam-island.d.ts +23 -0
- package/dist/types/data-grid/src/components/grid-sort-group.d.ts +25 -0
- package/dist/types/data-grid/src/components/grid-toolbar.d.ts +54 -0
- package/dist/types/data-grid/src/components/index-suggestion-banner.d.ts +11 -0
- package/dist/types/data-grid/src/components/inline-edit-draft.d.ts +18 -0
- package/dist/types/data-grid/src/components/keyboard-shortcuts-overlay.d.ts +7 -0
- package/dist/types/data-grid/src/components/measure-column-auto-width.d.ts +6 -0
- package/dist/types/data-grid/src/components/pending-edits.d.ts +25 -0
- package/dist/types/data-grid/src/components/perform-grid-row-delete.d.ts +27 -0
- package/dist/types/data-grid/src/components/query-plan-banner.d.ts +13 -0
- package/dist/types/data-grid/src/components/query-predicate-builder.d.ts +53 -0
- package/dist/types/data-grid/src/components/row-detail-dialog.d.ts +17 -0
- package/dist/types/data-grid/src/components/row-preview-content.d.ts +21 -0
- package/dist/types/data-grid/src/components/row-preview-drawer.d.ts +24 -0
- package/dist/types/data-grid/src/components/selection-value-chips.d.ts +12 -0
- package/dist/types/data-grid/src/components/selection.d.ts +46 -0
- package/dist/types/data-grid/src/components/table-cell-overlays.d.ts +33 -0
- package/dist/types/data-grid/src/components/table-color-marker.d.ts +10 -0
- package/dist/types/data-grid/src/components/use-column-visibility.d.ts +5 -0
- package/dist/types/data-grid/src/components/use-column-widths.d.ts +6 -0
- package/dist/types/data-grid/src/components/use-undo-redo.d.ts +46 -0
- package/dist/types/data-grid/src/hooks/plan-pending-edits.d.ts +41 -0
- package/dist/types/data-grid/src/hooks/use-grid-interactions.d.ts +100 -0
- package/dist/types/data-grid/src/hooks/use-grid-pending-state.d.ts +41 -0
- package/dist/types/data-grid/src/hooks/use-grid-selection-model.d.ts +28 -0
- package/dist/types/data-grid/src/hooks/use-grid-table-layout.d.ts +39 -0
- package/dist/types/data-grid/src/hooks/use-true-after-delay.d.ts +10 -0
- package/dist/types/data-grid/src/index.d.ts +47 -0
- package/dist/types/data-grid/src/lib/column-filter.d.ts +43 -0
- package/dist/types/data-grid/src/lib/display-search-scope.d.ts +2 -0
- package/dist/types/data-grid/src/lib/format-query-chips.d.ts +28 -0
- package/dist/types/data-grid/src/lib/grid-items.d.ts +63 -0
- package/dist/types/data-grid/src/lib/persistent-state.d.ts +6 -0
- package/dist/types/data-grid/src/lib/query-editor-draft.d.ts +15 -0
- package/dist/types/data-grid/src/lib/use-row-preview-collapsed.d.ts +9 -0
- package/dist/types/data-grid/src/lib/use-row-preview-title.d.ts +1 -0
- package/dist/types/fields/src/components/batch-edit-sheet.d.ts +10 -0
- package/dist/types/fields/src/components/cell-editor.d.ts +29 -0
- package/dist/types/fields/src/components/date-time-input.d.ts +21 -0
- package/dist/types/fields/src/components/date-time-picker-logic.d.ts +13 -0
- package/dist/types/fields/src/components/field-input-chrome.d.ts +11 -0
- package/dist/types/fields/src/components/field-input-inline.d.ts +30 -0
- package/dist/types/fields/src/components/field-input.d.ts +36 -0
- package/dist/types/fields/src/components/field-value-view.d.ts +10 -0
- package/dist/types/fields/src/components/file-array-cell.d.ts +5 -0
- package/dist/types/fields/src/components/file-array-upload-dialog.d.ts +19 -0
- package/dist/types/fields/src/components/file-cell.d.ts +5 -0
- package/dist/types/fields/src/components/file-input.d.ts +21 -0
- package/dist/types/fields/src/components/file-upload-dialog.d.ts +19 -0
- package/dist/types/fields/src/components/focus-text-input.d.ts +5 -0
- package/dist/types/fields/src/components/id-array-cell.d.ts +9 -0
- package/dist/types/fields/src/components/id-array-values.d.ts +1 -0
- package/dist/types/fields/src/components/id-cell.d.ts +4 -0
- package/dist/types/fields/src/components/id-picker.d.ts +28 -0
- package/dist/types/fields/src/components/image-array-cell.d.ts +7 -0
- package/dist/types/fields/src/components/image-cell.d.ts +7 -0
- package/dist/types/fields/src/components/image-preview-dialog.d.ts +8 -0
- package/dist/types/fields/src/components/media-compact-preview.d.ts +17 -0
- package/dist/types/fields/src/components/media-library-picker-dialog.d.ts +16 -0
- package/dist/types/fields/src/components/multi-id-picker.d.ts +24 -0
- package/dist/types/fields/src/components/picker-chrome.d.ts +28 -0
- package/dist/types/fields/src/components/picker-density.d.ts +5 -0
- package/dist/types/fields/src/components/picker-list-placeholder.d.ts +13 -0
- package/dist/types/fields/src/components/picker-menu-keyboard.d.ts +16 -0
- package/dist/types/fields/src/components/picker-menu-layout.d.ts +12 -0
- package/dist/types/fields/src/components/picker-menu-portal.d.ts +19 -0
- package/dist/types/fields/src/components/picker-option-row.d.ts +10 -0
- package/dist/types/fields/src/components/picker-overlay.d.ts +35 -0
- package/dist/types/fields/src/components/record-link-chip.d.ts +21 -0
- package/dist/types/fields/src/components/row-edit-panel.d.ts +36 -0
- package/dist/types/fields/src/components/row-editor.d.ts +19 -0
- package/dist/types/fields/src/components/row-popover.d.ts +11 -0
- package/dist/types/fields/src/components/use-flush-ref.d.ts +3 -0
- package/dist/types/fields/src/components/use-picker-combobox.d.ts +86 -0
- package/dist/types/fields/src/components/use-picker-highlight-scroll.d.ts +4 -0
- package/dist/types/fields/src/components/use-picker-menu-overlay.d.ts +7 -0
- package/dist/types/fields/src/fields-data-adapter.d.ts +111 -0
- package/dist/types/fields/src/fields-data-provider.d.ts +45 -0
- package/dist/types/fields/src/hooks/use-debounced-value.d.ts +1 -0
- package/dist/types/fields/src/hooks/use-row-edit-shortcuts.d.ts +15 -0
- package/dist/types/fields/src/index.d.ts +38 -0
- package/dist/types/fields/src/lib/is-row-doc-dirty.d.ts +2 -0
- package/dist/types/fields/src/lib/scroll-to-form-field.d.ts +6 -0
- package/dist/types/fields/src/media-library-query.d.ts +34 -0
- package/dist/types/fields/src/media-upload-limits.d.ts +18 -0
- package/dist/types/fields/src/record-actions-context.d.ts +17 -0
- package/dist/types/fields/src/storage-upload.d.ts +21 -0
- package/dist/types/primitives/src/components/ui/accordion.d.ts +6 -0
- package/dist/types/primitives/src/components/ui/alert-dialog.d.ts +12 -0
- package/dist/types/primitives/src/components/ui/badge.d.ts +9 -0
- package/dist/types/primitives/src/components/ui/button.d.ts +11 -0
- package/dist/types/primitives/src/components/ui/calendar.d.ts +8 -0
- package/dist/types/primitives/src/components/ui/card.d.ts +7 -0
- package/dist/types/primitives/src/components/ui/checkbox.d.ts +3 -0
- package/dist/types/primitives/src/components/ui/dialog.d.ts +15 -0
- package/dist/types/primitives/src/components/ui/dropdown-menu.d.ts +10 -0
- package/dist/types/primitives/src/components/ui/info-hint.d.ts +37 -0
- package/dist/types/primitives/src/components/ui/input.d.ts +2 -0
- package/dist/types/primitives/src/components/ui/label.d.ts +3 -0
- package/dist/types/primitives/src/components/ui/popover.d.ts +6 -0
- package/dist/types/primitives/src/components/ui/save-bar.d.ts +43 -0
- package/dist/types/primitives/src/components/ui/select.d.ts +8 -0
- package/dist/types/primitives/src/components/ui/separator.d.ts +3 -0
- package/dist/types/primitives/src/components/ui/sheet.d.ts +18 -0
- package/dist/types/primitives/src/components/ui/sonner.d.ts +1 -0
- package/dist/types/primitives/src/components/ui/switch.d.ts +3 -0
- package/dist/types/primitives/src/components/ui/table.d.ts +7 -0
- package/dist/types/primitives/src/components/ui/tabs.d.ts +6 -0
- package/dist/types/primitives/src/components/ui/tooltip.d.ts +6 -0
- package/dist/types/primitives/src/index.d.ts +28 -0
- package/dist/types/primitives/src/lib/animation-frame-batcher.d.ts +11 -0
- package/dist/types/primitives/src/lib/locale-week-start.d.ts +5 -0
- package/dist/types/primitives/src/lib/save-bar-logic.d.ts +52 -0
- package/dist/types/primitives/src/lib/use-raf-batched-pointer-drag.d.ts +31 -0
- package/dist/types/primitives/src/lib/use-save-bar.d.ts +36 -0
- package/dist/types/primitives/src/lib/use-unsaved-changes-guard.d.ts +15 -0
- package/dist/types/primitives/src/lib/utils.d.ts +6 -0
- package/dist/types/richtext/src/editor.d.ts +16 -0
- package/dist/types/richtext/src/host-adapter.d.ts +66 -0
- package/dist/types/richtext/src/index.d.ts +11 -0
- package/dist/types/richtext/src/markdown-editor/editor-styles.d.ts +7 -0
- package/dist/types/richtext/src/markdown-editor/markdown-editor-dialog.d.ts +16 -0
- package/dist/types/richtext/src/markdown-editor/markdown-editor.d.ts +2 -0
- package/dist/types/richtext/src/markdown-editor/markdown-field-input.d.ts +11 -0
- package/dist/types/richtext/src/markdown-editor/markdown-field-trigger.d.ts +8 -0
- package/dist/types/richtext/src/markdown-editor/markdown-insert-pickers-session.d.ts +5 -0
- package/dist/types/richtext/src/markdown-editor/markdown-insert-pickers.d.ts +9 -0
- package/dist/types/richtext/src/markdown-editor/markdown-preview.d.ts +7 -0
- package/dist/types/richtext/src/markdown-editor/markdown-rich-preview.d.ts +5 -0
- package/dist/types/richtext/src/markdown-editor/record-link-picker-session.d.ts +7 -0
- package/dist/types/richtext/src/markdown-editor/record-link-picker.d.ts +9 -0
- package/dist/types/richtext/src/markdown-editor/record-table-picker.d.ts +21 -0
- package/dist/types/richtext/src/markdown-editor/use-markdown-insert-pickers.d.ts +33 -0
- package/dist/types/richtext/src/record-table-view.d.ts +17 -0
- package/dist/types/richtext/src/rich-doc-view.d.ts +30 -0
- package/dist/types/richtext/src/rich-text-editor/blocknote-editor.d.ts +25 -0
- package/dist/types/richtext/src/rich-text-editor/blocknote-portaled-dropdown.d.ts +2 -0
- package/dist/types/richtext/src/rich-text-editor/blocknote-preview.d.ts +12 -0
- package/dist/types/richtext/src/rich-text-editor/record-link-inline.d.ts +15 -0
- package/dist/types/richtext/src/rich-text-editor/record-link-rows-context.d.ts +9 -0
- package/dist/types/richtext/src/rich-text-editor/record-table-block.d.ts +18 -0
- package/dist/types/richtext/src/rich-text-editor/studio-schema.d.ts +283 -0
- package/dist/types/richtext/src/rich-text-editor/studio-slash-menu.d.ts +8 -0
- package/dist/types/richtext/src/rich-text-editor/use-sync-blocknote-value.d.ts +2 -0
- package/dist/types/shared/src/apiProfile.d.ts +164 -0
- package/dist/types/shared/src/apiProfileDiscovery.d.ts +88 -0
- package/dist/types/shared/src/apiProfileSlug.d.ts +11 -0
- package/dist/types/shared/src/apiProfileSources.d.ts +112 -0
- package/dist/types/shared/src/apiProfileValidators.d.ts +310 -0
- package/dist/types/shared/src/apiToken.d.ts +6 -0
- package/dist/types/shared/src/assetFamily.d.ts +38 -0
- package/dist/types/shared/src/assetFieldValues.d.ts +21 -0
- package/dist/types/shared/src/assetGraph.d.ts +221 -0
- package/dist/types/shared/src/assetJobs.d.ts +99 -0
- package/dist/types/shared/src/assetSettings.d.ts +147 -0
- package/dist/types/shared/src/auditRedact.d.ts +36 -0
- package/dist/types/shared/src/betterAuthSession.d.ts +12 -0
- package/dist/types/shared/src/bffHost.d.ts +36 -0
- package/dist/types/shared/src/bffProtocol.d.ts +563 -0
- package/dist/types/shared/src/bffRedact.d.ts +30 -0
- package/dist/types/shared/src/ciPreviewEnv.d.ts +21 -0
- package/dist/types/shared/src/clipboardTransfer.d.ts +25 -0
- package/dist/types/shared/src/convexFacade.d.ts +44 -0
- package/dist/types/shared/src/convexSiteUrl.d.ts +73 -0
- package/dist/types/shared/src/csv.d.ts +65 -0
- package/dist/types/shared/src/dataTransfer.d.ts +21 -0
- package/dist/types/shared/src/dateValues.d.ts +21 -0
- package/dist/types/shared/src/deployOutput.d.ts +3 -0
- package/dist/types/shared/src/displayLabel.d.ts +17 -0
- package/dist/types/shared/src/displayTemplateGenerator.d.ts +11 -0
- package/dist/types/shared/src/displayTypes.d.ts +10 -0
- package/dist/types/shared/src/erdLayout.d.ts +27 -0
- package/dist/types/shared/src/facets.d.ts +109 -0
- package/dist/types/shared/src/failureMessage.d.ts +5 -0
- package/dist/types/shared/src/fieldTypeMeta.d.ts +110 -0
- package/dist/types/shared/src/fieldTypeText.d.ts +34 -0
- package/dist/types/shared/src/fieldValueEqual.d.ts +10 -0
- package/dist/types/shared/src/fieldValueShape.d.ts +24 -0
- package/dist/types/shared/src/fieldValueText.d.ts +32 -0
- package/dist/types/shared/src/gridQuery.d.ts +103 -0
- package/dist/types/shared/src/importMatch.d.ts +80 -0
- package/dist/types/shared/src/index.d.ts +78 -0
- package/dist/types/shared/src/inferIdentifier.d.ts +18 -0
- package/dist/types/shared/src/keyboard.d.ts +16 -0
- package/dist/types/shared/src/manifestDeploy.d.ts +31 -0
- package/dist/types/shared/src/manifestHash.d.ts +12 -0
- package/dist/types/shared/src/mcpOAuth.d.ts +182 -0
- package/dist/types/shared/src/postLoginPath.d.ts +21 -0
- package/dist/types/shared/src/previewDeployName.d.ts +27 -0
- package/dist/types/shared/src/proposalDraftMerge.d.ts +35 -0
- package/dist/types/shared/src/proposePolicy.d.ts +17 -0
- package/dist/types/shared/src/proposeRateLimit.d.ts +27 -0
- package/dist/types/shared/src/queryBetween.d.ts +21 -0
- package/dist/types/shared/src/queryConditions.d.ts +46 -0
- package/dist/types/shared/src/queryExecution.d.ts +12 -0
- package/dist/types/shared/src/queryFieldOps.d.ts +123 -0
- package/dist/types/shared/src/queryMerge.d.ts +30 -0
- package/dist/types/shared/src/queryPlan.d.ts +86 -0
- package/dist/types/shared/src/queryStudio.d.ts +28 -0
- package/dist/types/shared/src/queryTypes.d.ts +184 -0
- package/dist/types/shared/src/queryValidators.d.ts +233 -0
- package/dist/types/shared/src/readApiQuery.d.ts +10 -0
- package/dist/types/shared/src/readModelLimits.d.ts +23 -0
- package/dist/types/shared/src/recordTableColumns.d.ts +24 -0
- package/dist/types/shared/src/recordTablePreload.d.ts +19 -0
- package/dist/types/shared/src/refDisplayRequests.d.ts +17 -0
- package/dist/types/shared/src/refGraph.d.ts +97 -0
- package/dist/types/shared/src/refsRecompute.d.ts +16 -0
- package/dist/types/shared/src/richDoc.d.ts +80 -0
- package/dist/types/shared/src/rowPatchWire.d.ts +12 -0
- package/dist/types/shared/src/rowTrash.d.ts +26 -0
- package/dist/types/shared/src/savedView.d.ts +37 -0
- package/dist/types/shared/src/schemaGenerator.d.ts +36 -0
- package/dist/types/shared/src/schemaShrink.d.ts +82 -0
- package/dist/types/shared/src/schemaShrinkValidators.d.ts +72 -0
- package/dist/types/shared/src/schemaTypes.d.ts +311 -0
- package/dist/types/shared/src/share.d.ts +8 -0
- package/dist/types/shared/src/shareApiBridge.d.ts +13 -0
- package/dist/types/shared/src/shareGuestPolicy.d.ts +14 -0
- package/dist/types/shared/src/shareProposal.d.ts +141 -0
- package/dist/types/shared/src/shareProposalDiff.d.ts +13 -0
- package/dist/types/shared/src/shareScopes.d.ts +19 -0
- package/dist/types/shared/src/shareTokenCrypto.d.ts +9 -0
- package/dist/types/shared/src/shareTokens.d.ts +6 -0
- package/dist/types/shared/src/shareTypes.d.ts +113 -0
- package/dist/types/shared/src/shareWizard.d.ts +23 -0
- package/dist/types/shared/src/spaceBundle.d.ts +89 -0
- package/dist/types/shared/src/stagedApiAccess.d.ts +104 -0
- package/dist/types/shared/src/studioBoot.d.ts +63 -0
- package/dist/types/shared/src/syncChannel.d.ts +25 -0
- package/dist/types/shared/src/syncClampMembership.d.ts +22 -0
- package/dist/types/shared/src/tableSearch.d.ts +52 -0
- package/dist/types/shared/src/tenantHosts.d.ts +34 -0
- package/dist/types/shared/src/tenantSecretsCrypto.d.ts +31 -0
- package/dist/types/shared/src/useDebouncedCommit.d.ts +15 -0
- package/dist/types/shared/src/useDebouncedValue.d.ts +1 -0
- package/dist/types/shared/src/useModifierHeld.d.ts +2 -0
- package/package.json +85 -3
- package/README.md +0 -3
|
@@ -0,0 +1,563 @@
|
|
|
1
|
+
import { z } from "zod";
|
|
2
|
+
import { MAX_TRANSFER_BYTES } from "./dataTransfer.ts";
|
|
3
|
+
import type { FacetSpec } from "./facets.ts";
|
|
4
|
+
import type { GridQuery } from "./gridQuery.ts";
|
|
5
|
+
import type { RowScope } from "./rowTrash.ts";
|
|
6
|
+
/** Versioned BFF ↔ Management ↔ deploy-service contract (D32). */
|
|
7
|
+
export declare const COLUMNUS_BFF_PROTOCOL_VERSION: 1;
|
|
8
|
+
export declare const COLUMNUS_BFF_API_PREFIX: "/api/columnus/v1";
|
|
9
|
+
/** The Studio grid's read-model endpoints (plan 098). */
|
|
10
|
+
export declare const READ_MODEL_API_PREFIX: "/api/columnus/v1/read-model";
|
|
11
|
+
/** The body of a read-model `rows`, `groups` or `count` call; the BFF parses `query` itself. */
|
|
12
|
+
export type ReadModelRequest<Q = GridQuery> = {
|
|
13
|
+
query?: Q;
|
|
14
|
+
/** Live rows (default) or trashed rows, as `rowScopeQuery` defines them. */
|
|
15
|
+
scope?: RowScope;
|
|
16
|
+
/** The search box: words over the row's searched text (plan 106). */
|
|
17
|
+
q?: string;
|
|
18
|
+
/** Hybrid search: `q`'s words and its embedding, at most 200 hits (plan 106 D16). */
|
|
19
|
+
meaning?: boolean;
|
|
20
|
+
/** Group keys from the top level down; restricts rows to that group. */
|
|
21
|
+
path?: readonly unknown[];
|
|
22
|
+
/** IANA timezone date buckets start in. */
|
|
23
|
+
tz?: string;
|
|
24
|
+
};
|
|
25
|
+
/**
|
|
26
|
+
* A table's Meaning search in `/status` (plan 106 D21): `unconfigured` without an embedder in the
|
|
27
|
+
* BFF, `unavailable` without vectors under its model (no `vector` extension, or none in the sync
|
|
28
|
+
* worker), `embedding` while `pending` rows wait for the table's first fill, else `ready` (rows
|
|
29
|
+
* queued since are found by their words until embedded).
|
|
30
|
+
*/
|
|
31
|
+
export type ReadModelMeaning = {
|
|
32
|
+
state: "ready" | "embedding" | "unconfigured" | "unavailable";
|
|
33
|
+
pending: number;
|
|
34
|
+
};
|
|
35
|
+
/** One group of a read-model `groups` page, with its exact count. */
|
|
36
|
+
export type ReadModelGroup = {
|
|
37
|
+
key: unknown;
|
|
38
|
+
label: string | null;
|
|
39
|
+
count: number;
|
|
40
|
+
};
|
|
41
|
+
/**
|
|
42
|
+
* The body of a read-model `facets` call (plan 101): each facet counts under the query without
|
|
43
|
+
* its own selection. `search` keeps values whose label contains it, prefix matches first.
|
|
44
|
+
*/
|
|
45
|
+
export type ReadModelFacetsRequest<Q = GridQuery> = Omit<ReadModelRequest<Q>, "path"> & {
|
|
46
|
+
facets: (FacetSpec & {
|
|
47
|
+
search?: string;
|
|
48
|
+
limit?: number;
|
|
49
|
+
})[];
|
|
50
|
+
};
|
|
51
|
+
/**
|
|
52
|
+
* One facet's answer: values (selected ones and (Empty) first; a date bucket with its exclusive
|
|
53
|
+
* `end`, in epoch ms), a number's range, or a timeout of its own. `notEmpty` (and a range's
|
|
54
|
+
* `empty`) count rows with (without) a value, each once; none while a value search runs, and
|
|
55
|
+
* optional for read-model servers from before they were added.
|
|
56
|
+
*/
|
|
57
|
+
export type ReadModelFacet = {
|
|
58
|
+
field: string;
|
|
59
|
+
values: (ReadModelGroup & {
|
|
60
|
+
end?: number;
|
|
61
|
+
})[];
|
|
62
|
+
hasMore: boolean;
|
|
63
|
+
notEmpty?: number;
|
|
64
|
+
} | {
|
|
65
|
+
field: string;
|
|
66
|
+
min: unknown;
|
|
67
|
+
max: unknown;
|
|
68
|
+
empty?: number;
|
|
69
|
+
notEmpty?: number;
|
|
70
|
+
} | {
|
|
71
|
+
field: string;
|
|
72
|
+
error: "timeout";
|
|
73
|
+
};
|
|
74
|
+
export declare const COLUMNUS_BFF_MANAGEMENT_PREFIX: "/internal/columnus-bff/v1";
|
|
75
|
+
export declare const COLUMNUS_DEPLOY_INTERNAL_PREFIX: "/internal/v1";
|
|
76
|
+
/** Header carrying COLUMNUS_BFF_MANAGEMENT_SECRET (D6). */
|
|
77
|
+
export declare const COLUMNUS_BFF_MANAGEMENT_SECRET_HEADER: "x-columnus-bff-management-secret";
|
|
78
|
+
/** Header carrying COLUMNUS_PREVIEW_REGISTRATION_SECRET (D25). */
|
|
79
|
+
export declare const COLUMNUS_PREVIEW_REGISTRATION_SECRET_HEADER: "x-columnus-preview-registration-secret";
|
|
80
|
+
/**
|
|
81
|
+
* Management's tenant registry for the shared tenant fleet (render, sync): tenant URLs and deploy
|
|
82
|
+
* keys behind COLUMNUS_BFF_MANAGEMENT_SECRET. The wire names predate the sync worker.
|
|
83
|
+
*/
|
|
84
|
+
export declare const COLUMNUS_TENANT_REGISTRY_PATH: "/internal/columnus-render/v1/tenants";
|
|
85
|
+
export declare const COLUMNUS_TENANT_REGISTRY_SECRET_HEADER: "x-columnus-render-secret";
|
|
86
|
+
/** Caller-generated operation / idempotency IDs (not authorization credentials). */
|
|
87
|
+
export declare const OPERATION_ID_RE: RegExp;
|
|
88
|
+
/** Server-issued random transfer IDs (D10) — not signed bearer tokens. */
|
|
89
|
+
export declare const TRANSFER_ID_RE: RegExp;
|
|
90
|
+
export declare const MANIFEST_HASH_RE: RegExp;
|
|
91
|
+
export declare const TABLE_NAME_RE: RegExp;
|
|
92
|
+
export declare const operationIdSchema: z.ZodString;
|
|
93
|
+
export declare const transferIdSchema: z.ZodString;
|
|
94
|
+
export declare const manifestHashSchema: z.ZodString;
|
|
95
|
+
export declare const bffPrepareOperationTypeSchema: z.ZodEnum<{
|
|
96
|
+
schemaDeploy: "schemaDeploy";
|
|
97
|
+
dataExport: "dataExport";
|
|
98
|
+
dataImportPrepare: "dataImportPrepare";
|
|
99
|
+
dataImportCommit: "dataImportCommit";
|
|
100
|
+
}>;
|
|
101
|
+
export type BffPrepareOperationType = z.infer<typeof bffPrepareOperationTypeSchema>;
|
|
102
|
+
export declare const transferOperationSchema: z.ZodEnum<{
|
|
103
|
+
export: "export";
|
|
104
|
+
import: "import";
|
|
105
|
+
}>;
|
|
106
|
+
export type TransferOperation = z.infer<typeof transferOperationSchema>;
|
|
107
|
+
export declare const transferSessionStateSchema: z.ZodEnum<{
|
|
108
|
+
exportReady: "exportReady";
|
|
109
|
+
importAwaitingUpload: "importAwaitingUpload";
|
|
110
|
+
importUploaded: "importUploaded";
|
|
111
|
+
importCommitted: "importCommitted";
|
|
112
|
+
importFailed: "importFailed";
|
|
113
|
+
expired: "expired";
|
|
114
|
+
}>;
|
|
115
|
+
export type TransferSessionState = z.infer<typeof transferSessionStateSchema>;
|
|
116
|
+
export declare const schemaDeployPhaseSchema: z.ZodEnum<{
|
|
117
|
+
ready: "ready";
|
|
118
|
+
cleaning: "cleaning";
|
|
119
|
+
deploying: "deploying";
|
|
120
|
+
succeeded: "succeeded";
|
|
121
|
+
failed: "failed";
|
|
122
|
+
}>;
|
|
123
|
+
export type SchemaDeployPhase = z.infer<typeof schemaDeployPhaseSchema>;
|
|
124
|
+
/** Active schema operations hold this lease before a new operation may supersede them. */
|
|
125
|
+
export declare const SCHEMA_DEPLOY_OPERATION_LEASE_MS: number;
|
|
126
|
+
export declare function isSchemaDeployPhaseActive(phase: string | undefined): boolean;
|
|
127
|
+
export declare function hasSchemaDeployOperationLeaseExpired(startedAt: number | undefined, now: number): boolean;
|
|
128
|
+
/**
|
|
129
|
+
* Whether callers must wait (or BFF must recover) before starting another schema op.
|
|
130
|
+
* Matches beginBffDeploy: an active phase with an expired lease is supersedable, not blocking.
|
|
131
|
+
*/
|
|
132
|
+
export declare function isSchemaDeployOperationBlocking(phase: string | undefined, startedAt: number | undefined, now?: number): boolean;
|
|
133
|
+
/** Cryptographically random ID suitable for operationId / transferId. */
|
|
134
|
+
export declare function createRandomId(byteLength?: number): string;
|
|
135
|
+
export declare function createOperationId(): string;
|
|
136
|
+
export declare function createTransferId(): string;
|
|
137
|
+
export declare function isOperationId(value: string): boolean;
|
|
138
|
+
export declare function isTransferId(value: string): boolean;
|
|
139
|
+
export declare function isManifestHash(value: string): boolean;
|
|
140
|
+
/** True when completion should apply: same operation and matching desired hash. */
|
|
141
|
+
export declare function matchesDeployCompletion(args: {
|
|
142
|
+
activeOperationId: string | undefined;
|
|
143
|
+
activeDesiredHash: string | undefined;
|
|
144
|
+
completionOperationId: string;
|
|
145
|
+
completionManifestHash: string;
|
|
146
|
+
}): boolean;
|
|
147
|
+
/**
|
|
148
|
+
* Shrink cleanup may still mutate rows only while this operation holds `cleaning`.
|
|
149
|
+
* Finalize and fail-from-BFF must not proceed if the lease moved on.
|
|
150
|
+
*/
|
|
151
|
+
export declare function isCurrentSchemaCleaningOp(row: {
|
|
152
|
+
deployStatus?: string;
|
|
153
|
+
deployOperationId?: string;
|
|
154
|
+
desiredManifestHash?: string;
|
|
155
|
+
} | null | undefined, operationId: string, manifestHash: string): boolean;
|
|
156
|
+
export declare const dataTransferManifestSchema: z.ZodObject<{
|
|
157
|
+
version: z.ZodLiteral<1>;
|
|
158
|
+
tables: z.ZodArray<z.ZodString>;
|
|
159
|
+
schemaHash: z.ZodString;
|
|
160
|
+
includeFileStorage: z.ZodBoolean;
|
|
161
|
+
}, z.core.$strip>;
|
|
162
|
+
export type DataTransferManifestV1 = z.infer<typeof dataTransferManifestSchema>;
|
|
163
|
+
export declare const bffSchemaDeployRequestSchema: z.ZodObject<{
|
|
164
|
+
operationId: z.ZodString;
|
|
165
|
+
manifestJson: z.ZodString;
|
|
166
|
+
}, z.core.$strip>;
|
|
167
|
+
export type BffSchemaDeployRequest = z.infer<typeof bffSchemaDeployRequestSchema>;
|
|
168
|
+
export declare const bffTransferScopeRequestSchema: z.ZodObject<{
|
|
169
|
+
operationId: z.ZodString;
|
|
170
|
+
tables: z.ZodArray<z.ZodString>;
|
|
171
|
+
schemaHash: z.ZodString;
|
|
172
|
+
includeFileStorage: z.ZodBoolean;
|
|
173
|
+
}, z.core.$strip>;
|
|
174
|
+
export type BffTransferScopeRequest = z.infer<typeof bffTransferScopeRequestSchema>;
|
|
175
|
+
export declare const bffTransferCommitRequestSchema: z.ZodObject<{
|
|
176
|
+
operationId: z.ZodString;
|
|
177
|
+
schemaHash: z.ZodString;
|
|
178
|
+
}, z.core.$strip>;
|
|
179
|
+
export type BffTransferCommitRequest = z.infer<typeof bffTransferCommitRequestSchema>;
|
|
180
|
+
export type BffTransferCommitArgs = BffTransferCommitRequest & {
|
|
181
|
+
transferId: z.infer<typeof transferIdSchema>;
|
|
182
|
+
};
|
|
183
|
+
export declare const bffHealthResponseSchema: z.ZodObject<{
|
|
184
|
+
ok: z.ZodBoolean;
|
|
185
|
+
commit: z.ZodString;
|
|
186
|
+
executor: z.ZodObject<{
|
|
187
|
+
ok: z.ZodBoolean;
|
|
188
|
+
commit: z.ZodOptional<z.ZodString>;
|
|
189
|
+
error: z.ZodOptional<z.ZodString>;
|
|
190
|
+
}, z.core.$strip>;
|
|
191
|
+
}, z.core.$strip>;
|
|
192
|
+
export type BffHealthResponse = z.infer<typeof bffHealthResponseSchema>;
|
|
193
|
+
export declare const bffActiveOperationMetaSchema: z.ZodObject<{
|
|
194
|
+
operationId: z.ZodString;
|
|
195
|
+
desiredManifestHash: z.ZodOptional<z.ZodString>;
|
|
196
|
+
phase: z.ZodOptional<z.ZodEnum<{
|
|
197
|
+
ready: "ready";
|
|
198
|
+
cleaning: "cleaning";
|
|
199
|
+
deploying: "deploying";
|
|
200
|
+
succeeded: "succeeded";
|
|
201
|
+
failed: "failed";
|
|
202
|
+
}>>;
|
|
203
|
+
startedAt: z.ZodOptional<z.ZodNumber>;
|
|
204
|
+
}, z.core.$strip>;
|
|
205
|
+
export type BffActiveOperationMeta = z.infer<typeof bffActiveOperationMetaSchema>;
|
|
206
|
+
export declare const bffSchemaDeployResponseSchema: z.ZodObject<{
|
|
207
|
+
ok: z.ZodBoolean;
|
|
208
|
+
operationId: z.ZodString;
|
|
209
|
+
phase: z.ZodEnum<{
|
|
210
|
+
ready: "ready";
|
|
211
|
+
cleaning: "cleaning";
|
|
212
|
+
deploying: "deploying";
|
|
213
|
+
succeeded: "succeeded";
|
|
214
|
+
failed: "failed";
|
|
215
|
+
}>;
|
|
216
|
+
desiredManifestHash: z.ZodOptional<z.ZodString>;
|
|
217
|
+
deployedManifestHash: z.ZodOptional<z.ZodString>;
|
|
218
|
+
error: z.ZodOptional<z.ZodString>;
|
|
219
|
+
logTail: z.ZodOptional<z.ZodString>;
|
|
220
|
+
activeOperation: z.ZodOptional<z.ZodObject<{
|
|
221
|
+
operationId: z.ZodString;
|
|
222
|
+
desiredManifestHash: z.ZodOptional<z.ZodString>;
|
|
223
|
+
phase: z.ZodOptional<z.ZodEnum<{
|
|
224
|
+
ready: "ready";
|
|
225
|
+
cleaning: "cleaning";
|
|
226
|
+
deploying: "deploying";
|
|
227
|
+
succeeded: "succeeded";
|
|
228
|
+
failed: "failed";
|
|
229
|
+
}>>;
|
|
230
|
+
startedAt: z.ZodOptional<z.ZodNumber>;
|
|
231
|
+
}, z.core.$strip>>;
|
|
232
|
+
}, z.core.$strip>;
|
|
233
|
+
export type BffSchemaDeployResponse = z.infer<typeof bffSchemaDeployResponseSchema>;
|
|
234
|
+
export declare const bffTransferCreateResponseSchema: z.ZodObject<{
|
|
235
|
+
ok: z.ZodLiteral<true>;
|
|
236
|
+
transferId: z.ZodString;
|
|
237
|
+
expiresAt: z.ZodNumber;
|
|
238
|
+
bytes: z.ZodOptional<z.ZodNumber>;
|
|
239
|
+
}, z.core.$strip>;
|
|
240
|
+
export type BffTransferCreateResponse = z.infer<typeof bffTransferCreateResponseSchema>;
|
|
241
|
+
export declare const bffTransferCommitResponseSchema: z.ZodObject<{
|
|
242
|
+
ok: z.ZodBoolean;
|
|
243
|
+
transferId: z.ZodString;
|
|
244
|
+
error: z.ZodOptional<z.ZodString>;
|
|
245
|
+
logTail: z.ZodOptional<z.ZodString>;
|
|
246
|
+
}, z.core.$strip>;
|
|
247
|
+
export type BffTransferCommitResponse = z.infer<typeof bffTransferCommitResponseSchema>;
|
|
248
|
+
export declare const bffTransferUploadResponseSchema: z.ZodObject<{
|
|
249
|
+
ok: z.ZodLiteral<true>;
|
|
250
|
+
bytes: z.ZodNumber;
|
|
251
|
+
}, z.core.$strip>;
|
|
252
|
+
export type BffTransferUploadResponse = z.infer<typeof bffTransferUploadResponseSchema>;
|
|
253
|
+
export declare const bffErrorCodeSchema: z.ZodEnum<{
|
|
254
|
+
unauthorized: "unauthorized";
|
|
255
|
+
forbidden: "forbidden";
|
|
256
|
+
unknown_host: "unknown_host";
|
|
257
|
+
disabled_host: "disabled_host";
|
|
258
|
+
conflict: "conflict";
|
|
259
|
+
meaning_unavailable: "meaning_unavailable";
|
|
260
|
+
executor_mismatch: "executor_mismatch";
|
|
261
|
+
executor_unavailable: "executor_unavailable";
|
|
262
|
+
validation_error: "validation_error";
|
|
263
|
+
not_found: "not_found";
|
|
264
|
+
payload_too_large: "payload_too_large";
|
|
265
|
+
gone: "gone";
|
|
266
|
+
internal_error: "internal_error";
|
|
267
|
+
}>;
|
|
268
|
+
export type BffErrorCode = z.infer<typeof bffErrorCodeSchema>;
|
|
269
|
+
export declare const bffErrorResponseSchema: z.ZodObject<{
|
|
270
|
+
ok: z.ZodLiteral<false>;
|
|
271
|
+
error: z.ZodString;
|
|
272
|
+
code: z.ZodOptional<z.ZodEnum<{
|
|
273
|
+
unauthorized: "unauthorized";
|
|
274
|
+
forbidden: "forbidden";
|
|
275
|
+
unknown_host: "unknown_host";
|
|
276
|
+
disabled_host: "disabled_host";
|
|
277
|
+
conflict: "conflict";
|
|
278
|
+
meaning_unavailable: "meaning_unavailable";
|
|
279
|
+
executor_mismatch: "executor_mismatch";
|
|
280
|
+
executor_unavailable: "executor_unavailable";
|
|
281
|
+
validation_error: "validation_error";
|
|
282
|
+
not_found: "not_found";
|
|
283
|
+
payload_too_large: "payload_too_large";
|
|
284
|
+
gone: "gone";
|
|
285
|
+
internal_error: "internal_error";
|
|
286
|
+
}>>;
|
|
287
|
+
logTail: z.ZodOptional<z.ZodString>;
|
|
288
|
+
activeOperation: z.ZodOptional<z.ZodObject<{
|
|
289
|
+
operationId: z.ZodString;
|
|
290
|
+
desiredManifestHash: z.ZodOptional<z.ZodString>;
|
|
291
|
+
phase: z.ZodOptional<z.ZodEnum<{
|
|
292
|
+
ready: "ready";
|
|
293
|
+
cleaning: "cleaning";
|
|
294
|
+
deploying: "deploying";
|
|
295
|
+
succeeded: "succeeded";
|
|
296
|
+
failed: "failed";
|
|
297
|
+
}>>;
|
|
298
|
+
startedAt: z.ZodOptional<z.ZodNumber>;
|
|
299
|
+
}, z.core.$strip>>;
|
|
300
|
+
}, z.core.$strip>;
|
|
301
|
+
export type BffErrorResponse = z.infer<typeof bffErrorResponseSchema>;
|
|
302
|
+
export declare const bffPrepareOperationSchema: z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
303
|
+
type: z.ZodLiteral<"schemaDeploy">;
|
|
304
|
+
operationId: z.ZodString;
|
|
305
|
+
manifestJson: z.ZodString;
|
|
306
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
307
|
+
type: z.ZodLiteral<"dataExport">;
|
|
308
|
+
operationId: z.ZodString;
|
|
309
|
+
transferManifest: z.ZodObject<{
|
|
310
|
+
version: z.ZodLiteral<1>;
|
|
311
|
+
tables: z.ZodArray<z.ZodString>;
|
|
312
|
+
schemaHash: z.ZodString;
|
|
313
|
+
includeFileStorage: z.ZodBoolean;
|
|
314
|
+
}, z.core.$strip>;
|
|
315
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
316
|
+
type: z.ZodLiteral<"dataImportPrepare">;
|
|
317
|
+
operationId: z.ZodString;
|
|
318
|
+
transferManifest: z.ZodObject<{
|
|
319
|
+
version: z.ZodLiteral<1>;
|
|
320
|
+
tables: z.ZodArray<z.ZodString>;
|
|
321
|
+
schemaHash: z.ZodString;
|
|
322
|
+
includeFileStorage: z.ZodBoolean;
|
|
323
|
+
}, z.core.$strip>;
|
|
324
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
325
|
+
type: z.ZodLiteral<"dataImportCommit">;
|
|
326
|
+
operationId: z.ZodString;
|
|
327
|
+
transferId: z.ZodString;
|
|
328
|
+
schemaHash: z.ZodString;
|
|
329
|
+
}, z.core.$strip>], "type">;
|
|
330
|
+
export type BffPrepareOperation = z.infer<typeof bffPrepareOperationSchema>;
|
|
331
|
+
export declare const bffPrepareRequestSchema: z.ZodObject<{
|
|
332
|
+
protocolVersion: z.ZodLiteral<1>;
|
|
333
|
+
host: z.ZodString;
|
|
334
|
+
correlationId: z.ZodOptional<z.ZodString>;
|
|
335
|
+
operation: z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
336
|
+
type: z.ZodLiteral<"schemaDeploy">;
|
|
337
|
+
operationId: z.ZodString;
|
|
338
|
+
manifestJson: z.ZodString;
|
|
339
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
340
|
+
type: z.ZodLiteral<"dataExport">;
|
|
341
|
+
operationId: z.ZodString;
|
|
342
|
+
transferManifest: z.ZodObject<{
|
|
343
|
+
version: z.ZodLiteral<1>;
|
|
344
|
+
tables: z.ZodArray<z.ZodString>;
|
|
345
|
+
schemaHash: z.ZodString;
|
|
346
|
+
includeFileStorage: z.ZodBoolean;
|
|
347
|
+
}, z.core.$strip>;
|
|
348
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
349
|
+
type: z.ZodLiteral<"dataImportPrepare">;
|
|
350
|
+
operationId: z.ZodString;
|
|
351
|
+
transferManifest: z.ZodObject<{
|
|
352
|
+
version: z.ZodLiteral<1>;
|
|
353
|
+
tables: z.ZodArray<z.ZodString>;
|
|
354
|
+
schemaHash: z.ZodString;
|
|
355
|
+
includeFileStorage: z.ZodBoolean;
|
|
356
|
+
}, z.core.$strip>;
|
|
357
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
358
|
+
type: z.ZodLiteral<"dataImportCommit">;
|
|
359
|
+
operationId: z.ZodString;
|
|
360
|
+
transferId: z.ZodString;
|
|
361
|
+
schemaHash: z.ZodString;
|
|
362
|
+
}, z.core.$strip>], "type">;
|
|
363
|
+
}, z.core.$strip>;
|
|
364
|
+
export type BffPrepareRequest = z.infer<typeof bffPrepareRequestSchema>;
|
|
365
|
+
export declare const bffPreparedTenantSchema: z.ZodObject<{
|
|
366
|
+
slug: z.ZodString;
|
|
367
|
+
convexUrl: z.ZodString;
|
|
368
|
+
authIssuer: z.ZodOptional<z.ZodString>;
|
|
369
|
+
deploymentName: z.ZodOptional<z.ZodString>;
|
|
370
|
+
}, z.core.$strip>;
|
|
371
|
+
export type BffPreparedTenant = z.infer<typeof bffPreparedTenantSchema>;
|
|
372
|
+
/** Inner payload shapes for deploy-service `/internal/v1/*` (D39). */
|
|
373
|
+
export declare const deployInternalSchemaDeployPayloadSchema: z.ZodObject<{
|
|
374
|
+
manifestJson: z.ZodString;
|
|
375
|
+
convexDeployKey: z.ZodString;
|
|
376
|
+
convexUrl: z.ZodString;
|
|
377
|
+
authIssuer: z.ZodOptional<z.ZodString>;
|
|
378
|
+
previewName: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
379
|
+
operationId: z.ZodOptional<z.ZodString>;
|
|
380
|
+
}, z.core.$strip>;
|
|
381
|
+
export type DeployInternalSchemaDeployPayload = z.infer<typeof deployInternalSchemaDeployPayloadSchema>;
|
|
382
|
+
export declare const deployInternalTransferExportPayloadSchema: z.ZodObject<{
|
|
383
|
+
transferManifest: z.ZodObject<{
|
|
384
|
+
version: z.ZodLiteral<1>;
|
|
385
|
+
tables: z.ZodArray<z.ZodString>;
|
|
386
|
+
schemaHash: z.ZodString;
|
|
387
|
+
includeFileStorage: z.ZodBoolean;
|
|
388
|
+
}, z.core.$strip>;
|
|
389
|
+
convexDeployKey: z.ZodString;
|
|
390
|
+
convexUrl: z.ZodString;
|
|
391
|
+
tenantSlug: z.ZodString;
|
|
392
|
+
operationId: z.ZodString;
|
|
393
|
+
}, z.core.$strip>;
|
|
394
|
+
export type DeployInternalTransferExportPayload = z.infer<typeof deployInternalTransferExportPayloadSchema>;
|
|
395
|
+
export declare const deployInternalTransferImportPreparePayloadSchema: z.ZodObject<{
|
|
396
|
+
transferManifest: z.ZodObject<{
|
|
397
|
+
version: z.ZodLiteral<1>;
|
|
398
|
+
tables: z.ZodArray<z.ZodString>;
|
|
399
|
+
schemaHash: z.ZodString;
|
|
400
|
+
includeFileStorage: z.ZodBoolean;
|
|
401
|
+
}, z.core.$strip>;
|
|
402
|
+
convexDeployKey: z.ZodString;
|
|
403
|
+
convexUrl: z.ZodString;
|
|
404
|
+
tenantSlug: z.ZodString;
|
|
405
|
+
operationId: z.ZodString;
|
|
406
|
+
}, z.core.$strip>;
|
|
407
|
+
export type DeployInternalTransferImportPreparePayload = z.infer<typeof deployInternalTransferImportPreparePayloadSchema>;
|
|
408
|
+
export declare const deployInternalTransferCommitPayloadSchema: z.ZodObject<{
|
|
409
|
+
transferId: z.ZodString;
|
|
410
|
+
convexDeployKey: z.ZodString;
|
|
411
|
+
convexUrl: z.ZodString;
|
|
412
|
+
tenantSlug: z.ZodString;
|
|
413
|
+
operationId: z.ZodString;
|
|
414
|
+
schemaHash: z.ZodString;
|
|
415
|
+
}, z.core.$strip>;
|
|
416
|
+
export type DeployInternalTransferCommitPayload = z.infer<typeof deployInternalTransferCommitPayloadSchema>;
|
|
417
|
+
/**
|
|
418
|
+
* Management prepare response: a discriminated envelope whose operation owns
|
|
419
|
+
* the exact deploy-service payload shape. BFF forwards `payload` wholesale and
|
|
420
|
+
* must never log it as a unit.
|
|
421
|
+
*/
|
|
422
|
+
export declare const bffPreparedBodyEnvelopeSchema: z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
423
|
+
protocolVersion: z.ZodLiteral<1>;
|
|
424
|
+
tenant: z.ZodObject<{
|
|
425
|
+
slug: z.ZodString;
|
|
426
|
+
convexUrl: z.ZodString;
|
|
427
|
+
authIssuer: z.ZodOptional<z.ZodString>;
|
|
428
|
+
deploymentName: z.ZodOptional<z.ZodString>;
|
|
429
|
+
}, z.core.$strip>;
|
|
430
|
+
correlationId: z.ZodOptional<z.ZodString>;
|
|
431
|
+
operation: z.ZodLiteral<"schemaDeploy">;
|
|
432
|
+
payload: z.ZodObject<{
|
|
433
|
+
manifestJson: z.ZodString;
|
|
434
|
+
convexDeployKey: z.ZodString;
|
|
435
|
+
convexUrl: z.ZodString;
|
|
436
|
+
authIssuer: z.ZodOptional<z.ZodString>;
|
|
437
|
+
previewName: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
438
|
+
operationId: z.ZodOptional<z.ZodString>;
|
|
439
|
+
}, z.core.$strip>;
|
|
440
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
441
|
+
protocolVersion: z.ZodLiteral<1>;
|
|
442
|
+
tenant: z.ZodObject<{
|
|
443
|
+
slug: z.ZodString;
|
|
444
|
+
convexUrl: z.ZodString;
|
|
445
|
+
authIssuer: z.ZodOptional<z.ZodString>;
|
|
446
|
+
deploymentName: z.ZodOptional<z.ZodString>;
|
|
447
|
+
}, z.core.$strip>;
|
|
448
|
+
correlationId: z.ZodOptional<z.ZodString>;
|
|
449
|
+
operation: z.ZodLiteral<"dataExport">;
|
|
450
|
+
payload: z.ZodObject<{
|
|
451
|
+
transferManifest: z.ZodObject<{
|
|
452
|
+
version: z.ZodLiteral<1>;
|
|
453
|
+
tables: z.ZodArray<z.ZodString>;
|
|
454
|
+
schemaHash: z.ZodString;
|
|
455
|
+
includeFileStorage: z.ZodBoolean;
|
|
456
|
+
}, z.core.$strip>;
|
|
457
|
+
convexDeployKey: z.ZodString;
|
|
458
|
+
convexUrl: z.ZodString;
|
|
459
|
+
tenantSlug: z.ZodString;
|
|
460
|
+
operationId: z.ZodString;
|
|
461
|
+
}, z.core.$strip>;
|
|
462
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
463
|
+
protocolVersion: z.ZodLiteral<1>;
|
|
464
|
+
tenant: z.ZodObject<{
|
|
465
|
+
slug: z.ZodString;
|
|
466
|
+
convexUrl: z.ZodString;
|
|
467
|
+
authIssuer: z.ZodOptional<z.ZodString>;
|
|
468
|
+
deploymentName: z.ZodOptional<z.ZodString>;
|
|
469
|
+
}, z.core.$strip>;
|
|
470
|
+
correlationId: z.ZodOptional<z.ZodString>;
|
|
471
|
+
operation: z.ZodLiteral<"dataImportPrepare">;
|
|
472
|
+
payload: z.ZodObject<{
|
|
473
|
+
transferManifest: z.ZodObject<{
|
|
474
|
+
version: z.ZodLiteral<1>;
|
|
475
|
+
tables: z.ZodArray<z.ZodString>;
|
|
476
|
+
schemaHash: z.ZodString;
|
|
477
|
+
includeFileStorage: z.ZodBoolean;
|
|
478
|
+
}, z.core.$strip>;
|
|
479
|
+
convexDeployKey: z.ZodString;
|
|
480
|
+
convexUrl: z.ZodString;
|
|
481
|
+
tenantSlug: z.ZodString;
|
|
482
|
+
operationId: z.ZodString;
|
|
483
|
+
}, z.core.$strip>;
|
|
484
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
485
|
+
protocolVersion: z.ZodLiteral<1>;
|
|
486
|
+
tenant: z.ZodObject<{
|
|
487
|
+
slug: z.ZodString;
|
|
488
|
+
convexUrl: z.ZodString;
|
|
489
|
+
authIssuer: z.ZodOptional<z.ZodString>;
|
|
490
|
+
deploymentName: z.ZodOptional<z.ZodString>;
|
|
491
|
+
}, z.core.$strip>;
|
|
492
|
+
correlationId: z.ZodOptional<z.ZodString>;
|
|
493
|
+
operation: z.ZodLiteral<"dataImportCommit">;
|
|
494
|
+
payload: z.ZodObject<{
|
|
495
|
+
transferId: z.ZodString;
|
|
496
|
+
convexDeployKey: z.ZodString;
|
|
497
|
+
convexUrl: z.ZodString;
|
|
498
|
+
tenantSlug: z.ZodString;
|
|
499
|
+
operationId: z.ZodString;
|
|
500
|
+
schemaHash: z.ZodString;
|
|
501
|
+
}, z.core.$strip>;
|
|
502
|
+
}, z.core.$strip>], "operation">;
|
|
503
|
+
export type BffPreparedBodyEnvelope = z.infer<typeof bffPreparedBodyEnvelopeSchema>;
|
|
504
|
+
export type BffPreparedBodyEnvelopeFor<T extends BffPrepareOperationType> = Extract<BffPreparedBodyEnvelope, {
|
|
505
|
+
operation: T;
|
|
506
|
+
}>;
|
|
507
|
+
export declare const bffPreviewRegisterRequestSchema: z.ZodObject<{
|
|
508
|
+
previewName: z.ZodOptional<z.ZodString>;
|
|
509
|
+
hostname: z.ZodString;
|
|
510
|
+
convexUrl: z.ZodString;
|
|
511
|
+
deployKey: z.ZodString;
|
|
512
|
+
expectedCommit: z.ZodString;
|
|
513
|
+
expiresAt: z.ZodNumber;
|
|
514
|
+
}, z.core.$strip>;
|
|
515
|
+
export type BffPreviewRegisterRequest = z.infer<typeof bffPreviewRegisterRequestSchema>;
|
|
516
|
+
export declare const bffPreviewRemoveRequestSchema: z.ZodObject<{
|
|
517
|
+
hostname: z.ZodString;
|
|
518
|
+
}, z.core.$strip>;
|
|
519
|
+
export type BffPreviewRemoveRequest = z.infer<typeof bffPreviewRemoveRequestSchema>;
|
|
520
|
+
export declare const transferSessionRecordSchema: z.ZodObject<{
|
|
521
|
+
transferId: z.ZodString;
|
|
522
|
+
tenantSlug: z.ZodString;
|
|
523
|
+
convexUrl: z.ZodString;
|
|
524
|
+
operation: z.ZodEnum<{
|
|
525
|
+
export: "export";
|
|
526
|
+
import: "import";
|
|
527
|
+
}>;
|
|
528
|
+
tables: z.ZodArray<z.ZodString>;
|
|
529
|
+
schemaHash: z.ZodString;
|
|
530
|
+
includeFileStorage: z.ZodBoolean;
|
|
531
|
+
maxBytes: z.ZodNumber;
|
|
532
|
+
expiresAt: z.ZodNumber;
|
|
533
|
+
state: z.ZodEnum<{
|
|
534
|
+
exportReady: "exportReady";
|
|
535
|
+
importAwaitingUpload: "importAwaitingUpload";
|
|
536
|
+
importUploaded: "importUploaded";
|
|
537
|
+
importCommitted: "importCommitted";
|
|
538
|
+
importFailed: "importFailed";
|
|
539
|
+
expired: "expired";
|
|
540
|
+
}>;
|
|
541
|
+
operationId: z.ZodOptional<z.ZodString>;
|
|
542
|
+
bytes: z.ZodOptional<z.ZodNumber>;
|
|
543
|
+
commitResult: z.ZodOptional<z.ZodObject<{
|
|
544
|
+
ok: z.ZodBoolean;
|
|
545
|
+
error: z.ZodOptional<z.ZodString>;
|
|
546
|
+
logTail: z.ZodOptional<z.ZodString>;
|
|
547
|
+
}, z.core.$strip>>;
|
|
548
|
+
}, z.core.$strip>;
|
|
549
|
+
export type TransferSessionRecord = z.infer<typeof transferSessionRecordSchema>;
|
|
550
|
+
export declare const deployInternalTransferCreateResponseSchema: z.ZodObject<{
|
|
551
|
+
ok: z.ZodLiteral<true>;
|
|
552
|
+
transferId: z.ZodString;
|
|
553
|
+
expiresAt: z.ZodNumber;
|
|
554
|
+
bytes: z.ZodOptional<z.ZodNumber>;
|
|
555
|
+
}, z.core.$strip>;
|
|
556
|
+
export declare const deployHealthResponseSchema: z.ZodObject<{
|
|
557
|
+
ok: z.ZodBoolean;
|
|
558
|
+
commit: z.ZodOptional<z.ZodString>;
|
|
559
|
+
}, z.core.$strip>;
|
|
560
|
+
export type DeployHealthResponse = z.infer<typeof deployHealthResponseSchema>;
|
|
561
|
+
/** Default JSON body size for non-streaming BFF routes (bytes). */
|
|
562
|
+
export declare const BFF_JSON_BODY_LIMIT_BYTES: number;
|
|
563
|
+
export { MAX_TRANSFER_BYTES as BFF_TRANSFER_MAX_BYTES };
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Redaction and secret-compare helpers for BFF / Management / deploy boundaries (D39).
|
|
3
|
+
* Prepared bodies and deploy keys must never appear in logs or error telemetry.
|
|
4
|
+
*/
|
|
5
|
+
export declare const REDACTED: "[REDACTED]";
|
|
6
|
+
/**
|
|
7
|
+
* Deep-clone a value for logs, replacing classified fields (including nested
|
|
8
|
+
* `payload` / `convexDeployKey`) with {@link REDACTED}.
|
|
9
|
+
*/
|
|
10
|
+
export declare function redactForLogs(value: unknown): unknown;
|
|
11
|
+
/** Redact known secret substrings from a free-form message. */
|
|
12
|
+
export declare function redactString(message: string): string;
|
|
13
|
+
/**
|
|
14
|
+
* Constant-time string equality for shared secrets.
|
|
15
|
+
* Works in Node and browsers (no `node:crypto` dependency).
|
|
16
|
+
*/
|
|
17
|
+
export declare function secretsEqual(provided: string | undefined, expected: string | undefined): boolean;
|
|
18
|
+
/** True when a key name is classified and must not be logged. */
|
|
19
|
+
export declare function isClassifiedKey(key: string): boolean;
|
|
20
|
+
/**
|
|
21
|
+
* Safe summary of a prepared-body envelope for structured logs:
|
|
22
|
+
* operation, tenant slug, protocol version — never the inner payload.
|
|
23
|
+
*/
|
|
24
|
+
export declare function summarizePreparedEnvelope(envelope: unknown): {
|
|
25
|
+
protocolVersion?: unknown;
|
|
26
|
+
operation?: unknown;
|
|
27
|
+
tenantSlug?: unknown;
|
|
28
|
+
correlationId?: unknown;
|
|
29
|
+
payload: typeof REDACTED;
|
|
30
|
+
};
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
/** Parse and validate a git commit SHA (7–40 hex chars). */
|
|
2
|
+
export declare function parseGitSha(raw: string | undefined, label?: string): string;
|
|
3
|
+
export type PreviewSourceCommitResult = {
|
|
4
|
+
ok: true;
|
|
5
|
+
commit: string;
|
|
6
|
+
required: boolean;
|
|
7
|
+
} | {
|
|
8
|
+
ok: false;
|
|
9
|
+
message: string;
|
|
10
|
+
};
|
|
11
|
+
/** Validates SOURCE_COMMIT for isolated preview builds (skipped when CI_PREVIEW=true). */
|
|
12
|
+
export declare function validatePreviewSourceCommit(env?: NodeJS.ProcessEnv): PreviewSourceCommitResult;
|
|
13
|
+
export declare function normalizeConvexUrl(url: string): string;
|
|
14
|
+
/** DOCS_SEED_SYNC_EMAIL with PLAYWRIGHT_TEST_EMAIL fallback (CI / entrypoint). */
|
|
15
|
+
export declare function docsSeedSyncEmailFromEnv(env?: NodeJS.ProcessEnv): string | undefined;
|
|
16
|
+
/**
|
|
17
|
+
* Union comma-separated bootstrap admin emails with preview seed identities.
|
|
18
|
+
* Preview docs seed + Playwright OTP users must be bootstrap-approved or
|
|
19
|
+
* container-startup `sync-docs-seed` fails with `Not approved`.
|
|
20
|
+
*/
|
|
21
|
+
export declare function mergeBootstrapAdminEmails(...groups: Array<string | undefined>): string | undefined;
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import type { Table as TableT } from "./schemaTypes.ts";
|
|
2
|
+
import { type CsvExport } from "./csv.ts";
|
|
3
|
+
export declare const COLUMNUS_CLIPBOARD_MARKER = "#columnus-clipboard";
|
|
4
|
+
export declare const COLUMNUS_CLIPBOARD_VERSION = 1;
|
|
5
|
+
export type ColumnusClipboardMeta = {
|
|
6
|
+
version: number;
|
|
7
|
+
table: string;
|
|
8
|
+
columns: string[];
|
|
9
|
+
};
|
|
10
|
+
export type ParsedColumnusClipboard = {
|
|
11
|
+
meta: ColumnusClipboardMeta;
|
|
12
|
+
csvBody: string;
|
|
13
|
+
};
|
|
14
|
+
export type SerializeColumnusClipboardInput = {
|
|
15
|
+
table: string;
|
|
16
|
+
csv: CsvExport;
|
|
17
|
+
};
|
|
18
|
+
export declare function serializeColumnusClipboard(input: SerializeColumnusClipboardInput): string;
|
|
19
|
+
export declare function parseColumnusClipboard(text: string): ParsedColumnusClipboard | null;
|
|
20
|
+
export declare function validateClipboardColumns(columns: readonly string[], table: TableT): {
|
|
21
|
+
ok: true;
|
|
22
|
+
} | {
|
|
23
|
+
ok: false;
|
|
24
|
+
unknownColumns: string[];
|
|
25
|
+
};
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* A typed wire contract for public Convex functions that another process calls
|
|
3
|
+
* by name (the Web BFF calling a tenant facade). The spec is the single source
|
|
4
|
+
* of truth: callers build their `FunctionReference`s from it, and the module
|
|
5
|
+
* that registers the functions checks itself against it at compile time.
|
|
6
|
+
*/
|
|
7
|
+
import type { FunctionReference, RegisteredMutation, RegisteredQuery } from "convex/server";
|
|
8
|
+
/** One public function: its kind, what callers send, and what they get back. */
|
|
9
|
+
export type FacadeFunction = {
|
|
10
|
+
type: "query" | "mutation";
|
|
11
|
+
args: Record<string, unknown>;
|
|
12
|
+
returns: unknown;
|
|
13
|
+
};
|
|
14
|
+
export type FacadeSpec = Record<string, FacadeFunction>;
|
|
15
|
+
/** Typed references for every function in `Spec`, for `anyApi`-style callers. */
|
|
16
|
+
export type FacadeApi<Spec extends FacadeSpec> = {
|
|
17
|
+
[Name in keyof Spec]: FunctionReference<Spec[Name]["type"], "public", Spec[Name]["args"], Spec[Name]["returns"]>;
|
|
18
|
+
};
|
|
19
|
+
/** Whether one registered export honours one spec entry. */
|
|
20
|
+
type Conforms<Export, Fn extends FacadeFunction> = Export extends RegisteredQuery<infer Visibility, infer Args, infer Returns> ? Matches<"query", Visibility, Args, Returns, Fn> : Export extends RegisteredMutation<infer Visibility, infer Args, infer Returns> ? Matches<"mutation", Visibility, Args, Returns, Fn> : false;
|
|
21
|
+
/** Kind and visibility agree, callers' args are accepted, and the result is what they expect. */
|
|
22
|
+
type Matches<Type, Visibility, Args, Returns, Fn extends FacadeFunction> = [
|
|
23
|
+
Type,
|
|
24
|
+
Visibility
|
|
25
|
+
] extends [Fn["type"], "public"] ? Fn["args"] extends Args ? Awaited<Returns> extends Fn["returns"] ? true : false : false : false;
|
|
26
|
+
/**
|
|
27
|
+
* Names in `Spec` whose registration does not honour it: missing, the wrong
|
|
28
|
+
* kind or visibility, rejecting args callers may send, or returning something
|
|
29
|
+
* callers do not expect. `never` when every function conforms.
|
|
30
|
+
*/
|
|
31
|
+
export type FacadeDrift<Exports, Spec extends FacadeSpec> = {
|
|
32
|
+
[Name in keyof Spec]: Name extends keyof Exports ? Conforms<Exports[Name], Spec[Name]> extends true ? never : Name : Name;
|
|
33
|
+
}[keyof Spec];
|
|
34
|
+
/**
|
|
35
|
+
* `Exports` when it implements `Spec`; otherwise a type whose `facadeDrift`
|
|
36
|
+
* names the functions that drift. Use as `return fns satisfies
|
|
37
|
+
* ImplementsFacade<typeof fns, Spec>`.
|
|
38
|
+
*/
|
|
39
|
+
export type ImplementsFacade<Exports, Spec extends FacadeSpec> = [
|
|
40
|
+
FacadeDrift<Exports, Spec>
|
|
41
|
+
] extends [never] ? Exports : {
|
|
42
|
+
facadeDrift: FacadeDrift<Exports, Spec>;
|
|
43
|
+
};
|
|
44
|
+
export {};
|