@kardalum/plugin-sdk 0.0.0-stage → 0.15.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +108 -0
- package/LICENSE +202 -0
- package/README.md +70 -2
- package/dist/admin-section-registry.d.ts +34 -0
- package/dist/admin-section-registry.js +49 -0
- package/dist/built-in-serializers.d.ts +3 -0
- package/dist/built-in-serializers.js +18 -0
- package/dist/built-in-settings-schemas.d.ts +14 -0
- package/dist/built-in-settings-schemas.js +225 -0
- package/dist/built-in-value-schemas.d.ts +4 -0
- package/dist/built-in-value-schemas.js +47 -0
- package/dist/built-ins.d.ts +1 -0
- package/dist/built-ins.js +257 -0
- package/dist/capabilities.d.ts +99 -0
- package/dist/capabilities.js +363 -0
- package/dist/data-type-plugin.d.ts +28 -0
- package/dist/data-type-plugin.js +1 -0
- package/dist/datatype-validation.d.ts +26 -0
- package/dist/datatype-validation.js +110 -0
- package/dist/datatypes-entry.d.ts +4 -0
- package/dist/datatypes-entry.js +18 -0
- package/dist/define-plugin.d.ts +25 -0
- package/dist/define-plugin.js +51 -0
- package/dist/entitlement-entry.d.ts +5 -0
- package/dist/entitlement-entry.js +24 -0
- package/dist/entitlement-gate.d.ts +36 -0
- package/dist/entitlement-gate.js +201 -0
- package/dist/entitlement-types.d.ts +39 -0
- package/dist/entitlement-types.js +1 -0
- package/dist/entitlement.d.ts +57 -0
- package/dist/entitlement.js +170 -0
- package/dist/host-entry.d.ts +1 -0
- package/dist/host-entry.js +11 -0
- package/dist/icon-name.d.ts +1 -0
- package/dist/icon-name.js +1 -0
- package/dist/icons.d.ts +2 -0
- package/dist/icons.js +10 -0
- package/dist/index.d.ts +28 -0
- package/dist/index.js +93 -0
- package/dist/license-verdict-keys.d.ts +18 -0
- package/dist/license-verdict-keys.js +22 -0
- package/dist/local-host.d.ts +3 -0
- package/dist/local-host.js +38 -0
- package/dist/manifest-entry.d.ts +8 -0
- package/dist/manifest-entry.js +13 -0
- package/dist/manifest-schema.d.ts +408 -0
- package/dist/manifest-schema.js +774 -0
- package/dist/manifest.d.ts +546 -0
- package/dist/manifest.js +86 -0
- package/dist/media/media-picker.d.ts +39 -0
- package/dist/media/media-picker.js +438 -0
- package/dist/media/upload-error.d.ts +12 -0
- package/dist/media/upload-error.js +30 -0
- package/dist/plugin-context.d.ts +75 -0
- package/dist/plugin-context.js +70 -0
- package/dist/plugin-screen-context.d.ts +40 -0
- package/dist/plugin-screen-context.js +16 -0
- package/dist/register-built-ins.d.ts +1 -0
- package/dist/register-built-ins.js +41 -0
- package/dist/registry.d.ts +4 -0
- package/dist/registry.js +17 -0
- package/dist/rendition-eligibility.d.ts +24 -0
- package/dist/rendition-eligibility.js +40 -0
- package/dist/richtext/block-panel.d.ts +27 -0
- package/dist/richtext/block-panel.js +232 -0
- package/dist/richtext/extensions.d.ts +19 -0
- package/dist/richtext/extensions.js +56 -0
- package/dist/richtext/insert-menu.d.ts +24 -0
- package/dist/richtext/insert-menu.js +142 -0
- package/dist/richtext/kardalum-block.d.ts +33 -0
- package/dist/richtext/kardalum-block.js +282 -0
- package/dist/richtext/style-listbox.d.ts +10 -0
- package/dist/richtext/style-listbox.js +69 -0
- package/dist/richtext/text-style-class.d.ts +18 -0
- package/dist/richtext/text-style-class.js +36 -0
- package/dist/simple-storage-value-provider.d.ts +9 -0
- package/dist/simple-storage-value-provider.js +96 -0
- package/dist/structured-storage-types.d.ts +61 -0
- package/dist/structured-storage-types.js +11 -0
- package/dist/tailwind.d.ts +1 -0
- package/dist/tailwind.js +5 -0
- package/dist/tokens/system-dark.css +75 -0
- package/dist/tokens/tokens.css +239 -0
- package/dist/tokens/tokens.json +212 -0
- package/dist/tokens.d.ts +1 -0
- package/dist/tokens.js +11 -0
- package/dist/ui-entry.d.ts +5 -0
- package/dist/ui-entry.js +42 -0
- package/dist/views/content-list-preview.d.ts +1 -0
- package/dist/views/content-list-preview.js +14 -0
- package/dist/views/content-list-settings-view.d.ts +1 -0
- package/dist/views/content-list-settings-view.js +97 -0
- package/dist/views/content-list-view.d.ts +19 -0
- package/dist/views/content-list-view.js +248 -0
- package/dist/views/crop-view.d.ts +55 -0
- package/dist/views/crop-view.js +161 -0
- package/dist/views/date-range-view.d.ts +6 -0
- package/dist/views/date-range-view.js +55 -0
- package/dist/views/file-upload-view.d.ts +43 -0
- package/dist/views/file-upload-view.js +104 -0
- package/dist/views/html-code-editor.d.ts +10 -0
- package/dist/views/html-code-editor.js +101 -0
- package/dist/views/html-view.d.ts +3 -0
- package/dist/views/html-view.js +53 -0
- package/dist/views/image-view.d.ts +3 -0
- package/dist/views/image-view.js +387 -0
- package/dist/views/rich-text-view.d.ts +2 -0
- package/dist/views/rich-text-view.js +429 -0
- package/node_modules/@kardalum/api-schemas/LICENSE +202 -0
- package/node_modules/@kardalum/api-schemas/README.md +56 -0
- package/node_modules/@kardalum/api-schemas/dist/action.schema.d.ts +30 -0
- package/node_modules/@kardalum/api-schemas/dist/action.schema.js +88 -0
- package/node_modules/@kardalum/api-schemas/dist/api-error.schema.d.ts +5 -0
- package/node_modules/@kardalum/api-schemas/dist/api-error.schema.js +6 -0
- package/node_modules/@kardalum/api-schemas/dist/api-key-api.schema.d.ts +75 -0
- package/node_modules/@kardalum/api-schemas/dist/api-key-api.schema.js +36 -0
- package/node_modules/@kardalum/api-schemas/dist/asset-api.schema.d.ts +89 -0
- package/node_modules/@kardalum/api-schemas/dist/asset-api.schema.js +60 -0
- package/node_modules/@kardalum/api-schemas/dist/asset.schema.d.ts +24 -0
- package/node_modules/@kardalum/api-schemas/dist/asset.schema.js +47 -0
- package/node_modules/@kardalum/api-schemas/dist/auth.schema.d.ts +38 -0
- package/node_modules/@kardalum/api-schemas/dist/auth.schema.js +38 -0
- package/node_modules/@kardalum/api-schemas/dist/content-api.schema.d.ts +537 -0
- package/node_modules/@kardalum/api-schemas/dist/content-api.schema.js +353 -0
- package/node_modules/@kardalum/api-schemas/dist/content-list.schema.d.ts +158 -0
- package/node_modules/@kardalum/api-schemas/dist/content-list.schema.js +139 -0
- package/node_modules/@kardalum/api-schemas/dist/content-path.d.ts +125 -0
- package/node_modules/@kardalum/api-schemas/dist/content-path.js +256 -0
- package/node_modules/@kardalum/api-schemas/dist/content-trash-api.schema.d.ts +20 -0
- package/node_modules/@kardalum/api-schemas/dist/content-trash-api.schema.js +23 -0
- package/node_modules/@kardalum/api-schemas/dist/content-trash.schema.d.ts +151 -0
- package/node_modules/@kardalum/api-schemas/dist/content-trash.schema.js +82 -0
- package/node_modules/@kardalum/api-schemas/dist/content-version.schema.d.ts +18 -0
- package/node_modules/@kardalum/api-schemas/dist/content-version.schema.js +22 -0
- package/node_modules/@kardalum/api-schemas/dist/content.schema.d.ts +17 -0
- package/node_modules/@kardalum/api-schemas/dist/content.schema.js +20 -0
- package/node_modules/@kardalum/api-schemas/dist/core-actions.d.ts +302 -0
- package/node_modules/@kardalum/api-schemas/dist/core-actions.js +97 -0
- package/node_modules/@kardalum/api-schemas/dist/culture-direction.d.ts +1 -0
- package/node_modules/@kardalum/api-schemas/dist/culture-direction.js +9 -0
- package/node_modules/@kardalum/api-schemas/dist/data-type-api.schema.d.ts +36 -0
- package/node_modules/@kardalum/api-schemas/dist/data-type-api.schema.js +32 -0
- package/node_modules/@kardalum/api-schemas/dist/data-type-config.schema.d.ts +9 -0
- package/node_modules/@kardalum/api-schemas/dist/data-type-config.schema.js +32 -0
- package/node_modules/@kardalum/api-schemas/dist/document-type-api.schema.d.ts +296 -0
- package/node_modules/@kardalum/api-schemas/dist/document-type-api.schema.js +138 -0
- package/node_modules/@kardalum/api-schemas/dist/document-type.schema.d.ts +121 -0
- package/node_modules/@kardalum/api-schemas/dist/document-type.schema.js +147 -0
- package/node_modules/@kardalum/api-schemas/dist/health.schema.d.ts +6 -0
- package/node_modules/@kardalum/api-schemas/dist/health.schema.js +5 -0
- package/node_modules/@kardalum/api-schemas/dist/html-entities.d.ts +4 -0
- package/node_modules/@kardalum/api-schemas/dist/html-entities.js +250 -0
- package/node_modules/@kardalum/api-schemas/dist/index.d.ts +102 -0
- package/node_modules/@kardalum/api-schemas/dist/index.js +58 -0
- package/node_modules/@kardalum/api-schemas/dist/licensing.schema.d.ts +15 -0
- package/node_modules/@kardalum/api-schemas/dist/licensing.schema.js +14 -0
- package/node_modules/@kardalum/api-schemas/dist/marketplace-listing-api.schema.d.ts +381 -0
- package/node_modules/@kardalum/api-schemas/dist/marketplace-listing-api.schema.js +197 -0
- package/node_modules/@kardalum/api-schemas/dist/media-api.schema.d.ts +167 -0
- package/node_modules/@kardalum/api-schemas/dist/media-api.schema.js +214 -0
- package/node_modules/@kardalum/api-schemas/dist/media-reference-api.schema.d.ts +77 -0
- package/node_modules/@kardalum/api-schemas/dist/media-reference-api.schema.js +53 -0
- package/node_modules/@kardalum/api-schemas/dist/media-reference-use.d.ts +75 -0
- package/node_modules/@kardalum/api-schemas/dist/media-reference-use.js +117 -0
- package/node_modules/@kardalum/api-schemas/dist/media-reference.d.ts +27 -0
- package/node_modules/@kardalum/api-schemas/dist/media-reference.js +279 -0
- package/node_modules/@kardalum/api-schemas/dist/media-rendition.schema.d.ts +74 -0
- package/node_modules/@kardalum/api-schemas/dist/media-rendition.schema.js +157 -0
- package/node_modules/@kardalum/api-schemas/dist/media.schema.d.ts +80 -0
- package/node_modules/@kardalum/api-schemas/dist/media.schema.js +156 -0
- package/node_modules/@kardalum/api-schemas/dist/nav.schema.d.ts +23 -0
- package/node_modules/@kardalum/api-schemas/dist/nav.schema.js +55 -0
- package/node_modules/@kardalum/api-schemas/dist/node-access.schema.d.ts +846 -0
- package/node_modules/@kardalum/api-schemas/dist/node-access.schema.js +356 -0
- package/node_modules/@kardalum/api-schemas/dist/plugin-actions.schema.d.ts +20 -0
- package/node_modules/@kardalum/api-schemas/dist/plugin-actions.schema.js +27 -0
- package/node_modules/@kardalum/api-schemas/dist/plugin-docs-api.schema.d.ts +169 -0
- package/node_modules/@kardalum/api-schemas/dist/plugin-docs-api.schema.js +80 -0
- package/node_modules/@kardalum/api-schemas/dist/plugin-docs-text.d.ts +65 -0
- package/node_modules/@kardalum/api-schemas/dist/plugin-docs-text.js +889 -0
- package/node_modules/@kardalum/api-schemas/dist/plugin-docs.d.ts +89 -0
- package/node_modules/@kardalum/api-schemas/dist/plugin-docs.js +134 -0
- package/node_modules/@kardalum/api-schemas/dist/plugin-id-rules.d.ts +31 -0
- package/node_modules/@kardalum/api-schemas/dist/plugin-id-rules.js +38 -0
- package/node_modules/@kardalum/api-schemas/dist/plugin-management-api.schema.d.ts +369 -0
- package/node_modules/@kardalum/api-schemas/dist/plugin-management-api.schema.js +393 -0
- package/node_modules/@kardalum/api-schemas/dist/plugin-manifest-actions.d.ts +22 -0
- package/node_modules/@kardalum/api-schemas/dist/plugin-manifest-actions.js +87 -0
- package/node_modules/@kardalum/api-schemas/dist/plugin-registry-api.schema.d.ts +31 -0
- package/node_modules/@kardalum/api-schemas/dist/plugin-registry-api.schema.js +25 -0
- package/node_modules/@kardalum/api-schemas/dist/plugin-storage-api.schema.d.ts +15 -0
- package/node_modules/@kardalum/api-schemas/dist/plugin-storage-api.schema.js +24 -0
- package/node_modules/@kardalum/api-schemas/dist/public-api.schema.d.ts +306 -0
- package/node_modules/@kardalum/api-schemas/dist/public-api.schema.js +328 -0
- package/node_modules/@kardalum/api-schemas/dist/render-editing.d.ts +79 -0
- package/node_modules/@kardalum/api-schemas/dist/render-editing.js +50 -0
- package/node_modules/@kardalum/api-schemas/dist/render-settings-api.schema.d.ts +9 -0
- package/node_modules/@kardalum/api-schemas/dist/render-settings-api.schema.js +13 -0
- package/node_modules/@kardalum/api-schemas/dist/reserved-slugs.d.ts +2 -0
- package/node_modules/@kardalum/api-schemas/dist/reserved-slugs.js +16 -0
- package/node_modules/@kardalum/api-schemas/dist/role.schema.d.ts +90 -0
- package/node_modules/@kardalum/api-schemas/dist/role.schema.js +69 -0
- package/node_modules/@kardalum/api-schemas/dist/sample-content-outcome.schema.d.ts +17 -0
- package/node_modules/@kardalum/api-schemas/dist/sample-content-outcome.schema.js +27 -0
- package/node_modules/@kardalum/api-schemas/dist/setup-api.schema.d.ts +108 -0
- package/node_modules/@kardalum/api-schemas/dist/setup-api.schema.js +93 -0
- package/node_modules/@kardalum/api-schemas/dist/sites.schema.d.ts +243 -0
- package/node_modules/@kardalum/api-schemas/dist/sites.schema.js +296 -0
- package/node_modules/@kardalum/api-schemas/dist/snapshot-api.schema.d.ts +43 -0
- package/node_modules/@kardalum/api-schemas/dist/snapshot-api.schema.js +25 -0
- package/node_modules/@kardalum/api-schemas/dist/snapshot.schema.d.ts +30 -0
- package/node_modules/@kardalum/api-schemas/dist/snapshot.schema.js +19 -0
- package/node_modules/@kardalum/api-schemas/dist/template-api.schema.d.ts +112 -0
- package/node_modules/@kardalum/api-schemas/dist/template-api.schema.js +74 -0
- package/node_modules/@kardalum/api-schemas/dist/template.schema.d.ts +41 -0
- package/node_modules/@kardalum/api-schemas/dist/template.schema.js +39 -0
- package/node_modules/@kardalum/api-schemas/dist/theme-api.schema.d.ts +21 -0
- package/node_modules/@kardalum/api-schemas/dist/theme-api.schema.js +14 -0
- package/node_modules/@kardalum/api-schemas/dist/user-api.schema.d.ts +89 -0
- package/node_modules/@kardalum/api-schemas/dist/user-api.schema.js +68 -0
- package/node_modules/@kardalum/api-schemas/package.json +35 -0
- package/node_modules/@kardalum/design-tokens/LICENSE +202 -0
- package/node_modules/@kardalum/design-tokens/README.md +29 -0
- package/node_modules/@kardalum/design-tokens/dist/build-css.d.ts +32 -0
- package/node_modules/@kardalum/design-tokens/dist/build-css.js +88 -0
- package/node_modules/@kardalum/design-tokens/dist/generate.d.ts +1 -0
- package/node_modules/@kardalum/design-tokens/dist/generate.js +18 -0
- package/node_modules/@kardalum/design-tokens/dist/index.d.ts +6 -0
- package/node_modules/@kardalum/design-tokens/dist/index.js +4 -0
- package/node_modules/@kardalum/design-tokens/dist/system-dark.css +75 -0
- package/node_modules/@kardalum/design-tokens/dist/tailwind-theme.d.ts +33 -0
- package/node_modules/@kardalum/design-tokens/dist/tailwind-theme.js +54 -0
- package/node_modules/@kardalum/design-tokens/dist/theme-css.d.ts +12 -0
- package/node_modules/@kardalum/design-tokens/dist/theme-css.js +42 -0
- package/node_modules/@kardalum/design-tokens/dist/theme-types.d.ts +43 -0
- package/node_modules/@kardalum/design-tokens/dist/theme-types.js +1 -0
- package/node_modules/@kardalum/design-tokens/dist/themes/dark.d.ts +13 -0
- package/node_modules/@kardalum/design-tokens/dist/themes/dark.js +120 -0
- package/node_modules/@kardalum/design-tokens/dist/themes/index.d.ts +5 -0
- package/node_modules/@kardalum/design-tokens/dist/themes/index.js +4 -0
- package/node_modules/@kardalum/design-tokens/dist/themes/light.d.ts +9 -0
- package/node_modules/@kardalum/design-tokens/dist/themes/light.js +13 -0
- package/node_modules/@kardalum/design-tokens/dist/tokens.css +239 -0
- package/node_modules/@kardalum/design-tokens/dist/tokens.d.ts +25 -0
- package/node_modules/@kardalum/design-tokens/dist/tokens.js +276 -0
- package/node_modules/@kardalum/design-tokens/dist/tokens.json +212 -0
- package/node_modules/@kardalum/design-tokens/dist/types.d.ts +91 -0
- package/node_modules/@kardalum/design-tokens/dist/types.js +5 -0
- package/node_modules/@kardalum/design-tokens/package.json +42 -0
- package/node_modules/@kardalum/plugin-package/LICENSE +202 -0
- package/node_modules/@kardalum/plugin-package/README.md +71 -0
- package/node_modules/@kardalum/plugin-package/dist/docs-contract.d.ts +50 -0
- package/node_modules/@kardalum/plugin-package/dist/docs-contract.js +659 -0
- package/node_modules/@kardalum/plugin-package/dist/envelope.d.ts +19 -0
- package/node_modules/@kardalum/plugin-package/dist/envelope.js +104 -0
- package/node_modules/@kardalum/plugin-package/dist/extract.d.ts +37 -0
- package/node_modules/@kardalum/plugin-package/dist/extract.js +199 -0
- package/node_modules/@kardalum/plugin-package/dist/hash.d.ts +17 -0
- package/node_modules/@kardalum/plugin-package/dist/hash.js +69 -0
- package/node_modules/@kardalum/plugin-package/dist/index.d.ts +11 -0
- package/node_modules/@kardalum/plugin-package/dist/index.js +7 -0
- package/node_modules/@kardalum/plugin-package/dist/license-verdict.d.ts +185 -0
- package/node_modules/@kardalum/plugin-package/dist/license-verdict.js +236 -0
- package/node_modules/@kardalum/plugin-package/dist/package-contract.d.ts +50 -0
- package/node_modules/@kardalum/plugin-package/dist/package-contract.js +115 -0
- package/node_modules/@kardalum/plugin-package/dist/sample-content.d.ts +1 -0
- package/node_modules/@kardalum/plugin-package/dist/sample-content.js +17 -0
- package/node_modules/@kardalum/plugin-package/dist/types.d.ts +45 -0
- package/node_modules/@kardalum/plugin-package/dist/types.js +1 -0
- package/node_modules/@kardalum/plugin-package/package.json +49 -0
- package/node_modules/@kardalum/ui/LICENSE +202 -0
- package/node_modules/@kardalum/ui/README.md +35 -0
- package/node_modules/@kardalum/ui/dist/components/alert-dialog.d.ts +14 -0
- package/node_modules/@kardalum/ui/dist/components/alert-dialog.js +38 -0
- package/node_modules/@kardalum/ui/dist/components/badge.d.ts +9 -0
- package/node_modules/@kardalum/ui/dist/components/badge.js +30 -0
- package/node_modules/@kardalum/ui/dist/components/button.d.ts +11 -0
- package/node_modules/@kardalum/ui/dist/components/button.js +37 -0
- package/node_modules/@kardalum/ui/dist/components/checkbox.d.ts +5 -0
- package/node_modules/@kardalum/ui/dist/components/checkbox.js +7 -0
- package/node_modules/@kardalum/ui/dist/components/dialog.d.ts +17 -0
- package/node_modules/@kardalum/ui/dist/components/dialog.js +48 -0
- package/node_modules/@kardalum/ui/dist/components/dropdown-menu.d.ts +18 -0
- package/node_modules/@kardalum/ui/dist/components/dropdown-menu.js +53 -0
- package/node_modules/@kardalum/ui/dist/components/empty-state.d.ts +30 -0
- package/node_modules/@kardalum/ui/dist/components/empty-state.js +9 -0
- package/node_modules/@kardalum/ui/dist/components/input.d.ts +4 -0
- package/node_modules/@kardalum/ui/dist/components/input.js +6 -0
- package/node_modules/@kardalum/ui/dist/components/panel.d.ts +5 -0
- package/node_modules/@kardalum/ui/dist/components/panel.js +6 -0
- package/node_modules/@kardalum/ui/dist/components/property-field.d.ts +19 -0
- package/node_modules/@kardalum/ui/dist/components/property-field.js +86 -0
- package/node_modules/@kardalum/ui/dist/components/sheet.d.ts +17 -0
- package/node_modules/@kardalum/ui/dist/components/sheet.js +55 -0
- package/node_modules/@kardalum/ui/dist/components/skeleton.d.ts +3 -0
- package/node_modules/@kardalum/ui/dist/components/skeleton.js +9 -0
- package/node_modules/@kardalum/ui/dist/components/switch.d.ts +5 -0
- package/node_modules/@kardalum/ui/dist/components/switch.js +7 -0
- package/node_modules/@kardalum/ui/dist/components/tab-strip.d.ts +34 -0
- package/node_modules/@kardalum/ui/dist/components/tab-strip.js +72 -0
- package/node_modules/@kardalum/ui/dist/components/toast.d.ts +18 -0
- package/node_modules/@kardalum/ui/dist/components/toast.js +42 -0
- package/node_modules/@kardalum/ui/dist/components/toaster.d.ts +12 -0
- package/node_modules/@kardalum/ui/dist/components/toaster.js +11 -0
- package/node_modules/@kardalum/ui/dist/components/use-toast.d.ts +17 -0
- package/node_modules/@kardalum/ui/dist/components/use-toast.js +62 -0
- package/node_modules/@kardalum/ui/dist/index.d.ts +18 -0
- package/node_modules/@kardalum/ui/dist/index.js +18 -0
- package/node_modules/@kardalum/ui/dist/lib/cn.d.ts +2 -0
- package/node_modules/@kardalum/ui/dist/lib/cn.js +5 -0
- package/node_modules/@kardalum/ui/package.json +63 -0
- package/package.json +146 -4
|
@@ -0,0 +1,79 @@
|
|
|
1
|
+
import { z } from "zod";
|
|
2
|
+
export declare const TextStyleEntrySchema: z.ZodObject<{
|
|
3
|
+
key: z.ZodString;
|
|
4
|
+
label: z.ZodString;
|
|
5
|
+
}, z.core.$strict>;
|
|
6
|
+
export type TextStyleEntry = z.infer<typeof TextStyleEntrySchema>;
|
|
7
|
+
export declare const TextStylesResponseSchema: z.ZodArray<z.ZodObject<{
|
|
8
|
+
key: z.ZodString;
|
|
9
|
+
label: z.ZodString;
|
|
10
|
+
}, z.core.$strict>>;
|
|
11
|
+
export type TextStylesResponse = z.infer<typeof TextStylesResponseSchema>;
|
|
12
|
+
export declare const BlockParamTypeSchema: z.ZodEnum<{
|
|
13
|
+
number: "number";
|
|
14
|
+
boolean: "boolean";
|
|
15
|
+
text: "text";
|
|
16
|
+
textarea: "textarea";
|
|
17
|
+
image: "image";
|
|
18
|
+
choice: "choice";
|
|
19
|
+
}>;
|
|
20
|
+
export type BlockParamType = z.infer<typeof BlockParamTypeSchema>;
|
|
21
|
+
export declare const BlockParamSchema: z.ZodObject<{
|
|
22
|
+
key: z.ZodString;
|
|
23
|
+
type: z.ZodEnum<{
|
|
24
|
+
number: "number";
|
|
25
|
+
boolean: "boolean";
|
|
26
|
+
text: "text";
|
|
27
|
+
textarea: "textarea";
|
|
28
|
+
image: "image";
|
|
29
|
+
choice: "choice";
|
|
30
|
+
}>;
|
|
31
|
+
label: z.ZodString;
|
|
32
|
+
options: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
33
|
+
}, z.core.$strict>;
|
|
34
|
+
export type BlockParam = z.infer<typeof BlockParamSchema>;
|
|
35
|
+
export declare const BlockListingSchema: z.ZodObject<{
|
|
36
|
+
alias: z.ZodString;
|
|
37
|
+
name: z.ZodString;
|
|
38
|
+
params: z.ZodArray<z.ZodObject<{
|
|
39
|
+
key: z.ZodString;
|
|
40
|
+
type: z.ZodEnum<{
|
|
41
|
+
number: "number";
|
|
42
|
+
boolean: "boolean";
|
|
43
|
+
text: "text";
|
|
44
|
+
textarea: "textarea";
|
|
45
|
+
image: "image";
|
|
46
|
+
choice: "choice";
|
|
47
|
+
}>;
|
|
48
|
+
label: z.ZodString;
|
|
49
|
+
options: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
50
|
+
}, z.core.$strict>>;
|
|
51
|
+
}, z.core.$strict>;
|
|
52
|
+
export type BlockListing = z.infer<typeof BlockListingSchema>;
|
|
53
|
+
export declare const BlockListResponseSchema: z.ZodArray<z.ZodObject<{
|
|
54
|
+
alias: z.ZodString;
|
|
55
|
+
name: z.ZodString;
|
|
56
|
+
params: z.ZodArray<z.ZodObject<{
|
|
57
|
+
key: z.ZodString;
|
|
58
|
+
type: z.ZodEnum<{
|
|
59
|
+
number: "number";
|
|
60
|
+
boolean: "boolean";
|
|
61
|
+
text: "text";
|
|
62
|
+
textarea: "textarea";
|
|
63
|
+
image: "image";
|
|
64
|
+
choice: "choice";
|
|
65
|
+
}>;
|
|
66
|
+
label: z.ZodString;
|
|
67
|
+
options: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
68
|
+
}, z.core.$strict>>;
|
|
69
|
+
}, z.core.$strict>>;
|
|
70
|
+
export type BlockListResponse = z.infer<typeof BlockListResponseSchema>;
|
|
71
|
+
export declare const RenderBlockRequestSchema: z.ZodObject<{
|
|
72
|
+
partial: z.ZodString;
|
|
73
|
+
params: z.ZodRecord<z.ZodString, z.ZodUnknown>;
|
|
74
|
+
}, z.core.$strict>;
|
|
75
|
+
export type RenderBlockRequest = z.infer<typeof RenderBlockRequestSchema>;
|
|
76
|
+
export declare const RenderBlockResponseSchema: z.ZodObject<{
|
|
77
|
+
html: z.ZodString;
|
|
78
|
+
}, z.core.$strict>;
|
|
79
|
+
export type RenderBlockResponse = z.infer<typeof RenderBlockResponseSchema>;
|
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
import { z } from "zod";
|
|
2
|
+
import { TemplateAliasSchema } from "./template.schema.js";
|
|
3
|
+
// S197 Task 6: the editor's server side. GET .../text-styles and
|
|
4
|
+
// .../blocks feed the richtext editor's dropdowns
|
|
5
|
+
// (rich-text-view.tsx's useTextStyles, insert-menu.tsx's/block-panel.tsx's
|
|
6
|
+
// useBlockListings); POST .../block renders one embeddable block's live
|
|
7
|
+
// preview (block-panel.tsx's BlockPreviewPopover). Both list responses are
|
|
8
|
+
// bare arrays, not `{items, nextCursor}` — deliberately NOT
|
|
9
|
+
// cursor-paginated, unlike api-design.md's list-endpoint rule for content:
|
|
10
|
+
// both sources are small, in-process scans over registered assets/
|
|
11
|
+
// templates (assetMirror.listTextStyles() / templateService.
|
|
12
|
+
// listEmbeddableBlocks(), Task 4), not content, and every existing UI
|
|
13
|
+
// consumer already parses a bare array off `await response.json()` — see
|
|
14
|
+
// the three files above.
|
|
15
|
+
export const TextStyleEntrySchema = z.object({ key: z.string(), label: z.string() }).strict();
|
|
16
|
+
export const TextStylesResponseSchema = z.array(TextStyleEntrySchema);
|
|
17
|
+
// Mirrors BlockParamType/BlockParam in apps/server/src/render/
|
|
18
|
+
// block-annotations.ts (the parser that produces these) — kept as an
|
|
19
|
+
// independent schema here rather than imported, same "server internals
|
|
20
|
+
// don't leak into api-schemas" boundary every other schema in this
|
|
21
|
+
// package respects.
|
|
22
|
+
export const BlockParamTypeSchema = z.enum(["text", "textarea", "number", "boolean", "image", "choice"]);
|
|
23
|
+
export const BlockParamSchema = z
|
|
24
|
+
.object({
|
|
25
|
+
key: z.string(),
|
|
26
|
+
type: BlockParamTypeSchema,
|
|
27
|
+
label: z.string(),
|
|
28
|
+
options: z.array(z.string()).optional(),
|
|
29
|
+
})
|
|
30
|
+
.strict();
|
|
31
|
+
export const BlockListingSchema = z
|
|
32
|
+
.object({
|
|
33
|
+
alias: TemplateAliasSchema,
|
|
34
|
+
name: z.string(),
|
|
35
|
+
params: z.array(BlockParamSchema),
|
|
36
|
+
})
|
|
37
|
+
.strict();
|
|
38
|
+
export const BlockListResponseSchema = z.array(BlockListingSchema);
|
|
39
|
+
// params is an arbitrary bag (whatever the block's own declared params
|
|
40
|
+
// require) — validated against the live template declaration server-side
|
|
41
|
+
// (block-annotations.ts's findInvalidBlockParamKey), not by this schema,
|
|
42
|
+
// so it stays a permissive record here rather than trying to model every
|
|
43
|
+
// possible declared param shape in Zod.
|
|
44
|
+
export const RenderBlockRequestSchema = z
|
|
45
|
+
.object({
|
|
46
|
+
partial: TemplateAliasSchema,
|
|
47
|
+
params: z.record(z.string(), z.unknown()),
|
|
48
|
+
})
|
|
49
|
+
.strict();
|
|
50
|
+
export const RenderBlockResponseSchema = z.object({ html: z.string() }).strict();
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { z } from "zod";
|
|
2
|
+
export declare const RenderSettingsSchema: z.ZodObject<{
|
|
3
|
+
catchAllTemplateId: z.ZodNullable<z.ZodString>;
|
|
4
|
+
}, z.core.$strip>;
|
|
5
|
+
export type RenderSettings = z.infer<typeof RenderSettingsSchema>;
|
|
6
|
+
export declare const UpdateRenderSettingsRequestSchema: z.ZodObject<{
|
|
7
|
+
catchAllTemplateId: z.ZodNullable<z.ZodString>;
|
|
8
|
+
}, z.core.$strict>;
|
|
9
|
+
export type UpdateRenderSettingsRequest = z.infer<typeof UpdateRenderSettingsRequestSchema>;
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { z } from "zod";
|
|
2
|
+
// Site-level render settings, stored in the (previously unused) Prisma
|
|
3
|
+
// `Setting` key-value model — key "render", value = this object. The
|
|
4
|
+
// catch-all template is the S192 spec §6 step-3 fallback: rendered when a
|
|
5
|
+
// node's document type has no template of its own (the SPA-shell case).
|
|
6
|
+
export const RenderSettingsSchema = z.object({
|
|
7
|
+
catchAllTemplateId: z.string().uuid().nullable(),
|
|
8
|
+
});
|
|
9
|
+
export const UpdateRenderSettingsRequestSchema = z
|
|
10
|
+
.object({
|
|
11
|
+
catchAllTemplateId: z.string().uuid().nullable(),
|
|
12
|
+
})
|
|
13
|
+
.strict();
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
// Root path segments the server owns (S184): /kardalum is the admin SPA,
|
|
2
|
+
// /api /docs /plugin-assets are route namespaces. Content at these roots
|
|
3
|
+
// would be shadowed the moment the Month-17 site renderer serves "/", so
|
|
4
|
+
// creation refuses them everywhere (one list, enforced in the content
|
|
5
|
+
// service both create paths share).
|
|
6
|
+
//
|
|
7
|
+
// "media" joins the list in S186c §3: GET /media/:id/v:version/:filename
|
|
8
|
+
// is a server-owned route namespace exactly like /api, /docs and
|
|
9
|
+
// /plugin-assets, so content at /media would be shadowed the same way.
|
|
10
|
+
//
|
|
11
|
+
// "kardalum-edit" joins in S277c: /kardalum-edit/* is the edit-on-page route, so
|
|
12
|
+
// a site named that would be shadowed by it.
|
|
13
|
+
export const RESERVED_ROOT_SLUGS = ["kardalum", "api", "docs", "plugin-assets", "media", "kardalum-edit"];
|
|
14
|
+
export function isReservedRootSlug(slug) {
|
|
15
|
+
return RESERVED_ROOT_SLUGS.includes(slug.toLowerCase());
|
|
16
|
+
}
|
|
@@ -0,0 +1,90 @@
|
|
|
1
|
+
import { z } from "zod";
|
|
2
|
+
/** An operator-chosen slug, chosen at create and never changed. Lowercase
|
|
3
|
+
* so it reads the same in a URL, a token and a SQL client. */
|
|
4
|
+
export declare const ROLE_ID_PATTERN: RegExp;
|
|
5
|
+
/** The two roles every install has. `admin` is the fixed superuser: it
|
|
6
|
+
* holds every registered action, has no role_actions rows, and cannot be
|
|
7
|
+
* deleted or have actions removed. `editor` is an ordinary editable row
|
|
8
|
+
* seeded with today's non-admin-gated actions; it cannot be deleted. */
|
|
9
|
+
export declare const SEEDED_ROLE_IDS: {
|
|
10
|
+
readonly admin: "admin";
|
|
11
|
+
readonly editor: "editor";
|
|
12
|
+
};
|
|
13
|
+
export type SeededRoleId = (typeof SEEDED_ROLE_IDS)[keyof typeof SEEDED_ROLE_IDS];
|
|
14
|
+
export declare const RoleIdSchema: z.ZodString;
|
|
15
|
+
export type RoleId = z.infer<typeof RoleIdSchema>;
|
|
16
|
+
/** One registered action, as the role editor lists it. `source` is "core"
|
|
17
|
+
* or, from S273 on, the id of the plugin that declared it. */
|
|
18
|
+
export declare const ActionSummarySchema: z.ZodObject<{
|
|
19
|
+
id: z.ZodString;
|
|
20
|
+
label: z.ZodString;
|
|
21
|
+
source: z.ZodString;
|
|
22
|
+
sourceLabel: z.ZodString;
|
|
23
|
+
active: z.ZodBoolean;
|
|
24
|
+
}, z.core.$strip>;
|
|
25
|
+
export type ActionSummary = z.infer<typeof ActionSummarySchema>;
|
|
26
|
+
export declare const ActionListResponseSchema: z.ZodObject<{
|
|
27
|
+
items: z.ZodArray<z.ZodObject<{
|
|
28
|
+
id: z.ZodString;
|
|
29
|
+
label: z.ZodString;
|
|
30
|
+
source: z.ZodString;
|
|
31
|
+
sourceLabel: z.ZodString;
|
|
32
|
+
active: z.ZodBoolean;
|
|
33
|
+
}, z.core.$strip>>;
|
|
34
|
+
}, z.core.$strip>;
|
|
35
|
+
export type ActionListResponse = z.infer<typeof ActionListResponseSchema>;
|
|
36
|
+
export declare const RoleSchema: z.ZodObject<{
|
|
37
|
+
id: z.ZodString;
|
|
38
|
+
label: z.ZodString;
|
|
39
|
+
actions: z.ZodArray<z.ZodString>;
|
|
40
|
+
superuser: z.ZodBoolean;
|
|
41
|
+
userCount: z.ZodNumber;
|
|
42
|
+
createdAt: z.ZodString;
|
|
43
|
+
updatedAt: z.ZodString;
|
|
44
|
+
}, z.core.$strip>;
|
|
45
|
+
export type Role = z.infer<typeof RoleSchema>;
|
|
46
|
+
export declare const RoleListQuerySchema: z.ZodObject<{
|
|
47
|
+
cursor: z.ZodOptional<z.ZodString>;
|
|
48
|
+
limit: z.ZodDefault<z.ZodCoercedNumber<unknown>>;
|
|
49
|
+
}, z.core.$strip>;
|
|
50
|
+
export type RoleListQuery = z.infer<typeof RoleListQuerySchema>;
|
|
51
|
+
export declare const RoleListResponseSchema: z.ZodObject<{
|
|
52
|
+
items: z.ZodArray<z.ZodObject<{
|
|
53
|
+
id: z.ZodString;
|
|
54
|
+
label: z.ZodString;
|
|
55
|
+
actions: z.ZodArray<z.ZodString>;
|
|
56
|
+
superuser: z.ZodBoolean;
|
|
57
|
+
userCount: z.ZodNumber;
|
|
58
|
+
createdAt: z.ZodString;
|
|
59
|
+
updatedAt: z.ZodString;
|
|
60
|
+
}, z.core.$strip>>;
|
|
61
|
+
nextCursor: z.ZodNullable<z.ZodString>;
|
|
62
|
+
}, z.core.$strip>;
|
|
63
|
+
export type RoleListResponse = z.infer<typeof RoleListResponseSchema>;
|
|
64
|
+
export declare const CreateRoleRequestSchema: z.ZodObject<{
|
|
65
|
+
id: z.ZodString;
|
|
66
|
+
label: z.ZodString;
|
|
67
|
+
actions: z.ZodArray<z.ZodString>;
|
|
68
|
+
}, z.core.$strip>;
|
|
69
|
+
export type CreateRoleRequest = z.infer<typeof CreateRoleRequestSchema>;
|
|
70
|
+
export declare const UpdateRoleRequestSchema: z.ZodObject<{
|
|
71
|
+
label: z.ZodOptional<z.ZodString>;
|
|
72
|
+
actions: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
73
|
+
}, z.core.$strip>;
|
|
74
|
+
export type UpdateRoleRequest = z.infer<typeof UpdateRoleRequestSchema>;
|
|
75
|
+
export declare const RoleResponseSchema: z.ZodObject<{
|
|
76
|
+
role: z.ZodObject<{
|
|
77
|
+
id: z.ZodString;
|
|
78
|
+
label: z.ZodString;
|
|
79
|
+
actions: z.ZodArray<z.ZodString>;
|
|
80
|
+
superuser: z.ZodBoolean;
|
|
81
|
+
userCount: z.ZodNumber;
|
|
82
|
+
createdAt: z.ZodString;
|
|
83
|
+
updatedAt: z.ZodString;
|
|
84
|
+
}, z.core.$strip>;
|
|
85
|
+
}, z.core.$strip>;
|
|
86
|
+
export type RoleResponse = z.infer<typeof RoleResponseSchema>;
|
|
87
|
+
export declare const DeleteRoleResponseSchema: z.ZodObject<{
|
|
88
|
+
deleted: z.ZodLiteral<true>;
|
|
89
|
+
}, z.core.$strip>;
|
|
90
|
+
export type DeleteRoleResponse = z.infer<typeof DeleteRoleResponseSchema>;
|
|
@@ -0,0 +1,69 @@
|
|
|
1
|
+
import { z } from "zod";
|
|
2
|
+
import { ActionStringSchema } from "./action.schema.js";
|
|
3
|
+
// S272, theme G2: roles are rows. This file is the one definition the
|
|
4
|
+
// server, the admin UI and the setup wizard share for what a role id looks
|
|
5
|
+
// like and which two roles are seeded, so none of them can drift.
|
|
6
|
+
/** An operator-chosen slug, chosen at create and never changed. Lowercase
|
|
7
|
+
* so it reads the same in a URL, a token and a SQL client. */
|
|
8
|
+
export const ROLE_ID_PATTERN = /^[a-z][a-z0-9-]{0,63}$/;
|
|
9
|
+
/** The two roles every install has. `admin` is the fixed superuser: it
|
|
10
|
+
* holds every registered action, has no role_actions rows, and cannot be
|
|
11
|
+
* deleted or have actions removed. `editor` is an ordinary editable row
|
|
12
|
+
* seeded with today's non-admin-gated actions; it cannot be deleted. */
|
|
13
|
+
export const SEEDED_ROLE_IDS = { admin: "admin", editor: "editor" };
|
|
14
|
+
export const RoleIdSchema = z
|
|
15
|
+
.string()
|
|
16
|
+
.regex(ROLE_ID_PATTERN, "role id must be a lowercase slug: a letter, then letters, digits or hyphens, at most 64 characters");
|
|
17
|
+
/** One registered action, as the role editor lists it. `source` is "core"
|
|
18
|
+
* or, from S273 on, the id of the plugin that declared it. */
|
|
19
|
+
export const ActionSummarySchema = z.object({
|
|
20
|
+
id: ActionStringSchema,
|
|
21
|
+
label: z.string(),
|
|
22
|
+
source: z.string(),
|
|
23
|
+
/** "Core" for core's own actions, otherwise the plugin's display name,
|
|
24
|
+
* which the Roles screen heads the group with. */
|
|
25
|
+
sourceLabel: z.string(),
|
|
26
|
+
/** False while the owning plugin is deactivated (or gone): the rows and
|
|
27
|
+
* grants stay, and the editor marks the group inactive. Core is always
|
|
28
|
+
* active. */
|
|
29
|
+
active: z.boolean(),
|
|
30
|
+
});
|
|
31
|
+
export const ActionListResponseSchema = z.object({
|
|
32
|
+
items: z.array(ActionSummarySchema),
|
|
33
|
+
});
|
|
34
|
+
export const RoleSchema = z.object({
|
|
35
|
+
id: RoleIdSchema,
|
|
36
|
+
label: z.string(),
|
|
37
|
+
/** For the superuser this is every registered action, computed; for any
|
|
38
|
+
* other role, exactly its role_actions rows. Sorted. */
|
|
39
|
+
actions: z.array(z.string()),
|
|
40
|
+
superuser: z.boolean(),
|
|
41
|
+
userCount: z.number().int().nonnegative(),
|
|
42
|
+
createdAt: z.string().datetime(),
|
|
43
|
+
updatedAt: z.string().datetime(),
|
|
44
|
+
});
|
|
45
|
+
export const RoleListQuerySchema = z.object({
|
|
46
|
+
cursor: RoleIdSchema.optional(),
|
|
47
|
+
limit: z.coerce.number().int().min(1).max(100).default(50),
|
|
48
|
+
});
|
|
49
|
+
export const RoleListResponseSchema = z.object({
|
|
50
|
+
items: z.array(RoleSchema),
|
|
51
|
+
// null = no more pages.
|
|
52
|
+
nextCursor: RoleIdSchema.nullable(),
|
|
53
|
+
});
|
|
54
|
+
const RoleLabelSchema = z.string().trim().min(1).max(120);
|
|
55
|
+
export const CreateRoleRequestSchema = z.object({
|
|
56
|
+
id: RoleIdSchema,
|
|
57
|
+
label: RoleLabelSchema,
|
|
58
|
+
actions: z.array(ActionStringSchema),
|
|
59
|
+
});
|
|
60
|
+
export const UpdateRoleRequestSchema = z
|
|
61
|
+
.object({
|
|
62
|
+
label: RoleLabelSchema.optional(),
|
|
63
|
+
actions: z.array(ActionStringSchema).optional(),
|
|
64
|
+
})
|
|
65
|
+
.refine((body) => body.label !== undefined || body.actions !== undefined, {
|
|
66
|
+
message: "nothing to update: send label, actions, or both",
|
|
67
|
+
});
|
|
68
|
+
export const RoleResponseSchema = z.object({ role: RoleSchema });
|
|
69
|
+
export const DeleteRoleResponseSchema = z.object({ deleted: z.literal(true) });
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import { z } from "zod";
|
|
2
|
+
export declare const SampleContentOutcomeSchema: z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
3
|
+
status: z.ZodLiteral<"none">;
|
|
4
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
5
|
+
status: z.ZodLiteral<"invalid">;
|
|
6
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
7
|
+
status: z.ZodLiteral<"already-present">;
|
|
8
|
+
path: z.ZodString;
|
|
9
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
10
|
+
status: z.ZodLiteral<"skipped">;
|
|
11
|
+
name: z.ZodString;
|
|
12
|
+
message: z.ZodString;
|
|
13
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
14
|
+
status: z.ZodLiteral<"added">;
|
|
15
|
+
count: z.ZodNumber;
|
|
16
|
+
}, z.core.$strip>], "status">;
|
|
17
|
+
export type SampleContentOutcome = z.infer<typeof SampleContentOutcomeSchema>;
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
import { z } from "zod";
|
|
2
|
+
// S277e: what an install did with a plugin's sample content (the
|
|
3
|
+
// `sample-content.json` a template ships). Sample content is added whole
|
|
4
|
+
// or not at all, and the install stands whatever this says.
|
|
5
|
+
//
|
|
6
|
+
// - `none`: the plugin has no sample content.
|
|
7
|
+
// - `invalid`: the sample file could not be read (it is malformed, or it
|
|
8
|
+
// names a document type or a parent that is not there).
|
|
9
|
+
// - `already-present`: a page already exists at `path`, where one of the
|
|
10
|
+
// sample's top-level pages would go, so nothing was added. That page is
|
|
11
|
+
// the sample's own from an earlier install, or one the installer made.
|
|
12
|
+
// - `skipped`: a sample page was refused (its name is taken as the first
|
|
13
|
+
// part of an address, or reserved, or its document type may not be placed
|
|
14
|
+
// there, or the write failed), so no sample content was added. `name` is
|
|
15
|
+
// that page's slug in the sample and `message` is the reason.
|
|
16
|
+
// - `added`: every sample page was created and published; `count` of them.
|
|
17
|
+
//
|
|
18
|
+
// An install answer carries it as an optional `sampleContent`: absent when
|
|
19
|
+
// the install added nothing new that could have sample content (an update,
|
|
20
|
+
// or a plugin without any).
|
|
21
|
+
export const SampleContentOutcomeSchema = z.discriminatedUnion("status", [
|
|
22
|
+
z.object({ status: z.literal("none") }),
|
|
23
|
+
z.object({ status: z.literal("invalid") }),
|
|
24
|
+
z.object({ status: z.literal("already-present"), path: z.string() }),
|
|
25
|
+
z.object({ status: z.literal("skipped"), name: z.string(), message: z.string() }),
|
|
26
|
+
z.object({ status: z.literal("added"), count: z.number().int() }),
|
|
27
|
+
]);
|
|
@@ -0,0 +1,108 @@
|
|
|
1
|
+
import { z } from "zod";
|
|
2
|
+
export declare const BundledTemplateSchema: z.ZodObject<{
|
|
3
|
+
pluginId: z.ZodString;
|
|
4
|
+
version: z.ZodString;
|
|
5
|
+
name: z.ZodString;
|
|
6
|
+
description: z.ZodOptional<z.ZodString>;
|
|
7
|
+
sampleContent: z.ZodBoolean;
|
|
8
|
+
}, z.core.$strip>;
|
|
9
|
+
export type BundledTemplate = z.infer<typeof BundledTemplateSchema>;
|
|
10
|
+
export declare const SetupStatusResponseSchema: z.ZodObject<{
|
|
11
|
+
setupRequired: z.ZodBoolean;
|
|
12
|
+
bundledTemplates: z.ZodArray<z.ZodObject<{
|
|
13
|
+
pluginId: z.ZodString;
|
|
14
|
+
version: z.ZodString;
|
|
15
|
+
name: z.ZodString;
|
|
16
|
+
description: z.ZodOptional<z.ZodString>;
|
|
17
|
+
sampleContent: z.ZodBoolean;
|
|
18
|
+
}, z.core.$strip>>;
|
|
19
|
+
databaseConfigured: z.ZodBoolean;
|
|
20
|
+
}, z.core.$strip>;
|
|
21
|
+
export type SetupStatusResponse = z.infer<typeof SetupStatusResponseSchema>;
|
|
22
|
+
export declare const SetupStarterSelectionSchema: z.ZodObject<{
|
|
23
|
+
pluginId: z.ZodString;
|
|
24
|
+
includeSampleContent: z.ZodBoolean;
|
|
25
|
+
}, z.core.$strip>;
|
|
26
|
+
export type SetupStarterSelection = z.infer<typeof SetupStarterSelectionSchema>;
|
|
27
|
+
export declare const SetupCompleteRequestSchema: z.ZodObject<{
|
|
28
|
+
admin: z.ZodObject<{
|
|
29
|
+
email: z.ZodString;
|
|
30
|
+
name: z.ZodString;
|
|
31
|
+
password: z.ZodString;
|
|
32
|
+
}, z.core.$strip>;
|
|
33
|
+
database: z.ZodOptional<z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
34
|
+
dialect: z.ZodLiteral<"sqlite">;
|
|
35
|
+
filePath: z.ZodString;
|
|
36
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
37
|
+
host: z.ZodString;
|
|
38
|
+
port: z.ZodCoercedNumber<unknown>;
|
|
39
|
+
database: z.ZodString;
|
|
40
|
+
username: z.ZodString;
|
|
41
|
+
password: z.ZodString;
|
|
42
|
+
dialect: z.ZodLiteral<"postgresql">;
|
|
43
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
44
|
+
host: z.ZodString;
|
|
45
|
+
port: z.ZodCoercedNumber<unknown>;
|
|
46
|
+
database: z.ZodString;
|
|
47
|
+
username: z.ZodString;
|
|
48
|
+
password: z.ZodString;
|
|
49
|
+
dialect: z.ZodLiteral<"mysql">;
|
|
50
|
+
}, z.core.$strip>], "dialect">>;
|
|
51
|
+
starter: z.ZodOptional<z.ZodObject<{
|
|
52
|
+
pluginId: z.ZodString;
|
|
53
|
+
includeSampleContent: z.ZodBoolean;
|
|
54
|
+
}, z.core.$strip>>;
|
|
55
|
+
}, z.core.$strip>;
|
|
56
|
+
export type SetupCompleteRequest = z.infer<typeof SetupCompleteRequestSchema>;
|
|
57
|
+
export declare const SetupStarterResultSchema: z.ZodObject<{
|
|
58
|
+
pluginId: z.ZodString;
|
|
59
|
+
outcome: z.ZodEnum<{
|
|
60
|
+
installed: "installed";
|
|
61
|
+
failed: "failed";
|
|
62
|
+
}>;
|
|
63
|
+
reason: z.ZodOptional<z.ZodString>;
|
|
64
|
+
sampleContent: z.ZodOptional<z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
65
|
+
status: z.ZodLiteral<"none">;
|
|
66
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
67
|
+
status: z.ZodLiteral<"invalid">;
|
|
68
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
69
|
+
status: z.ZodLiteral<"already-present">;
|
|
70
|
+
path: z.ZodString;
|
|
71
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
72
|
+
status: z.ZodLiteral<"skipped">;
|
|
73
|
+
name: z.ZodString;
|
|
74
|
+
message: z.ZodString;
|
|
75
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
76
|
+
status: z.ZodLiteral<"added">;
|
|
77
|
+
count: z.ZodNumber;
|
|
78
|
+
}, z.core.$strip>], "status">>;
|
|
79
|
+
}, z.core.$strip>;
|
|
80
|
+
export type SetupStarterResult = z.infer<typeof SetupStarterResultSchema>;
|
|
81
|
+
export declare const SetupCompleteResponseSchema: z.ZodObject<{
|
|
82
|
+
success: z.ZodLiteral<true>;
|
|
83
|
+
starter: z.ZodOptional<z.ZodObject<{
|
|
84
|
+
pluginId: z.ZodString;
|
|
85
|
+
outcome: z.ZodEnum<{
|
|
86
|
+
installed: "installed";
|
|
87
|
+
failed: "failed";
|
|
88
|
+
}>;
|
|
89
|
+
reason: z.ZodOptional<z.ZodString>;
|
|
90
|
+
sampleContent: z.ZodOptional<z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
91
|
+
status: z.ZodLiteral<"none">;
|
|
92
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
93
|
+
status: z.ZodLiteral<"invalid">;
|
|
94
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
95
|
+
status: z.ZodLiteral<"already-present">;
|
|
96
|
+
path: z.ZodString;
|
|
97
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
98
|
+
status: z.ZodLiteral<"skipped">;
|
|
99
|
+
name: z.ZodString;
|
|
100
|
+
message: z.ZodString;
|
|
101
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
102
|
+
status: z.ZodLiteral<"added">;
|
|
103
|
+
count: z.ZodNumber;
|
|
104
|
+
}, z.core.$strip>], "status">>;
|
|
105
|
+
}, z.core.$strip>>;
|
|
106
|
+
configWarning: z.ZodOptional<z.ZodString>;
|
|
107
|
+
}, z.core.$strip>;
|
|
108
|
+
export type SetupCompleteResponse = z.infer<typeof SetupCompleteResponseSchema>;
|
|
@@ -0,0 +1,93 @@
|
|
|
1
|
+
import { z } from "zod";
|
|
2
|
+
import { SampleContentOutcomeSchema } from "./sample-content-outcome.schema.js";
|
|
3
|
+
// One bundled first-party starter template (currently only the blog
|
|
4
|
+
// template — apps/server/src/setup/bundled-templates.ts) offered from the
|
|
5
|
+
// setup wizard's optional "starter template" step. `pluginId` matches the
|
|
6
|
+
// template plugin's manifest id (e.g. "com.kardalum.blog"): the same id the
|
|
7
|
+
// marketplace install flow uses elsewhere, so a template picked here and a
|
|
8
|
+
// template found later in the marketplace are addressed identically.
|
|
9
|
+
// `sampleContent` reports whether the packed artifact carries a
|
|
10
|
+
// sample-content.json seed tree, not the content itself.
|
|
11
|
+
export const BundledTemplateSchema = z.object({
|
|
12
|
+
pluginId: z.string().min(1),
|
|
13
|
+
version: z.string().min(1),
|
|
14
|
+
name: z.string().min(1),
|
|
15
|
+
description: z.string().min(1).optional(),
|
|
16
|
+
sampleContent: z.boolean(),
|
|
17
|
+
});
|
|
18
|
+
export const SetupStatusResponseSchema = z.object({
|
|
19
|
+
setupRequired: z.boolean(),
|
|
20
|
+
// Always present — [] outside setup mode (a fully-configured instance has
|
|
21
|
+
// nothing left to offer here) and whenever nothing bundled is resolvable,
|
|
22
|
+
// never omitted or null.
|
|
23
|
+
bundledTemplates: z.array(BundledTemplateSchema),
|
|
24
|
+
// True when DATABASE_URL was already set at boot, so the wizard is
|
|
25
|
+
// running in its admin-only mode and must not render a database step.
|
|
26
|
+
// See the BootMode type and resolveBootMode function in
|
|
27
|
+
// apps/server/src/boot/resolve-boot-mode.ts for the three states.
|
|
28
|
+
databaseConfigured: z.boolean(),
|
|
29
|
+
});
|
|
30
|
+
const SqliteSelectionSchema = z.object({
|
|
31
|
+
dialect: z.literal("sqlite"),
|
|
32
|
+
filePath: z.string().min(1),
|
|
33
|
+
});
|
|
34
|
+
const ServerDialectSelectionSchema = z.object({
|
|
35
|
+
dialect: z.enum(["postgresql", "mysql"]),
|
|
36
|
+
host: z.string().min(1),
|
|
37
|
+
port: z.coerce.number().int().positive(),
|
|
38
|
+
database: z.string().min(1),
|
|
39
|
+
username: z.string().min(1),
|
|
40
|
+
password: z.string(),
|
|
41
|
+
});
|
|
42
|
+
// The wizard's optional starter step (Session 151): which bundled template
|
|
43
|
+
// to install during setup completion, and whether its sample-content.json
|
|
44
|
+
// tree should be seeded. Absent entirely = skip — never null.
|
|
45
|
+
export const SetupStarterSelectionSchema = z.object({
|
|
46
|
+
pluginId: z.string().min(1),
|
|
47
|
+
includeSampleContent: z.boolean(),
|
|
48
|
+
});
|
|
49
|
+
export const SetupCompleteRequestSchema = z.object({
|
|
50
|
+
admin: z.object({
|
|
51
|
+
email: z.string().email(),
|
|
52
|
+
name: z.string().min(1),
|
|
53
|
+
password: z.string().min(8),
|
|
54
|
+
}),
|
|
55
|
+
// Optional because the wizard has two shapes. On a fresh instance it
|
|
56
|
+
// collects a database selection; when DATABASE_URL was already injected
|
|
57
|
+
// the database is configured and read-only, and the request carries the
|
|
58
|
+
// admin only. The ROUTE enforces the pairing in both directions —
|
|
59
|
+
// routes/setup.ts — because "optional" alone would let a caller silently
|
|
60
|
+
// send a selection that is ignored.
|
|
61
|
+
database: z
|
|
62
|
+
.discriminatedUnion("dialect", [
|
|
63
|
+
SqliteSelectionSchema,
|
|
64
|
+
ServerDialectSelectionSchema.extend({ dialect: z.literal("postgresql") }),
|
|
65
|
+
ServerDialectSelectionSchema.extend({ dialect: z.literal("mysql") }),
|
|
66
|
+
])
|
|
67
|
+
.optional(),
|
|
68
|
+
starter: SetupStarterSelectionSchema.optional(),
|
|
69
|
+
});
|
|
70
|
+
// What happened to the requested starter. "failed" never fails setup
|
|
71
|
+
// itself — the admin account and database config always stand — so this
|
|
72
|
+
// rides alongside success: true rather than replacing it. `reason` is only
|
|
73
|
+
// present on failure.
|
|
74
|
+
export const SetupStarterResultSchema = z.object({
|
|
75
|
+
pluginId: z.string().min(1),
|
|
76
|
+
outcome: z.enum(["installed", "failed"]),
|
|
77
|
+
reason: z.string().min(1).optional(),
|
|
78
|
+
// S277e: what the install did with the starter's sample content, when
|
|
79
|
+
// sample content was asked for and the starter ships some. The starter
|
|
80
|
+
// counts as installed whatever this says.
|
|
81
|
+
sampleContent: SampleContentOutcomeSchema.optional(),
|
|
82
|
+
});
|
|
83
|
+
export const SetupCompleteResponseSchema = z.object({
|
|
84
|
+
success: z.literal(true),
|
|
85
|
+
// ABSENT (not null) when no starter was requested — the skip-path
|
|
86
|
+
// response stays byte-identical to the pre-starter shape.
|
|
87
|
+
starter: SetupStarterResultSchema.optional(),
|
|
88
|
+
// ABSENT unless setup completed but could not write its configuration
|
|
89
|
+
// to disk. Setup itself still succeeded — the admin account and the
|
|
90
|
+
// provisioned database stand — so this rides alongside success: true
|
|
91
|
+
// rather than replacing it, exactly as `starter` does.
|
|
92
|
+
configWarning: z.string().min(1).optional(),
|
|
93
|
+
});
|