@salesforce/lds-adapters-industries-claim 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.
Files changed (35) hide show
  1. package/LICENSE.txt +82 -0
  2. package/dist/es/es2018/industries-claim.js +1117 -0
  3. package/dist/es/es2018/types/src/generated/adapters/CreateClaimCoverage.d.ts +25 -0
  4. package/dist/es/es2018/types/src/generated/adapters/UpdateClaim.d.ts +33 -0
  5. package/dist/es/es2018/types/src/generated/adapters/UpdateClaimCoverage.d.ts +19 -0
  6. package/dist/es/es2018/types/src/generated/adapters/adapter-utils.d.ts +62 -0
  7. package/dist/es/es2018/types/src/generated/artifacts/main.d.ts +3 -0
  8. package/dist/es/es2018/types/src/generated/artifacts/sfdc.d.ts +4 -0
  9. package/dist/es/es2018/types/src/generated/resources/patchConnectClaimsByClaimId.d.ts +32 -0
  10. package/dist/es/es2018/types/src/generated/resources/patchConnectClaimsCoveragesByClaimIdAndCoverageId.d.ts +18 -0
  11. package/dist/es/es2018/types/src/generated/resources/postConnectClaimsCoveragesByClaimId.d.ts +24 -0
  12. package/dist/es/es2018/types/src/generated/types/ClaimAttributeInputRepresentation.d.ts +31 -0
  13. package/dist/es/es2018/types/src/generated/types/ClaimAttributesInput.d.ts +29 -0
  14. package/dist/es/es2018/types/src/generated/types/ClaimCoverageRepresentation.d.ts +45 -0
  15. package/dist/es/es2018/types/src/generated/types/ClaimErrorOutputRepresentation.d.ts +31 -0
  16. package/dist/es/es2018/types/src/generated/types/ClaimErrorsOutput.d.ts +29 -0
  17. package/dist/es/es2018/types/src/generated/types/ClaimInputRepresentation.d.ts +71 -0
  18. package/dist/es/es2018/types/src/generated/types/ClaimItemInputRepresentation.d.ts +60 -0
  19. package/dist/es/es2018/types/src/generated/types/ClaimItemsInput.d.ts +29 -0
  20. package/dist/es/es2018/types/src/generated/types/ClaimOptionsInputRepresentation.d.ts +28 -0
  21. package/dist/es/es2018/types/src/generated/types/ClaimParticipantInputRepresentation.d.ts +49 -0
  22. package/dist/es/es2018/types/src/generated/types/ClaimParticipantRolesInput.d.ts +28 -0
  23. package/dist/es/es2018/types/src/generated/types/ClaimParticipantsInput.d.ts +29 -0
  24. package/dist/es/es2018/types/src/generated/types/ClaimRelatedObjectInputRepresentation.d.ts +31 -0
  25. package/dist/es/es2018/types/src/generated/types/ClaimRelatedObjectsInput.d.ts +29 -0
  26. package/dist/es/es2018/types/src/generated/types/CreateClaimCoverageInputRepresentation.d.ts +55 -0
  27. package/dist/es/es2018/types/src/generated/types/CreateClaimOutputRepresentation.d.ts +45 -0
  28. package/dist/es/es2018/types/src/generated/types/ErrorDetail.d.ts +31 -0
  29. package/dist/es/es2018/types/src/generated/types/UpdateClaimCoverageInputRepresentation.d.ts +34 -0
  30. package/dist/es/es2018/types/src/generated/types/type-utils.d.ts +32 -0
  31. package/package.json +66 -0
  32. package/sfdc/index.d.ts +1 -0
  33. package/sfdc/index.js +1149 -0
  34. package/src/raml/api.raml +448 -0
  35. package/src/raml/luvio.raml +41 -0
@@ -0,0 +1,1117 @@
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$3, typeCheckConfig as typeCheckConfig$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
+ 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
+ let obj_attributes_union0 = null;
190
+ const obj_attributes_union0_error = (() => {
191
+ const referencepath_attributesValidationError = validate$b(obj_attributes, path_attributes);
192
+ if (referencepath_attributesValidationError !== null) {
193
+ let message = 'Object doesn\'t match ClaimAttributesInput (at "' + path_attributes + '")\n';
194
+ message += referencepath_attributesValidationError.message.split('\n').map((line) => '\t' + line).join('\n');
195
+ return new TypeError(message);
196
+ }
197
+ })();
198
+ if (obj_attributes_union0_error != null) {
199
+ obj_attributes_union0 = obj_attributes_union0_error.message;
200
+ }
201
+ let obj_attributes_union1 = null;
202
+ const obj_attributes_union1_error = (() => {
203
+ if (obj_attributes !== null) {
204
+ return new TypeError('Expected "null" but received "' + typeof obj_attributes + '" (at "' + path_attributes + '")');
205
+ }
206
+ })();
207
+ if (obj_attributes_union1_error != null) {
208
+ obj_attributes_union1 = obj_attributes_union1_error.message;
209
+ }
210
+ if (obj_attributes_union0 && obj_attributes_union1) {
211
+ let message = 'Object doesn\'t match union (at "' + path_attributes + '")';
212
+ message += '\n' + obj_attributes_union0.split('\n').map((line) => '\t' + line).join('\n');
213
+ message += '\n' + obj_attributes_union1.split('\n').map((line) => '\t' + line).join('\n');
214
+ return new TypeError(message);
215
+ }
216
+ }
217
+ if (obj.category !== undefined) {
218
+ const obj_category = obj.category;
219
+ const path_category = path + '.category';
220
+ let obj_category_union0 = null;
221
+ const obj_category_union0_error = (() => {
222
+ if (typeof obj_category !== 'string') {
223
+ return new TypeError('Expected "string" but received "' + typeof obj_category + '" (at "' + path_category + '")');
224
+ }
225
+ })();
226
+ if (obj_category_union0_error != null) {
227
+ obj_category_union0 = obj_category_union0_error.message;
228
+ }
229
+ let obj_category_union1 = null;
230
+ const obj_category_union1_error = (() => {
231
+ if (obj_category !== null) {
232
+ return new TypeError('Expected "null" but received "' + typeof obj_category + '" (at "' + path_category + '")');
233
+ }
234
+ })();
235
+ if (obj_category_union1_error != null) {
236
+ obj_category_union1 = obj_category_union1_error.message;
237
+ }
238
+ if (obj_category_union0 && obj_category_union1) {
239
+ let message = 'Object doesn\'t match union (at "' + path_category + '")';
240
+ message += '\n' + obj_category_union0.split('\n').map((line) => '\t' + line).join('\n');
241
+ message += '\n' + obj_category_union1.split('\n').map((line) => '\t' + line).join('\n');
242
+ return new TypeError(message);
243
+ }
244
+ }
245
+ const obj_instanceKey = obj.instanceKey;
246
+ const path_instanceKey = path + '.instanceKey';
247
+ if (typeof obj_instanceKey !== 'string') {
248
+ return new TypeError('Expected "string" but received "' + typeof obj_instanceKey + '" (at "' + path_instanceKey + '")');
249
+ }
250
+ if (obj.insurancePolicyCoverageId !== undefined) {
251
+ const obj_insurancePolicyCoverageId = obj.insurancePolicyCoverageId;
252
+ const path_insurancePolicyCoverageId = path + '.insurancePolicyCoverageId';
253
+ let obj_insurancePolicyCoverageId_union0 = null;
254
+ const obj_insurancePolicyCoverageId_union0_error = (() => {
255
+ if (typeof obj_insurancePolicyCoverageId !== 'string') {
256
+ return new TypeError('Expected "string" but received "' + typeof obj_insurancePolicyCoverageId + '" (at "' + path_insurancePolicyCoverageId + '")');
257
+ }
258
+ })();
259
+ if (obj_insurancePolicyCoverageId_union0_error != null) {
260
+ obj_insurancePolicyCoverageId_union0 = obj_insurancePolicyCoverageId_union0_error.message;
261
+ }
262
+ let obj_insurancePolicyCoverageId_union1 = null;
263
+ const obj_insurancePolicyCoverageId_union1_error = (() => {
264
+ if (obj_insurancePolicyCoverageId !== null) {
265
+ return new TypeError('Expected "null" but received "' + typeof obj_insurancePolicyCoverageId + '" (at "' + path_insurancePolicyCoverageId + '")');
266
+ }
267
+ })();
268
+ if (obj_insurancePolicyCoverageId_union1_error != null) {
269
+ obj_insurancePolicyCoverageId_union1 = obj_insurancePolicyCoverageId_union1_error.message;
270
+ }
271
+ if (obj_insurancePolicyCoverageId_union0 && obj_insurancePolicyCoverageId_union1) {
272
+ let message = 'Object doesn\'t match union (at "' + path_insurancePolicyCoverageId + '")';
273
+ message += '\n' + obj_insurancePolicyCoverageId_union0.split('\n').map((line) => '\t' + line).join('\n');
274
+ message += '\n' + obj_insurancePolicyCoverageId_union1.split('\n').map((line) => '\t' + line).join('\n');
275
+ return new TypeError(message);
276
+ }
277
+ }
278
+ if (obj.insuredItemId !== undefined) {
279
+ const obj_insuredItemId = obj.insuredItemId;
280
+ const path_insuredItemId = path + '.insuredItemId';
281
+ let obj_insuredItemId_union0 = null;
282
+ const obj_insuredItemId_union0_error = (() => {
283
+ if (typeof obj_insuredItemId !== 'string') {
284
+ return new TypeError('Expected "string" but received "' + typeof obj_insuredItemId + '" (at "' + path_insuredItemId + '")');
285
+ }
286
+ })();
287
+ if (obj_insuredItemId_union0_error != null) {
288
+ obj_insuredItemId_union0 = obj_insuredItemId_union0_error.message;
289
+ }
290
+ let obj_insuredItemId_union1 = null;
291
+ const obj_insuredItemId_union1_error = (() => {
292
+ if (obj_insuredItemId !== null) {
293
+ return new TypeError('Expected "null" but received "' + typeof obj_insuredItemId + '" (at "' + path_insuredItemId + '")');
294
+ }
295
+ })();
296
+ if (obj_insuredItemId_union1_error != null) {
297
+ obj_insuredItemId_union1 = obj_insuredItemId_union1_error.message;
298
+ }
299
+ if (obj_insuredItemId_union0 && obj_insuredItemId_union1) {
300
+ let message = 'Object doesn\'t match union (at "' + path_insuredItemId + '")';
301
+ message += '\n' + obj_insuredItemId_union0.split('\n').map((line) => '\t' + line).join('\n');
302
+ message += '\n' + obj_insuredItemId_union1.split('\n').map((line) => '\t' + line).join('\n');
303
+ return new TypeError(message);
304
+ }
305
+ }
306
+ if (obj.name !== undefined) {
307
+ const obj_name = obj.name;
308
+ const path_name = path + '.name';
309
+ let obj_name_union0 = null;
310
+ const obj_name_union0_error = (() => {
311
+ if (typeof obj_name !== 'string') {
312
+ return new TypeError('Expected "string" but received "' + typeof obj_name + '" (at "' + path_name + '")');
313
+ }
314
+ })();
315
+ if (obj_name_union0_error != null) {
316
+ obj_name_union0 = obj_name_union0_error.message;
317
+ }
318
+ let obj_name_union1 = null;
319
+ const obj_name_union1_error = (() => {
320
+ if (obj_name !== null) {
321
+ return new TypeError('Expected "null" but received "' + typeof obj_name + '" (at "' + path_name + '")');
322
+ }
323
+ })();
324
+ if (obj_name_union1_error != null) {
325
+ obj_name_union1 = obj_name_union1_error.message;
326
+ }
327
+ if (obj_name_union0 && obj_name_union1) {
328
+ let message = 'Object doesn\'t match union (at "' + path_name + '")';
329
+ message += '\n' + obj_name_union0.split('\n').map((line) => '\t' + line).join('\n');
330
+ message += '\n' + obj_name_union1.split('\n').map((line) => '\t' + line).join('\n');
331
+ return new TypeError(message);
332
+ }
333
+ }
334
+ if (obj.participantInstanceKey !== undefined) {
335
+ const obj_participantInstanceKey = obj.participantInstanceKey;
336
+ const path_participantInstanceKey = path + '.participantInstanceKey';
337
+ let obj_participantInstanceKey_union0 = null;
338
+ const obj_participantInstanceKey_union0_error = (() => {
339
+ if (typeof obj_participantInstanceKey !== 'string') {
340
+ return new TypeError('Expected "string" but received "' + typeof obj_participantInstanceKey + '" (at "' + path_participantInstanceKey + '")');
341
+ }
342
+ })();
343
+ if (obj_participantInstanceKey_union0_error != null) {
344
+ obj_participantInstanceKey_union0 = obj_participantInstanceKey_union0_error.message;
345
+ }
346
+ let obj_participantInstanceKey_union1 = null;
347
+ const obj_participantInstanceKey_union1_error = (() => {
348
+ if (obj_participantInstanceKey !== null) {
349
+ return new TypeError('Expected "null" but received "' + typeof obj_participantInstanceKey + '" (at "' + path_participantInstanceKey + '")');
350
+ }
351
+ })();
352
+ if (obj_participantInstanceKey_union1_error != null) {
353
+ obj_participantInstanceKey_union1 = obj_participantInstanceKey_union1_error.message;
354
+ }
355
+ if (obj_participantInstanceKey_union0 && obj_participantInstanceKey_union1) {
356
+ let message = 'Object doesn\'t match union (at "' + path_participantInstanceKey + '")';
357
+ message += '\n' + obj_participantInstanceKey_union0.split('\n').map((line) => '\t' + line).join('\n');
358
+ message += '\n' + obj_participantInstanceKey_union1.split('\n').map((line) => '\t' + line).join('\n');
359
+ return new TypeError(message);
360
+ }
361
+ }
362
+ if (obj.productCode !== undefined) {
363
+ const obj_productCode = obj.productCode;
364
+ const path_productCode = path + '.productCode';
365
+ let obj_productCode_union0 = null;
366
+ const obj_productCode_union0_error = (() => {
367
+ if (typeof obj_productCode !== 'string') {
368
+ return new TypeError('Expected "string" but received "' + typeof obj_productCode + '" (at "' + path_productCode + '")');
369
+ }
370
+ })();
371
+ if (obj_productCode_union0_error != null) {
372
+ obj_productCode_union0 = obj_productCode_union0_error.message;
373
+ }
374
+ let obj_productCode_union1 = null;
375
+ const obj_productCode_union1_error = (() => {
376
+ if (obj_productCode !== null) {
377
+ return new TypeError('Expected "null" but received "' + typeof obj_productCode + '" (at "' + path_productCode + '")');
378
+ }
379
+ })();
380
+ if (obj_productCode_union1_error != null) {
381
+ obj_productCode_union1 = obj_productCode_union1_error.message;
382
+ }
383
+ if (obj_productCode_union0 && obj_productCode_union1) {
384
+ let message = 'Object doesn\'t match union (at "' + path_productCode + '")';
385
+ message += '\n' + obj_productCode_union0.split('\n').map((line) => '\t' + line).join('\n');
386
+ message += '\n' + obj_productCode_union1.split('\n').map((line) => '\t' + line).join('\n');
387
+ return new TypeError(message);
388
+ }
389
+ }
390
+ if (obj.relatedObjects !== undefined) {
391
+ const obj_relatedObjects = obj.relatedObjects;
392
+ const path_relatedObjects = path + '.relatedObjects';
393
+ let obj_relatedObjects_union0 = null;
394
+ const obj_relatedObjects_union0_error = (() => {
395
+ const referencepath_relatedObjectsValidationError = validate$9(obj_relatedObjects, path_relatedObjects);
396
+ if (referencepath_relatedObjectsValidationError !== null) {
397
+ let message = 'Object doesn\'t match ClaimRelatedObjectsInput (at "' + path_relatedObjects + '")\n';
398
+ message += referencepath_relatedObjectsValidationError.message.split('\n').map((line) => '\t' + line).join('\n');
399
+ return new TypeError(message);
400
+ }
401
+ })();
402
+ if (obj_relatedObjects_union0_error != null) {
403
+ obj_relatedObjects_union0 = obj_relatedObjects_union0_error.message;
404
+ }
405
+ let obj_relatedObjects_union1 = null;
406
+ const obj_relatedObjects_union1_error = (() => {
407
+ if (obj_relatedObjects !== null) {
408
+ return new TypeError('Expected "null" but received "' + typeof obj_relatedObjects + '" (at "' + path_relatedObjects + '")');
409
+ }
410
+ })();
411
+ if (obj_relatedObjects_union1_error != null) {
412
+ obj_relatedObjects_union1 = obj_relatedObjects_union1_error.message;
413
+ }
414
+ if (obj_relatedObjects_union0 && obj_relatedObjects_union1) {
415
+ let message = 'Object doesn\'t match union (at "' + path_relatedObjects + '")';
416
+ message += '\n' + obj_relatedObjects_union0.split('\n').map((line) => '\t' + line).join('\n');
417
+ message += '\n' + obj_relatedObjects_union1.split('\n').map((line) => '\t' + line).join('\n');
418
+ return new TypeError(message);
419
+ }
420
+ }
421
+ })();
422
+ return v_error === undefined ? null : v_error;
423
+ }
424
+
425
+ function validate$7(obj, path = 'ClaimItemsInput') {
426
+ const v_error = (() => {
427
+ if (typeof obj !== 'object' || ArrayIsArray(obj) || obj === null) {
428
+ return new TypeError('Expected "object" but received "' + typeof obj + '" (at "' + path + '")');
429
+ }
430
+ const obj_list = obj.list;
431
+ const path_list = path + '.list';
432
+ if (!ArrayIsArray(obj_list)) {
433
+ return new TypeError('Expected "array" but received "' + typeof obj_list + '" (at "' + path_list + '")');
434
+ }
435
+ for (let i = 0; i < obj_list.length; i++) {
436
+ const obj_list_item = obj_list[i];
437
+ const path_list_item = path_list + '[' + i + ']';
438
+ const referencepath_list_itemValidationError = validate$8(obj_list_item, path_list_item);
439
+ if (referencepath_list_itemValidationError !== null) {
440
+ let message = 'Object doesn\'t match ClaimItemInputRepresentation (at "' + path_list_item + '")\n';
441
+ message += referencepath_list_itemValidationError.message.split('\n').map((line) => '\t' + line).join('\n');
442
+ return new TypeError(message);
443
+ }
444
+ }
445
+ })();
446
+ return v_error === undefined ? null : v_error;
447
+ }
448
+
449
+ function validate$6(obj, path = 'ClaimParticipantRolesInput') {
450
+ const v_error = (() => {
451
+ if (typeof obj !== 'object' || ArrayIsArray(obj) || obj === null) {
452
+ return new TypeError('Expected "object" but received "' + typeof obj + '" (at "' + path + '")');
453
+ }
454
+ if (obj.list !== undefined) {
455
+ const obj_list = obj.list;
456
+ const path_list = path + '.list';
457
+ if (!ArrayIsArray(obj_list)) {
458
+ return new TypeError('Expected "array" but received "' + typeof obj_list + '" (at "' + path_list + '")');
459
+ }
460
+ for (let i = 0; i < obj_list.length; i++) {
461
+ const obj_list_item = obj_list[i];
462
+ const path_list_item = path_list + '[' + i + ']';
463
+ if (typeof obj_list_item !== 'string') {
464
+ return new TypeError('Expected "string" but received "' + typeof obj_list_item + '" (at "' + path_list_item + '")');
465
+ }
466
+ }
467
+ }
468
+ })();
469
+ return v_error === undefined ? null : v_error;
470
+ }
471
+
472
+ function validate$5(obj, path = 'ClaimParticipantInputRepresentation') {
473
+ const v_error = (() => {
474
+ if (typeof obj !== 'object' || ArrayIsArray(obj) || obj === null) {
475
+ return new TypeError('Expected "object" but received "' + typeof obj + '" (at "' + path + '")');
476
+ }
477
+ if (obj.accountId !== undefined) {
478
+ const obj_accountId = obj.accountId;
479
+ const path_accountId = path + '.accountId';
480
+ if (typeof obj_accountId !== 'string') {
481
+ return new TypeError('Expected "string" but received "' + typeof obj_accountId + '" (at "' + path_accountId + '")');
482
+ }
483
+ }
484
+ const obj_action = obj.action;
485
+ const path_action = path + '.action';
486
+ if (typeof obj_action !== 'string') {
487
+ return new TypeError('Expected "string" but received "' + typeof obj_action + '" (at "' + path_action + '")');
488
+ }
489
+ if (obj.additionalFields !== undefined) {
490
+ const obj_additionalFields = obj.additionalFields;
491
+ const path_additionalFields = path + '.additionalFields';
492
+ if (obj_additionalFields === undefined) {
493
+ return new TypeError('Expected "defined" but received "' + typeof obj_additionalFields + '" (at "' + path_additionalFields + '")');
494
+ }
495
+ }
496
+ if (obj.contactId !== undefined) {
497
+ const obj_contactId = obj.contactId;
498
+ const path_contactId = path + '.contactId';
499
+ if (typeof obj_contactId !== 'string') {
500
+ return new TypeError('Expected "string" but received "' + typeof obj_contactId + '" (at "' + path_contactId + '")');
501
+ }
502
+ }
503
+ const obj_instanceKey = obj.instanceKey;
504
+ const path_instanceKey = path + '.instanceKey';
505
+ if (typeof obj_instanceKey !== 'string') {
506
+ return new TypeError('Expected "string" but received "' + typeof obj_instanceKey + '" (at "' + path_instanceKey + '")');
507
+ }
508
+ if (obj.insurancePolicyParticipantId !== undefined) {
509
+ const obj_insurancePolicyParticipantId = obj.insurancePolicyParticipantId;
510
+ const path_insurancePolicyParticipantId = path + '.insurancePolicyParticipantId';
511
+ if (typeof obj_insurancePolicyParticipantId !== 'string') {
512
+ return new TypeError('Expected "string" but received "' + typeof obj_insurancePolicyParticipantId + '" (at "' + path_insurancePolicyParticipantId + '")');
513
+ }
514
+ }
515
+ if (obj.isInjured !== undefined) {
516
+ const obj_isInjured = obj.isInjured;
517
+ const path_isInjured = path + '.isInjured';
518
+ if (typeof obj_isInjured !== 'string') {
519
+ return new TypeError('Expected "string" but received "' + typeof obj_isInjured + '" (at "' + path_isInjured + '")');
520
+ }
521
+ }
522
+ if (obj.roles !== undefined) {
523
+ const obj_roles = obj.roles;
524
+ const path_roles = path + '.roles';
525
+ const referencepath_rolesValidationError = validate$6(obj_roles, path_roles);
526
+ if (referencepath_rolesValidationError !== null) {
527
+ let message = 'Object doesn\'t match ClaimParticipantRolesInput (at "' + path_roles + '")\n';
528
+ message += referencepath_rolesValidationError.message.split('\n').map((line) => '\t' + line).join('\n');
529
+ return new TypeError(message);
530
+ }
531
+ }
532
+ })();
533
+ return v_error === undefined ? null : v_error;
534
+ }
535
+
536
+ function validate$4(obj, path = 'ClaimParticipantsInput') {
537
+ const v_error = (() => {
538
+ if (typeof obj !== 'object' || ArrayIsArray(obj) || obj === null) {
539
+ return new TypeError('Expected "object" but received "' + typeof obj + '" (at "' + path + '")');
540
+ }
541
+ const obj_list = obj.list;
542
+ const path_list = path + '.list';
543
+ if (!ArrayIsArray(obj_list)) {
544
+ return new TypeError('Expected "array" but received "' + typeof obj_list + '" (at "' + path_list + '")');
545
+ }
546
+ for (let i = 0; i < obj_list.length; i++) {
547
+ const obj_list_item = obj_list[i];
548
+ const path_list_item = path_list + '[' + i + ']';
549
+ const referencepath_list_itemValidationError = validate$5(obj_list_item, path_list_item);
550
+ if (referencepath_list_itemValidationError !== null) {
551
+ let message = 'Object doesn\'t match ClaimParticipantInputRepresentation (at "' + path_list_item + '")\n';
552
+ message += referencepath_list_itemValidationError.message.split('\n').map((line) => '\t' + line).join('\n');
553
+ return new TypeError(message);
554
+ }
555
+ }
556
+ })();
557
+ return v_error === undefined ? null : v_error;
558
+ }
559
+
560
+ function validate$3(obj, path = 'ClaimErrorOutputRepresentation') {
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_code = obj.code;
566
+ const path_code = path + '.code';
567
+ if (typeof obj_code !== 'string') {
568
+ return new TypeError('Expected "string" but received "' + typeof obj_code + '" (at "' + path_code + '")');
569
+ }
570
+ const obj_message = obj.message;
571
+ const path_message = path + '.message';
572
+ if (typeof obj_message !== 'string') {
573
+ return new TypeError('Expected "string" but received "' + typeof obj_message + '" (at "' + path_message + '")');
574
+ }
575
+ })();
576
+ return v_error === undefined ? null : v_error;
577
+ }
578
+
579
+ const TTL$1 = 1000;
580
+ const VERSION$1 = "a2761ec24de7405a85015297b44aa3cf";
581
+ function validate$2(obj, path = 'CreateClaimOutputRepresentation') {
582
+ const v_error = (() => {
583
+ if (typeof obj !== 'object' || ArrayIsArray(obj) || obj === null) {
584
+ return new TypeError('Expected "object" but received "' + typeof obj + '" (at "' + path + '")');
585
+ }
586
+ if (obj.claimId !== undefined) {
587
+ const obj_claimId = obj.claimId;
588
+ const path_claimId = path + '.claimId';
589
+ let obj_claimId_union0 = null;
590
+ const obj_claimId_union0_error = (() => {
591
+ if (typeof obj_claimId !== 'string') {
592
+ return new TypeError('Expected "string" but received "' + typeof obj_claimId + '" (at "' + path_claimId + '")');
593
+ }
594
+ })();
595
+ if (obj_claimId_union0_error != null) {
596
+ obj_claimId_union0 = obj_claimId_union0_error.message;
597
+ }
598
+ let obj_claimId_union1 = null;
599
+ const obj_claimId_union1_error = (() => {
600
+ if (obj_claimId !== null) {
601
+ return new TypeError('Expected "null" but received "' + typeof obj_claimId + '" (at "' + path_claimId + '")');
602
+ }
603
+ })();
604
+ if (obj_claimId_union1_error != null) {
605
+ obj_claimId_union1 = obj_claimId_union1_error.message;
606
+ }
607
+ if (obj_claimId_union0 && obj_claimId_union1) {
608
+ let message = 'Object doesn\'t match union (at "' + path_claimId + '")';
609
+ message += '\n' + obj_claimId_union0.split('\n').map((line) => '\t' + line).join('\n');
610
+ message += '\n' + obj_claimId_union1.split('\n').map((line) => '\t' + line).join('\n');
611
+ return new TypeError(message);
612
+ }
613
+ }
614
+ if (obj.errors !== undefined) {
615
+ const obj_errors = obj.errors;
616
+ const path_errors = path + '.errors';
617
+ if (!ArrayIsArray(obj_errors)) {
618
+ return new TypeError('Expected "array" but received "' + typeof obj_errors + '" (at "' + path_errors + '")');
619
+ }
620
+ for (let i = 0; i < obj_errors.length; i++) {
621
+ const obj_errors_item = obj_errors[i];
622
+ const path_errors_item = path_errors + '[' + i + ']';
623
+ const referencepath_errors_itemValidationError = validate$3(obj_errors_item, path_errors_item);
624
+ if (referencepath_errors_itemValidationError !== null) {
625
+ let message = 'Object doesn\'t match ClaimErrorOutputRepresentation (at "' + path_errors_item + '")\n';
626
+ message += referencepath_errors_itemValidationError.message.split('\n').map((line) => '\t' + line).join('\n');
627
+ return new TypeError(message);
628
+ }
629
+ }
630
+ }
631
+ const obj_isSuccess = obj.isSuccess;
632
+ const path_isSuccess = path + '.isSuccess';
633
+ if (typeof obj_isSuccess !== 'boolean') {
634
+ return new TypeError('Expected "boolean" but received "' + typeof obj_isSuccess + '" (at "' + path_isSuccess + '")');
635
+ }
636
+ })();
637
+ return v_error === undefined ? null : v_error;
638
+ }
639
+ const RepresentationType$1 = 'CreateClaimOutputRepresentation';
640
+ function keyBuilder$1(luvio, config) {
641
+ return keyPrefix + '::' + RepresentationType$1 + ':' + config.isSuccess;
642
+ }
643
+ function keyBuilderFromType$1(luvio, object) {
644
+ const keyParams = {
645
+ isSuccess: object.isSuccess
646
+ };
647
+ return keyBuilder$1(luvio, keyParams);
648
+ }
649
+ function normalize$1(input, existing, path, luvio, store, timestamp) {
650
+ return input;
651
+ }
652
+ const select$4 = function CreateClaimOutputRepresentationSelect() {
653
+ return {
654
+ kind: 'Fragment',
655
+ version: VERSION$1,
656
+ private: [],
657
+ opaque: true
658
+ };
659
+ };
660
+ function equals$1(existing, incoming) {
661
+ if (JSONStringify(incoming) !== JSONStringify(existing)) {
662
+ return false;
663
+ }
664
+ return true;
665
+ }
666
+ const ingest$1 = function CreateClaimOutputRepresentationIngest(input, path, luvio, store, timestamp) {
667
+ if (process.env.NODE_ENV !== 'production') {
668
+ const validateError = validate$2(input);
669
+ if (validateError !== null) {
670
+ throw validateError;
671
+ }
672
+ }
673
+ const key = keyBuilderFromType$1(luvio, input);
674
+ const ttlToUse = TTL$1;
675
+ ingestShape(input, path, luvio, store, timestamp, ttlToUse, key, normalize$1, "Claim", VERSION$1, RepresentationType$1, equals$1);
676
+ return createLink(key);
677
+ };
678
+ function getTypeCacheKeys$1(rootKeySet, luvio, input, fullPathFactory) {
679
+ // root cache key (uses fullPathFactory if keyBuilderFromType isn't defined)
680
+ const rootKey = keyBuilderFromType$1(luvio, input);
681
+ rootKeySet.set(rootKey, {
682
+ namespace: keyPrefix,
683
+ representationName: RepresentationType$1,
684
+ mergeable: false
685
+ });
686
+ }
687
+
688
+ function select$3(luvio, params) {
689
+ return select$4();
690
+ }
691
+ function getResponseCacheKeys$2(storeKeyMap, luvio, resourceParams, response) {
692
+ getTypeCacheKeys$1(storeKeyMap, luvio, response);
693
+ }
694
+ function ingestSuccess$2(luvio, resourceParams, response) {
695
+ const { body } = response;
696
+ const key = keyBuilderFromType$1(luvio, body);
697
+ luvio.storeIngest(key, ingest$1, body);
698
+ const snapshot = luvio.storeLookup({
699
+ recordId: key,
700
+ node: select$3(),
701
+ variables: {},
702
+ });
703
+ if (process.env.NODE_ENV !== 'production') {
704
+ if (snapshot.state !== 'Fulfilled') {
705
+ throw new Error('Invalid network response. Expected resource response to result in Fulfilled snapshot');
706
+ }
707
+ }
708
+ deepFreeze(snapshot.data);
709
+ return snapshot;
710
+ }
711
+ function createResourceRequest$2(config) {
712
+ const headers = {};
713
+ return {
714
+ baseUri: '/services/data/v66.0',
715
+ basePath: '/connect/claims/' + config.urlParams.claimId + '',
716
+ method: 'patch',
717
+ body: config.body,
718
+ urlParams: config.urlParams,
719
+ queryParams: {},
720
+ headers,
721
+ priority: 'normal',
722
+ };
723
+ }
724
+
725
+ const adapterName$2 = 'UpdateClaim';
726
+ const UpdateClaim_ConfigPropertyMetadata = [
727
+ generateParamConfigMetadata('claimId', true, 0 /* UrlParameter */, 0 /* String */),
728
+ generateParamConfigMetadata('accountId', false, 2 /* Body */, 0 /* String */),
729
+ generateParamConfigMetadata('additionalFields', false, 2 /* Body */, 4 /* Unsupported */),
730
+ generateParamConfigMetadata('attributes', false, 2 /* Body */, 4 /* Unsupported */),
731
+ generateParamConfigMetadata('claimReason', false, 2 /* Body */, 0 /* String */),
732
+ generateParamConfigMetadata('claimReasonType', false, 2 /* Body */, 0 /* String */),
733
+ generateParamConfigMetadata('claimType', false, 2 /* Body */, 0 /* String */),
734
+ generateParamConfigMetadata('incidentTypeId', false, 2 /* Body */, 0 /* String */),
735
+ generateParamConfigMetadata('insurancePolicyId', false, 2 /* Body */, 0 /* String */),
736
+ generateParamConfigMetadata('items', false, 2 /* Body */, 4 /* Unsupported */),
737
+ generateParamConfigMetadata('lossDate', false, 2 /* Body */, 0 /* String */),
738
+ generateParamConfigMetadata('lossType', false, 2 /* Body */, 0 /* String */),
739
+ generateParamConfigMetadata('name', false, 2 /* Body */, 0 /* String */),
740
+ generateParamConfigMetadata('options', false, 2 /* Body */, 4 /* Unsupported */),
741
+ generateParamConfigMetadata('participants', false, 2 /* Body */, 4 /* Unsupported */),
742
+ generateParamConfigMetadata('productCode', false, 2 /* Body */, 0 /* String */),
743
+ ];
744
+ const UpdateClaim_ConfigPropertyNames = /*#__PURE__*/ buildAdapterValidationConfig(adapterName$2, UpdateClaim_ConfigPropertyMetadata);
745
+ const createResourceParams$2 = /*#__PURE__*/ createResourceParams$3(UpdateClaim_ConfigPropertyMetadata);
746
+ function typeCheckConfig$2(untrustedConfig) {
747
+ const config = {};
748
+ typeCheckConfig$3(untrustedConfig, config, UpdateClaim_ConfigPropertyMetadata);
749
+ const untrustedConfig_additionalFields = untrustedConfig.additionalFields;
750
+ config.additionalFields = untrustedConfig_additionalFields;
751
+ const untrustedConfig_attributes = untrustedConfig.attributes;
752
+ const referenceClaimAttributesInputValidationError = validate$b(untrustedConfig_attributes);
753
+ if (referenceClaimAttributesInputValidationError === null) {
754
+ config.attributes = untrustedConfig_attributes;
755
+ }
756
+ const untrustedConfig_items = untrustedConfig.items;
757
+ const referenceClaimItemsInputValidationError = validate$7(untrustedConfig_items);
758
+ if (referenceClaimItemsInputValidationError === null) {
759
+ config.items = untrustedConfig_items;
760
+ }
761
+ const untrustedConfig_options = untrustedConfig.options;
762
+ config.options = untrustedConfig_options;
763
+ const untrustedConfig_participants = untrustedConfig.participants;
764
+ const referenceClaimParticipantsInputValidationError = validate$4(untrustedConfig_participants);
765
+ if (referenceClaimParticipantsInputValidationError === null) {
766
+ config.participants = untrustedConfig_participants;
767
+ }
768
+ return config;
769
+ }
770
+ function validateAdapterConfig$2(untrustedConfig, configPropertyNames) {
771
+ if (!untrustedIsObject(untrustedConfig)) {
772
+ return null;
773
+ }
774
+ if (process.env.NODE_ENV !== 'production') {
775
+ validateConfig(untrustedConfig, configPropertyNames);
776
+ }
777
+ const config = typeCheckConfig$2(untrustedConfig);
778
+ if (!areRequiredParametersPresent(config, configPropertyNames)) {
779
+ return null;
780
+ }
781
+ return config;
782
+ }
783
+ function buildNetworkSnapshot$2(luvio, config, options) {
784
+ const resourceParams = createResourceParams$2(config);
785
+ const request = createResourceRequest$2(resourceParams);
786
+ return luvio.dispatchResourceRequest(request, options)
787
+ .then((response) => {
788
+ return luvio.handleSuccessResponse(() => {
789
+ const snapshot = ingestSuccess$2(luvio, resourceParams, response);
790
+ return luvio.storeBroadcast().then(() => snapshot);
791
+ }, () => {
792
+ const cache = new StoreKeyMap();
793
+ getResponseCacheKeys$2(cache, luvio, resourceParams, response.body);
794
+ return cache;
795
+ });
796
+ }, (response) => {
797
+ deepFreeze(response);
798
+ throw response;
799
+ });
800
+ }
801
+ const UpdateClaimAdapterFactory = (luvio) => {
802
+ return function UpdateClaim(untrustedConfig) {
803
+ const config = validateAdapterConfig$2(untrustedConfig, UpdateClaim_ConfigPropertyNames);
804
+ // Invalid or incomplete config
805
+ if (config === null) {
806
+ throw new Error('Invalid config for "UpdateClaim"');
807
+ }
808
+ return buildNetworkSnapshot$2(luvio, config);
809
+ };
810
+ };
811
+
812
+ function validate$1(obj, path = 'ErrorDetail') {
813
+ const v_error = (() => {
814
+ if (typeof obj !== 'object' || ArrayIsArray(obj) || obj === null) {
815
+ return new TypeError('Expected "object" but received "' + typeof obj + '" (at "' + path + '")');
816
+ }
817
+ const obj_code = obj.code;
818
+ const path_code = path + '.code';
819
+ if (typeof obj_code !== 'string') {
820
+ return new TypeError('Expected "string" but received "' + typeof obj_code + '" (at "' + path_code + '")');
821
+ }
822
+ const obj_message = obj.message;
823
+ const path_message = path + '.message';
824
+ if (typeof obj_message !== 'string') {
825
+ return new TypeError('Expected "string" but received "' + typeof obj_message + '" (at "' + path_message + '")');
826
+ }
827
+ })();
828
+ return v_error === undefined ? null : v_error;
829
+ }
830
+
831
+ const TTL = 1000;
832
+ const VERSION = "452fa1d606be2ab752c4163290746f63";
833
+ function validate(obj, path = 'ClaimCoverageRepresentation') {
834
+ const v_error = (() => {
835
+ if (typeof obj !== 'object' || ArrayIsArray(obj) || obj === null) {
836
+ return new TypeError('Expected "object" but received "' + typeof obj + '" (at "' + path + '")');
837
+ }
838
+ if (obj.coverageId !== undefined) {
839
+ const obj_coverageId = obj.coverageId;
840
+ const path_coverageId = path + '.coverageId';
841
+ if (typeof obj_coverageId !== 'string') {
842
+ return new TypeError('Expected "string" but received "' + typeof obj_coverageId + '" (at "' + path_coverageId + '")');
843
+ }
844
+ }
845
+ if (obj.errors !== undefined) {
846
+ const obj_errors = obj.errors;
847
+ const path_errors = path + '.errors';
848
+ if (!ArrayIsArray(obj_errors)) {
849
+ return new TypeError('Expected "array" but received "' + typeof obj_errors + '" (at "' + path_errors + '")');
850
+ }
851
+ for (let i = 0; i < obj_errors.length; i++) {
852
+ const obj_errors_item = obj_errors[i];
853
+ const path_errors_item = path_errors + '[' + i + ']';
854
+ const referencepath_errors_itemValidationError = validate$1(obj_errors_item, path_errors_item);
855
+ if (referencepath_errors_itemValidationError !== null) {
856
+ let message = 'Object doesn\'t match ErrorDetail (at "' + path_errors_item + '")\n';
857
+ message += referencepath_errors_itemValidationError.message.split('\n').map((line) => '\t' + line).join('\n');
858
+ return new TypeError(message);
859
+ }
860
+ }
861
+ }
862
+ const obj_isSuccess = obj.isSuccess;
863
+ const path_isSuccess = path + '.isSuccess';
864
+ if (typeof obj_isSuccess !== 'boolean') {
865
+ return new TypeError('Expected "boolean" but received "' + typeof obj_isSuccess + '" (at "' + path_isSuccess + '")');
866
+ }
867
+ })();
868
+ return v_error === undefined ? null : v_error;
869
+ }
870
+ const RepresentationType = 'ClaimCoverageRepresentation';
871
+ function keyBuilder(luvio, config) {
872
+ return keyPrefix + '::' + RepresentationType + ':' + config.isSuccess;
873
+ }
874
+ function keyBuilderFromType(luvio, object) {
875
+ const keyParams = {
876
+ isSuccess: object.isSuccess
877
+ };
878
+ return keyBuilder(luvio, keyParams);
879
+ }
880
+ function normalize(input, existing, path, luvio, store, timestamp) {
881
+ return input;
882
+ }
883
+ const select$2 = function ClaimCoverageRepresentationSelect() {
884
+ return {
885
+ kind: 'Fragment',
886
+ version: VERSION,
887
+ private: [],
888
+ opaque: true
889
+ };
890
+ };
891
+ function equals(existing, incoming) {
892
+ if (JSONStringify(incoming) !== JSONStringify(existing)) {
893
+ return false;
894
+ }
895
+ return true;
896
+ }
897
+ const ingest = function ClaimCoverageRepresentationIngest(input, path, luvio, store, timestamp) {
898
+ if (process.env.NODE_ENV !== 'production') {
899
+ const validateError = validate(input);
900
+ if (validateError !== null) {
901
+ throw validateError;
902
+ }
903
+ }
904
+ const key = keyBuilderFromType(luvio, input);
905
+ const ttlToUse = TTL;
906
+ ingestShape(input, path, luvio, store, timestamp, ttlToUse, key, normalize, "Claim", VERSION, RepresentationType, equals);
907
+ return createLink(key);
908
+ };
909
+ function getTypeCacheKeys(rootKeySet, luvio, input, fullPathFactory) {
910
+ // root cache key (uses fullPathFactory if keyBuilderFromType isn't defined)
911
+ const rootKey = keyBuilderFromType(luvio, input);
912
+ rootKeySet.set(rootKey, {
913
+ namespace: keyPrefix,
914
+ representationName: RepresentationType,
915
+ mergeable: false
916
+ });
917
+ }
918
+
919
+ function select$1(luvio, params) {
920
+ return select$2();
921
+ }
922
+ function getResponseCacheKeys$1(storeKeyMap, luvio, resourceParams, response) {
923
+ getTypeCacheKeys(storeKeyMap, luvio, response);
924
+ }
925
+ function ingestSuccess$1(luvio, resourceParams, response) {
926
+ const { body } = response;
927
+ const key = keyBuilderFromType(luvio, body);
928
+ luvio.storeIngest(key, ingest, body);
929
+ const snapshot = luvio.storeLookup({
930
+ recordId: key,
931
+ node: select$1(),
932
+ variables: {},
933
+ });
934
+ if (process.env.NODE_ENV !== 'production') {
935
+ if (snapshot.state !== 'Fulfilled') {
936
+ throw new Error('Invalid network response. Expected resource response to result in Fulfilled snapshot');
937
+ }
938
+ }
939
+ deepFreeze(snapshot.data);
940
+ return snapshot;
941
+ }
942
+ function createResourceRequest$1(config) {
943
+ const headers = {};
944
+ return {
945
+ baseUri: '/services/data/v66.0',
946
+ basePath: '/connect/claims/' + config.urlParams.claimId + '/coverages',
947
+ method: 'post',
948
+ body: config.body,
949
+ urlParams: config.urlParams,
950
+ queryParams: {},
951
+ headers,
952
+ priority: 'normal',
953
+ };
954
+ }
955
+
956
+ const adapterName$1 = 'CreateClaimCoverage';
957
+ const CreateClaimCoverage_ConfigPropertyMetadata = [
958
+ generateParamConfigMetadata('claimId', true, 0 /* UrlParameter */, 0 /* String */),
959
+ generateParamConfigMetadata('additionalFields', false, 2 /* Body */, 4 /* Unsupported */),
960
+ generateParamConfigMetadata('claimItemId', true, 2 /* Body */, 0 /* String */),
961
+ generateParamConfigMetadata('claimParticipantId', true, 2 /* Body */, 0 /* String */),
962
+ generateParamConfigMetadata('currencyIsoCode', false, 2 /* Body */, 0 /* String */),
963
+ generateParamConfigMetadata('expenseReserveAmount', false, 2 /* Body */, 2 /* Number */),
964
+ generateParamConfigMetadata('insurancePolicyAssetId', false, 2 /* Body */, 0 /* String */),
965
+ generateParamConfigMetadata('insurancePolicyCoverageId', false, 2 /* Body */, 0 /* String */),
966
+ generateParamConfigMetadata('lossReserveAmount', false, 2 /* Body */, 2 /* Number */),
967
+ generateParamConfigMetadata('name', false, 2 /* Body */, 0 /* String */),
968
+ generateParamConfigMetadata('reserveProcessingMode', true, 2 /* Body */, 0 /* String */),
969
+ ];
970
+ const CreateClaimCoverage_ConfigPropertyNames = /*#__PURE__*/ buildAdapterValidationConfig(adapterName$1, CreateClaimCoverage_ConfigPropertyMetadata);
971
+ const createResourceParams$1 = /*#__PURE__*/ createResourceParams$3(CreateClaimCoverage_ConfigPropertyMetadata);
972
+ function typeCheckConfig$1(untrustedConfig) {
973
+ const config = {};
974
+ typeCheckConfig$3(untrustedConfig, config, CreateClaimCoverage_ConfigPropertyMetadata);
975
+ const untrustedConfig_additionalFields = untrustedConfig.additionalFields;
976
+ config.additionalFields = untrustedConfig_additionalFields;
977
+ return config;
978
+ }
979
+ function validateAdapterConfig$1(untrustedConfig, configPropertyNames) {
980
+ if (!untrustedIsObject(untrustedConfig)) {
981
+ return null;
982
+ }
983
+ if (process.env.NODE_ENV !== 'production') {
984
+ validateConfig(untrustedConfig, configPropertyNames);
985
+ }
986
+ const config = typeCheckConfig$1(untrustedConfig);
987
+ if (!areRequiredParametersPresent(config, configPropertyNames)) {
988
+ return null;
989
+ }
990
+ return config;
991
+ }
992
+ function buildNetworkSnapshot$1(luvio, config, options) {
993
+ const resourceParams = createResourceParams$1(config);
994
+ const request = createResourceRequest$1(resourceParams);
995
+ return luvio.dispatchResourceRequest(request, options)
996
+ .then((response) => {
997
+ return luvio.handleSuccessResponse(() => {
998
+ const snapshot = ingestSuccess$1(luvio, resourceParams, response);
999
+ return luvio.storeBroadcast().then(() => snapshot);
1000
+ }, () => {
1001
+ const cache = new StoreKeyMap();
1002
+ getResponseCacheKeys$1(cache, luvio, resourceParams, response.body);
1003
+ return cache;
1004
+ });
1005
+ }, (response) => {
1006
+ deepFreeze(response);
1007
+ throw response;
1008
+ });
1009
+ }
1010
+ const CreateClaimCoverageAdapterFactory = (luvio) => {
1011
+ return function CreateClaimCoverage(untrustedConfig) {
1012
+ const config = validateAdapterConfig$1(untrustedConfig, CreateClaimCoverage_ConfigPropertyNames);
1013
+ // Invalid or incomplete config
1014
+ if (config === null) {
1015
+ throw new Error('Invalid config for "CreateClaimCoverage"');
1016
+ }
1017
+ return buildNetworkSnapshot$1(luvio, config);
1018
+ };
1019
+ };
1020
+
1021
+ function select(luvio, params) {
1022
+ return select$2();
1023
+ }
1024
+ function getResponseCacheKeys(storeKeyMap, luvio, resourceParams, response) {
1025
+ getTypeCacheKeys(storeKeyMap, luvio, response);
1026
+ }
1027
+ function ingestSuccess(luvio, resourceParams, response) {
1028
+ const { body } = response;
1029
+ const key = keyBuilderFromType(luvio, body);
1030
+ luvio.storeIngest(key, ingest, body);
1031
+ const snapshot = luvio.storeLookup({
1032
+ recordId: key,
1033
+ node: select(),
1034
+ variables: {},
1035
+ });
1036
+ if (process.env.NODE_ENV !== 'production') {
1037
+ if (snapshot.state !== 'Fulfilled') {
1038
+ throw new Error('Invalid network response. Expected resource response to result in Fulfilled snapshot');
1039
+ }
1040
+ }
1041
+ deepFreeze(snapshot.data);
1042
+ return snapshot;
1043
+ }
1044
+ function createResourceRequest(config) {
1045
+ const headers = {};
1046
+ return {
1047
+ baseUri: '/services/data/v66.0',
1048
+ basePath: '/connect/claims/' + config.urlParams.claimId + '/coverages/' + config.urlParams.coverageId + '',
1049
+ method: 'patch',
1050
+ body: config.body,
1051
+ urlParams: config.urlParams,
1052
+ queryParams: {},
1053
+ headers,
1054
+ priority: 'normal',
1055
+ };
1056
+ }
1057
+
1058
+ const adapterName = 'UpdateClaimCoverage';
1059
+ const UpdateClaimCoverage_ConfigPropertyMetadata = [
1060
+ generateParamConfigMetadata('claimId', true, 0 /* UrlParameter */, 0 /* String */),
1061
+ generateParamConfigMetadata('coverageId', true, 0 /* UrlParameter */, 0 /* String */),
1062
+ generateParamConfigMetadata('additionalFields', false, 2 /* Body */, 4 /* Unsupported */),
1063
+ generateParamConfigMetadata('expenseReserveAmount', false, 2 /* Body */, 2 /* Number */),
1064
+ generateParamConfigMetadata('lossReserveAmount', false, 2 /* Body */, 2 /* Number */),
1065
+ ];
1066
+ const UpdateClaimCoverage_ConfigPropertyNames = /*#__PURE__*/ buildAdapterValidationConfig(adapterName, UpdateClaimCoverage_ConfigPropertyMetadata);
1067
+ const createResourceParams = /*#__PURE__*/ createResourceParams$3(UpdateClaimCoverage_ConfigPropertyMetadata);
1068
+ function typeCheckConfig(untrustedConfig) {
1069
+ const config = {};
1070
+ typeCheckConfig$3(untrustedConfig, config, UpdateClaimCoverage_ConfigPropertyMetadata);
1071
+ const untrustedConfig_additionalFields = untrustedConfig.additionalFields;
1072
+ config.additionalFields = untrustedConfig_additionalFields;
1073
+ return config;
1074
+ }
1075
+ function validateAdapterConfig(untrustedConfig, configPropertyNames) {
1076
+ if (!untrustedIsObject(untrustedConfig)) {
1077
+ return null;
1078
+ }
1079
+ if (process.env.NODE_ENV !== 'production') {
1080
+ validateConfig(untrustedConfig, configPropertyNames);
1081
+ }
1082
+ const config = typeCheckConfig(untrustedConfig);
1083
+ if (!areRequiredParametersPresent(config, configPropertyNames)) {
1084
+ return null;
1085
+ }
1086
+ return config;
1087
+ }
1088
+ function buildNetworkSnapshot(luvio, config, options) {
1089
+ const resourceParams = createResourceParams(config);
1090
+ const request = createResourceRequest(resourceParams);
1091
+ return luvio.dispatchResourceRequest(request, options)
1092
+ .then((response) => {
1093
+ return luvio.handleSuccessResponse(() => {
1094
+ const snapshot = ingestSuccess(luvio, resourceParams, response);
1095
+ return luvio.storeBroadcast().then(() => snapshot);
1096
+ }, () => {
1097
+ const cache = new StoreKeyMap();
1098
+ getResponseCacheKeys(cache, luvio, resourceParams, response.body);
1099
+ return cache;
1100
+ });
1101
+ }, (response) => {
1102
+ deepFreeze(response);
1103
+ throw response;
1104
+ });
1105
+ }
1106
+ const UpdateClaimCoverageAdapterFactory = (luvio) => {
1107
+ return function UpdateClaimCoverage(untrustedConfig) {
1108
+ const config = validateAdapterConfig(untrustedConfig, UpdateClaimCoverage_ConfigPropertyNames);
1109
+ // Invalid or incomplete config
1110
+ if (config === null) {
1111
+ throw new Error('Invalid config for "UpdateClaimCoverage"');
1112
+ }
1113
+ return buildNetworkSnapshot(luvio, config);
1114
+ };
1115
+ };
1116
+
1117
+ export { CreateClaimCoverageAdapterFactory, UpdateClaimAdapterFactory, UpdateClaimCoverageAdapterFactory };