@velora-cms/api-schemas 0.9.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.
Files changed (59) hide show
  1. package/LICENSE +202 -0
  2. package/README.md +22 -0
  3. package/dist/api-error.schema.d.ts +5 -0
  4. package/dist/api-error.schema.js +6 -0
  5. package/dist/api-key-api.schema.d.ts +50 -0
  6. package/dist/api-key-api.schema.js +29 -0
  7. package/dist/auth.schema.d.ts +40 -0
  8. package/dist/auth.schema.js +30 -0
  9. package/dist/content-api.schema.d.ts +188 -0
  10. package/dist/content-api.schema.js +121 -0
  11. package/dist/content-trash-api.schema.d.ts +20 -0
  12. package/dist/content-trash-api.schema.js +23 -0
  13. package/dist/content-trash.schema.d.ts +31 -0
  14. package/dist/content-trash.schema.js +26 -0
  15. package/dist/content-version.schema.d.ts +11 -0
  16. package/dist/content-version.schema.js +10 -0
  17. package/dist/content.schema.d.ts +15 -0
  18. package/dist/content.schema.js +14 -0
  19. package/dist/data-type-api.schema.d.ts +36 -0
  20. package/dist/data-type-api.schema.js +32 -0
  21. package/dist/data-type-config.schema.d.ts +9 -0
  22. package/dist/data-type-config.schema.js +32 -0
  23. package/dist/document-type-api.schema.d.ts +202 -0
  24. package/dist/document-type-api.schema.js +86 -0
  25. package/dist/document-type.schema.d.ts +90 -0
  26. package/dist/document-type.schema.js +103 -0
  27. package/dist/health.schema.d.ts +6 -0
  28. package/dist/health.schema.js +5 -0
  29. package/dist/index.d.ts +54 -0
  30. package/dist/index.js +27 -0
  31. package/dist/marketplace-listing-api.schema.d.ts +205 -0
  32. package/dist/marketplace-listing-api.schema.js +115 -0
  33. package/dist/media-api.schema.d.ts +36 -0
  34. package/dist/media-api.schema.js +23 -0
  35. package/dist/media.schema.d.ts +11 -0
  36. package/dist/media.schema.js +10 -0
  37. package/dist/plugin-management-api.schema.d.ts +145 -0
  38. package/dist/plugin-management-api.schema.js +186 -0
  39. package/dist/plugin-registry-api.schema.d.ts +31 -0
  40. package/dist/plugin-registry-api.schema.js +25 -0
  41. package/dist/plugin-storage-api.schema.d.ts +15 -0
  42. package/dist/plugin-storage-api.schema.js +24 -0
  43. package/dist/public-api.schema.d.ts +211 -0
  44. package/dist/public-api.schema.js +185 -0
  45. package/dist/setup-api.schema.d.ts +78 -0
  46. package/dist/setup-api.schema.js +88 -0
  47. package/dist/snapshot-api.schema.d.ts +43 -0
  48. package/dist/snapshot-api.schema.js +25 -0
  49. package/dist/snapshot.schema.d.ts +28 -0
  50. package/dist/snapshot.schema.js +17 -0
  51. package/dist/template-api.schema.d.ts +33 -0
  52. package/dist/template-api.schema.js +28 -0
  53. package/dist/template.schema.d.ts +7 -0
  54. package/dist/template.schema.js +13 -0
  55. package/dist/theme-api.schema.d.ts +21 -0
  56. package/dist/theme-api.schema.js +14 -0
  57. package/dist/user-api.schema.d.ts +79 -0
  58. package/dist/user-api.schema.js +36 -0
  59. package/package.json +26 -0
@@ -0,0 +1,86 @@
1
+ import { z } from "zod";
2
+ import { DocumentTypeDefinitionSchema, FieldDefinitionSchema, TabDefinitionSchema, TreeRulesSchema, } from "./document-type.schema.js";
3
+ // Shared by create AND update: duplicate field keys within one document
4
+ // type would silently collide in ContentVersion.data later, and a tabId
5
+ // must reference a tab declared in the same payload.
6
+ function validateFieldsAndTabs(value, ctx) {
7
+ const seen = new Set();
8
+ for (const [index, field] of value.fields.entries()) {
9
+ if (seen.has(field.id)) {
10
+ ctx.addIssue({
11
+ code: "custom",
12
+ message: `Duplicate field id "${field.id}" — field ids must be unique within a document type`,
13
+ path: ["fields", index, "id"],
14
+ });
15
+ }
16
+ seen.add(field.id);
17
+ }
18
+ const tabIds = new Set(value.tabs.map((tab) => tab.id));
19
+ for (const [index, field] of value.fields.entries()) {
20
+ if (field.tabId !== undefined && !tabIds.has(field.tabId)) {
21
+ ctx.addIssue({
22
+ code: "custom",
23
+ message: `Field references unknown tab id "${field.tabId}"`,
24
+ path: ["fields", index, "tabId"],
25
+ });
26
+ }
27
+ }
28
+ }
29
+ // Same shape as DocumentTypeDefinitionSchema minus `id` — the server
30
+ // mints that. `defaultTemplateId` is deliberately absent even on the
31
+ // 'page' branch — it's only ever set afterward via the dedicated
32
+ // default-template endpoint, since a template can't exist before its
33
+ // document type does.
34
+ export const CreateDocumentTypeRequestSchema = z
35
+ .discriminatedUnion("kind", [
36
+ z
37
+ .object({
38
+ name: z.string().min(1),
39
+ icon: z.string().min(1),
40
+ kind: z.literal("page"),
41
+ fields: z.array(FieldDefinitionSchema),
42
+ treeRules: TreeRulesSchema,
43
+ tabs: z.array(TabDefinitionSchema).default([]),
44
+ })
45
+ .strict(),
46
+ z
47
+ .object({
48
+ name: z.string().min(1),
49
+ icon: z.string().min(1),
50
+ kind: z.literal("element"),
51
+ fields: z.array(FieldDefinitionSchema),
52
+ tabs: z.array(TabDefinitionSchema).default([]),
53
+ })
54
+ .strict(),
55
+ ])
56
+ .superRefine(validateFieldsAndTabs);
57
+ // PUT /api/document-types/:id — the mutable subset only. `kind` is
58
+ // immutable after creation (a payload carrying it fails .strict() — the
59
+ // intended behavior, not an accident) and `defaultTemplateId` stays with
60
+ // its dedicated pointer endpoint. `treeRules` is optional HERE because
61
+ // the schema can't know the stored kind; the route requires it for
62
+ // 'page' types and rejects it for 'element' types.
63
+ export const UpdateDocumentTypeRequestSchema = z
64
+ .object({
65
+ name: z.string().min(1),
66
+ icon: z.string().min(1),
67
+ fields: z.array(FieldDefinitionSchema),
68
+ tabs: z.array(TabDefinitionSchema).default([]),
69
+ treeRules: TreeRulesSchema.optional(),
70
+ })
71
+ .strict()
72
+ .superRefine(validateFieldsAndTabs);
73
+ export const CreateDocumentTypeResponseSchema = z.object({
74
+ documentType: DocumentTypeDefinitionSchema,
75
+ });
76
+ export const DocumentTypeListQuerySchema = z.object({
77
+ cursor: z.string().uuid().optional(),
78
+ limit: z.coerce.number().int().min(1).max(100).default(50),
79
+ });
80
+ export const DocumentTypeListResponseSchema = z.object({
81
+ items: z.array(DocumentTypeDefinitionSchema),
82
+ nextCursor: z.string().uuid().nullable(),
83
+ });
84
+ export const DeleteDocumentTypeResponseSchema = z.object({
85
+ success: z.literal(true),
86
+ });
@@ -0,0 +1,90 @@
1
+ import { z } from "zod";
2
+ export declare const FieldValidationSchema: z.ZodObject<{
3
+ required: z.ZodOptional<z.ZodBoolean>;
4
+ minLength: z.ZodOptional<z.ZodNumber>;
5
+ maxLength: z.ZodOptional<z.ZodNumber>;
6
+ min: z.ZodOptional<z.ZodNumber>;
7
+ max: z.ZodOptional<z.ZodNumber>;
8
+ pattern: z.ZodOptional<z.ZodString>;
9
+ }, z.core.$strict>;
10
+ export type FieldValidation = z.infer<typeof FieldValidationSchema>;
11
+ export declare const TabDefinitionSchema: z.ZodObject<{
12
+ id: z.ZodString;
13
+ name: z.ZodString;
14
+ }, z.core.$strict>;
15
+ export type TabDefinition = z.infer<typeof TabDefinitionSchema>;
16
+ export declare const FieldDefinitionSchema: z.ZodObject<{
17
+ id: z.ZodString;
18
+ name: z.ZodString;
19
+ datatypeId: z.ZodString;
20
+ validation: z.ZodOptional<z.ZodObject<{
21
+ required: z.ZodOptional<z.ZodBoolean>;
22
+ minLength: z.ZodOptional<z.ZodNumber>;
23
+ maxLength: z.ZodOptional<z.ZodNumber>;
24
+ min: z.ZodOptional<z.ZodNumber>;
25
+ max: z.ZodOptional<z.ZodNumber>;
26
+ pattern: z.ZodOptional<z.ZodString>;
27
+ }, z.core.$strict>>;
28
+ tabId: z.ZodOptional<z.ZodString>;
29
+ }, z.core.$strict>;
30
+ export type FieldDefinition = z.infer<typeof FieldDefinitionSchema>;
31
+ export declare const TreeRulesSchema: z.ZodObject<{
32
+ allowedAtRoot: z.ZodBoolean;
33
+ allowedParentTypes: z.ZodArray<z.ZodString>;
34
+ allowedChildTypes: z.ZodArray<z.ZodString>;
35
+ }, z.core.$strip>;
36
+ export type TreeRules = z.infer<typeof TreeRulesSchema>;
37
+ export declare const DocumentTypeDefinitionSchema: z.ZodDiscriminatedUnion<[z.ZodObject<{
38
+ id: z.ZodString;
39
+ name: z.ZodString;
40
+ icon: z.ZodString;
41
+ kind: z.ZodLiteral<"page">;
42
+ fields: z.ZodArray<z.ZodObject<{
43
+ id: z.ZodString;
44
+ name: z.ZodString;
45
+ datatypeId: z.ZodString;
46
+ validation: z.ZodOptional<z.ZodObject<{
47
+ required: z.ZodOptional<z.ZodBoolean>;
48
+ minLength: z.ZodOptional<z.ZodNumber>;
49
+ maxLength: z.ZodOptional<z.ZodNumber>;
50
+ min: z.ZodOptional<z.ZodNumber>;
51
+ max: z.ZodOptional<z.ZodNumber>;
52
+ pattern: z.ZodOptional<z.ZodString>;
53
+ }, z.core.$strict>>;
54
+ tabId: z.ZodOptional<z.ZodString>;
55
+ }, z.core.$strict>>;
56
+ treeRules: z.ZodObject<{
57
+ allowedAtRoot: z.ZodBoolean;
58
+ allowedParentTypes: z.ZodArray<z.ZodString>;
59
+ allowedChildTypes: z.ZodArray<z.ZodString>;
60
+ }, z.core.$strip>;
61
+ tabs: z.ZodDefault<z.ZodArray<z.ZodObject<{
62
+ id: z.ZodString;
63
+ name: z.ZodString;
64
+ }, z.core.$strict>>>;
65
+ defaultTemplateId: z.ZodOptional<z.ZodString>;
66
+ }, z.core.$strict>, z.ZodObject<{
67
+ id: z.ZodString;
68
+ name: z.ZodString;
69
+ icon: z.ZodString;
70
+ kind: z.ZodLiteral<"element">;
71
+ fields: z.ZodArray<z.ZodObject<{
72
+ id: z.ZodString;
73
+ name: z.ZodString;
74
+ datatypeId: z.ZodString;
75
+ validation: z.ZodOptional<z.ZodObject<{
76
+ required: z.ZodOptional<z.ZodBoolean>;
77
+ minLength: z.ZodOptional<z.ZodNumber>;
78
+ maxLength: z.ZodOptional<z.ZodNumber>;
79
+ min: z.ZodOptional<z.ZodNumber>;
80
+ max: z.ZodOptional<z.ZodNumber>;
81
+ pattern: z.ZodOptional<z.ZodString>;
82
+ }, z.core.$strict>>;
83
+ tabId: z.ZodOptional<z.ZodString>;
84
+ }, z.core.$strict>>;
85
+ tabs: z.ZodDefault<z.ZodArray<z.ZodObject<{
86
+ id: z.ZodString;
87
+ name: z.ZodString;
88
+ }, z.core.$strict>>>;
89
+ }, z.core.$strict>], "kind">;
90
+ export type DocumentTypeDefinition = z.infer<typeof DocumentTypeDefinitionSchema>;
@@ -0,0 +1,103 @@
1
+ import { z } from "zod";
2
+ // Basic, generic validation rules (Session 34) — required applies to any
3
+ // datatype; minLength/maxLength are meaningful for text-like datatypes,
4
+ // min/max for numeric ones. Not cross-checked against datatypeId here
5
+ // (same non-goal as datatypeId itself — the registry is a client-side
6
+ // concept); the builder UI only shows the fields relevant to the
7
+ // selected datatype.
8
+ export const FieldValidationSchema = z
9
+ .object({
10
+ required: z.boolean().optional(),
11
+ minLength: z.number().int().nonnegative().optional(),
12
+ maxLength: z.number().int().nonnegative().optional(),
13
+ min: z.number().optional(),
14
+ max: z.number().optional(),
15
+ // Regex source (no flags) the value must match, for text-like
16
+ // editors. Enforced client-side in the editor (Session 55 UI);
17
+ // server-side enforcement of all validation is Month 9 scope.
18
+ pattern: z.string().min(1).optional(),
19
+ })
20
+ .strict()
21
+ .refine((v) => v.minLength === undefined || v.maxLength === undefined || v.minLength <= v.maxLength, {
22
+ message: "minLength must be <= maxLength",
23
+ path: ["maxLength"],
24
+ })
25
+ .refine((v) => v.min === undefined || v.max === undefined || v.min <= v.max, {
26
+ message: "min must be <= max",
27
+ path: ["max"],
28
+ });
29
+ // A tab id is purely organizational — unlike FieldDefinition.id (a
30
+ // human-typed key that becomes a ContentVersion.data key), a tab id is
31
+ // never a data key, only ever referenced by FieldDefinition.tabId. Minted
32
+ // client-side (crypto.randomUUID()) the same way DocumentTypeDefinition.id
33
+ // itself is, so a uuid is the right shape here, not a regex-constrained key.
34
+ export const TabDefinitionSchema = z
35
+ .object({
36
+ id: z.string().uuid(),
37
+ name: z.string().min(1),
38
+ })
39
+ .strict();
40
+ // id is a stable key, not a UUID — it becomes the key in
41
+ // ContentVersion.data once the content editor exists (Sessions 35-37), so
42
+ // renaming a field's display name later never orphans existing content.
43
+ export const FieldDefinitionSchema = z
44
+ .object({
45
+ id: z.string().regex(/^[a-zA-Z][a-zA-Z0-9_]*$/),
46
+ name: z.string().min(1),
47
+ // References a DataTypeConfig.id (a named, configured Data Type —
48
+ // see data-type-config.schema.ts), NOT a registry editor id, as of
49
+ // Session 50. Deliberately NOT z.string().uuid(): this schema also
50
+ // serializes READS, and pre-Session-50 rows hold registry editor ids
51
+ // ('com.velora.text') that must stay readable (the admin resolver has
52
+ // a legacy fallback for them). Create-time integrity doesn't need the
53
+ // uuid check either — the route rejects any id with no data_types row,
54
+ // which a registry id never has.
55
+ datatypeId: z.string().min(1),
56
+ validation: FieldValidationSchema.optional(),
57
+ // References a TabDefinition.id declared in this same document type's
58
+ // `tabs` array. Optional — a field with no tabId renders in the
59
+ // implicit default tab. Not cross-validated here (same non-goal as
60
+ // datatypeId); the create-request schema below validates it instead.
61
+ tabId: z.string().uuid().optional(),
62
+ })
63
+ .strict();
64
+ export const TreeRulesSchema = z.object({
65
+ allowedAtRoot: z.boolean(),
66
+ // Empty array = any page type allowed, per the Document Types section.
67
+ allowedParentTypes: z.array(z.string()),
68
+ allowedChildTypes: z.array(z.string()),
69
+ });
70
+ // .strict() on both branches: an 'element' payload carrying treeRules is
71
+ // a clear validation error, not silently stripped — treeRules genuinely
72
+ // doesn't apply to element kind, not just hidden in the UI. `tabs` is
73
+ // symmetric on both branches (an 'element' type can have just as many
74
+ // fields as a 'page' type); `defaultTemplateId` stays 'page'-only since
75
+ // rendering/templates are genuinely tied to tree placement, same reasoning
76
+ // as treeRules.
77
+ export const DocumentTypeDefinitionSchema = z.discriminatedUnion("kind", [
78
+ z
79
+ .object({
80
+ id: z.string().uuid(),
81
+ name: z.string().min(1),
82
+ icon: z.string().min(1),
83
+ kind: z.literal("page"),
84
+ fields: z.array(FieldDefinitionSchema),
85
+ treeRules: TreeRulesSchema,
86
+ tabs: z.array(TabDefinitionSchema).default([]),
87
+ // Set via a dedicated pointer-update endpoint, never at create time —
88
+ // a template can't exist before its document type does. Presence/
89
+ // absence only gates future rendering, never tree placement.
90
+ defaultTemplateId: z.string().uuid().optional(),
91
+ })
92
+ .strict(),
93
+ z
94
+ .object({
95
+ id: z.string().uuid(),
96
+ name: z.string().min(1),
97
+ icon: z.string().min(1),
98
+ kind: z.literal("element"),
99
+ fields: z.array(FieldDefinitionSchema),
100
+ tabs: z.array(TabDefinitionSchema).default([]),
101
+ })
102
+ .strict(),
103
+ ]);
@@ -0,0 +1,6 @@
1
+ import { z } from "zod";
2
+ export declare const HealthCheckSchema: z.ZodObject<{
3
+ status: z.ZodLiteral<"ok">;
4
+ timestamp: z.ZodString;
5
+ }, z.core.$strip>;
6
+ export type HealthCheck = z.infer<typeof HealthCheckSchema>;
@@ -0,0 +1,5 @@
1
+ import { z } from "zod";
2
+ export const HealthCheckSchema = z.object({
3
+ status: z.literal("ok"),
4
+ timestamp: z.string().datetime(),
5
+ });
@@ -0,0 +1,54 @@
1
+ export { ContentNodeSchema } from "./content.schema.js";
2
+ export type { ContentNode } from "./content.schema.js";
3
+ export { ContentVersionSchema } from "./content-version.schema.js";
4
+ export type { ContentVersion } from "./content-version.schema.js";
5
+ export { SnapshotSchema, SnapshotItemSchema, SnapshotMetaSchema } from "./snapshot.schema.js";
6
+ export type { Snapshot, SnapshotItem, SnapshotMeta } from "./snapshot.schema.js";
7
+ export { ApiErrorSchema } from "./api-error.schema.js";
8
+ export type { ApiError } from "./api-error.schema.js";
9
+ export { BundledTemplateSchema, SetupStatusResponseSchema, SetupStarterSelectionSchema, SetupStarterResultSchema, SetupCompleteRequestSchema, SetupCompleteResponseSchema, } from "./setup-api.schema.js";
10
+ export type { BundledTemplate, SetupStatusResponse, SetupStarterSelection, SetupStarterResult, SetupCompleteRequest, SetupCompleteResponse, } from "./setup-api.schema.js";
11
+ export { CreateContentRequestSchema, ContentItemQuerySchema, ContentItemResponseSchema, ContentByPathQuerySchema, ContentByPathResponseSchema, SaveContentRequestSchema, SaveContentResponseSchema, LatestVersionResponseSchema, ContentVersionMetaSchema, VersionListQuerySchema, VersionListResponseSchema, PublishContentRequestSchema, PublishContentResponseSchema, PreviewTokenResponseSchema, ContentChildrenQuerySchema, ContentChildrenResponseSchema, ReorderNodesRequestSchema, ReorderNodesResponseSchema, FieldValidationFailureSchema, ContentValidationErrorSchema, } from "./content-api.schema.js";
12
+ export type { CreateContentRequest, ContentItemQuery, ContentItemResponse, ContentByPathQuery, ContentByPathResponse, SaveContentRequest, SaveContentResponse, LatestVersionResponse, ContentVersionMeta, VersionListQuery, VersionListResponse, PublishContentRequest, PublishContentResponse, PreviewTokenResponse, ContentChildrenQuery, ContentChildrenResponse, ReorderNodesRequest, ReorderNodesResponse, FieldValidationFailureResponse, ContentValidationErrorResponse, } from "./content-api.schema.js";
13
+ export { FieldValidationSchema, FieldDefinitionSchema, TabDefinitionSchema, TreeRulesSchema, DocumentTypeDefinitionSchema, } from "./document-type.schema.js";
14
+ export type { FieldValidation, FieldDefinition, TabDefinition, TreeRules, DocumentTypeDefinition, } from "./document-type.schema.js";
15
+ export { CreateDocumentTypeRequestSchema, UpdateDocumentTypeRequestSchema, CreateDocumentTypeResponseSchema, DocumentTypeListQuerySchema, DocumentTypeListResponseSchema, DeleteDocumentTypeResponseSchema, } from "./document-type-api.schema.js";
16
+ export type { CreateDocumentTypeRequest, UpdateDocumentTypeRequest, CreateDocumentTypeResponse, DocumentTypeListQuery, DocumentTypeListResponse, DeleteDocumentTypeResponse, } from "./document-type-api.schema.js";
17
+ export { TemplateDefinitionSchema } from "./template.schema.js";
18
+ export type { TemplateDefinition } from "./template.schema.js";
19
+ export { CreateTemplateRequestSchema, CreateTemplateResponseSchema, TemplateListQuerySchema, TemplateListResponseSchema, SetDefaultTemplateRequestSchema, } from "./template-api.schema.js";
20
+ export type { CreateTemplateRequest, CreateTemplateResponse, TemplateListQuery, TemplateListResponse, SetDefaultTemplateRequest, } from "./template-api.schema.js";
21
+ export { MediaFileSchema } from "./media.schema.js";
22
+ export type { MediaFile } from "./media.schema.js";
23
+ export { MediaFileResponseSchema, MediaDeleteResponseSchema, MediaListQuerySchema, MediaListResponseSchema, } from "./media-api.schema.js";
24
+ export type { MediaFileResponse, MediaDeleteResponse, MediaListQuery, MediaListResponse, } from "./media-api.schema.js";
25
+ export { HealthCheckSchema } from "./health.schema.js";
26
+ export type { HealthCheck } from "./health.schema.js";
27
+ export { LoginRequestSchema, LoginResponseSchema, RefreshResponseSchema, LogoutResponseSchema, AuthErrorSchema, } from "./auth.schema.js";
28
+ export type { LoginRequest, LoginResponse, RefreshResponse, LogoutResponse, AuthError, } from "./auth.schema.js";
29
+ export { UserRoleSchema, UserSummarySchema, UserListQuerySchema, UserListResponseSchema, CreateUserRequestSchema, CreateUserResponseSchema, UpdateUserRoleRequestSchema, UpdateUserRoleResponseSchema, } from "./user-api.schema.js";
30
+ export type { UserRole, UserSummary, UserListQuery, UserListResponse, CreateUserRequest, CreateUserResponse, UpdateUserRoleRequest, UpdateUserRoleResponse, } from "./user-api.schema.js";
31
+ export { CreateSnapshotRequestSchema, SnapshotResponseSchema, SnapshotListQuerySchema, SnapshotListResponseSchema, RestoreSnapshotResponseSchema, } from "./snapshot-api.schema.js";
32
+ export type { CreateSnapshotRequest, SnapshotResponse, SnapshotListQuery, SnapshotListResponse, RestoreSnapshotResponse, } from "./snapshot-api.schema.js";
33
+ export { DataTypeConfigSchema, BUILT_IN_DATA_TYPE_CONFIGS } from "./data-type-config.schema.js";
34
+ export type { DataTypeConfig } from "./data-type-config.schema.js";
35
+ export { CreateDataTypeRequestSchema, UpdateDataTypeRequestSchema, DataTypeResponseSchema, DataTypeListQuerySchema, DataTypeListResponseSchema, } from "./data-type-api.schema.js";
36
+ export type { CreateDataTypeRequest, UpdateDataTypeRequest, DataTypeResponse, DataTypeListQuery, DataTypeListResponse, } from "./data-type-api.schema.js";
37
+ export { PluginStorageParamsSchema, SetPluginFieldValueRequestSchema, PluginFieldValueResponseSchema, } from "./plugin-storage-api.schema.js";
38
+ export type { PluginStorageParams, SetPluginFieldValueRequest, PluginFieldValueResponse, } from "./plugin-storage-api.schema.js";
39
+ export { PluginSchema, PluginListQuerySchema, PluginListResponseSchema } from "./plugin-registry-api.schema.js";
40
+ export type { Plugin, PluginListQuery, PluginListResponse } from "./plugin-registry-api.schema.js";
41
+ export { ManagedPluginSchema, ManagedPluginListQuerySchema, ManagedPluginListResponseSchema, PluginIdParamsSchema, UninstallPluginBodySchema, UninstallConfirmationRequiredSchema, BundleUninstallConfirmationRequiredSchema, UninstallSucceededSchema, BundleUninstallSucceededSchema, LicenseRecheckResponseSchema, SnapshotGroupSchema, SnapshotGroupListQuerySchema, SnapshotGroupListResponseSchema, RestorePlanEntrySchema, RestoreConfirmationRequiredSchema, RestoreSucceededSchema, RestoreBodySchema, } from "./plugin-management-api.schema.js";
42
+ export type { ManagedPlugin, UninstallSucceeded, BundleUninstallSucceeded, LicenseRecheckResponse, SnapshotGroup, SnapshotGroupListResponse, RestorePlanEntry, RestoreConfirmationRequired, RestoreSucceeded, } from "./plugin-management-api.schema.js";
43
+ export { PublicContentItemSchema, PublicContentItemQuerySchema, PublicContentByPathQuerySchema, PublicContentListQuerySchema, PublicContentNodeSummarySchema, PublicContentListResponseSchema, PublicContentSearchQuerySchema, PublicContentExtensionsSchema, PublicContentFormatResponseSchema, PublicMediaFileSchema, PublicMediaListQuerySchema, PublicMediaListResponseSchema, PublicFieldDefinitionSchema, PublicDocumentTypeSchema, PublicDocumentTypeListQuerySchema, PublicDocumentTypeListResponseSchema, PublicTemplateSchema, PublicTemplateListQuerySchema, PublicTemplateListResponseSchema, PublicContentWriteResponseSchema, PublicCreateContentRequestSchema, PublicUpdateContentRequestSchema, } from "./public-api.schema.js";
44
+ export type { PublicContentItem, PublicContentItemQuery, PublicContentByPathQuery, PublicContentListQuery, PublicContentNodeSummary, PublicContentListResponse, PublicContentSearchQuery, PublicContentFormatResponse, PublicMediaFile, PublicMediaListQuery, PublicMediaListResponse, PublicFieldDefinition, PublicDocumentType, PublicDocumentTypeListQuery, PublicDocumentTypeListResponse, PublicTemplate, PublicTemplateListQuery, PublicTemplateListResponse, PublicContentWriteResponse, PublicCreateContentRequest, PublicUpdateContentRequest, } from "./public-api.schema.js";
45
+ export { MarketplaceListingVersionSchema, MarketplaceListingSchema, MarketplaceStarterSchema, MarketplaceDocumentTypeSummarySchema, MarketplaceBundleMemberSchema, MarketplaceListingDetailVersionSchema, MarketplaceListingDetailSchema, MarketplaceListQuerySchema, MarketplaceListResponseSchema, MarketplacePluginIdParamsSchema, MarketplaceInstallBodySchema, MarketplaceInstallMemberSchema, MarketplaceInstallResponseSchema, } from "./marketplace-listing-api.schema.js";
46
+ export type { MarketplaceListing, MarketplaceStarter, MarketplaceDocumentTypeSummary, MarketplaceBundleMember, MarketplaceListingDetailVersion, MarketplaceListingDetail, MarketplaceInstallMember, MarketplaceInstallResponse, } from "./marketplace-listing-api.schema.js";
47
+ export { ApiKeySummarySchema, ApiKeyListQuerySchema, ApiKeyListResponseSchema, CreateApiKeyRequestSchema, CreateApiKeyResponseSchema, RevokeApiKeyResponseSchema, } from "./api-key-api.schema.js";
48
+ export type { ApiKeySummary, ApiKeyListQuery, ApiKeyListResponse, CreateApiKeyRequest, CreateApiKeyResponse, RevokeApiKeyResponse, } from "./api-key-api.schema.js";
49
+ export { ThemeListItemSchema, ThemeListResponseSchema } from "./theme-api.schema.js";
50
+ export type { ThemeListItem, ThemeListResponse } from "./theme-api.schema.js";
51
+ export { ContentTrashBodySchema, ContentTrashConfirmationSchema, ContentTrashResultSchema, ContentRestoreResultSchema, } from "./content-trash-api.schema.js";
52
+ export type { ContentTrashBody, ContentTrashConfirmation, ContentTrashResult, ContentRestoreResult, } from "./content-trash-api.schema.js";
53
+ export { ContentTrashListQuerySchema, TrashedSubtreeSchema, ContentTrashListResponseSchema, ContentRestoreBlockedSchema, } from "./content-trash.schema.js";
54
+ export type { ContentTrashListResponse, TrashedSubtreeDto, ContentRestoreBlocked, } from "./content-trash.schema.js";
package/dist/index.js ADDED
@@ -0,0 +1,27 @@
1
+ export { ContentNodeSchema } from "./content.schema.js";
2
+ export { ContentVersionSchema } from "./content-version.schema.js";
3
+ export { SnapshotSchema, SnapshotItemSchema, SnapshotMetaSchema } from "./snapshot.schema.js";
4
+ export { ApiErrorSchema } from "./api-error.schema.js";
5
+ export { BundledTemplateSchema, SetupStatusResponseSchema, SetupStarterSelectionSchema, SetupStarterResultSchema, SetupCompleteRequestSchema, SetupCompleteResponseSchema, } from "./setup-api.schema.js";
6
+ export { CreateContentRequestSchema, ContentItemQuerySchema, ContentItemResponseSchema, ContentByPathQuerySchema, ContentByPathResponseSchema, SaveContentRequestSchema, SaveContentResponseSchema, LatestVersionResponseSchema, ContentVersionMetaSchema, VersionListQuerySchema, VersionListResponseSchema, PublishContentRequestSchema, PublishContentResponseSchema, PreviewTokenResponseSchema, ContentChildrenQuerySchema, ContentChildrenResponseSchema, ReorderNodesRequestSchema, ReorderNodesResponseSchema, FieldValidationFailureSchema, ContentValidationErrorSchema, } from "./content-api.schema.js";
7
+ export { FieldValidationSchema, FieldDefinitionSchema, TabDefinitionSchema, TreeRulesSchema, DocumentTypeDefinitionSchema, } from "./document-type.schema.js";
8
+ export { CreateDocumentTypeRequestSchema, UpdateDocumentTypeRequestSchema, CreateDocumentTypeResponseSchema, DocumentTypeListQuerySchema, DocumentTypeListResponseSchema, DeleteDocumentTypeResponseSchema, } from "./document-type-api.schema.js";
9
+ export { TemplateDefinitionSchema } from "./template.schema.js";
10
+ export { CreateTemplateRequestSchema, CreateTemplateResponseSchema, TemplateListQuerySchema, TemplateListResponseSchema, SetDefaultTemplateRequestSchema, } from "./template-api.schema.js";
11
+ export { MediaFileSchema } from "./media.schema.js";
12
+ export { MediaFileResponseSchema, MediaDeleteResponseSchema, MediaListQuerySchema, MediaListResponseSchema, } from "./media-api.schema.js";
13
+ export { HealthCheckSchema } from "./health.schema.js";
14
+ export { LoginRequestSchema, LoginResponseSchema, RefreshResponseSchema, LogoutResponseSchema, AuthErrorSchema, } from "./auth.schema.js";
15
+ export { UserRoleSchema, UserSummarySchema, UserListQuerySchema, UserListResponseSchema, CreateUserRequestSchema, CreateUserResponseSchema, UpdateUserRoleRequestSchema, UpdateUserRoleResponseSchema, } from "./user-api.schema.js";
16
+ export { CreateSnapshotRequestSchema, SnapshotResponseSchema, SnapshotListQuerySchema, SnapshotListResponseSchema, RestoreSnapshotResponseSchema, } from "./snapshot-api.schema.js";
17
+ export { DataTypeConfigSchema, BUILT_IN_DATA_TYPE_CONFIGS } from "./data-type-config.schema.js";
18
+ export { CreateDataTypeRequestSchema, UpdateDataTypeRequestSchema, DataTypeResponseSchema, DataTypeListQuerySchema, DataTypeListResponseSchema, } from "./data-type-api.schema.js";
19
+ export { PluginStorageParamsSchema, SetPluginFieldValueRequestSchema, PluginFieldValueResponseSchema, } from "./plugin-storage-api.schema.js";
20
+ export { PluginSchema, PluginListQuerySchema, PluginListResponseSchema } from "./plugin-registry-api.schema.js";
21
+ export { ManagedPluginSchema, ManagedPluginListQuerySchema, ManagedPluginListResponseSchema, PluginIdParamsSchema, UninstallPluginBodySchema, UninstallConfirmationRequiredSchema, BundleUninstallConfirmationRequiredSchema, UninstallSucceededSchema, BundleUninstallSucceededSchema, LicenseRecheckResponseSchema, SnapshotGroupSchema, SnapshotGroupListQuerySchema, SnapshotGroupListResponseSchema, RestorePlanEntrySchema, RestoreConfirmationRequiredSchema, RestoreSucceededSchema, RestoreBodySchema, } from "./plugin-management-api.schema.js";
22
+ export { PublicContentItemSchema, PublicContentItemQuerySchema, PublicContentByPathQuerySchema, PublicContentListQuerySchema, PublicContentNodeSummarySchema, PublicContentListResponseSchema, PublicContentSearchQuerySchema, PublicContentExtensionsSchema, PublicContentFormatResponseSchema, PublicMediaFileSchema, PublicMediaListQuerySchema, PublicMediaListResponseSchema, PublicFieldDefinitionSchema, PublicDocumentTypeSchema, PublicDocumentTypeListQuerySchema, PublicDocumentTypeListResponseSchema, PublicTemplateSchema, PublicTemplateListQuerySchema, PublicTemplateListResponseSchema, PublicContentWriteResponseSchema, PublicCreateContentRequestSchema, PublicUpdateContentRequestSchema, } from "./public-api.schema.js";
23
+ export { MarketplaceListingVersionSchema, MarketplaceListingSchema, MarketplaceStarterSchema, MarketplaceDocumentTypeSummarySchema, MarketplaceBundleMemberSchema, MarketplaceListingDetailVersionSchema, MarketplaceListingDetailSchema, MarketplaceListQuerySchema, MarketplaceListResponseSchema, MarketplacePluginIdParamsSchema, MarketplaceInstallBodySchema, MarketplaceInstallMemberSchema, MarketplaceInstallResponseSchema, } from "./marketplace-listing-api.schema.js";
24
+ export { ApiKeySummarySchema, ApiKeyListQuerySchema, ApiKeyListResponseSchema, CreateApiKeyRequestSchema, CreateApiKeyResponseSchema, RevokeApiKeyResponseSchema, } from "./api-key-api.schema.js";
25
+ export { ThemeListItemSchema, ThemeListResponseSchema } from "./theme-api.schema.js";
26
+ export { ContentTrashBodySchema, ContentTrashConfirmationSchema, ContentTrashResultSchema, ContentRestoreResultSchema, } from "./content-trash-api.schema.js";
27
+ export { ContentTrashListQuerySchema, TrashedSubtreeSchema, ContentTrashListResponseSchema, ContentRestoreBlockedSchema, } from "./content-trash.schema.js";
@@ -0,0 +1,205 @@
1
+ import { z } from "zod";
2
+ export declare const MarketplaceListingVersionSchema: z.ZodObject<{
3
+ version: z.ZodString;
4
+ supportedDialects: z.ZodArray<z.ZodString>;
5
+ permissions: z.ZodRecord<z.ZodString, z.ZodBoolean>;
6
+ license: z.ZodString;
7
+ cmsVersion: z.ZodString;
8
+ verified: z.ZodBoolean;
9
+ createdAt: z.ZodString;
10
+ }, z.core.$strip>;
11
+ export declare const MarketplaceListingSchema: z.ZodObject<{
12
+ pluginId: z.ZodString;
13
+ name: z.ZodString;
14
+ type: z.ZodString;
15
+ description: z.ZodString;
16
+ author: z.ZodString;
17
+ priceCents: z.ZodNumber;
18
+ coverImagePath: z.ZodNullable<z.ZodString>;
19
+ latestVersion: z.ZodNullable<z.ZodObject<{
20
+ version: z.ZodString;
21
+ supportedDialects: z.ZodArray<z.ZodString>;
22
+ permissions: z.ZodRecord<z.ZodString, z.ZodBoolean>;
23
+ license: z.ZodString;
24
+ cmsVersion: z.ZodString;
25
+ verified: z.ZodBoolean;
26
+ createdAt: z.ZodString;
27
+ }, z.core.$strip>>;
28
+ compatible: z.ZodBoolean;
29
+ }, z.core.$strip>;
30
+ export type MarketplaceListing = z.infer<typeof MarketplaceListingSchema>;
31
+ export declare const MarketplaceStarterSchema: z.ZodObject<{
32
+ name: z.ZodString;
33
+ description: z.ZodNullable<z.ZodString>;
34
+ repository: z.ZodNullable<z.ZodString>;
35
+ hasArchive: z.ZodBoolean;
36
+ }, z.core.$strip>;
37
+ export type MarketplaceStarter = z.infer<typeof MarketplaceStarterSchema>;
38
+ export declare const MarketplaceDocumentTypeSummarySchema: z.ZodObject<{
39
+ name: z.ZodString;
40
+ fields: z.ZodArray<z.ZodString>;
41
+ }, z.core.$strip>;
42
+ export type MarketplaceDocumentTypeSummary = z.infer<typeof MarketplaceDocumentTypeSummarySchema>;
43
+ export declare const MarketplaceBundleMemberSchema: z.ZodObject<{
44
+ pluginId: z.ZodString;
45
+ name: z.ZodString;
46
+ description: z.ZodNullable<z.ZodString>;
47
+ type: z.ZodString;
48
+ priceCents: z.ZodNumber;
49
+ }, z.core.$strip>;
50
+ export type MarketplaceBundleMember = z.infer<typeof MarketplaceBundleMemberSchema>;
51
+ export declare const MarketplaceListingDetailVersionSchema: z.ZodObject<{
52
+ version: z.ZodString;
53
+ supportedDialects: z.ZodArray<z.ZodString>;
54
+ permissions: z.ZodRecord<z.ZodString, z.ZodBoolean>;
55
+ license: z.ZodString;
56
+ cmsVersion: z.ZodString;
57
+ verified: z.ZodBoolean;
58
+ createdAt: z.ZodString;
59
+ starter: z.ZodOptional<z.ZodNullable<z.ZodObject<{
60
+ name: z.ZodString;
61
+ description: z.ZodNullable<z.ZodString>;
62
+ repository: z.ZodNullable<z.ZodString>;
63
+ hasArchive: z.ZodBoolean;
64
+ }, z.core.$strip>>>;
65
+ documentTypesSummary: z.ZodOptional<z.ZodNullable<z.ZodArray<z.ZodObject<{
66
+ name: z.ZodString;
67
+ fields: z.ZodArray<z.ZodString>;
68
+ }, z.core.$strip>>>>;
69
+ bundledMembers: z.ZodOptional<z.ZodNullable<z.ZodArray<z.ZodObject<{
70
+ pluginId: z.ZodString;
71
+ name: z.ZodString;
72
+ description: z.ZodNullable<z.ZodString>;
73
+ type: z.ZodString;
74
+ priceCents: z.ZodNumber;
75
+ }, z.core.$strip>>>>;
76
+ }, z.core.$strip>;
77
+ export type MarketplaceListingDetailVersion = z.infer<typeof MarketplaceListingDetailVersionSchema>;
78
+ export declare const MarketplaceListingDetailSchema: z.ZodObject<{
79
+ pluginId: z.ZodString;
80
+ name: z.ZodString;
81
+ type: z.ZodString;
82
+ description: z.ZodString;
83
+ author: z.ZodString;
84
+ priceCents: z.ZodNumber;
85
+ coverImagePath: z.ZodNullable<z.ZodString>;
86
+ compatible: z.ZodBoolean;
87
+ latestVersion: z.ZodNullable<z.ZodObject<{
88
+ version: z.ZodString;
89
+ supportedDialects: z.ZodArray<z.ZodString>;
90
+ permissions: z.ZodRecord<z.ZodString, z.ZodBoolean>;
91
+ license: z.ZodString;
92
+ cmsVersion: z.ZodString;
93
+ verified: z.ZodBoolean;
94
+ createdAt: z.ZodString;
95
+ starter: z.ZodOptional<z.ZodNullable<z.ZodObject<{
96
+ name: z.ZodString;
97
+ description: z.ZodNullable<z.ZodString>;
98
+ repository: z.ZodNullable<z.ZodString>;
99
+ hasArchive: z.ZodBoolean;
100
+ }, z.core.$strip>>>;
101
+ documentTypesSummary: z.ZodOptional<z.ZodNullable<z.ZodArray<z.ZodObject<{
102
+ name: z.ZodString;
103
+ fields: z.ZodArray<z.ZodString>;
104
+ }, z.core.$strip>>>>;
105
+ bundledMembers: z.ZodOptional<z.ZodNullable<z.ZodArray<z.ZodObject<{
106
+ pluginId: z.ZodString;
107
+ name: z.ZodString;
108
+ description: z.ZodNullable<z.ZodString>;
109
+ type: z.ZodString;
110
+ priceCents: z.ZodNumber;
111
+ }, z.core.$strip>>>>;
112
+ }, z.core.$strip>>;
113
+ versions: z.ZodArray<z.ZodObject<{
114
+ version: z.ZodString;
115
+ supportedDialects: z.ZodArray<z.ZodString>;
116
+ permissions: z.ZodRecord<z.ZodString, z.ZodBoolean>;
117
+ license: z.ZodString;
118
+ cmsVersion: z.ZodString;
119
+ verified: z.ZodBoolean;
120
+ createdAt: z.ZodString;
121
+ starter: z.ZodOptional<z.ZodNullable<z.ZodObject<{
122
+ name: z.ZodString;
123
+ description: z.ZodNullable<z.ZodString>;
124
+ repository: z.ZodNullable<z.ZodString>;
125
+ hasArchive: z.ZodBoolean;
126
+ }, z.core.$strip>>>;
127
+ documentTypesSummary: z.ZodOptional<z.ZodNullable<z.ZodArray<z.ZodObject<{
128
+ name: z.ZodString;
129
+ fields: z.ZodArray<z.ZodString>;
130
+ }, z.core.$strip>>>>;
131
+ bundledMembers: z.ZodOptional<z.ZodNullable<z.ZodArray<z.ZodObject<{
132
+ pluginId: z.ZodString;
133
+ name: z.ZodString;
134
+ description: z.ZodNullable<z.ZodString>;
135
+ type: z.ZodString;
136
+ priceCents: z.ZodNumber;
137
+ }, z.core.$strip>>>>;
138
+ }, z.core.$strip>>;
139
+ activeDialect: z.ZodString;
140
+ marketplaceBaseUrl: z.ZodString;
141
+ }, z.core.$strip>;
142
+ export type MarketplaceListingDetail = z.infer<typeof MarketplaceListingDetailSchema>;
143
+ export declare const MarketplaceListQuerySchema: z.ZodObject<{
144
+ q: z.ZodOptional<z.ZodString>;
145
+ type: z.ZodOptional<z.ZodString>;
146
+ db: z.ZodOptional<z.ZodString>;
147
+ cursor: z.ZodOptional<z.ZodString>;
148
+ limit: z.ZodDefault<z.ZodCoercedNumber<unknown>>;
149
+ }, z.core.$strip>;
150
+ export declare const MarketplaceListResponseSchema: z.ZodObject<{
151
+ items: z.ZodArray<z.ZodObject<{
152
+ pluginId: z.ZodString;
153
+ name: z.ZodString;
154
+ type: z.ZodString;
155
+ description: z.ZodString;
156
+ author: z.ZodString;
157
+ priceCents: z.ZodNumber;
158
+ coverImagePath: z.ZodNullable<z.ZodString>;
159
+ latestVersion: z.ZodNullable<z.ZodObject<{
160
+ version: z.ZodString;
161
+ supportedDialects: z.ZodArray<z.ZodString>;
162
+ permissions: z.ZodRecord<z.ZodString, z.ZodBoolean>;
163
+ license: z.ZodString;
164
+ cmsVersion: z.ZodString;
165
+ verified: z.ZodBoolean;
166
+ createdAt: z.ZodString;
167
+ }, z.core.$strip>>;
168
+ compatible: z.ZodBoolean;
169
+ }, z.core.$strip>>;
170
+ nextCursor: z.ZodNullable<z.ZodString>;
171
+ activeDialect: z.ZodString;
172
+ marketplaceBaseUrl: z.ZodString;
173
+ }, z.core.$strip>;
174
+ export declare const MarketplacePluginIdParamsSchema: z.ZodObject<{
175
+ pluginId: z.ZodString;
176
+ }, z.core.$strip>;
177
+ export declare const MarketplaceInstallBodySchema: z.ZodObject<{
178
+ pluginId: z.ZodString;
179
+ version: z.ZodString;
180
+ licenseKey: z.ZodOptional<z.ZodString>;
181
+ }, z.core.$strip>;
182
+ export declare const MarketplaceInstallMemberSchema: z.ZodObject<{
183
+ pluginId: z.ZodString;
184
+ version: z.ZodString;
185
+ outcome: z.ZodEnum<{
186
+ installed: "installed";
187
+ "already-installed": "already-installed";
188
+ }>;
189
+ }, z.core.$strip>;
190
+ export type MarketplaceInstallMember = z.infer<typeof MarketplaceInstallMemberSchema>;
191
+ export declare const MarketplaceInstallResponseSchema: z.ZodObject<{
192
+ pluginId: z.ZodString;
193
+ version: z.ZodString;
194
+ trustTier: z.ZodLiteral<"verified">;
195
+ licensed: z.ZodBoolean;
196
+ members: z.ZodOptional<z.ZodArray<z.ZodObject<{
197
+ pluginId: z.ZodString;
198
+ version: z.ZodString;
199
+ outcome: z.ZodEnum<{
200
+ installed: "installed";
201
+ "already-installed": "already-installed";
202
+ }>;
203
+ }, z.core.$strip>>>;
204
+ }, z.core.$strip>;
205
+ export type MarketplaceInstallResponse = z.infer<typeof MarketplaceInstallResponseSchema>;