@salesforce/lds-adapters-industries-eri 1.100.2
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 +528 -0
- package/dist/types/src/generated/adapters/adapter-utils.d.ts +66 -0
- package/dist/types/src/generated/adapters/getERIDigest.d.ts +15 -0
- package/dist/types/src/generated/artifacts/main.d.ts +1 -0
- package/dist/types/src/generated/artifacts/sfdc.d.ts +2 -0
- package/dist/types/src/generated/resources/postConnectEriDigest.d.ts +13 -0
- package/dist/types/src/generated/types/DigestNotification.d.ts +63 -0
- package/dist/types/src/generated/types/ERIDigestInputRepresentation.d.ts +30 -0
- package/dist/types/src/generated/types/ERIDigestInputRepresentationWrapper.d.ts +30 -0
- package/dist/types/src/generated/types/ERIDigestOutputRepresentation.d.ts +52 -0
- package/dist/types/src/generated/types/FollowingInfo.d.ts +35 -0
- package/dist/types/src/generated/types/FollowingInfoInputRepresentation.d.ts +41 -0
- package/dist/types/src/generated/types/type-utils.d.ts +39 -0
- package/dist/umd/es2018/industries-eri.js +536 -0
- package/dist/umd/es5/industries-eri.js +541 -0
- package/package.json +70 -0
- package/sfdc/index.d.ts +1 -0
- package/sfdc/index.js +555 -0
- package/src/raml/api.raml +173 -0
- package/src/raml/luvio.raml +22 -0
|
@@ -0,0 +1,541 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Copyright (c) 2022, Salesforce, Inc.,
|
|
3
|
+
* All rights reserved.
|
|
4
|
+
* For full license text, see the LICENSE.txt file
|
|
5
|
+
*/
|
|
6
|
+
|
|
7
|
+
(function (global, factory) {
|
|
8
|
+
typeof exports === 'object' && typeof module !== 'undefined' ? factory(exports, require('@luvio/engine')) :
|
|
9
|
+
typeof define === 'function' && define.amd ? define(['exports', '@luvio/engine'], factory) :
|
|
10
|
+
(global = typeof globalThis !== 'undefined' ? globalThis : global || self, factory(global.industriesEri = {}, global.engine));
|
|
11
|
+
})(this, (function (exports, engine) { 'use strict';
|
|
12
|
+
|
|
13
|
+
var ObjectPrototypeHasOwnProperty = Object.prototype.hasOwnProperty;
|
|
14
|
+
var ObjectKeys$1 = Object.keys;
|
|
15
|
+
var ArrayIsArray$1 = Array.isArray;
|
|
16
|
+
/**
|
|
17
|
+
* Validates an adapter config is well-formed.
|
|
18
|
+
* @param config The config to validate.
|
|
19
|
+
* @param adapter The adapter validation configuration.
|
|
20
|
+
* @param oneOf The keys the config must contain at least one of.
|
|
21
|
+
* @throws A TypeError if config doesn't satisfy the adapter's config validation.
|
|
22
|
+
*/
|
|
23
|
+
function validateConfig(config, adapter, oneOf) {
|
|
24
|
+
var displayName = adapter.displayName;
|
|
25
|
+
var _a = adapter.parameters, required = _a.required, optional = _a.optional, unsupported = _a.unsupported;
|
|
26
|
+
if (config === undefined ||
|
|
27
|
+
required.every(function (req) { return ObjectPrototypeHasOwnProperty.call(config, req); }) === false) {
|
|
28
|
+
throw new TypeError("adapter ".concat(displayName, " configuration must specify ").concat(required.sort().join(', ')));
|
|
29
|
+
}
|
|
30
|
+
if (oneOf && oneOf.some(function (req) { return ObjectPrototypeHasOwnProperty.call(config, req); }) === false) {
|
|
31
|
+
throw new TypeError("adapter ".concat(displayName, " configuration must specify one of ").concat(oneOf.sort().join(', ')));
|
|
32
|
+
}
|
|
33
|
+
if (unsupported !== undefined &&
|
|
34
|
+
unsupported.some(function (req) { return ObjectPrototypeHasOwnProperty.call(config, req); })) {
|
|
35
|
+
throw new TypeError("adapter ".concat(displayName, " does not yet support ").concat(unsupported.sort().join(', ')));
|
|
36
|
+
}
|
|
37
|
+
var supported = required.concat(optional);
|
|
38
|
+
if (ObjectKeys$1(config).some(function (key) { return !supported.includes(key); })) {
|
|
39
|
+
throw new TypeError("adapter ".concat(displayName, " configuration supports only ").concat(supported.sort().join(', ')));
|
|
40
|
+
}
|
|
41
|
+
}
|
|
42
|
+
function untrustedIsObject(untrusted) {
|
|
43
|
+
return typeof untrusted === 'object' && untrusted !== null && ArrayIsArray$1(untrusted) === false;
|
|
44
|
+
}
|
|
45
|
+
function areRequiredParametersPresent(config, configPropertyNames) {
|
|
46
|
+
return configPropertyNames.parameters.required.every(function (req) { return req in config; });
|
|
47
|
+
}
|
|
48
|
+
var keyPrefix = 'eri';
|
|
49
|
+
|
|
50
|
+
var ObjectFreeze = Object.freeze, ObjectKeys = Object.keys;
|
|
51
|
+
var ArrayIsArray = Array.isArray;
|
|
52
|
+
var JSONStringify = JSON.stringify;
|
|
53
|
+
function deepFreeze$3(value) {
|
|
54
|
+
// No need to freeze primitives
|
|
55
|
+
if (typeof value !== 'object' || value === null) {
|
|
56
|
+
return;
|
|
57
|
+
}
|
|
58
|
+
if (ArrayIsArray(value)) {
|
|
59
|
+
for (var i = 0, len = value.length; i < len; i += 1) {
|
|
60
|
+
deepFreeze$3(value[i]);
|
|
61
|
+
}
|
|
62
|
+
}
|
|
63
|
+
else {
|
|
64
|
+
var keys = ObjectKeys(value);
|
|
65
|
+
for (var i = 0, len = keys.length; i < len; i += 1) {
|
|
66
|
+
deepFreeze$3(value[keys[i]]);
|
|
67
|
+
}
|
|
68
|
+
}
|
|
69
|
+
ObjectFreeze(value);
|
|
70
|
+
}
|
|
71
|
+
function createLink(ref) {
|
|
72
|
+
return {
|
|
73
|
+
__ref: engine.serializeStructuredKey(ref),
|
|
74
|
+
};
|
|
75
|
+
}
|
|
76
|
+
|
|
77
|
+
function validate$4(obj, path) {
|
|
78
|
+
if (path === void 0) { path = 'FollowingInfoInputRepresentation'; }
|
|
79
|
+
var v_error = (function () {
|
|
80
|
+
if (typeof obj !== 'object' || ArrayIsArray(obj) || obj === null) {
|
|
81
|
+
return new TypeError('Expected "object" but received "' + typeof obj + '" (at "' + path + '")');
|
|
82
|
+
}
|
|
83
|
+
if (obj.demo !== undefined) {
|
|
84
|
+
var obj_demo = obj.demo;
|
|
85
|
+
var path_demo = path + '.demo';
|
|
86
|
+
if (typeof obj_demo !== 'boolean') {
|
|
87
|
+
return new TypeError('Expected "boolean" but received "' + typeof obj_demo + '" (at "' + path_demo + '")');
|
|
88
|
+
}
|
|
89
|
+
}
|
|
90
|
+
if (obj.filterTypes !== undefined) {
|
|
91
|
+
var obj_filterTypes = obj.filterTypes;
|
|
92
|
+
var path_filterTypes = path + '.filterTypes';
|
|
93
|
+
if (!ArrayIsArray(obj_filterTypes)) {
|
|
94
|
+
return new TypeError('Expected "array" but received "' + typeof obj_filterTypes + '" (at "' + path_filterTypes + '")');
|
|
95
|
+
}
|
|
96
|
+
for (var i = 0; i < obj_filterTypes.length; i++) {
|
|
97
|
+
var obj_filterTypes_item = obj_filterTypes[i];
|
|
98
|
+
var path_filterTypes_item = path_filterTypes + '[' + i + ']';
|
|
99
|
+
if (typeof obj_filterTypes_item !== 'string') {
|
|
100
|
+
return new TypeError('Expected "string" but received "' + typeof obj_filterTypes_item + '" (at "' + path_filterTypes_item + '")');
|
|
101
|
+
}
|
|
102
|
+
}
|
|
103
|
+
}
|
|
104
|
+
if (obj.hasNext !== undefined) {
|
|
105
|
+
var obj_hasNext = obj.hasNext;
|
|
106
|
+
var path_hasNext = path + '.hasNext';
|
|
107
|
+
if (typeof obj_hasNext !== 'boolean') {
|
|
108
|
+
return new TypeError('Expected "boolean" but received "' + typeof obj_hasNext + '" (at "' + path_hasNext + '")');
|
|
109
|
+
}
|
|
110
|
+
}
|
|
111
|
+
if (obj.page !== undefined) {
|
|
112
|
+
var obj_page = obj.page;
|
|
113
|
+
var path_page = path + '.page';
|
|
114
|
+
if (typeof obj_page !== 'number' || (typeof obj_page === 'number' && Math.floor(obj_page) !== obj_page)) {
|
|
115
|
+
return new TypeError('Expected "integer" but received "' + typeof obj_page + '" (at "' + path_page + '")');
|
|
116
|
+
}
|
|
117
|
+
}
|
|
118
|
+
if (obj.recordIds !== undefined) {
|
|
119
|
+
var obj_recordIds = obj.recordIds;
|
|
120
|
+
var path_recordIds = path + '.recordIds';
|
|
121
|
+
if (!ArrayIsArray(obj_recordIds)) {
|
|
122
|
+
return new TypeError('Expected "array" but received "' + typeof obj_recordIds + '" (at "' + path_recordIds + '")');
|
|
123
|
+
}
|
|
124
|
+
for (var i = 0; i < obj_recordIds.length; i++) {
|
|
125
|
+
var obj_recordIds_item = obj_recordIds[i];
|
|
126
|
+
var path_recordIds_item = path_recordIds + '[' + i + ']';
|
|
127
|
+
if (typeof obj_recordIds_item !== 'string') {
|
|
128
|
+
return new TypeError('Expected "string" but received "' + typeof obj_recordIds_item + '" (at "' + path_recordIds_item + '")');
|
|
129
|
+
}
|
|
130
|
+
}
|
|
131
|
+
}
|
|
132
|
+
})();
|
|
133
|
+
return v_error === undefined ? null : v_error;
|
|
134
|
+
}
|
|
135
|
+
|
|
136
|
+
function validate$3(obj, path) {
|
|
137
|
+
if (path === void 0) { path = 'ERIDigestInputRepresentation'; }
|
|
138
|
+
var v_error = (function () {
|
|
139
|
+
if (typeof obj !== 'object' || ArrayIsArray(obj) || obj === null) {
|
|
140
|
+
return new TypeError('Expected "object" but received "' + typeof obj + '" (at "' + path + '")');
|
|
141
|
+
}
|
|
142
|
+
var obj_following = obj.following;
|
|
143
|
+
var path_following = path + '.following';
|
|
144
|
+
var referencepath_followingValidationError = validate$4(obj_following, path_following);
|
|
145
|
+
if (referencepath_followingValidationError !== null) {
|
|
146
|
+
var message = 'Object doesn\'t match FollowingInfoInputRepresentation (at "' + path_following + '")\n';
|
|
147
|
+
message += referencepath_followingValidationError.message.split('\n').map(function (line) { return '\t' + line; }).join('\n');
|
|
148
|
+
return new TypeError(message);
|
|
149
|
+
}
|
|
150
|
+
})();
|
|
151
|
+
return v_error === undefined ? null : v_error;
|
|
152
|
+
}
|
|
153
|
+
|
|
154
|
+
function validate$2(obj, path) {
|
|
155
|
+
if (path === void 0) { path = 'FollowingInfo'; }
|
|
156
|
+
var v_error = (function () {
|
|
157
|
+
if (typeof obj !== 'object' || ArrayIsArray(obj) || obj === null) {
|
|
158
|
+
return new TypeError('Expected "object" but received "' + typeof obj + '" (at "' + path + '")');
|
|
159
|
+
}
|
|
160
|
+
var obj_filterTypes = obj.filterTypes;
|
|
161
|
+
var path_filterTypes = path + '.filterTypes';
|
|
162
|
+
if (!ArrayIsArray(obj_filterTypes)) {
|
|
163
|
+
return new TypeError('Expected "array" but received "' + typeof obj_filterTypes + '" (at "' + path_filterTypes + '")');
|
|
164
|
+
}
|
|
165
|
+
for (var i = 0; i < obj_filterTypes.length; i++) {
|
|
166
|
+
var obj_filterTypes_item = obj_filterTypes[i];
|
|
167
|
+
var path_filterTypes_item = path_filterTypes + '[' + i + ']';
|
|
168
|
+
if (typeof obj_filterTypes_item !== 'string') {
|
|
169
|
+
return new TypeError('Expected "string" but received "' + typeof obj_filterTypes_item + '" (at "' + path_filterTypes_item + '")');
|
|
170
|
+
}
|
|
171
|
+
}
|
|
172
|
+
var obj_page = obj.page;
|
|
173
|
+
var path_page = path + '.page';
|
|
174
|
+
if (typeof obj_page !== 'number' || (typeof obj_page === 'number' && Math.floor(obj_page) !== obj_page)) {
|
|
175
|
+
return new TypeError('Expected "integer" but received "' + typeof obj_page + '" (at "' + path_page + '")');
|
|
176
|
+
}
|
|
177
|
+
var obj_recordIds = obj.recordIds;
|
|
178
|
+
var path_recordIds = path + '.recordIds';
|
|
179
|
+
if (!ArrayIsArray(obj_recordIds)) {
|
|
180
|
+
return new TypeError('Expected "array" but received "' + typeof obj_recordIds + '" (at "' + path_recordIds + '")');
|
|
181
|
+
}
|
|
182
|
+
for (var i = 0; i < obj_recordIds.length; i++) {
|
|
183
|
+
var obj_recordIds_item = obj_recordIds[i];
|
|
184
|
+
var path_recordIds_item = path_recordIds + '[' + i + ']';
|
|
185
|
+
if (typeof obj_recordIds_item !== 'string') {
|
|
186
|
+
return new TypeError('Expected "string" but received "' + typeof obj_recordIds_item + '" (at "' + path_recordIds_item + '")');
|
|
187
|
+
}
|
|
188
|
+
}
|
|
189
|
+
})();
|
|
190
|
+
return v_error === undefined ? null : v_error;
|
|
191
|
+
}
|
|
192
|
+
function deepFreeze$2(input) {
|
|
193
|
+
var input_filterTypes = input.filterTypes;
|
|
194
|
+
ObjectFreeze(input_filterTypes);
|
|
195
|
+
var input_recordIds = input.recordIds;
|
|
196
|
+
ObjectFreeze(input_recordIds);
|
|
197
|
+
ObjectFreeze(input);
|
|
198
|
+
}
|
|
199
|
+
|
|
200
|
+
function validate$1(obj, path) {
|
|
201
|
+
if (path === void 0) { path = 'DigestNotification'; }
|
|
202
|
+
var v_error = (function () {
|
|
203
|
+
if (typeof obj !== 'object' || ArrayIsArray(obj) || obj === null) {
|
|
204
|
+
return new TypeError('Expected "object" but received "' + typeof obj + '" (at "' + path + '")');
|
|
205
|
+
}
|
|
206
|
+
var obj_fields = obj.fields;
|
|
207
|
+
var path_fields = path + '.fields';
|
|
208
|
+
if (!ArrayIsArray(obj_fields)) {
|
|
209
|
+
return new TypeError('Expected "array" but received "' + typeof obj_fields + '" (at "' + path_fields + '")');
|
|
210
|
+
}
|
|
211
|
+
for (var i = 0; i < obj_fields.length; i++) {
|
|
212
|
+
var obj_fields_item = obj_fields[i];
|
|
213
|
+
var path_fields_item = path_fields + '[' + i + ']';
|
|
214
|
+
if (typeof obj_fields_item !== 'object' || ArrayIsArray(obj_fields_item) || obj_fields_item === null) {
|
|
215
|
+
return new TypeError('Expected "object" but received "' + typeof obj_fields_item + '" (at "' + path_fields_item + '")');
|
|
216
|
+
}
|
|
217
|
+
var obj_fields_item_keys = ObjectKeys(obj_fields_item);
|
|
218
|
+
for (var i_1 = 0; i_1 < obj_fields_item_keys.length; i_1++) {
|
|
219
|
+
var key = obj_fields_item_keys[i_1];
|
|
220
|
+
var obj_fields_item_prop = obj_fields_item[key];
|
|
221
|
+
var path_fields_item_prop = path_fields_item + '["' + key + '"]';
|
|
222
|
+
if (typeof obj_fields_item_prop !== 'string') {
|
|
223
|
+
return new TypeError('Expected "string" but received "' + typeof obj_fields_item_prop + '" (at "' + path_fields_item_prop + '")');
|
|
224
|
+
}
|
|
225
|
+
}
|
|
226
|
+
}
|
|
227
|
+
var obj_id = obj.id;
|
|
228
|
+
var path_id = path + '.id';
|
|
229
|
+
if (typeof obj_id !== 'string') {
|
|
230
|
+
return new TypeError('Expected "string" but received "' + typeof obj_id + '" (at "' + path_id + '")');
|
|
231
|
+
}
|
|
232
|
+
var obj_name = obj.name;
|
|
233
|
+
var path_name = path + '.name';
|
|
234
|
+
if (typeof obj_name !== 'string') {
|
|
235
|
+
return new TypeError('Expected "string" but received "' + typeof obj_name + '" (at "' + path_name + '")');
|
|
236
|
+
}
|
|
237
|
+
var obj_navigationLink = obj.navigationLink;
|
|
238
|
+
var path_navigationLink = path + '.navigationLink';
|
|
239
|
+
if (typeof obj_navigationLink !== 'string') {
|
|
240
|
+
return new TypeError('Expected "string" but received "' + typeof obj_navigationLink + '" (at "' + path_navigationLink + '")');
|
|
241
|
+
}
|
|
242
|
+
if (obj.read !== undefined) {
|
|
243
|
+
var obj_read = obj.read;
|
|
244
|
+
var path_read = path + '.read';
|
|
245
|
+
if (typeof obj_read !== 'boolean') {
|
|
246
|
+
return new TypeError('Expected "boolean" but received "' + typeof obj_read + '" (at "' + path_read + '")');
|
|
247
|
+
}
|
|
248
|
+
}
|
|
249
|
+
var obj_recordId = obj.recordId;
|
|
250
|
+
var path_recordId = path + '.recordId';
|
|
251
|
+
if (typeof obj_recordId !== 'string') {
|
|
252
|
+
return new TypeError('Expected "string" but received "' + typeof obj_recordId + '" (at "' + path_recordId + '")');
|
|
253
|
+
}
|
|
254
|
+
if (obj.recordTypeId !== undefined) {
|
|
255
|
+
var obj_recordTypeId = obj.recordTypeId;
|
|
256
|
+
var path_recordTypeId = path + '.recordTypeId';
|
|
257
|
+
if (typeof obj_recordTypeId !== 'string') {
|
|
258
|
+
return new TypeError('Expected "string" but received "' + typeof obj_recordTypeId + '" (at "' + path_recordTypeId + '")');
|
|
259
|
+
}
|
|
260
|
+
}
|
|
261
|
+
var obj_sobjectType = obj.sobjectType;
|
|
262
|
+
var path_sobjectType = path + '.sobjectType';
|
|
263
|
+
if (typeof obj_sobjectType !== 'string') {
|
|
264
|
+
return new TypeError('Expected "string" but received "' + typeof obj_sobjectType + '" (at "' + path_sobjectType + '")');
|
|
265
|
+
}
|
|
266
|
+
var obj_sobjectTypeLabel = obj.sobjectTypeLabel;
|
|
267
|
+
var path_sobjectTypeLabel = path + '.sobjectTypeLabel';
|
|
268
|
+
if (typeof obj_sobjectTypeLabel !== 'string') {
|
|
269
|
+
return new TypeError('Expected "string" but received "' + typeof obj_sobjectTypeLabel + '" (at "' + path_sobjectTypeLabel + '")');
|
|
270
|
+
}
|
|
271
|
+
var obj_timeStamp = obj.timeStamp;
|
|
272
|
+
var path_timeStamp = path + '.timeStamp';
|
|
273
|
+
if (typeof obj_timeStamp !== 'string') {
|
|
274
|
+
return new TypeError('Expected "string" but received "' + typeof obj_timeStamp + '" (at "' + path_timeStamp + '")');
|
|
275
|
+
}
|
|
276
|
+
var obj_type = obj.type;
|
|
277
|
+
var path_type = path + '.type';
|
|
278
|
+
if (typeof obj_type !== 'string') {
|
|
279
|
+
return new TypeError('Expected "string" but received "' + typeof obj_type + '" (at "' + path_type + '")');
|
|
280
|
+
}
|
|
281
|
+
})();
|
|
282
|
+
return v_error === undefined ? null : v_error;
|
|
283
|
+
}
|
|
284
|
+
function deepFreeze$1(input) {
|
|
285
|
+
var input_fields = input.fields;
|
|
286
|
+
for (var i = 0; i < input_fields.length; i++) {
|
|
287
|
+
var input_fields_item = input_fields[i];
|
|
288
|
+
var input_fields_item_keys = Object.keys(input_fields_item);
|
|
289
|
+
var input_fields_item_length = input_fields_item_keys.length;
|
|
290
|
+
for (var i_2 = 0; i_2 < input_fields_item_length; i_2++) {
|
|
291
|
+
input_fields_item_keys[i_2];
|
|
292
|
+
}
|
|
293
|
+
ObjectFreeze(input_fields_item);
|
|
294
|
+
}
|
|
295
|
+
ObjectFreeze(input_fields);
|
|
296
|
+
ObjectFreeze(input);
|
|
297
|
+
}
|
|
298
|
+
|
|
299
|
+
var TTL = 1000;
|
|
300
|
+
var VERSION = "954674f4e56dd5b956cf98542401fda9";
|
|
301
|
+
function validate(obj, path) {
|
|
302
|
+
if (path === void 0) { path = 'ERIDigestOutputRepresentation'; }
|
|
303
|
+
var v_error = (function () {
|
|
304
|
+
if (typeof obj !== 'object' || ArrayIsArray(obj) || obj === null) {
|
|
305
|
+
return new TypeError('Expected "object" but received "' + typeof obj + '" (at "' + path + '")');
|
|
306
|
+
}
|
|
307
|
+
if (obj.errorMsg !== undefined) {
|
|
308
|
+
var obj_errorMsg = obj.errorMsg;
|
|
309
|
+
var path_errorMsg = path + '.errorMsg';
|
|
310
|
+
if (typeof obj_errorMsg !== 'string') {
|
|
311
|
+
return new TypeError('Expected "string" but received "' + typeof obj_errorMsg + '" (at "' + path_errorMsg + '")');
|
|
312
|
+
}
|
|
313
|
+
}
|
|
314
|
+
if (obj.following !== undefined) {
|
|
315
|
+
var obj_following = obj.following;
|
|
316
|
+
var path_following = path + '.following';
|
|
317
|
+
var referencepath_followingValidationError = validate$2(obj_following, path_following);
|
|
318
|
+
if (referencepath_followingValidationError !== null) {
|
|
319
|
+
var message = 'Object doesn\'t match FollowingInfo (at "' + path_following + '")\n';
|
|
320
|
+
message += referencepath_followingValidationError.message.split('\n').map(function (line) { return '\t' + line; }).join('\n');
|
|
321
|
+
return new TypeError(message);
|
|
322
|
+
}
|
|
323
|
+
}
|
|
324
|
+
if (obj.notifications !== undefined) {
|
|
325
|
+
var obj_notifications = obj.notifications;
|
|
326
|
+
var path_notifications = path + '.notifications';
|
|
327
|
+
if (!ArrayIsArray(obj_notifications)) {
|
|
328
|
+
return new TypeError('Expected "array" but received "' + typeof obj_notifications + '" (at "' + path_notifications + '")');
|
|
329
|
+
}
|
|
330
|
+
for (var i = 0; i < obj_notifications.length; i++) {
|
|
331
|
+
var obj_notifications_item = obj_notifications[i];
|
|
332
|
+
var path_notifications_item = path_notifications + '[' + i + ']';
|
|
333
|
+
var referencepath_notifications_itemValidationError = validate$1(obj_notifications_item, path_notifications_item);
|
|
334
|
+
if (referencepath_notifications_itemValidationError !== null) {
|
|
335
|
+
var message = 'Object doesn\'t match DigestNotification (at "' + path_notifications_item + '")\n';
|
|
336
|
+
message += referencepath_notifications_itemValidationError.message.split('\n').map(function (line) { return '\t' + line; }).join('\n');
|
|
337
|
+
return new TypeError(message);
|
|
338
|
+
}
|
|
339
|
+
}
|
|
340
|
+
}
|
|
341
|
+
var obj_requestSucceeded = obj.requestSucceeded;
|
|
342
|
+
var path_requestSucceeded = path + '.requestSucceeded';
|
|
343
|
+
if (typeof obj_requestSucceeded !== 'boolean') {
|
|
344
|
+
return new TypeError('Expected "boolean" but received "' + typeof obj_requestSucceeded + '" (at "' + path_requestSucceeded + '")');
|
|
345
|
+
}
|
|
346
|
+
var obj_statusCode = obj.statusCode;
|
|
347
|
+
var path_statusCode = path + '.statusCode';
|
|
348
|
+
if (typeof obj_statusCode !== 'string') {
|
|
349
|
+
return new TypeError('Expected "string" but received "' + typeof obj_statusCode + '" (at "' + path_statusCode + '")');
|
|
350
|
+
}
|
|
351
|
+
})();
|
|
352
|
+
return v_error === undefined ? null : v_error;
|
|
353
|
+
}
|
|
354
|
+
var RepresentationType = 'ERIDigestOutputRepresentation';
|
|
355
|
+
function keyBuilder(luvio, config) {
|
|
356
|
+
return keyPrefix + '::' + RepresentationType + ':' + config.isSuccess;
|
|
357
|
+
}
|
|
358
|
+
function keyBuilderFromType(luvio, object) {
|
|
359
|
+
var keyParams = {
|
|
360
|
+
isSuccess: object.requestSucceeded
|
|
361
|
+
};
|
|
362
|
+
return keyBuilder(luvio, keyParams);
|
|
363
|
+
}
|
|
364
|
+
function normalize(input, existing, path, luvio, store, timestamp) {
|
|
365
|
+
return input;
|
|
366
|
+
}
|
|
367
|
+
var select$1 = function ERIDigestOutputRepresentationSelect() {
|
|
368
|
+
return {
|
|
369
|
+
kind: 'Fragment',
|
|
370
|
+
version: VERSION,
|
|
371
|
+
private: [],
|
|
372
|
+
opaque: true
|
|
373
|
+
};
|
|
374
|
+
};
|
|
375
|
+
function equals(existing, incoming) {
|
|
376
|
+
if (JSONStringify(incoming) !== JSONStringify(existing)) {
|
|
377
|
+
return false;
|
|
378
|
+
}
|
|
379
|
+
return true;
|
|
380
|
+
}
|
|
381
|
+
function deepFreeze(input) {
|
|
382
|
+
var input_following = input.following;
|
|
383
|
+
if (input_following !== undefined) {
|
|
384
|
+
deepFreeze$2(input_following);
|
|
385
|
+
}
|
|
386
|
+
var input_notifications = input.notifications;
|
|
387
|
+
if (input_notifications !== undefined) {
|
|
388
|
+
for (var i = 0; i < input_notifications.length; i++) {
|
|
389
|
+
var input_notifications_item = input_notifications[i];
|
|
390
|
+
deepFreeze$1(input_notifications_item);
|
|
391
|
+
}
|
|
392
|
+
ObjectFreeze(input_notifications);
|
|
393
|
+
}
|
|
394
|
+
ObjectFreeze(input);
|
|
395
|
+
}
|
|
396
|
+
var ingest = function ERIDigestOutputRepresentationIngest(input, path, luvio, store, timestamp) {
|
|
397
|
+
if (process.env.NODE_ENV !== 'production') {
|
|
398
|
+
var validateError = validate(input);
|
|
399
|
+
if (validateError !== null) {
|
|
400
|
+
throw validateError;
|
|
401
|
+
}
|
|
402
|
+
}
|
|
403
|
+
var key = keyBuilderFromType(luvio, input);
|
|
404
|
+
var existingRecord = store.readEntry(key);
|
|
405
|
+
var ttlToUse = TTL;
|
|
406
|
+
var incomingRecord = normalize(input, store.readEntry(key), {
|
|
407
|
+
fullPath: key,
|
|
408
|
+
parent: path.parent,
|
|
409
|
+
propertyName: path.propertyName,
|
|
410
|
+
ttl: ttlToUse
|
|
411
|
+
});
|
|
412
|
+
deepFreeze(input);
|
|
413
|
+
if (existingRecord === undefined || equals(existingRecord, incomingRecord) === false) {
|
|
414
|
+
luvio.storePublish(key, incomingRecord);
|
|
415
|
+
}
|
|
416
|
+
{
|
|
417
|
+
var storeMetadataParams = {
|
|
418
|
+
ttl: ttlToUse,
|
|
419
|
+
namespace: "eri",
|
|
420
|
+
version: VERSION,
|
|
421
|
+
representationName: RepresentationType,
|
|
422
|
+
};
|
|
423
|
+
luvio.publishStoreMetadata(key, storeMetadataParams);
|
|
424
|
+
}
|
|
425
|
+
return createLink(key);
|
|
426
|
+
};
|
|
427
|
+
function getTypeCacheKeys(luvio, input, fullPathFactory) {
|
|
428
|
+
var rootKeySet = new engine.StoreKeyMap();
|
|
429
|
+
// root cache key (uses fullPathFactory if keyBuilderFromType isn't defined)
|
|
430
|
+
var rootKey = keyBuilderFromType(luvio, input);
|
|
431
|
+
rootKeySet.set(rootKey, {
|
|
432
|
+
namespace: keyPrefix,
|
|
433
|
+
representationName: RepresentationType,
|
|
434
|
+
mergeable: false
|
|
435
|
+
});
|
|
436
|
+
return rootKeySet;
|
|
437
|
+
}
|
|
438
|
+
|
|
439
|
+
function select(luvio, params) {
|
|
440
|
+
return select$1();
|
|
441
|
+
}
|
|
442
|
+
function getResponseCacheKeys(luvio, resourceParams, response) {
|
|
443
|
+
return getTypeCacheKeys(luvio, response);
|
|
444
|
+
}
|
|
445
|
+
function ingestSuccess(luvio, resourceParams, response) {
|
|
446
|
+
var body = response.body;
|
|
447
|
+
var key = keyBuilderFromType(luvio, body);
|
|
448
|
+
luvio.storeIngest(key, ingest, body);
|
|
449
|
+
var snapshot = luvio.storeLookup({
|
|
450
|
+
recordId: key,
|
|
451
|
+
node: select(),
|
|
452
|
+
variables: {},
|
|
453
|
+
});
|
|
454
|
+
if (process.env.NODE_ENV !== 'production') {
|
|
455
|
+
if (snapshot.state !== 'Fulfilled') {
|
|
456
|
+
throw new Error('Invalid network response. Expected resource response to result in Fulfilled snapshot');
|
|
457
|
+
}
|
|
458
|
+
}
|
|
459
|
+
return snapshot;
|
|
460
|
+
}
|
|
461
|
+
function createResourceRequest(config) {
|
|
462
|
+
var headers = {};
|
|
463
|
+
return {
|
|
464
|
+
baseUri: '/services/data/v58.0',
|
|
465
|
+
basePath: '/connect/eri/digest',
|
|
466
|
+
method: 'post',
|
|
467
|
+
body: config.body,
|
|
468
|
+
urlParams: {},
|
|
469
|
+
queryParams: {},
|
|
470
|
+
headers: headers,
|
|
471
|
+
priority: 'normal',
|
|
472
|
+
};
|
|
473
|
+
}
|
|
474
|
+
|
|
475
|
+
var getERIDigest_ConfigPropertyNames = {
|
|
476
|
+
displayName: 'getERIDigest',
|
|
477
|
+
parameters: {
|
|
478
|
+
required: ['eriDigestInput'],
|
|
479
|
+
optional: []
|
|
480
|
+
}
|
|
481
|
+
};
|
|
482
|
+
function createResourceParams(config) {
|
|
483
|
+
var resourceParams = {
|
|
484
|
+
body: {
|
|
485
|
+
eriDigestInput: config.eriDigestInput
|
|
486
|
+
}
|
|
487
|
+
};
|
|
488
|
+
return resourceParams;
|
|
489
|
+
}
|
|
490
|
+
function typeCheckConfig(untrustedConfig) {
|
|
491
|
+
var config = {};
|
|
492
|
+
var untrustedConfig_eriDigestInput = untrustedConfig.eriDigestInput;
|
|
493
|
+
var referenceERIDigestInputRepresentationValidationError = validate$3(untrustedConfig_eriDigestInput);
|
|
494
|
+
if (referenceERIDigestInputRepresentationValidationError === null) {
|
|
495
|
+
config.eriDigestInput = untrustedConfig_eriDigestInput;
|
|
496
|
+
}
|
|
497
|
+
return config;
|
|
498
|
+
}
|
|
499
|
+
function validateAdapterConfig(untrustedConfig, configPropertyNames) {
|
|
500
|
+
if (!untrustedIsObject(untrustedConfig)) {
|
|
501
|
+
return null;
|
|
502
|
+
}
|
|
503
|
+
if (process.env.NODE_ENV !== 'production') {
|
|
504
|
+
validateConfig(untrustedConfig, configPropertyNames);
|
|
505
|
+
}
|
|
506
|
+
var config = typeCheckConfig(untrustedConfig);
|
|
507
|
+
if (!areRequiredParametersPresent(config, configPropertyNames)) {
|
|
508
|
+
return null;
|
|
509
|
+
}
|
|
510
|
+
return config;
|
|
511
|
+
}
|
|
512
|
+
function buildNetworkSnapshot(luvio, config, options) {
|
|
513
|
+
var resourceParams = createResourceParams(config);
|
|
514
|
+
var request = createResourceRequest(resourceParams);
|
|
515
|
+
return luvio.dispatchResourceRequest(request, options)
|
|
516
|
+
.then(function (response) {
|
|
517
|
+
return luvio.handleSuccessResponse(function () {
|
|
518
|
+
var snapshot = ingestSuccess(luvio, resourceParams, response);
|
|
519
|
+
return luvio.storeBroadcast().then(function () { return snapshot; });
|
|
520
|
+
}, function () { return getResponseCacheKeys(luvio, resourceParams, response.body); });
|
|
521
|
+
}, function (response) {
|
|
522
|
+
deepFreeze$3(response);
|
|
523
|
+
throw response;
|
|
524
|
+
});
|
|
525
|
+
}
|
|
526
|
+
var getERIDigestAdapterFactory = function (luvio) {
|
|
527
|
+
return function getERIDigest(untrustedConfig) {
|
|
528
|
+
var config = validateAdapterConfig(untrustedConfig, getERIDigest_ConfigPropertyNames);
|
|
529
|
+
// Invalid or incomplete config
|
|
530
|
+
if (config === null) {
|
|
531
|
+
throw new Error('Invalid config for "getERIDigest"');
|
|
532
|
+
}
|
|
533
|
+
return buildNetworkSnapshot(luvio, config);
|
|
534
|
+
};
|
|
535
|
+
};
|
|
536
|
+
|
|
537
|
+
exports.getERIDigestAdapterFactory = getERIDigestAdapterFactory;
|
|
538
|
+
|
|
539
|
+
Object.defineProperty(exports, '__esModule', { value: true });
|
|
540
|
+
|
|
541
|
+
}));
|
package/package.json
ADDED
|
@@ -0,0 +1,70 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@salesforce/lds-adapters-industries-eri",
|
|
3
|
+
"version": "1.100.2",
|
|
4
|
+
"license": "SEE LICENSE IN LICENSE.txt",
|
|
5
|
+
"description": "Einstein relationship insights",
|
|
6
|
+
"main": "dist/umd/es2018/industries-eri.js",
|
|
7
|
+
"module": "dist/es/es2018/industries-eri.js",
|
|
8
|
+
"types": "dist/types/src/generated/artifacts/main.d.ts",
|
|
9
|
+
"files": [
|
|
10
|
+
"dist",
|
|
11
|
+
"sfdc",
|
|
12
|
+
"src/raml/*"
|
|
13
|
+
],
|
|
14
|
+
"exports": {
|
|
15
|
+
".": {
|
|
16
|
+
"import": "./dist/es/es2018/industries-eri.js",
|
|
17
|
+
"require": "./dist/umd/es2018/industries-eri.js",
|
|
18
|
+
"types": "./dist/types/src/generated/artifacts/main.d.ts"
|
|
19
|
+
},
|
|
20
|
+
"./sfdc": {
|
|
21
|
+
"import": "./sfdc/index.js",
|
|
22
|
+
"types": "./sfdc/index.d.ts",
|
|
23
|
+
"default": "./sfdc/index.js"
|
|
24
|
+
}
|
|
25
|
+
},
|
|
26
|
+
"sdfc": {
|
|
27
|
+
"namespace": "lightning",
|
|
28
|
+
"module": "industriesEriApi"
|
|
29
|
+
},
|
|
30
|
+
"contributors": [
|
|
31
|
+
"pdevagiri@salesforce.com"
|
|
32
|
+
],
|
|
33
|
+
"scripts": {
|
|
34
|
+
"build": "yarn build:raml && yarn build:services && yarn build:karma",
|
|
35
|
+
"build:karma": "rollup --config rollup.config.karma.js",
|
|
36
|
+
"build:raml": "luvio generate src/raml/luvio.raml src/generated -p '../lds-compiler-plugins'",
|
|
37
|
+
"build:services": "rollup --config rollup.config.js",
|
|
38
|
+
"clean": "rm -rf dist sfdc src/generated karma/dist",
|
|
39
|
+
"release:core": "../../scripts/release/core.js --adapter=lds-adapters-industries-eri",
|
|
40
|
+
"release:corejar": "yarn build && packages/core-build/scripts/core.js --adapter=lds-adapters-industries-eri",
|
|
41
|
+
"start": "karma start",
|
|
42
|
+
"test": "karma start --single-run",
|
|
43
|
+
"test:compat": "karma start --single-run --compat"
|
|
44
|
+
},
|
|
45
|
+
"dependencies": {
|
|
46
|
+
"@salesforce/lds-bindings": "^1.100.2"
|
|
47
|
+
},
|
|
48
|
+
"devDependencies": {
|
|
49
|
+
"@luvio/cli": "0.135.4",
|
|
50
|
+
"@luvio/compiler": "0.135.4",
|
|
51
|
+
"@luvio/engine": "0.135.4",
|
|
52
|
+
"@luvio/lwc-luvio": "0.135.4",
|
|
53
|
+
"@salesforce/lds-karma": "^1.100.2"
|
|
54
|
+
},
|
|
55
|
+
"nx": {
|
|
56
|
+
"targets": {
|
|
57
|
+
"build": {
|
|
58
|
+
"outputs": [
|
|
59
|
+
"packages/lds-adapters-industries-eri/dist",
|
|
60
|
+
"packages/lds-adapters-industries-eri/karma/dist",
|
|
61
|
+
"packages/lds-adapters-industries-eri/sfdc",
|
|
62
|
+
"packages/lds-adapters-industries-eri/src/generated"
|
|
63
|
+
]
|
|
64
|
+
}
|
|
65
|
+
}
|
|
66
|
+
},
|
|
67
|
+
"volta": {
|
|
68
|
+
"extends": "../../package.json"
|
|
69
|
+
}
|
|
70
|
+
}
|
package/sfdc/index.d.ts
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from '../dist/types/src/generated/artifacts/sfdc';
|