@salesforce/lds-adapters-commerce-extensions 1.210.0 → 1.211.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/commerce-extensions.js +452 -223
- package/dist/es/es2018/types/src/generated/adapters/createMapping.d.ts +1 -1
- package/dist/es/es2018/types/src/generated/adapters/getProvider.d.ts +27 -0
- package/dist/es/es2018/types/src/generated/adapters/updateMapping.d.ts +1 -1
- package/dist/es/es2018/types/src/generated/artifacts/main.d.ts +1 -0
- package/dist/es/es2018/types/src/generated/artifacts/sfdc.d.ts +4 -1
- package/dist/es/es2018/types/src/generated/resources/getCommerceExtensionProvidersByProviderId.d.ts +16 -0
- package/dist/es/es2018/types/src/generated/resources/postCommerceExtensionMappings.d.ts +1 -1
- package/dist/es/es2018/types/src/generated/resources/putCommerceExtensionMappingsByMappingId.d.ts +1 -1
- package/dist/es/es2018/types/src/generated/types/MappingInputRepresentation.d.ts +3 -3
- package/dist/es/es2018/types/src/generated/types/ProviderOutputRepresentation.d.ts +19 -4
- package/package.json +1 -1
- package/sfdc/index.js +511 -230
- package/src/raml/api.raml +31 -2
- package/src/raml/luvio.raml +7 -1
package/sfdc/index.js
CHANGED
|
@@ -118,19 +118,19 @@ function validate$7(obj, path = 'ExtensionOutputRepresentation') {
|
|
|
118
118
|
return v_error === undefined ? null : v_error;
|
|
119
119
|
}
|
|
120
120
|
const RepresentationType$5 = 'ExtensionOutputRepresentation';
|
|
121
|
-
function keyBuilder$
|
|
121
|
+
function keyBuilder$d(luvio, config) {
|
|
122
122
|
return keyPrefix + '::' + RepresentationType$5 + ':' + config.epn;
|
|
123
123
|
}
|
|
124
124
|
function keyBuilderFromType$2(luvio, object) {
|
|
125
125
|
const keyParams = {
|
|
126
126
|
epn: object.epn
|
|
127
127
|
};
|
|
128
|
-
return keyBuilder$
|
|
128
|
+
return keyBuilder$d(luvio, keyParams);
|
|
129
129
|
}
|
|
130
130
|
function normalize$5(input, existing, path, luvio, store, timestamp) {
|
|
131
131
|
return input;
|
|
132
132
|
}
|
|
133
|
-
const select$
|
|
133
|
+
const select$e = function ExtensionOutputRepresentationSelect() {
|
|
134
134
|
return {
|
|
135
135
|
kind: 'Fragment',
|
|
136
136
|
version: VERSION$7,
|
|
@@ -274,7 +274,7 @@ function normalize$4(input, existing, path, luvio, store, timestamp) {
|
|
|
274
274
|
}
|
|
275
275
|
return input;
|
|
276
276
|
}
|
|
277
|
-
const select$
|
|
277
|
+
const select$d = function ExtensionOutputCollectionRepresentationSelect() {
|
|
278
278
|
return {
|
|
279
279
|
kind: 'Fragment',
|
|
280
280
|
version: VERSION$6,
|
|
@@ -288,7 +288,7 @@ const select$c = function ExtensionOutputCollectionRepresentationSelect() {
|
|
|
288
288
|
name: 'items',
|
|
289
289
|
kind: 'Link',
|
|
290
290
|
plural: true,
|
|
291
|
-
fragment: select$
|
|
291
|
+
fragment: select$e()
|
|
292
292
|
}
|
|
293
293
|
]
|
|
294
294
|
};
|
|
@@ -355,22 +355,22 @@ function getTypeCacheKeys$4(rootKeySet, luvio, input, fullPathFactory) {
|
|
|
355
355
|
}
|
|
356
356
|
}
|
|
357
357
|
|
|
358
|
-
function select$
|
|
359
|
-
return select$
|
|
358
|
+
function select$c(luvio, params) {
|
|
359
|
+
return select$d();
|
|
360
360
|
}
|
|
361
|
-
function keyBuilder$
|
|
361
|
+
function keyBuilder$c(luvio, params) {
|
|
362
362
|
return keyPrefix + '::ExtensionOutputCollectionRepresentation:(' + ')';
|
|
363
363
|
}
|
|
364
|
-
function getResponseCacheKeys$
|
|
365
|
-
getTypeCacheKeys$4(storeKeyMap, luvio, response, () => keyBuilder$
|
|
364
|
+
function getResponseCacheKeys$7(storeKeyMap, luvio, resourceParams, response) {
|
|
365
|
+
getTypeCacheKeys$4(storeKeyMap, luvio, response, () => keyBuilder$c());
|
|
366
366
|
}
|
|
367
|
-
function ingestSuccess$
|
|
367
|
+
function ingestSuccess$6(luvio, resourceParams, response, snapshotRefresh) {
|
|
368
368
|
const { body } = response;
|
|
369
|
-
const key = keyBuilder$
|
|
369
|
+
const key = keyBuilder$c();
|
|
370
370
|
luvio.storeIngest(key, ingest$4, body);
|
|
371
371
|
const snapshot = luvio.storeLookup({
|
|
372
372
|
recordId: key,
|
|
373
|
-
node: select$
|
|
373
|
+
node: select$c(),
|
|
374
374
|
variables: {},
|
|
375
375
|
}, snapshotRefresh);
|
|
376
376
|
if (process.env.NODE_ENV !== 'production') {
|
|
@@ -381,8 +381,8 @@ function ingestSuccess$5(luvio, resourceParams, response, snapshotRefresh) {
|
|
|
381
381
|
deepFreeze(snapshot.data);
|
|
382
382
|
return snapshot;
|
|
383
383
|
}
|
|
384
|
-
function ingestError$
|
|
385
|
-
const key = keyBuilder$
|
|
384
|
+
function ingestError$4(luvio, params, error, snapshotRefresh) {
|
|
385
|
+
const key = keyBuilder$c();
|
|
386
386
|
const errorSnapshot = luvio.errorSnapshot(error, snapshotRefresh);
|
|
387
387
|
const storeMetadataParams = {
|
|
388
388
|
ttl: TTL$4,
|
|
@@ -393,7 +393,7 @@ function ingestError$3(luvio, params, error, snapshotRefresh) {
|
|
|
393
393
|
luvio.storeIngestError(key, errorSnapshot, storeMetadataParams);
|
|
394
394
|
return errorSnapshot;
|
|
395
395
|
}
|
|
396
|
-
function createResourceRequest$
|
|
396
|
+
function createResourceRequest$7(config) {
|
|
397
397
|
const headers = {};
|
|
398
398
|
return {
|
|
399
399
|
baseUri: '/services/data/v59.0',
|
|
@@ -414,62 +414,62 @@ const getExtensions_ConfigPropertyNames = {
|
|
|
414
414
|
optional: []
|
|
415
415
|
}
|
|
416
416
|
};
|
|
417
|
-
function createResourceParams$
|
|
417
|
+
function createResourceParams$7(config) {
|
|
418
418
|
const resourceParams = {};
|
|
419
419
|
return resourceParams;
|
|
420
420
|
}
|
|
421
|
-
function keyBuilder$
|
|
422
|
-
return keyBuilder$
|
|
421
|
+
function keyBuilder$b(luvio, config) {
|
|
422
|
+
return keyBuilder$c();
|
|
423
423
|
}
|
|
424
|
-
function typeCheckConfig$
|
|
424
|
+
function typeCheckConfig$7(untrustedConfig) {
|
|
425
425
|
const config = {};
|
|
426
426
|
return config;
|
|
427
427
|
}
|
|
428
|
-
function validateAdapterConfig$
|
|
428
|
+
function validateAdapterConfig$7(untrustedConfig, configPropertyNames) {
|
|
429
429
|
if (!untrustedIsObject(untrustedConfig)) {
|
|
430
430
|
return null;
|
|
431
431
|
}
|
|
432
432
|
if (process.env.NODE_ENV !== 'production') {
|
|
433
433
|
validateConfig(untrustedConfig, configPropertyNames);
|
|
434
434
|
}
|
|
435
|
-
const config = typeCheckConfig$
|
|
435
|
+
const config = typeCheckConfig$7();
|
|
436
436
|
if (!areRequiredParametersPresent(config, configPropertyNames)) {
|
|
437
437
|
return null;
|
|
438
438
|
}
|
|
439
439
|
return config;
|
|
440
440
|
}
|
|
441
|
-
function adapterFragment$
|
|
442
|
-
return select$
|
|
441
|
+
function adapterFragment$4(luvio, config) {
|
|
442
|
+
return select$c();
|
|
443
443
|
}
|
|
444
|
-
function onFetchResponseSuccess$
|
|
445
|
-
const snapshot = ingestSuccess$
|
|
444
|
+
function onFetchResponseSuccess$4(luvio, config, resourceParams, response) {
|
|
445
|
+
const snapshot = ingestSuccess$6(luvio, resourceParams, response, {
|
|
446
446
|
config,
|
|
447
|
-
resolve: () => buildNetworkSnapshot$
|
|
447
|
+
resolve: () => buildNetworkSnapshot$7(luvio, config, snapshotRefreshOptions)
|
|
448
448
|
});
|
|
449
449
|
return luvio.storeBroadcast().then(() => snapshot);
|
|
450
450
|
}
|
|
451
|
-
function onFetchResponseError$
|
|
452
|
-
const snapshot = ingestError$
|
|
451
|
+
function onFetchResponseError$4(luvio, config, resourceParams, response) {
|
|
452
|
+
const snapshot = ingestError$4(luvio, resourceParams, response, {
|
|
453
453
|
config,
|
|
454
|
-
resolve: () => buildNetworkSnapshot$
|
|
454
|
+
resolve: () => buildNetworkSnapshot$7(luvio, config, snapshotRefreshOptions)
|
|
455
455
|
});
|
|
456
456
|
return luvio.storeBroadcast().then(() => snapshot);
|
|
457
457
|
}
|
|
458
|
-
function buildNetworkSnapshot$
|
|
459
|
-
const resourceParams = createResourceParams$
|
|
460
|
-
const request = createResourceRequest$
|
|
458
|
+
function buildNetworkSnapshot$7(luvio, config, options) {
|
|
459
|
+
const resourceParams = createResourceParams$7();
|
|
460
|
+
const request = createResourceRequest$7();
|
|
461
461
|
return luvio.dispatchResourceRequest(request, options)
|
|
462
462
|
.then((response) => {
|
|
463
|
-
return luvio.handleSuccessResponse(() => onFetchResponseSuccess$
|
|
463
|
+
return luvio.handleSuccessResponse(() => onFetchResponseSuccess$4(luvio, config, resourceParams, response), () => {
|
|
464
464
|
const cache = new StoreKeyMap();
|
|
465
|
-
getResponseCacheKeys$
|
|
465
|
+
getResponseCacheKeys$7(cache, luvio, resourceParams, response.body);
|
|
466
466
|
return cache;
|
|
467
467
|
});
|
|
468
468
|
}, (response) => {
|
|
469
|
-
return luvio.handleErrorResponse(() => onFetchResponseError$
|
|
469
|
+
return luvio.handleErrorResponse(() => onFetchResponseError$4(luvio, config, resourceParams, response));
|
|
470
470
|
});
|
|
471
471
|
}
|
|
472
|
-
function buildNetworkSnapshotCachePolicy$
|
|
472
|
+
function buildNetworkSnapshotCachePolicy$4(context, coercedAdapterRequestContext) {
|
|
473
473
|
const { luvio, config } = context;
|
|
474
474
|
const { networkPriority, requestCorrelator, eventObservers } = coercedAdapterRequestContext;
|
|
475
475
|
const dispatchOptions = {
|
|
@@ -484,29 +484,29 @@ function buildNetworkSnapshotCachePolicy$3(context, coercedAdapterRequestContext
|
|
|
484
484
|
priority: networkPriority
|
|
485
485
|
};
|
|
486
486
|
}
|
|
487
|
-
return buildNetworkSnapshot$
|
|
487
|
+
return buildNetworkSnapshot$7(luvio, config, dispatchOptions);
|
|
488
488
|
}
|
|
489
|
-
function buildCachedSnapshotCachePolicy$
|
|
489
|
+
function buildCachedSnapshotCachePolicy$4(context, storeLookup) {
|
|
490
490
|
const { luvio, config } = context;
|
|
491
491
|
const selector = {
|
|
492
|
-
recordId: keyBuilder$
|
|
493
|
-
node: adapterFragment$
|
|
492
|
+
recordId: keyBuilder$b(),
|
|
493
|
+
node: adapterFragment$4(),
|
|
494
494
|
variables: {},
|
|
495
495
|
};
|
|
496
496
|
const cacheSnapshot = storeLookup(selector, {
|
|
497
497
|
config,
|
|
498
|
-
resolve: () => buildNetworkSnapshot$
|
|
498
|
+
resolve: () => buildNetworkSnapshot$7(luvio, config, snapshotRefreshOptions)
|
|
499
499
|
});
|
|
500
500
|
return cacheSnapshot;
|
|
501
501
|
}
|
|
502
502
|
const getExtensionsAdapterFactory = (luvio) => function extensions__getExtensions(untrustedConfig, requestContext) {
|
|
503
|
-
const config = validateAdapterConfig$
|
|
503
|
+
const config = validateAdapterConfig$7(untrustedConfig, getExtensions_ConfigPropertyNames);
|
|
504
504
|
// Invalid or incomplete config
|
|
505
505
|
if (config === null) {
|
|
506
506
|
return null;
|
|
507
507
|
}
|
|
508
508
|
return luvio.applyCachePolicy((requestContext || {}), { config, luvio }, // BuildSnapshotContext
|
|
509
|
-
buildCachedSnapshotCachePolicy$
|
|
509
|
+
buildCachedSnapshotCachePolicy$4, buildNetworkSnapshotCachePolicy$4);
|
|
510
510
|
};
|
|
511
511
|
|
|
512
512
|
const TTL$3 = 60000;
|
|
@@ -540,19 +540,19 @@ function validate$5(obj, path = 'MappingOutputRepresentation') {
|
|
|
540
540
|
return v_error === undefined ? null : v_error;
|
|
541
541
|
}
|
|
542
542
|
const RepresentationType$3 = 'MappingOutputRepresentation';
|
|
543
|
-
function keyBuilder$
|
|
543
|
+
function keyBuilder$a(luvio, config) {
|
|
544
544
|
return keyPrefix + '::' + RepresentationType$3 + ':' + config.id;
|
|
545
545
|
}
|
|
546
546
|
function keyBuilderFromType$1(luvio, object) {
|
|
547
547
|
const keyParams = {
|
|
548
548
|
id: object.id
|
|
549
549
|
};
|
|
550
|
-
return keyBuilder$
|
|
550
|
+
return keyBuilder$a(luvio, keyParams);
|
|
551
551
|
}
|
|
552
552
|
function normalize$3(input, existing, path, luvio, store, timestamp) {
|
|
553
553
|
return input;
|
|
554
554
|
}
|
|
555
|
-
const select$
|
|
555
|
+
const select$b = function MappingOutputRepresentationSelect() {
|
|
556
556
|
return {
|
|
557
557
|
kind: 'Fragment',
|
|
558
558
|
version: VERSION$5,
|
|
@@ -649,7 +649,7 @@ const notifyUpdateAvailableFactory = (luvio) => {
|
|
|
649
649
|
}
|
|
650
650
|
});
|
|
651
651
|
}
|
|
652
|
-
const keys = configs.map(c => keyBuilder$
|
|
652
|
+
const keys = configs.map(c => keyBuilder$a(luvio, c));
|
|
653
653
|
return luvio.notifyStoreUpdateAvailable(keys);
|
|
654
654
|
};
|
|
655
655
|
};
|
|
@@ -701,7 +701,7 @@ function normalize$2(input, existing, path, luvio, store, timestamp) {
|
|
|
701
701
|
}
|
|
702
702
|
return input;
|
|
703
703
|
}
|
|
704
|
-
const select$
|
|
704
|
+
const select$a = function MappingOutputCollectionRepresentationSelect() {
|
|
705
705
|
return {
|
|
706
706
|
kind: 'Fragment',
|
|
707
707
|
version: VERSION$4,
|
|
@@ -715,7 +715,7 @@ const select$9 = function MappingOutputCollectionRepresentationSelect() {
|
|
|
715
715
|
name: 'items',
|
|
716
716
|
kind: 'Link',
|
|
717
717
|
plural: true,
|
|
718
|
-
fragment: select$
|
|
718
|
+
fragment: select$b()
|
|
719
719
|
}
|
|
720
720
|
]
|
|
721
721
|
};
|
|
@@ -782,22 +782,22 @@ function getTypeCacheKeys$2(rootKeySet, luvio, input, fullPathFactory) {
|
|
|
782
782
|
}
|
|
783
783
|
}
|
|
784
784
|
|
|
785
|
-
function select$
|
|
786
|
-
return select$
|
|
785
|
+
function select$9(luvio, params) {
|
|
786
|
+
return select$a();
|
|
787
787
|
}
|
|
788
|
-
function keyBuilder$
|
|
788
|
+
function keyBuilder$9(luvio, params) {
|
|
789
789
|
return keyPrefix + '::MappingOutputCollectionRepresentation:(' + 'epn:' + params.queryParams.epn + ',' + 'webstoreId:' + params.queryParams.webstoreId + ')';
|
|
790
790
|
}
|
|
791
|
-
function getResponseCacheKeys$
|
|
792
|
-
getTypeCacheKeys$2(storeKeyMap, luvio, response, () => keyBuilder$
|
|
791
|
+
function getResponseCacheKeys$6(storeKeyMap, luvio, resourceParams, response) {
|
|
792
|
+
getTypeCacheKeys$2(storeKeyMap, luvio, response, () => keyBuilder$9(luvio, resourceParams));
|
|
793
793
|
}
|
|
794
|
-
function ingestSuccess$
|
|
794
|
+
function ingestSuccess$5(luvio, resourceParams, response, snapshotRefresh) {
|
|
795
795
|
const { body } = response;
|
|
796
|
-
const key = keyBuilder$
|
|
796
|
+
const key = keyBuilder$9(luvio, resourceParams);
|
|
797
797
|
luvio.storeIngest(key, ingest$2, body);
|
|
798
798
|
const snapshot = luvio.storeLookup({
|
|
799
799
|
recordId: key,
|
|
800
|
-
node: select$
|
|
800
|
+
node: select$9(),
|
|
801
801
|
variables: {},
|
|
802
802
|
}, snapshotRefresh);
|
|
803
803
|
if (process.env.NODE_ENV !== 'production') {
|
|
@@ -808,8 +808,8 @@ function ingestSuccess$4(luvio, resourceParams, response, snapshotRefresh) {
|
|
|
808
808
|
deepFreeze(snapshot.data);
|
|
809
809
|
return snapshot;
|
|
810
810
|
}
|
|
811
|
-
function ingestError$
|
|
812
|
-
const key = keyBuilder$
|
|
811
|
+
function ingestError$3(luvio, params, error, snapshotRefresh) {
|
|
812
|
+
const key = keyBuilder$9(luvio, params);
|
|
813
813
|
const errorSnapshot = luvio.errorSnapshot(error, snapshotRefresh);
|
|
814
814
|
const storeMetadataParams = {
|
|
815
815
|
ttl: TTL$2,
|
|
@@ -820,7 +820,7 @@ function ingestError$2(luvio, params, error, snapshotRefresh) {
|
|
|
820
820
|
luvio.storeIngestError(key, errorSnapshot, storeMetadataParams);
|
|
821
821
|
return errorSnapshot;
|
|
822
822
|
}
|
|
823
|
-
function createResourceRequest$
|
|
823
|
+
function createResourceRequest$6(config) {
|
|
824
824
|
const headers = {};
|
|
825
825
|
return {
|
|
826
826
|
baseUri: '/services/data/v59.0',
|
|
@@ -841,7 +841,7 @@ const getMappings_ConfigPropertyNames = {
|
|
|
841
841
|
optional: ['epn', 'webstoreId']
|
|
842
842
|
}
|
|
843
843
|
};
|
|
844
|
-
function createResourceParams$
|
|
844
|
+
function createResourceParams$6(config) {
|
|
845
845
|
const resourceParams = {
|
|
846
846
|
queryParams: {
|
|
847
847
|
epn: config.epn, webstoreId: config.webstoreId
|
|
@@ -849,11 +849,11 @@ function createResourceParams$5(config) {
|
|
|
849
849
|
};
|
|
850
850
|
return resourceParams;
|
|
851
851
|
}
|
|
852
|
-
function keyBuilder$
|
|
853
|
-
const resourceParams = createResourceParams$
|
|
854
|
-
return keyBuilder$
|
|
852
|
+
function keyBuilder$8(luvio, config) {
|
|
853
|
+
const resourceParams = createResourceParams$6(config);
|
|
854
|
+
return keyBuilder$9(luvio, resourceParams);
|
|
855
855
|
}
|
|
856
|
-
function typeCheckConfig$
|
|
856
|
+
function typeCheckConfig$6(untrustedConfig) {
|
|
857
857
|
const config = {};
|
|
858
858
|
typeCheckScalars(untrustedConfig, config, {
|
|
859
859
|
epn: 0 /* String */,
|
|
@@ -861,52 +861,52 @@ function typeCheckConfig$5(untrustedConfig) {
|
|
|
861
861
|
});
|
|
862
862
|
return config;
|
|
863
863
|
}
|
|
864
|
-
function validateAdapterConfig$
|
|
864
|
+
function validateAdapterConfig$6(untrustedConfig, configPropertyNames) {
|
|
865
865
|
if (!untrustedIsObject(untrustedConfig)) {
|
|
866
866
|
return null;
|
|
867
867
|
}
|
|
868
868
|
if (process.env.NODE_ENV !== 'production') {
|
|
869
869
|
validateConfig(untrustedConfig, configPropertyNames);
|
|
870
870
|
}
|
|
871
|
-
const config = typeCheckConfig$
|
|
871
|
+
const config = typeCheckConfig$6(untrustedConfig);
|
|
872
872
|
if (!areRequiredParametersPresent(config, configPropertyNames)) {
|
|
873
873
|
return null;
|
|
874
874
|
}
|
|
875
875
|
return config;
|
|
876
876
|
}
|
|
877
|
-
function adapterFragment$
|
|
878
|
-
createResourceParams$
|
|
879
|
-
return select$
|
|
877
|
+
function adapterFragment$3(luvio, config) {
|
|
878
|
+
createResourceParams$6(config);
|
|
879
|
+
return select$9();
|
|
880
880
|
}
|
|
881
|
-
function onFetchResponseSuccess$
|
|
882
|
-
const snapshot = ingestSuccess$
|
|
881
|
+
function onFetchResponseSuccess$3(luvio, config, resourceParams, response) {
|
|
882
|
+
const snapshot = ingestSuccess$5(luvio, resourceParams, response, {
|
|
883
883
|
config,
|
|
884
|
-
resolve: () => buildNetworkSnapshot$
|
|
884
|
+
resolve: () => buildNetworkSnapshot$6(luvio, config, snapshotRefreshOptions)
|
|
885
885
|
});
|
|
886
886
|
return luvio.storeBroadcast().then(() => snapshot);
|
|
887
887
|
}
|
|
888
|
-
function onFetchResponseError$
|
|
889
|
-
const snapshot = ingestError$
|
|
888
|
+
function onFetchResponseError$3(luvio, config, resourceParams, response) {
|
|
889
|
+
const snapshot = ingestError$3(luvio, resourceParams, response, {
|
|
890
890
|
config,
|
|
891
|
-
resolve: () => buildNetworkSnapshot$
|
|
891
|
+
resolve: () => buildNetworkSnapshot$6(luvio, config, snapshotRefreshOptions)
|
|
892
892
|
});
|
|
893
893
|
return luvio.storeBroadcast().then(() => snapshot);
|
|
894
894
|
}
|
|
895
|
-
function buildNetworkSnapshot$
|
|
896
|
-
const resourceParams = createResourceParams$
|
|
897
|
-
const request = createResourceRequest$
|
|
895
|
+
function buildNetworkSnapshot$6(luvio, config, options) {
|
|
896
|
+
const resourceParams = createResourceParams$6(config);
|
|
897
|
+
const request = createResourceRequest$6(resourceParams);
|
|
898
898
|
return luvio.dispatchResourceRequest(request, options)
|
|
899
899
|
.then((response) => {
|
|
900
|
-
return luvio.handleSuccessResponse(() => onFetchResponseSuccess$
|
|
900
|
+
return luvio.handleSuccessResponse(() => onFetchResponseSuccess$3(luvio, config, resourceParams, response), () => {
|
|
901
901
|
const cache = new StoreKeyMap();
|
|
902
|
-
getResponseCacheKeys$
|
|
902
|
+
getResponseCacheKeys$6(cache, luvio, resourceParams, response.body);
|
|
903
903
|
return cache;
|
|
904
904
|
});
|
|
905
905
|
}, (response) => {
|
|
906
|
-
return luvio.handleErrorResponse(() => onFetchResponseError$
|
|
906
|
+
return luvio.handleErrorResponse(() => onFetchResponseError$3(luvio, config, resourceParams, response));
|
|
907
907
|
});
|
|
908
908
|
}
|
|
909
|
-
function buildNetworkSnapshotCachePolicy$
|
|
909
|
+
function buildNetworkSnapshotCachePolicy$3(context, coercedAdapterRequestContext) {
|
|
910
910
|
const { luvio, config } = context;
|
|
911
911
|
const { networkPriority, requestCorrelator, eventObservers } = coercedAdapterRequestContext;
|
|
912
912
|
const dispatchOptions = {
|
|
@@ -921,44 +921,44 @@ function buildNetworkSnapshotCachePolicy$2(context, coercedAdapterRequestContext
|
|
|
921
921
|
priority: networkPriority
|
|
922
922
|
};
|
|
923
923
|
}
|
|
924
|
-
return buildNetworkSnapshot$
|
|
924
|
+
return buildNetworkSnapshot$6(luvio, config, dispatchOptions);
|
|
925
925
|
}
|
|
926
|
-
function buildCachedSnapshotCachePolicy$
|
|
926
|
+
function buildCachedSnapshotCachePolicy$3(context, storeLookup) {
|
|
927
927
|
const { luvio, config } = context;
|
|
928
928
|
const selector = {
|
|
929
|
-
recordId: keyBuilder$
|
|
930
|
-
node: adapterFragment$
|
|
929
|
+
recordId: keyBuilder$8(luvio, config),
|
|
930
|
+
node: adapterFragment$3(luvio, config),
|
|
931
931
|
variables: {},
|
|
932
932
|
};
|
|
933
933
|
const cacheSnapshot = storeLookup(selector, {
|
|
934
934
|
config,
|
|
935
|
-
resolve: () => buildNetworkSnapshot$
|
|
935
|
+
resolve: () => buildNetworkSnapshot$6(luvio, config, snapshotRefreshOptions)
|
|
936
936
|
});
|
|
937
937
|
return cacheSnapshot;
|
|
938
938
|
}
|
|
939
939
|
const getMappingsAdapterFactory = (luvio) => function extensions__getMappings(untrustedConfig, requestContext) {
|
|
940
|
-
const config = validateAdapterConfig$
|
|
940
|
+
const config = validateAdapterConfig$6(untrustedConfig, getMappings_ConfigPropertyNames);
|
|
941
941
|
// Invalid or incomplete config
|
|
942
942
|
if (config === null) {
|
|
943
943
|
return null;
|
|
944
944
|
}
|
|
945
945
|
return luvio.applyCachePolicy((requestContext || {}), { config, luvio }, // BuildSnapshotContext
|
|
946
|
-
buildCachedSnapshotCachePolicy$
|
|
946
|
+
buildCachedSnapshotCachePolicy$3, buildNetworkSnapshotCachePolicy$3);
|
|
947
947
|
};
|
|
948
948
|
|
|
949
|
-
function select$
|
|
950
|
-
return select$
|
|
949
|
+
function select$8(luvio, params) {
|
|
950
|
+
return select$b();
|
|
951
951
|
}
|
|
952
|
-
function getResponseCacheKeys$
|
|
952
|
+
function getResponseCacheKeys$5(storeKeyMap, luvio, resourceParams, response) {
|
|
953
953
|
getTypeCacheKeys$3(storeKeyMap, luvio, response);
|
|
954
954
|
}
|
|
955
|
-
function ingestSuccess$
|
|
955
|
+
function ingestSuccess$4(luvio, resourceParams, response) {
|
|
956
956
|
const { body } = response;
|
|
957
957
|
const key = keyBuilderFromType$1(luvio, body);
|
|
958
958
|
luvio.storeIngest(key, ingest$3, body);
|
|
959
959
|
const snapshot = luvio.storeLookup({
|
|
960
960
|
recordId: key,
|
|
961
|
-
node: select$
|
|
961
|
+
node: select$8(),
|
|
962
962
|
variables: {},
|
|
963
963
|
});
|
|
964
964
|
if (process.env.NODE_ENV !== 'production') {
|
|
@@ -969,7 +969,7 @@ function ingestSuccess$3(luvio, resourceParams, response) {
|
|
|
969
969
|
deepFreeze(snapshot.data);
|
|
970
970
|
return snapshot;
|
|
971
971
|
}
|
|
972
|
-
function createResourceRequest$
|
|
972
|
+
function createResourceRequest$5(config) {
|
|
973
973
|
const headers = {};
|
|
974
974
|
return {
|
|
975
975
|
baseUri: '/services/data/v59.0',
|
|
@@ -986,22 +986,19 @@ function createResourceRequest$4(config) {
|
|
|
986
986
|
const createMapping_ConfigPropertyNames = {
|
|
987
987
|
displayName: 'createMapping',
|
|
988
988
|
parameters: {
|
|
989
|
-
required: ['epn', 'providerName', 'webstoreId'],
|
|
990
|
-
optional: [
|
|
989
|
+
required: ['epn', 'id', 'providerName', 'webstoreId'],
|
|
990
|
+
optional: []
|
|
991
991
|
}
|
|
992
992
|
};
|
|
993
|
-
function createResourceParams$
|
|
993
|
+
function createResourceParams$5(config) {
|
|
994
994
|
const resourceParams = {
|
|
995
995
|
body: {
|
|
996
|
-
epn: config.epn, providerName: config.providerName, webstoreId: config.webstoreId
|
|
996
|
+
epn: config.epn, id: config.id, providerName: config.providerName, webstoreId: config.webstoreId
|
|
997
997
|
}
|
|
998
998
|
};
|
|
999
|
-
if (config['id'] !== undefined) {
|
|
1000
|
-
resourceParams.body['id'] = config['id'];
|
|
1001
|
-
}
|
|
1002
999
|
return resourceParams;
|
|
1003
1000
|
}
|
|
1004
|
-
function typeCheckConfig$
|
|
1001
|
+
function typeCheckConfig$5(untrustedConfig) {
|
|
1005
1002
|
const config = {};
|
|
1006
1003
|
typeCheckScalars(untrustedConfig, config, {
|
|
1007
1004
|
epn: 0 /* String */,
|
|
@@ -1011,30 +1008,30 @@ function typeCheckConfig$4(untrustedConfig) {
|
|
|
1011
1008
|
});
|
|
1012
1009
|
return config;
|
|
1013
1010
|
}
|
|
1014
|
-
function validateAdapterConfig$
|
|
1011
|
+
function validateAdapterConfig$5(untrustedConfig, configPropertyNames) {
|
|
1015
1012
|
if (!untrustedIsObject(untrustedConfig)) {
|
|
1016
1013
|
return null;
|
|
1017
1014
|
}
|
|
1018
1015
|
if (process.env.NODE_ENV !== 'production') {
|
|
1019
1016
|
validateConfig(untrustedConfig, configPropertyNames);
|
|
1020
1017
|
}
|
|
1021
|
-
const config = typeCheckConfig$
|
|
1018
|
+
const config = typeCheckConfig$5(untrustedConfig);
|
|
1022
1019
|
if (!areRequiredParametersPresent(config, configPropertyNames)) {
|
|
1023
1020
|
return null;
|
|
1024
1021
|
}
|
|
1025
1022
|
return config;
|
|
1026
1023
|
}
|
|
1027
|
-
function buildNetworkSnapshot$
|
|
1028
|
-
const resourceParams = createResourceParams$
|
|
1029
|
-
const request = createResourceRequest$
|
|
1024
|
+
function buildNetworkSnapshot$5(luvio, config, options) {
|
|
1025
|
+
const resourceParams = createResourceParams$5(config);
|
|
1026
|
+
const request = createResourceRequest$5(resourceParams);
|
|
1030
1027
|
return luvio.dispatchResourceRequest(request, options)
|
|
1031
1028
|
.then((response) => {
|
|
1032
1029
|
return luvio.handleSuccessResponse(() => {
|
|
1033
|
-
const snapshot = ingestSuccess$
|
|
1030
|
+
const snapshot = ingestSuccess$4(luvio, resourceParams, response);
|
|
1034
1031
|
return luvio.storeBroadcast().then(() => snapshot);
|
|
1035
1032
|
}, () => {
|
|
1036
1033
|
const cache = new StoreKeyMap();
|
|
1037
|
-
getResponseCacheKeys$
|
|
1034
|
+
getResponseCacheKeys$5(cache, luvio, resourceParams, response.body);
|
|
1038
1035
|
return cache;
|
|
1039
1036
|
});
|
|
1040
1037
|
}, (response) => {
|
|
@@ -1044,22 +1041,22 @@ function buildNetworkSnapshot$4(luvio, config, options) {
|
|
|
1044
1041
|
}
|
|
1045
1042
|
const createMappingAdapterFactory = (luvio) => {
|
|
1046
1043
|
return function createMapping(untrustedConfig) {
|
|
1047
|
-
const config = validateAdapterConfig$
|
|
1044
|
+
const config = validateAdapterConfig$5(untrustedConfig, createMapping_ConfigPropertyNames);
|
|
1048
1045
|
// Invalid or incomplete config
|
|
1049
1046
|
if (config === null) {
|
|
1050
1047
|
throw new Error('Invalid config for "createMapping"');
|
|
1051
1048
|
}
|
|
1052
|
-
return buildNetworkSnapshot$
|
|
1049
|
+
return buildNetworkSnapshot$5(luvio, config);
|
|
1053
1050
|
};
|
|
1054
1051
|
};
|
|
1055
1052
|
|
|
1056
|
-
function keyBuilder$
|
|
1057
|
-
return keyBuilder$
|
|
1053
|
+
function keyBuilder$7(luvio, params) {
|
|
1054
|
+
return keyBuilder$a(luvio, {
|
|
1058
1055
|
id: params.urlParams.mappingId
|
|
1059
1056
|
});
|
|
1060
1057
|
}
|
|
1061
|
-
function getResponseCacheKeys$
|
|
1062
|
-
const key = keyBuilder$
|
|
1058
|
+
function getResponseCacheKeys$4(cacheKeyMap, luvio, resourceParams) {
|
|
1059
|
+
const key = keyBuilder$7(luvio, resourceParams);
|
|
1063
1060
|
cacheKeyMap.set(key, {
|
|
1064
1061
|
namespace: keyPrefix,
|
|
1065
1062
|
representationName: RepresentationType$3,
|
|
@@ -1067,10 +1064,10 @@ function getResponseCacheKeys$3(cacheKeyMap, luvio, resourceParams) {
|
|
|
1067
1064
|
});
|
|
1068
1065
|
}
|
|
1069
1066
|
function evictSuccess(luvio, resourceParams) {
|
|
1070
|
-
const key = keyBuilder$
|
|
1067
|
+
const key = keyBuilder$7(luvio, resourceParams);
|
|
1071
1068
|
luvio.storeEvict(key);
|
|
1072
1069
|
}
|
|
1073
|
-
function createResourceRequest$
|
|
1070
|
+
function createResourceRequest$4(config) {
|
|
1074
1071
|
const headers = {};
|
|
1075
1072
|
return {
|
|
1076
1073
|
baseUri: '/services/data/v59.0',
|
|
@@ -1092,7 +1089,7 @@ const deleteMapping_ConfigPropertyNames = {
|
|
|
1092
1089
|
optional: []
|
|
1093
1090
|
}
|
|
1094
1091
|
};
|
|
1095
|
-
function createResourceParams$
|
|
1092
|
+
function createResourceParams$4(config) {
|
|
1096
1093
|
const resourceParams = {
|
|
1097
1094
|
urlParams: {
|
|
1098
1095
|
mappingId: config.mappingId
|
|
@@ -1100,29 +1097,29 @@ function createResourceParams$3(config) {
|
|
|
1100
1097
|
};
|
|
1101
1098
|
return resourceParams;
|
|
1102
1099
|
}
|
|
1103
|
-
function typeCheckConfig$
|
|
1100
|
+
function typeCheckConfig$4(untrustedConfig) {
|
|
1104
1101
|
const config = {};
|
|
1105
1102
|
typeCheckScalars(untrustedConfig, config, {
|
|
1106
1103
|
mappingId: 0 /* String */,
|
|
1107
1104
|
});
|
|
1108
1105
|
return config;
|
|
1109
1106
|
}
|
|
1110
|
-
function validateAdapterConfig$
|
|
1107
|
+
function validateAdapterConfig$4(untrustedConfig, configPropertyNames) {
|
|
1111
1108
|
if (!untrustedIsObject(untrustedConfig)) {
|
|
1112
1109
|
return null;
|
|
1113
1110
|
}
|
|
1114
1111
|
if (process.env.NODE_ENV !== 'production') {
|
|
1115
1112
|
validateConfig(untrustedConfig, configPropertyNames);
|
|
1116
1113
|
}
|
|
1117
|
-
const config = typeCheckConfig$
|
|
1114
|
+
const config = typeCheckConfig$4(untrustedConfig);
|
|
1118
1115
|
if (!areRequiredParametersPresent(config, configPropertyNames)) {
|
|
1119
1116
|
return null;
|
|
1120
1117
|
}
|
|
1121
1118
|
return config;
|
|
1122
1119
|
}
|
|
1123
|
-
function buildNetworkSnapshot$
|
|
1124
|
-
const resourceParams = createResourceParams$
|
|
1125
|
-
const request = createResourceRequest$
|
|
1120
|
+
function buildNetworkSnapshot$4(luvio, config, options) {
|
|
1121
|
+
const resourceParams = createResourceParams$4(config);
|
|
1122
|
+
const request = createResourceRequest$4(resourceParams);
|
|
1126
1123
|
return luvio.dispatchResourceRequest(request, options)
|
|
1127
1124
|
.then(() => {
|
|
1128
1125
|
return luvio.handleSuccessResponse(() => {
|
|
@@ -1130,7 +1127,7 @@ function buildNetworkSnapshot$3(luvio, config, options) {
|
|
|
1130
1127
|
return luvio.storeBroadcast();
|
|
1131
1128
|
}, () => {
|
|
1132
1129
|
const cache = new StoreKeyMap();
|
|
1133
|
-
getResponseCacheKeys$
|
|
1130
|
+
getResponseCacheKeys$4(cache, luvio, resourceParams);
|
|
1134
1131
|
return cache;
|
|
1135
1132
|
});
|
|
1136
1133
|
}, (response) => {
|
|
@@ -1140,33 +1137,33 @@ function buildNetworkSnapshot$3(luvio, config, options) {
|
|
|
1140
1137
|
}
|
|
1141
1138
|
const deleteMappingAdapterFactory = (luvio) => {
|
|
1142
1139
|
return function extensionsdeleteMapping(untrustedConfig) {
|
|
1143
|
-
const config = validateAdapterConfig$
|
|
1140
|
+
const config = validateAdapterConfig$4(untrustedConfig, deleteMapping_ConfigPropertyNames);
|
|
1144
1141
|
// Invalid or incomplete config
|
|
1145
1142
|
if (config === null) {
|
|
1146
1143
|
throw new Error(`Invalid config for "${adapterName}"`);
|
|
1147
1144
|
}
|
|
1148
|
-
return buildNetworkSnapshot$
|
|
1145
|
+
return buildNetworkSnapshot$4(luvio, config);
|
|
1149
1146
|
};
|
|
1150
1147
|
};
|
|
1151
1148
|
|
|
1152
|
-
function select$
|
|
1153
|
-
return select$
|
|
1149
|
+
function select$7(luvio, params) {
|
|
1150
|
+
return select$b();
|
|
1154
1151
|
}
|
|
1155
|
-
function keyBuilder$
|
|
1156
|
-
return keyBuilder$
|
|
1152
|
+
function keyBuilder$6(luvio, params) {
|
|
1153
|
+
return keyBuilder$a(luvio, {
|
|
1157
1154
|
id: params.urlParams.mappingId
|
|
1158
1155
|
});
|
|
1159
1156
|
}
|
|
1160
|
-
function getResponseCacheKeys$
|
|
1157
|
+
function getResponseCacheKeys$3(storeKeyMap, luvio, resourceParams, response) {
|
|
1161
1158
|
getTypeCacheKeys$3(storeKeyMap, luvio, response);
|
|
1162
1159
|
}
|
|
1163
|
-
function ingestSuccess$
|
|
1160
|
+
function ingestSuccess$3(luvio, resourceParams, response, snapshotRefresh) {
|
|
1164
1161
|
const { body } = response;
|
|
1165
|
-
const key = keyBuilder$
|
|
1162
|
+
const key = keyBuilder$6(luvio, resourceParams);
|
|
1166
1163
|
luvio.storeIngest(key, ingest$3, body);
|
|
1167
1164
|
const snapshot = luvio.storeLookup({
|
|
1168
1165
|
recordId: key,
|
|
1169
|
-
node: select$
|
|
1166
|
+
node: select$7(),
|
|
1170
1167
|
variables: {},
|
|
1171
1168
|
}, snapshotRefresh);
|
|
1172
1169
|
if (process.env.NODE_ENV !== 'production') {
|
|
@@ -1177,8 +1174,8 @@ function ingestSuccess$2(luvio, resourceParams, response, snapshotRefresh) {
|
|
|
1177
1174
|
deepFreeze(snapshot.data);
|
|
1178
1175
|
return snapshot;
|
|
1179
1176
|
}
|
|
1180
|
-
function ingestError$
|
|
1181
|
-
const key = keyBuilder$
|
|
1177
|
+
function ingestError$2(luvio, params, error, snapshotRefresh) {
|
|
1178
|
+
const key = keyBuilder$6(luvio, params);
|
|
1182
1179
|
const errorSnapshot = luvio.errorSnapshot(error, snapshotRefresh);
|
|
1183
1180
|
const storeMetadataParams = {
|
|
1184
1181
|
ttl: TTL$3,
|
|
@@ -1189,7 +1186,7 @@ function ingestError$1(luvio, params, error, snapshotRefresh) {
|
|
|
1189
1186
|
luvio.storeIngestError(key, errorSnapshot, storeMetadataParams);
|
|
1190
1187
|
return errorSnapshot;
|
|
1191
1188
|
}
|
|
1192
|
-
function createResourceRequest$
|
|
1189
|
+
function createResourceRequest$3(config) {
|
|
1193
1190
|
const headers = {};
|
|
1194
1191
|
return {
|
|
1195
1192
|
baseUri: '/services/data/v59.0',
|
|
@@ -1202,12 +1199,12 @@ function createResourceRequest$2(config) {
|
|
|
1202
1199
|
priority: 'normal',
|
|
1203
1200
|
};
|
|
1204
1201
|
}
|
|
1205
|
-
function createResourceRequestFromRepresentation(representation) {
|
|
1202
|
+
function createResourceRequestFromRepresentation$1(representation) {
|
|
1206
1203
|
const config = {
|
|
1207
1204
|
urlParams: {},
|
|
1208
1205
|
};
|
|
1209
1206
|
config.urlParams.mappingId = representation.id;
|
|
1210
|
-
return createResourceRequest$
|
|
1207
|
+
return createResourceRequest$3(config);
|
|
1211
1208
|
}
|
|
1212
1209
|
|
|
1213
1210
|
const getMapping_ConfigPropertyNames = {
|
|
@@ -1217,7 +1214,7 @@ const getMapping_ConfigPropertyNames = {
|
|
|
1217
1214
|
optional: []
|
|
1218
1215
|
}
|
|
1219
1216
|
};
|
|
1220
|
-
function createResourceParams$
|
|
1217
|
+
function createResourceParams$3(config) {
|
|
1221
1218
|
const resourceParams = {
|
|
1222
1219
|
urlParams: {
|
|
1223
1220
|
mappingId: config.mappingId
|
|
@@ -1225,63 +1222,63 @@ function createResourceParams$2(config) {
|
|
|
1225
1222
|
};
|
|
1226
1223
|
return resourceParams;
|
|
1227
1224
|
}
|
|
1228
|
-
function keyBuilder$
|
|
1229
|
-
const resourceParams = createResourceParams$
|
|
1230
|
-
return keyBuilder$
|
|
1225
|
+
function keyBuilder$5(luvio, config) {
|
|
1226
|
+
const resourceParams = createResourceParams$3(config);
|
|
1227
|
+
return keyBuilder$6(luvio, resourceParams);
|
|
1231
1228
|
}
|
|
1232
|
-
function typeCheckConfig$
|
|
1229
|
+
function typeCheckConfig$3(untrustedConfig) {
|
|
1233
1230
|
const config = {};
|
|
1234
1231
|
typeCheckScalars(untrustedConfig, config, {
|
|
1235
1232
|
mappingId: 0 /* String */,
|
|
1236
1233
|
});
|
|
1237
1234
|
return config;
|
|
1238
1235
|
}
|
|
1239
|
-
function validateAdapterConfig$
|
|
1236
|
+
function validateAdapterConfig$3(untrustedConfig, configPropertyNames) {
|
|
1240
1237
|
if (!untrustedIsObject(untrustedConfig)) {
|
|
1241
1238
|
return null;
|
|
1242
1239
|
}
|
|
1243
1240
|
if (process.env.NODE_ENV !== 'production') {
|
|
1244
1241
|
validateConfig(untrustedConfig, configPropertyNames);
|
|
1245
1242
|
}
|
|
1246
|
-
const config = typeCheckConfig$
|
|
1243
|
+
const config = typeCheckConfig$3(untrustedConfig);
|
|
1247
1244
|
if (!areRequiredParametersPresent(config, configPropertyNames)) {
|
|
1248
1245
|
return null;
|
|
1249
1246
|
}
|
|
1250
1247
|
return config;
|
|
1251
1248
|
}
|
|
1252
|
-
function adapterFragment$
|
|
1253
|
-
createResourceParams$
|
|
1254
|
-
return select$
|
|
1249
|
+
function adapterFragment$2(luvio, config) {
|
|
1250
|
+
createResourceParams$3(config);
|
|
1251
|
+
return select$7();
|
|
1255
1252
|
}
|
|
1256
|
-
function onFetchResponseSuccess$
|
|
1257
|
-
const snapshot = ingestSuccess$
|
|
1253
|
+
function onFetchResponseSuccess$2(luvio, config, resourceParams, response) {
|
|
1254
|
+
const snapshot = ingestSuccess$3(luvio, resourceParams, response, {
|
|
1258
1255
|
config,
|
|
1259
|
-
resolve: () => buildNetworkSnapshot$
|
|
1256
|
+
resolve: () => buildNetworkSnapshot$3(luvio, config, snapshotRefreshOptions)
|
|
1260
1257
|
});
|
|
1261
1258
|
return luvio.storeBroadcast().then(() => snapshot);
|
|
1262
1259
|
}
|
|
1263
|
-
function onFetchResponseError$
|
|
1264
|
-
const snapshot = ingestError$
|
|
1260
|
+
function onFetchResponseError$2(luvio, config, resourceParams, response) {
|
|
1261
|
+
const snapshot = ingestError$2(luvio, resourceParams, response, {
|
|
1265
1262
|
config,
|
|
1266
|
-
resolve: () => buildNetworkSnapshot$
|
|
1263
|
+
resolve: () => buildNetworkSnapshot$3(luvio, config, snapshotRefreshOptions)
|
|
1267
1264
|
});
|
|
1268
1265
|
return luvio.storeBroadcast().then(() => snapshot);
|
|
1269
1266
|
}
|
|
1270
|
-
function buildNetworkSnapshot$
|
|
1271
|
-
const resourceParams = createResourceParams$
|
|
1272
|
-
const request = createResourceRequest$
|
|
1267
|
+
function buildNetworkSnapshot$3(luvio, config, options) {
|
|
1268
|
+
const resourceParams = createResourceParams$3(config);
|
|
1269
|
+
const request = createResourceRequest$3(resourceParams);
|
|
1273
1270
|
return luvio.dispatchResourceRequest(request, options)
|
|
1274
1271
|
.then((response) => {
|
|
1275
|
-
return luvio.handleSuccessResponse(() => onFetchResponseSuccess$
|
|
1272
|
+
return luvio.handleSuccessResponse(() => onFetchResponseSuccess$2(luvio, config, resourceParams, response), () => {
|
|
1276
1273
|
const cache = new StoreKeyMap();
|
|
1277
|
-
getResponseCacheKeys$
|
|
1274
|
+
getResponseCacheKeys$3(cache, luvio, resourceParams, response.body);
|
|
1278
1275
|
return cache;
|
|
1279
1276
|
});
|
|
1280
1277
|
}, (response) => {
|
|
1281
|
-
return luvio.handleErrorResponse(() => onFetchResponseError$
|
|
1278
|
+
return luvio.handleErrorResponse(() => onFetchResponseError$2(luvio, config, resourceParams, response));
|
|
1282
1279
|
});
|
|
1283
1280
|
}
|
|
1284
|
-
function buildNetworkSnapshotCachePolicy$
|
|
1281
|
+
function buildNetworkSnapshotCachePolicy$2(context, coercedAdapterRequestContext) {
|
|
1285
1282
|
const { luvio, config } = context;
|
|
1286
1283
|
const { networkPriority, requestCorrelator, eventObservers } = coercedAdapterRequestContext;
|
|
1287
1284
|
const dispatchOptions = {
|
|
@@ -1296,37 +1293,37 @@ function buildNetworkSnapshotCachePolicy$1(context, coercedAdapterRequestContext
|
|
|
1296
1293
|
priority: networkPriority
|
|
1297
1294
|
};
|
|
1298
1295
|
}
|
|
1299
|
-
return buildNetworkSnapshot$
|
|
1296
|
+
return buildNetworkSnapshot$3(luvio, config, dispatchOptions);
|
|
1300
1297
|
}
|
|
1301
|
-
function buildCachedSnapshotCachePolicy$
|
|
1298
|
+
function buildCachedSnapshotCachePolicy$2(context, storeLookup) {
|
|
1302
1299
|
const { luvio, config } = context;
|
|
1303
1300
|
const selector = {
|
|
1304
|
-
recordId: keyBuilder$
|
|
1305
|
-
node: adapterFragment$
|
|
1301
|
+
recordId: keyBuilder$5(luvio, config),
|
|
1302
|
+
node: adapterFragment$2(luvio, config),
|
|
1306
1303
|
variables: {},
|
|
1307
1304
|
};
|
|
1308
1305
|
const cacheSnapshot = storeLookup(selector, {
|
|
1309
1306
|
config,
|
|
1310
|
-
resolve: () => buildNetworkSnapshot$
|
|
1307
|
+
resolve: () => buildNetworkSnapshot$3(luvio, config, snapshotRefreshOptions)
|
|
1311
1308
|
});
|
|
1312
1309
|
return cacheSnapshot;
|
|
1313
1310
|
}
|
|
1314
1311
|
const getMappingAdapterFactory = (luvio) => function extensions__getMapping(untrustedConfig, requestContext) {
|
|
1315
|
-
const config = validateAdapterConfig$
|
|
1312
|
+
const config = validateAdapterConfig$3(untrustedConfig, getMapping_ConfigPropertyNames);
|
|
1316
1313
|
// Invalid or incomplete config
|
|
1317
1314
|
if (config === null) {
|
|
1318
1315
|
return null;
|
|
1319
1316
|
}
|
|
1320
1317
|
return luvio.applyCachePolicy((requestContext || {}), { config, luvio }, // BuildSnapshotContext
|
|
1321
|
-
buildCachedSnapshotCachePolicy$
|
|
1318
|
+
buildCachedSnapshotCachePolicy$2, buildNetworkSnapshotCachePolicy$2);
|
|
1322
1319
|
};
|
|
1323
|
-
const notifyChangeFactory = (luvio, options) => {
|
|
1320
|
+
const notifyChangeFactory$1 = (luvio, options) => {
|
|
1324
1321
|
return function getCommerceExtensionMappingsByMappingIdNotifyChange(configs) {
|
|
1325
|
-
const keys = configs.map(c => keyBuilder$
|
|
1322
|
+
const keys = configs.map(c => keyBuilder$a(luvio, c));
|
|
1326
1323
|
luvio.getNotifyChangeStoreEntries(keys).then(entries => {
|
|
1327
1324
|
for (let i = 0, len = entries.length; i < len; i++) {
|
|
1328
1325
|
const { key, record: val } = entries[i];
|
|
1329
|
-
const refreshRequest = createResourceRequestFromRepresentation(val);
|
|
1326
|
+
const refreshRequest = createResourceRequestFromRepresentation$1(val);
|
|
1330
1327
|
luvio.dispatchResourceRequest(refreshRequest, options)
|
|
1331
1328
|
.then((response) => {
|
|
1332
1329
|
return luvio.handleSuccessResponse(() => {
|
|
@@ -1355,19 +1352,19 @@ const notifyChangeFactory = (luvio, options) => {
|
|
|
1355
1352
|
};
|
|
1356
1353
|
};
|
|
1357
1354
|
|
|
1358
|
-
function select$
|
|
1359
|
-
return select$
|
|
1355
|
+
function select$6(luvio, params) {
|
|
1356
|
+
return select$b();
|
|
1360
1357
|
}
|
|
1361
|
-
function getResponseCacheKeys$
|
|
1358
|
+
function getResponseCacheKeys$2(storeKeyMap, luvio, resourceParams, response) {
|
|
1362
1359
|
getTypeCacheKeys$3(storeKeyMap, luvio, response);
|
|
1363
1360
|
}
|
|
1364
|
-
function ingestSuccess$
|
|
1361
|
+
function ingestSuccess$2(luvio, resourceParams, response) {
|
|
1365
1362
|
const { body } = response;
|
|
1366
1363
|
const key = keyBuilderFromType$1(luvio, body);
|
|
1367
1364
|
luvio.storeIngest(key, ingest$3, body);
|
|
1368
1365
|
const snapshot = luvio.storeLookup({
|
|
1369
1366
|
recordId: key,
|
|
1370
|
-
node: select$
|
|
1367
|
+
node: select$6(),
|
|
1371
1368
|
variables: {},
|
|
1372
1369
|
});
|
|
1373
1370
|
if (process.env.NODE_ENV !== 'production') {
|
|
@@ -1378,7 +1375,7 @@ function ingestSuccess$1(luvio, resourceParams, response) {
|
|
|
1378
1375
|
deepFreeze(snapshot.data);
|
|
1379
1376
|
return snapshot;
|
|
1380
1377
|
}
|
|
1381
|
-
function createResourceRequest$
|
|
1378
|
+
function createResourceRequest$2(config) {
|
|
1382
1379
|
const headers = {};
|
|
1383
1380
|
return {
|
|
1384
1381
|
baseUri: '/services/data/v59.0',
|
|
@@ -1395,25 +1392,22 @@ function createResourceRequest$1(config) {
|
|
|
1395
1392
|
const updateMapping_ConfigPropertyNames = {
|
|
1396
1393
|
displayName: 'updateMapping',
|
|
1397
1394
|
parameters: {
|
|
1398
|
-
required: ['mappingId', 'epn', 'providerName', 'webstoreId'],
|
|
1399
|
-
optional: [
|
|
1395
|
+
required: ['mappingId', 'epn', 'id', 'providerName', 'webstoreId'],
|
|
1396
|
+
optional: []
|
|
1400
1397
|
}
|
|
1401
1398
|
};
|
|
1402
|
-
function createResourceParams$
|
|
1399
|
+
function createResourceParams$2(config) {
|
|
1403
1400
|
const resourceParams = {
|
|
1404
1401
|
urlParams: {
|
|
1405
1402
|
mappingId: config.mappingId
|
|
1406
1403
|
},
|
|
1407
1404
|
body: {
|
|
1408
|
-
epn: config.epn, providerName: config.providerName, webstoreId: config.webstoreId
|
|
1405
|
+
epn: config.epn, id: config.id, providerName: config.providerName, webstoreId: config.webstoreId
|
|
1409
1406
|
}
|
|
1410
1407
|
};
|
|
1411
|
-
if (config['id'] !== undefined) {
|
|
1412
|
-
resourceParams.body['id'] = config['id'];
|
|
1413
|
-
}
|
|
1414
1408
|
return resourceParams;
|
|
1415
1409
|
}
|
|
1416
|
-
function typeCheckConfig$
|
|
1410
|
+
function typeCheckConfig$2(untrustedConfig) {
|
|
1417
1411
|
const config = {};
|
|
1418
1412
|
typeCheckScalars(untrustedConfig, config, {
|
|
1419
1413
|
mappingId: 0 /* String */,
|
|
@@ -1424,30 +1418,30 @@ function typeCheckConfig$1(untrustedConfig) {
|
|
|
1424
1418
|
});
|
|
1425
1419
|
return config;
|
|
1426
1420
|
}
|
|
1427
|
-
function validateAdapterConfig$
|
|
1421
|
+
function validateAdapterConfig$2(untrustedConfig, configPropertyNames) {
|
|
1428
1422
|
if (!untrustedIsObject(untrustedConfig)) {
|
|
1429
1423
|
return null;
|
|
1430
1424
|
}
|
|
1431
1425
|
if (process.env.NODE_ENV !== 'production') {
|
|
1432
1426
|
validateConfig(untrustedConfig, configPropertyNames);
|
|
1433
1427
|
}
|
|
1434
|
-
const config = typeCheckConfig$
|
|
1428
|
+
const config = typeCheckConfig$2(untrustedConfig);
|
|
1435
1429
|
if (!areRequiredParametersPresent(config, configPropertyNames)) {
|
|
1436
1430
|
return null;
|
|
1437
1431
|
}
|
|
1438
1432
|
return config;
|
|
1439
1433
|
}
|
|
1440
|
-
function buildNetworkSnapshot$
|
|
1441
|
-
const resourceParams = createResourceParams$
|
|
1442
|
-
const request = createResourceRequest$
|
|
1434
|
+
function buildNetworkSnapshot$2(luvio, config, options) {
|
|
1435
|
+
const resourceParams = createResourceParams$2(config);
|
|
1436
|
+
const request = createResourceRequest$2(resourceParams);
|
|
1443
1437
|
return luvio.dispatchResourceRequest(request, options)
|
|
1444
1438
|
.then((response) => {
|
|
1445
1439
|
return luvio.handleSuccessResponse(() => {
|
|
1446
|
-
const snapshot = ingestSuccess$
|
|
1440
|
+
const snapshot = ingestSuccess$2(luvio, resourceParams, response);
|
|
1447
1441
|
return luvio.storeBroadcast().then(() => snapshot);
|
|
1448
1442
|
}, () => {
|
|
1449
1443
|
const cache = new StoreKeyMap();
|
|
1450
|
-
getResponseCacheKeys$
|
|
1444
|
+
getResponseCacheKeys$2(cache, luvio, resourceParams, response.body);
|
|
1451
1445
|
return cache;
|
|
1452
1446
|
});
|
|
1453
1447
|
}, (response) => {
|
|
@@ -1457,12 +1451,12 @@ function buildNetworkSnapshot$1(luvio, config, options) {
|
|
|
1457
1451
|
}
|
|
1458
1452
|
const updateMappingAdapterFactory = (luvio) => {
|
|
1459
1453
|
return function updateMapping(untrustedConfig) {
|
|
1460
|
-
const config = validateAdapterConfig$
|
|
1454
|
+
const config = validateAdapterConfig$2(untrustedConfig, updateMapping_ConfigPropertyNames);
|
|
1461
1455
|
// Invalid or incomplete config
|
|
1462
1456
|
if (config === null) {
|
|
1463
1457
|
throw new Error('Invalid config for "updateMapping"');
|
|
1464
1458
|
}
|
|
1465
|
-
return buildNetworkSnapshot$
|
|
1459
|
+
return buildNetworkSnapshot$2(luvio, config);
|
|
1466
1460
|
};
|
|
1467
1461
|
};
|
|
1468
1462
|
|
|
@@ -1495,7 +1489,7 @@ function validate$3(obj, path = 'ApexClassOutputRepresentation') {
|
|
|
1495
1489
|
})();
|
|
1496
1490
|
return v_error === undefined ? null : v_error;
|
|
1497
1491
|
}
|
|
1498
|
-
const select$
|
|
1492
|
+
const select$5 = function ApexClassOutputRepresentationSelect() {
|
|
1499
1493
|
return {
|
|
1500
1494
|
kind: 'Fragment',
|
|
1501
1495
|
version: VERSION$3,
|
|
@@ -1558,7 +1552,7 @@ function validate$2(obj, path = 'EffectiveMappingRepresentation') {
|
|
|
1558
1552
|
})();
|
|
1559
1553
|
return v_error === undefined ? null : v_error;
|
|
1560
1554
|
}
|
|
1561
|
-
const select$
|
|
1555
|
+
const select$4 = function EffectiveMappingRepresentationSelect() {
|
|
1562
1556
|
return {
|
|
1563
1557
|
kind: 'Fragment',
|
|
1564
1558
|
version: VERSION$2,
|
|
@@ -1581,7 +1575,7 @@ function equals$2(existing, incoming) {
|
|
|
1581
1575
|
}
|
|
1582
1576
|
|
|
1583
1577
|
const TTL$1 = 60000;
|
|
1584
|
-
const VERSION$1 = "
|
|
1578
|
+
const VERSION$1 = "13fc665c9ed137c0ed2ffe53eccfb051";
|
|
1585
1579
|
function validate$1(obj, path = 'ProviderOutputRepresentation') {
|
|
1586
1580
|
const v_error = (() => {
|
|
1587
1581
|
if (typeof obj !== 'object' || ArrayIsArray(obj) || obj === null) {
|
|
@@ -1595,6 +1589,16 @@ function validate$1(obj, path = 'ProviderOutputRepresentation') {
|
|
|
1595
1589
|
message += referencepath_apexClassValidationError.message.split('\n').map((line) => '\t' + line).join('\n');
|
|
1596
1590
|
return new TypeError(message);
|
|
1597
1591
|
}
|
|
1592
|
+
const obj_configUrl = obj.configUrl;
|
|
1593
|
+
const path_configUrl = path + '.configUrl';
|
|
1594
|
+
if (typeof obj_configUrl !== 'string') {
|
|
1595
|
+
return new TypeError('Expected "string" but received "' + typeof obj_configUrl + '" (at "' + path_configUrl + '")');
|
|
1596
|
+
}
|
|
1597
|
+
const obj_description = obj.description;
|
|
1598
|
+
const path_description = path + '.description';
|
|
1599
|
+
if (typeof obj_description !== 'string') {
|
|
1600
|
+
return new TypeError('Expected "string" but received "' + typeof obj_description + '" (at "' + path_description + '")');
|
|
1601
|
+
}
|
|
1598
1602
|
const obj_effectiveMappings = obj.effectiveMappings;
|
|
1599
1603
|
const path_effectiveMappings = path + '.effectiveMappings';
|
|
1600
1604
|
if (!ArrayIsArray(obj_effectiveMappings)) {
|
|
@@ -1615,6 +1619,21 @@ function validate$1(obj, path = 'ProviderOutputRepresentation') {
|
|
|
1615
1619
|
if (typeof obj_epn !== 'string') {
|
|
1616
1620
|
return new TypeError('Expected "string" but received "' + typeof obj_epn + '" (at "' + path_epn + '")');
|
|
1617
1621
|
}
|
|
1622
|
+
const obj_iconUri = obj.iconUri;
|
|
1623
|
+
const path_iconUri = path + '.iconUri';
|
|
1624
|
+
if (typeof obj_iconUri !== 'string') {
|
|
1625
|
+
return new TypeError('Expected "string" but received "' + typeof obj_iconUri + '" (at "' + path_iconUri + '")');
|
|
1626
|
+
}
|
|
1627
|
+
const obj_id = obj.id;
|
|
1628
|
+
const path_id = path + '.id';
|
|
1629
|
+
if (typeof obj_id !== 'string') {
|
|
1630
|
+
return new TypeError('Expected "string" but received "' + typeof obj_id + '" (at "' + path_id + '")');
|
|
1631
|
+
}
|
|
1632
|
+
const obj_isApplication = obj.isApplication;
|
|
1633
|
+
const path_isApplication = path + '.isApplication';
|
|
1634
|
+
if (typeof obj_isApplication !== 'boolean') {
|
|
1635
|
+
return new TypeError('Expected "boolean" but received "' + typeof obj_isApplication + '" (at "' + path_isApplication + '")');
|
|
1636
|
+
}
|
|
1618
1637
|
const obj_name = obj.name;
|
|
1619
1638
|
const path_name = path + '.name';
|
|
1620
1639
|
if (typeof obj_name !== 'string') {
|
|
@@ -1629,21 +1648,21 @@ function validate$1(obj, path = 'ProviderOutputRepresentation') {
|
|
|
1629
1648
|
return v_error === undefined ? null : v_error;
|
|
1630
1649
|
}
|
|
1631
1650
|
const RepresentationType$1 = 'ProviderOutputRepresentation';
|
|
1632
|
-
function keyBuilder$
|
|
1633
|
-
return keyPrefix + '::' + RepresentationType$1 + ':' + config.
|
|
1651
|
+
function keyBuilder$4(luvio, config) {
|
|
1652
|
+
return keyPrefix + '::' + RepresentationType$1 + ':' + config.id;
|
|
1634
1653
|
}
|
|
1635
1654
|
function keyBuilderFromType(luvio, object) {
|
|
1636
1655
|
const keyParams = {
|
|
1637
|
-
|
|
1656
|
+
id: object.id
|
|
1638
1657
|
};
|
|
1639
|
-
return keyBuilder$
|
|
1658
|
+
return keyBuilder$4(luvio, keyParams);
|
|
1640
1659
|
}
|
|
1641
1660
|
function normalize$1(input, existing, path, luvio, store, timestamp) {
|
|
1642
1661
|
return input;
|
|
1643
1662
|
}
|
|
1644
|
-
const select$
|
|
1645
|
-
const { selections: ApexClassOutputRepresentation__selections, opaque: ApexClassOutputRepresentation__opaque, } = select$
|
|
1646
|
-
const { selections: EffectiveMappingRepresentation__selections, opaque: EffectiveMappingRepresentation__opaque, } = select$
|
|
1663
|
+
const select$3 = function ProviderOutputRepresentationSelect() {
|
|
1664
|
+
const { selections: ApexClassOutputRepresentation__selections, opaque: ApexClassOutputRepresentation__opaque, } = select$5();
|
|
1665
|
+
const { selections: EffectiveMappingRepresentation__selections, opaque: EffectiveMappingRepresentation__opaque, } = select$4();
|
|
1647
1666
|
return {
|
|
1648
1667
|
kind: 'Fragment',
|
|
1649
1668
|
version: VERSION$1,
|
|
@@ -1654,6 +1673,14 @@ const select$2 = function ProviderOutputRepresentationSelect() {
|
|
|
1654
1673
|
kind: 'Object',
|
|
1655
1674
|
selections: ApexClassOutputRepresentation__selections
|
|
1656
1675
|
},
|
|
1676
|
+
{
|
|
1677
|
+
name: 'configUrl',
|
|
1678
|
+
kind: 'Scalar'
|
|
1679
|
+
},
|
|
1680
|
+
{
|
|
1681
|
+
name: 'description',
|
|
1682
|
+
kind: 'Scalar'
|
|
1683
|
+
},
|
|
1657
1684
|
{
|
|
1658
1685
|
name: 'effectiveMappings',
|
|
1659
1686
|
kind: 'Object',
|
|
@@ -1664,6 +1691,18 @@ const select$2 = function ProviderOutputRepresentationSelect() {
|
|
|
1664
1691
|
name: 'epn',
|
|
1665
1692
|
kind: 'Scalar'
|
|
1666
1693
|
},
|
|
1694
|
+
{
|
|
1695
|
+
name: 'iconUri',
|
|
1696
|
+
kind: 'Scalar'
|
|
1697
|
+
},
|
|
1698
|
+
{
|
|
1699
|
+
name: 'id',
|
|
1700
|
+
kind: 'Scalar'
|
|
1701
|
+
},
|
|
1702
|
+
{
|
|
1703
|
+
name: 'isApplication',
|
|
1704
|
+
kind: 'Scalar'
|
|
1705
|
+
},
|
|
1667
1706
|
{
|
|
1668
1707
|
name: 'name',
|
|
1669
1708
|
kind: 'Scalar'
|
|
@@ -1676,11 +1715,36 @@ const select$2 = function ProviderOutputRepresentationSelect() {
|
|
|
1676
1715
|
};
|
|
1677
1716
|
};
|
|
1678
1717
|
function equals$1(existing, incoming) {
|
|
1718
|
+
const existing_isApplication = existing.isApplication;
|
|
1719
|
+
const incoming_isApplication = incoming.isApplication;
|
|
1720
|
+
if (!(existing_isApplication === incoming_isApplication)) {
|
|
1721
|
+
return false;
|
|
1722
|
+
}
|
|
1723
|
+
const existing_configUrl = existing.configUrl;
|
|
1724
|
+
const incoming_configUrl = incoming.configUrl;
|
|
1725
|
+
if (!(existing_configUrl === incoming_configUrl)) {
|
|
1726
|
+
return false;
|
|
1727
|
+
}
|
|
1728
|
+
const existing_description = existing.description;
|
|
1729
|
+
const incoming_description = incoming.description;
|
|
1730
|
+
if (!(existing_description === incoming_description)) {
|
|
1731
|
+
return false;
|
|
1732
|
+
}
|
|
1679
1733
|
const existing_epn = existing.epn;
|
|
1680
1734
|
const incoming_epn = incoming.epn;
|
|
1681
1735
|
if (!(existing_epn === incoming_epn)) {
|
|
1682
1736
|
return false;
|
|
1683
1737
|
}
|
|
1738
|
+
const existing_iconUri = existing.iconUri;
|
|
1739
|
+
const incoming_iconUri = incoming.iconUri;
|
|
1740
|
+
if (!(existing_iconUri === incoming_iconUri)) {
|
|
1741
|
+
return false;
|
|
1742
|
+
}
|
|
1743
|
+
const existing_id = existing.id;
|
|
1744
|
+
const incoming_id = incoming.id;
|
|
1745
|
+
if (!(existing_id === incoming_id)) {
|
|
1746
|
+
return false;
|
|
1747
|
+
}
|
|
1684
1748
|
const existing_name = existing.name;
|
|
1685
1749
|
const incoming_name = incoming.name;
|
|
1686
1750
|
if (!(existing_name === incoming_name)) {
|
|
@@ -1795,7 +1859,7 @@ function normalize(input, existing, path, luvio, store, timestamp) {
|
|
|
1795
1859
|
}
|
|
1796
1860
|
return input;
|
|
1797
1861
|
}
|
|
1798
|
-
const select$
|
|
1862
|
+
const select$2 = function ProviderOutputCollectionRepresentationSelect() {
|
|
1799
1863
|
return {
|
|
1800
1864
|
kind: 'Fragment',
|
|
1801
1865
|
version: VERSION,
|
|
@@ -1809,7 +1873,7 @@ const select$1 = function ProviderOutputCollectionRepresentationSelect() {
|
|
|
1809
1873
|
name: 'items',
|
|
1810
1874
|
kind: 'Link',
|
|
1811
1875
|
plural: true,
|
|
1812
|
-
fragment: select$
|
|
1876
|
+
fragment: select$3()
|
|
1813
1877
|
}
|
|
1814
1878
|
]
|
|
1815
1879
|
};
|
|
@@ -1876,22 +1940,22 @@ function getTypeCacheKeys(rootKeySet, luvio, input, fullPathFactory) {
|
|
|
1876
1940
|
}
|
|
1877
1941
|
}
|
|
1878
1942
|
|
|
1879
|
-
function select(luvio, params) {
|
|
1880
|
-
return select$
|
|
1943
|
+
function select$1(luvio, params) {
|
|
1944
|
+
return select$2();
|
|
1881
1945
|
}
|
|
1882
|
-
function keyBuilder$
|
|
1946
|
+
function keyBuilder$3(luvio, params) {
|
|
1883
1947
|
return keyPrefix + '::ProviderOutputCollectionRepresentation:(' + 'effectiveMappingsWebstoreId:' + params.queryParams.effectiveMappingsWebstoreId + ',' + 'epn:' + params.queryParams.epn + ')';
|
|
1884
1948
|
}
|
|
1885
|
-
function getResponseCacheKeys(storeKeyMap, luvio, resourceParams, response) {
|
|
1886
|
-
getTypeCacheKeys(storeKeyMap, luvio, response, () => keyBuilder$
|
|
1949
|
+
function getResponseCacheKeys$1(storeKeyMap, luvio, resourceParams, response) {
|
|
1950
|
+
getTypeCacheKeys(storeKeyMap, luvio, response, () => keyBuilder$3(luvio, resourceParams));
|
|
1887
1951
|
}
|
|
1888
|
-
function ingestSuccess(luvio, resourceParams, response, snapshotRefresh) {
|
|
1952
|
+
function ingestSuccess$1(luvio, resourceParams, response, snapshotRefresh) {
|
|
1889
1953
|
const { body } = response;
|
|
1890
|
-
const key = keyBuilder$
|
|
1954
|
+
const key = keyBuilder$3(luvio, resourceParams);
|
|
1891
1955
|
luvio.storeIngest(key, ingest, body);
|
|
1892
1956
|
const snapshot = luvio.storeLookup({
|
|
1893
1957
|
recordId: key,
|
|
1894
|
-
node: select(),
|
|
1958
|
+
node: select$1(),
|
|
1895
1959
|
variables: {},
|
|
1896
1960
|
}, snapshotRefresh);
|
|
1897
1961
|
if (process.env.NODE_ENV !== 'production') {
|
|
@@ -1902,8 +1966,8 @@ function ingestSuccess(luvio, resourceParams, response, snapshotRefresh) {
|
|
|
1902
1966
|
deepFreeze(snapshot.data);
|
|
1903
1967
|
return snapshot;
|
|
1904
1968
|
}
|
|
1905
|
-
function ingestError(luvio, params, error, snapshotRefresh) {
|
|
1906
|
-
const key = keyBuilder$
|
|
1969
|
+
function ingestError$1(luvio, params, error, snapshotRefresh) {
|
|
1970
|
+
const key = keyBuilder$3(luvio, params);
|
|
1907
1971
|
const errorSnapshot = luvio.errorSnapshot(error, snapshotRefresh);
|
|
1908
1972
|
const storeMetadataParams = {
|
|
1909
1973
|
ttl: TTL,
|
|
@@ -1914,7 +1978,7 @@ function ingestError(luvio, params, error, snapshotRefresh) {
|
|
|
1914
1978
|
luvio.storeIngestError(key, errorSnapshot, storeMetadataParams);
|
|
1915
1979
|
return errorSnapshot;
|
|
1916
1980
|
}
|
|
1917
|
-
function createResourceRequest(config) {
|
|
1981
|
+
function createResourceRequest$1(config) {
|
|
1918
1982
|
const headers = {};
|
|
1919
1983
|
return {
|
|
1920
1984
|
baseUri: '/services/data/v59.0',
|
|
@@ -1935,7 +1999,7 @@ const getProviders_ConfigPropertyNames = {
|
|
|
1935
1999
|
optional: ['effectiveMappingsWebstoreId', 'epn']
|
|
1936
2000
|
}
|
|
1937
2001
|
};
|
|
1938
|
-
function createResourceParams(config) {
|
|
2002
|
+
function createResourceParams$1(config) {
|
|
1939
2003
|
const resourceParams = {
|
|
1940
2004
|
queryParams: {
|
|
1941
2005
|
effectiveMappingsWebstoreId: config.effectiveMappingsWebstoreId, epn: config.epn
|
|
@@ -1943,6 +2007,179 @@ function createResourceParams(config) {
|
|
|
1943
2007
|
};
|
|
1944
2008
|
return resourceParams;
|
|
1945
2009
|
}
|
|
2010
|
+
function keyBuilder$2(luvio, config) {
|
|
2011
|
+
const resourceParams = createResourceParams$1(config);
|
|
2012
|
+
return keyBuilder$3(luvio, resourceParams);
|
|
2013
|
+
}
|
|
2014
|
+
function typeCheckConfig$1(untrustedConfig) {
|
|
2015
|
+
const config = {};
|
|
2016
|
+
typeCheckScalars(untrustedConfig, config, {
|
|
2017
|
+
effectiveMappingsWebstoreId: 0 /* String */,
|
|
2018
|
+
epn: 0 /* String */,
|
|
2019
|
+
});
|
|
2020
|
+
return config;
|
|
2021
|
+
}
|
|
2022
|
+
function validateAdapterConfig$1(untrustedConfig, configPropertyNames) {
|
|
2023
|
+
if (!untrustedIsObject(untrustedConfig)) {
|
|
2024
|
+
return null;
|
|
2025
|
+
}
|
|
2026
|
+
if (process.env.NODE_ENV !== 'production') {
|
|
2027
|
+
validateConfig(untrustedConfig, configPropertyNames);
|
|
2028
|
+
}
|
|
2029
|
+
const config = typeCheckConfig$1(untrustedConfig);
|
|
2030
|
+
if (!areRequiredParametersPresent(config, configPropertyNames)) {
|
|
2031
|
+
return null;
|
|
2032
|
+
}
|
|
2033
|
+
return config;
|
|
2034
|
+
}
|
|
2035
|
+
function adapterFragment$1(luvio, config) {
|
|
2036
|
+
createResourceParams$1(config);
|
|
2037
|
+
return select$1();
|
|
2038
|
+
}
|
|
2039
|
+
function onFetchResponseSuccess$1(luvio, config, resourceParams, response) {
|
|
2040
|
+
const snapshot = ingestSuccess$1(luvio, resourceParams, response, {
|
|
2041
|
+
config,
|
|
2042
|
+
resolve: () => buildNetworkSnapshot$1(luvio, config, snapshotRefreshOptions)
|
|
2043
|
+
});
|
|
2044
|
+
return luvio.storeBroadcast().then(() => snapshot);
|
|
2045
|
+
}
|
|
2046
|
+
function onFetchResponseError$1(luvio, config, resourceParams, response) {
|
|
2047
|
+
const snapshot = ingestError$1(luvio, resourceParams, response, {
|
|
2048
|
+
config,
|
|
2049
|
+
resolve: () => buildNetworkSnapshot$1(luvio, config, snapshotRefreshOptions)
|
|
2050
|
+
});
|
|
2051
|
+
return luvio.storeBroadcast().then(() => snapshot);
|
|
2052
|
+
}
|
|
2053
|
+
function buildNetworkSnapshot$1(luvio, config, options) {
|
|
2054
|
+
const resourceParams = createResourceParams$1(config);
|
|
2055
|
+
const request = createResourceRequest$1(resourceParams);
|
|
2056
|
+
return luvio.dispatchResourceRequest(request, options)
|
|
2057
|
+
.then((response) => {
|
|
2058
|
+
return luvio.handleSuccessResponse(() => onFetchResponseSuccess$1(luvio, config, resourceParams, response), () => {
|
|
2059
|
+
const cache = new StoreKeyMap();
|
|
2060
|
+
getResponseCacheKeys$1(cache, luvio, resourceParams, response.body);
|
|
2061
|
+
return cache;
|
|
2062
|
+
});
|
|
2063
|
+
}, (response) => {
|
|
2064
|
+
return luvio.handleErrorResponse(() => onFetchResponseError$1(luvio, config, resourceParams, response));
|
|
2065
|
+
});
|
|
2066
|
+
}
|
|
2067
|
+
function buildNetworkSnapshotCachePolicy$1(context, coercedAdapterRequestContext) {
|
|
2068
|
+
const { luvio, config } = context;
|
|
2069
|
+
const { networkPriority, requestCorrelator, eventObservers } = coercedAdapterRequestContext;
|
|
2070
|
+
const dispatchOptions = {
|
|
2071
|
+
resourceRequestContext: {
|
|
2072
|
+
requestCorrelator,
|
|
2073
|
+
luvioRequestMethod: undefined,
|
|
2074
|
+
},
|
|
2075
|
+
eventObservers
|
|
2076
|
+
};
|
|
2077
|
+
if (networkPriority !== 'normal') {
|
|
2078
|
+
dispatchOptions.overrides = {
|
|
2079
|
+
priority: networkPriority
|
|
2080
|
+
};
|
|
2081
|
+
}
|
|
2082
|
+
return buildNetworkSnapshot$1(luvio, config, dispatchOptions);
|
|
2083
|
+
}
|
|
2084
|
+
function buildCachedSnapshotCachePolicy$1(context, storeLookup) {
|
|
2085
|
+
const { luvio, config } = context;
|
|
2086
|
+
const selector = {
|
|
2087
|
+
recordId: keyBuilder$2(luvio, config),
|
|
2088
|
+
node: adapterFragment$1(luvio, config),
|
|
2089
|
+
variables: {},
|
|
2090
|
+
};
|
|
2091
|
+
const cacheSnapshot = storeLookup(selector, {
|
|
2092
|
+
config,
|
|
2093
|
+
resolve: () => buildNetworkSnapshot$1(luvio, config, snapshotRefreshOptions)
|
|
2094
|
+
});
|
|
2095
|
+
return cacheSnapshot;
|
|
2096
|
+
}
|
|
2097
|
+
const getProvidersAdapterFactory = (luvio) => function extensions__getProviders(untrustedConfig, requestContext) {
|
|
2098
|
+
const config = validateAdapterConfig$1(untrustedConfig, getProviders_ConfigPropertyNames);
|
|
2099
|
+
// Invalid or incomplete config
|
|
2100
|
+
if (config === null) {
|
|
2101
|
+
return null;
|
|
2102
|
+
}
|
|
2103
|
+
return luvio.applyCachePolicy((requestContext || {}), { config, luvio }, // BuildSnapshotContext
|
|
2104
|
+
buildCachedSnapshotCachePolicy$1, buildNetworkSnapshotCachePolicy$1);
|
|
2105
|
+
};
|
|
2106
|
+
|
|
2107
|
+
function select(luvio, params) {
|
|
2108
|
+
return select$3();
|
|
2109
|
+
}
|
|
2110
|
+
function keyBuilder$1(luvio, params) {
|
|
2111
|
+
return keyBuilder$4(luvio, {
|
|
2112
|
+
id: params.urlParams.providerId
|
|
2113
|
+
});
|
|
2114
|
+
}
|
|
2115
|
+
function getResponseCacheKeys(storeKeyMap, luvio, resourceParams, response) {
|
|
2116
|
+
getTypeCacheKeys$1(storeKeyMap, luvio, response);
|
|
2117
|
+
}
|
|
2118
|
+
function ingestSuccess(luvio, resourceParams, response, snapshotRefresh) {
|
|
2119
|
+
const { body } = response;
|
|
2120
|
+
const key = keyBuilder$1(luvio, resourceParams);
|
|
2121
|
+
luvio.storeIngest(key, ingest$1, body);
|
|
2122
|
+
const snapshot = luvio.storeLookup({
|
|
2123
|
+
recordId: key,
|
|
2124
|
+
node: select(),
|
|
2125
|
+
variables: {},
|
|
2126
|
+
}, snapshotRefresh);
|
|
2127
|
+
if (process.env.NODE_ENV !== 'production') {
|
|
2128
|
+
if (snapshot.state !== 'Fulfilled') {
|
|
2129
|
+
throw new Error('Invalid network response. Expected resource response to result in Fulfilled snapshot');
|
|
2130
|
+
}
|
|
2131
|
+
}
|
|
2132
|
+
deepFreeze(snapshot.data);
|
|
2133
|
+
return snapshot;
|
|
2134
|
+
}
|
|
2135
|
+
function ingestError(luvio, params, error, snapshotRefresh) {
|
|
2136
|
+
const key = keyBuilder$1(luvio, params);
|
|
2137
|
+
const errorSnapshot = luvio.errorSnapshot(error, snapshotRefresh);
|
|
2138
|
+
const storeMetadataParams = {
|
|
2139
|
+
ttl: TTL$1,
|
|
2140
|
+
namespace: keyPrefix,
|
|
2141
|
+
version: VERSION$1,
|
|
2142
|
+
representationName: RepresentationType$1
|
|
2143
|
+
};
|
|
2144
|
+
luvio.storeIngestError(key, errorSnapshot, storeMetadataParams);
|
|
2145
|
+
return errorSnapshot;
|
|
2146
|
+
}
|
|
2147
|
+
function createResourceRequest(config) {
|
|
2148
|
+
const headers = {};
|
|
2149
|
+
return {
|
|
2150
|
+
baseUri: '/services/data/v59.0',
|
|
2151
|
+
basePath: '/commerce/extension/providers/' + config.urlParams.providerId + '',
|
|
2152
|
+
method: 'get',
|
|
2153
|
+
body: null,
|
|
2154
|
+
urlParams: config.urlParams,
|
|
2155
|
+
queryParams: {},
|
|
2156
|
+
headers,
|
|
2157
|
+
priority: 'normal',
|
|
2158
|
+
};
|
|
2159
|
+
}
|
|
2160
|
+
function createResourceRequestFromRepresentation(representation) {
|
|
2161
|
+
const config = {
|
|
2162
|
+
urlParams: {},
|
|
2163
|
+
};
|
|
2164
|
+
config.urlParams.providerId = representation.id;
|
|
2165
|
+
return createResourceRequest(config);
|
|
2166
|
+
}
|
|
2167
|
+
|
|
2168
|
+
const getProvider_ConfigPropertyNames = {
|
|
2169
|
+
displayName: 'getProvider',
|
|
2170
|
+
parameters: {
|
|
2171
|
+
required: ['providerId'],
|
|
2172
|
+
optional: []
|
|
2173
|
+
}
|
|
2174
|
+
};
|
|
2175
|
+
function createResourceParams(config) {
|
|
2176
|
+
const resourceParams = {
|
|
2177
|
+
urlParams: {
|
|
2178
|
+
providerId: config.providerId
|
|
2179
|
+
}
|
|
2180
|
+
};
|
|
2181
|
+
return resourceParams;
|
|
2182
|
+
}
|
|
1946
2183
|
function keyBuilder(luvio, config) {
|
|
1947
2184
|
const resourceParams = createResourceParams(config);
|
|
1948
2185
|
return keyBuilder$1(luvio, resourceParams);
|
|
@@ -1950,8 +2187,7 @@ function keyBuilder(luvio, config) {
|
|
|
1950
2187
|
function typeCheckConfig(untrustedConfig) {
|
|
1951
2188
|
const config = {};
|
|
1952
2189
|
typeCheckScalars(untrustedConfig, config, {
|
|
1953
|
-
|
|
1954
|
-
epn: 0 /* String */,
|
|
2190
|
+
providerId: 0 /* String */,
|
|
1955
2191
|
});
|
|
1956
2192
|
return config;
|
|
1957
2193
|
}
|
|
@@ -2030,8 +2266,8 @@ function buildCachedSnapshotCachePolicy(context, storeLookup) {
|
|
|
2030
2266
|
});
|
|
2031
2267
|
return cacheSnapshot;
|
|
2032
2268
|
}
|
|
2033
|
-
const
|
|
2034
|
-
const config = validateAdapterConfig(untrustedConfig,
|
|
2269
|
+
const getProviderAdapterFactory = (luvio) => function extensions__getProvider(untrustedConfig, requestContext) {
|
|
2270
|
+
const config = validateAdapterConfig(untrustedConfig, getProvider_ConfigPropertyNames);
|
|
2035
2271
|
// Invalid or incomplete config
|
|
2036
2272
|
if (config === null) {
|
|
2037
2273
|
return null;
|
|
@@ -2039,6 +2275,40 @@ const getProvidersAdapterFactory = (luvio) => function extensions__getProviders(
|
|
|
2039
2275
|
return luvio.applyCachePolicy((requestContext || {}), { config, luvio }, // BuildSnapshotContext
|
|
2040
2276
|
buildCachedSnapshotCachePolicy, buildNetworkSnapshotCachePolicy);
|
|
2041
2277
|
};
|
|
2278
|
+
const notifyChangeFactory = (luvio, options) => {
|
|
2279
|
+
return function getCommerceExtensionProvidersByProviderIdNotifyChange(configs) {
|
|
2280
|
+
const keys = configs.map(c => keyBuilder$4(luvio, c));
|
|
2281
|
+
luvio.getNotifyChangeStoreEntries(keys).then(entries => {
|
|
2282
|
+
for (let i = 0, len = entries.length; i < len; i++) {
|
|
2283
|
+
const { key, record: val } = entries[i];
|
|
2284
|
+
const refreshRequest = createResourceRequestFromRepresentation(val);
|
|
2285
|
+
luvio.dispatchResourceRequest(refreshRequest, options)
|
|
2286
|
+
.then((response) => {
|
|
2287
|
+
return luvio.handleSuccessResponse(() => {
|
|
2288
|
+
const { body } = response;
|
|
2289
|
+
luvio.storeIngest(key, ingest$1, body);
|
|
2290
|
+
return luvio.storeBroadcast();
|
|
2291
|
+
}, () => {
|
|
2292
|
+
const cache = new StoreKeyMap();
|
|
2293
|
+
getTypeCacheKeys$1(cache, luvio, response.body);
|
|
2294
|
+
return cache;
|
|
2295
|
+
});
|
|
2296
|
+
}, (error) => {
|
|
2297
|
+
return luvio.handleErrorResponse(() => {
|
|
2298
|
+
const errorSnapshot = luvio.errorSnapshot(error);
|
|
2299
|
+
luvio.storeIngestError(key, errorSnapshot, {
|
|
2300
|
+
ttl: TTL$1,
|
|
2301
|
+
namespace: keyPrefix,
|
|
2302
|
+
version: VERSION$1,
|
|
2303
|
+
representationName: RepresentationType$1
|
|
2304
|
+
});
|
|
2305
|
+
return luvio.storeBroadcast().then(() => errorSnapshot);
|
|
2306
|
+
});
|
|
2307
|
+
});
|
|
2308
|
+
}
|
|
2309
|
+
});
|
|
2310
|
+
};
|
|
2311
|
+
};
|
|
2042
2312
|
|
|
2043
2313
|
let createMapping;
|
|
2044
2314
|
let deleteMapping;
|
|
@@ -2046,22 +2316,27 @@ let getExtensions;
|
|
|
2046
2316
|
let getMapping;
|
|
2047
2317
|
let getMappingNotifyChange;
|
|
2048
2318
|
let getMappings;
|
|
2319
|
+
let getProvider;
|
|
2320
|
+
let getProviderNotifyChange;
|
|
2049
2321
|
let getProviders;
|
|
2050
2322
|
let updateMapping;
|
|
2051
2323
|
// Imperative GET Adapters
|
|
2052
2324
|
let getExtensions_imperative;
|
|
2053
2325
|
let getMapping_imperative;
|
|
2054
2326
|
let getMappings_imperative;
|
|
2327
|
+
let getProvider_imperative;
|
|
2055
2328
|
let getProviders_imperative;
|
|
2056
2329
|
const getExtensionsMetadata = { apiFamily: 'extensions', name: 'getExtensions', ttl: 60000 };
|
|
2057
2330
|
const getMappingMetadata = { apiFamily: 'extensions', name: 'getMapping', ttl: 60000 };
|
|
2058
2331
|
const getMappingsMetadata = { apiFamily: 'extensions', name: 'getMappings', ttl: 60000 };
|
|
2332
|
+
const getProviderMetadata = { apiFamily: 'extensions', name: 'getProvider', ttl: 60000 };
|
|
2059
2333
|
const getProvidersMetadata = { apiFamily: 'extensions', name: 'getProviders', ttl: 60000 };
|
|
2060
2334
|
function bindExportsTo(luvio) {
|
|
2061
2335
|
// LDS Adapters
|
|
2062
2336
|
const getExtensions_ldsAdapter = createInstrumentedAdapter(createLDSAdapter(luvio, 'getExtensions', getExtensionsAdapterFactory), getExtensionsMetadata);
|
|
2063
2337
|
const getMapping_ldsAdapter = createInstrumentedAdapter(createLDSAdapter(luvio, 'getMapping', getMappingAdapterFactory), getMappingMetadata);
|
|
2064
2338
|
const getMappings_ldsAdapter = createInstrumentedAdapter(createLDSAdapter(luvio, 'getMappings', getMappingsAdapterFactory), getMappingsMetadata);
|
|
2339
|
+
const getProvider_ldsAdapter = createInstrumentedAdapter(createLDSAdapter(luvio, 'getProvider', getProviderAdapterFactory), getProviderMetadata);
|
|
2065
2340
|
const getProviders_ldsAdapter = createInstrumentedAdapter(createLDSAdapter(luvio, 'getProviders', getProvidersAdapterFactory), getProvidersMetadata);
|
|
2066
2341
|
function unwrapSnapshotData(factory) {
|
|
2067
2342
|
const adapter = factory(luvio);
|
|
@@ -2072,14 +2347,17 @@ function bindExportsTo(luvio) {
|
|
|
2072
2347
|
deleteMapping: createLDSAdapter(luvio, adapterName, deleteMappingAdapterFactory),
|
|
2073
2348
|
getExtensions: createWireAdapterConstructor(luvio, getExtensions_ldsAdapter, getExtensionsMetadata),
|
|
2074
2349
|
getMapping: createWireAdapterConstructor(luvio, getMapping_ldsAdapter, getMappingMetadata),
|
|
2075
|
-
getMappingNotifyChange: createLDSAdapter(luvio, 'getMappingNotifyChange', notifyChangeFactory),
|
|
2350
|
+
getMappingNotifyChange: createLDSAdapter(luvio, 'getMappingNotifyChange', notifyChangeFactory$1),
|
|
2076
2351
|
getMappings: createWireAdapterConstructor(luvio, getMappings_ldsAdapter, getMappingsMetadata),
|
|
2352
|
+
getProvider: createWireAdapterConstructor(luvio, getProvider_ldsAdapter, getProviderMetadata),
|
|
2353
|
+
getProviderNotifyChange: createLDSAdapter(luvio, 'getProviderNotifyChange', notifyChangeFactory),
|
|
2077
2354
|
getProviders: createWireAdapterConstructor(luvio, getProviders_ldsAdapter, getProvidersMetadata),
|
|
2078
2355
|
updateMapping: unwrapSnapshotData(updateMappingAdapterFactory),
|
|
2079
2356
|
// Imperative GET Adapters
|
|
2080
2357
|
getExtensions_imperative: createImperativeAdapter(luvio, getExtensions_ldsAdapter, getExtensionsMetadata),
|
|
2081
2358
|
getMapping_imperative: createImperativeAdapter(luvio, getMapping_ldsAdapter, getMappingMetadata),
|
|
2082
2359
|
getMappings_imperative: createImperativeAdapter(luvio, getMappings_ldsAdapter, getMappingsMetadata),
|
|
2360
|
+
getProvider_imperative: createImperativeAdapter(luvio, getProvider_ldsAdapter, getProviderMetadata),
|
|
2083
2361
|
getProviders_imperative: createImperativeAdapter(luvio, getProviders_ldsAdapter, getProvidersMetadata)
|
|
2084
2362
|
};
|
|
2085
2363
|
}
|
|
@@ -2091,11 +2369,14 @@ withDefaultLuvio((luvio) => {
|
|
|
2091
2369
|
getMapping,
|
|
2092
2370
|
getMappingNotifyChange,
|
|
2093
2371
|
getMappings,
|
|
2372
|
+
getProvider,
|
|
2373
|
+
getProviderNotifyChange,
|
|
2094
2374
|
getProviders,
|
|
2095
2375
|
updateMapping,
|
|
2096
2376
|
getExtensions_imperative,
|
|
2097
2377
|
getMapping_imperative,
|
|
2098
2378
|
getMappings_imperative,
|
|
2379
|
+
getProvider_imperative,
|
|
2099
2380
|
getProviders_imperative
|
|
2100
2381
|
} = bindExportsTo(luvio));
|
|
2101
2382
|
});
|
|
@@ -2105,5 +2386,5 @@ withDefaultLuvio((luvio) => {
|
|
|
2105
2386
|
notifyMappingUpdateAvailable = createLDSAdapter(luvio, 'notifyMappingUpdateAvailable', notifyUpdateAvailableFactory);
|
|
2106
2387
|
});
|
|
2107
2388
|
|
|
2108
|
-
export { createMapping, deleteMapping, getExtensions, getExtensions_imperative, getMapping, getMappingNotifyChange, getMapping_imperative, getMappings, getMappings_imperative, getProviders, getProviders_imperative, notifyMappingUpdateAvailable, updateMapping };
|
|
2109
|
-
// version: 1.
|
|
2389
|
+
export { createMapping, deleteMapping, getExtensions, getExtensions_imperative, getMapping, getMappingNotifyChange, getMapping_imperative, getMappings, getMappings_imperative, getProvider, getProviderNotifyChange, getProvider_imperative, getProviders, getProviders_imperative, notifyMappingUpdateAvailable, updateMapping };
|
|
2390
|
+
// version: 1.211.0-ba06d67e8
|