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