@ninetailed/experience.js-utils-contentful 2.2.5 → 2.2.7
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 -4
- package/index.umd.js +7 -4
- package/package.json +4 -4
- package/types/ExperienceEntry.d.ts +82 -88
package/index.esm.js
CHANGED
|
@@ -70,7 +70,7 @@ const ExperienceFields = z.object({
|
|
|
70
70
|
/**
|
|
71
71
|
* The config of the experience (JSON)
|
|
72
72
|
*/
|
|
73
|
-
nt_config: Config,
|
|
73
|
+
nt_config: Config.optional().nullable(),
|
|
74
74
|
|
|
75
75
|
/**
|
|
76
76
|
* The audience of the experience (Audience)
|
|
@@ -136,12 +136,15 @@ class ExperienceMapper {
|
|
|
136
136
|
nt_variants
|
|
137
137
|
}
|
|
138
138
|
} = parsedExperience.data;
|
|
139
|
-
return ExperienceMapper$1.mapExperience(Object.assign(Object.assign({
|
|
139
|
+
return ExperienceMapper$1.mapExperience(Object.assign(Object.assign(Object.assign({
|
|
140
140
|
id,
|
|
141
141
|
type: nt_type,
|
|
142
142
|
name: nt_name
|
|
143
|
-
}, nt_audience ?
|
|
144
|
-
|
|
143
|
+
}, nt_audience ? {
|
|
144
|
+
audience: AudienceMapper.mapAudience(nt_audience)
|
|
145
|
+
} : {}), nt_config ? {
|
|
146
|
+
config: nt_config
|
|
147
|
+
} : {}), {
|
|
145
148
|
variants: nt_variants.map(variant => _mapVariant(variant))
|
|
146
149
|
}));
|
|
147
150
|
}
|
package/index.umd.js
CHANGED
|
@@ -72,7 +72,7 @@
|
|
|
72
72
|
/**
|
|
73
73
|
* The config of the experience (JSON)
|
|
74
74
|
*/
|
|
75
|
-
nt_config: experience_jsUtils.Config,
|
|
75
|
+
nt_config: experience_jsUtils.Config.optional().nullable(),
|
|
76
76
|
|
|
77
77
|
/**
|
|
78
78
|
* The audience of the experience (Audience)
|
|
@@ -171,12 +171,15 @@
|
|
|
171
171
|
nt_config = _b.nt_config,
|
|
172
172
|
nt_audience = _b.nt_audience,
|
|
173
173
|
nt_variants = _b.nt_variants;
|
|
174
|
-
return experience_jsUtils.ExperienceMapper.mapExperience(__assign(__assign({
|
|
174
|
+
return experience_jsUtils.ExperienceMapper.mapExperience(__assign(__assign(__assign({
|
|
175
175
|
id: id,
|
|
176
176
|
type: nt_type,
|
|
177
177
|
name: nt_name
|
|
178
|
-
}, nt_audience ?
|
|
179
|
-
|
|
178
|
+
}, nt_audience ? {
|
|
179
|
+
audience: AudienceMapper.mapAudience(nt_audience)
|
|
180
|
+
} : {}), nt_config ? {
|
|
181
|
+
config: nt_config
|
|
182
|
+
} : {}), {
|
|
180
183
|
variants: nt_variants.map(function (variant) {
|
|
181
184
|
return _mapVariant(variant);
|
|
182
185
|
})
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@ninetailed/experience.js-utils-contentful",
|
|
3
|
-
"version": "2.2.
|
|
3
|
+
"version": "2.2.7",
|
|
4
4
|
"peerDependencies": {
|
|
5
5
|
"contentful": "^9.1.32"
|
|
6
6
|
},
|
|
@@ -8,10 +8,10 @@
|
|
|
8
8
|
"module": "./index.esm.js",
|
|
9
9
|
"typings": "./index.d.ts",
|
|
10
10
|
"dependencies": {
|
|
11
|
-
"@ninetailed/experience.js-utils": "2.2.
|
|
12
|
-
"@ninetailed/experience.js": "2.2.
|
|
11
|
+
"@ninetailed/experience.js-utils": "2.2.6",
|
|
12
|
+
"@ninetailed/experience.js": "2.2.7",
|
|
13
13
|
"analytics": "^0.8.0",
|
|
14
|
-
"@ninetailed/experience.js-shared": "2.2.
|
|
14
|
+
"@ninetailed/experience.js-shared": "2.2.7",
|
|
15
15
|
"uuid": "^8.3.2",
|
|
16
16
|
"ts-toolbelt": "^9.6.0",
|
|
17
17
|
"locale-enum": "^1.1.1",
|
|
@@ -11,7 +11,7 @@ export declare const ExperienceFields: z.ZodObject<{
|
|
|
11
11
|
/**
|
|
12
12
|
* The config of the experience (JSON)
|
|
13
13
|
*/
|
|
14
|
-
nt_config: z.ZodObject<{
|
|
14
|
+
nt_config: z.ZodNullable<z.ZodOptional<z.ZodObject<{
|
|
15
15
|
distribution: z.ZodDefault<z.ZodArray<z.ZodNumber, "many">>;
|
|
16
16
|
traffic: z.ZodDefault<z.ZodNumber>;
|
|
17
17
|
components: z.ZodDefault<z.ZodArray<z.ZodObject<{
|
|
@@ -23,9 +23,6 @@ export declare const ExperienceFields: z.ZodObject<{
|
|
|
23
23
|
id?: string | undefined;
|
|
24
24
|
}>;
|
|
25
25
|
variants: z.ZodArray<z.ZodObject<{
|
|
26
|
-
/**
|
|
27
|
-
* The config of the experience (JSON)
|
|
28
|
-
*/
|
|
29
26
|
id: z.ZodDefault<z.ZodString>;
|
|
30
27
|
hidden: z.ZodDefault<z.ZodBoolean>;
|
|
31
28
|
}, "strip", z.ZodTypeAny, {
|
|
@@ -76,7 +73,7 @@ export declare const ExperienceFields: z.ZodObject<{
|
|
|
76
73
|
hidden?: boolean | undefined;
|
|
77
74
|
}[];
|
|
78
75
|
}[] | undefined;
|
|
79
|
-
}
|
|
76
|
+
}>>>;
|
|
80
77
|
/**
|
|
81
78
|
* The audience of the experience (Audience)
|
|
82
79
|
*/
|
|
@@ -667,6 +664,19 @@ export declare const ExperienceFields: z.ZodObject<{
|
|
|
667
664
|
fields: {};
|
|
668
665
|
}>, "many">>;
|
|
669
666
|
}, "strip", z.ZodTypeAny, {
|
|
667
|
+
nt_config?: {
|
|
668
|
+
distribution: number[];
|
|
669
|
+
traffic: number;
|
|
670
|
+
components: {
|
|
671
|
+
baseline: {
|
|
672
|
+
id: string;
|
|
673
|
+
};
|
|
674
|
+
variants: {
|
|
675
|
+
id: string;
|
|
676
|
+
hidden: boolean;
|
|
677
|
+
}[];
|
|
678
|
+
}[];
|
|
679
|
+
} | null | undefined;
|
|
670
680
|
nt_audience?: {
|
|
671
681
|
metadata?: {
|
|
672
682
|
tags: {
|
|
@@ -713,19 +723,6 @@ export declare const ExperienceFields: z.ZodObject<{
|
|
|
713
723
|
} | null | undefined;
|
|
714
724
|
nt_name: string;
|
|
715
725
|
nt_type: "nt_experiment" | "nt_personalization";
|
|
716
|
-
nt_config: {
|
|
717
|
-
distribution: number[];
|
|
718
|
-
traffic: number;
|
|
719
|
-
components: {
|
|
720
|
-
baseline: {
|
|
721
|
-
id: string;
|
|
722
|
-
};
|
|
723
|
-
variants: {
|
|
724
|
-
id: string;
|
|
725
|
-
hidden: boolean;
|
|
726
|
-
}[];
|
|
727
|
-
}[];
|
|
728
|
-
};
|
|
729
726
|
nt_variants: {
|
|
730
727
|
metadata?: {
|
|
731
728
|
tags: {
|
|
@@ -768,6 +765,19 @@ export declare const ExperienceFields: z.ZodObject<{
|
|
|
768
765
|
fields: {};
|
|
769
766
|
}[];
|
|
770
767
|
}, {
|
|
768
|
+
nt_config?: {
|
|
769
|
+
distribution?: number[] | undefined;
|
|
770
|
+
traffic?: number | undefined;
|
|
771
|
+
components?: {
|
|
772
|
+
baseline: {
|
|
773
|
+
id?: string | undefined;
|
|
774
|
+
};
|
|
775
|
+
variants: {
|
|
776
|
+
id?: string | undefined;
|
|
777
|
+
hidden?: boolean | undefined;
|
|
778
|
+
}[];
|
|
779
|
+
}[] | undefined;
|
|
780
|
+
} | null | undefined;
|
|
771
781
|
nt_audience?: {
|
|
772
782
|
metadata?: {
|
|
773
783
|
tags: {
|
|
@@ -855,19 +865,6 @@ export declare const ExperienceFields: z.ZodObject<{
|
|
|
855
865
|
}[] | undefined;
|
|
856
866
|
nt_name: string;
|
|
857
867
|
nt_type: "nt_experiment" | "nt_personalization";
|
|
858
|
-
nt_config: {
|
|
859
|
-
distribution?: number[] | undefined;
|
|
860
|
-
traffic?: number | undefined;
|
|
861
|
-
components?: {
|
|
862
|
-
baseline: {
|
|
863
|
-
id?: string | undefined;
|
|
864
|
-
};
|
|
865
|
-
variants: {
|
|
866
|
-
id?: string | undefined;
|
|
867
|
-
hidden?: boolean | undefined;
|
|
868
|
-
}[];
|
|
869
|
-
}[] | undefined;
|
|
870
|
-
};
|
|
871
868
|
}>;
|
|
872
869
|
export declare type ExperienceFields = z.infer<typeof ExperienceFields>;
|
|
873
870
|
export declare const ExperienceEntry: z.ZodObject<z.extendShape<{
|
|
@@ -1085,7 +1082,7 @@ export declare const ExperienceEntry: z.ZodObject<z.extendShape<{
|
|
|
1085
1082
|
/**
|
|
1086
1083
|
* The config of the experience (JSON)
|
|
1087
1084
|
*/
|
|
1088
|
-
nt_config: z.ZodObject<{
|
|
1085
|
+
nt_config: z.ZodNullable<z.ZodOptional<z.ZodObject<{
|
|
1089
1086
|
distribution: z.ZodDefault<z.ZodArray<z.ZodNumber, "many">>;
|
|
1090
1087
|
traffic: z.ZodDefault<z.ZodNumber>;
|
|
1091
1088
|
components: z.ZodDefault<z.ZodArray<z.ZodObject<{
|
|
@@ -1097,9 +1094,6 @@ export declare const ExperienceEntry: z.ZodObject<z.extendShape<{
|
|
|
1097
1094
|
id?: string | undefined;
|
|
1098
1095
|
}>;
|
|
1099
1096
|
variants: z.ZodArray<z.ZodObject<{
|
|
1100
|
-
/**
|
|
1101
|
-
* The config of the experience (JSON)
|
|
1102
|
-
*/
|
|
1103
1097
|
id: z.ZodDefault<z.ZodString>;
|
|
1104
1098
|
hidden: z.ZodDefault<z.ZodBoolean>;
|
|
1105
1099
|
}, "strip", z.ZodTypeAny, {
|
|
@@ -1150,7 +1144,7 @@ export declare const ExperienceEntry: z.ZodObject<z.extendShape<{
|
|
|
1150
1144
|
hidden?: boolean | undefined;
|
|
1151
1145
|
}[];
|
|
1152
1146
|
}[] | undefined;
|
|
1153
|
-
}
|
|
1147
|
+
}>>>;
|
|
1154
1148
|
/**
|
|
1155
1149
|
* The audience of the experience (Audience)
|
|
1156
1150
|
*/
|
|
@@ -1741,6 +1735,19 @@ export declare const ExperienceEntry: z.ZodObject<z.extendShape<{
|
|
|
1741
1735
|
fields: {};
|
|
1742
1736
|
}>, "many">>;
|
|
1743
1737
|
}, "strip", z.ZodTypeAny, {
|
|
1738
|
+
nt_config?: {
|
|
1739
|
+
distribution: number[];
|
|
1740
|
+
traffic: number;
|
|
1741
|
+
components: {
|
|
1742
|
+
baseline: {
|
|
1743
|
+
id: string;
|
|
1744
|
+
};
|
|
1745
|
+
variants: {
|
|
1746
|
+
id: string;
|
|
1747
|
+
hidden: boolean;
|
|
1748
|
+
}[];
|
|
1749
|
+
}[];
|
|
1750
|
+
} | null | undefined;
|
|
1744
1751
|
nt_audience?: {
|
|
1745
1752
|
metadata?: {
|
|
1746
1753
|
tags: {
|
|
@@ -1787,19 +1794,6 @@ export declare const ExperienceEntry: z.ZodObject<z.extendShape<{
|
|
|
1787
1794
|
} | null | undefined;
|
|
1788
1795
|
nt_name: string;
|
|
1789
1796
|
nt_type: "nt_experiment" | "nt_personalization";
|
|
1790
|
-
nt_config: {
|
|
1791
|
-
distribution: number[];
|
|
1792
|
-
traffic: number;
|
|
1793
|
-
components: {
|
|
1794
|
-
baseline: {
|
|
1795
|
-
id: string;
|
|
1796
|
-
};
|
|
1797
|
-
variants: {
|
|
1798
|
-
id: string;
|
|
1799
|
-
hidden: boolean;
|
|
1800
|
-
}[];
|
|
1801
|
-
}[];
|
|
1802
|
-
};
|
|
1803
1797
|
nt_variants: {
|
|
1804
1798
|
metadata?: {
|
|
1805
1799
|
tags: {
|
|
@@ -1842,6 +1836,19 @@ export declare const ExperienceEntry: z.ZodObject<z.extendShape<{
|
|
|
1842
1836
|
fields: {};
|
|
1843
1837
|
}[];
|
|
1844
1838
|
}, {
|
|
1839
|
+
nt_config?: {
|
|
1840
|
+
distribution?: number[] | undefined;
|
|
1841
|
+
traffic?: number | undefined;
|
|
1842
|
+
components?: {
|
|
1843
|
+
baseline: {
|
|
1844
|
+
id?: string | undefined;
|
|
1845
|
+
};
|
|
1846
|
+
variants: {
|
|
1847
|
+
id?: string | undefined;
|
|
1848
|
+
hidden?: boolean | undefined;
|
|
1849
|
+
}[];
|
|
1850
|
+
}[] | undefined;
|
|
1851
|
+
} | null | undefined;
|
|
1845
1852
|
nt_audience?: {
|
|
1846
1853
|
metadata?: {
|
|
1847
1854
|
tags: {
|
|
@@ -1929,19 +1936,6 @@ export declare const ExperienceEntry: z.ZodObject<z.extendShape<{
|
|
|
1929
1936
|
}[] | undefined;
|
|
1930
1937
|
nt_name: string;
|
|
1931
1938
|
nt_type: "nt_experiment" | "nt_personalization";
|
|
1932
|
-
nt_config: {
|
|
1933
|
-
distribution?: number[] | undefined;
|
|
1934
|
-
traffic?: number | undefined;
|
|
1935
|
-
components?: {
|
|
1936
|
-
baseline: {
|
|
1937
|
-
id?: string | undefined;
|
|
1938
|
-
};
|
|
1939
|
-
variants: {
|
|
1940
|
-
id?: string | undefined;
|
|
1941
|
-
hidden?: boolean | undefined;
|
|
1942
|
-
}[];
|
|
1943
|
-
}[] | undefined;
|
|
1944
|
-
};
|
|
1945
1939
|
}>;
|
|
1946
1940
|
}>, "strip", z.ZodTypeAny, {
|
|
1947
1941
|
metadata?: {
|
|
@@ -1983,6 +1977,19 @@ export declare const ExperienceEntry: z.ZodObject<z.extendShape<{
|
|
|
1983
1977
|
id: string;
|
|
1984
1978
|
};
|
|
1985
1979
|
fields: {
|
|
1980
|
+
nt_config?: {
|
|
1981
|
+
distribution: number[];
|
|
1982
|
+
traffic: number;
|
|
1983
|
+
components: {
|
|
1984
|
+
baseline: {
|
|
1985
|
+
id: string;
|
|
1986
|
+
};
|
|
1987
|
+
variants: {
|
|
1988
|
+
id: string;
|
|
1989
|
+
hidden: boolean;
|
|
1990
|
+
}[];
|
|
1991
|
+
}[];
|
|
1992
|
+
} | null | undefined;
|
|
1986
1993
|
nt_audience?: {
|
|
1987
1994
|
metadata?: {
|
|
1988
1995
|
tags: {
|
|
@@ -2029,19 +2036,6 @@ export declare const ExperienceEntry: z.ZodObject<z.extendShape<{
|
|
|
2029
2036
|
} | null | undefined;
|
|
2030
2037
|
nt_name: string;
|
|
2031
2038
|
nt_type: "nt_experiment" | "nt_personalization";
|
|
2032
|
-
nt_config: {
|
|
2033
|
-
distribution: number[];
|
|
2034
|
-
traffic: number;
|
|
2035
|
-
components: {
|
|
2036
|
-
baseline: {
|
|
2037
|
-
id: string;
|
|
2038
|
-
};
|
|
2039
|
-
variants: {
|
|
2040
|
-
id: string;
|
|
2041
|
-
hidden: boolean;
|
|
2042
|
-
}[];
|
|
2043
|
-
}[];
|
|
2044
|
-
};
|
|
2045
2039
|
nt_variants: {
|
|
2046
2040
|
metadata?: {
|
|
2047
2041
|
tags: {
|
|
@@ -2124,6 +2118,19 @@ export declare const ExperienceEntry: z.ZodObject<z.extendShape<{
|
|
|
2124
2118
|
id: string;
|
|
2125
2119
|
};
|
|
2126
2120
|
fields: {
|
|
2121
|
+
nt_config?: {
|
|
2122
|
+
distribution?: number[] | undefined;
|
|
2123
|
+
traffic?: number | undefined;
|
|
2124
|
+
components?: {
|
|
2125
|
+
baseline: {
|
|
2126
|
+
id?: string | undefined;
|
|
2127
|
+
};
|
|
2128
|
+
variants: {
|
|
2129
|
+
id?: string | undefined;
|
|
2130
|
+
hidden?: boolean | undefined;
|
|
2131
|
+
}[];
|
|
2132
|
+
}[] | undefined;
|
|
2133
|
+
} | null | undefined;
|
|
2127
2134
|
nt_audience?: {
|
|
2128
2135
|
metadata?: {
|
|
2129
2136
|
tags: {
|
|
@@ -2211,19 +2218,6 @@ export declare const ExperienceEntry: z.ZodObject<z.extendShape<{
|
|
|
2211
2218
|
}[] | undefined;
|
|
2212
2219
|
nt_name: string;
|
|
2213
2220
|
nt_type: "nt_experiment" | "nt_personalization";
|
|
2214
|
-
nt_config: {
|
|
2215
|
-
distribution?: number[] | undefined;
|
|
2216
|
-
traffic?: number | undefined;
|
|
2217
|
-
components?: {
|
|
2218
|
-
baseline: {
|
|
2219
|
-
id?: string | undefined;
|
|
2220
|
-
};
|
|
2221
|
-
variants: {
|
|
2222
|
-
id?: string | undefined;
|
|
2223
|
-
hidden?: boolean | undefined;
|
|
2224
|
-
}[];
|
|
2225
|
-
}[] | undefined;
|
|
2226
|
-
};
|
|
2227
2221
|
};
|
|
2228
2222
|
}>;
|
|
2229
2223
|
export declare type ExperienceEntry = z.infer<typeof ExperienceEntry>;
|