@contentful/experiences-validators 1.39.0-alpha-20250528T1201-58ca01e.0 → 1.39.0-alpha-20250528T1549-bd210e1.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/dist/index.cjs +186 -115
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.ts +265 -246
- package/dist/index.js +185 -115
- package/dist/index.js.map +1 -1
- package/dist/types.d.ts +157 -126
- package/package.json +4 -2
package/dist/index.d.ts
CHANGED
|
@@ -1,7 +1,35 @@
|
|
|
1
1
|
import { z } from 'zod';
|
|
2
|
+
import { EntryProps } from 'contentful-management';
|
|
2
3
|
|
|
3
4
|
declare const DefinitionPropertyTypeSchema: z.ZodEnum<["Text", "RichText", "Number", "Date", "Boolean", "Location", "Media", "Object", "Hyperlink", "Array", "Link"]>;
|
|
4
5
|
declare const PrimitiveValueSchema: z.ZodUnion<[z.ZodString, z.ZodBoolean, z.ZodNumber, z.ZodRecord<z.ZodAny, z.ZodAny>, z.ZodUndefined]>;
|
|
6
|
+
declare const UsedComponentsSchema: z.ZodArray<z.ZodObject<{
|
|
7
|
+
sys: z.ZodObject<{
|
|
8
|
+
type: z.ZodLiteral<"Link">;
|
|
9
|
+
id: z.ZodString;
|
|
10
|
+
linkType: z.ZodLiteral<"Entry">;
|
|
11
|
+
}, "strip", z.ZodTypeAny, {
|
|
12
|
+
type: "Link";
|
|
13
|
+
id: string;
|
|
14
|
+
linkType: "Entry";
|
|
15
|
+
}, {
|
|
16
|
+
type: "Link";
|
|
17
|
+
id: string;
|
|
18
|
+
linkType: "Entry";
|
|
19
|
+
}>;
|
|
20
|
+
}, "strip", z.ZodTypeAny, {
|
|
21
|
+
sys: {
|
|
22
|
+
type: "Link";
|
|
23
|
+
id: string;
|
|
24
|
+
linkType: "Entry";
|
|
25
|
+
};
|
|
26
|
+
}, {
|
|
27
|
+
sys: {
|
|
28
|
+
type: "Link";
|
|
29
|
+
id: string;
|
|
30
|
+
linkType: "Entry";
|
|
31
|
+
};
|
|
32
|
+
}>, "many">;
|
|
5
33
|
declare const DataSourceSchema: z.ZodRecord<z.ZodString, z.ZodObject<{
|
|
6
34
|
sys: z.ZodObject<{
|
|
7
35
|
type: z.ZodLiteral<"Link">;
|
|
@@ -29,7 +57,15 @@ declare const DataSourceSchema: z.ZodRecord<z.ZodString, z.ZodObject<{
|
|
|
29
57
|
linkType: "Entry" | "Asset";
|
|
30
58
|
};
|
|
31
59
|
}>>;
|
|
60
|
+
declare const UnboundValuesSchema: z.ZodRecord<z.ZodString, z.ZodObject<{
|
|
61
|
+
value: z.ZodUnion<[z.ZodString, z.ZodBoolean, z.ZodNumber, z.ZodRecord<z.ZodAny, z.ZodAny>, z.ZodUndefined]>;
|
|
62
|
+
}, "strip", z.ZodTypeAny, {
|
|
63
|
+
value?: string | number | boolean | Record<any, any> | undefined;
|
|
64
|
+
}, {
|
|
65
|
+
value?: string | number | boolean | Record<any, any> | undefined;
|
|
66
|
+
}>>;
|
|
32
67
|
declare const ValuesByBreakpointSchema: z.ZodRecord<z.ZodString, z.ZodLazy<z.ZodUnion<[z.ZodString, z.ZodBoolean, z.ZodNumber, z.ZodRecord<z.ZodAny, z.ZodAny>, z.ZodUndefined]>>>;
|
|
68
|
+
declare const BindingSourceTypeEnumSchema: z.ZodArray<z.ZodEnum<["entry", "asset", "manual", "experience"]>, "atleastone">;
|
|
33
69
|
declare const DesignValueSchema: z.ZodObject<{
|
|
34
70
|
type: z.ZodLiteral<"DesignValue">;
|
|
35
71
|
valuesByBreakpoint: z.ZodRecord<z.ZodString, z.ZodLazy<z.ZodUnion<[z.ZodString, z.ZodBoolean, z.ZodNumber, z.ZodRecord<z.ZodAny, z.ZodAny>, z.ZodUndefined]>>>;
|
|
@@ -134,115 +170,6 @@ declare const ComponentPropertyValueSchema: z.ZodDiscriminatedUnion<"type", [z.Z
|
|
|
134
170
|
type: "NoValue";
|
|
135
171
|
}>]>;
|
|
136
172
|
type ComponentPropertyValue = z.infer<typeof ComponentPropertyValueSchema>;
|
|
137
|
-
declare const VariableMappingSchema: z.ZodObject<{
|
|
138
|
-
patternPropertyDefinitionId: z.ZodString;
|
|
139
|
-
type: z.ZodLiteral<"ContentTypeMapping">;
|
|
140
|
-
pathsByContentType: z.ZodRecord<z.ZodString, z.ZodObject<{
|
|
141
|
-
path: z.ZodString;
|
|
142
|
-
}, "strip", z.ZodTypeAny, {
|
|
143
|
-
path: string;
|
|
144
|
-
}, {
|
|
145
|
-
path: string;
|
|
146
|
-
}>>;
|
|
147
|
-
}, "strip", z.ZodTypeAny, {
|
|
148
|
-
type: "ContentTypeMapping";
|
|
149
|
-
patternPropertyDefinitionId: string;
|
|
150
|
-
pathsByContentType: Record<string, {
|
|
151
|
-
path: string;
|
|
152
|
-
}>;
|
|
153
|
-
}, {
|
|
154
|
-
type: "ContentTypeMapping";
|
|
155
|
-
patternPropertyDefinitionId: string;
|
|
156
|
-
pathsByContentType: Record<string, {
|
|
157
|
-
path: string;
|
|
158
|
-
}>;
|
|
159
|
-
}>;
|
|
160
|
-
declare const PatternPropertyDefinitionSchema: z.ZodObject<{
|
|
161
|
-
defaultValue: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodObject<{
|
|
162
|
-
sys: z.ZodObject<{
|
|
163
|
-
type: z.ZodLiteral<"Link">;
|
|
164
|
-
id: z.ZodString;
|
|
165
|
-
linkType: z.ZodEnum<["Entry"]>;
|
|
166
|
-
}, "strip", z.ZodTypeAny, {
|
|
167
|
-
type: "Link";
|
|
168
|
-
id: string;
|
|
169
|
-
linkType: "Entry";
|
|
170
|
-
}, {
|
|
171
|
-
type: "Link";
|
|
172
|
-
id: string;
|
|
173
|
-
linkType: "Entry";
|
|
174
|
-
}>;
|
|
175
|
-
}, "strip", z.ZodTypeAny, {
|
|
176
|
-
sys: {
|
|
177
|
-
type: "Link";
|
|
178
|
-
id: string;
|
|
179
|
-
linkType: "Entry";
|
|
180
|
-
};
|
|
181
|
-
}, {
|
|
182
|
-
sys: {
|
|
183
|
-
type: "Link";
|
|
184
|
-
id: string;
|
|
185
|
-
linkType: "Entry";
|
|
186
|
-
};
|
|
187
|
-
}>>>;
|
|
188
|
-
contentTypes: z.ZodRecord<z.ZodString, z.ZodObject<{
|
|
189
|
-
sys: z.ZodObject<{
|
|
190
|
-
type: z.ZodLiteral<"Link">;
|
|
191
|
-
id: z.ZodString;
|
|
192
|
-
linkType: z.ZodEnum<["ContentType"]>;
|
|
193
|
-
}, "strip", z.ZodTypeAny, {
|
|
194
|
-
type: "Link";
|
|
195
|
-
id: string;
|
|
196
|
-
linkType: "ContentType";
|
|
197
|
-
}, {
|
|
198
|
-
type: "Link";
|
|
199
|
-
id: string;
|
|
200
|
-
linkType: "ContentType";
|
|
201
|
-
}>;
|
|
202
|
-
}, "strip", z.ZodTypeAny, {
|
|
203
|
-
sys: {
|
|
204
|
-
type: "Link";
|
|
205
|
-
id: string;
|
|
206
|
-
linkType: "ContentType";
|
|
207
|
-
};
|
|
208
|
-
}, {
|
|
209
|
-
sys: {
|
|
210
|
-
type: "Link";
|
|
211
|
-
id: string;
|
|
212
|
-
linkType: "ContentType";
|
|
213
|
-
};
|
|
214
|
-
}>>;
|
|
215
|
-
}, "strip", z.ZodTypeAny, {
|
|
216
|
-
contentTypes: Record<string, {
|
|
217
|
-
sys: {
|
|
218
|
-
type: "Link";
|
|
219
|
-
id: string;
|
|
220
|
-
linkType: "ContentType";
|
|
221
|
-
};
|
|
222
|
-
}>;
|
|
223
|
-
defaultValue?: Record<string, {
|
|
224
|
-
sys: {
|
|
225
|
-
type: "Link";
|
|
226
|
-
id: string;
|
|
227
|
-
linkType: "Entry";
|
|
228
|
-
};
|
|
229
|
-
}> | undefined;
|
|
230
|
-
}, {
|
|
231
|
-
contentTypes: Record<string, {
|
|
232
|
-
sys: {
|
|
233
|
-
type: "Link";
|
|
234
|
-
id: string;
|
|
235
|
-
linkType: "ContentType";
|
|
236
|
-
};
|
|
237
|
-
}>;
|
|
238
|
-
defaultValue?: Record<string, {
|
|
239
|
-
sys: {
|
|
240
|
-
type: "Link";
|
|
241
|
-
id: string;
|
|
242
|
-
linkType: "Entry";
|
|
243
|
-
};
|
|
244
|
-
}> | undefined;
|
|
245
|
-
}>;
|
|
246
173
|
declare const PatternPropertySchema: z.ZodObject<{
|
|
247
174
|
type: z.ZodLiteral<"BoundValue">;
|
|
248
175
|
path: z.ZodString;
|
|
@@ -275,13 +202,6 @@ declare const BreakpointSchema: z.ZodObject<{
|
|
|
275
202
|
displayName: string;
|
|
276
203
|
displayIcon?: "desktop" | "tablet" | "mobile" | undefined;
|
|
277
204
|
}>;
|
|
278
|
-
declare const UnboundValuesSchema: z.ZodRecord<z.ZodString, z.ZodObject<{
|
|
279
|
-
value: z.ZodUnion<[z.ZodString, z.ZodBoolean, z.ZodNumber, z.ZodRecord<z.ZodAny, z.ZodAny>, z.ZodUndefined]>;
|
|
280
|
-
}, "strip", z.ZodTypeAny, {
|
|
281
|
-
value?: string | number | boolean | Record<any, any> | undefined;
|
|
282
|
-
}, {
|
|
283
|
-
value?: string | number | boolean | Record<any, any> | undefined;
|
|
284
|
-
}>>;
|
|
285
205
|
declare const BaseComponentTreeNodeSchema: z.ZodObject<{
|
|
286
206
|
id: z.ZodOptional<z.ZodString>;
|
|
287
207
|
definitionId: z.ZodString;
|
|
@@ -418,7 +338,203 @@ declare const BaseComponentTreeNodeSchema: z.ZodObject<{
|
|
|
418
338
|
type ComponentTreeNode = z.infer<typeof BaseComponentTreeNodeSchema> & {
|
|
419
339
|
children: ComponentTreeNode[];
|
|
420
340
|
};
|
|
421
|
-
declare const
|
|
341
|
+
declare const ComponentTreeSchema: z.ZodObject<{
|
|
342
|
+
breakpoints: z.ZodEffects<z.ZodArray<z.ZodObject<{
|
|
343
|
+
id: z.ZodString;
|
|
344
|
+
query: z.ZodString;
|
|
345
|
+
previewSize: z.ZodString;
|
|
346
|
+
displayName: z.ZodString;
|
|
347
|
+
displayIcon: z.ZodOptional<z.ZodEnum<["desktop", "tablet", "mobile"]>>;
|
|
348
|
+
}, "strict", z.ZodTypeAny, {
|
|
349
|
+
id: string;
|
|
350
|
+
query: string;
|
|
351
|
+
previewSize: string;
|
|
352
|
+
displayName: string;
|
|
353
|
+
displayIcon?: "desktop" | "tablet" | "mobile" | undefined;
|
|
354
|
+
}, {
|
|
355
|
+
id: string;
|
|
356
|
+
query: string;
|
|
357
|
+
previewSize: string;
|
|
358
|
+
displayName: string;
|
|
359
|
+
displayIcon?: "desktop" | "tablet" | "mobile" | undefined;
|
|
360
|
+
}>, "many">, {
|
|
361
|
+
id: string;
|
|
362
|
+
query: string;
|
|
363
|
+
previewSize: string;
|
|
364
|
+
displayName: string;
|
|
365
|
+
displayIcon?: "desktop" | "tablet" | "mobile" | undefined;
|
|
366
|
+
}[], {
|
|
367
|
+
id: string;
|
|
368
|
+
query: string;
|
|
369
|
+
previewSize: string;
|
|
370
|
+
displayName: string;
|
|
371
|
+
displayIcon?: "desktop" | "tablet" | "mobile" | undefined;
|
|
372
|
+
}[]>;
|
|
373
|
+
children: z.ZodArray<z.ZodType<ComponentTreeNode, z.ZodTypeDef, ComponentTreeNode>, "many">;
|
|
374
|
+
schemaVersion: z.ZodLiteral<"2023-09-28">;
|
|
375
|
+
}, "strict", z.ZodTypeAny, {
|
|
376
|
+
children: ComponentTreeNode[];
|
|
377
|
+
breakpoints: {
|
|
378
|
+
id: string;
|
|
379
|
+
query: string;
|
|
380
|
+
previewSize: string;
|
|
381
|
+
displayName: string;
|
|
382
|
+
displayIcon?: "desktop" | "tablet" | "mobile" | undefined;
|
|
383
|
+
}[];
|
|
384
|
+
schemaVersion: "2023-09-28";
|
|
385
|
+
}, {
|
|
386
|
+
children: ComponentTreeNode[];
|
|
387
|
+
breakpoints: {
|
|
388
|
+
id: string;
|
|
389
|
+
query: string;
|
|
390
|
+
previewSize: string;
|
|
391
|
+
displayName: string;
|
|
392
|
+
displayIcon?: "desktop" | "tablet" | "mobile" | undefined;
|
|
393
|
+
}[];
|
|
394
|
+
schemaVersion: "2023-09-28";
|
|
395
|
+
}>;
|
|
396
|
+
|
|
397
|
+
declare const ExperienceFieldsCMAShapeSchema: z.ZodObject<{
|
|
398
|
+
componentTree: z.ZodRecord<z.ZodString, z.ZodTypeAny>;
|
|
399
|
+
dataSource: z.ZodRecord<z.ZodString, z.ZodTypeAny>;
|
|
400
|
+
unboundValues: z.ZodRecord<z.ZodString, z.ZodTypeAny>;
|
|
401
|
+
usedComponents: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodTypeAny>>;
|
|
402
|
+
}, "strip", z.ZodTypeAny, {
|
|
403
|
+
componentTree: Record<string, any>;
|
|
404
|
+
dataSource: Record<string, any>;
|
|
405
|
+
unboundValues: Record<string, any>;
|
|
406
|
+
usedComponents?: Record<string, any> | undefined;
|
|
407
|
+
}, {
|
|
408
|
+
componentTree: Record<string, any>;
|
|
409
|
+
dataSource: Record<string, any>;
|
|
410
|
+
unboundValues: Record<string, any>;
|
|
411
|
+
usedComponents?: Record<string, any> | undefined;
|
|
412
|
+
}>;
|
|
413
|
+
type ExperienceFields = z.infer<typeof ExperienceFieldsCMAShapeSchema>;
|
|
414
|
+
type ExperienceDataSource = z.infer<typeof DataSourceSchema>;
|
|
415
|
+
type ExperienceUnboundValues = z.infer<typeof UnboundValuesSchema>;
|
|
416
|
+
type ExperienceUsedComponents = z.infer<typeof UsedComponentsSchema>;
|
|
417
|
+
type ExperienceComponentTree = z.infer<typeof ComponentTreeSchema>;
|
|
418
|
+
type ValuesByBreakpoint = z.infer<typeof ValuesByBreakpointSchema>;
|
|
419
|
+
type Breakpoint = z.infer<typeof BreakpointSchema>;
|
|
420
|
+
type PrimitiveValue = z.infer<typeof PrimitiveValueSchema>;
|
|
421
|
+
type DesignValue = z.infer<typeof DesignValueSchema>;
|
|
422
|
+
type BoundValue = z.infer<typeof BoundValueSchema>;
|
|
423
|
+
type NoValue = z.infer<typeof NoValueSchema>;
|
|
424
|
+
type UnboundValue = z.infer<typeof UnboundValueSchema>;
|
|
425
|
+
type ComponentValue = z.infer<typeof ComponentValueSchema>;
|
|
426
|
+
type BindingSourceTypeEnum = z.infer<typeof BindingSourceTypeEnumSchema>;
|
|
427
|
+
type PatternProperty = z.infer<typeof PatternPropertySchema>;
|
|
428
|
+
|
|
429
|
+
declare const VariableMappingSchema: z.ZodObject<{
|
|
430
|
+
patternPropertyDefinitionId: z.ZodString;
|
|
431
|
+
type: z.ZodLiteral<"ContentTypeMapping">;
|
|
432
|
+
pathsByContentType: z.ZodRecord<z.ZodString, z.ZodObject<{
|
|
433
|
+
path: z.ZodString;
|
|
434
|
+
}, "strip", z.ZodTypeAny, {
|
|
435
|
+
path: string;
|
|
436
|
+
}, {
|
|
437
|
+
path: string;
|
|
438
|
+
}>>;
|
|
439
|
+
}, "strip", z.ZodTypeAny, {
|
|
440
|
+
type: "ContentTypeMapping";
|
|
441
|
+
patternPropertyDefinitionId: string;
|
|
442
|
+
pathsByContentType: Record<string, {
|
|
443
|
+
path: string;
|
|
444
|
+
}>;
|
|
445
|
+
}, {
|
|
446
|
+
type: "ContentTypeMapping";
|
|
447
|
+
patternPropertyDefinitionId: string;
|
|
448
|
+
pathsByContentType: Record<string, {
|
|
449
|
+
path: string;
|
|
450
|
+
}>;
|
|
451
|
+
}>;
|
|
452
|
+
declare const PatternPropertyDefinitionSchema: z.ZodObject<{
|
|
453
|
+
defaultValue: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodObject<{
|
|
454
|
+
sys: z.ZodObject<{
|
|
455
|
+
type: z.ZodLiteral<"Link">;
|
|
456
|
+
id: z.ZodString;
|
|
457
|
+
linkType: z.ZodEnum<["Entry"]>;
|
|
458
|
+
}, "strip", z.ZodTypeAny, {
|
|
459
|
+
type: "Link";
|
|
460
|
+
id: string;
|
|
461
|
+
linkType: "Entry";
|
|
462
|
+
}, {
|
|
463
|
+
type: "Link";
|
|
464
|
+
id: string;
|
|
465
|
+
linkType: "Entry";
|
|
466
|
+
}>;
|
|
467
|
+
}, "strip", z.ZodTypeAny, {
|
|
468
|
+
sys: {
|
|
469
|
+
type: "Link";
|
|
470
|
+
id: string;
|
|
471
|
+
linkType: "Entry";
|
|
472
|
+
};
|
|
473
|
+
}, {
|
|
474
|
+
sys: {
|
|
475
|
+
type: "Link";
|
|
476
|
+
id: string;
|
|
477
|
+
linkType: "Entry";
|
|
478
|
+
};
|
|
479
|
+
}>>>;
|
|
480
|
+
contentTypes: z.ZodRecord<z.ZodString, z.ZodObject<{
|
|
481
|
+
sys: z.ZodObject<{
|
|
482
|
+
type: z.ZodLiteral<"Link">;
|
|
483
|
+
id: z.ZodString;
|
|
484
|
+
linkType: z.ZodEnum<["ContentType"]>;
|
|
485
|
+
}, "strip", z.ZodTypeAny, {
|
|
486
|
+
type: "Link";
|
|
487
|
+
id: string;
|
|
488
|
+
linkType: "ContentType";
|
|
489
|
+
}, {
|
|
490
|
+
type: "Link";
|
|
491
|
+
id: string;
|
|
492
|
+
linkType: "ContentType";
|
|
493
|
+
}>;
|
|
494
|
+
}, "strip", z.ZodTypeAny, {
|
|
495
|
+
sys: {
|
|
496
|
+
type: "Link";
|
|
497
|
+
id: string;
|
|
498
|
+
linkType: "ContentType";
|
|
499
|
+
};
|
|
500
|
+
}, {
|
|
501
|
+
sys: {
|
|
502
|
+
type: "Link";
|
|
503
|
+
id: string;
|
|
504
|
+
linkType: "ContentType";
|
|
505
|
+
};
|
|
506
|
+
}>>;
|
|
507
|
+
}, "strip", z.ZodTypeAny, {
|
|
508
|
+
contentTypes: Record<string, {
|
|
509
|
+
sys: {
|
|
510
|
+
type: "Link";
|
|
511
|
+
id: string;
|
|
512
|
+
linkType: "ContentType";
|
|
513
|
+
};
|
|
514
|
+
}>;
|
|
515
|
+
defaultValue?: Record<string, {
|
|
516
|
+
sys: {
|
|
517
|
+
type: "Link";
|
|
518
|
+
id: string;
|
|
519
|
+
linkType: "Entry";
|
|
520
|
+
};
|
|
521
|
+
}> | undefined;
|
|
522
|
+
}, {
|
|
523
|
+
contentTypes: Record<string, {
|
|
524
|
+
sys: {
|
|
525
|
+
type: "Link";
|
|
526
|
+
id: string;
|
|
527
|
+
linkType: "ContentType";
|
|
528
|
+
};
|
|
529
|
+
}>;
|
|
530
|
+
defaultValue?: Record<string, {
|
|
531
|
+
sys: {
|
|
532
|
+
type: "Link";
|
|
533
|
+
id: string;
|
|
534
|
+
linkType: "Entry";
|
|
535
|
+
};
|
|
536
|
+
}> | undefined;
|
|
537
|
+
}>;
|
|
422
538
|
declare const ComponentSettingsSchema: z.ZodObject<{
|
|
423
539
|
variableDefinitions: z.ZodRecord<z.ZodString, z.ZodObject<{
|
|
424
540
|
displayName: z.ZodOptional<z.ZodString>;
|
|
@@ -455,7 +571,6 @@ declare const ComponentSettingsSchema: z.ZodObject<{
|
|
|
455
571
|
}>, z.ZodObject<{
|
|
456
572
|
type: z.ZodLiteral<"HyperlinkValue">;
|
|
457
573
|
linkTargetKey: z.ZodString;
|
|
458
|
-
/** Allows to override parts of the URL, e.g. the locale */
|
|
459
574
|
overrides: z.ZodOptional<z.ZodObject<{}, "strip", z.ZodTypeAny, {}, {}>>;
|
|
460
575
|
}, "strict", z.ZodTypeAny, {
|
|
461
576
|
type: "HyperlinkValue";
|
|
@@ -514,6 +629,9 @@ declare const ComponentSettingsSchema: z.ZodObject<{
|
|
|
514
629
|
}>>;
|
|
515
630
|
}, "strip", z.ZodTypeAny, {
|
|
516
631
|
type: "Text" | "RichText" | "Number" | "Date" | "Boolean" | "Location" | "Media" | "Object" | "Hyperlink" | "Array" | "Link";
|
|
632
|
+
displayName?: string | undefined;
|
|
633
|
+
description?: string | undefined;
|
|
634
|
+
group?: string | undefined;
|
|
517
635
|
defaultValue?: string | number | boolean | Record<any, any> | {
|
|
518
636
|
type: "DesignValue";
|
|
519
637
|
valuesByBreakpoint: Record<string, string | number | boolean | Record<any, any> | undefined>;
|
|
@@ -533,9 +651,6 @@ declare const ComponentSettingsSchema: z.ZodObject<{
|
|
|
533
651
|
} | {
|
|
534
652
|
type: "NoValue";
|
|
535
653
|
} | undefined;
|
|
536
|
-
displayName?: string | undefined;
|
|
537
|
-
description?: string | undefined;
|
|
538
|
-
group?: string | undefined;
|
|
539
654
|
validations?: {
|
|
540
655
|
required?: boolean | undefined;
|
|
541
656
|
bindingSourceType?: ["entry" | "asset" | "manual" | "experience", ...("entry" | "asset" | "manual" | "experience")[]] | undefined;
|
|
@@ -547,6 +662,9 @@ declare const ComponentSettingsSchema: z.ZodObject<{
|
|
|
547
662
|
} | undefined;
|
|
548
663
|
}, {
|
|
549
664
|
type: "Text" | "RichText" | "Number" | "Date" | "Boolean" | "Location" | "Media" | "Object" | "Hyperlink" | "Array" | "Link";
|
|
665
|
+
displayName?: string | undefined;
|
|
666
|
+
description?: string | undefined;
|
|
667
|
+
group?: string | undefined;
|
|
550
668
|
defaultValue?: string | number | boolean | Record<any, any> | {
|
|
551
669
|
type: "DesignValue";
|
|
552
670
|
valuesByBreakpoint: Record<string, string | number | boolean | Record<any, any> | undefined>;
|
|
@@ -566,9 +684,6 @@ declare const ComponentSettingsSchema: z.ZodObject<{
|
|
|
566
684
|
} | {
|
|
567
685
|
type: "NoValue";
|
|
568
686
|
} | undefined;
|
|
569
|
-
displayName?: string | undefined;
|
|
570
|
-
description?: string | undefined;
|
|
571
|
-
group?: string | undefined;
|
|
572
687
|
validations?: {
|
|
573
688
|
required?: boolean | undefined;
|
|
574
689
|
bindingSourceType?: ["entry" | "asset" | "manual" | "experience", ...("entry" | "asset" | "manual" | "experience")[]] | undefined;
|
|
@@ -693,6 +808,9 @@ declare const ComponentSettingsSchema: z.ZodObject<{
|
|
|
693
808
|
}, "strip", z.ZodTypeAny, {
|
|
694
809
|
variableDefinitions: Record<string, {
|
|
695
810
|
type: "Text" | "RichText" | "Number" | "Date" | "Boolean" | "Location" | "Media" | "Object" | "Hyperlink" | "Array" | "Link";
|
|
811
|
+
displayName?: string | undefined;
|
|
812
|
+
description?: string | undefined;
|
|
813
|
+
group?: string | undefined;
|
|
696
814
|
defaultValue?: string | number | boolean | Record<any, any> | {
|
|
697
815
|
type: "DesignValue";
|
|
698
816
|
valuesByBreakpoint: Record<string, string | number | boolean | Record<any, any> | undefined>;
|
|
@@ -712,9 +830,6 @@ declare const ComponentSettingsSchema: z.ZodObject<{
|
|
|
712
830
|
} | {
|
|
713
831
|
type: "NoValue";
|
|
714
832
|
} | undefined;
|
|
715
|
-
displayName?: string | undefined;
|
|
716
|
-
description?: string | undefined;
|
|
717
|
-
group?: string | undefined;
|
|
718
833
|
validations?: {
|
|
719
834
|
required?: boolean | undefined;
|
|
720
835
|
bindingSourceType?: ["entry" | "asset" | "manual" | "experience", ...("entry" | "asset" | "manual" | "experience")[]] | undefined;
|
|
@@ -753,6 +868,9 @@ declare const ComponentSettingsSchema: z.ZodObject<{
|
|
|
753
868
|
}, {
|
|
754
869
|
variableDefinitions: Record<string, {
|
|
755
870
|
type: "Text" | "RichText" | "Number" | "Date" | "Boolean" | "Location" | "Media" | "Object" | "Hyperlink" | "Array" | "Link";
|
|
871
|
+
displayName?: string | undefined;
|
|
872
|
+
description?: string | undefined;
|
|
873
|
+
group?: string | undefined;
|
|
756
874
|
defaultValue?: string | number | boolean | Record<any, any> | {
|
|
757
875
|
type: "DesignValue";
|
|
758
876
|
valuesByBreakpoint: Record<string, string | number | boolean | Record<any, any> | undefined>;
|
|
@@ -772,9 +890,6 @@ declare const ComponentSettingsSchema: z.ZodObject<{
|
|
|
772
890
|
} | {
|
|
773
891
|
type: "NoValue";
|
|
774
892
|
} | undefined;
|
|
775
|
-
displayName?: string | undefined;
|
|
776
|
-
description?: string | undefined;
|
|
777
|
-
group?: string | undefined;
|
|
778
893
|
validations?: {
|
|
779
894
|
required?: boolean | undefined;
|
|
780
895
|
bindingSourceType?: ["entry" | "asset" | "manual" | "experience", ...("entry" | "asset" | "manual" | "experience")[]] | undefined;
|
|
@@ -811,126 +926,29 @@ declare const ComponentSettingsSchema: z.ZodObject<{
|
|
|
811
926
|
}> | undefined;
|
|
812
927
|
}> | undefined;
|
|
813
928
|
}>;
|
|
814
|
-
declare const
|
|
815
|
-
|
|
816
|
-
|
|
817
|
-
|
|
818
|
-
|
|
819
|
-
|
|
820
|
-
type: "Link";
|
|
821
|
-
id: string;
|
|
822
|
-
linkType: "Entry";
|
|
823
|
-
}, {
|
|
824
|
-
type: "Link";
|
|
825
|
-
id: string;
|
|
826
|
-
linkType: "Entry";
|
|
827
|
-
}>;
|
|
828
|
-
}, "strip", z.ZodTypeAny, {
|
|
829
|
-
sys: {
|
|
830
|
-
type: "Link";
|
|
831
|
-
id: string;
|
|
832
|
-
linkType: "Entry";
|
|
833
|
-
};
|
|
834
|
-
}, {
|
|
835
|
-
sys: {
|
|
836
|
-
type: "Link";
|
|
837
|
-
id: string;
|
|
838
|
-
linkType: "Entry";
|
|
839
|
-
};
|
|
840
|
-
}>, "many">;
|
|
841
|
-
declare const ComponentTreeSchema: z.ZodObject<{
|
|
842
|
-
breakpoints: z.ZodEffects<z.ZodArray<z.ZodObject<{
|
|
843
|
-
id: z.ZodString;
|
|
844
|
-
query: z.ZodString;
|
|
845
|
-
previewSize: z.ZodString;
|
|
846
|
-
displayName: z.ZodString;
|
|
847
|
-
displayIcon: z.ZodOptional<z.ZodEnum<["desktop", "tablet", "mobile"]>>;
|
|
848
|
-
}, "strict", z.ZodTypeAny, {
|
|
849
|
-
id: string;
|
|
850
|
-
query: string;
|
|
851
|
-
previewSize: string;
|
|
852
|
-
displayName: string;
|
|
853
|
-
displayIcon?: "desktop" | "tablet" | "mobile" | undefined;
|
|
854
|
-
}, {
|
|
855
|
-
id: string;
|
|
856
|
-
query: string;
|
|
857
|
-
previewSize: string;
|
|
858
|
-
displayName: string;
|
|
859
|
-
displayIcon?: "desktop" | "tablet" | "mobile" | undefined;
|
|
860
|
-
}>, "many">, {
|
|
861
|
-
id: string;
|
|
862
|
-
query: string;
|
|
863
|
-
previewSize: string;
|
|
864
|
-
displayName: string;
|
|
865
|
-
displayIcon?: "desktop" | "tablet" | "mobile" | undefined;
|
|
866
|
-
}[], {
|
|
867
|
-
id: string;
|
|
868
|
-
query: string;
|
|
869
|
-
previewSize: string;
|
|
870
|
-
displayName: string;
|
|
871
|
-
displayIcon?: "desktop" | "tablet" | "mobile" | undefined;
|
|
872
|
-
}[]>;
|
|
873
|
-
children: z.ZodArray<z.ZodType<ComponentTreeNode, z.ZodTypeDef, ComponentTreeNode>, "many">;
|
|
874
|
-
schemaVersion: z.ZodLiteral<"2023-09-28">;
|
|
875
|
-
}, "strict", z.ZodTypeAny, {
|
|
876
|
-
children: ComponentTreeNode[];
|
|
877
|
-
breakpoints: {
|
|
878
|
-
id: string;
|
|
879
|
-
query: string;
|
|
880
|
-
previewSize: string;
|
|
881
|
-
displayName: string;
|
|
882
|
-
displayIcon?: "desktop" | "tablet" | "mobile" | undefined;
|
|
883
|
-
}[];
|
|
884
|
-
schemaVersion: "2023-09-28";
|
|
885
|
-
}, {
|
|
886
|
-
children: ComponentTreeNode[];
|
|
887
|
-
breakpoints: {
|
|
888
|
-
id: string;
|
|
889
|
-
query: string;
|
|
890
|
-
previewSize: string;
|
|
891
|
-
displayName: string;
|
|
892
|
-
displayIcon?: "desktop" | "tablet" | "mobile" | undefined;
|
|
893
|
-
}[];
|
|
894
|
-
schemaVersion: "2023-09-28";
|
|
895
|
-
}>;
|
|
896
|
-
declare const ExperienceFieldsCMAShapeSchema: z.ZodObject<{
|
|
897
|
-
componentTree: z.ZodRecord<z.ZodString, any>;
|
|
898
|
-
dataSource: z.ZodRecord<z.ZodString, any>;
|
|
899
|
-
unboundValues: z.ZodRecord<z.ZodString, any>;
|
|
900
|
-
usedComponents: z.ZodOptional<z.ZodRecord<z.ZodString, any>>;
|
|
901
|
-
componentSettings: z.ZodOptional<z.ZodRecord<z.ZodString, any>>;
|
|
929
|
+
declare const PatternFieldsCMAShapeSchema: z.ZodObject<{
|
|
930
|
+
componentTree: z.ZodRecord<z.ZodString, z.ZodTypeAny>;
|
|
931
|
+
dataSource: z.ZodRecord<z.ZodString, z.ZodTypeAny>;
|
|
932
|
+
unboundValues: z.ZodRecord<z.ZodString, z.ZodTypeAny>;
|
|
933
|
+
usedComponents: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodTypeAny>>;
|
|
934
|
+
componentSettings: z.ZodRecord<z.ZodString, z.ZodTypeAny>;
|
|
902
935
|
}, "strip", z.ZodTypeAny, {
|
|
903
936
|
componentTree: Record<string, any>;
|
|
904
937
|
dataSource: Record<string, any>;
|
|
905
938
|
unboundValues: Record<string, any>;
|
|
939
|
+
componentSettings: Record<string, any>;
|
|
906
940
|
usedComponents?: Record<string, any> | undefined;
|
|
907
|
-
componentSettings?: Record<string, any> | undefined;
|
|
908
941
|
}, {
|
|
909
942
|
componentTree: Record<string, any>;
|
|
910
943
|
dataSource: Record<string, any>;
|
|
911
944
|
unboundValues: Record<string, any>;
|
|
945
|
+
componentSettings: Record<string, any>;
|
|
912
946
|
usedComponents?: Record<string, any> | undefined;
|
|
913
|
-
componentSettings?: Record<string, any> | undefined;
|
|
914
947
|
}>;
|
|
915
|
-
|
|
916
|
-
type ExperienceFields = z.infer<typeof ExperienceFieldsCMAShapeSchema>;
|
|
917
|
-
type ExperienceDataSource = z.infer<typeof DataSourceSchema>;
|
|
918
|
-
type ExperienceUnboundValues = z.infer<typeof UnboundValuesSchema>;
|
|
919
|
-
type ExperienceUsedComponents = z.infer<typeof UsedComponentsSchema>;
|
|
920
|
-
type ExperienceComponentSettings = z.infer<typeof ComponentSettingsSchema>;
|
|
921
|
-
type ExperienceComponentTree = z.infer<typeof ComponentTreeSchema>;
|
|
922
|
-
type ValuesByBreakpoint = z.infer<typeof ValuesByBreakpointSchema>;
|
|
923
|
-
type Breakpoint = z.infer<typeof BreakpointSchema>;
|
|
924
|
-
type PrimitiveValue = z.infer<typeof PrimitiveValueSchema>;
|
|
925
|
-
type DesignValue = z.infer<typeof DesignValueSchema>;
|
|
926
|
-
type BoundValue = z.infer<typeof BoundValueSchema>;
|
|
927
|
-
type NoValue = z.infer<typeof NoValueSchema>;
|
|
928
|
-
type UnboundValue = z.infer<typeof UnboundValueSchema>;
|
|
929
|
-
type ComponentValue = z.infer<typeof ComponentValueSchema>;
|
|
930
|
-
type BindingSourceTypeEnum = z.infer<typeof BindingSourceTypeEnumSchema>;
|
|
948
|
+
type PatternFields = z.infer<typeof PatternFieldsCMAShapeSchema>;
|
|
931
949
|
type PatternPropertyDefinition = z.infer<typeof PatternPropertyDefinitionSchema>;
|
|
932
|
-
type PatternProperty = z.infer<typeof PatternPropertySchema>;
|
|
933
950
|
type VariableMapping = z.infer<typeof VariableMappingSchema>;
|
|
951
|
+
type PatternComponentSettings = z.infer<typeof ComponentSettingsSchema>;
|
|
934
952
|
|
|
935
953
|
declare const ComponentDefinitionSchema: z.ZodObject<{
|
|
936
954
|
id: z.ZodString;
|
|
@@ -1029,10 +1047,10 @@ declare const ComponentDefinitionSchema: z.ZodObject<{
|
|
|
1029
1047
|
defaultValue: z.ZodOptional<z.ZodUnion<[z.ZodString, z.ZodBoolean, z.ZodNumber, z.ZodRecord<z.ZodAny, z.ZodAny>, z.ZodUndefined]>>;
|
|
1030
1048
|
}>, "strip", z.ZodTypeAny, {
|
|
1031
1049
|
type: "Text" | "RichText" | "Number" | "Date" | "Boolean" | "Location" | "Media" | "Object" | "Hyperlink" | "Array" | "Link";
|
|
1032
|
-
defaultValue?: string | number | boolean | Record<any, any> | undefined;
|
|
1033
1050
|
displayName?: string | undefined;
|
|
1034
1051
|
description?: string | undefined;
|
|
1035
1052
|
group?: string | undefined;
|
|
1053
|
+
defaultValue?: string | number | boolean | Record<any, any> | undefined;
|
|
1036
1054
|
validations?: {
|
|
1037
1055
|
required?: boolean | undefined;
|
|
1038
1056
|
bindingSourceType?: ["entry" | "asset" | "manual" | "experience", ...("entry" | "asset" | "manual" | "experience")[]] | undefined;
|
|
@@ -1044,10 +1062,10 @@ declare const ComponentDefinitionSchema: z.ZodObject<{
|
|
|
1044
1062
|
} | undefined;
|
|
1045
1063
|
}, {
|
|
1046
1064
|
type: "Text" | "RichText" | "Number" | "Date" | "Boolean" | "Location" | "Media" | "Object" | "Hyperlink" | "Array" | "Link";
|
|
1047
|
-
defaultValue?: string | number | boolean | Record<any, any> | undefined;
|
|
1048
1065
|
displayName?: string | undefined;
|
|
1049
1066
|
description?: string | undefined;
|
|
1050
1067
|
group?: string | undefined;
|
|
1068
|
+
defaultValue?: string | number | boolean | Record<any, any> | undefined;
|
|
1051
1069
|
validations?: {
|
|
1052
1070
|
required?: boolean | undefined;
|
|
1053
1071
|
bindingSourceType?: ["entry" | "asset" | "manual" | "experience", ...("entry" | "asset" | "manual" | "experience")[]] | undefined;
|
|
@@ -1059,10 +1077,10 @@ declare const ComponentDefinitionSchema: z.ZodObject<{
|
|
|
1059
1077
|
} | undefined;
|
|
1060
1078
|
}>, {
|
|
1061
1079
|
type: "Text" | "RichText" | "Number" | "Date" | "Boolean" | "Location" | "Media" | "Object" | "Hyperlink" | "Array" | "Link";
|
|
1062
|
-
defaultValue?: string | number | boolean | Record<any, any> | undefined;
|
|
1063
1080
|
displayName?: string | undefined;
|
|
1064
1081
|
description?: string | undefined;
|
|
1065
1082
|
group?: string | undefined;
|
|
1083
|
+
defaultValue?: string | number | boolean | Record<any, any> | undefined;
|
|
1066
1084
|
validations?: {
|
|
1067
1085
|
required?: boolean | undefined;
|
|
1068
1086
|
bindingSourceType?: ["entry" | "asset" | "manual" | "experience", ...("entry" | "asset" | "manual" | "experience")[]] | undefined;
|
|
@@ -1074,10 +1092,10 @@ declare const ComponentDefinitionSchema: z.ZodObject<{
|
|
|
1074
1092
|
} | undefined;
|
|
1075
1093
|
}, {
|
|
1076
1094
|
type: "Text" | "RichText" | "Number" | "Date" | "Boolean" | "Location" | "Media" | "Object" | "Hyperlink" | "Array" | "Link";
|
|
1077
|
-
defaultValue?: string | number | boolean | Record<any, any> | undefined;
|
|
1078
1095
|
displayName?: string | undefined;
|
|
1079
1096
|
description?: string | undefined;
|
|
1080
1097
|
group?: string | undefined;
|
|
1098
|
+
defaultValue?: string | number | boolean | Record<any, any> | undefined;
|
|
1081
1099
|
validations?: {
|
|
1082
1100
|
required?: boolean | undefined;
|
|
1083
1101
|
bindingSourceType?: ["entry" | "asset" | "manual" | "experience", ...("entry" | "asset" | "manual" | "experience")[]] | undefined;
|
|
@@ -1092,10 +1110,10 @@ declare const ComponentDefinitionSchema: z.ZodObject<{
|
|
|
1092
1110
|
id: string;
|
|
1093
1111
|
variables: Record<string, {
|
|
1094
1112
|
type: "Text" | "RichText" | "Number" | "Date" | "Boolean" | "Location" | "Media" | "Object" | "Hyperlink" | "Array" | "Link";
|
|
1095
|
-
defaultValue?: string | number | boolean | Record<any, any> | undefined;
|
|
1096
1113
|
displayName?: string | undefined;
|
|
1097
1114
|
description?: string | undefined;
|
|
1098
1115
|
group?: string | undefined;
|
|
1116
|
+
defaultValue?: string | number | boolean | Record<any, any> | undefined;
|
|
1099
1117
|
validations?: {
|
|
1100
1118
|
required?: boolean | undefined;
|
|
1101
1119
|
bindingSourceType?: ["entry" | "asset" | "manual" | "experience", ...("entry" | "asset" | "manual" | "experience")[]] | undefined;
|
|
@@ -1110,10 +1128,10 @@ declare const ComponentDefinitionSchema: z.ZodObject<{
|
|
|
1110
1128
|
id: string;
|
|
1111
1129
|
variables: Record<string, {
|
|
1112
1130
|
type: "Text" | "RichText" | "Number" | "Date" | "Boolean" | "Location" | "Media" | "Object" | "Hyperlink" | "Array" | "Link";
|
|
1113
|
-
defaultValue?: string | number | boolean | Record<any, any> | undefined;
|
|
1114
1131
|
displayName?: string | undefined;
|
|
1115
1132
|
description?: string | undefined;
|
|
1116
1133
|
group?: string | undefined;
|
|
1134
|
+
defaultValue?: string | number | boolean | Record<any, any> | undefined;
|
|
1117
1135
|
validations?: {
|
|
1118
1136
|
required?: boolean | undefined;
|
|
1119
1137
|
bindingSourceType?: ["entry" | "asset" | "manual" | "experience", ...("entry" | "asset" | "manual" | "experience")[]] | undefined;
|
|
@@ -1161,9 +1179,10 @@ declare const validateComponentDefinition: (definition: any) => ValidatorReturnV
|
|
|
1161
1179
|
/**
|
|
1162
1180
|
*
|
|
1163
1181
|
* @param experience The experience entry to validate
|
|
1164
|
-
* @param schemaVersionOverride Optional override for the schema version to validate against.
|
|
1182
|
+
* @param schemaVersionOverride Optional override for the schema version to validate against.
|
|
1183
|
+
* By default, the schema version is read from the experience entry
|
|
1165
1184
|
* @returns object with success property and optional errors array
|
|
1166
1185
|
*/
|
|
1167
|
-
declare const validateExperienceFields: (experience:
|
|
1186
|
+
declare const validateExperienceFields: (experience: EntryProps, schemaVersionOverride?: SchemaVersions) => ValidatorReturnValue;
|
|
1168
1187
|
|
|
1169
|
-
export { type BindingSourceTypeEnum, type BoundValue, type Breakpoint, type ComponentDefinitionPropertyType, ComponentDefinitionSchema, type ComponentPropertyValue, type ComponentTreeNode, type ComponentValue, type DesignValue, type ExperienceComponentSettings, type ExperienceComponentTree, type ExperienceDataSource, type ExperienceFields, type ExperienceUnboundValues, type ExperienceUsedComponents, type NoValue, type PatternProperty, type PatternPropertyDefinition, type PrimitiveValue, SchemaVersions,
|
|
1188
|
+
export { type BindingSourceTypeEnum, type BoundValue, type Breakpoint, type ComponentDefinitionPropertyType, ComponentDefinitionSchema, type ComponentPropertyValue, type ComponentTreeNode, type ComponentValue, type DesignValue, type PatternComponentSettings as ExperienceComponentSettings, type ExperienceComponentTree, type ExperienceDataSource, type ExperienceFields, ExperienceFieldsCMAShapeSchema as ExperienceSchema_2023_09_28, type ExperienceUnboundValues, type ExperienceUsedComponents, type NoValue, type PatternFields, type PatternProperty, type PatternPropertyDefinition, PatternFieldsCMAShapeSchema as PatternSchema_2023_09_28, type PrimitiveValue, SchemaVersions, type UnboundValue, type ValuesByBreakpoint, type VariableMapping, validateBreakpointsDefinition, validateComponentDefinition, validateExperienceFields };
|