@salesforce/lds-adapters-platform-external-services 0.1.0-dev1
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 +2748 -0
- package/dist/es/es2018/types/src/generated/adapters/adapter-utils.d.ts +62 -0
- package/dist/es/es2018/types/src/generated/adapters/getActionDetailsForService.d.ts +27 -0
- package/dist/es/es2018/types/src/generated/adapters/getDataShape.d.ts +29 -0
- package/dist/es/es2018/types/src/generated/adapters/getOpenApiSpec.d.ts +29 -0
- package/dist/es/es2018/types/src/generated/adapters/getStatistics.d.ts +26 -0
- package/dist/es/es2018/types/src/generated/adapters/getStatisticsForService.d.ts +27 -0
- package/dist/es/es2018/types/src/generated/adapters/sendTestConnectionRequest.d.ts +29 -0
- package/dist/es/es2018/types/src/generated/adapters/validateSchema.d.ts +17 -0
- package/dist/es/es2018/types/src/generated/artifacts/main.d.ts +7 -0
- package/dist/es/es2018/types/src/generated/artifacts/sfdc.d.ts +14 -0
- package/dist/es/es2018/types/src/generated/resources/getExternalservicesActionsServicesByActionName.d.ts +15 -0
- package/dist/es/es2018/types/src/generated/resources/getExternalservicesExternalserviceschemarequest.d.ts +17 -0
- package/dist/es/es2018/types/src/generated/resources/getExternalservicesStatisticsServices.d.ts +12 -0
- package/dist/es/es2018/types/src/generated/resources/getExternalservicesStatisticsServicesByRegistrationName.d.ts +15 -0
- package/dist/es/es2018/types/src/generated/resources/postExternalservicesInferenceDatashapeByVersion.d.ts +19 -0
- package/dist/es/es2018/types/src/generated/resources/postExternalservicesInferenceDatashapeSendrequestByVersion.d.ts +19 -0
- package/dist/es/es2018/types/src/generated/resources/postExternalservicesInferenceOpenapispecByVersion.d.ts +19 -0
- package/dist/es/es2018/types/src/generated/resources/postExternalservicesSchemasValidationBySchemaName.d.ts +16 -0
- package/dist/es/es2018/types/src/generated/types/ApiInfoRepresentation.d.ts +37 -0
- package/dist/es/es2018/types/src/generated/types/ApiListRepresentation.d.ts +29 -0
- package/dist/es/es2018/types/src/generated/types/ApiSchemaRepresentation.d.ts +28 -0
- package/dist/es/es2018/types/src/generated/types/DataShapeInferenceOutputRepresentation.d.ts +48 -0
- package/dist/es/es2018/types/src/generated/types/ExternalServiceActionOutputRepresentation.d.ts +41 -0
- package/dist/es/es2018/types/src/generated/types/ExternalServiceActionParameterRepresentation.d.ts +37 -0
- package/dist/es/es2018/types/src/generated/types/ExternalServiceSchemaRequestRepresentation.d.ts +31 -0
- package/dist/es/es2018/types/src/generated/types/ExternalServiceStatisticsBreakdownRepresentation.d.ts +43 -0
- package/dist/es/es2018/types/src/generated/types/ExternalServiceStatisticsForServiceRepresentation.d.ts +41 -0
- package/dist/es/es2018/types/src/generated/types/ExternalServiceStatisticsOutputRepresentation.d.ts +36 -0
- package/dist/es/es2018/types/src/generated/types/ExternalServiceStatisticsOverviewRepresentation.d.ts +34 -0
- package/dist/es/es2018/types/src/generated/types/InferenceErrorMessageRepresentation.d.ts +31 -0
- package/dist/es/es2018/types/src/generated/types/NamedCredentialListRepresentation.d.ts +29 -0
- package/dist/es/es2018/types/src/generated/types/NamedCredentialRepresentation.d.ts +34 -0
- package/dist/es/es2018/types/src/generated/types/OpenApiSpecInferenceInputRepresentation.d.ts +56 -0
- package/dist/es/es2018/types/src/generated/types/OpenApiSpecInferenceInputWrapperRepresentation.d.ts +28 -0
- package/dist/es/es2018/types/src/generated/types/OpenApiSpecInferenceOutputRepresentation.d.ts +36 -0
- package/dist/es/es2018/types/src/generated/types/OpenApiSpecInferenceParameterRepresentation.d.ts +43 -0
- package/dist/es/es2018/types/src/generated/types/SchemaValidationInputRepresentation.d.ts +34 -0
- package/dist/es/es2018/types/src/generated/types/SchemaValidationInputWrapperRepresentation.d.ts +28 -0
- package/dist/es/es2018/types/src/generated/types/SchemaValidationMessageRepresentation.d.ts +52 -0
- package/dist/es/es2018/types/src/generated/types/SchemaValidationOutputRepresentation.d.ts +50 -0
- package/dist/es/es2018/types/src/generated/types/TestConnectionInputRepresentation.d.ts +44 -0
- package/dist/es/es2018/types/src/generated/types/TestConnectionInputWrapperRepresentation.d.ts +28 -0
- package/dist/es/es2018/types/src/generated/types/TestConnectionOutputRepresentation.d.ts +40 -0
- package/dist/es/es2018/types/src/generated/types/type-utils.d.ts +32 -0
- package/dist/es/es2018/types/src/main.d.ts +6 -0
- package/dist/es/es2018/types/src/raml-artifacts/types/ExternalServiceStatisticsOutputRepresentation/notifyUpdateAvailableFactory.d.ts +2 -0
- package/dist/es/es2018/types/src/sfdc.d.ts +7 -0
- package/package.json +76 -0
- package/sfdc/index.d.ts +1 -0
- package/sfdc/index.js +2856 -0
- package/src/raml/api.raml +615 -0
- package/src/raml/luvio.raml +55 -0
package/sfdc/index.js
ADDED
|
@@ -0,0 +1,2856 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Copyright (c) 2022, Salesforce, Inc.,
|
|
3
|
+
* All rights reserved.
|
|
4
|
+
* For full license text, see the LICENSE.txt file
|
|
5
|
+
*/
|
|
6
|
+
|
|
7
|
+
/*
|
|
8
|
+
* ATTENTION!
|
|
9
|
+
* THIS IS A GENERATED FILE FROM https://github.com/salesforce-experience-platform-emu/lds-lightning-platform
|
|
10
|
+
* If you would like to contribute to LDS, please follow the steps outlined in the git repo.
|
|
11
|
+
* Any changes made to this file in p4 will be automatically overwritten.
|
|
12
|
+
* *******************************************************************************************
|
|
13
|
+
*/
|
|
14
|
+
/* proxy-compat-disable */
|
|
15
|
+
import { createInstrumentedAdapter, createLDSAdapter, createWireAdapterConstructor, createImperativeAdapter } from 'force/ldsBindings';
|
|
16
|
+
import { withDefaultLuvio } from 'force/ldsEngine';
|
|
17
|
+
import { serializeStructuredKey, ingestShape, deepFreeze, buildNetworkSnapshotCachePolicy as buildNetworkSnapshotCachePolicy$6, typeCheckConfig as typeCheckConfig$7, StoreKeyMap, createResourceParams as createResourceParams$7 } from 'force/luvioEngine';
|
|
18
|
+
|
|
19
|
+
const { hasOwnProperty: ObjectPrototypeHasOwnProperty } = Object.prototype;
|
|
20
|
+
const { keys: ObjectKeys$1, create: ObjectCreate$1 } = Object;
|
|
21
|
+
const { stringify: JSONStringify$1 } = JSON;
|
|
22
|
+
const { isArray: ArrayIsArray$1 } = Array;
|
|
23
|
+
/**
|
|
24
|
+
* Validates an adapter config is well-formed.
|
|
25
|
+
* @param config The config to validate.
|
|
26
|
+
* @param adapter The adapter validation configuration.
|
|
27
|
+
* @param oneOf The keys the config must contain at least one of.
|
|
28
|
+
* @throws A TypeError if config doesn't satisfy the adapter's config validation.
|
|
29
|
+
*/
|
|
30
|
+
function validateConfig(config, adapter, oneOf) {
|
|
31
|
+
const { displayName } = adapter;
|
|
32
|
+
const { required, optional, unsupported } = adapter.parameters;
|
|
33
|
+
if (config === undefined ||
|
|
34
|
+
required.every(req => ObjectPrototypeHasOwnProperty.call(config, req)) === false) {
|
|
35
|
+
throw new TypeError(`adapter ${displayName} configuration must specify ${required.sort().join(', ')}`);
|
|
36
|
+
}
|
|
37
|
+
if (oneOf && oneOf.some(req => ObjectPrototypeHasOwnProperty.call(config, req)) === false) {
|
|
38
|
+
throw new TypeError(`adapter ${displayName} configuration must specify one of ${oneOf.sort().join(', ')}`);
|
|
39
|
+
}
|
|
40
|
+
if (unsupported !== undefined &&
|
|
41
|
+
unsupported.some(req => ObjectPrototypeHasOwnProperty.call(config, req))) {
|
|
42
|
+
throw new TypeError(`adapter ${displayName} does not yet support ${unsupported.sort().join(', ')}`);
|
|
43
|
+
}
|
|
44
|
+
const supported = required.concat(optional);
|
|
45
|
+
if (ObjectKeys$1(config).some(key => !supported.includes(key))) {
|
|
46
|
+
throw new TypeError(`adapter ${displayName} configuration supports only ${supported.sort().join(', ')}`);
|
|
47
|
+
}
|
|
48
|
+
}
|
|
49
|
+
function untrustedIsObject(untrusted) {
|
|
50
|
+
return typeof untrusted === 'object' && untrusted !== null && ArrayIsArray$1(untrusted) === false;
|
|
51
|
+
}
|
|
52
|
+
function areRequiredParametersPresent(config, configPropertyNames) {
|
|
53
|
+
return configPropertyNames.parameters.required.every(req => req in config);
|
|
54
|
+
}
|
|
55
|
+
const snapshotRefreshOptions = {
|
|
56
|
+
overrides: {
|
|
57
|
+
headers: {
|
|
58
|
+
'Cache-Control': 'no-cache',
|
|
59
|
+
},
|
|
60
|
+
}
|
|
61
|
+
};
|
|
62
|
+
/**
|
|
63
|
+
* A deterministic JSON stringify implementation. Heavily adapted from https://github.com/epoberezkin/fast-json-stable-stringify.
|
|
64
|
+
* This is needed because insertion order for JSON.stringify(object) affects output:
|
|
65
|
+
* JSON.stringify({a: 1, b: 2})
|
|
66
|
+
* "{"a":1,"b":2}"
|
|
67
|
+
* JSON.stringify({b: 2, a: 1})
|
|
68
|
+
* "{"b":2,"a":1}"
|
|
69
|
+
* @param data Data to be JSON-stringified.
|
|
70
|
+
* @returns JSON.stringified value with consistent ordering of keys.
|
|
71
|
+
*/
|
|
72
|
+
function stableJSONStringify(node) {
|
|
73
|
+
// This is for Date values.
|
|
74
|
+
if (node && node.toJSON && typeof node.toJSON === 'function') {
|
|
75
|
+
// eslint-disable-next-line no-param-reassign
|
|
76
|
+
node = node.toJSON();
|
|
77
|
+
}
|
|
78
|
+
if (node === undefined) {
|
|
79
|
+
return;
|
|
80
|
+
}
|
|
81
|
+
if (typeof node === 'number') {
|
|
82
|
+
return isFinite(node) ? '' + node : 'null';
|
|
83
|
+
}
|
|
84
|
+
if (typeof node !== 'object') {
|
|
85
|
+
return JSONStringify$1(node);
|
|
86
|
+
}
|
|
87
|
+
let i;
|
|
88
|
+
let out;
|
|
89
|
+
if (ArrayIsArray$1(node)) {
|
|
90
|
+
out = '[';
|
|
91
|
+
for (i = 0; i < node.length; i++) {
|
|
92
|
+
if (i) {
|
|
93
|
+
out += ',';
|
|
94
|
+
}
|
|
95
|
+
out += stableJSONStringify(node[i]) || 'null';
|
|
96
|
+
}
|
|
97
|
+
return out + ']';
|
|
98
|
+
}
|
|
99
|
+
if (node === null) {
|
|
100
|
+
return 'null';
|
|
101
|
+
}
|
|
102
|
+
const keys = ObjectKeys$1(node).sort();
|
|
103
|
+
out = '';
|
|
104
|
+
for (i = 0; i < keys.length; i++) {
|
|
105
|
+
const key = keys[i];
|
|
106
|
+
const value = stableJSONStringify(node[key]);
|
|
107
|
+
if (!value) {
|
|
108
|
+
continue;
|
|
109
|
+
}
|
|
110
|
+
if (out) {
|
|
111
|
+
out += ',';
|
|
112
|
+
}
|
|
113
|
+
out += JSONStringify$1(key) + ':' + value;
|
|
114
|
+
}
|
|
115
|
+
return '{' + out + '}';
|
|
116
|
+
}
|
|
117
|
+
function generateParamConfigMetadata(name, required, resourceType, typeCheckShape, isArrayShape = false, coerceFn) {
|
|
118
|
+
return {
|
|
119
|
+
name,
|
|
120
|
+
required,
|
|
121
|
+
resourceType,
|
|
122
|
+
typeCheckShape,
|
|
123
|
+
isArrayShape,
|
|
124
|
+
coerceFn,
|
|
125
|
+
};
|
|
126
|
+
}
|
|
127
|
+
function buildAdapterValidationConfig(displayName, paramsMeta) {
|
|
128
|
+
const required = paramsMeta.filter(p => p.required).map(p => p.name);
|
|
129
|
+
const optional = paramsMeta.filter(p => !p.required).map(p => p.name);
|
|
130
|
+
return {
|
|
131
|
+
displayName,
|
|
132
|
+
parameters: {
|
|
133
|
+
required,
|
|
134
|
+
optional,
|
|
135
|
+
}
|
|
136
|
+
};
|
|
137
|
+
}
|
|
138
|
+
const keyPrefix = 'external-services';
|
|
139
|
+
|
|
140
|
+
const { keys: ObjectKeys, create: ObjectCreate, assign: ObjectAssign } = Object;
|
|
141
|
+
const { isArray: ArrayIsArray } = Array;
|
|
142
|
+
const { stringify: JSONStringify } = JSON;
|
|
143
|
+
function equalsArray(a, b, equalsItem) {
|
|
144
|
+
const aLength = a.length;
|
|
145
|
+
const bLength = b.length;
|
|
146
|
+
if (aLength !== bLength) {
|
|
147
|
+
return false;
|
|
148
|
+
}
|
|
149
|
+
for (let i = 0; i < aLength; i++) {
|
|
150
|
+
if (equalsItem(a[i], b[i]) === false) {
|
|
151
|
+
return false;
|
|
152
|
+
}
|
|
153
|
+
}
|
|
154
|
+
return true;
|
|
155
|
+
}
|
|
156
|
+
function createLink(ref) {
|
|
157
|
+
return {
|
|
158
|
+
__ref: serializeStructuredKey(ref),
|
|
159
|
+
};
|
|
160
|
+
}
|
|
161
|
+
|
|
162
|
+
const VERSION$b = "77afee4104970a3f44d1c478c16bd79c";
|
|
163
|
+
function validate$f(obj, path = 'ExternalServiceActionParameterRepresentation') {
|
|
164
|
+
const v_error = (() => {
|
|
165
|
+
if (typeof obj !== 'object' || ArrayIsArray(obj) || obj === null) {
|
|
166
|
+
return new TypeError('Expected "object" but received "' + typeof obj + '" (at "' + path + '")');
|
|
167
|
+
}
|
|
168
|
+
const obj_description = obj.description;
|
|
169
|
+
const path_description = path + '.description';
|
|
170
|
+
if (typeof obj_description !== 'string') {
|
|
171
|
+
return new TypeError('Expected "string" but received "' + typeof obj_description + '" (at "' + path_description + '")');
|
|
172
|
+
}
|
|
173
|
+
const obj_location = obj.location;
|
|
174
|
+
const path_location = path + '.location';
|
|
175
|
+
if (typeof obj_location !== 'string') {
|
|
176
|
+
return new TypeError('Expected "string" but received "' + typeof obj_location + '" (at "' + path_location + '")');
|
|
177
|
+
}
|
|
178
|
+
const obj_name = obj.name;
|
|
179
|
+
const path_name = path + '.name';
|
|
180
|
+
if (typeof obj_name !== 'string') {
|
|
181
|
+
return new TypeError('Expected "string" but received "' + typeof obj_name + '" (at "' + path_name + '")');
|
|
182
|
+
}
|
|
183
|
+
const obj_required = obj.required;
|
|
184
|
+
const path_required = path + '.required';
|
|
185
|
+
if (typeof obj_required !== 'boolean') {
|
|
186
|
+
return new TypeError('Expected "boolean" but received "' + typeof obj_required + '" (at "' + path_required + '")');
|
|
187
|
+
}
|
|
188
|
+
})();
|
|
189
|
+
return v_error === undefined ? null : v_error;
|
|
190
|
+
}
|
|
191
|
+
const select$i = function ExternalServiceActionParameterRepresentationSelect() {
|
|
192
|
+
return {
|
|
193
|
+
kind: 'Fragment',
|
|
194
|
+
version: VERSION$b,
|
|
195
|
+
private: [],
|
|
196
|
+
selections: [
|
|
197
|
+
{
|
|
198
|
+
name: 'description',
|
|
199
|
+
kind: 'Scalar'
|
|
200
|
+
},
|
|
201
|
+
{
|
|
202
|
+
name: 'location',
|
|
203
|
+
kind: 'Scalar'
|
|
204
|
+
},
|
|
205
|
+
{
|
|
206
|
+
name: 'name',
|
|
207
|
+
kind: 'Scalar'
|
|
208
|
+
},
|
|
209
|
+
{
|
|
210
|
+
name: 'required',
|
|
211
|
+
kind: 'Scalar'
|
|
212
|
+
}
|
|
213
|
+
]
|
|
214
|
+
};
|
|
215
|
+
};
|
|
216
|
+
function equals$b(existing, incoming) {
|
|
217
|
+
const existing_required = existing.required;
|
|
218
|
+
const incoming_required = incoming.required;
|
|
219
|
+
if (!(existing_required === incoming_required)) {
|
|
220
|
+
return false;
|
|
221
|
+
}
|
|
222
|
+
const existing_description = existing.description;
|
|
223
|
+
const incoming_description = incoming.description;
|
|
224
|
+
if (!(existing_description === incoming_description)) {
|
|
225
|
+
return false;
|
|
226
|
+
}
|
|
227
|
+
const existing_location = existing.location;
|
|
228
|
+
const incoming_location = incoming.location;
|
|
229
|
+
if (!(existing_location === incoming_location)) {
|
|
230
|
+
return false;
|
|
231
|
+
}
|
|
232
|
+
const existing_name = existing.name;
|
|
233
|
+
const incoming_name = incoming.name;
|
|
234
|
+
if (!(existing_name === incoming_name)) {
|
|
235
|
+
return false;
|
|
236
|
+
}
|
|
237
|
+
return true;
|
|
238
|
+
}
|
|
239
|
+
|
|
240
|
+
const VERSION$a = "4e90320a2a8521866935843772ace679";
|
|
241
|
+
function validate$e(obj, path = 'ExternalServiceActionOutputRepresentation') {
|
|
242
|
+
const v_error = (() => {
|
|
243
|
+
if (typeof obj !== 'object' || ArrayIsArray(obj) || obj === null) {
|
|
244
|
+
return new TypeError('Expected "object" but received "' + typeof obj + '" (at "' + path + '")');
|
|
245
|
+
}
|
|
246
|
+
const obj_externalServicePath = obj.externalServicePath;
|
|
247
|
+
const path_externalServicePath = path + '.externalServicePath';
|
|
248
|
+
if (typeof obj_externalServicePath !== 'string') {
|
|
249
|
+
return new TypeError('Expected "string" but received "' + typeof obj_externalServicePath + '" (at "' + path_externalServicePath + '")');
|
|
250
|
+
}
|
|
251
|
+
const obj_method = obj.method;
|
|
252
|
+
const path_method = path + '.method';
|
|
253
|
+
if (typeof obj_method !== 'string') {
|
|
254
|
+
return new TypeError('Expected "string" but received "' + typeof obj_method + '" (at "' + path_method + '")');
|
|
255
|
+
}
|
|
256
|
+
const obj_parameters = obj.parameters;
|
|
257
|
+
const path_parameters = path + '.parameters';
|
|
258
|
+
if (!ArrayIsArray(obj_parameters)) {
|
|
259
|
+
return new TypeError('Expected "array" but received "' + typeof obj_parameters + '" (at "' + path_parameters + '")');
|
|
260
|
+
}
|
|
261
|
+
for (let i = 0; i < obj_parameters.length; i++) {
|
|
262
|
+
const obj_parameters_item = obj_parameters[i];
|
|
263
|
+
const path_parameters_item = path_parameters + '[' + i + ']';
|
|
264
|
+
const referencepath_parameters_itemValidationError = validate$f(obj_parameters_item, path_parameters_item);
|
|
265
|
+
if (referencepath_parameters_itemValidationError !== null) {
|
|
266
|
+
let message = 'Object doesn\'t match ExternalServiceActionParameterRepresentation (at "' + path_parameters_item + '")\n';
|
|
267
|
+
message += referencepath_parameters_itemValidationError.message.split('\n').map((line) => '\t' + line).join('\n');
|
|
268
|
+
return new TypeError(message);
|
|
269
|
+
}
|
|
270
|
+
}
|
|
271
|
+
const obj_path = obj.path;
|
|
272
|
+
const path_path = path + '.path';
|
|
273
|
+
if (typeof obj_path !== 'string') {
|
|
274
|
+
return new TypeError('Expected "string" but received "' + typeof obj_path + '" (at "' + path_path + '")');
|
|
275
|
+
}
|
|
276
|
+
const obj_registrationName = obj.registrationName;
|
|
277
|
+
const path_registrationName = path + '.registrationName';
|
|
278
|
+
if (typeof obj_registrationName !== 'string') {
|
|
279
|
+
return new TypeError('Expected "string" but received "' + typeof obj_registrationName + '" (at "' + path_registrationName + '")');
|
|
280
|
+
}
|
|
281
|
+
})();
|
|
282
|
+
return v_error === undefined ? null : v_error;
|
|
283
|
+
}
|
|
284
|
+
const RepresentationType$5 = 'ExternalServiceActionOutputRepresentation';
|
|
285
|
+
function normalize$5(input, existing, path, luvio, store, timestamp) {
|
|
286
|
+
return input;
|
|
287
|
+
}
|
|
288
|
+
const select$h = function ExternalServiceActionOutputRepresentationSelect() {
|
|
289
|
+
const { selections: ExternalServiceActionParameterRepresentation__selections, opaque: ExternalServiceActionParameterRepresentation__opaque, } = select$i();
|
|
290
|
+
return {
|
|
291
|
+
kind: 'Fragment',
|
|
292
|
+
version: VERSION$a,
|
|
293
|
+
private: [],
|
|
294
|
+
selections: [
|
|
295
|
+
{
|
|
296
|
+
name: 'externalServicePath',
|
|
297
|
+
kind: 'Scalar'
|
|
298
|
+
},
|
|
299
|
+
{
|
|
300
|
+
name: 'method',
|
|
301
|
+
kind: 'Scalar'
|
|
302
|
+
},
|
|
303
|
+
{
|
|
304
|
+
name: 'parameters',
|
|
305
|
+
kind: 'Object',
|
|
306
|
+
plural: true,
|
|
307
|
+
selections: ExternalServiceActionParameterRepresentation__selections
|
|
308
|
+
},
|
|
309
|
+
{
|
|
310
|
+
name: 'path',
|
|
311
|
+
kind: 'Scalar'
|
|
312
|
+
},
|
|
313
|
+
{
|
|
314
|
+
name: 'registrationName',
|
|
315
|
+
kind: 'Scalar'
|
|
316
|
+
}
|
|
317
|
+
]
|
|
318
|
+
};
|
|
319
|
+
};
|
|
320
|
+
function equals$a(existing, incoming) {
|
|
321
|
+
const existing_externalServicePath = existing.externalServicePath;
|
|
322
|
+
const incoming_externalServicePath = incoming.externalServicePath;
|
|
323
|
+
if (!(existing_externalServicePath === incoming_externalServicePath)) {
|
|
324
|
+
return false;
|
|
325
|
+
}
|
|
326
|
+
const existing_method = existing.method;
|
|
327
|
+
const incoming_method = incoming.method;
|
|
328
|
+
if (!(existing_method === incoming_method)) {
|
|
329
|
+
return false;
|
|
330
|
+
}
|
|
331
|
+
const existing_path = existing.path;
|
|
332
|
+
const incoming_path = incoming.path;
|
|
333
|
+
if (!(existing_path === incoming_path)) {
|
|
334
|
+
return false;
|
|
335
|
+
}
|
|
336
|
+
const existing_registrationName = existing.registrationName;
|
|
337
|
+
const incoming_registrationName = incoming.registrationName;
|
|
338
|
+
if (!(existing_registrationName === incoming_registrationName)) {
|
|
339
|
+
return false;
|
|
340
|
+
}
|
|
341
|
+
const existing_parameters = existing.parameters;
|
|
342
|
+
const incoming_parameters = incoming.parameters;
|
|
343
|
+
const equals_parameters_items = equalsArray(existing_parameters, incoming_parameters, (existing_parameters_item, incoming_parameters_item) => {
|
|
344
|
+
if (!(equals$b(existing_parameters_item, incoming_parameters_item))) {
|
|
345
|
+
return false;
|
|
346
|
+
}
|
|
347
|
+
});
|
|
348
|
+
if (equals_parameters_items === false) {
|
|
349
|
+
return false;
|
|
350
|
+
}
|
|
351
|
+
return true;
|
|
352
|
+
}
|
|
353
|
+
const ingest$5 = function ExternalServiceActionOutputRepresentationIngest(input, path, luvio, store, timestamp) {
|
|
354
|
+
if (process.env.NODE_ENV !== 'production') {
|
|
355
|
+
const validateError = validate$e(input);
|
|
356
|
+
if (validateError !== null) {
|
|
357
|
+
throw validateError;
|
|
358
|
+
}
|
|
359
|
+
}
|
|
360
|
+
const key = path.fullPath;
|
|
361
|
+
const ttlToUse = path.ttl !== undefined ? path.ttl : 300000;
|
|
362
|
+
ingestShape(input, path, luvio, store, timestamp, ttlToUse, key, normalize$5, "external-services", VERSION$a, RepresentationType$5, equals$a);
|
|
363
|
+
return createLink(key);
|
|
364
|
+
};
|
|
365
|
+
function getTypeCacheKeys$5(rootKeySet, luvio, input, fullPathFactory) {
|
|
366
|
+
// root cache key (uses fullPathFactory if keyBuilderFromType isn't defined)
|
|
367
|
+
const rootKey = fullPathFactory();
|
|
368
|
+
rootKeySet.set(rootKey, {
|
|
369
|
+
namespace: keyPrefix,
|
|
370
|
+
representationName: RepresentationType$5,
|
|
371
|
+
mergeable: false
|
|
372
|
+
});
|
|
373
|
+
}
|
|
374
|
+
|
|
375
|
+
function select$g(luvio, params) {
|
|
376
|
+
return select$h();
|
|
377
|
+
}
|
|
378
|
+
function keyBuilder$c(luvio, params) {
|
|
379
|
+
return keyPrefix + '::ExternalServiceActionOutputRepresentation:(' + 'actionName:' + params.urlParams.actionName + ')';
|
|
380
|
+
}
|
|
381
|
+
function getResponseCacheKeys$6(storeKeyMap, luvio, resourceParams, response) {
|
|
382
|
+
getTypeCacheKeys$5(storeKeyMap, luvio, response, () => keyBuilder$c(luvio, resourceParams));
|
|
383
|
+
}
|
|
384
|
+
function ingestSuccess$6(luvio, resourceParams, response, snapshotRefresh) {
|
|
385
|
+
const { body } = response;
|
|
386
|
+
const key = keyBuilder$c(luvio, resourceParams);
|
|
387
|
+
luvio.storeIngest(key, ingest$5, body);
|
|
388
|
+
const snapshot = luvio.storeLookup({
|
|
389
|
+
recordId: key,
|
|
390
|
+
node: select$g(),
|
|
391
|
+
variables: {},
|
|
392
|
+
}, snapshotRefresh);
|
|
393
|
+
if (process.env.NODE_ENV !== 'production') {
|
|
394
|
+
if (snapshot.state !== 'Fulfilled') {
|
|
395
|
+
throw new Error('Invalid network response. Expected resource response to result in Fulfilled snapshot');
|
|
396
|
+
}
|
|
397
|
+
}
|
|
398
|
+
deepFreeze(snapshot.data);
|
|
399
|
+
return snapshot;
|
|
400
|
+
}
|
|
401
|
+
function ingestError$5(luvio, params, error, snapshotRefresh) {
|
|
402
|
+
const key = keyBuilder$c(luvio, params);
|
|
403
|
+
const errorSnapshot = luvio.errorSnapshot(error, snapshotRefresh);
|
|
404
|
+
luvio.storeIngestError(key, errorSnapshot);
|
|
405
|
+
return errorSnapshot;
|
|
406
|
+
}
|
|
407
|
+
function createResourceRequest$6(config) {
|
|
408
|
+
const headers = {};
|
|
409
|
+
return {
|
|
410
|
+
baseUri: '/services/data/v66.0',
|
|
411
|
+
basePath: '/externalservices/actions/services/' + config.urlParams.actionName + '',
|
|
412
|
+
method: 'get',
|
|
413
|
+
body: null,
|
|
414
|
+
urlParams: config.urlParams,
|
|
415
|
+
queryParams: {},
|
|
416
|
+
headers,
|
|
417
|
+
priority: 'normal',
|
|
418
|
+
};
|
|
419
|
+
}
|
|
420
|
+
|
|
421
|
+
const adapterName$6 = 'getActionDetailsForService';
|
|
422
|
+
const getActionDetailsForService_ConfigPropertyMetadata = [
|
|
423
|
+
generateParamConfigMetadata('actionName', true, 0 /* UrlParameter */, 0 /* String */),
|
|
424
|
+
];
|
|
425
|
+
const getActionDetailsForService_ConfigPropertyNames = /*#__PURE__*/ buildAdapterValidationConfig(adapterName$6, getActionDetailsForService_ConfigPropertyMetadata);
|
|
426
|
+
const createResourceParams$6 = /*#__PURE__*/ createResourceParams$7(getActionDetailsForService_ConfigPropertyMetadata);
|
|
427
|
+
function keyBuilder$b(luvio, config) {
|
|
428
|
+
const resourceParams = createResourceParams$6(config);
|
|
429
|
+
return keyBuilder$c(luvio, resourceParams);
|
|
430
|
+
}
|
|
431
|
+
function typeCheckConfig$6(untrustedConfig) {
|
|
432
|
+
const config = {};
|
|
433
|
+
typeCheckConfig$7(untrustedConfig, config, getActionDetailsForService_ConfigPropertyMetadata);
|
|
434
|
+
return config;
|
|
435
|
+
}
|
|
436
|
+
function validateAdapterConfig$6(untrustedConfig, configPropertyNames) {
|
|
437
|
+
if (!untrustedIsObject(untrustedConfig)) {
|
|
438
|
+
return null;
|
|
439
|
+
}
|
|
440
|
+
if (process.env.NODE_ENV !== 'production') {
|
|
441
|
+
validateConfig(untrustedConfig, configPropertyNames);
|
|
442
|
+
}
|
|
443
|
+
const config = typeCheckConfig$6(untrustedConfig);
|
|
444
|
+
if (!areRequiredParametersPresent(config, configPropertyNames)) {
|
|
445
|
+
return null;
|
|
446
|
+
}
|
|
447
|
+
return config;
|
|
448
|
+
}
|
|
449
|
+
function adapterFragment$5(luvio, config) {
|
|
450
|
+
createResourceParams$6(config);
|
|
451
|
+
return select$g();
|
|
452
|
+
}
|
|
453
|
+
function onFetchResponseSuccess$5(luvio, config, resourceParams, response) {
|
|
454
|
+
const snapshot = ingestSuccess$6(luvio, resourceParams, response, {
|
|
455
|
+
config,
|
|
456
|
+
resolve: () => buildNetworkSnapshot$6(luvio, config, snapshotRefreshOptions)
|
|
457
|
+
});
|
|
458
|
+
return luvio.storeBroadcast().then(() => snapshot);
|
|
459
|
+
}
|
|
460
|
+
function onFetchResponseError$5(luvio, config, resourceParams, response) {
|
|
461
|
+
const snapshot = ingestError$5(luvio, resourceParams, response, {
|
|
462
|
+
config,
|
|
463
|
+
resolve: () => buildNetworkSnapshot$6(luvio, config, snapshotRefreshOptions)
|
|
464
|
+
});
|
|
465
|
+
return luvio.storeBroadcast().then(() => snapshot);
|
|
466
|
+
}
|
|
467
|
+
function buildNetworkSnapshot$6(luvio, config, options) {
|
|
468
|
+
const resourceParams = createResourceParams$6(config);
|
|
469
|
+
const request = createResourceRequest$6(resourceParams);
|
|
470
|
+
return luvio.dispatchResourceRequest(request, options)
|
|
471
|
+
.then((response) => {
|
|
472
|
+
return luvio.handleSuccessResponse(() => onFetchResponseSuccess$5(luvio, config, resourceParams, response), () => {
|
|
473
|
+
const cache = new StoreKeyMap();
|
|
474
|
+
getResponseCacheKeys$6(cache, luvio, resourceParams, response.body);
|
|
475
|
+
return cache;
|
|
476
|
+
});
|
|
477
|
+
}, (response) => {
|
|
478
|
+
return luvio.handleErrorResponse(() => onFetchResponseError$5(luvio, config, resourceParams, response));
|
|
479
|
+
});
|
|
480
|
+
}
|
|
481
|
+
function buildNetworkSnapshotCachePolicy$5(context, coercedAdapterRequestContext) {
|
|
482
|
+
return buildNetworkSnapshotCachePolicy$6(context, coercedAdapterRequestContext, buildNetworkSnapshot$6, undefined, false);
|
|
483
|
+
}
|
|
484
|
+
function buildCachedSnapshotCachePolicy$5(context, storeLookup) {
|
|
485
|
+
const { luvio, config } = context;
|
|
486
|
+
const selector = {
|
|
487
|
+
recordId: keyBuilder$b(luvio, config),
|
|
488
|
+
node: adapterFragment$5(luvio, config),
|
|
489
|
+
variables: {},
|
|
490
|
+
};
|
|
491
|
+
const cacheSnapshot = storeLookup(selector, {
|
|
492
|
+
config,
|
|
493
|
+
resolve: () => buildNetworkSnapshot$6(luvio, config, snapshotRefreshOptions)
|
|
494
|
+
});
|
|
495
|
+
return cacheSnapshot;
|
|
496
|
+
}
|
|
497
|
+
const getActionDetailsForServiceAdapterFactory = (luvio) => function externalServices__getActionDetailsForService(untrustedConfig, requestContext) {
|
|
498
|
+
const config = validateAdapterConfig$6(untrustedConfig, getActionDetailsForService_ConfigPropertyNames);
|
|
499
|
+
// Invalid or incomplete config
|
|
500
|
+
if (config === null) {
|
|
501
|
+
return null;
|
|
502
|
+
}
|
|
503
|
+
return luvio.applyCachePolicy((requestContext || {}), { config, luvio }, // BuildSnapshotContext
|
|
504
|
+
buildCachedSnapshotCachePolicy$5, buildNetworkSnapshotCachePolicy$5);
|
|
505
|
+
};
|
|
506
|
+
|
|
507
|
+
const VERSION$9 = "68601d043a553523b207d5fcc707e053";
|
|
508
|
+
function validate$d(obj, path = 'InferenceErrorMessageRepresentation') {
|
|
509
|
+
const v_error = (() => {
|
|
510
|
+
if (typeof obj !== 'object' || ArrayIsArray(obj) || obj === null) {
|
|
511
|
+
return new TypeError('Expected "object" but received "' + typeof obj + '" (at "' + path + '")');
|
|
512
|
+
}
|
|
513
|
+
const obj_message = obj.message;
|
|
514
|
+
const path_message = path + '.message';
|
|
515
|
+
if (typeof obj_message !== 'string') {
|
|
516
|
+
return new TypeError('Expected "string" but received "' + typeof obj_message + '" (at "' + path_message + '")');
|
|
517
|
+
}
|
|
518
|
+
const obj_severityLevel = obj.severityLevel;
|
|
519
|
+
const path_severityLevel = path + '.severityLevel';
|
|
520
|
+
if (typeof obj_severityLevel !== 'string') {
|
|
521
|
+
return new TypeError('Expected "string" but received "' + typeof obj_severityLevel + '" (at "' + path_severityLevel + '")');
|
|
522
|
+
}
|
|
523
|
+
})();
|
|
524
|
+
return v_error === undefined ? null : v_error;
|
|
525
|
+
}
|
|
526
|
+
const select$f = function InferenceErrorMessageRepresentationSelect() {
|
|
527
|
+
return {
|
|
528
|
+
kind: 'Fragment',
|
|
529
|
+
version: VERSION$9,
|
|
530
|
+
private: [],
|
|
531
|
+
selections: [
|
|
532
|
+
{
|
|
533
|
+
name: 'message',
|
|
534
|
+
kind: 'Scalar'
|
|
535
|
+
},
|
|
536
|
+
{
|
|
537
|
+
name: 'severityLevel',
|
|
538
|
+
kind: 'Scalar'
|
|
539
|
+
}
|
|
540
|
+
]
|
|
541
|
+
};
|
|
542
|
+
};
|
|
543
|
+
function equals$9(existing, incoming) {
|
|
544
|
+
const existing_message = existing.message;
|
|
545
|
+
const incoming_message = incoming.message;
|
|
546
|
+
if (!(existing_message === incoming_message)) {
|
|
547
|
+
return false;
|
|
548
|
+
}
|
|
549
|
+
const existing_severityLevel = existing.severityLevel;
|
|
550
|
+
const incoming_severityLevel = incoming.severityLevel;
|
|
551
|
+
if (!(existing_severityLevel === incoming_severityLevel)) {
|
|
552
|
+
return false;
|
|
553
|
+
}
|
|
554
|
+
return true;
|
|
555
|
+
}
|
|
556
|
+
|
|
557
|
+
const VERSION$8 = "d45a6a39072862479f5c25fe921c0926";
|
|
558
|
+
function validate$c(obj, path = 'DataShapeInferenceOutputRepresentation') {
|
|
559
|
+
const v_error = (() => {
|
|
560
|
+
if (typeof obj !== 'object' || ArrayIsArray(obj) || obj === null) {
|
|
561
|
+
return new TypeError('Expected "object" but received "' + typeof obj + '" (at "' + path + '")');
|
|
562
|
+
}
|
|
563
|
+
const obj_errorMessages = obj.errorMessages;
|
|
564
|
+
const path_errorMessages = path + '.errorMessages';
|
|
565
|
+
if (!ArrayIsArray(obj_errorMessages)) {
|
|
566
|
+
return new TypeError('Expected "array" but received "' + typeof obj_errorMessages + '" (at "' + path_errorMessages + '")');
|
|
567
|
+
}
|
|
568
|
+
for (let i = 0; i < obj_errorMessages.length; i++) {
|
|
569
|
+
const obj_errorMessages_item = obj_errorMessages[i];
|
|
570
|
+
const path_errorMessages_item = path_errorMessages + '[' + i + ']';
|
|
571
|
+
const referencepath_errorMessages_itemValidationError = validate$d(obj_errorMessages_item, path_errorMessages_item);
|
|
572
|
+
if (referencepath_errorMessages_itemValidationError !== null) {
|
|
573
|
+
let message = 'Object doesn\'t match InferenceErrorMessageRepresentation (at "' + path_errorMessages_item + '")\n';
|
|
574
|
+
message += referencepath_errorMessages_itemValidationError.message.split('\n').map((line) => '\t' + line).join('\n');
|
|
575
|
+
return new TypeError(message);
|
|
576
|
+
}
|
|
577
|
+
}
|
|
578
|
+
if (obj.example !== undefined) {
|
|
579
|
+
const obj_example = obj.example;
|
|
580
|
+
const path_example = path + '.example';
|
|
581
|
+
if (typeof obj_example !== 'string') {
|
|
582
|
+
return new TypeError('Expected "string" but received "' + typeof obj_example + '" (at "' + path_example + '")');
|
|
583
|
+
}
|
|
584
|
+
}
|
|
585
|
+
const obj_items = obj.items;
|
|
586
|
+
const path_items = path + '.items';
|
|
587
|
+
if (!ArrayIsArray(obj_items)) {
|
|
588
|
+
return new TypeError('Expected "array" but received "' + typeof obj_items + '" (at "' + path_items + '")');
|
|
589
|
+
}
|
|
590
|
+
for (let i = 0; i < obj_items.length; i++) {
|
|
591
|
+
const obj_items_item = obj_items[i];
|
|
592
|
+
const path_items_item = path_items + '[' + i + ']';
|
|
593
|
+
const referencepath_items_itemValidationError = validate$c(obj_items_item, path_items_item);
|
|
594
|
+
if (referencepath_items_itemValidationError !== null) {
|
|
595
|
+
let message = 'Object doesn\'t match DataShapeInferenceOutputRepresentation (at "' + path_items_item + '")\n';
|
|
596
|
+
message += referencepath_items_itemValidationError.message.split('\n').map((line) => '\t' + line).join('\n');
|
|
597
|
+
return new TypeError(message);
|
|
598
|
+
}
|
|
599
|
+
}
|
|
600
|
+
const obj_properties = obj.properties;
|
|
601
|
+
const path_properties = path + '.properties';
|
|
602
|
+
if (typeof obj_properties !== 'object' || ArrayIsArray(obj_properties) || obj_properties === null) {
|
|
603
|
+
return new TypeError('Expected "object" but received "' + typeof obj_properties + '" (at "' + path_properties + '")');
|
|
604
|
+
}
|
|
605
|
+
const obj_properties_keys = ObjectKeys(obj_properties);
|
|
606
|
+
for (let i = 0; i < obj_properties_keys.length; i++) {
|
|
607
|
+
const key = obj_properties_keys[i];
|
|
608
|
+
const obj_properties_prop = obj_properties[key];
|
|
609
|
+
const path_properties_prop = path_properties + '["' + key + '"]';
|
|
610
|
+
const referencepath_properties_propValidationError = validate$c(obj_properties_prop, path_properties_prop);
|
|
611
|
+
if (referencepath_properties_propValidationError !== null) {
|
|
612
|
+
let message = 'Object doesn\'t match DataShapeInferenceOutputRepresentation (at "' + path_properties_prop + '")\n';
|
|
613
|
+
message += referencepath_properties_propValidationError.message.split('\n').map((line) => '\t' + line).join('\n');
|
|
614
|
+
return new TypeError(message);
|
|
615
|
+
}
|
|
616
|
+
}
|
|
617
|
+
const obj_success = obj.success;
|
|
618
|
+
const path_success = path + '.success';
|
|
619
|
+
if (typeof obj_success !== 'boolean') {
|
|
620
|
+
return new TypeError('Expected "boolean" but received "' + typeof obj_success + '" (at "' + path_success + '")');
|
|
621
|
+
}
|
|
622
|
+
if (obj.type !== undefined) {
|
|
623
|
+
const obj_type = obj.type;
|
|
624
|
+
const path_type = path + '.type';
|
|
625
|
+
if (typeof obj_type !== 'string') {
|
|
626
|
+
return new TypeError('Expected "string" but received "' + typeof obj_type + '" (at "' + path_type + '")');
|
|
627
|
+
}
|
|
628
|
+
}
|
|
629
|
+
})();
|
|
630
|
+
return v_error === undefined ? null : v_error;
|
|
631
|
+
}
|
|
632
|
+
const RepresentationType$4 = 'DataShapeInferenceOutputRepresentation';
|
|
633
|
+
function normalize$4(input, existing, path, luvio, store, timestamp) {
|
|
634
|
+
return input;
|
|
635
|
+
}
|
|
636
|
+
const select$e = function DataShapeInferenceOutputRepresentationSelect() {
|
|
637
|
+
return {
|
|
638
|
+
kind: 'Fragment',
|
|
639
|
+
version: VERSION$8,
|
|
640
|
+
private: [],
|
|
641
|
+
opaque: true
|
|
642
|
+
};
|
|
643
|
+
};
|
|
644
|
+
function equals$8(existing, incoming) {
|
|
645
|
+
if (JSONStringify(incoming) !== JSONStringify(existing)) {
|
|
646
|
+
return false;
|
|
647
|
+
}
|
|
648
|
+
return true;
|
|
649
|
+
}
|
|
650
|
+
const ingest$4 = function DataShapeInferenceOutputRepresentationIngest(input, path, luvio, store, timestamp) {
|
|
651
|
+
if (process.env.NODE_ENV !== 'production') {
|
|
652
|
+
const validateError = validate$c(input);
|
|
653
|
+
if (validateError !== null) {
|
|
654
|
+
throw validateError;
|
|
655
|
+
}
|
|
656
|
+
}
|
|
657
|
+
const key = path.fullPath;
|
|
658
|
+
const ttlToUse = path.ttl !== undefined ? path.ttl : 300000;
|
|
659
|
+
ingestShape(input, path, luvio, store, timestamp, ttlToUse, key, normalize$4, "external-services", VERSION$8, RepresentationType$4, equals$8);
|
|
660
|
+
return createLink(key);
|
|
661
|
+
};
|
|
662
|
+
function getTypeCacheKeys$4(rootKeySet, luvio, input, fullPathFactory) {
|
|
663
|
+
// root cache key (uses fullPathFactory if keyBuilderFromType isn't defined)
|
|
664
|
+
const rootKey = fullPathFactory();
|
|
665
|
+
rootKeySet.set(rootKey, {
|
|
666
|
+
namespace: keyPrefix,
|
|
667
|
+
representationName: RepresentationType$4,
|
|
668
|
+
mergeable: false
|
|
669
|
+
});
|
|
670
|
+
}
|
|
671
|
+
|
|
672
|
+
function select$d(luvio, params) {
|
|
673
|
+
return select$e();
|
|
674
|
+
}
|
|
675
|
+
function keyBuilder$a(luvio, params) {
|
|
676
|
+
return keyPrefix + '::DataShapeInferenceOutputRepresentation:(' + 'exampleData:' + params.queryParams.exampleData + ',' + 'mediaType:' + params.queryParams.mediaType + ',' + 'version:' + params.urlParams.version + ')';
|
|
677
|
+
}
|
|
678
|
+
function getResponseCacheKeys$5(storeKeyMap, luvio, resourceParams, response) {
|
|
679
|
+
getTypeCacheKeys$4(storeKeyMap, luvio, response, () => keyBuilder$a(luvio, resourceParams));
|
|
680
|
+
}
|
|
681
|
+
function ingestSuccess$5(luvio, resourceParams, response, snapshotRefresh) {
|
|
682
|
+
const { body } = response;
|
|
683
|
+
const key = keyBuilder$a(luvio, resourceParams);
|
|
684
|
+
luvio.storeIngest(key, ingest$4, body);
|
|
685
|
+
const snapshot = luvio.storeLookup({
|
|
686
|
+
recordId: key,
|
|
687
|
+
node: select$d(),
|
|
688
|
+
variables: {},
|
|
689
|
+
}, snapshotRefresh);
|
|
690
|
+
if (process.env.NODE_ENV !== 'production') {
|
|
691
|
+
if (snapshot.state !== 'Fulfilled') {
|
|
692
|
+
throw new Error('Invalid network response. Expected resource response to result in Fulfilled snapshot');
|
|
693
|
+
}
|
|
694
|
+
}
|
|
695
|
+
deepFreeze(snapshot.data);
|
|
696
|
+
return snapshot;
|
|
697
|
+
}
|
|
698
|
+
function ingestError$4(luvio, params, error, snapshotRefresh) {
|
|
699
|
+
const key = keyBuilder$a(luvio, params);
|
|
700
|
+
const errorSnapshot = luvio.errorSnapshot(error, snapshotRefresh);
|
|
701
|
+
luvio.storeIngestError(key, errorSnapshot);
|
|
702
|
+
return errorSnapshot;
|
|
703
|
+
}
|
|
704
|
+
function createResourceRequest$5(config) {
|
|
705
|
+
const headers = {};
|
|
706
|
+
return {
|
|
707
|
+
baseUri: '/services/data/v66.0',
|
|
708
|
+
basePath: '/externalservices/inference/datashape/' + config.urlParams.version + '',
|
|
709
|
+
method: 'post',
|
|
710
|
+
body: null,
|
|
711
|
+
urlParams: config.urlParams,
|
|
712
|
+
queryParams: config.queryParams,
|
|
713
|
+
headers,
|
|
714
|
+
priority: 'normal',
|
|
715
|
+
};
|
|
716
|
+
}
|
|
717
|
+
|
|
718
|
+
const adapterName$5 = 'getDataShape';
|
|
719
|
+
const getDataShape_ConfigPropertyMetadata = [
|
|
720
|
+
generateParamConfigMetadata('version', true, 0 /* UrlParameter */, 0 /* String */),
|
|
721
|
+
generateParamConfigMetadata('exampleData', false, 1 /* QueryParameter */, 0 /* String */),
|
|
722
|
+
generateParamConfigMetadata('mediaType', false, 1 /* QueryParameter */, 0 /* String */),
|
|
723
|
+
];
|
|
724
|
+
const getDataShape_ConfigPropertyNames = /*#__PURE__*/ buildAdapterValidationConfig(adapterName$5, getDataShape_ConfigPropertyMetadata);
|
|
725
|
+
const createResourceParams$5 = /*#__PURE__*/ createResourceParams$7(getDataShape_ConfigPropertyMetadata);
|
|
726
|
+
function keyBuilder$9(luvio, config) {
|
|
727
|
+
const resourceParams = createResourceParams$5(config);
|
|
728
|
+
return keyBuilder$a(luvio, resourceParams);
|
|
729
|
+
}
|
|
730
|
+
function typeCheckConfig$5(untrustedConfig) {
|
|
731
|
+
const config = {};
|
|
732
|
+
typeCheckConfig$7(untrustedConfig, config, getDataShape_ConfigPropertyMetadata);
|
|
733
|
+
return config;
|
|
734
|
+
}
|
|
735
|
+
function validateAdapterConfig$5(untrustedConfig, configPropertyNames) {
|
|
736
|
+
if (!untrustedIsObject(untrustedConfig)) {
|
|
737
|
+
return null;
|
|
738
|
+
}
|
|
739
|
+
if (process.env.NODE_ENV !== 'production') {
|
|
740
|
+
validateConfig(untrustedConfig, configPropertyNames);
|
|
741
|
+
}
|
|
742
|
+
const config = typeCheckConfig$5(untrustedConfig);
|
|
743
|
+
if (!areRequiredParametersPresent(config, configPropertyNames)) {
|
|
744
|
+
return null;
|
|
745
|
+
}
|
|
746
|
+
return config;
|
|
747
|
+
}
|
|
748
|
+
function adapterFragment$4(luvio, config) {
|
|
749
|
+
createResourceParams$5(config);
|
|
750
|
+
return select$d();
|
|
751
|
+
}
|
|
752
|
+
function onFetchResponseSuccess$4(luvio, config, resourceParams, response) {
|
|
753
|
+
const snapshot = ingestSuccess$5(luvio, resourceParams, response, {
|
|
754
|
+
config,
|
|
755
|
+
resolve: () => buildNetworkSnapshot$5(luvio, config, snapshotRefreshOptions)
|
|
756
|
+
});
|
|
757
|
+
return luvio.storeBroadcast().then(() => snapshot);
|
|
758
|
+
}
|
|
759
|
+
function onFetchResponseError$4(luvio, config, resourceParams, response) {
|
|
760
|
+
const snapshot = ingestError$4(luvio, resourceParams, response, {
|
|
761
|
+
config,
|
|
762
|
+
resolve: () => buildNetworkSnapshot$5(luvio, config, snapshotRefreshOptions)
|
|
763
|
+
});
|
|
764
|
+
return luvio.storeBroadcast().then(() => snapshot);
|
|
765
|
+
}
|
|
766
|
+
function buildNetworkSnapshot$5(luvio, config, options) {
|
|
767
|
+
const resourceParams = createResourceParams$5(config);
|
|
768
|
+
const request = createResourceRequest$5(resourceParams);
|
|
769
|
+
return luvio.dispatchResourceRequest(request, options)
|
|
770
|
+
.then((response) => {
|
|
771
|
+
return luvio.handleSuccessResponse(() => onFetchResponseSuccess$4(luvio, config, resourceParams, response), () => {
|
|
772
|
+
const cache = new StoreKeyMap();
|
|
773
|
+
getResponseCacheKeys$5(cache, luvio, resourceParams, response.body);
|
|
774
|
+
return cache;
|
|
775
|
+
});
|
|
776
|
+
}, (response) => {
|
|
777
|
+
return luvio.handleErrorResponse(() => onFetchResponseError$4(luvio, config, resourceParams, response));
|
|
778
|
+
});
|
|
779
|
+
}
|
|
780
|
+
function buildNetworkSnapshotCachePolicy$4(context, coercedAdapterRequestContext) {
|
|
781
|
+
return buildNetworkSnapshotCachePolicy$6(context, coercedAdapterRequestContext, buildNetworkSnapshot$5, 'get', false);
|
|
782
|
+
}
|
|
783
|
+
function buildCachedSnapshotCachePolicy$4(context, storeLookup) {
|
|
784
|
+
const { luvio, config } = context;
|
|
785
|
+
const selector = {
|
|
786
|
+
recordId: keyBuilder$9(luvio, config),
|
|
787
|
+
node: adapterFragment$4(luvio, config),
|
|
788
|
+
variables: {},
|
|
789
|
+
};
|
|
790
|
+
const cacheSnapshot = storeLookup(selector, {
|
|
791
|
+
config,
|
|
792
|
+
resolve: () => buildNetworkSnapshot$5(luvio, config, snapshotRefreshOptions)
|
|
793
|
+
});
|
|
794
|
+
return cacheSnapshot;
|
|
795
|
+
}
|
|
796
|
+
const getDataShapeAdapterFactory = (luvio) => function externalServices__getDataShape(untrustedConfig, requestContext) {
|
|
797
|
+
const config = validateAdapterConfig$5(untrustedConfig, getDataShape_ConfigPropertyNames);
|
|
798
|
+
// Invalid or incomplete config
|
|
799
|
+
if (config === null) {
|
|
800
|
+
return null;
|
|
801
|
+
}
|
|
802
|
+
return luvio.applyCachePolicy((requestContext || {}), { config, luvio }, // BuildSnapshotContext
|
|
803
|
+
buildCachedSnapshotCachePolicy$4, buildNetworkSnapshotCachePolicy$4);
|
|
804
|
+
};
|
|
805
|
+
|
|
806
|
+
function validate$b(obj, path = 'OpenApiSpecInferenceParameterRepresentation') {
|
|
807
|
+
const v_error = (() => {
|
|
808
|
+
if (typeof obj !== 'object' || ArrayIsArray(obj) || obj === null) {
|
|
809
|
+
return new TypeError('Expected "object" but received "' + typeof obj + '" (at "' + path + '")');
|
|
810
|
+
}
|
|
811
|
+
if (obj.description !== undefined) {
|
|
812
|
+
const obj_description = obj.description;
|
|
813
|
+
const path_description = path + '.description';
|
|
814
|
+
if (typeof obj_description !== 'string') {
|
|
815
|
+
return new TypeError('Expected "string" but received "' + typeof obj_description + '" (at "' + path_description + '")');
|
|
816
|
+
}
|
|
817
|
+
}
|
|
818
|
+
if (obj.example !== undefined) {
|
|
819
|
+
const obj_example = obj.example;
|
|
820
|
+
const path_example = path + '.example';
|
|
821
|
+
if (typeof obj_example !== 'string') {
|
|
822
|
+
return new TypeError('Expected "string" but received "' + typeof obj_example + '" (at "' + path_example + '")');
|
|
823
|
+
}
|
|
824
|
+
}
|
|
825
|
+
const obj_location = obj.location;
|
|
826
|
+
const path_location = path + '.location';
|
|
827
|
+
if (typeof obj_location !== 'string') {
|
|
828
|
+
return new TypeError('Expected "string" but received "' + typeof obj_location + '" (at "' + path_location + '")');
|
|
829
|
+
}
|
|
830
|
+
const obj_name = obj.name;
|
|
831
|
+
const path_name = path + '.name';
|
|
832
|
+
if (typeof obj_name !== 'string') {
|
|
833
|
+
return new TypeError('Expected "string" but received "' + typeof obj_name + '" (at "' + path_name + '")');
|
|
834
|
+
}
|
|
835
|
+
const obj_required = obj.required;
|
|
836
|
+
const path_required = path + '.required';
|
|
837
|
+
if (typeof obj_required !== 'boolean') {
|
|
838
|
+
return new TypeError('Expected "boolean" but received "' + typeof obj_required + '" (at "' + path_required + '")');
|
|
839
|
+
}
|
|
840
|
+
const obj_type = obj.type;
|
|
841
|
+
const path_type = path + '.type';
|
|
842
|
+
if (typeof obj_type !== 'string') {
|
|
843
|
+
return new TypeError('Expected "string" but received "' + typeof obj_type + '" (at "' + path_type + '")');
|
|
844
|
+
}
|
|
845
|
+
})();
|
|
846
|
+
return v_error === undefined ? null : v_error;
|
|
847
|
+
}
|
|
848
|
+
|
|
849
|
+
function validate$a(obj, path = 'OpenApiSpecInferenceInputRepresentation') {
|
|
850
|
+
const v_error = (() => {
|
|
851
|
+
if (typeof obj !== 'object' || ArrayIsArray(obj) || obj === null) {
|
|
852
|
+
return new TypeError('Expected "object" but received "' + typeof obj + '" (at "' + path + '")');
|
|
853
|
+
}
|
|
854
|
+
const obj_description = obj.description;
|
|
855
|
+
const path_description = path + '.description';
|
|
856
|
+
if (typeof obj_description !== 'string') {
|
|
857
|
+
return new TypeError('Expected "string" but received "' + typeof obj_description + '" (at "' + path_description + '")');
|
|
858
|
+
}
|
|
859
|
+
if (obj.externalServiceId !== undefined) {
|
|
860
|
+
const obj_externalServiceId = obj.externalServiceId;
|
|
861
|
+
const path_externalServiceId = path + '.externalServiceId';
|
|
862
|
+
if (typeof obj_externalServiceId !== 'string') {
|
|
863
|
+
return new TypeError('Expected "string" but received "' + typeof obj_externalServiceId + '" (at "' + path_externalServiceId + '")');
|
|
864
|
+
}
|
|
865
|
+
}
|
|
866
|
+
const obj_method = obj.method;
|
|
867
|
+
const path_method = path + '.method';
|
|
868
|
+
if (typeof obj_method !== 'string') {
|
|
869
|
+
return new TypeError('Expected "string" but received "' + typeof obj_method + '" (at "' + path_method + '")');
|
|
870
|
+
}
|
|
871
|
+
const obj_name = obj.name;
|
|
872
|
+
const path_name = path + '.name';
|
|
873
|
+
if (typeof obj_name !== 'string') {
|
|
874
|
+
return new TypeError('Expected "string" but received "' + typeof obj_name + '" (at "' + path_name + '")');
|
|
875
|
+
}
|
|
876
|
+
const obj_operationDescription = obj.operationDescription;
|
|
877
|
+
const path_operationDescription = path + '.operationDescription';
|
|
878
|
+
if (typeof obj_operationDescription !== 'string') {
|
|
879
|
+
return new TypeError('Expected "string" but received "' + typeof obj_operationDescription + '" (at "' + path_operationDescription + '")');
|
|
880
|
+
}
|
|
881
|
+
const obj_operationName = obj.operationName;
|
|
882
|
+
const path_operationName = path + '.operationName';
|
|
883
|
+
if (typeof obj_operationName !== 'string') {
|
|
884
|
+
return new TypeError('Expected "string" but received "' + typeof obj_operationName + '" (at "' + path_operationName + '")');
|
|
885
|
+
}
|
|
886
|
+
const obj_parameters = obj.parameters;
|
|
887
|
+
const path_parameters = path + '.parameters';
|
|
888
|
+
if (!ArrayIsArray(obj_parameters)) {
|
|
889
|
+
return new TypeError('Expected "array" but received "' + typeof obj_parameters + '" (at "' + path_parameters + '")');
|
|
890
|
+
}
|
|
891
|
+
for (let i = 0; i < obj_parameters.length; i++) {
|
|
892
|
+
const obj_parameters_item = obj_parameters[i];
|
|
893
|
+
const path_parameters_item = path_parameters + '[' + i + ']';
|
|
894
|
+
const referencepath_parameters_itemValidationError = validate$b(obj_parameters_item, path_parameters_item);
|
|
895
|
+
if (referencepath_parameters_itemValidationError !== null) {
|
|
896
|
+
let message = 'Object doesn\'t match OpenApiSpecInferenceParameterRepresentation (at "' + path_parameters_item + '")\n';
|
|
897
|
+
message += referencepath_parameters_itemValidationError.message.split('\n').map((line) => '\t' + line).join('\n');
|
|
898
|
+
return new TypeError(message);
|
|
899
|
+
}
|
|
900
|
+
}
|
|
901
|
+
const obj_path = obj.path;
|
|
902
|
+
const path_path = path + '.path';
|
|
903
|
+
if (typeof obj_path !== 'string') {
|
|
904
|
+
return new TypeError('Expected "string" but received "' + typeof obj_path + '" (at "' + path_path + '")');
|
|
905
|
+
}
|
|
906
|
+
if (obj.requestBody !== undefined) {
|
|
907
|
+
const obj_requestBody = obj.requestBody;
|
|
908
|
+
const path_requestBody = path + '.requestBody';
|
|
909
|
+
if (typeof obj_requestBody !== 'object' || ArrayIsArray(obj_requestBody) || obj_requestBody === null) {
|
|
910
|
+
return new TypeError('Expected "object" but received "' + typeof obj_requestBody + '" (at "' + path_requestBody + '")');
|
|
911
|
+
}
|
|
912
|
+
}
|
|
913
|
+
const obj_responseBody = obj.responseBody;
|
|
914
|
+
const path_responseBody = path + '.responseBody';
|
|
915
|
+
if (typeof obj_responseBody !== 'object' || ArrayIsArray(obj_responseBody) || obj_responseBody === null) {
|
|
916
|
+
return new TypeError('Expected "object" but received "' + typeof obj_responseBody + '" (at "' + path_responseBody + '")');
|
|
917
|
+
}
|
|
918
|
+
})();
|
|
919
|
+
return v_error === undefined ? null : v_error;
|
|
920
|
+
}
|
|
921
|
+
|
|
922
|
+
const TTL$1 = 500;
|
|
923
|
+
const VERSION$7 = "9f5779e32b8c9e02976609db89831dbb";
|
|
924
|
+
function validate$9(obj, path = 'OpenApiSpecInferenceOutputRepresentation') {
|
|
925
|
+
const v_error = (() => {
|
|
926
|
+
if (typeof obj !== 'object' || ArrayIsArray(obj) || obj === null) {
|
|
927
|
+
return new TypeError('Expected "object" but received "' + typeof obj + '" (at "' + path + '")');
|
|
928
|
+
}
|
|
929
|
+
const obj_errorMessages = obj.errorMessages;
|
|
930
|
+
const path_errorMessages = path + '.errorMessages';
|
|
931
|
+
if (!ArrayIsArray(obj_errorMessages)) {
|
|
932
|
+
return new TypeError('Expected "array" but received "' + typeof obj_errorMessages + '" (at "' + path_errorMessages + '")');
|
|
933
|
+
}
|
|
934
|
+
for (let i = 0; i < obj_errorMessages.length; i++) {
|
|
935
|
+
const obj_errorMessages_item = obj_errorMessages[i];
|
|
936
|
+
const path_errorMessages_item = path_errorMessages + '[' + i + ']';
|
|
937
|
+
const referencepath_errorMessages_itemValidationError = validate$d(obj_errorMessages_item, path_errorMessages_item);
|
|
938
|
+
if (referencepath_errorMessages_itemValidationError !== null) {
|
|
939
|
+
let message = 'Object doesn\'t match InferenceErrorMessageRepresentation (at "' + path_errorMessages_item + '")\n';
|
|
940
|
+
message += referencepath_errorMessages_itemValidationError.message.split('\n').map((line) => '\t' + line).join('\n');
|
|
941
|
+
return new TypeError(message);
|
|
942
|
+
}
|
|
943
|
+
}
|
|
944
|
+
const obj_schema = obj.schema;
|
|
945
|
+
const path_schema = path + '.schema';
|
|
946
|
+
if (typeof obj_schema !== 'string') {
|
|
947
|
+
return new TypeError('Expected "string" but received "' + typeof obj_schema + '" (at "' + path_schema + '")');
|
|
948
|
+
}
|
|
949
|
+
const obj_success = obj.success;
|
|
950
|
+
const path_success = path + '.success';
|
|
951
|
+
if (typeof obj_success !== 'boolean') {
|
|
952
|
+
return new TypeError('Expected "boolean" but received "' + typeof obj_success + '" (at "' + path_success + '")');
|
|
953
|
+
}
|
|
954
|
+
})();
|
|
955
|
+
return v_error === undefined ? null : v_error;
|
|
956
|
+
}
|
|
957
|
+
const RepresentationType$3 = 'OpenApiSpecInferenceOutputRepresentation';
|
|
958
|
+
function normalize$3(input, existing, path, luvio, store, timestamp) {
|
|
959
|
+
return input;
|
|
960
|
+
}
|
|
961
|
+
const select$c = function OpenApiSpecInferenceOutputRepresentationSelect() {
|
|
962
|
+
const { selections: InferenceErrorMessageRepresentation__selections, opaque: InferenceErrorMessageRepresentation__opaque, } = select$f();
|
|
963
|
+
return {
|
|
964
|
+
kind: 'Fragment',
|
|
965
|
+
version: VERSION$7,
|
|
966
|
+
private: [],
|
|
967
|
+
selections: [
|
|
968
|
+
{
|
|
969
|
+
name: 'errorMessages',
|
|
970
|
+
kind: 'Object',
|
|
971
|
+
plural: true,
|
|
972
|
+
selections: InferenceErrorMessageRepresentation__selections
|
|
973
|
+
},
|
|
974
|
+
{
|
|
975
|
+
name: 'schema',
|
|
976
|
+
kind: 'Scalar'
|
|
977
|
+
},
|
|
978
|
+
{
|
|
979
|
+
name: 'success',
|
|
980
|
+
kind: 'Scalar'
|
|
981
|
+
}
|
|
982
|
+
]
|
|
983
|
+
};
|
|
984
|
+
};
|
|
985
|
+
function equals$7(existing, incoming) {
|
|
986
|
+
const existing_success = existing.success;
|
|
987
|
+
const incoming_success = incoming.success;
|
|
988
|
+
if (!(existing_success === incoming_success)) {
|
|
989
|
+
return false;
|
|
990
|
+
}
|
|
991
|
+
const existing_schema = existing.schema;
|
|
992
|
+
const incoming_schema = incoming.schema;
|
|
993
|
+
if (!(existing_schema === incoming_schema)) {
|
|
994
|
+
return false;
|
|
995
|
+
}
|
|
996
|
+
const existing_errorMessages = existing.errorMessages;
|
|
997
|
+
const incoming_errorMessages = incoming.errorMessages;
|
|
998
|
+
const equals_errorMessages_items = equalsArray(existing_errorMessages, incoming_errorMessages, (existing_errorMessages_item, incoming_errorMessages_item) => {
|
|
999
|
+
if (!(equals$9(existing_errorMessages_item, incoming_errorMessages_item))) {
|
|
1000
|
+
return false;
|
|
1001
|
+
}
|
|
1002
|
+
});
|
|
1003
|
+
if (equals_errorMessages_items === false) {
|
|
1004
|
+
return false;
|
|
1005
|
+
}
|
|
1006
|
+
return true;
|
|
1007
|
+
}
|
|
1008
|
+
const ingest$3 = function OpenApiSpecInferenceOutputRepresentationIngest(input, path, luvio, store, timestamp) {
|
|
1009
|
+
if (process.env.NODE_ENV !== 'production') {
|
|
1010
|
+
const validateError = validate$9(input);
|
|
1011
|
+
if (validateError !== null) {
|
|
1012
|
+
throw validateError;
|
|
1013
|
+
}
|
|
1014
|
+
}
|
|
1015
|
+
const key = path.fullPath;
|
|
1016
|
+
const ttlToUse = TTL$1;
|
|
1017
|
+
ingestShape(input, path, luvio, store, timestamp, ttlToUse, key, normalize$3, "external-services", VERSION$7, RepresentationType$3, equals$7);
|
|
1018
|
+
return createLink(key);
|
|
1019
|
+
};
|
|
1020
|
+
function getTypeCacheKeys$3(rootKeySet, luvio, input, fullPathFactory) {
|
|
1021
|
+
// root cache key (uses fullPathFactory if keyBuilderFromType isn't defined)
|
|
1022
|
+
const rootKey = fullPathFactory();
|
|
1023
|
+
rootKeySet.set(rootKey, {
|
|
1024
|
+
namespace: keyPrefix,
|
|
1025
|
+
representationName: RepresentationType$3,
|
|
1026
|
+
mergeable: false
|
|
1027
|
+
});
|
|
1028
|
+
}
|
|
1029
|
+
|
|
1030
|
+
function select$b(luvio, params) {
|
|
1031
|
+
return select$c();
|
|
1032
|
+
}
|
|
1033
|
+
function keyBuilder$8(luvio, params) {
|
|
1034
|
+
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 + '::' + '[' + params.body.input.parameters.map(element => (element.description === undefined ? 'input.parameters.description' : 'input.parameters.description:' + element.description) + '::' + (element.example === undefined ? 'input.parameters.example' : 'input.parameters.example:' + element.example) + '::' + 'input.parameters.location:' + element.location + '::' + 'input.parameters.name:' + element.name + '::' + 'input.parameters.required:' + element.required + '::' + 'input.parameters.type:' + element.type).join(',') + ']' + '::' + 'input.path:' + params.body.input.path + '::' + stableJSONStringify(params.body.input.requestBody) + '::' + stableJSONStringify(params.body.input.responseBody) + ')';
|
|
1035
|
+
}
|
|
1036
|
+
function getResponseCacheKeys$4(storeKeyMap, luvio, resourceParams, response) {
|
|
1037
|
+
getTypeCacheKeys$3(storeKeyMap, luvio, response, () => keyBuilder$8(luvio, resourceParams));
|
|
1038
|
+
}
|
|
1039
|
+
function ingestSuccess$4(luvio, resourceParams, response, snapshotRefresh) {
|
|
1040
|
+
const { body } = response;
|
|
1041
|
+
const key = keyBuilder$8(luvio, resourceParams);
|
|
1042
|
+
luvio.storeIngest(key, ingest$3, body);
|
|
1043
|
+
const snapshot = luvio.storeLookup({
|
|
1044
|
+
recordId: key,
|
|
1045
|
+
node: select$b(),
|
|
1046
|
+
variables: {},
|
|
1047
|
+
}, snapshotRefresh);
|
|
1048
|
+
if (process.env.NODE_ENV !== 'production') {
|
|
1049
|
+
if (snapshot.state !== 'Fulfilled') {
|
|
1050
|
+
throw new Error('Invalid network response. Expected resource response to result in Fulfilled snapshot');
|
|
1051
|
+
}
|
|
1052
|
+
}
|
|
1053
|
+
deepFreeze(snapshot.data);
|
|
1054
|
+
return snapshot;
|
|
1055
|
+
}
|
|
1056
|
+
function ingestError$3(luvio, params, error, snapshotRefresh) {
|
|
1057
|
+
const key = keyBuilder$8(luvio, params);
|
|
1058
|
+
const errorSnapshot = luvio.errorSnapshot(error, snapshotRefresh);
|
|
1059
|
+
const storeMetadataParams = {
|
|
1060
|
+
ttl: TTL$1,
|
|
1061
|
+
namespace: keyPrefix,
|
|
1062
|
+
version: VERSION$7,
|
|
1063
|
+
representationName: RepresentationType$3
|
|
1064
|
+
};
|
|
1065
|
+
luvio.storeIngestError(key, errorSnapshot, storeMetadataParams);
|
|
1066
|
+
return errorSnapshot;
|
|
1067
|
+
}
|
|
1068
|
+
function createResourceRequest$4(config) {
|
|
1069
|
+
const headers = {};
|
|
1070
|
+
return {
|
|
1071
|
+
baseUri: '/services/data/v66.0',
|
|
1072
|
+
basePath: '/externalservices/inference/openapispec/' + config.urlParams.version + '',
|
|
1073
|
+
method: 'post',
|
|
1074
|
+
body: config.body,
|
|
1075
|
+
urlParams: config.urlParams,
|
|
1076
|
+
queryParams: {},
|
|
1077
|
+
headers,
|
|
1078
|
+
priority: 'normal',
|
|
1079
|
+
};
|
|
1080
|
+
}
|
|
1081
|
+
|
|
1082
|
+
const adapterName$4 = 'getOpenApiSpec';
|
|
1083
|
+
const getOpenApiSpec_ConfigPropertyMetadata = [
|
|
1084
|
+
generateParamConfigMetadata('version', true, 0 /* UrlParameter */, 0 /* String */),
|
|
1085
|
+
generateParamConfigMetadata('input', true, 2 /* Body */, 4 /* Unsupported */),
|
|
1086
|
+
];
|
|
1087
|
+
const getOpenApiSpec_ConfigPropertyNames = /*#__PURE__*/ buildAdapterValidationConfig(adapterName$4, getOpenApiSpec_ConfigPropertyMetadata);
|
|
1088
|
+
const createResourceParams$4 = /*#__PURE__*/ createResourceParams$7(getOpenApiSpec_ConfigPropertyMetadata);
|
|
1089
|
+
function keyBuilder$7(luvio, config) {
|
|
1090
|
+
const resourceParams = createResourceParams$4(config);
|
|
1091
|
+
return keyBuilder$8(luvio, resourceParams);
|
|
1092
|
+
}
|
|
1093
|
+
function typeCheckConfig$4(untrustedConfig) {
|
|
1094
|
+
const config = {};
|
|
1095
|
+
typeCheckConfig$7(untrustedConfig, config, getOpenApiSpec_ConfigPropertyMetadata);
|
|
1096
|
+
const untrustedConfig_input = untrustedConfig.input;
|
|
1097
|
+
const referenceOpenApiSpecInferenceInputRepresentationValidationError = validate$a(untrustedConfig_input);
|
|
1098
|
+
if (referenceOpenApiSpecInferenceInputRepresentationValidationError === null) {
|
|
1099
|
+
config.input = untrustedConfig_input;
|
|
1100
|
+
}
|
|
1101
|
+
return config;
|
|
1102
|
+
}
|
|
1103
|
+
function validateAdapterConfig$4(untrustedConfig, configPropertyNames) {
|
|
1104
|
+
if (!untrustedIsObject(untrustedConfig)) {
|
|
1105
|
+
return null;
|
|
1106
|
+
}
|
|
1107
|
+
if (process.env.NODE_ENV !== 'production') {
|
|
1108
|
+
validateConfig(untrustedConfig, configPropertyNames);
|
|
1109
|
+
}
|
|
1110
|
+
const config = typeCheckConfig$4(untrustedConfig);
|
|
1111
|
+
if (!areRequiredParametersPresent(config, configPropertyNames)) {
|
|
1112
|
+
return null;
|
|
1113
|
+
}
|
|
1114
|
+
return config;
|
|
1115
|
+
}
|
|
1116
|
+
function adapterFragment$3(luvio, config) {
|
|
1117
|
+
createResourceParams$4(config);
|
|
1118
|
+
return select$b();
|
|
1119
|
+
}
|
|
1120
|
+
function onFetchResponseSuccess$3(luvio, config, resourceParams, response) {
|
|
1121
|
+
const snapshot = ingestSuccess$4(luvio, resourceParams, response, {
|
|
1122
|
+
config,
|
|
1123
|
+
resolve: () => buildNetworkSnapshot$4(luvio, config, snapshotRefreshOptions)
|
|
1124
|
+
});
|
|
1125
|
+
return luvio.storeBroadcast().then(() => snapshot);
|
|
1126
|
+
}
|
|
1127
|
+
function onFetchResponseError$3(luvio, config, resourceParams, response) {
|
|
1128
|
+
const snapshot = ingestError$3(luvio, resourceParams, response, {
|
|
1129
|
+
config,
|
|
1130
|
+
resolve: () => buildNetworkSnapshot$4(luvio, config, snapshotRefreshOptions)
|
|
1131
|
+
});
|
|
1132
|
+
return luvio.storeBroadcast().then(() => snapshot);
|
|
1133
|
+
}
|
|
1134
|
+
function buildNetworkSnapshot$4(luvio, config, options) {
|
|
1135
|
+
const resourceParams = createResourceParams$4(config);
|
|
1136
|
+
const request = createResourceRequest$4(resourceParams);
|
|
1137
|
+
return luvio.dispatchResourceRequest(request, options)
|
|
1138
|
+
.then((response) => {
|
|
1139
|
+
return luvio.handleSuccessResponse(() => onFetchResponseSuccess$3(luvio, config, resourceParams, response), () => {
|
|
1140
|
+
const cache = new StoreKeyMap();
|
|
1141
|
+
getResponseCacheKeys$4(cache, luvio, resourceParams, response.body);
|
|
1142
|
+
return cache;
|
|
1143
|
+
});
|
|
1144
|
+
}, (response) => {
|
|
1145
|
+
return luvio.handleErrorResponse(() => onFetchResponseError$3(luvio, config, resourceParams, response));
|
|
1146
|
+
});
|
|
1147
|
+
}
|
|
1148
|
+
function buildNetworkSnapshotCachePolicy$3(context, coercedAdapterRequestContext) {
|
|
1149
|
+
return buildNetworkSnapshotCachePolicy$6(context, coercedAdapterRequestContext, buildNetworkSnapshot$4, 'get', false);
|
|
1150
|
+
}
|
|
1151
|
+
function buildCachedSnapshotCachePolicy$3(context, storeLookup) {
|
|
1152
|
+
const { luvio, config } = context;
|
|
1153
|
+
const selector = {
|
|
1154
|
+
recordId: keyBuilder$7(luvio, config),
|
|
1155
|
+
node: adapterFragment$3(luvio, config),
|
|
1156
|
+
variables: {},
|
|
1157
|
+
};
|
|
1158
|
+
const cacheSnapshot = storeLookup(selector, {
|
|
1159
|
+
config,
|
|
1160
|
+
resolve: () => buildNetworkSnapshot$4(luvio, config, snapshotRefreshOptions)
|
|
1161
|
+
});
|
|
1162
|
+
return cacheSnapshot;
|
|
1163
|
+
}
|
|
1164
|
+
const getOpenApiSpecAdapterFactory = (luvio) => function externalServices__getOpenApiSpec(untrustedConfig, requestContext) {
|
|
1165
|
+
const config = validateAdapterConfig$4(untrustedConfig, getOpenApiSpec_ConfigPropertyNames);
|
|
1166
|
+
// Invalid or incomplete config
|
|
1167
|
+
if (config === null) {
|
|
1168
|
+
return null;
|
|
1169
|
+
}
|
|
1170
|
+
return luvio.applyCachePolicy((requestContext || {}), { config, luvio }, // BuildSnapshotContext
|
|
1171
|
+
buildCachedSnapshotCachePolicy$3, buildNetworkSnapshotCachePolicy$3);
|
|
1172
|
+
};
|
|
1173
|
+
|
|
1174
|
+
const VERSION$6 = "7dd4168caef7cc755bcbcb7dddf11b57";
|
|
1175
|
+
function validate$8(obj, path = 'ExternalServiceStatisticsBreakdownRepresentation') {
|
|
1176
|
+
const v_error = (() => {
|
|
1177
|
+
if (typeof obj !== 'object' || ArrayIsArray(obj) || obj === null) {
|
|
1178
|
+
return new TypeError('Expected "object" but received "' + typeof obj + '" (at "' + path + '")');
|
|
1179
|
+
}
|
|
1180
|
+
const obj_active = obj.active;
|
|
1181
|
+
const path_active = path + '.active';
|
|
1182
|
+
if (typeof obj_active !== 'boolean') {
|
|
1183
|
+
return new TypeError('Expected "boolean" but received "' + typeof obj_active + '" (at "' + path_active + '")');
|
|
1184
|
+
}
|
|
1185
|
+
const obj_activeCount = obj.activeCount;
|
|
1186
|
+
const path_activeCount = path + '.activeCount';
|
|
1187
|
+
if (typeof obj_activeCount !== 'number' || (typeof obj_activeCount === 'number' && Math.floor(obj_activeCount) !== obj_activeCount)) {
|
|
1188
|
+
return new TypeError('Expected "integer" but received "' + typeof obj_activeCount + '" (at "' + path_activeCount + '")');
|
|
1189
|
+
}
|
|
1190
|
+
const obj_component = obj.component;
|
|
1191
|
+
const path_component = path + '.component';
|
|
1192
|
+
if (typeof obj_component !== 'string') {
|
|
1193
|
+
return new TypeError('Expected "string" but received "' + typeof obj_component + '" (at "' + path_component + '")');
|
|
1194
|
+
}
|
|
1195
|
+
const obj_componentType = obj.componentType;
|
|
1196
|
+
const path_componentType = path + '.componentType';
|
|
1197
|
+
if (typeof obj_componentType !== 'string') {
|
|
1198
|
+
return new TypeError('Expected "string" but received "' + typeof obj_componentType + '" (at "' + path_componentType + '")');
|
|
1199
|
+
}
|
|
1200
|
+
const obj_statisticFor = obj.statisticFor;
|
|
1201
|
+
const path_statisticFor = path + '.statisticFor';
|
|
1202
|
+
if (typeof obj_statisticFor !== 'string') {
|
|
1203
|
+
return new TypeError('Expected "string" but received "' + typeof obj_statisticFor + '" (at "' + path_statisticFor + '")');
|
|
1204
|
+
}
|
|
1205
|
+
const obj_totalCount = obj.totalCount;
|
|
1206
|
+
const path_totalCount = path + '.totalCount';
|
|
1207
|
+
if (typeof obj_totalCount !== 'number' || (typeof obj_totalCount === 'number' && Math.floor(obj_totalCount) !== obj_totalCount)) {
|
|
1208
|
+
return new TypeError('Expected "integer" but received "' + typeof obj_totalCount + '" (at "' + path_totalCount + '")');
|
|
1209
|
+
}
|
|
1210
|
+
})();
|
|
1211
|
+
return v_error === undefined ? null : v_error;
|
|
1212
|
+
}
|
|
1213
|
+
const select$a = function ExternalServiceStatisticsBreakdownRepresentationSelect() {
|
|
1214
|
+
return {
|
|
1215
|
+
kind: 'Fragment',
|
|
1216
|
+
version: VERSION$6,
|
|
1217
|
+
private: [],
|
|
1218
|
+
selections: [
|
|
1219
|
+
{
|
|
1220
|
+
name: 'active',
|
|
1221
|
+
kind: 'Scalar'
|
|
1222
|
+
},
|
|
1223
|
+
{
|
|
1224
|
+
name: 'activeCount',
|
|
1225
|
+
kind: 'Scalar'
|
|
1226
|
+
},
|
|
1227
|
+
{
|
|
1228
|
+
name: 'component',
|
|
1229
|
+
kind: 'Scalar'
|
|
1230
|
+
},
|
|
1231
|
+
{
|
|
1232
|
+
name: 'componentType',
|
|
1233
|
+
kind: 'Scalar'
|
|
1234
|
+
},
|
|
1235
|
+
{
|
|
1236
|
+
name: 'statisticFor',
|
|
1237
|
+
kind: 'Scalar'
|
|
1238
|
+
},
|
|
1239
|
+
{
|
|
1240
|
+
name: 'totalCount',
|
|
1241
|
+
kind: 'Scalar'
|
|
1242
|
+
}
|
|
1243
|
+
]
|
|
1244
|
+
};
|
|
1245
|
+
};
|
|
1246
|
+
function equals$6(existing, incoming) {
|
|
1247
|
+
const existing_active = existing.active;
|
|
1248
|
+
const incoming_active = incoming.active;
|
|
1249
|
+
if (!(existing_active === incoming_active)) {
|
|
1250
|
+
return false;
|
|
1251
|
+
}
|
|
1252
|
+
const existing_activeCount = existing.activeCount;
|
|
1253
|
+
const incoming_activeCount = incoming.activeCount;
|
|
1254
|
+
if (!(existing_activeCount === incoming_activeCount)) {
|
|
1255
|
+
return false;
|
|
1256
|
+
}
|
|
1257
|
+
const existing_totalCount = existing.totalCount;
|
|
1258
|
+
const incoming_totalCount = incoming.totalCount;
|
|
1259
|
+
if (!(existing_totalCount === incoming_totalCount)) {
|
|
1260
|
+
return false;
|
|
1261
|
+
}
|
|
1262
|
+
const existing_component = existing.component;
|
|
1263
|
+
const incoming_component = incoming.component;
|
|
1264
|
+
if (!(existing_component === incoming_component)) {
|
|
1265
|
+
return false;
|
|
1266
|
+
}
|
|
1267
|
+
const existing_componentType = existing.componentType;
|
|
1268
|
+
const incoming_componentType = incoming.componentType;
|
|
1269
|
+
if (!(existing_componentType === incoming_componentType)) {
|
|
1270
|
+
return false;
|
|
1271
|
+
}
|
|
1272
|
+
const existing_statisticFor = existing.statisticFor;
|
|
1273
|
+
const incoming_statisticFor = incoming.statisticFor;
|
|
1274
|
+
if (!(existing_statisticFor === incoming_statisticFor)) {
|
|
1275
|
+
return false;
|
|
1276
|
+
}
|
|
1277
|
+
return true;
|
|
1278
|
+
}
|
|
1279
|
+
|
|
1280
|
+
const VERSION$5 = "6bd958289eba0fb66f626c73737f8c00";
|
|
1281
|
+
function validate$7(obj, path = 'ExternalServiceStatisticsForServiceRepresentation') {
|
|
1282
|
+
const v_error = (() => {
|
|
1283
|
+
if (typeof obj !== 'object' || ArrayIsArray(obj) || obj === null) {
|
|
1284
|
+
return new TypeError('Expected "object" but received "' + typeof obj + '" (at "' + path + '")');
|
|
1285
|
+
}
|
|
1286
|
+
const obj_schemaSize = obj.schemaSize;
|
|
1287
|
+
const path_schemaSize = path + '.schemaSize';
|
|
1288
|
+
if (typeof obj_schemaSize !== 'number' || (typeof obj_schemaSize === 'number' && Math.floor(obj_schemaSize) !== obj_schemaSize)) {
|
|
1289
|
+
return new TypeError('Expected "integer" but received "' + typeof obj_schemaSize + '" (at "' + path_schemaSize + '")');
|
|
1290
|
+
}
|
|
1291
|
+
const obj_schemaType = obj.schemaType;
|
|
1292
|
+
const path_schemaType = path + '.schemaType';
|
|
1293
|
+
if (typeof obj_schemaType !== 'string') {
|
|
1294
|
+
return new TypeError('Expected "string" but received "' + typeof obj_schemaType + '" (at "' + path_schemaType + '")');
|
|
1295
|
+
}
|
|
1296
|
+
const obj_serviceName = obj.serviceName;
|
|
1297
|
+
const path_serviceName = path + '.serviceName';
|
|
1298
|
+
if (typeof obj_serviceName !== 'string') {
|
|
1299
|
+
return new TypeError('Expected "string" but received "' + typeof obj_serviceName + '" (at "' + path_serviceName + '")');
|
|
1300
|
+
}
|
|
1301
|
+
const obj_statistics = obj.statistics;
|
|
1302
|
+
const path_statistics = path + '.statistics';
|
|
1303
|
+
if (!ArrayIsArray(obj_statistics)) {
|
|
1304
|
+
return new TypeError('Expected "array" but received "' + typeof obj_statistics + '" (at "' + path_statistics + '")');
|
|
1305
|
+
}
|
|
1306
|
+
for (let i = 0; i < obj_statistics.length; i++) {
|
|
1307
|
+
const obj_statistics_item = obj_statistics[i];
|
|
1308
|
+
const path_statistics_item = path_statistics + '[' + i + ']';
|
|
1309
|
+
const referencepath_statistics_itemValidationError = validate$8(obj_statistics_item, path_statistics_item);
|
|
1310
|
+
if (referencepath_statistics_itemValidationError !== null) {
|
|
1311
|
+
let message = 'Object doesn\'t match ExternalServiceStatisticsBreakdownRepresentation (at "' + path_statistics_item + '")\n';
|
|
1312
|
+
message += referencepath_statistics_itemValidationError.message.split('\n').map((line) => '\t' + line).join('\n');
|
|
1313
|
+
return new TypeError(message);
|
|
1314
|
+
}
|
|
1315
|
+
}
|
|
1316
|
+
const obj_systemVersion = obj.systemVersion;
|
|
1317
|
+
const path_systemVersion = path + '.systemVersion';
|
|
1318
|
+
if (typeof obj_systemVersion !== 'number' || (typeof obj_systemVersion === 'number' && Math.floor(obj_systemVersion) !== obj_systemVersion)) {
|
|
1319
|
+
return new TypeError('Expected "integer" but received "' + typeof obj_systemVersion + '" (at "' + path_systemVersion + '")');
|
|
1320
|
+
}
|
|
1321
|
+
})();
|
|
1322
|
+
return v_error === undefined ? null : v_error;
|
|
1323
|
+
}
|
|
1324
|
+
const select$9 = function ExternalServiceStatisticsForServiceRepresentationSelect() {
|
|
1325
|
+
const { selections: ExternalServiceStatisticsBreakdownRepresentation__selections, opaque: ExternalServiceStatisticsBreakdownRepresentation__opaque, } = select$a();
|
|
1326
|
+
return {
|
|
1327
|
+
kind: 'Fragment',
|
|
1328
|
+
version: VERSION$5,
|
|
1329
|
+
private: [],
|
|
1330
|
+
selections: [
|
|
1331
|
+
{
|
|
1332
|
+
name: 'schemaSize',
|
|
1333
|
+
kind: 'Scalar'
|
|
1334
|
+
},
|
|
1335
|
+
{
|
|
1336
|
+
name: 'schemaType',
|
|
1337
|
+
kind: 'Scalar'
|
|
1338
|
+
},
|
|
1339
|
+
{
|
|
1340
|
+
name: 'serviceName',
|
|
1341
|
+
kind: 'Scalar'
|
|
1342
|
+
},
|
|
1343
|
+
{
|
|
1344
|
+
name: 'statistics',
|
|
1345
|
+
kind: 'Object',
|
|
1346
|
+
plural: true,
|
|
1347
|
+
selections: ExternalServiceStatisticsBreakdownRepresentation__selections
|
|
1348
|
+
},
|
|
1349
|
+
{
|
|
1350
|
+
name: 'systemVersion',
|
|
1351
|
+
kind: 'Scalar'
|
|
1352
|
+
}
|
|
1353
|
+
]
|
|
1354
|
+
};
|
|
1355
|
+
};
|
|
1356
|
+
function equals$5(existing, incoming) {
|
|
1357
|
+
const existing_schemaSize = existing.schemaSize;
|
|
1358
|
+
const incoming_schemaSize = incoming.schemaSize;
|
|
1359
|
+
if (!(existing_schemaSize === incoming_schemaSize)) {
|
|
1360
|
+
return false;
|
|
1361
|
+
}
|
|
1362
|
+
const existing_systemVersion = existing.systemVersion;
|
|
1363
|
+
const incoming_systemVersion = incoming.systemVersion;
|
|
1364
|
+
if (!(existing_systemVersion === incoming_systemVersion)) {
|
|
1365
|
+
return false;
|
|
1366
|
+
}
|
|
1367
|
+
const existing_schemaType = existing.schemaType;
|
|
1368
|
+
const incoming_schemaType = incoming.schemaType;
|
|
1369
|
+
if (!(existing_schemaType === incoming_schemaType)) {
|
|
1370
|
+
return false;
|
|
1371
|
+
}
|
|
1372
|
+
const existing_serviceName = existing.serviceName;
|
|
1373
|
+
const incoming_serviceName = incoming.serviceName;
|
|
1374
|
+
if (!(existing_serviceName === incoming_serviceName)) {
|
|
1375
|
+
return false;
|
|
1376
|
+
}
|
|
1377
|
+
const existing_statistics = existing.statistics;
|
|
1378
|
+
const incoming_statistics = incoming.statistics;
|
|
1379
|
+
const equals_statistics_items = equalsArray(existing_statistics, incoming_statistics, (existing_statistics_item, incoming_statistics_item) => {
|
|
1380
|
+
if (!(equals$6(existing_statistics_item, incoming_statistics_item))) {
|
|
1381
|
+
return false;
|
|
1382
|
+
}
|
|
1383
|
+
});
|
|
1384
|
+
if (equals_statistics_items === false) {
|
|
1385
|
+
return false;
|
|
1386
|
+
}
|
|
1387
|
+
return true;
|
|
1388
|
+
}
|
|
1389
|
+
|
|
1390
|
+
const VERSION$4 = "3ff0c02babe6583f09a09544b2c045fd";
|
|
1391
|
+
function validate$6(obj, path = 'ExternalServiceStatisticsOverviewRepresentation') {
|
|
1392
|
+
const v_error = (() => {
|
|
1393
|
+
if (typeof obj !== 'object' || ArrayIsArray(obj) || obj === null) {
|
|
1394
|
+
return new TypeError('Expected "object" but received "' + typeof obj + '" (at "' + path + '")');
|
|
1395
|
+
}
|
|
1396
|
+
const obj_activeCount = obj.activeCount;
|
|
1397
|
+
const path_activeCount = path + '.activeCount';
|
|
1398
|
+
if (typeof obj_activeCount !== 'number' || (typeof obj_activeCount === 'number' && Math.floor(obj_activeCount) !== obj_activeCount)) {
|
|
1399
|
+
return new TypeError('Expected "integer" but received "' + typeof obj_activeCount + '" (at "' + path_activeCount + '")');
|
|
1400
|
+
}
|
|
1401
|
+
const obj_statisticFor = obj.statisticFor;
|
|
1402
|
+
const path_statisticFor = path + '.statisticFor';
|
|
1403
|
+
if (typeof obj_statisticFor !== 'string') {
|
|
1404
|
+
return new TypeError('Expected "string" but received "' + typeof obj_statisticFor + '" (at "' + path_statisticFor + '")');
|
|
1405
|
+
}
|
|
1406
|
+
const obj_totalCount = obj.totalCount;
|
|
1407
|
+
const path_totalCount = path + '.totalCount';
|
|
1408
|
+
if (typeof obj_totalCount !== 'number' || (typeof obj_totalCount === 'number' && Math.floor(obj_totalCount) !== obj_totalCount)) {
|
|
1409
|
+
return new TypeError('Expected "integer" but received "' + typeof obj_totalCount + '" (at "' + path_totalCount + '")');
|
|
1410
|
+
}
|
|
1411
|
+
})();
|
|
1412
|
+
return v_error === undefined ? null : v_error;
|
|
1413
|
+
}
|
|
1414
|
+
const select$8 = function ExternalServiceStatisticsOverviewRepresentationSelect() {
|
|
1415
|
+
return {
|
|
1416
|
+
kind: 'Fragment',
|
|
1417
|
+
version: VERSION$4,
|
|
1418
|
+
private: [],
|
|
1419
|
+
selections: [
|
|
1420
|
+
{
|
|
1421
|
+
name: 'activeCount',
|
|
1422
|
+
kind: 'Scalar'
|
|
1423
|
+
},
|
|
1424
|
+
{
|
|
1425
|
+
name: 'statisticFor',
|
|
1426
|
+
kind: 'Scalar'
|
|
1427
|
+
},
|
|
1428
|
+
{
|
|
1429
|
+
name: 'totalCount',
|
|
1430
|
+
kind: 'Scalar'
|
|
1431
|
+
}
|
|
1432
|
+
]
|
|
1433
|
+
};
|
|
1434
|
+
};
|
|
1435
|
+
function equals$4(existing, incoming) {
|
|
1436
|
+
const existing_activeCount = existing.activeCount;
|
|
1437
|
+
const incoming_activeCount = incoming.activeCount;
|
|
1438
|
+
if (!(existing_activeCount === incoming_activeCount)) {
|
|
1439
|
+
return false;
|
|
1440
|
+
}
|
|
1441
|
+
const existing_totalCount = existing.totalCount;
|
|
1442
|
+
const incoming_totalCount = incoming.totalCount;
|
|
1443
|
+
if (!(existing_totalCount === incoming_totalCount)) {
|
|
1444
|
+
return false;
|
|
1445
|
+
}
|
|
1446
|
+
const existing_statisticFor = existing.statisticFor;
|
|
1447
|
+
const incoming_statisticFor = incoming.statisticFor;
|
|
1448
|
+
if (!(existing_statisticFor === incoming_statisticFor)) {
|
|
1449
|
+
return false;
|
|
1450
|
+
}
|
|
1451
|
+
return true;
|
|
1452
|
+
}
|
|
1453
|
+
|
|
1454
|
+
const VERSION$3 = "4246bda5c0cab4f897003ca8900ef381";
|
|
1455
|
+
function validate$5(obj, path = 'ExternalServiceStatisticsOutputRepresentation') {
|
|
1456
|
+
const v_error = (() => {
|
|
1457
|
+
if (typeof obj !== 'object' || ArrayIsArray(obj) || obj === null) {
|
|
1458
|
+
return new TypeError('Expected "object" but received "' + typeof obj + '" (at "' + path + '")');
|
|
1459
|
+
}
|
|
1460
|
+
const obj_serviceCount = obj.serviceCount;
|
|
1461
|
+
const path_serviceCount = path + '.serviceCount';
|
|
1462
|
+
if (typeof obj_serviceCount !== 'number' || (typeof obj_serviceCount === 'number' && Math.floor(obj_serviceCount) !== obj_serviceCount)) {
|
|
1463
|
+
return new TypeError('Expected "integer" but received "' + typeof obj_serviceCount + '" (at "' + path_serviceCount + '")');
|
|
1464
|
+
}
|
|
1465
|
+
const obj_services = obj.services;
|
|
1466
|
+
const path_services = path + '.services';
|
|
1467
|
+
if (!ArrayIsArray(obj_services)) {
|
|
1468
|
+
return new TypeError('Expected "array" but received "' + typeof obj_services + '" (at "' + path_services + '")');
|
|
1469
|
+
}
|
|
1470
|
+
for (let i = 0; i < obj_services.length; i++) {
|
|
1471
|
+
const obj_services_item = obj_services[i];
|
|
1472
|
+
const path_services_item = path_services + '[' + i + ']';
|
|
1473
|
+
const referencepath_services_itemValidationError = validate$7(obj_services_item, path_services_item);
|
|
1474
|
+
if (referencepath_services_itemValidationError !== null) {
|
|
1475
|
+
let message = 'Object doesn\'t match ExternalServiceStatisticsForServiceRepresentation (at "' + path_services_item + '")\n';
|
|
1476
|
+
message += referencepath_services_itemValidationError.message.split('\n').map((line) => '\t' + line).join('\n');
|
|
1477
|
+
return new TypeError(message);
|
|
1478
|
+
}
|
|
1479
|
+
}
|
|
1480
|
+
const obj_statistics = obj.statistics;
|
|
1481
|
+
const path_statistics = path + '.statistics';
|
|
1482
|
+
if (!ArrayIsArray(obj_statistics)) {
|
|
1483
|
+
return new TypeError('Expected "array" but received "' + typeof obj_statistics + '" (at "' + path_statistics + '")');
|
|
1484
|
+
}
|
|
1485
|
+
for (let i = 0; i < obj_statistics.length; i++) {
|
|
1486
|
+
const obj_statistics_item = obj_statistics[i];
|
|
1487
|
+
const path_statistics_item = path_statistics + '[' + i + ']';
|
|
1488
|
+
const referencepath_statistics_itemValidationError = validate$6(obj_statistics_item, path_statistics_item);
|
|
1489
|
+
if (referencepath_statistics_itemValidationError !== null) {
|
|
1490
|
+
let message = 'Object doesn\'t match ExternalServiceStatisticsOverviewRepresentation (at "' + path_statistics_item + '")\n';
|
|
1491
|
+
message += referencepath_statistics_itemValidationError.message.split('\n').map((line) => '\t' + line).join('\n');
|
|
1492
|
+
return new TypeError(message);
|
|
1493
|
+
}
|
|
1494
|
+
}
|
|
1495
|
+
})();
|
|
1496
|
+
return v_error === undefined ? null : v_error;
|
|
1497
|
+
}
|
|
1498
|
+
const RepresentationType$2 = 'ExternalServiceStatisticsOutputRepresentation';
|
|
1499
|
+
function normalize$2(input, existing, path, luvio, store, timestamp) {
|
|
1500
|
+
return input;
|
|
1501
|
+
}
|
|
1502
|
+
const select$7 = function ExternalServiceStatisticsOutputRepresentationSelect() {
|
|
1503
|
+
const { selections: ExternalServiceStatisticsForServiceRepresentation__selections, opaque: ExternalServiceStatisticsForServiceRepresentation__opaque, } = select$9();
|
|
1504
|
+
const { selections: ExternalServiceStatisticsOverviewRepresentation__selections, opaque: ExternalServiceStatisticsOverviewRepresentation__opaque, } = select$8();
|
|
1505
|
+
return {
|
|
1506
|
+
kind: 'Fragment',
|
|
1507
|
+
version: VERSION$3,
|
|
1508
|
+
private: [],
|
|
1509
|
+
selections: [
|
|
1510
|
+
{
|
|
1511
|
+
name: 'serviceCount',
|
|
1512
|
+
kind: 'Scalar'
|
|
1513
|
+
},
|
|
1514
|
+
{
|
|
1515
|
+
name: 'services',
|
|
1516
|
+
kind: 'Object',
|
|
1517
|
+
plural: true,
|
|
1518
|
+
selections: ExternalServiceStatisticsForServiceRepresentation__selections
|
|
1519
|
+
},
|
|
1520
|
+
{
|
|
1521
|
+
name: 'statistics',
|
|
1522
|
+
kind: 'Object',
|
|
1523
|
+
plural: true,
|
|
1524
|
+
selections: ExternalServiceStatisticsOverviewRepresentation__selections
|
|
1525
|
+
}
|
|
1526
|
+
]
|
|
1527
|
+
};
|
|
1528
|
+
};
|
|
1529
|
+
function equals$3(existing, incoming) {
|
|
1530
|
+
const existing_serviceCount = existing.serviceCount;
|
|
1531
|
+
const incoming_serviceCount = incoming.serviceCount;
|
|
1532
|
+
if (!(existing_serviceCount === incoming_serviceCount)) {
|
|
1533
|
+
return false;
|
|
1534
|
+
}
|
|
1535
|
+
const existing_services = existing.services;
|
|
1536
|
+
const incoming_services = incoming.services;
|
|
1537
|
+
const equals_services_items = equalsArray(existing_services, incoming_services, (existing_services_item, incoming_services_item) => {
|
|
1538
|
+
if (!(equals$5(existing_services_item, incoming_services_item))) {
|
|
1539
|
+
return false;
|
|
1540
|
+
}
|
|
1541
|
+
});
|
|
1542
|
+
if (equals_services_items === false) {
|
|
1543
|
+
return false;
|
|
1544
|
+
}
|
|
1545
|
+
const existing_statistics = existing.statistics;
|
|
1546
|
+
const incoming_statistics = incoming.statistics;
|
|
1547
|
+
const equals_statistics_items = equalsArray(existing_statistics, incoming_statistics, (existing_statistics_item, incoming_statistics_item) => {
|
|
1548
|
+
if (!(equals$4(existing_statistics_item, incoming_statistics_item))) {
|
|
1549
|
+
return false;
|
|
1550
|
+
}
|
|
1551
|
+
});
|
|
1552
|
+
if (equals_statistics_items === false) {
|
|
1553
|
+
return false;
|
|
1554
|
+
}
|
|
1555
|
+
return true;
|
|
1556
|
+
}
|
|
1557
|
+
const ingest$2 = function ExternalServiceStatisticsOutputRepresentationIngest(input, path, luvio, store, timestamp) {
|
|
1558
|
+
if (process.env.NODE_ENV !== 'production') {
|
|
1559
|
+
const validateError = validate$5(input);
|
|
1560
|
+
if (validateError !== null) {
|
|
1561
|
+
throw validateError;
|
|
1562
|
+
}
|
|
1563
|
+
}
|
|
1564
|
+
const key = path.fullPath;
|
|
1565
|
+
const ttlToUse = path.ttl !== undefined ? path.ttl : 300000;
|
|
1566
|
+
ingestShape(input, path, luvio, store, timestamp, ttlToUse, key, normalize$2, "external-services", VERSION$3, RepresentationType$2, equals$3);
|
|
1567
|
+
return createLink(key);
|
|
1568
|
+
};
|
|
1569
|
+
function getTypeCacheKeys$2(rootKeySet, luvio, input, fullPathFactory) {
|
|
1570
|
+
// root cache key (uses fullPathFactory if keyBuilderFromType isn't defined)
|
|
1571
|
+
const rootKey = fullPathFactory();
|
|
1572
|
+
rootKeySet.set(rootKey, {
|
|
1573
|
+
namespace: keyPrefix,
|
|
1574
|
+
representationName: RepresentationType$2,
|
|
1575
|
+
mergeable: false
|
|
1576
|
+
});
|
|
1577
|
+
}
|
|
1578
|
+
|
|
1579
|
+
function select$6(luvio, params) {
|
|
1580
|
+
return select$7();
|
|
1581
|
+
}
|
|
1582
|
+
function keyBuilder$6(luvio, params) {
|
|
1583
|
+
return keyPrefix + '::ExternalServiceStatisticsOutputRepresentation:(' + ')';
|
|
1584
|
+
}
|
|
1585
|
+
function getResponseCacheKeys$3(storeKeyMap, luvio, resourceParams, response) {
|
|
1586
|
+
getTypeCacheKeys$2(storeKeyMap, luvio, response, () => keyBuilder$6());
|
|
1587
|
+
}
|
|
1588
|
+
function ingestSuccess$3(luvio, resourceParams, response, snapshotRefresh) {
|
|
1589
|
+
const { body } = response;
|
|
1590
|
+
const key = keyBuilder$6();
|
|
1591
|
+
luvio.storeIngest(key, ingest$2, body);
|
|
1592
|
+
const snapshot = luvio.storeLookup({
|
|
1593
|
+
recordId: key,
|
|
1594
|
+
node: select$6(),
|
|
1595
|
+
variables: {},
|
|
1596
|
+
}, snapshotRefresh);
|
|
1597
|
+
if (process.env.NODE_ENV !== 'production') {
|
|
1598
|
+
if (snapshot.state !== 'Fulfilled') {
|
|
1599
|
+
throw new Error('Invalid network response. Expected resource response to result in Fulfilled snapshot');
|
|
1600
|
+
}
|
|
1601
|
+
}
|
|
1602
|
+
deepFreeze(snapshot.data);
|
|
1603
|
+
return snapshot;
|
|
1604
|
+
}
|
|
1605
|
+
function ingestError$2(luvio, params, error, snapshotRefresh) {
|
|
1606
|
+
const key = keyBuilder$6();
|
|
1607
|
+
const errorSnapshot = luvio.errorSnapshot(error, snapshotRefresh);
|
|
1608
|
+
luvio.storeIngestError(key, errorSnapshot);
|
|
1609
|
+
return errorSnapshot;
|
|
1610
|
+
}
|
|
1611
|
+
function createResourceRequest$3(config) {
|
|
1612
|
+
const headers = {};
|
|
1613
|
+
return {
|
|
1614
|
+
baseUri: '/services/data/v66.0',
|
|
1615
|
+
basePath: '/externalservices/statistics/services',
|
|
1616
|
+
method: 'get',
|
|
1617
|
+
body: null,
|
|
1618
|
+
urlParams: {},
|
|
1619
|
+
queryParams: {},
|
|
1620
|
+
headers,
|
|
1621
|
+
priority: 'normal',
|
|
1622
|
+
};
|
|
1623
|
+
}
|
|
1624
|
+
|
|
1625
|
+
const adapterName$3 = 'getStatistics';
|
|
1626
|
+
const getStatistics_ConfigPropertyMetadata = [];
|
|
1627
|
+
const getStatistics_ConfigPropertyNames = /*#__PURE__*/ buildAdapterValidationConfig(adapterName$3, getStatistics_ConfigPropertyMetadata);
|
|
1628
|
+
const createResourceParams$3 = /*#__PURE__*/ createResourceParams$7(getStatistics_ConfigPropertyMetadata);
|
|
1629
|
+
function keyBuilder$5(luvio, config) {
|
|
1630
|
+
createResourceParams$3(config);
|
|
1631
|
+
return keyBuilder$6();
|
|
1632
|
+
}
|
|
1633
|
+
function typeCheckConfig$3(untrustedConfig) {
|
|
1634
|
+
const config = {};
|
|
1635
|
+
return config;
|
|
1636
|
+
}
|
|
1637
|
+
function validateAdapterConfig$3(untrustedConfig, configPropertyNames) {
|
|
1638
|
+
if (!untrustedIsObject(untrustedConfig)) {
|
|
1639
|
+
return null;
|
|
1640
|
+
}
|
|
1641
|
+
if (process.env.NODE_ENV !== 'production') {
|
|
1642
|
+
validateConfig(untrustedConfig, configPropertyNames);
|
|
1643
|
+
}
|
|
1644
|
+
const config = typeCheckConfig$3();
|
|
1645
|
+
if (!areRequiredParametersPresent(config, configPropertyNames)) {
|
|
1646
|
+
return null;
|
|
1647
|
+
}
|
|
1648
|
+
return config;
|
|
1649
|
+
}
|
|
1650
|
+
function adapterFragment$2(luvio, config) {
|
|
1651
|
+
createResourceParams$3(config);
|
|
1652
|
+
return select$6();
|
|
1653
|
+
}
|
|
1654
|
+
function onFetchResponseSuccess$2(luvio, config, resourceParams, response) {
|
|
1655
|
+
const snapshot = ingestSuccess$3(luvio, resourceParams, response, {
|
|
1656
|
+
config,
|
|
1657
|
+
resolve: () => buildNetworkSnapshot$3(luvio, config, snapshotRefreshOptions)
|
|
1658
|
+
});
|
|
1659
|
+
return luvio.storeBroadcast().then(() => snapshot);
|
|
1660
|
+
}
|
|
1661
|
+
function onFetchResponseError$2(luvio, config, resourceParams, response) {
|
|
1662
|
+
const snapshot = ingestError$2(luvio, resourceParams, response, {
|
|
1663
|
+
config,
|
|
1664
|
+
resolve: () => buildNetworkSnapshot$3(luvio, config, snapshotRefreshOptions)
|
|
1665
|
+
});
|
|
1666
|
+
return luvio.storeBroadcast().then(() => snapshot);
|
|
1667
|
+
}
|
|
1668
|
+
function buildNetworkSnapshot$3(luvio, config, options) {
|
|
1669
|
+
const resourceParams = createResourceParams$3(config);
|
|
1670
|
+
const request = createResourceRequest$3();
|
|
1671
|
+
return luvio.dispatchResourceRequest(request, options)
|
|
1672
|
+
.then((response) => {
|
|
1673
|
+
return luvio.handleSuccessResponse(() => onFetchResponseSuccess$2(luvio, config, resourceParams, response), () => {
|
|
1674
|
+
const cache = new StoreKeyMap();
|
|
1675
|
+
getResponseCacheKeys$3(cache, luvio, resourceParams, response.body);
|
|
1676
|
+
return cache;
|
|
1677
|
+
});
|
|
1678
|
+
}, (response) => {
|
|
1679
|
+
return luvio.handleErrorResponse(() => onFetchResponseError$2(luvio, config, resourceParams, response));
|
|
1680
|
+
});
|
|
1681
|
+
}
|
|
1682
|
+
function buildNetworkSnapshotCachePolicy$2(context, coercedAdapterRequestContext) {
|
|
1683
|
+
return buildNetworkSnapshotCachePolicy$6(context, coercedAdapterRequestContext, buildNetworkSnapshot$3, undefined, false);
|
|
1684
|
+
}
|
|
1685
|
+
function buildCachedSnapshotCachePolicy$2(context, storeLookup) {
|
|
1686
|
+
const { luvio, config } = context;
|
|
1687
|
+
const selector = {
|
|
1688
|
+
recordId: keyBuilder$5(luvio, config),
|
|
1689
|
+
node: adapterFragment$2(luvio, config),
|
|
1690
|
+
variables: {},
|
|
1691
|
+
};
|
|
1692
|
+
const cacheSnapshot = storeLookup(selector, {
|
|
1693
|
+
config,
|
|
1694
|
+
resolve: () => buildNetworkSnapshot$3(luvio, config, snapshotRefreshOptions)
|
|
1695
|
+
});
|
|
1696
|
+
return cacheSnapshot;
|
|
1697
|
+
}
|
|
1698
|
+
const getStatisticsAdapterFactory = (luvio) => function externalServices__getStatistics(untrustedConfig, requestContext) {
|
|
1699
|
+
const config = validateAdapterConfig$3(untrustedConfig, getStatistics_ConfigPropertyNames);
|
|
1700
|
+
// Invalid or incomplete config
|
|
1701
|
+
if (config === null) {
|
|
1702
|
+
return null;
|
|
1703
|
+
}
|
|
1704
|
+
return luvio.applyCachePolicy((requestContext || {}), { config, luvio }, // BuildSnapshotContext
|
|
1705
|
+
buildCachedSnapshotCachePolicy$2, buildNetworkSnapshotCachePolicy$2);
|
|
1706
|
+
};
|
|
1707
|
+
|
|
1708
|
+
function select$5(luvio, params) {
|
|
1709
|
+
return select$7();
|
|
1710
|
+
}
|
|
1711
|
+
function keyBuilder$4(luvio, params) {
|
|
1712
|
+
return keyPrefix + '::ExternalServiceStatisticsOutputRepresentation:(' + 'registrationName:' + params.urlParams.registrationName + ')';
|
|
1713
|
+
}
|
|
1714
|
+
function getResponseCacheKeys$2(storeKeyMap, luvio, resourceParams, response) {
|
|
1715
|
+
getTypeCacheKeys$2(storeKeyMap, luvio, response, () => keyBuilder$4(luvio, resourceParams));
|
|
1716
|
+
}
|
|
1717
|
+
function ingestSuccess$2(luvio, resourceParams, response, snapshotRefresh) {
|
|
1718
|
+
const { body } = response;
|
|
1719
|
+
const key = keyBuilder$4(luvio, resourceParams);
|
|
1720
|
+
luvio.storeIngest(key, ingest$2, body);
|
|
1721
|
+
const snapshot = luvio.storeLookup({
|
|
1722
|
+
recordId: key,
|
|
1723
|
+
node: select$5(),
|
|
1724
|
+
variables: {},
|
|
1725
|
+
}, snapshotRefresh);
|
|
1726
|
+
if (process.env.NODE_ENV !== 'production') {
|
|
1727
|
+
if (snapshot.state !== 'Fulfilled') {
|
|
1728
|
+
throw new Error('Invalid network response. Expected resource response to result in Fulfilled snapshot');
|
|
1729
|
+
}
|
|
1730
|
+
}
|
|
1731
|
+
deepFreeze(snapshot.data);
|
|
1732
|
+
return snapshot;
|
|
1733
|
+
}
|
|
1734
|
+
function ingestError$1(luvio, params, error, snapshotRefresh) {
|
|
1735
|
+
const key = keyBuilder$4(luvio, params);
|
|
1736
|
+
const errorSnapshot = luvio.errorSnapshot(error, snapshotRefresh);
|
|
1737
|
+
luvio.storeIngestError(key, errorSnapshot);
|
|
1738
|
+
return errorSnapshot;
|
|
1739
|
+
}
|
|
1740
|
+
function createResourceRequest$2(config) {
|
|
1741
|
+
const headers = {};
|
|
1742
|
+
return {
|
|
1743
|
+
baseUri: '/services/data/v66.0',
|
|
1744
|
+
basePath: '/externalservices/statistics/services/' + config.urlParams.registrationName + '',
|
|
1745
|
+
method: 'get',
|
|
1746
|
+
body: null,
|
|
1747
|
+
urlParams: config.urlParams,
|
|
1748
|
+
queryParams: {},
|
|
1749
|
+
headers,
|
|
1750
|
+
priority: 'normal',
|
|
1751
|
+
};
|
|
1752
|
+
}
|
|
1753
|
+
|
|
1754
|
+
const adapterName$2 = 'getStatisticsForService';
|
|
1755
|
+
const getStatisticsForService_ConfigPropertyMetadata = [
|
|
1756
|
+
generateParamConfigMetadata('registrationName', true, 0 /* UrlParameter */, 0 /* String */),
|
|
1757
|
+
];
|
|
1758
|
+
const getStatisticsForService_ConfigPropertyNames = /*#__PURE__*/ buildAdapterValidationConfig(adapterName$2, getStatisticsForService_ConfigPropertyMetadata);
|
|
1759
|
+
const createResourceParams$2 = /*#__PURE__*/ createResourceParams$7(getStatisticsForService_ConfigPropertyMetadata);
|
|
1760
|
+
function keyBuilder$3(luvio, config) {
|
|
1761
|
+
const resourceParams = createResourceParams$2(config);
|
|
1762
|
+
return keyBuilder$4(luvio, resourceParams);
|
|
1763
|
+
}
|
|
1764
|
+
function typeCheckConfig$2(untrustedConfig) {
|
|
1765
|
+
const config = {};
|
|
1766
|
+
typeCheckConfig$7(untrustedConfig, config, getStatisticsForService_ConfigPropertyMetadata);
|
|
1767
|
+
return config;
|
|
1768
|
+
}
|
|
1769
|
+
function validateAdapterConfig$2(untrustedConfig, configPropertyNames) {
|
|
1770
|
+
if (!untrustedIsObject(untrustedConfig)) {
|
|
1771
|
+
return null;
|
|
1772
|
+
}
|
|
1773
|
+
if (process.env.NODE_ENV !== 'production') {
|
|
1774
|
+
validateConfig(untrustedConfig, configPropertyNames);
|
|
1775
|
+
}
|
|
1776
|
+
const config = typeCheckConfig$2(untrustedConfig);
|
|
1777
|
+
if (!areRequiredParametersPresent(config, configPropertyNames)) {
|
|
1778
|
+
return null;
|
|
1779
|
+
}
|
|
1780
|
+
return config;
|
|
1781
|
+
}
|
|
1782
|
+
function adapterFragment$1(luvio, config) {
|
|
1783
|
+
createResourceParams$2(config);
|
|
1784
|
+
return select$5();
|
|
1785
|
+
}
|
|
1786
|
+
function onFetchResponseSuccess$1(luvio, config, resourceParams, response) {
|
|
1787
|
+
const snapshot = ingestSuccess$2(luvio, resourceParams, response, {
|
|
1788
|
+
config,
|
|
1789
|
+
resolve: () => buildNetworkSnapshot$2(luvio, config, snapshotRefreshOptions)
|
|
1790
|
+
});
|
|
1791
|
+
return luvio.storeBroadcast().then(() => snapshot);
|
|
1792
|
+
}
|
|
1793
|
+
function onFetchResponseError$1(luvio, config, resourceParams, response) {
|
|
1794
|
+
const snapshot = ingestError$1(luvio, resourceParams, response, {
|
|
1795
|
+
config,
|
|
1796
|
+
resolve: () => buildNetworkSnapshot$2(luvio, config, snapshotRefreshOptions)
|
|
1797
|
+
});
|
|
1798
|
+
return luvio.storeBroadcast().then(() => snapshot);
|
|
1799
|
+
}
|
|
1800
|
+
function buildNetworkSnapshot$2(luvio, config, options) {
|
|
1801
|
+
const resourceParams = createResourceParams$2(config);
|
|
1802
|
+
const request = createResourceRequest$2(resourceParams);
|
|
1803
|
+
return luvio.dispatchResourceRequest(request, options)
|
|
1804
|
+
.then((response) => {
|
|
1805
|
+
return luvio.handleSuccessResponse(() => onFetchResponseSuccess$1(luvio, config, resourceParams, response), () => {
|
|
1806
|
+
const cache = new StoreKeyMap();
|
|
1807
|
+
getResponseCacheKeys$2(cache, luvio, resourceParams, response.body);
|
|
1808
|
+
return cache;
|
|
1809
|
+
});
|
|
1810
|
+
}, (response) => {
|
|
1811
|
+
return luvio.handleErrorResponse(() => onFetchResponseError$1(luvio, config, resourceParams, response));
|
|
1812
|
+
});
|
|
1813
|
+
}
|
|
1814
|
+
function buildNetworkSnapshotCachePolicy$1(context, coercedAdapterRequestContext) {
|
|
1815
|
+
return buildNetworkSnapshotCachePolicy$6(context, coercedAdapterRequestContext, buildNetworkSnapshot$2, undefined, false);
|
|
1816
|
+
}
|
|
1817
|
+
function buildCachedSnapshotCachePolicy$1(context, storeLookup) {
|
|
1818
|
+
const { luvio, config } = context;
|
|
1819
|
+
const selector = {
|
|
1820
|
+
recordId: keyBuilder$3(luvio, config),
|
|
1821
|
+
node: adapterFragment$1(luvio, config),
|
|
1822
|
+
variables: {},
|
|
1823
|
+
};
|
|
1824
|
+
const cacheSnapshot = storeLookup(selector, {
|
|
1825
|
+
config,
|
|
1826
|
+
resolve: () => buildNetworkSnapshot$2(luvio, config, snapshotRefreshOptions)
|
|
1827
|
+
});
|
|
1828
|
+
return cacheSnapshot;
|
|
1829
|
+
}
|
|
1830
|
+
const getStatisticsForServiceAdapterFactory = (luvio) => function externalServices__getStatisticsForService(untrustedConfig, requestContext) {
|
|
1831
|
+
const config = validateAdapterConfig$2(untrustedConfig, getStatisticsForService_ConfigPropertyNames);
|
|
1832
|
+
// Invalid or incomplete config
|
|
1833
|
+
if (config === null) {
|
|
1834
|
+
return null;
|
|
1835
|
+
}
|
|
1836
|
+
return luvio.applyCachePolicy((requestContext || {}), { config, luvio }, // BuildSnapshotContext
|
|
1837
|
+
buildCachedSnapshotCachePolicy$1, buildNetworkSnapshotCachePolicy$1);
|
|
1838
|
+
};
|
|
1839
|
+
|
|
1840
|
+
function validate$4(obj, path = 'TestConnectionInputRepresentation') {
|
|
1841
|
+
const v_error = (() => {
|
|
1842
|
+
if (typeof obj !== 'object' || ArrayIsArray(obj) || obj === null) {
|
|
1843
|
+
return new TypeError('Expected "object" but received "' + typeof obj + '" (at "' + path + '")');
|
|
1844
|
+
}
|
|
1845
|
+
const obj_mediaType = obj.mediaType;
|
|
1846
|
+
const path_mediaType = path + '.mediaType';
|
|
1847
|
+
if (typeof obj_mediaType !== 'string') {
|
|
1848
|
+
return new TypeError('Expected "string" but received "' + typeof obj_mediaType + '" (at "' + path_mediaType + '")');
|
|
1849
|
+
}
|
|
1850
|
+
const obj_method = obj.method;
|
|
1851
|
+
const path_method = path + '.method';
|
|
1852
|
+
if (typeof obj_method !== 'string') {
|
|
1853
|
+
return new TypeError('Expected "string" but received "' + typeof obj_method + '" (at "' + path_method + '")');
|
|
1854
|
+
}
|
|
1855
|
+
const obj_namedCredentialName = obj.namedCredentialName;
|
|
1856
|
+
const path_namedCredentialName = path + '.namedCredentialName';
|
|
1857
|
+
if (typeof obj_namedCredentialName !== 'string') {
|
|
1858
|
+
return new TypeError('Expected "string" but received "' + typeof obj_namedCredentialName + '" (at "' + path_namedCredentialName + '")');
|
|
1859
|
+
}
|
|
1860
|
+
const obj_parameters = obj.parameters;
|
|
1861
|
+
const path_parameters = path + '.parameters';
|
|
1862
|
+
if (!ArrayIsArray(obj_parameters)) {
|
|
1863
|
+
return new TypeError('Expected "array" but received "' + typeof obj_parameters + '" (at "' + path_parameters + '")');
|
|
1864
|
+
}
|
|
1865
|
+
for (let i = 0; i < obj_parameters.length; i++) {
|
|
1866
|
+
const obj_parameters_item = obj_parameters[i];
|
|
1867
|
+
const path_parameters_item = path_parameters + '[' + i + ']';
|
|
1868
|
+
const referencepath_parameters_itemValidationError = validate$b(obj_parameters_item, path_parameters_item);
|
|
1869
|
+
if (referencepath_parameters_itemValidationError !== null) {
|
|
1870
|
+
let message = 'Object doesn\'t match OpenApiSpecInferenceParameterRepresentation (at "' + path_parameters_item + '")\n';
|
|
1871
|
+
message += referencepath_parameters_itemValidationError.message.split('\n').map((line) => '\t' + line).join('\n');
|
|
1872
|
+
return new TypeError(message);
|
|
1873
|
+
}
|
|
1874
|
+
}
|
|
1875
|
+
const obj_path = obj.path;
|
|
1876
|
+
const path_path = path + '.path';
|
|
1877
|
+
if (typeof obj_path !== 'string') {
|
|
1878
|
+
return new TypeError('Expected "string" but received "' + typeof obj_path + '" (at "' + path_path + '")');
|
|
1879
|
+
}
|
|
1880
|
+
if (obj.requestBody !== undefined) {
|
|
1881
|
+
const obj_requestBody = obj.requestBody;
|
|
1882
|
+
const path_requestBody = path + '.requestBody';
|
|
1883
|
+
if (typeof obj_requestBody !== 'object' || ArrayIsArray(obj_requestBody) || obj_requestBody === null) {
|
|
1884
|
+
return new TypeError('Expected "object" but received "' + typeof obj_requestBody + '" (at "' + path_requestBody + '")');
|
|
1885
|
+
}
|
|
1886
|
+
}
|
|
1887
|
+
})();
|
|
1888
|
+
return v_error === undefined ? null : v_error;
|
|
1889
|
+
}
|
|
1890
|
+
|
|
1891
|
+
const TTL = 100;
|
|
1892
|
+
const VERSION$2 = "fe81d2c792e1804b5b6aff705f3a6b0a";
|
|
1893
|
+
function validate$3(obj, path = 'TestConnectionOutputRepresentation') {
|
|
1894
|
+
const v_error = (() => {
|
|
1895
|
+
if (typeof obj !== 'object' || ArrayIsArray(obj) || obj === null) {
|
|
1896
|
+
return new TypeError('Expected "object" but received "' + typeof obj + '" (at "' + path + '")');
|
|
1897
|
+
}
|
|
1898
|
+
if (obj.dataShape !== undefined) {
|
|
1899
|
+
const obj_dataShape = obj.dataShape;
|
|
1900
|
+
const path_dataShape = path + '.dataShape';
|
|
1901
|
+
let obj_dataShape_union0 = null;
|
|
1902
|
+
const obj_dataShape_union0_error = (() => {
|
|
1903
|
+
const referencepath_dataShapeValidationError = validate$c(obj_dataShape, path_dataShape);
|
|
1904
|
+
if (referencepath_dataShapeValidationError !== null) {
|
|
1905
|
+
let message = 'Object doesn\'t match DataShapeInferenceOutputRepresentation (at "' + path_dataShape + '")\n';
|
|
1906
|
+
message += referencepath_dataShapeValidationError.message.split('\n').map((line) => '\t' + line).join('\n');
|
|
1907
|
+
return new TypeError(message);
|
|
1908
|
+
}
|
|
1909
|
+
})();
|
|
1910
|
+
if (obj_dataShape_union0_error != null) {
|
|
1911
|
+
obj_dataShape_union0 = obj_dataShape_union0_error.message;
|
|
1912
|
+
}
|
|
1913
|
+
let obj_dataShape_union1 = null;
|
|
1914
|
+
const obj_dataShape_union1_error = (() => {
|
|
1915
|
+
if (obj_dataShape !== null) {
|
|
1916
|
+
return new TypeError('Expected "null" but received "' + typeof obj_dataShape + '" (at "' + path_dataShape + '")');
|
|
1917
|
+
}
|
|
1918
|
+
})();
|
|
1919
|
+
if (obj_dataShape_union1_error != null) {
|
|
1920
|
+
obj_dataShape_union1 = obj_dataShape_union1_error.message;
|
|
1921
|
+
}
|
|
1922
|
+
if (obj_dataShape_union0 && obj_dataShape_union1) {
|
|
1923
|
+
let message = 'Object doesn\'t match union (at "' + path_dataShape + '")';
|
|
1924
|
+
message += '\n' + obj_dataShape_union0.split('\n').map((line) => '\t' + line).join('\n');
|
|
1925
|
+
message += '\n' + obj_dataShape_union1.split('\n').map((line) => '\t' + line).join('\n');
|
|
1926
|
+
return new TypeError(message);
|
|
1927
|
+
}
|
|
1928
|
+
}
|
|
1929
|
+
const obj_errorMessages = obj.errorMessages;
|
|
1930
|
+
const path_errorMessages = path + '.errorMessages';
|
|
1931
|
+
if (!ArrayIsArray(obj_errorMessages)) {
|
|
1932
|
+
return new TypeError('Expected "array" but received "' + typeof obj_errorMessages + '" (at "' + path_errorMessages + '")');
|
|
1933
|
+
}
|
|
1934
|
+
for (let i = 0; i < obj_errorMessages.length; i++) {
|
|
1935
|
+
const obj_errorMessages_item = obj_errorMessages[i];
|
|
1936
|
+
const path_errorMessages_item = path_errorMessages + '[' + i + ']';
|
|
1937
|
+
const referencepath_errorMessages_itemValidationError = validate$d(obj_errorMessages_item, path_errorMessages_item);
|
|
1938
|
+
if (referencepath_errorMessages_itemValidationError !== null) {
|
|
1939
|
+
let message = 'Object doesn\'t match InferenceErrorMessageRepresentation (at "' + path_errorMessages_item + '")\n';
|
|
1940
|
+
message += referencepath_errorMessages_itemValidationError.message.split('\n').map((line) => '\t' + line).join('\n');
|
|
1941
|
+
return new TypeError(message);
|
|
1942
|
+
}
|
|
1943
|
+
}
|
|
1944
|
+
if (obj.rawData !== undefined) {
|
|
1945
|
+
const obj_rawData = obj.rawData;
|
|
1946
|
+
const path_rawData = path + '.rawData';
|
|
1947
|
+
if (typeof obj_rawData !== 'string') {
|
|
1948
|
+
return new TypeError('Expected "string" but received "' + typeof obj_rawData + '" (at "' + path_rawData + '")');
|
|
1949
|
+
}
|
|
1950
|
+
}
|
|
1951
|
+
if (obj.statusCode !== undefined) {
|
|
1952
|
+
const obj_statusCode = obj.statusCode;
|
|
1953
|
+
const path_statusCode = path + '.statusCode';
|
|
1954
|
+
if (typeof obj_statusCode !== 'string') {
|
|
1955
|
+
return new TypeError('Expected "string" but received "' + typeof obj_statusCode + '" (at "' + path_statusCode + '")');
|
|
1956
|
+
}
|
|
1957
|
+
}
|
|
1958
|
+
})();
|
|
1959
|
+
return v_error === undefined ? null : v_error;
|
|
1960
|
+
}
|
|
1961
|
+
const RepresentationType$1 = 'TestConnectionOutputRepresentation';
|
|
1962
|
+
function normalize$1(input, existing, path, luvio, store, timestamp) {
|
|
1963
|
+
return input;
|
|
1964
|
+
}
|
|
1965
|
+
const select$4 = function TestConnectionOutputRepresentationSelect() {
|
|
1966
|
+
return {
|
|
1967
|
+
kind: 'Fragment',
|
|
1968
|
+
version: VERSION$2,
|
|
1969
|
+
private: [],
|
|
1970
|
+
opaque: true
|
|
1971
|
+
};
|
|
1972
|
+
};
|
|
1973
|
+
function equals$2(existing, incoming) {
|
|
1974
|
+
if (JSONStringify(incoming) !== JSONStringify(existing)) {
|
|
1975
|
+
return false;
|
|
1976
|
+
}
|
|
1977
|
+
return true;
|
|
1978
|
+
}
|
|
1979
|
+
const ingest$1 = function TestConnectionOutputRepresentationIngest(input, path, luvio, store, timestamp) {
|
|
1980
|
+
if (process.env.NODE_ENV !== 'production') {
|
|
1981
|
+
const validateError = validate$3(input);
|
|
1982
|
+
if (validateError !== null) {
|
|
1983
|
+
throw validateError;
|
|
1984
|
+
}
|
|
1985
|
+
}
|
|
1986
|
+
const key = path.fullPath;
|
|
1987
|
+
const ttlToUse = TTL;
|
|
1988
|
+
ingestShape(input, path, luvio, store, timestamp, ttlToUse, key, normalize$1, "external-services", VERSION$2, RepresentationType$1, equals$2);
|
|
1989
|
+
return createLink(key);
|
|
1990
|
+
};
|
|
1991
|
+
function getTypeCacheKeys$1(rootKeySet, luvio, input, fullPathFactory) {
|
|
1992
|
+
// root cache key (uses fullPathFactory if keyBuilderFromType isn't defined)
|
|
1993
|
+
const rootKey = fullPathFactory();
|
|
1994
|
+
rootKeySet.set(rootKey, {
|
|
1995
|
+
namespace: keyPrefix,
|
|
1996
|
+
representationName: RepresentationType$1,
|
|
1997
|
+
mergeable: false
|
|
1998
|
+
});
|
|
1999
|
+
}
|
|
2000
|
+
|
|
2001
|
+
function select$3(luvio, params) {
|
|
2002
|
+
return select$4();
|
|
2003
|
+
}
|
|
2004
|
+
function keyBuilder$2(luvio, params) {
|
|
2005
|
+
return keyPrefix + '::TestConnectionOutputRepresentation:(' + 'version:' + params.urlParams.version + ',' + 'configuration.mediaType:' + params.body.configuration.mediaType + '::' + 'configuration.method:' + params.body.configuration.method + '::' + 'configuration.namedCredentialName:' + params.body.configuration.namedCredentialName + '::' + '[' + params.body.configuration.parameters.map(element => (element.description === undefined ? 'configuration.parameters.description' : 'configuration.parameters.description:' + element.description) + '::' + (element.example === undefined ? 'configuration.parameters.example' : 'configuration.parameters.example:' + element.example) + '::' + 'configuration.parameters.location:' + element.location + '::' + 'configuration.parameters.name:' + element.name + '::' + 'configuration.parameters.required:' + element.required + '::' + 'configuration.parameters.type:' + element.type).join(',') + ']' + '::' + 'configuration.path:' + params.body.configuration.path + '::' + stableJSONStringify(params.body.configuration.requestBody) + ')';
|
|
2006
|
+
}
|
|
2007
|
+
function getResponseCacheKeys$1(storeKeyMap, luvio, resourceParams, response) {
|
|
2008
|
+
getTypeCacheKeys$1(storeKeyMap, luvio, response, () => keyBuilder$2(luvio, resourceParams));
|
|
2009
|
+
}
|
|
2010
|
+
function ingestSuccess$1(luvio, resourceParams, response, snapshotRefresh) {
|
|
2011
|
+
const { body } = response;
|
|
2012
|
+
const key = keyBuilder$2(luvio, resourceParams);
|
|
2013
|
+
luvio.storeIngest(key, ingest$1, body);
|
|
2014
|
+
const snapshot = luvio.storeLookup({
|
|
2015
|
+
recordId: key,
|
|
2016
|
+
node: select$3(),
|
|
2017
|
+
variables: {},
|
|
2018
|
+
}, snapshotRefresh);
|
|
2019
|
+
if (process.env.NODE_ENV !== 'production') {
|
|
2020
|
+
if (snapshot.state !== 'Fulfilled') {
|
|
2021
|
+
throw new Error('Invalid network response. Expected resource response to result in Fulfilled snapshot');
|
|
2022
|
+
}
|
|
2023
|
+
}
|
|
2024
|
+
deepFreeze(snapshot.data);
|
|
2025
|
+
return snapshot;
|
|
2026
|
+
}
|
|
2027
|
+
function ingestError(luvio, params, error, snapshotRefresh) {
|
|
2028
|
+
const key = keyBuilder$2(luvio, params);
|
|
2029
|
+
const errorSnapshot = luvio.errorSnapshot(error, snapshotRefresh);
|
|
2030
|
+
const storeMetadataParams = {
|
|
2031
|
+
ttl: TTL,
|
|
2032
|
+
namespace: keyPrefix,
|
|
2033
|
+
version: VERSION$2,
|
|
2034
|
+
representationName: RepresentationType$1
|
|
2035
|
+
};
|
|
2036
|
+
luvio.storeIngestError(key, errorSnapshot, storeMetadataParams);
|
|
2037
|
+
return errorSnapshot;
|
|
2038
|
+
}
|
|
2039
|
+
function createResourceRequest$1(config) {
|
|
2040
|
+
const headers = {};
|
|
2041
|
+
return {
|
|
2042
|
+
baseUri: '/services/data/v66.0',
|
|
2043
|
+
basePath: '/externalservices/inference/datashape/' + config.urlParams.version + '/sendrequest',
|
|
2044
|
+
method: 'post',
|
|
2045
|
+
body: config.body,
|
|
2046
|
+
urlParams: config.urlParams,
|
|
2047
|
+
queryParams: {},
|
|
2048
|
+
headers,
|
|
2049
|
+
priority: 'normal',
|
|
2050
|
+
};
|
|
2051
|
+
}
|
|
2052
|
+
|
|
2053
|
+
const adapterName$1 = 'sendTestConnectionRequest';
|
|
2054
|
+
const sendTestConnectionRequest_ConfigPropertyMetadata = [
|
|
2055
|
+
generateParamConfigMetadata('version', true, 0 /* UrlParameter */, 0 /* String */),
|
|
2056
|
+
generateParamConfigMetadata('configuration', true, 2 /* Body */, 4 /* Unsupported */),
|
|
2057
|
+
];
|
|
2058
|
+
const sendTestConnectionRequest_ConfigPropertyNames = /*#__PURE__*/ buildAdapterValidationConfig(adapterName$1, sendTestConnectionRequest_ConfigPropertyMetadata);
|
|
2059
|
+
const createResourceParams$1 = /*#__PURE__*/ createResourceParams$7(sendTestConnectionRequest_ConfigPropertyMetadata);
|
|
2060
|
+
function keyBuilder$1(luvio, config) {
|
|
2061
|
+
const resourceParams = createResourceParams$1(config);
|
|
2062
|
+
return keyBuilder$2(luvio, resourceParams);
|
|
2063
|
+
}
|
|
2064
|
+
function typeCheckConfig$1(untrustedConfig) {
|
|
2065
|
+
const config = {};
|
|
2066
|
+
typeCheckConfig$7(untrustedConfig, config, sendTestConnectionRequest_ConfigPropertyMetadata);
|
|
2067
|
+
const untrustedConfig_configuration = untrustedConfig.configuration;
|
|
2068
|
+
const referenceTestConnectionInputRepresentationValidationError = validate$4(untrustedConfig_configuration);
|
|
2069
|
+
if (referenceTestConnectionInputRepresentationValidationError === null) {
|
|
2070
|
+
config.configuration = untrustedConfig_configuration;
|
|
2071
|
+
}
|
|
2072
|
+
return config;
|
|
2073
|
+
}
|
|
2074
|
+
function validateAdapterConfig$1(untrustedConfig, configPropertyNames) {
|
|
2075
|
+
if (!untrustedIsObject(untrustedConfig)) {
|
|
2076
|
+
return null;
|
|
2077
|
+
}
|
|
2078
|
+
if (process.env.NODE_ENV !== 'production') {
|
|
2079
|
+
validateConfig(untrustedConfig, configPropertyNames);
|
|
2080
|
+
}
|
|
2081
|
+
const config = typeCheckConfig$1(untrustedConfig);
|
|
2082
|
+
if (!areRequiredParametersPresent(config, configPropertyNames)) {
|
|
2083
|
+
return null;
|
|
2084
|
+
}
|
|
2085
|
+
return config;
|
|
2086
|
+
}
|
|
2087
|
+
function adapterFragment(luvio, config) {
|
|
2088
|
+
createResourceParams$1(config);
|
|
2089
|
+
return select$3();
|
|
2090
|
+
}
|
|
2091
|
+
function onFetchResponseSuccess(luvio, config, resourceParams, response) {
|
|
2092
|
+
const snapshot = ingestSuccess$1(luvio, resourceParams, response, {
|
|
2093
|
+
config,
|
|
2094
|
+
resolve: () => buildNetworkSnapshot$1(luvio, config, snapshotRefreshOptions)
|
|
2095
|
+
});
|
|
2096
|
+
return luvio.storeBroadcast().then(() => snapshot);
|
|
2097
|
+
}
|
|
2098
|
+
function onFetchResponseError(luvio, config, resourceParams, response) {
|
|
2099
|
+
const snapshot = ingestError(luvio, resourceParams, response, {
|
|
2100
|
+
config,
|
|
2101
|
+
resolve: () => buildNetworkSnapshot$1(luvio, config, snapshotRefreshOptions)
|
|
2102
|
+
});
|
|
2103
|
+
return luvio.storeBroadcast().then(() => snapshot);
|
|
2104
|
+
}
|
|
2105
|
+
function buildNetworkSnapshot$1(luvio, config, options) {
|
|
2106
|
+
const resourceParams = createResourceParams$1(config);
|
|
2107
|
+
const request = createResourceRequest$1(resourceParams);
|
|
2108
|
+
return luvio.dispatchResourceRequest(request, options)
|
|
2109
|
+
.then((response) => {
|
|
2110
|
+
return luvio.handleSuccessResponse(() => onFetchResponseSuccess(luvio, config, resourceParams, response), () => {
|
|
2111
|
+
const cache = new StoreKeyMap();
|
|
2112
|
+
getResponseCacheKeys$1(cache, luvio, resourceParams, response.body);
|
|
2113
|
+
return cache;
|
|
2114
|
+
});
|
|
2115
|
+
}, (response) => {
|
|
2116
|
+
return luvio.handleErrorResponse(() => onFetchResponseError(luvio, config, resourceParams, response));
|
|
2117
|
+
});
|
|
2118
|
+
}
|
|
2119
|
+
function buildNetworkSnapshotCachePolicy(context, coercedAdapterRequestContext) {
|
|
2120
|
+
return buildNetworkSnapshotCachePolicy$6(context, coercedAdapterRequestContext, buildNetworkSnapshot$1, 'get', false);
|
|
2121
|
+
}
|
|
2122
|
+
function buildCachedSnapshotCachePolicy(context, storeLookup) {
|
|
2123
|
+
const { luvio, config } = context;
|
|
2124
|
+
const selector = {
|
|
2125
|
+
recordId: keyBuilder$1(luvio, config),
|
|
2126
|
+
node: adapterFragment(luvio, config),
|
|
2127
|
+
variables: {},
|
|
2128
|
+
};
|
|
2129
|
+
const cacheSnapshot = storeLookup(selector, {
|
|
2130
|
+
config,
|
|
2131
|
+
resolve: () => buildNetworkSnapshot$1(luvio, config, snapshotRefreshOptions)
|
|
2132
|
+
});
|
|
2133
|
+
return cacheSnapshot;
|
|
2134
|
+
}
|
|
2135
|
+
const sendTestConnectionRequestAdapterFactory = (luvio) => function externalServices__sendTestConnectionRequest(untrustedConfig, requestContext) {
|
|
2136
|
+
const config = validateAdapterConfig$1(untrustedConfig, sendTestConnectionRequest_ConfigPropertyNames);
|
|
2137
|
+
// Invalid or incomplete config
|
|
2138
|
+
if (config === null) {
|
|
2139
|
+
return null;
|
|
2140
|
+
}
|
|
2141
|
+
return luvio.applyCachePolicy((requestContext || {}), { config, luvio }, // BuildSnapshotContext
|
|
2142
|
+
buildCachedSnapshotCachePolicy, buildNetworkSnapshotCachePolicy);
|
|
2143
|
+
};
|
|
2144
|
+
|
|
2145
|
+
function validate$2(obj, path = 'SchemaValidationInputRepresentation') {
|
|
2146
|
+
const v_error = (() => {
|
|
2147
|
+
if (typeof obj !== 'object' || ArrayIsArray(obj) || obj === null) {
|
|
2148
|
+
return new TypeError('Expected "object" but received "' + typeof obj + '" (at "' + path + '")');
|
|
2149
|
+
}
|
|
2150
|
+
const obj_schema = obj.schema;
|
|
2151
|
+
const path_schema = path + '.schema';
|
|
2152
|
+
if (typeof obj_schema !== 'string') {
|
|
2153
|
+
return new TypeError('Expected "string" but received "' + typeof obj_schema + '" (at "' + path_schema + '")');
|
|
2154
|
+
}
|
|
2155
|
+
const obj_schemaName = obj.schemaName;
|
|
2156
|
+
const path_schemaName = path + '.schemaName';
|
|
2157
|
+
if (typeof obj_schemaName !== 'string') {
|
|
2158
|
+
return new TypeError('Expected "string" but received "' + typeof obj_schemaName + '" (at "' + path_schemaName + '")');
|
|
2159
|
+
}
|
|
2160
|
+
const obj_systemVersion = obj.systemVersion;
|
|
2161
|
+
const path_systemVersion = path + '.systemVersion';
|
|
2162
|
+
if (typeof obj_systemVersion !== 'number' || (typeof obj_systemVersion === 'number' && Math.floor(obj_systemVersion) !== obj_systemVersion)) {
|
|
2163
|
+
return new TypeError('Expected "integer" but received "' + typeof obj_systemVersion + '" (at "' + path_systemVersion + '")');
|
|
2164
|
+
}
|
|
2165
|
+
})();
|
|
2166
|
+
return v_error === undefined ? null : v_error;
|
|
2167
|
+
}
|
|
2168
|
+
|
|
2169
|
+
const VERSION$1 = "970029a80f127a32c6e30cda09b02a11";
|
|
2170
|
+
function validate$1(obj, path = 'SchemaValidationMessageRepresentation') {
|
|
2171
|
+
const v_error = (() => {
|
|
2172
|
+
if (typeof obj !== 'object' || ArrayIsArray(obj) || obj === null) {
|
|
2173
|
+
return new TypeError('Expected "object" but received "' + typeof obj + '" (at "' + path + '")');
|
|
2174
|
+
}
|
|
2175
|
+
if (obj.endColumn !== undefined) {
|
|
2176
|
+
const obj_endColumn = obj.endColumn;
|
|
2177
|
+
const path_endColumn = path + '.endColumn';
|
|
2178
|
+
let obj_endColumn_union0 = null;
|
|
2179
|
+
const obj_endColumn_union0_error = (() => {
|
|
2180
|
+
if (typeof obj_endColumn !== 'number' || (typeof obj_endColumn === 'number' && Math.floor(obj_endColumn) !== obj_endColumn)) {
|
|
2181
|
+
return new TypeError('Expected "integer" but received "' + typeof obj_endColumn + '" (at "' + path_endColumn + '")');
|
|
2182
|
+
}
|
|
2183
|
+
})();
|
|
2184
|
+
if (obj_endColumn_union0_error != null) {
|
|
2185
|
+
obj_endColumn_union0 = obj_endColumn_union0_error.message;
|
|
2186
|
+
}
|
|
2187
|
+
let obj_endColumn_union1 = null;
|
|
2188
|
+
const obj_endColumn_union1_error = (() => {
|
|
2189
|
+
if (obj_endColumn !== null) {
|
|
2190
|
+
return new TypeError('Expected "null" but received "' + typeof obj_endColumn + '" (at "' + path_endColumn + '")');
|
|
2191
|
+
}
|
|
2192
|
+
})();
|
|
2193
|
+
if (obj_endColumn_union1_error != null) {
|
|
2194
|
+
obj_endColumn_union1 = obj_endColumn_union1_error.message;
|
|
2195
|
+
}
|
|
2196
|
+
if (obj_endColumn_union0 && obj_endColumn_union1) {
|
|
2197
|
+
let message = 'Object doesn\'t match union (at "' + path_endColumn + '")';
|
|
2198
|
+
message += '\n' + obj_endColumn_union0.split('\n').map((line) => '\t' + line).join('\n');
|
|
2199
|
+
message += '\n' + obj_endColumn_union1.split('\n').map((line) => '\t' + line).join('\n');
|
|
2200
|
+
return new TypeError(message);
|
|
2201
|
+
}
|
|
2202
|
+
}
|
|
2203
|
+
if (obj.endLine !== undefined) {
|
|
2204
|
+
const obj_endLine = obj.endLine;
|
|
2205
|
+
const path_endLine = path + '.endLine';
|
|
2206
|
+
let obj_endLine_union0 = null;
|
|
2207
|
+
const obj_endLine_union0_error = (() => {
|
|
2208
|
+
if (typeof obj_endLine !== 'number' || (typeof obj_endLine === 'number' && Math.floor(obj_endLine) !== obj_endLine)) {
|
|
2209
|
+
return new TypeError('Expected "integer" but received "' + typeof obj_endLine + '" (at "' + path_endLine + '")');
|
|
2210
|
+
}
|
|
2211
|
+
})();
|
|
2212
|
+
if (obj_endLine_union0_error != null) {
|
|
2213
|
+
obj_endLine_union0 = obj_endLine_union0_error.message;
|
|
2214
|
+
}
|
|
2215
|
+
let obj_endLine_union1 = null;
|
|
2216
|
+
const obj_endLine_union1_error = (() => {
|
|
2217
|
+
if (obj_endLine !== null) {
|
|
2218
|
+
return new TypeError('Expected "null" but received "' + typeof obj_endLine + '" (at "' + path_endLine + '")');
|
|
2219
|
+
}
|
|
2220
|
+
})();
|
|
2221
|
+
if (obj_endLine_union1_error != null) {
|
|
2222
|
+
obj_endLine_union1 = obj_endLine_union1_error.message;
|
|
2223
|
+
}
|
|
2224
|
+
if (obj_endLine_union0 && obj_endLine_union1) {
|
|
2225
|
+
let message = 'Object doesn\'t match union (at "' + path_endLine + '")';
|
|
2226
|
+
message += '\n' + obj_endLine_union0.split('\n').map((line) => '\t' + line).join('\n');
|
|
2227
|
+
message += '\n' + obj_endLine_union1.split('\n').map((line) => '\t' + line).join('\n');
|
|
2228
|
+
return new TypeError(message);
|
|
2229
|
+
}
|
|
2230
|
+
}
|
|
2231
|
+
if (obj.endPosition !== undefined) {
|
|
2232
|
+
const obj_endPosition = obj.endPosition;
|
|
2233
|
+
const path_endPosition = path + '.endPosition';
|
|
2234
|
+
let obj_endPosition_union0 = null;
|
|
2235
|
+
const obj_endPosition_union0_error = (() => {
|
|
2236
|
+
if (typeof obj_endPosition !== 'number' || (typeof obj_endPosition === 'number' && Math.floor(obj_endPosition) !== obj_endPosition)) {
|
|
2237
|
+
return new TypeError('Expected "integer" but received "' + typeof obj_endPosition + '" (at "' + path_endPosition + '")');
|
|
2238
|
+
}
|
|
2239
|
+
})();
|
|
2240
|
+
if (obj_endPosition_union0_error != null) {
|
|
2241
|
+
obj_endPosition_union0 = obj_endPosition_union0_error.message;
|
|
2242
|
+
}
|
|
2243
|
+
let obj_endPosition_union1 = null;
|
|
2244
|
+
const obj_endPosition_union1_error = (() => {
|
|
2245
|
+
if (obj_endPosition !== null) {
|
|
2246
|
+
return new TypeError('Expected "null" but received "' + typeof obj_endPosition + '" (at "' + path_endPosition + '")');
|
|
2247
|
+
}
|
|
2248
|
+
})();
|
|
2249
|
+
if (obj_endPosition_union1_error != null) {
|
|
2250
|
+
obj_endPosition_union1 = obj_endPosition_union1_error.message;
|
|
2251
|
+
}
|
|
2252
|
+
if (obj_endPosition_union0 && obj_endPosition_union1) {
|
|
2253
|
+
let message = 'Object doesn\'t match union (at "' + path_endPosition + '")';
|
|
2254
|
+
message += '\n' + obj_endPosition_union0.split('\n').map((line) => '\t' + line).join('\n');
|
|
2255
|
+
message += '\n' + obj_endPosition_union1.split('\n').map((line) => '\t' + line).join('\n');
|
|
2256
|
+
return new TypeError(message);
|
|
2257
|
+
}
|
|
2258
|
+
}
|
|
2259
|
+
const obj_message = obj.message;
|
|
2260
|
+
const path_message = path + '.message';
|
|
2261
|
+
if (typeof obj_message !== 'string') {
|
|
2262
|
+
return new TypeError('Expected "string" but received "' + typeof obj_message + '" (at "' + path_message + '")');
|
|
2263
|
+
}
|
|
2264
|
+
if (obj.startColumn !== undefined) {
|
|
2265
|
+
const obj_startColumn = obj.startColumn;
|
|
2266
|
+
const path_startColumn = path + '.startColumn';
|
|
2267
|
+
let obj_startColumn_union0 = null;
|
|
2268
|
+
const obj_startColumn_union0_error = (() => {
|
|
2269
|
+
if (typeof obj_startColumn !== 'number' || (typeof obj_startColumn === 'number' && Math.floor(obj_startColumn) !== obj_startColumn)) {
|
|
2270
|
+
return new TypeError('Expected "integer" but received "' + typeof obj_startColumn + '" (at "' + path_startColumn + '")');
|
|
2271
|
+
}
|
|
2272
|
+
})();
|
|
2273
|
+
if (obj_startColumn_union0_error != null) {
|
|
2274
|
+
obj_startColumn_union0 = obj_startColumn_union0_error.message;
|
|
2275
|
+
}
|
|
2276
|
+
let obj_startColumn_union1 = null;
|
|
2277
|
+
const obj_startColumn_union1_error = (() => {
|
|
2278
|
+
if (obj_startColumn !== null) {
|
|
2279
|
+
return new TypeError('Expected "null" but received "' + typeof obj_startColumn + '" (at "' + path_startColumn + '")');
|
|
2280
|
+
}
|
|
2281
|
+
})();
|
|
2282
|
+
if (obj_startColumn_union1_error != null) {
|
|
2283
|
+
obj_startColumn_union1 = obj_startColumn_union1_error.message;
|
|
2284
|
+
}
|
|
2285
|
+
if (obj_startColumn_union0 && obj_startColumn_union1) {
|
|
2286
|
+
let message = 'Object doesn\'t match union (at "' + path_startColumn + '")';
|
|
2287
|
+
message += '\n' + obj_startColumn_union0.split('\n').map((line) => '\t' + line).join('\n');
|
|
2288
|
+
message += '\n' + obj_startColumn_union1.split('\n').map((line) => '\t' + line).join('\n');
|
|
2289
|
+
return new TypeError(message);
|
|
2290
|
+
}
|
|
2291
|
+
}
|
|
2292
|
+
if (obj.startLine !== undefined) {
|
|
2293
|
+
const obj_startLine = obj.startLine;
|
|
2294
|
+
const path_startLine = path + '.startLine';
|
|
2295
|
+
let obj_startLine_union0 = null;
|
|
2296
|
+
const obj_startLine_union0_error = (() => {
|
|
2297
|
+
if (typeof obj_startLine !== 'number' || (typeof obj_startLine === 'number' && Math.floor(obj_startLine) !== obj_startLine)) {
|
|
2298
|
+
return new TypeError('Expected "integer" but received "' + typeof obj_startLine + '" (at "' + path_startLine + '")');
|
|
2299
|
+
}
|
|
2300
|
+
})();
|
|
2301
|
+
if (obj_startLine_union0_error != null) {
|
|
2302
|
+
obj_startLine_union0 = obj_startLine_union0_error.message;
|
|
2303
|
+
}
|
|
2304
|
+
let obj_startLine_union1 = null;
|
|
2305
|
+
const obj_startLine_union1_error = (() => {
|
|
2306
|
+
if (obj_startLine !== null) {
|
|
2307
|
+
return new TypeError('Expected "null" but received "' + typeof obj_startLine + '" (at "' + path_startLine + '")');
|
|
2308
|
+
}
|
|
2309
|
+
})();
|
|
2310
|
+
if (obj_startLine_union1_error != null) {
|
|
2311
|
+
obj_startLine_union1 = obj_startLine_union1_error.message;
|
|
2312
|
+
}
|
|
2313
|
+
if (obj_startLine_union0 && obj_startLine_union1) {
|
|
2314
|
+
let message = 'Object doesn\'t match union (at "' + path_startLine + '")';
|
|
2315
|
+
message += '\n' + obj_startLine_union0.split('\n').map((line) => '\t' + line).join('\n');
|
|
2316
|
+
message += '\n' + obj_startLine_union1.split('\n').map((line) => '\t' + line).join('\n');
|
|
2317
|
+
return new TypeError(message);
|
|
2318
|
+
}
|
|
2319
|
+
}
|
|
2320
|
+
if (obj.startPosition !== undefined) {
|
|
2321
|
+
const obj_startPosition = obj.startPosition;
|
|
2322
|
+
const path_startPosition = path + '.startPosition';
|
|
2323
|
+
let obj_startPosition_union0 = null;
|
|
2324
|
+
const obj_startPosition_union0_error = (() => {
|
|
2325
|
+
if (typeof obj_startPosition !== 'number' || (typeof obj_startPosition === 'number' && Math.floor(obj_startPosition) !== obj_startPosition)) {
|
|
2326
|
+
return new TypeError('Expected "integer" but received "' + typeof obj_startPosition + '" (at "' + path_startPosition + '")');
|
|
2327
|
+
}
|
|
2328
|
+
})();
|
|
2329
|
+
if (obj_startPosition_union0_error != null) {
|
|
2330
|
+
obj_startPosition_union0 = obj_startPosition_union0_error.message;
|
|
2331
|
+
}
|
|
2332
|
+
let obj_startPosition_union1 = null;
|
|
2333
|
+
const obj_startPosition_union1_error = (() => {
|
|
2334
|
+
if (obj_startPosition !== null) {
|
|
2335
|
+
return new TypeError('Expected "null" but received "' + typeof obj_startPosition + '" (at "' + path_startPosition + '")');
|
|
2336
|
+
}
|
|
2337
|
+
})();
|
|
2338
|
+
if (obj_startPosition_union1_error != null) {
|
|
2339
|
+
obj_startPosition_union1 = obj_startPosition_union1_error.message;
|
|
2340
|
+
}
|
|
2341
|
+
if (obj_startPosition_union0 && obj_startPosition_union1) {
|
|
2342
|
+
let message = 'Object doesn\'t match union (at "' + path_startPosition + '")';
|
|
2343
|
+
message += '\n' + obj_startPosition_union0.split('\n').map((line) => '\t' + line).join('\n');
|
|
2344
|
+
message += '\n' + obj_startPosition_union1.split('\n').map((line) => '\t' + line).join('\n');
|
|
2345
|
+
return new TypeError(message);
|
|
2346
|
+
}
|
|
2347
|
+
}
|
|
2348
|
+
const obj_validationClass = obj.validationClass;
|
|
2349
|
+
const path_validationClass = path + '.validationClass';
|
|
2350
|
+
if (typeof obj_validationClass !== 'string') {
|
|
2351
|
+
return new TypeError('Expected "string" but received "' + typeof obj_validationClass + '" (at "' + path_validationClass + '")');
|
|
2352
|
+
}
|
|
2353
|
+
const obj_validationLevel = obj.validationLevel;
|
|
2354
|
+
const path_validationLevel = path + '.validationLevel';
|
|
2355
|
+
if (typeof obj_validationLevel !== 'string') {
|
|
2356
|
+
return new TypeError('Expected "string" but received "' + typeof obj_validationLevel + '" (at "' + path_validationLevel + '")');
|
|
2357
|
+
}
|
|
2358
|
+
})();
|
|
2359
|
+
return v_error === undefined ? null : v_error;
|
|
2360
|
+
}
|
|
2361
|
+
const select$2 = function SchemaValidationMessageRepresentationSelect() {
|
|
2362
|
+
return {
|
|
2363
|
+
kind: 'Fragment',
|
|
2364
|
+
version: VERSION$1,
|
|
2365
|
+
private: [],
|
|
2366
|
+
selections: [
|
|
2367
|
+
{
|
|
2368
|
+
name: 'endColumn',
|
|
2369
|
+
kind: 'Scalar',
|
|
2370
|
+
required: false
|
|
2371
|
+
},
|
|
2372
|
+
{
|
|
2373
|
+
name: 'endLine',
|
|
2374
|
+
kind: 'Scalar',
|
|
2375
|
+
required: false
|
|
2376
|
+
},
|
|
2377
|
+
{
|
|
2378
|
+
name: 'endPosition',
|
|
2379
|
+
kind: 'Scalar',
|
|
2380
|
+
required: false
|
|
2381
|
+
},
|
|
2382
|
+
{
|
|
2383
|
+
name: 'message',
|
|
2384
|
+
kind: 'Scalar'
|
|
2385
|
+
},
|
|
2386
|
+
{
|
|
2387
|
+
name: 'startColumn',
|
|
2388
|
+
kind: 'Scalar',
|
|
2389
|
+
required: false
|
|
2390
|
+
},
|
|
2391
|
+
{
|
|
2392
|
+
name: 'startLine',
|
|
2393
|
+
kind: 'Scalar',
|
|
2394
|
+
required: false
|
|
2395
|
+
},
|
|
2396
|
+
{
|
|
2397
|
+
name: 'startPosition',
|
|
2398
|
+
kind: 'Scalar',
|
|
2399
|
+
required: false
|
|
2400
|
+
},
|
|
2401
|
+
{
|
|
2402
|
+
name: 'validationClass',
|
|
2403
|
+
kind: 'Scalar'
|
|
2404
|
+
},
|
|
2405
|
+
{
|
|
2406
|
+
name: 'validationLevel',
|
|
2407
|
+
kind: 'Scalar'
|
|
2408
|
+
}
|
|
2409
|
+
]
|
|
2410
|
+
};
|
|
2411
|
+
};
|
|
2412
|
+
function equals$1(existing, incoming) {
|
|
2413
|
+
const existing_message = existing.message;
|
|
2414
|
+
const incoming_message = incoming.message;
|
|
2415
|
+
if (!(existing_message === incoming_message)) {
|
|
2416
|
+
return false;
|
|
2417
|
+
}
|
|
2418
|
+
const existing_validationClass = existing.validationClass;
|
|
2419
|
+
const incoming_validationClass = incoming.validationClass;
|
|
2420
|
+
if (!(existing_validationClass === incoming_validationClass)) {
|
|
2421
|
+
return false;
|
|
2422
|
+
}
|
|
2423
|
+
const existing_validationLevel = existing.validationLevel;
|
|
2424
|
+
const incoming_validationLevel = incoming.validationLevel;
|
|
2425
|
+
if (!(existing_validationLevel === incoming_validationLevel)) {
|
|
2426
|
+
return false;
|
|
2427
|
+
}
|
|
2428
|
+
const existing_endColumn = existing.endColumn;
|
|
2429
|
+
const incoming_endColumn = incoming.endColumn;
|
|
2430
|
+
// if at least one of these optionals is defined
|
|
2431
|
+
if (existing_endColumn !== undefined || incoming_endColumn !== undefined) {
|
|
2432
|
+
// if one of these is not defined we know the other is defined and therefore
|
|
2433
|
+
// not equal
|
|
2434
|
+
if (existing_endColumn === undefined || incoming_endColumn === undefined) {
|
|
2435
|
+
return false;
|
|
2436
|
+
}
|
|
2437
|
+
if (!(existing_endColumn === incoming_endColumn)) {
|
|
2438
|
+
return false;
|
|
2439
|
+
}
|
|
2440
|
+
}
|
|
2441
|
+
const existing_endLine = existing.endLine;
|
|
2442
|
+
const incoming_endLine = incoming.endLine;
|
|
2443
|
+
// if at least one of these optionals is defined
|
|
2444
|
+
if (existing_endLine !== undefined || incoming_endLine !== undefined) {
|
|
2445
|
+
// if one of these is not defined we know the other is defined and therefore
|
|
2446
|
+
// not equal
|
|
2447
|
+
if (existing_endLine === undefined || incoming_endLine === undefined) {
|
|
2448
|
+
return false;
|
|
2449
|
+
}
|
|
2450
|
+
if (!(existing_endLine === incoming_endLine)) {
|
|
2451
|
+
return false;
|
|
2452
|
+
}
|
|
2453
|
+
}
|
|
2454
|
+
const existing_endPosition = existing.endPosition;
|
|
2455
|
+
const incoming_endPosition = incoming.endPosition;
|
|
2456
|
+
// if at least one of these optionals is defined
|
|
2457
|
+
if (existing_endPosition !== undefined || incoming_endPosition !== undefined) {
|
|
2458
|
+
// if one of these is not defined we know the other is defined and therefore
|
|
2459
|
+
// not equal
|
|
2460
|
+
if (existing_endPosition === undefined || incoming_endPosition === undefined) {
|
|
2461
|
+
return false;
|
|
2462
|
+
}
|
|
2463
|
+
if (!(existing_endPosition === incoming_endPosition)) {
|
|
2464
|
+
return false;
|
|
2465
|
+
}
|
|
2466
|
+
}
|
|
2467
|
+
const existing_startColumn = existing.startColumn;
|
|
2468
|
+
const incoming_startColumn = incoming.startColumn;
|
|
2469
|
+
// if at least one of these optionals is defined
|
|
2470
|
+
if (existing_startColumn !== undefined || incoming_startColumn !== undefined) {
|
|
2471
|
+
// if one of these is not defined we know the other is defined and therefore
|
|
2472
|
+
// not equal
|
|
2473
|
+
if (existing_startColumn === undefined || incoming_startColumn === undefined) {
|
|
2474
|
+
return false;
|
|
2475
|
+
}
|
|
2476
|
+
if (!(existing_startColumn === incoming_startColumn)) {
|
|
2477
|
+
return false;
|
|
2478
|
+
}
|
|
2479
|
+
}
|
|
2480
|
+
const existing_startLine = existing.startLine;
|
|
2481
|
+
const incoming_startLine = incoming.startLine;
|
|
2482
|
+
// if at least one of these optionals is defined
|
|
2483
|
+
if (existing_startLine !== undefined || incoming_startLine !== undefined) {
|
|
2484
|
+
// if one of these is not defined we know the other is defined and therefore
|
|
2485
|
+
// not equal
|
|
2486
|
+
if (existing_startLine === undefined || incoming_startLine === undefined) {
|
|
2487
|
+
return false;
|
|
2488
|
+
}
|
|
2489
|
+
if (!(existing_startLine === incoming_startLine)) {
|
|
2490
|
+
return false;
|
|
2491
|
+
}
|
|
2492
|
+
}
|
|
2493
|
+
const existing_startPosition = existing.startPosition;
|
|
2494
|
+
const incoming_startPosition = incoming.startPosition;
|
|
2495
|
+
// if at least one of these optionals is defined
|
|
2496
|
+
if (existing_startPosition !== undefined || incoming_startPosition !== undefined) {
|
|
2497
|
+
// if one of these is not defined we know the other is defined and therefore
|
|
2498
|
+
// not equal
|
|
2499
|
+
if (existing_startPosition === undefined || incoming_startPosition === undefined) {
|
|
2500
|
+
return false;
|
|
2501
|
+
}
|
|
2502
|
+
if (!(existing_startPosition === incoming_startPosition)) {
|
|
2503
|
+
return false;
|
|
2504
|
+
}
|
|
2505
|
+
}
|
|
2506
|
+
return true;
|
|
2507
|
+
}
|
|
2508
|
+
|
|
2509
|
+
const VERSION = "056d3062f884a64afdf97b374daf2e75";
|
|
2510
|
+
function validate(obj, path = 'SchemaValidationOutputRepresentation') {
|
|
2511
|
+
const v_error = (() => {
|
|
2512
|
+
if (typeof obj !== 'object' || ArrayIsArray(obj) || obj === null) {
|
|
2513
|
+
return new TypeError('Expected "object" but received "' + typeof obj + '" (at "' + path + '")');
|
|
2514
|
+
}
|
|
2515
|
+
const obj_schemaName = obj.schemaName;
|
|
2516
|
+
const path_schemaName = path + '.schemaName';
|
|
2517
|
+
if (typeof obj_schemaName !== 'string') {
|
|
2518
|
+
return new TypeError('Expected "string" but received "' + typeof obj_schemaName + '" (at "' + path_schemaName + '")');
|
|
2519
|
+
}
|
|
2520
|
+
const obj_schemaSize = obj.schemaSize;
|
|
2521
|
+
const path_schemaSize = path + '.schemaSize';
|
|
2522
|
+
if (typeof obj_schemaSize !== 'number' || (typeof obj_schemaSize === 'number' && Math.floor(obj_schemaSize) !== obj_schemaSize)) {
|
|
2523
|
+
return new TypeError('Expected "integer" but received "' + typeof obj_schemaSize + '" (at "' + path_schemaSize + '")');
|
|
2524
|
+
}
|
|
2525
|
+
const obj_schemaType = obj.schemaType;
|
|
2526
|
+
const path_schemaType = path + '.schemaType';
|
|
2527
|
+
if (typeof obj_schemaType !== 'string') {
|
|
2528
|
+
return new TypeError('Expected "string" but received "' + typeof obj_schemaType + '" (at "' + path_schemaType + '")');
|
|
2529
|
+
}
|
|
2530
|
+
const obj_schemaValidation = obj.schemaValidation;
|
|
2531
|
+
const path_schemaValidation = path + '.schemaValidation';
|
|
2532
|
+
if (!ArrayIsArray(obj_schemaValidation)) {
|
|
2533
|
+
return new TypeError('Expected "array" but received "' + typeof obj_schemaValidation + '" (at "' + path_schemaValidation + '")');
|
|
2534
|
+
}
|
|
2535
|
+
for (let i = 0; i < obj_schemaValidation.length; i++) {
|
|
2536
|
+
const obj_schemaValidation_item = obj_schemaValidation[i];
|
|
2537
|
+
const path_schemaValidation_item = path_schemaValidation + '[' + i + ']';
|
|
2538
|
+
const referencepath_schemaValidation_itemValidationError = validate$1(obj_schemaValidation_item, path_schemaValidation_item);
|
|
2539
|
+
if (referencepath_schemaValidation_itemValidationError !== null) {
|
|
2540
|
+
let message = 'Object doesn\'t match SchemaValidationMessageRepresentation (at "' + path_schemaValidation_item + '")\n';
|
|
2541
|
+
message += referencepath_schemaValidation_itemValidationError.message.split('\n').map((line) => '\t' + line).join('\n');
|
|
2542
|
+
return new TypeError(message);
|
|
2543
|
+
}
|
|
2544
|
+
}
|
|
2545
|
+
const obj_systemVersion = obj.systemVersion;
|
|
2546
|
+
const path_systemVersion = path + '.systemVersion';
|
|
2547
|
+
if (typeof obj_systemVersion !== 'number' || (typeof obj_systemVersion === 'number' && Math.floor(obj_systemVersion) !== obj_systemVersion)) {
|
|
2548
|
+
return new TypeError('Expected "integer" but received "' + typeof obj_systemVersion + '" (at "' + path_systemVersion + '")');
|
|
2549
|
+
}
|
|
2550
|
+
})();
|
|
2551
|
+
return v_error === undefined ? null : v_error;
|
|
2552
|
+
}
|
|
2553
|
+
const RepresentationType = 'SchemaValidationOutputRepresentation';
|
|
2554
|
+
function keyBuilder(luvio, config) {
|
|
2555
|
+
return keyPrefix + '::' + RepresentationType + ':' + config.schemaName;
|
|
2556
|
+
}
|
|
2557
|
+
function keyBuilderFromType(luvio, object) {
|
|
2558
|
+
const keyParams = {
|
|
2559
|
+
schemaName: object.schemaName
|
|
2560
|
+
};
|
|
2561
|
+
return keyBuilder(luvio, keyParams);
|
|
2562
|
+
}
|
|
2563
|
+
function normalize(input, existing, path, luvio, store, timestamp) {
|
|
2564
|
+
return input;
|
|
2565
|
+
}
|
|
2566
|
+
const select$1 = function SchemaValidationOutputRepresentationSelect() {
|
|
2567
|
+
const { selections: SchemaValidationMessageRepresentation__selections, opaque: SchemaValidationMessageRepresentation__opaque, } = select$2();
|
|
2568
|
+
return {
|
|
2569
|
+
kind: 'Fragment',
|
|
2570
|
+
version: VERSION,
|
|
2571
|
+
private: [],
|
|
2572
|
+
selections: [
|
|
2573
|
+
{
|
|
2574
|
+
name: 'schemaName',
|
|
2575
|
+
kind: 'Scalar'
|
|
2576
|
+
},
|
|
2577
|
+
{
|
|
2578
|
+
name: 'schemaSize',
|
|
2579
|
+
kind: 'Scalar'
|
|
2580
|
+
},
|
|
2581
|
+
{
|
|
2582
|
+
name: 'schemaType',
|
|
2583
|
+
kind: 'Scalar'
|
|
2584
|
+
},
|
|
2585
|
+
{
|
|
2586
|
+
name: 'schemaValidation',
|
|
2587
|
+
kind: 'Object',
|
|
2588
|
+
plural: true,
|
|
2589
|
+
selections: SchemaValidationMessageRepresentation__selections
|
|
2590
|
+
},
|
|
2591
|
+
{
|
|
2592
|
+
name: 'systemVersion',
|
|
2593
|
+
kind: 'Scalar'
|
|
2594
|
+
}
|
|
2595
|
+
]
|
|
2596
|
+
};
|
|
2597
|
+
};
|
|
2598
|
+
function equals(existing, incoming) {
|
|
2599
|
+
const existing_schemaSize = existing.schemaSize;
|
|
2600
|
+
const incoming_schemaSize = incoming.schemaSize;
|
|
2601
|
+
if (!(existing_schemaSize === incoming_schemaSize)) {
|
|
2602
|
+
return false;
|
|
2603
|
+
}
|
|
2604
|
+
const existing_systemVersion = existing.systemVersion;
|
|
2605
|
+
const incoming_systemVersion = incoming.systemVersion;
|
|
2606
|
+
if (!(existing_systemVersion === incoming_systemVersion)) {
|
|
2607
|
+
return false;
|
|
2608
|
+
}
|
|
2609
|
+
const existing_schemaName = existing.schemaName;
|
|
2610
|
+
const incoming_schemaName = incoming.schemaName;
|
|
2611
|
+
if (!(existing_schemaName === incoming_schemaName)) {
|
|
2612
|
+
return false;
|
|
2613
|
+
}
|
|
2614
|
+
const existing_schemaType = existing.schemaType;
|
|
2615
|
+
const incoming_schemaType = incoming.schemaType;
|
|
2616
|
+
if (!(existing_schemaType === incoming_schemaType)) {
|
|
2617
|
+
return false;
|
|
2618
|
+
}
|
|
2619
|
+
const existing_schemaValidation = existing.schemaValidation;
|
|
2620
|
+
const incoming_schemaValidation = incoming.schemaValidation;
|
|
2621
|
+
const equals_schemaValidation_items = equalsArray(existing_schemaValidation, incoming_schemaValidation, (existing_schemaValidation_item, incoming_schemaValidation_item) => {
|
|
2622
|
+
if (!(equals$1(existing_schemaValidation_item, incoming_schemaValidation_item))) {
|
|
2623
|
+
return false;
|
|
2624
|
+
}
|
|
2625
|
+
});
|
|
2626
|
+
if (equals_schemaValidation_items === false) {
|
|
2627
|
+
return false;
|
|
2628
|
+
}
|
|
2629
|
+
return true;
|
|
2630
|
+
}
|
|
2631
|
+
const ingest = function SchemaValidationOutputRepresentationIngest(input, path, luvio, store, timestamp) {
|
|
2632
|
+
if (process.env.NODE_ENV !== 'production') {
|
|
2633
|
+
const validateError = validate(input);
|
|
2634
|
+
if (validateError !== null) {
|
|
2635
|
+
throw validateError;
|
|
2636
|
+
}
|
|
2637
|
+
}
|
|
2638
|
+
const key = keyBuilderFromType(luvio, input);
|
|
2639
|
+
const ttlToUse = path.ttl !== undefined ? path.ttl : 300000;
|
|
2640
|
+
ingestShape(input, path, luvio, store, timestamp, ttlToUse, key, normalize, "external-services", VERSION, RepresentationType, equals);
|
|
2641
|
+
return createLink(key);
|
|
2642
|
+
};
|
|
2643
|
+
function getTypeCacheKeys(rootKeySet, luvio, input, fullPathFactory) {
|
|
2644
|
+
// root cache key (uses fullPathFactory if keyBuilderFromType isn't defined)
|
|
2645
|
+
const rootKey = keyBuilderFromType(luvio, input);
|
|
2646
|
+
rootKeySet.set(rootKey, {
|
|
2647
|
+
namespace: keyPrefix,
|
|
2648
|
+
representationName: RepresentationType,
|
|
2649
|
+
mergeable: false
|
|
2650
|
+
});
|
|
2651
|
+
}
|
|
2652
|
+
|
|
2653
|
+
function select(luvio, params) {
|
|
2654
|
+
return select$1();
|
|
2655
|
+
}
|
|
2656
|
+
function getResponseCacheKeys(storeKeyMap, luvio, resourceParams, response) {
|
|
2657
|
+
getTypeCacheKeys(storeKeyMap, luvio, response);
|
|
2658
|
+
}
|
|
2659
|
+
function ingestSuccess(luvio, resourceParams, response) {
|
|
2660
|
+
const { body } = response;
|
|
2661
|
+
const key = keyBuilderFromType(luvio, body);
|
|
2662
|
+
luvio.storeIngest(key, ingest, body);
|
|
2663
|
+
const snapshot = luvio.storeLookup({
|
|
2664
|
+
recordId: key,
|
|
2665
|
+
node: select(),
|
|
2666
|
+
variables: {},
|
|
2667
|
+
});
|
|
2668
|
+
if (process.env.NODE_ENV !== 'production') {
|
|
2669
|
+
if (snapshot.state !== 'Fulfilled') {
|
|
2670
|
+
throw new Error('Invalid network response. Expected resource response to result in Fulfilled snapshot');
|
|
2671
|
+
}
|
|
2672
|
+
}
|
|
2673
|
+
deepFreeze(snapshot.data);
|
|
2674
|
+
return snapshot;
|
|
2675
|
+
}
|
|
2676
|
+
function createResourceRequest(config) {
|
|
2677
|
+
const headers = {};
|
|
2678
|
+
return {
|
|
2679
|
+
baseUri: '/services/data/v66.0',
|
|
2680
|
+
basePath: '/externalservices/schemas/' + config.urlParams.schemaName + '/validation',
|
|
2681
|
+
method: 'post',
|
|
2682
|
+
body: config.body,
|
|
2683
|
+
urlParams: config.urlParams,
|
|
2684
|
+
queryParams: {},
|
|
2685
|
+
headers,
|
|
2686
|
+
priority: 'normal',
|
|
2687
|
+
};
|
|
2688
|
+
}
|
|
2689
|
+
|
|
2690
|
+
const adapterName = 'validateSchema';
|
|
2691
|
+
const validateSchema_ConfigPropertyMetadata = [
|
|
2692
|
+
generateParamConfigMetadata('schemaName', true, 0 /* UrlParameter */, 0 /* String */),
|
|
2693
|
+
generateParamConfigMetadata('schema', true, 2 /* Body */, 4 /* Unsupported */),
|
|
2694
|
+
];
|
|
2695
|
+
const validateSchema_ConfigPropertyNames = /*#__PURE__*/ buildAdapterValidationConfig(adapterName, validateSchema_ConfigPropertyMetadata);
|
|
2696
|
+
const createResourceParams = /*#__PURE__*/ createResourceParams$7(validateSchema_ConfigPropertyMetadata);
|
|
2697
|
+
function typeCheckConfig(untrustedConfig) {
|
|
2698
|
+
const config = {};
|
|
2699
|
+
typeCheckConfig$7(untrustedConfig, config, validateSchema_ConfigPropertyMetadata);
|
|
2700
|
+
const untrustedConfig_schema = untrustedConfig.schema;
|
|
2701
|
+
const referenceSchemaValidationInputRepresentationValidationError = validate$2(untrustedConfig_schema);
|
|
2702
|
+
if (referenceSchemaValidationInputRepresentationValidationError === null) {
|
|
2703
|
+
config.schema = untrustedConfig_schema;
|
|
2704
|
+
}
|
|
2705
|
+
return config;
|
|
2706
|
+
}
|
|
2707
|
+
function validateAdapterConfig(untrustedConfig, configPropertyNames) {
|
|
2708
|
+
if (!untrustedIsObject(untrustedConfig)) {
|
|
2709
|
+
return null;
|
|
2710
|
+
}
|
|
2711
|
+
if (process.env.NODE_ENV !== 'production') {
|
|
2712
|
+
validateConfig(untrustedConfig, configPropertyNames);
|
|
2713
|
+
}
|
|
2714
|
+
const config = typeCheckConfig(untrustedConfig);
|
|
2715
|
+
if (!areRequiredParametersPresent(config, configPropertyNames)) {
|
|
2716
|
+
return null;
|
|
2717
|
+
}
|
|
2718
|
+
return config;
|
|
2719
|
+
}
|
|
2720
|
+
function buildNetworkSnapshot(luvio, config, options) {
|
|
2721
|
+
const resourceParams = createResourceParams(config);
|
|
2722
|
+
const request = createResourceRequest(resourceParams);
|
|
2723
|
+
return luvio.dispatchResourceRequest(request, options)
|
|
2724
|
+
.then((response) => {
|
|
2725
|
+
return luvio.handleSuccessResponse(() => {
|
|
2726
|
+
const snapshot = ingestSuccess(luvio, resourceParams, response);
|
|
2727
|
+
return luvio.storeBroadcast().then(() => snapshot);
|
|
2728
|
+
}, () => {
|
|
2729
|
+
const cache = new StoreKeyMap();
|
|
2730
|
+
getResponseCacheKeys(cache, luvio, resourceParams, response.body);
|
|
2731
|
+
return cache;
|
|
2732
|
+
});
|
|
2733
|
+
}, (response) => {
|
|
2734
|
+
deepFreeze(response);
|
|
2735
|
+
throw response;
|
|
2736
|
+
});
|
|
2737
|
+
}
|
|
2738
|
+
const validateSchemaAdapterFactory = (luvio) => {
|
|
2739
|
+
return function validateSchema(untrustedConfig) {
|
|
2740
|
+
const config = validateAdapterConfig(untrustedConfig, validateSchema_ConfigPropertyNames);
|
|
2741
|
+
// Invalid or incomplete config
|
|
2742
|
+
if (config === null) {
|
|
2743
|
+
throw new Error('Invalid config for "validateSchema"');
|
|
2744
|
+
}
|
|
2745
|
+
return buildNetworkSnapshot(luvio, config);
|
|
2746
|
+
};
|
|
2747
|
+
};
|
|
2748
|
+
|
|
2749
|
+
let getActionDetailsForService;
|
|
2750
|
+
let getDataShape;
|
|
2751
|
+
let getOpenApiSpec;
|
|
2752
|
+
let getStatistics;
|
|
2753
|
+
let getStatisticsForService;
|
|
2754
|
+
let sendTestConnectionRequest;
|
|
2755
|
+
let validateSchema;
|
|
2756
|
+
// Imperative GET Adapters
|
|
2757
|
+
let getActionDetailsForService_imperative;
|
|
2758
|
+
let getDataShape_imperative;
|
|
2759
|
+
let getOpenApiSpec_imperative;
|
|
2760
|
+
let getStatistics_imperative;
|
|
2761
|
+
let getStatisticsForService_imperative;
|
|
2762
|
+
let sendTestConnectionRequest_imperative;
|
|
2763
|
+
// Adapter Metadata
|
|
2764
|
+
const getActionDetailsForServiceMetadata = {
|
|
2765
|
+
apiFamily: 'externalservices',
|
|
2766
|
+
name: 'getActionDetailsForService',
|
|
2767
|
+
};
|
|
2768
|
+
const getDataShapeMetadata = { apiFamily: 'externalservices', name: 'getDataShape' };
|
|
2769
|
+
const getOpenApiSpecMetadata = { apiFamily: 'externalservices', name: 'getOpenApiSpec', ttl: 500 };
|
|
2770
|
+
const getStatisticsMetadata = { apiFamily: 'externalservices', name: 'getStatistics' };
|
|
2771
|
+
const getStatisticsForServiceMetadata = {
|
|
2772
|
+
apiFamily: 'externalservices',
|
|
2773
|
+
name: 'getStatisticsForService',
|
|
2774
|
+
};
|
|
2775
|
+
const sendTestConnectionRequestMetadata = {
|
|
2776
|
+
apiFamily: 'externalservices',
|
|
2777
|
+
name: 'sendTestConnectionRequest',
|
|
2778
|
+
ttl: 100,
|
|
2779
|
+
};
|
|
2780
|
+
// Notify Update Available
|
|
2781
|
+
function bindExportsTo$1(luvio) {
|
|
2782
|
+
// LDS Adapters
|
|
2783
|
+
const getActionDetailsForService_ldsAdapter = createInstrumentedAdapter(createLDSAdapter(luvio, 'getActionDetailsForService', getActionDetailsForServiceAdapterFactory), getActionDetailsForServiceMetadata);
|
|
2784
|
+
const getDataShape_ldsAdapter = createInstrumentedAdapter(createLDSAdapter(luvio, 'getDataShape', getDataShapeAdapterFactory), getDataShapeMetadata);
|
|
2785
|
+
const getOpenApiSpec_ldsAdapter = createInstrumentedAdapter(createLDSAdapter(luvio, 'getOpenApiSpec', getOpenApiSpecAdapterFactory), getOpenApiSpecMetadata);
|
|
2786
|
+
const getStatistics_ldsAdapter = createInstrumentedAdapter(createLDSAdapter(luvio, 'getStatistics', getStatisticsAdapterFactory), getStatisticsMetadata);
|
|
2787
|
+
const getStatisticsForService_ldsAdapter = createInstrumentedAdapter(createLDSAdapter(luvio, 'getStatisticsForService', getStatisticsForServiceAdapterFactory), getStatisticsForServiceMetadata);
|
|
2788
|
+
const sendTestConnectionRequest_ldsAdapter = createInstrumentedAdapter(createLDSAdapter(luvio, 'sendTestConnectionRequest', sendTestConnectionRequestAdapterFactory), sendTestConnectionRequestMetadata);
|
|
2789
|
+
function unwrapSnapshotData(factory) {
|
|
2790
|
+
const adapter = factory(luvio);
|
|
2791
|
+
return (config) => adapter(config).then((snapshot) => snapshot.data);
|
|
2792
|
+
}
|
|
2793
|
+
return {
|
|
2794
|
+
getActionDetailsForService: createWireAdapterConstructor(luvio, getActionDetailsForService_ldsAdapter, getActionDetailsForServiceMetadata),
|
|
2795
|
+
getDataShape: createWireAdapterConstructor(luvio, getDataShape_ldsAdapter, getDataShapeMetadata),
|
|
2796
|
+
getOpenApiSpec: createWireAdapterConstructor(luvio, getOpenApiSpec_ldsAdapter, getOpenApiSpecMetadata),
|
|
2797
|
+
getStatistics: createWireAdapterConstructor(luvio, getStatistics_ldsAdapter, getStatisticsMetadata),
|
|
2798
|
+
getStatisticsForService: createWireAdapterConstructor(luvio, getStatisticsForService_ldsAdapter, getStatisticsForServiceMetadata),
|
|
2799
|
+
sendTestConnectionRequest: createWireAdapterConstructor(luvio, sendTestConnectionRequest_ldsAdapter, sendTestConnectionRequestMetadata),
|
|
2800
|
+
validateSchema: unwrapSnapshotData(validateSchemaAdapterFactory),
|
|
2801
|
+
// Imperative GET Adapters
|
|
2802
|
+
getActionDetailsForService_imperative: createImperativeAdapter(luvio, getActionDetailsForService_ldsAdapter, getActionDetailsForServiceMetadata),
|
|
2803
|
+
getDataShape_imperative: createImperativeAdapter(luvio, getDataShape_ldsAdapter, getDataShapeMetadata),
|
|
2804
|
+
getOpenApiSpec_imperative: createImperativeAdapter(luvio, getOpenApiSpec_ldsAdapter, getOpenApiSpecMetadata),
|
|
2805
|
+
getStatistics_imperative: createImperativeAdapter(luvio, getStatistics_ldsAdapter, getStatisticsMetadata),
|
|
2806
|
+
getStatisticsForService_imperative: createImperativeAdapter(luvio, getStatisticsForService_ldsAdapter, getStatisticsForServiceMetadata),
|
|
2807
|
+
sendTestConnectionRequest_imperative: createImperativeAdapter(luvio, sendTestConnectionRequest_ldsAdapter, sendTestConnectionRequestMetadata),
|
|
2808
|
+
// Notify Update Availables
|
|
2809
|
+
};
|
|
2810
|
+
}
|
|
2811
|
+
withDefaultLuvio((luvio) => {
|
|
2812
|
+
({
|
|
2813
|
+
getActionDetailsForService,
|
|
2814
|
+
getDataShape,
|
|
2815
|
+
getOpenApiSpec,
|
|
2816
|
+
getStatistics,
|
|
2817
|
+
getStatisticsForService,
|
|
2818
|
+
sendTestConnectionRequest,
|
|
2819
|
+
validateSchema,
|
|
2820
|
+
getActionDetailsForService_imperative,
|
|
2821
|
+
getDataShape_imperative,
|
|
2822
|
+
getOpenApiSpec_imperative,
|
|
2823
|
+
getStatistics_imperative,
|
|
2824
|
+
getStatisticsForService_imperative,
|
|
2825
|
+
sendTestConnectionRequest_imperative,
|
|
2826
|
+
} = bindExportsTo$1(luvio));
|
|
2827
|
+
});
|
|
2828
|
+
|
|
2829
|
+
const notifyUpdateAvailableFactory = (luvio) => {
|
|
2830
|
+
// custom override of notifyUpdateAvailable function to bypass luvio key requirement since it is not possible to have
|
|
2831
|
+
// a luvio.key for ExternalServiceStatisticOutputRepresentation
|
|
2832
|
+
return function notifyExternalServiceStatisticsOutputRepresentationUpdateAvailable() {
|
|
2833
|
+
const key = keyBuilder$6();
|
|
2834
|
+
return luvio.notifyStoreUpdateAvailable([key]);
|
|
2835
|
+
};
|
|
2836
|
+
};
|
|
2837
|
+
|
|
2838
|
+
/**
|
|
2839
|
+
* Original file is in 'packages/lds-adapters-platform-external-services/src/generated/artifacts/sfdc.ts'
|
|
2840
|
+
* Overriding this file to manually inject custom notifyUpdateAvailableFactory implementation.
|
|
2841
|
+
*/
|
|
2842
|
+
// Notify Update Available
|
|
2843
|
+
// manually injected notifyUpdateAvailable
|
|
2844
|
+
let notifyExternalServiceStatisticsOutputRepresentationUpdateAvailable;
|
|
2845
|
+
function bindExportsTo(luvio) {
|
|
2846
|
+
return {
|
|
2847
|
+
// Notify Update Availables
|
|
2848
|
+
notifyExternalServiceStatisticsOutputRepresentationUpdateAvailable: createLDSAdapter(luvio, 'notifyExternalServiceStatisticsOutputRepresentationUpdateAvailable', notifyUpdateAvailableFactory),
|
|
2849
|
+
};
|
|
2850
|
+
}
|
|
2851
|
+
withDefaultLuvio((luvio) => {
|
|
2852
|
+
({ notifyExternalServiceStatisticsOutputRepresentationUpdateAvailable } = bindExportsTo(luvio));
|
|
2853
|
+
});
|
|
2854
|
+
|
|
2855
|
+
export { getActionDetailsForService, getActionDetailsForService_imperative, getDataShape, getDataShape_imperative, getOpenApiSpec, getOpenApiSpec_imperative, getStatistics, getStatisticsForService, getStatisticsForService_imperative, getStatistics_imperative, notifyExternalServiceStatisticsOutputRepresentationUpdateAvailable, sendTestConnectionRequest, sendTestConnectionRequest_imperative, validateSchema };
|
|
2856
|
+
// version: 0.1.0-dev1-c978a7b010
|