@salesforce/lds-adapters-cdp-byoc 1.332.0-dev19 → 1.332.0-dev20

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.
@@ -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$5, typeCheckConfig as typeCheckConfig$5, buildNetworkSnapshotCachePolicy as buildNetworkSnapshotCachePolicy$2 } from '@luvio/engine';
7
+ import { serializeStructuredKey, ingestShape, deepFreeze, StoreKeyMap, createResourceParams as createResourceParams$1, typeCheckConfig as typeCheckConfig$1 } from '@luvio/engine';
8
8
 
9
9
  const { hasOwnProperty: ObjectPrototypeHasOwnProperty } = Object.prototype;
10
10
  const { keys: ObjectKeys$1, create: ObjectCreate$1 } = Object;
@@ -41,13 +41,6 @@ function untrustedIsObject(untrusted) {
41
41
  function areRequiredParametersPresent(config, configPropertyNames) {
42
42
  return configPropertyNames.parameters.required.every(req => req in config);
43
43
  }
44
- const snapshotRefreshOptions = {
45
- overrides: {
46
- headers: {
47
- 'Cache-Control': 'no-cache',
48
- },
49
- }
50
- };
51
44
  function generateParamConfigMetadata(name, required, resourceType, typeCheckShape, isArrayShape = false, coerceFn) {
52
45
  return {
53
46
  name,
@@ -111,8 +104,8 @@ function createLink(ref) {
111
104
  };
112
105
  }
113
106
 
114
- const VERSION$2 = "2fe1bfd9fd1c6a94767d2ea000d6d318";
115
- function validate$2(obj, path = 'CdpUserRepresentation') {
107
+ const VERSION$1 = "2fe1bfd9fd1c6a94767d2ea000d6d318";
108
+ function validate$1(obj, path = 'CdpUserRepresentation') {
116
109
  const v_error = (() => {
117
110
  if (typeof obj !== 'object' || ArrayIsArray(obj) || obj === null) {
118
111
  return new TypeError('Expected "object" but received "' + typeof obj + '" (at "' + path + '")');
@@ -135,10 +128,10 @@ function validate$2(obj, path = 'CdpUserRepresentation') {
135
128
  })();
136
129
  return v_error === undefined ? null : v_error;
137
130
  }
138
- const select$6 = function CdpUserRepresentationSelect() {
131
+ const select$2 = function CdpUserRepresentationSelect() {
139
132
  return {
140
133
  kind: 'Fragment',
141
- version: VERSION$2,
134
+ version: VERSION$1,
142
135
  private: [],
143
136
  selections: [
144
137
  {
@@ -156,7 +149,7 @@ const select$6 = function CdpUserRepresentationSelect() {
156
149
  ]
157
150
  };
158
151
  };
159
- function equals$2(existing, incoming) {
152
+ function equals$1(existing, incoming) {
160
153
  const existing_id = existing.id;
161
154
  const incoming_id = incoming.id;
162
155
  if (!(existing_id === incoming_id)) {
@@ -175,8 +168,8 @@ function equals$2(existing, incoming) {
175
168
  return true;
176
169
  }
177
170
 
178
- const VERSION$1 = "bc7c21323d31a68bdc0ef7484dc4fa2b";
179
- function validate$1(obj, path = 'CustomCodeDeploymentRepresentation') {
171
+ const VERSION = "bc7c21323d31a68bdc0ef7484dc4fa2b";
172
+ function validate(obj, path = 'CustomCodeDeploymentRepresentation') {
180
173
  const v_error = (() => {
181
174
  if (typeof obj !== 'object' || ArrayIsArray(obj) || obj === null) {
182
175
  return new TypeError('Expected "object" but received "' + typeof obj + '" (at "' + path + '")');
@@ -193,7 +186,7 @@ function validate$1(obj, path = 'CustomCodeDeploymentRepresentation') {
193
186
  }
194
187
  const obj_createdBy = obj.createdBy;
195
188
  const path_createdBy = path + '.createdBy';
196
- const referencepath_createdByValidationError = validate$2(obj_createdBy, path_createdBy);
189
+ const referencepath_createdByValidationError = validate$1(obj_createdBy, path_createdBy);
197
190
  if (referencepath_createdByValidationError !== null) {
198
191
  let message = 'Object doesn\'t match CdpUserRepresentation (at "' + path_createdBy + '")\n';
199
192
  message += referencepath_createdByValidationError.message.split('\n').map((line) => '\t' + line).join('\n');
@@ -261,7 +254,7 @@ function validate$1(obj, path = 'CustomCodeDeploymentRepresentation') {
261
254
  }
262
255
  const obj_lastModifiedBy = obj.lastModifiedBy;
263
256
  const path_lastModifiedBy = path + '.lastModifiedBy';
264
- const referencepath_lastModifiedByValidationError = validate$2(obj_lastModifiedBy, path_lastModifiedBy);
257
+ const referencepath_lastModifiedByValidationError = validate$1(obj_lastModifiedBy, path_lastModifiedBy);
265
258
  if (referencepath_lastModifiedByValidationError !== null) {
266
259
  let message = 'Object doesn\'t match CdpUserRepresentation (at "' + path_lastModifiedBy + '")\n';
267
260
  message += referencepath_lastModifiedByValidationError.message.split('\n').map((line) => '\t' + line).join('\n');
@@ -316,24 +309,24 @@ function validate$1(obj, path = 'CustomCodeDeploymentRepresentation') {
316
309
  })();
317
310
  return v_error === undefined ? null : v_error;
318
311
  }
319
- const RepresentationType$1 = 'CustomCodeDeploymentRepresentation';
320
- function keyBuilder$5(luvio, config) {
321
- return keyPrefix + '::' + RepresentationType$1 + ':' + config.id;
312
+ const RepresentationType = 'CustomCodeDeploymentRepresentation';
313
+ function keyBuilder(luvio, config) {
314
+ return keyPrefix + '::' + RepresentationType + ':' + config.id;
322
315
  }
323
316
  function keyBuilderFromType(luvio, object) {
324
317
  const keyParams = {
325
318
  id: object.id
326
319
  };
327
- return keyBuilder$5(luvio, keyParams);
320
+ return keyBuilder(luvio, keyParams);
328
321
  }
329
- function normalize$1(input, existing, path, luvio, store, timestamp) {
322
+ function normalize(input, existing, path, luvio, store, timestamp) {
330
323
  return input;
331
324
  }
332
- const select$5 = function CustomCodeDeploymentRepresentationSelect() {
333
- const { selections: CdpUserRepresentation__selections, opaque: CdpUserRepresentation__opaque, } = select$6();
325
+ const select$1 = function CustomCodeDeploymentRepresentationSelect() {
326
+ const { selections: CdpUserRepresentation__selections, opaque: CdpUserRepresentation__opaque, } = select$2();
334
327
  return {
335
328
  kind: 'Fragment',
336
- version: VERSION$1,
329
+ version: VERSION,
337
330
  private: [],
338
331
  selections: [
339
332
  {
@@ -428,7 +421,7 @@ const select$5 = function CustomCodeDeploymentRepresentationSelect() {
428
421
  ]
429
422
  };
430
423
  };
431
- function equals$1(existing, incoming) {
424
+ function equals(existing, incoming) {
432
425
  const existing_deploymentFailureCode = existing.deploymentFailureCode;
433
426
  const incoming_deploymentFailureCode = incoming.deploymentFailureCode;
434
427
  // if at least one of these optionals is defined
@@ -543,7 +536,7 @@ function equals$1(existing, incoming) {
543
536
  }
544
537
  const existing_createdBy = existing.createdBy;
545
538
  const incoming_createdBy = incoming.createdBy;
546
- if (!(equals$2(existing_createdBy, incoming_createdBy))) {
539
+ if (!(equals$1(existing_createdBy, incoming_createdBy))) {
547
540
  return false;
548
541
  }
549
542
  const existing_functionInvokeOptions = existing.functionInvokeOptions;
@@ -566,7 +559,7 @@ function equals$1(existing, incoming) {
566
559
  }
567
560
  const existing_lastModifiedBy = existing.lastModifiedBy;
568
561
  const incoming_lastModifiedBy = incoming.lastModifiedBy;
569
- if (!(equals$2(existing_lastModifiedBy, incoming_lastModifiedBy))) {
562
+ if (!(equals$1(existing_lastModifiedBy, incoming_lastModifiedBy))) {
570
563
  return false;
571
564
  }
572
565
  const existing_parameters = existing.parameters;
@@ -581,41 +574,41 @@ function equals$1(existing, incoming) {
581
574
  }
582
575
  return true;
583
576
  }
584
- const ingest$1 = function CustomCodeDeploymentRepresentationIngest(input, path, luvio, store, timestamp) {
577
+ const ingest = function CustomCodeDeploymentRepresentationIngest(input, path, luvio, store, timestamp) {
585
578
  if (process.env.NODE_ENV !== 'production') {
586
- const validateError = validate$1(input);
579
+ const validateError = validate(input);
587
580
  if (validateError !== null) {
588
581
  throw validateError;
589
582
  }
590
583
  }
591
584
  const key = keyBuilderFromType(luvio, input);
592
585
  const ttlToUse = path.ttl !== undefined ? path.ttl : 60000;
593
- ingestShape(input, path, luvio, store, timestamp, ttlToUse, key, normalize$1, "byoc", VERSION$1, RepresentationType$1, equals$1);
586
+ ingestShape(input, path, luvio, store, timestamp, ttlToUse, key, normalize, "byoc", VERSION, RepresentationType, equals);
594
587
  return createLink(key);
595
588
  };
596
- function getTypeCacheKeys$1(rootKeySet, luvio, input, fullPathFactory) {
589
+ function getTypeCacheKeys(rootKeySet, luvio, input, fullPathFactory) {
597
590
  // root cache key (uses fullPathFactory if keyBuilderFromType isn't defined)
598
591
  const rootKey = keyBuilderFromType(luvio, input);
599
592
  rootKeySet.set(rootKey, {
600
593
  namespace: keyPrefix,
601
- representationName: RepresentationType$1,
594
+ representationName: RepresentationType,
602
595
  mergeable: false
603
596
  });
604
597
  }
605
598
 
606
- function select$4(luvio, params) {
607
- return select$5();
599
+ function select(luvio, params) {
600
+ return select$1();
608
601
  }
609
- function getResponseCacheKeys$4(storeKeyMap, luvio, resourceParams, response) {
610
- getTypeCacheKeys$1(storeKeyMap, luvio, response);
602
+ function getResponseCacheKeys(storeKeyMap, luvio, resourceParams, response) {
603
+ getTypeCacheKeys(storeKeyMap, luvio, response);
611
604
  }
612
- function ingestSuccess$3(luvio, resourceParams, response) {
605
+ function ingestSuccess(luvio, resourceParams, response) {
613
606
  const { body } = response;
614
607
  const key = keyBuilderFromType(luvio, body);
615
- luvio.storeIngest(key, ingest$1, body);
608
+ luvio.storeIngest(key, ingest, body);
616
609
  const snapshot = luvio.storeLookup({
617
610
  recordId: key,
618
- node: select$4(),
611
+ node: select(),
619
612
  variables: {},
620
613
  });
621
614
  if (process.env.NODE_ENV !== 'production') {
@@ -626,7 +619,7 @@ function ingestSuccess$3(luvio, resourceParams, response) {
626
619
  deepFreeze(snapshot.data);
627
620
  return snapshot;
628
621
  }
629
- function createResourceRequest$4(config) {
622
+ function createResourceRequest(config) {
630
623
  const headers = {};
631
624
  return {
632
625
  baseUri: '/services/data/v63.0',
@@ -640,7 +633,7 @@ function createResourceRequest$4(config) {
640
633
  };
641
634
  }
642
635
 
643
- const adapterName$4 = 'createCustomCodeDeployment';
636
+ const adapterName = 'createCustomCodeDeployment';
644
637
  const createCustomCodeDeployment_ConfigPropertyMetadata = [
645
638
  generateParamConfigMetadata('codeType', false, 2 /* Body */, 0 /* String */),
646
639
  generateParamConfigMetadata('computeType', true, 2 /* Body */, 0 /* String */),
@@ -652,11 +645,11 @@ const createCustomCodeDeployment_ConfigPropertyMetadata = [
652
645
  generateParamConfigMetadata('parameters', false, 2 /* Body */, 4 /* Unsupported */),
653
646
  generateParamConfigMetadata('version', true, 2 /* Body */, 0 /* String */),
654
647
  ];
655
- const createCustomCodeDeployment_ConfigPropertyNames = /*#__PURE__*/ buildAdapterValidationConfig(adapterName$4, createCustomCodeDeployment_ConfigPropertyMetadata);
656
- const createResourceParams$4 = /*#__PURE__*/ createResourceParams$5(createCustomCodeDeployment_ConfigPropertyMetadata);
657
- function typeCheckConfig$4(untrustedConfig) {
648
+ const createCustomCodeDeployment_ConfigPropertyNames = /*#__PURE__*/ buildAdapterValidationConfig(adapterName, createCustomCodeDeployment_ConfigPropertyMetadata);
649
+ const createResourceParams = /*#__PURE__*/ createResourceParams$1(createCustomCodeDeployment_ConfigPropertyMetadata);
650
+ function typeCheckConfig(untrustedConfig) {
658
651
  const config = {};
659
- typeCheckConfig$5(untrustedConfig, config, createCustomCodeDeployment_ConfigPropertyMetadata);
652
+ typeCheckConfig$1(untrustedConfig, config, createCustomCodeDeployment_ConfigPropertyMetadata);
660
653
  const untrustedConfig_parameters = untrustedConfig.parameters;
661
654
  if (untrustedIsObject(untrustedConfig_parameters)) {
662
655
  const untrustedConfig_parameters_object = {};
@@ -676,600 +669,6 @@ function typeCheckConfig$4(untrustedConfig) {
676
669
  }
677
670
  return config;
678
671
  }
679
- function validateAdapterConfig$4(untrustedConfig, configPropertyNames) {
680
- if (!untrustedIsObject(untrustedConfig)) {
681
- return null;
682
- }
683
- if (process.env.NODE_ENV !== 'production') {
684
- validateConfig(untrustedConfig, configPropertyNames);
685
- }
686
- const config = typeCheckConfig$4(untrustedConfig);
687
- if (!areRequiredParametersPresent(config, configPropertyNames)) {
688
- return null;
689
- }
690
- return config;
691
- }
692
- function buildNetworkSnapshot$4(luvio, config, options) {
693
- const resourceParams = createResourceParams$4(config);
694
- const request = createResourceRequest$4(resourceParams);
695
- return luvio.dispatchResourceRequest(request, options)
696
- .then((response) => {
697
- return luvio.handleSuccessResponse(() => {
698
- const snapshot = ingestSuccess$3(luvio, resourceParams, response);
699
- return luvio.storeBroadcast().then(() => snapshot);
700
- }, () => {
701
- const cache = new StoreKeyMap();
702
- getResponseCacheKeys$4(cache, luvio, resourceParams, response.body);
703
- return cache;
704
- });
705
- }, (response) => {
706
- deepFreeze(response);
707
- throw response;
708
- });
709
- }
710
- const createCustomCodeDeploymentAdapterFactory = (luvio) => {
711
- return function createCustomCodeDeployment(untrustedConfig) {
712
- const config = validateAdapterConfig$4(untrustedConfig, createCustomCodeDeployment_ConfigPropertyNames);
713
- // Invalid or incomplete config
714
- if (config === null) {
715
- throw new Error('Invalid config for "createCustomCodeDeployment"');
716
- }
717
- return buildNetworkSnapshot$4(luvio, config);
718
- };
719
- };
720
-
721
- const VERSION = "3d9a814ca87df7e7c79c5d385c146820";
722
- function validate(obj, path = 'CustomCodeDeploymentCollectionRepresentation') {
723
- const v_error = (() => {
724
- if (typeof obj !== 'object' || ArrayIsArray(obj) || obj === null) {
725
- return new TypeError('Expected "object" but received "' + typeof obj + '" (at "' + path + '")');
726
- }
727
- const obj_currentPageUrl = obj.currentPageUrl;
728
- const path_currentPageUrl = path + '.currentPageUrl';
729
- if (typeof obj_currentPageUrl !== 'string') {
730
- return new TypeError('Expected "string" but received "' + typeof obj_currentPageUrl + '" (at "' + path_currentPageUrl + '")');
731
- }
732
- const obj_customCodeDeployments = obj.customCodeDeployments;
733
- const path_customCodeDeployments = path + '.customCodeDeployments';
734
- if (!ArrayIsArray(obj_customCodeDeployments)) {
735
- return new TypeError('Expected "array" but received "' + typeof obj_customCodeDeployments + '" (at "' + path_customCodeDeployments + '")');
736
- }
737
- for (let i = 0; i < obj_customCodeDeployments.length; i++) {
738
- const obj_customCodeDeployments_item = obj_customCodeDeployments[i];
739
- const path_customCodeDeployments_item = path_customCodeDeployments + '[' + i + ']';
740
- if (typeof obj_customCodeDeployments_item !== 'object') {
741
- return new TypeError('Expected "object" but received "' + typeof obj_customCodeDeployments_item + '" (at "' + path_customCodeDeployments_item + '")');
742
- }
743
- }
744
- if (obj.nextPageUrl !== undefined) {
745
- const obj_nextPageUrl = obj.nextPageUrl;
746
- const path_nextPageUrl = path + '.nextPageUrl';
747
- if (typeof obj_nextPageUrl !== 'string') {
748
- return new TypeError('Expected "string" but received "' + typeof obj_nextPageUrl + '" (at "' + path_nextPageUrl + '")');
749
- }
750
- }
751
- const obj_totalSize = obj.totalSize;
752
- const path_totalSize = path + '.totalSize';
753
- if (typeof obj_totalSize !== 'number' || (typeof obj_totalSize === 'number' && Math.floor(obj_totalSize) !== obj_totalSize)) {
754
- return new TypeError('Expected "integer" but received "' + typeof obj_totalSize + '" (at "' + path_totalSize + '")');
755
- }
756
- })();
757
- return v_error === undefined ? null : v_error;
758
- }
759
- const RepresentationType = 'CustomCodeDeploymentCollectionRepresentation';
760
- function normalize(input, existing, path, luvio, store, timestamp) {
761
- const input_customCodeDeployments = input.customCodeDeployments;
762
- const input_customCodeDeployments_id = path.fullPath + '__customCodeDeployments';
763
- for (let i = 0; i < input_customCodeDeployments.length; i++) {
764
- const input_customCodeDeployments_item = input_customCodeDeployments[i];
765
- let input_customCodeDeployments_item_id = input_customCodeDeployments_id + '__' + i;
766
- input_customCodeDeployments[i] = ingest$1(input_customCodeDeployments_item, {
767
- fullPath: input_customCodeDeployments_item_id,
768
- propertyName: i,
769
- parent: {
770
- data: input,
771
- key: path.fullPath,
772
- existing: existing,
773
- },
774
- ttl: path.ttl
775
- }, luvio, store, timestamp);
776
- }
777
- return input;
778
- }
779
- const select$3 = function CustomCodeDeploymentCollectionRepresentationSelect() {
780
- return {
781
- kind: 'Fragment',
782
- version: VERSION,
783
- private: [],
784
- selections: [
785
- {
786
- name: 'currentPageUrl',
787
- kind: 'Scalar'
788
- },
789
- {
790
- name: 'customCodeDeployments',
791
- kind: 'Link',
792
- plural: true,
793
- fragment: select$5()
794
- },
795
- {
796
- name: 'nextPageUrl',
797
- kind: 'Scalar',
798
- required: false
799
- },
800
- {
801
- name: 'totalSize',
802
- kind: 'Scalar'
803
- }
804
- ]
805
- };
806
- };
807
- function equals(existing, incoming) {
808
- const existing_totalSize = existing.totalSize;
809
- const incoming_totalSize = incoming.totalSize;
810
- if (!(existing_totalSize === incoming_totalSize)) {
811
- return false;
812
- }
813
- const existing_currentPageUrl = existing.currentPageUrl;
814
- const incoming_currentPageUrl = incoming.currentPageUrl;
815
- if (!(existing_currentPageUrl === incoming_currentPageUrl)) {
816
- return false;
817
- }
818
- const existing_nextPageUrl = existing.nextPageUrl;
819
- const incoming_nextPageUrl = incoming.nextPageUrl;
820
- // if at least one of these optionals is defined
821
- if (existing_nextPageUrl !== undefined || incoming_nextPageUrl !== undefined) {
822
- // if one of these is not defined we know the other is defined and therefore
823
- // not equal
824
- if (existing_nextPageUrl === undefined || incoming_nextPageUrl === undefined) {
825
- return false;
826
- }
827
- if (!(existing_nextPageUrl === incoming_nextPageUrl)) {
828
- return false;
829
- }
830
- }
831
- const existing_customCodeDeployments = existing.customCodeDeployments;
832
- const incoming_customCodeDeployments = incoming.customCodeDeployments;
833
- const equals_customCodeDeployments_items = equalsArray(existing_customCodeDeployments, incoming_customCodeDeployments, (existing_customCodeDeployments_item, incoming_customCodeDeployments_item) => {
834
- if (!(existing_customCodeDeployments_item.__ref === incoming_customCodeDeployments_item.__ref)) {
835
- return false;
836
- }
837
- });
838
- if (equals_customCodeDeployments_items === false) {
839
- return false;
840
- }
841
- return true;
842
- }
843
- const ingest = function CustomCodeDeploymentCollectionRepresentationIngest(input, path, luvio, store, timestamp) {
844
- if (process.env.NODE_ENV !== 'production') {
845
- const validateError = validate(input);
846
- if (validateError !== null) {
847
- throw validateError;
848
- }
849
- }
850
- const key = path.fullPath;
851
- const ttlToUse = path.ttl !== undefined ? path.ttl : 60000;
852
- ingestShape(input, path, luvio, store, timestamp, ttlToUse, key, normalize, "byoc", VERSION, RepresentationType, equals);
853
- return createLink(key);
854
- };
855
- function getTypeCacheKeys(rootKeySet, luvio, input, fullPathFactory) {
856
- // root cache key (uses fullPathFactory if keyBuilderFromType isn't defined)
857
- const rootKey = fullPathFactory();
858
- rootKeySet.set(rootKey, {
859
- namespace: keyPrefix,
860
- representationName: RepresentationType,
861
- mergeable: false
862
- });
863
- const input_customCodeDeployments_length = input.customCodeDeployments.length;
864
- for (let i = 0; i < input_customCodeDeployments_length; i++) {
865
- getTypeCacheKeys$1(rootKeySet, luvio, input.customCodeDeployments[i]);
866
- }
867
- }
868
-
869
- function select$2(luvio, params) {
870
- return select$3();
871
- }
872
- function keyBuilder$4(luvio, params) {
873
- return keyPrefix + '::CustomCodeDeploymentCollectionRepresentation:(' + 'limit:' + params.queryParams.limit + ',' + 'offset:' + params.queryParams.offset + ',' + 'orderBy:' + params.queryParams.orderBy + ')';
874
- }
875
- function getResponseCacheKeys$3(storeKeyMap, luvio, resourceParams, response) {
876
- getTypeCacheKeys(storeKeyMap, luvio, response, () => keyBuilder$4(luvio, resourceParams));
877
- }
878
- function ingestSuccess$2(luvio, resourceParams, response, snapshotRefresh) {
879
- const { body } = response;
880
- const key = keyBuilder$4(luvio, resourceParams);
881
- luvio.storeIngest(key, ingest, body);
882
- const snapshot = luvio.storeLookup({
883
- recordId: key,
884
- node: select$2(),
885
- variables: {},
886
- }, snapshotRefresh);
887
- if (process.env.NODE_ENV !== 'production') {
888
- if (snapshot.state !== 'Fulfilled') {
889
- throw new Error('Invalid network response. Expected resource response to result in Fulfilled snapshot');
890
- }
891
- }
892
- deepFreeze(snapshot.data);
893
- return snapshot;
894
- }
895
- function ingestError$1(luvio, params, error, snapshotRefresh) {
896
- const key = keyBuilder$4(luvio, params);
897
- const errorSnapshot = luvio.errorSnapshot(error, snapshotRefresh);
898
- luvio.storeIngestError(key, errorSnapshot);
899
- return errorSnapshot;
900
- }
901
- function createResourceRequest$3(config) {
902
- const headers = {};
903
- return {
904
- baseUri: '/services/data/v63.0',
905
- basePath: '/ssot/data-custom-code',
906
- method: 'get',
907
- body: null,
908
- urlParams: {},
909
- queryParams: config.queryParams,
910
- headers,
911
- priority: 'normal',
912
- };
913
- }
914
-
915
- const adapterName$3 = 'getCustomCodeDeployments';
916
- const getCustomCodeDeployments_ConfigPropertyMetadata = [
917
- generateParamConfigMetadata('limit', false, 1 /* QueryParameter */, 3 /* Integer */),
918
- generateParamConfigMetadata('offset', false, 1 /* QueryParameter */, 3 /* Integer */),
919
- generateParamConfigMetadata('orderBy', false, 1 /* QueryParameter */, 0 /* String */),
920
- ];
921
- const getCustomCodeDeployments_ConfigPropertyNames = /*#__PURE__*/ buildAdapterValidationConfig(adapterName$3, getCustomCodeDeployments_ConfigPropertyMetadata);
922
- const createResourceParams$3 = /*#__PURE__*/ createResourceParams$5(getCustomCodeDeployments_ConfigPropertyMetadata);
923
- function keyBuilder$3(luvio, config) {
924
- const resourceParams = createResourceParams$3(config);
925
- return keyBuilder$4(luvio, resourceParams);
926
- }
927
- function typeCheckConfig$3(untrustedConfig) {
928
- const config = {};
929
- typeCheckConfig$5(untrustedConfig, config, getCustomCodeDeployments_ConfigPropertyMetadata);
930
- return config;
931
- }
932
- function validateAdapterConfig$3(untrustedConfig, configPropertyNames) {
933
- if (!untrustedIsObject(untrustedConfig)) {
934
- return null;
935
- }
936
- if (process.env.NODE_ENV !== 'production') {
937
- validateConfig(untrustedConfig, configPropertyNames);
938
- }
939
- const config = typeCheckConfig$3(untrustedConfig);
940
- if (!areRequiredParametersPresent(config, configPropertyNames)) {
941
- return null;
942
- }
943
- return config;
944
- }
945
- function adapterFragment$1(luvio, config) {
946
- createResourceParams$3(config);
947
- return select$2();
948
- }
949
- function onFetchResponseSuccess$1(luvio, config, resourceParams, response) {
950
- const snapshot = ingestSuccess$2(luvio, resourceParams, response, {
951
- config,
952
- resolve: () => buildNetworkSnapshot$3(luvio, config, snapshotRefreshOptions)
953
- });
954
- return luvio.storeBroadcast().then(() => snapshot);
955
- }
956
- function onFetchResponseError$1(luvio, config, resourceParams, response) {
957
- const snapshot = ingestError$1(luvio, resourceParams, response, {
958
- config,
959
- resolve: () => buildNetworkSnapshot$3(luvio, config, snapshotRefreshOptions)
960
- });
961
- return luvio.storeBroadcast().then(() => snapshot);
962
- }
963
- function buildNetworkSnapshot$3(luvio, config, options) {
964
- const resourceParams = createResourceParams$3(config);
965
- const request = createResourceRequest$3(resourceParams);
966
- return luvio.dispatchResourceRequest(request, options)
967
- .then((response) => {
968
- return luvio.handleSuccessResponse(() => onFetchResponseSuccess$1(luvio, config, resourceParams, response), () => {
969
- const cache = new StoreKeyMap();
970
- getResponseCacheKeys$3(cache, luvio, resourceParams, response.body);
971
- return cache;
972
- });
973
- }, (response) => {
974
- return luvio.handleErrorResponse(() => onFetchResponseError$1(luvio, config, resourceParams, response));
975
- });
976
- }
977
- function buildNetworkSnapshotCachePolicy$1(context, coercedAdapterRequestContext) {
978
- return buildNetworkSnapshotCachePolicy$2(context, coercedAdapterRequestContext, buildNetworkSnapshot$3, undefined, false);
979
- }
980
- function buildCachedSnapshotCachePolicy$1(context, storeLookup) {
981
- const { luvio, config } = context;
982
- const selector = {
983
- recordId: keyBuilder$3(luvio, config),
984
- node: adapterFragment$1(luvio, config),
985
- variables: {},
986
- };
987
- const cacheSnapshot = storeLookup(selector, {
988
- config,
989
- resolve: () => buildNetworkSnapshot$3(luvio, config, snapshotRefreshOptions)
990
- });
991
- return cacheSnapshot;
992
- }
993
- const getCustomCodeDeploymentsAdapterFactory = (luvio) => function byoc__getCustomCodeDeployments(untrustedConfig, requestContext) {
994
- const config = validateAdapterConfig$3(untrustedConfig, getCustomCodeDeployments_ConfigPropertyNames);
995
- // Invalid or incomplete config
996
- if (config === null) {
997
- return null;
998
- }
999
- return luvio.applyCachePolicy((requestContext || {}), { config, luvio }, // BuildSnapshotContext
1000
- buildCachedSnapshotCachePolicy$1, buildNetworkSnapshotCachePolicy$1);
1001
- };
1002
-
1003
- function keyBuilder$2(luvio, params) {
1004
- return keyBuilder$5(luvio, {
1005
- id: params.urlParams.customCodeNameOrId
1006
- });
1007
- }
1008
- function getResponseCacheKeys$2(cacheKeyMap, luvio, resourceParams) {
1009
- const key = keyBuilder$2(luvio, resourceParams);
1010
- cacheKeyMap.set(key, {
1011
- namespace: keyPrefix,
1012
- representationName: RepresentationType$1,
1013
- mergeable: false
1014
- });
1015
- }
1016
- function evictSuccess(luvio, resourceParams) {
1017
- const key = keyBuilder$2(luvio, resourceParams);
1018
- luvio.storeEvict(key);
1019
- }
1020
- function createResourceRequest$2(config) {
1021
- const headers = {};
1022
- return {
1023
- baseUri: '/services/data/v63.0',
1024
- basePath: '/ssot/data-custom-code/' + config.urlParams.customCodeNameOrId + '',
1025
- method: 'delete',
1026
- body: null,
1027
- urlParams: config.urlParams,
1028
- queryParams: {},
1029
- headers,
1030
- priority: 'normal',
1031
- };
1032
- }
1033
-
1034
- const adapterName$2 = 'deleteCustomCodeDeployment';
1035
- const deleteCustomCodeDeployment_ConfigPropertyMetadata = [
1036
- generateParamConfigMetadata('customCodeNameOrId', true, 0 /* UrlParameter */, 0 /* String */),
1037
- ];
1038
- const deleteCustomCodeDeployment_ConfigPropertyNames = /*#__PURE__*/ buildAdapterValidationConfig(adapterName$2, deleteCustomCodeDeployment_ConfigPropertyMetadata);
1039
- const createResourceParams$2 = /*#__PURE__*/ createResourceParams$5(deleteCustomCodeDeployment_ConfigPropertyMetadata);
1040
- function typeCheckConfig$2(untrustedConfig) {
1041
- const config = {};
1042
- typeCheckConfig$5(untrustedConfig, config, deleteCustomCodeDeployment_ConfigPropertyMetadata);
1043
- return config;
1044
- }
1045
- function validateAdapterConfig$2(untrustedConfig, configPropertyNames) {
1046
- if (!untrustedIsObject(untrustedConfig)) {
1047
- return null;
1048
- }
1049
- if (process.env.NODE_ENV !== 'production') {
1050
- validateConfig(untrustedConfig, configPropertyNames);
1051
- }
1052
- const config = typeCheckConfig$2(untrustedConfig);
1053
- if (!areRequiredParametersPresent(config, configPropertyNames)) {
1054
- return null;
1055
- }
1056
- return config;
1057
- }
1058
- function buildNetworkSnapshot$2(luvio, config, options) {
1059
- const resourceParams = createResourceParams$2(config);
1060
- const request = createResourceRequest$2(resourceParams);
1061
- return luvio.dispatchResourceRequest(request, options)
1062
- .then(() => {
1063
- return luvio.handleSuccessResponse(() => {
1064
- evictSuccess(luvio, resourceParams);
1065
- return luvio.storeBroadcast();
1066
- }, () => {
1067
- const cache = new StoreKeyMap();
1068
- getResponseCacheKeys$2(cache, luvio, resourceParams);
1069
- return cache;
1070
- });
1071
- }, (response) => {
1072
- deepFreeze(response);
1073
- throw response;
1074
- });
1075
- }
1076
- const deleteCustomCodeDeploymentAdapterFactory = (luvio) => {
1077
- return function byocdeleteCustomCodeDeployment(untrustedConfig) {
1078
- const config = validateAdapterConfig$2(untrustedConfig, deleteCustomCodeDeployment_ConfigPropertyNames);
1079
- // Invalid or incomplete config
1080
- if (config === null) {
1081
- throw new Error(`Invalid config for "${adapterName$2}"`);
1082
- }
1083
- return buildNetworkSnapshot$2(luvio, config);
1084
- };
1085
- };
1086
-
1087
- function select$1(luvio, params) {
1088
- return select$5();
1089
- }
1090
- function keyBuilder$1(luvio, params) {
1091
- return keyBuilder$5(luvio, {
1092
- id: params.urlParams.customCodeNameOrId
1093
- });
1094
- }
1095
- function getResponseCacheKeys$1(storeKeyMap, luvio, resourceParams, response) {
1096
- getTypeCacheKeys$1(storeKeyMap, luvio, response);
1097
- }
1098
- function ingestSuccess$1(luvio, resourceParams, response, snapshotRefresh) {
1099
- const { body } = response;
1100
- const key = keyBuilder$1(luvio, resourceParams);
1101
- luvio.storeIngest(key, ingest$1, body);
1102
- const snapshot = luvio.storeLookup({
1103
- recordId: key,
1104
- node: select$1(),
1105
- variables: {},
1106
- }, snapshotRefresh);
1107
- if (process.env.NODE_ENV !== 'production') {
1108
- if (snapshot.state !== 'Fulfilled') {
1109
- throw new Error('Invalid network response. Expected resource response to result in Fulfilled snapshot');
1110
- }
1111
- }
1112
- deepFreeze(snapshot.data);
1113
- return snapshot;
1114
- }
1115
- function ingestError(luvio, params, error, snapshotRefresh) {
1116
- const key = keyBuilder$1(luvio, params);
1117
- const errorSnapshot = luvio.errorSnapshot(error, snapshotRefresh);
1118
- luvio.storeIngestError(key, errorSnapshot);
1119
- return errorSnapshot;
1120
- }
1121
- function createResourceRequest$1(config) {
1122
- const headers = {};
1123
- return {
1124
- baseUri: '/services/data/v63.0',
1125
- basePath: '/ssot/data-custom-code/' + config.urlParams.customCodeNameOrId + '',
1126
- method: 'get',
1127
- body: null,
1128
- urlParams: config.urlParams,
1129
- queryParams: {},
1130
- headers,
1131
- priority: 'normal',
1132
- };
1133
- }
1134
-
1135
- const adapterName$1 = 'getCustomCodeDeployment';
1136
- const getCustomCodeDeployment_ConfigPropertyMetadata = [
1137
- generateParamConfigMetadata('customCodeNameOrId', true, 0 /* UrlParameter */, 0 /* String */),
1138
- ];
1139
- const getCustomCodeDeployment_ConfigPropertyNames = /*#__PURE__*/ buildAdapterValidationConfig(adapterName$1, getCustomCodeDeployment_ConfigPropertyMetadata);
1140
- const createResourceParams$1 = /*#__PURE__*/ createResourceParams$5(getCustomCodeDeployment_ConfigPropertyMetadata);
1141
- function keyBuilder(luvio, config) {
1142
- const resourceParams = createResourceParams$1(config);
1143
- return keyBuilder$1(luvio, resourceParams);
1144
- }
1145
- function typeCheckConfig$1(untrustedConfig) {
1146
- const config = {};
1147
- typeCheckConfig$5(untrustedConfig, config, getCustomCodeDeployment_ConfigPropertyMetadata);
1148
- return config;
1149
- }
1150
- function validateAdapterConfig$1(untrustedConfig, configPropertyNames) {
1151
- if (!untrustedIsObject(untrustedConfig)) {
1152
- return null;
1153
- }
1154
- if (process.env.NODE_ENV !== 'production') {
1155
- validateConfig(untrustedConfig, configPropertyNames);
1156
- }
1157
- const config = typeCheckConfig$1(untrustedConfig);
1158
- if (!areRequiredParametersPresent(config, configPropertyNames)) {
1159
- return null;
1160
- }
1161
- return config;
1162
- }
1163
- function adapterFragment(luvio, config) {
1164
- createResourceParams$1(config);
1165
- return select$1();
1166
- }
1167
- function onFetchResponseSuccess(luvio, config, resourceParams, response) {
1168
- const snapshot = ingestSuccess$1(luvio, resourceParams, response, {
1169
- config,
1170
- resolve: () => buildNetworkSnapshot$1(luvio, config, snapshotRefreshOptions)
1171
- });
1172
- return luvio.storeBroadcast().then(() => snapshot);
1173
- }
1174
- function onFetchResponseError(luvio, config, resourceParams, response) {
1175
- const snapshot = ingestError(luvio, resourceParams, response, {
1176
- config,
1177
- resolve: () => buildNetworkSnapshot$1(luvio, config, snapshotRefreshOptions)
1178
- });
1179
- return luvio.storeBroadcast().then(() => snapshot);
1180
- }
1181
- function buildNetworkSnapshot$1(luvio, config, options) {
1182
- const resourceParams = createResourceParams$1(config);
1183
- const request = createResourceRequest$1(resourceParams);
1184
- return luvio.dispatchResourceRequest(request, options)
1185
- .then((response) => {
1186
- return luvio.handleSuccessResponse(() => onFetchResponseSuccess(luvio, config, resourceParams, response), () => {
1187
- const cache = new StoreKeyMap();
1188
- getResponseCacheKeys$1(cache, luvio, resourceParams, response.body);
1189
- return cache;
1190
- });
1191
- }, (response) => {
1192
- return luvio.handleErrorResponse(() => onFetchResponseError(luvio, config, resourceParams, response));
1193
- });
1194
- }
1195
- function buildNetworkSnapshotCachePolicy(context, coercedAdapterRequestContext) {
1196
- return buildNetworkSnapshotCachePolicy$2(context, coercedAdapterRequestContext, buildNetworkSnapshot$1, undefined, false);
1197
- }
1198
- function buildCachedSnapshotCachePolicy(context, storeLookup) {
1199
- const { luvio, config } = context;
1200
- const selector = {
1201
- recordId: keyBuilder(luvio, config),
1202
- node: adapterFragment(luvio, config),
1203
- variables: {},
1204
- };
1205
- const cacheSnapshot = storeLookup(selector, {
1206
- config,
1207
- resolve: () => buildNetworkSnapshot$1(luvio, config, snapshotRefreshOptions)
1208
- });
1209
- return cacheSnapshot;
1210
- }
1211
- const getCustomCodeDeploymentAdapterFactory = (luvio) => function byoc__getCustomCodeDeployment(untrustedConfig, requestContext) {
1212
- const config = validateAdapterConfig$1(untrustedConfig, getCustomCodeDeployment_ConfigPropertyNames);
1213
- // Invalid or incomplete config
1214
- if (config === null) {
1215
- return null;
1216
- }
1217
- return luvio.applyCachePolicy((requestContext || {}), { config, luvio }, // BuildSnapshotContext
1218
- buildCachedSnapshotCachePolicy, buildNetworkSnapshotCachePolicy);
1219
- };
1220
-
1221
- function select(luvio, params) {
1222
- return select$5();
1223
- }
1224
- function getResponseCacheKeys(storeKeyMap, luvio, resourceParams, response) {
1225
- getTypeCacheKeys$1(storeKeyMap, luvio, response);
1226
- }
1227
- function ingestSuccess(luvio, resourceParams, response) {
1228
- const { body } = response;
1229
- const key = keyBuilderFromType(luvio, body);
1230
- luvio.storeIngest(key, ingest$1, body);
1231
- const snapshot = luvio.storeLookup({
1232
- recordId: key,
1233
- node: select(),
1234
- variables: {},
1235
- });
1236
- if (process.env.NODE_ENV !== 'production') {
1237
- if (snapshot.state !== 'Fulfilled') {
1238
- throw new Error('Invalid network response. Expected resource response to result in Fulfilled snapshot');
1239
- }
1240
- }
1241
- deepFreeze(snapshot.data);
1242
- return snapshot;
1243
- }
1244
- function createResourceRequest(config) {
1245
- const headers = {};
1246
- return {
1247
- baseUri: '/services/data/v63.0',
1248
- basePath: '/ssot/data-custom-code/' + config.urlParams.customCodeNameOrId + '',
1249
- method: 'patch',
1250
- body: config.body,
1251
- urlParams: config.urlParams,
1252
- queryParams: {},
1253
- headers,
1254
- priority: 'normal',
1255
- };
1256
- }
1257
-
1258
- const adapterName = 'updateCustomCodeDeployment';
1259
- const updateCustomCodeDeployment_ConfigPropertyMetadata = [
1260
- generateParamConfigMetadata('customCodeNameOrId', true, 0 /* UrlParameter */, 0 /* String */),
1261
- generateParamConfigMetadata('computeType', false, 2 /* Body */, 0 /* String */),
1262
- generateParamConfigMetadata('description', false, 2 /* Body */, 0 /* String */),
1263
- generateParamConfigMetadata('label', false, 2 /* Body */, 0 /* String */),
1264
- generateParamConfigMetadata('version', false, 2 /* Body */, 0 /* String */),
1265
- ];
1266
- const updateCustomCodeDeployment_ConfigPropertyNames = /*#__PURE__*/ buildAdapterValidationConfig(adapterName, updateCustomCodeDeployment_ConfigPropertyMetadata);
1267
- const createResourceParams = /*#__PURE__*/ createResourceParams$5(updateCustomCodeDeployment_ConfigPropertyMetadata);
1268
- function typeCheckConfig(untrustedConfig) {
1269
- const config = {};
1270
- typeCheckConfig$5(untrustedConfig, config, updateCustomCodeDeployment_ConfigPropertyMetadata);
1271
- return config;
1272
- }
1273
672
  function validateAdapterConfig(untrustedConfig, configPropertyNames) {
1274
673
  if (!untrustedIsObject(untrustedConfig)) {
1275
674
  return null;
@@ -1301,15 +700,15 @@ function buildNetworkSnapshot(luvio, config, options) {
1301
700
  throw response;
1302
701
  });
1303
702
  }
1304
- const updateCustomCodeDeploymentAdapterFactory = (luvio) => {
1305
- return function updateCustomCodeDeployment(untrustedConfig) {
1306
- const config = validateAdapterConfig(untrustedConfig, updateCustomCodeDeployment_ConfigPropertyNames);
703
+ const createCustomCodeDeploymentAdapterFactory = (luvio) => {
704
+ return function createCustomCodeDeployment(untrustedConfig) {
705
+ const config = validateAdapterConfig(untrustedConfig, createCustomCodeDeployment_ConfigPropertyNames);
1307
706
  // Invalid or incomplete config
1308
707
  if (config === null) {
1309
- throw new Error('Invalid config for "updateCustomCodeDeployment"');
708
+ throw new Error('Invalid config for "createCustomCodeDeployment"');
1310
709
  }
1311
710
  return buildNetworkSnapshot(luvio, config);
1312
711
  };
1313
712
  };
1314
713
 
1315
- export { createCustomCodeDeploymentAdapterFactory, deleteCustomCodeDeploymentAdapterFactory, getCustomCodeDeploymentAdapterFactory, getCustomCodeDeploymentsAdapterFactory, updateCustomCodeDeploymentAdapterFactory };
714
+ export { createCustomCodeDeploymentAdapterFactory };