@salesforce/lds-adapters-industries-decisiontable 1.293.0 → 1.295.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-decisiontable.js +407 -173
- package/dist/es/es2018/types/src/generated/adapters/postDecisionTableRows.d.ts +19 -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 +2 -1
- package/dist/es/es2018/types/src/generated/resources/postConnectBusinessRulesDecisionTableDataByDecisionTableId.d.ts +18 -0
- package/dist/es/es2018/types/src/generated/types/DecisionTableDataOutputRepresentation.d.ts +47 -0
- package/dist/es/es2018/types/src/generated/types/DecisionTableRowInputRepresentation.d.ts +41 -0
- package/dist/es/es2018/types/src/generated/types/DecisionTableRowsListInputRepresentation.d.ts +35 -0
- package/package.json +3 -3
- package/sfdc/index.js +415 -174
- package/src/raml/api.raml +81 -0
- package/src/raml/luvio.raml +9 -0
|
@@ -4,10 +4,10 @@
|
|
|
4
4
|
* For full license text, see the LICENSE.txt file
|
|
5
5
|
*/
|
|
6
6
|
|
|
7
|
-
import { serializeStructuredKey, ingestShape, deepFreeze, buildNetworkSnapshotCachePolicy as buildNetworkSnapshotCachePolicy$3, typeCheckConfig as typeCheckConfig$
|
|
7
|
+
import { serializeStructuredKey, ingestShape, deepFreeze, buildNetworkSnapshotCachePolicy as buildNetworkSnapshotCachePolicy$3, typeCheckConfig as typeCheckConfig$4, StoreKeyMap, createResourceParams as createResourceParams$4 } from '@luvio/engine';
|
|
8
8
|
|
|
9
9
|
const { hasOwnProperty: ObjectPrototypeHasOwnProperty } = Object.prototype;
|
|
10
|
-
const { keys: ObjectKeys, create: ObjectCreate } = Object;
|
|
10
|
+
const { keys: ObjectKeys$1, create: ObjectCreate$1 } = Object;
|
|
11
11
|
const { isArray: ArrayIsArray$1 } = Array;
|
|
12
12
|
/**
|
|
13
13
|
* Validates an adapter config is well-formed.
|
|
@@ -31,7 +31,7 @@ function validateConfig(config, adapter, oneOf) {
|
|
|
31
31
|
throw new TypeError(`adapter ${displayName} does not yet support ${unsupported.sort().join(', ')}`);
|
|
32
32
|
}
|
|
33
33
|
const supported = required.concat(optional);
|
|
34
|
-
if (ObjectKeys(config).some(key => !supported.includes(key))) {
|
|
34
|
+
if (ObjectKeys$1(config).some(key => !supported.includes(key))) {
|
|
35
35
|
throw new TypeError(`adapter ${displayName} configuration supports only ${supported.sort().join(', ')}`);
|
|
36
36
|
}
|
|
37
37
|
}
|
|
@@ -71,6 +71,7 @@ function buildAdapterValidationConfig(displayName, paramsMeta) {
|
|
|
71
71
|
}
|
|
72
72
|
const keyPrefix = 'DecisionTable';
|
|
73
73
|
|
|
74
|
+
const { keys: ObjectKeys, create: ObjectCreate, assign: ObjectAssign } = Object;
|
|
74
75
|
const { isArray: ArrayIsArray } = Array;
|
|
75
76
|
const { stringify: JSONStringify } = JSON;
|
|
76
77
|
function createLink(ref) {
|
|
@@ -79,7 +80,7 @@ function createLink(ref) {
|
|
|
79
80
|
};
|
|
80
81
|
}
|
|
81
82
|
|
|
82
|
-
function validate$
|
|
83
|
+
function validate$b(obj, path = 'DecisionTableParameterOutputRepresentation') {
|
|
83
84
|
const v_error = (() => {
|
|
84
85
|
if (typeof obj !== 'object' || ArrayIsArray(obj) || obj === null) {
|
|
85
86
|
return new TypeError('Expected "object" but received "' + typeof obj + '" (at "' + path + '")');
|
|
@@ -179,7 +180,7 @@ function validate$9(obj, path = 'DecisionTableParameterOutputRepresentation') {
|
|
|
179
180
|
return v_error === undefined ? null : v_error;
|
|
180
181
|
}
|
|
181
182
|
|
|
182
|
-
function validate$
|
|
183
|
+
function validate$a(obj, path = 'DecisionTableSourceCriteriaOutputRepresentation') {
|
|
183
184
|
const v_error = (() => {
|
|
184
185
|
if (typeof obj !== 'object' || ArrayIsArray(obj) || obj === null) {
|
|
185
186
|
return new TypeError('Expected "object" but received "' + typeof obj + '" (at "' + path + '")');
|
|
@@ -223,7 +224,7 @@ function validate$8(obj, path = 'DecisionTableSourceCriteriaOutputRepresentation
|
|
|
223
224
|
return v_error === undefined ? null : v_error;
|
|
224
225
|
}
|
|
225
226
|
|
|
226
|
-
function validate$
|
|
227
|
+
function validate$9(obj, path = 'DecisionTableDefinitionOutputRepresentation') {
|
|
227
228
|
const v_error = (() => {
|
|
228
229
|
if (typeof obj !== 'object' || ArrayIsArray(obj) || obj === null) {
|
|
229
230
|
return new TypeError('Expected "object" but received "' + typeof obj + '" (at "' + path + '")');
|
|
@@ -285,7 +286,7 @@ function validate$7(obj, path = 'DecisionTableDefinitionOutputRepresentation') {
|
|
|
285
286
|
for (let i = 0; i < obj_parameters.length; i++) {
|
|
286
287
|
const obj_parameters_item = obj_parameters[i];
|
|
287
288
|
const path_parameters_item = path_parameters + '[' + i + ']';
|
|
288
|
-
const referencepath_parameters_itemValidationError = validate$
|
|
289
|
+
const referencepath_parameters_itemValidationError = validate$b(obj_parameters_item, path_parameters_item);
|
|
289
290
|
if (referencepath_parameters_itemValidationError !== null) {
|
|
290
291
|
let message = 'Object doesn\'t match DecisionTableParameterOutputRepresentation (at "' + path_parameters_item + '")\n';
|
|
291
292
|
message += referencepath_parameters_itemValidationError.message.split('\n').map((line) => '\t' + line).join('\n');
|
|
@@ -307,7 +308,7 @@ function validate$7(obj, path = 'DecisionTableDefinitionOutputRepresentation') {
|
|
|
307
308
|
for (let i = 0; i < obj_sourceCriteria.length; i++) {
|
|
308
309
|
const obj_sourceCriteria_item = obj_sourceCriteria[i];
|
|
309
310
|
const path_sourceCriteria_item = path_sourceCriteria + '[' + i + ']';
|
|
310
|
-
const referencepath_sourceCriteria_itemValidationError = validate$
|
|
311
|
+
const referencepath_sourceCriteria_itemValidationError = validate$a(obj_sourceCriteria_item, path_sourceCriteria_item);
|
|
311
312
|
if (referencepath_sourceCriteria_itemValidationError !== null) {
|
|
312
313
|
let message = 'Object doesn\'t match DecisionTableSourceCriteriaOutputRepresentation (at "' + path_sourceCriteria_item + '")\n';
|
|
313
314
|
message += referencepath_sourceCriteria_itemValidationError.message.split('\n').map((line) => '\t' + line).join('\n');
|
|
@@ -353,9 +354,9 @@ function validate$7(obj, path = 'DecisionTableDefinitionOutputRepresentation') {
|
|
|
353
354
|
return v_error === undefined ? null : v_error;
|
|
354
355
|
}
|
|
355
356
|
|
|
356
|
-
const TTL$
|
|
357
|
-
const VERSION$
|
|
358
|
-
function validate$
|
|
357
|
+
const TTL$3 = 1000;
|
|
358
|
+
const VERSION$3 = "21435364536c593ed8b8972af7d154d5";
|
|
359
|
+
function validate$8(obj, path = 'DecisionTableOutputRepresentation') {
|
|
359
360
|
const v_error = (() => {
|
|
360
361
|
if (typeof obj !== 'object' || ArrayIsArray(obj) || obj === null) {
|
|
361
362
|
return new TypeError('Expected "object" but received "' + typeof obj + '" (at "' + path + '")');
|
|
@@ -369,7 +370,7 @@ function validate$6(obj, path = 'DecisionTableOutputRepresentation') {
|
|
|
369
370
|
}
|
|
370
371
|
const obj_decisionTable = obj.decisionTable;
|
|
371
372
|
const path_decisionTable = path + '.decisionTable';
|
|
372
|
-
const referencepath_decisionTableValidationError = validate$
|
|
373
|
+
const referencepath_decisionTableValidationError = validate$9(obj_decisionTable, path_decisionTable);
|
|
373
374
|
if (referencepath_decisionTableValidationError !== null) {
|
|
374
375
|
let message = 'Object doesn\'t match DecisionTableDefinitionOutputRepresentation (at "' + path_decisionTable + '")\n';
|
|
375
376
|
message += referencepath_decisionTableValidationError.message.split('\n').map((line) => '\t' + line).join('\n');
|
|
@@ -392,62 +393,62 @@ function validate$6(obj, path = 'DecisionTableOutputRepresentation') {
|
|
|
392
393
|
})();
|
|
393
394
|
return v_error === undefined ? null : v_error;
|
|
394
395
|
}
|
|
395
|
-
const RepresentationType$
|
|
396
|
-
function normalize$
|
|
396
|
+
const RepresentationType$3 = 'DecisionTableOutputRepresentation';
|
|
397
|
+
function normalize$3(input, existing, path, luvio, store, timestamp) {
|
|
397
398
|
return input;
|
|
398
399
|
}
|
|
399
|
-
const select$
|
|
400
|
+
const select$7 = function DecisionTableOutputRepresentationSelect() {
|
|
400
401
|
return {
|
|
401
402
|
kind: 'Fragment',
|
|
402
|
-
version: VERSION$
|
|
403
|
+
version: VERSION$3,
|
|
403
404
|
private: [],
|
|
404
405
|
opaque: true
|
|
405
406
|
};
|
|
406
407
|
};
|
|
407
|
-
function equals$
|
|
408
|
+
function equals$3(existing, incoming) {
|
|
408
409
|
if (JSONStringify(incoming) !== JSONStringify(existing)) {
|
|
409
410
|
return false;
|
|
410
411
|
}
|
|
411
412
|
return true;
|
|
412
413
|
}
|
|
413
|
-
const ingest$
|
|
414
|
+
const ingest$3 = function DecisionTableOutputRepresentationIngest(input, path, luvio, store, timestamp) {
|
|
414
415
|
if (process.env.NODE_ENV !== 'production') {
|
|
415
|
-
const validateError = validate$
|
|
416
|
+
const validateError = validate$8(input);
|
|
416
417
|
if (validateError !== null) {
|
|
417
418
|
throw validateError;
|
|
418
419
|
}
|
|
419
420
|
}
|
|
420
421
|
const key = path.fullPath;
|
|
421
|
-
const ttlToUse = TTL$
|
|
422
|
-
ingestShape(input, path, luvio, store, timestamp, ttlToUse, key, normalize$
|
|
422
|
+
const ttlToUse = TTL$3;
|
|
423
|
+
ingestShape(input, path, luvio, store, timestamp, ttlToUse, key, normalize$3, "DecisionTable", VERSION$3, RepresentationType$3, equals$3);
|
|
423
424
|
return createLink(key);
|
|
424
425
|
};
|
|
425
|
-
function getTypeCacheKeys$
|
|
426
|
+
function getTypeCacheKeys$3(rootKeySet, luvio, input, fullPathFactory) {
|
|
426
427
|
// root cache key (uses fullPathFactory if keyBuilderFromType isn't defined)
|
|
427
428
|
const rootKey = fullPathFactory();
|
|
428
429
|
rootKeySet.set(rootKey, {
|
|
429
430
|
namespace: keyPrefix,
|
|
430
|
-
representationName: RepresentationType$
|
|
431
|
+
representationName: RepresentationType$3,
|
|
431
432
|
mergeable: false
|
|
432
433
|
});
|
|
433
434
|
}
|
|
434
435
|
|
|
435
|
-
function select$
|
|
436
|
-
return select$
|
|
436
|
+
function select$6(luvio, params) {
|
|
437
|
+
return select$7();
|
|
437
438
|
}
|
|
438
|
-
function keyBuilder$
|
|
439
|
+
function keyBuilder$6(luvio, params) {
|
|
439
440
|
return keyPrefix + '::DecisionTableOutputRepresentation:(' + 'decisionTableId:' + params.urlParams.decisionTableId + ')';
|
|
440
441
|
}
|
|
441
|
-
function getResponseCacheKeys$
|
|
442
|
-
getTypeCacheKeys$
|
|
442
|
+
function getResponseCacheKeys$3(storeKeyMap, luvio, resourceParams, response) {
|
|
443
|
+
getTypeCacheKeys$3(storeKeyMap, luvio, response, () => keyBuilder$6(luvio, resourceParams));
|
|
443
444
|
}
|
|
444
|
-
function ingestSuccess$
|
|
445
|
+
function ingestSuccess$3(luvio, resourceParams, response, snapshotRefresh) {
|
|
445
446
|
const { body } = response;
|
|
446
|
-
const key = keyBuilder$
|
|
447
|
-
luvio.storeIngest(key, ingest$
|
|
447
|
+
const key = keyBuilder$6(luvio, resourceParams);
|
|
448
|
+
luvio.storeIngest(key, ingest$3, body);
|
|
448
449
|
const snapshot = luvio.storeLookup({
|
|
449
450
|
recordId: key,
|
|
450
|
-
node: select$
|
|
451
|
+
node: select$6(),
|
|
451
452
|
variables: {},
|
|
452
453
|
}, snapshotRefresh);
|
|
453
454
|
if (process.env.NODE_ENV !== 'production') {
|
|
@@ -459,18 +460,18 @@ function ingestSuccess$2(luvio, resourceParams, response, snapshotRefresh) {
|
|
|
459
460
|
return snapshot;
|
|
460
461
|
}
|
|
461
462
|
function ingestError$2(luvio, params, error, snapshotRefresh) {
|
|
462
|
-
const key = keyBuilder$
|
|
463
|
+
const key = keyBuilder$6(luvio, params);
|
|
463
464
|
const errorSnapshot = luvio.errorSnapshot(error, snapshotRefresh);
|
|
464
465
|
const storeMetadataParams = {
|
|
465
|
-
ttl: TTL$
|
|
466
|
+
ttl: TTL$3,
|
|
466
467
|
namespace: keyPrefix,
|
|
467
|
-
version: VERSION$
|
|
468
|
-
representationName: RepresentationType$
|
|
468
|
+
version: VERSION$3,
|
|
469
|
+
representationName: RepresentationType$3
|
|
469
470
|
};
|
|
470
471
|
luvio.storeIngestError(key, errorSnapshot, storeMetadataParams);
|
|
471
472
|
return errorSnapshot;
|
|
472
473
|
}
|
|
473
|
-
function createResourceRequest$
|
|
474
|
+
function createResourceRequest$3(config) {
|
|
474
475
|
const headers = {};
|
|
475
476
|
return {
|
|
476
477
|
baseUri: '/services/data/v62.0',
|
|
@@ -484,60 +485,60 @@ function createResourceRequest$2(config) {
|
|
|
484
485
|
};
|
|
485
486
|
}
|
|
486
487
|
|
|
487
|
-
const adapterName$
|
|
488
|
+
const adapterName$3 = 'getDecisionTable';
|
|
488
489
|
const getDecisionTable_ConfigPropertyMetadata = [
|
|
489
490
|
generateParamConfigMetadata('decisionTableId', true, 0 /* UrlParameter */, 0 /* String */),
|
|
490
491
|
];
|
|
491
|
-
const getDecisionTable_ConfigPropertyNames = /*#__PURE__*/ buildAdapterValidationConfig(adapterName$
|
|
492
|
-
const createResourceParams$
|
|
493
|
-
function keyBuilder$
|
|
494
|
-
const resourceParams = createResourceParams$
|
|
495
|
-
return keyBuilder$
|
|
492
|
+
const getDecisionTable_ConfigPropertyNames = /*#__PURE__*/ buildAdapterValidationConfig(adapterName$3, getDecisionTable_ConfigPropertyMetadata);
|
|
493
|
+
const createResourceParams$3 = /*#__PURE__*/ createResourceParams$4(getDecisionTable_ConfigPropertyMetadata);
|
|
494
|
+
function keyBuilder$5(luvio, config) {
|
|
495
|
+
const resourceParams = createResourceParams$3(config);
|
|
496
|
+
return keyBuilder$6(luvio, resourceParams);
|
|
496
497
|
}
|
|
497
|
-
function typeCheckConfig$
|
|
498
|
+
function typeCheckConfig$3(untrustedConfig) {
|
|
498
499
|
const config = {};
|
|
499
|
-
typeCheckConfig$
|
|
500
|
+
typeCheckConfig$4(untrustedConfig, config, getDecisionTable_ConfigPropertyMetadata);
|
|
500
501
|
return config;
|
|
501
502
|
}
|
|
502
|
-
function validateAdapterConfig$
|
|
503
|
+
function validateAdapterConfig$3(untrustedConfig, configPropertyNames) {
|
|
503
504
|
if (!untrustedIsObject(untrustedConfig)) {
|
|
504
505
|
return null;
|
|
505
506
|
}
|
|
506
507
|
if (process.env.NODE_ENV !== 'production') {
|
|
507
508
|
validateConfig(untrustedConfig, configPropertyNames);
|
|
508
509
|
}
|
|
509
|
-
const config = typeCheckConfig$
|
|
510
|
+
const config = typeCheckConfig$3(untrustedConfig);
|
|
510
511
|
if (!areRequiredParametersPresent(config, configPropertyNames)) {
|
|
511
512
|
return null;
|
|
512
513
|
}
|
|
513
514
|
return config;
|
|
514
515
|
}
|
|
515
516
|
function adapterFragment$2(luvio, config) {
|
|
516
|
-
createResourceParams$
|
|
517
|
-
return select$
|
|
517
|
+
createResourceParams$3(config);
|
|
518
|
+
return select$6();
|
|
518
519
|
}
|
|
519
520
|
function onFetchResponseSuccess$2(luvio, config, resourceParams, response) {
|
|
520
|
-
const snapshot = ingestSuccess$
|
|
521
|
+
const snapshot = ingestSuccess$3(luvio, resourceParams, response, {
|
|
521
522
|
config,
|
|
522
|
-
resolve: () => buildNetworkSnapshot$
|
|
523
|
+
resolve: () => buildNetworkSnapshot$3(luvio, config, snapshotRefreshOptions)
|
|
523
524
|
});
|
|
524
525
|
return luvio.storeBroadcast().then(() => snapshot);
|
|
525
526
|
}
|
|
526
527
|
function onFetchResponseError$2(luvio, config, resourceParams, response) {
|
|
527
528
|
const snapshot = ingestError$2(luvio, resourceParams, response, {
|
|
528
529
|
config,
|
|
529
|
-
resolve: () => buildNetworkSnapshot$
|
|
530
|
+
resolve: () => buildNetworkSnapshot$3(luvio, config, snapshotRefreshOptions)
|
|
530
531
|
});
|
|
531
532
|
return luvio.storeBroadcast().then(() => snapshot);
|
|
532
533
|
}
|
|
533
|
-
function buildNetworkSnapshot$
|
|
534
|
-
const resourceParams = createResourceParams$
|
|
535
|
-
const request = createResourceRequest$
|
|
534
|
+
function buildNetworkSnapshot$3(luvio, config, options) {
|
|
535
|
+
const resourceParams = createResourceParams$3(config);
|
|
536
|
+
const request = createResourceRequest$3(resourceParams);
|
|
536
537
|
return luvio.dispatchResourceRequest(request, options)
|
|
537
538
|
.then((response) => {
|
|
538
539
|
return luvio.handleSuccessResponse(() => onFetchResponseSuccess$2(luvio, config, resourceParams, response), () => {
|
|
539
540
|
const cache = new StoreKeyMap();
|
|
540
|
-
getResponseCacheKeys$
|
|
541
|
+
getResponseCacheKeys$3(cache, luvio, resourceParams, response.body);
|
|
541
542
|
return cache;
|
|
542
543
|
});
|
|
543
544
|
}, (response) => {
|
|
@@ -545,23 +546,23 @@ function buildNetworkSnapshot$2(luvio, config, options) {
|
|
|
545
546
|
});
|
|
546
547
|
}
|
|
547
548
|
function buildNetworkSnapshotCachePolicy$2(context, coercedAdapterRequestContext) {
|
|
548
|
-
return buildNetworkSnapshotCachePolicy$3(context, coercedAdapterRequestContext, buildNetworkSnapshot$
|
|
549
|
+
return buildNetworkSnapshotCachePolicy$3(context, coercedAdapterRequestContext, buildNetworkSnapshot$3, undefined, false);
|
|
549
550
|
}
|
|
550
551
|
function buildCachedSnapshotCachePolicy$2(context, storeLookup) {
|
|
551
552
|
const { luvio, config } = context;
|
|
552
553
|
const selector = {
|
|
553
|
-
recordId: keyBuilder$
|
|
554
|
+
recordId: keyBuilder$5(luvio, config),
|
|
554
555
|
node: adapterFragment$2(luvio, config),
|
|
555
556
|
variables: {},
|
|
556
557
|
};
|
|
557
558
|
const cacheSnapshot = storeLookup(selector, {
|
|
558
559
|
config,
|
|
559
|
-
resolve: () => buildNetworkSnapshot$
|
|
560
|
+
resolve: () => buildNetworkSnapshot$3(luvio, config, snapshotRefreshOptions)
|
|
560
561
|
});
|
|
561
562
|
return cacheSnapshot;
|
|
562
563
|
}
|
|
563
564
|
const getDecisionTableAdapterFactory = (luvio) => function DecisionTable__getDecisionTable(untrustedConfig, requestContext) {
|
|
564
|
-
const config = validateAdapterConfig$
|
|
565
|
+
const config = validateAdapterConfig$3(untrustedConfig, getDecisionTable_ConfigPropertyNames);
|
|
565
566
|
// Invalid or incomplete config
|
|
566
567
|
if (config === null) {
|
|
567
568
|
return null;
|
|
@@ -570,7 +571,7 @@ const getDecisionTableAdapterFactory = (luvio) => function DecisionTable__getDec
|
|
|
570
571
|
buildCachedSnapshotCachePolicy$2, buildNetworkSnapshotCachePolicy$2);
|
|
571
572
|
};
|
|
572
573
|
|
|
573
|
-
function validate$
|
|
574
|
+
function validate$7(obj, path = 'DecisionTableTemplateOutputRepresentation') {
|
|
574
575
|
const v_error = (() => {
|
|
575
576
|
if (typeof obj !== 'object' || ArrayIsArray(obj) || obj === null) {
|
|
576
577
|
return new TypeError('Expected "object" but received "' + typeof obj + '" (at "' + path + '")');
|
|
@@ -600,7 +601,7 @@ function validate$5(obj, path = 'DecisionTableTemplateOutputRepresentation') {
|
|
|
600
601
|
return v_error === undefined ? null : v_error;
|
|
601
602
|
}
|
|
602
603
|
|
|
603
|
-
function validate$
|
|
604
|
+
function validate$6(obj, path = 'ErrorParametersOutputRepresentation') {
|
|
604
605
|
const v_error = (() => {
|
|
605
606
|
if (typeof obj !== 'object' || ArrayIsArray(obj) || obj === null) {
|
|
606
607
|
return new TypeError('Expected "object" but received "' + typeof obj + '" (at "' + path + '")');
|
|
@@ -623,7 +624,7 @@ function validate$4(obj, path = 'ErrorParametersOutputRepresentation') {
|
|
|
623
624
|
return v_error === undefined ? null : v_error;
|
|
624
625
|
}
|
|
625
626
|
|
|
626
|
-
function validate$
|
|
627
|
+
function validate$5(obj, path = 'ErrorTargetsOutputRepresentation') {
|
|
627
628
|
const v_error = (() => {
|
|
628
629
|
if (typeof obj !== 'object' || ArrayIsArray(obj) || obj === null) {
|
|
629
630
|
return new TypeError('Expected "object" but received "' + typeof obj + '" (at "' + path + '")');
|
|
@@ -646,7 +647,7 @@ function validate$3(obj, path = 'ErrorTargetsOutputRepresentation') {
|
|
|
646
647
|
return v_error === undefined ? null : v_error;
|
|
647
648
|
}
|
|
648
649
|
|
|
649
|
-
function validate$
|
|
650
|
+
function validate$4(obj, path = 'ErrorOutputRepresentation') {
|
|
650
651
|
const v_error = (() => {
|
|
651
652
|
if (typeof obj !== 'object' || ArrayIsArray(obj) || obj === null) {
|
|
652
653
|
return new TypeError('Expected "object" but received "' + typeof obj + '" (at "' + path + '")');
|
|
@@ -681,7 +682,7 @@ function validate$2(obj, path = 'ErrorOutputRepresentation') {
|
|
|
681
682
|
for (let i = 0; i < obj_parameters.length; i++) {
|
|
682
683
|
const obj_parameters_item = obj_parameters[i];
|
|
683
684
|
const path_parameters_item = path_parameters + '[' + i + ']';
|
|
684
|
-
const referencepath_parameters_itemValidationError = validate$
|
|
685
|
+
const referencepath_parameters_itemValidationError = validate$6(obj_parameters_item, path_parameters_item);
|
|
685
686
|
if (referencepath_parameters_itemValidationError !== null) {
|
|
686
687
|
let message = 'Object doesn\'t match ErrorParametersOutputRepresentation (at "' + path_parameters_item + '")\n';
|
|
687
688
|
message += referencepath_parameters_itemValidationError.message.split('\n').map((line) => '\t' + line).join('\n');
|
|
@@ -698,7 +699,7 @@ function validate$2(obj, path = 'ErrorOutputRepresentation') {
|
|
|
698
699
|
for (let i = 0; i < obj_targets.length; i++) {
|
|
699
700
|
const obj_targets_item = obj_targets[i];
|
|
700
701
|
const path_targets_item = path_targets + '[' + i + ']';
|
|
701
|
-
const referencepath_targets_itemValidationError = validate$
|
|
702
|
+
const referencepath_targets_itemValidationError = validate$5(obj_targets_item, path_targets_item);
|
|
702
703
|
if (referencepath_targets_itemValidationError !== null) {
|
|
703
704
|
let message = 'Object doesn\'t match ErrorTargetsOutputRepresentation (at "' + path_targets_item + '")\n';
|
|
704
705
|
message += referencepath_targets_itemValidationError.message.split('\n').map((line) => '\t' + line).join('\n');
|
|
@@ -710,9 +711,9 @@ function validate$2(obj, path = 'ErrorOutputRepresentation') {
|
|
|
710
711
|
return v_error === undefined ? null : v_error;
|
|
711
712
|
}
|
|
712
713
|
|
|
713
|
-
const TTL$
|
|
714
|
-
const VERSION$
|
|
715
|
-
function validate$
|
|
714
|
+
const TTL$2 = 1000;
|
|
715
|
+
const VERSION$2 = "a2891bd122ab9f728d5937bf70b9f600";
|
|
716
|
+
function validate$3(obj, path = 'DecisionTableTemplatesListOutputRepresentation') {
|
|
716
717
|
const v_error = (() => {
|
|
717
718
|
if (typeof obj !== 'object' || ArrayIsArray(obj) || obj === null) {
|
|
718
719
|
return new TypeError('Expected "object" but received "' + typeof obj + '" (at "' + path + '")');
|
|
@@ -726,7 +727,7 @@ function validate$1(obj, path = 'DecisionTableTemplatesListOutputRepresentation'
|
|
|
726
727
|
for (let i = 0; i < obj_decisionTableTemplates.length; i++) {
|
|
727
728
|
const obj_decisionTableTemplates_item = obj_decisionTableTemplates[i];
|
|
728
729
|
const path_decisionTableTemplates_item = path_decisionTableTemplates + '[' + i + ']';
|
|
729
|
-
const referencepath_decisionTableTemplates_itemValidationError = validate$
|
|
730
|
+
const referencepath_decisionTableTemplates_itemValidationError = validate$7(obj_decisionTableTemplates_item, path_decisionTableTemplates_item);
|
|
730
731
|
if (referencepath_decisionTableTemplates_itemValidationError !== null) {
|
|
731
732
|
let message = 'Object doesn\'t match DecisionTableTemplateOutputRepresentation (at "' + path_decisionTableTemplates_item + '")\n';
|
|
732
733
|
message += referencepath_decisionTableTemplates_itemValidationError.message.split('\n').map((line) => '\t' + line).join('\n');
|
|
@@ -743,7 +744,7 @@ function validate$1(obj, path = 'DecisionTableTemplatesListOutputRepresentation'
|
|
|
743
744
|
for (let i = 0; i < obj_errors.length; i++) {
|
|
744
745
|
const obj_errors_item = obj_errors[i];
|
|
745
746
|
const path_errors_item = path_errors + '[' + i + ']';
|
|
746
|
-
const referencepath_errors_itemValidationError = validate$
|
|
747
|
+
const referencepath_errors_itemValidationError = validate$4(obj_errors_item, path_errors_item);
|
|
747
748
|
if (referencepath_errors_itemValidationError !== null) {
|
|
748
749
|
let message = 'Object doesn\'t match ErrorOutputRepresentation (at "' + path_errors_item + '")\n';
|
|
749
750
|
message += referencepath_errors_itemValidationError.message.split('\n').map((line) => '\t' + line).join('\n');
|
|
@@ -754,62 +755,62 @@ function validate$1(obj, path = 'DecisionTableTemplatesListOutputRepresentation'
|
|
|
754
755
|
})();
|
|
755
756
|
return v_error === undefined ? null : v_error;
|
|
756
757
|
}
|
|
757
|
-
const RepresentationType$
|
|
758
|
-
function normalize$
|
|
758
|
+
const RepresentationType$2 = 'DecisionTableTemplatesListOutputRepresentation';
|
|
759
|
+
function normalize$2(input, existing, path, luvio, store, timestamp) {
|
|
759
760
|
return input;
|
|
760
761
|
}
|
|
761
|
-
const select$
|
|
762
|
+
const select$5 = function DecisionTableTemplatesListOutputRepresentationSelect() {
|
|
762
763
|
return {
|
|
763
764
|
kind: 'Fragment',
|
|
764
|
-
version: VERSION$
|
|
765
|
+
version: VERSION$2,
|
|
765
766
|
private: [],
|
|
766
767
|
opaque: true
|
|
767
768
|
};
|
|
768
769
|
};
|
|
769
|
-
function equals$
|
|
770
|
+
function equals$2(existing, incoming) {
|
|
770
771
|
if (JSONStringify(incoming) !== JSONStringify(existing)) {
|
|
771
772
|
return false;
|
|
772
773
|
}
|
|
773
774
|
return true;
|
|
774
775
|
}
|
|
775
|
-
const ingest$
|
|
776
|
+
const ingest$2 = function DecisionTableTemplatesListOutputRepresentationIngest(input, path, luvio, store, timestamp) {
|
|
776
777
|
if (process.env.NODE_ENV !== 'production') {
|
|
777
|
-
const validateError = validate$
|
|
778
|
+
const validateError = validate$3(input);
|
|
778
779
|
if (validateError !== null) {
|
|
779
780
|
throw validateError;
|
|
780
781
|
}
|
|
781
782
|
}
|
|
782
783
|
const key = path.fullPath;
|
|
783
|
-
const ttlToUse = TTL$
|
|
784
|
-
ingestShape(input, path, luvio, store, timestamp, ttlToUse, key, normalize$
|
|
784
|
+
const ttlToUse = TTL$2;
|
|
785
|
+
ingestShape(input, path, luvio, store, timestamp, ttlToUse, key, normalize$2, "DecisionTable", VERSION$2, RepresentationType$2, equals$2);
|
|
785
786
|
return createLink(key);
|
|
786
787
|
};
|
|
787
|
-
function getTypeCacheKeys$
|
|
788
|
+
function getTypeCacheKeys$2(rootKeySet, luvio, input, fullPathFactory) {
|
|
788
789
|
// root cache key (uses fullPathFactory if keyBuilderFromType isn't defined)
|
|
789
790
|
const rootKey = fullPathFactory();
|
|
790
791
|
rootKeySet.set(rootKey, {
|
|
791
792
|
namespace: keyPrefix,
|
|
792
|
-
representationName: RepresentationType$
|
|
793
|
+
representationName: RepresentationType$2,
|
|
793
794
|
mergeable: false
|
|
794
795
|
});
|
|
795
796
|
}
|
|
796
797
|
|
|
797
|
-
function select$
|
|
798
|
-
return select$
|
|
798
|
+
function select$4(luvio, params) {
|
|
799
|
+
return select$5();
|
|
799
800
|
}
|
|
800
|
-
function keyBuilder$
|
|
801
|
+
function keyBuilder$4(luvio, params) {
|
|
801
802
|
return keyPrefix + '::DecisionTableTemplatesListOutputRepresentation:(' + 'usageType:' + params.queryParams.usageType + ')';
|
|
802
803
|
}
|
|
803
|
-
function getResponseCacheKeys$
|
|
804
|
-
getTypeCacheKeys$
|
|
804
|
+
function getResponseCacheKeys$2(storeKeyMap, luvio, resourceParams, response) {
|
|
805
|
+
getTypeCacheKeys$2(storeKeyMap, luvio, response, () => keyBuilder$4(luvio, resourceParams));
|
|
805
806
|
}
|
|
806
|
-
function ingestSuccess$
|
|
807
|
+
function ingestSuccess$2(luvio, resourceParams, response, snapshotRefresh) {
|
|
807
808
|
const { body } = response;
|
|
808
|
-
const key = keyBuilder$
|
|
809
|
-
luvio.storeIngest(key, ingest$
|
|
809
|
+
const key = keyBuilder$4(luvio, resourceParams);
|
|
810
|
+
luvio.storeIngest(key, ingest$2, body);
|
|
810
811
|
const snapshot = luvio.storeLookup({
|
|
811
812
|
recordId: key,
|
|
812
|
-
node: select$
|
|
813
|
+
node: select$4(),
|
|
813
814
|
variables: {},
|
|
814
815
|
}, snapshotRefresh);
|
|
815
816
|
if (process.env.NODE_ENV !== 'production') {
|
|
@@ -821,18 +822,18 @@ function ingestSuccess$1(luvio, resourceParams, response, snapshotRefresh) {
|
|
|
821
822
|
return snapshot;
|
|
822
823
|
}
|
|
823
824
|
function ingestError$1(luvio, params, error, snapshotRefresh) {
|
|
824
|
-
const key = keyBuilder$
|
|
825
|
+
const key = keyBuilder$4(luvio, params);
|
|
825
826
|
const errorSnapshot = luvio.errorSnapshot(error, snapshotRefresh);
|
|
826
827
|
const storeMetadataParams = {
|
|
827
|
-
ttl: TTL$
|
|
828
|
+
ttl: TTL$2,
|
|
828
829
|
namespace: keyPrefix,
|
|
829
|
-
version: VERSION$
|
|
830
|
-
representationName: RepresentationType$
|
|
830
|
+
version: VERSION$2,
|
|
831
|
+
representationName: RepresentationType$2
|
|
831
832
|
};
|
|
832
833
|
luvio.storeIngestError(key, errorSnapshot, storeMetadataParams);
|
|
833
834
|
return errorSnapshot;
|
|
834
835
|
}
|
|
835
|
-
function createResourceRequest$
|
|
836
|
+
function createResourceRequest$2(config) {
|
|
836
837
|
const headers = {};
|
|
837
838
|
return {
|
|
838
839
|
baseUri: '/services/data/v62.0',
|
|
@@ -846,60 +847,60 @@ function createResourceRequest$1(config) {
|
|
|
846
847
|
};
|
|
847
848
|
}
|
|
848
849
|
|
|
849
|
-
const adapterName$
|
|
850
|
+
const adapterName$2 = 'getDecisionTableTemplateList';
|
|
850
851
|
const getDecisionTableTemplateList_ConfigPropertyMetadata = [
|
|
851
852
|
generateParamConfigMetadata('usageType', false, 1 /* QueryParameter */, 0 /* String */),
|
|
852
853
|
];
|
|
853
|
-
const getDecisionTableTemplateList_ConfigPropertyNames = /*#__PURE__*/ buildAdapterValidationConfig(adapterName$
|
|
854
|
-
const createResourceParams$
|
|
855
|
-
function keyBuilder$
|
|
856
|
-
const resourceParams = createResourceParams$
|
|
857
|
-
return keyBuilder$
|
|
854
|
+
const getDecisionTableTemplateList_ConfigPropertyNames = /*#__PURE__*/ buildAdapterValidationConfig(adapterName$2, getDecisionTableTemplateList_ConfigPropertyMetadata);
|
|
855
|
+
const createResourceParams$2 = /*#__PURE__*/ createResourceParams$4(getDecisionTableTemplateList_ConfigPropertyMetadata);
|
|
856
|
+
function keyBuilder$3(luvio, config) {
|
|
857
|
+
const resourceParams = createResourceParams$2(config);
|
|
858
|
+
return keyBuilder$4(luvio, resourceParams);
|
|
858
859
|
}
|
|
859
|
-
function typeCheckConfig$
|
|
860
|
+
function typeCheckConfig$2(untrustedConfig) {
|
|
860
861
|
const config = {};
|
|
861
|
-
typeCheckConfig$
|
|
862
|
+
typeCheckConfig$4(untrustedConfig, config, getDecisionTableTemplateList_ConfigPropertyMetadata);
|
|
862
863
|
return config;
|
|
863
864
|
}
|
|
864
|
-
function validateAdapterConfig$
|
|
865
|
+
function validateAdapterConfig$2(untrustedConfig, configPropertyNames) {
|
|
865
866
|
if (!untrustedIsObject(untrustedConfig)) {
|
|
866
867
|
return null;
|
|
867
868
|
}
|
|
868
869
|
if (process.env.NODE_ENV !== 'production') {
|
|
869
870
|
validateConfig(untrustedConfig, configPropertyNames);
|
|
870
871
|
}
|
|
871
|
-
const config = typeCheckConfig$
|
|
872
|
+
const config = typeCheckConfig$2(untrustedConfig);
|
|
872
873
|
if (!areRequiredParametersPresent(config, configPropertyNames)) {
|
|
873
874
|
return null;
|
|
874
875
|
}
|
|
875
876
|
return config;
|
|
876
877
|
}
|
|
877
878
|
function adapterFragment$1(luvio, config) {
|
|
878
|
-
createResourceParams$
|
|
879
|
-
return select$
|
|
879
|
+
createResourceParams$2(config);
|
|
880
|
+
return select$4();
|
|
880
881
|
}
|
|
881
882
|
function onFetchResponseSuccess$1(luvio, config, resourceParams, response) {
|
|
882
|
-
const snapshot = ingestSuccess$
|
|
883
|
+
const snapshot = ingestSuccess$2(luvio, resourceParams, response, {
|
|
883
884
|
config,
|
|
884
|
-
resolve: () => buildNetworkSnapshot$
|
|
885
|
+
resolve: () => buildNetworkSnapshot$2(luvio, config, snapshotRefreshOptions)
|
|
885
886
|
});
|
|
886
887
|
return luvio.storeBroadcast().then(() => snapshot);
|
|
887
888
|
}
|
|
888
889
|
function onFetchResponseError$1(luvio, config, resourceParams, response) {
|
|
889
890
|
const snapshot = ingestError$1(luvio, resourceParams, response, {
|
|
890
891
|
config,
|
|
891
|
-
resolve: () => buildNetworkSnapshot$
|
|
892
|
+
resolve: () => buildNetworkSnapshot$2(luvio, config, snapshotRefreshOptions)
|
|
892
893
|
});
|
|
893
894
|
return luvio.storeBroadcast().then(() => snapshot);
|
|
894
895
|
}
|
|
895
|
-
function buildNetworkSnapshot$
|
|
896
|
-
const resourceParams = createResourceParams$
|
|
897
|
-
const request = createResourceRequest$
|
|
896
|
+
function buildNetworkSnapshot$2(luvio, config, options) {
|
|
897
|
+
const resourceParams = createResourceParams$2(config);
|
|
898
|
+
const request = createResourceRequest$2(resourceParams);
|
|
898
899
|
return luvio.dispatchResourceRequest(request, options)
|
|
899
900
|
.then((response) => {
|
|
900
901
|
return luvio.handleSuccessResponse(() => onFetchResponseSuccess$1(luvio, config, resourceParams, response), () => {
|
|
901
902
|
const cache = new StoreKeyMap();
|
|
902
|
-
getResponseCacheKeys$
|
|
903
|
+
getResponseCacheKeys$2(cache, luvio, resourceParams, response.body);
|
|
903
904
|
return cache;
|
|
904
905
|
});
|
|
905
906
|
}, (response) => {
|
|
@@ -907,23 +908,23 @@ function buildNetworkSnapshot$1(luvio, config, options) {
|
|
|
907
908
|
});
|
|
908
909
|
}
|
|
909
910
|
function buildNetworkSnapshotCachePolicy$1(context, coercedAdapterRequestContext) {
|
|
910
|
-
return buildNetworkSnapshotCachePolicy$3(context, coercedAdapterRequestContext, buildNetworkSnapshot$
|
|
911
|
+
return buildNetworkSnapshotCachePolicy$3(context, coercedAdapterRequestContext, buildNetworkSnapshot$2, undefined, false);
|
|
911
912
|
}
|
|
912
913
|
function buildCachedSnapshotCachePolicy$1(context, storeLookup) {
|
|
913
914
|
const { luvio, config } = context;
|
|
914
915
|
const selector = {
|
|
915
|
-
recordId: keyBuilder$
|
|
916
|
+
recordId: keyBuilder$3(luvio, config),
|
|
916
917
|
node: adapterFragment$1(luvio, config),
|
|
917
918
|
variables: {},
|
|
918
919
|
};
|
|
919
920
|
const cacheSnapshot = storeLookup(selector, {
|
|
920
921
|
config,
|
|
921
|
-
resolve: () => buildNetworkSnapshot$
|
|
922
|
+
resolve: () => buildNetworkSnapshot$2(luvio, config, snapshotRefreshOptions)
|
|
922
923
|
});
|
|
923
924
|
return cacheSnapshot;
|
|
924
925
|
}
|
|
925
926
|
const getDecisionTableTemplateListAdapterFactory = (luvio) => function DecisionTable__getDecisionTableTemplateList(untrustedConfig, requestContext) {
|
|
926
|
-
const config = validateAdapterConfig$
|
|
927
|
+
const config = validateAdapterConfig$2(untrustedConfig, getDecisionTableTemplateList_ConfigPropertyNames);
|
|
927
928
|
// Invalid or incomplete config
|
|
928
929
|
if (config === null) {
|
|
929
930
|
return null;
|
|
@@ -932,9 +933,9 @@ const getDecisionTableTemplateListAdapterFactory = (luvio) => function DecisionT
|
|
|
932
933
|
buildCachedSnapshotCachePolicy$1, buildNetworkSnapshotCachePolicy$1);
|
|
933
934
|
};
|
|
934
935
|
|
|
935
|
-
const TTL = 1000;
|
|
936
|
-
const VERSION = "9a106f486843ccdb3e85594fb33ef97f";
|
|
937
|
-
function validate(obj, path = 'DecisionTableTemplateDefinitionOutputRepresentation') {
|
|
936
|
+
const TTL$1 = 1000;
|
|
937
|
+
const VERSION$1 = "9a106f486843ccdb3e85594fb33ef97f";
|
|
938
|
+
function validate$2(obj, path = 'DecisionTableTemplateDefinitionOutputRepresentation') {
|
|
938
939
|
const v_error = (() => {
|
|
939
940
|
if (typeof obj !== 'object' || ArrayIsArray(obj) || obj === null) {
|
|
940
941
|
return new TypeError('Expected "object" but received "' + typeof obj + '" (at "' + path + '")');
|
|
@@ -942,7 +943,7 @@ function validate(obj, path = 'DecisionTableTemplateDefinitionOutputRepresentati
|
|
|
942
943
|
if (obj.decisionTableTemplate !== undefined) {
|
|
943
944
|
const obj_decisionTableTemplate = obj.decisionTableTemplate;
|
|
944
945
|
const path_decisionTableTemplate = path + '.decisionTableTemplate';
|
|
945
|
-
const referencepath_decisionTableTemplateValidationError = validate$
|
|
946
|
+
const referencepath_decisionTableTemplateValidationError = validate$9(obj_decisionTableTemplate, path_decisionTableTemplate);
|
|
946
947
|
if (referencepath_decisionTableTemplateValidationError !== null) {
|
|
947
948
|
let message = 'Object doesn\'t match DecisionTableDefinitionOutputRepresentation (at "' + path_decisionTableTemplate + '")\n';
|
|
948
949
|
message += referencepath_decisionTableTemplateValidationError.message.split('\n').map((line) => '\t' + line).join('\n');
|
|
@@ -958,7 +959,7 @@ function validate(obj, path = 'DecisionTableTemplateDefinitionOutputRepresentati
|
|
|
958
959
|
for (let i = 0; i < obj_errors.length; i++) {
|
|
959
960
|
const obj_errors_item = obj_errors[i];
|
|
960
961
|
const path_errors_item = path_errors + '[' + i + ']';
|
|
961
|
-
const referencepath_errors_itemValidationError = validate$
|
|
962
|
+
const referencepath_errors_itemValidationError = validate$4(obj_errors_item, path_errors_item);
|
|
962
963
|
if (referencepath_errors_itemValidationError !== null) {
|
|
963
964
|
let message = 'Object doesn\'t match ErrorOutputRepresentation (at "' + path_errors_item + '")\n';
|
|
964
965
|
message += referencepath_errors_itemValidationError.message.split('\n').map((line) => '\t' + line).join('\n');
|
|
@@ -969,62 +970,62 @@ function validate(obj, path = 'DecisionTableTemplateDefinitionOutputRepresentati
|
|
|
969
970
|
})();
|
|
970
971
|
return v_error === undefined ? null : v_error;
|
|
971
972
|
}
|
|
972
|
-
const RepresentationType = 'DecisionTableTemplateDefinitionOutputRepresentation';
|
|
973
|
-
function normalize(input, existing, path, luvio, store, timestamp) {
|
|
973
|
+
const RepresentationType$1 = 'DecisionTableTemplateDefinitionOutputRepresentation';
|
|
974
|
+
function normalize$1(input, existing, path, luvio, store, timestamp) {
|
|
974
975
|
return input;
|
|
975
976
|
}
|
|
976
|
-
const select$
|
|
977
|
+
const select$3 = function DecisionTableTemplateDefinitionOutputRepresentationSelect() {
|
|
977
978
|
return {
|
|
978
979
|
kind: 'Fragment',
|
|
979
|
-
version: VERSION,
|
|
980
|
+
version: VERSION$1,
|
|
980
981
|
private: [],
|
|
981
982
|
opaque: true
|
|
982
983
|
};
|
|
983
984
|
};
|
|
984
|
-
function equals(existing, incoming) {
|
|
985
|
+
function equals$1(existing, incoming) {
|
|
985
986
|
if (JSONStringify(incoming) !== JSONStringify(existing)) {
|
|
986
987
|
return false;
|
|
987
988
|
}
|
|
988
989
|
return true;
|
|
989
990
|
}
|
|
990
|
-
const ingest = function DecisionTableTemplateDefinitionOutputRepresentationIngest(input, path, luvio, store, timestamp) {
|
|
991
|
+
const ingest$1 = function DecisionTableTemplateDefinitionOutputRepresentationIngest(input, path, luvio, store, timestamp) {
|
|
991
992
|
if (process.env.NODE_ENV !== 'production') {
|
|
992
|
-
const validateError = validate(input);
|
|
993
|
+
const validateError = validate$2(input);
|
|
993
994
|
if (validateError !== null) {
|
|
994
995
|
throw validateError;
|
|
995
996
|
}
|
|
996
997
|
}
|
|
997
998
|
const key = path.fullPath;
|
|
998
|
-
const ttlToUse = TTL;
|
|
999
|
-
ingestShape(input, path, luvio, store, timestamp, ttlToUse, key, normalize, "DecisionTable", VERSION, RepresentationType, equals);
|
|
999
|
+
const ttlToUse = TTL$1;
|
|
1000
|
+
ingestShape(input, path, luvio, store, timestamp, ttlToUse, key, normalize$1, "DecisionTable", VERSION$1, RepresentationType$1, equals$1);
|
|
1000
1001
|
return createLink(key);
|
|
1001
1002
|
};
|
|
1002
|
-
function getTypeCacheKeys(rootKeySet, luvio, input, fullPathFactory) {
|
|
1003
|
+
function getTypeCacheKeys$1(rootKeySet, luvio, input, fullPathFactory) {
|
|
1003
1004
|
// root cache key (uses fullPathFactory if keyBuilderFromType isn't defined)
|
|
1004
1005
|
const rootKey = fullPathFactory();
|
|
1005
1006
|
rootKeySet.set(rootKey, {
|
|
1006
1007
|
namespace: keyPrefix,
|
|
1007
|
-
representationName: RepresentationType,
|
|
1008
|
+
representationName: RepresentationType$1,
|
|
1008
1009
|
mergeable: false
|
|
1009
1010
|
});
|
|
1010
1011
|
}
|
|
1011
1012
|
|
|
1012
|
-
function select(luvio, params) {
|
|
1013
|
-
return select$
|
|
1013
|
+
function select$2(luvio, params) {
|
|
1014
|
+
return select$3();
|
|
1014
1015
|
}
|
|
1015
|
-
function keyBuilder$
|
|
1016
|
+
function keyBuilder$2(luvio, params) {
|
|
1016
1017
|
return keyPrefix + '::DecisionTableTemplateDefinitionOutputRepresentation:(' + 'templateName:' + params.urlParams.templateName + ')';
|
|
1017
1018
|
}
|
|
1018
|
-
function getResponseCacheKeys(storeKeyMap, luvio, resourceParams, response) {
|
|
1019
|
-
getTypeCacheKeys(storeKeyMap, luvio, response, () => keyBuilder$
|
|
1019
|
+
function getResponseCacheKeys$1(storeKeyMap, luvio, resourceParams, response) {
|
|
1020
|
+
getTypeCacheKeys$1(storeKeyMap, luvio, response, () => keyBuilder$2(luvio, resourceParams));
|
|
1020
1021
|
}
|
|
1021
|
-
function ingestSuccess(luvio, resourceParams, response, snapshotRefresh) {
|
|
1022
|
+
function ingestSuccess$1(luvio, resourceParams, response, snapshotRefresh) {
|
|
1022
1023
|
const { body } = response;
|
|
1023
|
-
const key = keyBuilder$
|
|
1024
|
-
luvio.storeIngest(key, ingest, body);
|
|
1024
|
+
const key = keyBuilder$2(luvio, resourceParams);
|
|
1025
|
+
luvio.storeIngest(key, ingest$1, body);
|
|
1025
1026
|
const snapshot = luvio.storeLookup({
|
|
1026
1027
|
recordId: key,
|
|
1027
|
-
node: select(),
|
|
1028
|
+
node: select$2(),
|
|
1028
1029
|
variables: {},
|
|
1029
1030
|
}, snapshotRefresh);
|
|
1030
1031
|
if (process.env.NODE_ENV !== 'production') {
|
|
@@ -1036,18 +1037,18 @@ function ingestSuccess(luvio, resourceParams, response, snapshotRefresh) {
|
|
|
1036
1037
|
return snapshot;
|
|
1037
1038
|
}
|
|
1038
1039
|
function ingestError(luvio, params, error, snapshotRefresh) {
|
|
1039
|
-
const key = keyBuilder$
|
|
1040
|
+
const key = keyBuilder$2(luvio, params);
|
|
1040
1041
|
const errorSnapshot = luvio.errorSnapshot(error, snapshotRefresh);
|
|
1041
1042
|
const storeMetadataParams = {
|
|
1042
|
-
ttl: TTL,
|
|
1043
|
+
ttl: TTL$1,
|
|
1043
1044
|
namespace: keyPrefix,
|
|
1044
|
-
version: VERSION,
|
|
1045
|
-
representationName: RepresentationType
|
|
1045
|
+
version: VERSION$1,
|
|
1046
|
+
representationName: RepresentationType$1
|
|
1046
1047
|
};
|
|
1047
1048
|
luvio.storeIngestError(key, errorSnapshot, storeMetadataParams);
|
|
1048
1049
|
return errorSnapshot;
|
|
1049
1050
|
}
|
|
1050
|
-
function createResourceRequest(config) {
|
|
1051
|
+
function createResourceRequest$1(config) {
|
|
1051
1052
|
const headers = {};
|
|
1052
1053
|
return {
|
|
1053
1054
|
baseUri: '/services/data/v62.0',
|
|
@@ -1061,60 +1062,60 @@ function createResourceRequest(config) {
|
|
|
1061
1062
|
};
|
|
1062
1063
|
}
|
|
1063
1064
|
|
|
1064
|
-
const adapterName = 'getDecisionTableTemplate';
|
|
1065
|
+
const adapterName$1 = 'getDecisionTableTemplate';
|
|
1065
1066
|
const getDecisionTableTemplate_ConfigPropertyMetadata = [
|
|
1066
1067
|
generateParamConfigMetadata('templateName', true, 0 /* UrlParameter */, 0 /* String */),
|
|
1067
1068
|
];
|
|
1068
|
-
const getDecisionTableTemplate_ConfigPropertyNames = /*#__PURE__*/ buildAdapterValidationConfig(adapterName, getDecisionTableTemplate_ConfigPropertyMetadata);
|
|
1069
|
-
const createResourceParams = /*#__PURE__*/ createResourceParams$
|
|
1070
|
-
function keyBuilder(luvio, config) {
|
|
1071
|
-
const resourceParams = createResourceParams(config);
|
|
1072
|
-
return keyBuilder$
|
|
1069
|
+
const getDecisionTableTemplate_ConfigPropertyNames = /*#__PURE__*/ buildAdapterValidationConfig(adapterName$1, getDecisionTableTemplate_ConfigPropertyMetadata);
|
|
1070
|
+
const createResourceParams$1 = /*#__PURE__*/ createResourceParams$4(getDecisionTableTemplate_ConfigPropertyMetadata);
|
|
1071
|
+
function keyBuilder$1(luvio, config) {
|
|
1072
|
+
const resourceParams = createResourceParams$1(config);
|
|
1073
|
+
return keyBuilder$2(luvio, resourceParams);
|
|
1073
1074
|
}
|
|
1074
|
-
function typeCheckConfig(untrustedConfig) {
|
|
1075
|
+
function typeCheckConfig$1(untrustedConfig) {
|
|
1075
1076
|
const config = {};
|
|
1076
|
-
typeCheckConfig$
|
|
1077
|
+
typeCheckConfig$4(untrustedConfig, config, getDecisionTableTemplate_ConfigPropertyMetadata);
|
|
1077
1078
|
return config;
|
|
1078
1079
|
}
|
|
1079
|
-
function validateAdapterConfig(untrustedConfig, configPropertyNames) {
|
|
1080
|
+
function validateAdapterConfig$1(untrustedConfig, configPropertyNames) {
|
|
1080
1081
|
if (!untrustedIsObject(untrustedConfig)) {
|
|
1081
1082
|
return null;
|
|
1082
1083
|
}
|
|
1083
1084
|
if (process.env.NODE_ENV !== 'production') {
|
|
1084
1085
|
validateConfig(untrustedConfig, configPropertyNames);
|
|
1085
1086
|
}
|
|
1086
|
-
const config = typeCheckConfig(untrustedConfig);
|
|
1087
|
+
const config = typeCheckConfig$1(untrustedConfig);
|
|
1087
1088
|
if (!areRequiredParametersPresent(config, configPropertyNames)) {
|
|
1088
1089
|
return null;
|
|
1089
1090
|
}
|
|
1090
1091
|
return config;
|
|
1091
1092
|
}
|
|
1092
1093
|
function adapterFragment(luvio, config) {
|
|
1093
|
-
createResourceParams(config);
|
|
1094
|
-
return select();
|
|
1094
|
+
createResourceParams$1(config);
|
|
1095
|
+
return select$2();
|
|
1095
1096
|
}
|
|
1096
1097
|
function onFetchResponseSuccess(luvio, config, resourceParams, response) {
|
|
1097
|
-
const snapshot = ingestSuccess(luvio, resourceParams, response, {
|
|
1098
|
+
const snapshot = ingestSuccess$1(luvio, resourceParams, response, {
|
|
1098
1099
|
config,
|
|
1099
|
-
resolve: () => buildNetworkSnapshot(luvio, config, snapshotRefreshOptions)
|
|
1100
|
+
resolve: () => buildNetworkSnapshot$1(luvio, config, snapshotRefreshOptions)
|
|
1100
1101
|
});
|
|
1101
1102
|
return luvio.storeBroadcast().then(() => snapshot);
|
|
1102
1103
|
}
|
|
1103
1104
|
function onFetchResponseError(luvio, config, resourceParams, response) {
|
|
1104
1105
|
const snapshot = ingestError(luvio, resourceParams, response, {
|
|
1105
1106
|
config,
|
|
1106
|
-
resolve: () => buildNetworkSnapshot(luvio, config, snapshotRefreshOptions)
|
|
1107
|
+
resolve: () => buildNetworkSnapshot$1(luvio, config, snapshotRefreshOptions)
|
|
1107
1108
|
});
|
|
1108
1109
|
return luvio.storeBroadcast().then(() => snapshot);
|
|
1109
1110
|
}
|
|
1110
|
-
function buildNetworkSnapshot(luvio, config, options) {
|
|
1111
|
-
const resourceParams = createResourceParams(config);
|
|
1112
|
-
const request = createResourceRequest(resourceParams);
|
|
1111
|
+
function buildNetworkSnapshot$1(luvio, config, options) {
|
|
1112
|
+
const resourceParams = createResourceParams$1(config);
|
|
1113
|
+
const request = createResourceRequest$1(resourceParams);
|
|
1113
1114
|
return luvio.dispatchResourceRequest(request, options)
|
|
1114
1115
|
.then((response) => {
|
|
1115
1116
|
return luvio.handleSuccessResponse(() => onFetchResponseSuccess(luvio, config, resourceParams, response), () => {
|
|
1116
1117
|
const cache = new StoreKeyMap();
|
|
1117
|
-
getResponseCacheKeys(cache, luvio, resourceParams, response.body);
|
|
1118
|
+
getResponseCacheKeys$1(cache, luvio, resourceParams, response.body);
|
|
1118
1119
|
return cache;
|
|
1119
1120
|
});
|
|
1120
1121
|
}, (response) => {
|
|
@@ -1122,23 +1123,23 @@ function buildNetworkSnapshot(luvio, config, options) {
|
|
|
1122
1123
|
});
|
|
1123
1124
|
}
|
|
1124
1125
|
function buildNetworkSnapshotCachePolicy(context, coercedAdapterRequestContext) {
|
|
1125
|
-
return buildNetworkSnapshotCachePolicy$3(context, coercedAdapterRequestContext, buildNetworkSnapshot, undefined, false);
|
|
1126
|
+
return buildNetworkSnapshotCachePolicy$3(context, coercedAdapterRequestContext, buildNetworkSnapshot$1, undefined, false);
|
|
1126
1127
|
}
|
|
1127
1128
|
function buildCachedSnapshotCachePolicy(context, storeLookup) {
|
|
1128
1129
|
const { luvio, config } = context;
|
|
1129
1130
|
const selector = {
|
|
1130
|
-
recordId: keyBuilder(luvio, config),
|
|
1131
|
+
recordId: keyBuilder$1(luvio, config),
|
|
1131
1132
|
node: adapterFragment(luvio, config),
|
|
1132
1133
|
variables: {},
|
|
1133
1134
|
};
|
|
1134
1135
|
const cacheSnapshot = storeLookup(selector, {
|
|
1135
1136
|
config,
|
|
1136
|
-
resolve: () => buildNetworkSnapshot(luvio, config, snapshotRefreshOptions)
|
|
1137
|
+
resolve: () => buildNetworkSnapshot$1(luvio, config, snapshotRefreshOptions)
|
|
1137
1138
|
});
|
|
1138
1139
|
return cacheSnapshot;
|
|
1139
1140
|
}
|
|
1140
1141
|
const getDecisionTableTemplateAdapterFactory = (luvio) => function DecisionTable__getDecisionTableTemplate(untrustedConfig, requestContext) {
|
|
1141
|
-
const config = validateAdapterConfig(untrustedConfig, getDecisionTableTemplate_ConfigPropertyNames);
|
|
1142
|
+
const config = validateAdapterConfig$1(untrustedConfig, getDecisionTableTemplate_ConfigPropertyNames);
|
|
1142
1143
|
// Invalid or incomplete config
|
|
1143
1144
|
if (config === null) {
|
|
1144
1145
|
return null;
|
|
@@ -1147,4 +1148,237 @@ const getDecisionTableTemplateAdapterFactory = (luvio) => function DecisionTable
|
|
|
1147
1148
|
buildCachedSnapshotCachePolicy, buildNetworkSnapshotCachePolicy);
|
|
1148
1149
|
};
|
|
1149
1150
|
|
|
1150
|
-
|
|
1151
|
+
function validate$1(obj, path = 'DecisionTableRowInputRepresentation') {
|
|
1152
|
+
const v_error = (() => {
|
|
1153
|
+
if (typeof obj !== 'object' || ArrayIsArray(obj) || obj === null) {
|
|
1154
|
+
return new TypeError('Expected "object" but received "' + typeof obj + '" (at "' + path + '")');
|
|
1155
|
+
}
|
|
1156
|
+
const obj_action = obj.action;
|
|
1157
|
+
const path_action = path + '.action';
|
|
1158
|
+
if (typeof obj_action !== 'string') {
|
|
1159
|
+
return new TypeError('Expected "string" but received "' + typeof obj_action + '" (at "' + path_action + '")');
|
|
1160
|
+
}
|
|
1161
|
+
const obj_id = obj.id;
|
|
1162
|
+
const path_id = path + '.id';
|
|
1163
|
+
if (typeof obj_id !== 'string') {
|
|
1164
|
+
return new TypeError('Expected "string" but received "' + typeof obj_id + '" (at "' + path_id + '")');
|
|
1165
|
+
}
|
|
1166
|
+
const obj_name = obj.name;
|
|
1167
|
+
const path_name = path + '.name';
|
|
1168
|
+
if (typeof obj_name !== 'string') {
|
|
1169
|
+
return new TypeError('Expected "string" but received "' + typeof obj_name + '" (at "' + path_name + '")');
|
|
1170
|
+
}
|
|
1171
|
+
const obj_rowData = obj.rowData;
|
|
1172
|
+
const path_rowData = path + '.rowData';
|
|
1173
|
+
if (typeof obj_rowData !== 'object' || ArrayIsArray(obj_rowData) || obj_rowData === null) {
|
|
1174
|
+
return new TypeError('Expected "object" but received "' + typeof obj_rowData + '" (at "' + path_rowData + '")');
|
|
1175
|
+
}
|
|
1176
|
+
const obj_rowData_keys = ObjectKeys(obj_rowData);
|
|
1177
|
+
for (let i = 0; i < obj_rowData_keys.length; i++) {
|
|
1178
|
+
const key = obj_rowData_keys[i];
|
|
1179
|
+
const obj_rowData_prop = obj_rowData[key];
|
|
1180
|
+
const path_rowData_prop = path_rowData + '["' + key + '"]';
|
|
1181
|
+
if (typeof obj_rowData_prop !== 'object' || ArrayIsArray(obj_rowData_prop) || obj_rowData_prop === null) {
|
|
1182
|
+
return new TypeError('Expected "object" but received "' + typeof obj_rowData_prop + '" (at "' + path_rowData_prop + '")');
|
|
1183
|
+
}
|
|
1184
|
+
}
|
|
1185
|
+
})();
|
|
1186
|
+
return v_error === undefined ? null : v_error;
|
|
1187
|
+
}
|
|
1188
|
+
|
|
1189
|
+
const TTL = 1000;
|
|
1190
|
+
const VERSION = "b20786da88bc707d39693989566d86c6";
|
|
1191
|
+
function validate(obj, path = 'DecisionTableDataOutputRepresentation') {
|
|
1192
|
+
const v_error = (() => {
|
|
1193
|
+
if (typeof obj !== 'object' || ArrayIsArray(obj) || obj === null) {
|
|
1194
|
+
return new TypeError('Expected "object" but received "' + typeof obj + '" (at "' + path + '")');
|
|
1195
|
+
}
|
|
1196
|
+
if (obj.errorFileId !== undefined) {
|
|
1197
|
+
const obj_errorFileId = obj.errorFileId;
|
|
1198
|
+
const path_errorFileId = path + '.errorFileId';
|
|
1199
|
+
if (typeof obj_errorFileId !== 'string') {
|
|
1200
|
+
return new TypeError('Expected "string" but received "' + typeof obj_errorFileId + '" (at "' + path_errorFileId + '")');
|
|
1201
|
+
}
|
|
1202
|
+
}
|
|
1203
|
+
if (obj.errors !== undefined) {
|
|
1204
|
+
const obj_errors = obj.errors;
|
|
1205
|
+
const path_errors = path + '.errors';
|
|
1206
|
+
if (!ArrayIsArray(obj_errors)) {
|
|
1207
|
+
return new TypeError('Expected "array" but received "' + typeof obj_errors + '" (at "' + path_errors + '")');
|
|
1208
|
+
}
|
|
1209
|
+
for (let i = 0; i < obj_errors.length; i++) {
|
|
1210
|
+
const obj_errors_item = obj_errors[i];
|
|
1211
|
+
const path_errors_item = path_errors + '[' + i + ']';
|
|
1212
|
+
if (typeof obj_errors_item !== 'string') {
|
|
1213
|
+
return new TypeError('Expected "string" but received "' + typeof obj_errors_item + '" (at "' + path_errors_item + '")');
|
|
1214
|
+
}
|
|
1215
|
+
}
|
|
1216
|
+
}
|
|
1217
|
+
const obj_message = obj.message;
|
|
1218
|
+
const path_message = path + '.message';
|
|
1219
|
+
if (typeof obj_message !== 'string') {
|
|
1220
|
+
return new TypeError('Expected "string" but received "' + typeof obj_message + '" (at "' + path_message + '")');
|
|
1221
|
+
}
|
|
1222
|
+
const obj_success = obj.success;
|
|
1223
|
+
const path_success = path + '.success';
|
|
1224
|
+
if (typeof obj_success !== 'boolean') {
|
|
1225
|
+
return new TypeError('Expected "boolean" but received "' + typeof obj_success + '" (at "' + path_success + '")');
|
|
1226
|
+
}
|
|
1227
|
+
})();
|
|
1228
|
+
return v_error === undefined ? null : v_error;
|
|
1229
|
+
}
|
|
1230
|
+
const RepresentationType = 'DecisionTableDataOutputRepresentation';
|
|
1231
|
+
function keyBuilder(luvio, config) {
|
|
1232
|
+
return keyPrefix + '::' + RepresentationType + ':' + config.success;
|
|
1233
|
+
}
|
|
1234
|
+
function keyBuilderFromType(luvio, object) {
|
|
1235
|
+
const keyParams = {
|
|
1236
|
+
success: object.success
|
|
1237
|
+
};
|
|
1238
|
+
return keyBuilder(luvio, keyParams);
|
|
1239
|
+
}
|
|
1240
|
+
function normalize(input, existing, path, luvio, store, timestamp) {
|
|
1241
|
+
return input;
|
|
1242
|
+
}
|
|
1243
|
+
const select$1 = function DecisionTableDataOutputRepresentationSelect() {
|
|
1244
|
+
return {
|
|
1245
|
+
kind: 'Fragment',
|
|
1246
|
+
version: VERSION,
|
|
1247
|
+
private: [],
|
|
1248
|
+
opaque: true
|
|
1249
|
+
};
|
|
1250
|
+
};
|
|
1251
|
+
function equals(existing, incoming) {
|
|
1252
|
+
if (JSONStringify(incoming) !== JSONStringify(existing)) {
|
|
1253
|
+
return false;
|
|
1254
|
+
}
|
|
1255
|
+
return true;
|
|
1256
|
+
}
|
|
1257
|
+
const ingest = function DecisionTableDataOutputRepresentationIngest(input, path, luvio, store, timestamp) {
|
|
1258
|
+
if (process.env.NODE_ENV !== 'production') {
|
|
1259
|
+
const validateError = validate(input);
|
|
1260
|
+
if (validateError !== null) {
|
|
1261
|
+
throw validateError;
|
|
1262
|
+
}
|
|
1263
|
+
}
|
|
1264
|
+
const key = keyBuilderFromType(luvio, input);
|
|
1265
|
+
const ttlToUse = TTL;
|
|
1266
|
+
ingestShape(input, path, luvio, store, timestamp, ttlToUse, key, normalize, "DecisionTable", VERSION, RepresentationType, equals);
|
|
1267
|
+
return createLink(key);
|
|
1268
|
+
};
|
|
1269
|
+
function getTypeCacheKeys(rootKeySet, luvio, input, fullPathFactory) {
|
|
1270
|
+
// root cache key (uses fullPathFactory if keyBuilderFromType isn't defined)
|
|
1271
|
+
const rootKey = keyBuilderFromType(luvio, input);
|
|
1272
|
+
rootKeySet.set(rootKey, {
|
|
1273
|
+
namespace: keyPrefix,
|
|
1274
|
+
representationName: RepresentationType,
|
|
1275
|
+
mergeable: false
|
|
1276
|
+
});
|
|
1277
|
+
}
|
|
1278
|
+
|
|
1279
|
+
function select(luvio, params) {
|
|
1280
|
+
return select$1();
|
|
1281
|
+
}
|
|
1282
|
+
function getResponseCacheKeys(storeKeyMap, luvio, resourceParams, response) {
|
|
1283
|
+
getTypeCacheKeys(storeKeyMap, luvio, response);
|
|
1284
|
+
}
|
|
1285
|
+
function ingestSuccess(luvio, resourceParams, response) {
|
|
1286
|
+
const { body } = response;
|
|
1287
|
+
const key = keyBuilderFromType(luvio, body);
|
|
1288
|
+
luvio.storeIngest(key, ingest, body);
|
|
1289
|
+
const snapshot = luvio.storeLookup({
|
|
1290
|
+
recordId: key,
|
|
1291
|
+
node: select(),
|
|
1292
|
+
variables: {},
|
|
1293
|
+
});
|
|
1294
|
+
if (process.env.NODE_ENV !== 'production') {
|
|
1295
|
+
if (snapshot.state !== 'Fulfilled') {
|
|
1296
|
+
throw new Error('Invalid network response. Expected resource response to result in Fulfilled snapshot');
|
|
1297
|
+
}
|
|
1298
|
+
}
|
|
1299
|
+
deepFreeze(snapshot.data);
|
|
1300
|
+
return snapshot;
|
|
1301
|
+
}
|
|
1302
|
+
function createResourceRequest(config) {
|
|
1303
|
+
const headers = {};
|
|
1304
|
+
return {
|
|
1305
|
+
baseUri: '/services/data/v62.0',
|
|
1306
|
+
basePath: '/connect/business-rules/decision-table/' + config.urlParams.decisionTableId + '/data',
|
|
1307
|
+
method: 'post',
|
|
1308
|
+
body: config.body,
|
|
1309
|
+
urlParams: config.urlParams,
|
|
1310
|
+
queryParams: {},
|
|
1311
|
+
headers,
|
|
1312
|
+
priority: 'normal',
|
|
1313
|
+
};
|
|
1314
|
+
}
|
|
1315
|
+
|
|
1316
|
+
const adapterName = 'postDecisionTableRows';
|
|
1317
|
+
const postDecisionTableRows_ConfigPropertyMetadata = [
|
|
1318
|
+
generateParamConfigMetadata('decisionTableId', true, 0 /* UrlParameter */, 0 /* String */),
|
|
1319
|
+
generateParamConfigMetadata('deleteAllRows', false, 2 /* Body */, 1 /* Boolean */),
|
|
1320
|
+
generateParamConfigMetadata('fileId', false, 2 /* Body */, 0 /* String */),
|
|
1321
|
+
generateParamConfigMetadata('rows', false, 2 /* Body */, 4 /* Unsupported */, true),
|
|
1322
|
+
];
|
|
1323
|
+
const postDecisionTableRows_ConfigPropertyNames = /*#__PURE__*/ buildAdapterValidationConfig(adapterName, postDecisionTableRows_ConfigPropertyMetadata);
|
|
1324
|
+
const createResourceParams = /*#__PURE__*/ createResourceParams$4(postDecisionTableRows_ConfigPropertyMetadata);
|
|
1325
|
+
function typeCheckConfig(untrustedConfig) {
|
|
1326
|
+
const config = {};
|
|
1327
|
+
typeCheckConfig$4(untrustedConfig, config, postDecisionTableRows_ConfigPropertyMetadata);
|
|
1328
|
+
const untrustedConfig_rows = untrustedConfig.rows;
|
|
1329
|
+
if (ArrayIsArray$1(untrustedConfig_rows)) {
|
|
1330
|
+
const untrustedConfig_rows_array = [];
|
|
1331
|
+
for (let i = 0, arrayLength = untrustedConfig_rows.length; i < arrayLength; i++) {
|
|
1332
|
+
const untrustedConfig_rows_item = untrustedConfig_rows[i];
|
|
1333
|
+
const referenceDecisionTableRowInputRepresentationValidationError = validate$1(untrustedConfig_rows_item);
|
|
1334
|
+
if (referenceDecisionTableRowInputRepresentationValidationError === null) {
|
|
1335
|
+
untrustedConfig_rows_array.push(untrustedConfig_rows_item);
|
|
1336
|
+
}
|
|
1337
|
+
}
|
|
1338
|
+
config.rows = untrustedConfig_rows_array;
|
|
1339
|
+
}
|
|
1340
|
+
return config;
|
|
1341
|
+
}
|
|
1342
|
+
function validateAdapterConfig(untrustedConfig, configPropertyNames) {
|
|
1343
|
+
if (!untrustedIsObject(untrustedConfig)) {
|
|
1344
|
+
return null;
|
|
1345
|
+
}
|
|
1346
|
+
if (process.env.NODE_ENV !== 'production') {
|
|
1347
|
+
validateConfig(untrustedConfig, configPropertyNames);
|
|
1348
|
+
}
|
|
1349
|
+
const config = typeCheckConfig(untrustedConfig);
|
|
1350
|
+
if (!areRequiredParametersPresent(config, configPropertyNames)) {
|
|
1351
|
+
return null;
|
|
1352
|
+
}
|
|
1353
|
+
return config;
|
|
1354
|
+
}
|
|
1355
|
+
function buildNetworkSnapshot(luvio, config, options) {
|
|
1356
|
+
const resourceParams = createResourceParams(config);
|
|
1357
|
+
const request = createResourceRequest(resourceParams);
|
|
1358
|
+
return luvio.dispatchResourceRequest(request, options)
|
|
1359
|
+
.then((response) => {
|
|
1360
|
+
return luvio.handleSuccessResponse(() => {
|
|
1361
|
+
const snapshot = ingestSuccess(luvio, resourceParams, response);
|
|
1362
|
+
return luvio.storeBroadcast().then(() => snapshot);
|
|
1363
|
+
}, () => {
|
|
1364
|
+
const cache = new StoreKeyMap();
|
|
1365
|
+
getResponseCacheKeys(cache, luvio, resourceParams, response.body);
|
|
1366
|
+
return cache;
|
|
1367
|
+
});
|
|
1368
|
+
}, (response) => {
|
|
1369
|
+
deepFreeze(response);
|
|
1370
|
+
throw response;
|
|
1371
|
+
});
|
|
1372
|
+
}
|
|
1373
|
+
const postDecisionTableRowsAdapterFactory = (luvio) => {
|
|
1374
|
+
return function postDecisionTableRows(untrustedConfig) {
|
|
1375
|
+
const config = validateAdapterConfig(untrustedConfig, postDecisionTableRows_ConfigPropertyNames);
|
|
1376
|
+
// Invalid or incomplete config
|
|
1377
|
+
if (config === null) {
|
|
1378
|
+
throw new Error('Invalid config for "postDecisionTableRows"');
|
|
1379
|
+
}
|
|
1380
|
+
return buildNetworkSnapshot(luvio, config);
|
|
1381
|
+
};
|
|
1382
|
+
};
|
|
1383
|
+
|
|
1384
|
+
export { getDecisionTableAdapterFactory, getDecisionTableTemplateAdapterFactory, getDecisionTableTemplateListAdapterFactory, postDecisionTableRowsAdapterFactory };
|