@salesforce/lds-adapters-industries-timeline 1.168.0 → 1.170.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/es/es2018/industries-timeline.js +700 -49
- package/dist/es/es2018/types/src/generated/adapters/getDataModelObjects.d.ts +26 -0
- package/dist/es/es2018/types/src/generated/adapters/getEngagementEvents.d.ts +27 -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/getConnectTimelineCustDataPfrmDataModelObjects.d.ts +15 -0
- package/dist/es/es2018/types/src/generated/resources/getConnectTimelineTimelineDefinitionsCustDataPfrmEventsByTimelineConfigFullNameAndTimelineObjRecordId.d.ts +16 -0
- package/dist/es/es2018/types/src/generated/types/CdpMetadataOutputRepresentation.d.ts +30 -0
- package/dist/es/es2018/types/src/generated/types/DmoFieldsOutputRepresentation.d.ts +34 -0
- package/dist/es/es2018/types/src/generated/types/DmoOutputRepresentation.d.ts +42 -0
- package/dist/es/es2018/types/src/generated/types/DmoRelationshipsOutputRepresentation.d.ts +30 -0
- package/dist/es/es2018/types/src/generated/types/EngagementEventTimelineDataRepresentation.d.ts +41 -0
- package/dist/es/es2018/types/src/generated/types/RelationshipTypeOutputRepresentation.d.ts +31 -0
- package/package.json +1 -1
- package/sfdc/index.js +678 -11
- package/src/raml/api.raml +142 -23
- package/src/raml/luvio.raml +86 -59
|
@@ -58,7 +58,7 @@ function createLink(ref) {
|
|
|
58
58
|
};
|
|
59
59
|
}
|
|
60
60
|
|
|
61
|
-
function validate$
|
|
61
|
+
function validate$f(obj, path = 'TimelineErrorRepresentation') {
|
|
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 + '")');
|
|
@@ -119,7 +119,7 @@ function validate$9(obj, path = 'TimelineErrorRepresentation') {
|
|
|
119
119
|
return v_error === undefined ? null : v_error;
|
|
120
120
|
}
|
|
121
121
|
|
|
122
|
-
function validate$
|
|
122
|
+
function validate$e(obj, path = 'TimelineEventTypeRepresentation') {
|
|
123
123
|
const v_error = (() => {
|
|
124
124
|
if (typeof obj !== 'object' || ArrayIsArray(obj) || obj === null) {
|
|
125
125
|
return new TypeError('Expected "object" but received "' + typeof obj + '" (at "' + path + '")');
|
|
@@ -180,7 +180,7 @@ function validate$8(obj, path = 'TimelineEventTypeRepresentation') {
|
|
|
180
180
|
return v_error === undefined ? null : v_error;
|
|
181
181
|
}
|
|
182
182
|
|
|
183
|
-
function validate$
|
|
183
|
+
function validate$d(obj, path = 'TimelineEventFieldRepresentation') {
|
|
184
184
|
const v_error = (() => {
|
|
185
185
|
if (typeof obj !== 'object' || ArrayIsArray(obj) || obj === null) {
|
|
186
186
|
return new TypeError('Expected "object" but received "' + typeof obj + '" (at "' + path + '")');
|
|
@@ -241,7 +241,7 @@ function validate$7(obj, path = 'TimelineEventFieldRepresentation') {
|
|
|
241
241
|
return v_error === undefined ? null : v_error;
|
|
242
242
|
}
|
|
243
243
|
|
|
244
|
-
function validate$
|
|
244
|
+
function validate$c(obj, path = 'TimelineEventRepresentation') {
|
|
245
245
|
const v_error = (() => {
|
|
246
246
|
if (typeof obj !== 'object' || ArrayIsArray(obj) || obj === null) {
|
|
247
247
|
return new TypeError('Expected "object" but received "' + typeof obj + '" (at "' + path + '")');
|
|
@@ -307,7 +307,7 @@ function validate$6(obj, path = 'TimelineEventRepresentation') {
|
|
|
307
307
|
for (let i = 0; i < obj_fields.length; i++) {
|
|
308
308
|
const obj_fields_item = obj_fields[i];
|
|
309
309
|
const path_fields_item = path_fields + '[' + i + ']';
|
|
310
|
-
const referencepath_fields_itemValidationError = validate$
|
|
310
|
+
const referencepath_fields_itemValidationError = validate$d(obj_fields_item, path_fields_item);
|
|
311
311
|
if (referencepath_fields_itemValidationError !== null) {
|
|
312
312
|
let message = 'Object doesn\'t match TimelineEventFieldRepresentation (at "' + path_fields_item + '")\n';
|
|
313
313
|
message += referencepath_fields_itemValidationError.message.split('\n').map((line) => '\t' + line).join('\n');
|
|
@@ -397,9 +397,293 @@ function validate$6(obj, path = 'TimelineEventRepresentation') {
|
|
|
397
397
|
return v_error === undefined ? null : v_error;
|
|
398
398
|
}
|
|
399
399
|
|
|
400
|
-
const TTL$
|
|
401
|
-
const VERSION$
|
|
402
|
-
function validate$
|
|
400
|
+
const TTL$3 = 600000;
|
|
401
|
+
const VERSION$3 = "321752356b84efcf9df843ceda55f23c";
|
|
402
|
+
function validate$b(obj, path = 'EngagementEventTimelineDataRepresentation') {
|
|
403
|
+
const v_error = (() => {
|
|
404
|
+
if (typeof obj !== 'object' || ArrayIsArray(obj) || obj === null) {
|
|
405
|
+
return new TypeError('Expected "object" but received "' + typeof obj + '" (at "' + path + '")');
|
|
406
|
+
}
|
|
407
|
+
const obj_errors = obj.errors;
|
|
408
|
+
const path_errors = path + '.errors';
|
|
409
|
+
if (!ArrayIsArray(obj_errors)) {
|
|
410
|
+
return new TypeError('Expected "array" but received "' + typeof obj_errors + '" (at "' + path_errors + '")');
|
|
411
|
+
}
|
|
412
|
+
for (let i = 0; i < obj_errors.length; i++) {
|
|
413
|
+
const obj_errors_item = obj_errors[i];
|
|
414
|
+
const path_errors_item = path_errors + '[' + i + ']';
|
|
415
|
+
const referencepath_errors_itemValidationError = validate$f(obj_errors_item, path_errors_item);
|
|
416
|
+
if (referencepath_errors_itemValidationError !== null) {
|
|
417
|
+
let message = 'Object doesn\'t match TimelineErrorRepresentation (at "' + path_errors_item + '")\n';
|
|
418
|
+
message += referencepath_errors_itemValidationError.message.split('\n').map((line) => '\t' + line).join('\n');
|
|
419
|
+
return new TypeError(message);
|
|
420
|
+
}
|
|
421
|
+
}
|
|
422
|
+
const obj_eventTypes = obj.eventTypes;
|
|
423
|
+
const path_eventTypes = path + '.eventTypes';
|
|
424
|
+
if (!ArrayIsArray(obj_eventTypes)) {
|
|
425
|
+
return new TypeError('Expected "array" but received "' + typeof obj_eventTypes + '" (at "' + path_eventTypes + '")');
|
|
426
|
+
}
|
|
427
|
+
for (let i = 0; i < obj_eventTypes.length; i++) {
|
|
428
|
+
const obj_eventTypes_item = obj_eventTypes[i];
|
|
429
|
+
const path_eventTypes_item = path_eventTypes + '[' + i + ']';
|
|
430
|
+
const referencepath_eventTypes_itemValidationError = validate$e(obj_eventTypes_item, path_eventTypes_item);
|
|
431
|
+
if (referencepath_eventTypes_itemValidationError !== null) {
|
|
432
|
+
let message = 'Object doesn\'t match TimelineEventTypeRepresentation (at "' + path_eventTypes_item + '")\n';
|
|
433
|
+
message += referencepath_eventTypes_itemValidationError.message.split('\n').map((line) => '\t' + line).join('\n');
|
|
434
|
+
return new TypeError(message);
|
|
435
|
+
}
|
|
436
|
+
}
|
|
437
|
+
const obj_events = obj.events;
|
|
438
|
+
const path_events = path + '.events';
|
|
439
|
+
if (!ArrayIsArray(obj_events)) {
|
|
440
|
+
return new TypeError('Expected "array" but received "' + typeof obj_events + '" (at "' + path_events + '")');
|
|
441
|
+
}
|
|
442
|
+
for (let i = 0; i < obj_events.length; i++) {
|
|
443
|
+
const obj_events_item = obj_events[i];
|
|
444
|
+
const path_events_item = path_events + '[' + i + ']';
|
|
445
|
+
const referencepath_events_itemValidationError = validate$c(obj_events_item, path_events_item);
|
|
446
|
+
if (referencepath_events_itemValidationError !== null) {
|
|
447
|
+
let message = 'Object doesn\'t match TimelineEventRepresentation (at "' + path_events_item + '")\n';
|
|
448
|
+
message += referencepath_events_itemValidationError.message.split('\n').map((line) => '\t' + line).join('\n');
|
|
449
|
+
return new TypeError(message);
|
|
450
|
+
}
|
|
451
|
+
}
|
|
452
|
+
const obj_isSuccess = obj.isSuccess;
|
|
453
|
+
const path_isSuccess = path + '.isSuccess';
|
|
454
|
+
if (typeof obj_isSuccess !== 'boolean') {
|
|
455
|
+
return new TypeError('Expected "boolean" but received "' + typeof obj_isSuccess + '" (at "' + path_isSuccess + '")');
|
|
456
|
+
}
|
|
457
|
+
})();
|
|
458
|
+
return v_error === undefined ? null : v_error;
|
|
459
|
+
}
|
|
460
|
+
const RepresentationType$3 = 'EngagementEventTimelineDataRepresentation';
|
|
461
|
+
function normalize$3(input, existing, path, luvio, store, timestamp) {
|
|
462
|
+
return input;
|
|
463
|
+
}
|
|
464
|
+
const select$7 = function EngagementEventTimelineDataRepresentationSelect() {
|
|
465
|
+
return {
|
|
466
|
+
kind: 'Fragment',
|
|
467
|
+
version: VERSION$3,
|
|
468
|
+
private: [],
|
|
469
|
+
opaque: true
|
|
470
|
+
};
|
|
471
|
+
};
|
|
472
|
+
function equals$3(existing, incoming) {
|
|
473
|
+
if (JSONStringify(incoming) !== JSONStringify(existing)) {
|
|
474
|
+
return false;
|
|
475
|
+
}
|
|
476
|
+
return true;
|
|
477
|
+
}
|
|
478
|
+
const ingest$3 = function EngagementEventTimelineDataRepresentationIngest(input, path, luvio, store, timestamp) {
|
|
479
|
+
if (process.env.NODE_ENV !== 'production') {
|
|
480
|
+
const validateError = validate$b(input);
|
|
481
|
+
if (validateError !== null) {
|
|
482
|
+
throw validateError;
|
|
483
|
+
}
|
|
484
|
+
}
|
|
485
|
+
const key = path.fullPath;
|
|
486
|
+
const existingRecord = store.readEntry(key);
|
|
487
|
+
const ttlToUse = TTL$3;
|
|
488
|
+
let incomingRecord = normalize$3(input, store.readEntry(key), {
|
|
489
|
+
fullPath: key,
|
|
490
|
+
parent: path.parent,
|
|
491
|
+
propertyName: path.propertyName,
|
|
492
|
+
ttl: ttlToUse
|
|
493
|
+
});
|
|
494
|
+
if (existingRecord === undefined || equals$3(existingRecord, incomingRecord) === false) {
|
|
495
|
+
luvio.storePublish(key, incomingRecord);
|
|
496
|
+
}
|
|
497
|
+
{
|
|
498
|
+
const storeMetadataParams = {
|
|
499
|
+
ttl: ttlToUse,
|
|
500
|
+
namespace: "Timeline",
|
|
501
|
+
version: VERSION$3,
|
|
502
|
+
representationName: RepresentationType$3,
|
|
503
|
+
};
|
|
504
|
+
luvio.publishStoreMetadata(key, storeMetadataParams);
|
|
505
|
+
}
|
|
506
|
+
return createLink(key);
|
|
507
|
+
};
|
|
508
|
+
function getTypeCacheKeys$3(luvio, input, fullPathFactory) {
|
|
509
|
+
const rootKeySet = new StoreKeyMap();
|
|
510
|
+
// root cache key (uses fullPathFactory if keyBuilderFromType isn't defined)
|
|
511
|
+
const rootKey = fullPathFactory();
|
|
512
|
+
rootKeySet.set(rootKey, {
|
|
513
|
+
namespace: keyPrefix,
|
|
514
|
+
representationName: RepresentationType$3,
|
|
515
|
+
mergeable: false
|
|
516
|
+
});
|
|
517
|
+
return rootKeySet;
|
|
518
|
+
}
|
|
519
|
+
|
|
520
|
+
function select$6(luvio, params) {
|
|
521
|
+
return select$7();
|
|
522
|
+
}
|
|
523
|
+
function keyBuilder$7(luvio, params) {
|
|
524
|
+
return keyPrefix + '::EngagementEventTimelineDataRepresentation:(' + 'timelineConfigFullName:' + params.urlParams.timelineConfigFullName + ',' + 'timelineObjRecordId:' + params.urlParams.timelineObjRecordId + ')';
|
|
525
|
+
}
|
|
526
|
+
function getResponseCacheKeys$3(luvio, resourceParams, response) {
|
|
527
|
+
return getTypeCacheKeys$3(luvio, response, () => keyBuilder$7(luvio, resourceParams));
|
|
528
|
+
}
|
|
529
|
+
function ingestSuccess$3(luvio, resourceParams, response, snapshotRefresh) {
|
|
530
|
+
const { body } = response;
|
|
531
|
+
const key = keyBuilder$7(luvio, resourceParams);
|
|
532
|
+
luvio.storeIngest(key, ingest$3, body);
|
|
533
|
+
const snapshot = luvio.storeLookup({
|
|
534
|
+
recordId: key,
|
|
535
|
+
node: select$6(),
|
|
536
|
+
variables: {},
|
|
537
|
+
}, snapshotRefresh);
|
|
538
|
+
if (process.env.NODE_ENV !== 'production') {
|
|
539
|
+
if (snapshot.state !== 'Fulfilled') {
|
|
540
|
+
throw new Error('Invalid network response. Expected resource response to result in Fulfilled snapshot');
|
|
541
|
+
}
|
|
542
|
+
}
|
|
543
|
+
deepFreeze(snapshot.data);
|
|
544
|
+
return snapshot;
|
|
545
|
+
}
|
|
546
|
+
function ingestError$3(luvio, params, error, snapshotRefresh) {
|
|
547
|
+
const key = keyBuilder$7(luvio, params);
|
|
548
|
+
const errorSnapshot = luvio.errorSnapshot(error, snapshotRefresh);
|
|
549
|
+
const storeMetadataParams = {
|
|
550
|
+
ttl: TTL$3,
|
|
551
|
+
namespace: keyPrefix,
|
|
552
|
+
version: VERSION$3,
|
|
553
|
+
representationName: RepresentationType$3
|
|
554
|
+
};
|
|
555
|
+
luvio.storeIngestError(key, errorSnapshot, storeMetadataParams);
|
|
556
|
+
return errorSnapshot;
|
|
557
|
+
}
|
|
558
|
+
function createResourceRequest$3(config) {
|
|
559
|
+
const headers = {};
|
|
560
|
+
return {
|
|
561
|
+
baseUri: '/services/data/v59.0',
|
|
562
|
+
basePath: '/connect/timeline/' + config.urlParams.timelineObjRecordId + '/timeline-definitions/' + config.urlParams.timelineConfigFullName + '/cust-data-pfrm/events',
|
|
563
|
+
method: 'get',
|
|
564
|
+
body: null,
|
|
565
|
+
urlParams: config.urlParams,
|
|
566
|
+
queryParams: {},
|
|
567
|
+
headers,
|
|
568
|
+
priority: 'normal',
|
|
569
|
+
};
|
|
570
|
+
}
|
|
571
|
+
|
|
572
|
+
const getEngagementEvents_ConfigPropertyNames = {
|
|
573
|
+
displayName: 'getEngagementEvents',
|
|
574
|
+
parameters: {
|
|
575
|
+
required: ['timelineConfigFullName', 'timelineObjRecordId'],
|
|
576
|
+
optional: []
|
|
577
|
+
}
|
|
578
|
+
};
|
|
579
|
+
function createResourceParams$3(config) {
|
|
580
|
+
const resourceParams = {
|
|
581
|
+
urlParams: {
|
|
582
|
+
timelineConfigFullName: config.timelineConfigFullName, timelineObjRecordId: config.timelineObjRecordId
|
|
583
|
+
}
|
|
584
|
+
};
|
|
585
|
+
return resourceParams;
|
|
586
|
+
}
|
|
587
|
+
function keyBuilder$6(luvio, config) {
|
|
588
|
+
const resourceParams = createResourceParams$3(config);
|
|
589
|
+
return keyBuilder$7(luvio, resourceParams);
|
|
590
|
+
}
|
|
591
|
+
function typeCheckConfig$3(untrustedConfig) {
|
|
592
|
+
const config = {};
|
|
593
|
+
const untrustedConfig_timelineConfigFullName = untrustedConfig.timelineConfigFullName;
|
|
594
|
+
if (typeof untrustedConfig_timelineConfigFullName === 'string') {
|
|
595
|
+
config.timelineConfigFullName = untrustedConfig_timelineConfigFullName;
|
|
596
|
+
}
|
|
597
|
+
const untrustedConfig_timelineObjRecordId = untrustedConfig.timelineObjRecordId;
|
|
598
|
+
if (typeof untrustedConfig_timelineObjRecordId === 'string') {
|
|
599
|
+
config.timelineObjRecordId = untrustedConfig_timelineObjRecordId;
|
|
600
|
+
}
|
|
601
|
+
return config;
|
|
602
|
+
}
|
|
603
|
+
function validateAdapterConfig$3(untrustedConfig, configPropertyNames) {
|
|
604
|
+
if (!untrustedIsObject(untrustedConfig)) {
|
|
605
|
+
return null;
|
|
606
|
+
}
|
|
607
|
+
if (process.env.NODE_ENV !== 'production') {
|
|
608
|
+
validateConfig(untrustedConfig, configPropertyNames);
|
|
609
|
+
}
|
|
610
|
+
const config = typeCheckConfig$3(untrustedConfig);
|
|
611
|
+
if (!areRequiredParametersPresent(config, configPropertyNames)) {
|
|
612
|
+
return null;
|
|
613
|
+
}
|
|
614
|
+
return config;
|
|
615
|
+
}
|
|
616
|
+
function adapterFragment$3(luvio, config) {
|
|
617
|
+
createResourceParams$3(config);
|
|
618
|
+
return select$6();
|
|
619
|
+
}
|
|
620
|
+
function onFetchResponseSuccess$3(luvio, config, resourceParams, response) {
|
|
621
|
+
const snapshot = ingestSuccess$3(luvio, resourceParams, response, {
|
|
622
|
+
config,
|
|
623
|
+
resolve: () => buildNetworkSnapshot$3(luvio, config, snapshotRefreshOptions)
|
|
624
|
+
});
|
|
625
|
+
return luvio.storeBroadcast().then(() => snapshot);
|
|
626
|
+
}
|
|
627
|
+
function onFetchResponseError$3(luvio, config, resourceParams, response) {
|
|
628
|
+
const snapshot = ingestError$3(luvio, resourceParams, response, {
|
|
629
|
+
config,
|
|
630
|
+
resolve: () => buildNetworkSnapshot$3(luvio, config, snapshotRefreshOptions)
|
|
631
|
+
});
|
|
632
|
+
return luvio.storeBroadcast().then(() => snapshot);
|
|
633
|
+
}
|
|
634
|
+
function buildNetworkSnapshot$3(luvio, config, options) {
|
|
635
|
+
const resourceParams = createResourceParams$3(config);
|
|
636
|
+
const request = createResourceRequest$3(resourceParams);
|
|
637
|
+
return luvio.dispatchResourceRequest(request, options)
|
|
638
|
+
.then((response) => {
|
|
639
|
+
return luvio.handleSuccessResponse(() => onFetchResponseSuccess$3(luvio, config, resourceParams, response), () => getResponseCacheKeys$3(luvio, resourceParams, response.body));
|
|
640
|
+
}, (response) => {
|
|
641
|
+
return luvio.handleErrorResponse(() => onFetchResponseError$3(luvio, config, resourceParams, response));
|
|
642
|
+
});
|
|
643
|
+
}
|
|
644
|
+
function buildNetworkSnapshotCachePolicy$3(context, coercedAdapterRequestContext) {
|
|
645
|
+
const { luvio, config } = context;
|
|
646
|
+
const { networkPriority, requestCorrelator, eventObservers } = coercedAdapterRequestContext;
|
|
647
|
+
const dispatchOptions = {
|
|
648
|
+
resourceRequestContext: {
|
|
649
|
+
requestCorrelator,
|
|
650
|
+
luvioRequestMethod: undefined,
|
|
651
|
+
},
|
|
652
|
+
eventObservers
|
|
653
|
+
};
|
|
654
|
+
if (networkPriority !== 'normal') {
|
|
655
|
+
dispatchOptions.overrides = {
|
|
656
|
+
priority: networkPriority
|
|
657
|
+
};
|
|
658
|
+
}
|
|
659
|
+
return buildNetworkSnapshot$3(luvio, config, dispatchOptions);
|
|
660
|
+
}
|
|
661
|
+
function buildCachedSnapshotCachePolicy$3(context, storeLookup) {
|
|
662
|
+
const { luvio, config } = context;
|
|
663
|
+
const selector = {
|
|
664
|
+
recordId: keyBuilder$6(luvio, config),
|
|
665
|
+
node: adapterFragment$3(luvio, config),
|
|
666
|
+
variables: {},
|
|
667
|
+
};
|
|
668
|
+
const cacheSnapshot = storeLookup(selector, {
|
|
669
|
+
config,
|
|
670
|
+
resolve: () => buildNetworkSnapshot$3(luvio, config, snapshotRefreshOptions)
|
|
671
|
+
});
|
|
672
|
+
return cacheSnapshot;
|
|
673
|
+
}
|
|
674
|
+
const getEngagementEventsAdapterFactory = (luvio) => function Timeline__getEngagementEvents(untrustedConfig, requestContext) {
|
|
675
|
+
const config = validateAdapterConfig$3(untrustedConfig, getEngagementEvents_ConfigPropertyNames);
|
|
676
|
+
// Invalid or incomplete config
|
|
677
|
+
if (config === null) {
|
|
678
|
+
return null;
|
|
679
|
+
}
|
|
680
|
+
return luvio.applyCachePolicy((requestContext || {}), { config, luvio }, // BuildSnapshotContext
|
|
681
|
+
buildCachedSnapshotCachePolicy$3, buildNetworkSnapshotCachePolicy$3);
|
|
682
|
+
};
|
|
683
|
+
|
|
684
|
+
const TTL$2 = 500;
|
|
685
|
+
const VERSION$2 = "fdc9f6f24a05bf6064b5dd39db6e4e4d";
|
|
686
|
+
function validate$a(obj, path = 'TimelineDataGetResultRepresentation') {
|
|
403
687
|
const v_error = (() => {
|
|
404
688
|
if (typeof obj !== 'object' || ArrayIsArray(obj) || obj === null) {
|
|
405
689
|
return new TypeError('Expected "object" but received "' + typeof obj + '" (at "' + path + '")');
|
|
@@ -413,7 +697,7 @@ function validate$5(obj, path = 'TimelineDataGetResultRepresentation') {
|
|
|
413
697
|
for (let i = 0; i < obj_errors.length; i++) {
|
|
414
698
|
const obj_errors_item = obj_errors[i];
|
|
415
699
|
const path_errors_item = path_errors + '[' + i + ']';
|
|
416
|
-
const referencepath_errors_itemValidationError = validate$
|
|
700
|
+
const referencepath_errors_itemValidationError = validate$f(obj_errors_item, path_errors_item);
|
|
417
701
|
if (referencepath_errors_itemValidationError !== null) {
|
|
418
702
|
let message = 'Object doesn\'t match TimelineErrorRepresentation (at "' + path_errors_item + '")\n';
|
|
419
703
|
message += referencepath_errors_itemValidationError.message.split('\n').map((line) => '\t' + line).join('\n');
|
|
@@ -430,7 +714,7 @@ function validate$5(obj, path = 'TimelineDataGetResultRepresentation') {
|
|
|
430
714
|
for (let i = 0; i < obj_eventTypes.length; i++) {
|
|
431
715
|
const obj_eventTypes_item = obj_eventTypes[i];
|
|
432
716
|
const path_eventTypes_item = path_eventTypes + '[' + i + ']';
|
|
433
|
-
const referencepath_eventTypes_itemValidationError = validate$
|
|
717
|
+
const referencepath_eventTypes_itemValidationError = validate$e(obj_eventTypes_item, path_eventTypes_item);
|
|
434
718
|
if (referencepath_eventTypes_itemValidationError !== null) {
|
|
435
719
|
let message = 'Object doesn\'t match TimelineEventTypeRepresentation (at "' + path_eventTypes_item + '")\n';
|
|
436
720
|
message += referencepath_eventTypes_itemValidationError.message.split('\n').map((line) => '\t' + line).join('\n');
|
|
@@ -447,7 +731,7 @@ function validate$5(obj, path = 'TimelineDataGetResultRepresentation') {
|
|
|
447
731
|
for (let i = 0; i < obj_events.length; i++) {
|
|
448
732
|
const obj_events_item = obj_events[i];
|
|
449
733
|
const path_events_item = path_events + '[' + i + ']';
|
|
450
|
-
const referencepath_events_itemValidationError = validate$
|
|
734
|
+
const referencepath_events_itemValidationError = validate$c(obj_events_item, path_events_item);
|
|
451
735
|
if (referencepath_events_itemValidationError !== null) {
|
|
452
736
|
let message = 'Object doesn\'t match TimelineEventRepresentation (at "' + path_events_item + '")\n';
|
|
453
737
|
message += referencepath_events_itemValidationError.message.split('\n').map((line) => '\t' + line).join('\n');
|
|
@@ -472,82 +756,82 @@ function validate$5(obj, path = 'TimelineDataGetResultRepresentation') {
|
|
|
472
756
|
})();
|
|
473
757
|
return v_error === undefined ? null : v_error;
|
|
474
758
|
}
|
|
475
|
-
const RepresentationType$
|
|
476
|
-
function normalize$
|
|
759
|
+
const RepresentationType$2 = 'TimelineDataGetResultRepresentation';
|
|
760
|
+
function normalize$2(input, existing, path, luvio, store, timestamp) {
|
|
477
761
|
return input;
|
|
478
762
|
}
|
|
479
|
-
const select$
|
|
763
|
+
const select$5 = function TimelineDataGetResultRepresentationSelect() {
|
|
480
764
|
return {
|
|
481
765
|
kind: 'Fragment',
|
|
482
|
-
version: VERSION$
|
|
766
|
+
version: VERSION$2,
|
|
483
767
|
private: [],
|
|
484
768
|
opaque: true
|
|
485
769
|
};
|
|
486
770
|
};
|
|
487
|
-
function equals$
|
|
771
|
+
function equals$2(existing, incoming) {
|
|
488
772
|
if (JSONStringify(incoming) !== JSONStringify(existing)) {
|
|
489
773
|
return false;
|
|
490
774
|
}
|
|
491
775
|
return true;
|
|
492
776
|
}
|
|
493
|
-
const ingest$
|
|
777
|
+
const ingest$2 = function TimelineDataGetResultRepresentationIngest(input, path, luvio, store, timestamp) {
|
|
494
778
|
if (process.env.NODE_ENV !== 'production') {
|
|
495
|
-
const validateError = validate$
|
|
779
|
+
const validateError = validate$a(input);
|
|
496
780
|
if (validateError !== null) {
|
|
497
781
|
throw validateError;
|
|
498
782
|
}
|
|
499
783
|
}
|
|
500
784
|
const key = path.fullPath;
|
|
501
785
|
const existingRecord = store.readEntry(key);
|
|
502
|
-
const ttlToUse = TTL$
|
|
503
|
-
let incomingRecord = normalize$
|
|
786
|
+
const ttlToUse = TTL$2;
|
|
787
|
+
let incomingRecord = normalize$2(input, store.readEntry(key), {
|
|
504
788
|
fullPath: key,
|
|
505
789
|
parent: path.parent,
|
|
506
790
|
propertyName: path.propertyName,
|
|
507
791
|
ttl: ttlToUse
|
|
508
792
|
});
|
|
509
|
-
if (existingRecord === undefined || equals$
|
|
793
|
+
if (existingRecord === undefined || equals$2(existingRecord, incomingRecord) === false) {
|
|
510
794
|
luvio.storePublish(key, incomingRecord);
|
|
511
795
|
}
|
|
512
796
|
{
|
|
513
797
|
const storeMetadataParams = {
|
|
514
798
|
ttl: ttlToUse,
|
|
515
799
|
namespace: "Timeline",
|
|
516
|
-
version: VERSION$
|
|
517
|
-
representationName: RepresentationType$
|
|
800
|
+
version: VERSION$2,
|
|
801
|
+
representationName: RepresentationType$2,
|
|
518
802
|
};
|
|
519
803
|
luvio.publishStoreMetadata(key, storeMetadataParams);
|
|
520
804
|
}
|
|
521
805
|
return createLink(key);
|
|
522
806
|
};
|
|
523
|
-
function getTypeCacheKeys$
|
|
807
|
+
function getTypeCacheKeys$2(luvio, input, fullPathFactory) {
|
|
524
808
|
const rootKeySet = new StoreKeyMap();
|
|
525
809
|
// root cache key (uses fullPathFactory if keyBuilderFromType isn't defined)
|
|
526
810
|
const rootKey = fullPathFactory();
|
|
527
811
|
rootKeySet.set(rootKey, {
|
|
528
812
|
namespace: keyPrefix,
|
|
529
|
-
representationName: RepresentationType$
|
|
813
|
+
representationName: RepresentationType$2,
|
|
530
814
|
mergeable: false
|
|
531
815
|
});
|
|
532
816
|
return rootKeySet;
|
|
533
817
|
}
|
|
534
818
|
|
|
535
|
-
function select$
|
|
536
|
-
return select$
|
|
819
|
+
function select$4(luvio, params) {
|
|
820
|
+
return select$5();
|
|
537
821
|
}
|
|
538
|
-
function keyBuilder$
|
|
822
|
+
function keyBuilder$5(luvio, params) {
|
|
539
823
|
return keyPrefix + '::TimelineDataGetResultRepresentation:(' + 'direction:' + params.queryParams.direction + ',' + 'endDate:' + params.queryParams.endDate + ',' + 'eventTypeOffsets:' + params.queryParams.eventTypeOffsets + ',' + 'eventTypes:' + params.queryParams.eventTypes + ',' + 'startDate:' + params.queryParams.startDate + ',' + 'timelineConfigFullName:' + params.urlParams.timelineConfigFullName + ',' + 'timelineObjRecordId:' + params.urlParams.timelineObjRecordId + ')';
|
|
540
824
|
}
|
|
541
|
-
function getResponseCacheKeys$
|
|
542
|
-
return getTypeCacheKeys$
|
|
825
|
+
function getResponseCacheKeys$2(luvio, resourceParams, response) {
|
|
826
|
+
return getTypeCacheKeys$2(luvio, response, () => keyBuilder$5(luvio, resourceParams));
|
|
543
827
|
}
|
|
544
|
-
function ingestSuccess$
|
|
828
|
+
function ingestSuccess$2(luvio, resourceParams, response, snapshotRefresh) {
|
|
545
829
|
const { body } = response;
|
|
546
|
-
const key = keyBuilder$
|
|
547
|
-
luvio.storeIngest(key, ingest$
|
|
830
|
+
const key = keyBuilder$5(luvio, resourceParams);
|
|
831
|
+
luvio.storeIngest(key, ingest$2, body);
|
|
548
832
|
const snapshot = luvio.storeLookup({
|
|
549
833
|
recordId: key,
|
|
550
|
-
node: select$
|
|
834
|
+
node: select$4(),
|
|
551
835
|
variables: {},
|
|
552
836
|
}, snapshotRefresh);
|
|
553
837
|
if (process.env.NODE_ENV !== 'production') {
|
|
@@ -558,19 +842,19 @@ function ingestSuccess$1(luvio, resourceParams, response, snapshotRefresh) {
|
|
|
558
842
|
deepFreeze(snapshot.data);
|
|
559
843
|
return snapshot;
|
|
560
844
|
}
|
|
561
|
-
function ingestError$
|
|
562
|
-
const key = keyBuilder$
|
|
845
|
+
function ingestError$2(luvio, params, error, snapshotRefresh) {
|
|
846
|
+
const key = keyBuilder$5(luvio, params);
|
|
563
847
|
const errorSnapshot = luvio.errorSnapshot(error, snapshotRefresh);
|
|
564
848
|
const storeMetadataParams = {
|
|
565
|
-
ttl: TTL$
|
|
849
|
+
ttl: TTL$2,
|
|
566
850
|
namespace: keyPrefix,
|
|
567
|
-
version: VERSION$
|
|
568
|
-
representationName: RepresentationType$
|
|
851
|
+
version: VERSION$2,
|
|
852
|
+
representationName: RepresentationType$2
|
|
569
853
|
};
|
|
570
854
|
luvio.storeIngestError(key, errorSnapshot, storeMetadataParams);
|
|
571
855
|
return errorSnapshot;
|
|
572
856
|
}
|
|
573
|
-
function createResourceRequest$
|
|
857
|
+
function createResourceRequest$2(config) {
|
|
574
858
|
const headers = {};
|
|
575
859
|
return {
|
|
576
860
|
baseUri: '/services/data/v59.0',
|
|
@@ -591,7 +875,7 @@ const getTimelineData_ConfigPropertyNames = {
|
|
|
591
875
|
optional: ['direction', 'endDate', 'eventTypeOffsets', 'eventTypes', 'startDate']
|
|
592
876
|
}
|
|
593
877
|
};
|
|
594
|
-
function createResourceParams$
|
|
878
|
+
function createResourceParams$2(config) {
|
|
595
879
|
const resourceParams = {
|
|
596
880
|
urlParams: {
|
|
597
881
|
timelineConfigFullName: config.timelineConfigFullName, timelineObjRecordId: config.timelineObjRecordId
|
|
@@ -602,11 +886,11 @@ function createResourceParams$1(config) {
|
|
|
602
886
|
};
|
|
603
887
|
return resourceParams;
|
|
604
888
|
}
|
|
605
|
-
function keyBuilder$
|
|
606
|
-
const resourceParams = createResourceParams$
|
|
607
|
-
return keyBuilder$
|
|
889
|
+
function keyBuilder$4(luvio, config) {
|
|
890
|
+
const resourceParams = createResourceParams$2(config);
|
|
891
|
+
return keyBuilder$5(luvio, resourceParams);
|
|
608
892
|
}
|
|
609
|
-
function typeCheckConfig$
|
|
893
|
+
function typeCheckConfig$2(untrustedConfig) {
|
|
610
894
|
const config = {};
|
|
611
895
|
const untrustedConfig_timelineConfigFullName = untrustedConfig.timelineConfigFullName;
|
|
612
896
|
if (typeof untrustedConfig_timelineConfigFullName === 'string') {
|
|
@@ -638,6 +922,373 @@ function typeCheckConfig$1(untrustedConfig) {
|
|
|
638
922
|
}
|
|
639
923
|
return config;
|
|
640
924
|
}
|
|
925
|
+
function validateAdapterConfig$2(untrustedConfig, configPropertyNames) {
|
|
926
|
+
if (!untrustedIsObject(untrustedConfig)) {
|
|
927
|
+
return null;
|
|
928
|
+
}
|
|
929
|
+
if (process.env.NODE_ENV !== 'production') {
|
|
930
|
+
validateConfig(untrustedConfig, configPropertyNames);
|
|
931
|
+
}
|
|
932
|
+
const config = typeCheckConfig$2(untrustedConfig);
|
|
933
|
+
if (!areRequiredParametersPresent(config, configPropertyNames)) {
|
|
934
|
+
return null;
|
|
935
|
+
}
|
|
936
|
+
return config;
|
|
937
|
+
}
|
|
938
|
+
function adapterFragment$2(luvio, config) {
|
|
939
|
+
createResourceParams$2(config);
|
|
940
|
+
return select$4();
|
|
941
|
+
}
|
|
942
|
+
function onFetchResponseSuccess$2(luvio, config, resourceParams, response) {
|
|
943
|
+
const snapshot = ingestSuccess$2(luvio, resourceParams, response, {
|
|
944
|
+
config,
|
|
945
|
+
resolve: () => buildNetworkSnapshot$2(luvio, config, snapshotRefreshOptions)
|
|
946
|
+
});
|
|
947
|
+
return luvio.storeBroadcast().then(() => snapshot);
|
|
948
|
+
}
|
|
949
|
+
function onFetchResponseError$2(luvio, config, resourceParams, response) {
|
|
950
|
+
const snapshot = ingestError$2(luvio, resourceParams, response, {
|
|
951
|
+
config,
|
|
952
|
+
resolve: () => buildNetworkSnapshot$2(luvio, config, snapshotRefreshOptions)
|
|
953
|
+
});
|
|
954
|
+
return luvio.storeBroadcast().then(() => snapshot);
|
|
955
|
+
}
|
|
956
|
+
function buildNetworkSnapshot$2(luvio, config, options) {
|
|
957
|
+
const resourceParams = createResourceParams$2(config);
|
|
958
|
+
const request = createResourceRequest$2(resourceParams);
|
|
959
|
+
return luvio.dispatchResourceRequest(request, options)
|
|
960
|
+
.then((response) => {
|
|
961
|
+
return luvio.handleSuccessResponse(() => onFetchResponseSuccess$2(luvio, config, resourceParams, response), () => getResponseCacheKeys$2(luvio, resourceParams, response.body));
|
|
962
|
+
}, (response) => {
|
|
963
|
+
return luvio.handleErrorResponse(() => onFetchResponseError$2(luvio, config, resourceParams, response));
|
|
964
|
+
});
|
|
965
|
+
}
|
|
966
|
+
function buildNetworkSnapshotCachePolicy$2(context, coercedAdapterRequestContext) {
|
|
967
|
+
const { luvio, config } = context;
|
|
968
|
+
const { networkPriority, requestCorrelator, eventObservers } = coercedAdapterRequestContext;
|
|
969
|
+
const dispatchOptions = {
|
|
970
|
+
resourceRequestContext: {
|
|
971
|
+
requestCorrelator,
|
|
972
|
+
luvioRequestMethod: undefined,
|
|
973
|
+
},
|
|
974
|
+
eventObservers
|
|
975
|
+
};
|
|
976
|
+
if (networkPriority !== 'normal') {
|
|
977
|
+
dispatchOptions.overrides = {
|
|
978
|
+
priority: networkPriority
|
|
979
|
+
};
|
|
980
|
+
}
|
|
981
|
+
return buildNetworkSnapshot$2(luvio, config, dispatchOptions);
|
|
982
|
+
}
|
|
983
|
+
function buildCachedSnapshotCachePolicy$2(context, storeLookup) {
|
|
984
|
+
const { luvio, config } = context;
|
|
985
|
+
const selector = {
|
|
986
|
+
recordId: keyBuilder$4(luvio, config),
|
|
987
|
+
node: adapterFragment$2(luvio, config),
|
|
988
|
+
variables: {},
|
|
989
|
+
};
|
|
990
|
+
const cacheSnapshot = storeLookup(selector, {
|
|
991
|
+
config,
|
|
992
|
+
resolve: () => buildNetworkSnapshot$2(luvio, config, snapshotRefreshOptions)
|
|
993
|
+
});
|
|
994
|
+
return cacheSnapshot;
|
|
995
|
+
}
|
|
996
|
+
const getTimelineDataAdapterFactory = (luvio) => function Timeline__getTimelineData(untrustedConfig, requestContext) {
|
|
997
|
+
const config = validateAdapterConfig$2(untrustedConfig, getTimelineData_ConfigPropertyNames);
|
|
998
|
+
// Invalid or incomplete config
|
|
999
|
+
if (config === null) {
|
|
1000
|
+
return null;
|
|
1001
|
+
}
|
|
1002
|
+
return luvio.applyCachePolicy((requestContext || {}), { config, luvio }, // BuildSnapshotContext
|
|
1003
|
+
buildCachedSnapshotCachePolicy$2, buildNetworkSnapshotCachePolicy$2);
|
|
1004
|
+
};
|
|
1005
|
+
|
|
1006
|
+
function validate$9(obj, path = 'DmoFieldsOutputRepresentation') {
|
|
1007
|
+
const v_error = (() => {
|
|
1008
|
+
if (typeof obj !== 'object' || ArrayIsArray(obj) || obj === null) {
|
|
1009
|
+
return new TypeError('Expected "object" but received "' + typeof obj + '" (at "' + path + '")');
|
|
1010
|
+
}
|
|
1011
|
+
const obj_displayName = obj.displayName;
|
|
1012
|
+
const path_displayName = path + '.displayName';
|
|
1013
|
+
if (typeof obj_displayName !== 'string') {
|
|
1014
|
+
return new TypeError('Expected "string" but received "' + typeof obj_displayName + '" (at "' + path_displayName + '")');
|
|
1015
|
+
}
|
|
1016
|
+
const obj_name = obj.name;
|
|
1017
|
+
const path_name = path + '.name';
|
|
1018
|
+
if (typeof obj_name !== 'string') {
|
|
1019
|
+
return new TypeError('Expected "string" but received "' + typeof obj_name + '" (at "' + path_name + '")');
|
|
1020
|
+
}
|
|
1021
|
+
const obj_type = obj.type;
|
|
1022
|
+
const path_type = path + '.type';
|
|
1023
|
+
if (typeof obj_type !== 'string') {
|
|
1024
|
+
return new TypeError('Expected "string" but received "' + typeof obj_type + '" (at "' + path_type + '")');
|
|
1025
|
+
}
|
|
1026
|
+
})();
|
|
1027
|
+
return v_error === undefined ? null : v_error;
|
|
1028
|
+
}
|
|
1029
|
+
|
|
1030
|
+
function validate$8(obj, path = 'RelationshipTypeOutputRepresentation') {
|
|
1031
|
+
const v_error = (() => {
|
|
1032
|
+
if (typeof obj !== 'object' || ArrayIsArray(obj) || obj === null) {
|
|
1033
|
+
return new TypeError('Expected "object" but received "' + typeof obj + '" (at "' + path + '")');
|
|
1034
|
+
}
|
|
1035
|
+
const obj_attribute = obj.attribute;
|
|
1036
|
+
const path_attribute = path + '.attribute';
|
|
1037
|
+
if (typeof obj_attribute !== 'string') {
|
|
1038
|
+
return new TypeError('Expected "string" but received "' + typeof obj_attribute + '" (at "' + path_attribute + '")');
|
|
1039
|
+
}
|
|
1040
|
+
const obj_name = obj.name;
|
|
1041
|
+
const path_name = path + '.name';
|
|
1042
|
+
if (typeof obj_name !== 'string') {
|
|
1043
|
+
return new TypeError('Expected "string" but received "' + typeof obj_name + '" (at "' + path_name + '")');
|
|
1044
|
+
}
|
|
1045
|
+
})();
|
|
1046
|
+
return v_error === undefined ? null : v_error;
|
|
1047
|
+
}
|
|
1048
|
+
|
|
1049
|
+
function validate$7(obj, path = 'DmoRelationshipsOutputRepresentation') {
|
|
1050
|
+
const v_error = (() => {
|
|
1051
|
+
if (typeof obj !== 'object' || ArrayIsArray(obj) || obj === null) {
|
|
1052
|
+
return new TypeError('Expected "object" but received "' + typeof obj + '" (at "' + path + '")');
|
|
1053
|
+
}
|
|
1054
|
+
const obj_fromEntity = obj.fromEntity;
|
|
1055
|
+
const path_fromEntity = path + '.fromEntity';
|
|
1056
|
+
const referencepath_fromEntityValidationError = validate$8(obj_fromEntity, path_fromEntity);
|
|
1057
|
+
if (referencepath_fromEntityValidationError !== null) {
|
|
1058
|
+
let message = 'Object doesn\'t match RelationshipTypeOutputRepresentation (at "' + path_fromEntity + '")\n';
|
|
1059
|
+
message += referencepath_fromEntityValidationError.message.split('\n').map((line) => '\t' + line).join('\n');
|
|
1060
|
+
return new TypeError(message);
|
|
1061
|
+
}
|
|
1062
|
+
const obj_toEntity = obj.toEntity;
|
|
1063
|
+
const path_toEntity = path + '.toEntity';
|
|
1064
|
+
const referencepath_toEntityValidationError = validate$8(obj_toEntity, path_toEntity);
|
|
1065
|
+
if (referencepath_toEntityValidationError !== null) {
|
|
1066
|
+
let message = 'Object doesn\'t match RelationshipTypeOutputRepresentation (at "' + path_toEntity + '")\n';
|
|
1067
|
+
message += referencepath_toEntityValidationError.message.split('\n').map((line) => '\t' + line).join('\n');
|
|
1068
|
+
return new TypeError(message);
|
|
1069
|
+
}
|
|
1070
|
+
})();
|
|
1071
|
+
return v_error === undefined ? null : v_error;
|
|
1072
|
+
}
|
|
1073
|
+
|
|
1074
|
+
function validate$6(obj, path = 'DmoOutputRepresentation') {
|
|
1075
|
+
const v_error = (() => {
|
|
1076
|
+
if (typeof obj !== 'object' || ArrayIsArray(obj) || obj === null) {
|
|
1077
|
+
return new TypeError('Expected "object" but received "' + typeof obj + '" (at "' + path + '")');
|
|
1078
|
+
}
|
|
1079
|
+
const obj_category = obj.category;
|
|
1080
|
+
const path_category = path + '.category';
|
|
1081
|
+
if (typeof obj_category !== 'string') {
|
|
1082
|
+
return new TypeError('Expected "string" but received "' + typeof obj_category + '" (at "' + path_category + '")');
|
|
1083
|
+
}
|
|
1084
|
+
const obj_displayName = obj.displayName;
|
|
1085
|
+
const path_displayName = path + '.displayName';
|
|
1086
|
+
if (typeof obj_displayName !== 'string') {
|
|
1087
|
+
return new TypeError('Expected "string" but received "' + typeof obj_displayName + '" (at "' + path_displayName + '")');
|
|
1088
|
+
}
|
|
1089
|
+
const obj_fields = obj.fields;
|
|
1090
|
+
const path_fields = path + '.fields';
|
|
1091
|
+
if (!ArrayIsArray(obj_fields)) {
|
|
1092
|
+
return new TypeError('Expected "array" but received "' + typeof obj_fields + '" (at "' + path_fields + '")');
|
|
1093
|
+
}
|
|
1094
|
+
for (let i = 0; i < obj_fields.length; i++) {
|
|
1095
|
+
const obj_fields_item = obj_fields[i];
|
|
1096
|
+
const path_fields_item = path_fields + '[' + i + ']';
|
|
1097
|
+
const referencepath_fields_itemValidationError = validate$9(obj_fields_item, path_fields_item);
|
|
1098
|
+
if (referencepath_fields_itemValidationError !== null) {
|
|
1099
|
+
let message = 'Object doesn\'t match DmoFieldsOutputRepresentation (at "' + path_fields_item + '")\n';
|
|
1100
|
+
message += referencepath_fields_itemValidationError.message.split('\n').map((line) => '\t' + line).join('\n');
|
|
1101
|
+
return new TypeError(message);
|
|
1102
|
+
}
|
|
1103
|
+
}
|
|
1104
|
+
const obj_name = obj.name;
|
|
1105
|
+
const path_name = path + '.name';
|
|
1106
|
+
if (typeof obj_name !== 'string') {
|
|
1107
|
+
return new TypeError('Expected "string" but received "' + typeof obj_name + '" (at "' + path_name + '")');
|
|
1108
|
+
}
|
|
1109
|
+
const obj_relationships = obj.relationships;
|
|
1110
|
+
const path_relationships = path + '.relationships';
|
|
1111
|
+
if (!ArrayIsArray(obj_relationships)) {
|
|
1112
|
+
return new TypeError('Expected "array" but received "' + typeof obj_relationships + '" (at "' + path_relationships + '")');
|
|
1113
|
+
}
|
|
1114
|
+
for (let i = 0; i < obj_relationships.length; i++) {
|
|
1115
|
+
const obj_relationships_item = obj_relationships[i];
|
|
1116
|
+
const path_relationships_item = path_relationships + '[' + i + ']';
|
|
1117
|
+
const referencepath_relationships_itemValidationError = validate$7(obj_relationships_item, path_relationships_item);
|
|
1118
|
+
if (referencepath_relationships_itemValidationError !== null) {
|
|
1119
|
+
let message = 'Object doesn\'t match DmoRelationshipsOutputRepresentation (at "' + path_relationships_item + '")\n';
|
|
1120
|
+
message += referencepath_relationships_itemValidationError.message.split('\n').map((line) => '\t' + line).join('\n');
|
|
1121
|
+
return new TypeError(message);
|
|
1122
|
+
}
|
|
1123
|
+
}
|
|
1124
|
+
})();
|
|
1125
|
+
return v_error === undefined ? null : v_error;
|
|
1126
|
+
}
|
|
1127
|
+
|
|
1128
|
+
const TTL$1 = 600000;
|
|
1129
|
+
const VERSION$1 = "84ccc17f91013e292e7b01a291dd0322";
|
|
1130
|
+
function validate$5(obj, path = 'CdpMetadataOutputRepresentation') {
|
|
1131
|
+
const v_error = (() => {
|
|
1132
|
+
if (typeof obj !== 'object' || ArrayIsArray(obj) || obj === null) {
|
|
1133
|
+
return new TypeError('Expected "object" but received "' + typeof obj + '" (at "' + path + '")');
|
|
1134
|
+
}
|
|
1135
|
+
const obj_dmos = obj.dmos;
|
|
1136
|
+
const path_dmos = path + '.dmos';
|
|
1137
|
+
if (!ArrayIsArray(obj_dmos)) {
|
|
1138
|
+
return new TypeError('Expected "array" but received "' + typeof obj_dmos + '" (at "' + path_dmos + '")');
|
|
1139
|
+
}
|
|
1140
|
+
for (let i = 0; i < obj_dmos.length; i++) {
|
|
1141
|
+
const obj_dmos_item = obj_dmos[i];
|
|
1142
|
+
const path_dmos_item = path_dmos + '[' + i + ']';
|
|
1143
|
+
const referencepath_dmos_itemValidationError = validate$6(obj_dmos_item, path_dmos_item);
|
|
1144
|
+
if (referencepath_dmos_itemValidationError !== null) {
|
|
1145
|
+
let message = 'Object doesn\'t match DmoOutputRepresentation (at "' + path_dmos_item + '")\n';
|
|
1146
|
+
message += referencepath_dmos_itemValidationError.message.split('\n').map((line) => '\t' + line).join('\n');
|
|
1147
|
+
return new TypeError(message);
|
|
1148
|
+
}
|
|
1149
|
+
}
|
|
1150
|
+
})();
|
|
1151
|
+
return v_error === undefined ? null : v_error;
|
|
1152
|
+
}
|
|
1153
|
+
const RepresentationType$1 = 'CdpMetadataOutputRepresentation';
|
|
1154
|
+
function normalize$1(input, existing, path, luvio, store, timestamp) {
|
|
1155
|
+
return input;
|
|
1156
|
+
}
|
|
1157
|
+
const select$3 = function CdpMetadataOutputRepresentationSelect() {
|
|
1158
|
+
return {
|
|
1159
|
+
kind: 'Fragment',
|
|
1160
|
+
version: VERSION$1,
|
|
1161
|
+
private: [],
|
|
1162
|
+
opaque: true
|
|
1163
|
+
};
|
|
1164
|
+
};
|
|
1165
|
+
function equals$1(existing, incoming) {
|
|
1166
|
+
if (JSONStringify(incoming) !== JSONStringify(existing)) {
|
|
1167
|
+
return false;
|
|
1168
|
+
}
|
|
1169
|
+
return true;
|
|
1170
|
+
}
|
|
1171
|
+
const ingest$1 = function CdpMetadataOutputRepresentationIngest(input, path, luvio, store, timestamp) {
|
|
1172
|
+
if (process.env.NODE_ENV !== 'production') {
|
|
1173
|
+
const validateError = validate$5(input);
|
|
1174
|
+
if (validateError !== null) {
|
|
1175
|
+
throw validateError;
|
|
1176
|
+
}
|
|
1177
|
+
}
|
|
1178
|
+
const key = path.fullPath;
|
|
1179
|
+
const existingRecord = store.readEntry(key);
|
|
1180
|
+
const ttlToUse = TTL$1;
|
|
1181
|
+
let incomingRecord = normalize$1(input, store.readEntry(key), {
|
|
1182
|
+
fullPath: key,
|
|
1183
|
+
parent: path.parent,
|
|
1184
|
+
propertyName: path.propertyName,
|
|
1185
|
+
ttl: ttlToUse
|
|
1186
|
+
});
|
|
1187
|
+
if (existingRecord === undefined || equals$1(existingRecord, incomingRecord) === false) {
|
|
1188
|
+
luvio.storePublish(key, incomingRecord);
|
|
1189
|
+
}
|
|
1190
|
+
{
|
|
1191
|
+
const storeMetadataParams = {
|
|
1192
|
+
ttl: ttlToUse,
|
|
1193
|
+
namespace: "Timeline",
|
|
1194
|
+
version: VERSION$1,
|
|
1195
|
+
representationName: RepresentationType$1,
|
|
1196
|
+
};
|
|
1197
|
+
luvio.publishStoreMetadata(key, storeMetadataParams);
|
|
1198
|
+
}
|
|
1199
|
+
return createLink(key);
|
|
1200
|
+
};
|
|
1201
|
+
function getTypeCacheKeys$1(luvio, input, fullPathFactory) {
|
|
1202
|
+
const rootKeySet = new StoreKeyMap();
|
|
1203
|
+
// root cache key (uses fullPathFactory if keyBuilderFromType isn't defined)
|
|
1204
|
+
const rootKey = fullPathFactory();
|
|
1205
|
+
rootKeySet.set(rootKey, {
|
|
1206
|
+
namespace: keyPrefix,
|
|
1207
|
+
representationName: RepresentationType$1,
|
|
1208
|
+
mergeable: false
|
|
1209
|
+
});
|
|
1210
|
+
return rootKeySet;
|
|
1211
|
+
}
|
|
1212
|
+
|
|
1213
|
+
function select$2(luvio, params) {
|
|
1214
|
+
return select$3();
|
|
1215
|
+
}
|
|
1216
|
+
function keyBuilder$3(luvio, params) {
|
|
1217
|
+
return keyPrefix + '::CdpMetadataOutputRepresentation:(' + 'objectCategory:' + params.queryParams.objectCategory + ')';
|
|
1218
|
+
}
|
|
1219
|
+
function getResponseCacheKeys$1(luvio, resourceParams, response) {
|
|
1220
|
+
return getTypeCacheKeys$1(luvio, response, () => keyBuilder$3(luvio, resourceParams));
|
|
1221
|
+
}
|
|
1222
|
+
function ingestSuccess$1(luvio, resourceParams, response, snapshotRefresh) {
|
|
1223
|
+
const { body } = response;
|
|
1224
|
+
const key = keyBuilder$3(luvio, resourceParams);
|
|
1225
|
+
luvio.storeIngest(key, ingest$1, body);
|
|
1226
|
+
const snapshot = luvio.storeLookup({
|
|
1227
|
+
recordId: key,
|
|
1228
|
+
node: select$2(),
|
|
1229
|
+
variables: {},
|
|
1230
|
+
}, snapshotRefresh);
|
|
1231
|
+
if (process.env.NODE_ENV !== 'production') {
|
|
1232
|
+
if (snapshot.state !== 'Fulfilled') {
|
|
1233
|
+
throw new Error('Invalid network response. Expected resource response to result in Fulfilled snapshot');
|
|
1234
|
+
}
|
|
1235
|
+
}
|
|
1236
|
+
deepFreeze(snapshot.data);
|
|
1237
|
+
return snapshot;
|
|
1238
|
+
}
|
|
1239
|
+
function ingestError$1(luvio, params, error, snapshotRefresh) {
|
|
1240
|
+
const key = keyBuilder$3(luvio, params);
|
|
1241
|
+
const errorSnapshot = luvio.errorSnapshot(error, snapshotRefresh);
|
|
1242
|
+
const storeMetadataParams = {
|
|
1243
|
+
ttl: TTL$1,
|
|
1244
|
+
namespace: keyPrefix,
|
|
1245
|
+
version: VERSION$1,
|
|
1246
|
+
representationName: RepresentationType$1
|
|
1247
|
+
};
|
|
1248
|
+
luvio.storeIngestError(key, errorSnapshot, storeMetadataParams);
|
|
1249
|
+
return errorSnapshot;
|
|
1250
|
+
}
|
|
1251
|
+
function createResourceRequest$1(config) {
|
|
1252
|
+
const headers = {};
|
|
1253
|
+
return {
|
|
1254
|
+
baseUri: '/services/data/v59.0',
|
|
1255
|
+
basePath: '/connect/timeline/cust-data-pfrm/data-model-objects',
|
|
1256
|
+
method: 'get',
|
|
1257
|
+
body: null,
|
|
1258
|
+
urlParams: {},
|
|
1259
|
+
queryParams: config.queryParams,
|
|
1260
|
+
headers,
|
|
1261
|
+
priority: 'normal',
|
|
1262
|
+
};
|
|
1263
|
+
}
|
|
1264
|
+
|
|
1265
|
+
const getDataModelObjects_ConfigPropertyNames = {
|
|
1266
|
+
displayName: 'getDataModelObjects',
|
|
1267
|
+
parameters: {
|
|
1268
|
+
required: [],
|
|
1269
|
+
optional: ['objectCategory']
|
|
1270
|
+
}
|
|
1271
|
+
};
|
|
1272
|
+
function createResourceParams$1(config) {
|
|
1273
|
+
const resourceParams = {
|
|
1274
|
+
queryParams: {
|
|
1275
|
+
objectCategory: config.objectCategory
|
|
1276
|
+
}
|
|
1277
|
+
};
|
|
1278
|
+
return resourceParams;
|
|
1279
|
+
}
|
|
1280
|
+
function keyBuilder$2(luvio, config) {
|
|
1281
|
+
const resourceParams = createResourceParams$1(config);
|
|
1282
|
+
return keyBuilder$3(luvio, resourceParams);
|
|
1283
|
+
}
|
|
1284
|
+
function typeCheckConfig$1(untrustedConfig) {
|
|
1285
|
+
const config = {};
|
|
1286
|
+
const untrustedConfig_objectCategory = untrustedConfig.objectCategory;
|
|
1287
|
+
if (typeof untrustedConfig_objectCategory === 'string') {
|
|
1288
|
+
config.objectCategory = untrustedConfig_objectCategory;
|
|
1289
|
+
}
|
|
1290
|
+
return config;
|
|
1291
|
+
}
|
|
641
1292
|
function validateAdapterConfig$1(untrustedConfig, configPropertyNames) {
|
|
642
1293
|
if (!untrustedIsObject(untrustedConfig)) {
|
|
643
1294
|
return null;
|
|
@@ -709,8 +1360,8 @@ function buildCachedSnapshotCachePolicy$1(context, storeLookup) {
|
|
|
709
1360
|
});
|
|
710
1361
|
return cacheSnapshot;
|
|
711
1362
|
}
|
|
712
|
-
const
|
|
713
|
-
const config = validateAdapterConfig$1(untrustedConfig,
|
|
1363
|
+
const getDataModelObjectsAdapterFactory = (luvio) => function Timeline__getDataModelObjects(untrustedConfig, requestContext) {
|
|
1364
|
+
const config = validateAdapterConfig$1(untrustedConfig, getDataModelObjects_ConfigPropertyNames);
|
|
714
1365
|
// Invalid or incomplete config
|
|
715
1366
|
if (config === null) {
|
|
716
1367
|
return null;
|
|
@@ -1241,7 +1892,7 @@ function validate(obj, path = 'TimelineMetadataResultRepresentation') {
|
|
|
1241
1892
|
for (let i = 0; i < obj_errors.length; i++) {
|
|
1242
1893
|
const obj_errors_item = obj_errors[i];
|
|
1243
1894
|
const path_errors_item = path_errors + '[' + i + ']';
|
|
1244
|
-
const referencepath_errors_itemValidationError = validate$
|
|
1895
|
+
const referencepath_errors_itemValidationError = validate$f(obj_errors_item, path_errors_item);
|
|
1245
1896
|
if (referencepath_errors_itemValidationError !== null) {
|
|
1246
1897
|
let message = 'Object doesn\'t match TimelineErrorRepresentation (at "' + path_errors_item + '")\n';
|
|
1247
1898
|
message += referencepath_errors_itemValidationError.message.split('\n').map((line) => '\t' + line).join('\n');
|
|
@@ -1505,4 +2156,4 @@ const getTimelineMetadataAdapterFactory = (luvio) => function Timeline__getTimel
|
|
|
1505
2156
|
buildCachedSnapshotCachePolicy, buildNetworkSnapshotCachePolicy);
|
|
1506
2157
|
};
|
|
1507
2158
|
|
|
1508
|
-
export { getTimelineDataAdapterFactory, getTimelineMetadataAdapterFactory };
|
|
2159
|
+
export { getDataModelObjectsAdapterFactory, getEngagementEventsAdapterFactory, getTimelineDataAdapterFactory, getTimelineMetadataAdapterFactory };
|