@salesforce/lds-adapters-industries-sustainability-reference-data-v2 1.124.2 → 1.124.3

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.
Files changed (22) hide show
  1. package/dist/es/es2018/industries-sustainability-reference-data-v2.js +714 -714
  2. package/dist/{types → es/es2018/types}/src/generated/adapters/adapter-utils.d.ts +66 -66
  3. package/dist/{types → es/es2018/types}/src/generated/adapters/getEntityVersion.d.ts +30 -30
  4. package/dist/{types → es/es2018/types}/src/generated/adapters/uploadEntityVersion.d.ts +15 -15
  5. package/dist/{types → es/es2018/types}/src/generated/artifacts/main.d.ts +2 -2
  6. package/dist/{types → es/es2018/types}/src/generated/artifacts/sfdc.d.ts +4 -4
  7. package/dist/{types → es/es2018/types}/src/generated/resources/getConnectSustainabilityReferenceDataV2EntitySectionDataSourceVersionByEntitySectionAndReferenceDataSource.d.ts +21 -21
  8. package/dist/{types → es/es2018/types}/src/generated/resources/putConnectSustainabilityReferenceDataV2EntityVersionUpload.d.ts +13 -13
  9. package/dist/{types → es/es2018/types}/src/generated/types/EntityDataSourceVersionDetailRepresentation.d.ts +38 -38
  10. package/dist/{types → es/es2018/types}/src/generated/types/FetchEntityVersionOutputRepresentation.d.ts +31 -31
  11. package/dist/{types → es/es2018/types}/src/generated/types/ReferenceDataEntityRepresentation.d.ts +33 -33
  12. package/dist/{types → es/es2018/types}/src/generated/types/ReferenceDataSourceRepresentation.d.ts +39 -39
  13. package/dist/{types → es/es2018/types}/src/generated/types/ReferenceDataVersionRepresentation.d.ts +56 -56
  14. package/dist/{types → es/es2018/types}/src/generated/types/UploadEntityVersionInputRepresentation.d.ts +30 -30
  15. package/dist/{types → es/es2018/types}/src/generated/types/UploadEntityVersionInputWrapperRepresentation.d.ts +29 -29
  16. package/dist/{types → es/es2018/types}/src/generated/types/UploadEntityVersionOutputRepresentation.d.ts +42 -42
  17. package/dist/{types → es/es2018/types}/src/generated/types/type-utils.d.ts +39 -39
  18. package/package.json +5 -5
  19. package/sfdc/index.d.ts +1 -1
  20. package/sfdc/index.js +741 -741
  21. package/dist/umd/es2018/industries-sustainability-reference-data-v2.js +0 -758
  22. package/dist/umd/es5/industries-sustainability-reference-data-v2.js +0 -765
@@ -6,744 +6,744 @@
6
6
 
7
7
  import { serializeStructuredKey, StoreKeyMap } from '@luvio/engine';
8
8
 
9
- const { hasOwnProperty: ObjectPrototypeHasOwnProperty } = Object.prototype;
10
- const { keys: ObjectKeys$1, freeze: ObjectFreeze$1, create: ObjectCreate$1 } = Object;
11
- const { isArray: ArrayIsArray$1 } = Array;
12
- /**
13
- * Validates an adapter config is well-formed.
14
- * @param config The config to validate.
15
- * @param adapter The adapter validation configuration.
16
- * @param oneOf The keys the config must contain at least one of.
17
- * @throws A TypeError if config doesn't satisfy the adapter's config validation.
18
- */
19
- function validateConfig(config, adapter, oneOf) {
20
- const { displayName } = adapter;
21
- const { required, optional, unsupported } = adapter.parameters;
22
- if (config === undefined ||
23
- required.every(req => ObjectPrototypeHasOwnProperty.call(config, req)) === false) {
24
- throw new TypeError(`adapter ${displayName} configuration must specify ${required.sort().join(', ')}`);
25
- }
26
- if (oneOf && oneOf.some(req => ObjectPrototypeHasOwnProperty.call(config, req)) === false) {
27
- throw new TypeError(`adapter ${displayName} configuration must specify one of ${oneOf.sort().join(', ')}`);
28
- }
29
- if (unsupported !== undefined &&
30
- unsupported.some(req => ObjectPrototypeHasOwnProperty.call(config, req))) {
31
- throw new TypeError(`adapter ${displayName} does not yet support ${unsupported.sort().join(', ')}`);
32
- }
33
- const supported = required.concat(optional);
34
- if (ObjectKeys$1(config).some(key => !supported.includes(key))) {
35
- throw new TypeError(`adapter ${displayName} configuration supports only ${supported.sort().join(', ')}`);
36
- }
37
- }
38
- function untrustedIsObject(untrusted) {
39
- return typeof untrusted === 'object' && untrusted !== null && ArrayIsArray$1(untrusted) === false;
40
- }
41
- function areRequiredParametersPresent(config, configPropertyNames) {
42
- return configPropertyNames.parameters.required.every(req => req in config);
43
- }
44
- const snapshotRefreshOptions = {
45
- overrides: {
46
- headers: {
47
- 'Cache-Control': 'no-cache',
48
- },
49
- }
50
- };
9
+ const { hasOwnProperty: ObjectPrototypeHasOwnProperty } = Object.prototype;
10
+ const { keys: ObjectKeys$1, freeze: ObjectFreeze$1, create: ObjectCreate$1 } = Object;
11
+ const { isArray: ArrayIsArray$1 } = Array;
12
+ /**
13
+ * Validates an adapter config is well-formed.
14
+ * @param config The config to validate.
15
+ * @param adapter The adapter validation configuration.
16
+ * @param oneOf The keys the config must contain at least one of.
17
+ * @throws A TypeError if config doesn't satisfy the adapter's config validation.
18
+ */
19
+ function validateConfig(config, adapter, oneOf) {
20
+ const { displayName } = adapter;
21
+ const { required, optional, unsupported } = adapter.parameters;
22
+ if (config === undefined ||
23
+ required.every(req => ObjectPrototypeHasOwnProperty.call(config, req)) === false) {
24
+ throw new TypeError(`adapter ${displayName} configuration must specify ${required.sort().join(', ')}`);
25
+ }
26
+ if (oneOf && oneOf.some(req => ObjectPrototypeHasOwnProperty.call(config, req)) === false) {
27
+ throw new TypeError(`adapter ${displayName} configuration must specify one of ${oneOf.sort().join(', ')}`);
28
+ }
29
+ if (unsupported !== undefined &&
30
+ unsupported.some(req => ObjectPrototypeHasOwnProperty.call(config, req))) {
31
+ throw new TypeError(`adapter ${displayName} does not yet support ${unsupported.sort().join(', ')}`);
32
+ }
33
+ const supported = required.concat(optional);
34
+ if (ObjectKeys$1(config).some(key => !supported.includes(key))) {
35
+ throw new TypeError(`adapter ${displayName} configuration supports only ${supported.sort().join(', ')}`);
36
+ }
37
+ }
38
+ function untrustedIsObject(untrusted) {
39
+ return typeof untrusted === 'object' && untrusted !== null && ArrayIsArray$1(untrusted) === false;
40
+ }
41
+ function areRequiredParametersPresent(config, configPropertyNames) {
42
+ return configPropertyNames.parameters.required.every(req => req in config);
43
+ }
44
+ const snapshotRefreshOptions = {
45
+ overrides: {
46
+ headers: {
47
+ 'Cache-Control': 'no-cache',
48
+ },
49
+ }
50
+ };
51
51
  const keyPrefix = 'sustainability-reference-data-v2';
52
52
 
53
- const { freeze: ObjectFreeze, keys: ObjectKeys, create: ObjectCreate, assign: ObjectAssign } = Object;
54
- const { isArray: ArrayIsArray } = Array;
55
- const { stringify: JSONStringify } = JSON;
56
- function deepFreeze$5(value) {
57
- // No need to freeze primitives
58
- if (typeof value !== 'object' || value === null) {
59
- return;
60
- }
61
- if (ArrayIsArray(value)) {
62
- for (let i = 0, len = value.length; i < len; i += 1) {
63
- deepFreeze$5(value[i]);
64
- }
65
- }
66
- else {
67
- const keys = ObjectKeys(value);
68
- for (let i = 0, len = keys.length; i < len; i += 1) {
69
- deepFreeze$5(value[keys[i]]);
70
- }
71
- }
72
- ObjectFreeze(value);
73
- }
74
- function createLink(ref) {
75
- return {
76
- __ref: serializeStructuredKey(ref),
77
- };
53
+ const { freeze: ObjectFreeze, keys: ObjectKeys, create: ObjectCreate, assign: ObjectAssign } = Object;
54
+ const { isArray: ArrayIsArray } = Array;
55
+ const { stringify: JSONStringify } = JSON;
56
+ function deepFreeze$5(value) {
57
+ // No need to freeze primitives
58
+ if (typeof value !== 'object' || value === null) {
59
+ return;
60
+ }
61
+ if (ArrayIsArray(value)) {
62
+ for (let i = 0, len = value.length; i < len; i += 1) {
63
+ deepFreeze$5(value[i]);
64
+ }
65
+ }
66
+ else {
67
+ const keys = ObjectKeys(value);
68
+ for (let i = 0, len = keys.length; i < len; i += 1) {
69
+ deepFreeze$5(value[keys[i]]);
70
+ }
71
+ }
72
+ ObjectFreeze(value);
73
+ }
74
+ function createLink(ref) {
75
+ return {
76
+ __ref: serializeStructuredKey(ref),
77
+ };
78
78
  }
79
79
 
80
- function validate$6(obj, path = 'ReferenceDataVersionRepresentation') {
81
- const v_error = (() => {
82
- if (typeof obj !== 'object' || ArrayIsArray(obj) || obj === null) {
83
- return new TypeError('Expected "object" but received "' + typeof obj + '" (at "' + path + '")');
84
- }
85
- const obj_isDataSourceLoaded = obj.isDataSourceLoaded;
86
- const path_isDataSourceLoaded = path + '.isDataSourceLoaded';
87
- if (typeof obj_isDataSourceLoaded !== 'boolean') {
88
- return new TypeError('Expected "boolean" but received "' + typeof obj_isDataSourceLoaded + '" (at "' + path_isDataSourceLoaded + '")');
89
- }
90
- const obj_isUnlocked = obj.isUnlocked;
91
- const path_isUnlocked = path + '.isUnlocked';
92
- if (typeof obj_isUnlocked !== 'boolean') {
93
- return new TypeError('Expected "boolean" but received "' + typeof obj_isUnlocked + '" (at "' + path_isUnlocked + '")');
94
- }
95
- if (obj.lastLoadDate !== undefined) {
96
- const obj_lastLoadDate = obj.lastLoadDate;
97
- const path_lastLoadDate = path + '.lastLoadDate';
98
- if (typeof obj_lastLoadDate !== 'string') {
99
- return new TypeError('Expected "string" but received "' + typeof obj_lastLoadDate + '" (at "' + path_lastLoadDate + '")');
100
- }
101
- }
102
- const obj_lastLoadStatus = obj.lastLoadStatus;
103
- const path_lastLoadStatus = path + '.lastLoadStatus';
104
- if (typeof obj_lastLoadStatus !== 'string') {
105
- return new TypeError('Expected "string" but received "' + typeof obj_lastLoadStatus + '" (at "' + path_lastLoadStatus + '")');
106
- }
107
- if (obj.lastLoadedBy !== undefined) {
108
- const obj_lastLoadedBy = obj.lastLoadedBy;
109
- const path_lastLoadedBy = path + '.lastLoadedBy';
110
- if (typeof obj_lastLoadedBy !== 'string') {
111
- return new TypeError('Expected "string" but received "' + typeof obj_lastLoadedBy + '" (at "' + path_lastLoadedBy + '")');
112
- }
113
- }
114
- const obj_releaseDate = obj.releaseDate;
115
- const path_releaseDate = path + '.releaseDate';
116
- if (typeof obj_releaseDate !== 'string') {
117
- return new TypeError('Expected "string" but received "' + typeof obj_releaseDate + '" (at "' + path_releaseDate + '")');
118
- }
119
- const obj_salesforceRelease = obj.salesforceRelease;
120
- const path_salesforceRelease = path + '.salesforceRelease';
121
- if (typeof obj_salesforceRelease !== 'string') {
122
- return new TypeError('Expected "string" but received "' + typeof obj_salesforceRelease + '" (at "' + path_salesforceRelease + '")');
123
- }
124
- const obj_updateNotes = obj.updateNotes;
125
- const path_updateNotes = path + '.updateNotes';
126
- if (typeof obj_updateNotes !== 'string') {
127
- return new TypeError('Expected "string" but received "' + typeof obj_updateNotes + '" (at "' + path_updateNotes + '")');
128
- }
129
- const obj_updateYear = obj.updateYear;
130
- const path_updateYear = path + '.updateYear';
131
- if (typeof obj_updateYear !== 'string') {
132
- return new TypeError('Expected "string" but received "' + typeof obj_updateYear + '" (at "' + path_updateYear + '")');
133
- }
134
- const obj_version = obj.version;
135
- const path_version = path + '.version';
136
- if (typeof obj_version !== 'string') {
137
- return new TypeError('Expected "string" but received "' + typeof obj_version + '" (at "' + path_version + '")');
138
- }
139
- })();
140
- return v_error === undefined ? null : v_error;
141
- }
142
- function deepFreeze$4(input) {
143
- ObjectFreeze(input);
80
+ function validate$6(obj, path = 'ReferenceDataVersionRepresentation') {
81
+ const v_error = (() => {
82
+ if (typeof obj !== 'object' || ArrayIsArray(obj) || obj === null) {
83
+ return new TypeError('Expected "object" but received "' + typeof obj + '" (at "' + path + '")');
84
+ }
85
+ const obj_isDataSourceLoaded = obj.isDataSourceLoaded;
86
+ const path_isDataSourceLoaded = path + '.isDataSourceLoaded';
87
+ if (typeof obj_isDataSourceLoaded !== 'boolean') {
88
+ return new TypeError('Expected "boolean" but received "' + typeof obj_isDataSourceLoaded + '" (at "' + path_isDataSourceLoaded + '")');
89
+ }
90
+ const obj_isUnlocked = obj.isUnlocked;
91
+ const path_isUnlocked = path + '.isUnlocked';
92
+ if (typeof obj_isUnlocked !== 'boolean') {
93
+ return new TypeError('Expected "boolean" but received "' + typeof obj_isUnlocked + '" (at "' + path_isUnlocked + '")');
94
+ }
95
+ if (obj.lastLoadDate !== undefined) {
96
+ const obj_lastLoadDate = obj.lastLoadDate;
97
+ const path_lastLoadDate = path + '.lastLoadDate';
98
+ if (typeof obj_lastLoadDate !== 'string') {
99
+ return new TypeError('Expected "string" but received "' + typeof obj_lastLoadDate + '" (at "' + path_lastLoadDate + '")');
100
+ }
101
+ }
102
+ const obj_lastLoadStatus = obj.lastLoadStatus;
103
+ const path_lastLoadStatus = path + '.lastLoadStatus';
104
+ if (typeof obj_lastLoadStatus !== 'string') {
105
+ return new TypeError('Expected "string" but received "' + typeof obj_lastLoadStatus + '" (at "' + path_lastLoadStatus + '")');
106
+ }
107
+ if (obj.lastLoadedBy !== undefined) {
108
+ const obj_lastLoadedBy = obj.lastLoadedBy;
109
+ const path_lastLoadedBy = path + '.lastLoadedBy';
110
+ if (typeof obj_lastLoadedBy !== 'string') {
111
+ return new TypeError('Expected "string" but received "' + typeof obj_lastLoadedBy + '" (at "' + path_lastLoadedBy + '")');
112
+ }
113
+ }
114
+ const obj_releaseDate = obj.releaseDate;
115
+ const path_releaseDate = path + '.releaseDate';
116
+ if (typeof obj_releaseDate !== 'string') {
117
+ return new TypeError('Expected "string" but received "' + typeof obj_releaseDate + '" (at "' + path_releaseDate + '")');
118
+ }
119
+ const obj_salesforceRelease = obj.salesforceRelease;
120
+ const path_salesforceRelease = path + '.salesforceRelease';
121
+ if (typeof obj_salesforceRelease !== 'string') {
122
+ return new TypeError('Expected "string" but received "' + typeof obj_salesforceRelease + '" (at "' + path_salesforceRelease + '")');
123
+ }
124
+ const obj_updateNotes = obj.updateNotes;
125
+ const path_updateNotes = path + '.updateNotes';
126
+ if (typeof obj_updateNotes !== 'string') {
127
+ return new TypeError('Expected "string" but received "' + typeof obj_updateNotes + '" (at "' + path_updateNotes + '")');
128
+ }
129
+ const obj_updateYear = obj.updateYear;
130
+ const path_updateYear = path + '.updateYear';
131
+ if (typeof obj_updateYear !== 'string') {
132
+ return new TypeError('Expected "string" but received "' + typeof obj_updateYear + '" (at "' + path_updateYear + '")');
133
+ }
134
+ const obj_version = obj.version;
135
+ const path_version = path + '.version';
136
+ if (typeof obj_version !== 'string') {
137
+ return new TypeError('Expected "string" but received "' + typeof obj_version + '" (at "' + path_version + '")');
138
+ }
139
+ })();
140
+ return v_error === undefined ? null : v_error;
141
+ }
142
+ function deepFreeze$4(input) {
143
+ ObjectFreeze(input);
144
144
  }
145
145
 
146
- function validate$5(obj, path = 'ReferenceDataSourceRepresentation') {
147
- const v_error = (() => {
148
- if (typeof obj !== 'object' || ArrayIsArray(obj) || obj === null) {
149
- return new TypeError('Expected "object" but received "' + typeof obj + '" (at "' + path + '")');
150
- }
151
- const obj_dataSourceName = obj.dataSourceName;
152
- const path_dataSourceName = path + '.dataSourceName';
153
- if (typeof obj_dataSourceName !== 'string') {
154
- return new TypeError('Expected "string" but received "' + typeof obj_dataSourceName + '" (at "' + path_dataSourceName + '")');
155
- }
156
- const obj_isUpdateAvailable = obj.isUpdateAvailable;
157
- const path_isUpdateAvailable = path + '.isUpdateAvailable';
158
- if (typeof obj_isUpdateAvailable !== 'boolean') {
159
- return new TypeError('Expected "boolean" but received "' + typeof obj_isUpdateAvailable + '" (at "' + path_isUpdateAvailable + '")');
160
- }
161
- const obj_latestVersion = obj.latestVersion;
162
- const path_latestVersion = path + '.latestVersion';
163
- if (typeof obj_latestVersion !== 'string') {
164
- return new TypeError('Expected "string" but received "' + typeof obj_latestVersion + '" (at "' + path_latestVersion + '")');
165
- }
166
- const obj_versions = obj.versions;
167
- const path_versions = path + '.versions';
168
- if (!ArrayIsArray(obj_versions)) {
169
- return new TypeError('Expected "array" but received "' + typeof obj_versions + '" (at "' + path_versions + '")');
170
- }
171
- for (let i = 0; i < obj_versions.length; i++) {
172
- const obj_versions_item = obj_versions[i];
173
- const path_versions_item = path_versions + '[' + i + ']';
174
- const referencepath_versions_itemValidationError = validate$6(obj_versions_item, path_versions_item);
175
- if (referencepath_versions_itemValidationError !== null) {
176
- let message = 'Object doesn\'t match ReferenceDataVersionRepresentation (at "' + path_versions_item + '")\n';
177
- message += referencepath_versions_itemValidationError.message.split('\n').map((line) => '\t' + line).join('\n');
178
- return new TypeError(message);
179
- }
180
- }
181
- })();
182
- return v_error === undefined ? null : v_error;
183
- }
184
- function deepFreeze$3(input) {
185
- const input_versions = input.versions;
186
- for (let i = 0; i < input_versions.length; i++) {
187
- const input_versions_item = input_versions[i];
188
- deepFreeze$4(input_versions_item);
189
- }
190
- ObjectFreeze(input_versions);
191
- ObjectFreeze(input);
146
+ function validate$5(obj, path = 'ReferenceDataSourceRepresentation') {
147
+ const v_error = (() => {
148
+ if (typeof obj !== 'object' || ArrayIsArray(obj) || obj === null) {
149
+ return new TypeError('Expected "object" but received "' + typeof obj + '" (at "' + path + '")');
150
+ }
151
+ const obj_dataSourceName = obj.dataSourceName;
152
+ const path_dataSourceName = path + '.dataSourceName';
153
+ if (typeof obj_dataSourceName !== 'string') {
154
+ return new TypeError('Expected "string" but received "' + typeof obj_dataSourceName + '" (at "' + path_dataSourceName + '")');
155
+ }
156
+ const obj_isUpdateAvailable = obj.isUpdateAvailable;
157
+ const path_isUpdateAvailable = path + '.isUpdateAvailable';
158
+ if (typeof obj_isUpdateAvailable !== 'boolean') {
159
+ return new TypeError('Expected "boolean" but received "' + typeof obj_isUpdateAvailable + '" (at "' + path_isUpdateAvailable + '")');
160
+ }
161
+ const obj_latestVersion = obj.latestVersion;
162
+ const path_latestVersion = path + '.latestVersion';
163
+ if (typeof obj_latestVersion !== 'string') {
164
+ return new TypeError('Expected "string" but received "' + typeof obj_latestVersion + '" (at "' + path_latestVersion + '")');
165
+ }
166
+ const obj_versions = obj.versions;
167
+ const path_versions = path + '.versions';
168
+ if (!ArrayIsArray(obj_versions)) {
169
+ return new TypeError('Expected "array" but received "' + typeof obj_versions + '" (at "' + path_versions + '")');
170
+ }
171
+ for (let i = 0; i < obj_versions.length; i++) {
172
+ const obj_versions_item = obj_versions[i];
173
+ const path_versions_item = path_versions + '[' + i + ']';
174
+ const referencepath_versions_itemValidationError = validate$6(obj_versions_item, path_versions_item);
175
+ if (referencepath_versions_itemValidationError !== null) {
176
+ let message = 'Object doesn\'t match ReferenceDataVersionRepresentation (at "' + path_versions_item + '")\n';
177
+ message += referencepath_versions_itemValidationError.message.split('\n').map((line) => '\t' + line).join('\n');
178
+ return new TypeError(message);
179
+ }
180
+ }
181
+ })();
182
+ return v_error === undefined ? null : v_error;
183
+ }
184
+ function deepFreeze$3(input) {
185
+ const input_versions = input.versions;
186
+ for (let i = 0; i < input_versions.length; i++) {
187
+ const input_versions_item = input_versions[i];
188
+ deepFreeze$4(input_versions_item);
189
+ }
190
+ ObjectFreeze(input_versions);
191
+ ObjectFreeze(input);
192
192
  }
193
193
 
194
- function validate$4(obj, path = 'ReferenceDataEntityRepresentation') {
195
- const v_error = (() => {
196
- if (typeof obj !== 'object' || ArrayIsArray(obj) || obj === null) {
197
- return new TypeError('Expected "object" but received "' + typeof obj + '" (at "' + path + '")');
198
- }
199
- const obj_entityName = obj.entityName;
200
- const path_entityName = path + '.entityName';
201
- if (typeof obj_entityName !== 'string') {
202
- return new TypeError('Expected "string" but received "' + typeof obj_entityName + '" (at "' + path_entityName + '")');
203
- }
204
- const obj_referenceDataSourceRepresentation = obj.referenceDataSourceRepresentation;
205
- const path_referenceDataSourceRepresentation = path + '.referenceDataSourceRepresentation';
206
- if (!ArrayIsArray(obj_referenceDataSourceRepresentation)) {
207
- return new TypeError('Expected "array" but received "' + typeof obj_referenceDataSourceRepresentation + '" (at "' + path_referenceDataSourceRepresentation + '")');
208
- }
209
- for (let i = 0; i < obj_referenceDataSourceRepresentation.length; i++) {
210
- const obj_referenceDataSourceRepresentation_item = obj_referenceDataSourceRepresentation[i];
211
- const path_referenceDataSourceRepresentation_item = path_referenceDataSourceRepresentation + '[' + i + ']';
212
- const referencepath_referenceDataSourceRepresentation_itemValidationError = validate$5(obj_referenceDataSourceRepresentation_item, path_referenceDataSourceRepresentation_item);
213
- if (referencepath_referenceDataSourceRepresentation_itemValidationError !== null) {
214
- let message = 'Object doesn\'t match ReferenceDataSourceRepresentation (at "' + path_referenceDataSourceRepresentation_item + '")\n';
215
- message += referencepath_referenceDataSourceRepresentation_itemValidationError.message.split('\n').map((line) => '\t' + line).join('\n');
216
- return new TypeError(message);
217
- }
218
- }
219
- })();
220
- return v_error === undefined ? null : v_error;
221
- }
222
- function deepFreeze$2(input) {
223
- const input_referenceDataSourceRepresentation = input.referenceDataSourceRepresentation;
224
- for (let i = 0; i < input_referenceDataSourceRepresentation.length; i++) {
225
- const input_referenceDataSourceRepresentation_item = input_referenceDataSourceRepresentation[i];
226
- deepFreeze$3(input_referenceDataSourceRepresentation_item);
227
- }
228
- ObjectFreeze(input_referenceDataSourceRepresentation);
229
- ObjectFreeze(input);
194
+ function validate$4(obj, path = 'ReferenceDataEntityRepresentation') {
195
+ const v_error = (() => {
196
+ if (typeof obj !== 'object' || ArrayIsArray(obj) || obj === null) {
197
+ return new TypeError('Expected "object" but received "' + typeof obj + '" (at "' + path + '")');
198
+ }
199
+ const obj_entityName = obj.entityName;
200
+ const path_entityName = path + '.entityName';
201
+ if (typeof obj_entityName !== 'string') {
202
+ return new TypeError('Expected "string" but received "' + typeof obj_entityName + '" (at "' + path_entityName + '")');
203
+ }
204
+ const obj_referenceDataSourceRepresentation = obj.referenceDataSourceRepresentation;
205
+ const path_referenceDataSourceRepresentation = path + '.referenceDataSourceRepresentation';
206
+ if (!ArrayIsArray(obj_referenceDataSourceRepresentation)) {
207
+ return new TypeError('Expected "array" but received "' + typeof obj_referenceDataSourceRepresentation + '" (at "' + path_referenceDataSourceRepresentation + '")');
208
+ }
209
+ for (let i = 0; i < obj_referenceDataSourceRepresentation.length; i++) {
210
+ const obj_referenceDataSourceRepresentation_item = obj_referenceDataSourceRepresentation[i];
211
+ const path_referenceDataSourceRepresentation_item = path_referenceDataSourceRepresentation + '[' + i + ']';
212
+ const referencepath_referenceDataSourceRepresentation_itemValidationError = validate$5(obj_referenceDataSourceRepresentation_item, path_referenceDataSourceRepresentation_item);
213
+ if (referencepath_referenceDataSourceRepresentation_itemValidationError !== null) {
214
+ let message = 'Object doesn\'t match ReferenceDataSourceRepresentation (at "' + path_referenceDataSourceRepresentation_item + '")\n';
215
+ message += referencepath_referenceDataSourceRepresentation_itemValidationError.message.split('\n').map((line) => '\t' + line).join('\n');
216
+ return new TypeError(message);
217
+ }
218
+ }
219
+ })();
220
+ return v_error === undefined ? null : v_error;
221
+ }
222
+ function deepFreeze$2(input) {
223
+ const input_referenceDataSourceRepresentation = input.referenceDataSourceRepresentation;
224
+ for (let i = 0; i < input_referenceDataSourceRepresentation.length; i++) {
225
+ const input_referenceDataSourceRepresentation_item = input_referenceDataSourceRepresentation[i];
226
+ deepFreeze$3(input_referenceDataSourceRepresentation_item);
227
+ }
228
+ ObjectFreeze(input_referenceDataSourceRepresentation);
229
+ ObjectFreeze(input);
230
230
  }
231
231
 
232
- const TTL$1 = 300;
233
- const VERSION$1 = "128a41ea06afa49c7b4c5d421747be7a";
234
- function validate$3(obj, path = 'FetchEntityVersionOutputRepresentation') {
235
- const v_error = (() => {
236
- if (typeof obj !== 'object' || ArrayIsArray(obj) || obj === null) {
237
- return new TypeError('Expected "object" but received "' + typeof obj + '" (at "' + path + '")');
238
- }
239
- const obj_referenceDataEntityRepresentation = obj.referenceDataEntityRepresentation;
240
- const path_referenceDataEntityRepresentation = path + '.referenceDataEntityRepresentation';
241
- if (!ArrayIsArray(obj_referenceDataEntityRepresentation)) {
242
- return new TypeError('Expected "array" but received "' + typeof obj_referenceDataEntityRepresentation + '" (at "' + path_referenceDataEntityRepresentation + '")');
243
- }
244
- for (let i = 0; i < obj_referenceDataEntityRepresentation.length; i++) {
245
- const obj_referenceDataEntityRepresentation_item = obj_referenceDataEntityRepresentation[i];
246
- const path_referenceDataEntityRepresentation_item = path_referenceDataEntityRepresentation + '[' + i + ']';
247
- const referencepath_referenceDataEntityRepresentation_itemValidationError = validate$4(obj_referenceDataEntityRepresentation_item, path_referenceDataEntityRepresentation_item);
248
- if (referencepath_referenceDataEntityRepresentation_itemValidationError !== null) {
249
- let message = 'Object doesn\'t match ReferenceDataEntityRepresentation (at "' + path_referenceDataEntityRepresentation_item + '")\n';
250
- message += referencepath_referenceDataEntityRepresentation_itemValidationError.message.split('\n').map((line) => '\t' + line).join('\n');
251
- return new TypeError(message);
252
- }
253
- }
254
- })();
255
- return v_error === undefined ? null : v_error;
256
- }
257
- const RepresentationType$1 = 'FetchEntityVersionOutputRepresentation';
258
- function normalize$1(input, existing, path, luvio, store, timestamp) {
259
- return input;
260
- }
261
- const select$3 = function FetchEntityVersionOutputRepresentationSelect() {
262
- return {
263
- kind: 'Fragment',
264
- version: VERSION$1,
265
- private: [],
266
- opaque: true
267
- };
268
- };
269
- function equals$1(existing, incoming) {
270
- if (JSONStringify(incoming) !== JSONStringify(existing)) {
271
- return false;
272
- }
273
- return true;
274
- }
275
- function deepFreeze$1(input) {
276
- const input_referenceDataEntityRepresentation = input.referenceDataEntityRepresentation;
277
- for (let i = 0; i < input_referenceDataEntityRepresentation.length; i++) {
278
- const input_referenceDataEntityRepresentation_item = input_referenceDataEntityRepresentation[i];
279
- deepFreeze$2(input_referenceDataEntityRepresentation_item);
280
- }
281
- ObjectFreeze(input_referenceDataEntityRepresentation);
282
- ObjectFreeze(input);
283
- }
284
- const ingest$1 = function FetchEntityVersionOutputRepresentationIngest(input, path, luvio, store, timestamp) {
285
- if (process.env.NODE_ENV !== 'production') {
286
- const validateError = validate$3(input);
287
- if (validateError !== null) {
288
- throw validateError;
289
- }
290
- }
291
- const key = path.fullPath;
292
- const existingRecord = store.readEntry(key);
293
- const ttlToUse = TTL$1;
294
- let incomingRecord = normalize$1(input, store.readEntry(key), {
295
- fullPath: key,
296
- parent: path.parent,
297
- propertyName: path.propertyName,
298
- ttl: ttlToUse
299
- });
300
- deepFreeze$1(input);
301
- if (existingRecord === undefined || equals$1(existingRecord, incomingRecord) === false) {
302
- luvio.storePublish(key, incomingRecord);
303
- }
304
- {
305
- const storeMetadataParams = {
306
- ttl: ttlToUse,
307
- namespace: "sustainability-reference-data-v2",
308
- version: VERSION$1,
309
- representationName: RepresentationType$1,
310
- };
311
- luvio.publishStoreMetadata(key, storeMetadataParams);
312
- }
313
- return createLink(key);
314
- };
315
- function getTypeCacheKeys$1(luvio, input, fullPathFactory) {
316
- const rootKeySet = new StoreKeyMap();
317
- // root cache key (uses fullPathFactory if keyBuilderFromType isn't defined)
318
- const rootKey = fullPathFactory();
319
- rootKeySet.set(rootKey, {
320
- namespace: keyPrefix,
321
- representationName: RepresentationType$1,
322
- mergeable: false
323
- });
324
- return rootKeySet;
232
+ const TTL$1 = 300;
233
+ const VERSION$1 = "128a41ea06afa49c7b4c5d421747be7a";
234
+ function validate$3(obj, path = 'FetchEntityVersionOutputRepresentation') {
235
+ const v_error = (() => {
236
+ if (typeof obj !== 'object' || ArrayIsArray(obj) || obj === null) {
237
+ return new TypeError('Expected "object" but received "' + typeof obj + '" (at "' + path + '")');
238
+ }
239
+ const obj_referenceDataEntityRepresentation = obj.referenceDataEntityRepresentation;
240
+ const path_referenceDataEntityRepresentation = path + '.referenceDataEntityRepresentation';
241
+ if (!ArrayIsArray(obj_referenceDataEntityRepresentation)) {
242
+ return new TypeError('Expected "array" but received "' + typeof obj_referenceDataEntityRepresentation + '" (at "' + path_referenceDataEntityRepresentation + '")');
243
+ }
244
+ for (let i = 0; i < obj_referenceDataEntityRepresentation.length; i++) {
245
+ const obj_referenceDataEntityRepresentation_item = obj_referenceDataEntityRepresentation[i];
246
+ const path_referenceDataEntityRepresentation_item = path_referenceDataEntityRepresentation + '[' + i + ']';
247
+ const referencepath_referenceDataEntityRepresentation_itemValidationError = validate$4(obj_referenceDataEntityRepresentation_item, path_referenceDataEntityRepresentation_item);
248
+ if (referencepath_referenceDataEntityRepresentation_itemValidationError !== null) {
249
+ let message = 'Object doesn\'t match ReferenceDataEntityRepresentation (at "' + path_referenceDataEntityRepresentation_item + '")\n';
250
+ message += referencepath_referenceDataEntityRepresentation_itemValidationError.message.split('\n').map((line) => '\t' + line).join('\n');
251
+ return new TypeError(message);
252
+ }
253
+ }
254
+ })();
255
+ return v_error === undefined ? null : v_error;
256
+ }
257
+ const RepresentationType$1 = 'FetchEntityVersionOutputRepresentation';
258
+ function normalize$1(input, existing, path, luvio, store, timestamp) {
259
+ return input;
260
+ }
261
+ const select$3 = function FetchEntityVersionOutputRepresentationSelect() {
262
+ return {
263
+ kind: 'Fragment',
264
+ version: VERSION$1,
265
+ private: [],
266
+ opaque: true
267
+ };
268
+ };
269
+ function equals$1(existing, incoming) {
270
+ if (JSONStringify(incoming) !== JSONStringify(existing)) {
271
+ return false;
272
+ }
273
+ return true;
274
+ }
275
+ function deepFreeze$1(input) {
276
+ const input_referenceDataEntityRepresentation = input.referenceDataEntityRepresentation;
277
+ for (let i = 0; i < input_referenceDataEntityRepresentation.length; i++) {
278
+ const input_referenceDataEntityRepresentation_item = input_referenceDataEntityRepresentation[i];
279
+ deepFreeze$2(input_referenceDataEntityRepresentation_item);
280
+ }
281
+ ObjectFreeze(input_referenceDataEntityRepresentation);
282
+ ObjectFreeze(input);
283
+ }
284
+ const ingest$1 = function FetchEntityVersionOutputRepresentationIngest(input, path, luvio, store, timestamp) {
285
+ if (process.env.NODE_ENV !== 'production') {
286
+ const validateError = validate$3(input);
287
+ if (validateError !== null) {
288
+ throw validateError;
289
+ }
290
+ }
291
+ const key = path.fullPath;
292
+ const existingRecord = store.readEntry(key);
293
+ const ttlToUse = TTL$1;
294
+ let incomingRecord = normalize$1(input, store.readEntry(key), {
295
+ fullPath: key,
296
+ parent: path.parent,
297
+ propertyName: path.propertyName,
298
+ ttl: ttlToUse
299
+ });
300
+ deepFreeze$1(input);
301
+ if (existingRecord === undefined || equals$1(existingRecord, incomingRecord) === false) {
302
+ luvio.storePublish(key, incomingRecord);
303
+ }
304
+ {
305
+ const storeMetadataParams = {
306
+ ttl: ttlToUse,
307
+ namespace: "sustainability-reference-data-v2",
308
+ version: VERSION$1,
309
+ representationName: RepresentationType$1,
310
+ };
311
+ luvio.publishStoreMetadata(key, storeMetadataParams);
312
+ }
313
+ return createLink(key);
314
+ };
315
+ function getTypeCacheKeys$1(luvio, input, fullPathFactory) {
316
+ const rootKeySet = new StoreKeyMap();
317
+ // root cache key (uses fullPathFactory if keyBuilderFromType isn't defined)
318
+ const rootKey = fullPathFactory();
319
+ rootKeySet.set(rootKey, {
320
+ namespace: keyPrefix,
321
+ representationName: RepresentationType$1,
322
+ mergeable: false
323
+ });
324
+ return rootKeySet;
325
325
  }
326
326
 
327
- function select$2(luvio, params) {
328
- return select$3();
329
- }
330
- function keyBuilder$2(luvio, params) {
331
- return keyPrefix + '::FetchEntityVersionOutputRepresentation:(' + 'loadType:' + params.queryParams.loadType + ',' + 'order:' + params.queryParams.order + ',' + 'size:' + params.queryParams.size + ',' + 'entitySection:' + params.urlParams.entitySection + ',' + 'referenceDataSource:' + params.urlParams.referenceDataSource + ')';
332
- }
333
- function getResponseCacheKeys$1(luvio, resourceParams, response) {
334
- return getTypeCacheKeys$1(luvio, response, () => keyBuilder$2(luvio, resourceParams));
335
- }
336
- function ingestSuccess$1(luvio, resourceParams, response, snapshotRefresh) {
337
- const { body } = response;
338
- const key = keyBuilder$2(luvio, resourceParams);
339
- luvio.storeIngest(key, ingest$1, body);
340
- const snapshot = luvio.storeLookup({
341
- recordId: key,
342
- node: select$2(),
343
- variables: {},
344
- }, snapshotRefresh);
345
- if (process.env.NODE_ENV !== 'production') {
346
- if (snapshot.state !== 'Fulfilled') {
347
- throw new Error('Invalid network response. Expected resource response to result in Fulfilled snapshot');
348
- }
349
- }
350
- return snapshot;
351
- }
352
- function ingestError(luvio, params, error, snapshotRefresh) {
353
- const key = keyBuilder$2(luvio, params);
354
- const errorSnapshot = luvio.errorSnapshot(error, snapshotRefresh);
355
- const storeMetadataParams = {
356
- ttl: TTL$1,
357
- namespace: keyPrefix,
358
- version: VERSION$1,
359
- representationName: RepresentationType$1
360
- };
361
- luvio.storeIngestError(key, errorSnapshot, storeMetadataParams);
362
- return errorSnapshot;
363
- }
364
- function createResourceRequest$1(config) {
365
- const headers = {};
366
- return {
367
- baseUri: '/services/data/v58.0',
368
- basePath: '/connect/sustainability/reference-data/v2/entitySection/' + config.urlParams.entitySection + '/dataSource/' + config.urlParams.referenceDataSource + '/version',
369
- method: 'get',
370
- body: null,
371
- urlParams: config.urlParams,
372
- queryParams: config.queryParams,
373
- headers,
374
- priority: 'normal',
375
- };
327
+ function select$2(luvio, params) {
328
+ return select$3();
329
+ }
330
+ function keyBuilder$2(luvio, params) {
331
+ return keyPrefix + '::FetchEntityVersionOutputRepresentation:(' + 'loadType:' + params.queryParams.loadType + ',' + 'order:' + params.queryParams.order + ',' + 'size:' + params.queryParams.size + ',' + 'entitySection:' + params.urlParams.entitySection + ',' + 'referenceDataSource:' + params.urlParams.referenceDataSource + ')';
332
+ }
333
+ function getResponseCacheKeys$1(luvio, resourceParams, response) {
334
+ return getTypeCacheKeys$1(luvio, response, () => keyBuilder$2(luvio, resourceParams));
335
+ }
336
+ function ingestSuccess$1(luvio, resourceParams, response, snapshotRefresh) {
337
+ const { body } = response;
338
+ const key = keyBuilder$2(luvio, resourceParams);
339
+ luvio.storeIngest(key, ingest$1, body);
340
+ const snapshot = luvio.storeLookup({
341
+ recordId: key,
342
+ node: select$2(),
343
+ variables: {},
344
+ }, snapshotRefresh);
345
+ if (process.env.NODE_ENV !== 'production') {
346
+ if (snapshot.state !== 'Fulfilled') {
347
+ throw new Error('Invalid network response. Expected resource response to result in Fulfilled snapshot');
348
+ }
349
+ }
350
+ return snapshot;
351
+ }
352
+ function ingestError(luvio, params, error, snapshotRefresh) {
353
+ const key = keyBuilder$2(luvio, params);
354
+ const errorSnapshot = luvio.errorSnapshot(error, snapshotRefresh);
355
+ const storeMetadataParams = {
356
+ ttl: TTL$1,
357
+ namespace: keyPrefix,
358
+ version: VERSION$1,
359
+ representationName: RepresentationType$1
360
+ };
361
+ luvio.storeIngestError(key, errorSnapshot, storeMetadataParams);
362
+ return errorSnapshot;
363
+ }
364
+ function createResourceRequest$1(config) {
365
+ const headers = {};
366
+ return {
367
+ baseUri: '/services/data/v58.0',
368
+ basePath: '/connect/sustainability/reference-data/v2/entitySection/' + config.urlParams.entitySection + '/dataSource/' + config.urlParams.referenceDataSource + '/version',
369
+ method: 'get',
370
+ body: null,
371
+ urlParams: config.urlParams,
372
+ queryParams: config.queryParams,
373
+ headers,
374
+ priority: 'normal',
375
+ };
376
376
  }
377
377
 
378
- const getEntityVersion_ConfigPropertyNames = {
379
- displayName: 'getEntityVersion',
380
- parameters: {
381
- required: ['entitySection', 'referenceDataSource'],
382
- optional: ['loadType', 'order', 'size']
383
- }
384
- };
385
- function createResourceParams$1(config) {
386
- const resourceParams = {
387
- urlParams: {
388
- entitySection: config.entitySection, referenceDataSource: config.referenceDataSource
389
- },
390
- queryParams: {
391
- loadType: config.loadType, order: config.order, size: config.size
392
- }
393
- };
394
- return resourceParams;
395
- }
396
- function keyBuilder$1(luvio, config) {
397
- const resourceParams = createResourceParams$1(config);
398
- return keyBuilder$2(luvio, resourceParams);
399
- }
400
- function typeCheckConfig$1(untrustedConfig) {
401
- const config = {};
402
- const untrustedConfig_entitySection = untrustedConfig.entitySection;
403
- if (typeof untrustedConfig_entitySection === 'string') {
404
- config.entitySection = untrustedConfig_entitySection;
405
- }
406
- const untrustedConfig_referenceDataSource = untrustedConfig.referenceDataSource;
407
- if (typeof untrustedConfig_referenceDataSource === 'string') {
408
- config.referenceDataSource = untrustedConfig_referenceDataSource;
409
- }
410
- const untrustedConfig_loadType = untrustedConfig.loadType;
411
- if (typeof untrustedConfig_loadType === 'string') {
412
- config.loadType = untrustedConfig_loadType;
413
- }
414
- const untrustedConfig_order = untrustedConfig.order;
415
- if (typeof untrustedConfig_order === 'string') {
416
- config.order = untrustedConfig_order;
417
- }
418
- const untrustedConfig_size = untrustedConfig.size;
419
- if (typeof untrustedConfig_size === 'number' && Math.floor(untrustedConfig_size) === untrustedConfig_size) {
420
- config.size = untrustedConfig_size;
421
- }
422
- return config;
423
- }
424
- function validateAdapterConfig$1(untrustedConfig, configPropertyNames) {
425
- if (!untrustedIsObject(untrustedConfig)) {
426
- return null;
427
- }
428
- if (process.env.NODE_ENV !== 'production') {
429
- validateConfig(untrustedConfig, configPropertyNames);
430
- }
431
- const config = typeCheckConfig$1(untrustedConfig);
432
- if (!areRequiredParametersPresent(config, configPropertyNames)) {
433
- return null;
434
- }
435
- return config;
436
- }
437
- function adapterFragment(luvio, config) {
438
- createResourceParams$1(config);
439
- return select$2();
440
- }
441
- function onFetchResponseSuccess(luvio, config, resourceParams, response) {
442
- const snapshot = ingestSuccess$1(luvio, resourceParams, response, {
443
- config,
444
- resolve: () => buildNetworkSnapshot$1(luvio, config, snapshotRefreshOptions)
445
- });
446
- return luvio.storeBroadcast().then(() => snapshot);
447
- }
448
- function onFetchResponseError(luvio, config, resourceParams, response) {
449
- const snapshot = ingestError(luvio, resourceParams, response, {
450
- config,
451
- resolve: () => buildNetworkSnapshot$1(luvio, config, snapshotRefreshOptions)
452
- });
453
- return luvio.storeBroadcast().then(() => snapshot);
454
- }
455
- function buildNetworkSnapshot$1(luvio, config, options) {
456
- const resourceParams = createResourceParams$1(config);
457
- const request = createResourceRequest$1(resourceParams);
458
- return luvio.dispatchResourceRequest(request, options)
459
- .then((response) => {
460
- return luvio.handleSuccessResponse(() => onFetchResponseSuccess(luvio, config, resourceParams, response), () => getResponseCacheKeys$1(luvio, resourceParams, response.body));
461
- }, (response) => {
462
- return luvio.handleErrorResponse(() => onFetchResponseError(luvio, config, resourceParams, response));
463
- });
464
- }
465
- function buildNetworkSnapshotCachePolicy(context, coercedAdapterRequestContext) {
466
- const { luvio, config } = context;
467
- const { networkPriority, requestCorrelator, eventObservers } = coercedAdapterRequestContext;
468
- const dispatchOptions = {
469
- resourceRequestContext: {
470
- requestCorrelator,
471
- luvioRequestMethod: undefined,
472
- },
473
- eventObservers
474
- };
475
- if (networkPriority !== 'normal') {
476
- dispatchOptions.overrides = {
477
- priority: networkPriority
478
- };
479
- }
480
- return buildNetworkSnapshot$1(luvio, config, dispatchOptions);
481
- }
482
- function buildCachedSnapshotCachePolicy(context, storeLookup) {
483
- const { luvio, config } = context;
484
- const selector = {
485
- recordId: keyBuilder$1(luvio, config),
486
- node: adapterFragment(luvio, config),
487
- variables: {},
488
- };
489
- const cacheSnapshot = storeLookup(selector, {
490
- config,
491
- resolve: () => buildNetworkSnapshot$1(luvio, config, snapshotRefreshOptions)
492
- });
493
- return cacheSnapshot;
494
- }
495
- const getEntityVersionAdapterFactory = (luvio) => function sustainabilityReferenceDataV2__getEntityVersion(untrustedConfig, requestContext) {
496
- const config = validateAdapterConfig$1(untrustedConfig, getEntityVersion_ConfigPropertyNames);
497
- // Invalid or incomplete config
498
- if (config === null) {
499
- return null;
500
- }
501
- return luvio.applyCachePolicy((requestContext || {}), { config, luvio }, // BuildSnapshotContext
502
- buildCachedSnapshotCachePolicy, buildNetworkSnapshotCachePolicy);
378
+ const getEntityVersion_ConfigPropertyNames = {
379
+ displayName: 'getEntityVersion',
380
+ parameters: {
381
+ required: ['entitySection', 'referenceDataSource'],
382
+ optional: ['loadType', 'order', 'size']
383
+ }
384
+ };
385
+ function createResourceParams$1(config) {
386
+ const resourceParams = {
387
+ urlParams: {
388
+ entitySection: config.entitySection, referenceDataSource: config.referenceDataSource
389
+ },
390
+ queryParams: {
391
+ loadType: config.loadType, order: config.order, size: config.size
392
+ }
393
+ };
394
+ return resourceParams;
395
+ }
396
+ function keyBuilder$1(luvio, config) {
397
+ const resourceParams = createResourceParams$1(config);
398
+ return keyBuilder$2(luvio, resourceParams);
399
+ }
400
+ function typeCheckConfig$1(untrustedConfig) {
401
+ const config = {};
402
+ const untrustedConfig_entitySection = untrustedConfig.entitySection;
403
+ if (typeof untrustedConfig_entitySection === 'string') {
404
+ config.entitySection = untrustedConfig_entitySection;
405
+ }
406
+ const untrustedConfig_referenceDataSource = untrustedConfig.referenceDataSource;
407
+ if (typeof untrustedConfig_referenceDataSource === 'string') {
408
+ config.referenceDataSource = untrustedConfig_referenceDataSource;
409
+ }
410
+ const untrustedConfig_loadType = untrustedConfig.loadType;
411
+ if (typeof untrustedConfig_loadType === 'string') {
412
+ config.loadType = untrustedConfig_loadType;
413
+ }
414
+ const untrustedConfig_order = untrustedConfig.order;
415
+ if (typeof untrustedConfig_order === 'string') {
416
+ config.order = untrustedConfig_order;
417
+ }
418
+ const untrustedConfig_size = untrustedConfig.size;
419
+ if (typeof untrustedConfig_size === 'number' && Math.floor(untrustedConfig_size) === untrustedConfig_size) {
420
+ config.size = untrustedConfig_size;
421
+ }
422
+ return config;
423
+ }
424
+ function validateAdapterConfig$1(untrustedConfig, configPropertyNames) {
425
+ if (!untrustedIsObject(untrustedConfig)) {
426
+ return null;
427
+ }
428
+ if (process.env.NODE_ENV !== 'production') {
429
+ validateConfig(untrustedConfig, configPropertyNames);
430
+ }
431
+ const config = typeCheckConfig$1(untrustedConfig);
432
+ if (!areRequiredParametersPresent(config, configPropertyNames)) {
433
+ return null;
434
+ }
435
+ return config;
436
+ }
437
+ function adapterFragment(luvio, config) {
438
+ createResourceParams$1(config);
439
+ return select$2();
440
+ }
441
+ function onFetchResponseSuccess(luvio, config, resourceParams, response) {
442
+ const snapshot = ingestSuccess$1(luvio, resourceParams, response, {
443
+ config,
444
+ resolve: () => buildNetworkSnapshot$1(luvio, config, snapshotRefreshOptions)
445
+ });
446
+ return luvio.storeBroadcast().then(() => snapshot);
447
+ }
448
+ function onFetchResponseError(luvio, config, resourceParams, response) {
449
+ const snapshot = ingestError(luvio, resourceParams, response, {
450
+ config,
451
+ resolve: () => buildNetworkSnapshot$1(luvio, config, snapshotRefreshOptions)
452
+ });
453
+ return luvio.storeBroadcast().then(() => snapshot);
454
+ }
455
+ function buildNetworkSnapshot$1(luvio, config, options) {
456
+ const resourceParams = createResourceParams$1(config);
457
+ const request = createResourceRequest$1(resourceParams);
458
+ return luvio.dispatchResourceRequest(request, options)
459
+ .then((response) => {
460
+ return luvio.handleSuccessResponse(() => onFetchResponseSuccess(luvio, config, resourceParams, response), () => getResponseCacheKeys$1(luvio, resourceParams, response.body));
461
+ }, (response) => {
462
+ return luvio.handleErrorResponse(() => onFetchResponseError(luvio, config, resourceParams, response));
463
+ });
464
+ }
465
+ function buildNetworkSnapshotCachePolicy(context, coercedAdapterRequestContext) {
466
+ const { luvio, config } = context;
467
+ const { networkPriority, requestCorrelator, eventObservers } = coercedAdapterRequestContext;
468
+ const dispatchOptions = {
469
+ resourceRequestContext: {
470
+ requestCorrelator,
471
+ luvioRequestMethod: undefined,
472
+ },
473
+ eventObservers
474
+ };
475
+ if (networkPriority !== 'normal') {
476
+ dispatchOptions.overrides = {
477
+ priority: networkPriority
478
+ };
479
+ }
480
+ return buildNetworkSnapshot$1(luvio, config, dispatchOptions);
481
+ }
482
+ function buildCachedSnapshotCachePolicy(context, storeLookup) {
483
+ const { luvio, config } = context;
484
+ const selector = {
485
+ recordId: keyBuilder$1(luvio, config),
486
+ node: adapterFragment(luvio, config),
487
+ variables: {},
488
+ };
489
+ const cacheSnapshot = storeLookup(selector, {
490
+ config,
491
+ resolve: () => buildNetworkSnapshot$1(luvio, config, snapshotRefreshOptions)
492
+ });
493
+ return cacheSnapshot;
494
+ }
495
+ const getEntityVersionAdapterFactory = (luvio) => function sustainabilityReferenceDataV2__getEntityVersion(untrustedConfig, requestContext) {
496
+ const config = validateAdapterConfig$1(untrustedConfig, getEntityVersion_ConfigPropertyNames);
497
+ // Invalid or incomplete config
498
+ if (config === null) {
499
+ return null;
500
+ }
501
+ return luvio.applyCachePolicy((requestContext || {}), { config, luvio }, // BuildSnapshotContext
502
+ buildCachedSnapshotCachePolicy, buildNetworkSnapshotCachePolicy);
503
503
  };
504
504
 
505
- function validate$2(obj, path = 'EntityDataSourceVersionDetailRepresentation') {
506
- const v_error = (() => {
507
- if (typeof obj !== 'object' || ArrayIsArray(obj) || obj === null) {
508
- return new TypeError('Expected "object" but received "' + typeof obj + '" (at "' + path + '")');
509
- }
510
- const obj_dataSource = obj.dataSource;
511
- const path_dataSource = path + '.dataSource';
512
- if (typeof obj_dataSource !== 'string') {
513
- return new TypeError('Expected "string" but received "' + typeof obj_dataSource + '" (at "' + path_dataSource + '")');
514
- }
515
- const obj_entitySection = obj.entitySection;
516
- const path_entitySection = path + '.entitySection';
517
- if (typeof obj_entitySection !== 'string') {
518
- return new TypeError('Expected "string" but received "' + typeof obj_entitySection + '" (at "' + path_entitySection + '")');
519
- }
520
- const obj_recordTypeId = obj.recordTypeId;
521
- const path_recordTypeId = path + '.recordTypeId';
522
- if (typeof obj_recordTypeId !== 'string') {
523
- return new TypeError('Expected "string" but received "' + typeof obj_recordTypeId + '" (at "' + path_recordTypeId + '")');
524
- }
525
- const obj_version = obj.version;
526
- const path_version = path + '.version';
527
- if (typeof obj_version !== 'string') {
528
- return new TypeError('Expected "string" but received "' + typeof obj_version + '" (at "' + path_version + '")');
529
- }
530
- })();
531
- return v_error === undefined ? null : v_error;
505
+ function validate$2(obj, path = 'EntityDataSourceVersionDetailRepresentation') {
506
+ const v_error = (() => {
507
+ if (typeof obj !== 'object' || ArrayIsArray(obj) || obj === null) {
508
+ return new TypeError('Expected "object" but received "' + typeof obj + '" (at "' + path + '")');
509
+ }
510
+ const obj_dataSource = obj.dataSource;
511
+ const path_dataSource = path + '.dataSource';
512
+ if (typeof obj_dataSource !== 'string') {
513
+ return new TypeError('Expected "string" but received "' + typeof obj_dataSource + '" (at "' + path_dataSource + '")');
514
+ }
515
+ const obj_entitySection = obj.entitySection;
516
+ const path_entitySection = path + '.entitySection';
517
+ if (typeof obj_entitySection !== 'string') {
518
+ return new TypeError('Expected "string" but received "' + typeof obj_entitySection + '" (at "' + path_entitySection + '")');
519
+ }
520
+ const obj_recordTypeId = obj.recordTypeId;
521
+ const path_recordTypeId = path + '.recordTypeId';
522
+ if (typeof obj_recordTypeId !== 'string') {
523
+ return new TypeError('Expected "string" but received "' + typeof obj_recordTypeId + '" (at "' + path_recordTypeId + '")');
524
+ }
525
+ const obj_version = obj.version;
526
+ const path_version = path + '.version';
527
+ if (typeof obj_version !== 'string') {
528
+ return new TypeError('Expected "string" but received "' + typeof obj_version + '" (at "' + path_version + '")');
529
+ }
530
+ })();
531
+ return v_error === undefined ? null : v_error;
532
532
  }
533
533
 
534
- function validate$1(obj, path = 'UploadEntityVersionInputRepresentation') {
535
- const v_error = (() => {
536
- if (typeof obj !== 'object' || ArrayIsArray(obj) || obj === null) {
537
- return new TypeError('Expected "object" but received "' + typeof obj + '" (at "' + path + '")');
538
- }
539
- const obj_entityDataSourceVersionDetails = obj.entityDataSourceVersionDetails;
540
- const path_entityDataSourceVersionDetails = path + '.entityDataSourceVersionDetails';
541
- if (!ArrayIsArray(obj_entityDataSourceVersionDetails)) {
542
- return new TypeError('Expected "array" but received "' + typeof obj_entityDataSourceVersionDetails + '" (at "' + path_entityDataSourceVersionDetails + '")');
543
- }
544
- for (let i = 0; i < obj_entityDataSourceVersionDetails.length; i++) {
545
- const obj_entityDataSourceVersionDetails_item = obj_entityDataSourceVersionDetails[i];
546
- const path_entityDataSourceVersionDetails_item = path_entityDataSourceVersionDetails + '[' + i + ']';
547
- const referencepath_entityDataSourceVersionDetails_itemValidationError = validate$2(obj_entityDataSourceVersionDetails_item, path_entityDataSourceVersionDetails_item);
548
- if (referencepath_entityDataSourceVersionDetails_itemValidationError !== null) {
549
- let message = 'Object doesn\'t match EntityDataSourceVersionDetailRepresentation (at "' + path_entityDataSourceVersionDetails_item + '")\n';
550
- message += referencepath_entityDataSourceVersionDetails_itemValidationError.message.split('\n').map((line) => '\t' + line).join('\n');
551
- return new TypeError(message);
552
- }
553
- }
554
- })();
555
- return v_error === undefined ? null : v_error;
534
+ function validate$1(obj, path = 'UploadEntityVersionInputRepresentation') {
535
+ const v_error = (() => {
536
+ if (typeof obj !== 'object' || ArrayIsArray(obj) || obj === null) {
537
+ return new TypeError('Expected "object" but received "' + typeof obj + '" (at "' + path + '")');
538
+ }
539
+ const obj_entityDataSourceVersionDetails = obj.entityDataSourceVersionDetails;
540
+ const path_entityDataSourceVersionDetails = path + '.entityDataSourceVersionDetails';
541
+ if (!ArrayIsArray(obj_entityDataSourceVersionDetails)) {
542
+ return new TypeError('Expected "array" but received "' + typeof obj_entityDataSourceVersionDetails + '" (at "' + path_entityDataSourceVersionDetails + '")');
543
+ }
544
+ for (let i = 0; i < obj_entityDataSourceVersionDetails.length; i++) {
545
+ const obj_entityDataSourceVersionDetails_item = obj_entityDataSourceVersionDetails[i];
546
+ const path_entityDataSourceVersionDetails_item = path_entityDataSourceVersionDetails + '[' + i + ']';
547
+ const referencepath_entityDataSourceVersionDetails_itemValidationError = validate$2(obj_entityDataSourceVersionDetails_item, path_entityDataSourceVersionDetails_item);
548
+ if (referencepath_entityDataSourceVersionDetails_itemValidationError !== null) {
549
+ let message = 'Object doesn\'t match EntityDataSourceVersionDetailRepresentation (at "' + path_entityDataSourceVersionDetails_item + '")\n';
550
+ message += referencepath_entityDataSourceVersionDetails_itemValidationError.message.split('\n').map((line) => '\t' + line).join('\n');
551
+ return new TypeError(message);
552
+ }
553
+ }
554
+ })();
555
+ return v_error === undefined ? null : v_error;
556
556
  }
557
557
 
558
- const TTL = 300;
559
- const VERSION = "22f23ab2e1d30bf8c35f0a92153102a2";
560
- function validate(obj, path = 'UploadEntityVersionOutputRepresentation') {
561
- const v_error = (() => {
562
- if (typeof obj !== 'object' || ArrayIsArray(obj) || obj === null) {
563
- return new TypeError('Expected "object" but received "' + typeof obj + '" (at "' + path + '")');
564
- }
565
- const obj_code = obj.code;
566
- const path_code = path + '.code';
567
- if (typeof obj_code !== 'number' || (typeof obj_code === 'number' && Math.floor(obj_code) !== obj_code)) {
568
- return new TypeError('Expected "integer" but received "' + typeof obj_code + '" (at "' + path_code + '")');
569
- }
570
- const obj_message = obj.message;
571
- const path_message = path + '.message';
572
- if (typeof obj_message !== 'string') {
573
- return new TypeError('Expected "string" but received "' + typeof obj_message + '" (at "' + path_message + '")');
574
- }
575
- })();
576
- return v_error === undefined ? null : v_error;
577
- }
578
- const RepresentationType = 'UploadEntityVersionOutputRepresentation';
579
- function keyBuilder(luvio, config) {
580
- return keyPrefix + '::' + RepresentationType + ':' + config.message;
581
- }
582
- function keyBuilderFromType(luvio, object) {
583
- const keyParams = {
584
- message: object.message
585
- };
586
- return keyBuilder(luvio, keyParams);
587
- }
588
- function normalize(input, existing, path, luvio, store, timestamp) {
589
- return input;
590
- }
591
- const select$1 = function UploadEntityVersionOutputRepresentationSelect() {
592
- return {
593
- kind: 'Fragment',
594
- version: VERSION,
595
- private: [],
596
- opaque: true
597
- };
598
- };
599
- function equals(existing, incoming) {
600
- if (JSONStringify(incoming) !== JSONStringify(existing)) {
601
- return false;
602
- }
603
- return true;
604
- }
605
- function deepFreeze(input) {
606
- ObjectFreeze(input);
607
- }
608
- const ingest = function UploadEntityVersionOutputRepresentationIngest(input, path, luvio, store, timestamp) {
609
- if (process.env.NODE_ENV !== 'production') {
610
- const validateError = validate(input);
611
- if (validateError !== null) {
612
- throw validateError;
613
- }
614
- }
615
- const key = keyBuilderFromType(luvio, input);
616
- const existingRecord = store.readEntry(key);
617
- const ttlToUse = TTL;
618
- let incomingRecord = normalize(input, store.readEntry(key), {
619
- fullPath: key,
620
- parent: path.parent,
621
- propertyName: path.propertyName,
622
- ttl: ttlToUse
623
- });
624
- deepFreeze(input);
625
- if (existingRecord === undefined || equals(existingRecord, incomingRecord) === false) {
626
- luvio.storePublish(key, incomingRecord);
627
- }
628
- {
629
- const storeMetadataParams = {
630
- ttl: ttlToUse,
631
- namespace: "sustainability-reference-data-v2",
632
- version: VERSION,
633
- representationName: RepresentationType,
634
- };
635
- luvio.publishStoreMetadata(key, storeMetadataParams);
636
- }
637
- return createLink(key);
638
- };
639
- function getTypeCacheKeys(luvio, input, fullPathFactory) {
640
- const rootKeySet = new StoreKeyMap();
641
- // root cache key (uses fullPathFactory if keyBuilderFromType isn't defined)
642
- const rootKey = keyBuilderFromType(luvio, input);
643
- rootKeySet.set(rootKey, {
644
- namespace: keyPrefix,
645
- representationName: RepresentationType,
646
- mergeable: false
647
- });
648
- return rootKeySet;
558
+ const TTL = 300;
559
+ const VERSION = "22f23ab2e1d30bf8c35f0a92153102a2";
560
+ function validate(obj, path = 'UploadEntityVersionOutputRepresentation') {
561
+ const v_error = (() => {
562
+ if (typeof obj !== 'object' || ArrayIsArray(obj) || obj === null) {
563
+ return new TypeError('Expected "object" but received "' + typeof obj + '" (at "' + path + '")');
564
+ }
565
+ const obj_code = obj.code;
566
+ const path_code = path + '.code';
567
+ if (typeof obj_code !== 'number' || (typeof obj_code === 'number' && Math.floor(obj_code) !== obj_code)) {
568
+ return new TypeError('Expected "integer" but received "' + typeof obj_code + '" (at "' + path_code + '")');
569
+ }
570
+ const obj_message = obj.message;
571
+ const path_message = path + '.message';
572
+ if (typeof obj_message !== 'string') {
573
+ return new TypeError('Expected "string" but received "' + typeof obj_message + '" (at "' + path_message + '")');
574
+ }
575
+ })();
576
+ return v_error === undefined ? null : v_error;
577
+ }
578
+ const RepresentationType = 'UploadEntityVersionOutputRepresentation';
579
+ function keyBuilder(luvio, config) {
580
+ return keyPrefix + '::' + RepresentationType + ':' + config.message;
581
+ }
582
+ function keyBuilderFromType(luvio, object) {
583
+ const keyParams = {
584
+ message: object.message
585
+ };
586
+ return keyBuilder(luvio, keyParams);
587
+ }
588
+ function normalize(input, existing, path, luvio, store, timestamp) {
589
+ return input;
590
+ }
591
+ const select$1 = function UploadEntityVersionOutputRepresentationSelect() {
592
+ return {
593
+ kind: 'Fragment',
594
+ version: VERSION,
595
+ private: [],
596
+ opaque: true
597
+ };
598
+ };
599
+ function equals(existing, incoming) {
600
+ if (JSONStringify(incoming) !== JSONStringify(existing)) {
601
+ return false;
602
+ }
603
+ return true;
604
+ }
605
+ function deepFreeze(input) {
606
+ ObjectFreeze(input);
607
+ }
608
+ const ingest = function UploadEntityVersionOutputRepresentationIngest(input, path, luvio, store, timestamp) {
609
+ if (process.env.NODE_ENV !== 'production') {
610
+ const validateError = validate(input);
611
+ if (validateError !== null) {
612
+ throw validateError;
613
+ }
614
+ }
615
+ const key = keyBuilderFromType(luvio, input);
616
+ const existingRecord = store.readEntry(key);
617
+ const ttlToUse = TTL;
618
+ let incomingRecord = normalize(input, store.readEntry(key), {
619
+ fullPath: key,
620
+ parent: path.parent,
621
+ propertyName: path.propertyName,
622
+ ttl: ttlToUse
623
+ });
624
+ deepFreeze(input);
625
+ if (existingRecord === undefined || equals(existingRecord, incomingRecord) === false) {
626
+ luvio.storePublish(key, incomingRecord);
627
+ }
628
+ {
629
+ const storeMetadataParams = {
630
+ ttl: ttlToUse,
631
+ namespace: "sustainability-reference-data-v2",
632
+ version: VERSION,
633
+ representationName: RepresentationType,
634
+ };
635
+ luvio.publishStoreMetadata(key, storeMetadataParams);
636
+ }
637
+ return createLink(key);
638
+ };
639
+ function getTypeCacheKeys(luvio, input, fullPathFactory) {
640
+ const rootKeySet = new StoreKeyMap();
641
+ // root cache key (uses fullPathFactory if keyBuilderFromType isn't defined)
642
+ const rootKey = keyBuilderFromType(luvio, input);
643
+ rootKeySet.set(rootKey, {
644
+ namespace: keyPrefix,
645
+ representationName: RepresentationType,
646
+ mergeable: false
647
+ });
648
+ return rootKeySet;
649
649
  }
650
650
 
651
- function select(luvio, params) {
652
- return select$1();
653
- }
654
- function getResponseCacheKeys(luvio, resourceParams, response) {
655
- return getTypeCacheKeys(luvio, response);
656
- }
657
- function ingestSuccess(luvio, resourceParams, response) {
658
- const { body } = response;
659
- const key = keyBuilderFromType(luvio, body);
660
- luvio.storeIngest(key, ingest, body);
661
- const snapshot = luvio.storeLookup({
662
- recordId: key,
663
- node: select(),
664
- variables: {},
665
- });
666
- if (process.env.NODE_ENV !== 'production') {
667
- if (snapshot.state !== 'Fulfilled') {
668
- throw new Error('Invalid network response. Expected resource response to result in Fulfilled snapshot');
669
- }
670
- }
671
- return snapshot;
672
- }
673
- function createResourceRequest(config) {
674
- const headers = {};
675
- return {
676
- baseUri: '/services/data/v58.0',
677
- basePath: '/connect/sustainability/reference-data/v2/entityVersion/upload',
678
- method: 'put',
679
- body: config.body,
680
- urlParams: {},
681
- queryParams: {},
682
- headers,
683
- priority: 'normal',
684
- };
651
+ function select(luvio, params) {
652
+ return select$1();
653
+ }
654
+ function getResponseCacheKeys(luvio, resourceParams, response) {
655
+ return getTypeCacheKeys(luvio, response);
656
+ }
657
+ function ingestSuccess(luvio, resourceParams, response) {
658
+ const { body } = response;
659
+ const key = keyBuilderFromType(luvio, body);
660
+ luvio.storeIngest(key, ingest, body);
661
+ const snapshot = luvio.storeLookup({
662
+ recordId: key,
663
+ node: select(),
664
+ variables: {},
665
+ });
666
+ if (process.env.NODE_ENV !== 'production') {
667
+ if (snapshot.state !== 'Fulfilled') {
668
+ throw new Error('Invalid network response. Expected resource response to result in Fulfilled snapshot');
669
+ }
670
+ }
671
+ return snapshot;
672
+ }
673
+ function createResourceRequest(config) {
674
+ const headers = {};
675
+ return {
676
+ baseUri: '/services/data/v58.0',
677
+ basePath: '/connect/sustainability/reference-data/v2/entityVersion/upload',
678
+ method: 'put',
679
+ body: config.body,
680
+ urlParams: {},
681
+ queryParams: {},
682
+ headers,
683
+ priority: 'normal',
684
+ };
685
685
  }
686
686
 
687
- const uploadEntityVersion_ConfigPropertyNames = {
688
- displayName: 'uploadEntityVersion',
689
- parameters: {
690
- required: ['uploadEntityInput'],
691
- optional: []
692
- }
693
- };
694
- function createResourceParams(config) {
695
- const resourceParams = {
696
- body: {
697
- uploadEntityInput: config.uploadEntityInput
698
- }
699
- };
700
- return resourceParams;
701
- }
702
- function typeCheckConfig(untrustedConfig) {
703
- const config = {};
704
- const untrustedConfig_uploadEntityInput = untrustedConfig.uploadEntityInput;
705
- const referenceUploadEntityVersionInputRepresentationValidationError = validate$1(untrustedConfig_uploadEntityInput);
706
- if (referenceUploadEntityVersionInputRepresentationValidationError === null) {
707
- config.uploadEntityInput = untrustedConfig_uploadEntityInput;
708
- }
709
- return config;
710
- }
711
- function validateAdapterConfig(untrustedConfig, configPropertyNames) {
712
- if (!untrustedIsObject(untrustedConfig)) {
713
- return null;
714
- }
715
- if (process.env.NODE_ENV !== 'production') {
716
- validateConfig(untrustedConfig, configPropertyNames);
717
- }
718
- const config = typeCheckConfig(untrustedConfig);
719
- if (!areRequiredParametersPresent(config, configPropertyNames)) {
720
- return null;
721
- }
722
- return config;
723
- }
724
- function buildNetworkSnapshot(luvio, config, options) {
725
- const resourceParams = createResourceParams(config);
726
- const request = createResourceRequest(resourceParams);
727
- return luvio.dispatchResourceRequest(request, options)
728
- .then((response) => {
729
- return luvio.handleSuccessResponse(() => {
730
- const snapshot = ingestSuccess(luvio, resourceParams, response);
731
- return luvio.storeBroadcast().then(() => snapshot);
732
- }, () => getResponseCacheKeys(luvio, resourceParams, response.body));
733
- }, (response) => {
734
- deepFreeze$5(response);
735
- throw response;
736
- });
737
- }
738
- const uploadEntityVersionAdapterFactory = (luvio) => {
739
- return function uploadEntityVersion(untrustedConfig) {
740
- const config = validateAdapterConfig(untrustedConfig, uploadEntityVersion_ConfigPropertyNames);
741
- // Invalid or incomplete config
742
- if (config === null) {
743
- throw new Error('Invalid config for "uploadEntityVersion"');
744
- }
745
- return buildNetworkSnapshot(luvio, config);
746
- };
687
+ const uploadEntityVersion_ConfigPropertyNames = {
688
+ displayName: 'uploadEntityVersion',
689
+ parameters: {
690
+ required: ['uploadEntityInput'],
691
+ optional: []
692
+ }
693
+ };
694
+ function createResourceParams(config) {
695
+ const resourceParams = {
696
+ body: {
697
+ uploadEntityInput: config.uploadEntityInput
698
+ }
699
+ };
700
+ return resourceParams;
701
+ }
702
+ function typeCheckConfig(untrustedConfig) {
703
+ const config = {};
704
+ const untrustedConfig_uploadEntityInput = untrustedConfig.uploadEntityInput;
705
+ const referenceUploadEntityVersionInputRepresentationValidationError = validate$1(untrustedConfig_uploadEntityInput);
706
+ if (referenceUploadEntityVersionInputRepresentationValidationError === null) {
707
+ config.uploadEntityInput = untrustedConfig_uploadEntityInput;
708
+ }
709
+ return config;
710
+ }
711
+ function validateAdapterConfig(untrustedConfig, configPropertyNames) {
712
+ if (!untrustedIsObject(untrustedConfig)) {
713
+ return null;
714
+ }
715
+ if (process.env.NODE_ENV !== 'production') {
716
+ validateConfig(untrustedConfig, configPropertyNames);
717
+ }
718
+ const config = typeCheckConfig(untrustedConfig);
719
+ if (!areRequiredParametersPresent(config, configPropertyNames)) {
720
+ return null;
721
+ }
722
+ return config;
723
+ }
724
+ function buildNetworkSnapshot(luvio, config, options) {
725
+ const resourceParams = createResourceParams(config);
726
+ const request = createResourceRequest(resourceParams);
727
+ return luvio.dispatchResourceRequest(request, options)
728
+ .then((response) => {
729
+ return luvio.handleSuccessResponse(() => {
730
+ const snapshot = ingestSuccess(luvio, resourceParams, response);
731
+ return luvio.storeBroadcast().then(() => snapshot);
732
+ }, () => getResponseCacheKeys(luvio, resourceParams, response.body));
733
+ }, (response) => {
734
+ deepFreeze$5(response);
735
+ throw response;
736
+ });
737
+ }
738
+ const uploadEntityVersionAdapterFactory = (luvio) => {
739
+ return function uploadEntityVersion(untrustedConfig) {
740
+ const config = validateAdapterConfig(untrustedConfig, uploadEntityVersion_ConfigPropertyNames);
741
+ // Invalid or incomplete config
742
+ if (config === null) {
743
+ throw new Error('Invalid config for "uploadEntityVersion"');
744
+ }
745
+ return buildNetworkSnapshot(luvio, config);
746
+ };
747
747
  };
748
748
 
749
749
  export { getEntityVersionAdapterFactory, uploadEntityVersionAdapterFactory };