@salesforce/lds-adapters-industries-epc 1.290.0 → 1.292.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 +366 -60
- package/dist/es/es2018/types/src/generated/adapters/getSnapshots.d.ts +26 -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/getConnectPcmIndexSnapshots.d.ts +12 -0
- package/dist/es/es2018/types/src/generated/types/SnapshotCollectionOutputRepresentation.d.ts +30 -0
- package/dist/es/es2018/types/src/generated/types/SnapshotIndexOutputRepresentation.d.ts +46 -0
- package/dist/es/es2018/types/src/generated/types/SnapshotOutputRepresentation.d.ts +41 -0
- package/package.json +4 -4
- package/sfdc/index.js +712 -398
- package/src/raml/api.raml +74 -0
- package/src/raml/luvio.raml +7 -0
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
* For full license text, see the LICENSE.txt file
|
|
5
5
|
*/
|
|
6
6
|
|
|
7
|
-
import { serializeStructuredKey, ingestShape, deepFreeze, StoreKeyMap, createResourceParams as createResourceParams$
|
|
7
|
+
import { serializeStructuredKey, ingestShape, deepFreeze, StoreKeyMap, createResourceParams as createResourceParams$8, buildNetworkSnapshotCachePolicy as buildNetworkSnapshotCachePolicy$6, typeCheckConfig as typeCheckConfig$8 } from '@luvio/engine';
|
|
8
8
|
|
|
9
9
|
const { hasOwnProperty: ObjectPrototypeHasOwnProperty } = Object.prototype;
|
|
10
10
|
const { keys: ObjectKeys, create: ObjectCreate } = Object;
|
|
@@ -92,7 +92,7 @@ function createLink(ref) {
|
|
|
92
92
|
};
|
|
93
93
|
}
|
|
94
94
|
|
|
95
|
-
function validate$
|
|
95
|
+
function validate$v(obj, path = 'DeactivateInputRepresentation') {
|
|
96
96
|
const v_error = (() => {
|
|
97
97
|
if (typeof obj !== 'object' || ArrayIsArray(obj) || obj === null) {
|
|
98
98
|
return new TypeError('Expected "object" but received "' + typeof obj + '" (at "' + path + '")');
|
|
@@ -125,7 +125,7 @@ function validate$s(obj, path = 'DeactivateInputRepresentation') {
|
|
|
125
125
|
return v_error === undefined ? null : v_error;
|
|
126
126
|
}
|
|
127
127
|
|
|
128
|
-
function validate$
|
|
128
|
+
function validate$u(obj, path = 'ErrorOutputRepresentation') {
|
|
129
129
|
const v_error = (() => {
|
|
130
130
|
if (typeof obj !== 'object' || ArrayIsArray(obj) || obj === null) {
|
|
131
131
|
return new TypeError('Expected "object" but received "' + typeof obj + '" (at "' + path + '")');
|
|
@@ -156,9 +156,9 @@ function validate$r(obj, path = 'ErrorOutputRepresentation') {
|
|
|
156
156
|
return v_error === undefined ? null : v_error;
|
|
157
157
|
}
|
|
158
158
|
|
|
159
|
-
const TTL$
|
|
160
|
-
const VERSION$
|
|
161
|
-
function validate$
|
|
159
|
+
const TTL$6 = 6000;
|
|
160
|
+
const VERSION$8 = "67abdeaa299bae24f468fd2e78cd1e1e";
|
|
161
|
+
function validate$t(obj, path = 'RecordIdMapOutputRepresentation') {
|
|
162
162
|
const v_error = (() => {
|
|
163
163
|
if (typeof obj !== 'object' || ArrayIsArray(obj) || obj === null) {
|
|
164
164
|
return new TypeError('Expected "object" but received "' + typeof obj + '" (at "' + path + '")');
|
|
@@ -171,7 +171,7 @@ function validate$q(obj, path = 'RecordIdMapOutputRepresentation') {
|
|
|
171
171
|
for (let i = 0; i < obj_errors.length; i++) {
|
|
172
172
|
const obj_errors_item = obj_errors[i];
|
|
173
173
|
const path_errors_item = path_errors + '[' + i + ']';
|
|
174
|
-
const referencepath_errors_itemValidationError = validate$
|
|
174
|
+
const referencepath_errors_itemValidationError = validate$u(obj_errors_item, path_errors_item);
|
|
175
175
|
if (referencepath_errors_itemValidationError !== null) {
|
|
176
176
|
let message = 'Object doesn\'t match ErrorOutputRepresentation (at "' + path_errors_item + '")\n';
|
|
177
177
|
message += referencepath_errors_itemValidationError.message.split('\n').map((line) => '\t' + line).join('\n');
|
|
@@ -186,68 +186,68 @@ function validate$q(obj, path = 'RecordIdMapOutputRepresentation') {
|
|
|
186
186
|
})();
|
|
187
187
|
return v_error === undefined ? null : v_error;
|
|
188
188
|
}
|
|
189
|
-
const RepresentationType$
|
|
190
|
-
function keyBuilder$
|
|
191
|
-
return keyPrefix + '::' + RepresentationType$
|
|
189
|
+
const RepresentationType$7 = 'RecordIdMapOutputRepresentation';
|
|
190
|
+
function keyBuilder$d(luvio, config) {
|
|
191
|
+
return keyPrefix + '::' + RepresentationType$7 + ':' + config.message;
|
|
192
192
|
}
|
|
193
193
|
function keyBuilderFromType$1(luvio, object) {
|
|
194
194
|
const keyParams = {
|
|
195
195
|
message: object.status
|
|
196
196
|
};
|
|
197
|
-
return keyBuilder$
|
|
197
|
+
return keyBuilder$d(luvio, keyParams);
|
|
198
198
|
}
|
|
199
|
-
function normalize$
|
|
199
|
+
function normalize$7(input, existing, path, luvio, store, timestamp) {
|
|
200
200
|
return input;
|
|
201
201
|
}
|
|
202
|
-
const select$
|
|
202
|
+
const select$g = function RecordIdMapOutputRepresentationSelect() {
|
|
203
203
|
return {
|
|
204
204
|
kind: 'Fragment',
|
|
205
|
-
version: VERSION$
|
|
205
|
+
version: VERSION$8,
|
|
206
206
|
private: [],
|
|
207
207
|
opaque: true
|
|
208
208
|
};
|
|
209
209
|
};
|
|
210
|
-
function equals$
|
|
210
|
+
function equals$8(existing, incoming) {
|
|
211
211
|
if (JSONStringify(incoming) !== JSONStringify(existing)) {
|
|
212
212
|
return false;
|
|
213
213
|
}
|
|
214
214
|
return true;
|
|
215
215
|
}
|
|
216
|
-
const ingest$
|
|
216
|
+
const ingest$7 = function RecordIdMapOutputRepresentationIngest(input, path, luvio, store, timestamp) {
|
|
217
217
|
if (process.env.NODE_ENV !== 'production') {
|
|
218
|
-
const validateError = validate$
|
|
218
|
+
const validateError = validate$t(input);
|
|
219
219
|
if (validateError !== null) {
|
|
220
220
|
throw validateError;
|
|
221
221
|
}
|
|
222
222
|
}
|
|
223
223
|
const key = keyBuilderFromType$1(luvio, input);
|
|
224
|
-
const ttlToUse = TTL$
|
|
225
|
-
ingestShape(input, path, luvio, store, timestamp, ttlToUse, key, normalize$
|
|
224
|
+
const ttlToUse = TTL$6;
|
|
225
|
+
ingestShape(input, path, luvio, store, timestamp, ttlToUse, key, normalize$7, "epc", VERSION$8, RepresentationType$7, equals$8);
|
|
226
226
|
return createLink(key);
|
|
227
227
|
};
|
|
228
|
-
function getTypeCacheKeys$
|
|
228
|
+
function getTypeCacheKeys$7(rootKeySet, luvio, input, fullPathFactory) {
|
|
229
229
|
// root cache key (uses fullPathFactory if keyBuilderFromType isn't defined)
|
|
230
230
|
const rootKey = keyBuilderFromType$1(luvio, input);
|
|
231
231
|
rootKeySet.set(rootKey, {
|
|
232
232
|
namespace: keyPrefix,
|
|
233
|
-
representationName: RepresentationType$
|
|
233
|
+
representationName: RepresentationType$7,
|
|
234
234
|
mergeable: false
|
|
235
235
|
});
|
|
236
236
|
}
|
|
237
237
|
|
|
238
|
-
function select$
|
|
239
|
-
return select$
|
|
238
|
+
function select$f(luvio, params) {
|
|
239
|
+
return select$g();
|
|
240
240
|
}
|
|
241
|
-
function getResponseCacheKeys$
|
|
242
|
-
getTypeCacheKeys$
|
|
241
|
+
function getResponseCacheKeys$7(storeKeyMap, luvio, resourceParams, response) {
|
|
242
|
+
getTypeCacheKeys$7(storeKeyMap, luvio, response);
|
|
243
243
|
}
|
|
244
|
-
function ingestSuccess$
|
|
244
|
+
function ingestSuccess$7(luvio, resourceParams, response) {
|
|
245
245
|
const { body } = response;
|
|
246
246
|
const key = keyBuilderFromType$1(luvio, body);
|
|
247
|
-
luvio.storeIngest(key, ingest$
|
|
247
|
+
luvio.storeIngest(key, ingest$7, body);
|
|
248
248
|
const snapshot = luvio.storeLookup({
|
|
249
249
|
recordId: key,
|
|
250
|
-
node: select$
|
|
250
|
+
node: select$f(),
|
|
251
251
|
variables: {},
|
|
252
252
|
});
|
|
253
253
|
if (process.env.NODE_ENV !== 'production') {
|
|
@@ -258,7 +258,7 @@ function ingestSuccess$6(luvio, resourceParams, response) {
|
|
|
258
258
|
deepFreeze(snapshot.data);
|
|
259
259
|
return snapshot;
|
|
260
260
|
}
|
|
261
|
-
function createResourceRequest$
|
|
261
|
+
function createResourceRequest$7(config) {
|
|
262
262
|
const headers = {};
|
|
263
263
|
return {
|
|
264
264
|
baseUri: '/services/data/v62.0',
|
|
@@ -272,45 +272,45 @@ function createResourceRequest$6(config) {
|
|
|
272
272
|
};
|
|
273
273
|
}
|
|
274
274
|
|
|
275
|
-
const adapterName$
|
|
275
|
+
const adapterName$7 = 'deactivate';
|
|
276
276
|
const deactivate_ConfigPropertyMetadata = [
|
|
277
277
|
generateParamConfigMetadata('deactivateInputPayload', true, 2 /* Body */, 4 /* Unsupported */),
|
|
278
278
|
];
|
|
279
|
-
const deactivate_ConfigPropertyNames = /*#__PURE__*/ buildAdapterValidationConfig(adapterName$
|
|
280
|
-
const createResourceParams$
|
|
281
|
-
function typeCheckConfig$
|
|
279
|
+
const deactivate_ConfigPropertyNames = /*#__PURE__*/ buildAdapterValidationConfig(adapterName$7, deactivate_ConfigPropertyMetadata);
|
|
280
|
+
const createResourceParams$7 = /*#__PURE__*/ createResourceParams$8(deactivate_ConfigPropertyMetadata);
|
|
281
|
+
function typeCheckConfig$7(untrustedConfig) {
|
|
282
282
|
const config = {};
|
|
283
283
|
const untrustedConfig_deactivateInputPayload = untrustedConfig.deactivateInputPayload;
|
|
284
|
-
const referenceDeactivateInputRepresentationValidationError = validate$
|
|
284
|
+
const referenceDeactivateInputRepresentationValidationError = validate$v(untrustedConfig_deactivateInputPayload);
|
|
285
285
|
if (referenceDeactivateInputRepresentationValidationError === null) {
|
|
286
286
|
config.deactivateInputPayload = untrustedConfig_deactivateInputPayload;
|
|
287
287
|
}
|
|
288
288
|
return config;
|
|
289
289
|
}
|
|
290
|
-
function validateAdapterConfig$
|
|
290
|
+
function validateAdapterConfig$7(untrustedConfig, configPropertyNames) {
|
|
291
291
|
if (!untrustedIsObject(untrustedConfig)) {
|
|
292
292
|
return null;
|
|
293
293
|
}
|
|
294
294
|
if (process.env.NODE_ENV !== 'production') {
|
|
295
295
|
validateConfig(untrustedConfig, configPropertyNames);
|
|
296
296
|
}
|
|
297
|
-
const config = typeCheckConfig$
|
|
297
|
+
const config = typeCheckConfig$7(untrustedConfig);
|
|
298
298
|
if (!areRequiredParametersPresent(config, configPropertyNames)) {
|
|
299
299
|
return null;
|
|
300
300
|
}
|
|
301
301
|
return config;
|
|
302
302
|
}
|
|
303
|
-
function buildNetworkSnapshot$
|
|
304
|
-
const resourceParams = createResourceParams$
|
|
305
|
-
const request = createResourceRequest$
|
|
303
|
+
function buildNetworkSnapshot$7(luvio, config, options) {
|
|
304
|
+
const resourceParams = createResourceParams$7(config);
|
|
305
|
+
const request = createResourceRequest$7(resourceParams);
|
|
306
306
|
return luvio.dispatchResourceRequest(request, options)
|
|
307
307
|
.then((response) => {
|
|
308
308
|
return luvio.handleSuccessResponse(() => {
|
|
309
|
-
const snapshot = ingestSuccess$
|
|
309
|
+
const snapshot = ingestSuccess$7(luvio, resourceParams, response);
|
|
310
310
|
return luvio.storeBroadcast().then(() => snapshot);
|
|
311
311
|
}, () => {
|
|
312
312
|
const cache = new StoreKeyMap();
|
|
313
|
-
getResponseCacheKeys$
|
|
313
|
+
getResponseCacheKeys$7(cache, luvio, resourceParams, response.body);
|
|
314
314
|
return cache;
|
|
315
315
|
});
|
|
316
316
|
}, (response) => {
|
|
@@ -320,13 +320,319 @@ function buildNetworkSnapshot$6(luvio, config, options) {
|
|
|
320
320
|
}
|
|
321
321
|
const deactivateAdapterFactory = (luvio) => {
|
|
322
322
|
return function deactivate(untrustedConfig) {
|
|
323
|
-
const config = validateAdapterConfig$
|
|
323
|
+
const config = validateAdapterConfig$7(untrustedConfig, deactivate_ConfigPropertyNames);
|
|
324
324
|
// Invalid or incomplete config
|
|
325
325
|
if (config === null) {
|
|
326
326
|
throw new Error('Invalid config for "deactivate"');
|
|
327
327
|
}
|
|
328
|
-
return buildNetworkSnapshot$
|
|
328
|
+
return buildNetworkSnapshot$7(luvio, config);
|
|
329
|
+
};
|
|
330
|
+
};
|
|
331
|
+
|
|
332
|
+
function validate$s(obj, path = 'SnapshotIndexOutputRepresentation') {
|
|
333
|
+
const v_error = (() => {
|
|
334
|
+
if (typeof obj !== 'object' || ArrayIsArray(obj) || obj === null) {
|
|
335
|
+
return new TypeError('Expected "object" but received "' + typeof obj + '" (at "' + path + '")');
|
|
336
|
+
}
|
|
337
|
+
if (obj.completedDate !== undefined) {
|
|
338
|
+
const obj_completedDate = obj.completedDate;
|
|
339
|
+
const path_completedDate = path + '.completedDate';
|
|
340
|
+
if (typeof obj_completedDate !== 'string') {
|
|
341
|
+
return new TypeError('Expected "string" but received "' + typeof obj_completedDate + '" (at "' + path_completedDate + '")');
|
|
342
|
+
}
|
|
343
|
+
}
|
|
344
|
+
if (obj.createdDate !== undefined) {
|
|
345
|
+
const obj_createdDate = obj.createdDate;
|
|
346
|
+
const path_createdDate = path + '.createdDate';
|
|
347
|
+
if (typeof obj_createdDate !== 'string') {
|
|
348
|
+
return new TypeError('Expected "string" but received "' + typeof obj_createdDate + '" (at "' + path_createdDate + '")');
|
|
349
|
+
}
|
|
350
|
+
}
|
|
351
|
+
const obj_id = obj.id;
|
|
352
|
+
const path_id = path + '.id';
|
|
353
|
+
if (typeof obj_id !== 'string') {
|
|
354
|
+
return new TypeError('Expected "string" but received "' + typeof obj_id + '" (at "' + path_id + '")');
|
|
355
|
+
}
|
|
356
|
+
if (obj.indexBuildType !== undefined) {
|
|
357
|
+
const obj_indexBuildType = obj.indexBuildType;
|
|
358
|
+
const path_indexBuildType = path + '.indexBuildType';
|
|
359
|
+
if (typeof obj_indexBuildType !== 'string') {
|
|
360
|
+
return new TypeError('Expected "string" but received "' + typeof obj_indexBuildType + '" (at "' + path_indexBuildType + '")');
|
|
361
|
+
}
|
|
362
|
+
}
|
|
363
|
+
if (obj.indexType !== undefined) {
|
|
364
|
+
const obj_indexType = obj.indexType;
|
|
365
|
+
const path_indexType = path + '.indexType';
|
|
366
|
+
if (typeof obj_indexType !== 'string') {
|
|
367
|
+
return new TypeError('Expected "string" but received "' + typeof obj_indexType + '" (at "' + path_indexType + '")');
|
|
368
|
+
}
|
|
369
|
+
}
|
|
370
|
+
if (obj.lastBuildStatus !== undefined) {
|
|
371
|
+
const obj_lastBuildStatus = obj.lastBuildStatus;
|
|
372
|
+
const path_lastBuildStatus = path + '.lastBuildStatus';
|
|
373
|
+
if (typeof obj_lastBuildStatus !== 'string') {
|
|
374
|
+
return new TypeError('Expected "string" but received "' + typeof obj_lastBuildStatus + '" (at "' + path_lastBuildStatus + '")');
|
|
375
|
+
}
|
|
376
|
+
}
|
|
377
|
+
if (obj.numberOfRecords !== undefined) {
|
|
378
|
+
const obj_numberOfRecords = obj.numberOfRecords;
|
|
379
|
+
const path_numberOfRecords = path + '.numberOfRecords';
|
|
380
|
+
if (typeof obj_numberOfRecords !== 'number' || (typeof obj_numberOfRecords === 'number' && Math.floor(obj_numberOfRecords) !== obj_numberOfRecords)) {
|
|
381
|
+
return new TypeError('Expected "integer" but received "' + typeof obj_numberOfRecords + '" (at "' + path_numberOfRecords + '")');
|
|
382
|
+
}
|
|
383
|
+
}
|
|
384
|
+
})();
|
|
385
|
+
return v_error === undefined ? null : v_error;
|
|
386
|
+
}
|
|
387
|
+
|
|
388
|
+
function validate$r(obj, path = 'SnapshotOutputRepresentation') {
|
|
389
|
+
const v_error = (() => {
|
|
390
|
+
if (typeof obj !== 'object' || ArrayIsArray(obj) || obj === null) {
|
|
391
|
+
return new TypeError('Expected "object" but received "' + typeof obj + '" (at "' + path + '")');
|
|
392
|
+
}
|
|
393
|
+
if (obj.activationDate !== undefined) {
|
|
394
|
+
const obj_activationDate = obj.activationDate;
|
|
395
|
+
const path_activationDate = path + '.activationDate';
|
|
396
|
+
if (typeof obj_activationDate !== 'string') {
|
|
397
|
+
return new TypeError('Expected "string" but received "' + typeof obj_activationDate + '" (at "' + path_activationDate + '")');
|
|
398
|
+
}
|
|
399
|
+
}
|
|
400
|
+
if (obj.activationStatus !== undefined) {
|
|
401
|
+
const obj_activationStatus = obj.activationStatus;
|
|
402
|
+
const path_activationStatus = path + '.activationStatus';
|
|
403
|
+
if (typeof obj_activationStatus !== 'string') {
|
|
404
|
+
return new TypeError('Expected "string" but received "' + typeof obj_activationStatus + '" (at "' + path_activationStatus + '")');
|
|
405
|
+
}
|
|
406
|
+
}
|
|
407
|
+
if (obj.activationType !== undefined) {
|
|
408
|
+
const obj_activationType = obj.activationType;
|
|
409
|
+
const path_activationType = path + '.activationType';
|
|
410
|
+
if (typeof obj_activationType !== 'string') {
|
|
411
|
+
return new TypeError('Expected "string" but received "' + typeof obj_activationType + '" (at "' + path_activationType + '")');
|
|
412
|
+
}
|
|
413
|
+
}
|
|
414
|
+
const obj_id = obj.id;
|
|
415
|
+
const path_id = path + '.id';
|
|
416
|
+
if (typeof obj_id !== 'string') {
|
|
417
|
+
return new TypeError('Expected "string" but received "' + typeof obj_id + '" (at "' + path_id + '")');
|
|
418
|
+
}
|
|
419
|
+
const obj_snapshotIndexes = obj.snapshotIndexes;
|
|
420
|
+
const path_snapshotIndexes = path + '.snapshotIndexes';
|
|
421
|
+
if (!ArrayIsArray(obj_snapshotIndexes)) {
|
|
422
|
+
return new TypeError('Expected "array" but received "' + typeof obj_snapshotIndexes + '" (at "' + path_snapshotIndexes + '")');
|
|
423
|
+
}
|
|
424
|
+
for (let i = 0; i < obj_snapshotIndexes.length; i++) {
|
|
425
|
+
const obj_snapshotIndexes_item = obj_snapshotIndexes[i];
|
|
426
|
+
const path_snapshotIndexes_item = path_snapshotIndexes + '[' + i + ']';
|
|
427
|
+
const referencepath_snapshotIndexes_itemValidationError = validate$s(obj_snapshotIndexes_item, path_snapshotIndexes_item);
|
|
428
|
+
if (referencepath_snapshotIndexes_itemValidationError !== null) {
|
|
429
|
+
let message = 'Object doesn\'t match SnapshotIndexOutputRepresentation (at "' + path_snapshotIndexes_item + '")\n';
|
|
430
|
+
message += referencepath_snapshotIndexes_itemValidationError.message.split('\n').map((line) => '\t' + line).join('\n');
|
|
431
|
+
return new TypeError(message);
|
|
432
|
+
}
|
|
433
|
+
}
|
|
434
|
+
})();
|
|
435
|
+
return v_error === undefined ? null : v_error;
|
|
436
|
+
}
|
|
437
|
+
|
|
438
|
+
const TTL$5 = 6000;
|
|
439
|
+
const VERSION$7 = "6c7ad97ab7e48e90336529c3204ce90e";
|
|
440
|
+
function validate$q(obj, path = 'SnapshotCollectionOutputRepresentation') {
|
|
441
|
+
const v_error = (() => {
|
|
442
|
+
if (typeof obj !== 'object' || ArrayIsArray(obj) || obj === null) {
|
|
443
|
+
return new TypeError('Expected "object" but received "' + typeof obj + '" (at "' + path + '")');
|
|
444
|
+
}
|
|
445
|
+
const obj_snapshots = obj.snapshots;
|
|
446
|
+
const path_snapshots = path + '.snapshots';
|
|
447
|
+
if (!ArrayIsArray(obj_snapshots)) {
|
|
448
|
+
return new TypeError('Expected "array" but received "' + typeof obj_snapshots + '" (at "' + path_snapshots + '")');
|
|
449
|
+
}
|
|
450
|
+
for (let i = 0; i < obj_snapshots.length; i++) {
|
|
451
|
+
const obj_snapshots_item = obj_snapshots[i];
|
|
452
|
+
const path_snapshots_item = path_snapshots + '[' + i + ']';
|
|
453
|
+
const referencepath_snapshots_itemValidationError = validate$r(obj_snapshots_item, path_snapshots_item);
|
|
454
|
+
if (referencepath_snapshots_itemValidationError !== null) {
|
|
455
|
+
let message = 'Object doesn\'t match SnapshotOutputRepresentation (at "' + path_snapshots_item + '")\n';
|
|
456
|
+
message += referencepath_snapshots_itemValidationError.message.split('\n').map((line) => '\t' + line).join('\n');
|
|
457
|
+
return new TypeError(message);
|
|
458
|
+
}
|
|
459
|
+
}
|
|
460
|
+
})();
|
|
461
|
+
return v_error === undefined ? null : v_error;
|
|
462
|
+
}
|
|
463
|
+
const RepresentationType$6 = 'SnapshotCollectionOutputRepresentation';
|
|
464
|
+
function normalize$6(input, existing, path, luvio, store, timestamp) {
|
|
465
|
+
return input;
|
|
466
|
+
}
|
|
467
|
+
const select$e = function SnapshotCollectionOutputRepresentationSelect() {
|
|
468
|
+
return {
|
|
469
|
+
kind: 'Fragment',
|
|
470
|
+
version: VERSION$7,
|
|
471
|
+
private: [],
|
|
472
|
+
opaque: true
|
|
473
|
+
};
|
|
474
|
+
};
|
|
475
|
+
function equals$7(existing, incoming) {
|
|
476
|
+
if (JSONStringify(incoming) !== JSONStringify(existing)) {
|
|
477
|
+
return false;
|
|
478
|
+
}
|
|
479
|
+
return true;
|
|
480
|
+
}
|
|
481
|
+
const ingest$6 = function SnapshotCollectionOutputRepresentationIngest(input, path, luvio, store, timestamp) {
|
|
482
|
+
if (process.env.NODE_ENV !== 'production') {
|
|
483
|
+
const validateError = validate$q(input);
|
|
484
|
+
if (validateError !== null) {
|
|
485
|
+
throw validateError;
|
|
486
|
+
}
|
|
487
|
+
}
|
|
488
|
+
const key = path.fullPath;
|
|
489
|
+
const ttlToUse = TTL$5;
|
|
490
|
+
ingestShape(input, path, luvio, store, timestamp, ttlToUse, key, normalize$6, "epc", VERSION$7, RepresentationType$6, equals$7);
|
|
491
|
+
return createLink(key);
|
|
492
|
+
};
|
|
493
|
+
function getTypeCacheKeys$6(rootKeySet, luvio, input, fullPathFactory) {
|
|
494
|
+
// root cache key (uses fullPathFactory if keyBuilderFromType isn't defined)
|
|
495
|
+
const rootKey = fullPathFactory();
|
|
496
|
+
rootKeySet.set(rootKey, {
|
|
497
|
+
namespace: keyPrefix,
|
|
498
|
+
representationName: RepresentationType$6,
|
|
499
|
+
mergeable: false
|
|
500
|
+
});
|
|
501
|
+
}
|
|
502
|
+
|
|
503
|
+
function select$d(luvio, params) {
|
|
504
|
+
return select$e();
|
|
505
|
+
}
|
|
506
|
+
function keyBuilder$c(luvio, params) {
|
|
507
|
+
return keyPrefix + '::SnapshotCollectionOutputRepresentation:(' + ')';
|
|
508
|
+
}
|
|
509
|
+
function getResponseCacheKeys$6(storeKeyMap, luvio, resourceParams, response) {
|
|
510
|
+
getTypeCacheKeys$6(storeKeyMap, luvio, response, () => keyBuilder$c());
|
|
511
|
+
}
|
|
512
|
+
function ingestSuccess$6(luvio, resourceParams, response, snapshotRefresh) {
|
|
513
|
+
const { body } = response;
|
|
514
|
+
const key = keyBuilder$c();
|
|
515
|
+
luvio.storeIngest(key, ingest$6, body);
|
|
516
|
+
const snapshot = luvio.storeLookup({
|
|
517
|
+
recordId: key,
|
|
518
|
+
node: select$d(),
|
|
519
|
+
variables: {},
|
|
520
|
+
}, snapshotRefresh);
|
|
521
|
+
if (process.env.NODE_ENV !== 'production') {
|
|
522
|
+
if (snapshot.state !== 'Fulfilled') {
|
|
523
|
+
throw new Error('Invalid network response. Expected resource response to result in Fulfilled snapshot');
|
|
524
|
+
}
|
|
525
|
+
}
|
|
526
|
+
deepFreeze(snapshot.data);
|
|
527
|
+
return snapshot;
|
|
528
|
+
}
|
|
529
|
+
function ingestError$5(luvio, params, error, snapshotRefresh) {
|
|
530
|
+
const key = keyBuilder$c();
|
|
531
|
+
const errorSnapshot = luvio.errorSnapshot(error, snapshotRefresh);
|
|
532
|
+
const storeMetadataParams = {
|
|
533
|
+
ttl: TTL$5,
|
|
534
|
+
namespace: keyPrefix,
|
|
535
|
+
version: VERSION$7,
|
|
536
|
+
representationName: RepresentationType$6
|
|
537
|
+
};
|
|
538
|
+
luvio.storeIngestError(key, errorSnapshot, storeMetadataParams);
|
|
539
|
+
return errorSnapshot;
|
|
540
|
+
}
|
|
541
|
+
function createResourceRequest$6(config) {
|
|
542
|
+
const headers = {};
|
|
543
|
+
return {
|
|
544
|
+
baseUri: '/services/data/v62.0',
|
|
545
|
+
basePath: '/connect/pcm/index/snapshots',
|
|
546
|
+
method: 'get',
|
|
547
|
+
body: null,
|
|
548
|
+
urlParams: {},
|
|
549
|
+
queryParams: {},
|
|
550
|
+
headers,
|
|
551
|
+
priority: 'normal',
|
|
329
552
|
};
|
|
553
|
+
}
|
|
554
|
+
|
|
555
|
+
const adapterName$6 = 'getSnapshots';
|
|
556
|
+
const getSnapshots_ConfigPropertyMetadata = [];
|
|
557
|
+
const getSnapshots_ConfigPropertyNames = /*#__PURE__*/ buildAdapterValidationConfig(adapterName$6, getSnapshots_ConfigPropertyMetadata);
|
|
558
|
+
const createResourceParams$6 = /*#__PURE__*/ createResourceParams$8(getSnapshots_ConfigPropertyMetadata);
|
|
559
|
+
function keyBuilder$b(luvio, config) {
|
|
560
|
+
createResourceParams$6(config);
|
|
561
|
+
return keyBuilder$c();
|
|
562
|
+
}
|
|
563
|
+
function typeCheckConfig$6(untrustedConfig) {
|
|
564
|
+
const config = {};
|
|
565
|
+
return config;
|
|
566
|
+
}
|
|
567
|
+
function validateAdapterConfig$6(untrustedConfig, configPropertyNames) {
|
|
568
|
+
if (!untrustedIsObject(untrustedConfig)) {
|
|
569
|
+
return null;
|
|
570
|
+
}
|
|
571
|
+
if (process.env.NODE_ENV !== 'production') {
|
|
572
|
+
validateConfig(untrustedConfig, configPropertyNames);
|
|
573
|
+
}
|
|
574
|
+
const config = typeCheckConfig$6();
|
|
575
|
+
if (!areRequiredParametersPresent(config, configPropertyNames)) {
|
|
576
|
+
return null;
|
|
577
|
+
}
|
|
578
|
+
return config;
|
|
579
|
+
}
|
|
580
|
+
function adapterFragment$5(luvio, config) {
|
|
581
|
+
createResourceParams$6(config);
|
|
582
|
+
return select$d();
|
|
583
|
+
}
|
|
584
|
+
function onFetchResponseSuccess$5(luvio, config, resourceParams, response) {
|
|
585
|
+
const snapshot = ingestSuccess$6(luvio, resourceParams, response, {
|
|
586
|
+
config,
|
|
587
|
+
resolve: () => buildNetworkSnapshot$6(luvio, config, snapshotRefreshOptions)
|
|
588
|
+
});
|
|
589
|
+
return luvio.storeBroadcast().then(() => snapshot);
|
|
590
|
+
}
|
|
591
|
+
function onFetchResponseError$5(luvio, config, resourceParams, response) {
|
|
592
|
+
const snapshot = ingestError$5(luvio, resourceParams, response, {
|
|
593
|
+
config,
|
|
594
|
+
resolve: () => buildNetworkSnapshot$6(luvio, config, snapshotRefreshOptions)
|
|
595
|
+
});
|
|
596
|
+
return luvio.storeBroadcast().then(() => snapshot);
|
|
597
|
+
}
|
|
598
|
+
function buildNetworkSnapshot$6(luvio, config, options) {
|
|
599
|
+
const resourceParams = createResourceParams$6(config);
|
|
600
|
+
const request = createResourceRequest$6();
|
|
601
|
+
return luvio.dispatchResourceRequest(request, options)
|
|
602
|
+
.then((response) => {
|
|
603
|
+
return luvio.handleSuccessResponse(() => onFetchResponseSuccess$5(luvio, config, resourceParams, response), () => {
|
|
604
|
+
const cache = new StoreKeyMap();
|
|
605
|
+
getResponseCacheKeys$6(cache, luvio, resourceParams, response.body);
|
|
606
|
+
return cache;
|
|
607
|
+
});
|
|
608
|
+
}, (response) => {
|
|
609
|
+
return luvio.handleErrorResponse(() => onFetchResponseError$5(luvio, config, resourceParams, response));
|
|
610
|
+
});
|
|
611
|
+
}
|
|
612
|
+
function buildNetworkSnapshotCachePolicy$5(context, coercedAdapterRequestContext) {
|
|
613
|
+
return buildNetworkSnapshotCachePolicy$6(context, coercedAdapterRequestContext, buildNetworkSnapshot$6, undefined, false);
|
|
614
|
+
}
|
|
615
|
+
function buildCachedSnapshotCachePolicy$5(context, storeLookup) {
|
|
616
|
+
const { luvio, config } = context;
|
|
617
|
+
const selector = {
|
|
618
|
+
recordId: keyBuilder$b(luvio, config),
|
|
619
|
+
node: adapterFragment$5(luvio, config),
|
|
620
|
+
variables: {},
|
|
621
|
+
};
|
|
622
|
+
const cacheSnapshot = storeLookup(selector, {
|
|
623
|
+
config,
|
|
624
|
+
resolve: () => buildNetworkSnapshot$6(luvio, config, snapshotRefreshOptions)
|
|
625
|
+
});
|
|
626
|
+
return cacheSnapshot;
|
|
627
|
+
}
|
|
628
|
+
const getSnapshotsAdapterFactory = (luvio) => function epc__getSnapshots(untrustedConfig, requestContext) {
|
|
629
|
+
const config = validateAdapterConfig$6(untrustedConfig, getSnapshots_ConfigPropertyNames);
|
|
630
|
+
// Invalid or incomplete config
|
|
631
|
+
if (config === null) {
|
|
632
|
+
return null;
|
|
633
|
+
}
|
|
634
|
+
return luvio.applyCachePolicy((requestContext || {}), { config, luvio }, // BuildSnapshotContext
|
|
635
|
+
buildCachedSnapshotCachePolicy$5, buildNetworkSnapshotCachePolicy$5);
|
|
330
636
|
};
|
|
331
637
|
|
|
332
638
|
function validate$p(obj, path = 'ProductAttributeDefinitionListInputRepresentation') {
|
|
@@ -494,7 +800,7 @@ const createProductAttributeDefinition_ConfigPropertyMetadata = [
|
|
|
494
800
|
generateParamConfigMetadata('productAttributeDefinitionListInputPayload', true, 2 /* Body */, 4 /* Unsupported */),
|
|
495
801
|
];
|
|
496
802
|
const createProductAttributeDefinition_ConfigPropertyNames = /*#__PURE__*/ buildAdapterValidationConfig(adapterName$5, createProductAttributeDefinition_ConfigPropertyMetadata);
|
|
497
|
-
const createResourceParams$5 = /*#__PURE__*/ createResourceParams$
|
|
803
|
+
const createResourceParams$5 = /*#__PURE__*/ createResourceParams$8(createProductAttributeDefinition_ConfigPropertyMetadata);
|
|
498
804
|
function typeCheckConfig$5(untrustedConfig) {
|
|
499
805
|
const config = {};
|
|
500
806
|
const untrustedConfig_productAttributeDefinitionListInputPayload = untrustedConfig.productAttributeDefinitionListInputPayload;
|
|
@@ -769,14 +1075,14 @@ const getProductFlowByProductId_ConfigPropertyMetadata = [
|
|
|
769
1075
|
generateParamConfigMetadata('correlationId', false, 1 /* QueryParameter */, 0 /* String */),
|
|
770
1076
|
];
|
|
771
1077
|
const getProductFlowByProductId_ConfigPropertyNames = /*#__PURE__*/ buildAdapterValidationConfig(adapterName$4, getProductFlowByProductId_ConfigPropertyMetadata);
|
|
772
|
-
const createResourceParams$4 = /*#__PURE__*/ createResourceParams$
|
|
1078
|
+
const createResourceParams$4 = /*#__PURE__*/ createResourceParams$8(getProductFlowByProductId_ConfigPropertyMetadata);
|
|
773
1079
|
function keyBuilder$8(luvio, config) {
|
|
774
1080
|
const resourceParams = createResourceParams$4(config);
|
|
775
1081
|
return keyBuilder$9(luvio, resourceParams);
|
|
776
1082
|
}
|
|
777
1083
|
function typeCheckConfig$4(untrustedConfig) {
|
|
778
1084
|
const config = {};
|
|
779
|
-
typeCheckConfig$
|
|
1085
|
+
typeCheckConfig$8(untrustedConfig, config, getProductFlowByProductId_ConfigPropertyMetadata);
|
|
780
1086
|
return config;
|
|
781
1087
|
}
|
|
782
1088
|
function validateAdapterConfig$4(untrustedConfig, configPropertyNames) {
|
|
@@ -825,7 +1131,7 @@ function buildNetworkSnapshot$4(luvio, config, options) {
|
|
|
825
1131
|
});
|
|
826
1132
|
}
|
|
827
1133
|
function buildNetworkSnapshotCachePolicy$4(context, coercedAdapterRequestContext) {
|
|
828
|
-
return buildNetworkSnapshotCachePolicy$
|
|
1134
|
+
return buildNetworkSnapshotCachePolicy$6(context, coercedAdapterRequestContext, buildNetworkSnapshot$4, undefined, false);
|
|
829
1135
|
}
|
|
830
1136
|
function buildCachedSnapshotCachePolicy$4(context, storeLookup) {
|
|
831
1137
|
const { luvio, config } = context;
|
|
@@ -1703,14 +2009,14 @@ const getProductAttributesByProductId_ConfigPropertyMetadata = [
|
|
|
1703
2009
|
generateParamConfigMetadata('isPriceImpacting', false, 1 /* QueryParameter */, 1 /* Boolean */),
|
|
1704
2010
|
];
|
|
1705
2011
|
const getProductAttributesByProductId_ConfigPropertyNames = /*#__PURE__*/ buildAdapterValidationConfig(adapterName$3, getProductAttributesByProductId_ConfigPropertyMetadata);
|
|
1706
|
-
const createResourceParams$3 = /*#__PURE__*/ createResourceParams$
|
|
2012
|
+
const createResourceParams$3 = /*#__PURE__*/ createResourceParams$8(getProductAttributesByProductId_ConfigPropertyMetadata);
|
|
1707
2013
|
function keyBuilder$6(luvio, config) {
|
|
1708
2014
|
const resourceParams = createResourceParams$3(config);
|
|
1709
2015
|
return keyBuilder$7(luvio, resourceParams);
|
|
1710
2016
|
}
|
|
1711
2017
|
function typeCheckConfig$3(untrustedConfig) {
|
|
1712
2018
|
const config = {};
|
|
1713
|
-
typeCheckConfig$
|
|
2019
|
+
typeCheckConfig$8(untrustedConfig, config, getProductAttributesByProductId_ConfigPropertyMetadata);
|
|
1714
2020
|
return config;
|
|
1715
2021
|
}
|
|
1716
2022
|
function validateAdapterConfig$3(untrustedConfig, configPropertyNames) {
|
|
@@ -1759,7 +2065,7 @@ function buildNetworkSnapshot$3(luvio, config, options) {
|
|
|
1759
2065
|
});
|
|
1760
2066
|
}
|
|
1761
2067
|
function buildNetworkSnapshotCachePolicy$3(context, coercedAdapterRequestContext) {
|
|
1762
|
-
return buildNetworkSnapshotCachePolicy$
|
|
2068
|
+
return buildNetworkSnapshotCachePolicy$6(context, coercedAdapterRequestContext, buildNetworkSnapshot$3, undefined, false);
|
|
1763
2069
|
}
|
|
1764
2070
|
function buildCachedSnapshotCachePolicy$3(context, storeLookup) {
|
|
1765
2071
|
const { luvio, config } = context;
|
|
@@ -2026,14 +2332,14 @@ const getProductById_ConfigPropertyMetadata = [
|
|
|
2026
2332
|
generateParamConfigMetadata('correlationId', false, 1 /* QueryParameter */, 0 /* String */),
|
|
2027
2333
|
];
|
|
2028
2334
|
const getProductById_ConfigPropertyNames = /*#__PURE__*/ buildAdapterValidationConfig(adapterName$2, getProductById_ConfigPropertyMetadata);
|
|
2029
|
-
const createResourceParams$2 = /*#__PURE__*/ createResourceParams$
|
|
2335
|
+
const createResourceParams$2 = /*#__PURE__*/ createResourceParams$8(getProductById_ConfigPropertyMetadata);
|
|
2030
2336
|
function keyBuilder$4(luvio, config) {
|
|
2031
2337
|
const resourceParams = createResourceParams$2(config);
|
|
2032
2338
|
return keyBuilder$5(luvio, resourceParams);
|
|
2033
2339
|
}
|
|
2034
2340
|
function typeCheckConfig$2(untrustedConfig) {
|
|
2035
2341
|
const config = {};
|
|
2036
|
-
typeCheckConfig$
|
|
2342
|
+
typeCheckConfig$8(untrustedConfig, config, getProductById_ConfigPropertyMetadata);
|
|
2037
2343
|
return config;
|
|
2038
2344
|
}
|
|
2039
2345
|
function validateAdapterConfig$2(untrustedConfig, configPropertyNames) {
|
|
@@ -2082,7 +2388,7 @@ function buildNetworkSnapshot$2(luvio, config, options) {
|
|
|
2082
2388
|
});
|
|
2083
2389
|
}
|
|
2084
2390
|
function buildNetworkSnapshotCachePolicy$2(context, coercedAdapterRequestContext) {
|
|
2085
|
-
return buildNetworkSnapshotCachePolicy$
|
|
2391
|
+
return buildNetworkSnapshotCachePolicy$6(context, coercedAdapterRequestContext, buildNetworkSnapshot$2, undefined, false);
|
|
2086
2392
|
}
|
|
2087
2393
|
function buildCachedSnapshotCachePolicy$2(context, storeLookup) {
|
|
2088
2394
|
const { luvio, config } = context;
|
|
@@ -2412,14 +2718,14 @@ const getContextDefinitionInfoById_ConfigPropertyMetadata = [
|
|
|
2412
2718
|
generateParamConfigMetadata('correlationId', false, 1 /* QueryParameter */, 0 /* String */),
|
|
2413
2719
|
];
|
|
2414
2720
|
const getContextDefinitionInfoById_ConfigPropertyNames = /*#__PURE__*/ buildAdapterValidationConfig(adapterName$1, getContextDefinitionInfoById_ConfigPropertyMetadata);
|
|
2415
|
-
const createResourceParams$1 = /*#__PURE__*/ createResourceParams$
|
|
2721
|
+
const createResourceParams$1 = /*#__PURE__*/ createResourceParams$8(getContextDefinitionInfoById_ConfigPropertyMetadata);
|
|
2416
2722
|
function keyBuilder$2(luvio, config) {
|
|
2417
2723
|
const resourceParams = createResourceParams$1(config);
|
|
2418
2724
|
return keyBuilder$3(luvio, resourceParams);
|
|
2419
2725
|
}
|
|
2420
2726
|
function typeCheckConfig$1(untrustedConfig) {
|
|
2421
2727
|
const config = {};
|
|
2422
|
-
typeCheckConfig$
|
|
2728
|
+
typeCheckConfig$8(untrustedConfig, config, getContextDefinitionInfoById_ConfigPropertyMetadata);
|
|
2423
2729
|
return config;
|
|
2424
2730
|
}
|
|
2425
2731
|
function validateAdapterConfig$1(untrustedConfig, configPropertyNames) {
|
|
@@ -2468,7 +2774,7 @@ function buildNetworkSnapshot$1(luvio, config, options) {
|
|
|
2468
2774
|
});
|
|
2469
2775
|
}
|
|
2470
2776
|
function buildNetworkSnapshotCachePolicy$1(context, coercedAdapterRequestContext) {
|
|
2471
|
-
return buildNetworkSnapshotCachePolicy$
|
|
2777
|
+
return buildNetworkSnapshotCachePolicy$6(context, coercedAdapterRequestContext, buildNetworkSnapshot$1, undefined, false);
|
|
2472
2778
|
}
|
|
2473
2779
|
function buildCachedSnapshotCachePolicy$1(context, storeLookup) {
|
|
2474
2780
|
const { luvio, config } = context;
|
|
@@ -2700,14 +3006,14 @@ const getConfigRuleMetadata_ConfigPropertyMetadata = [
|
|
|
2700
3006
|
generateParamConfigMetadata('correlationId', false, 1 /* QueryParameter */, 0 /* String */),
|
|
2701
3007
|
];
|
|
2702
3008
|
const getConfigRuleMetadata_ConfigPropertyNames = /*#__PURE__*/ buildAdapterValidationConfig(adapterName, getConfigRuleMetadata_ConfigPropertyMetadata);
|
|
2703
|
-
const createResourceParams = /*#__PURE__*/ createResourceParams$
|
|
3009
|
+
const createResourceParams = /*#__PURE__*/ createResourceParams$8(getConfigRuleMetadata_ConfigPropertyMetadata);
|
|
2704
3010
|
function keyBuilder(luvio, config) {
|
|
2705
3011
|
const resourceParams = createResourceParams(config);
|
|
2706
3012
|
return keyBuilder$1(luvio, resourceParams);
|
|
2707
3013
|
}
|
|
2708
3014
|
function typeCheckConfig(untrustedConfig) {
|
|
2709
3015
|
const config = {};
|
|
2710
|
-
typeCheckConfig$
|
|
3016
|
+
typeCheckConfig$8(untrustedConfig, config, getConfigRuleMetadata_ConfigPropertyMetadata);
|
|
2711
3017
|
return config;
|
|
2712
3018
|
}
|
|
2713
3019
|
function validateAdapterConfig(untrustedConfig, configPropertyNames) {
|
|
@@ -2756,7 +3062,7 @@ function buildNetworkSnapshot(luvio, config, options) {
|
|
|
2756
3062
|
});
|
|
2757
3063
|
}
|
|
2758
3064
|
function buildNetworkSnapshotCachePolicy(context, coercedAdapterRequestContext) {
|
|
2759
|
-
return buildNetworkSnapshotCachePolicy$
|
|
3065
|
+
return buildNetworkSnapshotCachePolicy$6(context, coercedAdapterRequestContext, buildNetworkSnapshot, undefined, false);
|
|
2760
3066
|
}
|
|
2761
3067
|
function buildCachedSnapshotCachePolicy(context, storeLookup) {
|
|
2762
3068
|
const { luvio, config } = context;
|
|
@@ -2781,4 +3087,4 @@ const getConfigRuleMetadataAdapterFactory = (luvio) => function epc__getConfigRu
|
|
|
2781
3087
|
buildCachedSnapshotCachePolicy, buildNetworkSnapshotCachePolicy);
|
|
2782
3088
|
};
|
|
2783
3089
|
|
|
2784
|
-
export { createProductAttributeDefinitionAdapterFactory, deactivateAdapterFactory, getConfigRuleMetadataAdapterFactory, getContextDefinitionInfoByIdAdapterFactory, getProductAttributesByProductIdAdapterFactory, getProductByIdAdapterFactory, getProductFlowByProductIdAdapterFactory };
|
|
3090
|
+
export { createProductAttributeDefinitionAdapterFactory, deactivateAdapterFactory, getConfigRuleMetadataAdapterFactory, getContextDefinitionInfoByIdAdapterFactory, getProductAttributesByProductIdAdapterFactory, getProductByIdAdapterFactory, getProductFlowByProductIdAdapterFactory, getSnapshotsAdapterFactory };
|