@ninetailed/experience.js-utils-contentful 4.2.3 → 4.2.4

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/index.cjs CHANGED
@@ -17,10 +17,13 @@ var experience_jsUtils = require('@ninetailed/experience.js-utils');
17
17
  const EntryFields = zod.z.object({}).passthrough();
18
18
 
19
19
  const EntryLink = zod.z.object({
20
- type: zod.z.string(),
21
- linkType: zod.z.string(),
20
+ type: zod.z.string().optional(),
21
+ linkType: zod.z.string().optional(),
22
22
  id: zod.z.string()
23
23
  });
24
+ const LinkedEntity = zod.z.object({
25
+ sys: EntryLink
26
+ });
24
27
  const EntrySchema = zod.z.object({
25
28
  sys: zod.z.object({
26
29
  type: zod.z.string().optional(),
@@ -29,21 +32,9 @@ const EntrySchema = zod.z.object({
29
32
  updatedAt: zod.z.string().optional(),
30
33
  locale: zod.z.string().optional(),
31
34
  revision: zod.z.number().optional(),
32
- space: zod.z.object({
33
- sys: EntryLink.extend({
34
- linkType: zod.z.string()
35
- })
36
- }).optional(),
37
- environment: zod.z.object({
38
- sys: EntryLink.extend({
39
- linkType: zod.z.string()
40
- })
41
- }).optional(),
42
- contentType: zod.z.object({
43
- sys: EntryLink.extend({
44
- linkType: zod.z.string()
45
- })
46
- }).optional()
35
+ space: LinkedEntity.optional(),
36
+ environment: LinkedEntity.optional(),
37
+ contentType: LinkedEntity.optional()
47
38
  }),
48
39
  fields: EntryFields,
49
40
  metadata: zod.z.object({
@@ -115,7 +106,7 @@ const ExperienceEntryFields = zod.z.object({
115
106
  /**
116
107
  * The description of the experience (Short Text)
117
108
  */
118
- nt_description: zod.z.string().optional(),
109
+ nt_description: zod.z.string().optional().nullable(),
119
110
  /**
120
111
  * The type if the experience (nt_experiment | nt_personalization)
121
112
  */
package/index.js CHANGED
@@ -13,10 +13,13 @@ import { Config, ExperienceMapper as ExperienceMapper$1 } from '@ninetailed/expe
13
13
  const EntryFields = z.object({}).passthrough();
14
14
 
15
15
  const EntryLink = z.object({
16
- type: z.string(),
17
- linkType: z.string(),
16
+ type: z.string().optional(),
17
+ linkType: z.string().optional(),
18
18
  id: z.string()
19
19
  });
20
+ const LinkedEntity = z.object({
21
+ sys: EntryLink
22
+ });
20
23
  const EntrySchema = z.object({
21
24
  sys: z.object({
22
25
  type: z.string().optional(),
@@ -25,21 +28,9 @@ const EntrySchema = z.object({
25
28
  updatedAt: z.string().optional(),
26
29
  locale: z.string().optional(),
27
30
  revision: z.number().optional(),
28
- space: z.object({
29
- sys: EntryLink.extend({
30
- linkType: z.string()
31
- })
32
- }).optional(),
33
- environment: z.object({
34
- sys: EntryLink.extend({
35
- linkType: z.string()
36
- })
37
- }).optional(),
38
- contentType: z.object({
39
- sys: EntryLink.extend({
40
- linkType: z.string()
41
- })
42
- }).optional()
31
+ space: LinkedEntity.optional(),
32
+ environment: LinkedEntity.optional(),
33
+ contentType: LinkedEntity.optional()
43
34
  }),
44
35
  fields: EntryFields,
45
36
  metadata: z.object({
@@ -111,7 +102,7 @@ const ExperienceEntryFields = z.object({
111
102
  /**
112
103
  * The description of the experience (Short Text)
113
104
  */
114
- nt_description: z.string().optional(),
105
+ nt_description: z.string().optional().nullable(),
115
106
  /**
116
107
  * The type if the experience (nt_experiment | nt_personalization)
117
108
  */
@@ -3,16 +3,8 @@ import { AudienceEntry } from '../types/AudienceEntry';
3
3
  import type { AudienceEntryLike } from '../types/AudienceEntry';
4
4
  export declare class AudienceMapper {
5
5
  static isAudienceEntry: (entry: AudienceEntryLike) => entry is {
6
- metadata?: {
7
- tags: {
8
- sys: {
9
- type: string;
10
- id: string;
11
- linkType: string;
12
- };
13
- }[];
14
- } | undefined;
15
6
  sys: {
7
+ id: string;
16
8
  type?: string | undefined;
17
9
  createdAt?: string | undefined;
18
10
  updatedAt?: string | undefined;
@@ -20,32 +12,40 @@ export declare class AudienceMapper {
20
12
  revision?: number | undefined;
21
13
  space?: {
22
14
  sys: {
23
- type: string;
24
15
  id: string;
25
- linkType: string;
16
+ type?: string | undefined;
17
+ linkType?: string | undefined;
26
18
  };
27
19
  } | undefined;
28
20
  environment?: {
29
21
  sys: {
30
- type: string;
31
22
  id: string;
32
- linkType: string;
23
+ type?: string | undefined;
24
+ linkType?: string | undefined;
33
25
  };
34
26
  } | undefined;
35
27
  contentType?: {
36
28
  sys: {
37
- type: string;
38
29
  id: string;
39
- linkType: string;
30
+ type?: string | undefined;
31
+ linkType?: string | undefined;
40
32
  };
41
33
  } | undefined;
42
- id: string;
43
34
  };
44
35
  fields: {
45
- nt_description?: string | undefined;
46
36
  nt_name: string;
47
37
  nt_audience_id: string;
38
+ nt_description?: string | undefined;
48
39
  };
40
+ metadata?: {
41
+ tags: {
42
+ sys: {
43
+ id: string;
44
+ linkType: string;
45
+ type?: string | undefined;
46
+ };
47
+ }[];
48
+ } | undefined;
49
49
  };
50
50
  static mapAudience(audience: AudienceEntry): Audience;
51
51
  }
@@ -10,6 +10,7 @@ export declare class ExperienceMapper {
10
10
  static mapExperience<VariantFields extends EntryFields>(ctfEntry: ExperienceEntryLike<VariantFields>): import("@ninetailed/experience.js").ExperienceConfiguration<{
11
11
  id: string;
12
12
  sys: {
13
+ id: string;
13
14
  type?: string | undefined;
14
15
  createdAt?: string | undefined;
15
16
  updatedAt?: string | undefined;
@@ -17,33 +18,32 @@ export declare class ExperienceMapper {
17
18
  revision?: number | undefined;
18
19
  space?: {
19
20
  sys: {
20
- type: string;
21
21
  id: string;
22
- linkType: string;
22
+ type?: string | undefined;
23
+ linkType?: string | undefined;
23
24
  };
24
25
  } | undefined;
25
26
  environment?: {
26
27
  sys: {
27
- type: string;
28
28
  id: string;
29
- linkType: string;
29
+ type?: string | undefined;
30
+ linkType?: string | undefined;
30
31
  };
31
32
  } | undefined;
32
33
  contentType?: {
33
34
  sys: {
34
- type: string;
35
35
  id: string;
36
- linkType: string;
36
+ type?: string | undefined;
37
+ linkType?: string | undefined;
37
38
  };
38
39
  } | undefined;
39
- id: string;
40
40
  };
41
41
  metadata?: {
42
42
  tags: {
43
43
  sys: {
44
- type: string;
45
44
  id: string;
46
45
  linkType: string;
46
+ type?: string | undefined;
47
47
  };
48
48
  }[];
49
49
  } | undefined;
@@ -57,6 +57,7 @@ export declare class ExperienceMapper {
57
57
  static mapBaselineWithExperiences<Fields extends EntryFields>(entry: BaselineWithExperiencesEntry<Fields>): import("@ninetailed/experience.js").ExperienceConfiguration<{
58
58
  id: string;
59
59
  sys: {
60
+ id: string;
60
61
  type?: string | undefined;
61
62
  createdAt?: string | undefined;
62
63
  updatedAt?: string | undefined;
@@ -64,33 +65,32 @@ export declare class ExperienceMapper {
64
65
  revision?: number | undefined;
65
66
  space?: {
66
67
  sys: {
67
- type: string;
68
68
  id: string;
69
- linkType: string;
69
+ type?: string | undefined;
70
+ linkType?: string | undefined;
70
71
  };
71
72
  } | undefined;
72
73
  environment?: {
73
74
  sys: {
74
- type: string;
75
75
  id: string;
76
- linkType: string;
76
+ type?: string | undefined;
77
+ linkType?: string | undefined;
77
78
  };
78
79
  } | undefined;
79
80
  contentType?: {
80
81
  sys: {
81
- type: string;
82
82
  id: string;
83
- linkType: string;
83
+ type?: string | undefined;
84
+ linkType?: string | undefined;
84
85
  };
85
86
  } | undefined;
86
- id: string;
87
87
  };
88
88
  metadata?: {
89
89
  tags: {
90
90
  sys: {
91
- type: string;
92
91
  id: string;
93
92
  linkType: string;
93
+ type?: string | undefined;
94
94
  };
95
95
  }[];
96
96
  } | undefined;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@ninetailed/experience.js-utils-contentful",
3
- "version": "4.2.3",
3
+ "version": "4.2.4",
4
4
  "peerDependencies": {
5
5
  "contentful": "^9.1.32"
6
6
  },
@@ -9,9 +9,10 @@
9
9
  "type": "module",
10
10
  "types": "./index.d.ts",
11
11
  "dependencies": {
12
- "@ninetailed/experience.js-utils": "4.2.3",
13
- "@ninetailed/experience.js": "4.2.3",
14
- "@ninetailed/experience.js-shared": "4.2.3",
15
- "zod": "3.21.4"
12
+ "@ninetailed/experience.js-utils": "4.2.4",
13
+ "@ninetailed/experience.js": "4.2.4",
14
+ "@ninetailed/experience.js-shared": "4.2.4",
15
+ "zod": "3.21.4",
16
+ "@contentful/rich-text-types": "16.2.0"
16
17
  }
17
18
  }