@salesforce/lds-adapters-industries-epc 1.183.0 → 1.185.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-epc.js +877 -269
- package/dist/es/es2018/types/src/generated/adapters/getProductById.d.ts +27 -0
- package/dist/es/es2018/types/src/generated/artifacts/main.d.ts +1 -0
- package/dist/es/es2018/types/src/generated/artifacts/sfdc.d.ts +3 -1
- package/dist/es/es2018/types/src/generated/resources/getConnectEpcProductsByProductId.d.ts +18 -0
- package/dist/es/es2018/types/src/generated/types/ProductClassificationOutputRepresentation.d.ts +28 -0
- package/dist/es/es2018/types/src/generated/types/ProductComponentGroupOutputRepresentation.d.ts +62 -0
- package/dist/es/es2018/types/src/generated/types/ProductOutputRepresentation.d.ts +20 -1
- package/dist/es/es2018/types/src/generated/types/ProductSpecificationRecordTypeOutputRepresentation.d.ts +28 -0
- package/dist/es/es2018/types/src/generated/types/ProductSpecificationTypeOutputRepresentation.d.ts +28 -0
- package/dist/es/es2018/types/src/generated/types/ProductsOutputRepresentation.d.ts +48 -0
- package/dist/es/es2018/types/src/generated/types/Status.d.ts +5 -5
- package/package.json +1 -1
- package/sfdc/index.js +768 -152
- package/src/raml/api.raml +131 -1
- package/src/raml/luvio.raml +4 -0
|
@@ -52,13 +52,26 @@ const keyPrefix = 'epc';
|
|
|
52
52
|
|
|
53
53
|
const { isArray: ArrayIsArray } = Array;
|
|
54
54
|
const { stringify: JSONStringify } = JSON;
|
|
55
|
+
function equalsArray(a, b, equalsItem) {
|
|
56
|
+
const aLength = a.length;
|
|
57
|
+
const bLength = b.length;
|
|
58
|
+
if (aLength !== bLength) {
|
|
59
|
+
return false;
|
|
60
|
+
}
|
|
61
|
+
for (let i = 0; i < aLength; i++) {
|
|
62
|
+
if (equalsItem(a[i], b[i]) === false) {
|
|
63
|
+
return false;
|
|
64
|
+
}
|
|
65
|
+
}
|
|
66
|
+
return true;
|
|
67
|
+
}
|
|
55
68
|
function createLink(ref) {
|
|
56
69
|
return {
|
|
57
70
|
__ref: serializeStructuredKey(ref),
|
|
58
71
|
};
|
|
59
72
|
}
|
|
60
73
|
|
|
61
|
-
function validate$
|
|
74
|
+
function validate$k(obj, path = 'DeactivateInputRepresentation') {
|
|
62
75
|
const v_error = (() => {
|
|
63
76
|
if (typeof obj !== 'object' || ArrayIsArray(obj) || obj === null) {
|
|
64
77
|
return new TypeError('Expected "object" but received "' + typeof obj + '" (at "' + path + '")');
|
|
@@ -91,7 +104,7 @@ function validate$g(obj, path = 'DeactivateInputRepresentation') {
|
|
|
91
104
|
return v_error === undefined ? null : v_error;
|
|
92
105
|
}
|
|
93
106
|
|
|
94
|
-
function validate$
|
|
107
|
+
function validate$j(obj, path = 'ErrorOutputRepresentation') {
|
|
95
108
|
const v_error = (() => {
|
|
96
109
|
if (typeof obj !== 'object' || ArrayIsArray(obj) || obj === null) {
|
|
97
110
|
return new TypeError('Expected "object" but received "' + typeof obj + '" (at "' + path + '")');
|
|
@@ -123,8 +136,8 @@ function validate$f(obj, path = 'ErrorOutputRepresentation') {
|
|
|
123
136
|
}
|
|
124
137
|
|
|
125
138
|
const TTL$3 = 6000;
|
|
126
|
-
const VERSION$
|
|
127
|
-
function validate$
|
|
139
|
+
const VERSION$5 = "67abdeaa299bae24f468fd2e78cd1e1e";
|
|
140
|
+
function validate$i(obj, path = 'RecordIdMapOutputRepresentation') {
|
|
128
141
|
const v_error = (() => {
|
|
129
142
|
if (typeof obj !== 'object' || ArrayIsArray(obj) || obj === null) {
|
|
130
143
|
return new TypeError('Expected "object" but received "' + typeof obj + '" (at "' + path + '")');
|
|
@@ -137,7 +150,7 @@ function validate$e(obj, path = 'RecordIdMapOutputRepresentation') {
|
|
|
137
150
|
for (let i = 0; i < obj_errors.length; i++) {
|
|
138
151
|
const obj_errors_item = obj_errors[i];
|
|
139
152
|
const path_errors_item = path_errors + '[' + i + ']';
|
|
140
|
-
const referencepath_errors_itemValidationError = validate$
|
|
153
|
+
const referencepath_errors_itemValidationError = validate$j(obj_errors_item, path_errors_item);
|
|
141
154
|
if (referencepath_errors_itemValidationError !== null) {
|
|
142
155
|
let message = 'Object doesn\'t match ErrorOutputRepresentation (at "' + path_errors_item + '")\n';
|
|
143
156
|
message += referencepath_errors_itemValidationError.message.split('\n').map((line) => '\t' + line).join('\n');
|
|
@@ -152,36 +165,36 @@ function validate$e(obj, path = 'RecordIdMapOutputRepresentation') {
|
|
|
152
165
|
})();
|
|
153
166
|
return v_error === undefined ? null : v_error;
|
|
154
167
|
}
|
|
155
|
-
const RepresentationType$
|
|
156
|
-
function keyBuilder$
|
|
157
|
-
return keyPrefix + '::' + RepresentationType$
|
|
168
|
+
const RepresentationType$4 = 'RecordIdMapOutputRepresentation';
|
|
169
|
+
function keyBuilder$7(luvio, config) {
|
|
170
|
+
return keyPrefix + '::' + RepresentationType$4 + ':' + config.message;
|
|
158
171
|
}
|
|
159
172
|
function keyBuilderFromType$1(luvio, object) {
|
|
160
173
|
const keyParams = {
|
|
161
174
|
message: object.status
|
|
162
175
|
};
|
|
163
|
-
return keyBuilder$
|
|
176
|
+
return keyBuilder$7(luvio, keyParams);
|
|
164
177
|
}
|
|
165
|
-
function normalize$
|
|
178
|
+
function normalize$4(input, existing, path, luvio, store, timestamp) {
|
|
166
179
|
return input;
|
|
167
180
|
}
|
|
168
|
-
const select$
|
|
181
|
+
const select$a = function RecordIdMapOutputRepresentationSelect() {
|
|
169
182
|
return {
|
|
170
183
|
kind: 'Fragment',
|
|
171
|
-
version: VERSION$
|
|
184
|
+
version: VERSION$5,
|
|
172
185
|
private: [],
|
|
173
186
|
opaque: true
|
|
174
187
|
};
|
|
175
188
|
};
|
|
176
|
-
function equals$
|
|
189
|
+
function equals$5(existing, incoming) {
|
|
177
190
|
if (JSONStringify(incoming) !== JSONStringify(existing)) {
|
|
178
191
|
return false;
|
|
179
192
|
}
|
|
180
193
|
return true;
|
|
181
194
|
}
|
|
182
|
-
const ingest$
|
|
195
|
+
const ingest$4 = function RecordIdMapOutputRepresentationIngest(input, path, luvio, store, timestamp) {
|
|
183
196
|
if (process.env.NODE_ENV !== 'production') {
|
|
184
|
-
const validateError = validate$
|
|
197
|
+
const validateError = validate$i(input);
|
|
185
198
|
if (validateError !== null) {
|
|
186
199
|
throw validateError;
|
|
187
200
|
}
|
|
@@ -189,49 +202,49 @@ const ingest$3 = function RecordIdMapOutputRepresentationIngest(input, path, luv
|
|
|
189
202
|
const key = keyBuilderFromType$1(luvio, input);
|
|
190
203
|
const existingRecord = store.readEntry(key);
|
|
191
204
|
const ttlToUse = TTL$3;
|
|
192
|
-
let incomingRecord = normalize$
|
|
205
|
+
let incomingRecord = normalize$4(input, store.readEntry(key), {
|
|
193
206
|
fullPath: key,
|
|
194
207
|
parent: path.parent,
|
|
195
208
|
propertyName: path.propertyName,
|
|
196
209
|
ttl: ttlToUse
|
|
197
210
|
});
|
|
198
|
-
if (existingRecord === undefined || equals$
|
|
211
|
+
if (existingRecord === undefined || equals$5(existingRecord, incomingRecord) === false) {
|
|
199
212
|
luvio.storePublish(key, incomingRecord);
|
|
200
213
|
}
|
|
201
214
|
{
|
|
202
215
|
const storeMetadataParams = {
|
|
203
216
|
ttl: ttlToUse,
|
|
204
217
|
namespace: "epc",
|
|
205
|
-
version: VERSION$
|
|
206
|
-
representationName: RepresentationType$
|
|
218
|
+
version: VERSION$5,
|
|
219
|
+
representationName: RepresentationType$4,
|
|
207
220
|
};
|
|
208
221
|
luvio.publishStoreMetadata(key, storeMetadataParams);
|
|
209
222
|
}
|
|
210
223
|
return createLink(key);
|
|
211
224
|
};
|
|
212
|
-
function getTypeCacheKeys$
|
|
225
|
+
function getTypeCacheKeys$4(rootKeySet, luvio, input, fullPathFactory) {
|
|
213
226
|
// root cache key (uses fullPathFactory if keyBuilderFromType isn't defined)
|
|
214
227
|
const rootKey = keyBuilderFromType$1(luvio, input);
|
|
215
228
|
rootKeySet.set(rootKey, {
|
|
216
229
|
namespace: keyPrefix,
|
|
217
|
-
representationName: RepresentationType$
|
|
230
|
+
representationName: RepresentationType$4,
|
|
218
231
|
mergeable: false
|
|
219
232
|
});
|
|
220
233
|
}
|
|
221
234
|
|
|
222
|
-
function select$
|
|
223
|
-
return select$
|
|
235
|
+
function select$9(luvio, params) {
|
|
236
|
+
return select$a();
|
|
224
237
|
}
|
|
225
|
-
function getResponseCacheKeys$
|
|
226
|
-
getTypeCacheKeys$
|
|
238
|
+
function getResponseCacheKeys$4(storeKeyMap, luvio, resourceParams, response) {
|
|
239
|
+
getTypeCacheKeys$4(storeKeyMap, luvio, response);
|
|
227
240
|
}
|
|
228
|
-
function ingestSuccess$
|
|
241
|
+
function ingestSuccess$4(luvio, resourceParams, response) {
|
|
229
242
|
const { body } = response;
|
|
230
243
|
const key = keyBuilderFromType$1(luvio, body);
|
|
231
|
-
luvio.storeIngest(key, ingest$
|
|
244
|
+
luvio.storeIngest(key, ingest$4, body);
|
|
232
245
|
const snapshot = luvio.storeLookup({
|
|
233
246
|
recordId: key,
|
|
234
|
-
node: select$
|
|
247
|
+
node: select$9(),
|
|
235
248
|
variables: {},
|
|
236
249
|
});
|
|
237
250
|
if (process.env.NODE_ENV !== 'production') {
|
|
@@ -242,7 +255,7 @@ function ingestSuccess$3(luvio, resourceParams, response) {
|
|
|
242
255
|
deepFreeze(snapshot.data);
|
|
243
256
|
return snapshot;
|
|
244
257
|
}
|
|
245
|
-
function createResourceRequest$
|
|
258
|
+
function createResourceRequest$4(config) {
|
|
246
259
|
const headers = {};
|
|
247
260
|
return {
|
|
248
261
|
baseUri: '/services/data/v59.0',
|
|
@@ -263,7 +276,7 @@ const deactivate_ConfigPropertyNames = {
|
|
|
263
276
|
optional: []
|
|
264
277
|
}
|
|
265
278
|
};
|
|
266
|
-
function createResourceParams$
|
|
279
|
+
function createResourceParams$4(config) {
|
|
267
280
|
const resourceParams = {
|
|
268
281
|
body: {
|
|
269
282
|
deactivateInputPayload: config.deactivateInputPayload
|
|
@@ -271,39 +284,39 @@ function createResourceParams$3(config) {
|
|
|
271
284
|
};
|
|
272
285
|
return resourceParams;
|
|
273
286
|
}
|
|
274
|
-
function typeCheckConfig$
|
|
287
|
+
function typeCheckConfig$4(untrustedConfig) {
|
|
275
288
|
const config = {};
|
|
276
289
|
const untrustedConfig_deactivateInputPayload = untrustedConfig.deactivateInputPayload;
|
|
277
|
-
const referenceDeactivateInputRepresentationValidationError = validate$
|
|
290
|
+
const referenceDeactivateInputRepresentationValidationError = validate$k(untrustedConfig_deactivateInputPayload);
|
|
278
291
|
if (referenceDeactivateInputRepresentationValidationError === null) {
|
|
279
292
|
config.deactivateInputPayload = untrustedConfig_deactivateInputPayload;
|
|
280
293
|
}
|
|
281
294
|
return config;
|
|
282
295
|
}
|
|
283
|
-
function validateAdapterConfig$
|
|
296
|
+
function validateAdapterConfig$4(untrustedConfig, configPropertyNames) {
|
|
284
297
|
if (!untrustedIsObject(untrustedConfig)) {
|
|
285
298
|
return null;
|
|
286
299
|
}
|
|
287
300
|
if (process.env.NODE_ENV !== 'production') {
|
|
288
301
|
validateConfig(untrustedConfig, configPropertyNames);
|
|
289
302
|
}
|
|
290
|
-
const config = typeCheckConfig$
|
|
303
|
+
const config = typeCheckConfig$4(untrustedConfig);
|
|
291
304
|
if (!areRequiredParametersPresent(config, configPropertyNames)) {
|
|
292
305
|
return null;
|
|
293
306
|
}
|
|
294
307
|
return config;
|
|
295
308
|
}
|
|
296
|
-
function buildNetworkSnapshot$
|
|
297
|
-
const resourceParams = createResourceParams$
|
|
298
|
-
const request = createResourceRequest$
|
|
309
|
+
function buildNetworkSnapshot$4(luvio, config, options) {
|
|
310
|
+
const resourceParams = createResourceParams$4(config);
|
|
311
|
+
const request = createResourceRequest$4(resourceParams);
|
|
299
312
|
return luvio.dispatchResourceRequest(request, options)
|
|
300
313
|
.then((response) => {
|
|
301
314
|
return luvio.handleSuccessResponse(() => {
|
|
302
|
-
const snapshot = ingestSuccess$
|
|
315
|
+
const snapshot = ingestSuccess$4(luvio, resourceParams, response);
|
|
303
316
|
return luvio.storeBroadcast().then(() => snapshot);
|
|
304
317
|
}, () => {
|
|
305
318
|
const cache = new StoreKeyMap();
|
|
306
|
-
getResponseCacheKeys$
|
|
319
|
+
getResponseCacheKeys$4(cache, luvio, resourceParams, response.body);
|
|
307
320
|
return cache;
|
|
308
321
|
});
|
|
309
322
|
}, (response) => {
|
|
@@ -313,16 +326,16 @@ function buildNetworkSnapshot$3(luvio, config, options) {
|
|
|
313
326
|
}
|
|
314
327
|
const deactivateAdapterFactory = (luvio) => {
|
|
315
328
|
return function deactivate(untrustedConfig) {
|
|
316
|
-
const config = validateAdapterConfig$
|
|
329
|
+
const config = validateAdapterConfig$4(untrustedConfig, deactivate_ConfigPropertyNames);
|
|
317
330
|
// Invalid or incomplete config
|
|
318
331
|
if (config === null) {
|
|
319
332
|
throw new Error('Invalid config for "deactivate"');
|
|
320
333
|
}
|
|
321
|
-
return buildNetworkSnapshot$
|
|
334
|
+
return buildNetworkSnapshot$4(luvio, config);
|
|
322
335
|
};
|
|
323
336
|
};
|
|
324
337
|
|
|
325
|
-
function validate$
|
|
338
|
+
function validate$h(obj, path = 'ProductAttributeDefinitionListInputRepresentation') {
|
|
326
339
|
const v_error = (() => {
|
|
327
340
|
if (typeof obj !== 'object' || ArrayIsArray(obj) || obj === null) {
|
|
328
341
|
return new TypeError('Expected "object" but received "' + typeof obj + '" (at "' + path + '")');
|
|
@@ -343,7 +356,7 @@ function validate$d(obj, path = 'ProductAttributeDefinitionListInputRepresentati
|
|
|
343
356
|
return v_error === undefined ? null : v_error;
|
|
344
357
|
}
|
|
345
358
|
|
|
346
|
-
function validate$
|
|
359
|
+
function validate$g(obj, path = 'ProductAttributeDefinitionRepresentation') {
|
|
347
360
|
const v_error = (() => {
|
|
348
361
|
if (typeof obj !== 'object' || ArrayIsArray(obj) || obj === null) {
|
|
349
362
|
return new TypeError('Expected "object" but received "' + typeof obj + '" (at "' + path + '")');
|
|
@@ -367,8 +380,8 @@ function validate$c(obj, path = 'ProductAttributeDefinitionRepresentation') {
|
|
|
367
380
|
}
|
|
368
381
|
|
|
369
382
|
const TTL$2 = 6000;
|
|
370
|
-
const VERSION$
|
|
371
|
-
function validate$
|
|
383
|
+
const VERSION$4 = "e67d3c8569b9667eac98cc1a9840041c";
|
|
384
|
+
function validate$f(obj, path = 'ProductAttributeDefinitionListRepresentation') {
|
|
372
385
|
const v_error = (() => {
|
|
373
386
|
if (typeof obj !== 'object' || ArrayIsArray(obj) || obj === null) {
|
|
374
387
|
return new TypeError('Expected "object" but received "' + typeof obj + '" (at "' + path + '")');
|
|
@@ -381,7 +394,7 @@ function validate$b(obj, path = 'ProductAttributeDefinitionListRepresentation')
|
|
|
381
394
|
for (let i = 0; i < obj_data.length; i++) {
|
|
382
395
|
const obj_data_item = obj_data[i];
|
|
383
396
|
const path_data_item = path_data + '[' + i + ']';
|
|
384
|
-
const referencepath_data_itemValidationError = validate$
|
|
397
|
+
const referencepath_data_itemValidationError = validate$g(obj_data_item, path_data_item);
|
|
385
398
|
if (referencepath_data_itemValidationError !== null) {
|
|
386
399
|
let message = 'Object doesn\'t match ProductAttributeDefinitionRepresentation (at "' + path_data_item + '")\n';
|
|
387
400
|
message += referencepath_data_itemValidationError.message.split('\n').map((line) => '\t' + line).join('\n');
|
|
@@ -396,36 +409,36 @@ function validate$b(obj, path = 'ProductAttributeDefinitionListRepresentation')
|
|
|
396
409
|
})();
|
|
397
410
|
return v_error === undefined ? null : v_error;
|
|
398
411
|
}
|
|
399
|
-
const RepresentationType$
|
|
400
|
-
function keyBuilder$
|
|
401
|
-
return keyPrefix + '::' + RepresentationType$
|
|
412
|
+
const RepresentationType$3 = 'ProductAttributeDefinitionListRepresentation';
|
|
413
|
+
function keyBuilder$6(luvio, config) {
|
|
414
|
+
return keyPrefix + '::' + RepresentationType$3 + ':' + config.message;
|
|
402
415
|
}
|
|
403
416
|
function keyBuilderFromType(luvio, object) {
|
|
404
417
|
const keyParams = {
|
|
405
418
|
message: object.message
|
|
406
419
|
};
|
|
407
|
-
return keyBuilder$
|
|
420
|
+
return keyBuilder$6(luvio, keyParams);
|
|
408
421
|
}
|
|
409
|
-
function normalize$
|
|
422
|
+
function normalize$3(input, existing, path, luvio, store, timestamp) {
|
|
410
423
|
return input;
|
|
411
424
|
}
|
|
412
|
-
const select$
|
|
425
|
+
const select$8 = function ProductAttributeDefinitionListRepresentationSelect() {
|
|
413
426
|
return {
|
|
414
427
|
kind: 'Fragment',
|
|
415
|
-
version: VERSION$
|
|
428
|
+
version: VERSION$4,
|
|
416
429
|
private: [],
|
|
417
430
|
opaque: true
|
|
418
431
|
};
|
|
419
432
|
};
|
|
420
|
-
function equals$
|
|
433
|
+
function equals$4(existing, incoming) {
|
|
421
434
|
if (JSONStringify(incoming) !== JSONStringify(existing)) {
|
|
422
435
|
return false;
|
|
423
436
|
}
|
|
424
437
|
return true;
|
|
425
438
|
}
|
|
426
|
-
const ingest$
|
|
439
|
+
const ingest$3 = function ProductAttributeDefinitionListRepresentationIngest(input, path, luvio, store, timestamp) {
|
|
427
440
|
if (process.env.NODE_ENV !== 'production') {
|
|
428
|
-
const validateError = validate$
|
|
441
|
+
const validateError = validate$f(input);
|
|
429
442
|
if (validateError !== null) {
|
|
430
443
|
throw validateError;
|
|
431
444
|
}
|
|
@@ -433,49 +446,49 @@ const ingest$2 = function ProductAttributeDefinitionListRepresentationIngest(inp
|
|
|
433
446
|
const key = keyBuilderFromType(luvio, input);
|
|
434
447
|
const existingRecord = store.readEntry(key);
|
|
435
448
|
const ttlToUse = TTL$2;
|
|
436
|
-
let incomingRecord = normalize$
|
|
449
|
+
let incomingRecord = normalize$3(input, store.readEntry(key), {
|
|
437
450
|
fullPath: key,
|
|
438
451
|
parent: path.parent,
|
|
439
452
|
propertyName: path.propertyName,
|
|
440
453
|
ttl: ttlToUse
|
|
441
454
|
});
|
|
442
|
-
if (existingRecord === undefined || equals$
|
|
455
|
+
if (existingRecord === undefined || equals$4(existingRecord, incomingRecord) === false) {
|
|
443
456
|
luvio.storePublish(key, incomingRecord);
|
|
444
457
|
}
|
|
445
458
|
{
|
|
446
459
|
const storeMetadataParams = {
|
|
447
460
|
ttl: ttlToUse,
|
|
448
461
|
namespace: "epc",
|
|
449
|
-
version: VERSION$
|
|
450
|
-
representationName: RepresentationType$
|
|
462
|
+
version: VERSION$4,
|
|
463
|
+
representationName: RepresentationType$3,
|
|
451
464
|
};
|
|
452
465
|
luvio.publishStoreMetadata(key, storeMetadataParams);
|
|
453
466
|
}
|
|
454
467
|
return createLink(key);
|
|
455
468
|
};
|
|
456
|
-
function getTypeCacheKeys$
|
|
469
|
+
function getTypeCacheKeys$3(rootKeySet, luvio, input, fullPathFactory) {
|
|
457
470
|
// root cache key (uses fullPathFactory if keyBuilderFromType isn't defined)
|
|
458
471
|
const rootKey = keyBuilderFromType(luvio, input);
|
|
459
472
|
rootKeySet.set(rootKey, {
|
|
460
473
|
namespace: keyPrefix,
|
|
461
|
-
representationName: RepresentationType$
|
|
474
|
+
representationName: RepresentationType$3,
|
|
462
475
|
mergeable: false
|
|
463
476
|
});
|
|
464
477
|
}
|
|
465
478
|
|
|
466
|
-
function select$
|
|
467
|
-
return select$
|
|
479
|
+
function select$7(luvio, params) {
|
|
480
|
+
return select$8();
|
|
468
481
|
}
|
|
469
|
-
function getResponseCacheKeys$
|
|
470
|
-
getTypeCacheKeys$
|
|
482
|
+
function getResponseCacheKeys$3(storeKeyMap, luvio, resourceParams, response) {
|
|
483
|
+
getTypeCacheKeys$3(storeKeyMap, luvio, response);
|
|
471
484
|
}
|
|
472
|
-
function ingestSuccess$
|
|
485
|
+
function ingestSuccess$3(luvio, resourceParams, response) {
|
|
473
486
|
const { body } = response;
|
|
474
487
|
const key = keyBuilderFromType(luvio, body);
|
|
475
|
-
luvio.storeIngest(key, ingest$
|
|
488
|
+
luvio.storeIngest(key, ingest$3, body);
|
|
476
489
|
const snapshot = luvio.storeLookup({
|
|
477
490
|
recordId: key,
|
|
478
|
-
node: select$
|
|
491
|
+
node: select$7(),
|
|
479
492
|
variables: {},
|
|
480
493
|
});
|
|
481
494
|
if (process.env.NODE_ENV !== 'production') {
|
|
@@ -486,7 +499,7 @@ function ingestSuccess$2(luvio, resourceParams, response) {
|
|
|
486
499
|
deepFreeze(snapshot.data);
|
|
487
500
|
return snapshot;
|
|
488
501
|
}
|
|
489
|
-
function createResourceRequest$
|
|
502
|
+
function createResourceRequest$3(config) {
|
|
490
503
|
const headers = {};
|
|
491
504
|
return {
|
|
492
505
|
baseUri: '/services/data/v59.0',
|
|
@@ -507,7 +520,7 @@ const createProductAttributeDefinition_ConfigPropertyNames = {
|
|
|
507
520
|
optional: []
|
|
508
521
|
}
|
|
509
522
|
};
|
|
510
|
-
function createResourceParams$
|
|
523
|
+
function createResourceParams$3(config) {
|
|
511
524
|
const resourceParams = {
|
|
512
525
|
body: {
|
|
513
526
|
productAttributeDefinitionListInputPayload: config.productAttributeDefinitionListInputPayload
|
|
@@ -515,39 +528,39 @@ function createResourceParams$2(config) {
|
|
|
515
528
|
};
|
|
516
529
|
return resourceParams;
|
|
517
530
|
}
|
|
518
|
-
function typeCheckConfig$
|
|
531
|
+
function typeCheckConfig$3(untrustedConfig) {
|
|
519
532
|
const config = {};
|
|
520
533
|
const untrustedConfig_productAttributeDefinitionListInputPayload = untrustedConfig.productAttributeDefinitionListInputPayload;
|
|
521
|
-
const referenceProductAttributeDefinitionListInputRepresentationValidationError = validate$
|
|
534
|
+
const referenceProductAttributeDefinitionListInputRepresentationValidationError = validate$h(untrustedConfig_productAttributeDefinitionListInputPayload);
|
|
522
535
|
if (referenceProductAttributeDefinitionListInputRepresentationValidationError === null) {
|
|
523
536
|
config.productAttributeDefinitionListInputPayload = untrustedConfig_productAttributeDefinitionListInputPayload;
|
|
524
537
|
}
|
|
525
538
|
return config;
|
|
526
539
|
}
|
|
527
|
-
function validateAdapterConfig$
|
|
540
|
+
function validateAdapterConfig$3(untrustedConfig, configPropertyNames) {
|
|
528
541
|
if (!untrustedIsObject(untrustedConfig)) {
|
|
529
542
|
return null;
|
|
530
543
|
}
|
|
531
544
|
if (process.env.NODE_ENV !== 'production') {
|
|
532
545
|
validateConfig(untrustedConfig, configPropertyNames);
|
|
533
546
|
}
|
|
534
|
-
const config = typeCheckConfig$
|
|
547
|
+
const config = typeCheckConfig$3(untrustedConfig);
|
|
535
548
|
if (!areRequiredParametersPresent(config, configPropertyNames)) {
|
|
536
549
|
return null;
|
|
537
550
|
}
|
|
538
551
|
return config;
|
|
539
552
|
}
|
|
540
|
-
function buildNetworkSnapshot$
|
|
541
|
-
const resourceParams = createResourceParams$
|
|
542
|
-
const request = createResourceRequest$
|
|
553
|
+
function buildNetworkSnapshot$3(luvio, config, options) {
|
|
554
|
+
const resourceParams = createResourceParams$3(config);
|
|
555
|
+
const request = createResourceRequest$3(resourceParams);
|
|
543
556
|
return luvio.dispatchResourceRequest(request, options)
|
|
544
557
|
.then((response) => {
|
|
545
558
|
return luvio.handleSuccessResponse(() => {
|
|
546
|
-
const snapshot = ingestSuccess$
|
|
559
|
+
const snapshot = ingestSuccess$3(luvio, resourceParams, response);
|
|
547
560
|
return luvio.storeBroadcast().then(() => snapshot);
|
|
548
561
|
}, () => {
|
|
549
562
|
const cache = new StoreKeyMap();
|
|
550
|
-
getResponseCacheKeys$
|
|
563
|
+
getResponseCacheKeys$3(cache, luvio, resourceParams, response.body);
|
|
551
564
|
return cache;
|
|
552
565
|
});
|
|
553
566
|
}, (response) => {
|
|
@@ -557,16 +570,16 @@ function buildNetworkSnapshot$2(luvio, config, options) {
|
|
|
557
570
|
}
|
|
558
571
|
const createProductAttributeDefinitionAdapterFactory = (luvio) => {
|
|
559
572
|
return function createProductAttributeDefinition(untrustedConfig) {
|
|
560
|
-
const config = validateAdapterConfig$
|
|
573
|
+
const config = validateAdapterConfig$3(untrustedConfig, createProductAttributeDefinition_ConfigPropertyNames);
|
|
561
574
|
// Invalid or incomplete config
|
|
562
575
|
if (config === null) {
|
|
563
576
|
throw new Error('Invalid config for "createProductAttributeDefinition"');
|
|
564
577
|
}
|
|
565
|
-
return buildNetworkSnapshot$
|
|
578
|
+
return buildNetworkSnapshot$3(luvio, config);
|
|
566
579
|
};
|
|
567
580
|
};
|
|
568
581
|
|
|
569
|
-
function validate$
|
|
582
|
+
function validate$e(obj, path = 'ProductFlowConnectRepresentation') {
|
|
570
583
|
const v_error = (() => {
|
|
571
584
|
if (typeof obj !== 'object' || ArrayIsArray(obj) || obj === null) {
|
|
572
585
|
return new TypeError('Expected "object" but received "' + typeof obj + '" (at "' + path + '")');
|
|
@@ -582,28 +595,81 @@ function validate$a(obj, path = 'ProductFlowConnectRepresentation') {
|
|
|
582
595
|
return v_error === undefined ? null : v_error;
|
|
583
596
|
}
|
|
584
597
|
|
|
585
|
-
|
|
598
|
+
const VERSION$3 = "9e839ceea7c6caa2747b4d3170bd209d";
|
|
599
|
+
function validate$d(obj, path = 'Status') {
|
|
586
600
|
const v_error = (() => {
|
|
587
601
|
if (typeof obj !== 'object' || ArrayIsArray(obj) || obj === null) {
|
|
588
602
|
return new TypeError('Expected "object" but received "' + typeof obj + '" (at "' + path + '")');
|
|
589
603
|
}
|
|
590
|
-
|
|
591
|
-
|
|
592
|
-
|
|
593
|
-
|
|
604
|
+
if (obj.code !== undefined) {
|
|
605
|
+
const obj_code = obj.code;
|
|
606
|
+
const path_code = path + '.code';
|
|
607
|
+
if (typeof obj_code !== 'string') {
|
|
608
|
+
return new TypeError('Expected "string" but received "' + typeof obj_code + '" (at "' + path_code + '")');
|
|
609
|
+
}
|
|
594
610
|
}
|
|
595
|
-
|
|
596
|
-
|
|
597
|
-
|
|
598
|
-
|
|
611
|
+
if (obj.message !== undefined) {
|
|
612
|
+
const obj_message = obj.message;
|
|
613
|
+
const path_message = path + '.message';
|
|
614
|
+
if (typeof obj_message !== 'string') {
|
|
615
|
+
return new TypeError('Expected "string" but received "' + typeof obj_message + '" (at "' + path_message + '")');
|
|
616
|
+
}
|
|
599
617
|
}
|
|
600
618
|
})();
|
|
601
619
|
return v_error === undefined ? null : v_error;
|
|
602
620
|
}
|
|
621
|
+
const select$6 = function StatusSelect() {
|
|
622
|
+
return {
|
|
623
|
+
kind: 'Fragment',
|
|
624
|
+
version: VERSION$3,
|
|
625
|
+
private: [],
|
|
626
|
+
selections: [
|
|
627
|
+
{
|
|
628
|
+
name: 'code',
|
|
629
|
+
kind: 'Scalar',
|
|
630
|
+
required: false
|
|
631
|
+
},
|
|
632
|
+
{
|
|
633
|
+
name: 'message',
|
|
634
|
+
kind: 'Scalar',
|
|
635
|
+
required: false
|
|
636
|
+
}
|
|
637
|
+
]
|
|
638
|
+
};
|
|
639
|
+
};
|
|
640
|
+
function equals$3(existing, incoming) {
|
|
641
|
+
const existing_code = existing.code;
|
|
642
|
+
const incoming_code = incoming.code;
|
|
643
|
+
// if at least one of these optionals is defined
|
|
644
|
+
if (existing_code !== undefined || incoming_code !== undefined) {
|
|
645
|
+
// if one of these is not defined we know the other is defined and therefore
|
|
646
|
+
// not equal
|
|
647
|
+
if (existing_code === undefined || incoming_code === undefined) {
|
|
648
|
+
return false;
|
|
649
|
+
}
|
|
650
|
+
if (!(existing_code === incoming_code)) {
|
|
651
|
+
return false;
|
|
652
|
+
}
|
|
653
|
+
}
|
|
654
|
+
const existing_message = existing.message;
|
|
655
|
+
const incoming_message = incoming.message;
|
|
656
|
+
// if at least one of these optionals is defined
|
|
657
|
+
if (existing_message !== undefined || incoming_message !== undefined) {
|
|
658
|
+
// if one of these is not defined we know the other is defined and therefore
|
|
659
|
+
// not equal
|
|
660
|
+
if (existing_message === undefined || incoming_message === undefined) {
|
|
661
|
+
return false;
|
|
662
|
+
}
|
|
663
|
+
if (!(existing_message === incoming_message)) {
|
|
664
|
+
return false;
|
|
665
|
+
}
|
|
666
|
+
}
|
|
667
|
+
return true;
|
|
668
|
+
}
|
|
603
669
|
|
|
604
670
|
const TTL$1 = 6000;
|
|
605
|
-
const VERSION$
|
|
606
|
-
function validate$
|
|
671
|
+
const VERSION$2 = "a75aed3c640fb969c24561ef4f8cb169";
|
|
672
|
+
function validate$c(obj, path = 'ProductFlowOutputRepresentation') {
|
|
607
673
|
const v_error = (() => {
|
|
608
674
|
if (typeof obj !== 'object' || ArrayIsArray(obj) || obj === null) {
|
|
609
675
|
return new TypeError('Expected "object" but received "' + typeof obj + '" (at "' + path + '")');
|
|
@@ -618,7 +684,7 @@ function validate$8(obj, path = 'ProductFlowOutputRepresentation') {
|
|
|
618
684
|
if (obj.productFlow !== undefined) {
|
|
619
685
|
const obj_productFlow = obj.productFlow;
|
|
620
686
|
const path_productFlow = path + '.productFlow';
|
|
621
|
-
const referencepath_productFlowValidationError = validate$
|
|
687
|
+
const referencepath_productFlowValidationError = validate$e(obj_productFlow, path_productFlow);
|
|
622
688
|
if (referencepath_productFlowValidationError !== null) {
|
|
623
689
|
let message = 'Object doesn\'t match ProductFlowConnectRepresentation (at "' + path_productFlow + '")\n';
|
|
624
690
|
message += referencepath_productFlowValidationError.message.split('\n').map((line) => '\t' + line).join('\n');
|
|
@@ -628,7 +694,7 @@ function validate$8(obj, path = 'ProductFlowOutputRepresentation') {
|
|
|
628
694
|
if (obj.status !== undefined) {
|
|
629
695
|
const obj_status = obj.status;
|
|
630
696
|
const path_status = path + '.status';
|
|
631
|
-
const referencepath_statusValidationError = validate$
|
|
697
|
+
const referencepath_statusValidationError = validate$d(obj_status, path_status);
|
|
632
698
|
if (referencepath_statusValidationError !== null) {
|
|
633
699
|
let message = 'Object doesn\'t match Status (at "' + path_status + '")\n';
|
|
634
700
|
message += referencepath_statusValidationError.message.split('\n').map((line) => '\t' + line).join('\n');
|
|
@@ -638,27 +704,27 @@ function validate$8(obj, path = 'ProductFlowOutputRepresentation') {
|
|
|
638
704
|
})();
|
|
639
705
|
return v_error === undefined ? null : v_error;
|
|
640
706
|
}
|
|
641
|
-
const RepresentationType$
|
|
642
|
-
function normalize$
|
|
707
|
+
const RepresentationType$2 = 'ProductFlowOutputRepresentation';
|
|
708
|
+
function normalize$2(input, existing, path, luvio, store, timestamp) {
|
|
643
709
|
return input;
|
|
644
710
|
}
|
|
645
|
-
const select$
|
|
711
|
+
const select$5 = function ProductFlowOutputRepresentationSelect() {
|
|
646
712
|
return {
|
|
647
713
|
kind: 'Fragment',
|
|
648
|
-
version: VERSION$
|
|
714
|
+
version: VERSION$2,
|
|
649
715
|
private: [],
|
|
650
716
|
opaque: true
|
|
651
717
|
};
|
|
652
718
|
};
|
|
653
|
-
function equals$
|
|
719
|
+
function equals$2(existing, incoming) {
|
|
654
720
|
if (JSONStringify(incoming) !== JSONStringify(existing)) {
|
|
655
721
|
return false;
|
|
656
722
|
}
|
|
657
723
|
return true;
|
|
658
724
|
}
|
|
659
|
-
const ingest$
|
|
725
|
+
const ingest$2 = function ProductFlowOutputRepresentationIngest(input, path, luvio, store, timestamp) {
|
|
660
726
|
if (process.env.NODE_ENV !== 'production') {
|
|
661
|
-
const validateError = validate$
|
|
727
|
+
const validateError = validate$c(input);
|
|
662
728
|
if (validateError !== null) {
|
|
663
729
|
throw validateError;
|
|
664
730
|
}
|
|
@@ -666,52 +732,52 @@ const ingest$1 = function ProductFlowOutputRepresentationIngest(input, path, luv
|
|
|
666
732
|
const key = path.fullPath;
|
|
667
733
|
const existingRecord = store.readEntry(key);
|
|
668
734
|
const ttlToUse = TTL$1;
|
|
669
|
-
let incomingRecord = normalize$
|
|
735
|
+
let incomingRecord = normalize$2(input, store.readEntry(key), {
|
|
670
736
|
fullPath: key,
|
|
671
737
|
parent: path.parent,
|
|
672
738
|
propertyName: path.propertyName,
|
|
673
739
|
ttl: ttlToUse
|
|
674
740
|
});
|
|
675
|
-
if (existingRecord === undefined || equals$
|
|
741
|
+
if (existingRecord === undefined || equals$2(existingRecord, incomingRecord) === false) {
|
|
676
742
|
luvio.storePublish(key, incomingRecord);
|
|
677
743
|
}
|
|
678
744
|
{
|
|
679
745
|
const storeMetadataParams = {
|
|
680
746
|
ttl: ttlToUse,
|
|
681
747
|
namespace: "epc",
|
|
682
|
-
version: VERSION$
|
|
683
|
-
representationName: RepresentationType$
|
|
748
|
+
version: VERSION$2,
|
|
749
|
+
representationName: RepresentationType$2,
|
|
684
750
|
};
|
|
685
751
|
luvio.publishStoreMetadata(key, storeMetadataParams);
|
|
686
752
|
}
|
|
687
753
|
return createLink(key);
|
|
688
754
|
};
|
|
689
|
-
function getTypeCacheKeys$
|
|
755
|
+
function getTypeCacheKeys$2(rootKeySet, luvio, input, fullPathFactory) {
|
|
690
756
|
// root cache key (uses fullPathFactory if keyBuilderFromType isn't defined)
|
|
691
757
|
const rootKey = fullPathFactory();
|
|
692
758
|
rootKeySet.set(rootKey, {
|
|
693
759
|
namespace: keyPrefix,
|
|
694
|
-
representationName: RepresentationType$
|
|
760
|
+
representationName: RepresentationType$2,
|
|
695
761
|
mergeable: false
|
|
696
762
|
});
|
|
697
763
|
}
|
|
698
764
|
|
|
699
|
-
function select$
|
|
700
|
-
return select$
|
|
765
|
+
function select$4(luvio, params) {
|
|
766
|
+
return select$5();
|
|
701
767
|
}
|
|
702
|
-
function keyBuilder$
|
|
768
|
+
function keyBuilder$5(luvio, params) {
|
|
703
769
|
return keyPrefix + '::ProductFlowOutputRepresentation:(' + 'correlationId:' + params.queryParams.correlationId + ',' + 'productId:' + params.urlParams.productId + ')';
|
|
704
770
|
}
|
|
705
|
-
function getResponseCacheKeys$
|
|
706
|
-
getTypeCacheKeys$
|
|
771
|
+
function getResponseCacheKeys$2(storeKeyMap, luvio, resourceParams, response) {
|
|
772
|
+
getTypeCacheKeys$2(storeKeyMap, luvio, response, () => keyBuilder$5(luvio, resourceParams));
|
|
707
773
|
}
|
|
708
|
-
function ingestSuccess$
|
|
774
|
+
function ingestSuccess$2(luvio, resourceParams, response, snapshotRefresh) {
|
|
709
775
|
const { body } = response;
|
|
710
|
-
const key = keyBuilder$
|
|
711
|
-
luvio.storeIngest(key, ingest$
|
|
776
|
+
const key = keyBuilder$5(luvio, resourceParams);
|
|
777
|
+
luvio.storeIngest(key, ingest$2, body);
|
|
712
778
|
const snapshot = luvio.storeLookup({
|
|
713
779
|
recordId: key,
|
|
714
|
-
node: select$
|
|
780
|
+
node: select$4(),
|
|
715
781
|
variables: {},
|
|
716
782
|
}, snapshotRefresh);
|
|
717
783
|
if (process.env.NODE_ENV !== 'production') {
|
|
@@ -722,19 +788,19 @@ function ingestSuccess$1(luvio, resourceParams, response, snapshotRefresh) {
|
|
|
722
788
|
deepFreeze(snapshot.data);
|
|
723
789
|
return snapshot;
|
|
724
790
|
}
|
|
725
|
-
function ingestError$
|
|
726
|
-
const key = keyBuilder$
|
|
791
|
+
function ingestError$2(luvio, params, error, snapshotRefresh) {
|
|
792
|
+
const key = keyBuilder$5(luvio, params);
|
|
727
793
|
const errorSnapshot = luvio.errorSnapshot(error, snapshotRefresh);
|
|
728
794
|
const storeMetadataParams = {
|
|
729
795
|
ttl: TTL$1,
|
|
730
796
|
namespace: keyPrefix,
|
|
731
|
-
version: VERSION$
|
|
732
|
-
representationName: RepresentationType$
|
|
797
|
+
version: VERSION$2,
|
|
798
|
+
representationName: RepresentationType$2
|
|
733
799
|
};
|
|
734
800
|
luvio.storeIngestError(key, errorSnapshot, storeMetadataParams);
|
|
735
801
|
return errorSnapshot;
|
|
736
802
|
}
|
|
737
|
-
function createResourceRequest$
|
|
803
|
+
function createResourceRequest$2(config) {
|
|
738
804
|
const headers = {};
|
|
739
805
|
return {
|
|
740
806
|
baseUri: '/services/data/v59.0',
|
|
@@ -755,7 +821,7 @@ const getProductFlowByProductId_ConfigPropertyNames = {
|
|
|
755
821
|
optional: ['correlationId']
|
|
756
822
|
}
|
|
757
823
|
};
|
|
758
|
-
function createResourceParams$
|
|
824
|
+
function createResourceParams$2(config) {
|
|
759
825
|
const resourceParams = {
|
|
760
826
|
urlParams: {
|
|
761
827
|
productId: config.productId
|
|
@@ -766,11 +832,11 @@ function createResourceParams$1(config) {
|
|
|
766
832
|
};
|
|
767
833
|
return resourceParams;
|
|
768
834
|
}
|
|
769
|
-
function keyBuilder$
|
|
770
|
-
const resourceParams = createResourceParams$
|
|
771
|
-
return keyBuilder$
|
|
835
|
+
function keyBuilder$4(luvio, config) {
|
|
836
|
+
const resourceParams = createResourceParams$2(config);
|
|
837
|
+
return keyBuilder$5(luvio, resourceParams);
|
|
772
838
|
}
|
|
773
|
-
function typeCheckConfig$
|
|
839
|
+
function typeCheckConfig$2(untrustedConfig) {
|
|
774
840
|
const config = {};
|
|
775
841
|
const untrustedConfig_productId = untrustedConfig.productId;
|
|
776
842
|
if (typeof untrustedConfig_productId === 'string') {
|
|
@@ -782,52 +848,52 @@ function typeCheckConfig$1(untrustedConfig) {
|
|
|
782
848
|
}
|
|
783
849
|
return config;
|
|
784
850
|
}
|
|
785
|
-
function validateAdapterConfig$
|
|
851
|
+
function validateAdapterConfig$2(untrustedConfig, configPropertyNames) {
|
|
786
852
|
if (!untrustedIsObject(untrustedConfig)) {
|
|
787
853
|
return null;
|
|
788
854
|
}
|
|
789
855
|
if (process.env.NODE_ENV !== 'production') {
|
|
790
856
|
validateConfig(untrustedConfig, configPropertyNames);
|
|
791
857
|
}
|
|
792
|
-
const config = typeCheckConfig$
|
|
858
|
+
const config = typeCheckConfig$2(untrustedConfig);
|
|
793
859
|
if (!areRequiredParametersPresent(config, configPropertyNames)) {
|
|
794
860
|
return null;
|
|
795
861
|
}
|
|
796
862
|
return config;
|
|
797
863
|
}
|
|
798
|
-
function adapterFragment$
|
|
799
|
-
createResourceParams$
|
|
800
|
-
return select$
|
|
864
|
+
function adapterFragment$2(luvio, config) {
|
|
865
|
+
createResourceParams$2(config);
|
|
866
|
+
return select$4();
|
|
801
867
|
}
|
|
802
|
-
function onFetchResponseSuccess$
|
|
803
|
-
const snapshot = ingestSuccess$
|
|
868
|
+
function onFetchResponseSuccess$2(luvio, config, resourceParams, response) {
|
|
869
|
+
const snapshot = ingestSuccess$2(luvio, resourceParams, response, {
|
|
804
870
|
config,
|
|
805
|
-
resolve: () => buildNetworkSnapshot$
|
|
871
|
+
resolve: () => buildNetworkSnapshot$2(luvio, config, snapshotRefreshOptions)
|
|
806
872
|
});
|
|
807
873
|
return luvio.storeBroadcast().then(() => snapshot);
|
|
808
874
|
}
|
|
809
|
-
function onFetchResponseError$
|
|
810
|
-
const snapshot = ingestError$
|
|
875
|
+
function onFetchResponseError$2(luvio, config, resourceParams, response) {
|
|
876
|
+
const snapshot = ingestError$2(luvio, resourceParams, response, {
|
|
811
877
|
config,
|
|
812
|
-
resolve: () => buildNetworkSnapshot$
|
|
878
|
+
resolve: () => buildNetworkSnapshot$2(luvio, config, snapshotRefreshOptions)
|
|
813
879
|
});
|
|
814
880
|
return luvio.storeBroadcast().then(() => snapshot);
|
|
815
881
|
}
|
|
816
|
-
function buildNetworkSnapshot$
|
|
817
|
-
const resourceParams = createResourceParams$
|
|
818
|
-
const request = createResourceRequest$
|
|
882
|
+
function buildNetworkSnapshot$2(luvio, config, options) {
|
|
883
|
+
const resourceParams = createResourceParams$2(config);
|
|
884
|
+
const request = createResourceRequest$2(resourceParams);
|
|
819
885
|
return luvio.dispatchResourceRequest(request, options)
|
|
820
886
|
.then((response) => {
|
|
821
|
-
return luvio.handleSuccessResponse(() => onFetchResponseSuccess$
|
|
887
|
+
return luvio.handleSuccessResponse(() => onFetchResponseSuccess$2(luvio, config, resourceParams, response), () => {
|
|
822
888
|
const cache = new StoreKeyMap();
|
|
823
|
-
getResponseCacheKeys$
|
|
889
|
+
getResponseCacheKeys$2(cache, luvio, resourceParams, response.body);
|
|
824
890
|
return cache;
|
|
825
891
|
});
|
|
826
892
|
}, (response) => {
|
|
827
|
-
return luvio.handleErrorResponse(() => onFetchResponseError$
|
|
893
|
+
return luvio.handleErrorResponse(() => onFetchResponseError$2(luvio, config, resourceParams, response));
|
|
828
894
|
});
|
|
829
895
|
}
|
|
830
|
-
function buildNetworkSnapshotCachePolicy$
|
|
896
|
+
function buildNetworkSnapshotCachePolicy$2(context, coercedAdapterRequestContext) {
|
|
831
897
|
const { luvio, config } = context;
|
|
832
898
|
const { networkPriority, requestCorrelator, eventObservers } = coercedAdapterRequestContext;
|
|
833
899
|
const dispatchOptions = {
|
|
@@ -842,32 +908,32 @@ function buildNetworkSnapshotCachePolicy$1(context, coercedAdapterRequestContext
|
|
|
842
908
|
priority: networkPriority
|
|
843
909
|
};
|
|
844
910
|
}
|
|
845
|
-
return buildNetworkSnapshot$
|
|
911
|
+
return buildNetworkSnapshot$2(luvio, config, dispatchOptions);
|
|
846
912
|
}
|
|
847
|
-
function buildCachedSnapshotCachePolicy$
|
|
913
|
+
function buildCachedSnapshotCachePolicy$2(context, storeLookup) {
|
|
848
914
|
const { luvio, config } = context;
|
|
849
915
|
const selector = {
|
|
850
|
-
recordId: keyBuilder$
|
|
851
|
-
node: adapterFragment$
|
|
916
|
+
recordId: keyBuilder$4(luvio, config),
|
|
917
|
+
node: adapterFragment$2(luvio, config),
|
|
852
918
|
variables: {},
|
|
853
919
|
};
|
|
854
920
|
const cacheSnapshot = storeLookup(selector, {
|
|
855
921
|
config,
|
|
856
|
-
resolve: () => buildNetworkSnapshot$
|
|
922
|
+
resolve: () => buildNetworkSnapshot$2(luvio, config, snapshotRefreshOptions)
|
|
857
923
|
});
|
|
858
924
|
return cacheSnapshot;
|
|
859
925
|
}
|
|
860
926
|
const getProductFlowByProductIdAdapterFactory = (luvio) => function epc__getProductFlowByProductId(untrustedConfig, requestContext) {
|
|
861
|
-
const config = validateAdapterConfig$
|
|
927
|
+
const config = validateAdapterConfig$2(untrustedConfig, getProductFlowByProductId_ConfigPropertyNames);
|
|
862
928
|
// Invalid or incomplete config
|
|
863
929
|
if (config === null) {
|
|
864
930
|
return null;
|
|
865
931
|
}
|
|
866
932
|
return luvio.applyCachePolicy((requestContext || {}), { config, luvio }, // BuildSnapshotContext
|
|
867
|
-
buildCachedSnapshotCachePolicy$
|
|
933
|
+
buildCachedSnapshotCachePolicy$2, buildNetworkSnapshotCachePolicy$2);
|
|
868
934
|
};
|
|
869
935
|
|
|
870
|
-
function validate$
|
|
936
|
+
function validate$b(obj, path = 'AttributePicklistValueOutputRepresentation') {
|
|
871
937
|
const v_error = (() => {
|
|
872
938
|
if (typeof obj !== 'object' || ArrayIsArray(obj) || obj === null) {
|
|
873
939
|
return new TypeError('Expected "object" but received "' + typeof obj + '" (at "' + path + '")');
|
|
@@ -946,7 +1012,7 @@ function validate$7(obj, path = 'AttributePicklistValueOutputRepresentation') {
|
|
|
946
1012
|
return v_error === undefined ? null : v_error;
|
|
947
1013
|
}
|
|
948
1014
|
|
|
949
|
-
function validate$
|
|
1015
|
+
function validate$a(obj, path = 'AttributePicklistOutputRepresentation') {
|
|
950
1016
|
const v_error = (() => {
|
|
951
1017
|
if (typeof obj !== 'object' || ArrayIsArray(obj) || obj === null) {
|
|
952
1018
|
return new TypeError('Expected "object" but received "' + typeof obj + '" (at "' + path + '")');
|
|
@@ -995,7 +1061,7 @@ function validate$6(obj, path = 'AttributePicklistOutputRepresentation') {
|
|
|
995
1061
|
for (let i = 0; i < obj_values.length; i++) {
|
|
996
1062
|
const obj_values_item = obj_values[i];
|
|
997
1063
|
const path_values_item = path_values + '[' + i + ']';
|
|
998
|
-
const referencepath_values_itemValidationError = validate$
|
|
1064
|
+
const referencepath_values_itemValidationError = validate$b(obj_values_item, path_values_item);
|
|
999
1065
|
if (referencepath_values_itemValidationError !== null) {
|
|
1000
1066
|
let message = 'Object doesn\'t match AttributePicklistValueOutputRepresentation (at "' + path_values_item + '")\n';
|
|
1001
1067
|
message += referencepath_values_itemValidationError.message.split('\n').map((line) => '\t' + line).join('\n');
|
|
@@ -1007,7 +1073,7 @@ function validate$6(obj, path = 'AttributePicklistOutputRepresentation') {
|
|
|
1007
1073
|
return v_error === undefined ? null : v_error;
|
|
1008
1074
|
}
|
|
1009
1075
|
|
|
1010
|
-
function validate$
|
|
1076
|
+
function validate$9(obj, path = 'AttributeDefinitionOutputRepresentation') {
|
|
1011
1077
|
const v_error = (() => {
|
|
1012
1078
|
if (typeof obj !== 'object' || ArrayIsArray(obj) || obj === null) {
|
|
1013
1079
|
return new TypeError('Expected "object" but received "' + typeof obj + '" (at "' + path + '")');
|
|
@@ -1127,7 +1193,7 @@ function validate$5(obj, path = 'AttributeDefinitionOutputRepresentation') {
|
|
|
1127
1193
|
if (obj.picklist !== undefined) {
|
|
1128
1194
|
const obj_picklist = obj.picklist;
|
|
1129
1195
|
const path_picklist = path + '.picklist';
|
|
1130
|
-
const referencepath_picklistValidationError = validate$
|
|
1196
|
+
const referencepath_picklistValidationError = validate$a(obj_picklist, path_picklist);
|
|
1131
1197
|
if (referencepath_picklistValidationError !== null) {
|
|
1132
1198
|
let message = 'Object doesn\'t match AttributePicklistOutputRepresentation (at "' + path_picklist + '")\n';
|
|
1133
1199
|
message += referencepath_picklistValidationError.message.split('\n').map((line) => '\t' + line).join('\n');
|
|
@@ -1145,7 +1211,7 @@ function validate$5(obj, path = 'AttributeDefinitionOutputRepresentation') {
|
|
|
1145
1211
|
return v_error === undefined ? null : v_error;
|
|
1146
1212
|
}
|
|
1147
1213
|
|
|
1148
|
-
function validate$
|
|
1214
|
+
function validate$8(obj, path = 'AttributeCategoryOutputRepresentation') {
|
|
1149
1215
|
const v_error = (() => {
|
|
1150
1216
|
if (typeof obj !== 'object' || ArrayIsArray(obj) || obj === null) {
|
|
1151
1217
|
return new TypeError('Expected "object" but received "' + typeof obj + '" (at "' + path + '")');
|
|
@@ -1159,7 +1225,7 @@ function validate$4(obj, path = 'AttributeCategoryOutputRepresentation') {
|
|
|
1159
1225
|
for (let i = 0; i < obj_attributes.length; i++) {
|
|
1160
1226
|
const obj_attributes_item = obj_attributes[i];
|
|
1161
1227
|
const path_attributes_item = path_attributes + '[' + i + ']';
|
|
1162
|
-
const referencepath_attributes_itemValidationError = validate$
|
|
1228
|
+
const referencepath_attributes_itemValidationError = validate$9(obj_attributes_item, path_attributes_item);
|
|
1163
1229
|
if (referencepath_attributes_itemValidationError !== null) {
|
|
1164
1230
|
let message = 'Object doesn\'t match AttributeDefinitionOutputRepresentation (at "' + path_attributes_item + '")\n';
|
|
1165
1231
|
message += referencepath_attributes_itemValidationError.message.split('\n').map((line) => '\t' + line).join('\n');
|
|
@@ -1192,7 +1258,7 @@ function validate$4(obj, path = 'AttributeCategoryOutputRepresentation') {
|
|
|
1192
1258
|
return v_error === undefined ? null : v_error;
|
|
1193
1259
|
}
|
|
1194
1260
|
|
|
1195
|
-
function validate$
|
|
1261
|
+
function validate$7(obj, path = 'PricingModelOutputRepresentation') {
|
|
1196
1262
|
const v_error = (() => {
|
|
1197
1263
|
if (typeof obj !== 'object' || ArrayIsArray(obj) || obj === null) {
|
|
1198
1264
|
return new TypeError('Expected "object" but received "' + typeof obj + '" (at "' + path + '")');
|
|
@@ -1243,7 +1309,7 @@ function validate$3(obj, path = 'PricingModelOutputRepresentation') {
|
|
|
1243
1309
|
return v_error === undefined ? null : v_error;
|
|
1244
1310
|
}
|
|
1245
1311
|
|
|
1246
|
-
function validate$
|
|
1312
|
+
function validate$6(obj, path = 'PriceOutputRepresentation') {
|
|
1247
1313
|
const v_error = (() => {
|
|
1248
1314
|
if (typeof obj !== 'object' || ArrayIsArray(obj) || obj === null) {
|
|
1249
1315
|
return new TypeError('Expected "object" but received "' + typeof obj + '" (at "' + path + '")');
|
|
@@ -1279,7 +1345,7 @@ function validate$2(obj, path = 'PriceOutputRepresentation') {
|
|
|
1279
1345
|
if (obj.pricingModel !== undefined) {
|
|
1280
1346
|
const obj_pricingModel = obj.pricingModel;
|
|
1281
1347
|
const path_pricingModel = path + '.pricingModel';
|
|
1282
|
-
const referencepath_pricingModelValidationError = validate$
|
|
1348
|
+
const referencepath_pricingModelValidationError = validate$7(obj_pricingModel, path_pricingModel);
|
|
1283
1349
|
if (referencepath_pricingModelValidationError !== null) {
|
|
1284
1350
|
let message = 'Object doesn\'t match PricingModelOutputRepresentation (at "' + path_pricingModel + '")\n';
|
|
1285
1351
|
message += referencepath_pricingModelValidationError.message.split('\n').map((line) => '\t' + line).join('\n');
|
|
@@ -1297,86 +1363,45 @@ function validate$2(obj, path = 'PriceOutputRepresentation') {
|
|
|
1297
1363
|
return v_error === undefined ? null : v_error;
|
|
1298
1364
|
}
|
|
1299
1365
|
|
|
1300
|
-
function validate$
|
|
1366
|
+
function validate$5(obj, path = 'ProductClassificationOutputRepresentation') {
|
|
1301
1367
|
const v_error = (() => {
|
|
1302
1368
|
if (typeof obj !== 'object' || ArrayIsArray(obj) || obj === null) {
|
|
1303
1369
|
return new TypeError('Expected "object" but received "' + typeof obj + '" (at "' + path + '")');
|
|
1304
1370
|
}
|
|
1305
|
-
if (obj.
|
|
1306
|
-
obj.
|
|
1307
|
-
|
|
1308
|
-
|
|
1309
|
-
|
|
1310
|
-
|
|
1311
|
-
if (obj.quantity !== undefined) {
|
|
1312
|
-
obj.quantity;
|
|
1371
|
+
if (obj.id !== undefined) {
|
|
1372
|
+
const obj_id = obj.id;
|
|
1373
|
+
const path_id = path + '.id';
|
|
1374
|
+
if (typeof obj_id !== 'string') {
|
|
1375
|
+
return new TypeError('Expected "string" but received "' + typeof obj_id + '" (at "' + path_id + '")');
|
|
1376
|
+
}
|
|
1313
1377
|
}
|
|
1314
1378
|
})();
|
|
1315
1379
|
return v_error === undefined ? null : v_error;
|
|
1316
1380
|
}
|
|
1317
1381
|
|
|
1318
|
-
|
|
1319
|
-
const VERSION = "59486918cad0cc20f8b6c12d84d03600";
|
|
1320
|
-
function validate(obj, path = 'ProductOutputRepresentation') {
|
|
1382
|
+
function validate$4(obj, path = 'ProductComponentGroupOutputRepresentation') {
|
|
1321
1383
|
const v_error = (() => {
|
|
1322
1384
|
if (typeof obj !== 'object' || ArrayIsArray(obj) || obj === null) {
|
|
1323
1385
|
return new TypeError('Expected "object" but received "' + typeof obj + '" (at "' + path + '")');
|
|
1324
1386
|
}
|
|
1325
|
-
if (obj.
|
|
1326
|
-
const
|
|
1327
|
-
const
|
|
1328
|
-
if (
|
|
1329
|
-
return new TypeError('Expected "
|
|
1330
|
-
}
|
|
1331
|
-
for (let i = 0; i < obj_attributeCategory.length; i++) {
|
|
1332
|
-
const obj_attributeCategory_item = obj_attributeCategory[i];
|
|
1333
|
-
const path_attributeCategory_item = path_attributeCategory + '[' + i + ']';
|
|
1334
|
-
const referencepath_attributeCategory_itemValidationError = validate$4(obj_attributeCategory_item, path_attributeCategory_item);
|
|
1335
|
-
if (referencepath_attributeCategory_itemValidationError !== null) {
|
|
1336
|
-
let message = 'Object doesn\'t match AttributeCategoryOutputRepresentation (at "' + path_attributeCategory_item + '")\n';
|
|
1337
|
-
message += referencepath_attributeCategory_itemValidationError.message.split('\n').map((line) => '\t' + line).join('\n');
|
|
1338
|
-
return new TypeError(message);
|
|
1339
|
-
}
|
|
1340
|
-
}
|
|
1341
|
-
}
|
|
1342
|
-
if (obj.attributes !== undefined) {
|
|
1343
|
-
const obj_attributes = obj.attributes;
|
|
1344
|
-
const path_attributes = path + '.attributes';
|
|
1345
|
-
if (!ArrayIsArray(obj_attributes)) {
|
|
1346
|
-
return new TypeError('Expected "array" but received "' + typeof obj_attributes + '" (at "' + path_attributes + '")');
|
|
1347
|
-
}
|
|
1348
|
-
for (let i = 0; i < obj_attributes.length; i++) {
|
|
1349
|
-
const obj_attributes_item = obj_attributes[i];
|
|
1350
|
-
const path_attributes_item = path_attributes + '[' + i + ']';
|
|
1351
|
-
const referencepath_attributes_itemValidationError = validate$5(obj_attributes_item, path_attributes_item);
|
|
1352
|
-
if (referencepath_attributes_itemValidationError !== null) {
|
|
1353
|
-
let message = 'Object doesn\'t match AttributeDefinitionOutputRepresentation (at "' + path_attributes_item + '")\n';
|
|
1354
|
-
message += referencepath_attributes_itemValidationError.message.split('\n').map((line) => '\t' + line).join('\n');
|
|
1355
|
-
return new TypeError(message);
|
|
1356
|
-
}
|
|
1357
|
-
}
|
|
1358
|
-
}
|
|
1359
|
-
if (obj.categoryId !== undefined) {
|
|
1360
|
-
const obj_categoryId = obj.categoryId;
|
|
1361
|
-
const path_categoryId = path + '.categoryId';
|
|
1362
|
-
if (typeof obj_categoryId !== 'string') {
|
|
1363
|
-
return new TypeError('Expected "string" but received "' + typeof obj_categoryId + '" (at "' + path_categoryId + '")');
|
|
1387
|
+
if (obj.code !== undefined) {
|
|
1388
|
+
const obj_code = obj.code;
|
|
1389
|
+
const path_code = path + '.code';
|
|
1390
|
+
if (typeof obj_code !== 'string') {
|
|
1391
|
+
return new TypeError('Expected "string" but received "' + typeof obj_code + '" (at "' + path_code + '")');
|
|
1364
1392
|
}
|
|
1365
1393
|
}
|
|
1366
|
-
if (obj.
|
|
1367
|
-
const
|
|
1368
|
-
const
|
|
1369
|
-
if (!ArrayIsArray(
|
|
1370
|
-
return new TypeError('Expected "array" but received "' + typeof
|
|
1394
|
+
if (obj.components !== undefined) {
|
|
1395
|
+
const obj_components = obj.components;
|
|
1396
|
+
const path_components = path + '.components';
|
|
1397
|
+
if (!ArrayIsArray(obj_components)) {
|
|
1398
|
+
return new TypeError('Expected "array" but received "' + typeof obj_components + '" (at "' + path_components + '")');
|
|
1371
1399
|
}
|
|
1372
|
-
for (let i = 0; i <
|
|
1373
|
-
const
|
|
1374
|
-
const
|
|
1375
|
-
|
|
1376
|
-
|
|
1377
|
-
let message = 'Object doesn\'t match ProductOutputRepresentation (at "' + path_childProducts_item + '")\n';
|
|
1378
|
-
message += referencepath_childProducts_itemValidationError.message.split('\n').map((line) => '\t' + line).join('\n');
|
|
1379
|
-
return new TypeError(message);
|
|
1400
|
+
for (let i = 0; i < obj_components.length; i++) {
|
|
1401
|
+
const obj_components_item = obj_components[i];
|
|
1402
|
+
const path_components_item = path_components + '[' + i + ']';
|
|
1403
|
+
if (typeof obj_components_item !== 'object') {
|
|
1404
|
+
return new TypeError('Expected "object" but received "' + typeof obj_components_item + '" (at "' + path_components_item + '")');
|
|
1380
1405
|
}
|
|
1381
1406
|
}
|
|
1382
1407
|
}
|
|
@@ -1394,21 +1419,180 @@ function validate(obj, path = 'ProductOutputRepresentation') {
|
|
|
1394
1419
|
return new TypeError('Expected "string" but received "' + typeof obj_id + '" (at "' + path_id + '")');
|
|
1395
1420
|
}
|
|
1396
1421
|
}
|
|
1397
|
-
if (obj.
|
|
1398
|
-
const
|
|
1399
|
-
const
|
|
1400
|
-
if (typeof
|
|
1401
|
-
return new TypeError('Expected "
|
|
1422
|
+
if (obj.maxBundleComponents !== undefined) {
|
|
1423
|
+
const obj_maxBundleComponents = obj.maxBundleComponents;
|
|
1424
|
+
const path_maxBundleComponents = path + '.maxBundleComponents';
|
|
1425
|
+
if (typeof obj_maxBundleComponents !== 'number' || (typeof obj_maxBundleComponents === 'number' && Math.floor(obj_maxBundleComponents) !== obj_maxBundleComponents)) {
|
|
1426
|
+
return new TypeError('Expected "integer" but received "' + typeof obj_maxBundleComponents + '" (at "' + path_maxBundleComponents + '")');
|
|
1402
1427
|
}
|
|
1403
1428
|
}
|
|
1404
|
-
if (obj.
|
|
1405
|
-
const
|
|
1406
|
-
const
|
|
1407
|
-
if (typeof
|
|
1408
|
-
return new TypeError('Expected "
|
|
1429
|
+
if (obj.minBundleComponents !== undefined) {
|
|
1430
|
+
const obj_minBundleComponents = obj.minBundleComponents;
|
|
1431
|
+
const path_minBundleComponents = path + '.minBundleComponents';
|
|
1432
|
+
if (typeof obj_minBundleComponents !== 'number' || (typeof obj_minBundleComponents === 'number' && Math.floor(obj_minBundleComponents) !== obj_minBundleComponents)) {
|
|
1433
|
+
return new TypeError('Expected "integer" but received "' + typeof obj_minBundleComponents + '" (at "' + path_minBundleComponents + '")');
|
|
1409
1434
|
}
|
|
1410
1435
|
}
|
|
1411
|
-
if (obj.
|
|
1436
|
+
if (obj.name !== undefined) {
|
|
1437
|
+
const obj_name = obj.name;
|
|
1438
|
+
const path_name = path + '.name';
|
|
1439
|
+
if (typeof obj_name !== 'string') {
|
|
1440
|
+
return new TypeError('Expected "string" but received "' + typeof obj_name + '" (at "' + path_name + '")');
|
|
1441
|
+
}
|
|
1442
|
+
}
|
|
1443
|
+
if (obj.parentProductId !== undefined) {
|
|
1444
|
+
const obj_parentProductId = obj.parentProductId;
|
|
1445
|
+
const path_parentProductId = path + '.parentProductId';
|
|
1446
|
+
if (typeof obj_parentProductId !== 'string') {
|
|
1447
|
+
return new TypeError('Expected "string" but received "' + typeof obj_parentProductId + '" (at "' + path_parentProductId + '")');
|
|
1448
|
+
}
|
|
1449
|
+
}
|
|
1450
|
+
if (obj.sequence !== undefined) {
|
|
1451
|
+
const obj_sequence = obj.sequence;
|
|
1452
|
+
const path_sequence = path + '.sequence';
|
|
1453
|
+
if (typeof obj_sequence !== 'number' || (typeof obj_sequence === 'number' && Math.floor(obj_sequence) !== obj_sequence)) {
|
|
1454
|
+
return new TypeError('Expected "integer" but received "' + typeof obj_sequence + '" (at "' + path_sequence + '")');
|
|
1455
|
+
}
|
|
1456
|
+
}
|
|
1457
|
+
})();
|
|
1458
|
+
return v_error === undefined ? null : v_error;
|
|
1459
|
+
}
|
|
1460
|
+
|
|
1461
|
+
function validate$3(obj, path = 'ProductSpecificationTypeOutputRepresentation') {
|
|
1462
|
+
const v_error = (() => {
|
|
1463
|
+
if (typeof obj !== 'object' || ArrayIsArray(obj) || obj === null) {
|
|
1464
|
+
return new TypeError('Expected "object" but received "' + typeof obj + '" (at "' + path + '")');
|
|
1465
|
+
}
|
|
1466
|
+
if (obj.name !== undefined) {
|
|
1467
|
+
const obj_name = obj.name;
|
|
1468
|
+
const path_name = path + '.name';
|
|
1469
|
+
if (typeof obj_name !== 'string') {
|
|
1470
|
+
return new TypeError('Expected "string" but received "' + typeof obj_name + '" (at "' + path_name + '")');
|
|
1471
|
+
}
|
|
1472
|
+
}
|
|
1473
|
+
})();
|
|
1474
|
+
return v_error === undefined ? null : v_error;
|
|
1475
|
+
}
|
|
1476
|
+
|
|
1477
|
+
function validate$2(obj, path = 'QuantityInfo') {
|
|
1478
|
+
const v_error = (() => {
|
|
1479
|
+
if (typeof obj !== 'object' || ArrayIsArray(obj) || obj === null) {
|
|
1480
|
+
return new TypeError('Expected "object" but received "' + typeof obj + '" (at "' + path + '")');
|
|
1481
|
+
}
|
|
1482
|
+
if (obj.maxQuantity !== undefined) {
|
|
1483
|
+
obj.maxQuantity;
|
|
1484
|
+
}
|
|
1485
|
+
if (obj.minQuantity !== undefined) {
|
|
1486
|
+
obj.minQuantity;
|
|
1487
|
+
}
|
|
1488
|
+
if (obj.quantity !== undefined) {
|
|
1489
|
+
obj.quantity;
|
|
1490
|
+
}
|
|
1491
|
+
})();
|
|
1492
|
+
return v_error === undefined ? null : v_error;
|
|
1493
|
+
}
|
|
1494
|
+
|
|
1495
|
+
const TTL = 6000;
|
|
1496
|
+
const VERSION$1 = "38ee0d8d67cda562ff19dd5273e07d95";
|
|
1497
|
+
function validate$1(obj, path = 'ProductOutputRepresentation') {
|
|
1498
|
+
const v_error = (() => {
|
|
1499
|
+
if (typeof obj !== 'object' || ArrayIsArray(obj) || obj === null) {
|
|
1500
|
+
return new TypeError('Expected "object" but received "' + typeof obj + '" (at "' + path + '")');
|
|
1501
|
+
}
|
|
1502
|
+
if (obj.attributeCategory !== undefined) {
|
|
1503
|
+
const obj_attributeCategory = obj.attributeCategory;
|
|
1504
|
+
const path_attributeCategory = path + '.attributeCategory';
|
|
1505
|
+
if (!ArrayIsArray(obj_attributeCategory)) {
|
|
1506
|
+
return new TypeError('Expected "array" but received "' + typeof obj_attributeCategory + '" (at "' + path_attributeCategory + '")');
|
|
1507
|
+
}
|
|
1508
|
+
for (let i = 0; i < obj_attributeCategory.length; i++) {
|
|
1509
|
+
const obj_attributeCategory_item = obj_attributeCategory[i];
|
|
1510
|
+
const path_attributeCategory_item = path_attributeCategory + '[' + i + ']';
|
|
1511
|
+
const referencepath_attributeCategory_itemValidationError = validate$8(obj_attributeCategory_item, path_attributeCategory_item);
|
|
1512
|
+
if (referencepath_attributeCategory_itemValidationError !== null) {
|
|
1513
|
+
let message = 'Object doesn\'t match AttributeCategoryOutputRepresentation (at "' + path_attributeCategory_item + '")\n';
|
|
1514
|
+
message += referencepath_attributeCategory_itemValidationError.message.split('\n').map((line) => '\t' + line).join('\n');
|
|
1515
|
+
return new TypeError(message);
|
|
1516
|
+
}
|
|
1517
|
+
}
|
|
1518
|
+
}
|
|
1519
|
+
if (obj.attributes !== undefined) {
|
|
1520
|
+
const obj_attributes = obj.attributes;
|
|
1521
|
+
const path_attributes = path + '.attributes';
|
|
1522
|
+
if (!ArrayIsArray(obj_attributes)) {
|
|
1523
|
+
return new TypeError('Expected "array" but received "' + typeof obj_attributes + '" (at "' + path_attributes + '")');
|
|
1524
|
+
}
|
|
1525
|
+
for (let i = 0; i < obj_attributes.length; i++) {
|
|
1526
|
+
const obj_attributes_item = obj_attributes[i];
|
|
1527
|
+
const path_attributes_item = path_attributes + '[' + i + ']';
|
|
1528
|
+
const referencepath_attributes_itemValidationError = validate$9(obj_attributes_item, path_attributes_item);
|
|
1529
|
+
if (referencepath_attributes_itemValidationError !== null) {
|
|
1530
|
+
let message = 'Object doesn\'t match AttributeDefinitionOutputRepresentation (at "' + path_attributes_item + '")\n';
|
|
1531
|
+
message += referencepath_attributes_itemValidationError.message.split('\n').map((line) => '\t' + line).join('\n');
|
|
1532
|
+
return new TypeError(message);
|
|
1533
|
+
}
|
|
1534
|
+
}
|
|
1535
|
+
}
|
|
1536
|
+
if (obj.categoryId !== undefined) {
|
|
1537
|
+
const obj_categoryId = obj.categoryId;
|
|
1538
|
+
const path_categoryId = path + '.categoryId';
|
|
1539
|
+
if (typeof obj_categoryId !== 'string') {
|
|
1540
|
+
return new TypeError('Expected "string" but received "' + typeof obj_categoryId + '" (at "' + path_categoryId + '")');
|
|
1541
|
+
}
|
|
1542
|
+
}
|
|
1543
|
+
if (obj.childProducts !== undefined) {
|
|
1544
|
+
const obj_childProducts = obj.childProducts;
|
|
1545
|
+
const path_childProducts = path + '.childProducts';
|
|
1546
|
+
if (!ArrayIsArray(obj_childProducts)) {
|
|
1547
|
+
return new TypeError('Expected "array" but received "' + typeof obj_childProducts + '" (at "' + path_childProducts + '")');
|
|
1548
|
+
}
|
|
1549
|
+
for (let i = 0; i < obj_childProducts.length; i++) {
|
|
1550
|
+
const obj_childProducts_item = obj_childProducts[i];
|
|
1551
|
+
const path_childProducts_item = path_childProducts + '[' + i + ']';
|
|
1552
|
+
const referencepath_childProducts_itemValidationError = validate$1(obj_childProducts_item, path_childProducts_item);
|
|
1553
|
+
if (referencepath_childProducts_itemValidationError !== null) {
|
|
1554
|
+
let message = 'Object doesn\'t match ProductOutputRepresentation (at "' + path_childProducts_item + '")\n';
|
|
1555
|
+
message += referencepath_childProducts_itemValidationError.message.split('\n').map((line) => '\t' + line).join('\n');
|
|
1556
|
+
return new TypeError(message);
|
|
1557
|
+
}
|
|
1558
|
+
}
|
|
1559
|
+
}
|
|
1560
|
+
if (obj.description !== undefined) {
|
|
1561
|
+
const obj_description = obj.description;
|
|
1562
|
+
const path_description = path + '.description';
|
|
1563
|
+
if (typeof obj_description !== 'string') {
|
|
1564
|
+
return new TypeError('Expected "string" but received "' + typeof obj_description + '" (at "' + path_description + '")');
|
|
1565
|
+
}
|
|
1566
|
+
}
|
|
1567
|
+
if (obj.displayUrl !== undefined) {
|
|
1568
|
+
const obj_displayUrl = obj.displayUrl;
|
|
1569
|
+
const path_displayUrl = path + '.displayUrl';
|
|
1570
|
+
if (typeof obj_displayUrl !== 'string') {
|
|
1571
|
+
return new TypeError('Expected "string" but received "' + typeof obj_displayUrl + '" (at "' + path_displayUrl + '")');
|
|
1572
|
+
}
|
|
1573
|
+
}
|
|
1574
|
+
if (obj.id !== undefined) {
|
|
1575
|
+
const obj_id = obj.id;
|
|
1576
|
+
const path_id = path + '.id';
|
|
1577
|
+
if (typeof obj_id !== 'string') {
|
|
1578
|
+
return new TypeError('Expected "string" but received "' + typeof obj_id + '" (at "' + path_id + '")');
|
|
1579
|
+
}
|
|
1580
|
+
}
|
|
1581
|
+
if (obj.isComponentRequired !== undefined) {
|
|
1582
|
+
const obj_isComponentRequired = obj.isComponentRequired;
|
|
1583
|
+
const path_isComponentRequired = path + '.isComponentRequired';
|
|
1584
|
+
if (typeof obj_isComponentRequired !== 'boolean') {
|
|
1585
|
+
return new TypeError('Expected "boolean" but received "' + typeof obj_isComponentRequired + '" (at "' + path_isComponentRequired + '")');
|
|
1586
|
+
}
|
|
1587
|
+
}
|
|
1588
|
+
if (obj.isDefaultComponent !== undefined) {
|
|
1589
|
+
const obj_isDefaultComponent = obj.isDefaultComponent;
|
|
1590
|
+
const path_isDefaultComponent = path + '.isDefaultComponent';
|
|
1591
|
+
if (typeof obj_isDefaultComponent !== 'boolean') {
|
|
1592
|
+
return new TypeError('Expected "boolean" but received "' + typeof obj_isDefaultComponent + '" (at "' + path_isDefaultComponent + '")');
|
|
1593
|
+
}
|
|
1594
|
+
}
|
|
1595
|
+
if (obj.isQuantityEditable !== undefined) {
|
|
1412
1596
|
const obj_isQuantityEditable = obj.isQuantityEditable;
|
|
1413
1597
|
const path_isQuantityEditable = path + '.isQuantityEditable';
|
|
1414
1598
|
if (typeof obj_isQuantityEditable !== 'boolean') {
|
|
@@ -1422,6 +1606,13 @@ function validate(obj, path = 'ProductOutputRepresentation') {
|
|
|
1422
1606
|
return new TypeError('Expected "string" but received "' + typeof obj_name + '" (at "' + path_name + '")');
|
|
1423
1607
|
}
|
|
1424
1608
|
}
|
|
1609
|
+
if (obj.nodeType !== undefined) {
|
|
1610
|
+
const obj_nodeType = obj.nodeType;
|
|
1611
|
+
const path_nodeType = path + '.nodeType';
|
|
1612
|
+
if (typeof obj_nodeType !== 'string') {
|
|
1613
|
+
return new TypeError('Expected "string" but received "' + typeof obj_nodeType + '" (at "' + path_nodeType + '")');
|
|
1614
|
+
}
|
|
1615
|
+
}
|
|
1425
1616
|
if (obj.prices !== undefined) {
|
|
1426
1617
|
const obj_prices = obj.prices;
|
|
1427
1618
|
const path_prices = path + '.prices';
|
|
@@ -1431,7 +1622,7 @@ function validate(obj, path = 'ProductOutputRepresentation') {
|
|
|
1431
1622
|
for (let i = 0; i < obj_prices.length; i++) {
|
|
1432
1623
|
const obj_prices_item = obj_prices[i];
|
|
1433
1624
|
const path_prices_item = path_prices + '[' + i + ']';
|
|
1434
|
-
const referencepath_prices_itemValidationError = validate$
|
|
1625
|
+
const referencepath_prices_itemValidationError = validate$6(obj_prices_item, path_prices_item);
|
|
1435
1626
|
if (referencepath_prices_itemValidationError !== null) {
|
|
1436
1627
|
let message = 'Object doesn\'t match PriceOutputRepresentation (at "' + path_prices_item + '")\n';
|
|
1437
1628
|
message += referencepath_prices_itemValidationError.message.split('\n').map((line) => '\t' + line).join('\n');
|
|
@@ -1439,10 +1630,54 @@ function validate(obj, path = 'ProductOutputRepresentation') {
|
|
|
1439
1630
|
}
|
|
1440
1631
|
}
|
|
1441
1632
|
}
|
|
1633
|
+
if (obj.productClassification !== undefined) {
|
|
1634
|
+
const obj_productClassification = obj.productClassification;
|
|
1635
|
+
const path_productClassification = path + '.productClassification';
|
|
1636
|
+
const referencepath_productClassificationValidationError = validate$5(obj_productClassification, path_productClassification);
|
|
1637
|
+
if (referencepath_productClassificationValidationError !== null) {
|
|
1638
|
+
let message = 'Object doesn\'t match ProductClassificationOutputRepresentation (at "' + path_productClassification + '")\n';
|
|
1639
|
+
message += referencepath_productClassificationValidationError.message.split('\n').map((line) => '\t' + line).join('\n');
|
|
1640
|
+
return new TypeError(message);
|
|
1641
|
+
}
|
|
1642
|
+
}
|
|
1643
|
+
if (obj.productCode !== undefined) {
|
|
1644
|
+
const obj_productCode = obj.productCode;
|
|
1645
|
+
const path_productCode = path + '.productCode';
|
|
1646
|
+
if (typeof obj_productCode !== 'string') {
|
|
1647
|
+
return new TypeError('Expected "string" but received "' + typeof obj_productCode + '" (at "' + path_productCode + '")');
|
|
1648
|
+
}
|
|
1649
|
+
}
|
|
1650
|
+
if (obj.productComponentGroups !== undefined) {
|
|
1651
|
+
const obj_productComponentGroups = obj.productComponentGroups;
|
|
1652
|
+
const path_productComponentGroups = path + '.productComponentGroups';
|
|
1653
|
+
if (!ArrayIsArray(obj_productComponentGroups)) {
|
|
1654
|
+
return new TypeError('Expected "array" but received "' + typeof obj_productComponentGroups + '" (at "' + path_productComponentGroups + '")');
|
|
1655
|
+
}
|
|
1656
|
+
for (let i = 0; i < obj_productComponentGroups.length; i++) {
|
|
1657
|
+
const obj_productComponentGroups_item = obj_productComponentGroups[i];
|
|
1658
|
+
const path_productComponentGroups_item = path_productComponentGroups + '[' + i + ']';
|
|
1659
|
+
const referencepath_productComponentGroups_itemValidationError = validate$4(obj_productComponentGroups_item, path_productComponentGroups_item);
|
|
1660
|
+
if (referencepath_productComponentGroups_itemValidationError !== null) {
|
|
1661
|
+
let message = 'Object doesn\'t match ProductComponentGroupOutputRepresentation (at "' + path_productComponentGroups_item + '")\n';
|
|
1662
|
+
message += referencepath_productComponentGroups_itemValidationError.message.split('\n').map((line) => '\t' + line).join('\n');
|
|
1663
|
+
return new TypeError(message);
|
|
1664
|
+
}
|
|
1665
|
+
}
|
|
1666
|
+
}
|
|
1667
|
+
if (obj.productSpecificationType !== undefined) {
|
|
1668
|
+
const obj_productSpecificationType = obj.productSpecificationType;
|
|
1669
|
+
const path_productSpecificationType = path + '.productSpecificationType';
|
|
1670
|
+
const referencepath_productSpecificationTypeValidationError = validate$3(obj_productSpecificationType, path_productSpecificationType);
|
|
1671
|
+
if (referencepath_productSpecificationTypeValidationError !== null) {
|
|
1672
|
+
let message = 'Object doesn\'t match ProductSpecificationTypeOutputRepresentation (at "' + path_productSpecificationType + '")\n';
|
|
1673
|
+
message += referencepath_productSpecificationTypeValidationError.message.split('\n').map((line) => '\t' + line).join('\n');
|
|
1674
|
+
return new TypeError(message);
|
|
1675
|
+
}
|
|
1676
|
+
}
|
|
1442
1677
|
if (obj.quantityInfo !== undefined) {
|
|
1443
1678
|
const obj_quantityInfo = obj.quantityInfo;
|
|
1444
1679
|
const path_quantityInfo = path + '.quantityInfo';
|
|
1445
|
-
const referencepath_quantityInfoValidationError = validate$
|
|
1680
|
+
const referencepath_quantityInfoValidationError = validate$2(obj_quantityInfo, path_quantityInfo);
|
|
1446
1681
|
if (referencepath_quantityInfoValidationError !== null) {
|
|
1447
1682
|
let message = 'Object doesn\'t match QuantityInfo (at "' + path_quantityInfo + '")\n';
|
|
1448
1683
|
message += referencepath_quantityInfoValidationError.message.split('\n').map((line) => '\t' + line).join('\n');
|
|
@@ -1452,27 +1687,27 @@ function validate(obj, path = 'ProductOutputRepresentation') {
|
|
|
1452
1687
|
})();
|
|
1453
1688
|
return v_error === undefined ? null : v_error;
|
|
1454
1689
|
}
|
|
1455
|
-
const RepresentationType = 'ProductOutputRepresentation';
|
|
1456
|
-
function normalize(input, existing, path, luvio, store, timestamp) {
|
|
1690
|
+
const RepresentationType$1 = 'ProductOutputRepresentation';
|
|
1691
|
+
function normalize$1(input, existing, path, luvio, store, timestamp) {
|
|
1457
1692
|
return input;
|
|
1458
1693
|
}
|
|
1459
|
-
const select$
|
|
1694
|
+
const select$3 = function ProductOutputRepresentationSelect() {
|
|
1460
1695
|
return {
|
|
1461
1696
|
kind: 'Fragment',
|
|
1462
|
-
version: VERSION,
|
|
1697
|
+
version: VERSION$1,
|
|
1463
1698
|
private: [],
|
|
1464
1699
|
opaque: true
|
|
1465
1700
|
};
|
|
1466
1701
|
};
|
|
1467
|
-
function equals(existing, incoming) {
|
|
1702
|
+
function equals$1(existing, incoming) {
|
|
1468
1703
|
if (JSONStringify(incoming) !== JSONStringify(existing)) {
|
|
1469
1704
|
return false;
|
|
1470
1705
|
}
|
|
1471
1706
|
return true;
|
|
1472
1707
|
}
|
|
1473
|
-
const ingest = function ProductOutputRepresentationIngest(input, path, luvio, store, timestamp) {
|
|
1708
|
+
const ingest$1 = function ProductOutputRepresentationIngest(input, path, luvio, store, timestamp) {
|
|
1474
1709
|
if (process.env.NODE_ENV !== 'production') {
|
|
1475
|
-
const validateError = validate(input);
|
|
1710
|
+
const validateError = validate$1(input);
|
|
1476
1711
|
if (validateError !== null) {
|
|
1477
1712
|
throw validateError;
|
|
1478
1713
|
}
|
|
@@ -1480,16 +1715,393 @@ const ingest = function ProductOutputRepresentationIngest(input, path, luvio, st
|
|
|
1480
1715
|
const key = path.fullPath;
|
|
1481
1716
|
const existingRecord = store.readEntry(key);
|
|
1482
1717
|
const ttlToUse = TTL;
|
|
1483
|
-
let incomingRecord = normalize(input, store.readEntry(key), {
|
|
1718
|
+
let incomingRecord = normalize$1(input, store.readEntry(key), {
|
|
1484
1719
|
fullPath: key,
|
|
1485
1720
|
parent: path.parent,
|
|
1486
1721
|
propertyName: path.propertyName,
|
|
1487
1722
|
ttl: ttlToUse
|
|
1488
1723
|
});
|
|
1489
|
-
if (existingRecord === undefined || equals(existingRecord, incomingRecord) === false) {
|
|
1724
|
+
if (existingRecord === undefined || equals$1(existingRecord, incomingRecord) === false) {
|
|
1490
1725
|
luvio.storePublish(key, incomingRecord);
|
|
1491
1726
|
}
|
|
1492
1727
|
{
|
|
1728
|
+
const storeMetadataParams = {
|
|
1729
|
+
ttl: ttlToUse,
|
|
1730
|
+
namespace: "epc",
|
|
1731
|
+
version: VERSION$1,
|
|
1732
|
+
representationName: RepresentationType$1,
|
|
1733
|
+
};
|
|
1734
|
+
luvio.publishStoreMetadata(key, storeMetadataParams);
|
|
1735
|
+
}
|
|
1736
|
+
return createLink(key);
|
|
1737
|
+
};
|
|
1738
|
+
function getTypeCacheKeys$1(rootKeySet, luvio, input, fullPathFactory) {
|
|
1739
|
+
// root cache key (uses fullPathFactory if keyBuilderFromType isn't defined)
|
|
1740
|
+
const rootKey = fullPathFactory();
|
|
1741
|
+
rootKeySet.set(rootKey, {
|
|
1742
|
+
namespace: keyPrefix,
|
|
1743
|
+
representationName: RepresentationType$1,
|
|
1744
|
+
mergeable: false
|
|
1745
|
+
});
|
|
1746
|
+
}
|
|
1747
|
+
|
|
1748
|
+
function select$2(luvio, params) {
|
|
1749
|
+
return select$3();
|
|
1750
|
+
}
|
|
1751
|
+
function keyBuilder$3(luvio, params) {
|
|
1752
|
+
return keyPrefix + '::ProductOutputRepresentation:(' + 'correlationId:' + params.queryParams.correlationId + ',' + 'isPriceImpacting:' + params.queryParams.isPriceImpacting + ',' + 'productId:' + params.urlParams.productId + ')';
|
|
1753
|
+
}
|
|
1754
|
+
function getResponseCacheKeys$1(storeKeyMap, luvio, resourceParams, response) {
|
|
1755
|
+
getTypeCacheKeys$1(storeKeyMap, luvio, response, () => keyBuilder$3(luvio, resourceParams));
|
|
1756
|
+
}
|
|
1757
|
+
function ingestSuccess$1(luvio, resourceParams, response, snapshotRefresh) {
|
|
1758
|
+
const { body } = response;
|
|
1759
|
+
const key = keyBuilder$3(luvio, resourceParams);
|
|
1760
|
+
luvio.storeIngest(key, ingest$1, body);
|
|
1761
|
+
const snapshot = luvio.storeLookup({
|
|
1762
|
+
recordId: key,
|
|
1763
|
+
node: select$2(),
|
|
1764
|
+
variables: {},
|
|
1765
|
+
}, snapshotRefresh);
|
|
1766
|
+
if (process.env.NODE_ENV !== 'production') {
|
|
1767
|
+
if (snapshot.state !== 'Fulfilled') {
|
|
1768
|
+
throw new Error('Invalid network response. Expected resource response to result in Fulfilled snapshot');
|
|
1769
|
+
}
|
|
1770
|
+
}
|
|
1771
|
+
deepFreeze(snapshot.data);
|
|
1772
|
+
return snapshot;
|
|
1773
|
+
}
|
|
1774
|
+
function ingestError$1(luvio, params, error, snapshotRefresh) {
|
|
1775
|
+
const key = keyBuilder$3(luvio, params);
|
|
1776
|
+
const errorSnapshot = luvio.errorSnapshot(error, snapshotRefresh);
|
|
1777
|
+
const storeMetadataParams = {
|
|
1778
|
+
ttl: TTL,
|
|
1779
|
+
namespace: keyPrefix,
|
|
1780
|
+
version: VERSION$1,
|
|
1781
|
+
representationName: RepresentationType$1
|
|
1782
|
+
};
|
|
1783
|
+
luvio.storeIngestError(key, errorSnapshot, storeMetadataParams);
|
|
1784
|
+
return errorSnapshot;
|
|
1785
|
+
}
|
|
1786
|
+
function createResourceRequest$1(config) {
|
|
1787
|
+
const headers = {};
|
|
1788
|
+
return {
|
|
1789
|
+
baseUri: '/services/data/v59.0',
|
|
1790
|
+
basePath: '/connect/epc/product/' + config.urlParams.productId + '/attributes',
|
|
1791
|
+
method: 'get',
|
|
1792
|
+
body: null,
|
|
1793
|
+
urlParams: config.urlParams,
|
|
1794
|
+
queryParams: config.queryParams,
|
|
1795
|
+
headers,
|
|
1796
|
+
priority: 'normal',
|
|
1797
|
+
};
|
|
1798
|
+
}
|
|
1799
|
+
|
|
1800
|
+
const getProductAttributesByProductId_ConfigPropertyNames = {
|
|
1801
|
+
displayName: 'getProductAttributesByProductId',
|
|
1802
|
+
parameters: {
|
|
1803
|
+
required: ['productId'],
|
|
1804
|
+
optional: ['correlationId', 'isPriceImpacting']
|
|
1805
|
+
}
|
|
1806
|
+
};
|
|
1807
|
+
function createResourceParams$1(config) {
|
|
1808
|
+
const resourceParams = {
|
|
1809
|
+
urlParams: {
|
|
1810
|
+
productId: config.productId
|
|
1811
|
+
},
|
|
1812
|
+
queryParams: {
|
|
1813
|
+
correlationId: config.correlationId, isPriceImpacting: config.isPriceImpacting
|
|
1814
|
+
}
|
|
1815
|
+
};
|
|
1816
|
+
return resourceParams;
|
|
1817
|
+
}
|
|
1818
|
+
function keyBuilder$2(luvio, config) {
|
|
1819
|
+
const resourceParams = createResourceParams$1(config);
|
|
1820
|
+
return keyBuilder$3(luvio, resourceParams);
|
|
1821
|
+
}
|
|
1822
|
+
function typeCheckConfig$1(untrustedConfig) {
|
|
1823
|
+
const config = {};
|
|
1824
|
+
const untrustedConfig_productId = untrustedConfig.productId;
|
|
1825
|
+
if (typeof untrustedConfig_productId === 'string') {
|
|
1826
|
+
config.productId = untrustedConfig_productId;
|
|
1827
|
+
}
|
|
1828
|
+
const untrustedConfig_correlationId = untrustedConfig.correlationId;
|
|
1829
|
+
if (typeof untrustedConfig_correlationId === 'string') {
|
|
1830
|
+
config.correlationId = untrustedConfig_correlationId;
|
|
1831
|
+
}
|
|
1832
|
+
const untrustedConfig_isPriceImpacting = untrustedConfig.isPriceImpacting;
|
|
1833
|
+
if (typeof untrustedConfig_isPriceImpacting === 'boolean') {
|
|
1834
|
+
config.isPriceImpacting = untrustedConfig_isPriceImpacting;
|
|
1835
|
+
}
|
|
1836
|
+
return config;
|
|
1837
|
+
}
|
|
1838
|
+
function validateAdapterConfig$1(untrustedConfig, configPropertyNames) {
|
|
1839
|
+
if (!untrustedIsObject(untrustedConfig)) {
|
|
1840
|
+
return null;
|
|
1841
|
+
}
|
|
1842
|
+
if (process.env.NODE_ENV !== 'production') {
|
|
1843
|
+
validateConfig(untrustedConfig, configPropertyNames);
|
|
1844
|
+
}
|
|
1845
|
+
const config = typeCheckConfig$1(untrustedConfig);
|
|
1846
|
+
if (!areRequiredParametersPresent(config, configPropertyNames)) {
|
|
1847
|
+
return null;
|
|
1848
|
+
}
|
|
1849
|
+
return config;
|
|
1850
|
+
}
|
|
1851
|
+
function adapterFragment$1(luvio, config) {
|
|
1852
|
+
createResourceParams$1(config);
|
|
1853
|
+
return select$2();
|
|
1854
|
+
}
|
|
1855
|
+
function onFetchResponseSuccess$1(luvio, config, resourceParams, response) {
|
|
1856
|
+
const snapshot = ingestSuccess$1(luvio, resourceParams, response, {
|
|
1857
|
+
config,
|
|
1858
|
+
resolve: () => buildNetworkSnapshot$1(luvio, config, snapshotRefreshOptions)
|
|
1859
|
+
});
|
|
1860
|
+
return luvio.storeBroadcast().then(() => snapshot);
|
|
1861
|
+
}
|
|
1862
|
+
function onFetchResponseError$1(luvio, config, resourceParams, response) {
|
|
1863
|
+
const snapshot = ingestError$1(luvio, resourceParams, response, {
|
|
1864
|
+
config,
|
|
1865
|
+
resolve: () => buildNetworkSnapshot$1(luvio, config, snapshotRefreshOptions)
|
|
1866
|
+
});
|
|
1867
|
+
return luvio.storeBroadcast().then(() => snapshot);
|
|
1868
|
+
}
|
|
1869
|
+
function buildNetworkSnapshot$1(luvio, config, options) {
|
|
1870
|
+
const resourceParams = createResourceParams$1(config);
|
|
1871
|
+
const request = createResourceRequest$1(resourceParams);
|
|
1872
|
+
return luvio.dispatchResourceRequest(request, options)
|
|
1873
|
+
.then((response) => {
|
|
1874
|
+
return luvio.handleSuccessResponse(() => onFetchResponseSuccess$1(luvio, config, resourceParams, response), () => {
|
|
1875
|
+
const cache = new StoreKeyMap();
|
|
1876
|
+
getResponseCacheKeys$1(cache, luvio, resourceParams, response.body);
|
|
1877
|
+
return cache;
|
|
1878
|
+
});
|
|
1879
|
+
}, (response) => {
|
|
1880
|
+
return luvio.handleErrorResponse(() => onFetchResponseError$1(luvio, config, resourceParams, response));
|
|
1881
|
+
});
|
|
1882
|
+
}
|
|
1883
|
+
function buildNetworkSnapshotCachePolicy$1(context, coercedAdapterRequestContext) {
|
|
1884
|
+
const { luvio, config } = context;
|
|
1885
|
+
const { networkPriority, requestCorrelator, eventObservers } = coercedAdapterRequestContext;
|
|
1886
|
+
const dispatchOptions = {
|
|
1887
|
+
resourceRequestContext: {
|
|
1888
|
+
requestCorrelator,
|
|
1889
|
+
luvioRequestMethod: undefined,
|
|
1890
|
+
},
|
|
1891
|
+
eventObservers
|
|
1892
|
+
};
|
|
1893
|
+
if (networkPriority !== 'normal') {
|
|
1894
|
+
dispatchOptions.overrides = {
|
|
1895
|
+
priority: networkPriority
|
|
1896
|
+
};
|
|
1897
|
+
}
|
|
1898
|
+
return buildNetworkSnapshot$1(luvio, config, dispatchOptions);
|
|
1899
|
+
}
|
|
1900
|
+
function buildCachedSnapshotCachePolicy$1(context, storeLookup) {
|
|
1901
|
+
const { luvio, config } = context;
|
|
1902
|
+
const selector = {
|
|
1903
|
+
recordId: keyBuilder$2(luvio, config),
|
|
1904
|
+
node: adapterFragment$1(luvio, config),
|
|
1905
|
+
variables: {},
|
|
1906
|
+
};
|
|
1907
|
+
const cacheSnapshot = storeLookup(selector, {
|
|
1908
|
+
config,
|
|
1909
|
+
resolve: () => buildNetworkSnapshot$1(luvio, config, snapshotRefreshOptions)
|
|
1910
|
+
});
|
|
1911
|
+
return cacheSnapshot;
|
|
1912
|
+
}
|
|
1913
|
+
const getProductAttributesByProductIdAdapterFactory = (luvio) => function epc__getProductAttributesByProductId(untrustedConfig, requestContext) {
|
|
1914
|
+
const config = validateAdapterConfig$1(untrustedConfig, getProductAttributesByProductId_ConfigPropertyNames);
|
|
1915
|
+
// Invalid or incomplete config
|
|
1916
|
+
if (config === null) {
|
|
1917
|
+
return null;
|
|
1918
|
+
}
|
|
1919
|
+
return luvio.applyCachePolicy((requestContext || {}), { config, luvio }, // BuildSnapshotContext
|
|
1920
|
+
buildCachedSnapshotCachePolicy$1, buildNetworkSnapshotCachePolicy$1);
|
|
1921
|
+
};
|
|
1922
|
+
|
|
1923
|
+
const VERSION = "dc3572320bc5b04b2f7f9fd7c6ee1281";
|
|
1924
|
+
function validate(obj, path = 'ProductsOutputRepresentation') {
|
|
1925
|
+
const v_error = (() => {
|
|
1926
|
+
if (typeof obj !== 'object' || ArrayIsArray(obj) || obj === null) {
|
|
1927
|
+
return new TypeError('Expected "object" but received "' + typeof obj + '" (at "' + path + '")');
|
|
1928
|
+
}
|
|
1929
|
+
if (obj.correlationId !== undefined) {
|
|
1930
|
+
const obj_correlationId = obj.correlationId;
|
|
1931
|
+
const path_correlationId = path + '.correlationId';
|
|
1932
|
+
if (typeof obj_correlationId !== 'string') {
|
|
1933
|
+
return new TypeError('Expected "string" but received "' + typeof obj_correlationId + '" (at "' + path_correlationId + '")');
|
|
1934
|
+
}
|
|
1935
|
+
}
|
|
1936
|
+
if (obj.count !== undefined) {
|
|
1937
|
+
const obj_count = obj.count;
|
|
1938
|
+
const path_count = path + '.count';
|
|
1939
|
+
if (typeof obj_count !== 'number' || (typeof obj_count === 'number' && Math.floor(obj_count) !== obj_count)) {
|
|
1940
|
+
return new TypeError('Expected "integer" but received "' + typeof obj_count + '" (at "' + path_count + '")');
|
|
1941
|
+
}
|
|
1942
|
+
}
|
|
1943
|
+
if (obj.products !== undefined) {
|
|
1944
|
+
const obj_products = obj.products;
|
|
1945
|
+
const path_products = path + '.products';
|
|
1946
|
+
if (!ArrayIsArray(obj_products)) {
|
|
1947
|
+
return new TypeError('Expected "array" but received "' + typeof obj_products + '" (at "' + path_products + '")');
|
|
1948
|
+
}
|
|
1949
|
+
for (let i = 0; i < obj_products.length; i++) {
|
|
1950
|
+
const obj_products_item = obj_products[i];
|
|
1951
|
+
const path_products_item = path_products + '[' + i + ']';
|
|
1952
|
+
if (typeof obj_products_item !== 'object') {
|
|
1953
|
+
return new TypeError('Expected "object" but received "' + typeof obj_products_item + '" (at "' + path_products_item + '")');
|
|
1954
|
+
}
|
|
1955
|
+
}
|
|
1956
|
+
}
|
|
1957
|
+
if (obj.status !== undefined) {
|
|
1958
|
+
const obj_status = obj.status;
|
|
1959
|
+
const path_status = path + '.status';
|
|
1960
|
+
const referencepath_statusValidationError = validate$d(obj_status, path_status);
|
|
1961
|
+
if (referencepath_statusValidationError !== null) {
|
|
1962
|
+
let message = 'Object doesn\'t match Status (at "' + path_status + '")\n';
|
|
1963
|
+
message += referencepath_statusValidationError.message.split('\n').map((line) => '\t' + line).join('\n');
|
|
1964
|
+
return new TypeError(message);
|
|
1965
|
+
}
|
|
1966
|
+
}
|
|
1967
|
+
})();
|
|
1968
|
+
return v_error === undefined ? null : v_error;
|
|
1969
|
+
}
|
|
1970
|
+
const RepresentationType = 'ProductsOutputRepresentation';
|
|
1971
|
+
function normalize(input, existing, path, luvio, store, timestamp) {
|
|
1972
|
+
const input_products = input.products;
|
|
1973
|
+
const input_products_id = path.fullPath + '__products';
|
|
1974
|
+
if (input_products !== undefined) {
|
|
1975
|
+
for (let i = 0; i < input_products.length; i++) {
|
|
1976
|
+
const input_products_item = input_products[i];
|
|
1977
|
+
let input_products_item_id = input_products_id + '__' + i;
|
|
1978
|
+
input_products[i] = ingest$1(input_products_item, {
|
|
1979
|
+
fullPath: input_products_item_id,
|
|
1980
|
+
propertyName: i,
|
|
1981
|
+
parent: {
|
|
1982
|
+
data: input,
|
|
1983
|
+
key: path.fullPath,
|
|
1984
|
+
existing: existing,
|
|
1985
|
+
},
|
|
1986
|
+
ttl: path.ttl
|
|
1987
|
+
}, luvio, store);
|
|
1988
|
+
}
|
|
1989
|
+
}
|
|
1990
|
+
return input;
|
|
1991
|
+
}
|
|
1992
|
+
const select$1 = function ProductsOutputRepresentationSelect() {
|
|
1993
|
+
const { selections: Status__selections, opaque: Status__opaque, } = select$6();
|
|
1994
|
+
return {
|
|
1995
|
+
kind: 'Fragment',
|
|
1996
|
+
version: VERSION,
|
|
1997
|
+
private: [],
|
|
1998
|
+
selections: [
|
|
1999
|
+
{
|
|
2000
|
+
name: 'correlationId',
|
|
2001
|
+
kind: 'Scalar',
|
|
2002
|
+
required: false
|
|
2003
|
+
},
|
|
2004
|
+
{
|
|
2005
|
+
name: 'count',
|
|
2006
|
+
kind: 'Scalar',
|
|
2007
|
+
required: false
|
|
2008
|
+
},
|
|
2009
|
+
{
|
|
2010
|
+
name: 'products',
|
|
2011
|
+
kind: 'Link',
|
|
2012
|
+
plural: true,
|
|
2013
|
+
required: false,
|
|
2014
|
+
fragment: select$3()
|
|
2015
|
+
},
|
|
2016
|
+
{
|
|
2017
|
+
name: 'status',
|
|
2018
|
+
kind: 'Object',
|
|
2019
|
+
selections: Status__selections,
|
|
2020
|
+
required: false
|
|
2021
|
+
}
|
|
2022
|
+
]
|
|
2023
|
+
};
|
|
2024
|
+
};
|
|
2025
|
+
function equals(existing, incoming) {
|
|
2026
|
+
const existing_count = existing.count;
|
|
2027
|
+
const incoming_count = incoming.count;
|
|
2028
|
+
// if at least one of these optionals is defined
|
|
2029
|
+
if (existing_count !== undefined || incoming_count !== undefined) {
|
|
2030
|
+
// if one of these is not defined we know the other is defined and therefore
|
|
2031
|
+
// not equal
|
|
2032
|
+
if (existing_count === undefined || incoming_count === undefined) {
|
|
2033
|
+
return false;
|
|
2034
|
+
}
|
|
2035
|
+
if (!(existing_count === incoming_count)) {
|
|
2036
|
+
return false;
|
|
2037
|
+
}
|
|
2038
|
+
}
|
|
2039
|
+
const existing_correlationId = existing.correlationId;
|
|
2040
|
+
const incoming_correlationId = incoming.correlationId;
|
|
2041
|
+
// if at least one of these optionals is defined
|
|
2042
|
+
if (existing_correlationId !== undefined || incoming_correlationId !== undefined) {
|
|
2043
|
+
// if one of these is not defined we know the other is defined and therefore
|
|
2044
|
+
// not equal
|
|
2045
|
+
if (existing_correlationId === undefined || incoming_correlationId === undefined) {
|
|
2046
|
+
return false;
|
|
2047
|
+
}
|
|
2048
|
+
if (!(existing_correlationId === incoming_correlationId)) {
|
|
2049
|
+
return false;
|
|
2050
|
+
}
|
|
2051
|
+
}
|
|
2052
|
+
const existing_products = existing.products;
|
|
2053
|
+
const incoming_products = incoming.products;
|
|
2054
|
+
// if at least one of these optionals is defined
|
|
2055
|
+
if (existing_products !== undefined || incoming_products !== undefined) {
|
|
2056
|
+
// if one of these is not defined we know the other is defined and therefore
|
|
2057
|
+
// not equal
|
|
2058
|
+
if (existing_products === undefined || incoming_products === undefined) {
|
|
2059
|
+
return false;
|
|
2060
|
+
}
|
|
2061
|
+
const equals_products_items = equalsArray(existing_products, incoming_products, (existing_products_item, incoming_products_item) => {
|
|
2062
|
+
if (!(existing_products_item.__ref === incoming_products_item.__ref)) {
|
|
2063
|
+
return false;
|
|
2064
|
+
}
|
|
2065
|
+
});
|
|
2066
|
+
if (equals_products_items === false) {
|
|
2067
|
+
return false;
|
|
2068
|
+
}
|
|
2069
|
+
}
|
|
2070
|
+
const existing_status = existing.status;
|
|
2071
|
+
const incoming_status = incoming.status;
|
|
2072
|
+
// if at least one of these optionals is defined
|
|
2073
|
+
if (existing_status !== undefined || incoming_status !== undefined) {
|
|
2074
|
+
// if one of these is not defined we know the other is defined and therefore
|
|
2075
|
+
// not equal
|
|
2076
|
+
if (existing_status === undefined || incoming_status === undefined) {
|
|
2077
|
+
return false;
|
|
2078
|
+
}
|
|
2079
|
+
if (!(equals$3(existing_status, incoming_status))) {
|
|
2080
|
+
return false;
|
|
2081
|
+
}
|
|
2082
|
+
}
|
|
2083
|
+
return true;
|
|
2084
|
+
}
|
|
2085
|
+
const ingest = function ProductsOutputRepresentationIngest(input, path, luvio, store, timestamp) {
|
|
2086
|
+
if (process.env.NODE_ENV !== 'production') {
|
|
2087
|
+
const validateError = validate(input);
|
|
2088
|
+
if (validateError !== null) {
|
|
2089
|
+
throw validateError;
|
|
2090
|
+
}
|
|
2091
|
+
}
|
|
2092
|
+
const key = path.fullPath;
|
|
2093
|
+
const existingRecord = store.readEntry(key);
|
|
2094
|
+
const ttlToUse = path.ttl !== undefined ? path.ttl : 360000;
|
|
2095
|
+
let incomingRecord = normalize(input, store.readEntry(key), {
|
|
2096
|
+
fullPath: key,
|
|
2097
|
+
parent: path.parent,
|
|
2098
|
+
propertyName: path.propertyName,
|
|
2099
|
+
ttl: ttlToUse
|
|
2100
|
+
}, luvio, store);
|
|
2101
|
+
if (existingRecord === undefined || equals(existingRecord, incomingRecord) === false) {
|
|
2102
|
+
luvio.storePublish(key, incomingRecord);
|
|
2103
|
+
}
|
|
2104
|
+
if (ttlToUse !== undefined) {
|
|
1493
2105
|
const storeMetadataParams = {
|
|
1494
2106
|
ttl: ttlToUse,
|
|
1495
2107
|
namespace: "epc",
|
|
@@ -1508,13 +2120,19 @@ function getTypeCacheKeys(rootKeySet, luvio, input, fullPathFactory) {
|
|
|
1508
2120
|
representationName: RepresentationType,
|
|
1509
2121
|
mergeable: false
|
|
1510
2122
|
});
|
|
2123
|
+
if (input.products !== undefined) {
|
|
2124
|
+
const input_products_length = input.products.length;
|
|
2125
|
+
for (let i = 0; i < input_products_length; i++) {
|
|
2126
|
+
getTypeCacheKeys$1(rootKeySet, luvio, input.products[i], () => '');
|
|
2127
|
+
}
|
|
2128
|
+
}
|
|
1511
2129
|
}
|
|
1512
2130
|
|
|
1513
2131
|
function select(luvio, params) {
|
|
1514
2132
|
return select$1();
|
|
1515
2133
|
}
|
|
1516
2134
|
function keyBuilder$1(luvio, params) {
|
|
1517
|
-
return keyPrefix + '::
|
|
2135
|
+
return keyPrefix + '::ProductsOutputRepresentation:(' + 'correlationId:' + params.queryParams.correlationId + ',' + 'productId:' + params.urlParams.productId + ')';
|
|
1518
2136
|
}
|
|
1519
2137
|
function getResponseCacheKeys(storeKeyMap, luvio, resourceParams, response) {
|
|
1520
2138
|
getTypeCacheKeys(storeKeyMap, luvio, response, () => keyBuilder$1(luvio, resourceParams));
|
|
@@ -1539,20 +2157,14 @@ function ingestSuccess(luvio, resourceParams, response, snapshotRefresh) {
|
|
|
1539
2157
|
function ingestError(luvio, params, error, snapshotRefresh) {
|
|
1540
2158
|
const key = keyBuilder$1(luvio, params);
|
|
1541
2159
|
const errorSnapshot = luvio.errorSnapshot(error, snapshotRefresh);
|
|
1542
|
-
|
|
1543
|
-
ttl: TTL,
|
|
1544
|
-
namespace: keyPrefix,
|
|
1545
|
-
version: VERSION,
|
|
1546
|
-
representationName: RepresentationType
|
|
1547
|
-
};
|
|
1548
|
-
luvio.storeIngestError(key, errorSnapshot, storeMetadataParams);
|
|
2160
|
+
luvio.storeIngestError(key, errorSnapshot);
|
|
1549
2161
|
return errorSnapshot;
|
|
1550
2162
|
}
|
|
1551
2163
|
function createResourceRequest(config) {
|
|
1552
2164
|
const headers = {};
|
|
1553
2165
|
return {
|
|
1554
2166
|
baseUri: '/services/data/v59.0',
|
|
1555
|
-
basePath: '/connect/epc/
|
|
2167
|
+
basePath: '/connect/epc/products/' + config.urlParams.productId + '',
|
|
1556
2168
|
method: 'get',
|
|
1557
2169
|
body: null,
|
|
1558
2170
|
urlParams: config.urlParams,
|
|
@@ -1562,11 +2174,11 @@ function createResourceRequest(config) {
|
|
|
1562
2174
|
};
|
|
1563
2175
|
}
|
|
1564
2176
|
|
|
1565
|
-
const
|
|
1566
|
-
displayName: '
|
|
2177
|
+
const getProductById_ConfigPropertyNames = {
|
|
2178
|
+
displayName: 'getProductById',
|
|
1567
2179
|
parameters: {
|
|
1568
2180
|
required: ['productId'],
|
|
1569
|
-
optional: ['correlationId'
|
|
2181
|
+
optional: ['correlationId']
|
|
1570
2182
|
}
|
|
1571
2183
|
};
|
|
1572
2184
|
function createResourceParams(config) {
|
|
@@ -1575,7 +2187,7 @@ function createResourceParams(config) {
|
|
|
1575
2187
|
productId: config.productId
|
|
1576
2188
|
},
|
|
1577
2189
|
queryParams: {
|
|
1578
|
-
correlationId: config.correlationId
|
|
2190
|
+
correlationId: config.correlationId
|
|
1579
2191
|
}
|
|
1580
2192
|
};
|
|
1581
2193
|
return resourceParams;
|
|
@@ -1594,10 +2206,6 @@ function typeCheckConfig(untrustedConfig) {
|
|
|
1594
2206
|
if (typeof untrustedConfig_correlationId === 'string') {
|
|
1595
2207
|
config.correlationId = untrustedConfig_correlationId;
|
|
1596
2208
|
}
|
|
1597
|
-
const untrustedConfig_isPriceImpacting = untrustedConfig.isPriceImpacting;
|
|
1598
|
-
if (typeof untrustedConfig_isPriceImpacting === 'boolean') {
|
|
1599
|
-
config.isPriceImpacting = untrustedConfig_isPriceImpacting;
|
|
1600
|
-
}
|
|
1601
2209
|
return config;
|
|
1602
2210
|
}
|
|
1603
2211
|
function validateAdapterConfig(untrustedConfig, configPropertyNames) {
|
|
@@ -1675,8 +2283,8 @@ function buildCachedSnapshotCachePolicy(context, storeLookup) {
|
|
|
1675
2283
|
});
|
|
1676
2284
|
return cacheSnapshot;
|
|
1677
2285
|
}
|
|
1678
|
-
const
|
|
1679
|
-
const config = validateAdapterConfig(untrustedConfig,
|
|
2286
|
+
const getProductByIdAdapterFactory = (luvio) => function epc__getProductById(untrustedConfig, requestContext) {
|
|
2287
|
+
const config = validateAdapterConfig(untrustedConfig, getProductById_ConfigPropertyNames);
|
|
1680
2288
|
// Invalid or incomplete config
|
|
1681
2289
|
if (config === null) {
|
|
1682
2290
|
return null;
|
|
@@ -1685,4 +2293,4 @@ const getProductAttributesByProductIdAdapterFactory = (luvio) => function epc__g
|
|
|
1685
2293
|
buildCachedSnapshotCachePolicy, buildNetworkSnapshotCachePolicy);
|
|
1686
2294
|
};
|
|
1687
2295
|
|
|
1688
|
-
export { createProductAttributeDefinitionAdapterFactory, deactivateAdapterFactory, getProductAttributesByProductIdAdapterFactory, getProductFlowByProductIdAdapterFactory };
|
|
2296
|
+
export { createProductAttributeDefinitionAdapterFactory, deactivateAdapterFactory, getProductAttributesByProductIdAdapterFactory, getProductByIdAdapterFactory, getProductFlowByProductIdAdapterFactory };
|