@ninetailed/experience.js-utils-contentful 2.1.1 → 2.1.2-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.esm.js +7 -7
- package/index.umd.js +7 -7
- package/package.json +3 -3
- package/types/Entry.d.ts +48 -48
package/index.esm.js
CHANGED
|
@@ -7,11 +7,11 @@ const EntryLink = z.object({
|
|
|
7
7
|
});
|
|
8
8
|
const Entry = z.object({
|
|
9
9
|
sys: z.object({
|
|
10
|
-
type: z.string(),
|
|
10
|
+
type: z.string().optional(),
|
|
11
11
|
id: z.string(),
|
|
12
|
-
createdAt: z.string(),
|
|
13
|
-
updatedAt: z.string(),
|
|
14
|
-
locale: z.string(),
|
|
12
|
+
createdAt: z.string().optional(),
|
|
13
|
+
updatedAt: z.string().optional(),
|
|
14
|
+
locale: z.string().optional(),
|
|
15
15
|
revision: z.number().optional(),
|
|
16
16
|
space: z.object({
|
|
17
17
|
sys: EntryLink.extend({
|
|
@@ -27,7 +27,7 @@ const Entry = z.object({
|
|
|
27
27
|
sys: EntryLink.extend({
|
|
28
28
|
linkType: z.literal('ContentType')
|
|
29
29
|
})
|
|
30
|
-
})
|
|
30
|
+
}).optional()
|
|
31
31
|
}),
|
|
32
32
|
fields: z.object({}),
|
|
33
33
|
metadata: z.object({
|
|
@@ -36,7 +36,7 @@ const Entry = z.object({
|
|
|
36
36
|
linkType: z.literal('Tag')
|
|
37
37
|
})
|
|
38
38
|
}))
|
|
39
|
-
})
|
|
39
|
+
}).optional()
|
|
40
40
|
});
|
|
41
41
|
|
|
42
42
|
const AudienceFields = z.object({
|
|
@@ -99,7 +99,7 @@ const ExperienceEntry = Entry.extend({
|
|
|
99
99
|
class AudienceMapper {
|
|
100
100
|
static mapAudience(audience) {
|
|
101
101
|
return {
|
|
102
|
-
id: audience.
|
|
102
|
+
id: audience.fields.nt_audience_id
|
|
103
103
|
};
|
|
104
104
|
}
|
|
105
105
|
|
package/index.umd.js
CHANGED
|
@@ -11,11 +11,11 @@
|
|
|
11
11
|
});
|
|
12
12
|
var Entry = zod.z.object({
|
|
13
13
|
sys: zod.z.object({
|
|
14
|
-
type: zod.z.string(),
|
|
14
|
+
type: zod.z.string().optional(),
|
|
15
15
|
id: zod.z.string(),
|
|
16
|
-
createdAt: zod.z.string(),
|
|
17
|
-
updatedAt: zod.z.string(),
|
|
18
|
-
locale: zod.z.string(),
|
|
16
|
+
createdAt: zod.z.string().optional(),
|
|
17
|
+
updatedAt: zod.z.string().optional(),
|
|
18
|
+
locale: zod.z.string().optional(),
|
|
19
19
|
revision: zod.z.number().optional(),
|
|
20
20
|
space: zod.z.object({
|
|
21
21
|
sys: EntryLink.extend({
|
|
@@ -31,7 +31,7 @@
|
|
|
31
31
|
sys: EntryLink.extend({
|
|
32
32
|
linkType: zod.z.literal('ContentType')
|
|
33
33
|
})
|
|
34
|
-
})
|
|
34
|
+
}).optional()
|
|
35
35
|
}),
|
|
36
36
|
fields: zod.z.object({}),
|
|
37
37
|
metadata: zod.z.object({
|
|
@@ -40,7 +40,7 @@
|
|
|
40
40
|
linkType: zod.z.literal('Tag')
|
|
41
41
|
})
|
|
42
42
|
}))
|
|
43
|
-
})
|
|
43
|
+
}).optional()
|
|
44
44
|
});
|
|
45
45
|
|
|
46
46
|
var AudienceFields = zod.z.object({
|
|
@@ -107,7 +107,7 @@
|
|
|
107
107
|
|
|
108
108
|
AudienceMapper.mapAudience = function (audience) {
|
|
109
109
|
return {
|
|
110
|
-
id: audience.
|
|
110
|
+
id: audience.fields.nt_audience_id
|
|
111
111
|
};
|
|
112
112
|
};
|
|
113
113
|
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@ninetailed/experience.js-utils-contentful",
|
|
3
|
-
"version": "2.1.1",
|
|
3
|
+
"version": "2.1.2-beta.1",
|
|
4
4
|
"peerDependencies": {
|
|
5
5
|
"contentful": "^9.1.32"
|
|
6
6
|
},
|
|
@@ -8,9 +8,9 @@
|
|
|
8
8
|
"module": "./index.esm.js",
|
|
9
9
|
"typings": "./index.d.ts",
|
|
10
10
|
"dependencies": {
|
|
11
|
-
"@ninetailed/experience.js": "2.1.1",
|
|
11
|
+
"@ninetailed/experience.js": "2.1.2-beta.1",
|
|
12
12
|
"analytics": "^0.8.0",
|
|
13
|
-
"@ninetailed/experience.js-shared": "2.1.1",
|
|
13
|
+
"@ninetailed/experience.js-shared": "2.1.2-beta.1",
|
|
14
14
|
"uuid": "^8.3.2",
|
|
15
15
|
"ts-toolbelt": "^9.6.0",
|
|
16
16
|
"locale-enum": "^1.1.1",
|
package/types/Entry.d.ts
CHANGED
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
import { z } from 'zod';
|
|
2
2
|
export declare const Entry: z.ZodObject<{
|
|
3
3
|
sys: z.ZodObject<{
|
|
4
|
-
type: z.ZodString
|
|
4
|
+
type: z.ZodOptional<z.ZodString>;
|
|
5
5
|
id: z.ZodString;
|
|
6
|
-
createdAt: z.ZodString
|
|
7
|
-
updatedAt: z.ZodString
|
|
8
|
-
locale: z.ZodString
|
|
6
|
+
createdAt: z.ZodOptional<z.ZodString>;
|
|
7
|
+
updatedAt: z.ZodOptional<z.ZodString>;
|
|
8
|
+
locale: z.ZodOptional<z.ZodString>;
|
|
9
9
|
revision: z.ZodOptional<z.ZodNumber>;
|
|
10
10
|
space: z.ZodOptional<z.ZodObject<{
|
|
11
11
|
sys: z.ZodObject<z.extendShape<{
|
|
@@ -65,7 +65,7 @@ export declare const Entry: z.ZodObject<{
|
|
|
65
65
|
id: string;
|
|
66
66
|
};
|
|
67
67
|
}>>;
|
|
68
|
-
contentType: z.ZodObject<{
|
|
68
|
+
contentType: z.ZodOptional<z.ZodObject<{
|
|
69
69
|
sys: z.ZodObject<z.extendShape<{
|
|
70
70
|
type: z.ZodLiteral<"Link">;
|
|
71
71
|
linkType: z.ZodString;
|
|
@@ -93,8 +93,12 @@ export declare const Entry: z.ZodObject<{
|
|
|
93
93
|
linkType: "ContentType";
|
|
94
94
|
id: string;
|
|
95
95
|
};
|
|
96
|
-
}
|
|
96
|
+
}>>;
|
|
97
97
|
}, "strip", z.ZodTypeAny, {
|
|
98
|
+
type?: string | undefined;
|
|
99
|
+
createdAt?: string | undefined;
|
|
100
|
+
updatedAt?: string | undefined;
|
|
101
|
+
locale?: string | undefined;
|
|
98
102
|
revision?: number | undefined;
|
|
99
103
|
space?: {
|
|
100
104
|
sys: {
|
|
@@ -110,19 +114,19 @@ export declare const Entry: z.ZodObject<{
|
|
|
110
114
|
id: string;
|
|
111
115
|
};
|
|
112
116
|
} | undefined;
|
|
113
|
-
|
|
114
|
-
id: string;
|
|
115
|
-
createdAt: string;
|
|
116
|
-
updatedAt: string;
|
|
117
|
-
locale: string;
|
|
118
|
-
contentType: {
|
|
117
|
+
contentType?: {
|
|
119
118
|
sys: {
|
|
120
119
|
type: "Link";
|
|
121
120
|
linkType: "ContentType";
|
|
122
121
|
id: string;
|
|
123
122
|
};
|
|
124
|
-
};
|
|
123
|
+
} | undefined;
|
|
124
|
+
id: string;
|
|
125
125
|
}, {
|
|
126
|
+
type?: string | undefined;
|
|
127
|
+
createdAt?: string | undefined;
|
|
128
|
+
updatedAt?: string | undefined;
|
|
129
|
+
locale?: string | undefined;
|
|
126
130
|
revision?: number | undefined;
|
|
127
131
|
space?: {
|
|
128
132
|
sys: {
|
|
@@ -138,21 +142,17 @@ export declare const Entry: z.ZodObject<{
|
|
|
138
142
|
id: string;
|
|
139
143
|
};
|
|
140
144
|
} | undefined;
|
|
141
|
-
|
|
142
|
-
id: string;
|
|
143
|
-
createdAt: string;
|
|
144
|
-
updatedAt: string;
|
|
145
|
-
locale: string;
|
|
146
|
-
contentType: {
|
|
145
|
+
contentType?: {
|
|
147
146
|
sys: {
|
|
148
147
|
type: "Link";
|
|
149
148
|
linkType: "ContentType";
|
|
150
149
|
id: string;
|
|
151
150
|
};
|
|
152
|
-
};
|
|
151
|
+
} | undefined;
|
|
152
|
+
id: string;
|
|
153
153
|
}>;
|
|
154
154
|
fields: z.ZodObject<{}, "strip", z.ZodTypeAny, {}, {}>;
|
|
155
|
-
metadata: z.ZodObject<{
|
|
155
|
+
metadata: z.ZodOptional<z.ZodObject<{
|
|
156
156
|
tags: z.ZodArray<z.ZodObject<{
|
|
157
157
|
sys: z.ZodObject<z.extendShape<{
|
|
158
158
|
type: z.ZodLiteral<"Link">;
|
|
@@ -198,9 +198,22 @@ export declare const Entry: z.ZodObject<{
|
|
|
198
198
|
id: string;
|
|
199
199
|
};
|
|
200
200
|
}[];
|
|
201
|
-
}
|
|
201
|
+
}>>;
|
|
202
202
|
}, "strip", z.ZodTypeAny, {
|
|
203
|
+
metadata?: {
|
|
204
|
+
tags: {
|
|
205
|
+
sys: {
|
|
206
|
+
type: "Link";
|
|
207
|
+
linkType: "Tag";
|
|
208
|
+
id: string;
|
|
209
|
+
};
|
|
210
|
+
}[];
|
|
211
|
+
} | undefined;
|
|
203
212
|
sys: {
|
|
213
|
+
type?: string | undefined;
|
|
214
|
+
createdAt?: string | undefined;
|
|
215
|
+
updatedAt?: string | undefined;
|
|
216
|
+
locale?: string | undefined;
|
|
204
217
|
revision?: number | undefined;
|
|
205
218
|
space?: {
|
|
206
219
|
sys: {
|
|
@@ -216,21 +229,18 @@ export declare const Entry: z.ZodObject<{
|
|
|
216
229
|
id: string;
|
|
217
230
|
};
|
|
218
231
|
} | undefined;
|
|
219
|
-
|
|
220
|
-
id: string;
|
|
221
|
-
createdAt: string;
|
|
222
|
-
updatedAt: string;
|
|
223
|
-
locale: string;
|
|
224
|
-
contentType: {
|
|
232
|
+
contentType?: {
|
|
225
233
|
sys: {
|
|
226
234
|
type: "Link";
|
|
227
235
|
linkType: "ContentType";
|
|
228
236
|
id: string;
|
|
229
237
|
};
|
|
230
|
-
};
|
|
238
|
+
} | undefined;
|
|
239
|
+
id: string;
|
|
231
240
|
};
|
|
232
241
|
fields: {};
|
|
233
|
-
|
|
242
|
+
}, {
|
|
243
|
+
metadata?: {
|
|
234
244
|
tags: {
|
|
235
245
|
sys: {
|
|
236
246
|
type: "Link";
|
|
@@ -238,9 +248,12 @@ export declare const Entry: z.ZodObject<{
|
|
|
238
248
|
id: string;
|
|
239
249
|
};
|
|
240
250
|
}[];
|
|
241
|
-
};
|
|
242
|
-
}, {
|
|
251
|
+
} | undefined;
|
|
243
252
|
sys: {
|
|
253
|
+
type?: string | undefined;
|
|
254
|
+
createdAt?: string | undefined;
|
|
255
|
+
updatedAt?: string | undefined;
|
|
256
|
+
locale?: string | undefined;
|
|
244
257
|
revision?: number | undefined;
|
|
245
258
|
space?: {
|
|
246
259
|
sys: {
|
|
@@ -256,28 +269,15 @@ export declare const Entry: z.ZodObject<{
|
|
|
256
269
|
id: string;
|
|
257
270
|
};
|
|
258
271
|
} | undefined;
|
|
259
|
-
|
|
260
|
-
id: string;
|
|
261
|
-
createdAt: string;
|
|
262
|
-
updatedAt: string;
|
|
263
|
-
locale: string;
|
|
264
|
-
contentType: {
|
|
272
|
+
contentType?: {
|
|
265
273
|
sys: {
|
|
266
274
|
type: "Link";
|
|
267
275
|
linkType: "ContentType";
|
|
268
276
|
id: string;
|
|
269
277
|
};
|
|
270
|
-
};
|
|
278
|
+
} | undefined;
|
|
279
|
+
id: string;
|
|
271
280
|
};
|
|
272
281
|
fields: {};
|
|
273
|
-
metadata: {
|
|
274
|
-
tags: {
|
|
275
|
-
sys: {
|
|
276
|
-
type: "Link";
|
|
277
|
-
linkType: "Tag";
|
|
278
|
-
id: string;
|
|
279
|
-
};
|
|
280
|
-
}[];
|
|
281
|
-
};
|
|
282
282
|
}>;
|
|
283
283
|
export declare type Entry = z.infer<typeof Entry>;
|