@ninetailed/experience.js-utils-contentful 4.3.0-beta.2 → 4.4.0-beta.1

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
  */
@@ -12,23 +12,23 @@ export declare class AudienceMapper {
12
12
  revision?: number | undefined;
13
13
  space?: {
14
14
  sys: {
15
- type: string;
16
15
  id: string;
17
- linkType: string;
16
+ type?: string | undefined;
17
+ linkType?: string | undefined;
18
18
  };
19
19
  } | undefined;
20
20
  environment?: {
21
21
  sys: {
22
- type: string;
23
22
  id: string;
24
- linkType: string;
23
+ type?: string | undefined;
24
+ linkType?: string | undefined;
25
25
  };
26
26
  } | undefined;
27
27
  contentType?: {
28
28
  sys: {
29
- type: string;
30
29
  id: string;
31
- linkType: string;
30
+ type?: string | undefined;
31
+ linkType?: string | undefined;
32
32
  };
33
33
  } | undefined;
34
34
  };
@@ -40,9 +40,9 @@ export declare class AudienceMapper {
40
40
  metadata?: {
41
41
  tags: {
42
42
  sys: {
43
- type: string;
44
43
  id: string;
45
44
  linkType: string;
45
+ type?: string | undefined;
46
46
  };
47
47
  }[];
48
48
  } | undefined;
@@ -18,32 +18,32 @@ export declare class ExperienceMapper {
18
18
  revision?: number | undefined;
19
19
  space?: {
20
20
  sys: {
21
- type: string;
22
21
  id: string;
23
- linkType: string;
22
+ type?: string | undefined;
23
+ linkType?: string | undefined;
24
24
  };
25
25
  } | undefined;
26
26
  environment?: {
27
27
  sys: {
28
- type: string;
29
28
  id: string;
30
- linkType: string;
29
+ type?: string | undefined;
30
+ linkType?: string | undefined;
31
31
  };
32
32
  } | undefined;
33
33
  contentType?: {
34
34
  sys: {
35
- type: string;
36
35
  id: string;
37
- linkType: string;
36
+ type?: string | undefined;
37
+ linkType?: string | undefined;
38
38
  };
39
39
  } | undefined;
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;
@@ -65,32 +65,32 @@ export declare class ExperienceMapper {
65
65
  revision?: number | undefined;
66
66
  space?: {
67
67
  sys: {
68
- type: string;
69
68
  id: string;
70
- linkType: string;
69
+ type?: string | undefined;
70
+ linkType?: string | undefined;
71
71
  };
72
72
  } | undefined;
73
73
  environment?: {
74
74
  sys: {
75
- type: string;
76
75
  id: string;
77
- linkType: string;
76
+ type?: string | undefined;
77
+ linkType?: string | undefined;
78
78
  };
79
79
  } | undefined;
80
80
  contentType?: {
81
81
  sys: {
82
- type: string;
83
82
  id: string;
84
- linkType: string;
83
+ type?: string | undefined;
84
+ linkType?: string | undefined;
85
85
  };
86
86
  } | undefined;
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,18 +1,19 @@
1
1
  {
2
2
  "name": "@ninetailed/experience.js-utils-contentful",
3
- "version": "4.3.0-beta.2",
4
- "peerDependencies": {
5
- "contentful": "^9.1.32"
3
+ "version": "4.4.0-beta.1",
4
+ "devDependencies": {
5
+ "contentful": "^9.1.32",
6
+ "@contentful/rich-text-types": "^16.2.0"
6
7
  },
7
8
  "module": "./index.js",
8
9
  "main": "./index.cjs",
9
10
  "type": "module",
10
11
  "types": "./index.d.ts",
11
12
  "dependencies": {
12
- "@ninetailed/experience.js-utils": "4.3.0-beta.2",
13
- "@ninetailed/experience.js": "4.3.0-beta.2",
14
- "@ninetailed/experience.js-shared": "4.3.0-beta.2",
15
- "zod": "3.21.4",
16
- "@contentful/rich-text-types": "16.2.0"
17
- }
13
+ "@ninetailed/experience.js-utils": "4.4.0-beta.1",
14
+ "@ninetailed/experience.js": "4.4.0-beta.1",
15
+ "@ninetailed/experience.js-shared": "4.4.0-beta.1",
16
+ "zod": "3.21.4"
17
+ },
18
+ "peerDependencies": {}
18
19
  }
@@ -23,83 +23,83 @@ export declare const AudienceEntry: z.ZodObject<{
23
23
  revision: z.ZodOptional<z.ZodNumber>;
24
24
  space: z.ZodOptional<z.ZodObject<{
25
25
  sys: z.ZodObject<{
26
- type: z.ZodString;
26
+ type: z.ZodOptional<z.ZodString>;
27
+ linkType: z.ZodOptional<z.ZodString>;
27
28
  id: z.ZodString;
28
- linkType: z.ZodString;
29
29
  }, "strip", z.ZodTypeAny, {
30
- type: string;
31
30
  id: string;
32
- linkType: string;
31
+ type?: string | undefined;
32
+ linkType?: string | undefined;
33
33
  }, {
34
- type: string;
35
34
  id: string;
36
- linkType: string;
35
+ type?: string | undefined;
36
+ linkType?: string | undefined;
37
37
  }>;
38
38
  }, "strip", z.ZodTypeAny, {
39
39
  sys: {
40
- type: string;
41
40
  id: string;
42
- linkType: string;
41
+ type?: string | undefined;
42
+ linkType?: string | undefined;
43
43
  };
44
44
  }, {
45
45
  sys: {
46
- type: string;
47
46
  id: string;
48
- linkType: string;
47
+ type?: string | undefined;
48
+ linkType?: string | undefined;
49
49
  };
50
50
  }>>;
51
51
  environment: z.ZodOptional<z.ZodObject<{
52
52
  sys: z.ZodObject<{
53
- type: z.ZodString;
53
+ type: z.ZodOptional<z.ZodString>;
54
+ linkType: z.ZodOptional<z.ZodString>;
54
55
  id: z.ZodString;
55
- linkType: z.ZodString;
56
56
  }, "strip", z.ZodTypeAny, {
57
- type: string;
58
57
  id: string;
59
- linkType: string;
58
+ type?: string | undefined;
59
+ linkType?: string | undefined;
60
60
  }, {
61
- type: string;
62
61
  id: string;
63
- linkType: string;
62
+ type?: string | undefined;
63
+ linkType?: string | undefined;
64
64
  }>;
65
65
  }, "strip", z.ZodTypeAny, {
66
66
  sys: {
67
- type: string;
68
67
  id: string;
69
- linkType: string;
68
+ type?: string | undefined;
69
+ linkType?: string | undefined;
70
70
  };
71
71
  }, {
72
72
  sys: {
73
- type: string;
74
73
  id: string;
75
- linkType: string;
74
+ type?: string | undefined;
75
+ linkType?: string | undefined;
76
76
  };
77
77
  }>>;
78
78
  contentType: z.ZodOptional<z.ZodObject<{
79
79
  sys: z.ZodObject<{
80
- type: z.ZodString;
80
+ type: z.ZodOptional<z.ZodString>;
81
+ linkType: z.ZodOptional<z.ZodString>;
81
82
  id: z.ZodString;
82
- linkType: z.ZodString;
83
83
  }, "strip", z.ZodTypeAny, {
84
- type: string;
85
84
  id: string;
86
- linkType: string;
85
+ type?: string | undefined;
86
+ linkType?: string | undefined;
87
87
  }, {
88
- type: string;
89
88
  id: string;
90
- linkType: string;
89
+ type?: string | undefined;
90
+ linkType?: string | undefined;
91
91
  }>;
92
92
  }, "strip", z.ZodTypeAny, {
93
93
  sys: {
94
- type: string;
95
94
  id: string;
96
- linkType: string;
95
+ type?: string | undefined;
96
+ linkType?: string | undefined;
97
97
  };
98
98
  }, {
99
99
  sys: {
100
- type: string;
101
100
  id: string;
102
- linkType: string;
101
+ type?: string | undefined;
102
+ linkType?: string | undefined;
103
103
  };
104
104
  }>>;
105
105
  }, "strip", z.ZodTypeAny, {
@@ -111,23 +111,23 @@ export declare const AudienceEntry: z.ZodObject<{
111
111
  revision?: number | undefined;
112
112
  space?: {
113
113
  sys: {
114
- type: string;
115
114
  id: string;
116
- linkType: string;
115
+ type?: string | undefined;
116
+ linkType?: string | undefined;
117
117
  };
118
118
  } | undefined;
119
119
  environment?: {
120
120
  sys: {
121
- type: string;
122
121
  id: string;
123
- linkType: string;
122
+ type?: string | undefined;
123
+ linkType?: string | undefined;
124
124
  };
125
125
  } | undefined;
126
126
  contentType?: {
127
127
  sys: {
128
- type: string;
129
128
  id: string;
130
- linkType: string;
129
+ type?: string | undefined;
130
+ linkType?: string | undefined;
131
131
  };
132
132
  } | undefined;
133
133
  }, {
@@ -139,68 +139,68 @@ export declare const AudienceEntry: z.ZodObject<{
139
139
  revision?: number | undefined;
140
140
  space?: {
141
141
  sys: {
142
- type: string;
143
142
  id: string;
144
- linkType: string;
143
+ type?: string | undefined;
144
+ linkType?: string | undefined;
145
145
  };
146
146
  } | undefined;
147
147
  environment?: {
148
148
  sys: {
149
- type: string;
150
149
  id: string;
151
- linkType: string;
150
+ type?: string | undefined;
151
+ linkType?: string | undefined;
152
152
  };
153
153
  } | undefined;
154
154
  contentType?: {
155
155
  sys: {
156
- type: string;
157
156
  id: string;
158
- linkType: string;
157
+ type?: string | undefined;
158
+ linkType?: string | undefined;
159
159
  };
160
160
  } | undefined;
161
161
  }>;
162
162
  metadata: z.ZodOptional<z.ZodObject<{
163
163
  tags: z.ZodArray<z.ZodObject<{
164
164
  sys: z.ZodObject<{
165
- type: z.ZodString;
165
+ type: z.ZodOptional<z.ZodString>;
166
166
  id: z.ZodString;
167
167
  linkType: z.ZodString;
168
168
  }, "strip", z.ZodTypeAny, {
169
- type: string;
170
169
  id: string;
171
170
  linkType: string;
171
+ type?: string | undefined;
172
172
  }, {
173
- type: string;
174
173
  id: string;
175
174
  linkType: string;
175
+ type?: string | undefined;
176
176
  }>;
177
177
  }, "strip", z.ZodTypeAny, {
178
178
  sys: {
179
- type: string;
180
179
  id: string;
181
180
  linkType: string;
181
+ type?: string | undefined;
182
182
  };
183
183
  }, {
184
184
  sys: {
185
- type: string;
186
185
  id: string;
187
186
  linkType: string;
187
+ type?: string | undefined;
188
188
  };
189
189
  }>, "many">;
190
190
  }, "strip", z.ZodTypeAny, {
191
191
  tags: {
192
192
  sys: {
193
- type: string;
194
193
  id: string;
195
194
  linkType: string;
195
+ type?: string | undefined;
196
196
  };
197
197
  }[];
198
198
  }, {
199
199
  tags: {
200
200
  sys: {
201
- type: string;
202
201
  id: string;
203
202
  linkType: string;
203
+ type?: string | undefined;
204
204
  };
205
205
  }[];
206
206
  }>>;
@@ -227,23 +227,23 @@ export declare const AudienceEntry: z.ZodObject<{
227
227
  revision?: number | undefined;
228
228
  space?: {
229
229
  sys: {
230
- type: string;
231
230
  id: string;
232
- linkType: string;
231
+ type?: string | undefined;
232
+ linkType?: string | undefined;
233
233
  };
234
234
  } | undefined;
235
235
  environment?: {
236
236
  sys: {
237
- type: string;
238
237
  id: string;
239
- linkType: string;
238
+ type?: string | undefined;
239
+ linkType?: string | undefined;
240
240
  };
241
241
  } | undefined;
242
242
  contentType?: {
243
243
  sys: {
244
- type: string;
245
244
  id: string;
246
- linkType: string;
245
+ type?: string | undefined;
246
+ linkType?: string | undefined;
247
247
  };
248
248
  } | undefined;
249
249
  };
@@ -255,9 +255,9 @@ export declare const AudienceEntry: z.ZodObject<{
255
255
  metadata?: {
256
256
  tags: {
257
257
  sys: {
258
- type: string;
259
258
  id: string;
260
259
  linkType: string;
260
+ type?: string | undefined;
261
261
  };
262
262
  }[];
263
263
  } | undefined;
@@ -271,23 +271,23 @@ export declare const AudienceEntry: z.ZodObject<{
271
271
  revision?: number | undefined;
272
272
  space?: {
273
273
  sys: {
274
- type: string;
275
274
  id: string;
276
- linkType: string;
275
+ type?: string | undefined;
276
+ linkType?: string | undefined;
277
277
  };
278
278
  } | undefined;
279
279
  environment?: {
280
280
  sys: {
281
- type: string;
282
281
  id: string;
283
- linkType: string;
282
+ type?: string | undefined;
283
+ linkType?: string | undefined;
284
284
  };
285
285
  } | undefined;
286
286
  contentType?: {
287
287
  sys: {
288
- type: string;
289
288
  id: string;
290
- linkType: string;
289
+ type?: string | undefined;
290
+ linkType?: string | undefined;
291
291
  };
292
292
  } | undefined;
293
293
  };
@@ -299,9 +299,9 @@ export declare const AudienceEntry: z.ZodObject<{
299
299
  metadata?: {
300
300
  tags: {
301
301
  sys: {
302
- type: string;
303
302
  id: string;
304
303
  linkType: string;
304
+ type?: string | undefined;
305
305
  };
306
306
  }[];
307
307
  } | undefined;