@ninetailed/experience.js-utils-contentful 3.3.1 → 3.3.3-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.cjs +9 -1
- package/index.js +9 -1
- package/package.json +4 -4
- package/types/BaselineWithExperiencesEntry.d.ts +16 -0
- package/types/ExperienceEntry.d.ts +370 -261
package/index.cjs
CHANGED
|
@@ -104,6 +104,10 @@ const ExperienceEntryFields = zod.z.object({
|
|
|
104
104
|
* The name of the experience (Short Text)
|
|
105
105
|
*/
|
|
106
106
|
nt_name: zod.z.string(),
|
|
107
|
+
/**
|
|
108
|
+
* The description of the experience (Short Text)
|
|
109
|
+
*/
|
|
110
|
+
nt_description: zod.z.string().optional(),
|
|
107
111
|
/**
|
|
108
112
|
* The type if the experience (nt_experiment | nt_personalization)
|
|
109
113
|
*/
|
|
@@ -164,12 +168,15 @@ const ExperimentEntry = ExperienceEntry.extend({
|
|
|
164
168
|
|
|
165
169
|
function mapAudience(ctfAudienceEntry) {
|
|
166
170
|
return {
|
|
167
|
-
id: ctfAudienceEntry.fields.nt_audience_id
|
|
171
|
+
id: ctfAudienceEntry.fields.nt_audience_id,
|
|
172
|
+
name: ctfAudienceEntry.fields.nt_name,
|
|
173
|
+
description: ctfAudienceEntry.fields.nt_description || ''
|
|
168
174
|
};
|
|
169
175
|
}
|
|
170
176
|
function createExperience(id, fields, variants) {
|
|
171
177
|
const {
|
|
172
178
|
nt_name,
|
|
179
|
+
nt_description,
|
|
173
180
|
nt_type,
|
|
174
181
|
nt_audience,
|
|
175
182
|
nt_config
|
|
@@ -177,6 +184,7 @@ function createExperience(id, fields, variants) {
|
|
|
177
184
|
return Object.assign(Object.assign({
|
|
178
185
|
id,
|
|
179
186
|
name: nt_name,
|
|
187
|
+
description: nt_description || '',
|
|
180
188
|
type: nt_type
|
|
181
189
|
}, nt_audience ? {
|
|
182
190
|
audience: mapAudience(nt_audience)
|
package/index.js
CHANGED
|
@@ -100,6 +100,10 @@ const ExperienceEntryFields = z.object({
|
|
|
100
100
|
* The name of the experience (Short Text)
|
|
101
101
|
*/
|
|
102
102
|
nt_name: z.string(),
|
|
103
|
+
/**
|
|
104
|
+
* The description of the experience (Short Text)
|
|
105
|
+
*/
|
|
106
|
+
nt_description: z.string().optional(),
|
|
103
107
|
/**
|
|
104
108
|
* The type if the experience (nt_experiment | nt_personalization)
|
|
105
109
|
*/
|
|
@@ -160,12 +164,15 @@ const ExperimentEntry = ExperienceEntry.extend({
|
|
|
160
164
|
|
|
161
165
|
function mapAudience(ctfAudienceEntry) {
|
|
162
166
|
return {
|
|
163
|
-
id: ctfAudienceEntry.fields.nt_audience_id
|
|
167
|
+
id: ctfAudienceEntry.fields.nt_audience_id,
|
|
168
|
+
name: ctfAudienceEntry.fields.nt_name,
|
|
169
|
+
description: ctfAudienceEntry.fields.nt_description || ''
|
|
164
170
|
};
|
|
165
171
|
}
|
|
166
172
|
function createExperience(id, fields, variants) {
|
|
167
173
|
const {
|
|
168
174
|
nt_name,
|
|
175
|
+
nt_description,
|
|
169
176
|
nt_type,
|
|
170
177
|
nt_audience,
|
|
171
178
|
nt_config
|
|
@@ -173,6 +180,7 @@ function createExperience(id, fields, variants) {
|
|
|
173
180
|
return Object.assign(Object.assign({
|
|
174
181
|
id,
|
|
175
182
|
name: nt_name,
|
|
183
|
+
description: nt_description || '',
|
|
176
184
|
type: nt_type
|
|
177
185
|
}, nt_audience ? {
|
|
178
186
|
audience: mapAudience(nt_audience)
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@ninetailed/experience.js-utils-contentful",
|
|
3
|
-
"version": "3.3.
|
|
3
|
+
"version": "3.3.3-beta.0",
|
|
4
4
|
"peerDependencies": {
|
|
5
5
|
"contentful": "^9.1.32"
|
|
6
6
|
},
|
|
@@ -9,9 +9,9 @@
|
|
|
9
9
|
"type": "module",
|
|
10
10
|
"types": "./index.d.ts",
|
|
11
11
|
"dependencies": {
|
|
12
|
-
"@ninetailed/experience.js-utils": "3.3.
|
|
13
|
-
"@ninetailed/experience.js": "3.3.
|
|
14
|
-
"@ninetailed/experience.js-shared": "3.3.
|
|
12
|
+
"@ninetailed/experience.js-utils": "3.3.3-beta.0",
|
|
13
|
+
"@ninetailed/experience.js": "3.3.3-beta.0",
|
|
14
|
+
"@ninetailed/experience.js-shared": "3.3.3-beta.0",
|
|
15
15
|
"zod": "3.20.2"
|
|
16
16
|
}
|
|
17
17
|
}
|
|
@@ -205,6 +205,7 @@ declare const BaselineWithExperiencesEntryFields: z.ZodObject<z.extendShape<{},
|
|
|
205
205
|
}, {
|
|
206
206
|
fields: z.ZodObject<{
|
|
207
207
|
nt_name: z.ZodString;
|
|
208
|
+
nt_description: z.ZodOptional<z.ZodString>;
|
|
208
209
|
nt_type: z.ZodUnion<[z.ZodString, z.ZodString]>;
|
|
209
210
|
nt_config: z.ZodEffects<z.ZodDefault<z.ZodNullable<z.ZodOptional<z.ZodObject<{
|
|
210
211
|
distribution: z.ZodDefault<z.ZodOptional<z.ZodArray<z.ZodNumber, "many">>>;
|
|
@@ -923,6 +924,7 @@ declare const BaselineWithExperiencesEntryFields: z.ZodObject<z.extendShape<{},
|
|
|
923
924
|
nt_audience_id: string;
|
|
924
925
|
};
|
|
925
926
|
} | null | undefined;
|
|
927
|
+
nt_description?: string | undefined;
|
|
926
928
|
nt_variants?: {
|
|
927
929
|
metadata?: {
|
|
928
930
|
tags: {
|
|
@@ -1025,6 +1027,7 @@ declare const BaselineWithExperiencesEntryFields: z.ZodObject<z.extendShape<{},
|
|
|
1025
1027
|
nt_audience_id: string;
|
|
1026
1028
|
};
|
|
1027
1029
|
} | null | undefined;
|
|
1030
|
+
nt_description?: string | undefined;
|
|
1028
1031
|
nt_config?: {
|
|
1029
1032
|
distribution?: number[] | undefined;
|
|
1030
1033
|
traffic?: number | undefined;
|
|
@@ -1167,6 +1170,7 @@ declare const BaselineWithExperiencesEntryFields: z.ZodObject<z.extendShape<{},
|
|
|
1167
1170
|
nt_audience_id: string;
|
|
1168
1171
|
};
|
|
1169
1172
|
} | null | undefined;
|
|
1173
|
+
nt_description?: string | undefined;
|
|
1170
1174
|
nt_variants?: {
|
|
1171
1175
|
metadata?: {
|
|
1172
1176
|
tags: {
|
|
@@ -1309,6 +1313,7 @@ declare const BaselineWithExperiencesEntryFields: z.ZodObject<z.extendShape<{},
|
|
|
1309
1313
|
nt_audience_id: string;
|
|
1310
1314
|
};
|
|
1311
1315
|
} | null | undefined;
|
|
1316
|
+
nt_description?: string | undefined;
|
|
1312
1317
|
nt_config?: {
|
|
1313
1318
|
distribution?: number[] | undefined;
|
|
1314
1319
|
traffic?: number | undefined;
|
|
@@ -1453,6 +1458,7 @@ declare const BaselineWithExperiencesEntryFields: z.ZodObject<z.extendShape<{},
|
|
|
1453
1458
|
nt_audience_id: string;
|
|
1454
1459
|
};
|
|
1455
1460
|
} | null | undefined;
|
|
1461
|
+
nt_description?: string | undefined;
|
|
1456
1462
|
nt_variants?: {
|
|
1457
1463
|
metadata?: {
|
|
1458
1464
|
tags: {
|
|
@@ -1597,6 +1603,7 @@ declare const BaselineWithExperiencesEntryFields: z.ZodObject<z.extendShape<{},
|
|
|
1597
1603
|
nt_audience_id: string;
|
|
1598
1604
|
};
|
|
1599
1605
|
} | null | undefined;
|
|
1606
|
+
nt_description?: string | undefined;
|
|
1600
1607
|
nt_config?: {
|
|
1601
1608
|
distribution?: number[] | undefined;
|
|
1602
1609
|
traffic?: number | undefined;
|
|
@@ -2062,6 +2069,7 @@ export declare const BaselineWithExperiencesEntrySchema: z.ZodObject<z.extendSha
|
|
|
2062
2069
|
}, {
|
|
2063
2070
|
fields: z.ZodObject<{
|
|
2064
2071
|
nt_name: z.ZodString;
|
|
2072
|
+
nt_description: z.ZodOptional<z.ZodString>;
|
|
2065
2073
|
nt_type: z.ZodUnion<[z.ZodString, z.ZodString]>;
|
|
2066
2074
|
nt_config: z.ZodEffects<z.ZodDefault<z.ZodNullable<z.ZodOptional<z.ZodObject<{
|
|
2067
2075
|
distribution: z.ZodDefault<z.ZodOptional<z.ZodArray<z.ZodNumber, "many">>>;
|
|
@@ -2780,6 +2788,7 @@ export declare const BaselineWithExperiencesEntrySchema: z.ZodObject<z.extendSha
|
|
|
2780
2788
|
nt_audience_id: string;
|
|
2781
2789
|
};
|
|
2782
2790
|
} | null | undefined;
|
|
2791
|
+
nt_description?: string | undefined;
|
|
2783
2792
|
nt_variants?: {
|
|
2784
2793
|
metadata?: {
|
|
2785
2794
|
tags: {
|
|
@@ -2882,6 +2891,7 @@ export declare const BaselineWithExperiencesEntrySchema: z.ZodObject<z.extendSha
|
|
|
2882
2891
|
nt_audience_id: string;
|
|
2883
2892
|
};
|
|
2884
2893
|
} | null | undefined;
|
|
2894
|
+
nt_description?: string | undefined;
|
|
2885
2895
|
nt_config?: {
|
|
2886
2896
|
distribution?: number[] | undefined;
|
|
2887
2897
|
traffic?: number | undefined;
|
|
@@ -3024,6 +3034,7 @@ export declare const BaselineWithExperiencesEntrySchema: z.ZodObject<z.extendSha
|
|
|
3024
3034
|
nt_audience_id: string;
|
|
3025
3035
|
};
|
|
3026
3036
|
} | null | undefined;
|
|
3037
|
+
nt_description?: string | undefined;
|
|
3027
3038
|
nt_variants?: {
|
|
3028
3039
|
metadata?: {
|
|
3029
3040
|
tags: {
|
|
@@ -3166,6 +3177,7 @@ export declare const BaselineWithExperiencesEntrySchema: z.ZodObject<z.extendSha
|
|
|
3166
3177
|
nt_audience_id: string;
|
|
3167
3178
|
};
|
|
3168
3179
|
} | null | undefined;
|
|
3180
|
+
nt_description?: string | undefined;
|
|
3169
3181
|
nt_config?: {
|
|
3170
3182
|
distribution?: number[] | undefined;
|
|
3171
3183
|
traffic?: number | undefined;
|
|
@@ -3310,6 +3322,7 @@ export declare const BaselineWithExperiencesEntrySchema: z.ZodObject<z.extendSha
|
|
|
3310
3322
|
nt_audience_id: string;
|
|
3311
3323
|
};
|
|
3312
3324
|
} | null | undefined;
|
|
3325
|
+
nt_description?: string | undefined;
|
|
3313
3326
|
nt_variants?: {
|
|
3314
3327
|
metadata?: {
|
|
3315
3328
|
tags: {
|
|
@@ -3454,6 +3467,7 @@ export declare const BaselineWithExperiencesEntrySchema: z.ZodObject<z.extendSha
|
|
|
3454
3467
|
nt_audience_id: string;
|
|
3455
3468
|
};
|
|
3456
3469
|
} | null | undefined;
|
|
3470
|
+
nt_description?: string | undefined;
|
|
3457
3471
|
nt_config?: {
|
|
3458
3472
|
distribution?: number[] | undefined;
|
|
3459
3473
|
traffic?: number | undefined;
|
|
@@ -3638,6 +3652,7 @@ export declare const BaselineWithExperiencesEntrySchema: z.ZodObject<z.extendSha
|
|
|
3638
3652
|
nt_audience_id: string;
|
|
3639
3653
|
};
|
|
3640
3654
|
} | null | undefined;
|
|
3655
|
+
nt_description?: string | undefined;
|
|
3641
3656
|
nt_variants?: {
|
|
3642
3657
|
metadata?: {
|
|
3643
3658
|
tags: {
|
|
@@ -3822,6 +3837,7 @@ export declare const BaselineWithExperiencesEntrySchema: z.ZodObject<z.extendSha
|
|
|
3822
3837
|
nt_audience_id: string;
|
|
3823
3838
|
};
|
|
3824
3839
|
} | null | undefined;
|
|
3840
|
+
nt_description?: string | undefined;
|
|
3825
3841
|
nt_config?: {
|
|
3826
3842
|
distribution?: number[] | undefined;
|
|
3827
3843
|
traffic?: number | undefined;
|