@salesforce/lds-adapters-cdp-personalization-service 1.299.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/LICENSE.txt +82 -0
- package/dist/es/es2018/cdp-personalization-service.js +2067 -0
- package/dist/es/es2018/types/src/generated/adapters/adapter-utils.d.ts +62 -0
- package/dist/es/es2018/types/src/generated/adapters/createPersonalizationPoint.d.ts +25 -0
- package/dist/es/es2018/types/src/generated/adapters/deletePersonalizationPoint.d.ts +14 -0
- package/dist/es/es2018/types/src/generated/adapters/getPersonalizationPoint.d.ts +27 -0
- package/dist/es/es2018/types/src/generated/adapters/updatePersonalizationPoint.d.ts +26 -0
- package/dist/es/es2018/types/src/generated/artifacts/main.d.ts +4 -0
- package/dist/es/es2018/types/src/generated/artifacts/sfdc.d.ts +6 -0
- package/dist/es/es2018/types/src/generated/resources/deletePersonalizationPersonalizationPointsByIdOrName.d.ts +12 -0
- package/dist/es/es2018/types/src/generated/resources/getPersonalizationPersonalizationPointsByIdOrName.d.ts +15 -0
- package/dist/es/es2018/types/src/generated/resources/postPersonalizationPersonalizationPoints.d.ts +22 -0
- package/dist/es/es2018/types/src/generated/resources/putPersonalizationPersonalizationPointsByIdOrName.d.ts +25 -0
- package/dist/es/es2018/types/src/generated/types/ABnExperimentCohortInputRepresentation.d.ts +46 -0
- package/dist/es/es2018/types/src/generated/types/ABnExperimentInputRepresentation.d.ts +52 -0
- package/dist/es/es2018/types/src/generated/types/ABnExperimentRepresentation.d.ts +79 -0
- package/dist/es/es2018/types/src/generated/types/PersonalizationAttributeValueInputRepresentation.d.ts +34 -0
- package/dist/es/es2018/types/src/generated/types/PersonalizationAttributeValueRepresentation.d.ts +34 -0
- package/dist/es/es2018/types/src/generated/types/PersonalizationDecisionInputRepresentation.d.ts +44 -0
- package/dist/es/es2018/types/src/generated/types/PersonalizationDecisionRepresentation.d.ts +62 -0
- package/dist/es/es2018/types/src/generated/types/PersonalizationPointInputRepresentation.d.ts +56 -0
- package/dist/es/es2018/types/src/generated/types/PersonalizationPointRepresentation.d.ts +87 -0
- package/dist/es/es2018/types/src/generated/types/type-utils.d.ts +32 -0
- package/package.json +66 -0
- package/sfdc/index.d.ts +1 -0
- package/sfdc/index.js +2117 -0
- package/src/raml/api.raml +458 -0
- package/src/raml/luvio.raml +34 -0
package/sfdc/index.js
ADDED
|
@@ -0,0 +1,2117 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Copyright (c) 2022, Salesforce, Inc.,
|
|
3
|
+
* All rights reserved.
|
|
4
|
+
* For full license text, see the LICENSE.txt file
|
|
5
|
+
*/
|
|
6
|
+
|
|
7
|
+
/*
|
|
8
|
+
* ATTENTION!
|
|
9
|
+
* THIS IS A GENERATED FILE FROM https://github.com/salesforce-experience-platform-emu/lds-lightning-platform
|
|
10
|
+
* If you would like to contribute to LDS, please follow the steps outlined in the git repo.
|
|
11
|
+
* Any changes made to this file in p4 will be automatically overwritten.
|
|
12
|
+
* *******************************************************************************************
|
|
13
|
+
*/
|
|
14
|
+
/* proxy-compat-disable */
|
|
15
|
+
import { createInstrumentedAdapter, createLDSAdapter, createWireAdapterConstructor, createImperativeAdapter } from 'force/ldsBindings';
|
|
16
|
+
import { withDefaultLuvio } from 'force/ldsEngine';
|
|
17
|
+
import { serializeStructuredKey, ingestShape, deepFreeze, StoreKeyMap, createResourceParams as createResourceParams$4, typeCheckConfig as typeCheckConfig$4, buildNetworkSnapshotCachePolicy as buildNetworkSnapshotCachePolicy$1 } from 'force/luvioEngine';
|
|
18
|
+
|
|
19
|
+
const { hasOwnProperty: ObjectPrototypeHasOwnProperty } = Object.prototype;
|
|
20
|
+
const { keys: ObjectKeys, create: ObjectCreate } = Object;
|
|
21
|
+
const { isArray: ArrayIsArray$1 } = Array;
|
|
22
|
+
/**
|
|
23
|
+
* Validates an adapter config is well-formed.
|
|
24
|
+
* @param config The config to validate.
|
|
25
|
+
* @param adapter The adapter validation configuration.
|
|
26
|
+
* @param oneOf The keys the config must contain at least one of.
|
|
27
|
+
* @throws A TypeError if config doesn't satisfy the adapter's config validation.
|
|
28
|
+
*/
|
|
29
|
+
function validateConfig(config, adapter, oneOf) {
|
|
30
|
+
const { displayName } = adapter;
|
|
31
|
+
const { required, optional, unsupported } = adapter.parameters;
|
|
32
|
+
if (config === undefined ||
|
|
33
|
+
required.every(req => ObjectPrototypeHasOwnProperty.call(config, req)) === false) {
|
|
34
|
+
throw new TypeError(`adapter ${displayName} configuration must specify ${required.sort().join(', ')}`);
|
|
35
|
+
}
|
|
36
|
+
if (oneOf && oneOf.some(req => ObjectPrototypeHasOwnProperty.call(config, req)) === false) {
|
|
37
|
+
throw new TypeError(`adapter ${displayName} configuration must specify one of ${oneOf.sort().join(', ')}`);
|
|
38
|
+
}
|
|
39
|
+
if (unsupported !== undefined &&
|
|
40
|
+
unsupported.some(req => ObjectPrototypeHasOwnProperty.call(config, req))) {
|
|
41
|
+
throw new TypeError(`adapter ${displayName} does not yet support ${unsupported.sort().join(', ')}`);
|
|
42
|
+
}
|
|
43
|
+
const supported = required.concat(optional);
|
|
44
|
+
if (ObjectKeys(config).some(key => !supported.includes(key))) {
|
|
45
|
+
throw new TypeError(`adapter ${displayName} configuration supports only ${supported.sort().join(', ')}`);
|
|
46
|
+
}
|
|
47
|
+
}
|
|
48
|
+
function untrustedIsObject(untrusted) {
|
|
49
|
+
return typeof untrusted === 'object' && untrusted !== null && ArrayIsArray$1(untrusted) === false;
|
|
50
|
+
}
|
|
51
|
+
function areRequiredParametersPresent(config, configPropertyNames) {
|
|
52
|
+
return configPropertyNames.parameters.required.every(req => req in config);
|
|
53
|
+
}
|
|
54
|
+
const snapshotRefreshOptions = {
|
|
55
|
+
overrides: {
|
|
56
|
+
headers: {
|
|
57
|
+
'Cache-Control': 'no-cache',
|
|
58
|
+
},
|
|
59
|
+
}
|
|
60
|
+
};
|
|
61
|
+
function generateParamConfigMetadata(name, required, resourceType, typeCheckShape, isArrayShape = false, coerceFn) {
|
|
62
|
+
return {
|
|
63
|
+
name,
|
|
64
|
+
required,
|
|
65
|
+
resourceType,
|
|
66
|
+
typeCheckShape,
|
|
67
|
+
isArrayShape,
|
|
68
|
+
coerceFn,
|
|
69
|
+
};
|
|
70
|
+
}
|
|
71
|
+
function buildAdapterValidationConfig(displayName, paramsMeta) {
|
|
72
|
+
const required = paramsMeta.filter(p => p.required).map(p => p.name);
|
|
73
|
+
const optional = paramsMeta.filter(p => !p.required).map(p => p.name);
|
|
74
|
+
return {
|
|
75
|
+
displayName,
|
|
76
|
+
parameters: {
|
|
77
|
+
required,
|
|
78
|
+
optional,
|
|
79
|
+
}
|
|
80
|
+
};
|
|
81
|
+
}
|
|
82
|
+
const keyPrefix = 'personalization-service';
|
|
83
|
+
|
|
84
|
+
const { isArray: ArrayIsArray } = Array;
|
|
85
|
+
function equalsArray(a, b, equalsItem) {
|
|
86
|
+
const aLength = a.length;
|
|
87
|
+
const bLength = b.length;
|
|
88
|
+
if (aLength !== bLength) {
|
|
89
|
+
return false;
|
|
90
|
+
}
|
|
91
|
+
for (let i = 0; i < aLength; i++) {
|
|
92
|
+
if (equalsItem(a[i], b[i]) === false) {
|
|
93
|
+
return false;
|
|
94
|
+
}
|
|
95
|
+
}
|
|
96
|
+
return true;
|
|
97
|
+
}
|
|
98
|
+
function createLink(ref) {
|
|
99
|
+
return {
|
|
100
|
+
__ref: serializeStructuredKey(ref),
|
|
101
|
+
};
|
|
102
|
+
}
|
|
103
|
+
|
|
104
|
+
function validate$4(obj, path = 'PersonalizationAttributeValueInputRepresentation') {
|
|
105
|
+
const v_error = (() => {
|
|
106
|
+
if (typeof obj !== 'object' || ArrayIsArray(obj) || obj === null) {
|
|
107
|
+
return new TypeError('Expected "object" but received "' + typeof obj + '" (at "' + path + '")');
|
|
108
|
+
}
|
|
109
|
+
const obj_attributeEnum = obj.attributeEnum;
|
|
110
|
+
const path_attributeEnum = path + '.attributeEnum';
|
|
111
|
+
let obj_attributeEnum_union0 = null;
|
|
112
|
+
const obj_attributeEnum_union0_error = (() => {
|
|
113
|
+
if (typeof obj_attributeEnum !== 'string') {
|
|
114
|
+
return new TypeError('Expected "string" but received "' + typeof obj_attributeEnum + '" (at "' + path_attributeEnum + '")');
|
|
115
|
+
}
|
|
116
|
+
})();
|
|
117
|
+
if (obj_attributeEnum_union0_error != null) {
|
|
118
|
+
obj_attributeEnum_union0 = obj_attributeEnum_union0_error.message;
|
|
119
|
+
}
|
|
120
|
+
let obj_attributeEnum_union1 = null;
|
|
121
|
+
const obj_attributeEnum_union1_error = (() => {
|
|
122
|
+
if (obj_attributeEnum !== null) {
|
|
123
|
+
return new TypeError('Expected "null" but received "' + typeof obj_attributeEnum + '" (at "' + path_attributeEnum + '")');
|
|
124
|
+
}
|
|
125
|
+
})();
|
|
126
|
+
if (obj_attributeEnum_union1_error != null) {
|
|
127
|
+
obj_attributeEnum_union1 = obj_attributeEnum_union1_error.message;
|
|
128
|
+
}
|
|
129
|
+
if (obj_attributeEnum_union0 && obj_attributeEnum_union1) {
|
|
130
|
+
let message = 'Object doesn\'t match union (at "' + path_attributeEnum + '")';
|
|
131
|
+
message += '\n' + obj_attributeEnum_union0.split('\n').map((line) => '\t' + line).join('\n');
|
|
132
|
+
message += '\n' + obj_attributeEnum_union1.split('\n').map((line) => '\t' + line).join('\n');
|
|
133
|
+
return new TypeError(message);
|
|
134
|
+
}
|
|
135
|
+
const obj_attributeName = obj.attributeName;
|
|
136
|
+
const path_attributeName = path + '.attributeName';
|
|
137
|
+
let obj_attributeName_union0 = null;
|
|
138
|
+
const obj_attributeName_union0_error = (() => {
|
|
139
|
+
if (typeof obj_attributeName !== 'string') {
|
|
140
|
+
return new TypeError('Expected "string" but received "' + typeof obj_attributeName + '" (at "' + path_attributeName + '")');
|
|
141
|
+
}
|
|
142
|
+
})();
|
|
143
|
+
if (obj_attributeName_union0_error != null) {
|
|
144
|
+
obj_attributeName_union0 = obj_attributeName_union0_error.message;
|
|
145
|
+
}
|
|
146
|
+
let obj_attributeName_union1 = null;
|
|
147
|
+
const obj_attributeName_union1_error = (() => {
|
|
148
|
+
if (obj_attributeName !== null) {
|
|
149
|
+
return new TypeError('Expected "null" but received "' + typeof obj_attributeName + '" (at "' + path_attributeName + '")');
|
|
150
|
+
}
|
|
151
|
+
})();
|
|
152
|
+
if (obj_attributeName_union1_error != null) {
|
|
153
|
+
obj_attributeName_union1 = obj_attributeName_union1_error.message;
|
|
154
|
+
}
|
|
155
|
+
if (obj_attributeName_union0 && obj_attributeName_union1) {
|
|
156
|
+
let message = 'Object doesn\'t match union (at "' + path_attributeName + '")';
|
|
157
|
+
message += '\n' + obj_attributeName_union0.split('\n').map((line) => '\t' + line).join('\n');
|
|
158
|
+
message += '\n' + obj_attributeName_union1.split('\n').map((line) => '\t' + line).join('\n');
|
|
159
|
+
return new TypeError(message);
|
|
160
|
+
}
|
|
161
|
+
const obj_value = obj.value;
|
|
162
|
+
const path_value = path + '.value';
|
|
163
|
+
let obj_value_union0 = null;
|
|
164
|
+
const obj_value_union0_error = (() => {
|
|
165
|
+
if (typeof obj_value !== 'string') {
|
|
166
|
+
return new TypeError('Expected "string" but received "' + typeof obj_value + '" (at "' + path_value + '")');
|
|
167
|
+
}
|
|
168
|
+
})();
|
|
169
|
+
if (obj_value_union0_error != null) {
|
|
170
|
+
obj_value_union0 = obj_value_union0_error.message;
|
|
171
|
+
}
|
|
172
|
+
let obj_value_union1 = null;
|
|
173
|
+
const obj_value_union1_error = (() => {
|
|
174
|
+
if (obj_value !== null) {
|
|
175
|
+
return new TypeError('Expected "null" but received "' + typeof obj_value + '" (at "' + path_value + '")');
|
|
176
|
+
}
|
|
177
|
+
})();
|
|
178
|
+
if (obj_value_union1_error != null) {
|
|
179
|
+
obj_value_union1 = obj_value_union1_error.message;
|
|
180
|
+
}
|
|
181
|
+
if (obj_value_union0 && obj_value_union1) {
|
|
182
|
+
let message = 'Object doesn\'t match union (at "' + path_value + '")';
|
|
183
|
+
message += '\n' + obj_value_union0.split('\n').map((line) => '\t' + line).join('\n');
|
|
184
|
+
message += '\n' + obj_value_union1.split('\n').map((line) => '\t' + line).join('\n');
|
|
185
|
+
return new TypeError(message);
|
|
186
|
+
}
|
|
187
|
+
})();
|
|
188
|
+
return v_error === undefined ? null : v_error;
|
|
189
|
+
}
|
|
190
|
+
|
|
191
|
+
function validate$3(obj, path = 'PersonalizationDecisionInputRepresentation') {
|
|
192
|
+
const v_error = (() => {
|
|
193
|
+
if (typeof obj !== 'object' || ArrayIsArray(obj) || obj === null) {
|
|
194
|
+
return new TypeError('Expected "object" but received "' + typeof obj + '" (at "' + path + '")');
|
|
195
|
+
}
|
|
196
|
+
const obj_attributeValues = obj.attributeValues;
|
|
197
|
+
const path_attributeValues = path + '.attributeValues';
|
|
198
|
+
if (!ArrayIsArray(obj_attributeValues)) {
|
|
199
|
+
return new TypeError('Expected "array" but received "' + typeof obj_attributeValues + '" (at "' + path_attributeValues + '")');
|
|
200
|
+
}
|
|
201
|
+
for (let i = 0; i < obj_attributeValues.length; i++) {
|
|
202
|
+
const obj_attributeValues_item = obj_attributeValues[i];
|
|
203
|
+
const path_attributeValues_item = path_attributeValues + '[' + i + ']';
|
|
204
|
+
const referencepath_attributeValues_itemValidationError = validate$4(obj_attributeValues_item, path_attributeValues_item);
|
|
205
|
+
if (referencepath_attributeValues_itemValidationError !== null) {
|
|
206
|
+
let message = 'Object doesn\'t match PersonalizationAttributeValueInputRepresentation (at "' + path_attributeValues_item + '")\n';
|
|
207
|
+
message += referencepath_attributeValues_itemValidationError.message.split('\n').map((line) => '\t' + line).join('\n');
|
|
208
|
+
return new TypeError(message);
|
|
209
|
+
}
|
|
210
|
+
}
|
|
211
|
+
const obj_criteria = obj.criteria;
|
|
212
|
+
const path_criteria = path + '.criteria';
|
|
213
|
+
let obj_criteria_union0 = null;
|
|
214
|
+
const obj_criteria_union0_error = (() => {
|
|
215
|
+
if (typeof obj_criteria !== 'string') {
|
|
216
|
+
return new TypeError('Expected "string" but received "' + typeof obj_criteria + '" (at "' + path_criteria + '")');
|
|
217
|
+
}
|
|
218
|
+
})();
|
|
219
|
+
if (obj_criteria_union0_error != null) {
|
|
220
|
+
obj_criteria_union0 = obj_criteria_union0_error.message;
|
|
221
|
+
}
|
|
222
|
+
let obj_criteria_union1 = null;
|
|
223
|
+
const obj_criteria_union1_error = (() => {
|
|
224
|
+
if (obj_criteria !== null) {
|
|
225
|
+
return new TypeError('Expected "null" but received "' + typeof obj_criteria + '" (at "' + path_criteria + '")');
|
|
226
|
+
}
|
|
227
|
+
})();
|
|
228
|
+
if (obj_criteria_union1_error != null) {
|
|
229
|
+
obj_criteria_union1 = obj_criteria_union1_error.message;
|
|
230
|
+
}
|
|
231
|
+
if (obj_criteria_union0 && obj_criteria_union1) {
|
|
232
|
+
let message = 'Object doesn\'t match union (at "' + path_criteria + '")';
|
|
233
|
+
message += '\n' + obj_criteria_union0.split('\n').map((line) => '\t' + line).join('\n');
|
|
234
|
+
message += '\n' + obj_criteria_union1.split('\n').map((line) => '\t' + line).join('\n');
|
|
235
|
+
return new TypeError(message);
|
|
236
|
+
}
|
|
237
|
+
const obj_description = obj.description;
|
|
238
|
+
const path_description = path + '.description';
|
|
239
|
+
let obj_description_union0 = null;
|
|
240
|
+
const obj_description_union0_error = (() => {
|
|
241
|
+
if (typeof obj_description !== 'string') {
|
|
242
|
+
return new TypeError('Expected "string" but received "' + typeof obj_description + '" (at "' + path_description + '")');
|
|
243
|
+
}
|
|
244
|
+
})();
|
|
245
|
+
if (obj_description_union0_error != null) {
|
|
246
|
+
obj_description_union0 = obj_description_union0_error.message;
|
|
247
|
+
}
|
|
248
|
+
let obj_description_union1 = null;
|
|
249
|
+
const obj_description_union1_error = (() => {
|
|
250
|
+
if (obj_description !== null) {
|
|
251
|
+
return new TypeError('Expected "null" but received "' + typeof obj_description + '" (at "' + path_description + '")');
|
|
252
|
+
}
|
|
253
|
+
})();
|
|
254
|
+
if (obj_description_union1_error != null) {
|
|
255
|
+
obj_description_union1 = obj_description_union1_error.message;
|
|
256
|
+
}
|
|
257
|
+
if (obj_description_union0 && obj_description_union1) {
|
|
258
|
+
let message = 'Object doesn\'t match union (at "' + path_description + '")';
|
|
259
|
+
message += '\n' + obj_description_union0.split('\n').map((line) => '\t' + line).join('\n');
|
|
260
|
+
message += '\n' + obj_description_union1.split('\n').map((line) => '\t' + line).join('\n');
|
|
261
|
+
return new TypeError(message);
|
|
262
|
+
}
|
|
263
|
+
const obj_label = obj.label;
|
|
264
|
+
const path_label = path + '.label';
|
|
265
|
+
let obj_label_union0 = null;
|
|
266
|
+
const obj_label_union0_error = (() => {
|
|
267
|
+
if (typeof obj_label !== 'string') {
|
|
268
|
+
return new TypeError('Expected "string" but received "' + typeof obj_label + '" (at "' + path_label + '")');
|
|
269
|
+
}
|
|
270
|
+
})();
|
|
271
|
+
if (obj_label_union0_error != null) {
|
|
272
|
+
obj_label_union0 = obj_label_union0_error.message;
|
|
273
|
+
}
|
|
274
|
+
let obj_label_union1 = null;
|
|
275
|
+
const obj_label_union1_error = (() => {
|
|
276
|
+
if (obj_label !== null) {
|
|
277
|
+
return new TypeError('Expected "null" but received "' + typeof obj_label + '" (at "' + path_label + '")');
|
|
278
|
+
}
|
|
279
|
+
})();
|
|
280
|
+
if (obj_label_union1_error != null) {
|
|
281
|
+
obj_label_union1 = obj_label_union1_error.message;
|
|
282
|
+
}
|
|
283
|
+
if (obj_label_union0 && obj_label_union1) {
|
|
284
|
+
let message = 'Object doesn\'t match union (at "' + path_label + '")';
|
|
285
|
+
message += '\n' + obj_label_union0.split('\n').map((line) => '\t' + line).join('\n');
|
|
286
|
+
message += '\n' + obj_label_union1.split('\n').map((line) => '\t' + line).join('\n');
|
|
287
|
+
return new TypeError(message);
|
|
288
|
+
}
|
|
289
|
+
const obj_name = obj.name;
|
|
290
|
+
const path_name = path + '.name';
|
|
291
|
+
let obj_name_union0 = null;
|
|
292
|
+
const obj_name_union0_error = (() => {
|
|
293
|
+
if (typeof obj_name !== 'string') {
|
|
294
|
+
return new TypeError('Expected "string" but received "' + typeof obj_name + '" (at "' + path_name + '")');
|
|
295
|
+
}
|
|
296
|
+
})();
|
|
297
|
+
if (obj_name_union0_error != null) {
|
|
298
|
+
obj_name_union0 = obj_name_union0_error.message;
|
|
299
|
+
}
|
|
300
|
+
let obj_name_union1 = null;
|
|
301
|
+
const obj_name_union1_error = (() => {
|
|
302
|
+
if (obj_name !== null) {
|
|
303
|
+
return new TypeError('Expected "null" but received "' + typeof obj_name + '" (at "' + path_name + '")');
|
|
304
|
+
}
|
|
305
|
+
})();
|
|
306
|
+
if (obj_name_union1_error != null) {
|
|
307
|
+
obj_name_union1 = obj_name_union1_error.message;
|
|
308
|
+
}
|
|
309
|
+
if (obj_name_union0 && obj_name_union1) {
|
|
310
|
+
let message = 'Object doesn\'t match union (at "' + path_name + '")';
|
|
311
|
+
message += '\n' + obj_name_union0.split('\n').map((line) => '\t' + line).join('\n');
|
|
312
|
+
message += '\n' + obj_name_union1.split('\n').map((line) => '\t' + line).join('\n');
|
|
313
|
+
return new TypeError(message);
|
|
314
|
+
}
|
|
315
|
+
const obj_personalizerName = obj.personalizerName;
|
|
316
|
+
const path_personalizerName = path + '.personalizerName';
|
|
317
|
+
let obj_personalizerName_union0 = null;
|
|
318
|
+
const obj_personalizerName_union0_error = (() => {
|
|
319
|
+
if (typeof obj_personalizerName !== 'string') {
|
|
320
|
+
return new TypeError('Expected "string" but received "' + typeof obj_personalizerName + '" (at "' + path_personalizerName + '")');
|
|
321
|
+
}
|
|
322
|
+
})();
|
|
323
|
+
if (obj_personalizerName_union0_error != null) {
|
|
324
|
+
obj_personalizerName_union0 = obj_personalizerName_union0_error.message;
|
|
325
|
+
}
|
|
326
|
+
let obj_personalizerName_union1 = null;
|
|
327
|
+
const obj_personalizerName_union1_error = (() => {
|
|
328
|
+
if (obj_personalizerName !== null) {
|
|
329
|
+
return new TypeError('Expected "null" but received "' + typeof obj_personalizerName + '" (at "' + path_personalizerName + '")');
|
|
330
|
+
}
|
|
331
|
+
})();
|
|
332
|
+
if (obj_personalizerName_union1_error != null) {
|
|
333
|
+
obj_personalizerName_union1 = obj_personalizerName_union1_error.message;
|
|
334
|
+
}
|
|
335
|
+
if (obj_personalizerName_union0 && obj_personalizerName_union1) {
|
|
336
|
+
let message = 'Object doesn\'t match union (at "' + path_personalizerName + '")';
|
|
337
|
+
message += '\n' + obj_personalizerName_union0.split('\n').map((line) => '\t' + line).join('\n');
|
|
338
|
+
message += '\n' + obj_personalizerName_union1.split('\n').map((line) => '\t' + line).join('\n');
|
|
339
|
+
return new TypeError(message);
|
|
340
|
+
}
|
|
341
|
+
})();
|
|
342
|
+
return v_error === undefined ? null : v_error;
|
|
343
|
+
}
|
|
344
|
+
|
|
345
|
+
const VERSION$2 = "52ea9c14b7a747a28cedbcff0e7ab169";
|
|
346
|
+
function validate$2(obj, path = 'PersonalizationAttributeValueRepresentation') {
|
|
347
|
+
const v_error = (() => {
|
|
348
|
+
if (typeof obj !== 'object' || ArrayIsArray(obj) || obj === null) {
|
|
349
|
+
return new TypeError('Expected "object" but received "' + typeof obj + '" (at "' + path + '")');
|
|
350
|
+
}
|
|
351
|
+
const obj_attributeEnum = obj.attributeEnum;
|
|
352
|
+
const path_attributeEnum = path + '.attributeEnum';
|
|
353
|
+
let obj_attributeEnum_union0 = null;
|
|
354
|
+
const obj_attributeEnum_union0_error = (() => {
|
|
355
|
+
if (typeof obj_attributeEnum !== 'string') {
|
|
356
|
+
return new TypeError('Expected "string" but received "' + typeof obj_attributeEnum + '" (at "' + path_attributeEnum + '")');
|
|
357
|
+
}
|
|
358
|
+
})();
|
|
359
|
+
if (obj_attributeEnum_union0_error != null) {
|
|
360
|
+
obj_attributeEnum_union0 = obj_attributeEnum_union0_error.message;
|
|
361
|
+
}
|
|
362
|
+
let obj_attributeEnum_union1 = null;
|
|
363
|
+
const obj_attributeEnum_union1_error = (() => {
|
|
364
|
+
if (obj_attributeEnum !== null) {
|
|
365
|
+
return new TypeError('Expected "null" but received "' + typeof obj_attributeEnum + '" (at "' + path_attributeEnum + '")');
|
|
366
|
+
}
|
|
367
|
+
})();
|
|
368
|
+
if (obj_attributeEnum_union1_error != null) {
|
|
369
|
+
obj_attributeEnum_union1 = obj_attributeEnum_union1_error.message;
|
|
370
|
+
}
|
|
371
|
+
if (obj_attributeEnum_union0 && obj_attributeEnum_union1) {
|
|
372
|
+
let message = 'Object doesn\'t match union (at "' + path_attributeEnum + '")';
|
|
373
|
+
message += '\n' + obj_attributeEnum_union0.split('\n').map((line) => '\t' + line).join('\n');
|
|
374
|
+
message += '\n' + obj_attributeEnum_union1.split('\n').map((line) => '\t' + line).join('\n');
|
|
375
|
+
return new TypeError(message);
|
|
376
|
+
}
|
|
377
|
+
const obj_attributeName = obj.attributeName;
|
|
378
|
+
const path_attributeName = path + '.attributeName';
|
|
379
|
+
let obj_attributeName_union0 = null;
|
|
380
|
+
const obj_attributeName_union0_error = (() => {
|
|
381
|
+
if (typeof obj_attributeName !== 'string') {
|
|
382
|
+
return new TypeError('Expected "string" but received "' + typeof obj_attributeName + '" (at "' + path_attributeName + '")');
|
|
383
|
+
}
|
|
384
|
+
})();
|
|
385
|
+
if (obj_attributeName_union0_error != null) {
|
|
386
|
+
obj_attributeName_union0 = obj_attributeName_union0_error.message;
|
|
387
|
+
}
|
|
388
|
+
let obj_attributeName_union1 = null;
|
|
389
|
+
const obj_attributeName_union1_error = (() => {
|
|
390
|
+
if (obj_attributeName !== null) {
|
|
391
|
+
return new TypeError('Expected "null" but received "' + typeof obj_attributeName + '" (at "' + path_attributeName + '")');
|
|
392
|
+
}
|
|
393
|
+
})();
|
|
394
|
+
if (obj_attributeName_union1_error != null) {
|
|
395
|
+
obj_attributeName_union1 = obj_attributeName_union1_error.message;
|
|
396
|
+
}
|
|
397
|
+
if (obj_attributeName_union0 && obj_attributeName_union1) {
|
|
398
|
+
let message = 'Object doesn\'t match union (at "' + path_attributeName + '")';
|
|
399
|
+
message += '\n' + obj_attributeName_union0.split('\n').map((line) => '\t' + line).join('\n');
|
|
400
|
+
message += '\n' + obj_attributeName_union1.split('\n').map((line) => '\t' + line).join('\n');
|
|
401
|
+
return new TypeError(message);
|
|
402
|
+
}
|
|
403
|
+
const obj_value = obj.value;
|
|
404
|
+
const path_value = path + '.value';
|
|
405
|
+
let obj_value_union0 = null;
|
|
406
|
+
const obj_value_union0_error = (() => {
|
|
407
|
+
if (typeof obj_value !== 'string') {
|
|
408
|
+
return new TypeError('Expected "string" but received "' + typeof obj_value + '" (at "' + path_value + '")');
|
|
409
|
+
}
|
|
410
|
+
})();
|
|
411
|
+
if (obj_value_union0_error != null) {
|
|
412
|
+
obj_value_union0 = obj_value_union0_error.message;
|
|
413
|
+
}
|
|
414
|
+
let obj_value_union1 = null;
|
|
415
|
+
const obj_value_union1_error = (() => {
|
|
416
|
+
if (obj_value !== null) {
|
|
417
|
+
return new TypeError('Expected "null" but received "' + typeof obj_value + '" (at "' + path_value + '")');
|
|
418
|
+
}
|
|
419
|
+
})();
|
|
420
|
+
if (obj_value_union1_error != null) {
|
|
421
|
+
obj_value_union1 = obj_value_union1_error.message;
|
|
422
|
+
}
|
|
423
|
+
if (obj_value_union0 && obj_value_union1) {
|
|
424
|
+
let message = 'Object doesn\'t match union (at "' + path_value + '")';
|
|
425
|
+
message += '\n' + obj_value_union0.split('\n').map((line) => '\t' + line).join('\n');
|
|
426
|
+
message += '\n' + obj_value_union1.split('\n').map((line) => '\t' + line).join('\n');
|
|
427
|
+
return new TypeError(message);
|
|
428
|
+
}
|
|
429
|
+
})();
|
|
430
|
+
return v_error === undefined ? null : v_error;
|
|
431
|
+
}
|
|
432
|
+
const select$5 = function PersonalizationAttributeValueRepresentationSelect() {
|
|
433
|
+
return {
|
|
434
|
+
kind: 'Fragment',
|
|
435
|
+
version: VERSION$2,
|
|
436
|
+
private: [],
|
|
437
|
+
selections: [
|
|
438
|
+
{
|
|
439
|
+
name: 'attributeEnum',
|
|
440
|
+
kind: 'Scalar'
|
|
441
|
+
},
|
|
442
|
+
{
|
|
443
|
+
name: 'attributeName',
|
|
444
|
+
kind: 'Scalar'
|
|
445
|
+
},
|
|
446
|
+
{
|
|
447
|
+
name: 'value',
|
|
448
|
+
kind: 'Scalar'
|
|
449
|
+
}
|
|
450
|
+
]
|
|
451
|
+
};
|
|
452
|
+
};
|
|
453
|
+
function equals$2(existing, incoming) {
|
|
454
|
+
const existing_attributeEnum = existing.attributeEnum;
|
|
455
|
+
const incoming_attributeEnum = incoming.attributeEnum;
|
|
456
|
+
if (!(existing_attributeEnum === incoming_attributeEnum)) {
|
|
457
|
+
return false;
|
|
458
|
+
}
|
|
459
|
+
const existing_attributeName = existing.attributeName;
|
|
460
|
+
const incoming_attributeName = incoming.attributeName;
|
|
461
|
+
if (!(existing_attributeName === incoming_attributeName)) {
|
|
462
|
+
return false;
|
|
463
|
+
}
|
|
464
|
+
const existing_value = existing.value;
|
|
465
|
+
const incoming_value = incoming.value;
|
|
466
|
+
if (!(existing_value === incoming_value)) {
|
|
467
|
+
return false;
|
|
468
|
+
}
|
|
469
|
+
return true;
|
|
470
|
+
}
|
|
471
|
+
|
|
472
|
+
const VERSION$1 = "a3c1b816177380fe8095a6b0eb674f08";
|
|
473
|
+
function validate$1(obj, path = 'PersonalizationDecisionRepresentation') {
|
|
474
|
+
const v_error = (() => {
|
|
475
|
+
if (typeof obj !== 'object' || ArrayIsArray(obj) || obj === null) {
|
|
476
|
+
return new TypeError('Expected "object" but received "' + typeof obj + '" (at "' + path + '")');
|
|
477
|
+
}
|
|
478
|
+
const obj_attributeValues = obj.attributeValues;
|
|
479
|
+
const path_attributeValues = path + '.attributeValues';
|
|
480
|
+
if (!ArrayIsArray(obj_attributeValues)) {
|
|
481
|
+
return new TypeError('Expected "array" but received "' + typeof obj_attributeValues + '" (at "' + path_attributeValues + '")');
|
|
482
|
+
}
|
|
483
|
+
for (let i = 0; i < obj_attributeValues.length; i++) {
|
|
484
|
+
const obj_attributeValues_item = obj_attributeValues[i];
|
|
485
|
+
const path_attributeValues_item = path_attributeValues + '[' + i + ']';
|
|
486
|
+
const referencepath_attributeValues_itemValidationError = validate$2(obj_attributeValues_item, path_attributeValues_item);
|
|
487
|
+
if (referencepath_attributeValues_itemValidationError !== null) {
|
|
488
|
+
let message = 'Object doesn\'t match PersonalizationAttributeValueRepresentation (at "' + path_attributeValues_item + '")\n';
|
|
489
|
+
message += referencepath_attributeValues_itemValidationError.message.split('\n').map((line) => '\t' + line).join('\n');
|
|
490
|
+
return new TypeError(message);
|
|
491
|
+
}
|
|
492
|
+
}
|
|
493
|
+
const obj_createdById = obj.createdById;
|
|
494
|
+
const path_createdById = path + '.createdById';
|
|
495
|
+
let obj_createdById_union0 = null;
|
|
496
|
+
const obj_createdById_union0_error = (() => {
|
|
497
|
+
if (typeof obj_createdById !== 'string') {
|
|
498
|
+
return new TypeError('Expected "string" but received "' + typeof obj_createdById + '" (at "' + path_createdById + '")');
|
|
499
|
+
}
|
|
500
|
+
})();
|
|
501
|
+
if (obj_createdById_union0_error != null) {
|
|
502
|
+
obj_createdById_union0 = obj_createdById_union0_error.message;
|
|
503
|
+
}
|
|
504
|
+
let obj_createdById_union1 = null;
|
|
505
|
+
const obj_createdById_union1_error = (() => {
|
|
506
|
+
if (obj_createdById !== null) {
|
|
507
|
+
return new TypeError('Expected "null" but received "' + typeof obj_createdById + '" (at "' + path_createdById + '")');
|
|
508
|
+
}
|
|
509
|
+
})();
|
|
510
|
+
if (obj_createdById_union1_error != null) {
|
|
511
|
+
obj_createdById_union1 = obj_createdById_union1_error.message;
|
|
512
|
+
}
|
|
513
|
+
if (obj_createdById_union0 && obj_createdById_union1) {
|
|
514
|
+
let message = 'Object doesn\'t match union (at "' + path_createdById + '")';
|
|
515
|
+
message += '\n' + obj_createdById_union0.split('\n').map((line) => '\t' + line).join('\n');
|
|
516
|
+
message += '\n' + obj_createdById_union1.split('\n').map((line) => '\t' + line).join('\n');
|
|
517
|
+
return new TypeError(message);
|
|
518
|
+
}
|
|
519
|
+
const obj_createdDate = obj.createdDate;
|
|
520
|
+
const path_createdDate = path + '.createdDate';
|
|
521
|
+
let obj_createdDate_union0 = null;
|
|
522
|
+
const obj_createdDate_union0_error = (() => {
|
|
523
|
+
if (typeof obj_createdDate !== 'string') {
|
|
524
|
+
return new TypeError('Expected "string" but received "' + typeof obj_createdDate + '" (at "' + path_createdDate + '")');
|
|
525
|
+
}
|
|
526
|
+
})();
|
|
527
|
+
if (obj_createdDate_union0_error != null) {
|
|
528
|
+
obj_createdDate_union0 = obj_createdDate_union0_error.message;
|
|
529
|
+
}
|
|
530
|
+
let obj_createdDate_union1 = null;
|
|
531
|
+
const obj_createdDate_union1_error = (() => {
|
|
532
|
+
if (obj_createdDate !== null) {
|
|
533
|
+
return new TypeError('Expected "null" but received "' + typeof obj_createdDate + '" (at "' + path_createdDate + '")');
|
|
534
|
+
}
|
|
535
|
+
})();
|
|
536
|
+
if (obj_createdDate_union1_error != null) {
|
|
537
|
+
obj_createdDate_union1 = obj_createdDate_union1_error.message;
|
|
538
|
+
}
|
|
539
|
+
if (obj_createdDate_union0 && obj_createdDate_union1) {
|
|
540
|
+
let message = 'Object doesn\'t match union (at "' + path_createdDate + '")';
|
|
541
|
+
message += '\n' + obj_createdDate_union0.split('\n').map((line) => '\t' + line).join('\n');
|
|
542
|
+
message += '\n' + obj_createdDate_union1.split('\n').map((line) => '\t' + line).join('\n');
|
|
543
|
+
return new TypeError(message);
|
|
544
|
+
}
|
|
545
|
+
const obj_criteria = obj.criteria;
|
|
546
|
+
const path_criteria = path + '.criteria';
|
|
547
|
+
let obj_criteria_union0 = null;
|
|
548
|
+
const obj_criteria_union0_error = (() => {
|
|
549
|
+
if (typeof obj_criteria !== 'string') {
|
|
550
|
+
return new TypeError('Expected "string" but received "' + typeof obj_criteria + '" (at "' + path_criteria + '")');
|
|
551
|
+
}
|
|
552
|
+
})();
|
|
553
|
+
if (obj_criteria_union0_error != null) {
|
|
554
|
+
obj_criteria_union0 = obj_criteria_union0_error.message;
|
|
555
|
+
}
|
|
556
|
+
let obj_criteria_union1 = null;
|
|
557
|
+
const obj_criteria_union1_error = (() => {
|
|
558
|
+
if (obj_criteria !== null) {
|
|
559
|
+
return new TypeError('Expected "null" but received "' + typeof obj_criteria + '" (at "' + path_criteria + '")');
|
|
560
|
+
}
|
|
561
|
+
})();
|
|
562
|
+
if (obj_criteria_union1_error != null) {
|
|
563
|
+
obj_criteria_union1 = obj_criteria_union1_error.message;
|
|
564
|
+
}
|
|
565
|
+
if (obj_criteria_union0 && obj_criteria_union1) {
|
|
566
|
+
let message = 'Object doesn\'t match union (at "' + path_criteria + '")';
|
|
567
|
+
message += '\n' + obj_criteria_union0.split('\n').map((line) => '\t' + line).join('\n');
|
|
568
|
+
message += '\n' + obj_criteria_union1.split('\n').map((line) => '\t' + line).join('\n');
|
|
569
|
+
return new TypeError(message);
|
|
570
|
+
}
|
|
571
|
+
const obj_description = obj.description;
|
|
572
|
+
const path_description = path + '.description';
|
|
573
|
+
let obj_description_union0 = null;
|
|
574
|
+
const obj_description_union0_error = (() => {
|
|
575
|
+
if (typeof obj_description !== 'string') {
|
|
576
|
+
return new TypeError('Expected "string" but received "' + typeof obj_description + '" (at "' + path_description + '")');
|
|
577
|
+
}
|
|
578
|
+
})();
|
|
579
|
+
if (obj_description_union0_error != null) {
|
|
580
|
+
obj_description_union0 = obj_description_union0_error.message;
|
|
581
|
+
}
|
|
582
|
+
let obj_description_union1 = null;
|
|
583
|
+
const obj_description_union1_error = (() => {
|
|
584
|
+
if (obj_description !== null) {
|
|
585
|
+
return new TypeError('Expected "null" but received "' + typeof obj_description + '" (at "' + path_description + '")');
|
|
586
|
+
}
|
|
587
|
+
})();
|
|
588
|
+
if (obj_description_union1_error != null) {
|
|
589
|
+
obj_description_union1 = obj_description_union1_error.message;
|
|
590
|
+
}
|
|
591
|
+
if (obj_description_union0 && obj_description_union1) {
|
|
592
|
+
let message = 'Object doesn\'t match union (at "' + path_description + '")';
|
|
593
|
+
message += '\n' + obj_description_union0.split('\n').map((line) => '\t' + line).join('\n');
|
|
594
|
+
message += '\n' + obj_description_union1.split('\n').map((line) => '\t' + line).join('\n');
|
|
595
|
+
return new TypeError(message);
|
|
596
|
+
}
|
|
597
|
+
const obj_id = obj.id;
|
|
598
|
+
const path_id = path + '.id';
|
|
599
|
+
let obj_id_union0 = null;
|
|
600
|
+
const obj_id_union0_error = (() => {
|
|
601
|
+
if (typeof obj_id !== 'string') {
|
|
602
|
+
return new TypeError('Expected "string" but received "' + typeof obj_id + '" (at "' + path_id + '")');
|
|
603
|
+
}
|
|
604
|
+
})();
|
|
605
|
+
if (obj_id_union0_error != null) {
|
|
606
|
+
obj_id_union0 = obj_id_union0_error.message;
|
|
607
|
+
}
|
|
608
|
+
let obj_id_union1 = null;
|
|
609
|
+
const obj_id_union1_error = (() => {
|
|
610
|
+
if (obj_id !== null) {
|
|
611
|
+
return new TypeError('Expected "null" but received "' + typeof obj_id + '" (at "' + path_id + '")');
|
|
612
|
+
}
|
|
613
|
+
})();
|
|
614
|
+
if (obj_id_union1_error != null) {
|
|
615
|
+
obj_id_union1 = obj_id_union1_error.message;
|
|
616
|
+
}
|
|
617
|
+
if (obj_id_union0 && obj_id_union1) {
|
|
618
|
+
let message = 'Object doesn\'t match union (at "' + path_id + '")';
|
|
619
|
+
message += '\n' + obj_id_union0.split('\n').map((line) => '\t' + line).join('\n');
|
|
620
|
+
message += '\n' + obj_id_union1.split('\n').map((line) => '\t' + line).join('\n');
|
|
621
|
+
return new TypeError(message);
|
|
622
|
+
}
|
|
623
|
+
const obj_label = obj.label;
|
|
624
|
+
const path_label = path + '.label';
|
|
625
|
+
let obj_label_union0 = null;
|
|
626
|
+
const obj_label_union0_error = (() => {
|
|
627
|
+
if (typeof obj_label !== 'string') {
|
|
628
|
+
return new TypeError('Expected "string" but received "' + typeof obj_label + '" (at "' + path_label + '")');
|
|
629
|
+
}
|
|
630
|
+
})();
|
|
631
|
+
if (obj_label_union0_error != null) {
|
|
632
|
+
obj_label_union0 = obj_label_union0_error.message;
|
|
633
|
+
}
|
|
634
|
+
let obj_label_union1 = null;
|
|
635
|
+
const obj_label_union1_error = (() => {
|
|
636
|
+
if (obj_label !== null) {
|
|
637
|
+
return new TypeError('Expected "null" but received "' + typeof obj_label + '" (at "' + path_label + '")');
|
|
638
|
+
}
|
|
639
|
+
})();
|
|
640
|
+
if (obj_label_union1_error != null) {
|
|
641
|
+
obj_label_union1 = obj_label_union1_error.message;
|
|
642
|
+
}
|
|
643
|
+
if (obj_label_union0 && obj_label_union1) {
|
|
644
|
+
let message = 'Object doesn\'t match union (at "' + path_label + '")';
|
|
645
|
+
message += '\n' + obj_label_union0.split('\n').map((line) => '\t' + line).join('\n');
|
|
646
|
+
message += '\n' + obj_label_union1.split('\n').map((line) => '\t' + line).join('\n');
|
|
647
|
+
return new TypeError(message);
|
|
648
|
+
}
|
|
649
|
+
const obj_lastModifiedById = obj.lastModifiedById;
|
|
650
|
+
const path_lastModifiedById = path + '.lastModifiedById';
|
|
651
|
+
let obj_lastModifiedById_union0 = null;
|
|
652
|
+
const obj_lastModifiedById_union0_error = (() => {
|
|
653
|
+
if (typeof obj_lastModifiedById !== 'string') {
|
|
654
|
+
return new TypeError('Expected "string" but received "' + typeof obj_lastModifiedById + '" (at "' + path_lastModifiedById + '")');
|
|
655
|
+
}
|
|
656
|
+
})();
|
|
657
|
+
if (obj_lastModifiedById_union0_error != null) {
|
|
658
|
+
obj_lastModifiedById_union0 = obj_lastModifiedById_union0_error.message;
|
|
659
|
+
}
|
|
660
|
+
let obj_lastModifiedById_union1 = null;
|
|
661
|
+
const obj_lastModifiedById_union1_error = (() => {
|
|
662
|
+
if (obj_lastModifiedById !== null) {
|
|
663
|
+
return new TypeError('Expected "null" but received "' + typeof obj_lastModifiedById + '" (at "' + path_lastModifiedById + '")');
|
|
664
|
+
}
|
|
665
|
+
})();
|
|
666
|
+
if (obj_lastModifiedById_union1_error != null) {
|
|
667
|
+
obj_lastModifiedById_union1 = obj_lastModifiedById_union1_error.message;
|
|
668
|
+
}
|
|
669
|
+
if (obj_lastModifiedById_union0 && obj_lastModifiedById_union1) {
|
|
670
|
+
let message = 'Object doesn\'t match union (at "' + path_lastModifiedById + '")';
|
|
671
|
+
message += '\n' + obj_lastModifiedById_union0.split('\n').map((line) => '\t' + line).join('\n');
|
|
672
|
+
message += '\n' + obj_lastModifiedById_union1.split('\n').map((line) => '\t' + line).join('\n');
|
|
673
|
+
return new TypeError(message);
|
|
674
|
+
}
|
|
675
|
+
const obj_lastModifiedDate = obj.lastModifiedDate;
|
|
676
|
+
const path_lastModifiedDate = path + '.lastModifiedDate';
|
|
677
|
+
let obj_lastModifiedDate_union0 = null;
|
|
678
|
+
const obj_lastModifiedDate_union0_error = (() => {
|
|
679
|
+
if (typeof obj_lastModifiedDate !== 'string') {
|
|
680
|
+
return new TypeError('Expected "string" but received "' + typeof obj_lastModifiedDate + '" (at "' + path_lastModifiedDate + '")');
|
|
681
|
+
}
|
|
682
|
+
})();
|
|
683
|
+
if (obj_lastModifiedDate_union0_error != null) {
|
|
684
|
+
obj_lastModifiedDate_union0 = obj_lastModifiedDate_union0_error.message;
|
|
685
|
+
}
|
|
686
|
+
let obj_lastModifiedDate_union1 = null;
|
|
687
|
+
const obj_lastModifiedDate_union1_error = (() => {
|
|
688
|
+
if (obj_lastModifiedDate !== null) {
|
|
689
|
+
return new TypeError('Expected "null" but received "' + typeof obj_lastModifiedDate + '" (at "' + path_lastModifiedDate + '")');
|
|
690
|
+
}
|
|
691
|
+
})();
|
|
692
|
+
if (obj_lastModifiedDate_union1_error != null) {
|
|
693
|
+
obj_lastModifiedDate_union1 = obj_lastModifiedDate_union1_error.message;
|
|
694
|
+
}
|
|
695
|
+
if (obj_lastModifiedDate_union0 && obj_lastModifiedDate_union1) {
|
|
696
|
+
let message = 'Object doesn\'t match union (at "' + path_lastModifiedDate + '")';
|
|
697
|
+
message += '\n' + obj_lastModifiedDate_union0.split('\n').map((line) => '\t' + line).join('\n');
|
|
698
|
+
message += '\n' + obj_lastModifiedDate_union1.split('\n').map((line) => '\t' + line).join('\n');
|
|
699
|
+
return new TypeError(message);
|
|
700
|
+
}
|
|
701
|
+
const obj_name = obj.name;
|
|
702
|
+
const path_name = path + '.name';
|
|
703
|
+
let obj_name_union0 = null;
|
|
704
|
+
const obj_name_union0_error = (() => {
|
|
705
|
+
if (typeof obj_name !== 'string') {
|
|
706
|
+
return new TypeError('Expected "string" but received "' + typeof obj_name + '" (at "' + path_name + '")');
|
|
707
|
+
}
|
|
708
|
+
})();
|
|
709
|
+
if (obj_name_union0_error != null) {
|
|
710
|
+
obj_name_union0 = obj_name_union0_error.message;
|
|
711
|
+
}
|
|
712
|
+
let obj_name_union1 = null;
|
|
713
|
+
const obj_name_union1_error = (() => {
|
|
714
|
+
if (obj_name !== null) {
|
|
715
|
+
return new TypeError('Expected "null" but received "' + typeof obj_name + '" (at "' + path_name + '")');
|
|
716
|
+
}
|
|
717
|
+
})();
|
|
718
|
+
if (obj_name_union1_error != null) {
|
|
719
|
+
obj_name_union1 = obj_name_union1_error.message;
|
|
720
|
+
}
|
|
721
|
+
if (obj_name_union0 && obj_name_union1) {
|
|
722
|
+
let message = 'Object doesn\'t match union (at "' + path_name + '")';
|
|
723
|
+
message += '\n' + obj_name_union0.split('\n').map((line) => '\t' + line).join('\n');
|
|
724
|
+
message += '\n' + obj_name_union1.split('\n').map((line) => '\t' + line).join('\n');
|
|
725
|
+
return new TypeError(message);
|
|
726
|
+
}
|
|
727
|
+
const obj_personalizerName = obj.personalizerName;
|
|
728
|
+
const path_personalizerName = path + '.personalizerName';
|
|
729
|
+
let obj_personalizerName_union0 = null;
|
|
730
|
+
const obj_personalizerName_union0_error = (() => {
|
|
731
|
+
if (typeof obj_personalizerName !== 'string') {
|
|
732
|
+
return new TypeError('Expected "string" but received "' + typeof obj_personalizerName + '" (at "' + path_personalizerName + '")');
|
|
733
|
+
}
|
|
734
|
+
})();
|
|
735
|
+
if (obj_personalizerName_union0_error != null) {
|
|
736
|
+
obj_personalizerName_union0 = obj_personalizerName_union0_error.message;
|
|
737
|
+
}
|
|
738
|
+
let obj_personalizerName_union1 = null;
|
|
739
|
+
const obj_personalizerName_union1_error = (() => {
|
|
740
|
+
if (obj_personalizerName !== null) {
|
|
741
|
+
return new TypeError('Expected "null" but received "' + typeof obj_personalizerName + '" (at "' + path_personalizerName + '")');
|
|
742
|
+
}
|
|
743
|
+
})();
|
|
744
|
+
if (obj_personalizerName_union1_error != null) {
|
|
745
|
+
obj_personalizerName_union1 = obj_personalizerName_union1_error.message;
|
|
746
|
+
}
|
|
747
|
+
if (obj_personalizerName_union0 && obj_personalizerName_union1) {
|
|
748
|
+
let message = 'Object doesn\'t match union (at "' + path_personalizerName + '")';
|
|
749
|
+
message += '\n' + obj_personalizerName_union0.split('\n').map((line) => '\t' + line).join('\n');
|
|
750
|
+
message += '\n' + obj_personalizerName_union1.split('\n').map((line) => '\t' + line).join('\n');
|
|
751
|
+
return new TypeError(message);
|
|
752
|
+
}
|
|
753
|
+
const obj_url = obj.url;
|
|
754
|
+
const path_url = path + '.url';
|
|
755
|
+
let obj_url_union0 = null;
|
|
756
|
+
const obj_url_union0_error = (() => {
|
|
757
|
+
if (typeof obj_url !== 'string') {
|
|
758
|
+
return new TypeError('Expected "string" but received "' + typeof obj_url + '" (at "' + path_url + '")');
|
|
759
|
+
}
|
|
760
|
+
})();
|
|
761
|
+
if (obj_url_union0_error != null) {
|
|
762
|
+
obj_url_union0 = obj_url_union0_error.message;
|
|
763
|
+
}
|
|
764
|
+
let obj_url_union1 = null;
|
|
765
|
+
const obj_url_union1_error = (() => {
|
|
766
|
+
if (obj_url !== null) {
|
|
767
|
+
return new TypeError('Expected "null" but received "' + typeof obj_url + '" (at "' + path_url + '")');
|
|
768
|
+
}
|
|
769
|
+
})();
|
|
770
|
+
if (obj_url_union1_error != null) {
|
|
771
|
+
obj_url_union1 = obj_url_union1_error.message;
|
|
772
|
+
}
|
|
773
|
+
if (obj_url_union0 && obj_url_union1) {
|
|
774
|
+
let message = 'Object doesn\'t match union (at "' + path_url + '")';
|
|
775
|
+
message += '\n' + obj_url_union0.split('\n').map((line) => '\t' + line).join('\n');
|
|
776
|
+
message += '\n' + obj_url_union1.split('\n').map((line) => '\t' + line).join('\n');
|
|
777
|
+
return new TypeError(message);
|
|
778
|
+
}
|
|
779
|
+
})();
|
|
780
|
+
return v_error === undefined ? null : v_error;
|
|
781
|
+
}
|
|
782
|
+
const select$4 = function PersonalizationDecisionRepresentationSelect() {
|
|
783
|
+
const { selections: PersonalizationAttributeValueRepresentation__selections, opaque: PersonalizationAttributeValueRepresentation__opaque, } = select$5();
|
|
784
|
+
return {
|
|
785
|
+
kind: 'Fragment',
|
|
786
|
+
version: VERSION$1,
|
|
787
|
+
private: [],
|
|
788
|
+
selections: [
|
|
789
|
+
{
|
|
790
|
+
name: 'attributeValues',
|
|
791
|
+
kind: 'Object',
|
|
792
|
+
plural: true,
|
|
793
|
+
selections: PersonalizationAttributeValueRepresentation__selections
|
|
794
|
+
},
|
|
795
|
+
{
|
|
796
|
+
name: 'createdById',
|
|
797
|
+
kind: 'Scalar'
|
|
798
|
+
},
|
|
799
|
+
{
|
|
800
|
+
name: 'createdDate',
|
|
801
|
+
kind: 'Scalar'
|
|
802
|
+
},
|
|
803
|
+
{
|
|
804
|
+
name: 'criteria',
|
|
805
|
+
kind: 'Scalar'
|
|
806
|
+
},
|
|
807
|
+
{
|
|
808
|
+
name: 'description',
|
|
809
|
+
kind: 'Scalar'
|
|
810
|
+
},
|
|
811
|
+
{
|
|
812
|
+
name: 'id',
|
|
813
|
+
kind: 'Scalar'
|
|
814
|
+
},
|
|
815
|
+
{
|
|
816
|
+
name: 'label',
|
|
817
|
+
kind: 'Scalar'
|
|
818
|
+
},
|
|
819
|
+
{
|
|
820
|
+
name: 'lastModifiedById',
|
|
821
|
+
kind: 'Scalar'
|
|
822
|
+
},
|
|
823
|
+
{
|
|
824
|
+
name: 'lastModifiedDate',
|
|
825
|
+
kind: 'Scalar'
|
|
826
|
+
},
|
|
827
|
+
{
|
|
828
|
+
name: 'name',
|
|
829
|
+
kind: 'Scalar'
|
|
830
|
+
},
|
|
831
|
+
{
|
|
832
|
+
name: 'personalizerName',
|
|
833
|
+
kind: 'Scalar'
|
|
834
|
+
},
|
|
835
|
+
{
|
|
836
|
+
name: 'url',
|
|
837
|
+
kind: 'Scalar'
|
|
838
|
+
}
|
|
839
|
+
]
|
|
840
|
+
};
|
|
841
|
+
};
|
|
842
|
+
function equals$1(existing, incoming) {
|
|
843
|
+
const existing_attributeValues = existing.attributeValues;
|
|
844
|
+
const incoming_attributeValues = incoming.attributeValues;
|
|
845
|
+
const equals_attributeValues_items = equalsArray(existing_attributeValues, incoming_attributeValues, (existing_attributeValues_item, incoming_attributeValues_item) => {
|
|
846
|
+
if (!(equals$2(existing_attributeValues_item, incoming_attributeValues_item))) {
|
|
847
|
+
return false;
|
|
848
|
+
}
|
|
849
|
+
});
|
|
850
|
+
if (equals_attributeValues_items === false) {
|
|
851
|
+
return false;
|
|
852
|
+
}
|
|
853
|
+
const existing_createdById = existing.createdById;
|
|
854
|
+
const incoming_createdById = incoming.createdById;
|
|
855
|
+
if (!(existing_createdById === incoming_createdById)) {
|
|
856
|
+
return false;
|
|
857
|
+
}
|
|
858
|
+
const existing_createdDate = existing.createdDate;
|
|
859
|
+
const incoming_createdDate = incoming.createdDate;
|
|
860
|
+
if (!(existing_createdDate === incoming_createdDate)) {
|
|
861
|
+
return false;
|
|
862
|
+
}
|
|
863
|
+
const existing_criteria = existing.criteria;
|
|
864
|
+
const incoming_criteria = incoming.criteria;
|
|
865
|
+
if (!(existing_criteria === incoming_criteria)) {
|
|
866
|
+
return false;
|
|
867
|
+
}
|
|
868
|
+
const existing_description = existing.description;
|
|
869
|
+
const incoming_description = incoming.description;
|
|
870
|
+
if (!(existing_description === incoming_description)) {
|
|
871
|
+
return false;
|
|
872
|
+
}
|
|
873
|
+
const existing_id = existing.id;
|
|
874
|
+
const incoming_id = incoming.id;
|
|
875
|
+
if (!(existing_id === incoming_id)) {
|
|
876
|
+
return false;
|
|
877
|
+
}
|
|
878
|
+
const existing_label = existing.label;
|
|
879
|
+
const incoming_label = incoming.label;
|
|
880
|
+
if (!(existing_label === incoming_label)) {
|
|
881
|
+
return false;
|
|
882
|
+
}
|
|
883
|
+
const existing_lastModifiedById = existing.lastModifiedById;
|
|
884
|
+
const incoming_lastModifiedById = incoming.lastModifiedById;
|
|
885
|
+
if (!(existing_lastModifiedById === incoming_lastModifiedById)) {
|
|
886
|
+
return false;
|
|
887
|
+
}
|
|
888
|
+
const existing_lastModifiedDate = existing.lastModifiedDate;
|
|
889
|
+
const incoming_lastModifiedDate = incoming.lastModifiedDate;
|
|
890
|
+
if (!(existing_lastModifiedDate === incoming_lastModifiedDate)) {
|
|
891
|
+
return false;
|
|
892
|
+
}
|
|
893
|
+
const existing_name = existing.name;
|
|
894
|
+
const incoming_name = incoming.name;
|
|
895
|
+
if (!(existing_name === incoming_name)) {
|
|
896
|
+
return false;
|
|
897
|
+
}
|
|
898
|
+
const existing_personalizerName = existing.personalizerName;
|
|
899
|
+
const incoming_personalizerName = incoming.personalizerName;
|
|
900
|
+
if (!(existing_personalizerName === incoming_personalizerName)) {
|
|
901
|
+
return false;
|
|
902
|
+
}
|
|
903
|
+
const existing_url = existing.url;
|
|
904
|
+
const incoming_url = incoming.url;
|
|
905
|
+
if (!(existing_url === incoming_url)) {
|
|
906
|
+
return false;
|
|
907
|
+
}
|
|
908
|
+
return true;
|
|
909
|
+
}
|
|
910
|
+
|
|
911
|
+
const TTL = 600;
|
|
912
|
+
const VERSION = "ee1ca8342609b01b292f149ed9209840";
|
|
913
|
+
function validate(obj, path = 'PersonalizationPointRepresentation') {
|
|
914
|
+
const v_error = (() => {
|
|
915
|
+
if (typeof obj !== 'object' || ArrayIsArray(obj) || obj === null) {
|
|
916
|
+
return new TypeError('Expected "object" but received "' + typeof obj + '" (at "' + path + '")');
|
|
917
|
+
}
|
|
918
|
+
const obj_abnExperimentName = obj.abnExperimentName;
|
|
919
|
+
const path_abnExperimentName = path + '.abnExperimentName';
|
|
920
|
+
let obj_abnExperimentName_union0 = null;
|
|
921
|
+
const obj_abnExperimentName_union0_error = (() => {
|
|
922
|
+
if (typeof obj_abnExperimentName !== 'string') {
|
|
923
|
+
return new TypeError('Expected "string" but received "' + typeof obj_abnExperimentName + '" (at "' + path_abnExperimentName + '")');
|
|
924
|
+
}
|
|
925
|
+
})();
|
|
926
|
+
if (obj_abnExperimentName_union0_error != null) {
|
|
927
|
+
obj_abnExperimentName_union0 = obj_abnExperimentName_union0_error.message;
|
|
928
|
+
}
|
|
929
|
+
let obj_abnExperimentName_union1 = null;
|
|
930
|
+
const obj_abnExperimentName_union1_error = (() => {
|
|
931
|
+
if (obj_abnExperimentName !== null) {
|
|
932
|
+
return new TypeError('Expected "null" but received "' + typeof obj_abnExperimentName + '" (at "' + path_abnExperimentName + '")');
|
|
933
|
+
}
|
|
934
|
+
})();
|
|
935
|
+
if (obj_abnExperimentName_union1_error != null) {
|
|
936
|
+
obj_abnExperimentName_union1 = obj_abnExperimentName_union1_error.message;
|
|
937
|
+
}
|
|
938
|
+
if (obj_abnExperimentName_union0 && obj_abnExperimentName_union1) {
|
|
939
|
+
let message = 'Object doesn\'t match union (at "' + path_abnExperimentName + '")';
|
|
940
|
+
message += '\n' + obj_abnExperimentName_union0.split('\n').map((line) => '\t' + line).join('\n');
|
|
941
|
+
message += '\n' + obj_abnExperimentName_union1.split('\n').map((line) => '\t' + line).join('\n');
|
|
942
|
+
return new TypeError(message);
|
|
943
|
+
}
|
|
944
|
+
const obj_createdById = obj.createdById;
|
|
945
|
+
const path_createdById = path + '.createdById';
|
|
946
|
+
let obj_createdById_union0 = null;
|
|
947
|
+
const obj_createdById_union0_error = (() => {
|
|
948
|
+
if (typeof obj_createdById !== 'string') {
|
|
949
|
+
return new TypeError('Expected "string" but received "' + typeof obj_createdById + '" (at "' + path_createdById + '")');
|
|
950
|
+
}
|
|
951
|
+
})();
|
|
952
|
+
if (obj_createdById_union0_error != null) {
|
|
953
|
+
obj_createdById_union0 = obj_createdById_union0_error.message;
|
|
954
|
+
}
|
|
955
|
+
let obj_createdById_union1 = null;
|
|
956
|
+
const obj_createdById_union1_error = (() => {
|
|
957
|
+
if (obj_createdById !== null) {
|
|
958
|
+
return new TypeError('Expected "null" but received "' + typeof obj_createdById + '" (at "' + path_createdById + '")');
|
|
959
|
+
}
|
|
960
|
+
})();
|
|
961
|
+
if (obj_createdById_union1_error != null) {
|
|
962
|
+
obj_createdById_union1 = obj_createdById_union1_error.message;
|
|
963
|
+
}
|
|
964
|
+
if (obj_createdById_union0 && obj_createdById_union1) {
|
|
965
|
+
let message = 'Object doesn\'t match union (at "' + path_createdById + '")';
|
|
966
|
+
message += '\n' + obj_createdById_union0.split('\n').map((line) => '\t' + line).join('\n');
|
|
967
|
+
message += '\n' + obj_createdById_union1.split('\n').map((line) => '\t' + line).join('\n');
|
|
968
|
+
return new TypeError(message);
|
|
969
|
+
}
|
|
970
|
+
const obj_createdDate = obj.createdDate;
|
|
971
|
+
const path_createdDate = path + '.createdDate';
|
|
972
|
+
let obj_createdDate_union0 = null;
|
|
973
|
+
const obj_createdDate_union0_error = (() => {
|
|
974
|
+
if (typeof obj_createdDate !== 'string') {
|
|
975
|
+
return new TypeError('Expected "string" but received "' + typeof obj_createdDate + '" (at "' + path_createdDate + '")');
|
|
976
|
+
}
|
|
977
|
+
})();
|
|
978
|
+
if (obj_createdDate_union0_error != null) {
|
|
979
|
+
obj_createdDate_union0 = obj_createdDate_union0_error.message;
|
|
980
|
+
}
|
|
981
|
+
let obj_createdDate_union1 = null;
|
|
982
|
+
const obj_createdDate_union1_error = (() => {
|
|
983
|
+
if (obj_createdDate !== null) {
|
|
984
|
+
return new TypeError('Expected "null" but received "' + typeof obj_createdDate + '" (at "' + path_createdDate + '")');
|
|
985
|
+
}
|
|
986
|
+
})();
|
|
987
|
+
if (obj_createdDate_union1_error != null) {
|
|
988
|
+
obj_createdDate_union1 = obj_createdDate_union1_error.message;
|
|
989
|
+
}
|
|
990
|
+
if (obj_createdDate_union0 && obj_createdDate_union1) {
|
|
991
|
+
let message = 'Object doesn\'t match union (at "' + path_createdDate + '")';
|
|
992
|
+
message += '\n' + obj_createdDate_union0.split('\n').map((line) => '\t' + line).join('\n');
|
|
993
|
+
message += '\n' + obj_createdDate_union1.split('\n').map((line) => '\t' + line).join('\n');
|
|
994
|
+
return new TypeError(message);
|
|
995
|
+
}
|
|
996
|
+
const obj_dataSpaceName = obj.dataSpaceName;
|
|
997
|
+
const path_dataSpaceName = path + '.dataSpaceName';
|
|
998
|
+
let obj_dataSpaceName_union0 = null;
|
|
999
|
+
const obj_dataSpaceName_union0_error = (() => {
|
|
1000
|
+
if (typeof obj_dataSpaceName !== 'string') {
|
|
1001
|
+
return new TypeError('Expected "string" but received "' + typeof obj_dataSpaceName + '" (at "' + path_dataSpaceName + '")');
|
|
1002
|
+
}
|
|
1003
|
+
})();
|
|
1004
|
+
if (obj_dataSpaceName_union0_error != null) {
|
|
1005
|
+
obj_dataSpaceName_union0 = obj_dataSpaceName_union0_error.message;
|
|
1006
|
+
}
|
|
1007
|
+
let obj_dataSpaceName_union1 = null;
|
|
1008
|
+
const obj_dataSpaceName_union1_error = (() => {
|
|
1009
|
+
if (obj_dataSpaceName !== null) {
|
|
1010
|
+
return new TypeError('Expected "null" but received "' + typeof obj_dataSpaceName + '" (at "' + path_dataSpaceName + '")');
|
|
1011
|
+
}
|
|
1012
|
+
})();
|
|
1013
|
+
if (obj_dataSpaceName_union1_error != null) {
|
|
1014
|
+
obj_dataSpaceName_union1 = obj_dataSpaceName_union1_error.message;
|
|
1015
|
+
}
|
|
1016
|
+
if (obj_dataSpaceName_union0 && obj_dataSpaceName_union1) {
|
|
1017
|
+
let message = 'Object doesn\'t match union (at "' + path_dataSpaceName + '")';
|
|
1018
|
+
message += '\n' + obj_dataSpaceName_union0.split('\n').map((line) => '\t' + line).join('\n');
|
|
1019
|
+
message += '\n' + obj_dataSpaceName_union1.split('\n').map((line) => '\t' + line).join('\n');
|
|
1020
|
+
return new TypeError(message);
|
|
1021
|
+
}
|
|
1022
|
+
const obj_decisions = obj.decisions;
|
|
1023
|
+
const path_decisions = path + '.decisions';
|
|
1024
|
+
if (!ArrayIsArray(obj_decisions)) {
|
|
1025
|
+
return new TypeError('Expected "array" but received "' + typeof obj_decisions + '" (at "' + path_decisions + '")');
|
|
1026
|
+
}
|
|
1027
|
+
for (let i = 0; i < obj_decisions.length; i++) {
|
|
1028
|
+
const obj_decisions_item = obj_decisions[i];
|
|
1029
|
+
const path_decisions_item = path_decisions + '[' + i + ']';
|
|
1030
|
+
const referencepath_decisions_itemValidationError = validate$1(obj_decisions_item, path_decisions_item);
|
|
1031
|
+
if (referencepath_decisions_itemValidationError !== null) {
|
|
1032
|
+
let message = 'Object doesn\'t match PersonalizationDecisionRepresentation (at "' + path_decisions_item + '")\n';
|
|
1033
|
+
message += referencepath_decisions_itemValidationError.message.split('\n').map((line) => '\t' + line).join('\n');
|
|
1034
|
+
return new TypeError(message);
|
|
1035
|
+
}
|
|
1036
|
+
}
|
|
1037
|
+
const obj_description = obj.description;
|
|
1038
|
+
const path_description = path + '.description';
|
|
1039
|
+
let obj_description_union0 = null;
|
|
1040
|
+
const obj_description_union0_error = (() => {
|
|
1041
|
+
if (typeof obj_description !== 'string') {
|
|
1042
|
+
return new TypeError('Expected "string" but received "' + typeof obj_description + '" (at "' + path_description + '")');
|
|
1043
|
+
}
|
|
1044
|
+
})();
|
|
1045
|
+
if (obj_description_union0_error != null) {
|
|
1046
|
+
obj_description_union0 = obj_description_union0_error.message;
|
|
1047
|
+
}
|
|
1048
|
+
let obj_description_union1 = null;
|
|
1049
|
+
const obj_description_union1_error = (() => {
|
|
1050
|
+
if (obj_description !== null) {
|
|
1051
|
+
return new TypeError('Expected "null" but received "' + typeof obj_description + '" (at "' + path_description + '")');
|
|
1052
|
+
}
|
|
1053
|
+
})();
|
|
1054
|
+
if (obj_description_union1_error != null) {
|
|
1055
|
+
obj_description_union1 = obj_description_union1_error.message;
|
|
1056
|
+
}
|
|
1057
|
+
if (obj_description_union0 && obj_description_union1) {
|
|
1058
|
+
let message = 'Object doesn\'t match union (at "' + path_description + '")';
|
|
1059
|
+
message += '\n' + obj_description_union0.split('\n').map((line) => '\t' + line).join('\n');
|
|
1060
|
+
message += '\n' + obj_description_union1.split('\n').map((line) => '\t' + line).join('\n');
|
|
1061
|
+
return new TypeError(message);
|
|
1062
|
+
}
|
|
1063
|
+
const obj_id = obj.id;
|
|
1064
|
+
const path_id = path + '.id';
|
|
1065
|
+
let obj_id_union0 = null;
|
|
1066
|
+
const obj_id_union0_error = (() => {
|
|
1067
|
+
if (typeof obj_id !== 'string') {
|
|
1068
|
+
return new TypeError('Expected "string" but received "' + typeof obj_id + '" (at "' + path_id + '")');
|
|
1069
|
+
}
|
|
1070
|
+
})();
|
|
1071
|
+
if (obj_id_union0_error != null) {
|
|
1072
|
+
obj_id_union0 = obj_id_union0_error.message;
|
|
1073
|
+
}
|
|
1074
|
+
let obj_id_union1 = null;
|
|
1075
|
+
const obj_id_union1_error = (() => {
|
|
1076
|
+
if (obj_id !== null) {
|
|
1077
|
+
return new TypeError('Expected "null" but received "' + typeof obj_id + '" (at "' + path_id + '")');
|
|
1078
|
+
}
|
|
1079
|
+
})();
|
|
1080
|
+
if (obj_id_union1_error != null) {
|
|
1081
|
+
obj_id_union1 = obj_id_union1_error.message;
|
|
1082
|
+
}
|
|
1083
|
+
if (obj_id_union0 && obj_id_union1) {
|
|
1084
|
+
let message = 'Object doesn\'t match union (at "' + path_id + '")';
|
|
1085
|
+
message += '\n' + obj_id_union0.split('\n').map((line) => '\t' + line).join('\n');
|
|
1086
|
+
message += '\n' + obj_id_union1.split('\n').map((line) => '\t' + line).join('\n');
|
|
1087
|
+
return new TypeError(message);
|
|
1088
|
+
}
|
|
1089
|
+
const obj_label = obj.label;
|
|
1090
|
+
const path_label = path + '.label';
|
|
1091
|
+
let obj_label_union0 = null;
|
|
1092
|
+
const obj_label_union0_error = (() => {
|
|
1093
|
+
if (typeof obj_label !== 'string') {
|
|
1094
|
+
return new TypeError('Expected "string" but received "' + typeof obj_label + '" (at "' + path_label + '")');
|
|
1095
|
+
}
|
|
1096
|
+
})();
|
|
1097
|
+
if (obj_label_union0_error != null) {
|
|
1098
|
+
obj_label_union0 = obj_label_union0_error.message;
|
|
1099
|
+
}
|
|
1100
|
+
let obj_label_union1 = null;
|
|
1101
|
+
const obj_label_union1_error = (() => {
|
|
1102
|
+
if (obj_label !== null) {
|
|
1103
|
+
return new TypeError('Expected "null" but received "' + typeof obj_label + '" (at "' + path_label + '")');
|
|
1104
|
+
}
|
|
1105
|
+
})();
|
|
1106
|
+
if (obj_label_union1_error != null) {
|
|
1107
|
+
obj_label_union1 = obj_label_union1_error.message;
|
|
1108
|
+
}
|
|
1109
|
+
if (obj_label_union0 && obj_label_union1) {
|
|
1110
|
+
let message = 'Object doesn\'t match union (at "' + path_label + '")';
|
|
1111
|
+
message += '\n' + obj_label_union0.split('\n').map((line) => '\t' + line).join('\n');
|
|
1112
|
+
message += '\n' + obj_label_union1.split('\n').map((line) => '\t' + line).join('\n');
|
|
1113
|
+
return new TypeError(message);
|
|
1114
|
+
}
|
|
1115
|
+
const obj_lastModifiedById = obj.lastModifiedById;
|
|
1116
|
+
const path_lastModifiedById = path + '.lastModifiedById';
|
|
1117
|
+
let obj_lastModifiedById_union0 = null;
|
|
1118
|
+
const obj_lastModifiedById_union0_error = (() => {
|
|
1119
|
+
if (typeof obj_lastModifiedById !== 'string') {
|
|
1120
|
+
return new TypeError('Expected "string" but received "' + typeof obj_lastModifiedById + '" (at "' + path_lastModifiedById + '")');
|
|
1121
|
+
}
|
|
1122
|
+
})();
|
|
1123
|
+
if (obj_lastModifiedById_union0_error != null) {
|
|
1124
|
+
obj_lastModifiedById_union0 = obj_lastModifiedById_union0_error.message;
|
|
1125
|
+
}
|
|
1126
|
+
let obj_lastModifiedById_union1 = null;
|
|
1127
|
+
const obj_lastModifiedById_union1_error = (() => {
|
|
1128
|
+
if (obj_lastModifiedById !== null) {
|
|
1129
|
+
return new TypeError('Expected "null" but received "' + typeof obj_lastModifiedById + '" (at "' + path_lastModifiedById + '")');
|
|
1130
|
+
}
|
|
1131
|
+
})();
|
|
1132
|
+
if (obj_lastModifiedById_union1_error != null) {
|
|
1133
|
+
obj_lastModifiedById_union1 = obj_lastModifiedById_union1_error.message;
|
|
1134
|
+
}
|
|
1135
|
+
if (obj_lastModifiedById_union0 && obj_lastModifiedById_union1) {
|
|
1136
|
+
let message = 'Object doesn\'t match union (at "' + path_lastModifiedById + '")';
|
|
1137
|
+
message += '\n' + obj_lastModifiedById_union0.split('\n').map((line) => '\t' + line).join('\n');
|
|
1138
|
+
message += '\n' + obj_lastModifiedById_union1.split('\n').map((line) => '\t' + line).join('\n');
|
|
1139
|
+
return new TypeError(message);
|
|
1140
|
+
}
|
|
1141
|
+
const obj_lastModifiedDate = obj.lastModifiedDate;
|
|
1142
|
+
const path_lastModifiedDate = path + '.lastModifiedDate';
|
|
1143
|
+
let obj_lastModifiedDate_union0 = null;
|
|
1144
|
+
const obj_lastModifiedDate_union0_error = (() => {
|
|
1145
|
+
if (typeof obj_lastModifiedDate !== 'string') {
|
|
1146
|
+
return new TypeError('Expected "string" but received "' + typeof obj_lastModifiedDate + '" (at "' + path_lastModifiedDate + '")');
|
|
1147
|
+
}
|
|
1148
|
+
})();
|
|
1149
|
+
if (obj_lastModifiedDate_union0_error != null) {
|
|
1150
|
+
obj_lastModifiedDate_union0 = obj_lastModifiedDate_union0_error.message;
|
|
1151
|
+
}
|
|
1152
|
+
let obj_lastModifiedDate_union1 = null;
|
|
1153
|
+
const obj_lastModifiedDate_union1_error = (() => {
|
|
1154
|
+
if (obj_lastModifiedDate !== null) {
|
|
1155
|
+
return new TypeError('Expected "null" but received "' + typeof obj_lastModifiedDate + '" (at "' + path_lastModifiedDate + '")');
|
|
1156
|
+
}
|
|
1157
|
+
})();
|
|
1158
|
+
if (obj_lastModifiedDate_union1_error != null) {
|
|
1159
|
+
obj_lastModifiedDate_union1 = obj_lastModifiedDate_union1_error.message;
|
|
1160
|
+
}
|
|
1161
|
+
if (obj_lastModifiedDate_union0 && obj_lastModifiedDate_union1) {
|
|
1162
|
+
let message = 'Object doesn\'t match union (at "' + path_lastModifiedDate + '")';
|
|
1163
|
+
message += '\n' + obj_lastModifiedDate_union0.split('\n').map((line) => '\t' + line).join('\n');
|
|
1164
|
+
message += '\n' + obj_lastModifiedDate_union1.split('\n').map((line) => '\t' + line).join('\n');
|
|
1165
|
+
return new TypeError(message);
|
|
1166
|
+
}
|
|
1167
|
+
const obj_name = obj.name;
|
|
1168
|
+
const path_name = path + '.name';
|
|
1169
|
+
let obj_name_union0 = null;
|
|
1170
|
+
const obj_name_union0_error = (() => {
|
|
1171
|
+
if (typeof obj_name !== 'string') {
|
|
1172
|
+
return new TypeError('Expected "string" but received "' + typeof obj_name + '" (at "' + path_name + '")');
|
|
1173
|
+
}
|
|
1174
|
+
})();
|
|
1175
|
+
if (obj_name_union0_error != null) {
|
|
1176
|
+
obj_name_union0 = obj_name_union0_error.message;
|
|
1177
|
+
}
|
|
1178
|
+
let obj_name_union1 = null;
|
|
1179
|
+
const obj_name_union1_error = (() => {
|
|
1180
|
+
if (obj_name !== null) {
|
|
1181
|
+
return new TypeError('Expected "null" but received "' + typeof obj_name + '" (at "' + path_name + '")');
|
|
1182
|
+
}
|
|
1183
|
+
})();
|
|
1184
|
+
if (obj_name_union1_error != null) {
|
|
1185
|
+
obj_name_union1 = obj_name_union1_error.message;
|
|
1186
|
+
}
|
|
1187
|
+
if (obj_name_union0 && obj_name_union1) {
|
|
1188
|
+
let message = 'Object doesn\'t match union (at "' + path_name + '")';
|
|
1189
|
+
message += '\n' + obj_name_union0.split('\n').map((line) => '\t' + line).join('\n');
|
|
1190
|
+
message += '\n' + obj_name_union1.split('\n').map((line) => '\t' + line).join('\n');
|
|
1191
|
+
return new TypeError(message);
|
|
1192
|
+
}
|
|
1193
|
+
const obj_profileDataGraphName = obj.profileDataGraphName;
|
|
1194
|
+
const path_profileDataGraphName = path + '.profileDataGraphName';
|
|
1195
|
+
let obj_profileDataGraphName_union0 = null;
|
|
1196
|
+
const obj_profileDataGraphName_union0_error = (() => {
|
|
1197
|
+
if (typeof obj_profileDataGraphName !== 'string') {
|
|
1198
|
+
return new TypeError('Expected "string" but received "' + typeof obj_profileDataGraphName + '" (at "' + path_profileDataGraphName + '")');
|
|
1199
|
+
}
|
|
1200
|
+
})();
|
|
1201
|
+
if (obj_profileDataGraphName_union0_error != null) {
|
|
1202
|
+
obj_profileDataGraphName_union0 = obj_profileDataGraphName_union0_error.message;
|
|
1203
|
+
}
|
|
1204
|
+
let obj_profileDataGraphName_union1 = null;
|
|
1205
|
+
const obj_profileDataGraphName_union1_error = (() => {
|
|
1206
|
+
if (obj_profileDataGraphName !== null) {
|
|
1207
|
+
return new TypeError('Expected "null" but received "' + typeof obj_profileDataGraphName + '" (at "' + path_profileDataGraphName + '")');
|
|
1208
|
+
}
|
|
1209
|
+
})();
|
|
1210
|
+
if (obj_profileDataGraphName_union1_error != null) {
|
|
1211
|
+
obj_profileDataGraphName_union1 = obj_profileDataGraphName_union1_error.message;
|
|
1212
|
+
}
|
|
1213
|
+
if (obj_profileDataGraphName_union0 && obj_profileDataGraphName_union1) {
|
|
1214
|
+
let message = 'Object doesn\'t match union (at "' + path_profileDataGraphName + '")';
|
|
1215
|
+
message += '\n' + obj_profileDataGraphName_union0.split('\n').map((line) => '\t' + line).join('\n');
|
|
1216
|
+
message += '\n' + obj_profileDataGraphName_union1.split('\n').map((line) => '\t' + line).join('\n');
|
|
1217
|
+
return new TypeError(message);
|
|
1218
|
+
}
|
|
1219
|
+
const obj_schemaEnum = obj.schemaEnum;
|
|
1220
|
+
const path_schemaEnum = path + '.schemaEnum';
|
|
1221
|
+
let obj_schemaEnum_union0 = null;
|
|
1222
|
+
const obj_schemaEnum_union0_error = (() => {
|
|
1223
|
+
if (typeof obj_schemaEnum !== 'string') {
|
|
1224
|
+
return new TypeError('Expected "string" but received "' + typeof obj_schemaEnum + '" (at "' + path_schemaEnum + '")');
|
|
1225
|
+
}
|
|
1226
|
+
})();
|
|
1227
|
+
if (obj_schemaEnum_union0_error != null) {
|
|
1228
|
+
obj_schemaEnum_union0 = obj_schemaEnum_union0_error.message;
|
|
1229
|
+
}
|
|
1230
|
+
let obj_schemaEnum_union1 = null;
|
|
1231
|
+
const obj_schemaEnum_union1_error = (() => {
|
|
1232
|
+
if (obj_schemaEnum !== null) {
|
|
1233
|
+
return new TypeError('Expected "null" but received "' + typeof obj_schemaEnum + '" (at "' + path_schemaEnum + '")');
|
|
1234
|
+
}
|
|
1235
|
+
})();
|
|
1236
|
+
if (obj_schemaEnum_union1_error != null) {
|
|
1237
|
+
obj_schemaEnum_union1 = obj_schemaEnum_union1_error.message;
|
|
1238
|
+
}
|
|
1239
|
+
if (obj_schemaEnum_union0 && obj_schemaEnum_union1) {
|
|
1240
|
+
let message = 'Object doesn\'t match union (at "' + path_schemaEnum + '")';
|
|
1241
|
+
message += '\n' + obj_schemaEnum_union0.split('\n').map((line) => '\t' + line).join('\n');
|
|
1242
|
+
message += '\n' + obj_schemaEnum_union1.split('\n').map((line) => '\t' + line).join('\n');
|
|
1243
|
+
return new TypeError(message);
|
|
1244
|
+
}
|
|
1245
|
+
const obj_schemaName = obj.schemaName;
|
|
1246
|
+
const path_schemaName = path + '.schemaName';
|
|
1247
|
+
let obj_schemaName_union0 = null;
|
|
1248
|
+
const obj_schemaName_union0_error = (() => {
|
|
1249
|
+
if (typeof obj_schemaName !== 'string') {
|
|
1250
|
+
return new TypeError('Expected "string" but received "' + typeof obj_schemaName + '" (at "' + path_schemaName + '")');
|
|
1251
|
+
}
|
|
1252
|
+
})();
|
|
1253
|
+
if (obj_schemaName_union0_error != null) {
|
|
1254
|
+
obj_schemaName_union0 = obj_schemaName_union0_error.message;
|
|
1255
|
+
}
|
|
1256
|
+
let obj_schemaName_union1 = null;
|
|
1257
|
+
const obj_schemaName_union1_error = (() => {
|
|
1258
|
+
if (obj_schemaName !== null) {
|
|
1259
|
+
return new TypeError('Expected "null" but received "' + typeof obj_schemaName + '" (at "' + path_schemaName + '")');
|
|
1260
|
+
}
|
|
1261
|
+
})();
|
|
1262
|
+
if (obj_schemaName_union1_error != null) {
|
|
1263
|
+
obj_schemaName_union1 = obj_schemaName_union1_error.message;
|
|
1264
|
+
}
|
|
1265
|
+
if (obj_schemaName_union0 && obj_schemaName_union1) {
|
|
1266
|
+
let message = 'Object doesn\'t match union (at "' + path_schemaName + '")';
|
|
1267
|
+
message += '\n' + obj_schemaName_union0.split('\n').map((line) => '\t' + line).join('\n');
|
|
1268
|
+
message += '\n' + obj_schemaName_union1.split('\n').map((line) => '\t' + line).join('\n');
|
|
1269
|
+
return new TypeError(message);
|
|
1270
|
+
}
|
|
1271
|
+
const obj_source = obj.source;
|
|
1272
|
+
const path_source = path + '.source';
|
|
1273
|
+
if (typeof obj_source !== 'string') {
|
|
1274
|
+
return new TypeError('Expected "string" but received "' + typeof obj_source + '" (at "' + path_source + '")');
|
|
1275
|
+
}
|
|
1276
|
+
const obj_status = obj.status;
|
|
1277
|
+
const path_status = path + '.status';
|
|
1278
|
+
if (typeof obj_status !== 'string') {
|
|
1279
|
+
return new TypeError('Expected "string" but received "' + typeof obj_status + '" (at "' + path_status + '")');
|
|
1280
|
+
}
|
|
1281
|
+
const obj_url = obj.url;
|
|
1282
|
+
const path_url = path + '.url';
|
|
1283
|
+
let obj_url_union0 = null;
|
|
1284
|
+
const obj_url_union0_error = (() => {
|
|
1285
|
+
if (typeof obj_url !== 'string') {
|
|
1286
|
+
return new TypeError('Expected "string" but received "' + typeof obj_url + '" (at "' + path_url + '")');
|
|
1287
|
+
}
|
|
1288
|
+
})();
|
|
1289
|
+
if (obj_url_union0_error != null) {
|
|
1290
|
+
obj_url_union0 = obj_url_union0_error.message;
|
|
1291
|
+
}
|
|
1292
|
+
let obj_url_union1 = null;
|
|
1293
|
+
const obj_url_union1_error = (() => {
|
|
1294
|
+
if (obj_url !== null) {
|
|
1295
|
+
return new TypeError('Expected "null" but received "' + typeof obj_url + '" (at "' + path_url + '")');
|
|
1296
|
+
}
|
|
1297
|
+
})();
|
|
1298
|
+
if (obj_url_union1_error != null) {
|
|
1299
|
+
obj_url_union1 = obj_url_union1_error.message;
|
|
1300
|
+
}
|
|
1301
|
+
if (obj_url_union0 && obj_url_union1) {
|
|
1302
|
+
let message = 'Object doesn\'t match union (at "' + path_url + '")';
|
|
1303
|
+
message += '\n' + obj_url_union0.split('\n').map((line) => '\t' + line).join('\n');
|
|
1304
|
+
message += '\n' + obj_url_union1.split('\n').map((line) => '\t' + line).join('\n');
|
|
1305
|
+
return new TypeError(message);
|
|
1306
|
+
}
|
|
1307
|
+
})();
|
|
1308
|
+
return v_error === undefined ? null : v_error;
|
|
1309
|
+
}
|
|
1310
|
+
const RepresentationType = 'PersonalizationPointRepresentation';
|
|
1311
|
+
function keyBuilder$3(luvio, config) {
|
|
1312
|
+
return keyPrefix + '::' + RepresentationType + ':' + (config.id === null ? '' : config.id);
|
|
1313
|
+
}
|
|
1314
|
+
function keyBuilderFromType(luvio, object) {
|
|
1315
|
+
const keyParams = {
|
|
1316
|
+
id: object.name
|
|
1317
|
+
};
|
|
1318
|
+
return keyBuilder$3(luvio, keyParams);
|
|
1319
|
+
}
|
|
1320
|
+
function normalize(input, existing, path, luvio, store, timestamp) {
|
|
1321
|
+
return input;
|
|
1322
|
+
}
|
|
1323
|
+
const select$3 = function PersonalizationPointRepresentationSelect() {
|
|
1324
|
+
const { selections: PersonalizationDecisionRepresentation__selections, opaque: PersonalizationDecisionRepresentation__opaque, } = select$4();
|
|
1325
|
+
return {
|
|
1326
|
+
kind: 'Fragment',
|
|
1327
|
+
version: VERSION,
|
|
1328
|
+
private: [],
|
|
1329
|
+
selections: [
|
|
1330
|
+
{
|
|
1331
|
+
name: 'abnExperimentName',
|
|
1332
|
+
kind: 'Scalar'
|
|
1333
|
+
},
|
|
1334
|
+
{
|
|
1335
|
+
name: 'createdById',
|
|
1336
|
+
kind: 'Scalar'
|
|
1337
|
+
},
|
|
1338
|
+
{
|
|
1339
|
+
name: 'createdDate',
|
|
1340
|
+
kind: 'Scalar'
|
|
1341
|
+
},
|
|
1342
|
+
{
|
|
1343
|
+
name: 'dataSpaceName',
|
|
1344
|
+
kind: 'Scalar'
|
|
1345
|
+
},
|
|
1346
|
+
{
|
|
1347
|
+
name: 'decisions',
|
|
1348
|
+
kind: 'Object',
|
|
1349
|
+
plural: true,
|
|
1350
|
+
selections: PersonalizationDecisionRepresentation__selections
|
|
1351
|
+
},
|
|
1352
|
+
{
|
|
1353
|
+
name: 'description',
|
|
1354
|
+
kind: 'Scalar'
|
|
1355
|
+
},
|
|
1356
|
+
{
|
|
1357
|
+
name: 'id',
|
|
1358
|
+
kind: 'Scalar'
|
|
1359
|
+
},
|
|
1360
|
+
{
|
|
1361
|
+
name: 'label',
|
|
1362
|
+
kind: 'Scalar'
|
|
1363
|
+
},
|
|
1364
|
+
{
|
|
1365
|
+
name: 'lastModifiedById',
|
|
1366
|
+
kind: 'Scalar'
|
|
1367
|
+
},
|
|
1368
|
+
{
|
|
1369
|
+
name: 'lastModifiedDate',
|
|
1370
|
+
kind: 'Scalar'
|
|
1371
|
+
},
|
|
1372
|
+
{
|
|
1373
|
+
name: 'name',
|
|
1374
|
+
kind: 'Scalar'
|
|
1375
|
+
},
|
|
1376
|
+
{
|
|
1377
|
+
name: 'profileDataGraphName',
|
|
1378
|
+
kind: 'Scalar'
|
|
1379
|
+
},
|
|
1380
|
+
{
|
|
1381
|
+
name: 'schemaEnum',
|
|
1382
|
+
kind: 'Scalar'
|
|
1383
|
+
},
|
|
1384
|
+
{
|
|
1385
|
+
name: 'schemaName',
|
|
1386
|
+
kind: 'Scalar'
|
|
1387
|
+
},
|
|
1388
|
+
{
|
|
1389
|
+
name: 'source',
|
|
1390
|
+
kind: 'Scalar'
|
|
1391
|
+
},
|
|
1392
|
+
{
|
|
1393
|
+
name: 'status',
|
|
1394
|
+
kind: 'Scalar'
|
|
1395
|
+
},
|
|
1396
|
+
{
|
|
1397
|
+
name: 'url',
|
|
1398
|
+
kind: 'Scalar'
|
|
1399
|
+
}
|
|
1400
|
+
]
|
|
1401
|
+
};
|
|
1402
|
+
};
|
|
1403
|
+
function equals(existing, incoming) {
|
|
1404
|
+
const existing_source = existing.source;
|
|
1405
|
+
const incoming_source = incoming.source;
|
|
1406
|
+
if (!(existing_source === incoming_source)) {
|
|
1407
|
+
return false;
|
|
1408
|
+
}
|
|
1409
|
+
const existing_status = existing.status;
|
|
1410
|
+
const incoming_status = incoming.status;
|
|
1411
|
+
if (!(existing_status === incoming_status)) {
|
|
1412
|
+
return false;
|
|
1413
|
+
}
|
|
1414
|
+
const existing_abnExperimentName = existing.abnExperimentName;
|
|
1415
|
+
const incoming_abnExperimentName = incoming.abnExperimentName;
|
|
1416
|
+
if (!(existing_abnExperimentName === incoming_abnExperimentName)) {
|
|
1417
|
+
return false;
|
|
1418
|
+
}
|
|
1419
|
+
const existing_createdById = existing.createdById;
|
|
1420
|
+
const incoming_createdById = incoming.createdById;
|
|
1421
|
+
if (!(existing_createdById === incoming_createdById)) {
|
|
1422
|
+
return false;
|
|
1423
|
+
}
|
|
1424
|
+
const existing_createdDate = existing.createdDate;
|
|
1425
|
+
const incoming_createdDate = incoming.createdDate;
|
|
1426
|
+
if (!(existing_createdDate === incoming_createdDate)) {
|
|
1427
|
+
return false;
|
|
1428
|
+
}
|
|
1429
|
+
const existing_dataSpaceName = existing.dataSpaceName;
|
|
1430
|
+
const incoming_dataSpaceName = incoming.dataSpaceName;
|
|
1431
|
+
if (!(existing_dataSpaceName === incoming_dataSpaceName)) {
|
|
1432
|
+
return false;
|
|
1433
|
+
}
|
|
1434
|
+
const existing_decisions = existing.decisions;
|
|
1435
|
+
const incoming_decisions = incoming.decisions;
|
|
1436
|
+
const equals_decisions_items = equalsArray(existing_decisions, incoming_decisions, (existing_decisions_item, incoming_decisions_item) => {
|
|
1437
|
+
if (!(equals$1(existing_decisions_item, incoming_decisions_item))) {
|
|
1438
|
+
return false;
|
|
1439
|
+
}
|
|
1440
|
+
});
|
|
1441
|
+
if (equals_decisions_items === false) {
|
|
1442
|
+
return false;
|
|
1443
|
+
}
|
|
1444
|
+
const existing_description = existing.description;
|
|
1445
|
+
const incoming_description = incoming.description;
|
|
1446
|
+
if (!(existing_description === incoming_description)) {
|
|
1447
|
+
return false;
|
|
1448
|
+
}
|
|
1449
|
+
const existing_id = existing.id;
|
|
1450
|
+
const incoming_id = incoming.id;
|
|
1451
|
+
if (!(existing_id === incoming_id)) {
|
|
1452
|
+
return false;
|
|
1453
|
+
}
|
|
1454
|
+
const existing_label = existing.label;
|
|
1455
|
+
const incoming_label = incoming.label;
|
|
1456
|
+
if (!(existing_label === incoming_label)) {
|
|
1457
|
+
return false;
|
|
1458
|
+
}
|
|
1459
|
+
const existing_lastModifiedById = existing.lastModifiedById;
|
|
1460
|
+
const incoming_lastModifiedById = incoming.lastModifiedById;
|
|
1461
|
+
if (!(existing_lastModifiedById === incoming_lastModifiedById)) {
|
|
1462
|
+
return false;
|
|
1463
|
+
}
|
|
1464
|
+
const existing_lastModifiedDate = existing.lastModifiedDate;
|
|
1465
|
+
const incoming_lastModifiedDate = incoming.lastModifiedDate;
|
|
1466
|
+
if (!(existing_lastModifiedDate === incoming_lastModifiedDate)) {
|
|
1467
|
+
return false;
|
|
1468
|
+
}
|
|
1469
|
+
const existing_name = existing.name;
|
|
1470
|
+
const incoming_name = incoming.name;
|
|
1471
|
+
if (!(existing_name === incoming_name)) {
|
|
1472
|
+
return false;
|
|
1473
|
+
}
|
|
1474
|
+
const existing_profileDataGraphName = existing.profileDataGraphName;
|
|
1475
|
+
const incoming_profileDataGraphName = incoming.profileDataGraphName;
|
|
1476
|
+
if (!(existing_profileDataGraphName === incoming_profileDataGraphName)) {
|
|
1477
|
+
return false;
|
|
1478
|
+
}
|
|
1479
|
+
const existing_schemaEnum = existing.schemaEnum;
|
|
1480
|
+
const incoming_schemaEnum = incoming.schemaEnum;
|
|
1481
|
+
if (!(existing_schemaEnum === incoming_schemaEnum)) {
|
|
1482
|
+
return false;
|
|
1483
|
+
}
|
|
1484
|
+
const existing_schemaName = existing.schemaName;
|
|
1485
|
+
const incoming_schemaName = incoming.schemaName;
|
|
1486
|
+
if (!(existing_schemaName === incoming_schemaName)) {
|
|
1487
|
+
return false;
|
|
1488
|
+
}
|
|
1489
|
+
const existing_url = existing.url;
|
|
1490
|
+
const incoming_url = incoming.url;
|
|
1491
|
+
if (!(existing_url === incoming_url)) {
|
|
1492
|
+
return false;
|
|
1493
|
+
}
|
|
1494
|
+
return true;
|
|
1495
|
+
}
|
|
1496
|
+
const ingest = function PersonalizationPointRepresentationIngest(input, path, luvio, store, timestamp) {
|
|
1497
|
+
if (process.env.NODE_ENV !== 'production') {
|
|
1498
|
+
const validateError = validate(input);
|
|
1499
|
+
if (validateError !== null) {
|
|
1500
|
+
throw validateError;
|
|
1501
|
+
}
|
|
1502
|
+
}
|
|
1503
|
+
const key = keyBuilderFromType(luvio, input);
|
|
1504
|
+
const ttlToUse = TTL;
|
|
1505
|
+
ingestShape(input, path, luvio, store, timestamp, ttlToUse, key, normalize, "personalization-service", VERSION, RepresentationType, equals);
|
|
1506
|
+
return createLink(key);
|
|
1507
|
+
};
|
|
1508
|
+
function getTypeCacheKeys(rootKeySet, luvio, input, fullPathFactory) {
|
|
1509
|
+
// root cache key (uses fullPathFactory if keyBuilderFromType isn't defined)
|
|
1510
|
+
const rootKey = keyBuilderFromType(luvio, input);
|
|
1511
|
+
rootKeySet.set(rootKey, {
|
|
1512
|
+
namespace: keyPrefix,
|
|
1513
|
+
representationName: RepresentationType,
|
|
1514
|
+
mergeable: false
|
|
1515
|
+
});
|
|
1516
|
+
}
|
|
1517
|
+
|
|
1518
|
+
function select$2(luvio, params) {
|
|
1519
|
+
return select$3();
|
|
1520
|
+
}
|
|
1521
|
+
function getResponseCacheKeys$3(storeKeyMap, luvio, resourceParams, response) {
|
|
1522
|
+
getTypeCacheKeys(storeKeyMap, luvio, response);
|
|
1523
|
+
}
|
|
1524
|
+
function ingestSuccess$2(luvio, resourceParams, response) {
|
|
1525
|
+
const { body } = response;
|
|
1526
|
+
const key = keyBuilderFromType(luvio, body);
|
|
1527
|
+
luvio.storeIngest(key, ingest, body);
|
|
1528
|
+
const snapshot = luvio.storeLookup({
|
|
1529
|
+
recordId: key,
|
|
1530
|
+
node: select$2(),
|
|
1531
|
+
variables: {},
|
|
1532
|
+
});
|
|
1533
|
+
if (process.env.NODE_ENV !== 'production') {
|
|
1534
|
+
if (snapshot.state !== 'Fulfilled') {
|
|
1535
|
+
throw new Error('Invalid network response. Expected resource response to result in Fulfilled snapshot');
|
|
1536
|
+
}
|
|
1537
|
+
}
|
|
1538
|
+
deepFreeze(snapshot.data);
|
|
1539
|
+
return snapshot;
|
|
1540
|
+
}
|
|
1541
|
+
function createResourceRequest$3(config) {
|
|
1542
|
+
const headers = {};
|
|
1543
|
+
return {
|
|
1544
|
+
baseUri: '/services/data/v62.0',
|
|
1545
|
+
basePath: '/personalization/personalization-points',
|
|
1546
|
+
method: 'post',
|
|
1547
|
+
body: config.body,
|
|
1548
|
+
urlParams: {},
|
|
1549
|
+
queryParams: {},
|
|
1550
|
+
headers,
|
|
1551
|
+
priority: 'normal',
|
|
1552
|
+
};
|
|
1553
|
+
}
|
|
1554
|
+
|
|
1555
|
+
const adapterName$3 = 'createPersonalizationPoint';
|
|
1556
|
+
const createPersonalizationPoint_ConfigPropertyMetadata = [
|
|
1557
|
+
generateParamConfigMetadata('description', true, 2 /* Body */, 4 /* Unsupported */),
|
|
1558
|
+
generateParamConfigMetadata('label', true, 2 /* Body */, 4 /* Unsupported */),
|
|
1559
|
+
generateParamConfigMetadata('name', true, 2 /* Body */, 4 /* Unsupported */),
|
|
1560
|
+
generateParamConfigMetadata('abnExperimentName', true, 2 /* Body */, 4 /* Unsupported */),
|
|
1561
|
+
generateParamConfigMetadata('dataSpaceName', true, 2 /* Body */, 4 /* Unsupported */),
|
|
1562
|
+
generateParamConfigMetadata('decisions', true, 2 /* Body */, 4 /* Unsupported */, true),
|
|
1563
|
+
generateParamConfigMetadata('profileDataGraphName', true, 2 /* Body */, 4 /* Unsupported */),
|
|
1564
|
+
generateParamConfigMetadata('schemaEnum', true, 2 /* Body */, 4 /* Unsupported */),
|
|
1565
|
+
generateParamConfigMetadata('schemaName', true, 2 /* Body */, 4 /* Unsupported */),
|
|
1566
|
+
generateParamConfigMetadata('source', true, 2 /* Body */, 0 /* String */),
|
|
1567
|
+
];
|
|
1568
|
+
const createPersonalizationPoint_ConfigPropertyNames = /*#__PURE__*/ buildAdapterValidationConfig(adapterName$3, createPersonalizationPoint_ConfigPropertyMetadata);
|
|
1569
|
+
const createResourceParams$3 = /*#__PURE__*/ createResourceParams$4(createPersonalizationPoint_ConfigPropertyMetadata);
|
|
1570
|
+
function typeCheckConfig$3(untrustedConfig) {
|
|
1571
|
+
const config = {};
|
|
1572
|
+
typeCheckConfig$4(untrustedConfig, config, createPersonalizationPoint_ConfigPropertyMetadata);
|
|
1573
|
+
const untrustedConfig_description = untrustedConfig.description;
|
|
1574
|
+
if (typeof untrustedConfig_description === 'string') {
|
|
1575
|
+
config.description = untrustedConfig_description;
|
|
1576
|
+
}
|
|
1577
|
+
if (untrustedConfig_description === null) {
|
|
1578
|
+
config.description = untrustedConfig_description;
|
|
1579
|
+
}
|
|
1580
|
+
const untrustedConfig_label = untrustedConfig.label;
|
|
1581
|
+
if (typeof untrustedConfig_label === 'string') {
|
|
1582
|
+
config.label = untrustedConfig_label;
|
|
1583
|
+
}
|
|
1584
|
+
if (untrustedConfig_label === null) {
|
|
1585
|
+
config.label = untrustedConfig_label;
|
|
1586
|
+
}
|
|
1587
|
+
const untrustedConfig_name = untrustedConfig.name;
|
|
1588
|
+
if (typeof untrustedConfig_name === 'string') {
|
|
1589
|
+
config.name = untrustedConfig_name;
|
|
1590
|
+
}
|
|
1591
|
+
if (untrustedConfig_name === null) {
|
|
1592
|
+
config.name = untrustedConfig_name;
|
|
1593
|
+
}
|
|
1594
|
+
const untrustedConfig_abnExperimentName = untrustedConfig.abnExperimentName;
|
|
1595
|
+
if (typeof untrustedConfig_abnExperimentName === 'string') {
|
|
1596
|
+
config.abnExperimentName = untrustedConfig_abnExperimentName;
|
|
1597
|
+
}
|
|
1598
|
+
if (untrustedConfig_abnExperimentName === null) {
|
|
1599
|
+
config.abnExperimentName = untrustedConfig_abnExperimentName;
|
|
1600
|
+
}
|
|
1601
|
+
const untrustedConfig_dataSpaceName = untrustedConfig.dataSpaceName;
|
|
1602
|
+
if (typeof untrustedConfig_dataSpaceName === 'string') {
|
|
1603
|
+
config.dataSpaceName = untrustedConfig_dataSpaceName;
|
|
1604
|
+
}
|
|
1605
|
+
if (untrustedConfig_dataSpaceName === null) {
|
|
1606
|
+
config.dataSpaceName = untrustedConfig_dataSpaceName;
|
|
1607
|
+
}
|
|
1608
|
+
const untrustedConfig_decisions = untrustedConfig.decisions;
|
|
1609
|
+
if (ArrayIsArray$1(untrustedConfig_decisions)) {
|
|
1610
|
+
const untrustedConfig_decisions_array = [];
|
|
1611
|
+
for (let i = 0, arrayLength = untrustedConfig_decisions.length; i < arrayLength; i++) {
|
|
1612
|
+
const untrustedConfig_decisions_item = untrustedConfig_decisions[i];
|
|
1613
|
+
const referencePersonalizationDecisionInputRepresentationValidationError = validate$3(untrustedConfig_decisions_item);
|
|
1614
|
+
if (referencePersonalizationDecisionInputRepresentationValidationError === null) {
|
|
1615
|
+
untrustedConfig_decisions_array.push(untrustedConfig_decisions_item);
|
|
1616
|
+
}
|
|
1617
|
+
}
|
|
1618
|
+
config.decisions = untrustedConfig_decisions_array;
|
|
1619
|
+
}
|
|
1620
|
+
const untrustedConfig_profileDataGraphName = untrustedConfig.profileDataGraphName;
|
|
1621
|
+
if (typeof untrustedConfig_profileDataGraphName === 'string') {
|
|
1622
|
+
config.profileDataGraphName = untrustedConfig_profileDataGraphName;
|
|
1623
|
+
}
|
|
1624
|
+
if (untrustedConfig_profileDataGraphName === null) {
|
|
1625
|
+
config.profileDataGraphName = untrustedConfig_profileDataGraphName;
|
|
1626
|
+
}
|
|
1627
|
+
const untrustedConfig_schemaEnum = untrustedConfig.schemaEnum;
|
|
1628
|
+
if (typeof untrustedConfig_schemaEnum === 'string') {
|
|
1629
|
+
config.schemaEnum = untrustedConfig_schemaEnum;
|
|
1630
|
+
}
|
|
1631
|
+
if (untrustedConfig_schemaEnum === null) {
|
|
1632
|
+
config.schemaEnum = untrustedConfig_schemaEnum;
|
|
1633
|
+
}
|
|
1634
|
+
const untrustedConfig_schemaName = untrustedConfig.schemaName;
|
|
1635
|
+
if (typeof untrustedConfig_schemaName === 'string') {
|
|
1636
|
+
config.schemaName = untrustedConfig_schemaName;
|
|
1637
|
+
}
|
|
1638
|
+
if (untrustedConfig_schemaName === null) {
|
|
1639
|
+
config.schemaName = untrustedConfig_schemaName;
|
|
1640
|
+
}
|
|
1641
|
+
return config;
|
|
1642
|
+
}
|
|
1643
|
+
function validateAdapterConfig$3(untrustedConfig, configPropertyNames) {
|
|
1644
|
+
if (!untrustedIsObject(untrustedConfig)) {
|
|
1645
|
+
return null;
|
|
1646
|
+
}
|
|
1647
|
+
if (process.env.NODE_ENV !== 'production') {
|
|
1648
|
+
validateConfig(untrustedConfig, configPropertyNames);
|
|
1649
|
+
}
|
|
1650
|
+
const config = typeCheckConfig$3(untrustedConfig);
|
|
1651
|
+
if (!areRequiredParametersPresent(config, configPropertyNames)) {
|
|
1652
|
+
return null;
|
|
1653
|
+
}
|
|
1654
|
+
return config;
|
|
1655
|
+
}
|
|
1656
|
+
function buildNetworkSnapshot$3(luvio, config, options) {
|
|
1657
|
+
const resourceParams = createResourceParams$3(config);
|
|
1658
|
+
const request = createResourceRequest$3(resourceParams);
|
|
1659
|
+
return luvio.dispatchResourceRequest(request, options)
|
|
1660
|
+
.then((response) => {
|
|
1661
|
+
return luvio.handleSuccessResponse(() => {
|
|
1662
|
+
const snapshot = ingestSuccess$2(luvio, resourceParams, response);
|
|
1663
|
+
return luvio.storeBroadcast().then(() => snapshot);
|
|
1664
|
+
}, () => {
|
|
1665
|
+
const cache = new StoreKeyMap();
|
|
1666
|
+
getResponseCacheKeys$3(cache, luvio, resourceParams, response.body);
|
|
1667
|
+
return cache;
|
|
1668
|
+
});
|
|
1669
|
+
}, (response) => {
|
|
1670
|
+
deepFreeze(response);
|
|
1671
|
+
throw response;
|
|
1672
|
+
});
|
|
1673
|
+
}
|
|
1674
|
+
const createPersonalizationPointAdapterFactory = (luvio) => {
|
|
1675
|
+
return function createPersonalizationPoint(untrustedConfig) {
|
|
1676
|
+
const config = validateAdapterConfig$3(untrustedConfig, createPersonalizationPoint_ConfigPropertyNames);
|
|
1677
|
+
// Invalid or incomplete config
|
|
1678
|
+
if (config === null) {
|
|
1679
|
+
throw new Error('Invalid config for "createPersonalizationPoint"');
|
|
1680
|
+
}
|
|
1681
|
+
return buildNetworkSnapshot$3(luvio, config);
|
|
1682
|
+
};
|
|
1683
|
+
};
|
|
1684
|
+
|
|
1685
|
+
function keyBuilder$2(luvio, params) {
|
|
1686
|
+
return keyBuilder$3(luvio, {
|
|
1687
|
+
id: params.urlParams.idOrName
|
|
1688
|
+
});
|
|
1689
|
+
}
|
|
1690
|
+
function getResponseCacheKeys$2(cacheKeyMap, luvio, resourceParams) {
|
|
1691
|
+
const key = keyBuilder$2(luvio, resourceParams);
|
|
1692
|
+
cacheKeyMap.set(key, {
|
|
1693
|
+
namespace: keyPrefix,
|
|
1694
|
+
representationName: RepresentationType,
|
|
1695
|
+
mergeable: false
|
|
1696
|
+
});
|
|
1697
|
+
}
|
|
1698
|
+
function evictSuccess(luvio, resourceParams) {
|
|
1699
|
+
const key = keyBuilder$2(luvio, resourceParams);
|
|
1700
|
+
luvio.storeEvict(key);
|
|
1701
|
+
}
|
|
1702
|
+
function createResourceRequest$2(config) {
|
|
1703
|
+
const headers = {};
|
|
1704
|
+
return {
|
|
1705
|
+
baseUri: '/services/data/v62.0',
|
|
1706
|
+
basePath: '/personalization/personalization-points/' + config.urlParams.idOrName + '',
|
|
1707
|
+
method: 'delete',
|
|
1708
|
+
body: null,
|
|
1709
|
+
urlParams: config.urlParams,
|
|
1710
|
+
queryParams: {},
|
|
1711
|
+
headers,
|
|
1712
|
+
priority: 'normal',
|
|
1713
|
+
};
|
|
1714
|
+
}
|
|
1715
|
+
|
|
1716
|
+
const adapterName$2 = 'deletePersonalizationPoint';
|
|
1717
|
+
const deletePersonalizationPoint_ConfigPropertyMetadata = [
|
|
1718
|
+
generateParamConfigMetadata('idOrName', true, 0 /* UrlParameter */, 0 /* String */),
|
|
1719
|
+
];
|
|
1720
|
+
const deletePersonalizationPoint_ConfigPropertyNames = /*#__PURE__*/ buildAdapterValidationConfig(adapterName$2, deletePersonalizationPoint_ConfigPropertyMetadata);
|
|
1721
|
+
const createResourceParams$2 = /*#__PURE__*/ createResourceParams$4(deletePersonalizationPoint_ConfigPropertyMetadata);
|
|
1722
|
+
function typeCheckConfig$2(untrustedConfig) {
|
|
1723
|
+
const config = {};
|
|
1724
|
+
typeCheckConfig$4(untrustedConfig, config, deletePersonalizationPoint_ConfigPropertyMetadata);
|
|
1725
|
+
return config;
|
|
1726
|
+
}
|
|
1727
|
+
function validateAdapterConfig$2(untrustedConfig, configPropertyNames) {
|
|
1728
|
+
if (!untrustedIsObject(untrustedConfig)) {
|
|
1729
|
+
return null;
|
|
1730
|
+
}
|
|
1731
|
+
if (process.env.NODE_ENV !== 'production') {
|
|
1732
|
+
validateConfig(untrustedConfig, configPropertyNames);
|
|
1733
|
+
}
|
|
1734
|
+
const config = typeCheckConfig$2(untrustedConfig);
|
|
1735
|
+
if (!areRequiredParametersPresent(config, configPropertyNames)) {
|
|
1736
|
+
return null;
|
|
1737
|
+
}
|
|
1738
|
+
return config;
|
|
1739
|
+
}
|
|
1740
|
+
function buildNetworkSnapshot$2(luvio, config, options) {
|
|
1741
|
+
const resourceParams = createResourceParams$2(config);
|
|
1742
|
+
const request = createResourceRequest$2(resourceParams);
|
|
1743
|
+
return luvio.dispatchResourceRequest(request, options)
|
|
1744
|
+
.then(() => {
|
|
1745
|
+
return luvio.handleSuccessResponse(() => {
|
|
1746
|
+
evictSuccess(luvio, resourceParams);
|
|
1747
|
+
return luvio.storeBroadcast();
|
|
1748
|
+
}, () => {
|
|
1749
|
+
const cache = new StoreKeyMap();
|
|
1750
|
+
getResponseCacheKeys$2(cache, luvio, resourceParams);
|
|
1751
|
+
return cache;
|
|
1752
|
+
});
|
|
1753
|
+
}, (response) => {
|
|
1754
|
+
deepFreeze(response);
|
|
1755
|
+
throw response;
|
|
1756
|
+
});
|
|
1757
|
+
}
|
|
1758
|
+
const deletePersonalizationPointAdapterFactory = (luvio) => {
|
|
1759
|
+
return function personalizationServicedeletePersonalizationPoint(untrustedConfig) {
|
|
1760
|
+
const config = validateAdapterConfig$2(untrustedConfig, deletePersonalizationPoint_ConfigPropertyNames);
|
|
1761
|
+
// Invalid or incomplete config
|
|
1762
|
+
if (config === null) {
|
|
1763
|
+
throw new Error(`Invalid config for "${adapterName$2}"`);
|
|
1764
|
+
}
|
|
1765
|
+
return buildNetworkSnapshot$2(luvio, config);
|
|
1766
|
+
};
|
|
1767
|
+
};
|
|
1768
|
+
|
|
1769
|
+
function select$1(luvio, params) {
|
|
1770
|
+
return select$3();
|
|
1771
|
+
}
|
|
1772
|
+
function keyBuilder$1(luvio, params) {
|
|
1773
|
+
return keyBuilder$3(luvio, {
|
|
1774
|
+
id: params.urlParams.idOrName
|
|
1775
|
+
});
|
|
1776
|
+
}
|
|
1777
|
+
function getResponseCacheKeys$1(storeKeyMap, luvio, resourceParams, response) {
|
|
1778
|
+
getTypeCacheKeys(storeKeyMap, luvio, response);
|
|
1779
|
+
}
|
|
1780
|
+
function ingestSuccess$1(luvio, resourceParams, response, snapshotRefresh) {
|
|
1781
|
+
const { body } = response;
|
|
1782
|
+
const key = keyBuilder$1(luvio, resourceParams);
|
|
1783
|
+
luvio.storeIngest(key, ingest, body);
|
|
1784
|
+
const snapshot = luvio.storeLookup({
|
|
1785
|
+
recordId: key,
|
|
1786
|
+
node: select$1(),
|
|
1787
|
+
variables: {},
|
|
1788
|
+
}, snapshotRefresh);
|
|
1789
|
+
if (process.env.NODE_ENV !== 'production') {
|
|
1790
|
+
if (snapshot.state !== 'Fulfilled') {
|
|
1791
|
+
throw new Error('Invalid network response. Expected resource response to result in Fulfilled snapshot');
|
|
1792
|
+
}
|
|
1793
|
+
}
|
|
1794
|
+
deepFreeze(snapshot.data);
|
|
1795
|
+
return snapshot;
|
|
1796
|
+
}
|
|
1797
|
+
function ingestError(luvio, params, error, snapshotRefresh) {
|
|
1798
|
+
const key = keyBuilder$1(luvio, params);
|
|
1799
|
+
const errorSnapshot = luvio.errorSnapshot(error, snapshotRefresh);
|
|
1800
|
+
const storeMetadataParams = {
|
|
1801
|
+
ttl: TTL,
|
|
1802
|
+
namespace: keyPrefix,
|
|
1803
|
+
version: VERSION,
|
|
1804
|
+
representationName: RepresentationType
|
|
1805
|
+
};
|
|
1806
|
+
luvio.storeIngestError(key, errorSnapshot, storeMetadataParams);
|
|
1807
|
+
return errorSnapshot;
|
|
1808
|
+
}
|
|
1809
|
+
function createResourceRequest$1(config) {
|
|
1810
|
+
const headers = {};
|
|
1811
|
+
return {
|
|
1812
|
+
baseUri: '/services/data/v62.0',
|
|
1813
|
+
basePath: '/personalization/personalization-points/' + config.urlParams.idOrName + '',
|
|
1814
|
+
method: 'get',
|
|
1815
|
+
body: null,
|
|
1816
|
+
urlParams: config.urlParams,
|
|
1817
|
+
queryParams: {},
|
|
1818
|
+
headers,
|
|
1819
|
+
priority: 'normal',
|
|
1820
|
+
};
|
|
1821
|
+
}
|
|
1822
|
+
|
|
1823
|
+
const adapterName$1 = 'getPersonalizationPoint';
|
|
1824
|
+
const getPersonalizationPoint_ConfigPropertyMetadata = [
|
|
1825
|
+
generateParamConfigMetadata('idOrName', true, 0 /* UrlParameter */, 0 /* String */),
|
|
1826
|
+
];
|
|
1827
|
+
const getPersonalizationPoint_ConfigPropertyNames = /*#__PURE__*/ buildAdapterValidationConfig(adapterName$1, getPersonalizationPoint_ConfigPropertyMetadata);
|
|
1828
|
+
const createResourceParams$1 = /*#__PURE__*/ createResourceParams$4(getPersonalizationPoint_ConfigPropertyMetadata);
|
|
1829
|
+
function keyBuilder(luvio, config) {
|
|
1830
|
+
const resourceParams = createResourceParams$1(config);
|
|
1831
|
+
return keyBuilder$1(luvio, resourceParams);
|
|
1832
|
+
}
|
|
1833
|
+
function typeCheckConfig$1(untrustedConfig) {
|
|
1834
|
+
const config = {};
|
|
1835
|
+
typeCheckConfig$4(untrustedConfig, config, getPersonalizationPoint_ConfigPropertyMetadata);
|
|
1836
|
+
return config;
|
|
1837
|
+
}
|
|
1838
|
+
function validateAdapterConfig$1(untrustedConfig, configPropertyNames) {
|
|
1839
|
+
if (!untrustedIsObject(untrustedConfig)) {
|
|
1840
|
+
return null;
|
|
1841
|
+
}
|
|
1842
|
+
if (process.env.NODE_ENV !== 'production') {
|
|
1843
|
+
validateConfig(untrustedConfig, configPropertyNames);
|
|
1844
|
+
}
|
|
1845
|
+
const config = typeCheckConfig$1(untrustedConfig);
|
|
1846
|
+
if (!areRequiredParametersPresent(config, configPropertyNames)) {
|
|
1847
|
+
return null;
|
|
1848
|
+
}
|
|
1849
|
+
return config;
|
|
1850
|
+
}
|
|
1851
|
+
function adapterFragment(luvio, config) {
|
|
1852
|
+
createResourceParams$1(config);
|
|
1853
|
+
return select$1();
|
|
1854
|
+
}
|
|
1855
|
+
function onFetchResponseSuccess(luvio, config, resourceParams, response) {
|
|
1856
|
+
const snapshot = ingestSuccess$1(luvio, resourceParams, response, {
|
|
1857
|
+
config,
|
|
1858
|
+
resolve: () => buildNetworkSnapshot$1(luvio, config, snapshotRefreshOptions)
|
|
1859
|
+
});
|
|
1860
|
+
return luvio.storeBroadcast().then(() => snapshot);
|
|
1861
|
+
}
|
|
1862
|
+
function onFetchResponseError(luvio, config, resourceParams, response) {
|
|
1863
|
+
const snapshot = ingestError(luvio, resourceParams, response, {
|
|
1864
|
+
config,
|
|
1865
|
+
resolve: () => buildNetworkSnapshot$1(luvio, config, snapshotRefreshOptions)
|
|
1866
|
+
});
|
|
1867
|
+
return luvio.storeBroadcast().then(() => snapshot);
|
|
1868
|
+
}
|
|
1869
|
+
function buildNetworkSnapshot$1(luvio, config, options) {
|
|
1870
|
+
const resourceParams = createResourceParams$1(config);
|
|
1871
|
+
const request = createResourceRequest$1(resourceParams);
|
|
1872
|
+
return luvio.dispatchResourceRequest(request, options)
|
|
1873
|
+
.then((response) => {
|
|
1874
|
+
return luvio.handleSuccessResponse(() => onFetchResponseSuccess(luvio, config, resourceParams, response), () => {
|
|
1875
|
+
const cache = new StoreKeyMap();
|
|
1876
|
+
getResponseCacheKeys$1(cache, luvio, resourceParams, response.body);
|
|
1877
|
+
return cache;
|
|
1878
|
+
});
|
|
1879
|
+
}, (response) => {
|
|
1880
|
+
return luvio.handleErrorResponse(() => onFetchResponseError(luvio, config, resourceParams, response));
|
|
1881
|
+
});
|
|
1882
|
+
}
|
|
1883
|
+
function buildNetworkSnapshotCachePolicy(context, coercedAdapterRequestContext) {
|
|
1884
|
+
return buildNetworkSnapshotCachePolicy$1(context, coercedAdapterRequestContext, buildNetworkSnapshot$1, undefined, false);
|
|
1885
|
+
}
|
|
1886
|
+
function buildCachedSnapshotCachePolicy(context, storeLookup) {
|
|
1887
|
+
const { luvio, config } = context;
|
|
1888
|
+
const selector = {
|
|
1889
|
+
recordId: keyBuilder(luvio, config),
|
|
1890
|
+
node: adapterFragment(luvio, config),
|
|
1891
|
+
variables: {},
|
|
1892
|
+
};
|
|
1893
|
+
const cacheSnapshot = storeLookup(selector, {
|
|
1894
|
+
config,
|
|
1895
|
+
resolve: () => buildNetworkSnapshot$1(luvio, config, snapshotRefreshOptions)
|
|
1896
|
+
});
|
|
1897
|
+
return cacheSnapshot;
|
|
1898
|
+
}
|
|
1899
|
+
const getPersonalizationPointAdapterFactory = (luvio) => function personalizationService__getPersonalizationPoint(untrustedConfig, requestContext) {
|
|
1900
|
+
const config = validateAdapterConfig$1(untrustedConfig, getPersonalizationPoint_ConfigPropertyNames);
|
|
1901
|
+
// Invalid or incomplete config
|
|
1902
|
+
if (config === null) {
|
|
1903
|
+
return null;
|
|
1904
|
+
}
|
|
1905
|
+
return luvio.applyCachePolicy((requestContext || {}), { config, luvio }, // BuildSnapshotContext
|
|
1906
|
+
buildCachedSnapshotCachePolicy, buildNetworkSnapshotCachePolicy);
|
|
1907
|
+
};
|
|
1908
|
+
|
|
1909
|
+
function select(luvio, params) {
|
|
1910
|
+
return select$3();
|
|
1911
|
+
}
|
|
1912
|
+
function getResponseCacheKeys(storeKeyMap, luvio, resourceParams, response) {
|
|
1913
|
+
getTypeCacheKeys(storeKeyMap, luvio, response);
|
|
1914
|
+
}
|
|
1915
|
+
function ingestSuccess(luvio, resourceParams, response) {
|
|
1916
|
+
const { body } = response;
|
|
1917
|
+
const key = keyBuilderFromType(luvio, body);
|
|
1918
|
+
luvio.storeIngest(key, ingest, body);
|
|
1919
|
+
const snapshot = luvio.storeLookup({
|
|
1920
|
+
recordId: key,
|
|
1921
|
+
node: select(),
|
|
1922
|
+
variables: {},
|
|
1923
|
+
});
|
|
1924
|
+
if (process.env.NODE_ENV !== 'production') {
|
|
1925
|
+
if (snapshot.state !== 'Fulfilled') {
|
|
1926
|
+
throw new Error('Invalid network response. Expected resource response to result in Fulfilled snapshot');
|
|
1927
|
+
}
|
|
1928
|
+
}
|
|
1929
|
+
deepFreeze(snapshot.data);
|
|
1930
|
+
return snapshot;
|
|
1931
|
+
}
|
|
1932
|
+
function createResourceRequest(config) {
|
|
1933
|
+
const headers = {};
|
|
1934
|
+
return {
|
|
1935
|
+
baseUri: '/services/data/v62.0',
|
|
1936
|
+
basePath: '/personalization/personalization-points/' + config.urlParams.idOrName + '',
|
|
1937
|
+
method: 'put',
|
|
1938
|
+
body: config.body,
|
|
1939
|
+
urlParams: config.urlParams,
|
|
1940
|
+
queryParams: {},
|
|
1941
|
+
headers,
|
|
1942
|
+
priority: 'normal',
|
|
1943
|
+
};
|
|
1944
|
+
}
|
|
1945
|
+
|
|
1946
|
+
const adapterName = 'updatePersonalizationPoint';
|
|
1947
|
+
const updatePersonalizationPoint_ConfigPropertyMetadata = [
|
|
1948
|
+
generateParamConfigMetadata('idOrName', true, 0 /* UrlParameter */, 0 /* String */),
|
|
1949
|
+
generateParamConfigMetadata('description', true, 2 /* Body */, 4 /* Unsupported */),
|
|
1950
|
+
generateParamConfigMetadata('label', true, 2 /* Body */, 4 /* Unsupported */),
|
|
1951
|
+
generateParamConfigMetadata('name', true, 2 /* Body */, 4 /* Unsupported */),
|
|
1952
|
+
generateParamConfigMetadata('abnExperimentName', true, 2 /* Body */, 4 /* Unsupported */),
|
|
1953
|
+
generateParamConfigMetadata('dataSpaceName', true, 2 /* Body */, 4 /* Unsupported */),
|
|
1954
|
+
generateParamConfigMetadata('decisions', true, 2 /* Body */, 4 /* Unsupported */, true),
|
|
1955
|
+
generateParamConfigMetadata('profileDataGraphName', true, 2 /* Body */, 4 /* Unsupported */),
|
|
1956
|
+
generateParamConfigMetadata('schemaEnum', true, 2 /* Body */, 4 /* Unsupported */),
|
|
1957
|
+
generateParamConfigMetadata('schemaName', true, 2 /* Body */, 4 /* Unsupported */),
|
|
1958
|
+
generateParamConfigMetadata('source', true, 2 /* Body */, 0 /* String */),
|
|
1959
|
+
];
|
|
1960
|
+
const updatePersonalizationPoint_ConfigPropertyNames = /*#__PURE__*/ buildAdapterValidationConfig(adapterName, updatePersonalizationPoint_ConfigPropertyMetadata);
|
|
1961
|
+
const createResourceParams = /*#__PURE__*/ createResourceParams$4(updatePersonalizationPoint_ConfigPropertyMetadata);
|
|
1962
|
+
function typeCheckConfig(untrustedConfig) {
|
|
1963
|
+
const config = {};
|
|
1964
|
+
typeCheckConfig$4(untrustedConfig, config, updatePersonalizationPoint_ConfigPropertyMetadata);
|
|
1965
|
+
const untrustedConfig_description = untrustedConfig.description;
|
|
1966
|
+
if (typeof untrustedConfig_description === 'string') {
|
|
1967
|
+
config.description = untrustedConfig_description;
|
|
1968
|
+
}
|
|
1969
|
+
if (untrustedConfig_description === null) {
|
|
1970
|
+
config.description = untrustedConfig_description;
|
|
1971
|
+
}
|
|
1972
|
+
const untrustedConfig_label = untrustedConfig.label;
|
|
1973
|
+
if (typeof untrustedConfig_label === 'string') {
|
|
1974
|
+
config.label = untrustedConfig_label;
|
|
1975
|
+
}
|
|
1976
|
+
if (untrustedConfig_label === null) {
|
|
1977
|
+
config.label = untrustedConfig_label;
|
|
1978
|
+
}
|
|
1979
|
+
const untrustedConfig_name = untrustedConfig.name;
|
|
1980
|
+
if (typeof untrustedConfig_name === 'string') {
|
|
1981
|
+
config.name = untrustedConfig_name;
|
|
1982
|
+
}
|
|
1983
|
+
if (untrustedConfig_name === null) {
|
|
1984
|
+
config.name = untrustedConfig_name;
|
|
1985
|
+
}
|
|
1986
|
+
const untrustedConfig_abnExperimentName = untrustedConfig.abnExperimentName;
|
|
1987
|
+
if (typeof untrustedConfig_abnExperimentName === 'string') {
|
|
1988
|
+
config.abnExperimentName = untrustedConfig_abnExperimentName;
|
|
1989
|
+
}
|
|
1990
|
+
if (untrustedConfig_abnExperimentName === null) {
|
|
1991
|
+
config.abnExperimentName = untrustedConfig_abnExperimentName;
|
|
1992
|
+
}
|
|
1993
|
+
const untrustedConfig_dataSpaceName = untrustedConfig.dataSpaceName;
|
|
1994
|
+
if (typeof untrustedConfig_dataSpaceName === 'string') {
|
|
1995
|
+
config.dataSpaceName = untrustedConfig_dataSpaceName;
|
|
1996
|
+
}
|
|
1997
|
+
if (untrustedConfig_dataSpaceName === null) {
|
|
1998
|
+
config.dataSpaceName = untrustedConfig_dataSpaceName;
|
|
1999
|
+
}
|
|
2000
|
+
const untrustedConfig_decisions = untrustedConfig.decisions;
|
|
2001
|
+
if (ArrayIsArray$1(untrustedConfig_decisions)) {
|
|
2002
|
+
const untrustedConfig_decisions_array = [];
|
|
2003
|
+
for (let i = 0, arrayLength = untrustedConfig_decisions.length; i < arrayLength; i++) {
|
|
2004
|
+
const untrustedConfig_decisions_item = untrustedConfig_decisions[i];
|
|
2005
|
+
const referencePersonalizationDecisionInputRepresentationValidationError = validate$3(untrustedConfig_decisions_item);
|
|
2006
|
+
if (referencePersonalizationDecisionInputRepresentationValidationError === null) {
|
|
2007
|
+
untrustedConfig_decisions_array.push(untrustedConfig_decisions_item);
|
|
2008
|
+
}
|
|
2009
|
+
}
|
|
2010
|
+
config.decisions = untrustedConfig_decisions_array;
|
|
2011
|
+
}
|
|
2012
|
+
const untrustedConfig_profileDataGraphName = untrustedConfig.profileDataGraphName;
|
|
2013
|
+
if (typeof untrustedConfig_profileDataGraphName === 'string') {
|
|
2014
|
+
config.profileDataGraphName = untrustedConfig_profileDataGraphName;
|
|
2015
|
+
}
|
|
2016
|
+
if (untrustedConfig_profileDataGraphName === null) {
|
|
2017
|
+
config.profileDataGraphName = untrustedConfig_profileDataGraphName;
|
|
2018
|
+
}
|
|
2019
|
+
const untrustedConfig_schemaEnum = untrustedConfig.schemaEnum;
|
|
2020
|
+
if (typeof untrustedConfig_schemaEnum === 'string') {
|
|
2021
|
+
config.schemaEnum = untrustedConfig_schemaEnum;
|
|
2022
|
+
}
|
|
2023
|
+
if (untrustedConfig_schemaEnum === null) {
|
|
2024
|
+
config.schemaEnum = untrustedConfig_schemaEnum;
|
|
2025
|
+
}
|
|
2026
|
+
const untrustedConfig_schemaName = untrustedConfig.schemaName;
|
|
2027
|
+
if (typeof untrustedConfig_schemaName === 'string') {
|
|
2028
|
+
config.schemaName = untrustedConfig_schemaName;
|
|
2029
|
+
}
|
|
2030
|
+
if (untrustedConfig_schemaName === null) {
|
|
2031
|
+
config.schemaName = untrustedConfig_schemaName;
|
|
2032
|
+
}
|
|
2033
|
+
return config;
|
|
2034
|
+
}
|
|
2035
|
+
function validateAdapterConfig(untrustedConfig, configPropertyNames) {
|
|
2036
|
+
if (!untrustedIsObject(untrustedConfig)) {
|
|
2037
|
+
return null;
|
|
2038
|
+
}
|
|
2039
|
+
if (process.env.NODE_ENV !== 'production') {
|
|
2040
|
+
validateConfig(untrustedConfig, configPropertyNames);
|
|
2041
|
+
}
|
|
2042
|
+
const config = typeCheckConfig(untrustedConfig);
|
|
2043
|
+
if (!areRequiredParametersPresent(config, configPropertyNames)) {
|
|
2044
|
+
return null;
|
|
2045
|
+
}
|
|
2046
|
+
return config;
|
|
2047
|
+
}
|
|
2048
|
+
function buildNetworkSnapshot(luvio, config, options) {
|
|
2049
|
+
const resourceParams = createResourceParams(config);
|
|
2050
|
+
const request = createResourceRequest(resourceParams);
|
|
2051
|
+
return luvio.dispatchResourceRequest(request, options)
|
|
2052
|
+
.then((response) => {
|
|
2053
|
+
return luvio.handleSuccessResponse(() => {
|
|
2054
|
+
const snapshot = ingestSuccess(luvio, resourceParams, response);
|
|
2055
|
+
return luvio.storeBroadcast().then(() => snapshot);
|
|
2056
|
+
}, () => {
|
|
2057
|
+
const cache = new StoreKeyMap();
|
|
2058
|
+
getResponseCacheKeys(cache, luvio, resourceParams, response.body);
|
|
2059
|
+
return cache;
|
|
2060
|
+
});
|
|
2061
|
+
}, (response) => {
|
|
2062
|
+
deepFreeze(response);
|
|
2063
|
+
throw response;
|
|
2064
|
+
});
|
|
2065
|
+
}
|
|
2066
|
+
const updatePersonalizationPointAdapterFactory = (luvio) => {
|
|
2067
|
+
return function updatePersonalizationPoint(untrustedConfig) {
|
|
2068
|
+
const config = validateAdapterConfig(untrustedConfig, updatePersonalizationPoint_ConfigPropertyNames);
|
|
2069
|
+
// Invalid or incomplete config
|
|
2070
|
+
if (config === null) {
|
|
2071
|
+
throw new Error('Invalid config for "updatePersonalizationPoint"');
|
|
2072
|
+
}
|
|
2073
|
+
return buildNetworkSnapshot(luvio, config);
|
|
2074
|
+
};
|
|
2075
|
+
};
|
|
2076
|
+
|
|
2077
|
+
let createPersonalizationPoint;
|
|
2078
|
+
let deletePersonalizationPoint;
|
|
2079
|
+
let getPersonalizationPoint;
|
|
2080
|
+
let updatePersonalizationPoint;
|
|
2081
|
+
// Imperative GET Adapters
|
|
2082
|
+
let getPersonalizationPoint_imperative;
|
|
2083
|
+
const getPersonalizationPointMetadata = {
|
|
2084
|
+
apiFamily: 'personalizationservice',
|
|
2085
|
+
name: 'getPersonalizationPoint',
|
|
2086
|
+
ttl: 600,
|
|
2087
|
+
};
|
|
2088
|
+
// Notify Update Available
|
|
2089
|
+
function bindExportsTo(luvio) {
|
|
2090
|
+
// LDS Adapters
|
|
2091
|
+
const getPersonalizationPoint_ldsAdapter = createInstrumentedAdapter(createLDSAdapter(luvio, 'getPersonalizationPoint', getPersonalizationPointAdapterFactory), getPersonalizationPointMetadata);
|
|
2092
|
+
function unwrapSnapshotData(factory) {
|
|
2093
|
+
const adapter = factory(luvio);
|
|
2094
|
+
return (config) => adapter(config).then((snapshot) => snapshot.data);
|
|
2095
|
+
}
|
|
2096
|
+
return {
|
|
2097
|
+
createPersonalizationPoint: unwrapSnapshotData(createPersonalizationPointAdapterFactory),
|
|
2098
|
+
deletePersonalizationPoint: createLDSAdapter(luvio, adapterName$2, deletePersonalizationPointAdapterFactory),
|
|
2099
|
+
getPersonalizationPoint: createWireAdapterConstructor(luvio, getPersonalizationPoint_ldsAdapter, getPersonalizationPointMetadata),
|
|
2100
|
+
updatePersonalizationPoint: unwrapSnapshotData(updatePersonalizationPointAdapterFactory),
|
|
2101
|
+
// Imperative GET Adapters
|
|
2102
|
+
getPersonalizationPoint_imperative: createImperativeAdapter(luvio, getPersonalizationPoint_ldsAdapter, getPersonalizationPointMetadata),
|
|
2103
|
+
// Notify Update Availables
|
|
2104
|
+
};
|
|
2105
|
+
}
|
|
2106
|
+
withDefaultLuvio((luvio) => {
|
|
2107
|
+
({
|
|
2108
|
+
createPersonalizationPoint,
|
|
2109
|
+
deletePersonalizationPoint,
|
|
2110
|
+
getPersonalizationPoint,
|
|
2111
|
+
updatePersonalizationPoint,
|
|
2112
|
+
getPersonalizationPoint_imperative,
|
|
2113
|
+
} = bindExportsTo(luvio));
|
|
2114
|
+
});
|
|
2115
|
+
|
|
2116
|
+
export { createPersonalizationPoint, deletePersonalizationPoint, getPersonalizationPoint, getPersonalizationPoint_imperative, updatePersonalizationPoint };
|
|
2117
|
+
// version: 1.299.0-161c48605a
|