@salesforce/lds-adapters-industries-claim 1.365.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.
Files changed (28) hide show
  1. package/LICENSE.txt +82 -0
  2. package/dist/es/es2018/industries-claim.js +733 -0
  3. package/dist/es/es2018/types/src/generated/adapters/UpdateClaim.d.ts +17 -0
  4. package/dist/es/es2018/types/src/generated/adapters/adapter-utils.d.ts +62 -0
  5. package/dist/es/es2018/types/src/generated/artifacts/main.d.ts +1 -0
  6. package/dist/es/es2018/types/src/generated/artifacts/sfdc.d.ts +2 -0
  7. package/dist/es/es2018/types/src/generated/resources/patchConnectClaimsByClaimId.d.ts +16 -0
  8. package/dist/es/es2018/types/src/generated/types/ClaimAttributeInputRepresentation.d.ts +31 -0
  9. package/dist/es/es2018/types/src/generated/types/ClaimAttributesInput.d.ts +29 -0
  10. package/dist/es/es2018/types/src/generated/types/ClaimErrorOutputRepresentation.d.ts +31 -0
  11. package/dist/es/es2018/types/src/generated/types/ClaimErrorsOutput.d.ts +29 -0
  12. package/dist/es/es2018/types/src/generated/types/ClaimInputRepresentation.d.ts +71 -0
  13. package/dist/es/es2018/types/src/generated/types/ClaimInputWrapperRepresentation.d.ts +29 -0
  14. package/dist/es/es2018/types/src/generated/types/ClaimItemInputRepresentation.d.ts +59 -0
  15. package/dist/es/es2018/types/src/generated/types/ClaimItemsInput.d.ts +29 -0
  16. package/dist/es/es2018/types/src/generated/types/ClaimOptionsInputRepresentation.d.ts +28 -0
  17. package/dist/es/es2018/types/src/generated/types/ClaimParticipantInputRepresentation.d.ts +49 -0
  18. package/dist/es/es2018/types/src/generated/types/ClaimParticipantRolesInput.d.ts +28 -0
  19. package/dist/es/es2018/types/src/generated/types/ClaimParticipantsInput.d.ts +29 -0
  20. package/dist/es/es2018/types/src/generated/types/ClaimRelatedObjectInputRepresentation.d.ts +31 -0
  21. package/dist/es/es2018/types/src/generated/types/ClaimRelatedObjectsInput.d.ts +29 -0
  22. package/dist/es/es2018/types/src/generated/types/CreateClaimOutputRepresentation.d.ts +45 -0
  23. package/dist/es/es2018/types/src/generated/types/type-utils.d.ts +32 -0
  24. package/package.json +66 -0
  25. package/sfdc/index.d.ts +1 -0
  26. package/sfdc/index.js +761 -0
  27. package/src/raml/api.raml +313 -0
  28. package/src/raml/luvio.raml +20 -0
@@ -0,0 +1,733 @@
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, StoreKeyMap, createResourceParams as createResourceParams$1, typeCheckConfig as typeCheckConfig$1 } 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
+ function generateParamConfigMetadata(name, required, resourceType, typeCheckShape, isArrayShape = false, coerceFn) {
45
+ return {
46
+ name,
47
+ required,
48
+ resourceType,
49
+ typeCheckShape,
50
+ isArrayShape,
51
+ coerceFn,
52
+ };
53
+ }
54
+ function buildAdapterValidationConfig(displayName, paramsMeta) {
55
+ const required = paramsMeta.filter(p => p.required).map(p => p.name);
56
+ const optional = paramsMeta.filter(p => !p.required).map(p => p.name);
57
+ return {
58
+ displayName,
59
+ parameters: {
60
+ required,
61
+ optional,
62
+ }
63
+ };
64
+ }
65
+ const keyPrefix = 'Claim';
66
+
67
+ const { isArray: ArrayIsArray } = Array;
68
+ const { stringify: JSONStringify } = JSON;
69
+ function createLink(ref) {
70
+ return {
71
+ __ref: serializeStructuredKey(ref),
72
+ };
73
+ }
74
+
75
+ function validate$c(obj, path = 'ClaimAttributeInputRepresentation') {
76
+ const v_error = (() => {
77
+ if (typeof obj !== 'object' || ArrayIsArray(obj) || obj === null) {
78
+ return new TypeError('Expected "object" but received "' + typeof obj + '" (at "' + path + '")');
79
+ }
80
+ if (obj.apiName !== undefined) {
81
+ const obj_apiName = obj.apiName;
82
+ const path_apiName = path + '.apiName';
83
+ if (typeof obj_apiName !== 'string') {
84
+ return new TypeError('Expected "string" but received "' + typeof obj_apiName + '" (at "' + path_apiName + '")');
85
+ }
86
+ }
87
+ if (obj.value !== undefined) {
88
+ const obj_value = obj.value;
89
+ const path_value = path + '.value';
90
+ if (typeof obj_value !== 'string') {
91
+ return new TypeError('Expected "string" but received "' + typeof obj_value + '" (at "' + path_value + '")');
92
+ }
93
+ }
94
+ })();
95
+ return v_error === undefined ? null : v_error;
96
+ }
97
+
98
+ function validate$b(obj, path = 'ClaimAttributesInput') {
99
+ const v_error = (() => {
100
+ if (typeof obj !== 'object' || ArrayIsArray(obj) || obj === null) {
101
+ return new TypeError('Expected "object" but received "' + typeof obj + '" (at "' + path + '")');
102
+ }
103
+ const obj_list = obj.list;
104
+ const path_list = path + '.list';
105
+ if (!ArrayIsArray(obj_list)) {
106
+ return new TypeError('Expected "array" but received "' + typeof obj_list + '" (at "' + path_list + '")');
107
+ }
108
+ for (let i = 0; i < obj_list.length; i++) {
109
+ const obj_list_item = obj_list[i];
110
+ const path_list_item = path_list + '[' + i + ']';
111
+ const referencepath_list_itemValidationError = validate$c(obj_list_item, path_list_item);
112
+ if (referencepath_list_itemValidationError !== null) {
113
+ let message = 'Object doesn\'t match ClaimAttributeInputRepresentation (at "' + path_list_item + '")\n';
114
+ message += referencepath_list_itemValidationError.message.split('\n').map((line) => '\t' + line).join('\n');
115
+ return new TypeError(message);
116
+ }
117
+ }
118
+ })();
119
+ return v_error === undefined ? null : v_error;
120
+ }
121
+
122
+ function validate$a(obj, path = 'ClaimRelatedObjectInputRepresentation') {
123
+ const v_error = (() => {
124
+ if (typeof obj !== 'object' || ArrayIsArray(obj) || obj === null) {
125
+ return new TypeError('Expected "object" but received "' + typeof obj + '" (at "' + path + '")');
126
+ }
127
+ if (obj.recordId !== undefined) {
128
+ const obj_recordId = obj.recordId;
129
+ const path_recordId = path + '.recordId';
130
+ if (typeof obj_recordId !== 'string') {
131
+ return new TypeError('Expected "string" but received "' + typeof obj_recordId + '" (at "' + path_recordId + '")');
132
+ }
133
+ }
134
+ if (obj.recordObjName !== undefined) {
135
+ const obj_recordObjName = obj.recordObjName;
136
+ const path_recordObjName = path + '.recordObjName';
137
+ if (typeof obj_recordObjName !== 'string') {
138
+ return new TypeError('Expected "string" but received "' + typeof obj_recordObjName + '" (at "' + path_recordObjName + '")');
139
+ }
140
+ }
141
+ })();
142
+ return v_error === undefined ? null : v_error;
143
+ }
144
+
145
+ function validate$9(obj, path = 'ClaimRelatedObjectsInput') {
146
+ const v_error = (() => {
147
+ if (typeof obj !== 'object' || ArrayIsArray(obj) || obj === null) {
148
+ return new TypeError('Expected "object" but received "' + typeof obj + '" (at "' + path + '")');
149
+ }
150
+ const obj_list = obj.list;
151
+ const path_list = path + '.list';
152
+ if (!ArrayIsArray(obj_list)) {
153
+ return new TypeError('Expected "array" but received "' + typeof obj_list + '" (at "' + path_list + '")');
154
+ }
155
+ for (let i = 0; i < obj_list.length; i++) {
156
+ const obj_list_item = obj_list[i];
157
+ const path_list_item = path_list + '[' + i + ']';
158
+ const referencepath_list_itemValidationError = validate$a(obj_list_item, path_list_item);
159
+ if (referencepath_list_itemValidationError !== null) {
160
+ let message = 'Object doesn\'t match ClaimRelatedObjectInputRepresentation (at "' + path_list_item + '")\n';
161
+ message += referencepath_list_itemValidationError.message.split('\n').map((line) => '\t' + line).join('\n');
162
+ return new TypeError(message);
163
+ }
164
+ }
165
+ })();
166
+ return v_error === undefined ? null : v_error;
167
+ }
168
+
169
+ function validate$8(obj, path = 'ClaimItemInputRepresentation') {
170
+ const v_error = (() => {
171
+ if (typeof obj !== 'object' || ArrayIsArray(obj) || obj === null) {
172
+ return new TypeError('Expected "object" but received "' + typeof obj + '" (at "' + path + '")');
173
+ }
174
+ const obj_action = obj.action;
175
+ const path_action = path + '.action';
176
+ if (typeof obj_action !== 'string') {
177
+ return new TypeError('Expected "string" but received "' + typeof obj_action + '" (at "' + path_action + '")');
178
+ }
179
+ if (obj.additionalFields !== undefined) {
180
+ const obj_additionalFields = obj.additionalFields;
181
+ const path_additionalFields = path + '.additionalFields';
182
+ if (obj_additionalFields === undefined) {
183
+ return new TypeError('Expected "defined" but received "' + typeof obj_additionalFields + '" (at "' + path_additionalFields + '")');
184
+ }
185
+ }
186
+ if (obj.attributes !== undefined) {
187
+ const obj_attributes = obj.attributes;
188
+ const path_attributes = path + '.attributes';
189
+ const referencepath_attributesValidationError = validate$b(obj_attributes, path_attributes);
190
+ if (referencepath_attributesValidationError !== null) {
191
+ let message = 'Object doesn\'t match ClaimAttributesInput (at "' + path_attributes + '")\n';
192
+ message += referencepath_attributesValidationError.message.split('\n').map((line) => '\t' + line).join('\n');
193
+ return new TypeError(message);
194
+ }
195
+ }
196
+ if (obj.category !== undefined) {
197
+ const obj_category = obj.category;
198
+ const path_category = path + '.category';
199
+ if (typeof obj_category !== 'string') {
200
+ return new TypeError('Expected "string" but received "' + typeof obj_category + '" (at "' + path_category + '")');
201
+ }
202
+ }
203
+ const obj_instanceKey = obj.instanceKey;
204
+ const path_instanceKey = path + '.instanceKey';
205
+ if (typeof obj_instanceKey !== 'string') {
206
+ return new TypeError('Expected "string" but received "' + typeof obj_instanceKey + '" (at "' + path_instanceKey + '")');
207
+ }
208
+ if (obj.insurancePolicyCoverageId !== undefined) {
209
+ const obj_insurancePolicyCoverageId = obj.insurancePolicyCoverageId;
210
+ const path_insurancePolicyCoverageId = path + '.insurancePolicyCoverageId';
211
+ if (typeof obj_insurancePolicyCoverageId !== 'string') {
212
+ return new TypeError('Expected "string" but received "' + typeof obj_insurancePolicyCoverageId + '" (at "' + path_insurancePolicyCoverageId + '")');
213
+ }
214
+ }
215
+ if (obj.insuredItemId !== undefined) {
216
+ const obj_insuredItemId = obj.insuredItemId;
217
+ const path_insuredItemId = path + '.insuredItemId';
218
+ if (typeof obj_insuredItemId !== 'string') {
219
+ return new TypeError('Expected "string" but received "' + typeof obj_insuredItemId + '" (at "' + path_insuredItemId + '")');
220
+ }
221
+ }
222
+ if (obj.name !== undefined) {
223
+ const obj_name = obj.name;
224
+ const path_name = path + '.name';
225
+ if (typeof obj_name !== 'string') {
226
+ return new TypeError('Expected "string" but received "' + typeof obj_name + '" (at "' + path_name + '")');
227
+ }
228
+ }
229
+ if (obj.participantInstanceKey !== undefined) {
230
+ const obj_participantInstanceKey = obj.participantInstanceKey;
231
+ const path_participantInstanceKey = path + '.participantInstanceKey';
232
+ if (typeof obj_participantInstanceKey !== 'string') {
233
+ return new TypeError('Expected "string" but received "' + typeof obj_participantInstanceKey + '" (at "' + path_participantInstanceKey + '")');
234
+ }
235
+ }
236
+ if (obj.productCode !== undefined) {
237
+ const obj_productCode = obj.productCode;
238
+ const path_productCode = path + '.productCode';
239
+ if (typeof obj_productCode !== 'string') {
240
+ return new TypeError('Expected "string" but received "' + typeof obj_productCode + '" (at "' + path_productCode + '")');
241
+ }
242
+ }
243
+ if (obj.relatedObjects !== undefined) {
244
+ const obj_relatedObjects = obj.relatedObjects;
245
+ const path_relatedObjects = path + '.relatedObjects';
246
+ const referencepath_relatedObjectsValidationError = validate$9(obj_relatedObjects, path_relatedObjects);
247
+ if (referencepath_relatedObjectsValidationError !== null) {
248
+ let message = 'Object doesn\'t match ClaimRelatedObjectsInput (at "' + path_relatedObjects + '")\n';
249
+ message += referencepath_relatedObjectsValidationError.message.split('\n').map((line) => '\t' + line).join('\n');
250
+ return new TypeError(message);
251
+ }
252
+ }
253
+ })();
254
+ return v_error === undefined ? null : v_error;
255
+ }
256
+
257
+ function validate$7(obj, path = 'ClaimItemsInput') {
258
+ const v_error = (() => {
259
+ if (typeof obj !== 'object' || ArrayIsArray(obj) || obj === null) {
260
+ return new TypeError('Expected "object" but received "' + typeof obj + '" (at "' + path + '")');
261
+ }
262
+ const obj_list = obj.list;
263
+ const path_list = path + '.list';
264
+ if (!ArrayIsArray(obj_list)) {
265
+ return new TypeError('Expected "array" but received "' + typeof obj_list + '" (at "' + path_list + '")');
266
+ }
267
+ for (let i = 0; i < obj_list.length; i++) {
268
+ const obj_list_item = obj_list[i];
269
+ const path_list_item = path_list + '[' + i + ']';
270
+ const referencepath_list_itemValidationError = validate$8(obj_list_item, path_list_item);
271
+ if (referencepath_list_itemValidationError !== null) {
272
+ let message = 'Object doesn\'t match ClaimItemInputRepresentation (at "' + path_list_item + '")\n';
273
+ message += referencepath_list_itemValidationError.message.split('\n').map((line) => '\t' + line).join('\n');
274
+ return new TypeError(message);
275
+ }
276
+ }
277
+ })();
278
+ return v_error === undefined ? null : v_error;
279
+ }
280
+
281
+ function validate$6(obj, path = 'ClaimParticipantRolesInput') {
282
+ const v_error = (() => {
283
+ if (typeof obj !== 'object' || ArrayIsArray(obj) || obj === null) {
284
+ return new TypeError('Expected "object" but received "' + typeof obj + '" (at "' + path + '")');
285
+ }
286
+ if (obj.list !== undefined) {
287
+ const obj_list = obj.list;
288
+ const path_list = path + '.list';
289
+ if (!ArrayIsArray(obj_list)) {
290
+ return new TypeError('Expected "array" but received "' + typeof obj_list + '" (at "' + path_list + '")');
291
+ }
292
+ for (let i = 0; i < obj_list.length; i++) {
293
+ const obj_list_item = obj_list[i];
294
+ const path_list_item = path_list + '[' + i + ']';
295
+ if (typeof obj_list_item !== 'string') {
296
+ return new TypeError('Expected "string" but received "' + typeof obj_list_item + '" (at "' + path_list_item + '")');
297
+ }
298
+ }
299
+ }
300
+ })();
301
+ return v_error === undefined ? null : v_error;
302
+ }
303
+
304
+ function validate$5(obj, path = 'ClaimParticipantInputRepresentation') {
305
+ const v_error = (() => {
306
+ if (typeof obj !== 'object' || ArrayIsArray(obj) || obj === null) {
307
+ return new TypeError('Expected "object" but received "' + typeof obj + '" (at "' + path + '")');
308
+ }
309
+ if (obj.accountId !== undefined) {
310
+ const obj_accountId = obj.accountId;
311
+ const path_accountId = path + '.accountId';
312
+ if (typeof obj_accountId !== 'string') {
313
+ return new TypeError('Expected "string" but received "' + typeof obj_accountId + '" (at "' + path_accountId + '")');
314
+ }
315
+ }
316
+ const obj_action = obj.action;
317
+ const path_action = path + '.action';
318
+ if (typeof obj_action !== 'string') {
319
+ return new TypeError('Expected "string" but received "' + typeof obj_action + '" (at "' + path_action + '")');
320
+ }
321
+ if (obj.additionalFields !== undefined) {
322
+ const obj_additionalFields = obj.additionalFields;
323
+ const path_additionalFields = path + '.additionalFields';
324
+ if (obj_additionalFields === undefined) {
325
+ return new TypeError('Expected "defined" but received "' + typeof obj_additionalFields + '" (at "' + path_additionalFields + '")');
326
+ }
327
+ }
328
+ if (obj.contactId !== undefined) {
329
+ const obj_contactId = obj.contactId;
330
+ const path_contactId = path + '.contactId';
331
+ if (typeof obj_contactId !== 'string') {
332
+ return new TypeError('Expected "string" but received "' + typeof obj_contactId + '" (at "' + path_contactId + '")');
333
+ }
334
+ }
335
+ const obj_instanceKey = obj.instanceKey;
336
+ const path_instanceKey = path + '.instanceKey';
337
+ if (typeof obj_instanceKey !== 'string') {
338
+ return new TypeError('Expected "string" but received "' + typeof obj_instanceKey + '" (at "' + path_instanceKey + '")');
339
+ }
340
+ if (obj.insurancePolicyParticipantId !== undefined) {
341
+ const obj_insurancePolicyParticipantId = obj.insurancePolicyParticipantId;
342
+ const path_insurancePolicyParticipantId = path + '.insurancePolicyParticipantId';
343
+ if (typeof obj_insurancePolicyParticipantId !== 'string') {
344
+ return new TypeError('Expected "string" but received "' + typeof obj_insurancePolicyParticipantId + '" (at "' + path_insurancePolicyParticipantId + '")');
345
+ }
346
+ }
347
+ if (obj.isInjured !== undefined) {
348
+ const obj_isInjured = obj.isInjured;
349
+ const path_isInjured = path + '.isInjured';
350
+ if (typeof obj_isInjured !== 'string') {
351
+ return new TypeError('Expected "string" but received "' + typeof obj_isInjured + '" (at "' + path_isInjured + '")');
352
+ }
353
+ }
354
+ if (obj.roles !== undefined) {
355
+ const obj_roles = obj.roles;
356
+ const path_roles = path + '.roles';
357
+ const referencepath_rolesValidationError = validate$6(obj_roles, path_roles);
358
+ if (referencepath_rolesValidationError !== null) {
359
+ let message = 'Object doesn\'t match ClaimParticipantRolesInput (at "' + path_roles + '")\n';
360
+ message += referencepath_rolesValidationError.message.split('\n').map((line) => '\t' + line).join('\n');
361
+ return new TypeError(message);
362
+ }
363
+ }
364
+ })();
365
+ return v_error === undefined ? null : v_error;
366
+ }
367
+
368
+ function validate$4(obj, path = 'ClaimParticipantsInput') {
369
+ const v_error = (() => {
370
+ if (typeof obj !== 'object' || ArrayIsArray(obj) || obj === null) {
371
+ return new TypeError('Expected "object" but received "' + typeof obj + '" (at "' + path + '")');
372
+ }
373
+ const obj_list = obj.list;
374
+ const path_list = path + '.list';
375
+ if (!ArrayIsArray(obj_list)) {
376
+ return new TypeError('Expected "array" but received "' + typeof obj_list + '" (at "' + path_list + '")');
377
+ }
378
+ for (let i = 0; i < obj_list.length; i++) {
379
+ const obj_list_item = obj_list[i];
380
+ const path_list_item = path_list + '[' + i + ']';
381
+ const referencepath_list_itemValidationError = validate$5(obj_list_item, path_list_item);
382
+ if (referencepath_list_itemValidationError !== null) {
383
+ let message = 'Object doesn\'t match ClaimParticipantInputRepresentation (at "' + path_list_item + '")\n';
384
+ message += referencepath_list_itemValidationError.message.split('\n').map((line) => '\t' + line).join('\n');
385
+ return new TypeError(message);
386
+ }
387
+ }
388
+ })();
389
+ return v_error === undefined ? null : v_error;
390
+ }
391
+
392
+ function validate$3(obj, path = 'ClaimInputRepresentation') {
393
+ const v_error = (() => {
394
+ if (typeof obj !== 'object' || ArrayIsArray(obj) || obj === null) {
395
+ return new TypeError('Expected "object" but received "' + typeof obj + '" (at "' + path + '")');
396
+ }
397
+ if (obj.accountId !== undefined) {
398
+ const obj_accountId = obj.accountId;
399
+ const path_accountId = path + '.accountId';
400
+ if (typeof obj_accountId !== 'string') {
401
+ return new TypeError('Expected "string" but received "' + typeof obj_accountId + '" (at "' + path_accountId + '")');
402
+ }
403
+ }
404
+ if (obj.additionalFields !== undefined) {
405
+ const obj_additionalFields = obj.additionalFields;
406
+ const path_additionalFields = path + '.additionalFields';
407
+ if (obj_additionalFields === undefined) {
408
+ return new TypeError('Expected "defined" but received "' + typeof obj_additionalFields + '" (at "' + path_additionalFields + '")');
409
+ }
410
+ }
411
+ if (obj.attributes !== undefined) {
412
+ const obj_attributes = obj.attributes;
413
+ const path_attributes = path + '.attributes';
414
+ const referencepath_attributesValidationError = validate$b(obj_attributes, path_attributes);
415
+ if (referencepath_attributesValidationError !== null) {
416
+ let message = 'Object doesn\'t match ClaimAttributesInput (at "' + path_attributes + '")\n';
417
+ message += referencepath_attributesValidationError.message.split('\n').map((line) => '\t' + line).join('\n');
418
+ return new TypeError(message);
419
+ }
420
+ }
421
+ if (obj.claimReason !== undefined) {
422
+ const obj_claimReason = obj.claimReason;
423
+ const path_claimReason = path + '.claimReason';
424
+ if (typeof obj_claimReason !== 'string') {
425
+ return new TypeError('Expected "string" but received "' + typeof obj_claimReason + '" (at "' + path_claimReason + '")');
426
+ }
427
+ }
428
+ if (obj.claimReasonType !== undefined) {
429
+ const obj_claimReasonType = obj.claimReasonType;
430
+ const path_claimReasonType = path + '.claimReasonType';
431
+ if (typeof obj_claimReasonType !== 'string') {
432
+ return new TypeError('Expected "string" but received "' + typeof obj_claimReasonType + '" (at "' + path_claimReasonType + '")');
433
+ }
434
+ }
435
+ if (obj.claimType !== undefined) {
436
+ const obj_claimType = obj.claimType;
437
+ const path_claimType = path + '.claimType';
438
+ if (typeof obj_claimType !== 'string') {
439
+ return new TypeError('Expected "string" but received "' + typeof obj_claimType + '" (at "' + path_claimType + '")');
440
+ }
441
+ }
442
+ if (obj.incidentTypeId !== undefined) {
443
+ const obj_incidentTypeId = obj.incidentTypeId;
444
+ const path_incidentTypeId = path + '.incidentTypeId';
445
+ if (typeof obj_incidentTypeId !== 'string') {
446
+ return new TypeError('Expected "string" but received "' + typeof obj_incidentTypeId + '" (at "' + path_incidentTypeId + '")');
447
+ }
448
+ }
449
+ if (obj.insurancePolicyId !== undefined) {
450
+ const obj_insurancePolicyId = obj.insurancePolicyId;
451
+ const path_insurancePolicyId = path + '.insurancePolicyId';
452
+ if (typeof obj_insurancePolicyId !== 'string') {
453
+ return new TypeError('Expected "string" but received "' + typeof obj_insurancePolicyId + '" (at "' + path_insurancePolicyId + '")');
454
+ }
455
+ }
456
+ if (obj.items !== undefined) {
457
+ const obj_items = obj.items;
458
+ const path_items = path + '.items';
459
+ const referencepath_itemsValidationError = validate$7(obj_items, path_items);
460
+ if (referencepath_itemsValidationError !== null) {
461
+ let message = 'Object doesn\'t match ClaimItemsInput (at "' + path_items + '")\n';
462
+ message += referencepath_itemsValidationError.message.split('\n').map((line) => '\t' + line).join('\n');
463
+ return new TypeError(message);
464
+ }
465
+ }
466
+ if (obj.lossDate !== undefined) {
467
+ const obj_lossDate = obj.lossDate;
468
+ const path_lossDate = path + '.lossDate';
469
+ if (typeof obj_lossDate !== 'string') {
470
+ return new TypeError('Expected "string" but received "' + typeof obj_lossDate + '" (at "' + path_lossDate + '")');
471
+ }
472
+ }
473
+ if (obj.lossType !== undefined) {
474
+ const obj_lossType = obj.lossType;
475
+ const path_lossType = path + '.lossType';
476
+ if (typeof obj_lossType !== 'string') {
477
+ return new TypeError('Expected "string" but received "' + typeof obj_lossType + '" (at "' + path_lossType + '")');
478
+ }
479
+ }
480
+ if (obj.name !== undefined) {
481
+ const obj_name = obj.name;
482
+ const path_name = path + '.name';
483
+ if (typeof obj_name !== 'string') {
484
+ return new TypeError('Expected "string" but received "' + typeof obj_name + '" (at "' + path_name + '")');
485
+ }
486
+ }
487
+ if (obj.options !== undefined) {
488
+ const obj_options = obj.options;
489
+ const path_options = path + '.options';
490
+ if (obj_options === undefined) {
491
+ return new TypeError('Expected "defined" but received "' + typeof obj_options + '" (at "' + path_options + '")');
492
+ }
493
+ }
494
+ if (obj.participants !== undefined) {
495
+ const obj_participants = obj.participants;
496
+ const path_participants = path + '.participants';
497
+ const referencepath_participantsValidationError = validate$4(obj_participants, path_participants);
498
+ if (referencepath_participantsValidationError !== null) {
499
+ let message = 'Object doesn\'t match ClaimParticipantsInput (at "' + path_participants + '")\n';
500
+ message += referencepath_participantsValidationError.message.split('\n').map((line) => '\t' + line).join('\n');
501
+ return new TypeError(message);
502
+ }
503
+ }
504
+ if (obj.productCode !== undefined) {
505
+ const obj_productCode = obj.productCode;
506
+ const path_productCode = path + '.productCode';
507
+ if (typeof obj_productCode !== 'string') {
508
+ return new TypeError('Expected "string" but received "' + typeof obj_productCode + '" (at "' + path_productCode + '")');
509
+ }
510
+ }
511
+ })();
512
+ return v_error === undefined ? null : v_error;
513
+ }
514
+
515
+ function validate$2(obj, path = 'ClaimErrorOutputRepresentation') {
516
+ const v_error = (() => {
517
+ if (typeof obj !== 'object' || ArrayIsArray(obj) || obj === null) {
518
+ return new TypeError('Expected "object" but received "' + typeof obj + '" (at "' + path + '")');
519
+ }
520
+ const obj_code = obj.code;
521
+ const path_code = path + '.code';
522
+ if (typeof obj_code !== 'string') {
523
+ return new TypeError('Expected "string" but received "' + typeof obj_code + '" (at "' + path_code + '")');
524
+ }
525
+ const obj_message = obj.message;
526
+ const path_message = path + '.message';
527
+ if (typeof obj_message !== 'string') {
528
+ return new TypeError('Expected "string" but received "' + typeof obj_message + '" (at "' + path_message + '")');
529
+ }
530
+ })();
531
+ return v_error === undefined ? null : v_error;
532
+ }
533
+
534
+ function validate$1(obj, path = 'ClaimErrorsOutput') {
535
+ const v_error = (() => {
536
+ if (typeof obj !== 'object' || ArrayIsArray(obj) || obj === null) {
537
+ return new TypeError('Expected "object" but received "' + typeof obj + '" (at "' + path + '")');
538
+ }
539
+ const obj_list = obj.list;
540
+ const path_list = path + '.list';
541
+ if (!ArrayIsArray(obj_list)) {
542
+ return new TypeError('Expected "array" but received "' + typeof obj_list + '" (at "' + path_list + '")');
543
+ }
544
+ for (let i = 0; i < obj_list.length; i++) {
545
+ const obj_list_item = obj_list[i];
546
+ const path_list_item = path_list + '[' + i + ']';
547
+ const referencepath_list_itemValidationError = validate$2(obj_list_item, path_list_item);
548
+ if (referencepath_list_itemValidationError !== null) {
549
+ let message = 'Object doesn\'t match ClaimErrorOutputRepresentation (at "' + path_list_item + '")\n';
550
+ message += referencepath_list_itemValidationError.message.split('\n').map((line) => '\t' + line).join('\n');
551
+ return new TypeError(message);
552
+ }
553
+ }
554
+ })();
555
+ return v_error === undefined ? null : v_error;
556
+ }
557
+
558
+ const TTL = 1000;
559
+ const VERSION = "cfe519428dbc15b5957bdd77685559d4";
560
+ function validate(obj, path = 'CreateClaimOutputRepresentation') {
561
+ const v_error = (() => {
562
+ if (typeof obj !== 'object' || ArrayIsArray(obj) || obj === null) {
563
+ return new TypeError('Expected "object" but received "' + typeof obj + '" (at "' + path + '")');
564
+ }
565
+ const obj_claimId = obj.claimId;
566
+ const path_claimId = path + '.claimId';
567
+ if (typeof obj_claimId !== 'string') {
568
+ return new TypeError('Expected "string" but received "' + typeof obj_claimId + '" (at "' + path_claimId + '")');
569
+ }
570
+ if (obj.errors !== undefined) {
571
+ const obj_errors = obj.errors;
572
+ const path_errors = path + '.errors';
573
+ const referencepath_errorsValidationError = validate$1(obj_errors, path_errors);
574
+ if (referencepath_errorsValidationError !== null) {
575
+ let message = 'Object doesn\'t match ClaimErrorsOutput (at "' + path_errors + '")\n';
576
+ message += referencepath_errorsValidationError.message.split('\n').map((line) => '\t' + line).join('\n');
577
+ return new TypeError(message);
578
+ }
579
+ }
580
+ const obj_isSuccess = obj.isSuccess;
581
+ const path_isSuccess = path + '.isSuccess';
582
+ if (typeof obj_isSuccess !== 'boolean') {
583
+ return new TypeError('Expected "boolean" but received "' + typeof obj_isSuccess + '" (at "' + path_isSuccess + '")');
584
+ }
585
+ })();
586
+ return v_error === undefined ? null : v_error;
587
+ }
588
+ const RepresentationType = 'CreateClaimOutputRepresentation';
589
+ function keyBuilder(luvio, config) {
590
+ return keyPrefix + '::' + RepresentationType + ':' + config.claim_id;
591
+ }
592
+ function keyBuilderFromType(luvio, object) {
593
+ const keyParams = {
594
+ claim_id: object.claimId
595
+ };
596
+ return keyBuilder(luvio, keyParams);
597
+ }
598
+ function normalize(input, existing, path, luvio, store, timestamp) {
599
+ return input;
600
+ }
601
+ const select$1 = function CreateClaimOutputRepresentationSelect() {
602
+ return {
603
+ kind: 'Fragment',
604
+ version: VERSION,
605
+ private: [],
606
+ opaque: true
607
+ };
608
+ };
609
+ function equals(existing, incoming) {
610
+ if (JSONStringify(incoming) !== JSONStringify(existing)) {
611
+ return false;
612
+ }
613
+ return true;
614
+ }
615
+ const ingest = function CreateClaimOutputRepresentationIngest(input, path, luvio, store, timestamp) {
616
+ if (process.env.NODE_ENV !== 'production') {
617
+ const validateError = validate(input);
618
+ if (validateError !== null) {
619
+ throw validateError;
620
+ }
621
+ }
622
+ const key = keyBuilderFromType(luvio, input);
623
+ const ttlToUse = TTL;
624
+ ingestShape(input, path, luvio, store, timestamp, ttlToUse, key, normalize, "Claim", VERSION, RepresentationType, equals);
625
+ return createLink(key);
626
+ };
627
+ function getTypeCacheKeys(rootKeySet, luvio, input, fullPathFactory) {
628
+ // root cache key (uses fullPathFactory if keyBuilderFromType isn't defined)
629
+ const rootKey = keyBuilderFromType(luvio, input);
630
+ rootKeySet.set(rootKey, {
631
+ namespace: keyPrefix,
632
+ representationName: RepresentationType,
633
+ mergeable: false
634
+ });
635
+ }
636
+
637
+ function select(luvio, params) {
638
+ return select$1();
639
+ }
640
+ function getResponseCacheKeys(storeKeyMap, luvio, resourceParams, response) {
641
+ getTypeCacheKeys(storeKeyMap, luvio, response);
642
+ }
643
+ function ingestSuccess(luvio, resourceParams, response) {
644
+ const { body } = response;
645
+ const key = keyBuilderFromType(luvio, body);
646
+ luvio.storeIngest(key, ingest, body);
647
+ const snapshot = luvio.storeLookup({
648
+ recordId: key,
649
+ node: select(),
650
+ variables: {},
651
+ });
652
+ if (process.env.NODE_ENV !== 'production') {
653
+ if (snapshot.state !== 'Fulfilled') {
654
+ throw new Error('Invalid network response. Expected resource response to result in Fulfilled snapshot');
655
+ }
656
+ }
657
+ deepFreeze(snapshot.data);
658
+ return snapshot;
659
+ }
660
+ function createResourceRequest(config) {
661
+ const headers = {};
662
+ return {
663
+ baseUri: '/services/data/v65.0',
664
+ basePath: '/connect/claims/' + config.urlParams.claimId + '',
665
+ method: 'patch',
666
+ body: config.body,
667
+ urlParams: config.urlParams,
668
+ queryParams: {},
669
+ headers,
670
+ priority: 'normal',
671
+ };
672
+ }
673
+
674
+ const adapterName = 'UpdateClaim';
675
+ const UpdateClaim_ConfigPropertyMetadata = [
676
+ generateParamConfigMetadata('claimId', true, 0 /* UrlParameter */, 0 /* String */),
677
+ generateParamConfigMetadata('updateClaimInput', true, 2 /* Body */, 4 /* Unsupported */),
678
+ ];
679
+ const UpdateClaim_ConfigPropertyNames = /*#__PURE__*/ buildAdapterValidationConfig(adapterName, UpdateClaim_ConfigPropertyMetadata);
680
+ const createResourceParams = /*#__PURE__*/ createResourceParams$1(UpdateClaim_ConfigPropertyMetadata);
681
+ function typeCheckConfig(untrustedConfig) {
682
+ const config = {};
683
+ typeCheckConfig$1(untrustedConfig, config, UpdateClaim_ConfigPropertyMetadata);
684
+ const untrustedConfig_updateClaimInput = untrustedConfig.updateClaimInput;
685
+ const referenceClaimInputRepresentationValidationError = validate$3(untrustedConfig_updateClaimInput);
686
+ if (referenceClaimInputRepresentationValidationError === null) {
687
+ config.updateClaimInput = untrustedConfig_updateClaimInput;
688
+ }
689
+ return config;
690
+ }
691
+ function validateAdapterConfig(untrustedConfig, configPropertyNames) {
692
+ if (!untrustedIsObject(untrustedConfig)) {
693
+ return null;
694
+ }
695
+ if (process.env.NODE_ENV !== 'production') {
696
+ validateConfig(untrustedConfig, configPropertyNames);
697
+ }
698
+ const config = typeCheckConfig(untrustedConfig);
699
+ if (!areRequiredParametersPresent(config, configPropertyNames)) {
700
+ return null;
701
+ }
702
+ return config;
703
+ }
704
+ function buildNetworkSnapshot(luvio, config, options) {
705
+ const resourceParams = createResourceParams(config);
706
+ const request = createResourceRequest(resourceParams);
707
+ return luvio.dispatchResourceRequest(request, options)
708
+ .then((response) => {
709
+ return luvio.handleSuccessResponse(() => {
710
+ const snapshot = ingestSuccess(luvio, resourceParams, response);
711
+ return luvio.storeBroadcast().then(() => snapshot);
712
+ }, () => {
713
+ const cache = new StoreKeyMap();
714
+ getResponseCacheKeys(cache, luvio, resourceParams, response.body);
715
+ return cache;
716
+ });
717
+ }, (response) => {
718
+ deepFreeze(response);
719
+ throw response;
720
+ });
721
+ }
722
+ const UpdateClaimAdapterFactory = (luvio) => {
723
+ return function UpdateClaim(untrustedConfig) {
724
+ const config = validateAdapterConfig(untrustedConfig, UpdateClaim_ConfigPropertyNames);
725
+ // Invalid or incomplete config
726
+ if (config === null) {
727
+ throw new Error('Invalid config for "UpdateClaim"');
728
+ }
729
+ return buildNetworkSnapshot(luvio, config);
730
+ };
731
+ };
732
+
733
+ export { UpdateClaimAdapterFactory };