@salesforce/lds-adapters-industries-cib 0.131.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-cib.js +1300 -0
- package/dist/es/es2018/types/src/generated/adapters/adapter-utils.d.ts +66 -0
- package/dist/es/es2018/types/src/generated/adapters/getContactsInteractions.d.ts +28 -0
- package/dist/es/es2018/types/src/generated/adapters/getDealParties.d.ts +27 -0
- package/dist/es/es2018/types/src/generated/adapters/getInteractionInsights.d.ts +31 -0
- package/dist/es/es2018/types/src/generated/artifacts/main.d.ts +3 -0
- package/dist/es/es2018/types/src/generated/artifacts/sfdc.d.ts +7 -0
- package/dist/es/es2018/types/src/generated/resources/getConnectFinancialservicesContactsInteractions.d.ts +17 -0
- package/dist/es/es2018/types/src/generated/resources/getConnectFinancialservicesDealPartiesByFinancialDealId.d.ts +18 -0
- package/dist/es/es2018/types/src/generated/resources/getConnectFinancialservicesInteractionInsightsByAccountId.d.ts +22 -0
- package/dist/es/es2018/types/src/generated/types/CompanyDealPartyListRepresentation.d.ts +31 -0
- package/dist/es/es2018/types/src/generated/types/CompanyDealPartyRepresentation.d.ts +38 -0
- package/dist/es/es2018/types/src/generated/types/ContactInteractionsListRepresentation.d.ts +31 -0
- package/dist/es/es2018/types/src/generated/types/ContactInteractionsRepresentation.d.ts +39 -0
- package/dist/es/es2018/types/src/generated/types/ContactRepresentation.d.ts +38 -0
- package/dist/es/es2018/types/src/generated/types/ContactsRepresentation.d.ts +37 -0
- package/dist/es/es2018/types/src/generated/types/InteractionRepresentation.d.ts +48 -0
- package/dist/es/es2018/types/src/generated/types/UserRepresentation.d.ts +38 -0
- package/dist/es/es2018/types/src/generated/types/type-utils.d.ts +39 -0
- package/package.json +67 -0
- package/sfdc/index.d.ts +1 -0
- package/sfdc/index.js +1348 -0
- package/src/raml/api.raml +231 -0
- package/src/raml/luvio.raml +33 -0
|
@@ -0,0 +1,1300 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Copyright (c) 2022, Salesforce, Inc.,
|
|
3
|
+
* All rights reserved.
|
|
4
|
+
* For full license text, see the LICENSE.txt file
|
|
5
|
+
*/
|
|
6
|
+
|
|
7
|
+
import { serializeStructuredKey, StoreKeyMap } from '@luvio/engine';
|
|
8
|
+
|
|
9
|
+
const { hasOwnProperty: ObjectPrototypeHasOwnProperty } = Object.prototype;
|
|
10
|
+
const { keys: ObjectKeys$1, freeze: ObjectFreeze$1, create: ObjectCreate$1 } = Object;
|
|
11
|
+
const { isArray: ArrayIsArray$1 } = Array;
|
|
12
|
+
/**
|
|
13
|
+
* Validates an adapter config is well-formed.
|
|
14
|
+
* @param config The config to validate.
|
|
15
|
+
* @param adapter The adapter validation configuration.
|
|
16
|
+
* @param oneOf The keys the config must contain at least one of.
|
|
17
|
+
* @throws A TypeError if config doesn't satisfy the adapter's config validation.
|
|
18
|
+
*/
|
|
19
|
+
function validateConfig(config, adapter, oneOf) {
|
|
20
|
+
const { displayName } = adapter;
|
|
21
|
+
const { required, optional, unsupported } = adapter.parameters;
|
|
22
|
+
if (config === undefined ||
|
|
23
|
+
required.every(req => ObjectPrototypeHasOwnProperty.call(config, req)) === false) {
|
|
24
|
+
throw new TypeError(`adapter ${displayName} configuration must specify ${required.sort().join(', ')}`);
|
|
25
|
+
}
|
|
26
|
+
if (oneOf && oneOf.some(req => ObjectPrototypeHasOwnProperty.call(config, req)) === false) {
|
|
27
|
+
throw new TypeError(`adapter ${displayName} configuration must specify one of ${oneOf.sort().join(', ')}`);
|
|
28
|
+
}
|
|
29
|
+
if (unsupported !== undefined &&
|
|
30
|
+
unsupported.some(req => ObjectPrototypeHasOwnProperty.call(config, req))) {
|
|
31
|
+
throw new TypeError(`adapter ${displayName} does not yet support ${unsupported.sort().join(', ')}`);
|
|
32
|
+
}
|
|
33
|
+
const supported = required.concat(optional);
|
|
34
|
+
if (ObjectKeys$1(config).some(key => !supported.includes(key))) {
|
|
35
|
+
throw new TypeError(`adapter ${displayName} configuration supports only ${supported.sort().join(', ')}`);
|
|
36
|
+
}
|
|
37
|
+
}
|
|
38
|
+
function untrustedIsObject(untrusted) {
|
|
39
|
+
return typeof untrusted === 'object' && untrusted !== null && ArrayIsArray$1(untrusted) === false;
|
|
40
|
+
}
|
|
41
|
+
function areRequiredParametersPresent(config, configPropertyNames) {
|
|
42
|
+
return configPropertyNames.parameters.required.every(req => req in config);
|
|
43
|
+
}
|
|
44
|
+
const snapshotRefreshOptions = {
|
|
45
|
+
overrides: {
|
|
46
|
+
headers: {
|
|
47
|
+
'Cache-Control': 'no-cache',
|
|
48
|
+
},
|
|
49
|
+
}
|
|
50
|
+
};
|
|
51
|
+
const keyPrefix = 'cib';
|
|
52
|
+
|
|
53
|
+
const { freeze: ObjectFreeze, keys: ObjectKeys, create: ObjectCreate, assign: ObjectAssign } = Object;
|
|
54
|
+
const { isArray: ArrayIsArray } = Array;
|
|
55
|
+
const { stringify: JSONStringify } = JSON;
|
|
56
|
+
function createLink(ref) {
|
|
57
|
+
return {
|
|
58
|
+
__ref: serializeStructuredKey(ref),
|
|
59
|
+
};
|
|
60
|
+
}
|
|
61
|
+
|
|
62
|
+
function validate$7(obj, path = 'UserRepresentation') {
|
|
63
|
+
const v_error = (() => {
|
|
64
|
+
if (typeof obj !== 'object' || ArrayIsArray(obj) || obj === null) {
|
|
65
|
+
return new TypeError('Expected "object" but received "' + typeof obj + '" (at "' + path + '")');
|
|
66
|
+
}
|
|
67
|
+
const obj_id = obj.id;
|
|
68
|
+
const path_id = path + '.id';
|
|
69
|
+
if (typeof obj_id !== 'string') {
|
|
70
|
+
return new TypeError('Expected "string" but received "' + typeof obj_id + '" (at "' + path_id + '")');
|
|
71
|
+
}
|
|
72
|
+
const obj_name = obj.name;
|
|
73
|
+
const path_name = path + '.name';
|
|
74
|
+
if (typeof obj_name !== 'string') {
|
|
75
|
+
return new TypeError('Expected "string" but received "' + typeof obj_name + '" (at "' + path_name + '")');
|
|
76
|
+
}
|
|
77
|
+
const obj_photoUrl = obj.photoUrl;
|
|
78
|
+
const path_photoUrl = path + '.photoUrl';
|
|
79
|
+
if (typeof obj_photoUrl !== 'string') {
|
|
80
|
+
return new TypeError('Expected "string" but received "' + typeof obj_photoUrl + '" (at "' + path_photoUrl + '")');
|
|
81
|
+
}
|
|
82
|
+
const obj_title = obj.title;
|
|
83
|
+
const path_title = path + '.title';
|
|
84
|
+
let obj_title_union0 = null;
|
|
85
|
+
const obj_title_union0_error = (() => {
|
|
86
|
+
if (typeof obj_title !== 'string') {
|
|
87
|
+
return new TypeError('Expected "string" but received "' + typeof obj_title + '" (at "' + path_title + '")');
|
|
88
|
+
}
|
|
89
|
+
})();
|
|
90
|
+
if (obj_title_union0_error != null) {
|
|
91
|
+
obj_title_union0 = obj_title_union0_error.message;
|
|
92
|
+
}
|
|
93
|
+
let obj_title_union1 = null;
|
|
94
|
+
const obj_title_union1_error = (() => {
|
|
95
|
+
if (obj_title !== null) {
|
|
96
|
+
return new TypeError('Expected "null" but received "' + typeof obj_title + '" (at "' + path_title + '")');
|
|
97
|
+
}
|
|
98
|
+
})();
|
|
99
|
+
if (obj_title_union1_error != null) {
|
|
100
|
+
obj_title_union1 = obj_title_union1_error.message;
|
|
101
|
+
}
|
|
102
|
+
if (obj_title_union0 && obj_title_union1) {
|
|
103
|
+
let message = 'Object doesn\'t match union (at "' + path_title + '")';
|
|
104
|
+
message += '\n' + obj_title_union0.split('\n').map((line) => '\t' + line).join('\n');
|
|
105
|
+
message += '\n' + obj_title_union1.split('\n').map((line) => '\t' + line).join('\n');
|
|
106
|
+
return new TypeError(message);
|
|
107
|
+
}
|
|
108
|
+
})();
|
|
109
|
+
return v_error === undefined ? null : v_error;
|
|
110
|
+
}
|
|
111
|
+
function deepFreeze$7(input) {
|
|
112
|
+
ObjectFreeze(input);
|
|
113
|
+
}
|
|
114
|
+
|
|
115
|
+
function validate$6(obj, path = 'InteractionRepresentation') {
|
|
116
|
+
const v_error = (() => {
|
|
117
|
+
if (typeof obj !== 'object' || ArrayIsArray(obj) || obj === null) {
|
|
118
|
+
return new TypeError('Expected "object" but received "' + typeof obj + '" (at "' + path + '")');
|
|
119
|
+
}
|
|
120
|
+
const obj_attendeesCount = obj.attendeesCount;
|
|
121
|
+
const path_attendeesCount = path + '.attendeesCount';
|
|
122
|
+
if (typeof obj_attendeesCount !== 'number' || (typeof obj_attendeesCount === 'number' && Math.floor(obj_attendeesCount) !== obj_attendeesCount)) {
|
|
123
|
+
return new TypeError('Expected "integer" but received "' + typeof obj_attendeesCount + '" (at "' + path_attendeesCount + '")');
|
|
124
|
+
}
|
|
125
|
+
const obj_icon = obj.icon;
|
|
126
|
+
const path_icon = path + '.icon';
|
|
127
|
+
let obj_icon_union0 = null;
|
|
128
|
+
const obj_icon_union0_error = (() => {
|
|
129
|
+
if (typeof obj_icon !== 'string') {
|
|
130
|
+
return new TypeError('Expected "string" but received "' + typeof obj_icon + '" (at "' + path_icon + '")');
|
|
131
|
+
}
|
|
132
|
+
})();
|
|
133
|
+
if (obj_icon_union0_error != null) {
|
|
134
|
+
obj_icon_union0 = obj_icon_union0_error.message;
|
|
135
|
+
}
|
|
136
|
+
let obj_icon_union1 = null;
|
|
137
|
+
const obj_icon_union1_error = (() => {
|
|
138
|
+
if (obj_icon !== null) {
|
|
139
|
+
return new TypeError('Expected "null" but received "' + typeof obj_icon + '" (at "' + path_icon + '")');
|
|
140
|
+
}
|
|
141
|
+
})();
|
|
142
|
+
if (obj_icon_union1_error != null) {
|
|
143
|
+
obj_icon_union1 = obj_icon_union1_error.message;
|
|
144
|
+
}
|
|
145
|
+
if (obj_icon_union0 && obj_icon_union1) {
|
|
146
|
+
let message = 'Object doesn\'t match union (at "' + path_icon + '")';
|
|
147
|
+
message += '\n' + obj_icon_union0.split('\n').map((line) => '\t' + line).join('\n');
|
|
148
|
+
message += '\n' + obj_icon_union1.split('\n').map((line) => '\t' + line).join('\n');
|
|
149
|
+
return new TypeError(message);
|
|
150
|
+
}
|
|
151
|
+
const obj_id = obj.id;
|
|
152
|
+
const path_id = path + '.id';
|
|
153
|
+
let obj_id_union0 = null;
|
|
154
|
+
const obj_id_union0_error = (() => {
|
|
155
|
+
if (typeof obj_id !== 'string') {
|
|
156
|
+
return new TypeError('Expected "string" but received "' + typeof obj_id + '" (at "' + path_id + '")');
|
|
157
|
+
}
|
|
158
|
+
})();
|
|
159
|
+
if (obj_id_union0_error != null) {
|
|
160
|
+
obj_id_union0 = obj_id_union0_error.message;
|
|
161
|
+
}
|
|
162
|
+
let obj_id_union1 = null;
|
|
163
|
+
const obj_id_union1_error = (() => {
|
|
164
|
+
if (obj_id !== null) {
|
|
165
|
+
return new TypeError('Expected "null" but received "' + typeof obj_id + '" (at "' + path_id + '")');
|
|
166
|
+
}
|
|
167
|
+
})();
|
|
168
|
+
if (obj_id_union1_error != null) {
|
|
169
|
+
obj_id_union1 = obj_id_union1_error.message;
|
|
170
|
+
}
|
|
171
|
+
if (obj_id_union0 && obj_id_union1) {
|
|
172
|
+
let message = 'Object doesn\'t match union (at "' + path_id + '")';
|
|
173
|
+
message += '\n' + obj_id_union0.split('\n').map((line) => '\t' + line).join('\n');
|
|
174
|
+
message += '\n' + obj_id_union1.split('\n').map((line) => '\t' + line).join('\n');
|
|
175
|
+
return new TypeError(message);
|
|
176
|
+
}
|
|
177
|
+
const obj_isPrivate = obj.isPrivate;
|
|
178
|
+
const path_isPrivate = path + '.isPrivate';
|
|
179
|
+
if (typeof obj_isPrivate !== 'boolean') {
|
|
180
|
+
return new TypeError('Expected "boolean" but received "' + typeof obj_isPrivate + '" (at "' + path_isPrivate + '")');
|
|
181
|
+
}
|
|
182
|
+
const obj_name = obj.name;
|
|
183
|
+
const path_name = path + '.name';
|
|
184
|
+
let obj_name_union0 = null;
|
|
185
|
+
const obj_name_union0_error = (() => {
|
|
186
|
+
if (typeof obj_name !== 'string') {
|
|
187
|
+
return new TypeError('Expected "string" but received "' + typeof obj_name + '" (at "' + path_name + '")');
|
|
188
|
+
}
|
|
189
|
+
})();
|
|
190
|
+
if (obj_name_union0_error != null) {
|
|
191
|
+
obj_name_union0 = obj_name_union0_error.message;
|
|
192
|
+
}
|
|
193
|
+
let obj_name_union1 = null;
|
|
194
|
+
const obj_name_union1_error = (() => {
|
|
195
|
+
if (obj_name !== null) {
|
|
196
|
+
return new TypeError('Expected "null" but received "' + typeof obj_name + '" (at "' + path_name + '")');
|
|
197
|
+
}
|
|
198
|
+
})();
|
|
199
|
+
if (obj_name_union1_error != null) {
|
|
200
|
+
obj_name_union1 = obj_name_union1_error.message;
|
|
201
|
+
}
|
|
202
|
+
if (obj_name_union0 && obj_name_union1) {
|
|
203
|
+
let message = 'Object doesn\'t match union (at "' + path_name + '")';
|
|
204
|
+
message += '\n' + obj_name_union0.split('\n').map((line) => '\t' + line).join('\n');
|
|
205
|
+
message += '\n' + obj_name_union1.split('\n').map((line) => '\t' + line).join('\n');
|
|
206
|
+
return new TypeError(message);
|
|
207
|
+
}
|
|
208
|
+
const obj_startDate = obj.startDate;
|
|
209
|
+
const path_startDate = path + '.startDate';
|
|
210
|
+
let obj_startDate_union0 = null;
|
|
211
|
+
const obj_startDate_union0_error = (() => {
|
|
212
|
+
if (typeof obj_startDate !== 'string') {
|
|
213
|
+
return new TypeError('Expected "string" but received "' + typeof obj_startDate + '" (at "' + path_startDate + '")');
|
|
214
|
+
}
|
|
215
|
+
})();
|
|
216
|
+
if (obj_startDate_union0_error != null) {
|
|
217
|
+
obj_startDate_union0 = obj_startDate_union0_error.message;
|
|
218
|
+
}
|
|
219
|
+
let obj_startDate_union1 = null;
|
|
220
|
+
const obj_startDate_union1_error = (() => {
|
|
221
|
+
if (obj_startDate !== null) {
|
|
222
|
+
return new TypeError('Expected "null" but received "' + typeof obj_startDate + '" (at "' + path_startDate + '")');
|
|
223
|
+
}
|
|
224
|
+
})();
|
|
225
|
+
if (obj_startDate_union1_error != null) {
|
|
226
|
+
obj_startDate_union1 = obj_startDate_union1_error.message;
|
|
227
|
+
}
|
|
228
|
+
if (obj_startDate_union0 && obj_startDate_union1) {
|
|
229
|
+
let message = 'Object doesn\'t match union (at "' + path_startDate + '")';
|
|
230
|
+
message += '\n' + obj_startDate_union0.split('\n').map((line) => '\t' + line).join('\n');
|
|
231
|
+
message += '\n' + obj_startDate_union1.split('\n').map((line) => '\t' + line).join('\n');
|
|
232
|
+
return new TypeError(message);
|
|
233
|
+
}
|
|
234
|
+
const obj_users = obj.users;
|
|
235
|
+
const path_users = path + '.users';
|
|
236
|
+
if (!ArrayIsArray(obj_users)) {
|
|
237
|
+
return new TypeError('Expected "array" but received "' + typeof obj_users + '" (at "' + path_users + '")');
|
|
238
|
+
}
|
|
239
|
+
for (let i = 0; i < obj_users.length; i++) {
|
|
240
|
+
const obj_users_item = obj_users[i];
|
|
241
|
+
const path_users_item = path_users + '[' + i + ']';
|
|
242
|
+
const referencepath_users_itemValidationError = validate$7(obj_users_item, path_users_item);
|
|
243
|
+
if (referencepath_users_itemValidationError !== null) {
|
|
244
|
+
let message = 'Object doesn\'t match UserRepresentation (at "' + path_users_item + '")\n';
|
|
245
|
+
message += referencepath_users_itemValidationError.message.split('\n').map((line) => '\t' + line).join('\n');
|
|
246
|
+
return new TypeError(message);
|
|
247
|
+
}
|
|
248
|
+
}
|
|
249
|
+
})();
|
|
250
|
+
return v_error === undefined ? null : v_error;
|
|
251
|
+
}
|
|
252
|
+
function deepFreeze$6(input) {
|
|
253
|
+
const input_users = input.users;
|
|
254
|
+
for (let i = 0; i < input_users.length; i++) {
|
|
255
|
+
const input_users_item = input_users[i];
|
|
256
|
+
deepFreeze$7(input_users_item);
|
|
257
|
+
}
|
|
258
|
+
ObjectFreeze(input_users);
|
|
259
|
+
ObjectFreeze(input);
|
|
260
|
+
}
|
|
261
|
+
|
|
262
|
+
function validate$5(obj, path = 'ContactInteractionsRepresentation') {
|
|
263
|
+
const v_error = (() => {
|
|
264
|
+
if (typeof obj !== 'object' || ArrayIsArray(obj) || obj === null) {
|
|
265
|
+
return new TypeError('Expected "object" but received "' + typeof obj + '" (at "' + path + '")');
|
|
266
|
+
}
|
|
267
|
+
const obj_contactId = obj.contactId;
|
|
268
|
+
const path_contactId = path + '.contactId';
|
|
269
|
+
if (typeof obj_contactId !== 'string') {
|
|
270
|
+
return new TypeError('Expected "string" but received "' + typeof obj_contactId + '" (at "' + path_contactId + '")');
|
|
271
|
+
}
|
|
272
|
+
const obj_interactions = obj.interactions;
|
|
273
|
+
const path_interactions = path + '.interactions';
|
|
274
|
+
if (!ArrayIsArray(obj_interactions)) {
|
|
275
|
+
return new TypeError('Expected "array" but received "' + typeof obj_interactions + '" (at "' + path_interactions + '")');
|
|
276
|
+
}
|
|
277
|
+
for (let i = 0; i < obj_interactions.length; i++) {
|
|
278
|
+
const obj_interactions_item = obj_interactions[i];
|
|
279
|
+
const path_interactions_item = path_interactions + '[' + i + ']';
|
|
280
|
+
const referencepath_interactions_itemValidationError = validate$6(obj_interactions_item, path_interactions_item);
|
|
281
|
+
if (referencepath_interactions_itemValidationError !== null) {
|
|
282
|
+
let message = 'Object doesn\'t match InteractionRepresentation (at "' + path_interactions_item + '")\n';
|
|
283
|
+
message += referencepath_interactions_itemValidationError.message.split('\n').map((line) => '\t' + line).join('\n');
|
|
284
|
+
return new TypeError(message);
|
|
285
|
+
}
|
|
286
|
+
}
|
|
287
|
+
const obj_name = obj.name;
|
|
288
|
+
const path_name = path + '.name';
|
|
289
|
+
let obj_name_union0 = null;
|
|
290
|
+
const obj_name_union0_error = (() => {
|
|
291
|
+
if (typeof obj_name !== 'string') {
|
|
292
|
+
return new TypeError('Expected "string" but received "' + typeof obj_name + '" (at "' + path_name + '")');
|
|
293
|
+
}
|
|
294
|
+
})();
|
|
295
|
+
if (obj_name_union0_error != null) {
|
|
296
|
+
obj_name_union0 = obj_name_union0_error.message;
|
|
297
|
+
}
|
|
298
|
+
let obj_name_union1 = null;
|
|
299
|
+
const obj_name_union1_error = (() => {
|
|
300
|
+
if (obj_name !== null) {
|
|
301
|
+
return new TypeError('Expected "null" but received "' + typeof obj_name + '" (at "' + path_name + '")');
|
|
302
|
+
}
|
|
303
|
+
})();
|
|
304
|
+
if (obj_name_union1_error != null) {
|
|
305
|
+
obj_name_union1 = obj_name_union1_error.message;
|
|
306
|
+
}
|
|
307
|
+
if (obj_name_union0 && obj_name_union1) {
|
|
308
|
+
let message = 'Object doesn\'t match union (at "' + path_name + '")';
|
|
309
|
+
message += '\n' + obj_name_union0.split('\n').map((line) => '\t' + line).join('\n');
|
|
310
|
+
message += '\n' + obj_name_union1.split('\n').map((line) => '\t' + line).join('\n');
|
|
311
|
+
return new TypeError(message);
|
|
312
|
+
}
|
|
313
|
+
const obj_title = obj.title;
|
|
314
|
+
const path_title = path + '.title';
|
|
315
|
+
let obj_title_union0 = null;
|
|
316
|
+
const obj_title_union0_error = (() => {
|
|
317
|
+
if (typeof obj_title !== 'string') {
|
|
318
|
+
return new TypeError('Expected "string" but received "' + typeof obj_title + '" (at "' + path_title + '")');
|
|
319
|
+
}
|
|
320
|
+
})();
|
|
321
|
+
if (obj_title_union0_error != null) {
|
|
322
|
+
obj_title_union0 = obj_title_union0_error.message;
|
|
323
|
+
}
|
|
324
|
+
let obj_title_union1 = null;
|
|
325
|
+
const obj_title_union1_error = (() => {
|
|
326
|
+
if (obj_title !== null) {
|
|
327
|
+
return new TypeError('Expected "null" but received "' + typeof obj_title + '" (at "' + path_title + '")');
|
|
328
|
+
}
|
|
329
|
+
})();
|
|
330
|
+
if (obj_title_union1_error != null) {
|
|
331
|
+
obj_title_union1 = obj_title_union1_error.message;
|
|
332
|
+
}
|
|
333
|
+
if (obj_title_union0 && obj_title_union1) {
|
|
334
|
+
let message = 'Object doesn\'t match union (at "' + path_title + '")';
|
|
335
|
+
message += '\n' + obj_title_union0.split('\n').map((line) => '\t' + line).join('\n');
|
|
336
|
+
message += '\n' + obj_title_union1.split('\n').map((line) => '\t' + line).join('\n');
|
|
337
|
+
return new TypeError(message);
|
|
338
|
+
}
|
|
339
|
+
})();
|
|
340
|
+
return v_error === undefined ? null : v_error;
|
|
341
|
+
}
|
|
342
|
+
function deepFreeze$5(input) {
|
|
343
|
+
const input_interactions = input.interactions;
|
|
344
|
+
for (let i = 0; i < input_interactions.length; i++) {
|
|
345
|
+
const input_interactions_item = input_interactions[i];
|
|
346
|
+
deepFreeze$6(input_interactions_item);
|
|
347
|
+
}
|
|
348
|
+
ObjectFreeze(input_interactions);
|
|
349
|
+
ObjectFreeze(input);
|
|
350
|
+
}
|
|
351
|
+
|
|
352
|
+
const TTL$2 = 60000;
|
|
353
|
+
const VERSION$2 = "84ad09d24737a1d099958eeb5c3ebc1d";
|
|
354
|
+
function validate$4(obj, path = 'ContactInteractionsListRepresentation') {
|
|
355
|
+
const v_error = (() => {
|
|
356
|
+
if (typeof obj !== 'object' || ArrayIsArray(obj) || obj === null) {
|
|
357
|
+
return new TypeError('Expected "object" but received "' + typeof obj + '" (at "' + path + '")');
|
|
358
|
+
}
|
|
359
|
+
const obj_data = obj.data;
|
|
360
|
+
const path_data = path + '.data';
|
|
361
|
+
if (!ArrayIsArray(obj_data)) {
|
|
362
|
+
return new TypeError('Expected "array" but received "' + typeof obj_data + '" (at "' + path_data + '")');
|
|
363
|
+
}
|
|
364
|
+
for (let i = 0; i < obj_data.length; i++) {
|
|
365
|
+
const obj_data_item = obj_data[i];
|
|
366
|
+
const path_data_item = path_data + '[' + i + ']';
|
|
367
|
+
const referencepath_data_itemValidationError = validate$5(obj_data_item, path_data_item);
|
|
368
|
+
if (referencepath_data_itemValidationError !== null) {
|
|
369
|
+
let message = 'Object doesn\'t match ContactInteractionsRepresentation (at "' + path_data_item + '")\n';
|
|
370
|
+
message += referencepath_data_itemValidationError.message.split('\n').map((line) => '\t' + line).join('\n');
|
|
371
|
+
return new TypeError(message);
|
|
372
|
+
}
|
|
373
|
+
}
|
|
374
|
+
})();
|
|
375
|
+
return v_error === undefined ? null : v_error;
|
|
376
|
+
}
|
|
377
|
+
const RepresentationType$2 = 'ContactInteractionsListRepresentation';
|
|
378
|
+
function normalize$2(input, existing, path, luvio, store, timestamp) {
|
|
379
|
+
return input;
|
|
380
|
+
}
|
|
381
|
+
const select$5 = function ContactInteractionsListRepresentationSelect() {
|
|
382
|
+
return {
|
|
383
|
+
kind: 'Fragment',
|
|
384
|
+
version: VERSION$2,
|
|
385
|
+
private: [],
|
|
386
|
+
opaque: true
|
|
387
|
+
};
|
|
388
|
+
};
|
|
389
|
+
function equals$2(existing, incoming) {
|
|
390
|
+
if (JSONStringify(incoming) !== JSONStringify(existing)) {
|
|
391
|
+
return false;
|
|
392
|
+
}
|
|
393
|
+
return true;
|
|
394
|
+
}
|
|
395
|
+
function deepFreeze$4(input) {
|
|
396
|
+
const input_data = input.data;
|
|
397
|
+
for (let i = 0; i < input_data.length; i++) {
|
|
398
|
+
const input_data_item = input_data[i];
|
|
399
|
+
deepFreeze$5(input_data_item);
|
|
400
|
+
}
|
|
401
|
+
ObjectFreeze(input_data);
|
|
402
|
+
ObjectFreeze(input);
|
|
403
|
+
}
|
|
404
|
+
const ingest$2 = function ContactInteractionsListRepresentationIngest(input, path, luvio, store, timestamp) {
|
|
405
|
+
if (process.env.NODE_ENV !== 'production') {
|
|
406
|
+
const validateError = validate$4(input);
|
|
407
|
+
if (validateError !== null) {
|
|
408
|
+
throw validateError;
|
|
409
|
+
}
|
|
410
|
+
}
|
|
411
|
+
const key = path.fullPath;
|
|
412
|
+
const existingRecord = store.readEntry(key);
|
|
413
|
+
const ttlToUse = TTL$2;
|
|
414
|
+
let incomingRecord = normalize$2(input, store.readEntry(key), {
|
|
415
|
+
fullPath: key,
|
|
416
|
+
parent: path.parent,
|
|
417
|
+
propertyName: path.propertyName,
|
|
418
|
+
ttl: ttlToUse
|
|
419
|
+
});
|
|
420
|
+
deepFreeze$4(input);
|
|
421
|
+
if (existingRecord === undefined || equals$2(existingRecord, incomingRecord) === false) {
|
|
422
|
+
luvio.storePublish(key, incomingRecord);
|
|
423
|
+
}
|
|
424
|
+
{
|
|
425
|
+
const storeMetadataParams = {
|
|
426
|
+
ttl: ttlToUse,
|
|
427
|
+
namespace: "cib",
|
|
428
|
+
version: VERSION$2,
|
|
429
|
+
representationName: RepresentationType$2,
|
|
430
|
+
};
|
|
431
|
+
luvio.publishStoreMetadata(key, storeMetadataParams);
|
|
432
|
+
}
|
|
433
|
+
return createLink(key);
|
|
434
|
+
};
|
|
435
|
+
function getTypeCacheKeys$2(luvio, input, fullPathFactory) {
|
|
436
|
+
const rootKeySet = new StoreKeyMap();
|
|
437
|
+
// root cache key (uses fullPathFactory if keyBuilderFromType isn't defined)
|
|
438
|
+
const rootKey = fullPathFactory();
|
|
439
|
+
rootKeySet.set(rootKey, {
|
|
440
|
+
namespace: keyPrefix,
|
|
441
|
+
representationName: RepresentationType$2,
|
|
442
|
+
mergeable: false
|
|
443
|
+
});
|
|
444
|
+
return rootKeySet;
|
|
445
|
+
}
|
|
446
|
+
|
|
447
|
+
function select$4(luvio, params) {
|
|
448
|
+
return select$5();
|
|
449
|
+
}
|
|
450
|
+
function keyBuilder$5(luvio, params) {
|
|
451
|
+
return keyPrefix + '::ContactInteractionsListRepresentation:(' + 'contactIds:' + params.queryParams.contactIds + ',' + 'relatedRecordId:' + params.queryParams.relatedRecordId + ',' + 'systemContext:' + params.queryParams.systemContext + ')';
|
|
452
|
+
}
|
|
453
|
+
function getResponseCacheKeys$2(luvio, resourceParams, response) {
|
|
454
|
+
return getTypeCacheKeys$2(luvio, response, () => keyBuilder$5(luvio, resourceParams));
|
|
455
|
+
}
|
|
456
|
+
function ingestSuccess$2(luvio, resourceParams, response, snapshotRefresh) {
|
|
457
|
+
const { body } = response;
|
|
458
|
+
const key = keyBuilder$5(luvio, resourceParams);
|
|
459
|
+
luvio.storeIngest(key, ingest$2, body);
|
|
460
|
+
const snapshot = luvio.storeLookup({
|
|
461
|
+
recordId: key,
|
|
462
|
+
node: select$4(),
|
|
463
|
+
variables: {},
|
|
464
|
+
}, snapshotRefresh);
|
|
465
|
+
if (process.env.NODE_ENV !== 'production') {
|
|
466
|
+
if (snapshot.state !== 'Fulfilled') {
|
|
467
|
+
throw new Error('Invalid network response. Expected resource response to result in Fulfilled snapshot');
|
|
468
|
+
}
|
|
469
|
+
}
|
|
470
|
+
return snapshot;
|
|
471
|
+
}
|
|
472
|
+
function ingestError$2(luvio, params, error, snapshotRefresh) {
|
|
473
|
+
const key = keyBuilder$5(luvio, params);
|
|
474
|
+
const errorSnapshot = luvio.errorSnapshot(error, snapshotRefresh);
|
|
475
|
+
const storeMetadataParams = {
|
|
476
|
+
ttl: TTL$2,
|
|
477
|
+
namespace: keyPrefix,
|
|
478
|
+
version: VERSION$2,
|
|
479
|
+
representationName: RepresentationType$2
|
|
480
|
+
};
|
|
481
|
+
luvio.storeIngestError(key, errorSnapshot, storeMetadataParams);
|
|
482
|
+
return errorSnapshot;
|
|
483
|
+
}
|
|
484
|
+
function createResourceRequest$2(config) {
|
|
485
|
+
const headers = {};
|
|
486
|
+
return {
|
|
487
|
+
baseUri: '/services/data/v58.0',
|
|
488
|
+
basePath: '/connect/financialservices/contacts-interactions',
|
|
489
|
+
method: 'get',
|
|
490
|
+
body: null,
|
|
491
|
+
urlParams: {},
|
|
492
|
+
queryParams: config.queryParams,
|
|
493
|
+
headers,
|
|
494
|
+
priority: 'normal',
|
|
495
|
+
};
|
|
496
|
+
}
|
|
497
|
+
|
|
498
|
+
const getContactsInteractions_ConfigPropertyNames = {
|
|
499
|
+
displayName: 'getContactsInteractions',
|
|
500
|
+
parameters: {
|
|
501
|
+
required: [],
|
|
502
|
+
optional: ['contactIds', 'relatedRecordId', 'systemContext']
|
|
503
|
+
}
|
|
504
|
+
};
|
|
505
|
+
function createResourceParams$2(config) {
|
|
506
|
+
const resourceParams = {
|
|
507
|
+
queryParams: {
|
|
508
|
+
contactIds: config.contactIds, relatedRecordId: config.relatedRecordId, systemContext: config.systemContext
|
|
509
|
+
}
|
|
510
|
+
};
|
|
511
|
+
return resourceParams;
|
|
512
|
+
}
|
|
513
|
+
function keyBuilder$4(luvio, config) {
|
|
514
|
+
const resourceParams = createResourceParams$2(config);
|
|
515
|
+
return keyBuilder$5(luvio, resourceParams);
|
|
516
|
+
}
|
|
517
|
+
function typeCheckConfig$2(untrustedConfig) {
|
|
518
|
+
const config = {};
|
|
519
|
+
const untrustedConfig_contactIds = untrustedConfig.contactIds;
|
|
520
|
+
if (ArrayIsArray$1(untrustedConfig_contactIds)) {
|
|
521
|
+
const untrustedConfig_contactIds_array = [];
|
|
522
|
+
for (let i = 0, arrayLength = untrustedConfig_contactIds.length; i < arrayLength; i++) {
|
|
523
|
+
const untrustedConfig_contactIds_item = untrustedConfig_contactIds[i];
|
|
524
|
+
if (typeof untrustedConfig_contactIds_item === 'string') {
|
|
525
|
+
untrustedConfig_contactIds_array.push(untrustedConfig_contactIds_item);
|
|
526
|
+
}
|
|
527
|
+
}
|
|
528
|
+
config.contactIds = untrustedConfig_contactIds_array;
|
|
529
|
+
}
|
|
530
|
+
const untrustedConfig_relatedRecordId = untrustedConfig.relatedRecordId;
|
|
531
|
+
if (typeof untrustedConfig_relatedRecordId === 'string') {
|
|
532
|
+
config.relatedRecordId = untrustedConfig_relatedRecordId;
|
|
533
|
+
}
|
|
534
|
+
const untrustedConfig_systemContext = untrustedConfig.systemContext;
|
|
535
|
+
if (typeof untrustedConfig_systemContext === 'boolean') {
|
|
536
|
+
config.systemContext = untrustedConfig_systemContext;
|
|
537
|
+
}
|
|
538
|
+
return config;
|
|
539
|
+
}
|
|
540
|
+
function validateAdapterConfig$2(untrustedConfig, configPropertyNames) {
|
|
541
|
+
if (!untrustedIsObject(untrustedConfig)) {
|
|
542
|
+
return null;
|
|
543
|
+
}
|
|
544
|
+
if (process.env.NODE_ENV !== 'production') {
|
|
545
|
+
validateConfig(untrustedConfig, configPropertyNames);
|
|
546
|
+
}
|
|
547
|
+
const config = typeCheckConfig$2(untrustedConfig);
|
|
548
|
+
if (!areRequiredParametersPresent(config, configPropertyNames)) {
|
|
549
|
+
return null;
|
|
550
|
+
}
|
|
551
|
+
return config;
|
|
552
|
+
}
|
|
553
|
+
function adapterFragment$2(luvio, config) {
|
|
554
|
+
createResourceParams$2(config);
|
|
555
|
+
return select$4();
|
|
556
|
+
}
|
|
557
|
+
function onFetchResponseSuccess$2(luvio, config, resourceParams, response) {
|
|
558
|
+
const snapshot = ingestSuccess$2(luvio, resourceParams, response, {
|
|
559
|
+
config,
|
|
560
|
+
resolve: () => buildNetworkSnapshot$2(luvio, config, snapshotRefreshOptions)
|
|
561
|
+
});
|
|
562
|
+
return luvio.storeBroadcast().then(() => snapshot);
|
|
563
|
+
}
|
|
564
|
+
function onFetchResponseError$2(luvio, config, resourceParams, response) {
|
|
565
|
+
const snapshot = ingestError$2(luvio, resourceParams, response, {
|
|
566
|
+
config,
|
|
567
|
+
resolve: () => buildNetworkSnapshot$2(luvio, config, snapshotRefreshOptions)
|
|
568
|
+
});
|
|
569
|
+
return luvio.storeBroadcast().then(() => snapshot);
|
|
570
|
+
}
|
|
571
|
+
function buildNetworkSnapshot$2(luvio, config, options) {
|
|
572
|
+
const resourceParams = createResourceParams$2(config);
|
|
573
|
+
const request = createResourceRequest$2(resourceParams);
|
|
574
|
+
return luvio.dispatchResourceRequest(request, options)
|
|
575
|
+
.then((response) => {
|
|
576
|
+
return luvio.handleSuccessResponse(() => onFetchResponseSuccess$2(luvio, config, resourceParams, response), () => getResponseCacheKeys$2(luvio, resourceParams, response.body));
|
|
577
|
+
}, (response) => {
|
|
578
|
+
return luvio.handleErrorResponse(() => onFetchResponseError$2(luvio, config, resourceParams, response));
|
|
579
|
+
});
|
|
580
|
+
}
|
|
581
|
+
function buildNetworkSnapshotCachePolicy$2(context, coercedAdapterRequestContext) {
|
|
582
|
+
const { luvio, config } = context;
|
|
583
|
+
const { networkPriority, requestCorrelator, eventObservers } = coercedAdapterRequestContext;
|
|
584
|
+
const dispatchOptions = {
|
|
585
|
+
resourceRequestContext: {
|
|
586
|
+
requestCorrelator,
|
|
587
|
+
luvioRequestMethod: undefined,
|
|
588
|
+
},
|
|
589
|
+
eventObservers
|
|
590
|
+
};
|
|
591
|
+
if (networkPriority !== 'normal') {
|
|
592
|
+
dispatchOptions.overrides = {
|
|
593
|
+
priority: networkPriority
|
|
594
|
+
};
|
|
595
|
+
}
|
|
596
|
+
return buildNetworkSnapshot$2(luvio, config, dispatchOptions);
|
|
597
|
+
}
|
|
598
|
+
function buildCachedSnapshotCachePolicy$2(context, storeLookup) {
|
|
599
|
+
const { luvio, config } = context;
|
|
600
|
+
const selector = {
|
|
601
|
+
recordId: keyBuilder$4(luvio, config),
|
|
602
|
+
node: adapterFragment$2(luvio, config),
|
|
603
|
+
variables: {},
|
|
604
|
+
};
|
|
605
|
+
const cacheSnapshot = storeLookup(selector, {
|
|
606
|
+
config,
|
|
607
|
+
resolve: () => buildNetworkSnapshot$2(luvio, config, snapshotRefreshOptions)
|
|
608
|
+
});
|
|
609
|
+
return cacheSnapshot;
|
|
610
|
+
}
|
|
611
|
+
const getContactsInteractionsAdapterFactory = (luvio) => function cib__getContactsInteractions(untrustedConfig, requestContext) {
|
|
612
|
+
const config = validateAdapterConfig$2(untrustedConfig, getContactsInteractions_ConfigPropertyNames);
|
|
613
|
+
// Invalid or incomplete config
|
|
614
|
+
if (config === null) {
|
|
615
|
+
return null;
|
|
616
|
+
}
|
|
617
|
+
return luvio.applyCachePolicy((requestContext || {}), { config, luvio }, // BuildSnapshotContext
|
|
618
|
+
buildCachedSnapshotCachePolicy$2, buildNetworkSnapshotCachePolicy$2);
|
|
619
|
+
};
|
|
620
|
+
|
|
621
|
+
function validate$3(obj, path = 'CompanyDealPartyRepresentation') {
|
|
622
|
+
const v_error = (() => {
|
|
623
|
+
if (typeof obj !== 'object' || ArrayIsArray(obj) || obj === null) {
|
|
624
|
+
return new TypeError('Expected "object" but received "' + typeof obj + '" (at "' + path + '")');
|
|
625
|
+
}
|
|
626
|
+
const obj_contactIds = obj.contactIds;
|
|
627
|
+
const path_contactIds = path + '.contactIds';
|
|
628
|
+
if (!ArrayIsArray(obj_contactIds)) {
|
|
629
|
+
return new TypeError('Expected "array" but received "' + typeof obj_contactIds + '" (at "' + path_contactIds + '")');
|
|
630
|
+
}
|
|
631
|
+
for (let i = 0; i < obj_contactIds.length; i++) {
|
|
632
|
+
const obj_contactIds_item = obj_contactIds[i];
|
|
633
|
+
const path_contactIds_item = path_contactIds + '[' + i + ']';
|
|
634
|
+
if (typeof obj_contactIds_item !== 'string') {
|
|
635
|
+
return new TypeError('Expected "string" but received "' + typeof obj_contactIds_item + '" (at "' + path_contactIds_item + '")');
|
|
636
|
+
}
|
|
637
|
+
}
|
|
638
|
+
const obj_name = obj.name;
|
|
639
|
+
const path_name = path + '.name';
|
|
640
|
+
if (typeof obj_name !== 'string') {
|
|
641
|
+
return new TypeError('Expected "string" but received "' + typeof obj_name + '" (at "' + path_name + '")');
|
|
642
|
+
}
|
|
643
|
+
const obj_partyId = obj.partyId;
|
|
644
|
+
const path_partyId = path + '.partyId';
|
|
645
|
+
if (typeof obj_partyId !== 'string') {
|
|
646
|
+
return new TypeError('Expected "string" but received "' + typeof obj_partyId + '" (at "' + path_partyId + '")');
|
|
647
|
+
}
|
|
648
|
+
const obj_partyRoles = obj.partyRoles;
|
|
649
|
+
const path_partyRoles = path + '.partyRoles';
|
|
650
|
+
if (!ArrayIsArray(obj_partyRoles)) {
|
|
651
|
+
return new TypeError('Expected "array" but received "' + typeof obj_partyRoles + '" (at "' + path_partyRoles + '")');
|
|
652
|
+
}
|
|
653
|
+
for (let i = 0; i < obj_partyRoles.length; i++) {
|
|
654
|
+
const obj_partyRoles_item = obj_partyRoles[i];
|
|
655
|
+
const path_partyRoles_item = path_partyRoles + '[' + i + ']';
|
|
656
|
+
if (typeof obj_partyRoles_item !== 'string') {
|
|
657
|
+
return new TypeError('Expected "string" but received "' + typeof obj_partyRoles_item + '" (at "' + path_partyRoles_item + '")');
|
|
658
|
+
}
|
|
659
|
+
}
|
|
660
|
+
})();
|
|
661
|
+
return v_error === undefined ? null : v_error;
|
|
662
|
+
}
|
|
663
|
+
function deepFreeze$3(input) {
|
|
664
|
+
const input_contactIds = input.contactIds;
|
|
665
|
+
ObjectFreeze(input_contactIds);
|
|
666
|
+
const input_partyRoles = input.partyRoles;
|
|
667
|
+
ObjectFreeze(input_partyRoles);
|
|
668
|
+
ObjectFreeze(input);
|
|
669
|
+
}
|
|
670
|
+
|
|
671
|
+
const TTL$1 = 60000;
|
|
672
|
+
const VERSION$1 = "486ac4c33dd5ef737f23a417fce9ab94";
|
|
673
|
+
function validate$2(obj, path = 'CompanyDealPartyListRepresentation') {
|
|
674
|
+
const v_error = (() => {
|
|
675
|
+
if (typeof obj !== 'object' || ArrayIsArray(obj) || obj === null) {
|
|
676
|
+
return new TypeError('Expected "object" but received "' + typeof obj + '" (at "' + path + '")');
|
|
677
|
+
}
|
|
678
|
+
const obj_data = obj.data;
|
|
679
|
+
const path_data = path + '.data';
|
|
680
|
+
if (!ArrayIsArray(obj_data)) {
|
|
681
|
+
return new TypeError('Expected "array" but received "' + typeof obj_data + '" (at "' + path_data + '")');
|
|
682
|
+
}
|
|
683
|
+
for (let i = 0; i < obj_data.length; i++) {
|
|
684
|
+
const obj_data_item = obj_data[i];
|
|
685
|
+
const path_data_item = path_data + '[' + i + ']';
|
|
686
|
+
const referencepath_data_itemValidationError = validate$3(obj_data_item, path_data_item);
|
|
687
|
+
if (referencepath_data_itemValidationError !== null) {
|
|
688
|
+
let message = 'Object doesn\'t match CompanyDealPartyRepresentation (at "' + path_data_item + '")\n';
|
|
689
|
+
message += referencepath_data_itemValidationError.message.split('\n').map((line) => '\t' + line).join('\n');
|
|
690
|
+
return new TypeError(message);
|
|
691
|
+
}
|
|
692
|
+
}
|
|
693
|
+
})();
|
|
694
|
+
return v_error === undefined ? null : v_error;
|
|
695
|
+
}
|
|
696
|
+
const RepresentationType$1 = 'CompanyDealPartyListRepresentation';
|
|
697
|
+
function normalize$1(input, existing, path, luvio, store, timestamp) {
|
|
698
|
+
return input;
|
|
699
|
+
}
|
|
700
|
+
const select$3 = function CompanyDealPartyListRepresentationSelect() {
|
|
701
|
+
return {
|
|
702
|
+
kind: 'Fragment',
|
|
703
|
+
version: VERSION$1,
|
|
704
|
+
private: [],
|
|
705
|
+
opaque: true
|
|
706
|
+
};
|
|
707
|
+
};
|
|
708
|
+
function equals$1(existing, incoming) {
|
|
709
|
+
if (JSONStringify(incoming) !== JSONStringify(existing)) {
|
|
710
|
+
return false;
|
|
711
|
+
}
|
|
712
|
+
return true;
|
|
713
|
+
}
|
|
714
|
+
function deepFreeze$2(input) {
|
|
715
|
+
const input_data = input.data;
|
|
716
|
+
for (let i = 0; i < input_data.length; i++) {
|
|
717
|
+
const input_data_item = input_data[i];
|
|
718
|
+
deepFreeze$3(input_data_item);
|
|
719
|
+
}
|
|
720
|
+
ObjectFreeze(input_data);
|
|
721
|
+
ObjectFreeze(input);
|
|
722
|
+
}
|
|
723
|
+
const ingest$1 = function CompanyDealPartyListRepresentationIngest(input, path, luvio, store, timestamp) {
|
|
724
|
+
if (process.env.NODE_ENV !== 'production') {
|
|
725
|
+
const validateError = validate$2(input);
|
|
726
|
+
if (validateError !== null) {
|
|
727
|
+
throw validateError;
|
|
728
|
+
}
|
|
729
|
+
}
|
|
730
|
+
const key = path.fullPath;
|
|
731
|
+
const existingRecord = store.readEntry(key);
|
|
732
|
+
const ttlToUse = TTL$1;
|
|
733
|
+
let incomingRecord = normalize$1(input, store.readEntry(key), {
|
|
734
|
+
fullPath: key,
|
|
735
|
+
parent: path.parent,
|
|
736
|
+
propertyName: path.propertyName,
|
|
737
|
+
ttl: ttlToUse
|
|
738
|
+
});
|
|
739
|
+
deepFreeze$2(input);
|
|
740
|
+
if (existingRecord === undefined || equals$1(existingRecord, incomingRecord) === false) {
|
|
741
|
+
luvio.storePublish(key, incomingRecord);
|
|
742
|
+
}
|
|
743
|
+
{
|
|
744
|
+
const storeMetadataParams = {
|
|
745
|
+
ttl: ttlToUse,
|
|
746
|
+
namespace: "cib",
|
|
747
|
+
version: VERSION$1,
|
|
748
|
+
representationName: RepresentationType$1,
|
|
749
|
+
};
|
|
750
|
+
luvio.publishStoreMetadata(key, storeMetadataParams);
|
|
751
|
+
}
|
|
752
|
+
return createLink(key);
|
|
753
|
+
};
|
|
754
|
+
function getTypeCacheKeys$1(luvio, input, fullPathFactory) {
|
|
755
|
+
const rootKeySet = new StoreKeyMap();
|
|
756
|
+
// root cache key (uses fullPathFactory if keyBuilderFromType isn't defined)
|
|
757
|
+
const rootKey = fullPathFactory();
|
|
758
|
+
rootKeySet.set(rootKey, {
|
|
759
|
+
namespace: keyPrefix,
|
|
760
|
+
representationName: RepresentationType$1,
|
|
761
|
+
mergeable: false
|
|
762
|
+
});
|
|
763
|
+
return rootKeySet;
|
|
764
|
+
}
|
|
765
|
+
|
|
766
|
+
function select$2(luvio, params) {
|
|
767
|
+
return select$3();
|
|
768
|
+
}
|
|
769
|
+
function keyBuilder$3(luvio, params) {
|
|
770
|
+
return keyPrefix + '::CompanyDealPartyListRepresentation:(' + 'partyRoles:' + params.queryParams.partyRoles + ',' + 'financialDealId:' + params.urlParams.financialDealId + ')';
|
|
771
|
+
}
|
|
772
|
+
function getResponseCacheKeys$1(luvio, resourceParams, response) {
|
|
773
|
+
return getTypeCacheKeys$1(luvio, response, () => keyBuilder$3(luvio, resourceParams));
|
|
774
|
+
}
|
|
775
|
+
function ingestSuccess$1(luvio, resourceParams, response, snapshotRefresh) {
|
|
776
|
+
const { body } = response;
|
|
777
|
+
const key = keyBuilder$3(luvio, resourceParams);
|
|
778
|
+
luvio.storeIngest(key, ingest$1, body);
|
|
779
|
+
const snapshot = luvio.storeLookup({
|
|
780
|
+
recordId: key,
|
|
781
|
+
node: select$2(),
|
|
782
|
+
variables: {},
|
|
783
|
+
}, snapshotRefresh);
|
|
784
|
+
if (process.env.NODE_ENV !== 'production') {
|
|
785
|
+
if (snapshot.state !== 'Fulfilled') {
|
|
786
|
+
throw new Error('Invalid network response. Expected resource response to result in Fulfilled snapshot');
|
|
787
|
+
}
|
|
788
|
+
}
|
|
789
|
+
return snapshot;
|
|
790
|
+
}
|
|
791
|
+
function ingestError$1(luvio, params, error, snapshotRefresh) {
|
|
792
|
+
const key = keyBuilder$3(luvio, params);
|
|
793
|
+
const errorSnapshot = luvio.errorSnapshot(error, snapshotRefresh);
|
|
794
|
+
const storeMetadataParams = {
|
|
795
|
+
ttl: TTL$1,
|
|
796
|
+
namespace: keyPrefix,
|
|
797
|
+
version: VERSION$1,
|
|
798
|
+
representationName: RepresentationType$1
|
|
799
|
+
};
|
|
800
|
+
luvio.storeIngestError(key, errorSnapshot, storeMetadataParams);
|
|
801
|
+
return errorSnapshot;
|
|
802
|
+
}
|
|
803
|
+
function createResourceRequest$1(config) {
|
|
804
|
+
const headers = {};
|
|
805
|
+
return {
|
|
806
|
+
baseUri: '/services/data/v58.0',
|
|
807
|
+
basePath: '/connect/financialservices/deal-parties/' + config.urlParams.financialDealId + '',
|
|
808
|
+
method: 'get',
|
|
809
|
+
body: null,
|
|
810
|
+
urlParams: config.urlParams,
|
|
811
|
+
queryParams: config.queryParams,
|
|
812
|
+
headers,
|
|
813
|
+
priority: 'normal',
|
|
814
|
+
};
|
|
815
|
+
}
|
|
816
|
+
|
|
817
|
+
const getDealParties_ConfigPropertyNames = {
|
|
818
|
+
displayName: 'getDealParties',
|
|
819
|
+
parameters: {
|
|
820
|
+
required: ['financialDealId'],
|
|
821
|
+
optional: ['partyRoles']
|
|
822
|
+
}
|
|
823
|
+
};
|
|
824
|
+
function createResourceParams$1(config) {
|
|
825
|
+
const resourceParams = {
|
|
826
|
+
urlParams: {
|
|
827
|
+
financialDealId: config.financialDealId
|
|
828
|
+
},
|
|
829
|
+
queryParams: {
|
|
830
|
+
partyRoles: config.partyRoles
|
|
831
|
+
}
|
|
832
|
+
};
|
|
833
|
+
return resourceParams;
|
|
834
|
+
}
|
|
835
|
+
function keyBuilder$2(luvio, config) {
|
|
836
|
+
const resourceParams = createResourceParams$1(config);
|
|
837
|
+
return keyBuilder$3(luvio, resourceParams);
|
|
838
|
+
}
|
|
839
|
+
function typeCheckConfig$1(untrustedConfig) {
|
|
840
|
+
const config = {};
|
|
841
|
+
const untrustedConfig_financialDealId = untrustedConfig.financialDealId;
|
|
842
|
+
if (typeof untrustedConfig_financialDealId === 'string') {
|
|
843
|
+
config.financialDealId = untrustedConfig_financialDealId;
|
|
844
|
+
}
|
|
845
|
+
const untrustedConfig_partyRoles = untrustedConfig.partyRoles;
|
|
846
|
+
if (ArrayIsArray$1(untrustedConfig_partyRoles)) {
|
|
847
|
+
const untrustedConfig_partyRoles_array = [];
|
|
848
|
+
for (let i = 0, arrayLength = untrustedConfig_partyRoles.length; i < arrayLength; i++) {
|
|
849
|
+
const untrustedConfig_partyRoles_item = untrustedConfig_partyRoles[i];
|
|
850
|
+
if (typeof untrustedConfig_partyRoles_item === 'string') {
|
|
851
|
+
untrustedConfig_partyRoles_array.push(untrustedConfig_partyRoles_item);
|
|
852
|
+
}
|
|
853
|
+
}
|
|
854
|
+
config.partyRoles = untrustedConfig_partyRoles_array;
|
|
855
|
+
}
|
|
856
|
+
return config;
|
|
857
|
+
}
|
|
858
|
+
function validateAdapterConfig$1(untrustedConfig, configPropertyNames) {
|
|
859
|
+
if (!untrustedIsObject(untrustedConfig)) {
|
|
860
|
+
return null;
|
|
861
|
+
}
|
|
862
|
+
if (process.env.NODE_ENV !== 'production') {
|
|
863
|
+
validateConfig(untrustedConfig, configPropertyNames);
|
|
864
|
+
}
|
|
865
|
+
const config = typeCheckConfig$1(untrustedConfig);
|
|
866
|
+
if (!areRequiredParametersPresent(config, configPropertyNames)) {
|
|
867
|
+
return null;
|
|
868
|
+
}
|
|
869
|
+
return config;
|
|
870
|
+
}
|
|
871
|
+
function adapterFragment$1(luvio, config) {
|
|
872
|
+
createResourceParams$1(config);
|
|
873
|
+
return select$2();
|
|
874
|
+
}
|
|
875
|
+
function onFetchResponseSuccess$1(luvio, config, resourceParams, response) {
|
|
876
|
+
const snapshot = ingestSuccess$1(luvio, resourceParams, response, {
|
|
877
|
+
config,
|
|
878
|
+
resolve: () => buildNetworkSnapshot$1(luvio, config, snapshotRefreshOptions)
|
|
879
|
+
});
|
|
880
|
+
return luvio.storeBroadcast().then(() => snapshot);
|
|
881
|
+
}
|
|
882
|
+
function onFetchResponseError$1(luvio, config, resourceParams, response) {
|
|
883
|
+
const snapshot = ingestError$1(luvio, resourceParams, response, {
|
|
884
|
+
config,
|
|
885
|
+
resolve: () => buildNetworkSnapshot$1(luvio, config, snapshotRefreshOptions)
|
|
886
|
+
});
|
|
887
|
+
return luvio.storeBroadcast().then(() => snapshot);
|
|
888
|
+
}
|
|
889
|
+
function buildNetworkSnapshot$1(luvio, config, options) {
|
|
890
|
+
const resourceParams = createResourceParams$1(config);
|
|
891
|
+
const request = createResourceRequest$1(resourceParams);
|
|
892
|
+
return luvio.dispatchResourceRequest(request, options)
|
|
893
|
+
.then((response) => {
|
|
894
|
+
return luvio.handleSuccessResponse(() => onFetchResponseSuccess$1(luvio, config, resourceParams, response), () => getResponseCacheKeys$1(luvio, resourceParams, response.body));
|
|
895
|
+
}, (response) => {
|
|
896
|
+
return luvio.handleErrorResponse(() => onFetchResponseError$1(luvio, config, resourceParams, response));
|
|
897
|
+
});
|
|
898
|
+
}
|
|
899
|
+
function buildNetworkSnapshotCachePolicy$1(context, coercedAdapterRequestContext) {
|
|
900
|
+
const { luvio, config } = context;
|
|
901
|
+
const { networkPriority, requestCorrelator, eventObservers } = coercedAdapterRequestContext;
|
|
902
|
+
const dispatchOptions = {
|
|
903
|
+
resourceRequestContext: {
|
|
904
|
+
requestCorrelator,
|
|
905
|
+
luvioRequestMethod: undefined,
|
|
906
|
+
},
|
|
907
|
+
eventObservers
|
|
908
|
+
};
|
|
909
|
+
if (networkPriority !== 'normal') {
|
|
910
|
+
dispatchOptions.overrides = {
|
|
911
|
+
priority: networkPriority
|
|
912
|
+
};
|
|
913
|
+
}
|
|
914
|
+
return buildNetworkSnapshot$1(luvio, config, dispatchOptions);
|
|
915
|
+
}
|
|
916
|
+
function buildCachedSnapshotCachePolicy$1(context, storeLookup) {
|
|
917
|
+
const { luvio, config } = context;
|
|
918
|
+
const selector = {
|
|
919
|
+
recordId: keyBuilder$2(luvio, config),
|
|
920
|
+
node: adapterFragment$1(luvio, config),
|
|
921
|
+
variables: {},
|
|
922
|
+
};
|
|
923
|
+
const cacheSnapshot = storeLookup(selector, {
|
|
924
|
+
config,
|
|
925
|
+
resolve: () => buildNetworkSnapshot$1(luvio, config, snapshotRefreshOptions)
|
|
926
|
+
});
|
|
927
|
+
return cacheSnapshot;
|
|
928
|
+
}
|
|
929
|
+
const getDealPartiesAdapterFactory = (luvio) => function cib__getDealParties(untrustedConfig, requestContext) {
|
|
930
|
+
const config = validateAdapterConfig$1(untrustedConfig, getDealParties_ConfigPropertyNames);
|
|
931
|
+
// Invalid or incomplete config
|
|
932
|
+
if (config === null) {
|
|
933
|
+
return null;
|
|
934
|
+
}
|
|
935
|
+
return luvio.applyCachePolicy((requestContext || {}), { config, luvio }, // BuildSnapshotContext
|
|
936
|
+
buildCachedSnapshotCachePolicy$1, buildNetworkSnapshotCachePolicy$1);
|
|
937
|
+
};
|
|
938
|
+
|
|
939
|
+
function validate$1(obj, path = 'ContactRepresentation') {
|
|
940
|
+
const v_error = (() => {
|
|
941
|
+
if (typeof obj !== 'object' || ArrayIsArray(obj) || obj === null) {
|
|
942
|
+
return new TypeError('Expected "object" but received "' + typeof obj + '" (at "' + path + '")');
|
|
943
|
+
}
|
|
944
|
+
const obj_id = obj.id;
|
|
945
|
+
const path_id = path + '.id';
|
|
946
|
+
if (typeof obj_id !== 'string') {
|
|
947
|
+
return new TypeError('Expected "string" but received "' + typeof obj_id + '" (at "' + path_id + '")');
|
|
948
|
+
}
|
|
949
|
+
const obj_interactionsCount = obj.interactionsCount;
|
|
950
|
+
const path_interactionsCount = path + '.interactionsCount';
|
|
951
|
+
if (typeof obj_interactionsCount !== 'number' || (typeof obj_interactionsCount === 'number' && Math.floor(obj_interactionsCount) !== obj_interactionsCount)) {
|
|
952
|
+
return new TypeError('Expected "integer" but received "' + typeof obj_interactionsCount + '" (at "' + path_interactionsCount + '")');
|
|
953
|
+
}
|
|
954
|
+
const obj_name = obj.name;
|
|
955
|
+
const path_name = path + '.name';
|
|
956
|
+
let obj_name_union0 = null;
|
|
957
|
+
const obj_name_union0_error = (() => {
|
|
958
|
+
if (typeof obj_name !== 'string') {
|
|
959
|
+
return new TypeError('Expected "string" but received "' + typeof obj_name + '" (at "' + path_name + '")');
|
|
960
|
+
}
|
|
961
|
+
})();
|
|
962
|
+
if (obj_name_union0_error != null) {
|
|
963
|
+
obj_name_union0 = obj_name_union0_error.message;
|
|
964
|
+
}
|
|
965
|
+
let obj_name_union1 = null;
|
|
966
|
+
const obj_name_union1_error = (() => {
|
|
967
|
+
if (obj_name !== null) {
|
|
968
|
+
return new TypeError('Expected "null" but received "' + typeof obj_name + '" (at "' + path_name + '")');
|
|
969
|
+
}
|
|
970
|
+
})();
|
|
971
|
+
if (obj_name_union1_error != null) {
|
|
972
|
+
obj_name_union1 = obj_name_union1_error.message;
|
|
973
|
+
}
|
|
974
|
+
if (obj_name_union0 && obj_name_union1) {
|
|
975
|
+
let message = 'Object doesn\'t match union (at "' + path_name + '")';
|
|
976
|
+
message += '\n' + obj_name_union0.split('\n').map((line) => '\t' + line).join('\n');
|
|
977
|
+
message += '\n' + obj_name_union1.split('\n').map((line) => '\t' + line).join('\n');
|
|
978
|
+
return new TypeError(message);
|
|
979
|
+
}
|
|
980
|
+
const obj_title = obj.title;
|
|
981
|
+
const path_title = path + '.title';
|
|
982
|
+
let obj_title_union0 = null;
|
|
983
|
+
const obj_title_union0_error = (() => {
|
|
984
|
+
if (typeof obj_title !== 'string') {
|
|
985
|
+
return new TypeError('Expected "string" but received "' + typeof obj_title + '" (at "' + path_title + '")');
|
|
986
|
+
}
|
|
987
|
+
})();
|
|
988
|
+
if (obj_title_union0_error != null) {
|
|
989
|
+
obj_title_union0 = obj_title_union0_error.message;
|
|
990
|
+
}
|
|
991
|
+
let obj_title_union1 = null;
|
|
992
|
+
const obj_title_union1_error = (() => {
|
|
993
|
+
if (obj_title !== null) {
|
|
994
|
+
return new TypeError('Expected "null" but received "' + typeof obj_title + '" (at "' + path_title + '")');
|
|
995
|
+
}
|
|
996
|
+
})();
|
|
997
|
+
if (obj_title_union1_error != null) {
|
|
998
|
+
obj_title_union1 = obj_title_union1_error.message;
|
|
999
|
+
}
|
|
1000
|
+
if (obj_title_union0 && obj_title_union1) {
|
|
1001
|
+
let message = 'Object doesn\'t match union (at "' + path_title + '")';
|
|
1002
|
+
message += '\n' + obj_title_union0.split('\n').map((line) => '\t' + line).join('\n');
|
|
1003
|
+
message += '\n' + obj_title_union1.split('\n').map((line) => '\t' + line).join('\n');
|
|
1004
|
+
return new TypeError(message);
|
|
1005
|
+
}
|
|
1006
|
+
})();
|
|
1007
|
+
return v_error === undefined ? null : v_error;
|
|
1008
|
+
}
|
|
1009
|
+
function deepFreeze$1(input) {
|
|
1010
|
+
ObjectFreeze(input);
|
|
1011
|
+
}
|
|
1012
|
+
|
|
1013
|
+
const TTL = 60000;
|
|
1014
|
+
const VERSION = "ae005c5c1fab63939fcd5bab74c1d960";
|
|
1015
|
+
function validate(obj, path = 'ContactsRepresentation') {
|
|
1016
|
+
const v_error = (() => {
|
|
1017
|
+
if (typeof obj !== 'object' || ArrayIsArray(obj) || obj === null) {
|
|
1018
|
+
return new TypeError('Expected "object" but received "' + typeof obj + '" (at "' + path + '")');
|
|
1019
|
+
}
|
|
1020
|
+
const obj_contacts = obj.contacts;
|
|
1021
|
+
const path_contacts = path + '.contacts';
|
|
1022
|
+
if (!ArrayIsArray(obj_contacts)) {
|
|
1023
|
+
return new TypeError('Expected "array" but received "' + typeof obj_contacts + '" (at "' + path_contacts + '")');
|
|
1024
|
+
}
|
|
1025
|
+
for (let i = 0; i < obj_contacts.length; i++) {
|
|
1026
|
+
const obj_contacts_item = obj_contacts[i];
|
|
1027
|
+
const path_contacts_item = path_contacts + '[' + i + ']';
|
|
1028
|
+
const referencepath_contacts_itemValidationError = validate$1(obj_contacts_item, path_contacts_item);
|
|
1029
|
+
if (referencepath_contacts_itemValidationError !== null) {
|
|
1030
|
+
let message = 'Object doesn\'t match ContactRepresentation (at "' + path_contacts_item + '")\n';
|
|
1031
|
+
message += referencepath_contacts_itemValidationError.message.split('\n').map((line) => '\t' + line).join('\n');
|
|
1032
|
+
return new TypeError(message);
|
|
1033
|
+
}
|
|
1034
|
+
}
|
|
1035
|
+
const obj_isDirectContacts = obj.isDirectContacts;
|
|
1036
|
+
const path_isDirectContacts = path + '.isDirectContacts';
|
|
1037
|
+
if (typeof obj_isDirectContacts !== 'boolean') {
|
|
1038
|
+
return new TypeError('Expected "boolean" but received "' + typeof obj_isDirectContacts + '" (at "' + path_isDirectContacts + '")');
|
|
1039
|
+
}
|
|
1040
|
+
const obj_nextOffset = obj.nextOffset;
|
|
1041
|
+
const path_nextOffset = path + '.nextOffset';
|
|
1042
|
+
if (typeof obj_nextOffset !== 'number' || (typeof obj_nextOffset === 'number' && Math.floor(obj_nextOffset) !== obj_nextOffset)) {
|
|
1043
|
+
return new TypeError('Expected "integer" but received "' + typeof obj_nextOffset + '" (at "' + path_nextOffset + '")');
|
|
1044
|
+
}
|
|
1045
|
+
})();
|
|
1046
|
+
return v_error === undefined ? null : v_error;
|
|
1047
|
+
}
|
|
1048
|
+
const RepresentationType = 'ContactsRepresentation';
|
|
1049
|
+
function normalize(input, existing, path, luvio, store, timestamp) {
|
|
1050
|
+
return input;
|
|
1051
|
+
}
|
|
1052
|
+
const select$1 = function ContactsRepresentationSelect() {
|
|
1053
|
+
return {
|
|
1054
|
+
kind: 'Fragment',
|
|
1055
|
+
version: VERSION,
|
|
1056
|
+
private: [],
|
|
1057
|
+
opaque: true
|
|
1058
|
+
};
|
|
1059
|
+
};
|
|
1060
|
+
function equals(existing, incoming) {
|
|
1061
|
+
if (JSONStringify(incoming) !== JSONStringify(existing)) {
|
|
1062
|
+
return false;
|
|
1063
|
+
}
|
|
1064
|
+
return true;
|
|
1065
|
+
}
|
|
1066
|
+
function deepFreeze(input) {
|
|
1067
|
+
const input_contacts = input.contacts;
|
|
1068
|
+
for (let i = 0; i < input_contacts.length; i++) {
|
|
1069
|
+
const input_contacts_item = input_contacts[i];
|
|
1070
|
+
deepFreeze$1(input_contacts_item);
|
|
1071
|
+
}
|
|
1072
|
+
ObjectFreeze(input_contacts);
|
|
1073
|
+
ObjectFreeze(input);
|
|
1074
|
+
}
|
|
1075
|
+
const ingest = function ContactsRepresentationIngest(input, path, luvio, store, timestamp) {
|
|
1076
|
+
if (process.env.NODE_ENV !== 'production') {
|
|
1077
|
+
const validateError = validate(input);
|
|
1078
|
+
if (validateError !== null) {
|
|
1079
|
+
throw validateError;
|
|
1080
|
+
}
|
|
1081
|
+
}
|
|
1082
|
+
const key = path.fullPath;
|
|
1083
|
+
const existingRecord = store.readEntry(key);
|
|
1084
|
+
const ttlToUse = TTL;
|
|
1085
|
+
let incomingRecord = normalize(input, store.readEntry(key), {
|
|
1086
|
+
fullPath: key,
|
|
1087
|
+
parent: path.parent,
|
|
1088
|
+
propertyName: path.propertyName,
|
|
1089
|
+
ttl: ttlToUse
|
|
1090
|
+
});
|
|
1091
|
+
deepFreeze(input);
|
|
1092
|
+
if (existingRecord === undefined || equals(existingRecord, incomingRecord) === false) {
|
|
1093
|
+
luvio.storePublish(key, incomingRecord);
|
|
1094
|
+
}
|
|
1095
|
+
{
|
|
1096
|
+
const storeMetadataParams = {
|
|
1097
|
+
ttl: ttlToUse,
|
|
1098
|
+
namespace: "cib",
|
|
1099
|
+
version: VERSION,
|
|
1100
|
+
representationName: RepresentationType,
|
|
1101
|
+
};
|
|
1102
|
+
luvio.publishStoreMetadata(key, storeMetadataParams);
|
|
1103
|
+
}
|
|
1104
|
+
return createLink(key);
|
|
1105
|
+
};
|
|
1106
|
+
function getTypeCacheKeys(luvio, input, fullPathFactory) {
|
|
1107
|
+
const rootKeySet = new StoreKeyMap();
|
|
1108
|
+
// root cache key (uses fullPathFactory if keyBuilderFromType isn't defined)
|
|
1109
|
+
const rootKey = fullPathFactory();
|
|
1110
|
+
rootKeySet.set(rootKey, {
|
|
1111
|
+
namespace: keyPrefix,
|
|
1112
|
+
representationName: RepresentationType,
|
|
1113
|
+
mergeable: false
|
|
1114
|
+
});
|
|
1115
|
+
return rootKeySet;
|
|
1116
|
+
}
|
|
1117
|
+
|
|
1118
|
+
function select(luvio, params) {
|
|
1119
|
+
return select$1();
|
|
1120
|
+
}
|
|
1121
|
+
function keyBuilder$1(luvio, params) {
|
|
1122
|
+
return keyPrefix + '::ContactsRepresentation:(' + 'isDirectContacts:' + params.queryParams.isDirectContacts + ',' + 'limit:' + params.queryParams.limit + ',' + 'offset:' + params.queryParams.offset + ',' + 'showACR:' + params.queryParams.showACR + ',' + 'systemContext:' + params.queryParams.systemContext + ',' + 'accountId:' + params.urlParams.accountId + ')';
|
|
1123
|
+
}
|
|
1124
|
+
function getResponseCacheKeys(luvio, resourceParams, response) {
|
|
1125
|
+
return getTypeCacheKeys(luvio, response, () => keyBuilder$1(luvio, resourceParams));
|
|
1126
|
+
}
|
|
1127
|
+
function ingestSuccess(luvio, resourceParams, response, snapshotRefresh) {
|
|
1128
|
+
const { body } = response;
|
|
1129
|
+
const key = keyBuilder$1(luvio, resourceParams);
|
|
1130
|
+
luvio.storeIngest(key, ingest, body);
|
|
1131
|
+
const snapshot = luvio.storeLookup({
|
|
1132
|
+
recordId: key,
|
|
1133
|
+
node: select(),
|
|
1134
|
+
variables: {},
|
|
1135
|
+
}, snapshotRefresh);
|
|
1136
|
+
if (process.env.NODE_ENV !== 'production') {
|
|
1137
|
+
if (snapshot.state !== 'Fulfilled') {
|
|
1138
|
+
throw new Error('Invalid network response. Expected resource response to result in Fulfilled snapshot');
|
|
1139
|
+
}
|
|
1140
|
+
}
|
|
1141
|
+
return snapshot;
|
|
1142
|
+
}
|
|
1143
|
+
function ingestError(luvio, params, error, snapshotRefresh) {
|
|
1144
|
+
const key = keyBuilder$1(luvio, params);
|
|
1145
|
+
const errorSnapshot = luvio.errorSnapshot(error, snapshotRefresh);
|
|
1146
|
+
const storeMetadataParams = {
|
|
1147
|
+
ttl: TTL,
|
|
1148
|
+
namespace: keyPrefix,
|
|
1149
|
+
version: VERSION,
|
|
1150
|
+
representationName: RepresentationType
|
|
1151
|
+
};
|
|
1152
|
+
luvio.storeIngestError(key, errorSnapshot, storeMetadataParams);
|
|
1153
|
+
return errorSnapshot;
|
|
1154
|
+
}
|
|
1155
|
+
function createResourceRequest(config) {
|
|
1156
|
+
const headers = {};
|
|
1157
|
+
return {
|
|
1158
|
+
baseUri: '/services/data/v58.0',
|
|
1159
|
+
basePath: '/connect/financialservices/interaction-insights/' + config.urlParams.accountId + '',
|
|
1160
|
+
method: 'get',
|
|
1161
|
+
body: null,
|
|
1162
|
+
urlParams: config.urlParams,
|
|
1163
|
+
queryParams: config.queryParams,
|
|
1164
|
+
headers,
|
|
1165
|
+
priority: 'normal',
|
|
1166
|
+
};
|
|
1167
|
+
}
|
|
1168
|
+
|
|
1169
|
+
const getInteractionInsights_ConfigPropertyNames = {
|
|
1170
|
+
displayName: 'getInteractionInsights',
|
|
1171
|
+
parameters: {
|
|
1172
|
+
required: ['accountId'],
|
|
1173
|
+
optional: ['isDirectContacts', 'limit', 'offset', 'showACR', 'systemContext']
|
|
1174
|
+
}
|
|
1175
|
+
};
|
|
1176
|
+
function createResourceParams(config) {
|
|
1177
|
+
const resourceParams = {
|
|
1178
|
+
urlParams: {
|
|
1179
|
+
accountId: config.accountId
|
|
1180
|
+
},
|
|
1181
|
+
queryParams: {
|
|
1182
|
+
isDirectContacts: config.isDirectContacts, limit: config.limit, offset: config.offset, showACR: config.showACR, systemContext: config.systemContext
|
|
1183
|
+
}
|
|
1184
|
+
};
|
|
1185
|
+
return resourceParams;
|
|
1186
|
+
}
|
|
1187
|
+
function keyBuilder(luvio, config) {
|
|
1188
|
+
const resourceParams = createResourceParams(config);
|
|
1189
|
+
return keyBuilder$1(luvio, resourceParams);
|
|
1190
|
+
}
|
|
1191
|
+
function typeCheckConfig(untrustedConfig) {
|
|
1192
|
+
const config = {};
|
|
1193
|
+
const untrustedConfig_accountId = untrustedConfig.accountId;
|
|
1194
|
+
if (typeof untrustedConfig_accountId === 'string') {
|
|
1195
|
+
config.accountId = untrustedConfig_accountId;
|
|
1196
|
+
}
|
|
1197
|
+
const untrustedConfig_isDirectContacts = untrustedConfig.isDirectContacts;
|
|
1198
|
+
if (typeof untrustedConfig_isDirectContacts === 'boolean') {
|
|
1199
|
+
config.isDirectContacts = untrustedConfig_isDirectContacts;
|
|
1200
|
+
}
|
|
1201
|
+
const untrustedConfig_limit = untrustedConfig.limit;
|
|
1202
|
+
if (typeof untrustedConfig_limit === 'number' && Math.floor(untrustedConfig_limit) === untrustedConfig_limit) {
|
|
1203
|
+
config.limit = untrustedConfig_limit;
|
|
1204
|
+
}
|
|
1205
|
+
const untrustedConfig_offset = untrustedConfig.offset;
|
|
1206
|
+
if (typeof untrustedConfig_offset === 'number' && Math.floor(untrustedConfig_offset) === untrustedConfig_offset) {
|
|
1207
|
+
config.offset = untrustedConfig_offset;
|
|
1208
|
+
}
|
|
1209
|
+
const untrustedConfig_showACR = untrustedConfig.showACR;
|
|
1210
|
+
if (typeof untrustedConfig_showACR === 'boolean') {
|
|
1211
|
+
config.showACR = untrustedConfig_showACR;
|
|
1212
|
+
}
|
|
1213
|
+
const untrustedConfig_systemContext = untrustedConfig.systemContext;
|
|
1214
|
+
if (typeof untrustedConfig_systemContext === 'boolean') {
|
|
1215
|
+
config.systemContext = untrustedConfig_systemContext;
|
|
1216
|
+
}
|
|
1217
|
+
return config;
|
|
1218
|
+
}
|
|
1219
|
+
function validateAdapterConfig(untrustedConfig, configPropertyNames) {
|
|
1220
|
+
if (!untrustedIsObject(untrustedConfig)) {
|
|
1221
|
+
return null;
|
|
1222
|
+
}
|
|
1223
|
+
if (process.env.NODE_ENV !== 'production') {
|
|
1224
|
+
validateConfig(untrustedConfig, configPropertyNames);
|
|
1225
|
+
}
|
|
1226
|
+
const config = typeCheckConfig(untrustedConfig);
|
|
1227
|
+
if (!areRequiredParametersPresent(config, configPropertyNames)) {
|
|
1228
|
+
return null;
|
|
1229
|
+
}
|
|
1230
|
+
return config;
|
|
1231
|
+
}
|
|
1232
|
+
function adapterFragment(luvio, config) {
|
|
1233
|
+
createResourceParams(config);
|
|
1234
|
+
return select();
|
|
1235
|
+
}
|
|
1236
|
+
function onFetchResponseSuccess(luvio, config, resourceParams, response) {
|
|
1237
|
+
const snapshot = ingestSuccess(luvio, resourceParams, response, {
|
|
1238
|
+
config,
|
|
1239
|
+
resolve: () => buildNetworkSnapshot(luvio, config, snapshotRefreshOptions)
|
|
1240
|
+
});
|
|
1241
|
+
return luvio.storeBroadcast().then(() => snapshot);
|
|
1242
|
+
}
|
|
1243
|
+
function onFetchResponseError(luvio, config, resourceParams, response) {
|
|
1244
|
+
const snapshot = ingestError(luvio, resourceParams, response, {
|
|
1245
|
+
config,
|
|
1246
|
+
resolve: () => buildNetworkSnapshot(luvio, config, snapshotRefreshOptions)
|
|
1247
|
+
});
|
|
1248
|
+
return luvio.storeBroadcast().then(() => snapshot);
|
|
1249
|
+
}
|
|
1250
|
+
function buildNetworkSnapshot(luvio, config, options) {
|
|
1251
|
+
const resourceParams = createResourceParams(config);
|
|
1252
|
+
const request = createResourceRequest(resourceParams);
|
|
1253
|
+
return luvio.dispatchResourceRequest(request, options)
|
|
1254
|
+
.then((response) => {
|
|
1255
|
+
return luvio.handleSuccessResponse(() => onFetchResponseSuccess(luvio, config, resourceParams, response), () => getResponseCacheKeys(luvio, resourceParams, response.body));
|
|
1256
|
+
}, (response) => {
|
|
1257
|
+
return luvio.handleErrorResponse(() => onFetchResponseError(luvio, config, resourceParams, response));
|
|
1258
|
+
});
|
|
1259
|
+
}
|
|
1260
|
+
function buildNetworkSnapshotCachePolicy(context, coercedAdapterRequestContext) {
|
|
1261
|
+
const { luvio, config } = context;
|
|
1262
|
+
const { networkPriority, requestCorrelator, eventObservers } = coercedAdapterRequestContext;
|
|
1263
|
+
const dispatchOptions = {
|
|
1264
|
+
resourceRequestContext: {
|
|
1265
|
+
requestCorrelator,
|
|
1266
|
+
luvioRequestMethod: undefined,
|
|
1267
|
+
},
|
|
1268
|
+
eventObservers
|
|
1269
|
+
};
|
|
1270
|
+
if (networkPriority !== 'normal') {
|
|
1271
|
+
dispatchOptions.overrides = {
|
|
1272
|
+
priority: networkPriority
|
|
1273
|
+
};
|
|
1274
|
+
}
|
|
1275
|
+
return buildNetworkSnapshot(luvio, config, dispatchOptions);
|
|
1276
|
+
}
|
|
1277
|
+
function buildCachedSnapshotCachePolicy(context, storeLookup) {
|
|
1278
|
+
const { luvio, config } = context;
|
|
1279
|
+
const selector = {
|
|
1280
|
+
recordId: keyBuilder(luvio, config),
|
|
1281
|
+
node: adapterFragment(luvio, config),
|
|
1282
|
+
variables: {},
|
|
1283
|
+
};
|
|
1284
|
+
const cacheSnapshot = storeLookup(selector, {
|
|
1285
|
+
config,
|
|
1286
|
+
resolve: () => buildNetworkSnapshot(luvio, config, snapshotRefreshOptions)
|
|
1287
|
+
});
|
|
1288
|
+
return cacheSnapshot;
|
|
1289
|
+
}
|
|
1290
|
+
const getInteractionInsightsAdapterFactory = (luvio) => function cib__getInteractionInsights(untrustedConfig, requestContext) {
|
|
1291
|
+
const config = validateAdapterConfig(untrustedConfig, getInteractionInsights_ConfigPropertyNames);
|
|
1292
|
+
// Invalid or incomplete config
|
|
1293
|
+
if (config === null) {
|
|
1294
|
+
return null;
|
|
1295
|
+
}
|
|
1296
|
+
return luvio.applyCachePolicy((requestContext || {}), { config, luvio }, // BuildSnapshotContext
|
|
1297
|
+
buildCachedSnapshotCachePolicy, buildNetworkSnapshotCachePolicy);
|
|
1298
|
+
};
|
|
1299
|
+
|
|
1300
|
+
export { getContactsInteractionsAdapterFactory, getDealPartiesAdapterFactory, getInteractionInsightsAdapterFactory };
|