@ninetailed/experience.js-utils-contentful 3.0.0-beta.42 → 3.0.0-beta.44
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.js +3 -3
- package/package.json +4 -4
- package/types/BaselineWithExperiencesEntry.d.ts +121 -121
- package/types/ExperienceEntry.d.ts +929 -1090
- package/types/ExperimentEntry.d.ts +53 -53
- package/types/fixtures/experienceEntryWithoutVariants.d.ts +115 -0
package/index.js
CHANGED
|
@@ -115,7 +115,7 @@ const ExperienceEntryFields = z.object({
|
|
|
115
115
|
/**
|
|
116
116
|
* All used variants of the experience (Contentful references to other Content Types)
|
|
117
117
|
*/
|
|
118
|
-
nt_variants: z.array(EntrySchema).
|
|
118
|
+
nt_variants: z.array(EntrySchema).optional()
|
|
119
119
|
});
|
|
120
120
|
const ExperienceEntrySchema = EntrySchema.extend({
|
|
121
121
|
fields: ExperienceEntryFields
|
|
@@ -124,7 +124,7 @@ const parse = input => {
|
|
|
124
124
|
const output = ExperienceEntrySchema.parse(input);
|
|
125
125
|
return Object.assign(Object.assign({}, output), {
|
|
126
126
|
fields: Object.assign(Object.assign({}, output.fields), {
|
|
127
|
-
nt_variants: input.fields.nt_variants
|
|
127
|
+
nt_variants: input.fields.nt_variants || []
|
|
128
128
|
})
|
|
129
129
|
});
|
|
130
130
|
};
|
|
@@ -136,7 +136,7 @@ const safeParse = input => {
|
|
|
136
136
|
return Object.assign(Object.assign({}, output), {
|
|
137
137
|
data: Object.assign(Object.assign({}, output.data), {
|
|
138
138
|
fields: Object.assign(Object.assign({}, output.data.fields), {
|
|
139
|
-
nt_variants: input.fields.nt_variants
|
|
139
|
+
nt_variants: input.fields.nt_variants || []
|
|
140
140
|
})
|
|
141
141
|
})
|
|
142
142
|
});
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@ninetailed/experience.js-utils-contentful",
|
|
3
|
-
"version": "3.0.0-beta.
|
|
3
|
+
"version": "3.0.0-beta.44",
|
|
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.0.0-beta.
|
|
13
|
-
"@ninetailed/experience.js": "3.0.0-beta.
|
|
14
|
-
"@ninetailed/experience.js-shared": "3.0.0-beta.
|
|
12
|
+
"@ninetailed/experience.js-utils": "3.0.0-beta.44",
|
|
13
|
+
"@ninetailed/experience.js": "3.0.0-beta.44",
|
|
14
|
+
"@ninetailed/experience.js-shared": "3.0.0-beta.44",
|
|
15
15
|
"zod": "3.20.2"
|
|
16
16
|
}
|
|
17
17
|
}
|
|
@@ -603,7 +603,7 @@ declare const BaselineWithExperiencesEntryFields: z.ZodObject<z.extendShape<{},
|
|
|
603
603
|
nt_audience_id: string;
|
|
604
604
|
};
|
|
605
605
|
}>>>;
|
|
606
|
-
nt_variants: z.
|
|
606
|
+
nt_variants: z.ZodOptional<z.ZodArray<z.ZodObject<{
|
|
607
607
|
sys: z.ZodObject<{
|
|
608
608
|
type: z.ZodOptional<z.ZodString>;
|
|
609
609
|
id: z.ZodString;
|
|
@@ -938,22 +938,7 @@ declare const BaselineWithExperiencesEntryFields: z.ZodObject<z.extendShape<{},
|
|
|
938
938
|
nt_audience_id: string;
|
|
939
939
|
};
|
|
940
940
|
} | null | undefined;
|
|
941
|
-
|
|
942
|
-
nt_type: string;
|
|
943
|
-
nt_config: {
|
|
944
|
-
distribution: number[];
|
|
945
|
-
traffic: number;
|
|
946
|
-
components: {
|
|
947
|
-
baseline: {
|
|
948
|
-
id: string;
|
|
949
|
-
};
|
|
950
|
-
variants: {
|
|
951
|
-
id: string;
|
|
952
|
-
hidden: boolean;
|
|
953
|
-
}[];
|
|
954
|
-
}[];
|
|
955
|
-
};
|
|
956
|
-
nt_variants: {
|
|
941
|
+
nt_variants?: {
|
|
957
942
|
metadata?: {
|
|
958
943
|
tags: {
|
|
959
944
|
sys: {
|
|
@@ -995,7 +980,22 @@ declare const BaselineWithExperiencesEntryFields: z.ZodObject<z.extendShape<{},
|
|
|
995
980
|
fields: {
|
|
996
981
|
[x: string]: unknown;
|
|
997
982
|
};
|
|
998
|
-
}[];
|
|
983
|
+
}[] | undefined;
|
|
984
|
+
nt_name: string;
|
|
985
|
+
nt_type: string;
|
|
986
|
+
nt_config: {
|
|
987
|
+
distribution: number[];
|
|
988
|
+
traffic: number;
|
|
989
|
+
components: {
|
|
990
|
+
baseline: {
|
|
991
|
+
id: string;
|
|
992
|
+
};
|
|
993
|
+
variants: {
|
|
994
|
+
id: string;
|
|
995
|
+
hidden: boolean;
|
|
996
|
+
}[];
|
|
997
|
+
}[];
|
|
998
|
+
};
|
|
999
999
|
}, {
|
|
1000
1000
|
nt_audience?: {
|
|
1001
1001
|
metadata?: {
|
|
@@ -1186,22 +1186,7 @@ declare const BaselineWithExperiencesEntryFields: z.ZodObject<z.extendShape<{},
|
|
|
1186
1186
|
nt_audience_id: string;
|
|
1187
1187
|
};
|
|
1188
1188
|
} | null | undefined;
|
|
1189
|
-
|
|
1190
|
-
nt_type: string;
|
|
1191
|
-
nt_config: {
|
|
1192
|
-
distribution: number[];
|
|
1193
|
-
traffic: number;
|
|
1194
|
-
components: {
|
|
1195
|
-
baseline: {
|
|
1196
|
-
id: string;
|
|
1197
|
-
};
|
|
1198
|
-
variants: {
|
|
1199
|
-
id: string;
|
|
1200
|
-
hidden: boolean;
|
|
1201
|
-
}[];
|
|
1202
|
-
}[];
|
|
1203
|
-
};
|
|
1204
|
-
nt_variants: {
|
|
1189
|
+
nt_variants?: {
|
|
1205
1190
|
metadata?: {
|
|
1206
1191
|
tags: {
|
|
1207
1192
|
sys: {
|
|
@@ -1243,7 +1228,22 @@ declare const BaselineWithExperiencesEntryFields: z.ZodObject<z.extendShape<{},
|
|
|
1243
1228
|
fields: {
|
|
1244
1229
|
[x: string]: unknown;
|
|
1245
1230
|
};
|
|
1246
|
-
}[];
|
|
1231
|
+
}[] | undefined;
|
|
1232
|
+
nt_name: string;
|
|
1233
|
+
nt_type: string;
|
|
1234
|
+
nt_config: {
|
|
1235
|
+
distribution: number[];
|
|
1236
|
+
traffic: number;
|
|
1237
|
+
components: {
|
|
1238
|
+
baseline: {
|
|
1239
|
+
id: string;
|
|
1240
|
+
};
|
|
1241
|
+
variants: {
|
|
1242
|
+
id: string;
|
|
1243
|
+
hidden: boolean;
|
|
1244
|
+
}[];
|
|
1245
|
+
}[];
|
|
1246
|
+
};
|
|
1247
1247
|
};
|
|
1248
1248
|
}, {
|
|
1249
1249
|
metadata?: {
|
|
@@ -1477,22 +1477,7 @@ declare const BaselineWithExperiencesEntryFields: z.ZodObject<z.extendShape<{},
|
|
|
1477
1477
|
nt_audience_id: string;
|
|
1478
1478
|
};
|
|
1479
1479
|
} | null | undefined;
|
|
1480
|
-
|
|
1481
|
-
nt_type: string;
|
|
1482
|
-
nt_config: {
|
|
1483
|
-
distribution: number[];
|
|
1484
|
-
traffic: number;
|
|
1485
|
-
components: {
|
|
1486
|
-
baseline: {
|
|
1487
|
-
id: string;
|
|
1488
|
-
};
|
|
1489
|
-
variants: {
|
|
1490
|
-
id: string;
|
|
1491
|
-
hidden: boolean;
|
|
1492
|
-
}[];
|
|
1493
|
-
}[];
|
|
1494
|
-
};
|
|
1495
|
-
nt_variants: {
|
|
1480
|
+
nt_variants?: {
|
|
1496
1481
|
metadata?: {
|
|
1497
1482
|
tags: {
|
|
1498
1483
|
sys: {
|
|
@@ -1534,7 +1519,22 @@ declare const BaselineWithExperiencesEntryFields: z.ZodObject<z.extendShape<{},
|
|
|
1534
1519
|
fields: {
|
|
1535
1520
|
[x: string]: unknown;
|
|
1536
1521
|
};
|
|
1537
|
-
}[];
|
|
1522
|
+
}[] | undefined;
|
|
1523
|
+
nt_name: string;
|
|
1524
|
+
nt_type: string;
|
|
1525
|
+
nt_config: {
|
|
1526
|
+
distribution: number[];
|
|
1527
|
+
traffic: number;
|
|
1528
|
+
components: {
|
|
1529
|
+
baseline: {
|
|
1530
|
+
id: string;
|
|
1531
|
+
};
|
|
1532
|
+
variants: {
|
|
1533
|
+
id: string;
|
|
1534
|
+
hidden: boolean;
|
|
1535
|
+
}[];
|
|
1536
|
+
}[];
|
|
1537
|
+
};
|
|
1538
1538
|
};
|
|
1539
1539
|
}[];
|
|
1540
1540
|
}, {
|
|
@@ -2493,7 +2493,7 @@ export declare const BaselineWithExperiencesEntrySchema: z.ZodObject<z.extendSha
|
|
|
2493
2493
|
nt_audience_id: string;
|
|
2494
2494
|
};
|
|
2495
2495
|
}>>>;
|
|
2496
|
-
nt_variants: z.
|
|
2496
|
+
nt_variants: z.ZodOptional<z.ZodArray<z.ZodObject<{
|
|
2497
2497
|
sys: z.ZodObject<{
|
|
2498
2498
|
type: z.ZodOptional<z.ZodString>;
|
|
2499
2499
|
id: z.ZodString;
|
|
@@ -2828,22 +2828,7 @@ export declare const BaselineWithExperiencesEntrySchema: z.ZodObject<z.extendSha
|
|
|
2828
2828
|
nt_audience_id: string;
|
|
2829
2829
|
};
|
|
2830
2830
|
} | null | undefined;
|
|
2831
|
-
|
|
2832
|
-
nt_type: string;
|
|
2833
|
-
nt_config: {
|
|
2834
|
-
distribution: number[];
|
|
2835
|
-
traffic: number;
|
|
2836
|
-
components: {
|
|
2837
|
-
baseline: {
|
|
2838
|
-
id: string;
|
|
2839
|
-
};
|
|
2840
|
-
variants: {
|
|
2841
|
-
id: string;
|
|
2842
|
-
hidden: boolean;
|
|
2843
|
-
}[];
|
|
2844
|
-
}[];
|
|
2845
|
-
};
|
|
2846
|
-
nt_variants: {
|
|
2831
|
+
nt_variants?: {
|
|
2847
2832
|
metadata?: {
|
|
2848
2833
|
tags: {
|
|
2849
2834
|
sys: {
|
|
@@ -2885,7 +2870,22 @@ export declare const BaselineWithExperiencesEntrySchema: z.ZodObject<z.extendSha
|
|
|
2885
2870
|
fields: {
|
|
2886
2871
|
[x: string]: unknown;
|
|
2887
2872
|
};
|
|
2888
|
-
}[];
|
|
2873
|
+
}[] | undefined;
|
|
2874
|
+
nt_name: string;
|
|
2875
|
+
nt_type: string;
|
|
2876
|
+
nt_config: {
|
|
2877
|
+
distribution: number[];
|
|
2878
|
+
traffic: number;
|
|
2879
|
+
components: {
|
|
2880
|
+
baseline: {
|
|
2881
|
+
id: string;
|
|
2882
|
+
};
|
|
2883
|
+
variants: {
|
|
2884
|
+
id: string;
|
|
2885
|
+
hidden: boolean;
|
|
2886
|
+
}[];
|
|
2887
|
+
}[];
|
|
2888
|
+
};
|
|
2889
2889
|
}, {
|
|
2890
2890
|
nt_audience?: {
|
|
2891
2891
|
metadata?: {
|
|
@@ -3076,22 +3076,7 @@ export declare const BaselineWithExperiencesEntrySchema: z.ZodObject<z.extendSha
|
|
|
3076
3076
|
nt_audience_id: string;
|
|
3077
3077
|
};
|
|
3078
3078
|
} | null | undefined;
|
|
3079
|
-
|
|
3080
|
-
nt_type: string;
|
|
3081
|
-
nt_config: {
|
|
3082
|
-
distribution: number[];
|
|
3083
|
-
traffic: number;
|
|
3084
|
-
components: {
|
|
3085
|
-
baseline: {
|
|
3086
|
-
id: string;
|
|
3087
|
-
};
|
|
3088
|
-
variants: {
|
|
3089
|
-
id: string;
|
|
3090
|
-
hidden: boolean;
|
|
3091
|
-
}[];
|
|
3092
|
-
}[];
|
|
3093
|
-
};
|
|
3094
|
-
nt_variants: {
|
|
3079
|
+
nt_variants?: {
|
|
3095
3080
|
metadata?: {
|
|
3096
3081
|
tags: {
|
|
3097
3082
|
sys: {
|
|
@@ -3133,7 +3118,22 @@ export declare const BaselineWithExperiencesEntrySchema: z.ZodObject<z.extendSha
|
|
|
3133
3118
|
fields: {
|
|
3134
3119
|
[x: string]: unknown;
|
|
3135
3120
|
};
|
|
3136
|
-
}[];
|
|
3121
|
+
}[] | undefined;
|
|
3122
|
+
nt_name: string;
|
|
3123
|
+
nt_type: string;
|
|
3124
|
+
nt_config: {
|
|
3125
|
+
distribution: number[];
|
|
3126
|
+
traffic: number;
|
|
3127
|
+
components: {
|
|
3128
|
+
baseline: {
|
|
3129
|
+
id: string;
|
|
3130
|
+
};
|
|
3131
|
+
variants: {
|
|
3132
|
+
id: string;
|
|
3133
|
+
hidden: boolean;
|
|
3134
|
+
}[];
|
|
3135
|
+
}[];
|
|
3136
|
+
};
|
|
3137
3137
|
};
|
|
3138
3138
|
}, {
|
|
3139
3139
|
metadata?: {
|
|
@@ -3367,22 +3367,7 @@ export declare const BaselineWithExperiencesEntrySchema: z.ZodObject<z.extendSha
|
|
|
3367
3367
|
nt_audience_id: string;
|
|
3368
3368
|
};
|
|
3369
3369
|
} | null | undefined;
|
|
3370
|
-
|
|
3371
|
-
nt_type: string;
|
|
3372
|
-
nt_config: {
|
|
3373
|
-
distribution: number[];
|
|
3374
|
-
traffic: number;
|
|
3375
|
-
components: {
|
|
3376
|
-
baseline: {
|
|
3377
|
-
id: string;
|
|
3378
|
-
};
|
|
3379
|
-
variants: {
|
|
3380
|
-
id: string;
|
|
3381
|
-
hidden: boolean;
|
|
3382
|
-
}[];
|
|
3383
|
-
}[];
|
|
3384
|
-
};
|
|
3385
|
-
nt_variants: {
|
|
3370
|
+
nt_variants?: {
|
|
3386
3371
|
metadata?: {
|
|
3387
3372
|
tags: {
|
|
3388
3373
|
sys: {
|
|
@@ -3424,7 +3409,22 @@ export declare const BaselineWithExperiencesEntrySchema: z.ZodObject<z.extendSha
|
|
|
3424
3409
|
fields: {
|
|
3425
3410
|
[x: string]: unknown;
|
|
3426
3411
|
};
|
|
3427
|
-
}[];
|
|
3412
|
+
}[] | undefined;
|
|
3413
|
+
nt_name: string;
|
|
3414
|
+
nt_type: string;
|
|
3415
|
+
nt_config: {
|
|
3416
|
+
distribution: number[];
|
|
3417
|
+
traffic: number;
|
|
3418
|
+
components: {
|
|
3419
|
+
baseline: {
|
|
3420
|
+
id: string;
|
|
3421
|
+
};
|
|
3422
|
+
variants: {
|
|
3423
|
+
id: string;
|
|
3424
|
+
hidden: boolean;
|
|
3425
|
+
}[];
|
|
3426
|
+
}[];
|
|
3427
|
+
};
|
|
3428
3428
|
};
|
|
3429
3429
|
}[];
|
|
3430
3430
|
}, {
|
|
@@ -3701,22 +3701,7 @@ export declare const BaselineWithExperiencesEntrySchema: z.ZodObject<z.extendSha
|
|
|
3701
3701
|
nt_audience_id: string;
|
|
3702
3702
|
};
|
|
3703
3703
|
} | null | undefined;
|
|
3704
|
-
|
|
3705
|
-
nt_type: string;
|
|
3706
|
-
nt_config: {
|
|
3707
|
-
distribution: number[];
|
|
3708
|
-
traffic: number;
|
|
3709
|
-
components: {
|
|
3710
|
-
baseline: {
|
|
3711
|
-
id: string;
|
|
3712
|
-
};
|
|
3713
|
-
variants: {
|
|
3714
|
-
id: string;
|
|
3715
|
-
hidden: boolean;
|
|
3716
|
-
}[];
|
|
3717
|
-
}[];
|
|
3718
|
-
};
|
|
3719
|
-
nt_variants: {
|
|
3704
|
+
nt_variants?: {
|
|
3720
3705
|
metadata?: {
|
|
3721
3706
|
tags: {
|
|
3722
3707
|
sys: {
|
|
@@ -3758,7 +3743,22 @@ export declare const BaselineWithExperiencesEntrySchema: z.ZodObject<z.extendSha
|
|
|
3758
3743
|
fields: {
|
|
3759
3744
|
[x: string]: unknown;
|
|
3760
3745
|
};
|
|
3761
|
-
}[];
|
|
3746
|
+
}[] | undefined;
|
|
3747
|
+
nt_name: string;
|
|
3748
|
+
nt_type: string;
|
|
3749
|
+
nt_config: {
|
|
3750
|
+
distribution: number[];
|
|
3751
|
+
traffic: number;
|
|
3752
|
+
components: {
|
|
3753
|
+
baseline: {
|
|
3754
|
+
id: string;
|
|
3755
|
+
};
|
|
3756
|
+
variants: {
|
|
3757
|
+
id: string;
|
|
3758
|
+
hidden: boolean;
|
|
3759
|
+
}[];
|
|
3760
|
+
}[];
|
|
3761
|
+
};
|
|
3762
3762
|
};
|
|
3763
3763
|
}[];
|
|
3764
3764
|
};
|