@salesforce/lds-adapters-cdp-byoc 1.354.0-dev7 → 1.354.0-dev8
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/es/es2018/cdp-byoc.js +867 -199
- package/dist/es/es2018/types/src/generated/adapters/getCustomCodeDeployments.d.ts +2 -0
- package/dist/es/es2018/types/src/generated/adapters/getCustomCodeExecutionLogs.d.ts +28 -0
- package/dist/es/es2018/types/src/generated/adapters/getCustomCodeExecutions.d.ts +29 -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/getSsotDataCustomCode.d.ts +2 -0
- package/dist/es/es2018/types/src/generated/resources/getSsotDataCustomCodeExecutionsByCustomCodeNameOrId.d.ts +19 -0
- package/dist/es/es2018/types/src/generated/resources/getSsotDataCustomCodeExecutionsLogsByCustomCodeExecutionIdAndCustomCodeNameOrId.d.ts +16 -0
- package/dist/es/es2018/types/src/generated/types/CustomCodeExecutionBaseRepresentation.d.ts +55 -0
- package/dist/es/es2018/types/src/generated/types/CustomCodeExecutionCollectionRepresentation.d.ts +38 -0
- package/dist/es/es2018/types/src/generated/types/CustomCodeExecutionLogRepresentation.d.ts +28 -0
- package/package.json +3 -3
- package/sfdc/index.js +909 -222
- package/src/raml/api.raml +130 -0
- package/src/raml/luvio.raml +10 -0
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
* For full license text, see the LICENSE.txt file
|
|
5
5
|
*/
|
|
6
6
|
|
|
7
|
-
import { serializeStructuredKey, ingestShape, deepFreeze, StoreKeyMap, createResourceParams as createResourceParams$
|
|
7
|
+
import { serializeStructuredKey, ingestShape, deepFreeze, StoreKeyMap, createResourceParams as createResourceParams$7, typeCheckConfig as typeCheckConfig$7, buildNetworkSnapshotCachePolicy as buildNetworkSnapshotCachePolicy$4 } from '@luvio/engine';
|
|
8
8
|
|
|
9
9
|
const { hasOwnProperty: ObjectPrototypeHasOwnProperty } = Object.prototype;
|
|
10
10
|
const { keys: ObjectKeys$1, create: ObjectCreate$1 } = Object;
|
|
@@ -112,8 +112,8 @@ function createLink(ref) {
|
|
|
112
112
|
};
|
|
113
113
|
}
|
|
114
114
|
|
|
115
|
-
const VERSION$
|
|
116
|
-
function validate$
|
|
115
|
+
const VERSION$5 = "2fe1bfd9fd1c6a94767d2ea000d6d318";
|
|
116
|
+
function validate$5(obj, path = 'CdpUserRepresentation') {
|
|
117
117
|
const v_error = (() => {
|
|
118
118
|
if (typeof obj !== 'object' || ArrayIsArray(obj) || obj === null) {
|
|
119
119
|
return new TypeError('Expected "object" but received "' + typeof obj + '" (at "' + path + '")');
|
|
@@ -136,10 +136,10 @@ function validate$2(obj, path = 'CdpUserRepresentation') {
|
|
|
136
136
|
})();
|
|
137
137
|
return v_error === undefined ? null : v_error;
|
|
138
138
|
}
|
|
139
|
-
const select$
|
|
139
|
+
const select$b = function CdpUserRepresentationSelect() {
|
|
140
140
|
return {
|
|
141
141
|
kind: 'Fragment',
|
|
142
|
-
version: VERSION$
|
|
142
|
+
version: VERSION$5,
|
|
143
143
|
private: [],
|
|
144
144
|
selections: [
|
|
145
145
|
{
|
|
@@ -157,7 +157,7 @@ const select$6 = function CdpUserRepresentationSelect() {
|
|
|
157
157
|
]
|
|
158
158
|
};
|
|
159
159
|
};
|
|
160
|
-
function equals$
|
|
160
|
+
function equals$5(existing, incoming) {
|
|
161
161
|
const existing_id = existing.id;
|
|
162
162
|
const incoming_id = incoming.id;
|
|
163
163
|
if (!(existing_id === incoming_id)) {
|
|
@@ -176,8 +176,8 @@ function equals$2(existing, incoming) {
|
|
|
176
176
|
return true;
|
|
177
177
|
}
|
|
178
178
|
|
|
179
|
-
const VERSION$
|
|
180
|
-
function validate$
|
|
179
|
+
const VERSION$4 = "3a8185ac626c1463f8bf0540517ef2e2";
|
|
180
|
+
function validate$4(obj, path = 'CustomCodeDeploymentRepresentation') {
|
|
181
181
|
const v_error = (() => {
|
|
182
182
|
if (typeof obj !== 'object' || ArrayIsArray(obj) || obj === null) {
|
|
183
183
|
return new TypeError('Expected "object" but received "' + typeof obj + '" (at "' + path + '")');
|
|
@@ -194,7 +194,7 @@ function validate$1(obj, path = 'CustomCodeDeploymentRepresentation') {
|
|
|
194
194
|
}
|
|
195
195
|
const obj_createdBy = obj.createdBy;
|
|
196
196
|
const path_createdBy = path + '.createdBy';
|
|
197
|
-
const referencepath_createdByValidationError = validate$
|
|
197
|
+
const referencepath_createdByValidationError = validate$5(obj_createdBy, path_createdBy);
|
|
198
198
|
if (referencepath_createdByValidationError !== null) {
|
|
199
199
|
let message = 'Object doesn\'t match CdpUserRepresentation (at "' + path_createdBy + '")\n';
|
|
200
200
|
message += referencepath_createdByValidationError.message.split('\n').map((line) => '\t' + line).join('\n');
|
|
@@ -262,7 +262,7 @@ function validate$1(obj, path = 'CustomCodeDeploymentRepresentation') {
|
|
|
262
262
|
}
|
|
263
263
|
const obj_lastModifiedBy = obj.lastModifiedBy;
|
|
264
264
|
const path_lastModifiedBy = path + '.lastModifiedBy';
|
|
265
|
-
const referencepath_lastModifiedByValidationError = validate$
|
|
265
|
+
const referencepath_lastModifiedByValidationError = validate$5(obj_lastModifiedBy, path_lastModifiedBy);
|
|
266
266
|
if (referencepath_lastModifiedByValidationError !== null) {
|
|
267
267
|
let message = 'Object doesn\'t match CdpUserRepresentation (at "' + path_lastModifiedBy + '")\n';
|
|
268
268
|
message += referencepath_lastModifiedByValidationError.message.split('\n').map((line) => '\t' + line).join('\n');
|
|
@@ -317,24 +317,24 @@ function validate$1(obj, path = 'CustomCodeDeploymentRepresentation') {
|
|
|
317
317
|
})();
|
|
318
318
|
return v_error === undefined ? null : v_error;
|
|
319
319
|
}
|
|
320
|
-
const RepresentationType$
|
|
321
|
-
function keyBuilder$
|
|
322
|
-
return keyPrefix + '::' + RepresentationType$
|
|
320
|
+
const RepresentationType$3 = 'CustomCodeDeploymentRepresentation';
|
|
321
|
+
function keyBuilder$9(luvio, config) {
|
|
322
|
+
return keyPrefix + '::' + RepresentationType$3 + ':' + config.id;
|
|
323
323
|
}
|
|
324
324
|
function keyBuilderFromType(luvio, object) {
|
|
325
325
|
const keyParams = {
|
|
326
326
|
id: object.id
|
|
327
327
|
};
|
|
328
|
-
return keyBuilder$
|
|
328
|
+
return keyBuilder$9(luvio, keyParams);
|
|
329
329
|
}
|
|
330
|
-
function normalize$
|
|
330
|
+
function normalize$3(input, existing, path, luvio, store, timestamp) {
|
|
331
331
|
return input;
|
|
332
332
|
}
|
|
333
|
-
const select$
|
|
334
|
-
const { selections: CdpUserRepresentation__selections, opaque: CdpUserRepresentation__opaque, } = select$
|
|
333
|
+
const select$a = function CustomCodeDeploymentRepresentationSelect() {
|
|
334
|
+
const { selections: CdpUserRepresentation__selections, opaque: CdpUserRepresentation__opaque, } = select$b();
|
|
335
335
|
return {
|
|
336
336
|
kind: 'Fragment',
|
|
337
|
-
version: VERSION$
|
|
337
|
+
version: VERSION$4,
|
|
338
338
|
private: [],
|
|
339
339
|
selections: [
|
|
340
340
|
{
|
|
@@ -429,7 +429,7 @@ const select$5 = function CustomCodeDeploymentRepresentationSelect() {
|
|
|
429
429
|
]
|
|
430
430
|
};
|
|
431
431
|
};
|
|
432
|
-
function equals$
|
|
432
|
+
function equals$4(existing, incoming) {
|
|
433
433
|
const existing_deploymentFailureCode = existing.deploymentFailureCode;
|
|
434
434
|
const incoming_deploymentFailureCode = incoming.deploymentFailureCode;
|
|
435
435
|
// if at least one of these optionals is defined
|
|
@@ -544,7 +544,7 @@ function equals$1(existing, incoming) {
|
|
|
544
544
|
}
|
|
545
545
|
const existing_createdBy = existing.createdBy;
|
|
546
546
|
const incoming_createdBy = incoming.createdBy;
|
|
547
|
-
if (!(equals$
|
|
547
|
+
if (!(equals$5(existing_createdBy, incoming_createdBy))) {
|
|
548
548
|
return false;
|
|
549
549
|
}
|
|
550
550
|
const existing_functionInvokeOptions = existing.functionInvokeOptions;
|
|
@@ -567,7 +567,7 @@ function equals$1(existing, incoming) {
|
|
|
567
567
|
}
|
|
568
568
|
const existing_lastModifiedBy = existing.lastModifiedBy;
|
|
569
569
|
const incoming_lastModifiedBy = incoming.lastModifiedBy;
|
|
570
|
-
if (!(equals$
|
|
570
|
+
if (!(equals$5(existing_lastModifiedBy, incoming_lastModifiedBy))) {
|
|
571
571
|
return false;
|
|
572
572
|
}
|
|
573
573
|
const existing_parameters = existing.parameters;
|
|
@@ -582,41 +582,41 @@ function equals$1(existing, incoming) {
|
|
|
582
582
|
}
|
|
583
583
|
return true;
|
|
584
584
|
}
|
|
585
|
-
const ingest$
|
|
585
|
+
const ingest$3 = function CustomCodeDeploymentRepresentationIngest(input, path, luvio, store, timestamp) {
|
|
586
586
|
if (process.env.NODE_ENV !== 'production') {
|
|
587
|
-
const validateError = validate$
|
|
587
|
+
const validateError = validate$4(input);
|
|
588
588
|
if (validateError !== null) {
|
|
589
589
|
throw validateError;
|
|
590
590
|
}
|
|
591
591
|
}
|
|
592
592
|
const key = keyBuilderFromType(luvio, input);
|
|
593
593
|
const ttlToUse = path.ttl !== undefined ? path.ttl : 60000;
|
|
594
|
-
ingestShape(input, path, luvio, store, timestamp, ttlToUse, key, normalize$
|
|
594
|
+
ingestShape(input, path, luvio, store, timestamp, ttlToUse, key, normalize$3, "byoc", VERSION$4, RepresentationType$3, equals$4);
|
|
595
595
|
return createLink(key);
|
|
596
596
|
};
|
|
597
|
-
function getTypeCacheKeys$
|
|
597
|
+
function getTypeCacheKeys$3(rootKeySet, luvio, input, fullPathFactory) {
|
|
598
598
|
// root cache key (uses fullPathFactory if keyBuilderFromType isn't defined)
|
|
599
599
|
const rootKey = keyBuilderFromType(luvio, input);
|
|
600
600
|
rootKeySet.set(rootKey, {
|
|
601
601
|
namespace: keyPrefix,
|
|
602
|
-
representationName: RepresentationType$
|
|
602
|
+
representationName: RepresentationType$3,
|
|
603
603
|
mergeable: false
|
|
604
604
|
});
|
|
605
605
|
}
|
|
606
606
|
|
|
607
|
-
function select$
|
|
608
|
-
return select$
|
|
607
|
+
function select$9(luvio, params) {
|
|
608
|
+
return select$a();
|
|
609
609
|
}
|
|
610
|
-
function getResponseCacheKeys$
|
|
611
|
-
getTypeCacheKeys$
|
|
610
|
+
function getResponseCacheKeys$6(storeKeyMap, luvio, resourceParams, response) {
|
|
611
|
+
getTypeCacheKeys$3(storeKeyMap, luvio, response);
|
|
612
612
|
}
|
|
613
|
-
function ingestSuccess$
|
|
613
|
+
function ingestSuccess$5(luvio, resourceParams, response) {
|
|
614
614
|
const { body } = response;
|
|
615
615
|
const key = keyBuilderFromType(luvio, body);
|
|
616
|
-
luvio.storeIngest(key, ingest$
|
|
616
|
+
luvio.storeIngest(key, ingest$3, body);
|
|
617
617
|
const snapshot = luvio.storeLookup({
|
|
618
618
|
recordId: key,
|
|
619
|
-
node: select$
|
|
619
|
+
node: select$9(),
|
|
620
620
|
variables: {},
|
|
621
621
|
});
|
|
622
622
|
if (process.env.NODE_ENV !== 'production') {
|
|
@@ -627,7 +627,7 @@ function ingestSuccess$3(luvio, resourceParams, response) {
|
|
|
627
627
|
deepFreeze(snapshot.data);
|
|
628
628
|
return snapshot;
|
|
629
629
|
}
|
|
630
|
-
function createResourceRequest$
|
|
630
|
+
function createResourceRequest$6(config) {
|
|
631
631
|
const headers = {};
|
|
632
632
|
return {
|
|
633
633
|
baseUri: '/services/data/v64.0',
|
|
@@ -641,7 +641,7 @@ function createResourceRequest$4(config) {
|
|
|
641
641
|
};
|
|
642
642
|
}
|
|
643
643
|
|
|
644
|
-
const adapterName$
|
|
644
|
+
const adapterName$6 = 'createCustomCodeDeployment';
|
|
645
645
|
const createCustomCodeDeployment_ConfigPropertyMetadata = [
|
|
646
646
|
generateParamConfigMetadata('codeType', false, 2 /* Body */, 0 /* String */),
|
|
647
647
|
generateParamConfigMetadata('computeType', true, 2 /* Body */, 0 /* String */),
|
|
@@ -653,11 +653,11 @@ const createCustomCodeDeployment_ConfigPropertyMetadata = [
|
|
|
653
653
|
generateParamConfigMetadata('parameters', false, 2 /* Body */, 4 /* Unsupported */),
|
|
654
654
|
generateParamConfigMetadata('version', true, 2 /* Body */, 0 /* String */),
|
|
655
655
|
];
|
|
656
|
-
const createCustomCodeDeployment_ConfigPropertyNames = /*#__PURE__*/ buildAdapterValidationConfig(adapterName$
|
|
657
|
-
const createResourceParams$
|
|
658
|
-
function typeCheckConfig$
|
|
656
|
+
const createCustomCodeDeployment_ConfigPropertyNames = /*#__PURE__*/ buildAdapterValidationConfig(adapterName$6, createCustomCodeDeployment_ConfigPropertyMetadata);
|
|
657
|
+
const createResourceParams$6 = /*#__PURE__*/ createResourceParams$7(createCustomCodeDeployment_ConfigPropertyMetadata);
|
|
658
|
+
function typeCheckConfig$6(untrustedConfig) {
|
|
659
659
|
const config = {};
|
|
660
|
-
typeCheckConfig$
|
|
660
|
+
typeCheckConfig$7(untrustedConfig, config, createCustomCodeDeployment_ConfigPropertyMetadata);
|
|
661
661
|
const untrustedConfig_parameters = untrustedConfig.parameters;
|
|
662
662
|
if (untrustedIsObject(untrustedConfig_parameters)) {
|
|
663
663
|
const untrustedConfig_parameters_object = {};
|
|
@@ -677,30 +677,30 @@ function typeCheckConfig$4(untrustedConfig) {
|
|
|
677
677
|
}
|
|
678
678
|
return config;
|
|
679
679
|
}
|
|
680
|
-
function validateAdapterConfig$
|
|
680
|
+
function validateAdapterConfig$6(untrustedConfig, configPropertyNames) {
|
|
681
681
|
if (!untrustedIsObject(untrustedConfig)) {
|
|
682
682
|
return null;
|
|
683
683
|
}
|
|
684
684
|
if (process.env.NODE_ENV !== 'production') {
|
|
685
685
|
validateConfig(untrustedConfig, configPropertyNames);
|
|
686
686
|
}
|
|
687
|
-
const config = typeCheckConfig$
|
|
687
|
+
const config = typeCheckConfig$6(untrustedConfig);
|
|
688
688
|
if (!areRequiredParametersPresent(config, configPropertyNames)) {
|
|
689
689
|
return null;
|
|
690
690
|
}
|
|
691
691
|
return config;
|
|
692
692
|
}
|
|
693
|
-
function buildNetworkSnapshot$
|
|
694
|
-
const resourceParams = createResourceParams$
|
|
695
|
-
const request = createResourceRequest$
|
|
693
|
+
function buildNetworkSnapshot$6(luvio, config, options) {
|
|
694
|
+
const resourceParams = createResourceParams$6(config);
|
|
695
|
+
const request = createResourceRequest$6(resourceParams);
|
|
696
696
|
return luvio.dispatchResourceRequest(request, options)
|
|
697
697
|
.then((response) => {
|
|
698
698
|
return luvio.handleSuccessResponse(() => {
|
|
699
|
-
const snapshot = ingestSuccess$
|
|
699
|
+
const snapshot = ingestSuccess$5(luvio, resourceParams, response);
|
|
700
700
|
return luvio.storeBroadcast().then(() => snapshot);
|
|
701
701
|
}, () => {
|
|
702
702
|
const cache = new StoreKeyMap();
|
|
703
|
-
getResponseCacheKeys$
|
|
703
|
+
getResponseCacheKeys$6(cache, luvio, resourceParams, response.body);
|
|
704
704
|
return cache;
|
|
705
705
|
});
|
|
706
706
|
}, (response) => {
|
|
@@ -710,17 +710,17 @@ function buildNetworkSnapshot$4(luvio, config, options) {
|
|
|
710
710
|
}
|
|
711
711
|
const createCustomCodeDeploymentAdapterFactory = (luvio) => {
|
|
712
712
|
return function createCustomCodeDeployment(untrustedConfig) {
|
|
713
|
-
const config = validateAdapterConfig$
|
|
713
|
+
const config = validateAdapterConfig$6(untrustedConfig, createCustomCodeDeployment_ConfigPropertyNames);
|
|
714
714
|
// Invalid or incomplete config
|
|
715
715
|
if (config === null) {
|
|
716
716
|
throw new Error('Invalid config for "createCustomCodeDeployment"');
|
|
717
717
|
}
|
|
718
|
-
return buildNetworkSnapshot$
|
|
718
|
+
return buildNetworkSnapshot$6(luvio, config);
|
|
719
719
|
};
|
|
720
720
|
};
|
|
721
721
|
|
|
722
|
-
const VERSION = "3d9a814ca87df7e7c79c5d385c146820";
|
|
723
|
-
function validate(obj, path = 'CustomCodeDeploymentCollectionRepresentation') {
|
|
722
|
+
const VERSION$3 = "3d9a814ca87df7e7c79c5d385c146820";
|
|
723
|
+
function validate$3(obj, path = 'CustomCodeDeploymentCollectionRepresentation') {
|
|
724
724
|
const v_error = (() => {
|
|
725
725
|
if (typeof obj !== 'object' || ArrayIsArray(obj) || obj === null) {
|
|
726
726
|
return new TypeError('Expected "object" but received "' + typeof obj + '" (at "' + path + '")');
|
|
@@ -757,14 +757,14 @@ function validate(obj, path = 'CustomCodeDeploymentCollectionRepresentation') {
|
|
|
757
757
|
})();
|
|
758
758
|
return v_error === undefined ? null : v_error;
|
|
759
759
|
}
|
|
760
|
-
const RepresentationType = 'CustomCodeDeploymentCollectionRepresentation';
|
|
761
|
-
function normalize(input, existing, path, luvio, store, timestamp) {
|
|
760
|
+
const RepresentationType$2 = 'CustomCodeDeploymentCollectionRepresentation';
|
|
761
|
+
function normalize$2(input, existing, path, luvio, store, timestamp) {
|
|
762
762
|
const input_customCodeDeployments = input.customCodeDeployments;
|
|
763
763
|
const input_customCodeDeployments_id = path.fullPath + '__customCodeDeployments';
|
|
764
764
|
for (let i = 0; i < input_customCodeDeployments.length; i++) {
|
|
765
765
|
const input_customCodeDeployments_item = input_customCodeDeployments[i];
|
|
766
766
|
let input_customCodeDeployments_item_id = input_customCodeDeployments_id + '__' + i;
|
|
767
|
-
input_customCodeDeployments[i] = ingest$
|
|
767
|
+
input_customCodeDeployments[i] = ingest$3(input_customCodeDeployments_item, {
|
|
768
768
|
fullPath: input_customCodeDeployments_item_id,
|
|
769
769
|
propertyName: i,
|
|
770
770
|
parent: {
|
|
@@ -777,10 +777,10 @@ function normalize(input, existing, path, luvio, store, timestamp) {
|
|
|
777
777
|
}
|
|
778
778
|
return input;
|
|
779
779
|
}
|
|
780
|
-
const select$
|
|
780
|
+
const select$8 = function CustomCodeDeploymentCollectionRepresentationSelect() {
|
|
781
781
|
return {
|
|
782
782
|
kind: 'Fragment',
|
|
783
|
-
version: VERSION,
|
|
783
|
+
version: VERSION$3,
|
|
784
784
|
private: [],
|
|
785
785
|
selections: [
|
|
786
786
|
{
|
|
@@ -791,7 +791,7 @@ const select$3 = function CustomCodeDeploymentCollectionRepresentationSelect() {
|
|
|
791
791
|
name: 'customCodeDeployments',
|
|
792
792
|
kind: 'Link',
|
|
793
793
|
plural: true,
|
|
794
|
-
fragment: select$
|
|
794
|
+
fragment: select$a()
|
|
795
795
|
},
|
|
796
796
|
{
|
|
797
797
|
name: 'nextPageUrl',
|
|
@@ -805,7 +805,7 @@ const select$3 = function CustomCodeDeploymentCollectionRepresentationSelect() {
|
|
|
805
805
|
]
|
|
806
806
|
};
|
|
807
807
|
};
|
|
808
|
-
function equals(existing, incoming) {
|
|
808
|
+
function equals$3(existing, incoming) {
|
|
809
809
|
const existing_totalSize = existing.totalSize;
|
|
810
810
|
const incoming_totalSize = incoming.totalSize;
|
|
811
811
|
if (!(existing_totalSize === incoming_totalSize)) {
|
|
@@ -841,48 +841,48 @@ function equals(existing, incoming) {
|
|
|
841
841
|
}
|
|
842
842
|
return true;
|
|
843
843
|
}
|
|
844
|
-
const ingest = function CustomCodeDeploymentCollectionRepresentationIngest(input, path, luvio, store, timestamp) {
|
|
844
|
+
const ingest$2 = function CustomCodeDeploymentCollectionRepresentationIngest(input, path, luvio, store, timestamp) {
|
|
845
845
|
if (process.env.NODE_ENV !== 'production') {
|
|
846
|
-
const validateError = validate(input);
|
|
846
|
+
const validateError = validate$3(input);
|
|
847
847
|
if (validateError !== null) {
|
|
848
848
|
throw validateError;
|
|
849
849
|
}
|
|
850
850
|
}
|
|
851
851
|
const key = path.fullPath;
|
|
852
852
|
const ttlToUse = path.ttl !== undefined ? path.ttl : 60000;
|
|
853
|
-
ingestShape(input, path, luvio, store, timestamp, ttlToUse, key, normalize, "byoc", VERSION, RepresentationType, equals);
|
|
853
|
+
ingestShape(input, path, luvio, store, timestamp, ttlToUse, key, normalize$2, "byoc", VERSION$3, RepresentationType$2, equals$3);
|
|
854
854
|
return createLink(key);
|
|
855
855
|
};
|
|
856
|
-
function getTypeCacheKeys(rootKeySet, luvio, input, fullPathFactory) {
|
|
856
|
+
function getTypeCacheKeys$2(rootKeySet, luvio, input, fullPathFactory) {
|
|
857
857
|
// root cache key (uses fullPathFactory if keyBuilderFromType isn't defined)
|
|
858
858
|
const rootKey = fullPathFactory();
|
|
859
859
|
rootKeySet.set(rootKey, {
|
|
860
860
|
namespace: keyPrefix,
|
|
861
|
-
representationName: RepresentationType,
|
|
861
|
+
representationName: RepresentationType$2,
|
|
862
862
|
mergeable: false
|
|
863
863
|
});
|
|
864
864
|
const input_customCodeDeployments_length = input.customCodeDeployments.length;
|
|
865
865
|
for (let i = 0; i < input_customCodeDeployments_length; i++) {
|
|
866
|
-
getTypeCacheKeys$
|
|
866
|
+
getTypeCacheKeys$3(rootKeySet, luvio, input.customCodeDeployments[i]);
|
|
867
867
|
}
|
|
868
868
|
}
|
|
869
869
|
|
|
870
|
-
function select$
|
|
871
|
-
return select$
|
|
870
|
+
function select$7(luvio, params) {
|
|
871
|
+
return select$8();
|
|
872
872
|
}
|
|
873
|
-
function keyBuilder$
|
|
874
|
-
return keyPrefix + '::CustomCodeDeploymentCollectionRepresentation:(' + 'limit:' + params.queryParams.limit + ',' + 'offset:' + params.queryParams.offset + ',' + 'orderBy:' + params.queryParams.orderBy + ')';
|
|
873
|
+
function keyBuilder$8(luvio, params) {
|
|
874
|
+
return keyPrefix + '::CustomCodeDeploymentCollectionRepresentation:(' + 'codeType:' + params.queryParams.codeType + ',' + 'deploymentStatus:' + params.queryParams.deploymentStatus + ',' + 'limit:' + params.queryParams.limit + ',' + 'offset:' + params.queryParams.offset + ',' + 'orderBy:' + params.queryParams.orderBy + ')';
|
|
875
875
|
}
|
|
876
|
-
function getResponseCacheKeys$
|
|
877
|
-
getTypeCacheKeys(storeKeyMap, luvio, response, () => keyBuilder$
|
|
876
|
+
function getResponseCacheKeys$5(storeKeyMap, luvio, resourceParams, response) {
|
|
877
|
+
getTypeCacheKeys$2(storeKeyMap, luvio, response, () => keyBuilder$8(luvio, resourceParams));
|
|
878
878
|
}
|
|
879
|
-
function ingestSuccess$
|
|
879
|
+
function ingestSuccess$4(luvio, resourceParams, response, snapshotRefresh) {
|
|
880
880
|
const { body } = response;
|
|
881
|
-
const key = keyBuilder$
|
|
882
|
-
luvio.storeIngest(key, ingest, body);
|
|
881
|
+
const key = keyBuilder$8(luvio, resourceParams);
|
|
882
|
+
luvio.storeIngest(key, ingest$2, body);
|
|
883
883
|
const snapshot = luvio.storeLookup({
|
|
884
884
|
recordId: key,
|
|
885
|
-
node: select$
|
|
885
|
+
node: select$7(),
|
|
886
886
|
variables: {},
|
|
887
887
|
}, snapshotRefresh);
|
|
888
888
|
if (process.env.NODE_ENV !== 'production') {
|
|
@@ -893,13 +893,13 @@ function ingestSuccess$2(luvio, resourceParams, response, snapshotRefresh) {
|
|
|
893
893
|
deepFreeze(snapshot.data);
|
|
894
894
|
return snapshot;
|
|
895
895
|
}
|
|
896
|
-
function ingestError$
|
|
897
|
-
const key = keyBuilder$
|
|
896
|
+
function ingestError$3(luvio, params, error, snapshotRefresh) {
|
|
897
|
+
const key = keyBuilder$8(luvio, params);
|
|
898
898
|
const errorSnapshot = luvio.errorSnapshot(error, snapshotRefresh);
|
|
899
899
|
luvio.storeIngestError(key, errorSnapshot);
|
|
900
900
|
return errorSnapshot;
|
|
901
901
|
}
|
|
902
|
-
function createResourceRequest$
|
|
902
|
+
function createResourceRequest$5(config) {
|
|
903
903
|
const headers = {};
|
|
904
904
|
return {
|
|
905
905
|
baseUri: '/services/data/v64.0',
|
|
@@ -913,112 +913,114 @@ function createResourceRequest$3(config) {
|
|
|
913
913
|
};
|
|
914
914
|
}
|
|
915
915
|
|
|
916
|
-
const adapterName$
|
|
916
|
+
const adapterName$5 = 'getCustomCodeDeployments';
|
|
917
917
|
const getCustomCodeDeployments_ConfigPropertyMetadata = [
|
|
918
|
+
generateParamConfigMetadata('codeType', false, 1 /* QueryParameter */, 0 /* String */),
|
|
919
|
+
generateParamConfigMetadata('deploymentStatus', false, 1 /* QueryParameter */, 0 /* String */),
|
|
918
920
|
generateParamConfigMetadata('limit', false, 1 /* QueryParameter */, 3 /* Integer */),
|
|
919
921
|
generateParamConfigMetadata('offset', false, 1 /* QueryParameter */, 3 /* Integer */),
|
|
920
922
|
generateParamConfigMetadata('orderBy', false, 1 /* QueryParameter */, 0 /* String */),
|
|
921
923
|
];
|
|
922
|
-
const getCustomCodeDeployments_ConfigPropertyNames = /*#__PURE__*/ buildAdapterValidationConfig(adapterName$
|
|
923
|
-
const createResourceParams$
|
|
924
|
-
function keyBuilder$
|
|
925
|
-
const resourceParams = createResourceParams$
|
|
926
|
-
return keyBuilder$
|
|
924
|
+
const getCustomCodeDeployments_ConfigPropertyNames = /*#__PURE__*/ buildAdapterValidationConfig(adapterName$5, getCustomCodeDeployments_ConfigPropertyMetadata);
|
|
925
|
+
const createResourceParams$5 = /*#__PURE__*/ createResourceParams$7(getCustomCodeDeployments_ConfigPropertyMetadata);
|
|
926
|
+
function keyBuilder$7(luvio, config) {
|
|
927
|
+
const resourceParams = createResourceParams$5(config);
|
|
928
|
+
return keyBuilder$8(luvio, resourceParams);
|
|
927
929
|
}
|
|
928
|
-
function typeCheckConfig$
|
|
930
|
+
function typeCheckConfig$5(untrustedConfig) {
|
|
929
931
|
const config = {};
|
|
930
|
-
typeCheckConfig$
|
|
932
|
+
typeCheckConfig$7(untrustedConfig, config, getCustomCodeDeployments_ConfigPropertyMetadata);
|
|
931
933
|
return config;
|
|
932
934
|
}
|
|
933
|
-
function validateAdapterConfig$
|
|
935
|
+
function validateAdapterConfig$5(untrustedConfig, configPropertyNames) {
|
|
934
936
|
if (!untrustedIsObject(untrustedConfig)) {
|
|
935
937
|
return null;
|
|
936
938
|
}
|
|
937
939
|
if (process.env.NODE_ENV !== 'production') {
|
|
938
940
|
validateConfig(untrustedConfig, configPropertyNames);
|
|
939
941
|
}
|
|
940
|
-
const config = typeCheckConfig$
|
|
942
|
+
const config = typeCheckConfig$5(untrustedConfig);
|
|
941
943
|
if (!areRequiredParametersPresent(config, configPropertyNames)) {
|
|
942
944
|
return null;
|
|
943
945
|
}
|
|
944
946
|
return config;
|
|
945
947
|
}
|
|
946
|
-
function adapterFragment$
|
|
947
|
-
createResourceParams$
|
|
948
|
-
return select$
|
|
948
|
+
function adapterFragment$3(luvio, config) {
|
|
949
|
+
createResourceParams$5(config);
|
|
950
|
+
return select$7();
|
|
949
951
|
}
|
|
950
|
-
function onFetchResponseSuccess$
|
|
951
|
-
const snapshot = ingestSuccess$
|
|
952
|
+
function onFetchResponseSuccess$3(luvio, config, resourceParams, response) {
|
|
953
|
+
const snapshot = ingestSuccess$4(luvio, resourceParams, response, {
|
|
952
954
|
config,
|
|
953
|
-
resolve: () => buildNetworkSnapshot$
|
|
955
|
+
resolve: () => buildNetworkSnapshot$5(luvio, config, snapshotRefreshOptions)
|
|
954
956
|
});
|
|
955
957
|
return luvio.storeBroadcast().then(() => snapshot);
|
|
956
958
|
}
|
|
957
|
-
function onFetchResponseError$
|
|
958
|
-
const snapshot = ingestError$
|
|
959
|
+
function onFetchResponseError$3(luvio, config, resourceParams, response) {
|
|
960
|
+
const snapshot = ingestError$3(luvio, resourceParams, response, {
|
|
959
961
|
config,
|
|
960
|
-
resolve: () => buildNetworkSnapshot$
|
|
962
|
+
resolve: () => buildNetworkSnapshot$5(luvio, config, snapshotRefreshOptions)
|
|
961
963
|
});
|
|
962
964
|
return luvio.storeBroadcast().then(() => snapshot);
|
|
963
965
|
}
|
|
964
|
-
function buildNetworkSnapshot$
|
|
965
|
-
const resourceParams = createResourceParams$
|
|
966
|
-
const request = createResourceRequest$
|
|
966
|
+
function buildNetworkSnapshot$5(luvio, config, options) {
|
|
967
|
+
const resourceParams = createResourceParams$5(config);
|
|
968
|
+
const request = createResourceRequest$5(resourceParams);
|
|
967
969
|
return luvio.dispatchResourceRequest(request, options)
|
|
968
970
|
.then((response) => {
|
|
969
|
-
return luvio.handleSuccessResponse(() => onFetchResponseSuccess$
|
|
971
|
+
return luvio.handleSuccessResponse(() => onFetchResponseSuccess$3(luvio, config, resourceParams, response), () => {
|
|
970
972
|
const cache = new StoreKeyMap();
|
|
971
|
-
getResponseCacheKeys$
|
|
973
|
+
getResponseCacheKeys$5(cache, luvio, resourceParams, response.body);
|
|
972
974
|
return cache;
|
|
973
975
|
});
|
|
974
976
|
}, (response) => {
|
|
975
|
-
return luvio.handleErrorResponse(() => onFetchResponseError$
|
|
977
|
+
return luvio.handleErrorResponse(() => onFetchResponseError$3(luvio, config, resourceParams, response));
|
|
976
978
|
});
|
|
977
979
|
}
|
|
978
|
-
function buildNetworkSnapshotCachePolicy$
|
|
979
|
-
return buildNetworkSnapshotCachePolicy$
|
|
980
|
+
function buildNetworkSnapshotCachePolicy$3(context, coercedAdapterRequestContext) {
|
|
981
|
+
return buildNetworkSnapshotCachePolicy$4(context, coercedAdapterRequestContext, buildNetworkSnapshot$5, undefined, false);
|
|
980
982
|
}
|
|
981
|
-
function buildCachedSnapshotCachePolicy$
|
|
983
|
+
function buildCachedSnapshotCachePolicy$3(context, storeLookup) {
|
|
982
984
|
const { luvio, config } = context;
|
|
983
985
|
const selector = {
|
|
984
|
-
recordId: keyBuilder$
|
|
985
|
-
node: adapterFragment$
|
|
986
|
+
recordId: keyBuilder$7(luvio, config),
|
|
987
|
+
node: adapterFragment$3(luvio, config),
|
|
986
988
|
variables: {},
|
|
987
989
|
};
|
|
988
990
|
const cacheSnapshot = storeLookup(selector, {
|
|
989
991
|
config,
|
|
990
|
-
resolve: () => buildNetworkSnapshot$
|
|
992
|
+
resolve: () => buildNetworkSnapshot$5(luvio, config, snapshotRefreshOptions)
|
|
991
993
|
});
|
|
992
994
|
return cacheSnapshot;
|
|
993
995
|
}
|
|
994
996
|
const getCustomCodeDeploymentsAdapterFactory = (luvio) => function byoc__getCustomCodeDeployments(untrustedConfig, requestContext) {
|
|
995
|
-
const config = validateAdapterConfig$
|
|
997
|
+
const config = validateAdapterConfig$5(untrustedConfig, getCustomCodeDeployments_ConfigPropertyNames);
|
|
996
998
|
// Invalid or incomplete config
|
|
997
999
|
if (config === null) {
|
|
998
1000
|
return null;
|
|
999
1001
|
}
|
|
1000
1002
|
return luvio.applyCachePolicy((requestContext || {}), { config, luvio }, // BuildSnapshotContext
|
|
1001
|
-
buildCachedSnapshotCachePolicy$
|
|
1003
|
+
buildCachedSnapshotCachePolicy$3, buildNetworkSnapshotCachePolicy$3);
|
|
1002
1004
|
};
|
|
1003
1005
|
|
|
1004
|
-
function keyBuilder$
|
|
1005
|
-
return keyBuilder$
|
|
1006
|
+
function keyBuilder$6(luvio, params) {
|
|
1007
|
+
return keyBuilder$9(luvio, {
|
|
1006
1008
|
id: params.urlParams.customCodeNameOrId
|
|
1007
1009
|
});
|
|
1008
1010
|
}
|
|
1009
|
-
function getResponseCacheKeys$
|
|
1010
|
-
const key = keyBuilder$
|
|
1011
|
+
function getResponseCacheKeys$4(cacheKeyMap, luvio, resourceParams) {
|
|
1012
|
+
const key = keyBuilder$6(luvio, resourceParams);
|
|
1011
1013
|
cacheKeyMap.set(key, {
|
|
1012
1014
|
namespace: keyPrefix,
|
|
1013
|
-
representationName: RepresentationType$
|
|
1015
|
+
representationName: RepresentationType$3,
|
|
1014
1016
|
mergeable: false
|
|
1015
1017
|
});
|
|
1016
1018
|
}
|
|
1017
1019
|
function evictSuccess(luvio, resourceParams) {
|
|
1018
|
-
const key = keyBuilder$
|
|
1020
|
+
const key = keyBuilder$6(luvio, resourceParams);
|
|
1019
1021
|
luvio.storeEvict(key);
|
|
1020
1022
|
}
|
|
1021
|
-
function createResourceRequest$
|
|
1023
|
+
function createResourceRequest$4(config) {
|
|
1022
1024
|
const headers = {};
|
|
1023
1025
|
return {
|
|
1024
1026
|
baseUri: '/services/data/v64.0',
|
|
@@ -1032,33 +1034,33 @@ function createResourceRequest$2(config) {
|
|
|
1032
1034
|
};
|
|
1033
1035
|
}
|
|
1034
1036
|
|
|
1035
|
-
const adapterName$
|
|
1037
|
+
const adapterName$4 = 'deleteCustomCodeDeployment';
|
|
1036
1038
|
const deleteCustomCodeDeployment_ConfigPropertyMetadata = [
|
|
1037
1039
|
generateParamConfigMetadata('customCodeNameOrId', true, 0 /* UrlParameter */, 0 /* String */),
|
|
1038
1040
|
];
|
|
1039
|
-
const deleteCustomCodeDeployment_ConfigPropertyNames = /*#__PURE__*/ buildAdapterValidationConfig(adapterName$
|
|
1040
|
-
const createResourceParams$
|
|
1041
|
-
function typeCheckConfig$
|
|
1041
|
+
const deleteCustomCodeDeployment_ConfigPropertyNames = /*#__PURE__*/ buildAdapterValidationConfig(adapterName$4, deleteCustomCodeDeployment_ConfigPropertyMetadata);
|
|
1042
|
+
const createResourceParams$4 = /*#__PURE__*/ createResourceParams$7(deleteCustomCodeDeployment_ConfigPropertyMetadata);
|
|
1043
|
+
function typeCheckConfig$4(untrustedConfig) {
|
|
1042
1044
|
const config = {};
|
|
1043
|
-
typeCheckConfig$
|
|
1045
|
+
typeCheckConfig$7(untrustedConfig, config, deleteCustomCodeDeployment_ConfigPropertyMetadata);
|
|
1044
1046
|
return config;
|
|
1045
1047
|
}
|
|
1046
|
-
function validateAdapterConfig$
|
|
1048
|
+
function validateAdapterConfig$4(untrustedConfig, configPropertyNames) {
|
|
1047
1049
|
if (!untrustedIsObject(untrustedConfig)) {
|
|
1048
1050
|
return null;
|
|
1049
1051
|
}
|
|
1050
1052
|
if (process.env.NODE_ENV !== 'production') {
|
|
1051
1053
|
validateConfig(untrustedConfig, configPropertyNames);
|
|
1052
1054
|
}
|
|
1053
|
-
const config = typeCheckConfig$
|
|
1055
|
+
const config = typeCheckConfig$4(untrustedConfig);
|
|
1054
1056
|
if (!areRequiredParametersPresent(config, configPropertyNames)) {
|
|
1055
1057
|
return null;
|
|
1056
1058
|
}
|
|
1057
1059
|
return config;
|
|
1058
1060
|
}
|
|
1059
|
-
function buildNetworkSnapshot$
|
|
1060
|
-
const resourceParams = createResourceParams$
|
|
1061
|
-
const request = createResourceRequest$
|
|
1061
|
+
function buildNetworkSnapshot$4(luvio, config, options) {
|
|
1062
|
+
const resourceParams = createResourceParams$4(config);
|
|
1063
|
+
const request = createResourceRequest$4(resourceParams);
|
|
1062
1064
|
return luvio.dispatchResourceRequest(request, options)
|
|
1063
1065
|
.then(() => {
|
|
1064
1066
|
return luvio.handleSuccessResponse(() => {
|
|
@@ -1066,7 +1068,7 @@ function buildNetworkSnapshot$2(luvio, config, options) {
|
|
|
1066
1068
|
return luvio.storeBroadcast();
|
|
1067
1069
|
}, () => {
|
|
1068
1070
|
const cache = new StoreKeyMap();
|
|
1069
|
-
getResponseCacheKeys$
|
|
1071
|
+
getResponseCacheKeys$4(cache, luvio, resourceParams);
|
|
1070
1072
|
return cache;
|
|
1071
1073
|
});
|
|
1072
1074
|
}, (response) => {
|
|
@@ -1076,33 +1078,33 @@ function buildNetworkSnapshot$2(luvio, config, options) {
|
|
|
1076
1078
|
}
|
|
1077
1079
|
const deleteCustomCodeDeploymentAdapterFactory = (luvio) => {
|
|
1078
1080
|
return function byocdeleteCustomCodeDeployment(untrustedConfig) {
|
|
1079
|
-
const config = validateAdapterConfig$
|
|
1081
|
+
const config = validateAdapterConfig$4(untrustedConfig, deleteCustomCodeDeployment_ConfigPropertyNames);
|
|
1080
1082
|
// Invalid or incomplete config
|
|
1081
1083
|
if (config === null) {
|
|
1082
|
-
throw new Error(`Invalid config for "${adapterName$
|
|
1084
|
+
throw new Error(`Invalid config for "${adapterName$4}"`);
|
|
1083
1085
|
}
|
|
1084
|
-
return buildNetworkSnapshot$
|
|
1086
|
+
return buildNetworkSnapshot$4(luvio, config);
|
|
1085
1087
|
};
|
|
1086
1088
|
};
|
|
1087
1089
|
|
|
1088
|
-
function select$
|
|
1089
|
-
return select$
|
|
1090
|
+
function select$6(luvio, params) {
|
|
1091
|
+
return select$a();
|
|
1090
1092
|
}
|
|
1091
|
-
function keyBuilder$
|
|
1092
|
-
return keyBuilder$
|
|
1093
|
+
function keyBuilder$5(luvio, params) {
|
|
1094
|
+
return keyBuilder$9(luvio, {
|
|
1093
1095
|
id: params.urlParams.customCodeNameOrId
|
|
1094
1096
|
});
|
|
1095
1097
|
}
|
|
1096
|
-
function getResponseCacheKeys$
|
|
1097
|
-
getTypeCacheKeys$
|
|
1098
|
+
function getResponseCacheKeys$3(storeKeyMap, luvio, resourceParams, response) {
|
|
1099
|
+
getTypeCacheKeys$3(storeKeyMap, luvio, response);
|
|
1098
1100
|
}
|
|
1099
|
-
function ingestSuccess$
|
|
1101
|
+
function ingestSuccess$3(luvio, resourceParams, response, snapshotRefresh) {
|
|
1100
1102
|
const { body } = response;
|
|
1101
|
-
const key = keyBuilder$
|
|
1102
|
-
luvio.storeIngest(key, ingest$
|
|
1103
|
+
const key = keyBuilder$5(luvio, resourceParams);
|
|
1104
|
+
luvio.storeIngest(key, ingest$3, body);
|
|
1103
1105
|
const snapshot = luvio.storeLookup({
|
|
1104
1106
|
recordId: key,
|
|
1105
|
-
node: select$
|
|
1107
|
+
node: select$6(),
|
|
1106
1108
|
variables: {},
|
|
1107
1109
|
}, snapshotRefresh);
|
|
1108
1110
|
if (process.env.NODE_ENV !== 'production') {
|
|
@@ -1113,13 +1115,13 @@ function ingestSuccess$1(luvio, resourceParams, response, snapshotRefresh) {
|
|
|
1113
1115
|
deepFreeze(snapshot.data);
|
|
1114
1116
|
return snapshot;
|
|
1115
1117
|
}
|
|
1116
|
-
function ingestError(luvio, params, error, snapshotRefresh) {
|
|
1117
|
-
const key = keyBuilder$
|
|
1118
|
+
function ingestError$2(luvio, params, error, snapshotRefresh) {
|
|
1119
|
+
const key = keyBuilder$5(luvio, params);
|
|
1118
1120
|
const errorSnapshot = luvio.errorSnapshot(error, snapshotRefresh);
|
|
1119
1121
|
luvio.storeIngestError(key, errorSnapshot);
|
|
1120
1122
|
return errorSnapshot;
|
|
1121
1123
|
}
|
|
1122
|
-
function createResourceRequest$
|
|
1124
|
+
function createResourceRequest$3(config) {
|
|
1123
1125
|
const headers = {};
|
|
1124
1126
|
return {
|
|
1125
1127
|
baseUri: '/services/data/v64.0',
|
|
@@ -1133,105 +1135,105 @@ function createResourceRequest$1(config) {
|
|
|
1133
1135
|
};
|
|
1134
1136
|
}
|
|
1135
1137
|
|
|
1136
|
-
const adapterName$
|
|
1138
|
+
const adapterName$3 = 'getCustomCodeDeployment';
|
|
1137
1139
|
const getCustomCodeDeployment_ConfigPropertyMetadata = [
|
|
1138
1140
|
generateParamConfigMetadata('customCodeNameOrId', true, 0 /* UrlParameter */, 0 /* String */),
|
|
1139
1141
|
];
|
|
1140
|
-
const getCustomCodeDeployment_ConfigPropertyNames = /*#__PURE__*/ buildAdapterValidationConfig(adapterName$
|
|
1141
|
-
const createResourceParams$
|
|
1142
|
-
function keyBuilder(luvio, config) {
|
|
1143
|
-
const resourceParams = createResourceParams$
|
|
1144
|
-
return keyBuilder$
|
|
1142
|
+
const getCustomCodeDeployment_ConfigPropertyNames = /*#__PURE__*/ buildAdapterValidationConfig(adapterName$3, getCustomCodeDeployment_ConfigPropertyMetadata);
|
|
1143
|
+
const createResourceParams$3 = /*#__PURE__*/ createResourceParams$7(getCustomCodeDeployment_ConfigPropertyMetadata);
|
|
1144
|
+
function keyBuilder$4(luvio, config) {
|
|
1145
|
+
const resourceParams = createResourceParams$3(config);
|
|
1146
|
+
return keyBuilder$5(luvio, resourceParams);
|
|
1145
1147
|
}
|
|
1146
|
-
function typeCheckConfig$
|
|
1148
|
+
function typeCheckConfig$3(untrustedConfig) {
|
|
1147
1149
|
const config = {};
|
|
1148
|
-
typeCheckConfig$
|
|
1150
|
+
typeCheckConfig$7(untrustedConfig, config, getCustomCodeDeployment_ConfigPropertyMetadata);
|
|
1149
1151
|
return config;
|
|
1150
1152
|
}
|
|
1151
|
-
function validateAdapterConfig$
|
|
1153
|
+
function validateAdapterConfig$3(untrustedConfig, configPropertyNames) {
|
|
1152
1154
|
if (!untrustedIsObject(untrustedConfig)) {
|
|
1153
1155
|
return null;
|
|
1154
1156
|
}
|
|
1155
1157
|
if (process.env.NODE_ENV !== 'production') {
|
|
1156
1158
|
validateConfig(untrustedConfig, configPropertyNames);
|
|
1157
1159
|
}
|
|
1158
|
-
const config = typeCheckConfig$
|
|
1160
|
+
const config = typeCheckConfig$3(untrustedConfig);
|
|
1159
1161
|
if (!areRequiredParametersPresent(config, configPropertyNames)) {
|
|
1160
1162
|
return null;
|
|
1161
1163
|
}
|
|
1162
1164
|
return config;
|
|
1163
1165
|
}
|
|
1164
|
-
function adapterFragment(luvio, config) {
|
|
1165
|
-
createResourceParams$
|
|
1166
|
-
return select$
|
|
1166
|
+
function adapterFragment$2(luvio, config) {
|
|
1167
|
+
createResourceParams$3(config);
|
|
1168
|
+
return select$6();
|
|
1167
1169
|
}
|
|
1168
|
-
function onFetchResponseSuccess(luvio, config, resourceParams, response) {
|
|
1169
|
-
const snapshot = ingestSuccess$
|
|
1170
|
+
function onFetchResponseSuccess$2(luvio, config, resourceParams, response) {
|
|
1171
|
+
const snapshot = ingestSuccess$3(luvio, resourceParams, response, {
|
|
1170
1172
|
config,
|
|
1171
|
-
resolve: () => buildNetworkSnapshot$
|
|
1173
|
+
resolve: () => buildNetworkSnapshot$3(luvio, config, snapshotRefreshOptions)
|
|
1172
1174
|
});
|
|
1173
1175
|
return luvio.storeBroadcast().then(() => snapshot);
|
|
1174
1176
|
}
|
|
1175
|
-
function onFetchResponseError(luvio, config, resourceParams, response) {
|
|
1176
|
-
const snapshot = ingestError(luvio, resourceParams, response, {
|
|
1177
|
+
function onFetchResponseError$2(luvio, config, resourceParams, response) {
|
|
1178
|
+
const snapshot = ingestError$2(luvio, resourceParams, response, {
|
|
1177
1179
|
config,
|
|
1178
|
-
resolve: () => buildNetworkSnapshot$
|
|
1180
|
+
resolve: () => buildNetworkSnapshot$3(luvio, config, snapshotRefreshOptions)
|
|
1179
1181
|
});
|
|
1180
1182
|
return luvio.storeBroadcast().then(() => snapshot);
|
|
1181
1183
|
}
|
|
1182
|
-
function buildNetworkSnapshot$
|
|
1183
|
-
const resourceParams = createResourceParams$
|
|
1184
|
-
const request = createResourceRequest$
|
|
1184
|
+
function buildNetworkSnapshot$3(luvio, config, options) {
|
|
1185
|
+
const resourceParams = createResourceParams$3(config);
|
|
1186
|
+
const request = createResourceRequest$3(resourceParams);
|
|
1185
1187
|
return luvio.dispatchResourceRequest(request, options)
|
|
1186
1188
|
.then((response) => {
|
|
1187
|
-
return luvio.handleSuccessResponse(() => onFetchResponseSuccess(luvio, config, resourceParams, response), () => {
|
|
1189
|
+
return luvio.handleSuccessResponse(() => onFetchResponseSuccess$2(luvio, config, resourceParams, response), () => {
|
|
1188
1190
|
const cache = new StoreKeyMap();
|
|
1189
|
-
getResponseCacheKeys$
|
|
1191
|
+
getResponseCacheKeys$3(cache, luvio, resourceParams, response.body);
|
|
1190
1192
|
return cache;
|
|
1191
1193
|
});
|
|
1192
1194
|
}, (response) => {
|
|
1193
|
-
return luvio.handleErrorResponse(() => onFetchResponseError(luvio, config, resourceParams, response));
|
|
1195
|
+
return luvio.handleErrorResponse(() => onFetchResponseError$2(luvio, config, resourceParams, response));
|
|
1194
1196
|
});
|
|
1195
1197
|
}
|
|
1196
|
-
function buildNetworkSnapshotCachePolicy(context, coercedAdapterRequestContext) {
|
|
1197
|
-
return buildNetworkSnapshotCachePolicy$
|
|
1198
|
+
function buildNetworkSnapshotCachePolicy$2(context, coercedAdapterRequestContext) {
|
|
1199
|
+
return buildNetworkSnapshotCachePolicy$4(context, coercedAdapterRequestContext, buildNetworkSnapshot$3, undefined, false);
|
|
1198
1200
|
}
|
|
1199
|
-
function buildCachedSnapshotCachePolicy(context, storeLookup) {
|
|
1201
|
+
function buildCachedSnapshotCachePolicy$2(context, storeLookup) {
|
|
1200
1202
|
const { luvio, config } = context;
|
|
1201
1203
|
const selector = {
|
|
1202
|
-
recordId: keyBuilder(luvio, config),
|
|
1203
|
-
node: adapterFragment(luvio, config),
|
|
1204
|
+
recordId: keyBuilder$4(luvio, config),
|
|
1205
|
+
node: adapterFragment$2(luvio, config),
|
|
1204
1206
|
variables: {},
|
|
1205
1207
|
};
|
|
1206
1208
|
const cacheSnapshot = storeLookup(selector, {
|
|
1207
1209
|
config,
|
|
1208
|
-
resolve: () => buildNetworkSnapshot$
|
|
1210
|
+
resolve: () => buildNetworkSnapshot$3(luvio, config, snapshotRefreshOptions)
|
|
1209
1211
|
});
|
|
1210
1212
|
return cacheSnapshot;
|
|
1211
1213
|
}
|
|
1212
1214
|
const getCustomCodeDeploymentAdapterFactory = (luvio) => function byoc__getCustomCodeDeployment(untrustedConfig, requestContext) {
|
|
1213
|
-
const config = validateAdapterConfig$
|
|
1215
|
+
const config = validateAdapterConfig$3(untrustedConfig, getCustomCodeDeployment_ConfigPropertyNames);
|
|
1214
1216
|
// Invalid or incomplete config
|
|
1215
1217
|
if (config === null) {
|
|
1216
1218
|
return null;
|
|
1217
1219
|
}
|
|
1218
1220
|
return luvio.applyCachePolicy((requestContext || {}), { config, luvio }, // BuildSnapshotContext
|
|
1219
|
-
buildCachedSnapshotCachePolicy, buildNetworkSnapshotCachePolicy);
|
|
1221
|
+
buildCachedSnapshotCachePolicy$2, buildNetworkSnapshotCachePolicy$2);
|
|
1220
1222
|
};
|
|
1221
1223
|
|
|
1222
|
-
function select(luvio, params) {
|
|
1223
|
-
return select$
|
|
1224
|
+
function select$5(luvio, params) {
|
|
1225
|
+
return select$a();
|
|
1224
1226
|
}
|
|
1225
|
-
function getResponseCacheKeys(storeKeyMap, luvio, resourceParams, response) {
|
|
1226
|
-
getTypeCacheKeys$
|
|
1227
|
+
function getResponseCacheKeys$2(storeKeyMap, luvio, resourceParams, response) {
|
|
1228
|
+
getTypeCacheKeys$3(storeKeyMap, luvio, response);
|
|
1227
1229
|
}
|
|
1228
|
-
function ingestSuccess(luvio, resourceParams, response) {
|
|
1230
|
+
function ingestSuccess$2(luvio, resourceParams, response) {
|
|
1229
1231
|
const { body } = response;
|
|
1230
1232
|
const key = keyBuilderFromType(luvio, body);
|
|
1231
|
-
luvio.storeIngest(key, ingest$
|
|
1233
|
+
luvio.storeIngest(key, ingest$3, body);
|
|
1232
1234
|
const snapshot = luvio.storeLookup({
|
|
1233
1235
|
recordId: key,
|
|
1234
|
-
node: select(),
|
|
1236
|
+
node: select$5(),
|
|
1235
1237
|
variables: {},
|
|
1236
1238
|
});
|
|
1237
1239
|
if (process.env.NODE_ENV !== 'production') {
|
|
@@ -1242,7 +1244,7 @@ function ingestSuccess(luvio, resourceParams, response) {
|
|
|
1242
1244
|
deepFreeze(snapshot.data);
|
|
1243
1245
|
return snapshot;
|
|
1244
1246
|
}
|
|
1245
|
-
function createResourceRequest(config) {
|
|
1247
|
+
function createResourceRequest$2(config) {
|
|
1246
1248
|
const headers = {};
|
|
1247
1249
|
return {
|
|
1248
1250
|
baseUri: '/services/data/v64.0',
|
|
@@ -1256,7 +1258,7 @@ function createResourceRequest(config) {
|
|
|
1256
1258
|
};
|
|
1257
1259
|
}
|
|
1258
1260
|
|
|
1259
|
-
const adapterName = 'updateCustomCodeDeployment';
|
|
1261
|
+
const adapterName$2 = 'updateCustomCodeDeployment';
|
|
1260
1262
|
const updateCustomCodeDeployment_ConfigPropertyMetadata = [
|
|
1261
1263
|
generateParamConfigMetadata('customCodeNameOrId', true, 0 /* UrlParameter */, 0 /* String */),
|
|
1262
1264
|
generateParamConfigMetadata('computeType', false, 2 /* Body */, 0 /* String */),
|
|
@@ -1264,37 +1266,37 @@ const updateCustomCodeDeployment_ConfigPropertyMetadata = [
|
|
|
1264
1266
|
generateParamConfigMetadata('label', false, 2 /* Body */, 0 /* String */),
|
|
1265
1267
|
generateParamConfigMetadata('version', false, 2 /* Body */, 0 /* String */),
|
|
1266
1268
|
];
|
|
1267
|
-
const updateCustomCodeDeployment_ConfigPropertyNames = /*#__PURE__*/ buildAdapterValidationConfig(adapterName, updateCustomCodeDeployment_ConfigPropertyMetadata);
|
|
1268
|
-
const createResourceParams = /*#__PURE__*/ createResourceParams$
|
|
1269
|
-
function typeCheckConfig(untrustedConfig) {
|
|
1269
|
+
const updateCustomCodeDeployment_ConfigPropertyNames = /*#__PURE__*/ buildAdapterValidationConfig(adapterName$2, updateCustomCodeDeployment_ConfigPropertyMetadata);
|
|
1270
|
+
const createResourceParams$2 = /*#__PURE__*/ createResourceParams$7(updateCustomCodeDeployment_ConfigPropertyMetadata);
|
|
1271
|
+
function typeCheckConfig$2(untrustedConfig) {
|
|
1270
1272
|
const config = {};
|
|
1271
|
-
typeCheckConfig$
|
|
1273
|
+
typeCheckConfig$7(untrustedConfig, config, updateCustomCodeDeployment_ConfigPropertyMetadata);
|
|
1272
1274
|
return config;
|
|
1273
1275
|
}
|
|
1274
|
-
function validateAdapterConfig(untrustedConfig, configPropertyNames) {
|
|
1276
|
+
function validateAdapterConfig$2(untrustedConfig, configPropertyNames) {
|
|
1275
1277
|
if (!untrustedIsObject(untrustedConfig)) {
|
|
1276
1278
|
return null;
|
|
1277
1279
|
}
|
|
1278
1280
|
if (process.env.NODE_ENV !== 'production') {
|
|
1279
1281
|
validateConfig(untrustedConfig, configPropertyNames);
|
|
1280
1282
|
}
|
|
1281
|
-
const config = typeCheckConfig(untrustedConfig);
|
|
1283
|
+
const config = typeCheckConfig$2(untrustedConfig);
|
|
1282
1284
|
if (!areRequiredParametersPresent(config, configPropertyNames)) {
|
|
1283
1285
|
return null;
|
|
1284
1286
|
}
|
|
1285
1287
|
return config;
|
|
1286
1288
|
}
|
|
1287
|
-
function buildNetworkSnapshot(luvio, config, options) {
|
|
1288
|
-
const resourceParams = createResourceParams(config);
|
|
1289
|
-
const request = createResourceRequest(resourceParams);
|
|
1289
|
+
function buildNetworkSnapshot$2(luvio, config, options) {
|
|
1290
|
+
const resourceParams = createResourceParams$2(config);
|
|
1291
|
+
const request = createResourceRequest$2(resourceParams);
|
|
1290
1292
|
return luvio.dispatchResourceRequest(request, options)
|
|
1291
1293
|
.then((response) => {
|
|
1292
1294
|
return luvio.handleSuccessResponse(() => {
|
|
1293
|
-
const snapshot = ingestSuccess(luvio, resourceParams, response);
|
|
1295
|
+
const snapshot = ingestSuccess$2(luvio, resourceParams, response);
|
|
1294
1296
|
return luvio.storeBroadcast().then(() => snapshot);
|
|
1295
1297
|
}, () => {
|
|
1296
1298
|
const cache = new StoreKeyMap();
|
|
1297
|
-
getResponseCacheKeys(cache, luvio, resourceParams, response.body);
|
|
1299
|
+
getResponseCacheKeys$2(cache, luvio, resourceParams, response.body);
|
|
1298
1300
|
return cache;
|
|
1299
1301
|
});
|
|
1300
1302
|
}, (response) => {
|
|
@@ -1304,13 +1306,679 @@ function buildNetworkSnapshot(luvio, config, options) {
|
|
|
1304
1306
|
}
|
|
1305
1307
|
const updateCustomCodeDeploymentAdapterFactory = (luvio) => {
|
|
1306
1308
|
return function updateCustomCodeDeployment(untrustedConfig) {
|
|
1307
|
-
const config = validateAdapterConfig(untrustedConfig, updateCustomCodeDeployment_ConfigPropertyNames);
|
|
1309
|
+
const config = validateAdapterConfig$2(untrustedConfig, updateCustomCodeDeployment_ConfigPropertyNames);
|
|
1308
1310
|
// Invalid or incomplete config
|
|
1309
1311
|
if (config === null) {
|
|
1310
1312
|
throw new Error('Invalid config for "updateCustomCodeDeployment"');
|
|
1311
1313
|
}
|
|
1312
|
-
return buildNetworkSnapshot(luvio, config);
|
|
1314
|
+
return buildNetworkSnapshot$2(luvio, config);
|
|
1315
|
+
};
|
|
1316
|
+
};
|
|
1317
|
+
|
|
1318
|
+
const VERSION$2 = "16ba4e83f3e94d331bcbdba6f3d301b9";
|
|
1319
|
+
function validate$2(obj, path = 'CustomCodeExecutionBaseRepresentation') {
|
|
1320
|
+
const v_error = (() => {
|
|
1321
|
+
if (typeof obj !== 'object' || ArrayIsArray(obj) || obj === null) {
|
|
1322
|
+
return new TypeError('Expected "object" but received "' + typeof obj + '" (at "' + path + '")');
|
|
1323
|
+
}
|
|
1324
|
+
const obj_durationInSeconds = obj.durationInSeconds;
|
|
1325
|
+
const path_durationInSeconds = path + '.durationInSeconds';
|
|
1326
|
+
if (typeof obj_durationInSeconds !== 'number' || (typeof obj_durationInSeconds === 'number' && Math.floor(obj_durationInSeconds) !== obj_durationInSeconds)) {
|
|
1327
|
+
return new TypeError('Expected "integer" but received "' + typeof obj_durationInSeconds + '" (at "' + path_durationInSeconds + '")');
|
|
1328
|
+
}
|
|
1329
|
+
const obj_endTime = obj.endTime;
|
|
1330
|
+
const path_endTime = path + '.endTime';
|
|
1331
|
+
if (typeof obj_endTime !== 'string') {
|
|
1332
|
+
return new TypeError('Expected "string" but received "' + typeof obj_endTime + '" (at "' + path_endTime + '")');
|
|
1333
|
+
}
|
|
1334
|
+
if (obj.errorCode !== undefined) {
|
|
1335
|
+
const obj_errorCode = obj.errorCode;
|
|
1336
|
+
const path_errorCode = path + '.errorCode';
|
|
1337
|
+
if (typeof obj_errorCode !== 'number' || (typeof obj_errorCode === 'number' && Math.floor(obj_errorCode) !== obj_errorCode)) {
|
|
1338
|
+
return new TypeError('Expected "integer" but received "' + typeof obj_errorCode + '" (at "' + path_errorCode + '")');
|
|
1339
|
+
}
|
|
1340
|
+
}
|
|
1341
|
+
if (obj.errorMessage !== undefined) {
|
|
1342
|
+
const obj_errorMessage = obj.errorMessage;
|
|
1343
|
+
const path_errorMessage = path + '.errorMessage';
|
|
1344
|
+
if (typeof obj_errorMessage !== 'string') {
|
|
1345
|
+
return new TypeError('Expected "string" but received "' + typeof obj_errorMessage + '" (at "' + path_errorMessage + '")');
|
|
1346
|
+
}
|
|
1347
|
+
}
|
|
1348
|
+
const obj_id = obj.id;
|
|
1349
|
+
const path_id = path + '.id';
|
|
1350
|
+
if (typeof obj_id !== 'string') {
|
|
1351
|
+
return new TypeError('Expected "string" but received "' + typeof obj_id + '" (at "' + path_id + '")');
|
|
1352
|
+
}
|
|
1353
|
+
const obj_rowsRead = obj.rowsRead;
|
|
1354
|
+
const path_rowsRead = path + '.rowsRead';
|
|
1355
|
+
if (typeof obj_rowsRead !== 'number' || (typeof obj_rowsRead === 'number' && Math.floor(obj_rowsRead) !== obj_rowsRead)) {
|
|
1356
|
+
return new TypeError('Expected "integer" but received "' + typeof obj_rowsRead + '" (at "' + path_rowsRead + '")');
|
|
1357
|
+
}
|
|
1358
|
+
const obj_rowsWritten = obj.rowsWritten;
|
|
1359
|
+
const path_rowsWritten = path + '.rowsWritten';
|
|
1360
|
+
if (typeof obj_rowsWritten !== 'number' || (typeof obj_rowsWritten === 'number' && Math.floor(obj_rowsWritten) !== obj_rowsWritten)) {
|
|
1361
|
+
return new TypeError('Expected "integer" but received "' + typeof obj_rowsWritten + '" (at "' + path_rowsWritten + '")');
|
|
1362
|
+
}
|
|
1363
|
+
const obj_startTime = obj.startTime;
|
|
1364
|
+
const path_startTime = path + '.startTime';
|
|
1365
|
+
if (typeof obj_startTime !== 'string') {
|
|
1366
|
+
return new TypeError('Expected "string" but received "' + typeof obj_startTime + '" (at "' + path_startTime + '")');
|
|
1367
|
+
}
|
|
1368
|
+
const obj_status = obj.status;
|
|
1369
|
+
const path_status = path + '.status';
|
|
1370
|
+
if (typeof obj_status !== 'string') {
|
|
1371
|
+
return new TypeError('Expected "string" but received "' + typeof obj_status + '" (at "' + path_status + '")');
|
|
1372
|
+
}
|
|
1373
|
+
const obj_submittedTime = obj.submittedTime;
|
|
1374
|
+
const path_submittedTime = path + '.submittedTime';
|
|
1375
|
+
if (typeof obj_submittedTime !== 'string') {
|
|
1376
|
+
return new TypeError('Expected "string" but received "' + typeof obj_submittedTime + '" (at "' + path_submittedTime + '")');
|
|
1377
|
+
}
|
|
1378
|
+
})();
|
|
1379
|
+
return v_error === undefined ? null : v_error;
|
|
1380
|
+
}
|
|
1381
|
+
const select$4 = function CustomCodeExecutionBaseRepresentationSelect() {
|
|
1382
|
+
return {
|
|
1383
|
+
kind: 'Fragment',
|
|
1384
|
+
version: VERSION$2,
|
|
1385
|
+
private: [],
|
|
1386
|
+
selections: [
|
|
1387
|
+
{
|
|
1388
|
+
name: 'durationInSeconds',
|
|
1389
|
+
kind: 'Scalar'
|
|
1390
|
+
},
|
|
1391
|
+
{
|
|
1392
|
+
name: 'endTime',
|
|
1393
|
+
kind: 'Scalar'
|
|
1394
|
+
},
|
|
1395
|
+
{
|
|
1396
|
+
name: 'errorCode',
|
|
1397
|
+
kind: 'Scalar',
|
|
1398
|
+
required: false
|
|
1399
|
+
},
|
|
1400
|
+
{
|
|
1401
|
+
name: 'errorMessage',
|
|
1402
|
+
kind: 'Scalar',
|
|
1403
|
+
required: false
|
|
1404
|
+
},
|
|
1405
|
+
{
|
|
1406
|
+
name: 'id',
|
|
1407
|
+
kind: 'Scalar'
|
|
1408
|
+
},
|
|
1409
|
+
{
|
|
1410
|
+
name: 'rowsRead',
|
|
1411
|
+
kind: 'Scalar'
|
|
1412
|
+
},
|
|
1413
|
+
{
|
|
1414
|
+
name: 'rowsWritten',
|
|
1415
|
+
kind: 'Scalar'
|
|
1416
|
+
},
|
|
1417
|
+
{
|
|
1418
|
+
name: 'startTime',
|
|
1419
|
+
kind: 'Scalar'
|
|
1420
|
+
},
|
|
1421
|
+
{
|
|
1422
|
+
name: 'status',
|
|
1423
|
+
kind: 'Scalar'
|
|
1424
|
+
},
|
|
1425
|
+
{
|
|
1426
|
+
name: 'submittedTime',
|
|
1427
|
+
kind: 'Scalar'
|
|
1428
|
+
}
|
|
1429
|
+
]
|
|
1313
1430
|
};
|
|
1314
1431
|
};
|
|
1432
|
+
function equals$2(existing, incoming) {
|
|
1433
|
+
const existing_durationInSeconds = existing.durationInSeconds;
|
|
1434
|
+
const incoming_durationInSeconds = incoming.durationInSeconds;
|
|
1435
|
+
if (!(existing_durationInSeconds === incoming_durationInSeconds)) {
|
|
1436
|
+
return false;
|
|
1437
|
+
}
|
|
1438
|
+
const existing_errorCode = existing.errorCode;
|
|
1439
|
+
const incoming_errorCode = incoming.errorCode;
|
|
1440
|
+
// if at least one of these optionals is defined
|
|
1441
|
+
if (existing_errorCode !== undefined || incoming_errorCode !== undefined) {
|
|
1442
|
+
// if one of these is not defined we know the other is defined and therefore
|
|
1443
|
+
// not equal
|
|
1444
|
+
if (existing_errorCode === undefined || incoming_errorCode === undefined) {
|
|
1445
|
+
return false;
|
|
1446
|
+
}
|
|
1447
|
+
if (!(existing_errorCode === incoming_errorCode)) {
|
|
1448
|
+
return false;
|
|
1449
|
+
}
|
|
1450
|
+
}
|
|
1451
|
+
const existing_rowsRead = existing.rowsRead;
|
|
1452
|
+
const incoming_rowsRead = incoming.rowsRead;
|
|
1453
|
+
if (!(existing_rowsRead === incoming_rowsRead)) {
|
|
1454
|
+
return false;
|
|
1455
|
+
}
|
|
1456
|
+
const existing_rowsWritten = existing.rowsWritten;
|
|
1457
|
+
const incoming_rowsWritten = incoming.rowsWritten;
|
|
1458
|
+
if (!(existing_rowsWritten === incoming_rowsWritten)) {
|
|
1459
|
+
return false;
|
|
1460
|
+
}
|
|
1461
|
+
const existing_endTime = existing.endTime;
|
|
1462
|
+
const incoming_endTime = incoming.endTime;
|
|
1463
|
+
if (!(existing_endTime === incoming_endTime)) {
|
|
1464
|
+
return false;
|
|
1465
|
+
}
|
|
1466
|
+
const existing_errorMessage = existing.errorMessage;
|
|
1467
|
+
const incoming_errorMessage = incoming.errorMessage;
|
|
1468
|
+
// if at least one of these optionals is defined
|
|
1469
|
+
if (existing_errorMessage !== undefined || incoming_errorMessage !== undefined) {
|
|
1470
|
+
// if one of these is not defined we know the other is defined and therefore
|
|
1471
|
+
// not equal
|
|
1472
|
+
if (existing_errorMessage === undefined || incoming_errorMessage === undefined) {
|
|
1473
|
+
return false;
|
|
1474
|
+
}
|
|
1475
|
+
if (!(existing_errorMessage === incoming_errorMessage)) {
|
|
1476
|
+
return false;
|
|
1477
|
+
}
|
|
1478
|
+
}
|
|
1479
|
+
const existing_id = existing.id;
|
|
1480
|
+
const incoming_id = incoming.id;
|
|
1481
|
+
if (!(existing_id === incoming_id)) {
|
|
1482
|
+
return false;
|
|
1483
|
+
}
|
|
1484
|
+
const existing_startTime = existing.startTime;
|
|
1485
|
+
const incoming_startTime = incoming.startTime;
|
|
1486
|
+
if (!(existing_startTime === incoming_startTime)) {
|
|
1487
|
+
return false;
|
|
1488
|
+
}
|
|
1489
|
+
const existing_status = existing.status;
|
|
1490
|
+
const incoming_status = incoming.status;
|
|
1491
|
+
if (!(existing_status === incoming_status)) {
|
|
1492
|
+
return false;
|
|
1493
|
+
}
|
|
1494
|
+
const existing_submittedTime = existing.submittedTime;
|
|
1495
|
+
const incoming_submittedTime = incoming.submittedTime;
|
|
1496
|
+
if (!(existing_submittedTime === incoming_submittedTime)) {
|
|
1497
|
+
return false;
|
|
1498
|
+
}
|
|
1499
|
+
return true;
|
|
1500
|
+
}
|
|
1501
|
+
|
|
1502
|
+
const VERSION$1 = "eff3ca61ebb18d80a094043be3f81c07";
|
|
1503
|
+
function validate$1(obj, path = 'CustomCodeExecutionCollectionRepresentation') {
|
|
1504
|
+
const v_error = (() => {
|
|
1505
|
+
if (typeof obj !== 'object' || ArrayIsArray(obj) || obj === null) {
|
|
1506
|
+
return new TypeError('Expected "object" but received "' + typeof obj + '" (at "' + path + '")');
|
|
1507
|
+
}
|
|
1508
|
+
if (obj.currentPageUrl !== undefined) {
|
|
1509
|
+
const obj_currentPageUrl = obj.currentPageUrl;
|
|
1510
|
+
const path_currentPageUrl = path + '.currentPageUrl';
|
|
1511
|
+
if (typeof obj_currentPageUrl !== 'string') {
|
|
1512
|
+
return new TypeError('Expected "string" but received "' + typeof obj_currentPageUrl + '" (at "' + path_currentPageUrl + '")');
|
|
1513
|
+
}
|
|
1514
|
+
}
|
|
1515
|
+
const obj_executions = obj.executions;
|
|
1516
|
+
const path_executions = path + '.executions';
|
|
1517
|
+
if (!ArrayIsArray(obj_executions)) {
|
|
1518
|
+
return new TypeError('Expected "array" but received "' + typeof obj_executions + '" (at "' + path_executions + '")');
|
|
1519
|
+
}
|
|
1520
|
+
for (let i = 0; i < obj_executions.length; i++) {
|
|
1521
|
+
const obj_executions_item = obj_executions[i];
|
|
1522
|
+
const path_executions_item = path_executions + '[' + i + ']';
|
|
1523
|
+
const referencepath_executions_itemValidationError = validate$2(obj_executions_item, path_executions_item);
|
|
1524
|
+
if (referencepath_executions_itemValidationError !== null) {
|
|
1525
|
+
let message = 'Object doesn\'t match CustomCodeExecutionBaseRepresentation (at "' + path_executions_item + '")\n';
|
|
1526
|
+
message += referencepath_executions_itemValidationError.message.split('\n').map((line) => '\t' + line).join('\n');
|
|
1527
|
+
return new TypeError(message);
|
|
1528
|
+
}
|
|
1529
|
+
}
|
|
1530
|
+
if (obj.nextPageUrl !== undefined) {
|
|
1531
|
+
const obj_nextPageUrl = obj.nextPageUrl;
|
|
1532
|
+
const path_nextPageUrl = path + '.nextPageUrl';
|
|
1533
|
+
if (typeof obj_nextPageUrl !== 'string') {
|
|
1534
|
+
return new TypeError('Expected "string" but received "' + typeof obj_nextPageUrl + '" (at "' + path_nextPageUrl + '")');
|
|
1535
|
+
}
|
|
1536
|
+
}
|
|
1537
|
+
if (obj.totalSize !== undefined) {
|
|
1538
|
+
const obj_totalSize = obj.totalSize;
|
|
1539
|
+
const path_totalSize = path + '.totalSize';
|
|
1540
|
+
if (typeof obj_totalSize !== 'number' || (typeof obj_totalSize === 'number' && Math.floor(obj_totalSize) !== obj_totalSize)) {
|
|
1541
|
+
return new TypeError('Expected "integer" but received "' + typeof obj_totalSize + '" (at "' + path_totalSize + '")');
|
|
1542
|
+
}
|
|
1543
|
+
}
|
|
1544
|
+
})();
|
|
1545
|
+
return v_error === undefined ? null : v_error;
|
|
1546
|
+
}
|
|
1547
|
+
const RepresentationType$1 = 'CustomCodeExecutionCollectionRepresentation';
|
|
1548
|
+
function normalize$1(input, existing, path, luvio, store, timestamp) {
|
|
1549
|
+
return input;
|
|
1550
|
+
}
|
|
1551
|
+
const select$3 = function CustomCodeExecutionCollectionRepresentationSelect() {
|
|
1552
|
+
const { selections: CustomCodeExecutionBaseRepresentation__selections, opaque: CustomCodeExecutionBaseRepresentation__opaque, } = select$4();
|
|
1553
|
+
return {
|
|
1554
|
+
kind: 'Fragment',
|
|
1555
|
+
version: VERSION$1,
|
|
1556
|
+
private: [],
|
|
1557
|
+
selections: [
|
|
1558
|
+
{
|
|
1559
|
+
name: 'currentPageUrl',
|
|
1560
|
+
kind: 'Scalar',
|
|
1561
|
+
required: false
|
|
1562
|
+
},
|
|
1563
|
+
{
|
|
1564
|
+
name: 'executions',
|
|
1565
|
+
kind: 'Object',
|
|
1566
|
+
plural: true,
|
|
1567
|
+
selections: CustomCodeExecutionBaseRepresentation__selections
|
|
1568
|
+
},
|
|
1569
|
+
{
|
|
1570
|
+
name: 'nextPageUrl',
|
|
1571
|
+
kind: 'Scalar',
|
|
1572
|
+
required: false
|
|
1573
|
+
},
|
|
1574
|
+
{
|
|
1575
|
+
name: 'totalSize',
|
|
1576
|
+
kind: 'Scalar',
|
|
1577
|
+
required: false
|
|
1578
|
+
}
|
|
1579
|
+
]
|
|
1580
|
+
};
|
|
1581
|
+
};
|
|
1582
|
+
function equals$1(existing, incoming) {
|
|
1583
|
+
const existing_totalSize = existing.totalSize;
|
|
1584
|
+
const incoming_totalSize = incoming.totalSize;
|
|
1585
|
+
// if at least one of these optionals is defined
|
|
1586
|
+
if (existing_totalSize !== undefined || incoming_totalSize !== undefined) {
|
|
1587
|
+
// if one of these is not defined we know the other is defined and therefore
|
|
1588
|
+
// not equal
|
|
1589
|
+
if (existing_totalSize === undefined || incoming_totalSize === undefined) {
|
|
1590
|
+
return false;
|
|
1591
|
+
}
|
|
1592
|
+
if (!(existing_totalSize === incoming_totalSize)) {
|
|
1593
|
+
return false;
|
|
1594
|
+
}
|
|
1595
|
+
}
|
|
1596
|
+
const existing_currentPageUrl = existing.currentPageUrl;
|
|
1597
|
+
const incoming_currentPageUrl = incoming.currentPageUrl;
|
|
1598
|
+
// if at least one of these optionals is defined
|
|
1599
|
+
if (existing_currentPageUrl !== undefined || incoming_currentPageUrl !== undefined) {
|
|
1600
|
+
// if one of these is not defined we know the other is defined and therefore
|
|
1601
|
+
// not equal
|
|
1602
|
+
if (existing_currentPageUrl === undefined || incoming_currentPageUrl === undefined) {
|
|
1603
|
+
return false;
|
|
1604
|
+
}
|
|
1605
|
+
if (!(existing_currentPageUrl === incoming_currentPageUrl)) {
|
|
1606
|
+
return false;
|
|
1607
|
+
}
|
|
1608
|
+
}
|
|
1609
|
+
const existing_nextPageUrl = existing.nextPageUrl;
|
|
1610
|
+
const incoming_nextPageUrl = incoming.nextPageUrl;
|
|
1611
|
+
// if at least one of these optionals is defined
|
|
1612
|
+
if (existing_nextPageUrl !== undefined || incoming_nextPageUrl !== undefined) {
|
|
1613
|
+
// if one of these is not defined we know the other is defined and therefore
|
|
1614
|
+
// not equal
|
|
1615
|
+
if (existing_nextPageUrl === undefined || incoming_nextPageUrl === undefined) {
|
|
1616
|
+
return false;
|
|
1617
|
+
}
|
|
1618
|
+
if (!(existing_nextPageUrl === incoming_nextPageUrl)) {
|
|
1619
|
+
return false;
|
|
1620
|
+
}
|
|
1621
|
+
}
|
|
1622
|
+
const existing_executions = existing.executions;
|
|
1623
|
+
const incoming_executions = incoming.executions;
|
|
1624
|
+
const equals_executions_items = equalsArray(existing_executions, incoming_executions, (existing_executions_item, incoming_executions_item) => {
|
|
1625
|
+
if (!(equals$2(existing_executions_item, incoming_executions_item))) {
|
|
1626
|
+
return false;
|
|
1627
|
+
}
|
|
1628
|
+
});
|
|
1629
|
+
if (equals_executions_items === false) {
|
|
1630
|
+
return false;
|
|
1631
|
+
}
|
|
1632
|
+
return true;
|
|
1633
|
+
}
|
|
1634
|
+
const ingest$1 = function CustomCodeExecutionCollectionRepresentationIngest(input, path, luvio, store, timestamp) {
|
|
1635
|
+
if (process.env.NODE_ENV !== 'production') {
|
|
1636
|
+
const validateError = validate$1(input);
|
|
1637
|
+
if (validateError !== null) {
|
|
1638
|
+
throw validateError;
|
|
1639
|
+
}
|
|
1640
|
+
}
|
|
1641
|
+
const key = path.fullPath;
|
|
1642
|
+
const ttlToUse = path.ttl !== undefined ? path.ttl : 60000;
|
|
1643
|
+
ingestShape(input, path, luvio, store, timestamp, ttlToUse, key, normalize$1, "byoc", VERSION$1, RepresentationType$1, equals$1);
|
|
1644
|
+
return createLink(key);
|
|
1645
|
+
};
|
|
1646
|
+
function getTypeCacheKeys$1(rootKeySet, luvio, input, fullPathFactory) {
|
|
1647
|
+
// root cache key (uses fullPathFactory if keyBuilderFromType isn't defined)
|
|
1648
|
+
const rootKey = fullPathFactory();
|
|
1649
|
+
rootKeySet.set(rootKey, {
|
|
1650
|
+
namespace: keyPrefix,
|
|
1651
|
+
representationName: RepresentationType$1,
|
|
1652
|
+
mergeable: false
|
|
1653
|
+
});
|
|
1654
|
+
}
|
|
1655
|
+
|
|
1656
|
+
function select$2(luvio, params) {
|
|
1657
|
+
return select$3();
|
|
1658
|
+
}
|
|
1659
|
+
function keyBuilder$3(luvio, params) {
|
|
1660
|
+
return keyPrefix + '::CustomCodeExecutionCollectionRepresentation:(' + 'limit:' + params.queryParams.limit + ',' + 'offset:' + params.queryParams.offset + ',' + 'customCodeNameOrId:' + params.urlParams.customCodeNameOrId + ')';
|
|
1661
|
+
}
|
|
1662
|
+
function getResponseCacheKeys$1(storeKeyMap, luvio, resourceParams, response) {
|
|
1663
|
+
getTypeCacheKeys$1(storeKeyMap, luvio, response, () => keyBuilder$3(luvio, resourceParams));
|
|
1664
|
+
}
|
|
1665
|
+
function ingestSuccess$1(luvio, resourceParams, response, snapshotRefresh) {
|
|
1666
|
+
const { body } = response;
|
|
1667
|
+
const key = keyBuilder$3(luvio, resourceParams);
|
|
1668
|
+
luvio.storeIngest(key, ingest$1, body);
|
|
1669
|
+
const snapshot = luvio.storeLookup({
|
|
1670
|
+
recordId: key,
|
|
1671
|
+
node: select$2(),
|
|
1672
|
+
variables: {},
|
|
1673
|
+
}, snapshotRefresh);
|
|
1674
|
+
if (process.env.NODE_ENV !== 'production') {
|
|
1675
|
+
if (snapshot.state !== 'Fulfilled') {
|
|
1676
|
+
throw new Error('Invalid network response. Expected resource response to result in Fulfilled snapshot');
|
|
1677
|
+
}
|
|
1678
|
+
}
|
|
1679
|
+
deepFreeze(snapshot.data);
|
|
1680
|
+
return snapshot;
|
|
1681
|
+
}
|
|
1682
|
+
function ingestError$1(luvio, params, error, snapshotRefresh) {
|
|
1683
|
+
const key = keyBuilder$3(luvio, params);
|
|
1684
|
+
const errorSnapshot = luvio.errorSnapshot(error, snapshotRefresh);
|
|
1685
|
+
luvio.storeIngestError(key, errorSnapshot);
|
|
1686
|
+
return errorSnapshot;
|
|
1687
|
+
}
|
|
1688
|
+
function createResourceRequest$1(config) {
|
|
1689
|
+
const headers = {};
|
|
1690
|
+
return {
|
|
1691
|
+
baseUri: '/services/data/v64.0',
|
|
1692
|
+
basePath: '/ssot/data-custom-code/' + config.urlParams.customCodeNameOrId + '/executions',
|
|
1693
|
+
method: 'get',
|
|
1694
|
+
body: null,
|
|
1695
|
+
urlParams: config.urlParams,
|
|
1696
|
+
queryParams: config.queryParams,
|
|
1697
|
+
headers,
|
|
1698
|
+
priority: 'normal',
|
|
1699
|
+
};
|
|
1700
|
+
}
|
|
1701
|
+
|
|
1702
|
+
const adapterName$1 = 'getCustomCodeExecutions';
|
|
1703
|
+
const getCustomCodeExecutions_ConfigPropertyMetadata = [
|
|
1704
|
+
generateParamConfigMetadata('customCodeNameOrId', true, 0 /* UrlParameter */, 0 /* String */),
|
|
1705
|
+
generateParamConfigMetadata('limit', false, 1 /* QueryParameter */, 3 /* Integer */),
|
|
1706
|
+
generateParamConfigMetadata('offset', false, 1 /* QueryParameter */, 3 /* Integer */),
|
|
1707
|
+
];
|
|
1708
|
+
const getCustomCodeExecutions_ConfigPropertyNames = /*#__PURE__*/ buildAdapterValidationConfig(adapterName$1, getCustomCodeExecutions_ConfigPropertyMetadata);
|
|
1709
|
+
const createResourceParams$1 = /*#__PURE__*/ createResourceParams$7(getCustomCodeExecutions_ConfigPropertyMetadata);
|
|
1710
|
+
function keyBuilder$2(luvio, config) {
|
|
1711
|
+
const resourceParams = createResourceParams$1(config);
|
|
1712
|
+
return keyBuilder$3(luvio, resourceParams);
|
|
1713
|
+
}
|
|
1714
|
+
function typeCheckConfig$1(untrustedConfig) {
|
|
1715
|
+
const config = {};
|
|
1716
|
+
typeCheckConfig$7(untrustedConfig, config, getCustomCodeExecutions_ConfigPropertyMetadata);
|
|
1717
|
+
return config;
|
|
1718
|
+
}
|
|
1719
|
+
function validateAdapterConfig$1(untrustedConfig, configPropertyNames) {
|
|
1720
|
+
if (!untrustedIsObject(untrustedConfig)) {
|
|
1721
|
+
return null;
|
|
1722
|
+
}
|
|
1723
|
+
if (process.env.NODE_ENV !== 'production') {
|
|
1724
|
+
validateConfig(untrustedConfig, configPropertyNames);
|
|
1725
|
+
}
|
|
1726
|
+
const config = typeCheckConfig$1(untrustedConfig);
|
|
1727
|
+
if (!areRequiredParametersPresent(config, configPropertyNames)) {
|
|
1728
|
+
return null;
|
|
1729
|
+
}
|
|
1730
|
+
return config;
|
|
1731
|
+
}
|
|
1732
|
+
function adapterFragment$1(luvio, config) {
|
|
1733
|
+
createResourceParams$1(config);
|
|
1734
|
+
return select$2();
|
|
1735
|
+
}
|
|
1736
|
+
function onFetchResponseSuccess$1(luvio, config, resourceParams, response) {
|
|
1737
|
+
const snapshot = ingestSuccess$1(luvio, resourceParams, response, {
|
|
1738
|
+
config,
|
|
1739
|
+
resolve: () => buildNetworkSnapshot$1(luvio, config, snapshotRefreshOptions)
|
|
1740
|
+
});
|
|
1741
|
+
return luvio.storeBroadcast().then(() => snapshot);
|
|
1742
|
+
}
|
|
1743
|
+
function onFetchResponseError$1(luvio, config, resourceParams, response) {
|
|
1744
|
+
const snapshot = ingestError$1(luvio, resourceParams, response, {
|
|
1745
|
+
config,
|
|
1746
|
+
resolve: () => buildNetworkSnapshot$1(luvio, config, snapshotRefreshOptions)
|
|
1747
|
+
});
|
|
1748
|
+
return luvio.storeBroadcast().then(() => snapshot);
|
|
1749
|
+
}
|
|
1750
|
+
function buildNetworkSnapshot$1(luvio, config, options) {
|
|
1751
|
+
const resourceParams = createResourceParams$1(config);
|
|
1752
|
+
const request = createResourceRequest$1(resourceParams);
|
|
1753
|
+
return luvio.dispatchResourceRequest(request, options)
|
|
1754
|
+
.then((response) => {
|
|
1755
|
+
return luvio.handleSuccessResponse(() => onFetchResponseSuccess$1(luvio, config, resourceParams, response), () => {
|
|
1756
|
+
const cache = new StoreKeyMap();
|
|
1757
|
+
getResponseCacheKeys$1(cache, luvio, resourceParams, response.body);
|
|
1758
|
+
return cache;
|
|
1759
|
+
});
|
|
1760
|
+
}, (response) => {
|
|
1761
|
+
return luvio.handleErrorResponse(() => onFetchResponseError$1(luvio, config, resourceParams, response));
|
|
1762
|
+
});
|
|
1763
|
+
}
|
|
1764
|
+
function buildNetworkSnapshotCachePolicy$1(context, coercedAdapterRequestContext) {
|
|
1765
|
+
return buildNetworkSnapshotCachePolicy$4(context, coercedAdapterRequestContext, buildNetworkSnapshot$1, undefined, false);
|
|
1766
|
+
}
|
|
1767
|
+
function buildCachedSnapshotCachePolicy$1(context, storeLookup) {
|
|
1768
|
+
const { luvio, config } = context;
|
|
1769
|
+
const selector = {
|
|
1770
|
+
recordId: keyBuilder$2(luvio, config),
|
|
1771
|
+
node: adapterFragment$1(luvio, config),
|
|
1772
|
+
variables: {},
|
|
1773
|
+
};
|
|
1774
|
+
const cacheSnapshot = storeLookup(selector, {
|
|
1775
|
+
config,
|
|
1776
|
+
resolve: () => buildNetworkSnapshot$1(luvio, config, snapshotRefreshOptions)
|
|
1777
|
+
});
|
|
1778
|
+
return cacheSnapshot;
|
|
1779
|
+
}
|
|
1780
|
+
const getCustomCodeExecutionsAdapterFactory = (luvio) => function byoc__getCustomCodeExecutions(untrustedConfig, requestContext) {
|
|
1781
|
+
const config = validateAdapterConfig$1(untrustedConfig, getCustomCodeExecutions_ConfigPropertyNames);
|
|
1782
|
+
// Invalid or incomplete config
|
|
1783
|
+
if (config === null) {
|
|
1784
|
+
return null;
|
|
1785
|
+
}
|
|
1786
|
+
return luvio.applyCachePolicy((requestContext || {}), { config, luvio }, // BuildSnapshotContext
|
|
1787
|
+
buildCachedSnapshotCachePolicy$1, buildNetworkSnapshotCachePolicy$1);
|
|
1788
|
+
};
|
|
1789
|
+
|
|
1790
|
+
const VERSION = "67e4b6c0a2163a4de44249f2a2dc7bd0";
|
|
1791
|
+
function validate(obj, path = 'CustomCodeExecutionLogRepresentation') {
|
|
1792
|
+
const v_error = (() => {
|
|
1793
|
+
if (typeof obj !== 'object' || ArrayIsArray(obj) || obj === null) {
|
|
1794
|
+
return new TypeError('Expected "object" but received "' + typeof obj + '" (at "' + path + '")');
|
|
1795
|
+
}
|
|
1796
|
+
const obj_downloadUrl = obj.downloadUrl;
|
|
1797
|
+
const path_downloadUrl = path + '.downloadUrl';
|
|
1798
|
+
if (typeof obj_downloadUrl !== 'string') {
|
|
1799
|
+
return new TypeError('Expected "string" but received "' + typeof obj_downloadUrl + '" (at "' + path_downloadUrl + '")');
|
|
1800
|
+
}
|
|
1801
|
+
})();
|
|
1802
|
+
return v_error === undefined ? null : v_error;
|
|
1803
|
+
}
|
|
1804
|
+
const RepresentationType = 'CustomCodeExecutionLogRepresentation';
|
|
1805
|
+
function normalize(input, existing, path, luvio, store, timestamp) {
|
|
1806
|
+
return input;
|
|
1807
|
+
}
|
|
1808
|
+
const select$1 = function CustomCodeExecutionLogRepresentationSelect() {
|
|
1809
|
+
return {
|
|
1810
|
+
kind: 'Fragment',
|
|
1811
|
+
version: VERSION,
|
|
1812
|
+
private: [],
|
|
1813
|
+
selections: [
|
|
1814
|
+
{
|
|
1815
|
+
name: 'downloadUrl',
|
|
1816
|
+
kind: 'Scalar'
|
|
1817
|
+
}
|
|
1818
|
+
]
|
|
1819
|
+
};
|
|
1820
|
+
};
|
|
1821
|
+
function equals(existing, incoming) {
|
|
1822
|
+
const existing_downloadUrl = existing.downloadUrl;
|
|
1823
|
+
const incoming_downloadUrl = incoming.downloadUrl;
|
|
1824
|
+
if (!(existing_downloadUrl === incoming_downloadUrl)) {
|
|
1825
|
+
return false;
|
|
1826
|
+
}
|
|
1827
|
+
return true;
|
|
1828
|
+
}
|
|
1829
|
+
const ingest = function CustomCodeExecutionLogRepresentationIngest(input, path, luvio, store, timestamp) {
|
|
1830
|
+
if (process.env.NODE_ENV !== 'production') {
|
|
1831
|
+
const validateError = validate(input);
|
|
1832
|
+
if (validateError !== null) {
|
|
1833
|
+
throw validateError;
|
|
1834
|
+
}
|
|
1835
|
+
}
|
|
1836
|
+
const key = path.fullPath;
|
|
1837
|
+
const ttlToUse = path.ttl !== undefined ? path.ttl : 60000;
|
|
1838
|
+
ingestShape(input, path, luvio, store, timestamp, ttlToUse, key, normalize, "byoc", VERSION, RepresentationType, equals);
|
|
1839
|
+
return createLink(key);
|
|
1840
|
+
};
|
|
1841
|
+
function getTypeCacheKeys(rootKeySet, luvio, input, fullPathFactory) {
|
|
1842
|
+
// root cache key (uses fullPathFactory if keyBuilderFromType isn't defined)
|
|
1843
|
+
const rootKey = fullPathFactory();
|
|
1844
|
+
rootKeySet.set(rootKey, {
|
|
1845
|
+
namespace: keyPrefix,
|
|
1846
|
+
representationName: RepresentationType,
|
|
1847
|
+
mergeable: false
|
|
1848
|
+
});
|
|
1849
|
+
}
|
|
1850
|
+
|
|
1851
|
+
function select(luvio, params) {
|
|
1852
|
+
return select$1();
|
|
1853
|
+
}
|
|
1854
|
+
function keyBuilder$1(luvio, params) {
|
|
1855
|
+
return keyPrefix + '::CustomCodeExecutionLogRepresentation:(' + 'customCodeExecutionId:' + params.urlParams.customCodeExecutionId + ',' + 'customCodeNameOrId:' + params.urlParams.customCodeNameOrId + ')';
|
|
1856
|
+
}
|
|
1857
|
+
function getResponseCacheKeys(storeKeyMap, luvio, resourceParams, response) {
|
|
1858
|
+
getTypeCacheKeys(storeKeyMap, luvio, response, () => keyBuilder$1(luvio, resourceParams));
|
|
1859
|
+
}
|
|
1860
|
+
function ingestSuccess(luvio, resourceParams, response, snapshotRefresh) {
|
|
1861
|
+
const { body } = response;
|
|
1862
|
+
const key = keyBuilder$1(luvio, resourceParams);
|
|
1863
|
+
luvio.storeIngest(key, ingest, body);
|
|
1864
|
+
const snapshot = luvio.storeLookup({
|
|
1865
|
+
recordId: key,
|
|
1866
|
+
node: select(),
|
|
1867
|
+
variables: {},
|
|
1868
|
+
}, snapshotRefresh);
|
|
1869
|
+
if (process.env.NODE_ENV !== 'production') {
|
|
1870
|
+
if (snapshot.state !== 'Fulfilled') {
|
|
1871
|
+
throw new Error('Invalid network response. Expected resource response to result in Fulfilled snapshot');
|
|
1872
|
+
}
|
|
1873
|
+
}
|
|
1874
|
+
deepFreeze(snapshot.data);
|
|
1875
|
+
return snapshot;
|
|
1876
|
+
}
|
|
1877
|
+
function ingestError(luvio, params, error, snapshotRefresh) {
|
|
1878
|
+
const key = keyBuilder$1(luvio, params);
|
|
1879
|
+
const errorSnapshot = luvio.errorSnapshot(error, snapshotRefresh);
|
|
1880
|
+
luvio.storeIngestError(key, errorSnapshot);
|
|
1881
|
+
return errorSnapshot;
|
|
1882
|
+
}
|
|
1883
|
+
function createResourceRequest(config) {
|
|
1884
|
+
const headers = {};
|
|
1885
|
+
return {
|
|
1886
|
+
baseUri: '/services/data/v64.0',
|
|
1887
|
+
basePath: '/ssot/data-custom-code/' + config.urlParams.customCodeNameOrId + '/executions/' + config.urlParams.customCodeExecutionId + '/logs',
|
|
1888
|
+
method: 'get',
|
|
1889
|
+
body: null,
|
|
1890
|
+
urlParams: config.urlParams,
|
|
1891
|
+
queryParams: {},
|
|
1892
|
+
headers,
|
|
1893
|
+
priority: 'normal',
|
|
1894
|
+
};
|
|
1895
|
+
}
|
|
1896
|
+
|
|
1897
|
+
const adapterName = 'getCustomCodeExecutionLogs';
|
|
1898
|
+
const getCustomCodeExecutionLogs_ConfigPropertyMetadata = [
|
|
1899
|
+
generateParamConfigMetadata('customCodeExecutionId', true, 0 /* UrlParameter */, 0 /* String */),
|
|
1900
|
+
generateParamConfigMetadata('customCodeNameOrId', true, 0 /* UrlParameter */, 0 /* String */),
|
|
1901
|
+
];
|
|
1902
|
+
const getCustomCodeExecutionLogs_ConfigPropertyNames = /*#__PURE__*/ buildAdapterValidationConfig(adapterName, getCustomCodeExecutionLogs_ConfigPropertyMetadata);
|
|
1903
|
+
const createResourceParams = /*#__PURE__*/ createResourceParams$7(getCustomCodeExecutionLogs_ConfigPropertyMetadata);
|
|
1904
|
+
function keyBuilder(luvio, config) {
|
|
1905
|
+
const resourceParams = createResourceParams(config);
|
|
1906
|
+
return keyBuilder$1(luvio, resourceParams);
|
|
1907
|
+
}
|
|
1908
|
+
function typeCheckConfig(untrustedConfig) {
|
|
1909
|
+
const config = {};
|
|
1910
|
+
typeCheckConfig$7(untrustedConfig, config, getCustomCodeExecutionLogs_ConfigPropertyMetadata);
|
|
1911
|
+
return config;
|
|
1912
|
+
}
|
|
1913
|
+
function validateAdapterConfig(untrustedConfig, configPropertyNames) {
|
|
1914
|
+
if (!untrustedIsObject(untrustedConfig)) {
|
|
1915
|
+
return null;
|
|
1916
|
+
}
|
|
1917
|
+
if (process.env.NODE_ENV !== 'production') {
|
|
1918
|
+
validateConfig(untrustedConfig, configPropertyNames);
|
|
1919
|
+
}
|
|
1920
|
+
const config = typeCheckConfig(untrustedConfig);
|
|
1921
|
+
if (!areRequiredParametersPresent(config, configPropertyNames)) {
|
|
1922
|
+
return null;
|
|
1923
|
+
}
|
|
1924
|
+
return config;
|
|
1925
|
+
}
|
|
1926
|
+
function adapterFragment(luvio, config) {
|
|
1927
|
+
createResourceParams(config);
|
|
1928
|
+
return select();
|
|
1929
|
+
}
|
|
1930
|
+
function onFetchResponseSuccess(luvio, config, resourceParams, response) {
|
|
1931
|
+
const snapshot = ingestSuccess(luvio, resourceParams, response, {
|
|
1932
|
+
config,
|
|
1933
|
+
resolve: () => buildNetworkSnapshot(luvio, config, snapshotRefreshOptions)
|
|
1934
|
+
});
|
|
1935
|
+
return luvio.storeBroadcast().then(() => snapshot);
|
|
1936
|
+
}
|
|
1937
|
+
function onFetchResponseError(luvio, config, resourceParams, response) {
|
|
1938
|
+
const snapshot = ingestError(luvio, resourceParams, response, {
|
|
1939
|
+
config,
|
|
1940
|
+
resolve: () => buildNetworkSnapshot(luvio, config, snapshotRefreshOptions)
|
|
1941
|
+
});
|
|
1942
|
+
return luvio.storeBroadcast().then(() => snapshot);
|
|
1943
|
+
}
|
|
1944
|
+
function buildNetworkSnapshot(luvio, config, options) {
|
|
1945
|
+
const resourceParams = createResourceParams(config);
|
|
1946
|
+
const request = createResourceRequest(resourceParams);
|
|
1947
|
+
return luvio.dispatchResourceRequest(request, options)
|
|
1948
|
+
.then((response) => {
|
|
1949
|
+
return luvio.handleSuccessResponse(() => onFetchResponseSuccess(luvio, config, resourceParams, response), () => {
|
|
1950
|
+
const cache = new StoreKeyMap();
|
|
1951
|
+
getResponseCacheKeys(cache, luvio, resourceParams, response.body);
|
|
1952
|
+
return cache;
|
|
1953
|
+
});
|
|
1954
|
+
}, (response) => {
|
|
1955
|
+
return luvio.handleErrorResponse(() => onFetchResponseError(luvio, config, resourceParams, response));
|
|
1956
|
+
});
|
|
1957
|
+
}
|
|
1958
|
+
function buildNetworkSnapshotCachePolicy(context, coercedAdapterRequestContext) {
|
|
1959
|
+
return buildNetworkSnapshotCachePolicy$4(context, coercedAdapterRequestContext, buildNetworkSnapshot, undefined, false);
|
|
1960
|
+
}
|
|
1961
|
+
function buildCachedSnapshotCachePolicy(context, storeLookup) {
|
|
1962
|
+
const { luvio, config } = context;
|
|
1963
|
+
const selector = {
|
|
1964
|
+
recordId: keyBuilder(luvio, config),
|
|
1965
|
+
node: adapterFragment(luvio, config),
|
|
1966
|
+
variables: {},
|
|
1967
|
+
};
|
|
1968
|
+
const cacheSnapshot = storeLookup(selector, {
|
|
1969
|
+
config,
|
|
1970
|
+
resolve: () => buildNetworkSnapshot(luvio, config, snapshotRefreshOptions)
|
|
1971
|
+
});
|
|
1972
|
+
return cacheSnapshot;
|
|
1973
|
+
}
|
|
1974
|
+
const getCustomCodeExecutionLogsAdapterFactory = (luvio) => function byoc__getCustomCodeExecutionLogs(untrustedConfig, requestContext) {
|
|
1975
|
+
const config = validateAdapterConfig(untrustedConfig, getCustomCodeExecutionLogs_ConfigPropertyNames);
|
|
1976
|
+
// Invalid or incomplete config
|
|
1977
|
+
if (config === null) {
|
|
1978
|
+
return null;
|
|
1979
|
+
}
|
|
1980
|
+
return luvio.applyCachePolicy((requestContext || {}), { config, luvio }, // BuildSnapshotContext
|
|
1981
|
+
buildCachedSnapshotCachePolicy, buildNetworkSnapshotCachePolicy);
|
|
1982
|
+
};
|
|
1315
1983
|
|
|
1316
|
-
export { createCustomCodeDeploymentAdapterFactory, deleteCustomCodeDeploymentAdapterFactory, getCustomCodeDeploymentAdapterFactory, getCustomCodeDeploymentsAdapterFactory, updateCustomCodeDeploymentAdapterFactory };
|
|
1984
|
+
export { createCustomCodeDeploymentAdapterFactory, deleteCustomCodeDeploymentAdapterFactory, getCustomCodeDeploymentAdapterFactory, getCustomCodeDeploymentsAdapterFactory, getCustomCodeExecutionLogsAdapterFactory, getCustomCodeExecutionsAdapterFactory, updateCustomCodeDeploymentAdapterFactory };
|