@salesforce/lds-adapters-industries-eri 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/industries-eri.js +470 -0
- package/dist/es/es2018/types/src/generated/adapters/adapter-utils.d.ts +62 -0
- package/dist/es/es2018/types/src/generated/adapters/getERIDigest.d.ts +16 -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 +2 -0
- package/dist/es/es2018/types/src/generated/resources/postConnectEriDigest.d.ts +13 -0
- package/dist/es/es2018/types/src/generated/types/DigestNotification.d.ts +62 -0
- package/dist/es/es2018/types/src/generated/types/ERIDigestInputRepresentation.d.ts +29 -0
- package/dist/es/es2018/types/src/generated/types/ERIDigestInputRepresentationWrapper.d.ts +29 -0
- package/dist/es/es2018/types/src/generated/types/ERIDigestOutputRepresentation.d.ts +51 -0
- package/dist/es/es2018/types/src/generated/types/FollowingInfo.d.ts +34 -0
- package/dist/es/es2018/types/src/generated/types/FollowingInfoInputRepresentation.d.ts +40 -0
- package/dist/es/es2018/types/src/generated/types/type-utils.d.ts +32 -0
- package/package.json +74 -0
- package/sfdc/index.d.ts +1 -0
- package/sfdc/index.js +498 -0
- package/src/raml/api.raml +173 -0
- package/src/raml/luvio.raml +22 -0
package/sfdc/index.js
ADDED
|
@@ -0,0 +1,498 @@
|
|
|
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 { withDefaultLuvio } from 'force/ldsEngine';
|
|
16
|
+
import { serializeStructuredKey, ingestShape, deepFreeze, StoreKeyMap, createResourceParams as createResourceParams$1 } from 'force/luvioEngine';
|
|
17
|
+
|
|
18
|
+
const { hasOwnProperty: ObjectPrototypeHasOwnProperty } = Object.prototype;
|
|
19
|
+
const { keys: ObjectKeys$1, create: ObjectCreate$1 } = Object;
|
|
20
|
+
const { isArray: ArrayIsArray$1 } = Array;
|
|
21
|
+
/**
|
|
22
|
+
* Validates an adapter config is well-formed.
|
|
23
|
+
* @param config The config to validate.
|
|
24
|
+
* @param adapter The adapter validation configuration.
|
|
25
|
+
* @param oneOf The keys the config must contain at least one of.
|
|
26
|
+
* @throws A TypeError if config doesn't satisfy the adapter's config validation.
|
|
27
|
+
*/
|
|
28
|
+
function validateConfig(config, adapter, oneOf) {
|
|
29
|
+
const { displayName } = adapter;
|
|
30
|
+
const { required, optional, unsupported } = adapter.parameters;
|
|
31
|
+
if (config === undefined ||
|
|
32
|
+
required.every(req => ObjectPrototypeHasOwnProperty.call(config, req)) === false) {
|
|
33
|
+
throw new TypeError(`adapter ${displayName} configuration must specify ${required.sort().join(', ')}`);
|
|
34
|
+
}
|
|
35
|
+
if (oneOf && oneOf.some(req => ObjectPrototypeHasOwnProperty.call(config, req)) === false) {
|
|
36
|
+
throw new TypeError(`adapter ${displayName} configuration must specify one of ${oneOf.sort().join(', ')}`);
|
|
37
|
+
}
|
|
38
|
+
if (unsupported !== undefined &&
|
|
39
|
+
unsupported.some(req => ObjectPrototypeHasOwnProperty.call(config, req))) {
|
|
40
|
+
throw new TypeError(`adapter ${displayName} does not yet support ${unsupported.sort().join(', ')}`);
|
|
41
|
+
}
|
|
42
|
+
const supported = required.concat(optional);
|
|
43
|
+
if (ObjectKeys$1(config).some(key => !supported.includes(key))) {
|
|
44
|
+
throw new TypeError(`adapter ${displayName} configuration supports only ${supported.sort().join(', ')}`);
|
|
45
|
+
}
|
|
46
|
+
}
|
|
47
|
+
function untrustedIsObject(untrusted) {
|
|
48
|
+
return typeof untrusted === 'object' && untrusted !== null && ArrayIsArray$1(untrusted) === false;
|
|
49
|
+
}
|
|
50
|
+
function areRequiredParametersPresent(config, configPropertyNames) {
|
|
51
|
+
return configPropertyNames.parameters.required.every(req => req in config);
|
|
52
|
+
}
|
|
53
|
+
function generateParamConfigMetadata(name, required, resourceType, typeCheckShape, isArrayShape = false, coerceFn) {
|
|
54
|
+
return {
|
|
55
|
+
name,
|
|
56
|
+
required,
|
|
57
|
+
resourceType,
|
|
58
|
+
typeCheckShape,
|
|
59
|
+
isArrayShape,
|
|
60
|
+
coerceFn,
|
|
61
|
+
};
|
|
62
|
+
}
|
|
63
|
+
function buildAdapterValidationConfig(displayName, paramsMeta) {
|
|
64
|
+
const required = paramsMeta.filter(p => p.required).map(p => p.name);
|
|
65
|
+
const optional = paramsMeta.filter(p => !p.required).map(p => p.name);
|
|
66
|
+
return {
|
|
67
|
+
displayName,
|
|
68
|
+
parameters: {
|
|
69
|
+
required,
|
|
70
|
+
optional,
|
|
71
|
+
}
|
|
72
|
+
};
|
|
73
|
+
}
|
|
74
|
+
const keyPrefix = 'eri';
|
|
75
|
+
|
|
76
|
+
const { keys: ObjectKeys, create: ObjectCreate, assign: ObjectAssign } = Object;
|
|
77
|
+
const { isArray: ArrayIsArray } = Array;
|
|
78
|
+
const { stringify: JSONStringify } = JSON;
|
|
79
|
+
function createLink(ref) {
|
|
80
|
+
return {
|
|
81
|
+
__ref: serializeStructuredKey(ref),
|
|
82
|
+
};
|
|
83
|
+
}
|
|
84
|
+
|
|
85
|
+
function validate$4(obj, path = 'FollowingInfoInputRepresentation') {
|
|
86
|
+
const v_error = (() => {
|
|
87
|
+
if (typeof obj !== 'object' || ArrayIsArray(obj) || obj === null) {
|
|
88
|
+
return new TypeError('Expected "object" but received "' + typeof obj + '" (at "' + path + '")');
|
|
89
|
+
}
|
|
90
|
+
if (obj.demo !== undefined) {
|
|
91
|
+
const obj_demo = obj.demo;
|
|
92
|
+
const path_demo = path + '.demo';
|
|
93
|
+
if (typeof obj_demo !== 'boolean') {
|
|
94
|
+
return new TypeError('Expected "boolean" but received "' + typeof obj_demo + '" (at "' + path_demo + '")');
|
|
95
|
+
}
|
|
96
|
+
}
|
|
97
|
+
if (obj.filterTypes !== undefined) {
|
|
98
|
+
const obj_filterTypes = obj.filterTypes;
|
|
99
|
+
const path_filterTypes = path + '.filterTypes';
|
|
100
|
+
if (!ArrayIsArray(obj_filterTypes)) {
|
|
101
|
+
return new TypeError('Expected "array" but received "' + typeof obj_filterTypes + '" (at "' + path_filterTypes + '")');
|
|
102
|
+
}
|
|
103
|
+
for (let i = 0; i < obj_filterTypes.length; i++) {
|
|
104
|
+
const obj_filterTypes_item = obj_filterTypes[i];
|
|
105
|
+
const path_filterTypes_item = path_filterTypes + '[' + i + ']';
|
|
106
|
+
if (typeof obj_filterTypes_item !== 'string') {
|
|
107
|
+
return new TypeError('Expected "string" but received "' + typeof obj_filterTypes_item + '" (at "' + path_filterTypes_item + '")');
|
|
108
|
+
}
|
|
109
|
+
}
|
|
110
|
+
}
|
|
111
|
+
if (obj.hasNext !== undefined) {
|
|
112
|
+
const obj_hasNext = obj.hasNext;
|
|
113
|
+
const path_hasNext = path + '.hasNext';
|
|
114
|
+
if (typeof obj_hasNext !== 'boolean') {
|
|
115
|
+
return new TypeError('Expected "boolean" but received "' + typeof obj_hasNext + '" (at "' + path_hasNext + '")');
|
|
116
|
+
}
|
|
117
|
+
}
|
|
118
|
+
if (obj.page !== undefined) {
|
|
119
|
+
const obj_page = obj.page;
|
|
120
|
+
const path_page = path + '.page';
|
|
121
|
+
if (typeof obj_page !== 'number' || (typeof obj_page === 'number' && Math.floor(obj_page) !== obj_page)) {
|
|
122
|
+
return new TypeError('Expected "integer" but received "' + typeof obj_page + '" (at "' + path_page + '")');
|
|
123
|
+
}
|
|
124
|
+
}
|
|
125
|
+
if (obj.recordIds !== undefined) {
|
|
126
|
+
const obj_recordIds = obj.recordIds;
|
|
127
|
+
const path_recordIds = path + '.recordIds';
|
|
128
|
+
if (!ArrayIsArray(obj_recordIds)) {
|
|
129
|
+
return new TypeError('Expected "array" but received "' + typeof obj_recordIds + '" (at "' + path_recordIds + '")');
|
|
130
|
+
}
|
|
131
|
+
for (let i = 0; i < obj_recordIds.length; i++) {
|
|
132
|
+
const obj_recordIds_item = obj_recordIds[i];
|
|
133
|
+
const path_recordIds_item = path_recordIds + '[' + i + ']';
|
|
134
|
+
if (typeof obj_recordIds_item !== 'string') {
|
|
135
|
+
return new TypeError('Expected "string" but received "' + typeof obj_recordIds_item + '" (at "' + path_recordIds_item + '")');
|
|
136
|
+
}
|
|
137
|
+
}
|
|
138
|
+
}
|
|
139
|
+
})();
|
|
140
|
+
return v_error === undefined ? null : v_error;
|
|
141
|
+
}
|
|
142
|
+
|
|
143
|
+
function validate$3(obj, path = 'ERIDigestInputRepresentation') {
|
|
144
|
+
const v_error = (() => {
|
|
145
|
+
if (typeof obj !== 'object' || ArrayIsArray(obj) || obj === null) {
|
|
146
|
+
return new TypeError('Expected "object" but received "' + typeof obj + '" (at "' + path + '")');
|
|
147
|
+
}
|
|
148
|
+
const obj_following = obj.following;
|
|
149
|
+
const path_following = path + '.following';
|
|
150
|
+
const referencepath_followingValidationError = validate$4(obj_following, path_following);
|
|
151
|
+
if (referencepath_followingValidationError !== null) {
|
|
152
|
+
let message = 'Object doesn\'t match FollowingInfoInputRepresentation (at "' + path_following + '")\n';
|
|
153
|
+
message += referencepath_followingValidationError.message.split('\n').map((line) => '\t' + line).join('\n');
|
|
154
|
+
return new TypeError(message);
|
|
155
|
+
}
|
|
156
|
+
})();
|
|
157
|
+
return v_error === undefined ? null : v_error;
|
|
158
|
+
}
|
|
159
|
+
|
|
160
|
+
function validate$2(obj, path = 'FollowingInfo') {
|
|
161
|
+
const v_error = (() => {
|
|
162
|
+
if (typeof obj !== 'object' || ArrayIsArray(obj) || obj === null) {
|
|
163
|
+
return new TypeError('Expected "object" but received "' + typeof obj + '" (at "' + path + '")');
|
|
164
|
+
}
|
|
165
|
+
const obj_filterTypes = obj.filterTypes;
|
|
166
|
+
const path_filterTypes = path + '.filterTypes';
|
|
167
|
+
if (!ArrayIsArray(obj_filterTypes)) {
|
|
168
|
+
return new TypeError('Expected "array" but received "' + typeof obj_filterTypes + '" (at "' + path_filterTypes + '")');
|
|
169
|
+
}
|
|
170
|
+
for (let i = 0; i < obj_filterTypes.length; i++) {
|
|
171
|
+
const obj_filterTypes_item = obj_filterTypes[i];
|
|
172
|
+
const path_filterTypes_item = path_filterTypes + '[' + i + ']';
|
|
173
|
+
if (typeof obj_filterTypes_item !== 'string') {
|
|
174
|
+
return new TypeError('Expected "string" but received "' + typeof obj_filterTypes_item + '" (at "' + path_filterTypes_item + '")');
|
|
175
|
+
}
|
|
176
|
+
}
|
|
177
|
+
const obj_page = obj.page;
|
|
178
|
+
const path_page = path + '.page';
|
|
179
|
+
if (typeof obj_page !== 'number' || (typeof obj_page === 'number' && Math.floor(obj_page) !== obj_page)) {
|
|
180
|
+
return new TypeError('Expected "integer" but received "' + typeof obj_page + '" (at "' + path_page + '")');
|
|
181
|
+
}
|
|
182
|
+
const obj_recordIds = obj.recordIds;
|
|
183
|
+
const path_recordIds = path + '.recordIds';
|
|
184
|
+
if (!ArrayIsArray(obj_recordIds)) {
|
|
185
|
+
return new TypeError('Expected "array" but received "' + typeof obj_recordIds + '" (at "' + path_recordIds + '")');
|
|
186
|
+
}
|
|
187
|
+
for (let i = 0; i < obj_recordIds.length; i++) {
|
|
188
|
+
const obj_recordIds_item = obj_recordIds[i];
|
|
189
|
+
const path_recordIds_item = path_recordIds + '[' + i + ']';
|
|
190
|
+
if (typeof obj_recordIds_item !== 'string') {
|
|
191
|
+
return new TypeError('Expected "string" but received "' + typeof obj_recordIds_item + '" (at "' + path_recordIds_item + '")');
|
|
192
|
+
}
|
|
193
|
+
}
|
|
194
|
+
})();
|
|
195
|
+
return v_error === undefined ? null : v_error;
|
|
196
|
+
}
|
|
197
|
+
|
|
198
|
+
function validate$1(obj, path = 'DigestNotification') {
|
|
199
|
+
const v_error = (() => {
|
|
200
|
+
if (typeof obj !== 'object' || ArrayIsArray(obj) || obj === null) {
|
|
201
|
+
return new TypeError('Expected "object" but received "' + typeof obj + '" (at "' + path + '")');
|
|
202
|
+
}
|
|
203
|
+
const obj_fields = obj.fields;
|
|
204
|
+
const path_fields = path + '.fields';
|
|
205
|
+
if (!ArrayIsArray(obj_fields)) {
|
|
206
|
+
return new TypeError('Expected "array" but received "' + typeof obj_fields + '" (at "' + path_fields + '")');
|
|
207
|
+
}
|
|
208
|
+
for (let i = 0; i < obj_fields.length; i++) {
|
|
209
|
+
const obj_fields_item = obj_fields[i];
|
|
210
|
+
const path_fields_item = path_fields + '[' + i + ']';
|
|
211
|
+
if (typeof obj_fields_item !== 'object' || ArrayIsArray(obj_fields_item) || obj_fields_item === null) {
|
|
212
|
+
return new TypeError('Expected "object" but received "' + typeof obj_fields_item + '" (at "' + path_fields_item + '")');
|
|
213
|
+
}
|
|
214
|
+
const obj_fields_item_keys = ObjectKeys(obj_fields_item);
|
|
215
|
+
for (let i = 0; i < obj_fields_item_keys.length; i++) {
|
|
216
|
+
const key = obj_fields_item_keys[i];
|
|
217
|
+
const obj_fields_item_prop = obj_fields_item[key];
|
|
218
|
+
const path_fields_item_prop = path_fields_item + '["' + key + '"]';
|
|
219
|
+
if (typeof obj_fields_item_prop !== 'string') {
|
|
220
|
+
return new TypeError('Expected "string" but received "' + typeof obj_fields_item_prop + '" (at "' + path_fields_item_prop + '")');
|
|
221
|
+
}
|
|
222
|
+
}
|
|
223
|
+
}
|
|
224
|
+
const obj_id = obj.id;
|
|
225
|
+
const path_id = path + '.id';
|
|
226
|
+
if (typeof obj_id !== 'string') {
|
|
227
|
+
return new TypeError('Expected "string" but received "' + typeof obj_id + '" (at "' + path_id + '")');
|
|
228
|
+
}
|
|
229
|
+
const obj_name = obj.name;
|
|
230
|
+
const path_name = path + '.name';
|
|
231
|
+
if (typeof obj_name !== 'string') {
|
|
232
|
+
return new TypeError('Expected "string" but received "' + typeof obj_name + '" (at "' + path_name + '")');
|
|
233
|
+
}
|
|
234
|
+
const obj_navigationLink = obj.navigationLink;
|
|
235
|
+
const path_navigationLink = path + '.navigationLink';
|
|
236
|
+
if (typeof obj_navigationLink !== 'string') {
|
|
237
|
+
return new TypeError('Expected "string" but received "' + typeof obj_navigationLink + '" (at "' + path_navigationLink + '")');
|
|
238
|
+
}
|
|
239
|
+
if (obj.read !== undefined) {
|
|
240
|
+
const obj_read = obj.read;
|
|
241
|
+
const path_read = path + '.read';
|
|
242
|
+
if (typeof obj_read !== 'boolean') {
|
|
243
|
+
return new TypeError('Expected "boolean" but received "' + typeof obj_read + '" (at "' + path_read + '")');
|
|
244
|
+
}
|
|
245
|
+
}
|
|
246
|
+
const obj_recordId = obj.recordId;
|
|
247
|
+
const path_recordId = path + '.recordId';
|
|
248
|
+
if (typeof obj_recordId !== 'string') {
|
|
249
|
+
return new TypeError('Expected "string" but received "' + typeof obj_recordId + '" (at "' + path_recordId + '")');
|
|
250
|
+
}
|
|
251
|
+
if (obj.recordTypeId !== undefined) {
|
|
252
|
+
const obj_recordTypeId = obj.recordTypeId;
|
|
253
|
+
const path_recordTypeId = path + '.recordTypeId';
|
|
254
|
+
if (typeof obj_recordTypeId !== 'string') {
|
|
255
|
+
return new TypeError('Expected "string" but received "' + typeof obj_recordTypeId + '" (at "' + path_recordTypeId + '")');
|
|
256
|
+
}
|
|
257
|
+
}
|
|
258
|
+
const obj_sobjectType = obj.sobjectType;
|
|
259
|
+
const path_sobjectType = path + '.sobjectType';
|
|
260
|
+
if (typeof obj_sobjectType !== 'string') {
|
|
261
|
+
return new TypeError('Expected "string" but received "' + typeof obj_sobjectType + '" (at "' + path_sobjectType + '")');
|
|
262
|
+
}
|
|
263
|
+
const obj_sobjectTypeLabel = obj.sobjectTypeLabel;
|
|
264
|
+
const path_sobjectTypeLabel = path + '.sobjectTypeLabel';
|
|
265
|
+
if (typeof obj_sobjectTypeLabel !== 'string') {
|
|
266
|
+
return new TypeError('Expected "string" but received "' + typeof obj_sobjectTypeLabel + '" (at "' + path_sobjectTypeLabel + '")');
|
|
267
|
+
}
|
|
268
|
+
const obj_timeStamp = obj.timeStamp;
|
|
269
|
+
const path_timeStamp = path + '.timeStamp';
|
|
270
|
+
if (typeof obj_timeStamp !== 'string') {
|
|
271
|
+
return new TypeError('Expected "string" but received "' + typeof obj_timeStamp + '" (at "' + path_timeStamp + '")');
|
|
272
|
+
}
|
|
273
|
+
const obj_type = obj.type;
|
|
274
|
+
const path_type = path + '.type';
|
|
275
|
+
if (typeof obj_type !== 'string') {
|
|
276
|
+
return new TypeError('Expected "string" but received "' + typeof obj_type + '" (at "' + path_type + '")');
|
|
277
|
+
}
|
|
278
|
+
})();
|
|
279
|
+
return v_error === undefined ? null : v_error;
|
|
280
|
+
}
|
|
281
|
+
|
|
282
|
+
const TTL = 1000;
|
|
283
|
+
const VERSION = "954674f4e56dd5b956cf98542401fda9";
|
|
284
|
+
function validate(obj, path = 'ERIDigestOutputRepresentation') {
|
|
285
|
+
const v_error = (() => {
|
|
286
|
+
if (typeof obj !== 'object' || ArrayIsArray(obj) || obj === null) {
|
|
287
|
+
return new TypeError('Expected "object" but received "' + typeof obj + '" (at "' + path + '")');
|
|
288
|
+
}
|
|
289
|
+
if (obj.errorMsg !== undefined) {
|
|
290
|
+
const obj_errorMsg = obj.errorMsg;
|
|
291
|
+
const path_errorMsg = path + '.errorMsg';
|
|
292
|
+
if (typeof obj_errorMsg !== 'string') {
|
|
293
|
+
return new TypeError('Expected "string" but received "' + typeof obj_errorMsg + '" (at "' + path_errorMsg + '")');
|
|
294
|
+
}
|
|
295
|
+
}
|
|
296
|
+
if (obj.following !== undefined) {
|
|
297
|
+
const obj_following = obj.following;
|
|
298
|
+
const path_following = path + '.following';
|
|
299
|
+
const referencepath_followingValidationError = validate$2(obj_following, path_following);
|
|
300
|
+
if (referencepath_followingValidationError !== null) {
|
|
301
|
+
let message = 'Object doesn\'t match FollowingInfo (at "' + path_following + '")\n';
|
|
302
|
+
message += referencepath_followingValidationError.message.split('\n').map((line) => '\t' + line).join('\n');
|
|
303
|
+
return new TypeError(message);
|
|
304
|
+
}
|
|
305
|
+
}
|
|
306
|
+
if (obj.notifications !== undefined) {
|
|
307
|
+
const obj_notifications = obj.notifications;
|
|
308
|
+
const path_notifications = path + '.notifications';
|
|
309
|
+
if (!ArrayIsArray(obj_notifications)) {
|
|
310
|
+
return new TypeError('Expected "array" but received "' + typeof obj_notifications + '" (at "' + path_notifications + '")');
|
|
311
|
+
}
|
|
312
|
+
for (let i = 0; i < obj_notifications.length; i++) {
|
|
313
|
+
const obj_notifications_item = obj_notifications[i];
|
|
314
|
+
const path_notifications_item = path_notifications + '[' + i + ']';
|
|
315
|
+
const referencepath_notifications_itemValidationError = validate$1(obj_notifications_item, path_notifications_item);
|
|
316
|
+
if (referencepath_notifications_itemValidationError !== null) {
|
|
317
|
+
let message = 'Object doesn\'t match DigestNotification (at "' + path_notifications_item + '")\n';
|
|
318
|
+
message += referencepath_notifications_itemValidationError.message.split('\n').map((line) => '\t' + line).join('\n');
|
|
319
|
+
return new TypeError(message);
|
|
320
|
+
}
|
|
321
|
+
}
|
|
322
|
+
}
|
|
323
|
+
const obj_requestSucceeded = obj.requestSucceeded;
|
|
324
|
+
const path_requestSucceeded = path + '.requestSucceeded';
|
|
325
|
+
if (typeof obj_requestSucceeded !== 'boolean') {
|
|
326
|
+
return new TypeError('Expected "boolean" but received "' + typeof obj_requestSucceeded + '" (at "' + path_requestSucceeded + '")');
|
|
327
|
+
}
|
|
328
|
+
const obj_statusCode = obj.statusCode;
|
|
329
|
+
const path_statusCode = path + '.statusCode';
|
|
330
|
+
if (typeof obj_statusCode !== 'string') {
|
|
331
|
+
return new TypeError('Expected "string" but received "' + typeof obj_statusCode + '" (at "' + path_statusCode + '")');
|
|
332
|
+
}
|
|
333
|
+
})();
|
|
334
|
+
return v_error === undefined ? null : v_error;
|
|
335
|
+
}
|
|
336
|
+
const RepresentationType = 'ERIDigestOutputRepresentation';
|
|
337
|
+
function keyBuilder(luvio, config) {
|
|
338
|
+
return keyPrefix + '::' + RepresentationType + ':' + config.isSuccess;
|
|
339
|
+
}
|
|
340
|
+
function keyBuilderFromType(luvio, object) {
|
|
341
|
+
const keyParams = {
|
|
342
|
+
isSuccess: object.requestSucceeded
|
|
343
|
+
};
|
|
344
|
+
return keyBuilder(luvio, keyParams);
|
|
345
|
+
}
|
|
346
|
+
function normalize(input, existing, path, luvio, store, timestamp) {
|
|
347
|
+
return input;
|
|
348
|
+
}
|
|
349
|
+
const select$1 = function ERIDigestOutputRepresentationSelect() {
|
|
350
|
+
return {
|
|
351
|
+
kind: 'Fragment',
|
|
352
|
+
version: VERSION,
|
|
353
|
+
private: [],
|
|
354
|
+
opaque: true
|
|
355
|
+
};
|
|
356
|
+
};
|
|
357
|
+
function equals(existing, incoming) {
|
|
358
|
+
if (JSONStringify(incoming) !== JSONStringify(existing)) {
|
|
359
|
+
return false;
|
|
360
|
+
}
|
|
361
|
+
return true;
|
|
362
|
+
}
|
|
363
|
+
const ingest = function ERIDigestOutputRepresentationIngest(input, path, luvio, store, timestamp) {
|
|
364
|
+
if (process.env.NODE_ENV !== 'production') {
|
|
365
|
+
const validateError = validate(input);
|
|
366
|
+
if (validateError !== null) {
|
|
367
|
+
throw validateError;
|
|
368
|
+
}
|
|
369
|
+
}
|
|
370
|
+
const key = keyBuilderFromType(luvio, input);
|
|
371
|
+
const ttlToUse = TTL;
|
|
372
|
+
ingestShape(input, path, luvio, store, timestamp, ttlToUse, key, normalize, "eri", VERSION, RepresentationType, equals);
|
|
373
|
+
return createLink(key);
|
|
374
|
+
};
|
|
375
|
+
function getTypeCacheKeys(rootKeySet, luvio, input, fullPathFactory) {
|
|
376
|
+
// root cache key (uses fullPathFactory if keyBuilderFromType isn't defined)
|
|
377
|
+
const rootKey = keyBuilderFromType(luvio, input);
|
|
378
|
+
rootKeySet.set(rootKey, {
|
|
379
|
+
namespace: keyPrefix,
|
|
380
|
+
representationName: RepresentationType,
|
|
381
|
+
mergeable: false
|
|
382
|
+
});
|
|
383
|
+
}
|
|
384
|
+
|
|
385
|
+
function select(luvio, params) {
|
|
386
|
+
return select$1();
|
|
387
|
+
}
|
|
388
|
+
function getResponseCacheKeys(storeKeyMap, luvio, resourceParams, response) {
|
|
389
|
+
getTypeCacheKeys(storeKeyMap, luvio, response);
|
|
390
|
+
}
|
|
391
|
+
function ingestSuccess(luvio, resourceParams, response) {
|
|
392
|
+
const { body } = response;
|
|
393
|
+
const key = keyBuilderFromType(luvio, body);
|
|
394
|
+
luvio.storeIngest(key, ingest, body);
|
|
395
|
+
const snapshot = luvio.storeLookup({
|
|
396
|
+
recordId: key,
|
|
397
|
+
node: select(),
|
|
398
|
+
variables: {},
|
|
399
|
+
});
|
|
400
|
+
if (process.env.NODE_ENV !== 'production') {
|
|
401
|
+
if (snapshot.state !== 'Fulfilled') {
|
|
402
|
+
throw new Error('Invalid network response. Expected resource response to result in Fulfilled snapshot');
|
|
403
|
+
}
|
|
404
|
+
}
|
|
405
|
+
deepFreeze(snapshot.data);
|
|
406
|
+
return snapshot;
|
|
407
|
+
}
|
|
408
|
+
function createResourceRequest(config) {
|
|
409
|
+
const headers = {};
|
|
410
|
+
return {
|
|
411
|
+
baseUri: '/services/data/v66.0',
|
|
412
|
+
basePath: '/connect/eri/digest',
|
|
413
|
+
method: 'post',
|
|
414
|
+
body: config.body,
|
|
415
|
+
urlParams: {},
|
|
416
|
+
queryParams: {},
|
|
417
|
+
headers,
|
|
418
|
+
priority: 'normal',
|
|
419
|
+
};
|
|
420
|
+
}
|
|
421
|
+
|
|
422
|
+
const adapterName = 'getERIDigest';
|
|
423
|
+
const getERIDigest_ConfigPropertyMetadata = [
|
|
424
|
+
generateParamConfigMetadata('eriDigestInput', true, 2 /* Body */, 4 /* Unsupported */),
|
|
425
|
+
];
|
|
426
|
+
const getERIDigest_ConfigPropertyNames = /*#__PURE__*/ buildAdapterValidationConfig(adapterName, getERIDigest_ConfigPropertyMetadata);
|
|
427
|
+
const createResourceParams = /*#__PURE__*/ createResourceParams$1(getERIDigest_ConfigPropertyMetadata);
|
|
428
|
+
function typeCheckConfig(untrustedConfig) {
|
|
429
|
+
const config = {};
|
|
430
|
+
const untrustedConfig_eriDigestInput = untrustedConfig.eriDigestInput;
|
|
431
|
+
const referenceERIDigestInputRepresentationValidationError = validate$3(untrustedConfig_eriDigestInput);
|
|
432
|
+
if (referenceERIDigestInputRepresentationValidationError === null) {
|
|
433
|
+
config.eriDigestInput = untrustedConfig_eriDigestInput;
|
|
434
|
+
}
|
|
435
|
+
return config;
|
|
436
|
+
}
|
|
437
|
+
function validateAdapterConfig(untrustedConfig, configPropertyNames) {
|
|
438
|
+
if (!untrustedIsObject(untrustedConfig)) {
|
|
439
|
+
return null;
|
|
440
|
+
}
|
|
441
|
+
if (process.env.NODE_ENV !== 'production') {
|
|
442
|
+
validateConfig(untrustedConfig, configPropertyNames);
|
|
443
|
+
}
|
|
444
|
+
const config = typeCheckConfig(untrustedConfig);
|
|
445
|
+
if (!areRequiredParametersPresent(config, configPropertyNames)) {
|
|
446
|
+
return null;
|
|
447
|
+
}
|
|
448
|
+
return config;
|
|
449
|
+
}
|
|
450
|
+
function buildNetworkSnapshot(luvio, config, options) {
|
|
451
|
+
const resourceParams = createResourceParams(config);
|
|
452
|
+
const request = createResourceRequest(resourceParams);
|
|
453
|
+
return luvio.dispatchResourceRequest(request, options)
|
|
454
|
+
.then((response) => {
|
|
455
|
+
return luvio.handleSuccessResponse(() => {
|
|
456
|
+
const snapshot = ingestSuccess(luvio, resourceParams, response);
|
|
457
|
+
return luvio.storeBroadcast().then(() => snapshot);
|
|
458
|
+
}, () => {
|
|
459
|
+
const cache = new StoreKeyMap();
|
|
460
|
+
getResponseCacheKeys(cache, luvio, resourceParams, response.body);
|
|
461
|
+
return cache;
|
|
462
|
+
});
|
|
463
|
+
}, (response) => {
|
|
464
|
+
deepFreeze(response);
|
|
465
|
+
throw response;
|
|
466
|
+
});
|
|
467
|
+
}
|
|
468
|
+
const getERIDigestAdapterFactory = (luvio) => {
|
|
469
|
+
return function getERIDigest(untrustedConfig) {
|
|
470
|
+
const config = validateAdapterConfig(untrustedConfig, getERIDigest_ConfigPropertyNames);
|
|
471
|
+
// Invalid or incomplete config
|
|
472
|
+
if (config === null) {
|
|
473
|
+
throw new Error('Invalid config for "getERIDigest"');
|
|
474
|
+
}
|
|
475
|
+
return buildNetworkSnapshot(luvio, config);
|
|
476
|
+
};
|
|
477
|
+
};
|
|
478
|
+
|
|
479
|
+
let getERIDigest;
|
|
480
|
+
// Notify Update Available
|
|
481
|
+
function bindExportsTo(luvio) {
|
|
482
|
+
// LDS Adapters
|
|
483
|
+
function unwrapSnapshotData(factory) {
|
|
484
|
+
const adapter = factory(luvio);
|
|
485
|
+
return (config) => adapter(config).then((snapshot) => snapshot.data);
|
|
486
|
+
}
|
|
487
|
+
return {
|
|
488
|
+
getERIDigest: unwrapSnapshotData(getERIDigestAdapterFactory),
|
|
489
|
+
// Imperative GET Adapters
|
|
490
|
+
// Notify Update Availables
|
|
491
|
+
};
|
|
492
|
+
}
|
|
493
|
+
withDefaultLuvio((luvio) => {
|
|
494
|
+
({ getERIDigest } = bindExportsTo(luvio));
|
|
495
|
+
});
|
|
496
|
+
|
|
497
|
+
export { getERIDigest };
|
|
498
|
+
// version: 0.1.0-dev1-c978a7b010
|
|
@@ -0,0 +1,173 @@
|
|
|
1
|
+
#%RAML 1.0
|
|
2
|
+
securedBy:
|
|
3
|
+
- OAuth2
|
|
4
|
+
title: Salesforce Connect API
|
|
5
|
+
version: '56.0'
|
|
6
|
+
mediaType: application/json
|
|
7
|
+
protocols:
|
|
8
|
+
- https
|
|
9
|
+
baseUri: /services/data/v66.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
|
+
DigestNotification:
|
|
29
|
+
description: Digest notification
|
|
30
|
+
type: object
|
|
31
|
+
properties:
|
|
32
|
+
fields:
|
|
33
|
+
description: Display fields in the notification
|
|
34
|
+
type: array
|
|
35
|
+
items:
|
|
36
|
+
type: object
|
|
37
|
+
properties:
|
|
38
|
+
//:
|
|
39
|
+
type: string
|
|
40
|
+
id:
|
|
41
|
+
description: Unique id of the notification in the digest
|
|
42
|
+
type: string
|
|
43
|
+
name:
|
|
44
|
+
description: Record Name referenced in this notification
|
|
45
|
+
type: string
|
|
46
|
+
navigationLink:
|
|
47
|
+
description: Navigation Url
|
|
48
|
+
type: string
|
|
49
|
+
recordId:
|
|
50
|
+
description: Record id referenced in this notification
|
|
51
|
+
type: string
|
|
52
|
+
recordTypeId:
|
|
53
|
+
description: Record id type referenced in this notification
|
|
54
|
+
type: string
|
|
55
|
+
required: false
|
|
56
|
+
sobjectType:
|
|
57
|
+
description: Sobject Type of the record referenced in this notification
|
|
58
|
+
type: string
|
|
59
|
+
sobjectTypeLabel:
|
|
60
|
+
description: Sobject type label of the record referenced in this notification
|
|
61
|
+
type: string
|
|
62
|
+
timeStamp:
|
|
63
|
+
description: Time when this relationship is found
|
|
64
|
+
type: string
|
|
65
|
+
read:
|
|
66
|
+
description: true if the notification is read by the user
|
|
67
|
+
type: boolean
|
|
68
|
+
required: false
|
|
69
|
+
type:
|
|
70
|
+
description: Notificatio type
|
|
71
|
+
type: string
|
|
72
|
+
enum:
|
|
73
|
+
- JobChangeNotification
|
|
74
|
+
- RelationNotification
|
|
75
|
+
- NewsNotification
|
|
76
|
+
FollowingInfoInputRepresentation:
|
|
77
|
+
description: An Input Representation following object
|
|
78
|
+
type: object
|
|
79
|
+
properties:
|
|
80
|
+
filterTypes:
|
|
81
|
+
description: List of sObjectTypes used in home page mappings
|
|
82
|
+
type: array
|
|
83
|
+
required: false
|
|
84
|
+
items:
|
|
85
|
+
type: string
|
|
86
|
+
page:
|
|
87
|
+
description: 'Page number of the eri relationship digest list '
|
|
88
|
+
type: integer
|
|
89
|
+
required: false
|
|
90
|
+
recordIds:
|
|
91
|
+
description: List of RecordIds being followed by the user
|
|
92
|
+
type: array
|
|
93
|
+
required: false
|
|
94
|
+
items:
|
|
95
|
+
type: string
|
|
96
|
+
hasNext:
|
|
97
|
+
description: true if there any more recordIds to be queried for notifications else false
|
|
98
|
+
type: boolean
|
|
99
|
+
required: false
|
|
100
|
+
demo:
|
|
101
|
+
description: true for demo reponse else false
|
|
102
|
+
type: boolean
|
|
103
|
+
required: false
|
|
104
|
+
ERIDigestInputRepresentation:
|
|
105
|
+
description: An Input Representation for ERI digest
|
|
106
|
+
type: object
|
|
107
|
+
properties:
|
|
108
|
+
following:
|
|
109
|
+
type: FollowingInfoInputRepresentation
|
|
110
|
+
description: following input
|
|
111
|
+
ERIDigestInputRepresentationWrapper:
|
|
112
|
+
description: Wrapper for ERI digest input representation
|
|
113
|
+
type: object
|
|
114
|
+
properties:
|
|
115
|
+
eriDigestInput:
|
|
116
|
+
type: ERIDigestInputRepresentation
|
|
117
|
+
description: ERI Digest input represenation
|
|
118
|
+
ERIDigestOutputRepresentation:
|
|
119
|
+
description: Output representation of a ERI Digest
|
|
120
|
+
type: object
|
|
121
|
+
properties:
|
|
122
|
+
errorMsg:
|
|
123
|
+
description: Error message
|
|
124
|
+
type: string
|
|
125
|
+
required: false
|
|
126
|
+
following:
|
|
127
|
+
description: User following records info
|
|
128
|
+
type: FollowingInfo
|
|
129
|
+
required: false
|
|
130
|
+
notifications:
|
|
131
|
+
description: Notifications list
|
|
132
|
+
type: array
|
|
133
|
+
required: false
|
|
134
|
+
items:
|
|
135
|
+
type: DigestNotification
|
|
136
|
+
requestSucceeded:
|
|
137
|
+
description: true if request is succeeded else false
|
|
138
|
+
type: boolean
|
|
139
|
+
statusCode:
|
|
140
|
+
description: Status code
|
|
141
|
+
type: string
|
|
142
|
+
FollowingInfo:
|
|
143
|
+
description: following info
|
|
144
|
+
type: object
|
|
145
|
+
properties:
|
|
146
|
+
filterTypes:
|
|
147
|
+
description: List of sObjectTypes used in home page mappings
|
|
148
|
+
type: array
|
|
149
|
+
items:
|
|
150
|
+
type: string
|
|
151
|
+
page:
|
|
152
|
+
description: 'Page number of the eri digest '
|
|
153
|
+
type: integer
|
|
154
|
+
recordIds:
|
|
155
|
+
description: List of RecordIds being followed by the user
|
|
156
|
+
type: array
|
|
157
|
+
items:
|
|
158
|
+
type: string
|
|
159
|
+
|
|
160
|
+
/connect:
|
|
161
|
+
/eri/digest:
|
|
162
|
+
post:
|
|
163
|
+
description: API to get relationship digest in ERI
|
|
164
|
+
responses:
|
|
165
|
+
'200':
|
|
166
|
+
description: Success
|
|
167
|
+
body:
|
|
168
|
+
application/json:
|
|
169
|
+
type: ERIDigestOutputRepresentation
|
|
170
|
+
body:
|
|
171
|
+
application/json:
|
|
172
|
+
type: ERIDigestInputRepresentationWrapper
|
|
173
|
+
(oas-body-name): eriDigestInput
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
#%RAML 1.0 Overlay
|
|
2
|
+
extends: ./api.raml
|
|
3
|
+
|
|
4
|
+
uses:
|
|
5
|
+
luvio: luvio://annotations.raml
|
|
6
|
+
|
|
7
|
+
(luvio.keyPrefix): 'eri'
|
|
8
|
+
(luvio.ttl): 1000
|
|
9
|
+
|
|
10
|
+
types:
|
|
11
|
+
DigestNotification:
|
|
12
|
+
(luvio.opaque): true
|
|
13
|
+
ERIDigestOutputRepresentation:
|
|
14
|
+
(luvio.ttl): 1000
|
|
15
|
+
(luvio.opaque): true
|
|
16
|
+
(luvio.key):
|
|
17
|
+
isSuccess: requestSucceeded
|
|
18
|
+
|
|
19
|
+
/connect/eri/digest:
|
|
20
|
+
post:
|
|
21
|
+
(luvio.adapter):
|
|
22
|
+
name: getERIDigest
|