@salesforce/lds-adapters-cdp-metadata 0.1.0-dev1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE.txt +82 -0
- package/dist/es/es2018/cdp-metadata.js +885 -0
- package/dist/es/es2018/types/src/generated/adapters/adapter-utils.d.ts +62 -0
- package/dist/es/es2018/types/src/generated/adapters/getAllMetadata.d.ts +30 -0
- package/dist/es/es2018/types/src/generated/adapters/getDataGraphMetadata.d.ts +28 -0
- package/dist/es/es2018/types/src/generated/artifacts/main.d.ts +2 -0
- package/dist/es/es2018/types/src/generated/artifacts/sfdc.d.ts +5 -0
- package/dist/es/es2018/types/src/generated/resources/getSsotDataGraphsMetadata.d.ts +16 -0
- package/dist/es/es2018/types/src/generated/resources/getSsotMetadata.d.ts +18 -0
- package/dist/es/es2018/types/src/generated/types/CdpDgMetadataRepresentation.d.ts +29 -0
- package/dist/es/es2018/types/src/generated/types/CdpQueryDataGraphMetadataRepresentation.d.ts +64 -0
- package/dist/es/es2018/types/src/generated/types/CdpQueryMetadataOutputRepresentation.d.ts +28 -0
- package/dist/es/es2018/types/src/generated/types/DataGraphFieldRepresentation.d.ts +55 -0
- package/dist/es/es2018/types/src/generated/types/DataGraphIdsDmoFieldRepresentation.d.ts +34 -0
- package/dist/es/es2018/types/src/generated/types/DataGraphIdsDmoRepresentation.d.ts +32 -0
- package/dist/es/es2018/types/src/generated/types/DataGraphObjectDataRepresentation.d.ts +55 -0
- package/dist/es/es2018/types/src/generated/types/DataGraphRelationshipRepresentation.d.ts +34 -0
- package/dist/es/es2018/types/src/generated/types/DataGraphValuesDmoFieldRepresentation.d.ts +34 -0
- package/dist/es/es2018/types/src/generated/types/DataGraphValuesDmoRepresentation.d.ts +32 -0
- package/dist/es/es2018/types/src/generated/types/RecencyCriteriaRepresentation.d.ts +37 -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 +927 -0
- package/src/raml/api.raml +288 -0
- package/src/raml/luvio.raml +24 -0
package/sfdc/index.js
ADDED
|
@@ -0,0 +1,927 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Copyright (c) 2022, Salesforce, Inc.,
|
|
3
|
+
* All rights reserved.
|
|
4
|
+
* For full license text, see the LICENSE.txt file
|
|
5
|
+
*/
|
|
6
|
+
|
|
7
|
+
/*
|
|
8
|
+
* ATTENTION!
|
|
9
|
+
* THIS IS A GENERATED FILE FROM https://github.com/salesforce-experience-platform-emu/lds-lightning-platform
|
|
10
|
+
* If you would like to contribute to LDS, please follow the steps outlined in the git repo.
|
|
11
|
+
* Any changes made to this file in p4 will be automatically overwritten.
|
|
12
|
+
* *******************************************************************************************
|
|
13
|
+
*/
|
|
14
|
+
/* proxy-compat-disable */
|
|
15
|
+
import { createInstrumentedAdapter, createLDSAdapter, createWireAdapterConstructor, createImperativeAdapter } from 'force/ldsBindings';
|
|
16
|
+
import { withDefaultLuvio } from 'force/ldsEngine';
|
|
17
|
+
import { serializeStructuredKey, ingestShape, deepFreeze, buildNetworkSnapshotCachePolicy as buildNetworkSnapshotCachePolicy$2, typeCheckConfig as typeCheckConfig$2, StoreKeyMap, createResourceParams as createResourceParams$2 } 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-metadata';
|
|
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
|
+
const VERSION$1 = "21dc23f3b30fa0daeb25fca386243e68";
|
|
93
|
+
function validate$a(obj, path = 'CdpQueryMetadataOutputRepresentation') {
|
|
94
|
+
const v_error = (() => {
|
|
95
|
+
if (typeof obj !== 'object' || ArrayIsArray(obj) || obj === null) {
|
|
96
|
+
return new TypeError('Expected "object" but received "' + typeof obj + '" (at "' + path + '")');
|
|
97
|
+
}
|
|
98
|
+
const obj_metadata = obj.metadata;
|
|
99
|
+
const path_metadata = path + '.metadata';
|
|
100
|
+
if (!ArrayIsArray(obj_metadata)) {
|
|
101
|
+
return new TypeError('Expected "array" but received "' + typeof obj_metadata + '" (at "' + path_metadata + '")');
|
|
102
|
+
}
|
|
103
|
+
for (let i = 0; i < obj_metadata.length; i++) {
|
|
104
|
+
const obj_metadata_item = obj_metadata[i];
|
|
105
|
+
const path_metadata_item = path_metadata + '[' + i + ']';
|
|
106
|
+
if (obj_metadata_item === undefined) {
|
|
107
|
+
return new TypeError('Expected "defined" but received "' + typeof obj_metadata_item + '" (at "' + path_metadata_item + '")');
|
|
108
|
+
}
|
|
109
|
+
}
|
|
110
|
+
})();
|
|
111
|
+
return v_error === undefined ? null : v_error;
|
|
112
|
+
}
|
|
113
|
+
const RepresentationType$1 = 'CdpQueryMetadataOutputRepresentation';
|
|
114
|
+
function normalize$1(input, existing, path, luvio, store, timestamp) {
|
|
115
|
+
return input;
|
|
116
|
+
}
|
|
117
|
+
const select$3 = function CdpQueryMetadataOutputRepresentationSelect() {
|
|
118
|
+
return {
|
|
119
|
+
kind: 'Fragment',
|
|
120
|
+
version: VERSION$1,
|
|
121
|
+
private: [],
|
|
122
|
+
opaque: true
|
|
123
|
+
};
|
|
124
|
+
};
|
|
125
|
+
function equals$1(existing, incoming) {
|
|
126
|
+
if (JSONStringify(incoming) !== JSONStringify(existing)) {
|
|
127
|
+
return false;
|
|
128
|
+
}
|
|
129
|
+
return true;
|
|
130
|
+
}
|
|
131
|
+
const ingest$1 = function CdpQueryMetadataOutputRepresentationIngest(input, path, luvio, store, timestamp) {
|
|
132
|
+
if (process.env.NODE_ENV !== 'production') {
|
|
133
|
+
const validateError = validate$a(input);
|
|
134
|
+
if (validateError !== null) {
|
|
135
|
+
throw validateError;
|
|
136
|
+
}
|
|
137
|
+
}
|
|
138
|
+
const key = path.fullPath;
|
|
139
|
+
const ttlToUse = path.ttl !== undefined ? path.ttl : 3000000;
|
|
140
|
+
ingestShape(input, path, luvio, store, timestamp, ttlToUse, key, normalize$1, "cdp-metadata", VERSION$1, RepresentationType$1, equals$1);
|
|
141
|
+
return createLink(key);
|
|
142
|
+
};
|
|
143
|
+
function getTypeCacheKeys$1(rootKeySet, luvio, input, fullPathFactory) {
|
|
144
|
+
// root cache key (uses fullPathFactory if keyBuilderFromType isn't defined)
|
|
145
|
+
const rootKey = fullPathFactory();
|
|
146
|
+
rootKeySet.set(rootKey, {
|
|
147
|
+
namespace: keyPrefix,
|
|
148
|
+
representationName: RepresentationType$1,
|
|
149
|
+
mergeable: false
|
|
150
|
+
});
|
|
151
|
+
}
|
|
152
|
+
|
|
153
|
+
function select$2(luvio, params) {
|
|
154
|
+
return select$3();
|
|
155
|
+
}
|
|
156
|
+
function keyBuilder$3(luvio, params) {
|
|
157
|
+
return keyPrefix + '::CdpQueryMetadataOutputRepresentation:(' + 'dataspace:' + params.queryParams.dataspace + ',' + 'entityCategory:' + params.queryParams.entityCategory + ',' + 'entityName:' + params.queryParams.entityName + ',' + 'entityType:' + params.queryParams.entityType + ')';
|
|
158
|
+
}
|
|
159
|
+
function getResponseCacheKeys$1(storeKeyMap, luvio, resourceParams, response) {
|
|
160
|
+
getTypeCacheKeys$1(storeKeyMap, luvio, response, () => keyBuilder$3(luvio, resourceParams));
|
|
161
|
+
}
|
|
162
|
+
function ingestSuccess$1(luvio, resourceParams, response, snapshotRefresh) {
|
|
163
|
+
const { body } = response;
|
|
164
|
+
const key = keyBuilder$3(luvio, resourceParams);
|
|
165
|
+
luvio.storeIngest(key, ingest$1, body);
|
|
166
|
+
const snapshot = luvio.storeLookup({
|
|
167
|
+
recordId: key,
|
|
168
|
+
node: select$2(),
|
|
169
|
+
variables: {},
|
|
170
|
+
}, snapshotRefresh);
|
|
171
|
+
if (process.env.NODE_ENV !== 'production') {
|
|
172
|
+
if (snapshot.state !== 'Fulfilled') {
|
|
173
|
+
throw new Error('Invalid network response. Expected resource response to result in Fulfilled snapshot');
|
|
174
|
+
}
|
|
175
|
+
}
|
|
176
|
+
deepFreeze(snapshot.data);
|
|
177
|
+
return snapshot;
|
|
178
|
+
}
|
|
179
|
+
function ingestError$1(luvio, params, error, snapshotRefresh) {
|
|
180
|
+
const key = keyBuilder$3(luvio, params);
|
|
181
|
+
const errorSnapshot = luvio.errorSnapshot(error, snapshotRefresh);
|
|
182
|
+
luvio.storeIngestError(key, errorSnapshot);
|
|
183
|
+
return errorSnapshot;
|
|
184
|
+
}
|
|
185
|
+
function createResourceRequest$1(config) {
|
|
186
|
+
const headers = {};
|
|
187
|
+
return {
|
|
188
|
+
baseUri: '/services/data/v66.0',
|
|
189
|
+
basePath: '/ssot/metadata',
|
|
190
|
+
method: 'get',
|
|
191
|
+
body: null,
|
|
192
|
+
urlParams: {},
|
|
193
|
+
queryParams: config.queryParams,
|
|
194
|
+
headers,
|
|
195
|
+
priority: 'normal',
|
|
196
|
+
};
|
|
197
|
+
}
|
|
198
|
+
|
|
199
|
+
const adapterName$1 = 'getAllMetadata';
|
|
200
|
+
const getAllMetadata_ConfigPropertyMetadata = [
|
|
201
|
+
generateParamConfigMetadata('dataspace', false, 1 /* QueryParameter */, 0 /* String */),
|
|
202
|
+
generateParamConfigMetadata('entityCategory', false, 1 /* QueryParameter */, 0 /* String */),
|
|
203
|
+
generateParamConfigMetadata('entityName', false, 1 /* QueryParameter */, 0 /* String */),
|
|
204
|
+
generateParamConfigMetadata('entityType', false, 1 /* QueryParameter */, 0 /* String */),
|
|
205
|
+
];
|
|
206
|
+
const getAllMetadata_ConfigPropertyNames = /*#__PURE__*/ buildAdapterValidationConfig(adapterName$1, getAllMetadata_ConfigPropertyMetadata);
|
|
207
|
+
const createResourceParams$1 = /*#__PURE__*/ createResourceParams$2(getAllMetadata_ConfigPropertyMetadata);
|
|
208
|
+
function keyBuilder$2(luvio, config) {
|
|
209
|
+
const resourceParams = createResourceParams$1(config);
|
|
210
|
+
return keyBuilder$3(luvio, resourceParams);
|
|
211
|
+
}
|
|
212
|
+
function typeCheckConfig$1(untrustedConfig) {
|
|
213
|
+
const config = {};
|
|
214
|
+
typeCheckConfig$2(untrustedConfig, config, getAllMetadata_ConfigPropertyMetadata);
|
|
215
|
+
return config;
|
|
216
|
+
}
|
|
217
|
+
function validateAdapterConfig$1(untrustedConfig, configPropertyNames) {
|
|
218
|
+
if (!untrustedIsObject(untrustedConfig)) {
|
|
219
|
+
return null;
|
|
220
|
+
}
|
|
221
|
+
if (process.env.NODE_ENV !== 'production') {
|
|
222
|
+
validateConfig(untrustedConfig, configPropertyNames);
|
|
223
|
+
}
|
|
224
|
+
const config = typeCheckConfig$1(untrustedConfig);
|
|
225
|
+
if (!areRequiredParametersPresent(config, configPropertyNames)) {
|
|
226
|
+
return null;
|
|
227
|
+
}
|
|
228
|
+
return config;
|
|
229
|
+
}
|
|
230
|
+
function adapterFragment$1(luvio, config) {
|
|
231
|
+
createResourceParams$1(config);
|
|
232
|
+
return select$2();
|
|
233
|
+
}
|
|
234
|
+
function onFetchResponseSuccess$1(luvio, config, resourceParams, response) {
|
|
235
|
+
const snapshot = ingestSuccess$1(luvio, resourceParams, response, {
|
|
236
|
+
config,
|
|
237
|
+
resolve: () => buildNetworkSnapshot$1(luvio, config, snapshotRefreshOptions)
|
|
238
|
+
});
|
|
239
|
+
return luvio.storeBroadcast().then(() => snapshot);
|
|
240
|
+
}
|
|
241
|
+
function onFetchResponseError$1(luvio, config, resourceParams, response) {
|
|
242
|
+
const snapshot = ingestError$1(luvio, resourceParams, response, {
|
|
243
|
+
config,
|
|
244
|
+
resolve: () => buildNetworkSnapshot$1(luvio, config, snapshotRefreshOptions)
|
|
245
|
+
});
|
|
246
|
+
return luvio.storeBroadcast().then(() => snapshot);
|
|
247
|
+
}
|
|
248
|
+
function buildNetworkSnapshot$1(luvio, config, options) {
|
|
249
|
+
const resourceParams = createResourceParams$1(config);
|
|
250
|
+
const request = createResourceRequest$1(resourceParams);
|
|
251
|
+
return luvio.dispatchResourceRequest(request, options)
|
|
252
|
+
.then((response) => {
|
|
253
|
+
return luvio.handleSuccessResponse(() => onFetchResponseSuccess$1(luvio, config, resourceParams, response), () => {
|
|
254
|
+
const cache = new StoreKeyMap();
|
|
255
|
+
getResponseCacheKeys$1(cache, luvio, resourceParams, response.body);
|
|
256
|
+
return cache;
|
|
257
|
+
});
|
|
258
|
+
}, (response) => {
|
|
259
|
+
return luvio.handleErrorResponse(() => onFetchResponseError$1(luvio, config, resourceParams, response));
|
|
260
|
+
});
|
|
261
|
+
}
|
|
262
|
+
function buildNetworkSnapshotCachePolicy$1(context, coercedAdapterRequestContext) {
|
|
263
|
+
return buildNetworkSnapshotCachePolicy$2(context, coercedAdapterRequestContext, buildNetworkSnapshot$1, undefined, false);
|
|
264
|
+
}
|
|
265
|
+
function buildCachedSnapshotCachePolicy$1(context, storeLookup) {
|
|
266
|
+
const { luvio, config } = context;
|
|
267
|
+
const selector = {
|
|
268
|
+
recordId: keyBuilder$2(luvio, config),
|
|
269
|
+
node: adapterFragment$1(luvio, config),
|
|
270
|
+
variables: {},
|
|
271
|
+
};
|
|
272
|
+
const cacheSnapshot = storeLookup(selector, {
|
|
273
|
+
config,
|
|
274
|
+
resolve: () => buildNetworkSnapshot$1(luvio, config, snapshotRefreshOptions)
|
|
275
|
+
});
|
|
276
|
+
return cacheSnapshot;
|
|
277
|
+
}
|
|
278
|
+
const getAllMetadataAdapterFactory = (luvio) => function cdpMetadata__getAllMetadata(untrustedConfig, requestContext) {
|
|
279
|
+
const config = validateAdapterConfig$1(untrustedConfig, getAllMetadata_ConfigPropertyNames);
|
|
280
|
+
// Invalid or incomplete config
|
|
281
|
+
if (config === null) {
|
|
282
|
+
return null;
|
|
283
|
+
}
|
|
284
|
+
return luvio.applyCachePolicy((requestContext || {}), { config, luvio }, // BuildSnapshotContext
|
|
285
|
+
buildCachedSnapshotCachePolicy$1, buildNetworkSnapshotCachePolicy$1);
|
|
286
|
+
};
|
|
287
|
+
|
|
288
|
+
function validate$9(obj, path = 'DataGraphFieldRepresentation') {
|
|
289
|
+
const v_error = (() => {
|
|
290
|
+
if (typeof obj !== 'object' || ArrayIsArray(obj) || obj === null) {
|
|
291
|
+
return new TypeError('Expected "object" but received "' + typeof obj + '" (at "' + path + '")');
|
|
292
|
+
}
|
|
293
|
+
if (obj.ciFieldType !== undefined) {
|
|
294
|
+
const obj_ciFieldType = obj.ciFieldType;
|
|
295
|
+
const path_ciFieldType = path + '.ciFieldType';
|
|
296
|
+
if (typeof obj_ciFieldType !== 'string') {
|
|
297
|
+
return new TypeError('Expected "string" but received "' + typeof obj_ciFieldType + '" (at "' + path_ciFieldType + '")');
|
|
298
|
+
}
|
|
299
|
+
}
|
|
300
|
+
const obj_dataGraphFieldDevName = obj.dataGraphFieldDevName;
|
|
301
|
+
const path_dataGraphFieldDevName = path + '.dataGraphFieldDevName';
|
|
302
|
+
if (typeof obj_dataGraphFieldDevName !== 'string') {
|
|
303
|
+
return new TypeError('Expected "string" but received "' + typeof obj_dataGraphFieldDevName + '" (at "' + path_dataGraphFieldDevName + '")');
|
|
304
|
+
}
|
|
305
|
+
const obj_dataType = obj.dataType;
|
|
306
|
+
const path_dataType = path + '.dataType';
|
|
307
|
+
if (typeof obj_dataType !== 'string') {
|
|
308
|
+
return new TypeError('Expected "string" but received "' + typeof obj_dataType + '" (at "' + path_dataType + '")');
|
|
309
|
+
}
|
|
310
|
+
const obj_developerName = obj.developerName;
|
|
311
|
+
const path_developerName = path + '.developerName';
|
|
312
|
+
if (typeof obj_developerName !== 'string') {
|
|
313
|
+
return new TypeError('Expected "string" but received "' + typeof obj_developerName + '" (at "' + path_developerName + '")');
|
|
314
|
+
}
|
|
315
|
+
const obj_isProjected = obj.isProjected;
|
|
316
|
+
const path_isProjected = path + '.isProjected';
|
|
317
|
+
if (typeof obj_isProjected !== 'string') {
|
|
318
|
+
return new TypeError('Expected "string" but received "' + typeof obj_isProjected + '" (at "' + path_isProjected + '")');
|
|
319
|
+
}
|
|
320
|
+
const obj_keyCol = obj.keyCol;
|
|
321
|
+
const path_keyCol = path + '.keyCol';
|
|
322
|
+
if (typeof obj_keyCol !== 'string') {
|
|
323
|
+
return new TypeError('Expected "string" but received "' + typeof obj_keyCol + '" (at "' + path_keyCol + '")');
|
|
324
|
+
}
|
|
325
|
+
const obj_keyQualifierName = obj.keyQualifierName;
|
|
326
|
+
const path_keyQualifierName = path + '.keyQualifierName';
|
|
327
|
+
if (typeof obj_keyQualifierName !== 'string') {
|
|
328
|
+
return new TypeError('Expected "string" but received "' + typeof obj_keyQualifierName + '" (at "' + path_keyQualifierName + '")');
|
|
329
|
+
}
|
|
330
|
+
const obj_length = obj.length;
|
|
331
|
+
const path_length = path + '.length';
|
|
332
|
+
if (typeof obj_length !== 'string') {
|
|
333
|
+
return new TypeError('Expected "string" but received "' + typeof obj_length + '" (at "' + path_length + '")');
|
|
334
|
+
}
|
|
335
|
+
const obj_lookupCol = obj.lookupCol;
|
|
336
|
+
const path_lookupCol = path + '.lookupCol';
|
|
337
|
+
if (typeof obj_lookupCol !== 'string') {
|
|
338
|
+
return new TypeError('Expected "string" but received "' + typeof obj_lookupCol + '" (at "' + path_lookupCol + '")');
|
|
339
|
+
}
|
|
340
|
+
const obj_usageTag = obj.usageTag;
|
|
341
|
+
const path_usageTag = path + '.usageTag';
|
|
342
|
+
if (typeof obj_usageTag !== 'string') {
|
|
343
|
+
return new TypeError('Expected "string" but received "' + typeof obj_usageTag + '" (at "' + path_usageTag + '")');
|
|
344
|
+
}
|
|
345
|
+
})();
|
|
346
|
+
return v_error === undefined ? null : v_error;
|
|
347
|
+
}
|
|
348
|
+
|
|
349
|
+
function validate$8(obj, path = 'DataGraphRelationshipRepresentation') {
|
|
350
|
+
const v_error = (() => {
|
|
351
|
+
if (typeof obj !== 'object' || ArrayIsArray(obj) || obj === null) {
|
|
352
|
+
return new TypeError('Expected "object" but received "' + typeof obj + '" (at "' + path + '")');
|
|
353
|
+
}
|
|
354
|
+
const obj_cardinality = obj.cardinality;
|
|
355
|
+
const path_cardinality = path + '.cardinality';
|
|
356
|
+
if (typeof obj_cardinality !== 'string') {
|
|
357
|
+
return new TypeError('Expected "string" but received "' + typeof obj_cardinality + '" (at "' + path_cardinality + '")');
|
|
358
|
+
}
|
|
359
|
+
const obj_fieldName = obj.fieldName;
|
|
360
|
+
const path_fieldName = path + '.fieldName';
|
|
361
|
+
if (typeof obj_fieldName !== 'string') {
|
|
362
|
+
return new TypeError('Expected "string" but received "' + typeof obj_fieldName + '" (at "' + path_fieldName + '")');
|
|
363
|
+
}
|
|
364
|
+
const obj_parentFieldName = obj.parentFieldName;
|
|
365
|
+
const path_parentFieldName = path + '.parentFieldName';
|
|
366
|
+
if (typeof obj_parentFieldName !== 'string') {
|
|
367
|
+
return new TypeError('Expected "string" but received "' + typeof obj_parentFieldName + '" (at "' + path_parentFieldName + '")');
|
|
368
|
+
}
|
|
369
|
+
})();
|
|
370
|
+
return v_error === undefined ? null : v_error;
|
|
371
|
+
}
|
|
372
|
+
|
|
373
|
+
function validate$7(obj, path = 'RecencyCriteriaRepresentation') {
|
|
374
|
+
const v_error = (() => {
|
|
375
|
+
if (typeof obj !== 'object' || ArrayIsArray(obj) || obj === null) {
|
|
376
|
+
return new TypeError('Expected "object" but received "' + typeof obj + '" (at "' + path + '")');
|
|
377
|
+
}
|
|
378
|
+
const obj_fieldName = obj.fieldName;
|
|
379
|
+
const path_fieldName = path + '.fieldName';
|
|
380
|
+
if (typeof obj_fieldName !== 'string') {
|
|
381
|
+
return new TypeError('Expected "string" but received "' + typeof obj_fieldName + '" (at "' + path_fieldName + '")');
|
|
382
|
+
}
|
|
383
|
+
const obj_value = obj.value;
|
|
384
|
+
const path_value = path + '.value';
|
|
385
|
+
if (typeof obj_value !== 'string') {
|
|
386
|
+
return new TypeError('Expected "string" but received "' + typeof obj_value + '" (at "' + path_value + '")');
|
|
387
|
+
}
|
|
388
|
+
const obj_valueType = obj.valueType;
|
|
389
|
+
const path_valueType = path + '.valueType';
|
|
390
|
+
if (typeof obj_valueType !== 'string') {
|
|
391
|
+
return new TypeError('Expected "string" but received "' + typeof obj_valueType + '" (at "' + path_valueType + '")');
|
|
392
|
+
}
|
|
393
|
+
const obj_valueUnit = obj.valueUnit;
|
|
394
|
+
const path_valueUnit = path + '.valueUnit';
|
|
395
|
+
if (typeof obj_valueUnit !== 'string') {
|
|
396
|
+
return new TypeError('Expected "string" but received "' + typeof obj_valueUnit + '" (at "' + path_valueUnit + '")');
|
|
397
|
+
}
|
|
398
|
+
})();
|
|
399
|
+
return v_error === undefined ? null : v_error;
|
|
400
|
+
}
|
|
401
|
+
|
|
402
|
+
function validate$6(obj, path = 'DataGraphObjectDataRepresentation') {
|
|
403
|
+
const v_error = (() => {
|
|
404
|
+
if (typeof obj !== 'object' || ArrayIsArray(obj) || obj === null) {
|
|
405
|
+
return new TypeError('Expected "object" but received "' + typeof obj + '" (at "' + path + '")');
|
|
406
|
+
}
|
|
407
|
+
const obj_dataGraphSourceDevName = obj.dataGraphSourceDevName;
|
|
408
|
+
const path_dataGraphSourceDevName = path + '.dataGraphSourceDevName';
|
|
409
|
+
if (typeof obj_dataGraphSourceDevName !== 'string') {
|
|
410
|
+
return new TypeError('Expected "string" but received "' + typeof obj_dataGraphSourceDevName + '" (at "' + path_dataGraphSourceDevName + '")');
|
|
411
|
+
}
|
|
412
|
+
const obj_developerName = obj.developerName;
|
|
413
|
+
const path_developerName = path + '.developerName';
|
|
414
|
+
if (typeof obj_developerName !== 'string') {
|
|
415
|
+
return new TypeError('Expected "string" but received "' + typeof obj_developerName + '" (at "' + path_developerName + '")');
|
|
416
|
+
}
|
|
417
|
+
const obj_fields = obj.fields;
|
|
418
|
+
const path_fields = path + '.fields';
|
|
419
|
+
if (!ArrayIsArray(obj_fields)) {
|
|
420
|
+
return new TypeError('Expected "array" but received "' + typeof obj_fields + '" (at "' + path_fields + '")');
|
|
421
|
+
}
|
|
422
|
+
for (let i = 0; i < obj_fields.length; i++) {
|
|
423
|
+
const obj_fields_item = obj_fields[i];
|
|
424
|
+
const path_fields_item = path_fields + '[' + i + ']';
|
|
425
|
+
const referencepath_fields_itemValidationError = validate$9(obj_fields_item, path_fields_item);
|
|
426
|
+
if (referencepath_fields_itemValidationError !== null) {
|
|
427
|
+
let message = 'Object doesn\'t match DataGraphFieldRepresentation (at "' + path_fields_item + '")\n';
|
|
428
|
+
message += referencepath_fields_itemValidationError.message.split('\n').map((line) => '\t' + line).join('\n');
|
|
429
|
+
return new TypeError(message);
|
|
430
|
+
}
|
|
431
|
+
}
|
|
432
|
+
const obj_filterCriteria = obj.filterCriteria;
|
|
433
|
+
const path_filterCriteria = path + '.filterCriteria';
|
|
434
|
+
if (typeof obj_filterCriteria !== 'string') {
|
|
435
|
+
return new TypeError('Expected "string" but received "' + typeof obj_filterCriteria + '" (at "' + path_filterCriteria + '")');
|
|
436
|
+
}
|
|
437
|
+
const obj_memberDmoName = obj.memberDmoName;
|
|
438
|
+
const path_memberDmoName = path + '.memberDmoName';
|
|
439
|
+
if (typeof obj_memberDmoName !== 'string') {
|
|
440
|
+
return new TypeError('Expected "string" but received "' + typeof obj_memberDmoName + '" (at "' + path_memberDmoName + '")');
|
|
441
|
+
}
|
|
442
|
+
const obj_paths = obj.paths;
|
|
443
|
+
const path_paths = path + '.paths';
|
|
444
|
+
if (!ArrayIsArray(obj_paths)) {
|
|
445
|
+
return new TypeError('Expected "array" but received "' + typeof obj_paths + '" (at "' + path_paths + '")');
|
|
446
|
+
}
|
|
447
|
+
for (let i = 0; i < obj_paths.length; i++) {
|
|
448
|
+
const obj_paths_item = obj_paths[i];
|
|
449
|
+
const path_paths_item = path_paths + '[' + i + ']';
|
|
450
|
+
const referencepath_paths_itemValidationError = validate$8(obj_paths_item, path_paths_item);
|
|
451
|
+
if (referencepath_paths_itemValidationError !== null) {
|
|
452
|
+
let message = 'Object doesn\'t match DataGraphRelationshipRepresentation (at "' + path_paths_item + '")\n';
|
|
453
|
+
message += referencepath_paths_itemValidationError.message.split('\n').map((line) => '\t' + line).join('\n');
|
|
454
|
+
return new TypeError(message);
|
|
455
|
+
}
|
|
456
|
+
}
|
|
457
|
+
const obj_recencyCriteria = obj.recencyCriteria;
|
|
458
|
+
const path_recencyCriteria = path + '.recencyCriteria';
|
|
459
|
+
if (!ArrayIsArray(obj_recencyCriteria)) {
|
|
460
|
+
return new TypeError('Expected "array" but received "' + typeof obj_recencyCriteria + '" (at "' + path_recencyCriteria + '")');
|
|
461
|
+
}
|
|
462
|
+
for (let i = 0; i < obj_recencyCriteria.length; i++) {
|
|
463
|
+
const obj_recencyCriteria_item = obj_recencyCriteria[i];
|
|
464
|
+
const path_recencyCriteria_item = path_recencyCriteria + '[' + i + ']';
|
|
465
|
+
const referencepath_recencyCriteria_itemValidationError = validate$7(obj_recencyCriteria_item, path_recencyCriteria_item);
|
|
466
|
+
if (referencepath_recencyCriteria_itemValidationError !== null) {
|
|
467
|
+
let message = 'Object doesn\'t match RecencyCriteriaRepresentation (at "' + path_recencyCriteria_item + '")\n';
|
|
468
|
+
message += referencepath_recencyCriteria_itemValidationError.message.split('\n').map((line) => '\t' + line).join('\n');
|
|
469
|
+
return new TypeError(message);
|
|
470
|
+
}
|
|
471
|
+
}
|
|
472
|
+
const obj_relatedObjects = obj.relatedObjects;
|
|
473
|
+
const path_relatedObjects = path + '.relatedObjects';
|
|
474
|
+
if (!ArrayIsArray(obj_relatedObjects)) {
|
|
475
|
+
return new TypeError('Expected "array" but received "' + typeof obj_relatedObjects + '" (at "' + path_relatedObjects + '")');
|
|
476
|
+
}
|
|
477
|
+
for (let i = 0; i < obj_relatedObjects.length; i++) {
|
|
478
|
+
const obj_relatedObjects_item = obj_relatedObjects[i];
|
|
479
|
+
const path_relatedObjects_item = path_relatedObjects + '[' + i + ']';
|
|
480
|
+
if (obj_relatedObjects_item === undefined) {
|
|
481
|
+
return new TypeError('Expected "defined" but received "' + typeof obj_relatedObjects_item + '" (at "' + path_relatedObjects_item + '")');
|
|
482
|
+
}
|
|
483
|
+
}
|
|
484
|
+
const obj_type = obj.type;
|
|
485
|
+
const path_type = path + '.type';
|
|
486
|
+
if (typeof obj_type !== 'string') {
|
|
487
|
+
return new TypeError('Expected "string" but received "' + typeof obj_type + '" (at "' + path_type + '")');
|
|
488
|
+
}
|
|
489
|
+
})();
|
|
490
|
+
return v_error === undefined ? null : v_error;
|
|
491
|
+
}
|
|
492
|
+
|
|
493
|
+
function validate$5(obj, path = 'DataGraphIdsDmoFieldRepresentation') {
|
|
494
|
+
const v_error = (() => {
|
|
495
|
+
if (typeof obj !== 'object' || ArrayIsArray(obj) || obj === null) {
|
|
496
|
+
return new TypeError('Expected "object" but received "' + typeof obj + '" (at "' + path + '")');
|
|
497
|
+
}
|
|
498
|
+
const obj_capabilities = obj.capabilities;
|
|
499
|
+
const path_capabilities = path + '.capabilities';
|
|
500
|
+
if (!ArrayIsArray(obj_capabilities)) {
|
|
501
|
+
return new TypeError('Expected "array" but received "' + typeof obj_capabilities + '" (at "' + path_capabilities + '")');
|
|
502
|
+
}
|
|
503
|
+
for (let i = 0; i < obj_capabilities.length; i++) {
|
|
504
|
+
const obj_capabilities_item = obj_capabilities[i];
|
|
505
|
+
const path_capabilities_item = path_capabilities + '[' + i + ']';
|
|
506
|
+
if (typeof obj_capabilities_item !== 'number' || (typeof obj_capabilities_item === 'number' && Math.floor(obj_capabilities_item) !== obj_capabilities_item)) {
|
|
507
|
+
return new TypeError('Expected "integer" but received "' + typeof obj_capabilities_item + '" (at "' + path_capabilities_item + '")');
|
|
508
|
+
}
|
|
509
|
+
}
|
|
510
|
+
const obj_dataType = obj.dataType;
|
|
511
|
+
const path_dataType = path + '.dataType';
|
|
512
|
+
if (typeof obj_dataType !== 'string') {
|
|
513
|
+
return new TypeError('Expected "string" but received "' + typeof obj_dataType + '" (at "' + path_dataType + '")');
|
|
514
|
+
}
|
|
515
|
+
const obj_developerName = obj.developerName;
|
|
516
|
+
const path_developerName = path + '.developerName';
|
|
517
|
+
if (typeof obj_developerName !== 'string') {
|
|
518
|
+
return new TypeError('Expected "string" but received "' + typeof obj_developerName + '" (at "' + path_developerName + '")');
|
|
519
|
+
}
|
|
520
|
+
})();
|
|
521
|
+
return v_error === undefined ? null : v_error;
|
|
522
|
+
}
|
|
523
|
+
|
|
524
|
+
function validate$4(obj, path = 'DataGraphIdsDmoRepresentation') {
|
|
525
|
+
const v_error = (() => {
|
|
526
|
+
if (typeof obj !== 'object' || ArrayIsArray(obj) || obj === null) {
|
|
527
|
+
return new TypeError('Expected "object" but received "' + typeof obj + '" (at "' + path + '")');
|
|
528
|
+
}
|
|
529
|
+
const obj_developerName = obj.developerName;
|
|
530
|
+
const path_developerName = path + '.developerName';
|
|
531
|
+
if (typeof obj_developerName !== 'string') {
|
|
532
|
+
return new TypeError('Expected "string" but received "' + typeof obj_developerName + '" (at "' + path_developerName + '")');
|
|
533
|
+
}
|
|
534
|
+
const obj_fields = obj.fields;
|
|
535
|
+
const path_fields = path + '.fields';
|
|
536
|
+
if (!ArrayIsArray(obj_fields)) {
|
|
537
|
+
return new TypeError('Expected "array" but received "' + typeof obj_fields + '" (at "' + path_fields + '")');
|
|
538
|
+
}
|
|
539
|
+
for (let i = 0; i < obj_fields.length; i++) {
|
|
540
|
+
const obj_fields_item = obj_fields[i];
|
|
541
|
+
const path_fields_item = path_fields + '[' + i + ']';
|
|
542
|
+
const referencepath_fields_itemValidationError = validate$5(obj_fields_item, path_fields_item);
|
|
543
|
+
if (referencepath_fields_itemValidationError !== null) {
|
|
544
|
+
let message = 'Object doesn\'t match DataGraphIdsDmoFieldRepresentation (at "' + path_fields_item + '")\n';
|
|
545
|
+
message += referencepath_fields_itemValidationError.message.split('\n').map((line) => '\t' + line).join('\n');
|
|
546
|
+
return new TypeError(message);
|
|
547
|
+
}
|
|
548
|
+
}
|
|
549
|
+
})();
|
|
550
|
+
return v_error === undefined ? null : v_error;
|
|
551
|
+
}
|
|
552
|
+
|
|
553
|
+
function validate$3(obj, path = 'DataGraphValuesDmoFieldRepresentation') {
|
|
554
|
+
const v_error = (() => {
|
|
555
|
+
if (typeof obj !== 'object' || ArrayIsArray(obj) || obj === null) {
|
|
556
|
+
return new TypeError('Expected "object" but received "' + typeof obj + '" (at "' + path + '")');
|
|
557
|
+
}
|
|
558
|
+
const obj_capabilities = obj.capabilities;
|
|
559
|
+
const path_capabilities = path + '.capabilities';
|
|
560
|
+
if (!ArrayIsArray(obj_capabilities)) {
|
|
561
|
+
return new TypeError('Expected "array" but received "' + typeof obj_capabilities + '" (at "' + path_capabilities + '")');
|
|
562
|
+
}
|
|
563
|
+
for (let i = 0; i < obj_capabilities.length; i++) {
|
|
564
|
+
const obj_capabilities_item = obj_capabilities[i];
|
|
565
|
+
const path_capabilities_item = path_capabilities + '[' + i + ']';
|
|
566
|
+
if (typeof obj_capabilities_item !== 'number' || (typeof obj_capabilities_item === 'number' && Math.floor(obj_capabilities_item) !== obj_capabilities_item)) {
|
|
567
|
+
return new TypeError('Expected "integer" but received "' + typeof obj_capabilities_item + '" (at "' + path_capabilities_item + '")');
|
|
568
|
+
}
|
|
569
|
+
}
|
|
570
|
+
const obj_dataType = obj.dataType;
|
|
571
|
+
const path_dataType = path + '.dataType';
|
|
572
|
+
if (typeof obj_dataType !== 'string') {
|
|
573
|
+
return new TypeError('Expected "string" but received "' + typeof obj_dataType + '" (at "' + path_dataType + '")');
|
|
574
|
+
}
|
|
575
|
+
const obj_developerName = obj.developerName;
|
|
576
|
+
const path_developerName = path + '.developerName';
|
|
577
|
+
if (typeof obj_developerName !== 'string') {
|
|
578
|
+
return new TypeError('Expected "string" but received "' + typeof obj_developerName + '" (at "' + path_developerName + '")');
|
|
579
|
+
}
|
|
580
|
+
})();
|
|
581
|
+
return v_error === undefined ? null : v_error;
|
|
582
|
+
}
|
|
583
|
+
|
|
584
|
+
function validate$2(obj, path = 'DataGraphValuesDmoRepresentation') {
|
|
585
|
+
const v_error = (() => {
|
|
586
|
+
if (typeof obj !== 'object' || ArrayIsArray(obj) || obj === null) {
|
|
587
|
+
return new TypeError('Expected "object" but received "' + typeof obj + '" (at "' + path + '")');
|
|
588
|
+
}
|
|
589
|
+
const obj_developerName = obj.developerName;
|
|
590
|
+
const path_developerName = path + '.developerName';
|
|
591
|
+
if (typeof obj_developerName !== 'string') {
|
|
592
|
+
return new TypeError('Expected "string" but received "' + typeof obj_developerName + '" (at "' + path_developerName + '")');
|
|
593
|
+
}
|
|
594
|
+
const obj_fields = obj.fields;
|
|
595
|
+
const path_fields = path + '.fields';
|
|
596
|
+
if (!ArrayIsArray(obj_fields)) {
|
|
597
|
+
return new TypeError('Expected "array" but received "' + typeof obj_fields + '" (at "' + path_fields + '")');
|
|
598
|
+
}
|
|
599
|
+
for (let i = 0; i < obj_fields.length; i++) {
|
|
600
|
+
const obj_fields_item = obj_fields[i];
|
|
601
|
+
const path_fields_item = path_fields + '[' + i + ']';
|
|
602
|
+
const referencepath_fields_itemValidationError = validate$3(obj_fields_item, path_fields_item);
|
|
603
|
+
if (referencepath_fields_itemValidationError !== null) {
|
|
604
|
+
let message = 'Object doesn\'t match DataGraphValuesDmoFieldRepresentation (at "' + path_fields_item + '")\n';
|
|
605
|
+
message += referencepath_fields_itemValidationError.message.split('\n').map((line) => '\t' + line).join('\n');
|
|
606
|
+
return new TypeError(message);
|
|
607
|
+
}
|
|
608
|
+
}
|
|
609
|
+
})();
|
|
610
|
+
return v_error === undefined ? null : v_error;
|
|
611
|
+
}
|
|
612
|
+
|
|
613
|
+
function validate$1(obj, path = 'CdpQueryDataGraphMetadataRepresentation') {
|
|
614
|
+
const v_error = (() => {
|
|
615
|
+
if (typeof obj !== 'object' || ArrayIsArray(obj) || obj === null) {
|
|
616
|
+
return new TypeError('Expected "object" but received "' + typeof obj + '" (at "' + path + '")');
|
|
617
|
+
}
|
|
618
|
+
const obj_dataspaceName = obj.dataspaceName;
|
|
619
|
+
const path_dataspaceName = path + '.dataspaceName';
|
|
620
|
+
if (typeof obj_dataspaceName !== 'string') {
|
|
621
|
+
return new TypeError('Expected "string" but received "' + typeof obj_dataspaceName + '" (at "' + path_dataspaceName + '")');
|
|
622
|
+
}
|
|
623
|
+
const obj_description = obj.description;
|
|
624
|
+
const path_description = path + '.description';
|
|
625
|
+
if (typeof obj_description !== 'string') {
|
|
626
|
+
return new TypeError('Expected "string" but received "' + typeof obj_description + '" (at "' + path_description + '")');
|
|
627
|
+
}
|
|
628
|
+
const obj_developerName = obj.developerName;
|
|
629
|
+
const path_developerName = path + '.developerName';
|
|
630
|
+
if (typeof obj_developerName !== 'string') {
|
|
631
|
+
return new TypeError('Expected "string" but received "' + typeof obj_developerName + '" (at "' + path_developerName + '")');
|
|
632
|
+
}
|
|
633
|
+
const obj_dgObject = obj.dgObject;
|
|
634
|
+
const path_dgObject = path + '.dgObject';
|
|
635
|
+
const referencepath_dgObjectValidationError = validate$6(obj_dgObject, path_dgObject);
|
|
636
|
+
if (referencepath_dgObjectValidationError !== null) {
|
|
637
|
+
let message = 'Object doesn\'t match DataGraphObjectDataRepresentation (at "' + path_dgObject + '")\n';
|
|
638
|
+
message += referencepath_dgObjectValidationError.message.split('\n').map((line) => '\t' + line).join('\n');
|
|
639
|
+
return new TypeError(message);
|
|
640
|
+
}
|
|
641
|
+
if (obj.extendedProperties !== undefined) {
|
|
642
|
+
const obj_extendedProperties = obj.extendedProperties;
|
|
643
|
+
const path_extendedProperties = path + '.extendedProperties';
|
|
644
|
+
if (typeof obj_extendedProperties !== 'object' || ArrayIsArray(obj_extendedProperties) || obj_extendedProperties === null) {
|
|
645
|
+
return new TypeError('Expected "object" but received "' + typeof obj_extendedProperties + '" (at "' + path_extendedProperties + '")');
|
|
646
|
+
}
|
|
647
|
+
}
|
|
648
|
+
const obj_idDmoName = obj.idDmoName;
|
|
649
|
+
const path_idDmoName = path + '.idDmoName';
|
|
650
|
+
if (typeof obj_idDmoName !== 'string') {
|
|
651
|
+
return new TypeError('Expected "string" but received "' + typeof obj_idDmoName + '" (at "' + path_idDmoName + '")');
|
|
652
|
+
}
|
|
653
|
+
const obj_idsDmo = obj.idsDmo;
|
|
654
|
+
const path_idsDmo = path + '.idsDmo';
|
|
655
|
+
const referencepath_idsDmoValidationError = validate$4(obj_idsDmo, path_idsDmo);
|
|
656
|
+
if (referencepath_idsDmoValidationError !== null) {
|
|
657
|
+
let message = 'Object doesn\'t match DataGraphIdsDmoRepresentation (at "' + path_idsDmo + '")\n';
|
|
658
|
+
message += referencepath_idsDmoValidationError.message.split('\n').map((line) => '\t' + line).join('\n');
|
|
659
|
+
return new TypeError(message);
|
|
660
|
+
}
|
|
661
|
+
const obj_primaryObjectName = obj.primaryObjectName;
|
|
662
|
+
const path_primaryObjectName = path + '.primaryObjectName';
|
|
663
|
+
if (typeof obj_primaryObjectName !== 'string') {
|
|
664
|
+
return new TypeError('Expected "string" but received "' + typeof obj_primaryObjectName + '" (at "' + path_primaryObjectName + '")');
|
|
665
|
+
}
|
|
666
|
+
const obj_primaryObjectType = obj.primaryObjectType;
|
|
667
|
+
const path_primaryObjectType = path + '.primaryObjectType';
|
|
668
|
+
if (typeof obj_primaryObjectType !== 'string') {
|
|
669
|
+
return new TypeError('Expected "string" but received "' + typeof obj_primaryObjectType + '" (at "' + path_primaryObjectType + '")');
|
|
670
|
+
}
|
|
671
|
+
const obj_status = obj.status;
|
|
672
|
+
const path_status = path + '.status';
|
|
673
|
+
if (typeof obj_status !== 'string') {
|
|
674
|
+
return new TypeError('Expected "string" but received "' + typeof obj_status + '" (at "' + path_status + '")');
|
|
675
|
+
}
|
|
676
|
+
const obj_valuesDmo = obj.valuesDmo;
|
|
677
|
+
const path_valuesDmo = path + '.valuesDmo';
|
|
678
|
+
const referencepath_valuesDmoValidationError = validate$2(obj_valuesDmo, path_valuesDmo);
|
|
679
|
+
if (referencepath_valuesDmoValidationError !== null) {
|
|
680
|
+
let message = 'Object doesn\'t match DataGraphValuesDmoRepresentation (at "' + path_valuesDmo + '")\n';
|
|
681
|
+
message += referencepath_valuesDmoValidationError.message.split('\n').map((line) => '\t' + line).join('\n');
|
|
682
|
+
return new TypeError(message);
|
|
683
|
+
}
|
|
684
|
+
const obj_valuesDmoName = obj.valuesDmoName;
|
|
685
|
+
const path_valuesDmoName = path + '.valuesDmoName';
|
|
686
|
+
if (typeof obj_valuesDmoName !== 'string') {
|
|
687
|
+
return new TypeError('Expected "string" but received "' + typeof obj_valuesDmoName + '" (at "' + path_valuesDmoName + '")');
|
|
688
|
+
}
|
|
689
|
+
const obj_version = obj.version;
|
|
690
|
+
const path_version = path + '.version';
|
|
691
|
+
if (typeof obj_version !== 'string') {
|
|
692
|
+
return new TypeError('Expected "string" but received "' + typeof obj_version + '" (at "' + path_version + '")');
|
|
693
|
+
}
|
|
694
|
+
})();
|
|
695
|
+
return v_error === undefined ? null : v_error;
|
|
696
|
+
}
|
|
697
|
+
|
|
698
|
+
const VERSION = "d39db1870f5b57ce6e726950714a32cd";
|
|
699
|
+
function validate(obj, path = 'CdpDgMetadataRepresentation') {
|
|
700
|
+
const v_error = (() => {
|
|
701
|
+
if (typeof obj !== 'object' || ArrayIsArray(obj) || obj === null) {
|
|
702
|
+
return new TypeError('Expected "object" but received "' + typeof obj + '" (at "' + path + '")');
|
|
703
|
+
}
|
|
704
|
+
const obj_dataGraphMetadata = obj.dataGraphMetadata;
|
|
705
|
+
const path_dataGraphMetadata = path + '.dataGraphMetadata';
|
|
706
|
+
if (!ArrayIsArray(obj_dataGraphMetadata)) {
|
|
707
|
+
return new TypeError('Expected "array" but received "' + typeof obj_dataGraphMetadata + '" (at "' + path_dataGraphMetadata + '")');
|
|
708
|
+
}
|
|
709
|
+
for (let i = 0; i < obj_dataGraphMetadata.length; i++) {
|
|
710
|
+
const obj_dataGraphMetadata_item = obj_dataGraphMetadata[i];
|
|
711
|
+
const path_dataGraphMetadata_item = path_dataGraphMetadata + '[' + i + ']';
|
|
712
|
+
const referencepath_dataGraphMetadata_itemValidationError = validate$1(obj_dataGraphMetadata_item, path_dataGraphMetadata_item);
|
|
713
|
+
if (referencepath_dataGraphMetadata_itemValidationError !== null) {
|
|
714
|
+
let message = 'Object doesn\'t match CdpQueryDataGraphMetadataRepresentation (at "' + path_dataGraphMetadata_item + '")\n';
|
|
715
|
+
message += referencepath_dataGraphMetadata_itemValidationError.message.split('\n').map((line) => '\t' + line).join('\n');
|
|
716
|
+
return new TypeError(message);
|
|
717
|
+
}
|
|
718
|
+
}
|
|
719
|
+
})();
|
|
720
|
+
return v_error === undefined ? null : v_error;
|
|
721
|
+
}
|
|
722
|
+
const RepresentationType = 'CdpDgMetadataRepresentation';
|
|
723
|
+
function normalize(input, existing, path, luvio, store, timestamp) {
|
|
724
|
+
return input;
|
|
725
|
+
}
|
|
726
|
+
const select$1 = function CdpDgMetadataRepresentationSelect() {
|
|
727
|
+
return {
|
|
728
|
+
kind: 'Fragment',
|
|
729
|
+
version: VERSION,
|
|
730
|
+
private: [],
|
|
731
|
+
opaque: true
|
|
732
|
+
};
|
|
733
|
+
};
|
|
734
|
+
function equals(existing, incoming) {
|
|
735
|
+
if (JSONStringify(incoming) !== JSONStringify(existing)) {
|
|
736
|
+
return false;
|
|
737
|
+
}
|
|
738
|
+
return true;
|
|
739
|
+
}
|
|
740
|
+
const ingest = function CdpDgMetadataRepresentationIngest(input, path, luvio, store, timestamp) {
|
|
741
|
+
if (process.env.NODE_ENV !== 'production') {
|
|
742
|
+
const validateError = validate(input);
|
|
743
|
+
if (validateError !== null) {
|
|
744
|
+
throw validateError;
|
|
745
|
+
}
|
|
746
|
+
}
|
|
747
|
+
const key = path.fullPath;
|
|
748
|
+
const ttlToUse = path.ttl !== undefined ? path.ttl : 3000000;
|
|
749
|
+
ingestShape(input, path, luvio, store, timestamp, ttlToUse, key, normalize, "cdp-metadata", VERSION, RepresentationType, equals);
|
|
750
|
+
return createLink(key);
|
|
751
|
+
};
|
|
752
|
+
function getTypeCacheKeys(rootKeySet, luvio, input, fullPathFactory) {
|
|
753
|
+
// root cache key (uses fullPathFactory if keyBuilderFromType isn't defined)
|
|
754
|
+
const rootKey = fullPathFactory();
|
|
755
|
+
rootKeySet.set(rootKey, {
|
|
756
|
+
namespace: keyPrefix,
|
|
757
|
+
representationName: RepresentationType,
|
|
758
|
+
mergeable: false
|
|
759
|
+
});
|
|
760
|
+
}
|
|
761
|
+
|
|
762
|
+
function select(luvio, params) {
|
|
763
|
+
return select$1();
|
|
764
|
+
}
|
|
765
|
+
function keyBuilder$1(luvio, params) {
|
|
766
|
+
return keyPrefix + '::CdpDgMetadataRepresentation:(' + 'dataGraphEntityName:' + params.queryParams.dataGraphEntityName + ',' + 'dataspace:' + params.queryParams.dataspace + ')';
|
|
767
|
+
}
|
|
768
|
+
function getResponseCacheKeys(storeKeyMap, luvio, resourceParams, response) {
|
|
769
|
+
getTypeCacheKeys(storeKeyMap, luvio, response, () => keyBuilder$1(luvio, resourceParams));
|
|
770
|
+
}
|
|
771
|
+
function ingestSuccess(luvio, resourceParams, response, snapshotRefresh) {
|
|
772
|
+
const { body } = response;
|
|
773
|
+
const key = keyBuilder$1(luvio, resourceParams);
|
|
774
|
+
luvio.storeIngest(key, ingest, body);
|
|
775
|
+
const snapshot = luvio.storeLookup({
|
|
776
|
+
recordId: key,
|
|
777
|
+
node: select(),
|
|
778
|
+
variables: {},
|
|
779
|
+
}, snapshotRefresh);
|
|
780
|
+
if (process.env.NODE_ENV !== 'production') {
|
|
781
|
+
if (snapshot.state !== 'Fulfilled') {
|
|
782
|
+
throw new Error('Invalid network response. Expected resource response to result in Fulfilled snapshot');
|
|
783
|
+
}
|
|
784
|
+
}
|
|
785
|
+
deepFreeze(snapshot.data);
|
|
786
|
+
return snapshot;
|
|
787
|
+
}
|
|
788
|
+
function ingestError(luvio, params, error, snapshotRefresh) {
|
|
789
|
+
const key = keyBuilder$1(luvio, params);
|
|
790
|
+
const errorSnapshot = luvio.errorSnapshot(error, snapshotRefresh);
|
|
791
|
+
luvio.storeIngestError(key, errorSnapshot);
|
|
792
|
+
return errorSnapshot;
|
|
793
|
+
}
|
|
794
|
+
function createResourceRequest(config) {
|
|
795
|
+
const headers = {};
|
|
796
|
+
return {
|
|
797
|
+
baseUri: '/services/data/v66.0',
|
|
798
|
+
basePath: '/ssot/data-graphs/metadata',
|
|
799
|
+
method: 'get',
|
|
800
|
+
body: null,
|
|
801
|
+
urlParams: {},
|
|
802
|
+
queryParams: config.queryParams,
|
|
803
|
+
headers,
|
|
804
|
+
priority: 'normal',
|
|
805
|
+
};
|
|
806
|
+
}
|
|
807
|
+
|
|
808
|
+
const adapterName = 'getDataGraphMetadata';
|
|
809
|
+
const getDataGraphMetadata_ConfigPropertyMetadata = [
|
|
810
|
+
generateParamConfigMetadata('dataGraphEntityName', false, 1 /* QueryParameter */, 0 /* String */),
|
|
811
|
+
generateParamConfigMetadata('dataspace', false, 1 /* QueryParameter */, 0 /* String */),
|
|
812
|
+
];
|
|
813
|
+
const getDataGraphMetadata_ConfigPropertyNames = /*#__PURE__*/ buildAdapterValidationConfig(adapterName, getDataGraphMetadata_ConfigPropertyMetadata);
|
|
814
|
+
const createResourceParams = /*#__PURE__*/ createResourceParams$2(getDataGraphMetadata_ConfigPropertyMetadata);
|
|
815
|
+
function keyBuilder(luvio, config) {
|
|
816
|
+
const resourceParams = createResourceParams(config);
|
|
817
|
+
return keyBuilder$1(luvio, resourceParams);
|
|
818
|
+
}
|
|
819
|
+
function typeCheckConfig(untrustedConfig) {
|
|
820
|
+
const config = {};
|
|
821
|
+
typeCheckConfig$2(untrustedConfig, config, getDataGraphMetadata_ConfigPropertyMetadata);
|
|
822
|
+
return config;
|
|
823
|
+
}
|
|
824
|
+
function validateAdapterConfig(untrustedConfig, configPropertyNames) {
|
|
825
|
+
if (!untrustedIsObject(untrustedConfig)) {
|
|
826
|
+
return null;
|
|
827
|
+
}
|
|
828
|
+
if (process.env.NODE_ENV !== 'production') {
|
|
829
|
+
validateConfig(untrustedConfig, configPropertyNames);
|
|
830
|
+
}
|
|
831
|
+
const config = typeCheckConfig(untrustedConfig);
|
|
832
|
+
if (!areRequiredParametersPresent(config, configPropertyNames)) {
|
|
833
|
+
return null;
|
|
834
|
+
}
|
|
835
|
+
return config;
|
|
836
|
+
}
|
|
837
|
+
function adapterFragment(luvio, config) {
|
|
838
|
+
createResourceParams(config);
|
|
839
|
+
return select();
|
|
840
|
+
}
|
|
841
|
+
function onFetchResponseSuccess(luvio, config, resourceParams, response) {
|
|
842
|
+
const snapshot = ingestSuccess(luvio, resourceParams, response, {
|
|
843
|
+
config,
|
|
844
|
+
resolve: () => buildNetworkSnapshot(luvio, config, snapshotRefreshOptions)
|
|
845
|
+
});
|
|
846
|
+
return luvio.storeBroadcast().then(() => snapshot);
|
|
847
|
+
}
|
|
848
|
+
function onFetchResponseError(luvio, config, resourceParams, response) {
|
|
849
|
+
const snapshot = ingestError(luvio, resourceParams, response, {
|
|
850
|
+
config,
|
|
851
|
+
resolve: () => buildNetworkSnapshot(luvio, config, snapshotRefreshOptions)
|
|
852
|
+
});
|
|
853
|
+
return luvio.storeBroadcast().then(() => snapshot);
|
|
854
|
+
}
|
|
855
|
+
function buildNetworkSnapshot(luvio, config, options) {
|
|
856
|
+
const resourceParams = createResourceParams(config);
|
|
857
|
+
const request = createResourceRequest(resourceParams);
|
|
858
|
+
return luvio.dispatchResourceRequest(request, options)
|
|
859
|
+
.then((response) => {
|
|
860
|
+
return luvio.handleSuccessResponse(() => onFetchResponseSuccess(luvio, config, resourceParams, response), () => {
|
|
861
|
+
const cache = new StoreKeyMap();
|
|
862
|
+
getResponseCacheKeys(cache, luvio, resourceParams, response.body);
|
|
863
|
+
return cache;
|
|
864
|
+
});
|
|
865
|
+
}, (response) => {
|
|
866
|
+
return luvio.handleErrorResponse(() => onFetchResponseError(luvio, config, resourceParams, response));
|
|
867
|
+
});
|
|
868
|
+
}
|
|
869
|
+
function buildNetworkSnapshotCachePolicy(context, coercedAdapterRequestContext) {
|
|
870
|
+
return buildNetworkSnapshotCachePolicy$2(context, coercedAdapterRequestContext, buildNetworkSnapshot, undefined, false);
|
|
871
|
+
}
|
|
872
|
+
function buildCachedSnapshotCachePolicy(context, storeLookup) {
|
|
873
|
+
const { luvio, config } = context;
|
|
874
|
+
const selector = {
|
|
875
|
+
recordId: keyBuilder(luvio, config),
|
|
876
|
+
node: adapterFragment(luvio, config),
|
|
877
|
+
variables: {},
|
|
878
|
+
};
|
|
879
|
+
const cacheSnapshot = storeLookup(selector, {
|
|
880
|
+
config,
|
|
881
|
+
resolve: () => buildNetworkSnapshot(luvio, config, snapshotRefreshOptions)
|
|
882
|
+
});
|
|
883
|
+
return cacheSnapshot;
|
|
884
|
+
}
|
|
885
|
+
const getDataGraphMetadataAdapterFactory = (luvio) => function cdpMetadata__getDataGraphMetadata(untrustedConfig, requestContext) {
|
|
886
|
+
const config = validateAdapterConfig(untrustedConfig, getDataGraphMetadata_ConfigPropertyNames);
|
|
887
|
+
// Invalid or incomplete config
|
|
888
|
+
if (config === null) {
|
|
889
|
+
return null;
|
|
890
|
+
}
|
|
891
|
+
return luvio.applyCachePolicy((requestContext || {}), { config, luvio }, // BuildSnapshotContext
|
|
892
|
+
buildCachedSnapshotCachePolicy, buildNetworkSnapshotCachePolicy);
|
|
893
|
+
};
|
|
894
|
+
|
|
895
|
+
let getAllMetadata;
|
|
896
|
+
let getDataGraphMetadata;
|
|
897
|
+
// Imperative GET Adapters
|
|
898
|
+
let getAllMetadata_imperative;
|
|
899
|
+
let getDataGraphMetadata_imperative;
|
|
900
|
+
// Adapter Metadata
|
|
901
|
+
const getAllMetadataMetadata = { apiFamily: 'cdpmetadata', name: 'getAllMetadata' };
|
|
902
|
+
const getDataGraphMetadataMetadata = { apiFamily: 'cdpmetadata', name: 'getDataGraphMetadata' };
|
|
903
|
+
// Notify Update Available
|
|
904
|
+
function bindExportsTo(luvio) {
|
|
905
|
+
// LDS Adapters
|
|
906
|
+
const getAllMetadata_ldsAdapter = createInstrumentedAdapter(createLDSAdapter(luvio, 'getAllMetadata', getAllMetadataAdapterFactory), getAllMetadataMetadata);
|
|
907
|
+
const getDataGraphMetadata_ldsAdapter = createInstrumentedAdapter(createLDSAdapter(luvio, 'getDataGraphMetadata', getDataGraphMetadataAdapterFactory), getDataGraphMetadataMetadata);
|
|
908
|
+
return {
|
|
909
|
+
getAllMetadata: createWireAdapterConstructor(luvio, getAllMetadata_ldsAdapter, getAllMetadataMetadata),
|
|
910
|
+
getDataGraphMetadata: createWireAdapterConstructor(luvio, getDataGraphMetadata_ldsAdapter, getDataGraphMetadataMetadata),
|
|
911
|
+
// Imperative GET Adapters
|
|
912
|
+
getAllMetadata_imperative: createImperativeAdapter(luvio, getAllMetadata_ldsAdapter, getAllMetadataMetadata),
|
|
913
|
+
getDataGraphMetadata_imperative: createImperativeAdapter(luvio, getDataGraphMetadata_ldsAdapter, getDataGraphMetadataMetadata),
|
|
914
|
+
// Notify Update Availables
|
|
915
|
+
};
|
|
916
|
+
}
|
|
917
|
+
withDefaultLuvio((luvio) => {
|
|
918
|
+
({
|
|
919
|
+
getAllMetadata,
|
|
920
|
+
getDataGraphMetadata,
|
|
921
|
+
getAllMetadata_imperative,
|
|
922
|
+
getDataGraphMetadata_imperative,
|
|
923
|
+
} = bindExportsTo(luvio));
|
|
924
|
+
});
|
|
925
|
+
|
|
926
|
+
export { getAllMetadata, getAllMetadata_imperative, getDataGraphMetadata, getDataGraphMetadata_imperative };
|
|
927
|
+
// version: 0.1.0-dev1-c978a7b010
|