@kameleoon/javascript-sdk-core 1.1.1 → 2.1.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/dist/cacheManager/cacheManager.d.ts +38 -0
- package/dist/cacheManager/cacheManager.js +74 -0
- package/dist/cacheManager/cacheManager.js.map +1 -0
- package/dist/cacheManager/index.d.ts +2 -0
- package/dist/cacheManager/index.js +20 -0
- package/dist/cacheManager/index.js.map +1 -0
- package/dist/cacheManager/types.d.ts +14 -0
- package/dist/cacheManager/types.js +6 -0
- package/dist/cacheManager/types.js.map +1 -0
- package/dist/campaignConfiguration/campaignConfiguration.d.ts +2 -1
- package/dist/campaignConfiguration/campaignConfiguration.js +243 -196
- package/dist/campaignConfiguration/campaignConfiguration.js.map +1 -1
- package/dist/campaignConfiguration/constants.d.ts +3 -3
- package/dist/campaignConfiguration/constants.js +22 -16
- package/dist/campaignConfiguration/constants.js.map +1 -1
- package/dist/campaignConfiguration/index.d.ts +1 -0
- package/dist/campaignConfiguration/index.js +85 -6
- package/dist/campaignConfiguration/index.js.map +1 -1
- package/dist/campaignConfiguration/types.d.ts +7 -3
- package/dist/campaignConfiguration/types.js +53 -45
- package/dist/campaignConfiguration/types.js.map +1 -1
- package/dist/clientSettings/clientSettings.d.ts +1 -1
- package/dist/clientSettings/clientSettings.js +28 -21
- package/dist/clientSettings/clientSettings.js.map +1 -1
- package/dist/clientSettings/index.js +18 -4
- package/dist/clientSettings/index.js.map +1 -1
- package/dist/clientSettings/types.d.ts +1 -1
- package/dist/clientSettings/types.js +4 -1
- package/dist/clientSettings/types.js.map +1 -1
- package/dist/constants.d.ts +11 -0
- package/dist/constants.js +37 -14
- package/dist/constants.js.map +1 -1
- package/dist/eventSource/constants.js +6 -2
- package/dist/eventSource/constants.js.map +1 -1
- package/dist/eventSource/externalEventSource.js +28 -20
- package/dist/eventSource/externalEventSource.js.map +1 -1
- package/dist/eventSource/index.js +49 -6
- package/dist/eventSource/index.js.map +1 -1
- package/dist/eventSource/types.d.ts +1 -1
- package/dist/eventSource/types.js +4 -1
- package/dist/eventSource/types.js.map +1 -1
- package/dist/hasher/hasher.d.ts +1 -1
- package/dist/hasher/hasher.js +37 -26
- package/dist/hasher/hasher.js.map +1 -1
- package/dist/hasher/index.js +11 -4
- package/dist/hasher/index.js.map +1 -1
- package/dist/hasher/types.d.ts +1 -1
- package/dist/hasher/types.js +4 -1
- package/dist/hasher/types.js.map +1 -1
- package/dist/index.d.ts +4 -2
- package/dist/index.js +309 -28
- package/dist/index.js.map +1 -1
- package/dist/kameleoonClient.d.ts +32 -19
- package/dist/kameleoonClient.js +353 -235
- package/dist/kameleoonClient.js.map +1 -1
- package/dist/kameleoonData/browser.js +37 -32
- package/dist/kameleoonData/browser.js.map +1 -1
- package/dist/kameleoonData/constants.js +6 -2
- package/dist/kameleoonData/constants.js.map +1 -1
- package/dist/kameleoonData/conversion.js +47 -40
- package/dist/kameleoonData/conversion.js.map +1 -1
- package/dist/kameleoonData/customData.js +62 -58
- package/dist/kameleoonData/customData.js.map +1 -1
- package/dist/kameleoonData/device.js +37 -32
- package/dist/kameleoonData/device.js.map +1 -1
- package/dist/kameleoonData/index.js +101 -18
- package/dist/kameleoonData/index.js.map +1 -1
- package/dist/kameleoonData/nonce.js +25 -13
- package/dist/kameleoonData/nonce.js.map +1 -1
- package/dist/kameleoonData/pageView.js +52 -44
- package/dist/kameleoonData/pageView.js.map +1 -1
- package/dist/kameleoonData/types.js +41 -26
- package/dist/kameleoonData/types.js.map +1 -1
- package/dist/kameleoonData/userAgent.js +33 -24
- package/dist/kameleoonData/userAgent.js.map +1 -1
- package/dist/kameleoonError/constants.d.ts +1 -1
- package/dist/kameleoonError/constants.js +25 -21
- package/dist/kameleoonError/constants.js.map +1 -1
- package/dist/kameleoonError/helpers.js +6 -4
- package/dist/kameleoonError/helpers.js.map +1 -1
- package/dist/kameleoonError/index.js +25 -8
- package/dist/kameleoonError/index.js.map +1 -1
- package/dist/kameleoonError/kameleoonError.d.ts +1 -1
- package/dist/kameleoonError/kameleoonError.js +64 -53
- package/dist/kameleoonError/kameleoonError.js.map +1 -1
- package/dist/kameleoonError/types.d.ts +1 -1
- package/dist/kameleoonError/types.js +26 -22
- package/dist/kameleoonError/types.js.map +1 -1
- package/dist/kameleoonUtils.js +34 -33
- package/dist/kameleoonUtils.js.map +1 -1
- package/dist/requester/constants.d.ts +6 -7
- package/dist/requester/constants.js +58 -45
- package/dist/requester/constants.js.map +1 -1
- package/dist/requester/index.d.ts +2 -2
- package/dist/requester/index.js +67 -8
- package/dist/requester/index.js.map +1 -1
- package/dist/requester/requester.d.ts +7 -7
- package/dist/requester/requester.js +90 -113
- package/dist/requester/requester.js.map +1 -1
- package/dist/requester/types.d.ts +38 -10
- package/dist/requester/types.js +14 -36
- package/dist/requester/types.js.map +1 -1
- package/dist/storage/constants.js +11 -7
- package/dist/storage/constants.js.map +1 -1
- package/dist/storage/externalStorage.js +33 -26
- package/dist/storage/externalStorage.js.map +1 -1
- package/dist/storage/index.js +55 -6
- package/dist/storage/index.js.map +1 -1
- package/dist/storage/types.js +4 -1
- package/dist/storage/types.js.map +1 -1
- package/dist/targeting/conditions/conditionFactory.js +24 -19
- package/dist/targeting/conditions/conditionFactory.js.map +1 -1
- package/dist/targeting/conditions/customDataCondition.js +99 -88
- package/dist/targeting/conditions/customDataCondition.js.map +1 -1
- package/dist/targeting/conditions/exclusiveExperimentCondition.js +27 -15
- package/dist/targeting/conditions/exclusiveExperimentCondition.js.map +1 -1
- package/dist/targeting/conditions/index.js +45 -10
- package/dist/targeting/conditions/index.js.map +1 -1
- package/dist/targeting/conditions/targetExperimentCondition.js +54 -32
- package/dist/targeting/conditions/targetExperimentCondition.js.map +1 -1
- package/dist/targeting/conditions/types.js +4 -1
- package/dist/targeting/conditions/types.js.map +1 -1
- package/dist/targeting/index.js +79 -13
- package/dist/targeting/index.js.map +1 -1
- package/dist/targeting/targetingNode.js +41 -33
- package/dist/targeting/targetingNode.js.map +1 -1
- package/dist/targeting/targetingTree.js +125 -104
- package/dist/targeting/targetingTree.js.map +1 -1
- package/dist/targeting/types.js +99 -91
- package/dist/targeting/types.js.map +1 -1
- package/dist/types.d.ts +34 -2
- package/dist/types.js +58 -21
- package/dist/types.js.map +1 -1
- package/dist/utilities/constants.js +6 -2
- package/dist/utilities/constants.js.map +1 -1
- package/dist/utilities/index.js +11 -4
- package/dist/utilities/index.js.map +1 -1
- package/dist/utilities/types.d.ts +9 -1
- package/dist/utilities/types.js +4 -1
- package/dist/utilities/types.js.map +1 -1
- package/dist/utilities/utilities.d.ts +6 -3
- package/dist/utilities/utilities.js +171 -105
- package/dist/utilities/utilities.js.map +1 -1
- package/dist/variationConfiguration/index.js +24 -4
- package/dist/variationConfiguration/index.js.map +1 -1
- package/dist/variationConfiguration/types.d.ts +1 -1
- package/dist/variationConfiguration/types.js +4 -1
- package/dist/variationConfiguration/types.js.map +1 -1
- package/dist/variationConfiguration/variation.js +35 -28
- package/dist/variationConfiguration/variation.js.map +1 -1
- package/dist/variationConfiguration/variationConfiguration.d.ts +5 -6
- package/dist/variationConfiguration/variationConfiguration.js +263 -230
- package/dist/variationConfiguration/variationConfiguration.js.map +1 -1
- package/package.json +6 -4
- package/dist/hasher/constants.d.ts +0 -1
- package/dist/hasher/constants.js +0 -5
- package/dist/hasher/constants.js.map +0 -1
package/dist/index.js
CHANGED
|
@@ -1,30 +1,311 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
Object.defineProperty(exports, "
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
Object.defineProperty(exports, "
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
Object.defineProperty(exports, "
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
Object.defineProperty(exports, "Browser", {
|
|
7
|
+
enumerable: true,
|
|
8
|
+
get: function () {
|
|
9
|
+
return _kameleoonData.Browser;
|
|
10
|
+
}
|
|
11
|
+
});
|
|
12
|
+
Object.defineProperty(exports, "BrowserType", {
|
|
13
|
+
enumerable: true,
|
|
14
|
+
get: function () {
|
|
15
|
+
return _kameleoonData.BrowserType;
|
|
16
|
+
}
|
|
17
|
+
});
|
|
18
|
+
Object.defineProperty(exports, "CLEANUP_TARGETING_DATA_INTERVAL", {
|
|
19
|
+
enumerable: true,
|
|
20
|
+
get: function () {
|
|
21
|
+
return _campaignConfiguration.CLEANUP_TARGETING_DATA_INTERVAL;
|
|
22
|
+
}
|
|
23
|
+
});
|
|
24
|
+
Object.defineProperty(exports, "ClientGetVisitorCodeParametersType", {
|
|
25
|
+
enumerable: true,
|
|
26
|
+
get: function () {
|
|
27
|
+
return _types.ClientGetVisitorCodeParametersType;
|
|
28
|
+
}
|
|
29
|
+
});
|
|
30
|
+
Object.defineProperty(exports, "Conversion", {
|
|
31
|
+
enumerable: true,
|
|
32
|
+
get: function () {
|
|
33
|
+
return _kameleoonData.Conversion;
|
|
34
|
+
}
|
|
35
|
+
});
|
|
36
|
+
Object.defineProperty(exports, "ConversionParametersType", {
|
|
37
|
+
enumerable: true,
|
|
38
|
+
get: function () {
|
|
39
|
+
return _kameleoonData.ConversionParametersType;
|
|
40
|
+
}
|
|
41
|
+
});
|
|
42
|
+
Object.defineProperty(exports, "Cookie", {
|
|
43
|
+
enumerable: true,
|
|
44
|
+
get: function () {
|
|
45
|
+
return _constants.Cookie;
|
|
46
|
+
}
|
|
47
|
+
});
|
|
48
|
+
Object.defineProperty(exports, "CustomData", {
|
|
49
|
+
enumerable: true,
|
|
50
|
+
get: function () {
|
|
51
|
+
return _kameleoonData.CustomData;
|
|
52
|
+
}
|
|
53
|
+
});
|
|
54
|
+
Object.defineProperty(exports, "Device", {
|
|
55
|
+
enumerable: true,
|
|
56
|
+
get: function () {
|
|
57
|
+
return _kameleoonData.Device;
|
|
58
|
+
}
|
|
59
|
+
});
|
|
60
|
+
Object.defineProperty(exports, "DeviceType", {
|
|
61
|
+
enumerable: true,
|
|
62
|
+
get: function () {
|
|
63
|
+
return _kameleoonData.DeviceType;
|
|
64
|
+
}
|
|
65
|
+
});
|
|
66
|
+
Object.defineProperty(exports, "Environment", {
|
|
67
|
+
enumerable: true,
|
|
68
|
+
get: function () {
|
|
69
|
+
return _types.Environment;
|
|
70
|
+
}
|
|
71
|
+
});
|
|
72
|
+
Object.defineProperty(exports, "Err", {
|
|
73
|
+
enumerable: true,
|
|
74
|
+
get: function () {
|
|
75
|
+
return _tsRes.Err;
|
|
76
|
+
}
|
|
77
|
+
});
|
|
78
|
+
Object.defineProperty(exports, "EventSourceOpenParametersType", {
|
|
79
|
+
enumerable: true,
|
|
80
|
+
get: function () {
|
|
81
|
+
return _eventSource.EventSourceOpenParametersType;
|
|
82
|
+
}
|
|
83
|
+
});
|
|
84
|
+
Object.defineProperty(exports, "ExperimentType", {
|
|
85
|
+
enumerable: true,
|
|
86
|
+
get: function () {
|
|
87
|
+
return _types.ExperimentType;
|
|
88
|
+
}
|
|
89
|
+
});
|
|
90
|
+
Object.defineProperty(exports, "ExternalPackageInfoType", {
|
|
91
|
+
enumerable: true,
|
|
92
|
+
get: function () {
|
|
93
|
+
return _types.ExternalPackageInfoType;
|
|
94
|
+
}
|
|
95
|
+
});
|
|
96
|
+
Object.defineProperty(exports, "FeatureFlagType", {
|
|
97
|
+
enumerable: true,
|
|
98
|
+
get: function () {
|
|
99
|
+
return _types.FeatureFlagType;
|
|
100
|
+
}
|
|
101
|
+
});
|
|
102
|
+
Object.defineProperty(exports, "FeatureVariableResultType", {
|
|
103
|
+
enumerable: true,
|
|
104
|
+
get: function () {
|
|
105
|
+
return _types.FeatureVariableResultType;
|
|
106
|
+
}
|
|
107
|
+
});
|
|
108
|
+
Object.defineProperty(exports, "GetClientConfigurationResultType", {
|
|
109
|
+
enumerable: true,
|
|
110
|
+
get: function () {
|
|
111
|
+
return _requester.GetClientConfigurationResultType;
|
|
112
|
+
}
|
|
113
|
+
});
|
|
114
|
+
Object.defineProperty(exports, "GetFeatureFlagVariableParamsType", {
|
|
115
|
+
enumerable: true,
|
|
116
|
+
get: function () {
|
|
117
|
+
return _types.GetFeatureFlagVariableParamsType;
|
|
118
|
+
}
|
|
119
|
+
});
|
|
120
|
+
Object.defineProperty(exports, "Header", {
|
|
121
|
+
enumerable: true,
|
|
122
|
+
get: function () {
|
|
123
|
+
return _requester.Header;
|
|
124
|
+
}
|
|
125
|
+
});
|
|
126
|
+
Object.defineProperty(exports, "HttpMethod", {
|
|
127
|
+
enumerable: true,
|
|
128
|
+
get: function () {
|
|
129
|
+
return _requester.HttpMethod;
|
|
130
|
+
}
|
|
131
|
+
});
|
|
132
|
+
Object.defineProperty(exports, "IExternalEventSource", {
|
|
133
|
+
enumerable: true,
|
|
134
|
+
get: function () {
|
|
135
|
+
return _eventSource.IExternalEventSource;
|
|
136
|
+
}
|
|
137
|
+
});
|
|
138
|
+
Object.defineProperty(exports, "IExternalEventSourceConstructor", {
|
|
139
|
+
enumerable: true,
|
|
140
|
+
get: function () {
|
|
141
|
+
return _eventSource.IExternalEventSourceConstructor;
|
|
142
|
+
}
|
|
143
|
+
});
|
|
144
|
+
Object.defineProperty(exports, "IExternalRequestDispatcher", {
|
|
145
|
+
enumerable: true,
|
|
146
|
+
get: function () {
|
|
147
|
+
return _requester.IExternalRequestDispatcher;
|
|
148
|
+
}
|
|
149
|
+
});
|
|
150
|
+
Object.defineProperty(exports, "IExternalStorage", {
|
|
151
|
+
enumerable: true,
|
|
152
|
+
get: function () {
|
|
153
|
+
return _storage.IExternalStorage;
|
|
154
|
+
}
|
|
155
|
+
});
|
|
156
|
+
Object.defineProperty(exports, "IExternalStorageConstructor", {
|
|
157
|
+
enumerable: true,
|
|
158
|
+
get: function () {
|
|
159
|
+
return _storage.IExternalStorageConstructor;
|
|
160
|
+
}
|
|
161
|
+
});
|
|
162
|
+
Object.defineProperty(exports, "IKameleoonCore", {
|
|
163
|
+
enumerable: true,
|
|
164
|
+
get: function () {
|
|
165
|
+
return _kameleoonClient.IKameleoonClient;
|
|
166
|
+
}
|
|
167
|
+
});
|
|
168
|
+
Object.defineProperty(exports, "InternalSDKConfigurationType", {
|
|
169
|
+
enumerable: true,
|
|
170
|
+
get: function () {
|
|
171
|
+
return _types.InternalSDKConfigurationType;
|
|
172
|
+
}
|
|
173
|
+
});
|
|
174
|
+
Object.defineProperty(exports, "JSONType", {
|
|
175
|
+
enumerable: true,
|
|
176
|
+
get: function () {
|
|
177
|
+
return _campaignConfiguration.JSONType;
|
|
178
|
+
}
|
|
179
|
+
});
|
|
180
|
+
Object.defineProperty(exports, "KameleoonCore", {
|
|
181
|
+
enumerable: true,
|
|
182
|
+
get: function () {
|
|
183
|
+
return _kameleoonClient.KameleoonClient;
|
|
184
|
+
}
|
|
185
|
+
});
|
|
186
|
+
Object.defineProperty(exports, "KameleoonCoreUtils", {
|
|
187
|
+
enumerable: true,
|
|
188
|
+
get: function () {
|
|
189
|
+
return _kameleoonUtils.KameleoonUtils;
|
|
190
|
+
}
|
|
191
|
+
});
|
|
192
|
+
Object.defineProperty(exports, "KameleoonDataType", {
|
|
193
|
+
enumerable: true,
|
|
194
|
+
get: function () {
|
|
195
|
+
return _kameleoonData.KameleoonDataType;
|
|
196
|
+
}
|
|
197
|
+
});
|
|
198
|
+
Object.defineProperty(exports, "KameleoonError", {
|
|
199
|
+
enumerable: true,
|
|
200
|
+
get: function () {
|
|
201
|
+
return _kameleoonError.KameleoonError;
|
|
202
|
+
}
|
|
203
|
+
});
|
|
204
|
+
Object.defineProperty(exports, "KameleoonException", {
|
|
205
|
+
enumerable: true,
|
|
206
|
+
get: function () {
|
|
207
|
+
return _kameleoonError.KameleoonException;
|
|
208
|
+
}
|
|
209
|
+
});
|
|
210
|
+
Object.defineProperty(exports, "KameleoonStorageKey", {
|
|
211
|
+
enumerable: true,
|
|
212
|
+
get: function () {
|
|
213
|
+
return _storage.KameleoonStorageKey;
|
|
214
|
+
}
|
|
215
|
+
});
|
|
216
|
+
Object.defineProperty(exports, "MobileGetVisitorCodeParametersType", {
|
|
217
|
+
enumerable: true,
|
|
218
|
+
get: function () {
|
|
219
|
+
return _types.MobileGetVisitorCodeParametersType;
|
|
220
|
+
}
|
|
221
|
+
});
|
|
222
|
+
Object.defineProperty(exports, "Ok", {
|
|
223
|
+
enumerable: true,
|
|
224
|
+
get: function () {
|
|
225
|
+
return _tsRes.Ok;
|
|
226
|
+
}
|
|
227
|
+
});
|
|
228
|
+
Object.defineProperty(exports, "PageView", {
|
|
229
|
+
enumerable: true,
|
|
230
|
+
get: function () {
|
|
231
|
+
return _kameleoonData.PageView;
|
|
232
|
+
}
|
|
233
|
+
});
|
|
234
|
+
Object.defineProperty(exports, "PageViewParametersType", {
|
|
235
|
+
enumerable: true,
|
|
236
|
+
get: function () {
|
|
237
|
+
return _kameleoonData.PageViewParametersType;
|
|
238
|
+
}
|
|
239
|
+
});
|
|
240
|
+
Object.defineProperty(exports, "RealTimeEventType", {
|
|
241
|
+
enumerable: true,
|
|
242
|
+
get: function () {
|
|
243
|
+
return _eventSource.RealTimeEventType;
|
|
244
|
+
}
|
|
245
|
+
});
|
|
246
|
+
Object.defineProperty(exports, "Result", {
|
|
247
|
+
enumerable: true,
|
|
248
|
+
get: function () {
|
|
249
|
+
return _tsRes.Result;
|
|
250
|
+
}
|
|
251
|
+
});
|
|
252
|
+
Object.defineProperty(exports, "SDKConfigurationType", {
|
|
253
|
+
enumerable: true,
|
|
254
|
+
get: function () {
|
|
255
|
+
return _types.SDKConfigurationType;
|
|
256
|
+
}
|
|
257
|
+
});
|
|
258
|
+
Object.defineProperty(exports, "SDKCoreParameters", {
|
|
259
|
+
enumerable: true,
|
|
260
|
+
get: function () {
|
|
261
|
+
return _types.SDKCoreParameters;
|
|
262
|
+
}
|
|
263
|
+
});
|
|
264
|
+
Object.defineProperty(exports, "SDKType", {
|
|
265
|
+
enumerable: true,
|
|
266
|
+
get: function () {
|
|
267
|
+
return _constants.SDKType;
|
|
268
|
+
}
|
|
269
|
+
});
|
|
270
|
+
Object.defineProperty(exports, "ServerGetVisitorCodeParametersType", {
|
|
271
|
+
enumerable: true,
|
|
272
|
+
get: function () {
|
|
273
|
+
return _types.ServerGetVisitorCodeParametersType;
|
|
274
|
+
}
|
|
275
|
+
});
|
|
276
|
+
Object.defineProperty(exports, "TrackConversionParamsType", {
|
|
277
|
+
enumerable: true,
|
|
278
|
+
get: function () {
|
|
279
|
+
return _types.TrackConversionParamsType;
|
|
280
|
+
}
|
|
281
|
+
});
|
|
282
|
+
Object.defineProperty(exports, "TrackParametersType", {
|
|
283
|
+
enumerable: true,
|
|
284
|
+
get: function () {
|
|
285
|
+
return _requester.TrackParametersType;
|
|
286
|
+
}
|
|
287
|
+
});
|
|
288
|
+
Object.defineProperty(exports, "VISITOR_CODE_LENGTH", {
|
|
289
|
+
enumerable: true,
|
|
290
|
+
get: function () {
|
|
291
|
+
return _constants.VISITOR_CODE_LENGTH;
|
|
292
|
+
}
|
|
293
|
+
});
|
|
294
|
+
Object.defineProperty(exports, "VariableType", {
|
|
295
|
+
enumerable: true,
|
|
296
|
+
get: function () {
|
|
297
|
+
return _types.VariableType;
|
|
298
|
+
}
|
|
299
|
+
});
|
|
300
|
+
var _kameleoonClient = require("./kameleoonClient");
|
|
301
|
+
var _kameleoonUtils = require("./kameleoonUtils");
|
|
302
|
+
var _kameleoonError = require("./kameleoonError");
|
|
303
|
+
var _storage = require("./storage");
|
|
304
|
+
var _constants = require("./constants");
|
|
305
|
+
var _campaignConfiguration = require("./campaignConfiguration");
|
|
306
|
+
var _tsRes = require("ts-res");
|
|
307
|
+
var _types = require("./types");
|
|
308
|
+
var _kameleoonData = require("./kameleoonData");
|
|
309
|
+
var _eventSource = require("./eventSource");
|
|
310
|
+
var _requester = require("./requester");
|
|
30
311
|
//# sourceMappingURL=index.js.map
|
package/dist/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","
|
|
1
|
+
{"version":3,"file":"index.js","names":["_kameleoonClient","require","_kameleoonUtils","_kameleoonError","_storage","_constants","_campaignConfiguration","_tsRes","_types","_kameleoonData","_eventSource","_requester"],"sources":["../src/index.ts"],"sourcesContent":["export {\n KameleoonClient as KameleoonCore,\n IKameleoonClient as IKameleoonCore,\n} from './kameleoonClient';\nexport { KameleoonUtils as KameleoonCoreUtils } from './kameleoonUtils';\nexport { KameleoonException, KameleoonError } from './kameleoonError';\nexport {\n KameleoonStorageKey,\n IExternalStorage,\n IExternalStorageConstructor,\n} from './storage';\nexport { Cookie, VISITOR_CODE_LENGTH, SDKType } from './constants';\nexport { CLEANUP_TARGETING_DATA_INTERVAL } from './campaignConfiguration';\nexport { JSONType } from './campaignConfiguration';\nexport { Ok, Result, Err } from 'ts-res';\nexport {\n Environment,\n VariableType,\n ExperimentType,\n FeatureFlagType,\n SDKCoreParameters,\n SDKConfigurationType,\n ExternalPackageInfoType,\n TrackConversionParamsType,\n FeatureVariableResultType,\n InternalSDKConfigurationType,\n GetFeatureFlagVariableParamsType,\n ServerGetVisitorCodeParametersType,\n ClientGetVisitorCodeParametersType,\n MobileGetVisitorCodeParametersType,\n} from './types';\nexport {\n CustomData,\n Conversion,\n Device,\n Browser,\n DeviceType,\n BrowserType,\n PageView,\n KameleoonDataType,\n PageViewParametersType,\n ConversionParametersType,\n} from './kameleoonData';\nexport {\n RealTimeEventType,\n IExternalEventSource,\n EventSourceOpenParametersType,\n IExternalEventSourceConstructor,\n} from './eventSource';\nexport {\n Header,\n HttpMethod,\n TrackParametersType,\n IExternalRequestDispatcher,\n GetClientConfigurationResultType,\n} from './requester';\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,IAAAA,gBAAA,GAAAC,OAAA;AAIA,IAAAC,eAAA,GAAAD,OAAA;AACA,IAAAE,eAAA,GAAAF,OAAA;AACA,IAAAG,QAAA,GAAAH,OAAA;AAKA,IAAAI,UAAA,GAAAJ,OAAA;AACA,IAAAK,sBAAA,GAAAL,OAAA;AAEA,IAAAM,MAAA,GAAAN,OAAA;AACA,IAAAO,MAAA,GAAAP,OAAA;AAgBA,IAAAQ,cAAA,GAAAR,OAAA;AAYA,IAAAS,YAAA,GAAAT,OAAA;AAMA,IAAAU,UAAA,GAAAV,OAAA"}
|
|
@@ -3,7 +3,7 @@ import { KameleoonDataType } from './kameleoonData';
|
|
|
3
3
|
import { TrackConversionParamsType, ExperimentType, FeatureFlagType, GetFeatureFlagVariableParamsType, FeatureVariableResultType, SDKCoreParameters } from './types';
|
|
4
4
|
/**
|
|
5
5
|
* @interface an interface of KameleoonClient instance
|
|
6
|
-
|
|
6
|
+
*/
|
|
7
7
|
export interface IKameleoonClient {
|
|
8
8
|
/**
|
|
9
9
|
* @method initialize - an asynchronous method for KameleoonClient initialization by fetching Kameleoon SDK related data from server or by retrieving data from local source if data is up-to-date or update interval has not been reached
|
|
@@ -12,7 +12,7 @@ export interface IKameleoonClient {
|
|
|
12
12
|
*
|
|
13
13
|
* - `KameleoonException.StorageWrite` Couldn't update storage data
|
|
14
14
|
* - `KameleoonException.ClientConfiguration` Couldn't retrieve client configuration from Kameleoon Api
|
|
15
|
-
|
|
15
|
+
*/
|
|
16
16
|
initialize: () => Promise<boolean>;
|
|
17
17
|
/**
|
|
18
18
|
* @method addData - method for adding targeting data to the storage so that other methods could decide whether the current visitor is targeted or not. Note: userAgent data will not be stored in storage like other data, and it will be sent with every tracking request for bot filtration.
|
|
@@ -24,7 +24,7 @@ export interface IKameleoonClient {
|
|
|
24
24
|
* - `KameleoonException.VisitorCodeMaxLength` The visitor code length was exceeded
|
|
25
25
|
* - `KameleoonException.StorageWrite` Couldn't update storage data
|
|
26
26
|
* - `KameleoonException.Initialization` - Method was executed before `initialize` was done for `kameleoonClient`
|
|
27
|
-
|
|
27
|
+
*/
|
|
28
28
|
addData: (visitorCode: string, ...data: KameleoonDataType[]) => void;
|
|
29
29
|
/**
|
|
30
30
|
* @method triggerExperiment - triggers experiment by assigning the variation to the user with `visitorCode`, if the variation is already assigned just returns it's id. Note: returned id `0` indicates default variation. At the same time executes `flushData` without sending extra request.
|
|
@@ -38,7 +38,7 @@ export interface IKameleoonClient {
|
|
|
38
38
|
* - `KameleoonException.StorageRead` Couldn't find associated experiment by provided `experimentId` and `visitorCode` inside the storage
|
|
39
39
|
* - `KameleoonException.NotTargeted` Current visitor is not targeted
|
|
40
40
|
* - `KameleoonException.Initialization` - Method was executed before `initialize` was done for `kameleoonClient`
|
|
41
|
-
|
|
41
|
+
*/
|
|
42
42
|
triggerExperiment: (visitorCode: string, experimentId: number) => number;
|
|
43
43
|
/**
|
|
44
44
|
* @method trackConversion - creates and adds `Conversion` data to the visitor with specified parameters and executes `flushData`. Note: it's a helper method for the quick and convenient conversion tracking, however creating and adding `Conversion` manually allows more flexible `Conversion` with `negative` parameter
|
|
@@ -48,7 +48,7 @@ export interface IKameleoonClient {
|
|
|
48
48
|
*
|
|
49
49
|
* - `KameleoonException.VisitorCodeMaxLength` The visitor code length was exceeded
|
|
50
50
|
* - `KameleoonException.StorageWrite` Couldn't update storage data
|
|
51
|
-
|
|
51
|
+
*/
|
|
52
52
|
trackConversion: ({ visitorCode, goalId, revenue, }: TrackConversionParamsType) => void;
|
|
53
53
|
/**
|
|
54
54
|
* @method flushData - takes visitor associated kameleoon data and sends the data tracking request with collected data
|
|
@@ -58,7 +58,7 @@ export interface IKameleoonClient {
|
|
|
58
58
|
* @throws `KameleoonError` with one of the following `type` s:
|
|
59
59
|
*
|
|
60
60
|
* - `KameleoonException.Initialization` - Method was executed before `initialize` was done for `kameleoonClient`
|
|
61
|
-
|
|
61
|
+
*/
|
|
62
62
|
flushData: (visitorCode: string) => void;
|
|
63
63
|
/**
|
|
64
64
|
* @method getExperiments - returns a list of experiments stored in the client configuration
|
|
@@ -66,7 +66,7 @@ export interface IKameleoonClient {
|
|
|
66
66
|
* @throws `KameleoonError` with one of the following `type` s:
|
|
67
67
|
*
|
|
68
68
|
* - `KameleoonException.Initialization` - Method was executed before `initialize` was done for `kameleoonClient`
|
|
69
|
-
|
|
69
|
+
*/
|
|
70
70
|
getExperiments: () => ExperimentType[];
|
|
71
71
|
/**
|
|
72
72
|
* @method getVisitorExperiments - returns a list of experiments that the visitor with `visitorCode` is targeted by and that are *active* for the visitor (visitor will have one of the variations allocated if the experiment will be triggered).
|
|
@@ -77,15 +77,25 @@ export interface IKameleoonClient {
|
|
|
77
77
|
*
|
|
78
78
|
* - `KameleoonException.VisitorCodeMaxLength` - The visitor code length was exceeded
|
|
79
79
|
* - `KameleoonException.Initialization` - Method was executed before `initialize` was done for `kameleoonClient`
|
|
80
|
-
|
|
80
|
+
*/
|
|
81
81
|
getVisitorExperiments: (visitorCode: string, isAllocated?: boolean) => ExperimentType[];
|
|
82
|
+
/**
|
|
83
|
+
* @method getExperimentVariationData - returns variation data in JSON format for the variation with `variationId`
|
|
84
|
+
* @param {number} variationId - id of variation
|
|
85
|
+
* @returns {JSONType} variation data in JSON format
|
|
86
|
+
* @throws `KameleoonError` with one of the following `type` s:
|
|
87
|
+
* - `KameleoonException.Initialization` - Method was executed before `initialize` was done for `kameleoonClient`
|
|
88
|
+
* - `KameleoonException.JSONParse` - Couldn't pass JSON value
|
|
89
|
+
* - `KameleoonException.VariationNotFound` - No variation found for provided `variationId`
|
|
90
|
+
*/
|
|
91
|
+
getExperimentVariationData: (variationId: number) => JSONType | null;
|
|
82
92
|
/**
|
|
83
93
|
* @method getFeatureFlags - returns a list of feature flags stored in the client configuration
|
|
84
94
|
* @returns {FeatureFlagType[]} a list of all feature flags items with `id` and `key` fields
|
|
85
95
|
* @throws `KameleoonError` with one of the following `type` s:
|
|
86
96
|
*
|
|
87
97
|
* - `KameleoonException.Initialization` - Method was executed before `initialize` was done for `kameleoonClient`
|
|
88
|
-
|
|
98
|
+
*/
|
|
89
99
|
getFeatureFlags: () => FeatureFlagType[];
|
|
90
100
|
/**
|
|
91
101
|
* @method getVisitorFeatureFlags - returns a list of feature flags that the visitor with `visitorCode` that is targeted by and that are *active* for the visitor (visitor will have one of the variations allocated).
|
|
@@ -96,10 +106,10 @@ export interface IKameleoonClient {
|
|
|
96
106
|
* - `KameleoonException.VisitorCodeMaxLength` - The visitor code length was exceeded
|
|
97
107
|
* - `KameleoonException.Initialization` - Method was executed before `initialize` was done for `kameleoonClient`
|
|
98
108
|
* - `KameleoonException.NotTargeted` - Current visitor is not targeted
|
|
99
|
-
|
|
109
|
+
*/
|
|
100
110
|
getVisitorFeatureFlags: (visitorCode: string) => FeatureFlagType[];
|
|
101
111
|
/**
|
|
102
|
-
* @method isFeatureFlagActive - returns a boolean indicating whether the visitor with `visitorCode` has `featureKey` active for him, this method includes targeting check, finding the according variation exposed to the visitor and saving it to storage along with sending tracking request
|
|
112
|
+
* @method isFeatureFlagActive - returns a boolean indicating whether the visitor with `visitorCode` has `featureKey` active for him, this method includes targeting check, finding the according variation exposed to the visitor and saving it to storage along with sending tracking request
|
|
103
113
|
* @param {string} visitorCode - unique visitor identification string, can't exceed 255 characters length
|
|
104
114
|
* @param {string} featureKey - a unique key for feature flag
|
|
105
115
|
* @returns {boolean} a boolean indicator of whether the feature flag with `featureKey` is active for visitor with `visitorCode`
|
|
@@ -110,10 +120,10 @@ export interface IKameleoonClient {
|
|
|
110
120
|
* - `KameleoonException.FeatureFlagConfigurationNotFound` - No feature flag was found for provided `visitorCode` and `featureKey`
|
|
111
121
|
* - `KameleoonException.DataInconsistency` - Allocated variation was found but there is no feature flag with according `featureKey`.
|
|
112
122
|
* - `KameleoonException.NotTargeted` - Current visitor is not targeted
|
|
113
|
-
|
|
123
|
+
*/
|
|
114
124
|
isFeatureFlagActive: (visitorCode: string, featureKey: string) => boolean;
|
|
115
125
|
/**
|
|
116
|
-
* @method getFeatureFlagVariationKey - returns variation key for the visitor under `visitorCode` in the found feature flag, this method includes targeting check, finding the according variation exposed to the visitor and saving it to storage along with sending tracking request
|
|
126
|
+
* @method getFeatureFlagVariationKey - returns variation key for the visitor under `visitorCode` in the found feature flag, this method includes targeting check, finding the according variation exposed to the visitor and saving it to storage along with sending tracking request
|
|
117
127
|
* @param {string} visitorCode - unique visitor identification string, can't exceed 255 characters length
|
|
118
128
|
* @param {string} featureKey - a unique key for feature flag
|
|
119
129
|
* @returns {string} a string containing variable key for the allocated feature flag variation for the provided visitor
|
|
@@ -123,10 +133,10 @@ export interface IKameleoonClient {
|
|
|
123
133
|
* - `KameleoonException.Initialization` - Method was executed before `initialize` was done for `kameleoonClient`
|
|
124
134
|
* - `KameleoonException.FeatureFlagConfigurationNotFound` - No feature flag was found for provided `visitorCode` and `featureKey`
|
|
125
135
|
* - `KameleoonException.NotTargeted` - Current visitor is not targeted
|
|
126
|
-
|
|
136
|
+
*/
|
|
127
137
|
getFeatureFlagVariationKey: (visitorCode: string, featureKey: string) => string;
|
|
128
138
|
/**
|
|
129
|
-
* @method getFeatureFlagVariable - returns a variable for the visitor under `visitorCode` in the found feature flag, this method includes targeting check, finding the according variation exposed to the visitor and saving it to storage along with sending tracking request
|
|
139
|
+
* @method getFeatureFlagVariable - returns a variable for the visitor under `visitorCode` in the found feature flag, this method includes targeting check, finding the according variation exposed to the visitor and saving it to storage along with sending tracking request
|
|
130
140
|
* @param {GetFeatureFlagVariableParamsType} parameters - an object with parameters of a type `GetFeatureFlagVariableParamsType`, see the type for details.
|
|
131
141
|
* @returns {FeatureVariableResultType} a variable object containing `type` and `value` fields, `type` can be checked against `FeatureVariableType` enum, if the `type` is `FeatureVariableType.BOOLEAN` then the `value` type will be `boolean` and so on.
|
|
132
142
|
* @throws `KameleoonError` with one of the following `type` s:
|
|
@@ -137,7 +147,7 @@ export interface IKameleoonClient {
|
|
|
137
147
|
* - `KameleoonException.NotTargeted` - Current visitor is not targeted
|
|
138
148
|
* - `KameleoonException.JSONParse` - Couldn't pass JSON value
|
|
139
149
|
* - `KameleoonException.NumberParse` - Couldn't pass Number value
|
|
140
|
-
|
|
150
|
+
*/
|
|
141
151
|
getFeatureFlagVariable: ({ visitorCode, featureKey, variableKey, }: GetFeatureFlagVariableParamsType) => FeatureVariableResultType;
|
|
142
152
|
/**
|
|
143
153
|
* @method getRemoteData - returns a data which is stored for specified siteCode on a remote Kameleoon server.
|
|
@@ -146,7 +156,7 @@ export interface IKameleoonClient {
|
|
|
146
156
|
* @throws `KameleoonError` with one of the following `type` s:
|
|
147
157
|
*
|
|
148
158
|
* - `KameleoonException.RemoteData` - Couldn't retrieve data from Kameleoon server
|
|
149
|
-
|
|
159
|
+
*/
|
|
150
160
|
getRemoteData: (key: string) => Promise<JSONType>;
|
|
151
161
|
/**
|
|
152
162
|
* @method onConfigurationUpdate - fires a callback on client configuration update. Note: this method only works for server sent events of real time update.
|
|
@@ -155,19 +165,20 @@ export interface IKameleoonClient {
|
|
|
155
165
|
* @throws `KameleoonError` with one of the following `type` s:
|
|
156
166
|
*
|
|
157
167
|
* - `KameleoonException.Initialization` - Method was executed before `initialize` was done for `kameleoonClient`
|
|
158
|
-
|
|
168
|
+
*/
|
|
159
169
|
onConfigurationUpdate: (callback: () => void) => void;
|
|
160
170
|
}
|
|
161
171
|
/**
|
|
162
172
|
* @class
|
|
163
173
|
* KameleoonClient - a class for creating kameleoon client instance
|
|
164
174
|
* for communicating with Kameleoon JavaScript SDK Core, when new instance is created
|
|
165
|
-
|
|
175
|
+
*/
|
|
166
176
|
export declare class KameleoonClient implements IKameleoonClient {
|
|
167
177
|
private internalConfiguration;
|
|
168
178
|
private variationConfiguration?;
|
|
169
179
|
private campaignConfiguration?;
|
|
170
180
|
private settings;
|
|
181
|
+
private trackingCache;
|
|
171
182
|
private requester;
|
|
172
183
|
/**
|
|
173
184
|
* @param {SDKCoreParameters} sdkCoreParameters - parameters for initializing sdk core
|
|
@@ -180,6 +191,7 @@ export declare class KameleoonClient implements IKameleoonClient {
|
|
|
180
191
|
flushData(visitorCode: string): void;
|
|
181
192
|
getExperiments(): ExperimentType[];
|
|
182
193
|
getVisitorExperiments(visitorCode: string, isActive?: boolean): ExperimentType[];
|
|
194
|
+
getExperimentVariationData(variationId: number): JSONType;
|
|
183
195
|
getFeatureFlags(): FeatureFlagType[];
|
|
184
196
|
getVisitorFeatureFlags(visitorCode: string): FeatureFlagType[];
|
|
185
197
|
getFeatureFlagVariationKey(visitorCode: string, featureKey: string): string;
|
|
@@ -187,5 +199,6 @@ export declare class KameleoonClient implements IKameleoonClient {
|
|
|
187
199
|
isFeatureFlagActive(visitorCode: string, featureKey: string): boolean;
|
|
188
200
|
getRemoteData(key: string): Promise<JSONType>;
|
|
189
201
|
onConfigurationUpdate(callback: () => void): void;
|
|
202
|
+
protected _getEngineTrackingCode(visitorCode: string): string;
|
|
190
203
|
private _getFeatureFlagVariation;
|
|
191
204
|
}
|