@salesforce/lds-adapters-industries-cpq 1.135.0 → 1.136.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/es/es2018/industries-cpq.js +3718 -146
- package/dist/es/es2018/types/src/generated/adapters/createCart.d.ts +15 -0
- package/dist/es/es2018/types/src/generated/adapters/createCartItems.d.ts +16 -0
- package/dist/es/es2018/types/src/generated/adapters/getCart.d.ts +26 -0
- package/dist/es/es2018/types/src/generated/adapters/priceCart.d.ts +16 -0
- package/dist/es/es2018/types/src/generated/adapters/updateCart.d.ts +16 -0
- package/dist/es/es2018/types/src/generated/adapters/updateCartItems.d.ts +16 -0
- package/dist/es/es2018/types/src/generated/artifacts/main.d.ts +6 -0
- package/dist/es/es2018/types/src/generated/artifacts/sfdc.d.ts +8 -1
- package/dist/es/es2018/types/src/generated/resources/getConnectCpqCartsByCartId.d.ts +15 -0
- package/dist/es/es2018/types/src/generated/resources/patchConnectCpqCartsByCartId.d.ts +16 -0
- package/dist/es/es2018/types/src/generated/resources/patchConnectCpqCartsItemsByCartId.d.ts +16 -0
- package/dist/es/es2018/types/src/generated/resources/patchConnectCpqCartsPriceByCartId.d.ts +16 -0
- package/dist/es/es2018/types/src/generated/resources/postConnectCpqCarts.d.ts +13 -0
- package/dist/es/es2018/types/src/generated/resources/postConnectCpqCartsItemsByCartId.d.ts +16 -0
- package/dist/es/es2018/types/src/generated/types/ApiStatusOutputRepresentation.d.ts +1 -4
- package/dist/es/es2018/types/src/generated/types/AttributeCategoryOutputRepresentation.d.ts +4 -1
- package/dist/es/es2018/types/src/generated/types/CartItemOutputRepresentation.d.ts +60 -0
- package/dist/es/es2018/types/src/generated/types/CartItemsOutputRepresentation.d.ts +32 -0
- package/dist/es/es2018/types/src/generated/types/CartPricingTotalOutputRepresentation.d.ts +46 -0
- package/dist/es/es2018/types/src/generated/types/CreateCartInputRepresentation.d.ts +48 -0
- package/dist/es/es2018/types/src/generated/types/CreateCartItemsInputRepresentation.d.ts +34 -0
- package/dist/es/es2018/types/src/generated/types/CreateCartItemsInputRepresentationWrapper.d.ts +28 -0
- package/dist/es/es2018/types/src/generated/types/CreateCartItemsOutputRepresentation.d.ts +42 -0
- package/dist/es/es2018/types/src/generated/types/CreateCartOutputRepresentation.d.ts +42 -0
- package/dist/es/es2018/types/src/generated/types/CreateCartRequestWrapper.d.ts +28 -0
- package/dist/es/es2018/types/src/generated/types/GetCartOutputRepresentation.d.ts +40 -0
- package/dist/es/es2018/types/src/generated/types/PriceCartInputRepresentation.d.ts +34 -0
- package/dist/es/es2018/types/src/generated/types/PriceCartInputRepresentationWrapper.d.ts +28 -0
- package/dist/es/es2018/types/src/generated/types/PricingTotalOutputRepresentation.d.ts +37 -0
- package/dist/es/es2018/types/src/generated/types/ProductAttributeOutputRepresentation.d.ts +16 -1
- package/dist/es/es2018/types/src/generated/types/QocBaseOutputRepresentation.d.ts +29 -0
- package/dist/es/es2018/types/src/generated/types/UpdateCartInputRepresentation.d.ts +34 -0
- package/dist/es/es2018/types/src/generated/types/UpdateCartInputRepresentationWrapper.d.ts +28 -0
- package/dist/es/es2018/types/src/generated/types/UpdateCartItemsInputRepresentation.d.ts +34 -0
- package/dist/es/es2018/types/src/generated/types/UpdateCartItemsInputRepresentationWrapper.d.ts +28 -0
- package/dist/es/es2018/types/src/generated/types/UpdateCartItemsOutputRepresentation.d.ts +42 -0
- package/dist/es/es2018/types/src/generated/types/UpdateCartOutputRepresentation.d.ts +42 -0
- package/dist/es/es2018/types/src/generated/types/ValidateCartOutputRepresentation.d.ts +38 -0
- package/dist/es/es2018/types/src/generated/types/ValidationResultOutputRepresentation.d.ts +40 -0
- package/package.json +1 -1
- package/sfdc/index.js +3834 -236
- package/src/raml/api.raml +486 -4
- package/src/raml/luvio.raml +53 -0
|
@@ -41,18 +41,38 @@ function untrustedIsObject(untrusted) {
|
|
|
41
41
|
function areRequiredParametersPresent(config, configPropertyNames) {
|
|
42
42
|
return configPropertyNames.parameters.required.every(req => req in config);
|
|
43
43
|
}
|
|
44
|
+
const snapshotRefreshOptions = {
|
|
45
|
+
overrides: {
|
|
46
|
+
headers: {
|
|
47
|
+
'Cache-Control': 'no-cache',
|
|
48
|
+
},
|
|
49
|
+
}
|
|
50
|
+
};
|
|
44
51
|
const keyPrefix = 'cpq';
|
|
45
52
|
|
|
46
53
|
const { keys: ObjectKeys, create: ObjectCreate, assign: ObjectAssign } = Object;
|
|
47
54
|
const { isArray: ArrayIsArray } = Array;
|
|
48
55
|
const { stringify: JSONStringify } = JSON;
|
|
56
|
+
function equalsArray(a, b, equalsItem) {
|
|
57
|
+
const aLength = a.length;
|
|
58
|
+
const bLength = b.length;
|
|
59
|
+
if (aLength !== bLength) {
|
|
60
|
+
return false;
|
|
61
|
+
}
|
|
62
|
+
for (let i = 0; i < aLength; i++) {
|
|
63
|
+
if (equalsItem(a[i], b[i]) === false) {
|
|
64
|
+
return false;
|
|
65
|
+
}
|
|
66
|
+
}
|
|
67
|
+
return true;
|
|
68
|
+
}
|
|
49
69
|
function createLink(ref) {
|
|
50
70
|
return {
|
|
51
71
|
__ref: serializeStructuredKey(ref),
|
|
52
72
|
};
|
|
53
73
|
}
|
|
54
74
|
|
|
55
|
-
function validate$
|
|
75
|
+
function validate$r(obj, path = 'PreviewInputRepresentation') {
|
|
56
76
|
const v_error = (() => {
|
|
57
77
|
if (typeof obj !== 'object' || ArrayIsArray(obj) || obj === null) {
|
|
58
78
|
return new TypeError('Expected "object" but received "' + typeof obj + '" (at "' + path + '")');
|
|
@@ -112,7 +132,8 @@ function validate$7(obj, path = 'PreviewInputRepresentation') {
|
|
|
112
132
|
return v_error === undefined ? null : v_error;
|
|
113
133
|
}
|
|
114
134
|
|
|
115
|
-
|
|
135
|
+
const VERSION$g = "16ee7e6452adaa7a1a8e36a1238a4b85";
|
|
136
|
+
function validate$q(obj, path = 'CpqMessageOutputRepresentation') {
|
|
116
137
|
const v_error = (() => {
|
|
117
138
|
if (typeof obj !== 'object' || ArrayIsArray(obj) || obj === null) {
|
|
118
139
|
return new TypeError('Expected "object" but received "' + typeof obj + '" (at "' + path + '")');
|
|
@@ -148,19 +169,97 @@ function validate$6(obj, path = 'CpqMessageOutputRepresentation') {
|
|
|
148
169
|
})();
|
|
149
170
|
return v_error === undefined ? null : v_error;
|
|
150
171
|
}
|
|
172
|
+
const select$q = function CpqMessageOutputRepresentationSelect() {
|
|
173
|
+
return {
|
|
174
|
+
kind: 'Fragment',
|
|
175
|
+
version: VERSION$g,
|
|
176
|
+
private: [],
|
|
177
|
+
selections: [
|
|
178
|
+
{
|
|
179
|
+
name: 'code',
|
|
180
|
+
kind: 'Scalar',
|
|
181
|
+
required: false
|
|
182
|
+
},
|
|
183
|
+
{
|
|
184
|
+
name: 'detail',
|
|
185
|
+
kind: 'Scalar',
|
|
186
|
+
required: false
|
|
187
|
+
},
|
|
188
|
+
{
|
|
189
|
+
name: 'message',
|
|
190
|
+
kind: 'Scalar',
|
|
191
|
+
required: false
|
|
192
|
+
},
|
|
193
|
+
{
|
|
194
|
+
name: 'severity',
|
|
195
|
+
kind: 'Scalar',
|
|
196
|
+
required: false
|
|
197
|
+
}
|
|
198
|
+
]
|
|
199
|
+
};
|
|
200
|
+
};
|
|
201
|
+
function equals$g(existing, incoming) {
|
|
202
|
+
const existing_code = existing.code;
|
|
203
|
+
const incoming_code = incoming.code;
|
|
204
|
+
// if at least one of these optionals is defined
|
|
205
|
+
if (existing_code !== undefined || incoming_code !== undefined) {
|
|
206
|
+
// if one of these is not defined we know the other is defined and therefore
|
|
207
|
+
// not equal
|
|
208
|
+
if (existing_code === undefined || incoming_code === undefined) {
|
|
209
|
+
return false;
|
|
210
|
+
}
|
|
211
|
+
if (!(existing_code === incoming_code)) {
|
|
212
|
+
return false;
|
|
213
|
+
}
|
|
214
|
+
}
|
|
215
|
+
const existing_detail = existing.detail;
|
|
216
|
+
const incoming_detail = incoming.detail;
|
|
217
|
+
// if at least one of these optionals is defined
|
|
218
|
+
if (existing_detail !== undefined || incoming_detail !== undefined) {
|
|
219
|
+
// if one of these is not defined we know the other is defined and therefore
|
|
220
|
+
// not equal
|
|
221
|
+
if (existing_detail === undefined || incoming_detail === undefined) {
|
|
222
|
+
return false;
|
|
223
|
+
}
|
|
224
|
+
if (!(existing_detail === incoming_detail)) {
|
|
225
|
+
return false;
|
|
226
|
+
}
|
|
227
|
+
}
|
|
228
|
+
const existing_message = existing.message;
|
|
229
|
+
const incoming_message = incoming.message;
|
|
230
|
+
// if at least one of these optionals is defined
|
|
231
|
+
if (existing_message !== undefined || incoming_message !== undefined) {
|
|
232
|
+
// if one of these is not defined we know the other is defined and therefore
|
|
233
|
+
// not equal
|
|
234
|
+
if (existing_message === undefined || incoming_message === undefined) {
|
|
235
|
+
return false;
|
|
236
|
+
}
|
|
237
|
+
if (!(existing_message === incoming_message)) {
|
|
238
|
+
return false;
|
|
239
|
+
}
|
|
240
|
+
}
|
|
241
|
+
const existing_severity = existing.severity;
|
|
242
|
+
const incoming_severity = incoming.severity;
|
|
243
|
+
// if at least one of these optionals is defined
|
|
244
|
+
if (existing_severity !== undefined || incoming_severity !== undefined) {
|
|
245
|
+
// if one of these is not defined we know the other is defined and therefore
|
|
246
|
+
// not equal
|
|
247
|
+
if (existing_severity === undefined || incoming_severity === undefined) {
|
|
248
|
+
return false;
|
|
249
|
+
}
|
|
250
|
+
if (!(existing_severity === incoming_severity)) {
|
|
251
|
+
return false;
|
|
252
|
+
}
|
|
253
|
+
}
|
|
254
|
+
return true;
|
|
255
|
+
}
|
|
151
256
|
|
|
152
|
-
|
|
257
|
+
const VERSION$f = "2927abd89d0e76012000aa604b583b6d";
|
|
258
|
+
function validate$p(obj, path = 'ApiStatusOutputRepresentation') {
|
|
153
259
|
const v_error = (() => {
|
|
154
260
|
if (typeof obj !== 'object' || ArrayIsArray(obj) || obj === null) {
|
|
155
261
|
return new TypeError('Expected "object" but received "' + typeof obj + '" (at "' + path + '")');
|
|
156
262
|
}
|
|
157
|
-
if (obj.httpStatusCode !== undefined) {
|
|
158
|
-
const obj_httpStatusCode = obj.httpStatusCode;
|
|
159
|
-
const path_httpStatusCode = path + '.httpStatusCode';
|
|
160
|
-
if (typeof obj_httpStatusCode !== 'string') {
|
|
161
|
-
return new TypeError('Expected "string" but received "' + typeof obj_httpStatusCode + '" (at "' + path_httpStatusCode + '")');
|
|
162
|
-
}
|
|
163
|
-
}
|
|
164
263
|
if (obj.messages !== undefined) {
|
|
165
264
|
const obj_messages = obj.messages;
|
|
166
265
|
const path_messages = path + '.messages';
|
|
@@ -170,7 +269,7 @@ function validate$5(obj, path = 'ApiStatusOutputRepresentation') {
|
|
|
170
269
|
for (let i = 0; i < obj_messages.length; i++) {
|
|
171
270
|
const obj_messages_item = obj_messages[i];
|
|
172
271
|
const path_messages_item = path_messages + '[' + i + ']';
|
|
173
|
-
const referencepath_messages_itemValidationError = validate$
|
|
272
|
+
const referencepath_messages_itemValidationError = validate$q(obj_messages_item, path_messages_item);
|
|
174
273
|
if (referencepath_messages_itemValidationError !== null) {
|
|
175
274
|
let message = 'Object doesn\'t match CpqMessageOutputRepresentation (at "' + path_messages_item + '")\n';
|
|
176
275
|
message += referencepath_messages_itemValidationError.message.split('\n').map((line) => '\t' + line).join('\n');
|
|
@@ -193,17 +292,82 @@ function validate$5(obj, path = 'ApiStatusOutputRepresentation') {
|
|
|
193
292
|
})();
|
|
194
293
|
return v_error === undefined ? null : v_error;
|
|
195
294
|
}
|
|
295
|
+
const select$p = function ApiStatusOutputRepresentationSelect() {
|
|
296
|
+
const { selections: CpqMessageOutputRepresentation__selections, opaque: CpqMessageOutputRepresentation__opaque, } = select$q();
|
|
297
|
+
return {
|
|
298
|
+
kind: 'Fragment',
|
|
299
|
+
version: VERSION$f,
|
|
300
|
+
private: [],
|
|
301
|
+
selections: [
|
|
302
|
+
{
|
|
303
|
+
name: 'messages',
|
|
304
|
+
kind: 'Object',
|
|
305
|
+
plural: true,
|
|
306
|
+
selections: CpqMessageOutputRepresentation__selections,
|
|
307
|
+
required: false
|
|
308
|
+
},
|
|
309
|
+
{
|
|
310
|
+
name: 'statusCode',
|
|
311
|
+
kind: 'Scalar'
|
|
312
|
+
},
|
|
313
|
+
{
|
|
314
|
+
name: 'statusMessage',
|
|
315
|
+
kind: 'Scalar',
|
|
316
|
+
required: false
|
|
317
|
+
}
|
|
318
|
+
]
|
|
319
|
+
};
|
|
320
|
+
};
|
|
321
|
+
function equals$f(existing, incoming) {
|
|
322
|
+
const existing_statusCode = existing.statusCode;
|
|
323
|
+
const incoming_statusCode = incoming.statusCode;
|
|
324
|
+
if (!(existing_statusCode === incoming_statusCode)) {
|
|
325
|
+
return false;
|
|
326
|
+
}
|
|
327
|
+
const existing_statusMessage = existing.statusMessage;
|
|
328
|
+
const incoming_statusMessage = incoming.statusMessage;
|
|
329
|
+
// if at least one of these optionals is defined
|
|
330
|
+
if (existing_statusMessage !== undefined || incoming_statusMessage !== undefined) {
|
|
331
|
+
// if one of these is not defined we know the other is defined and therefore
|
|
332
|
+
// not equal
|
|
333
|
+
if (existing_statusMessage === undefined || incoming_statusMessage === undefined) {
|
|
334
|
+
return false;
|
|
335
|
+
}
|
|
336
|
+
if (!(existing_statusMessage === incoming_statusMessage)) {
|
|
337
|
+
return false;
|
|
338
|
+
}
|
|
339
|
+
}
|
|
340
|
+
const existing_messages = existing.messages;
|
|
341
|
+
const incoming_messages = incoming.messages;
|
|
342
|
+
// if at least one of these optionals is defined
|
|
343
|
+
if (existing_messages !== undefined || incoming_messages !== undefined) {
|
|
344
|
+
// if one of these is not defined we know the other is defined and therefore
|
|
345
|
+
// not equal
|
|
346
|
+
if (existing_messages === undefined || incoming_messages === undefined) {
|
|
347
|
+
return false;
|
|
348
|
+
}
|
|
349
|
+
const equals_messages_items = equalsArray(existing_messages, incoming_messages, (existing_messages_item, incoming_messages_item) => {
|
|
350
|
+
if (!(equals$g(existing_messages_item, incoming_messages_item))) {
|
|
351
|
+
return false;
|
|
352
|
+
}
|
|
353
|
+
});
|
|
354
|
+
if (equals_messages_items === false) {
|
|
355
|
+
return false;
|
|
356
|
+
}
|
|
357
|
+
}
|
|
358
|
+
return true;
|
|
359
|
+
}
|
|
196
360
|
|
|
197
|
-
const TTL$
|
|
198
|
-
const VERSION$
|
|
199
|
-
function validate$
|
|
361
|
+
const TTL$6 = 1000;
|
|
362
|
+
const VERSION$e = "1b001ded9d8468be069df058f1b491e1";
|
|
363
|
+
function validate$o(obj, path = 'CpqBaseListOutputRepresentation') {
|
|
200
364
|
const v_error = (() => {
|
|
201
365
|
if (typeof obj !== 'object' || ArrayIsArray(obj) || obj === null) {
|
|
202
366
|
return new TypeError('Expected "object" but received "' + typeof obj + '" (at "' + path + '")');
|
|
203
367
|
}
|
|
204
368
|
const obj_apiStatus = obj.apiStatus;
|
|
205
369
|
const path_apiStatus = path + '.apiStatus';
|
|
206
|
-
const referencepath_apiStatusValidationError = validate$
|
|
370
|
+
const referencepath_apiStatusValidationError = validate$p(obj_apiStatus, path_apiStatus);
|
|
207
371
|
if (referencepath_apiStatusValidationError !== null) {
|
|
208
372
|
let message = 'Object doesn\'t match ApiStatusOutputRepresentation (at "' + path_apiStatus + '")\n';
|
|
209
373
|
message += referencepath_apiStatusValidationError.message.split('\n').map((line) => '\t' + line).join('\n');
|
|
@@ -252,88 +416,88 @@ function validate$4(obj, path = 'CpqBaseListOutputRepresentation') {
|
|
|
252
416
|
})();
|
|
253
417
|
return v_error === undefined ? null : v_error;
|
|
254
418
|
}
|
|
255
|
-
const RepresentationType$
|
|
256
|
-
function keyBuilder$
|
|
257
|
-
return keyPrefix + '::' + RepresentationType$
|
|
419
|
+
const RepresentationType$7 = 'CpqBaseListOutputRepresentation';
|
|
420
|
+
function keyBuilder$8(luvio, config) {
|
|
421
|
+
return keyPrefix + '::' + RepresentationType$7 + ':' + config.message;
|
|
258
422
|
}
|
|
259
|
-
function keyBuilderFromType$
|
|
423
|
+
function keyBuilderFromType$6(luvio, object) {
|
|
260
424
|
const keyParams = {
|
|
261
425
|
message: object.apiStatus.statusCode
|
|
262
426
|
};
|
|
263
|
-
return keyBuilder$
|
|
427
|
+
return keyBuilder$8(luvio, keyParams);
|
|
264
428
|
}
|
|
265
|
-
function normalize$
|
|
429
|
+
function normalize$7(input, existing, path, luvio, store, timestamp) {
|
|
266
430
|
return input;
|
|
267
431
|
}
|
|
268
|
-
const select$
|
|
432
|
+
const select$o = function CpqBaseListOutputRepresentationSelect() {
|
|
269
433
|
return {
|
|
270
434
|
kind: 'Fragment',
|
|
271
|
-
version: VERSION$
|
|
435
|
+
version: VERSION$e,
|
|
272
436
|
private: [],
|
|
273
437
|
opaque: true
|
|
274
438
|
};
|
|
275
439
|
};
|
|
276
|
-
function equals$
|
|
440
|
+
function equals$e(existing, incoming) {
|
|
277
441
|
if (JSONStringify(incoming) !== JSONStringify(existing)) {
|
|
278
442
|
return false;
|
|
279
443
|
}
|
|
280
444
|
return true;
|
|
281
445
|
}
|
|
282
|
-
const ingest$
|
|
446
|
+
const ingest$7 = function CpqBaseListOutputRepresentationIngest(input, path, luvio, store, timestamp) {
|
|
283
447
|
if (process.env.NODE_ENV !== 'production') {
|
|
284
|
-
const validateError = validate$
|
|
448
|
+
const validateError = validate$o(input);
|
|
285
449
|
if (validateError !== null) {
|
|
286
450
|
throw validateError;
|
|
287
451
|
}
|
|
288
452
|
}
|
|
289
|
-
const key = keyBuilderFromType$
|
|
453
|
+
const key = keyBuilderFromType$6(luvio, input);
|
|
290
454
|
const existingRecord = store.readEntry(key);
|
|
291
|
-
const ttlToUse = TTL$
|
|
292
|
-
let incomingRecord = normalize$
|
|
455
|
+
const ttlToUse = TTL$6;
|
|
456
|
+
let incomingRecord = normalize$7(input, store.readEntry(key), {
|
|
293
457
|
fullPath: key,
|
|
294
458
|
parent: path.parent,
|
|
295
459
|
propertyName: path.propertyName,
|
|
296
460
|
ttl: ttlToUse
|
|
297
461
|
});
|
|
298
|
-
if (existingRecord === undefined || equals$
|
|
462
|
+
if (existingRecord === undefined || equals$e(existingRecord, incomingRecord) === false) {
|
|
299
463
|
luvio.storePublish(key, incomingRecord);
|
|
300
464
|
}
|
|
301
465
|
{
|
|
302
466
|
const storeMetadataParams = {
|
|
303
467
|
ttl: ttlToUse,
|
|
304
468
|
namespace: "cpq",
|
|
305
|
-
version: VERSION$
|
|
306
|
-
representationName: RepresentationType$
|
|
469
|
+
version: VERSION$e,
|
|
470
|
+
representationName: RepresentationType$7,
|
|
307
471
|
};
|
|
308
472
|
luvio.publishStoreMetadata(key, storeMetadataParams);
|
|
309
473
|
}
|
|
310
474
|
return createLink(key);
|
|
311
475
|
};
|
|
312
|
-
function getTypeCacheKeys$
|
|
476
|
+
function getTypeCacheKeys$7(luvio, input, fullPathFactory) {
|
|
313
477
|
const rootKeySet = new StoreKeyMap();
|
|
314
478
|
// root cache key (uses fullPathFactory if keyBuilderFromType isn't defined)
|
|
315
|
-
const rootKey = keyBuilderFromType$
|
|
479
|
+
const rootKey = keyBuilderFromType$6(luvio, input);
|
|
316
480
|
rootKeySet.set(rootKey, {
|
|
317
481
|
namespace: keyPrefix,
|
|
318
|
-
representationName: RepresentationType$
|
|
482
|
+
representationName: RepresentationType$7,
|
|
319
483
|
mergeable: false
|
|
320
484
|
});
|
|
321
485
|
return rootKeySet;
|
|
322
486
|
}
|
|
323
487
|
|
|
324
|
-
function select$
|
|
325
|
-
return select$
|
|
488
|
+
function select$n(luvio, params) {
|
|
489
|
+
return select$o();
|
|
326
490
|
}
|
|
327
|
-
function getResponseCacheKeys$
|
|
328
|
-
return getTypeCacheKeys$
|
|
491
|
+
function getResponseCacheKeys$9(luvio, resourceParams, response) {
|
|
492
|
+
return getTypeCacheKeys$7(luvio, response);
|
|
329
493
|
}
|
|
330
|
-
function ingestSuccess$
|
|
494
|
+
function ingestSuccess$9(luvio, resourceParams, response) {
|
|
331
495
|
const { body } = response;
|
|
332
|
-
const key = keyBuilderFromType$
|
|
333
|
-
luvio.storeIngest(key, ingest$
|
|
496
|
+
const key = keyBuilderFromType$6(luvio, body);
|
|
497
|
+
luvio.storeIngest(key, ingest$7, body);
|
|
334
498
|
const snapshot = luvio.storeLookup({
|
|
335
499
|
recordId: key,
|
|
336
|
-
node: select$
|
|
500
|
+
node: select$n(),
|
|
337
501
|
variables: {},
|
|
338
502
|
});
|
|
339
503
|
if (process.env.NODE_ENV !== 'production') {
|
|
@@ -344,7 +508,7 @@ function ingestSuccess$3(luvio, resourceParams, response) {
|
|
|
344
508
|
deepFreeze(snapshot.data);
|
|
345
509
|
return snapshot;
|
|
346
510
|
}
|
|
347
|
-
function createResourceRequest$
|
|
511
|
+
function createResourceRequest$9(config) {
|
|
348
512
|
const headers = {};
|
|
349
513
|
return {
|
|
350
514
|
baseUri: '/services/data/v59.0',
|
|
@@ -365,7 +529,7 @@ const preview_ConfigPropertyNames = {
|
|
|
365
529
|
optional: []
|
|
366
530
|
}
|
|
367
531
|
};
|
|
368
|
-
function createResourceParams$
|
|
532
|
+
function createResourceParams$9(config) {
|
|
369
533
|
const resourceParams = {
|
|
370
534
|
body: {
|
|
371
535
|
previewInput: config.previewInput
|
|
@@ -373,37 +537,37 @@ function createResourceParams$3(config) {
|
|
|
373
537
|
};
|
|
374
538
|
return resourceParams;
|
|
375
539
|
}
|
|
376
|
-
function typeCheckConfig$
|
|
540
|
+
function typeCheckConfig$9(untrustedConfig) {
|
|
377
541
|
const config = {};
|
|
378
542
|
const untrustedConfig_previewInput = untrustedConfig.previewInput;
|
|
379
|
-
const referencePreviewInputRepresentationValidationError = validate$
|
|
543
|
+
const referencePreviewInputRepresentationValidationError = validate$r(untrustedConfig_previewInput);
|
|
380
544
|
if (referencePreviewInputRepresentationValidationError === null) {
|
|
381
545
|
config.previewInput = untrustedConfig_previewInput;
|
|
382
546
|
}
|
|
383
547
|
return config;
|
|
384
548
|
}
|
|
385
|
-
function validateAdapterConfig$
|
|
549
|
+
function validateAdapterConfig$9(untrustedConfig, configPropertyNames) {
|
|
386
550
|
if (!untrustedIsObject(untrustedConfig)) {
|
|
387
551
|
return null;
|
|
388
552
|
}
|
|
389
553
|
if (process.env.NODE_ENV !== 'production') {
|
|
390
554
|
validateConfig(untrustedConfig, configPropertyNames);
|
|
391
555
|
}
|
|
392
|
-
const config = typeCheckConfig$
|
|
556
|
+
const config = typeCheckConfig$9(untrustedConfig);
|
|
393
557
|
if (!areRequiredParametersPresent(config, configPropertyNames)) {
|
|
394
558
|
return null;
|
|
395
559
|
}
|
|
396
560
|
return config;
|
|
397
561
|
}
|
|
398
|
-
function buildNetworkSnapshot$
|
|
399
|
-
const resourceParams = createResourceParams$
|
|
400
|
-
const request = createResourceRequest$
|
|
562
|
+
function buildNetworkSnapshot$9(luvio, config, options) {
|
|
563
|
+
const resourceParams = createResourceParams$9(config);
|
|
564
|
+
const request = createResourceRequest$9(resourceParams);
|
|
401
565
|
return luvio.dispatchResourceRequest(request, options)
|
|
402
566
|
.then((response) => {
|
|
403
567
|
return luvio.handleSuccessResponse(() => {
|
|
404
|
-
const snapshot = ingestSuccess$
|
|
568
|
+
const snapshot = ingestSuccess$9(luvio, resourceParams, response);
|
|
405
569
|
return luvio.storeBroadcast().then(() => snapshot);
|
|
406
|
-
}, () => getResponseCacheKeys$
|
|
570
|
+
}, () => getResponseCacheKeys$9(luvio, resourceParams, response.body));
|
|
407
571
|
}, (response) => {
|
|
408
572
|
deepFreeze(response);
|
|
409
573
|
throw response;
|
|
@@ -411,16 +575,16 @@ function buildNetworkSnapshot$3(luvio, config, options) {
|
|
|
411
575
|
}
|
|
412
576
|
const previewAdapterFactory = (luvio) => {
|
|
413
577
|
return function preview(untrustedConfig) {
|
|
414
|
-
const config = validateAdapterConfig$
|
|
578
|
+
const config = validateAdapterConfig$9(untrustedConfig, preview_ConfigPropertyNames);
|
|
415
579
|
// Invalid or incomplete config
|
|
416
580
|
if (config === null) {
|
|
417
581
|
throw new Error('Invalid config for "preview"');
|
|
418
582
|
}
|
|
419
|
-
return buildNetworkSnapshot$
|
|
583
|
+
return buildNetworkSnapshot$9(luvio, config);
|
|
420
584
|
};
|
|
421
585
|
};
|
|
422
586
|
|
|
423
|
-
function validate$
|
|
587
|
+
function validate$n(obj, path = 'ProductListInputRepresentation') {
|
|
424
588
|
const v_error = (() => {
|
|
425
589
|
if (typeof obj !== 'object' || ArrayIsArray(obj) || obj === null) {
|
|
426
590
|
return new TypeError('Expected "object" but received "' + typeof obj + '" (at "' + path + '")');
|
|
@@ -483,19 +647,19 @@ function validate$3(obj, path = 'ProductListInputRepresentation') {
|
|
|
483
647
|
return v_error === undefined ? null : v_error;
|
|
484
648
|
}
|
|
485
649
|
|
|
486
|
-
function select$
|
|
487
|
-
return select$
|
|
650
|
+
function select$m(luvio, params) {
|
|
651
|
+
return select$o();
|
|
488
652
|
}
|
|
489
|
-
function getResponseCacheKeys$
|
|
490
|
-
return getTypeCacheKeys$
|
|
653
|
+
function getResponseCacheKeys$8(luvio, resourceParams, response) {
|
|
654
|
+
return getTypeCacheKeys$7(luvio, response);
|
|
491
655
|
}
|
|
492
|
-
function ingestSuccess$
|
|
656
|
+
function ingestSuccess$8(luvio, resourceParams, response) {
|
|
493
657
|
const { body } = response;
|
|
494
|
-
const key = keyBuilderFromType$
|
|
495
|
-
luvio.storeIngest(key, ingest$
|
|
658
|
+
const key = keyBuilderFromType$6(luvio, body);
|
|
659
|
+
luvio.storeIngest(key, ingest$7, body);
|
|
496
660
|
const snapshot = luvio.storeLookup({
|
|
497
661
|
recordId: key,
|
|
498
|
-
node: select$
|
|
662
|
+
node: select$m(),
|
|
499
663
|
variables: {},
|
|
500
664
|
});
|
|
501
665
|
if (process.env.NODE_ENV !== 'production') {
|
|
@@ -506,7 +670,7 @@ function ingestSuccess$2(luvio, resourceParams, response) {
|
|
|
506
670
|
deepFreeze(snapshot.data);
|
|
507
671
|
return snapshot;
|
|
508
672
|
}
|
|
509
|
-
function createResourceRequest$
|
|
673
|
+
function createResourceRequest$8(config) {
|
|
510
674
|
const headers = {};
|
|
511
675
|
return {
|
|
512
676
|
baseUri: '/services/data/v59.0',
|
|
@@ -527,7 +691,7 @@ const productList_ConfigPropertyNames = {
|
|
|
527
691
|
optional: []
|
|
528
692
|
}
|
|
529
693
|
};
|
|
530
|
-
function createResourceParams$
|
|
694
|
+
function createResourceParams$8(config) {
|
|
531
695
|
const resourceParams = {
|
|
532
696
|
body: {
|
|
533
697
|
requestBody: config.requestBody
|
|
@@ -535,37 +699,37 @@ function createResourceParams$2(config) {
|
|
|
535
699
|
};
|
|
536
700
|
return resourceParams;
|
|
537
701
|
}
|
|
538
|
-
function typeCheckConfig$
|
|
702
|
+
function typeCheckConfig$8(untrustedConfig) {
|
|
539
703
|
const config = {};
|
|
540
704
|
const untrustedConfig_requestBody = untrustedConfig.requestBody;
|
|
541
|
-
const referenceProductListInputRepresentationValidationError = validate$
|
|
705
|
+
const referenceProductListInputRepresentationValidationError = validate$n(untrustedConfig_requestBody);
|
|
542
706
|
if (referenceProductListInputRepresentationValidationError === null) {
|
|
543
707
|
config.requestBody = untrustedConfig_requestBody;
|
|
544
708
|
}
|
|
545
709
|
return config;
|
|
546
710
|
}
|
|
547
|
-
function validateAdapterConfig$
|
|
711
|
+
function validateAdapterConfig$8(untrustedConfig, configPropertyNames) {
|
|
548
712
|
if (!untrustedIsObject(untrustedConfig)) {
|
|
549
713
|
return null;
|
|
550
714
|
}
|
|
551
715
|
if (process.env.NODE_ENV !== 'production') {
|
|
552
716
|
validateConfig(untrustedConfig, configPropertyNames);
|
|
553
717
|
}
|
|
554
|
-
const config = typeCheckConfig$
|
|
718
|
+
const config = typeCheckConfig$8(untrustedConfig);
|
|
555
719
|
if (!areRequiredParametersPresent(config, configPropertyNames)) {
|
|
556
720
|
return null;
|
|
557
721
|
}
|
|
558
722
|
return config;
|
|
559
723
|
}
|
|
560
|
-
function buildNetworkSnapshot$
|
|
561
|
-
const resourceParams = createResourceParams$
|
|
562
|
-
const request = createResourceRequest$
|
|
724
|
+
function buildNetworkSnapshot$8(luvio, config, options) {
|
|
725
|
+
const resourceParams = createResourceParams$8(config);
|
|
726
|
+
const request = createResourceRequest$8(resourceParams);
|
|
563
727
|
return luvio.dispatchResourceRequest(request, options)
|
|
564
728
|
.then((response) => {
|
|
565
729
|
return luvio.handleSuccessResponse(() => {
|
|
566
|
-
const snapshot = ingestSuccess$
|
|
730
|
+
const snapshot = ingestSuccess$8(luvio, resourceParams, response);
|
|
567
731
|
return luvio.storeBroadcast().then(() => snapshot);
|
|
568
|
-
}, () => getResponseCacheKeys$
|
|
732
|
+
}, () => getResponseCacheKeys$8(luvio, resourceParams, response.body));
|
|
569
733
|
}, (response) => {
|
|
570
734
|
deepFreeze(response);
|
|
571
735
|
throw response;
|
|
@@ -573,16 +737,16 @@ function buildNetworkSnapshot$2(luvio, config, options) {
|
|
|
573
737
|
}
|
|
574
738
|
const productListAdapterFactory = (luvio) => {
|
|
575
739
|
return function productList(untrustedConfig) {
|
|
576
|
-
const config = validateAdapterConfig$
|
|
740
|
+
const config = validateAdapterConfig$8(untrustedConfig, productList_ConfigPropertyNames);
|
|
577
741
|
// Invalid or incomplete config
|
|
578
742
|
if (config === null) {
|
|
579
743
|
throw new Error('Invalid config for "productList"');
|
|
580
744
|
}
|
|
581
|
-
return buildNetworkSnapshot$
|
|
745
|
+
return buildNetworkSnapshot$8(luvio, config);
|
|
582
746
|
};
|
|
583
747
|
};
|
|
584
748
|
|
|
585
|
-
function validate$
|
|
749
|
+
function validate$m(obj, path = 'SearchOffersInputRepresentation') {
|
|
586
750
|
const v_error = (() => {
|
|
587
751
|
if (typeof obj !== 'object' || ArrayIsArray(obj) || obj === null) {
|
|
588
752
|
return new TypeError('Expected "object" but received "' + typeof obj + '" (at "' + path + '")');
|
|
@@ -668,19 +832,19 @@ function validate$2(obj, path = 'SearchOffersInputRepresentation') {
|
|
|
668
832
|
return v_error === undefined ? null : v_error;
|
|
669
833
|
}
|
|
670
834
|
|
|
671
|
-
function select$
|
|
672
|
-
return select$
|
|
835
|
+
function select$l(luvio, params) {
|
|
836
|
+
return select$o();
|
|
673
837
|
}
|
|
674
|
-
function getResponseCacheKeys$
|
|
675
|
-
return getTypeCacheKeys$
|
|
838
|
+
function getResponseCacheKeys$7(luvio, resourceParams, response) {
|
|
839
|
+
return getTypeCacheKeys$7(luvio, response);
|
|
676
840
|
}
|
|
677
|
-
function ingestSuccess$
|
|
841
|
+
function ingestSuccess$7(luvio, resourceParams, response) {
|
|
678
842
|
const { body } = response;
|
|
679
|
-
const key = keyBuilderFromType$
|
|
680
|
-
luvio.storeIngest(key, ingest$
|
|
843
|
+
const key = keyBuilderFromType$6(luvio, body);
|
|
844
|
+
luvio.storeIngest(key, ingest$7, body);
|
|
681
845
|
const snapshot = luvio.storeLookup({
|
|
682
846
|
recordId: key,
|
|
683
|
-
node: select$
|
|
847
|
+
node: select$l(),
|
|
684
848
|
variables: {},
|
|
685
849
|
});
|
|
686
850
|
if (process.env.NODE_ENV !== 'production') {
|
|
@@ -691,7 +855,7 @@ function ingestSuccess$1(luvio, resourceParams, response) {
|
|
|
691
855
|
deepFreeze(snapshot.data);
|
|
692
856
|
return snapshot;
|
|
693
857
|
}
|
|
694
|
-
function createResourceRequest$
|
|
858
|
+
function createResourceRequest$7(config) {
|
|
695
859
|
const headers = {};
|
|
696
860
|
return {
|
|
697
861
|
baseUri: '/services/data/v59.0',
|
|
@@ -712,7 +876,7 @@ const SearchProductsList_ConfigPropertyNames = {
|
|
|
712
876
|
optional: []
|
|
713
877
|
}
|
|
714
878
|
};
|
|
715
|
-
function createResourceParams$
|
|
879
|
+
function createResourceParams$7(config) {
|
|
716
880
|
const resourceParams = {
|
|
717
881
|
body: {
|
|
718
882
|
SearchOffersInput: config.SearchOffersInput
|
|
@@ -720,37 +884,37 @@ function createResourceParams$1(config) {
|
|
|
720
884
|
};
|
|
721
885
|
return resourceParams;
|
|
722
886
|
}
|
|
723
|
-
function typeCheckConfig$
|
|
887
|
+
function typeCheckConfig$7(untrustedConfig) {
|
|
724
888
|
const config = {};
|
|
725
889
|
const untrustedConfig_SearchOffersInput = untrustedConfig.SearchOffersInput;
|
|
726
|
-
const referenceSearchOffersInputRepresentationValidationError = validate$
|
|
890
|
+
const referenceSearchOffersInputRepresentationValidationError = validate$m(untrustedConfig_SearchOffersInput);
|
|
727
891
|
if (referenceSearchOffersInputRepresentationValidationError === null) {
|
|
728
892
|
config.SearchOffersInput = untrustedConfig_SearchOffersInput;
|
|
729
893
|
}
|
|
730
894
|
return config;
|
|
731
895
|
}
|
|
732
|
-
function validateAdapterConfig$
|
|
896
|
+
function validateAdapterConfig$7(untrustedConfig, configPropertyNames) {
|
|
733
897
|
if (!untrustedIsObject(untrustedConfig)) {
|
|
734
898
|
return null;
|
|
735
899
|
}
|
|
736
900
|
if (process.env.NODE_ENV !== 'production') {
|
|
737
901
|
validateConfig(untrustedConfig, configPropertyNames);
|
|
738
902
|
}
|
|
739
|
-
const config = typeCheckConfig$
|
|
903
|
+
const config = typeCheckConfig$7(untrustedConfig);
|
|
740
904
|
if (!areRequiredParametersPresent(config, configPropertyNames)) {
|
|
741
905
|
return null;
|
|
742
906
|
}
|
|
743
907
|
return config;
|
|
744
908
|
}
|
|
745
|
-
function buildNetworkSnapshot$
|
|
746
|
-
const resourceParams = createResourceParams$
|
|
747
|
-
const request = createResourceRequest$
|
|
909
|
+
function buildNetworkSnapshot$7(luvio, config, options) {
|
|
910
|
+
const resourceParams = createResourceParams$7(config);
|
|
911
|
+
const request = createResourceRequest$7(resourceParams);
|
|
748
912
|
return luvio.dispatchResourceRequest(request, options)
|
|
749
913
|
.then((response) => {
|
|
750
914
|
return luvio.handleSuccessResponse(() => {
|
|
751
|
-
const snapshot = ingestSuccess$
|
|
915
|
+
const snapshot = ingestSuccess$7(luvio, resourceParams, response);
|
|
752
916
|
return luvio.storeBroadcast().then(() => snapshot);
|
|
753
|
-
}, () => getResponseCacheKeys$
|
|
917
|
+
}, () => getResponseCacheKeys$7(luvio, resourceParams, response.body));
|
|
754
918
|
}, (response) => {
|
|
755
919
|
deepFreeze(response);
|
|
756
920
|
throw response;
|
|
@@ -758,16 +922,16 @@ function buildNetworkSnapshot$1(luvio, config, options) {
|
|
|
758
922
|
}
|
|
759
923
|
const SearchProductsListAdapterFactory = (luvio) => {
|
|
760
924
|
return function SearchProductsList(untrustedConfig) {
|
|
761
|
-
const config = validateAdapterConfig$
|
|
925
|
+
const config = validateAdapterConfig$7(untrustedConfig, SearchProductsList_ConfigPropertyNames);
|
|
762
926
|
// Invalid or incomplete config
|
|
763
927
|
if (config === null) {
|
|
764
928
|
throw new Error('Invalid config for "SearchProductsList"');
|
|
765
929
|
}
|
|
766
|
-
return buildNetworkSnapshot$
|
|
930
|
+
return buildNetworkSnapshot$7(luvio, config);
|
|
767
931
|
};
|
|
768
932
|
};
|
|
769
933
|
|
|
770
|
-
function validate$
|
|
934
|
+
function validate$l(obj, path = 'ProductDetailsInputRepresentation') {
|
|
771
935
|
const v_error = (() => {
|
|
772
936
|
if (typeof obj !== 'object' || ArrayIsArray(obj) || obj === null) {
|
|
773
937
|
return new TypeError('Expected "object" but received "' + typeof obj + '" (at "' + path + '")');
|
|
@@ -809,16 +973,16 @@ function validate$1(obj, path = 'ProductDetailsInputRepresentation') {
|
|
|
809
973
|
return v_error === undefined ? null : v_error;
|
|
810
974
|
}
|
|
811
975
|
|
|
812
|
-
const TTL = 1000;
|
|
813
|
-
const VERSION = "3cf40c7bb274825983f189e73ad0baa4";
|
|
814
|
-
function validate(obj, path = 'CpqBaseDetailsOutputRepresentation') {
|
|
976
|
+
const TTL$5 = 1000;
|
|
977
|
+
const VERSION$d = "3cf40c7bb274825983f189e73ad0baa4";
|
|
978
|
+
function validate$k(obj, path = 'CpqBaseDetailsOutputRepresentation') {
|
|
815
979
|
const v_error = (() => {
|
|
816
980
|
if (typeof obj !== 'object' || ArrayIsArray(obj) || obj === null) {
|
|
817
981
|
return new TypeError('Expected "object" but received "' + typeof obj + '" (at "' + path + '")');
|
|
818
982
|
}
|
|
819
983
|
const obj_apiStatus = obj.apiStatus;
|
|
820
984
|
const path_apiStatus = path + '.apiStatus';
|
|
821
|
-
const referencepath_apiStatusValidationError = validate$
|
|
985
|
+
const referencepath_apiStatusValidationError = validate$p(obj_apiStatus, path_apiStatus);
|
|
822
986
|
if (referencepath_apiStatusValidationError !== null) {
|
|
823
987
|
let message = 'Object doesn\'t match ApiStatusOutputRepresentation (at "' + path_apiStatus + '")\n';
|
|
824
988
|
message += referencepath_apiStatusValidationError.message.split('\n').map((line) => '\t' + line).join('\n');
|
|
@@ -832,88 +996,88 @@ function validate(obj, path = 'CpqBaseDetailsOutputRepresentation') {
|
|
|
832
996
|
})();
|
|
833
997
|
return v_error === undefined ? null : v_error;
|
|
834
998
|
}
|
|
835
|
-
const RepresentationType = 'CpqBaseDetailsOutputRepresentation';
|
|
836
|
-
function keyBuilder(luvio, config) {
|
|
837
|
-
return keyPrefix + '::' + RepresentationType + ':' + config.message;
|
|
999
|
+
const RepresentationType$6 = 'CpqBaseDetailsOutputRepresentation';
|
|
1000
|
+
function keyBuilder$7(luvio, config) {
|
|
1001
|
+
return keyPrefix + '::' + RepresentationType$6 + ':' + config.message;
|
|
838
1002
|
}
|
|
839
|
-
function keyBuilderFromType(luvio, object) {
|
|
1003
|
+
function keyBuilderFromType$5(luvio, object) {
|
|
840
1004
|
const keyParams = {
|
|
841
1005
|
message: object.apiStatus.statusCode
|
|
842
1006
|
};
|
|
843
|
-
return keyBuilder(luvio, keyParams);
|
|
1007
|
+
return keyBuilder$7(luvio, keyParams);
|
|
844
1008
|
}
|
|
845
|
-
function normalize(input, existing, path, luvio, store, timestamp) {
|
|
1009
|
+
function normalize$6(input, existing, path, luvio, store, timestamp) {
|
|
846
1010
|
return input;
|
|
847
1011
|
}
|
|
848
|
-
const select$
|
|
1012
|
+
const select$k = function CpqBaseDetailsOutputRepresentationSelect() {
|
|
849
1013
|
return {
|
|
850
1014
|
kind: 'Fragment',
|
|
851
|
-
version: VERSION,
|
|
1015
|
+
version: VERSION$d,
|
|
852
1016
|
private: [],
|
|
853
1017
|
opaque: true
|
|
854
1018
|
};
|
|
855
1019
|
};
|
|
856
|
-
function equals(existing, incoming) {
|
|
1020
|
+
function equals$d(existing, incoming) {
|
|
857
1021
|
if (JSONStringify(incoming) !== JSONStringify(existing)) {
|
|
858
1022
|
return false;
|
|
859
1023
|
}
|
|
860
1024
|
return true;
|
|
861
1025
|
}
|
|
862
|
-
const ingest = function CpqBaseDetailsOutputRepresentationIngest(input, path, luvio, store, timestamp) {
|
|
1026
|
+
const ingest$6 = function CpqBaseDetailsOutputRepresentationIngest(input, path, luvio, store, timestamp) {
|
|
863
1027
|
if (process.env.NODE_ENV !== 'production') {
|
|
864
|
-
const validateError = validate(input);
|
|
1028
|
+
const validateError = validate$k(input);
|
|
865
1029
|
if (validateError !== null) {
|
|
866
1030
|
throw validateError;
|
|
867
1031
|
}
|
|
868
1032
|
}
|
|
869
|
-
const key = keyBuilderFromType(luvio, input);
|
|
1033
|
+
const key = keyBuilderFromType$5(luvio, input);
|
|
870
1034
|
const existingRecord = store.readEntry(key);
|
|
871
|
-
const ttlToUse = TTL;
|
|
872
|
-
let incomingRecord = normalize(input, store.readEntry(key), {
|
|
1035
|
+
const ttlToUse = TTL$5;
|
|
1036
|
+
let incomingRecord = normalize$6(input, store.readEntry(key), {
|
|
873
1037
|
fullPath: key,
|
|
874
1038
|
parent: path.parent,
|
|
875
1039
|
propertyName: path.propertyName,
|
|
876
1040
|
ttl: ttlToUse
|
|
877
1041
|
});
|
|
878
|
-
if (existingRecord === undefined || equals(existingRecord, incomingRecord) === false) {
|
|
1042
|
+
if (existingRecord === undefined || equals$d(existingRecord, incomingRecord) === false) {
|
|
879
1043
|
luvio.storePublish(key, incomingRecord);
|
|
880
1044
|
}
|
|
881
1045
|
{
|
|
882
1046
|
const storeMetadataParams = {
|
|
883
1047
|
ttl: ttlToUse,
|
|
884
1048
|
namespace: "cpq",
|
|
885
|
-
version: VERSION,
|
|
886
|
-
representationName: RepresentationType,
|
|
1049
|
+
version: VERSION$d,
|
|
1050
|
+
representationName: RepresentationType$6,
|
|
887
1051
|
};
|
|
888
1052
|
luvio.publishStoreMetadata(key, storeMetadataParams);
|
|
889
1053
|
}
|
|
890
1054
|
return createLink(key);
|
|
891
1055
|
};
|
|
892
|
-
function getTypeCacheKeys(luvio, input, fullPathFactory) {
|
|
1056
|
+
function getTypeCacheKeys$6(luvio, input, fullPathFactory) {
|
|
893
1057
|
const rootKeySet = new StoreKeyMap();
|
|
894
1058
|
// root cache key (uses fullPathFactory if keyBuilderFromType isn't defined)
|
|
895
|
-
const rootKey = keyBuilderFromType(luvio, input);
|
|
1059
|
+
const rootKey = keyBuilderFromType$5(luvio, input);
|
|
896
1060
|
rootKeySet.set(rootKey, {
|
|
897
1061
|
namespace: keyPrefix,
|
|
898
|
-
representationName: RepresentationType,
|
|
1062
|
+
representationName: RepresentationType$6,
|
|
899
1063
|
mergeable: false
|
|
900
1064
|
});
|
|
901
1065
|
return rootKeySet;
|
|
902
1066
|
}
|
|
903
1067
|
|
|
904
|
-
function select(luvio, params) {
|
|
905
|
-
return select$
|
|
1068
|
+
function select$j(luvio, params) {
|
|
1069
|
+
return select$k();
|
|
906
1070
|
}
|
|
907
|
-
function getResponseCacheKeys(luvio, resourceParams, response) {
|
|
908
|
-
return getTypeCacheKeys(luvio, response);
|
|
1071
|
+
function getResponseCacheKeys$6(luvio, resourceParams, response) {
|
|
1072
|
+
return getTypeCacheKeys$6(luvio, response);
|
|
909
1073
|
}
|
|
910
|
-
function ingestSuccess(luvio, resourceParams, response) {
|
|
1074
|
+
function ingestSuccess$6(luvio, resourceParams, response) {
|
|
911
1075
|
const { body } = response;
|
|
912
|
-
const key = keyBuilderFromType(luvio, body);
|
|
913
|
-
luvio.storeIngest(key, ingest, body);
|
|
1076
|
+
const key = keyBuilderFromType$5(luvio, body);
|
|
1077
|
+
luvio.storeIngest(key, ingest$6, body);
|
|
914
1078
|
const snapshot = luvio.storeLookup({
|
|
915
1079
|
recordId: key,
|
|
916
|
-
node: select(),
|
|
1080
|
+
node: select$j(),
|
|
917
1081
|
variables: {},
|
|
918
1082
|
});
|
|
919
1083
|
if (process.env.NODE_ENV !== 'production') {
|
|
@@ -924,7 +1088,7 @@ function ingestSuccess(luvio, resourceParams, response) {
|
|
|
924
1088
|
deepFreeze(snapshot.data);
|
|
925
1089
|
return snapshot;
|
|
926
1090
|
}
|
|
927
|
-
function createResourceRequest(config) {
|
|
1091
|
+
function createResourceRequest$6(config) {
|
|
928
1092
|
const headers = {};
|
|
929
1093
|
return {
|
|
930
1094
|
baseUri: '/services/data/v59.0',
|
|
@@ -945,7 +1109,7 @@ const productDetails_ConfigPropertyNames = {
|
|
|
945
1109
|
optional: []
|
|
946
1110
|
}
|
|
947
1111
|
};
|
|
948
|
-
function createResourceParams(config) {
|
|
1112
|
+
function createResourceParams$6(config) {
|
|
949
1113
|
const resourceParams = {
|
|
950
1114
|
urlParams: {
|
|
951
1115
|
productId: config.productId
|
|
@@ -956,41 +1120,41 @@ function createResourceParams(config) {
|
|
|
956
1120
|
};
|
|
957
1121
|
return resourceParams;
|
|
958
1122
|
}
|
|
959
|
-
function typeCheckConfig(untrustedConfig) {
|
|
1123
|
+
function typeCheckConfig$6(untrustedConfig) {
|
|
960
1124
|
const config = {};
|
|
961
1125
|
const untrustedConfig_productId = untrustedConfig.productId;
|
|
962
1126
|
if (typeof untrustedConfig_productId === 'string') {
|
|
963
1127
|
config.productId = untrustedConfig_productId;
|
|
964
1128
|
}
|
|
965
1129
|
const untrustedConfig_requestBody = untrustedConfig.requestBody;
|
|
966
|
-
const referenceProductDetailsInputRepresentationValidationError = validate$
|
|
1130
|
+
const referenceProductDetailsInputRepresentationValidationError = validate$l(untrustedConfig_requestBody);
|
|
967
1131
|
if (referenceProductDetailsInputRepresentationValidationError === null) {
|
|
968
1132
|
config.requestBody = untrustedConfig_requestBody;
|
|
969
1133
|
}
|
|
970
1134
|
return config;
|
|
971
1135
|
}
|
|
972
|
-
function validateAdapterConfig(untrustedConfig, configPropertyNames) {
|
|
1136
|
+
function validateAdapterConfig$6(untrustedConfig, configPropertyNames) {
|
|
973
1137
|
if (!untrustedIsObject(untrustedConfig)) {
|
|
974
1138
|
return null;
|
|
975
1139
|
}
|
|
976
1140
|
if (process.env.NODE_ENV !== 'production') {
|
|
977
1141
|
validateConfig(untrustedConfig, configPropertyNames);
|
|
978
1142
|
}
|
|
979
|
-
const config = typeCheckConfig(untrustedConfig);
|
|
1143
|
+
const config = typeCheckConfig$6(untrustedConfig);
|
|
980
1144
|
if (!areRequiredParametersPresent(config, configPropertyNames)) {
|
|
981
1145
|
return null;
|
|
982
1146
|
}
|
|
983
1147
|
return config;
|
|
984
1148
|
}
|
|
985
|
-
function buildNetworkSnapshot(luvio, config, options) {
|
|
986
|
-
const resourceParams = createResourceParams(config);
|
|
987
|
-
const request = createResourceRequest(resourceParams);
|
|
1149
|
+
function buildNetworkSnapshot$6(luvio, config, options) {
|
|
1150
|
+
const resourceParams = createResourceParams$6(config);
|
|
1151
|
+
const request = createResourceRequest$6(resourceParams);
|
|
988
1152
|
return luvio.dispatchResourceRequest(request, options)
|
|
989
1153
|
.then((response) => {
|
|
990
1154
|
return luvio.handleSuccessResponse(() => {
|
|
991
|
-
const snapshot = ingestSuccess(luvio, resourceParams, response);
|
|
1155
|
+
const snapshot = ingestSuccess$6(luvio, resourceParams, response);
|
|
992
1156
|
return luvio.storeBroadcast().then(() => snapshot);
|
|
993
|
-
}, () => getResponseCacheKeys(luvio, resourceParams, response.body));
|
|
1157
|
+
}, () => getResponseCacheKeys$6(luvio, resourceParams, response.body));
|
|
994
1158
|
}, (response) => {
|
|
995
1159
|
deepFreeze(response);
|
|
996
1160
|
throw response;
|
|
@@ -998,13 +1162,3421 @@ function buildNetworkSnapshot(luvio, config, options) {
|
|
|
998
1162
|
}
|
|
999
1163
|
const productDetailsAdapterFactory = (luvio) => {
|
|
1000
1164
|
return function productDetails(untrustedConfig) {
|
|
1001
|
-
const config = validateAdapterConfig(untrustedConfig, productDetails_ConfigPropertyNames);
|
|
1165
|
+
const config = validateAdapterConfig$6(untrustedConfig, productDetails_ConfigPropertyNames);
|
|
1002
1166
|
// Invalid or incomplete config
|
|
1003
1167
|
if (config === null) {
|
|
1004
1168
|
throw new Error('Invalid config for "productDetails"');
|
|
1005
1169
|
}
|
|
1170
|
+
return buildNetworkSnapshot$6(luvio, config);
|
|
1171
|
+
};
|
|
1172
|
+
};
|
|
1173
|
+
|
|
1174
|
+
function validate$j(obj, path = 'CreateCartInputRepresentation') {
|
|
1175
|
+
const v_error = (() => {
|
|
1176
|
+
if (typeof obj !== 'object' || ArrayIsArray(obj) || obj === null) {
|
|
1177
|
+
return new TypeError('Expected "object" but received "' + typeof obj + '" (at "' + path + '")');
|
|
1178
|
+
}
|
|
1179
|
+
if (obj.correlationId !== undefined) {
|
|
1180
|
+
const obj_correlationId = obj.correlationId;
|
|
1181
|
+
const path_correlationId = path + '.correlationId';
|
|
1182
|
+
if (typeof obj_correlationId !== 'string') {
|
|
1183
|
+
return new TypeError('Expected "string" but received "' + typeof obj_correlationId + '" (at "' + path_correlationId + '")');
|
|
1184
|
+
}
|
|
1185
|
+
}
|
|
1186
|
+
if (obj.customFields !== undefined) {
|
|
1187
|
+
const obj_customFields = obj.customFields;
|
|
1188
|
+
const path_customFields = path + '.customFields';
|
|
1189
|
+
if (typeof obj_customFields !== 'object' || ArrayIsArray(obj_customFields) || obj_customFields === null) {
|
|
1190
|
+
return new TypeError('Expected "object" but received "' + typeof obj_customFields + '" (at "' + path_customFields + '")');
|
|
1191
|
+
}
|
|
1192
|
+
const obj_customFields_keys = ObjectKeys(obj_customFields);
|
|
1193
|
+
for (let i = 0; i < obj_customFields_keys.length; i++) {
|
|
1194
|
+
const key = obj_customFields_keys[i];
|
|
1195
|
+
const obj_customFields_prop = obj_customFields[key];
|
|
1196
|
+
const path_customFields_prop = path_customFields + '["' + key + '"]';
|
|
1197
|
+
if (typeof obj_customFields_prop !== 'string') {
|
|
1198
|
+
return new TypeError('Expected "string" but received "' + typeof obj_customFields_prop + '" (at "' + path_customFields_prop + '")');
|
|
1199
|
+
}
|
|
1200
|
+
}
|
|
1201
|
+
}
|
|
1202
|
+
if (obj.productConfigurations !== undefined) {
|
|
1203
|
+
const obj_productConfigurations = obj.productConfigurations;
|
|
1204
|
+
const path_productConfigurations = path + '.productConfigurations';
|
|
1205
|
+
if (!ArrayIsArray(obj_productConfigurations)) {
|
|
1206
|
+
return new TypeError('Expected "array" but received "' + typeof obj_productConfigurations + '" (at "' + path_productConfigurations + '")');
|
|
1207
|
+
}
|
|
1208
|
+
for (let i = 0; i < obj_productConfigurations.length; i++) {
|
|
1209
|
+
const obj_productConfigurations_item = obj_productConfigurations[i];
|
|
1210
|
+
const path_productConfigurations_item = path_productConfigurations + '[' + i + ']';
|
|
1211
|
+
if (typeof obj_productConfigurations_item !== 'object' || ArrayIsArray(obj_productConfigurations_item) || obj_productConfigurations_item === null) {
|
|
1212
|
+
return new TypeError('Expected "object" but received "' + typeof obj_productConfigurations_item + '" (at "' + path_productConfigurations_item + '")');
|
|
1213
|
+
}
|
|
1214
|
+
}
|
|
1215
|
+
}
|
|
1216
|
+
if (obj.toBeUpdatedFields !== undefined) {
|
|
1217
|
+
const obj_toBeUpdatedFields = obj.toBeUpdatedFields;
|
|
1218
|
+
const path_toBeUpdatedFields = path + '.toBeUpdatedFields';
|
|
1219
|
+
if (typeof obj_toBeUpdatedFields !== 'object' || ArrayIsArray(obj_toBeUpdatedFields) || obj_toBeUpdatedFields === null) {
|
|
1220
|
+
return new TypeError('Expected "object" but received "' + typeof obj_toBeUpdatedFields + '" (at "' + path_toBeUpdatedFields + '")');
|
|
1221
|
+
}
|
|
1222
|
+
const obj_toBeUpdatedFields_keys = ObjectKeys(obj_toBeUpdatedFields);
|
|
1223
|
+
for (let i = 0; i < obj_toBeUpdatedFields_keys.length; i++) {
|
|
1224
|
+
const key = obj_toBeUpdatedFields_keys[i];
|
|
1225
|
+
const obj_toBeUpdatedFields_prop = obj_toBeUpdatedFields[key];
|
|
1226
|
+
const path_toBeUpdatedFields_prop = path_toBeUpdatedFields + '["' + key + '"]';
|
|
1227
|
+
if (typeof obj_toBeUpdatedFields_prop !== 'object' || ArrayIsArray(obj_toBeUpdatedFields_prop) || obj_toBeUpdatedFields_prop === null) {
|
|
1228
|
+
return new TypeError('Expected "object" but received "' + typeof obj_toBeUpdatedFields_prop + '" (at "' + path_toBeUpdatedFields_prop + '")');
|
|
1229
|
+
}
|
|
1230
|
+
}
|
|
1231
|
+
}
|
|
1232
|
+
if (obj.userContext !== undefined) {
|
|
1233
|
+
const obj_userContext = obj.userContext;
|
|
1234
|
+
const path_userContext = path + '.userContext';
|
|
1235
|
+
if (typeof obj_userContext !== 'object' || ArrayIsArray(obj_userContext) || obj_userContext === null) {
|
|
1236
|
+
return new TypeError('Expected "object" but received "' + typeof obj_userContext + '" (at "' + path_userContext + '")');
|
|
1237
|
+
}
|
|
1238
|
+
}
|
|
1239
|
+
})();
|
|
1240
|
+
return v_error === undefined ? null : v_error;
|
|
1241
|
+
}
|
|
1242
|
+
|
|
1243
|
+
const TTL$4 = 1000;
|
|
1244
|
+
const VERSION$c = "1f730145ab6b9f6b4d070b5eade57b4c";
|
|
1245
|
+
function validate$i(obj, path = 'CreateCartOutputRepresentation') {
|
|
1246
|
+
const v_error = (() => {
|
|
1247
|
+
if (typeof obj !== 'object' || ArrayIsArray(obj) || obj === null) {
|
|
1248
|
+
return new TypeError('Expected "object" but received "' + typeof obj + '" (at "' + path + '")');
|
|
1249
|
+
}
|
|
1250
|
+
const obj_apiStatus = obj.apiStatus;
|
|
1251
|
+
const path_apiStatus = path + '.apiStatus';
|
|
1252
|
+
const referencepath_apiStatusValidationError = validate$p(obj_apiStatus, path_apiStatus);
|
|
1253
|
+
if (referencepath_apiStatusValidationError !== null) {
|
|
1254
|
+
let message = 'Object doesn\'t match ApiStatusOutputRepresentation (at "' + path_apiStatus + '")\n';
|
|
1255
|
+
message += referencepath_apiStatusValidationError.message.split('\n').map((line) => '\t' + line).join('\n');
|
|
1256
|
+
return new TypeError(message);
|
|
1257
|
+
}
|
|
1258
|
+
if (obj.cartId !== undefined) {
|
|
1259
|
+
const obj_cartId = obj.cartId;
|
|
1260
|
+
const path_cartId = path + '.cartId';
|
|
1261
|
+
if (typeof obj_cartId !== 'string') {
|
|
1262
|
+
return new TypeError('Expected "string" but received "' + typeof obj_cartId + '" (at "' + path_cartId + '")');
|
|
1263
|
+
}
|
|
1264
|
+
}
|
|
1265
|
+
})();
|
|
1266
|
+
return v_error === undefined ? null : v_error;
|
|
1267
|
+
}
|
|
1268
|
+
const RepresentationType$5 = 'CreateCartOutputRepresentation';
|
|
1269
|
+
function keyBuilder$6(luvio, config) {
|
|
1270
|
+
return keyPrefix + '::' + RepresentationType$5 + ':' + config.message;
|
|
1271
|
+
}
|
|
1272
|
+
function keyBuilderFromType$4(luvio, object) {
|
|
1273
|
+
const keyParams = {
|
|
1274
|
+
message: object.apiStatus.statusCode
|
|
1275
|
+
};
|
|
1276
|
+
return keyBuilder$6(luvio, keyParams);
|
|
1277
|
+
}
|
|
1278
|
+
function normalize$5(input, existing, path, luvio, store, timestamp) {
|
|
1279
|
+
return input;
|
|
1280
|
+
}
|
|
1281
|
+
const select$i = function CreateCartOutputRepresentationSelect() {
|
|
1282
|
+
return {
|
|
1283
|
+
kind: 'Fragment',
|
|
1284
|
+
version: VERSION$c,
|
|
1285
|
+
private: [],
|
|
1286
|
+
opaque: true
|
|
1287
|
+
};
|
|
1288
|
+
};
|
|
1289
|
+
function equals$c(existing, incoming) {
|
|
1290
|
+
if (JSONStringify(incoming) !== JSONStringify(existing)) {
|
|
1291
|
+
return false;
|
|
1292
|
+
}
|
|
1293
|
+
return true;
|
|
1294
|
+
}
|
|
1295
|
+
const ingest$5 = function CreateCartOutputRepresentationIngest(input, path, luvio, store, timestamp) {
|
|
1296
|
+
if (process.env.NODE_ENV !== 'production') {
|
|
1297
|
+
const validateError = validate$i(input);
|
|
1298
|
+
if (validateError !== null) {
|
|
1299
|
+
throw validateError;
|
|
1300
|
+
}
|
|
1301
|
+
}
|
|
1302
|
+
const key = keyBuilderFromType$4(luvio, input);
|
|
1303
|
+
const existingRecord = store.readEntry(key);
|
|
1304
|
+
const ttlToUse = TTL$4;
|
|
1305
|
+
let incomingRecord = normalize$5(input, store.readEntry(key), {
|
|
1306
|
+
fullPath: key,
|
|
1307
|
+
parent: path.parent,
|
|
1308
|
+
propertyName: path.propertyName,
|
|
1309
|
+
ttl: ttlToUse
|
|
1310
|
+
});
|
|
1311
|
+
if (existingRecord === undefined || equals$c(existingRecord, incomingRecord) === false) {
|
|
1312
|
+
luvio.storePublish(key, incomingRecord);
|
|
1313
|
+
}
|
|
1314
|
+
{
|
|
1315
|
+
const storeMetadataParams = {
|
|
1316
|
+
ttl: ttlToUse,
|
|
1317
|
+
namespace: "cpq",
|
|
1318
|
+
version: VERSION$c,
|
|
1319
|
+
representationName: RepresentationType$5,
|
|
1320
|
+
};
|
|
1321
|
+
luvio.publishStoreMetadata(key, storeMetadataParams);
|
|
1322
|
+
}
|
|
1323
|
+
return createLink(key);
|
|
1324
|
+
};
|
|
1325
|
+
function getTypeCacheKeys$5(luvio, input, fullPathFactory) {
|
|
1326
|
+
const rootKeySet = new StoreKeyMap();
|
|
1327
|
+
// root cache key (uses fullPathFactory if keyBuilderFromType isn't defined)
|
|
1328
|
+
const rootKey = keyBuilderFromType$4(luvio, input);
|
|
1329
|
+
rootKeySet.set(rootKey, {
|
|
1330
|
+
namespace: keyPrefix,
|
|
1331
|
+
representationName: RepresentationType$5,
|
|
1332
|
+
mergeable: false
|
|
1333
|
+
});
|
|
1334
|
+
return rootKeySet;
|
|
1335
|
+
}
|
|
1336
|
+
|
|
1337
|
+
function select$h(luvio, params) {
|
|
1338
|
+
return select$i();
|
|
1339
|
+
}
|
|
1340
|
+
function getResponseCacheKeys$5(luvio, resourceParams, response) {
|
|
1341
|
+
return getTypeCacheKeys$5(luvio, response);
|
|
1342
|
+
}
|
|
1343
|
+
function ingestSuccess$5(luvio, resourceParams, response) {
|
|
1344
|
+
const { body } = response;
|
|
1345
|
+
const key = keyBuilderFromType$4(luvio, body);
|
|
1346
|
+
luvio.storeIngest(key, ingest$5, body);
|
|
1347
|
+
const snapshot = luvio.storeLookup({
|
|
1348
|
+
recordId: key,
|
|
1349
|
+
node: select$h(),
|
|
1350
|
+
variables: {},
|
|
1351
|
+
});
|
|
1352
|
+
if (process.env.NODE_ENV !== 'production') {
|
|
1353
|
+
if (snapshot.state !== 'Fulfilled') {
|
|
1354
|
+
throw new Error('Invalid network response. Expected resource response to result in Fulfilled snapshot');
|
|
1355
|
+
}
|
|
1356
|
+
}
|
|
1357
|
+
deepFreeze(snapshot.data);
|
|
1358
|
+
return snapshot;
|
|
1359
|
+
}
|
|
1360
|
+
function createResourceRequest$5(config) {
|
|
1361
|
+
const headers = {};
|
|
1362
|
+
return {
|
|
1363
|
+
baseUri: '/services/data/v59.0',
|
|
1364
|
+
basePath: '/connect/cpq/carts',
|
|
1365
|
+
method: 'post',
|
|
1366
|
+
body: config.body,
|
|
1367
|
+
urlParams: {},
|
|
1368
|
+
queryParams: {},
|
|
1369
|
+
headers,
|
|
1370
|
+
priority: 'normal',
|
|
1371
|
+
};
|
|
1372
|
+
}
|
|
1373
|
+
|
|
1374
|
+
const createCart_ConfigPropertyNames = {
|
|
1375
|
+
displayName: 'createCart',
|
|
1376
|
+
parameters: {
|
|
1377
|
+
required: ['createCartRequestPayload'],
|
|
1378
|
+
optional: []
|
|
1379
|
+
}
|
|
1380
|
+
};
|
|
1381
|
+
function createResourceParams$5(config) {
|
|
1382
|
+
const resourceParams = {
|
|
1383
|
+
body: {
|
|
1384
|
+
createCartRequestPayload: config.createCartRequestPayload
|
|
1385
|
+
}
|
|
1386
|
+
};
|
|
1387
|
+
return resourceParams;
|
|
1388
|
+
}
|
|
1389
|
+
function typeCheckConfig$5(untrustedConfig) {
|
|
1390
|
+
const config = {};
|
|
1391
|
+
const untrustedConfig_createCartRequestPayload = untrustedConfig.createCartRequestPayload;
|
|
1392
|
+
const referenceCreateCartInputRepresentationValidationError = validate$j(untrustedConfig_createCartRequestPayload);
|
|
1393
|
+
if (referenceCreateCartInputRepresentationValidationError === null) {
|
|
1394
|
+
config.createCartRequestPayload = untrustedConfig_createCartRequestPayload;
|
|
1395
|
+
}
|
|
1396
|
+
return config;
|
|
1397
|
+
}
|
|
1398
|
+
function validateAdapterConfig$5(untrustedConfig, configPropertyNames) {
|
|
1399
|
+
if (!untrustedIsObject(untrustedConfig)) {
|
|
1400
|
+
return null;
|
|
1401
|
+
}
|
|
1402
|
+
if (process.env.NODE_ENV !== 'production') {
|
|
1403
|
+
validateConfig(untrustedConfig, configPropertyNames);
|
|
1404
|
+
}
|
|
1405
|
+
const config = typeCheckConfig$5(untrustedConfig);
|
|
1406
|
+
if (!areRequiredParametersPresent(config, configPropertyNames)) {
|
|
1407
|
+
return null;
|
|
1408
|
+
}
|
|
1409
|
+
return config;
|
|
1410
|
+
}
|
|
1411
|
+
function buildNetworkSnapshot$5(luvio, config, options) {
|
|
1412
|
+
const resourceParams = createResourceParams$5(config);
|
|
1413
|
+
const request = createResourceRequest$5(resourceParams);
|
|
1414
|
+
return luvio.dispatchResourceRequest(request, options)
|
|
1415
|
+
.then((response) => {
|
|
1416
|
+
return luvio.handleSuccessResponse(() => {
|
|
1417
|
+
const snapshot = ingestSuccess$5(luvio, resourceParams, response);
|
|
1418
|
+
return luvio.storeBroadcast().then(() => snapshot);
|
|
1419
|
+
}, () => getResponseCacheKeys$5(luvio, resourceParams, response.body));
|
|
1420
|
+
}, (response) => {
|
|
1421
|
+
deepFreeze(response);
|
|
1422
|
+
throw response;
|
|
1423
|
+
});
|
|
1424
|
+
}
|
|
1425
|
+
const createCartAdapterFactory = (luvio) => {
|
|
1426
|
+
return function createCart(untrustedConfig) {
|
|
1427
|
+
const config = validateAdapterConfig$5(untrustedConfig, createCart_ConfigPropertyNames);
|
|
1428
|
+
// Invalid or incomplete config
|
|
1429
|
+
if (config === null) {
|
|
1430
|
+
throw new Error('Invalid config for "createCart"');
|
|
1431
|
+
}
|
|
1432
|
+
return buildNetworkSnapshot$5(luvio, config);
|
|
1433
|
+
};
|
|
1434
|
+
};
|
|
1435
|
+
|
|
1436
|
+
const VERSION$b = "c49b7c37c117b93f62b9696af8a68cdc";
|
|
1437
|
+
function validate$h(obj, path = 'AttributePickListValueOutputRepresentation') {
|
|
1438
|
+
const v_error = (() => {
|
|
1439
|
+
if (typeof obj !== 'object' || ArrayIsArray(obj) || obj === null) {
|
|
1440
|
+
return new TypeError('Expected "object" but received "' + typeof obj + '" (at "' + path + '")');
|
|
1441
|
+
}
|
|
1442
|
+
if (obj.code !== undefined) {
|
|
1443
|
+
const obj_code = obj.code;
|
|
1444
|
+
const path_code = path + '.code';
|
|
1445
|
+
if (typeof obj_code !== 'string') {
|
|
1446
|
+
return new TypeError('Expected "string" but received "' + typeof obj_code + '" (at "' + path_code + '")');
|
|
1447
|
+
}
|
|
1448
|
+
}
|
|
1449
|
+
if (obj.description !== undefined) {
|
|
1450
|
+
const obj_description = obj.description;
|
|
1451
|
+
const path_description = path + '.description';
|
|
1452
|
+
if (typeof obj_description !== 'string') {
|
|
1453
|
+
return new TypeError('Expected "string" but received "' + typeof obj_description + '" (at "' + path_description + '")');
|
|
1454
|
+
}
|
|
1455
|
+
}
|
|
1456
|
+
if (obj.displayValue !== undefined) {
|
|
1457
|
+
const obj_displayValue = obj.displayValue;
|
|
1458
|
+
const path_displayValue = path + '.displayValue';
|
|
1459
|
+
if (typeof obj_displayValue !== 'string') {
|
|
1460
|
+
return new TypeError('Expected "string" but received "' + typeof obj_displayValue + '" (at "' + path_displayValue + '")');
|
|
1461
|
+
}
|
|
1462
|
+
}
|
|
1463
|
+
if (obj.id !== undefined) {
|
|
1464
|
+
const obj_id = obj.id;
|
|
1465
|
+
const path_id = path + '.id';
|
|
1466
|
+
if (typeof obj_id !== 'string') {
|
|
1467
|
+
return new TypeError('Expected "string" but received "' + typeof obj_id + '" (at "' + path_id + '")');
|
|
1468
|
+
}
|
|
1469
|
+
}
|
|
1470
|
+
if (obj.isBooleanValue !== undefined) {
|
|
1471
|
+
const obj_isBooleanValue = obj.isBooleanValue;
|
|
1472
|
+
const path_isBooleanValue = path + '.isBooleanValue';
|
|
1473
|
+
if (typeof obj_isBooleanValue !== 'boolean') {
|
|
1474
|
+
return new TypeError('Expected "boolean" but received "' + typeof obj_isBooleanValue + '" (at "' + path_isBooleanValue + '")');
|
|
1475
|
+
}
|
|
1476
|
+
}
|
|
1477
|
+
if (obj.label !== undefined) {
|
|
1478
|
+
const obj_label = obj.label;
|
|
1479
|
+
const path_label = path + '.label';
|
|
1480
|
+
if (typeof obj_label !== 'string') {
|
|
1481
|
+
return new TypeError('Expected "string" but received "' + typeof obj_label + '" (at "' + path_label + '")');
|
|
1482
|
+
}
|
|
1483
|
+
}
|
|
1484
|
+
if (obj.name !== undefined) {
|
|
1485
|
+
const obj_name = obj.name;
|
|
1486
|
+
const path_name = path + '.name';
|
|
1487
|
+
if (typeof obj_name !== 'string') {
|
|
1488
|
+
return new TypeError('Expected "string" but received "' + typeof obj_name + '" (at "' + path_name + '")');
|
|
1489
|
+
}
|
|
1490
|
+
}
|
|
1491
|
+
if (obj.sequence !== undefined) {
|
|
1492
|
+
const obj_sequence = obj.sequence;
|
|
1493
|
+
const path_sequence = path + '.sequence';
|
|
1494
|
+
if (typeof obj_sequence !== 'number' || (typeof obj_sequence === 'number' && Math.floor(obj_sequence) !== obj_sequence)) {
|
|
1495
|
+
return new TypeError('Expected "integer" but received "' + typeof obj_sequence + '" (at "' + path_sequence + '")');
|
|
1496
|
+
}
|
|
1497
|
+
}
|
|
1498
|
+
if (obj.status !== undefined) {
|
|
1499
|
+
const obj_status = obj.status;
|
|
1500
|
+
const path_status = path + '.status';
|
|
1501
|
+
if (typeof obj_status !== 'string') {
|
|
1502
|
+
return new TypeError('Expected "string" but received "' + typeof obj_status + '" (at "' + path_status + '")');
|
|
1503
|
+
}
|
|
1504
|
+
}
|
|
1505
|
+
if (obj.textValue !== undefined) {
|
|
1506
|
+
const obj_textValue = obj.textValue;
|
|
1507
|
+
const path_textValue = path + '.textValue';
|
|
1508
|
+
if (typeof obj_textValue !== 'string') {
|
|
1509
|
+
return new TypeError('Expected "string" but received "' + typeof obj_textValue + '" (at "' + path_textValue + '")');
|
|
1510
|
+
}
|
|
1511
|
+
}
|
|
1512
|
+
})();
|
|
1513
|
+
return v_error === undefined ? null : v_error;
|
|
1514
|
+
}
|
|
1515
|
+
const select$g = function AttributePickListValueOutputRepresentationSelect() {
|
|
1516
|
+
return {
|
|
1517
|
+
kind: 'Fragment',
|
|
1518
|
+
version: VERSION$b,
|
|
1519
|
+
private: [],
|
|
1520
|
+
selections: [
|
|
1521
|
+
{
|
|
1522
|
+
name: 'code',
|
|
1523
|
+
kind: 'Scalar',
|
|
1524
|
+
required: false
|
|
1525
|
+
},
|
|
1526
|
+
{
|
|
1527
|
+
name: 'description',
|
|
1528
|
+
kind: 'Scalar',
|
|
1529
|
+
required: false
|
|
1530
|
+
},
|
|
1531
|
+
{
|
|
1532
|
+
name: 'displayValue',
|
|
1533
|
+
kind: 'Scalar',
|
|
1534
|
+
required: false
|
|
1535
|
+
},
|
|
1536
|
+
{
|
|
1537
|
+
name: 'id',
|
|
1538
|
+
kind: 'Scalar',
|
|
1539
|
+
required: false
|
|
1540
|
+
},
|
|
1541
|
+
{
|
|
1542
|
+
name: 'isBooleanValue',
|
|
1543
|
+
kind: 'Scalar',
|
|
1544
|
+
required: false
|
|
1545
|
+
},
|
|
1546
|
+
{
|
|
1547
|
+
name: 'label',
|
|
1548
|
+
kind: 'Scalar',
|
|
1549
|
+
required: false
|
|
1550
|
+
},
|
|
1551
|
+
{
|
|
1552
|
+
name: 'name',
|
|
1553
|
+
kind: 'Scalar',
|
|
1554
|
+
required: false
|
|
1555
|
+
},
|
|
1556
|
+
{
|
|
1557
|
+
name: 'sequence',
|
|
1558
|
+
kind: 'Scalar',
|
|
1559
|
+
required: false
|
|
1560
|
+
},
|
|
1561
|
+
{
|
|
1562
|
+
name: 'status',
|
|
1563
|
+
kind: 'Scalar',
|
|
1564
|
+
required: false
|
|
1565
|
+
},
|
|
1566
|
+
{
|
|
1567
|
+
name: 'textValue',
|
|
1568
|
+
kind: 'Scalar',
|
|
1569
|
+
required: false
|
|
1570
|
+
}
|
|
1571
|
+
]
|
|
1572
|
+
};
|
|
1573
|
+
};
|
|
1574
|
+
function equals$b(existing, incoming) {
|
|
1575
|
+
const existing_isBooleanValue = existing.isBooleanValue;
|
|
1576
|
+
const incoming_isBooleanValue = incoming.isBooleanValue;
|
|
1577
|
+
// if at least one of these optionals is defined
|
|
1578
|
+
if (existing_isBooleanValue !== undefined || incoming_isBooleanValue !== undefined) {
|
|
1579
|
+
// if one of these is not defined we know the other is defined and therefore
|
|
1580
|
+
// not equal
|
|
1581
|
+
if (existing_isBooleanValue === undefined || incoming_isBooleanValue === undefined) {
|
|
1582
|
+
return false;
|
|
1583
|
+
}
|
|
1584
|
+
if (!(existing_isBooleanValue === incoming_isBooleanValue)) {
|
|
1585
|
+
return false;
|
|
1586
|
+
}
|
|
1587
|
+
}
|
|
1588
|
+
const existing_sequence = existing.sequence;
|
|
1589
|
+
const incoming_sequence = incoming.sequence;
|
|
1590
|
+
// if at least one of these optionals is defined
|
|
1591
|
+
if (existing_sequence !== undefined || incoming_sequence !== undefined) {
|
|
1592
|
+
// if one of these is not defined we know the other is defined and therefore
|
|
1593
|
+
// not equal
|
|
1594
|
+
if (existing_sequence === undefined || incoming_sequence === undefined) {
|
|
1595
|
+
return false;
|
|
1596
|
+
}
|
|
1597
|
+
if (!(existing_sequence === incoming_sequence)) {
|
|
1598
|
+
return false;
|
|
1599
|
+
}
|
|
1600
|
+
}
|
|
1601
|
+
const existing_code = existing.code;
|
|
1602
|
+
const incoming_code = incoming.code;
|
|
1603
|
+
// if at least one of these optionals is defined
|
|
1604
|
+
if (existing_code !== undefined || incoming_code !== undefined) {
|
|
1605
|
+
// if one of these is not defined we know the other is defined and therefore
|
|
1606
|
+
// not equal
|
|
1607
|
+
if (existing_code === undefined || incoming_code === undefined) {
|
|
1608
|
+
return false;
|
|
1609
|
+
}
|
|
1610
|
+
if (!(existing_code === incoming_code)) {
|
|
1611
|
+
return false;
|
|
1612
|
+
}
|
|
1613
|
+
}
|
|
1614
|
+
const existing_description = existing.description;
|
|
1615
|
+
const incoming_description = incoming.description;
|
|
1616
|
+
// if at least one of these optionals is defined
|
|
1617
|
+
if (existing_description !== undefined || incoming_description !== undefined) {
|
|
1618
|
+
// if one of these is not defined we know the other is defined and therefore
|
|
1619
|
+
// not equal
|
|
1620
|
+
if (existing_description === undefined || incoming_description === undefined) {
|
|
1621
|
+
return false;
|
|
1622
|
+
}
|
|
1623
|
+
if (!(existing_description === incoming_description)) {
|
|
1624
|
+
return false;
|
|
1625
|
+
}
|
|
1626
|
+
}
|
|
1627
|
+
const existing_displayValue = existing.displayValue;
|
|
1628
|
+
const incoming_displayValue = incoming.displayValue;
|
|
1629
|
+
// if at least one of these optionals is defined
|
|
1630
|
+
if (existing_displayValue !== undefined || incoming_displayValue !== undefined) {
|
|
1631
|
+
// if one of these is not defined we know the other is defined and therefore
|
|
1632
|
+
// not equal
|
|
1633
|
+
if (existing_displayValue === undefined || incoming_displayValue === undefined) {
|
|
1634
|
+
return false;
|
|
1635
|
+
}
|
|
1636
|
+
if (!(existing_displayValue === incoming_displayValue)) {
|
|
1637
|
+
return false;
|
|
1638
|
+
}
|
|
1639
|
+
}
|
|
1640
|
+
const existing_id = existing.id;
|
|
1641
|
+
const incoming_id = incoming.id;
|
|
1642
|
+
// if at least one of these optionals is defined
|
|
1643
|
+
if (existing_id !== undefined || incoming_id !== undefined) {
|
|
1644
|
+
// if one of these is not defined we know the other is defined and therefore
|
|
1645
|
+
// not equal
|
|
1646
|
+
if (existing_id === undefined || incoming_id === undefined) {
|
|
1647
|
+
return false;
|
|
1648
|
+
}
|
|
1649
|
+
if (!(existing_id === incoming_id)) {
|
|
1650
|
+
return false;
|
|
1651
|
+
}
|
|
1652
|
+
}
|
|
1653
|
+
const existing_label = existing.label;
|
|
1654
|
+
const incoming_label = incoming.label;
|
|
1655
|
+
// if at least one of these optionals is defined
|
|
1656
|
+
if (existing_label !== undefined || incoming_label !== undefined) {
|
|
1657
|
+
// if one of these is not defined we know the other is defined and therefore
|
|
1658
|
+
// not equal
|
|
1659
|
+
if (existing_label === undefined || incoming_label === undefined) {
|
|
1660
|
+
return false;
|
|
1661
|
+
}
|
|
1662
|
+
if (!(existing_label === incoming_label)) {
|
|
1663
|
+
return false;
|
|
1664
|
+
}
|
|
1665
|
+
}
|
|
1666
|
+
const existing_name = existing.name;
|
|
1667
|
+
const incoming_name = incoming.name;
|
|
1668
|
+
// if at least one of these optionals is defined
|
|
1669
|
+
if (existing_name !== undefined || incoming_name !== undefined) {
|
|
1670
|
+
// if one of these is not defined we know the other is defined and therefore
|
|
1671
|
+
// not equal
|
|
1672
|
+
if (existing_name === undefined || incoming_name === undefined) {
|
|
1673
|
+
return false;
|
|
1674
|
+
}
|
|
1675
|
+
if (!(existing_name === incoming_name)) {
|
|
1676
|
+
return false;
|
|
1677
|
+
}
|
|
1678
|
+
}
|
|
1679
|
+
const existing_status = existing.status;
|
|
1680
|
+
const incoming_status = incoming.status;
|
|
1681
|
+
// if at least one of these optionals is defined
|
|
1682
|
+
if (existing_status !== undefined || incoming_status !== undefined) {
|
|
1683
|
+
// if one of these is not defined we know the other is defined and therefore
|
|
1684
|
+
// not equal
|
|
1685
|
+
if (existing_status === undefined || incoming_status === undefined) {
|
|
1686
|
+
return false;
|
|
1687
|
+
}
|
|
1688
|
+
if (!(existing_status === incoming_status)) {
|
|
1689
|
+
return false;
|
|
1690
|
+
}
|
|
1691
|
+
}
|
|
1692
|
+
const existing_textValue = existing.textValue;
|
|
1693
|
+
const incoming_textValue = incoming.textValue;
|
|
1694
|
+
// if at least one of these optionals is defined
|
|
1695
|
+
if (existing_textValue !== undefined || incoming_textValue !== undefined) {
|
|
1696
|
+
// if one of these is not defined we know the other is defined and therefore
|
|
1697
|
+
// not equal
|
|
1698
|
+
if (existing_textValue === undefined || incoming_textValue === undefined) {
|
|
1699
|
+
return false;
|
|
1700
|
+
}
|
|
1701
|
+
if (!(existing_textValue === incoming_textValue)) {
|
|
1702
|
+
return false;
|
|
1703
|
+
}
|
|
1704
|
+
}
|
|
1705
|
+
return true;
|
|
1706
|
+
}
|
|
1707
|
+
|
|
1708
|
+
const VERSION$a = "78e748e628eb86e688eec1678db105d8";
|
|
1709
|
+
function validate$g(obj, path = 'AttributePickListOutputRepresentation') {
|
|
1710
|
+
const v_error = (() => {
|
|
1711
|
+
if (typeof obj !== 'object' || ArrayIsArray(obj) || obj === null) {
|
|
1712
|
+
return new TypeError('Expected "object" but received "' + typeof obj + '" (at "' + path + '")');
|
|
1713
|
+
}
|
|
1714
|
+
if (obj.code !== undefined) {
|
|
1715
|
+
const obj_code = obj.code;
|
|
1716
|
+
const path_code = path + '.code';
|
|
1717
|
+
if (typeof obj_code !== 'string') {
|
|
1718
|
+
return new TypeError('Expected "string" but received "' + typeof obj_code + '" (at "' + path_code + '")');
|
|
1719
|
+
}
|
|
1720
|
+
}
|
|
1721
|
+
if (obj.description !== undefined) {
|
|
1722
|
+
const obj_description = obj.description;
|
|
1723
|
+
const path_description = path + '.description';
|
|
1724
|
+
if (typeof obj_description !== 'string') {
|
|
1725
|
+
return new TypeError('Expected "string" but received "' + typeof obj_description + '" (at "' + path_description + '")');
|
|
1726
|
+
}
|
|
1727
|
+
}
|
|
1728
|
+
if (obj.id !== undefined) {
|
|
1729
|
+
const obj_id = obj.id;
|
|
1730
|
+
const path_id = path + '.id';
|
|
1731
|
+
if (typeof obj_id !== 'string') {
|
|
1732
|
+
return new TypeError('Expected "string" but received "' + typeof obj_id + '" (at "' + path_id + '")');
|
|
1733
|
+
}
|
|
1734
|
+
}
|
|
1735
|
+
if (obj.name !== undefined) {
|
|
1736
|
+
const obj_name = obj.name;
|
|
1737
|
+
const path_name = path + '.name';
|
|
1738
|
+
if (typeof obj_name !== 'string') {
|
|
1739
|
+
return new TypeError('Expected "string" but received "' + typeof obj_name + '" (at "' + path_name + '")');
|
|
1740
|
+
}
|
|
1741
|
+
}
|
|
1742
|
+
if (obj.status !== undefined) {
|
|
1743
|
+
const obj_status = obj.status;
|
|
1744
|
+
const path_status = path + '.status';
|
|
1745
|
+
if (typeof obj_status !== 'string') {
|
|
1746
|
+
return new TypeError('Expected "string" but received "' + typeof obj_status + '" (at "' + path_status + '")');
|
|
1747
|
+
}
|
|
1748
|
+
}
|
|
1749
|
+
if (obj.values !== undefined) {
|
|
1750
|
+
const obj_values = obj.values;
|
|
1751
|
+
const path_values = path + '.values';
|
|
1752
|
+
if (!ArrayIsArray(obj_values)) {
|
|
1753
|
+
return new TypeError('Expected "array" but received "' + typeof obj_values + '" (at "' + path_values + '")');
|
|
1754
|
+
}
|
|
1755
|
+
for (let i = 0; i < obj_values.length; i++) {
|
|
1756
|
+
const obj_values_item = obj_values[i];
|
|
1757
|
+
const path_values_item = path_values + '[' + i + ']';
|
|
1758
|
+
const referencepath_values_itemValidationError = validate$h(obj_values_item, path_values_item);
|
|
1759
|
+
if (referencepath_values_itemValidationError !== null) {
|
|
1760
|
+
let message = 'Object doesn\'t match AttributePickListValueOutputRepresentation (at "' + path_values_item + '")\n';
|
|
1761
|
+
message += referencepath_values_itemValidationError.message.split('\n').map((line) => '\t' + line).join('\n');
|
|
1762
|
+
return new TypeError(message);
|
|
1763
|
+
}
|
|
1764
|
+
}
|
|
1765
|
+
}
|
|
1766
|
+
})();
|
|
1767
|
+
return v_error === undefined ? null : v_error;
|
|
1768
|
+
}
|
|
1769
|
+
const select$f = function AttributePickListOutputRepresentationSelect() {
|
|
1770
|
+
const { selections: AttributePickListValueOutputRepresentation__selections, opaque: AttributePickListValueOutputRepresentation__opaque, } = select$g();
|
|
1771
|
+
return {
|
|
1772
|
+
kind: 'Fragment',
|
|
1773
|
+
version: VERSION$a,
|
|
1774
|
+
private: [],
|
|
1775
|
+
selections: [
|
|
1776
|
+
{
|
|
1777
|
+
name: 'code',
|
|
1778
|
+
kind: 'Scalar',
|
|
1779
|
+
required: false
|
|
1780
|
+
},
|
|
1781
|
+
{
|
|
1782
|
+
name: 'description',
|
|
1783
|
+
kind: 'Scalar',
|
|
1784
|
+
required: false
|
|
1785
|
+
},
|
|
1786
|
+
{
|
|
1787
|
+
name: 'id',
|
|
1788
|
+
kind: 'Scalar',
|
|
1789
|
+
required: false
|
|
1790
|
+
},
|
|
1791
|
+
{
|
|
1792
|
+
name: 'name',
|
|
1793
|
+
kind: 'Scalar',
|
|
1794
|
+
required: false
|
|
1795
|
+
},
|
|
1796
|
+
{
|
|
1797
|
+
name: 'status',
|
|
1798
|
+
kind: 'Scalar',
|
|
1799
|
+
required: false
|
|
1800
|
+
},
|
|
1801
|
+
{
|
|
1802
|
+
name: 'values',
|
|
1803
|
+
kind: 'Object',
|
|
1804
|
+
plural: true,
|
|
1805
|
+
selections: AttributePickListValueOutputRepresentation__selections,
|
|
1806
|
+
required: false
|
|
1807
|
+
}
|
|
1808
|
+
]
|
|
1809
|
+
};
|
|
1810
|
+
};
|
|
1811
|
+
function equals$a(existing, incoming) {
|
|
1812
|
+
const existing_code = existing.code;
|
|
1813
|
+
const incoming_code = incoming.code;
|
|
1814
|
+
// if at least one of these optionals is defined
|
|
1815
|
+
if (existing_code !== undefined || incoming_code !== undefined) {
|
|
1816
|
+
// if one of these is not defined we know the other is defined and therefore
|
|
1817
|
+
// not equal
|
|
1818
|
+
if (existing_code === undefined || incoming_code === undefined) {
|
|
1819
|
+
return false;
|
|
1820
|
+
}
|
|
1821
|
+
if (!(existing_code === incoming_code)) {
|
|
1822
|
+
return false;
|
|
1823
|
+
}
|
|
1824
|
+
}
|
|
1825
|
+
const existing_description = existing.description;
|
|
1826
|
+
const incoming_description = incoming.description;
|
|
1827
|
+
// if at least one of these optionals is defined
|
|
1828
|
+
if (existing_description !== undefined || incoming_description !== undefined) {
|
|
1829
|
+
// if one of these is not defined we know the other is defined and therefore
|
|
1830
|
+
// not equal
|
|
1831
|
+
if (existing_description === undefined || incoming_description === undefined) {
|
|
1832
|
+
return false;
|
|
1833
|
+
}
|
|
1834
|
+
if (!(existing_description === incoming_description)) {
|
|
1835
|
+
return false;
|
|
1836
|
+
}
|
|
1837
|
+
}
|
|
1838
|
+
const existing_id = existing.id;
|
|
1839
|
+
const incoming_id = incoming.id;
|
|
1840
|
+
// if at least one of these optionals is defined
|
|
1841
|
+
if (existing_id !== undefined || incoming_id !== undefined) {
|
|
1842
|
+
// if one of these is not defined we know the other is defined and therefore
|
|
1843
|
+
// not equal
|
|
1844
|
+
if (existing_id === undefined || incoming_id === undefined) {
|
|
1845
|
+
return false;
|
|
1846
|
+
}
|
|
1847
|
+
if (!(existing_id === incoming_id)) {
|
|
1848
|
+
return false;
|
|
1849
|
+
}
|
|
1850
|
+
}
|
|
1851
|
+
const existing_name = existing.name;
|
|
1852
|
+
const incoming_name = incoming.name;
|
|
1853
|
+
// if at least one of these optionals is defined
|
|
1854
|
+
if (existing_name !== undefined || incoming_name !== undefined) {
|
|
1855
|
+
// if one of these is not defined we know the other is defined and therefore
|
|
1856
|
+
// not equal
|
|
1857
|
+
if (existing_name === undefined || incoming_name === undefined) {
|
|
1858
|
+
return false;
|
|
1859
|
+
}
|
|
1860
|
+
if (!(existing_name === incoming_name)) {
|
|
1861
|
+
return false;
|
|
1862
|
+
}
|
|
1863
|
+
}
|
|
1864
|
+
const existing_status = existing.status;
|
|
1865
|
+
const incoming_status = incoming.status;
|
|
1866
|
+
// if at least one of these optionals is defined
|
|
1867
|
+
if (existing_status !== undefined || incoming_status !== undefined) {
|
|
1868
|
+
// if one of these is not defined we know the other is defined and therefore
|
|
1869
|
+
// not equal
|
|
1870
|
+
if (existing_status === undefined || incoming_status === undefined) {
|
|
1871
|
+
return false;
|
|
1872
|
+
}
|
|
1873
|
+
if (!(existing_status === incoming_status)) {
|
|
1874
|
+
return false;
|
|
1875
|
+
}
|
|
1876
|
+
}
|
|
1877
|
+
const existing_values = existing.values;
|
|
1878
|
+
const incoming_values = incoming.values;
|
|
1879
|
+
// if at least one of these optionals is defined
|
|
1880
|
+
if (existing_values !== undefined || incoming_values !== undefined) {
|
|
1881
|
+
// if one of these is not defined we know the other is defined and therefore
|
|
1882
|
+
// not equal
|
|
1883
|
+
if (existing_values === undefined || incoming_values === undefined) {
|
|
1884
|
+
return false;
|
|
1885
|
+
}
|
|
1886
|
+
const equals_values_items = equalsArray(existing_values, incoming_values, (existing_values_item, incoming_values_item) => {
|
|
1887
|
+
if (!(equals$b(existing_values_item, incoming_values_item))) {
|
|
1888
|
+
return false;
|
|
1889
|
+
}
|
|
1890
|
+
});
|
|
1891
|
+
if (equals_values_items === false) {
|
|
1892
|
+
return false;
|
|
1893
|
+
}
|
|
1894
|
+
}
|
|
1895
|
+
return true;
|
|
1896
|
+
}
|
|
1897
|
+
|
|
1898
|
+
const VERSION$9 = "b4d64b73b67739b304b8b6c4b19e2b38";
|
|
1899
|
+
function validate$f(obj, path = 'ProductAttributeOutputRepresentation') {
|
|
1900
|
+
const v_error = (() => {
|
|
1901
|
+
if (typeof obj !== 'object' || ArrayIsArray(obj) || obj === null) {
|
|
1902
|
+
return new TypeError('Expected "object" but received "' + typeof obj + '" (at "' + path + '")');
|
|
1903
|
+
}
|
|
1904
|
+
if (obj.attributeCategoryId !== undefined) {
|
|
1905
|
+
const obj_attributeCategoryId = obj.attributeCategoryId;
|
|
1906
|
+
const path_attributeCategoryId = path + '.attributeCategoryId';
|
|
1907
|
+
if (typeof obj_attributeCategoryId !== 'string') {
|
|
1908
|
+
return new TypeError('Expected "string" but received "' + typeof obj_attributeCategoryId + '" (at "' + path_attributeCategoryId + '")');
|
|
1909
|
+
}
|
|
1910
|
+
}
|
|
1911
|
+
if (obj.attributePickList !== undefined) {
|
|
1912
|
+
const obj_attributePickList = obj.attributePickList;
|
|
1913
|
+
const path_attributePickList = path + '.attributePickList';
|
|
1914
|
+
const referencepath_attributePickListValidationError = validate$g(obj_attributePickList, path_attributePickList);
|
|
1915
|
+
if (referencepath_attributePickListValidationError !== null) {
|
|
1916
|
+
let message = 'Object doesn\'t match AttributePickListOutputRepresentation (at "' + path_attributePickList + '")\n';
|
|
1917
|
+
message += referencepath_attributePickListValidationError.message.split('\n').map((line) => '\t' + line).join('\n');
|
|
1918
|
+
return new TypeError(message);
|
|
1919
|
+
}
|
|
1920
|
+
}
|
|
1921
|
+
if (obj.code !== undefined) {
|
|
1922
|
+
const obj_code = obj.code;
|
|
1923
|
+
const path_code = path + '.code';
|
|
1924
|
+
if (typeof obj_code !== 'string') {
|
|
1925
|
+
return new TypeError('Expected "string" but received "' + typeof obj_code + '" (at "' + path_code + '")');
|
|
1926
|
+
}
|
|
1927
|
+
}
|
|
1928
|
+
if (obj.dataType !== undefined) {
|
|
1929
|
+
const obj_dataType = obj.dataType;
|
|
1930
|
+
const path_dataType = path + '.dataType';
|
|
1931
|
+
if (typeof obj_dataType !== 'string') {
|
|
1932
|
+
return new TypeError('Expected "string" but received "' + typeof obj_dataType + '" (at "' + path_dataType + '")');
|
|
1933
|
+
}
|
|
1934
|
+
}
|
|
1935
|
+
if (obj.defaultHelpText !== undefined) {
|
|
1936
|
+
const obj_defaultHelpText = obj.defaultHelpText;
|
|
1937
|
+
const path_defaultHelpText = path + '.defaultHelpText';
|
|
1938
|
+
if (typeof obj_defaultHelpText !== 'string') {
|
|
1939
|
+
return new TypeError('Expected "string" but received "' + typeof obj_defaultHelpText + '" (at "' + path_defaultHelpText + '")');
|
|
1940
|
+
}
|
|
1941
|
+
}
|
|
1942
|
+
if (obj.defaultValue !== undefined) {
|
|
1943
|
+
const obj_defaultValue = obj.defaultValue;
|
|
1944
|
+
const path_defaultValue = path + '.defaultValue';
|
|
1945
|
+
if (typeof obj_defaultValue !== 'string') {
|
|
1946
|
+
return new TypeError('Expected "string" but received "' + typeof obj_defaultValue + '" (at "' + path_defaultValue + '")');
|
|
1947
|
+
}
|
|
1948
|
+
}
|
|
1949
|
+
if (obj.description !== undefined) {
|
|
1950
|
+
const obj_description = obj.description;
|
|
1951
|
+
const path_description = path + '.description';
|
|
1952
|
+
if (typeof obj_description !== 'string') {
|
|
1953
|
+
return new TypeError('Expected "string" but received "' + typeof obj_description + '" (at "' + path_description + '")');
|
|
1954
|
+
}
|
|
1955
|
+
}
|
|
1956
|
+
if (obj.hidden !== undefined) {
|
|
1957
|
+
const obj_hidden = obj.hidden;
|
|
1958
|
+
const path_hidden = path + '.hidden';
|
|
1959
|
+
if (typeof obj_hidden !== 'boolean') {
|
|
1960
|
+
return new TypeError('Expected "boolean" but received "' + typeof obj_hidden + '" (at "' + path_hidden + '")');
|
|
1961
|
+
}
|
|
1962
|
+
}
|
|
1963
|
+
if (obj.id !== undefined) {
|
|
1964
|
+
const obj_id = obj.id;
|
|
1965
|
+
const path_id = path + '.id';
|
|
1966
|
+
if (typeof obj_id !== 'string') {
|
|
1967
|
+
return new TypeError('Expected "string" but received "' + typeof obj_id + '" (at "' + path_id + '")');
|
|
1968
|
+
}
|
|
1969
|
+
}
|
|
1970
|
+
if (obj.isCloneable !== undefined) {
|
|
1971
|
+
const obj_isCloneable = obj.isCloneable;
|
|
1972
|
+
const path_isCloneable = path + '.isCloneable';
|
|
1973
|
+
if (typeof obj_isCloneable !== 'boolean') {
|
|
1974
|
+
return new TypeError('Expected "boolean" but received "' + typeof obj_isCloneable + '" (at "' + path_isCloneable + '")');
|
|
1975
|
+
}
|
|
1976
|
+
}
|
|
1977
|
+
if (obj.isConfigurable !== undefined) {
|
|
1978
|
+
const obj_isConfigurable = obj.isConfigurable;
|
|
1979
|
+
const path_isConfigurable = path + '.isConfigurable';
|
|
1980
|
+
if (typeof obj_isConfigurable !== 'boolean') {
|
|
1981
|
+
return new TypeError('Expected "boolean" but received "' + typeof obj_isConfigurable + '" (at "' + path_isConfigurable + '")');
|
|
1982
|
+
}
|
|
1983
|
+
}
|
|
1984
|
+
if (obj.isEncrypted !== undefined) {
|
|
1985
|
+
const obj_isEncrypted = obj.isEncrypted;
|
|
1986
|
+
const path_isEncrypted = path + '.isEncrypted';
|
|
1987
|
+
if (typeof obj_isEncrypted !== 'boolean') {
|
|
1988
|
+
return new TypeError('Expected "boolean" but received "' + typeof obj_isEncrypted + '" (at "' + path_isEncrypted + '")');
|
|
1989
|
+
}
|
|
1990
|
+
}
|
|
1991
|
+
if (obj.isPriceImpacting !== undefined) {
|
|
1992
|
+
const obj_isPriceImpacting = obj.isPriceImpacting;
|
|
1993
|
+
const path_isPriceImpacting = path + '.isPriceImpacting';
|
|
1994
|
+
if (typeof obj_isPriceImpacting !== 'boolean') {
|
|
1995
|
+
return new TypeError('Expected "boolean" but received "' + typeof obj_isPriceImpacting + '" (at "' + path_isPriceImpacting + '")');
|
|
1996
|
+
}
|
|
1997
|
+
}
|
|
1998
|
+
if (obj.isReadOnly !== undefined) {
|
|
1999
|
+
const obj_isReadOnly = obj.isReadOnly;
|
|
2000
|
+
const path_isReadOnly = path + '.isReadOnly';
|
|
2001
|
+
if (typeof obj_isReadOnly !== 'boolean') {
|
|
2002
|
+
return new TypeError('Expected "boolean" but received "' + typeof obj_isReadOnly + '" (at "' + path_isReadOnly + '")');
|
|
2003
|
+
}
|
|
2004
|
+
}
|
|
2005
|
+
if (obj.isRequired !== undefined) {
|
|
2006
|
+
const obj_isRequired = obj.isRequired;
|
|
2007
|
+
const path_isRequired = path + '.isRequired';
|
|
2008
|
+
if (typeof obj_isRequired !== 'boolean') {
|
|
2009
|
+
return new TypeError('Expected "boolean" but received "' + typeof obj_isRequired + '" (at "' + path_isRequired + '")');
|
|
2010
|
+
}
|
|
2011
|
+
}
|
|
2012
|
+
if (obj.label !== undefined) {
|
|
2013
|
+
const obj_label = obj.label;
|
|
2014
|
+
const path_label = path + '.label';
|
|
2015
|
+
if (typeof obj_label !== 'string') {
|
|
2016
|
+
return new TypeError('Expected "string" but received "' + typeof obj_label + '" (at "' + path_label + '")');
|
|
2017
|
+
}
|
|
2018
|
+
}
|
|
2019
|
+
if (obj.name !== undefined) {
|
|
2020
|
+
const obj_name = obj.name;
|
|
2021
|
+
const path_name = path + '.name';
|
|
2022
|
+
if (typeof obj_name !== 'string') {
|
|
2023
|
+
return new TypeError('Expected "string" but received "' + typeof obj_name + '" (at "' + path_name + '")');
|
|
2024
|
+
}
|
|
2025
|
+
}
|
|
2026
|
+
if (obj.status !== undefined) {
|
|
2027
|
+
const obj_status = obj.status;
|
|
2028
|
+
const path_status = path + '.status';
|
|
2029
|
+
if (typeof obj_status !== 'string') {
|
|
2030
|
+
return new TypeError('Expected "string" but received "' + typeof obj_status + '" (at "' + path_status + '")');
|
|
2031
|
+
}
|
|
2032
|
+
}
|
|
2033
|
+
if (obj.userValue !== undefined) {
|
|
2034
|
+
const obj_userValue = obj.userValue;
|
|
2035
|
+
const path_userValue = path + '.userValue';
|
|
2036
|
+
if (typeof obj_userValue !== 'string') {
|
|
2037
|
+
return new TypeError('Expected "string" but received "' + typeof obj_userValue + '" (at "' + path_userValue + '")');
|
|
2038
|
+
}
|
|
2039
|
+
}
|
|
2040
|
+
})();
|
|
2041
|
+
return v_error === undefined ? null : v_error;
|
|
2042
|
+
}
|
|
2043
|
+
const select$e = function ProductAttributeOutputRepresentationSelect() {
|
|
2044
|
+
const { selections: AttributePickListOutputRepresentation__selections, opaque: AttributePickListOutputRepresentation__opaque, } = select$f();
|
|
2045
|
+
return {
|
|
2046
|
+
kind: 'Fragment',
|
|
2047
|
+
version: VERSION$9,
|
|
2048
|
+
private: [],
|
|
2049
|
+
selections: [
|
|
2050
|
+
{
|
|
2051
|
+
name: 'attributeCategoryId',
|
|
2052
|
+
kind: 'Scalar',
|
|
2053
|
+
required: false
|
|
2054
|
+
},
|
|
2055
|
+
{
|
|
2056
|
+
name: 'attributePickList',
|
|
2057
|
+
kind: 'Object',
|
|
2058
|
+
selections: AttributePickListOutputRepresentation__selections,
|
|
2059
|
+
required: false
|
|
2060
|
+
},
|
|
2061
|
+
{
|
|
2062
|
+
name: 'code',
|
|
2063
|
+
kind: 'Scalar',
|
|
2064
|
+
required: false
|
|
2065
|
+
},
|
|
2066
|
+
{
|
|
2067
|
+
name: 'dataType',
|
|
2068
|
+
kind: 'Scalar',
|
|
2069
|
+
required: false
|
|
2070
|
+
},
|
|
2071
|
+
{
|
|
2072
|
+
name: 'defaultHelpText',
|
|
2073
|
+
kind: 'Scalar',
|
|
2074
|
+
required: false
|
|
2075
|
+
},
|
|
2076
|
+
{
|
|
2077
|
+
name: 'defaultValue',
|
|
2078
|
+
kind: 'Scalar',
|
|
2079
|
+
required: false
|
|
2080
|
+
},
|
|
2081
|
+
{
|
|
2082
|
+
name: 'description',
|
|
2083
|
+
kind: 'Scalar',
|
|
2084
|
+
required: false
|
|
2085
|
+
},
|
|
2086
|
+
{
|
|
2087
|
+
name: 'hidden',
|
|
2088
|
+
kind: 'Scalar',
|
|
2089
|
+
required: false
|
|
2090
|
+
},
|
|
2091
|
+
{
|
|
2092
|
+
name: 'id',
|
|
2093
|
+
kind: 'Scalar',
|
|
2094
|
+
required: false
|
|
2095
|
+
},
|
|
2096
|
+
{
|
|
2097
|
+
name: 'isCloneable',
|
|
2098
|
+
kind: 'Scalar',
|
|
2099
|
+
required: false
|
|
2100
|
+
},
|
|
2101
|
+
{
|
|
2102
|
+
name: 'isConfigurable',
|
|
2103
|
+
kind: 'Scalar',
|
|
2104
|
+
required: false
|
|
2105
|
+
},
|
|
2106
|
+
{
|
|
2107
|
+
name: 'isEncrypted',
|
|
2108
|
+
kind: 'Scalar',
|
|
2109
|
+
required: false
|
|
2110
|
+
},
|
|
2111
|
+
{
|
|
2112
|
+
name: 'isPriceImpacting',
|
|
2113
|
+
kind: 'Scalar',
|
|
2114
|
+
required: false
|
|
2115
|
+
},
|
|
2116
|
+
{
|
|
2117
|
+
name: 'isReadOnly',
|
|
2118
|
+
kind: 'Scalar',
|
|
2119
|
+
required: false
|
|
2120
|
+
},
|
|
2121
|
+
{
|
|
2122
|
+
name: 'isRequired',
|
|
2123
|
+
kind: 'Scalar',
|
|
2124
|
+
required: false
|
|
2125
|
+
},
|
|
2126
|
+
{
|
|
2127
|
+
name: 'label',
|
|
2128
|
+
kind: 'Scalar',
|
|
2129
|
+
required: false
|
|
2130
|
+
},
|
|
2131
|
+
{
|
|
2132
|
+
name: 'name',
|
|
2133
|
+
kind: 'Scalar',
|
|
2134
|
+
required: false
|
|
2135
|
+
},
|
|
2136
|
+
{
|
|
2137
|
+
name: 'status',
|
|
2138
|
+
kind: 'Scalar',
|
|
2139
|
+
required: false
|
|
2140
|
+
},
|
|
2141
|
+
{
|
|
2142
|
+
name: 'userValue',
|
|
2143
|
+
kind: 'Scalar',
|
|
2144
|
+
required: false
|
|
2145
|
+
}
|
|
2146
|
+
]
|
|
2147
|
+
};
|
|
2148
|
+
};
|
|
2149
|
+
function equals$9(existing, incoming) {
|
|
2150
|
+
const existing_hidden = existing.hidden;
|
|
2151
|
+
const incoming_hidden = incoming.hidden;
|
|
2152
|
+
// if at least one of these optionals is defined
|
|
2153
|
+
if (existing_hidden !== undefined || incoming_hidden !== undefined) {
|
|
2154
|
+
// if one of these is not defined we know the other is defined and therefore
|
|
2155
|
+
// not equal
|
|
2156
|
+
if (existing_hidden === undefined || incoming_hidden === undefined) {
|
|
2157
|
+
return false;
|
|
2158
|
+
}
|
|
2159
|
+
if (!(existing_hidden === incoming_hidden)) {
|
|
2160
|
+
return false;
|
|
2161
|
+
}
|
|
2162
|
+
}
|
|
2163
|
+
const existing_isCloneable = existing.isCloneable;
|
|
2164
|
+
const incoming_isCloneable = incoming.isCloneable;
|
|
2165
|
+
// if at least one of these optionals is defined
|
|
2166
|
+
if (existing_isCloneable !== undefined || incoming_isCloneable !== undefined) {
|
|
2167
|
+
// if one of these is not defined we know the other is defined and therefore
|
|
2168
|
+
// not equal
|
|
2169
|
+
if (existing_isCloneable === undefined || incoming_isCloneable === undefined) {
|
|
2170
|
+
return false;
|
|
2171
|
+
}
|
|
2172
|
+
if (!(existing_isCloneable === incoming_isCloneable)) {
|
|
2173
|
+
return false;
|
|
2174
|
+
}
|
|
2175
|
+
}
|
|
2176
|
+
const existing_isConfigurable = existing.isConfigurable;
|
|
2177
|
+
const incoming_isConfigurable = incoming.isConfigurable;
|
|
2178
|
+
// if at least one of these optionals is defined
|
|
2179
|
+
if (existing_isConfigurable !== undefined || incoming_isConfigurable !== undefined) {
|
|
2180
|
+
// if one of these is not defined we know the other is defined and therefore
|
|
2181
|
+
// not equal
|
|
2182
|
+
if (existing_isConfigurable === undefined || incoming_isConfigurable === undefined) {
|
|
2183
|
+
return false;
|
|
2184
|
+
}
|
|
2185
|
+
if (!(existing_isConfigurable === incoming_isConfigurable)) {
|
|
2186
|
+
return false;
|
|
2187
|
+
}
|
|
2188
|
+
}
|
|
2189
|
+
const existing_isEncrypted = existing.isEncrypted;
|
|
2190
|
+
const incoming_isEncrypted = incoming.isEncrypted;
|
|
2191
|
+
// if at least one of these optionals is defined
|
|
2192
|
+
if (existing_isEncrypted !== undefined || incoming_isEncrypted !== undefined) {
|
|
2193
|
+
// if one of these is not defined we know the other is defined and therefore
|
|
2194
|
+
// not equal
|
|
2195
|
+
if (existing_isEncrypted === undefined || incoming_isEncrypted === undefined) {
|
|
2196
|
+
return false;
|
|
2197
|
+
}
|
|
2198
|
+
if (!(existing_isEncrypted === incoming_isEncrypted)) {
|
|
2199
|
+
return false;
|
|
2200
|
+
}
|
|
2201
|
+
}
|
|
2202
|
+
const existing_isPriceImpacting = existing.isPriceImpacting;
|
|
2203
|
+
const incoming_isPriceImpacting = incoming.isPriceImpacting;
|
|
2204
|
+
// if at least one of these optionals is defined
|
|
2205
|
+
if (existing_isPriceImpacting !== undefined || incoming_isPriceImpacting !== undefined) {
|
|
2206
|
+
// if one of these is not defined we know the other is defined and therefore
|
|
2207
|
+
// not equal
|
|
2208
|
+
if (existing_isPriceImpacting === undefined || incoming_isPriceImpacting === undefined) {
|
|
2209
|
+
return false;
|
|
2210
|
+
}
|
|
2211
|
+
if (!(existing_isPriceImpacting === incoming_isPriceImpacting)) {
|
|
2212
|
+
return false;
|
|
2213
|
+
}
|
|
2214
|
+
}
|
|
2215
|
+
const existing_isReadOnly = existing.isReadOnly;
|
|
2216
|
+
const incoming_isReadOnly = incoming.isReadOnly;
|
|
2217
|
+
// if at least one of these optionals is defined
|
|
2218
|
+
if (existing_isReadOnly !== undefined || incoming_isReadOnly !== undefined) {
|
|
2219
|
+
// if one of these is not defined we know the other is defined and therefore
|
|
2220
|
+
// not equal
|
|
2221
|
+
if (existing_isReadOnly === undefined || incoming_isReadOnly === undefined) {
|
|
2222
|
+
return false;
|
|
2223
|
+
}
|
|
2224
|
+
if (!(existing_isReadOnly === incoming_isReadOnly)) {
|
|
2225
|
+
return false;
|
|
2226
|
+
}
|
|
2227
|
+
}
|
|
2228
|
+
const existing_isRequired = existing.isRequired;
|
|
2229
|
+
const incoming_isRequired = incoming.isRequired;
|
|
2230
|
+
// if at least one of these optionals is defined
|
|
2231
|
+
if (existing_isRequired !== undefined || incoming_isRequired !== undefined) {
|
|
2232
|
+
// if one of these is not defined we know the other is defined and therefore
|
|
2233
|
+
// not equal
|
|
2234
|
+
if (existing_isRequired === undefined || incoming_isRequired === undefined) {
|
|
2235
|
+
return false;
|
|
2236
|
+
}
|
|
2237
|
+
if (!(existing_isRequired === incoming_isRequired)) {
|
|
2238
|
+
return false;
|
|
2239
|
+
}
|
|
2240
|
+
}
|
|
2241
|
+
const existing_attributeCategoryId = existing.attributeCategoryId;
|
|
2242
|
+
const incoming_attributeCategoryId = incoming.attributeCategoryId;
|
|
2243
|
+
// if at least one of these optionals is defined
|
|
2244
|
+
if (existing_attributeCategoryId !== undefined || incoming_attributeCategoryId !== undefined) {
|
|
2245
|
+
// if one of these is not defined we know the other is defined and therefore
|
|
2246
|
+
// not equal
|
|
2247
|
+
if (existing_attributeCategoryId === undefined || incoming_attributeCategoryId === undefined) {
|
|
2248
|
+
return false;
|
|
2249
|
+
}
|
|
2250
|
+
if (!(existing_attributeCategoryId === incoming_attributeCategoryId)) {
|
|
2251
|
+
return false;
|
|
2252
|
+
}
|
|
2253
|
+
}
|
|
2254
|
+
const existing_code = existing.code;
|
|
2255
|
+
const incoming_code = incoming.code;
|
|
2256
|
+
// if at least one of these optionals is defined
|
|
2257
|
+
if (existing_code !== undefined || incoming_code !== undefined) {
|
|
2258
|
+
// if one of these is not defined we know the other is defined and therefore
|
|
2259
|
+
// not equal
|
|
2260
|
+
if (existing_code === undefined || incoming_code === undefined) {
|
|
2261
|
+
return false;
|
|
2262
|
+
}
|
|
2263
|
+
if (!(existing_code === incoming_code)) {
|
|
2264
|
+
return false;
|
|
2265
|
+
}
|
|
2266
|
+
}
|
|
2267
|
+
const existing_dataType = existing.dataType;
|
|
2268
|
+
const incoming_dataType = incoming.dataType;
|
|
2269
|
+
// if at least one of these optionals is defined
|
|
2270
|
+
if (existing_dataType !== undefined || incoming_dataType !== undefined) {
|
|
2271
|
+
// if one of these is not defined we know the other is defined and therefore
|
|
2272
|
+
// not equal
|
|
2273
|
+
if (existing_dataType === undefined || incoming_dataType === undefined) {
|
|
2274
|
+
return false;
|
|
2275
|
+
}
|
|
2276
|
+
if (!(existing_dataType === incoming_dataType)) {
|
|
2277
|
+
return false;
|
|
2278
|
+
}
|
|
2279
|
+
}
|
|
2280
|
+
const existing_defaultHelpText = existing.defaultHelpText;
|
|
2281
|
+
const incoming_defaultHelpText = incoming.defaultHelpText;
|
|
2282
|
+
// if at least one of these optionals is defined
|
|
2283
|
+
if (existing_defaultHelpText !== undefined || incoming_defaultHelpText !== undefined) {
|
|
2284
|
+
// if one of these is not defined we know the other is defined and therefore
|
|
2285
|
+
// not equal
|
|
2286
|
+
if (existing_defaultHelpText === undefined || incoming_defaultHelpText === undefined) {
|
|
2287
|
+
return false;
|
|
2288
|
+
}
|
|
2289
|
+
if (!(existing_defaultHelpText === incoming_defaultHelpText)) {
|
|
2290
|
+
return false;
|
|
2291
|
+
}
|
|
2292
|
+
}
|
|
2293
|
+
const existing_defaultValue = existing.defaultValue;
|
|
2294
|
+
const incoming_defaultValue = incoming.defaultValue;
|
|
2295
|
+
// if at least one of these optionals is defined
|
|
2296
|
+
if (existing_defaultValue !== undefined || incoming_defaultValue !== undefined) {
|
|
2297
|
+
// if one of these is not defined we know the other is defined and therefore
|
|
2298
|
+
// not equal
|
|
2299
|
+
if (existing_defaultValue === undefined || incoming_defaultValue === undefined) {
|
|
2300
|
+
return false;
|
|
2301
|
+
}
|
|
2302
|
+
if (!(existing_defaultValue === incoming_defaultValue)) {
|
|
2303
|
+
return false;
|
|
2304
|
+
}
|
|
2305
|
+
}
|
|
2306
|
+
const existing_description = existing.description;
|
|
2307
|
+
const incoming_description = incoming.description;
|
|
2308
|
+
// if at least one of these optionals is defined
|
|
2309
|
+
if (existing_description !== undefined || incoming_description !== undefined) {
|
|
2310
|
+
// if one of these is not defined we know the other is defined and therefore
|
|
2311
|
+
// not equal
|
|
2312
|
+
if (existing_description === undefined || incoming_description === undefined) {
|
|
2313
|
+
return false;
|
|
2314
|
+
}
|
|
2315
|
+
if (!(existing_description === incoming_description)) {
|
|
2316
|
+
return false;
|
|
2317
|
+
}
|
|
2318
|
+
}
|
|
2319
|
+
const existing_id = existing.id;
|
|
2320
|
+
const incoming_id = incoming.id;
|
|
2321
|
+
// if at least one of these optionals is defined
|
|
2322
|
+
if (existing_id !== undefined || incoming_id !== undefined) {
|
|
2323
|
+
// if one of these is not defined we know the other is defined and therefore
|
|
2324
|
+
// not equal
|
|
2325
|
+
if (existing_id === undefined || incoming_id === undefined) {
|
|
2326
|
+
return false;
|
|
2327
|
+
}
|
|
2328
|
+
if (!(existing_id === incoming_id)) {
|
|
2329
|
+
return false;
|
|
2330
|
+
}
|
|
2331
|
+
}
|
|
2332
|
+
const existing_label = existing.label;
|
|
2333
|
+
const incoming_label = incoming.label;
|
|
2334
|
+
// if at least one of these optionals is defined
|
|
2335
|
+
if (existing_label !== undefined || incoming_label !== undefined) {
|
|
2336
|
+
// if one of these is not defined we know the other is defined and therefore
|
|
2337
|
+
// not equal
|
|
2338
|
+
if (existing_label === undefined || incoming_label === undefined) {
|
|
2339
|
+
return false;
|
|
2340
|
+
}
|
|
2341
|
+
if (!(existing_label === incoming_label)) {
|
|
2342
|
+
return false;
|
|
2343
|
+
}
|
|
2344
|
+
}
|
|
2345
|
+
const existing_name = existing.name;
|
|
2346
|
+
const incoming_name = incoming.name;
|
|
2347
|
+
// if at least one of these optionals is defined
|
|
2348
|
+
if (existing_name !== undefined || incoming_name !== undefined) {
|
|
2349
|
+
// if one of these is not defined we know the other is defined and therefore
|
|
2350
|
+
// not equal
|
|
2351
|
+
if (existing_name === undefined || incoming_name === undefined) {
|
|
2352
|
+
return false;
|
|
2353
|
+
}
|
|
2354
|
+
if (!(existing_name === incoming_name)) {
|
|
2355
|
+
return false;
|
|
2356
|
+
}
|
|
2357
|
+
}
|
|
2358
|
+
const existing_status = existing.status;
|
|
2359
|
+
const incoming_status = incoming.status;
|
|
2360
|
+
// if at least one of these optionals is defined
|
|
2361
|
+
if (existing_status !== undefined || incoming_status !== undefined) {
|
|
2362
|
+
// if one of these is not defined we know the other is defined and therefore
|
|
2363
|
+
// not equal
|
|
2364
|
+
if (existing_status === undefined || incoming_status === undefined) {
|
|
2365
|
+
return false;
|
|
2366
|
+
}
|
|
2367
|
+
if (!(existing_status === incoming_status)) {
|
|
2368
|
+
return false;
|
|
2369
|
+
}
|
|
2370
|
+
}
|
|
2371
|
+
const existing_userValue = existing.userValue;
|
|
2372
|
+
const incoming_userValue = incoming.userValue;
|
|
2373
|
+
// if at least one of these optionals is defined
|
|
2374
|
+
if (existing_userValue !== undefined || incoming_userValue !== undefined) {
|
|
2375
|
+
// if one of these is not defined we know the other is defined and therefore
|
|
2376
|
+
// not equal
|
|
2377
|
+
if (existing_userValue === undefined || incoming_userValue === undefined) {
|
|
2378
|
+
return false;
|
|
2379
|
+
}
|
|
2380
|
+
if (!(existing_userValue === incoming_userValue)) {
|
|
2381
|
+
return false;
|
|
2382
|
+
}
|
|
2383
|
+
}
|
|
2384
|
+
const existing_attributePickList = existing.attributePickList;
|
|
2385
|
+
const incoming_attributePickList = incoming.attributePickList;
|
|
2386
|
+
// if at least one of these optionals is defined
|
|
2387
|
+
if (existing_attributePickList !== undefined || incoming_attributePickList !== undefined) {
|
|
2388
|
+
// if one of these is not defined we know the other is defined and therefore
|
|
2389
|
+
// not equal
|
|
2390
|
+
if (existing_attributePickList === undefined || incoming_attributePickList === undefined) {
|
|
2391
|
+
return false;
|
|
2392
|
+
}
|
|
2393
|
+
if (!(equals$a(existing_attributePickList, incoming_attributePickList))) {
|
|
2394
|
+
return false;
|
|
2395
|
+
}
|
|
2396
|
+
}
|
|
2397
|
+
return true;
|
|
2398
|
+
}
|
|
2399
|
+
|
|
2400
|
+
const VERSION$8 = "63ca2614b6879bfb4df068438d7e78ec";
|
|
2401
|
+
function validate$e(obj, path = 'AttributeCategoryOutputRepresentation') {
|
|
2402
|
+
const v_error = (() => {
|
|
2403
|
+
if (typeof obj !== 'object' || ArrayIsArray(obj) || obj === null) {
|
|
2404
|
+
return new TypeError('Expected "object" but received "' + typeof obj + '" (at "' + path + '")');
|
|
2405
|
+
}
|
|
2406
|
+
if (obj.code !== undefined) {
|
|
2407
|
+
const obj_code = obj.code;
|
|
2408
|
+
const path_code = path + '.code';
|
|
2409
|
+
if (typeof obj_code !== 'string') {
|
|
2410
|
+
return new TypeError('Expected "string" but received "' + typeof obj_code + '" (at "' + path_code + '")');
|
|
2411
|
+
}
|
|
2412
|
+
}
|
|
2413
|
+
if (obj.description !== undefined) {
|
|
2414
|
+
const obj_description = obj.description;
|
|
2415
|
+
const path_description = path + '.description';
|
|
2416
|
+
if (typeof obj_description !== 'string') {
|
|
2417
|
+
return new TypeError('Expected "string" but received "' + typeof obj_description + '" (at "' + path_description + '")');
|
|
2418
|
+
}
|
|
2419
|
+
}
|
|
2420
|
+
if (obj.id !== undefined) {
|
|
2421
|
+
const obj_id = obj.id;
|
|
2422
|
+
const path_id = path + '.id';
|
|
2423
|
+
if (typeof obj_id !== 'string') {
|
|
2424
|
+
return new TypeError('Expected "string" but received "' + typeof obj_id + '" (at "' + path_id + '")');
|
|
2425
|
+
}
|
|
2426
|
+
}
|
|
2427
|
+
if (obj.name !== undefined) {
|
|
2428
|
+
const obj_name = obj.name;
|
|
2429
|
+
const path_name = path + '.name';
|
|
2430
|
+
if (typeof obj_name !== 'string') {
|
|
2431
|
+
return new TypeError('Expected "string" but received "' + typeof obj_name + '" (at "' + path_name + '")');
|
|
2432
|
+
}
|
|
2433
|
+
}
|
|
2434
|
+
if (obj.records !== undefined) {
|
|
2435
|
+
const obj_records = obj.records;
|
|
2436
|
+
const path_records = path + '.records';
|
|
2437
|
+
if (!ArrayIsArray(obj_records)) {
|
|
2438
|
+
return new TypeError('Expected "array" but received "' + typeof obj_records + '" (at "' + path_records + '")');
|
|
2439
|
+
}
|
|
2440
|
+
for (let i = 0; i < obj_records.length; i++) {
|
|
2441
|
+
const obj_records_item = obj_records[i];
|
|
2442
|
+
const path_records_item = path_records + '[' + i + ']';
|
|
2443
|
+
const referencepath_records_itemValidationError = validate$f(obj_records_item, path_records_item);
|
|
2444
|
+
if (referencepath_records_itemValidationError !== null) {
|
|
2445
|
+
let message = 'Object doesn\'t match ProductAttributeOutputRepresentation (at "' + path_records_item + '")\n';
|
|
2446
|
+
message += referencepath_records_itemValidationError.message.split('\n').map((line) => '\t' + line).join('\n');
|
|
2447
|
+
return new TypeError(message);
|
|
2448
|
+
}
|
|
2449
|
+
}
|
|
2450
|
+
}
|
|
2451
|
+
if (obj.status !== undefined) {
|
|
2452
|
+
const obj_status = obj.status;
|
|
2453
|
+
const path_status = path + '.status';
|
|
2454
|
+
if (typeof obj_status !== 'string') {
|
|
2455
|
+
return new TypeError('Expected "string" but received "' + typeof obj_status + '" (at "' + path_status + '")');
|
|
2456
|
+
}
|
|
2457
|
+
}
|
|
2458
|
+
if (obj.totalSize !== undefined) {
|
|
2459
|
+
const obj_totalSize = obj.totalSize;
|
|
2460
|
+
const path_totalSize = path + '.totalSize';
|
|
2461
|
+
if (typeof obj_totalSize !== 'number' || (typeof obj_totalSize === 'number' && Math.floor(obj_totalSize) !== obj_totalSize)) {
|
|
2462
|
+
return new TypeError('Expected "integer" but received "' + typeof obj_totalSize + '" (at "' + path_totalSize + '")');
|
|
2463
|
+
}
|
|
2464
|
+
}
|
|
2465
|
+
if (obj.usageType !== undefined) {
|
|
2466
|
+
const obj_usageType = obj.usageType;
|
|
2467
|
+
const path_usageType = path + '.usageType';
|
|
2468
|
+
if (typeof obj_usageType !== 'string') {
|
|
2469
|
+
return new TypeError('Expected "string" but received "' + typeof obj_usageType + '" (at "' + path_usageType + '")');
|
|
2470
|
+
}
|
|
2471
|
+
}
|
|
2472
|
+
})();
|
|
2473
|
+
return v_error === undefined ? null : v_error;
|
|
2474
|
+
}
|
|
2475
|
+
const select$d = function AttributeCategoryOutputRepresentationSelect() {
|
|
2476
|
+
const { selections: ProductAttributeOutputRepresentation__selections, opaque: ProductAttributeOutputRepresentation__opaque, } = select$e();
|
|
2477
|
+
return {
|
|
2478
|
+
kind: 'Fragment',
|
|
2479
|
+
version: VERSION$8,
|
|
2480
|
+
private: [],
|
|
2481
|
+
selections: [
|
|
2482
|
+
{
|
|
2483
|
+
name: 'code',
|
|
2484
|
+
kind: 'Scalar',
|
|
2485
|
+
required: false
|
|
2486
|
+
},
|
|
2487
|
+
{
|
|
2488
|
+
name: 'description',
|
|
2489
|
+
kind: 'Scalar',
|
|
2490
|
+
required: false
|
|
2491
|
+
},
|
|
2492
|
+
{
|
|
2493
|
+
name: 'id',
|
|
2494
|
+
kind: 'Scalar',
|
|
2495
|
+
required: false
|
|
2496
|
+
},
|
|
2497
|
+
{
|
|
2498
|
+
name: 'name',
|
|
2499
|
+
kind: 'Scalar',
|
|
2500
|
+
required: false
|
|
2501
|
+
},
|
|
2502
|
+
{
|
|
2503
|
+
name: 'records',
|
|
2504
|
+
kind: 'Object',
|
|
2505
|
+
plural: true,
|
|
2506
|
+
selections: ProductAttributeOutputRepresentation__selections,
|
|
2507
|
+
required: false
|
|
2508
|
+
},
|
|
2509
|
+
{
|
|
2510
|
+
name: 'status',
|
|
2511
|
+
kind: 'Scalar',
|
|
2512
|
+
required: false
|
|
2513
|
+
},
|
|
2514
|
+
{
|
|
2515
|
+
name: 'totalSize',
|
|
2516
|
+
kind: 'Scalar',
|
|
2517
|
+
required: false
|
|
2518
|
+
},
|
|
2519
|
+
{
|
|
2520
|
+
name: 'usageType',
|
|
2521
|
+
kind: 'Scalar',
|
|
2522
|
+
required: false
|
|
2523
|
+
}
|
|
2524
|
+
]
|
|
2525
|
+
};
|
|
2526
|
+
};
|
|
2527
|
+
function equals$8(existing, incoming) {
|
|
2528
|
+
const existing_totalSize = existing.totalSize;
|
|
2529
|
+
const incoming_totalSize = incoming.totalSize;
|
|
2530
|
+
// if at least one of these optionals is defined
|
|
2531
|
+
if (existing_totalSize !== undefined || incoming_totalSize !== undefined) {
|
|
2532
|
+
// if one of these is not defined we know the other is defined and therefore
|
|
2533
|
+
// not equal
|
|
2534
|
+
if (existing_totalSize === undefined || incoming_totalSize === undefined) {
|
|
2535
|
+
return false;
|
|
2536
|
+
}
|
|
2537
|
+
if (!(existing_totalSize === incoming_totalSize)) {
|
|
2538
|
+
return false;
|
|
2539
|
+
}
|
|
2540
|
+
}
|
|
2541
|
+
const existing_code = existing.code;
|
|
2542
|
+
const incoming_code = incoming.code;
|
|
2543
|
+
// if at least one of these optionals is defined
|
|
2544
|
+
if (existing_code !== undefined || incoming_code !== undefined) {
|
|
2545
|
+
// if one of these is not defined we know the other is defined and therefore
|
|
2546
|
+
// not equal
|
|
2547
|
+
if (existing_code === undefined || incoming_code === undefined) {
|
|
2548
|
+
return false;
|
|
2549
|
+
}
|
|
2550
|
+
if (!(existing_code === incoming_code)) {
|
|
2551
|
+
return false;
|
|
2552
|
+
}
|
|
2553
|
+
}
|
|
2554
|
+
const existing_description = existing.description;
|
|
2555
|
+
const incoming_description = incoming.description;
|
|
2556
|
+
// if at least one of these optionals is defined
|
|
2557
|
+
if (existing_description !== undefined || incoming_description !== undefined) {
|
|
2558
|
+
// if one of these is not defined we know the other is defined and therefore
|
|
2559
|
+
// not equal
|
|
2560
|
+
if (existing_description === undefined || incoming_description === undefined) {
|
|
2561
|
+
return false;
|
|
2562
|
+
}
|
|
2563
|
+
if (!(existing_description === incoming_description)) {
|
|
2564
|
+
return false;
|
|
2565
|
+
}
|
|
2566
|
+
}
|
|
2567
|
+
const existing_id = existing.id;
|
|
2568
|
+
const incoming_id = incoming.id;
|
|
2569
|
+
// if at least one of these optionals is defined
|
|
2570
|
+
if (existing_id !== undefined || incoming_id !== undefined) {
|
|
2571
|
+
// if one of these is not defined we know the other is defined and therefore
|
|
2572
|
+
// not equal
|
|
2573
|
+
if (existing_id === undefined || incoming_id === undefined) {
|
|
2574
|
+
return false;
|
|
2575
|
+
}
|
|
2576
|
+
if (!(existing_id === incoming_id)) {
|
|
2577
|
+
return false;
|
|
2578
|
+
}
|
|
2579
|
+
}
|
|
2580
|
+
const existing_name = existing.name;
|
|
2581
|
+
const incoming_name = incoming.name;
|
|
2582
|
+
// if at least one of these optionals is defined
|
|
2583
|
+
if (existing_name !== undefined || incoming_name !== undefined) {
|
|
2584
|
+
// if one of these is not defined we know the other is defined and therefore
|
|
2585
|
+
// not equal
|
|
2586
|
+
if (existing_name === undefined || incoming_name === undefined) {
|
|
2587
|
+
return false;
|
|
2588
|
+
}
|
|
2589
|
+
if (!(existing_name === incoming_name)) {
|
|
2590
|
+
return false;
|
|
2591
|
+
}
|
|
2592
|
+
}
|
|
2593
|
+
const existing_status = existing.status;
|
|
2594
|
+
const incoming_status = incoming.status;
|
|
2595
|
+
// if at least one of these optionals is defined
|
|
2596
|
+
if (existing_status !== undefined || incoming_status !== undefined) {
|
|
2597
|
+
// if one of these is not defined we know the other is defined and therefore
|
|
2598
|
+
// not equal
|
|
2599
|
+
if (existing_status === undefined || incoming_status === undefined) {
|
|
2600
|
+
return false;
|
|
2601
|
+
}
|
|
2602
|
+
if (!(existing_status === incoming_status)) {
|
|
2603
|
+
return false;
|
|
2604
|
+
}
|
|
2605
|
+
}
|
|
2606
|
+
const existing_usageType = existing.usageType;
|
|
2607
|
+
const incoming_usageType = incoming.usageType;
|
|
2608
|
+
// if at least one of these optionals is defined
|
|
2609
|
+
if (existing_usageType !== undefined || incoming_usageType !== undefined) {
|
|
2610
|
+
// if one of these is not defined we know the other is defined and therefore
|
|
2611
|
+
// not equal
|
|
2612
|
+
if (existing_usageType === undefined || incoming_usageType === undefined) {
|
|
2613
|
+
return false;
|
|
2614
|
+
}
|
|
2615
|
+
if (!(existing_usageType === incoming_usageType)) {
|
|
2616
|
+
return false;
|
|
2617
|
+
}
|
|
2618
|
+
}
|
|
2619
|
+
const existing_records = existing.records;
|
|
2620
|
+
const incoming_records = incoming.records;
|
|
2621
|
+
// if at least one of these optionals is defined
|
|
2622
|
+
if (existing_records !== undefined || incoming_records !== undefined) {
|
|
2623
|
+
// if one of these is not defined we know the other is defined and therefore
|
|
2624
|
+
// not equal
|
|
2625
|
+
if (existing_records === undefined || incoming_records === undefined) {
|
|
2626
|
+
return false;
|
|
2627
|
+
}
|
|
2628
|
+
const equals_records_items = equalsArray(existing_records, incoming_records, (existing_records_item, incoming_records_item) => {
|
|
2629
|
+
if (!(equals$9(existing_records_item, incoming_records_item))) {
|
|
2630
|
+
return false;
|
|
2631
|
+
}
|
|
2632
|
+
});
|
|
2633
|
+
if (equals_records_items === false) {
|
|
2634
|
+
return false;
|
|
2635
|
+
}
|
|
2636
|
+
}
|
|
2637
|
+
return true;
|
|
2638
|
+
}
|
|
2639
|
+
|
|
2640
|
+
const VERSION$7 = "a59ef129f333de8bbfe140f39144b415";
|
|
2641
|
+
function validate$d(obj, path = 'CartItemOutputRepresentation') {
|
|
2642
|
+
const v_error = (() => {
|
|
2643
|
+
if (typeof obj !== 'object' || ArrayIsArray(obj) || obj === null) {
|
|
2644
|
+
return new TypeError('Expected "object" but received "' + typeof obj + '" (at "' + path + '")');
|
|
2645
|
+
}
|
|
2646
|
+
if (obj.attributeCategories !== undefined) {
|
|
2647
|
+
const obj_attributeCategories = obj.attributeCategories;
|
|
2648
|
+
const path_attributeCategories = path + '.attributeCategories';
|
|
2649
|
+
if (!ArrayIsArray(obj_attributeCategories)) {
|
|
2650
|
+
return new TypeError('Expected "array" but received "' + typeof obj_attributeCategories + '" (at "' + path_attributeCategories + '")');
|
|
2651
|
+
}
|
|
2652
|
+
for (let i = 0; i < obj_attributeCategories.length; i++) {
|
|
2653
|
+
const obj_attributeCategories_item = obj_attributeCategories[i];
|
|
2654
|
+
const path_attributeCategories_item = path_attributeCategories + '[' + i + ']';
|
|
2655
|
+
const referencepath_attributeCategories_itemValidationError = validate$e(obj_attributeCategories_item, path_attributeCategories_item);
|
|
2656
|
+
if (referencepath_attributeCategories_itemValidationError !== null) {
|
|
2657
|
+
let message = 'Object doesn\'t match AttributeCategoryOutputRepresentation (at "' + path_attributeCategories_item + '")\n';
|
|
2658
|
+
message += referencepath_attributeCategories_itemValidationError.message.split('\n').map((line) => '\t' + line).join('\n');
|
|
2659
|
+
return new TypeError(message);
|
|
2660
|
+
}
|
|
2661
|
+
}
|
|
2662
|
+
}
|
|
2663
|
+
if (obj.attributes !== undefined) {
|
|
2664
|
+
const obj_attributes = obj.attributes;
|
|
2665
|
+
const path_attributes = path + '.attributes';
|
|
2666
|
+
if (!ArrayIsArray(obj_attributes)) {
|
|
2667
|
+
return new TypeError('Expected "array" but received "' + typeof obj_attributes + '" (at "' + path_attributes + '")');
|
|
2668
|
+
}
|
|
2669
|
+
for (let i = 0; i < obj_attributes.length; i++) {
|
|
2670
|
+
const obj_attributes_item = obj_attributes[i];
|
|
2671
|
+
const path_attributes_item = path_attributes + '[' + i + ']';
|
|
2672
|
+
const referencepath_attributes_itemValidationError = validate$f(obj_attributes_item, path_attributes_item);
|
|
2673
|
+
if (referencepath_attributes_itemValidationError !== null) {
|
|
2674
|
+
let message = 'Object doesn\'t match ProductAttributeOutputRepresentation (at "' + path_attributes_item + '")\n';
|
|
2675
|
+
message += referencepath_attributes_itemValidationError.message.split('\n').map((line) => '\t' + line).join('\n');
|
|
2676
|
+
return new TypeError(message);
|
|
2677
|
+
}
|
|
2678
|
+
}
|
|
2679
|
+
}
|
|
2680
|
+
if (obj.cartItemId !== undefined) {
|
|
2681
|
+
const obj_cartItemId = obj.cartItemId;
|
|
2682
|
+
const path_cartItemId = path + '.cartItemId';
|
|
2683
|
+
if (typeof obj_cartItemId !== 'string') {
|
|
2684
|
+
return new TypeError('Expected "string" but received "' + typeof obj_cartItemId + '" (at "' + path_cartItemId + '")');
|
|
2685
|
+
}
|
|
2686
|
+
}
|
|
2687
|
+
if (obj.displayName !== undefined) {
|
|
2688
|
+
const obj_displayName = obj.displayName;
|
|
2689
|
+
const path_displayName = path + '.displayName';
|
|
2690
|
+
if (typeof obj_displayName !== 'string') {
|
|
2691
|
+
return new TypeError('Expected "string" but received "' + typeof obj_displayName + '" (at "' + path_displayName + '")');
|
|
2692
|
+
}
|
|
2693
|
+
}
|
|
2694
|
+
if (obj.name !== undefined) {
|
|
2695
|
+
const obj_name = obj.name;
|
|
2696
|
+
const path_name = path + '.name';
|
|
2697
|
+
if (typeof obj_name !== 'string') {
|
|
2698
|
+
return new TypeError('Expected "string" but received "' + typeof obj_name + '" (at "' + path_name + '")');
|
|
2699
|
+
}
|
|
2700
|
+
}
|
|
2701
|
+
if (obj.netUnitPrice !== undefined) {
|
|
2702
|
+
obj.netUnitPrice;
|
|
2703
|
+
}
|
|
2704
|
+
if (obj.priceWaterFall !== undefined) {
|
|
2705
|
+
const obj_priceWaterFall = obj.priceWaterFall;
|
|
2706
|
+
const path_priceWaterFall = path + '.priceWaterFall';
|
|
2707
|
+
if (typeof obj_priceWaterFall !== 'string') {
|
|
2708
|
+
return new TypeError('Expected "string" but received "' + typeof obj_priceWaterFall + '" (at "' + path_priceWaterFall + '")');
|
|
2709
|
+
}
|
|
2710
|
+
}
|
|
2711
|
+
if (obj.productCode !== undefined) {
|
|
2712
|
+
const obj_productCode = obj.productCode;
|
|
2713
|
+
const path_productCode = path + '.productCode';
|
|
2714
|
+
if (typeof obj_productCode !== 'string') {
|
|
2715
|
+
return new TypeError('Expected "string" but received "' + typeof obj_productCode + '" (at "' + path_productCode + '")');
|
|
2716
|
+
}
|
|
2717
|
+
}
|
|
2718
|
+
if (obj.productId !== undefined) {
|
|
2719
|
+
const obj_productId = obj.productId;
|
|
2720
|
+
const path_productId = path + '.productId';
|
|
2721
|
+
if (typeof obj_productId !== 'string') {
|
|
2722
|
+
return new TypeError('Expected "string" but received "' + typeof obj_productId + '" (at "' + path_productId + '")');
|
|
2723
|
+
}
|
|
2724
|
+
}
|
|
2725
|
+
if (obj.quantity !== undefined) {
|
|
2726
|
+
obj.quantity;
|
|
2727
|
+
}
|
|
2728
|
+
if (obj.unitPrice !== undefined) {
|
|
2729
|
+
obj.unitPrice;
|
|
2730
|
+
}
|
|
2731
|
+
})();
|
|
2732
|
+
return v_error === undefined ? null : v_error;
|
|
2733
|
+
}
|
|
2734
|
+
const select$c = function CartItemOutputRepresentationSelect() {
|
|
2735
|
+
const { selections: AttributeCategoryOutputRepresentation__selections, opaque: AttributeCategoryOutputRepresentation__opaque, } = select$d();
|
|
2736
|
+
const { selections: ProductAttributeOutputRepresentation__selections, opaque: ProductAttributeOutputRepresentation__opaque, } = select$e();
|
|
2737
|
+
return {
|
|
2738
|
+
kind: 'Fragment',
|
|
2739
|
+
version: VERSION$7,
|
|
2740
|
+
private: [],
|
|
2741
|
+
selections: [
|
|
2742
|
+
{
|
|
2743
|
+
name: 'attributeCategories',
|
|
2744
|
+
kind: 'Object',
|
|
2745
|
+
plural: true,
|
|
2746
|
+
selections: AttributeCategoryOutputRepresentation__selections,
|
|
2747
|
+
required: false
|
|
2748
|
+
},
|
|
2749
|
+
{
|
|
2750
|
+
name: 'attributes',
|
|
2751
|
+
kind: 'Object',
|
|
2752
|
+
plural: true,
|
|
2753
|
+
selections: ProductAttributeOutputRepresentation__selections,
|
|
2754
|
+
required: false
|
|
2755
|
+
},
|
|
2756
|
+
{
|
|
2757
|
+
name: 'cartItemId',
|
|
2758
|
+
kind: 'Scalar',
|
|
2759
|
+
required: false
|
|
2760
|
+
},
|
|
2761
|
+
{
|
|
2762
|
+
name: 'displayName',
|
|
2763
|
+
kind: 'Scalar',
|
|
2764
|
+
required: false
|
|
2765
|
+
},
|
|
2766
|
+
{
|
|
2767
|
+
name: 'name',
|
|
2768
|
+
kind: 'Scalar',
|
|
2769
|
+
required: false
|
|
2770
|
+
},
|
|
2771
|
+
{
|
|
2772
|
+
name: 'netUnitPrice',
|
|
2773
|
+
kind: 'Scalar',
|
|
2774
|
+
required: false
|
|
2775
|
+
},
|
|
2776
|
+
{
|
|
2777
|
+
name: 'priceWaterFall',
|
|
2778
|
+
kind: 'Scalar',
|
|
2779
|
+
required: false
|
|
2780
|
+
},
|
|
2781
|
+
{
|
|
2782
|
+
name: 'productCode',
|
|
2783
|
+
kind: 'Scalar',
|
|
2784
|
+
required: false
|
|
2785
|
+
},
|
|
2786
|
+
{
|
|
2787
|
+
name: 'productId',
|
|
2788
|
+
kind: 'Scalar',
|
|
2789
|
+
required: false
|
|
2790
|
+
},
|
|
2791
|
+
{
|
|
2792
|
+
name: 'quantity',
|
|
2793
|
+
kind: 'Scalar',
|
|
2794
|
+
required: false
|
|
2795
|
+
},
|
|
2796
|
+
{
|
|
2797
|
+
name: 'unitPrice',
|
|
2798
|
+
kind: 'Scalar',
|
|
2799
|
+
required: false
|
|
2800
|
+
}
|
|
2801
|
+
]
|
|
2802
|
+
};
|
|
2803
|
+
};
|
|
2804
|
+
function equals$7(existing, incoming) {
|
|
2805
|
+
const existing_cartItemId = existing.cartItemId;
|
|
2806
|
+
const incoming_cartItemId = incoming.cartItemId;
|
|
2807
|
+
// if at least one of these optionals is defined
|
|
2808
|
+
if (existing_cartItemId !== undefined || incoming_cartItemId !== undefined) {
|
|
2809
|
+
// if one of these is not defined we know the other is defined and therefore
|
|
2810
|
+
// not equal
|
|
2811
|
+
if (existing_cartItemId === undefined || incoming_cartItemId === undefined) {
|
|
2812
|
+
return false;
|
|
2813
|
+
}
|
|
2814
|
+
if (!(existing_cartItemId === incoming_cartItemId)) {
|
|
2815
|
+
return false;
|
|
2816
|
+
}
|
|
2817
|
+
}
|
|
2818
|
+
const existing_displayName = existing.displayName;
|
|
2819
|
+
const incoming_displayName = incoming.displayName;
|
|
2820
|
+
// if at least one of these optionals is defined
|
|
2821
|
+
if (existing_displayName !== undefined || incoming_displayName !== undefined) {
|
|
2822
|
+
// if one of these is not defined we know the other is defined and therefore
|
|
2823
|
+
// not equal
|
|
2824
|
+
if (existing_displayName === undefined || incoming_displayName === undefined) {
|
|
2825
|
+
return false;
|
|
2826
|
+
}
|
|
2827
|
+
if (!(existing_displayName === incoming_displayName)) {
|
|
2828
|
+
return false;
|
|
2829
|
+
}
|
|
2830
|
+
}
|
|
2831
|
+
const existing_name = existing.name;
|
|
2832
|
+
const incoming_name = incoming.name;
|
|
2833
|
+
// if at least one of these optionals is defined
|
|
2834
|
+
if (existing_name !== undefined || incoming_name !== undefined) {
|
|
2835
|
+
// if one of these is not defined we know the other is defined and therefore
|
|
2836
|
+
// not equal
|
|
2837
|
+
if (existing_name === undefined || incoming_name === undefined) {
|
|
2838
|
+
return false;
|
|
2839
|
+
}
|
|
2840
|
+
if (!(existing_name === incoming_name)) {
|
|
2841
|
+
return false;
|
|
2842
|
+
}
|
|
2843
|
+
}
|
|
2844
|
+
const existing_priceWaterFall = existing.priceWaterFall;
|
|
2845
|
+
const incoming_priceWaterFall = incoming.priceWaterFall;
|
|
2846
|
+
// if at least one of these optionals is defined
|
|
2847
|
+
if (existing_priceWaterFall !== undefined || incoming_priceWaterFall !== undefined) {
|
|
2848
|
+
// if one of these is not defined we know the other is defined and therefore
|
|
2849
|
+
// not equal
|
|
2850
|
+
if (existing_priceWaterFall === undefined || incoming_priceWaterFall === undefined) {
|
|
2851
|
+
return false;
|
|
2852
|
+
}
|
|
2853
|
+
if (!(existing_priceWaterFall === incoming_priceWaterFall)) {
|
|
2854
|
+
return false;
|
|
2855
|
+
}
|
|
2856
|
+
}
|
|
2857
|
+
const existing_productCode = existing.productCode;
|
|
2858
|
+
const incoming_productCode = incoming.productCode;
|
|
2859
|
+
// if at least one of these optionals is defined
|
|
2860
|
+
if (existing_productCode !== undefined || incoming_productCode !== undefined) {
|
|
2861
|
+
// if one of these is not defined we know the other is defined and therefore
|
|
2862
|
+
// not equal
|
|
2863
|
+
if (existing_productCode === undefined || incoming_productCode === undefined) {
|
|
2864
|
+
return false;
|
|
2865
|
+
}
|
|
2866
|
+
if (!(existing_productCode === incoming_productCode)) {
|
|
2867
|
+
return false;
|
|
2868
|
+
}
|
|
2869
|
+
}
|
|
2870
|
+
const existing_productId = existing.productId;
|
|
2871
|
+
const incoming_productId = incoming.productId;
|
|
2872
|
+
// if at least one of these optionals is defined
|
|
2873
|
+
if (existing_productId !== undefined || incoming_productId !== undefined) {
|
|
2874
|
+
// if one of these is not defined we know the other is defined and therefore
|
|
2875
|
+
// not equal
|
|
2876
|
+
if (existing_productId === undefined || incoming_productId === undefined) {
|
|
2877
|
+
return false;
|
|
2878
|
+
}
|
|
2879
|
+
if (!(existing_productId === incoming_productId)) {
|
|
2880
|
+
return false;
|
|
2881
|
+
}
|
|
2882
|
+
}
|
|
2883
|
+
const existing_netUnitPrice = existing.netUnitPrice;
|
|
2884
|
+
const incoming_netUnitPrice = incoming.netUnitPrice;
|
|
2885
|
+
// if at least one of these optionals is defined
|
|
2886
|
+
if (existing_netUnitPrice !== undefined || incoming_netUnitPrice !== undefined) {
|
|
2887
|
+
// if one of these is not defined we know the other is defined and therefore
|
|
2888
|
+
// not equal
|
|
2889
|
+
if (existing_netUnitPrice === undefined || incoming_netUnitPrice === undefined) {
|
|
2890
|
+
return false;
|
|
2891
|
+
}
|
|
2892
|
+
if (!(existing_netUnitPrice === incoming_netUnitPrice)) {
|
|
2893
|
+
return false;
|
|
2894
|
+
}
|
|
2895
|
+
}
|
|
2896
|
+
const existing_quantity = existing.quantity;
|
|
2897
|
+
const incoming_quantity = incoming.quantity;
|
|
2898
|
+
// if at least one of these optionals is defined
|
|
2899
|
+
if (existing_quantity !== undefined || incoming_quantity !== undefined) {
|
|
2900
|
+
// if one of these is not defined we know the other is defined and therefore
|
|
2901
|
+
// not equal
|
|
2902
|
+
if (existing_quantity === undefined || incoming_quantity === undefined) {
|
|
2903
|
+
return false;
|
|
2904
|
+
}
|
|
2905
|
+
if (!(existing_quantity === incoming_quantity)) {
|
|
2906
|
+
return false;
|
|
2907
|
+
}
|
|
2908
|
+
}
|
|
2909
|
+
const existing_unitPrice = existing.unitPrice;
|
|
2910
|
+
const incoming_unitPrice = incoming.unitPrice;
|
|
2911
|
+
// if at least one of these optionals is defined
|
|
2912
|
+
if (existing_unitPrice !== undefined || incoming_unitPrice !== undefined) {
|
|
2913
|
+
// if one of these is not defined we know the other is defined and therefore
|
|
2914
|
+
// not equal
|
|
2915
|
+
if (existing_unitPrice === undefined || incoming_unitPrice === undefined) {
|
|
2916
|
+
return false;
|
|
2917
|
+
}
|
|
2918
|
+
if (!(existing_unitPrice === incoming_unitPrice)) {
|
|
2919
|
+
return false;
|
|
2920
|
+
}
|
|
2921
|
+
}
|
|
2922
|
+
const existing_attributeCategories = existing.attributeCategories;
|
|
2923
|
+
const incoming_attributeCategories = incoming.attributeCategories;
|
|
2924
|
+
// if at least one of these optionals is defined
|
|
2925
|
+
if (existing_attributeCategories !== undefined || incoming_attributeCategories !== undefined) {
|
|
2926
|
+
// if one of these is not defined we know the other is defined and therefore
|
|
2927
|
+
// not equal
|
|
2928
|
+
if (existing_attributeCategories === undefined || incoming_attributeCategories === undefined) {
|
|
2929
|
+
return false;
|
|
2930
|
+
}
|
|
2931
|
+
const equals_attributeCategories_items = equalsArray(existing_attributeCategories, incoming_attributeCategories, (existing_attributeCategories_item, incoming_attributeCategories_item) => {
|
|
2932
|
+
if (!(equals$8(existing_attributeCategories_item, incoming_attributeCategories_item))) {
|
|
2933
|
+
return false;
|
|
2934
|
+
}
|
|
2935
|
+
});
|
|
2936
|
+
if (equals_attributeCategories_items === false) {
|
|
2937
|
+
return false;
|
|
2938
|
+
}
|
|
2939
|
+
}
|
|
2940
|
+
const existing_attributes = existing.attributes;
|
|
2941
|
+
const incoming_attributes = incoming.attributes;
|
|
2942
|
+
// if at least one of these optionals is defined
|
|
2943
|
+
if (existing_attributes !== undefined || incoming_attributes !== undefined) {
|
|
2944
|
+
// if one of these is not defined we know the other is defined and therefore
|
|
2945
|
+
// not equal
|
|
2946
|
+
if (existing_attributes === undefined || incoming_attributes === undefined) {
|
|
2947
|
+
return false;
|
|
2948
|
+
}
|
|
2949
|
+
const equals_attributes_items = equalsArray(existing_attributes, incoming_attributes, (existing_attributes_item, incoming_attributes_item) => {
|
|
2950
|
+
if (!(equals$9(existing_attributes_item, incoming_attributes_item))) {
|
|
2951
|
+
return false;
|
|
2952
|
+
}
|
|
2953
|
+
});
|
|
2954
|
+
if (equals_attributes_items === false) {
|
|
2955
|
+
return false;
|
|
2956
|
+
}
|
|
2957
|
+
}
|
|
2958
|
+
return true;
|
|
2959
|
+
}
|
|
2960
|
+
|
|
2961
|
+
const VERSION$6 = "dbbe0e43dcf8f1d5334798bb12acca37";
|
|
2962
|
+
function validate$c(obj, path = 'CartItemsOutputRepresentation') {
|
|
2963
|
+
const v_error = (() => {
|
|
2964
|
+
if (typeof obj !== 'object' || ArrayIsArray(obj) || obj === null) {
|
|
2965
|
+
return new TypeError('Expected "object" but received "' + typeof obj + '" (at "' + path + '")');
|
|
2966
|
+
}
|
|
2967
|
+
if (obj.records !== undefined) {
|
|
2968
|
+
const obj_records = obj.records;
|
|
2969
|
+
const path_records = path + '.records';
|
|
2970
|
+
if (!ArrayIsArray(obj_records)) {
|
|
2971
|
+
return new TypeError('Expected "array" but received "' + typeof obj_records + '" (at "' + path_records + '")');
|
|
2972
|
+
}
|
|
2973
|
+
for (let i = 0; i < obj_records.length; i++) {
|
|
2974
|
+
const obj_records_item = obj_records[i];
|
|
2975
|
+
const path_records_item = path_records + '[' + i + ']';
|
|
2976
|
+
const referencepath_records_itemValidationError = validate$d(obj_records_item, path_records_item);
|
|
2977
|
+
if (referencepath_records_itemValidationError !== null) {
|
|
2978
|
+
let message = 'Object doesn\'t match CartItemOutputRepresentation (at "' + path_records_item + '")\n';
|
|
2979
|
+
message += referencepath_records_itemValidationError.message.split('\n').map((line) => '\t' + line).join('\n');
|
|
2980
|
+
return new TypeError(message);
|
|
2981
|
+
}
|
|
2982
|
+
}
|
|
2983
|
+
}
|
|
2984
|
+
if (obj.totalSize !== undefined) {
|
|
2985
|
+
const obj_totalSize = obj.totalSize;
|
|
2986
|
+
const path_totalSize = path + '.totalSize';
|
|
2987
|
+
if (typeof obj_totalSize !== 'number' || (typeof obj_totalSize === 'number' && Math.floor(obj_totalSize) !== obj_totalSize)) {
|
|
2988
|
+
return new TypeError('Expected "integer" but received "' + typeof obj_totalSize + '" (at "' + path_totalSize + '")');
|
|
2989
|
+
}
|
|
2990
|
+
}
|
|
2991
|
+
})();
|
|
2992
|
+
return v_error === undefined ? null : v_error;
|
|
2993
|
+
}
|
|
2994
|
+
const select$b = function CartItemsOutputRepresentationSelect() {
|
|
2995
|
+
const { selections: CartItemOutputRepresentation__selections, opaque: CartItemOutputRepresentation__opaque, } = select$c();
|
|
2996
|
+
return {
|
|
2997
|
+
kind: 'Fragment',
|
|
2998
|
+
version: VERSION$6,
|
|
2999
|
+
private: [],
|
|
3000
|
+
selections: [
|
|
3001
|
+
{
|
|
3002
|
+
name: 'records',
|
|
3003
|
+
kind: 'Object',
|
|
3004
|
+
plural: true,
|
|
3005
|
+
selections: CartItemOutputRepresentation__selections,
|
|
3006
|
+
required: false
|
|
3007
|
+
},
|
|
3008
|
+
{
|
|
3009
|
+
name: 'totalSize',
|
|
3010
|
+
kind: 'Scalar',
|
|
3011
|
+
required: false
|
|
3012
|
+
}
|
|
3013
|
+
]
|
|
3014
|
+
};
|
|
3015
|
+
};
|
|
3016
|
+
function equals$6(existing, incoming) {
|
|
3017
|
+
const existing_totalSize = existing.totalSize;
|
|
3018
|
+
const incoming_totalSize = incoming.totalSize;
|
|
3019
|
+
// if at least one of these optionals is defined
|
|
3020
|
+
if (existing_totalSize !== undefined || incoming_totalSize !== undefined) {
|
|
3021
|
+
// if one of these is not defined we know the other is defined and therefore
|
|
3022
|
+
// not equal
|
|
3023
|
+
if (existing_totalSize === undefined || incoming_totalSize === undefined) {
|
|
3024
|
+
return false;
|
|
3025
|
+
}
|
|
3026
|
+
if (!(existing_totalSize === incoming_totalSize)) {
|
|
3027
|
+
return false;
|
|
3028
|
+
}
|
|
3029
|
+
}
|
|
3030
|
+
const existing_records = existing.records;
|
|
3031
|
+
const incoming_records = incoming.records;
|
|
3032
|
+
// if at least one of these optionals is defined
|
|
3033
|
+
if (existing_records !== undefined || incoming_records !== undefined) {
|
|
3034
|
+
// if one of these is not defined we know the other is defined and therefore
|
|
3035
|
+
// not equal
|
|
3036
|
+
if (existing_records === undefined || incoming_records === undefined) {
|
|
3037
|
+
return false;
|
|
3038
|
+
}
|
|
3039
|
+
const equals_records_items = equalsArray(existing_records, incoming_records, (existing_records_item, incoming_records_item) => {
|
|
3040
|
+
if (!(equals$7(existing_records_item, incoming_records_item))) {
|
|
3041
|
+
return false;
|
|
3042
|
+
}
|
|
3043
|
+
});
|
|
3044
|
+
if (equals_records_items === false) {
|
|
3045
|
+
return false;
|
|
3046
|
+
}
|
|
3047
|
+
}
|
|
3048
|
+
return true;
|
|
3049
|
+
}
|
|
3050
|
+
|
|
3051
|
+
const VERSION$5 = "ce1e52694d8508b2f5239ba28287dc1e";
|
|
3052
|
+
function validate$b(obj, path = 'PricingTotalOutputRepresentation') {
|
|
3053
|
+
const v_error = (() => {
|
|
3054
|
+
if (typeof obj !== 'object' || ArrayIsArray(obj) || obj === null) {
|
|
3055
|
+
return new TypeError('Expected "object" but received "' + typeof obj + '" (at "' + path + '")');
|
|
3056
|
+
}
|
|
3057
|
+
if (obj.amount !== undefined) {
|
|
3058
|
+
obj.amount;
|
|
3059
|
+
}
|
|
3060
|
+
if (obj.frequency !== undefined) {
|
|
3061
|
+
const obj_frequency = obj.frequency;
|
|
3062
|
+
const path_frequency = path + '.frequency';
|
|
3063
|
+
if (typeof obj_frequency !== 'string') {
|
|
3064
|
+
return new TypeError('Expected "string" but received "' + typeof obj_frequency + '" (at "' + path_frequency + '")');
|
|
3065
|
+
}
|
|
3066
|
+
}
|
|
3067
|
+
if (obj.occurrence !== undefined) {
|
|
3068
|
+
const obj_occurrence = obj.occurrence;
|
|
3069
|
+
const path_occurrence = path + '.occurrence';
|
|
3070
|
+
if (typeof obj_occurrence !== 'number' || (typeof obj_occurrence === 'number' && Math.floor(obj_occurrence) !== obj_occurrence)) {
|
|
3071
|
+
return new TypeError('Expected "integer" but received "' + typeof obj_occurrence + '" (at "' + path_occurrence + '")');
|
|
3072
|
+
}
|
|
3073
|
+
}
|
|
3074
|
+
if (obj.priceType !== undefined) {
|
|
3075
|
+
const obj_priceType = obj.priceType;
|
|
3076
|
+
const path_priceType = path + '.priceType';
|
|
3077
|
+
if (typeof obj_priceType !== 'string') {
|
|
3078
|
+
return new TypeError('Expected "string" but received "' + typeof obj_priceType + '" (at "' + path_priceType + '")');
|
|
3079
|
+
}
|
|
3080
|
+
}
|
|
3081
|
+
})();
|
|
3082
|
+
return v_error === undefined ? null : v_error;
|
|
3083
|
+
}
|
|
3084
|
+
const select$a = function PricingTotalOutputRepresentationSelect() {
|
|
3085
|
+
return {
|
|
3086
|
+
kind: 'Fragment',
|
|
3087
|
+
version: VERSION$5,
|
|
3088
|
+
private: [],
|
|
3089
|
+
selections: [
|
|
3090
|
+
{
|
|
3091
|
+
name: 'amount',
|
|
3092
|
+
kind: 'Scalar',
|
|
3093
|
+
required: false
|
|
3094
|
+
},
|
|
3095
|
+
{
|
|
3096
|
+
name: 'frequency',
|
|
3097
|
+
kind: 'Scalar',
|
|
3098
|
+
required: false
|
|
3099
|
+
},
|
|
3100
|
+
{
|
|
3101
|
+
name: 'occurrence',
|
|
3102
|
+
kind: 'Scalar',
|
|
3103
|
+
required: false
|
|
3104
|
+
},
|
|
3105
|
+
{
|
|
3106
|
+
name: 'priceType',
|
|
3107
|
+
kind: 'Scalar',
|
|
3108
|
+
required: false
|
|
3109
|
+
}
|
|
3110
|
+
]
|
|
3111
|
+
};
|
|
3112
|
+
};
|
|
3113
|
+
function equals$5(existing, incoming) {
|
|
3114
|
+
const existing_occurrence = existing.occurrence;
|
|
3115
|
+
const incoming_occurrence = incoming.occurrence;
|
|
3116
|
+
// if at least one of these optionals is defined
|
|
3117
|
+
if (existing_occurrence !== undefined || incoming_occurrence !== undefined) {
|
|
3118
|
+
// if one of these is not defined we know the other is defined and therefore
|
|
3119
|
+
// not equal
|
|
3120
|
+
if (existing_occurrence === undefined || incoming_occurrence === undefined) {
|
|
3121
|
+
return false;
|
|
3122
|
+
}
|
|
3123
|
+
if (!(existing_occurrence === incoming_occurrence)) {
|
|
3124
|
+
return false;
|
|
3125
|
+
}
|
|
3126
|
+
}
|
|
3127
|
+
const existing_frequency = existing.frequency;
|
|
3128
|
+
const incoming_frequency = incoming.frequency;
|
|
3129
|
+
// if at least one of these optionals is defined
|
|
3130
|
+
if (existing_frequency !== undefined || incoming_frequency !== undefined) {
|
|
3131
|
+
// if one of these is not defined we know the other is defined and therefore
|
|
3132
|
+
// not equal
|
|
3133
|
+
if (existing_frequency === undefined || incoming_frequency === undefined) {
|
|
3134
|
+
return false;
|
|
3135
|
+
}
|
|
3136
|
+
if (!(existing_frequency === incoming_frequency)) {
|
|
3137
|
+
return false;
|
|
3138
|
+
}
|
|
3139
|
+
}
|
|
3140
|
+
const existing_priceType = existing.priceType;
|
|
3141
|
+
const incoming_priceType = incoming.priceType;
|
|
3142
|
+
// if at least one of these optionals is defined
|
|
3143
|
+
if (existing_priceType !== undefined || incoming_priceType !== undefined) {
|
|
3144
|
+
// if one of these is not defined we know the other is defined and therefore
|
|
3145
|
+
// not equal
|
|
3146
|
+
if (existing_priceType === undefined || incoming_priceType === undefined) {
|
|
3147
|
+
return false;
|
|
3148
|
+
}
|
|
3149
|
+
if (!(existing_priceType === incoming_priceType)) {
|
|
3150
|
+
return false;
|
|
3151
|
+
}
|
|
3152
|
+
}
|
|
3153
|
+
const existing_amount = existing.amount;
|
|
3154
|
+
const incoming_amount = incoming.amount;
|
|
3155
|
+
// if at least one of these optionals is defined
|
|
3156
|
+
if (existing_amount !== undefined || incoming_amount !== undefined) {
|
|
3157
|
+
// if one of these is not defined we know the other is defined and therefore
|
|
3158
|
+
// not equal
|
|
3159
|
+
if (existing_amount === undefined || incoming_amount === undefined) {
|
|
3160
|
+
return false;
|
|
3161
|
+
}
|
|
3162
|
+
if (!(existing_amount === incoming_amount)) {
|
|
3163
|
+
return false;
|
|
3164
|
+
}
|
|
3165
|
+
}
|
|
3166
|
+
return true;
|
|
3167
|
+
}
|
|
3168
|
+
|
|
3169
|
+
const VERSION$4 = "db83704358e5d7a3f3f3622cdd0a5114";
|
|
3170
|
+
function validate$a(obj, path = 'GetCartOutputRepresentation') {
|
|
3171
|
+
const v_error = (() => {
|
|
3172
|
+
if (typeof obj !== 'object' || ArrayIsArray(obj) || obj === null) {
|
|
3173
|
+
return new TypeError('Expected "object" but received "' + typeof obj + '" (at "' + path + '")');
|
|
3174
|
+
}
|
|
3175
|
+
const obj_apiStatus = obj.apiStatus;
|
|
3176
|
+
const path_apiStatus = path + '.apiStatus';
|
|
3177
|
+
const referencepath_apiStatusValidationError = validate$p(obj_apiStatus, path_apiStatus);
|
|
3178
|
+
if (referencepath_apiStatusValidationError !== null) {
|
|
3179
|
+
let message = 'Object doesn\'t match ApiStatusOutputRepresentation (at "' + path_apiStatus + '")\n';
|
|
3180
|
+
message += referencepath_apiStatusValidationError.message.split('\n').map((line) => '\t' + line).join('\n');
|
|
3181
|
+
return new TypeError(message);
|
|
3182
|
+
}
|
|
3183
|
+
if (obj.cartId !== undefined) {
|
|
3184
|
+
const obj_cartId = obj.cartId;
|
|
3185
|
+
const path_cartId = path + '.cartId';
|
|
3186
|
+
if (typeof obj_cartId !== 'string') {
|
|
3187
|
+
return new TypeError('Expected "string" but received "' + typeof obj_cartId + '" (at "' + path_cartId + '")');
|
|
3188
|
+
}
|
|
3189
|
+
}
|
|
3190
|
+
if (obj.cartItems !== undefined) {
|
|
3191
|
+
const obj_cartItems = obj.cartItems;
|
|
3192
|
+
const path_cartItems = path + '.cartItems';
|
|
3193
|
+
const referencepath_cartItemsValidationError = validate$c(obj_cartItems, path_cartItems);
|
|
3194
|
+
if (referencepath_cartItemsValidationError !== null) {
|
|
3195
|
+
let message = 'Object doesn\'t match CartItemsOutputRepresentation (at "' + path_cartItems + '")\n';
|
|
3196
|
+
message += referencepath_cartItemsValidationError.message.split('\n').map((line) => '\t' + line).join('\n');
|
|
3197
|
+
return new TypeError(message);
|
|
3198
|
+
}
|
|
3199
|
+
}
|
|
3200
|
+
if (obj.totals !== undefined) {
|
|
3201
|
+
const obj_totals = obj.totals;
|
|
3202
|
+
const path_totals = path + '.totals';
|
|
3203
|
+
if (!ArrayIsArray(obj_totals)) {
|
|
3204
|
+
return new TypeError('Expected "array" but received "' + typeof obj_totals + '" (at "' + path_totals + '")');
|
|
3205
|
+
}
|
|
3206
|
+
for (let i = 0; i < obj_totals.length; i++) {
|
|
3207
|
+
const obj_totals_item = obj_totals[i];
|
|
3208
|
+
const path_totals_item = path_totals + '[' + i + ']';
|
|
3209
|
+
const referencepath_totals_itemValidationError = validate$b(obj_totals_item, path_totals_item);
|
|
3210
|
+
if (referencepath_totals_itemValidationError !== null) {
|
|
3211
|
+
let message = 'Object doesn\'t match PricingTotalOutputRepresentation (at "' + path_totals_item + '")\n';
|
|
3212
|
+
message += referencepath_totals_itemValidationError.message.split('\n').map((line) => '\t' + line).join('\n');
|
|
3213
|
+
return new TypeError(message);
|
|
3214
|
+
}
|
|
3215
|
+
}
|
|
3216
|
+
}
|
|
3217
|
+
})();
|
|
3218
|
+
return v_error === undefined ? null : v_error;
|
|
3219
|
+
}
|
|
3220
|
+
const RepresentationType$4 = 'GetCartOutputRepresentation';
|
|
3221
|
+
function normalize$4(input, existing, path, luvio, store, timestamp) {
|
|
3222
|
+
return input;
|
|
3223
|
+
}
|
|
3224
|
+
const select$9 = function GetCartOutputRepresentationSelect() {
|
|
3225
|
+
const { selections: ApiStatusOutputRepresentation__selections, opaque: ApiStatusOutputRepresentation__opaque, } = select$p();
|
|
3226
|
+
const { selections: CartItemsOutputRepresentation__selections, opaque: CartItemsOutputRepresentation__opaque, } = select$b();
|
|
3227
|
+
const { selections: PricingTotalOutputRepresentation__selections, opaque: PricingTotalOutputRepresentation__opaque, } = select$a();
|
|
3228
|
+
return {
|
|
3229
|
+
kind: 'Fragment',
|
|
3230
|
+
version: VERSION$4,
|
|
3231
|
+
private: [],
|
|
3232
|
+
selections: [
|
|
3233
|
+
{
|
|
3234
|
+
name: 'apiStatus',
|
|
3235
|
+
kind: 'Object',
|
|
3236
|
+
selections: ApiStatusOutputRepresentation__selections
|
|
3237
|
+
},
|
|
3238
|
+
{
|
|
3239
|
+
name: 'cartId',
|
|
3240
|
+
kind: 'Scalar',
|
|
3241
|
+
required: false
|
|
3242
|
+
},
|
|
3243
|
+
{
|
|
3244
|
+
name: 'cartItems',
|
|
3245
|
+
kind: 'Object',
|
|
3246
|
+
selections: CartItemsOutputRepresentation__selections,
|
|
3247
|
+
required: false
|
|
3248
|
+
},
|
|
3249
|
+
{
|
|
3250
|
+
name: 'totals',
|
|
3251
|
+
kind: 'Object',
|
|
3252
|
+
plural: true,
|
|
3253
|
+
selections: PricingTotalOutputRepresentation__selections,
|
|
3254
|
+
required: false
|
|
3255
|
+
}
|
|
3256
|
+
]
|
|
3257
|
+
};
|
|
3258
|
+
};
|
|
3259
|
+
function equals$4(existing, incoming) {
|
|
3260
|
+
const existing_cartId = existing.cartId;
|
|
3261
|
+
const incoming_cartId = incoming.cartId;
|
|
3262
|
+
// if at least one of these optionals is defined
|
|
3263
|
+
if (existing_cartId !== undefined || incoming_cartId !== undefined) {
|
|
3264
|
+
// if one of these is not defined we know the other is defined and therefore
|
|
3265
|
+
// not equal
|
|
3266
|
+
if (existing_cartId === undefined || incoming_cartId === undefined) {
|
|
3267
|
+
return false;
|
|
3268
|
+
}
|
|
3269
|
+
if (!(existing_cartId === incoming_cartId)) {
|
|
3270
|
+
return false;
|
|
3271
|
+
}
|
|
3272
|
+
}
|
|
3273
|
+
const existing_apiStatus = existing.apiStatus;
|
|
3274
|
+
const incoming_apiStatus = incoming.apiStatus;
|
|
3275
|
+
if (!(equals$f(existing_apiStatus, incoming_apiStatus))) {
|
|
3276
|
+
return false;
|
|
3277
|
+
}
|
|
3278
|
+
const existing_cartItems = existing.cartItems;
|
|
3279
|
+
const incoming_cartItems = incoming.cartItems;
|
|
3280
|
+
// if at least one of these optionals is defined
|
|
3281
|
+
if (existing_cartItems !== undefined || incoming_cartItems !== undefined) {
|
|
3282
|
+
// if one of these is not defined we know the other is defined and therefore
|
|
3283
|
+
// not equal
|
|
3284
|
+
if (existing_cartItems === undefined || incoming_cartItems === undefined) {
|
|
3285
|
+
return false;
|
|
3286
|
+
}
|
|
3287
|
+
if (!(equals$6(existing_cartItems, incoming_cartItems))) {
|
|
3288
|
+
return false;
|
|
3289
|
+
}
|
|
3290
|
+
}
|
|
3291
|
+
const existing_totals = existing.totals;
|
|
3292
|
+
const incoming_totals = incoming.totals;
|
|
3293
|
+
// if at least one of these optionals is defined
|
|
3294
|
+
if (existing_totals !== undefined || incoming_totals !== undefined) {
|
|
3295
|
+
// if one of these is not defined we know the other is defined and therefore
|
|
3296
|
+
// not equal
|
|
3297
|
+
if (existing_totals === undefined || incoming_totals === undefined) {
|
|
3298
|
+
return false;
|
|
3299
|
+
}
|
|
3300
|
+
const equals_totals_items = equalsArray(existing_totals, incoming_totals, (existing_totals_item, incoming_totals_item) => {
|
|
3301
|
+
if (!(equals$5(existing_totals_item, incoming_totals_item))) {
|
|
3302
|
+
return false;
|
|
3303
|
+
}
|
|
3304
|
+
});
|
|
3305
|
+
if (equals_totals_items === false) {
|
|
3306
|
+
return false;
|
|
3307
|
+
}
|
|
3308
|
+
}
|
|
3309
|
+
return true;
|
|
3310
|
+
}
|
|
3311
|
+
const ingest$4 = function GetCartOutputRepresentationIngest(input, path, luvio, store, timestamp) {
|
|
3312
|
+
if (process.env.NODE_ENV !== 'production') {
|
|
3313
|
+
const validateError = validate$a(input);
|
|
3314
|
+
if (validateError !== null) {
|
|
3315
|
+
throw validateError;
|
|
3316
|
+
}
|
|
3317
|
+
}
|
|
3318
|
+
const key = path.fullPath;
|
|
3319
|
+
const existingRecord = store.readEntry(key);
|
|
3320
|
+
const ttlToUse = path.ttl !== undefined ? path.ttl : 1000;
|
|
3321
|
+
let incomingRecord = normalize$4(input, store.readEntry(key), {
|
|
3322
|
+
fullPath: key,
|
|
3323
|
+
parent: path.parent,
|
|
3324
|
+
propertyName: path.propertyName,
|
|
3325
|
+
ttl: ttlToUse
|
|
3326
|
+
});
|
|
3327
|
+
if (existingRecord === undefined || equals$4(existingRecord, incomingRecord) === false) {
|
|
3328
|
+
luvio.storePublish(key, incomingRecord);
|
|
3329
|
+
}
|
|
3330
|
+
if (ttlToUse !== undefined) {
|
|
3331
|
+
const storeMetadataParams = {
|
|
3332
|
+
ttl: ttlToUse,
|
|
3333
|
+
namespace: "cpq",
|
|
3334
|
+
version: VERSION$4,
|
|
3335
|
+
representationName: RepresentationType$4,
|
|
3336
|
+
};
|
|
3337
|
+
luvio.publishStoreMetadata(key, storeMetadataParams);
|
|
3338
|
+
}
|
|
3339
|
+
return createLink(key);
|
|
3340
|
+
};
|
|
3341
|
+
function getTypeCacheKeys$4(luvio, input, fullPathFactory) {
|
|
3342
|
+
const rootKeySet = new StoreKeyMap();
|
|
3343
|
+
// root cache key (uses fullPathFactory if keyBuilderFromType isn't defined)
|
|
3344
|
+
const rootKey = fullPathFactory();
|
|
3345
|
+
rootKeySet.set(rootKey, {
|
|
3346
|
+
namespace: keyPrefix,
|
|
3347
|
+
representationName: RepresentationType$4,
|
|
3348
|
+
mergeable: false
|
|
3349
|
+
});
|
|
3350
|
+
return rootKeySet;
|
|
3351
|
+
}
|
|
3352
|
+
|
|
3353
|
+
function select$8(luvio, params) {
|
|
3354
|
+
return select$9();
|
|
3355
|
+
}
|
|
3356
|
+
function keyBuilder$5(luvio, params) {
|
|
3357
|
+
return keyPrefix + '::GetCartOutputRepresentation:(' + 'cartId:' + params.urlParams.cartId + ')';
|
|
3358
|
+
}
|
|
3359
|
+
function getResponseCacheKeys$4(luvio, resourceParams, response) {
|
|
3360
|
+
return getTypeCacheKeys$4(luvio, response, () => keyBuilder$5(luvio, resourceParams));
|
|
3361
|
+
}
|
|
3362
|
+
function ingestSuccess$4(luvio, resourceParams, response, snapshotRefresh) {
|
|
3363
|
+
const { body } = response;
|
|
3364
|
+
const key = keyBuilder$5(luvio, resourceParams);
|
|
3365
|
+
luvio.storeIngest(key, ingest$4, body);
|
|
3366
|
+
const snapshot = luvio.storeLookup({
|
|
3367
|
+
recordId: key,
|
|
3368
|
+
node: select$8(),
|
|
3369
|
+
variables: {},
|
|
3370
|
+
}, snapshotRefresh);
|
|
3371
|
+
if (process.env.NODE_ENV !== 'production') {
|
|
3372
|
+
if (snapshot.state !== 'Fulfilled') {
|
|
3373
|
+
throw new Error('Invalid network response. Expected resource response to result in Fulfilled snapshot');
|
|
3374
|
+
}
|
|
3375
|
+
}
|
|
3376
|
+
deepFreeze(snapshot.data);
|
|
3377
|
+
return snapshot;
|
|
3378
|
+
}
|
|
3379
|
+
function ingestError(luvio, params, error, snapshotRefresh) {
|
|
3380
|
+
const key = keyBuilder$5(luvio, params);
|
|
3381
|
+
const errorSnapshot = luvio.errorSnapshot(error, snapshotRefresh);
|
|
3382
|
+
luvio.storeIngestError(key, errorSnapshot);
|
|
3383
|
+
return errorSnapshot;
|
|
3384
|
+
}
|
|
3385
|
+
function createResourceRequest$4(config) {
|
|
3386
|
+
const headers = {};
|
|
3387
|
+
return {
|
|
3388
|
+
baseUri: '/services/data/v59.0',
|
|
3389
|
+
basePath: '/connect/cpq/carts/' + config.urlParams.cartId + '',
|
|
3390
|
+
method: 'get',
|
|
3391
|
+
body: null,
|
|
3392
|
+
urlParams: config.urlParams,
|
|
3393
|
+
queryParams: {},
|
|
3394
|
+
headers,
|
|
3395
|
+
priority: 'normal',
|
|
3396
|
+
};
|
|
3397
|
+
}
|
|
3398
|
+
|
|
3399
|
+
const getCart_ConfigPropertyNames = {
|
|
3400
|
+
displayName: 'getCart',
|
|
3401
|
+
parameters: {
|
|
3402
|
+
required: ['cartId'],
|
|
3403
|
+
optional: []
|
|
3404
|
+
}
|
|
3405
|
+
};
|
|
3406
|
+
function createResourceParams$4(config) {
|
|
3407
|
+
const resourceParams = {
|
|
3408
|
+
urlParams: {
|
|
3409
|
+
cartId: config.cartId
|
|
3410
|
+
}
|
|
3411
|
+
};
|
|
3412
|
+
return resourceParams;
|
|
3413
|
+
}
|
|
3414
|
+
function keyBuilder$4(luvio, config) {
|
|
3415
|
+
const resourceParams = createResourceParams$4(config);
|
|
3416
|
+
return keyBuilder$5(luvio, resourceParams);
|
|
3417
|
+
}
|
|
3418
|
+
function typeCheckConfig$4(untrustedConfig) {
|
|
3419
|
+
const config = {};
|
|
3420
|
+
const untrustedConfig_cartId = untrustedConfig.cartId;
|
|
3421
|
+
if (typeof untrustedConfig_cartId === 'string') {
|
|
3422
|
+
config.cartId = untrustedConfig_cartId;
|
|
3423
|
+
}
|
|
3424
|
+
return config;
|
|
3425
|
+
}
|
|
3426
|
+
function validateAdapterConfig$4(untrustedConfig, configPropertyNames) {
|
|
3427
|
+
if (!untrustedIsObject(untrustedConfig)) {
|
|
3428
|
+
return null;
|
|
3429
|
+
}
|
|
3430
|
+
if (process.env.NODE_ENV !== 'production') {
|
|
3431
|
+
validateConfig(untrustedConfig, configPropertyNames);
|
|
3432
|
+
}
|
|
3433
|
+
const config = typeCheckConfig$4(untrustedConfig);
|
|
3434
|
+
if (!areRequiredParametersPresent(config, configPropertyNames)) {
|
|
3435
|
+
return null;
|
|
3436
|
+
}
|
|
3437
|
+
return config;
|
|
3438
|
+
}
|
|
3439
|
+
function adapterFragment(luvio, config) {
|
|
3440
|
+
createResourceParams$4(config);
|
|
3441
|
+
return select$8();
|
|
3442
|
+
}
|
|
3443
|
+
function onFetchResponseSuccess(luvio, config, resourceParams, response) {
|
|
3444
|
+
const snapshot = ingestSuccess$4(luvio, resourceParams, response, {
|
|
3445
|
+
config,
|
|
3446
|
+
resolve: () => buildNetworkSnapshot$4(luvio, config, snapshotRefreshOptions)
|
|
3447
|
+
});
|
|
3448
|
+
return luvio.storeBroadcast().then(() => snapshot);
|
|
3449
|
+
}
|
|
3450
|
+
function onFetchResponseError(luvio, config, resourceParams, response) {
|
|
3451
|
+
const snapshot = ingestError(luvio, resourceParams, response, {
|
|
3452
|
+
config,
|
|
3453
|
+
resolve: () => buildNetworkSnapshot$4(luvio, config, snapshotRefreshOptions)
|
|
3454
|
+
});
|
|
3455
|
+
return luvio.storeBroadcast().then(() => snapshot);
|
|
3456
|
+
}
|
|
3457
|
+
function buildNetworkSnapshot$4(luvio, config, options) {
|
|
3458
|
+
const resourceParams = createResourceParams$4(config);
|
|
3459
|
+
const request = createResourceRequest$4(resourceParams);
|
|
3460
|
+
return luvio.dispatchResourceRequest(request, options)
|
|
3461
|
+
.then((response) => {
|
|
3462
|
+
return luvio.handleSuccessResponse(() => onFetchResponseSuccess(luvio, config, resourceParams, response), () => getResponseCacheKeys$4(luvio, resourceParams, response.body));
|
|
3463
|
+
}, (response) => {
|
|
3464
|
+
return luvio.handleErrorResponse(() => onFetchResponseError(luvio, config, resourceParams, response));
|
|
3465
|
+
});
|
|
3466
|
+
}
|
|
3467
|
+
function buildNetworkSnapshotCachePolicy(context, coercedAdapterRequestContext) {
|
|
3468
|
+
const { luvio, config } = context;
|
|
3469
|
+
const { networkPriority, requestCorrelator, eventObservers } = coercedAdapterRequestContext;
|
|
3470
|
+
const dispatchOptions = {
|
|
3471
|
+
resourceRequestContext: {
|
|
3472
|
+
requestCorrelator,
|
|
3473
|
+
luvioRequestMethod: undefined,
|
|
3474
|
+
},
|
|
3475
|
+
eventObservers
|
|
3476
|
+
};
|
|
3477
|
+
if (networkPriority !== 'normal') {
|
|
3478
|
+
dispatchOptions.overrides = {
|
|
3479
|
+
priority: networkPriority
|
|
3480
|
+
};
|
|
3481
|
+
}
|
|
3482
|
+
return buildNetworkSnapshot$4(luvio, config, dispatchOptions);
|
|
3483
|
+
}
|
|
3484
|
+
function buildCachedSnapshotCachePolicy(context, storeLookup) {
|
|
3485
|
+
const { luvio, config } = context;
|
|
3486
|
+
const selector = {
|
|
3487
|
+
recordId: keyBuilder$4(luvio, config),
|
|
3488
|
+
node: adapterFragment(luvio, config),
|
|
3489
|
+
variables: {},
|
|
3490
|
+
};
|
|
3491
|
+
const cacheSnapshot = storeLookup(selector, {
|
|
3492
|
+
config,
|
|
3493
|
+
resolve: () => buildNetworkSnapshot$4(luvio, config, snapshotRefreshOptions)
|
|
3494
|
+
});
|
|
3495
|
+
return cacheSnapshot;
|
|
3496
|
+
}
|
|
3497
|
+
const getCartAdapterFactory = (luvio) => function cpq__getCart(untrustedConfig, requestContext) {
|
|
3498
|
+
const config = validateAdapterConfig$4(untrustedConfig, getCart_ConfigPropertyNames);
|
|
3499
|
+
// Invalid or incomplete config
|
|
3500
|
+
if (config === null) {
|
|
3501
|
+
return null;
|
|
3502
|
+
}
|
|
3503
|
+
return luvio.applyCachePolicy((requestContext || {}), { config, luvio }, // BuildSnapshotContext
|
|
3504
|
+
buildCachedSnapshotCachePolicy, buildNetworkSnapshotCachePolicy);
|
|
3505
|
+
};
|
|
3506
|
+
|
|
3507
|
+
function validate$9(obj, path = 'UpdateCartInputRepresentation') {
|
|
3508
|
+
const v_error = (() => {
|
|
3509
|
+
if (typeof obj !== 'object' || ArrayIsArray(obj) || obj === null) {
|
|
3510
|
+
return new TypeError('Expected "object" but received "' + typeof obj + '" (at "' + path + '")');
|
|
3511
|
+
}
|
|
3512
|
+
const obj_actions = obj.actions;
|
|
3513
|
+
const path_actions = path + '.actions';
|
|
3514
|
+
if (!ArrayIsArray(obj_actions)) {
|
|
3515
|
+
return new TypeError('Expected "array" but received "' + typeof obj_actions + '" (at "' + path_actions + '")');
|
|
3516
|
+
}
|
|
3517
|
+
for (let i = 0; i < obj_actions.length; i++) {
|
|
3518
|
+
const obj_actions_item = obj_actions[i];
|
|
3519
|
+
const path_actions_item = path_actions + '[' + i + ']';
|
|
3520
|
+
if (typeof obj_actions_item !== 'string') {
|
|
3521
|
+
return new TypeError('Expected "string" but received "' + typeof obj_actions_item + '" (at "' + path_actions_item + '")');
|
|
3522
|
+
}
|
|
3523
|
+
}
|
|
3524
|
+
if (obj.correlationId !== undefined) {
|
|
3525
|
+
const obj_correlationId = obj.correlationId;
|
|
3526
|
+
const path_correlationId = path + '.correlationId';
|
|
3527
|
+
if (typeof obj_correlationId !== 'string') {
|
|
3528
|
+
return new TypeError('Expected "string" but received "' + typeof obj_correlationId + '" (at "' + path_correlationId + '")');
|
|
3529
|
+
}
|
|
3530
|
+
}
|
|
3531
|
+
if (obj.userContext !== undefined) {
|
|
3532
|
+
const obj_userContext = obj.userContext;
|
|
3533
|
+
const path_userContext = path + '.userContext';
|
|
3534
|
+
if (typeof obj_userContext !== 'object' || ArrayIsArray(obj_userContext) || obj_userContext === null) {
|
|
3535
|
+
return new TypeError('Expected "object" but received "' + typeof obj_userContext + '" (at "' + path_userContext + '")');
|
|
3536
|
+
}
|
|
3537
|
+
}
|
|
3538
|
+
})();
|
|
3539
|
+
return v_error === undefined ? null : v_error;
|
|
3540
|
+
}
|
|
3541
|
+
|
|
3542
|
+
function validate$8(obj, path = 'ValidationResultOutputRepresentation') {
|
|
3543
|
+
const v_error = (() => {
|
|
3544
|
+
if (typeof obj !== 'object' || ArrayIsArray(obj) || obj === null) {
|
|
3545
|
+
return new TypeError('Expected "object" but received "' + typeof obj + '" (at "' + path + '")');
|
|
3546
|
+
}
|
|
3547
|
+
if (obj.cartItemId !== undefined) {
|
|
3548
|
+
const obj_cartItemId = obj.cartItemId;
|
|
3549
|
+
const path_cartItemId = path + '.cartItemId';
|
|
3550
|
+
if (typeof obj_cartItemId !== 'string') {
|
|
3551
|
+
return new TypeError('Expected "string" but received "' + typeof obj_cartItemId + '" (at "' + path_cartItemId + '")');
|
|
3552
|
+
}
|
|
3553
|
+
}
|
|
3554
|
+
if (obj.condition !== undefined) {
|
|
3555
|
+
const obj_condition = obj.condition;
|
|
3556
|
+
const path_condition = path + '.condition';
|
|
3557
|
+
if (typeof obj_condition !== 'string') {
|
|
3558
|
+
return new TypeError('Expected "string" but received "' + typeof obj_condition + '" (at "' + path_condition + '")');
|
|
3559
|
+
}
|
|
3560
|
+
}
|
|
3561
|
+
if (obj.hasPassed !== undefined) {
|
|
3562
|
+
const obj_hasPassed = obj.hasPassed;
|
|
3563
|
+
const path_hasPassed = path + '.hasPassed';
|
|
3564
|
+
if (typeof obj_hasPassed !== 'boolean') {
|
|
3565
|
+
return new TypeError('Expected "boolean" but received "' + typeof obj_hasPassed + '" (at "' + path_hasPassed + '")');
|
|
3566
|
+
}
|
|
3567
|
+
}
|
|
3568
|
+
if (obj.message !== undefined) {
|
|
3569
|
+
const obj_message = obj.message;
|
|
3570
|
+
const path_message = path + '.message';
|
|
3571
|
+
if (typeof obj_message !== 'string') {
|
|
3572
|
+
return new TypeError('Expected "string" but received "' + typeof obj_message + '" (at "' + path_message + '")');
|
|
3573
|
+
}
|
|
3574
|
+
}
|
|
3575
|
+
if (obj.validationType !== undefined) {
|
|
3576
|
+
const obj_validationType = obj.validationType;
|
|
3577
|
+
const path_validationType = path + '.validationType';
|
|
3578
|
+
if (typeof obj_validationType !== 'string') {
|
|
3579
|
+
return new TypeError('Expected "string" but received "' + typeof obj_validationType + '" (at "' + path_validationType + '")');
|
|
3580
|
+
}
|
|
3581
|
+
}
|
|
3582
|
+
})();
|
|
3583
|
+
return v_error === undefined ? null : v_error;
|
|
3584
|
+
}
|
|
3585
|
+
|
|
3586
|
+
function validate$7(obj, path = 'ValidateCartOutputRepresentation') {
|
|
3587
|
+
const v_error = (() => {
|
|
3588
|
+
if (typeof obj !== 'object' || ArrayIsArray(obj) || obj === null) {
|
|
3589
|
+
return new TypeError('Expected "object" but received "' + typeof obj + '" (at "' + path + '")');
|
|
3590
|
+
}
|
|
3591
|
+
if (obj.attributeErrors !== undefined) {
|
|
3592
|
+
const obj_attributeErrors = obj.attributeErrors;
|
|
3593
|
+
const path_attributeErrors = path + '.attributeErrors';
|
|
3594
|
+
if (!ArrayIsArray(obj_attributeErrors)) {
|
|
3595
|
+
return new TypeError('Expected "array" but received "' + typeof obj_attributeErrors + '" (at "' + path_attributeErrors + '")');
|
|
3596
|
+
}
|
|
3597
|
+
for (let i = 0; i < obj_attributeErrors.length; i++) {
|
|
3598
|
+
const obj_attributeErrors_item = obj_attributeErrors[i];
|
|
3599
|
+
const path_attributeErrors_item = path_attributeErrors + '[' + i + ']';
|
|
3600
|
+
const referencepath_attributeErrors_itemValidationError = validate$8(obj_attributeErrors_item, path_attributeErrors_item);
|
|
3601
|
+
if (referencepath_attributeErrors_itemValidationError !== null) {
|
|
3602
|
+
let message = 'Object doesn\'t match ValidationResultOutputRepresentation (at "' + path_attributeErrors_item + '")\n';
|
|
3603
|
+
message += referencepath_attributeErrors_itemValidationError.message.split('\n').map((line) => '\t' + line).join('\n');
|
|
3604
|
+
return new TypeError(message);
|
|
3605
|
+
}
|
|
3606
|
+
}
|
|
3607
|
+
}
|
|
3608
|
+
if (obj.breErrors !== undefined) {
|
|
3609
|
+
const obj_breErrors = obj.breErrors;
|
|
3610
|
+
const path_breErrors = path + '.breErrors';
|
|
3611
|
+
if (!ArrayIsArray(obj_breErrors)) {
|
|
3612
|
+
return new TypeError('Expected "array" but received "' + typeof obj_breErrors + '" (at "' + path_breErrors + '")');
|
|
3613
|
+
}
|
|
3614
|
+
for (let i = 0; i < obj_breErrors.length; i++) {
|
|
3615
|
+
const obj_breErrors_item = obj_breErrors[i];
|
|
3616
|
+
const path_breErrors_item = path_breErrors + '[' + i + ']';
|
|
3617
|
+
const referencepath_breErrors_itemValidationError = validate$8(obj_breErrors_item, path_breErrors_item);
|
|
3618
|
+
if (referencepath_breErrors_itemValidationError !== null) {
|
|
3619
|
+
let message = 'Object doesn\'t match ValidationResultOutputRepresentation (at "' + path_breErrors_item + '")\n';
|
|
3620
|
+
message += referencepath_breErrors_itemValidationError.message.split('\n').map((line) => '\t' + line).join('\n');
|
|
3621
|
+
return new TypeError(message);
|
|
3622
|
+
}
|
|
3623
|
+
}
|
|
3624
|
+
}
|
|
3625
|
+
if (obj.cardinalityErrors !== undefined) {
|
|
3626
|
+
const obj_cardinalityErrors = obj.cardinalityErrors;
|
|
3627
|
+
const path_cardinalityErrors = path + '.cardinalityErrors';
|
|
3628
|
+
if (!ArrayIsArray(obj_cardinalityErrors)) {
|
|
3629
|
+
return new TypeError('Expected "array" but received "' + typeof obj_cardinalityErrors + '" (at "' + path_cardinalityErrors + '")');
|
|
3630
|
+
}
|
|
3631
|
+
for (let i = 0; i < obj_cardinalityErrors.length; i++) {
|
|
3632
|
+
const obj_cardinalityErrors_item = obj_cardinalityErrors[i];
|
|
3633
|
+
const path_cardinalityErrors_item = path_cardinalityErrors + '[' + i + ']';
|
|
3634
|
+
const referencepath_cardinalityErrors_itemValidationError = validate$8(obj_cardinalityErrors_item, path_cardinalityErrors_item);
|
|
3635
|
+
if (referencepath_cardinalityErrors_itemValidationError !== null) {
|
|
3636
|
+
let message = 'Object doesn\'t match ValidationResultOutputRepresentation (at "' + path_cardinalityErrors_item + '")\n';
|
|
3637
|
+
message += referencepath_cardinalityErrors_itemValidationError.message.split('\n').map((line) => '\t' + line).join('\n');
|
|
3638
|
+
return new TypeError(message);
|
|
3639
|
+
}
|
|
3640
|
+
}
|
|
3641
|
+
}
|
|
3642
|
+
if (obj.hasErrors !== undefined) {
|
|
3643
|
+
const obj_hasErrors = obj.hasErrors;
|
|
3644
|
+
const path_hasErrors = path + '.hasErrors';
|
|
3645
|
+
if (typeof obj_hasErrors !== 'boolean') {
|
|
3646
|
+
return new TypeError('Expected "boolean" but received "' + typeof obj_hasErrors + '" (at "' + path_hasErrors + '")');
|
|
3647
|
+
}
|
|
3648
|
+
}
|
|
3649
|
+
})();
|
|
3650
|
+
return v_error === undefined ? null : v_error;
|
|
3651
|
+
}
|
|
3652
|
+
|
|
3653
|
+
const TTL$3 = 1000;
|
|
3654
|
+
const VERSION$3 = "b0d6081a9f20773285c8aeb2e715ead3";
|
|
3655
|
+
function validate$6(obj, path = 'UpdateCartOutputRepresentation') {
|
|
3656
|
+
const v_error = (() => {
|
|
3657
|
+
if (typeof obj !== 'object' || ArrayIsArray(obj) || obj === null) {
|
|
3658
|
+
return new TypeError('Expected "object" but received "' + typeof obj + '" (at "' + path + '")');
|
|
3659
|
+
}
|
|
3660
|
+
const obj_apiStatus = obj.apiStatus;
|
|
3661
|
+
const path_apiStatus = path + '.apiStatus';
|
|
3662
|
+
const referencepath_apiStatusValidationError = validate$p(obj_apiStatus, path_apiStatus);
|
|
3663
|
+
if (referencepath_apiStatusValidationError !== null) {
|
|
3664
|
+
let message = 'Object doesn\'t match ApiStatusOutputRepresentation (at "' + path_apiStatus + '")\n';
|
|
3665
|
+
message += referencepath_apiStatusValidationError.message.split('\n').map((line) => '\t' + line).join('\n');
|
|
3666
|
+
return new TypeError(message);
|
|
3667
|
+
}
|
|
3668
|
+
const obj_validationResults = obj.validationResults;
|
|
3669
|
+
const path_validationResults = path + '.validationResults';
|
|
3670
|
+
const referencepath_validationResultsValidationError = validate$7(obj_validationResults, path_validationResults);
|
|
3671
|
+
if (referencepath_validationResultsValidationError !== null) {
|
|
3672
|
+
let message = 'Object doesn\'t match ValidateCartOutputRepresentation (at "' + path_validationResults + '")\n';
|
|
3673
|
+
message += referencepath_validationResultsValidationError.message.split('\n').map((line) => '\t' + line).join('\n');
|
|
3674
|
+
return new TypeError(message);
|
|
3675
|
+
}
|
|
3676
|
+
})();
|
|
3677
|
+
return v_error === undefined ? null : v_error;
|
|
3678
|
+
}
|
|
3679
|
+
const RepresentationType$3 = 'UpdateCartOutputRepresentation';
|
|
3680
|
+
function keyBuilder$3(luvio, config) {
|
|
3681
|
+
return keyPrefix + '::' + RepresentationType$3 + ':' + config.message;
|
|
3682
|
+
}
|
|
3683
|
+
function keyBuilderFromType$3(luvio, object) {
|
|
3684
|
+
const keyParams = {
|
|
3685
|
+
message: object.apiStatus.statusCode
|
|
3686
|
+
};
|
|
3687
|
+
return keyBuilder$3(luvio, keyParams);
|
|
3688
|
+
}
|
|
3689
|
+
function normalize$3(input, existing, path, luvio, store, timestamp) {
|
|
3690
|
+
return input;
|
|
3691
|
+
}
|
|
3692
|
+
const select$7 = function UpdateCartOutputRepresentationSelect() {
|
|
3693
|
+
return {
|
|
3694
|
+
kind: 'Fragment',
|
|
3695
|
+
version: VERSION$3,
|
|
3696
|
+
private: [],
|
|
3697
|
+
opaque: true
|
|
3698
|
+
};
|
|
3699
|
+
};
|
|
3700
|
+
function equals$3(existing, incoming) {
|
|
3701
|
+
if (JSONStringify(incoming) !== JSONStringify(existing)) {
|
|
3702
|
+
return false;
|
|
3703
|
+
}
|
|
3704
|
+
return true;
|
|
3705
|
+
}
|
|
3706
|
+
const ingest$3 = function UpdateCartOutputRepresentationIngest(input, path, luvio, store, timestamp) {
|
|
3707
|
+
if (process.env.NODE_ENV !== 'production') {
|
|
3708
|
+
const validateError = validate$6(input);
|
|
3709
|
+
if (validateError !== null) {
|
|
3710
|
+
throw validateError;
|
|
3711
|
+
}
|
|
3712
|
+
}
|
|
3713
|
+
const key = keyBuilderFromType$3(luvio, input);
|
|
3714
|
+
const existingRecord = store.readEntry(key);
|
|
3715
|
+
const ttlToUse = TTL$3;
|
|
3716
|
+
let incomingRecord = normalize$3(input, store.readEntry(key), {
|
|
3717
|
+
fullPath: key,
|
|
3718
|
+
parent: path.parent,
|
|
3719
|
+
propertyName: path.propertyName,
|
|
3720
|
+
ttl: ttlToUse
|
|
3721
|
+
});
|
|
3722
|
+
if (existingRecord === undefined || equals$3(existingRecord, incomingRecord) === false) {
|
|
3723
|
+
luvio.storePublish(key, incomingRecord);
|
|
3724
|
+
}
|
|
3725
|
+
{
|
|
3726
|
+
const storeMetadataParams = {
|
|
3727
|
+
ttl: ttlToUse,
|
|
3728
|
+
namespace: "cpq",
|
|
3729
|
+
version: VERSION$3,
|
|
3730
|
+
representationName: RepresentationType$3,
|
|
3731
|
+
};
|
|
3732
|
+
luvio.publishStoreMetadata(key, storeMetadataParams);
|
|
3733
|
+
}
|
|
3734
|
+
return createLink(key);
|
|
3735
|
+
};
|
|
3736
|
+
function getTypeCacheKeys$3(luvio, input, fullPathFactory) {
|
|
3737
|
+
const rootKeySet = new StoreKeyMap();
|
|
3738
|
+
// root cache key (uses fullPathFactory if keyBuilderFromType isn't defined)
|
|
3739
|
+
const rootKey = keyBuilderFromType$3(luvio, input);
|
|
3740
|
+
rootKeySet.set(rootKey, {
|
|
3741
|
+
namespace: keyPrefix,
|
|
3742
|
+
representationName: RepresentationType$3,
|
|
3743
|
+
mergeable: false
|
|
3744
|
+
});
|
|
3745
|
+
return rootKeySet;
|
|
3746
|
+
}
|
|
3747
|
+
|
|
3748
|
+
function select$6(luvio, params) {
|
|
3749
|
+
return select$7();
|
|
3750
|
+
}
|
|
3751
|
+
function getResponseCacheKeys$3(luvio, resourceParams, response) {
|
|
3752
|
+
return getTypeCacheKeys$3(luvio, response);
|
|
3753
|
+
}
|
|
3754
|
+
function ingestSuccess$3(luvio, resourceParams, response) {
|
|
3755
|
+
const { body } = response;
|
|
3756
|
+
const key = keyBuilderFromType$3(luvio, body);
|
|
3757
|
+
luvio.storeIngest(key, ingest$3, body);
|
|
3758
|
+
const snapshot = luvio.storeLookup({
|
|
3759
|
+
recordId: key,
|
|
3760
|
+
node: select$6(),
|
|
3761
|
+
variables: {},
|
|
3762
|
+
});
|
|
3763
|
+
if (process.env.NODE_ENV !== 'production') {
|
|
3764
|
+
if (snapshot.state !== 'Fulfilled') {
|
|
3765
|
+
throw new Error('Invalid network response. Expected resource response to result in Fulfilled snapshot');
|
|
3766
|
+
}
|
|
3767
|
+
}
|
|
3768
|
+
deepFreeze(snapshot.data);
|
|
3769
|
+
return snapshot;
|
|
3770
|
+
}
|
|
3771
|
+
function createResourceRequest$3(config) {
|
|
3772
|
+
const headers = {};
|
|
3773
|
+
return {
|
|
3774
|
+
baseUri: '/services/data/v59.0',
|
|
3775
|
+
basePath: '/connect/cpq/carts/' + config.urlParams.cartId + '',
|
|
3776
|
+
method: 'patch',
|
|
3777
|
+
body: config.body,
|
|
3778
|
+
urlParams: config.urlParams,
|
|
3779
|
+
queryParams: {},
|
|
3780
|
+
headers,
|
|
3781
|
+
priority: 'normal',
|
|
3782
|
+
};
|
|
3783
|
+
}
|
|
3784
|
+
|
|
3785
|
+
const updateCart_ConfigPropertyNames = {
|
|
3786
|
+
displayName: 'updateCart',
|
|
3787
|
+
parameters: {
|
|
3788
|
+
required: ['cartId', 'requestBody'],
|
|
3789
|
+
optional: []
|
|
3790
|
+
}
|
|
3791
|
+
};
|
|
3792
|
+
function createResourceParams$3(config) {
|
|
3793
|
+
const resourceParams = {
|
|
3794
|
+
urlParams: {
|
|
3795
|
+
cartId: config.cartId
|
|
3796
|
+
},
|
|
3797
|
+
body: {
|
|
3798
|
+
requestBody: config.requestBody
|
|
3799
|
+
}
|
|
3800
|
+
};
|
|
3801
|
+
return resourceParams;
|
|
3802
|
+
}
|
|
3803
|
+
function typeCheckConfig$3(untrustedConfig) {
|
|
3804
|
+
const config = {};
|
|
3805
|
+
const untrustedConfig_cartId = untrustedConfig.cartId;
|
|
3806
|
+
if (typeof untrustedConfig_cartId === 'string') {
|
|
3807
|
+
config.cartId = untrustedConfig_cartId;
|
|
3808
|
+
}
|
|
3809
|
+
const untrustedConfig_requestBody = untrustedConfig.requestBody;
|
|
3810
|
+
const referenceUpdateCartInputRepresentationValidationError = validate$9(untrustedConfig_requestBody);
|
|
3811
|
+
if (referenceUpdateCartInputRepresentationValidationError === null) {
|
|
3812
|
+
config.requestBody = untrustedConfig_requestBody;
|
|
3813
|
+
}
|
|
3814
|
+
return config;
|
|
3815
|
+
}
|
|
3816
|
+
function validateAdapterConfig$3(untrustedConfig, configPropertyNames) {
|
|
3817
|
+
if (!untrustedIsObject(untrustedConfig)) {
|
|
3818
|
+
return null;
|
|
3819
|
+
}
|
|
3820
|
+
if (process.env.NODE_ENV !== 'production') {
|
|
3821
|
+
validateConfig(untrustedConfig, configPropertyNames);
|
|
3822
|
+
}
|
|
3823
|
+
const config = typeCheckConfig$3(untrustedConfig);
|
|
3824
|
+
if (!areRequiredParametersPresent(config, configPropertyNames)) {
|
|
3825
|
+
return null;
|
|
3826
|
+
}
|
|
3827
|
+
return config;
|
|
3828
|
+
}
|
|
3829
|
+
function buildNetworkSnapshot$3(luvio, config, options) {
|
|
3830
|
+
const resourceParams = createResourceParams$3(config);
|
|
3831
|
+
const request = createResourceRequest$3(resourceParams);
|
|
3832
|
+
return luvio.dispatchResourceRequest(request, options)
|
|
3833
|
+
.then((response) => {
|
|
3834
|
+
return luvio.handleSuccessResponse(() => {
|
|
3835
|
+
const snapshot = ingestSuccess$3(luvio, resourceParams, response);
|
|
3836
|
+
return luvio.storeBroadcast().then(() => snapshot);
|
|
3837
|
+
}, () => getResponseCacheKeys$3(luvio, resourceParams, response.body));
|
|
3838
|
+
}, (response) => {
|
|
3839
|
+
deepFreeze(response);
|
|
3840
|
+
throw response;
|
|
3841
|
+
});
|
|
3842
|
+
}
|
|
3843
|
+
const updateCartAdapterFactory = (luvio) => {
|
|
3844
|
+
return function updateCart(untrustedConfig) {
|
|
3845
|
+
const config = validateAdapterConfig$3(untrustedConfig, updateCart_ConfigPropertyNames);
|
|
3846
|
+
// Invalid or incomplete config
|
|
3847
|
+
if (config === null) {
|
|
3848
|
+
throw new Error('Invalid config for "updateCart"');
|
|
3849
|
+
}
|
|
3850
|
+
return buildNetworkSnapshot$3(luvio, config);
|
|
3851
|
+
};
|
|
3852
|
+
};
|
|
3853
|
+
|
|
3854
|
+
function validate$5(obj, path = 'UpdateCartItemsInputRepresentation') {
|
|
3855
|
+
const v_error = (() => {
|
|
3856
|
+
if (typeof obj !== 'object' || ArrayIsArray(obj) || obj === null) {
|
|
3857
|
+
return new TypeError('Expected "object" but received "' + typeof obj + '" (at "' + path + '")');
|
|
3858
|
+
}
|
|
3859
|
+
if (obj.cartItemConfigurations !== undefined) {
|
|
3860
|
+
const obj_cartItemConfigurations = obj.cartItemConfigurations;
|
|
3861
|
+
const path_cartItemConfigurations = path + '.cartItemConfigurations';
|
|
3862
|
+
if (!ArrayIsArray(obj_cartItemConfigurations)) {
|
|
3863
|
+
return new TypeError('Expected "array" but received "' + typeof obj_cartItemConfigurations + '" (at "' + path_cartItemConfigurations + '")');
|
|
3864
|
+
}
|
|
3865
|
+
for (let i = 0; i < obj_cartItemConfigurations.length; i++) {
|
|
3866
|
+
const obj_cartItemConfigurations_item = obj_cartItemConfigurations[i];
|
|
3867
|
+
const path_cartItemConfigurations_item = path_cartItemConfigurations + '[' + i + ']';
|
|
3868
|
+
if (typeof obj_cartItemConfigurations_item !== 'object' || ArrayIsArray(obj_cartItemConfigurations_item) || obj_cartItemConfigurations_item === null) {
|
|
3869
|
+
return new TypeError('Expected "object" but received "' + typeof obj_cartItemConfigurations_item + '" (at "' + path_cartItemConfigurations_item + '")');
|
|
3870
|
+
}
|
|
3871
|
+
}
|
|
3872
|
+
}
|
|
3873
|
+
if (obj.correlationId !== undefined) {
|
|
3874
|
+
const obj_correlationId = obj.correlationId;
|
|
3875
|
+
const path_correlationId = path + '.correlationId';
|
|
3876
|
+
if (typeof obj_correlationId !== 'string') {
|
|
3877
|
+
return new TypeError('Expected "string" but received "' + typeof obj_correlationId + '" (at "' + path_correlationId + '")');
|
|
3878
|
+
}
|
|
3879
|
+
}
|
|
3880
|
+
if (obj.userContext !== undefined) {
|
|
3881
|
+
const obj_userContext = obj.userContext;
|
|
3882
|
+
const path_userContext = path + '.userContext';
|
|
3883
|
+
if (typeof obj_userContext !== 'object' || ArrayIsArray(obj_userContext) || obj_userContext === null) {
|
|
3884
|
+
return new TypeError('Expected "object" but received "' + typeof obj_userContext + '" (at "' + path_userContext + '")');
|
|
3885
|
+
}
|
|
3886
|
+
}
|
|
3887
|
+
})();
|
|
3888
|
+
return v_error === undefined ? null : v_error;
|
|
3889
|
+
}
|
|
3890
|
+
|
|
3891
|
+
const TTL$2 = 1000;
|
|
3892
|
+
const VERSION$2 = "7f205594e7cf298b4bee71200afab626";
|
|
3893
|
+
function validate$4(obj, path = 'UpdateCartItemsOutputRepresentation') {
|
|
3894
|
+
const v_error = (() => {
|
|
3895
|
+
if (typeof obj !== 'object' || ArrayIsArray(obj) || obj === null) {
|
|
3896
|
+
return new TypeError('Expected "object" but received "' + typeof obj + '" (at "' + path + '")');
|
|
3897
|
+
}
|
|
3898
|
+
const obj_apiStatus = obj.apiStatus;
|
|
3899
|
+
const path_apiStatus = path + '.apiStatus';
|
|
3900
|
+
const referencepath_apiStatusValidationError = validate$p(obj_apiStatus, path_apiStatus);
|
|
3901
|
+
if (referencepath_apiStatusValidationError !== null) {
|
|
3902
|
+
let message = 'Object doesn\'t match ApiStatusOutputRepresentation (at "' + path_apiStatus + '")\n';
|
|
3903
|
+
message += referencepath_apiStatusValidationError.message.split('\n').map((line) => '\t' + line).join('\n');
|
|
3904
|
+
return new TypeError(message);
|
|
3905
|
+
}
|
|
3906
|
+
if (obj.cartId !== undefined) {
|
|
3907
|
+
const obj_cartId = obj.cartId;
|
|
3908
|
+
const path_cartId = path + '.cartId';
|
|
3909
|
+
if (typeof obj_cartId !== 'string') {
|
|
3910
|
+
return new TypeError('Expected "string" but received "' + typeof obj_cartId + '" (at "' + path_cartId + '")');
|
|
3911
|
+
}
|
|
3912
|
+
}
|
|
3913
|
+
})();
|
|
3914
|
+
return v_error === undefined ? null : v_error;
|
|
3915
|
+
}
|
|
3916
|
+
const RepresentationType$2 = 'UpdateCartItemsOutputRepresentation';
|
|
3917
|
+
function keyBuilder$2(luvio, config) {
|
|
3918
|
+
return keyPrefix + '::' + RepresentationType$2 + ':' + config.message;
|
|
3919
|
+
}
|
|
3920
|
+
function keyBuilderFromType$2(luvio, object) {
|
|
3921
|
+
const keyParams = {
|
|
3922
|
+
message: object.apiStatus.statusCode
|
|
3923
|
+
};
|
|
3924
|
+
return keyBuilder$2(luvio, keyParams);
|
|
3925
|
+
}
|
|
3926
|
+
function normalize$2(input, existing, path, luvio, store, timestamp) {
|
|
3927
|
+
return input;
|
|
3928
|
+
}
|
|
3929
|
+
const select$5 = function UpdateCartItemsOutputRepresentationSelect() {
|
|
3930
|
+
return {
|
|
3931
|
+
kind: 'Fragment',
|
|
3932
|
+
version: VERSION$2,
|
|
3933
|
+
private: [],
|
|
3934
|
+
opaque: true
|
|
3935
|
+
};
|
|
3936
|
+
};
|
|
3937
|
+
function equals$2(existing, incoming) {
|
|
3938
|
+
if (JSONStringify(incoming) !== JSONStringify(existing)) {
|
|
3939
|
+
return false;
|
|
3940
|
+
}
|
|
3941
|
+
return true;
|
|
3942
|
+
}
|
|
3943
|
+
const ingest$2 = function UpdateCartItemsOutputRepresentationIngest(input, path, luvio, store, timestamp) {
|
|
3944
|
+
if (process.env.NODE_ENV !== 'production') {
|
|
3945
|
+
const validateError = validate$4(input);
|
|
3946
|
+
if (validateError !== null) {
|
|
3947
|
+
throw validateError;
|
|
3948
|
+
}
|
|
3949
|
+
}
|
|
3950
|
+
const key = keyBuilderFromType$2(luvio, input);
|
|
3951
|
+
const existingRecord = store.readEntry(key);
|
|
3952
|
+
const ttlToUse = TTL$2;
|
|
3953
|
+
let incomingRecord = normalize$2(input, store.readEntry(key), {
|
|
3954
|
+
fullPath: key,
|
|
3955
|
+
parent: path.parent,
|
|
3956
|
+
propertyName: path.propertyName,
|
|
3957
|
+
ttl: ttlToUse
|
|
3958
|
+
});
|
|
3959
|
+
if (existingRecord === undefined || equals$2(existingRecord, incomingRecord) === false) {
|
|
3960
|
+
luvio.storePublish(key, incomingRecord);
|
|
3961
|
+
}
|
|
3962
|
+
{
|
|
3963
|
+
const storeMetadataParams = {
|
|
3964
|
+
ttl: ttlToUse,
|
|
3965
|
+
namespace: "cpq",
|
|
3966
|
+
version: VERSION$2,
|
|
3967
|
+
representationName: RepresentationType$2,
|
|
3968
|
+
};
|
|
3969
|
+
luvio.publishStoreMetadata(key, storeMetadataParams);
|
|
3970
|
+
}
|
|
3971
|
+
return createLink(key);
|
|
3972
|
+
};
|
|
3973
|
+
function getTypeCacheKeys$2(luvio, input, fullPathFactory) {
|
|
3974
|
+
const rootKeySet = new StoreKeyMap();
|
|
3975
|
+
// root cache key (uses fullPathFactory if keyBuilderFromType isn't defined)
|
|
3976
|
+
const rootKey = keyBuilderFromType$2(luvio, input);
|
|
3977
|
+
rootKeySet.set(rootKey, {
|
|
3978
|
+
namespace: keyPrefix,
|
|
3979
|
+
representationName: RepresentationType$2,
|
|
3980
|
+
mergeable: false
|
|
3981
|
+
});
|
|
3982
|
+
return rootKeySet;
|
|
3983
|
+
}
|
|
3984
|
+
|
|
3985
|
+
function select$4(luvio, params) {
|
|
3986
|
+
return select$5();
|
|
3987
|
+
}
|
|
3988
|
+
function getResponseCacheKeys$2(luvio, resourceParams, response) {
|
|
3989
|
+
return getTypeCacheKeys$2(luvio, response);
|
|
3990
|
+
}
|
|
3991
|
+
function ingestSuccess$2(luvio, resourceParams, response) {
|
|
3992
|
+
const { body } = response;
|
|
3993
|
+
const key = keyBuilderFromType$2(luvio, body);
|
|
3994
|
+
luvio.storeIngest(key, ingest$2, body);
|
|
3995
|
+
const snapshot = luvio.storeLookup({
|
|
3996
|
+
recordId: key,
|
|
3997
|
+
node: select$4(),
|
|
3998
|
+
variables: {},
|
|
3999
|
+
});
|
|
4000
|
+
if (process.env.NODE_ENV !== 'production') {
|
|
4001
|
+
if (snapshot.state !== 'Fulfilled') {
|
|
4002
|
+
throw new Error('Invalid network response. Expected resource response to result in Fulfilled snapshot');
|
|
4003
|
+
}
|
|
4004
|
+
}
|
|
4005
|
+
deepFreeze(snapshot.data);
|
|
4006
|
+
return snapshot;
|
|
4007
|
+
}
|
|
4008
|
+
function createResourceRequest$2(config) {
|
|
4009
|
+
const headers = {};
|
|
4010
|
+
return {
|
|
4011
|
+
baseUri: '/services/data/v59.0',
|
|
4012
|
+
basePath: '/connect/cpq/carts/' + config.urlParams.cartId + '/items',
|
|
4013
|
+
method: 'patch',
|
|
4014
|
+
body: config.body,
|
|
4015
|
+
urlParams: config.urlParams,
|
|
4016
|
+
queryParams: {},
|
|
4017
|
+
headers,
|
|
4018
|
+
priority: 'normal',
|
|
4019
|
+
};
|
|
4020
|
+
}
|
|
4021
|
+
|
|
4022
|
+
const updateCartItems_ConfigPropertyNames = {
|
|
4023
|
+
displayName: 'updateCartItems',
|
|
4024
|
+
parameters: {
|
|
4025
|
+
required: ['cartId', 'requestBody'],
|
|
4026
|
+
optional: []
|
|
4027
|
+
}
|
|
4028
|
+
};
|
|
4029
|
+
function createResourceParams$2(config) {
|
|
4030
|
+
const resourceParams = {
|
|
4031
|
+
urlParams: {
|
|
4032
|
+
cartId: config.cartId
|
|
4033
|
+
},
|
|
4034
|
+
body: {
|
|
4035
|
+
requestBody: config.requestBody
|
|
4036
|
+
}
|
|
4037
|
+
};
|
|
4038
|
+
return resourceParams;
|
|
4039
|
+
}
|
|
4040
|
+
function typeCheckConfig$2(untrustedConfig) {
|
|
4041
|
+
const config = {};
|
|
4042
|
+
const untrustedConfig_cartId = untrustedConfig.cartId;
|
|
4043
|
+
if (typeof untrustedConfig_cartId === 'string') {
|
|
4044
|
+
config.cartId = untrustedConfig_cartId;
|
|
4045
|
+
}
|
|
4046
|
+
const untrustedConfig_requestBody = untrustedConfig.requestBody;
|
|
4047
|
+
const referenceUpdateCartItemsInputRepresentationValidationError = validate$5(untrustedConfig_requestBody);
|
|
4048
|
+
if (referenceUpdateCartItemsInputRepresentationValidationError === null) {
|
|
4049
|
+
config.requestBody = untrustedConfig_requestBody;
|
|
4050
|
+
}
|
|
4051
|
+
return config;
|
|
4052
|
+
}
|
|
4053
|
+
function validateAdapterConfig$2(untrustedConfig, configPropertyNames) {
|
|
4054
|
+
if (!untrustedIsObject(untrustedConfig)) {
|
|
4055
|
+
return null;
|
|
4056
|
+
}
|
|
4057
|
+
if (process.env.NODE_ENV !== 'production') {
|
|
4058
|
+
validateConfig(untrustedConfig, configPropertyNames);
|
|
4059
|
+
}
|
|
4060
|
+
const config = typeCheckConfig$2(untrustedConfig);
|
|
4061
|
+
if (!areRequiredParametersPresent(config, configPropertyNames)) {
|
|
4062
|
+
return null;
|
|
4063
|
+
}
|
|
4064
|
+
return config;
|
|
4065
|
+
}
|
|
4066
|
+
function buildNetworkSnapshot$2(luvio, config, options) {
|
|
4067
|
+
const resourceParams = createResourceParams$2(config);
|
|
4068
|
+
const request = createResourceRequest$2(resourceParams);
|
|
4069
|
+
return luvio.dispatchResourceRequest(request, options)
|
|
4070
|
+
.then((response) => {
|
|
4071
|
+
return luvio.handleSuccessResponse(() => {
|
|
4072
|
+
const snapshot = ingestSuccess$2(luvio, resourceParams, response);
|
|
4073
|
+
return luvio.storeBroadcast().then(() => snapshot);
|
|
4074
|
+
}, () => getResponseCacheKeys$2(luvio, resourceParams, response.body));
|
|
4075
|
+
}, (response) => {
|
|
4076
|
+
deepFreeze(response);
|
|
4077
|
+
throw response;
|
|
4078
|
+
});
|
|
4079
|
+
}
|
|
4080
|
+
const updateCartItemsAdapterFactory = (luvio) => {
|
|
4081
|
+
return function updateCartItems(untrustedConfig) {
|
|
4082
|
+
const config = validateAdapterConfig$2(untrustedConfig, updateCartItems_ConfigPropertyNames);
|
|
4083
|
+
// Invalid or incomplete config
|
|
4084
|
+
if (config === null) {
|
|
4085
|
+
throw new Error('Invalid config for "updateCartItems"');
|
|
4086
|
+
}
|
|
4087
|
+
return buildNetworkSnapshot$2(luvio, config);
|
|
4088
|
+
};
|
|
4089
|
+
};
|
|
4090
|
+
|
|
4091
|
+
function validate$3(obj, path = 'CreateCartItemsInputRepresentation') {
|
|
4092
|
+
const v_error = (() => {
|
|
4093
|
+
if (typeof obj !== 'object' || ArrayIsArray(obj) || obj === null) {
|
|
4094
|
+
return new TypeError('Expected "object" but received "' + typeof obj + '" (at "' + path + '")');
|
|
4095
|
+
}
|
|
4096
|
+
if (obj.correlationId !== undefined) {
|
|
4097
|
+
const obj_correlationId = obj.correlationId;
|
|
4098
|
+
const path_correlationId = path + '.correlationId';
|
|
4099
|
+
if (typeof obj_correlationId !== 'string') {
|
|
4100
|
+
return new TypeError('Expected "string" but received "' + typeof obj_correlationId + '" (at "' + path_correlationId + '")');
|
|
4101
|
+
}
|
|
4102
|
+
}
|
|
4103
|
+
if (obj.productConfigurations !== undefined) {
|
|
4104
|
+
const obj_productConfigurations = obj.productConfigurations;
|
|
4105
|
+
const path_productConfigurations = path + '.productConfigurations';
|
|
4106
|
+
if (!ArrayIsArray(obj_productConfigurations)) {
|
|
4107
|
+
return new TypeError('Expected "array" but received "' + typeof obj_productConfigurations + '" (at "' + path_productConfigurations + '")');
|
|
4108
|
+
}
|
|
4109
|
+
for (let i = 0; i < obj_productConfigurations.length; i++) {
|
|
4110
|
+
const obj_productConfigurations_item = obj_productConfigurations[i];
|
|
4111
|
+
const path_productConfigurations_item = path_productConfigurations + '[' + i + ']';
|
|
4112
|
+
if (typeof obj_productConfigurations_item !== 'object' || ArrayIsArray(obj_productConfigurations_item) || obj_productConfigurations_item === null) {
|
|
4113
|
+
return new TypeError('Expected "object" but received "' + typeof obj_productConfigurations_item + '" (at "' + path_productConfigurations_item + '")');
|
|
4114
|
+
}
|
|
4115
|
+
}
|
|
4116
|
+
}
|
|
4117
|
+
if (obj.userContext !== undefined) {
|
|
4118
|
+
const obj_userContext = obj.userContext;
|
|
4119
|
+
const path_userContext = path + '.userContext';
|
|
4120
|
+
if (typeof obj_userContext !== 'object' || ArrayIsArray(obj_userContext) || obj_userContext === null) {
|
|
4121
|
+
return new TypeError('Expected "object" but received "' + typeof obj_userContext + '" (at "' + path_userContext + '")');
|
|
4122
|
+
}
|
|
4123
|
+
}
|
|
4124
|
+
})();
|
|
4125
|
+
return v_error === undefined ? null : v_error;
|
|
4126
|
+
}
|
|
4127
|
+
|
|
4128
|
+
const TTL$1 = 1000;
|
|
4129
|
+
const VERSION$1 = "34153309b079451754e6d3fbf85bb8bd";
|
|
4130
|
+
function validate$2(obj, path = 'CreateCartItemsOutputRepresentation') {
|
|
4131
|
+
const v_error = (() => {
|
|
4132
|
+
if (typeof obj !== 'object' || ArrayIsArray(obj) || obj === null) {
|
|
4133
|
+
return new TypeError('Expected "object" but received "' + typeof obj + '" (at "' + path + '")');
|
|
4134
|
+
}
|
|
4135
|
+
const obj_apiStatus = obj.apiStatus;
|
|
4136
|
+
const path_apiStatus = path + '.apiStatus';
|
|
4137
|
+
const referencepath_apiStatusValidationError = validate$p(obj_apiStatus, path_apiStatus);
|
|
4138
|
+
if (referencepath_apiStatusValidationError !== null) {
|
|
4139
|
+
let message = 'Object doesn\'t match ApiStatusOutputRepresentation (at "' + path_apiStatus + '")\n';
|
|
4140
|
+
message += referencepath_apiStatusValidationError.message.split('\n').map((line) => '\t' + line).join('\n');
|
|
4141
|
+
return new TypeError(message);
|
|
4142
|
+
}
|
|
4143
|
+
if (obj.cartId !== undefined) {
|
|
4144
|
+
const obj_cartId = obj.cartId;
|
|
4145
|
+
const path_cartId = path + '.cartId';
|
|
4146
|
+
if (typeof obj_cartId !== 'string') {
|
|
4147
|
+
return new TypeError('Expected "string" but received "' + typeof obj_cartId + '" (at "' + path_cartId + '")');
|
|
4148
|
+
}
|
|
4149
|
+
}
|
|
4150
|
+
})();
|
|
4151
|
+
return v_error === undefined ? null : v_error;
|
|
4152
|
+
}
|
|
4153
|
+
const RepresentationType$1 = 'CreateCartItemsOutputRepresentation';
|
|
4154
|
+
function keyBuilder$1(luvio, config) {
|
|
4155
|
+
return keyPrefix + '::' + RepresentationType$1 + ':' + config.message;
|
|
4156
|
+
}
|
|
4157
|
+
function keyBuilderFromType$1(luvio, object) {
|
|
4158
|
+
const keyParams = {
|
|
4159
|
+
message: object.apiStatus.statusCode
|
|
4160
|
+
};
|
|
4161
|
+
return keyBuilder$1(luvio, keyParams);
|
|
4162
|
+
}
|
|
4163
|
+
function normalize$1(input, existing, path, luvio, store, timestamp) {
|
|
4164
|
+
return input;
|
|
4165
|
+
}
|
|
4166
|
+
const select$3 = function CreateCartItemsOutputRepresentationSelect() {
|
|
4167
|
+
return {
|
|
4168
|
+
kind: 'Fragment',
|
|
4169
|
+
version: VERSION$1,
|
|
4170
|
+
private: [],
|
|
4171
|
+
opaque: true
|
|
4172
|
+
};
|
|
4173
|
+
};
|
|
4174
|
+
function equals$1(existing, incoming) {
|
|
4175
|
+
if (JSONStringify(incoming) !== JSONStringify(existing)) {
|
|
4176
|
+
return false;
|
|
4177
|
+
}
|
|
4178
|
+
return true;
|
|
4179
|
+
}
|
|
4180
|
+
const ingest$1 = function CreateCartItemsOutputRepresentationIngest(input, path, luvio, store, timestamp) {
|
|
4181
|
+
if (process.env.NODE_ENV !== 'production') {
|
|
4182
|
+
const validateError = validate$2(input);
|
|
4183
|
+
if (validateError !== null) {
|
|
4184
|
+
throw validateError;
|
|
4185
|
+
}
|
|
4186
|
+
}
|
|
4187
|
+
const key = keyBuilderFromType$1(luvio, input);
|
|
4188
|
+
const existingRecord = store.readEntry(key);
|
|
4189
|
+
const ttlToUse = TTL$1;
|
|
4190
|
+
let incomingRecord = normalize$1(input, store.readEntry(key), {
|
|
4191
|
+
fullPath: key,
|
|
4192
|
+
parent: path.parent,
|
|
4193
|
+
propertyName: path.propertyName,
|
|
4194
|
+
ttl: ttlToUse
|
|
4195
|
+
});
|
|
4196
|
+
if (existingRecord === undefined || equals$1(existingRecord, incomingRecord) === false) {
|
|
4197
|
+
luvio.storePublish(key, incomingRecord);
|
|
4198
|
+
}
|
|
4199
|
+
{
|
|
4200
|
+
const storeMetadataParams = {
|
|
4201
|
+
ttl: ttlToUse,
|
|
4202
|
+
namespace: "cpq",
|
|
4203
|
+
version: VERSION$1,
|
|
4204
|
+
representationName: RepresentationType$1,
|
|
4205
|
+
};
|
|
4206
|
+
luvio.publishStoreMetadata(key, storeMetadataParams);
|
|
4207
|
+
}
|
|
4208
|
+
return createLink(key);
|
|
4209
|
+
};
|
|
4210
|
+
function getTypeCacheKeys$1(luvio, input, fullPathFactory) {
|
|
4211
|
+
const rootKeySet = new StoreKeyMap();
|
|
4212
|
+
// root cache key (uses fullPathFactory if keyBuilderFromType isn't defined)
|
|
4213
|
+
const rootKey = keyBuilderFromType$1(luvio, input);
|
|
4214
|
+
rootKeySet.set(rootKey, {
|
|
4215
|
+
namespace: keyPrefix,
|
|
4216
|
+
representationName: RepresentationType$1,
|
|
4217
|
+
mergeable: false
|
|
4218
|
+
});
|
|
4219
|
+
return rootKeySet;
|
|
4220
|
+
}
|
|
4221
|
+
|
|
4222
|
+
function select$2(luvio, params) {
|
|
4223
|
+
return select$3();
|
|
4224
|
+
}
|
|
4225
|
+
function getResponseCacheKeys$1(luvio, resourceParams, response) {
|
|
4226
|
+
return getTypeCacheKeys$1(luvio, response);
|
|
4227
|
+
}
|
|
4228
|
+
function ingestSuccess$1(luvio, resourceParams, response) {
|
|
4229
|
+
const { body } = response;
|
|
4230
|
+
const key = keyBuilderFromType$1(luvio, body);
|
|
4231
|
+
luvio.storeIngest(key, ingest$1, body);
|
|
4232
|
+
const snapshot = luvio.storeLookup({
|
|
4233
|
+
recordId: key,
|
|
4234
|
+
node: select$2(),
|
|
4235
|
+
variables: {},
|
|
4236
|
+
});
|
|
4237
|
+
if (process.env.NODE_ENV !== 'production') {
|
|
4238
|
+
if (snapshot.state !== 'Fulfilled') {
|
|
4239
|
+
throw new Error('Invalid network response. Expected resource response to result in Fulfilled snapshot');
|
|
4240
|
+
}
|
|
4241
|
+
}
|
|
4242
|
+
deepFreeze(snapshot.data);
|
|
4243
|
+
return snapshot;
|
|
4244
|
+
}
|
|
4245
|
+
function createResourceRequest$1(config) {
|
|
4246
|
+
const headers = {};
|
|
4247
|
+
return {
|
|
4248
|
+
baseUri: '/services/data/v59.0',
|
|
4249
|
+
basePath: '/connect/cpq/carts/' + config.urlParams.cartId + '/items',
|
|
4250
|
+
method: 'post',
|
|
4251
|
+
body: config.body,
|
|
4252
|
+
urlParams: config.urlParams,
|
|
4253
|
+
queryParams: {},
|
|
4254
|
+
headers,
|
|
4255
|
+
priority: 'normal',
|
|
4256
|
+
};
|
|
4257
|
+
}
|
|
4258
|
+
|
|
4259
|
+
const createCartItems_ConfigPropertyNames = {
|
|
4260
|
+
displayName: 'createCartItems',
|
|
4261
|
+
parameters: {
|
|
4262
|
+
required: ['cartId', 'requestBody'],
|
|
4263
|
+
optional: []
|
|
4264
|
+
}
|
|
4265
|
+
};
|
|
4266
|
+
function createResourceParams$1(config) {
|
|
4267
|
+
const resourceParams = {
|
|
4268
|
+
urlParams: {
|
|
4269
|
+
cartId: config.cartId
|
|
4270
|
+
},
|
|
4271
|
+
body: {
|
|
4272
|
+
requestBody: config.requestBody
|
|
4273
|
+
}
|
|
4274
|
+
};
|
|
4275
|
+
return resourceParams;
|
|
4276
|
+
}
|
|
4277
|
+
function typeCheckConfig$1(untrustedConfig) {
|
|
4278
|
+
const config = {};
|
|
4279
|
+
const untrustedConfig_cartId = untrustedConfig.cartId;
|
|
4280
|
+
if (typeof untrustedConfig_cartId === 'string') {
|
|
4281
|
+
config.cartId = untrustedConfig_cartId;
|
|
4282
|
+
}
|
|
4283
|
+
const untrustedConfig_requestBody = untrustedConfig.requestBody;
|
|
4284
|
+
const referenceCreateCartItemsInputRepresentationValidationError = validate$3(untrustedConfig_requestBody);
|
|
4285
|
+
if (referenceCreateCartItemsInputRepresentationValidationError === null) {
|
|
4286
|
+
config.requestBody = untrustedConfig_requestBody;
|
|
4287
|
+
}
|
|
4288
|
+
return config;
|
|
4289
|
+
}
|
|
4290
|
+
function validateAdapterConfig$1(untrustedConfig, configPropertyNames) {
|
|
4291
|
+
if (!untrustedIsObject(untrustedConfig)) {
|
|
4292
|
+
return null;
|
|
4293
|
+
}
|
|
4294
|
+
if (process.env.NODE_ENV !== 'production') {
|
|
4295
|
+
validateConfig(untrustedConfig, configPropertyNames);
|
|
4296
|
+
}
|
|
4297
|
+
const config = typeCheckConfig$1(untrustedConfig);
|
|
4298
|
+
if (!areRequiredParametersPresent(config, configPropertyNames)) {
|
|
4299
|
+
return null;
|
|
4300
|
+
}
|
|
4301
|
+
return config;
|
|
4302
|
+
}
|
|
4303
|
+
function buildNetworkSnapshot$1(luvio, config, options) {
|
|
4304
|
+
const resourceParams = createResourceParams$1(config);
|
|
4305
|
+
const request = createResourceRequest$1(resourceParams);
|
|
4306
|
+
return luvio.dispatchResourceRequest(request, options)
|
|
4307
|
+
.then((response) => {
|
|
4308
|
+
return luvio.handleSuccessResponse(() => {
|
|
4309
|
+
const snapshot = ingestSuccess$1(luvio, resourceParams, response);
|
|
4310
|
+
return luvio.storeBroadcast().then(() => snapshot);
|
|
4311
|
+
}, () => getResponseCacheKeys$1(luvio, resourceParams, response.body));
|
|
4312
|
+
}, (response) => {
|
|
4313
|
+
deepFreeze(response);
|
|
4314
|
+
throw response;
|
|
4315
|
+
});
|
|
4316
|
+
}
|
|
4317
|
+
const createCartItemsAdapterFactory = (luvio) => {
|
|
4318
|
+
return function createCartItems(untrustedConfig) {
|
|
4319
|
+
const config = validateAdapterConfig$1(untrustedConfig, createCartItems_ConfigPropertyNames);
|
|
4320
|
+
// Invalid or incomplete config
|
|
4321
|
+
if (config === null) {
|
|
4322
|
+
throw new Error('Invalid config for "createCartItems"');
|
|
4323
|
+
}
|
|
4324
|
+
return buildNetworkSnapshot$1(luvio, config);
|
|
4325
|
+
};
|
|
4326
|
+
};
|
|
4327
|
+
|
|
4328
|
+
function validate$1(obj, path = 'PriceCartInputRepresentation') {
|
|
4329
|
+
const v_error = (() => {
|
|
4330
|
+
if (typeof obj !== 'object' || ArrayIsArray(obj) || obj === null) {
|
|
4331
|
+
return new TypeError('Expected "object" but received "' + typeof obj + '" (at "' + path + '")');
|
|
4332
|
+
}
|
|
4333
|
+
if (obj.cartItemPricingConfig !== undefined) {
|
|
4334
|
+
const obj_cartItemPricingConfig = obj.cartItemPricingConfig;
|
|
4335
|
+
const path_cartItemPricingConfig = path + '.cartItemPricingConfig';
|
|
4336
|
+
if (!ArrayIsArray(obj_cartItemPricingConfig)) {
|
|
4337
|
+
return new TypeError('Expected "array" but received "' + typeof obj_cartItemPricingConfig + '" (at "' + path_cartItemPricingConfig + '")');
|
|
4338
|
+
}
|
|
4339
|
+
for (let i = 0; i < obj_cartItemPricingConfig.length; i++) {
|
|
4340
|
+
const obj_cartItemPricingConfig_item = obj_cartItemPricingConfig[i];
|
|
4341
|
+
const path_cartItemPricingConfig_item = path_cartItemPricingConfig + '[' + i + ']';
|
|
4342
|
+
if (typeof obj_cartItemPricingConfig_item !== 'object' || ArrayIsArray(obj_cartItemPricingConfig_item) || obj_cartItemPricingConfig_item === null) {
|
|
4343
|
+
return new TypeError('Expected "object" but received "' + typeof obj_cartItemPricingConfig_item + '" (at "' + path_cartItemPricingConfig_item + '")');
|
|
4344
|
+
}
|
|
4345
|
+
}
|
|
4346
|
+
}
|
|
4347
|
+
if (obj.correlationId !== undefined) {
|
|
4348
|
+
const obj_correlationId = obj.correlationId;
|
|
4349
|
+
const path_correlationId = path + '.correlationId';
|
|
4350
|
+
if (typeof obj_correlationId !== 'string') {
|
|
4351
|
+
return new TypeError('Expected "string" but received "' + typeof obj_correlationId + '" (at "' + path_correlationId + '")');
|
|
4352
|
+
}
|
|
4353
|
+
}
|
|
4354
|
+
if (obj.userContext !== undefined) {
|
|
4355
|
+
const obj_userContext = obj.userContext;
|
|
4356
|
+
const path_userContext = path + '.userContext';
|
|
4357
|
+
if (typeof obj_userContext !== 'object' || ArrayIsArray(obj_userContext) || obj_userContext === null) {
|
|
4358
|
+
return new TypeError('Expected "object" but received "' + typeof obj_userContext + '" (at "' + path_userContext + '")');
|
|
4359
|
+
}
|
|
4360
|
+
}
|
|
4361
|
+
})();
|
|
4362
|
+
return v_error === undefined ? null : v_error;
|
|
4363
|
+
}
|
|
4364
|
+
|
|
4365
|
+
const TTL = 1000;
|
|
4366
|
+
const VERSION = "b1e28ba15f534459065f2870a9dc703d";
|
|
4367
|
+
function validate(obj, path = 'CartPricingTotalOutputRepresentation') {
|
|
4368
|
+
const v_error = (() => {
|
|
4369
|
+
if (typeof obj !== 'object' || ArrayIsArray(obj) || obj === null) {
|
|
4370
|
+
return new TypeError('Expected "object" but received "' + typeof obj + '" (at "' + path + '")');
|
|
4371
|
+
}
|
|
4372
|
+
const obj_apiStatus = obj.apiStatus;
|
|
4373
|
+
const path_apiStatus = path + '.apiStatus';
|
|
4374
|
+
const referencepath_apiStatusValidationError = validate$p(obj_apiStatus, path_apiStatus);
|
|
4375
|
+
if (referencepath_apiStatusValidationError !== null) {
|
|
4376
|
+
let message = 'Object doesn\'t match ApiStatusOutputRepresentation (at "' + path_apiStatus + '")\n';
|
|
4377
|
+
message += referencepath_apiStatusValidationError.message.split('\n').map((line) => '\t' + line).join('\n');
|
|
4378
|
+
return new TypeError(message);
|
|
4379
|
+
}
|
|
4380
|
+
if (obj.cartId !== undefined) {
|
|
4381
|
+
const obj_cartId = obj.cartId;
|
|
4382
|
+
const path_cartId = path + '.cartId';
|
|
4383
|
+
if (typeof obj_cartId !== 'string') {
|
|
4384
|
+
return new TypeError('Expected "string" but received "' + typeof obj_cartId + '" (at "' + path_cartId + '")');
|
|
4385
|
+
}
|
|
4386
|
+
}
|
|
4387
|
+
if (obj.cartPricingTotals !== undefined) {
|
|
4388
|
+
const obj_cartPricingTotals = obj.cartPricingTotals;
|
|
4389
|
+
const path_cartPricingTotals = path + '.cartPricingTotals';
|
|
4390
|
+
if (!ArrayIsArray(obj_cartPricingTotals)) {
|
|
4391
|
+
return new TypeError('Expected "array" but received "' + typeof obj_cartPricingTotals + '" (at "' + path_cartPricingTotals + '")');
|
|
4392
|
+
}
|
|
4393
|
+
for (let i = 0; i < obj_cartPricingTotals.length; i++) {
|
|
4394
|
+
const obj_cartPricingTotals_item = obj_cartPricingTotals[i];
|
|
4395
|
+
const path_cartPricingTotals_item = path_cartPricingTotals + '[' + i + ']';
|
|
4396
|
+
const referencepath_cartPricingTotals_itemValidationError = validate$b(obj_cartPricingTotals_item, path_cartPricingTotals_item);
|
|
4397
|
+
if (referencepath_cartPricingTotals_itemValidationError !== null) {
|
|
4398
|
+
let message = 'Object doesn\'t match PricingTotalOutputRepresentation (at "' + path_cartPricingTotals_item + '")\n';
|
|
4399
|
+
message += referencepath_cartPricingTotals_itemValidationError.message.split('\n').map((line) => '\t' + line).join('\n');
|
|
4400
|
+
return new TypeError(message);
|
|
4401
|
+
}
|
|
4402
|
+
}
|
|
4403
|
+
}
|
|
4404
|
+
})();
|
|
4405
|
+
return v_error === undefined ? null : v_error;
|
|
4406
|
+
}
|
|
4407
|
+
const RepresentationType = 'CartPricingTotalOutputRepresentation';
|
|
4408
|
+
function keyBuilder(luvio, config) {
|
|
4409
|
+
return keyPrefix + '::' + RepresentationType + ':' + config.message;
|
|
4410
|
+
}
|
|
4411
|
+
function keyBuilderFromType(luvio, object) {
|
|
4412
|
+
const keyParams = {
|
|
4413
|
+
message: object.apiStatus.statusCode
|
|
4414
|
+
};
|
|
4415
|
+
return keyBuilder(luvio, keyParams);
|
|
4416
|
+
}
|
|
4417
|
+
function normalize(input, existing, path, luvio, store, timestamp) {
|
|
4418
|
+
return input;
|
|
4419
|
+
}
|
|
4420
|
+
const select$1 = function CartPricingTotalOutputRepresentationSelect() {
|
|
4421
|
+
return {
|
|
4422
|
+
kind: 'Fragment',
|
|
4423
|
+
version: VERSION,
|
|
4424
|
+
private: [],
|
|
4425
|
+
opaque: true
|
|
4426
|
+
};
|
|
4427
|
+
};
|
|
4428
|
+
function equals(existing, incoming) {
|
|
4429
|
+
if (JSONStringify(incoming) !== JSONStringify(existing)) {
|
|
4430
|
+
return false;
|
|
4431
|
+
}
|
|
4432
|
+
return true;
|
|
4433
|
+
}
|
|
4434
|
+
const ingest = function CartPricingTotalOutputRepresentationIngest(input, path, luvio, store, timestamp) {
|
|
4435
|
+
if (process.env.NODE_ENV !== 'production') {
|
|
4436
|
+
const validateError = validate(input);
|
|
4437
|
+
if (validateError !== null) {
|
|
4438
|
+
throw validateError;
|
|
4439
|
+
}
|
|
4440
|
+
}
|
|
4441
|
+
const key = keyBuilderFromType(luvio, input);
|
|
4442
|
+
const existingRecord = store.readEntry(key);
|
|
4443
|
+
const ttlToUse = TTL;
|
|
4444
|
+
let incomingRecord = normalize(input, store.readEntry(key), {
|
|
4445
|
+
fullPath: key,
|
|
4446
|
+
parent: path.parent,
|
|
4447
|
+
propertyName: path.propertyName,
|
|
4448
|
+
ttl: ttlToUse
|
|
4449
|
+
});
|
|
4450
|
+
if (existingRecord === undefined || equals(existingRecord, incomingRecord) === false) {
|
|
4451
|
+
luvio.storePublish(key, incomingRecord);
|
|
4452
|
+
}
|
|
4453
|
+
{
|
|
4454
|
+
const storeMetadataParams = {
|
|
4455
|
+
ttl: ttlToUse,
|
|
4456
|
+
namespace: "cpq",
|
|
4457
|
+
version: VERSION,
|
|
4458
|
+
representationName: RepresentationType,
|
|
4459
|
+
};
|
|
4460
|
+
luvio.publishStoreMetadata(key, storeMetadataParams);
|
|
4461
|
+
}
|
|
4462
|
+
return createLink(key);
|
|
4463
|
+
};
|
|
4464
|
+
function getTypeCacheKeys(luvio, input, fullPathFactory) {
|
|
4465
|
+
const rootKeySet = new StoreKeyMap();
|
|
4466
|
+
// root cache key (uses fullPathFactory if keyBuilderFromType isn't defined)
|
|
4467
|
+
const rootKey = keyBuilderFromType(luvio, input);
|
|
4468
|
+
rootKeySet.set(rootKey, {
|
|
4469
|
+
namespace: keyPrefix,
|
|
4470
|
+
representationName: RepresentationType,
|
|
4471
|
+
mergeable: false
|
|
4472
|
+
});
|
|
4473
|
+
return rootKeySet;
|
|
4474
|
+
}
|
|
4475
|
+
|
|
4476
|
+
function select(luvio, params) {
|
|
4477
|
+
return select$1();
|
|
4478
|
+
}
|
|
4479
|
+
function getResponseCacheKeys(luvio, resourceParams, response) {
|
|
4480
|
+
return getTypeCacheKeys(luvio, response);
|
|
4481
|
+
}
|
|
4482
|
+
function ingestSuccess(luvio, resourceParams, response) {
|
|
4483
|
+
const { body } = response;
|
|
4484
|
+
const key = keyBuilderFromType(luvio, body);
|
|
4485
|
+
luvio.storeIngest(key, ingest, body);
|
|
4486
|
+
const snapshot = luvio.storeLookup({
|
|
4487
|
+
recordId: key,
|
|
4488
|
+
node: select(),
|
|
4489
|
+
variables: {},
|
|
4490
|
+
});
|
|
4491
|
+
if (process.env.NODE_ENV !== 'production') {
|
|
4492
|
+
if (snapshot.state !== 'Fulfilled') {
|
|
4493
|
+
throw new Error('Invalid network response. Expected resource response to result in Fulfilled snapshot');
|
|
4494
|
+
}
|
|
4495
|
+
}
|
|
4496
|
+
deepFreeze(snapshot.data);
|
|
4497
|
+
return snapshot;
|
|
4498
|
+
}
|
|
4499
|
+
function createResourceRequest(config) {
|
|
4500
|
+
const headers = {};
|
|
4501
|
+
return {
|
|
4502
|
+
baseUri: '/services/data/v59.0',
|
|
4503
|
+
basePath: '/connect/cpq/carts/' + config.urlParams.cartId + '/price',
|
|
4504
|
+
method: 'patch',
|
|
4505
|
+
body: config.body,
|
|
4506
|
+
urlParams: config.urlParams,
|
|
4507
|
+
queryParams: {},
|
|
4508
|
+
headers,
|
|
4509
|
+
priority: 'normal',
|
|
4510
|
+
};
|
|
4511
|
+
}
|
|
4512
|
+
|
|
4513
|
+
const priceCart_ConfigPropertyNames = {
|
|
4514
|
+
displayName: 'priceCart',
|
|
4515
|
+
parameters: {
|
|
4516
|
+
required: ['cartId', 'requestBody'],
|
|
4517
|
+
optional: []
|
|
4518
|
+
}
|
|
4519
|
+
};
|
|
4520
|
+
function createResourceParams(config) {
|
|
4521
|
+
const resourceParams = {
|
|
4522
|
+
urlParams: {
|
|
4523
|
+
cartId: config.cartId
|
|
4524
|
+
},
|
|
4525
|
+
body: {
|
|
4526
|
+
requestBody: config.requestBody
|
|
4527
|
+
}
|
|
4528
|
+
};
|
|
4529
|
+
return resourceParams;
|
|
4530
|
+
}
|
|
4531
|
+
function typeCheckConfig(untrustedConfig) {
|
|
4532
|
+
const config = {};
|
|
4533
|
+
const untrustedConfig_cartId = untrustedConfig.cartId;
|
|
4534
|
+
if (typeof untrustedConfig_cartId === 'string') {
|
|
4535
|
+
config.cartId = untrustedConfig_cartId;
|
|
4536
|
+
}
|
|
4537
|
+
const untrustedConfig_requestBody = untrustedConfig.requestBody;
|
|
4538
|
+
const referencePriceCartInputRepresentationValidationError = validate$1(untrustedConfig_requestBody);
|
|
4539
|
+
if (referencePriceCartInputRepresentationValidationError === null) {
|
|
4540
|
+
config.requestBody = untrustedConfig_requestBody;
|
|
4541
|
+
}
|
|
4542
|
+
return config;
|
|
4543
|
+
}
|
|
4544
|
+
function validateAdapterConfig(untrustedConfig, configPropertyNames) {
|
|
4545
|
+
if (!untrustedIsObject(untrustedConfig)) {
|
|
4546
|
+
return null;
|
|
4547
|
+
}
|
|
4548
|
+
if (process.env.NODE_ENV !== 'production') {
|
|
4549
|
+
validateConfig(untrustedConfig, configPropertyNames);
|
|
4550
|
+
}
|
|
4551
|
+
const config = typeCheckConfig(untrustedConfig);
|
|
4552
|
+
if (!areRequiredParametersPresent(config, configPropertyNames)) {
|
|
4553
|
+
return null;
|
|
4554
|
+
}
|
|
4555
|
+
return config;
|
|
4556
|
+
}
|
|
4557
|
+
function buildNetworkSnapshot(luvio, config, options) {
|
|
4558
|
+
const resourceParams = createResourceParams(config);
|
|
4559
|
+
const request = createResourceRequest(resourceParams);
|
|
4560
|
+
return luvio.dispatchResourceRequest(request, options)
|
|
4561
|
+
.then((response) => {
|
|
4562
|
+
return luvio.handleSuccessResponse(() => {
|
|
4563
|
+
const snapshot = ingestSuccess(luvio, resourceParams, response);
|
|
4564
|
+
return luvio.storeBroadcast().then(() => snapshot);
|
|
4565
|
+
}, () => getResponseCacheKeys(luvio, resourceParams, response.body));
|
|
4566
|
+
}, (response) => {
|
|
4567
|
+
deepFreeze(response);
|
|
4568
|
+
throw response;
|
|
4569
|
+
});
|
|
4570
|
+
}
|
|
4571
|
+
const priceCartAdapterFactory = (luvio) => {
|
|
4572
|
+
return function priceCart(untrustedConfig) {
|
|
4573
|
+
const config = validateAdapterConfig(untrustedConfig, priceCart_ConfigPropertyNames);
|
|
4574
|
+
// Invalid or incomplete config
|
|
4575
|
+
if (config === null) {
|
|
4576
|
+
throw new Error('Invalid config for "priceCart"');
|
|
4577
|
+
}
|
|
1006
4578
|
return buildNetworkSnapshot(luvio, config);
|
|
1007
4579
|
};
|
|
1008
4580
|
};
|
|
1009
4581
|
|
|
1010
|
-
export { SearchProductsListAdapterFactory, previewAdapterFactory, productDetailsAdapterFactory, productListAdapterFactory };
|
|
4582
|
+
export { SearchProductsListAdapterFactory, createCartAdapterFactory, createCartItemsAdapterFactory, getCartAdapterFactory, previewAdapterFactory, priceCartAdapterFactory, productDetailsAdapterFactory, productListAdapterFactory, updateCartAdapterFactory, updateCartItemsAdapterFactory };
|