@ninetailed/experience.js-utils-contentful 2.1.2-beta.1 → 2.2.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/index.esm.js +49 -82
- package/index.umd.js +49 -94
- package/lib/AudienceMapper.d.ts +2 -3
- package/lib/ExperienceMapper.d.ts +6 -6
- package/lib/isAudienceEntry.d.ts +26 -26
- package/lib/isEntry.d.ts +26 -26
- package/lib/isExperienceEntry.d.ts +68 -68
- package/package.json +4 -3
- package/types/AudienceEntry.d.ts +49 -49
- package/types/Entry.d.ts +1 -1
- package/types/ExperienceEntry.d.ts +535 -519
- package/types/ExperimentEntry.d.ts +2185 -0
- package/types/index.d.ts +1 -0
|
@@ -1,5 +1,18 @@
|
|
|
1
1
|
export declare const isExperienceEntry: (entry?: {
|
|
2
|
+
metadata?: {
|
|
3
|
+
tags: {
|
|
4
|
+
sys: {
|
|
5
|
+
type: "Link";
|
|
6
|
+
id: string;
|
|
7
|
+
linkType: "Tag";
|
|
8
|
+
};
|
|
9
|
+
}[];
|
|
10
|
+
} | undefined;
|
|
2
11
|
sys: {
|
|
12
|
+
type?: string | undefined;
|
|
13
|
+
createdAt?: string | undefined;
|
|
14
|
+
updatedAt?: string | undefined;
|
|
15
|
+
locale?: string | undefined;
|
|
3
16
|
revision?: number | undefined;
|
|
4
17
|
space?: {
|
|
5
18
|
sys: {
|
|
@@ -15,21 +28,18 @@ export declare const isExperienceEntry: (entry?: {
|
|
|
15
28
|
linkType: "Environment";
|
|
16
29
|
};
|
|
17
30
|
} | undefined;
|
|
18
|
-
|
|
19
|
-
id: string;
|
|
20
|
-
createdAt: string;
|
|
21
|
-
updatedAt: string;
|
|
22
|
-
locale: string;
|
|
23
|
-
contentType: {
|
|
31
|
+
contentType?: {
|
|
24
32
|
sys: {
|
|
25
33
|
type: "Link";
|
|
26
34
|
id: string;
|
|
27
35
|
linkType: "ContentType";
|
|
28
36
|
};
|
|
29
|
-
};
|
|
37
|
+
} | undefined;
|
|
38
|
+
id: string;
|
|
30
39
|
};
|
|
31
40
|
fields: {};
|
|
32
|
-
|
|
41
|
+
} | undefined) => entry is {
|
|
42
|
+
metadata?: {
|
|
33
43
|
tags: {
|
|
34
44
|
sys: {
|
|
35
45
|
type: "Link";
|
|
@@ -37,9 +47,12 @@ export declare const isExperienceEntry: (entry?: {
|
|
|
37
47
|
linkType: "Tag";
|
|
38
48
|
};
|
|
39
49
|
}[];
|
|
40
|
-
};
|
|
41
|
-
} | undefined) => entry is {
|
|
50
|
+
} | undefined;
|
|
42
51
|
sys: {
|
|
52
|
+
type?: string | undefined;
|
|
53
|
+
createdAt?: string | undefined;
|
|
54
|
+
updatedAt?: string | undefined;
|
|
55
|
+
locale?: string | undefined;
|
|
43
56
|
revision?: number | undefined;
|
|
44
57
|
space?: {
|
|
45
58
|
sys: {
|
|
@@ -55,35 +68,31 @@ export declare const isExperienceEntry: (entry?: {
|
|
|
55
68
|
linkType: "Environment";
|
|
56
69
|
};
|
|
57
70
|
} | undefined;
|
|
58
|
-
|
|
59
|
-
id: string;
|
|
60
|
-
createdAt: string;
|
|
61
|
-
updatedAt: string;
|
|
62
|
-
locale: string;
|
|
63
|
-
contentType: {
|
|
71
|
+
contentType?: {
|
|
64
72
|
sys: {
|
|
65
73
|
type: "Link";
|
|
66
74
|
id: string;
|
|
67
75
|
linkType: "ContentType";
|
|
68
76
|
};
|
|
69
|
-
};
|
|
77
|
+
} | undefined;
|
|
78
|
+
id: string;
|
|
70
79
|
};
|
|
71
80
|
fields: {
|
|
72
|
-
nt_config?: {
|
|
73
|
-
distribution: number[];
|
|
74
|
-
traffic: number;
|
|
75
|
-
components: {
|
|
76
|
-
baseline: {
|
|
77
|
-
id: string;
|
|
78
|
-
};
|
|
79
|
-
variants: {
|
|
80
|
-
id: string;
|
|
81
|
-
hidden: boolean;
|
|
82
|
-
}[];
|
|
83
|
-
}[];
|
|
84
|
-
} | null | undefined;
|
|
85
81
|
nt_audience?: {
|
|
82
|
+
metadata?: {
|
|
83
|
+
tags: {
|
|
84
|
+
sys: {
|
|
85
|
+
type: "Link";
|
|
86
|
+
id: string;
|
|
87
|
+
linkType: "Tag";
|
|
88
|
+
};
|
|
89
|
+
}[];
|
|
90
|
+
} | undefined;
|
|
86
91
|
sys: {
|
|
92
|
+
type?: string | undefined;
|
|
93
|
+
createdAt?: string | undefined;
|
|
94
|
+
updatedAt?: string | undefined;
|
|
95
|
+
locale?: string | undefined;
|
|
87
96
|
revision?: number | undefined;
|
|
88
97
|
space?: {
|
|
89
98
|
sys: {
|
|
@@ -99,24 +108,37 @@ export declare const isExperienceEntry: (entry?: {
|
|
|
99
108
|
linkType: "Environment";
|
|
100
109
|
};
|
|
101
110
|
} | undefined;
|
|
102
|
-
|
|
103
|
-
id: string;
|
|
104
|
-
createdAt: string;
|
|
105
|
-
updatedAt: string;
|
|
106
|
-
locale: string;
|
|
107
|
-
contentType: {
|
|
111
|
+
contentType?: {
|
|
108
112
|
sys: {
|
|
109
113
|
type: "Link";
|
|
110
114
|
id: string;
|
|
111
115
|
linkType: "ContentType";
|
|
112
116
|
};
|
|
113
|
-
};
|
|
117
|
+
} | undefined;
|
|
118
|
+
id: string;
|
|
114
119
|
};
|
|
115
120
|
fields: {
|
|
116
121
|
nt_name: string;
|
|
117
122
|
nt_audience_id: string;
|
|
118
123
|
};
|
|
119
|
-
|
|
124
|
+
} | null | undefined;
|
|
125
|
+
nt_name: string;
|
|
126
|
+
nt_type: "nt_experiment" | "nt_personalization";
|
|
127
|
+
nt_config: {
|
|
128
|
+
distribution: number[];
|
|
129
|
+
traffic: number;
|
|
130
|
+
components: {
|
|
131
|
+
baseline: {
|
|
132
|
+
id: string;
|
|
133
|
+
};
|
|
134
|
+
variants: {
|
|
135
|
+
id: string;
|
|
136
|
+
hidden: boolean;
|
|
137
|
+
}[];
|
|
138
|
+
}[];
|
|
139
|
+
};
|
|
140
|
+
nt_variants: {
|
|
141
|
+
metadata?: {
|
|
120
142
|
tags: {
|
|
121
143
|
sys: {
|
|
122
144
|
type: "Link";
|
|
@@ -124,12 +146,12 @@ export declare const isExperienceEntry: (entry?: {
|
|
|
124
146
|
linkType: "Tag";
|
|
125
147
|
};
|
|
126
148
|
}[];
|
|
127
|
-
};
|
|
128
|
-
} | null | undefined;
|
|
129
|
-
nt_name: string;
|
|
130
|
-
nt_type: "nt_experiment" | "nt_personalization";
|
|
131
|
-
nt_variants: {
|
|
149
|
+
} | undefined;
|
|
132
150
|
sys: {
|
|
151
|
+
type?: string | undefined;
|
|
152
|
+
createdAt?: string | undefined;
|
|
153
|
+
updatedAt?: string | undefined;
|
|
154
|
+
locale?: string | undefined;
|
|
133
155
|
revision?: number | undefined;
|
|
134
156
|
space?: {
|
|
135
157
|
sys: {
|
|
@@ -145,38 +167,16 @@ export declare const isExperienceEntry: (entry?: {
|
|
|
145
167
|
linkType: "Environment";
|
|
146
168
|
};
|
|
147
169
|
} | undefined;
|
|
148
|
-
|
|
149
|
-
id: string;
|
|
150
|
-
createdAt: string;
|
|
151
|
-
updatedAt: string;
|
|
152
|
-
locale: string;
|
|
153
|
-
contentType: {
|
|
170
|
+
contentType?: {
|
|
154
171
|
sys: {
|
|
155
172
|
type: "Link";
|
|
156
173
|
id: string;
|
|
157
174
|
linkType: "ContentType";
|
|
158
175
|
};
|
|
159
|
-
};
|
|
160
|
-
};
|
|
161
|
-
fields: {};
|
|
162
|
-
metadata: {
|
|
163
|
-
tags: {
|
|
164
|
-
sys: {
|
|
165
|
-
type: "Link";
|
|
166
|
-
id: string;
|
|
167
|
-
linkType: "Tag";
|
|
168
|
-
};
|
|
169
|
-
}[];
|
|
170
|
-
};
|
|
171
|
-
}[];
|
|
172
|
-
};
|
|
173
|
-
metadata: {
|
|
174
|
-
tags: {
|
|
175
|
-
sys: {
|
|
176
|
-
type: "Link";
|
|
176
|
+
} | undefined;
|
|
177
177
|
id: string;
|
|
178
|
-
linkType: "Tag";
|
|
179
178
|
};
|
|
179
|
+
fields: {};
|
|
180
180
|
}[];
|
|
181
181
|
};
|
|
182
182
|
};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@ninetailed/experience.js-utils-contentful",
|
|
3
|
-
"version": "2.
|
|
3
|
+
"version": "2.2.0-beta.0",
|
|
4
4
|
"peerDependencies": {
|
|
5
5
|
"contentful": "^9.1.32"
|
|
6
6
|
},
|
|
@@ -8,9 +8,10 @@
|
|
|
8
8
|
"module": "./index.esm.js",
|
|
9
9
|
"typings": "./index.d.ts",
|
|
10
10
|
"dependencies": {
|
|
11
|
-
"@ninetailed/experience.js": "
|
|
11
|
+
"@ninetailed/experience.js-utils": "0.0.1",
|
|
12
|
+
"@ninetailed/experience.js": "2.2.0-beta.0",
|
|
12
13
|
"analytics": "^0.8.0",
|
|
13
|
-
"@ninetailed/experience.js-shared": "2.
|
|
14
|
+
"@ninetailed/experience.js-shared": "2.2.0-beta.0",
|
|
14
15
|
"uuid": "^8.3.2",
|
|
15
16
|
"ts-toolbelt": "^9.6.0",
|
|
16
17
|
"locale-enum": "^1.1.1",
|
package/types/AudienceEntry.d.ts
CHANGED
|
@@ -21,11 +21,11 @@ export declare const AudienceEntry: z.ZodObject<z.extendShape<{
|
|
|
21
21
|
/**
|
|
22
22
|
* The internal id of the audience (Short Text)
|
|
23
23
|
*/
|
|
24
|
-
type: z.ZodString
|
|
24
|
+
type: z.ZodOptional<z.ZodString>;
|
|
25
25
|
id: z.ZodString;
|
|
26
|
-
createdAt: z.ZodString
|
|
27
|
-
updatedAt: z.ZodString
|
|
28
|
-
locale: z.ZodString
|
|
26
|
+
createdAt: z.ZodOptional<z.ZodString>;
|
|
27
|
+
updatedAt: z.ZodOptional<z.ZodString>;
|
|
28
|
+
locale: z.ZodOptional<z.ZodString>;
|
|
29
29
|
revision: z.ZodOptional<z.ZodNumber>;
|
|
30
30
|
space: z.ZodOptional<z.ZodObject<{
|
|
31
31
|
sys: z.ZodObject<z.extendShape<{
|
|
@@ -85,7 +85,7 @@ export declare const AudienceEntry: z.ZodObject<z.extendShape<{
|
|
|
85
85
|
linkType: "Environment";
|
|
86
86
|
};
|
|
87
87
|
}>>;
|
|
88
|
-
contentType: z.ZodObject<{
|
|
88
|
+
contentType: z.ZodOptional<z.ZodObject<{
|
|
89
89
|
sys: z.ZodObject<z.extendShape<{
|
|
90
90
|
type: z.ZodLiteral<"Link">;
|
|
91
91
|
linkType: z.ZodString;
|
|
@@ -113,8 +113,12 @@ export declare const AudienceEntry: z.ZodObject<z.extendShape<{
|
|
|
113
113
|
id: string;
|
|
114
114
|
linkType: "ContentType";
|
|
115
115
|
};
|
|
116
|
-
}
|
|
116
|
+
}>>;
|
|
117
117
|
}, "strip", z.ZodTypeAny, {
|
|
118
|
+
type?: string | undefined;
|
|
119
|
+
createdAt?: string | undefined;
|
|
120
|
+
updatedAt?: string | undefined;
|
|
121
|
+
locale?: string | undefined;
|
|
118
122
|
revision?: number | undefined;
|
|
119
123
|
space?: {
|
|
120
124
|
sys: {
|
|
@@ -130,19 +134,19 @@ export declare const AudienceEntry: z.ZodObject<z.extendShape<{
|
|
|
130
134
|
linkType: "Environment";
|
|
131
135
|
};
|
|
132
136
|
} | undefined;
|
|
133
|
-
|
|
134
|
-
id: string;
|
|
135
|
-
createdAt: string;
|
|
136
|
-
updatedAt: string;
|
|
137
|
-
locale: string;
|
|
138
|
-
contentType: {
|
|
137
|
+
contentType?: {
|
|
139
138
|
sys: {
|
|
140
139
|
type: "Link";
|
|
141
140
|
id: string;
|
|
142
141
|
linkType: "ContentType";
|
|
143
142
|
};
|
|
144
|
-
};
|
|
143
|
+
} | undefined;
|
|
144
|
+
id: string;
|
|
145
145
|
}, {
|
|
146
|
+
type?: string | undefined;
|
|
147
|
+
createdAt?: string | undefined;
|
|
148
|
+
updatedAt?: string | undefined;
|
|
149
|
+
locale?: string | undefined;
|
|
146
150
|
revision?: number | undefined;
|
|
147
151
|
space?: {
|
|
148
152
|
sys: {
|
|
@@ -158,21 +162,17 @@ export declare const AudienceEntry: z.ZodObject<z.extendShape<{
|
|
|
158
162
|
linkType: "Environment";
|
|
159
163
|
};
|
|
160
164
|
} | undefined;
|
|
161
|
-
|
|
162
|
-
id: string;
|
|
163
|
-
createdAt: string;
|
|
164
|
-
updatedAt: string;
|
|
165
|
-
locale: string;
|
|
166
|
-
contentType: {
|
|
165
|
+
contentType?: {
|
|
167
166
|
sys: {
|
|
168
167
|
type: "Link";
|
|
169
168
|
id: string;
|
|
170
169
|
linkType: "ContentType";
|
|
171
170
|
};
|
|
172
|
-
};
|
|
171
|
+
} | undefined;
|
|
172
|
+
id: string;
|
|
173
173
|
}>;
|
|
174
|
-
fields: z.ZodObject<{}, "
|
|
175
|
-
metadata: z.ZodObject<{
|
|
174
|
+
fields: z.ZodObject<{}, "passthrough", z.ZodTypeAny, {}, {}>;
|
|
175
|
+
metadata: z.ZodOptional<z.ZodObject<{
|
|
176
176
|
tags: z.ZodArray<z.ZodObject<{
|
|
177
177
|
sys: z.ZodObject<z.extendShape<{
|
|
178
178
|
type: z.ZodLiteral<"Link">;
|
|
@@ -218,7 +218,7 @@ export declare const AudienceEntry: z.ZodObject<z.extendShape<{
|
|
|
218
218
|
linkType: "Tag";
|
|
219
219
|
};
|
|
220
220
|
}[];
|
|
221
|
-
}
|
|
221
|
+
}>>;
|
|
222
222
|
}, {
|
|
223
223
|
fields: z.ZodObject<{
|
|
224
224
|
/**
|
|
@@ -237,7 +237,20 @@ export declare const AudienceEntry: z.ZodObject<z.extendShape<{
|
|
|
237
237
|
nt_audience_id: string;
|
|
238
238
|
}>;
|
|
239
239
|
}>, "strip", z.ZodTypeAny, {
|
|
240
|
+
metadata?: {
|
|
241
|
+
tags: {
|
|
242
|
+
sys: {
|
|
243
|
+
type: "Link";
|
|
244
|
+
id: string;
|
|
245
|
+
linkType: "Tag";
|
|
246
|
+
};
|
|
247
|
+
}[];
|
|
248
|
+
} | undefined;
|
|
240
249
|
sys: {
|
|
250
|
+
type?: string | undefined;
|
|
251
|
+
createdAt?: string | undefined;
|
|
252
|
+
updatedAt?: string | undefined;
|
|
253
|
+
locale?: string | undefined;
|
|
241
254
|
revision?: number | undefined;
|
|
242
255
|
space?: {
|
|
243
256
|
sys: {
|
|
@@ -253,24 +266,21 @@ export declare const AudienceEntry: z.ZodObject<z.extendShape<{
|
|
|
253
266
|
linkType: "Environment";
|
|
254
267
|
};
|
|
255
268
|
} | undefined;
|
|
256
|
-
|
|
257
|
-
id: string;
|
|
258
|
-
createdAt: string;
|
|
259
|
-
updatedAt: string;
|
|
260
|
-
locale: string;
|
|
261
|
-
contentType: {
|
|
269
|
+
contentType?: {
|
|
262
270
|
sys: {
|
|
263
271
|
type: "Link";
|
|
264
272
|
id: string;
|
|
265
273
|
linkType: "ContentType";
|
|
266
274
|
};
|
|
267
|
-
};
|
|
275
|
+
} | undefined;
|
|
276
|
+
id: string;
|
|
268
277
|
};
|
|
269
278
|
fields: {
|
|
270
279
|
nt_name: string;
|
|
271
280
|
nt_audience_id: string;
|
|
272
281
|
};
|
|
273
|
-
|
|
282
|
+
}, {
|
|
283
|
+
metadata?: {
|
|
274
284
|
tags: {
|
|
275
285
|
sys: {
|
|
276
286
|
type: "Link";
|
|
@@ -278,9 +288,12 @@ export declare const AudienceEntry: z.ZodObject<z.extendShape<{
|
|
|
278
288
|
linkType: "Tag";
|
|
279
289
|
};
|
|
280
290
|
}[];
|
|
281
|
-
};
|
|
282
|
-
}, {
|
|
291
|
+
} | undefined;
|
|
283
292
|
sys: {
|
|
293
|
+
type?: string | undefined;
|
|
294
|
+
createdAt?: string | undefined;
|
|
295
|
+
updatedAt?: string | undefined;
|
|
296
|
+
locale?: string | undefined;
|
|
284
297
|
revision?: number | undefined;
|
|
285
298
|
space?: {
|
|
286
299
|
sys: {
|
|
@@ -296,31 +309,18 @@ export declare const AudienceEntry: z.ZodObject<z.extendShape<{
|
|
|
296
309
|
linkType: "Environment";
|
|
297
310
|
};
|
|
298
311
|
} | undefined;
|
|
299
|
-
|
|
300
|
-
id: string;
|
|
301
|
-
createdAt: string;
|
|
302
|
-
updatedAt: string;
|
|
303
|
-
locale: string;
|
|
304
|
-
contentType: {
|
|
312
|
+
contentType?: {
|
|
305
313
|
sys: {
|
|
306
314
|
type: "Link";
|
|
307
315
|
id: string;
|
|
308
316
|
linkType: "ContentType";
|
|
309
317
|
};
|
|
310
|
-
};
|
|
318
|
+
} | undefined;
|
|
319
|
+
id: string;
|
|
311
320
|
};
|
|
312
321
|
fields: {
|
|
313
322
|
nt_name: string;
|
|
314
323
|
nt_audience_id: string;
|
|
315
324
|
};
|
|
316
|
-
metadata: {
|
|
317
|
-
tags: {
|
|
318
|
-
sys: {
|
|
319
|
-
type: "Link";
|
|
320
|
-
id: string;
|
|
321
|
-
linkType: "Tag";
|
|
322
|
-
};
|
|
323
|
-
}[];
|
|
324
|
-
};
|
|
325
325
|
}>;
|
|
326
326
|
export declare type AudienceEntry = z.infer<typeof AudienceEntry>;
|
package/types/Entry.d.ts
CHANGED
|
@@ -151,7 +151,7 @@ export declare const Entry: z.ZodObject<{
|
|
|
151
151
|
} | undefined;
|
|
152
152
|
id: string;
|
|
153
153
|
}>;
|
|
154
|
-
fields: z.ZodObject<{}, "
|
|
154
|
+
fields: z.ZodObject<{}, "passthrough", z.ZodTypeAny, {}, {}>;
|
|
155
155
|
metadata: z.ZodOptional<z.ZodObject<{
|
|
156
156
|
tags: z.ZodArray<z.ZodObject<{
|
|
157
157
|
sys: z.ZodObject<z.extendShape<{
|