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