@cloudcannon/configuration-types 0.0.37 → 0.0.38
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/dist/cloudcannon-config.latest.schema.json +9352 -10957
- package/dist/cloudcannon-config.legacy-eleventy.schema.json +9476 -11075
- package/dist/cloudcannon-config.legacy-hugo.schema.json +9424 -11028
- package/dist/cloudcannon-config.legacy-jekyll.schema.json +9476 -11075
- package/dist/cloudcannon-config.legacy-reader.schema.json +5882 -7489
- package/package.json +19 -21
- package/src/build-coupled.ts +295 -0
- package/src/cascade.ts +38 -0
- package/src/configuration.ts +421 -0
- package/src/documentation.ts +22 -0
- package/src/editables.ts +243 -0
- package/src/icon.ts +3597 -0
- package/src/image-options.ts +72 -0
- package/src/index.ts +40 -0
- package/src/inputs.ts +993 -0
- package/src/markdown.ts +97 -0
- package/src/mimetype.ts +445 -0
- package/src/paths.ts +43 -0
- package/src/preview.ts +125 -0
- package/src/select-values.ts +26 -0
- package/src/snippets.ts +113 -0
- package/src/source-editor.ts +68 -0
- package/src/structures.ts +120 -0
- package/src/syntax.ts +183 -0
- package/src/timezone.ts +607 -0
- package/src/build-coupled.d.ts +0 -315
- package/src/cascade.d.ts +0 -37
- package/src/cloudcannon-config.schema.json +0 -79
- package/src/configuration.d.ts +0 -750
- package/src/documentation.d.ts +0 -18
- package/src/editables.d.ts +0 -252
- package/src/icon.d.ts +0 -3585
- package/src/image-resizeable.d.ts +0 -65
- package/src/index.d.ts +0 -36
- package/src/inputs.d.ts +0 -1647
- package/src/javascript-api.d.ts +0 -204
- package/src/markdown.d.ts +0 -103
- package/src/paths.d.ts +0 -44
- package/src/preview.d.ts +0 -110
- package/src/select-values.d.ts +0 -6
- package/src/snippets.d.ts +0 -227
- package/src/source-editor.d.ts +0 -92
- package/src/structures.d.ts +0 -113
- package/src/timezone.d.ts +0 -596
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@cloudcannon/configuration-types",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.38",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"description": "Contains TypeScript declarations and generates JSONSchema files for the CloudCannon configuration file.",
|
|
6
6
|
"author": "CloudCannon <support@cloudcannon.com>",
|
|
@@ -19,24 +19,22 @@
|
|
|
19
19
|
"email": "support@cloudcannon.com"
|
|
20
20
|
},
|
|
21
21
|
"scripts": {
|
|
22
|
-
"prebuild": "
|
|
23
|
-
"build": "
|
|
24
|
-
"build:combined": "cp
|
|
25
|
-
"build:latest": "ts-json-schema-generator --markdown-description --no-top-ref --path src/index.d.ts --type Configuration --out dist/cloudcannon-config.latest.schema.json --id 'https://github.com/cloudcannon/configuration-types/releases/latest/download/cloudcannon-config.latest.schema.json'",
|
|
26
|
-
"build:legacy-jekyll": "ts-json-schema-generator --markdown-description --no-top-ref --path src/build-coupled.d.ts --type JekyllConfiguration --out dist/cloudcannon-config.legacy-jekyll.schema.json --id 'https://github.com/cloudcannon/configuration-types/releases/latest/download/cloudcannon-config.legacy-jekyll.schema.json'",
|
|
27
|
-
"build:legacy-hugo": "ts-json-schema-generator --markdown-description --no-top-ref --path src/build-coupled.d.ts --type HugoConfiguration --out dist/cloudcannon-config.legacy-hugo.schema.json --id 'https://github.com/cloudcannon/configuration-types/releases/latest/download/cloudcannon-config.legacy-hugo.schema.json'",
|
|
28
|
-
"build:legacy-eleventy": "ts-json-schema-generator --markdown-description --no-top-ref --path src/build-coupled.d.ts --type EleventyConfiguration --out dist/cloudcannon-config.legacy-eleventy.schema.json --id 'https://github.com/cloudcannon/configuration-types/releases/latest/download/cloudcannon-config.legacy-eleventy.schema.json'",
|
|
29
|
-
"build:legacy-reader": "ts-json-schema-generator --markdown-description --no-top-ref --path src/build-coupled.d.ts --type ReaderConfiguration --out dist/cloudcannon-config.legacy-reader.schema.json --id 'https://github.com/cloudcannon/configuration-types/releases/latest/download/cloudcannon-config.legacy-reader.schema.json'",
|
|
22
|
+
"prebuild": "rm -rf dist && mkdir -p dist",
|
|
23
|
+
"build": "tsx generate-schemas.ts && npm run build:combined",
|
|
24
|
+
"build:combined": "cp cloudcannon-config.schema.json dist/cloudcannon-config.schema.json",
|
|
30
25
|
"lint": "npm run lint:tsc && npm run lint:format",
|
|
31
26
|
"lint:tsc": "tsc --noEmit",
|
|
32
|
-
"lint:format": "
|
|
33
|
-
"
|
|
27
|
+
"lint:format": "biome check --fix",
|
|
28
|
+
"lint:report": "biome lint --diagnostic-level=error --reporter=junit > lint-results.xml",
|
|
29
|
+
"lint:staged": "biome check --diagnostic-level=error --staged --no-errors-on-unmatched",
|
|
34
30
|
"site:dev": "http-server site -p 12345 -c-1",
|
|
35
31
|
"site:build": "cp dist/*.schema.json site/.",
|
|
36
|
-
"test": "
|
|
32
|
+
"test": "vitest run",
|
|
33
|
+
"test:watch": "vitest",
|
|
34
|
+
"test:coverage": "vitest run --coverage"
|
|
37
35
|
},
|
|
38
|
-
"main": "./src/index.
|
|
39
|
-
"types": "./src/index.
|
|
36
|
+
"main": "./src/index.ts",
|
|
37
|
+
"types": "./src/index.ts",
|
|
40
38
|
"publishConfig": {
|
|
41
39
|
"access": "public"
|
|
42
40
|
},
|
|
@@ -46,15 +44,15 @@
|
|
|
46
44
|
],
|
|
47
45
|
"dependencies": {
|
|
48
46
|
"@cloudcannon/snippet-types": "^1.1.13",
|
|
49
|
-
"
|
|
50
|
-
"ts-json-schema-generator": "^2.2.0"
|
|
47
|
+
"zod": "^4.0.17"
|
|
51
48
|
},
|
|
52
49
|
"devDependencies": {
|
|
53
|
-
"@
|
|
50
|
+
"@biomejs/biome": "1.9.4",
|
|
51
|
+
"@types/node": "^24.2.1",
|
|
52
|
+
"@vitest/coverage-v8": "^2.1.9",
|
|
54
53
|
"http-server": "^14.1.1",
|
|
55
|
-
"
|
|
56
|
-
"
|
|
57
|
-
"
|
|
58
|
-
"typescript": "^5.7.3"
|
|
54
|
+
"tsx": "^4.20.4",
|
|
55
|
+
"typescript": "^5.9.2",
|
|
56
|
+
"vitest": "^2.1.8"
|
|
59
57
|
}
|
|
60
58
|
}
|
|
@@ -0,0 +1,295 @@
|
|
|
1
|
+
import * as z from 'zod';
|
|
2
|
+
import {
|
|
3
|
+
CollectionConfigSchema,
|
|
4
|
+
ConfigurationSchema,
|
|
5
|
+
DataConfigEntrySchema,
|
|
6
|
+
} from './configuration';
|
|
7
|
+
import { PathsSchema } from './paths';
|
|
8
|
+
|
|
9
|
+
export const BuildCoupledPathsSchema = z
|
|
10
|
+
.object({
|
|
11
|
+
...PathsSchema.shape,
|
|
12
|
+
collections: z.string().optional().meta({
|
|
13
|
+
description: 'Parent folder of all collections.',
|
|
14
|
+
}),
|
|
15
|
+
data: z.string().optional().meta({
|
|
16
|
+
description: 'Parent folder of all site data files.',
|
|
17
|
+
}),
|
|
18
|
+
layouts: z.string().optional().meta({
|
|
19
|
+
description:
|
|
20
|
+
'Parent folder of all site layout files. Only applies to Jekyll, Hugo, and Eleventy sites.',
|
|
21
|
+
}),
|
|
22
|
+
includes: z.string().optional().meta({
|
|
23
|
+
description:
|
|
24
|
+
'Parent folder of all includes, partials, or shortcode files. Only applies to Jekyll, Hugo, and Eleventy sites.',
|
|
25
|
+
}),
|
|
26
|
+
})
|
|
27
|
+
.meta({
|
|
28
|
+
id: 'paths:BuildCoupled',
|
|
29
|
+
description:
|
|
30
|
+
'Paths to where new asset files are uploaded to. They also set the default path when choosing existing images, and linking to existing files. Each path is relative to global `source`.',
|
|
31
|
+
});
|
|
32
|
+
|
|
33
|
+
export const FilterBaseSchema = z.enum(['none', 'all', 'strict']);
|
|
34
|
+
|
|
35
|
+
export const FilterValueSchema = z.object({
|
|
36
|
+
base: FilterBaseSchema.optional().meta({
|
|
37
|
+
description:
|
|
38
|
+
'Defines the initial set of visible files in the collection file list. Defaults to "all", or "strict" for the auto-discovered `pages` collection in Jekyll, Hugo, and Eleventy.',
|
|
39
|
+
}),
|
|
40
|
+
include: z.array(z.string()).optional().meta({
|
|
41
|
+
description:
|
|
42
|
+
'Add to the visible files set with `base`. Paths must be relative to the containing collection `path`.',
|
|
43
|
+
}),
|
|
44
|
+
exclude: z.array(z.string()).optional().meta({
|
|
45
|
+
description:
|
|
46
|
+
'Remove from the visible files set with `base`. Paths must be relative to the containing collection `path`.',
|
|
47
|
+
}),
|
|
48
|
+
});
|
|
49
|
+
|
|
50
|
+
export const FilterSchema = z.union([FilterValueSchema, FilterBaseSchema]).meta({
|
|
51
|
+
id: 'filter',
|
|
52
|
+
description:
|
|
53
|
+
'Controls which files are displayed in the collection list. Does not change which files are assigned to this collection.',
|
|
54
|
+
});
|
|
55
|
+
|
|
56
|
+
const ParserSchema = z.enum(['csv', 'front-matter', 'json', 'properties', 'toml', 'yaml']).meta({
|
|
57
|
+
id: 'parser',
|
|
58
|
+
description:
|
|
59
|
+
'Overrides the format files are read. Detected automatically from file extension if unset.',
|
|
60
|
+
});
|
|
61
|
+
|
|
62
|
+
const versionMeta = {
|
|
63
|
+
description:
|
|
64
|
+
'Controls which schema this file is validated against. Defaults to the latest schema.',
|
|
65
|
+
};
|
|
66
|
+
|
|
67
|
+
const collectionsConfigMeta = {
|
|
68
|
+
title: 'Collections Configuration',
|
|
69
|
+
description:
|
|
70
|
+
'Definitions for your collections, which are the sets of content files for your site grouped by folder. Entries are keyed by a chosen collection key, and contain configuration specific to that collection.',
|
|
71
|
+
};
|
|
72
|
+
|
|
73
|
+
const SingularKeySchema = z.string().meta({
|
|
74
|
+
id: 'singular_key',
|
|
75
|
+
description:
|
|
76
|
+
'Overrides the default singular input key of the collection. This is used for naming conventions for select and multiselect inputs.',
|
|
77
|
+
});
|
|
78
|
+
|
|
79
|
+
const OutputSchema = z.boolean().meta({
|
|
80
|
+
id: 'output',
|
|
81
|
+
description:
|
|
82
|
+
"Specifies whether this collection's source files build to output files. Defaults to false.",
|
|
83
|
+
});
|
|
84
|
+
|
|
85
|
+
export const BuildCoupledCollectionConfigSchema = z.object({
|
|
86
|
+
...CollectionConfigSchema.omit({ url: true, disable_url: true }).shape,
|
|
87
|
+
path: CollectionConfigSchema.shape.path.optional(),
|
|
88
|
+
filter: FilterSchema.optional(),
|
|
89
|
+
singular_key: SingularKeySchema.optional(),
|
|
90
|
+
output: OutputSchema.optional(),
|
|
91
|
+
});
|
|
92
|
+
|
|
93
|
+
export const ReaderCollectionConfigSchema = z.object({
|
|
94
|
+
...CollectionConfigSchema.shape,
|
|
95
|
+
parser: ParserSchema.optional(),
|
|
96
|
+
filter: FilterSchema.optional(),
|
|
97
|
+
singular_key: SingularKeySchema.optional(),
|
|
98
|
+
output: OutputSchema.optional(),
|
|
99
|
+
});
|
|
100
|
+
|
|
101
|
+
export const HugoCollectionConfigSchema = z.object({
|
|
102
|
+
...BuildCoupledCollectionConfigSchema.shape,
|
|
103
|
+
parse_branch_index: z.boolean().optional().meta({
|
|
104
|
+
description:
|
|
105
|
+
'Controls whether branch index files (e.g. `_index.md`) are assigned to this collection or not. The "pages" collection defaults this to true, and false otherwise.',
|
|
106
|
+
}),
|
|
107
|
+
});
|
|
108
|
+
|
|
109
|
+
export const BuildCoupledConfigurationSchema = z.object({
|
|
110
|
+
...ConfigurationSchema.omit({ version: true }).shape,
|
|
111
|
+
collections_config_override: z.boolean().optional().meta({
|
|
112
|
+
id: 'collections_config_override',
|
|
113
|
+
description:
|
|
114
|
+
'Prevents CloudCannon from automatically discovering collections for supported SSGs if true. Defaults to false.',
|
|
115
|
+
}),
|
|
116
|
+
version: z
|
|
117
|
+
.enum(['legacy-hugo', 'legacy-jekyll', 'legacy-eleventy', 'legacy-reader'])
|
|
118
|
+
.optional()
|
|
119
|
+
.meta(versionMeta),
|
|
120
|
+
paths: BuildCoupledPathsSchema.optional(),
|
|
121
|
+
collections_config: z
|
|
122
|
+
.record(z.string(), BuildCoupledCollectionConfigSchema)
|
|
123
|
+
.optional()
|
|
124
|
+
.meta({
|
|
125
|
+
...collectionsConfigMeta,
|
|
126
|
+
id: 'collections_config:BuildCoupled',
|
|
127
|
+
}),
|
|
128
|
+
data_config: z.record(z.string(), z.boolean()).optional().meta({
|
|
129
|
+
description: 'Controls what data sets are available to populate select and multiselect inputs.',
|
|
130
|
+
}),
|
|
131
|
+
});
|
|
132
|
+
|
|
133
|
+
export const ReaderConfigurationSchema = z.object({
|
|
134
|
+
...BuildCoupledConfigurationSchema.omit({ collections_config_override: true }).shape,
|
|
135
|
+
version: z.literal('legacy-reader').meta(versionMeta),
|
|
136
|
+
data_config: z
|
|
137
|
+
.record(
|
|
138
|
+
z.string(),
|
|
139
|
+
z.object({ ...DataConfigEntrySchema.shape, parser: ParserSchema.optional() })
|
|
140
|
+
)
|
|
141
|
+
.optional()
|
|
142
|
+
.meta({
|
|
143
|
+
description:
|
|
144
|
+
'Controls what data sets are available to populate select and multiselect inputs.',
|
|
145
|
+
}),
|
|
146
|
+
collections_config: z
|
|
147
|
+
.record(z.string(), ReaderCollectionConfigSchema)
|
|
148
|
+
.optional()
|
|
149
|
+
.meta(collectionsConfigMeta),
|
|
150
|
+
output: z.string().optional().meta({
|
|
151
|
+
description:
|
|
152
|
+
'Generates the integration file in another folder. Not applicable to Jekyll, Hugo, and Eleventy. Defaults to the root folder.',
|
|
153
|
+
}),
|
|
154
|
+
});
|
|
155
|
+
|
|
156
|
+
export const HugoConfigurationSchema = z.object({
|
|
157
|
+
...BuildCoupledConfigurationSchema.shape,
|
|
158
|
+
version: z.literal('legacy-hugo').meta(versionMeta),
|
|
159
|
+
collections_config: z
|
|
160
|
+
.record(z.string(), HugoCollectionConfigSchema)
|
|
161
|
+
.optional()
|
|
162
|
+
.meta(collectionsConfigMeta),
|
|
163
|
+
});
|
|
164
|
+
|
|
165
|
+
export const JekyllConfigurationSchema = z.object({
|
|
166
|
+
...BuildCoupledConfigurationSchema.shape,
|
|
167
|
+
version: z.literal('legacy-jekyll').meta(versionMeta),
|
|
168
|
+
});
|
|
169
|
+
|
|
170
|
+
export const EleventyConfigurationSchema = z.object({
|
|
171
|
+
...BuildCoupledConfigurationSchema.shape,
|
|
172
|
+
version: z.literal('legacy-eleventy').meta(versionMeta),
|
|
173
|
+
});
|
|
174
|
+
|
|
175
|
+
export const AnyLegacyConfigurationSchema = z.union([
|
|
176
|
+
HugoConfigurationSchema,
|
|
177
|
+
JekyllConfigurationSchema,
|
|
178
|
+
EleventyConfigurationSchema,
|
|
179
|
+
ReaderConfigurationSchema,
|
|
180
|
+
]);
|
|
181
|
+
|
|
182
|
+
export const AnyConfigurationSchema = z.union([ConfigurationSchema, AnyLegacyConfigurationSchema]);
|
|
183
|
+
|
|
184
|
+
export const ParsedDatasetSchema = z.union([
|
|
185
|
+
z.array(z.string()),
|
|
186
|
+
z.record(z.string(), z.string()),
|
|
187
|
+
z.record(z.string(), z.record(z.string(), z.unknown())),
|
|
188
|
+
z.array(z.record(z.string(), z.unknown())),
|
|
189
|
+
]);
|
|
190
|
+
|
|
191
|
+
export const ParsedCollectionItemSchema = z.record(z.string(), z.unknown()).and(
|
|
192
|
+
z.object({
|
|
193
|
+
path: z.string().meta({
|
|
194
|
+
description: 'The path to the file this was parsed from.',
|
|
195
|
+
}),
|
|
196
|
+
collection: z.string().optional().meta({
|
|
197
|
+
description: 'The collection key this is assigned to. Matches keys in `collections_config`.',
|
|
198
|
+
}),
|
|
199
|
+
url: z.string().optional().meta({
|
|
200
|
+
description: 'The URL this file is served at once built.',
|
|
201
|
+
}),
|
|
202
|
+
})
|
|
203
|
+
);
|
|
204
|
+
|
|
205
|
+
const WithIntegrationOutputSchema = z.object({
|
|
206
|
+
error: z
|
|
207
|
+
.union([z.literal('NO_CONTENT'), z.string()])
|
|
208
|
+
.optional()
|
|
209
|
+
.meta({
|
|
210
|
+
id: 'error',
|
|
211
|
+
description:
|
|
212
|
+
'The error code encountered when attempting to create the integration output file.',
|
|
213
|
+
}),
|
|
214
|
+
time: z.string().optional().meta({
|
|
215
|
+
id: 'time',
|
|
216
|
+
description: 'The time this file was generated.',
|
|
217
|
+
}),
|
|
218
|
+
cloudcannon: z
|
|
219
|
+
.object({
|
|
220
|
+
name: z.string().meta({
|
|
221
|
+
description: 'Name of the integration tool used to generate the integration output file.',
|
|
222
|
+
}),
|
|
223
|
+
version: z.string().meta({
|
|
224
|
+
description:
|
|
225
|
+
'Version of the integration tool used to generate the integration output file.',
|
|
226
|
+
}),
|
|
227
|
+
})
|
|
228
|
+
.optional()
|
|
229
|
+
.meta({
|
|
230
|
+
id: 'cloudcannon',
|
|
231
|
+
description:
|
|
232
|
+
'Details about the integration tool used to generate the integration output file.',
|
|
233
|
+
}),
|
|
234
|
+
data: z.record(z.string(), ParsedDatasetSchema).optional().meta({
|
|
235
|
+
id: 'data',
|
|
236
|
+
description: 'Map of data keys to parsed datasets. Keys match keys in `data_config`.',
|
|
237
|
+
}),
|
|
238
|
+
collections: z.record(z.string(), z.array(ParsedCollectionItemSchema)).optional().meta({
|
|
239
|
+
id: 'collections',
|
|
240
|
+
description:
|
|
241
|
+
'Map of collection keys to parsed collection files. Keys match keys in `collections_config`.',
|
|
242
|
+
}),
|
|
243
|
+
files: z.record(z.string(), z.string()).optional().meta({
|
|
244
|
+
id: 'files',
|
|
245
|
+
description: 'Map of build file paths to MD5s.',
|
|
246
|
+
}),
|
|
247
|
+
});
|
|
248
|
+
|
|
249
|
+
export const IntegrationOutputSchema = z.object({
|
|
250
|
+
...ConfigurationSchema.shape,
|
|
251
|
+
...WithIntegrationOutputSchema.shape,
|
|
252
|
+
});
|
|
253
|
+
|
|
254
|
+
export const ReaderIntegrationOutputSchema = z.object({
|
|
255
|
+
...ReaderConfigurationSchema.shape,
|
|
256
|
+
...WithIntegrationOutputSchema.shape,
|
|
257
|
+
});
|
|
258
|
+
|
|
259
|
+
export const HugoIntegrationOutputSchema = z.object({
|
|
260
|
+
...HugoConfigurationSchema.shape,
|
|
261
|
+
...WithIntegrationOutputSchema.shape,
|
|
262
|
+
});
|
|
263
|
+
|
|
264
|
+
export const JekyllIntegrationOutputSchema = z.object({
|
|
265
|
+
...JekyllConfigurationSchema.shape,
|
|
266
|
+
...WithIntegrationOutputSchema.shape,
|
|
267
|
+
defaults: z.unknown(),
|
|
268
|
+
});
|
|
269
|
+
|
|
270
|
+
export const EleventyIntegrationOutputSchema = z.object({
|
|
271
|
+
...EleventyConfigurationSchema.shape,
|
|
272
|
+
...WithIntegrationOutputSchema.shape,
|
|
273
|
+
});
|
|
274
|
+
|
|
275
|
+
export type BuildCoupledPaths = z.infer<typeof BuildCoupledPathsSchema>;
|
|
276
|
+
export type FilterBase = z.infer<typeof FilterBaseSchema>;
|
|
277
|
+
export type FilterValue = z.infer<typeof FilterValueSchema>;
|
|
278
|
+
export type Filter = z.infer<typeof FilterSchema>;
|
|
279
|
+
export type BuildCoupledCollectionConfig = z.infer<typeof BuildCoupledCollectionConfigSchema>;
|
|
280
|
+
export type ReaderCollectionConfig = z.infer<typeof ReaderCollectionConfigSchema>;
|
|
281
|
+
export type HugoCollectionConfig = z.infer<typeof HugoCollectionConfigSchema>;
|
|
282
|
+
export type BuildCoupledConfiguration = z.infer<typeof BuildCoupledConfigurationSchema>;
|
|
283
|
+
export type ReaderConfiguration = z.infer<typeof ReaderConfigurationSchema>;
|
|
284
|
+
export type HugoConfiguration = z.infer<typeof HugoConfigurationSchema>;
|
|
285
|
+
export type JekyllConfiguration = z.infer<typeof JekyllConfigurationSchema>;
|
|
286
|
+
export type EleventyConfiguration = z.infer<typeof EleventyConfigurationSchema>;
|
|
287
|
+
export type AnyLegacyConfiguration = z.infer<typeof AnyLegacyConfigurationSchema>;
|
|
288
|
+
export type AnyConfiguration = z.infer<typeof AnyConfigurationSchema>;
|
|
289
|
+
export type ParsedDataset = z.infer<typeof ParsedDatasetSchema>;
|
|
290
|
+
export type ParsedCollectionItem = z.infer<typeof ParsedCollectionItemSchema>;
|
|
291
|
+
export type IntegrationOutput = z.infer<typeof IntegrationOutputSchema>;
|
|
292
|
+
export type ReaderIntegrationOutput = z.infer<typeof ReaderIntegrationOutputSchema>;
|
|
293
|
+
export type HugoIntegrationOutput = z.infer<typeof HugoIntegrationOutputSchema>;
|
|
294
|
+
export type JekyllIntegrationOutput = z.infer<typeof JekyllIntegrationOutputSchema>;
|
|
295
|
+
export type EleventyIntegrationOutput = z.infer<typeof EleventyIntegrationOutputSchema>;
|
package/src/cascade.ts
ADDED
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
import * as z from 'zod';
|
|
2
|
+
import { EditablesSchema } from './editables';
|
|
3
|
+
import { InputsSchema } from './inputs';
|
|
4
|
+
import { SelectDataSchema } from './select-values';
|
|
5
|
+
import { StructuresSchema } from './structures';
|
|
6
|
+
|
|
7
|
+
export const EditorKeySchema = z.enum(['visual', 'content', 'data']).meta({
|
|
8
|
+
id: 'EditorKey',
|
|
9
|
+
title: 'Editor Key',
|
|
10
|
+
description: 'The available editors in CloudCannon: visual, content, and data editors.',
|
|
11
|
+
});
|
|
12
|
+
|
|
13
|
+
export const ReducedCascadeSchema = z.object({
|
|
14
|
+
_inputs: InputsSchema.optional(),
|
|
15
|
+
_select_data: SelectDataSchema.optional(),
|
|
16
|
+
_structures: StructuresSchema.optional(),
|
|
17
|
+
});
|
|
18
|
+
|
|
19
|
+
export const CascadeSchema = z.object({
|
|
20
|
+
...ReducedCascadeSchema.shape,
|
|
21
|
+
_enabled_editors: z.array(EditorKeySchema).optional().meta({
|
|
22
|
+
id: '_enabled_editors',
|
|
23
|
+
title: 'Enabled Editors',
|
|
24
|
+
description:
|
|
25
|
+
'Set a preferred editor and/or disable the others. The first value sets which editor opens by default, and the following values specify which editors are accessible.',
|
|
26
|
+
uniqueItems: true,
|
|
27
|
+
}),
|
|
28
|
+
_editables: EditablesSchema.optional().meta({
|
|
29
|
+
id: '_editables',
|
|
30
|
+
title: 'Editables',
|
|
31
|
+
description:
|
|
32
|
+
'Configuration for editable regions in the Visual Editor, including content, block, link, image, and text editing options.',
|
|
33
|
+
}),
|
|
34
|
+
});
|
|
35
|
+
|
|
36
|
+
export type EditorKey = z.infer<typeof EditorKeySchema>;
|
|
37
|
+
export type ReducedCascade = z.infer<typeof ReducedCascadeSchema>;
|
|
38
|
+
export type Cascade = z.infer<typeof CascadeSchema>;
|