@contentful/experiences-validators 1.39.0-alpha-20250528T1342-e28bc3d.0 → 1.39.0-beta.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/types.d.ts CHANGED
@@ -2,6 +2,33 @@ import { z } from 'zod';
2
2
 
3
3
  declare const DefinitionPropertyTypeSchema: z.ZodEnum<["Text", "RichText", "Number", "Date", "Boolean", "Location", "Media", "Object", "Hyperlink", "Array", "Link"]>;
4
4
  declare const PrimitiveValueSchema: z.ZodUnion<[z.ZodString, z.ZodBoolean, z.ZodNumber, z.ZodRecord<z.ZodAny, z.ZodAny>, z.ZodUndefined]>;
5
+ declare const UsedComponentsSchema: z.ZodArray<z.ZodObject<{
6
+ sys: z.ZodObject<{
7
+ type: z.ZodLiteral<"Link">;
8
+ id: z.ZodString;
9
+ linkType: z.ZodLiteral<"Entry">;
10
+ }, "strip", z.ZodTypeAny, {
11
+ type: "Link";
12
+ id: string;
13
+ linkType: "Entry";
14
+ }, {
15
+ type: "Link";
16
+ id: string;
17
+ linkType: "Entry";
18
+ }>;
19
+ }, "strip", z.ZodTypeAny, {
20
+ sys: {
21
+ type: "Link";
22
+ id: string;
23
+ linkType: "Entry";
24
+ };
25
+ }, {
26
+ sys: {
27
+ type: "Link";
28
+ id: string;
29
+ linkType: "Entry";
30
+ };
31
+ }>, "many">;
5
32
  declare const DataSourceSchema: z.ZodRecord<z.ZodString, z.ZodObject<{
6
33
  sys: z.ZodObject<{
7
34
  type: z.ZodLiteral<"Link">;
@@ -29,6 +56,13 @@ declare const DataSourceSchema: z.ZodRecord<z.ZodString, z.ZodObject<{
29
56
  linkType: "Entry" | "Asset";
30
57
  };
31
58
  }>>;
59
+ declare const UnboundValuesSchema: z.ZodRecord<z.ZodString, z.ZodObject<{
60
+ value: z.ZodUnion<[z.ZodString, z.ZodBoolean, z.ZodNumber, z.ZodRecord<z.ZodAny, z.ZodAny>, z.ZodUndefined]>;
61
+ }, "strip", z.ZodTypeAny, {
62
+ value?: string | number | boolean | Record<any, any> | undefined;
63
+ }, {
64
+ value?: string | number | boolean | Record<any, any> | undefined;
65
+ }>>;
32
66
  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]>>>;
33
67
  declare const DesignValueSchema: z.ZodObject<{
34
68
  type: z.ZodLiteral<"DesignValue">;
@@ -134,6 +168,19 @@ declare const ComponentPropertyValueSchema: z.ZodDiscriminatedUnion<"type", [z.Z
134
168
  type: "NoValue";
135
169
  }>]>;
136
170
  type ComponentPropertyValue = z.infer<typeof ComponentPropertyValueSchema>;
171
+ declare const PatternPropertySchema: z.ZodObject<{
172
+ type: z.ZodLiteral<"BoundValue">;
173
+ path: z.ZodString;
174
+ contentType: z.ZodString;
175
+ }, "strip", z.ZodTypeAny, {
176
+ path: string;
177
+ type: "BoundValue";
178
+ contentType: string;
179
+ }, {
180
+ path: string;
181
+ type: "BoundValue";
182
+ contentType: string;
183
+ }>;
137
184
  declare const BreakpointSchema: z.ZodObject<{
138
185
  id: z.ZodString;
139
186
  query: z.ZodString;
@@ -153,13 +200,6 @@ declare const BreakpointSchema: z.ZodObject<{
153
200
  displayName: string;
154
201
  displayIcon?: "desktop" | "tablet" | "mobile" | undefined;
155
202
  }>;
156
- declare const UnboundValuesSchema: z.ZodRecord<z.ZodString, z.ZodObject<{
157
- value: z.ZodUnion<[z.ZodString, z.ZodBoolean, z.ZodNumber, z.ZodRecord<z.ZodAny, z.ZodAny>, z.ZodUndefined]>;
158
- }, "strip", z.ZodTypeAny, {
159
- value?: string | number | boolean | Record<any, any> | undefined;
160
- }, {
161
- value?: string | number | boolean | Record<any, any> | undefined;
162
- }>>;
163
203
  declare const BaseComponentTreeNodeSchema: z.ZodObject<{
164
204
  id: z.ZodOptional<z.ZodString>;
165
205
  definitionId: z.ZodString;
@@ -296,6 +336,93 @@ declare const BaseComponentTreeNodeSchema: z.ZodObject<{
296
336
  type ComponentTreeNode = z.infer<typeof BaseComponentTreeNodeSchema> & {
297
337
  children: ComponentTreeNode[];
298
338
  };
339
+ declare const ComponentTreeSchema: z.ZodObject<{
340
+ breakpoints: z.ZodEffects<z.ZodArray<z.ZodObject<{
341
+ id: z.ZodString;
342
+ query: z.ZodString;
343
+ previewSize: z.ZodString;
344
+ displayName: z.ZodString;
345
+ displayIcon: z.ZodOptional<z.ZodEnum<["desktop", "tablet", "mobile"]>>;
346
+ }, "strict", z.ZodTypeAny, {
347
+ id: string;
348
+ query: string;
349
+ previewSize: string;
350
+ displayName: string;
351
+ displayIcon?: "desktop" | "tablet" | "mobile" | undefined;
352
+ }, {
353
+ id: string;
354
+ query: string;
355
+ previewSize: string;
356
+ displayName: string;
357
+ displayIcon?: "desktop" | "tablet" | "mobile" | undefined;
358
+ }>, "many">, {
359
+ id: string;
360
+ query: string;
361
+ previewSize: string;
362
+ displayName: string;
363
+ displayIcon?: "desktop" | "tablet" | "mobile" | undefined;
364
+ }[], {
365
+ id: string;
366
+ query: string;
367
+ previewSize: string;
368
+ displayName: string;
369
+ displayIcon?: "desktop" | "tablet" | "mobile" | undefined;
370
+ }[]>;
371
+ children: z.ZodArray<z.ZodType<ComponentTreeNode, z.ZodTypeDef, ComponentTreeNode>, "many">;
372
+ schemaVersion: z.ZodLiteral<"2023-09-28">;
373
+ }, "strict", z.ZodTypeAny, {
374
+ children: ComponentTreeNode[];
375
+ breakpoints: {
376
+ id: string;
377
+ query: string;
378
+ previewSize: string;
379
+ displayName: string;
380
+ displayIcon?: "desktop" | "tablet" | "mobile" | undefined;
381
+ }[];
382
+ schemaVersion: "2023-09-28";
383
+ }, {
384
+ children: ComponentTreeNode[];
385
+ breakpoints: {
386
+ id: string;
387
+ query: string;
388
+ previewSize: string;
389
+ displayName: string;
390
+ displayIcon?: "desktop" | "tablet" | "mobile" | undefined;
391
+ }[];
392
+ schemaVersion: "2023-09-28";
393
+ }>;
394
+
395
+ declare const ExperienceFieldsCMAShapeSchema: z.ZodObject<{
396
+ componentTree: z.ZodRecord<z.ZodString, z.ZodTypeAny>;
397
+ dataSource: z.ZodRecord<z.ZodString, z.ZodTypeAny>;
398
+ unboundValues: z.ZodRecord<z.ZodString, z.ZodTypeAny>;
399
+ usedComponents: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodTypeAny>>;
400
+ }, "strip", z.ZodTypeAny, {
401
+ componentTree: Record<string, any>;
402
+ dataSource: Record<string, any>;
403
+ unboundValues: Record<string, any>;
404
+ usedComponents?: Record<string, any> | undefined;
405
+ }, {
406
+ componentTree: Record<string, any>;
407
+ dataSource: Record<string, any>;
408
+ unboundValues: Record<string, any>;
409
+ usedComponents?: Record<string, any> | undefined;
410
+ }>;
411
+ type ExperienceFields = z.infer<typeof ExperienceFieldsCMAShapeSchema>;
412
+ type ExperienceDataSource = z.infer<typeof DataSourceSchema>;
413
+ type ExperienceUnboundValues = z.infer<typeof UnboundValuesSchema>;
414
+ type ExperienceUsedComponents = z.infer<typeof UsedComponentsSchema>;
415
+ type ExperienceComponentTree = z.infer<typeof ComponentTreeSchema>;
416
+ type ValuesByBreakpoint = z.infer<typeof ValuesByBreakpointSchema>;
417
+ type Breakpoint = z.infer<typeof BreakpointSchema>;
418
+ type PrimitiveValue = z.infer<typeof PrimitiveValueSchema>;
419
+ type DesignValue = z.infer<typeof DesignValueSchema>;
420
+ type BoundValue = z.infer<typeof BoundValueSchema>;
421
+ type NoValue = z.infer<typeof NoValueSchema>;
422
+ type UnboundValue = z.infer<typeof UnboundValueSchema>;
423
+ type ComponentValue = z.infer<typeof ComponentValueSchema>;
424
+ type PatternProperty = z.infer<typeof PatternPropertySchema>;
425
+
299
426
  declare const ComponentSettingsSchema: z.ZodObject<{
300
427
  variableDefinitions: z.ZodRecord<z.ZodString, z.ZodObject<{
301
428
  displayName: z.ZodOptional<z.ZodString>;
@@ -332,7 +459,6 @@ declare const ComponentSettingsSchema: z.ZodObject<{
332
459
  }>, z.ZodObject<{
333
460
  type: z.ZodLiteral<"HyperlinkValue">;
334
461
  linkTargetKey: z.ZodString;
335
- /** Allows to override parts of the URL, e.g. the locale */
336
462
  overrides: z.ZodOptional<z.ZodObject<{}, "strip", z.ZodTypeAny, {}, {}>>;
337
463
  }, "strict", z.ZodTypeAny, {
338
464
  type: "HyperlinkValue";
@@ -391,6 +517,9 @@ declare const ComponentSettingsSchema: z.ZodObject<{
391
517
  }>>;
392
518
  }, "strip", z.ZodTypeAny, {
393
519
  type: "Text" | "RichText" | "Number" | "Date" | "Boolean" | "Location" | "Media" | "Object" | "Hyperlink" | "Array" | "Link";
520
+ displayName?: string | undefined;
521
+ description?: string | undefined;
522
+ group?: string | undefined;
394
523
  defaultValue?: string | number | boolean | Record<any, any> | {
395
524
  type: "DesignValue";
396
525
  valuesByBreakpoint: Record<string, string | number | boolean | Record<any, any> | undefined>;
@@ -410,9 +539,6 @@ declare const ComponentSettingsSchema: z.ZodObject<{
410
539
  } | {
411
540
  type: "NoValue";
412
541
  } | undefined;
413
- displayName?: string | undefined;
414
- description?: string | undefined;
415
- group?: string | undefined;
416
542
  validations?: {
417
543
  required?: boolean | undefined;
418
544
  bindingSourceType?: ["entry" | "asset" | "manual" | "experience", ...("entry" | "asset" | "manual" | "experience")[]] | undefined;
@@ -424,6 +550,9 @@ declare const ComponentSettingsSchema: z.ZodObject<{
424
550
  } | undefined;
425
551
  }, {
426
552
  type: "Text" | "RichText" | "Number" | "Date" | "Boolean" | "Location" | "Media" | "Object" | "Hyperlink" | "Array" | "Link";
553
+ displayName?: string | undefined;
554
+ description?: string | undefined;
555
+ group?: string | undefined;
427
556
  defaultValue?: string | number | boolean | Record<any, any> | {
428
557
  type: "DesignValue";
429
558
  valuesByBreakpoint: Record<string, string | number | boolean | Record<any, any> | undefined>;
@@ -443,9 +572,6 @@ declare const ComponentSettingsSchema: z.ZodObject<{
443
572
  } | {
444
573
  type: "NoValue";
445
574
  } | undefined;
446
- displayName?: string | undefined;
447
- description?: string | undefined;
448
- group?: string | undefined;
449
575
  validations?: {
450
576
  required?: boolean | undefined;
451
577
  bindingSourceType?: ["entry" | "asset" | "manual" | "experience", ...("entry" | "asset" | "manual" | "experience")[]] | undefined;
@@ -570,6 +696,9 @@ declare const ComponentSettingsSchema: z.ZodObject<{
570
696
  }, "strip", z.ZodTypeAny, {
571
697
  variableDefinitions: Record<string, {
572
698
  type: "Text" | "RichText" | "Number" | "Date" | "Boolean" | "Location" | "Media" | "Object" | "Hyperlink" | "Array" | "Link";
699
+ displayName?: string | undefined;
700
+ description?: string | undefined;
701
+ group?: string | undefined;
573
702
  defaultValue?: string | number | boolean | Record<any, any> | {
574
703
  type: "DesignValue";
575
704
  valuesByBreakpoint: Record<string, string | number | boolean | Record<any, any> | undefined>;
@@ -589,9 +718,6 @@ declare const ComponentSettingsSchema: z.ZodObject<{
589
718
  } | {
590
719
  type: "NoValue";
591
720
  } | undefined;
592
- displayName?: string | undefined;
593
- description?: string | undefined;
594
- group?: string | undefined;
595
721
  validations?: {
596
722
  required?: boolean | undefined;
597
723
  bindingSourceType?: ["entry" | "asset" | "manual" | "experience", ...("entry" | "asset" | "manual" | "experience")[]] | undefined;
@@ -630,6 +756,9 @@ declare const ComponentSettingsSchema: z.ZodObject<{
630
756
  }, {
631
757
  variableDefinitions: Record<string, {
632
758
  type: "Text" | "RichText" | "Number" | "Date" | "Boolean" | "Location" | "Media" | "Object" | "Hyperlink" | "Array" | "Link";
759
+ displayName?: string | undefined;
760
+ description?: string | undefined;
761
+ group?: string | undefined;
633
762
  defaultValue?: string | number | boolean | Record<any, any> | {
634
763
  type: "DesignValue";
635
764
  valuesByBreakpoint: Record<string, string | number | boolean | Record<any, any> | undefined>;
@@ -649,9 +778,6 @@ declare const ComponentSettingsSchema: z.ZodObject<{
649
778
  } | {
650
779
  type: "NoValue";
651
780
  } | undefined;
652
- displayName?: string | undefined;
653
- description?: string | undefined;
654
- group?: string | undefined;
655
781
  validations?: {
656
782
  required?: boolean | undefined;
657
783
  bindingSourceType?: ["entry" | "asset" | "manual" | "experience", ...("entry" | "asset" | "manual" | "experience")[]] | undefined;
@@ -688,126 +814,31 @@ declare const ComponentSettingsSchema: z.ZodObject<{
688
814
  }> | undefined;
689
815
  }> | undefined;
690
816
  }>;
691
- declare const UsedComponentsSchema: z.ZodArray<z.ZodObject<{
692
- sys: z.ZodObject<{
693
- type: z.ZodLiteral<"Link">;
694
- id: z.ZodString;
695
- linkType: z.ZodLiteral<"Entry">;
696
- }, "strip", z.ZodTypeAny, {
697
- type: "Link";
698
- id: string;
699
- linkType: "Entry";
700
- }, {
701
- type: "Link";
702
- id: string;
703
- linkType: "Entry";
704
- }>;
705
- }, "strip", z.ZodTypeAny, {
706
- sys: {
707
- type: "Link";
708
- id: string;
709
- linkType: "Entry";
710
- };
711
- }, {
712
- sys: {
713
- type: "Link";
714
- id: string;
715
- linkType: "Entry";
716
- };
717
- }>, "many">;
718
- declare const ComponentTreeSchema: z.ZodObject<{
719
- breakpoints: z.ZodEffects<z.ZodArray<z.ZodObject<{
720
- id: z.ZodString;
721
- query: z.ZodString;
722
- previewSize: z.ZodString;
723
- displayName: z.ZodString;
724
- displayIcon: z.ZodOptional<z.ZodEnum<["desktop", "tablet", "mobile"]>>;
725
- }, "strict", z.ZodTypeAny, {
726
- id: string;
727
- query: string;
728
- previewSize: string;
729
- displayName: string;
730
- displayIcon?: "desktop" | "tablet" | "mobile" | undefined;
731
- }, {
732
- id: string;
733
- query: string;
734
- previewSize: string;
735
- displayName: string;
736
- displayIcon?: "desktop" | "tablet" | "mobile" | undefined;
737
- }>, "many">, {
738
- id: string;
739
- query: string;
740
- previewSize: string;
741
- displayName: string;
742
- displayIcon?: "desktop" | "tablet" | "mobile" | undefined;
743
- }[], {
744
- id: string;
745
- query: string;
746
- previewSize: string;
747
- displayName: string;
748
- displayIcon?: "desktop" | "tablet" | "mobile" | undefined;
749
- }[]>;
750
- children: z.ZodArray<z.ZodType<ComponentTreeNode, z.ZodTypeDef, ComponentTreeNode>, "many">;
751
- schemaVersion: z.ZodLiteral<"2023-09-28">;
752
- }, "strict", z.ZodTypeAny, {
753
- children: ComponentTreeNode[];
754
- breakpoints: {
755
- id: string;
756
- query: string;
757
- previewSize: string;
758
- displayName: string;
759
- displayIcon?: "desktop" | "tablet" | "mobile" | undefined;
760
- }[];
761
- schemaVersion: "2023-09-28";
762
- }, {
763
- children: ComponentTreeNode[];
764
- breakpoints: {
765
- id: string;
766
- query: string;
767
- previewSize: string;
768
- displayName: string;
769
- displayIcon?: "desktop" | "tablet" | "mobile" | undefined;
770
- }[];
771
- schemaVersion: "2023-09-28";
772
- }>;
773
- declare const ExperienceFieldsCMAShapeSchema: z.ZodObject<{
774
- componentTree: z.ZodRecord<z.ZodString, any>;
775
- dataSource: z.ZodRecord<z.ZodString, any>;
776
- unboundValues: z.ZodRecord<z.ZodString, any>;
777
- usedComponents: z.ZodOptional<z.ZodRecord<z.ZodString, any>>;
778
- componentSettings: z.ZodOptional<z.ZodRecord<z.ZodString, any>>;
817
+ declare const PatternFieldsCMAShapeSchema: z.ZodObject<{
818
+ componentTree: z.ZodRecord<z.ZodString, z.ZodTypeAny>;
819
+ dataSource: z.ZodRecord<z.ZodString, z.ZodTypeAny>;
820
+ unboundValues: z.ZodRecord<z.ZodString, z.ZodTypeAny>;
821
+ usedComponents: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodTypeAny>>;
822
+ componentSettings: z.ZodRecord<z.ZodString, z.ZodTypeAny>;
779
823
  }, "strip", z.ZodTypeAny, {
780
824
  componentTree: Record<string, any>;
781
825
  dataSource: Record<string, any>;
782
826
  unboundValues: Record<string, any>;
827
+ componentSettings: Record<string, any>;
783
828
  usedComponents?: Record<string, any> | undefined;
784
- componentSettings?: Record<string, any> | undefined;
785
829
  }, {
786
830
  componentTree: Record<string, any>;
787
831
  dataSource: Record<string, any>;
788
832
  unboundValues: Record<string, any>;
833
+ componentSettings: Record<string, any>;
789
834
  usedComponents?: Record<string, any> | undefined;
790
- componentSettings?: Record<string, any> | undefined;
791
835
  }>;
792
-
793
- type ExperienceFields = z.infer<typeof ExperienceFieldsCMAShapeSchema>;
794
- type ExperienceDataSource = z.infer<typeof DataSourceSchema>;
795
- type ExperienceUnboundValues = z.infer<typeof UnboundValuesSchema>;
796
- type ExperienceUsedComponents = z.infer<typeof UsedComponentsSchema>;
797
- type ExperienceComponentSettings = z.infer<typeof ComponentSettingsSchema>;
798
- type ExperienceComponentTree = z.infer<typeof ComponentTreeSchema>;
799
- type ValuesByBreakpoint = z.infer<typeof ValuesByBreakpointSchema>;
800
- type Breakpoint = z.infer<typeof BreakpointSchema>;
801
- type PrimitiveValue = z.infer<typeof PrimitiveValueSchema>;
802
- type DesignValue = z.infer<typeof DesignValueSchema>;
803
- type BoundValue = z.infer<typeof BoundValueSchema>;
804
- type NoValue = z.infer<typeof NoValueSchema>;
805
- type UnboundValue = z.infer<typeof UnboundValueSchema>;
806
- type ComponentValue = z.infer<typeof ComponentValueSchema>;
836
+ type PatternFields = z.infer<typeof PatternFieldsCMAShapeSchema>;
837
+ type PatternComponentSettings = z.infer<typeof ComponentSettingsSchema>;
807
838
 
808
839
  type ComponentDefinitionPropertyType = z.infer<typeof DefinitionPropertyTypeSchema>;
809
840
 
810
841
  declare const SchemaVersions: z.ZodLiteral<"2023-09-28">;
811
842
  type SchemaVersions = z.infer<typeof SchemaVersions>;
812
843
 
813
- export { type BoundValue, type Breakpoint, type ComponentDefinitionPropertyType, type ComponentPropertyValue, type ComponentTreeNode, type ComponentValue, type DesignValue, type ExperienceComponentSettings, type ExperienceComponentTree, type ExperienceDataSource, type ExperienceFields, type ExperienceUnboundValues, type ExperienceUsedComponents, type NoValue, type PrimitiveValue, SchemaVersions, type UnboundValue, type ValuesByBreakpoint };
844
+ export { type BoundValue, type Breakpoint, type ComponentDefinitionPropertyType, type ComponentPropertyValue, type ComponentTreeNode, type ComponentValue, type DesignValue, type PatternComponentSettings as ExperienceComponentSettings, type ExperienceComponentTree, type ExperienceDataSource, type ExperienceFields, type ExperienceUnboundValues, type ExperienceUsedComponents, type NoValue, type PatternFields, type PatternProperty, type PrimitiveValue, SchemaVersions, type UnboundValue, type ValuesByBreakpoint };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@contentful/experiences-validators",
3
- "version": "1.39.0-alpha-20250528T1342-e28bc3d.0",
3
+ "version": "1.39.0-beta.0",
4
4
  "main": "./dist/index.js",
5
5
  "module": "./dist/index.js",
6
6
  "types": "./dist/index.d.ts",
@@ -40,8 +40,10 @@
40
40
  },
41
41
  "devDependencies": {
42
42
  "@vitest/coverage-v8": "^2.1.1",
43
+ "contentful-management": "^11.52.2",
43
44
  "typescript": "^5.2.2",
44
45
  "vite": "^5.0.8",
46
+ "vite-tsconfig-paths": "^5.1.4",
45
47
  "vitest": "^2.1.1"
46
48
  },
47
49
  "dependencies": {
@@ -50,5 +52,5 @@
50
52
  "publishConfig": {
51
53
  "registry": "https://npm.pkg.github.com/"
52
54
  },
53
- "gitHead": "2260b6f7c1ba8064ab4e12c7817cffe6cc2cdbd5"
55
+ "gitHead": "cce8dd8ff4e1c5125b8e6bd7aa4a73acfa948367"
54
56
  }