@salesforce/lds-adapters-marketing-cdp 1.160.0 → 1.161.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 +300 -109
- package/dist/es/es2018/types/src/generated/adapters/retryDataGraph.d.ts +14 -0
- package/dist/es/es2018/types/src/generated/artifacts/main.d.ts +1 -0
- package/dist/es/es2018/types/src/generated/artifacts/sfdc.d.ts +2 -1
- package/dist/es/es2018/types/src/generated/resources/putSsotApplicationDataGraphsRetry.d.ts +12 -0
- package/dist/es/es2018/types/src/generated/types/CdpDataGraphRetryInputRepresentation.d.ts +28 -0
- package/dist/es/es2018/types/src/generated/types/CdpDataGraphRetryOutputRepresentation.d.ts +43 -0
- package/package.json +1 -1
- package/sfdc/index.js +309 -115
|
@@ -58,7 +58,7 @@ function createLink(ref) {
|
|
|
58
58
|
};
|
|
59
59
|
}
|
|
60
60
|
|
|
61
|
-
function validate$
|
|
61
|
+
function validate$6(obj, path = 'CdpObjectBaseOutputRepresentation') {
|
|
62
62
|
const v_error = (() => {
|
|
63
63
|
if (typeof obj !== 'object' || ArrayIsArray(obj) || obj === null) {
|
|
64
64
|
return new TypeError('Expected "object" but received "' + typeof obj + '" (at "' + path + '")');
|
|
@@ -132,24 +132,24 @@ function validate$5(obj, path = 'CdpObjectBaseOutputRepresentation') {
|
|
|
132
132
|
})();
|
|
133
133
|
return v_error === undefined ? null : v_error;
|
|
134
134
|
}
|
|
135
|
-
const RepresentationType$
|
|
136
|
-
function keyBuilder$
|
|
137
|
-
return keyPrefix + '::' + RepresentationType$
|
|
135
|
+
const RepresentationType$2 = 'CdpObjectBaseOutputRepresentation';
|
|
136
|
+
function keyBuilder$5(luvio, config) {
|
|
137
|
+
return keyPrefix + '::' + RepresentationType$2 + ':' + config.name;
|
|
138
138
|
}
|
|
139
|
-
function keyBuilderFromType$
|
|
139
|
+
function keyBuilderFromType$2(luvio, object) {
|
|
140
140
|
const keyParams = {
|
|
141
141
|
name: object.name
|
|
142
142
|
};
|
|
143
|
-
return keyBuilder$
|
|
143
|
+
return keyBuilder$5(luvio, keyParams);
|
|
144
144
|
}
|
|
145
|
-
function equals$
|
|
145
|
+
function equals$3(existing, incoming) {
|
|
146
146
|
if (JSONStringify(incoming) !== JSONStringify(existing)) {
|
|
147
147
|
return false;
|
|
148
148
|
}
|
|
149
149
|
return true;
|
|
150
150
|
}
|
|
151
151
|
|
|
152
|
-
function validate$
|
|
152
|
+
function validate$5(obj, path = 'CdpApplicationDataGraphFieldOutputRepresentation') {
|
|
153
153
|
const v_error = (() => {
|
|
154
154
|
if (typeof obj !== 'object' || ArrayIsArray(obj) || obj === null) {
|
|
155
155
|
return new TypeError('Expected "object" but received "' + typeof obj + '" (at "' + path + '")');
|
|
@@ -168,7 +168,7 @@ function validate$4(obj, path = 'CdpApplicationDataGraphFieldOutputRepresentatio
|
|
|
168
168
|
return v_error === undefined ? null : v_error;
|
|
169
169
|
}
|
|
170
170
|
|
|
171
|
-
function validate$
|
|
171
|
+
function validate$4(obj, path = 'CdpApplicationDataGraphPathToParentOutputRepresentation') {
|
|
172
172
|
const v_error = (() => {
|
|
173
173
|
if (typeof obj !== 'object' || ArrayIsArray(obj) || obj === null) {
|
|
174
174
|
return new TypeError('Expected "object" but received "' + typeof obj + '" (at "' + path + '")');
|
|
@@ -187,7 +187,7 @@ function validate$3(obj, path = 'CdpApplicationDataGraphPathToParentOutputRepres
|
|
|
187
187
|
return v_error === undefined ? null : v_error;
|
|
188
188
|
}
|
|
189
189
|
|
|
190
|
-
function validate$
|
|
190
|
+
function validate$3(obj, path = 'CdpApplicationDataGraphRecencyCriteriaOutputRepresentation') {
|
|
191
191
|
const v_error = (() => {
|
|
192
192
|
if (typeof obj !== 'object' || ArrayIsArray(obj) || obj === null) {
|
|
193
193
|
return new TypeError('Expected "object" but received "' + typeof obj + '" (at "' + path + '")');
|
|
@@ -216,7 +216,7 @@ function validate$2(obj, path = 'CdpApplicationDataGraphRecencyCriteriaOutputRep
|
|
|
216
216
|
return v_error === undefined ? null : v_error;
|
|
217
217
|
}
|
|
218
218
|
|
|
219
|
-
function validate$
|
|
219
|
+
function validate$2(obj, path = 'CdpApplicationDataGraphSourceObjectOutputRepresentation') {
|
|
220
220
|
const v_error = (() => {
|
|
221
221
|
if (typeof obj !== 'object' || ArrayIsArray(obj) || obj === null) {
|
|
222
222
|
return new TypeError('Expected "object" but received "' + typeof obj + '" (at "' + path + '")');
|
|
@@ -229,7 +229,7 @@ function validate$1(obj, path = 'CdpApplicationDataGraphSourceObjectOutputRepres
|
|
|
229
229
|
for (let i = 0; i < obj_fields.length; i++) {
|
|
230
230
|
const obj_fields_item = obj_fields[i];
|
|
231
231
|
const path_fields_item = path_fields + '[' + i + ']';
|
|
232
|
-
const referencepath_fields_itemValidationError = validate$
|
|
232
|
+
const referencepath_fields_itemValidationError = validate$5(obj_fields_item, path_fields_item);
|
|
233
233
|
if (referencepath_fields_itemValidationError !== null) {
|
|
234
234
|
let message = 'Object doesn\'t match CdpApplicationDataGraphFieldOutputRepresentation (at "' + path_fields_item + '")\n';
|
|
235
235
|
message += referencepath_fields_itemValidationError.message.split('\n').map((line) => '\t' + line).join('\n');
|
|
@@ -245,7 +245,7 @@ function validate$1(obj, path = 'CdpApplicationDataGraphSourceObjectOutputRepres
|
|
|
245
245
|
for (let i = 0; i < obj_path.length; i++) {
|
|
246
246
|
const obj_path_item = obj_path[i];
|
|
247
247
|
const path_path_item = path_path + '[' + i + ']';
|
|
248
|
-
const referencepath_path_itemValidationError = validate$
|
|
248
|
+
const referencepath_path_itemValidationError = validate$4(obj_path_item, path_path_item);
|
|
249
249
|
if (referencepath_path_itemValidationError !== null) {
|
|
250
250
|
let message = 'Object doesn\'t match CdpApplicationDataGraphPathToParentOutputRepresentation (at "' + path_path_item + '")\n';
|
|
251
251
|
message += referencepath_path_itemValidationError.message.split('\n').map((line) => '\t' + line).join('\n');
|
|
@@ -256,7 +256,7 @@ function validate$1(obj, path = 'CdpApplicationDataGraphSourceObjectOutputRepres
|
|
|
256
256
|
if (obj.recencyCriteria !== undefined) {
|
|
257
257
|
const obj_recencyCriteria = obj.recencyCriteria;
|
|
258
258
|
const path_recencyCriteria = path + '.recencyCriteria';
|
|
259
|
-
const referencepath_recencyCriteriaValidationError = validate$
|
|
259
|
+
const referencepath_recencyCriteriaValidationError = validate$3(obj_recencyCriteria, path_recencyCriteria);
|
|
260
260
|
if (referencepath_recencyCriteriaValidationError !== null) {
|
|
261
261
|
let message = 'Object doesn\'t match CdpApplicationDataGraphRecencyCriteriaOutputRepresentation (at "' + path_recencyCriteria + '")\n';
|
|
262
262
|
message += referencepath_recencyCriteriaValidationError.message.split('\n').map((line) => '\t' + line).join('\n');
|
|
@@ -283,16 +283,16 @@ function validate$1(obj, path = 'CdpApplicationDataGraphSourceObjectOutputRepres
|
|
|
283
283
|
})();
|
|
284
284
|
return v_error === undefined ? null : v_error;
|
|
285
285
|
}
|
|
286
|
-
function equals$
|
|
286
|
+
function equals$2(existing, incoming) {
|
|
287
287
|
if (JSONStringify(incoming) !== JSONStringify(existing)) {
|
|
288
288
|
return false;
|
|
289
289
|
}
|
|
290
290
|
return true;
|
|
291
291
|
}
|
|
292
292
|
|
|
293
|
-
const VERSION = "4b0a63cfd4548d05f499d3b760f52560";
|
|
294
|
-
function validate(obj, path = 'CdpApplicationDataGraphOutputRepresentation') {
|
|
295
|
-
const validateCdpObjectBaseOutputRepresentation_validateError = validate$
|
|
293
|
+
const VERSION$1 = "4b0a63cfd4548d05f499d3b760f52560";
|
|
294
|
+
function validate$1(obj, path = 'CdpApplicationDataGraphOutputRepresentation') {
|
|
295
|
+
const validateCdpObjectBaseOutputRepresentation_validateError = validate$6(obj, path);
|
|
296
296
|
if (validateCdpObjectBaseOutputRepresentation_validateError !== null) {
|
|
297
297
|
return validateCdpObjectBaseOutputRepresentation_validateError;
|
|
298
298
|
}
|
|
@@ -322,7 +322,7 @@ function validate(obj, path = 'CdpApplicationDataGraphOutputRepresentation') {
|
|
|
322
322
|
}
|
|
323
323
|
const obj_sourceObject = obj.sourceObject;
|
|
324
324
|
const path_sourceObject = path + '.sourceObject';
|
|
325
|
-
const referencepath_sourceObjectValidationError = validate$
|
|
325
|
+
const referencepath_sourceObjectValidationError = validate$2(obj_sourceObject, path_sourceObject);
|
|
326
326
|
if (referencepath_sourceObjectValidationError !== null) {
|
|
327
327
|
let message = 'Object doesn\'t match CdpApplicationDataGraphSourceObjectOutputRepresentation (at "' + path_sourceObject + '")\n';
|
|
328
328
|
message += referencepath_sourceObjectValidationError.message.split('\n').map((line) => '\t' + line).join('\n');
|
|
@@ -346,26 +346,26 @@ function validate(obj, path = 'CdpApplicationDataGraphOutputRepresentation') {
|
|
|
346
346
|
})();
|
|
347
347
|
return v_error === undefined ? null : v_error;
|
|
348
348
|
}
|
|
349
|
-
const RepresentationType = 'CdpApplicationDataGraphOutputRepresentation';
|
|
350
|
-
function keyBuilder$
|
|
351
|
-
return keyBuilder$
|
|
349
|
+
const RepresentationType$1 = 'CdpApplicationDataGraphOutputRepresentation';
|
|
350
|
+
function keyBuilder$4(luvio, config) {
|
|
351
|
+
return keyBuilder$5(luvio, config);
|
|
352
352
|
}
|
|
353
|
-
function keyBuilderFromType(luvio, object) {
|
|
354
|
-
return keyBuilderFromType$
|
|
353
|
+
function keyBuilderFromType$1(luvio, object) {
|
|
354
|
+
return keyBuilderFromType$2(luvio, object);
|
|
355
355
|
}
|
|
356
|
-
function normalize(input, existing, path, luvio, store, timestamp) {
|
|
356
|
+
function normalize$1(input, existing, path, luvio, store, timestamp) {
|
|
357
357
|
return input;
|
|
358
358
|
}
|
|
359
|
-
const select$
|
|
359
|
+
const select$4 = function CdpApplicationDataGraphOutputRepresentationSelect() {
|
|
360
360
|
return {
|
|
361
361
|
kind: 'Fragment',
|
|
362
|
-
version: VERSION,
|
|
362
|
+
version: VERSION$1,
|
|
363
363
|
private: [],
|
|
364
364
|
opaque: true
|
|
365
365
|
};
|
|
366
366
|
};
|
|
367
|
-
function equals(existing, incoming) {
|
|
368
|
-
if (equals$
|
|
367
|
+
function equals$1(existing, incoming) {
|
|
368
|
+
if (equals$3(existing, incoming) === false) {
|
|
369
369
|
return false;
|
|
370
370
|
}
|
|
371
371
|
const existing_extendedProperties = existing.extendedProperties;
|
|
@@ -405,66 +405,66 @@ function equals(existing, incoming) {
|
|
|
405
405
|
}
|
|
406
406
|
const existing_sourceObject = existing.sourceObject;
|
|
407
407
|
const incoming_sourceObject = incoming.sourceObject;
|
|
408
|
-
if (!(equals$
|
|
408
|
+
if (!(equals$2(existing_sourceObject, incoming_sourceObject))) {
|
|
409
409
|
return false;
|
|
410
410
|
}
|
|
411
411
|
return true;
|
|
412
412
|
}
|
|
413
|
-
const ingest = function CdpApplicationDataGraphOutputRepresentationIngest(input, path, luvio, store, timestamp) {
|
|
413
|
+
const ingest$1 = function CdpApplicationDataGraphOutputRepresentationIngest(input, path, luvio, store, timestamp) {
|
|
414
414
|
if (process.env.NODE_ENV !== 'production') {
|
|
415
|
-
const validateError = validate(input);
|
|
415
|
+
const validateError = validate$1(input);
|
|
416
416
|
if (validateError !== null) {
|
|
417
417
|
throw validateError;
|
|
418
418
|
}
|
|
419
419
|
}
|
|
420
|
-
const key = keyBuilderFromType(luvio, input);
|
|
420
|
+
const key = keyBuilderFromType$1(luvio, input);
|
|
421
421
|
const existingRecord = store.readEntry(key);
|
|
422
422
|
const ttlToUse = path.ttl !== undefined ? path.ttl : 3000000;
|
|
423
|
-
let incomingRecord = normalize(input, store.readEntry(key), {
|
|
423
|
+
let incomingRecord = normalize$1(input, store.readEntry(key), {
|
|
424
424
|
fullPath: key,
|
|
425
425
|
parent: path.parent,
|
|
426
426
|
propertyName: path.propertyName,
|
|
427
427
|
ttl: ttlToUse
|
|
428
428
|
});
|
|
429
|
-
if (existingRecord === undefined || equals(existingRecord, incomingRecord) === false) {
|
|
429
|
+
if (existingRecord === undefined || equals$1(existingRecord, incomingRecord) === false) {
|
|
430
430
|
luvio.storePublish(key, incomingRecord);
|
|
431
431
|
}
|
|
432
432
|
if (ttlToUse !== undefined) {
|
|
433
433
|
const storeMetadataParams = {
|
|
434
434
|
ttl: ttlToUse,
|
|
435
435
|
namespace: "CDP",
|
|
436
|
-
version: VERSION,
|
|
437
|
-
representationName: RepresentationType,
|
|
436
|
+
version: VERSION$1,
|
|
437
|
+
representationName: RepresentationType$1,
|
|
438
438
|
};
|
|
439
439
|
luvio.publishStoreMetadata(key, storeMetadataParams);
|
|
440
440
|
}
|
|
441
441
|
return createLink(key);
|
|
442
442
|
};
|
|
443
|
-
function getTypeCacheKeys(luvio, input, fullPathFactory) {
|
|
443
|
+
function getTypeCacheKeys$1(luvio, input, fullPathFactory) {
|
|
444
444
|
const rootKeySet = new StoreKeyMap();
|
|
445
445
|
// root cache key (uses fullPathFactory if keyBuilderFromType isn't defined)
|
|
446
|
-
const rootKey = keyBuilderFromType(luvio, input);
|
|
446
|
+
const rootKey = keyBuilderFromType$1(luvio, input);
|
|
447
447
|
rootKeySet.set(rootKey, {
|
|
448
448
|
namespace: keyPrefix,
|
|
449
|
-
representationName: RepresentationType$
|
|
449
|
+
representationName: RepresentationType$2,
|
|
450
450
|
mergeable: false
|
|
451
451
|
});
|
|
452
452
|
return rootKeySet;
|
|
453
453
|
}
|
|
454
454
|
|
|
455
|
-
function select$
|
|
456
|
-
return select$
|
|
455
|
+
function select$3(luvio, params) {
|
|
456
|
+
return select$4();
|
|
457
457
|
}
|
|
458
|
-
function getResponseCacheKeys$
|
|
459
|
-
return getTypeCacheKeys(luvio, response);
|
|
458
|
+
function getResponseCacheKeys$3(luvio, resourceParams, response) {
|
|
459
|
+
return getTypeCacheKeys$1(luvio, response);
|
|
460
460
|
}
|
|
461
|
-
function ingestSuccess$
|
|
461
|
+
function ingestSuccess$2(luvio, resourceParams, response) {
|
|
462
462
|
const { body } = response;
|
|
463
|
-
const key = keyBuilderFromType(luvio, body);
|
|
464
|
-
luvio.storeIngest(key, ingest, body);
|
|
463
|
+
const key = keyBuilderFromType$1(luvio, body);
|
|
464
|
+
luvio.storeIngest(key, ingest$1, body);
|
|
465
465
|
const snapshot = luvio.storeLookup({
|
|
466
466
|
recordId: key,
|
|
467
|
-
node: select$
|
|
467
|
+
node: select$3(),
|
|
468
468
|
variables: {},
|
|
469
469
|
});
|
|
470
470
|
if (process.env.NODE_ENV !== 'production') {
|
|
@@ -475,7 +475,7 @@ function ingestSuccess$1(luvio, resourceParams, response) {
|
|
|
475
475
|
deepFreeze(snapshot.data);
|
|
476
476
|
return snapshot;
|
|
477
477
|
}
|
|
478
|
-
function createResourceRequest$
|
|
478
|
+
function createResourceRequest$3(config) {
|
|
479
479
|
const headers = {};
|
|
480
480
|
return {
|
|
481
481
|
baseUri: '/services/data/v58.0',
|
|
@@ -496,7 +496,7 @@ const createAdg_ConfigPropertyNames = {
|
|
|
496
496
|
optional: ['dataspaceName', 'description', 'label', 'name']
|
|
497
497
|
}
|
|
498
498
|
};
|
|
499
|
-
function createResourceParams$
|
|
499
|
+
function createResourceParams$3(config) {
|
|
500
500
|
const resourceParams = {
|
|
501
501
|
body: {
|
|
502
502
|
primaryObjectName: config.primaryObjectName, primaryObjectType: config.primaryObjectType, sourceObject: config.sourceObject
|
|
@@ -516,7 +516,7 @@ function createResourceParams$2(config) {
|
|
|
516
516
|
}
|
|
517
517
|
return resourceParams;
|
|
518
518
|
}
|
|
519
|
-
function typeCheckConfig$
|
|
519
|
+
function typeCheckConfig$3(untrustedConfig) {
|
|
520
520
|
const config = {};
|
|
521
521
|
const untrustedConfig_dataspaceName = untrustedConfig.dataspaceName;
|
|
522
522
|
if (typeof untrustedConfig_dataspaceName === 'string') {
|
|
@@ -546,28 +546,28 @@ function typeCheckConfig$2(untrustedConfig) {
|
|
|
546
546
|
config.sourceObject = untrustedConfig_sourceObject;
|
|
547
547
|
return config;
|
|
548
548
|
}
|
|
549
|
-
function validateAdapterConfig$
|
|
549
|
+
function validateAdapterConfig$3(untrustedConfig, configPropertyNames) {
|
|
550
550
|
if (!untrustedIsObject(untrustedConfig)) {
|
|
551
551
|
return null;
|
|
552
552
|
}
|
|
553
553
|
if (process.env.NODE_ENV !== 'production') {
|
|
554
554
|
validateConfig(untrustedConfig, configPropertyNames);
|
|
555
555
|
}
|
|
556
|
-
const config = typeCheckConfig$
|
|
556
|
+
const config = typeCheckConfig$3(untrustedConfig);
|
|
557
557
|
if (!areRequiredParametersPresent(config, configPropertyNames)) {
|
|
558
558
|
return null;
|
|
559
559
|
}
|
|
560
560
|
return config;
|
|
561
561
|
}
|
|
562
|
-
function buildNetworkSnapshot$
|
|
563
|
-
const resourceParams = createResourceParams$
|
|
564
|
-
const request = createResourceRequest$
|
|
562
|
+
function buildNetworkSnapshot$3(luvio, config, options) {
|
|
563
|
+
const resourceParams = createResourceParams$3(config);
|
|
564
|
+
const request = createResourceRequest$3(resourceParams);
|
|
565
565
|
return luvio.dispatchResourceRequest(request, options)
|
|
566
566
|
.then((response) => {
|
|
567
567
|
return luvio.handleSuccessResponse(() => {
|
|
568
|
-
const snapshot = ingestSuccess$
|
|
568
|
+
const snapshot = ingestSuccess$2(luvio, resourceParams, response);
|
|
569
569
|
return luvio.storeBroadcast().then(() => snapshot);
|
|
570
|
-
}, () => getResponseCacheKeys$
|
|
570
|
+
}, () => getResponseCacheKeys$3(luvio, resourceParams, response.body));
|
|
571
571
|
}, (response) => {
|
|
572
572
|
deepFreeze(response);
|
|
573
573
|
throw response;
|
|
@@ -575,33 +575,33 @@ function buildNetworkSnapshot$2(luvio, config, options) {
|
|
|
575
575
|
}
|
|
576
576
|
const createAdgAdapterFactory = (luvio) => {
|
|
577
577
|
return function createAdg(untrustedConfig) {
|
|
578
|
-
const config = validateAdapterConfig$
|
|
578
|
+
const config = validateAdapterConfig$3(untrustedConfig, createAdg_ConfigPropertyNames);
|
|
579
579
|
// Invalid or incomplete config
|
|
580
580
|
if (config === null) {
|
|
581
581
|
throw new Error('Invalid config for "createAdg"');
|
|
582
582
|
}
|
|
583
|
-
return buildNetworkSnapshot$
|
|
583
|
+
return buildNetworkSnapshot$3(luvio, config);
|
|
584
584
|
};
|
|
585
585
|
};
|
|
586
586
|
|
|
587
|
-
function select(luvio, params) {
|
|
588
|
-
return select$
|
|
587
|
+
function select$2(luvio, params) {
|
|
588
|
+
return select$4();
|
|
589
589
|
}
|
|
590
|
-
function keyBuilder$
|
|
591
|
-
return keyBuilder$
|
|
590
|
+
function keyBuilder$3(luvio, params) {
|
|
591
|
+
return keyBuilder$4(luvio, {
|
|
592
592
|
name: params.urlParams.adgName
|
|
593
593
|
});
|
|
594
594
|
}
|
|
595
|
-
function getResponseCacheKeys$
|
|
596
|
-
return getTypeCacheKeys(luvio, response);
|
|
595
|
+
function getResponseCacheKeys$2(luvio, resourceParams, response) {
|
|
596
|
+
return getTypeCacheKeys$1(luvio, response);
|
|
597
597
|
}
|
|
598
|
-
function ingestSuccess(luvio, resourceParams, response, snapshotRefresh) {
|
|
598
|
+
function ingestSuccess$1(luvio, resourceParams, response, snapshotRefresh) {
|
|
599
599
|
const { body } = response;
|
|
600
|
-
const key = keyBuilder$
|
|
601
|
-
luvio.storeIngest(key, ingest, body);
|
|
600
|
+
const key = keyBuilder$3(luvio, resourceParams);
|
|
601
|
+
luvio.storeIngest(key, ingest$1, body);
|
|
602
602
|
const snapshot = luvio.storeLookup({
|
|
603
603
|
recordId: key,
|
|
604
|
-
node: select(),
|
|
604
|
+
node: select$2(),
|
|
605
605
|
variables: {},
|
|
606
606
|
}, snapshotRefresh);
|
|
607
607
|
if (process.env.NODE_ENV !== 'production') {
|
|
@@ -613,12 +613,12 @@ function ingestSuccess(luvio, resourceParams, response, snapshotRefresh) {
|
|
|
613
613
|
return snapshot;
|
|
614
614
|
}
|
|
615
615
|
function ingestError(luvio, params, error, snapshotRefresh) {
|
|
616
|
-
const key = keyBuilder$
|
|
616
|
+
const key = keyBuilder$3(luvio, params);
|
|
617
617
|
const errorSnapshot = luvio.errorSnapshot(error, snapshotRefresh);
|
|
618
618
|
luvio.storeIngestError(key, errorSnapshot);
|
|
619
619
|
return errorSnapshot;
|
|
620
620
|
}
|
|
621
|
-
function createResourceRequest$
|
|
621
|
+
function createResourceRequest$2(config) {
|
|
622
622
|
const headers = {};
|
|
623
623
|
return {
|
|
624
624
|
baseUri: '/services/data/v58.0',
|
|
@@ -639,7 +639,7 @@ const getAdg_ConfigPropertyNames = {
|
|
|
639
639
|
optional: []
|
|
640
640
|
}
|
|
641
641
|
};
|
|
642
|
-
function createResourceParams$
|
|
642
|
+
function createResourceParams$2(config) {
|
|
643
643
|
const resourceParams = {
|
|
644
644
|
urlParams: {
|
|
645
645
|
adgName: config.adgName
|
|
@@ -647,11 +647,11 @@ function createResourceParams$1(config) {
|
|
|
647
647
|
};
|
|
648
648
|
return resourceParams;
|
|
649
649
|
}
|
|
650
|
-
function keyBuilder$
|
|
651
|
-
const resourceParams = createResourceParams$
|
|
652
|
-
return keyBuilder$
|
|
650
|
+
function keyBuilder$2(luvio, config) {
|
|
651
|
+
const resourceParams = createResourceParams$2(config);
|
|
652
|
+
return keyBuilder$3(luvio, resourceParams);
|
|
653
653
|
}
|
|
654
|
-
function typeCheckConfig$
|
|
654
|
+
function typeCheckConfig$2(untrustedConfig) {
|
|
655
655
|
const config = {};
|
|
656
656
|
const untrustedConfig_adgName = untrustedConfig.adgName;
|
|
657
657
|
if (typeof untrustedConfig_adgName === 'string') {
|
|
@@ -659,43 +659,43 @@ function typeCheckConfig$1(untrustedConfig) {
|
|
|
659
659
|
}
|
|
660
660
|
return config;
|
|
661
661
|
}
|
|
662
|
-
function validateAdapterConfig$
|
|
662
|
+
function validateAdapterConfig$2(untrustedConfig, configPropertyNames) {
|
|
663
663
|
if (!untrustedIsObject(untrustedConfig)) {
|
|
664
664
|
return null;
|
|
665
665
|
}
|
|
666
666
|
if (process.env.NODE_ENV !== 'production') {
|
|
667
667
|
validateConfig(untrustedConfig, configPropertyNames);
|
|
668
668
|
}
|
|
669
|
-
const config = typeCheckConfig$
|
|
669
|
+
const config = typeCheckConfig$2(untrustedConfig);
|
|
670
670
|
if (!areRequiredParametersPresent(config, configPropertyNames)) {
|
|
671
671
|
return null;
|
|
672
672
|
}
|
|
673
673
|
return config;
|
|
674
674
|
}
|
|
675
675
|
function adapterFragment(luvio, config) {
|
|
676
|
-
createResourceParams$
|
|
677
|
-
return select();
|
|
676
|
+
createResourceParams$2(config);
|
|
677
|
+
return select$2();
|
|
678
678
|
}
|
|
679
679
|
function onFetchResponseSuccess(luvio, config, resourceParams, response) {
|
|
680
|
-
const snapshot = ingestSuccess(luvio, resourceParams, response, {
|
|
680
|
+
const snapshot = ingestSuccess$1(luvio, resourceParams, response, {
|
|
681
681
|
config,
|
|
682
|
-
resolve: () => buildNetworkSnapshot$
|
|
682
|
+
resolve: () => buildNetworkSnapshot$2(luvio, config, snapshotRefreshOptions)
|
|
683
683
|
});
|
|
684
684
|
return luvio.storeBroadcast().then(() => snapshot);
|
|
685
685
|
}
|
|
686
686
|
function onFetchResponseError(luvio, config, resourceParams, response) {
|
|
687
687
|
const snapshot = ingestError(luvio, resourceParams, response, {
|
|
688
688
|
config,
|
|
689
|
-
resolve: () => buildNetworkSnapshot$
|
|
689
|
+
resolve: () => buildNetworkSnapshot$2(luvio, config, snapshotRefreshOptions)
|
|
690
690
|
});
|
|
691
691
|
return luvio.storeBroadcast().then(() => snapshot);
|
|
692
692
|
}
|
|
693
|
-
function buildNetworkSnapshot$
|
|
694
|
-
const resourceParams = createResourceParams$
|
|
695
|
-
const request = createResourceRequest$
|
|
693
|
+
function buildNetworkSnapshot$2(luvio, config, options) {
|
|
694
|
+
const resourceParams = createResourceParams$2(config);
|
|
695
|
+
const request = createResourceRequest$2(resourceParams);
|
|
696
696
|
return luvio.dispatchResourceRequest(request, options)
|
|
697
697
|
.then((response) => {
|
|
698
|
-
return luvio.handleSuccessResponse(() => onFetchResponseSuccess(luvio, config, resourceParams, response), () => getResponseCacheKeys$
|
|
698
|
+
return luvio.handleSuccessResponse(() => onFetchResponseSuccess(luvio, config, resourceParams, response), () => getResponseCacheKeys$2(luvio, resourceParams, response.body));
|
|
699
699
|
}, (response) => {
|
|
700
700
|
return luvio.handleErrorResponse(() => onFetchResponseError(luvio, config, resourceParams, response));
|
|
701
701
|
});
|
|
@@ -715,23 +715,23 @@ function buildNetworkSnapshotCachePolicy(context, coercedAdapterRequestContext)
|
|
|
715
715
|
priority: networkPriority
|
|
716
716
|
};
|
|
717
717
|
}
|
|
718
|
-
return buildNetworkSnapshot$
|
|
718
|
+
return buildNetworkSnapshot$2(luvio, config, dispatchOptions);
|
|
719
719
|
}
|
|
720
720
|
function buildCachedSnapshotCachePolicy(context, storeLookup) {
|
|
721
721
|
const { luvio, config } = context;
|
|
722
722
|
const selector = {
|
|
723
|
-
recordId: keyBuilder$
|
|
723
|
+
recordId: keyBuilder$2(luvio, config),
|
|
724
724
|
node: adapterFragment(luvio, config),
|
|
725
725
|
variables: {},
|
|
726
726
|
};
|
|
727
727
|
const cacheSnapshot = storeLookup(selector, {
|
|
728
728
|
config,
|
|
729
|
-
resolve: () => buildNetworkSnapshot$
|
|
729
|
+
resolve: () => buildNetworkSnapshot$2(luvio, config, snapshotRefreshOptions)
|
|
730
730
|
});
|
|
731
731
|
return cacheSnapshot;
|
|
732
732
|
}
|
|
733
733
|
const getAdgAdapterFactory = (luvio) => function CDP__getAdg(untrustedConfig, requestContext) {
|
|
734
|
-
const config = validateAdapterConfig$
|
|
734
|
+
const config = validateAdapterConfig$2(untrustedConfig, getAdg_ConfigPropertyNames);
|
|
735
735
|
// Invalid or incomplete config
|
|
736
736
|
if (config === null) {
|
|
737
737
|
return null;
|
|
@@ -740,26 +740,26 @@ const getAdgAdapterFactory = (luvio) => function CDP__getAdg(untrustedConfig, re
|
|
|
740
740
|
buildCachedSnapshotCachePolicy, buildNetworkSnapshotCachePolicy);
|
|
741
741
|
};
|
|
742
742
|
|
|
743
|
-
function keyBuilder(luvio, params) {
|
|
744
|
-
return keyBuilder$
|
|
743
|
+
function keyBuilder$1(luvio, params) {
|
|
744
|
+
return keyBuilder$4(luvio, {
|
|
745
745
|
name: params.urlParams.adgName
|
|
746
746
|
});
|
|
747
747
|
}
|
|
748
|
-
function getResponseCacheKeys(luvio, resourceParams) {
|
|
749
|
-
const key = keyBuilder(luvio, resourceParams);
|
|
748
|
+
function getResponseCacheKeys$1(luvio, resourceParams) {
|
|
749
|
+
const key = keyBuilder$1(luvio, resourceParams);
|
|
750
750
|
const cacheKeyMap = new StoreKeyMap();
|
|
751
751
|
cacheKeyMap.set(key, {
|
|
752
752
|
namespace: keyPrefix,
|
|
753
|
-
representationName: RepresentationType,
|
|
753
|
+
representationName: RepresentationType$1,
|
|
754
754
|
mergeable: false
|
|
755
755
|
});
|
|
756
756
|
return cacheKeyMap;
|
|
757
757
|
}
|
|
758
758
|
function evictSuccess(luvio, resourceParams) {
|
|
759
|
-
const key = keyBuilder(luvio, resourceParams);
|
|
759
|
+
const key = keyBuilder$1(luvio, resourceParams);
|
|
760
760
|
luvio.storeEvict(key);
|
|
761
761
|
}
|
|
762
|
-
function createResourceRequest(config) {
|
|
762
|
+
function createResourceRequest$1(config) {
|
|
763
763
|
const headers = {};
|
|
764
764
|
return {
|
|
765
765
|
baseUri: '/services/data/v58.0',
|
|
@@ -781,7 +781,7 @@ const deleteAdg_ConfigPropertyNames = {
|
|
|
781
781
|
optional: []
|
|
782
782
|
}
|
|
783
783
|
};
|
|
784
|
-
function createResourceParams(config) {
|
|
784
|
+
function createResourceParams$1(config) {
|
|
785
785
|
const resourceParams = {
|
|
786
786
|
urlParams: {
|
|
787
787
|
adgName: config.adgName
|
|
@@ -789,7 +789,7 @@ function createResourceParams(config) {
|
|
|
789
789
|
};
|
|
790
790
|
return resourceParams;
|
|
791
791
|
}
|
|
792
|
-
function typeCheckConfig(untrustedConfig) {
|
|
792
|
+
function typeCheckConfig$1(untrustedConfig) {
|
|
793
793
|
const config = {};
|
|
794
794
|
const untrustedConfig_adgName = untrustedConfig.adgName;
|
|
795
795
|
if (typeof untrustedConfig_adgName === 'string') {
|
|
@@ -797,28 +797,28 @@ function typeCheckConfig(untrustedConfig) {
|
|
|
797
797
|
}
|
|
798
798
|
return config;
|
|
799
799
|
}
|
|
800
|
-
function validateAdapterConfig(untrustedConfig, configPropertyNames) {
|
|
800
|
+
function validateAdapterConfig$1(untrustedConfig, configPropertyNames) {
|
|
801
801
|
if (!untrustedIsObject(untrustedConfig)) {
|
|
802
802
|
return null;
|
|
803
803
|
}
|
|
804
804
|
if (process.env.NODE_ENV !== 'production') {
|
|
805
805
|
validateConfig(untrustedConfig, configPropertyNames);
|
|
806
806
|
}
|
|
807
|
-
const config = typeCheckConfig(untrustedConfig);
|
|
807
|
+
const config = typeCheckConfig$1(untrustedConfig);
|
|
808
808
|
if (!areRequiredParametersPresent(config, configPropertyNames)) {
|
|
809
809
|
return null;
|
|
810
810
|
}
|
|
811
811
|
return config;
|
|
812
812
|
}
|
|
813
|
-
function buildNetworkSnapshot(luvio, config, options) {
|
|
814
|
-
const resourceParams = createResourceParams(config);
|
|
815
|
-
const request = createResourceRequest(resourceParams);
|
|
813
|
+
function buildNetworkSnapshot$1(luvio, config, options) {
|
|
814
|
+
const resourceParams = createResourceParams$1(config);
|
|
815
|
+
const request = createResourceRequest$1(resourceParams);
|
|
816
816
|
return luvio.dispatchResourceRequest(request, options)
|
|
817
817
|
.then(() => {
|
|
818
818
|
return luvio.handleSuccessResponse(() => {
|
|
819
819
|
evictSuccess(luvio, resourceParams);
|
|
820
820
|
return luvio.storeBroadcast();
|
|
821
|
-
}, () => getResponseCacheKeys(luvio, resourceParams));
|
|
821
|
+
}, () => getResponseCacheKeys$1(luvio, resourceParams));
|
|
822
822
|
}, (response) => {
|
|
823
823
|
deepFreeze(response);
|
|
824
824
|
throw response;
|
|
@@ -826,13 +826,204 @@ function buildNetworkSnapshot(luvio, config, options) {
|
|
|
826
826
|
}
|
|
827
827
|
const deleteAdgAdapterFactory = (luvio) => {
|
|
828
828
|
return function CDPdeleteAdg(untrustedConfig) {
|
|
829
|
-
const config = validateAdapterConfig(untrustedConfig, deleteAdg_ConfigPropertyNames);
|
|
829
|
+
const config = validateAdapterConfig$1(untrustedConfig, deleteAdg_ConfigPropertyNames);
|
|
830
830
|
// Invalid or incomplete config
|
|
831
831
|
if (config === null) {
|
|
832
832
|
throw new Error(`Invalid config for "${adapterName}"`);
|
|
833
833
|
}
|
|
834
|
+
return buildNetworkSnapshot$1(luvio, config);
|
|
835
|
+
};
|
|
836
|
+
};
|
|
837
|
+
|
|
838
|
+
const VERSION = "0c1f279e921d51f73cd64db1eaef780c";
|
|
839
|
+
function validate(obj, path = 'CdpDataGraphRetryOutputRepresentation') {
|
|
840
|
+
const v_error = (() => {
|
|
841
|
+
if (typeof obj !== 'object' || ArrayIsArray(obj) || obj === null) {
|
|
842
|
+
return new TypeError('Expected "object" but received "' + typeof obj + '" (at "' + path + '")');
|
|
843
|
+
}
|
|
844
|
+
const obj_dataGraphName = obj.dataGraphName;
|
|
845
|
+
const path_dataGraphName = path + '.dataGraphName';
|
|
846
|
+
if (typeof obj_dataGraphName !== 'string') {
|
|
847
|
+
return new TypeError('Expected "string" but received "' + typeof obj_dataGraphName + '" (at "' + path_dataGraphName + '")');
|
|
848
|
+
}
|
|
849
|
+
const obj_lastRunStatus = obj.lastRunStatus;
|
|
850
|
+
const path_lastRunStatus = path + '.lastRunStatus';
|
|
851
|
+
if (typeof obj_lastRunStatus !== 'string') {
|
|
852
|
+
return new TypeError('Expected "string" but received "' + typeof obj_lastRunStatus + '" (at "' + path_lastRunStatus + '")');
|
|
853
|
+
}
|
|
854
|
+
const obj_status = obj.status;
|
|
855
|
+
const path_status = path + '.status';
|
|
856
|
+
if (typeof obj_status !== 'string') {
|
|
857
|
+
return new TypeError('Expected "string" but received "' + typeof obj_status + '" (at "' + path_status + '")');
|
|
858
|
+
}
|
|
859
|
+
})();
|
|
860
|
+
return v_error === undefined ? null : v_error;
|
|
861
|
+
}
|
|
862
|
+
const RepresentationType = 'CdpDataGraphRetryOutputRepresentation';
|
|
863
|
+
function keyBuilder(luvio, config) {
|
|
864
|
+
return keyPrefix + '::' + RepresentationType + ':' + config.name;
|
|
865
|
+
}
|
|
866
|
+
function keyBuilderFromType(luvio, object) {
|
|
867
|
+
const keyParams = {
|
|
868
|
+
name: object.dataGraphName
|
|
869
|
+
};
|
|
870
|
+
return keyBuilder(luvio, keyParams);
|
|
871
|
+
}
|
|
872
|
+
function normalize(input, existing, path, luvio, store, timestamp) {
|
|
873
|
+
return input;
|
|
874
|
+
}
|
|
875
|
+
const select$1 = function CdpDataGraphRetryOutputRepresentationSelect() {
|
|
876
|
+
return {
|
|
877
|
+
kind: 'Fragment',
|
|
878
|
+
version: VERSION,
|
|
879
|
+
private: [],
|
|
880
|
+
opaque: true
|
|
881
|
+
};
|
|
882
|
+
};
|
|
883
|
+
function equals(existing, incoming) {
|
|
884
|
+
if (JSONStringify(incoming) !== JSONStringify(existing)) {
|
|
885
|
+
return false;
|
|
886
|
+
}
|
|
887
|
+
return true;
|
|
888
|
+
}
|
|
889
|
+
const ingest = function CdpDataGraphRetryOutputRepresentationIngest(input, path, luvio, store, timestamp) {
|
|
890
|
+
if (process.env.NODE_ENV !== 'production') {
|
|
891
|
+
const validateError = validate(input);
|
|
892
|
+
if (validateError !== null) {
|
|
893
|
+
throw validateError;
|
|
894
|
+
}
|
|
895
|
+
}
|
|
896
|
+
const key = keyBuilderFromType(luvio, input);
|
|
897
|
+
const existingRecord = store.readEntry(key);
|
|
898
|
+
const ttlToUse = path.ttl !== undefined ? path.ttl : 3000000;
|
|
899
|
+
let incomingRecord = normalize(input, store.readEntry(key), {
|
|
900
|
+
fullPath: key,
|
|
901
|
+
parent: path.parent,
|
|
902
|
+
propertyName: path.propertyName,
|
|
903
|
+
ttl: ttlToUse
|
|
904
|
+
});
|
|
905
|
+
if (existingRecord === undefined || equals(existingRecord, incomingRecord) === false) {
|
|
906
|
+
luvio.storePublish(key, incomingRecord);
|
|
907
|
+
}
|
|
908
|
+
if (ttlToUse !== undefined) {
|
|
909
|
+
const storeMetadataParams = {
|
|
910
|
+
ttl: ttlToUse,
|
|
911
|
+
namespace: "CDP",
|
|
912
|
+
version: VERSION,
|
|
913
|
+
representationName: RepresentationType,
|
|
914
|
+
};
|
|
915
|
+
luvio.publishStoreMetadata(key, storeMetadataParams);
|
|
916
|
+
}
|
|
917
|
+
return createLink(key);
|
|
918
|
+
};
|
|
919
|
+
function getTypeCacheKeys(luvio, input, fullPathFactory) {
|
|
920
|
+
const rootKeySet = new StoreKeyMap();
|
|
921
|
+
// root cache key (uses fullPathFactory if keyBuilderFromType isn't defined)
|
|
922
|
+
const rootKey = keyBuilderFromType(luvio, input);
|
|
923
|
+
rootKeySet.set(rootKey, {
|
|
924
|
+
namespace: keyPrefix,
|
|
925
|
+
representationName: RepresentationType,
|
|
926
|
+
mergeable: false
|
|
927
|
+
});
|
|
928
|
+
return rootKeySet;
|
|
929
|
+
}
|
|
930
|
+
|
|
931
|
+
function select(luvio, params) {
|
|
932
|
+
return select$1();
|
|
933
|
+
}
|
|
934
|
+
function getResponseCacheKeys(luvio, resourceParams, response) {
|
|
935
|
+
return getTypeCacheKeys(luvio, response);
|
|
936
|
+
}
|
|
937
|
+
function ingestSuccess(luvio, resourceParams, response) {
|
|
938
|
+
const { body } = response;
|
|
939
|
+
const key = keyBuilderFromType(luvio, body);
|
|
940
|
+
luvio.storeIngest(key, ingest, body);
|
|
941
|
+
const snapshot = luvio.storeLookup({
|
|
942
|
+
recordId: key,
|
|
943
|
+
node: select(),
|
|
944
|
+
variables: {},
|
|
945
|
+
});
|
|
946
|
+
if (process.env.NODE_ENV !== 'production') {
|
|
947
|
+
if (snapshot.state !== 'Fulfilled') {
|
|
948
|
+
throw new Error('Invalid network response. Expected resource response to result in Fulfilled snapshot');
|
|
949
|
+
}
|
|
950
|
+
}
|
|
951
|
+
deepFreeze(snapshot.data);
|
|
952
|
+
return snapshot;
|
|
953
|
+
}
|
|
954
|
+
function createResourceRequest(config) {
|
|
955
|
+
const headers = {};
|
|
956
|
+
return {
|
|
957
|
+
baseUri: '/services/data/v58.0',
|
|
958
|
+
basePath: '/ssot/application-data-graphs/retry',
|
|
959
|
+
method: 'put',
|
|
960
|
+
body: config.body,
|
|
961
|
+
urlParams: {},
|
|
962
|
+
queryParams: {},
|
|
963
|
+
headers,
|
|
964
|
+
priority: 'normal',
|
|
965
|
+
};
|
|
966
|
+
}
|
|
967
|
+
|
|
968
|
+
const retryDataGraph_ConfigPropertyNames = {
|
|
969
|
+
displayName: 'retryDataGraph',
|
|
970
|
+
parameters: {
|
|
971
|
+
required: ['dataGraphName'],
|
|
972
|
+
optional: []
|
|
973
|
+
}
|
|
974
|
+
};
|
|
975
|
+
function createResourceParams(config) {
|
|
976
|
+
const resourceParams = {
|
|
977
|
+
body: {
|
|
978
|
+
dataGraphName: config.dataGraphName
|
|
979
|
+
}
|
|
980
|
+
};
|
|
981
|
+
return resourceParams;
|
|
982
|
+
}
|
|
983
|
+
function typeCheckConfig(untrustedConfig) {
|
|
984
|
+
const config = {};
|
|
985
|
+
const untrustedConfig_dataGraphName = untrustedConfig.dataGraphName;
|
|
986
|
+
if (typeof untrustedConfig_dataGraphName === 'string') {
|
|
987
|
+
config.dataGraphName = untrustedConfig_dataGraphName;
|
|
988
|
+
}
|
|
989
|
+
return config;
|
|
990
|
+
}
|
|
991
|
+
function validateAdapterConfig(untrustedConfig, configPropertyNames) {
|
|
992
|
+
if (!untrustedIsObject(untrustedConfig)) {
|
|
993
|
+
return null;
|
|
994
|
+
}
|
|
995
|
+
if (process.env.NODE_ENV !== 'production') {
|
|
996
|
+
validateConfig(untrustedConfig, configPropertyNames);
|
|
997
|
+
}
|
|
998
|
+
const config = typeCheckConfig(untrustedConfig);
|
|
999
|
+
if (!areRequiredParametersPresent(config, configPropertyNames)) {
|
|
1000
|
+
return null;
|
|
1001
|
+
}
|
|
1002
|
+
return config;
|
|
1003
|
+
}
|
|
1004
|
+
function buildNetworkSnapshot(luvio, config, options) {
|
|
1005
|
+
const resourceParams = createResourceParams(config);
|
|
1006
|
+
const request = createResourceRequest(resourceParams);
|
|
1007
|
+
return luvio.dispatchResourceRequest(request, options)
|
|
1008
|
+
.then((response) => {
|
|
1009
|
+
return luvio.handleSuccessResponse(() => {
|
|
1010
|
+
const snapshot = ingestSuccess(luvio, resourceParams, response);
|
|
1011
|
+
return luvio.storeBroadcast().then(() => snapshot);
|
|
1012
|
+
}, () => getResponseCacheKeys(luvio, resourceParams, response.body));
|
|
1013
|
+
}, (response) => {
|
|
1014
|
+
deepFreeze(response);
|
|
1015
|
+
throw response;
|
|
1016
|
+
});
|
|
1017
|
+
}
|
|
1018
|
+
const retryDataGraphAdapterFactory = (luvio) => {
|
|
1019
|
+
return function retryDataGraph(untrustedConfig) {
|
|
1020
|
+
const config = validateAdapterConfig(untrustedConfig, retryDataGraph_ConfigPropertyNames);
|
|
1021
|
+
// Invalid or incomplete config
|
|
1022
|
+
if (config === null) {
|
|
1023
|
+
throw new Error('Invalid config for "retryDataGraph"');
|
|
1024
|
+
}
|
|
834
1025
|
return buildNetworkSnapshot(luvio, config);
|
|
835
1026
|
};
|
|
836
1027
|
};
|
|
837
1028
|
|
|
838
|
-
export { createAdgAdapterFactory, deleteAdgAdapterFactory, getAdgAdapterFactory };
|
|
1029
|
+
export { createAdgAdapterFactory, deleteAdgAdapterFactory, getAdgAdapterFactory, retryDataGraphAdapterFactory };
|