@salesforce/lds-adapters-platform-cdp-machine-learning 1.256.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE.txt +82 -0
- package/dist/es/es2018/platform-cdp-machine-learning.js +2722 -0
- package/dist/es/es2018/types/src/generated/adapters/adapter-utils.d.ts +62 -0
- package/dist/es/es2018/types/src/generated/adapters/createCdpMlConfiguredModelCollection.d.ts +25 -0
- package/dist/es/es2018/types/src/generated/adapters/getCdpMlConfiguredModel.d.ts +28 -0
- package/dist/es/es2018/types/src/generated/adapters/getCdpMlConfiguredModelCollection.d.ts +27 -0
- package/dist/es/es2018/types/src/generated/adapters/getCdpMlModelArtifact.d.ts +27 -0
- package/dist/es/es2018/types/src/generated/adapters/getCdpMlModelArtifactCollection.d.ts +30 -0
- package/dist/es/es2018/types/src/generated/adapters/getCdpMlWorkspace.d.ts +28 -0
- package/dist/es/es2018/types/src/generated/adapters/getCdpMlWorkspaceCollection.d.ts +33 -0
- package/dist/es/es2018/types/src/generated/adapters/updateCdpMlConfiguredModel.d.ts +26 -0
- package/dist/es/es2018/types/src/generated/artifacts/main.d.ts +8 -0
- package/dist/es/es2018/types/src/generated/artifacts/sfdc.d.ts +16 -0
- package/dist/es/es2018/types/src/generated/resources/getSsotMachineLearningModelArtifacts.d.ts +18 -0
- package/dist/es/es2018/types/src/generated/resources/getSsotMachineLearningModelArtifactsByModelArtifactIdOrName.d.ts +15 -0
- package/dist/es/es2018/types/src/generated/resources/getSsotMachineLearningWorkspaces.d.ts +21 -0
- package/dist/es/es2018/types/src/generated/resources/getSsotMachineLearningWorkspacesByWorkspaceIdOrName.d.ts +16 -0
- package/dist/es/es2018/types/src/generated/resources/getSsotMachineLearningWorkspacesModelsByModelIdAndWorkspaceIdOrName.d.ts +16 -0
- package/dist/es/es2018/types/src/generated/resources/getSsotMachineLearningWorkspacesModelsByWorkspaceIdOrName.d.ts +15 -0
- package/dist/es/es2018/types/src/generated/resources/patchSsotMachineLearningWorkspacesModelsByModelIdAndWorkspaceIdOrName.d.ts +25 -0
- package/dist/es/es2018/types/src/generated/resources/postSsotMachineLearningWorkspacesModelsByWorkspaceIdOrName.d.ts +24 -0
- package/dist/es/es2018/types/src/generated/types/CdpAssetBaseRepresentation.d.ts +51 -0
- package/dist/es/es2018/types/src/generated/types/CdpAssetReferenceRepresentation.d.ts +51 -0
- package/dist/es/es2018/types/src/generated/types/CdpMlConfiguredModelCollectionRepresentation.d.ts +36 -0
- package/dist/es/es2018/types/src/generated/types/CdpMlConfiguredModelInputRepresentation.d.ts +56 -0
- package/dist/es/es2018/types/src/generated/types/CdpMlConfiguredModelRepresentation.d.ts +102 -0
- package/dist/es/es2018/types/src/generated/types/CdpMlCustomizableFieldDefinitionRepresentation.d.ts +31 -0
- package/dist/es/es2018/types/src/generated/types/CdpMlCustomizableFieldRepresentation.d.ts +35 -0
- package/dist/es/es2018/types/src/generated/types/CdpMlFieldRepresentation.d.ts +31 -0
- package/dist/es/es2018/types/src/generated/types/CdpMlFilterCriterionBaseRepresentation.d.ts +35 -0
- package/dist/es/es2018/types/src/generated/types/CdpMlFilterRepresentation.d.ts +29 -0
- package/dist/es/es2018/types/src/generated/types/CdpMlFilterValueRepresentation.d.ts +31 -0
- package/dist/es/es2018/types/src/generated/types/CdpMlModelArtifactBaseRepresentation.d.ts +82 -0
- package/dist/es/es2018/types/src/generated/types/CdpMlModelArtifactCollectionRepresentation.d.ts +39 -0
- package/dist/es/es2018/types/src/generated/types/CdpMlModelFieldBaseRepresentation.d.ts +37 -0
- package/dist/es/es2018/types/src/generated/types/CdpMlModelInputFieldBaseRepresentation.d.ts +40 -0
- package/dist/es/es2018/types/src/generated/types/CdpMlModelOutcomeDefinitionRepresentation.d.ts +32 -0
- package/dist/es/es2018/types/src/generated/types/CdpMlModelOutputFieldRepresentation.d.ts +31 -0
- package/dist/es/es2018/types/src/generated/types/CdpMlModelParameterDefinitionBaseRepresentation.d.ts +34 -0
- package/dist/es/es2018/types/src/generated/types/CdpMlModelParameterOverrideBaseRepresentation.d.ts +31 -0
- package/dist/es/es2018/types/src/generated/types/CdpMlModelRefreshConfigRepresentation.d.ts +35 -0
- package/dist/es/es2018/types/src/generated/types/CdpMlModelRefreshRecipientRepresentation.d.ts +34 -0
- package/dist/es/es2018/types/src/generated/types/CdpMlModelTypeRepresentation.d.ts +34 -0
- package/dist/es/es2018/types/src/generated/types/CdpMlWorkspaceBaseRepresentation.d.ts +102 -0
- package/dist/es/es2018/types/src/generated/types/CdpMlWorkspaceCollectionRepresentation.d.ts +39 -0
- package/dist/es/es2018/types/src/generated/types/CdpMlWorkspaceDetailRepresentation.d.ts +115 -0
- package/dist/es/es2018/types/src/generated/types/CdpMlWorkspaceRepresentation.d.ts +102 -0
- package/dist/es/es2018/types/src/generated/types/CdpPaginatedResponseBaseRepresentation.d.ts +34 -0
- package/dist/es/es2018/types/src/generated/types/CdpScheduleRepresentation.d.ts +35 -0
- package/dist/es/es2018/types/src/generated/types/CdpTimeRepresentation.d.ts +34 -0
- package/dist/es/es2018/types/src/generated/types/CdpTimeZoneRepresentation.d.ts +34 -0
- package/dist/es/es2018/types/src/generated/types/CdpUserRepresentation.d.ts +34 -0
- package/dist/es/es2018/types/src/generated/types/type-utils.d.ts +32 -0
- package/package.json +66 -0
- package/sfdc/index.d.ts +1 -0
- package/sfdc/index.js +2847 -0
- package/src/raml/api.raml +1089 -0
- package/src/raml/luvio.raml +79 -0
package/sfdc/index.js
ADDED
|
@@ -0,0 +1,2847 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Copyright (c) 2022, Salesforce, Inc.,
|
|
3
|
+
* All rights reserved.
|
|
4
|
+
* For full license text, see the LICENSE.txt file
|
|
5
|
+
*/
|
|
6
|
+
|
|
7
|
+
/* *******************************************************************************************
|
|
8
|
+
* ATTENTION!
|
|
9
|
+
* THIS IS A GENERATED FILE FROM https://github.com/salesforce-experience-platform-emu/lds-lightning-platform
|
|
10
|
+
* If you would like to contribute to LDS, please follow the steps outlined in the git repo.
|
|
11
|
+
* Any changes made to this file in p4 will be automatically overwritten.
|
|
12
|
+
* *******************************************************************************************
|
|
13
|
+
*/
|
|
14
|
+
/* proxy-compat-disable */
|
|
15
|
+
import { createInstrumentedAdapter, createLDSAdapter, createWireAdapterConstructor, createImperativeAdapter } from 'force/ldsBindings';
|
|
16
|
+
import { withDefaultLuvio } from 'force/ldsEngine';
|
|
17
|
+
import { serializeStructuredKey, ingestShape, deepFreeze, StoreKeyMap, createResourceParams as createResourceParams$8, typeCheckConfig as typeCheckConfig$8, buildNetworkSnapshotCachePolicy as buildNetworkSnapshotCachePolicy$6 } from 'force/luvioEngine';
|
|
18
|
+
|
|
19
|
+
const { hasOwnProperty: ObjectPrototypeHasOwnProperty } = Object.prototype;
|
|
20
|
+
const { keys: ObjectKeys, create: ObjectCreate } = Object;
|
|
21
|
+
const { isArray: ArrayIsArray$1 } = Array;
|
|
22
|
+
/**
|
|
23
|
+
* Validates an adapter config is well-formed.
|
|
24
|
+
* @param config The config to validate.
|
|
25
|
+
* @param adapter The adapter validation configuration.
|
|
26
|
+
* @param oneOf The keys the config must contain at least one of.
|
|
27
|
+
* @throws A TypeError if config doesn't satisfy the adapter's config validation.
|
|
28
|
+
*/
|
|
29
|
+
function validateConfig(config, adapter, oneOf) {
|
|
30
|
+
const { displayName } = adapter;
|
|
31
|
+
const { required, optional, unsupported } = adapter.parameters;
|
|
32
|
+
if (config === undefined ||
|
|
33
|
+
required.every(req => ObjectPrototypeHasOwnProperty.call(config, req)) === false) {
|
|
34
|
+
throw new TypeError(`adapter ${displayName} configuration must specify ${required.sort().join(', ')}`);
|
|
35
|
+
}
|
|
36
|
+
if (oneOf && oneOf.some(req => ObjectPrototypeHasOwnProperty.call(config, req)) === false) {
|
|
37
|
+
throw new TypeError(`adapter ${displayName} configuration must specify one of ${oneOf.sort().join(', ')}`);
|
|
38
|
+
}
|
|
39
|
+
if (unsupported !== undefined &&
|
|
40
|
+
unsupported.some(req => ObjectPrototypeHasOwnProperty.call(config, req))) {
|
|
41
|
+
throw new TypeError(`adapter ${displayName} does not yet support ${unsupported.sort().join(', ')}`);
|
|
42
|
+
}
|
|
43
|
+
const supported = required.concat(optional);
|
|
44
|
+
if (ObjectKeys(config).some(key => !supported.includes(key))) {
|
|
45
|
+
throw new TypeError(`adapter ${displayName} configuration supports only ${supported.sort().join(', ')}`);
|
|
46
|
+
}
|
|
47
|
+
}
|
|
48
|
+
function untrustedIsObject(untrusted) {
|
|
49
|
+
return typeof untrusted === 'object' && untrusted !== null && ArrayIsArray$1(untrusted) === false;
|
|
50
|
+
}
|
|
51
|
+
function areRequiredParametersPresent(config, configPropertyNames) {
|
|
52
|
+
return configPropertyNames.parameters.required.every(req => req in config);
|
|
53
|
+
}
|
|
54
|
+
const snapshotRefreshOptions = {
|
|
55
|
+
overrides: {
|
|
56
|
+
headers: {
|
|
57
|
+
'Cache-Control': 'no-cache',
|
|
58
|
+
},
|
|
59
|
+
}
|
|
60
|
+
};
|
|
61
|
+
function generateParamConfigMetadata(name, required, resourceType, typeCheckShape, isArrayShape = false, coerceFn) {
|
|
62
|
+
return {
|
|
63
|
+
name,
|
|
64
|
+
required,
|
|
65
|
+
resourceType,
|
|
66
|
+
typeCheckShape,
|
|
67
|
+
isArrayShape,
|
|
68
|
+
coerceFn,
|
|
69
|
+
};
|
|
70
|
+
}
|
|
71
|
+
function buildAdapterValidationConfig(displayName, paramsMeta) {
|
|
72
|
+
const required = paramsMeta.filter(p => p.required).map(p => p.name);
|
|
73
|
+
const optional = paramsMeta.filter(p => !p.required).map(p => p.name);
|
|
74
|
+
return {
|
|
75
|
+
displayName,
|
|
76
|
+
parameters: {
|
|
77
|
+
required,
|
|
78
|
+
optional,
|
|
79
|
+
}
|
|
80
|
+
};
|
|
81
|
+
}
|
|
82
|
+
const keyPrefix = 'cdp-machine-learning';
|
|
83
|
+
|
|
84
|
+
const { isArray: ArrayIsArray } = Array;
|
|
85
|
+
const { stringify: JSONStringify } = JSON;
|
|
86
|
+
function createLink(ref) {
|
|
87
|
+
return {
|
|
88
|
+
__ref: serializeStructuredKey(ref),
|
|
89
|
+
};
|
|
90
|
+
}
|
|
91
|
+
|
|
92
|
+
function validate$o(obj, path = 'CdpMlFilterValueRepresentation') {
|
|
93
|
+
const v_error = (() => {
|
|
94
|
+
if (typeof obj !== 'object' || ArrayIsArray(obj) || obj === null) {
|
|
95
|
+
return new TypeError('Expected "object" but received "' + typeof obj + '" (at "' + path + '")');
|
|
96
|
+
}
|
|
97
|
+
const obj_type = obj.type;
|
|
98
|
+
const path_type = path + '.type';
|
|
99
|
+
if (typeof obj_type !== 'string') {
|
|
100
|
+
return new TypeError('Expected "string" but received "' + typeof obj_type + '" (at "' + path_type + '")');
|
|
101
|
+
}
|
|
102
|
+
const obj_value = obj.value;
|
|
103
|
+
const path_value = path + '.value';
|
|
104
|
+
if (typeof obj_value !== 'string') {
|
|
105
|
+
return new TypeError('Expected "string" but received "' + typeof obj_value + '" (at "' + path_value + '")');
|
|
106
|
+
}
|
|
107
|
+
})();
|
|
108
|
+
return v_error === undefined ? null : v_error;
|
|
109
|
+
}
|
|
110
|
+
|
|
111
|
+
function validate$n(obj, path = 'CdpMlFilterCriterionBaseRepresentation') {
|
|
112
|
+
const v_error = (() => {
|
|
113
|
+
if (typeof obj !== 'object' || ArrayIsArray(obj) || obj === null) {
|
|
114
|
+
return new TypeError('Expected "object" but received "' + typeof obj + '" (at "' + path + '")');
|
|
115
|
+
}
|
|
116
|
+
const obj_operator = obj.operator;
|
|
117
|
+
const path_operator = path + '.operator';
|
|
118
|
+
if (typeof obj_operator !== 'string') {
|
|
119
|
+
return new TypeError('Expected "string" but received "' + typeof obj_operator + '" (at "' + path_operator + '")');
|
|
120
|
+
}
|
|
121
|
+
const obj_type = obj.type;
|
|
122
|
+
const path_type = path + '.type';
|
|
123
|
+
if (typeof obj_type !== 'string') {
|
|
124
|
+
return new TypeError('Expected "string" but received "' + typeof obj_type + '" (at "' + path_type + '")');
|
|
125
|
+
}
|
|
126
|
+
const obj_values = obj.values;
|
|
127
|
+
const path_values = path + '.values';
|
|
128
|
+
if (!ArrayIsArray(obj_values)) {
|
|
129
|
+
return new TypeError('Expected "array" but received "' + typeof obj_values + '" (at "' + path_values + '")');
|
|
130
|
+
}
|
|
131
|
+
for (let i = 0; i < obj_values.length; i++) {
|
|
132
|
+
const obj_values_item = obj_values[i];
|
|
133
|
+
const path_values_item = path_values + '[' + i + ']';
|
|
134
|
+
const referencepath_values_itemValidationError = validate$o(obj_values_item, path_values_item);
|
|
135
|
+
if (referencepath_values_itemValidationError !== null) {
|
|
136
|
+
let message = 'Object doesn\'t match CdpMlFilterValueRepresentation (at "' + path_values_item + '")\n';
|
|
137
|
+
message += referencepath_values_itemValidationError.message.split('\n').map((line) => '\t' + line).join('\n');
|
|
138
|
+
return new TypeError(message);
|
|
139
|
+
}
|
|
140
|
+
}
|
|
141
|
+
})();
|
|
142
|
+
return v_error === undefined ? null : v_error;
|
|
143
|
+
}
|
|
144
|
+
|
|
145
|
+
function validate$m(obj, path = 'CdpMlFilterRepresentation') {
|
|
146
|
+
const v_error = (() => {
|
|
147
|
+
if (typeof obj !== 'object' || ArrayIsArray(obj) || obj === null) {
|
|
148
|
+
return new TypeError('Expected "object" but received "' + typeof obj + '" (at "' + path + '")');
|
|
149
|
+
}
|
|
150
|
+
const obj_criteria = obj.criteria;
|
|
151
|
+
const path_criteria = path + '.criteria';
|
|
152
|
+
if (!ArrayIsArray(obj_criteria)) {
|
|
153
|
+
return new TypeError('Expected "array" but received "' + typeof obj_criteria + '" (at "' + path_criteria + '")');
|
|
154
|
+
}
|
|
155
|
+
for (let i = 0; i < obj_criteria.length; i++) {
|
|
156
|
+
const obj_criteria_item = obj_criteria[i];
|
|
157
|
+
const path_criteria_item = path_criteria + '[' + i + ']';
|
|
158
|
+
const referencepath_criteria_itemValidationError = validate$n(obj_criteria_item, path_criteria_item);
|
|
159
|
+
if (referencepath_criteria_itemValidationError !== null) {
|
|
160
|
+
let message = 'Object doesn\'t match CdpMlFilterCriterionBaseRepresentation (at "' + path_criteria_item + '")\n';
|
|
161
|
+
message += referencepath_criteria_itemValidationError.message.split('\n').map((line) => '\t' + line).join('\n');
|
|
162
|
+
return new TypeError(message);
|
|
163
|
+
}
|
|
164
|
+
}
|
|
165
|
+
})();
|
|
166
|
+
return v_error === undefined ? null : v_error;
|
|
167
|
+
}
|
|
168
|
+
|
|
169
|
+
function validate$l(obj, path = 'CdpMlCustomizableFieldDefinitionRepresentation') {
|
|
170
|
+
const v_error = (() => {
|
|
171
|
+
if (typeof obj !== 'object' || ArrayIsArray(obj) || obj === null) {
|
|
172
|
+
return new TypeError('Expected "object" but received "' + typeof obj + '" (at "' + path + '")');
|
|
173
|
+
}
|
|
174
|
+
const obj_filter = obj.filter;
|
|
175
|
+
const path_filter = path + '.filter';
|
|
176
|
+
const referencepath_filterValidationError = validate$m(obj_filter, path_filter);
|
|
177
|
+
if (referencepath_filterValidationError !== null) {
|
|
178
|
+
let message = 'Object doesn\'t match CdpMlFilterRepresentation (at "' + path_filter + '")\n';
|
|
179
|
+
message += referencepath_filterValidationError.message.split('\n').map((line) => '\t' + line).join('\n');
|
|
180
|
+
return new TypeError(message);
|
|
181
|
+
}
|
|
182
|
+
const obj_templateText = obj.templateText;
|
|
183
|
+
const path_templateText = path + '.templateText';
|
|
184
|
+
if (typeof obj_templateText !== 'string') {
|
|
185
|
+
return new TypeError('Expected "string" but received "' + typeof obj_templateText + '" (at "' + path_templateText + '")');
|
|
186
|
+
}
|
|
187
|
+
})();
|
|
188
|
+
return v_error === undefined ? null : v_error;
|
|
189
|
+
}
|
|
190
|
+
|
|
191
|
+
function validate$k(obj, path = 'CdpMlModelInputFieldBaseRepresentation') {
|
|
192
|
+
const v_error = (() => {
|
|
193
|
+
if (typeof obj !== 'object' || ArrayIsArray(obj) || obj === null) {
|
|
194
|
+
return new TypeError('Expected "object" but received "' + typeof obj + '" (at "' + path + '")');
|
|
195
|
+
}
|
|
196
|
+
const obj_dataType = obj.dataType;
|
|
197
|
+
const path_dataType = path + '.dataType';
|
|
198
|
+
if (typeof obj_dataType !== 'string') {
|
|
199
|
+
return new TypeError('Expected "string" but received "' + typeof obj_dataType + '" (at "' + path_dataType + '")');
|
|
200
|
+
}
|
|
201
|
+
const obj_isDisparateImpact = obj.isDisparateImpact;
|
|
202
|
+
const path_isDisparateImpact = path + '.isDisparateImpact';
|
|
203
|
+
if (typeof obj_isDisparateImpact !== 'boolean') {
|
|
204
|
+
return new TypeError('Expected "boolean" but received "' + typeof obj_isDisparateImpact + '" (at "' + path_isDisparateImpact + '")');
|
|
205
|
+
}
|
|
206
|
+
const obj_isPartitionField = obj.isPartitionField;
|
|
207
|
+
const path_isPartitionField = path + '.isPartitionField';
|
|
208
|
+
if (typeof obj_isPartitionField !== 'boolean') {
|
|
209
|
+
return new TypeError('Expected "boolean" but received "' + typeof obj_isPartitionField + '" (at "' + path_isPartitionField + '")');
|
|
210
|
+
}
|
|
211
|
+
const obj_isSensitive = obj.isSensitive;
|
|
212
|
+
const path_isSensitive = path + '.isSensitive';
|
|
213
|
+
if (typeof obj_isSensitive !== 'boolean') {
|
|
214
|
+
return new TypeError('Expected "boolean" but received "' + typeof obj_isSensitive + '" (at "' + path_isSensitive + '")');
|
|
215
|
+
}
|
|
216
|
+
const obj_position = obj.position;
|
|
217
|
+
const path_position = path + '.position';
|
|
218
|
+
if (typeof obj_position !== 'number' || (typeof obj_position === 'number' && Math.floor(obj_position) !== obj_position)) {
|
|
219
|
+
return new TypeError('Expected "integer" but received "' + typeof obj_position + '" (at "' + path_position + '")');
|
|
220
|
+
}
|
|
221
|
+
})();
|
|
222
|
+
return v_error === undefined ? null : v_error;
|
|
223
|
+
}
|
|
224
|
+
|
|
225
|
+
function validate$j(obj, path = 'CdpMlCustomizableFieldRepresentation') {
|
|
226
|
+
const v_error = (() => {
|
|
227
|
+
if (typeof obj !== 'object' || ArrayIsArray(obj) || obj === null) {
|
|
228
|
+
return new TypeError('Expected "object" but received "' + typeof obj + '" (at "' + path + '")');
|
|
229
|
+
}
|
|
230
|
+
const obj_customDefinitions = obj.customDefinitions;
|
|
231
|
+
const path_customDefinitions = path + '.customDefinitions';
|
|
232
|
+
if (!ArrayIsArray(obj_customDefinitions)) {
|
|
233
|
+
return new TypeError('Expected "array" but received "' + typeof obj_customDefinitions + '" (at "' + path_customDefinitions + '")');
|
|
234
|
+
}
|
|
235
|
+
for (let i = 0; i < obj_customDefinitions.length; i++) {
|
|
236
|
+
const obj_customDefinitions_item = obj_customDefinitions[i];
|
|
237
|
+
const path_customDefinitions_item = path_customDefinitions + '[' + i + ']';
|
|
238
|
+
const referencepath_customDefinitions_itemValidationError = validate$l(obj_customDefinitions_item, path_customDefinitions_item);
|
|
239
|
+
if (referencepath_customDefinitions_itemValidationError !== null) {
|
|
240
|
+
let message = 'Object doesn\'t match CdpMlCustomizableFieldDefinitionRepresentation (at "' + path_customDefinitions_item + '")\n';
|
|
241
|
+
message += referencepath_customDefinitions_itemValidationError.message.split('\n').map((line) => '\t' + line).join('\n');
|
|
242
|
+
return new TypeError(message);
|
|
243
|
+
}
|
|
244
|
+
}
|
|
245
|
+
const obj_field = obj.field;
|
|
246
|
+
const path_field = path + '.field';
|
|
247
|
+
const referencepath_fieldValidationError = validate$k(obj_field, path_field);
|
|
248
|
+
if (referencepath_fieldValidationError !== null) {
|
|
249
|
+
let message = 'Object doesn\'t match CdpMlModelInputFieldBaseRepresentation (at "' + path_field + '")\n';
|
|
250
|
+
message += referencepath_fieldValidationError.message.split('\n').map((line) => '\t' + line).join('\n');
|
|
251
|
+
return new TypeError(message);
|
|
252
|
+
}
|
|
253
|
+
const obj_type = obj.type;
|
|
254
|
+
const path_type = path + '.type';
|
|
255
|
+
if (typeof obj_type !== 'string') {
|
|
256
|
+
return new TypeError('Expected "string" but received "' + typeof obj_type + '" (at "' + path_type + '")');
|
|
257
|
+
}
|
|
258
|
+
})();
|
|
259
|
+
return v_error === undefined ? null : v_error;
|
|
260
|
+
}
|
|
261
|
+
|
|
262
|
+
function validate$i(obj, path = 'CdpUserRepresentation') {
|
|
263
|
+
const v_error = (() => {
|
|
264
|
+
if (typeof obj !== 'object' || ArrayIsArray(obj) || obj === null) {
|
|
265
|
+
return new TypeError('Expected "object" but received "' + typeof obj + '" (at "' + path + '")');
|
|
266
|
+
}
|
|
267
|
+
const obj_id = obj.id;
|
|
268
|
+
const path_id = path + '.id';
|
|
269
|
+
if (typeof obj_id !== 'string') {
|
|
270
|
+
return new TypeError('Expected "string" but received "' + typeof obj_id + '" (at "' + path_id + '")');
|
|
271
|
+
}
|
|
272
|
+
const obj_name = obj.name;
|
|
273
|
+
const path_name = path + '.name';
|
|
274
|
+
if (typeof obj_name !== 'string') {
|
|
275
|
+
return new TypeError('Expected "string" but received "' + typeof obj_name + '" (at "' + path_name + '")');
|
|
276
|
+
}
|
|
277
|
+
const obj_profilePhotoUrl = obj.profilePhotoUrl;
|
|
278
|
+
const path_profilePhotoUrl = path + '.profilePhotoUrl';
|
|
279
|
+
if (typeof obj_profilePhotoUrl !== 'string') {
|
|
280
|
+
return new TypeError('Expected "string" but received "' + typeof obj_profilePhotoUrl + '" (at "' + path_profilePhotoUrl + '")');
|
|
281
|
+
}
|
|
282
|
+
})();
|
|
283
|
+
return v_error === undefined ? null : v_error;
|
|
284
|
+
}
|
|
285
|
+
|
|
286
|
+
function validate$h(obj, path = 'CdpAssetReferenceRepresentation') {
|
|
287
|
+
const v_error = (() => {
|
|
288
|
+
if (typeof obj !== 'object' || ArrayIsArray(obj) || obj === null) {
|
|
289
|
+
return new TypeError('Expected "object" but received "' + typeof obj + '" (at "' + path + '")');
|
|
290
|
+
}
|
|
291
|
+
const obj_createdBy = obj.createdBy;
|
|
292
|
+
const path_createdBy = path + '.createdBy';
|
|
293
|
+
const referencepath_createdByValidationError = validate$i(obj_createdBy, path_createdBy);
|
|
294
|
+
if (referencepath_createdByValidationError !== null) {
|
|
295
|
+
let message = 'Object doesn\'t match CdpUserRepresentation (at "' + path_createdBy + '")\n';
|
|
296
|
+
message += referencepath_createdByValidationError.message.split('\n').map((line) => '\t' + line).join('\n');
|
|
297
|
+
return new TypeError(message);
|
|
298
|
+
}
|
|
299
|
+
const obj_createdDate = obj.createdDate;
|
|
300
|
+
const path_createdDate = path + '.createdDate';
|
|
301
|
+
if (typeof obj_createdDate !== 'string') {
|
|
302
|
+
return new TypeError('Expected "string" but received "' + typeof obj_createdDate + '" (at "' + path_createdDate + '")');
|
|
303
|
+
}
|
|
304
|
+
const obj_id = obj.id;
|
|
305
|
+
const path_id = path + '.id';
|
|
306
|
+
if (typeof obj_id !== 'string') {
|
|
307
|
+
return new TypeError('Expected "string" but received "' + typeof obj_id + '" (at "' + path_id + '")');
|
|
308
|
+
}
|
|
309
|
+
const obj_label = obj.label;
|
|
310
|
+
const path_label = path + '.label';
|
|
311
|
+
if (typeof obj_label !== 'string') {
|
|
312
|
+
return new TypeError('Expected "string" but received "' + typeof obj_label + '" (at "' + path_label + '")');
|
|
313
|
+
}
|
|
314
|
+
const obj_lastModifiedBy = obj.lastModifiedBy;
|
|
315
|
+
const path_lastModifiedBy = path + '.lastModifiedBy';
|
|
316
|
+
const referencepath_lastModifiedByValidationError = validate$i(obj_lastModifiedBy, path_lastModifiedBy);
|
|
317
|
+
if (referencepath_lastModifiedByValidationError !== null) {
|
|
318
|
+
let message = 'Object doesn\'t match CdpUserRepresentation (at "' + path_lastModifiedBy + '")\n';
|
|
319
|
+
message += referencepath_lastModifiedByValidationError.message.split('\n').map((line) => '\t' + line).join('\n');
|
|
320
|
+
return new TypeError(message);
|
|
321
|
+
}
|
|
322
|
+
const obj_lastModifiedDate = obj.lastModifiedDate;
|
|
323
|
+
const path_lastModifiedDate = path + '.lastModifiedDate';
|
|
324
|
+
if (typeof obj_lastModifiedDate !== 'string') {
|
|
325
|
+
return new TypeError('Expected "string" but received "' + typeof obj_lastModifiedDate + '" (at "' + path_lastModifiedDate + '")');
|
|
326
|
+
}
|
|
327
|
+
const obj_name = obj.name;
|
|
328
|
+
const path_name = path + '.name';
|
|
329
|
+
if (typeof obj_name !== 'string') {
|
|
330
|
+
return new TypeError('Expected "string" but received "' + typeof obj_name + '" (at "' + path_name + '")');
|
|
331
|
+
}
|
|
332
|
+
const obj_namespace = obj.namespace;
|
|
333
|
+
const path_namespace = path + '.namespace';
|
|
334
|
+
if (typeof obj_namespace !== 'string') {
|
|
335
|
+
return new TypeError('Expected "string" but received "' + typeof obj_namespace + '" (at "' + path_namespace + '")');
|
|
336
|
+
}
|
|
337
|
+
const obj_url = obj.url;
|
|
338
|
+
const path_url = path + '.url';
|
|
339
|
+
if (typeof obj_url !== 'string') {
|
|
340
|
+
return new TypeError('Expected "string" but received "' + typeof obj_url + '" (at "' + path_url + '")');
|
|
341
|
+
}
|
|
342
|
+
})();
|
|
343
|
+
return v_error === undefined ? null : v_error;
|
|
344
|
+
}
|
|
345
|
+
|
|
346
|
+
function validate$g(obj, path = 'CdpMlModelParameterOverrideBaseRepresentation') {
|
|
347
|
+
const v_error = (() => {
|
|
348
|
+
if (typeof obj !== 'object' || ArrayIsArray(obj) || obj === null) {
|
|
349
|
+
return new TypeError('Expected "object" but received "' + typeof obj + '" (at "' + path + '")');
|
|
350
|
+
}
|
|
351
|
+
const obj_parameterName = obj.parameterName;
|
|
352
|
+
const path_parameterName = path + '.parameterName';
|
|
353
|
+
if (typeof obj_parameterName !== 'string') {
|
|
354
|
+
return new TypeError('Expected "string" but received "' + typeof obj_parameterName + '" (at "' + path_parameterName + '")');
|
|
355
|
+
}
|
|
356
|
+
const obj_type = obj.type;
|
|
357
|
+
const path_type = path + '.type';
|
|
358
|
+
if (typeof obj_type !== 'string') {
|
|
359
|
+
return new TypeError('Expected "string" but received "' + typeof obj_type + '" (at "' + path_type + '")');
|
|
360
|
+
}
|
|
361
|
+
})();
|
|
362
|
+
return v_error === undefined ? null : v_error;
|
|
363
|
+
}
|
|
364
|
+
|
|
365
|
+
const TTL$5 = 1000;
|
|
366
|
+
const VERSION$5 = "fd6be4e2373b9db208417a21b7500f5f";
|
|
367
|
+
function validate$f(obj, path = 'CdpMlConfiguredModelRepresentation') {
|
|
368
|
+
const v_error = (() => {
|
|
369
|
+
if (typeof obj !== 'object' || ArrayIsArray(obj) || obj === null) {
|
|
370
|
+
return new TypeError('Expected "object" but received "' + typeof obj + '" (at "' + path + '")');
|
|
371
|
+
}
|
|
372
|
+
const obj_actionableFields = obj.actionableFields;
|
|
373
|
+
const path_actionableFields = path + '.actionableFields';
|
|
374
|
+
if (!ArrayIsArray(obj_actionableFields)) {
|
|
375
|
+
return new TypeError('Expected "array" but received "' + typeof obj_actionableFields + '" (at "' + path_actionableFields + '")');
|
|
376
|
+
}
|
|
377
|
+
for (let i = 0; i < obj_actionableFields.length; i++) {
|
|
378
|
+
const obj_actionableFields_item = obj_actionableFields[i];
|
|
379
|
+
const path_actionableFields_item = path_actionableFields + '[' + i + ']';
|
|
380
|
+
const referencepath_actionableFields_itemValidationError = validate$j(obj_actionableFields_item, path_actionableFields_item);
|
|
381
|
+
if (referencepath_actionableFields_itemValidationError !== null) {
|
|
382
|
+
let message = 'Object doesn\'t match CdpMlCustomizableFieldRepresentation (at "' + path_actionableFields_item + '")\n';
|
|
383
|
+
message += referencepath_actionableFields_itemValidationError.message.split('\n').map((line) => '\t' + line).join('\n');
|
|
384
|
+
return new TypeError(message);
|
|
385
|
+
}
|
|
386
|
+
}
|
|
387
|
+
const obj_artifact = obj.artifact;
|
|
388
|
+
const path_artifact = path + '.artifact';
|
|
389
|
+
const referencepath_artifactValidationError = validate$h(obj_artifact, path_artifact);
|
|
390
|
+
if (referencepath_artifactValidationError !== null) {
|
|
391
|
+
let message = 'Object doesn\'t match CdpAssetReferenceRepresentation (at "' + path_artifact + '")\n';
|
|
392
|
+
message += referencepath_artifactValidationError.message.split('\n').map((line) => '\t' + line).join('\n');
|
|
393
|
+
return new TypeError(message);
|
|
394
|
+
}
|
|
395
|
+
const obj_capability = obj.capability;
|
|
396
|
+
const path_capability = path + '.capability';
|
|
397
|
+
if (typeof obj_capability !== 'string') {
|
|
398
|
+
return new TypeError('Expected "string" but received "' + typeof obj_capability + '" (at "' + path_capability + '")');
|
|
399
|
+
}
|
|
400
|
+
const obj_createdBy = obj.createdBy;
|
|
401
|
+
const path_createdBy = path + '.createdBy';
|
|
402
|
+
const referencepath_createdByValidationError = validate$i(obj_createdBy, path_createdBy);
|
|
403
|
+
if (referencepath_createdByValidationError !== null) {
|
|
404
|
+
let message = 'Object doesn\'t match CdpUserRepresentation (at "' + path_createdBy + '")\n';
|
|
405
|
+
message += referencepath_createdByValidationError.message.split('\n').map((line) => '\t' + line).join('\n');
|
|
406
|
+
return new TypeError(message);
|
|
407
|
+
}
|
|
408
|
+
const obj_createdDate = obj.createdDate;
|
|
409
|
+
const path_createdDate = path + '.createdDate';
|
|
410
|
+
if (typeof obj_createdDate !== 'string') {
|
|
411
|
+
return new TypeError('Expected "string" but received "' + typeof obj_createdDate + '" (at "' + path_createdDate + '")');
|
|
412
|
+
}
|
|
413
|
+
const obj_customizableFields = obj.customizableFields;
|
|
414
|
+
const path_customizableFields = path + '.customizableFields';
|
|
415
|
+
if (!ArrayIsArray(obj_customizableFields)) {
|
|
416
|
+
return new TypeError('Expected "array" but received "' + typeof obj_customizableFields + '" (at "' + path_customizableFields + '")');
|
|
417
|
+
}
|
|
418
|
+
for (let i = 0; i < obj_customizableFields.length; i++) {
|
|
419
|
+
const obj_customizableFields_item = obj_customizableFields[i];
|
|
420
|
+
const path_customizableFields_item = path_customizableFields + '[' + i + ']';
|
|
421
|
+
const referencepath_customizableFields_itemValidationError = validate$j(obj_customizableFields_item, path_customizableFields_item);
|
|
422
|
+
if (referencepath_customizableFields_itemValidationError !== null) {
|
|
423
|
+
let message = 'Object doesn\'t match CdpMlCustomizableFieldRepresentation (at "' + path_customizableFields_item + '")\n';
|
|
424
|
+
message += referencepath_customizableFields_itemValidationError.message.split('\n').map((line) => '\t' + line).join('\n');
|
|
425
|
+
return new TypeError(message);
|
|
426
|
+
}
|
|
427
|
+
}
|
|
428
|
+
const obj_description = obj.description;
|
|
429
|
+
const path_description = path + '.description';
|
|
430
|
+
if (typeof obj_description !== 'string') {
|
|
431
|
+
return new TypeError('Expected "string" but received "' + typeof obj_description + '" (at "' + path_description + '")');
|
|
432
|
+
}
|
|
433
|
+
const obj_filter = obj.filter;
|
|
434
|
+
const path_filter = path + '.filter';
|
|
435
|
+
const referencepath_filterValidationError = validate$m(obj_filter, path_filter);
|
|
436
|
+
if (referencepath_filterValidationError !== null) {
|
|
437
|
+
let message = 'Object doesn\'t match CdpMlFilterRepresentation (at "' + path_filter + '")\n';
|
|
438
|
+
message += referencepath_filterValidationError.message.split('\n').map((line) => '\t' + line).join('\n');
|
|
439
|
+
return new TypeError(message);
|
|
440
|
+
}
|
|
441
|
+
const obj_id = obj.id;
|
|
442
|
+
const path_id = path + '.id';
|
|
443
|
+
if (typeof obj_id !== 'string') {
|
|
444
|
+
return new TypeError('Expected "string" but received "' + typeof obj_id + '" (at "' + path_id + '")');
|
|
445
|
+
}
|
|
446
|
+
const obj_label = obj.label;
|
|
447
|
+
const path_label = path + '.label';
|
|
448
|
+
if (typeof obj_label !== 'string') {
|
|
449
|
+
return new TypeError('Expected "string" but received "' + typeof obj_label + '" (at "' + path_label + '")');
|
|
450
|
+
}
|
|
451
|
+
const obj_lastActivatedBy = obj.lastActivatedBy;
|
|
452
|
+
const path_lastActivatedBy = path + '.lastActivatedBy';
|
|
453
|
+
const referencepath_lastActivatedByValidationError = validate$i(obj_lastActivatedBy, path_lastActivatedBy);
|
|
454
|
+
if (referencepath_lastActivatedByValidationError !== null) {
|
|
455
|
+
let message = 'Object doesn\'t match CdpUserRepresentation (at "' + path_lastActivatedBy + '")\n';
|
|
456
|
+
message += referencepath_lastActivatedByValidationError.message.split('\n').map((line) => '\t' + line).join('\n');
|
|
457
|
+
return new TypeError(message);
|
|
458
|
+
}
|
|
459
|
+
const obj_lastActivatedDate = obj.lastActivatedDate;
|
|
460
|
+
const path_lastActivatedDate = path + '.lastActivatedDate';
|
|
461
|
+
if (typeof obj_lastActivatedDate !== 'string') {
|
|
462
|
+
return new TypeError('Expected "string" but received "' + typeof obj_lastActivatedDate + '" (at "' + path_lastActivatedDate + '")');
|
|
463
|
+
}
|
|
464
|
+
const obj_lastModifiedBy = obj.lastModifiedBy;
|
|
465
|
+
const path_lastModifiedBy = path + '.lastModifiedBy';
|
|
466
|
+
const referencepath_lastModifiedByValidationError = validate$i(obj_lastModifiedBy, path_lastModifiedBy);
|
|
467
|
+
if (referencepath_lastModifiedByValidationError !== null) {
|
|
468
|
+
let message = 'Object doesn\'t match CdpUserRepresentation (at "' + path_lastModifiedBy + '")\n';
|
|
469
|
+
message += referencepath_lastModifiedByValidationError.message.split('\n').map((line) => '\t' + line).join('\n');
|
|
470
|
+
return new TypeError(message);
|
|
471
|
+
}
|
|
472
|
+
const obj_lastModifiedDate = obj.lastModifiedDate;
|
|
473
|
+
const path_lastModifiedDate = path + '.lastModifiedDate';
|
|
474
|
+
if (typeof obj_lastModifiedDate !== 'string') {
|
|
475
|
+
return new TypeError('Expected "string" but received "' + typeof obj_lastModifiedDate + '" (at "' + path_lastModifiedDate + '")');
|
|
476
|
+
}
|
|
477
|
+
const obj_metricsUrl = obj.metricsUrl;
|
|
478
|
+
const path_metricsUrl = path + '.metricsUrl';
|
|
479
|
+
if (typeof obj_metricsUrl !== 'string') {
|
|
480
|
+
return new TypeError('Expected "string" but received "' + typeof obj_metricsUrl + '" (at "' + path_metricsUrl + '")');
|
|
481
|
+
}
|
|
482
|
+
const obj_name = obj.name;
|
|
483
|
+
const path_name = path + '.name';
|
|
484
|
+
if (typeof obj_name !== 'string') {
|
|
485
|
+
return new TypeError('Expected "string" but received "' + typeof obj_name + '" (at "' + path_name + '")');
|
|
486
|
+
}
|
|
487
|
+
const obj_namespace = obj.namespace;
|
|
488
|
+
const path_namespace = path + '.namespace';
|
|
489
|
+
if (typeof obj_namespace !== 'string') {
|
|
490
|
+
return new TypeError('Expected "string" but received "' + typeof obj_namespace + '" (at "' + path_namespace + '")');
|
|
491
|
+
}
|
|
492
|
+
const obj_parameterOverrides = obj.parameterOverrides;
|
|
493
|
+
const path_parameterOverrides = path + '.parameterOverrides';
|
|
494
|
+
if (!ArrayIsArray(obj_parameterOverrides)) {
|
|
495
|
+
return new TypeError('Expected "array" but received "' + typeof obj_parameterOverrides + '" (at "' + path_parameterOverrides + '")');
|
|
496
|
+
}
|
|
497
|
+
for (let i = 0; i < obj_parameterOverrides.length; i++) {
|
|
498
|
+
const obj_parameterOverrides_item = obj_parameterOverrides[i];
|
|
499
|
+
const path_parameterOverrides_item = path_parameterOverrides + '[' + i + ']';
|
|
500
|
+
const referencepath_parameterOverrides_itemValidationError = validate$g(obj_parameterOverrides_item, path_parameterOverrides_item);
|
|
501
|
+
if (referencepath_parameterOverrides_itemValidationError !== null) {
|
|
502
|
+
let message = 'Object doesn\'t match CdpMlModelParameterOverrideBaseRepresentation (at "' + path_parameterOverrides_item + '")\n';
|
|
503
|
+
message += referencepath_parameterOverrides_itemValidationError.message.split('\n').map((line) => '\t' + line).join('\n');
|
|
504
|
+
return new TypeError(message);
|
|
505
|
+
}
|
|
506
|
+
}
|
|
507
|
+
const obj_position = obj.position;
|
|
508
|
+
const path_position = path + '.position';
|
|
509
|
+
if (typeof obj_position !== 'number' || (typeof obj_position === 'number' && Math.floor(obj_position) !== obj_position)) {
|
|
510
|
+
return new TypeError('Expected "integer" but received "' + typeof obj_position + '" (at "' + path_position + '")');
|
|
511
|
+
}
|
|
512
|
+
const obj_status = obj.status;
|
|
513
|
+
const path_status = path + '.status';
|
|
514
|
+
if (typeof obj_status !== 'string') {
|
|
515
|
+
return new TypeError('Expected "string" but received "' + typeof obj_status + '" (at "' + path_status + '")');
|
|
516
|
+
}
|
|
517
|
+
const obj_url = obj.url;
|
|
518
|
+
const path_url = path + '.url';
|
|
519
|
+
if (typeof obj_url !== 'string') {
|
|
520
|
+
return new TypeError('Expected "string" but received "' + typeof obj_url + '" (at "' + path_url + '")');
|
|
521
|
+
}
|
|
522
|
+
})();
|
|
523
|
+
return v_error === undefined ? null : v_error;
|
|
524
|
+
}
|
|
525
|
+
const RepresentationType$5 = 'CdpMlConfiguredModelRepresentation';
|
|
526
|
+
function keyBuilder$d(luvio, config) {
|
|
527
|
+
return keyPrefix + '::' + RepresentationType$5 + ':' + config.modelId;
|
|
528
|
+
}
|
|
529
|
+
function keyBuilderFromType$1(luvio, object) {
|
|
530
|
+
const keyParams = {
|
|
531
|
+
modelId: object.id
|
|
532
|
+
};
|
|
533
|
+
return keyBuilder$d(luvio, keyParams);
|
|
534
|
+
}
|
|
535
|
+
function normalize$5(input, existing, path, luvio, store, timestamp) {
|
|
536
|
+
return input;
|
|
537
|
+
}
|
|
538
|
+
const select$d = function CdpMlConfiguredModelRepresentationSelect() {
|
|
539
|
+
return {
|
|
540
|
+
kind: 'Fragment',
|
|
541
|
+
version: VERSION$5,
|
|
542
|
+
private: [],
|
|
543
|
+
opaque: true
|
|
544
|
+
};
|
|
545
|
+
};
|
|
546
|
+
function equals$5(existing, incoming) {
|
|
547
|
+
if (JSONStringify(incoming) !== JSONStringify(existing)) {
|
|
548
|
+
return false;
|
|
549
|
+
}
|
|
550
|
+
return true;
|
|
551
|
+
}
|
|
552
|
+
const ingest$5 = function CdpMlConfiguredModelRepresentationIngest(input, path, luvio, store, timestamp) {
|
|
553
|
+
if (process.env.NODE_ENV !== 'production') {
|
|
554
|
+
const validateError = validate$f(input);
|
|
555
|
+
if (validateError !== null) {
|
|
556
|
+
throw validateError;
|
|
557
|
+
}
|
|
558
|
+
}
|
|
559
|
+
const key = keyBuilderFromType$1(luvio, input);
|
|
560
|
+
const ttlToUse = TTL$5;
|
|
561
|
+
ingestShape(input, path, luvio, store, timestamp, ttlToUse, key, normalize$5, "cdp-machine-learning", VERSION$5, RepresentationType$5, equals$5);
|
|
562
|
+
return createLink(key);
|
|
563
|
+
};
|
|
564
|
+
function getTypeCacheKeys$5(rootKeySet, luvio, input, fullPathFactory) {
|
|
565
|
+
// root cache key (uses fullPathFactory if keyBuilderFromType isn't defined)
|
|
566
|
+
const rootKey = keyBuilderFromType$1(luvio, input);
|
|
567
|
+
rootKeySet.set(rootKey, {
|
|
568
|
+
namespace: keyPrefix,
|
|
569
|
+
representationName: RepresentationType$5,
|
|
570
|
+
mergeable: false
|
|
571
|
+
});
|
|
572
|
+
}
|
|
573
|
+
|
|
574
|
+
function select$c(luvio, params) {
|
|
575
|
+
return select$d();
|
|
576
|
+
}
|
|
577
|
+
function getResponseCacheKeys$7(storeKeyMap, luvio, resourceParams, response) {
|
|
578
|
+
getTypeCacheKeys$5(storeKeyMap, luvio, response);
|
|
579
|
+
}
|
|
580
|
+
function ingestSuccess$7(luvio, resourceParams, response) {
|
|
581
|
+
const { body } = response;
|
|
582
|
+
const key = keyBuilderFromType$1(luvio, body);
|
|
583
|
+
luvio.storeIngest(key, ingest$5, body);
|
|
584
|
+
const snapshot = luvio.storeLookup({
|
|
585
|
+
recordId: key,
|
|
586
|
+
node: select$c(),
|
|
587
|
+
variables: {},
|
|
588
|
+
});
|
|
589
|
+
if (process.env.NODE_ENV !== 'production') {
|
|
590
|
+
if (snapshot.state !== 'Fulfilled') {
|
|
591
|
+
throw new Error('Invalid network response. Expected resource response to result in Fulfilled snapshot');
|
|
592
|
+
}
|
|
593
|
+
}
|
|
594
|
+
deepFreeze(snapshot.data);
|
|
595
|
+
return snapshot;
|
|
596
|
+
}
|
|
597
|
+
function createResourceRequest$7(config) {
|
|
598
|
+
const headers = {};
|
|
599
|
+
return {
|
|
600
|
+
baseUri: '/services/data/v60.0',
|
|
601
|
+
basePath: '/ssot/machine-learning/workspaces/' + config.urlParams.workspaceIdOrName + '/models',
|
|
602
|
+
method: 'post',
|
|
603
|
+
body: config.body,
|
|
604
|
+
urlParams: config.urlParams,
|
|
605
|
+
queryParams: {},
|
|
606
|
+
headers,
|
|
607
|
+
priority: 'normal',
|
|
608
|
+
};
|
|
609
|
+
}
|
|
610
|
+
|
|
611
|
+
const adapterName$7 = 'createCdpMlConfiguredModelCollection';
|
|
612
|
+
const createCdpMlConfiguredModelCollection_ConfigPropertyMetadata = [
|
|
613
|
+
generateParamConfigMetadata('workspaceIdOrName', true, 0 /* UrlParameter */, 0 /* String */),
|
|
614
|
+
generateParamConfigMetadata('actionableFields', true, 2 /* Body */, 4 /* Unsupported */, true),
|
|
615
|
+
generateParamConfigMetadata('artifact', true, 2 /* Body */, 4 /* Unsupported */),
|
|
616
|
+
generateParamConfigMetadata('capability', true, 2 /* Body */, 0 /* String */),
|
|
617
|
+
generateParamConfigMetadata('customizableFields', true, 2 /* Body */, 4 /* Unsupported */, true),
|
|
618
|
+
generateParamConfigMetadata('description', true, 2 /* Body */, 0 /* String */),
|
|
619
|
+
generateParamConfigMetadata('filter', true, 2 /* Body */, 4 /* Unsupported */),
|
|
620
|
+
generateParamConfigMetadata('label', true, 2 /* Body */, 0 /* String */),
|
|
621
|
+
generateParamConfigMetadata('parameterOverrides', true, 2 /* Body */, 4 /* Unsupported */, true),
|
|
622
|
+
generateParamConfigMetadata('position', true, 2 /* Body */, 3 /* Integer */),
|
|
623
|
+
generateParamConfigMetadata('status', true, 2 /* Body */, 0 /* String */),
|
|
624
|
+
];
|
|
625
|
+
const createCdpMlConfiguredModelCollection_ConfigPropertyNames = /*#__PURE__*/ buildAdapterValidationConfig(adapterName$7, createCdpMlConfiguredModelCollection_ConfigPropertyMetadata);
|
|
626
|
+
const createResourceParams$7 = /*#__PURE__*/ createResourceParams$8(createCdpMlConfiguredModelCollection_ConfigPropertyMetadata);
|
|
627
|
+
function typeCheckConfig$7(untrustedConfig) {
|
|
628
|
+
const config = {};
|
|
629
|
+
typeCheckConfig$8(untrustedConfig, config, createCdpMlConfiguredModelCollection_ConfigPropertyMetadata);
|
|
630
|
+
const untrustedConfig_actionableFields = untrustedConfig.actionableFields;
|
|
631
|
+
if (ArrayIsArray$1(untrustedConfig_actionableFields)) {
|
|
632
|
+
const untrustedConfig_actionableFields_array = [];
|
|
633
|
+
for (let i = 0, arrayLength = untrustedConfig_actionableFields.length; i < arrayLength; i++) {
|
|
634
|
+
const untrustedConfig_actionableFields_item = untrustedConfig_actionableFields[i];
|
|
635
|
+
if (untrustedIsObject(untrustedConfig_actionableFields_item)) {
|
|
636
|
+
const untrustedConfig_actionableFields_item_object = {};
|
|
637
|
+
if (untrustedConfig_actionableFields_item_object !== undefined && Object.keys(untrustedConfig_actionableFields_item_object).length >= 0) {
|
|
638
|
+
untrustedConfig_actionableFields_array.push(untrustedConfig_actionableFields_item_object);
|
|
639
|
+
}
|
|
640
|
+
}
|
|
641
|
+
}
|
|
642
|
+
config.actionableFields = untrustedConfig_actionableFields_array;
|
|
643
|
+
}
|
|
644
|
+
const untrustedConfig_artifact = untrustedConfig.artifact;
|
|
645
|
+
if (untrustedIsObject(untrustedConfig_artifact)) {
|
|
646
|
+
const untrustedConfig_artifact_object = {};
|
|
647
|
+
if (untrustedConfig_artifact_object !== undefined && Object.keys(untrustedConfig_artifact_object).length >= 0) {
|
|
648
|
+
config.artifact = untrustedConfig_artifact_object;
|
|
649
|
+
}
|
|
650
|
+
}
|
|
651
|
+
const untrustedConfig_customizableFields = untrustedConfig.customizableFields;
|
|
652
|
+
if (ArrayIsArray$1(untrustedConfig_customizableFields)) {
|
|
653
|
+
const untrustedConfig_customizableFields_array = [];
|
|
654
|
+
for (let i = 0, arrayLength = untrustedConfig_customizableFields.length; i < arrayLength; i++) {
|
|
655
|
+
const untrustedConfig_customizableFields_item = untrustedConfig_customizableFields[i];
|
|
656
|
+
if (untrustedIsObject(untrustedConfig_customizableFields_item)) {
|
|
657
|
+
const untrustedConfig_customizableFields_item_object = {};
|
|
658
|
+
if (untrustedConfig_customizableFields_item_object !== undefined && Object.keys(untrustedConfig_customizableFields_item_object).length >= 0) {
|
|
659
|
+
untrustedConfig_customizableFields_array.push(untrustedConfig_customizableFields_item_object);
|
|
660
|
+
}
|
|
661
|
+
}
|
|
662
|
+
}
|
|
663
|
+
config.customizableFields = untrustedConfig_customizableFields_array;
|
|
664
|
+
}
|
|
665
|
+
const untrustedConfig_filter = untrustedConfig.filter;
|
|
666
|
+
if (untrustedIsObject(untrustedConfig_filter)) {
|
|
667
|
+
const untrustedConfig_filter_object = {};
|
|
668
|
+
if (untrustedConfig_filter_object !== undefined && Object.keys(untrustedConfig_filter_object).length >= 0) {
|
|
669
|
+
config.filter = untrustedConfig_filter_object;
|
|
670
|
+
}
|
|
671
|
+
}
|
|
672
|
+
const untrustedConfig_parameterOverrides = untrustedConfig.parameterOverrides;
|
|
673
|
+
if (ArrayIsArray$1(untrustedConfig_parameterOverrides)) {
|
|
674
|
+
const untrustedConfig_parameterOverrides_array = [];
|
|
675
|
+
for (let i = 0, arrayLength = untrustedConfig_parameterOverrides.length; i < arrayLength; i++) {
|
|
676
|
+
const untrustedConfig_parameterOverrides_item = untrustedConfig_parameterOverrides[i];
|
|
677
|
+
if (untrustedIsObject(untrustedConfig_parameterOverrides_item)) {
|
|
678
|
+
const untrustedConfig_parameterOverrides_item_object = {};
|
|
679
|
+
if (untrustedConfig_parameterOverrides_item_object !== undefined && Object.keys(untrustedConfig_parameterOverrides_item_object).length >= 0) {
|
|
680
|
+
untrustedConfig_parameterOverrides_array.push(untrustedConfig_parameterOverrides_item_object);
|
|
681
|
+
}
|
|
682
|
+
}
|
|
683
|
+
}
|
|
684
|
+
config.parameterOverrides = untrustedConfig_parameterOverrides_array;
|
|
685
|
+
}
|
|
686
|
+
return config;
|
|
687
|
+
}
|
|
688
|
+
function validateAdapterConfig$7(untrustedConfig, configPropertyNames) {
|
|
689
|
+
if (!untrustedIsObject(untrustedConfig)) {
|
|
690
|
+
return null;
|
|
691
|
+
}
|
|
692
|
+
if (process.env.NODE_ENV !== 'production') {
|
|
693
|
+
validateConfig(untrustedConfig, configPropertyNames);
|
|
694
|
+
}
|
|
695
|
+
const config = typeCheckConfig$7(untrustedConfig);
|
|
696
|
+
if (!areRequiredParametersPresent(config, configPropertyNames)) {
|
|
697
|
+
return null;
|
|
698
|
+
}
|
|
699
|
+
return config;
|
|
700
|
+
}
|
|
701
|
+
function buildNetworkSnapshot$7(luvio, config, options) {
|
|
702
|
+
const resourceParams = createResourceParams$7(config);
|
|
703
|
+
const request = createResourceRequest$7(resourceParams);
|
|
704
|
+
return luvio.dispatchResourceRequest(request, options)
|
|
705
|
+
.then((response) => {
|
|
706
|
+
return luvio.handleSuccessResponse(() => {
|
|
707
|
+
const snapshot = ingestSuccess$7(luvio, resourceParams, response);
|
|
708
|
+
return luvio.storeBroadcast().then(() => snapshot);
|
|
709
|
+
}, () => {
|
|
710
|
+
const cache = new StoreKeyMap();
|
|
711
|
+
getResponseCacheKeys$7(cache, luvio, resourceParams, response.body);
|
|
712
|
+
return cache;
|
|
713
|
+
});
|
|
714
|
+
}, (response) => {
|
|
715
|
+
deepFreeze(response);
|
|
716
|
+
throw response;
|
|
717
|
+
});
|
|
718
|
+
}
|
|
719
|
+
const createCdpMlConfiguredModelCollectionAdapterFactory = (luvio) => {
|
|
720
|
+
return function createCdpMlConfiguredModelCollection(untrustedConfig) {
|
|
721
|
+
const config = validateAdapterConfig$7(untrustedConfig, createCdpMlConfiguredModelCollection_ConfigPropertyNames);
|
|
722
|
+
// Invalid or incomplete config
|
|
723
|
+
if (config === null) {
|
|
724
|
+
throw new Error('Invalid config for "createCdpMlConfiguredModelCollection"');
|
|
725
|
+
}
|
|
726
|
+
return buildNetworkSnapshot$7(luvio, config);
|
|
727
|
+
};
|
|
728
|
+
};
|
|
729
|
+
|
|
730
|
+
function select$b(luvio, params) {
|
|
731
|
+
return select$d();
|
|
732
|
+
}
|
|
733
|
+
function keyBuilder$c(luvio, params) {
|
|
734
|
+
return keyBuilder$d(luvio, {
|
|
735
|
+
modelId: params.urlParams.modelId,
|
|
736
|
+
workspaceIdOrName: params.urlParams.workspaceIdOrName
|
|
737
|
+
});
|
|
738
|
+
}
|
|
739
|
+
function getResponseCacheKeys$6(storeKeyMap, luvio, resourceParams, response) {
|
|
740
|
+
getTypeCacheKeys$5(storeKeyMap, luvio, response);
|
|
741
|
+
}
|
|
742
|
+
function ingestSuccess$6(luvio, resourceParams, response, snapshotRefresh) {
|
|
743
|
+
const { body } = response;
|
|
744
|
+
const key = keyBuilder$c(luvio, resourceParams);
|
|
745
|
+
luvio.storeIngest(key, ingest$5, body);
|
|
746
|
+
const snapshot = luvio.storeLookup({
|
|
747
|
+
recordId: key,
|
|
748
|
+
node: select$b(),
|
|
749
|
+
variables: {},
|
|
750
|
+
}, snapshotRefresh);
|
|
751
|
+
if (process.env.NODE_ENV !== 'production') {
|
|
752
|
+
if (snapshot.state !== 'Fulfilled') {
|
|
753
|
+
throw new Error('Invalid network response. Expected resource response to result in Fulfilled snapshot');
|
|
754
|
+
}
|
|
755
|
+
}
|
|
756
|
+
deepFreeze(snapshot.data);
|
|
757
|
+
return snapshot;
|
|
758
|
+
}
|
|
759
|
+
function ingestError$5(luvio, params, error, snapshotRefresh) {
|
|
760
|
+
const key = keyBuilder$c(luvio, params);
|
|
761
|
+
const errorSnapshot = luvio.errorSnapshot(error, snapshotRefresh);
|
|
762
|
+
const storeMetadataParams = {
|
|
763
|
+
ttl: TTL$5,
|
|
764
|
+
namespace: keyPrefix,
|
|
765
|
+
version: VERSION$5,
|
|
766
|
+
representationName: RepresentationType$5
|
|
767
|
+
};
|
|
768
|
+
luvio.storeIngestError(key, errorSnapshot, storeMetadataParams);
|
|
769
|
+
return errorSnapshot;
|
|
770
|
+
}
|
|
771
|
+
function createResourceRequest$6(config) {
|
|
772
|
+
const headers = {};
|
|
773
|
+
return {
|
|
774
|
+
baseUri: '/services/data/v60.0',
|
|
775
|
+
basePath: '/ssot/machine-learning/workspaces/' + config.urlParams.workspaceIdOrName + '/models/' + config.urlParams.modelId + '',
|
|
776
|
+
method: 'get',
|
|
777
|
+
body: null,
|
|
778
|
+
urlParams: config.urlParams,
|
|
779
|
+
queryParams: {},
|
|
780
|
+
headers,
|
|
781
|
+
priority: 'normal',
|
|
782
|
+
};
|
|
783
|
+
}
|
|
784
|
+
|
|
785
|
+
const adapterName$6 = 'getCdpMlConfiguredModel';
|
|
786
|
+
const getCdpMlConfiguredModel_ConfigPropertyMetadata = [
|
|
787
|
+
generateParamConfigMetadata('modelId', true, 0 /* UrlParameter */, 0 /* String */),
|
|
788
|
+
generateParamConfigMetadata('workspaceIdOrName', true, 0 /* UrlParameter */, 0 /* String */),
|
|
789
|
+
];
|
|
790
|
+
const getCdpMlConfiguredModel_ConfigPropertyNames = /*#__PURE__*/ buildAdapterValidationConfig(adapterName$6, getCdpMlConfiguredModel_ConfigPropertyMetadata);
|
|
791
|
+
const createResourceParams$6 = /*#__PURE__*/ createResourceParams$8(getCdpMlConfiguredModel_ConfigPropertyMetadata);
|
|
792
|
+
function keyBuilder$b(luvio, config) {
|
|
793
|
+
const resourceParams = createResourceParams$6(config);
|
|
794
|
+
return keyBuilder$c(luvio, resourceParams);
|
|
795
|
+
}
|
|
796
|
+
function typeCheckConfig$6(untrustedConfig) {
|
|
797
|
+
const config = {};
|
|
798
|
+
typeCheckConfig$8(untrustedConfig, config, getCdpMlConfiguredModel_ConfigPropertyMetadata);
|
|
799
|
+
return config;
|
|
800
|
+
}
|
|
801
|
+
function validateAdapterConfig$6(untrustedConfig, configPropertyNames) {
|
|
802
|
+
if (!untrustedIsObject(untrustedConfig)) {
|
|
803
|
+
return null;
|
|
804
|
+
}
|
|
805
|
+
if (process.env.NODE_ENV !== 'production') {
|
|
806
|
+
validateConfig(untrustedConfig, configPropertyNames);
|
|
807
|
+
}
|
|
808
|
+
const config = typeCheckConfig$6(untrustedConfig);
|
|
809
|
+
if (!areRequiredParametersPresent(config, configPropertyNames)) {
|
|
810
|
+
return null;
|
|
811
|
+
}
|
|
812
|
+
return config;
|
|
813
|
+
}
|
|
814
|
+
function adapterFragment$5(luvio, config) {
|
|
815
|
+
createResourceParams$6(config);
|
|
816
|
+
return select$b();
|
|
817
|
+
}
|
|
818
|
+
function onFetchResponseSuccess$5(luvio, config, resourceParams, response) {
|
|
819
|
+
const snapshot = ingestSuccess$6(luvio, resourceParams, response, {
|
|
820
|
+
config,
|
|
821
|
+
resolve: () => buildNetworkSnapshot$6(luvio, config, snapshotRefreshOptions)
|
|
822
|
+
});
|
|
823
|
+
return luvio.storeBroadcast().then(() => snapshot);
|
|
824
|
+
}
|
|
825
|
+
function onFetchResponseError$5(luvio, config, resourceParams, response) {
|
|
826
|
+
const snapshot = ingestError$5(luvio, resourceParams, response, {
|
|
827
|
+
config,
|
|
828
|
+
resolve: () => buildNetworkSnapshot$6(luvio, config, snapshotRefreshOptions)
|
|
829
|
+
});
|
|
830
|
+
return luvio.storeBroadcast().then(() => snapshot);
|
|
831
|
+
}
|
|
832
|
+
function buildNetworkSnapshot$6(luvio, config, options) {
|
|
833
|
+
const resourceParams = createResourceParams$6(config);
|
|
834
|
+
const request = createResourceRequest$6(resourceParams);
|
|
835
|
+
return luvio.dispatchResourceRequest(request, options)
|
|
836
|
+
.then((response) => {
|
|
837
|
+
return luvio.handleSuccessResponse(() => onFetchResponseSuccess$5(luvio, config, resourceParams, response), () => {
|
|
838
|
+
const cache = new StoreKeyMap();
|
|
839
|
+
getResponseCacheKeys$6(cache, luvio, resourceParams, response.body);
|
|
840
|
+
return cache;
|
|
841
|
+
});
|
|
842
|
+
}, (response) => {
|
|
843
|
+
return luvio.handleErrorResponse(() => onFetchResponseError$5(luvio, config, resourceParams, response));
|
|
844
|
+
});
|
|
845
|
+
}
|
|
846
|
+
function buildNetworkSnapshotCachePolicy$5(context, coercedAdapterRequestContext) {
|
|
847
|
+
return buildNetworkSnapshotCachePolicy$6(context, coercedAdapterRequestContext, buildNetworkSnapshot$6, undefined, false);
|
|
848
|
+
}
|
|
849
|
+
function buildCachedSnapshotCachePolicy$5(context, storeLookup) {
|
|
850
|
+
const { luvio, config } = context;
|
|
851
|
+
const selector = {
|
|
852
|
+
recordId: keyBuilder$b(luvio, config),
|
|
853
|
+
node: adapterFragment$5(luvio, config),
|
|
854
|
+
variables: {},
|
|
855
|
+
};
|
|
856
|
+
const cacheSnapshot = storeLookup(selector, {
|
|
857
|
+
config,
|
|
858
|
+
resolve: () => buildNetworkSnapshot$6(luvio, config, snapshotRefreshOptions)
|
|
859
|
+
});
|
|
860
|
+
return cacheSnapshot;
|
|
861
|
+
}
|
|
862
|
+
const getCdpMlConfiguredModelAdapterFactory = (luvio) => function cdpMachineLearning__getCdpMlConfiguredModel(untrustedConfig, requestContext) {
|
|
863
|
+
const config = validateAdapterConfig$6(untrustedConfig, getCdpMlConfiguredModel_ConfigPropertyNames);
|
|
864
|
+
// Invalid or incomplete config
|
|
865
|
+
if (config === null) {
|
|
866
|
+
return null;
|
|
867
|
+
}
|
|
868
|
+
return luvio.applyCachePolicy((requestContext || {}), { config, luvio }, // BuildSnapshotContext
|
|
869
|
+
buildCachedSnapshotCachePolicy$5, buildNetworkSnapshotCachePolicy$5);
|
|
870
|
+
};
|
|
871
|
+
|
|
872
|
+
const TTL$4 = 1000;
|
|
873
|
+
const VERSION$4 = "06a9e2678743ed66dde7a06f3c7a39c6";
|
|
874
|
+
function validate$e(obj, path = 'CdpMlConfiguredModelCollectionRepresentation') {
|
|
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_models = obj.models;
|
|
880
|
+
const path_models = path + '.models';
|
|
881
|
+
if (!ArrayIsArray(obj_models)) {
|
|
882
|
+
return new TypeError('Expected "array" but received "' + typeof obj_models + '" (at "' + path_models + '")');
|
|
883
|
+
}
|
|
884
|
+
for (let i = 0; i < obj_models.length; i++) {
|
|
885
|
+
const obj_models_item = obj_models[i];
|
|
886
|
+
const path_models_item = path_models + '[' + i + ']';
|
|
887
|
+
const referencepath_models_itemValidationError = validate$f(obj_models_item, path_models_item);
|
|
888
|
+
if (referencepath_models_itemValidationError !== null) {
|
|
889
|
+
let message = 'Object doesn\'t match CdpMlConfiguredModelRepresentation (at "' + path_models_item + '")\n';
|
|
890
|
+
message += referencepath_models_itemValidationError.message.split('\n').map((line) => '\t' + line).join('\n');
|
|
891
|
+
return new TypeError(message);
|
|
892
|
+
}
|
|
893
|
+
}
|
|
894
|
+
const obj_totalSize = obj.totalSize;
|
|
895
|
+
const path_totalSize = path + '.totalSize';
|
|
896
|
+
if (typeof obj_totalSize !== 'number' || (typeof obj_totalSize === 'number' && Math.floor(obj_totalSize) !== obj_totalSize)) {
|
|
897
|
+
return new TypeError('Expected "integer" but received "' + typeof obj_totalSize + '" (at "' + path_totalSize + '")');
|
|
898
|
+
}
|
|
899
|
+
const obj_url = obj.url;
|
|
900
|
+
const path_url = path + '.url';
|
|
901
|
+
if (typeof obj_url !== 'string') {
|
|
902
|
+
return new TypeError('Expected "string" but received "' + typeof obj_url + '" (at "' + path_url + '")');
|
|
903
|
+
}
|
|
904
|
+
})();
|
|
905
|
+
return v_error === undefined ? null : v_error;
|
|
906
|
+
}
|
|
907
|
+
const RepresentationType$4 = 'CdpMlConfiguredModelCollectionRepresentation';
|
|
908
|
+
function normalize$4(input, existing, path, luvio, store, timestamp) {
|
|
909
|
+
return input;
|
|
910
|
+
}
|
|
911
|
+
const select$a = function CdpMlConfiguredModelCollectionRepresentationSelect() {
|
|
912
|
+
return {
|
|
913
|
+
kind: 'Fragment',
|
|
914
|
+
version: VERSION$4,
|
|
915
|
+
private: [],
|
|
916
|
+
opaque: true
|
|
917
|
+
};
|
|
918
|
+
};
|
|
919
|
+
function equals$4(existing, incoming) {
|
|
920
|
+
if (JSONStringify(incoming) !== JSONStringify(existing)) {
|
|
921
|
+
return false;
|
|
922
|
+
}
|
|
923
|
+
return true;
|
|
924
|
+
}
|
|
925
|
+
const ingest$4 = function CdpMlConfiguredModelCollectionRepresentationIngest(input, path, luvio, store, timestamp) {
|
|
926
|
+
if (process.env.NODE_ENV !== 'production') {
|
|
927
|
+
const validateError = validate$e(input);
|
|
928
|
+
if (validateError !== null) {
|
|
929
|
+
throw validateError;
|
|
930
|
+
}
|
|
931
|
+
}
|
|
932
|
+
const key = path.fullPath;
|
|
933
|
+
const ttlToUse = TTL$4;
|
|
934
|
+
ingestShape(input, path, luvio, store, timestamp, ttlToUse, key, normalize$4, "cdp-machine-learning", VERSION$4, RepresentationType$4, equals$4);
|
|
935
|
+
return createLink(key);
|
|
936
|
+
};
|
|
937
|
+
function getTypeCacheKeys$4(rootKeySet, luvio, input, fullPathFactory) {
|
|
938
|
+
// root cache key (uses fullPathFactory if keyBuilderFromType isn't defined)
|
|
939
|
+
const rootKey = fullPathFactory();
|
|
940
|
+
rootKeySet.set(rootKey, {
|
|
941
|
+
namespace: keyPrefix,
|
|
942
|
+
representationName: RepresentationType$4,
|
|
943
|
+
mergeable: false
|
|
944
|
+
});
|
|
945
|
+
}
|
|
946
|
+
|
|
947
|
+
function select$9(luvio, params) {
|
|
948
|
+
return select$a();
|
|
949
|
+
}
|
|
950
|
+
function keyBuilder$a(luvio, params) {
|
|
951
|
+
return keyPrefix + '::CdpMlConfiguredModelCollectionRepresentation:(' + 'workspaceIdOrName:' + params.urlParams.workspaceIdOrName + ')';
|
|
952
|
+
}
|
|
953
|
+
function getResponseCacheKeys$5(storeKeyMap, luvio, resourceParams, response) {
|
|
954
|
+
getTypeCacheKeys$4(storeKeyMap, luvio, response, () => keyBuilder$a(luvio, resourceParams));
|
|
955
|
+
}
|
|
956
|
+
function ingestSuccess$5(luvio, resourceParams, response, snapshotRefresh) {
|
|
957
|
+
const { body } = response;
|
|
958
|
+
const key = keyBuilder$a(luvio, resourceParams);
|
|
959
|
+
luvio.storeIngest(key, ingest$4, body);
|
|
960
|
+
const snapshot = luvio.storeLookup({
|
|
961
|
+
recordId: key,
|
|
962
|
+
node: select$9(),
|
|
963
|
+
variables: {},
|
|
964
|
+
}, snapshotRefresh);
|
|
965
|
+
if (process.env.NODE_ENV !== 'production') {
|
|
966
|
+
if (snapshot.state !== 'Fulfilled') {
|
|
967
|
+
throw new Error('Invalid network response. Expected resource response to result in Fulfilled snapshot');
|
|
968
|
+
}
|
|
969
|
+
}
|
|
970
|
+
deepFreeze(snapshot.data);
|
|
971
|
+
return snapshot;
|
|
972
|
+
}
|
|
973
|
+
function ingestError$4(luvio, params, error, snapshotRefresh) {
|
|
974
|
+
const key = keyBuilder$a(luvio, params);
|
|
975
|
+
const errorSnapshot = luvio.errorSnapshot(error, snapshotRefresh);
|
|
976
|
+
const storeMetadataParams = {
|
|
977
|
+
ttl: TTL$4,
|
|
978
|
+
namespace: keyPrefix,
|
|
979
|
+
version: VERSION$4,
|
|
980
|
+
representationName: RepresentationType$4
|
|
981
|
+
};
|
|
982
|
+
luvio.storeIngestError(key, errorSnapshot, storeMetadataParams);
|
|
983
|
+
return errorSnapshot;
|
|
984
|
+
}
|
|
985
|
+
function createResourceRequest$5(config) {
|
|
986
|
+
const headers = {};
|
|
987
|
+
return {
|
|
988
|
+
baseUri: '/services/data/v60.0',
|
|
989
|
+
basePath: '/ssot/machine-learning/workspaces/' + config.urlParams.workspaceIdOrName + '/models',
|
|
990
|
+
method: 'get',
|
|
991
|
+
body: null,
|
|
992
|
+
urlParams: config.urlParams,
|
|
993
|
+
queryParams: {},
|
|
994
|
+
headers,
|
|
995
|
+
priority: 'normal',
|
|
996
|
+
};
|
|
997
|
+
}
|
|
998
|
+
|
|
999
|
+
const adapterName$5 = 'getCdpMlConfiguredModelCollection';
|
|
1000
|
+
const getCdpMlConfiguredModelCollection_ConfigPropertyMetadata = [
|
|
1001
|
+
generateParamConfigMetadata('workspaceIdOrName', true, 0 /* UrlParameter */, 0 /* String */),
|
|
1002
|
+
];
|
|
1003
|
+
const getCdpMlConfiguredModelCollection_ConfigPropertyNames = /*#__PURE__*/ buildAdapterValidationConfig(adapterName$5, getCdpMlConfiguredModelCollection_ConfigPropertyMetadata);
|
|
1004
|
+
const createResourceParams$5 = /*#__PURE__*/ createResourceParams$8(getCdpMlConfiguredModelCollection_ConfigPropertyMetadata);
|
|
1005
|
+
function keyBuilder$9(luvio, config) {
|
|
1006
|
+
const resourceParams = createResourceParams$5(config);
|
|
1007
|
+
return keyBuilder$a(luvio, resourceParams);
|
|
1008
|
+
}
|
|
1009
|
+
function typeCheckConfig$5(untrustedConfig) {
|
|
1010
|
+
const config = {};
|
|
1011
|
+
typeCheckConfig$8(untrustedConfig, config, getCdpMlConfiguredModelCollection_ConfigPropertyMetadata);
|
|
1012
|
+
return config;
|
|
1013
|
+
}
|
|
1014
|
+
function validateAdapterConfig$5(untrustedConfig, configPropertyNames) {
|
|
1015
|
+
if (!untrustedIsObject(untrustedConfig)) {
|
|
1016
|
+
return null;
|
|
1017
|
+
}
|
|
1018
|
+
if (process.env.NODE_ENV !== 'production') {
|
|
1019
|
+
validateConfig(untrustedConfig, configPropertyNames);
|
|
1020
|
+
}
|
|
1021
|
+
const config = typeCheckConfig$5(untrustedConfig);
|
|
1022
|
+
if (!areRequiredParametersPresent(config, configPropertyNames)) {
|
|
1023
|
+
return null;
|
|
1024
|
+
}
|
|
1025
|
+
return config;
|
|
1026
|
+
}
|
|
1027
|
+
function adapterFragment$4(luvio, config) {
|
|
1028
|
+
createResourceParams$5(config);
|
|
1029
|
+
return select$9();
|
|
1030
|
+
}
|
|
1031
|
+
function onFetchResponseSuccess$4(luvio, config, resourceParams, response) {
|
|
1032
|
+
const snapshot = ingestSuccess$5(luvio, resourceParams, response, {
|
|
1033
|
+
config,
|
|
1034
|
+
resolve: () => buildNetworkSnapshot$5(luvio, config, snapshotRefreshOptions)
|
|
1035
|
+
});
|
|
1036
|
+
return luvio.storeBroadcast().then(() => snapshot);
|
|
1037
|
+
}
|
|
1038
|
+
function onFetchResponseError$4(luvio, config, resourceParams, response) {
|
|
1039
|
+
const snapshot = ingestError$4(luvio, resourceParams, response, {
|
|
1040
|
+
config,
|
|
1041
|
+
resolve: () => buildNetworkSnapshot$5(luvio, config, snapshotRefreshOptions)
|
|
1042
|
+
});
|
|
1043
|
+
return luvio.storeBroadcast().then(() => snapshot);
|
|
1044
|
+
}
|
|
1045
|
+
function buildNetworkSnapshot$5(luvio, config, options) {
|
|
1046
|
+
const resourceParams = createResourceParams$5(config);
|
|
1047
|
+
const request = createResourceRequest$5(resourceParams);
|
|
1048
|
+
return luvio.dispatchResourceRequest(request, options)
|
|
1049
|
+
.then((response) => {
|
|
1050
|
+
return luvio.handleSuccessResponse(() => onFetchResponseSuccess$4(luvio, config, resourceParams, response), () => {
|
|
1051
|
+
const cache = new StoreKeyMap();
|
|
1052
|
+
getResponseCacheKeys$5(cache, luvio, resourceParams, response.body);
|
|
1053
|
+
return cache;
|
|
1054
|
+
});
|
|
1055
|
+
}, (response) => {
|
|
1056
|
+
return luvio.handleErrorResponse(() => onFetchResponseError$4(luvio, config, resourceParams, response));
|
|
1057
|
+
});
|
|
1058
|
+
}
|
|
1059
|
+
function buildNetworkSnapshotCachePolicy$4(context, coercedAdapterRequestContext) {
|
|
1060
|
+
return buildNetworkSnapshotCachePolicy$6(context, coercedAdapterRequestContext, buildNetworkSnapshot$5, undefined, false);
|
|
1061
|
+
}
|
|
1062
|
+
function buildCachedSnapshotCachePolicy$4(context, storeLookup) {
|
|
1063
|
+
const { luvio, config } = context;
|
|
1064
|
+
const selector = {
|
|
1065
|
+
recordId: keyBuilder$9(luvio, config),
|
|
1066
|
+
node: adapterFragment$4(luvio, config),
|
|
1067
|
+
variables: {},
|
|
1068
|
+
};
|
|
1069
|
+
const cacheSnapshot = storeLookup(selector, {
|
|
1070
|
+
config,
|
|
1071
|
+
resolve: () => buildNetworkSnapshot$5(luvio, config, snapshotRefreshOptions)
|
|
1072
|
+
});
|
|
1073
|
+
return cacheSnapshot;
|
|
1074
|
+
}
|
|
1075
|
+
const getCdpMlConfiguredModelCollectionAdapterFactory = (luvio) => function cdpMachineLearning__getCdpMlConfiguredModelCollection(untrustedConfig, requestContext) {
|
|
1076
|
+
const config = validateAdapterConfig$5(untrustedConfig, getCdpMlConfiguredModelCollection_ConfigPropertyNames);
|
|
1077
|
+
// Invalid or incomplete config
|
|
1078
|
+
if (config === null) {
|
|
1079
|
+
return null;
|
|
1080
|
+
}
|
|
1081
|
+
return luvio.applyCachePolicy((requestContext || {}), { config, luvio }, // BuildSnapshotContext
|
|
1082
|
+
buildCachedSnapshotCachePolicy$4, buildNetworkSnapshotCachePolicy$4);
|
|
1083
|
+
};
|
|
1084
|
+
|
|
1085
|
+
function validate$d(obj, path = 'CdpMlModelOutputFieldRepresentation') {
|
|
1086
|
+
const v_error = (() => {
|
|
1087
|
+
if (typeof obj !== 'object' || ArrayIsArray(obj) || obj === null) {
|
|
1088
|
+
return new TypeError('Expected "object" but received "' + typeof obj + '" (at "' + path + '")');
|
|
1089
|
+
}
|
|
1090
|
+
const obj_dataType = obj.dataType;
|
|
1091
|
+
const path_dataType = path + '.dataType';
|
|
1092
|
+
if (typeof obj_dataType !== 'string') {
|
|
1093
|
+
return new TypeError('Expected "string" but received "' + typeof obj_dataType + '" (at "' + path_dataType + '")');
|
|
1094
|
+
}
|
|
1095
|
+
const obj_position = obj.position;
|
|
1096
|
+
const path_position = path + '.position';
|
|
1097
|
+
if (typeof obj_position !== 'number' || (typeof obj_position === 'number' && Math.floor(obj_position) !== obj_position)) {
|
|
1098
|
+
return new TypeError('Expected "integer" but received "' + typeof obj_position + '" (at "' + path_position + '")');
|
|
1099
|
+
}
|
|
1100
|
+
})();
|
|
1101
|
+
return v_error === undefined ? null : v_error;
|
|
1102
|
+
}
|
|
1103
|
+
|
|
1104
|
+
function validate$c(obj, path = 'CdpMlModelParameterDefinitionBaseRepresentation') {
|
|
1105
|
+
const v_error = (() => {
|
|
1106
|
+
if (typeof obj !== 'object' || ArrayIsArray(obj) || obj === null) {
|
|
1107
|
+
return new TypeError('Expected "object" but received "' + typeof obj + '" (at "' + path + '")');
|
|
1108
|
+
}
|
|
1109
|
+
const obj_description = obj.description;
|
|
1110
|
+
const path_description = path + '.description';
|
|
1111
|
+
if (typeof obj_description !== 'string') {
|
|
1112
|
+
return new TypeError('Expected "string" but received "' + typeof obj_description + '" (at "' + path_description + '")');
|
|
1113
|
+
}
|
|
1114
|
+
const obj_parameterName = obj.parameterName;
|
|
1115
|
+
const path_parameterName = path + '.parameterName';
|
|
1116
|
+
if (typeof obj_parameterName !== 'string') {
|
|
1117
|
+
return new TypeError('Expected "string" but received "' + typeof obj_parameterName + '" (at "' + path_parameterName + '")');
|
|
1118
|
+
}
|
|
1119
|
+
const obj_type = obj.type;
|
|
1120
|
+
const path_type = path + '.type';
|
|
1121
|
+
if (typeof obj_type !== 'string') {
|
|
1122
|
+
return new TypeError('Expected "string" but received "' + typeof obj_type + '" (at "' + path_type + '")');
|
|
1123
|
+
}
|
|
1124
|
+
})();
|
|
1125
|
+
return v_error === undefined ? null : v_error;
|
|
1126
|
+
}
|
|
1127
|
+
|
|
1128
|
+
const TTL$3 = 1000;
|
|
1129
|
+
const VERSION$3 = "00d91a5e9670906e48ab7002bbc53044";
|
|
1130
|
+
function validate$b(obj, path = 'CdpMlModelArtifactBaseRepresentation') {
|
|
1131
|
+
const v_error = (() => {
|
|
1132
|
+
if (typeof obj !== 'object' || ArrayIsArray(obj) || obj === null) {
|
|
1133
|
+
return new TypeError('Expected "object" but received "' + typeof obj + '" (at "' + path + '")');
|
|
1134
|
+
}
|
|
1135
|
+
const obj_createdBy = obj.createdBy;
|
|
1136
|
+
const path_createdBy = path + '.createdBy';
|
|
1137
|
+
const referencepath_createdByValidationError = validate$i(obj_createdBy, path_createdBy);
|
|
1138
|
+
if (referencepath_createdByValidationError !== null) {
|
|
1139
|
+
let message = 'Object doesn\'t match CdpUserRepresentation (at "' + path_createdBy + '")\n';
|
|
1140
|
+
message += referencepath_createdByValidationError.message.split('\n').map((line) => '\t' + line).join('\n');
|
|
1141
|
+
return new TypeError(message);
|
|
1142
|
+
}
|
|
1143
|
+
const obj_createdDate = obj.createdDate;
|
|
1144
|
+
const path_createdDate = path + '.createdDate';
|
|
1145
|
+
if (typeof obj_createdDate !== 'string') {
|
|
1146
|
+
return new TypeError('Expected "string" but received "' + typeof obj_createdDate + '" (at "' + path_createdDate + '")');
|
|
1147
|
+
}
|
|
1148
|
+
const obj_description = obj.description;
|
|
1149
|
+
const path_description = path + '.description';
|
|
1150
|
+
if (typeof obj_description !== 'string') {
|
|
1151
|
+
return new TypeError('Expected "string" but received "' + typeof obj_description + '" (at "' + path_description + '")');
|
|
1152
|
+
}
|
|
1153
|
+
const obj_id = obj.id;
|
|
1154
|
+
const path_id = path + '.id';
|
|
1155
|
+
if (typeof obj_id !== 'string') {
|
|
1156
|
+
return new TypeError('Expected "string" but received "' + typeof obj_id + '" (at "' + path_id + '")');
|
|
1157
|
+
}
|
|
1158
|
+
const obj_inputFields = obj.inputFields;
|
|
1159
|
+
const path_inputFields = path + '.inputFields';
|
|
1160
|
+
if (!ArrayIsArray(obj_inputFields)) {
|
|
1161
|
+
return new TypeError('Expected "array" but received "' + typeof obj_inputFields + '" (at "' + path_inputFields + '")');
|
|
1162
|
+
}
|
|
1163
|
+
for (let i = 0; i < obj_inputFields.length; i++) {
|
|
1164
|
+
const obj_inputFields_item = obj_inputFields[i];
|
|
1165
|
+
const path_inputFields_item = path_inputFields + '[' + i + ']';
|
|
1166
|
+
const referencepath_inputFields_itemValidationError = validate$k(obj_inputFields_item, path_inputFields_item);
|
|
1167
|
+
if (referencepath_inputFields_itemValidationError !== null) {
|
|
1168
|
+
let message = 'Object doesn\'t match CdpMlModelInputFieldBaseRepresentation (at "' + path_inputFields_item + '")\n';
|
|
1169
|
+
message += referencepath_inputFields_itemValidationError.message.split('\n').map((line) => '\t' + line).join('\n');
|
|
1170
|
+
return new TypeError(message);
|
|
1171
|
+
}
|
|
1172
|
+
}
|
|
1173
|
+
const obj_label = obj.label;
|
|
1174
|
+
const path_label = path + '.label';
|
|
1175
|
+
if (typeof obj_label !== 'string') {
|
|
1176
|
+
return new TypeError('Expected "string" but received "' + typeof obj_label + '" (at "' + path_label + '")');
|
|
1177
|
+
}
|
|
1178
|
+
const obj_lastModifiedBy = obj.lastModifiedBy;
|
|
1179
|
+
const path_lastModifiedBy = path + '.lastModifiedBy';
|
|
1180
|
+
const referencepath_lastModifiedByValidationError = validate$i(obj_lastModifiedBy, path_lastModifiedBy);
|
|
1181
|
+
if (referencepath_lastModifiedByValidationError !== null) {
|
|
1182
|
+
let message = 'Object doesn\'t match CdpUserRepresentation (at "' + path_lastModifiedBy + '")\n';
|
|
1183
|
+
message += referencepath_lastModifiedByValidationError.message.split('\n').map((line) => '\t' + line).join('\n');
|
|
1184
|
+
return new TypeError(message);
|
|
1185
|
+
}
|
|
1186
|
+
const obj_lastModifiedDate = obj.lastModifiedDate;
|
|
1187
|
+
const path_lastModifiedDate = path + '.lastModifiedDate';
|
|
1188
|
+
if (typeof obj_lastModifiedDate !== 'string') {
|
|
1189
|
+
return new TypeError('Expected "string" but received "' + typeof obj_lastModifiedDate + '" (at "' + path_lastModifiedDate + '")');
|
|
1190
|
+
}
|
|
1191
|
+
const obj_modelType = obj.modelType;
|
|
1192
|
+
const path_modelType = path + '.modelType';
|
|
1193
|
+
if (typeof obj_modelType !== 'string') {
|
|
1194
|
+
return new TypeError('Expected "string" but received "' + typeof obj_modelType + '" (at "' + path_modelType + '")');
|
|
1195
|
+
}
|
|
1196
|
+
const obj_name = obj.name;
|
|
1197
|
+
const path_name = path + '.name';
|
|
1198
|
+
if (typeof obj_name !== 'string') {
|
|
1199
|
+
return new TypeError('Expected "string" but received "' + typeof obj_name + '" (at "' + path_name + '")');
|
|
1200
|
+
}
|
|
1201
|
+
const obj_namespace = obj.namespace;
|
|
1202
|
+
const path_namespace = path + '.namespace';
|
|
1203
|
+
if (typeof obj_namespace !== 'string') {
|
|
1204
|
+
return new TypeError('Expected "string" but received "' + typeof obj_namespace + '" (at "' + path_namespace + '")');
|
|
1205
|
+
}
|
|
1206
|
+
const obj_outputFields = obj.outputFields;
|
|
1207
|
+
const path_outputFields = path + '.outputFields';
|
|
1208
|
+
if (!ArrayIsArray(obj_outputFields)) {
|
|
1209
|
+
return new TypeError('Expected "array" but received "' + typeof obj_outputFields + '" (at "' + path_outputFields + '")');
|
|
1210
|
+
}
|
|
1211
|
+
for (let i = 0; i < obj_outputFields.length; i++) {
|
|
1212
|
+
const obj_outputFields_item = obj_outputFields[i];
|
|
1213
|
+
const path_outputFields_item = path_outputFields + '[' + i + ']';
|
|
1214
|
+
const referencepath_outputFields_itemValidationError = validate$d(obj_outputFields_item, path_outputFields_item);
|
|
1215
|
+
if (referencepath_outputFields_itemValidationError !== null) {
|
|
1216
|
+
let message = 'Object doesn\'t match CdpMlModelOutputFieldRepresentation (at "' + path_outputFields_item + '")\n';
|
|
1217
|
+
message += referencepath_outputFields_itemValidationError.message.split('\n').map((line) => '\t' + line).join('\n');
|
|
1218
|
+
return new TypeError(message);
|
|
1219
|
+
}
|
|
1220
|
+
}
|
|
1221
|
+
const obj_parameters = obj.parameters;
|
|
1222
|
+
const path_parameters = path + '.parameters';
|
|
1223
|
+
if (!ArrayIsArray(obj_parameters)) {
|
|
1224
|
+
return new TypeError('Expected "array" but received "' + typeof obj_parameters + '" (at "' + path_parameters + '")');
|
|
1225
|
+
}
|
|
1226
|
+
for (let i = 0; i < obj_parameters.length; i++) {
|
|
1227
|
+
const obj_parameters_item = obj_parameters[i];
|
|
1228
|
+
const path_parameters_item = path_parameters + '[' + i + ']';
|
|
1229
|
+
const referencepath_parameters_itemValidationError = validate$c(obj_parameters_item, path_parameters_item);
|
|
1230
|
+
if (referencepath_parameters_itemValidationError !== null) {
|
|
1231
|
+
let message = 'Object doesn\'t match CdpMlModelParameterDefinitionBaseRepresentation (at "' + path_parameters_item + '")\n';
|
|
1232
|
+
message += referencepath_parameters_itemValidationError.message.split('\n').map((line) => '\t' + line).join('\n');
|
|
1233
|
+
return new TypeError(message);
|
|
1234
|
+
}
|
|
1235
|
+
}
|
|
1236
|
+
const obj_runtimeType = obj.runtimeType;
|
|
1237
|
+
const path_runtimeType = path + '.runtimeType';
|
|
1238
|
+
if (typeof obj_runtimeType !== 'string') {
|
|
1239
|
+
return new TypeError('Expected "string" but received "' + typeof obj_runtimeType + '" (at "' + path_runtimeType + '")');
|
|
1240
|
+
}
|
|
1241
|
+
const obj_source = obj.source;
|
|
1242
|
+
const path_source = path + '.source';
|
|
1243
|
+
const referencepath_sourceValidationError = validate$h(obj_source, path_source);
|
|
1244
|
+
if (referencepath_sourceValidationError !== null) {
|
|
1245
|
+
let message = 'Object doesn\'t match CdpAssetReferenceRepresentation (at "' + path_source + '")\n';
|
|
1246
|
+
message += referencepath_sourceValidationError.message.split('\n').map((line) => '\t' + line).join('\n');
|
|
1247
|
+
return new TypeError(message);
|
|
1248
|
+
}
|
|
1249
|
+
const obj_sourceType = obj.sourceType;
|
|
1250
|
+
const path_sourceType = path + '.sourceType';
|
|
1251
|
+
if (typeof obj_sourceType !== 'string') {
|
|
1252
|
+
return new TypeError('Expected "string" but received "' + typeof obj_sourceType + '" (at "' + path_sourceType + '")');
|
|
1253
|
+
}
|
|
1254
|
+
const obj_url = obj.url;
|
|
1255
|
+
const path_url = path + '.url';
|
|
1256
|
+
if (typeof obj_url !== 'string') {
|
|
1257
|
+
return new TypeError('Expected "string" but received "' + typeof obj_url + '" (at "' + path_url + '")');
|
|
1258
|
+
}
|
|
1259
|
+
})();
|
|
1260
|
+
return v_error === undefined ? null : v_error;
|
|
1261
|
+
}
|
|
1262
|
+
const RepresentationType$3 = 'CdpMlModelArtifactBaseRepresentation';
|
|
1263
|
+
function normalize$3(input, existing, path, luvio, store, timestamp) {
|
|
1264
|
+
return input;
|
|
1265
|
+
}
|
|
1266
|
+
const select$8 = function CdpMlModelArtifactBaseRepresentationSelect() {
|
|
1267
|
+
return {
|
|
1268
|
+
kind: 'Fragment',
|
|
1269
|
+
version: VERSION$3,
|
|
1270
|
+
private: [],
|
|
1271
|
+
opaque: true
|
|
1272
|
+
};
|
|
1273
|
+
};
|
|
1274
|
+
function equals$3(existing, incoming) {
|
|
1275
|
+
if (JSONStringify(incoming) !== JSONStringify(existing)) {
|
|
1276
|
+
return false;
|
|
1277
|
+
}
|
|
1278
|
+
return true;
|
|
1279
|
+
}
|
|
1280
|
+
const ingest$3 = function CdpMlModelArtifactBaseRepresentationIngest(input, path, luvio, store, timestamp) {
|
|
1281
|
+
if (process.env.NODE_ENV !== 'production') {
|
|
1282
|
+
const validateError = validate$b(input);
|
|
1283
|
+
if (validateError !== null) {
|
|
1284
|
+
throw validateError;
|
|
1285
|
+
}
|
|
1286
|
+
}
|
|
1287
|
+
const key = path.fullPath;
|
|
1288
|
+
const ttlToUse = TTL$3;
|
|
1289
|
+
ingestShape(input, path, luvio, store, timestamp, ttlToUse, key, normalize$3, "cdp-machine-learning", VERSION$3, RepresentationType$3, equals$3);
|
|
1290
|
+
return createLink(key);
|
|
1291
|
+
};
|
|
1292
|
+
function getTypeCacheKeys$3(rootKeySet, luvio, input, fullPathFactory) {
|
|
1293
|
+
// root cache key (uses fullPathFactory if keyBuilderFromType isn't defined)
|
|
1294
|
+
const rootKey = fullPathFactory();
|
|
1295
|
+
rootKeySet.set(rootKey, {
|
|
1296
|
+
namespace: keyPrefix,
|
|
1297
|
+
representationName: RepresentationType$3,
|
|
1298
|
+
mergeable: false
|
|
1299
|
+
});
|
|
1300
|
+
}
|
|
1301
|
+
|
|
1302
|
+
function select$7(luvio, params) {
|
|
1303
|
+
return select$8();
|
|
1304
|
+
}
|
|
1305
|
+
function keyBuilder$8(luvio, params) {
|
|
1306
|
+
return keyPrefix + '::CdpMlModelArtifactBaseRepresentation:(' + 'modelArtifactIdOrName:' + params.urlParams.modelArtifactIdOrName + ')';
|
|
1307
|
+
}
|
|
1308
|
+
function getResponseCacheKeys$4(storeKeyMap, luvio, resourceParams, response) {
|
|
1309
|
+
getTypeCacheKeys$3(storeKeyMap, luvio, response, () => keyBuilder$8(luvio, resourceParams));
|
|
1310
|
+
}
|
|
1311
|
+
function ingestSuccess$4(luvio, resourceParams, response, snapshotRefresh) {
|
|
1312
|
+
const { body } = response;
|
|
1313
|
+
const key = keyBuilder$8(luvio, resourceParams);
|
|
1314
|
+
luvio.storeIngest(key, ingest$3, body);
|
|
1315
|
+
const snapshot = luvio.storeLookup({
|
|
1316
|
+
recordId: key,
|
|
1317
|
+
node: select$7(),
|
|
1318
|
+
variables: {},
|
|
1319
|
+
}, snapshotRefresh);
|
|
1320
|
+
if (process.env.NODE_ENV !== 'production') {
|
|
1321
|
+
if (snapshot.state !== 'Fulfilled') {
|
|
1322
|
+
throw new Error('Invalid network response. Expected resource response to result in Fulfilled snapshot');
|
|
1323
|
+
}
|
|
1324
|
+
}
|
|
1325
|
+
deepFreeze(snapshot.data);
|
|
1326
|
+
return snapshot;
|
|
1327
|
+
}
|
|
1328
|
+
function ingestError$3(luvio, params, error, snapshotRefresh) {
|
|
1329
|
+
const key = keyBuilder$8(luvio, params);
|
|
1330
|
+
const errorSnapshot = luvio.errorSnapshot(error, snapshotRefresh);
|
|
1331
|
+
const storeMetadataParams = {
|
|
1332
|
+
ttl: TTL$3,
|
|
1333
|
+
namespace: keyPrefix,
|
|
1334
|
+
version: VERSION$3,
|
|
1335
|
+
representationName: RepresentationType$3
|
|
1336
|
+
};
|
|
1337
|
+
luvio.storeIngestError(key, errorSnapshot, storeMetadataParams);
|
|
1338
|
+
return errorSnapshot;
|
|
1339
|
+
}
|
|
1340
|
+
function createResourceRequest$4(config) {
|
|
1341
|
+
const headers = {};
|
|
1342
|
+
return {
|
|
1343
|
+
baseUri: '/services/data/v60.0',
|
|
1344
|
+
basePath: '/ssot/machine-learning/model-artifacts/' + config.urlParams.modelArtifactIdOrName + '',
|
|
1345
|
+
method: 'get',
|
|
1346
|
+
body: null,
|
|
1347
|
+
urlParams: config.urlParams,
|
|
1348
|
+
queryParams: {},
|
|
1349
|
+
headers,
|
|
1350
|
+
priority: 'normal',
|
|
1351
|
+
};
|
|
1352
|
+
}
|
|
1353
|
+
|
|
1354
|
+
const adapterName$4 = 'getCdpMlModelArtifact';
|
|
1355
|
+
const getCdpMlModelArtifact_ConfigPropertyMetadata = [
|
|
1356
|
+
generateParamConfigMetadata('modelArtifactIdOrName', true, 0 /* UrlParameter */, 0 /* String */),
|
|
1357
|
+
];
|
|
1358
|
+
const getCdpMlModelArtifact_ConfigPropertyNames = /*#__PURE__*/ buildAdapterValidationConfig(adapterName$4, getCdpMlModelArtifact_ConfigPropertyMetadata);
|
|
1359
|
+
const createResourceParams$4 = /*#__PURE__*/ createResourceParams$8(getCdpMlModelArtifact_ConfigPropertyMetadata);
|
|
1360
|
+
function keyBuilder$7(luvio, config) {
|
|
1361
|
+
const resourceParams = createResourceParams$4(config);
|
|
1362
|
+
return keyBuilder$8(luvio, resourceParams);
|
|
1363
|
+
}
|
|
1364
|
+
function typeCheckConfig$4(untrustedConfig) {
|
|
1365
|
+
const config = {};
|
|
1366
|
+
typeCheckConfig$8(untrustedConfig, config, getCdpMlModelArtifact_ConfigPropertyMetadata);
|
|
1367
|
+
return config;
|
|
1368
|
+
}
|
|
1369
|
+
function validateAdapterConfig$4(untrustedConfig, configPropertyNames) {
|
|
1370
|
+
if (!untrustedIsObject(untrustedConfig)) {
|
|
1371
|
+
return null;
|
|
1372
|
+
}
|
|
1373
|
+
if (process.env.NODE_ENV !== 'production') {
|
|
1374
|
+
validateConfig(untrustedConfig, configPropertyNames);
|
|
1375
|
+
}
|
|
1376
|
+
const config = typeCheckConfig$4(untrustedConfig);
|
|
1377
|
+
if (!areRequiredParametersPresent(config, configPropertyNames)) {
|
|
1378
|
+
return null;
|
|
1379
|
+
}
|
|
1380
|
+
return config;
|
|
1381
|
+
}
|
|
1382
|
+
function adapterFragment$3(luvio, config) {
|
|
1383
|
+
createResourceParams$4(config);
|
|
1384
|
+
return select$7();
|
|
1385
|
+
}
|
|
1386
|
+
function onFetchResponseSuccess$3(luvio, config, resourceParams, response) {
|
|
1387
|
+
const snapshot = ingestSuccess$4(luvio, resourceParams, response, {
|
|
1388
|
+
config,
|
|
1389
|
+
resolve: () => buildNetworkSnapshot$4(luvio, config, snapshotRefreshOptions)
|
|
1390
|
+
});
|
|
1391
|
+
return luvio.storeBroadcast().then(() => snapshot);
|
|
1392
|
+
}
|
|
1393
|
+
function onFetchResponseError$3(luvio, config, resourceParams, response) {
|
|
1394
|
+
const snapshot = ingestError$3(luvio, resourceParams, response, {
|
|
1395
|
+
config,
|
|
1396
|
+
resolve: () => buildNetworkSnapshot$4(luvio, config, snapshotRefreshOptions)
|
|
1397
|
+
});
|
|
1398
|
+
return luvio.storeBroadcast().then(() => snapshot);
|
|
1399
|
+
}
|
|
1400
|
+
function buildNetworkSnapshot$4(luvio, config, options) {
|
|
1401
|
+
const resourceParams = createResourceParams$4(config);
|
|
1402
|
+
const request = createResourceRequest$4(resourceParams);
|
|
1403
|
+
return luvio.dispatchResourceRequest(request, options)
|
|
1404
|
+
.then((response) => {
|
|
1405
|
+
return luvio.handleSuccessResponse(() => onFetchResponseSuccess$3(luvio, config, resourceParams, response), () => {
|
|
1406
|
+
const cache = new StoreKeyMap();
|
|
1407
|
+
getResponseCacheKeys$4(cache, luvio, resourceParams, response.body);
|
|
1408
|
+
return cache;
|
|
1409
|
+
});
|
|
1410
|
+
}, (response) => {
|
|
1411
|
+
return luvio.handleErrorResponse(() => onFetchResponseError$3(luvio, config, resourceParams, response));
|
|
1412
|
+
});
|
|
1413
|
+
}
|
|
1414
|
+
function buildNetworkSnapshotCachePolicy$3(context, coercedAdapterRequestContext) {
|
|
1415
|
+
return buildNetworkSnapshotCachePolicy$6(context, coercedAdapterRequestContext, buildNetworkSnapshot$4, undefined, false);
|
|
1416
|
+
}
|
|
1417
|
+
function buildCachedSnapshotCachePolicy$3(context, storeLookup) {
|
|
1418
|
+
const { luvio, config } = context;
|
|
1419
|
+
const selector = {
|
|
1420
|
+
recordId: keyBuilder$7(luvio, config),
|
|
1421
|
+
node: adapterFragment$3(luvio, config),
|
|
1422
|
+
variables: {},
|
|
1423
|
+
};
|
|
1424
|
+
const cacheSnapshot = storeLookup(selector, {
|
|
1425
|
+
config,
|
|
1426
|
+
resolve: () => buildNetworkSnapshot$4(luvio, config, snapshotRefreshOptions)
|
|
1427
|
+
});
|
|
1428
|
+
return cacheSnapshot;
|
|
1429
|
+
}
|
|
1430
|
+
const getCdpMlModelArtifactAdapterFactory = (luvio) => function cdpMachineLearning__getCdpMlModelArtifact(untrustedConfig, requestContext) {
|
|
1431
|
+
const config = validateAdapterConfig$4(untrustedConfig, getCdpMlModelArtifact_ConfigPropertyNames);
|
|
1432
|
+
// Invalid or incomplete config
|
|
1433
|
+
if (config === null) {
|
|
1434
|
+
return null;
|
|
1435
|
+
}
|
|
1436
|
+
return luvio.applyCachePolicy((requestContext || {}), { config, luvio }, // BuildSnapshotContext
|
|
1437
|
+
buildCachedSnapshotCachePolicy$3, buildNetworkSnapshotCachePolicy$3);
|
|
1438
|
+
};
|
|
1439
|
+
|
|
1440
|
+
const TTL$2 = 1000;
|
|
1441
|
+
const VERSION$2 = "11ef38d7d5daa2448f4bcad3c1a85425";
|
|
1442
|
+
function validate$a(obj, path = 'CdpMlModelArtifactCollectionRepresentation') {
|
|
1443
|
+
const v_error = (() => {
|
|
1444
|
+
if (typeof obj !== 'object' || ArrayIsArray(obj) || obj === null) {
|
|
1445
|
+
return new TypeError('Expected "object" but received "' + typeof obj + '" (at "' + path + '")');
|
|
1446
|
+
}
|
|
1447
|
+
const obj_currentPageUrl = obj.currentPageUrl;
|
|
1448
|
+
const path_currentPageUrl = path + '.currentPageUrl';
|
|
1449
|
+
if (typeof obj_currentPageUrl !== 'string') {
|
|
1450
|
+
return new TypeError('Expected "string" but received "' + typeof obj_currentPageUrl + '" (at "' + path_currentPageUrl + '")');
|
|
1451
|
+
}
|
|
1452
|
+
const obj_modelArtifacts = obj.modelArtifacts;
|
|
1453
|
+
const path_modelArtifacts = path + '.modelArtifacts';
|
|
1454
|
+
if (!ArrayIsArray(obj_modelArtifacts)) {
|
|
1455
|
+
return new TypeError('Expected "array" but received "' + typeof obj_modelArtifacts + '" (at "' + path_modelArtifacts + '")');
|
|
1456
|
+
}
|
|
1457
|
+
for (let i = 0; i < obj_modelArtifacts.length; i++) {
|
|
1458
|
+
const obj_modelArtifacts_item = obj_modelArtifacts[i];
|
|
1459
|
+
const path_modelArtifacts_item = path_modelArtifacts + '[' + i + ']';
|
|
1460
|
+
const referencepath_modelArtifacts_itemValidationError = validate$b(obj_modelArtifacts_item, path_modelArtifacts_item);
|
|
1461
|
+
if (referencepath_modelArtifacts_itemValidationError !== null) {
|
|
1462
|
+
let message = 'Object doesn\'t match CdpMlModelArtifactBaseRepresentation (at "' + path_modelArtifacts_item + '")\n';
|
|
1463
|
+
message += referencepath_modelArtifacts_itemValidationError.message.split('\n').map((line) => '\t' + line).join('\n');
|
|
1464
|
+
return new TypeError(message);
|
|
1465
|
+
}
|
|
1466
|
+
}
|
|
1467
|
+
const obj_nextPageUrl = obj.nextPageUrl;
|
|
1468
|
+
const path_nextPageUrl = path + '.nextPageUrl';
|
|
1469
|
+
if (typeof obj_nextPageUrl !== 'string') {
|
|
1470
|
+
return new TypeError('Expected "string" but received "' + typeof obj_nextPageUrl + '" (at "' + path_nextPageUrl + '")');
|
|
1471
|
+
}
|
|
1472
|
+
const obj_totalSize = obj.totalSize;
|
|
1473
|
+
const path_totalSize = path + '.totalSize';
|
|
1474
|
+
if (typeof obj_totalSize !== 'number' || (typeof obj_totalSize === 'number' && Math.floor(obj_totalSize) !== obj_totalSize)) {
|
|
1475
|
+
return new TypeError('Expected "integer" but received "' + typeof obj_totalSize + '" (at "' + path_totalSize + '")');
|
|
1476
|
+
}
|
|
1477
|
+
})();
|
|
1478
|
+
return v_error === undefined ? null : v_error;
|
|
1479
|
+
}
|
|
1480
|
+
const RepresentationType$2 = 'CdpMlModelArtifactCollectionRepresentation';
|
|
1481
|
+
function normalize$2(input, existing, path, luvio, store, timestamp) {
|
|
1482
|
+
return input;
|
|
1483
|
+
}
|
|
1484
|
+
const select$6 = function CdpMlModelArtifactCollectionRepresentationSelect() {
|
|
1485
|
+
return {
|
|
1486
|
+
kind: 'Fragment',
|
|
1487
|
+
version: VERSION$2,
|
|
1488
|
+
private: [],
|
|
1489
|
+
opaque: true
|
|
1490
|
+
};
|
|
1491
|
+
};
|
|
1492
|
+
function equals$2(existing, incoming) {
|
|
1493
|
+
if (JSONStringify(incoming) !== JSONStringify(existing)) {
|
|
1494
|
+
return false;
|
|
1495
|
+
}
|
|
1496
|
+
return true;
|
|
1497
|
+
}
|
|
1498
|
+
const ingest$2 = function CdpMlModelArtifactCollectionRepresentationIngest(input, path, luvio, store, timestamp) {
|
|
1499
|
+
if (process.env.NODE_ENV !== 'production') {
|
|
1500
|
+
const validateError = validate$a(input);
|
|
1501
|
+
if (validateError !== null) {
|
|
1502
|
+
throw validateError;
|
|
1503
|
+
}
|
|
1504
|
+
}
|
|
1505
|
+
const key = path.fullPath;
|
|
1506
|
+
const ttlToUse = TTL$2;
|
|
1507
|
+
ingestShape(input, path, luvio, store, timestamp, ttlToUse, key, normalize$2, "cdp-machine-learning", VERSION$2, RepresentationType$2, equals$2);
|
|
1508
|
+
return createLink(key);
|
|
1509
|
+
};
|
|
1510
|
+
function getTypeCacheKeys$2(rootKeySet, luvio, input, fullPathFactory) {
|
|
1511
|
+
// root cache key (uses fullPathFactory if keyBuilderFromType isn't defined)
|
|
1512
|
+
const rootKey = fullPathFactory();
|
|
1513
|
+
rootKeySet.set(rootKey, {
|
|
1514
|
+
namespace: keyPrefix,
|
|
1515
|
+
representationName: RepresentationType$2,
|
|
1516
|
+
mergeable: false
|
|
1517
|
+
});
|
|
1518
|
+
}
|
|
1519
|
+
|
|
1520
|
+
function select$5(luvio, params) {
|
|
1521
|
+
return select$6();
|
|
1522
|
+
}
|
|
1523
|
+
function keyBuilder$6(luvio, params) {
|
|
1524
|
+
return keyPrefix + '::CdpMlModelArtifactCollectionRepresentation:(' + 'limit:' + params.queryParams.limit + ',' + 'modelType:' + params.queryParams.modelType + ',' + 'offset:' + params.queryParams.offset + ',' + 'sourceType:' + params.queryParams.sourceType + ')';
|
|
1525
|
+
}
|
|
1526
|
+
function getResponseCacheKeys$3(storeKeyMap, luvio, resourceParams, response) {
|
|
1527
|
+
getTypeCacheKeys$2(storeKeyMap, luvio, response, () => keyBuilder$6(luvio, resourceParams));
|
|
1528
|
+
}
|
|
1529
|
+
function ingestSuccess$3(luvio, resourceParams, response, snapshotRefresh) {
|
|
1530
|
+
const { body } = response;
|
|
1531
|
+
const key = keyBuilder$6(luvio, resourceParams);
|
|
1532
|
+
luvio.storeIngest(key, ingest$2, body);
|
|
1533
|
+
const snapshot = luvio.storeLookup({
|
|
1534
|
+
recordId: key,
|
|
1535
|
+
node: select$5(),
|
|
1536
|
+
variables: {},
|
|
1537
|
+
}, snapshotRefresh);
|
|
1538
|
+
if (process.env.NODE_ENV !== 'production') {
|
|
1539
|
+
if (snapshot.state !== 'Fulfilled') {
|
|
1540
|
+
throw new Error('Invalid network response. Expected resource response to result in Fulfilled snapshot');
|
|
1541
|
+
}
|
|
1542
|
+
}
|
|
1543
|
+
deepFreeze(snapshot.data);
|
|
1544
|
+
return snapshot;
|
|
1545
|
+
}
|
|
1546
|
+
function ingestError$2(luvio, params, error, snapshotRefresh) {
|
|
1547
|
+
const key = keyBuilder$6(luvio, params);
|
|
1548
|
+
const errorSnapshot = luvio.errorSnapshot(error, snapshotRefresh);
|
|
1549
|
+
const storeMetadataParams = {
|
|
1550
|
+
ttl: TTL$2,
|
|
1551
|
+
namespace: keyPrefix,
|
|
1552
|
+
version: VERSION$2,
|
|
1553
|
+
representationName: RepresentationType$2
|
|
1554
|
+
};
|
|
1555
|
+
luvio.storeIngestError(key, errorSnapshot, storeMetadataParams);
|
|
1556
|
+
return errorSnapshot;
|
|
1557
|
+
}
|
|
1558
|
+
function createResourceRequest$3(config) {
|
|
1559
|
+
const headers = {};
|
|
1560
|
+
return {
|
|
1561
|
+
baseUri: '/services/data/v60.0',
|
|
1562
|
+
basePath: '/ssot/machine-learning/model-artifacts',
|
|
1563
|
+
method: 'get',
|
|
1564
|
+
body: null,
|
|
1565
|
+
urlParams: {},
|
|
1566
|
+
queryParams: config.queryParams,
|
|
1567
|
+
headers,
|
|
1568
|
+
priority: 'normal',
|
|
1569
|
+
};
|
|
1570
|
+
}
|
|
1571
|
+
|
|
1572
|
+
const adapterName$3 = 'getCdpMlModelArtifactCollection';
|
|
1573
|
+
const getCdpMlModelArtifactCollection_ConfigPropertyMetadata = [
|
|
1574
|
+
generateParamConfigMetadata('limit', false, 1 /* QueryParameter */, 3 /* Integer */),
|
|
1575
|
+
generateParamConfigMetadata('modelType', false, 1 /* QueryParameter */, 0 /* String */),
|
|
1576
|
+
generateParamConfigMetadata('offset', false, 1 /* QueryParameter */, 3 /* Integer */),
|
|
1577
|
+
generateParamConfigMetadata('sourceType', false, 1 /* QueryParameter */, 0 /* String */),
|
|
1578
|
+
];
|
|
1579
|
+
const getCdpMlModelArtifactCollection_ConfigPropertyNames = /*#__PURE__*/ buildAdapterValidationConfig(adapterName$3, getCdpMlModelArtifactCollection_ConfigPropertyMetadata);
|
|
1580
|
+
const createResourceParams$3 = /*#__PURE__*/ createResourceParams$8(getCdpMlModelArtifactCollection_ConfigPropertyMetadata);
|
|
1581
|
+
function keyBuilder$5(luvio, config) {
|
|
1582
|
+
const resourceParams = createResourceParams$3(config);
|
|
1583
|
+
return keyBuilder$6(luvio, resourceParams);
|
|
1584
|
+
}
|
|
1585
|
+
function typeCheckConfig$3(untrustedConfig) {
|
|
1586
|
+
const config = {};
|
|
1587
|
+
typeCheckConfig$8(untrustedConfig, config, getCdpMlModelArtifactCollection_ConfigPropertyMetadata);
|
|
1588
|
+
return config;
|
|
1589
|
+
}
|
|
1590
|
+
function validateAdapterConfig$3(untrustedConfig, configPropertyNames) {
|
|
1591
|
+
if (!untrustedIsObject(untrustedConfig)) {
|
|
1592
|
+
return null;
|
|
1593
|
+
}
|
|
1594
|
+
if (process.env.NODE_ENV !== 'production') {
|
|
1595
|
+
validateConfig(untrustedConfig, configPropertyNames);
|
|
1596
|
+
}
|
|
1597
|
+
const config = typeCheckConfig$3(untrustedConfig);
|
|
1598
|
+
if (!areRequiredParametersPresent(config, configPropertyNames)) {
|
|
1599
|
+
return null;
|
|
1600
|
+
}
|
|
1601
|
+
return config;
|
|
1602
|
+
}
|
|
1603
|
+
function adapterFragment$2(luvio, config) {
|
|
1604
|
+
createResourceParams$3(config);
|
|
1605
|
+
return select$5();
|
|
1606
|
+
}
|
|
1607
|
+
function onFetchResponseSuccess$2(luvio, config, resourceParams, response) {
|
|
1608
|
+
const snapshot = ingestSuccess$3(luvio, resourceParams, response, {
|
|
1609
|
+
config,
|
|
1610
|
+
resolve: () => buildNetworkSnapshot$3(luvio, config, snapshotRefreshOptions)
|
|
1611
|
+
});
|
|
1612
|
+
return luvio.storeBroadcast().then(() => snapshot);
|
|
1613
|
+
}
|
|
1614
|
+
function onFetchResponseError$2(luvio, config, resourceParams, response) {
|
|
1615
|
+
const snapshot = ingestError$2(luvio, resourceParams, response, {
|
|
1616
|
+
config,
|
|
1617
|
+
resolve: () => buildNetworkSnapshot$3(luvio, config, snapshotRefreshOptions)
|
|
1618
|
+
});
|
|
1619
|
+
return luvio.storeBroadcast().then(() => snapshot);
|
|
1620
|
+
}
|
|
1621
|
+
function buildNetworkSnapshot$3(luvio, config, options) {
|
|
1622
|
+
const resourceParams = createResourceParams$3(config);
|
|
1623
|
+
const request = createResourceRequest$3(resourceParams);
|
|
1624
|
+
return luvio.dispatchResourceRequest(request, options)
|
|
1625
|
+
.then((response) => {
|
|
1626
|
+
return luvio.handleSuccessResponse(() => onFetchResponseSuccess$2(luvio, config, resourceParams, response), () => {
|
|
1627
|
+
const cache = new StoreKeyMap();
|
|
1628
|
+
getResponseCacheKeys$3(cache, luvio, resourceParams, response.body);
|
|
1629
|
+
return cache;
|
|
1630
|
+
});
|
|
1631
|
+
}, (response) => {
|
|
1632
|
+
return luvio.handleErrorResponse(() => onFetchResponseError$2(luvio, config, resourceParams, response));
|
|
1633
|
+
});
|
|
1634
|
+
}
|
|
1635
|
+
function buildNetworkSnapshotCachePolicy$2(context, coercedAdapterRequestContext) {
|
|
1636
|
+
return buildNetworkSnapshotCachePolicy$6(context, coercedAdapterRequestContext, buildNetworkSnapshot$3, undefined, false);
|
|
1637
|
+
}
|
|
1638
|
+
function buildCachedSnapshotCachePolicy$2(context, storeLookup) {
|
|
1639
|
+
const { luvio, config } = context;
|
|
1640
|
+
const selector = {
|
|
1641
|
+
recordId: keyBuilder$5(luvio, config),
|
|
1642
|
+
node: adapterFragment$2(luvio, config),
|
|
1643
|
+
variables: {},
|
|
1644
|
+
};
|
|
1645
|
+
const cacheSnapshot = storeLookup(selector, {
|
|
1646
|
+
config,
|
|
1647
|
+
resolve: () => buildNetworkSnapshot$3(luvio, config, snapshotRefreshOptions)
|
|
1648
|
+
});
|
|
1649
|
+
return cacheSnapshot;
|
|
1650
|
+
}
|
|
1651
|
+
const getCdpMlModelArtifactCollectionAdapterFactory = (luvio) => function cdpMachineLearning__getCdpMlModelArtifactCollection(untrustedConfig, requestContext) {
|
|
1652
|
+
const config = validateAdapterConfig$3(untrustedConfig, getCdpMlModelArtifactCollection_ConfigPropertyNames);
|
|
1653
|
+
// Invalid or incomplete config
|
|
1654
|
+
if (config === null) {
|
|
1655
|
+
return null;
|
|
1656
|
+
}
|
|
1657
|
+
return luvio.applyCachePolicy((requestContext || {}), { config, luvio }, // BuildSnapshotContext
|
|
1658
|
+
buildCachedSnapshotCachePolicy$2, buildNetworkSnapshotCachePolicy$2);
|
|
1659
|
+
};
|
|
1660
|
+
|
|
1661
|
+
function validate$9(obj, path = 'CdpMlModelTypeRepresentation') {
|
|
1662
|
+
const v_error = (() => {
|
|
1663
|
+
if (typeof obj !== 'object' || ArrayIsArray(obj) || obj === null) {
|
|
1664
|
+
return new TypeError('Expected "object" but received "' + typeof obj + '" (at "' + path + '")');
|
|
1665
|
+
}
|
|
1666
|
+
const obj_connectorType = obj.connectorType;
|
|
1667
|
+
const path_connectorType = path + '.connectorType';
|
|
1668
|
+
if (typeof obj_connectorType !== 'string') {
|
|
1669
|
+
return new TypeError('Expected "string" but received "' + typeof obj_connectorType + '" (at "' + path_connectorType + '")');
|
|
1670
|
+
}
|
|
1671
|
+
const obj_modelType = obj.modelType;
|
|
1672
|
+
const path_modelType = path + '.modelType';
|
|
1673
|
+
if (typeof obj_modelType !== 'string') {
|
|
1674
|
+
return new TypeError('Expected "string" but received "' + typeof obj_modelType + '" (at "' + path_modelType + '")');
|
|
1675
|
+
}
|
|
1676
|
+
const obj_sourceType = obj.sourceType;
|
|
1677
|
+
const path_sourceType = path + '.sourceType';
|
|
1678
|
+
if (typeof obj_sourceType !== 'string') {
|
|
1679
|
+
return new TypeError('Expected "string" but received "' + typeof obj_sourceType + '" (at "' + path_sourceType + '")');
|
|
1680
|
+
}
|
|
1681
|
+
})();
|
|
1682
|
+
return v_error === undefined ? null : v_error;
|
|
1683
|
+
}
|
|
1684
|
+
|
|
1685
|
+
function validate$8(obj, path = 'CdpMlModelOutcomeDefinitionRepresentation') {
|
|
1686
|
+
const v_error = (() => {
|
|
1687
|
+
if (typeof obj !== 'object' || ArrayIsArray(obj) || obj === null) {
|
|
1688
|
+
return new TypeError('Expected "object" but received "' + typeof obj + '" (at "' + path + '")');
|
|
1689
|
+
}
|
|
1690
|
+
const obj_fields = obj.fields;
|
|
1691
|
+
const path_fields = path + '.fields';
|
|
1692
|
+
if (!ArrayIsArray(obj_fields)) {
|
|
1693
|
+
return new TypeError('Expected "array" but received "' + typeof obj_fields + '" (at "' + path_fields + '")');
|
|
1694
|
+
}
|
|
1695
|
+
for (let i = 0; i < obj_fields.length; i++) {
|
|
1696
|
+
const obj_fields_item = obj_fields[i];
|
|
1697
|
+
const path_fields_item = path_fields + '[' + i + ']';
|
|
1698
|
+
const referencepath_fields_itemValidationError = validate$d(obj_fields_item, path_fields_item);
|
|
1699
|
+
if (referencepath_fields_itemValidationError !== null) {
|
|
1700
|
+
let message = 'Object doesn\'t match CdpMlModelOutputFieldRepresentation (at "' + path_fields_item + '")\n';
|
|
1701
|
+
message += referencepath_fields_itemValidationError.message.split('\n').map((line) => '\t' + line).join('\n');
|
|
1702
|
+
return new TypeError(message);
|
|
1703
|
+
}
|
|
1704
|
+
}
|
|
1705
|
+
const obj_goal = obj.goal;
|
|
1706
|
+
const path_goal = path + '.goal';
|
|
1707
|
+
if (typeof obj_goal !== 'string') {
|
|
1708
|
+
return new TypeError('Expected "string" but received "' + typeof obj_goal + '" (at "' + path_goal + '")');
|
|
1709
|
+
}
|
|
1710
|
+
})();
|
|
1711
|
+
return v_error === undefined ? null : v_error;
|
|
1712
|
+
}
|
|
1713
|
+
|
|
1714
|
+
function validate$7(obj, path = 'CdpMlModelRefreshRecipientRepresentation') {
|
|
1715
|
+
const v_error = (() => {
|
|
1716
|
+
if (typeof obj !== 'object' || ArrayIsArray(obj) || obj === null) {
|
|
1717
|
+
return new TypeError('Expected "object" but received "' + typeof obj + '" (at "' + path + '")');
|
|
1718
|
+
}
|
|
1719
|
+
const obj_displayName = obj.displayName;
|
|
1720
|
+
const path_displayName = path + '.displayName';
|
|
1721
|
+
if (typeof obj_displayName !== 'string') {
|
|
1722
|
+
return new TypeError('Expected "string" but received "' + typeof obj_displayName + '" (at "' + path_displayName + '")');
|
|
1723
|
+
}
|
|
1724
|
+
const obj_id = obj.id;
|
|
1725
|
+
const path_id = path + '.id';
|
|
1726
|
+
if (typeof obj_id !== 'string') {
|
|
1727
|
+
return new TypeError('Expected "string" but received "' + typeof obj_id + '" (at "' + path_id + '")');
|
|
1728
|
+
}
|
|
1729
|
+
const obj_type = obj.type;
|
|
1730
|
+
const path_type = path + '.type';
|
|
1731
|
+
if (typeof obj_type !== 'string') {
|
|
1732
|
+
return new TypeError('Expected "string" but received "' + typeof obj_type + '" (at "' + path_type + '")');
|
|
1733
|
+
}
|
|
1734
|
+
})();
|
|
1735
|
+
return v_error === undefined ? null : v_error;
|
|
1736
|
+
}
|
|
1737
|
+
|
|
1738
|
+
function validate$6(obj, path = 'CdpTimeZoneRepresentation') {
|
|
1739
|
+
const v_error = (() => {
|
|
1740
|
+
if (typeof obj !== 'object' || ArrayIsArray(obj) || obj === null) {
|
|
1741
|
+
return new TypeError('Expected "object" but received "' + typeof obj + '" (at "' + path + '")');
|
|
1742
|
+
}
|
|
1743
|
+
obj.gmtOffset;
|
|
1744
|
+
const obj_name = obj.name;
|
|
1745
|
+
const path_name = path + '.name';
|
|
1746
|
+
if (typeof obj_name !== 'string') {
|
|
1747
|
+
return new TypeError('Expected "string" but received "' + typeof obj_name + '" (at "' + path_name + '")');
|
|
1748
|
+
}
|
|
1749
|
+
const obj_zoneId = obj.zoneId;
|
|
1750
|
+
const path_zoneId = path + '.zoneId';
|
|
1751
|
+
if (typeof obj_zoneId !== 'string') {
|
|
1752
|
+
return new TypeError('Expected "string" but received "' + typeof obj_zoneId + '" (at "' + path_zoneId + '")');
|
|
1753
|
+
}
|
|
1754
|
+
})();
|
|
1755
|
+
return v_error === undefined ? null : v_error;
|
|
1756
|
+
}
|
|
1757
|
+
|
|
1758
|
+
function validate$5(obj, path = 'CdpTimeRepresentation') {
|
|
1759
|
+
const v_error = (() => {
|
|
1760
|
+
if (typeof obj !== 'object' || ArrayIsArray(obj) || obj === null) {
|
|
1761
|
+
return new TypeError('Expected "object" but received "' + typeof obj + '" (at "' + path + '")');
|
|
1762
|
+
}
|
|
1763
|
+
const obj_hour = obj.hour;
|
|
1764
|
+
const path_hour = path + '.hour';
|
|
1765
|
+
if (typeof obj_hour !== 'number' || (typeof obj_hour === 'number' && Math.floor(obj_hour) !== obj_hour)) {
|
|
1766
|
+
return new TypeError('Expected "integer" but received "' + typeof obj_hour + '" (at "' + path_hour + '")');
|
|
1767
|
+
}
|
|
1768
|
+
const obj_minute = obj.minute;
|
|
1769
|
+
const path_minute = path + '.minute';
|
|
1770
|
+
if (typeof obj_minute !== 'number' || (typeof obj_minute === 'number' && Math.floor(obj_minute) !== obj_minute)) {
|
|
1771
|
+
return new TypeError('Expected "integer" but received "' + typeof obj_minute + '" (at "' + path_minute + '")');
|
|
1772
|
+
}
|
|
1773
|
+
const obj_timezone = obj.timezone;
|
|
1774
|
+
const path_timezone = path + '.timezone';
|
|
1775
|
+
const referencepath_timezoneValidationError = validate$6(obj_timezone, path_timezone);
|
|
1776
|
+
if (referencepath_timezoneValidationError !== null) {
|
|
1777
|
+
let message = 'Object doesn\'t match CdpTimeZoneRepresentation (at "' + path_timezone + '")\n';
|
|
1778
|
+
message += referencepath_timezoneValidationError.message.split('\n').map((line) => '\t' + line).join('\n');
|
|
1779
|
+
return new TypeError(message);
|
|
1780
|
+
}
|
|
1781
|
+
})();
|
|
1782
|
+
return v_error === undefined ? null : v_error;
|
|
1783
|
+
}
|
|
1784
|
+
|
|
1785
|
+
function validate$4(obj, path = 'CdpScheduleRepresentation') {
|
|
1786
|
+
const v_error = (() => {
|
|
1787
|
+
if (typeof obj !== 'object' || ArrayIsArray(obj) || obj === null) {
|
|
1788
|
+
return new TypeError('Expected "object" but received "' + typeof obj + '" (at "' + path + '")');
|
|
1789
|
+
}
|
|
1790
|
+
const obj_frequency = obj.frequency;
|
|
1791
|
+
const path_frequency = path + '.frequency';
|
|
1792
|
+
if (typeof obj_frequency !== 'string') {
|
|
1793
|
+
return new TypeError('Expected "string" but received "' + typeof obj_frequency + '" (at "' + path_frequency + '")');
|
|
1794
|
+
}
|
|
1795
|
+
const obj_nextScheduledDate = obj.nextScheduledDate;
|
|
1796
|
+
const path_nextScheduledDate = path + '.nextScheduledDate';
|
|
1797
|
+
if (typeof obj_nextScheduledDate !== 'string') {
|
|
1798
|
+
return new TypeError('Expected "string" but received "' + typeof obj_nextScheduledDate + '" (at "' + path_nextScheduledDate + '")');
|
|
1799
|
+
}
|
|
1800
|
+
const obj_time = obj.time;
|
|
1801
|
+
const path_time = path + '.time';
|
|
1802
|
+
const referencepath_timeValidationError = validate$5(obj_time, path_time);
|
|
1803
|
+
if (referencepath_timeValidationError !== null) {
|
|
1804
|
+
let message = 'Object doesn\'t match CdpTimeRepresentation (at "' + path_time + '")\n';
|
|
1805
|
+
message += referencepath_timeValidationError.message.split('\n').map((line) => '\t' + line).join('\n');
|
|
1806
|
+
return new TypeError(message);
|
|
1807
|
+
}
|
|
1808
|
+
})();
|
|
1809
|
+
return v_error === undefined ? null : v_error;
|
|
1810
|
+
}
|
|
1811
|
+
|
|
1812
|
+
function validate$3(obj, path = 'CdpMlModelRefreshConfigRepresentation') {
|
|
1813
|
+
const v_error = (() => {
|
|
1814
|
+
if (typeof obj !== 'object' || ArrayIsArray(obj) || obj === null) {
|
|
1815
|
+
return new TypeError('Expected "object" but received "' + typeof obj + '" (at "' + path + '")');
|
|
1816
|
+
}
|
|
1817
|
+
const obj_isEnabled = obj.isEnabled;
|
|
1818
|
+
const path_isEnabled = path + '.isEnabled';
|
|
1819
|
+
if (typeof obj_isEnabled !== 'boolean') {
|
|
1820
|
+
return new TypeError('Expected "boolean" but received "' + typeof obj_isEnabled + '" (at "' + path_isEnabled + '")');
|
|
1821
|
+
}
|
|
1822
|
+
const obj_recipients = obj.recipients;
|
|
1823
|
+
const path_recipients = path + '.recipients';
|
|
1824
|
+
if (!ArrayIsArray(obj_recipients)) {
|
|
1825
|
+
return new TypeError('Expected "array" but received "' + typeof obj_recipients + '" (at "' + path_recipients + '")');
|
|
1826
|
+
}
|
|
1827
|
+
for (let i = 0; i < obj_recipients.length; i++) {
|
|
1828
|
+
const obj_recipients_item = obj_recipients[i];
|
|
1829
|
+
const path_recipients_item = path_recipients + '[' + i + ']';
|
|
1830
|
+
const referencepath_recipients_itemValidationError = validate$7(obj_recipients_item, path_recipients_item);
|
|
1831
|
+
if (referencepath_recipients_itemValidationError !== null) {
|
|
1832
|
+
let message = 'Object doesn\'t match CdpMlModelRefreshRecipientRepresentation (at "' + path_recipients_item + '")\n';
|
|
1833
|
+
message += referencepath_recipients_itemValidationError.message.split('\n').map((line) => '\t' + line).join('\n');
|
|
1834
|
+
return new TypeError(message);
|
|
1835
|
+
}
|
|
1836
|
+
}
|
|
1837
|
+
const obj_schedule = obj.schedule;
|
|
1838
|
+
const path_schedule = path + '.schedule';
|
|
1839
|
+
const referencepath_scheduleValidationError = validate$4(obj_schedule, path_schedule);
|
|
1840
|
+
if (referencepath_scheduleValidationError !== null) {
|
|
1841
|
+
let message = 'Object doesn\'t match CdpScheduleRepresentation (at "' + path_schedule + '")\n';
|
|
1842
|
+
message += referencepath_scheduleValidationError.message.split('\n').map((line) => '\t' + line).join('\n');
|
|
1843
|
+
return new TypeError(message);
|
|
1844
|
+
}
|
|
1845
|
+
})();
|
|
1846
|
+
return v_error === undefined ? null : v_error;
|
|
1847
|
+
}
|
|
1848
|
+
|
|
1849
|
+
const TTL$1 = 1000;
|
|
1850
|
+
const VERSION$1 = "b700ad4033c4cc1a2f1373d916e31c4d";
|
|
1851
|
+
function validate$2(obj, path = 'CdpMlWorkspaceDetailRepresentation') {
|
|
1852
|
+
const v_error = (() => {
|
|
1853
|
+
if (typeof obj !== 'object' || ArrayIsArray(obj) || obj === null) {
|
|
1854
|
+
return new TypeError('Expected "object" but received "' + typeof obj + '" (at "' + path + '")');
|
|
1855
|
+
}
|
|
1856
|
+
const obj_activations = obj.activations;
|
|
1857
|
+
const path_activations = path + '.activations';
|
|
1858
|
+
if (!ArrayIsArray(obj_activations)) {
|
|
1859
|
+
return new TypeError('Expected "array" but received "' + typeof obj_activations + '" (at "' + path_activations + '")');
|
|
1860
|
+
}
|
|
1861
|
+
for (let i = 0; i < obj_activations.length; i++) {
|
|
1862
|
+
const obj_activations_item = obj_activations[i];
|
|
1863
|
+
const path_activations_item = path_activations + '[' + i + ']';
|
|
1864
|
+
if (typeof obj_activations_item !== 'string') {
|
|
1865
|
+
return new TypeError('Expected "string" but received "' + typeof obj_activations_item + '" (at "' + path_activations_item + '")');
|
|
1866
|
+
}
|
|
1867
|
+
}
|
|
1868
|
+
const obj_activeSetup = obj.activeSetup;
|
|
1869
|
+
const path_activeSetup = path + '.activeSetup';
|
|
1870
|
+
const referencepath_activeSetupValidationError = validate$h(obj_activeSetup, path_activeSetup);
|
|
1871
|
+
if (referencepath_activeSetupValidationError !== null) {
|
|
1872
|
+
let message = 'Object doesn\'t match CdpAssetReferenceRepresentation (at "' + path_activeSetup + '")\n';
|
|
1873
|
+
message += referencepath_activeSetupValidationError.message.split('\n').map((line) => '\t' + line).join('\n');
|
|
1874
|
+
return new TypeError(message);
|
|
1875
|
+
}
|
|
1876
|
+
const obj_activeSetupVersionNumber = obj.activeSetupVersionNumber;
|
|
1877
|
+
const path_activeSetupVersionNumber = path + '.activeSetupVersionNumber';
|
|
1878
|
+
if (typeof obj_activeSetupVersionNumber !== 'number' || (typeof obj_activeSetupVersionNumber === 'number' && Math.floor(obj_activeSetupVersionNumber) !== obj_activeSetupVersionNumber)) {
|
|
1879
|
+
return new TypeError('Expected "integer" but received "' + typeof obj_activeSetupVersionNumber + '" (at "' + path_activeSetupVersionNumber + '")');
|
|
1880
|
+
}
|
|
1881
|
+
const obj_createdBy = obj.createdBy;
|
|
1882
|
+
const path_createdBy = path + '.createdBy';
|
|
1883
|
+
const referencepath_createdByValidationError = validate$i(obj_createdBy, path_createdBy);
|
|
1884
|
+
if (referencepath_createdByValidationError !== null) {
|
|
1885
|
+
let message = 'Object doesn\'t match CdpUserRepresentation (at "' + path_createdBy + '")\n';
|
|
1886
|
+
message += referencepath_createdByValidationError.message.split('\n').map((line) => '\t' + line).join('\n');
|
|
1887
|
+
return new TypeError(message);
|
|
1888
|
+
}
|
|
1889
|
+
const obj_createdDate = obj.createdDate;
|
|
1890
|
+
const path_createdDate = path + '.createdDate';
|
|
1891
|
+
if (typeof obj_createdDate !== 'string') {
|
|
1892
|
+
return new TypeError('Expected "string" but received "' + typeof obj_createdDate + '" (at "' + path_createdDate + '")');
|
|
1893
|
+
}
|
|
1894
|
+
const obj_description = obj.description;
|
|
1895
|
+
const path_description = path + '.description';
|
|
1896
|
+
if (typeof obj_description !== 'string') {
|
|
1897
|
+
return new TypeError('Expected "string" but received "' + typeof obj_description + '" (at "' + path_description + '")');
|
|
1898
|
+
}
|
|
1899
|
+
const obj_historiesUrl = obj.historiesUrl;
|
|
1900
|
+
const path_historiesUrl = path + '.historiesUrl';
|
|
1901
|
+
if (typeof obj_historiesUrl !== 'string') {
|
|
1902
|
+
return new TypeError('Expected "string" but received "' + typeof obj_historiesUrl + '" (at "' + path_historiesUrl + '")');
|
|
1903
|
+
}
|
|
1904
|
+
const obj_id = obj.id;
|
|
1905
|
+
const path_id = path + '.id';
|
|
1906
|
+
if (typeof obj_id !== 'string') {
|
|
1907
|
+
return new TypeError('Expected "string" but received "' + typeof obj_id + '" (at "' + path_id + '")');
|
|
1908
|
+
}
|
|
1909
|
+
const obj_label = obj.label;
|
|
1910
|
+
const path_label = path + '.label';
|
|
1911
|
+
if (typeof obj_label !== 'string') {
|
|
1912
|
+
return new TypeError('Expected "string" but received "' + typeof obj_label + '" (at "' + path_label + '")');
|
|
1913
|
+
}
|
|
1914
|
+
const obj_lastModifiedBy = obj.lastModifiedBy;
|
|
1915
|
+
const path_lastModifiedBy = path + '.lastModifiedBy';
|
|
1916
|
+
const referencepath_lastModifiedByValidationError = validate$i(obj_lastModifiedBy, path_lastModifiedBy);
|
|
1917
|
+
if (referencepath_lastModifiedByValidationError !== null) {
|
|
1918
|
+
let message = 'Object doesn\'t match CdpUserRepresentation (at "' + path_lastModifiedBy + '")\n';
|
|
1919
|
+
message += referencepath_lastModifiedByValidationError.message.split('\n').map((line) => '\t' + line).join('\n');
|
|
1920
|
+
return new TypeError(message);
|
|
1921
|
+
}
|
|
1922
|
+
const obj_lastModifiedDate = obj.lastModifiedDate;
|
|
1923
|
+
const path_lastModifiedDate = path + '.lastModifiedDate';
|
|
1924
|
+
if (typeof obj_lastModifiedDate !== 'string') {
|
|
1925
|
+
return new TypeError('Expected "string" but received "' + typeof obj_lastModifiedDate + '" (at "' + path_lastModifiedDate + '")');
|
|
1926
|
+
}
|
|
1927
|
+
const obj_latestSetup = obj.latestSetup;
|
|
1928
|
+
const path_latestSetup = path + '.latestSetup';
|
|
1929
|
+
const referencepath_latestSetupValidationError = validate$h(obj_latestSetup, path_latestSetup);
|
|
1930
|
+
if (referencepath_latestSetupValidationError !== null) {
|
|
1931
|
+
let message = 'Object doesn\'t match CdpAssetReferenceRepresentation (at "' + path_latestSetup + '")\n';
|
|
1932
|
+
message += referencepath_latestSetupValidationError.message.split('\n').map((line) => '\t' + line).join('\n');
|
|
1933
|
+
return new TypeError(message);
|
|
1934
|
+
}
|
|
1935
|
+
const obj_modelCount = obj.modelCount;
|
|
1936
|
+
const path_modelCount = path + '.modelCount';
|
|
1937
|
+
if (typeof obj_modelCount !== 'number' || (typeof obj_modelCount === 'number' && Math.floor(obj_modelCount) !== obj_modelCount)) {
|
|
1938
|
+
return new TypeError('Expected "integer" but received "' + typeof obj_modelCount + '" (at "' + path_modelCount + '")');
|
|
1939
|
+
}
|
|
1940
|
+
const obj_modelType = obj.modelType;
|
|
1941
|
+
const path_modelType = path + '.modelType';
|
|
1942
|
+
const referencepath_modelTypeValidationError = validate$9(obj_modelType, path_modelType);
|
|
1943
|
+
if (referencepath_modelTypeValidationError !== null) {
|
|
1944
|
+
let message = 'Object doesn\'t match CdpMlModelTypeRepresentation (at "' + path_modelType + '")\n';
|
|
1945
|
+
message += referencepath_modelTypeValidationError.message.split('\n').map((line) => '\t' + line).join('\n');
|
|
1946
|
+
return new TypeError(message);
|
|
1947
|
+
}
|
|
1948
|
+
const obj_modelsUrl = obj.modelsUrl;
|
|
1949
|
+
const path_modelsUrl = path + '.modelsUrl';
|
|
1950
|
+
if (typeof obj_modelsUrl !== 'string') {
|
|
1951
|
+
return new TypeError('Expected "string" but received "' + typeof obj_modelsUrl + '" (at "' + path_modelsUrl + '")');
|
|
1952
|
+
}
|
|
1953
|
+
const obj_name = obj.name;
|
|
1954
|
+
const path_name = path + '.name';
|
|
1955
|
+
if (typeof obj_name !== 'string') {
|
|
1956
|
+
return new TypeError('Expected "string" but received "' + typeof obj_name + '" (at "' + path_name + '")');
|
|
1957
|
+
}
|
|
1958
|
+
const obj_namespace = obj.namespace;
|
|
1959
|
+
const path_namespace = path + '.namespace';
|
|
1960
|
+
if (typeof obj_namespace !== 'string') {
|
|
1961
|
+
return new TypeError('Expected "string" but received "' + typeof obj_namespace + '" (at "' + path_namespace + '")');
|
|
1962
|
+
}
|
|
1963
|
+
const obj_outcomeDefinition = obj.outcomeDefinition;
|
|
1964
|
+
const path_outcomeDefinition = path + '.outcomeDefinition';
|
|
1965
|
+
const referencepath_outcomeDefinitionValidationError = validate$8(obj_outcomeDefinition, path_outcomeDefinition);
|
|
1966
|
+
if (referencepath_outcomeDefinitionValidationError !== null) {
|
|
1967
|
+
let message = 'Object doesn\'t match CdpMlModelOutcomeDefinitionRepresentation (at "' + path_outcomeDefinition + '")\n';
|
|
1968
|
+
message += referencepath_outcomeDefinitionValidationError.message.split('\n').map((line) => '\t' + line).join('\n');
|
|
1969
|
+
return new TypeError(message);
|
|
1970
|
+
}
|
|
1971
|
+
const obj_predictionType = obj.predictionType;
|
|
1972
|
+
const path_predictionType = path + '.predictionType';
|
|
1973
|
+
if (typeof obj_predictionType !== 'string') {
|
|
1974
|
+
return new TypeError('Expected "string" but received "' + typeof obj_predictionType + '" (at "' + path_predictionType + '")');
|
|
1975
|
+
}
|
|
1976
|
+
const obj_refreshConfig = obj.refreshConfig;
|
|
1977
|
+
const path_refreshConfig = path + '.refreshConfig';
|
|
1978
|
+
const referencepath_refreshConfigValidationError = validate$3(obj_refreshConfig, path_refreshConfig);
|
|
1979
|
+
if (referencepath_refreshConfigValidationError !== null) {
|
|
1980
|
+
let message = 'Object doesn\'t match CdpMlModelRefreshConfigRepresentation (at "' + path_refreshConfig + '")\n';
|
|
1981
|
+
message += referencepath_refreshConfigValidationError.message.split('\n').map((line) => '\t' + line).join('\n');
|
|
1982
|
+
return new TypeError(message);
|
|
1983
|
+
}
|
|
1984
|
+
const obj_setupVersionsUrl = obj.setupVersionsUrl;
|
|
1985
|
+
const path_setupVersionsUrl = path + '.setupVersionsUrl';
|
|
1986
|
+
if (typeof obj_setupVersionsUrl !== 'string') {
|
|
1987
|
+
return new TypeError('Expected "string" but received "' + typeof obj_setupVersionsUrl + '" (at "' + path_setupVersionsUrl + '")');
|
|
1988
|
+
}
|
|
1989
|
+
const obj_status = obj.status;
|
|
1990
|
+
const path_status = path + '.status';
|
|
1991
|
+
if (typeof obj_status !== 'string') {
|
|
1992
|
+
return new TypeError('Expected "string" but received "' + typeof obj_status + '" (at "' + path_status + '")');
|
|
1993
|
+
}
|
|
1994
|
+
const obj_totalInferenceCount = obj.totalInferenceCount;
|
|
1995
|
+
const path_totalInferenceCount = path + '.totalInferenceCount';
|
|
1996
|
+
if (typeof obj_totalInferenceCount !== 'number' || (typeof obj_totalInferenceCount === 'number' && Math.floor(obj_totalInferenceCount) !== obj_totalInferenceCount)) {
|
|
1997
|
+
return new TypeError('Expected "integer" but received "' + typeof obj_totalInferenceCount + '" (at "' + path_totalInferenceCount + '")');
|
|
1998
|
+
}
|
|
1999
|
+
const obj_totalWarningsCount = obj.totalWarningsCount;
|
|
2000
|
+
const path_totalWarningsCount = path + '.totalWarningsCount';
|
|
2001
|
+
if (typeof obj_totalWarningsCount !== 'number' || (typeof obj_totalWarningsCount === 'number' && Math.floor(obj_totalWarningsCount) !== obj_totalWarningsCount)) {
|
|
2002
|
+
return new TypeError('Expected "integer" but received "' + typeof obj_totalWarningsCount + '" (at "' + path_totalWarningsCount + '")');
|
|
2003
|
+
}
|
|
2004
|
+
const obj_url = obj.url;
|
|
2005
|
+
const path_url = path + '.url';
|
|
2006
|
+
if (typeof obj_url !== 'string') {
|
|
2007
|
+
return new TypeError('Expected "string" but received "' + typeof obj_url + '" (at "' + path_url + '")');
|
|
2008
|
+
}
|
|
2009
|
+
})();
|
|
2010
|
+
return v_error === undefined ? null : v_error;
|
|
2011
|
+
}
|
|
2012
|
+
const RepresentationType$1 = 'CdpMlWorkspaceDetailRepresentation';
|
|
2013
|
+
function keyBuilder$4(luvio, config) {
|
|
2014
|
+
return keyPrefix + '::' + RepresentationType$1 + ':' + config.workspaceIdOrName;
|
|
2015
|
+
}
|
|
2016
|
+
function keyBuilderFromType(luvio, object) {
|
|
2017
|
+
const keyParams = {
|
|
2018
|
+
workspaceIdOrName: object.id
|
|
2019
|
+
};
|
|
2020
|
+
return keyBuilder$4(luvio, keyParams);
|
|
2021
|
+
}
|
|
2022
|
+
function normalize$1(input, existing, path, luvio, store, timestamp) {
|
|
2023
|
+
return input;
|
|
2024
|
+
}
|
|
2025
|
+
const select$4 = function CdpMlWorkspaceDetailRepresentationSelect() {
|
|
2026
|
+
return {
|
|
2027
|
+
kind: 'Fragment',
|
|
2028
|
+
version: VERSION$1,
|
|
2029
|
+
private: [],
|
|
2030
|
+
opaque: true
|
|
2031
|
+
};
|
|
2032
|
+
};
|
|
2033
|
+
function equals$1(existing, incoming) {
|
|
2034
|
+
if (JSONStringify(incoming) !== JSONStringify(existing)) {
|
|
2035
|
+
return false;
|
|
2036
|
+
}
|
|
2037
|
+
return true;
|
|
2038
|
+
}
|
|
2039
|
+
const ingest$1 = function CdpMlWorkspaceDetailRepresentationIngest(input, path, luvio, store, timestamp) {
|
|
2040
|
+
if (process.env.NODE_ENV !== 'production') {
|
|
2041
|
+
const validateError = validate$2(input);
|
|
2042
|
+
if (validateError !== null) {
|
|
2043
|
+
throw validateError;
|
|
2044
|
+
}
|
|
2045
|
+
}
|
|
2046
|
+
const key = keyBuilderFromType(luvio, input);
|
|
2047
|
+
const ttlToUse = TTL$1;
|
|
2048
|
+
ingestShape(input, path, luvio, store, timestamp, ttlToUse, key, normalize$1, "cdp-machine-learning", VERSION$1, RepresentationType$1, equals$1);
|
|
2049
|
+
return createLink(key);
|
|
2050
|
+
};
|
|
2051
|
+
function getTypeCacheKeys$1(rootKeySet, luvio, input, fullPathFactory) {
|
|
2052
|
+
// root cache key (uses fullPathFactory if keyBuilderFromType isn't defined)
|
|
2053
|
+
const rootKey = keyBuilderFromType(luvio, input);
|
|
2054
|
+
rootKeySet.set(rootKey, {
|
|
2055
|
+
namespace: keyPrefix,
|
|
2056
|
+
representationName: RepresentationType$1,
|
|
2057
|
+
mergeable: false
|
|
2058
|
+
});
|
|
2059
|
+
}
|
|
2060
|
+
|
|
2061
|
+
function select$3(luvio, params) {
|
|
2062
|
+
return select$4();
|
|
2063
|
+
}
|
|
2064
|
+
function keyBuilder$3(luvio, params) {
|
|
2065
|
+
return keyBuilder$4(luvio, {
|
|
2066
|
+
workspaceIdOrName: params.urlParams.workspaceIdOrName
|
|
2067
|
+
});
|
|
2068
|
+
}
|
|
2069
|
+
function getResponseCacheKeys$2(storeKeyMap, luvio, resourceParams, response) {
|
|
2070
|
+
getTypeCacheKeys$1(storeKeyMap, luvio, response);
|
|
2071
|
+
}
|
|
2072
|
+
function ingestSuccess$2(luvio, resourceParams, response, snapshotRefresh) {
|
|
2073
|
+
const { body } = response;
|
|
2074
|
+
const key = keyBuilder$3(luvio, resourceParams);
|
|
2075
|
+
luvio.storeIngest(key, ingest$1, body);
|
|
2076
|
+
const snapshot = luvio.storeLookup({
|
|
2077
|
+
recordId: key,
|
|
2078
|
+
node: select$3(),
|
|
2079
|
+
variables: {},
|
|
2080
|
+
}, snapshotRefresh);
|
|
2081
|
+
if (process.env.NODE_ENV !== 'production') {
|
|
2082
|
+
if (snapshot.state !== 'Fulfilled') {
|
|
2083
|
+
throw new Error('Invalid network response. Expected resource response to result in Fulfilled snapshot');
|
|
2084
|
+
}
|
|
2085
|
+
}
|
|
2086
|
+
deepFreeze(snapshot.data);
|
|
2087
|
+
return snapshot;
|
|
2088
|
+
}
|
|
2089
|
+
function ingestError$1(luvio, params, error, snapshotRefresh) {
|
|
2090
|
+
const key = keyBuilder$3(luvio, params);
|
|
2091
|
+
const errorSnapshot = luvio.errorSnapshot(error, snapshotRefresh);
|
|
2092
|
+
const storeMetadataParams = {
|
|
2093
|
+
ttl: TTL$1,
|
|
2094
|
+
namespace: keyPrefix,
|
|
2095
|
+
version: VERSION$1,
|
|
2096
|
+
representationName: RepresentationType$1
|
|
2097
|
+
};
|
|
2098
|
+
luvio.storeIngestError(key, errorSnapshot, storeMetadataParams);
|
|
2099
|
+
return errorSnapshot;
|
|
2100
|
+
}
|
|
2101
|
+
function createResourceRequest$2(config) {
|
|
2102
|
+
const headers = {};
|
|
2103
|
+
return {
|
|
2104
|
+
baseUri: '/services/data/v60.0',
|
|
2105
|
+
basePath: '/ssot/machine-learning/workspaces/' + config.urlParams.workspaceIdOrName + '',
|
|
2106
|
+
method: 'get',
|
|
2107
|
+
body: null,
|
|
2108
|
+
urlParams: config.urlParams,
|
|
2109
|
+
queryParams: {},
|
|
2110
|
+
headers,
|
|
2111
|
+
priority: 'normal',
|
|
2112
|
+
};
|
|
2113
|
+
}
|
|
2114
|
+
function createResourceRequestFromRepresentation(representation) {
|
|
2115
|
+
const config = {
|
|
2116
|
+
urlParams: {},
|
|
2117
|
+
};
|
|
2118
|
+
config.urlParams.workspaceIdOrName = representation.id;
|
|
2119
|
+
return createResourceRequest$2(config);
|
|
2120
|
+
}
|
|
2121
|
+
|
|
2122
|
+
const adapterName$2 = 'getCdpMlWorkspace';
|
|
2123
|
+
const getCdpMlWorkspace_ConfigPropertyMetadata = [
|
|
2124
|
+
generateParamConfigMetadata('workspaceIdOrName', true, 0 /* UrlParameter */, 0 /* String */),
|
|
2125
|
+
];
|
|
2126
|
+
const getCdpMlWorkspace_ConfigPropertyNames = /*#__PURE__*/ buildAdapterValidationConfig(adapterName$2, getCdpMlWorkspace_ConfigPropertyMetadata);
|
|
2127
|
+
const createResourceParams$2 = /*#__PURE__*/ createResourceParams$8(getCdpMlWorkspace_ConfigPropertyMetadata);
|
|
2128
|
+
function keyBuilder$2(luvio, config) {
|
|
2129
|
+
const resourceParams = createResourceParams$2(config);
|
|
2130
|
+
return keyBuilder$3(luvio, resourceParams);
|
|
2131
|
+
}
|
|
2132
|
+
function typeCheckConfig$2(untrustedConfig) {
|
|
2133
|
+
const config = {};
|
|
2134
|
+
typeCheckConfig$8(untrustedConfig, config, getCdpMlWorkspace_ConfigPropertyMetadata);
|
|
2135
|
+
return config;
|
|
2136
|
+
}
|
|
2137
|
+
function validateAdapterConfig$2(untrustedConfig, configPropertyNames) {
|
|
2138
|
+
if (!untrustedIsObject(untrustedConfig)) {
|
|
2139
|
+
return null;
|
|
2140
|
+
}
|
|
2141
|
+
if (process.env.NODE_ENV !== 'production') {
|
|
2142
|
+
validateConfig(untrustedConfig, configPropertyNames);
|
|
2143
|
+
}
|
|
2144
|
+
const config = typeCheckConfig$2(untrustedConfig);
|
|
2145
|
+
if (!areRequiredParametersPresent(config, configPropertyNames)) {
|
|
2146
|
+
return null;
|
|
2147
|
+
}
|
|
2148
|
+
return config;
|
|
2149
|
+
}
|
|
2150
|
+
function adapterFragment$1(luvio, config) {
|
|
2151
|
+
createResourceParams$2(config);
|
|
2152
|
+
return select$3();
|
|
2153
|
+
}
|
|
2154
|
+
function onFetchResponseSuccess$1(luvio, config, resourceParams, response) {
|
|
2155
|
+
const snapshot = ingestSuccess$2(luvio, resourceParams, response, {
|
|
2156
|
+
config,
|
|
2157
|
+
resolve: () => buildNetworkSnapshot$2(luvio, config, snapshotRefreshOptions)
|
|
2158
|
+
});
|
|
2159
|
+
return luvio.storeBroadcast().then(() => snapshot);
|
|
2160
|
+
}
|
|
2161
|
+
function onFetchResponseError$1(luvio, config, resourceParams, response) {
|
|
2162
|
+
const snapshot = ingestError$1(luvio, resourceParams, response, {
|
|
2163
|
+
config,
|
|
2164
|
+
resolve: () => buildNetworkSnapshot$2(luvio, config, snapshotRefreshOptions)
|
|
2165
|
+
});
|
|
2166
|
+
return luvio.storeBroadcast().then(() => snapshot);
|
|
2167
|
+
}
|
|
2168
|
+
function buildNetworkSnapshot$2(luvio, config, options) {
|
|
2169
|
+
const resourceParams = createResourceParams$2(config);
|
|
2170
|
+
const request = createResourceRequest$2(resourceParams);
|
|
2171
|
+
return luvio.dispatchResourceRequest(request, options)
|
|
2172
|
+
.then((response) => {
|
|
2173
|
+
return luvio.handleSuccessResponse(() => onFetchResponseSuccess$1(luvio, config, resourceParams, response), () => {
|
|
2174
|
+
const cache = new StoreKeyMap();
|
|
2175
|
+
getResponseCacheKeys$2(cache, luvio, resourceParams, response.body);
|
|
2176
|
+
return cache;
|
|
2177
|
+
});
|
|
2178
|
+
}, (response) => {
|
|
2179
|
+
return luvio.handleErrorResponse(() => onFetchResponseError$1(luvio, config, resourceParams, response));
|
|
2180
|
+
});
|
|
2181
|
+
}
|
|
2182
|
+
function buildNetworkSnapshotCachePolicy$1(context, coercedAdapterRequestContext) {
|
|
2183
|
+
return buildNetworkSnapshotCachePolicy$6(context, coercedAdapterRequestContext, buildNetworkSnapshot$2, undefined, false);
|
|
2184
|
+
}
|
|
2185
|
+
function buildCachedSnapshotCachePolicy$1(context, storeLookup) {
|
|
2186
|
+
const { luvio, config } = context;
|
|
2187
|
+
const selector = {
|
|
2188
|
+
recordId: keyBuilder$2(luvio, config),
|
|
2189
|
+
node: adapterFragment$1(luvio, config),
|
|
2190
|
+
variables: {},
|
|
2191
|
+
};
|
|
2192
|
+
const cacheSnapshot = storeLookup(selector, {
|
|
2193
|
+
config,
|
|
2194
|
+
resolve: () => buildNetworkSnapshot$2(luvio, config, snapshotRefreshOptions)
|
|
2195
|
+
});
|
|
2196
|
+
return cacheSnapshot;
|
|
2197
|
+
}
|
|
2198
|
+
const getCdpMlWorkspaceAdapterFactory = (luvio) => function cdpMachineLearning__getCdpMlWorkspace(untrustedConfig, requestContext) {
|
|
2199
|
+
const config = validateAdapterConfig$2(untrustedConfig, getCdpMlWorkspace_ConfigPropertyNames);
|
|
2200
|
+
// Invalid or incomplete config
|
|
2201
|
+
if (config === null) {
|
|
2202
|
+
return null;
|
|
2203
|
+
}
|
|
2204
|
+
return luvio.applyCachePolicy((requestContext || {}), { config, luvio }, // BuildSnapshotContext
|
|
2205
|
+
buildCachedSnapshotCachePolicy$1, buildNetworkSnapshotCachePolicy$1);
|
|
2206
|
+
};
|
|
2207
|
+
const notifyChangeFactory = (luvio, options) => {
|
|
2208
|
+
return function getSsotMachineLearningWorkspacesByWorkspaceIdOrNameNotifyChange(configs) {
|
|
2209
|
+
const keys = configs.map(c => keyBuilder$4(luvio, c));
|
|
2210
|
+
luvio.getNotifyChangeStoreEntries(keys).then(entries => {
|
|
2211
|
+
for (let i = 0, len = entries.length; i < len; i++) {
|
|
2212
|
+
const { key, record: val } = entries[i];
|
|
2213
|
+
const refreshRequest = createResourceRequestFromRepresentation(val);
|
|
2214
|
+
luvio.dispatchResourceRequest(refreshRequest, options)
|
|
2215
|
+
.then((response) => {
|
|
2216
|
+
return luvio.handleSuccessResponse(() => {
|
|
2217
|
+
const { body } = response;
|
|
2218
|
+
luvio.storeIngest(key, ingest$1, body);
|
|
2219
|
+
return luvio.storeBroadcast();
|
|
2220
|
+
}, () => {
|
|
2221
|
+
const cache = new StoreKeyMap();
|
|
2222
|
+
getTypeCacheKeys$1(cache, luvio, response.body);
|
|
2223
|
+
return cache;
|
|
2224
|
+
});
|
|
2225
|
+
}, (error) => {
|
|
2226
|
+
return luvio.handleErrorResponse(() => {
|
|
2227
|
+
const errorSnapshot = luvio.errorSnapshot(error);
|
|
2228
|
+
luvio.storeIngestError(key, errorSnapshot, {
|
|
2229
|
+
ttl: TTL$1,
|
|
2230
|
+
namespace: keyPrefix,
|
|
2231
|
+
version: VERSION$1,
|
|
2232
|
+
representationName: RepresentationType$1
|
|
2233
|
+
});
|
|
2234
|
+
return luvio.storeBroadcast().then(() => errorSnapshot);
|
|
2235
|
+
});
|
|
2236
|
+
});
|
|
2237
|
+
}
|
|
2238
|
+
});
|
|
2239
|
+
};
|
|
2240
|
+
};
|
|
2241
|
+
|
|
2242
|
+
function validate$1(obj, path = 'CdpMlWorkspaceRepresentation') {
|
|
2243
|
+
const v_error = (() => {
|
|
2244
|
+
if (typeof obj !== 'object' || ArrayIsArray(obj) || obj === null) {
|
|
2245
|
+
return new TypeError('Expected "object" but received "' + typeof obj + '" (at "' + path + '")');
|
|
2246
|
+
}
|
|
2247
|
+
const obj_activeSetup = obj.activeSetup;
|
|
2248
|
+
const path_activeSetup = path + '.activeSetup';
|
|
2249
|
+
const referencepath_activeSetupValidationError = validate$h(obj_activeSetup, path_activeSetup);
|
|
2250
|
+
if (referencepath_activeSetupValidationError !== null) {
|
|
2251
|
+
let message = 'Object doesn\'t match CdpAssetReferenceRepresentation (at "' + path_activeSetup + '")\n';
|
|
2252
|
+
message += referencepath_activeSetupValidationError.message.split('\n').map((line) => '\t' + line).join('\n');
|
|
2253
|
+
return new TypeError(message);
|
|
2254
|
+
}
|
|
2255
|
+
const obj_activeSetupVersionNumber = obj.activeSetupVersionNumber;
|
|
2256
|
+
const path_activeSetupVersionNumber = path + '.activeSetupVersionNumber';
|
|
2257
|
+
if (typeof obj_activeSetupVersionNumber !== 'number' || (typeof obj_activeSetupVersionNumber === 'number' && Math.floor(obj_activeSetupVersionNumber) !== obj_activeSetupVersionNumber)) {
|
|
2258
|
+
return new TypeError('Expected "integer" but received "' + typeof obj_activeSetupVersionNumber + '" (at "' + path_activeSetupVersionNumber + '")');
|
|
2259
|
+
}
|
|
2260
|
+
const obj_createdBy = obj.createdBy;
|
|
2261
|
+
const path_createdBy = path + '.createdBy';
|
|
2262
|
+
const referencepath_createdByValidationError = validate$i(obj_createdBy, path_createdBy);
|
|
2263
|
+
if (referencepath_createdByValidationError !== null) {
|
|
2264
|
+
let message = 'Object doesn\'t match CdpUserRepresentation (at "' + path_createdBy + '")\n';
|
|
2265
|
+
message += referencepath_createdByValidationError.message.split('\n').map((line) => '\t' + line).join('\n');
|
|
2266
|
+
return new TypeError(message);
|
|
2267
|
+
}
|
|
2268
|
+
const obj_createdDate = obj.createdDate;
|
|
2269
|
+
const path_createdDate = path + '.createdDate';
|
|
2270
|
+
if (typeof obj_createdDate !== 'string') {
|
|
2271
|
+
return new TypeError('Expected "string" but received "' + typeof obj_createdDate + '" (at "' + path_createdDate + '")');
|
|
2272
|
+
}
|
|
2273
|
+
const obj_description = obj.description;
|
|
2274
|
+
const path_description = path + '.description';
|
|
2275
|
+
if (typeof obj_description !== 'string') {
|
|
2276
|
+
return new TypeError('Expected "string" but received "' + typeof obj_description + '" (at "' + path_description + '")');
|
|
2277
|
+
}
|
|
2278
|
+
const obj_historiesUrl = obj.historiesUrl;
|
|
2279
|
+
const path_historiesUrl = path + '.historiesUrl';
|
|
2280
|
+
if (typeof obj_historiesUrl !== 'string') {
|
|
2281
|
+
return new TypeError('Expected "string" but received "' + typeof obj_historiesUrl + '" (at "' + path_historiesUrl + '")');
|
|
2282
|
+
}
|
|
2283
|
+
const obj_id = obj.id;
|
|
2284
|
+
const path_id = path + '.id';
|
|
2285
|
+
if (typeof obj_id !== 'string') {
|
|
2286
|
+
return new TypeError('Expected "string" but received "' + typeof obj_id + '" (at "' + path_id + '")');
|
|
2287
|
+
}
|
|
2288
|
+
const obj_label = obj.label;
|
|
2289
|
+
const path_label = path + '.label';
|
|
2290
|
+
if (typeof obj_label !== 'string') {
|
|
2291
|
+
return new TypeError('Expected "string" but received "' + typeof obj_label + '" (at "' + path_label + '")');
|
|
2292
|
+
}
|
|
2293
|
+
const obj_lastModifiedBy = obj.lastModifiedBy;
|
|
2294
|
+
const path_lastModifiedBy = path + '.lastModifiedBy';
|
|
2295
|
+
const referencepath_lastModifiedByValidationError = validate$i(obj_lastModifiedBy, path_lastModifiedBy);
|
|
2296
|
+
if (referencepath_lastModifiedByValidationError !== null) {
|
|
2297
|
+
let message = 'Object doesn\'t match CdpUserRepresentation (at "' + path_lastModifiedBy + '")\n';
|
|
2298
|
+
message += referencepath_lastModifiedByValidationError.message.split('\n').map((line) => '\t' + line).join('\n');
|
|
2299
|
+
return new TypeError(message);
|
|
2300
|
+
}
|
|
2301
|
+
const obj_lastModifiedDate = obj.lastModifiedDate;
|
|
2302
|
+
const path_lastModifiedDate = path + '.lastModifiedDate';
|
|
2303
|
+
if (typeof obj_lastModifiedDate !== 'string') {
|
|
2304
|
+
return new TypeError('Expected "string" but received "' + typeof obj_lastModifiedDate + '" (at "' + path_lastModifiedDate + '")');
|
|
2305
|
+
}
|
|
2306
|
+
const obj_latestSetup = obj.latestSetup;
|
|
2307
|
+
const path_latestSetup = path + '.latestSetup';
|
|
2308
|
+
const referencepath_latestSetupValidationError = validate$h(obj_latestSetup, path_latestSetup);
|
|
2309
|
+
if (referencepath_latestSetupValidationError !== null) {
|
|
2310
|
+
let message = 'Object doesn\'t match CdpAssetReferenceRepresentation (at "' + path_latestSetup + '")\n';
|
|
2311
|
+
message += referencepath_latestSetupValidationError.message.split('\n').map((line) => '\t' + line).join('\n');
|
|
2312
|
+
return new TypeError(message);
|
|
2313
|
+
}
|
|
2314
|
+
const obj_modelCount = obj.modelCount;
|
|
2315
|
+
const path_modelCount = path + '.modelCount';
|
|
2316
|
+
if (typeof obj_modelCount !== 'number' || (typeof obj_modelCount === 'number' && Math.floor(obj_modelCount) !== obj_modelCount)) {
|
|
2317
|
+
return new TypeError('Expected "integer" but received "' + typeof obj_modelCount + '" (at "' + path_modelCount + '")');
|
|
2318
|
+
}
|
|
2319
|
+
const obj_modelType = obj.modelType;
|
|
2320
|
+
const path_modelType = path + '.modelType';
|
|
2321
|
+
const referencepath_modelTypeValidationError = validate$9(obj_modelType, path_modelType);
|
|
2322
|
+
if (referencepath_modelTypeValidationError !== null) {
|
|
2323
|
+
let message = 'Object doesn\'t match CdpMlModelTypeRepresentation (at "' + path_modelType + '")\n';
|
|
2324
|
+
message += referencepath_modelTypeValidationError.message.split('\n').map((line) => '\t' + line).join('\n');
|
|
2325
|
+
return new TypeError(message);
|
|
2326
|
+
}
|
|
2327
|
+
const obj_modelsUrl = obj.modelsUrl;
|
|
2328
|
+
const path_modelsUrl = path + '.modelsUrl';
|
|
2329
|
+
if (typeof obj_modelsUrl !== 'string') {
|
|
2330
|
+
return new TypeError('Expected "string" but received "' + typeof obj_modelsUrl + '" (at "' + path_modelsUrl + '")');
|
|
2331
|
+
}
|
|
2332
|
+
const obj_name = obj.name;
|
|
2333
|
+
const path_name = path + '.name';
|
|
2334
|
+
if (typeof obj_name !== 'string') {
|
|
2335
|
+
return new TypeError('Expected "string" but received "' + typeof obj_name + '" (at "' + path_name + '")');
|
|
2336
|
+
}
|
|
2337
|
+
const obj_namespace = obj.namespace;
|
|
2338
|
+
const path_namespace = path + '.namespace';
|
|
2339
|
+
if (typeof obj_namespace !== 'string') {
|
|
2340
|
+
return new TypeError('Expected "string" but received "' + typeof obj_namespace + '" (at "' + path_namespace + '")');
|
|
2341
|
+
}
|
|
2342
|
+
const obj_outcomeDefinition = obj.outcomeDefinition;
|
|
2343
|
+
const path_outcomeDefinition = path + '.outcomeDefinition';
|
|
2344
|
+
const referencepath_outcomeDefinitionValidationError = validate$8(obj_outcomeDefinition, path_outcomeDefinition);
|
|
2345
|
+
if (referencepath_outcomeDefinitionValidationError !== null) {
|
|
2346
|
+
let message = 'Object doesn\'t match CdpMlModelOutcomeDefinitionRepresentation (at "' + path_outcomeDefinition + '")\n';
|
|
2347
|
+
message += referencepath_outcomeDefinitionValidationError.message.split('\n').map((line) => '\t' + line).join('\n');
|
|
2348
|
+
return new TypeError(message);
|
|
2349
|
+
}
|
|
2350
|
+
const obj_predictionType = obj.predictionType;
|
|
2351
|
+
const path_predictionType = path + '.predictionType';
|
|
2352
|
+
if (typeof obj_predictionType !== 'string') {
|
|
2353
|
+
return new TypeError('Expected "string" but received "' + typeof obj_predictionType + '" (at "' + path_predictionType + '")');
|
|
2354
|
+
}
|
|
2355
|
+
const obj_refreshConfig = obj.refreshConfig;
|
|
2356
|
+
const path_refreshConfig = path + '.refreshConfig';
|
|
2357
|
+
const referencepath_refreshConfigValidationError = validate$3(obj_refreshConfig, path_refreshConfig);
|
|
2358
|
+
if (referencepath_refreshConfigValidationError !== null) {
|
|
2359
|
+
let message = 'Object doesn\'t match CdpMlModelRefreshConfigRepresentation (at "' + path_refreshConfig + '")\n';
|
|
2360
|
+
message += referencepath_refreshConfigValidationError.message.split('\n').map((line) => '\t' + line).join('\n');
|
|
2361
|
+
return new TypeError(message);
|
|
2362
|
+
}
|
|
2363
|
+
const obj_setupVersionsUrl = obj.setupVersionsUrl;
|
|
2364
|
+
const path_setupVersionsUrl = path + '.setupVersionsUrl';
|
|
2365
|
+
if (typeof obj_setupVersionsUrl !== 'string') {
|
|
2366
|
+
return new TypeError('Expected "string" but received "' + typeof obj_setupVersionsUrl + '" (at "' + path_setupVersionsUrl + '")');
|
|
2367
|
+
}
|
|
2368
|
+
const obj_status = obj.status;
|
|
2369
|
+
const path_status = path + '.status';
|
|
2370
|
+
if (typeof obj_status !== 'string') {
|
|
2371
|
+
return new TypeError('Expected "string" but received "' + typeof obj_status + '" (at "' + path_status + '")');
|
|
2372
|
+
}
|
|
2373
|
+
const obj_totalInferenceCount = obj.totalInferenceCount;
|
|
2374
|
+
const path_totalInferenceCount = path + '.totalInferenceCount';
|
|
2375
|
+
if (typeof obj_totalInferenceCount !== 'number' || (typeof obj_totalInferenceCount === 'number' && Math.floor(obj_totalInferenceCount) !== obj_totalInferenceCount)) {
|
|
2376
|
+
return new TypeError('Expected "integer" but received "' + typeof obj_totalInferenceCount + '" (at "' + path_totalInferenceCount + '")');
|
|
2377
|
+
}
|
|
2378
|
+
const obj_totalWarningsCount = obj.totalWarningsCount;
|
|
2379
|
+
const path_totalWarningsCount = path + '.totalWarningsCount';
|
|
2380
|
+
if (typeof obj_totalWarningsCount !== 'number' || (typeof obj_totalWarningsCount === 'number' && Math.floor(obj_totalWarningsCount) !== obj_totalWarningsCount)) {
|
|
2381
|
+
return new TypeError('Expected "integer" but received "' + typeof obj_totalWarningsCount + '" (at "' + path_totalWarningsCount + '")');
|
|
2382
|
+
}
|
|
2383
|
+
const obj_url = obj.url;
|
|
2384
|
+
const path_url = path + '.url';
|
|
2385
|
+
if (typeof obj_url !== 'string') {
|
|
2386
|
+
return new TypeError('Expected "string" but received "' + typeof obj_url + '" (at "' + path_url + '")');
|
|
2387
|
+
}
|
|
2388
|
+
})();
|
|
2389
|
+
return v_error === undefined ? null : v_error;
|
|
2390
|
+
}
|
|
2391
|
+
|
|
2392
|
+
const TTL = 1000;
|
|
2393
|
+
const VERSION = "6f430e4ccb178c06b2e6b7450e3010c2";
|
|
2394
|
+
function validate(obj, path = 'CdpMlWorkspaceCollectionRepresentation') {
|
|
2395
|
+
const v_error = (() => {
|
|
2396
|
+
if (typeof obj !== 'object' || ArrayIsArray(obj) || obj === null) {
|
|
2397
|
+
return new TypeError('Expected "object" but received "' + typeof obj + '" (at "' + path + '")');
|
|
2398
|
+
}
|
|
2399
|
+
const obj_currentPageUrl = obj.currentPageUrl;
|
|
2400
|
+
const path_currentPageUrl = path + '.currentPageUrl';
|
|
2401
|
+
if (typeof obj_currentPageUrl !== 'string') {
|
|
2402
|
+
return new TypeError('Expected "string" but received "' + typeof obj_currentPageUrl + '" (at "' + path_currentPageUrl + '")');
|
|
2403
|
+
}
|
|
2404
|
+
const obj_nextPageUrl = obj.nextPageUrl;
|
|
2405
|
+
const path_nextPageUrl = path + '.nextPageUrl';
|
|
2406
|
+
if (typeof obj_nextPageUrl !== 'string') {
|
|
2407
|
+
return new TypeError('Expected "string" but received "' + typeof obj_nextPageUrl + '" (at "' + path_nextPageUrl + '")');
|
|
2408
|
+
}
|
|
2409
|
+
const obj_totalSize = obj.totalSize;
|
|
2410
|
+
const path_totalSize = path + '.totalSize';
|
|
2411
|
+
if (typeof obj_totalSize !== 'number' || (typeof obj_totalSize === 'number' && Math.floor(obj_totalSize) !== obj_totalSize)) {
|
|
2412
|
+
return new TypeError('Expected "integer" but received "' + typeof obj_totalSize + '" (at "' + path_totalSize + '")');
|
|
2413
|
+
}
|
|
2414
|
+
const obj_workspaces = obj.workspaces;
|
|
2415
|
+
const path_workspaces = path + '.workspaces';
|
|
2416
|
+
if (!ArrayIsArray(obj_workspaces)) {
|
|
2417
|
+
return new TypeError('Expected "array" but received "' + typeof obj_workspaces + '" (at "' + path_workspaces + '")');
|
|
2418
|
+
}
|
|
2419
|
+
for (let i = 0; i < obj_workspaces.length; i++) {
|
|
2420
|
+
const obj_workspaces_item = obj_workspaces[i];
|
|
2421
|
+
const path_workspaces_item = path_workspaces + '[' + i + ']';
|
|
2422
|
+
const referencepath_workspaces_itemValidationError = validate$1(obj_workspaces_item, path_workspaces_item);
|
|
2423
|
+
if (referencepath_workspaces_itemValidationError !== null) {
|
|
2424
|
+
let message = 'Object doesn\'t match CdpMlWorkspaceRepresentation (at "' + path_workspaces_item + '")\n';
|
|
2425
|
+
message += referencepath_workspaces_itemValidationError.message.split('\n').map((line) => '\t' + line).join('\n');
|
|
2426
|
+
return new TypeError(message);
|
|
2427
|
+
}
|
|
2428
|
+
}
|
|
2429
|
+
})();
|
|
2430
|
+
return v_error === undefined ? null : v_error;
|
|
2431
|
+
}
|
|
2432
|
+
const RepresentationType = 'CdpMlWorkspaceCollectionRepresentation';
|
|
2433
|
+
function normalize(input, existing, path, luvio, store, timestamp) {
|
|
2434
|
+
return input;
|
|
2435
|
+
}
|
|
2436
|
+
const select$2 = function CdpMlWorkspaceCollectionRepresentationSelect() {
|
|
2437
|
+
return {
|
|
2438
|
+
kind: 'Fragment',
|
|
2439
|
+
version: VERSION,
|
|
2440
|
+
private: [],
|
|
2441
|
+
opaque: true
|
|
2442
|
+
};
|
|
2443
|
+
};
|
|
2444
|
+
function equals(existing, incoming) {
|
|
2445
|
+
if (JSONStringify(incoming) !== JSONStringify(existing)) {
|
|
2446
|
+
return false;
|
|
2447
|
+
}
|
|
2448
|
+
return true;
|
|
2449
|
+
}
|
|
2450
|
+
const ingest = function CdpMlWorkspaceCollectionRepresentationIngest(input, path, luvio, store, timestamp) {
|
|
2451
|
+
if (process.env.NODE_ENV !== 'production') {
|
|
2452
|
+
const validateError = validate(input);
|
|
2453
|
+
if (validateError !== null) {
|
|
2454
|
+
throw validateError;
|
|
2455
|
+
}
|
|
2456
|
+
}
|
|
2457
|
+
const key = path.fullPath;
|
|
2458
|
+
const ttlToUse = TTL;
|
|
2459
|
+
ingestShape(input, path, luvio, store, timestamp, ttlToUse, key, normalize, "cdp-machine-learning", VERSION, RepresentationType, equals);
|
|
2460
|
+
return createLink(key);
|
|
2461
|
+
};
|
|
2462
|
+
function getTypeCacheKeys(rootKeySet, luvio, input, fullPathFactory) {
|
|
2463
|
+
// root cache key (uses fullPathFactory if keyBuilderFromType isn't defined)
|
|
2464
|
+
const rootKey = fullPathFactory();
|
|
2465
|
+
rootKeySet.set(rootKey, {
|
|
2466
|
+
namespace: keyPrefix,
|
|
2467
|
+
representationName: RepresentationType,
|
|
2468
|
+
mergeable: false
|
|
2469
|
+
});
|
|
2470
|
+
}
|
|
2471
|
+
|
|
2472
|
+
function select$1(luvio, params) {
|
|
2473
|
+
return select$2();
|
|
2474
|
+
}
|
|
2475
|
+
function keyBuilder$1(luvio, params) {
|
|
2476
|
+
return keyPrefix + '::CdpMlWorkspaceCollectionRepresentation:(' + 'limit:' + params.queryParams.limit + ',' + 'modelType:' + params.queryParams.modelType + ',' + 'offset:' + params.queryParams.offset + ',' + 'predictionType:' + params.queryParams.predictionType + ',' + 'search:' + params.queryParams.search + ',' + 'sourceType:' + params.queryParams.sourceType + ',' + 'status:' + params.queryParams.status + ')';
|
|
2477
|
+
}
|
|
2478
|
+
function getResponseCacheKeys$1(storeKeyMap, luvio, resourceParams, response) {
|
|
2479
|
+
getTypeCacheKeys(storeKeyMap, luvio, response, () => keyBuilder$1(luvio, resourceParams));
|
|
2480
|
+
}
|
|
2481
|
+
function ingestSuccess$1(luvio, resourceParams, response, snapshotRefresh) {
|
|
2482
|
+
const { body } = response;
|
|
2483
|
+
const key = keyBuilder$1(luvio, resourceParams);
|
|
2484
|
+
luvio.storeIngest(key, ingest, body);
|
|
2485
|
+
const snapshot = luvio.storeLookup({
|
|
2486
|
+
recordId: key,
|
|
2487
|
+
node: select$1(),
|
|
2488
|
+
variables: {},
|
|
2489
|
+
}, snapshotRefresh);
|
|
2490
|
+
if (process.env.NODE_ENV !== 'production') {
|
|
2491
|
+
if (snapshot.state !== 'Fulfilled') {
|
|
2492
|
+
throw new Error('Invalid network response. Expected resource response to result in Fulfilled snapshot');
|
|
2493
|
+
}
|
|
2494
|
+
}
|
|
2495
|
+
deepFreeze(snapshot.data);
|
|
2496
|
+
return snapshot;
|
|
2497
|
+
}
|
|
2498
|
+
function ingestError(luvio, params, error, snapshotRefresh) {
|
|
2499
|
+
const key = keyBuilder$1(luvio, params);
|
|
2500
|
+
const errorSnapshot = luvio.errorSnapshot(error, snapshotRefresh);
|
|
2501
|
+
const storeMetadataParams = {
|
|
2502
|
+
ttl: TTL,
|
|
2503
|
+
namespace: keyPrefix,
|
|
2504
|
+
version: VERSION,
|
|
2505
|
+
representationName: RepresentationType
|
|
2506
|
+
};
|
|
2507
|
+
luvio.storeIngestError(key, errorSnapshot, storeMetadataParams);
|
|
2508
|
+
return errorSnapshot;
|
|
2509
|
+
}
|
|
2510
|
+
function createResourceRequest$1(config) {
|
|
2511
|
+
const headers = {};
|
|
2512
|
+
return {
|
|
2513
|
+
baseUri: '/services/data/v60.0',
|
|
2514
|
+
basePath: '/ssot/machine-learning/workspaces',
|
|
2515
|
+
method: 'get',
|
|
2516
|
+
body: null,
|
|
2517
|
+
urlParams: {},
|
|
2518
|
+
queryParams: config.queryParams,
|
|
2519
|
+
headers,
|
|
2520
|
+
priority: 'normal',
|
|
2521
|
+
};
|
|
2522
|
+
}
|
|
2523
|
+
|
|
2524
|
+
const adapterName$1 = 'getCdpMlWorkspaceCollection';
|
|
2525
|
+
const getCdpMlWorkspaceCollection_ConfigPropertyMetadata = [
|
|
2526
|
+
generateParamConfigMetadata('limit', false, 1 /* QueryParameter */, 3 /* Integer */),
|
|
2527
|
+
generateParamConfigMetadata('modelType', false, 1 /* QueryParameter */, 0 /* String */),
|
|
2528
|
+
generateParamConfigMetadata('offset', false, 1 /* QueryParameter */, 3 /* Integer */),
|
|
2529
|
+
generateParamConfigMetadata('predictionType', false, 1 /* QueryParameter */, 0 /* String */),
|
|
2530
|
+
generateParamConfigMetadata('search', false, 1 /* QueryParameter */, 0 /* String */),
|
|
2531
|
+
generateParamConfigMetadata('sourceType', false, 1 /* QueryParameter */, 0 /* String */),
|
|
2532
|
+
generateParamConfigMetadata('status', false, 1 /* QueryParameter */, 0 /* String */),
|
|
2533
|
+
];
|
|
2534
|
+
const getCdpMlWorkspaceCollection_ConfigPropertyNames = /*#__PURE__*/ buildAdapterValidationConfig(adapterName$1, getCdpMlWorkspaceCollection_ConfigPropertyMetadata);
|
|
2535
|
+
const createResourceParams$1 = /*#__PURE__*/ createResourceParams$8(getCdpMlWorkspaceCollection_ConfigPropertyMetadata);
|
|
2536
|
+
function keyBuilder(luvio, config) {
|
|
2537
|
+
const resourceParams = createResourceParams$1(config);
|
|
2538
|
+
return keyBuilder$1(luvio, resourceParams);
|
|
2539
|
+
}
|
|
2540
|
+
function typeCheckConfig$1(untrustedConfig) {
|
|
2541
|
+
const config = {};
|
|
2542
|
+
typeCheckConfig$8(untrustedConfig, config, getCdpMlWorkspaceCollection_ConfigPropertyMetadata);
|
|
2543
|
+
return config;
|
|
2544
|
+
}
|
|
2545
|
+
function validateAdapterConfig$1(untrustedConfig, configPropertyNames) {
|
|
2546
|
+
if (!untrustedIsObject(untrustedConfig)) {
|
|
2547
|
+
return null;
|
|
2548
|
+
}
|
|
2549
|
+
if (process.env.NODE_ENV !== 'production') {
|
|
2550
|
+
validateConfig(untrustedConfig, configPropertyNames);
|
|
2551
|
+
}
|
|
2552
|
+
const config = typeCheckConfig$1(untrustedConfig);
|
|
2553
|
+
if (!areRequiredParametersPresent(config, configPropertyNames)) {
|
|
2554
|
+
return null;
|
|
2555
|
+
}
|
|
2556
|
+
return config;
|
|
2557
|
+
}
|
|
2558
|
+
function adapterFragment(luvio, config) {
|
|
2559
|
+
createResourceParams$1(config);
|
|
2560
|
+
return select$1();
|
|
2561
|
+
}
|
|
2562
|
+
function onFetchResponseSuccess(luvio, config, resourceParams, response) {
|
|
2563
|
+
const snapshot = ingestSuccess$1(luvio, resourceParams, response, {
|
|
2564
|
+
config,
|
|
2565
|
+
resolve: () => buildNetworkSnapshot$1(luvio, config, snapshotRefreshOptions)
|
|
2566
|
+
});
|
|
2567
|
+
return luvio.storeBroadcast().then(() => snapshot);
|
|
2568
|
+
}
|
|
2569
|
+
function onFetchResponseError(luvio, config, resourceParams, response) {
|
|
2570
|
+
const snapshot = ingestError(luvio, resourceParams, response, {
|
|
2571
|
+
config,
|
|
2572
|
+
resolve: () => buildNetworkSnapshot$1(luvio, config, snapshotRefreshOptions)
|
|
2573
|
+
});
|
|
2574
|
+
return luvio.storeBroadcast().then(() => snapshot);
|
|
2575
|
+
}
|
|
2576
|
+
function buildNetworkSnapshot$1(luvio, config, options) {
|
|
2577
|
+
const resourceParams = createResourceParams$1(config);
|
|
2578
|
+
const request = createResourceRequest$1(resourceParams);
|
|
2579
|
+
return luvio.dispatchResourceRequest(request, options)
|
|
2580
|
+
.then((response) => {
|
|
2581
|
+
return luvio.handleSuccessResponse(() => onFetchResponseSuccess(luvio, config, resourceParams, response), () => {
|
|
2582
|
+
const cache = new StoreKeyMap();
|
|
2583
|
+
getResponseCacheKeys$1(cache, luvio, resourceParams, response.body);
|
|
2584
|
+
return cache;
|
|
2585
|
+
});
|
|
2586
|
+
}, (response) => {
|
|
2587
|
+
return luvio.handleErrorResponse(() => onFetchResponseError(luvio, config, resourceParams, response));
|
|
2588
|
+
});
|
|
2589
|
+
}
|
|
2590
|
+
function buildNetworkSnapshotCachePolicy(context, coercedAdapterRequestContext) {
|
|
2591
|
+
return buildNetworkSnapshotCachePolicy$6(context, coercedAdapterRequestContext, buildNetworkSnapshot$1, undefined, false);
|
|
2592
|
+
}
|
|
2593
|
+
function buildCachedSnapshotCachePolicy(context, storeLookup) {
|
|
2594
|
+
const { luvio, config } = context;
|
|
2595
|
+
const selector = {
|
|
2596
|
+
recordId: keyBuilder(luvio, config),
|
|
2597
|
+
node: adapterFragment(luvio, config),
|
|
2598
|
+
variables: {},
|
|
2599
|
+
};
|
|
2600
|
+
const cacheSnapshot = storeLookup(selector, {
|
|
2601
|
+
config,
|
|
2602
|
+
resolve: () => buildNetworkSnapshot$1(luvio, config, snapshotRefreshOptions)
|
|
2603
|
+
});
|
|
2604
|
+
return cacheSnapshot;
|
|
2605
|
+
}
|
|
2606
|
+
const getCdpMlWorkspaceCollectionAdapterFactory = (luvio) => function cdpMachineLearning__getCdpMlWorkspaceCollection(untrustedConfig, requestContext) {
|
|
2607
|
+
const config = validateAdapterConfig$1(untrustedConfig, getCdpMlWorkspaceCollection_ConfigPropertyNames);
|
|
2608
|
+
// Invalid or incomplete config
|
|
2609
|
+
if (config === null) {
|
|
2610
|
+
return null;
|
|
2611
|
+
}
|
|
2612
|
+
return luvio.applyCachePolicy((requestContext || {}), { config, luvio }, // BuildSnapshotContext
|
|
2613
|
+
buildCachedSnapshotCachePolicy, buildNetworkSnapshotCachePolicy);
|
|
2614
|
+
};
|
|
2615
|
+
|
|
2616
|
+
function select(luvio, params) {
|
|
2617
|
+
return select$d();
|
|
2618
|
+
}
|
|
2619
|
+
function getResponseCacheKeys(storeKeyMap, luvio, resourceParams, response) {
|
|
2620
|
+
getTypeCacheKeys$5(storeKeyMap, luvio, response);
|
|
2621
|
+
}
|
|
2622
|
+
function ingestSuccess(luvio, resourceParams, response) {
|
|
2623
|
+
const { body } = response;
|
|
2624
|
+
const key = keyBuilderFromType$1(luvio, body);
|
|
2625
|
+
luvio.storeIngest(key, ingest$5, body);
|
|
2626
|
+
const snapshot = luvio.storeLookup({
|
|
2627
|
+
recordId: key,
|
|
2628
|
+
node: select(),
|
|
2629
|
+
variables: {},
|
|
2630
|
+
});
|
|
2631
|
+
if (process.env.NODE_ENV !== 'production') {
|
|
2632
|
+
if (snapshot.state !== 'Fulfilled') {
|
|
2633
|
+
throw new Error('Invalid network response. Expected resource response to result in Fulfilled snapshot');
|
|
2634
|
+
}
|
|
2635
|
+
}
|
|
2636
|
+
deepFreeze(snapshot.data);
|
|
2637
|
+
return snapshot;
|
|
2638
|
+
}
|
|
2639
|
+
function createResourceRequest(config) {
|
|
2640
|
+
const headers = {};
|
|
2641
|
+
return {
|
|
2642
|
+
baseUri: '/services/data/v60.0',
|
|
2643
|
+
basePath: '/ssot/machine-learning/workspaces/' + config.urlParams.workspaceIdOrName + '/models/' + config.urlParams.modelId + '',
|
|
2644
|
+
method: 'patch',
|
|
2645
|
+
body: config.body,
|
|
2646
|
+
urlParams: config.urlParams,
|
|
2647
|
+
queryParams: {},
|
|
2648
|
+
headers,
|
|
2649
|
+
priority: 'normal',
|
|
2650
|
+
};
|
|
2651
|
+
}
|
|
2652
|
+
|
|
2653
|
+
const adapterName = 'updateCdpMlConfiguredModel';
|
|
2654
|
+
const updateCdpMlConfiguredModel_ConfigPropertyMetadata = [
|
|
2655
|
+
generateParamConfigMetadata('modelId', true, 0 /* UrlParameter */, 0 /* String */),
|
|
2656
|
+
generateParamConfigMetadata('workspaceIdOrName', true, 0 /* UrlParameter */, 0 /* String */),
|
|
2657
|
+
generateParamConfigMetadata('actionableFields', true, 2 /* Body */, 4 /* Unsupported */, true),
|
|
2658
|
+
generateParamConfigMetadata('artifact', true, 2 /* Body */, 4 /* Unsupported */),
|
|
2659
|
+
generateParamConfigMetadata('capability', true, 2 /* Body */, 0 /* String */),
|
|
2660
|
+
generateParamConfigMetadata('customizableFields', true, 2 /* Body */, 4 /* Unsupported */, true),
|
|
2661
|
+
generateParamConfigMetadata('description', true, 2 /* Body */, 0 /* String */),
|
|
2662
|
+
generateParamConfigMetadata('filter', true, 2 /* Body */, 4 /* Unsupported */),
|
|
2663
|
+
generateParamConfigMetadata('label', true, 2 /* Body */, 0 /* String */),
|
|
2664
|
+
generateParamConfigMetadata('parameterOverrides', true, 2 /* Body */, 4 /* Unsupported */, true),
|
|
2665
|
+
generateParamConfigMetadata('position', true, 2 /* Body */, 3 /* Integer */),
|
|
2666
|
+
generateParamConfigMetadata('status', true, 2 /* Body */, 0 /* String */),
|
|
2667
|
+
];
|
|
2668
|
+
const updateCdpMlConfiguredModel_ConfigPropertyNames = /*#__PURE__*/ buildAdapterValidationConfig(adapterName, updateCdpMlConfiguredModel_ConfigPropertyMetadata);
|
|
2669
|
+
const createResourceParams = /*#__PURE__*/ createResourceParams$8(updateCdpMlConfiguredModel_ConfigPropertyMetadata);
|
|
2670
|
+
function typeCheckConfig(untrustedConfig) {
|
|
2671
|
+
const config = {};
|
|
2672
|
+
typeCheckConfig$8(untrustedConfig, config, updateCdpMlConfiguredModel_ConfigPropertyMetadata);
|
|
2673
|
+
const untrustedConfig_actionableFields = untrustedConfig.actionableFields;
|
|
2674
|
+
if (ArrayIsArray$1(untrustedConfig_actionableFields)) {
|
|
2675
|
+
const untrustedConfig_actionableFields_array = [];
|
|
2676
|
+
for (let i = 0, arrayLength = untrustedConfig_actionableFields.length; i < arrayLength; i++) {
|
|
2677
|
+
const untrustedConfig_actionableFields_item = untrustedConfig_actionableFields[i];
|
|
2678
|
+
if (untrustedIsObject(untrustedConfig_actionableFields_item)) {
|
|
2679
|
+
const untrustedConfig_actionableFields_item_object = {};
|
|
2680
|
+
if (untrustedConfig_actionableFields_item_object !== undefined && Object.keys(untrustedConfig_actionableFields_item_object).length >= 0) {
|
|
2681
|
+
untrustedConfig_actionableFields_array.push(untrustedConfig_actionableFields_item_object);
|
|
2682
|
+
}
|
|
2683
|
+
}
|
|
2684
|
+
}
|
|
2685
|
+
config.actionableFields = untrustedConfig_actionableFields_array;
|
|
2686
|
+
}
|
|
2687
|
+
const untrustedConfig_artifact = untrustedConfig.artifact;
|
|
2688
|
+
if (untrustedIsObject(untrustedConfig_artifact)) {
|
|
2689
|
+
const untrustedConfig_artifact_object = {};
|
|
2690
|
+
if (untrustedConfig_artifact_object !== undefined && Object.keys(untrustedConfig_artifact_object).length >= 0) {
|
|
2691
|
+
config.artifact = untrustedConfig_artifact_object;
|
|
2692
|
+
}
|
|
2693
|
+
}
|
|
2694
|
+
const untrustedConfig_customizableFields = untrustedConfig.customizableFields;
|
|
2695
|
+
if (ArrayIsArray$1(untrustedConfig_customizableFields)) {
|
|
2696
|
+
const untrustedConfig_customizableFields_array = [];
|
|
2697
|
+
for (let i = 0, arrayLength = untrustedConfig_customizableFields.length; i < arrayLength; i++) {
|
|
2698
|
+
const untrustedConfig_customizableFields_item = untrustedConfig_customizableFields[i];
|
|
2699
|
+
if (untrustedIsObject(untrustedConfig_customizableFields_item)) {
|
|
2700
|
+
const untrustedConfig_customizableFields_item_object = {};
|
|
2701
|
+
if (untrustedConfig_customizableFields_item_object !== undefined && Object.keys(untrustedConfig_customizableFields_item_object).length >= 0) {
|
|
2702
|
+
untrustedConfig_customizableFields_array.push(untrustedConfig_customizableFields_item_object);
|
|
2703
|
+
}
|
|
2704
|
+
}
|
|
2705
|
+
}
|
|
2706
|
+
config.customizableFields = untrustedConfig_customizableFields_array;
|
|
2707
|
+
}
|
|
2708
|
+
const untrustedConfig_filter = untrustedConfig.filter;
|
|
2709
|
+
if (untrustedIsObject(untrustedConfig_filter)) {
|
|
2710
|
+
const untrustedConfig_filter_object = {};
|
|
2711
|
+
if (untrustedConfig_filter_object !== undefined && Object.keys(untrustedConfig_filter_object).length >= 0) {
|
|
2712
|
+
config.filter = untrustedConfig_filter_object;
|
|
2713
|
+
}
|
|
2714
|
+
}
|
|
2715
|
+
const untrustedConfig_parameterOverrides = untrustedConfig.parameterOverrides;
|
|
2716
|
+
if (ArrayIsArray$1(untrustedConfig_parameterOverrides)) {
|
|
2717
|
+
const untrustedConfig_parameterOverrides_array = [];
|
|
2718
|
+
for (let i = 0, arrayLength = untrustedConfig_parameterOverrides.length; i < arrayLength; i++) {
|
|
2719
|
+
const untrustedConfig_parameterOverrides_item = untrustedConfig_parameterOverrides[i];
|
|
2720
|
+
if (untrustedIsObject(untrustedConfig_parameterOverrides_item)) {
|
|
2721
|
+
const untrustedConfig_parameterOverrides_item_object = {};
|
|
2722
|
+
if (untrustedConfig_parameterOverrides_item_object !== undefined && Object.keys(untrustedConfig_parameterOverrides_item_object).length >= 0) {
|
|
2723
|
+
untrustedConfig_parameterOverrides_array.push(untrustedConfig_parameterOverrides_item_object);
|
|
2724
|
+
}
|
|
2725
|
+
}
|
|
2726
|
+
}
|
|
2727
|
+
config.parameterOverrides = untrustedConfig_parameterOverrides_array;
|
|
2728
|
+
}
|
|
2729
|
+
return config;
|
|
2730
|
+
}
|
|
2731
|
+
function validateAdapterConfig(untrustedConfig, configPropertyNames) {
|
|
2732
|
+
if (!untrustedIsObject(untrustedConfig)) {
|
|
2733
|
+
return null;
|
|
2734
|
+
}
|
|
2735
|
+
if (process.env.NODE_ENV !== 'production') {
|
|
2736
|
+
validateConfig(untrustedConfig, configPropertyNames);
|
|
2737
|
+
}
|
|
2738
|
+
const config = typeCheckConfig(untrustedConfig);
|
|
2739
|
+
if (!areRequiredParametersPresent(config, configPropertyNames)) {
|
|
2740
|
+
return null;
|
|
2741
|
+
}
|
|
2742
|
+
return config;
|
|
2743
|
+
}
|
|
2744
|
+
function buildNetworkSnapshot(luvio, config, options) {
|
|
2745
|
+
const resourceParams = createResourceParams(config);
|
|
2746
|
+
const request = createResourceRequest(resourceParams);
|
|
2747
|
+
return luvio.dispatchResourceRequest(request, options)
|
|
2748
|
+
.then((response) => {
|
|
2749
|
+
return luvio.handleSuccessResponse(() => {
|
|
2750
|
+
const snapshot = ingestSuccess(luvio, resourceParams, response);
|
|
2751
|
+
return luvio.storeBroadcast().then(() => snapshot);
|
|
2752
|
+
}, () => {
|
|
2753
|
+
const cache = new StoreKeyMap();
|
|
2754
|
+
getResponseCacheKeys(cache, luvio, resourceParams, response.body);
|
|
2755
|
+
return cache;
|
|
2756
|
+
});
|
|
2757
|
+
}, (response) => {
|
|
2758
|
+
deepFreeze(response);
|
|
2759
|
+
throw response;
|
|
2760
|
+
});
|
|
2761
|
+
}
|
|
2762
|
+
const updateCdpMlConfiguredModelAdapterFactory = (luvio) => {
|
|
2763
|
+
return function updateCdpMlConfiguredModel(untrustedConfig) {
|
|
2764
|
+
const config = validateAdapterConfig(untrustedConfig, updateCdpMlConfiguredModel_ConfigPropertyNames);
|
|
2765
|
+
// Invalid or incomplete config
|
|
2766
|
+
if (config === null) {
|
|
2767
|
+
throw new Error('Invalid config for "updateCdpMlConfiguredModel"');
|
|
2768
|
+
}
|
|
2769
|
+
return buildNetworkSnapshot(luvio, config);
|
|
2770
|
+
};
|
|
2771
|
+
};
|
|
2772
|
+
|
|
2773
|
+
let createCdpMlConfiguredModelCollection;
|
|
2774
|
+
let getCdpMlConfiguredModel;
|
|
2775
|
+
let getCdpMlConfiguredModelCollection;
|
|
2776
|
+
let getCdpMlModelArtifact;
|
|
2777
|
+
let getCdpMlModelArtifactCollection;
|
|
2778
|
+
let getCdpMlWorkspace;
|
|
2779
|
+
let getCdpMlWorkspaceCollection;
|
|
2780
|
+
let getCdpMlWorkspaceNotifyChange;
|
|
2781
|
+
let updateCdpMlConfiguredModel;
|
|
2782
|
+
// Imperative GET Adapters
|
|
2783
|
+
let getCdpMlConfiguredModel_imperative;
|
|
2784
|
+
let getCdpMlConfiguredModelCollection_imperative;
|
|
2785
|
+
let getCdpMlModelArtifact_imperative;
|
|
2786
|
+
let getCdpMlModelArtifactCollection_imperative;
|
|
2787
|
+
let getCdpMlWorkspace_imperative;
|
|
2788
|
+
let getCdpMlWorkspaceCollection_imperative;
|
|
2789
|
+
const getCdpMlConfiguredModelMetadata = { apiFamily: 'cdpmachine-learning', name: 'getCdpMlConfiguredModel', ttl: 1000 };
|
|
2790
|
+
const getCdpMlConfiguredModelCollectionMetadata = { apiFamily: 'cdpmachine-learning', name: 'getCdpMlConfiguredModelCollection', ttl: 1000 };
|
|
2791
|
+
const getCdpMlModelArtifactMetadata = { apiFamily: 'cdpmachine-learning', name: 'getCdpMlModelArtifact', ttl: 1000 };
|
|
2792
|
+
const getCdpMlModelArtifactCollectionMetadata = { apiFamily: 'cdpmachine-learning', name: 'getCdpMlModelArtifactCollection', ttl: 1000 };
|
|
2793
|
+
const getCdpMlWorkspaceMetadata = { apiFamily: 'cdpmachine-learning', name: 'getCdpMlWorkspace', ttl: 1000 };
|
|
2794
|
+
const getCdpMlWorkspaceCollectionMetadata = { apiFamily: 'cdpmachine-learning', name: 'getCdpMlWorkspaceCollection', ttl: 1000 };
|
|
2795
|
+
function bindExportsTo(luvio) {
|
|
2796
|
+
// LDS Adapters
|
|
2797
|
+
const getCdpMlConfiguredModel_ldsAdapter = createInstrumentedAdapter(createLDSAdapter(luvio, 'getCdpMlConfiguredModel', getCdpMlConfiguredModelAdapterFactory), getCdpMlConfiguredModelMetadata);
|
|
2798
|
+
const getCdpMlConfiguredModelCollection_ldsAdapter = createInstrumentedAdapter(createLDSAdapter(luvio, 'getCdpMlConfiguredModelCollection', getCdpMlConfiguredModelCollectionAdapterFactory), getCdpMlConfiguredModelCollectionMetadata);
|
|
2799
|
+
const getCdpMlModelArtifact_ldsAdapter = createInstrumentedAdapter(createLDSAdapter(luvio, 'getCdpMlModelArtifact', getCdpMlModelArtifactAdapterFactory), getCdpMlModelArtifactMetadata);
|
|
2800
|
+
const getCdpMlModelArtifactCollection_ldsAdapter = createInstrumentedAdapter(createLDSAdapter(luvio, 'getCdpMlModelArtifactCollection', getCdpMlModelArtifactCollectionAdapterFactory), getCdpMlModelArtifactCollectionMetadata);
|
|
2801
|
+
const getCdpMlWorkspace_ldsAdapter = createInstrumentedAdapter(createLDSAdapter(luvio, 'getCdpMlWorkspace', getCdpMlWorkspaceAdapterFactory), getCdpMlWorkspaceMetadata);
|
|
2802
|
+
const getCdpMlWorkspaceCollection_ldsAdapter = createInstrumentedAdapter(createLDSAdapter(luvio, 'getCdpMlWorkspaceCollection', getCdpMlWorkspaceCollectionAdapterFactory), getCdpMlWorkspaceCollectionMetadata);
|
|
2803
|
+
function unwrapSnapshotData(factory) {
|
|
2804
|
+
const adapter = factory(luvio);
|
|
2805
|
+
return (config) => adapter(config).then(snapshot => snapshot.data);
|
|
2806
|
+
}
|
|
2807
|
+
return {
|
|
2808
|
+
createCdpMlConfiguredModelCollection: unwrapSnapshotData(createCdpMlConfiguredModelCollectionAdapterFactory),
|
|
2809
|
+
getCdpMlConfiguredModel: createWireAdapterConstructor(luvio, getCdpMlConfiguredModel_ldsAdapter, getCdpMlConfiguredModelMetadata),
|
|
2810
|
+
getCdpMlConfiguredModelCollection: createWireAdapterConstructor(luvio, getCdpMlConfiguredModelCollection_ldsAdapter, getCdpMlConfiguredModelCollectionMetadata),
|
|
2811
|
+
getCdpMlModelArtifact: createWireAdapterConstructor(luvio, getCdpMlModelArtifact_ldsAdapter, getCdpMlModelArtifactMetadata),
|
|
2812
|
+
getCdpMlModelArtifactCollection: createWireAdapterConstructor(luvio, getCdpMlModelArtifactCollection_ldsAdapter, getCdpMlModelArtifactCollectionMetadata),
|
|
2813
|
+
getCdpMlWorkspace: createWireAdapterConstructor(luvio, getCdpMlWorkspace_ldsAdapter, getCdpMlWorkspaceMetadata),
|
|
2814
|
+
getCdpMlWorkspaceCollection: createWireAdapterConstructor(luvio, getCdpMlWorkspaceCollection_ldsAdapter, getCdpMlWorkspaceCollectionMetadata),
|
|
2815
|
+
getCdpMlWorkspaceNotifyChange: createLDSAdapter(luvio, 'getCdpMlWorkspaceNotifyChange', notifyChangeFactory),
|
|
2816
|
+
updateCdpMlConfiguredModel: unwrapSnapshotData(updateCdpMlConfiguredModelAdapterFactory),
|
|
2817
|
+
// Imperative GET Adapters
|
|
2818
|
+
getCdpMlConfiguredModel_imperative: createImperativeAdapter(luvio, getCdpMlConfiguredModel_ldsAdapter, getCdpMlConfiguredModelMetadata),
|
|
2819
|
+
getCdpMlConfiguredModelCollection_imperative: createImperativeAdapter(luvio, getCdpMlConfiguredModelCollection_ldsAdapter, getCdpMlConfiguredModelCollectionMetadata),
|
|
2820
|
+
getCdpMlModelArtifact_imperative: createImperativeAdapter(luvio, getCdpMlModelArtifact_ldsAdapter, getCdpMlModelArtifactMetadata),
|
|
2821
|
+
getCdpMlModelArtifactCollection_imperative: createImperativeAdapter(luvio, getCdpMlModelArtifactCollection_ldsAdapter, getCdpMlModelArtifactCollectionMetadata),
|
|
2822
|
+
getCdpMlWorkspace_imperative: createImperativeAdapter(luvio, getCdpMlWorkspace_ldsAdapter, getCdpMlWorkspaceMetadata),
|
|
2823
|
+
getCdpMlWorkspaceCollection_imperative: createImperativeAdapter(luvio, getCdpMlWorkspaceCollection_ldsAdapter, getCdpMlWorkspaceCollectionMetadata)
|
|
2824
|
+
};
|
|
2825
|
+
}
|
|
2826
|
+
withDefaultLuvio((luvio) => {
|
|
2827
|
+
({
|
|
2828
|
+
createCdpMlConfiguredModelCollection,
|
|
2829
|
+
getCdpMlConfiguredModel,
|
|
2830
|
+
getCdpMlConfiguredModelCollection,
|
|
2831
|
+
getCdpMlModelArtifact,
|
|
2832
|
+
getCdpMlModelArtifactCollection,
|
|
2833
|
+
getCdpMlWorkspace,
|
|
2834
|
+
getCdpMlWorkspaceCollection,
|
|
2835
|
+
getCdpMlWorkspaceNotifyChange,
|
|
2836
|
+
updateCdpMlConfiguredModel,
|
|
2837
|
+
getCdpMlConfiguredModel_imperative,
|
|
2838
|
+
getCdpMlConfiguredModelCollection_imperative,
|
|
2839
|
+
getCdpMlModelArtifact_imperative,
|
|
2840
|
+
getCdpMlModelArtifactCollection_imperative,
|
|
2841
|
+
getCdpMlWorkspace_imperative,
|
|
2842
|
+
getCdpMlWorkspaceCollection_imperative
|
|
2843
|
+
} = bindExportsTo(luvio));
|
|
2844
|
+
});
|
|
2845
|
+
|
|
2846
|
+
export { createCdpMlConfiguredModelCollection, getCdpMlConfiguredModel, getCdpMlConfiguredModelCollection, getCdpMlConfiguredModelCollection_imperative, getCdpMlConfiguredModel_imperative, getCdpMlModelArtifact, getCdpMlModelArtifactCollection, getCdpMlModelArtifactCollection_imperative, getCdpMlModelArtifact_imperative, getCdpMlWorkspace, getCdpMlWorkspaceCollection, getCdpMlWorkspaceCollection_imperative, getCdpMlWorkspaceNotifyChange, getCdpMlWorkspace_imperative, updateCdpMlConfiguredModel };
|
|
2847
|
+
// version: 1.256.0-fb019fbad
|