@salesforce/lds-adapters-platform-external-services 1.124.2 → 1.124.4

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 (41) hide show
  1. package/dist/es/es2018/platform-external-services.js +2171 -2171
  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/getDataShape.d.ts +28 -28
  4. package/dist/{types → es/es2018/types}/src/generated/adapters/getOpenApiSpec.d.ts +28 -28
  5. package/dist/{types → es/es2018/types}/src/generated/adapters/getStatistics.d.ts +25 -25
  6. package/dist/{types → es/es2018/types}/src/generated/adapters/getStatisticsForService.d.ts +26 -26
  7. package/dist/{types → es/es2018/types}/src/generated/adapters/validateSchema.d.ts +16 -16
  8. package/dist/{types → es/es2018/types}/src/generated/artifacts/main.d.ts +5 -5
  9. package/dist/{types → es/es2018/types}/src/generated/artifacts/sfdc.d.ts +10 -10
  10. package/dist/{types → es/es2018/types}/src/generated/resources/getExternalservicesExternalserviceschemarequest.d.ts +17 -17
  11. package/dist/{types → es/es2018/types}/src/generated/resources/getExternalservicesStatisticsServices.d.ts +12 -12
  12. package/dist/{types → es/es2018/types}/src/generated/resources/getExternalservicesStatisticsServicesByRegistrationName.d.ts +15 -15
  13. package/dist/{types → es/es2018/types}/src/generated/resources/postExternalservicesInferenceDatashapeByVersion.d.ts +19 -19
  14. package/dist/{types → es/es2018/types}/src/generated/resources/postExternalservicesInferenceOpenapispecByVersion.d.ts +19 -19
  15. package/dist/{types → es/es2018/types}/src/generated/resources/postExternalservicesSchemasValidationBySchemaName.d.ts +16 -16
  16. package/dist/{types → es/es2018/types}/src/generated/types/ApiInfoRepresentation.d.ts +38 -38
  17. package/dist/{types → es/es2018/types}/src/generated/types/ApiListRepresentation.d.ts +30 -30
  18. package/dist/{types → es/es2018/types}/src/generated/types/ApiSchemaRepresentation.d.ts +29 -29
  19. package/dist/{types → es/es2018/types}/src/generated/types/DataShapeInferenceOutputRepresentation.d.ts +49 -49
  20. package/dist/{types → es/es2018/types}/src/generated/types/ExternalServiceSchemaRequestRepresentation.d.ts +32 -32
  21. package/dist/{types → es/es2018/types}/src/generated/types/ExternalServiceStatisticsBreakdownRepresentation.d.ts +44 -44
  22. package/dist/{types → es/es2018/types}/src/generated/types/ExternalServiceStatisticsForServiceRepresentation.d.ts +42 -42
  23. package/dist/{types → es/es2018/types}/src/generated/types/ExternalServiceStatisticsOutputRepresentation.d.ts +37 -37
  24. package/dist/{types → es/es2018/types}/src/generated/types/ExternalServiceStatisticsOverviewRepresentation.d.ts +35 -35
  25. package/dist/{types → es/es2018/types}/src/generated/types/InferenceErrorMessageRepresentation.d.ts +32 -32
  26. package/dist/{types → es/es2018/types}/src/generated/types/NamedCredentialListRepresentation.d.ts +30 -30
  27. package/dist/{types → es/es2018/types}/src/generated/types/NamedCredentialRepresentation.d.ts +35 -35
  28. package/dist/{types → es/es2018/types}/src/generated/types/OpenApiSpecInferenceInputRepresentation.d.ts +57 -57
  29. package/dist/{types → es/es2018/types}/src/generated/types/OpenApiSpecInferenceInputWrapperRepresentation.d.ts +29 -29
  30. package/dist/{types → es/es2018/types}/src/generated/types/OpenApiSpecInferenceOutputRepresentation.d.ts +37 -37
  31. package/dist/{types → es/es2018/types}/src/generated/types/OpenApiSpecInferenceParameterRepresentation.d.ts +41 -41
  32. package/dist/{types → es/es2018/types}/src/generated/types/SchemaValidationInputRepresentation.d.ts +35 -35
  33. package/dist/{types → es/es2018/types}/src/generated/types/SchemaValidationInputWrapperRepresentation.d.ts +29 -29
  34. package/dist/{types → es/es2018/types}/src/generated/types/SchemaValidationMessageRepresentation.d.ts +53 -53
  35. package/dist/{types → es/es2018/types}/src/generated/types/SchemaValidationOutputRepresentation.d.ts +51 -51
  36. package/dist/{types → es/es2018/types}/src/generated/types/type-utils.d.ts +39 -39
  37. package/package.json +5 -5
  38. package/sfdc/index.d.ts +1 -1
  39. package/sfdc/index.js +2222 -2222
  40. package/dist/umd/es2018/platform-external-services.js +0 -2240
  41. package/dist/umd/es5/platform-external-services.js +0 -2252
package/sfdc/index.js CHANGED
@@ -16,2276 +16,2276 @@ 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 = 'external-services';
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 equalsArray(a, b, equalsItem) {
67
- const aLength = a.length;
68
- const bLength = b.length;
69
- if (aLength !== bLength) {
70
- return false;
71
- }
72
- for (let i = 0; i < aLength; i++) {
73
- if (equalsItem(a[i], b[i]) === false) {
74
- return false;
75
- }
76
- }
77
- return true;
78
- }
79
- function deepFreeze$2(value) {
80
- // No need to freeze primitives
81
- if (typeof value !== 'object' || value === null) {
82
- return;
83
- }
84
- if (ArrayIsArray(value)) {
85
- for (let i = 0, len = value.length; i < len; i += 1) {
86
- deepFreeze$2(value[i]);
87
- }
88
- }
89
- else {
90
- const keys = ObjectKeys(value);
91
- for (let i = 0, len = keys.length; i < len; i += 1) {
92
- deepFreeze$2(value[keys[i]]);
93
- }
94
- }
95
- ObjectFreeze(value);
96
- }
97
- function createLink(ref) {
98
- return {
99
- __ref: serializeStructuredKey(ref),
100
- };
63
+ const { freeze: ObjectFreeze, keys: ObjectKeys, create: ObjectCreate, assign: ObjectAssign } = Object;
64
+ const { isArray: ArrayIsArray } = Array;
65
+ const { stringify: JSONStringify } = JSON;
66
+ function equalsArray(a, b, equalsItem) {
67
+ const aLength = a.length;
68
+ const bLength = b.length;
69
+ if (aLength !== bLength) {
70
+ return false;
71
+ }
72
+ for (let i = 0; i < aLength; i++) {
73
+ if (equalsItem(a[i], b[i]) === false) {
74
+ return false;
75
+ }
76
+ }
77
+ return true;
78
+ }
79
+ function deepFreeze$2(value) {
80
+ // No need to freeze primitives
81
+ if (typeof value !== 'object' || value === null) {
82
+ return;
83
+ }
84
+ if (ArrayIsArray(value)) {
85
+ for (let i = 0, len = value.length; i < len; i += 1) {
86
+ deepFreeze$2(value[i]);
87
+ }
88
+ }
89
+ else {
90
+ const keys = ObjectKeys(value);
91
+ for (let i = 0, len = keys.length; i < len; i += 1) {
92
+ deepFreeze$2(value[keys[i]]);
93
+ }
94
+ }
95
+ ObjectFreeze(value);
96
+ }
97
+ function createLink(ref) {
98
+ return {
99
+ __ref: serializeStructuredKey(ref),
100
+ };
101
101
  }
102
102
 
103
- const VERSION$8 = "68601d043a553523b207d5fcc707e053";
104
- function validate$b(obj, path = 'InferenceErrorMessageRepresentation') {
105
- const v_error = (() => {
106
- if (typeof obj !== 'object' || ArrayIsArray(obj) || obj === null) {
107
- return new TypeError('Expected "object" but received "' + typeof obj + '" (at "' + path + '")');
108
- }
109
- const obj_message = obj.message;
110
- const path_message = path + '.message';
111
- if (typeof obj_message !== 'string') {
112
- return new TypeError('Expected "string" but received "' + typeof obj_message + '" (at "' + path_message + '")');
113
- }
114
- const obj_severityLevel = obj.severityLevel;
115
- const path_severityLevel = path + '.severityLevel';
116
- if (typeof obj_severityLevel !== 'string') {
117
- return new TypeError('Expected "string" but received "' + typeof obj_severityLevel + '" (at "' + path_severityLevel + '")');
118
- }
119
- })();
120
- return v_error === undefined ? null : v_error;
121
- }
122
- const select$d = function InferenceErrorMessageRepresentationSelect() {
123
- return {
124
- kind: 'Fragment',
125
- version: VERSION$8,
126
- private: [],
127
- selections: [
128
- {
129
- name: 'message',
130
- kind: 'Scalar'
131
- },
132
- {
133
- name: 'severityLevel',
134
- kind: 'Scalar'
135
- }
136
- ]
137
- };
138
- };
139
- function equals$8(existing, incoming) {
140
- const existing_message = existing.message;
141
- const incoming_message = incoming.message;
142
- if (!(existing_message === incoming_message)) {
143
- return false;
144
- }
145
- const existing_severityLevel = existing.severityLevel;
146
- const incoming_severityLevel = incoming.severityLevel;
147
- if (!(existing_severityLevel === incoming_severityLevel)) {
148
- return false;
149
- }
150
- return true;
151
- }
152
- function deepFreeze$1(input) {
153
- ObjectFreeze(input);
103
+ const VERSION$8 = "68601d043a553523b207d5fcc707e053";
104
+ function validate$b(obj, path = 'InferenceErrorMessageRepresentation') {
105
+ const v_error = (() => {
106
+ if (typeof obj !== 'object' || ArrayIsArray(obj) || obj === null) {
107
+ return new TypeError('Expected "object" but received "' + typeof obj + '" (at "' + path + '")');
108
+ }
109
+ const obj_message = obj.message;
110
+ const path_message = path + '.message';
111
+ if (typeof obj_message !== 'string') {
112
+ return new TypeError('Expected "string" but received "' + typeof obj_message + '" (at "' + path_message + '")');
113
+ }
114
+ const obj_severityLevel = obj.severityLevel;
115
+ const path_severityLevel = path + '.severityLevel';
116
+ if (typeof obj_severityLevel !== 'string') {
117
+ return new TypeError('Expected "string" but received "' + typeof obj_severityLevel + '" (at "' + path_severityLevel + '")');
118
+ }
119
+ })();
120
+ return v_error === undefined ? null : v_error;
121
+ }
122
+ const select$d = function InferenceErrorMessageRepresentationSelect() {
123
+ return {
124
+ kind: 'Fragment',
125
+ version: VERSION$8,
126
+ private: [],
127
+ selections: [
128
+ {
129
+ name: 'message',
130
+ kind: 'Scalar'
131
+ },
132
+ {
133
+ name: 'severityLevel',
134
+ kind: 'Scalar'
135
+ }
136
+ ]
137
+ };
138
+ };
139
+ function equals$8(existing, incoming) {
140
+ const existing_message = existing.message;
141
+ const incoming_message = incoming.message;
142
+ if (!(existing_message === incoming_message)) {
143
+ return false;
144
+ }
145
+ const existing_severityLevel = existing.severityLevel;
146
+ const incoming_severityLevel = incoming.severityLevel;
147
+ if (!(existing_severityLevel === incoming_severityLevel)) {
148
+ return false;
149
+ }
150
+ return true;
151
+ }
152
+ function deepFreeze$1(input) {
153
+ ObjectFreeze(input);
154
154
  }
155
155
 
156
- const VERSION$7 = "d45a6a39072862479f5c25fe921c0926";
157
- function validate$a(obj, path = 'DataShapeInferenceOutputRepresentation') {
158
- const v_error = (() => {
159
- if (typeof obj !== 'object' || ArrayIsArray(obj) || obj === null) {
160
- return new TypeError('Expected "object" but received "' + typeof obj + '" (at "' + path + '")');
161
- }
162
- const obj_errorMessages = obj.errorMessages;
163
- const path_errorMessages = path + '.errorMessages';
164
- if (!ArrayIsArray(obj_errorMessages)) {
165
- return new TypeError('Expected "array" but received "' + typeof obj_errorMessages + '" (at "' + path_errorMessages + '")');
166
- }
167
- for (let i = 0; i < obj_errorMessages.length; i++) {
168
- const obj_errorMessages_item = obj_errorMessages[i];
169
- const path_errorMessages_item = path_errorMessages + '[' + i + ']';
170
- const referencepath_errorMessages_itemValidationError = validate$b(obj_errorMessages_item, path_errorMessages_item);
171
- if (referencepath_errorMessages_itemValidationError !== null) {
172
- let message = 'Object doesn\'t match InferenceErrorMessageRepresentation (at "' + path_errorMessages_item + '")\n';
173
- message += referencepath_errorMessages_itemValidationError.message.split('\n').map((line) => '\t' + line).join('\n');
174
- return new TypeError(message);
175
- }
176
- }
177
- if (obj.example !== undefined) {
178
- const obj_example = obj.example;
179
- const path_example = path + '.example';
180
- if (typeof obj_example !== 'string') {
181
- return new TypeError('Expected "string" but received "' + typeof obj_example + '" (at "' + path_example + '")');
182
- }
183
- }
184
- const obj_items = obj.items;
185
- const path_items = path + '.items';
186
- if (!ArrayIsArray(obj_items)) {
187
- return new TypeError('Expected "array" but received "' + typeof obj_items + '" (at "' + path_items + '")');
188
- }
189
- for (let i = 0; i < obj_items.length; i++) {
190
- const obj_items_item = obj_items[i];
191
- const path_items_item = path_items + '[' + i + ']';
192
- const referencepath_items_itemValidationError = validate$a(obj_items_item, path_items_item);
193
- if (referencepath_items_itemValidationError !== null) {
194
- let message = 'Object doesn\'t match DataShapeInferenceOutputRepresentation (at "' + path_items_item + '")\n';
195
- message += referencepath_items_itemValidationError.message.split('\n').map((line) => '\t' + line).join('\n');
196
- return new TypeError(message);
197
- }
198
- }
199
- const obj_properties = obj.properties;
200
- const path_properties = path + '.properties';
201
- if (typeof obj_properties !== 'object' || ArrayIsArray(obj_properties) || obj_properties === null) {
202
- return new TypeError('Expected "object" but received "' + typeof obj_properties + '" (at "' + path_properties + '")');
203
- }
204
- const obj_properties_keys = ObjectKeys(obj_properties);
205
- for (let i = 0; i < obj_properties_keys.length; i++) {
206
- const key = obj_properties_keys[i];
207
- const obj_properties_prop = obj_properties[key];
208
- const path_properties_prop = path_properties + '["' + key + '"]';
209
- const referencepath_properties_propValidationError = validate$a(obj_properties_prop, path_properties_prop);
210
- if (referencepath_properties_propValidationError !== null) {
211
- let message = 'Object doesn\'t match DataShapeInferenceOutputRepresentation (at "' + path_properties_prop + '")\n';
212
- message += referencepath_properties_propValidationError.message.split('\n').map((line) => '\t' + line).join('\n');
213
- return new TypeError(message);
214
- }
215
- }
216
- const obj_success = obj.success;
217
- const path_success = path + '.success';
218
- if (typeof obj_success !== 'boolean') {
219
- return new TypeError('Expected "boolean" but received "' + typeof obj_success + '" (at "' + path_success + '")');
220
- }
221
- if (obj.type !== undefined) {
222
- const obj_type = obj.type;
223
- const path_type = path + '.type';
224
- if (typeof obj_type !== 'string') {
225
- return new TypeError('Expected "string" but received "' + typeof obj_type + '" (at "' + path_type + '")');
226
- }
227
- }
228
- })();
229
- return v_error === undefined ? null : v_error;
230
- }
231
- const RepresentationType$3 = 'DataShapeInferenceOutputRepresentation';
232
- function normalize$3(input, existing, path, luvio, store, timestamp) {
233
- return input;
234
- }
235
- const select$c = function DataShapeInferenceOutputRepresentationSelect() {
236
- return {
237
- kind: 'Fragment',
238
- version: VERSION$7,
239
- private: [],
240
- opaque: true
241
- };
242
- };
243
- function equals$7(existing, incoming) {
244
- if (JSONStringify(incoming) !== JSONStringify(existing)) {
245
- return false;
246
- }
247
- return true;
248
- }
249
- function deepFreeze(input) {
250
- const input_errorMessages = input.errorMessages;
251
- for (let i = 0; i < input_errorMessages.length; i++) {
252
- const input_errorMessages_item = input_errorMessages[i];
253
- deepFreeze$1(input_errorMessages_item);
254
- }
255
- ObjectFreeze(input_errorMessages);
256
- const input_items = input.items;
257
- for (let i = 0; i < input_items.length; i++) {
258
- const input_items_item = input_items[i];
259
- deepFreeze(input_items_item);
260
- }
261
- ObjectFreeze(input_items);
262
- const input_properties = input.properties;
263
- const input_properties_keys = Object.keys(input_properties);
264
- const input_properties_length = input_properties_keys.length;
265
- for (let i = 0; i < input_properties_length; i++) {
266
- const key = input_properties_keys[i];
267
- const input_properties_prop = input_properties[key];
268
- deepFreeze(input_properties_prop);
269
- }
270
- ObjectFreeze(input_properties);
271
- ObjectFreeze(input);
272
- }
273
- const ingest$3 = function DataShapeInferenceOutputRepresentationIngest(input, path, luvio, store, timestamp) {
274
- if (process.env.NODE_ENV !== 'production') {
275
- const validateError = validate$a(input);
276
- if (validateError !== null) {
277
- throw validateError;
278
- }
279
- }
280
- const key = path.fullPath;
281
- const existingRecord = store.readEntry(key);
282
- const ttlToUse = path.ttl !== undefined ? path.ttl : 300000;
283
- let incomingRecord = normalize$3(input, store.readEntry(key), {
284
- fullPath: key,
285
- parent: path.parent,
286
- propertyName: path.propertyName,
287
- ttl: ttlToUse
288
- });
289
- deepFreeze(input);
290
- if (existingRecord === undefined || equals$7(existingRecord, incomingRecord) === false) {
291
- luvio.storePublish(key, incomingRecord);
292
- }
293
- if (ttlToUse !== undefined) {
294
- const storeMetadataParams = {
295
- ttl: ttlToUse,
296
- namespace: "external-services",
297
- version: VERSION$7,
298
- representationName: RepresentationType$3,
299
- };
300
- luvio.publishStoreMetadata(key, storeMetadataParams);
301
- }
302
- return createLink(key);
303
- };
304
- function getTypeCacheKeys$3(luvio, input, fullPathFactory) {
305
- const rootKeySet = new StoreKeyMap();
306
- // root cache key (uses fullPathFactory if keyBuilderFromType isn't defined)
307
- const rootKey = fullPathFactory();
308
- rootKeySet.set(rootKey, {
309
- namespace: keyPrefix,
310
- representationName: RepresentationType$3,
311
- mergeable: false
312
- });
313
- return rootKeySet;
156
+ const VERSION$7 = "d45a6a39072862479f5c25fe921c0926";
157
+ function validate$a(obj, path = 'DataShapeInferenceOutputRepresentation') {
158
+ const v_error = (() => {
159
+ if (typeof obj !== 'object' || ArrayIsArray(obj) || obj === null) {
160
+ return new TypeError('Expected "object" but received "' + typeof obj + '" (at "' + path + '")');
161
+ }
162
+ const obj_errorMessages = obj.errorMessages;
163
+ const path_errorMessages = path + '.errorMessages';
164
+ if (!ArrayIsArray(obj_errorMessages)) {
165
+ return new TypeError('Expected "array" but received "' + typeof obj_errorMessages + '" (at "' + path_errorMessages + '")');
166
+ }
167
+ for (let i = 0; i < obj_errorMessages.length; i++) {
168
+ const obj_errorMessages_item = obj_errorMessages[i];
169
+ const path_errorMessages_item = path_errorMessages + '[' + i + ']';
170
+ const referencepath_errorMessages_itemValidationError = validate$b(obj_errorMessages_item, path_errorMessages_item);
171
+ if (referencepath_errorMessages_itemValidationError !== null) {
172
+ let message = 'Object doesn\'t match InferenceErrorMessageRepresentation (at "' + path_errorMessages_item + '")\n';
173
+ message += referencepath_errorMessages_itemValidationError.message.split('\n').map((line) => '\t' + line).join('\n');
174
+ return new TypeError(message);
175
+ }
176
+ }
177
+ if (obj.example !== undefined) {
178
+ const obj_example = obj.example;
179
+ const path_example = path + '.example';
180
+ if (typeof obj_example !== 'string') {
181
+ return new TypeError('Expected "string" but received "' + typeof obj_example + '" (at "' + path_example + '")');
182
+ }
183
+ }
184
+ const obj_items = obj.items;
185
+ const path_items = path + '.items';
186
+ if (!ArrayIsArray(obj_items)) {
187
+ return new TypeError('Expected "array" but received "' + typeof obj_items + '" (at "' + path_items + '")');
188
+ }
189
+ for (let i = 0; i < obj_items.length; i++) {
190
+ const obj_items_item = obj_items[i];
191
+ const path_items_item = path_items + '[' + i + ']';
192
+ const referencepath_items_itemValidationError = validate$a(obj_items_item, path_items_item);
193
+ if (referencepath_items_itemValidationError !== null) {
194
+ let message = 'Object doesn\'t match DataShapeInferenceOutputRepresentation (at "' + path_items_item + '")\n';
195
+ message += referencepath_items_itemValidationError.message.split('\n').map((line) => '\t' + line).join('\n');
196
+ return new TypeError(message);
197
+ }
198
+ }
199
+ const obj_properties = obj.properties;
200
+ const path_properties = path + '.properties';
201
+ if (typeof obj_properties !== 'object' || ArrayIsArray(obj_properties) || obj_properties === null) {
202
+ return new TypeError('Expected "object" but received "' + typeof obj_properties + '" (at "' + path_properties + '")');
203
+ }
204
+ const obj_properties_keys = ObjectKeys(obj_properties);
205
+ for (let i = 0; i < obj_properties_keys.length; i++) {
206
+ const key = obj_properties_keys[i];
207
+ const obj_properties_prop = obj_properties[key];
208
+ const path_properties_prop = path_properties + '["' + key + '"]';
209
+ const referencepath_properties_propValidationError = validate$a(obj_properties_prop, path_properties_prop);
210
+ if (referencepath_properties_propValidationError !== null) {
211
+ let message = 'Object doesn\'t match DataShapeInferenceOutputRepresentation (at "' + path_properties_prop + '")\n';
212
+ message += referencepath_properties_propValidationError.message.split('\n').map((line) => '\t' + line).join('\n');
213
+ return new TypeError(message);
214
+ }
215
+ }
216
+ const obj_success = obj.success;
217
+ const path_success = path + '.success';
218
+ if (typeof obj_success !== 'boolean') {
219
+ return new TypeError('Expected "boolean" but received "' + typeof obj_success + '" (at "' + path_success + '")');
220
+ }
221
+ if (obj.type !== undefined) {
222
+ const obj_type = obj.type;
223
+ const path_type = path + '.type';
224
+ if (typeof obj_type !== 'string') {
225
+ return new TypeError('Expected "string" but received "' + typeof obj_type + '" (at "' + path_type + '")');
226
+ }
227
+ }
228
+ })();
229
+ return v_error === undefined ? null : v_error;
230
+ }
231
+ const RepresentationType$3 = 'DataShapeInferenceOutputRepresentation';
232
+ function normalize$3(input, existing, path, luvio, store, timestamp) {
233
+ return input;
234
+ }
235
+ const select$c = function DataShapeInferenceOutputRepresentationSelect() {
236
+ return {
237
+ kind: 'Fragment',
238
+ version: VERSION$7,
239
+ private: [],
240
+ opaque: true
241
+ };
242
+ };
243
+ function equals$7(existing, incoming) {
244
+ if (JSONStringify(incoming) !== JSONStringify(existing)) {
245
+ return false;
246
+ }
247
+ return true;
248
+ }
249
+ function deepFreeze(input) {
250
+ const input_errorMessages = input.errorMessages;
251
+ for (let i = 0; i < input_errorMessages.length; i++) {
252
+ const input_errorMessages_item = input_errorMessages[i];
253
+ deepFreeze$1(input_errorMessages_item);
254
+ }
255
+ ObjectFreeze(input_errorMessages);
256
+ const input_items = input.items;
257
+ for (let i = 0; i < input_items.length; i++) {
258
+ const input_items_item = input_items[i];
259
+ deepFreeze(input_items_item);
260
+ }
261
+ ObjectFreeze(input_items);
262
+ const input_properties = input.properties;
263
+ const input_properties_keys = Object.keys(input_properties);
264
+ const input_properties_length = input_properties_keys.length;
265
+ for (let i = 0; i < input_properties_length; i++) {
266
+ const key = input_properties_keys[i];
267
+ const input_properties_prop = input_properties[key];
268
+ deepFreeze(input_properties_prop);
269
+ }
270
+ ObjectFreeze(input_properties);
271
+ ObjectFreeze(input);
272
+ }
273
+ const ingest$3 = function DataShapeInferenceOutputRepresentationIngest(input, path, luvio, store, timestamp) {
274
+ if (process.env.NODE_ENV !== 'production') {
275
+ const validateError = validate$a(input);
276
+ if (validateError !== null) {
277
+ throw validateError;
278
+ }
279
+ }
280
+ const key = path.fullPath;
281
+ const existingRecord = store.readEntry(key);
282
+ const ttlToUse = path.ttl !== undefined ? path.ttl : 300000;
283
+ let incomingRecord = normalize$3(input, store.readEntry(key), {
284
+ fullPath: key,
285
+ parent: path.parent,
286
+ propertyName: path.propertyName,
287
+ ttl: ttlToUse
288
+ });
289
+ deepFreeze(input);
290
+ if (existingRecord === undefined || equals$7(existingRecord, incomingRecord) === false) {
291
+ luvio.storePublish(key, incomingRecord);
292
+ }
293
+ if (ttlToUse !== undefined) {
294
+ const storeMetadataParams = {
295
+ ttl: ttlToUse,
296
+ namespace: "external-services",
297
+ version: VERSION$7,
298
+ representationName: RepresentationType$3,
299
+ };
300
+ luvio.publishStoreMetadata(key, storeMetadataParams);
301
+ }
302
+ return createLink(key);
303
+ };
304
+ function getTypeCacheKeys$3(luvio, input, fullPathFactory) {
305
+ const rootKeySet = new StoreKeyMap();
306
+ // root cache key (uses fullPathFactory if keyBuilderFromType isn't defined)
307
+ const rootKey = fullPathFactory();
308
+ rootKeySet.set(rootKey, {
309
+ namespace: keyPrefix,
310
+ representationName: RepresentationType$3,
311
+ mergeable: false
312
+ });
313
+ return rootKeySet;
314
314
  }
315
315
 
316
- function select$b(luvio, params) {
317
- return select$c();
318
- }
319
- function keyBuilder$8(luvio, params) {
320
- return keyPrefix + '::DataShapeInferenceOutputRepresentation:(' + 'exampleData:' + params.queryParams.exampleData + ',' + 'mediaType:' + params.queryParams.mediaType + ',' + 'version:' + params.urlParams.version + ')';
321
- }
322
- function getResponseCacheKeys$4(luvio, resourceParams, response) {
323
- return getTypeCacheKeys$3(luvio, response, () => keyBuilder$8(luvio, resourceParams));
324
- }
325
- function ingestSuccess$4(luvio, resourceParams, response, snapshotRefresh) {
326
- const { body } = response;
327
- const key = keyBuilder$8(luvio, resourceParams);
328
- luvio.storeIngest(key, ingest$3, body);
329
- const snapshot = luvio.storeLookup({
330
- recordId: key,
331
- node: select$b(),
332
- variables: {},
333
- }, snapshotRefresh);
334
- if (process.env.NODE_ENV !== 'production') {
335
- if (snapshot.state !== 'Fulfilled') {
336
- throw new Error('Invalid network response. Expected resource response to result in Fulfilled snapshot');
337
- }
338
- }
339
- return snapshot;
340
- }
341
- function ingestError$3(luvio, params, error, snapshotRefresh) {
342
- const key = keyBuilder$8(luvio, params);
343
- const errorSnapshot = luvio.errorSnapshot(error, snapshotRefresh);
344
- luvio.storeIngestError(key, errorSnapshot);
345
- return errorSnapshot;
346
- }
347
- function createResourceRequest$4(config) {
348
- const headers = {};
349
- return {
350
- baseUri: '/services/data/v58.0',
351
- basePath: '/externalservices/inference/datashape/' + config.urlParams.version + '',
352
- method: 'post',
353
- body: null,
354
- urlParams: config.urlParams,
355
- queryParams: config.queryParams,
356
- headers,
357
- priority: 'normal',
358
- };
316
+ function select$b(luvio, params) {
317
+ return select$c();
318
+ }
319
+ function keyBuilder$8(luvio, params) {
320
+ return keyPrefix + '::DataShapeInferenceOutputRepresentation:(' + 'exampleData:' + params.queryParams.exampleData + ',' + 'mediaType:' + params.queryParams.mediaType + ',' + 'version:' + params.urlParams.version + ')';
321
+ }
322
+ function getResponseCacheKeys$4(luvio, resourceParams, response) {
323
+ return getTypeCacheKeys$3(luvio, response, () => keyBuilder$8(luvio, resourceParams));
324
+ }
325
+ function ingestSuccess$4(luvio, resourceParams, response, snapshotRefresh) {
326
+ const { body } = response;
327
+ const key = keyBuilder$8(luvio, resourceParams);
328
+ luvio.storeIngest(key, ingest$3, body);
329
+ const snapshot = luvio.storeLookup({
330
+ recordId: key,
331
+ node: select$b(),
332
+ variables: {},
333
+ }, snapshotRefresh);
334
+ if (process.env.NODE_ENV !== 'production') {
335
+ if (snapshot.state !== 'Fulfilled') {
336
+ throw new Error('Invalid network response. Expected resource response to result in Fulfilled snapshot');
337
+ }
338
+ }
339
+ return snapshot;
340
+ }
341
+ function ingestError$3(luvio, params, error, snapshotRefresh) {
342
+ const key = keyBuilder$8(luvio, params);
343
+ const errorSnapshot = luvio.errorSnapshot(error, snapshotRefresh);
344
+ luvio.storeIngestError(key, errorSnapshot);
345
+ return errorSnapshot;
346
+ }
347
+ function createResourceRequest$4(config) {
348
+ const headers = {};
349
+ return {
350
+ baseUri: '/services/data/v58.0',
351
+ basePath: '/externalservices/inference/datashape/' + config.urlParams.version + '',
352
+ method: 'post',
353
+ body: null,
354
+ urlParams: config.urlParams,
355
+ queryParams: config.queryParams,
356
+ headers,
357
+ priority: 'normal',
358
+ };
359
359
  }
360
360
 
361
- const getDataShape_ConfigPropertyNames = {
362
- displayName: 'getDataShape',
363
- parameters: {
364
- required: ['version'],
365
- optional: ['exampleData', 'mediaType']
366
- }
367
- };
368
- function createResourceParams$4(config) {
369
- const resourceParams = {
370
- urlParams: {
371
- version: config.version
372
- },
373
- queryParams: {
374
- exampleData: config.exampleData, mediaType: config.mediaType
375
- }
376
- };
377
- return resourceParams;
378
- }
379
- function keyBuilder$7(luvio, config) {
380
- const resourceParams = createResourceParams$4(config);
381
- return keyBuilder$8(luvio, resourceParams);
382
- }
383
- function typeCheckConfig$4(untrustedConfig) {
384
- const config = {};
385
- const untrustedConfig_version = untrustedConfig.version;
386
- if (typeof untrustedConfig_version === 'string') {
387
- config.version = untrustedConfig_version;
388
- }
389
- const untrustedConfig_exampleData = untrustedConfig.exampleData;
390
- if (typeof untrustedConfig_exampleData === 'string') {
391
- config.exampleData = untrustedConfig_exampleData;
392
- }
393
- const untrustedConfig_mediaType = untrustedConfig.mediaType;
394
- if (typeof untrustedConfig_mediaType === 'string') {
395
- config.mediaType = untrustedConfig_mediaType;
396
- }
397
- return config;
398
- }
399
- function validateAdapterConfig$4(untrustedConfig, configPropertyNames) {
400
- if (!untrustedIsObject(untrustedConfig)) {
401
- return null;
402
- }
403
- if (process.env.NODE_ENV !== 'production') {
404
- validateConfig(untrustedConfig, configPropertyNames);
405
- }
406
- const config = typeCheckConfig$4(untrustedConfig);
407
- if (!areRequiredParametersPresent(config, configPropertyNames)) {
408
- return null;
409
- }
410
- return config;
411
- }
412
- function adapterFragment$3(luvio, config) {
413
- createResourceParams$4(config);
414
- return select$b();
415
- }
416
- function onFetchResponseSuccess$3(luvio, config, resourceParams, response) {
417
- const snapshot = ingestSuccess$4(luvio, resourceParams, response, {
418
- config,
419
- resolve: () => buildNetworkSnapshot$4(luvio, config, snapshotRefreshOptions)
420
- });
421
- return luvio.storeBroadcast().then(() => snapshot);
422
- }
423
- function onFetchResponseError$3(luvio, config, resourceParams, response) {
424
- const snapshot = ingestError$3(luvio, resourceParams, response, {
425
- config,
426
- resolve: () => buildNetworkSnapshot$4(luvio, config, snapshotRefreshOptions)
427
- });
428
- return luvio.storeBroadcast().then(() => snapshot);
429
- }
430
- function buildNetworkSnapshot$4(luvio, config, options) {
431
- const resourceParams = createResourceParams$4(config);
432
- const request = createResourceRequest$4(resourceParams);
433
- return luvio.dispatchResourceRequest(request, options)
434
- .then((response) => {
435
- return luvio.handleSuccessResponse(() => onFetchResponseSuccess$3(luvio, config, resourceParams, response), () => getResponseCacheKeys$4(luvio, resourceParams, response.body));
436
- }, (response) => {
437
- return luvio.handleErrorResponse(() => onFetchResponseError$3(luvio, config, resourceParams, response));
438
- });
439
- }
440
- function buildNetworkSnapshotCachePolicy$3(context, coercedAdapterRequestContext) {
441
- const { luvio, config } = context;
442
- const { networkPriority, requestCorrelator, eventObservers } = coercedAdapterRequestContext;
443
- const dispatchOptions = {
444
- resourceRequestContext: {
445
- requestCorrelator,
446
- luvioRequestMethod: 'get',
447
- },
448
- eventObservers
449
- };
450
- if (networkPriority !== 'normal') {
451
- dispatchOptions.overrides = {
452
- priority: networkPriority
453
- };
454
- }
455
- return buildNetworkSnapshot$4(luvio, config, dispatchOptions);
456
- }
457
- function buildCachedSnapshotCachePolicy$3(context, storeLookup) {
458
- const { luvio, config } = context;
459
- const selector = {
460
- recordId: keyBuilder$7(luvio, config),
461
- node: adapterFragment$3(luvio, config),
462
- variables: {},
463
- };
464
- const cacheSnapshot = storeLookup(selector, {
465
- config,
466
- resolve: () => buildNetworkSnapshot$4(luvio, config, snapshotRefreshOptions)
467
- });
468
- return cacheSnapshot;
469
- }
470
- const getDataShapeAdapterFactory = (luvio) => function externalServices__getDataShape(untrustedConfig, requestContext) {
471
- const config = validateAdapterConfig$4(untrustedConfig, getDataShape_ConfigPropertyNames);
472
- // Invalid or incomplete config
473
- if (config === null) {
474
- return null;
475
- }
476
- return luvio.applyCachePolicy((requestContext || {}), { config, luvio }, // BuildSnapshotContext
477
- buildCachedSnapshotCachePolicy$3, buildNetworkSnapshotCachePolicy$3);
361
+ const getDataShape_ConfigPropertyNames = {
362
+ displayName: 'getDataShape',
363
+ parameters: {
364
+ required: ['version'],
365
+ optional: ['exampleData', 'mediaType']
366
+ }
367
+ };
368
+ function createResourceParams$4(config) {
369
+ const resourceParams = {
370
+ urlParams: {
371
+ version: config.version
372
+ },
373
+ queryParams: {
374
+ exampleData: config.exampleData, mediaType: config.mediaType
375
+ }
376
+ };
377
+ return resourceParams;
378
+ }
379
+ function keyBuilder$7(luvio, config) {
380
+ const resourceParams = createResourceParams$4(config);
381
+ return keyBuilder$8(luvio, resourceParams);
382
+ }
383
+ function typeCheckConfig$4(untrustedConfig) {
384
+ const config = {};
385
+ const untrustedConfig_version = untrustedConfig.version;
386
+ if (typeof untrustedConfig_version === 'string') {
387
+ config.version = untrustedConfig_version;
388
+ }
389
+ const untrustedConfig_exampleData = untrustedConfig.exampleData;
390
+ if (typeof untrustedConfig_exampleData === 'string') {
391
+ config.exampleData = untrustedConfig_exampleData;
392
+ }
393
+ const untrustedConfig_mediaType = untrustedConfig.mediaType;
394
+ if (typeof untrustedConfig_mediaType === 'string') {
395
+ config.mediaType = untrustedConfig_mediaType;
396
+ }
397
+ return config;
398
+ }
399
+ function validateAdapterConfig$4(untrustedConfig, configPropertyNames) {
400
+ if (!untrustedIsObject(untrustedConfig)) {
401
+ return null;
402
+ }
403
+ if (process.env.NODE_ENV !== 'production') {
404
+ validateConfig(untrustedConfig, configPropertyNames);
405
+ }
406
+ const config = typeCheckConfig$4(untrustedConfig);
407
+ if (!areRequiredParametersPresent(config, configPropertyNames)) {
408
+ return null;
409
+ }
410
+ return config;
411
+ }
412
+ function adapterFragment$3(luvio, config) {
413
+ createResourceParams$4(config);
414
+ return select$b();
415
+ }
416
+ function onFetchResponseSuccess$3(luvio, config, resourceParams, response) {
417
+ const snapshot = ingestSuccess$4(luvio, resourceParams, response, {
418
+ config,
419
+ resolve: () => buildNetworkSnapshot$4(luvio, config, snapshotRefreshOptions)
420
+ });
421
+ return luvio.storeBroadcast().then(() => snapshot);
422
+ }
423
+ function onFetchResponseError$3(luvio, config, resourceParams, response) {
424
+ const snapshot = ingestError$3(luvio, resourceParams, response, {
425
+ config,
426
+ resolve: () => buildNetworkSnapshot$4(luvio, config, snapshotRefreshOptions)
427
+ });
428
+ return luvio.storeBroadcast().then(() => snapshot);
429
+ }
430
+ function buildNetworkSnapshot$4(luvio, config, options) {
431
+ const resourceParams = createResourceParams$4(config);
432
+ const request = createResourceRequest$4(resourceParams);
433
+ return luvio.dispatchResourceRequest(request, options)
434
+ .then((response) => {
435
+ return luvio.handleSuccessResponse(() => onFetchResponseSuccess$3(luvio, config, resourceParams, response), () => getResponseCacheKeys$4(luvio, resourceParams, response.body));
436
+ }, (response) => {
437
+ return luvio.handleErrorResponse(() => onFetchResponseError$3(luvio, config, resourceParams, response));
438
+ });
439
+ }
440
+ function buildNetworkSnapshotCachePolicy$3(context, coercedAdapterRequestContext) {
441
+ const { luvio, config } = context;
442
+ const { networkPriority, requestCorrelator, eventObservers } = coercedAdapterRequestContext;
443
+ const dispatchOptions = {
444
+ resourceRequestContext: {
445
+ requestCorrelator,
446
+ luvioRequestMethod: 'get',
447
+ },
448
+ eventObservers
449
+ };
450
+ if (networkPriority !== 'normal') {
451
+ dispatchOptions.overrides = {
452
+ priority: networkPriority
453
+ };
454
+ }
455
+ return buildNetworkSnapshot$4(luvio, config, dispatchOptions);
456
+ }
457
+ function buildCachedSnapshotCachePolicy$3(context, storeLookup) {
458
+ const { luvio, config } = context;
459
+ const selector = {
460
+ recordId: keyBuilder$7(luvio, config),
461
+ node: adapterFragment$3(luvio, config),
462
+ variables: {},
463
+ };
464
+ const cacheSnapshot = storeLookup(selector, {
465
+ config,
466
+ resolve: () => buildNetworkSnapshot$4(luvio, config, snapshotRefreshOptions)
467
+ });
468
+ return cacheSnapshot;
469
+ }
470
+ const getDataShapeAdapterFactory = (luvio) => function externalServices__getDataShape(untrustedConfig, requestContext) {
471
+ const config = validateAdapterConfig$4(untrustedConfig, getDataShape_ConfigPropertyNames);
472
+ // Invalid or incomplete config
473
+ if (config === null) {
474
+ return null;
475
+ }
476
+ return luvio.applyCachePolicy((requestContext || {}), { config, luvio }, // BuildSnapshotContext
477
+ buildCachedSnapshotCachePolicy$3, buildNetworkSnapshotCachePolicy$3);
478
478
  };
479
479
 
480
- function validate$9(obj, path = 'OpenApiSpecInferenceParameterRepresentation') {
481
- const v_error = (() => {
482
- if (typeof obj !== 'object' || ArrayIsArray(obj) || obj === null) {
483
- return new TypeError('Expected "object" but received "' + typeof obj + '" (at "' + path + '")');
484
- }
485
- if (obj.description !== undefined) {
486
- const obj_description = obj.description;
487
- const path_description = path + '.description';
488
- if (typeof obj_description !== 'string') {
489
- return new TypeError('Expected "string" but received "' + typeof obj_description + '" (at "' + path_description + '")');
490
- }
491
- }
492
- const obj_location = obj.location;
493
- const path_location = path + '.location';
494
- if (typeof obj_location !== 'string') {
495
- return new TypeError('Expected "string" but received "' + typeof obj_location + '" (at "' + path_location + '")');
496
- }
497
- const obj_name = obj.name;
498
- const path_name = path + '.name';
499
- if (typeof obj_name !== 'string') {
500
- return new TypeError('Expected "string" but received "' + typeof obj_name + '" (at "' + path_name + '")');
501
- }
502
- const obj_required = obj.required;
503
- const path_required = path + '.required';
504
- if (typeof obj_required !== 'boolean') {
505
- return new TypeError('Expected "boolean" but received "' + typeof obj_required + '" (at "' + path_required + '")');
506
- }
507
- const obj_type = obj.type;
508
- const path_type = path + '.type';
509
- if (typeof obj_type !== 'string') {
510
- return new TypeError('Expected "string" but received "' + typeof obj_type + '" (at "' + path_type + '")');
511
- }
512
- })();
513
- return v_error === undefined ? null : v_error;
480
+ function validate$9(obj, path = 'OpenApiSpecInferenceParameterRepresentation') {
481
+ const v_error = (() => {
482
+ if (typeof obj !== 'object' || ArrayIsArray(obj) || obj === null) {
483
+ return new TypeError('Expected "object" but received "' + typeof obj + '" (at "' + path + '")');
484
+ }
485
+ if (obj.description !== undefined) {
486
+ const obj_description = obj.description;
487
+ const path_description = path + '.description';
488
+ if (typeof obj_description !== 'string') {
489
+ return new TypeError('Expected "string" but received "' + typeof obj_description + '" (at "' + path_description + '")');
490
+ }
491
+ }
492
+ const obj_location = obj.location;
493
+ const path_location = path + '.location';
494
+ if (typeof obj_location !== 'string') {
495
+ return new TypeError('Expected "string" but received "' + typeof obj_location + '" (at "' + path_location + '")');
496
+ }
497
+ const obj_name = obj.name;
498
+ const path_name = path + '.name';
499
+ if (typeof obj_name !== 'string') {
500
+ return new TypeError('Expected "string" but received "' + typeof obj_name + '" (at "' + path_name + '")');
501
+ }
502
+ const obj_required = obj.required;
503
+ const path_required = path + '.required';
504
+ if (typeof obj_required !== 'boolean') {
505
+ return new TypeError('Expected "boolean" but received "' + typeof obj_required + '" (at "' + path_required + '")');
506
+ }
507
+ const obj_type = obj.type;
508
+ const path_type = path + '.type';
509
+ if (typeof obj_type !== 'string') {
510
+ return new TypeError('Expected "string" but received "' + typeof obj_type + '" (at "' + path_type + '")');
511
+ }
512
+ })();
513
+ return v_error === undefined ? null : v_error;
514
514
  }
515
515
 
516
- function validate$8(obj, path = 'OpenApiSpecInferenceInputRepresentation') {
517
- const v_error = (() => {
518
- if (typeof obj !== 'object' || ArrayIsArray(obj) || obj === null) {
519
- return new TypeError('Expected "object" but received "' + typeof obj + '" (at "' + path + '")');
520
- }
521
- const obj_description = obj.description;
522
- const path_description = path + '.description';
523
- if (typeof obj_description !== 'string') {
524
- return new TypeError('Expected "string" but received "' + typeof obj_description + '" (at "' + path_description + '")');
525
- }
526
- if (obj.externalServiceId !== undefined) {
527
- const obj_externalServiceId = obj.externalServiceId;
528
- const path_externalServiceId = path + '.externalServiceId';
529
- if (typeof obj_externalServiceId !== 'string') {
530
- return new TypeError('Expected "string" but received "' + typeof obj_externalServiceId + '" (at "' + path_externalServiceId + '")');
531
- }
532
- }
533
- const obj_method = obj.method;
534
- const path_method = path + '.method';
535
- if (typeof obj_method !== 'string') {
536
- return new TypeError('Expected "string" but received "' + typeof obj_method + '" (at "' + path_method + '")');
537
- }
538
- const obj_name = obj.name;
539
- const path_name = path + '.name';
540
- if (typeof obj_name !== 'string') {
541
- return new TypeError('Expected "string" but received "' + typeof obj_name + '" (at "' + path_name + '")');
542
- }
543
- const obj_operationDescription = obj.operationDescription;
544
- const path_operationDescription = path + '.operationDescription';
545
- if (typeof obj_operationDescription !== 'string') {
546
- return new TypeError('Expected "string" but received "' + typeof obj_operationDescription + '" (at "' + path_operationDescription + '")');
547
- }
548
- const obj_operationName = obj.operationName;
549
- const path_operationName = path + '.operationName';
550
- if (typeof obj_operationName !== 'string') {
551
- return new TypeError('Expected "string" but received "' + typeof obj_operationName + '" (at "' + path_operationName + '")');
552
- }
553
- const obj_parameters = obj.parameters;
554
- const path_parameters = path + '.parameters';
555
- if (!ArrayIsArray(obj_parameters)) {
556
- return new TypeError('Expected "array" but received "' + typeof obj_parameters + '" (at "' + path_parameters + '")');
557
- }
558
- for (let i = 0; i < obj_parameters.length; i++) {
559
- const obj_parameters_item = obj_parameters[i];
560
- const path_parameters_item = path_parameters + '[' + i + ']';
561
- const referencepath_parameters_itemValidationError = validate$9(obj_parameters_item, path_parameters_item);
562
- if (referencepath_parameters_itemValidationError !== null) {
563
- let message = 'Object doesn\'t match OpenApiSpecInferenceParameterRepresentation (at "' + path_parameters_item + '")\n';
564
- message += referencepath_parameters_itemValidationError.message.split('\n').map((line) => '\t' + line).join('\n');
565
- return new TypeError(message);
566
- }
567
- }
568
- const obj_path = obj.path;
569
- const path_path = path + '.path';
570
- if (typeof obj_path !== 'string') {
571
- return new TypeError('Expected "string" but received "' + typeof obj_path + '" (at "' + path_path + '")');
572
- }
573
- if (obj.requestBody !== undefined) {
574
- const obj_requestBody = obj.requestBody;
575
- const path_requestBody = path + '.requestBody';
576
- if (typeof obj_requestBody !== 'object' || ArrayIsArray(obj_requestBody) || obj_requestBody === null) {
577
- return new TypeError('Expected "object" but received "' + typeof obj_requestBody + '" (at "' + path_requestBody + '")');
578
- }
579
- }
580
- const obj_responseBody = obj.responseBody;
581
- const path_responseBody = path + '.responseBody';
582
- if (typeof obj_responseBody !== 'object' || ArrayIsArray(obj_responseBody) || obj_responseBody === null) {
583
- return new TypeError('Expected "object" but received "' + typeof obj_responseBody + '" (at "' + path_responseBody + '")');
584
- }
585
- })();
586
- return v_error === undefined ? null : v_error;
516
+ function validate$8(obj, path = 'OpenApiSpecInferenceInputRepresentation') {
517
+ const v_error = (() => {
518
+ if (typeof obj !== 'object' || ArrayIsArray(obj) || obj === null) {
519
+ return new TypeError('Expected "object" but received "' + typeof obj + '" (at "' + path + '")');
520
+ }
521
+ const obj_description = obj.description;
522
+ const path_description = path + '.description';
523
+ if (typeof obj_description !== 'string') {
524
+ return new TypeError('Expected "string" but received "' + typeof obj_description + '" (at "' + path_description + '")');
525
+ }
526
+ if (obj.externalServiceId !== undefined) {
527
+ const obj_externalServiceId = obj.externalServiceId;
528
+ const path_externalServiceId = path + '.externalServiceId';
529
+ if (typeof obj_externalServiceId !== 'string') {
530
+ return new TypeError('Expected "string" but received "' + typeof obj_externalServiceId + '" (at "' + path_externalServiceId + '")');
531
+ }
532
+ }
533
+ const obj_method = obj.method;
534
+ const path_method = path + '.method';
535
+ if (typeof obj_method !== 'string') {
536
+ return new TypeError('Expected "string" but received "' + typeof obj_method + '" (at "' + path_method + '")');
537
+ }
538
+ const obj_name = obj.name;
539
+ const path_name = path + '.name';
540
+ if (typeof obj_name !== 'string') {
541
+ return new TypeError('Expected "string" but received "' + typeof obj_name + '" (at "' + path_name + '")');
542
+ }
543
+ const obj_operationDescription = obj.operationDescription;
544
+ const path_operationDescription = path + '.operationDescription';
545
+ if (typeof obj_operationDescription !== 'string') {
546
+ return new TypeError('Expected "string" but received "' + typeof obj_operationDescription + '" (at "' + path_operationDescription + '")');
547
+ }
548
+ const obj_operationName = obj.operationName;
549
+ const path_operationName = path + '.operationName';
550
+ if (typeof obj_operationName !== 'string') {
551
+ return new TypeError('Expected "string" but received "' + typeof obj_operationName + '" (at "' + path_operationName + '")');
552
+ }
553
+ const obj_parameters = obj.parameters;
554
+ const path_parameters = path + '.parameters';
555
+ if (!ArrayIsArray(obj_parameters)) {
556
+ return new TypeError('Expected "array" but received "' + typeof obj_parameters + '" (at "' + path_parameters + '")');
557
+ }
558
+ for (let i = 0; i < obj_parameters.length; i++) {
559
+ const obj_parameters_item = obj_parameters[i];
560
+ const path_parameters_item = path_parameters + '[' + i + ']';
561
+ const referencepath_parameters_itemValidationError = validate$9(obj_parameters_item, path_parameters_item);
562
+ if (referencepath_parameters_itemValidationError !== null) {
563
+ let message = 'Object doesn\'t match OpenApiSpecInferenceParameterRepresentation (at "' + path_parameters_item + '")\n';
564
+ message += referencepath_parameters_itemValidationError.message.split('\n').map((line) => '\t' + line).join('\n');
565
+ return new TypeError(message);
566
+ }
567
+ }
568
+ const obj_path = obj.path;
569
+ const path_path = path + '.path';
570
+ if (typeof obj_path !== 'string') {
571
+ return new TypeError('Expected "string" but received "' + typeof obj_path + '" (at "' + path_path + '")');
572
+ }
573
+ if (obj.requestBody !== undefined) {
574
+ const obj_requestBody = obj.requestBody;
575
+ const path_requestBody = path + '.requestBody';
576
+ if (typeof obj_requestBody !== 'object' || ArrayIsArray(obj_requestBody) || obj_requestBody === null) {
577
+ return new TypeError('Expected "object" but received "' + typeof obj_requestBody + '" (at "' + path_requestBody + '")');
578
+ }
579
+ }
580
+ const obj_responseBody = obj.responseBody;
581
+ const path_responseBody = path + '.responseBody';
582
+ if (typeof obj_responseBody !== 'object' || ArrayIsArray(obj_responseBody) || obj_responseBody === null) {
583
+ return new TypeError('Expected "object" but received "' + typeof obj_responseBody + '" (at "' + path_responseBody + '")');
584
+ }
585
+ })();
586
+ return v_error === undefined ? null : v_error;
587
587
  }
588
588
 
589
- const TTL = 500;
590
- const VERSION$6 = "9f5779e32b8c9e02976609db89831dbb";
591
- function validate$7(obj, path = 'OpenApiSpecInferenceOutputRepresentation') {
592
- const v_error = (() => {
593
- if (typeof obj !== 'object' || ArrayIsArray(obj) || obj === null) {
594
- return new TypeError('Expected "object" but received "' + typeof obj + '" (at "' + path + '")');
595
- }
596
- const obj_errorMessages = obj.errorMessages;
597
- const path_errorMessages = path + '.errorMessages';
598
- if (!ArrayIsArray(obj_errorMessages)) {
599
- return new TypeError('Expected "array" but received "' + typeof obj_errorMessages + '" (at "' + path_errorMessages + '")');
600
- }
601
- for (let i = 0; i < obj_errorMessages.length; i++) {
602
- const obj_errorMessages_item = obj_errorMessages[i];
603
- const path_errorMessages_item = path_errorMessages + '[' + i + ']';
604
- const referencepath_errorMessages_itemValidationError = validate$b(obj_errorMessages_item, path_errorMessages_item);
605
- if (referencepath_errorMessages_itemValidationError !== null) {
606
- let message = 'Object doesn\'t match InferenceErrorMessageRepresentation (at "' + path_errorMessages_item + '")\n';
607
- message += referencepath_errorMessages_itemValidationError.message.split('\n').map((line) => '\t' + line).join('\n');
608
- return new TypeError(message);
609
- }
610
- }
611
- const obj_schema = obj.schema;
612
- const path_schema = path + '.schema';
613
- if (typeof obj_schema !== 'string') {
614
- return new TypeError('Expected "string" but received "' + typeof obj_schema + '" (at "' + path_schema + '")');
615
- }
616
- const obj_success = obj.success;
617
- const path_success = path + '.success';
618
- if (typeof obj_success !== 'boolean') {
619
- return new TypeError('Expected "boolean" but received "' + typeof obj_success + '" (at "' + path_success + '")');
620
- }
621
- })();
622
- return v_error === undefined ? null : v_error;
623
- }
624
- const RepresentationType$2 = 'OpenApiSpecInferenceOutputRepresentation';
625
- function normalize$2(input, existing, path, luvio, store, timestamp) {
626
- return input;
627
- }
628
- const select$a = function OpenApiSpecInferenceOutputRepresentationSelect() {
629
- const { selections: InferenceErrorMessageRepresentation__selections, opaque: InferenceErrorMessageRepresentation__opaque, } = select$d();
630
- return {
631
- kind: 'Fragment',
632
- version: VERSION$6,
633
- private: [],
634
- selections: [
635
- {
636
- name: 'errorMessages',
637
- kind: 'Object',
638
- plural: true,
639
- selections: InferenceErrorMessageRepresentation__selections
640
- },
641
- {
642
- name: 'schema',
643
- kind: 'Scalar'
644
- },
645
- {
646
- name: 'success',
647
- kind: 'Scalar'
648
- }
649
- ]
650
- };
651
- };
652
- function equals$6(existing, incoming) {
653
- const existing_success = existing.success;
654
- const incoming_success = incoming.success;
655
- if (!(existing_success === incoming_success)) {
656
- return false;
657
- }
658
- const existing_schema = existing.schema;
659
- const incoming_schema = incoming.schema;
660
- if (!(existing_schema === incoming_schema)) {
661
- return false;
662
- }
663
- const existing_errorMessages = existing.errorMessages;
664
- const incoming_errorMessages = incoming.errorMessages;
665
- const equals_errorMessages_items = equalsArray(existing_errorMessages, incoming_errorMessages, (existing_errorMessages_item, incoming_errorMessages_item) => {
666
- if (!(equals$8(existing_errorMessages_item, incoming_errorMessages_item))) {
667
- return false;
668
- }
669
- });
670
- if (equals_errorMessages_items === false) {
671
- return false;
672
- }
673
- return true;
674
- }
675
- const ingest$2 = function OpenApiSpecInferenceOutputRepresentationIngest(input, path, luvio, store, timestamp) {
676
- if (process.env.NODE_ENV !== 'production') {
677
- const validateError = validate$7(input);
678
- if (validateError !== null) {
679
- throw validateError;
680
- }
681
- }
682
- const key = path.fullPath;
683
- const existingRecord = store.readEntry(key);
684
- const ttlToUse = TTL;
685
- let incomingRecord = normalize$2(input, store.readEntry(key), {
686
- fullPath: key,
687
- parent: path.parent,
688
- propertyName: path.propertyName,
689
- ttl: ttlToUse
690
- });
691
- if (existingRecord === undefined || equals$6(existingRecord, incomingRecord) === false) {
692
- luvio.storePublish(key, incomingRecord);
693
- }
694
- {
695
- const storeMetadataParams = {
696
- ttl: ttlToUse,
697
- namespace: "external-services",
698
- version: VERSION$6,
699
- representationName: RepresentationType$2,
700
- };
701
- luvio.publishStoreMetadata(key, storeMetadataParams);
702
- }
703
- return createLink(key);
704
- };
705
- function getTypeCacheKeys$2(luvio, input, fullPathFactory) {
706
- const rootKeySet = new StoreKeyMap();
707
- // root cache key (uses fullPathFactory if keyBuilderFromType isn't defined)
708
- const rootKey = fullPathFactory();
709
- rootKeySet.set(rootKey, {
710
- namespace: keyPrefix,
711
- representationName: RepresentationType$2,
712
- mergeable: false
713
- });
714
- return rootKeySet;
589
+ const TTL = 500;
590
+ const VERSION$6 = "9f5779e32b8c9e02976609db89831dbb";
591
+ function validate$7(obj, path = 'OpenApiSpecInferenceOutputRepresentation') {
592
+ const v_error = (() => {
593
+ if (typeof obj !== 'object' || ArrayIsArray(obj) || obj === null) {
594
+ return new TypeError('Expected "object" but received "' + typeof obj + '" (at "' + path + '")');
595
+ }
596
+ const obj_errorMessages = obj.errorMessages;
597
+ const path_errorMessages = path + '.errorMessages';
598
+ if (!ArrayIsArray(obj_errorMessages)) {
599
+ return new TypeError('Expected "array" but received "' + typeof obj_errorMessages + '" (at "' + path_errorMessages + '")');
600
+ }
601
+ for (let i = 0; i < obj_errorMessages.length; i++) {
602
+ const obj_errorMessages_item = obj_errorMessages[i];
603
+ const path_errorMessages_item = path_errorMessages + '[' + i + ']';
604
+ const referencepath_errorMessages_itemValidationError = validate$b(obj_errorMessages_item, path_errorMessages_item);
605
+ if (referencepath_errorMessages_itemValidationError !== null) {
606
+ let message = 'Object doesn\'t match InferenceErrorMessageRepresentation (at "' + path_errorMessages_item + '")\n';
607
+ message += referencepath_errorMessages_itemValidationError.message.split('\n').map((line) => '\t' + line).join('\n');
608
+ return new TypeError(message);
609
+ }
610
+ }
611
+ const obj_schema = obj.schema;
612
+ const path_schema = path + '.schema';
613
+ if (typeof obj_schema !== 'string') {
614
+ return new TypeError('Expected "string" but received "' + typeof obj_schema + '" (at "' + path_schema + '")');
615
+ }
616
+ const obj_success = obj.success;
617
+ const path_success = path + '.success';
618
+ if (typeof obj_success !== 'boolean') {
619
+ return new TypeError('Expected "boolean" but received "' + typeof obj_success + '" (at "' + path_success + '")');
620
+ }
621
+ })();
622
+ return v_error === undefined ? null : v_error;
623
+ }
624
+ const RepresentationType$2 = 'OpenApiSpecInferenceOutputRepresentation';
625
+ function normalize$2(input, existing, path, luvio, store, timestamp) {
626
+ return input;
627
+ }
628
+ const select$a = function OpenApiSpecInferenceOutputRepresentationSelect() {
629
+ const { selections: InferenceErrorMessageRepresentation__selections, opaque: InferenceErrorMessageRepresentation__opaque, } = select$d();
630
+ return {
631
+ kind: 'Fragment',
632
+ version: VERSION$6,
633
+ private: [],
634
+ selections: [
635
+ {
636
+ name: 'errorMessages',
637
+ kind: 'Object',
638
+ plural: true,
639
+ selections: InferenceErrorMessageRepresentation__selections
640
+ },
641
+ {
642
+ name: 'schema',
643
+ kind: 'Scalar'
644
+ },
645
+ {
646
+ name: 'success',
647
+ kind: 'Scalar'
648
+ }
649
+ ]
650
+ };
651
+ };
652
+ function equals$6(existing, incoming) {
653
+ const existing_success = existing.success;
654
+ const incoming_success = incoming.success;
655
+ if (!(existing_success === incoming_success)) {
656
+ return false;
657
+ }
658
+ const existing_schema = existing.schema;
659
+ const incoming_schema = incoming.schema;
660
+ if (!(existing_schema === incoming_schema)) {
661
+ return false;
662
+ }
663
+ const existing_errorMessages = existing.errorMessages;
664
+ const incoming_errorMessages = incoming.errorMessages;
665
+ const equals_errorMessages_items = equalsArray(existing_errorMessages, incoming_errorMessages, (existing_errorMessages_item, incoming_errorMessages_item) => {
666
+ if (!(equals$8(existing_errorMessages_item, incoming_errorMessages_item))) {
667
+ return false;
668
+ }
669
+ });
670
+ if (equals_errorMessages_items === false) {
671
+ return false;
672
+ }
673
+ return true;
674
+ }
675
+ const ingest$2 = function OpenApiSpecInferenceOutputRepresentationIngest(input, path, luvio, store, timestamp) {
676
+ if (process.env.NODE_ENV !== 'production') {
677
+ const validateError = validate$7(input);
678
+ if (validateError !== null) {
679
+ throw validateError;
680
+ }
681
+ }
682
+ const key = path.fullPath;
683
+ const existingRecord = store.readEntry(key);
684
+ const ttlToUse = TTL;
685
+ let incomingRecord = normalize$2(input, store.readEntry(key), {
686
+ fullPath: key,
687
+ parent: path.parent,
688
+ propertyName: path.propertyName,
689
+ ttl: ttlToUse
690
+ });
691
+ if (existingRecord === undefined || equals$6(existingRecord, incomingRecord) === false) {
692
+ luvio.storePublish(key, incomingRecord);
693
+ }
694
+ {
695
+ const storeMetadataParams = {
696
+ ttl: ttlToUse,
697
+ namespace: "external-services",
698
+ version: VERSION$6,
699
+ representationName: RepresentationType$2,
700
+ };
701
+ luvio.publishStoreMetadata(key, storeMetadataParams);
702
+ }
703
+ return createLink(key);
704
+ };
705
+ function getTypeCacheKeys$2(luvio, input, fullPathFactory) {
706
+ const rootKeySet = new StoreKeyMap();
707
+ // root cache key (uses fullPathFactory if keyBuilderFromType isn't defined)
708
+ const rootKey = fullPathFactory();
709
+ rootKeySet.set(rootKey, {
710
+ namespace: keyPrefix,
711
+ representationName: RepresentationType$2,
712
+ mergeable: false
713
+ });
714
+ return rootKeySet;
715
715
  }
716
716
 
717
- function select$9(luvio, params) {
718
- return select$a();
719
- }
720
- function keyBuilder$6(luvio, params) {
721
- return keyPrefix + '::OpenApiSpecInferenceOutputRepresentation:(' + 'version:' + params.urlParams.version + ',' + 'input.description:' + params.body.input.description + '::' + (params.body.input.externalServiceId === undefined ? 'input.externalServiceId' : 'input.externalServiceId:' + params.body.input.externalServiceId) + '::' + 'input.method:' + params.body.input.method + '::' + 'input.name:' + params.body.input.name + '::' + 'input.operationDescription:' + params.body.input.operationDescription + '::' + 'input.operationName:' + params.body.input.operationName + '::' + 'input.parameters:' + params.body.input.parameters + '::' + 'input.path:' + params.body.input.path + '::' + +'::' + +')';
722
- }
723
- function getResponseCacheKeys$3(luvio, resourceParams, response) {
724
- return getTypeCacheKeys$2(luvio, response, () => keyBuilder$6(luvio, resourceParams));
725
- }
726
- function ingestSuccess$3(luvio, resourceParams, response, snapshotRefresh) {
727
- const { body } = response;
728
- const key = keyBuilder$6(luvio, resourceParams);
729
- luvio.storeIngest(key, ingest$2, body);
730
- const snapshot = luvio.storeLookup({
731
- recordId: key,
732
- node: select$9(),
733
- variables: {},
734
- }, snapshotRefresh);
735
- if (process.env.NODE_ENV !== 'production') {
736
- if (snapshot.state !== 'Fulfilled') {
737
- throw new Error('Invalid network response. Expected resource response to result in Fulfilled snapshot');
738
- }
739
- }
740
- return snapshot;
741
- }
742
- function ingestError$2(luvio, params, error, snapshotRefresh) {
743
- const key = keyBuilder$6(luvio, params);
744
- const errorSnapshot = luvio.errorSnapshot(error, snapshotRefresh);
745
- const storeMetadataParams = {
746
- ttl: TTL,
747
- namespace: keyPrefix,
748
- version: VERSION$6,
749
- representationName: RepresentationType$2
750
- };
751
- luvio.storeIngestError(key, errorSnapshot, storeMetadataParams);
752
- return errorSnapshot;
753
- }
754
- function createResourceRequest$3(config) {
755
- const headers = {};
756
- return {
757
- baseUri: '/services/data/v58.0',
758
- basePath: '/externalservices/inference/openapispec/' + config.urlParams.version + '',
759
- method: 'post',
760
- body: config.body,
761
- urlParams: config.urlParams,
762
- queryParams: {},
763
- headers,
764
- priority: 'normal',
765
- };
717
+ function select$9(luvio, params) {
718
+ return select$a();
719
+ }
720
+ function keyBuilder$6(luvio, params) {
721
+ return keyPrefix + '::OpenApiSpecInferenceOutputRepresentation:(' + 'version:' + params.urlParams.version + ',' + 'input.description:' + params.body.input.description + '::' + (params.body.input.externalServiceId === undefined ? 'input.externalServiceId' : 'input.externalServiceId:' + params.body.input.externalServiceId) + '::' + 'input.method:' + params.body.input.method + '::' + 'input.name:' + params.body.input.name + '::' + 'input.operationDescription:' + params.body.input.operationDescription + '::' + 'input.operationName:' + params.body.input.operationName + '::' + 'input.parameters:' + params.body.input.parameters + '::' + 'input.path:' + params.body.input.path + '::' + +'::' + +')';
722
+ }
723
+ function getResponseCacheKeys$3(luvio, resourceParams, response) {
724
+ return getTypeCacheKeys$2(luvio, response, () => keyBuilder$6(luvio, resourceParams));
725
+ }
726
+ function ingestSuccess$3(luvio, resourceParams, response, snapshotRefresh) {
727
+ const { body } = response;
728
+ const key = keyBuilder$6(luvio, resourceParams);
729
+ luvio.storeIngest(key, ingest$2, body);
730
+ const snapshot = luvio.storeLookup({
731
+ recordId: key,
732
+ node: select$9(),
733
+ variables: {},
734
+ }, snapshotRefresh);
735
+ if (process.env.NODE_ENV !== 'production') {
736
+ if (snapshot.state !== 'Fulfilled') {
737
+ throw new Error('Invalid network response. Expected resource response to result in Fulfilled snapshot');
738
+ }
739
+ }
740
+ return snapshot;
741
+ }
742
+ function ingestError$2(luvio, params, error, snapshotRefresh) {
743
+ const key = keyBuilder$6(luvio, params);
744
+ const errorSnapshot = luvio.errorSnapshot(error, snapshotRefresh);
745
+ const storeMetadataParams = {
746
+ ttl: TTL,
747
+ namespace: keyPrefix,
748
+ version: VERSION$6,
749
+ representationName: RepresentationType$2
750
+ };
751
+ luvio.storeIngestError(key, errorSnapshot, storeMetadataParams);
752
+ return errorSnapshot;
753
+ }
754
+ function createResourceRequest$3(config) {
755
+ const headers = {};
756
+ return {
757
+ baseUri: '/services/data/v58.0',
758
+ basePath: '/externalservices/inference/openapispec/' + config.urlParams.version + '',
759
+ method: 'post',
760
+ body: config.body,
761
+ urlParams: config.urlParams,
762
+ queryParams: {},
763
+ headers,
764
+ priority: 'normal',
765
+ };
766
766
  }
767
767
 
768
- const getOpenApiSpec_ConfigPropertyNames = {
769
- displayName: 'getOpenApiSpec',
770
- parameters: {
771
- required: ['version', 'input'],
772
- optional: []
773
- }
774
- };
775
- function createResourceParams$3(config) {
776
- const resourceParams = {
777
- urlParams: {
778
- version: config.version
779
- },
780
- body: {
781
- input: config.input
782
- }
783
- };
784
- return resourceParams;
785
- }
786
- function keyBuilder$5(luvio, config) {
787
- const resourceParams = createResourceParams$3(config);
788
- return keyBuilder$6(luvio, resourceParams);
789
- }
790
- function typeCheckConfig$3(untrustedConfig) {
791
- const config = {};
792
- const untrustedConfig_version = untrustedConfig.version;
793
- if (typeof untrustedConfig_version === 'string') {
794
- config.version = untrustedConfig_version;
795
- }
796
- const untrustedConfig_input = untrustedConfig.input;
797
- const referenceOpenApiSpecInferenceInputRepresentationValidationError = validate$8(untrustedConfig_input);
798
- if (referenceOpenApiSpecInferenceInputRepresentationValidationError === null) {
799
- config.input = untrustedConfig_input;
800
- }
801
- return config;
802
- }
803
- function validateAdapterConfig$3(untrustedConfig, configPropertyNames) {
804
- if (!untrustedIsObject(untrustedConfig)) {
805
- return null;
806
- }
807
- if (process.env.NODE_ENV !== 'production') {
808
- validateConfig(untrustedConfig, configPropertyNames);
809
- }
810
- const config = typeCheckConfig$3(untrustedConfig);
811
- if (!areRequiredParametersPresent(config, configPropertyNames)) {
812
- return null;
813
- }
814
- return config;
815
- }
816
- function adapterFragment$2(luvio, config) {
817
- createResourceParams$3(config);
818
- return select$9();
819
- }
820
- function onFetchResponseSuccess$2(luvio, config, resourceParams, response) {
821
- const snapshot = ingestSuccess$3(luvio, resourceParams, response, {
822
- config,
823
- resolve: () => buildNetworkSnapshot$3(luvio, config, snapshotRefreshOptions)
824
- });
825
- return luvio.storeBroadcast().then(() => snapshot);
826
- }
827
- function onFetchResponseError$2(luvio, config, resourceParams, response) {
828
- const snapshot = ingestError$2(luvio, resourceParams, response, {
829
- config,
830
- resolve: () => buildNetworkSnapshot$3(luvio, config, snapshotRefreshOptions)
831
- });
832
- return luvio.storeBroadcast().then(() => snapshot);
833
- }
834
- function buildNetworkSnapshot$3(luvio, config, options) {
835
- const resourceParams = createResourceParams$3(config);
836
- const request = createResourceRequest$3(resourceParams);
837
- return luvio.dispatchResourceRequest(request, options)
838
- .then((response) => {
839
- return luvio.handleSuccessResponse(() => onFetchResponseSuccess$2(luvio, config, resourceParams, response), () => getResponseCacheKeys$3(luvio, resourceParams, response.body));
840
- }, (response) => {
841
- return luvio.handleErrorResponse(() => onFetchResponseError$2(luvio, config, resourceParams, response));
842
- });
843
- }
844
- function buildNetworkSnapshotCachePolicy$2(context, coercedAdapterRequestContext) {
845
- const { luvio, config } = context;
846
- const { networkPriority, requestCorrelator, eventObservers } = coercedAdapterRequestContext;
847
- const dispatchOptions = {
848
- resourceRequestContext: {
849
- requestCorrelator,
850
- luvioRequestMethod: 'get',
851
- },
852
- eventObservers
853
- };
854
- if (networkPriority !== 'normal') {
855
- dispatchOptions.overrides = {
856
- priority: networkPriority
857
- };
858
- }
859
- return buildNetworkSnapshot$3(luvio, config, dispatchOptions);
860
- }
861
- function buildCachedSnapshotCachePolicy$2(context, storeLookup) {
862
- const { luvio, config } = context;
863
- const selector = {
864
- recordId: keyBuilder$5(luvio, config),
865
- node: adapterFragment$2(luvio, config),
866
- variables: {},
867
- };
868
- const cacheSnapshot = storeLookup(selector, {
869
- config,
870
- resolve: () => buildNetworkSnapshot$3(luvio, config, snapshotRefreshOptions)
871
- });
872
- return cacheSnapshot;
873
- }
874
- const getOpenApiSpecAdapterFactory = (luvio) => function externalServices__getOpenApiSpec(untrustedConfig, requestContext) {
875
- const config = validateAdapterConfig$3(untrustedConfig, getOpenApiSpec_ConfigPropertyNames);
876
- // Invalid or incomplete config
877
- if (config === null) {
878
- return null;
879
- }
880
- return luvio.applyCachePolicy((requestContext || {}), { config, luvio }, // BuildSnapshotContext
881
- buildCachedSnapshotCachePolicy$2, buildNetworkSnapshotCachePolicy$2);
768
+ const getOpenApiSpec_ConfigPropertyNames = {
769
+ displayName: 'getOpenApiSpec',
770
+ parameters: {
771
+ required: ['version', 'input'],
772
+ optional: []
773
+ }
774
+ };
775
+ function createResourceParams$3(config) {
776
+ const resourceParams = {
777
+ urlParams: {
778
+ version: config.version
779
+ },
780
+ body: {
781
+ input: config.input
782
+ }
783
+ };
784
+ return resourceParams;
785
+ }
786
+ function keyBuilder$5(luvio, config) {
787
+ const resourceParams = createResourceParams$3(config);
788
+ return keyBuilder$6(luvio, resourceParams);
789
+ }
790
+ function typeCheckConfig$3(untrustedConfig) {
791
+ const config = {};
792
+ const untrustedConfig_version = untrustedConfig.version;
793
+ if (typeof untrustedConfig_version === 'string') {
794
+ config.version = untrustedConfig_version;
795
+ }
796
+ const untrustedConfig_input = untrustedConfig.input;
797
+ const referenceOpenApiSpecInferenceInputRepresentationValidationError = validate$8(untrustedConfig_input);
798
+ if (referenceOpenApiSpecInferenceInputRepresentationValidationError === null) {
799
+ config.input = untrustedConfig_input;
800
+ }
801
+ return config;
802
+ }
803
+ function validateAdapterConfig$3(untrustedConfig, configPropertyNames) {
804
+ if (!untrustedIsObject(untrustedConfig)) {
805
+ return null;
806
+ }
807
+ if (process.env.NODE_ENV !== 'production') {
808
+ validateConfig(untrustedConfig, configPropertyNames);
809
+ }
810
+ const config = typeCheckConfig$3(untrustedConfig);
811
+ if (!areRequiredParametersPresent(config, configPropertyNames)) {
812
+ return null;
813
+ }
814
+ return config;
815
+ }
816
+ function adapterFragment$2(luvio, config) {
817
+ createResourceParams$3(config);
818
+ return select$9();
819
+ }
820
+ function onFetchResponseSuccess$2(luvio, config, resourceParams, response) {
821
+ const snapshot = ingestSuccess$3(luvio, resourceParams, response, {
822
+ config,
823
+ resolve: () => buildNetworkSnapshot$3(luvio, config, snapshotRefreshOptions)
824
+ });
825
+ return luvio.storeBroadcast().then(() => snapshot);
826
+ }
827
+ function onFetchResponseError$2(luvio, config, resourceParams, response) {
828
+ const snapshot = ingestError$2(luvio, resourceParams, response, {
829
+ config,
830
+ resolve: () => buildNetworkSnapshot$3(luvio, config, snapshotRefreshOptions)
831
+ });
832
+ return luvio.storeBroadcast().then(() => snapshot);
833
+ }
834
+ function buildNetworkSnapshot$3(luvio, config, options) {
835
+ const resourceParams = createResourceParams$3(config);
836
+ const request = createResourceRequest$3(resourceParams);
837
+ return luvio.dispatchResourceRequest(request, options)
838
+ .then((response) => {
839
+ return luvio.handleSuccessResponse(() => onFetchResponseSuccess$2(luvio, config, resourceParams, response), () => getResponseCacheKeys$3(luvio, resourceParams, response.body));
840
+ }, (response) => {
841
+ return luvio.handleErrorResponse(() => onFetchResponseError$2(luvio, config, resourceParams, response));
842
+ });
843
+ }
844
+ function buildNetworkSnapshotCachePolicy$2(context, coercedAdapterRequestContext) {
845
+ const { luvio, config } = context;
846
+ const { networkPriority, requestCorrelator, eventObservers } = coercedAdapterRequestContext;
847
+ const dispatchOptions = {
848
+ resourceRequestContext: {
849
+ requestCorrelator,
850
+ luvioRequestMethod: 'get',
851
+ },
852
+ eventObservers
853
+ };
854
+ if (networkPriority !== 'normal') {
855
+ dispatchOptions.overrides = {
856
+ priority: networkPriority
857
+ };
858
+ }
859
+ return buildNetworkSnapshot$3(luvio, config, dispatchOptions);
860
+ }
861
+ function buildCachedSnapshotCachePolicy$2(context, storeLookup) {
862
+ const { luvio, config } = context;
863
+ const selector = {
864
+ recordId: keyBuilder$5(luvio, config),
865
+ node: adapterFragment$2(luvio, config),
866
+ variables: {},
867
+ };
868
+ const cacheSnapshot = storeLookup(selector, {
869
+ config,
870
+ resolve: () => buildNetworkSnapshot$3(luvio, config, snapshotRefreshOptions)
871
+ });
872
+ return cacheSnapshot;
873
+ }
874
+ const getOpenApiSpecAdapterFactory = (luvio) => function externalServices__getOpenApiSpec(untrustedConfig, requestContext) {
875
+ const config = validateAdapterConfig$3(untrustedConfig, getOpenApiSpec_ConfigPropertyNames);
876
+ // Invalid or incomplete config
877
+ if (config === null) {
878
+ return null;
879
+ }
880
+ return luvio.applyCachePolicy((requestContext || {}), { config, luvio }, // BuildSnapshotContext
881
+ buildCachedSnapshotCachePolicy$2, buildNetworkSnapshotCachePolicy$2);
882
882
  };
883
883
 
884
- const VERSION$5 = "7dd4168caef7cc755bcbcb7dddf11b57";
885
- function validate$6(obj, path = 'ExternalServiceStatisticsBreakdownRepresentation') {
886
- const v_error = (() => {
887
- if (typeof obj !== 'object' || ArrayIsArray(obj) || obj === null) {
888
- return new TypeError('Expected "object" but received "' + typeof obj + '" (at "' + path + '")');
889
- }
890
- const obj_active = obj.active;
891
- const path_active = path + '.active';
892
- if (typeof obj_active !== 'boolean') {
893
- return new TypeError('Expected "boolean" but received "' + typeof obj_active + '" (at "' + path_active + '")');
894
- }
895
- const obj_activeCount = obj.activeCount;
896
- const path_activeCount = path + '.activeCount';
897
- if (typeof obj_activeCount !== 'number' || (typeof obj_activeCount === 'number' && Math.floor(obj_activeCount) !== obj_activeCount)) {
898
- return new TypeError('Expected "integer" but received "' + typeof obj_activeCount + '" (at "' + path_activeCount + '")');
899
- }
900
- const obj_component = obj.component;
901
- const path_component = path + '.component';
902
- if (typeof obj_component !== 'string') {
903
- return new TypeError('Expected "string" but received "' + typeof obj_component + '" (at "' + path_component + '")');
904
- }
905
- const obj_componentType = obj.componentType;
906
- const path_componentType = path + '.componentType';
907
- if (typeof obj_componentType !== 'string') {
908
- return new TypeError('Expected "string" but received "' + typeof obj_componentType + '" (at "' + path_componentType + '")');
909
- }
910
- const obj_statisticFor = obj.statisticFor;
911
- const path_statisticFor = path + '.statisticFor';
912
- if (typeof obj_statisticFor !== 'string') {
913
- return new TypeError('Expected "string" but received "' + typeof obj_statisticFor + '" (at "' + path_statisticFor + '")');
914
- }
915
- const obj_totalCount = obj.totalCount;
916
- const path_totalCount = path + '.totalCount';
917
- if (typeof obj_totalCount !== 'number' || (typeof obj_totalCount === 'number' && Math.floor(obj_totalCount) !== obj_totalCount)) {
918
- return new TypeError('Expected "integer" but received "' + typeof obj_totalCount + '" (at "' + path_totalCount + '")');
919
- }
920
- })();
921
- return v_error === undefined ? null : v_error;
922
- }
923
- const select$8 = function ExternalServiceStatisticsBreakdownRepresentationSelect() {
924
- return {
925
- kind: 'Fragment',
926
- version: VERSION$5,
927
- private: [],
928
- selections: [
929
- {
930
- name: 'active',
931
- kind: 'Scalar'
932
- },
933
- {
934
- name: 'activeCount',
935
- kind: 'Scalar'
936
- },
937
- {
938
- name: 'component',
939
- kind: 'Scalar'
940
- },
941
- {
942
- name: 'componentType',
943
- kind: 'Scalar'
944
- },
945
- {
946
- name: 'statisticFor',
947
- kind: 'Scalar'
948
- },
949
- {
950
- name: 'totalCount',
951
- kind: 'Scalar'
952
- }
953
- ]
954
- };
955
- };
956
- function equals$5(existing, incoming) {
957
- const existing_active = existing.active;
958
- const incoming_active = incoming.active;
959
- if (!(existing_active === incoming_active)) {
960
- return false;
961
- }
962
- const existing_activeCount = existing.activeCount;
963
- const incoming_activeCount = incoming.activeCount;
964
- if (!(existing_activeCount === incoming_activeCount)) {
965
- return false;
966
- }
967
- const existing_totalCount = existing.totalCount;
968
- const incoming_totalCount = incoming.totalCount;
969
- if (!(existing_totalCount === incoming_totalCount)) {
970
- return false;
971
- }
972
- const existing_component = existing.component;
973
- const incoming_component = incoming.component;
974
- if (!(existing_component === incoming_component)) {
975
- return false;
976
- }
977
- const existing_componentType = existing.componentType;
978
- const incoming_componentType = incoming.componentType;
979
- if (!(existing_componentType === incoming_componentType)) {
980
- return false;
981
- }
982
- const existing_statisticFor = existing.statisticFor;
983
- const incoming_statisticFor = incoming.statisticFor;
984
- if (!(existing_statisticFor === incoming_statisticFor)) {
985
- return false;
986
- }
987
- return true;
884
+ const VERSION$5 = "7dd4168caef7cc755bcbcb7dddf11b57";
885
+ function validate$6(obj, path = 'ExternalServiceStatisticsBreakdownRepresentation') {
886
+ const v_error = (() => {
887
+ if (typeof obj !== 'object' || ArrayIsArray(obj) || obj === null) {
888
+ return new TypeError('Expected "object" but received "' + typeof obj + '" (at "' + path + '")');
889
+ }
890
+ const obj_active = obj.active;
891
+ const path_active = path + '.active';
892
+ if (typeof obj_active !== 'boolean') {
893
+ return new TypeError('Expected "boolean" but received "' + typeof obj_active + '" (at "' + path_active + '")');
894
+ }
895
+ const obj_activeCount = obj.activeCount;
896
+ const path_activeCount = path + '.activeCount';
897
+ if (typeof obj_activeCount !== 'number' || (typeof obj_activeCount === 'number' && Math.floor(obj_activeCount) !== obj_activeCount)) {
898
+ return new TypeError('Expected "integer" but received "' + typeof obj_activeCount + '" (at "' + path_activeCount + '")');
899
+ }
900
+ const obj_component = obj.component;
901
+ const path_component = path + '.component';
902
+ if (typeof obj_component !== 'string') {
903
+ return new TypeError('Expected "string" but received "' + typeof obj_component + '" (at "' + path_component + '")');
904
+ }
905
+ const obj_componentType = obj.componentType;
906
+ const path_componentType = path + '.componentType';
907
+ if (typeof obj_componentType !== 'string') {
908
+ return new TypeError('Expected "string" but received "' + typeof obj_componentType + '" (at "' + path_componentType + '")');
909
+ }
910
+ const obj_statisticFor = obj.statisticFor;
911
+ const path_statisticFor = path + '.statisticFor';
912
+ if (typeof obj_statisticFor !== 'string') {
913
+ return new TypeError('Expected "string" but received "' + typeof obj_statisticFor + '" (at "' + path_statisticFor + '")');
914
+ }
915
+ const obj_totalCount = obj.totalCount;
916
+ const path_totalCount = path + '.totalCount';
917
+ if (typeof obj_totalCount !== 'number' || (typeof obj_totalCount === 'number' && Math.floor(obj_totalCount) !== obj_totalCount)) {
918
+ return new TypeError('Expected "integer" but received "' + typeof obj_totalCount + '" (at "' + path_totalCount + '")');
919
+ }
920
+ })();
921
+ return v_error === undefined ? null : v_error;
922
+ }
923
+ const select$8 = function ExternalServiceStatisticsBreakdownRepresentationSelect() {
924
+ return {
925
+ kind: 'Fragment',
926
+ version: VERSION$5,
927
+ private: [],
928
+ selections: [
929
+ {
930
+ name: 'active',
931
+ kind: 'Scalar'
932
+ },
933
+ {
934
+ name: 'activeCount',
935
+ kind: 'Scalar'
936
+ },
937
+ {
938
+ name: 'component',
939
+ kind: 'Scalar'
940
+ },
941
+ {
942
+ name: 'componentType',
943
+ kind: 'Scalar'
944
+ },
945
+ {
946
+ name: 'statisticFor',
947
+ kind: 'Scalar'
948
+ },
949
+ {
950
+ name: 'totalCount',
951
+ kind: 'Scalar'
952
+ }
953
+ ]
954
+ };
955
+ };
956
+ function equals$5(existing, incoming) {
957
+ const existing_active = existing.active;
958
+ const incoming_active = incoming.active;
959
+ if (!(existing_active === incoming_active)) {
960
+ return false;
961
+ }
962
+ const existing_activeCount = existing.activeCount;
963
+ const incoming_activeCount = incoming.activeCount;
964
+ if (!(existing_activeCount === incoming_activeCount)) {
965
+ return false;
966
+ }
967
+ const existing_totalCount = existing.totalCount;
968
+ const incoming_totalCount = incoming.totalCount;
969
+ if (!(existing_totalCount === incoming_totalCount)) {
970
+ return false;
971
+ }
972
+ const existing_component = existing.component;
973
+ const incoming_component = incoming.component;
974
+ if (!(existing_component === incoming_component)) {
975
+ return false;
976
+ }
977
+ const existing_componentType = existing.componentType;
978
+ const incoming_componentType = incoming.componentType;
979
+ if (!(existing_componentType === incoming_componentType)) {
980
+ return false;
981
+ }
982
+ const existing_statisticFor = existing.statisticFor;
983
+ const incoming_statisticFor = incoming.statisticFor;
984
+ if (!(existing_statisticFor === incoming_statisticFor)) {
985
+ return false;
986
+ }
987
+ return true;
988
988
  }
989
989
 
990
- const VERSION$4 = "6bd958289eba0fb66f626c73737f8c00";
991
- function validate$5(obj, path = 'ExternalServiceStatisticsForServiceRepresentation') {
992
- const v_error = (() => {
993
- if (typeof obj !== 'object' || ArrayIsArray(obj) || obj === null) {
994
- return new TypeError('Expected "object" but received "' + typeof obj + '" (at "' + path + '")');
995
- }
996
- const obj_schemaSize = obj.schemaSize;
997
- const path_schemaSize = path + '.schemaSize';
998
- if (typeof obj_schemaSize !== 'number' || (typeof obj_schemaSize === 'number' && Math.floor(obj_schemaSize) !== obj_schemaSize)) {
999
- return new TypeError('Expected "integer" but received "' + typeof obj_schemaSize + '" (at "' + path_schemaSize + '")');
1000
- }
1001
- const obj_schemaType = obj.schemaType;
1002
- const path_schemaType = path + '.schemaType';
1003
- if (typeof obj_schemaType !== 'string') {
1004
- return new TypeError('Expected "string" but received "' + typeof obj_schemaType + '" (at "' + path_schemaType + '")');
1005
- }
1006
- const obj_serviceName = obj.serviceName;
1007
- const path_serviceName = path + '.serviceName';
1008
- if (typeof obj_serviceName !== 'string') {
1009
- return new TypeError('Expected "string" but received "' + typeof obj_serviceName + '" (at "' + path_serviceName + '")');
1010
- }
1011
- const obj_statistics = obj.statistics;
1012
- const path_statistics = path + '.statistics';
1013
- if (!ArrayIsArray(obj_statistics)) {
1014
- return new TypeError('Expected "array" but received "' + typeof obj_statistics + '" (at "' + path_statistics + '")');
1015
- }
1016
- for (let i = 0; i < obj_statistics.length; i++) {
1017
- const obj_statistics_item = obj_statistics[i];
1018
- const path_statistics_item = path_statistics + '[' + i + ']';
1019
- const referencepath_statistics_itemValidationError = validate$6(obj_statistics_item, path_statistics_item);
1020
- if (referencepath_statistics_itemValidationError !== null) {
1021
- let message = 'Object doesn\'t match ExternalServiceStatisticsBreakdownRepresentation (at "' + path_statistics_item + '")\n';
1022
- message += referencepath_statistics_itemValidationError.message.split('\n').map((line) => '\t' + line).join('\n');
1023
- return new TypeError(message);
1024
- }
1025
- }
1026
- const obj_systemVersion = obj.systemVersion;
1027
- const path_systemVersion = path + '.systemVersion';
1028
- if (typeof obj_systemVersion !== 'number' || (typeof obj_systemVersion === 'number' && Math.floor(obj_systemVersion) !== obj_systemVersion)) {
1029
- return new TypeError('Expected "integer" but received "' + typeof obj_systemVersion + '" (at "' + path_systemVersion + '")');
1030
- }
1031
- })();
1032
- return v_error === undefined ? null : v_error;
1033
- }
1034
- const select$7 = function ExternalServiceStatisticsForServiceRepresentationSelect() {
1035
- const { selections: ExternalServiceStatisticsBreakdownRepresentation__selections, opaque: ExternalServiceStatisticsBreakdownRepresentation__opaque, } = select$8();
1036
- return {
1037
- kind: 'Fragment',
1038
- version: VERSION$4,
1039
- private: [],
1040
- selections: [
1041
- {
1042
- name: 'schemaSize',
1043
- kind: 'Scalar'
1044
- },
1045
- {
1046
- name: 'schemaType',
1047
- kind: 'Scalar'
1048
- },
1049
- {
1050
- name: 'serviceName',
1051
- kind: 'Scalar'
1052
- },
1053
- {
1054
- name: 'statistics',
1055
- kind: 'Object',
1056
- plural: true,
1057
- selections: ExternalServiceStatisticsBreakdownRepresentation__selections
1058
- },
1059
- {
1060
- name: 'systemVersion',
1061
- kind: 'Scalar'
1062
- }
1063
- ]
1064
- };
1065
- };
1066
- function equals$4(existing, incoming) {
1067
- const existing_schemaSize = existing.schemaSize;
1068
- const incoming_schemaSize = incoming.schemaSize;
1069
- if (!(existing_schemaSize === incoming_schemaSize)) {
1070
- return false;
1071
- }
1072
- const existing_systemVersion = existing.systemVersion;
1073
- const incoming_systemVersion = incoming.systemVersion;
1074
- if (!(existing_systemVersion === incoming_systemVersion)) {
1075
- return false;
1076
- }
1077
- const existing_schemaType = existing.schemaType;
1078
- const incoming_schemaType = incoming.schemaType;
1079
- if (!(existing_schemaType === incoming_schemaType)) {
1080
- return false;
1081
- }
1082
- const existing_serviceName = existing.serviceName;
1083
- const incoming_serviceName = incoming.serviceName;
1084
- if (!(existing_serviceName === incoming_serviceName)) {
1085
- return false;
1086
- }
1087
- const existing_statistics = existing.statistics;
1088
- const incoming_statistics = incoming.statistics;
1089
- const equals_statistics_items = equalsArray(existing_statistics, incoming_statistics, (existing_statistics_item, incoming_statistics_item) => {
1090
- if (!(equals$5(existing_statistics_item, incoming_statistics_item))) {
1091
- return false;
1092
- }
1093
- });
1094
- if (equals_statistics_items === false) {
1095
- return false;
1096
- }
1097
- return true;
990
+ const VERSION$4 = "6bd958289eba0fb66f626c73737f8c00";
991
+ function validate$5(obj, path = 'ExternalServiceStatisticsForServiceRepresentation') {
992
+ const v_error = (() => {
993
+ if (typeof obj !== 'object' || ArrayIsArray(obj) || obj === null) {
994
+ return new TypeError('Expected "object" but received "' + typeof obj + '" (at "' + path + '")');
995
+ }
996
+ const obj_schemaSize = obj.schemaSize;
997
+ const path_schemaSize = path + '.schemaSize';
998
+ if (typeof obj_schemaSize !== 'number' || (typeof obj_schemaSize === 'number' && Math.floor(obj_schemaSize) !== obj_schemaSize)) {
999
+ return new TypeError('Expected "integer" but received "' + typeof obj_schemaSize + '" (at "' + path_schemaSize + '")');
1000
+ }
1001
+ const obj_schemaType = obj.schemaType;
1002
+ const path_schemaType = path + '.schemaType';
1003
+ if (typeof obj_schemaType !== 'string') {
1004
+ return new TypeError('Expected "string" but received "' + typeof obj_schemaType + '" (at "' + path_schemaType + '")');
1005
+ }
1006
+ const obj_serviceName = obj.serviceName;
1007
+ const path_serviceName = path + '.serviceName';
1008
+ if (typeof obj_serviceName !== 'string') {
1009
+ return new TypeError('Expected "string" but received "' + typeof obj_serviceName + '" (at "' + path_serviceName + '")');
1010
+ }
1011
+ const obj_statistics = obj.statistics;
1012
+ const path_statistics = path + '.statistics';
1013
+ if (!ArrayIsArray(obj_statistics)) {
1014
+ return new TypeError('Expected "array" but received "' + typeof obj_statistics + '" (at "' + path_statistics + '")');
1015
+ }
1016
+ for (let i = 0; i < obj_statistics.length; i++) {
1017
+ const obj_statistics_item = obj_statistics[i];
1018
+ const path_statistics_item = path_statistics + '[' + i + ']';
1019
+ const referencepath_statistics_itemValidationError = validate$6(obj_statistics_item, path_statistics_item);
1020
+ if (referencepath_statistics_itemValidationError !== null) {
1021
+ let message = 'Object doesn\'t match ExternalServiceStatisticsBreakdownRepresentation (at "' + path_statistics_item + '")\n';
1022
+ message += referencepath_statistics_itemValidationError.message.split('\n').map((line) => '\t' + line).join('\n');
1023
+ return new TypeError(message);
1024
+ }
1025
+ }
1026
+ const obj_systemVersion = obj.systemVersion;
1027
+ const path_systemVersion = path + '.systemVersion';
1028
+ if (typeof obj_systemVersion !== 'number' || (typeof obj_systemVersion === 'number' && Math.floor(obj_systemVersion) !== obj_systemVersion)) {
1029
+ return new TypeError('Expected "integer" but received "' + typeof obj_systemVersion + '" (at "' + path_systemVersion + '")');
1030
+ }
1031
+ })();
1032
+ return v_error === undefined ? null : v_error;
1033
+ }
1034
+ const select$7 = function ExternalServiceStatisticsForServiceRepresentationSelect() {
1035
+ const { selections: ExternalServiceStatisticsBreakdownRepresentation__selections, opaque: ExternalServiceStatisticsBreakdownRepresentation__opaque, } = select$8();
1036
+ return {
1037
+ kind: 'Fragment',
1038
+ version: VERSION$4,
1039
+ private: [],
1040
+ selections: [
1041
+ {
1042
+ name: 'schemaSize',
1043
+ kind: 'Scalar'
1044
+ },
1045
+ {
1046
+ name: 'schemaType',
1047
+ kind: 'Scalar'
1048
+ },
1049
+ {
1050
+ name: 'serviceName',
1051
+ kind: 'Scalar'
1052
+ },
1053
+ {
1054
+ name: 'statistics',
1055
+ kind: 'Object',
1056
+ plural: true,
1057
+ selections: ExternalServiceStatisticsBreakdownRepresentation__selections
1058
+ },
1059
+ {
1060
+ name: 'systemVersion',
1061
+ kind: 'Scalar'
1062
+ }
1063
+ ]
1064
+ };
1065
+ };
1066
+ function equals$4(existing, incoming) {
1067
+ const existing_schemaSize = existing.schemaSize;
1068
+ const incoming_schemaSize = incoming.schemaSize;
1069
+ if (!(existing_schemaSize === incoming_schemaSize)) {
1070
+ return false;
1071
+ }
1072
+ const existing_systemVersion = existing.systemVersion;
1073
+ const incoming_systemVersion = incoming.systemVersion;
1074
+ if (!(existing_systemVersion === incoming_systemVersion)) {
1075
+ return false;
1076
+ }
1077
+ const existing_schemaType = existing.schemaType;
1078
+ const incoming_schemaType = incoming.schemaType;
1079
+ if (!(existing_schemaType === incoming_schemaType)) {
1080
+ return false;
1081
+ }
1082
+ const existing_serviceName = existing.serviceName;
1083
+ const incoming_serviceName = incoming.serviceName;
1084
+ if (!(existing_serviceName === incoming_serviceName)) {
1085
+ return false;
1086
+ }
1087
+ const existing_statistics = existing.statistics;
1088
+ const incoming_statistics = incoming.statistics;
1089
+ const equals_statistics_items = equalsArray(existing_statistics, incoming_statistics, (existing_statistics_item, incoming_statistics_item) => {
1090
+ if (!(equals$5(existing_statistics_item, incoming_statistics_item))) {
1091
+ return false;
1092
+ }
1093
+ });
1094
+ if (equals_statistics_items === false) {
1095
+ return false;
1096
+ }
1097
+ return true;
1098
1098
  }
1099
1099
 
1100
- const VERSION$3 = "3ff0c02babe6583f09a09544b2c045fd";
1101
- function validate$4(obj, path = 'ExternalServiceStatisticsOverviewRepresentation') {
1102
- const v_error = (() => {
1103
- if (typeof obj !== 'object' || ArrayIsArray(obj) || obj === null) {
1104
- return new TypeError('Expected "object" but received "' + typeof obj + '" (at "' + path + '")');
1105
- }
1106
- const obj_activeCount = obj.activeCount;
1107
- const path_activeCount = path + '.activeCount';
1108
- if (typeof obj_activeCount !== 'number' || (typeof obj_activeCount === 'number' && Math.floor(obj_activeCount) !== obj_activeCount)) {
1109
- return new TypeError('Expected "integer" but received "' + typeof obj_activeCount + '" (at "' + path_activeCount + '")');
1110
- }
1111
- const obj_statisticFor = obj.statisticFor;
1112
- const path_statisticFor = path + '.statisticFor';
1113
- if (typeof obj_statisticFor !== 'string') {
1114
- return new TypeError('Expected "string" but received "' + typeof obj_statisticFor + '" (at "' + path_statisticFor + '")');
1115
- }
1116
- const obj_totalCount = obj.totalCount;
1117
- const path_totalCount = path + '.totalCount';
1118
- if (typeof obj_totalCount !== 'number' || (typeof obj_totalCount === 'number' && Math.floor(obj_totalCount) !== obj_totalCount)) {
1119
- return new TypeError('Expected "integer" but received "' + typeof obj_totalCount + '" (at "' + path_totalCount + '")');
1120
- }
1121
- })();
1122
- return v_error === undefined ? null : v_error;
1123
- }
1124
- const select$6 = function ExternalServiceStatisticsOverviewRepresentationSelect() {
1125
- return {
1126
- kind: 'Fragment',
1127
- version: VERSION$3,
1128
- private: [],
1129
- selections: [
1130
- {
1131
- name: 'activeCount',
1132
- kind: 'Scalar'
1133
- },
1134
- {
1135
- name: 'statisticFor',
1136
- kind: 'Scalar'
1137
- },
1138
- {
1139
- name: 'totalCount',
1140
- kind: 'Scalar'
1141
- }
1142
- ]
1143
- };
1144
- };
1145
- function equals$3(existing, incoming) {
1146
- const existing_activeCount = existing.activeCount;
1147
- const incoming_activeCount = incoming.activeCount;
1148
- if (!(existing_activeCount === incoming_activeCount)) {
1149
- return false;
1150
- }
1151
- const existing_totalCount = existing.totalCount;
1152
- const incoming_totalCount = incoming.totalCount;
1153
- if (!(existing_totalCount === incoming_totalCount)) {
1154
- return false;
1155
- }
1156
- const existing_statisticFor = existing.statisticFor;
1157
- const incoming_statisticFor = incoming.statisticFor;
1158
- if (!(existing_statisticFor === incoming_statisticFor)) {
1159
- return false;
1160
- }
1161
- return true;
1100
+ const VERSION$3 = "3ff0c02babe6583f09a09544b2c045fd";
1101
+ function validate$4(obj, path = 'ExternalServiceStatisticsOverviewRepresentation') {
1102
+ const v_error = (() => {
1103
+ if (typeof obj !== 'object' || ArrayIsArray(obj) || obj === null) {
1104
+ return new TypeError('Expected "object" but received "' + typeof obj + '" (at "' + path + '")');
1105
+ }
1106
+ const obj_activeCount = obj.activeCount;
1107
+ const path_activeCount = path + '.activeCount';
1108
+ if (typeof obj_activeCount !== 'number' || (typeof obj_activeCount === 'number' && Math.floor(obj_activeCount) !== obj_activeCount)) {
1109
+ return new TypeError('Expected "integer" but received "' + typeof obj_activeCount + '" (at "' + path_activeCount + '")');
1110
+ }
1111
+ const obj_statisticFor = obj.statisticFor;
1112
+ const path_statisticFor = path + '.statisticFor';
1113
+ if (typeof obj_statisticFor !== 'string') {
1114
+ return new TypeError('Expected "string" but received "' + typeof obj_statisticFor + '" (at "' + path_statisticFor + '")');
1115
+ }
1116
+ const obj_totalCount = obj.totalCount;
1117
+ const path_totalCount = path + '.totalCount';
1118
+ if (typeof obj_totalCount !== 'number' || (typeof obj_totalCount === 'number' && Math.floor(obj_totalCount) !== obj_totalCount)) {
1119
+ return new TypeError('Expected "integer" but received "' + typeof obj_totalCount + '" (at "' + path_totalCount + '")');
1120
+ }
1121
+ })();
1122
+ return v_error === undefined ? null : v_error;
1123
+ }
1124
+ const select$6 = function ExternalServiceStatisticsOverviewRepresentationSelect() {
1125
+ return {
1126
+ kind: 'Fragment',
1127
+ version: VERSION$3,
1128
+ private: [],
1129
+ selections: [
1130
+ {
1131
+ name: 'activeCount',
1132
+ kind: 'Scalar'
1133
+ },
1134
+ {
1135
+ name: 'statisticFor',
1136
+ kind: 'Scalar'
1137
+ },
1138
+ {
1139
+ name: 'totalCount',
1140
+ kind: 'Scalar'
1141
+ }
1142
+ ]
1143
+ };
1144
+ };
1145
+ function equals$3(existing, incoming) {
1146
+ const existing_activeCount = existing.activeCount;
1147
+ const incoming_activeCount = incoming.activeCount;
1148
+ if (!(existing_activeCount === incoming_activeCount)) {
1149
+ return false;
1150
+ }
1151
+ const existing_totalCount = existing.totalCount;
1152
+ const incoming_totalCount = incoming.totalCount;
1153
+ if (!(existing_totalCount === incoming_totalCount)) {
1154
+ return false;
1155
+ }
1156
+ const existing_statisticFor = existing.statisticFor;
1157
+ const incoming_statisticFor = incoming.statisticFor;
1158
+ if (!(existing_statisticFor === incoming_statisticFor)) {
1159
+ return false;
1160
+ }
1161
+ return true;
1162
1162
  }
1163
1163
 
1164
- const VERSION$2 = "4246bda5c0cab4f897003ca8900ef381";
1165
- function validate$3(obj, path = 'ExternalServiceStatisticsOutputRepresentation') {
1166
- const v_error = (() => {
1167
- if (typeof obj !== 'object' || ArrayIsArray(obj) || obj === null) {
1168
- return new TypeError('Expected "object" but received "' + typeof obj + '" (at "' + path + '")');
1169
- }
1170
- const obj_serviceCount = obj.serviceCount;
1171
- const path_serviceCount = path + '.serviceCount';
1172
- if (typeof obj_serviceCount !== 'number' || (typeof obj_serviceCount === 'number' && Math.floor(obj_serviceCount) !== obj_serviceCount)) {
1173
- return new TypeError('Expected "integer" but received "' + typeof obj_serviceCount + '" (at "' + path_serviceCount + '")');
1174
- }
1175
- const obj_services = obj.services;
1176
- const path_services = path + '.services';
1177
- if (!ArrayIsArray(obj_services)) {
1178
- return new TypeError('Expected "array" but received "' + typeof obj_services + '" (at "' + path_services + '")');
1179
- }
1180
- for (let i = 0; i < obj_services.length; i++) {
1181
- const obj_services_item = obj_services[i];
1182
- const path_services_item = path_services + '[' + i + ']';
1183
- const referencepath_services_itemValidationError = validate$5(obj_services_item, path_services_item);
1184
- if (referencepath_services_itemValidationError !== null) {
1185
- let message = 'Object doesn\'t match ExternalServiceStatisticsForServiceRepresentation (at "' + path_services_item + '")\n';
1186
- message += referencepath_services_itemValidationError.message.split('\n').map((line) => '\t' + line).join('\n');
1187
- return new TypeError(message);
1188
- }
1189
- }
1190
- const obj_statistics = obj.statistics;
1191
- const path_statistics = path + '.statistics';
1192
- if (!ArrayIsArray(obj_statistics)) {
1193
- return new TypeError('Expected "array" but received "' + typeof obj_statistics + '" (at "' + path_statistics + '")');
1194
- }
1195
- for (let i = 0; i < obj_statistics.length; i++) {
1196
- const obj_statistics_item = obj_statistics[i];
1197
- const path_statistics_item = path_statistics + '[' + i + ']';
1198
- const referencepath_statistics_itemValidationError = validate$4(obj_statistics_item, path_statistics_item);
1199
- if (referencepath_statistics_itemValidationError !== null) {
1200
- let message = 'Object doesn\'t match ExternalServiceStatisticsOverviewRepresentation (at "' + path_statistics_item + '")\n';
1201
- message += referencepath_statistics_itemValidationError.message.split('\n').map((line) => '\t' + line).join('\n');
1202
- return new TypeError(message);
1203
- }
1204
- }
1205
- })();
1206
- return v_error === undefined ? null : v_error;
1207
- }
1208
- const RepresentationType$1 = 'ExternalServiceStatisticsOutputRepresentation';
1209
- function normalize$1(input, existing, path, luvio, store, timestamp) {
1210
- return input;
1211
- }
1212
- const select$5 = function ExternalServiceStatisticsOutputRepresentationSelect() {
1213
- const { selections: ExternalServiceStatisticsForServiceRepresentation__selections, opaque: ExternalServiceStatisticsForServiceRepresentation__opaque, } = select$7();
1214
- const { selections: ExternalServiceStatisticsOverviewRepresentation__selections, opaque: ExternalServiceStatisticsOverviewRepresentation__opaque, } = select$6();
1215
- return {
1216
- kind: 'Fragment',
1217
- version: VERSION$2,
1218
- private: [],
1219
- selections: [
1220
- {
1221
- name: 'serviceCount',
1222
- kind: 'Scalar'
1223
- },
1224
- {
1225
- name: 'services',
1226
- kind: 'Object',
1227
- plural: true,
1228
- selections: ExternalServiceStatisticsForServiceRepresentation__selections
1229
- },
1230
- {
1231
- name: 'statistics',
1232
- kind: 'Object',
1233
- plural: true,
1234
- selections: ExternalServiceStatisticsOverviewRepresentation__selections
1235
- }
1236
- ]
1237
- };
1238
- };
1239
- function equals$2(existing, incoming) {
1240
- const existing_serviceCount = existing.serviceCount;
1241
- const incoming_serviceCount = incoming.serviceCount;
1242
- if (!(existing_serviceCount === incoming_serviceCount)) {
1243
- return false;
1244
- }
1245
- const existing_services = existing.services;
1246
- const incoming_services = incoming.services;
1247
- const equals_services_items = equalsArray(existing_services, incoming_services, (existing_services_item, incoming_services_item) => {
1248
- if (!(equals$4(existing_services_item, incoming_services_item))) {
1249
- return false;
1250
- }
1251
- });
1252
- if (equals_services_items === false) {
1253
- return false;
1254
- }
1255
- const existing_statistics = existing.statistics;
1256
- const incoming_statistics = incoming.statistics;
1257
- const equals_statistics_items = equalsArray(existing_statistics, incoming_statistics, (existing_statistics_item, incoming_statistics_item) => {
1258
- if (!(equals$3(existing_statistics_item, incoming_statistics_item))) {
1259
- return false;
1260
- }
1261
- });
1262
- if (equals_statistics_items === false) {
1263
- return false;
1264
- }
1265
- return true;
1266
- }
1267
- const ingest$1 = function ExternalServiceStatisticsOutputRepresentationIngest(input, path, luvio, store, timestamp) {
1268
- if (process.env.NODE_ENV !== 'production') {
1269
- const validateError = validate$3(input);
1270
- if (validateError !== null) {
1271
- throw validateError;
1272
- }
1273
- }
1274
- const key = path.fullPath;
1275
- const existingRecord = store.readEntry(key);
1276
- const ttlToUse = path.ttl !== undefined ? path.ttl : 300000;
1277
- let incomingRecord = normalize$1(input, store.readEntry(key), {
1278
- fullPath: key,
1279
- parent: path.parent,
1280
- propertyName: path.propertyName,
1281
- ttl: ttlToUse
1282
- });
1283
- if (existingRecord === undefined || equals$2(existingRecord, incomingRecord) === false) {
1284
- luvio.storePublish(key, incomingRecord);
1285
- }
1286
- if (ttlToUse !== undefined) {
1287
- const storeMetadataParams = {
1288
- ttl: ttlToUse,
1289
- namespace: "external-services",
1290
- version: VERSION$2,
1291
- representationName: RepresentationType$1,
1292
- };
1293
- luvio.publishStoreMetadata(key, storeMetadataParams);
1294
- }
1295
- return createLink(key);
1296
- };
1297
- function getTypeCacheKeys$1(luvio, input, fullPathFactory) {
1298
- const rootKeySet = new StoreKeyMap();
1299
- // root cache key (uses fullPathFactory if keyBuilderFromType isn't defined)
1300
- const rootKey = fullPathFactory();
1301
- rootKeySet.set(rootKey, {
1302
- namespace: keyPrefix,
1303
- representationName: RepresentationType$1,
1304
- mergeable: false
1305
- });
1306
- return rootKeySet;
1164
+ const VERSION$2 = "4246bda5c0cab4f897003ca8900ef381";
1165
+ function validate$3(obj, path = 'ExternalServiceStatisticsOutputRepresentation') {
1166
+ const v_error = (() => {
1167
+ if (typeof obj !== 'object' || ArrayIsArray(obj) || obj === null) {
1168
+ return new TypeError('Expected "object" but received "' + typeof obj + '" (at "' + path + '")');
1169
+ }
1170
+ const obj_serviceCount = obj.serviceCount;
1171
+ const path_serviceCount = path + '.serviceCount';
1172
+ if (typeof obj_serviceCount !== 'number' || (typeof obj_serviceCount === 'number' && Math.floor(obj_serviceCount) !== obj_serviceCount)) {
1173
+ return new TypeError('Expected "integer" but received "' + typeof obj_serviceCount + '" (at "' + path_serviceCount + '")');
1174
+ }
1175
+ const obj_services = obj.services;
1176
+ const path_services = path + '.services';
1177
+ if (!ArrayIsArray(obj_services)) {
1178
+ return new TypeError('Expected "array" but received "' + typeof obj_services + '" (at "' + path_services + '")');
1179
+ }
1180
+ for (let i = 0; i < obj_services.length; i++) {
1181
+ const obj_services_item = obj_services[i];
1182
+ const path_services_item = path_services + '[' + i + ']';
1183
+ const referencepath_services_itemValidationError = validate$5(obj_services_item, path_services_item);
1184
+ if (referencepath_services_itemValidationError !== null) {
1185
+ let message = 'Object doesn\'t match ExternalServiceStatisticsForServiceRepresentation (at "' + path_services_item + '")\n';
1186
+ message += referencepath_services_itemValidationError.message.split('\n').map((line) => '\t' + line).join('\n');
1187
+ return new TypeError(message);
1188
+ }
1189
+ }
1190
+ const obj_statistics = obj.statistics;
1191
+ const path_statistics = path + '.statistics';
1192
+ if (!ArrayIsArray(obj_statistics)) {
1193
+ return new TypeError('Expected "array" but received "' + typeof obj_statistics + '" (at "' + path_statistics + '")');
1194
+ }
1195
+ for (let i = 0; i < obj_statistics.length; i++) {
1196
+ const obj_statistics_item = obj_statistics[i];
1197
+ const path_statistics_item = path_statistics + '[' + i + ']';
1198
+ const referencepath_statistics_itemValidationError = validate$4(obj_statistics_item, path_statistics_item);
1199
+ if (referencepath_statistics_itemValidationError !== null) {
1200
+ let message = 'Object doesn\'t match ExternalServiceStatisticsOverviewRepresentation (at "' + path_statistics_item + '")\n';
1201
+ message += referencepath_statistics_itemValidationError.message.split('\n').map((line) => '\t' + line).join('\n');
1202
+ return new TypeError(message);
1203
+ }
1204
+ }
1205
+ })();
1206
+ return v_error === undefined ? null : v_error;
1207
+ }
1208
+ const RepresentationType$1 = 'ExternalServiceStatisticsOutputRepresentation';
1209
+ function normalize$1(input, existing, path, luvio, store, timestamp) {
1210
+ return input;
1211
+ }
1212
+ const select$5 = function ExternalServiceStatisticsOutputRepresentationSelect() {
1213
+ const { selections: ExternalServiceStatisticsForServiceRepresentation__selections, opaque: ExternalServiceStatisticsForServiceRepresentation__opaque, } = select$7();
1214
+ const { selections: ExternalServiceStatisticsOverviewRepresentation__selections, opaque: ExternalServiceStatisticsOverviewRepresentation__opaque, } = select$6();
1215
+ return {
1216
+ kind: 'Fragment',
1217
+ version: VERSION$2,
1218
+ private: [],
1219
+ selections: [
1220
+ {
1221
+ name: 'serviceCount',
1222
+ kind: 'Scalar'
1223
+ },
1224
+ {
1225
+ name: 'services',
1226
+ kind: 'Object',
1227
+ plural: true,
1228
+ selections: ExternalServiceStatisticsForServiceRepresentation__selections
1229
+ },
1230
+ {
1231
+ name: 'statistics',
1232
+ kind: 'Object',
1233
+ plural: true,
1234
+ selections: ExternalServiceStatisticsOverviewRepresentation__selections
1235
+ }
1236
+ ]
1237
+ };
1238
+ };
1239
+ function equals$2(existing, incoming) {
1240
+ const existing_serviceCount = existing.serviceCount;
1241
+ const incoming_serviceCount = incoming.serviceCount;
1242
+ if (!(existing_serviceCount === incoming_serviceCount)) {
1243
+ return false;
1244
+ }
1245
+ const existing_services = existing.services;
1246
+ const incoming_services = incoming.services;
1247
+ const equals_services_items = equalsArray(existing_services, incoming_services, (existing_services_item, incoming_services_item) => {
1248
+ if (!(equals$4(existing_services_item, incoming_services_item))) {
1249
+ return false;
1250
+ }
1251
+ });
1252
+ if (equals_services_items === false) {
1253
+ return false;
1254
+ }
1255
+ const existing_statistics = existing.statistics;
1256
+ const incoming_statistics = incoming.statistics;
1257
+ const equals_statistics_items = equalsArray(existing_statistics, incoming_statistics, (existing_statistics_item, incoming_statistics_item) => {
1258
+ if (!(equals$3(existing_statistics_item, incoming_statistics_item))) {
1259
+ return false;
1260
+ }
1261
+ });
1262
+ if (equals_statistics_items === false) {
1263
+ return false;
1264
+ }
1265
+ return true;
1266
+ }
1267
+ const ingest$1 = function ExternalServiceStatisticsOutputRepresentationIngest(input, path, luvio, store, timestamp) {
1268
+ if (process.env.NODE_ENV !== 'production') {
1269
+ const validateError = validate$3(input);
1270
+ if (validateError !== null) {
1271
+ throw validateError;
1272
+ }
1273
+ }
1274
+ const key = path.fullPath;
1275
+ const existingRecord = store.readEntry(key);
1276
+ const ttlToUse = path.ttl !== undefined ? path.ttl : 300000;
1277
+ let incomingRecord = normalize$1(input, store.readEntry(key), {
1278
+ fullPath: key,
1279
+ parent: path.parent,
1280
+ propertyName: path.propertyName,
1281
+ ttl: ttlToUse
1282
+ });
1283
+ if (existingRecord === undefined || equals$2(existingRecord, incomingRecord) === false) {
1284
+ luvio.storePublish(key, incomingRecord);
1285
+ }
1286
+ if (ttlToUse !== undefined) {
1287
+ const storeMetadataParams = {
1288
+ ttl: ttlToUse,
1289
+ namespace: "external-services",
1290
+ version: VERSION$2,
1291
+ representationName: RepresentationType$1,
1292
+ };
1293
+ luvio.publishStoreMetadata(key, storeMetadataParams);
1294
+ }
1295
+ return createLink(key);
1296
+ };
1297
+ function getTypeCacheKeys$1(luvio, input, fullPathFactory) {
1298
+ const rootKeySet = new StoreKeyMap();
1299
+ // root cache key (uses fullPathFactory if keyBuilderFromType isn't defined)
1300
+ const rootKey = fullPathFactory();
1301
+ rootKeySet.set(rootKey, {
1302
+ namespace: keyPrefix,
1303
+ representationName: RepresentationType$1,
1304
+ mergeable: false
1305
+ });
1306
+ return rootKeySet;
1307
1307
  }
1308
1308
 
1309
- function select$4(luvio, params) {
1310
- return select$5();
1311
- }
1312
- function keyBuilder$4(luvio, params) {
1313
- return keyPrefix + '::ExternalServiceStatisticsOutputRepresentation:(' + ')';
1314
- }
1315
- function getResponseCacheKeys$2(luvio, resourceParams, response) {
1316
- return getTypeCacheKeys$1(luvio, response, () => keyBuilder$4());
1317
- }
1318
- function ingestSuccess$2(luvio, resourceParams, response, snapshotRefresh) {
1319
- const { body } = response;
1320
- const key = keyBuilder$4();
1321
- luvio.storeIngest(key, ingest$1, body);
1322
- const snapshot = luvio.storeLookup({
1323
- recordId: key,
1324
- node: select$4(),
1325
- variables: {},
1326
- }, snapshotRefresh);
1327
- if (process.env.NODE_ENV !== 'production') {
1328
- if (snapshot.state !== 'Fulfilled') {
1329
- throw new Error('Invalid network response. Expected resource response to result in Fulfilled snapshot');
1330
- }
1331
- }
1332
- return snapshot;
1333
- }
1334
- function ingestError$1(luvio, params, error, snapshotRefresh) {
1335
- const key = keyBuilder$4();
1336
- const errorSnapshot = luvio.errorSnapshot(error, snapshotRefresh);
1337
- luvio.storeIngestError(key, errorSnapshot);
1338
- return errorSnapshot;
1339
- }
1340
- function createResourceRequest$2(config) {
1341
- const headers = {};
1342
- return {
1343
- baseUri: '/services/data/v58.0',
1344
- basePath: '/externalservices/statistics/services',
1345
- method: 'get',
1346
- body: null,
1347
- urlParams: {},
1348
- queryParams: {},
1349
- headers,
1350
- priority: 'normal',
1351
- };
1309
+ function select$4(luvio, params) {
1310
+ return select$5();
1311
+ }
1312
+ function keyBuilder$4(luvio, params) {
1313
+ return keyPrefix + '::ExternalServiceStatisticsOutputRepresentation:(' + ')';
1314
+ }
1315
+ function getResponseCacheKeys$2(luvio, resourceParams, response) {
1316
+ return getTypeCacheKeys$1(luvio, response, () => keyBuilder$4());
1317
+ }
1318
+ function ingestSuccess$2(luvio, resourceParams, response, snapshotRefresh) {
1319
+ const { body } = response;
1320
+ const key = keyBuilder$4();
1321
+ luvio.storeIngest(key, ingest$1, body);
1322
+ const snapshot = luvio.storeLookup({
1323
+ recordId: key,
1324
+ node: select$4(),
1325
+ variables: {},
1326
+ }, snapshotRefresh);
1327
+ if (process.env.NODE_ENV !== 'production') {
1328
+ if (snapshot.state !== 'Fulfilled') {
1329
+ throw new Error('Invalid network response. Expected resource response to result in Fulfilled snapshot');
1330
+ }
1331
+ }
1332
+ return snapshot;
1333
+ }
1334
+ function ingestError$1(luvio, params, error, snapshotRefresh) {
1335
+ const key = keyBuilder$4();
1336
+ const errorSnapshot = luvio.errorSnapshot(error, snapshotRefresh);
1337
+ luvio.storeIngestError(key, errorSnapshot);
1338
+ return errorSnapshot;
1339
+ }
1340
+ function createResourceRequest$2(config) {
1341
+ const headers = {};
1342
+ return {
1343
+ baseUri: '/services/data/v58.0',
1344
+ basePath: '/externalservices/statistics/services',
1345
+ method: 'get',
1346
+ body: null,
1347
+ urlParams: {},
1348
+ queryParams: {},
1349
+ headers,
1350
+ priority: 'normal',
1351
+ };
1352
1352
  }
1353
1353
 
1354
- const getStatistics_ConfigPropertyNames = {
1355
- displayName: 'getStatistics',
1356
- parameters: {
1357
- required: [],
1358
- optional: []
1359
- }
1360
- };
1361
- function createResourceParams$2(config) {
1362
- const resourceParams = {};
1363
- return resourceParams;
1364
- }
1365
- function keyBuilder$3(luvio, config) {
1366
- return keyBuilder$4();
1367
- }
1368
- function typeCheckConfig$2(untrustedConfig) {
1369
- const config = {};
1370
- return config;
1371
- }
1372
- function validateAdapterConfig$2(untrustedConfig, configPropertyNames) {
1373
- if (!untrustedIsObject(untrustedConfig)) {
1374
- return null;
1375
- }
1376
- if (process.env.NODE_ENV !== 'production') {
1377
- validateConfig(untrustedConfig, configPropertyNames);
1378
- }
1379
- const config = typeCheckConfig$2();
1380
- if (!areRequiredParametersPresent(config, configPropertyNames)) {
1381
- return null;
1382
- }
1383
- return config;
1384
- }
1385
- function adapterFragment$1(luvio, config) {
1386
- return select$4();
1387
- }
1388
- function onFetchResponseSuccess$1(luvio, config, resourceParams, response) {
1389
- const snapshot = ingestSuccess$2(luvio, resourceParams, response, {
1390
- config,
1391
- resolve: () => buildNetworkSnapshot$2(luvio, config, snapshotRefreshOptions)
1392
- });
1393
- return luvio.storeBroadcast().then(() => snapshot);
1394
- }
1395
- function onFetchResponseError$1(luvio, config, resourceParams, response) {
1396
- const snapshot = ingestError$1(luvio, resourceParams, response, {
1397
- config,
1398
- resolve: () => buildNetworkSnapshot$2(luvio, config, snapshotRefreshOptions)
1399
- });
1400
- return luvio.storeBroadcast().then(() => snapshot);
1401
- }
1402
- function buildNetworkSnapshot$2(luvio, config, options) {
1403
- const resourceParams = createResourceParams$2();
1404
- const request = createResourceRequest$2();
1405
- return luvio.dispatchResourceRequest(request, options)
1406
- .then((response) => {
1407
- return luvio.handleSuccessResponse(() => onFetchResponseSuccess$1(luvio, config, resourceParams, response), () => getResponseCacheKeys$2(luvio, resourceParams, response.body));
1408
- }, (response) => {
1409
- return luvio.handleErrorResponse(() => onFetchResponseError$1(luvio, config, resourceParams, response));
1410
- });
1411
- }
1412
- function buildNetworkSnapshotCachePolicy$1(context, coercedAdapterRequestContext) {
1413
- const { luvio, config } = context;
1414
- const { networkPriority, requestCorrelator, eventObservers } = coercedAdapterRequestContext;
1415
- const dispatchOptions = {
1416
- resourceRequestContext: {
1417
- requestCorrelator,
1418
- luvioRequestMethod: undefined,
1419
- },
1420
- eventObservers
1421
- };
1422
- if (networkPriority !== 'normal') {
1423
- dispatchOptions.overrides = {
1424
- priority: networkPriority
1425
- };
1426
- }
1427
- return buildNetworkSnapshot$2(luvio, config, dispatchOptions);
1428
- }
1429
- function buildCachedSnapshotCachePolicy$1(context, storeLookup) {
1430
- const { luvio, config } = context;
1431
- const selector = {
1432
- recordId: keyBuilder$3(),
1433
- node: adapterFragment$1(),
1434
- variables: {},
1435
- };
1436
- const cacheSnapshot = storeLookup(selector, {
1437
- config,
1438
- resolve: () => buildNetworkSnapshot$2(luvio, config, snapshotRefreshOptions)
1439
- });
1440
- return cacheSnapshot;
1441
- }
1442
- const getStatisticsAdapterFactory = (luvio) => function externalServices__getStatistics(untrustedConfig, requestContext) {
1443
- const config = validateAdapterConfig$2(untrustedConfig, getStatistics_ConfigPropertyNames);
1444
- // Invalid or incomplete config
1445
- if (config === null) {
1446
- return null;
1447
- }
1448
- return luvio.applyCachePolicy((requestContext || {}), { config, luvio }, // BuildSnapshotContext
1449
- buildCachedSnapshotCachePolicy$1, buildNetworkSnapshotCachePolicy$1);
1354
+ const getStatistics_ConfigPropertyNames = {
1355
+ displayName: 'getStatistics',
1356
+ parameters: {
1357
+ required: [],
1358
+ optional: []
1359
+ }
1360
+ };
1361
+ function createResourceParams$2(config) {
1362
+ const resourceParams = {};
1363
+ return resourceParams;
1364
+ }
1365
+ function keyBuilder$3(luvio, config) {
1366
+ return keyBuilder$4();
1367
+ }
1368
+ function typeCheckConfig$2(untrustedConfig) {
1369
+ const config = {};
1370
+ return config;
1371
+ }
1372
+ function validateAdapterConfig$2(untrustedConfig, configPropertyNames) {
1373
+ if (!untrustedIsObject(untrustedConfig)) {
1374
+ return null;
1375
+ }
1376
+ if (process.env.NODE_ENV !== 'production') {
1377
+ validateConfig(untrustedConfig, configPropertyNames);
1378
+ }
1379
+ const config = typeCheckConfig$2();
1380
+ if (!areRequiredParametersPresent(config, configPropertyNames)) {
1381
+ return null;
1382
+ }
1383
+ return config;
1384
+ }
1385
+ function adapterFragment$1(luvio, config) {
1386
+ return select$4();
1387
+ }
1388
+ function onFetchResponseSuccess$1(luvio, config, resourceParams, response) {
1389
+ const snapshot = ingestSuccess$2(luvio, resourceParams, response, {
1390
+ config,
1391
+ resolve: () => buildNetworkSnapshot$2(luvio, config, snapshotRefreshOptions)
1392
+ });
1393
+ return luvio.storeBroadcast().then(() => snapshot);
1394
+ }
1395
+ function onFetchResponseError$1(luvio, config, resourceParams, response) {
1396
+ const snapshot = ingestError$1(luvio, resourceParams, response, {
1397
+ config,
1398
+ resolve: () => buildNetworkSnapshot$2(luvio, config, snapshotRefreshOptions)
1399
+ });
1400
+ return luvio.storeBroadcast().then(() => snapshot);
1401
+ }
1402
+ function buildNetworkSnapshot$2(luvio, config, options) {
1403
+ const resourceParams = createResourceParams$2();
1404
+ const request = createResourceRequest$2();
1405
+ return luvio.dispatchResourceRequest(request, options)
1406
+ .then((response) => {
1407
+ return luvio.handleSuccessResponse(() => onFetchResponseSuccess$1(luvio, config, resourceParams, response), () => getResponseCacheKeys$2(luvio, resourceParams, response.body));
1408
+ }, (response) => {
1409
+ return luvio.handleErrorResponse(() => onFetchResponseError$1(luvio, config, resourceParams, response));
1410
+ });
1411
+ }
1412
+ function buildNetworkSnapshotCachePolicy$1(context, coercedAdapterRequestContext) {
1413
+ const { luvio, config } = context;
1414
+ const { networkPriority, requestCorrelator, eventObservers } = coercedAdapterRequestContext;
1415
+ const dispatchOptions = {
1416
+ resourceRequestContext: {
1417
+ requestCorrelator,
1418
+ luvioRequestMethod: undefined,
1419
+ },
1420
+ eventObservers
1421
+ };
1422
+ if (networkPriority !== 'normal') {
1423
+ dispatchOptions.overrides = {
1424
+ priority: networkPriority
1425
+ };
1426
+ }
1427
+ return buildNetworkSnapshot$2(luvio, config, dispatchOptions);
1428
+ }
1429
+ function buildCachedSnapshotCachePolicy$1(context, storeLookup) {
1430
+ const { luvio, config } = context;
1431
+ const selector = {
1432
+ recordId: keyBuilder$3(),
1433
+ node: adapterFragment$1(),
1434
+ variables: {},
1435
+ };
1436
+ const cacheSnapshot = storeLookup(selector, {
1437
+ config,
1438
+ resolve: () => buildNetworkSnapshot$2(luvio, config, snapshotRefreshOptions)
1439
+ });
1440
+ return cacheSnapshot;
1441
+ }
1442
+ const getStatisticsAdapterFactory = (luvio) => function externalServices__getStatistics(untrustedConfig, requestContext) {
1443
+ const config = validateAdapterConfig$2(untrustedConfig, getStatistics_ConfigPropertyNames);
1444
+ // Invalid or incomplete config
1445
+ if (config === null) {
1446
+ return null;
1447
+ }
1448
+ return luvio.applyCachePolicy((requestContext || {}), { config, luvio }, // BuildSnapshotContext
1449
+ buildCachedSnapshotCachePolicy$1, buildNetworkSnapshotCachePolicy$1);
1450
1450
  };
1451
1451
 
1452
- function select$3(luvio, params) {
1453
- return select$5();
1454
- }
1455
- function keyBuilder$2(luvio, params) {
1456
- return keyPrefix + '::ExternalServiceStatisticsOutputRepresentation:(' + 'registrationName:' + params.urlParams.registrationName + ')';
1457
- }
1458
- function getResponseCacheKeys$1(luvio, resourceParams, response) {
1459
- return getTypeCacheKeys$1(luvio, response, () => keyBuilder$2(luvio, resourceParams));
1460
- }
1461
- function ingestSuccess$1(luvio, resourceParams, response, snapshotRefresh) {
1462
- const { body } = response;
1463
- const key = keyBuilder$2(luvio, resourceParams);
1464
- luvio.storeIngest(key, ingest$1, body);
1465
- const snapshot = luvio.storeLookup({
1466
- recordId: key,
1467
- node: select$3(),
1468
- variables: {},
1469
- }, snapshotRefresh);
1470
- if (process.env.NODE_ENV !== 'production') {
1471
- if (snapshot.state !== 'Fulfilled') {
1472
- throw new Error('Invalid network response. Expected resource response to result in Fulfilled snapshot');
1473
- }
1474
- }
1475
- return snapshot;
1476
- }
1477
- function ingestError(luvio, params, error, snapshotRefresh) {
1478
- const key = keyBuilder$2(luvio, params);
1479
- const errorSnapshot = luvio.errorSnapshot(error, snapshotRefresh);
1480
- luvio.storeIngestError(key, errorSnapshot);
1481
- return errorSnapshot;
1482
- }
1483
- function createResourceRequest$1(config) {
1484
- const headers = {};
1485
- return {
1486
- baseUri: '/services/data/v58.0',
1487
- basePath: '/externalservices/statistics/services/' + config.urlParams.registrationName + '',
1488
- method: 'get',
1489
- body: null,
1490
- urlParams: config.urlParams,
1491
- queryParams: {},
1492
- headers,
1493
- priority: 'normal',
1494
- };
1452
+ function select$3(luvio, params) {
1453
+ return select$5();
1454
+ }
1455
+ function keyBuilder$2(luvio, params) {
1456
+ return keyPrefix + '::ExternalServiceStatisticsOutputRepresentation:(' + 'registrationName:' + params.urlParams.registrationName + ')';
1457
+ }
1458
+ function getResponseCacheKeys$1(luvio, resourceParams, response) {
1459
+ return getTypeCacheKeys$1(luvio, response, () => keyBuilder$2(luvio, resourceParams));
1460
+ }
1461
+ function ingestSuccess$1(luvio, resourceParams, response, snapshotRefresh) {
1462
+ const { body } = response;
1463
+ const key = keyBuilder$2(luvio, resourceParams);
1464
+ luvio.storeIngest(key, ingest$1, body);
1465
+ const snapshot = luvio.storeLookup({
1466
+ recordId: key,
1467
+ node: select$3(),
1468
+ variables: {},
1469
+ }, snapshotRefresh);
1470
+ if (process.env.NODE_ENV !== 'production') {
1471
+ if (snapshot.state !== 'Fulfilled') {
1472
+ throw new Error('Invalid network response. Expected resource response to result in Fulfilled snapshot');
1473
+ }
1474
+ }
1475
+ return snapshot;
1476
+ }
1477
+ function ingestError(luvio, params, error, snapshotRefresh) {
1478
+ const key = keyBuilder$2(luvio, params);
1479
+ const errorSnapshot = luvio.errorSnapshot(error, snapshotRefresh);
1480
+ luvio.storeIngestError(key, errorSnapshot);
1481
+ return errorSnapshot;
1482
+ }
1483
+ function createResourceRequest$1(config) {
1484
+ const headers = {};
1485
+ return {
1486
+ baseUri: '/services/data/v58.0',
1487
+ basePath: '/externalservices/statistics/services/' + config.urlParams.registrationName + '',
1488
+ method: 'get',
1489
+ body: null,
1490
+ urlParams: config.urlParams,
1491
+ queryParams: {},
1492
+ headers,
1493
+ priority: 'normal',
1494
+ };
1495
1495
  }
1496
1496
 
1497
- const getStatisticsForService_ConfigPropertyNames = {
1498
- displayName: 'getStatisticsForService',
1499
- parameters: {
1500
- required: ['registrationName'],
1501
- optional: []
1502
- }
1503
- };
1504
- function createResourceParams$1(config) {
1505
- const resourceParams = {
1506
- urlParams: {
1507
- registrationName: config.registrationName
1508
- }
1509
- };
1510
- return resourceParams;
1511
- }
1512
- function keyBuilder$1(luvio, config) {
1513
- const resourceParams = createResourceParams$1(config);
1514
- return keyBuilder$2(luvio, resourceParams);
1515
- }
1516
- function typeCheckConfig$1(untrustedConfig) {
1517
- const config = {};
1518
- const untrustedConfig_registrationName = untrustedConfig.registrationName;
1519
- if (typeof untrustedConfig_registrationName === 'string') {
1520
- config.registrationName = untrustedConfig_registrationName;
1521
- }
1522
- return config;
1523
- }
1524
- function validateAdapterConfig$1(untrustedConfig, configPropertyNames) {
1525
- if (!untrustedIsObject(untrustedConfig)) {
1526
- return null;
1527
- }
1528
- if (process.env.NODE_ENV !== 'production') {
1529
- validateConfig(untrustedConfig, configPropertyNames);
1530
- }
1531
- const config = typeCheckConfig$1(untrustedConfig);
1532
- if (!areRequiredParametersPresent(config, configPropertyNames)) {
1533
- return null;
1534
- }
1535
- return config;
1536
- }
1537
- function adapterFragment(luvio, config) {
1538
- createResourceParams$1(config);
1539
- return select$3();
1540
- }
1541
- function onFetchResponseSuccess(luvio, config, resourceParams, response) {
1542
- const snapshot = ingestSuccess$1(luvio, resourceParams, response, {
1543
- config,
1544
- resolve: () => buildNetworkSnapshot$1(luvio, config, snapshotRefreshOptions)
1545
- });
1546
- return luvio.storeBroadcast().then(() => snapshot);
1547
- }
1548
- function onFetchResponseError(luvio, config, resourceParams, response) {
1549
- const snapshot = ingestError(luvio, resourceParams, response, {
1550
- config,
1551
- resolve: () => buildNetworkSnapshot$1(luvio, config, snapshotRefreshOptions)
1552
- });
1553
- return luvio.storeBroadcast().then(() => snapshot);
1554
- }
1555
- function buildNetworkSnapshot$1(luvio, config, options) {
1556
- const resourceParams = createResourceParams$1(config);
1557
- const request = createResourceRequest$1(resourceParams);
1558
- return luvio.dispatchResourceRequest(request, options)
1559
- .then((response) => {
1560
- return luvio.handleSuccessResponse(() => onFetchResponseSuccess(luvio, config, resourceParams, response), () => getResponseCacheKeys$1(luvio, resourceParams, response.body));
1561
- }, (response) => {
1562
- return luvio.handleErrorResponse(() => onFetchResponseError(luvio, config, resourceParams, response));
1563
- });
1564
- }
1565
- function buildNetworkSnapshotCachePolicy(context, coercedAdapterRequestContext) {
1566
- const { luvio, config } = context;
1567
- const { networkPriority, requestCorrelator, eventObservers } = coercedAdapterRequestContext;
1568
- const dispatchOptions = {
1569
- resourceRequestContext: {
1570
- requestCorrelator,
1571
- luvioRequestMethod: undefined,
1572
- },
1573
- eventObservers
1574
- };
1575
- if (networkPriority !== 'normal') {
1576
- dispatchOptions.overrides = {
1577
- priority: networkPriority
1578
- };
1579
- }
1580
- return buildNetworkSnapshot$1(luvio, config, dispatchOptions);
1581
- }
1582
- function buildCachedSnapshotCachePolicy(context, storeLookup) {
1583
- const { luvio, config } = context;
1584
- const selector = {
1585
- recordId: keyBuilder$1(luvio, config),
1586
- node: adapterFragment(luvio, config),
1587
- variables: {},
1588
- };
1589
- const cacheSnapshot = storeLookup(selector, {
1590
- config,
1591
- resolve: () => buildNetworkSnapshot$1(luvio, config, snapshotRefreshOptions)
1592
- });
1593
- return cacheSnapshot;
1594
- }
1595
- const getStatisticsForServiceAdapterFactory = (luvio) => function externalServices__getStatisticsForService(untrustedConfig, requestContext) {
1596
- const config = validateAdapterConfig$1(untrustedConfig, getStatisticsForService_ConfigPropertyNames);
1597
- // Invalid or incomplete config
1598
- if (config === null) {
1599
- return null;
1600
- }
1601
- return luvio.applyCachePolicy((requestContext || {}), { config, luvio }, // BuildSnapshotContext
1602
- buildCachedSnapshotCachePolicy, buildNetworkSnapshotCachePolicy);
1497
+ const getStatisticsForService_ConfigPropertyNames = {
1498
+ displayName: 'getStatisticsForService',
1499
+ parameters: {
1500
+ required: ['registrationName'],
1501
+ optional: []
1502
+ }
1503
+ };
1504
+ function createResourceParams$1(config) {
1505
+ const resourceParams = {
1506
+ urlParams: {
1507
+ registrationName: config.registrationName
1508
+ }
1509
+ };
1510
+ return resourceParams;
1511
+ }
1512
+ function keyBuilder$1(luvio, config) {
1513
+ const resourceParams = createResourceParams$1(config);
1514
+ return keyBuilder$2(luvio, resourceParams);
1515
+ }
1516
+ function typeCheckConfig$1(untrustedConfig) {
1517
+ const config = {};
1518
+ const untrustedConfig_registrationName = untrustedConfig.registrationName;
1519
+ if (typeof untrustedConfig_registrationName === 'string') {
1520
+ config.registrationName = untrustedConfig_registrationName;
1521
+ }
1522
+ return config;
1523
+ }
1524
+ function validateAdapterConfig$1(untrustedConfig, configPropertyNames) {
1525
+ if (!untrustedIsObject(untrustedConfig)) {
1526
+ return null;
1527
+ }
1528
+ if (process.env.NODE_ENV !== 'production') {
1529
+ validateConfig(untrustedConfig, configPropertyNames);
1530
+ }
1531
+ const config = typeCheckConfig$1(untrustedConfig);
1532
+ if (!areRequiredParametersPresent(config, configPropertyNames)) {
1533
+ return null;
1534
+ }
1535
+ return config;
1536
+ }
1537
+ function adapterFragment(luvio, config) {
1538
+ createResourceParams$1(config);
1539
+ return select$3();
1540
+ }
1541
+ function onFetchResponseSuccess(luvio, config, resourceParams, response) {
1542
+ const snapshot = ingestSuccess$1(luvio, resourceParams, response, {
1543
+ config,
1544
+ resolve: () => buildNetworkSnapshot$1(luvio, config, snapshotRefreshOptions)
1545
+ });
1546
+ return luvio.storeBroadcast().then(() => snapshot);
1547
+ }
1548
+ function onFetchResponseError(luvio, config, resourceParams, response) {
1549
+ const snapshot = ingestError(luvio, resourceParams, response, {
1550
+ config,
1551
+ resolve: () => buildNetworkSnapshot$1(luvio, config, snapshotRefreshOptions)
1552
+ });
1553
+ return luvio.storeBroadcast().then(() => snapshot);
1554
+ }
1555
+ function buildNetworkSnapshot$1(luvio, config, options) {
1556
+ const resourceParams = createResourceParams$1(config);
1557
+ const request = createResourceRequest$1(resourceParams);
1558
+ return luvio.dispatchResourceRequest(request, options)
1559
+ .then((response) => {
1560
+ return luvio.handleSuccessResponse(() => onFetchResponseSuccess(luvio, config, resourceParams, response), () => getResponseCacheKeys$1(luvio, resourceParams, response.body));
1561
+ }, (response) => {
1562
+ return luvio.handleErrorResponse(() => onFetchResponseError(luvio, config, resourceParams, response));
1563
+ });
1564
+ }
1565
+ function buildNetworkSnapshotCachePolicy(context, coercedAdapterRequestContext) {
1566
+ const { luvio, config } = context;
1567
+ const { networkPriority, requestCorrelator, eventObservers } = coercedAdapterRequestContext;
1568
+ const dispatchOptions = {
1569
+ resourceRequestContext: {
1570
+ requestCorrelator,
1571
+ luvioRequestMethod: undefined,
1572
+ },
1573
+ eventObservers
1574
+ };
1575
+ if (networkPriority !== 'normal') {
1576
+ dispatchOptions.overrides = {
1577
+ priority: networkPriority
1578
+ };
1579
+ }
1580
+ return buildNetworkSnapshot$1(luvio, config, dispatchOptions);
1581
+ }
1582
+ function buildCachedSnapshotCachePolicy(context, storeLookup) {
1583
+ const { luvio, config } = context;
1584
+ const selector = {
1585
+ recordId: keyBuilder$1(luvio, config),
1586
+ node: adapterFragment(luvio, config),
1587
+ variables: {},
1588
+ };
1589
+ const cacheSnapshot = storeLookup(selector, {
1590
+ config,
1591
+ resolve: () => buildNetworkSnapshot$1(luvio, config, snapshotRefreshOptions)
1592
+ });
1593
+ return cacheSnapshot;
1594
+ }
1595
+ const getStatisticsForServiceAdapterFactory = (luvio) => function externalServices__getStatisticsForService(untrustedConfig, requestContext) {
1596
+ const config = validateAdapterConfig$1(untrustedConfig, getStatisticsForService_ConfigPropertyNames);
1597
+ // Invalid or incomplete config
1598
+ if (config === null) {
1599
+ return null;
1600
+ }
1601
+ return luvio.applyCachePolicy((requestContext || {}), { config, luvio }, // BuildSnapshotContext
1602
+ buildCachedSnapshotCachePolicy, buildNetworkSnapshotCachePolicy);
1603
1603
  };
1604
1604
 
1605
- function validate$2(obj, path = 'SchemaValidationInputRepresentation') {
1606
- const v_error = (() => {
1607
- if (typeof obj !== 'object' || ArrayIsArray(obj) || obj === null) {
1608
- return new TypeError('Expected "object" but received "' + typeof obj + '" (at "' + path + '")');
1609
- }
1610
- const obj_schema = obj.schema;
1611
- const path_schema = path + '.schema';
1612
- if (typeof obj_schema !== 'string') {
1613
- return new TypeError('Expected "string" but received "' + typeof obj_schema + '" (at "' + path_schema + '")');
1614
- }
1615
- const obj_schemaName = obj.schemaName;
1616
- const path_schemaName = path + '.schemaName';
1617
- if (typeof obj_schemaName !== 'string') {
1618
- return new TypeError('Expected "string" but received "' + typeof obj_schemaName + '" (at "' + path_schemaName + '")');
1619
- }
1620
- const obj_systemVersion = obj.systemVersion;
1621
- const path_systemVersion = path + '.systemVersion';
1622
- if (typeof obj_systemVersion !== 'number' || (typeof obj_systemVersion === 'number' && Math.floor(obj_systemVersion) !== obj_systemVersion)) {
1623
- return new TypeError('Expected "integer" but received "' + typeof obj_systemVersion + '" (at "' + path_systemVersion + '")');
1624
- }
1625
- })();
1626
- return v_error === undefined ? null : v_error;
1605
+ function validate$2(obj, path = 'SchemaValidationInputRepresentation') {
1606
+ const v_error = (() => {
1607
+ if (typeof obj !== 'object' || ArrayIsArray(obj) || obj === null) {
1608
+ return new TypeError('Expected "object" but received "' + typeof obj + '" (at "' + path + '")');
1609
+ }
1610
+ const obj_schema = obj.schema;
1611
+ const path_schema = path + '.schema';
1612
+ if (typeof obj_schema !== 'string') {
1613
+ return new TypeError('Expected "string" but received "' + typeof obj_schema + '" (at "' + path_schema + '")');
1614
+ }
1615
+ const obj_schemaName = obj.schemaName;
1616
+ const path_schemaName = path + '.schemaName';
1617
+ if (typeof obj_schemaName !== 'string') {
1618
+ return new TypeError('Expected "string" but received "' + typeof obj_schemaName + '" (at "' + path_schemaName + '")');
1619
+ }
1620
+ const obj_systemVersion = obj.systemVersion;
1621
+ const path_systemVersion = path + '.systemVersion';
1622
+ if (typeof obj_systemVersion !== 'number' || (typeof obj_systemVersion === 'number' && Math.floor(obj_systemVersion) !== obj_systemVersion)) {
1623
+ return new TypeError('Expected "integer" but received "' + typeof obj_systemVersion + '" (at "' + path_systemVersion + '")');
1624
+ }
1625
+ })();
1626
+ return v_error === undefined ? null : v_error;
1627
1627
  }
1628
1628
 
1629
- const VERSION$1 = "970029a80f127a32c6e30cda09b02a11";
1630
- function validate$1(obj, path = 'SchemaValidationMessageRepresentation') {
1631
- const v_error = (() => {
1632
- if (typeof obj !== 'object' || ArrayIsArray(obj) || obj === null) {
1633
- return new TypeError('Expected "object" but received "' + typeof obj + '" (at "' + path + '")');
1634
- }
1635
- if (obj.endColumn !== undefined) {
1636
- const obj_endColumn = obj.endColumn;
1637
- const path_endColumn = path + '.endColumn';
1638
- let obj_endColumn_union0 = null;
1639
- const obj_endColumn_union0_error = (() => {
1640
- if (typeof obj_endColumn !== 'number' || (typeof obj_endColumn === 'number' && Math.floor(obj_endColumn) !== obj_endColumn)) {
1641
- return new TypeError('Expected "integer" but received "' + typeof obj_endColumn + '" (at "' + path_endColumn + '")');
1642
- }
1643
- })();
1644
- if (obj_endColumn_union0_error != null) {
1645
- obj_endColumn_union0 = obj_endColumn_union0_error.message;
1646
- }
1647
- let obj_endColumn_union1 = null;
1648
- const obj_endColumn_union1_error = (() => {
1649
- if (obj_endColumn !== null) {
1650
- return new TypeError('Expected "null" but received "' + typeof obj_endColumn + '" (at "' + path_endColumn + '")');
1651
- }
1652
- })();
1653
- if (obj_endColumn_union1_error != null) {
1654
- obj_endColumn_union1 = obj_endColumn_union1_error.message;
1655
- }
1656
- if (obj_endColumn_union0 && obj_endColumn_union1) {
1657
- let message = 'Object doesn\'t match union (at "' + path_endColumn + '")';
1658
- message += '\n' + obj_endColumn_union0.split('\n').map((line) => '\t' + line).join('\n');
1659
- message += '\n' + obj_endColumn_union1.split('\n').map((line) => '\t' + line).join('\n');
1660
- return new TypeError(message);
1661
- }
1662
- }
1663
- if (obj.endLine !== undefined) {
1664
- const obj_endLine = obj.endLine;
1665
- const path_endLine = path + '.endLine';
1666
- let obj_endLine_union0 = null;
1667
- const obj_endLine_union0_error = (() => {
1668
- if (typeof obj_endLine !== 'number' || (typeof obj_endLine === 'number' && Math.floor(obj_endLine) !== obj_endLine)) {
1669
- return new TypeError('Expected "integer" but received "' + typeof obj_endLine + '" (at "' + path_endLine + '")');
1670
- }
1671
- })();
1672
- if (obj_endLine_union0_error != null) {
1673
- obj_endLine_union0 = obj_endLine_union0_error.message;
1674
- }
1675
- let obj_endLine_union1 = null;
1676
- const obj_endLine_union1_error = (() => {
1677
- if (obj_endLine !== null) {
1678
- return new TypeError('Expected "null" but received "' + typeof obj_endLine + '" (at "' + path_endLine + '")');
1679
- }
1680
- })();
1681
- if (obj_endLine_union1_error != null) {
1682
- obj_endLine_union1 = obj_endLine_union1_error.message;
1683
- }
1684
- if (obj_endLine_union0 && obj_endLine_union1) {
1685
- let message = 'Object doesn\'t match union (at "' + path_endLine + '")';
1686
- message += '\n' + obj_endLine_union0.split('\n').map((line) => '\t' + line).join('\n');
1687
- message += '\n' + obj_endLine_union1.split('\n').map((line) => '\t' + line).join('\n');
1688
- return new TypeError(message);
1689
- }
1690
- }
1691
- if (obj.endPosition !== undefined) {
1692
- const obj_endPosition = obj.endPosition;
1693
- const path_endPosition = path + '.endPosition';
1694
- let obj_endPosition_union0 = null;
1695
- const obj_endPosition_union0_error = (() => {
1696
- if (typeof obj_endPosition !== 'number' || (typeof obj_endPosition === 'number' && Math.floor(obj_endPosition) !== obj_endPosition)) {
1697
- return new TypeError('Expected "integer" but received "' + typeof obj_endPosition + '" (at "' + path_endPosition + '")');
1698
- }
1699
- })();
1700
- if (obj_endPosition_union0_error != null) {
1701
- obj_endPosition_union0 = obj_endPosition_union0_error.message;
1702
- }
1703
- let obj_endPosition_union1 = null;
1704
- const obj_endPosition_union1_error = (() => {
1705
- if (obj_endPosition !== null) {
1706
- return new TypeError('Expected "null" but received "' + typeof obj_endPosition + '" (at "' + path_endPosition + '")');
1707
- }
1708
- })();
1709
- if (obj_endPosition_union1_error != null) {
1710
- obj_endPosition_union1 = obj_endPosition_union1_error.message;
1711
- }
1712
- if (obj_endPosition_union0 && obj_endPosition_union1) {
1713
- let message = 'Object doesn\'t match union (at "' + path_endPosition + '")';
1714
- message += '\n' + obj_endPosition_union0.split('\n').map((line) => '\t' + line).join('\n');
1715
- message += '\n' + obj_endPosition_union1.split('\n').map((line) => '\t' + line).join('\n');
1716
- return new TypeError(message);
1717
- }
1718
- }
1719
- const obj_message = obj.message;
1720
- const path_message = path + '.message';
1721
- if (typeof obj_message !== 'string') {
1722
- return new TypeError('Expected "string" but received "' + typeof obj_message + '" (at "' + path_message + '")');
1723
- }
1724
- if (obj.startColumn !== undefined) {
1725
- const obj_startColumn = obj.startColumn;
1726
- const path_startColumn = path + '.startColumn';
1727
- let obj_startColumn_union0 = null;
1728
- const obj_startColumn_union0_error = (() => {
1729
- if (typeof obj_startColumn !== 'number' || (typeof obj_startColumn === 'number' && Math.floor(obj_startColumn) !== obj_startColumn)) {
1730
- return new TypeError('Expected "integer" but received "' + typeof obj_startColumn + '" (at "' + path_startColumn + '")');
1731
- }
1732
- })();
1733
- if (obj_startColumn_union0_error != null) {
1734
- obj_startColumn_union0 = obj_startColumn_union0_error.message;
1735
- }
1736
- let obj_startColumn_union1 = null;
1737
- const obj_startColumn_union1_error = (() => {
1738
- if (obj_startColumn !== null) {
1739
- return new TypeError('Expected "null" but received "' + typeof obj_startColumn + '" (at "' + path_startColumn + '")');
1740
- }
1741
- })();
1742
- if (obj_startColumn_union1_error != null) {
1743
- obj_startColumn_union1 = obj_startColumn_union1_error.message;
1744
- }
1745
- if (obj_startColumn_union0 && obj_startColumn_union1) {
1746
- let message = 'Object doesn\'t match union (at "' + path_startColumn + '")';
1747
- message += '\n' + obj_startColumn_union0.split('\n').map((line) => '\t' + line).join('\n');
1748
- message += '\n' + obj_startColumn_union1.split('\n').map((line) => '\t' + line).join('\n');
1749
- return new TypeError(message);
1750
- }
1751
- }
1752
- if (obj.startLine !== undefined) {
1753
- const obj_startLine = obj.startLine;
1754
- const path_startLine = path + '.startLine';
1755
- let obj_startLine_union0 = null;
1756
- const obj_startLine_union0_error = (() => {
1757
- if (typeof obj_startLine !== 'number' || (typeof obj_startLine === 'number' && Math.floor(obj_startLine) !== obj_startLine)) {
1758
- return new TypeError('Expected "integer" but received "' + typeof obj_startLine + '" (at "' + path_startLine + '")');
1759
- }
1760
- })();
1761
- if (obj_startLine_union0_error != null) {
1762
- obj_startLine_union0 = obj_startLine_union0_error.message;
1763
- }
1764
- let obj_startLine_union1 = null;
1765
- const obj_startLine_union1_error = (() => {
1766
- if (obj_startLine !== null) {
1767
- return new TypeError('Expected "null" but received "' + typeof obj_startLine + '" (at "' + path_startLine + '")');
1768
- }
1769
- })();
1770
- if (obj_startLine_union1_error != null) {
1771
- obj_startLine_union1 = obj_startLine_union1_error.message;
1772
- }
1773
- if (obj_startLine_union0 && obj_startLine_union1) {
1774
- let message = 'Object doesn\'t match union (at "' + path_startLine + '")';
1775
- message += '\n' + obj_startLine_union0.split('\n').map((line) => '\t' + line).join('\n');
1776
- message += '\n' + obj_startLine_union1.split('\n').map((line) => '\t' + line).join('\n');
1777
- return new TypeError(message);
1778
- }
1779
- }
1780
- if (obj.startPosition !== undefined) {
1781
- const obj_startPosition = obj.startPosition;
1782
- const path_startPosition = path + '.startPosition';
1783
- let obj_startPosition_union0 = null;
1784
- const obj_startPosition_union0_error = (() => {
1785
- if (typeof obj_startPosition !== 'number' || (typeof obj_startPosition === 'number' && Math.floor(obj_startPosition) !== obj_startPosition)) {
1786
- return new TypeError('Expected "integer" but received "' + typeof obj_startPosition + '" (at "' + path_startPosition + '")');
1787
- }
1788
- })();
1789
- if (obj_startPosition_union0_error != null) {
1790
- obj_startPosition_union0 = obj_startPosition_union0_error.message;
1791
- }
1792
- let obj_startPosition_union1 = null;
1793
- const obj_startPosition_union1_error = (() => {
1794
- if (obj_startPosition !== null) {
1795
- return new TypeError('Expected "null" but received "' + typeof obj_startPosition + '" (at "' + path_startPosition + '")');
1796
- }
1797
- })();
1798
- if (obj_startPosition_union1_error != null) {
1799
- obj_startPosition_union1 = obj_startPosition_union1_error.message;
1800
- }
1801
- if (obj_startPosition_union0 && obj_startPosition_union1) {
1802
- let message = 'Object doesn\'t match union (at "' + path_startPosition + '")';
1803
- message += '\n' + obj_startPosition_union0.split('\n').map((line) => '\t' + line).join('\n');
1804
- message += '\n' + obj_startPosition_union1.split('\n').map((line) => '\t' + line).join('\n');
1805
- return new TypeError(message);
1806
- }
1807
- }
1808
- const obj_validationClass = obj.validationClass;
1809
- const path_validationClass = path + '.validationClass';
1810
- if (typeof obj_validationClass !== 'string') {
1811
- return new TypeError('Expected "string" but received "' + typeof obj_validationClass + '" (at "' + path_validationClass + '")');
1812
- }
1813
- const obj_validationLevel = obj.validationLevel;
1814
- const path_validationLevel = path + '.validationLevel';
1815
- if (typeof obj_validationLevel !== 'string') {
1816
- return new TypeError('Expected "string" but received "' + typeof obj_validationLevel + '" (at "' + path_validationLevel + '")');
1817
- }
1818
- })();
1819
- return v_error === undefined ? null : v_error;
1820
- }
1821
- const select$2 = function SchemaValidationMessageRepresentationSelect() {
1822
- return {
1823
- kind: 'Fragment',
1824
- version: VERSION$1,
1825
- private: [],
1826
- selections: [
1827
- {
1828
- name: 'endColumn',
1829
- kind: 'Scalar',
1830
- required: false
1831
- },
1832
- {
1833
- name: 'endLine',
1834
- kind: 'Scalar',
1835
- required: false
1836
- },
1837
- {
1838
- name: 'endPosition',
1839
- kind: 'Scalar',
1840
- required: false
1841
- },
1842
- {
1843
- name: 'message',
1844
- kind: 'Scalar'
1845
- },
1846
- {
1847
- name: 'startColumn',
1848
- kind: 'Scalar',
1849
- required: false
1850
- },
1851
- {
1852
- name: 'startLine',
1853
- kind: 'Scalar',
1854
- required: false
1855
- },
1856
- {
1857
- name: 'startPosition',
1858
- kind: 'Scalar',
1859
- required: false
1860
- },
1861
- {
1862
- name: 'validationClass',
1863
- kind: 'Scalar'
1864
- },
1865
- {
1866
- name: 'validationLevel',
1867
- kind: 'Scalar'
1868
- }
1869
- ]
1870
- };
1871
- };
1872
- function equals$1(existing, incoming) {
1873
- const existing_message = existing.message;
1874
- const incoming_message = incoming.message;
1875
- if (!(existing_message === incoming_message)) {
1876
- return false;
1877
- }
1878
- const existing_validationClass = existing.validationClass;
1879
- const incoming_validationClass = incoming.validationClass;
1880
- if (!(existing_validationClass === incoming_validationClass)) {
1881
- return false;
1882
- }
1883
- const existing_validationLevel = existing.validationLevel;
1884
- const incoming_validationLevel = incoming.validationLevel;
1885
- if (!(existing_validationLevel === incoming_validationLevel)) {
1886
- return false;
1887
- }
1888
- const existing_endColumn = existing.endColumn;
1889
- const incoming_endColumn = incoming.endColumn;
1890
- // if at least one of these optionals is defined
1891
- if (existing_endColumn !== undefined || incoming_endColumn !== undefined) {
1892
- // if one of these is not defined we know the other is defined and therefore
1893
- // not equal
1894
- if (existing_endColumn === undefined || incoming_endColumn === undefined) {
1895
- return false;
1896
- }
1897
- if (!(existing_endColumn === incoming_endColumn)) {
1898
- return false;
1899
- }
1900
- }
1901
- const existing_endLine = existing.endLine;
1902
- const incoming_endLine = incoming.endLine;
1903
- // if at least one of these optionals is defined
1904
- if (existing_endLine !== undefined || incoming_endLine !== undefined) {
1905
- // if one of these is not defined we know the other is defined and therefore
1906
- // not equal
1907
- if (existing_endLine === undefined || incoming_endLine === undefined) {
1908
- return false;
1909
- }
1910
- if (!(existing_endLine === incoming_endLine)) {
1911
- return false;
1912
- }
1913
- }
1914
- const existing_endPosition = existing.endPosition;
1915
- const incoming_endPosition = incoming.endPosition;
1916
- // if at least one of these optionals is defined
1917
- if (existing_endPosition !== undefined || incoming_endPosition !== undefined) {
1918
- // if one of these is not defined we know the other is defined and therefore
1919
- // not equal
1920
- if (existing_endPosition === undefined || incoming_endPosition === undefined) {
1921
- return false;
1922
- }
1923
- if (!(existing_endPosition === incoming_endPosition)) {
1924
- return false;
1925
- }
1926
- }
1927
- const existing_startColumn = existing.startColumn;
1928
- const incoming_startColumn = incoming.startColumn;
1929
- // if at least one of these optionals is defined
1930
- if (existing_startColumn !== undefined || incoming_startColumn !== undefined) {
1931
- // if one of these is not defined we know the other is defined and therefore
1932
- // not equal
1933
- if (existing_startColumn === undefined || incoming_startColumn === undefined) {
1934
- return false;
1935
- }
1936
- if (!(existing_startColumn === incoming_startColumn)) {
1937
- return false;
1938
- }
1939
- }
1940
- const existing_startLine = existing.startLine;
1941
- const incoming_startLine = incoming.startLine;
1942
- // if at least one of these optionals is defined
1943
- if (existing_startLine !== undefined || incoming_startLine !== undefined) {
1944
- // if one of these is not defined we know the other is defined and therefore
1945
- // not equal
1946
- if (existing_startLine === undefined || incoming_startLine === undefined) {
1947
- return false;
1948
- }
1949
- if (!(existing_startLine === incoming_startLine)) {
1950
- return false;
1951
- }
1952
- }
1953
- const existing_startPosition = existing.startPosition;
1954
- const incoming_startPosition = incoming.startPosition;
1955
- // if at least one of these optionals is defined
1956
- if (existing_startPosition !== undefined || incoming_startPosition !== undefined) {
1957
- // if one of these is not defined we know the other is defined and therefore
1958
- // not equal
1959
- if (existing_startPosition === undefined || incoming_startPosition === undefined) {
1960
- return false;
1961
- }
1962
- if (!(existing_startPosition === incoming_startPosition)) {
1963
- return false;
1964
- }
1965
- }
1966
- return true;
1629
+ const VERSION$1 = "970029a80f127a32c6e30cda09b02a11";
1630
+ function validate$1(obj, path = 'SchemaValidationMessageRepresentation') {
1631
+ const v_error = (() => {
1632
+ if (typeof obj !== 'object' || ArrayIsArray(obj) || obj === null) {
1633
+ return new TypeError('Expected "object" but received "' + typeof obj + '" (at "' + path + '")');
1634
+ }
1635
+ if (obj.endColumn !== undefined) {
1636
+ const obj_endColumn = obj.endColumn;
1637
+ const path_endColumn = path + '.endColumn';
1638
+ let obj_endColumn_union0 = null;
1639
+ const obj_endColumn_union0_error = (() => {
1640
+ if (typeof obj_endColumn !== 'number' || (typeof obj_endColumn === 'number' && Math.floor(obj_endColumn) !== obj_endColumn)) {
1641
+ return new TypeError('Expected "integer" but received "' + typeof obj_endColumn + '" (at "' + path_endColumn + '")');
1642
+ }
1643
+ })();
1644
+ if (obj_endColumn_union0_error != null) {
1645
+ obj_endColumn_union0 = obj_endColumn_union0_error.message;
1646
+ }
1647
+ let obj_endColumn_union1 = null;
1648
+ const obj_endColumn_union1_error = (() => {
1649
+ if (obj_endColumn !== null) {
1650
+ return new TypeError('Expected "null" but received "' + typeof obj_endColumn + '" (at "' + path_endColumn + '")');
1651
+ }
1652
+ })();
1653
+ if (obj_endColumn_union1_error != null) {
1654
+ obj_endColumn_union1 = obj_endColumn_union1_error.message;
1655
+ }
1656
+ if (obj_endColumn_union0 && obj_endColumn_union1) {
1657
+ let message = 'Object doesn\'t match union (at "' + path_endColumn + '")';
1658
+ message += '\n' + obj_endColumn_union0.split('\n').map((line) => '\t' + line).join('\n');
1659
+ message += '\n' + obj_endColumn_union1.split('\n').map((line) => '\t' + line).join('\n');
1660
+ return new TypeError(message);
1661
+ }
1662
+ }
1663
+ if (obj.endLine !== undefined) {
1664
+ const obj_endLine = obj.endLine;
1665
+ const path_endLine = path + '.endLine';
1666
+ let obj_endLine_union0 = null;
1667
+ const obj_endLine_union0_error = (() => {
1668
+ if (typeof obj_endLine !== 'number' || (typeof obj_endLine === 'number' && Math.floor(obj_endLine) !== obj_endLine)) {
1669
+ return new TypeError('Expected "integer" but received "' + typeof obj_endLine + '" (at "' + path_endLine + '")');
1670
+ }
1671
+ })();
1672
+ if (obj_endLine_union0_error != null) {
1673
+ obj_endLine_union0 = obj_endLine_union0_error.message;
1674
+ }
1675
+ let obj_endLine_union1 = null;
1676
+ const obj_endLine_union1_error = (() => {
1677
+ if (obj_endLine !== null) {
1678
+ return new TypeError('Expected "null" but received "' + typeof obj_endLine + '" (at "' + path_endLine + '")');
1679
+ }
1680
+ })();
1681
+ if (obj_endLine_union1_error != null) {
1682
+ obj_endLine_union1 = obj_endLine_union1_error.message;
1683
+ }
1684
+ if (obj_endLine_union0 && obj_endLine_union1) {
1685
+ let message = 'Object doesn\'t match union (at "' + path_endLine + '")';
1686
+ message += '\n' + obj_endLine_union0.split('\n').map((line) => '\t' + line).join('\n');
1687
+ message += '\n' + obj_endLine_union1.split('\n').map((line) => '\t' + line).join('\n');
1688
+ return new TypeError(message);
1689
+ }
1690
+ }
1691
+ if (obj.endPosition !== undefined) {
1692
+ const obj_endPosition = obj.endPosition;
1693
+ const path_endPosition = path + '.endPosition';
1694
+ let obj_endPosition_union0 = null;
1695
+ const obj_endPosition_union0_error = (() => {
1696
+ if (typeof obj_endPosition !== 'number' || (typeof obj_endPosition === 'number' && Math.floor(obj_endPosition) !== obj_endPosition)) {
1697
+ return new TypeError('Expected "integer" but received "' + typeof obj_endPosition + '" (at "' + path_endPosition + '")');
1698
+ }
1699
+ })();
1700
+ if (obj_endPosition_union0_error != null) {
1701
+ obj_endPosition_union0 = obj_endPosition_union0_error.message;
1702
+ }
1703
+ let obj_endPosition_union1 = null;
1704
+ const obj_endPosition_union1_error = (() => {
1705
+ if (obj_endPosition !== null) {
1706
+ return new TypeError('Expected "null" but received "' + typeof obj_endPosition + '" (at "' + path_endPosition + '")');
1707
+ }
1708
+ })();
1709
+ if (obj_endPosition_union1_error != null) {
1710
+ obj_endPosition_union1 = obj_endPosition_union1_error.message;
1711
+ }
1712
+ if (obj_endPosition_union0 && obj_endPosition_union1) {
1713
+ let message = 'Object doesn\'t match union (at "' + path_endPosition + '")';
1714
+ message += '\n' + obj_endPosition_union0.split('\n').map((line) => '\t' + line).join('\n');
1715
+ message += '\n' + obj_endPosition_union1.split('\n').map((line) => '\t' + line).join('\n');
1716
+ return new TypeError(message);
1717
+ }
1718
+ }
1719
+ const obj_message = obj.message;
1720
+ const path_message = path + '.message';
1721
+ if (typeof obj_message !== 'string') {
1722
+ return new TypeError('Expected "string" but received "' + typeof obj_message + '" (at "' + path_message + '")');
1723
+ }
1724
+ if (obj.startColumn !== undefined) {
1725
+ const obj_startColumn = obj.startColumn;
1726
+ const path_startColumn = path + '.startColumn';
1727
+ let obj_startColumn_union0 = null;
1728
+ const obj_startColumn_union0_error = (() => {
1729
+ if (typeof obj_startColumn !== 'number' || (typeof obj_startColumn === 'number' && Math.floor(obj_startColumn) !== obj_startColumn)) {
1730
+ return new TypeError('Expected "integer" but received "' + typeof obj_startColumn + '" (at "' + path_startColumn + '")');
1731
+ }
1732
+ })();
1733
+ if (obj_startColumn_union0_error != null) {
1734
+ obj_startColumn_union0 = obj_startColumn_union0_error.message;
1735
+ }
1736
+ let obj_startColumn_union1 = null;
1737
+ const obj_startColumn_union1_error = (() => {
1738
+ if (obj_startColumn !== null) {
1739
+ return new TypeError('Expected "null" but received "' + typeof obj_startColumn + '" (at "' + path_startColumn + '")');
1740
+ }
1741
+ })();
1742
+ if (obj_startColumn_union1_error != null) {
1743
+ obj_startColumn_union1 = obj_startColumn_union1_error.message;
1744
+ }
1745
+ if (obj_startColumn_union0 && obj_startColumn_union1) {
1746
+ let message = 'Object doesn\'t match union (at "' + path_startColumn + '")';
1747
+ message += '\n' + obj_startColumn_union0.split('\n').map((line) => '\t' + line).join('\n');
1748
+ message += '\n' + obj_startColumn_union1.split('\n').map((line) => '\t' + line).join('\n');
1749
+ return new TypeError(message);
1750
+ }
1751
+ }
1752
+ if (obj.startLine !== undefined) {
1753
+ const obj_startLine = obj.startLine;
1754
+ const path_startLine = path + '.startLine';
1755
+ let obj_startLine_union0 = null;
1756
+ const obj_startLine_union0_error = (() => {
1757
+ if (typeof obj_startLine !== 'number' || (typeof obj_startLine === 'number' && Math.floor(obj_startLine) !== obj_startLine)) {
1758
+ return new TypeError('Expected "integer" but received "' + typeof obj_startLine + '" (at "' + path_startLine + '")');
1759
+ }
1760
+ })();
1761
+ if (obj_startLine_union0_error != null) {
1762
+ obj_startLine_union0 = obj_startLine_union0_error.message;
1763
+ }
1764
+ let obj_startLine_union1 = null;
1765
+ const obj_startLine_union1_error = (() => {
1766
+ if (obj_startLine !== null) {
1767
+ return new TypeError('Expected "null" but received "' + typeof obj_startLine + '" (at "' + path_startLine + '")');
1768
+ }
1769
+ })();
1770
+ if (obj_startLine_union1_error != null) {
1771
+ obj_startLine_union1 = obj_startLine_union1_error.message;
1772
+ }
1773
+ if (obj_startLine_union0 && obj_startLine_union1) {
1774
+ let message = 'Object doesn\'t match union (at "' + path_startLine + '")';
1775
+ message += '\n' + obj_startLine_union0.split('\n').map((line) => '\t' + line).join('\n');
1776
+ message += '\n' + obj_startLine_union1.split('\n').map((line) => '\t' + line).join('\n');
1777
+ return new TypeError(message);
1778
+ }
1779
+ }
1780
+ if (obj.startPosition !== undefined) {
1781
+ const obj_startPosition = obj.startPosition;
1782
+ const path_startPosition = path + '.startPosition';
1783
+ let obj_startPosition_union0 = null;
1784
+ const obj_startPosition_union0_error = (() => {
1785
+ if (typeof obj_startPosition !== 'number' || (typeof obj_startPosition === 'number' && Math.floor(obj_startPosition) !== obj_startPosition)) {
1786
+ return new TypeError('Expected "integer" but received "' + typeof obj_startPosition + '" (at "' + path_startPosition + '")');
1787
+ }
1788
+ })();
1789
+ if (obj_startPosition_union0_error != null) {
1790
+ obj_startPosition_union0 = obj_startPosition_union0_error.message;
1791
+ }
1792
+ let obj_startPosition_union1 = null;
1793
+ const obj_startPosition_union1_error = (() => {
1794
+ if (obj_startPosition !== null) {
1795
+ return new TypeError('Expected "null" but received "' + typeof obj_startPosition + '" (at "' + path_startPosition + '")');
1796
+ }
1797
+ })();
1798
+ if (obj_startPosition_union1_error != null) {
1799
+ obj_startPosition_union1 = obj_startPosition_union1_error.message;
1800
+ }
1801
+ if (obj_startPosition_union0 && obj_startPosition_union1) {
1802
+ let message = 'Object doesn\'t match union (at "' + path_startPosition + '")';
1803
+ message += '\n' + obj_startPosition_union0.split('\n').map((line) => '\t' + line).join('\n');
1804
+ message += '\n' + obj_startPosition_union1.split('\n').map((line) => '\t' + line).join('\n');
1805
+ return new TypeError(message);
1806
+ }
1807
+ }
1808
+ const obj_validationClass = obj.validationClass;
1809
+ const path_validationClass = path + '.validationClass';
1810
+ if (typeof obj_validationClass !== 'string') {
1811
+ return new TypeError('Expected "string" but received "' + typeof obj_validationClass + '" (at "' + path_validationClass + '")');
1812
+ }
1813
+ const obj_validationLevel = obj.validationLevel;
1814
+ const path_validationLevel = path + '.validationLevel';
1815
+ if (typeof obj_validationLevel !== 'string') {
1816
+ return new TypeError('Expected "string" but received "' + typeof obj_validationLevel + '" (at "' + path_validationLevel + '")');
1817
+ }
1818
+ })();
1819
+ return v_error === undefined ? null : v_error;
1820
+ }
1821
+ const select$2 = function SchemaValidationMessageRepresentationSelect() {
1822
+ return {
1823
+ kind: 'Fragment',
1824
+ version: VERSION$1,
1825
+ private: [],
1826
+ selections: [
1827
+ {
1828
+ name: 'endColumn',
1829
+ kind: 'Scalar',
1830
+ required: false
1831
+ },
1832
+ {
1833
+ name: 'endLine',
1834
+ kind: 'Scalar',
1835
+ required: false
1836
+ },
1837
+ {
1838
+ name: 'endPosition',
1839
+ kind: 'Scalar',
1840
+ required: false
1841
+ },
1842
+ {
1843
+ name: 'message',
1844
+ kind: 'Scalar'
1845
+ },
1846
+ {
1847
+ name: 'startColumn',
1848
+ kind: 'Scalar',
1849
+ required: false
1850
+ },
1851
+ {
1852
+ name: 'startLine',
1853
+ kind: 'Scalar',
1854
+ required: false
1855
+ },
1856
+ {
1857
+ name: 'startPosition',
1858
+ kind: 'Scalar',
1859
+ required: false
1860
+ },
1861
+ {
1862
+ name: 'validationClass',
1863
+ kind: 'Scalar'
1864
+ },
1865
+ {
1866
+ name: 'validationLevel',
1867
+ kind: 'Scalar'
1868
+ }
1869
+ ]
1870
+ };
1871
+ };
1872
+ function equals$1(existing, incoming) {
1873
+ const existing_message = existing.message;
1874
+ const incoming_message = incoming.message;
1875
+ if (!(existing_message === incoming_message)) {
1876
+ return false;
1877
+ }
1878
+ const existing_validationClass = existing.validationClass;
1879
+ const incoming_validationClass = incoming.validationClass;
1880
+ if (!(existing_validationClass === incoming_validationClass)) {
1881
+ return false;
1882
+ }
1883
+ const existing_validationLevel = existing.validationLevel;
1884
+ const incoming_validationLevel = incoming.validationLevel;
1885
+ if (!(existing_validationLevel === incoming_validationLevel)) {
1886
+ return false;
1887
+ }
1888
+ const existing_endColumn = existing.endColumn;
1889
+ const incoming_endColumn = incoming.endColumn;
1890
+ // if at least one of these optionals is defined
1891
+ if (existing_endColumn !== undefined || incoming_endColumn !== undefined) {
1892
+ // if one of these is not defined we know the other is defined and therefore
1893
+ // not equal
1894
+ if (existing_endColumn === undefined || incoming_endColumn === undefined) {
1895
+ return false;
1896
+ }
1897
+ if (!(existing_endColumn === incoming_endColumn)) {
1898
+ return false;
1899
+ }
1900
+ }
1901
+ const existing_endLine = existing.endLine;
1902
+ const incoming_endLine = incoming.endLine;
1903
+ // if at least one of these optionals is defined
1904
+ if (existing_endLine !== undefined || incoming_endLine !== undefined) {
1905
+ // if one of these is not defined we know the other is defined and therefore
1906
+ // not equal
1907
+ if (existing_endLine === undefined || incoming_endLine === undefined) {
1908
+ return false;
1909
+ }
1910
+ if (!(existing_endLine === incoming_endLine)) {
1911
+ return false;
1912
+ }
1913
+ }
1914
+ const existing_endPosition = existing.endPosition;
1915
+ const incoming_endPosition = incoming.endPosition;
1916
+ // if at least one of these optionals is defined
1917
+ if (existing_endPosition !== undefined || incoming_endPosition !== undefined) {
1918
+ // if one of these is not defined we know the other is defined and therefore
1919
+ // not equal
1920
+ if (existing_endPosition === undefined || incoming_endPosition === undefined) {
1921
+ return false;
1922
+ }
1923
+ if (!(existing_endPosition === incoming_endPosition)) {
1924
+ return false;
1925
+ }
1926
+ }
1927
+ const existing_startColumn = existing.startColumn;
1928
+ const incoming_startColumn = incoming.startColumn;
1929
+ // if at least one of these optionals is defined
1930
+ if (existing_startColumn !== undefined || incoming_startColumn !== undefined) {
1931
+ // if one of these is not defined we know the other is defined and therefore
1932
+ // not equal
1933
+ if (existing_startColumn === undefined || incoming_startColumn === undefined) {
1934
+ return false;
1935
+ }
1936
+ if (!(existing_startColumn === incoming_startColumn)) {
1937
+ return false;
1938
+ }
1939
+ }
1940
+ const existing_startLine = existing.startLine;
1941
+ const incoming_startLine = incoming.startLine;
1942
+ // if at least one of these optionals is defined
1943
+ if (existing_startLine !== undefined || incoming_startLine !== undefined) {
1944
+ // if one of these is not defined we know the other is defined and therefore
1945
+ // not equal
1946
+ if (existing_startLine === undefined || incoming_startLine === undefined) {
1947
+ return false;
1948
+ }
1949
+ if (!(existing_startLine === incoming_startLine)) {
1950
+ return false;
1951
+ }
1952
+ }
1953
+ const existing_startPosition = existing.startPosition;
1954
+ const incoming_startPosition = incoming.startPosition;
1955
+ // if at least one of these optionals is defined
1956
+ if (existing_startPosition !== undefined || incoming_startPosition !== undefined) {
1957
+ // if one of these is not defined we know the other is defined and therefore
1958
+ // not equal
1959
+ if (existing_startPosition === undefined || incoming_startPosition === undefined) {
1960
+ return false;
1961
+ }
1962
+ if (!(existing_startPosition === incoming_startPosition)) {
1963
+ return false;
1964
+ }
1965
+ }
1966
+ return true;
1967
1967
  }
1968
1968
 
1969
- const VERSION = "056d3062f884a64afdf97b374daf2e75";
1970
- function validate(obj, path = 'SchemaValidationOutputRepresentation') {
1971
- const v_error = (() => {
1972
- if (typeof obj !== 'object' || ArrayIsArray(obj) || obj === null) {
1973
- return new TypeError('Expected "object" but received "' + typeof obj + '" (at "' + path + '")');
1974
- }
1975
- const obj_schemaName = obj.schemaName;
1976
- const path_schemaName = path + '.schemaName';
1977
- if (typeof obj_schemaName !== 'string') {
1978
- return new TypeError('Expected "string" but received "' + typeof obj_schemaName + '" (at "' + path_schemaName + '")');
1979
- }
1980
- const obj_schemaSize = obj.schemaSize;
1981
- const path_schemaSize = path + '.schemaSize';
1982
- if (typeof obj_schemaSize !== 'number' || (typeof obj_schemaSize === 'number' && Math.floor(obj_schemaSize) !== obj_schemaSize)) {
1983
- return new TypeError('Expected "integer" but received "' + typeof obj_schemaSize + '" (at "' + path_schemaSize + '")');
1984
- }
1985
- const obj_schemaType = obj.schemaType;
1986
- const path_schemaType = path + '.schemaType';
1987
- if (typeof obj_schemaType !== 'string') {
1988
- return new TypeError('Expected "string" but received "' + typeof obj_schemaType + '" (at "' + path_schemaType + '")');
1989
- }
1990
- const obj_schemaValidation = obj.schemaValidation;
1991
- const path_schemaValidation = path + '.schemaValidation';
1992
- if (!ArrayIsArray(obj_schemaValidation)) {
1993
- return new TypeError('Expected "array" but received "' + typeof obj_schemaValidation + '" (at "' + path_schemaValidation + '")');
1994
- }
1995
- for (let i = 0; i < obj_schemaValidation.length; i++) {
1996
- const obj_schemaValidation_item = obj_schemaValidation[i];
1997
- const path_schemaValidation_item = path_schemaValidation + '[' + i + ']';
1998
- const referencepath_schemaValidation_itemValidationError = validate$1(obj_schemaValidation_item, path_schemaValidation_item);
1999
- if (referencepath_schemaValidation_itemValidationError !== null) {
2000
- let message = 'Object doesn\'t match SchemaValidationMessageRepresentation (at "' + path_schemaValidation_item + '")\n';
2001
- message += referencepath_schemaValidation_itemValidationError.message.split('\n').map((line) => '\t' + line).join('\n');
2002
- return new TypeError(message);
2003
- }
2004
- }
2005
- const obj_systemVersion = obj.systemVersion;
2006
- const path_systemVersion = path + '.systemVersion';
2007
- if (typeof obj_systemVersion !== 'number' || (typeof obj_systemVersion === 'number' && Math.floor(obj_systemVersion) !== obj_systemVersion)) {
2008
- return new TypeError('Expected "integer" but received "' + typeof obj_systemVersion + '" (at "' + path_systemVersion + '")');
2009
- }
2010
- })();
2011
- return v_error === undefined ? null : v_error;
2012
- }
2013
- const RepresentationType = 'SchemaValidationOutputRepresentation';
2014
- function keyBuilder(luvio, config) {
2015
- return keyPrefix + '::' + RepresentationType + ':' + config.schemaName;
2016
- }
2017
- function keyBuilderFromType(luvio, object) {
2018
- const keyParams = {
2019
- schemaName: object.schemaName
2020
- };
2021
- return keyBuilder(luvio, keyParams);
2022
- }
2023
- function normalize(input, existing, path, luvio, store, timestamp) {
2024
- return input;
2025
- }
2026
- const select$1 = function SchemaValidationOutputRepresentationSelect() {
2027
- const { selections: SchemaValidationMessageRepresentation__selections, opaque: SchemaValidationMessageRepresentation__opaque, } = select$2();
2028
- return {
2029
- kind: 'Fragment',
2030
- version: VERSION,
2031
- private: [],
2032
- selections: [
2033
- {
2034
- name: 'schemaName',
2035
- kind: 'Scalar'
2036
- },
2037
- {
2038
- name: 'schemaSize',
2039
- kind: 'Scalar'
2040
- },
2041
- {
2042
- name: 'schemaType',
2043
- kind: 'Scalar'
2044
- },
2045
- {
2046
- name: 'schemaValidation',
2047
- kind: 'Object',
2048
- plural: true,
2049
- selections: SchemaValidationMessageRepresentation__selections
2050
- },
2051
- {
2052
- name: 'systemVersion',
2053
- kind: 'Scalar'
2054
- }
2055
- ]
2056
- };
2057
- };
2058
- function equals(existing, incoming) {
2059
- const existing_schemaSize = existing.schemaSize;
2060
- const incoming_schemaSize = incoming.schemaSize;
2061
- if (!(existing_schemaSize === incoming_schemaSize)) {
2062
- return false;
2063
- }
2064
- const existing_systemVersion = existing.systemVersion;
2065
- const incoming_systemVersion = incoming.systemVersion;
2066
- if (!(existing_systemVersion === incoming_systemVersion)) {
2067
- return false;
2068
- }
2069
- const existing_schemaName = existing.schemaName;
2070
- const incoming_schemaName = incoming.schemaName;
2071
- if (!(existing_schemaName === incoming_schemaName)) {
2072
- return false;
2073
- }
2074
- const existing_schemaType = existing.schemaType;
2075
- const incoming_schemaType = incoming.schemaType;
2076
- if (!(existing_schemaType === incoming_schemaType)) {
2077
- return false;
2078
- }
2079
- const existing_schemaValidation = existing.schemaValidation;
2080
- const incoming_schemaValidation = incoming.schemaValidation;
2081
- const equals_schemaValidation_items = equalsArray(existing_schemaValidation, incoming_schemaValidation, (existing_schemaValidation_item, incoming_schemaValidation_item) => {
2082
- if (!(equals$1(existing_schemaValidation_item, incoming_schemaValidation_item))) {
2083
- return false;
2084
- }
2085
- });
2086
- if (equals_schemaValidation_items === false) {
2087
- return false;
2088
- }
2089
- return true;
2090
- }
2091
- const ingest = function SchemaValidationOutputRepresentationIngest(input, path, luvio, store, timestamp) {
2092
- if (process.env.NODE_ENV !== 'production') {
2093
- const validateError = validate(input);
2094
- if (validateError !== null) {
2095
- throw validateError;
2096
- }
2097
- }
2098
- const key = keyBuilderFromType(luvio, input);
2099
- const existingRecord = store.readEntry(key);
2100
- const ttlToUse = path.ttl !== undefined ? path.ttl : 300000;
2101
- let incomingRecord = normalize(input, store.readEntry(key), {
2102
- fullPath: key,
2103
- parent: path.parent,
2104
- propertyName: path.propertyName,
2105
- ttl: ttlToUse
2106
- });
2107
- if (existingRecord === undefined || equals(existingRecord, incomingRecord) === false) {
2108
- luvio.storePublish(key, incomingRecord);
2109
- }
2110
- if (ttlToUse !== undefined) {
2111
- const storeMetadataParams = {
2112
- ttl: ttlToUse,
2113
- namespace: "external-services",
2114
- version: VERSION,
2115
- representationName: RepresentationType,
2116
- };
2117
- luvio.publishStoreMetadata(key, storeMetadataParams);
2118
- }
2119
- return createLink(key);
2120
- };
2121
- function getTypeCacheKeys(luvio, input, fullPathFactory) {
2122
- const rootKeySet = new StoreKeyMap();
2123
- // root cache key (uses fullPathFactory if keyBuilderFromType isn't defined)
2124
- const rootKey = keyBuilderFromType(luvio, input);
2125
- rootKeySet.set(rootKey, {
2126
- namespace: keyPrefix,
2127
- representationName: RepresentationType,
2128
- mergeable: false
2129
- });
2130
- return rootKeySet;
1969
+ const VERSION = "056d3062f884a64afdf97b374daf2e75";
1970
+ function validate(obj, path = 'SchemaValidationOutputRepresentation') {
1971
+ const v_error = (() => {
1972
+ if (typeof obj !== 'object' || ArrayIsArray(obj) || obj === null) {
1973
+ return new TypeError('Expected "object" but received "' + typeof obj + '" (at "' + path + '")');
1974
+ }
1975
+ const obj_schemaName = obj.schemaName;
1976
+ const path_schemaName = path + '.schemaName';
1977
+ if (typeof obj_schemaName !== 'string') {
1978
+ return new TypeError('Expected "string" but received "' + typeof obj_schemaName + '" (at "' + path_schemaName + '")');
1979
+ }
1980
+ const obj_schemaSize = obj.schemaSize;
1981
+ const path_schemaSize = path + '.schemaSize';
1982
+ if (typeof obj_schemaSize !== 'number' || (typeof obj_schemaSize === 'number' && Math.floor(obj_schemaSize) !== obj_schemaSize)) {
1983
+ return new TypeError('Expected "integer" but received "' + typeof obj_schemaSize + '" (at "' + path_schemaSize + '")');
1984
+ }
1985
+ const obj_schemaType = obj.schemaType;
1986
+ const path_schemaType = path + '.schemaType';
1987
+ if (typeof obj_schemaType !== 'string') {
1988
+ return new TypeError('Expected "string" but received "' + typeof obj_schemaType + '" (at "' + path_schemaType + '")');
1989
+ }
1990
+ const obj_schemaValidation = obj.schemaValidation;
1991
+ const path_schemaValidation = path + '.schemaValidation';
1992
+ if (!ArrayIsArray(obj_schemaValidation)) {
1993
+ return new TypeError('Expected "array" but received "' + typeof obj_schemaValidation + '" (at "' + path_schemaValidation + '")');
1994
+ }
1995
+ for (let i = 0; i < obj_schemaValidation.length; i++) {
1996
+ const obj_schemaValidation_item = obj_schemaValidation[i];
1997
+ const path_schemaValidation_item = path_schemaValidation + '[' + i + ']';
1998
+ const referencepath_schemaValidation_itemValidationError = validate$1(obj_schemaValidation_item, path_schemaValidation_item);
1999
+ if (referencepath_schemaValidation_itemValidationError !== null) {
2000
+ let message = 'Object doesn\'t match SchemaValidationMessageRepresentation (at "' + path_schemaValidation_item + '")\n';
2001
+ message += referencepath_schemaValidation_itemValidationError.message.split('\n').map((line) => '\t' + line).join('\n');
2002
+ return new TypeError(message);
2003
+ }
2004
+ }
2005
+ const obj_systemVersion = obj.systemVersion;
2006
+ const path_systemVersion = path + '.systemVersion';
2007
+ if (typeof obj_systemVersion !== 'number' || (typeof obj_systemVersion === 'number' && Math.floor(obj_systemVersion) !== obj_systemVersion)) {
2008
+ return new TypeError('Expected "integer" but received "' + typeof obj_systemVersion + '" (at "' + path_systemVersion + '")');
2009
+ }
2010
+ })();
2011
+ return v_error === undefined ? null : v_error;
2012
+ }
2013
+ const RepresentationType = 'SchemaValidationOutputRepresentation';
2014
+ function keyBuilder(luvio, config) {
2015
+ return keyPrefix + '::' + RepresentationType + ':' + config.schemaName;
2016
+ }
2017
+ function keyBuilderFromType(luvio, object) {
2018
+ const keyParams = {
2019
+ schemaName: object.schemaName
2020
+ };
2021
+ return keyBuilder(luvio, keyParams);
2022
+ }
2023
+ function normalize(input, existing, path, luvio, store, timestamp) {
2024
+ return input;
2025
+ }
2026
+ const select$1 = function SchemaValidationOutputRepresentationSelect() {
2027
+ const { selections: SchemaValidationMessageRepresentation__selections, opaque: SchemaValidationMessageRepresentation__opaque, } = select$2();
2028
+ return {
2029
+ kind: 'Fragment',
2030
+ version: VERSION,
2031
+ private: [],
2032
+ selections: [
2033
+ {
2034
+ name: 'schemaName',
2035
+ kind: 'Scalar'
2036
+ },
2037
+ {
2038
+ name: 'schemaSize',
2039
+ kind: 'Scalar'
2040
+ },
2041
+ {
2042
+ name: 'schemaType',
2043
+ kind: 'Scalar'
2044
+ },
2045
+ {
2046
+ name: 'schemaValidation',
2047
+ kind: 'Object',
2048
+ plural: true,
2049
+ selections: SchemaValidationMessageRepresentation__selections
2050
+ },
2051
+ {
2052
+ name: 'systemVersion',
2053
+ kind: 'Scalar'
2054
+ }
2055
+ ]
2056
+ };
2057
+ };
2058
+ function equals(existing, incoming) {
2059
+ const existing_schemaSize = existing.schemaSize;
2060
+ const incoming_schemaSize = incoming.schemaSize;
2061
+ if (!(existing_schemaSize === incoming_schemaSize)) {
2062
+ return false;
2063
+ }
2064
+ const existing_systemVersion = existing.systemVersion;
2065
+ const incoming_systemVersion = incoming.systemVersion;
2066
+ if (!(existing_systemVersion === incoming_systemVersion)) {
2067
+ return false;
2068
+ }
2069
+ const existing_schemaName = existing.schemaName;
2070
+ const incoming_schemaName = incoming.schemaName;
2071
+ if (!(existing_schemaName === incoming_schemaName)) {
2072
+ return false;
2073
+ }
2074
+ const existing_schemaType = existing.schemaType;
2075
+ const incoming_schemaType = incoming.schemaType;
2076
+ if (!(existing_schemaType === incoming_schemaType)) {
2077
+ return false;
2078
+ }
2079
+ const existing_schemaValidation = existing.schemaValidation;
2080
+ const incoming_schemaValidation = incoming.schemaValidation;
2081
+ const equals_schemaValidation_items = equalsArray(existing_schemaValidation, incoming_schemaValidation, (existing_schemaValidation_item, incoming_schemaValidation_item) => {
2082
+ if (!(equals$1(existing_schemaValidation_item, incoming_schemaValidation_item))) {
2083
+ return false;
2084
+ }
2085
+ });
2086
+ if (equals_schemaValidation_items === false) {
2087
+ return false;
2088
+ }
2089
+ return true;
2090
+ }
2091
+ const ingest = function SchemaValidationOutputRepresentationIngest(input, path, luvio, store, timestamp) {
2092
+ if (process.env.NODE_ENV !== 'production') {
2093
+ const validateError = validate(input);
2094
+ if (validateError !== null) {
2095
+ throw validateError;
2096
+ }
2097
+ }
2098
+ const key = keyBuilderFromType(luvio, input);
2099
+ const existingRecord = store.readEntry(key);
2100
+ const ttlToUse = path.ttl !== undefined ? path.ttl : 300000;
2101
+ let incomingRecord = normalize(input, store.readEntry(key), {
2102
+ fullPath: key,
2103
+ parent: path.parent,
2104
+ propertyName: path.propertyName,
2105
+ ttl: ttlToUse
2106
+ });
2107
+ if (existingRecord === undefined || equals(existingRecord, incomingRecord) === false) {
2108
+ luvio.storePublish(key, incomingRecord);
2109
+ }
2110
+ if (ttlToUse !== undefined) {
2111
+ const storeMetadataParams = {
2112
+ ttl: ttlToUse,
2113
+ namespace: "external-services",
2114
+ version: VERSION,
2115
+ representationName: RepresentationType,
2116
+ };
2117
+ luvio.publishStoreMetadata(key, storeMetadataParams);
2118
+ }
2119
+ return createLink(key);
2120
+ };
2121
+ function getTypeCacheKeys(luvio, input, fullPathFactory) {
2122
+ const rootKeySet = new StoreKeyMap();
2123
+ // root cache key (uses fullPathFactory if keyBuilderFromType isn't defined)
2124
+ const rootKey = keyBuilderFromType(luvio, input);
2125
+ rootKeySet.set(rootKey, {
2126
+ namespace: keyPrefix,
2127
+ representationName: RepresentationType,
2128
+ mergeable: false
2129
+ });
2130
+ return rootKeySet;
2131
2131
  }
2132
2132
 
2133
- function select(luvio, params) {
2134
- return select$1();
2135
- }
2136
- function getResponseCacheKeys(luvio, resourceParams, response) {
2137
- return getTypeCacheKeys(luvio, response);
2138
- }
2139
- function ingestSuccess(luvio, resourceParams, response) {
2140
- const { body } = response;
2141
- const key = keyBuilderFromType(luvio, body);
2142
- luvio.storeIngest(key, ingest, body);
2143
- const snapshot = luvio.storeLookup({
2144
- recordId: key,
2145
- node: select(),
2146
- variables: {},
2147
- });
2148
- if (process.env.NODE_ENV !== 'production') {
2149
- if (snapshot.state !== 'Fulfilled') {
2150
- throw new Error('Invalid network response. Expected resource response to result in Fulfilled snapshot');
2151
- }
2152
- }
2153
- return snapshot;
2154
- }
2155
- function createResourceRequest(config) {
2156
- const headers = {};
2157
- return {
2158
- baseUri: '/services/data/v58.0',
2159
- basePath: '/externalservices/schemas/' + config.urlParams.schemaName + '/validation',
2160
- method: 'post',
2161
- body: config.body,
2162
- urlParams: config.urlParams,
2163
- queryParams: {},
2164
- headers,
2165
- priority: 'normal',
2166
- };
2133
+ function select(luvio, params) {
2134
+ return select$1();
2135
+ }
2136
+ function getResponseCacheKeys(luvio, resourceParams, response) {
2137
+ return getTypeCacheKeys(luvio, response);
2138
+ }
2139
+ function ingestSuccess(luvio, resourceParams, response) {
2140
+ const { body } = response;
2141
+ const key = keyBuilderFromType(luvio, body);
2142
+ luvio.storeIngest(key, ingest, body);
2143
+ const snapshot = luvio.storeLookup({
2144
+ recordId: key,
2145
+ node: select(),
2146
+ variables: {},
2147
+ });
2148
+ if (process.env.NODE_ENV !== 'production') {
2149
+ if (snapshot.state !== 'Fulfilled') {
2150
+ throw new Error('Invalid network response. Expected resource response to result in Fulfilled snapshot');
2151
+ }
2152
+ }
2153
+ return snapshot;
2154
+ }
2155
+ function createResourceRequest(config) {
2156
+ const headers = {};
2157
+ return {
2158
+ baseUri: '/services/data/v58.0',
2159
+ basePath: '/externalservices/schemas/' + config.urlParams.schemaName + '/validation',
2160
+ method: 'post',
2161
+ body: config.body,
2162
+ urlParams: config.urlParams,
2163
+ queryParams: {},
2164
+ headers,
2165
+ priority: 'normal',
2166
+ };
2167
2167
  }
2168
2168
 
2169
- const validateSchema_ConfigPropertyNames = {
2170
- displayName: 'validateSchema',
2171
- parameters: {
2172
- required: ['schemaName', 'schema'],
2173
- optional: []
2174
- }
2175
- };
2176
- function createResourceParams(config) {
2177
- const resourceParams = {
2178
- urlParams: {
2179
- schemaName: config.schemaName
2180
- },
2181
- body: {
2182
- schema: config.schema
2183
- }
2184
- };
2185
- return resourceParams;
2186
- }
2187
- function typeCheckConfig(untrustedConfig) {
2188
- const config = {};
2189
- const untrustedConfig_schemaName = untrustedConfig.schemaName;
2190
- if (typeof untrustedConfig_schemaName === 'string') {
2191
- config.schemaName = untrustedConfig_schemaName;
2192
- }
2193
- const untrustedConfig_schema = untrustedConfig.schema;
2194
- const referenceSchemaValidationInputRepresentationValidationError = validate$2(untrustedConfig_schema);
2195
- if (referenceSchemaValidationInputRepresentationValidationError === null) {
2196
- config.schema = untrustedConfig_schema;
2197
- }
2198
- return config;
2199
- }
2200
- function validateAdapterConfig(untrustedConfig, configPropertyNames) {
2201
- if (!untrustedIsObject(untrustedConfig)) {
2202
- return null;
2203
- }
2204
- if (process.env.NODE_ENV !== 'production') {
2205
- validateConfig(untrustedConfig, configPropertyNames);
2206
- }
2207
- const config = typeCheckConfig(untrustedConfig);
2208
- if (!areRequiredParametersPresent(config, configPropertyNames)) {
2209
- return null;
2210
- }
2211
- return config;
2212
- }
2213
- function buildNetworkSnapshot(luvio, config, options) {
2214
- const resourceParams = createResourceParams(config);
2215
- const request = createResourceRequest(resourceParams);
2216
- return luvio.dispatchResourceRequest(request, options)
2217
- .then((response) => {
2218
- return luvio.handleSuccessResponse(() => {
2219
- const snapshot = ingestSuccess(luvio, resourceParams, response);
2220
- return luvio.storeBroadcast().then(() => snapshot);
2221
- }, () => getResponseCacheKeys(luvio, resourceParams, response.body));
2222
- }, (response) => {
2223
- deepFreeze$2(response);
2224
- throw response;
2225
- });
2226
- }
2227
- const validateSchemaAdapterFactory = (luvio) => {
2228
- return function validateSchema(untrustedConfig) {
2229
- const config = validateAdapterConfig(untrustedConfig, validateSchema_ConfigPropertyNames);
2230
- // Invalid or incomplete config
2231
- if (config === null) {
2232
- throw new Error('Invalid config for "validateSchema"');
2233
- }
2234
- return buildNetworkSnapshot(luvio, config);
2235
- };
2169
+ const validateSchema_ConfigPropertyNames = {
2170
+ displayName: 'validateSchema',
2171
+ parameters: {
2172
+ required: ['schemaName', 'schema'],
2173
+ optional: []
2174
+ }
2175
+ };
2176
+ function createResourceParams(config) {
2177
+ const resourceParams = {
2178
+ urlParams: {
2179
+ schemaName: config.schemaName
2180
+ },
2181
+ body: {
2182
+ schema: config.schema
2183
+ }
2184
+ };
2185
+ return resourceParams;
2186
+ }
2187
+ function typeCheckConfig(untrustedConfig) {
2188
+ const config = {};
2189
+ const untrustedConfig_schemaName = untrustedConfig.schemaName;
2190
+ if (typeof untrustedConfig_schemaName === 'string') {
2191
+ config.schemaName = untrustedConfig_schemaName;
2192
+ }
2193
+ const untrustedConfig_schema = untrustedConfig.schema;
2194
+ const referenceSchemaValidationInputRepresentationValidationError = validate$2(untrustedConfig_schema);
2195
+ if (referenceSchemaValidationInputRepresentationValidationError === null) {
2196
+ config.schema = untrustedConfig_schema;
2197
+ }
2198
+ return config;
2199
+ }
2200
+ function validateAdapterConfig(untrustedConfig, configPropertyNames) {
2201
+ if (!untrustedIsObject(untrustedConfig)) {
2202
+ return null;
2203
+ }
2204
+ if (process.env.NODE_ENV !== 'production') {
2205
+ validateConfig(untrustedConfig, configPropertyNames);
2206
+ }
2207
+ const config = typeCheckConfig(untrustedConfig);
2208
+ if (!areRequiredParametersPresent(config, configPropertyNames)) {
2209
+ return null;
2210
+ }
2211
+ return config;
2212
+ }
2213
+ function buildNetworkSnapshot(luvio, config, options) {
2214
+ const resourceParams = createResourceParams(config);
2215
+ const request = createResourceRequest(resourceParams);
2216
+ return luvio.dispatchResourceRequest(request, options)
2217
+ .then((response) => {
2218
+ return luvio.handleSuccessResponse(() => {
2219
+ const snapshot = ingestSuccess(luvio, resourceParams, response);
2220
+ return luvio.storeBroadcast().then(() => snapshot);
2221
+ }, () => getResponseCacheKeys(luvio, resourceParams, response.body));
2222
+ }, (response) => {
2223
+ deepFreeze$2(response);
2224
+ throw response;
2225
+ });
2226
+ }
2227
+ const validateSchemaAdapterFactory = (luvio) => {
2228
+ return function validateSchema(untrustedConfig) {
2229
+ const config = validateAdapterConfig(untrustedConfig, validateSchema_ConfigPropertyNames);
2230
+ // Invalid or incomplete config
2231
+ if (config === null) {
2232
+ throw new Error('Invalid config for "validateSchema"');
2233
+ }
2234
+ return buildNetworkSnapshot(luvio, config);
2235
+ };
2236
2236
  };
2237
2237
 
2238
- let getDataShape;
2239
- let getOpenApiSpec;
2240
- let getStatistics;
2241
- let getStatisticsForService;
2242
- let validateSchema;
2243
- // Imperative GET Adapters
2244
- let getDataShape_imperative;
2245
- let getOpenApiSpec_imperative;
2246
- let getStatistics_imperative;
2247
- let getStatisticsForService_imperative;
2248
- // Adapter Metadata
2249
- const getDataShapeMetadata = { apiFamily: 'externalservices', name: 'getDataShape' };
2250
- const getOpenApiSpecMetadata = { apiFamily: 'externalservices', name: 'getOpenApiSpec', ttl: 500 };
2251
- const getStatisticsMetadata = { apiFamily: 'externalservices', name: 'getStatistics' };
2252
- const getStatisticsForServiceMetadata = { apiFamily: 'externalservices', name: 'getStatisticsForService' };
2253
- function bindExportsTo(luvio) {
2254
- // LDS Adapters
2255
- const getDataShape_ldsAdapter = createInstrumentedAdapter(createLDSAdapter(luvio, 'getDataShape', getDataShapeAdapterFactory), getDataShapeMetadata);
2256
- const getOpenApiSpec_ldsAdapter = createInstrumentedAdapter(createLDSAdapter(luvio, 'getOpenApiSpec', getOpenApiSpecAdapterFactory), getOpenApiSpecMetadata);
2257
- const getStatistics_ldsAdapter = createInstrumentedAdapter(createLDSAdapter(luvio, 'getStatistics', getStatisticsAdapterFactory), getStatisticsMetadata);
2258
- const getStatisticsForService_ldsAdapter = createInstrumentedAdapter(createLDSAdapter(luvio, 'getStatisticsForService', getStatisticsForServiceAdapterFactory), getStatisticsForServiceMetadata);
2259
- function unwrapSnapshotData(factory) {
2260
- const adapter = factory(luvio);
2261
- return (config) => adapter(config).then(snapshot => snapshot.data);
2262
- }
2263
- return {
2264
- getDataShape: createWireAdapterConstructor(luvio, getDataShape_ldsAdapter, getDataShapeMetadata),
2265
- getOpenApiSpec: createWireAdapterConstructor(luvio, getOpenApiSpec_ldsAdapter, getOpenApiSpecMetadata),
2266
- getStatistics: createWireAdapterConstructor(luvio, getStatistics_ldsAdapter, getStatisticsMetadata),
2267
- getStatisticsForService: createWireAdapterConstructor(luvio, getStatisticsForService_ldsAdapter, getStatisticsForServiceMetadata),
2268
- validateSchema: unwrapSnapshotData(validateSchemaAdapterFactory),
2269
- // Imperative GET Adapters
2270
- getDataShape_imperative: createImperativeAdapter(luvio, getDataShape_ldsAdapter, getDataShapeMetadata),
2271
- getOpenApiSpec_imperative: createImperativeAdapter(luvio, getOpenApiSpec_ldsAdapter, getOpenApiSpecMetadata),
2272
- getStatistics_imperative: createImperativeAdapter(luvio, getStatistics_ldsAdapter, getStatisticsMetadata),
2273
- getStatisticsForService_imperative: createImperativeAdapter(luvio, getStatisticsForService_ldsAdapter, getStatisticsForServiceMetadata)
2274
- };
2275
- }
2276
- withDefaultLuvio((luvio) => {
2277
- ({
2278
- getDataShape,
2279
- getOpenApiSpec,
2280
- getStatistics,
2281
- getStatisticsForService,
2282
- validateSchema,
2283
- getDataShape_imperative,
2284
- getOpenApiSpec_imperative,
2285
- getStatistics_imperative,
2286
- getStatisticsForService_imperative
2287
- } = bindExportsTo(luvio));
2238
+ let getDataShape;
2239
+ let getOpenApiSpec;
2240
+ let getStatistics;
2241
+ let getStatisticsForService;
2242
+ let validateSchema;
2243
+ // Imperative GET Adapters
2244
+ let getDataShape_imperative;
2245
+ let getOpenApiSpec_imperative;
2246
+ let getStatistics_imperative;
2247
+ let getStatisticsForService_imperative;
2248
+ // Adapter Metadata
2249
+ const getDataShapeMetadata = { apiFamily: 'externalservices', name: 'getDataShape' };
2250
+ const getOpenApiSpecMetadata = { apiFamily: 'externalservices', name: 'getOpenApiSpec', ttl: 500 };
2251
+ const getStatisticsMetadata = { apiFamily: 'externalservices', name: 'getStatistics' };
2252
+ const getStatisticsForServiceMetadata = { apiFamily: 'externalservices', name: 'getStatisticsForService' };
2253
+ function bindExportsTo(luvio) {
2254
+ // LDS Adapters
2255
+ const getDataShape_ldsAdapter = createInstrumentedAdapter(createLDSAdapter(luvio, 'getDataShape', getDataShapeAdapterFactory), getDataShapeMetadata);
2256
+ const getOpenApiSpec_ldsAdapter = createInstrumentedAdapter(createLDSAdapter(luvio, 'getOpenApiSpec', getOpenApiSpecAdapterFactory), getOpenApiSpecMetadata);
2257
+ const getStatistics_ldsAdapter = createInstrumentedAdapter(createLDSAdapter(luvio, 'getStatistics', getStatisticsAdapterFactory), getStatisticsMetadata);
2258
+ const getStatisticsForService_ldsAdapter = createInstrumentedAdapter(createLDSAdapter(luvio, 'getStatisticsForService', getStatisticsForServiceAdapterFactory), getStatisticsForServiceMetadata);
2259
+ function unwrapSnapshotData(factory) {
2260
+ const adapter = factory(luvio);
2261
+ return (config) => adapter(config).then(snapshot => snapshot.data);
2262
+ }
2263
+ return {
2264
+ getDataShape: createWireAdapterConstructor(luvio, getDataShape_ldsAdapter, getDataShapeMetadata),
2265
+ getOpenApiSpec: createWireAdapterConstructor(luvio, getOpenApiSpec_ldsAdapter, getOpenApiSpecMetadata),
2266
+ getStatistics: createWireAdapterConstructor(luvio, getStatistics_ldsAdapter, getStatisticsMetadata),
2267
+ getStatisticsForService: createWireAdapterConstructor(luvio, getStatisticsForService_ldsAdapter, getStatisticsForServiceMetadata),
2268
+ validateSchema: unwrapSnapshotData(validateSchemaAdapterFactory),
2269
+ // Imperative GET Adapters
2270
+ getDataShape_imperative: createImperativeAdapter(luvio, getDataShape_ldsAdapter, getDataShapeMetadata),
2271
+ getOpenApiSpec_imperative: createImperativeAdapter(luvio, getOpenApiSpec_ldsAdapter, getOpenApiSpecMetadata),
2272
+ getStatistics_imperative: createImperativeAdapter(luvio, getStatistics_ldsAdapter, getStatisticsMetadata),
2273
+ getStatisticsForService_imperative: createImperativeAdapter(luvio, getStatisticsForService_ldsAdapter, getStatisticsForServiceMetadata)
2274
+ };
2275
+ }
2276
+ withDefaultLuvio((luvio) => {
2277
+ ({
2278
+ getDataShape,
2279
+ getOpenApiSpec,
2280
+ getStatistics,
2281
+ getStatisticsForService,
2282
+ validateSchema,
2283
+ getDataShape_imperative,
2284
+ getOpenApiSpec_imperative,
2285
+ getStatistics_imperative,
2286
+ getStatisticsForService_imperative
2287
+ } = bindExportsTo(luvio));
2288
2288
  });
2289
2289
 
2290
2290
  export { getDataShape, getDataShape_imperative, getOpenApiSpec, getOpenApiSpec_imperative, getStatistics, getStatisticsForService, getStatisticsForService_imperative, getStatistics_imperative, validateSchema };
2291
- // version: 1.124.2-4dc3034f1
2291
+ // version: 1.124.4-fc08995da