@salesforce/lds-adapters-industries-cib 0.1.0-dev1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE.txt +82 -0
- package/dist/es/es2018/industries-cib.js +1092 -0
- package/dist/es/es2018/types/src/generated/adapters/adapter-utils.d.ts +62 -0
- package/dist/es/es2018/types/src/generated/adapters/getContactsInteractions.d.ts +29 -0
- package/dist/es/es2018/types/src/generated/adapters/getDealParties.d.ts +28 -0
- package/dist/es/es2018/types/src/generated/adapters/getInteractionInsights.d.ts +32 -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 +30 -0
- package/dist/es/es2018/types/src/generated/types/CompanyDealPartyRepresentation.d.ts +37 -0
- package/dist/es/es2018/types/src/generated/types/ContactInteractionsListRepresentation.d.ts +30 -0
- package/dist/es/es2018/types/src/generated/types/ContactInteractionsRepresentation.d.ts +38 -0
- package/dist/es/es2018/types/src/generated/types/ContactRepresentation.d.ts +37 -0
- package/dist/es/es2018/types/src/generated/types/ContactsRepresentation.d.ts +36 -0
- package/dist/es/es2018/types/src/generated/types/InteractionRepresentation.d.ts +47 -0
- package/dist/es/es2018/types/src/generated/types/UserRepresentation.d.ts +37 -0
- package/dist/es/es2018/types/src/generated/types/type-utils.d.ts +32 -0
- package/package.json +74 -0
- package/sfdc/index.d.ts +1 -0
- package/sfdc/index.js +1150 -0
- package/src/raml/api.raml +231 -0
- package/src/raml/luvio.raml +33 -0
|
@@ -0,0 +1,1092 @@
|
|
|
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, ingestShape, deepFreeze, buildNetworkSnapshotCachePolicy as buildNetworkSnapshotCachePolicy$3, typeCheckConfig as typeCheckConfig$3, StoreKeyMap, createResourceParams as createResourceParams$3 } from '@luvio/engine';
|
|
8
|
+
|
|
9
|
+
const { hasOwnProperty: ObjectPrototypeHasOwnProperty } = Object.prototype;
|
|
10
|
+
const { keys: ObjectKeys, create: ObjectCreate } = 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(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
|
+
function generateParamConfigMetadata(name, required, resourceType, typeCheckShape, isArrayShape = false, coerceFn) {
|
|
52
|
+
return {
|
|
53
|
+
name,
|
|
54
|
+
required,
|
|
55
|
+
resourceType,
|
|
56
|
+
typeCheckShape,
|
|
57
|
+
isArrayShape,
|
|
58
|
+
coerceFn,
|
|
59
|
+
};
|
|
60
|
+
}
|
|
61
|
+
function buildAdapterValidationConfig(displayName, paramsMeta) {
|
|
62
|
+
const required = paramsMeta.filter(p => p.required).map(p => p.name);
|
|
63
|
+
const optional = paramsMeta.filter(p => !p.required).map(p => p.name);
|
|
64
|
+
return {
|
|
65
|
+
displayName,
|
|
66
|
+
parameters: {
|
|
67
|
+
required,
|
|
68
|
+
optional,
|
|
69
|
+
}
|
|
70
|
+
};
|
|
71
|
+
}
|
|
72
|
+
const keyPrefix = 'cib';
|
|
73
|
+
|
|
74
|
+
const { isArray: ArrayIsArray } = Array;
|
|
75
|
+
const { stringify: JSONStringify } = JSON;
|
|
76
|
+
function createLink(ref) {
|
|
77
|
+
return {
|
|
78
|
+
__ref: serializeStructuredKey(ref),
|
|
79
|
+
};
|
|
80
|
+
}
|
|
81
|
+
|
|
82
|
+
function validate$7(obj, path = 'UserRepresentation') {
|
|
83
|
+
const v_error = (() => {
|
|
84
|
+
if (typeof obj !== 'object' || ArrayIsArray(obj) || obj === null) {
|
|
85
|
+
return new TypeError('Expected "object" but received "' + typeof obj + '" (at "' + path + '")');
|
|
86
|
+
}
|
|
87
|
+
const obj_id = obj.id;
|
|
88
|
+
const path_id = path + '.id';
|
|
89
|
+
if (typeof obj_id !== 'string') {
|
|
90
|
+
return new TypeError('Expected "string" but received "' + typeof obj_id + '" (at "' + path_id + '")');
|
|
91
|
+
}
|
|
92
|
+
const obj_name = obj.name;
|
|
93
|
+
const path_name = path + '.name';
|
|
94
|
+
if (typeof obj_name !== 'string') {
|
|
95
|
+
return new TypeError('Expected "string" but received "' + typeof obj_name + '" (at "' + path_name + '")');
|
|
96
|
+
}
|
|
97
|
+
const obj_photoUrl = obj.photoUrl;
|
|
98
|
+
const path_photoUrl = path + '.photoUrl';
|
|
99
|
+
if (typeof obj_photoUrl !== 'string') {
|
|
100
|
+
return new TypeError('Expected "string" but received "' + typeof obj_photoUrl + '" (at "' + path_photoUrl + '")');
|
|
101
|
+
}
|
|
102
|
+
const obj_title = obj.title;
|
|
103
|
+
const path_title = path + '.title';
|
|
104
|
+
let obj_title_union0 = null;
|
|
105
|
+
const obj_title_union0_error = (() => {
|
|
106
|
+
if (typeof obj_title !== 'string') {
|
|
107
|
+
return new TypeError('Expected "string" but received "' + typeof obj_title + '" (at "' + path_title + '")');
|
|
108
|
+
}
|
|
109
|
+
})();
|
|
110
|
+
if (obj_title_union0_error != null) {
|
|
111
|
+
obj_title_union0 = obj_title_union0_error.message;
|
|
112
|
+
}
|
|
113
|
+
let obj_title_union1 = null;
|
|
114
|
+
const obj_title_union1_error = (() => {
|
|
115
|
+
if (obj_title !== null) {
|
|
116
|
+
return new TypeError('Expected "null" but received "' + typeof obj_title + '" (at "' + path_title + '")');
|
|
117
|
+
}
|
|
118
|
+
})();
|
|
119
|
+
if (obj_title_union1_error != null) {
|
|
120
|
+
obj_title_union1 = obj_title_union1_error.message;
|
|
121
|
+
}
|
|
122
|
+
if (obj_title_union0 && obj_title_union1) {
|
|
123
|
+
let message = 'Object doesn\'t match union (at "' + path_title + '")';
|
|
124
|
+
message += '\n' + obj_title_union0.split('\n').map((line) => '\t' + line).join('\n');
|
|
125
|
+
message += '\n' + obj_title_union1.split('\n').map((line) => '\t' + line).join('\n');
|
|
126
|
+
return new TypeError(message);
|
|
127
|
+
}
|
|
128
|
+
})();
|
|
129
|
+
return v_error === undefined ? null : v_error;
|
|
130
|
+
}
|
|
131
|
+
|
|
132
|
+
function validate$6(obj, path = 'InteractionRepresentation') {
|
|
133
|
+
const v_error = (() => {
|
|
134
|
+
if (typeof obj !== 'object' || ArrayIsArray(obj) || obj === null) {
|
|
135
|
+
return new TypeError('Expected "object" but received "' + typeof obj + '" (at "' + path + '")');
|
|
136
|
+
}
|
|
137
|
+
const obj_attendeesCount = obj.attendeesCount;
|
|
138
|
+
const path_attendeesCount = path + '.attendeesCount';
|
|
139
|
+
if (typeof obj_attendeesCount !== 'number' || (typeof obj_attendeesCount === 'number' && Math.floor(obj_attendeesCount) !== obj_attendeesCount)) {
|
|
140
|
+
return new TypeError('Expected "integer" but received "' + typeof obj_attendeesCount + '" (at "' + path_attendeesCount + '")');
|
|
141
|
+
}
|
|
142
|
+
const obj_icon = obj.icon;
|
|
143
|
+
const path_icon = path + '.icon';
|
|
144
|
+
let obj_icon_union0 = null;
|
|
145
|
+
const obj_icon_union0_error = (() => {
|
|
146
|
+
if (typeof obj_icon !== 'string') {
|
|
147
|
+
return new TypeError('Expected "string" but received "' + typeof obj_icon + '" (at "' + path_icon + '")');
|
|
148
|
+
}
|
|
149
|
+
})();
|
|
150
|
+
if (obj_icon_union0_error != null) {
|
|
151
|
+
obj_icon_union0 = obj_icon_union0_error.message;
|
|
152
|
+
}
|
|
153
|
+
let obj_icon_union1 = null;
|
|
154
|
+
const obj_icon_union1_error = (() => {
|
|
155
|
+
if (obj_icon !== null) {
|
|
156
|
+
return new TypeError('Expected "null" but received "' + typeof obj_icon + '" (at "' + path_icon + '")');
|
|
157
|
+
}
|
|
158
|
+
})();
|
|
159
|
+
if (obj_icon_union1_error != null) {
|
|
160
|
+
obj_icon_union1 = obj_icon_union1_error.message;
|
|
161
|
+
}
|
|
162
|
+
if (obj_icon_union0 && obj_icon_union1) {
|
|
163
|
+
let message = 'Object doesn\'t match union (at "' + path_icon + '")';
|
|
164
|
+
message += '\n' + obj_icon_union0.split('\n').map((line) => '\t' + line).join('\n');
|
|
165
|
+
message += '\n' + obj_icon_union1.split('\n').map((line) => '\t' + line).join('\n');
|
|
166
|
+
return new TypeError(message);
|
|
167
|
+
}
|
|
168
|
+
const obj_id = obj.id;
|
|
169
|
+
const path_id = path + '.id';
|
|
170
|
+
let obj_id_union0 = null;
|
|
171
|
+
const obj_id_union0_error = (() => {
|
|
172
|
+
if (typeof obj_id !== 'string') {
|
|
173
|
+
return new TypeError('Expected "string" but received "' + typeof obj_id + '" (at "' + path_id + '")');
|
|
174
|
+
}
|
|
175
|
+
})();
|
|
176
|
+
if (obj_id_union0_error != null) {
|
|
177
|
+
obj_id_union0 = obj_id_union0_error.message;
|
|
178
|
+
}
|
|
179
|
+
let obj_id_union1 = null;
|
|
180
|
+
const obj_id_union1_error = (() => {
|
|
181
|
+
if (obj_id !== null) {
|
|
182
|
+
return new TypeError('Expected "null" but received "' + typeof obj_id + '" (at "' + path_id + '")');
|
|
183
|
+
}
|
|
184
|
+
})();
|
|
185
|
+
if (obj_id_union1_error != null) {
|
|
186
|
+
obj_id_union1 = obj_id_union1_error.message;
|
|
187
|
+
}
|
|
188
|
+
if (obj_id_union0 && obj_id_union1) {
|
|
189
|
+
let message = 'Object doesn\'t match union (at "' + path_id + '")';
|
|
190
|
+
message += '\n' + obj_id_union0.split('\n').map((line) => '\t' + line).join('\n');
|
|
191
|
+
message += '\n' + obj_id_union1.split('\n').map((line) => '\t' + line).join('\n');
|
|
192
|
+
return new TypeError(message);
|
|
193
|
+
}
|
|
194
|
+
const obj_isPrivate = obj.isPrivate;
|
|
195
|
+
const path_isPrivate = path + '.isPrivate';
|
|
196
|
+
if (typeof obj_isPrivate !== 'boolean') {
|
|
197
|
+
return new TypeError('Expected "boolean" but received "' + typeof obj_isPrivate + '" (at "' + path_isPrivate + '")');
|
|
198
|
+
}
|
|
199
|
+
const obj_name = obj.name;
|
|
200
|
+
const path_name = path + '.name';
|
|
201
|
+
let obj_name_union0 = null;
|
|
202
|
+
const obj_name_union0_error = (() => {
|
|
203
|
+
if (typeof obj_name !== 'string') {
|
|
204
|
+
return new TypeError('Expected "string" but received "' + typeof obj_name + '" (at "' + path_name + '")');
|
|
205
|
+
}
|
|
206
|
+
})();
|
|
207
|
+
if (obj_name_union0_error != null) {
|
|
208
|
+
obj_name_union0 = obj_name_union0_error.message;
|
|
209
|
+
}
|
|
210
|
+
let obj_name_union1 = null;
|
|
211
|
+
const obj_name_union1_error = (() => {
|
|
212
|
+
if (obj_name !== null) {
|
|
213
|
+
return new TypeError('Expected "null" but received "' + typeof obj_name + '" (at "' + path_name + '")');
|
|
214
|
+
}
|
|
215
|
+
})();
|
|
216
|
+
if (obj_name_union1_error != null) {
|
|
217
|
+
obj_name_union1 = obj_name_union1_error.message;
|
|
218
|
+
}
|
|
219
|
+
if (obj_name_union0 && obj_name_union1) {
|
|
220
|
+
let message = 'Object doesn\'t match union (at "' + path_name + '")';
|
|
221
|
+
message += '\n' + obj_name_union0.split('\n').map((line) => '\t' + line).join('\n');
|
|
222
|
+
message += '\n' + obj_name_union1.split('\n').map((line) => '\t' + line).join('\n');
|
|
223
|
+
return new TypeError(message);
|
|
224
|
+
}
|
|
225
|
+
const obj_startDate = obj.startDate;
|
|
226
|
+
const path_startDate = path + '.startDate';
|
|
227
|
+
let obj_startDate_union0 = null;
|
|
228
|
+
const obj_startDate_union0_error = (() => {
|
|
229
|
+
if (typeof obj_startDate !== 'string') {
|
|
230
|
+
return new TypeError('Expected "string" but received "' + typeof obj_startDate + '" (at "' + path_startDate + '")');
|
|
231
|
+
}
|
|
232
|
+
})();
|
|
233
|
+
if (obj_startDate_union0_error != null) {
|
|
234
|
+
obj_startDate_union0 = obj_startDate_union0_error.message;
|
|
235
|
+
}
|
|
236
|
+
let obj_startDate_union1 = null;
|
|
237
|
+
const obj_startDate_union1_error = (() => {
|
|
238
|
+
if (obj_startDate !== null) {
|
|
239
|
+
return new TypeError('Expected "null" but received "' + typeof obj_startDate + '" (at "' + path_startDate + '")');
|
|
240
|
+
}
|
|
241
|
+
})();
|
|
242
|
+
if (obj_startDate_union1_error != null) {
|
|
243
|
+
obj_startDate_union1 = obj_startDate_union1_error.message;
|
|
244
|
+
}
|
|
245
|
+
if (obj_startDate_union0 && obj_startDate_union1) {
|
|
246
|
+
let message = 'Object doesn\'t match union (at "' + path_startDate + '")';
|
|
247
|
+
message += '\n' + obj_startDate_union0.split('\n').map((line) => '\t' + line).join('\n');
|
|
248
|
+
message += '\n' + obj_startDate_union1.split('\n').map((line) => '\t' + line).join('\n');
|
|
249
|
+
return new TypeError(message);
|
|
250
|
+
}
|
|
251
|
+
const obj_users = obj.users;
|
|
252
|
+
const path_users = path + '.users';
|
|
253
|
+
if (!ArrayIsArray(obj_users)) {
|
|
254
|
+
return new TypeError('Expected "array" but received "' + typeof obj_users + '" (at "' + path_users + '")');
|
|
255
|
+
}
|
|
256
|
+
for (let i = 0; i < obj_users.length; i++) {
|
|
257
|
+
const obj_users_item = obj_users[i];
|
|
258
|
+
const path_users_item = path_users + '[' + i + ']';
|
|
259
|
+
const referencepath_users_itemValidationError = validate$7(obj_users_item, path_users_item);
|
|
260
|
+
if (referencepath_users_itemValidationError !== null) {
|
|
261
|
+
let message = 'Object doesn\'t match UserRepresentation (at "' + path_users_item + '")\n';
|
|
262
|
+
message += referencepath_users_itemValidationError.message.split('\n').map((line) => '\t' + line).join('\n');
|
|
263
|
+
return new TypeError(message);
|
|
264
|
+
}
|
|
265
|
+
}
|
|
266
|
+
})();
|
|
267
|
+
return v_error === undefined ? null : v_error;
|
|
268
|
+
}
|
|
269
|
+
|
|
270
|
+
function validate$5(obj, path = 'ContactInteractionsRepresentation') {
|
|
271
|
+
const v_error = (() => {
|
|
272
|
+
if (typeof obj !== 'object' || ArrayIsArray(obj) || obj === null) {
|
|
273
|
+
return new TypeError('Expected "object" but received "' + typeof obj + '" (at "' + path + '")');
|
|
274
|
+
}
|
|
275
|
+
const obj_contactId = obj.contactId;
|
|
276
|
+
const path_contactId = path + '.contactId';
|
|
277
|
+
if (typeof obj_contactId !== 'string') {
|
|
278
|
+
return new TypeError('Expected "string" but received "' + typeof obj_contactId + '" (at "' + path_contactId + '")');
|
|
279
|
+
}
|
|
280
|
+
const obj_interactions = obj.interactions;
|
|
281
|
+
const path_interactions = path + '.interactions';
|
|
282
|
+
if (!ArrayIsArray(obj_interactions)) {
|
|
283
|
+
return new TypeError('Expected "array" but received "' + typeof obj_interactions + '" (at "' + path_interactions + '")');
|
|
284
|
+
}
|
|
285
|
+
for (let i = 0; i < obj_interactions.length; i++) {
|
|
286
|
+
const obj_interactions_item = obj_interactions[i];
|
|
287
|
+
const path_interactions_item = path_interactions + '[' + i + ']';
|
|
288
|
+
const referencepath_interactions_itemValidationError = validate$6(obj_interactions_item, path_interactions_item);
|
|
289
|
+
if (referencepath_interactions_itemValidationError !== null) {
|
|
290
|
+
let message = 'Object doesn\'t match InteractionRepresentation (at "' + path_interactions_item + '")\n';
|
|
291
|
+
message += referencepath_interactions_itemValidationError.message.split('\n').map((line) => '\t' + line).join('\n');
|
|
292
|
+
return new TypeError(message);
|
|
293
|
+
}
|
|
294
|
+
}
|
|
295
|
+
const obj_name = obj.name;
|
|
296
|
+
const path_name = path + '.name';
|
|
297
|
+
let obj_name_union0 = null;
|
|
298
|
+
const obj_name_union0_error = (() => {
|
|
299
|
+
if (typeof obj_name !== 'string') {
|
|
300
|
+
return new TypeError('Expected "string" but received "' + typeof obj_name + '" (at "' + path_name + '")');
|
|
301
|
+
}
|
|
302
|
+
})();
|
|
303
|
+
if (obj_name_union0_error != null) {
|
|
304
|
+
obj_name_union0 = obj_name_union0_error.message;
|
|
305
|
+
}
|
|
306
|
+
let obj_name_union1 = null;
|
|
307
|
+
const obj_name_union1_error = (() => {
|
|
308
|
+
if (obj_name !== null) {
|
|
309
|
+
return new TypeError('Expected "null" but received "' + typeof obj_name + '" (at "' + path_name + '")');
|
|
310
|
+
}
|
|
311
|
+
})();
|
|
312
|
+
if (obj_name_union1_error != null) {
|
|
313
|
+
obj_name_union1 = obj_name_union1_error.message;
|
|
314
|
+
}
|
|
315
|
+
if (obj_name_union0 && obj_name_union1) {
|
|
316
|
+
let message = 'Object doesn\'t match union (at "' + path_name + '")';
|
|
317
|
+
message += '\n' + obj_name_union0.split('\n').map((line) => '\t' + line).join('\n');
|
|
318
|
+
message += '\n' + obj_name_union1.split('\n').map((line) => '\t' + line).join('\n');
|
|
319
|
+
return new TypeError(message);
|
|
320
|
+
}
|
|
321
|
+
const obj_title = obj.title;
|
|
322
|
+
const path_title = path + '.title';
|
|
323
|
+
let obj_title_union0 = null;
|
|
324
|
+
const obj_title_union0_error = (() => {
|
|
325
|
+
if (typeof obj_title !== 'string') {
|
|
326
|
+
return new TypeError('Expected "string" but received "' + typeof obj_title + '" (at "' + path_title + '")');
|
|
327
|
+
}
|
|
328
|
+
})();
|
|
329
|
+
if (obj_title_union0_error != null) {
|
|
330
|
+
obj_title_union0 = obj_title_union0_error.message;
|
|
331
|
+
}
|
|
332
|
+
let obj_title_union1 = null;
|
|
333
|
+
const obj_title_union1_error = (() => {
|
|
334
|
+
if (obj_title !== null) {
|
|
335
|
+
return new TypeError('Expected "null" but received "' + typeof obj_title + '" (at "' + path_title + '")');
|
|
336
|
+
}
|
|
337
|
+
})();
|
|
338
|
+
if (obj_title_union1_error != null) {
|
|
339
|
+
obj_title_union1 = obj_title_union1_error.message;
|
|
340
|
+
}
|
|
341
|
+
if (obj_title_union0 && obj_title_union1) {
|
|
342
|
+
let message = 'Object doesn\'t match union (at "' + path_title + '")';
|
|
343
|
+
message += '\n' + obj_title_union0.split('\n').map((line) => '\t' + line).join('\n');
|
|
344
|
+
message += '\n' + obj_title_union1.split('\n').map((line) => '\t' + line).join('\n');
|
|
345
|
+
return new TypeError(message);
|
|
346
|
+
}
|
|
347
|
+
})();
|
|
348
|
+
return v_error === undefined ? null : v_error;
|
|
349
|
+
}
|
|
350
|
+
|
|
351
|
+
const TTL$2 = 60000;
|
|
352
|
+
const VERSION$2 = "84ad09d24737a1d099958eeb5c3ebc1d";
|
|
353
|
+
function validate$4(obj, path = 'ContactInteractionsListRepresentation') {
|
|
354
|
+
const v_error = (() => {
|
|
355
|
+
if (typeof obj !== 'object' || ArrayIsArray(obj) || obj === null) {
|
|
356
|
+
return new TypeError('Expected "object" but received "' + typeof obj + '" (at "' + path + '")');
|
|
357
|
+
}
|
|
358
|
+
const obj_data = obj.data;
|
|
359
|
+
const path_data = path + '.data';
|
|
360
|
+
if (!ArrayIsArray(obj_data)) {
|
|
361
|
+
return new TypeError('Expected "array" but received "' + typeof obj_data + '" (at "' + path_data + '")');
|
|
362
|
+
}
|
|
363
|
+
for (let i = 0; i < obj_data.length; i++) {
|
|
364
|
+
const obj_data_item = obj_data[i];
|
|
365
|
+
const path_data_item = path_data + '[' + i + ']';
|
|
366
|
+
const referencepath_data_itemValidationError = validate$5(obj_data_item, path_data_item);
|
|
367
|
+
if (referencepath_data_itemValidationError !== null) {
|
|
368
|
+
let message = 'Object doesn\'t match ContactInteractionsRepresentation (at "' + path_data_item + '")\n';
|
|
369
|
+
message += referencepath_data_itemValidationError.message.split('\n').map((line) => '\t' + line).join('\n');
|
|
370
|
+
return new TypeError(message);
|
|
371
|
+
}
|
|
372
|
+
}
|
|
373
|
+
})();
|
|
374
|
+
return v_error === undefined ? null : v_error;
|
|
375
|
+
}
|
|
376
|
+
const RepresentationType$2 = 'ContactInteractionsListRepresentation';
|
|
377
|
+
function normalize$2(input, existing, path, luvio, store, timestamp) {
|
|
378
|
+
return input;
|
|
379
|
+
}
|
|
380
|
+
const select$5 = function ContactInteractionsListRepresentationSelect() {
|
|
381
|
+
return {
|
|
382
|
+
kind: 'Fragment',
|
|
383
|
+
version: VERSION$2,
|
|
384
|
+
private: [],
|
|
385
|
+
opaque: true
|
|
386
|
+
};
|
|
387
|
+
};
|
|
388
|
+
function equals$2(existing, incoming) {
|
|
389
|
+
if (JSONStringify(incoming) !== JSONStringify(existing)) {
|
|
390
|
+
return false;
|
|
391
|
+
}
|
|
392
|
+
return true;
|
|
393
|
+
}
|
|
394
|
+
const ingest$2 = function ContactInteractionsListRepresentationIngest(input, path, luvio, store, timestamp) {
|
|
395
|
+
if (process.env.NODE_ENV !== 'production') {
|
|
396
|
+
const validateError = validate$4(input);
|
|
397
|
+
if (validateError !== null) {
|
|
398
|
+
throw validateError;
|
|
399
|
+
}
|
|
400
|
+
}
|
|
401
|
+
const key = path.fullPath;
|
|
402
|
+
const ttlToUse = TTL$2;
|
|
403
|
+
ingestShape(input, path, luvio, store, timestamp, ttlToUse, key, normalize$2, "cib", VERSION$2, RepresentationType$2, equals$2);
|
|
404
|
+
return createLink(key);
|
|
405
|
+
};
|
|
406
|
+
function getTypeCacheKeys$2(rootKeySet, luvio, input, fullPathFactory) {
|
|
407
|
+
// root cache key (uses fullPathFactory if keyBuilderFromType isn't defined)
|
|
408
|
+
const rootKey = fullPathFactory();
|
|
409
|
+
rootKeySet.set(rootKey, {
|
|
410
|
+
namespace: keyPrefix,
|
|
411
|
+
representationName: RepresentationType$2,
|
|
412
|
+
mergeable: false
|
|
413
|
+
});
|
|
414
|
+
}
|
|
415
|
+
|
|
416
|
+
function select$4(luvio, params) {
|
|
417
|
+
return select$5();
|
|
418
|
+
}
|
|
419
|
+
function keyBuilder$5(luvio, params) {
|
|
420
|
+
return keyPrefix + '::ContactInteractionsListRepresentation:(' + 'contactIds:' + params.queryParams.contactIds + ',' + 'relatedRecordId:' + params.queryParams.relatedRecordId + ',' + 'systemContext:' + params.queryParams.systemContext + ')';
|
|
421
|
+
}
|
|
422
|
+
function getResponseCacheKeys$2(storeKeyMap, luvio, resourceParams, response) {
|
|
423
|
+
getTypeCacheKeys$2(storeKeyMap, luvio, response, () => keyBuilder$5(luvio, resourceParams));
|
|
424
|
+
}
|
|
425
|
+
function ingestSuccess$2(luvio, resourceParams, response, snapshotRefresh) {
|
|
426
|
+
const { body } = response;
|
|
427
|
+
const key = keyBuilder$5(luvio, resourceParams);
|
|
428
|
+
luvio.storeIngest(key, ingest$2, body);
|
|
429
|
+
const snapshot = luvio.storeLookup({
|
|
430
|
+
recordId: key,
|
|
431
|
+
node: select$4(),
|
|
432
|
+
variables: {},
|
|
433
|
+
}, snapshotRefresh);
|
|
434
|
+
if (process.env.NODE_ENV !== 'production') {
|
|
435
|
+
if (snapshot.state !== 'Fulfilled') {
|
|
436
|
+
throw new Error('Invalid network response. Expected resource response to result in Fulfilled snapshot');
|
|
437
|
+
}
|
|
438
|
+
}
|
|
439
|
+
deepFreeze(snapshot.data);
|
|
440
|
+
return snapshot;
|
|
441
|
+
}
|
|
442
|
+
function ingestError$2(luvio, params, error, snapshotRefresh) {
|
|
443
|
+
const key = keyBuilder$5(luvio, params);
|
|
444
|
+
const errorSnapshot = luvio.errorSnapshot(error, snapshotRefresh);
|
|
445
|
+
const storeMetadataParams = {
|
|
446
|
+
ttl: TTL$2,
|
|
447
|
+
namespace: keyPrefix,
|
|
448
|
+
version: VERSION$2,
|
|
449
|
+
representationName: RepresentationType$2
|
|
450
|
+
};
|
|
451
|
+
luvio.storeIngestError(key, errorSnapshot, storeMetadataParams);
|
|
452
|
+
return errorSnapshot;
|
|
453
|
+
}
|
|
454
|
+
function createResourceRequest$2(config) {
|
|
455
|
+
const headers = {};
|
|
456
|
+
return {
|
|
457
|
+
baseUri: '/services/data/v66.0',
|
|
458
|
+
basePath: '/connect/financialservices/contacts-interactions',
|
|
459
|
+
method: 'get',
|
|
460
|
+
body: null,
|
|
461
|
+
urlParams: {},
|
|
462
|
+
queryParams: config.queryParams,
|
|
463
|
+
headers,
|
|
464
|
+
priority: 'normal',
|
|
465
|
+
};
|
|
466
|
+
}
|
|
467
|
+
|
|
468
|
+
const adapterName$2 = 'getContactsInteractions';
|
|
469
|
+
const getContactsInteractions_ConfigPropertyMetadata = [
|
|
470
|
+
generateParamConfigMetadata('contactIds', false, 1 /* QueryParameter */, 0 /* String */, true),
|
|
471
|
+
generateParamConfigMetadata('relatedRecordId', false, 1 /* QueryParameter */, 0 /* String */),
|
|
472
|
+
generateParamConfigMetadata('systemContext', false, 1 /* QueryParameter */, 1 /* Boolean */),
|
|
473
|
+
];
|
|
474
|
+
const getContactsInteractions_ConfigPropertyNames = /*#__PURE__*/ buildAdapterValidationConfig(adapterName$2, getContactsInteractions_ConfigPropertyMetadata);
|
|
475
|
+
const createResourceParams$2 = /*#__PURE__*/ createResourceParams$3(getContactsInteractions_ConfigPropertyMetadata);
|
|
476
|
+
function keyBuilder$4(luvio, config) {
|
|
477
|
+
const resourceParams = createResourceParams$2(config);
|
|
478
|
+
return keyBuilder$5(luvio, resourceParams);
|
|
479
|
+
}
|
|
480
|
+
function typeCheckConfig$2(untrustedConfig) {
|
|
481
|
+
const config = {};
|
|
482
|
+
typeCheckConfig$3(untrustedConfig, config, getContactsInteractions_ConfigPropertyMetadata);
|
|
483
|
+
return config;
|
|
484
|
+
}
|
|
485
|
+
function validateAdapterConfig$2(untrustedConfig, configPropertyNames) {
|
|
486
|
+
if (!untrustedIsObject(untrustedConfig)) {
|
|
487
|
+
return null;
|
|
488
|
+
}
|
|
489
|
+
if (process.env.NODE_ENV !== 'production') {
|
|
490
|
+
validateConfig(untrustedConfig, configPropertyNames);
|
|
491
|
+
}
|
|
492
|
+
const config = typeCheckConfig$2(untrustedConfig);
|
|
493
|
+
if (!areRequiredParametersPresent(config, configPropertyNames)) {
|
|
494
|
+
return null;
|
|
495
|
+
}
|
|
496
|
+
return config;
|
|
497
|
+
}
|
|
498
|
+
function adapterFragment$2(luvio, config) {
|
|
499
|
+
createResourceParams$2(config);
|
|
500
|
+
return select$4();
|
|
501
|
+
}
|
|
502
|
+
function onFetchResponseSuccess$2(luvio, config, resourceParams, response) {
|
|
503
|
+
const snapshot = ingestSuccess$2(luvio, resourceParams, response, {
|
|
504
|
+
config,
|
|
505
|
+
resolve: () => buildNetworkSnapshot$2(luvio, config, snapshotRefreshOptions)
|
|
506
|
+
});
|
|
507
|
+
return luvio.storeBroadcast().then(() => snapshot);
|
|
508
|
+
}
|
|
509
|
+
function onFetchResponseError$2(luvio, config, resourceParams, response) {
|
|
510
|
+
const snapshot = ingestError$2(luvio, resourceParams, response, {
|
|
511
|
+
config,
|
|
512
|
+
resolve: () => buildNetworkSnapshot$2(luvio, config, snapshotRefreshOptions)
|
|
513
|
+
});
|
|
514
|
+
return luvio.storeBroadcast().then(() => snapshot);
|
|
515
|
+
}
|
|
516
|
+
function buildNetworkSnapshot$2(luvio, config, options) {
|
|
517
|
+
const resourceParams = createResourceParams$2(config);
|
|
518
|
+
const request = createResourceRequest$2(resourceParams);
|
|
519
|
+
return luvio.dispatchResourceRequest(request, options)
|
|
520
|
+
.then((response) => {
|
|
521
|
+
return luvio.handleSuccessResponse(() => onFetchResponseSuccess$2(luvio, config, resourceParams, response), () => {
|
|
522
|
+
const cache = new StoreKeyMap();
|
|
523
|
+
getResponseCacheKeys$2(cache, luvio, resourceParams, response.body);
|
|
524
|
+
return cache;
|
|
525
|
+
});
|
|
526
|
+
}, (response) => {
|
|
527
|
+
return luvio.handleErrorResponse(() => onFetchResponseError$2(luvio, config, resourceParams, response));
|
|
528
|
+
});
|
|
529
|
+
}
|
|
530
|
+
function buildNetworkSnapshotCachePolicy$2(context, coercedAdapterRequestContext) {
|
|
531
|
+
return buildNetworkSnapshotCachePolicy$3(context, coercedAdapterRequestContext, buildNetworkSnapshot$2, undefined, false);
|
|
532
|
+
}
|
|
533
|
+
function buildCachedSnapshotCachePolicy$2(context, storeLookup) {
|
|
534
|
+
const { luvio, config } = context;
|
|
535
|
+
const selector = {
|
|
536
|
+
recordId: keyBuilder$4(luvio, config),
|
|
537
|
+
node: adapterFragment$2(luvio, config),
|
|
538
|
+
variables: {},
|
|
539
|
+
};
|
|
540
|
+
const cacheSnapshot = storeLookup(selector, {
|
|
541
|
+
config,
|
|
542
|
+
resolve: () => buildNetworkSnapshot$2(luvio, config, snapshotRefreshOptions)
|
|
543
|
+
});
|
|
544
|
+
return cacheSnapshot;
|
|
545
|
+
}
|
|
546
|
+
const getContactsInteractionsAdapterFactory = (luvio) => function cib__getContactsInteractions(untrustedConfig, requestContext) {
|
|
547
|
+
const config = validateAdapterConfig$2(untrustedConfig, getContactsInteractions_ConfigPropertyNames);
|
|
548
|
+
// Invalid or incomplete config
|
|
549
|
+
if (config === null) {
|
|
550
|
+
return null;
|
|
551
|
+
}
|
|
552
|
+
return luvio.applyCachePolicy((requestContext || {}), { config, luvio }, // BuildSnapshotContext
|
|
553
|
+
buildCachedSnapshotCachePolicy$2, buildNetworkSnapshotCachePolicy$2);
|
|
554
|
+
};
|
|
555
|
+
|
|
556
|
+
function validate$3(obj, path = 'CompanyDealPartyRepresentation') {
|
|
557
|
+
const v_error = (() => {
|
|
558
|
+
if (typeof obj !== 'object' || ArrayIsArray(obj) || obj === null) {
|
|
559
|
+
return new TypeError('Expected "object" but received "' + typeof obj + '" (at "' + path + '")');
|
|
560
|
+
}
|
|
561
|
+
const obj_contactIds = obj.contactIds;
|
|
562
|
+
const path_contactIds = path + '.contactIds';
|
|
563
|
+
if (!ArrayIsArray(obj_contactIds)) {
|
|
564
|
+
return new TypeError('Expected "array" but received "' + typeof obj_contactIds + '" (at "' + path_contactIds + '")');
|
|
565
|
+
}
|
|
566
|
+
for (let i = 0; i < obj_contactIds.length; i++) {
|
|
567
|
+
const obj_contactIds_item = obj_contactIds[i];
|
|
568
|
+
const path_contactIds_item = path_contactIds + '[' + i + ']';
|
|
569
|
+
if (typeof obj_contactIds_item !== 'string') {
|
|
570
|
+
return new TypeError('Expected "string" but received "' + typeof obj_contactIds_item + '" (at "' + path_contactIds_item + '")');
|
|
571
|
+
}
|
|
572
|
+
}
|
|
573
|
+
const obj_name = obj.name;
|
|
574
|
+
const path_name = path + '.name';
|
|
575
|
+
if (typeof obj_name !== 'string') {
|
|
576
|
+
return new TypeError('Expected "string" but received "' + typeof obj_name + '" (at "' + path_name + '")');
|
|
577
|
+
}
|
|
578
|
+
const obj_partyId = obj.partyId;
|
|
579
|
+
const path_partyId = path + '.partyId';
|
|
580
|
+
if (typeof obj_partyId !== 'string') {
|
|
581
|
+
return new TypeError('Expected "string" but received "' + typeof obj_partyId + '" (at "' + path_partyId + '")');
|
|
582
|
+
}
|
|
583
|
+
const obj_partyRoles = obj.partyRoles;
|
|
584
|
+
const path_partyRoles = path + '.partyRoles';
|
|
585
|
+
if (!ArrayIsArray(obj_partyRoles)) {
|
|
586
|
+
return new TypeError('Expected "array" but received "' + typeof obj_partyRoles + '" (at "' + path_partyRoles + '")');
|
|
587
|
+
}
|
|
588
|
+
for (let i = 0; i < obj_partyRoles.length; i++) {
|
|
589
|
+
const obj_partyRoles_item = obj_partyRoles[i];
|
|
590
|
+
const path_partyRoles_item = path_partyRoles + '[' + i + ']';
|
|
591
|
+
if (typeof obj_partyRoles_item !== 'string') {
|
|
592
|
+
return new TypeError('Expected "string" but received "' + typeof obj_partyRoles_item + '" (at "' + path_partyRoles_item + '")');
|
|
593
|
+
}
|
|
594
|
+
}
|
|
595
|
+
})();
|
|
596
|
+
return v_error === undefined ? null : v_error;
|
|
597
|
+
}
|
|
598
|
+
|
|
599
|
+
const TTL$1 = 60000;
|
|
600
|
+
const VERSION$1 = "486ac4c33dd5ef737f23a417fce9ab94";
|
|
601
|
+
function validate$2(obj, path = 'CompanyDealPartyListRepresentation') {
|
|
602
|
+
const v_error = (() => {
|
|
603
|
+
if (typeof obj !== 'object' || ArrayIsArray(obj) || obj === null) {
|
|
604
|
+
return new TypeError('Expected "object" but received "' + typeof obj + '" (at "' + path + '")');
|
|
605
|
+
}
|
|
606
|
+
const obj_data = obj.data;
|
|
607
|
+
const path_data = path + '.data';
|
|
608
|
+
if (!ArrayIsArray(obj_data)) {
|
|
609
|
+
return new TypeError('Expected "array" but received "' + typeof obj_data + '" (at "' + path_data + '")');
|
|
610
|
+
}
|
|
611
|
+
for (let i = 0; i < obj_data.length; i++) {
|
|
612
|
+
const obj_data_item = obj_data[i];
|
|
613
|
+
const path_data_item = path_data + '[' + i + ']';
|
|
614
|
+
const referencepath_data_itemValidationError = validate$3(obj_data_item, path_data_item);
|
|
615
|
+
if (referencepath_data_itemValidationError !== null) {
|
|
616
|
+
let message = 'Object doesn\'t match CompanyDealPartyRepresentation (at "' + path_data_item + '")\n';
|
|
617
|
+
message += referencepath_data_itemValidationError.message.split('\n').map((line) => '\t' + line).join('\n');
|
|
618
|
+
return new TypeError(message);
|
|
619
|
+
}
|
|
620
|
+
}
|
|
621
|
+
})();
|
|
622
|
+
return v_error === undefined ? null : v_error;
|
|
623
|
+
}
|
|
624
|
+
const RepresentationType$1 = 'CompanyDealPartyListRepresentation';
|
|
625
|
+
function normalize$1(input, existing, path, luvio, store, timestamp) {
|
|
626
|
+
return input;
|
|
627
|
+
}
|
|
628
|
+
const select$3 = function CompanyDealPartyListRepresentationSelect() {
|
|
629
|
+
return {
|
|
630
|
+
kind: 'Fragment',
|
|
631
|
+
version: VERSION$1,
|
|
632
|
+
private: [],
|
|
633
|
+
opaque: true
|
|
634
|
+
};
|
|
635
|
+
};
|
|
636
|
+
function equals$1(existing, incoming) {
|
|
637
|
+
if (JSONStringify(incoming) !== JSONStringify(existing)) {
|
|
638
|
+
return false;
|
|
639
|
+
}
|
|
640
|
+
return true;
|
|
641
|
+
}
|
|
642
|
+
const ingest$1 = function CompanyDealPartyListRepresentationIngest(input, path, luvio, store, timestamp) {
|
|
643
|
+
if (process.env.NODE_ENV !== 'production') {
|
|
644
|
+
const validateError = validate$2(input);
|
|
645
|
+
if (validateError !== null) {
|
|
646
|
+
throw validateError;
|
|
647
|
+
}
|
|
648
|
+
}
|
|
649
|
+
const key = path.fullPath;
|
|
650
|
+
const ttlToUse = TTL$1;
|
|
651
|
+
ingestShape(input, path, luvio, store, timestamp, ttlToUse, key, normalize$1, "cib", VERSION$1, RepresentationType$1, equals$1);
|
|
652
|
+
return createLink(key);
|
|
653
|
+
};
|
|
654
|
+
function getTypeCacheKeys$1(rootKeySet, luvio, input, fullPathFactory) {
|
|
655
|
+
// root cache key (uses fullPathFactory if keyBuilderFromType isn't defined)
|
|
656
|
+
const rootKey = fullPathFactory();
|
|
657
|
+
rootKeySet.set(rootKey, {
|
|
658
|
+
namespace: keyPrefix,
|
|
659
|
+
representationName: RepresentationType$1,
|
|
660
|
+
mergeable: false
|
|
661
|
+
});
|
|
662
|
+
}
|
|
663
|
+
|
|
664
|
+
function select$2(luvio, params) {
|
|
665
|
+
return select$3();
|
|
666
|
+
}
|
|
667
|
+
function keyBuilder$3(luvio, params) {
|
|
668
|
+
return keyPrefix + '::CompanyDealPartyListRepresentation:(' + 'partyRoles:' + params.queryParams.partyRoles + ',' + 'financialDealId:' + params.urlParams.financialDealId + ')';
|
|
669
|
+
}
|
|
670
|
+
function getResponseCacheKeys$1(storeKeyMap, luvio, resourceParams, response) {
|
|
671
|
+
getTypeCacheKeys$1(storeKeyMap, luvio, response, () => keyBuilder$3(luvio, resourceParams));
|
|
672
|
+
}
|
|
673
|
+
function ingestSuccess$1(luvio, resourceParams, response, snapshotRefresh) {
|
|
674
|
+
const { body } = response;
|
|
675
|
+
const key = keyBuilder$3(luvio, resourceParams);
|
|
676
|
+
luvio.storeIngest(key, ingest$1, body);
|
|
677
|
+
const snapshot = luvio.storeLookup({
|
|
678
|
+
recordId: key,
|
|
679
|
+
node: select$2(),
|
|
680
|
+
variables: {},
|
|
681
|
+
}, snapshotRefresh);
|
|
682
|
+
if (process.env.NODE_ENV !== 'production') {
|
|
683
|
+
if (snapshot.state !== 'Fulfilled') {
|
|
684
|
+
throw new Error('Invalid network response. Expected resource response to result in Fulfilled snapshot');
|
|
685
|
+
}
|
|
686
|
+
}
|
|
687
|
+
deepFreeze(snapshot.data);
|
|
688
|
+
return snapshot;
|
|
689
|
+
}
|
|
690
|
+
function ingestError$1(luvio, params, error, snapshotRefresh) {
|
|
691
|
+
const key = keyBuilder$3(luvio, params);
|
|
692
|
+
const errorSnapshot = luvio.errorSnapshot(error, snapshotRefresh);
|
|
693
|
+
const storeMetadataParams = {
|
|
694
|
+
ttl: TTL$1,
|
|
695
|
+
namespace: keyPrefix,
|
|
696
|
+
version: VERSION$1,
|
|
697
|
+
representationName: RepresentationType$1
|
|
698
|
+
};
|
|
699
|
+
luvio.storeIngestError(key, errorSnapshot, storeMetadataParams);
|
|
700
|
+
return errorSnapshot;
|
|
701
|
+
}
|
|
702
|
+
function createResourceRequest$1(config) {
|
|
703
|
+
const headers = {};
|
|
704
|
+
return {
|
|
705
|
+
baseUri: '/services/data/v66.0',
|
|
706
|
+
basePath: '/connect/financialservices/deal-parties/' + config.urlParams.financialDealId + '',
|
|
707
|
+
method: 'get',
|
|
708
|
+
body: null,
|
|
709
|
+
urlParams: config.urlParams,
|
|
710
|
+
queryParams: config.queryParams,
|
|
711
|
+
headers,
|
|
712
|
+
priority: 'normal',
|
|
713
|
+
};
|
|
714
|
+
}
|
|
715
|
+
|
|
716
|
+
const adapterName$1 = 'getDealParties';
|
|
717
|
+
const getDealParties_ConfigPropertyMetadata = [
|
|
718
|
+
generateParamConfigMetadata('financialDealId', true, 0 /* UrlParameter */, 0 /* String */),
|
|
719
|
+
generateParamConfigMetadata('partyRoles', false, 1 /* QueryParameter */, 0 /* String */, true),
|
|
720
|
+
];
|
|
721
|
+
const getDealParties_ConfigPropertyNames = /*#__PURE__*/ buildAdapterValidationConfig(adapterName$1, getDealParties_ConfigPropertyMetadata);
|
|
722
|
+
const createResourceParams$1 = /*#__PURE__*/ createResourceParams$3(getDealParties_ConfigPropertyMetadata);
|
|
723
|
+
function keyBuilder$2(luvio, config) {
|
|
724
|
+
const resourceParams = createResourceParams$1(config);
|
|
725
|
+
return keyBuilder$3(luvio, resourceParams);
|
|
726
|
+
}
|
|
727
|
+
function typeCheckConfig$1(untrustedConfig) {
|
|
728
|
+
const config = {};
|
|
729
|
+
typeCheckConfig$3(untrustedConfig, config, getDealParties_ConfigPropertyMetadata);
|
|
730
|
+
return config;
|
|
731
|
+
}
|
|
732
|
+
function validateAdapterConfig$1(untrustedConfig, configPropertyNames) {
|
|
733
|
+
if (!untrustedIsObject(untrustedConfig)) {
|
|
734
|
+
return null;
|
|
735
|
+
}
|
|
736
|
+
if (process.env.NODE_ENV !== 'production') {
|
|
737
|
+
validateConfig(untrustedConfig, configPropertyNames);
|
|
738
|
+
}
|
|
739
|
+
const config = typeCheckConfig$1(untrustedConfig);
|
|
740
|
+
if (!areRequiredParametersPresent(config, configPropertyNames)) {
|
|
741
|
+
return null;
|
|
742
|
+
}
|
|
743
|
+
return config;
|
|
744
|
+
}
|
|
745
|
+
function adapterFragment$1(luvio, config) {
|
|
746
|
+
createResourceParams$1(config);
|
|
747
|
+
return select$2();
|
|
748
|
+
}
|
|
749
|
+
function onFetchResponseSuccess$1(luvio, config, resourceParams, response) {
|
|
750
|
+
const snapshot = ingestSuccess$1(luvio, resourceParams, response, {
|
|
751
|
+
config,
|
|
752
|
+
resolve: () => buildNetworkSnapshot$1(luvio, config, snapshotRefreshOptions)
|
|
753
|
+
});
|
|
754
|
+
return luvio.storeBroadcast().then(() => snapshot);
|
|
755
|
+
}
|
|
756
|
+
function onFetchResponseError$1(luvio, config, resourceParams, response) {
|
|
757
|
+
const snapshot = ingestError$1(luvio, resourceParams, response, {
|
|
758
|
+
config,
|
|
759
|
+
resolve: () => buildNetworkSnapshot$1(luvio, config, snapshotRefreshOptions)
|
|
760
|
+
});
|
|
761
|
+
return luvio.storeBroadcast().then(() => snapshot);
|
|
762
|
+
}
|
|
763
|
+
function buildNetworkSnapshot$1(luvio, config, options) {
|
|
764
|
+
const resourceParams = createResourceParams$1(config);
|
|
765
|
+
const request = createResourceRequest$1(resourceParams);
|
|
766
|
+
return luvio.dispatchResourceRequest(request, options)
|
|
767
|
+
.then((response) => {
|
|
768
|
+
return luvio.handleSuccessResponse(() => onFetchResponseSuccess$1(luvio, config, resourceParams, response), () => {
|
|
769
|
+
const cache = new StoreKeyMap();
|
|
770
|
+
getResponseCacheKeys$1(cache, luvio, resourceParams, response.body);
|
|
771
|
+
return cache;
|
|
772
|
+
});
|
|
773
|
+
}, (response) => {
|
|
774
|
+
return luvio.handleErrorResponse(() => onFetchResponseError$1(luvio, config, resourceParams, response));
|
|
775
|
+
});
|
|
776
|
+
}
|
|
777
|
+
function buildNetworkSnapshotCachePolicy$1(context, coercedAdapterRequestContext) {
|
|
778
|
+
return buildNetworkSnapshotCachePolicy$3(context, coercedAdapterRequestContext, buildNetworkSnapshot$1, undefined, false);
|
|
779
|
+
}
|
|
780
|
+
function buildCachedSnapshotCachePolicy$1(context, storeLookup) {
|
|
781
|
+
const { luvio, config } = context;
|
|
782
|
+
const selector = {
|
|
783
|
+
recordId: keyBuilder$2(luvio, config),
|
|
784
|
+
node: adapterFragment$1(luvio, config),
|
|
785
|
+
variables: {},
|
|
786
|
+
};
|
|
787
|
+
const cacheSnapshot = storeLookup(selector, {
|
|
788
|
+
config,
|
|
789
|
+
resolve: () => buildNetworkSnapshot$1(luvio, config, snapshotRefreshOptions)
|
|
790
|
+
});
|
|
791
|
+
return cacheSnapshot;
|
|
792
|
+
}
|
|
793
|
+
const getDealPartiesAdapterFactory = (luvio) => function cib__getDealParties(untrustedConfig, requestContext) {
|
|
794
|
+
const config = validateAdapterConfig$1(untrustedConfig, getDealParties_ConfigPropertyNames);
|
|
795
|
+
// Invalid or incomplete config
|
|
796
|
+
if (config === null) {
|
|
797
|
+
return null;
|
|
798
|
+
}
|
|
799
|
+
return luvio.applyCachePolicy((requestContext || {}), { config, luvio }, // BuildSnapshotContext
|
|
800
|
+
buildCachedSnapshotCachePolicy$1, buildNetworkSnapshotCachePolicy$1);
|
|
801
|
+
};
|
|
802
|
+
|
|
803
|
+
function validate$1(obj, path = 'ContactRepresentation') {
|
|
804
|
+
const v_error = (() => {
|
|
805
|
+
if (typeof obj !== 'object' || ArrayIsArray(obj) || obj === null) {
|
|
806
|
+
return new TypeError('Expected "object" but received "' + typeof obj + '" (at "' + path + '")');
|
|
807
|
+
}
|
|
808
|
+
const obj_id = obj.id;
|
|
809
|
+
const path_id = path + '.id';
|
|
810
|
+
if (typeof obj_id !== 'string') {
|
|
811
|
+
return new TypeError('Expected "string" but received "' + typeof obj_id + '" (at "' + path_id + '")');
|
|
812
|
+
}
|
|
813
|
+
const obj_interactionsCount = obj.interactionsCount;
|
|
814
|
+
const path_interactionsCount = path + '.interactionsCount';
|
|
815
|
+
if (typeof obj_interactionsCount !== 'number' || (typeof obj_interactionsCount === 'number' && Math.floor(obj_interactionsCount) !== obj_interactionsCount)) {
|
|
816
|
+
return new TypeError('Expected "integer" but received "' + typeof obj_interactionsCount + '" (at "' + path_interactionsCount + '")');
|
|
817
|
+
}
|
|
818
|
+
const obj_name = obj.name;
|
|
819
|
+
const path_name = path + '.name';
|
|
820
|
+
let obj_name_union0 = null;
|
|
821
|
+
const obj_name_union0_error = (() => {
|
|
822
|
+
if (typeof obj_name !== 'string') {
|
|
823
|
+
return new TypeError('Expected "string" but received "' + typeof obj_name + '" (at "' + path_name + '")');
|
|
824
|
+
}
|
|
825
|
+
})();
|
|
826
|
+
if (obj_name_union0_error != null) {
|
|
827
|
+
obj_name_union0 = obj_name_union0_error.message;
|
|
828
|
+
}
|
|
829
|
+
let obj_name_union1 = null;
|
|
830
|
+
const obj_name_union1_error = (() => {
|
|
831
|
+
if (obj_name !== null) {
|
|
832
|
+
return new TypeError('Expected "null" but received "' + typeof obj_name + '" (at "' + path_name + '")');
|
|
833
|
+
}
|
|
834
|
+
})();
|
|
835
|
+
if (obj_name_union1_error != null) {
|
|
836
|
+
obj_name_union1 = obj_name_union1_error.message;
|
|
837
|
+
}
|
|
838
|
+
if (obj_name_union0 && obj_name_union1) {
|
|
839
|
+
let message = 'Object doesn\'t match union (at "' + path_name + '")';
|
|
840
|
+
message += '\n' + obj_name_union0.split('\n').map((line) => '\t' + line).join('\n');
|
|
841
|
+
message += '\n' + obj_name_union1.split('\n').map((line) => '\t' + line).join('\n');
|
|
842
|
+
return new TypeError(message);
|
|
843
|
+
}
|
|
844
|
+
const obj_title = obj.title;
|
|
845
|
+
const path_title = path + '.title';
|
|
846
|
+
let obj_title_union0 = null;
|
|
847
|
+
const obj_title_union0_error = (() => {
|
|
848
|
+
if (typeof obj_title !== 'string') {
|
|
849
|
+
return new TypeError('Expected "string" but received "' + typeof obj_title + '" (at "' + path_title + '")');
|
|
850
|
+
}
|
|
851
|
+
})();
|
|
852
|
+
if (obj_title_union0_error != null) {
|
|
853
|
+
obj_title_union0 = obj_title_union0_error.message;
|
|
854
|
+
}
|
|
855
|
+
let obj_title_union1 = null;
|
|
856
|
+
const obj_title_union1_error = (() => {
|
|
857
|
+
if (obj_title !== null) {
|
|
858
|
+
return new TypeError('Expected "null" but received "' + typeof obj_title + '" (at "' + path_title + '")');
|
|
859
|
+
}
|
|
860
|
+
})();
|
|
861
|
+
if (obj_title_union1_error != null) {
|
|
862
|
+
obj_title_union1 = obj_title_union1_error.message;
|
|
863
|
+
}
|
|
864
|
+
if (obj_title_union0 && obj_title_union1) {
|
|
865
|
+
let message = 'Object doesn\'t match union (at "' + path_title + '")';
|
|
866
|
+
message += '\n' + obj_title_union0.split('\n').map((line) => '\t' + line).join('\n');
|
|
867
|
+
message += '\n' + obj_title_union1.split('\n').map((line) => '\t' + line).join('\n');
|
|
868
|
+
return new TypeError(message);
|
|
869
|
+
}
|
|
870
|
+
})();
|
|
871
|
+
return v_error === undefined ? null : v_error;
|
|
872
|
+
}
|
|
873
|
+
|
|
874
|
+
const TTL = 60000;
|
|
875
|
+
const VERSION = "ae005c5c1fab63939fcd5bab74c1d960";
|
|
876
|
+
function validate(obj, path = 'ContactsRepresentation') {
|
|
877
|
+
const v_error = (() => {
|
|
878
|
+
if (typeof obj !== 'object' || ArrayIsArray(obj) || obj === null) {
|
|
879
|
+
return new TypeError('Expected "object" but received "' + typeof obj + '" (at "' + path + '")');
|
|
880
|
+
}
|
|
881
|
+
const obj_contacts = obj.contacts;
|
|
882
|
+
const path_contacts = path + '.contacts';
|
|
883
|
+
if (!ArrayIsArray(obj_contacts)) {
|
|
884
|
+
return new TypeError('Expected "array" but received "' + typeof obj_contacts + '" (at "' + path_contacts + '")');
|
|
885
|
+
}
|
|
886
|
+
for (let i = 0; i < obj_contacts.length; i++) {
|
|
887
|
+
const obj_contacts_item = obj_contacts[i];
|
|
888
|
+
const path_contacts_item = path_contacts + '[' + i + ']';
|
|
889
|
+
const referencepath_contacts_itemValidationError = validate$1(obj_contacts_item, path_contacts_item);
|
|
890
|
+
if (referencepath_contacts_itemValidationError !== null) {
|
|
891
|
+
let message = 'Object doesn\'t match ContactRepresentation (at "' + path_contacts_item + '")\n';
|
|
892
|
+
message += referencepath_contacts_itemValidationError.message.split('\n').map((line) => '\t' + line).join('\n');
|
|
893
|
+
return new TypeError(message);
|
|
894
|
+
}
|
|
895
|
+
}
|
|
896
|
+
const obj_isDirectContacts = obj.isDirectContacts;
|
|
897
|
+
const path_isDirectContacts = path + '.isDirectContacts';
|
|
898
|
+
if (typeof obj_isDirectContacts !== 'boolean') {
|
|
899
|
+
return new TypeError('Expected "boolean" but received "' + typeof obj_isDirectContacts + '" (at "' + path_isDirectContacts + '")');
|
|
900
|
+
}
|
|
901
|
+
const obj_nextOffset = obj.nextOffset;
|
|
902
|
+
const path_nextOffset = path + '.nextOffset';
|
|
903
|
+
if (typeof obj_nextOffset !== 'number' || (typeof obj_nextOffset === 'number' && Math.floor(obj_nextOffset) !== obj_nextOffset)) {
|
|
904
|
+
return new TypeError('Expected "integer" but received "' + typeof obj_nextOffset + '" (at "' + path_nextOffset + '")');
|
|
905
|
+
}
|
|
906
|
+
})();
|
|
907
|
+
return v_error === undefined ? null : v_error;
|
|
908
|
+
}
|
|
909
|
+
const RepresentationType = 'ContactsRepresentation';
|
|
910
|
+
function normalize(input, existing, path, luvio, store, timestamp) {
|
|
911
|
+
return input;
|
|
912
|
+
}
|
|
913
|
+
const select$1 = function ContactsRepresentationSelect() {
|
|
914
|
+
return {
|
|
915
|
+
kind: 'Fragment',
|
|
916
|
+
version: VERSION,
|
|
917
|
+
private: [],
|
|
918
|
+
opaque: true
|
|
919
|
+
};
|
|
920
|
+
};
|
|
921
|
+
function equals(existing, incoming) {
|
|
922
|
+
if (JSONStringify(incoming) !== JSONStringify(existing)) {
|
|
923
|
+
return false;
|
|
924
|
+
}
|
|
925
|
+
return true;
|
|
926
|
+
}
|
|
927
|
+
const ingest = function ContactsRepresentationIngest(input, path, luvio, store, timestamp) {
|
|
928
|
+
if (process.env.NODE_ENV !== 'production') {
|
|
929
|
+
const validateError = validate(input);
|
|
930
|
+
if (validateError !== null) {
|
|
931
|
+
throw validateError;
|
|
932
|
+
}
|
|
933
|
+
}
|
|
934
|
+
const key = path.fullPath;
|
|
935
|
+
const ttlToUse = TTL;
|
|
936
|
+
ingestShape(input, path, luvio, store, timestamp, ttlToUse, key, normalize, "cib", VERSION, RepresentationType, equals);
|
|
937
|
+
return createLink(key);
|
|
938
|
+
};
|
|
939
|
+
function getTypeCacheKeys(rootKeySet, luvio, input, fullPathFactory) {
|
|
940
|
+
// root cache key (uses fullPathFactory if keyBuilderFromType isn't defined)
|
|
941
|
+
const rootKey = fullPathFactory();
|
|
942
|
+
rootKeySet.set(rootKey, {
|
|
943
|
+
namespace: keyPrefix,
|
|
944
|
+
representationName: RepresentationType,
|
|
945
|
+
mergeable: false
|
|
946
|
+
});
|
|
947
|
+
}
|
|
948
|
+
|
|
949
|
+
function select(luvio, params) {
|
|
950
|
+
return select$1();
|
|
951
|
+
}
|
|
952
|
+
function keyBuilder$1(luvio, params) {
|
|
953
|
+
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 + ')';
|
|
954
|
+
}
|
|
955
|
+
function getResponseCacheKeys(storeKeyMap, luvio, resourceParams, response) {
|
|
956
|
+
getTypeCacheKeys(storeKeyMap, luvio, response, () => keyBuilder$1(luvio, resourceParams));
|
|
957
|
+
}
|
|
958
|
+
function ingestSuccess(luvio, resourceParams, response, snapshotRefresh) {
|
|
959
|
+
const { body } = response;
|
|
960
|
+
const key = keyBuilder$1(luvio, resourceParams);
|
|
961
|
+
luvio.storeIngest(key, ingest, body);
|
|
962
|
+
const snapshot = luvio.storeLookup({
|
|
963
|
+
recordId: key,
|
|
964
|
+
node: select(),
|
|
965
|
+
variables: {},
|
|
966
|
+
}, snapshotRefresh);
|
|
967
|
+
if (process.env.NODE_ENV !== 'production') {
|
|
968
|
+
if (snapshot.state !== 'Fulfilled') {
|
|
969
|
+
throw new Error('Invalid network response. Expected resource response to result in Fulfilled snapshot');
|
|
970
|
+
}
|
|
971
|
+
}
|
|
972
|
+
deepFreeze(snapshot.data);
|
|
973
|
+
return snapshot;
|
|
974
|
+
}
|
|
975
|
+
function ingestError(luvio, params, error, snapshotRefresh) {
|
|
976
|
+
const key = keyBuilder$1(luvio, params);
|
|
977
|
+
const errorSnapshot = luvio.errorSnapshot(error, snapshotRefresh);
|
|
978
|
+
const storeMetadataParams = {
|
|
979
|
+
ttl: TTL,
|
|
980
|
+
namespace: keyPrefix,
|
|
981
|
+
version: VERSION,
|
|
982
|
+
representationName: RepresentationType
|
|
983
|
+
};
|
|
984
|
+
luvio.storeIngestError(key, errorSnapshot, storeMetadataParams);
|
|
985
|
+
return errorSnapshot;
|
|
986
|
+
}
|
|
987
|
+
function createResourceRequest(config) {
|
|
988
|
+
const headers = {};
|
|
989
|
+
return {
|
|
990
|
+
baseUri: '/services/data/v66.0',
|
|
991
|
+
basePath: '/connect/financialservices/interaction-insights/' + config.urlParams.accountId + '',
|
|
992
|
+
method: 'get',
|
|
993
|
+
body: null,
|
|
994
|
+
urlParams: config.urlParams,
|
|
995
|
+
queryParams: config.queryParams,
|
|
996
|
+
headers,
|
|
997
|
+
priority: 'normal',
|
|
998
|
+
};
|
|
999
|
+
}
|
|
1000
|
+
|
|
1001
|
+
const adapterName = 'getInteractionInsights';
|
|
1002
|
+
const getInteractionInsights_ConfigPropertyMetadata = [
|
|
1003
|
+
generateParamConfigMetadata('accountId', true, 0 /* UrlParameter */, 0 /* String */),
|
|
1004
|
+
generateParamConfigMetadata('isDirectContacts', false, 1 /* QueryParameter */, 1 /* Boolean */),
|
|
1005
|
+
generateParamConfigMetadata('limit', false, 1 /* QueryParameter */, 3 /* Integer */),
|
|
1006
|
+
generateParamConfigMetadata('offset', false, 1 /* QueryParameter */, 3 /* Integer */),
|
|
1007
|
+
generateParamConfigMetadata('showACR', false, 1 /* QueryParameter */, 1 /* Boolean */),
|
|
1008
|
+
generateParamConfigMetadata('systemContext', false, 1 /* QueryParameter */, 1 /* Boolean */),
|
|
1009
|
+
];
|
|
1010
|
+
const getInteractionInsights_ConfigPropertyNames = /*#__PURE__*/ buildAdapterValidationConfig(adapterName, getInteractionInsights_ConfigPropertyMetadata);
|
|
1011
|
+
const createResourceParams = /*#__PURE__*/ createResourceParams$3(getInteractionInsights_ConfigPropertyMetadata);
|
|
1012
|
+
function keyBuilder(luvio, config) {
|
|
1013
|
+
const resourceParams = createResourceParams(config);
|
|
1014
|
+
return keyBuilder$1(luvio, resourceParams);
|
|
1015
|
+
}
|
|
1016
|
+
function typeCheckConfig(untrustedConfig) {
|
|
1017
|
+
const config = {};
|
|
1018
|
+
typeCheckConfig$3(untrustedConfig, config, getInteractionInsights_ConfigPropertyMetadata);
|
|
1019
|
+
return config;
|
|
1020
|
+
}
|
|
1021
|
+
function validateAdapterConfig(untrustedConfig, configPropertyNames) {
|
|
1022
|
+
if (!untrustedIsObject(untrustedConfig)) {
|
|
1023
|
+
return null;
|
|
1024
|
+
}
|
|
1025
|
+
if (process.env.NODE_ENV !== 'production') {
|
|
1026
|
+
validateConfig(untrustedConfig, configPropertyNames);
|
|
1027
|
+
}
|
|
1028
|
+
const config = typeCheckConfig(untrustedConfig);
|
|
1029
|
+
if (!areRequiredParametersPresent(config, configPropertyNames)) {
|
|
1030
|
+
return null;
|
|
1031
|
+
}
|
|
1032
|
+
return config;
|
|
1033
|
+
}
|
|
1034
|
+
function adapterFragment(luvio, config) {
|
|
1035
|
+
createResourceParams(config);
|
|
1036
|
+
return select();
|
|
1037
|
+
}
|
|
1038
|
+
function onFetchResponseSuccess(luvio, config, resourceParams, response) {
|
|
1039
|
+
const snapshot = ingestSuccess(luvio, resourceParams, response, {
|
|
1040
|
+
config,
|
|
1041
|
+
resolve: () => buildNetworkSnapshot(luvio, config, snapshotRefreshOptions)
|
|
1042
|
+
});
|
|
1043
|
+
return luvio.storeBroadcast().then(() => snapshot);
|
|
1044
|
+
}
|
|
1045
|
+
function onFetchResponseError(luvio, config, resourceParams, response) {
|
|
1046
|
+
const snapshot = ingestError(luvio, resourceParams, response, {
|
|
1047
|
+
config,
|
|
1048
|
+
resolve: () => buildNetworkSnapshot(luvio, config, snapshotRefreshOptions)
|
|
1049
|
+
});
|
|
1050
|
+
return luvio.storeBroadcast().then(() => snapshot);
|
|
1051
|
+
}
|
|
1052
|
+
function buildNetworkSnapshot(luvio, config, options) {
|
|
1053
|
+
const resourceParams = createResourceParams(config);
|
|
1054
|
+
const request = createResourceRequest(resourceParams);
|
|
1055
|
+
return luvio.dispatchResourceRequest(request, options)
|
|
1056
|
+
.then((response) => {
|
|
1057
|
+
return luvio.handleSuccessResponse(() => onFetchResponseSuccess(luvio, config, resourceParams, response), () => {
|
|
1058
|
+
const cache = new StoreKeyMap();
|
|
1059
|
+
getResponseCacheKeys(cache, luvio, resourceParams, response.body);
|
|
1060
|
+
return cache;
|
|
1061
|
+
});
|
|
1062
|
+
}, (response) => {
|
|
1063
|
+
return luvio.handleErrorResponse(() => onFetchResponseError(luvio, config, resourceParams, response));
|
|
1064
|
+
});
|
|
1065
|
+
}
|
|
1066
|
+
function buildNetworkSnapshotCachePolicy(context, coercedAdapterRequestContext) {
|
|
1067
|
+
return buildNetworkSnapshotCachePolicy$3(context, coercedAdapterRequestContext, buildNetworkSnapshot, undefined, false);
|
|
1068
|
+
}
|
|
1069
|
+
function buildCachedSnapshotCachePolicy(context, storeLookup) {
|
|
1070
|
+
const { luvio, config } = context;
|
|
1071
|
+
const selector = {
|
|
1072
|
+
recordId: keyBuilder(luvio, config),
|
|
1073
|
+
node: adapterFragment(luvio, config),
|
|
1074
|
+
variables: {},
|
|
1075
|
+
};
|
|
1076
|
+
const cacheSnapshot = storeLookup(selector, {
|
|
1077
|
+
config,
|
|
1078
|
+
resolve: () => buildNetworkSnapshot(luvio, config, snapshotRefreshOptions)
|
|
1079
|
+
});
|
|
1080
|
+
return cacheSnapshot;
|
|
1081
|
+
}
|
|
1082
|
+
const getInteractionInsightsAdapterFactory = (luvio) => function cib__getInteractionInsights(untrustedConfig, requestContext) {
|
|
1083
|
+
const config = validateAdapterConfig(untrustedConfig, getInteractionInsights_ConfigPropertyNames);
|
|
1084
|
+
// Invalid or incomplete config
|
|
1085
|
+
if (config === null) {
|
|
1086
|
+
return null;
|
|
1087
|
+
}
|
|
1088
|
+
return luvio.applyCachePolicy((requestContext || {}), { config, luvio }, // BuildSnapshotContext
|
|
1089
|
+
buildCachedSnapshotCachePolicy, buildNetworkSnapshotCachePolicy);
|
|
1090
|
+
};
|
|
1091
|
+
|
|
1092
|
+
export { getContactsInteractionsAdapterFactory, getDealPartiesAdapterFactory, getInteractionInsightsAdapterFactory };
|