@salesforce/lds-adapters-marketing-cdp 1.278.0 → 1.280.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/marketing-cdp.js +490 -199
- package/dist/es/es2018/types/src/generated/adapters/getDataGraphDraft.d.ts +28 -0
- package/dist/es/es2018/types/src/generated/adapters/saveDataGraphDraft.d.ts +16 -0
- package/dist/es/es2018/types/src/generated/artifacts/main.d.ts +2 -0
- package/dist/es/es2018/types/src/generated/artifacts/sfdc.d.ts +5 -1
- package/dist/es/es2018/types/src/generated/resources/getSsotDataGraphsDraftByDataGraphName.d.ts +16 -0
- package/dist/es/es2018/types/src/generated/resources/postSsotDataGraphsDraft.d.ts +13 -0
- package/dist/es/es2018/types/src/generated/types/CdpDataGraphDraftInputRepresentation.d.ts +31 -0
- package/dist/es/es2018/types/src/generated/types/CdpDataGraphDraftOutputRepresentation.d.ts +38 -0
- package/package.json +4 -4
- package/sfdc/index.js +548 -207
- package/src/raml/api.raml +45 -0
- package/src/raml/luvio.raml +14 -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$3 } from '@luvio/engine';
|
|
8
8
|
|
|
9
9
|
const { hasOwnProperty: ObjectPrototypeHasOwnProperty } = Object.prototype;
|
|
10
10
|
const { keys: ObjectKeys, create: ObjectCreate } = Object;
|
|
@@ -92,7 +92,7 @@ function createLink(ref) {
|
|
|
92
92
|
};
|
|
93
93
|
}
|
|
94
94
|
|
|
95
|
-
function validate$
|
|
95
|
+
function validate$9(obj, path = 'CdpObjectBaseOutputRepresentation') {
|
|
96
96
|
const v_error = (() => {
|
|
97
97
|
if (typeof obj !== 'object' || ArrayIsArray(obj) || obj === null) {
|
|
98
98
|
return new TypeError('Expected "object" but received "' + typeof obj + '" (at "' + path + '")');
|
|
@@ -166,24 +166,24 @@ function validate$8(obj, path = 'CdpObjectBaseOutputRepresentation') {
|
|
|
166
166
|
})();
|
|
167
167
|
return v_error === undefined ? null : v_error;
|
|
168
168
|
}
|
|
169
|
-
const RepresentationType$
|
|
170
|
-
function keyBuilder$
|
|
171
|
-
return keyPrefix + '::' + RepresentationType$
|
|
169
|
+
const RepresentationType$4 = 'CdpObjectBaseOutputRepresentation';
|
|
170
|
+
function keyBuilder$b(luvio, config) {
|
|
171
|
+
return keyPrefix + '::' + RepresentationType$4 + ':' + config.name;
|
|
172
172
|
}
|
|
173
|
-
function keyBuilderFromType$
|
|
173
|
+
function keyBuilderFromType$4(luvio, object) {
|
|
174
174
|
const keyParams = {
|
|
175
175
|
name: object.name
|
|
176
176
|
};
|
|
177
|
-
return keyBuilder$
|
|
177
|
+
return keyBuilder$b(luvio, keyParams);
|
|
178
178
|
}
|
|
179
|
-
function equals$
|
|
179
|
+
function equals$6(existing, incoming) {
|
|
180
180
|
if (JSONStringify(incoming) !== JSONStringify(existing)) {
|
|
181
181
|
return false;
|
|
182
182
|
}
|
|
183
183
|
return true;
|
|
184
184
|
}
|
|
185
185
|
|
|
186
|
-
function validate$
|
|
186
|
+
function validate$8(obj, path = 'CdpDataGraphFieldOutputRepresentation') {
|
|
187
187
|
const v_error = (() => {
|
|
188
188
|
if (typeof obj !== 'object' || ArrayIsArray(obj) || obj === null) {
|
|
189
189
|
return new TypeError('Expected "object" but received "' + typeof obj + '" (at "' + path + '")');
|
|
@@ -237,7 +237,7 @@ function validate$7(obj, path = 'CdpDataGraphFieldOutputRepresentation') {
|
|
|
237
237
|
return v_error === undefined ? null : v_error;
|
|
238
238
|
}
|
|
239
239
|
|
|
240
|
-
function validate$
|
|
240
|
+
function validate$7(obj, path = 'CdpDataGraphPathToParentOutputRepresentation') {
|
|
241
241
|
const v_error = (() => {
|
|
242
242
|
if (typeof obj !== 'object' || ArrayIsArray(obj) || obj === null) {
|
|
243
243
|
return new TypeError('Expected "object" but received "' + typeof obj + '" (at "' + path + '")');
|
|
@@ -256,7 +256,7 @@ function validate$6(obj, path = 'CdpDataGraphPathToParentOutputRepresentation')
|
|
|
256
256
|
return v_error === undefined ? null : v_error;
|
|
257
257
|
}
|
|
258
258
|
|
|
259
|
-
function validate$
|
|
259
|
+
function validate$6(obj, path = 'CdpDataGraphRecencyCriteriaOutputRepresentation') {
|
|
260
260
|
const v_error = (() => {
|
|
261
261
|
if (typeof obj !== 'object' || ArrayIsArray(obj) || obj === null) {
|
|
262
262
|
return new TypeError('Expected "object" but received "' + typeof obj + '" (at "' + path + '")');
|
|
@@ -285,7 +285,7 @@ function validate$5(obj, path = 'CdpDataGraphRecencyCriteriaOutputRepresentation
|
|
|
285
285
|
return v_error === undefined ? null : v_error;
|
|
286
286
|
}
|
|
287
287
|
|
|
288
|
-
function validate$
|
|
288
|
+
function validate$5(obj, path = 'CdpDataGraphSourceObjectOutputRepresentation') {
|
|
289
289
|
const v_error = (() => {
|
|
290
290
|
if (typeof obj !== 'object' || ArrayIsArray(obj) || obj === null) {
|
|
291
291
|
return new TypeError('Expected "object" but received "' + typeof obj + '" (at "' + path + '")');
|
|
@@ -298,7 +298,7 @@ function validate$4(obj, path = 'CdpDataGraphSourceObjectOutputRepresentation')
|
|
|
298
298
|
for (let i = 0; i < obj_fields.length; i++) {
|
|
299
299
|
const obj_fields_item = obj_fields[i];
|
|
300
300
|
const path_fields_item = path_fields + '[' + i + ']';
|
|
301
|
-
const referencepath_fields_itemValidationError = validate$
|
|
301
|
+
const referencepath_fields_itemValidationError = validate$8(obj_fields_item, path_fields_item);
|
|
302
302
|
if (referencepath_fields_itemValidationError !== null) {
|
|
303
303
|
let message = 'Object doesn\'t match CdpDataGraphFieldOutputRepresentation (at "' + path_fields_item + '")\n';
|
|
304
304
|
message += referencepath_fields_itemValidationError.message.split('\n').map((line) => '\t' + line).join('\n');
|
|
@@ -328,7 +328,7 @@ function validate$4(obj, path = 'CdpDataGraphSourceObjectOutputRepresentation')
|
|
|
328
328
|
for (let i = 0; i < obj_path.length; i++) {
|
|
329
329
|
const obj_path_item = obj_path[i];
|
|
330
330
|
const path_path_item = path_path + '[' + i + ']';
|
|
331
|
-
const referencepath_path_itemValidationError = validate$
|
|
331
|
+
const referencepath_path_itemValidationError = validate$7(obj_path_item, path_path_item);
|
|
332
332
|
if (referencepath_path_itemValidationError !== null) {
|
|
333
333
|
let message = 'Object doesn\'t match CdpDataGraphPathToParentOutputRepresentation (at "' + path_path_item + '")\n';
|
|
334
334
|
message += referencepath_path_itemValidationError.message.split('\n').map((line) => '\t' + line).join('\n');
|
|
@@ -345,7 +345,7 @@ function validate$4(obj, path = 'CdpDataGraphSourceObjectOutputRepresentation')
|
|
|
345
345
|
for (let i = 0; i < obj_recencyCriteria.length; i++) {
|
|
346
346
|
const obj_recencyCriteria_item = obj_recencyCriteria[i];
|
|
347
347
|
const path_recencyCriteria_item = path_recencyCriteria + '[' + i + ']';
|
|
348
|
-
const referencepath_recencyCriteria_itemValidationError = validate$
|
|
348
|
+
const referencepath_recencyCriteria_itemValidationError = validate$6(obj_recencyCriteria_item, path_recencyCriteria_item);
|
|
349
349
|
if (referencepath_recencyCriteria_itemValidationError !== null) {
|
|
350
350
|
let message = 'Object doesn\'t match CdpDataGraphRecencyCriteriaOutputRepresentation (at "' + path_recencyCriteria_item + '")\n';
|
|
351
351
|
message += referencepath_recencyCriteria_itemValidationError.message.split('\n').map((line) => '\t' + line).join('\n');
|
|
@@ -368,16 +368,16 @@ function validate$4(obj, path = 'CdpDataGraphSourceObjectOutputRepresentation')
|
|
|
368
368
|
})();
|
|
369
369
|
return v_error === undefined ? null : v_error;
|
|
370
370
|
}
|
|
371
|
-
function equals$
|
|
371
|
+
function equals$5(existing, incoming) {
|
|
372
372
|
if (JSONStringify(incoming) !== JSONStringify(existing)) {
|
|
373
373
|
return false;
|
|
374
374
|
}
|
|
375
375
|
return true;
|
|
376
376
|
}
|
|
377
377
|
|
|
378
|
-
const VERSION$
|
|
379
|
-
function validate$
|
|
380
|
-
const validateCdpObjectBaseOutputRepresentation_validateError = validate$
|
|
378
|
+
const VERSION$3 = "5d9e99f6f73f52f2cfcb77b921003155";
|
|
379
|
+
function validate$4(obj, path = 'CdpDataGraphOutputRepresentation') {
|
|
380
|
+
const validateCdpObjectBaseOutputRepresentation_validateError = validate$9(obj, path);
|
|
381
381
|
if (validateCdpObjectBaseOutputRepresentation_validateError !== null) {
|
|
382
382
|
return validateCdpObjectBaseOutputRepresentation_validateError;
|
|
383
383
|
}
|
|
@@ -444,7 +444,7 @@ function validate$3(obj, path = 'CdpDataGraphOutputRepresentation') {
|
|
|
444
444
|
}
|
|
445
445
|
const obj_sourceObject = obj.sourceObject;
|
|
446
446
|
const path_sourceObject = path + '.sourceObject';
|
|
447
|
-
const referencepath_sourceObjectValidationError = validate$
|
|
447
|
+
const referencepath_sourceObjectValidationError = validate$5(obj_sourceObject, path_sourceObject);
|
|
448
448
|
if (referencepath_sourceObjectValidationError !== null) {
|
|
449
449
|
let message = 'Object doesn\'t match CdpDataGraphSourceObjectOutputRepresentation (at "' + path_sourceObject + '")\n';
|
|
450
450
|
message += referencepath_sourceObjectValidationError.message.split('\n').map((line) => '\t' + line).join('\n');
|
|
@@ -475,26 +475,26 @@ function validate$3(obj, path = 'CdpDataGraphOutputRepresentation') {
|
|
|
475
475
|
})();
|
|
476
476
|
return v_error === undefined ? null : v_error;
|
|
477
477
|
}
|
|
478
|
-
const RepresentationType$
|
|
479
|
-
function keyBuilder$
|
|
480
|
-
return keyBuilder$
|
|
478
|
+
const RepresentationType$3 = 'CdpDataGraphOutputRepresentation';
|
|
479
|
+
function keyBuilder$a(luvio, config) {
|
|
480
|
+
return keyBuilder$b(luvio, config);
|
|
481
481
|
}
|
|
482
|
-
function keyBuilderFromType$
|
|
483
|
-
return keyBuilderFromType$
|
|
482
|
+
function keyBuilderFromType$3(luvio, object) {
|
|
483
|
+
return keyBuilderFromType$4(luvio, object);
|
|
484
484
|
}
|
|
485
|
-
function normalize$
|
|
485
|
+
function normalize$3(input, existing, path, luvio, store, timestamp) {
|
|
486
486
|
return input;
|
|
487
487
|
}
|
|
488
|
-
const select$
|
|
488
|
+
const select$9 = function CdpDataGraphOutputRepresentationSelect() {
|
|
489
489
|
return {
|
|
490
490
|
kind: 'Fragment',
|
|
491
|
-
version: VERSION$
|
|
491
|
+
version: VERSION$3,
|
|
492
492
|
private: [],
|
|
493
493
|
opaque: true
|
|
494
494
|
};
|
|
495
495
|
};
|
|
496
|
-
function equals$
|
|
497
|
-
if (equals$
|
|
496
|
+
function equals$4(existing, incoming) {
|
|
497
|
+
if (equals$6(existing, incoming) === false) {
|
|
498
498
|
return false;
|
|
499
499
|
}
|
|
500
500
|
const existing_isRecordCachingDisabled = existing.isRecordCachingDisabled;
|
|
@@ -620,46 +620,46 @@ function equals$3(existing, incoming) {
|
|
|
620
620
|
}
|
|
621
621
|
const existing_sourceObject = existing.sourceObject;
|
|
622
622
|
const incoming_sourceObject = incoming.sourceObject;
|
|
623
|
-
if (!(equals$
|
|
623
|
+
if (!(equals$5(existing_sourceObject, incoming_sourceObject))) {
|
|
624
624
|
return false;
|
|
625
625
|
}
|
|
626
626
|
return true;
|
|
627
627
|
}
|
|
628
|
-
const ingest$
|
|
628
|
+
const ingest$3 = function CdpDataGraphOutputRepresentationIngest(input, path, luvio, store, timestamp) {
|
|
629
629
|
if (process.env.NODE_ENV !== 'production') {
|
|
630
|
-
const validateError = validate$
|
|
630
|
+
const validateError = validate$4(input);
|
|
631
631
|
if (validateError !== null) {
|
|
632
632
|
throw validateError;
|
|
633
633
|
}
|
|
634
634
|
}
|
|
635
|
-
const key = keyBuilderFromType$
|
|
635
|
+
const key = keyBuilderFromType$3(luvio, input);
|
|
636
636
|
const ttlToUse = path.ttl !== undefined ? path.ttl : 3000000;
|
|
637
|
-
ingestShape(input, path, luvio, store, timestamp, ttlToUse, key, normalize$
|
|
637
|
+
ingestShape(input, path, luvio, store, timestamp, ttlToUse, key, normalize$3, "CDP", VERSION$3, RepresentationType$3, equals$4);
|
|
638
638
|
return createLink(key);
|
|
639
639
|
};
|
|
640
|
-
function getTypeCacheKeys$
|
|
640
|
+
function getTypeCacheKeys$3(rootKeySet, luvio, input, fullPathFactory) {
|
|
641
641
|
// root cache key (uses fullPathFactory if keyBuilderFromType isn't defined)
|
|
642
|
-
const rootKey = keyBuilderFromType$
|
|
642
|
+
const rootKey = keyBuilderFromType$3(luvio, input);
|
|
643
643
|
rootKeySet.set(rootKey, {
|
|
644
644
|
namespace: keyPrefix,
|
|
645
|
-
representationName: RepresentationType$
|
|
645
|
+
representationName: RepresentationType$4,
|
|
646
646
|
mergeable: false
|
|
647
647
|
});
|
|
648
648
|
}
|
|
649
649
|
|
|
650
|
-
function select$
|
|
651
|
-
return select$
|
|
650
|
+
function select$8(luvio, params) {
|
|
651
|
+
return select$9();
|
|
652
652
|
}
|
|
653
|
-
function getResponseCacheKeys$
|
|
654
|
-
getTypeCacheKeys$
|
|
653
|
+
function getResponseCacheKeys$6(storeKeyMap, luvio, resourceParams, response) {
|
|
654
|
+
getTypeCacheKeys$3(storeKeyMap, luvio, response);
|
|
655
655
|
}
|
|
656
|
-
function ingestSuccess$
|
|
656
|
+
function ingestSuccess$5(luvio, resourceParams, response) {
|
|
657
657
|
const { body } = response;
|
|
658
|
-
const key = keyBuilderFromType$
|
|
659
|
-
luvio.storeIngest(key, ingest$
|
|
658
|
+
const key = keyBuilderFromType$3(luvio, body);
|
|
659
|
+
luvio.storeIngest(key, ingest$3, body);
|
|
660
660
|
const snapshot = luvio.storeLookup({
|
|
661
661
|
recordId: key,
|
|
662
|
-
node: select$
|
|
662
|
+
node: select$8(),
|
|
663
663
|
variables: {},
|
|
664
664
|
});
|
|
665
665
|
if (process.env.NODE_ENV !== 'production') {
|
|
@@ -670,7 +670,7 @@ function ingestSuccess$3(luvio, resourceParams, response) {
|
|
|
670
670
|
deepFreeze(snapshot.data);
|
|
671
671
|
return snapshot;
|
|
672
672
|
}
|
|
673
|
-
function createResourceRequest$
|
|
673
|
+
function createResourceRequest$6(config) {
|
|
674
674
|
const headers = {};
|
|
675
675
|
return {
|
|
676
676
|
baseUri: '/services/data/v61.0',
|
|
@@ -684,7 +684,7 @@ function createResourceRequest$4(config) {
|
|
|
684
684
|
};
|
|
685
685
|
}
|
|
686
686
|
|
|
687
|
-
const adapterName$
|
|
687
|
+
const adapterName$6 = 'createDataGraph';
|
|
688
688
|
const createDataGraph_ConfigPropertyMetadata = [
|
|
689
689
|
generateParamConfigMetadata('dataspaceName', false, 2 /* Body */, 0 /* String */),
|
|
690
690
|
generateParamConfigMetadata('description', false, 2 /* Body */, 0 /* String */),
|
|
@@ -699,39 +699,39 @@ const createDataGraph_ConfigPropertyMetadata = [
|
|
|
699
699
|
generateParamConfigMetadata('sessionEnd', false, 2 /* Body */, 3 /* Integer */),
|
|
700
700
|
generateParamConfigMetadata('sessionEndTimeUnit', false, 2 /* Body */, 0 /* String */),
|
|
701
701
|
];
|
|
702
|
-
const createDataGraph_ConfigPropertyNames = /*#__PURE__*/ buildAdapterValidationConfig(adapterName$
|
|
703
|
-
const createResourceParams$
|
|
704
|
-
function typeCheckConfig$
|
|
702
|
+
const createDataGraph_ConfigPropertyNames = /*#__PURE__*/ buildAdapterValidationConfig(adapterName$6, createDataGraph_ConfigPropertyMetadata);
|
|
703
|
+
const createResourceParams$6 = /*#__PURE__*/ createResourceParams$7(createDataGraph_ConfigPropertyMetadata);
|
|
704
|
+
function typeCheckConfig$6(untrustedConfig) {
|
|
705
705
|
const config = {};
|
|
706
|
-
typeCheckConfig$
|
|
706
|
+
typeCheckConfig$7(untrustedConfig, config, createDataGraph_ConfigPropertyMetadata);
|
|
707
707
|
const untrustedConfig_sourceObject = untrustedConfig.sourceObject;
|
|
708
708
|
config.sourceObject = untrustedConfig_sourceObject;
|
|
709
709
|
return config;
|
|
710
710
|
}
|
|
711
|
-
function validateAdapterConfig$
|
|
711
|
+
function validateAdapterConfig$6(untrustedConfig, configPropertyNames) {
|
|
712
712
|
if (!untrustedIsObject(untrustedConfig)) {
|
|
713
713
|
return null;
|
|
714
714
|
}
|
|
715
715
|
if (process.env.NODE_ENV !== 'production') {
|
|
716
716
|
validateConfig(untrustedConfig, configPropertyNames);
|
|
717
717
|
}
|
|
718
|
-
const config = typeCheckConfig$
|
|
718
|
+
const config = typeCheckConfig$6(untrustedConfig);
|
|
719
719
|
if (!areRequiredParametersPresent(config, configPropertyNames)) {
|
|
720
720
|
return null;
|
|
721
721
|
}
|
|
722
722
|
return config;
|
|
723
723
|
}
|
|
724
|
-
function buildNetworkSnapshot$
|
|
725
|
-
const resourceParams = createResourceParams$
|
|
726
|
-
const request = createResourceRequest$
|
|
724
|
+
function buildNetworkSnapshot$6(luvio, config, options) {
|
|
725
|
+
const resourceParams = createResourceParams$6(config);
|
|
726
|
+
const request = createResourceRequest$6(resourceParams);
|
|
727
727
|
return luvio.dispatchResourceRequest(request, options)
|
|
728
728
|
.then((response) => {
|
|
729
729
|
return luvio.handleSuccessResponse(() => {
|
|
730
|
-
const snapshot = ingestSuccess$
|
|
730
|
+
const snapshot = ingestSuccess$5(luvio, resourceParams, response);
|
|
731
731
|
return luvio.storeBroadcast().then(() => snapshot);
|
|
732
732
|
}, () => {
|
|
733
733
|
const cache = new StoreKeyMap();
|
|
734
|
-
getResponseCacheKeys$
|
|
734
|
+
getResponseCacheKeys$6(cache, luvio, resourceParams, response.body);
|
|
735
735
|
return cache;
|
|
736
736
|
});
|
|
737
737
|
}, (response) => {
|
|
@@ -741,33 +741,33 @@ function buildNetworkSnapshot$4(luvio, config, options) {
|
|
|
741
741
|
}
|
|
742
742
|
const createDataGraphAdapterFactory = (luvio) => {
|
|
743
743
|
return function createDataGraph(untrustedConfig) {
|
|
744
|
-
const config = validateAdapterConfig$
|
|
744
|
+
const config = validateAdapterConfig$6(untrustedConfig, createDataGraph_ConfigPropertyNames);
|
|
745
745
|
// Invalid or incomplete config
|
|
746
746
|
if (config === null) {
|
|
747
747
|
throw new Error('Invalid config for "createDataGraph"');
|
|
748
748
|
}
|
|
749
|
-
return buildNetworkSnapshot$
|
|
749
|
+
return buildNetworkSnapshot$6(luvio, config);
|
|
750
750
|
};
|
|
751
751
|
};
|
|
752
752
|
|
|
753
|
-
function select$
|
|
754
|
-
return select$
|
|
753
|
+
function select$7(luvio, params) {
|
|
754
|
+
return select$9();
|
|
755
755
|
}
|
|
756
|
-
function keyBuilder$
|
|
757
|
-
return keyBuilder$
|
|
756
|
+
function keyBuilder$9(luvio, params) {
|
|
757
|
+
return keyBuilder$a(luvio, {
|
|
758
758
|
name: params.urlParams.dataGraphName
|
|
759
759
|
});
|
|
760
760
|
}
|
|
761
|
-
function getResponseCacheKeys$
|
|
762
|
-
getTypeCacheKeys$
|
|
761
|
+
function getResponseCacheKeys$5(storeKeyMap, luvio, resourceParams, response) {
|
|
762
|
+
getTypeCacheKeys$3(storeKeyMap, luvio, response);
|
|
763
763
|
}
|
|
764
|
-
function ingestSuccess$
|
|
764
|
+
function ingestSuccess$4(luvio, resourceParams, response, snapshotRefresh) {
|
|
765
765
|
const { body } = response;
|
|
766
|
-
const key = keyBuilder$
|
|
767
|
-
luvio.storeIngest(key, ingest$
|
|
766
|
+
const key = keyBuilder$9(luvio, resourceParams);
|
|
767
|
+
luvio.storeIngest(key, ingest$3, body);
|
|
768
768
|
const snapshot = luvio.storeLookup({
|
|
769
769
|
recordId: key,
|
|
770
|
-
node: select$
|
|
770
|
+
node: select$7(),
|
|
771
771
|
variables: {},
|
|
772
772
|
}, snapshotRefresh);
|
|
773
773
|
if (process.env.NODE_ENV !== 'production') {
|
|
@@ -778,13 +778,13 @@ function ingestSuccess$2(luvio, resourceParams, response, snapshotRefresh) {
|
|
|
778
778
|
deepFreeze(snapshot.data);
|
|
779
779
|
return snapshot;
|
|
780
780
|
}
|
|
781
|
-
function ingestError$
|
|
782
|
-
const key = keyBuilder$
|
|
781
|
+
function ingestError$2(luvio, params, error, snapshotRefresh) {
|
|
782
|
+
const key = keyBuilder$9(luvio, params);
|
|
783
783
|
const errorSnapshot = luvio.errorSnapshot(error, snapshotRefresh);
|
|
784
784
|
luvio.storeIngestError(key, errorSnapshot);
|
|
785
785
|
return errorSnapshot;
|
|
786
786
|
}
|
|
787
|
-
function createResourceRequest$
|
|
787
|
+
function createResourceRequest$5(config) {
|
|
788
788
|
const headers = {};
|
|
789
789
|
return {
|
|
790
790
|
baseUri: '/services/data/v61.0',
|
|
@@ -798,110 +798,110 @@ function createResourceRequest$3(config) {
|
|
|
798
798
|
};
|
|
799
799
|
}
|
|
800
800
|
|
|
801
|
-
const adapterName$
|
|
801
|
+
const adapterName$5 = 'getDataGraph';
|
|
802
802
|
const getDataGraph_ConfigPropertyMetadata = [
|
|
803
803
|
generateParamConfigMetadata('dataGraphName', true, 0 /* UrlParameter */, 0 /* String */),
|
|
804
804
|
];
|
|
805
|
-
const getDataGraph_ConfigPropertyNames = /*#__PURE__*/ buildAdapterValidationConfig(adapterName$
|
|
806
|
-
const createResourceParams$
|
|
807
|
-
function keyBuilder$
|
|
808
|
-
const resourceParams = createResourceParams$
|
|
809
|
-
return keyBuilder$
|
|
805
|
+
const getDataGraph_ConfigPropertyNames = /*#__PURE__*/ buildAdapterValidationConfig(adapterName$5, getDataGraph_ConfigPropertyMetadata);
|
|
806
|
+
const createResourceParams$5 = /*#__PURE__*/ createResourceParams$7(getDataGraph_ConfigPropertyMetadata);
|
|
807
|
+
function keyBuilder$8(luvio, config) {
|
|
808
|
+
const resourceParams = createResourceParams$5(config);
|
|
809
|
+
return keyBuilder$9(luvio, resourceParams);
|
|
810
810
|
}
|
|
811
|
-
function typeCheckConfig$
|
|
811
|
+
function typeCheckConfig$5(untrustedConfig) {
|
|
812
812
|
const config = {};
|
|
813
|
-
typeCheckConfig$
|
|
813
|
+
typeCheckConfig$7(untrustedConfig, config, getDataGraph_ConfigPropertyMetadata);
|
|
814
814
|
return config;
|
|
815
815
|
}
|
|
816
|
-
function validateAdapterConfig$
|
|
816
|
+
function validateAdapterConfig$5(untrustedConfig, configPropertyNames) {
|
|
817
817
|
if (!untrustedIsObject(untrustedConfig)) {
|
|
818
818
|
return null;
|
|
819
819
|
}
|
|
820
820
|
if (process.env.NODE_ENV !== 'production') {
|
|
821
821
|
validateConfig(untrustedConfig, configPropertyNames);
|
|
822
822
|
}
|
|
823
|
-
const config = typeCheckConfig$
|
|
823
|
+
const config = typeCheckConfig$5(untrustedConfig);
|
|
824
824
|
if (!areRequiredParametersPresent(config, configPropertyNames)) {
|
|
825
825
|
return null;
|
|
826
826
|
}
|
|
827
827
|
return config;
|
|
828
828
|
}
|
|
829
|
-
function adapterFragment$
|
|
830
|
-
createResourceParams$
|
|
831
|
-
return select$
|
|
829
|
+
function adapterFragment$2(luvio, config) {
|
|
830
|
+
createResourceParams$5(config);
|
|
831
|
+
return select$7();
|
|
832
832
|
}
|
|
833
|
-
function onFetchResponseSuccess$
|
|
834
|
-
const snapshot = ingestSuccess$
|
|
833
|
+
function onFetchResponseSuccess$2(luvio, config, resourceParams, response) {
|
|
834
|
+
const snapshot = ingestSuccess$4(luvio, resourceParams, response, {
|
|
835
835
|
config,
|
|
836
|
-
resolve: () => buildNetworkSnapshot$
|
|
836
|
+
resolve: () => buildNetworkSnapshot$5(luvio, config, snapshotRefreshOptions)
|
|
837
837
|
});
|
|
838
838
|
return luvio.storeBroadcast().then(() => snapshot);
|
|
839
839
|
}
|
|
840
|
-
function onFetchResponseError$
|
|
841
|
-
const snapshot = ingestError$
|
|
840
|
+
function onFetchResponseError$2(luvio, config, resourceParams, response) {
|
|
841
|
+
const snapshot = ingestError$2(luvio, resourceParams, response, {
|
|
842
842
|
config,
|
|
843
|
-
resolve: () => buildNetworkSnapshot$
|
|
843
|
+
resolve: () => buildNetworkSnapshot$5(luvio, config, snapshotRefreshOptions)
|
|
844
844
|
});
|
|
845
845
|
return luvio.storeBroadcast().then(() => snapshot);
|
|
846
846
|
}
|
|
847
|
-
function buildNetworkSnapshot$
|
|
848
|
-
const resourceParams = createResourceParams$
|
|
849
|
-
const request = createResourceRequest$
|
|
847
|
+
function buildNetworkSnapshot$5(luvio, config, options) {
|
|
848
|
+
const resourceParams = createResourceParams$5(config);
|
|
849
|
+
const request = createResourceRequest$5(resourceParams);
|
|
850
850
|
return luvio.dispatchResourceRequest(request, options)
|
|
851
851
|
.then((response) => {
|
|
852
|
-
return luvio.handleSuccessResponse(() => onFetchResponseSuccess$
|
|
852
|
+
return luvio.handleSuccessResponse(() => onFetchResponseSuccess$2(luvio, config, resourceParams, response), () => {
|
|
853
853
|
const cache = new StoreKeyMap();
|
|
854
|
-
getResponseCacheKeys$
|
|
854
|
+
getResponseCacheKeys$5(cache, luvio, resourceParams, response.body);
|
|
855
855
|
return cache;
|
|
856
856
|
});
|
|
857
857
|
}, (response) => {
|
|
858
|
-
return luvio.handleErrorResponse(() => onFetchResponseError$
|
|
858
|
+
return luvio.handleErrorResponse(() => onFetchResponseError$2(luvio, config, resourceParams, response));
|
|
859
859
|
});
|
|
860
860
|
}
|
|
861
|
-
function buildNetworkSnapshotCachePolicy$
|
|
862
|
-
return buildNetworkSnapshotCachePolicy$
|
|
861
|
+
function buildNetworkSnapshotCachePolicy$2(context, coercedAdapterRequestContext) {
|
|
862
|
+
return buildNetworkSnapshotCachePolicy$3(context, coercedAdapterRequestContext, buildNetworkSnapshot$5, undefined, false);
|
|
863
863
|
}
|
|
864
|
-
function buildCachedSnapshotCachePolicy$
|
|
864
|
+
function buildCachedSnapshotCachePolicy$2(context, storeLookup) {
|
|
865
865
|
const { luvio, config } = context;
|
|
866
866
|
const selector = {
|
|
867
|
-
recordId: keyBuilder$
|
|
868
|
-
node: adapterFragment$
|
|
867
|
+
recordId: keyBuilder$8(luvio, config),
|
|
868
|
+
node: adapterFragment$2(luvio, config),
|
|
869
869
|
variables: {},
|
|
870
870
|
};
|
|
871
871
|
const cacheSnapshot = storeLookup(selector, {
|
|
872
872
|
config,
|
|
873
|
-
resolve: () => buildNetworkSnapshot$
|
|
873
|
+
resolve: () => buildNetworkSnapshot$5(luvio, config, snapshotRefreshOptions)
|
|
874
874
|
});
|
|
875
875
|
return cacheSnapshot;
|
|
876
876
|
}
|
|
877
877
|
const getDataGraphAdapterFactory = (luvio) => function CDP__getDataGraph(untrustedConfig, requestContext) {
|
|
878
|
-
const config = validateAdapterConfig$
|
|
878
|
+
const config = validateAdapterConfig$5(untrustedConfig, getDataGraph_ConfigPropertyNames);
|
|
879
879
|
// Invalid or incomplete config
|
|
880
880
|
if (config === null) {
|
|
881
881
|
return null;
|
|
882
882
|
}
|
|
883
883
|
return luvio.applyCachePolicy((requestContext || {}), { config, luvio }, // BuildSnapshotContext
|
|
884
|
-
buildCachedSnapshotCachePolicy$
|
|
884
|
+
buildCachedSnapshotCachePolicy$2, buildNetworkSnapshotCachePolicy$2);
|
|
885
885
|
};
|
|
886
886
|
|
|
887
|
-
function keyBuilder$
|
|
888
|
-
return keyBuilder$
|
|
887
|
+
function keyBuilder$7(luvio, params) {
|
|
888
|
+
return keyBuilder$a(luvio, {
|
|
889
889
|
name: params.urlParams.dataGraphName
|
|
890
890
|
});
|
|
891
891
|
}
|
|
892
|
-
function getResponseCacheKeys$
|
|
893
|
-
const key = keyBuilder$
|
|
892
|
+
function getResponseCacheKeys$4(cacheKeyMap, luvio, resourceParams) {
|
|
893
|
+
const key = keyBuilder$7(luvio, resourceParams);
|
|
894
894
|
cacheKeyMap.set(key, {
|
|
895
895
|
namespace: keyPrefix,
|
|
896
|
-
representationName: RepresentationType$
|
|
896
|
+
representationName: RepresentationType$3,
|
|
897
897
|
mergeable: false
|
|
898
898
|
});
|
|
899
899
|
}
|
|
900
900
|
function evictSuccess(luvio, resourceParams) {
|
|
901
|
-
const key = keyBuilder$
|
|
901
|
+
const key = keyBuilder$7(luvio, resourceParams);
|
|
902
902
|
luvio.storeEvict(key);
|
|
903
903
|
}
|
|
904
|
-
function createResourceRequest$
|
|
904
|
+
function createResourceRequest$4(config) {
|
|
905
905
|
const headers = {};
|
|
906
906
|
return {
|
|
907
907
|
baseUri: '/services/data/v61.0',
|
|
@@ -915,33 +915,33 @@ function createResourceRequest$2(config) {
|
|
|
915
915
|
};
|
|
916
916
|
}
|
|
917
917
|
|
|
918
|
-
const adapterName$
|
|
918
|
+
const adapterName$4 = 'deleteDataGraph';
|
|
919
919
|
const deleteDataGraph_ConfigPropertyMetadata = [
|
|
920
920
|
generateParamConfigMetadata('dataGraphName', true, 0 /* UrlParameter */, 0 /* String */),
|
|
921
921
|
];
|
|
922
|
-
const deleteDataGraph_ConfigPropertyNames = /*#__PURE__*/ buildAdapterValidationConfig(adapterName$
|
|
923
|
-
const createResourceParams$
|
|
924
|
-
function typeCheckConfig$
|
|
922
|
+
const deleteDataGraph_ConfigPropertyNames = /*#__PURE__*/ buildAdapterValidationConfig(adapterName$4, deleteDataGraph_ConfigPropertyMetadata);
|
|
923
|
+
const createResourceParams$4 = /*#__PURE__*/ createResourceParams$7(deleteDataGraph_ConfigPropertyMetadata);
|
|
924
|
+
function typeCheckConfig$4(untrustedConfig) {
|
|
925
925
|
const config = {};
|
|
926
|
-
typeCheckConfig$
|
|
926
|
+
typeCheckConfig$7(untrustedConfig, config, deleteDataGraph_ConfigPropertyMetadata);
|
|
927
927
|
return config;
|
|
928
928
|
}
|
|
929
|
-
function validateAdapterConfig$
|
|
929
|
+
function validateAdapterConfig$4(untrustedConfig, configPropertyNames) {
|
|
930
930
|
if (!untrustedIsObject(untrustedConfig)) {
|
|
931
931
|
return null;
|
|
932
932
|
}
|
|
933
933
|
if (process.env.NODE_ENV !== 'production') {
|
|
934
934
|
validateConfig(untrustedConfig, configPropertyNames);
|
|
935
935
|
}
|
|
936
|
-
const config = typeCheckConfig$
|
|
936
|
+
const config = typeCheckConfig$4(untrustedConfig);
|
|
937
937
|
if (!areRequiredParametersPresent(config, configPropertyNames)) {
|
|
938
938
|
return null;
|
|
939
939
|
}
|
|
940
940
|
return config;
|
|
941
941
|
}
|
|
942
|
-
function buildNetworkSnapshot$
|
|
943
|
-
const resourceParams = createResourceParams$
|
|
944
|
-
const request = createResourceRequest$
|
|
942
|
+
function buildNetworkSnapshot$4(luvio, config, options) {
|
|
943
|
+
const resourceParams = createResourceParams$4(config);
|
|
944
|
+
const request = createResourceRequest$4(resourceParams);
|
|
945
945
|
return luvio.dispatchResourceRequest(request, options)
|
|
946
946
|
.then(() => {
|
|
947
947
|
return luvio.handleSuccessResponse(() => {
|
|
@@ -949,7 +949,7 @@ function buildNetworkSnapshot$2(luvio, config, options) {
|
|
|
949
949
|
return luvio.storeBroadcast();
|
|
950
950
|
}, () => {
|
|
951
951
|
const cache = new StoreKeyMap();
|
|
952
|
-
getResponseCacheKeys$
|
|
952
|
+
getResponseCacheKeys$4(cache, luvio, resourceParams);
|
|
953
953
|
return cache;
|
|
954
954
|
});
|
|
955
955
|
}, (response) => {
|
|
@@ -959,17 +959,17 @@ function buildNetworkSnapshot$2(luvio, config, options) {
|
|
|
959
959
|
}
|
|
960
960
|
const deleteDataGraphAdapterFactory = (luvio) => {
|
|
961
961
|
return function CDPdeleteDataGraph(untrustedConfig) {
|
|
962
|
-
const config = validateAdapterConfig$
|
|
962
|
+
const config = validateAdapterConfig$4(untrustedConfig, deleteDataGraph_ConfigPropertyNames);
|
|
963
963
|
// Invalid or incomplete config
|
|
964
964
|
if (config === null) {
|
|
965
|
-
throw new Error(`Invalid config for "${adapterName$
|
|
965
|
+
throw new Error(`Invalid config for "${adapterName$4}"`);
|
|
966
966
|
}
|
|
967
|
-
return buildNetworkSnapshot$
|
|
967
|
+
return buildNetworkSnapshot$4(luvio, config);
|
|
968
968
|
};
|
|
969
969
|
};
|
|
970
970
|
|
|
971
|
-
const VERSION$
|
|
972
|
-
function validate$
|
|
971
|
+
const VERSION$2 = "0c1f279e921d51f73cd64db1eaef780c";
|
|
972
|
+
function validate$3(obj, path = 'CdpDataGraphRetryOutputRepresentation') {
|
|
973
973
|
const v_error = (() => {
|
|
974
974
|
if (typeof obj !== 'object' || ArrayIsArray(obj) || obj === null) {
|
|
975
975
|
return new TypeError('Expected "object" but received "' + typeof obj + '" (at "' + path + '")');
|
|
@@ -992,68 +992,68 @@ function validate$2(obj, path = 'CdpDataGraphRetryOutputRepresentation') {
|
|
|
992
992
|
})();
|
|
993
993
|
return v_error === undefined ? null : v_error;
|
|
994
994
|
}
|
|
995
|
-
const RepresentationType$
|
|
996
|
-
function keyBuilder$
|
|
997
|
-
return keyPrefix + '::' + RepresentationType$
|
|
995
|
+
const RepresentationType$2 = 'CdpDataGraphRetryOutputRepresentation';
|
|
996
|
+
function keyBuilder$6(luvio, config) {
|
|
997
|
+
return keyPrefix + '::' + RepresentationType$2 + ':' + config.name;
|
|
998
998
|
}
|
|
999
|
-
function keyBuilderFromType$
|
|
999
|
+
function keyBuilderFromType$2(luvio, object) {
|
|
1000
1000
|
const keyParams = {
|
|
1001
1001
|
name: object.dataGraphName
|
|
1002
1002
|
};
|
|
1003
|
-
return keyBuilder$
|
|
1003
|
+
return keyBuilder$6(luvio, keyParams);
|
|
1004
1004
|
}
|
|
1005
|
-
function normalize$
|
|
1005
|
+
function normalize$2(input, existing, path, luvio, store, timestamp) {
|
|
1006
1006
|
return input;
|
|
1007
1007
|
}
|
|
1008
|
-
const select$
|
|
1008
|
+
const select$6 = function CdpDataGraphRetryOutputRepresentationSelect() {
|
|
1009
1009
|
return {
|
|
1010
1010
|
kind: 'Fragment',
|
|
1011
|
-
version: VERSION$
|
|
1011
|
+
version: VERSION$2,
|
|
1012
1012
|
private: [],
|
|
1013
1013
|
opaque: true
|
|
1014
1014
|
};
|
|
1015
1015
|
};
|
|
1016
|
-
function equals$
|
|
1016
|
+
function equals$3(existing, incoming) {
|
|
1017
1017
|
if (JSONStringify(incoming) !== JSONStringify(existing)) {
|
|
1018
1018
|
return false;
|
|
1019
1019
|
}
|
|
1020
1020
|
return true;
|
|
1021
1021
|
}
|
|
1022
|
-
const ingest$
|
|
1022
|
+
const ingest$2 = function CdpDataGraphRetryOutputRepresentationIngest(input, path, luvio, store, timestamp) {
|
|
1023
1023
|
if (process.env.NODE_ENV !== 'production') {
|
|
1024
|
-
const validateError = validate$
|
|
1024
|
+
const validateError = validate$3(input);
|
|
1025
1025
|
if (validateError !== null) {
|
|
1026
1026
|
throw validateError;
|
|
1027
1027
|
}
|
|
1028
1028
|
}
|
|
1029
|
-
const key = keyBuilderFromType$
|
|
1029
|
+
const key = keyBuilderFromType$2(luvio, input);
|
|
1030
1030
|
const ttlToUse = path.ttl !== undefined ? path.ttl : 3000000;
|
|
1031
|
-
ingestShape(input, path, luvio, store, timestamp, ttlToUse, key, normalize$
|
|
1031
|
+
ingestShape(input, path, luvio, store, timestamp, ttlToUse, key, normalize$2, "CDP", VERSION$2, RepresentationType$2, equals$3);
|
|
1032
1032
|
return createLink(key);
|
|
1033
1033
|
};
|
|
1034
|
-
function getTypeCacheKeys$
|
|
1034
|
+
function getTypeCacheKeys$2(rootKeySet, luvio, input, fullPathFactory) {
|
|
1035
1035
|
// root cache key (uses fullPathFactory if keyBuilderFromType isn't defined)
|
|
1036
|
-
const rootKey = keyBuilderFromType$
|
|
1036
|
+
const rootKey = keyBuilderFromType$2(luvio, input);
|
|
1037
1037
|
rootKeySet.set(rootKey, {
|
|
1038
1038
|
namespace: keyPrefix,
|
|
1039
|
-
representationName: RepresentationType$
|
|
1039
|
+
representationName: RepresentationType$2,
|
|
1040
1040
|
mergeable: false
|
|
1041
1041
|
});
|
|
1042
1042
|
}
|
|
1043
1043
|
|
|
1044
|
-
function select$
|
|
1045
|
-
return select$
|
|
1044
|
+
function select$5(luvio, params) {
|
|
1045
|
+
return select$6();
|
|
1046
1046
|
}
|
|
1047
|
-
function getResponseCacheKeys$
|
|
1048
|
-
getTypeCacheKeys$
|
|
1047
|
+
function getResponseCacheKeys$3(storeKeyMap, luvio, resourceParams, response) {
|
|
1048
|
+
getTypeCacheKeys$2(storeKeyMap, luvio, response);
|
|
1049
1049
|
}
|
|
1050
|
-
function ingestSuccess$
|
|
1050
|
+
function ingestSuccess$3(luvio, resourceParams, response) {
|
|
1051
1051
|
const { body } = response;
|
|
1052
|
-
const key = keyBuilderFromType$
|
|
1053
|
-
luvio.storeIngest(key, ingest$
|
|
1052
|
+
const key = keyBuilderFromType$2(luvio, body);
|
|
1053
|
+
luvio.storeIngest(key, ingest$2, body);
|
|
1054
1054
|
const snapshot = luvio.storeLookup({
|
|
1055
1055
|
recordId: key,
|
|
1056
|
-
node: select$
|
|
1056
|
+
node: select$5(),
|
|
1057
1057
|
variables: {},
|
|
1058
1058
|
});
|
|
1059
1059
|
if (process.env.NODE_ENV !== 'production') {
|
|
@@ -1064,7 +1064,7 @@ function ingestSuccess$1(luvio, resourceParams, response) {
|
|
|
1064
1064
|
deepFreeze(snapshot.data);
|
|
1065
1065
|
return snapshot;
|
|
1066
1066
|
}
|
|
1067
|
-
function createResourceRequest$
|
|
1067
|
+
function createResourceRequest$3(config) {
|
|
1068
1068
|
const headers = {};
|
|
1069
1069
|
return {
|
|
1070
1070
|
baseUri: '/services/data/v61.0',
|
|
@@ -1078,41 +1078,41 @@ function createResourceRequest$1(config) {
|
|
|
1078
1078
|
};
|
|
1079
1079
|
}
|
|
1080
1080
|
|
|
1081
|
-
const adapterName$
|
|
1081
|
+
const adapterName$3 = 'retryDataGraph';
|
|
1082
1082
|
const retryDataGraph_ConfigPropertyMetadata = [
|
|
1083
1083
|
generateParamConfigMetadata('dataGraphName', true, 2 /* Body */, 0 /* String */),
|
|
1084
1084
|
];
|
|
1085
|
-
const retryDataGraph_ConfigPropertyNames = /*#__PURE__*/ buildAdapterValidationConfig(adapterName$
|
|
1086
|
-
const createResourceParams$
|
|
1087
|
-
function typeCheckConfig$
|
|
1085
|
+
const retryDataGraph_ConfigPropertyNames = /*#__PURE__*/ buildAdapterValidationConfig(adapterName$3, retryDataGraph_ConfigPropertyMetadata);
|
|
1086
|
+
const createResourceParams$3 = /*#__PURE__*/ createResourceParams$7(retryDataGraph_ConfigPropertyMetadata);
|
|
1087
|
+
function typeCheckConfig$3(untrustedConfig) {
|
|
1088
1088
|
const config = {};
|
|
1089
|
-
typeCheckConfig$
|
|
1089
|
+
typeCheckConfig$7(untrustedConfig, config, retryDataGraph_ConfigPropertyMetadata);
|
|
1090
1090
|
return config;
|
|
1091
1091
|
}
|
|
1092
|
-
function validateAdapterConfig$
|
|
1092
|
+
function validateAdapterConfig$3(untrustedConfig, configPropertyNames) {
|
|
1093
1093
|
if (!untrustedIsObject(untrustedConfig)) {
|
|
1094
1094
|
return null;
|
|
1095
1095
|
}
|
|
1096
1096
|
if (process.env.NODE_ENV !== 'production') {
|
|
1097
1097
|
validateConfig(untrustedConfig, configPropertyNames);
|
|
1098
1098
|
}
|
|
1099
|
-
const config = typeCheckConfig$
|
|
1099
|
+
const config = typeCheckConfig$3(untrustedConfig);
|
|
1100
1100
|
if (!areRequiredParametersPresent(config, configPropertyNames)) {
|
|
1101
1101
|
return null;
|
|
1102
1102
|
}
|
|
1103
1103
|
return config;
|
|
1104
1104
|
}
|
|
1105
|
-
function buildNetworkSnapshot$
|
|
1106
|
-
const resourceParams = createResourceParams$
|
|
1107
|
-
const request = createResourceRequest$
|
|
1105
|
+
function buildNetworkSnapshot$3(luvio, config, options) {
|
|
1106
|
+
const resourceParams = createResourceParams$3(config);
|
|
1107
|
+
const request = createResourceRequest$3(resourceParams);
|
|
1108
1108
|
return luvio.dispatchResourceRequest(request, options)
|
|
1109
1109
|
.then((response) => {
|
|
1110
1110
|
return luvio.handleSuccessResponse(() => {
|
|
1111
|
-
const snapshot = ingestSuccess$
|
|
1111
|
+
const snapshot = ingestSuccess$3(luvio, resourceParams, response);
|
|
1112
1112
|
return luvio.storeBroadcast().then(() => snapshot);
|
|
1113
1113
|
}, () => {
|
|
1114
1114
|
const cache = new StoreKeyMap();
|
|
1115
|
-
getResponseCacheKeys$
|
|
1115
|
+
getResponseCacheKeys$3(cache, luvio, resourceParams, response.body);
|
|
1116
1116
|
return cache;
|
|
1117
1117
|
});
|
|
1118
1118
|
}, (response) => {
|
|
@@ -1122,16 +1122,16 @@ function buildNetworkSnapshot$1(luvio, config, options) {
|
|
|
1122
1122
|
}
|
|
1123
1123
|
const retryDataGraphAdapterFactory = (luvio) => {
|
|
1124
1124
|
return function retryDataGraph(untrustedConfig) {
|
|
1125
|
-
const config = validateAdapterConfig$
|
|
1125
|
+
const config = validateAdapterConfig$3(untrustedConfig, retryDataGraph_ConfigPropertyNames);
|
|
1126
1126
|
// Invalid or incomplete config
|
|
1127
1127
|
if (config === null) {
|
|
1128
1128
|
throw new Error('Invalid config for "retryDataGraph"');
|
|
1129
1129
|
}
|
|
1130
|
-
return buildNetworkSnapshot$
|
|
1130
|
+
return buildNetworkSnapshot$3(luvio, config);
|
|
1131
1131
|
};
|
|
1132
1132
|
};
|
|
1133
1133
|
|
|
1134
|
-
function validate$
|
|
1134
|
+
function validate$2(obj, path = 'DependencyOutputRepresentation') {
|
|
1135
1135
|
const v_error = (() => {
|
|
1136
1136
|
if (typeof obj !== 'object' || ArrayIsArray(obj) || obj === null) {
|
|
1137
1137
|
return new TypeError('Expected "object" but received "' + typeof obj + '" (at "' + path + '")');
|
|
@@ -1169,7 +1169,7 @@ function validate$1(obj, path = 'DependencyOutputRepresentation') {
|
|
|
1169
1169
|
})();
|
|
1170
1170
|
return v_error === undefined ? null : v_error;
|
|
1171
1171
|
}
|
|
1172
|
-
function equals$
|
|
1172
|
+
function equals$2(existing, incoming) {
|
|
1173
1173
|
const existing_linkable = existing.linkable;
|
|
1174
1174
|
const incoming_linkable = incoming.linkable;
|
|
1175
1175
|
if (!(existing_linkable === incoming_linkable)) {
|
|
@@ -1203,9 +1203,9 @@ function equals$1(existing, incoming) {
|
|
|
1203
1203
|
return true;
|
|
1204
1204
|
}
|
|
1205
1205
|
|
|
1206
|
-
const VERSION = "0c15cc932d3ea4f07bf6a3b0429e3520";
|
|
1207
|
-
function validate(obj, path = 'CdpDataGraphDependencyOutputRepresentation') {
|
|
1208
|
-
const validateCdpObjectBaseOutputRepresentation_validateError = validate$
|
|
1206
|
+
const VERSION$1 = "0c15cc932d3ea4f07bf6a3b0429e3520";
|
|
1207
|
+
function validate$1(obj, path = 'CdpDataGraphDependencyOutputRepresentation') {
|
|
1208
|
+
const validateCdpObjectBaseOutputRepresentation_validateError = validate$9(obj, path);
|
|
1209
1209
|
if (validateCdpObjectBaseOutputRepresentation_validateError !== null) {
|
|
1210
1210
|
return validateCdpObjectBaseOutputRepresentation_validateError;
|
|
1211
1211
|
}
|
|
@@ -1221,7 +1221,7 @@ function validate(obj, path = 'CdpDataGraphDependencyOutputRepresentation') {
|
|
|
1221
1221
|
for (let i = 0; i < obj_dependency.length; i++) {
|
|
1222
1222
|
const obj_dependency_item = obj_dependency[i];
|
|
1223
1223
|
const path_dependency_item = path_dependency + '[' + i + ']';
|
|
1224
|
-
const referencepath_dependency_itemValidationError = validate$
|
|
1224
|
+
const referencepath_dependency_itemValidationError = validate$2(obj_dependency_item, path_dependency_item);
|
|
1225
1225
|
if (referencepath_dependency_itemValidationError !== null) {
|
|
1226
1226
|
let message = 'Object doesn\'t match DependencyOutputRepresentation (at "' + path_dependency_item + '")\n';
|
|
1227
1227
|
message += referencepath_dependency_itemValidationError.message.split('\n').map((line) => '\t' + line).join('\n');
|
|
@@ -1231,32 +1231,32 @@ function validate(obj, path = 'CdpDataGraphDependencyOutputRepresentation') {
|
|
|
1231
1231
|
})();
|
|
1232
1232
|
return v_error === undefined ? null : v_error;
|
|
1233
1233
|
}
|
|
1234
|
-
const RepresentationType = 'CdpDataGraphDependencyOutputRepresentation';
|
|
1235
|
-
function keyBuilder$
|
|
1236
|
-
return keyBuilder$
|
|
1234
|
+
const RepresentationType$1 = 'CdpDataGraphDependencyOutputRepresentation';
|
|
1235
|
+
function keyBuilder$5(luvio, config) {
|
|
1236
|
+
return keyBuilder$b(luvio, config);
|
|
1237
1237
|
}
|
|
1238
|
-
function keyBuilderFromType(luvio, object) {
|
|
1239
|
-
return keyBuilderFromType$
|
|
1238
|
+
function keyBuilderFromType$1(luvio, object) {
|
|
1239
|
+
return keyBuilderFromType$4(luvio, object);
|
|
1240
1240
|
}
|
|
1241
|
-
function normalize(input, existing, path, luvio, store, timestamp) {
|
|
1241
|
+
function normalize$1(input, existing, path, luvio, store, timestamp) {
|
|
1242
1242
|
return input;
|
|
1243
1243
|
}
|
|
1244
|
-
const select$
|
|
1244
|
+
const select$4 = function CdpDataGraphDependencyOutputRepresentationSelect() {
|
|
1245
1245
|
return {
|
|
1246
1246
|
kind: 'Fragment',
|
|
1247
|
-
version: VERSION,
|
|
1247
|
+
version: VERSION$1,
|
|
1248
1248
|
private: [],
|
|
1249
1249
|
opaque: true
|
|
1250
1250
|
};
|
|
1251
1251
|
};
|
|
1252
|
-
function equals(existing, incoming) {
|
|
1253
|
-
if (equals$
|
|
1252
|
+
function equals$1(existing, incoming) {
|
|
1253
|
+
if (equals$6(existing, incoming) === false) {
|
|
1254
1254
|
return false;
|
|
1255
1255
|
}
|
|
1256
1256
|
const existing_dependency = existing.dependency;
|
|
1257
1257
|
const incoming_dependency = incoming.dependency;
|
|
1258
1258
|
const equals_dependency_items = equalsArray(existing_dependency, incoming_dependency, (existing_dependency_item, incoming_dependency_item) => {
|
|
1259
|
-
if (!(equals$
|
|
1259
|
+
if (!(equals$2(existing_dependency_item, incoming_dependency_item))) {
|
|
1260
1260
|
return false;
|
|
1261
1261
|
}
|
|
1262
1262
|
});
|
|
@@ -1265,7 +1265,207 @@ function equals(existing, incoming) {
|
|
|
1265
1265
|
}
|
|
1266
1266
|
return true;
|
|
1267
1267
|
}
|
|
1268
|
-
const ingest = function CdpDataGraphDependencyOutputRepresentationIngest(input, path, luvio, store, timestamp) {
|
|
1268
|
+
const ingest$1 = function CdpDataGraphDependencyOutputRepresentationIngest(input, path, luvio, store, timestamp) {
|
|
1269
|
+
if (process.env.NODE_ENV !== 'production') {
|
|
1270
|
+
const validateError = validate$1(input);
|
|
1271
|
+
if (validateError !== null) {
|
|
1272
|
+
throw validateError;
|
|
1273
|
+
}
|
|
1274
|
+
}
|
|
1275
|
+
const key = keyBuilderFromType$1(luvio, input);
|
|
1276
|
+
const ttlToUse = path.ttl !== undefined ? path.ttl : 3000000;
|
|
1277
|
+
ingestShape(input, path, luvio, store, timestamp, ttlToUse, key, normalize$1, "CDP", VERSION$1, RepresentationType$1, equals$1);
|
|
1278
|
+
return createLink(key);
|
|
1279
|
+
};
|
|
1280
|
+
function getTypeCacheKeys$1(rootKeySet, luvio, input, fullPathFactory) {
|
|
1281
|
+
// root cache key (uses fullPathFactory if keyBuilderFromType isn't defined)
|
|
1282
|
+
const rootKey = keyBuilderFromType$1(luvio, input);
|
|
1283
|
+
rootKeySet.set(rootKey, {
|
|
1284
|
+
namespace: keyPrefix,
|
|
1285
|
+
representationName: RepresentationType$4,
|
|
1286
|
+
mergeable: false
|
|
1287
|
+
});
|
|
1288
|
+
}
|
|
1289
|
+
|
|
1290
|
+
function select$3(luvio, params) {
|
|
1291
|
+
return select$4();
|
|
1292
|
+
}
|
|
1293
|
+
function keyBuilder$4(luvio, params) {
|
|
1294
|
+
return keyBuilder$5(luvio, {
|
|
1295
|
+
name: params.urlParams.dataGraphName
|
|
1296
|
+
});
|
|
1297
|
+
}
|
|
1298
|
+
function getResponseCacheKeys$2(storeKeyMap, luvio, resourceParams, response) {
|
|
1299
|
+
getTypeCacheKeys$1(storeKeyMap, luvio, response);
|
|
1300
|
+
}
|
|
1301
|
+
function ingestSuccess$2(luvio, resourceParams, response, snapshotRefresh) {
|
|
1302
|
+
const { body } = response;
|
|
1303
|
+
const key = keyBuilder$4(luvio, resourceParams);
|
|
1304
|
+
luvio.storeIngest(key, ingest$1, body);
|
|
1305
|
+
const snapshot = luvio.storeLookup({
|
|
1306
|
+
recordId: key,
|
|
1307
|
+
node: select$3(),
|
|
1308
|
+
variables: {},
|
|
1309
|
+
}, snapshotRefresh);
|
|
1310
|
+
if (process.env.NODE_ENV !== 'production') {
|
|
1311
|
+
if (snapshot.state !== 'Fulfilled') {
|
|
1312
|
+
throw new Error('Invalid network response. Expected resource response to result in Fulfilled snapshot');
|
|
1313
|
+
}
|
|
1314
|
+
}
|
|
1315
|
+
deepFreeze(snapshot.data);
|
|
1316
|
+
return snapshot;
|
|
1317
|
+
}
|
|
1318
|
+
function ingestError$1(luvio, params, error, snapshotRefresh) {
|
|
1319
|
+
const key = keyBuilder$4(luvio, params);
|
|
1320
|
+
const errorSnapshot = luvio.errorSnapshot(error, snapshotRefresh);
|
|
1321
|
+
luvio.storeIngestError(key, errorSnapshot);
|
|
1322
|
+
return errorSnapshot;
|
|
1323
|
+
}
|
|
1324
|
+
function createResourceRequest$2(config) {
|
|
1325
|
+
const headers = {};
|
|
1326
|
+
return {
|
|
1327
|
+
baseUri: '/services/data/v61.0',
|
|
1328
|
+
basePath: '/ssot/data-graphs/dependency/' + config.urlParams.dataGraphName + '',
|
|
1329
|
+
method: 'get',
|
|
1330
|
+
body: null,
|
|
1331
|
+
urlParams: config.urlParams,
|
|
1332
|
+
queryParams: {},
|
|
1333
|
+
headers,
|
|
1334
|
+
priority: 'normal',
|
|
1335
|
+
};
|
|
1336
|
+
}
|
|
1337
|
+
|
|
1338
|
+
const adapterName$2 = 'getDataGraphDependency';
|
|
1339
|
+
const getDataGraphDependency_ConfigPropertyMetadata = [
|
|
1340
|
+
generateParamConfigMetadata('dataGraphName', true, 0 /* UrlParameter */, 0 /* String */),
|
|
1341
|
+
];
|
|
1342
|
+
const getDataGraphDependency_ConfigPropertyNames = /*#__PURE__*/ buildAdapterValidationConfig(adapterName$2, getDataGraphDependency_ConfigPropertyMetadata);
|
|
1343
|
+
const createResourceParams$2 = /*#__PURE__*/ createResourceParams$7(getDataGraphDependency_ConfigPropertyMetadata);
|
|
1344
|
+
function keyBuilder$3(luvio, config) {
|
|
1345
|
+
const resourceParams = createResourceParams$2(config);
|
|
1346
|
+
return keyBuilder$4(luvio, resourceParams);
|
|
1347
|
+
}
|
|
1348
|
+
function typeCheckConfig$2(untrustedConfig) {
|
|
1349
|
+
const config = {};
|
|
1350
|
+
typeCheckConfig$7(untrustedConfig, config, getDataGraphDependency_ConfigPropertyMetadata);
|
|
1351
|
+
return config;
|
|
1352
|
+
}
|
|
1353
|
+
function validateAdapterConfig$2(untrustedConfig, configPropertyNames) {
|
|
1354
|
+
if (!untrustedIsObject(untrustedConfig)) {
|
|
1355
|
+
return null;
|
|
1356
|
+
}
|
|
1357
|
+
if (process.env.NODE_ENV !== 'production') {
|
|
1358
|
+
validateConfig(untrustedConfig, configPropertyNames);
|
|
1359
|
+
}
|
|
1360
|
+
const config = typeCheckConfig$2(untrustedConfig);
|
|
1361
|
+
if (!areRequiredParametersPresent(config, configPropertyNames)) {
|
|
1362
|
+
return null;
|
|
1363
|
+
}
|
|
1364
|
+
return config;
|
|
1365
|
+
}
|
|
1366
|
+
function adapterFragment$1(luvio, config) {
|
|
1367
|
+
createResourceParams$2(config);
|
|
1368
|
+
return select$3();
|
|
1369
|
+
}
|
|
1370
|
+
function onFetchResponseSuccess$1(luvio, config, resourceParams, response) {
|
|
1371
|
+
const snapshot = ingestSuccess$2(luvio, resourceParams, response, {
|
|
1372
|
+
config,
|
|
1373
|
+
resolve: () => buildNetworkSnapshot$2(luvio, config, snapshotRefreshOptions)
|
|
1374
|
+
});
|
|
1375
|
+
return luvio.storeBroadcast().then(() => snapshot);
|
|
1376
|
+
}
|
|
1377
|
+
function onFetchResponseError$1(luvio, config, resourceParams, response) {
|
|
1378
|
+
const snapshot = ingestError$1(luvio, resourceParams, response, {
|
|
1379
|
+
config,
|
|
1380
|
+
resolve: () => buildNetworkSnapshot$2(luvio, config, snapshotRefreshOptions)
|
|
1381
|
+
});
|
|
1382
|
+
return luvio.storeBroadcast().then(() => snapshot);
|
|
1383
|
+
}
|
|
1384
|
+
function buildNetworkSnapshot$2(luvio, config, options) {
|
|
1385
|
+
const resourceParams = createResourceParams$2(config);
|
|
1386
|
+
const request = createResourceRequest$2(resourceParams);
|
|
1387
|
+
return luvio.dispatchResourceRequest(request, options)
|
|
1388
|
+
.then((response) => {
|
|
1389
|
+
return luvio.handleSuccessResponse(() => onFetchResponseSuccess$1(luvio, config, resourceParams, response), () => {
|
|
1390
|
+
const cache = new StoreKeyMap();
|
|
1391
|
+
getResponseCacheKeys$2(cache, luvio, resourceParams, response.body);
|
|
1392
|
+
return cache;
|
|
1393
|
+
});
|
|
1394
|
+
}, (response) => {
|
|
1395
|
+
return luvio.handleErrorResponse(() => onFetchResponseError$1(luvio, config, resourceParams, response));
|
|
1396
|
+
});
|
|
1397
|
+
}
|
|
1398
|
+
function buildNetworkSnapshotCachePolicy$1(context, coercedAdapterRequestContext) {
|
|
1399
|
+
return buildNetworkSnapshotCachePolicy$3(context, coercedAdapterRequestContext, buildNetworkSnapshot$2, undefined, false);
|
|
1400
|
+
}
|
|
1401
|
+
function buildCachedSnapshotCachePolicy$1(context, storeLookup) {
|
|
1402
|
+
const { luvio, config } = context;
|
|
1403
|
+
const selector = {
|
|
1404
|
+
recordId: keyBuilder$3(luvio, config),
|
|
1405
|
+
node: adapterFragment$1(luvio, config),
|
|
1406
|
+
variables: {},
|
|
1407
|
+
};
|
|
1408
|
+
const cacheSnapshot = storeLookup(selector, {
|
|
1409
|
+
config,
|
|
1410
|
+
resolve: () => buildNetworkSnapshot$2(luvio, config, snapshotRefreshOptions)
|
|
1411
|
+
});
|
|
1412
|
+
return cacheSnapshot;
|
|
1413
|
+
}
|
|
1414
|
+
const getDataGraphDependencyAdapterFactory = (luvio) => function CDP__getDataGraphDependency(untrustedConfig, requestContext) {
|
|
1415
|
+
const config = validateAdapterConfig$2(untrustedConfig, getDataGraphDependency_ConfigPropertyNames);
|
|
1416
|
+
// Invalid or incomplete config
|
|
1417
|
+
if (config === null) {
|
|
1418
|
+
return null;
|
|
1419
|
+
}
|
|
1420
|
+
return luvio.applyCachePolicy((requestContext || {}), { config, luvio }, // BuildSnapshotContext
|
|
1421
|
+
buildCachedSnapshotCachePolicy$1, buildNetworkSnapshotCachePolicy$1);
|
|
1422
|
+
};
|
|
1423
|
+
|
|
1424
|
+
const VERSION = "f772ba42e8976d22b7d5bfc77460f241";
|
|
1425
|
+
function validate(obj, path = 'CdpDataGraphDraftOutputRepresentation') {
|
|
1426
|
+
const v_error = (() => {
|
|
1427
|
+
if (typeof obj !== 'object' || ArrayIsArray(obj) || obj === null) {
|
|
1428
|
+
return new TypeError('Expected "object" but received "' + typeof obj + '" (at "' + path + '")');
|
|
1429
|
+
}
|
|
1430
|
+
const obj_outputRepresentation = obj.outputRepresentation;
|
|
1431
|
+
const path_outputRepresentation = path + '.outputRepresentation';
|
|
1432
|
+
const referencepath_outputRepresentationValidationError = validate$4(obj_outputRepresentation, path_outputRepresentation);
|
|
1433
|
+
if (referencepath_outputRepresentationValidationError !== null) {
|
|
1434
|
+
let message = 'Object doesn\'t match CdpDataGraphOutputRepresentation (at "' + path_outputRepresentation + '")\n';
|
|
1435
|
+
message += referencepath_outputRepresentationValidationError.message.split('\n').map((line) => '\t' + line).join('\n');
|
|
1436
|
+
return new TypeError(message);
|
|
1437
|
+
}
|
|
1438
|
+
})();
|
|
1439
|
+
return v_error === undefined ? null : v_error;
|
|
1440
|
+
}
|
|
1441
|
+
const RepresentationType = 'CdpDataGraphDraftOutputRepresentation';
|
|
1442
|
+
function keyBuilder$2(luvio, config) {
|
|
1443
|
+
return keyPrefix + '::' + RepresentationType + ':' + config.name;
|
|
1444
|
+
}
|
|
1445
|
+
function keyBuilderFromType(luvio, object) {
|
|
1446
|
+
const keyParams = {
|
|
1447
|
+
name: object.outputRepresentation.name
|
|
1448
|
+
};
|
|
1449
|
+
return keyBuilder$2(luvio, keyParams);
|
|
1450
|
+
}
|
|
1451
|
+
function normalize(input, existing, path, luvio, store, timestamp) {
|
|
1452
|
+
return input;
|
|
1453
|
+
}
|
|
1454
|
+
const select$2 = function CdpDataGraphDraftOutputRepresentationSelect() {
|
|
1455
|
+
return {
|
|
1456
|
+
kind: 'Fragment',
|
|
1457
|
+
version: VERSION,
|
|
1458
|
+
private: [],
|
|
1459
|
+
opaque: true
|
|
1460
|
+
};
|
|
1461
|
+
};
|
|
1462
|
+
function equals(existing, incoming) {
|
|
1463
|
+
if (JSONStringify(incoming) !== JSONStringify(existing)) {
|
|
1464
|
+
return false;
|
|
1465
|
+
}
|
|
1466
|
+
return true;
|
|
1467
|
+
}
|
|
1468
|
+
const ingest = function CdpDataGraphDraftOutputRepresentationIngest(input, path, luvio, store, timestamp) {
|
|
1269
1469
|
if (process.env.NODE_ENV !== 'production') {
|
|
1270
1470
|
const validateError = validate(input);
|
|
1271
1471
|
if (validateError !== null) {
|
|
@@ -1282,13 +1482,104 @@ function getTypeCacheKeys(rootKeySet, luvio, input, fullPathFactory) {
|
|
|
1282
1482
|
const rootKey = keyBuilderFromType(luvio, input);
|
|
1283
1483
|
rootKeySet.set(rootKey, {
|
|
1284
1484
|
namespace: keyPrefix,
|
|
1285
|
-
representationName: RepresentationType
|
|
1485
|
+
representationName: RepresentationType,
|
|
1286
1486
|
mergeable: false
|
|
1287
1487
|
});
|
|
1288
1488
|
}
|
|
1289
1489
|
|
|
1490
|
+
function select$1(luvio, params) {
|
|
1491
|
+
return select$2();
|
|
1492
|
+
}
|
|
1493
|
+
function getResponseCacheKeys$1(storeKeyMap, luvio, resourceParams, response) {
|
|
1494
|
+
getTypeCacheKeys(storeKeyMap, luvio, response);
|
|
1495
|
+
}
|
|
1496
|
+
function ingestSuccess$1(luvio, resourceParams, response) {
|
|
1497
|
+
const { body } = response;
|
|
1498
|
+
const key = keyBuilderFromType(luvio, body);
|
|
1499
|
+
luvio.storeIngest(key, ingest, body);
|
|
1500
|
+
const snapshot = luvio.storeLookup({
|
|
1501
|
+
recordId: key,
|
|
1502
|
+
node: select$1(),
|
|
1503
|
+
variables: {},
|
|
1504
|
+
});
|
|
1505
|
+
if (process.env.NODE_ENV !== 'production') {
|
|
1506
|
+
if (snapshot.state !== 'Fulfilled') {
|
|
1507
|
+
throw new Error('Invalid network response. Expected resource response to result in Fulfilled snapshot');
|
|
1508
|
+
}
|
|
1509
|
+
}
|
|
1510
|
+
deepFreeze(snapshot.data);
|
|
1511
|
+
return snapshot;
|
|
1512
|
+
}
|
|
1513
|
+
function createResourceRequest$1(config) {
|
|
1514
|
+
const headers = {};
|
|
1515
|
+
return {
|
|
1516
|
+
baseUri: '/services/data/v61.0',
|
|
1517
|
+
basePath: '/ssot/data-graphs/draft',
|
|
1518
|
+
method: 'post',
|
|
1519
|
+
body: config.body,
|
|
1520
|
+
urlParams: {},
|
|
1521
|
+
queryParams: {},
|
|
1522
|
+
headers,
|
|
1523
|
+
priority: 'normal',
|
|
1524
|
+
};
|
|
1525
|
+
}
|
|
1526
|
+
|
|
1527
|
+
const adapterName$1 = 'saveDataGraphDraft';
|
|
1528
|
+
const saveDataGraphDraft_ConfigPropertyMetadata = [
|
|
1529
|
+
generateParamConfigMetadata('dataGraphName', true, 2 /* Body */, 0 /* String */),
|
|
1530
|
+
generateParamConfigMetadata('jsonSchema', true, 2 /* Body */, 0 /* String */),
|
|
1531
|
+
];
|
|
1532
|
+
const saveDataGraphDraft_ConfigPropertyNames = /*#__PURE__*/ buildAdapterValidationConfig(adapterName$1, saveDataGraphDraft_ConfigPropertyMetadata);
|
|
1533
|
+
const createResourceParams$1 = /*#__PURE__*/ createResourceParams$7(saveDataGraphDraft_ConfigPropertyMetadata);
|
|
1534
|
+
function typeCheckConfig$1(untrustedConfig) {
|
|
1535
|
+
const config = {};
|
|
1536
|
+
typeCheckConfig$7(untrustedConfig, config, saveDataGraphDraft_ConfigPropertyMetadata);
|
|
1537
|
+
return config;
|
|
1538
|
+
}
|
|
1539
|
+
function validateAdapterConfig$1(untrustedConfig, configPropertyNames) {
|
|
1540
|
+
if (!untrustedIsObject(untrustedConfig)) {
|
|
1541
|
+
return null;
|
|
1542
|
+
}
|
|
1543
|
+
if (process.env.NODE_ENV !== 'production') {
|
|
1544
|
+
validateConfig(untrustedConfig, configPropertyNames);
|
|
1545
|
+
}
|
|
1546
|
+
const config = typeCheckConfig$1(untrustedConfig);
|
|
1547
|
+
if (!areRequiredParametersPresent(config, configPropertyNames)) {
|
|
1548
|
+
return null;
|
|
1549
|
+
}
|
|
1550
|
+
return config;
|
|
1551
|
+
}
|
|
1552
|
+
function buildNetworkSnapshot$1(luvio, config, options) {
|
|
1553
|
+
const resourceParams = createResourceParams$1(config);
|
|
1554
|
+
const request = createResourceRequest$1(resourceParams);
|
|
1555
|
+
return luvio.dispatchResourceRequest(request, options)
|
|
1556
|
+
.then((response) => {
|
|
1557
|
+
return luvio.handleSuccessResponse(() => {
|
|
1558
|
+
const snapshot = ingestSuccess$1(luvio, resourceParams, response);
|
|
1559
|
+
return luvio.storeBroadcast().then(() => snapshot);
|
|
1560
|
+
}, () => {
|
|
1561
|
+
const cache = new StoreKeyMap();
|
|
1562
|
+
getResponseCacheKeys$1(cache, luvio, resourceParams, response.body);
|
|
1563
|
+
return cache;
|
|
1564
|
+
});
|
|
1565
|
+
}, (response) => {
|
|
1566
|
+
deepFreeze(response);
|
|
1567
|
+
throw response;
|
|
1568
|
+
});
|
|
1569
|
+
}
|
|
1570
|
+
const saveDataGraphDraftAdapterFactory = (luvio) => {
|
|
1571
|
+
return function saveDataGraphDraft(untrustedConfig) {
|
|
1572
|
+
const config = validateAdapterConfig$1(untrustedConfig, saveDataGraphDraft_ConfigPropertyNames);
|
|
1573
|
+
// Invalid or incomplete config
|
|
1574
|
+
if (config === null) {
|
|
1575
|
+
throw new Error('Invalid config for "saveDataGraphDraft"');
|
|
1576
|
+
}
|
|
1577
|
+
return buildNetworkSnapshot$1(luvio, config);
|
|
1578
|
+
};
|
|
1579
|
+
};
|
|
1580
|
+
|
|
1290
1581
|
function select(luvio, params) {
|
|
1291
|
-
return select$
|
|
1582
|
+
return select$2();
|
|
1292
1583
|
}
|
|
1293
1584
|
function keyBuilder$1(luvio, params) {
|
|
1294
1585
|
return keyBuilder$2(luvio, {
|
|
@@ -1325,7 +1616,7 @@ function createResourceRequest(config) {
|
|
|
1325
1616
|
const headers = {};
|
|
1326
1617
|
return {
|
|
1327
1618
|
baseUri: '/services/data/v61.0',
|
|
1328
|
-
basePath: '/ssot/data-graphs/
|
|
1619
|
+
basePath: '/ssot/data-graphs/draft/' + config.urlParams.dataGraphName + '',
|
|
1329
1620
|
method: 'get',
|
|
1330
1621
|
body: null,
|
|
1331
1622
|
urlParams: config.urlParams,
|
|
@@ -1335,19 +1626,19 @@ function createResourceRequest(config) {
|
|
|
1335
1626
|
};
|
|
1336
1627
|
}
|
|
1337
1628
|
|
|
1338
|
-
const adapterName = '
|
|
1339
|
-
const
|
|
1629
|
+
const adapterName = 'getDataGraphDraft';
|
|
1630
|
+
const getDataGraphDraft_ConfigPropertyMetadata = [
|
|
1340
1631
|
generateParamConfigMetadata('dataGraphName', true, 0 /* UrlParameter */, 0 /* String */),
|
|
1341
1632
|
];
|
|
1342
|
-
const
|
|
1343
|
-
const createResourceParams = /*#__PURE__*/ createResourceParams$
|
|
1633
|
+
const getDataGraphDraft_ConfigPropertyNames = /*#__PURE__*/ buildAdapterValidationConfig(adapterName, getDataGraphDraft_ConfigPropertyMetadata);
|
|
1634
|
+
const createResourceParams = /*#__PURE__*/ createResourceParams$7(getDataGraphDraft_ConfigPropertyMetadata);
|
|
1344
1635
|
function keyBuilder(luvio, config) {
|
|
1345
1636
|
const resourceParams = createResourceParams(config);
|
|
1346
1637
|
return keyBuilder$1(luvio, resourceParams);
|
|
1347
1638
|
}
|
|
1348
1639
|
function typeCheckConfig(untrustedConfig) {
|
|
1349
1640
|
const config = {};
|
|
1350
|
-
typeCheckConfig$
|
|
1641
|
+
typeCheckConfig$7(untrustedConfig, config, getDataGraphDraft_ConfigPropertyMetadata);
|
|
1351
1642
|
return config;
|
|
1352
1643
|
}
|
|
1353
1644
|
function validateAdapterConfig(untrustedConfig, configPropertyNames) {
|
|
@@ -1396,7 +1687,7 @@ function buildNetworkSnapshot(luvio, config, options) {
|
|
|
1396
1687
|
});
|
|
1397
1688
|
}
|
|
1398
1689
|
function buildNetworkSnapshotCachePolicy(context, coercedAdapterRequestContext) {
|
|
1399
|
-
return buildNetworkSnapshotCachePolicy$
|
|
1690
|
+
return buildNetworkSnapshotCachePolicy$3(context, coercedAdapterRequestContext, buildNetworkSnapshot, undefined, false);
|
|
1400
1691
|
}
|
|
1401
1692
|
function buildCachedSnapshotCachePolicy(context, storeLookup) {
|
|
1402
1693
|
const { luvio, config } = context;
|
|
@@ -1411,8 +1702,8 @@ function buildCachedSnapshotCachePolicy(context, storeLookup) {
|
|
|
1411
1702
|
});
|
|
1412
1703
|
return cacheSnapshot;
|
|
1413
1704
|
}
|
|
1414
|
-
const
|
|
1415
|
-
const config = validateAdapterConfig(untrustedConfig,
|
|
1705
|
+
const getDataGraphDraftAdapterFactory = (luvio) => function CDP__getDataGraphDraft(untrustedConfig, requestContext) {
|
|
1706
|
+
const config = validateAdapterConfig(untrustedConfig, getDataGraphDraft_ConfigPropertyNames);
|
|
1416
1707
|
// Invalid or incomplete config
|
|
1417
1708
|
if (config === null) {
|
|
1418
1709
|
return null;
|
|
@@ -1421,4 +1712,4 @@ const getDataGraphDependencyAdapterFactory = (luvio) => function CDP__getDataGra
|
|
|
1421
1712
|
buildCachedSnapshotCachePolicy, buildNetworkSnapshotCachePolicy);
|
|
1422
1713
|
};
|
|
1423
1714
|
|
|
1424
|
-
export { createDataGraphAdapterFactory, deleteDataGraphAdapterFactory, getDataGraphAdapterFactory, getDataGraphDependencyAdapterFactory, retryDataGraphAdapterFactory };
|
|
1715
|
+
export { createDataGraphAdapterFactory, deleteDataGraphAdapterFactory, getDataGraphAdapterFactory, getDataGraphDependencyAdapterFactory, getDataGraphDraftAdapterFactory, retryDataGraphAdapterFactory, saveDataGraphDraftAdapterFactory };
|