@kardalum/plugin-sdk 0.17.0 → 0.19.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 +109 -0
- package/README.md +4 -3
- package/dist/assets/asset-picker.d.ts +11 -0
- package/dist/assets/asset-picker.js +109 -0
- package/dist/assets/asset-tree.d.ts +30 -0
- package/dist/assets/asset-tree.js +150 -0
- package/dist/built-in-editor-ids.d.ts +1 -0
- package/dist/built-in-editor-ids.js +20 -0
- package/dist/built-in-serializers.js +1 -1
- package/dist/built-in-settings-schemas.d.ts +2 -0
- package/dist/built-in-settings-schemas.js +31 -4
- package/dist/built-in-value-schemas.js +3 -0
- package/dist/built-ins.js +20 -11
- package/dist/capabilities.js +5 -0
- package/dist/data-type-plugin.d.ts +2 -2
- package/dist/datatype-validation.d.ts +2 -2
- package/dist/datatype-validation.js +20 -6
- package/dist/datatypes-entry.d.ts +1 -0
- package/dist/datatypes-entry.js +1 -0
- package/dist/define-plugin.d.ts +4 -4
- package/dist/define-plugin.js +5 -5
- package/dist/entitlement-entry.d.ts +3 -2
- package/dist/entitlement-entry.js +13 -1
- package/dist/entitlement-gate.d.ts +18 -0
- package/dist/entitlement-gate.js +95 -21
- package/dist/entitlement-plan.d.ts +21 -0
- package/dist/entitlement-plan.js +26 -0
- package/dist/entitlement-types.d.ts +21 -4
- package/dist/entitlement.d.ts +29 -1
- package/dist/entitlement.js +39 -0
- package/dist/grid-arrow-step.d.ts +7 -0
- package/dist/grid-arrow-step.js +20 -0
- package/dist/index.d.ts +8 -1
- package/dist/index.js +11 -12
- package/dist/manifest-entry.d.ts +4 -0
- package/dist/manifest-entry.js +4 -0
- package/dist/manifest-schema.d.ts +5 -1
- package/dist/manifest-schema.js +14 -2
- package/dist/manifest.d.ts +21 -1
- package/dist/media/media-picker.js +34 -34
- package/dist/notify.d.ts +17 -0
- package/dist/notify.js +17 -0
- package/dist/plugin-context.js +3 -3
- package/dist/register-built-ins.js +6 -6
- package/dist/registry.js +1 -1
- package/dist/richtext/block-panel.js +19 -20
- package/dist/richtext/extensions.js +17 -8
- package/dist/richtext/insert-menu.js +4 -4
- package/dist/richtext/kardalum-block.js +17 -17
- package/dist/richtext/style-listbox.js +2 -2
- package/dist/richtext/text-style-class.js +1 -1
- package/dist/richtext-html-entry.d.ts +35 -0
- package/dist/richtext-html-entry.js +73 -0
- package/dist/simple-storage-value-provider.js +3 -3
- package/dist/structured-storage-types.d.ts +12 -1
- package/dist/structured-storage-types.js +2 -2
- package/dist/tailwind.js +10 -3
- package/dist/tokens/tailwind-theme.css +176 -0
- package/dist/tokens/tokens.css +1 -0
- package/dist/tokens/tokens.json +2 -1
- package/dist/ui-entry.js +3 -3
- package/dist/vendor-check.d.ts +39 -0
- package/dist/vendor-check.js +79 -0
- package/dist/vendor-entry.d.ts +3 -0
- package/dist/vendor-entry.js +9 -0
- package/dist/vendor-service.d.ts +20 -0
- package/dist/vendor-service.js +20 -0
- package/dist/views/asset-view.d.ts +6 -0
- package/dist/views/asset-view.js +55 -0
- package/dist/views/content-list-settings-view.js +1 -1
- package/dist/views/content-list-view.js +1 -1
- package/dist/views/date-range-view.js +5 -5
- package/dist/views/html-code-editor.js +2 -3
- package/dist/views/html-view.js +7 -7
- package/dist/views/image-view.js +5 -5
- package/dist/views/rich-text-view.js +33 -32
- package/node_modules/@kardalum/api-schemas/README.md +1 -1
- package/node_modules/@kardalum/api-schemas/dist/api-error.schema.js +1 -1
- package/node_modules/@kardalum/api-schemas/dist/asset-api.schema.js +17 -15
- package/node_modules/@kardalum/api-schemas/dist/asset-field.schema.d.ts +21 -0
- package/node_modules/@kardalum/api-schemas/dist/asset-field.schema.js +42 -0
- package/node_modules/@kardalum/api-schemas/dist/asset.schema.d.ts +1 -0
- package/node_modules/@kardalum/api-schemas/dist/asset.schema.js +10 -3
- package/node_modules/@kardalum/api-schemas/dist/auth.schema.js +1 -1
- package/node_modules/@kardalum/api-schemas/dist/checkout-shown.schema.d.ts +36 -0
- package/node_modules/@kardalum/api-schemas/dist/checkout-shown.schema.js +46 -0
- package/node_modules/@kardalum/api-schemas/dist/content-api.schema.d.ts +13 -0
- package/node_modules/@kardalum/api-schemas/dist/content-api.schema.js +30 -9
- package/node_modules/@kardalum/api-schemas/dist/content-trash-api.schema.js +3 -3
- package/node_modules/@kardalum/api-schemas/dist/content-trash.schema.js +1 -1
- package/node_modules/@kardalum/api-schemas/dist/core-actions.d.ts +12 -6
- package/node_modules/@kardalum/api-schemas/dist/core-actions.js +11 -6
- package/node_modules/@kardalum/api-schemas/dist/data-type-api.schema.d.ts +50 -0
- package/node_modules/@kardalum/api-schemas/dist/data-type-api.schema.js +26 -6
- package/node_modules/@kardalum/api-schemas/dist/data-type-config.schema.d.ts +1 -0
- package/node_modules/@kardalum/api-schemas/dist/data-type-config.schema.js +6 -3
- package/node_modules/@kardalum/api-schemas/dist/data-type-cursor.d.ts +11 -0
- package/node_modules/@kardalum/api-schemas/dist/data-type-cursor.js +28 -0
- package/node_modules/@kardalum/api-schemas/dist/document-type-api.schema.d.ts +90 -0
- package/node_modules/@kardalum/api-schemas/dist/document-type-api.schema.js +56 -6
- package/node_modules/@kardalum/api-schemas/dist/document-type.schema.js +8 -8
- package/node_modules/@kardalum/api-schemas/dist/home.schema.d.ts +130 -0
- package/node_modules/@kardalum/api-schemas/dist/home.schema.js +87 -0
- package/node_modules/@kardalum/api-schemas/dist/index.d.ts +48 -19
- package/node_modules/@kardalum/api-schemas/dist/index.js +34 -12
- package/node_modules/@kardalum/api-schemas/dist/kardalum-latest.schema.d.ts +7 -0
- package/node_modules/@kardalum/api-schemas/dist/kardalum-latest.schema.js +9 -0
- package/node_modules/@kardalum/api-schemas/dist/listing-categories.schema.d.ts +46 -0
- package/node_modules/@kardalum/api-schemas/dist/listing-categories.schema.js +52 -0
- package/node_modules/@kardalum/api-schemas/dist/marketplace-listing-api.schema.d.ts +162 -1
- package/node_modules/@kardalum/api-schemas/dist/marketplace-listing-api.schema.js +144 -9
- package/node_modules/@kardalum/api-schemas/dist/marketplace-package-api.schema.d.ts +17 -0
- package/node_modules/@kardalum/api-schemas/dist/marketplace-package-api.schema.js +16 -0
- package/node_modules/@kardalum/api-schemas/dist/media-api.schema.d.ts +26 -0
- package/node_modules/@kardalum/api-schemas/dist/media-api.schema.js +15 -9
- package/node_modules/@kardalum/api-schemas/dist/media-reference-use.d.ts +10 -0
- package/node_modules/@kardalum/api-schemas/dist/media-reference-use.js +4 -4
- package/node_modules/@kardalum/api-schemas/dist/media.schema.js +5 -5
- package/node_modules/@kardalum/api-schemas/dist/news.schema.d.ts +93 -0
- package/node_modules/@kardalum/api-schemas/dist/news.schema.js +86 -0
- package/node_modules/@kardalum/api-schemas/dist/node-access.schema.js +13 -0
- package/node_modules/@kardalum/api-schemas/dist/notification.schema.d.ts +410 -0
- package/node_modules/@kardalum/api-schemas/dist/notification.schema.js +193 -0
- package/node_modules/@kardalum/api-schemas/dist/plan-editor.schema.d.ts +86 -0
- package/node_modules/@kardalum/api-schemas/dist/plan-editor.schema.js +92 -0
- package/node_modules/@kardalum/api-schemas/dist/plugin-docs-api.schema.d.ts +7 -2
- package/node_modules/@kardalum/api-schemas/dist/plugin-docs-api.schema.js +7 -0
- package/node_modules/@kardalum/api-schemas/dist/plugin-docs-text.js +1 -0
- package/node_modules/@kardalum/api-schemas/dist/plugin-management-api.schema.d.ts +251 -0
- package/node_modules/@kardalum/api-schemas/dist/plugin-management-api.schema.js +196 -31
- package/node_modules/@kardalum/api-schemas/dist/plugin-read-only.schema.d.ts +19 -0
- package/node_modules/@kardalum/api-schemas/dist/plugin-read-only.schema.js +33 -0
- package/node_modules/@kardalum/api-schemas/dist/plugin-registry-api.schema.js +1 -1
- package/node_modules/@kardalum/api-schemas/dist/plugin-storage-api.schema.js +3 -3
- package/node_modules/@kardalum/api-schemas/dist/plugin-template-payload.d.ts +10 -1
- package/node_modules/@kardalum/api-schemas/dist/plugin-template-payload.js +24 -4
- package/node_modules/@kardalum/api-schemas/dist/public-api.schema.d.ts +5 -0
- package/node_modules/@kardalum/api-schemas/dist/public-api.schema.js +23 -20
- package/node_modules/@kardalum/api-schemas/dist/render-editing.js +4 -4
- package/node_modules/@kardalum/api-schemas/dist/render-settings-api.schema.js +1 -1
- package/node_modules/@kardalum/api-schemas/dist/revenue-view.schema.d.ts +83 -0
- package/node_modules/@kardalum/api-schemas/dist/revenue-view.schema.js +73 -0
- package/node_modules/@kardalum/api-schemas/dist/server-settings-api.schema.d.ts +207 -0
- package/node_modules/@kardalum/api-schemas/dist/server-settings-api.schema.js +147 -0
- package/node_modules/@kardalum/api-schemas/dist/setup-api.schema.d.ts +11 -0
- package/node_modules/@kardalum/api-schemas/dist/setup-api.schema.js +17 -8
- package/node_modules/@kardalum/api-schemas/dist/sites.schema.d.ts +14 -0
- package/node_modules/@kardalum/api-schemas/dist/sites.schema.js +7 -0
- package/node_modules/@kardalum/api-schemas/dist/snapshot-api.schema.d.ts +3 -3
- package/node_modules/@kardalum/api-schemas/dist/snapshot.schema.d.ts +1 -1
- package/node_modules/@kardalum/api-schemas/dist/snapshot.schema.js +1 -1
- package/node_modules/@kardalum/api-schemas/dist/template-api.schema.d.ts +10 -0
- package/node_modules/@kardalum/api-schemas/dist/template-api.schema.js +27 -12
- package/node_modules/@kardalum/api-schemas/dist/template.schema.d.ts +7 -0
- package/node_modules/@kardalum/api-schemas/dist/template.schema.js +22 -10
- package/node_modules/@kardalum/api-schemas/dist/theme-api.schema.d.ts +1 -1
- package/node_modules/@kardalum/api-schemas/dist/theme-api.schema.js +1 -1
- package/node_modules/@kardalum/api-schemas/dist/user-api.schema.d.ts +12 -0
- package/node_modules/@kardalum/api-schemas/dist/user-api.schema.js +6 -1
- package/node_modules/@kardalum/api-schemas/dist/uuid.schema.d.ts +2 -0
- package/node_modules/@kardalum/api-schemas/dist/uuid.schema.js +4 -0
- package/node_modules/@kardalum/api-schemas/dist/vendor-service.schema.d.ts +88 -0
- package/node_modules/@kardalum/api-schemas/dist/vendor-service.schema.js +100 -0
- package/node_modules/@kardalum/api-schemas/dist/whoami-api.schema.d.ts +13 -0
- package/node_modules/@kardalum/api-schemas/dist/whoami-api.schema.js +5 -0
- package/node_modules/@kardalum/design-tokens/README.md +1 -1
- package/node_modules/@kardalum/design-tokens/dist/build-css.d.ts +1 -1
- package/node_modules/@kardalum/design-tokens/dist/build-css.js +2 -2
- package/node_modules/@kardalum/design-tokens/dist/build-theme-css.d.ts +16 -0
- package/node_modules/@kardalum/design-tokens/dist/build-theme-css.js +76 -0
- package/node_modules/@kardalum/design-tokens/dist/generate.js +4 -1
- package/node_modules/@kardalum/design-tokens/dist/tailwind-theme.css +176 -0
- package/node_modules/@kardalum/design-tokens/dist/tailwind-theme.d.ts +1 -1
- package/node_modules/@kardalum/design-tokens/dist/tailwind-theme.js +3 -3
- package/node_modules/@kardalum/design-tokens/dist/theme-css.d.ts +2 -2
- package/node_modules/@kardalum/design-tokens/dist/theme-css.js +2 -2
- package/node_modules/@kardalum/design-tokens/dist/theme-types.d.ts +2 -2
- package/node_modules/@kardalum/design-tokens/dist/themes/dark.d.ts +3 -3
- package/node_modules/@kardalum/design-tokens/dist/themes/dark.js +3 -3
- package/node_modules/@kardalum/design-tokens/dist/themes/light.d.ts +1 -1
- package/node_modules/@kardalum/design-tokens/dist/themes/light.js +1 -1
- package/node_modules/@kardalum/design-tokens/dist/tokens.css +1 -0
- package/node_modules/@kardalum/design-tokens/dist/tokens.d.ts +3 -3
- package/node_modules/@kardalum/design-tokens/dist/tokens.js +6 -5
- package/node_modules/@kardalum/design-tokens/dist/tokens.json +2 -1
- package/node_modules/@kardalum/design-tokens/dist/types.d.ts +2 -1
- package/node_modules/@kardalum/design-tokens/dist/types.js +1 -1
- package/node_modules/@kardalum/design-tokens/package.json +6 -3
- package/node_modules/@kardalum/plugin-package/README.md +1 -1
- package/node_modules/@kardalum/plugin-package/dist/capabilities.d.ts +4 -4
- package/node_modules/@kardalum/plugin-package/dist/capabilities.js +54 -6
- package/node_modules/@kardalum/plugin-package/dist/delivery/bundle.js +1 -1
- package/node_modules/@kardalum/plugin-package/dist/delivery/contributions.d.ts +3 -0
- package/node_modules/@kardalum/plugin-package/dist/delivery/contributions.js +18 -1
- package/node_modules/@kardalum/plugin-package/dist/delivery/limits.d.ts +1 -1
- package/node_modules/@kardalum/plugin-package/dist/delivery/limits.js +1 -1
- package/node_modules/@kardalum/plugin-package/dist/delivery/registry.js +9 -4
- package/node_modules/@kardalum/plugin-package/dist/delivery/templates.d.ts +1 -0
- package/node_modules/@kardalum/plugin-package/dist/delivery/templates.js +58 -1
- package/node_modules/@kardalum/plugin-package/dist/envelope.d.ts +2 -2
- package/node_modules/@kardalum/plugin-package/dist/envelope.js +2 -2
- package/node_modules/@kardalum/plugin-package/dist/extract.d.ts +3 -3
- package/node_modules/@kardalum/plugin-package/dist/extract.js +10 -10
- package/node_modules/@kardalum/plugin-package/dist/hash.d.ts +1 -1
- package/node_modules/@kardalum/plugin-package/dist/hash.js +1 -1
- package/node_modules/@kardalum/plugin-package/dist/index.d.ts +4 -2
- package/node_modules/@kardalum/plugin-package/dist/index.js +3 -1
- package/node_modules/@kardalum/plugin-package/dist/license-verdict.d.ts +56 -19
- package/node_modules/@kardalum/plugin-package/dist/license-verdict.js +119 -25
- package/node_modules/@kardalum/plugin-package/dist/package-contract.d.ts +2 -2
- package/node_modules/@kardalum/plugin-package/dist/package-contract.js +5 -5
- package/node_modules/@kardalum/plugin-package/dist/types.d.ts +1 -1
- package/node_modules/@kardalum/plugin-package/dist/vendor-token.d.ts +24 -0
- package/node_modules/@kardalum/plugin-package/dist/vendor-token.js +118 -0
- package/node_modules/@kardalum/ui/README.md +1 -1
- package/node_modules/@kardalum/ui/dist/components/alert-dialog.d.ts +1 -1
- package/node_modules/@kardalum/ui/dist/components/alert-dialog.js +8 -3
- package/node_modules/@kardalum/ui/dist/components/badge.js +1 -1
- package/node_modules/@kardalum/ui/dist/components/button.js +2 -2
- package/node_modules/@kardalum/ui/dist/components/checkbox.js +1 -1
- package/node_modules/@kardalum/ui/dist/components/dialog.d.ts +1 -1
- package/node_modules/@kardalum/ui/dist/components/dialog.js +52 -4
- package/node_modules/@kardalum/ui/dist/components/dropdown-menu.d.ts +5 -1
- package/node_modules/@kardalum/ui/dist/components/dropdown-menu.js +20 -7
- package/node_modules/@kardalum/ui/dist/components/empty-state.d.ts +4 -4
- package/node_modules/@kardalum/ui/dist/components/input.js +6 -1
- package/node_modules/@kardalum/ui/dist/components/popover-panel.d.ts +4 -0
- package/node_modules/@kardalum/ui/dist/components/popover-panel.js +13 -0
- package/node_modules/@kardalum/ui/dist/components/property-field.js +3 -3
- package/node_modules/@kardalum/ui/dist/components/sheet.d.ts +1 -1
- package/node_modules/@kardalum/ui/dist/components/sheet.js +15 -9
- package/node_modules/@kardalum/ui/dist/components/skeleton.js +1 -1
- package/node_modules/@kardalum/ui/dist/components/switch.js +1 -1
- package/node_modules/@kardalum/ui/dist/components/tab-strip.d.ts +3 -3
- package/node_modules/@kardalum/ui/dist/components/tab-strip.js +1 -1
- package/node_modules/@kardalum/ui/dist/components/toast.js +4 -3
- package/node_modules/@kardalum/ui/dist/components/tooltip.d.ts +27 -0
- package/node_modules/@kardalum/ui/dist/components/tooltip.js +82 -0
- package/node_modules/@kardalum/ui/dist/components/truncated-text.d.ts +11 -0
- package/node_modules/@kardalum/ui/dist/components/truncated-text.js +94 -0
- package/node_modules/@kardalum/ui/dist/components/use-toast.js +2 -2
- package/node_modules/@kardalum/ui/dist/index.d.ts +4 -1
- package/node_modules/@kardalum/ui/dist/index.js +4 -1
- package/node_modules/@kardalum/ui/dist/lib/menu-host.d.ts +5 -0
- package/node_modules/@kardalum/ui/dist/lib/menu-host.js +17 -0
- package/node_modules/@kardalum/ui/package.json +8 -6
- package/package.json +21 -7
|
@@ -1,16 +1,17 @@
|
|
|
1
1
|
import { z } from "zod";
|
|
2
|
+
import { ReadOnlyFieldSchema } from "./plugin-read-only.schema.js";
|
|
2
3
|
import { CultureSchema } from "./content-api.schema.js";
|
|
3
4
|
import { MediaVisibilitySchema } from "./media.schema.js";
|
|
4
|
-
// Session 112: serializer-contribution output. Keyed by pluginId
|
|
5
|
+
// Session 112: serializer-contribution output. Keyed by pluginId:
|
|
5
6
|
// structurally separate from core fields and `data`, so a contribution
|
|
6
7
|
// can never remove or overwrite either. Present only when at least one
|
|
7
8
|
// active plugin's extendContentResponse produced a value.
|
|
8
9
|
export const PublicContentExtensionsSchema = z.record(z.string(), z.record(z.string(), z.unknown()));
|
|
9
10
|
// The public Content API's own wire contract (Month 9). Deliberately NOT
|
|
10
|
-
// a re-export of the backoffice ContentNode/ContentVersion shapes
|
|
11
|
+
// a re-export of the backoffice ContentNode/ContentVersion shapes: the
|
|
11
12
|
// public surface exposes only what an external consumer needs, and can
|
|
12
13
|
// stay stable while internal shapes evolve. Session 103 widens this file.
|
|
13
|
-
// Session 116: `publishedAt` is nullable ONLY here
|
|
14
|
+
// Session 116: `publishedAt` is nullable ONLY here: a verified preview
|
|
14
15
|
// token can serve a genuinely-draft node's latest version, which has no
|
|
15
16
|
// publishedAt. Every other public schema (summaries/lists) stays on the
|
|
16
17
|
// published-only surface and keeps its non-null publishedAt unchanged.
|
|
@@ -33,7 +34,7 @@ export const PublicContentItemSchema = z.object({
|
|
|
33
34
|
// `locale` mirrors the backoffice contract exactly (content-api.schema).
|
|
34
35
|
// `previewToken` (Session 116) is a stateless signed token minted by
|
|
35
36
|
// POST /api/manage/v1/content/:id/preview-token; verified once per request against
|
|
36
|
-
// the FINAL resolved (post-locale) node id
|
|
37
|
+
// the FINAL resolved (post-locale) node id (see published-item.ts).
|
|
37
38
|
export const PublicContentItemQuerySchema = z.object({
|
|
38
39
|
// S230: validated as a language tag, identically to the backoffice
|
|
39
40
|
// route. It used to be any string of two or more characters, so a
|
|
@@ -42,7 +43,7 @@ export const PublicContentItemQuerySchema = z.object({
|
|
|
42
43
|
format: z.string().regex(/^[a-z0-9.-]+:[a-z0-9-]+$/).optional(),
|
|
43
44
|
previewToken: z.string().optional(),
|
|
44
45
|
});
|
|
45
|
-
// A custom-format read (?format=<pluginId>:<name>)
|
|
46
|
+
// A custom-format read (?format=<pluginId>:<name>). The plugin's whole
|
|
46
47
|
// projection rides in `content`; the caller asked for the plugin's shape,
|
|
47
48
|
// so the server imposes nothing beyond JSON-serializability.
|
|
48
49
|
export const PublicContentFormatResponseSchema = z.object({
|
|
@@ -81,7 +82,7 @@ export const PublicContentListQuerySchema = z.object({
|
|
|
81
82
|
limit: z.coerce.number().int().min(1).max(100).default(50),
|
|
82
83
|
});
|
|
83
84
|
// The tree-walk row: everything a consumer needs to render navigation and
|
|
84
|
-
// fetch the full item
|
|
85
|
+
// fetch the full item: no version data (fetch by id for that), and
|
|
85
86
|
// publishedAt is non-nullable by construction (published-only surface).
|
|
86
87
|
export const PublicContentNodeSummarySchema = z.object({
|
|
87
88
|
id: z.string().uuid(),
|
|
@@ -120,7 +121,7 @@ export const PublicSitesResponseSchema = z.object({
|
|
|
120
121
|
items: z.array(PublicSiteSchema),
|
|
121
122
|
nextCursor: z.string().nullable(),
|
|
122
123
|
});
|
|
123
|
-
// GET /api/v1/content
|
|
124
|
+
// GET /api/v1/content: combinable filters over the published surface.
|
|
124
125
|
// `under` is a published node's id; the server resolves it to a subtree
|
|
125
126
|
// path filter (strict descendants). q is a case-insensitive substring
|
|
126
127
|
// (ASCII-pinned), min 2 chars so a single char can't trigger full scans.
|
|
@@ -174,7 +175,7 @@ export const PublicMediaListResponseSchema = z.object({
|
|
|
174
175
|
// Public document type introspection. Deliberately narrower than the
|
|
175
176
|
// backoffice DocumentTypeDefinitionSchema: tabs (admin-UI organization),
|
|
176
177
|
// treeRules (an admin content-placement rule), and defaultTemplateId (an
|
|
177
|
-
// editor pointer
|
|
178
|
+
// editor pointer; the separate templates resource covers discovery) are
|
|
178
179
|
// all excluded. Just enough to interpret a fetched ContentVersion.data:
|
|
179
180
|
// each field's data key (id), display name, datatypeId, and its
|
|
180
181
|
// client-facing validation rules.
|
|
@@ -225,7 +226,7 @@ export const PublicDocumentTypeListResponseSchema = z.object({
|
|
|
225
226
|
items: z.array(PublicDocumentTypeSchema),
|
|
226
227
|
nextCursor: z.string().uuid().nullable(),
|
|
227
228
|
});
|
|
228
|
-
// Templates are inert data (headless-first decision)
|
|
229
|
+
// Templates are inert data (headless-first decision): the public shape
|
|
229
230
|
// is the same three fields the backoffice already exposes, defined fresh
|
|
230
231
|
// as its own contract rather than re-exporting TemplateDefinitionSchema.
|
|
231
232
|
export const PublicTemplateSchema = z.object({
|
|
@@ -243,10 +244,12 @@ export const PublicTemplateListResponseSchema = z.object({
|
|
|
243
244
|
nextCursor: z.string().uuid().nullable(),
|
|
244
245
|
});
|
|
245
246
|
// Public content write shapes (Month 9, Session 107). The write surface is
|
|
246
|
-
// key-gated and NOT published-only
|
|
247
|
+
// key-gated and NOT published-only: a writer operates on a node by id in
|
|
247
248
|
// any publish state, so `publishedAt` here is nullable (a fresh draft),
|
|
248
249
|
// unlike the read PublicContentItemSchema's non-null publishedAt.
|
|
249
250
|
export const PublicContentWriteResponseSchema = z.object({
|
|
251
|
+
// S318: fields kept because their plugin is read-only.
|
|
252
|
+
readOnlyFields: z.array(ReadOnlyFieldSchema).optional(),
|
|
250
253
|
id: z.string().uuid(),
|
|
251
254
|
documentTypeId: z.string().uuid(),
|
|
252
255
|
parentId: z.string().uuid().nullable(),
|
|
@@ -265,18 +268,18 @@ export const PublicCreateContentRequestSchema = z.object({
|
|
|
265
268
|
slug: z.string().regex(/^[a-z0-9]+(?:-[a-z0-9]+)*$/),
|
|
266
269
|
data: z.record(z.string(), z.unknown()).default({}),
|
|
267
270
|
});
|
|
268
|
-
// Body for both PUT (full-replace) and PATCH (partial merge)
|
|
271
|
+
// Body for both PUT (full-replace) and PATCH (partial merge): the verb,
|
|
269
272
|
// not the body shape, decides the merge semantics. See the route
|
|
270
273
|
// descriptions.
|
|
271
274
|
export const PublicUpdateContentRequestSchema = z.object({
|
|
272
275
|
data: z.record(z.string(), z.unknown()),
|
|
273
276
|
});
|
|
274
|
-
// DELETE /api/v1/content/:id?cascade=true
|
|
277
|
+
// DELETE /api/v1/content/:id?cascade=true: cascade opts into trashing a
|
|
275
278
|
// node's whole descendant subtree in one call, the API equivalent of the
|
|
276
|
-
// admin trash route's confirm:true retry (S154). z.stringbool()
|
|
279
|
+
// admin trash route's confirm:true retry (S154). z.stringbool() is used, NOT
|
|
277
280
|
// z.coerce.boolean(), which is plain JS truthiness (Boolean("false") ===
|
|
278
281
|
// true, so "?cascade=false" would silently perform the cascade it looks
|
|
279
|
-
// like it's declining)
|
|
282
|
+
// like it's declining). It parses "true"/"1"/"yes"/"on"/"y"/"enabled" to
|
|
280
283
|
// true and "false"/"0"/"no"/"off"/"n"/"disabled" to false, and rejects
|
|
281
284
|
// anything else (including a bare "?cascade" with no value, which arrives
|
|
282
285
|
// as "") with a clean 400 instead of guessing. Omitting the param
|
|
@@ -285,7 +288,7 @@ export const PublicContentDeleteQuerySchema = z.object({
|
|
|
285
288
|
cascade: z.stringbool().optional().default(false),
|
|
286
289
|
});
|
|
287
290
|
// DELETE /api/v1/content/:id response. Deletion is soft (trash, not
|
|
288
|
-
// destroy
|
|
291
|
+
// destroy: content immutability applies to the whole subtree, not just
|
|
289
292
|
// this node), so there is nothing to hand back but a confirmation; same
|
|
290
293
|
// shape as PublicMediaDeleteResponseSchema below, kept as its own type
|
|
291
294
|
// since the two write surfaces evolve independently.
|
|
@@ -293,8 +296,8 @@ export const PublicContentDeleteResponseSchema = z.object({ ok: z.literal(true)
|
|
|
293
296
|
// 409 when the node has descendants and the caller didn't pass
|
|
294
297
|
// ?cascade=true. Carries the same information the admin trash route's
|
|
295
298
|
// unconfirmed 409 does (ContentTrashConfirmationSchema: blast radius +
|
|
296
|
-
// remedy) reshaped for a single API round trip instead of a UI dialog
|
|
297
|
-
//
|
|
299
|
+
// remedy) reshaped for a single API round trip instead of a UI dialog.
|
|
300
|
+
// The remedy is spelled out in the message itself since there's no
|
|
298
301
|
// confirmation click to follow up with, so there's no separate
|
|
299
302
|
// requiresConfirmation/nodeName pair to carry.
|
|
300
303
|
export const PublicContentDeleteConfirmationSchema = z.object({
|
|
@@ -302,7 +305,7 @@ export const PublicContentDeleteConfirmationSchema = z.object({
|
|
|
302
305
|
message: z.string(),
|
|
303
306
|
});
|
|
304
307
|
// Public media write shapes (Month 9 media write routes). The upload is a
|
|
305
|
-
// multipart request
|
|
308
|
+
// multipart request: the binary streams separately at the route; this
|
|
306
309
|
// schema covers only the accompanying form fields. No folderId: folders
|
|
307
310
|
// are an admin-only surface (S186e), never exposed on the public write
|
|
308
311
|
// API. `.strict()` so a caller that sends folderId here gets a clear 400
|
|
@@ -322,7 +325,7 @@ export const PublicMediaUploadBodySchema = PublicMediaUploadFieldsSchema.extend(
|
|
|
322
325
|
.file()
|
|
323
326
|
.describe("The file to store. It must come after the visibility field in the multipart body: a field sent after the file may not be read."),
|
|
324
327
|
});
|
|
325
|
-
// PATCH /api/v1/media/:id body. v1 patches visibility only
|
|
328
|
+
// PATCH /api/v1/media/:id body. v1 patches visibility only: metadata
|
|
326
329
|
// (filename, custom fields) is a later task, so visibility is required
|
|
327
330
|
// rather than optional: this is the only field there is, and an empty
|
|
328
331
|
// body has nothing to do. folderId is deliberately absent for the same
|
|
@@ -334,7 +337,7 @@ export const PublicMediaUpdateRequestSchema = z
|
|
|
334
337
|
})
|
|
335
338
|
.strict();
|
|
336
339
|
// Upload (POST) and update (PATCH) both hand back the same public media
|
|
337
|
-
// item shape already used for reads/lists
|
|
340
|
+
// item shape already used for reads/lists: an alias, not a fresh shape.
|
|
338
341
|
export const PublicMediaWriteResponseSchema = PublicMediaFileSchema;
|
|
339
342
|
// S234e: the route behind this now trashes rather than destroys (the
|
|
340
343
|
// admin DELETE route made the same change in the same session; see
|
|
@@ -5,17 +5,17 @@ import { TemplateAliasSchema } from "./template.schema.js";
|
|
|
5
5
|
// (rich-text-view.tsx's useTextStyles, insert-menu.tsx's/block-panel.tsx's
|
|
6
6
|
// useBlockListings); POST .../block renders one embeddable block's live
|
|
7
7
|
// preview (block-panel.tsx's BlockPreviewPopover). Both list responses are
|
|
8
|
-
// bare arrays, not `{items, nextCursor}
|
|
8
|
+
// bare arrays, not `{items, nextCursor}`, deliberately NOT
|
|
9
9
|
// cursor-paginated, unlike api-design.md's list-endpoint rule for content:
|
|
10
10
|
// both sources are small, in-process scans over registered assets/
|
|
11
11
|
// templates (assetMirror.listTextStyles() / templateService.
|
|
12
12
|
// listEmbeddableBlocks(), Task 4), not content, and every existing UI
|
|
13
|
-
// consumer already parses a bare array off `await response.json()
|
|
13
|
+
// consumer already parses a bare array off `await response.json()`. See
|
|
14
14
|
// the three files above.
|
|
15
15
|
export const TextStyleEntrySchema = z.object({ key: z.string(), label: z.string() }).strict();
|
|
16
16
|
export const TextStylesResponseSchema = z.array(TextStyleEntrySchema);
|
|
17
17
|
// Mirrors BlockParamType/BlockParam in apps/server/src/render/
|
|
18
|
-
// block-annotations.ts (the parser that produces these)
|
|
18
|
+
// block-annotations.ts (the parser that produces these), kept as an
|
|
19
19
|
// independent schema here rather than imported, same "server internals
|
|
20
20
|
// don't leak into api-schemas" boundary every other schema in this
|
|
21
21
|
// package respects.
|
|
@@ -37,7 +37,7 @@ export const BlockListingSchema = z
|
|
|
37
37
|
.strict();
|
|
38
38
|
export const BlockListResponseSchema = z.array(BlockListingSchema);
|
|
39
39
|
// params is an arbitrary bag (whatever the block's own declared params
|
|
40
|
-
// require)
|
|
40
|
+
// require), validated against the live template declaration server-side
|
|
41
41
|
// (block-annotations.ts's findInvalidBlockParamKey), not by this schema,
|
|
42
42
|
// so it stays a permissive record here rather than trying to model every
|
|
43
43
|
// possible declared param shape in Zod.
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { z } from "zod";
|
|
2
2
|
// Site-level render settings, stored in the (previously unused) Prisma
|
|
3
|
-
// `Setting` key-value model
|
|
3
|
+
// `Setting` key-value model (key "render", value = this object). The
|
|
4
4
|
// catch-all template is the S192 spec §6 step-3 fallback: rendered when a
|
|
5
5
|
// node's document type has no template of its own (the SPA-shell case).
|
|
6
6
|
export const RenderSettingsSchema = z.object({
|
|
@@ -0,0 +1,83 @@
|
|
|
1
|
+
import { z } from "zod";
|
|
2
|
+
/** "YYYY-MM" with a month from 01 to 12. A linear scan with the length
|
|
3
|
+
* checked first, never a regex (the value comes from a query string). */
|
|
4
|
+
export declare function isRevenueMonthKey(value: string): boolean;
|
|
5
|
+
export declare const RevenueMonthKeySchema: z.ZodString;
|
|
6
|
+
/** A plugin id is at most 214 characters (the npm name cap the marketplace uses). */
|
|
7
|
+
export declare const REVENUE_PLUGIN_PARAM_MAX = 214;
|
|
8
|
+
export declare const RevenuePluginParamSchema: z.ZodString;
|
|
9
|
+
export declare const RevenueMonthSchema: z.ZodObject<{
|
|
10
|
+
month: z.ZodString;
|
|
11
|
+
oneTimeCents: z.ZodNumber;
|
|
12
|
+
recurringCents: z.ZodNumber;
|
|
13
|
+
newSubscribers: z.ZodNumber;
|
|
14
|
+
renewals: z.ZodNumber;
|
|
15
|
+
lostSubscribers: z.ZodNumber;
|
|
16
|
+
planChanges: z.ZodNumber;
|
|
17
|
+
netCents: z.ZodNumber;
|
|
18
|
+
}, z.core.$strict>;
|
|
19
|
+
export type RevenueMonth = z.infer<typeof RevenueMonthSchema>;
|
|
20
|
+
export declare const RevenuePlanMonthSchema: z.ZodObject<{
|
|
21
|
+
planId: z.ZodString;
|
|
22
|
+
pluginId: z.ZodString;
|
|
23
|
+
key: z.ZodString;
|
|
24
|
+
name: z.ZodString;
|
|
25
|
+
shape: z.ZodEnum<{
|
|
26
|
+
monthly: "monthly";
|
|
27
|
+
yearly: "yearly";
|
|
28
|
+
}>;
|
|
29
|
+
retired: z.ZodBoolean;
|
|
30
|
+
subscribers: z.ZodNumber;
|
|
31
|
+
newSubscribers: z.ZodNumber;
|
|
32
|
+
renewals: z.ZodNumber;
|
|
33
|
+
lostSubscribers: z.ZodNumber;
|
|
34
|
+
recurringCents: z.ZodNumber;
|
|
35
|
+
netCents: z.ZodNumber;
|
|
36
|
+
}, z.core.$strict>;
|
|
37
|
+
export type RevenuePlanMonth = z.infer<typeof RevenuePlanMonthSchema>;
|
|
38
|
+
export declare const RevenueNowSchema: z.ZodObject<{
|
|
39
|
+
activeSubscribers: z.ZodNumber;
|
|
40
|
+
monthlyRecurringCents: z.ZodNumber;
|
|
41
|
+
monthlyRecurringNetCents: z.ZodNumber;
|
|
42
|
+
cancelling: z.ZodNumber;
|
|
43
|
+
inGrace: z.ZodNumber;
|
|
44
|
+
}, z.core.$strict>;
|
|
45
|
+
export type RevenueNow = z.infer<typeof RevenueNowSchema>;
|
|
46
|
+
export declare const RevenueViewSchema: z.ZodObject<{
|
|
47
|
+
months: z.ZodArray<z.ZodObject<{
|
|
48
|
+
month: z.ZodString;
|
|
49
|
+
oneTimeCents: z.ZodNumber;
|
|
50
|
+
recurringCents: z.ZodNumber;
|
|
51
|
+
newSubscribers: z.ZodNumber;
|
|
52
|
+
renewals: z.ZodNumber;
|
|
53
|
+
lostSubscribers: z.ZodNumber;
|
|
54
|
+
planChanges: z.ZodNumber;
|
|
55
|
+
netCents: z.ZodNumber;
|
|
56
|
+
}, z.core.$strict>>;
|
|
57
|
+
byPlanMonth: z.ZodString;
|
|
58
|
+
byPlan: z.ZodArray<z.ZodObject<{
|
|
59
|
+
planId: z.ZodString;
|
|
60
|
+
pluginId: z.ZodString;
|
|
61
|
+
key: z.ZodString;
|
|
62
|
+
name: z.ZodString;
|
|
63
|
+
shape: z.ZodEnum<{
|
|
64
|
+
monthly: "monthly";
|
|
65
|
+
yearly: "yearly";
|
|
66
|
+
}>;
|
|
67
|
+
retired: z.ZodBoolean;
|
|
68
|
+
subscribers: z.ZodNumber;
|
|
69
|
+
newSubscribers: z.ZodNumber;
|
|
70
|
+
renewals: z.ZodNumber;
|
|
71
|
+
lostSubscribers: z.ZodNumber;
|
|
72
|
+
recurringCents: z.ZodNumber;
|
|
73
|
+
netCents: z.ZodNumber;
|
|
74
|
+
}, z.core.$strict>>;
|
|
75
|
+
now: z.ZodObject<{
|
|
76
|
+
activeSubscribers: z.ZodNumber;
|
|
77
|
+
monthlyRecurringCents: z.ZodNumber;
|
|
78
|
+
monthlyRecurringNetCents: z.ZodNumber;
|
|
79
|
+
cancelling: z.ZodNumber;
|
|
80
|
+
inGrace: z.ZodNumber;
|
|
81
|
+
}, z.core.$strict>;
|
|
82
|
+
}, z.core.$strict>;
|
|
83
|
+
export type RevenueView = z.infer<typeof RevenueViewSchema>;
|
|
@@ -0,0 +1,73 @@
|
|
|
1
|
+
import { z } from "zod";
|
|
2
|
+
// S321b (spec 3a, D1 to D4): what the marketplace portal's Revenue page
|
|
3
|
+
// reads. Months are UTC calendar months as "YYYY-MM" (D3); money is whole
|
|
4
|
+
// USD cents after refunds (D4). No field names a buyer.
|
|
5
|
+
/** "YYYY-MM" with a month from 01 to 12. A linear scan with the length
|
|
6
|
+
* checked first, never a regex (the value comes from a query string). */
|
|
7
|
+
export function isRevenueMonthKey(value) {
|
|
8
|
+
if (value.length !== 7)
|
|
9
|
+
return false;
|
|
10
|
+
for (let i = 0; i < 7; i++) {
|
|
11
|
+
const c = value.charCodeAt(i);
|
|
12
|
+
if (i === 4) {
|
|
13
|
+
if (c !== 45)
|
|
14
|
+
return false;
|
|
15
|
+
}
|
|
16
|
+
else if (c < 48 || c > 57) {
|
|
17
|
+
return false;
|
|
18
|
+
}
|
|
19
|
+
}
|
|
20
|
+
const month = (value.charCodeAt(5) - 48) * 10 + (value.charCodeAt(6) - 48);
|
|
21
|
+
return month >= 1 && month <= 12;
|
|
22
|
+
}
|
|
23
|
+
export const RevenueMonthKeySchema = z.string().refine(isRevenueMonthKey, { message: "Expected a month as YYYY-MM" });
|
|
24
|
+
/** A plugin id is at most 214 characters (the npm name cap the marketplace uses). */
|
|
25
|
+
export const REVENUE_PLUGIN_PARAM_MAX = 214;
|
|
26
|
+
export const RevenuePluginParamSchema = z.string().trim().min(1).max(REVENUE_PLUGIN_PARAM_MAX);
|
|
27
|
+
const Cents = z.number().int().nonnegative();
|
|
28
|
+
const Count = z.number().int().nonnegative();
|
|
29
|
+
export const RevenueMonthSchema = z
|
|
30
|
+
.object({
|
|
31
|
+
month: RevenueMonthKeySchema,
|
|
32
|
+
oneTimeCents: Cents,
|
|
33
|
+
recurringCents: Cents,
|
|
34
|
+
newSubscribers: Count,
|
|
35
|
+
renewals: Count,
|
|
36
|
+
lostSubscribers: Count,
|
|
37
|
+
planChanges: Count,
|
|
38
|
+
netCents: Cents,
|
|
39
|
+
})
|
|
40
|
+
.strict();
|
|
41
|
+
export const RevenuePlanMonthSchema = z
|
|
42
|
+
.object({
|
|
43
|
+
planId: z.string().min(1).max(64),
|
|
44
|
+
pluginId: z.string().min(1).max(REVENUE_PLUGIN_PARAM_MAX),
|
|
45
|
+
key: z.string().min(1),
|
|
46
|
+
name: z.string().min(1),
|
|
47
|
+
shape: z.enum(["monthly", "yearly"]),
|
|
48
|
+
retired: z.boolean(),
|
|
49
|
+
subscribers: Count,
|
|
50
|
+
newSubscribers: Count,
|
|
51
|
+
renewals: Count,
|
|
52
|
+
lostSubscribers: Count,
|
|
53
|
+
recurringCents: Cents,
|
|
54
|
+
netCents: Cents,
|
|
55
|
+
})
|
|
56
|
+
.strict();
|
|
57
|
+
export const RevenueNowSchema = z
|
|
58
|
+
.object({
|
|
59
|
+
activeSubscribers: Count,
|
|
60
|
+
monthlyRecurringCents: Cents,
|
|
61
|
+
monthlyRecurringNetCents: Cents,
|
|
62
|
+
cancelling: Count,
|
|
63
|
+
inGrace: Count,
|
|
64
|
+
})
|
|
65
|
+
.strict();
|
|
66
|
+
export const RevenueViewSchema = z
|
|
67
|
+
.object({
|
|
68
|
+
months: z.array(RevenueMonthSchema).length(12),
|
|
69
|
+
byPlanMonth: RevenueMonthKeySchema,
|
|
70
|
+
byPlan: z.array(RevenuePlanMonthSchema),
|
|
71
|
+
now: RevenueNowSchema,
|
|
72
|
+
})
|
|
73
|
+
.strict();
|
|
@@ -0,0 +1,207 @@
|
|
|
1
|
+
import { z } from "zod";
|
|
2
|
+
/** The most a stored media ceiling may be (S358 P6). Uploads are held in memory. */
|
|
3
|
+
export declare const MEDIA_MAX_SIZE_CEILING_BYTES = 1073741824;
|
|
4
|
+
export declare const MAX_ASSET_BYTES_CEILING = 33554432;
|
|
5
|
+
export declare const MAX_TEMPLATE_BYTES_CEILING = 8388608;
|
|
6
|
+
/** The longest licence grace period, in days: a paid plugin's own check refuses a verdict older
|
|
7
|
+
* than this, so a longer period could never hold (S284b). */
|
|
8
|
+
export declare const LICENSE_GRACE_DAYS_MAX = 14;
|
|
9
|
+
export declare const RATE_LIMIT_SETTING_KEYS: readonly ["rateLimitKeyMax", "rateLimitIpMax", "rateLimitWindowSeconds", "rateLimitDocsMax", "rateLimitDocsWindowSeconds", "rateLimitMediaMax", "rateLimitMediaWindowSeconds", "rateLimitRenderMax", "rateLimitRenderWindowSeconds", "rateLimitAdminMax", "rateLimitAdminWindowSeconds"];
|
|
10
|
+
export type RateLimitSettingKey = (typeof RATE_LIMIT_SETTING_KEYS)[number];
|
|
11
|
+
export declare function isRateLimitSettingKey(key: string): key is RateLimitSettingKey;
|
|
12
|
+
export declare const RATE_LIMIT_MAX_CEILING = 1000000;
|
|
13
|
+
export declare const RATE_LIMIT_WINDOW_CEILING_SECONDS = 3600;
|
|
14
|
+
/** S359 spec D8: the administrator's own path runs through these two lanes. */
|
|
15
|
+
export declare const RATE_LIMIT_FLOORS_PER_MINUTE: {
|
|
16
|
+
readonly ip: 30;
|
|
17
|
+
readonly admin: 120;
|
|
18
|
+
};
|
|
19
|
+
/** The smallest maximum that keeps `floorPerMinute` over a window of `windowSeconds`. It floors
|
|
20
|
+
* the burst as well as the rate (S359 fix wave): a window under a minute still allows the
|
|
21
|
+
* per-minute floor in one window, because a cold admin load is many requests in under a second. */
|
|
22
|
+
export declare function rateLimitFloorMax(floorPerMinute: number, windowSeconds: number): number;
|
|
23
|
+
export declare const LIVE_SERVER_SETTING_KEYS: readonly ["previewTokenTtl", "previewBaseUrl", "publicUrl", "mediaMaxSize", "licenseCheckIntervalHours", "licenseStaleWarnDays", "maxAssetBytes", "maxTemplateBytes", "licenseGraceDays", "rateLimitKeyMax", "rateLimitIpMax", "rateLimitWindowSeconds", "rateLimitDocsMax", "rateLimitDocsWindowSeconds", "rateLimitMediaMax", "rateLimitMediaWindowSeconds", "rateLimitRenderMax", "rateLimitRenderWindowSeconds", "rateLimitAdminMax", "rateLimitAdminWindowSeconds"];
|
|
24
|
+
export declare const LiveServerSettingKeySchema: z.ZodEnum<{
|
|
25
|
+
licenseGraceDays: "licenseGraceDays";
|
|
26
|
+
licenseStaleWarnDays: "licenseStaleWarnDays";
|
|
27
|
+
rateLimitKeyMax: "rateLimitKeyMax";
|
|
28
|
+
rateLimitIpMax: "rateLimitIpMax";
|
|
29
|
+
rateLimitWindowSeconds: "rateLimitWindowSeconds";
|
|
30
|
+
rateLimitDocsMax: "rateLimitDocsMax";
|
|
31
|
+
rateLimitDocsWindowSeconds: "rateLimitDocsWindowSeconds";
|
|
32
|
+
rateLimitMediaMax: "rateLimitMediaMax";
|
|
33
|
+
rateLimitMediaWindowSeconds: "rateLimitMediaWindowSeconds";
|
|
34
|
+
rateLimitRenderMax: "rateLimitRenderMax";
|
|
35
|
+
rateLimitRenderWindowSeconds: "rateLimitRenderWindowSeconds";
|
|
36
|
+
rateLimitAdminMax: "rateLimitAdminMax";
|
|
37
|
+
rateLimitAdminWindowSeconds: "rateLimitAdminWindowSeconds";
|
|
38
|
+
previewTokenTtl: "previewTokenTtl";
|
|
39
|
+
previewBaseUrl: "previewBaseUrl";
|
|
40
|
+
publicUrl: "publicUrl";
|
|
41
|
+
mediaMaxSize: "mediaMaxSize";
|
|
42
|
+
licenseCheckIntervalHours: "licenseCheckIntervalHours";
|
|
43
|
+
maxAssetBytes: "maxAssetBytes";
|
|
44
|
+
maxTemplateBytes: "maxTemplateBytes";
|
|
45
|
+
}>;
|
|
46
|
+
export type LiveServerSettingKey = z.infer<typeof LiveServerSettingKeySchema>;
|
|
47
|
+
export declare const ServerSettingSourceSchema: z.ZodEnum<{
|
|
48
|
+
default: "default";
|
|
49
|
+
stored: "stored";
|
|
50
|
+
environment: "environment";
|
|
51
|
+
}>;
|
|
52
|
+
export type ServerSettingSource = z.infer<typeof ServerSettingSourceSchema>;
|
|
53
|
+
export declare const LiveServerSettingValueSchemas: {
|
|
54
|
+
readonly previewTokenTtl: z.ZodNumber;
|
|
55
|
+
readonly previewBaseUrl: z.ZodPipe<z.ZodString, z.ZodURL>;
|
|
56
|
+
readonly publicUrl: z.ZodPipe<z.ZodString, z.ZodURL>;
|
|
57
|
+
readonly mediaMaxSize: z.ZodNumber;
|
|
58
|
+
readonly licenseCheckIntervalHours: z.ZodNumber;
|
|
59
|
+
readonly licenseStaleWarnDays: z.ZodNumber;
|
|
60
|
+
readonly maxAssetBytes: z.ZodNumber;
|
|
61
|
+
readonly maxTemplateBytes: z.ZodNumber;
|
|
62
|
+
readonly licenseGraceDays: z.ZodNumber;
|
|
63
|
+
readonly rateLimitKeyMax: z.ZodNumber;
|
|
64
|
+
readonly rateLimitIpMax: z.ZodNumber;
|
|
65
|
+
readonly rateLimitWindowSeconds: z.ZodNumber;
|
|
66
|
+
readonly rateLimitDocsMax: z.ZodNumber;
|
|
67
|
+
readonly rateLimitDocsWindowSeconds: z.ZodNumber;
|
|
68
|
+
readonly rateLimitMediaMax: z.ZodNumber;
|
|
69
|
+
readonly rateLimitMediaWindowSeconds: z.ZodNumber;
|
|
70
|
+
readonly rateLimitRenderMax: z.ZodNumber;
|
|
71
|
+
readonly rateLimitRenderWindowSeconds: z.ZodNumber;
|
|
72
|
+
readonly rateLimitAdminMax: z.ZodNumber;
|
|
73
|
+
readonly rateLimitAdminWindowSeconds: z.ZodNumber;
|
|
74
|
+
};
|
|
75
|
+
export interface LiveServerSettingValues {
|
|
76
|
+
previewTokenTtl: number;
|
|
77
|
+
previewBaseUrl: string | null;
|
|
78
|
+
publicUrl: string | null;
|
|
79
|
+
mediaMaxSize: number;
|
|
80
|
+
licenseCheckIntervalHours: number;
|
|
81
|
+
licenseStaleWarnDays: number;
|
|
82
|
+
maxAssetBytes: number;
|
|
83
|
+
maxTemplateBytes: number;
|
|
84
|
+
licenseGraceDays: number;
|
|
85
|
+
rateLimitKeyMax: number;
|
|
86
|
+
rateLimitIpMax: number;
|
|
87
|
+
rateLimitWindowSeconds: number;
|
|
88
|
+
rateLimitDocsMax: number;
|
|
89
|
+
rateLimitDocsWindowSeconds: number;
|
|
90
|
+
rateLimitMediaMax: number;
|
|
91
|
+
rateLimitMediaWindowSeconds: number;
|
|
92
|
+
rateLimitRenderMax: number;
|
|
93
|
+
rateLimitRenderWindowSeconds: number;
|
|
94
|
+
rateLimitAdminMax: number;
|
|
95
|
+
rateLimitAdminWindowSeconds: number;
|
|
96
|
+
}
|
|
97
|
+
/** A key left out is unchanged; null clears the stored value (back to the environment). */
|
|
98
|
+
export declare const UpdateServerSettingsRequestSchema: z.ZodObject<{
|
|
99
|
+
previewTokenTtl: z.ZodOptional<z.ZodNullable<z.ZodNumber>>;
|
|
100
|
+
previewBaseUrl: z.ZodOptional<z.ZodNullable<z.ZodPipe<z.ZodString, z.ZodURL>>>;
|
|
101
|
+
publicUrl: z.ZodOptional<z.ZodNullable<z.ZodPipe<z.ZodString, z.ZodURL>>>;
|
|
102
|
+
mediaMaxSize: z.ZodOptional<z.ZodNullable<z.ZodNumber>>;
|
|
103
|
+
licenseCheckIntervalHours: z.ZodOptional<z.ZodNullable<z.ZodNumber>>;
|
|
104
|
+
licenseStaleWarnDays: z.ZodOptional<z.ZodNullable<z.ZodNumber>>;
|
|
105
|
+
maxAssetBytes: z.ZodOptional<z.ZodNullable<z.ZodNumber>>;
|
|
106
|
+
maxTemplateBytes: z.ZodOptional<z.ZodNullable<z.ZodNumber>>;
|
|
107
|
+
licenseGraceDays: z.ZodOptional<z.ZodNullable<z.ZodNumber>>;
|
|
108
|
+
rateLimitKeyMax: z.ZodOptional<z.ZodNullable<z.ZodNumber>>;
|
|
109
|
+
rateLimitIpMax: z.ZodOptional<z.ZodNullable<z.ZodNumber>>;
|
|
110
|
+
rateLimitWindowSeconds: z.ZodOptional<z.ZodNullable<z.ZodNumber>>;
|
|
111
|
+
rateLimitDocsMax: z.ZodOptional<z.ZodNullable<z.ZodNumber>>;
|
|
112
|
+
rateLimitDocsWindowSeconds: z.ZodOptional<z.ZodNullable<z.ZodNumber>>;
|
|
113
|
+
rateLimitMediaMax: z.ZodOptional<z.ZodNullable<z.ZodNumber>>;
|
|
114
|
+
rateLimitMediaWindowSeconds: z.ZodOptional<z.ZodNullable<z.ZodNumber>>;
|
|
115
|
+
rateLimitRenderMax: z.ZodOptional<z.ZodNullable<z.ZodNumber>>;
|
|
116
|
+
rateLimitRenderWindowSeconds: z.ZodOptional<z.ZodNullable<z.ZodNumber>>;
|
|
117
|
+
rateLimitAdminMax: z.ZodOptional<z.ZodNullable<z.ZodNumber>>;
|
|
118
|
+
rateLimitAdminWindowSeconds: z.ZodOptional<z.ZodNullable<z.ZodNumber>>;
|
|
119
|
+
}, z.core.$strict>;
|
|
120
|
+
export type UpdateServerSettingsRequest = z.infer<typeof UpdateServerSettingsRequestSchema>;
|
|
121
|
+
export declare const LiveServerSettingRowSchema: z.ZodObject<{
|
|
122
|
+
key: z.ZodEnum<{
|
|
123
|
+
licenseGraceDays: "licenseGraceDays";
|
|
124
|
+
licenseStaleWarnDays: "licenseStaleWarnDays";
|
|
125
|
+
rateLimitKeyMax: "rateLimitKeyMax";
|
|
126
|
+
rateLimitIpMax: "rateLimitIpMax";
|
|
127
|
+
rateLimitWindowSeconds: "rateLimitWindowSeconds";
|
|
128
|
+
rateLimitDocsMax: "rateLimitDocsMax";
|
|
129
|
+
rateLimitDocsWindowSeconds: "rateLimitDocsWindowSeconds";
|
|
130
|
+
rateLimitMediaMax: "rateLimitMediaMax";
|
|
131
|
+
rateLimitMediaWindowSeconds: "rateLimitMediaWindowSeconds";
|
|
132
|
+
rateLimitRenderMax: "rateLimitRenderMax";
|
|
133
|
+
rateLimitRenderWindowSeconds: "rateLimitRenderWindowSeconds";
|
|
134
|
+
rateLimitAdminMax: "rateLimitAdminMax";
|
|
135
|
+
rateLimitAdminWindowSeconds: "rateLimitAdminWindowSeconds";
|
|
136
|
+
previewTokenTtl: "previewTokenTtl";
|
|
137
|
+
previewBaseUrl: "previewBaseUrl";
|
|
138
|
+
publicUrl: "publicUrl";
|
|
139
|
+
mediaMaxSize: "mediaMaxSize";
|
|
140
|
+
licenseCheckIntervalHours: "licenseCheckIntervalHours";
|
|
141
|
+
maxAssetBytes: "maxAssetBytes";
|
|
142
|
+
maxTemplateBytes: "maxTemplateBytes";
|
|
143
|
+
}>;
|
|
144
|
+
envName: z.ZodString;
|
|
145
|
+
value: z.ZodUnion<readonly [z.ZodNumber, z.ZodString, z.ZodNull]>;
|
|
146
|
+
source: z.ZodEnum<{
|
|
147
|
+
default: "default";
|
|
148
|
+
stored: "stored";
|
|
149
|
+
environment: "environment";
|
|
150
|
+
}>;
|
|
151
|
+
environment: z.ZodNullable<z.ZodString>;
|
|
152
|
+
defaultValue: z.ZodUnion<readonly [z.ZodNumber, z.ZodString, z.ZodNull]>;
|
|
153
|
+
envLine: z.ZodNullable<z.ZodString>;
|
|
154
|
+
}, z.core.$strip>;
|
|
155
|
+
export declare const RestartOnlySettingRowSchema: z.ZodObject<{
|
|
156
|
+
envName: z.ZodString;
|
|
157
|
+
environment: z.ZodNullable<z.ZodString>;
|
|
158
|
+
reason: z.ZodEnum<{
|
|
159
|
+
registration: "registration";
|
|
160
|
+
boundary: "boundary";
|
|
161
|
+
}>;
|
|
162
|
+
}, z.core.$strip>;
|
|
163
|
+
export declare const ServerSettingsResponseSchema: z.ZodObject<{
|
|
164
|
+
live: z.ZodArray<z.ZodObject<{
|
|
165
|
+
key: z.ZodEnum<{
|
|
166
|
+
licenseGraceDays: "licenseGraceDays";
|
|
167
|
+
licenseStaleWarnDays: "licenseStaleWarnDays";
|
|
168
|
+
rateLimitKeyMax: "rateLimitKeyMax";
|
|
169
|
+
rateLimitIpMax: "rateLimitIpMax";
|
|
170
|
+
rateLimitWindowSeconds: "rateLimitWindowSeconds";
|
|
171
|
+
rateLimitDocsMax: "rateLimitDocsMax";
|
|
172
|
+
rateLimitDocsWindowSeconds: "rateLimitDocsWindowSeconds";
|
|
173
|
+
rateLimitMediaMax: "rateLimitMediaMax";
|
|
174
|
+
rateLimitMediaWindowSeconds: "rateLimitMediaWindowSeconds";
|
|
175
|
+
rateLimitRenderMax: "rateLimitRenderMax";
|
|
176
|
+
rateLimitRenderWindowSeconds: "rateLimitRenderWindowSeconds";
|
|
177
|
+
rateLimitAdminMax: "rateLimitAdminMax";
|
|
178
|
+
rateLimitAdminWindowSeconds: "rateLimitAdminWindowSeconds";
|
|
179
|
+
previewTokenTtl: "previewTokenTtl";
|
|
180
|
+
previewBaseUrl: "previewBaseUrl";
|
|
181
|
+
publicUrl: "publicUrl";
|
|
182
|
+
mediaMaxSize: "mediaMaxSize";
|
|
183
|
+
licenseCheckIntervalHours: "licenseCheckIntervalHours";
|
|
184
|
+
maxAssetBytes: "maxAssetBytes";
|
|
185
|
+
maxTemplateBytes: "maxTemplateBytes";
|
|
186
|
+
}>;
|
|
187
|
+
envName: z.ZodString;
|
|
188
|
+
value: z.ZodUnion<readonly [z.ZodNumber, z.ZodString, z.ZodNull]>;
|
|
189
|
+
source: z.ZodEnum<{
|
|
190
|
+
default: "default";
|
|
191
|
+
stored: "stored";
|
|
192
|
+
environment: "environment";
|
|
193
|
+
}>;
|
|
194
|
+
environment: z.ZodNullable<z.ZodString>;
|
|
195
|
+
defaultValue: z.ZodUnion<readonly [z.ZodNumber, z.ZodString, z.ZodNull]>;
|
|
196
|
+
envLine: z.ZodNullable<z.ZodString>;
|
|
197
|
+
}, z.core.$strip>>;
|
|
198
|
+
restartOnly: z.ZodArray<z.ZodObject<{
|
|
199
|
+
envName: z.ZodString;
|
|
200
|
+
environment: z.ZodNullable<z.ZodString>;
|
|
201
|
+
reason: z.ZodEnum<{
|
|
202
|
+
registration: "registration";
|
|
203
|
+
boundary: "boundary";
|
|
204
|
+
}>;
|
|
205
|
+
}, z.core.$strip>>;
|
|
206
|
+
}, z.core.$strip>;
|
|
207
|
+
export type ServerSettingsResponse = z.infer<typeof ServerSettingsResponseSchema>;
|