@questpie/admin 1.1.0 → 2.0.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/README.md +245 -474
- package/dist/_virtual/rolldown_runtime.mjs +18 -0
- package/dist/augmentation.d.mts +315 -0
- package/dist/augmentation.d.mts.map +1 -0
- package/dist/client/blocks/block-registry.d.mts +199 -0
- package/dist/client/blocks/block-registry.d.mts.map +1 -0
- package/dist/client/blocks/block-registry.mjs +88 -0
- package/dist/client/blocks/block-registry.mjs.map +1 -0
- package/dist/client/blocks/block-renderer.d.mts +52 -0
- package/dist/client/blocks/block-renderer.d.mts.map +1 -0
- package/dist/client/blocks/block-renderer.mjs +71 -0
- package/dist/client/blocks/block-renderer.mjs.map +1 -0
- package/dist/client/blocks/index.d.mts +4 -0
- package/dist/client/blocks/prefetch.d.mts +45 -0
- package/dist/client/blocks/prefetch.d.mts.map +1 -0
- package/dist/client/blocks/prefetch.mjs +26 -0
- package/dist/client/blocks/prefetch.mjs.map +1 -0
- package/dist/client/blocks/types.d.mts +69 -0
- package/dist/client/blocks/types.d.mts.map +1 -0
- package/dist/client/blocks/types.mjs +20 -0
- package/dist/client/blocks/types.mjs.map +1 -0
- package/dist/client/builder/admin-builder.d.mts +112 -0
- package/dist/client/builder/admin-builder.d.mts.map +1 -0
- package/dist/client/builder/admin-builder.mjs +185 -0
- package/dist/client/builder/admin-builder.mjs.map +1 -0
- package/dist/client/builder/admin-types.d.mts +73 -0
- package/dist/client/builder/admin-types.d.mts.map +1 -0
- package/dist/client/builder/admin.d.mts +121 -0
- package/dist/client/builder/admin.d.mts.map +1 -0
- package/dist/client/builder/admin.mjs +160 -0
- package/dist/client/builder/admin.mjs.map +1 -0
- package/dist/client/builder/defaults/components.mjs +20 -0
- package/dist/client/builder/defaults/components.mjs.map +1 -0
- package/dist/client/builder/defaults/core.d.mts +354 -0
- package/dist/client/builder/defaults/core.d.mts.map +1 -0
- package/dist/client/builder/defaults/core.mjs +49 -0
- package/dist/client/builder/defaults/core.mjs.map +1 -0
- package/dist/client/builder/defaults/fields.mjs +328 -0
- package/dist/client/builder/defaults/fields.mjs.map +1 -0
- package/dist/client/builder/defaults/pages.mjs +58 -0
- package/dist/client/builder/defaults/pages.mjs.map +1 -0
- package/dist/client/builder/defaults/starter.d.mts +351 -0
- package/dist/client/builder/defaults/starter.d.mts.map +1 -0
- package/dist/client/builder/defaults/starter.mjs +28 -0
- package/dist/client/builder/defaults/starter.mjs.map +1 -0
- package/dist/client/builder/defaults/views.mjs +27 -0
- package/dist/client/builder/defaults/views.mjs.map +1 -0
- package/dist/client/builder/defaults/widgets.mjs +31 -0
- package/dist/client/builder/defaults/widgets.mjs.map +1 -0
- package/dist/client/builder/field/field.d.mts +229 -0
- package/dist/client/builder/field/field.d.mts.map +1 -0
- package/dist/client/builder/field/field.mjs +83 -0
- package/dist/client/builder/field/field.mjs.map +1 -0
- package/dist/client/builder/index.d.mts +36 -0
- package/dist/client/builder/index.d.mts.map +1 -0
- package/dist/client/builder/page/page.d.mts +36 -0
- package/dist/client/builder/page/page.d.mts.map +1 -0
- package/dist/client/builder/page/page.mjs +27 -0
- package/dist/client/builder/page/page.mjs.map +1 -0
- package/dist/client/builder/proxies.d.mts +2 -0
- package/dist/client/builder/proxies.mjs +24 -0
- package/dist/client/builder/proxies.mjs.map +1 -0
- package/dist/client/builder/qa.d.mts +50 -0
- package/dist/client/builder/qa.d.mts.map +1 -0
- package/dist/client/builder/qa.mjs +42 -0
- package/dist/client/builder/qa.mjs.map +1 -0
- package/dist/client/builder/registry.d.mts +70 -0
- package/dist/client/builder/registry.d.mts.map +1 -0
- package/dist/client/builder/types/action-registry.d.mts +2 -0
- package/dist/client/builder/types/action-registry.mjs +142 -0
- package/dist/client/builder/types/action-registry.mjs.map +1 -0
- package/dist/client/builder/types/action-types.d.mts +253 -0
- package/dist/client/builder/types/action-types.d.mts.map +1 -0
- package/dist/client/builder/types/collection-types.d.mts +199 -0
- package/dist/client/builder/types/collection-types.d.mts.map +1 -0
- package/dist/client/builder/types/collection-types.mjs +11 -0
- package/dist/client/builder/types/collection-types.mjs.map +1 -0
- package/dist/client/builder/types/common.d.mts +60 -0
- package/dist/client/builder/types/common.d.mts.map +1 -0
- package/dist/client/builder/types/field-types.d.mts +593 -0
- package/dist/client/builder/types/field-types.d.mts.map +1 -0
- package/dist/client/builder/types/field-types.mjs +19 -0
- package/dist/client/builder/types/field-types.mjs.map +1 -0
- package/dist/client/builder/types/global-types.d.mts +22 -0
- package/dist/client/builder/types/global-types.d.mts.map +1 -0
- package/dist/client/builder/types/ui-config.d.mts +160 -0
- package/dist/client/builder/types/ui-config.d.mts.map +1 -0
- package/dist/client/builder/types/views.d.mts +89 -0
- package/dist/client/builder/types/views.d.mts.map +1 -0
- package/dist/client/builder/types/widget-types.d.mts +563 -0
- package/dist/client/builder/types/widget-types.d.mts.map +1 -0
- package/dist/client/builder/validation.d.mts +3 -0
- package/dist/client/builder/validation.mjs +208 -0
- package/dist/client/builder/validation.mjs.map +1 -0
- package/dist/client/builder/view/view.d.mts +129 -0
- package/dist/client/builder/view/view.d.mts.map +1 -0
- package/dist/client/builder/view/view.mjs +109 -0
- package/dist/client/builder/view/view.mjs.map +1 -0
- package/dist/client/builder/widget/widget.d.mts +33 -0
- package/dist/client/builder/widget/widget.d.mts.map +1 -0
- package/dist/client/builder/widget/widget.mjs +26 -0
- package/dist/client/builder/widget/widget.mjs.map +1 -0
- package/dist/client/components/actions/action-button.d.mts +2 -0
- package/dist/client/components/actions/action-button.mjs +135 -0
- package/dist/client/components/actions/action-button.mjs.map +1 -0
- package/dist/client/components/actions/action-dialog.d.mts +2 -0
- package/dist/client/components/actions/action-dialog.mjs +264 -0
- package/dist/client/components/actions/action-dialog.mjs.map +1 -0
- package/dist/client/components/actions/confirmation-dialog.d.mts +2 -0
- package/dist/client/components/actions/confirmation-dialog.mjs +82 -0
- package/dist/client/components/actions/confirmation-dialog.mjs.map +1 -0
- package/dist/client/components/actions/header-actions.d.mts +2 -0
- package/dist/client/components/actions/header-actions.mjs +117 -0
- package/dist/client/components/actions/header-actions.mjs.map +1 -0
- package/dist/client/components/actions/index.d.mts +4 -0
- package/dist/client/components/admin-link.d.mts +67 -0
- package/dist/client/components/admin-link.d.mts.map +1 -0
- package/dist/client/components/admin-link.mjs +92 -0
- package/dist/client/components/admin-link.mjs.map +1 -0
- package/dist/client/components/auth/auth-guard.d.mts +51 -0
- package/dist/client/components/auth/auth-guard.d.mts.map +1 -0
- package/dist/client/components/auth/auth-guard.mjs +60 -0
- package/dist/client/components/auth/auth-guard.mjs.map +1 -0
- package/dist/client/components/auth/auth-loading.d.mts +36 -0
- package/dist/client/components/auth/auth-loading.d.mts.map +1 -0
- package/dist/client/components/auth/auth-loading.mjs +27 -0
- package/dist/client/components/auth/auth-loading.mjs.map +1 -0
- package/dist/client/components/auth/index.d.mts +2 -0
- package/dist/client/components/blocks/block-canvas.mjs +90 -0
- package/dist/client/components/blocks/block-canvas.mjs.map +1 -0
- package/dist/client/components/blocks/block-editor-context.mjs +58 -0
- package/dist/client/components/blocks/block-editor-context.mjs.map +1 -0
- package/dist/client/components/blocks/block-editor-layout.mjs +82 -0
- package/dist/client/components/blocks/block-editor-layout.mjs.map +1 -0
- package/dist/client/components/blocks/block-editor-provider.mjs +155 -0
- package/dist/client/components/blocks/block-editor-provider.mjs.map +1 -0
- package/dist/client/components/blocks/block-fields-renderer.mjs +70 -0
- package/dist/client/components/blocks/block-fields-renderer.mjs.map +1 -0
- package/dist/client/components/blocks/block-insert-button.mjs +72 -0
- package/dist/client/components/blocks/block-insert-button.mjs.map +1 -0
- package/dist/client/components/blocks/block-item-menu.mjs +161 -0
- package/dist/client/components/blocks/block-item-menu.mjs.map +1 -0
- package/dist/client/components/blocks/block-item.mjs +187 -0
- package/dist/client/components/blocks/block-item.mjs.map +1 -0
- package/dist/client/components/blocks/block-library-sidebar.mjs +190 -0
- package/dist/client/components/blocks/block-library-sidebar.mjs.map +1 -0
- package/dist/client/components/blocks/block-tree.mjs +45 -0
- package/dist/client/components/blocks/block-tree.mjs.map +1 -0
- package/dist/client/components/blocks/block-type-icon.mjs +50 -0
- package/dist/client/components/blocks/block-type-icon.mjs.map +1 -0
- package/dist/client/components/blocks/utils/tree-utils.mjs +186 -0
- package/dist/client/components/blocks/utils/tree-utils.mjs.map +1 -0
- package/dist/client/components/component-renderer.d.mts +125 -0
- package/dist/client/components/component-renderer.d.mts.map +1 -0
- package/dist/client/components/component-renderer.mjs +145 -0
- package/dist/client/components/component-renderer.mjs.map +1 -0
- package/dist/client/components/error-boundary.mjs +92 -0
- package/dist/client/components/error-boundary.mjs.map +1 -0
- package/dist/client/components/fields/array-field.d.mts +44 -0
- package/dist/client/components/fields/array-field.d.mts.map +1 -0
- package/dist/client/components/fields/array-field.mjs +231 -0
- package/dist/client/components/fields/array-field.mjs.map +1 -0
- package/dist/client/components/fields/asset-preview-field.d.mts +52 -0
- package/dist/client/components/fields/asset-preview-field.d.mts.map +1 -0
- package/dist/client/components/fields/asset-preview-field.mjs +60 -0
- package/dist/client/components/fields/asset-preview-field.mjs.map +1 -0
- package/dist/client/components/fields/blocks-field/blocks-field.d.mts +41 -0
- package/dist/client/components/fields/blocks-field/blocks-field.d.mts.map +1 -0
- package/dist/client/components/fields/blocks-field/blocks-field.mjs +101 -0
- package/dist/client/components/fields/blocks-field/blocks-field.mjs.map +1 -0
- package/dist/client/components/fields/blocks-field/index.d.mts +1 -0
- package/dist/client/components/fields/boolean-field.d.mts +30 -0
- package/dist/client/components/fields/boolean-field.d.mts.map +1 -0
- package/dist/client/components/fields/boolean-field.mjs +47 -0
- package/dist/client/components/fields/boolean-field.mjs.map +1 -0
- package/dist/client/components/fields/custom-field.d.mts +3 -0
- package/dist/client/components/fields/date-field.d.mts +22 -0
- package/dist/client/components/fields/date-field.d.mts.map +1 -0
- package/dist/client/components/fields/date-field.mjs +42 -0
- package/dist/client/components/fields/date-field.mjs.map +1 -0
- package/dist/client/components/fields/datetime-field.d.mts +23 -0
- package/dist/client/components/fields/datetime-field.d.mts.map +1 -0
- package/dist/client/components/fields/datetime-field.mjs +43 -0
- package/dist/client/components/fields/datetime-field.mjs.map +1 -0
- package/dist/client/components/fields/email-field.d.mts +19 -0
- package/dist/client/components/fields/email-field.d.mts.map +1 -0
- package/dist/client/components/fields/email-field.mjs +38 -0
- package/dist/client/components/fields/email-field.mjs.map +1 -0
- package/dist/client/components/fields/embedded-collection.d.mts +3 -0
- package/dist/client/components/fields/field-types.d.mts +571 -0
- package/dist/client/components/fields/field-types.d.mts.map +1 -0
- package/dist/client/components/fields/field-utils.d.mts +1 -0
- package/dist/client/components/fields/field-utils.mjs +65 -0
- package/dist/client/components/fields/field-utils.mjs.map +1 -0
- package/dist/client/components/fields/field-wrapper.d.mts +3 -0
- package/dist/client/components/fields/field-wrapper.mjs +49 -0
- package/dist/client/components/fields/field-wrapper.mjs.map +1 -0
- package/dist/client/components/fields/index.d.mts +33 -0
- package/dist/client/components/fields/json-field.d.mts +84 -0
- package/dist/client/components/fields/json-field.d.mts.map +1 -0
- package/dist/client/components/fields/json-field.mjs +248 -0
- package/dist/client/components/fields/json-field.mjs.map +1 -0
- package/dist/client/components/fields/locale-badge.d.mts +1 -0
- package/dist/client/components/fields/locale-badge.mjs +17 -0
- package/dist/client/components/fields/locale-badge.mjs.map +1 -0
- package/dist/client/components/fields/number-field.d.mts +23 -0
- package/dist/client/components/fields/number-field.d.mts.map +1 -0
- package/dist/client/components/fields/number-field.mjs +40 -0
- package/dist/client/components/fields/number-field.mjs.map +1 -0
- package/dist/client/components/fields/object-array-field.d.mts +2 -0
- package/dist/client/components/fields/object-array-field.mjs +313 -0
- package/dist/client/components/fields/object-array-field.mjs.map +1 -0
- package/dist/client/components/fields/object-field.d.mts +32 -0
- package/dist/client/components/fields/object-field.d.mts.map +1 -0
- package/dist/client/components/fields/object-field.mjs +128 -0
- package/dist/client/components/fields/object-field.mjs.map +1 -0
- package/dist/client/components/fields/relation/displays/cards-display.d.mts +2 -0
- package/dist/client/components/fields/relation/displays/cards-display.mjs +140 -0
- package/dist/client/components/fields/relation/displays/cards-display.mjs.map +1 -0
- package/dist/client/components/fields/relation/displays/chips-display.d.mts +2 -0
- package/dist/client/components/fields/relation/displays/chips-display.mjs +100 -0
- package/dist/client/components/fields/relation/displays/chips-display.mjs.map +1 -0
- package/dist/client/components/fields/relation/displays/grid-display.d.mts +2 -0
- package/dist/client/components/fields/relation/displays/grid-display.mjs +114 -0
- package/dist/client/components/fields/relation/displays/grid-display.mjs.map +1 -0
- package/dist/client/components/fields/relation/displays/index.d.mts +6 -0
- package/dist/client/components/fields/relation/displays/list-display.d.mts +2 -0
- package/dist/client/components/fields/relation/displays/list-display.mjs +128 -0
- package/dist/client/components/fields/relation/displays/list-display.mjs.map +1 -0
- package/dist/client/components/fields/relation/displays/table-display.d.mts +2 -0
- package/dist/client/components/fields/relation/displays/table-display.mjs +134 -0
- package/dist/client/components/fields/relation/displays/table-display.mjs.map +1 -0
- package/dist/client/components/fields/relation/displays/types.d.mts +22 -0
- package/dist/client/components/fields/relation/displays/types.d.mts.map +1 -0
- package/dist/client/components/fields/relation/displays/types.mjs +73 -0
- package/dist/client/components/fields/relation/displays/types.mjs.map +1 -0
- package/dist/client/components/fields/relation/index.d.mts +3 -0
- package/dist/client/components/fields/relation/relation-items-display.d.mts +5 -0
- package/dist/client/components/fields/relation/relation-items-display.mjs +47 -0
- package/dist/client/components/fields/relation/relation-items-display.mjs.map +1 -0
- package/dist/client/components/fields/relation-field.d.mts +134 -0
- package/dist/client/components/fields/relation-field.d.mts.map +1 -0
- package/dist/client/components/fields/relation-field.mjs +106 -0
- package/dist/client/components/fields/relation-field.mjs.map +1 -0
- package/dist/client/components/fields/relation-picker.d.mts +4 -0
- package/dist/client/components/fields/relation-picker.mjs +301 -0
- package/dist/client/components/fields/relation-picker.mjs.map +1 -0
- package/dist/client/components/fields/relation-select.d.mts +3 -0
- package/dist/client/components/fields/relation-select.mjs +219 -0
- package/dist/client/components/fields/relation-select.mjs.map +1 -0
- package/dist/client/components/fields/reverse-relation-field.d.mts +2 -0
- package/dist/client/components/fields/rich-text-editor/bubble-menu.mjs +56 -0
- package/dist/client/components/fields/rich-text-editor/bubble-menu.mjs.map +1 -0
- package/dist/client/components/fields/rich-text-editor/extensions.mjs +118 -0
- package/dist/client/components/fields/rich-text-editor/extensions.mjs.map +1 -0
- package/dist/client/components/fields/rich-text-editor/image-popover.mjs +196 -0
- package/dist/client/components/fields/rich-text-editor/image-popover.mjs.map +1 -0
- package/dist/client/components/fields/rich-text-editor/index.d.mts +4 -0
- package/dist/client/components/fields/rich-text-editor/index.mjs +187 -0
- package/dist/client/components/fields/rich-text-editor/index.mjs.map +1 -0
- package/dist/client/components/fields/rich-text-editor/link-popover.mjs +86 -0
- package/dist/client/components/fields/rich-text-editor/link-popover.mjs.map +1 -0
- package/dist/client/components/fields/rich-text-editor/presets.d.mts +11 -0
- package/dist/client/components/fields/rich-text-editor/presets.d.mts.map +1 -0
- package/dist/client/components/fields/rich-text-editor/presets.mjs +124 -0
- package/dist/client/components/fields/rich-text-editor/presets.mjs.map +1 -0
- package/dist/client/components/fields/rich-text-editor/slash-commands.mjs +145 -0
- package/dist/client/components/fields/rich-text-editor/slash-commands.mjs.map +1 -0
- package/dist/client/components/fields/rich-text-editor/table-controls.mjs +124 -0
- package/dist/client/components/fields/rich-text-editor/table-controls.mjs.map +1 -0
- package/dist/client/components/fields/rich-text-editor/toolbar.mjs +280 -0
- package/dist/client/components/fields/rich-text-editor/toolbar.mjs.map +1 -0
- package/dist/client/components/fields/rich-text-editor/types.d.mts +78 -0
- package/dist/client/components/fields/rich-text-editor/types.d.mts.map +1 -0
- package/dist/client/components/fields/rich-text-editor/types.mjs +31 -0
- package/dist/client/components/fields/rich-text-editor/types.mjs.map +1 -0
- package/dist/client/components/fields/rich-text-editor/utils.mjs +51 -0
- package/dist/client/components/fields/rich-text-editor/utils.mjs.map +1 -0
- package/dist/client/components/fields/rich-text-editor/variants.d.mts +2 -0
- package/dist/client/components/fields/rich-text-field.d.mts +14 -0
- package/dist/client/components/fields/rich-text-field.d.mts.map +1 -0
- package/dist/client/components/fields/rich-text-field.mjs +26 -0
- package/dist/client/components/fields/rich-text-field.mjs.map +1 -0
- package/dist/client/components/fields/select-field.d.mts +25 -0
- package/dist/client/components/fields/select-field.d.mts.map +1 -0
- package/dist/client/components/fields/select-field.mjs +53 -0
- package/dist/client/components/fields/select-field.mjs.map +1 -0
- package/dist/client/components/fields/status-field.d.mts +2 -0
- package/dist/client/components/fields/text-field.d.mts +22 -0
- package/dist/client/components/fields/text-field.d.mts.map +1 -0
- package/dist/client/components/fields/text-field.mjs +39 -0
- package/dist/client/components/fields/text-field.mjs.map +1 -0
- package/dist/client/components/fields/textarea-field.d.mts +22 -0
- package/dist/client/components/fields/textarea-field.d.mts.map +1 -0
- package/dist/client/components/fields/textarea-field.mjs +39 -0
- package/dist/client/components/fields/textarea-field.mjs.map +1 -0
- package/dist/client/components/fields/time-field.d.mts +20 -0
- package/dist/client/components/fields/time-field.d.mts.map +1 -0
- package/dist/client/components/fields/time-field.mjs +39 -0
- package/dist/client/components/fields/time-field.mjs.map +1 -0
- package/dist/client/components/fields/upload-field.d.mts +97 -0
- package/dist/client/components/fields/upload-field.d.mts.map +1 -0
- package/dist/client/components/fields/upload-field.mjs +497 -0
- package/dist/client/components/fields/upload-field.mjs.map +1 -0
- package/dist/client/components/filter-builder/columns-tab.d.mts +1 -0
- package/dist/client/components/filter-builder/columns-tab.mjs +131 -0
- package/dist/client/components/filter-builder/columns-tab.mjs.map +1 -0
- package/dist/client/components/filter-builder/filter-builder-sheet.d.mts +1 -0
- package/dist/client/components/filter-builder/filter-builder-sheet.mjs +157 -0
- package/dist/client/components/filter-builder/filter-builder-sheet.mjs.map +1 -0
- package/dist/client/components/filter-builder/filters-tab.d.mts +1 -0
- package/dist/client/components/filter-builder/filters-tab.mjs +380 -0
- package/dist/client/components/filter-builder/filters-tab.mjs.map +1 -0
- package/dist/client/components/filter-builder/index.d.mts +5 -0
- package/dist/client/components/filter-builder/saved-views-tab.d.mts +1 -0
- package/dist/client/components/filter-builder/saved-views-tab.mjs +125 -0
- package/dist/client/components/filter-builder/saved-views-tab.mjs.map +1 -0
- package/dist/client/components/index.d.mts +80 -0
- package/dist/client/components/locale-switcher.d.mts +2 -0
- package/dist/client/components/locale-switcher.mjs +128 -0
- package/dist/client/components/locale-switcher.mjs.map +1 -0
- package/dist/client/components/media/media-grid.mjs +139 -0
- package/dist/client/components/media/media-grid.mjs.map +1 -0
- package/dist/client/components/media/media-picker-dialog.mjs +255 -0
- package/dist/client/components/media/media-picker-dialog.mjs.map +1 -0
- package/dist/client/components/preview/live-preview-mode.mjs +211 -0
- package/dist/client/components/preview/live-preview-mode.mjs.map +1 -0
- package/dist/client/components/preview/preview-pane.mjs +179 -0
- package/dist/client/components/preview/preview-pane.mjs.map +1 -0
- package/dist/client/components/primitives/asset-preview.mjs +363 -0
- package/dist/client/components/primitives/asset-preview.mjs.map +1 -0
- package/dist/client/components/primitives/checkbox-input.mjs +33 -0
- package/dist/client/components/primitives/checkbox-input.mjs.map +1 -0
- package/dist/client/components/primitives/date-input.mjs +218 -0
- package/dist/client/components/primitives/date-input.mjs.map +1 -0
- package/dist/client/components/primitives/dropzone.mjs +239 -0
- package/dist/client/components/primitives/dropzone.mjs.map +1 -0
- package/dist/client/components/primitives/number-input.mjs +113 -0
- package/dist/client/components/primitives/number-input.mjs.map +1 -0
- package/dist/client/components/primitives/select-multi.mjs +256 -0
- package/dist/client/components/primitives/select-multi.mjs.map +1 -0
- package/dist/client/components/primitives/select-single.mjs +183 -0
- package/dist/client/components/primitives/select-single.mjs.map +1 -0
- package/dist/client/components/primitives/text-input.mjs +40 -0
- package/dist/client/components/primitives/text-input.mjs.map +1 -0
- package/dist/client/components/primitives/textarea-input.mjs +38 -0
- package/dist/client/components/primitives/textarea-input.mjs.map +1 -0
- package/dist/client/components/primitives/time-input.mjs +72 -0
- package/dist/client/components/primitives/time-input.mjs.map +1 -0
- package/dist/client/components/primitives/toggle-input.mjs +31 -0
- package/dist/client/components/primitives/toggle-input.mjs.map +1 -0
- package/dist/client/components/primitives/types.d.mts +14 -0
- package/dist/client/components/primitives/types.d.mts.map +1 -0
- package/dist/client/components/primitives/types.mjs +13 -0
- package/dist/client/components/primitives/types.mjs.map +1 -0
- package/dist/client/components/sheets/index.d.mts +1 -0
- package/dist/client/components/sheets/resource-sheet.d.mts +1 -0
- package/dist/client/components/sheets/resource-sheet.mjs +78 -0
- package/dist/client/components/sheets/resource-sheet.mjs.map +1 -0
- package/dist/client/components/ui/accordion.d.mts +2 -0
- package/dist/client/components/ui/accordion.mjs +50 -0
- package/dist/client/components/ui/accordion.mjs.map +1 -0
- package/dist/client/components/ui/alert.mjs +32 -0
- package/dist/client/components/ui/alert.mjs.map +1 -0
- package/dist/client/components/ui/avatar.d.mts +3 -0
- package/dist/client/components/ui/badge.d.mts +3 -0
- package/dist/client/components/ui/badge.mjs +35 -0
- package/dist/client/components/ui/badge.mjs.map +1 -0
- package/dist/client/components/ui/button.d.mts +3 -0
- package/dist/client/components/ui/button.mjs +49 -0
- package/dist/client/components/ui/button.mjs.map +1 -0
- package/dist/client/components/ui/card.d.mts +2 -0
- package/dist/{card-BKHjBQfw.mjs → client/components/ui/card.mjs} +3 -10
- package/dist/{card-BKHjBQfw.mjs.map → client/components/ui/card.mjs.map} +1 -1
- package/dist/client/components/ui/checkbox.d.mts +2 -0
- package/dist/client/components/ui/checkbox.mjs +27 -0
- package/dist/client/components/ui/checkbox.mjs.map +1 -0
- package/dist/client/components/ui/combobox.d.mts +3 -0
- package/dist/client/components/ui/command.mjs +69 -0
- package/dist/client/components/ui/command.mjs.map +1 -0
- package/dist/client/components/ui/dialog.d.mts +3 -0
- package/dist/client/components/ui/dialog.mjs +83 -0
- package/dist/client/components/ui/dialog.mjs.map +1 -0
- package/dist/client/components/ui/drawer.mjs +75 -0
- package/dist/client/components/ui/drawer.mjs.map +1 -0
- package/dist/client/components/ui/dropdown-menu.d.mts +3 -0
- package/dist/client/components/ui/dropdown-menu.mjs +89 -0
- package/dist/client/components/ui/dropdown-menu.mjs.map +1 -0
- package/dist/client/components/ui/empty-state.mjs +53 -0
- package/dist/client/components/ui/empty-state.mjs.map +1 -0
- package/dist/client/components/ui/field.d.mts +3 -0
- package/dist/client/components/ui/field.mjs +78 -0
- package/dist/client/components/ui/field.mjs.map +1 -0
- package/dist/client/components/ui/input-group.d.mts +4 -0
- package/dist/client/components/ui/input-group.mjs +68 -0
- package/dist/client/components/ui/input-group.mjs.map +1 -0
- package/dist/client/components/ui/input.d.mts +2 -0
- package/dist/client/components/ui/input.mjs +17 -0
- package/dist/client/components/ui/input.mjs.map +1 -0
- package/dist/client/components/ui/kbd.mjs +24 -0
- package/dist/client/components/ui/kbd.mjs.map +1 -0
- package/dist/client/components/ui/label.d.mts +2 -0
- package/dist/client/components/ui/label.mjs +15 -0
- package/dist/client/components/ui/label.mjs.map +1 -0
- package/dist/client/components/ui/popover.d.mts +3 -0
- package/dist/client/components/ui/popover.mjs +49 -0
- package/dist/client/components/ui/popover.mjs.map +1 -0
- package/dist/client/components/ui/responsive-dialog.mjs +102 -0
- package/dist/client/components/ui/responsive-dialog.mjs.map +1 -0
- package/dist/client/components/ui/scroll-area.d.mts +2 -0
- package/dist/client/components/ui/search-input.mjs +74 -0
- package/dist/client/components/ui/search-input.mjs.map +1 -0
- package/dist/client/components/ui/select.d.mts +3 -0
- package/dist/client/components/ui/select.mjs +85 -0
- package/dist/client/components/ui/select.mjs.map +1 -0
- package/dist/client/components/ui/separator.d.mts +2 -0
- package/dist/client/components/ui/separator.mjs +17 -0
- package/dist/client/components/ui/separator.mjs.map +1 -0
- package/dist/client/components/ui/sheet.d.mts +3 -0
- package/dist/client/components/ui/sheet.mjs +78 -0
- package/dist/client/components/ui/sheet.mjs.map +1 -0
- package/dist/client/components/ui/sidebar.d.mts +8 -0
- package/dist/client/components/ui/sidebar.mjs +256 -0
- package/dist/client/components/ui/sidebar.mjs.map +1 -0
- package/dist/client/components/ui/skeleton.d.mts +1 -0
- package/dist/client/components/ui/skeleton.mjs +15 -0
- package/dist/client/components/ui/skeleton.mjs.map +1 -0
- package/dist/client/components/ui/sonner.d.mts +14 -0
- package/dist/client/components/ui/sonner.d.mts.map +1 -0
- package/dist/client/components/ui/sonner.mjs +55 -0
- package/dist/client/components/ui/sonner.mjs.map +1 -0
- package/dist/client/components/ui/spinner.d.mts +1 -0
- package/dist/client/components/ui/spinner.mjs +18 -0
- package/dist/client/components/ui/spinner.mjs.map +1 -0
- package/dist/client/components/ui/switch.d.mts +2 -0
- package/dist/client/components/ui/switch.mjs +23 -0
- package/dist/client/components/ui/switch.mjs.map +1 -0
- package/dist/client/components/ui/table.d.mts +2 -0
- package/dist/client/components/ui/table.mjs +66 -0
- package/dist/client/components/ui/table.mjs.map +1 -0
- package/dist/client/components/ui/tabs.d.mts +3 -0
- package/dist/client/components/ui/tabs.mjs +49 -0
- package/dist/client/components/ui/tabs.mjs.map +1 -0
- package/dist/client/components/ui/textarea.d.mts +2 -0
- package/dist/client/components/ui/textarea.mjs +15 -0
- package/dist/client/components/ui/textarea.mjs.map +1 -0
- package/dist/client/components/ui/toolbar.mjs +54 -0
- package/dist/client/components/ui/toolbar.mjs.map +1 -0
- package/dist/client/components/ui/tooltip.d.mts +2 -0
- package/dist/client/components/ui/tooltip.mjs +45 -0
- package/dist/client/components/ui/tooltip.mjs.map +1 -0
- package/dist/client/components/widgets/chart-widget.d.mts +57 -0
- package/dist/client/components/widgets/chart-widget.d.mts.map +1 -0
- package/dist/client/components/widgets/chart-widget.mjs +282 -0
- package/dist/client/components/widgets/chart-widget.mjs.map +1 -0
- package/dist/client/components/widgets/progress-widget.d.mts +41 -0
- package/dist/client/components/widgets/progress-widget.d.mts.map +1 -0
- package/dist/client/components/widgets/progress-widget.mjs +110 -0
- package/dist/client/components/widgets/progress-widget.mjs.map +1 -0
- package/dist/client/components/widgets/quick-actions-widget.d.mts +29 -0
- package/dist/client/components/widgets/quick-actions-widget.d.mts.map +1 -0
- package/dist/client/components/widgets/quick-actions-widget.mjs +121 -0
- package/dist/client/components/widgets/quick-actions-widget.mjs.map +1 -0
- package/dist/client/components/widgets/recent-items-widget.d.mts +51 -0
- package/dist/client/components/widgets/recent-items-widget.d.mts.map +1 -0
- package/dist/client/components/widgets/recent-items-widget.mjs +101 -0
- package/dist/client/components/widgets/recent-items-widget.mjs.map +1 -0
- package/dist/client/components/widgets/stats-widget.d.mts +55 -0
- package/dist/client/components/widgets/stats-widget.d.mts.map +1 -0
- package/dist/client/components/widgets/stats-widget.mjs +150 -0
- package/dist/client/components/widgets/stats-widget.mjs.map +1 -0
- package/dist/client/components/widgets/table-widget.d.mts +31 -0
- package/dist/client/components/widgets/table-widget.d.mts.map +1 -0
- package/dist/client/components/widgets/table-widget.mjs +139 -0
- package/dist/client/components/widgets/table-widget.mjs.map +1 -0
- package/dist/client/components/widgets/timeline-widget.d.mts +51 -0
- package/dist/client/components/widgets/timeline-widget.d.mts.map +1 -0
- package/dist/client/components/widgets/timeline-widget.mjs +168 -0
- package/dist/client/components/widgets/timeline-widget.mjs.map +1 -0
- package/dist/client/components/widgets/value-widget.d.mts +39 -0
- package/dist/client/components/widgets/value-widget.d.mts.map +1 -0
- package/dist/client/components/widgets/value-widget.mjs +111 -0
- package/dist/client/components/widgets/value-widget.mjs.map +1 -0
- package/dist/client/components/widgets/widget-skeletons.mjs +145 -0
- package/dist/client/components/widgets/widget-skeletons.mjs.map +1 -0
- package/dist/client/context/focus-context.d.mts +88 -0
- package/dist/client/context/focus-context.d.mts.map +1 -0
- package/dist/client/context/focus-context.mjs +178 -0
- package/dist/client/context/focus-context.mjs.map +1 -0
- package/dist/client/contexts/breadcrumb-context.mjs +32 -0
- package/dist/client/contexts/breadcrumb-context.mjs.map +1 -0
- package/dist/client/hooks/typed-hooks.d.mts +84 -0
- package/dist/client/hooks/typed-hooks.d.mts.map +1 -0
- package/dist/client/hooks/typed-hooks.mjs +272 -0
- package/dist/client/hooks/typed-hooks.mjs.map +1 -0
- package/dist/client/hooks/use-action.mjs +201 -0
- package/dist/client/hooks/use-action.mjs.map +1 -0
- package/dist/client/hooks/use-admin-config.mjs +40 -0
- package/dist/client/hooks/use-admin-config.mjs.map +1 -0
- package/dist/client/hooks/use-admin-preferences.mjs +68 -0
- package/dist/client/hooks/use-admin-preferences.mjs.map +1 -0
- package/dist/client/hooks/use-admin-routes.mjs +97 -0
- package/dist/client/hooks/use-admin-routes.mjs.map +1 -0
- package/dist/client/hooks/use-auth.d.mts +98 -0
- package/dist/client/hooks/use-auth.d.mts.map +1 -0
- package/dist/{use-auth-BoLmWtmU.mjs → client/hooks/use-auth.mjs} +3 -3
- package/dist/client/hooks/use-auth.mjs.map +1 -0
- package/dist/client/hooks/use-collection-fields.mjs +32 -0
- package/dist/client/hooks/use-collection-fields.mjs.map +1 -0
- package/dist/client/hooks/use-collection-meta.mjs +121 -0
- package/dist/client/hooks/use-collection-meta.mjs.map +1 -0
- package/dist/client/hooks/use-collection-schema.mjs +67 -0
- package/dist/client/hooks/use-collection-schema.mjs.map +1 -0
- package/dist/client/hooks/use-collection-validation.mjs +74 -0
- package/dist/client/hooks/use-collection-validation.mjs.map +1 -0
- package/dist/client/hooks/use-collection.d.mts +86 -0
- package/dist/client/hooks/use-collection.d.mts.map +1 -0
- package/dist/client/hooks/use-collection.mjs +214 -0
- package/dist/client/hooks/use-collection.mjs.map +1 -0
- package/dist/client/hooks/use-current-user.d.mts +57 -0
- package/dist/client/hooks/use-current-user.d.mts.map +1 -0
- package/dist/client/hooks/use-current-user.mjs +79 -0
- package/dist/client/hooks/use-current-user.mjs.map +1 -0
- package/dist/client/hooks/use-field-hooks.mjs +191 -0
- package/dist/client/hooks/use-field-hooks.mjs.map +1 -0
- package/dist/client/hooks/use-field-options.d.mts +90 -0
- package/dist/client/hooks/use-field-options.d.mts.map +1 -0
- package/dist/client/hooks/use-field-options.mjs +184 -0
- package/dist/client/hooks/use-field-options.mjs.map +1 -0
- package/dist/client/hooks/use-global-fields.mjs +27 -0
- package/dist/client/hooks/use-global-fields.mjs.map +1 -0
- package/dist/client/hooks/use-global-meta.mjs +59 -0
- package/dist/client/hooks/use-global-meta.mjs.map +1 -0
- package/dist/client/hooks/use-global-schema.mjs +33 -0
- package/dist/client/hooks/use-global-schema.mjs.map +1 -0
- package/dist/client/hooks/use-global.d.mts +40 -0
- package/dist/client/hooks/use-global.d.mts.map +1 -0
- package/dist/client/hooks/use-global.mjs +74 -0
- package/dist/client/hooks/use-global.mjs.map +1 -0
- package/dist/client/hooks/use-locks.mjs +245 -0
- package/dist/client/hooks/use-locks.mjs.map +1 -0
- package/dist/client/hooks/use-media-query.d.mts +23 -0
- package/dist/client/hooks/use-media-query.d.mts.map +1 -0
- package/dist/client/hooks/use-media-query.mjs +62 -0
- package/dist/client/hooks/use-media-query.mjs.map +1 -0
- package/dist/client/hooks/use-prefill-params.mjs +47 -0
- package/dist/client/hooks/use-prefill-params.mjs.map +1 -0
- package/dist/client/hooks/use-questpie-query-options.mjs +28 -0
- package/dist/client/hooks/use-questpie-query-options.mjs.map +1 -0
- package/dist/client/hooks/use-reactive-fields.d.mts +75 -0
- package/dist/client/hooks/use-reactive-fields.d.mts.map +1 -0
- package/dist/client/hooks/use-reactive-fields.mjs +164 -0
- package/dist/client/hooks/use-reactive-fields.mjs.map +1 -0
- package/dist/client/hooks/use-realtime-highlight.mjs +96 -0
- package/dist/client/hooks/use-realtime-highlight.mjs.map +1 -0
- package/dist/client/hooks/use-saved-views.mjs +65 -0
- package/dist/client/hooks/use-saved-views.mjs.map +1 -0
- package/dist/client/hooks/use-search.mjs +147 -0
- package/dist/client/hooks/use-search.mjs.map +1 -0
- package/dist/client/hooks/use-server-validation.mjs +199 -0
- package/dist/client/hooks/use-server-validation.mjs.map +1 -0
- package/dist/client/hooks/use-server-widget-data.d.mts +26 -0
- package/dist/client/hooks/use-server-widget-data.d.mts.map +1 -0
- package/dist/client/hooks/use-server-widget-data.mjs +40 -0
- package/dist/client/hooks/use-server-widget-data.mjs.map +1 -0
- package/dist/client/hooks/use-setup-status.d.mts +39 -0
- package/dist/client/hooks/use-setup-status.d.mts.map +1 -0
- package/dist/client/hooks/use-setup-status.mjs +50 -0
- package/dist/client/hooks/use-setup-status.mjs.map +1 -0
- package/dist/client/hooks/use-upload-collection.mjs +32 -0
- package/dist/client/hooks/use-upload-collection.mjs.map +1 -0
- package/dist/client/hooks/use-upload.d.mts +23 -0
- package/dist/client/hooks/use-upload.d.mts.map +1 -0
- package/dist/client/hooks/use-upload.mjs +145 -0
- package/dist/client/hooks/use-upload.mjs.map +1 -0
- package/dist/client/hooks/use-validation-error-map.mjs +53 -0
- package/dist/client/hooks/use-validation-error-map.mjs.map +1 -0
- package/dist/client/hooks/use-view-state.mjs +261 -0
- package/dist/client/hooks/use-view-state.mjs.map +1 -0
- package/dist/client/i18n/hooks.mjs +160 -0
- package/dist/client/i18n/hooks.mjs.map +1 -0
- package/dist/client/i18n/intl-cache.mjs +65 -0
- package/dist/client/i18n/intl-cache.mjs.map +1 -0
- package/dist/client/i18n/messages.mjs +7 -0
- package/dist/client/i18n/messages.mjs.map +1 -0
- package/dist/client/i18n/simple.d.mts +22 -0
- package/dist/client/i18n/simple.d.mts.map +1 -0
- package/dist/client/i18n/simple.mjs +157 -0
- package/dist/client/i18n/simple.mjs.map +1 -0
- package/dist/client/i18n/types.d.mts +110 -0
- package/dist/client/i18n/types.d.mts.map +1 -0
- package/dist/client/lib/utils.d.mts +1 -0
- package/dist/client/lib/utils.mjs +28 -0
- package/dist/client/lib/utils.mjs.map +1 -0
- package/dist/client/preview/block-scope-context.d.mts +74 -0
- package/dist/client/preview/block-scope-context.d.mts.map +1 -0
- package/dist/client/preview/block-scope-context.mjs +93 -0
- package/dist/client/preview/block-scope-context.mjs.map +1 -0
- package/dist/client/preview/index.d.mts +5 -0
- package/dist/client/preview/preview-banner.d.mts +46 -0
- package/dist/client/preview/preview-banner.d.mts.map +1 -0
- package/dist/client/preview/preview-banner.mjs +95 -0
- package/dist/client/preview/preview-banner.mjs.map +1 -0
- package/dist/client/preview/preview-field.d.mts +108 -0
- package/dist/client/preview/preview-field.d.mts.map +1 -0
- package/dist/client/preview/preview-field.mjs +125 -0
- package/dist/client/preview/preview-field.mjs.map +1 -0
- package/dist/client/preview/types.d.mts +115 -0
- package/dist/client/preview/types.d.mts.map +1 -0
- package/dist/client/preview/types.mjs +21 -0
- package/dist/client/preview/types.mjs.map +1 -0
- package/dist/client/preview/use-collection-preview.d.mts +71 -0
- package/dist/client/preview/use-collection-preview.d.mts.map +1 -0
- package/dist/client/preview/use-collection-preview.mjs +114 -0
- package/dist/client/preview/use-collection-preview.mjs.map +1 -0
- package/dist/client/runtime/content-locales-provider.d.mts +1 -0
- package/dist/client/runtime/content-locales-provider.mjs +85 -0
- package/dist/client/runtime/content-locales-provider.mjs.map +1 -0
- package/dist/client/runtime/index.d.mts +7 -0
- package/dist/client/runtime/index.mjs +8 -0
- package/dist/client/runtime/locale-scope.d.mts +2 -0
- package/dist/{runtime-6VZM878K.mjs → client/runtime/locale-scope.mjs} +3 -4
- package/dist/client/runtime/locale-scope.mjs.map +1 -0
- package/dist/client/runtime/provider.d.mts +10107 -0
- package/dist/client/runtime/provider.d.mts.map +1 -0
- package/dist/client/runtime/provider.mjs +229 -0
- package/dist/client/runtime/provider.mjs.map +1 -0
- package/dist/client/runtime/routes.d.mts +49 -0
- package/dist/client/runtime/routes.d.mts.map +1 -0
- package/dist/client/runtime/routes.mjs +107 -0
- package/dist/client/runtime/routes.mjs.map +1 -0
- package/dist/client/runtime/translations-provider.d.mts +2 -0
- package/dist/client/runtime/translations-provider.mjs +181 -0
- package/dist/client/runtime/translations-provider.mjs.map +1 -0
- package/dist/client/scope/index.d.mts +3 -0
- package/dist/client/scope/picker.d.mts +54 -0
- package/dist/client/scope/picker.d.mts.map +1 -0
- package/dist/client/scope/picker.mjs +161 -0
- package/dist/client/scope/picker.mjs.map +1 -0
- package/dist/client/scope/provider.d.mts +104 -0
- package/dist/client/scope/provider.d.mts.map +1 -0
- package/dist/client/scope/provider.mjs +159 -0
- package/dist/client/scope/provider.mjs.map +1 -0
- package/dist/client/scope/types.d.mts +112 -0
- package/dist/client/scope/types.d.mts.map +1 -0
- package/dist/client/styles/index.css +80 -0
- package/dist/client/utils/auto-expand-fields.mjs +65 -0
- package/dist/client/utils/auto-expand-fields.mjs.map +1 -0
- package/dist/client/utils/build-field-definitions-from-schema.mjs +256 -0
- package/dist/client/utils/build-field-definitions-from-schema.mjs.map +1 -0
- package/dist/client/utils/detect-relations.mjs +46 -0
- package/dist/client/utils/detect-relations.mjs.map +1 -0
- package/dist/client/utils/locale-to-flag.d.mts +118 -0
- package/dist/client/utils/locale-to-flag.d.mts.map +1 -0
- package/dist/client/utils/locale-to-flag.mjs +130 -0
- package/dist/client/utils/locale-to-flag.mjs.map +1 -0
- package/dist/client/utils/routes.mjs +196 -0
- package/dist/client/utils/routes.mjs.map +1 -0
- package/dist/client/views/auth/accept-invite-form.d.mts +73 -0
- package/dist/client/views/auth/accept-invite-form.d.mts.map +1 -0
- package/dist/client/views/auth/accept-invite-form.mjs +180 -0
- package/dist/client/views/auth/accept-invite-form.mjs.map +1 -0
- package/dist/client/views/auth/auth-layout.d.mts +44 -0
- package/dist/client/views/auth/auth-layout.d.mts.map +1 -0
- package/dist/client/views/auth/auth-layout.mjs +53 -0
- package/dist/client/views/auth/auth-layout.mjs.map +1 -0
- package/dist/client/views/auth/forgot-password-form.d.mts +59 -0
- package/dist/client/views/auth/forgot-password-form.d.mts.map +1 -0
- package/dist/{forgot-password-page-Bcp-An4Y.mjs → client/views/auth/forgot-password-form.mjs} +22 -89
- package/dist/client/views/auth/forgot-password-form.mjs.map +1 -0
- package/dist/client/views/auth/index.d.mts +7 -0
- package/dist/client/views/auth/invite-form.d.mts +1 -0
- package/dist/client/views/auth/invite-form.mjs +155 -0
- package/dist/client/views/auth/invite-form.mjs.map +1 -0
- package/dist/client/views/auth/login-form.d.mts +76 -0
- package/dist/client/views/auth/login-form.d.mts.map +1 -0
- package/dist/client/views/auth/login-form.mjs +167 -0
- package/dist/client/views/auth/login-form.mjs.map +1 -0
- package/dist/client/views/auth/reset-password-form.d.mts +66 -0
- package/dist/client/views/auth/reset-password-form.d.mts.map +1 -0
- package/dist/client/views/auth/reset-password-form.mjs +188 -0
- package/dist/client/views/auth/reset-password-form.mjs.map +1 -0
- package/dist/client/views/auth/setup-form.d.mts +61 -0
- package/dist/client/views/auth/setup-form.d.mts.map +1 -0
- package/dist/{setup-page-YAP_fzqh.mjs → client/views/auth/setup-form.mjs} +46 -124
- package/dist/client/views/auth/setup-form.mjs.map +1 -0
- package/dist/client/views/collection/auto-form-fields.d.mts +4 -0
- package/dist/client/views/collection/auto-form-fields.mjs +453 -0
- package/dist/client/views/collection/auto-form-fields.mjs.map +1 -0
- package/dist/client/views/collection/bulk-action-toolbar.mjs +291 -0
- package/dist/client/views/collection/bulk-action-toolbar.mjs.map +1 -0
- package/dist/client/views/collection/cells/complex-cells.d.mts +46 -0
- package/dist/client/views/collection/cells/complex-cells.d.mts.map +1 -0
- package/dist/client/views/collection/cells/complex-cells.mjs +327 -0
- package/dist/client/views/collection/cells/complex-cells.mjs.map +1 -0
- package/dist/client/views/collection/cells/index.d.mts +7 -0
- package/dist/client/views/collection/cells/primitive-cells.d.mts +76 -0
- package/dist/client/views/collection/cells/primitive-cells.d.mts.map +1 -0
- package/dist/client/views/collection/cells/primitive-cells.mjs +165 -0
- package/dist/client/views/collection/cells/primitive-cells.mjs.map +1 -0
- package/dist/client/views/collection/cells/relation-cells.d.mts +21 -0
- package/dist/client/views/collection/cells/relation-cells.d.mts.map +1 -0
- package/dist/client/views/collection/cells/relation-cells.mjs +105 -0
- package/dist/client/views/collection/cells/relation-cells.mjs.map +1 -0
- package/dist/client/views/collection/cells/shared/asset-thumbnail.d.mts +1 -0
- package/dist/client/views/collection/cells/shared/asset-thumbnail.mjs +189 -0
- package/dist/client/views/collection/cells/shared/asset-thumbnail.mjs.map +1 -0
- package/dist/client/views/collection/cells/shared/cell-helpers.d.mts +2 -0
- package/dist/client/views/collection/cells/shared/cell-helpers.mjs +78 -0
- package/dist/client/views/collection/cells/shared/cell-helpers.mjs.map +1 -0
- package/dist/client/views/collection/cells/shared/relation-chip.d.mts +1 -0
- package/dist/client/views/collection/cells/shared/relation-chip.mjs +37 -0
- package/dist/client/views/collection/cells/shared/relation-chip.mjs.map +1 -0
- package/dist/client/views/collection/cells/upload-cells.d.mts +25 -0
- package/dist/client/views/collection/cells/upload-cells.d.mts.map +1 -0
- package/dist/client/views/collection/cells/upload-cells.mjs +20 -0
- package/dist/client/views/collection/cells/upload-cells.mjs.map +1 -0
- package/dist/client/views/collection/columns/build-columns.d.mts +2 -0
- package/dist/client/views/collection/columns/build-columns.mjs +156 -0
- package/dist/client/views/collection/columns/build-columns.mjs.map +1 -0
- package/dist/client/views/collection/columns/column-defaults.d.mts +2 -0
- package/dist/client/views/collection/columns/column-defaults.mjs +108 -0
- package/dist/client/views/collection/columns/column-defaults.mjs.map +1 -0
- package/dist/client/views/collection/columns/index.d.mts +3 -0
- package/dist/client/views/collection/columns/types.d.mts +2 -0
- package/dist/client/views/collection/field-context.mjs +127 -0
- package/dist/client/views/collection/field-context.mjs.map +1 -0
- package/dist/client/views/collection/field-renderer.mjs +171 -0
- package/dist/client/views/collection/field-renderer.mjs.map +1 -0
- package/dist/client/views/collection/form-view.d.mts +112 -0
- package/dist/client/views/collection/form-view.d.mts.map +1 -0
- package/dist/client/views/collection/form-view.mjs +903 -0
- package/dist/client/views/collection/form-view.mjs.map +1 -0
- package/dist/client/views/collection/index.d.mts +9 -0
- package/dist/client/views/collection/table-view.d.mts +102 -0
- package/dist/client/views/collection/table-view.d.mts.map +1 -0
- package/dist/client/views/collection/table-view.mjs +695 -0
- package/dist/client/views/collection/table-view.mjs.map +1 -0
- package/dist/client/views/collection/view-skeletons.mjs +121 -0
- package/dist/client/views/collection/view-skeletons.mjs.map +1 -0
- package/dist/client/views/common/global-search.d.mts +1 -0
- package/dist/client/views/common/global-search.mjs +376 -0
- package/dist/client/views/common/global-search.mjs.map +1 -0
- package/dist/client/views/common/index.d.mts +1 -0
- package/dist/client/views/dashboard/dashboard-grid.mjs +385 -0
- package/dist/client/views/dashboard/dashboard-grid.mjs.map +1 -0
- package/dist/client/views/dashboard/dashboard-widget.mjs +178 -0
- package/dist/client/views/dashboard/dashboard-widget.mjs.map +1 -0
- package/dist/client/views/dashboard/widget-card.mjs +159 -0
- package/dist/client/views/dashboard/widget-card.mjs.map +1 -0
- package/dist/client/views/globals/global-form-view.d.mts +74 -0
- package/dist/client/views/globals/global-form-view.d.mts.map +1 -0
- package/dist/client/views/globals/global-form-view.mjs +181 -0
- package/dist/client/views/globals/global-form-view.mjs.map +1 -0
- package/dist/client/views/index.d.mts +28 -0
- package/dist/client/views/layout/admin-layout-provider.d.mts +140 -0
- package/dist/client/views/layout/admin-layout-provider.d.mts.map +1 -0
- package/dist/client/views/layout/admin-layout-provider.mjs +90 -0
- package/dist/client/views/layout/admin-layout-provider.mjs.map +1 -0
- package/dist/client/views/layout/admin-layout.d.mts +151 -0
- package/dist/client/views/layout/admin-layout.d.mts.map +1 -0
- package/dist/client/views/layout/admin-layout.mjs +144 -0
- package/dist/client/views/layout/admin-layout.mjs.map +1 -0
- package/dist/client/views/layout/admin-root.d.mts +7 -0
- package/dist/client/views/layout/admin-router.d.mts +125 -0
- package/dist/client/views/layout/admin-router.d.mts.map +1 -0
- package/dist/client/views/layout/admin-router.mjs +594 -0
- package/dist/client/views/layout/admin-router.mjs.map +1 -0
- package/dist/client/views/layout/admin-sidebar.d.mts +105 -0
- package/dist/client/views/layout/admin-sidebar.d.mts.map +1 -0
- package/dist/client/views/layout/admin-sidebar.mjs +550 -0
- package/dist/client/views/layout/admin-sidebar.mjs.map +1 -0
- package/dist/client/views/layout/admin-topbar.mjs +128 -0
- package/dist/client/views/layout/admin-topbar.mjs.map +1 -0
- package/dist/client/views/layout/index.d.mts +5 -0
- package/dist/client/views/pages/accept-invite-page.d.mts +67 -0
- package/dist/client/views/pages/accept-invite-page.d.mts.map +1 -0
- package/dist/client/views/pages/accept-invite-page.mjs +143 -0
- package/dist/client/views/pages/accept-invite-page.mjs.map +1 -0
- package/dist/client/views/pages/dashboard-page.d.mts +52 -0
- package/dist/client/views/pages/dashboard-page.d.mts.map +1 -0
- package/dist/client/views/pages/dashboard-page.mjs +45 -0
- package/dist/client/views/pages/dashboard-page.mjs.map +1 -0
- package/dist/client/views/pages/forgot-password-page.d.mts +59 -0
- package/dist/client/views/pages/forgot-password-page.d.mts.map +1 -0
- package/dist/client/views/pages/forgot-password-page.mjs +80 -0
- package/dist/client/views/pages/forgot-password-page.mjs.map +1 -0
- package/dist/client/views/pages/index.d.mts +7 -0
- package/dist/client/views/pages/invite-page.d.mts +71 -0
- package/dist/client/views/pages/invite-page.d.mts.map +1 -0
- package/dist/client/views/pages/invite-page.mjs +86 -0
- package/dist/client/views/pages/invite-page.mjs.map +1 -0
- package/dist/client/views/pages/login-page.d.mts +76 -0
- package/dist/client/views/pages/login-page.d.mts.map +1 -0
- package/dist/client/views/pages/login-page.mjs +98 -0
- package/dist/client/views/pages/login-page.mjs.map +1 -0
- package/dist/client/views/pages/reset-password-page.d.mts +66 -0
- package/dist/client/views/pages/reset-password-page.d.mts.map +1 -0
- package/dist/client/views/pages/reset-password-page.mjs +105 -0
- package/dist/client/views/pages/reset-password-page.mjs.map +1 -0
- package/dist/client/views/pages/setup-page.d.mts +64 -0
- package/dist/client/views/pages/setup-page.d.mts.map +1 -0
- package/dist/client/views/pages/setup-page.mjs +91 -0
- package/dist/client/views/pages/setup-page.mjs.map +1 -0
- package/dist/client.d.mts +92 -3
- package/dist/client.d.mts.map +1 -0
- package/dist/client.mjs +54 -12
- package/dist/components/rich-text/index.d.mts +1 -0
- package/dist/components/rich-text/rich-text-renderer.d.mts +104 -0
- package/dist/components/rich-text/rich-text-renderer.d.mts.map +1 -0
- package/dist/components/rich-text/rich-text-renderer.mjs +210 -0
- package/dist/components/rich-text/rich-text-renderer.mjs.map +1 -0
- package/dist/index.d.mts +62 -3
- package/dist/index.mjs +54 -12
- package/dist/server/adapters/nextjs.d.mts +121 -0
- package/dist/server/adapters/nextjs.d.mts.map +1 -0
- package/dist/server/adapters/nextjs.mjs +111 -0
- package/dist/server/adapters/nextjs.mjs.map +1 -0
- package/dist/server/adapters/tanstack.d.mts +133 -0
- package/dist/server/adapters/tanstack.d.mts.map +1 -0
- package/dist/server/adapters/tanstack.mjs +90 -0
- package/dist/server/adapters/tanstack.mjs.map +1 -0
- package/dist/server/augmentation.d.mts +1523 -0
- package/dist/server/augmentation.d.mts.map +1 -0
- package/dist/server/auth-helpers.d.mts +143 -0
- package/dist/server/auth-helpers.d.mts.map +1 -0
- package/dist/server/auth-helpers.mjs +108 -0
- package/dist/server/auth-helpers.mjs.map +1 -0
- package/dist/server/block/block-builder.d.mts +319 -0
- package/dist/server/block/block-builder.d.mts.map +1 -0
- package/dist/server/block/block-builder.mjs +217 -0
- package/dist/server/block/block-builder.mjs.map +1 -0
- package/dist/server/block/index.d.mts +3 -0
- package/dist/server/block/introspection.d.mts +84 -0
- package/dist/server/block/introspection.d.mts.map +1 -0
- package/dist/server/block/introspection.mjs +89 -0
- package/dist/server/block/introspection.mjs.map +1 -0
- package/dist/server/block/prefetch.d.mts +78 -0
- package/dist/server/block/prefetch.d.mts.map +1 -0
- package/dist/server/block/prefetch.mjs +240 -0
- package/dist/server/block/prefetch.mjs.map +1 -0
- package/dist/server/fields/blocks.d.mts +139 -0
- package/dist/server/fields/blocks.d.mts.map +1 -0
- package/dist/server/fields/blocks.mjs +192 -0
- package/dist/server/fields/blocks.mjs.map +1 -0
- package/dist/server/fields/index.d.mts +48 -0
- package/dist/server/fields/index.d.mts.map +1 -0
- package/dist/server/fields/index.mjs +16 -0
- package/dist/server/fields/index.mjs.map +1 -0
- package/dist/server/fields/rich-text.d.mts +135 -0
- package/dist/server/fields/rich-text.d.mts.map +1 -0
- package/dist/server/fields/rich-text.mjs +188 -0
- package/dist/server/fields/rich-text.mjs.map +1 -0
- package/dist/server/i18n/index.d.mts +16 -0
- package/dist/server/i18n/index.d.mts.map +1 -0
- package/dist/server/i18n/index.mjs +44 -0
- package/dist/server/i18n/index.mjs.map +1 -0
- package/dist/server/i18n/messages/cs.mjs +461 -0
- package/dist/server/i18n/messages/cs.mjs.map +1 -0
- package/dist/server/i18n/messages/de.mjs +461 -0
- package/dist/server/i18n/messages/de.mjs.map +1 -0
- package/dist/server/i18n/messages/en.mjs +493 -0
- package/dist/server/i18n/messages/en.mjs.map +1 -0
- package/dist/server/i18n/messages/es.mjs +461 -0
- package/dist/server/i18n/messages/es.mjs.map +1 -0
- package/dist/server/i18n/messages/fr.mjs +461 -0
- package/dist/server/i18n/messages/fr.mjs.map +1 -0
- package/dist/server/i18n/messages/index.mjs +24 -0
- package/dist/server/i18n/messages/index.mjs.map +1 -0
- package/dist/server/i18n/messages/pl.mjs +461 -0
- package/dist/server/i18n/messages/pl.mjs.map +1 -0
- package/dist/server/i18n/messages/pt.mjs +464 -0
- package/dist/server/i18n/messages/pt.mjs.map +1 -0
- package/dist/server/i18n/messages/sk.mjs +490 -0
- package/dist/server/i18n/messages/sk.mjs.map +1 -0
- package/dist/server/index.d.mts +20 -0
- package/dist/server/modules/admin/functions/admin-config.mjs +348 -0
- package/dist/server/modules/admin/functions/admin-config.mjs.map +1 -0
- package/dist/server/modules/admin/functions/execute-action.d.mts +107 -0
- package/dist/server/modules/admin/functions/execute-action.d.mts.map +1 -0
- package/dist/server/modules/admin/functions/execute-action.mjs +331 -0
- package/dist/server/modules/admin/functions/execute-action.mjs.map +1 -0
- package/dist/server/modules/admin/functions/locales.mjs +80 -0
- package/dist/server/modules/admin/functions/locales.mjs.map +1 -0
- package/dist/server/modules/admin/functions/preview.d.mts +70 -0
- package/dist/server/modules/admin/functions/preview.d.mts.map +1 -0
- package/dist/server/modules/admin/functions/preview.mjs +243 -0
- package/dist/server/modules/admin/functions/preview.mjs.map +1 -0
- package/dist/server/modules/admin/functions/reactive.d.mts +99 -0
- package/dist/server/modules/admin/functions/reactive.d.mts.map +1 -0
- package/dist/server/modules/admin/functions/reactive.mjs +378 -0
- package/dist/server/modules/admin/functions/reactive.mjs.map +1 -0
- package/dist/server/modules/admin/functions/setup.d.mts +84 -0
- package/dist/server/modules/admin/functions/setup.d.mts.map +1 -0
- package/dist/server/modules/admin/functions/setup.mjs +131 -0
- package/dist/server/modules/admin/functions/setup.mjs.map +1 -0
- package/dist/server/modules/admin/functions/translations.mjs +125 -0
- package/dist/server/modules/admin/functions/translations.mjs.map +1 -0
- package/dist/server/modules/admin/functions/widget-data.d.mts +33 -0
- package/dist/server/modules/admin/functions/widget-data.d.mts.map +1 -0
- package/dist/server/modules/admin/functions/widget-data.mjs +70 -0
- package/dist/server/modules/admin/functions/widget-data.mjs.map +1 -0
- package/dist/server/modules/admin/index.d.mts +16879 -0
- package/dist/server/modules/admin/index.d.mts.map +1 -0
- package/dist/server/modules/admin/index.mjs +249 -0
- package/dist/server/modules/admin/index.mjs.map +1 -0
- package/dist/server/modules/admin-preferences/collections/admin-preferences.collection.d.mts +3 -0
- package/dist/server/modules/admin-preferences/collections/admin-preferences.collection.mjs +48 -0
- package/dist/server/modules/admin-preferences/collections/admin-preferences.collection.mjs.map +1 -0
- package/dist/server/modules/admin-preferences/collections/locks.collection.d.mts +3 -0
- package/dist/server/modules/admin-preferences/collections/locks.collection.mjs +79 -0
- package/dist/server/modules/admin-preferences/collections/locks.collection.mjs.map +1 -0
- package/dist/server/modules/admin-preferences/collections/saved-views.collection.d.mts +1490 -0
- package/dist/server/modules/admin-preferences/collections/saved-views.collection.d.mts.map +1 -0
- package/dist/server/modules/admin-preferences/collections/saved-views.collection.mjs +57 -0
- package/dist/server/modules/admin-preferences/collections/saved-views.collection.mjs.map +1 -0
- package/dist/server/patch.d.mts +100 -0
- package/dist/server/patch.d.mts.map +1 -0
- package/dist/server/patch.mjs +1062 -0
- package/dist/server/patch.mjs.map +1 -0
- package/dist/server.d.mts +21 -250
- package/dist/server.mjs +19 -832
- package/dist/shared/preview-utils.d.mts +54 -0
- package/dist/shared/preview-utils.d.mts.map +1 -0
- package/dist/{preview-utils-BKQ9-TMa.mjs → shared/preview-utils.mjs} +2 -2
- package/dist/shared/preview-utils.mjs.map +1 -0
- package/dist/{saved-views.types-BMsz5mCy.d.mts → shared/types/saved-views.types.d.mts} +7 -2
- package/dist/shared/types/saved-views.types.d.mts.map +1 -0
- package/dist/shared.d.mts +3 -57
- package/dist/shared.mjs +1 -1
- package/package.json +12 -17
- package/dist/auth-layout-M8K8_q5R.mjs +0 -181
- package/dist/auth-layout-M8K8_q5R.mjs.map +0 -1
- package/dist/bulk-upload-dialog-D7w7W1Hl.mjs +0 -273
- package/dist/bulk-upload-dialog-D7w7W1Hl.mjs.map +0 -1
- package/dist/client-B7r47hEd.d.mts +0 -13403
- package/dist/client-B7r47hEd.d.mts.map +0 -1
- package/dist/client-njX1rZmi.mjs +0 -22612
- package/dist/client-njX1rZmi.mjs.map +0 -1
- package/dist/content-locales-provider-BXvuIgfg.mjs +0 -1650
- package/dist/content-locales-provider-BXvuIgfg.mjs.map +0 -1
- package/dist/dashboard-page-B4PGEdc2.mjs +0 -2500
- package/dist/dashboard-page-B4PGEdc2.mjs.map +0 -1
- package/dist/dashboard-page-mCY0pgZv.mjs +0 -3
- package/dist/dropzone-Do3awXKd.mjs +0 -634
- package/dist/dropzone-Do3awXKd.mjs.map +0 -1
- package/dist/forgot-password-page-Bcp-An4Y.mjs.map +0 -1
- package/dist/forgot-password-page-CEwsdLwn.mjs +0 -3
- package/dist/index-BYyqkWtn.d.mts +0 -2753
- package/dist/index-BYyqkWtn.d.mts.map +0 -1
- package/dist/login-page-BUnpCbCa.mjs +0 -3
- package/dist/login-page-CP4gA-dl.mjs +0 -298
- package/dist/login-page-CP4gA-dl.mjs.map +0 -1
- package/dist/preview-utils-BKQ9-TMa.mjs.map +0 -1
- package/dist/reset-password-page-BqfDmLxA.mjs +0 -281
- package/dist/reset-password-page-BqfDmLxA.mjs.map +0 -1
- package/dist/reset-password-page-CufHz3h3.mjs +0 -3
- package/dist/runtime-6VZM878K.mjs.map +0 -1
- package/dist/saved-views.types-BMsz5mCy.d.mts.map +0 -1
- package/dist/server.d.mts.map +0 -1
- package/dist/server.mjs.map +0 -1
- package/dist/setup-page-BNNzt_Z6.mjs +0 -3
- package/dist/setup-page-YAP_fzqh.mjs.map +0 -1
- package/dist/shared.d.mts.map +0 -1
- package/dist/use-auth-BoLmWtmU.mjs.map +0 -1
package/dist/server.mjs
CHANGED
|
@@ -1,832 +1,19 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
6
|
-
import {
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
* request: context.request,
|
|
21
|
-
* cms,
|
|
22
|
-
* loginPath: "/admin/login",
|
|
23
|
-
* });
|
|
24
|
-
* if (redirect) throw redirect;
|
|
25
|
-
* },
|
|
26
|
-
* });
|
|
27
|
-
* ```
|
|
28
|
-
*
|
|
29
|
-
* @example Next.js Middleware
|
|
30
|
-
* ```ts
|
|
31
|
-
* export async function middleware(request: NextRequest) {
|
|
32
|
-
* const redirect = await requireAdminAuth({
|
|
33
|
-
* request,
|
|
34
|
-
* cms,
|
|
35
|
-
* loginPath: "/admin/login",
|
|
36
|
-
* });
|
|
37
|
-
* if (redirect) return redirect;
|
|
38
|
-
* return NextResponse.next();
|
|
39
|
-
* }
|
|
40
|
-
* ```
|
|
41
|
-
*/
|
|
42
|
-
async function requireAdminAuth({ request, cms, loginPath = "/admin/login", requiredRole = "admin", redirectParam = "redirect" }) {
|
|
43
|
-
if (!cms.auth) {
|
|
44
|
-
console.warn("requireAdminAuth: Auth not configured on CMS instance");
|
|
45
|
-
return null;
|
|
46
|
-
}
|
|
47
|
-
try {
|
|
48
|
-
const session = await cms.auth.api.getSession({ headers: request.headers });
|
|
49
|
-
if (!session || !session.user) {
|
|
50
|
-
const currentUrl = new URL(request.url);
|
|
51
|
-
const redirectUrl = new URL(loginPath, currentUrl.origin);
|
|
52
|
-
redirectUrl.searchParams.set(redirectParam, currentUrl.pathname);
|
|
53
|
-
return Response.redirect(redirectUrl.toString(), 302);
|
|
54
|
-
}
|
|
55
|
-
if (session.user.role !== requiredRole) {
|
|
56
|
-
const currentUrl = new URL(request.url);
|
|
57
|
-
const redirectUrl = new URL(loginPath, currentUrl.origin);
|
|
58
|
-
redirectUrl.searchParams.set(redirectParam, currentUrl.pathname);
|
|
59
|
-
return Response.redirect(redirectUrl.toString(), 302);
|
|
60
|
-
}
|
|
61
|
-
return null;
|
|
62
|
-
} catch (error) {
|
|
63
|
-
console.error("requireAdminAuth: Error checking session", error);
|
|
64
|
-
const currentUrl = new URL(request.url);
|
|
65
|
-
const redirectUrl = new URL(loginPath, currentUrl.origin);
|
|
66
|
-
return Response.redirect(redirectUrl.toString(), 302);
|
|
67
|
-
}
|
|
68
|
-
}
|
|
69
|
-
/**
|
|
70
|
-
* Get the current admin session on the server.
|
|
71
|
-
* Returns null if not authenticated.
|
|
72
|
-
*
|
|
73
|
-
* Use this when you need access to the session data in server code.
|
|
74
|
-
*
|
|
75
|
-
* @example
|
|
76
|
-
* ```ts
|
|
77
|
-
* const session = await getAdminSession({ request, cms });
|
|
78
|
-
* if (!session) {
|
|
79
|
-
* return redirect("/admin/login");
|
|
80
|
-
* }
|
|
81
|
-
* console.log("User:", session.user.name);
|
|
82
|
-
* ```
|
|
83
|
-
*/
|
|
84
|
-
async function getAdminSession({ request, cms }) {
|
|
85
|
-
if (!cms.auth) return null;
|
|
86
|
-
try {
|
|
87
|
-
const session = await cms.auth.api.getSession({ headers: request.headers });
|
|
88
|
-
if (!session || !session.user) return null;
|
|
89
|
-
return session;
|
|
90
|
-
} catch (error) {
|
|
91
|
-
console.error("getAdminSession: Error getting session", error);
|
|
92
|
-
return null;
|
|
93
|
-
}
|
|
94
|
-
}
|
|
95
|
-
/**
|
|
96
|
-
* Check if the current user has admin role on the server.
|
|
97
|
-
*
|
|
98
|
-
* @example
|
|
99
|
-
* ```ts
|
|
100
|
-
* const isAdmin = await isAdminUser({ request, cms });
|
|
101
|
-
* if (!isAdmin) {
|
|
102
|
-
* return json({ error: "Unauthorized" }, { status: 403 });
|
|
103
|
-
* }
|
|
104
|
-
* ```
|
|
105
|
-
*/
|
|
106
|
-
async function isAdminUser({ request, cms, requiredRole = "admin" }) {
|
|
107
|
-
return ((await getAdminSession({
|
|
108
|
-
request,
|
|
109
|
-
cms
|
|
110
|
-
}))?.user)?.role === requiredRole;
|
|
111
|
-
}
|
|
112
|
-
|
|
113
|
-
//#endregion
|
|
114
|
-
//#region src/server/adapters/tanstack.ts
|
|
115
|
-
/**
|
|
116
|
-
* Create a TanStack Router beforeLoad guard for admin authentication.
|
|
117
|
-
*
|
|
118
|
-
* Returns a function that can be used as beforeLoad in route definitions.
|
|
119
|
-
* Throws a redirect Response when authentication fails.
|
|
120
|
-
*
|
|
121
|
-
* @example
|
|
122
|
-
* ```ts
|
|
123
|
-
* import { createFileRoute } from "@tanstack/react-router";
|
|
124
|
-
* import { createTanStackAuthGuard } from "@questpie/admin/server/adapters/tanstack";
|
|
125
|
-
* import { cms } from "~/questpie/server/cms";
|
|
126
|
-
*
|
|
127
|
-
* export const Route = createFileRoute("/admin")({
|
|
128
|
-
* beforeLoad: createTanStackAuthGuard({
|
|
129
|
-
* cms,
|
|
130
|
-
* loginPath: "/admin/login",
|
|
131
|
-
* requiredRole: "admin",
|
|
132
|
-
* }),
|
|
133
|
-
* component: AdminLayout,
|
|
134
|
-
* });
|
|
135
|
-
* ```
|
|
136
|
-
*
|
|
137
|
-
* @example With custom context
|
|
138
|
-
* ```ts
|
|
139
|
-
* export const Route = createFileRoute("/admin")({
|
|
140
|
-
* beforeLoad: async (ctx) => {
|
|
141
|
-
* // Run auth guard
|
|
142
|
-
* await createTanStackAuthGuard({ cms })(ctx);
|
|
143
|
-
*
|
|
144
|
-
* // Add additional context
|
|
145
|
-
* return { user: ctx.context.user };
|
|
146
|
-
* },
|
|
147
|
-
* });
|
|
148
|
-
* ```
|
|
149
|
-
*/
|
|
150
|
-
function createTanStackAuthGuard({ cms, loginPath = "/admin/login", requiredRole = "admin", redirectParam = "redirect" }) {
|
|
151
|
-
return async function beforeLoad({ context }) {
|
|
152
|
-
const request = context.request;
|
|
153
|
-
if (!request) {
|
|
154
|
-
console.warn("createTanStackAuthGuard: No request in context. Make sure you're using TanStack Start with SSR enabled.");
|
|
155
|
-
return;
|
|
156
|
-
}
|
|
157
|
-
const redirect = await requireAdminAuth({
|
|
158
|
-
request,
|
|
159
|
-
cms,
|
|
160
|
-
loginPath,
|
|
161
|
-
requiredRole,
|
|
162
|
-
redirectParam
|
|
163
|
-
});
|
|
164
|
-
if (redirect) throw redirect;
|
|
165
|
-
};
|
|
166
|
-
}
|
|
167
|
-
/**
|
|
168
|
-
* Create a TanStack Router loader that injects the admin session into context.
|
|
169
|
-
*
|
|
170
|
-
* Use this when you need access to the session in your components.
|
|
171
|
-
*
|
|
172
|
-
* @example
|
|
173
|
-
* ```ts
|
|
174
|
-
* import { createTanStackSessionLoader } from "@questpie/admin/server/adapters/tanstack";
|
|
175
|
-
*
|
|
176
|
-
* export const Route = createFileRoute("/admin")({
|
|
177
|
-
* loader: createTanStackSessionLoader({ cms }),
|
|
178
|
-
* component: AdminLayout,
|
|
179
|
-
* });
|
|
180
|
-
*
|
|
181
|
-
* function AdminLayout() {
|
|
182
|
-
* const { session } = Route.useLoaderData();
|
|
183
|
-
* return <div>Hello {session?.user?.name}</div>;
|
|
184
|
-
* }
|
|
185
|
-
* ```
|
|
186
|
-
*/
|
|
187
|
-
function createTanStackSessionLoader({ cms }) {
|
|
188
|
-
return async function loader({ context }) {
|
|
189
|
-
const request = context.request;
|
|
190
|
-
if (!request || !cms.auth) return { session: null };
|
|
191
|
-
try {
|
|
192
|
-
return { session: await cms.auth.api.getSession({ headers: request.headers }) ?? null };
|
|
193
|
-
} catch {
|
|
194
|
-
return { session: null };
|
|
195
|
-
}
|
|
196
|
-
};
|
|
197
|
-
}
|
|
198
|
-
|
|
199
|
-
//#endregion
|
|
200
|
-
//#region src/server/adapters/nextjs.ts
|
|
201
|
-
/**
|
|
202
|
-
* Check if a path matches any of the given patterns
|
|
203
|
-
*/
|
|
204
|
-
function pathMatches(pathname, patterns) {
|
|
205
|
-
return patterns.some((pattern) => pathname === pattern || pathname.startsWith(`${pattern}/`) || pathname.startsWith(pattern));
|
|
206
|
-
}
|
|
207
|
-
/**
|
|
208
|
-
* Create a Next.js middleware for admin authentication.
|
|
209
|
-
*
|
|
210
|
-
* @example
|
|
211
|
-
* ```ts
|
|
212
|
-
* // middleware.ts
|
|
213
|
-
* import { createNextAuthMiddleware } from "@questpie/admin/server/adapters/nextjs";
|
|
214
|
-
* import { cms } from "./questpie/server/cms";
|
|
215
|
-
*
|
|
216
|
-
* export default createNextAuthMiddleware({
|
|
217
|
-
* cms,
|
|
218
|
-
* loginPath: "/admin/login",
|
|
219
|
-
* });
|
|
220
|
-
*
|
|
221
|
-
* export const config = {
|
|
222
|
-
* matcher: ["/admin/:path*"],
|
|
223
|
-
* };
|
|
224
|
-
* ```
|
|
225
|
-
*/
|
|
226
|
-
function createNextAuthMiddleware({ cms, loginPath = "/admin/login", requiredRole = "admin", protectedPaths = ["/admin"], publicPaths = [
|
|
227
|
-
"/admin/login",
|
|
228
|
-
"/admin/forgot-password",
|
|
229
|
-
"/admin/reset-password",
|
|
230
|
-
"/admin/accept-invite"
|
|
231
|
-
], redirectParam = "redirect" }) {
|
|
232
|
-
return async function middleware(request) {
|
|
233
|
-
const pathname = new URL(request.url).pathname;
|
|
234
|
-
const isProtected = pathMatches(pathname, protectedPaths);
|
|
235
|
-
const isPublic = pathMatches(pathname, publicPaths);
|
|
236
|
-
if (!isProtected || isPublic) return new Response(null, {
|
|
237
|
-
status: 200,
|
|
238
|
-
headers: { "x-middleware-next": "1" }
|
|
239
|
-
});
|
|
240
|
-
const redirect = await requireAdminAuth({
|
|
241
|
-
request,
|
|
242
|
-
cms,
|
|
243
|
-
loginPath,
|
|
244
|
-
requiredRole,
|
|
245
|
-
redirectParam
|
|
246
|
-
});
|
|
247
|
-
if (redirect) return redirect;
|
|
248
|
-
return new Response(null, {
|
|
249
|
-
status: 200,
|
|
250
|
-
headers: { "x-middleware-next": "1" }
|
|
251
|
-
});
|
|
252
|
-
};
|
|
253
|
-
}
|
|
254
|
-
/**
|
|
255
|
-
* Get the admin session in a Next.js server component or API route.
|
|
256
|
-
*
|
|
257
|
-
* @example Server Component
|
|
258
|
-
* ```tsx
|
|
259
|
-
* // app/admin/layout.tsx
|
|
260
|
-
* import { getNextAdminSession } from "@questpie/admin/server/adapters/nextjs";
|
|
261
|
-
* import { headers } from "next/headers";
|
|
262
|
-
* import { cms } from "~/questpie/server/cms";
|
|
263
|
-
*
|
|
264
|
-
* export default async function AdminLayout({ children }) {
|
|
265
|
-
* const headersList = headers();
|
|
266
|
-
* const session = await getNextAdminSession({
|
|
267
|
-
* headers: headersList,
|
|
268
|
-
* cms,
|
|
269
|
-
* });
|
|
270
|
-
*
|
|
271
|
-
* if (!session) {
|
|
272
|
-
* redirect("/admin/login");
|
|
273
|
-
* }
|
|
274
|
-
*
|
|
275
|
-
* return <div>{children}</div>;
|
|
276
|
-
* }
|
|
277
|
-
* ```
|
|
278
|
-
*
|
|
279
|
-
* @example API Route
|
|
280
|
-
* ```ts
|
|
281
|
-
* // app/api/admin/users/route.ts
|
|
282
|
-
* import { getNextAdminSession } from "@questpie/admin/server/adapters/nextjs";
|
|
283
|
-
* import { cms } from "~/questpie/server/cms";
|
|
284
|
-
*
|
|
285
|
-
* export async function GET(request: Request) {
|
|
286
|
-
* const session = await getNextAdminSession({
|
|
287
|
-
* headers: request.headers,
|
|
288
|
-
* cms,
|
|
289
|
-
* });
|
|
290
|
-
*
|
|
291
|
-
* if (!session || session.user.role !== "admin") {
|
|
292
|
-
* return Response.json({ error: "Unauthorized" }, { status: 401 });
|
|
293
|
-
* }
|
|
294
|
-
*
|
|
295
|
-
* // ... handle request
|
|
296
|
-
* }
|
|
297
|
-
* ```
|
|
298
|
-
*/
|
|
299
|
-
async function getNextAdminSession({ headers, cms }) {
|
|
300
|
-
return getAdminSession({
|
|
301
|
-
request: new Request("http://localhost", { headers }),
|
|
302
|
-
cms
|
|
303
|
-
});
|
|
304
|
-
}
|
|
305
|
-
|
|
306
|
-
//#endregion
|
|
307
|
-
//#region src/server/modules/admin-preferences/collections/admin-preferences.collection.ts
|
|
308
|
-
/**
|
|
309
|
-
* Admin Preferences Collection
|
|
310
|
-
*
|
|
311
|
-
* Stores user-specific preferences for admin UI state.
|
|
312
|
-
* This includes view configurations (columns, filters, sort)
|
|
313
|
-
* that persist across devices and sessions.
|
|
314
|
-
*
|
|
315
|
-
* Key format: "viewState:{collectionName}" for view state preferences
|
|
316
|
-
*
|
|
317
|
-
* @example
|
|
318
|
-
* ```ts
|
|
319
|
-
* import { adminModule } from "@questpie/admin/server";
|
|
320
|
-
*
|
|
321
|
-
* const cms = q({ name: "my-app" })
|
|
322
|
-
* .use(adminModule)
|
|
323
|
-
* .collections({ ... })
|
|
324
|
-
* .build({ ... });
|
|
325
|
-
*
|
|
326
|
-
* // Access preferences
|
|
327
|
-
* const prefs = await cms.api.collections.admin_preferences.findOne({
|
|
328
|
-
* where: { userId: currentUser.id, key: "viewState:posts" }
|
|
329
|
-
* });
|
|
330
|
-
* ```
|
|
331
|
-
*/
|
|
332
|
-
const adminPreferencesCollection = q.collection("admin_preferences").fields({
|
|
333
|
-
userId: varchar("user_id", { length: 255 }).notNull(),
|
|
334
|
-
key: varchar("key", { length: 255 }).notNull(),
|
|
335
|
-
value: jsonb("value").notNull()
|
|
336
|
-
}).options({ timestamps: true }).indexes(({ table }) => [uniqueIndex("admin_preferences_user_key_idx").on(table.userId, table.key)]);
|
|
337
|
-
|
|
338
|
-
//#endregion
|
|
339
|
-
//#region src/server/modules/admin-preferences/collections/saved-views.collection.ts
|
|
340
|
-
/**
|
|
341
|
-
* Admin Saved Views Collection
|
|
342
|
-
*
|
|
343
|
-
* Stores user-specific view configurations for collection lists.
|
|
344
|
-
* Each view can contain:
|
|
345
|
-
* - Filter rules (field/operator/value combinations)
|
|
346
|
-
* - Sort configuration (field/direction)
|
|
347
|
-
* - Visible columns selection
|
|
348
|
-
*
|
|
349
|
-
* @example
|
|
350
|
-
* ```ts
|
|
351
|
-
* import { adminModule } from "@questpie/admin/server";
|
|
352
|
-
*
|
|
353
|
-
* const cms = q({ name: "my-app" })
|
|
354
|
-
* .use(starterModule)
|
|
355
|
-
* .use(adminModule)
|
|
356
|
-
* .collections({ ... })
|
|
357
|
-
* .build({ ... });
|
|
358
|
-
*
|
|
359
|
-
* // Access saved views
|
|
360
|
-
* const views = await cms.api.collections.adminSavedViews.find({
|
|
361
|
-
* where: { collectionName: "posts", userId: currentUser.id }
|
|
362
|
-
* });
|
|
363
|
-
* ```
|
|
364
|
-
*/
|
|
365
|
-
const savedViewsCollection = q.collection("admin_saved_views").fields({
|
|
366
|
-
userId: varchar("user_id", { length: 255 }).notNull(),
|
|
367
|
-
collectionName: varchar("collection_name", { length: 255 }).notNull(),
|
|
368
|
-
name: varchar("name", { length: 255 }).notNull(),
|
|
369
|
-
configuration: jsonb("configuration").notNull().$type(),
|
|
370
|
-
isDefault: boolean("is_default").default(false).notNull()
|
|
371
|
-
}).options({ timestamps: true });
|
|
372
|
-
|
|
373
|
-
//#endregion
|
|
374
|
-
//#region src/server/modules/admin/functions/locales.ts
|
|
375
|
-
/**
|
|
376
|
-
* Content Locales Functions
|
|
377
|
-
*
|
|
378
|
-
* Functions for retrieving available content locales from the CMS configuration.
|
|
379
|
-
* Used by the admin panel to populate locale switchers and validate locale selection.
|
|
380
|
-
*/
|
|
381
|
-
/**
|
|
382
|
-
* Helper to get typed CMS app from handler context.
|
|
383
|
-
*/
|
|
384
|
-
function getApp$1(ctx) {
|
|
385
|
-
return ctx.app;
|
|
386
|
-
}
|
|
387
|
-
const getContentLocalesSchema = z.object({}).optional();
|
|
388
|
-
const getContentLocalesOutputSchema = z.object({
|
|
389
|
-
locales: z.array(z.object({
|
|
390
|
-
code: z.string(),
|
|
391
|
-
label: z.string().optional(),
|
|
392
|
-
fallback: z.boolean().optional(),
|
|
393
|
-
flagCountryCode: z.string().optional()
|
|
394
|
-
})),
|
|
395
|
-
defaultLocale: z.string(),
|
|
396
|
-
fallbacks: z.record(z.string(), z.string()).optional()
|
|
397
|
-
});
|
|
398
|
-
/**
|
|
399
|
-
* Get available content locales from CMS configuration.
|
|
400
|
-
*
|
|
401
|
-
* Returns the list of available locales for content localization,
|
|
402
|
-
* the default locale, and any fallback mappings.
|
|
403
|
-
*
|
|
404
|
-
* @example
|
|
405
|
-
* ```ts
|
|
406
|
-
* const result = await client.rpc.getContentLocales({});
|
|
407
|
-
* // {
|
|
408
|
-
* // locales: [
|
|
409
|
-
* // { code: "en", label: "English", fallback: true },
|
|
410
|
-
* // { code: "sk", label: "Slovenčina" },
|
|
411
|
-
* // ],
|
|
412
|
-
* // defaultLocale: "en",
|
|
413
|
-
* // fallbacks: { "en-GB": "en" },
|
|
414
|
-
* // }
|
|
415
|
-
* ```
|
|
416
|
-
*/
|
|
417
|
-
const getContentLocales = fn({
|
|
418
|
-
type: "query",
|
|
419
|
-
schema: getContentLocalesSchema,
|
|
420
|
-
outputSchema: getContentLocalesOutputSchema,
|
|
421
|
-
handler: async (ctx) => {
|
|
422
|
-
const localeConfig = getApp$1(ctx).config.locale;
|
|
423
|
-
if (!localeConfig) return {
|
|
424
|
-
locales: [{
|
|
425
|
-
code: "en",
|
|
426
|
-
label: "English",
|
|
427
|
-
fallback: true
|
|
428
|
-
}],
|
|
429
|
-
defaultLocale: "en"
|
|
430
|
-
};
|
|
431
|
-
return {
|
|
432
|
-
locales: (typeof localeConfig.locales === "function" ? await localeConfig.locales() : localeConfig.locales).map((l) => ({
|
|
433
|
-
code: l.code,
|
|
434
|
-
label: l.label,
|
|
435
|
-
fallback: l.fallback,
|
|
436
|
-
flagCountryCode: l.flagCountryCode
|
|
437
|
-
})),
|
|
438
|
-
defaultLocale: localeConfig.defaultLocale,
|
|
439
|
-
fallbacks: localeConfig.fallbacks
|
|
440
|
-
};
|
|
441
|
-
}
|
|
442
|
-
});
|
|
443
|
-
/**
|
|
444
|
-
* Bundle of locale-related functions.
|
|
445
|
-
*/
|
|
446
|
-
const localeFunctions = { getContentLocales };
|
|
447
|
-
|
|
448
|
-
//#endregion
|
|
449
|
-
//#region src/server/modules/admin/functions/preview.ts
|
|
450
|
-
/**
|
|
451
|
-
* Preview Functions - Server-side
|
|
452
|
-
*
|
|
453
|
-
* RPC functions for draft mode preview.
|
|
454
|
-
* Handles token minting for secure, shareable preview links.
|
|
455
|
-
*
|
|
456
|
-
* Browser-safe utilities (isDraftMode, createDraftModeCookie, etc.) are in @questpie/admin/shared
|
|
457
|
-
*/
|
|
458
|
-
function base64UrlEncode(input) {
|
|
459
|
-
return (Buffer.isBuffer(input) ? input : Buffer.from(input)).toString("base64").replace(/\+/g, "-").replace(/\//g, "_").replace(/=+$/g, "");
|
|
460
|
-
}
|
|
461
|
-
function base64UrlDecode(input) {
|
|
462
|
-
let base64 = input.replace(/-/g, "+").replace(/_/g, "/");
|
|
463
|
-
const padding = base64.length % 4;
|
|
464
|
-
if (padding) base64 += "=".repeat(4 - padding);
|
|
465
|
-
return Buffer.from(base64, "base64").toString("utf8");
|
|
466
|
-
}
|
|
467
|
-
const mintPreviewTokenSchema = z.object({
|
|
468
|
-
path: z.string().min(1, "Path is required"),
|
|
469
|
-
ttlMs: z.number().positive().optional()
|
|
470
|
-
});
|
|
471
|
-
const mintPreviewTokenOutputSchema = z.object({
|
|
472
|
-
token: z.string(),
|
|
473
|
-
expiresAt: z.number()
|
|
474
|
-
});
|
|
475
|
-
const verifyPreviewTokenSchema = z.object({ token: z.string() });
|
|
476
|
-
const verifyPreviewTokenOutputSchema = z.object({
|
|
477
|
-
valid: z.boolean(),
|
|
478
|
-
path: z.string().optional(),
|
|
479
|
-
error: z.string().optional()
|
|
480
|
-
});
|
|
481
|
-
const DEFAULT_TTL_MS = 3600 * 1e3;
|
|
482
|
-
/**
|
|
483
|
-
* Create preview-related RPC functions.
|
|
484
|
-
*
|
|
485
|
-
* @param secret - Secret key for signing tokens
|
|
486
|
-
* @returns Object with preview functions
|
|
487
|
-
*/
|
|
488
|
-
function createPreviewFunctions(secret) {
|
|
489
|
-
const signPayload = (payload) => {
|
|
490
|
-
return base64UrlEncode(createHmac("sha256", secret).update(payload).digest());
|
|
491
|
-
};
|
|
492
|
-
return {
|
|
493
|
-
mintPreviewToken: fn({
|
|
494
|
-
type: "mutation",
|
|
495
|
-
schema: mintPreviewTokenSchema,
|
|
496
|
-
outputSchema: mintPreviewTokenOutputSchema,
|
|
497
|
-
handler: async ({ input, session }) => {
|
|
498
|
-
if (!session) throw new Error("Unauthorized: Admin session required");
|
|
499
|
-
const { path, ttlMs = DEFAULT_TTL_MS } = input;
|
|
500
|
-
const expiresAt = Date.now() + ttlMs;
|
|
501
|
-
const payload = {
|
|
502
|
-
path,
|
|
503
|
-
exp: expiresAt
|
|
504
|
-
};
|
|
505
|
-
const encodedPayload = base64UrlEncode(JSON.stringify(payload));
|
|
506
|
-
return {
|
|
507
|
-
token: `${encodedPayload}.${signPayload(encodedPayload)}`,
|
|
508
|
-
expiresAt
|
|
509
|
-
};
|
|
510
|
-
}
|
|
511
|
-
}),
|
|
512
|
-
verifyPreviewToken: fn({
|
|
513
|
-
type: "query",
|
|
514
|
-
schema: verifyPreviewTokenSchema,
|
|
515
|
-
outputSchema: verifyPreviewTokenOutputSchema,
|
|
516
|
-
handler: async ({ input }) => {
|
|
517
|
-
const { token } = input;
|
|
518
|
-
const [encodedPayload, signature] = token.split(".");
|
|
519
|
-
if (!encodedPayload || !signature) return {
|
|
520
|
-
valid: false,
|
|
521
|
-
error: "Invalid token format"
|
|
522
|
-
};
|
|
523
|
-
const expectedSignature = signPayload(encodedPayload);
|
|
524
|
-
const signatureBuffer = Uint8Array.from(Buffer.from(signature));
|
|
525
|
-
const expectedBuffer = Uint8Array.from(Buffer.from(expectedSignature));
|
|
526
|
-
if (signatureBuffer.length !== expectedBuffer.length) return {
|
|
527
|
-
valid: false,
|
|
528
|
-
error: "Invalid signature"
|
|
529
|
-
};
|
|
530
|
-
if (!timingSafeEqual(signatureBuffer, expectedBuffer)) return {
|
|
531
|
-
valid: false,
|
|
532
|
-
error: "Invalid signature"
|
|
533
|
-
};
|
|
534
|
-
try {
|
|
535
|
-
const payload = JSON.parse(base64UrlDecode(encodedPayload));
|
|
536
|
-
if (!payload?.exp || typeof payload.exp !== "number") return {
|
|
537
|
-
valid: false,
|
|
538
|
-
error: "Invalid payload"
|
|
539
|
-
};
|
|
540
|
-
if (payload.exp < Date.now()) return {
|
|
541
|
-
valid: false,
|
|
542
|
-
error: "Token expired"
|
|
543
|
-
};
|
|
544
|
-
if (!payload.path || typeof payload.path !== "string") return {
|
|
545
|
-
valid: false,
|
|
546
|
-
error: "Invalid path"
|
|
547
|
-
};
|
|
548
|
-
return {
|
|
549
|
-
valid: true,
|
|
550
|
-
path: payload.path
|
|
551
|
-
};
|
|
552
|
-
} catch {
|
|
553
|
-
return {
|
|
554
|
-
valid: false,
|
|
555
|
-
error: "Invalid payload"
|
|
556
|
-
};
|
|
557
|
-
}
|
|
558
|
-
}
|
|
559
|
-
})
|
|
560
|
-
};
|
|
561
|
-
}
|
|
562
|
-
/**
|
|
563
|
-
* Verify a preview token without RPC.
|
|
564
|
-
* Used directly in route handlers where RPC is not available.
|
|
565
|
-
*
|
|
566
|
-
* @param token - The preview token to verify
|
|
567
|
-
* @param secret - The secret used to sign the token
|
|
568
|
-
* @returns The payload if valid, null otherwise
|
|
569
|
-
*/
|
|
570
|
-
function verifyPreviewTokenDirect(token, secret) {
|
|
571
|
-
const [encodedPayload, signature] = token.split(".");
|
|
572
|
-
if (!encodedPayload || !signature) return null;
|
|
573
|
-
const expectedSignature = base64UrlEncode(createHmac("sha256", secret).update(encodedPayload).digest());
|
|
574
|
-
const signatureBuffer = Uint8Array.from(Buffer.from(signature));
|
|
575
|
-
const expectedBuffer = Uint8Array.from(Buffer.from(expectedSignature));
|
|
576
|
-
if (signatureBuffer.length !== expectedBuffer.length) return null;
|
|
577
|
-
if (!timingSafeEqual(signatureBuffer, expectedBuffer)) return null;
|
|
578
|
-
try {
|
|
579
|
-
const payload = JSON.parse(base64UrlDecode(encodedPayload));
|
|
580
|
-
if (!payload?.exp || typeof payload.exp !== "number") return null;
|
|
581
|
-
if (payload.exp < Date.now()) return null;
|
|
582
|
-
if (!payload.path || typeof payload.path !== "string") return null;
|
|
583
|
-
return payload;
|
|
584
|
-
} catch {
|
|
585
|
-
return null;
|
|
586
|
-
}
|
|
587
|
-
}
|
|
588
|
-
/**
|
|
589
|
-
* Create a preview token verifier with bound secret.
|
|
590
|
-
* Use this in route handlers to avoid passing secret repeatedly.
|
|
591
|
-
*
|
|
592
|
-
* @param secret - The secret used to sign tokens (optional, uses env if not provided)
|
|
593
|
-
* @returns A verify function that only needs the token
|
|
594
|
-
*
|
|
595
|
-
* @example
|
|
596
|
-
* ```ts
|
|
597
|
-
* // Create once at module level
|
|
598
|
-
* const verifyPreviewToken = createPreviewTokenVerifier();
|
|
599
|
-
*
|
|
600
|
-
* // Use in route handler
|
|
601
|
-
* const payload = verifyPreviewToken(token);
|
|
602
|
-
* if (!payload) {
|
|
603
|
-
* return new Response("Invalid token", { status: 401 });
|
|
604
|
-
* }
|
|
605
|
-
* ```
|
|
606
|
-
*/
|
|
607
|
-
function createPreviewTokenVerifier(secret) {
|
|
608
|
-
const resolvedSecret = secret ?? getPreviewSecret();
|
|
609
|
-
return (token) => {
|
|
610
|
-
return verifyPreviewTokenDirect(token, resolvedSecret);
|
|
611
|
-
};
|
|
612
|
-
}
|
|
613
|
-
/**
|
|
614
|
-
* Default preview functions bundle with env-based secret.
|
|
615
|
-
* Used by adminModule to register preview RPC functions.
|
|
616
|
-
*/
|
|
617
|
-
const previewFunctions = createPreviewFunctions(getPreviewSecret());
|
|
618
|
-
|
|
619
|
-
//#endregion
|
|
620
|
-
//#region src/server/modules/admin/functions/setup.ts
|
|
621
|
-
/**
|
|
622
|
-
* Setup Functions
|
|
623
|
-
*
|
|
624
|
-
* Built-in functions for bootstrapping the first admin user.
|
|
625
|
-
* Solves the chicken-and-egg problem where invitation-based systems
|
|
626
|
-
* need an existing admin to create the first invitation.
|
|
627
|
-
*/
|
|
628
|
-
/**
|
|
629
|
-
* Helper to get typed CMS app from handler context.
|
|
630
|
-
* Used internally for better IDE support without affecting the public API.
|
|
631
|
-
*/
|
|
632
|
-
function getApp(ctx) {
|
|
633
|
-
return ctx.app;
|
|
634
|
-
}
|
|
635
|
-
const isSetupRequiredSchema = z.object({});
|
|
636
|
-
const isSetupRequiredOutputSchema = z.object({ required: z.boolean() });
|
|
637
|
-
const createFirstAdminSchema = z.object({
|
|
638
|
-
email: z.string().email("Invalid email address"),
|
|
639
|
-
password: z.string().min(8, "Password must be at least 8 characters"),
|
|
640
|
-
name: z.string().min(2, "Name must be at least 2 characters")
|
|
641
|
-
});
|
|
642
|
-
const createFirstAdminOutputSchema = z.object({
|
|
643
|
-
success: z.boolean(),
|
|
644
|
-
user: z.object({
|
|
645
|
-
id: z.string(),
|
|
646
|
-
email: z.string(),
|
|
647
|
-
name: z.string()
|
|
648
|
-
}).optional(),
|
|
649
|
-
error: z.string().optional()
|
|
650
|
-
});
|
|
651
|
-
/**
|
|
652
|
-
* Check if setup is required (no users exist in the system).
|
|
653
|
-
*
|
|
654
|
-
* @example
|
|
655
|
-
* ```ts
|
|
656
|
-
* const result = await client.rpc.isSetupRequired({});
|
|
657
|
-
* if (result.required) {
|
|
658
|
-
* // Redirect to setup page
|
|
659
|
-
* }
|
|
660
|
-
* ```
|
|
661
|
-
*/
|
|
662
|
-
const isSetupRequired = fn({
|
|
663
|
-
type: "query",
|
|
664
|
-
schema: isSetupRequiredSchema,
|
|
665
|
-
outputSchema: isSetupRequiredOutputSchema,
|
|
666
|
-
handler: async (ctx) => {
|
|
667
|
-
const app = getApp(ctx);
|
|
668
|
-
const userCollection = app.getCollectionConfig("user");
|
|
669
|
-
return { required: (await app.db.select({ count: sql`count(*)::int` }).from(userCollection.table))[0].count === 0 };
|
|
670
|
-
}
|
|
671
|
-
});
|
|
672
|
-
/**
|
|
673
|
-
* Create the first admin user in the system.
|
|
674
|
-
* This function only works when no users exist (setup mode).
|
|
675
|
-
*
|
|
676
|
-
* Security: Once any user exists, this function will refuse to create more users.
|
|
677
|
-
* This prevents unauthorized admin creation after initial setup.
|
|
678
|
-
*
|
|
679
|
-
* @example
|
|
680
|
-
* ```ts
|
|
681
|
-
* const result = await client.rpc.createFirstAdmin({
|
|
682
|
-
* email: "admin@example.com",
|
|
683
|
-
* password: "securepassword123",
|
|
684
|
-
* name: "Admin User",
|
|
685
|
-
* });
|
|
686
|
-
*
|
|
687
|
-
* if (result.success) {
|
|
688
|
-
* // Redirect to login page
|
|
689
|
-
* } else {
|
|
690
|
-
* console.error(result.error);
|
|
691
|
-
* }
|
|
692
|
-
* ```
|
|
693
|
-
*/
|
|
694
|
-
const createFirstAdmin = fn({
|
|
695
|
-
type: "mutation",
|
|
696
|
-
schema: createFirstAdminSchema,
|
|
697
|
-
outputSchema: createFirstAdminOutputSchema,
|
|
698
|
-
handler: async (ctx) => {
|
|
699
|
-
const app = getApp(ctx);
|
|
700
|
-
const input = ctx.input;
|
|
701
|
-
const userCollection = app.getCollectionConfig("user");
|
|
702
|
-
if ((await app.db.select({ count: sql`count(*)::int` }).from(userCollection.table))[0].count > 0) return {
|
|
703
|
-
success: false,
|
|
704
|
-
error: "Setup already completed - users exist in the system"
|
|
705
|
-
};
|
|
706
|
-
try {
|
|
707
|
-
const signUpResult = await app.auth.api.signUpEmail({ body: {
|
|
708
|
-
email: input.email,
|
|
709
|
-
password: input.password,
|
|
710
|
-
name: input.name
|
|
711
|
-
} });
|
|
712
|
-
if (!signUpResult.user) return {
|
|
713
|
-
success: false,
|
|
714
|
-
error: "Failed to create user account"
|
|
715
|
-
};
|
|
716
|
-
await app.db.update(userCollection.table).set({
|
|
717
|
-
role: "admin",
|
|
718
|
-
emailVerified: true
|
|
719
|
-
}).where(eq(userCollection.table.id, signUpResult.user.id));
|
|
720
|
-
return {
|
|
721
|
-
success: true,
|
|
722
|
-
user: {
|
|
723
|
-
id: signUpResult.user.id,
|
|
724
|
-
email: signUpResult.user.email,
|
|
725
|
-
name: signUpResult.user.name
|
|
726
|
-
}
|
|
727
|
-
};
|
|
728
|
-
} catch (error) {
|
|
729
|
-
return {
|
|
730
|
-
success: false,
|
|
731
|
-
error: error instanceof Error ? error.message : "An unexpected error occurred"
|
|
732
|
-
};
|
|
733
|
-
}
|
|
734
|
-
}
|
|
735
|
-
});
|
|
736
|
-
/**
|
|
737
|
-
* Bundle of setup-related functions.
|
|
738
|
-
*/
|
|
739
|
-
const setupFunctions = {
|
|
740
|
-
isSetupRequired,
|
|
741
|
-
createFirstAdmin
|
|
742
|
-
};
|
|
743
|
-
|
|
744
|
-
//#endregion
|
|
745
|
-
//#region src/server/modules/admin/index.ts
|
|
746
|
-
/**
|
|
747
|
-
* Admin Module
|
|
748
|
-
*
|
|
749
|
-
* Complete backend module for running the QuestPie admin panel.
|
|
750
|
-
* This is the main entry point for setting up the admin backend.
|
|
751
|
-
*
|
|
752
|
-
* Includes:
|
|
753
|
-
* - Auth collections (users, sessions, accounts, verifications, apikeys)
|
|
754
|
-
* - Assets collection with file upload support
|
|
755
|
-
* - Admin saved views collection (named view configurations)
|
|
756
|
-
* - Admin preferences collection (user-specific view state)
|
|
757
|
-
* - Setup functions for bootstrapping first admin
|
|
758
|
-
* - Core auth options (Better Auth configuration)
|
|
759
|
-
*
|
|
760
|
-
* @example
|
|
761
|
-
* ```ts
|
|
762
|
-
* import { q } from "questpie";
|
|
763
|
-
* import { adminModule } from "@questpie/admin/server";
|
|
764
|
-
*
|
|
765
|
-
* const cms = q({ name: "my-app" })
|
|
766
|
-
* .use(adminModule)
|
|
767
|
-
* .collections({
|
|
768
|
-
* posts: postsCollection,
|
|
769
|
-
* })
|
|
770
|
-
* .build({
|
|
771
|
-
* db: { url: process.env.DATABASE_URL },
|
|
772
|
-
* storage: { driver: s3Driver(...) },
|
|
773
|
-
* });
|
|
774
|
-
* ```
|
|
775
|
-
*/
|
|
776
|
-
/**
|
|
777
|
-
* Admin Module - the complete backend for QuestPie admin panel.
|
|
778
|
-
*
|
|
779
|
-
* This module provides everything needed to run the admin panel:
|
|
780
|
-
* - User authentication (Better Auth) - from starterModule
|
|
781
|
-
* - File uploads (assets) - from starterModule
|
|
782
|
-
* - Saved views for collection filters (named configurations)
|
|
783
|
-
* - User preferences (view state synced across devices)
|
|
784
|
-
* - Setup flow for first admin creation
|
|
785
|
-
*
|
|
786
|
-
* @example
|
|
787
|
-
* ```ts
|
|
788
|
-
* import { q } from "questpie";
|
|
789
|
-
* import { adminModule } from "@questpie/admin/server";
|
|
790
|
-
*
|
|
791
|
-
* const cms = q({ name: "my-app" })
|
|
792
|
-
* .use(adminModule)
|
|
793
|
-
* .collections({
|
|
794
|
-
* posts: postsCollection,
|
|
795
|
-
* })
|
|
796
|
-
* .build({
|
|
797
|
-
* db: { url: process.env.DATABASE_URL },
|
|
798
|
-
* });
|
|
799
|
-
* ```
|
|
800
|
-
*
|
|
801
|
-
* @example
|
|
802
|
-
* ```ts
|
|
803
|
-
* // Extend assets collection with custom fields
|
|
804
|
-
* import { q, collection, varchar } from "questpie";
|
|
805
|
-
* import { adminModule } from "@questpie/admin/server";
|
|
806
|
-
*
|
|
807
|
-
* const cms = q({ name: "my-app" })
|
|
808
|
-
* .use(adminModule)
|
|
809
|
-
* .collections({
|
|
810
|
-
* // Override assets with additional fields
|
|
811
|
-
* assets: adminModule.state.collections.assets.merge(
|
|
812
|
-
* collection("assets").fields({
|
|
813
|
-
* folder: varchar("folder", { length: 255 }),
|
|
814
|
-
* tags: varchar("tags", { length: 1000 }),
|
|
815
|
-
* })
|
|
816
|
-
* ),
|
|
817
|
-
* })
|
|
818
|
-
* .build({ ... });
|
|
819
|
-
* ```
|
|
820
|
-
*/
|
|
821
|
-
const adminModule = q({ name: "questpie-admin" }).use(starterModule).collections({
|
|
822
|
-
admin_saved_views: savedViewsCollection,
|
|
823
|
-
admin_preferences: adminPreferencesCollection
|
|
824
|
-
}).functions({
|
|
825
|
-
...setupFunctions,
|
|
826
|
-
...localeFunctions,
|
|
827
|
-
...previewFunctions
|
|
828
|
-
});
|
|
829
|
-
|
|
830
|
-
//#endregion
|
|
831
|
-
export { adminModule, createFirstAdmin, createNextAuthMiddleware, createPreviewFunctions, createPreviewTokenVerifier, createTanStackAuthGuard, createTanStackSessionLoader, getAdminSession, getNextAdminSession, isAdminUser, isSetupRequired, requireAdminAuth, savedViewsCollection, setupFunctions, verifyPreviewTokenDirect };
|
|
832
|
-
//# sourceMappingURL=server.mjs.map
|
|
1
|
+
import { BlockBuilder, block } from "./server/block/block-builder.mjs";
|
|
2
|
+
import { createBlocksPrefetchHook, processBlocksDocument, processDocumentBlocksPrefetch } from "./server/block/prefetch.mjs";
|
|
3
|
+
import { applyAdminPatches, arePatchesApplied, createActionProxy, createComponentProxy, createFieldProxy, createViewProxy } from "./server/patch.mjs";
|
|
4
|
+
import { getAdminSession, isAdminUser, requireAdminAuth } from "./server/auth-helpers.mjs";
|
|
5
|
+
import { createTanStackAuthGuard, createTanStackSessionLoader } from "./server/adapters/tanstack.mjs";
|
|
6
|
+
import { createNextAuthMiddleware, getNextAdminSession } from "./server/adapters/nextjs.mjs";
|
|
7
|
+
import { getBlocksByCategory, introspectBlock, introspectBlocks } from "./server/block/introspection.mjs";
|
|
8
|
+
import { blocksField } from "./server/fields/blocks.mjs";
|
|
9
|
+
import { richTextField } from "./server/fields/rich-text.mjs";
|
|
10
|
+
import { adminFields } from "./server/fields/index.mjs";
|
|
11
|
+
import { savedViewsCollection } from "./server/modules/admin-preferences/collections/saved-views.collection.mjs";
|
|
12
|
+
import { actionFunctions, executeAction, executeActionFn, getActionsConfig, getActionsConfigFn } from "./server/modules/admin/functions/execute-action.mjs";
|
|
13
|
+
import { createPreviewFunctions, createPreviewTokenVerifier, verifyPreviewTokenDirect } from "./server/modules/admin/functions/preview.mjs";
|
|
14
|
+
import { batchReactive, fieldOptions, reactiveFunctions } from "./server/modules/admin/functions/reactive.mjs";
|
|
15
|
+
import { createFirstAdmin, isSetupRequired, setupFunctions } from "./server/modules/admin/functions/setup.mjs";
|
|
16
|
+
import { fetchWidgetData, widgetDataFunctions } from "./server/modules/admin/functions/widget-data.mjs";
|
|
17
|
+
import { adminModule, adminRpc } from "./server/modules/admin/index.mjs";
|
|
18
|
+
|
|
19
|
+
export { BlockBuilder, actionFunctions, adminFields, adminModule, adminRpc, applyAdminPatches, arePatchesApplied, batchReactive, block, blocksField, createActionProxy, createBlocksPrefetchHook, createComponentProxy, createFieldProxy, createFirstAdmin, createNextAuthMiddleware, createPreviewFunctions, createPreviewTokenVerifier, createTanStackAuthGuard, createTanStackSessionLoader, createViewProxy, executeAction, executeActionFn, fetchWidgetData, fieldOptions, getActionsConfig, getActionsConfigFn, getAdminSession, getBlocksByCategory, getNextAdminSession, introspectBlock, introspectBlocks, isAdminUser, isSetupRequired, processBlocksDocument, processDocumentBlocksPrefetch, reactiveFunctions, requireAdminAuth, richTextField, savedViewsCollection, setupFunctions, verifyPreviewTokenDirect, widgetDataFunctions };
|