@salesforce/lds-adapters-cdp-personalization-service 1.299.0 → 1.300.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/cdp-personalization-service.js +1055 -161
- package/dist/es/es2018/types/src/generated/adapters/createPersonalizationSchema.d.ts +22 -0
- package/dist/es/es2018/types/src/generated/adapters/deletePersonalizationSchema.d.ts +14 -0
- package/dist/es/es2018/types/src/generated/adapters/getPersonalizationSchema.d.ts +28 -0
- package/dist/es/es2018/types/src/generated/artifacts/main.d.ts +3 -0
- package/dist/es/es2018/types/src/generated/artifacts/sfdc.d.ts +6 -1
- package/dist/es/es2018/types/src/generated/resources/deletePersonalizationPersonalizationSchemasByIdOrName.d.ts +12 -0
- package/dist/es/es2018/types/src/generated/resources/getPersonalizationPersonalizationSchemasByIdOrName.d.ts +16 -0
- package/dist/es/es2018/types/src/generated/resources/postPersonalizationPersonalizationSchemas.d.ts +19 -0
- package/dist/es/es2018/types/src/generated/types/PersonalizationAttributeInputRepresentation.d.ts +34 -0
- package/dist/es/es2018/types/src/generated/types/PersonalizationAttributeRepresentation.d.ts +52 -0
- package/dist/es/es2018/types/src/generated/types/PersonalizationSchemaInputRepresentation.d.ts +47 -0
- package/dist/es/es2018/types/src/generated/types/PersonalizationSchemaRepresentation.d.ts +75 -0
- package/package.json +5 -4
- package/sfdc/index.js +1115 -159
- package/src/raml/api.raml +165 -0
- package/src/raml/luvio.raml +22 -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$7, typeCheckConfig as typeCheckConfig$7, buildNetworkSnapshotCachePolicy as buildNetworkSnapshotCachePolicy$2 } from '@luvio/engine';
|
|
8
8
|
|
|
9
9
|
const { hasOwnProperty: ObjectPrototypeHasOwnProperty } = Object.prototype;
|
|
10
10
|
const { keys: ObjectKeys, create: ObjectCreate } = Object;
|
|
@@ -91,7 +91,7 @@ function createLink(ref) {
|
|
|
91
91
|
};
|
|
92
92
|
}
|
|
93
93
|
|
|
94
|
-
function validate$
|
|
94
|
+
function validate$7(obj, path = 'PersonalizationAttributeValueInputRepresentation') {
|
|
95
95
|
const v_error = (() => {
|
|
96
96
|
if (typeof obj !== 'object' || ArrayIsArray(obj) || obj === null) {
|
|
97
97
|
return new TypeError('Expected "object" but received "' + typeof obj + '" (at "' + path + '")');
|
|
@@ -178,7 +178,7 @@ function validate$4(obj, path = 'PersonalizationAttributeValueInputRepresentatio
|
|
|
178
178
|
return v_error === undefined ? null : v_error;
|
|
179
179
|
}
|
|
180
180
|
|
|
181
|
-
function validate$
|
|
181
|
+
function validate$6(obj, path = 'PersonalizationDecisionInputRepresentation') {
|
|
182
182
|
const v_error = (() => {
|
|
183
183
|
if (typeof obj !== 'object' || ArrayIsArray(obj) || obj === null) {
|
|
184
184
|
return new TypeError('Expected "object" but received "' + typeof obj + '" (at "' + path + '")');
|
|
@@ -191,7 +191,7 @@ function validate$3(obj, path = 'PersonalizationDecisionInputRepresentation') {
|
|
|
191
191
|
for (let i = 0; i < obj_attributeValues.length; i++) {
|
|
192
192
|
const obj_attributeValues_item = obj_attributeValues[i];
|
|
193
193
|
const path_attributeValues_item = path_attributeValues + '[' + i + ']';
|
|
194
|
-
const referencepath_attributeValues_itemValidationError = validate$
|
|
194
|
+
const referencepath_attributeValues_itemValidationError = validate$7(obj_attributeValues_item, path_attributeValues_item);
|
|
195
195
|
if (referencepath_attributeValues_itemValidationError !== null) {
|
|
196
196
|
let message = 'Object doesn\'t match PersonalizationAttributeValueInputRepresentation (at "' + path_attributeValues_item + '")\n';
|
|
197
197
|
message += referencepath_attributeValues_itemValidationError.message.split('\n').map((line) => '\t' + line).join('\n');
|
|
@@ -332,8 +332,8 @@ function validate$3(obj, path = 'PersonalizationDecisionInputRepresentation') {
|
|
|
332
332
|
return v_error === undefined ? null : v_error;
|
|
333
333
|
}
|
|
334
334
|
|
|
335
|
-
const VERSION$
|
|
336
|
-
function validate$
|
|
335
|
+
const VERSION$4 = "52ea9c14b7a747a28cedbcff0e7ab169";
|
|
336
|
+
function validate$5(obj, path = 'PersonalizationAttributeValueRepresentation') {
|
|
337
337
|
const v_error = (() => {
|
|
338
338
|
if (typeof obj !== 'object' || ArrayIsArray(obj) || obj === null) {
|
|
339
339
|
return new TypeError('Expected "object" but received "' + typeof obj + '" (at "' + path + '")');
|
|
@@ -419,10 +419,10 @@ function validate$2(obj, path = 'PersonalizationAttributeValueRepresentation') {
|
|
|
419
419
|
})();
|
|
420
420
|
return v_error === undefined ? null : v_error;
|
|
421
421
|
}
|
|
422
|
-
const select$
|
|
422
|
+
const select$9 = function PersonalizationAttributeValueRepresentationSelect() {
|
|
423
423
|
return {
|
|
424
424
|
kind: 'Fragment',
|
|
425
|
-
version: VERSION$
|
|
425
|
+
version: VERSION$4,
|
|
426
426
|
private: [],
|
|
427
427
|
selections: [
|
|
428
428
|
{
|
|
@@ -440,7 +440,7 @@ const select$5 = function PersonalizationAttributeValueRepresentationSelect() {
|
|
|
440
440
|
]
|
|
441
441
|
};
|
|
442
442
|
};
|
|
443
|
-
function equals$
|
|
443
|
+
function equals$4(existing, incoming) {
|
|
444
444
|
const existing_attributeEnum = existing.attributeEnum;
|
|
445
445
|
const incoming_attributeEnum = incoming.attributeEnum;
|
|
446
446
|
if (!(existing_attributeEnum === incoming_attributeEnum)) {
|
|
@@ -459,8 +459,8 @@ function equals$2(existing, incoming) {
|
|
|
459
459
|
return true;
|
|
460
460
|
}
|
|
461
461
|
|
|
462
|
-
const VERSION$
|
|
463
|
-
function validate$
|
|
462
|
+
const VERSION$3 = "a3c1b816177380fe8095a6b0eb674f08";
|
|
463
|
+
function validate$4(obj, path = 'PersonalizationDecisionRepresentation') {
|
|
464
464
|
const v_error = (() => {
|
|
465
465
|
if (typeof obj !== 'object' || ArrayIsArray(obj) || obj === null) {
|
|
466
466
|
return new TypeError('Expected "object" but received "' + typeof obj + '" (at "' + path + '")');
|
|
@@ -473,7 +473,7 @@ function validate$1(obj, path = 'PersonalizationDecisionRepresentation') {
|
|
|
473
473
|
for (let i = 0; i < obj_attributeValues.length; i++) {
|
|
474
474
|
const obj_attributeValues_item = obj_attributeValues[i];
|
|
475
475
|
const path_attributeValues_item = path_attributeValues + '[' + i + ']';
|
|
476
|
-
const referencepath_attributeValues_itemValidationError = validate$
|
|
476
|
+
const referencepath_attributeValues_itemValidationError = validate$5(obj_attributeValues_item, path_attributeValues_item);
|
|
477
477
|
if (referencepath_attributeValues_itemValidationError !== null) {
|
|
478
478
|
let message = 'Object doesn\'t match PersonalizationAttributeValueRepresentation (at "' + path_attributeValues_item + '")\n';
|
|
479
479
|
message += referencepath_attributeValues_itemValidationError.message.split('\n').map((line) => '\t' + line).join('\n');
|
|
@@ -769,11 +769,11 @@ function validate$1(obj, path = 'PersonalizationDecisionRepresentation') {
|
|
|
769
769
|
})();
|
|
770
770
|
return v_error === undefined ? null : v_error;
|
|
771
771
|
}
|
|
772
|
-
const select$
|
|
773
|
-
const { selections: PersonalizationAttributeValueRepresentation__selections, opaque: PersonalizationAttributeValueRepresentation__opaque, } = select$
|
|
772
|
+
const select$8 = function PersonalizationDecisionRepresentationSelect() {
|
|
773
|
+
const { selections: PersonalizationAttributeValueRepresentation__selections, opaque: PersonalizationAttributeValueRepresentation__opaque, } = select$9();
|
|
774
774
|
return {
|
|
775
775
|
kind: 'Fragment',
|
|
776
|
-
version: VERSION$
|
|
776
|
+
version: VERSION$3,
|
|
777
777
|
private: [],
|
|
778
778
|
selections: [
|
|
779
779
|
{
|
|
@@ -829,11 +829,11 @@ const select$4 = function PersonalizationDecisionRepresentationSelect() {
|
|
|
829
829
|
]
|
|
830
830
|
};
|
|
831
831
|
};
|
|
832
|
-
function equals$
|
|
832
|
+
function equals$3(existing, incoming) {
|
|
833
833
|
const existing_attributeValues = existing.attributeValues;
|
|
834
834
|
const incoming_attributeValues = incoming.attributeValues;
|
|
835
835
|
const equals_attributeValues_items = equalsArray(existing_attributeValues, incoming_attributeValues, (existing_attributeValues_item, incoming_attributeValues_item) => {
|
|
836
|
-
if (!(equals$
|
|
836
|
+
if (!(equals$4(existing_attributeValues_item, incoming_attributeValues_item))) {
|
|
837
837
|
return false;
|
|
838
838
|
}
|
|
839
839
|
});
|
|
@@ -898,9 +898,9 @@ function equals$1(existing, incoming) {
|
|
|
898
898
|
return true;
|
|
899
899
|
}
|
|
900
900
|
|
|
901
|
-
const TTL = 600;
|
|
902
|
-
const VERSION = "ee1ca8342609b01b292f149ed9209840";
|
|
903
|
-
function validate(obj, path = 'PersonalizationPointRepresentation') {
|
|
901
|
+
const TTL$1 = 600;
|
|
902
|
+
const VERSION$2 = "ee1ca8342609b01b292f149ed9209840";
|
|
903
|
+
function validate$3(obj, path = 'PersonalizationPointRepresentation') {
|
|
904
904
|
const v_error = (() => {
|
|
905
905
|
if (typeof obj !== 'object' || ArrayIsArray(obj) || obj === null) {
|
|
906
906
|
return new TypeError('Expected "object" but received "' + typeof obj + '" (at "' + path + '")');
|
|
@@ -1017,7 +1017,7 @@ function validate(obj, path = 'PersonalizationPointRepresentation') {
|
|
|
1017
1017
|
for (let i = 0; i < obj_decisions.length; i++) {
|
|
1018
1018
|
const obj_decisions_item = obj_decisions[i];
|
|
1019
1019
|
const path_decisions_item = path_decisions + '[' + i + ']';
|
|
1020
|
-
const referencepath_decisions_itemValidationError = validate$
|
|
1020
|
+
const referencepath_decisions_itemValidationError = validate$4(obj_decisions_item, path_decisions_item);
|
|
1021
1021
|
if (referencepath_decisions_itemValidationError !== null) {
|
|
1022
1022
|
let message = 'Object doesn\'t match PersonalizationDecisionRepresentation (at "' + path_decisions_item + '")\n';
|
|
1023
1023
|
message += referencepath_decisions_itemValidationError.message.split('\n').map((line) => '\t' + line).join('\n');
|
|
@@ -1297,24 +1297,24 @@ function validate(obj, path = 'PersonalizationPointRepresentation') {
|
|
|
1297
1297
|
})();
|
|
1298
1298
|
return v_error === undefined ? null : v_error;
|
|
1299
1299
|
}
|
|
1300
|
-
const RepresentationType = 'PersonalizationPointRepresentation';
|
|
1301
|
-
function keyBuilder$
|
|
1302
|
-
return keyPrefix + '::' + RepresentationType + ':' + (config.id === null ? '' : config.id);
|
|
1300
|
+
const RepresentationType$1 = 'PersonalizationPointRepresentation';
|
|
1301
|
+
function keyBuilder$7(luvio, config) {
|
|
1302
|
+
return keyPrefix + '::' + RepresentationType$1 + ':' + (config.id === null ? '' : config.id);
|
|
1303
1303
|
}
|
|
1304
|
-
function keyBuilderFromType(luvio, object) {
|
|
1304
|
+
function keyBuilderFromType$1(luvio, object) {
|
|
1305
1305
|
const keyParams = {
|
|
1306
1306
|
id: object.name
|
|
1307
1307
|
};
|
|
1308
|
-
return keyBuilder$
|
|
1308
|
+
return keyBuilder$7(luvio, keyParams);
|
|
1309
1309
|
}
|
|
1310
|
-
function normalize(input, existing, path, luvio, store, timestamp) {
|
|
1310
|
+
function normalize$1(input, existing, path, luvio, store, timestamp) {
|
|
1311
1311
|
return input;
|
|
1312
1312
|
}
|
|
1313
|
-
const select$
|
|
1314
|
-
const { selections: PersonalizationDecisionRepresentation__selections, opaque: PersonalizationDecisionRepresentation__opaque, } = select$
|
|
1313
|
+
const select$7 = function PersonalizationPointRepresentationSelect() {
|
|
1314
|
+
const { selections: PersonalizationDecisionRepresentation__selections, opaque: PersonalizationDecisionRepresentation__opaque, } = select$8();
|
|
1315
1315
|
return {
|
|
1316
1316
|
kind: 'Fragment',
|
|
1317
|
-
version: VERSION,
|
|
1317
|
+
version: VERSION$2,
|
|
1318
1318
|
private: [],
|
|
1319
1319
|
selections: [
|
|
1320
1320
|
{
|
|
@@ -1390,7 +1390,7 @@ const select$3 = function PersonalizationPointRepresentationSelect() {
|
|
|
1390
1390
|
]
|
|
1391
1391
|
};
|
|
1392
1392
|
};
|
|
1393
|
-
function equals(existing, incoming) {
|
|
1393
|
+
function equals$2(existing, incoming) {
|
|
1394
1394
|
const existing_source = existing.source;
|
|
1395
1395
|
const incoming_source = incoming.source;
|
|
1396
1396
|
if (!(existing_source === incoming_source)) {
|
|
@@ -1424,7 +1424,7 @@ function equals(existing, incoming) {
|
|
|
1424
1424
|
const existing_decisions = existing.decisions;
|
|
1425
1425
|
const incoming_decisions = incoming.decisions;
|
|
1426
1426
|
const equals_decisions_items = equalsArray(existing_decisions, incoming_decisions, (existing_decisions_item, incoming_decisions_item) => {
|
|
1427
|
-
if (!(equals$
|
|
1427
|
+
if (!(equals$3(existing_decisions_item, incoming_decisions_item))) {
|
|
1428
1428
|
return false;
|
|
1429
1429
|
}
|
|
1430
1430
|
});
|
|
@@ -1483,41 +1483,41 @@ function equals(existing, incoming) {
|
|
|
1483
1483
|
}
|
|
1484
1484
|
return true;
|
|
1485
1485
|
}
|
|
1486
|
-
const ingest = function PersonalizationPointRepresentationIngest(input, path, luvio, store, timestamp) {
|
|
1486
|
+
const ingest$1 = function PersonalizationPointRepresentationIngest(input, path, luvio, store, timestamp) {
|
|
1487
1487
|
if (process.env.NODE_ENV !== 'production') {
|
|
1488
|
-
const validateError = validate(input);
|
|
1488
|
+
const validateError = validate$3(input);
|
|
1489
1489
|
if (validateError !== null) {
|
|
1490
1490
|
throw validateError;
|
|
1491
1491
|
}
|
|
1492
1492
|
}
|
|
1493
|
-
const key = keyBuilderFromType(luvio, input);
|
|
1494
|
-
const ttlToUse = TTL;
|
|
1495
|
-
ingestShape(input, path, luvio, store, timestamp, ttlToUse, key, normalize, "personalization-service", VERSION, RepresentationType, equals);
|
|
1493
|
+
const key = keyBuilderFromType$1(luvio, input);
|
|
1494
|
+
const ttlToUse = TTL$1;
|
|
1495
|
+
ingestShape(input, path, luvio, store, timestamp, ttlToUse, key, normalize$1, "personalization-service", VERSION$2, RepresentationType$1, equals$2);
|
|
1496
1496
|
return createLink(key);
|
|
1497
1497
|
};
|
|
1498
|
-
function getTypeCacheKeys(rootKeySet, luvio, input, fullPathFactory) {
|
|
1498
|
+
function getTypeCacheKeys$1(rootKeySet, luvio, input, fullPathFactory) {
|
|
1499
1499
|
// root cache key (uses fullPathFactory if keyBuilderFromType isn't defined)
|
|
1500
|
-
const rootKey = keyBuilderFromType(luvio, input);
|
|
1500
|
+
const rootKey = keyBuilderFromType$1(luvio, input);
|
|
1501
1501
|
rootKeySet.set(rootKey, {
|
|
1502
1502
|
namespace: keyPrefix,
|
|
1503
|
-
representationName: RepresentationType,
|
|
1503
|
+
representationName: RepresentationType$1,
|
|
1504
1504
|
mergeable: false
|
|
1505
1505
|
});
|
|
1506
1506
|
}
|
|
1507
1507
|
|
|
1508
|
-
function select$
|
|
1509
|
-
return select$
|
|
1508
|
+
function select$6(luvio, params) {
|
|
1509
|
+
return select$7();
|
|
1510
1510
|
}
|
|
1511
|
-
function getResponseCacheKeys$
|
|
1512
|
-
getTypeCacheKeys(storeKeyMap, luvio, response);
|
|
1511
|
+
function getResponseCacheKeys$6(storeKeyMap, luvio, resourceParams, response) {
|
|
1512
|
+
getTypeCacheKeys$1(storeKeyMap, luvio, response);
|
|
1513
1513
|
}
|
|
1514
|
-
function ingestSuccess$
|
|
1514
|
+
function ingestSuccess$4(luvio, resourceParams, response) {
|
|
1515
1515
|
const { body } = response;
|
|
1516
|
-
const key = keyBuilderFromType(luvio, body);
|
|
1517
|
-
luvio.storeIngest(key, ingest, body);
|
|
1516
|
+
const key = keyBuilderFromType$1(luvio, body);
|
|
1517
|
+
luvio.storeIngest(key, ingest$1, body);
|
|
1518
1518
|
const snapshot = luvio.storeLookup({
|
|
1519
1519
|
recordId: key,
|
|
1520
|
-
node: select$
|
|
1520
|
+
node: select$6(),
|
|
1521
1521
|
variables: {},
|
|
1522
1522
|
});
|
|
1523
1523
|
if (process.env.NODE_ENV !== 'production') {
|
|
@@ -1528,7 +1528,7 @@ function ingestSuccess$2(luvio, resourceParams, response) {
|
|
|
1528
1528
|
deepFreeze(snapshot.data);
|
|
1529
1529
|
return snapshot;
|
|
1530
1530
|
}
|
|
1531
|
-
function createResourceRequest$
|
|
1531
|
+
function createResourceRequest$6(config) {
|
|
1532
1532
|
const headers = {};
|
|
1533
1533
|
return {
|
|
1534
1534
|
baseUri: '/services/data/v62.0',
|
|
@@ -1542,7 +1542,7 @@ function createResourceRequest$3(config) {
|
|
|
1542
1542
|
};
|
|
1543
1543
|
}
|
|
1544
1544
|
|
|
1545
|
-
const adapterName$
|
|
1545
|
+
const adapterName$6 = 'createPersonalizationPoint';
|
|
1546
1546
|
const createPersonalizationPoint_ConfigPropertyMetadata = [
|
|
1547
1547
|
generateParamConfigMetadata('description', true, 2 /* Body */, 4 /* Unsupported */),
|
|
1548
1548
|
generateParamConfigMetadata('label', true, 2 /* Body */, 4 /* Unsupported */),
|
|
@@ -1555,11 +1555,11 @@ const createPersonalizationPoint_ConfigPropertyMetadata = [
|
|
|
1555
1555
|
generateParamConfigMetadata('schemaName', true, 2 /* Body */, 4 /* Unsupported */),
|
|
1556
1556
|
generateParamConfigMetadata('source', true, 2 /* Body */, 0 /* String */),
|
|
1557
1557
|
];
|
|
1558
|
-
const createPersonalizationPoint_ConfigPropertyNames = /*#__PURE__*/ buildAdapterValidationConfig(adapterName$
|
|
1559
|
-
const createResourceParams$
|
|
1560
|
-
function typeCheckConfig$
|
|
1558
|
+
const createPersonalizationPoint_ConfigPropertyNames = /*#__PURE__*/ buildAdapterValidationConfig(adapterName$6, createPersonalizationPoint_ConfigPropertyMetadata);
|
|
1559
|
+
const createResourceParams$6 = /*#__PURE__*/ createResourceParams$7(createPersonalizationPoint_ConfigPropertyMetadata);
|
|
1560
|
+
function typeCheckConfig$6(untrustedConfig) {
|
|
1561
1561
|
const config = {};
|
|
1562
|
-
typeCheckConfig$
|
|
1562
|
+
typeCheckConfig$7(untrustedConfig, config, createPersonalizationPoint_ConfigPropertyMetadata);
|
|
1563
1563
|
const untrustedConfig_description = untrustedConfig.description;
|
|
1564
1564
|
if (typeof untrustedConfig_description === 'string') {
|
|
1565
1565
|
config.description = untrustedConfig_description;
|
|
@@ -1600,7 +1600,7 @@ function typeCheckConfig$3(untrustedConfig) {
|
|
|
1600
1600
|
const untrustedConfig_decisions_array = [];
|
|
1601
1601
|
for (let i = 0, arrayLength = untrustedConfig_decisions.length; i < arrayLength; i++) {
|
|
1602
1602
|
const untrustedConfig_decisions_item = untrustedConfig_decisions[i];
|
|
1603
|
-
const referencePersonalizationDecisionInputRepresentationValidationError = validate$
|
|
1603
|
+
const referencePersonalizationDecisionInputRepresentationValidationError = validate$6(untrustedConfig_decisions_item);
|
|
1604
1604
|
if (referencePersonalizationDecisionInputRepresentationValidationError === null) {
|
|
1605
1605
|
untrustedConfig_decisions_array.push(untrustedConfig_decisions_item);
|
|
1606
1606
|
}
|
|
@@ -1630,30 +1630,30 @@ function typeCheckConfig$3(untrustedConfig) {
|
|
|
1630
1630
|
}
|
|
1631
1631
|
return config;
|
|
1632
1632
|
}
|
|
1633
|
-
function validateAdapterConfig$
|
|
1633
|
+
function validateAdapterConfig$6(untrustedConfig, configPropertyNames) {
|
|
1634
1634
|
if (!untrustedIsObject(untrustedConfig)) {
|
|
1635
1635
|
return null;
|
|
1636
1636
|
}
|
|
1637
1637
|
if (process.env.NODE_ENV !== 'production') {
|
|
1638
1638
|
validateConfig(untrustedConfig, configPropertyNames);
|
|
1639
1639
|
}
|
|
1640
|
-
const config = typeCheckConfig$
|
|
1640
|
+
const config = typeCheckConfig$6(untrustedConfig);
|
|
1641
1641
|
if (!areRequiredParametersPresent(config, configPropertyNames)) {
|
|
1642
1642
|
return null;
|
|
1643
1643
|
}
|
|
1644
1644
|
return config;
|
|
1645
1645
|
}
|
|
1646
|
-
function buildNetworkSnapshot$
|
|
1647
|
-
const resourceParams = createResourceParams$
|
|
1648
|
-
const request = createResourceRequest$
|
|
1646
|
+
function buildNetworkSnapshot$6(luvio, config, options) {
|
|
1647
|
+
const resourceParams = createResourceParams$6(config);
|
|
1648
|
+
const request = createResourceRequest$6(resourceParams);
|
|
1649
1649
|
return luvio.dispatchResourceRequest(request, options)
|
|
1650
1650
|
.then((response) => {
|
|
1651
1651
|
return luvio.handleSuccessResponse(() => {
|
|
1652
|
-
const snapshot = ingestSuccess$
|
|
1652
|
+
const snapshot = ingestSuccess$4(luvio, resourceParams, response);
|
|
1653
1653
|
return luvio.storeBroadcast().then(() => snapshot);
|
|
1654
1654
|
}, () => {
|
|
1655
1655
|
const cache = new StoreKeyMap();
|
|
1656
|
-
getResponseCacheKeys$
|
|
1656
|
+
getResponseCacheKeys$6(cache, luvio, resourceParams, response.body);
|
|
1657
1657
|
return cache;
|
|
1658
1658
|
});
|
|
1659
1659
|
}, (response) => {
|
|
@@ -1663,33 +1663,33 @@ function buildNetworkSnapshot$3(luvio, config, options) {
|
|
|
1663
1663
|
}
|
|
1664
1664
|
const createPersonalizationPointAdapterFactory = (luvio) => {
|
|
1665
1665
|
return function createPersonalizationPoint(untrustedConfig) {
|
|
1666
|
-
const config = validateAdapterConfig$
|
|
1666
|
+
const config = validateAdapterConfig$6(untrustedConfig, createPersonalizationPoint_ConfigPropertyNames);
|
|
1667
1667
|
// Invalid or incomplete config
|
|
1668
1668
|
if (config === null) {
|
|
1669
1669
|
throw new Error('Invalid config for "createPersonalizationPoint"');
|
|
1670
1670
|
}
|
|
1671
|
-
return buildNetworkSnapshot$
|
|
1671
|
+
return buildNetworkSnapshot$6(luvio, config);
|
|
1672
1672
|
};
|
|
1673
1673
|
};
|
|
1674
1674
|
|
|
1675
|
-
function keyBuilder$
|
|
1676
|
-
return keyBuilder$
|
|
1675
|
+
function keyBuilder$6(luvio, params) {
|
|
1676
|
+
return keyBuilder$7(luvio, {
|
|
1677
1677
|
id: params.urlParams.idOrName
|
|
1678
1678
|
});
|
|
1679
1679
|
}
|
|
1680
|
-
function getResponseCacheKeys$
|
|
1681
|
-
const key = keyBuilder$
|
|
1680
|
+
function getResponseCacheKeys$5(cacheKeyMap, luvio, resourceParams) {
|
|
1681
|
+
const key = keyBuilder$6(luvio, resourceParams);
|
|
1682
1682
|
cacheKeyMap.set(key, {
|
|
1683
1683
|
namespace: keyPrefix,
|
|
1684
|
-
representationName: RepresentationType,
|
|
1684
|
+
representationName: RepresentationType$1,
|
|
1685
1685
|
mergeable: false
|
|
1686
1686
|
});
|
|
1687
1687
|
}
|
|
1688
|
-
function evictSuccess(luvio, resourceParams) {
|
|
1689
|
-
const key = keyBuilder$
|
|
1688
|
+
function evictSuccess$1(luvio, resourceParams) {
|
|
1689
|
+
const key = keyBuilder$6(luvio, resourceParams);
|
|
1690
1690
|
luvio.storeEvict(key);
|
|
1691
1691
|
}
|
|
1692
|
-
function createResourceRequest$
|
|
1692
|
+
function createResourceRequest$5(config) {
|
|
1693
1693
|
const headers = {};
|
|
1694
1694
|
return {
|
|
1695
1695
|
baseUri: '/services/data/v62.0',
|
|
@@ -1703,41 +1703,41 @@ function createResourceRequest$2(config) {
|
|
|
1703
1703
|
};
|
|
1704
1704
|
}
|
|
1705
1705
|
|
|
1706
|
-
const adapterName$
|
|
1706
|
+
const adapterName$5 = 'deletePersonalizationPoint';
|
|
1707
1707
|
const deletePersonalizationPoint_ConfigPropertyMetadata = [
|
|
1708
1708
|
generateParamConfigMetadata('idOrName', true, 0 /* UrlParameter */, 0 /* String */),
|
|
1709
1709
|
];
|
|
1710
|
-
const deletePersonalizationPoint_ConfigPropertyNames = /*#__PURE__*/ buildAdapterValidationConfig(adapterName$
|
|
1711
|
-
const createResourceParams$
|
|
1712
|
-
function typeCheckConfig$
|
|
1710
|
+
const deletePersonalizationPoint_ConfigPropertyNames = /*#__PURE__*/ buildAdapterValidationConfig(adapterName$5, deletePersonalizationPoint_ConfigPropertyMetadata);
|
|
1711
|
+
const createResourceParams$5 = /*#__PURE__*/ createResourceParams$7(deletePersonalizationPoint_ConfigPropertyMetadata);
|
|
1712
|
+
function typeCheckConfig$5(untrustedConfig) {
|
|
1713
1713
|
const config = {};
|
|
1714
|
-
typeCheckConfig$
|
|
1714
|
+
typeCheckConfig$7(untrustedConfig, config, deletePersonalizationPoint_ConfigPropertyMetadata);
|
|
1715
1715
|
return config;
|
|
1716
1716
|
}
|
|
1717
|
-
function validateAdapterConfig$
|
|
1717
|
+
function validateAdapterConfig$5(untrustedConfig, configPropertyNames) {
|
|
1718
1718
|
if (!untrustedIsObject(untrustedConfig)) {
|
|
1719
1719
|
return null;
|
|
1720
1720
|
}
|
|
1721
1721
|
if (process.env.NODE_ENV !== 'production') {
|
|
1722
1722
|
validateConfig(untrustedConfig, configPropertyNames);
|
|
1723
1723
|
}
|
|
1724
|
-
const config = typeCheckConfig$
|
|
1724
|
+
const config = typeCheckConfig$5(untrustedConfig);
|
|
1725
1725
|
if (!areRequiredParametersPresent(config, configPropertyNames)) {
|
|
1726
1726
|
return null;
|
|
1727
1727
|
}
|
|
1728
1728
|
return config;
|
|
1729
1729
|
}
|
|
1730
|
-
function buildNetworkSnapshot$
|
|
1731
|
-
const resourceParams = createResourceParams$
|
|
1732
|
-
const request = createResourceRequest$
|
|
1730
|
+
function buildNetworkSnapshot$5(luvio, config, options) {
|
|
1731
|
+
const resourceParams = createResourceParams$5(config);
|
|
1732
|
+
const request = createResourceRequest$5(resourceParams);
|
|
1733
1733
|
return luvio.dispatchResourceRequest(request, options)
|
|
1734
1734
|
.then(() => {
|
|
1735
1735
|
return luvio.handleSuccessResponse(() => {
|
|
1736
|
-
evictSuccess(luvio, resourceParams);
|
|
1736
|
+
evictSuccess$1(luvio, resourceParams);
|
|
1737
1737
|
return luvio.storeBroadcast();
|
|
1738
1738
|
}, () => {
|
|
1739
1739
|
const cache = new StoreKeyMap();
|
|
1740
|
-
getResponseCacheKeys$
|
|
1740
|
+
getResponseCacheKeys$5(cache, luvio, resourceParams);
|
|
1741
1741
|
return cache;
|
|
1742
1742
|
});
|
|
1743
1743
|
}, (response) => {
|
|
@@ -1747,33 +1747,33 @@ function buildNetworkSnapshot$2(luvio, config, options) {
|
|
|
1747
1747
|
}
|
|
1748
1748
|
const deletePersonalizationPointAdapterFactory = (luvio) => {
|
|
1749
1749
|
return function personalizationServicedeletePersonalizationPoint(untrustedConfig) {
|
|
1750
|
-
const config = validateAdapterConfig$
|
|
1750
|
+
const config = validateAdapterConfig$5(untrustedConfig, deletePersonalizationPoint_ConfigPropertyNames);
|
|
1751
1751
|
// Invalid or incomplete config
|
|
1752
1752
|
if (config === null) {
|
|
1753
|
-
throw new Error(`Invalid config for "${adapterName$
|
|
1753
|
+
throw new Error(`Invalid config for "${adapterName$5}"`);
|
|
1754
1754
|
}
|
|
1755
|
-
return buildNetworkSnapshot$
|
|
1755
|
+
return buildNetworkSnapshot$5(luvio, config);
|
|
1756
1756
|
};
|
|
1757
1757
|
};
|
|
1758
1758
|
|
|
1759
|
-
function select$
|
|
1760
|
-
return select$
|
|
1759
|
+
function select$5(luvio, params) {
|
|
1760
|
+
return select$7();
|
|
1761
1761
|
}
|
|
1762
|
-
function keyBuilder$
|
|
1763
|
-
return keyBuilder$
|
|
1762
|
+
function keyBuilder$5(luvio, params) {
|
|
1763
|
+
return keyBuilder$7(luvio, {
|
|
1764
1764
|
id: params.urlParams.idOrName
|
|
1765
1765
|
});
|
|
1766
1766
|
}
|
|
1767
|
-
function getResponseCacheKeys$
|
|
1768
|
-
getTypeCacheKeys(storeKeyMap, luvio, response);
|
|
1767
|
+
function getResponseCacheKeys$4(storeKeyMap, luvio, resourceParams, response) {
|
|
1768
|
+
getTypeCacheKeys$1(storeKeyMap, luvio, response);
|
|
1769
1769
|
}
|
|
1770
|
-
function ingestSuccess$
|
|
1770
|
+
function ingestSuccess$3(luvio, resourceParams, response, snapshotRefresh) {
|
|
1771
1771
|
const { body } = response;
|
|
1772
|
-
const key = keyBuilder$
|
|
1773
|
-
luvio.storeIngest(key, ingest, body);
|
|
1772
|
+
const key = keyBuilder$5(luvio, resourceParams);
|
|
1773
|
+
luvio.storeIngest(key, ingest$1, body);
|
|
1774
1774
|
const snapshot = luvio.storeLookup({
|
|
1775
1775
|
recordId: key,
|
|
1776
|
-
node: select$
|
|
1776
|
+
node: select$5(),
|
|
1777
1777
|
variables: {},
|
|
1778
1778
|
}, snapshotRefresh);
|
|
1779
1779
|
if (process.env.NODE_ENV !== 'production') {
|
|
@@ -1784,19 +1784,19 @@ function ingestSuccess$1(luvio, resourceParams, response, snapshotRefresh) {
|
|
|
1784
1784
|
deepFreeze(snapshot.data);
|
|
1785
1785
|
return snapshot;
|
|
1786
1786
|
}
|
|
1787
|
-
function ingestError(luvio, params, error, snapshotRefresh) {
|
|
1788
|
-
const key = keyBuilder$
|
|
1787
|
+
function ingestError$1(luvio, params, error, snapshotRefresh) {
|
|
1788
|
+
const key = keyBuilder$5(luvio, params);
|
|
1789
1789
|
const errorSnapshot = luvio.errorSnapshot(error, snapshotRefresh);
|
|
1790
1790
|
const storeMetadataParams = {
|
|
1791
|
-
ttl: TTL,
|
|
1791
|
+
ttl: TTL$1,
|
|
1792
1792
|
namespace: keyPrefix,
|
|
1793
|
-
version: VERSION,
|
|
1794
|
-
representationName: RepresentationType
|
|
1793
|
+
version: VERSION$2,
|
|
1794
|
+
representationName: RepresentationType$1
|
|
1795
1795
|
};
|
|
1796
1796
|
luvio.storeIngestError(key, errorSnapshot, storeMetadataParams);
|
|
1797
1797
|
return errorSnapshot;
|
|
1798
1798
|
}
|
|
1799
|
-
function createResourceRequest$
|
|
1799
|
+
function createResourceRequest$4(config) {
|
|
1800
1800
|
const headers = {};
|
|
1801
1801
|
return {
|
|
1802
1802
|
baseUri: '/services/data/v62.0',
|
|
@@ -1810,105 +1810,105 @@ function createResourceRequest$1(config) {
|
|
|
1810
1810
|
};
|
|
1811
1811
|
}
|
|
1812
1812
|
|
|
1813
|
-
const adapterName$
|
|
1813
|
+
const adapterName$4 = 'getPersonalizationPoint';
|
|
1814
1814
|
const getPersonalizationPoint_ConfigPropertyMetadata = [
|
|
1815
1815
|
generateParamConfigMetadata('idOrName', true, 0 /* UrlParameter */, 0 /* String */),
|
|
1816
1816
|
];
|
|
1817
|
-
const getPersonalizationPoint_ConfigPropertyNames = /*#__PURE__*/ buildAdapterValidationConfig(adapterName$
|
|
1818
|
-
const createResourceParams$
|
|
1819
|
-
function keyBuilder(luvio, config) {
|
|
1820
|
-
const resourceParams = createResourceParams$
|
|
1821
|
-
return keyBuilder$
|
|
1817
|
+
const getPersonalizationPoint_ConfigPropertyNames = /*#__PURE__*/ buildAdapterValidationConfig(adapterName$4, getPersonalizationPoint_ConfigPropertyMetadata);
|
|
1818
|
+
const createResourceParams$4 = /*#__PURE__*/ createResourceParams$7(getPersonalizationPoint_ConfigPropertyMetadata);
|
|
1819
|
+
function keyBuilder$4(luvio, config) {
|
|
1820
|
+
const resourceParams = createResourceParams$4(config);
|
|
1821
|
+
return keyBuilder$5(luvio, resourceParams);
|
|
1822
1822
|
}
|
|
1823
|
-
function typeCheckConfig$
|
|
1823
|
+
function typeCheckConfig$4(untrustedConfig) {
|
|
1824
1824
|
const config = {};
|
|
1825
|
-
typeCheckConfig$
|
|
1825
|
+
typeCheckConfig$7(untrustedConfig, config, getPersonalizationPoint_ConfigPropertyMetadata);
|
|
1826
1826
|
return config;
|
|
1827
1827
|
}
|
|
1828
|
-
function validateAdapterConfig$
|
|
1828
|
+
function validateAdapterConfig$4(untrustedConfig, configPropertyNames) {
|
|
1829
1829
|
if (!untrustedIsObject(untrustedConfig)) {
|
|
1830
1830
|
return null;
|
|
1831
1831
|
}
|
|
1832
1832
|
if (process.env.NODE_ENV !== 'production') {
|
|
1833
1833
|
validateConfig(untrustedConfig, configPropertyNames);
|
|
1834
1834
|
}
|
|
1835
|
-
const config = typeCheckConfig$
|
|
1835
|
+
const config = typeCheckConfig$4(untrustedConfig);
|
|
1836
1836
|
if (!areRequiredParametersPresent(config, configPropertyNames)) {
|
|
1837
1837
|
return null;
|
|
1838
1838
|
}
|
|
1839
1839
|
return config;
|
|
1840
1840
|
}
|
|
1841
|
-
function adapterFragment(luvio, config) {
|
|
1842
|
-
createResourceParams$
|
|
1843
|
-
return select$
|
|
1841
|
+
function adapterFragment$1(luvio, config) {
|
|
1842
|
+
createResourceParams$4(config);
|
|
1843
|
+
return select$5();
|
|
1844
1844
|
}
|
|
1845
|
-
function onFetchResponseSuccess(luvio, config, resourceParams, response) {
|
|
1846
|
-
const snapshot = ingestSuccess$
|
|
1845
|
+
function onFetchResponseSuccess$1(luvio, config, resourceParams, response) {
|
|
1846
|
+
const snapshot = ingestSuccess$3(luvio, resourceParams, response, {
|
|
1847
1847
|
config,
|
|
1848
|
-
resolve: () => buildNetworkSnapshot$
|
|
1848
|
+
resolve: () => buildNetworkSnapshot$4(luvio, config, snapshotRefreshOptions)
|
|
1849
1849
|
});
|
|
1850
1850
|
return luvio.storeBroadcast().then(() => snapshot);
|
|
1851
1851
|
}
|
|
1852
|
-
function onFetchResponseError(luvio, config, resourceParams, response) {
|
|
1853
|
-
const snapshot = ingestError(luvio, resourceParams, response, {
|
|
1852
|
+
function onFetchResponseError$1(luvio, config, resourceParams, response) {
|
|
1853
|
+
const snapshot = ingestError$1(luvio, resourceParams, response, {
|
|
1854
1854
|
config,
|
|
1855
|
-
resolve: () => buildNetworkSnapshot$
|
|
1855
|
+
resolve: () => buildNetworkSnapshot$4(luvio, config, snapshotRefreshOptions)
|
|
1856
1856
|
});
|
|
1857
1857
|
return luvio.storeBroadcast().then(() => snapshot);
|
|
1858
1858
|
}
|
|
1859
|
-
function buildNetworkSnapshot$
|
|
1860
|
-
const resourceParams = createResourceParams$
|
|
1861
|
-
const request = createResourceRequest$
|
|
1859
|
+
function buildNetworkSnapshot$4(luvio, config, options) {
|
|
1860
|
+
const resourceParams = createResourceParams$4(config);
|
|
1861
|
+
const request = createResourceRequest$4(resourceParams);
|
|
1862
1862
|
return luvio.dispatchResourceRequest(request, options)
|
|
1863
1863
|
.then((response) => {
|
|
1864
|
-
return luvio.handleSuccessResponse(() => onFetchResponseSuccess(luvio, config, resourceParams, response), () => {
|
|
1864
|
+
return luvio.handleSuccessResponse(() => onFetchResponseSuccess$1(luvio, config, resourceParams, response), () => {
|
|
1865
1865
|
const cache = new StoreKeyMap();
|
|
1866
|
-
getResponseCacheKeys$
|
|
1866
|
+
getResponseCacheKeys$4(cache, luvio, resourceParams, response.body);
|
|
1867
1867
|
return cache;
|
|
1868
1868
|
});
|
|
1869
1869
|
}, (response) => {
|
|
1870
|
-
return luvio.handleErrorResponse(() => onFetchResponseError(luvio, config, resourceParams, response));
|
|
1870
|
+
return luvio.handleErrorResponse(() => onFetchResponseError$1(luvio, config, resourceParams, response));
|
|
1871
1871
|
});
|
|
1872
1872
|
}
|
|
1873
|
-
function buildNetworkSnapshotCachePolicy(context, coercedAdapterRequestContext) {
|
|
1874
|
-
return buildNetworkSnapshotCachePolicy$
|
|
1873
|
+
function buildNetworkSnapshotCachePolicy$1(context, coercedAdapterRequestContext) {
|
|
1874
|
+
return buildNetworkSnapshotCachePolicy$2(context, coercedAdapterRequestContext, buildNetworkSnapshot$4, undefined, false);
|
|
1875
1875
|
}
|
|
1876
|
-
function buildCachedSnapshotCachePolicy(context, storeLookup) {
|
|
1876
|
+
function buildCachedSnapshotCachePolicy$1(context, storeLookup) {
|
|
1877
1877
|
const { luvio, config } = context;
|
|
1878
1878
|
const selector = {
|
|
1879
|
-
recordId: keyBuilder(luvio, config),
|
|
1880
|
-
node: adapterFragment(luvio, config),
|
|
1879
|
+
recordId: keyBuilder$4(luvio, config),
|
|
1880
|
+
node: adapterFragment$1(luvio, config),
|
|
1881
1881
|
variables: {},
|
|
1882
1882
|
};
|
|
1883
1883
|
const cacheSnapshot = storeLookup(selector, {
|
|
1884
1884
|
config,
|
|
1885
|
-
resolve: () => buildNetworkSnapshot$
|
|
1885
|
+
resolve: () => buildNetworkSnapshot$4(luvio, config, snapshotRefreshOptions)
|
|
1886
1886
|
});
|
|
1887
1887
|
return cacheSnapshot;
|
|
1888
1888
|
}
|
|
1889
1889
|
const getPersonalizationPointAdapterFactory = (luvio) => function personalizationService__getPersonalizationPoint(untrustedConfig, requestContext) {
|
|
1890
|
-
const config = validateAdapterConfig$
|
|
1890
|
+
const config = validateAdapterConfig$4(untrustedConfig, getPersonalizationPoint_ConfigPropertyNames);
|
|
1891
1891
|
// Invalid or incomplete config
|
|
1892
1892
|
if (config === null) {
|
|
1893
1893
|
return null;
|
|
1894
1894
|
}
|
|
1895
1895
|
return luvio.applyCachePolicy((requestContext || {}), { config, luvio }, // BuildSnapshotContext
|
|
1896
|
-
buildCachedSnapshotCachePolicy, buildNetworkSnapshotCachePolicy);
|
|
1896
|
+
buildCachedSnapshotCachePolicy$1, buildNetworkSnapshotCachePolicy$1);
|
|
1897
1897
|
};
|
|
1898
1898
|
|
|
1899
|
-
function select(luvio, params) {
|
|
1900
|
-
return select$
|
|
1899
|
+
function select$4(luvio, params) {
|
|
1900
|
+
return select$7();
|
|
1901
1901
|
}
|
|
1902
|
-
function getResponseCacheKeys(storeKeyMap, luvio, resourceParams, response) {
|
|
1903
|
-
getTypeCacheKeys(storeKeyMap, luvio, response);
|
|
1902
|
+
function getResponseCacheKeys$3(storeKeyMap, luvio, resourceParams, response) {
|
|
1903
|
+
getTypeCacheKeys$1(storeKeyMap, luvio, response);
|
|
1904
1904
|
}
|
|
1905
|
-
function ingestSuccess(luvio, resourceParams, response) {
|
|
1905
|
+
function ingestSuccess$2(luvio, resourceParams, response) {
|
|
1906
1906
|
const { body } = response;
|
|
1907
|
-
const key = keyBuilderFromType(luvio, body);
|
|
1908
|
-
luvio.storeIngest(key, ingest, body);
|
|
1907
|
+
const key = keyBuilderFromType$1(luvio, body);
|
|
1908
|
+
luvio.storeIngest(key, ingest$1, body);
|
|
1909
1909
|
const snapshot = luvio.storeLookup({
|
|
1910
1910
|
recordId: key,
|
|
1911
|
-
node: select(),
|
|
1911
|
+
node: select$4(),
|
|
1912
1912
|
variables: {},
|
|
1913
1913
|
});
|
|
1914
1914
|
if (process.env.NODE_ENV !== 'production') {
|
|
@@ -1919,7 +1919,7 @@ function ingestSuccess(luvio, resourceParams, response) {
|
|
|
1919
1919
|
deepFreeze(snapshot.data);
|
|
1920
1920
|
return snapshot;
|
|
1921
1921
|
}
|
|
1922
|
-
function createResourceRequest(config) {
|
|
1922
|
+
function createResourceRequest$3(config) {
|
|
1923
1923
|
const headers = {};
|
|
1924
1924
|
return {
|
|
1925
1925
|
baseUri: '/services/data/v62.0',
|
|
@@ -1933,7 +1933,7 @@ function createResourceRequest(config) {
|
|
|
1933
1933
|
};
|
|
1934
1934
|
}
|
|
1935
1935
|
|
|
1936
|
-
const adapterName = 'updatePersonalizationPoint';
|
|
1936
|
+
const adapterName$3 = 'updatePersonalizationPoint';
|
|
1937
1937
|
const updatePersonalizationPoint_ConfigPropertyMetadata = [
|
|
1938
1938
|
generateParamConfigMetadata('idOrName', true, 0 /* UrlParameter */, 0 /* String */),
|
|
1939
1939
|
generateParamConfigMetadata('description', true, 2 /* Body */, 4 /* Unsupported */),
|
|
@@ -1947,11 +1947,11 @@ const updatePersonalizationPoint_ConfigPropertyMetadata = [
|
|
|
1947
1947
|
generateParamConfigMetadata('schemaName', true, 2 /* Body */, 4 /* Unsupported */),
|
|
1948
1948
|
generateParamConfigMetadata('source', true, 2 /* Body */, 0 /* String */),
|
|
1949
1949
|
];
|
|
1950
|
-
const updatePersonalizationPoint_ConfigPropertyNames = /*#__PURE__*/ buildAdapterValidationConfig(adapterName, updatePersonalizationPoint_ConfigPropertyMetadata);
|
|
1951
|
-
const createResourceParams = /*#__PURE__*/ createResourceParams$
|
|
1952
|
-
function typeCheckConfig(untrustedConfig) {
|
|
1950
|
+
const updatePersonalizationPoint_ConfigPropertyNames = /*#__PURE__*/ buildAdapterValidationConfig(adapterName$3, updatePersonalizationPoint_ConfigPropertyMetadata);
|
|
1951
|
+
const createResourceParams$3 = /*#__PURE__*/ createResourceParams$7(updatePersonalizationPoint_ConfigPropertyMetadata);
|
|
1952
|
+
function typeCheckConfig$3(untrustedConfig) {
|
|
1953
1953
|
const config = {};
|
|
1954
|
-
typeCheckConfig$
|
|
1954
|
+
typeCheckConfig$7(untrustedConfig, config, updatePersonalizationPoint_ConfigPropertyMetadata);
|
|
1955
1955
|
const untrustedConfig_description = untrustedConfig.description;
|
|
1956
1956
|
if (typeof untrustedConfig_description === 'string') {
|
|
1957
1957
|
config.description = untrustedConfig_description;
|
|
@@ -1992,7 +1992,7 @@ function typeCheckConfig(untrustedConfig) {
|
|
|
1992
1992
|
const untrustedConfig_decisions_array = [];
|
|
1993
1993
|
for (let i = 0, arrayLength = untrustedConfig_decisions.length; i < arrayLength; i++) {
|
|
1994
1994
|
const untrustedConfig_decisions_item = untrustedConfig_decisions[i];
|
|
1995
|
-
const referencePersonalizationDecisionInputRepresentationValidationError = validate$
|
|
1995
|
+
const referencePersonalizationDecisionInputRepresentationValidationError = validate$6(untrustedConfig_decisions_item);
|
|
1996
1996
|
if (referencePersonalizationDecisionInputRepresentationValidationError === null) {
|
|
1997
1997
|
untrustedConfig_decisions_array.push(untrustedConfig_decisions_item);
|
|
1998
1998
|
}
|
|
@@ -2022,30 +2022,30 @@ function typeCheckConfig(untrustedConfig) {
|
|
|
2022
2022
|
}
|
|
2023
2023
|
return config;
|
|
2024
2024
|
}
|
|
2025
|
-
function validateAdapterConfig(untrustedConfig, configPropertyNames) {
|
|
2025
|
+
function validateAdapterConfig$3(untrustedConfig, configPropertyNames) {
|
|
2026
2026
|
if (!untrustedIsObject(untrustedConfig)) {
|
|
2027
2027
|
return null;
|
|
2028
2028
|
}
|
|
2029
2029
|
if (process.env.NODE_ENV !== 'production') {
|
|
2030
2030
|
validateConfig(untrustedConfig, configPropertyNames);
|
|
2031
2031
|
}
|
|
2032
|
-
const config = typeCheckConfig(untrustedConfig);
|
|
2032
|
+
const config = typeCheckConfig$3(untrustedConfig);
|
|
2033
2033
|
if (!areRequiredParametersPresent(config, configPropertyNames)) {
|
|
2034
2034
|
return null;
|
|
2035
2035
|
}
|
|
2036
2036
|
return config;
|
|
2037
2037
|
}
|
|
2038
|
-
function buildNetworkSnapshot(luvio, config, options) {
|
|
2039
|
-
const resourceParams = createResourceParams(config);
|
|
2040
|
-
const request = createResourceRequest(resourceParams);
|
|
2038
|
+
function buildNetworkSnapshot$3(luvio, config, options) {
|
|
2039
|
+
const resourceParams = createResourceParams$3(config);
|
|
2040
|
+
const request = createResourceRequest$3(resourceParams);
|
|
2041
2041
|
return luvio.dispatchResourceRequest(request, options)
|
|
2042
2042
|
.then((response) => {
|
|
2043
2043
|
return luvio.handleSuccessResponse(() => {
|
|
2044
|
-
const snapshot = ingestSuccess(luvio, resourceParams, response);
|
|
2044
|
+
const snapshot = ingestSuccess$2(luvio, resourceParams, response);
|
|
2045
2045
|
return luvio.storeBroadcast().then(() => snapshot);
|
|
2046
2046
|
}, () => {
|
|
2047
2047
|
const cache = new StoreKeyMap();
|
|
2048
|
-
getResponseCacheKeys(cache, luvio, resourceParams, response.body);
|
|
2048
|
+
getResponseCacheKeys$3(cache, luvio, resourceParams, response.body);
|
|
2049
2049
|
return cache;
|
|
2050
2050
|
});
|
|
2051
2051
|
}, (response) => {
|
|
@@ -2055,13 +2055,907 @@ function buildNetworkSnapshot(luvio, config, options) {
|
|
|
2055
2055
|
}
|
|
2056
2056
|
const updatePersonalizationPointAdapterFactory = (luvio) => {
|
|
2057
2057
|
return function updatePersonalizationPoint(untrustedConfig) {
|
|
2058
|
-
const config = validateAdapterConfig(untrustedConfig, updatePersonalizationPoint_ConfigPropertyNames);
|
|
2058
|
+
const config = validateAdapterConfig$3(untrustedConfig, updatePersonalizationPoint_ConfigPropertyNames);
|
|
2059
2059
|
// Invalid or incomplete config
|
|
2060
2060
|
if (config === null) {
|
|
2061
2061
|
throw new Error('Invalid config for "updatePersonalizationPoint"');
|
|
2062
2062
|
}
|
|
2063
|
-
return buildNetworkSnapshot(luvio, config);
|
|
2063
|
+
return buildNetworkSnapshot$3(luvio, config);
|
|
2064
|
+
};
|
|
2065
|
+
};
|
|
2066
|
+
|
|
2067
|
+
function validate$2(obj, path = 'PersonalizationAttributeInputRepresentation') {
|
|
2068
|
+
const v_error = (() => {
|
|
2069
|
+
if (typeof obj !== 'object' || ArrayIsArray(obj) || obj === null) {
|
|
2070
|
+
return new TypeError('Expected "object" but received "' + typeof obj + '" (at "' + path + '")');
|
|
2071
|
+
}
|
|
2072
|
+
const obj_defaultValue = obj.defaultValue;
|
|
2073
|
+
const path_defaultValue = path + '.defaultValue';
|
|
2074
|
+
let obj_defaultValue_union0 = null;
|
|
2075
|
+
const obj_defaultValue_union0_error = (() => {
|
|
2076
|
+
if (typeof obj_defaultValue !== 'string') {
|
|
2077
|
+
return new TypeError('Expected "string" but received "' + typeof obj_defaultValue + '" (at "' + path_defaultValue + '")');
|
|
2078
|
+
}
|
|
2079
|
+
})();
|
|
2080
|
+
if (obj_defaultValue_union0_error != null) {
|
|
2081
|
+
obj_defaultValue_union0 = obj_defaultValue_union0_error.message;
|
|
2082
|
+
}
|
|
2083
|
+
let obj_defaultValue_union1 = null;
|
|
2084
|
+
const obj_defaultValue_union1_error = (() => {
|
|
2085
|
+
if (obj_defaultValue !== null) {
|
|
2086
|
+
return new TypeError('Expected "null" but received "' + typeof obj_defaultValue + '" (at "' + path_defaultValue + '")');
|
|
2087
|
+
}
|
|
2088
|
+
})();
|
|
2089
|
+
if (obj_defaultValue_union1_error != null) {
|
|
2090
|
+
obj_defaultValue_union1 = obj_defaultValue_union1_error.message;
|
|
2091
|
+
}
|
|
2092
|
+
if (obj_defaultValue_union0 && obj_defaultValue_union1) {
|
|
2093
|
+
let message = 'Object doesn\'t match union (at "' + path_defaultValue + '")';
|
|
2094
|
+
message += '\n' + obj_defaultValue_union0.split('\n').map((line) => '\t' + line).join('\n');
|
|
2095
|
+
message += '\n' + obj_defaultValue_union1.split('\n').map((line) => '\t' + line).join('\n');
|
|
2096
|
+
return new TypeError(message);
|
|
2097
|
+
}
|
|
2098
|
+
const obj_label = obj.label;
|
|
2099
|
+
const path_label = path + '.label';
|
|
2100
|
+
if (typeof obj_label !== 'string') {
|
|
2101
|
+
return new TypeError('Expected "string" but received "' + typeof obj_label + '" (at "' + path_label + '")');
|
|
2102
|
+
}
|
|
2103
|
+
const obj_name = obj.name;
|
|
2104
|
+
const path_name = path + '.name';
|
|
2105
|
+
if (typeof obj_name !== 'string') {
|
|
2106
|
+
return new TypeError('Expected "string" but received "' + typeof obj_name + '" (at "' + path_name + '")');
|
|
2107
|
+
}
|
|
2108
|
+
})();
|
|
2109
|
+
return v_error === undefined ? null : v_error;
|
|
2110
|
+
}
|
|
2111
|
+
|
|
2112
|
+
const VERSION$1 = "014064b188ff923423af6301d64be36a";
|
|
2113
|
+
function validate$1(obj, path = 'PersonalizationAttributeRepresentation') {
|
|
2114
|
+
const v_error = (() => {
|
|
2115
|
+
if (typeof obj !== 'object' || ArrayIsArray(obj) || obj === null) {
|
|
2116
|
+
return new TypeError('Expected "object" but received "' + typeof obj + '" (at "' + path + '")');
|
|
2117
|
+
}
|
|
2118
|
+
const obj_createdById = obj.createdById;
|
|
2119
|
+
const path_createdById = path + '.createdById';
|
|
2120
|
+
if (typeof obj_createdById !== 'string') {
|
|
2121
|
+
return new TypeError('Expected "string" but received "' + typeof obj_createdById + '" (at "' + path_createdById + '")');
|
|
2122
|
+
}
|
|
2123
|
+
const obj_createdDate = obj.createdDate;
|
|
2124
|
+
const path_createdDate = path + '.createdDate';
|
|
2125
|
+
if (typeof obj_createdDate !== 'string') {
|
|
2126
|
+
return new TypeError('Expected "string" but received "' + typeof obj_createdDate + '" (at "' + path_createdDate + '")');
|
|
2127
|
+
}
|
|
2128
|
+
const obj_defaultValue = obj.defaultValue;
|
|
2129
|
+
const path_defaultValue = path + '.defaultValue';
|
|
2130
|
+
let obj_defaultValue_union0 = null;
|
|
2131
|
+
const obj_defaultValue_union0_error = (() => {
|
|
2132
|
+
if (typeof obj_defaultValue !== 'string') {
|
|
2133
|
+
return new TypeError('Expected "string" but received "' + typeof obj_defaultValue + '" (at "' + path_defaultValue + '")');
|
|
2134
|
+
}
|
|
2135
|
+
})();
|
|
2136
|
+
if (obj_defaultValue_union0_error != null) {
|
|
2137
|
+
obj_defaultValue_union0 = obj_defaultValue_union0_error.message;
|
|
2138
|
+
}
|
|
2139
|
+
let obj_defaultValue_union1 = null;
|
|
2140
|
+
const obj_defaultValue_union1_error = (() => {
|
|
2141
|
+
if (obj_defaultValue !== null) {
|
|
2142
|
+
return new TypeError('Expected "null" but received "' + typeof obj_defaultValue + '" (at "' + path_defaultValue + '")');
|
|
2143
|
+
}
|
|
2144
|
+
})();
|
|
2145
|
+
if (obj_defaultValue_union1_error != null) {
|
|
2146
|
+
obj_defaultValue_union1 = obj_defaultValue_union1_error.message;
|
|
2147
|
+
}
|
|
2148
|
+
if (obj_defaultValue_union0 && obj_defaultValue_union1) {
|
|
2149
|
+
let message = 'Object doesn\'t match union (at "' + path_defaultValue + '")';
|
|
2150
|
+
message += '\n' + obj_defaultValue_union0.split('\n').map((line) => '\t' + line).join('\n');
|
|
2151
|
+
message += '\n' + obj_defaultValue_union1.split('\n').map((line) => '\t' + line).join('\n');
|
|
2152
|
+
return new TypeError(message);
|
|
2153
|
+
}
|
|
2154
|
+
const obj_id = obj.id;
|
|
2155
|
+
const path_id = path + '.id';
|
|
2156
|
+
if (typeof obj_id !== 'string') {
|
|
2157
|
+
return new TypeError('Expected "string" but received "' + typeof obj_id + '" (at "' + path_id + '")');
|
|
2158
|
+
}
|
|
2159
|
+
const obj_label = obj.label;
|
|
2160
|
+
const path_label = path + '.label';
|
|
2161
|
+
if (typeof obj_label !== 'string') {
|
|
2162
|
+
return new TypeError('Expected "string" but received "' + typeof obj_label + '" (at "' + path_label + '")');
|
|
2163
|
+
}
|
|
2164
|
+
const obj_lastModifiedById = obj.lastModifiedById;
|
|
2165
|
+
const path_lastModifiedById = path + '.lastModifiedById';
|
|
2166
|
+
if (typeof obj_lastModifiedById !== 'string') {
|
|
2167
|
+
return new TypeError('Expected "string" but received "' + typeof obj_lastModifiedById + '" (at "' + path_lastModifiedById + '")');
|
|
2168
|
+
}
|
|
2169
|
+
const obj_lastModifiedDate = obj.lastModifiedDate;
|
|
2170
|
+
const path_lastModifiedDate = path + '.lastModifiedDate';
|
|
2171
|
+
if (typeof obj_lastModifiedDate !== 'string') {
|
|
2172
|
+
return new TypeError('Expected "string" but received "' + typeof obj_lastModifiedDate + '" (at "' + path_lastModifiedDate + '")');
|
|
2173
|
+
}
|
|
2174
|
+
const obj_name = obj.name;
|
|
2175
|
+
const path_name = path + '.name';
|
|
2176
|
+
if (typeof obj_name !== 'string') {
|
|
2177
|
+
return new TypeError('Expected "string" but received "' + typeof obj_name + '" (at "' + path_name + '")');
|
|
2178
|
+
}
|
|
2179
|
+
const obj_url = obj.url;
|
|
2180
|
+
const path_url = path + '.url';
|
|
2181
|
+
let obj_url_union0 = null;
|
|
2182
|
+
const obj_url_union0_error = (() => {
|
|
2183
|
+
if (typeof obj_url !== 'string') {
|
|
2184
|
+
return new TypeError('Expected "string" but received "' + typeof obj_url + '" (at "' + path_url + '")');
|
|
2185
|
+
}
|
|
2186
|
+
})();
|
|
2187
|
+
if (obj_url_union0_error != null) {
|
|
2188
|
+
obj_url_union0 = obj_url_union0_error.message;
|
|
2189
|
+
}
|
|
2190
|
+
let obj_url_union1 = null;
|
|
2191
|
+
const obj_url_union1_error = (() => {
|
|
2192
|
+
if (obj_url !== null) {
|
|
2193
|
+
return new TypeError('Expected "null" but received "' + typeof obj_url + '" (at "' + path_url + '")');
|
|
2194
|
+
}
|
|
2195
|
+
})();
|
|
2196
|
+
if (obj_url_union1_error != null) {
|
|
2197
|
+
obj_url_union1 = obj_url_union1_error.message;
|
|
2198
|
+
}
|
|
2199
|
+
if (obj_url_union0 && obj_url_union1) {
|
|
2200
|
+
let message = 'Object doesn\'t match union (at "' + path_url + '")';
|
|
2201
|
+
message += '\n' + obj_url_union0.split('\n').map((line) => '\t' + line).join('\n');
|
|
2202
|
+
message += '\n' + obj_url_union1.split('\n').map((line) => '\t' + line).join('\n');
|
|
2203
|
+
return new TypeError(message);
|
|
2204
|
+
}
|
|
2205
|
+
})();
|
|
2206
|
+
return v_error === undefined ? null : v_error;
|
|
2207
|
+
}
|
|
2208
|
+
const select$3 = function PersonalizationAttributeRepresentationSelect() {
|
|
2209
|
+
return {
|
|
2210
|
+
kind: 'Fragment',
|
|
2211
|
+
version: VERSION$1,
|
|
2212
|
+
private: [],
|
|
2213
|
+
selections: [
|
|
2214
|
+
{
|
|
2215
|
+
name: 'createdById',
|
|
2216
|
+
kind: 'Scalar'
|
|
2217
|
+
},
|
|
2218
|
+
{
|
|
2219
|
+
name: 'createdDate',
|
|
2220
|
+
kind: 'Scalar'
|
|
2221
|
+
},
|
|
2222
|
+
{
|
|
2223
|
+
name: 'defaultValue',
|
|
2224
|
+
kind: 'Scalar'
|
|
2225
|
+
},
|
|
2226
|
+
{
|
|
2227
|
+
name: 'id',
|
|
2228
|
+
kind: 'Scalar'
|
|
2229
|
+
},
|
|
2230
|
+
{
|
|
2231
|
+
name: 'label',
|
|
2232
|
+
kind: 'Scalar'
|
|
2233
|
+
},
|
|
2234
|
+
{
|
|
2235
|
+
name: 'lastModifiedById',
|
|
2236
|
+
kind: 'Scalar'
|
|
2237
|
+
},
|
|
2238
|
+
{
|
|
2239
|
+
name: 'lastModifiedDate',
|
|
2240
|
+
kind: 'Scalar'
|
|
2241
|
+
},
|
|
2242
|
+
{
|
|
2243
|
+
name: 'name',
|
|
2244
|
+
kind: 'Scalar'
|
|
2245
|
+
},
|
|
2246
|
+
{
|
|
2247
|
+
name: 'url',
|
|
2248
|
+
kind: 'Scalar'
|
|
2249
|
+
}
|
|
2250
|
+
]
|
|
2064
2251
|
};
|
|
2065
2252
|
};
|
|
2253
|
+
function equals$1(existing, incoming) {
|
|
2254
|
+
const existing_createdById = existing.createdById;
|
|
2255
|
+
const incoming_createdById = incoming.createdById;
|
|
2256
|
+
if (!(existing_createdById === incoming_createdById)) {
|
|
2257
|
+
return false;
|
|
2258
|
+
}
|
|
2259
|
+
const existing_createdDate = existing.createdDate;
|
|
2260
|
+
const incoming_createdDate = incoming.createdDate;
|
|
2261
|
+
if (!(existing_createdDate === incoming_createdDate)) {
|
|
2262
|
+
return false;
|
|
2263
|
+
}
|
|
2264
|
+
const existing_id = existing.id;
|
|
2265
|
+
const incoming_id = incoming.id;
|
|
2266
|
+
if (!(existing_id === incoming_id)) {
|
|
2267
|
+
return false;
|
|
2268
|
+
}
|
|
2269
|
+
const existing_label = existing.label;
|
|
2270
|
+
const incoming_label = incoming.label;
|
|
2271
|
+
if (!(existing_label === incoming_label)) {
|
|
2272
|
+
return false;
|
|
2273
|
+
}
|
|
2274
|
+
const existing_lastModifiedById = existing.lastModifiedById;
|
|
2275
|
+
const incoming_lastModifiedById = incoming.lastModifiedById;
|
|
2276
|
+
if (!(existing_lastModifiedById === incoming_lastModifiedById)) {
|
|
2277
|
+
return false;
|
|
2278
|
+
}
|
|
2279
|
+
const existing_lastModifiedDate = existing.lastModifiedDate;
|
|
2280
|
+
const incoming_lastModifiedDate = incoming.lastModifiedDate;
|
|
2281
|
+
if (!(existing_lastModifiedDate === incoming_lastModifiedDate)) {
|
|
2282
|
+
return false;
|
|
2283
|
+
}
|
|
2284
|
+
const existing_name = existing.name;
|
|
2285
|
+
const incoming_name = incoming.name;
|
|
2286
|
+
if (!(existing_name === incoming_name)) {
|
|
2287
|
+
return false;
|
|
2288
|
+
}
|
|
2289
|
+
const existing_defaultValue = existing.defaultValue;
|
|
2290
|
+
const incoming_defaultValue = incoming.defaultValue;
|
|
2291
|
+
if (!(existing_defaultValue === incoming_defaultValue)) {
|
|
2292
|
+
return false;
|
|
2293
|
+
}
|
|
2294
|
+
const existing_url = existing.url;
|
|
2295
|
+
const incoming_url = incoming.url;
|
|
2296
|
+
if (!(existing_url === incoming_url)) {
|
|
2297
|
+
return false;
|
|
2298
|
+
}
|
|
2299
|
+
return true;
|
|
2300
|
+
}
|
|
2301
|
+
|
|
2302
|
+
const TTL = 600;
|
|
2303
|
+
const VERSION = "5af63dda9547f61a93c8ca2ee190887f";
|
|
2304
|
+
function validate(obj, path = 'PersonalizationSchemaRepresentation') {
|
|
2305
|
+
const v_error = (() => {
|
|
2306
|
+
if (typeof obj !== 'object' || ArrayIsArray(obj) || obj === null) {
|
|
2307
|
+
return new TypeError('Expected "object" but received "' + typeof obj + '" (at "' + path + '")');
|
|
2308
|
+
}
|
|
2309
|
+
const obj_attributes = obj.attributes;
|
|
2310
|
+
const path_attributes = path + '.attributes';
|
|
2311
|
+
if (!ArrayIsArray(obj_attributes)) {
|
|
2312
|
+
return new TypeError('Expected "array" but received "' + typeof obj_attributes + '" (at "' + path_attributes + '")');
|
|
2313
|
+
}
|
|
2314
|
+
for (let i = 0; i < obj_attributes.length; i++) {
|
|
2315
|
+
const obj_attributes_item = obj_attributes[i];
|
|
2316
|
+
const path_attributes_item = path_attributes + '[' + i + ']';
|
|
2317
|
+
const referencepath_attributes_itemValidationError = validate$1(obj_attributes_item, path_attributes_item);
|
|
2318
|
+
if (referencepath_attributes_itemValidationError !== null) {
|
|
2319
|
+
let message = 'Object doesn\'t match PersonalizationAttributeRepresentation (at "' + path_attributes_item + '")\n';
|
|
2320
|
+
message += referencepath_attributes_itemValidationError.message.split('\n').map((line) => '\t' + line).join('\n');
|
|
2321
|
+
return new TypeError(message);
|
|
2322
|
+
}
|
|
2323
|
+
}
|
|
2324
|
+
const obj_contentObjectName = obj.contentObjectName;
|
|
2325
|
+
const path_contentObjectName = path + '.contentObjectName';
|
|
2326
|
+
let obj_contentObjectName_union0 = null;
|
|
2327
|
+
const obj_contentObjectName_union0_error = (() => {
|
|
2328
|
+
if (typeof obj_contentObjectName !== 'string') {
|
|
2329
|
+
return new TypeError('Expected "string" but received "' + typeof obj_contentObjectName + '" (at "' + path_contentObjectName + '")');
|
|
2330
|
+
}
|
|
2331
|
+
})();
|
|
2332
|
+
if (obj_contentObjectName_union0_error != null) {
|
|
2333
|
+
obj_contentObjectName_union0 = obj_contentObjectName_union0_error.message;
|
|
2334
|
+
}
|
|
2335
|
+
let obj_contentObjectName_union1 = null;
|
|
2336
|
+
const obj_contentObjectName_union1_error = (() => {
|
|
2337
|
+
if (obj_contentObjectName !== null) {
|
|
2338
|
+
return new TypeError('Expected "null" but received "' + typeof obj_contentObjectName + '" (at "' + path_contentObjectName + '")');
|
|
2339
|
+
}
|
|
2340
|
+
})();
|
|
2341
|
+
if (obj_contentObjectName_union1_error != null) {
|
|
2342
|
+
obj_contentObjectName_union1 = obj_contentObjectName_union1_error.message;
|
|
2343
|
+
}
|
|
2344
|
+
if (obj_contentObjectName_union0 && obj_contentObjectName_union1) {
|
|
2345
|
+
let message = 'Object doesn\'t match union (at "' + path_contentObjectName + '")';
|
|
2346
|
+
message += '\n' + obj_contentObjectName_union0.split('\n').map((line) => '\t' + line).join('\n');
|
|
2347
|
+
message += '\n' + obj_contentObjectName_union1.split('\n').map((line) => '\t' + line).join('\n');
|
|
2348
|
+
return new TypeError(message);
|
|
2349
|
+
}
|
|
2350
|
+
const obj_createdById = obj.createdById;
|
|
2351
|
+
const path_createdById = path + '.createdById';
|
|
2352
|
+
if (typeof obj_createdById !== 'string') {
|
|
2353
|
+
return new TypeError('Expected "string" but received "' + typeof obj_createdById + '" (at "' + path_createdById + '")');
|
|
2354
|
+
}
|
|
2355
|
+
const obj_createdDate = obj.createdDate;
|
|
2356
|
+
const path_createdDate = path + '.createdDate';
|
|
2357
|
+
if (typeof obj_createdDate !== 'string') {
|
|
2358
|
+
return new TypeError('Expected "string" but received "' + typeof obj_createdDate + '" (at "' + path_createdDate + '")');
|
|
2359
|
+
}
|
|
2360
|
+
const obj_dataSpaceName = obj.dataSpaceName;
|
|
2361
|
+
const path_dataSpaceName = path + '.dataSpaceName';
|
|
2362
|
+
if (typeof obj_dataSpaceName !== 'string') {
|
|
2363
|
+
return new TypeError('Expected "string" but received "' + typeof obj_dataSpaceName + '" (at "' + path_dataSpaceName + '")');
|
|
2364
|
+
}
|
|
2365
|
+
const obj_description = obj.description;
|
|
2366
|
+
const path_description = path + '.description';
|
|
2367
|
+
let obj_description_union0 = null;
|
|
2368
|
+
const obj_description_union0_error = (() => {
|
|
2369
|
+
if (typeof obj_description !== 'string') {
|
|
2370
|
+
return new TypeError('Expected "string" but received "' + typeof obj_description + '" (at "' + path_description + '")');
|
|
2371
|
+
}
|
|
2372
|
+
})();
|
|
2373
|
+
if (obj_description_union0_error != null) {
|
|
2374
|
+
obj_description_union0 = obj_description_union0_error.message;
|
|
2375
|
+
}
|
|
2376
|
+
let obj_description_union1 = null;
|
|
2377
|
+
const obj_description_union1_error = (() => {
|
|
2378
|
+
if (obj_description !== null) {
|
|
2379
|
+
return new TypeError('Expected "null" but received "' + typeof obj_description + '" (at "' + path_description + '")');
|
|
2380
|
+
}
|
|
2381
|
+
})();
|
|
2382
|
+
if (obj_description_union1_error != null) {
|
|
2383
|
+
obj_description_union1 = obj_description_union1_error.message;
|
|
2384
|
+
}
|
|
2385
|
+
if (obj_description_union0 && obj_description_union1) {
|
|
2386
|
+
let message = 'Object doesn\'t match union (at "' + path_description + '")';
|
|
2387
|
+
message += '\n' + obj_description_union0.split('\n').map((line) => '\t' + line).join('\n');
|
|
2388
|
+
message += '\n' + obj_description_union1.split('\n').map((line) => '\t' + line).join('\n');
|
|
2389
|
+
return new TypeError(message);
|
|
2390
|
+
}
|
|
2391
|
+
const obj_id = obj.id;
|
|
2392
|
+
const path_id = path + '.id';
|
|
2393
|
+
if (typeof obj_id !== 'string') {
|
|
2394
|
+
return new TypeError('Expected "string" but received "' + typeof obj_id + '" (at "' + path_id + '")');
|
|
2395
|
+
}
|
|
2396
|
+
const obj_label = obj.label;
|
|
2397
|
+
const path_label = path + '.label';
|
|
2398
|
+
if (typeof obj_label !== 'string') {
|
|
2399
|
+
return new TypeError('Expected "string" but received "' + typeof obj_label + '" (at "' + path_label + '")');
|
|
2400
|
+
}
|
|
2401
|
+
const obj_lastModifiedById = obj.lastModifiedById;
|
|
2402
|
+
const path_lastModifiedById = path + '.lastModifiedById';
|
|
2403
|
+
if (typeof obj_lastModifiedById !== 'string') {
|
|
2404
|
+
return new TypeError('Expected "string" but received "' + typeof obj_lastModifiedById + '" (at "' + path_lastModifiedById + '")');
|
|
2405
|
+
}
|
|
2406
|
+
const obj_lastModifiedDate = obj.lastModifiedDate;
|
|
2407
|
+
const path_lastModifiedDate = path + '.lastModifiedDate';
|
|
2408
|
+
if (typeof obj_lastModifiedDate !== 'string') {
|
|
2409
|
+
return new TypeError('Expected "string" but received "' + typeof obj_lastModifiedDate + '" (at "' + path_lastModifiedDate + '")');
|
|
2410
|
+
}
|
|
2411
|
+
const obj_name = obj.name;
|
|
2412
|
+
const path_name = path + '.name';
|
|
2413
|
+
if (typeof obj_name !== 'string') {
|
|
2414
|
+
return new TypeError('Expected "string" but received "' + typeof obj_name + '" (at "' + path_name + '")');
|
|
2415
|
+
}
|
|
2416
|
+
const obj_personalizationType = obj.personalizationType;
|
|
2417
|
+
const path_personalizationType = path + '.personalizationType';
|
|
2418
|
+
if (typeof obj_personalizationType !== 'string') {
|
|
2419
|
+
return new TypeError('Expected "string" but received "' + typeof obj_personalizationType + '" (at "' + path_personalizationType + '")');
|
|
2420
|
+
}
|
|
2421
|
+
const obj_url = obj.url;
|
|
2422
|
+
const path_url = path + '.url';
|
|
2423
|
+
if (typeof obj_url !== 'string') {
|
|
2424
|
+
return new TypeError('Expected "string" but received "' + typeof obj_url + '" (at "' + path_url + '")');
|
|
2425
|
+
}
|
|
2426
|
+
})();
|
|
2427
|
+
return v_error === undefined ? null : v_error;
|
|
2428
|
+
}
|
|
2429
|
+
const RepresentationType = 'PersonalizationSchemaRepresentation';
|
|
2430
|
+
function keyBuilder$3(luvio, config) {
|
|
2431
|
+
return keyPrefix + '::' + RepresentationType + ':' + config.id;
|
|
2432
|
+
}
|
|
2433
|
+
function keyBuilderFromType(luvio, object) {
|
|
2434
|
+
const keyParams = {
|
|
2435
|
+
id: object.name
|
|
2436
|
+
};
|
|
2437
|
+
return keyBuilder$3(luvio, keyParams);
|
|
2438
|
+
}
|
|
2439
|
+
function normalize(input, existing, path, luvio, store, timestamp) {
|
|
2440
|
+
return input;
|
|
2441
|
+
}
|
|
2442
|
+
const select$2 = function PersonalizationSchemaRepresentationSelect() {
|
|
2443
|
+
const { selections: PersonalizationAttributeRepresentation__selections, opaque: PersonalizationAttributeRepresentation__opaque, } = select$3();
|
|
2444
|
+
return {
|
|
2445
|
+
kind: 'Fragment',
|
|
2446
|
+
version: VERSION,
|
|
2447
|
+
private: [],
|
|
2448
|
+
selections: [
|
|
2449
|
+
{
|
|
2450
|
+
name: 'attributes',
|
|
2451
|
+
kind: 'Object',
|
|
2452
|
+
plural: true,
|
|
2453
|
+
selections: PersonalizationAttributeRepresentation__selections
|
|
2454
|
+
},
|
|
2455
|
+
{
|
|
2456
|
+
name: 'contentObjectName',
|
|
2457
|
+
kind: 'Scalar'
|
|
2458
|
+
},
|
|
2459
|
+
{
|
|
2460
|
+
name: 'createdById',
|
|
2461
|
+
kind: 'Scalar'
|
|
2462
|
+
},
|
|
2463
|
+
{
|
|
2464
|
+
name: 'createdDate',
|
|
2465
|
+
kind: 'Scalar'
|
|
2466
|
+
},
|
|
2467
|
+
{
|
|
2468
|
+
name: 'dataSpaceName',
|
|
2469
|
+
kind: 'Scalar'
|
|
2470
|
+
},
|
|
2471
|
+
{
|
|
2472
|
+
name: 'description',
|
|
2473
|
+
kind: 'Scalar'
|
|
2474
|
+
},
|
|
2475
|
+
{
|
|
2476
|
+
name: 'id',
|
|
2477
|
+
kind: 'Scalar'
|
|
2478
|
+
},
|
|
2479
|
+
{
|
|
2480
|
+
name: 'label',
|
|
2481
|
+
kind: 'Scalar'
|
|
2482
|
+
},
|
|
2483
|
+
{
|
|
2484
|
+
name: 'lastModifiedById',
|
|
2485
|
+
kind: 'Scalar'
|
|
2486
|
+
},
|
|
2487
|
+
{
|
|
2488
|
+
name: 'lastModifiedDate',
|
|
2489
|
+
kind: 'Scalar'
|
|
2490
|
+
},
|
|
2491
|
+
{
|
|
2492
|
+
name: 'name',
|
|
2493
|
+
kind: 'Scalar'
|
|
2494
|
+
},
|
|
2495
|
+
{
|
|
2496
|
+
name: 'personalizationType',
|
|
2497
|
+
kind: 'Scalar'
|
|
2498
|
+
},
|
|
2499
|
+
{
|
|
2500
|
+
name: 'url',
|
|
2501
|
+
kind: 'Scalar'
|
|
2502
|
+
}
|
|
2503
|
+
]
|
|
2504
|
+
};
|
|
2505
|
+
};
|
|
2506
|
+
function equals(existing, incoming) {
|
|
2507
|
+
const existing_createdById = existing.createdById;
|
|
2508
|
+
const incoming_createdById = incoming.createdById;
|
|
2509
|
+
if (!(existing_createdById === incoming_createdById)) {
|
|
2510
|
+
return false;
|
|
2511
|
+
}
|
|
2512
|
+
const existing_createdDate = existing.createdDate;
|
|
2513
|
+
const incoming_createdDate = incoming.createdDate;
|
|
2514
|
+
if (!(existing_createdDate === incoming_createdDate)) {
|
|
2515
|
+
return false;
|
|
2516
|
+
}
|
|
2517
|
+
const existing_dataSpaceName = existing.dataSpaceName;
|
|
2518
|
+
const incoming_dataSpaceName = incoming.dataSpaceName;
|
|
2519
|
+
if (!(existing_dataSpaceName === incoming_dataSpaceName)) {
|
|
2520
|
+
return false;
|
|
2521
|
+
}
|
|
2522
|
+
const existing_id = existing.id;
|
|
2523
|
+
const incoming_id = incoming.id;
|
|
2524
|
+
if (!(existing_id === incoming_id)) {
|
|
2525
|
+
return false;
|
|
2526
|
+
}
|
|
2527
|
+
const existing_label = existing.label;
|
|
2528
|
+
const incoming_label = incoming.label;
|
|
2529
|
+
if (!(existing_label === incoming_label)) {
|
|
2530
|
+
return false;
|
|
2531
|
+
}
|
|
2532
|
+
const existing_lastModifiedById = existing.lastModifiedById;
|
|
2533
|
+
const incoming_lastModifiedById = incoming.lastModifiedById;
|
|
2534
|
+
if (!(existing_lastModifiedById === incoming_lastModifiedById)) {
|
|
2535
|
+
return false;
|
|
2536
|
+
}
|
|
2537
|
+
const existing_lastModifiedDate = existing.lastModifiedDate;
|
|
2538
|
+
const incoming_lastModifiedDate = incoming.lastModifiedDate;
|
|
2539
|
+
if (!(existing_lastModifiedDate === incoming_lastModifiedDate)) {
|
|
2540
|
+
return false;
|
|
2541
|
+
}
|
|
2542
|
+
const existing_name = existing.name;
|
|
2543
|
+
const incoming_name = incoming.name;
|
|
2544
|
+
if (!(existing_name === incoming_name)) {
|
|
2545
|
+
return false;
|
|
2546
|
+
}
|
|
2547
|
+
const existing_personalizationType = existing.personalizationType;
|
|
2548
|
+
const incoming_personalizationType = incoming.personalizationType;
|
|
2549
|
+
if (!(existing_personalizationType === incoming_personalizationType)) {
|
|
2550
|
+
return false;
|
|
2551
|
+
}
|
|
2552
|
+
const existing_url = existing.url;
|
|
2553
|
+
const incoming_url = incoming.url;
|
|
2554
|
+
if (!(existing_url === incoming_url)) {
|
|
2555
|
+
return false;
|
|
2556
|
+
}
|
|
2557
|
+
const existing_attributes = existing.attributes;
|
|
2558
|
+
const incoming_attributes = incoming.attributes;
|
|
2559
|
+
const equals_attributes_items = equalsArray(existing_attributes, incoming_attributes, (existing_attributes_item, incoming_attributes_item) => {
|
|
2560
|
+
if (!(equals$1(existing_attributes_item, incoming_attributes_item))) {
|
|
2561
|
+
return false;
|
|
2562
|
+
}
|
|
2563
|
+
});
|
|
2564
|
+
if (equals_attributes_items === false) {
|
|
2565
|
+
return false;
|
|
2566
|
+
}
|
|
2567
|
+
const existing_contentObjectName = existing.contentObjectName;
|
|
2568
|
+
const incoming_contentObjectName = incoming.contentObjectName;
|
|
2569
|
+
if (!(existing_contentObjectName === incoming_contentObjectName)) {
|
|
2570
|
+
return false;
|
|
2571
|
+
}
|
|
2572
|
+
const existing_description = existing.description;
|
|
2573
|
+
const incoming_description = incoming.description;
|
|
2574
|
+
if (!(existing_description === incoming_description)) {
|
|
2575
|
+
return false;
|
|
2576
|
+
}
|
|
2577
|
+
return true;
|
|
2578
|
+
}
|
|
2579
|
+
const ingest = function PersonalizationSchemaRepresentationIngest(input, path, luvio, store, timestamp) {
|
|
2580
|
+
if (process.env.NODE_ENV !== 'production') {
|
|
2581
|
+
const validateError = validate(input);
|
|
2582
|
+
if (validateError !== null) {
|
|
2583
|
+
throw validateError;
|
|
2584
|
+
}
|
|
2585
|
+
}
|
|
2586
|
+
const key = keyBuilderFromType(luvio, input);
|
|
2587
|
+
const ttlToUse = TTL;
|
|
2588
|
+
ingestShape(input, path, luvio, store, timestamp, ttlToUse, key, normalize, "personalization-service", VERSION, RepresentationType, equals);
|
|
2589
|
+
return createLink(key);
|
|
2590
|
+
};
|
|
2591
|
+
function getTypeCacheKeys(rootKeySet, luvio, input, fullPathFactory) {
|
|
2592
|
+
// root cache key (uses fullPathFactory if keyBuilderFromType isn't defined)
|
|
2593
|
+
const rootKey = keyBuilderFromType(luvio, input);
|
|
2594
|
+
rootKeySet.set(rootKey, {
|
|
2595
|
+
namespace: keyPrefix,
|
|
2596
|
+
representationName: RepresentationType,
|
|
2597
|
+
mergeable: false
|
|
2598
|
+
});
|
|
2599
|
+
}
|
|
2600
|
+
|
|
2601
|
+
function select$1(luvio, params) {
|
|
2602
|
+
return select$2();
|
|
2603
|
+
}
|
|
2604
|
+
function getResponseCacheKeys$2(storeKeyMap, luvio, resourceParams, response) {
|
|
2605
|
+
getTypeCacheKeys(storeKeyMap, luvio, response);
|
|
2606
|
+
}
|
|
2607
|
+
function ingestSuccess$1(luvio, resourceParams, response) {
|
|
2608
|
+
const { body } = response;
|
|
2609
|
+
const key = keyBuilderFromType(luvio, body);
|
|
2610
|
+
luvio.storeIngest(key, ingest, body);
|
|
2611
|
+
const snapshot = luvio.storeLookup({
|
|
2612
|
+
recordId: key,
|
|
2613
|
+
node: select$1(),
|
|
2614
|
+
variables: {},
|
|
2615
|
+
});
|
|
2616
|
+
if (process.env.NODE_ENV !== 'production') {
|
|
2617
|
+
if (snapshot.state !== 'Fulfilled') {
|
|
2618
|
+
throw new Error('Invalid network response. Expected resource response to result in Fulfilled snapshot');
|
|
2619
|
+
}
|
|
2620
|
+
}
|
|
2621
|
+
deepFreeze(snapshot.data);
|
|
2622
|
+
return snapshot;
|
|
2623
|
+
}
|
|
2624
|
+
function createResourceRequest$2(config) {
|
|
2625
|
+
const headers = {};
|
|
2626
|
+
return {
|
|
2627
|
+
baseUri: '/services/data/v62.0',
|
|
2628
|
+
basePath: '/personalization/personalization-schemas',
|
|
2629
|
+
method: 'post',
|
|
2630
|
+
body: config.body,
|
|
2631
|
+
urlParams: {},
|
|
2632
|
+
queryParams: {},
|
|
2633
|
+
headers,
|
|
2634
|
+
priority: 'normal',
|
|
2635
|
+
};
|
|
2636
|
+
}
|
|
2637
|
+
|
|
2638
|
+
const adapterName$2 = 'createPersonalizationSchema';
|
|
2639
|
+
const createPersonalizationSchema_ConfigPropertyMetadata = [
|
|
2640
|
+
generateParamConfigMetadata('description', true, 2 /* Body */, 4 /* Unsupported */),
|
|
2641
|
+
generateParamConfigMetadata('label', true, 2 /* Body */, 4 /* Unsupported */),
|
|
2642
|
+
generateParamConfigMetadata('name', true, 2 /* Body */, 4 /* Unsupported */),
|
|
2643
|
+
generateParamConfigMetadata('attributes', true, 2 /* Body */, 4 /* Unsupported */, true),
|
|
2644
|
+
generateParamConfigMetadata('contentObjectName', true, 2 /* Body */, 4 /* Unsupported */),
|
|
2645
|
+
generateParamConfigMetadata('dataSpaceName', true, 2 /* Body */, 0 /* String */),
|
|
2646
|
+
generateParamConfigMetadata('personalizationType', true, 2 /* Body */, 0 /* String */),
|
|
2647
|
+
];
|
|
2648
|
+
const createPersonalizationSchema_ConfigPropertyNames = /*#__PURE__*/ buildAdapterValidationConfig(adapterName$2, createPersonalizationSchema_ConfigPropertyMetadata);
|
|
2649
|
+
const createResourceParams$2 = /*#__PURE__*/ createResourceParams$7(createPersonalizationSchema_ConfigPropertyMetadata);
|
|
2650
|
+
function typeCheckConfig$2(untrustedConfig) {
|
|
2651
|
+
const config = {};
|
|
2652
|
+
typeCheckConfig$7(untrustedConfig, config, createPersonalizationSchema_ConfigPropertyMetadata);
|
|
2653
|
+
const untrustedConfig_description = untrustedConfig.description;
|
|
2654
|
+
if (typeof untrustedConfig_description === 'string') {
|
|
2655
|
+
config.description = untrustedConfig_description;
|
|
2656
|
+
}
|
|
2657
|
+
if (untrustedConfig_description === null) {
|
|
2658
|
+
config.description = untrustedConfig_description;
|
|
2659
|
+
}
|
|
2660
|
+
const untrustedConfig_label = untrustedConfig.label;
|
|
2661
|
+
if (typeof untrustedConfig_label === 'string') {
|
|
2662
|
+
config.label = untrustedConfig_label;
|
|
2663
|
+
}
|
|
2664
|
+
if (untrustedConfig_label === null) {
|
|
2665
|
+
config.label = untrustedConfig_label;
|
|
2666
|
+
}
|
|
2667
|
+
const untrustedConfig_name = untrustedConfig.name;
|
|
2668
|
+
if (typeof untrustedConfig_name === 'string') {
|
|
2669
|
+
config.name = untrustedConfig_name;
|
|
2670
|
+
}
|
|
2671
|
+
if (untrustedConfig_name === null) {
|
|
2672
|
+
config.name = untrustedConfig_name;
|
|
2673
|
+
}
|
|
2674
|
+
const untrustedConfig_attributes = untrustedConfig.attributes;
|
|
2675
|
+
if (ArrayIsArray$1(untrustedConfig_attributes)) {
|
|
2676
|
+
const untrustedConfig_attributes_array = [];
|
|
2677
|
+
for (let i = 0, arrayLength = untrustedConfig_attributes.length; i < arrayLength; i++) {
|
|
2678
|
+
const untrustedConfig_attributes_item = untrustedConfig_attributes[i];
|
|
2679
|
+
const referencePersonalizationAttributeInputRepresentationValidationError = validate$2(untrustedConfig_attributes_item);
|
|
2680
|
+
if (referencePersonalizationAttributeInputRepresentationValidationError === null) {
|
|
2681
|
+
untrustedConfig_attributes_array.push(untrustedConfig_attributes_item);
|
|
2682
|
+
}
|
|
2683
|
+
}
|
|
2684
|
+
config.attributes = untrustedConfig_attributes_array;
|
|
2685
|
+
}
|
|
2686
|
+
const untrustedConfig_contentObjectName = untrustedConfig.contentObjectName;
|
|
2687
|
+
if (typeof untrustedConfig_contentObjectName === 'string') {
|
|
2688
|
+
config.contentObjectName = untrustedConfig_contentObjectName;
|
|
2689
|
+
}
|
|
2690
|
+
if (untrustedConfig_contentObjectName === null) {
|
|
2691
|
+
config.contentObjectName = untrustedConfig_contentObjectName;
|
|
2692
|
+
}
|
|
2693
|
+
return config;
|
|
2694
|
+
}
|
|
2695
|
+
function validateAdapterConfig$2(untrustedConfig, configPropertyNames) {
|
|
2696
|
+
if (!untrustedIsObject(untrustedConfig)) {
|
|
2697
|
+
return null;
|
|
2698
|
+
}
|
|
2699
|
+
if (process.env.NODE_ENV !== 'production') {
|
|
2700
|
+
validateConfig(untrustedConfig, configPropertyNames);
|
|
2701
|
+
}
|
|
2702
|
+
const config = typeCheckConfig$2(untrustedConfig);
|
|
2703
|
+
if (!areRequiredParametersPresent(config, configPropertyNames)) {
|
|
2704
|
+
return null;
|
|
2705
|
+
}
|
|
2706
|
+
return config;
|
|
2707
|
+
}
|
|
2708
|
+
function buildNetworkSnapshot$2(luvio, config, options) {
|
|
2709
|
+
const resourceParams = createResourceParams$2(config);
|
|
2710
|
+
const request = createResourceRequest$2(resourceParams);
|
|
2711
|
+
return luvio.dispatchResourceRequest(request, options)
|
|
2712
|
+
.then((response) => {
|
|
2713
|
+
return luvio.handleSuccessResponse(() => {
|
|
2714
|
+
const snapshot = ingestSuccess$1(luvio, resourceParams, response);
|
|
2715
|
+
return luvio.storeBroadcast().then(() => snapshot);
|
|
2716
|
+
}, () => {
|
|
2717
|
+
const cache = new StoreKeyMap();
|
|
2718
|
+
getResponseCacheKeys$2(cache, luvio, resourceParams, response.body);
|
|
2719
|
+
return cache;
|
|
2720
|
+
});
|
|
2721
|
+
}, (response) => {
|
|
2722
|
+
deepFreeze(response);
|
|
2723
|
+
throw response;
|
|
2724
|
+
});
|
|
2725
|
+
}
|
|
2726
|
+
const createPersonalizationSchemaAdapterFactory = (luvio) => {
|
|
2727
|
+
return function createPersonalizationSchema(untrustedConfig) {
|
|
2728
|
+
const config = validateAdapterConfig$2(untrustedConfig, createPersonalizationSchema_ConfigPropertyNames);
|
|
2729
|
+
// Invalid or incomplete config
|
|
2730
|
+
if (config === null) {
|
|
2731
|
+
throw new Error('Invalid config for "createPersonalizationSchema"');
|
|
2732
|
+
}
|
|
2733
|
+
return buildNetworkSnapshot$2(luvio, config);
|
|
2734
|
+
};
|
|
2735
|
+
};
|
|
2736
|
+
|
|
2737
|
+
function keyBuilder$2(luvio, params) {
|
|
2738
|
+
return keyBuilder$3(luvio, {
|
|
2739
|
+
id: params.urlParams.idOrName
|
|
2740
|
+
});
|
|
2741
|
+
}
|
|
2742
|
+
function getResponseCacheKeys$1(cacheKeyMap, luvio, resourceParams) {
|
|
2743
|
+
const key = keyBuilder$2(luvio, resourceParams);
|
|
2744
|
+
cacheKeyMap.set(key, {
|
|
2745
|
+
namespace: keyPrefix,
|
|
2746
|
+
representationName: RepresentationType,
|
|
2747
|
+
mergeable: false
|
|
2748
|
+
});
|
|
2749
|
+
}
|
|
2750
|
+
function evictSuccess(luvio, resourceParams) {
|
|
2751
|
+
const key = keyBuilder$2(luvio, resourceParams);
|
|
2752
|
+
luvio.storeEvict(key);
|
|
2753
|
+
}
|
|
2754
|
+
function createResourceRequest$1(config) {
|
|
2755
|
+
const headers = {};
|
|
2756
|
+
return {
|
|
2757
|
+
baseUri: '/services/data/v62.0',
|
|
2758
|
+
basePath: '/personalization/personalization-schemas/' + config.urlParams.idOrName + '',
|
|
2759
|
+
method: 'delete',
|
|
2760
|
+
body: null,
|
|
2761
|
+
urlParams: config.urlParams,
|
|
2762
|
+
queryParams: {},
|
|
2763
|
+
headers,
|
|
2764
|
+
priority: 'normal',
|
|
2765
|
+
};
|
|
2766
|
+
}
|
|
2767
|
+
|
|
2768
|
+
const adapterName$1 = 'deletePersonalizationSchema';
|
|
2769
|
+
const deletePersonalizationSchema_ConfigPropertyMetadata = [
|
|
2770
|
+
generateParamConfigMetadata('idOrName', true, 0 /* UrlParameter */, 0 /* String */),
|
|
2771
|
+
];
|
|
2772
|
+
const deletePersonalizationSchema_ConfigPropertyNames = /*#__PURE__*/ buildAdapterValidationConfig(adapterName$1, deletePersonalizationSchema_ConfigPropertyMetadata);
|
|
2773
|
+
const createResourceParams$1 = /*#__PURE__*/ createResourceParams$7(deletePersonalizationSchema_ConfigPropertyMetadata);
|
|
2774
|
+
function typeCheckConfig$1(untrustedConfig) {
|
|
2775
|
+
const config = {};
|
|
2776
|
+
typeCheckConfig$7(untrustedConfig, config, deletePersonalizationSchema_ConfigPropertyMetadata);
|
|
2777
|
+
return config;
|
|
2778
|
+
}
|
|
2779
|
+
function validateAdapterConfig$1(untrustedConfig, configPropertyNames) {
|
|
2780
|
+
if (!untrustedIsObject(untrustedConfig)) {
|
|
2781
|
+
return null;
|
|
2782
|
+
}
|
|
2783
|
+
if (process.env.NODE_ENV !== 'production') {
|
|
2784
|
+
validateConfig(untrustedConfig, configPropertyNames);
|
|
2785
|
+
}
|
|
2786
|
+
const config = typeCheckConfig$1(untrustedConfig);
|
|
2787
|
+
if (!areRequiredParametersPresent(config, configPropertyNames)) {
|
|
2788
|
+
return null;
|
|
2789
|
+
}
|
|
2790
|
+
return config;
|
|
2791
|
+
}
|
|
2792
|
+
function buildNetworkSnapshot$1(luvio, config, options) {
|
|
2793
|
+
const resourceParams = createResourceParams$1(config);
|
|
2794
|
+
const request = createResourceRequest$1(resourceParams);
|
|
2795
|
+
return luvio.dispatchResourceRequest(request, options)
|
|
2796
|
+
.then(() => {
|
|
2797
|
+
return luvio.handleSuccessResponse(() => {
|
|
2798
|
+
evictSuccess(luvio, resourceParams);
|
|
2799
|
+
return luvio.storeBroadcast();
|
|
2800
|
+
}, () => {
|
|
2801
|
+
const cache = new StoreKeyMap();
|
|
2802
|
+
getResponseCacheKeys$1(cache, luvio, resourceParams);
|
|
2803
|
+
return cache;
|
|
2804
|
+
});
|
|
2805
|
+
}, (response) => {
|
|
2806
|
+
deepFreeze(response);
|
|
2807
|
+
throw response;
|
|
2808
|
+
});
|
|
2809
|
+
}
|
|
2810
|
+
const deletePersonalizationSchemaAdapterFactory = (luvio) => {
|
|
2811
|
+
return function personalizationServicedeletePersonalizationSchema(untrustedConfig) {
|
|
2812
|
+
const config = validateAdapterConfig$1(untrustedConfig, deletePersonalizationSchema_ConfigPropertyNames);
|
|
2813
|
+
// Invalid or incomplete config
|
|
2814
|
+
if (config === null) {
|
|
2815
|
+
throw new Error(`Invalid config for "${adapterName$1}"`);
|
|
2816
|
+
}
|
|
2817
|
+
return buildNetworkSnapshot$1(luvio, config);
|
|
2818
|
+
};
|
|
2819
|
+
};
|
|
2820
|
+
|
|
2821
|
+
function select(luvio, params) {
|
|
2822
|
+
return select$2();
|
|
2823
|
+
}
|
|
2824
|
+
function keyBuilder$1(luvio, params) {
|
|
2825
|
+
return keyBuilder$3(luvio, {
|
|
2826
|
+
id: params.urlParams.idOrName
|
|
2827
|
+
});
|
|
2828
|
+
}
|
|
2829
|
+
function getResponseCacheKeys(storeKeyMap, luvio, resourceParams, response) {
|
|
2830
|
+
getTypeCacheKeys(storeKeyMap, luvio, response);
|
|
2831
|
+
}
|
|
2832
|
+
function ingestSuccess(luvio, resourceParams, response, snapshotRefresh) {
|
|
2833
|
+
const { body } = response;
|
|
2834
|
+
const key = keyBuilder$1(luvio, resourceParams);
|
|
2835
|
+
luvio.storeIngest(key, ingest, body);
|
|
2836
|
+
const snapshot = luvio.storeLookup({
|
|
2837
|
+
recordId: key,
|
|
2838
|
+
node: select(),
|
|
2839
|
+
variables: {},
|
|
2840
|
+
}, snapshotRefresh);
|
|
2841
|
+
if (process.env.NODE_ENV !== 'production') {
|
|
2842
|
+
if (snapshot.state !== 'Fulfilled') {
|
|
2843
|
+
throw new Error('Invalid network response. Expected resource response to result in Fulfilled snapshot');
|
|
2844
|
+
}
|
|
2845
|
+
}
|
|
2846
|
+
deepFreeze(snapshot.data);
|
|
2847
|
+
return snapshot;
|
|
2848
|
+
}
|
|
2849
|
+
function ingestError(luvio, params, error, snapshotRefresh) {
|
|
2850
|
+
const key = keyBuilder$1(luvio, params);
|
|
2851
|
+
const errorSnapshot = luvio.errorSnapshot(error, snapshotRefresh);
|
|
2852
|
+
const storeMetadataParams = {
|
|
2853
|
+
ttl: TTL,
|
|
2854
|
+
namespace: keyPrefix,
|
|
2855
|
+
version: VERSION,
|
|
2856
|
+
representationName: RepresentationType
|
|
2857
|
+
};
|
|
2858
|
+
luvio.storeIngestError(key, errorSnapshot, storeMetadataParams);
|
|
2859
|
+
return errorSnapshot;
|
|
2860
|
+
}
|
|
2861
|
+
function createResourceRequest(config) {
|
|
2862
|
+
const headers = {};
|
|
2863
|
+
return {
|
|
2864
|
+
baseUri: '/services/data/v62.0',
|
|
2865
|
+
basePath: '/personalization/personalization-schemas/' + config.urlParams.idOrName + '',
|
|
2866
|
+
method: 'get',
|
|
2867
|
+
body: null,
|
|
2868
|
+
urlParams: config.urlParams,
|
|
2869
|
+
queryParams: {},
|
|
2870
|
+
headers,
|
|
2871
|
+
priority: 'normal',
|
|
2872
|
+
};
|
|
2873
|
+
}
|
|
2874
|
+
|
|
2875
|
+
const adapterName = 'getPersonalizationSchema';
|
|
2876
|
+
const getPersonalizationSchema_ConfigPropertyMetadata = [
|
|
2877
|
+
generateParamConfigMetadata('idOrName', true, 0 /* UrlParameter */, 0 /* String */),
|
|
2878
|
+
];
|
|
2879
|
+
const getPersonalizationSchema_ConfigPropertyNames = /*#__PURE__*/ buildAdapterValidationConfig(adapterName, getPersonalizationSchema_ConfigPropertyMetadata);
|
|
2880
|
+
const createResourceParams = /*#__PURE__*/ createResourceParams$7(getPersonalizationSchema_ConfigPropertyMetadata);
|
|
2881
|
+
function keyBuilder(luvio, config) {
|
|
2882
|
+
const resourceParams = createResourceParams(config);
|
|
2883
|
+
return keyBuilder$1(luvio, resourceParams);
|
|
2884
|
+
}
|
|
2885
|
+
function typeCheckConfig(untrustedConfig) {
|
|
2886
|
+
const config = {};
|
|
2887
|
+
typeCheckConfig$7(untrustedConfig, config, getPersonalizationSchema_ConfigPropertyMetadata);
|
|
2888
|
+
return config;
|
|
2889
|
+
}
|
|
2890
|
+
function validateAdapterConfig(untrustedConfig, configPropertyNames) {
|
|
2891
|
+
if (!untrustedIsObject(untrustedConfig)) {
|
|
2892
|
+
return null;
|
|
2893
|
+
}
|
|
2894
|
+
if (process.env.NODE_ENV !== 'production') {
|
|
2895
|
+
validateConfig(untrustedConfig, configPropertyNames);
|
|
2896
|
+
}
|
|
2897
|
+
const config = typeCheckConfig(untrustedConfig);
|
|
2898
|
+
if (!areRequiredParametersPresent(config, configPropertyNames)) {
|
|
2899
|
+
return null;
|
|
2900
|
+
}
|
|
2901
|
+
return config;
|
|
2902
|
+
}
|
|
2903
|
+
function adapterFragment(luvio, config) {
|
|
2904
|
+
createResourceParams(config);
|
|
2905
|
+
return select();
|
|
2906
|
+
}
|
|
2907
|
+
function onFetchResponseSuccess(luvio, config, resourceParams, response) {
|
|
2908
|
+
const snapshot = ingestSuccess(luvio, resourceParams, response, {
|
|
2909
|
+
config,
|
|
2910
|
+
resolve: () => buildNetworkSnapshot(luvio, config, snapshotRefreshOptions)
|
|
2911
|
+
});
|
|
2912
|
+
return luvio.storeBroadcast().then(() => snapshot);
|
|
2913
|
+
}
|
|
2914
|
+
function onFetchResponseError(luvio, config, resourceParams, response) {
|
|
2915
|
+
const snapshot = ingestError(luvio, resourceParams, response, {
|
|
2916
|
+
config,
|
|
2917
|
+
resolve: () => buildNetworkSnapshot(luvio, config, snapshotRefreshOptions)
|
|
2918
|
+
});
|
|
2919
|
+
return luvio.storeBroadcast().then(() => snapshot);
|
|
2920
|
+
}
|
|
2921
|
+
function buildNetworkSnapshot(luvio, config, options) {
|
|
2922
|
+
const resourceParams = createResourceParams(config);
|
|
2923
|
+
const request = createResourceRequest(resourceParams);
|
|
2924
|
+
return luvio.dispatchResourceRequest(request, options)
|
|
2925
|
+
.then((response) => {
|
|
2926
|
+
return luvio.handleSuccessResponse(() => onFetchResponseSuccess(luvio, config, resourceParams, response), () => {
|
|
2927
|
+
const cache = new StoreKeyMap();
|
|
2928
|
+
getResponseCacheKeys(cache, luvio, resourceParams, response.body);
|
|
2929
|
+
return cache;
|
|
2930
|
+
});
|
|
2931
|
+
}, (response) => {
|
|
2932
|
+
return luvio.handleErrorResponse(() => onFetchResponseError(luvio, config, resourceParams, response));
|
|
2933
|
+
});
|
|
2934
|
+
}
|
|
2935
|
+
function buildNetworkSnapshotCachePolicy(context, coercedAdapterRequestContext) {
|
|
2936
|
+
return buildNetworkSnapshotCachePolicy$2(context, coercedAdapterRequestContext, buildNetworkSnapshot, undefined, false);
|
|
2937
|
+
}
|
|
2938
|
+
function buildCachedSnapshotCachePolicy(context, storeLookup) {
|
|
2939
|
+
const { luvio, config } = context;
|
|
2940
|
+
const selector = {
|
|
2941
|
+
recordId: keyBuilder(luvio, config),
|
|
2942
|
+
node: adapterFragment(luvio, config),
|
|
2943
|
+
variables: {},
|
|
2944
|
+
};
|
|
2945
|
+
const cacheSnapshot = storeLookup(selector, {
|
|
2946
|
+
config,
|
|
2947
|
+
resolve: () => buildNetworkSnapshot(luvio, config, snapshotRefreshOptions)
|
|
2948
|
+
});
|
|
2949
|
+
return cacheSnapshot;
|
|
2950
|
+
}
|
|
2951
|
+
const getPersonalizationSchemaAdapterFactory = (luvio) => function personalizationService__getPersonalizationSchema(untrustedConfig, requestContext) {
|
|
2952
|
+
const config = validateAdapterConfig(untrustedConfig, getPersonalizationSchema_ConfigPropertyNames);
|
|
2953
|
+
// Invalid or incomplete config
|
|
2954
|
+
if (config === null) {
|
|
2955
|
+
return null;
|
|
2956
|
+
}
|
|
2957
|
+
return luvio.applyCachePolicy((requestContext || {}), { config, luvio }, // BuildSnapshotContext
|
|
2958
|
+
buildCachedSnapshotCachePolicy, buildNetworkSnapshotCachePolicy);
|
|
2959
|
+
};
|
|
2066
2960
|
|
|
2067
|
-
export { createPersonalizationPointAdapterFactory, deletePersonalizationPointAdapterFactory, getPersonalizationPointAdapterFactory, updatePersonalizationPointAdapterFactory };
|
|
2961
|
+
export { createPersonalizationPointAdapterFactory, createPersonalizationSchemaAdapterFactory, deletePersonalizationPointAdapterFactory, deletePersonalizationSchemaAdapterFactory, getPersonalizationPointAdapterFactory, getPersonalizationSchemaAdapterFactory, updatePersonalizationPointAdapterFactory };
|