@salesforce/lds-adapters-industries-omnidesigner 1.281.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/industries-omnidesigner.js +456 -0
- package/dist/es/es2018/types/src/generated/adapters/adapter-utils.d.ts +62 -0
- package/dist/es/es2018/types/src/generated/adapters/fetchEntityInfo.d.ts +28 -0
- package/dist/es/es2018/types/src/generated/artifacts/main.d.ts +1 -0
- package/dist/es/es2018/types/src/generated/artifacts/sfdc.d.ts +3 -0
- package/dist/es/es2018/types/src/generated/resources/getConnectOmniDesignerEntityInfo.d.ts +16 -0
- package/dist/es/es2018/types/src/generated/types/OmniDesignerEntitiesInfoDetailRepresentation.d.ts +32 -0
- package/dist/es/es2018/types/src/generated/types/OmniDesignerEntityInfoDetailRepresentation.d.ts +31 -0
- package/dist/es/es2018/types/src/generated/types/OmniDesignerEntityInfoRepresentation.d.ts +33 -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 +487 -0
- package/src/raml/api.raml +82 -0
- package/src/raml/luvio.raml +17 -0
package/sfdc/index.js
ADDED
|
@@ -0,0 +1,487 @@
|
|
|
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$1, typeCheckConfig as typeCheckConfig$1, StoreKeyMap, createResourceParams as createResourceParams$1 } 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 = 'OmniDesigner';
|
|
83
|
+
|
|
84
|
+
const { isArray: ArrayIsArray } = Array;
|
|
85
|
+
function equalsArray(a, b, equalsItem) {
|
|
86
|
+
const aLength = a.length;
|
|
87
|
+
const bLength = b.length;
|
|
88
|
+
if (aLength !== bLength) {
|
|
89
|
+
return false;
|
|
90
|
+
}
|
|
91
|
+
for (let i = 0; i < aLength; i++) {
|
|
92
|
+
if (equalsItem(a[i], b[i]) === false) {
|
|
93
|
+
return false;
|
|
94
|
+
}
|
|
95
|
+
}
|
|
96
|
+
return true;
|
|
97
|
+
}
|
|
98
|
+
function createLink(ref) {
|
|
99
|
+
return {
|
|
100
|
+
__ref: serializeStructuredKey(ref),
|
|
101
|
+
};
|
|
102
|
+
}
|
|
103
|
+
|
|
104
|
+
const VERSION$2 = "82ae2dc85f99633c65d4dd65d4ea7723";
|
|
105
|
+
function validate$2(obj, path = 'OmniDesignerEntityInfoDetailRepresentation') {
|
|
106
|
+
const v_error = (() => {
|
|
107
|
+
if (typeof obj !== 'object' || ArrayIsArray(obj) || obj === null) {
|
|
108
|
+
return new TypeError('Expected "object" but received "' + typeof obj + '" (at "' + path + '")');
|
|
109
|
+
}
|
|
110
|
+
const obj_entityInfoName = obj.entityInfoName;
|
|
111
|
+
const path_entityInfoName = path + '.entityInfoName';
|
|
112
|
+
if (typeof obj_entityInfoName !== 'string') {
|
|
113
|
+
return new TypeError('Expected "string" but received "' + typeof obj_entityInfoName + '" (at "' + path_entityInfoName + '")');
|
|
114
|
+
}
|
|
115
|
+
const obj_entityInfoValue = obj.entityInfoValue;
|
|
116
|
+
const path_entityInfoValue = path + '.entityInfoValue';
|
|
117
|
+
if (typeof obj_entityInfoValue !== 'string') {
|
|
118
|
+
return new TypeError('Expected "string" but received "' + typeof obj_entityInfoValue + '" (at "' + path_entityInfoValue + '")');
|
|
119
|
+
}
|
|
120
|
+
})();
|
|
121
|
+
return v_error === undefined ? null : v_error;
|
|
122
|
+
}
|
|
123
|
+
const select$3 = function OmniDesignerEntityInfoDetailRepresentationSelect() {
|
|
124
|
+
return {
|
|
125
|
+
kind: 'Fragment',
|
|
126
|
+
version: VERSION$2,
|
|
127
|
+
private: [],
|
|
128
|
+
selections: [
|
|
129
|
+
{
|
|
130
|
+
name: 'entityInfoName',
|
|
131
|
+
kind: 'Scalar'
|
|
132
|
+
},
|
|
133
|
+
{
|
|
134
|
+
name: 'entityInfoValue',
|
|
135
|
+
kind: 'Scalar'
|
|
136
|
+
}
|
|
137
|
+
]
|
|
138
|
+
};
|
|
139
|
+
};
|
|
140
|
+
function equals$2(existing, incoming) {
|
|
141
|
+
const existing_entityInfoName = existing.entityInfoName;
|
|
142
|
+
const incoming_entityInfoName = incoming.entityInfoName;
|
|
143
|
+
if (!(existing_entityInfoName === incoming_entityInfoName)) {
|
|
144
|
+
return false;
|
|
145
|
+
}
|
|
146
|
+
const existing_entityInfoValue = existing.entityInfoValue;
|
|
147
|
+
const incoming_entityInfoValue = incoming.entityInfoValue;
|
|
148
|
+
if (!(existing_entityInfoValue === incoming_entityInfoValue)) {
|
|
149
|
+
return false;
|
|
150
|
+
}
|
|
151
|
+
return true;
|
|
152
|
+
}
|
|
153
|
+
|
|
154
|
+
const VERSION$1 = "4d8b4cf8a4cb069856885e2ea0da8a80";
|
|
155
|
+
function validate$1(obj, path = 'OmniDesignerEntitiesInfoDetailRepresentation') {
|
|
156
|
+
const v_error = (() => {
|
|
157
|
+
if (typeof obj !== 'object' || ArrayIsArray(obj) || obj === null) {
|
|
158
|
+
return new TypeError('Expected "object" but received "' + typeof obj + '" (at "' + path + '")');
|
|
159
|
+
}
|
|
160
|
+
const obj_entityInfo = obj.entityInfo;
|
|
161
|
+
const path_entityInfo = path + '.entityInfo';
|
|
162
|
+
if (!ArrayIsArray(obj_entityInfo)) {
|
|
163
|
+
return new TypeError('Expected "array" but received "' + typeof obj_entityInfo + '" (at "' + path_entityInfo + '")');
|
|
164
|
+
}
|
|
165
|
+
for (let i = 0; i < obj_entityInfo.length; i++) {
|
|
166
|
+
const obj_entityInfo_item = obj_entityInfo[i];
|
|
167
|
+
const path_entityInfo_item = path_entityInfo + '[' + i + ']';
|
|
168
|
+
const referencepath_entityInfo_itemValidationError = validate$2(obj_entityInfo_item, path_entityInfo_item);
|
|
169
|
+
if (referencepath_entityInfo_itemValidationError !== null) {
|
|
170
|
+
let message = 'Object doesn\'t match OmniDesignerEntityInfoDetailRepresentation (at "' + path_entityInfo_item + '")\n';
|
|
171
|
+
message += referencepath_entityInfo_itemValidationError.message.split('\n').map((line) => '\t' + line).join('\n');
|
|
172
|
+
return new TypeError(message);
|
|
173
|
+
}
|
|
174
|
+
}
|
|
175
|
+
const obj_entityName = obj.entityName;
|
|
176
|
+
const path_entityName = path + '.entityName';
|
|
177
|
+
if (typeof obj_entityName !== 'string') {
|
|
178
|
+
return new TypeError('Expected "string" but received "' + typeof obj_entityName + '" (at "' + path_entityName + '")');
|
|
179
|
+
}
|
|
180
|
+
})();
|
|
181
|
+
return v_error === undefined ? null : v_error;
|
|
182
|
+
}
|
|
183
|
+
const select$2 = function OmniDesignerEntitiesInfoDetailRepresentationSelect() {
|
|
184
|
+
const { selections: OmniDesignerEntityInfoDetailRepresentation__selections, opaque: OmniDesignerEntityInfoDetailRepresentation__opaque, } = select$3();
|
|
185
|
+
return {
|
|
186
|
+
kind: 'Fragment',
|
|
187
|
+
version: VERSION$1,
|
|
188
|
+
private: [],
|
|
189
|
+
selections: [
|
|
190
|
+
{
|
|
191
|
+
name: 'entityInfo',
|
|
192
|
+
kind: 'Object',
|
|
193
|
+
plural: true,
|
|
194
|
+
selections: OmniDesignerEntityInfoDetailRepresentation__selections
|
|
195
|
+
},
|
|
196
|
+
{
|
|
197
|
+
name: 'entityName',
|
|
198
|
+
kind: 'Scalar'
|
|
199
|
+
}
|
|
200
|
+
]
|
|
201
|
+
};
|
|
202
|
+
};
|
|
203
|
+
function equals$1(existing, incoming) {
|
|
204
|
+
const existing_entityName = existing.entityName;
|
|
205
|
+
const incoming_entityName = incoming.entityName;
|
|
206
|
+
if (!(existing_entityName === incoming_entityName)) {
|
|
207
|
+
return false;
|
|
208
|
+
}
|
|
209
|
+
const existing_entityInfo = existing.entityInfo;
|
|
210
|
+
const incoming_entityInfo = incoming.entityInfo;
|
|
211
|
+
const equals_entityInfo_items = equalsArray(existing_entityInfo, incoming_entityInfo, (existing_entityInfo_item, incoming_entityInfo_item) => {
|
|
212
|
+
if (!(equals$2(existing_entityInfo_item, incoming_entityInfo_item))) {
|
|
213
|
+
return false;
|
|
214
|
+
}
|
|
215
|
+
});
|
|
216
|
+
if (equals_entityInfo_items === false) {
|
|
217
|
+
return false;
|
|
218
|
+
}
|
|
219
|
+
return true;
|
|
220
|
+
}
|
|
221
|
+
|
|
222
|
+
const TTL = 10000;
|
|
223
|
+
const VERSION = "2ed0e3bb8be6d1c5a8e7b538d4a59f17";
|
|
224
|
+
function validate(obj, path = 'OmniDesignerEntityInfoRepresentation') {
|
|
225
|
+
const v_error = (() => {
|
|
226
|
+
if (typeof obj !== 'object' || ArrayIsArray(obj) || obj === null) {
|
|
227
|
+
return new TypeError('Expected "object" but received "' + typeof obj + '" (at "' + path + '")');
|
|
228
|
+
}
|
|
229
|
+
const obj_entitiesInfo = obj.entitiesInfo;
|
|
230
|
+
const path_entitiesInfo = path + '.entitiesInfo';
|
|
231
|
+
if (!ArrayIsArray(obj_entitiesInfo)) {
|
|
232
|
+
return new TypeError('Expected "array" but received "' + typeof obj_entitiesInfo + '" (at "' + path_entitiesInfo + '")');
|
|
233
|
+
}
|
|
234
|
+
for (let i = 0; i < obj_entitiesInfo.length; i++) {
|
|
235
|
+
const obj_entitiesInfo_item = obj_entitiesInfo[i];
|
|
236
|
+
const path_entitiesInfo_item = path_entitiesInfo + '[' + i + ']';
|
|
237
|
+
const referencepath_entitiesInfo_itemValidationError = validate$1(obj_entitiesInfo_item, path_entitiesInfo_item);
|
|
238
|
+
if (referencepath_entitiesInfo_itemValidationError !== null) {
|
|
239
|
+
let message = 'Object doesn\'t match OmniDesignerEntitiesInfoDetailRepresentation (at "' + path_entitiesInfo_item + '")\n';
|
|
240
|
+
message += referencepath_entitiesInfo_itemValidationError.message.split('\n').map((line) => '\t' + line).join('\n');
|
|
241
|
+
return new TypeError(message);
|
|
242
|
+
}
|
|
243
|
+
}
|
|
244
|
+
if (obj.queryMore !== undefined) {
|
|
245
|
+
const obj_queryMore = obj.queryMore;
|
|
246
|
+
const path_queryMore = path + '.queryMore';
|
|
247
|
+
if (typeof obj_queryMore !== 'string') {
|
|
248
|
+
return new TypeError('Expected "string" but received "' + typeof obj_queryMore + '" (at "' + path_queryMore + '")');
|
|
249
|
+
}
|
|
250
|
+
}
|
|
251
|
+
})();
|
|
252
|
+
return v_error === undefined ? null : v_error;
|
|
253
|
+
}
|
|
254
|
+
const RepresentationType = 'OmniDesignerEntityInfoRepresentation';
|
|
255
|
+
function normalize(input, existing, path, luvio, store, timestamp) {
|
|
256
|
+
return input;
|
|
257
|
+
}
|
|
258
|
+
const select$1 = function OmniDesignerEntityInfoRepresentationSelect() {
|
|
259
|
+
const { selections: OmniDesignerEntitiesInfoDetailRepresentation__selections, opaque: OmniDesignerEntitiesInfoDetailRepresentation__opaque, } = select$2();
|
|
260
|
+
return {
|
|
261
|
+
kind: 'Fragment',
|
|
262
|
+
version: VERSION,
|
|
263
|
+
private: [],
|
|
264
|
+
selections: [
|
|
265
|
+
{
|
|
266
|
+
name: 'entitiesInfo',
|
|
267
|
+
kind: 'Object',
|
|
268
|
+
plural: true,
|
|
269
|
+
selections: OmniDesignerEntitiesInfoDetailRepresentation__selections
|
|
270
|
+
},
|
|
271
|
+
{
|
|
272
|
+
name: 'queryMore',
|
|
273
|
+
kind: 'Scalar',
|
|
274
|
+
required: false
|
|
275
|
+
}
|
|
276
|
+
]
|
|
277
|
+
};
|
|
278
|
+
};
|
|
279
|
+
function equals(existing, incoming) {
|
|
280
|
+
const existing_queryMore = existing.queryMore;
|
|
281
|
+
const incoming_queryMore = incoming.queryMore;
|
|
282
|
+
// if at least one of these optionals is defined
|
|
283
|
+
if (existing_queryMore !== undefined || incoming_queryMore !== undefined) {
|
|
284
|
+
// if one of these is not defined we know the other is defined and therefore
|
|
285
|
+
// not equal
|
|
286
|
+
if (existing_queryMore === undefined || incoming_queryMore === undefined) {
|
|
287
|
+
return false;
|
|
288
|
+
}
|
|
289
|
+
if (!(existing_queryMore === incoming_queryMore)) {
|
|
290
|
+
return false;
|
|
291
|
+
}
|
|
292
|
+
}
|
|
293
|
+
const existing_entitiesInfo = existing.entitiesInfo;
|
|
294
|
+
const incoming_entitiesInfo = incoming.entitiesInfo;
|
|
295
|
+
const equals_entitiesInfo_items = equalsArray(existing_entitiesInfo, incoming_entitiesInfo, (existing_entitiesInfo_item, incoming_entitiesInfo_item) => {
|
|
296
|
+
if (!(equals$1(existing_entitiesInfo_item, incoming_entitiesInfo_item))) {
|
|
297
|
+
return false;
|
|
298
|
+
}
|
|
299
|
+
});
|
|
300
|
+
if (equals_entitiesInfo_items === false) {
|
|
301
|
+
return false;
|
|
302
|
+
}
|
|
303
|
+
return true;
|
|
304
|
+
}
|
|
305
|
+
const ingest = function OmniDesignerEntityInfoRepresentationIngest(input, path, luvio, store, timestamp) {
|
|
306
|
+
if (process.env.NODE_ENV !== 'production') {
|
|
307
|
+
const validateError = validate(input);
|
|
308
|
+
if (validateError !== null) {
|
|
309
|
+
throw validateError;
|
|
310
|
+
}
|
|
311
|
+
}
|
|
312
|
+
const key = path.fullPath;
|
|
313
|
+
const ttlToUse = TTL;
|
|
314
|
+
ingestShape(input, path, luvio, store, timestamp, ttlToUse, key, normalize, "OmniDesigner", VERSION, RepresentationType, equals);
|
|
315
|
+
return createLink(key);
|
|
316
|
+
};
|
|
317
|
+
function getTypeCacheKeys(rootKeySet, luvio, input, fullPathFactory) {
|
|
318
|
+
// root cache key (uses fullPathFactory if keyBuilderFromType isn't defined)
|
|
319
|
+
const rootKey = fullPathFactory();
|
|
320
|
+
rootKeySet.set(rootKey, {
|
|
321
|
+
namespace: keyPrefix,
|
|
322
|
+
representationName: RepresentationType,
|
|
323
|
+
mergeable: false
|
|
324
|
+
});
|
|
325
|
+
}
|
|
326
|
+
|
|
327
|
+
function select(luvio, params) {
|
|
328
|
+
return select$1();
|
|
329
|
+
}
|
|
330
|
+
function keyBuilder$1(luvio, params) {
|
|
331
|
+
return keyPrefix + '::OmniDesignerEntityInfoRepresentation:(' + 'pageSize:' + params.queryParams.pageSize + ',' + 'queryMore:' + params.queryParams.queryMore + ')';
|
|
332
|
+
}
|
|
333
|
+
function getResponseCacheKeys(storeKeyMap, luvio, resourceParams, response) {
|
|
334
|
+
getTypeCacheKeys(storeKeyMap, luvio, response, () => keyBuilder$1(luvio, resourceParams));
|
|
335
|
+
}
|
|
336
|
+
function ingestSuccess(luvio, resourceParams, response, snapshotRefresh) {
|
|
337
|
+
const { body } = response;
|
|
338
|
+
const key = keyBuilder$1(luvio, resourceParams);
|
|
339
|
+
luvio.storeIngest(key, ingest, body);
|
|
340
|
+
const snapshot = luvio.storeLookup({
|
|
341
|
+
recordId: key,
|
|
342
|
+
node: select(),
|
|
343
|
+
variables: {},
|
|
344
|
+
}, snapshotRefresh);
|
|
345
|
+
if (process.env.NODE_ENV !== 'production') {
|
|
346
|
+
if (snapshot.state !== 'Fulfilled') {
|
|
347
|
+
throw new Error('Invalid network response. Expected resource response to result in Fulfilled snapshot');
|
|
348
|
+
}
|
|
349
|
+
}
|
|
350
|
+
deepFreeze(snapshot.data);
|
|
351
|
+
return snapshot;
|
|
352
|
+
}
|
|
353
|
+
function ingestError(luvio, params, error, snapshotRefresh) {
|
|
354
|
+
const key = keyBuilder$1(luvio, params);
|
|
355
|
+
const errorSnapshot = luvio.errorSnapshot(error, snapshotRefresh);
|
|
356
|
+
const storeMetadataParams = {
|
|
357
|
+
ttl: TTL,
|
|
358
|
+
namespace: keyPrefix,
|
|
359
|
+
version: VERSION,
|
|
360
|
+
representationName: RepresentationType
|
|
361
|
+
};
|
|
362
|
+
luvio.storeIngestError(key, errorSnapshot, storeMetadataParams);
|
|
363
|
+
return errorSnapshot;
|
|
364
|
+
}
|
|
365
|
+
function createResourceRequest(config) {
|
|
366
|
+
const headers = {};
|
|
367
|
+
return {
|
|
368
|
+
baseUri: '/services/data/v61.0',
|
|
369
|
+
basePath: '/connect/omni-designer/entity-info',
|
|
370
|
+
method: 'get',
|
|
371
|
+
body: null,
|
|
372
|
+
urlParams: {},
|
|
373
|
+
queryParams: config.queryParams,
|
|
374
|
+
headers,
|
|
375
|
+
priority: 'normal',
|
|
376
|
+
};
|
|
377
|
+
}
|
|
378
|
+
|
|
379
|
+
const adapterName = 'fetchEntityInfo';
|
|
380
|
+
const fetchEntityInfo_ConfigPropertyMetadata = [
|
|
381
|
+
generateParamConfigMetadata('pageSize', false, 1 /* QueryParameter */, 3 /* Integer */),
|
|
382
|
+
generateParamConfigMetadata('queryMore', false, 1 /* QueryParameter */, 0 /* String */),
|
|
383
|
+
];
|
|
384
|
+
const fetchEntityInfo_ConfigPropertyNames = /*#__PURE__*/ buildAdapterValidationConfig(adapterName, fetchEntityInfo_ConfigPropertyMetadata);
|
|
385
|
+
const createResourceParams = /*#__PURE__*/ createResourceParams$1(fetchEntityInfo_ConfigPropertyMetadata);
|
|
386
|
+
function keyBuilder(luvio, config) {
|
|
387
|
+
const resourceParams = createResourceParams(config);
|
|
388
|
+
return keyBuilder$1(luvio, resourceParams);
|
|
389
|
+
}
|
|
390
|
+
function typeCheckConfig(untrustedConfig) {
|
|
391
|
+
const config = {};
|
|
392
|
+
typeCheckConfig$1(untrustedConfig, config, fetchEntityInfo_ConfigPropertyMetadata);
|
|
393
|
+
return config;
|
|
394
|
+
}
|
|
395
|
+
function validateAdapterConfig(untrustedConfig, configPropertyNames) {
|
|
396
|
+
if (!untrustedIsObject(untrustedConfig)) {
|
|
397
|
+
return null;
|
|
398
|
+
}
|
|
399
|
+
if (process.env.NODE_ENV !== 'production') {
|
|
400
|
+
validateConfig(untrustedConfig, configPropertyNames);
|
|
401
|
+
}
|
|
402
|
+
const config = typeCheckConfig(untrustedConfig);
|
|
403
|
+
if (!areRequiredParametersPresent(config, configPropertyNames)) {
|
|
404
|
+
return null;
|
|
405
|
+
}
|
|
406
|
+
return config;
|
|
407
|
+
}
|
|
408
|
+
function adapterFragment(luvio, config) {
|
|
409
|
+
createResourceParams(config);
|
|
410
|
+
return select();
|
|
411
|
+
}
|
|
412
|
+
function onFetchResponseSuccess(luvio, config, resourceParams, response) {
|
|
413
|
+
const snapshot = ingestSuccess(luvio, resourceParams, response, {
|
|
414
|
+
config,
|
|
415
|
+
resolve: () => buildNetworkSnapshot(luvio, config, snapshotRefreshOptions)
|
|
416
|
+
});
|
|
417
|
+
return luvio.storeBroadcast().then(() => snapshot);
|
|
418
|
+
}
|
|
419
|
+
function onFetchResponseError(luvio, config, resourceParams, response) {
|
|
420
|
+
const snapshot = ingestError(luvio, resourceParams, response, {
|
|
421
|
+
config,
|
|
422
|
+
resolve: () => buildNetworkSnapshot(luvio, config, snapshotRefreshOptions)
|
|
423
|
+
});
|
|
424
|
+
return luvio.storeBroadcast().then(() => snapshot);
|
|
425
|
+
}
|
|
426
|
+
function buildNetworkSnapshot(luvio, config, options) {
|
|
427
|
+
const resourceParams = createResourceParams(config);
|
|
428
|
+
const request = createResourceRequest(resourceParams);
|
|
429
|
+
return luvio.dispatchResourceRequest(request, options)
|
|
430
|
+
.then((response) => {
|
|
431
|
+
return luvio.handleSuccessResponse(() => onFetchResponseSuccess(luvio, config, resourceParams, response), () => {
|
|
432
|
+
const cache = new StoreKeyMap();
|
|
433
|
+
getResponseCacheKeys(cache, luvio, resourceParams, response.body);
|
|
434
|
+
return cache;
|
|
435
|
+
});
|
|
436
|
+
}, (response) => {
|
|
437
|
+
return luvio.handleErrorResponse(() => onFetchResponseError(luvio, config, resourceParams, response));
|
|
438
|
+
});
|
|
439
|
+
}
|
|
440
|
+
function buildNetworkSnapshotCachePolicy(context, coercedAdapterRequestContext) {
|
|
441
|
+
return buildNetworkSnapshotCachePolicy$1(context, coercedAdapterRequestContext, buildNetworkSnapshot, undefined, false);
|
|
442
|
+
}
|
|
443
|
+
function buildCachedSnapshotCachePolicy(context, storeLookup) {
|
|
444
|
+
const { luvio, config } = context;
|
|
445
|
+
const selector = {
|
|
446
|
+
recordId: keyBuilder(luvio, config),
|
|
447
|
+
node: adapterFragment(luvio, config),
|
|
448
|
+
variables: {},
|
|
449
|
+
};
|
|
450
|
+
const cacheSnapshot = storeLookup(selector, {
|
|
451
|
+
config,
|
|
452
|
+
resolve: () => buildNetworkSnapshot(luvio, config, snapshotRefreshOptions)
|
|
453
|
+
});
|
|
454
|
+
return cacheSnapshot;
|
|
455
|
+
}
|
|
456
|
+
const fetchEntityInfoAdapterFactory = (luvio) => function OmniDesigner__fetchEntityInfo(untrustedConfig, requestContext) {
|
|
457
|
+
const config = validateAdapterConfig(untrustedConfig, fetchEntityInfo_ConfigPropertyNames);
|
|
458
|
+
// Invalid or incomplete config
|
|
459
|
+
if (config === null) {
|
|
460
|
+
return null;
|
|
461
|
+
}
|
|
462
|
+
return luvio.applyCachePolicy((requestContext || {}), { config, luvio }, // BuildSnapshotContext
|
|
463
|
+
buildCachedSnapshotCachePolicy, buildNetworkSnapshotCachePolicy);
|
|
464
|
+
};
|
|
465
|
+
|
|
466
|
+
let fetchEntityInfo;
|
|
467
|
+
// Imperative GET Adapters
|
|
468
|
+
let fetchEntityInfo_imperative;
|
|
469
|
+
// Adapter Metadata
|
|
470
|
+
const fetchEntityInfoMetadata = { apiFamily: 'OmniDesigner', name: 'fetchEntityInfo', ttl: 10000 };
|
|
471
|
+
// Notify Update Available
|
|
472
|
+
function bindExportsTo(luvio) {
|
|
473
|
+
// LDS Adapters
|
|
474
|
+
const fetchEntityInfo_ldsAdapter = createInstrumentedAdapter(createLDSAdapter(luvio, 'fetchEntityInfo', fetchEntityInfoAdapterFactory), fetchEntityInfoMetadata);
|
|
475
|
+
return {
|
|
476
|
+
fetchEntityInfo: createWireAdapterConstructor(luvio, fetchEntityInfo_ldsAdapter, fetchEntityInfoMetadata),
|
|
477
|
+
// Imperative GET Adapters
|
|
478
|
+
fetchEntityInfo_imperative: createImperativeAdapter(luvio, fetchEntityInfo_ldsAdapter, fetchEntityInfoMetadata),
|
|
479
|
+
// Notify Update Availables
|
|
480
|
+
};
|
|
481
|
+
}
|
|
482
|
+
withDefaultLuvio((luvio) => {
|
|
483
|
+
({ fetchEntityInfo, fetchEntityInfo_imperative } = bindExportsTo(luvio));
|
|
484
|
+
});
|
|
485
|
+
|
|
486
|
+
export { fetchEntityInfo, fetchEntityInfo_imperative };
|
|
487
|
+
// version: 1.281.0-bcef40769
|
|
@@ -0,0 +1,82 @@
|
|
|
1
|
+
#%RAML 1.0
|
|
2
|
+
securedBy:
|
|
3
|
+
- OAuth2
|
|
4
|
+
title: Salesforce Connect API
|
|
5
|
+
version: '61.0'
|
|
6
|
+
mediaType: application/json
|
|
7
|
+
protocols:
|
|
8
|
+
- https
|
|
9
|
+
baseUri: /services/data/v61.0
|
|
10
|
+
securitySchemes:
|
|
11
|
+
OAuth2:
|
|
12
|
+
type: OAuth 2.0
|
|
13
|
+
settings:
|
|
14
|
+
authorizationUri: https://example.com/oauth/authorize
|
|
15
|
+
accessTokenUri: ''
|
|
16
|
+
authorizationGrants:
|
|
17
|
+
- implicit
|
|
18
|
+
annotationTypes:
|
|
19
|
+
oas-readOnly:
|
|
20
|
+
type: boolean
|
|
21
|
+
allowedTargets: TypeDeclaration
|
|
22
|
+
oas-collectionFormat:
|
|
23
|
+
type: string
|
|
24
|
+
oas-body-name:
|
|
25
|
+
type: string
|
|
26
|
+
allowedTargets: TypeDeclaration
|
|
27
|
+
types:
|
|
28
|
+
OmniDesignerEntitiesInfoDetailRepresentation:
|
|
29
|
+
description: List of enities
|
|
30
|
+
type: object
|
|
31
|
+
properties:
|
|
32
|
+
entityInfo:
|
|
33
|
+
description: Information about the entity as a List of name value pairs.
|
|
34
|
+
type: array
|
|
35
|
+
items:
|
|
36
|
+
type: OmniDesignerEntityInfoDetailRepresentation
|
|
37
|
+
entityName:
|
|
38
|
+
description: The name of the entity
|
|
39
|
+
type: string
|
|
40
|
+
OmniDesignerEntityInfoDetailRepresentation:
|
|
41
|
+
description: Information about an entity
|
|
42
|
+
type: object
|
|
43
|
+
properties:
|
|
44
|
+
entityInfoName:
|
|
45
|
+
description: The name of the property of the entity like the label
|
|
46
|
+
type: string
|
|
47
|
+
entityInfoValue:
|
|
48
|
+
description: The value of the property
|
|
49
|
+
type: string
|
|
50
|
+
OmniDesignerEntityInfoRepresentation:
|
|
51
|
+
description: Entity Info output
|
|
52
|
+
type: object
|
|
53
|
+
properties:
|
|
54
|
+
entitiesInfo:
|
|
55
|
+
description: A list of OmniDesignerEntityInfoDetailRepresentation
|
|
56
|
+
type: array
|
|
57
|
+
items:
|
|
58
|
+
type: OmniDesignerEntitiesInfoDetailRepresentation
|
|
59
|
+
queryMore:
|
|
60
|
+
description: A string in an internal format that should be returned by the
|
|
61
|
+
caller as is to fetch the next set of entities
|
|
62
|
+
type: string
|
|
63
|
+
required: false
|
|
64
|
+
|
|
65
|
+
/connect/omni-designer:
|
|
66
|
+
/entity-info:
|
|
67
|
+
get:
|
|
68
|
+
displayName: fetchEntityInfo
|
|
69
|
+
description: Fetches metadata about Entity Objects
|
|
70
|
+
responses:
|
|
71
|
+
'200':
|
|
72
|
+
description: Success
|
|
73
|
+
body:
|
|
74
|
+
application/json:
|
|
75
|
+
type: OmniDesignerEntityInfoRepresentation
|
|
76
|
+
queryParameters:
|
|
77
|
+
pageSize:
|
|
78
|
+
type: integer
|
|
79
|
+
required: false
|
|
80
|
+
queryMore:
|
|
81
|
+
type: string
|
|
82
|
+
required: false
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
#%RAML 1.0 Overlay
|
|
2
|
+
extends: ./api.raml
|
|
3
|
+
|
|
4
|
+
uses:
|
|
5
|
+
luvio: luvio://annotations.raml
|
|
6
|
+
|
|
7
|
+
(luvio.keyPrefix): 'OmniDesigner'
|
|
8
|
+
|
|
9
|
+
types:
|
|
10
|
+
OmniDesignerEntityInfoRepresentation:
|
|
11
|
+
(luvio.ttl): 10000
|
|
12
|
+
|
|
13
|
+
/connect/omni-designer:
|
|
14
|
+
/entity-info:
|
|
15
|
+
get:
|
|
16
|
+
(luvio.adapter):
|
|
17
|
+
name: fetchEntityInfo
|