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