@ekrist1/vulse 0.1.6-alpha.3
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/LICENSE +21 -0
- package/README.md +104 -0
- package/dist/admin/client/active-locale.d.ts +3 -0
- package/dist/admin/client/active-locale.d.ts.map +1 -0
- package/dist/admin/client/active-locale.js +14 -0
- package/dist/admin/client/api.d.ts +14 -0
- package/dist/admin/client/api.d.ts.map +1 -0
- package/dist/admin/client/api.js +26 -0
- package/dist/admin/client/form-from-zod.d.ts +2 -0
- package/dist/admin/client/form-from-zod.d.ts.map +1 -0
- package/dist/admin/client/form-from-zod.js +1 -0
- package/dist/admin/client/live-preview-enabled.d.ts +3 -0
- package/dist/admin/client/live-preview-enabled.d.ts.map +1 -0
- package/dist/admin/client/live-preview-enabled.js +6 -0
- package/dist/cli/collection-scaffold.d.ts +14 -0
- package/dist/cli/collection-scaffold.d.ts.map +1 -0
- package/dist/cli/collection-scaffold.js +44 -0
- package/dist/cli/index.d.ts +3 -0
- package/dist/cli/index.d.ts.map +1 -0
- package/dist/cli/index.js +74 -0
- package/dist/cli/migrate.d.ts +5 -0
- package/dist/cli/migrate.d.ts.map +1 -0
- package/dist/cli/migrate.js +10 -0
- package/dist/cli/platform.d.ts +12 -0
- package/dist/cli/platform.d.ts.map +1 -0
- package/dist/cli/platform.js +38 -0
- package/dist/cli/seed-admin.d.ts +19 -0
- package/dist/cli/seed-admin.d.ts.map +1 -0
- package/dist/cli/seed-admin.js +59 -0
- package/dist/cli/setup.d.ts +29 -0
- package/dist/cli/setup.d.ts.map +1 -0
- package/dist/cli/setup.js +254 -0
- package/dist/core/access.d.ts +5 -0
- package/dist/core/access.d.ts.map +1 -0
- package/dist/core/access.js +6 -0
- package/dist/core/blocks/schema.d.ts +81 -0
- package/dist/core/blocks/schema.d.ts.map +1 -0
- package/dist/core/blocks/schema.js +54 -0
- package/dist/core/blueprints/code-to-definition.d.ts +6 -0
- package/dist/core/blueprints/code-to-definition.d.ts.map +1 -0
- package/dist/core/blueprints/code-to-definition.js +147 -0
- package/dist/core/blueprints/compile.d.ts +10 -0
- package/dist/core/blueprints/compile.d.ts.map +1 -0
- package/dist/core/blueprints/compile.js +153 -0
- package/dist/core/blueprints/define.d.ts +6 -0
- package/dist/core/blueprints/define.d.ts.map +1 -0
- package/dist/core/blueprints/define.js +8 -0
- package/dist/core/blueprints/definition.d.ts +963 -0
- package/dist/core/blueprints/definition.d.ts.map +1 -0
- package/dist/core/blueprints/definition.js +151 -0
- package/dist/core/blueprints/load.d.ts +11 -0
- package/dist/core/blueprints/load.d.ts.map +1 -0
- package/dist/core/blueprints/load.js +137 -0
- package/dist/core/blueprints/mutations.d.ts +8 -0
- package/dist/core/blueprints/mutations.d.ts.map +1 -0
- package/dist/core/blueprints/mutations.js +191 -0
- package/dist/core/blueprints/preview-path.d.ts +15 -0
- package/dist/core/blueprints/preview-path.d.ts.map +1 -0
- package/dist/core/blueprints/preview-path.js +25 -0
- package/dist/core/blueprints/reflect-fields.d.ts +36 -0
- package/dist/core/blueprints/reflect-fields.d.ts.map +1 -0
- package/dist/core/blueprints/reflect-fields.js +229 -0
- package/dist/core/blueprints/registry.d.ts +9 -0
- package/dist/core/blueprints/registry.d.ts.map +1 -0
- package/dist/core/blueprints/registry.js +11 -0
- package/dist/core/blueprints/seed.d.ts +5 -0
- package/dist/core/blueprints/seed.d.ts.map +1 -0
- package/dist/core/blueprints/seed.js +17 -0
- package/dist/core/blueprints/select-helpers.d.ts +10 -0
- package/dist/core/blueprints/select-helpers.d.ts.map +1 -0
- package/dist/core/blueprints/select-helpers.js +26 -0
- package/dist/core/blueprints/seo.d.ts +41 -0
- package/dist/core/blueprints/seo.d.ts.map +1 -0
- package/dist/core/blueprints/seo.js +125 -0
- package/dist/core/blueprints/types.d.ts +60 -0
- package/dist/core/blueprints/types.d.ts.map +1 -0
- package/dist/core/blueprints/types.js +1 -0
- package/dist/core/blueprints/zod-helpers.d.ts +79 -0
- package/dist/core/blueprints/zod-helpers.d.ts.map +1 -0
- package/dist/core/blueprints/zod-helpers.js +72 -0
- package/dist/core/db.d.ts +7 -0
- package/dist/core/db.d.ts.map +1 -0
- package/dist/core/db.js +8 -0
- package/dist/core/errors.d.ts +21 -0
- package/dist/core/errors.d.ts.map +1 -0
- package/dist/core/errors.js +29 -0
- package/dist/core/forms/compile.d.ts +9 -0
- package/dist/core/forms/compile.d.ts.map +1 -0
- package/dist/core/forms/compile.js +80 -0
- package/dist/core/forms/definition.d.ts +226 -0
- package/dist/core/forms/definition.d.ts.map +1 -0
- package/dist/core/forms/definition.js +83 -0
- package/dist/core/forms/rate-limit.d.ts +10 -0
- package/dist/core/forms/rate-limit.d.ts.map +1 -0
- package/dist/core/forms/rate-limit.js +31 -0
- package/dist/core/forms/unique.d.ts +5 -0
- package/dist/core/forms/unique.d.ts.map +1 -0
- package/dist/core/forms/unique.js +30 -0
- package/dist/core/globals/compile.d.ts +13 -0
- package/dist/core/globals/compile.d.ts.map +1 -0
- package/dist/core/globals/compile.js +17 -0
- package/dist/core/globals/definition.d.ts +161 -0
- package/dist/core/globals/definition.d.ts.map +1 -0
- package/dist/core/globals/definition.js +23 -0
- package/dist/core/locales.d.ts +14 -0
- package/dist/core/locales.d.ts.map +1 -0
- package/dist/core/locales.js +35 -0
- package/dist/core/migrations.d.ts +3 -0
- package/dist/core/migrations.d.ts.map +1 -0
- package/dist/core/migrations.js +41 -0
- package/dist/core/parse-content.d.ts +14 -0
- package/dist/core/parse-content.d.ts.map +1 -0
- package/dist/core/parse-content.js +68 -0
- package/dist/core/plugins/definition.d.ts +99 -0
- package/dist/core/plugins/definition.d.ts.map +1 -0
- package/dist/core/plugins/definition.js +10 -0
- package/dist/core/preview-content.d.ts +16 -0
- package/dist/core/preview-content.d.ts.map +1 -0
- package/dist/core/preview-content.js +8 -0
- package/dist/core/repos/entries.d.ts +102 -0
- package/dist/core/repos/entries.d.ts.map +1 -0
- package/dist/core/repos/entries.js +393 -0
- package/dist/core/repos/forms.d.ts +82 -0
- package/dist/core/repos/forms.d.ts.map +1 -0
- package/dist/core/repos/forms.js +199 -0
- package/dist/core/repos/globals.d.ts +31 -0
- package/dist/core/repos/globals.d.ts.map +1 -0
- package/dist/core/repos/globals.js +150 -0
- package/dist/core/repos/media.d.ts +39 -0
- package/dist/core/repos/media.d.ts.map +1 -0
- package/dist/core/repos/media.js +81 -0
- package/dist/core/repos/preview-sessions.d.ts +35 -0
- package/dist/core/repos/preview-sessions.d.ts.map +1 -0
- package/dist/core/repos/preview-sessions.js +85 -0
- package/dist/core/repos/revisions.d.ts +24 -0
- package/dist/core/repos/revisions.d.ts.map +1 -0
- package/dist/core/repos/revisions.js +44 -0
- package/dist/core/repos/settings.d.ts +9 -0
- package/dist/core/repos/settings.d.ts.map +1 -0
- package/dist/core/repos/settings.js +21 -0
- package/dist/core/schema.d.ts +2717 -0
- package/dist/core/schema.d.ts.map +1 -0
- package/dist/core/schema.js +220 -0
- package/dist/core/sets/compile.d.ts +8 -0
- package/dist/core/sets/compile.d.ts.map +1 -0
- package/dist/core/sets/compile.js +4 -0
- package/dist/core/sets/definition.d.ts +53 -0
- package/dist/core/sets/definition.d.ts.map +1 -0
- package/dist/core/sets/definition.js +7 -0
- package/dist/core/sets/service.d.ts +13 -0
- package/dist/core/sets/service.d.ts.map +1 -0
- package/dist/core/sets/service.js +68 -0
- package/dist/core/sets/validate-tree.d.ts +4 -0
- package/dist/core/sets/validate-tree.d.ts.map +1 -0
- package/dist/core/sets/validate-tree.js +40 -0
- package/dist/core/slug.d.ts +5 -0
- package/dist/core/slug.d.ts.map +1 -0
- package/dist/core/slug.js +25 -0
- package/dist/index.d.ts +16 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +19 -0
- package/dist/integration/cron.d.ts +4 -0
- package/dist/integration/cron.d.ts.map +1 -0
- package/dist/integration/cron.js +2 -0
- package/dist/integration/index.d.ts +9 -0
- package/dist/integration/index.d.ts.map +1 -0
- package/dist/integration/index.js +63 -0
- package/dist/integration/inject-admin-routes.d.ts +12 -0
- package/dist/integration/inject-admin-routes.d.ts.map +1 -0
- package/dist/integration/inject-admin-routes.js +35 -0
- package/dist/integration/inject-routes.d.ts +11 -0
- package/dist/integration/inject-routes.d.ts.map +1 -0
- package/dist/integration/inject-routes.js +51 -0
- package/dist/integration/install-hook.d.ts +2 -0
- package/dist/integration/install-hook.d.ts.map +1 -0
- package/dist/integration/install-hook.js +74 -0
- package/dist/integration/live-preview-middleware-helpers.d.ts +29 -0
- package/dist/integration/live-preview-middleware-helpers.d.ts.map +1 -0
- package/dist/integration/live-preview-middleware-helpers.js +75 -0
- package/dist/integration/loader-binding.d.ts +6 -0
- package/dist/integration/loader-binding.d.ts.map +1 -0
- package/dist/integration/loader-binding.js +15 -0
- package/dist/integration/middleware.d.ts +2 -0
- package/dist/integration/middleware.d.ts.map +1 -0
- package/dist/integration/middleware.js +51 -0
- package/dist/integration/type-gen.d.ts +2 -0
- package/dist/integration/type-gen.d.ts.map +1 -0
- package/dist/integration/type-gen.js +26 -0
- package/dist/integration/vite-plugin-blueprints.d.ts +3 -0
- package/dist/integration/vite-plugin-blueprints.d.ts.map +1 -0
- package/dist/integration/vite-plugin-blueprints.js +33 -0
- package/dist/integration/wrangler-patch.d.ts +6 -0
- package/dist/integration/wrangler-patch.d.ts.map +1 -0
- package/dist/integration/wrangler-patch.js +18 -0
- package/dist/integration.d.ts +3 -0
- package/dist/integration.d.ts.map +1 -0
- package/dist/integration.js +1 -0
- package/dist/loader.d.ts +3 -0
- package/dist/loader.d.ts.map +1 -0
- package/dist/loader.js +1 -0
- package/dist/package-name.d.ts +3 -0
- package/dist/package-name.d.ts.map +1 -0
- package/dist/package-name.js +2 -0
- package/dist/scaffold/collection-write.d.ts +14 -0
- package/dist/scaffold/collection-write.d.ts.map +1 -0
- package/dist/scaffold/collection-write.js +59 -0
- package/dist/scaffold/collection.d.ts +36 -0
- package/dist/scaffold/collection.d.ts.map +1 -0
- package/dist/scaffold/collection.js +231 -0
- package/dist/server/assets/live-preview-bridge.content.d.ts +2 -0
- package/dist/server/assets/live-preview-bridge.content.d.ts.map +1 -0
- package/dist/server/assets/live-preview-bridge.content.js +2 -0
- package/dist/server/better-auth.d.ts +71 -0
- package/dist/server/better-auth.d.ts.map +1 -0
- package/dist/server/better-auth.js +68 -0
- package/dist/server/cf-images.d.ts +12 -0
- package/dist/server/cf-images.d.ts.map +1 -0
- package/dist/server/cf-images.js +27 -0
- package/dist/server/cron.d.ts +9 -0
- package/dist/server/cron.d.ts.map +1 -0
- package/dist/server/cron.js +26 -0
- package/dist/server/email.d.ts +10 -0
- package/dist/server/email.d.ts.map +1 -0
- package/dist/server/email.js +9 -0
- package/dist/server/endpoints/api-auth.d.ts +5 -0
- package/dist/server/endpoints/api-auth.d.ts.map +1 -0
- package/dist/server/endpoints/api-auth.js +7 -0
- package/dist/server/endpoints/api-vulse-blueprints.d.ts +6 -0
- package/dist/server/endpoints/api-vulse-blueprints.d.ts.map +1 -0
- package/dist/server/endpoints/api-vulse-blueprints.js +19 -0
- package/dist/server/endpoints/api-vulse-entries-locales.d.ts +4 -0
- package/dist/server/endpoints/api-vulse-entries-locales.d.ts.map +1 -0
- package/dist/server/endpoints/api-vulse-entries-locales.js +9 -0
- package/dist/server/endpoints/api-vulse-entries-move.d.ts +3 -0
- package/dist/server/endpoints/api-vulse-entries-move.d.ts.map +1 -0
- package/dist/server/endpoints/api-vulse-entries-move.js +5 -0
- package/dist/server/endpoints/api-vulse-entries-publish.d.ts +3 -0
- package/dist/server/endpoints/api-vulse-entries-publish.d.ts.map +1 -0
- package/dist/server/endpoints/api-vulse-entries-publish.js +5 -0
- package/dist/server/endpoints/api-vulse-entries-tree.d.ts +3 -0
- package/dist/server/endpoints/api-vulse-entries-tree.d.ts.map +1 -0
- package/dist/server/endpoints/api-vulse-entries-tree.js +5 -0
- package/dist/server/endpoints/api-vulse-entries.d.ts +6 -0
- package/dist/server/endpoints/api-vulse-entries.d.ts.map +1 -0
- package/dist/server/endpoints/api-vulse-entries.js +19 -0
- package/dist/server/endpoints/api-vulse-form-handle.d.ts +6 -0
- package/dist/server/endpoints/api-vulse-form-handle.d.ts.map +1 -0
- package/dist/server/endpoints/api-vulse-form-handle.js +27 -0
- package/dist/server/endpoints/api-vulse-form-public.d.ts +3 -0
- package/dist/server/endpoints/api-vulse-form-public.d.ts.map +1 -0
- package/dist/server/endpoints/api-vulse-form-public.js +5 -0
- package/dist/server/endpoints/api-vulse-form-submit.d.ts +3 -0
- package/dist/server/endpoints/api-vulse-form-submit.d.ts.map +1 -0
- package/dist/server/endpoints/api-vulse-form-submit.js +5 -0
- package/dist/server/endpoints/api-vulse-form-upload.d.ts +3 -0
- package/dist/server/endpoints/api-vulse-form-upload.d.ts.map +1 -0
- package/dist/server/endpoints/api-vulse-form-upload.js +5 -0
- package/dist/server/endpoints/api-vulse-forms.d.ts +4 -0
- package/dist/server/endpoints/api-vulse-forms.d.ts.map +1 -0
- package/dist/server/endpoints/api-vulse-forms.js +9 -0
- package/dist/server/endpoints/api-vulse-globals-handle.d.ts +5 -0
- package/dist/server/endpoints/api-vulse-globals-handle.d.ts.map +1 -0
- package/dist/server/endpoints/api-vulse-globals-handle.js +19 -0
- package/dist/server/endpoints/api-vulse-globals-public-handle.d.ts +3 -0
- package/dist/server/endpoints/api-vulse-globals-public-handle.d.ts.map +1 -0
- package/dist/server/endpoints/api-vulse-globals-public-handle.js +5 -0
- package/dist/server/endpoints/api-vulse-globals-public.d.ts +3 -0
- package/dist/server/endpoints/api-vulse-globals-public.d.ts.map +1 -0
- package/dist/server/endpoints/api-vulse-globals-public.js +5 -0
- package/dist/server/endpoints/api-vulse-globals-value.d.ts +3 -0
- package/dist/server/endpoints/api-vulse-globals-value.d.ts.map +1 -0
- package/dist/server/endpoints/api-vulse-globals-value.js +7 -0
- package/dist/server/endpoints/api-vulse-globals.d.ts +4 -0
- package/dist/server/endpoints/api-vulse-globals.d.ts.map +1 -0
- package/dist/server/endpoints/api-vulse-globals.js +9 -0
- package/dist/server/endpoints/api-vulse-media-file.d.ts +3 -0
- package/dist/server/endpoints/api-vulse-media-file.d.ts.map +1 -0
- package/dist/server/endpoints/api-vulse-media-file.js +5 -0
- package/dist/server/endpoints/api-vulse-media-id.d.ts +4 -0
- package/dist/server/endpoints/api-vulse-media-id.d.ts.map +1 -0
- package/dist/server/endpoints/api-vulse-media-id.js +9 -0
- package/dist/server/endpoints/api-vulse-media.d.ts +4 -0
- package/dist/server/endpoints/api-vulse-media.d.ts.map +1 -0
- package/dist/server/endpoints/api-vulse-media.js +9 -0
- package/dist/server/endpoints/api-vulse-preview-bridge.d.ts +3 -0
- package/dist/server/endpoints/api-vulse-preview-bridge.d.ts.map +1 -0
- package/dist/server/endpoints/api-vulse-preview-bridge.js +9 -0
- package/dist/server/endpoints/api-vulse-preview-sessions-id.d.ts +3 -0
- package/dist/server/endpoints/api-vulse-preview-sessions-id.d.ts.map +1 -0
- package/dist/server/endpoints/api-vulse-preview-sessions-id.js +10 -0
- package/dist/server/endpoints/api-vulse-preview-sessions.d.ts +3 -0
- package/dist/server/endpoints/api-vulse-preview-sessions.d.ts.map +1 -0
- package/dist/server/endpoints/api-vulse-preview-sessions.js +5 -0
- package/dist/server/endpoints/api-vulse-preview-start.d.ts +3 -0
- package/dist/server/endpoints/api-vulse-preview-start.d.ts.map +1 -0
- package/dist/server/endpoints/api-vulse-preview-start.js +5 -0
- package/dist/server/endpoints/api-vulse-preview-stop.d.ts +3 -0
- package/dist/server/endpoints/api-vulse-preview-stop.d.ts.map +1 -0
- package/dist/server/endpoints/api-vulse-preview-stop.js +5 -0
- package/dist/server/endpoints/api-vulse-revisions-restore.d.ts +3 -0
- package/dist/server/endpoints/api-vulse-revisions-restore.d.ts.map +1 -0
- package/dist/server/endpoints/api-vulse-revisions-restore.js +5 -0
- package/dist/server/endpoints/api-vulse-revisions.d.ts +3 -0
- package/dist/server/endpoints/api-vulse-revisions.d.ts.map +1 -0
- package/dist/server/endpoints/api-vulse-revisions.js +5 -0
- package/dist/server/endpoints/api-vulse-search.d.ts +3 -0
- package/dist/server/endpoints/api-vulse-search.d.ts.map +1 -0
- package/dist/server/endpoints/api-vulse-search.js +5 -0
- package/dist/server/endpoints/api-vulse-sets.d.ts +6 -0
- package/dist/server/endpoints/api-vulse-sets.d.ts.map +1 -0
- package/dist/server/endpoints/api-vulse-sets.js +19 -0
- package/dist/server/endpoints/api-vulse-settings.d.ts +4 -0
- package/dist/server/endpoints/api-vulse-settings.d.ts.map +1 -0
- package/dist/server/endpoints/api-vulse-settings.js +9 -0
- package/dist/server/endpoints/api-vulse-users-id.d.ts +4 -0
- package/dist/server/endpoints/api-vulse-users-id.d.ts.map +1 -0
- package/dist/server/endpoints/api-vulse-users-id.js +9 -0
- package/dist/server/endpoints/api-vulse-users-reset-password.d.ts +3 -0
- package/dist/server/endpoints/api-vulse-users-reset-password.d.ts.map +1 -0
- package/dist/server/endpoints/api-vulse-users-reset-password.js +5 -0
- package/dist/server/endpoints/api-vulse-users-role.d.ts +4 -0
- package/dist/server/endpoints/api-vulse-users-role.d.ts.map +1 -0
- package/dist/server/endpoints/api-vulse-users-role.js +6 -0
- package/dist/server/endpoints/api-vulse-users.d.ts +3 -0
- package/dist/server/endpoints/api-vulse-users.d.ts.map +1 -0
- package/dist/server/endpoints/api-vulse-users.js +5 -0
- package/dist/server/endpoints/with-runtime.d.ts +2 -0
- package/dist/server/endpoints/with-runtime.d.ts.map +1 -0
- package/dist/server/endpoints/with-runtime.js +10 -0
- package/dist/server/env.d.ts +16 -0
- package/dist/server/env.d.ts.map +1 -0
- package/dist/server/env.js +9 -0
- package/dist/server/envelope.d.ts +15 -0
- package/dist/server/envelope.d.ts.map +1 -0
- package/dist/server/envelope.js +16 -0
- package/dist/server/forms/email.d.ts +8 -0
- package/dist/server/forms/email.d.ts.map +1 -0
- package/dist/server/forms/email.js +6 -0
- package/dist/server/forms/process-submission.d.ts +8 -0
- package/dist/server/forms/process-submission.d.ts.map +1 -0
- package/dist/server/forms/process-submission.js +75 -0
- package/dist/server/forms/queue.d.ts +8 -0
- package/dist/server/forms/queue.d.ts.map +1 -0
- package/dist/server/forms/queue.js +17 -0
- package/dist/server/forms/templates.d.ts +9 -0
- package/dist/server/forms/templates.d.ts.map +1 -0
- package/dist/server/forms/templates.js +14 -0
- package/dist/server/forms/webhook.d.ts +2 -0
- package/dist/server/forms/webhook.d.ts.map +1 -0
- package/dist/server/forms/webhook.js +17 -0
- package/dist/server/handler.d.ts +17 -0
- package/dist/server/handler.d.ts.map +1 -0
- package/dist/server/handler.js +45 -0
- package/dist/server/image-probe.d.ts +6 -0
- package/dist/server/image-probe.d.ts.map +1 -0
- package/dist/server/image-probe.js +38 -0
- package/dist/server/loader.d.ts +10 -0
- package/dist/server/loader.d.ts.map +1 -0
- package/dist/server/loader.js +42 -0
- package/dist/server/plugins.d.ts +17 -0
- package/dist/server/plugins.d.ts.map +1 -0
- package/dist/server/plugins.js +134 -0
- package/dist/server/preview.d.ts +7 -0
- package/dist/server/preview.d.ts.map +1 -0
- package/dist/server/preview.js +22 -0
- package/dist/server/r2.d.ts +8 -0
- package/dist/server/r2.d.ts.map +1 -0
- package/dist/server/r2.js +9 -0
- package/dist/server/routes/blueprints.d.ts +10 -0
- package/dist/server/routes/blueprints.d.ts.map +1 -0
- package/dist/server/routes/blueprints.js +46 -0
- package/dist/server/routes/entries.d.ts +16 -0
- package/dist/server/routes/entries.d.ts.map +1 -0
- package/dist/server/routes/entries.js +262 -0
- package/dist/server/routes/form-submit.d.ts +10 -0
- package/dist/server/routes/form-submit.d.ts.map +1 -0
- package/dist/server/routes/form-submit.js +155 -0
- package/dist/server/routes/form-upload.d.ts +11 -0
- package/dist/server/routes/form-upload.d.ts.map +1 -0
- package/dist/server/routes/form-upload.js +87 -0
- package/dist/server/routes/forms.d.ts +14 -0
- package/dist/server/routes/forms.d.ts.map +1 -0
- package/dist/server/routes/forms.js +78 -0
- package/dist/server/routes/globals-public.d.ts +6 -0
- package/dist/server/routes/globals-public.d.ts.map +1 -0
- package/dist/server/routes/globals-public.js +30 -0
- package/dist/server/routes/globals.d.ts +11 -0
- package/dist/server/routes/globals.d.ts.map +1 -0
- package/dist/server/routes/globals.js +84 -0
- package/dist/server/routes/media.d.ts +23 -0
- package/dist/server/routes/media.d.ts.map +1 -0
- package/dist/server/routes/media.js +129 -0
- package/dist/server/routes/preview-sessions.d.ts +9 -0
- package/dist/server/routes/preview-sessions.d.ts.map +1 -0
- package/dist/server/routes/preview-sessions.js +74 -0
- package/dist/server/routes/preview.d.ts +6 -0
- package/dist/server/routes/preview.d.ts.map +1 -0
- package/dist/server/routes/preview.js +37 -0
- package/dist/server/routes/revisions.d.ts +7 -0
- package/dist/server/routes/revisions.d.ts.map +1 -0
- package/dist/server/routes/revisions.js +26 -0
- package/dist/server/routes/search.d.ts +6 -0
- package/dist/server/routes/search.d.ts.map +1 -0
- package/dist/server/routes/search.js +28 -0
- package/dist/server/routes/sets.d.ts +10 -0
- package/dist/server/routes/sets.d.ts.map +1 -0
- package/dist/server/routes/sets.js +33 -0
- package/dist/server/routes/settings.d.ts +7 -0
- package/dist/server/routes/settings.d.ts.map +1 -0
- package/dist/server/routes/settings.js +21 -0
- package/dist/server/routes/users.d.ts +10 -0
- package/dist/server/routes/users.d.ts.map +1 -0
- package/dist/server/routes/users.js +113 -0
- package/dist/server/runtime.d.ts +49 -0
- package/dist/server/runtime.d.ts.map +1 -0
- package/dist/server/runtime.js +69 -0
- package/dist/server/sdk/collections.d.ts +25 -0
- package/dist/server/sdk/collections.d.ts.map +1 -0
- package/dist/server/sdk/collections.js +76 -0
- package/dist/server/sdk/index.d.ts +45 -0
- package/dist/server/sdk/index.d.ts.map +1 -0
- package/dist/server/sdk/index.js +13 -0
- package/dist/server/sdk/media.d.ts +7 -0
- package/dist/server/sdk/media.d.ts.map +1 -0
- package/dist/server/sdk/media.js +9 -0
- package/dist/server/sdk/search.d.ts +19 -0
- package/dist/server/sdk/search.d.ts.map +1 -0
- package/dist/server/sdk/search.js +58 -0
- package/dist/server.d.ts +8 -0
- package/dist/server.d.ts.map +1 -0
- package/dist/server.js +6 -0
- package/dist/version.d.ts +2 -0
- package/dist/version.d.ts.map +1 -0
- package/dist/version.js +2 -0
- package/migrations/0000_init.sql +114 -0
- package/migrations/0001_collections_sets.sql +21 -0
- package/migrations/0003_fts.sql +22 -0
- package/migrations/0004_forms.sql +58 -0
- package/migrations/0005_globals.sql +16 -0
- package/migrations/0006_preview_sessions.sql +16 -0
- package/migrations/meta/0000_snapshot.json +672 -0
- package/migrations/meta/_journal.json +13 -0
- package/package.json +130 -0
- package/src/client/BlockRenderer.astro +40 -0
- package/src/client/BlockRenderer.vue +42 -0
- package/src/client/Node.vue +21 -0
- package/src/client/ProseMirrorRenderer.vue +31 -0
- package/src/client/auth.ts +28 -0
- package/src/client/blocks/Blockquote.vue +12 -0
- package/src/client/blocks/BulletList.vue +12 -0
- package/src/client/blocks/CodeBlock.vue +12 -0
- package/src/client/blocks/Emoji.vue +14 -0
- package/src/client/blocks/HardBreak.vue +1 -0
- package/src/client/blocks/Heading.vue +17 -0
- package/src/client/blocks/ListItem.vue +12 -0
- package/src/client/blocks/OrderedList.vue +12 -0
- package/src/client/blocks/Paragraph.vue +12 -0
- package/src/client/blocks/Text.vue +33 -0
- package/src/client/blocks/VulseAccordion.vue +16 -0
- package/src/client/blocks/VulseAccordionGroup.vue +12 -0
- package/src/client/blocks/VulseCallout.vue +14 -0
- package/src/client/blocks/VulseIframe.vue +65 -0
- package/src/client/blocks/VulseImage.vue +30 -0
- package/src/client/blocks/VulseSet.vue +26 -0
- package/src/client/blocks/VulseVideo.vue +18 -0
- package/src/client/components/ForgotPasswordForm.astro +71 -0
- package/src/client/components/FormRenderer.astro +40 -0
- package/src/client/components/ResetPasswordForm.astro +72 -0
- package/src/client/components/SessionGuard.astro +27 -0
- package/src/client/components/SignInForm.astro +57 -0
- package/src/client/components/SignOutButton.astro +22 -0
- package/src/client/components/SignUpForm.astro +61 -0
- package/src/client/components/VulseImage.vue +25 -0
- package/src/client/embed.ts +52 -0
- package/src/client/index.ts +2 -0
- package/src/client/inject.ts +4 -0
- package/src/client/live-preview-bridge.ts +20 -0
- package/src/client/pm-defaults.ts +38 -0
- package/src/client/pm-types.ts +21 -0
- package/src/client/render-pm-html.ts +154 -0
- package/src/client/url.ts +35 -0
|
@@ -0,0 +1,229 @@
|
|
|
1
|
+
import { z } from 'astro/zod';
|
|
2
|
+
import { nestedFieldToDescriptor } from './code-to-definition.js';
|
|
3
|
+
import { normalizeSelectOptions } from './select-helpers.js';
|
|
4
|
+
function unwrap(sch) {
|
|
5
|
+
let inner = sch;
|
|
6
|
+
for (;;) {
|
|
7
|
+
const def = inner._def;
|
|
8
|
+
if (def.type === 'optional' || def.type === 'default') {
|
|
9
|
+
inner = def.innerType;
|
|
10
|
+
continue;
|
|
11
|
+
}
|
|
12
|
+
break;
|
|
13
|
+
}
|
|
14
|
+
return inner;
|
|
15
|
+
}
|
|
16
|
+
function maxLength(sch) {
|
|
17
|
+
const checks = sch._def.checks ?? [];
|
|
18
|
+
for (const check of checks) {
|
|
19
|
+
const zod = check._zod;
|
|
20
|
+
if (zod?.def?.check === 'max_length')
|
|
21
|
+
return zod.def.maximum;
|
|
22
|
+
}
|
|
23
|
+
return undefined;
|
|
24
|
+
}
|
|
25
|
+
function parseEntriesTag(tag) {
|
|
26
|
+
const rest = tag.slice('vulse:entries:'.length);
|
|
27
|
+
const lastColon = rest.lastIndexOf(':');
|
|
28
|
+
if (lastColon > 0) {
|
|
29
|
+
const maybeMax = Number(rest.slice(lastColon + 1));
|
|
30
|
+
if (!Number.isNaN(maybeMax) && String(maybeMax) === rest.slice(lastColon + 1)) {
|
|
31
|
+
return {
|
|
32
|
+
collections: rest.slice(0, lastColon).split(',').filter(Boolean),
|
|
33
|
+
max: maybeMax,
|
|
34
|
+
};
|
|
35
|
+
}
|
|
36
|
+
}
|
|
37
|
+
return { collections: rest.split(',').filter(Boolean) };
|
|
38
|
+
}
|
|
39
|
+
export function reflectFields(schema) {
|
|
40
|
+
const shape = schema.shape;
|
|
41
|
+
return Object.entries(shape).map(([path, sch]) => describe(path, sch));
|
|
42
|
+
}
|
|
43
|
+
function describe(path, sch) {
|
|
44
|
+
const tag = (sch.description ?? '');
|
|
45
|
+
const required = !sch.isOptional();
|
|
46
|
+
if (tag === 'vulse:media')
|
|
47
|
+
return { path, widget: 'media', required };
|
|
48
|
+
if (tag.startsWith('vulse:ref:')) {
|
|
49
|
+
return { path, widget: 'ref', required, refTarget: tag.slice('vulse:ref:'.length) };
|
|
50
|
+
}
|
|
51
|
+
if (tag.startsWith('vulse:entry:')) {
|
|
52
|
+
return {
|
|
53
|
+
path,
|
|
54
|
+
widget: 'entry',
|
|
55
|
+
required,
|
|
56
|
+
entryCollections: tag.slice('vulse:entry:'.length).split(',').filter(Boolean),
|
|
57
|
+
};
|
|
58
|
+
}
|
|
59
|
+
if (tag.startsWith('vulse:entries:')) {
|
|
60
|
+
const parsed = parseEntriesTag(tag);
|
|
61
|
+
return {
|
|
62
|
+
path,
|
|
63
|
+
widget: 'entries',
|
|
64
|
+
required,
|
|
65
|
+
entriesCollections: parsed.collections,
|
|
66
|
+
...(parsed.max !== undefined ? { entriesMax: parsed.max } : {}),
|
|
67
|
+
};
|
|
68
|
+
}
|
|
69
|
+
if (tag.startsWith('vulse:link')) {
|
|
70
|
+
const collections = tag.length > 'vulse:link'.length
|
|
71
|
+
? tag.slice('vulse:link:'.length).split(',').filter(Boolean)
|
|
72
|
+
: undefined;
|
|
73
|
+
return {
|
|
74
|
+
path,
|
|
75
|
+
widget: 'link',
|
|
76
|
+
required,
|
|
77
|
+
...(collections !== undefined ? { linkCollections: collections } : {}),
|
|
78
|
+
};
|
|
79
|
+
}
|
|
80
|
+
const inner = unwrap(sch);
|
|
81
|
+
const t = inner._def.type;
|
|
82
|
+
if (t === 'string') {
|
|
83
|
+
const max = maxLength(inner);
|
|
84
|
+
return { path, widget: max && max > 200 ? 'textarea' : 'text', required };
|
|
85
|
+
}
|
|
86
|
+
if (t === 'number')
|
|
87
|
+
return { path, widget: 'number', required };
|
|
88
|
+
if (t === 'boolean')
|
|
89
|
+
return { path, widget: 'bool', required };
|
|
90
|
+
if (t === 'date')
|
|
91
|
+
return { path, widget: 'date', required };
|
|
92
|
+
if (t === 'enum') {
|
|
93
|
+
const entries = inner._def.entries ?? {};
|
|
94
|
+
const keys = Object.keys(entries);
|
|
95
|
+
return {
|
|
96
|
+
path,
|
|
97
|
+
widget: 'enum',
|
|
98
|
+
required,
|
|
99
|
+
options: keys,
|
|
100
|
+
selectOptions: keys.map((key) => ({ key, label: key })),
|
|
101
|
+
};
|
|
102
|
+
}
|
|
103
|
+
if (t === 'object') {
|
|
104
|
+
return { path, widget: 'object', required, children: reflectFields(inner) };
|
|
105
|
+
}
|
|
106
|
+
if (t === 'any' && (tag === 'vulse:blocks' || tag.startsWith('vulse:blocks:'))) {
|
|
107
|
+
return blocksDescriptor(path, required, tag);
|
|
108
|
+
}
|
|
109
|
+
if (t === 'array') {
|
|
110
|
+
if (tag === 'vulse:blocks' || tag.startsWith('vulse:blocks:') || path === 'body') {
|
|
111
|
+
return blocksDescriptor(path, required, tag || 'vulse:blocks');
|
|
112
|
+
}
|
|
113
|
+
const el = inner._def.element;
|
|
114
|
+
if (el._def.type === 'object') {
|
|
115
|
+
const itemFields = reflectFields(el);
|
|
116
|
+
if (tag === 'vulse:grid') {
|
|
117
|
+
return { path, widget: 'grid', required, itemFields, gridMode: 'table' };
|
|
118
|
+
}
|
|
119
|
+
return { path, widget: 'repeater', required, itemFields };
|
|
120
|
+
}
|
|
121
|
+
if (el._def.type === 'enum') {
|
|
122
|
+
const entries = el._def.entries ?? {};
|
|
123
|
+
const keys = Object.keys(entries);
|
|
124
|
+
return {
|
|
125
|
+
path,
|
|
126
|
+
widget: 'enum',
|
|
127
|
+
required,
|
|
128
|
+
options: keys,
|
|
129
|
+
selectOptions: keys.map((key) => ({ key, label: key })),
|
|
130
|
+
selectMultiple: true,
|
|
131
|
+
};
|
|
132
|
+
}
|
|
133
|
+
return { path, widget: 'text', required };
|
|
134
|
+
}
|
|
135
|
+
return { path, widget: 'text', required };
|
|
136
|
+
}
|
|
137
|
+
const RESERVED_FIELD_NAMES = new Set(['slug', 'status', 'seo']);
|
|
138
|
+
export function fieldDescriptorsFromDefinitions(fields) {
|
|
139
|
+
return fields.map(fieldDefinitionToDescriptor);
|
|
140
|
+
}
|
|
141
|
+
export function fieldDescriptorsFromBlueprint(bp) {
|
|
142
|
+
const all = !bp.fields?.length
|
|
143
|
+
? reflectFields(bp.schema)
|
|
144
|
+
: bp.fields.map(fieldDefinitionToDescriptor);
|
|
145
|
+
return all.filter((f) => !RESERVED_FIELD_NAMES.has(f.path));
|
|
146
|
+
}
|
|
147
|
+
function selectDescriptor(base, options, config) {
|
|
148
|
+
const normalized = normalizeSelectOptions(options);
|
|
149
|
+
return {
|
|
150
|
+
...base,
|
|
151
|
+
widget: 'enum',
|
|
152
|
+
options: normalized.map((o) => o.key),
|
|
153
|
+
selectOptions: normalized,
|
|
154
|
+
...(config?.multiple !== undefined ? { selectMultiple: config.multiple } : {}),
|
|
155
|
+
...(config?.placeholder !== undefined ? { selectPlaceholder: config.placeholder } : {}),
|
|
156
|
+
...(config?.clearable !== undefined ? { selectClearable: config.clearable } : {}),
|
|
157
|
+
};
|
|
158
|
+
}
|
|
159
|
+
function fieldDefinitionToDescriptor(f) {
|
|
160
|
+
const base = { path: f.name, required: !f.optional, label: f.label ?? f.name };
|
|
161
|
+
switch (f.ui.kind) {
|
|
162
|
+
case 'textarea':
|
|
163
|
+
return { ...base, widget: 'textarea' };
|
|
164
|
+
case 'boolean':
|
|
165
|
+
return { ...base, widget: 'bool' };
|
|
166
|
+
case 'date':
|
|
167
|
+
return { ...base, widget: 'date' };
|
|
168
|
+
case 'select':
|
|
169
|
+
return selectDescriptor(base, f.ui.options, {
|
|
170
|
+
...(f.ui.multiple !== undefined ? { multiple: f.ui.multiple } : {}),
|
|
171
|
+
...(f.ui.placeholder !== undefined ? { placeholder: f.ui.placeholder } : {}),
|
|
172
|
+
...(f.ui.clearable !== undefined ? { clearable: f.ui.clearable } : {}),
|
|
173
|
+
});
|
|
174
|
+
case 'relationship':
|
|
175
|
+
return { ...base, widget: 'ref', refTarget: f.ui.to };
|
|
176
|
+
case 'entry':
|
|
177
|
+
return { ...base, widget: 'entry', entryCollections: f.ui.collections };
|
|
178
|
+
case 'entries':
|
|
179
|
+
return {
|
|
180
|
+
...base,
|
|
181
|
+
widget: 'entries',
|
|
182
|
+
entriesCollections: f.ui.collections,
|
|
183
|
+
...(f.ui.max !== undefined ? { entriesMax: f.ui.max } : {}),
|
|
184
|
+
};
|
|
185
|
+
case 'link':
|
|
186
|
+
return {
|
|
187
|
+
...base,
|
|
188
|
+
widget: 'link',
|
|
189
|
+
...(f.ui.collections !== undefined ? { linkCollections: f.ui.collections } : {}),
|
|
190
|
+
};
|
|
191
|
+
case 'asset':
|
|
192
|
+
return { ...base, widget: 'media' };
|
|
193
|
+
case 'blocks': {
|
|
194
|
+
const tag = f.ui.sets?.length ? `vulse:blocks:${f.ui.sets.join(',')}` : 'vulse:blocks';
|
|
195
|
+
return {
|
|
196
|
+
...base,
|
|
197
|
+
widget: 'blocks',
|
|
198
|
+
description: tag,
|
|
199
|
+
...(f.ui.sets?.length ? { blocksSets: f.ui.sets } : {}),
|
|
200
|
+
};
|
|
201
|
+
}
|
|
202
|
+
case 'replicator':
|
|
203
|
+
return { ...base, widget: 'replicator', replicatorSets: f.ui.sets };
|
|
204
|
+
case 'grid':
|
|
205
|
+
return {
|
|
206
|
+
...base,
|
|
207
|
+
widget: 'grid',
|
|
208
|
+
itemFields: f.ui.fields.map((field) => nestedFieldToDescriptor(field)),
|
|
209
|
+
gridMode: f.ui.mode ?? 'table',
|
|
210
|
+
...(f.ui.minRows !== undefined ? { gridMinRows: f.ui.minRows } : {}),
|
|
211
|
+
...(f.ui.maxRows !== undefined ? { gridMaxRows: f.ui.maxRows } : {}),
|
|
212
|
+
...(f.ui.addLabel !== undefined ? { gridAddLabel: f.ui.addLabel } : {}),
|
|
213
|
+
};
|
|
214
|
+
default:
|
|
215
|
+
return { ...base, widget: 'text' };
|
|
216
|
+
}
|
|
217
|
+
}
|
|
218
|
+
function blocksDescriptor(path, required, tag) {
|
|
219
|
+
const blocksSets = tag.startsWith('vulse:blocks:')
|
|
220
|
+
? tag.slice('vulse:blocks:'.length).split(',').filter(Boolean)
|
|
221
|
+
: [];
|
|
222
|
+
return {
|
|
223
|
+
path,
|
|
224
|
+
widget: 'blocks',
|
|
225
|
+
required,
|
|
226
|
+
description: tag,
|
|
227
|
+
...(blocksSets.length ? { blocksSets } : {}),
|
|
228
|
+
};
|
|
229
|
+
}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import type { Blueprint } from './types.js';
|
|
2
|
+
export declare class BlueprintRegistry {
|
|
3
|
+
#private;
|
|
4
|
+
register(bp: Blueprint): void;
|
|
5
|
+
get(name: string): Blueprint | undefined;
|
|
6
|
+
list(): Blueprint[];
|
|
7
|
+
has(name: string): boolean;
|
|
8
|
+
}
|
|
9
|
+
//# sourceMappingURL=registry.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"registry.d.ts","sourceRoot":"","sources":["../../../src/core/blueprints/registry.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,YAAY,CAAA;AAE3C,qBAAa,iBAAiB;;IAG5B,QAAQ,CAAC,EAAE,EAAE,SAAS,GAAG,IAAI;IAK7B,GAAG,CAAC,IAAI,EAAE,MAAM,GAAG,SAAS,GAAG,SAAS;IACxC,IAAI,IAAI,SAAS,EAAE;IACnB,GAAG,CAAC,IAAI,EAAE,MAAM,GAAG,OAAO;CAC3B"}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
export class BlueprintRegistry {
|
|
2
|
+
#map = new Map();
|
|
3
|
+
register(bp) {
|
|
4
|
+
if (this.#map.has(bp.name))
|
|
5
|
+
throw new Error(`Blueprint "${bp.name}" already registered`);
|
|
6
|
+
this.#map.set(bp.name, bp);
|
|
7
|
+
}
|
|
8
|
+
get(name) { return this.#map.get(name); }
|
|
9
|
+
list() { return [...this.#map.values()]; }
|
|
10
|
+
has(name) { return this.#map.has(name); }
|
|
11
|
+
}
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import type { VulseDb } from '../db.js';
|
|
2
|
+
import type { Blueprint } from './types.js';
|
|
3
|
+
export declare function seedCodeBlueprints(db: VulseDb, codeBlueprints: Blueprint[]): Promise<void>;
|
|
4
|
+
export declare function listCollectionHandles(db: VulseDb): Promise<string[]>;
|
|
5
|
+
//# sourceMappingURL=seed.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"seed.d.ts","sourceRoot":"","sources":["../../../src/core/blueprints/seed.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,UAAU,CAAA;AAIvC,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,YAAY,CAAA;AAE3C,wBAAsB,kBAAkB,CAAC,EAAE,EAAE,OAAO,EAAE,cAAc,EAAE,SAAS,EAAE,GAAG,OAAO,CAAC,IAAI,CAAC,CAOhG;AAED,wBAAsB,qBAAqB,CAAC,EAAE,EAAE,OAAO,GAAG,OAAO,CAAC,MAAM,EAAE,CAAC,CAG1E"}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import { eq } from 'drizzle-orm';
|
|
2
|
+
import { vulseCollections } from '../schema.js';
|
|
3
|
+
import { createBlueprint, getBlueprintDefinition } from './mutations.js';
|
|
4
|
+
import { blueprintToDefinition } from './code-to-definition.js';
|
|
5
|
+
export async function seedCodeBlueprints(db, codeBlueprints) {
|
|
6
|
+
for (const bp of codeBlueprints) {
|
|
7
|
+
const existing = await getBlueprintDefinition(db, bp.name);
|
|
8
|
+
if (existing)
|
|
9
|
+
continue;
|
|
10
|
+
const def = blueprintToDefinition(bp);
|
|
11
|
+
await createBlueprint(db, def);
|
|
12
|
+
}
|
|
13
|
+
}
|
|
14
|
+
export async function listCollectionHandles(db) {
|
|
15
|
+
const rows = await db.select({ handle: vulseCollections.handle }).from(vulseCollections);
|
|
16
|
+
return rows.map((r) => r.handle);
|
|
17
|
+
}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import type { SelectOption } from './definition.js';
|
|
2
|
+
export declare function normalizeSelectOptions(options: SelectOption[]): {
|
|
3
|
+
key: string;
|
|
4
|
+
label: string;
|
|
5
|
+
}[];
|
|
6
|
+
export declare function selectOptionKeys(options: SelectOption[]): [string, ...string[]];
|
|
7
|
+
/** Parse blueprint editor textarea: `key` or `key: Label` per line. */
|
|
8
|
+
export declare function parseSelectOptionsText(text: string): SelectOption[];
|
|
9
|
+
export declare function formatSelectOptionsText(options: SelectOption[]): string;
|
|
10
|
+
//# sourceMappingURL=select-helpers.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"select-helpers.d.ts","sourceRoot":"","sources":["../../../src/core/blueprints/select-helpers.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,iBAAiB,CAAA;AAEnD,wBAAgB,sBAAsB,CAAC,OAAO,EAAE,YAAY,EAAE,GAAG;IAAE,GAAG,EAAE,MAAM,CAAC;IAAC,KAAK,EAAE,MAAM,CAAA;CAAE,EAAE,CAEhG;AAED,wBAAgB,gBAAgB,CAAC,OAAO,EAAE,YAAY,EAAE,GAAG,CAAC,MAAM,EAAE,GAAG,MAAM,EAAE,CAAC,CAI/E;AAED,uEAAuE;AACvE,wBAAgB,sBAAsB,CAAC,IAAI,EAAE,MAAM,GAAG,YAAY,EAAE,CAYnE;AAED,wBAAgB,uBAAuB,CAAC,OAAO,EAAE,YAAY,EAAE,GAAG,MAAM,CAEvE"}
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
export function normalizeSelectOptions(options) {
|
|
2
|
+
return options.map((o) => (typeof o === 'string' ? { key: o, label: o } : o));
|
|
3
|
+
}
|
|
4
|
+
export function selectOptionKeys(options) {
|
|
5
|
+
const keys = normalizeSelectOptions(options).map((o) => o.key);
|
|
6
|
+
if (keys.length === 0)
|
|
7
|
+
throw new Error('Select field requires at least one option');
|
|
8
|
+
return keys;
|
|
9
|
+
}
|
|
10
|
+
/** Parse blueprint editor textarea: `key` or `key: Label` per line. */
|
|
11
|
+
export function parseSelectOptionsText(text) {
|
|
12
|
+
return text
|
|
13
|
+
.split('\n')
|
|
14
|
+
.map((s) => s.trim())
|
|
15
|
+
.filter(Boolean)
|
|
16
|
+
.map((line) => {
|
|
17
|
+
const colon = line.indexOf(':');
|
|
18
|
+
if (colon > 0) {
|
|
19
|
+
return { key: line.slice(0, colon).trim(), label: line.slice(colon + 1).trim() };
|
|
20
|
+
}
|
|
21
|
+
return line;
|
|
22
|
+
});
|
|
23
|
+
}
|
|
24
|
+
export function formatSelectOptionsText(options) {
|
|
25
|
+
return options.map((o) => (typeof o === 'string' ? o : `${o.key}: ${o.label}`)).join('\n');
|
|
26
|
+
}
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
import { z } from 'astro/zod';
|
|
2
|
+
import type { FieldDescriptor } from './reflect-fields.js';
|
|
3
|
+
export declare const SEO_FIELD_PATH = "seo";
|
|
4
|
+
export interface SeoContent {
|
|
5
|
+
metaTitle?: string;
|
|
6
|
+
metaDescription?: string;
|
|
7
|
+
ogImage?: string;
|
|
8
|
+
}
|
|
9
|
+
/** Maps blueprint content fields to SEO defaults. Omitted keys use inferred defaults. */
|
|
10
|
+
export interface SeoFieldMapping {
|
|
11
|
+
metaTitle?: string;
|
|
12
|
+
metaDescription?: string;
|
|
13
|
+
ogImage?: string;
|
|
14
|
+
}
|
|
15
|
+
export declare const SeoFieldMappingSchema: z.ZodObject<{
|
|
16
|
+
metaTitle: z.ZodOptional<z.ZodString>;
|
|
17
|
+
metaDescription: z.ZodOptional<z.ZodString>;
|
|
18
|
+
ogImage: z.ZodOptional<z.ZodString>;
|
|
19
|
+
}, z.core.$strip>;
|
|
20
|
+
export interface ResolvedSeoField<T = string> {
|
|
21
|
+
value: T | undefined;
|
|
22
|
+
sourceField?: string;
|
|
23
|
+
overridden: boolean;
|
|
24
|
+
}
|
|
25
|
+
export interface ResolvedSeo {
|
|
26
|
+
metaTitle: ResolvedSeoField;
|
|
27
|
+
metaDescription: ResolvedSeoField;
|
|
28
|
+
ogImage: ResolvedSeoField;
|
|
29
|
+
}
|
|
30
|
+
export declare function seoZodSchema(): z.ZodOptional<z.ZodObject<{
|
|
31
|
+
metaTitle: z.ZodOptional<z.ZodString>;
|
|
32
|
+
metaDescription: z.ZodOptional<z.ZodString>;
|
|
33
|
+
ogImage: z.ZodOptional<z.ZodString>;
|
|
34
|
+
}>>;
|
|
35
|
+
export declare function applySeoToSchema(schema: z.ZodObject<z.ZodRawShape>, seo?: boolean): z.ZodObject<z.ZodRawShape>;
|
|
36
|
+
export declare function emptySeoContent(): SeoContent;
|
|
37
|
+
export declare function resolveSeoFieldMapping(fields: Array<Pick<FieldDescriptor, 'path' | 'widget'>>, titleField: string, mapping?: SeoFieldMapping): SeoFieldMapping;
|
|
38
|
+
export declare function extractSeoFieldValue(value: unknown, widget: FieldDescriptor['widget'] | undefined): string | undefined;
|
|
39
|
+
export declare function resolveEffectiveSeo(content: Record<string, unknown>, explicit: SeoContent | undefined, fields: FieldDescriptor[], titleField: string, mapping?: SeoFieldMapping): ResolvedSeo;
|
|
40
|
+
export declare function resolvedSeoSummary(resolved: ResolvedSeo): string;
|
|
41
|
+
//# sourceMappingURL=seo.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"seo.d.ts","sourceRoot":"","sources":["../../../src/core/blueprints/seo.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,WAAW,CAAA;AAC7B,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,qBAAqB,CAAA;AAE1D,eAAO,MAAM,cAAc,QAAQ,CAAA;AAEnC,MAAM,WAAW,UAAU;IACzB,SAAS,CAAC,EAAE,MAAM,CAAA;IAClB,eAAe,CAAC,EAAE,MAAM,CAAA;IACxB,OAAO,CAAC,EAAE,MAAM,CAAA;CACjB;AAED,yFAAyF;AACzF,MAAM,WAAW,eAAe;IAC9B,SAAS,CAAC,EAAE,MAAM,CAAA;IAClB,eAAe,CAAC,EAAE,MAAM,CAAA;IACxB,OAAO,CAAC,EAAE,MAAM,CAAA;CACjB;AAED,eAAO,MAAM,qBAAqB;;;;iBAIhC,CAAA;AAEF,MAAM,WAAW,gBAAgB,CAAC,CAAC,GAAG,MAAM;IAC1C,KAAK,EAAE,CAAC,GAAG,SAAS,CAAA;IACpB,WAAW,CAAC,EAAE,MAAM,CAAA;IACpB,UAAU,EAAE,OAAO,CAAA;CACpB;AAED,MAAM,WAAW,WAAW;IAC1B,SAAS,EAAE,gBAAgB,CAAA;IAC3B,eAAe,EAAE,gBAAgB,CAAA;IACjC,OAAO,EAAE,gBAAgB,CAAA;CAC1B;AAQD,wBAAgB,YAAY,IAAI,CAAC,CAAC,WAAW,CAAC,CAAC,CAAC,SAAS,CAAC;IACxD,SAAS,EAAE,CAAC,CAAC,WAAW,CAAC,CAAC,CAAC,SAAS,CAAC,CAAA;IACrC,eAAe,EAAE,CAAC,CAAC,WAAW,CAAC,CAAC,CAAC,SAAS,CAAC,CAAA;IAC3C,OAAO,EAAE,CAAC,CAAC,WAAW,CAAC,CAAC,CAAC,SAAS,CAAC,CAAA;CACpC,CAAC,CAAC,CAMF;AAED,wBAAgB,gBAAgB,CAC9B,MAAM,EAAE,CAAC,CAAC,SAAS,CAAC,CAAC,CAAC,WAAW,CAAC,EAClC,GAAG,CAAC,EAAE,OAAO,GACZ,CAAC,CAAC,SAAS,CAAC,CAAC,CAAC,WAAW,CAAC,CAO5B;AAED,wBAAgB,eAAe,IAAI,UAAU,CAE5C;AA2BD,wBAAgB,sBAAsB,CACpC,MAAM,EAAE,KAAK,CAAC,IAAI,CAAC,eAAe,EAAE,MAAM,GAAG,QAAQ,CAAC,CAAC,EACvD,UAAU,EAAE,MAAM,EAClB,OAAO,CAAC,EAAE,eAAe,GACxB,eAAe,CAcjB;AAED,wBAAgB,oBAAoB,CAClC,KAAK,EAAE,OAAO,EACd,MAAM,EAAE,eAAe,CAAC,QAAQ,CAAC,GAAG,SAAS,GAC5C,MAAM,GAAG,SAAS,CAcpB;AAED,wBAAgB,mBAAmB,CACjC,OAAO,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,EAChC,QAAQ,EAAE,UAAU,GAAG,SAAS,EAChC,MAAM,EAAE,eAAe,EAAE,EACzB,UAAU,EAAE,MAAM,EAClB,OAAO,CAAC,EAAE,eAAe,GACxB,WAAW,CA8Bb;AAED,wBAAgB,kBAAkB,CAAC,QAAQ,EAAE,WAAW,GAAG,MAAM,CAOhE"}
|
|
@@ -0,0 +1,125 @@
|
|
|
1
|
+
import { z } from 'astro/zod';
|
|
2
|
+
export const SEO_FIELD_PATH = 'seo';
|
|
3
|
+
export const SeoFieldMappingSchema = z.object({
|
|
4
|
+
metaTitle: z.string().regex(/^[a-zA-Z_][a-zA-Z0-9_]*$/).optional(),
|
|
5
|
+
metaDescription: z.string().regex(/^[a-zA-Z_][a-zA-Z0-9_]*$/).optional(),
|
|
6
|
+
ogImage: z.string().regex(/^[a-zA-Z_][a-zA-Z0-9_]*$/).optional(),
|
|
7
|
+
});
|
|
8
|
+
export function seoZodSchema() {
|
|
9
|
+
return z.object({
|
|
10
|
+
metaTitle: z.string().max(70).optional(),
|
|
11
|
+
metaDescription: z.string().max(160).optional(),
|
|
12
|
+
ogImage: z.string().describe('vulse:media').optional(),
|
|
13
|
+
}).optional();
|
|
14
|
+
}
|
|
15
|
+
export function applySeoToSchema(schema, seo) {
|
|
16
|
+
if (!seo)
|
|
17
|
+
return schema;
|
|
18
|
+
if (SEO_FIELD_PATH in schema.shape)
|
|
19
|
+
return schema;
|
|
20
|
+
return z.object({
|
|
21
|
+
...schema.shape,
|
|
22
|
+
[SEO_FIELD_PATH]: seoZodSchema(),
|
|
23
|
+
});
|
|
24
|
+
}
|
|
25
|
+
export function emptySeoContent() {
|
|
26
|
+
return {};
|
|
27
|
+
}
|
|
28
|
+
function isProseMirrorDoc(v) {
|
|
29
|
+
return typeof v === 'object' && v !== null && v.type === 'doc';
|
|
30
|
+
}
|
|
31
|
+
function plainTextFromRichContent(value) {
|
|
32
|
+
if (typeof value === 'string')
|
|
33
|
+
return value.replace(/\s+/g, ' ').trim();
|
|
34
|
+
if (!isProseMirrorDoc(value))
|
|
35
|
+
return '';
|
|
36
|
+
const parts = [];
|
|
37
|
+
function walk(nodes) {
|
|
38
|
+
for (const node of nodes ?? []) {
|
|
39
|
+
if (node.type === 'text')
|
|
40
|
+
parts.push(node.text ?? '');
|
|
41
|
+
else
|
|
42
|
+
walk(node.content);
|
|
43
|
+
}
|
|
44
|
+
}
|
|
45
|
+
walk(value.content);
|
|
46
|
+
return parts.join(' ').replace(/\s+/g, ' ').trim();
|
|
47
|
+
}
|
|
48
|
+
function truncateDescription(text, max = 160) {
|
|
49
|
+
if (text.length <= max)
|
|
50
|
+
return text;
|
|
51
|
+
const slice = text.slice(0, max);
|
|
52
|
+
const lastSpace = slice.lastIndexOf(' ');
|
|
53
|
+
return (lastSpace > 0 ? slice.slice(0, lastSpace) : slice).trim();
|
|
54
|
+
}
|
|
55
|
+
export function resolveSeoFieldMapping(fields, titleField, mapping) {
|
|
56
|
+
const mediaField = fields.find((f) => f.widget === 'media')?.path;
|
|
57
|
+
const textareaField = fields.find((f) => f.widget === 'textarea')?.path;
|
|
58
|
+
const blocksField = fields.find((f) => f.widget === 'blocks')?.path;
|
|
59
|
+
const textField = fields.find((f) => f.widget === 'text' && f.path !== titleField)?.path;
|
|
60
|
+
const resolved = {
|
|
61
|
+
metaTitle: mapping?.metaTitle ?? titleField,
|
|
62
|
+
};
|
|
63
|
+
const metaDescription = mapping?.metaDescription ?? textareaField ?? blocksField ?? textField;
|
|
64
|
+
if (metaDescription)
|
|
65
|
+
resolved.metaDescription = metaDescription;
|
|
66
|
+
const ogImage = mapping?.ogImage ?? mediaField;
|
|
67
|
+
if (ogImage)
|
|
68
|
+
resolved.ogImage = ogImage;
|
|
69
|
+
return resolved;
|
|
70
|
+
}
|
|
71
|
+
export function extractSeoFieldValue(value, widget) {
|
|
72
|
+
if (value === null || value === undefined)
|
|
73
|
+
return undefined;
|
|
74
|
+
switch (widget) {
|
|
75
|
+
case 'media':
|
|
76
|
+
return typeof value === 'string' && value ? value : undefined;
|
|
77
|
+
case 'textarea':
|
|
78
|
+
case 'text':
|
|
79
|
+
return typeof value === 'string' && value.trim() ? value.trim() : undefined;
|
|
80
|
+
case 'blocks':
|
|
81
|
+
return plainTextFromRichContent(value) || undefined;
|
|
82
|
+
default:
|
|
83
|
+
if (typeof value === 'string' && value.trim())
|
|
84
|
+
return value.trim();
|
|
85
|
+
return undefined;
|
|
86
|
+
}
|
|
87
|
+
}
|
|
88
|
+
export function resolveEffectiveSeo(content, explicit, fields, titleField, mapping) {
|
|
89
|
+
const fieldByPath = new Map(fields.map((f) => [f.path, f]));
|
|
90
|
+
const resolvedMapping = resolveSeoFieldMapping(fields, titleField, mapping);
|
|
91
|
+
function resolveField(key, mapKey, transform) {
|
|
92
|
+
const rawOverride = explicit?.[key];
|
|
93
|
+
if (key === 'ogImage') {
|
|
94
|
+
if (typeof rawOverride === 'string' && rawOverride) {
|
|
95
|
+
return { value: rawOverride, overridden: true };
|
|
96
|
+
}
|
|
97
|
+
}
|
|
98
|
+
else if (typeof rawOverride === 'string' && rawOverride.trim()) {
|
|
99
|
+
return { value: rawOverride.trim(), overridden: true };
|
|
100
|
+
}
|
|
101
|
+
const sourceField = resolvedMapping[mapKey];
|
|
102
|
+
if (!sourceField)
|
|
103
|
+
return { value: undefined, overridden: false };
|
|
104
|
+
const widget = fieldByPath.get(sourceField)?.widget;
|
|
105
|
+
const raw = extractSeoFieldValue(content[sourceField], widget);
|
|
106
|
+
const value = raw && transform ? transform(raw) : raw;
|
|
107
|
+
return { value, sourceField, overridden: false };
|
|
108
|
+
}
|
|
109
|
+
return {
|
|
110
|
+
metaTitle: resolveField('metaTitle', 'metaTitle'),
|
|
111
|
+
metaDescription: resolveField('metaDescription', 'metaDescription', truncateDescription),
|
|
112
|
+
ogImage: resolveField('ogImage', 'ogImage'),
|
|
113
|
+
};
|
|
114
|
+
}
|
|
115
|
+
export function resolvedSeoSummary(resolved) {
|
|
116
|
+
const title = resolved.metaTitle.value?.trim();
|
|
117
|
+
if (title)
|
|
118
|
+
return title;
|
|
119
|
+
const description = resolved.metaDescription.value?.trim();
|
|
120
|
+
if (description)
|
|
121
|
+
return truncateDescription(description, 70);
|
|
122
|
+
if (resolved.ogImage.value)
|
|
123
|
+
return 'Image configured';
|
|
124
|
+
return 'No defaults available yet';
|
|
125
|
+
}
|
|
@@ -0,0 +1,60 @@
|
|
|
1
|
+
import type { z } from 'astro/zod';
|
|
2
|
+
import type { BlueprintDefinition, FieldDefinition } from './definition.js';
|
|
3
|
+
export type Role = 'admin' | 'editor' | 'member';
|
|
4
|
+
export interface AuthContext {
|
|
5
|
+
user: {
|
|
6
|
+
id: string;
|
|
7
|
+
role: Role;
|
|
8
|
+
email: string;
|
|
9
|
+
} | null;
|
|
10
|
+
}
|
|
11
|
+
export interface AccessArgs<T = unknown> extends AuthContext {
|
|
12
|
+
entry?: {
|
|
13
|
+
id: string;
|
|
14
|
+
status: 'draft' | 'published';
|
|
15
|
+
createdBy: string | null;
|
|
16
|
+
content: T;
|
|
17
|
+
};
|
|
18
|
+
}
|
|
19
|
+
export type AccessFn<T = unknown> = (args: AccessArgs<T>) => boolean | Promise<boolean>;
|
|
20
|
+
import type { SeoFieldMapping } from './seo.js';
|
|
21
|
+
export interface AdminConfig {
|
|
22
|
+
titleField: string;
|
|
23
|
+
listColumns?: string[];
|
|
24
|
+
/** Maps content fields to SEO defaults in the entry editor. */
|
|
25
|
+
seoMapping?: SeoFieldMapping;
|
|
26
|
+
}
|
|
27
|
+
export interface PreviewConfig {
|
|
28
|
+
/**
|
|
29
|
+
* URL template for the public-facing entry page. `{slug}` is replaced with
|
|
30
|
+
* the entry's URL slug. Defaults to `/{slug}` if omitted.
|
|
31
|
+
* Example: `/recipes/{slug}` or `/blog/{slug}`.
|
|
32
|
+
*/
|
|
33
|
+
path: string;
|
|
34
|
+
/** DOM selector for live preview morph target. Defaults to `main`. */
|
|
35
|
+
rootSelector?: string;
|
|
36
|
+
/** When `false`, hides the live preview split panel (Preview button still works). Defaults to `true`. */
|
|
37
|
+
live?: boolean;
|
|
38
|
+
}
|
|
39
|
+
export interface BlueprintAccess<T = unknown> {
|
|
40
|
+
read?: AccessFn<T>;
|
|
41
|
+
create?: AccessFn<T>;
|
|
42
|
+
update?: AccessFn<T>;
|
|
43
|
+
delete?: AccessFn<T>;
|
|
44
|
+
}
|
|
45
|
+
export interface Blueprint<S extends z.ZodTypeAny = z.ZodTypeAny> {
|
|
46
|
+
name: string;
|
|
47
|
+
label: string;
|
|
48
|
+
schema: S;
|
|
49
|
+
admin: AdminConfig;
|
|
50
|
+
access?: BlueprintAccess<z.infer<S>>;
|
|
51
|
+
preview?: PreviewConfig;
|
|
52
|
+
singleton?: boolean;
|
|
53
|
+
tree?: boolean;
|
|
54
|
+
maxDepth?: number;
|
|
55
|
+
drafts?: boolean;
|
|
56
|
+
seo?: boolean;
|
|
57
|
+
fields?: FieldDefinition[];
|
|
58
|
+
definition?: BlueprintDefinition;
|
|
59
|
+
}
|
|
60
|
+
//# sourceMappingURL=types.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../src/core/blueprints/types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,CAAC,EAAE,MAAM,WAAW,CAAA;AAClC,OAAO,KAAK,EAAE,mBAAmB,EAAE,eAAe,EAAE,MAAM,iBAAiB,CAAA;AAE3E,MAAM,MAAM,IAAI,GAAG,OAAO,GAAG,QAAQ,GAAG,QAAQ,CAAA;AAEhD,MAAM,WAAW,WAAW;IAC1B,IAAI,EAAE;QAAE,EAAE,EAAE,MAAM,CAAC;QAAC,IAAI,EAAE,IAAI,CAAC;QAAC,KAAK,EAAE,MAAM,CAAA;KAAE,GAAG,IAAI,CAAA;CACvD;AAED,MAAM,WAAW,UAAU,CAAC,CAAC,GAAG,OAAO,CAAE,SAAQ,WAAW;IAC1D,KAAK,CAAC,EAAE;QAAE,EAAE,EAAE,MAAM,CAAC;QAAC,MAAM,EAAE,OAAO,GAAG,WAAW,CAAC;QAAC,SAAS,EAAE,MAAM,GAAG,IAAI,CAAC;QAAC,OAAO,EAAE,CAAC,CAAA;KAAE,CAAA;CAC5F;AAED,MAAM,MAAM,QAAQ,CAAC,CAAC,GAAG,OAAO,IAAI,CAAC,IAAI,EAAE,UAAU,CAAC,CAAC,CAAC,KAAK,OAAO,GAAG,OAAO,CAAC,OAAO,CAAC,CAAA;AAEvF,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,UAAU,CAAA;AAE/C,MAAM,WAAW,WAAW;IAC1B,UAAU,EAAE,MAAM,CAAA;IAClB,WAAW,CAAC,EAAE,MAAM,EAAE,CAAA;IACtB,+DAA+D;IAC/D,UAAU,CAAC,EAAE,eAAe,CAAA;CAC7B;AAED,MAAM,WAAW,aAAa;IAC5B;;;;OAIG;IACH,IAAI,EAAE,MAAM,CAAA;IACZ,sEAAsE;IACtE,YAAY,CAAC,EAAE,MAAM,CAAA;IACrB,yGAAyG;IACzG,IAAI,CAAC,EAAE,OAAO,CAAA;CACf;AAED,MAAM,WAAW,eAAe,CAAC,CAAC,GAAG,OAAO;IAC1C,IAAI,CAAC,EAAE,QAAQ,CAAC,CAAC,CAAC,CAAA;IAClB,MAAM,CAAC,EAAE,QAAQ,CAAC,CAAC,CAAC,CAAA;IACpB,MAAM,CAAC,EAAE,QAAQ,CAAC,CAAC,CAAC,CAAA;IACpB,MAAM,CAAC,EAAE,QAAQ,CAAC,CAAC,CAAC,CAAA;CACrB;AAED,MAAM,WAAW,SAAS,CAAC,CAAC,SAAS,CAAC,CAAC,UAAU,GAAG,CAAC,CAAC,UAAU;IAC9D,IAAI,EAAE,MAAM,CAAA;IACZ,KAAK,EAAE,MAAM,CAAA;IACb,MAAM,EAAE,CAAC,CAAA;IACT,KAAK,EAAE,WAAW,CAAA;IAClB,MAAM,CAAC,EAAE,eAAe,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,CAAA;IACpC,OAAO,CAAC,EAAE,aAAa,CAAA;IACvB,SAAS,CAAC,EAAE,OAAO,CAAA;IACnB,IAAI,CAAC,EAAE,OAAO,CAAA;IACd,QAAQ,CAAC,EAAE,MAAM,CAAA;IACjB,MAAM,CAAC,EAAE,OAAO,CAAA;IAChB,GAAG,CAAC,EAAE,OAAO,CAAA;IACb,MAAM,CAAC,EAAE,eAAe,EAAE,CAAA;IAC1B,UAAU,CAAC,EAAE,mBAAmB,CAAA;CACjC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,79 @@
|
|
|
1
|
+
import { z as astroZ, type ZodRawShape, type ZodTypeAny } from 'astro/zod';
|
|
2
|
+
export declare const EMPTY_BLOCKS_DOC: {
|
|
3
|
+
readonly type: "doc";
|
|
4
|
+
readonly content: readonly [{
|
|
5
|
+
readonly type: "paragraph";
|
|
6
|
+
}];
|
|
7
|
+
};
|
|
8
|
+
export declare function blocks(sets?: string[]): astroZ.ZodDefault<astroZ.ZodAny>;
|
|
9
|
+
/** Legacy flat block list (deprecated). */
|
|
10
|
+
export declare function blocksLegacy(): astroZ.ZodDefault<astroZ.ZodArray<astroZ.ZodDiscriminatedUnion<[astroZ.ZodObject<{
|
|
11
|
+
type: astroZ.ZodLiteral<"heading">;
|
|
12
|
+
level: astroZ.ZodUnion<readonly [astroZ.ZodLiteral<1>, astroZ.ZodLiteral<2>, astroZ.ZodLiteral<3>, astroZ.ZodLiteral<4>]>;
|
|
13
|
+
text: astroZ.ZodString;
|
|
14
|
+
id: astroZ.ZodOptional<astroZ.ZodString>;
|
|
15
|
+
}, astroZ.z.core.$strip>, astroZ.ZodObject<{
|
|
16
|
+
type: astroZ.ZodLiteral<"paragraph">;
|
|
17
|
+
text: astroZ.ZodString;
|
|
18
|
+
id: astroZ.ZodOptional<astroZ.ZodString>;
|
|
19
|
+
}, astroZ.z.core.$strip>, astroZ.ZodObject<{
|
|
20
|
+
type: astroZ.ZodLiteral<"image">;
|
|
21
|
+
mediaId: astroZ.ZodString;
|
|
22
|
+
alt: astroZ.ZodDefault<astroZ.ZodString>;
|
|
23
|
+
caption: astroZ.ZodOptional<astroZ.ZodString>;
|
|
24
|
+
id: astroZ.ZodOptional<astroZ.ZodString>;
|
|
25
|
+
}, astroZ.z.core.$strip>, astroZ.ZodObject<{
|
|
26
|
+
type: astroZ.ZodLiteral<"code">;
|
|
27
|
+
language: astroZ.ZodString;
|
|
28
|
+
code: astroZ.ZodString;
|
|
29
|
+
id: astroZ.ZodOptional<astroZ.ZodString>;
|
|
30
|
+
}, astroZ.z.core.$strip>, astroZ.ZodObject<{
|
|
31
|
+
type: astroZ.ZodLiteral<"embed">;
|
|
32
|
+
url: astroZ.ZodString;
|
|
33
|
+
id: astroZ.ZodOptional<astroZ.ZodString>;
|
|
34
|
+
}, astroZ.z.core.$strip>, astroZ.ZodObject<{
|
|
35
|
+
type: astroZ.ZodLiteral<"quote">;
|
|
36
|
+
text: astroZ.ZodString;
|
|
37
|
+
cite: astroZ.ZodOptional<astroZ.ZodString>;
|
|
38
|
+
id: astroZ.ZodOptional<astroZ.ZodString>;
|
|
39
|
+
}, astroZ.z.core.$strip>, astroZ.ZodObject<{
|
|
40
|
+
type: astroZ.ZodLiteral<"list">;
|
|
41
|
+
ordered: astroZ.ZodDefault<astroZ.ZodBoolean>;
|
|
42
|
+
items: astroZ.ZodArray<astroZ.ZodString>;
|
|
43
|
+
id: astroZ.ZodOptional<astroZ.ZodString>;
|
|
44
|
+
}, astroZ.z.core.$strip>], "type">>>;
|
|
45
|
+
/** Media reference: stored as the media row's id; resolved at read time. */
|
|
46
|
+
export declare function media(): astroZ.ZodString;
|
|
47
|
+
/** Reference to another collection (or 'user'). Kept for backward compatibility. */
|
|
48
|
+
export declare function ref(target: string): astroZ.ZodString;
|
|
49
|
+
/** Single entry picker from one or more collections. */
|
|
50
|
+
export declare function entry(...collections: string[]): astroZ.ZodString;
|
|
51
|
+
/** Multi-entry picker from one or more collections. */
|
|
52
|
+
export declare function entries(collections: string[], max?: number): astroZ.ZodArray<astroZ.ZodString>;
|
|
53
|
+
/** URL, entry, or first-child link value. */
|
|
54
|
+
export declare function link(collections?: string[]): astroZ.ZodDiscriminatedUnion<[astroZ.ZodObject<{
|
|
55
|
+
type: astroZ.ZodLiteral<"url">;
|
|
56
|
+
url: astroZ.ZodString;
|
|
57
|
+
}, astroZ.z.core.$strip>, astroZ.ZodObject<{
|
|
58
|
+
type: astroZ.ZodLiteral<"entry">;
|
|
59
|
+
entryId: astroZ.ZodString;
|
|
60
|
+
collection: astroZ.ZodString;
|
|
61
|
+
}, astroZ.z.core.$strip>, astroZ.ZodObject<{
|
|
62
|
+
type: astroZ.ZodLiteral<"first-child">;
|
|
63
|
+
}, astroZ.z.core.$strip>], "type">;
|
|
64
|
+
/** Homogeneous row grid (array of objects with fixed columns). */
|
|
65
|
+
export declare function grid<T extends ZodRawShape>(fields: T, opts?: {
|
|
66
|
+
minRows?: number;
|
|
67
|
+
maxRows?: number;
|
|
68
|
+
}): astroZ.ZodArray<astroZ.ZodObject<{ -readonly [P in keyof T]: T[P]; }, astroZ.z.core.$strip>>;
|
|
69
|
+
export type VulseZ = typeof astroZ & {
|
|
70
|
+
media: typeof media;
|
|
71
|
+
ref: typeof ref;
|
|
72
|
+
entry: typeof entry;
|
|
73
|
+
entries: typeof entries;
|
|
74
|
+
link: typeof link;
|
|
75
|
+
grid: typeof grid;
|
|
76
|
+
};
|
|
77
|
+
export declare const z: VulseZ;
|
|
78
|
+
export type { ZodTypeAny };
|
|
79
|
+
//# sourceMappingURL=zod-helpers.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"zod-helpers.d.ts","sourceRoot":"","sources":["../../../src/core/blueprints/zod-helpers.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,IAAI,MAAM,EAAE,KAAK,WAAW,EAAE,KAAK,UAAU,EAAE,MAAM,WAAW,CAAA;AAI1E,eAAO,MAAM,gBAAgB;;;;;CAGnB,CAAA;AAEV,wBAAgB,MAAM,CAAC,IAAI,CAAC,EAAE,MAAM,EAAE,oCAGrC;AAED,2CAA2C;AAC3C,wBAAgB,YAAY;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;qCAE3B;AAED,4EAA4E;AAC5E,wBAAgB,KAAK,qBAEpB;AAED,oFAAoF;AACpF,wBAAgB,GAAG,CAAC,MAAM,EAAE,MAAM,oBAEjC;AAED,wDAAwD;AACxD,wBAAgB,KAAK,CAAC,GAAG,WAAW,EAAE,MAAM,EAAE,oBAG7C;AAED,uDAAuD;AACvD,wBAAgB,OAAO,CAAC,WAAW,EAAE,MAAM,EAAE,EAAE,GAAG,CAAC,EAAE,MAAM,qCAS1D;AAED,6CAA6C;AAC7C,wBAAgB,IAAI,CAAC,WAAW,CAAC,EAAE,MAAM,EAAE;;;;;;;;;mCAG1C;AAED,kEAAkE;AAClE,wBAAgB,IAAI,CAAC,CAAC,SAAS,WAAW,EACxC,MAAM,EAAE,CAAC,EACT,IAAI,CAAC,EAAE;IAAE,OAAO,CAAC,EAAE,MAAM,CAAC;IAAC,OAAO,CAAC,EAAE,MAAM,CAAA;CAAE,gGAM9C;AAED,MAAM,MAAM,MAAM,GAAG,OAAO,MAAM,GAAG;IACnC,KAAK,EAAE,OAAO,KAAK,CAAA;IACnB,GAAG,EAAE,OAAO,GAAG,CAAA;IACf,KAAK,EAAE,OAAO,KAAK,CAAA;IACnB,OAAO,EAAE,OAAO,OAAO,CAAA;IACvB,IAAI,EAAE,OAAO,IAAI,CAAA;IACjB,IAAI,EAAE,OAAO,IAAI,CAAA;CAClB,CAAA;AAED,eAAO,MAAM,CAAC,EAAE,MAUJ,CAAA;AAEZ,YAAY,EAAE,UAAU,EAAE,CAAA"}
|