@salesforce/lds-adapters-industries-insuranceclaim 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 (43) hide show
  1. package/LICENSE.txt +82 -0
  2. package/dist/es/es2018/industries-insuranceclaim.js +1688 -0
  3. package/dist/es/es2018/types/src/generated/adapters/CalculateAdjustments.d.ts +17 -0
  4. package/dist/es/es2018/types/src/generated/adapters/CancelClaimCoveragePaymentDetail.d.ts +17 -0
  5. package/dist/es/es2018/types/src/generated/adapters/CreateClaimCoveragePaymentDetail.d.ts +24 -0
  6. package/dist/es/es2018/types/src/generated/adapters/DeleteClaimCoveragePaymentDetail.d.ts +17 -0
  7. package/dist/es/es2018/types/src/generated/adapters/PayClaimCoveragePaymentDetail.d.ts +17 -0
  8. package/dist/es/es2018/types/src/generated/adapters/PolicyLimitStandingCalculation.d.ts +21 -0
  9. package/dist/es/es2018/types/src/generated/adapters/adapter-utils.d.ts +62 -0
  10. package/dist/es/es2018/types/src/generated/adapters/postVerifyPolicyCoverage.d.ts +18 -0
  11. package/dist/es/es2018/types/src/generated/artifacts/main.d.ts +7 -0
  12. package/dist/es/es2018/types/src/generated/artifacts/sfdc.d.ts +8 -0
  13. package/dist/es/es2018/types/src/generated/resources/postConnectInsuranceClaimsCoveragesCalculateAdjustmentsByClaimIdAndCoverageId.d.ts +16 -0
  14. package/dist/es/es2018/types/src/generated/resources/postConnectInsuranceClaimsCoveragesPaymentDetailsByClaimIdAndCoverageId.d.ts +23 -0
  15. package/dist/es/es2018/types/src/generated/resources/postConnectInsuranceClaimsCoveragesPaymentDetailsCancelByClaimIdAndCoverageIdAndPaymentDetailId.d.ts +14 -0
  16. package/dist/es/es2018/types/src/generated/resources/postConnectInsuranceClaimsCoveragesPaymentDetailsDeleteByClaimIdAndCoverageIdAndPaymentDetailId.d.ts +14 -0
  17. package/dist/es/es2018/types/src/generated/resources/postConnectInsuranceClaimsCoveragesPaymentDetailsPayByPaymentDetailIdAndClaimIdAndCoverageId.d.ts +14 -0
  18. package/dist/es/es2018/types/src/generated/resources/postConnectInsurancePoliciesCoveragesVerifyByCoverageIdAndPolicyId.d.ts +17 -0
  19. package/dist/es/es2018/types/src/generated/resources/postConnectInsurancePolicyLimitCalculateStandings.d.ts +18 -0
  20. package/dist/es/es2018/types/src/generated/types/CalculateAdjustmentsInputRepresentation.d.ts +28 -0
  21. package/dist/es/es2018/types/src/generated/types/CalculateAdjustmentsRepresentation.d.ts +56 -0
  22. package/dist/es/es2018/types/src/generated/types/CancelClaimCoveragePaymentDetailRep.d.ts +45 -0
  23. package/dist/es/es2018/types/src/generated/types/ClaimCovPaymentAdjDetailsRep.d.ts +31 -0
  24. package/dist/es/es2018/types/src/generated/types/CreateClaimCovPaymentDetailInputRep.d.ts +49 -0
  25. package/dist/es/es2018/types/src/generated/types/CreateClaimCoveragePaymentDetailRep.d.ts +54 -0
  26. package/dist/es/es2018/types/src/generated/types/DeleteClaimCoveragePaymentDetailRep.d.ts +45 -0
  27. package/dist/es/es2018/types/src/generated/types/ErrorDetail.d.ts +31 -0
  28. package/dist/es/es2018/types/src/generated/types/InsPolicyLimitTrackingDetailsRep.d.ts +58 -0
  29. package/dist/es/es2018/types/src/generated/types/InsPolicyLmtCalcStandingNode.d.ts +97 -0
  30. package/dist/es/es2018/types/src/generated/types/InsPolicyLmtCalcStandingRepresentation.d.ts +46 -0
  31. package/dist/es/es2018/types/src/generated/types/InsPolicyLmtCurrentStandingsInputRep.d.ts +46 -0
  32. package/dist/es/es2018/types/src/generated/types/LimitStandingOptionInputRepresentation.d.ts +31 -0
  33. package/dist/es/es2018/types/src/generated/types/PayClaimCoveragePaymentDetailRep.d.ts +42 -0
  34. package/dist/es/es2018/types/src/generated/types/VerifyPolicyCoverageInputRepresentation.d.ts +31 -0
  35. package/dist/es/es2018/types/src/generated/types/VerifyPolicyCoverageRepresentation.d.ts +42 -0
  36. package/dist/es/es2018/types/src/generated/types/type-utils.d.ts +32 -0
  37. package/dist/es/es2018/types/src/wire/cancelClaimCoveragePaymentDetail/types.d.ts +14 -0
  38. package/dist/es/es2018/types/src/wire/deleteClaimCoveragePaymentDetail/types.d.ts +14 -0
  39. package/package.json +66 -0
  40. package/sfdc/index.d.ts +1 -0
  41. package/sfdc/index.js +1736 -0
  42. package/src/raml/api.raml +630 -0
  43. package/src/raml/luvio.raml +84 -0
@@ -0,0 +1,1688 @@
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$7, typeCheckConfig as typeCheckConfig$7 } 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 = 'insuranceclaim';
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$a(obj, path = 'ErrorDetail') {
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
+ const obj_code = obj.code;
81
+ const path_code = path + '.code';
82
+ if (typeof obj_code !== 'string') {
83
+ return new TypeError('Expected "string" but received "' + typeof obj_code + '" (at "' + path_code + '")');
84
+ }
85
+ const obj_message = obj.message;
86
+ const path_message = path + '.message';
87
+ if (typeof obj_message !== 'string') {
88
+ return new TypeError('Expected "string" but received "' + typeof obj_message + '" (at "' + path_message + '")');
89
+ }
90
+ })();
91
+ return v_error === undefined ? null : v_error;
92
+ }
93
+
94
+ const TTL$6 = 1000;
95
+ const VERSION$6 = "5913e1c0d676a648498b82658ebb40ee";
96
+ function validate$9(obj, path = 'CreateClaimCoveragePaymentDetailRep') {
97
+ const v_error = (() => {
98
+ if (typeof obj !== 'object' || ArrayIsArray(obj) || obj === null) {
99
+ return new TypeError('Expected "object" but received "' + typeof obj + '" (at "' + path + '")');
100
+ }
101
+ if (obj.adjustedAmount !== undefined) {
102
+ obj.adjustedAmount;
103
+ }
104
+ if (obj.adjustedReason !== undefined) {
105
+ const obj_adjustedReason = obj.adjustedReason;
106
+ const path_adjustedReason = path + '.adjustedReason';
107
+ if (typeof obj_adjustedReason !== 'string') {
108
+ return new TypeError('Expected "string" but received "' + typeof obj_adjustedReason + '" (at "' + path_adjustedReason + '")');
109
+ }
110
+ }
111
+ if (obj.errors !== undefined) {
112
+ const obj_errors = obj.errors;
113
+ const path_errors = path + '.errors';
114
+ if (!ArrayIsArray(obj_errors)) {
115
+ return new TypeError('Expected "array" but received "' + typeof obj_errors + '" (at "' + path_errors + '")');
116
+ }
117
+ for (let i = 0; i < obj_errors.length; i++) {
118
+ const obj_errors_item = obj_errors[i];
119
+ const path_errors_item = path_errors + '[' + i + ']';
120
+ const referencepath_errors_itemValidationError = validate$a(obj_errors_item, path_errors_item);
121
+ if (referencepath_errors_itemValidationError !== null) {
122
+ let message = 'Object doesn\'t match ErrorDetail (at "' + path_errors_item + '")\n';
123
+ message += referencepath_errors_itemValidationError.message.split('\n').map((line) => '\t' + line).join('\n');
124
+ return new TypeError(message);
125
+ }
126
+ }
127
+ }
128
+ if (obj.insurancePolicyLimitTrackingIds !== undefined) {
129
+ const obj_insurancePolicyLimitTrackingIds = obj.insurancePolicyLimitTrackingIds;
130
+ const path_insurancePolicyLimitTrackingIds = path + '.insurancePolicyLimitTrackingIds';
131
+ if (!ArrayIsArray(obj_insurancePolicyLimitTrackingIds)) {
132
+ return new TypeError('Expected "array" but received "' + typeof obj_insurancePolicyLimitTrackingIds + '" (at "' + path_insurancePolicyLimitTrackingIds + '")');
133
+ }
134
+ for (let i = 0; i < obj_insurancePolicyLimitTrackingIds.length; i++) {
135
+ const obj_insurancePolicyLimitTrackingIds_item = obj_insurancePolicyLimitTrackingIds[i];
136
+ const path_insurancePolicyLimitTrackingIds_item = path_insurancePolicyLimitTrackingIds + '[' + i + ']';
137
+ if (typeof obj_insurancePolicyLimitTrackingIds_item !== 'string') {
138
+ return new TypeError('Expected "string" but received "' + typeof obj_insurancePolicyLimitTrackingIds_item + '" (at "' + path_insurancePolicyLimitTrackingIds_item + '")');
139
+ }
140
+ }
141
+ }
142
+ const obj_isSuccess = obj.isSuccess;
143
+ const path_isSuccess = path + '.isSuccess';
144
+ if (typeof obj_isSuccess !== 'boolean') {
145
+ return new TypeError('Expected "boolean" but received "' + typeof obj_isSuccess + '" (at "' + path_isSuccess + '")');
146
+ }
147
+ if (obj.paymentDetailId !== undefined) {
148
+ const obj_paymentDetailId = obj.paymentDetailId;
149
+ const path_paymentDetailId = path + '.paymentDetailId';
150
+ if (typeof obj_paymentDetailId !== 'string') {
151
+ return new TypeError('Expected "string" but received "' + typeof obj_paymentDetailId + '" (at "' + path_paymentDetailId + '")');
152
+ }
153
+ }
154
+ })();
155
+ return v_error === undefined ? null : v_error;
156
+ }
157
+ const RepresentationType$6 = 'CreateClaimCoveragePaymentDetailRep';
158
+ function keyBuilder$6(luvio, config) {
159
+ return keyPrefix + '::' + RepresentationType$6 + ':' + config.isSuccess;
160
+ }
161
+ function keyBuilderFromType$6(luvio, object) {
162
+ const keyParams = {
163
+ isSuccess: object.isSuccess
164
+ };
165
+ return keyBuilder$6(luvio, keyParams);
166
+ }
167
+ function normalize$6(input, existing, path, luvio, store, timestamp) {
168
+ return input;
169
+ }
170
+ const select$d = function CreateClaimCoveragePaymentDetailRepSelect() {
171
+ return {
172
+ kind: 'Fragment',
173
+ version: VERSION$6,
174
+ private: [],
175
+ opaque: true
176
+ };
177
+ };
178
+ function equals$6(existing, incoming) {
179
+ if (JSONStringify(incoming) !== JSONStringify(existing)) {
180
+ return false;
181
+ }
182
+ return true;
183
+ }
184
+ const ingest$6 = function CreateClaimCoveragePaymentDetailRepIngest(input, path, luvio, store, timestamp) {
185
+ if (process.env.NODE_ENV !== 'production') {
186
+ const validateError = validate$9(input);
187
+ if (validateError !== null) {
188
+ throw validateError;
189
+ }
190
+ }
191
+ const key = keyBuilderFromType$6(luvio, input);
192
+ const ttlToUse = TTL$6;
193
+ ingestShape(input, path, luvio, store, timestamp, ttlToUse, key, normalize$6, "insuranceclaim", VERSION$6, RepresentationType$6, equals$6);
194
+ return createLink(key);
195
+ };
196
+ function getTypeCacheKeys$6(rootKeySet, luvio, input, fullPathFactory) {
197
+ // root cache key (uses fullPathFactory if keyBuilderFromType isn't defined)
198
+ const rootKey = keyBuilderFromType$6(luvio, input);
199
+ rootKeySet.set(rootKey, {
200
+ namespace: keyPrefix,
201
+ representationName: RepresentationType$6,
202
+ mergeable: false
203
+ });
204
+ }
205
+
206
+ function select$c(luvio, params) {
207
+ return select$d();
208
+ }
209
+ function getResponseCacheKeys$6(storeKeyMap, luvio, resourceParams, response) {
210
+ getTypeCacheKeys$6(storeKeyMap, luvio, response);
211
+ }
212
+ function ingestSuccess$6(luvio, resourceParams, response) {
213
+ const { body } = response;
214
+ const key = keyBuilderFromType$6(luvio, body);
215
+ luvio.storeIngest(key, ingest$6, body);
216
+ const snapshot = luvio.storeLookup({
217
+ recordId: key,
218
+ node: select$c(),
219
+ variables: {},
220
+ });
221
+ if (process.env.NODE_ENV !== 'production') {
222
+ if (snapshot.state !== 'Fulfilled') {
223
+ throw new Error('Invalid network response. Expected resource response to result in Fulfilled snapshot');
224
+ }
225
+ }
226
+ deepFreeze(snapshot.data);
227
+ return snapshot;
228
+ }
229
+ function createResourceRequest$6(config) {
230
+ const headers = {};
231
+ return {
232
+ baseUri: '/services/data/v66.0',
233
+ basePath: '/connect/insurance/claims/' + config.urlParams.claimId + '/coverages/' + config.urlParams.coverageId + '/payment-details',
234
+ method: 'post',
235
+ body: config.body,
236
+ urlParams: config.urlParams,
237
+ queryParams: {},
238
+ headers,
239
+ priority: 'normal',
240
+ };
241
+ }
242
+
243
+ const adapterName$6 = 'CreateClaimCoveragePaymentDetail';
244
+ const CreateClaimCoveragePaymentDetail_ConfigPropertyMetadata = [
245
+ generateParamConfigMetadata('claimId', true, 0 /* UrlParameter */, 0 /* String */),
246
+ generateParamConfigMetadata('coverageId', true, 0 /* UrlParameter */, 0 /* String */),
247
+ generateParamConfigMetadata('additionalFields', false, 2 /* Body */, 4 /* Unsupported */),
248
+ generateParamConfigMetadata('adjustedAmount', false, 2 /* Body */, 2 /* Number */),
249
+ generateParamConfigMetadata('benefitName', false, 2 /* Body */, 0 /* String */),
250
+ generateParamConfigMetadata('claimedAmount', true, 2 /* Body */, 2 /* Number */),
251
+ generateParamConfigMetadata('description', false, 2 /* Body */, 0 /* String */),
252
+ generateParamConfigMetadata('recipientId', false, 2 /* Body */, 0 /* String */),
253
+ generateParamConfigMetadata('coveragePaymentType', true, 2 /* Body */, 0 /* String */),
254
+ generateParamConfigMetadata('limitUnitCount', false, 2 /* Body */, 3 /* Integer */),
255
+ ];
256
+ const CreateClaimCoveragePaymentDetail_ConfigPropertyNames = /*#__PURE__*/ buildAdapterValidationConfig(adapterName$6, CreateClaimCoveragePaymentDetail_ConfigPropertyMetadata);
257
+ const createResourceParams$6 = /*#__PURE__*/ createResourceParams$7(CreateClaimCoveragePaymentDetail_ConfigPropertyMetadata);
258
+ function typeCheckConfig$6(untrustedConfig) {
259
+ const config = {};
260
+ typeCheckConfig$7(untrustedConfig, config, CreateClaimCoveragePaymentDetail_ConfigPropertyMetadata);
261
+ const untrustedConfig_additionalFields = untrustedConfig.additionalFields;
262
+ config.additionalFields = untrustedConfig_additionalFields;
263
+ return config;
264
+ }
265
+ function validateAdapterConfig$6(untrustedConfig, configPropertyNames) {
266
+ if (!untrustedIsObject(untrustedConfig)) {
267
+ return null;
268
+ }
269
+ if (process.env.NODE_ENV !== 'production') {
270
+ validateConfig(untrustedConfig, configPropertyNames);
271
+ }
272
+ const config = typeCheckConfig$6(untrustedConfig);
273
+ if (!areRequiredParametersPresent(config, configPropertyNames)) {
274
+ return null;
275
+ }
276
+ return config;
277
+ }
278
+ function buildNetworkSnapshot$6(luvio, config, options) {
279
+ const resourceParams = createResourceParams$6(config);
280
+ const request = createResourceRequest$6(resourceParams);
281
+ return luvio.dispatchResourceRequest(request, options)
282
+ .then((response) => {
283
+ return luvio.handleSuccessResponse(() => {
284
+ const snapshot = ingestSuccess$6(luvio, resourceParams, response);
285
+ return luvio.storeBroadcast().then(() => snapshot);
286
+ }, () => {
287
+ const cache = new StoreKeyMap();
288
+ getResponseCacheKeys$6(cache, luvio, resourceParams, response.body);
289
+ return cache;
290
+ });
291
+ }, (response) => {
292
+ deepFreeze(response);
293
+ throw response;
294
+ });
295
+ }
296
+ const CreateClaimCoveragePaymentDetailAdapterFactory = (luvio) => {
297
+ return function CreateClaimCoveragePaymentDetail(untrustedConfig) {
298
+ const config = validateAdapterConfig$6(untrustedConfig, CreateClaimCoveragePaymentDetail_ConfigPropertyNames);
299
+ // Invalid or incomplete config
300
+ if (config === null) {
301
+ throw new Error('Invalid config for "CreateClaimCoveragePaymentDetail"');
302
+ }
303
+ return buildNetworkSnapshot$6(luvio, config);
304
+ };
305
+ };
306
+
307
+ const TTL$5 = 1000;
308
+ const VERSION$5 = "0fe1cd8410cf5ab954b0ee6bea965e0d";
309
+ function validate$8(obj, path = 'CancelClaimCoveragePaymentDetailRep') {
310
+ const v_error = (() => {
311
+ if (typeof obj !== 'object' || ArrayIsArray(obj) || obj === null) {
312
+ return new TypeError('Expected "object" but received "' + typeof obj + '" (at "' + path + '")');
313
+ }
314
+ if (obj.errors !== undefined) {
315
+ const obj_errors = obj.errors;
316
+ const path_errors = path + '.errors';
317
+ if (!ArrayIsArray(obj_errors)) {
318
+ return new TypeError('Expected "array" but received "' + typeof obj_errors + '" (at "' + path_errors + '")');
319
+ }
320
+ for (let i = 0; i < obj_errors.length; i++) {
321
+ const obj_errors_item = obj_errors[i];
322
+ const path_errors_item = path_errors + '[' + i + ']';
323
+ const referencepath_errors_itemValidationError = validate$a(obj_errors_item, path_errors_item);
324
+ if (referencepath_errors_itemValidationError !== null) {
325
+ let message = 'Object doesn\'t match ErrorDetail (at "' + path_errors_item + '")\n';
326
+ message += referencepath_errors_itemValidationError.message.split('\n').map((line) => '\t' + line).join('\n');
327
+ return new TypeError(message);
328
+ }
329
+ }
330
+ }
331
+ const obj_isSuccess = obj.isSuccess;
332
+ const path_isSuccess = path + '.isSuccess';
333
+ if (typeof obj_isSuccess !== 'boolean') {
334
+ return new TypeError('Expected "boolean" but received "' + typeof obj_isSuccess + '" (at "' + path_isSuccess + '")');
335
+ }
336
+ if (obj.paymentDetailId !== undefined) {
337
+ const obj_paymentDetailId = obj.paymentDetailId;
338
+ const path_paymentDetailId = path + '.paymentDetailId';
339
+ if (typeof obj_paymentDetailId !== 'string') {
340
+ return new TypeError('Expected "string" but received "' + typeof obj_paymentDetailId + '" (at "' + path_paymentDetailId + '")');
341
+ }
342
+ }
343
+ })();
344
+ return v_error === undefined ? null : v_error;
345
+ }
346
+ const RepresentationType$5 = 'CancelClaimCoveragePaymentDetailRep';
347
+ function keyBuilder$5(luvio, config) {
348
+ return keyPrefix + '::' + RepresentationType$5 + ':' + config.isSuccess;
349
+ }
350
+ function keyBuilderFromType$5(luvio, object) {
351
+ const keyParams = {
352
+ isSuccess: object.isSuccess
353
+ };
354
+ return keyBuilder$5(luvio, keyParams);
355
+ }
356
+ function normalize$5(input, existing, path, luvio, store, timestamp) {
357
+ return input;
358
+ }
359
+ const select$b = function CancelClaimCoveragePaymentDetailRepSelect() {
360
+ return {
361
+ kind: 'Fragment',
362
+ version: VERSION$5,
363
+ private: [],
364
+ opaque: true
365
+ };
366
+ };
367
+ function equals$5(existing, incoming) {
368
+ if (JSONStringify(incoming) !== JSONStringify(existing)) {
369
+ return false;
370
+ }
371
+ return true;
372
+ }
373
+ const ingest$5 = function CancelClaimCoveragePaymentDetailRepIngest(input, path, luvio, store, timestamp) {
374
+ if (process.env.NODE_ENV !== 'production') {
375
+ const validateError = validate$8(input);
376
+ if (validateError !== null) {
377
+ throw validateError;
378
+ }
379
+ }
380
+ const key = keyBuilderFromType$5(luvio, input);
381
+ const ttlToUse = TTL$5;
382
+ ingestShape(input, path, luvio, store, timestamp, ttlToUse, key, normalize$5, "insuranceclaim", VERSION$5, RepresentationType$5, equals$5);
383
+ return createLink(key);
384
+ };
385
+ function getTypeCacheKeys$5(rootKeySet, luvio, input, fullPathFactory) {
386
+ // root cache key (uses fullPathFactory if keyBuilderFromType isn't defined)
387
+ const rootKey = keyBuilderFromType$5(luvio, input);
388
+ rootKeySet.set(rootKey, {
389
+ namespace: keyPrefix,
390
+ representationName: RepresentationType$5,
391
+ mergeable: false
392
+ });
393
+ }
394
+
395
+ function select$a(luvio, params) {
396
+ return select$b();
397
+ }
398
+ function getResponseCacheKeys$5(storeKeyMap, luvio, resourceParams, response) {
399
+ getTypeCacheKeys$5(storeKeyMap, luvio, response);
400
+ }
401
+ function ingestSuccess$5(luvio, resourceParams, response) {
402
+ const { body } = response;
403
+ const key = keyBuilderFromType$5(luvio, body);
404
+ luvio.storeIngest(key, ingest$5, body);
405
+ const snapshot = luvio.storeLookup({
406
+ recordId: key,
407
+ node: select$a(),
408
+ variables: {},
409
+ });
410
+ if (process.env.NODE_ENV !== 'production') {
411
+ if (snapshot.state !== 'Fulfilled') {
412
+ throw new Error('Invalid network response. Expected resource response to result in Fulfilled snapshot');
413
+ }
414
+ }
415
+ deepFreeze(snapshot.data);
416
+ return snapshot;
417
+ }
418
+ function createResourceRequest$5(config) {
419
+ const headers = {};
420
+ return {
421
+ baseUri: '/services/data/v66.0',
422
+ basePath: '/connect/insurance/claims/' + config.urlParams.claimId + '/coverages/' + config.urlParams.coverageId + '/payment-details/' + config.urlParams.paymentDetailId + '/cancel',
423
+ method: 'post',
424
+ body: null,
425
+ urlParams: config.urlParams,
426
+ queryParams: {},
427
+ headers,
428
+ priority: 'normal',
429
+ };
430
+ }
431
+
432
+ const adapterName$5 = 'CancelClaimCoveragePaymentDetail';
433
+ const CancelClaimCoveragePaymentDetail_ConfigPropertyMetadata = [
434
+ generateParamConfigMetadata('claimId', true, 0 /* UrlParameter */, 0 /* String */),
435
+ generateParamConfigMetadata('coverageId', true, 0 /* UrlParameter */, 0 /* String */),
436
+ generateParamConfigMetadata('paymentDetailId', true, 0 /* UrlParameter */, 0 /* String */),
437
+ ];
438
+ const CancelClaimCoveragePaymentDetail_ConfigPropertyNames = /*#__PURE__*/ buildAdapterValidationConfig(adapterName$5, CancelClaimCoveragePaymentDetail_ConfigPropertyMetadata);
439
+ const createResourceParams$5 = /*#__PURE__*/ createResourceParams$7(CancelClaimCoveragePaymentDetail_ConfigPropertyMetadata);
440
+ function typeCheckConfig$5(untrustedConfig) {
441
+ const config = {};
442
+ typeCheckConfig$7(untrustedConfig, config, CancelClaimCoveragePaymentDetail_ConfigPropertyMetadata);
443
+ return config;
444
+ }
445
+ function validateAdapterConfig$5(untrustedConfig, configPropertyNames) {
446
+ if (!untrustedIsObject(untrustedConfig)) {
447
+ return null;
448
+ }
449
+ if (process.env.NODE_ENV !== 'production') {
450
+ validateConfig(untrustedConfig, configPropertyNames);
451
+ }
452
+ const config = typeCheckConfig$5(untrustedConfig);
453
+ if (!areRequiredParametersPresent(config, configPropertyNames)) {
454
+ return null;
455
+ }
456
+ return config;
457
+ }
458
+ function buildNetworkSnapshot$5(luvio, config, options) {
459
+ const resourceParams = createResourceParams$5(config);
460
+ const request = createResourceRequest$5(resourceParams);
461
+ return luvio.dispatchResourceRequest(request, options)
462
+ .then((response) => {
463
+ return luvio.handleSuccessResponse(() => {
464
+ const snapshot = ingestSuccess$5(luvio, resourceParams, response);
465
+ return luvio.storeBroadcast().then(() => snapshot);
466
+ }, () => {
467
+ const cache = new StoreKeyMap();
468
+ getResponseCacheKeys$5(cache, luvio, resourceParams, response.body);
469
+ return cache;
470
+ });
471
+ }, (response) => {
472
+ deepFreeze(response);
473
+ throw response;
474
+ });
475
+ }
476
+ const CancelClaimCoveragePaymentDetailAdapterFactory = (luvio) => {
477
+ return function CancelClaimCoveragePaymentDetail(untrustedConfig) {
478
+ const config = validateAdapterConfig$5(untrustedConfig, CancelClaimCoveragePaymentDetail_ConfigPropertyNames);
479
+ // Invalid or incomplete config
480
+ if (config === null) {
481
+ throw new Error('Invalid config for "CancelClaimCoveragePaymentDetail"');
482
+ }
483
+ return buildNetworkSnapshot$5(luvio, config);
484
+ };
485
+ };
486
+
487
+ const TTL$4 = 1000;
488
+ const VERSION$4 = "c336a66ea51f6cee0b4b062fb1e2dbe0";
489
+ function validate$7(obj, path = 'DeleteClaimCoveragePaymentDetailRep') {
490
+ const v_error = (() => {
491
+ if (typeof obj !== 'object' || ArrayIsArray(obj) || obj === null) {
492
+ return new TypeError('Expected "object" but received "' + typeof obj + '" (at "' + path + '")');
493
+ }
494
+ if (obj.errors !== undefined) {
495
+ const obj_errors = obj.errors;
496
+ const path_errors = path + '.errors';
497
+ if (!ArrayIsArray(obj_errors)) {
498
+ return new TypeError('Expected "array" but received "' + typeof obj_errors + '" (at "' + path_errors + '")');
499
+ }
500
+ for (let i = 0; i < obj_errors.length; i++) {
501
+ const obj_errors_item = obj_errors[i];
502
+ const path_errors_item = path_errors + '[' + i + ']';
503
+ const referencepath_errors_itemValidationError = validate$a(obj_errors_item, path_errors_item);
504
+ if (referencepath_errors_itemValidationError !== null) {
505
+ let message = 'Object doesn\'t match ErrorDetail (at "' + path_errors_item + '")\n';
506
+ message += referencepath_errors_itemValidationError.message.split('\n').map((line) => '\t' + line).join('\n');
507
+ return new TypeError(message);
508
+ }
509
+ }
510
+ }
511
+ const obj_isSuccess = obj.isSuccess;
512
+ const path_isSuccess = path + '.isSuccess';
513
+ if (typeof obj_isSuccess !== 'boolean') {
514
+ return new TypeError('Expected "boolean" but received "' + typeof obj_isSuccess + '" (at "' + path_isSuccess + '")');
515
+ }
516
+ if (obj.paymentDetailId !== undefined) {
517
+ const obj_paymentDetailId = obj.paymentDetailId;
518
+ const path_paymentDetailId = path + '.paymentDetailId';
519
+ if (typeof obj_paymentDetailId !== 'string') {
520
+ return new TypeError('Expected "string" but received "' + typeof obj_paymentDetailId + '" (at "' + path_paymentDetailId + '")');
521
+ }
522
+ }
523
+ })();
524
+ return v_error === undefined ? null : v_error;
525
+ }
526
+ const RepresentationType$4 = 'DeleteClaimCoveragePaymentDetailRep';
527
+ function keyBuilder$4(luvio, config) {
528
+ return keyPrefix + '::' + RepresentationType$4 + ':' + config.isSuccess;
529
+ }
530
+ function keyBuilderFromType$4(luvio, object) {
531
+ const keyParams = {
532
+ isSuccess: object.isSuccess
533
+ };
534
+ return keyBuilder$4(luvio, keyParams);
535
+ }
536
+ function normalize$4(input, existing, path, luvio, store, timestamp) {
537
+ return input;
538
+ }
539
+ const select$9 = function DeleteClaimCoveragePaymentDetailRepSelect() {
540
+ return {
541
+ kind: 'Fragment',
542
+ version: VERSION$4,
543
+ private: [],
544
+ opaque: true
545
+ };
546
+ };
547
+ function equals$4(existing, incoming) {
548
+ if (JSONStringify(incoming) !== JSONStringify(existing)) {
549
+ return false;
550
+ }
551
+ return true;
552
+ }
553
+ const ingest$4 = function DeleteClaimCoveragePaymentDetailRepIngest(input, path, luvio, store, timestamp) {
554
+ if (process.env.NODE_ENV !== 'production') {
555
+ const validateError = validate$7(input);
556
+ if (validateError !== null) {
557
+ throw validateError;
558
+ }
559
+ }
560
+ const key = keyBuilderFromType$4(luvio, input);
561
+ const ttlToUse = TTL$4;
562
+ ingestShape(input, path, luvio, store, timestamp, ttlToUse, key, normalize$4, "insuranceclaim", VERSION$4, RepresentationType$4, equals$4);
563
+ return createLink(key);
564
+ };
565
+ function getTypeCacheKeys$4(rootKeySet, luvio, input, fullPathFactory) {
566
+ // root cache key (uses fullPathFactory if keyBuilderFromType isn't defined)
567
+ const rootKey = keyBuilderFromType$4(luvio, input);
568
+ rootKeySet.set(rootKey, {
569
+ namespace: keyPrefix,
570
+ representationName: RepresentationType$4,
571
+ mergeable: false
572
+ });
573
+ }
574
+
575
+ function select$8(luvio, params) {
576
+ return select$9();
577
+ }
578
+ function getResponseCacheKeys$4(storeKeyMap, luvio, resourceParams, response) {
579
+ getTypeCacheKeys$4(storeKeyMap, luvio, response);
580
+ }
581
+ function ingestSuccess$4(luvio, resourceParams, response) {
582
+ const { body } = response;
583
+ const key = keyBuilderFromType$4(luvio, body);
584
+ luvio.storeIngest(key, ingest$4, body);
585
+ const snapshot = luvio.storeLookup({
586
+ recordId: key,
587
+ node: select$8(),
588
+ variables: {},
589
+ });
590
+ if (process.env.NODE_ENV !== 'production') {
591
+ if (snapshot.state !== 'Fulfilled') {
592
+ throw new Error('Invalid network response. Expected resource response to result in Fulfilled snapshot');
593
+ }
594
+ }
595
+ deepFreeze(snapshot.data);
596
+ return snapshot;
597
+ }
598
+ function createResourceRequest$4(config) {
599
+ const headers = {};
600
+ return {
601
+ baseUri: '/services/data/v66.0',
602
+ basePath: '/connect/insurance/claims/' + config.urlParams.claimId + '/coverages/' + config.urlParams.coverageId + '/payment-details/' + config.urlParams.paymentDetailId + '/delete',
603
+ method: 'post',
604
+ body: null,
605
+ urlParams: config.urlParams,
606
+ queryParams: {},
607
+ headers,
608
+ priority: 'normal',
609
+ };
610
+ }
611
+
612
+ const adapterName$4 = 'DeleteClaimCoveragePaymentDetail';
613
+ const DeleteClaimCoveragePaymentDetail_ConfigPropertyMetadata = [
614
+ generateParamConfigMetadata('claimId', true, 0 /* UrlParameter */, 0 /* String */),
615
+ generateParamConfigMetadata('coverageId', true, 0 /* UrlParameter */, 0 /* String */),
616
+ generateParamConfigMetadata('paymentDetailId', true, 0 /* UrlParameter */, 0 /* String */),
617
+ ];
618
+ const DeleteClaimCoveragePaymentDetail_ConfigPropertyNames = /*#__PURE__*/ buildAdapterValidationConfig(adapterName$4, DeleteClaimCoveragePaymentDetail_ConfigPropertyMetadata);
619
+ const createResourceParams$4 = /*#__PURE__*/ createResourceParams$7(DeleteClaimCoveragePaymentDetail_ConfigPropertyMetadata);
620
+ function typeCheckConfig$4(untrustedConfig) {
621
+ const config = {};
622
+ typeCheckConfig$7(untrustedConfig, config, DeleteClaimCoveragePaymentDetail_ConfigPropertyMetadata);
623
+ return config;
624
+ }
625
+ function validateAdapterConfig$4(untrustedConfig, configPropertyNames) {
626
+ if (!untrustedIsObject(untrustedConfig)) {
627
+ return null;
628
+ }
629
+ if (process.env.NODE_ENV !== 'production') {
630
+ validateConfig(untrustedConfig, configPropertyNames);
631
+ }
632
+ const config = typeCheckConfig$4(untrustedConfig);
633
+ if (!areRequiredParametersPresent(config, configPropertyNames)) {
634
+ return null;
635
+ }
636
+ return config;
637
+ }
638
+ function buildNetworkSnapshot$4(luvio, config, options) {
639
+ const resourceParams = createResourceParams$4(config);
640
+ const request = createResourceRequest$4(resourceParams);
641
+ return luvio.dispatchResourceRequest(request, options)
642
+ .then((response) => {
643
+ return luvio.handleSuccessResponse(() => {
644
+ const snapshot = ingestSuccess$4(luvio, resourceParams, response);
645
+ return luvio.storeBroadcast().then(() => snapshot);
646
+ }, () => {
647
+ const cache = new StoreKeyMap();
648
+ getResponseCacheKeys$4(cache, luvio, resourceParams, response.body);
649
+ return cache;
650
+ });
651
+ }, (response) => {
652
+ deepFreeze(response);
653
+ throw response;
654
+ });
655
+ }
656
+ const DeleteClaimCoveragePaymentDetailAdapterFactory = (luvio) => {
657
+ return function DeleteClaimCoveragePaymentDetail(untrustedConfig) {
658
+ const config = validateAdapterConfig$4(untrustedConfig, DeleteClaimCoveragePaymentDetail_ConfigPropertyNames);
659
+ // Invalid or incomplete config
660
+ if (config === null) {
661
+ throw new Error('Invalid config for "DeleteClaimCoveragePaymentDetail"');
662
+ }
663
+ return buildNetworkSnapshot$4(luvio, config);
664
+ };
665
+ };
666
+
667
+ const TTL$3 = 1000;
668
+ const VERSION$3 = "0870e1dbab361d84a1ab08b2b69fb9d9";
669
+ function validate$6(obj, path = 'PayClaimCoveragePaymentDetailRep') {
670
+ const v_error = (() => {
671
+ if (typeof obj !== 'object' || ArrayIsArray(obj) || obj === null) {
672
+ return new TypeError('Expected "object" but received "' + typeof obj + '" (at "' + path + '")');
673
+ }
674
+ if (obj.errors !== undefined) {
675
+ const obj_errors = obj.errors;
676
+ const path_errors = path + '.errors';
677
+ if (!ArrayIsArray(obj_errors)) {
678
+ return new TypeError('Expected "array" but received "' + typeof obj_errors + '" (at "' + path_errors + '")');
679
+ }
680
+ for (let i = 0; i < obj_errors.length; i++) {
681
+ const obj_errors_item = obj_errors[i];
682
+ const path_errors_item = path_errors + '[' + i + ']';
683
+ const referencepath_errors_itemValidationError = validate$a(obj_errors_item, path_errors_item);
684
+ if (referencepath_errors_itemValidationError !== null) {
685
+ let message = 'Object doesn\'t match ErrorDetail (at "' + path_errors_item + '")\n';
686
+ message += referencepath_errors_itemValidationError.message.split('\n').map((line) => '\t' + line).join('\n');
687
+ return new TypeError(message);
688
+ }
689
+ }
690
+ }
691
+ const obj_isSuccess = obj.isSuccess;
692
+ const path_isSuccess = path + '.isSuccess';
693
+ if (typeof obj_isSuccess !== 'boolean') {
694
+ return new TypeError('Expected "boolean" but received "' + typeof obj_isSuccess + '" (at "' + path_isSuccess + '")');
695
+ }
696
+ })();
697
+ return v_error === undefined ? null : v_error;
698
+ }
699
+ const RepresentationType$3 = 'PayClaimCoveragePaymentDetailRep';
700
+ function keyBuilder$3(luvio, config) {
701
+ return keyPrefix + '::' + RepresentationType$3 + ':' + config.isSuccess;
702
+ }
703
+ function keyBuilderFromType$3(luvio, object) {
704
+ const keyParams = {
705
+ isSuccess: object.isSuccess
706
+ };
707
+ return keyBuilder$3(luvio, keyParams);
708
+ }
709
+ function normalize$3(input, existing, path, luvio, store, timestamp) {
710
+ return input;
711
+ }
712
+ const select$7 = function PayClaimCoveragePaymentDetailRepSelect() {
713
+ return {
714
+ kind: 'Fragment',
715
+ version: VERSION$3,
716
+ private: [],
717
+ opaque: true
718
+ };
719
+ };
720
+ function equals$3(existing, incoming) {
721
+ if (JSONStringify(incoming) !== JSONStringify(existing)) {
722
+ return false;
723
+ }
724
+ return true;
725
+ }
726
+ const ingest$3 = function PayClaimCoveragePaymentDetailRepIngest(input, path, luvio, store, timestamp) {
727
+ if (process.env.NODE_ENV !== 'production') {
728
+ const validateError = validate$6(input);
729
+ if (validateError !== null) {
730
+ throw validateError;
731
+ }
732
+ }
733
+ const key = keyBuilderFromType$3(luvio, input);
734
+ const ttlToUse = TTL$3;
735
+ ingestShape(input, path, luvio, store, timestamp, ttlToUse, key, normalize$3, "insuranceclaim", VERSION$3, RepresentationType$3, equals$3);
736
+ return createLink(key);
737
+ };
738
+ function getTypeCacheKeys$3(rootKeySet, luvio, input, fullPathFactory) {
739
+ // root cache key (uses fullPathFactory if keyBuilderFromType isn't defined)
740
+ const rootKey = keyBuilderFromType$3(luvio, input);
741
+ rootKeySet.set(rootKey, {
742
+ namespace: keyPrefix,
743
+ representationName: RepresentationType$3,
744
+ mergeable: false
745
+ });
746
+ }
747
+
748
+ function select$6(luvio, params) {
749
+ return select$7();
750
+ }
751
+ function getResponseCacheKeys$3(storeKeyMap, luvio, resourceParams, response) {
752
+ getTypeCacheKeys$3(storeKeyMap, luvio, response);
753
+ }
754
+ function ingestSuccess$3(luvio, resourceParams, response) {
755
+ const { body } = response;
756
+ const key = keyBuilderFromType$3(luvio, body);
757
+ luvio.storeIngest(key, ingest$3, body);
758
+ const snapshot = luvio.storeLookup({
759
+ recordId: key,
760
+ node: select$6(),
761
+ variables: {},
762
+ });
763
+ if (process.env.NODE_ENV !== 'production') {
764
+ if (snapshot.state !== 'Fulfilled') {
765
+ throw new Error('Invalid network response. Expected resource response to result in Fulfilled snapshot');
766
+ }
767
+ }
768
+ deepFreeze(snapshot.data);
769
+ return snapshot;
770
+ }
771
+ function createResourceRequest$3(config) {
772
+ const headers = {};
773
+ return {
774
+ baseUri: '/services/data/v66.0',
775
+ basePath: '/connect/insurance/claims/' + config.urlParams.claimId + '/coverages/' + config.urlParams.coverageId + '/payment-details/' + config.urlParams.paymentDetailId + '/pay',
776
+ method: 'post',
777
+ body: null,
778
+ urlParams: config.urlParams,
779
+ queryParams: {},
780
+ headers,
781
+ priority: 'normal',
782
+ };
783
+ }
784
+
785
+ const adapterName$3 = 'PayClaimCoveragePaymentDetail';
786
+ const PayClaimCoveragePaymentDetail_ConfigPropertyMetadata = [
787
+ generateParamConfigMetadata('paymentDetailId', true, 0 /* UrlParameter */, 0 /* String */),
788
+ generateParamConfigMetadata('claimId', true, 0 /* UrlParameter */, 0 /* String */),
789
+ generateParamConfigMetadata('coverageId', true, 0 /* UrlParameter */, 0 /* String */),
790
+ ];
791
+ const PayClaimCoveragePaymentDetail_ConfigPropertyNames = /*#__PURE__*/ buildAdapterValidationConfig(adapterName$3, PayClaimCoveragePaymentDetail_ConfigPropertyMetadata);
792
+ const createResourceParams$3 = /*#__PURE__*/ createResourceParams$7(PayClaimCoveragePaymentDetail_ConfigPropertyMetadata);
793
+ function typeCheckConfig$3(untrustedConfig) {
794
+ const config = {};
795
+ typeCheckConfig$7(untrustedConfig, config, PayClaimCoveragePaymentDetail_ConfigPropertyMetadata);
796
+ return config;
797
+ }
798
+ function validateAdapterConfig$3(untrustedConfig, configPropertyNames) {
799
+ if (!untrustedIsObject(untrustedConfig)) {
800
+ return null;
801
+ }
802
+ if (process.env.NODE_ENV !== 'production') {
803
+ validateConfig(untrustedConfig, configPropertyNames);
804
+ }
805
+ const config = typeCheckConfig$3(untrustedConfig);
806
+ if (!areRequiredParametersPresent(config, configPropertyNames)) {
807
+ return null;
808
+ }
809
+ return config;
810
+ }
811
+ function buildNetworkSnapshot$3(luvio, config, options) {
812
+ const resourceParams = createResourceParams$3(config);
813
+ const request = createResourceRequest$3(resourceParams);
814
+ return luvio.dispatchResourceRequest(request, options)
815
+ .then((response) => {
816
+ return luvio.handleSuccessResponse(() => {
817
+ const snapshot = ingestSuccess$3(luvio, resourceParams, response);
818
+ return luvio.storeBroadcast().then(() => snapshot);
819
+ }, () => {
820
+ const cache = new StoreKeyMap();
821
+ getResponseCacheKeys$3(cache, luvio, resourceParams, response.body);
822
+ return cache;
823
+ });
824
+ }, (response) => {
825
+ deepFreeze(response);
826
+ throw response;
827
+ });
828
+ }
829
+ const PayClaimCoveragePaymentDetailAdapterFactory = (luvio) => {
830
+ return function PayClaimCoveragePaymentDetail(untrustedConfig) {
831
+ const config = validateAdapterConfig$3(untrustedConfig, PayClaimCoveragePaymentDetail_ConfigPropertyNames);
832
+ // Invalid or incomplete config
833
+ if (config === null) {
834
+ throw new Error('Invalid config for "PayClaimCoveragePaymentDetail"');
835
+ }
836
+ return buildNetworkSnapshot$3(luvio, config);
837
+ };
838
+ };
839
+
840
+ function validate$5(obj, path = 'ClaimCovPaymentAdjDetailsRep') {
841
+ const v_error = (() => {
842
+ if (typeof obj !== 'object' || ArrayIsArray(obj) || obj === null) {
843
+ return new TypeError('Expected "object" but received "' + typeof obj + '" (at "' + path + '")');
844
+ }
845
+ if (obj.adjustedAmount !== undefined) {
846
+ const obj_adjustedAmount = obj.adjustedAmount;
847
+ const path_adjustedAmount = path + '.adjustedAmount';
848
+ if (typeof obj_adjustedAmount !== 'number') {
849
+ return new TypeError('Expected "number" but received "' + typeof obj_adjustedAmount + '" (at "' + path_adjustedAmount + '")');
850
+ }
851
+ }
852
+ if (obj.adjustmentReason !== undefined) {
853
+ const obj_adjustmentReason = obj.adjustmentReason;
854
+ const path_adjustmentReason = path + '.adjustmentReason';
855
+ if (typeof obj_adjustmentReason !== 'string') {
856
+ return new TypeError('Expected "string" but received "' + typeof obj_adjustmentReason + '" (at "' + path_adjustmentReason + '")');
857
+ }
858
+ }
859
+ })();
860
+ return v_error === undefined ? null : v_error;
861
+ }
862
+
863
+ function validate$4(obj, path = 'InsPolicyLimitTrackingDetailsRep') {
864
+ const v_error = (() => {
865
+ if (typeof obj !== 'object' || ArrayIsArray(obj) || obj === null) {
866
+ return new TypeError('Expected "object" but received "' + typeof obj + '" (at "' + path + '")');
867
+ }
868
+ if (obj.calcInitialAmount !== undefined) {
869
+ obj.calcInitialAmount;
870
+ }
871
+ if (obj.calcInitialValue !== undefined) {
872
+ const obj_calcInitialValue = obj.calcInitialValue;
873
+ const path_calcInitialValue = path + '.calcInitialValue';
874
+ if (typeof obj_calcInitialValue !== 'number' || (typeof obj_calcInitialValue === 'number' && Math.floor(obj_calcInitialValue) !== obj_calcInitialValue)) {
875
+ return new TypeError('Expected "integer" but received "' + typeof obj_calcInitialValue + '" (at "' + path_calcInitialValue + '")');
876
+ }
877
+ }
878
+ if (obj.category !== undefined) {
879
+ const obj_category = obj.category;
880
+ const path_category = path + '.category';
881
+ if (typeof obj_category !== 'string') {
882
+ return new TypeError('Expected "string" but received "' + typeof obj_category + '" (at "' + path_category + '")');
883
+ }
884
+ }
885
+ if (obj.policyLimitId !== undefined) {
886
+ const obj_policyLimitId = obj.policyLimitId;
887
+ const path_policyLimitId = path + '.policyLimitId';
888
+ if (typeof obj_policyLimitId !== 'string') {
889
+ return new TypeError('Expected "string" but received "' + typeof obj_policyLimitId + '" (at "' + path_policyLimitId + '")');
890
+ }
891
+ }
892
+ if (obj.postedAmount !== undefined) {
893
+ const obj_postedAmount = obj.postedAmount;
894
+ const path_postedAmount = path + '.postedAmount';
895
+ if (typeof obj_postedAmount !== 'number') {
896
+ return new TypeError('Expected "number" but received "' + typeof obj_postedAmount + '" (at "' + path_postedAmount + '")');
897
+ }
898
+ }
899
+ if (obj.postedValue !== undefined) {
900
+ const obj_postedValue = obj.postedValue;
901
+ const path_postedValue = path + '.postedValue';
902
+ if (typeof obj_postedValue !== 'number' || (typeof obj_postedValue === 'number' && Math.floor(obj_postedValue) !== obj_postedValue)) {
903
+ return new TypeError('Expected "integer" but received "' + typeof obj_postedValue + '" (at "' + path_postedValue + '")');
904
+ }
905
+ }
906
+ if (obj.remainingAmount !== undefined) {
907
+ const obj_remainingAmount = obj.remainingAmount;
908
+ const path_remainingAmount = path + '.remainingAmount';
909
+ if (typeof obj_remainingAmount !== 'number') {
910
+ return new TypeError('Expected "number" but received "' + typeof obj_remainingAmount + '" (at "' + path_remainingAmount + '")');
911
+ }
912
+ }
913
+ if (obj.remainingValue !== undefined) {
914
+ const obj_remainingValue = obj.remainingValue;
915
+ const path_remainingValue = path + '.remainingValue';
916
+ if (typeof obj_remainingValue !== 'number' || (typeof obj_remainingValue === 'number' && Math.floor(obj_remainingValue) !== obj_remainingValue)) {
917
+ return new TypeError('Expected "integer" but received "' + typeof obj_remainingValue + '" (at "' + path_remainingValue + '")');
918
+ }
919
+ }
920
+ if (obj.scope !== undefined) {
921
+ const obj_scope = obj.scope;
922
+ const path_scope = path + '.scope';
923
+ if (typeof obj_scope !== 'string') {
924
+ return new TypeError('Expected "string" but received "' + typeof obj_scope + '" (at "' + path_scope + '")');
925
+ }
926
+ }
927
+ if (obj.totalUsedAmount !== undefined) {
928
+ const obj_totalUsedAmount = obj.totalUsedAmount;
929
+ const path_totalUsedAmount = path + '.totalUsedAmount';
930
+ if (typeof obj_totalUsedAmount !== 'number') {
931
+ return new TypeError('Expected "number" but received "' + typeof obj_totalUsedAmount + '" (at "' + path_totalUsedAmount + '")');
932
+ }
933
+ }
934
+ if (obj.totalUsedValue !== undefined) {
935
+ const obj_totalUsedValue = obj.totalUsedValue;
936
+ const path_totalUsedValue = path + '.totalUsedValue';
937
+ if (typeof obj_totalUsedValue !== 'number' || (typeof obj_totalUsedValue === 'number' && Math.floor(obj_totalUsedValue) !== obj_totalUsedValue)) {
938
+ return new TypeError('Expected "integer" but received "' + typeof obj_totalUsedValue + '" (at "' + path_totalUsedValue + '")');
939
+ }
940
+ }
941
+ })();
942
+ return v_error === undefined ? null : v_error;
943
+ }
944
+
945
+ const TTL$2 = 1000;
946
+ const VERSION$2 = "cb555dac128f300b8ecb7f878bff8049";
947
+ function validate$3(obj, path = 'CalculateAdjustmentsRepresentation') {
948
+ const v_error = (() => {
949
+ if (typeof obj !== 'object' || ArrayIsArray(obj) || obj === null) {
950
+ return new TypeError('Expected "object" but received "' + typeof obj + '" (at "' + path + '")');
951
+ }
952
+ if (obj.adjustedAmount !== undefined) {
953
+ const obj_adjustedAmount = obj.adjustedAmount;
954
+ const path_adjustedAmount = path + '.adjustedAmount';
955
+ if (typeof obj_adjustedAmount !== 'number') {
956
+ return new TypeError('Expected "number" but received "' + typeof obj_adjustedAmount + '" (at "' + path_adjustedAmount + '")');
957
+ }
958
+ }
959
+ if (obj.adjustmentReason !== undefined) {
960
+ const obj_adjustmentReason = obj.adjustmentReason;
961
+ const path_adjustmentReason = path + '.adjustmentReason';
962
+ if (typeof obj_adjustmentReason !== 'string') {
963
+ return new TypeError('Expected "string" but received "' + typeof obj_adjustmentReason + '" (at "' + path_adjustmentReason + '")');
964
+ }
965
+ }
966
+ if (obj.claimCovPaymentAdjustments !== undefined) {
967
+ const obj_claimCovPaymentAdjustments = obj.claimCovPaymentAdjustments;
968
+ const path_claimCovPaymentAdjustments = path + '.claimCovPaymentAdjustments';
969
+ if (!ArrayIsArray(obj_claimCovPaymentAdjustments)) {
970
+ return new TypeError('Expected "array" but received "' + typeof obj_claimCovPaymentAdjustments + '" (at "' + path_claimCovPaymentAdjustments + '")');
971
+ }
972
+ for (let i = 0; i < obj_claimCovPaymentAdjustments.length; i++) {
973
+ const obj_claimCovPaymentAdjustments_item = obj_claimCovPaymentAdjustments[i];
974
+ const path_claimCovPaymentAdjustments_item = path_claimCovPaymentAdjustments + '[' + i + ']';
975
+ const referencepath_claimCovPaymentAdjustments_itemValidationError = validate$5(obj_claimCovPaymentAdjustments_item, path_claimCovPaymentAdjustments_item);
976
+ if (referencepath_claimCovPaymentAdjustments_itemValidationError !== null) {
977
+ let message = 'Object doesn\'t match ClaimCovPaymentAdjDetailsRep (at "' + path_claimCovPaymentAdjustments_item + '")\n';
978
+ message += referencepath_claimCovPaymentAdjustments_itemValidationError.message.split('\n').map((line) => '\t' + line).join('\n');
979
+ return new TypeError(message);
980
+ }
981
+ }
982
+ }
983
+ if (obj.errors !== undefined) {
984
+ const obj_errors = obj.errors;
985
+ const path_errors = path + '.errors';
986
+ if (!ArrayIsArray(obj_errors)) {
987
+ return new TypeError('Expected "array" but received "' + typeof obj_errors + '" (at "' + path_errors + '")');
988
+ }
989
+ for (let i = 0; i < obj_errors.length; i++) {
990
+ const obj_errors_item = obj_errors[i];
991
+ const path_errors_item = path_errors + '[' + i + ']';
992
+ const referencepath_errors_itemValidationError = validate$a(obj_errors_item, path_errors_item);
993
+ if (referencepath_errors_itemValidationError !== null) {
994
+ let message = 'Object doesn\'t match ErrorDetail (at "' + path_errors_item + '")\n';
995
+ message += referencepath_errors_itemValidationError.message.split('\n').map((line) => '\t' + line).join('\n');
996
+ return new TypeError(message);
997
+ }
998
+ }
999
+ }
1000
+ if (obj.insPolicyLimitTrackings !== undefined) {
1001
+ const obj_insPolicyLimitTrackings = obj.insPolicyLimitTrackings;
1002
+ const path_insPolicyLimitTrackings = path + '.insPolicyLimitTrackings';
1003
+ if (!ArrayIsArray(obj_insPolicyLimitTrackings)) {
1004
+ return new TypeError('Expected "array" but received "' + typeof obj_insPolicyLimitTrackings + '" (at "' + path_insPolicyLimitTrackings + '")');
1005
+ }
1006
+ for (let i = 0; i < obj_insPolicyLimitTrackings.length; i++) {
1007
+ const obj_insPolicyLimitTrackings_item = obj_insPolicyLimitTrackings[i];
1008
+ const path_insPolicyLimitTrackings_item = path_insPolicyLimitTrackings + '[' + i + ']';
1009
+ const referencepath_insPolicyLimitTrackings_itemValidationError = validate$4(obj_insPolicyLimitTrackings_item, path_insPolicyLimitTrackings_item);
1010
+ if (referencepath_insPolicyLimitTrackings_itemValidationError !== null) {
1011
+ let message = 'Object doesn\'t match InsPolicyLimitTrackingDetailsRep (at "' + path_insPolicyLimitTrackings_item + '")\n';
1012
+ message += referencepath_insPolicyLimitTrackings_itemValidationError.message.split('\n').map((line) => '\t' + line).join('\n');
1013
+ return new TypeError(message);
1014
+ }
1015
+ }
1016
+ }
1017
+ const obj_isSuccess = obj.isSuccess;
1018
+ const path_isSuccess = path + '.isSuccess';
1019
+ if (typeof obj_isSuccess !== 'boolean') {
1020
+ return new TypeError('Expected "boolean" but received "' + typeof obj_isSuccess + '" (at "' + path_isSuccess + '")');
1021
+ }
1022
+ })();
1023
+ return v_error === undefined ? null : v_error;
1024
+ }
1025
+ const RepresentationType$2 = 'CalculateAdjustmentsRepresentation';
1026
+ function keyBuilder$2(luvio, config) {
1027
+ return keyPrefix + '::' + RepresentationType$2 + ':' + config.isSuccess;
1028
+ }
1029
+ function keyBuilderFromType$2(luvio, object) {
1030
+ const keyParams = {
1031
+ isSuccess: object.isSuccess
1032
+ };
1033
+ return keyBuilder$2(luvio, keyParams);
1034
+ }
1035
+ function normalize$2(input, existing, path, luvio, store, timestamp) {
1036
+ return input;
1037
+ }
1038
+ const select$5 = function CalculateAdjustmentsRepresentationSelect() {
1039
+ return {
1040
+ kind: 'Fragment',
1041
+ version: VERSION$2,
1042
+ private: [],
1043
+ opaque: true
1044
+ };
1045
+ };
1046
+ function equals$2(existing, incoming) {
1047
+ if (JSONStringify(incoming) !== JSONStringify(existing)) {
1048
+ return false;
1049
+ }
1050
+ return true;
1051
+ }
1052
+ const ingest$2 = function CalculateAdjustmentsRepresentationIngest(input, path, luvio, store, timestamp) {
1053
+ if (process.env.NODE_ENV !== 'production') {
1054
+ const validateError = validate$3(input);
1055
+ if (validateError !== null) {
1056
+ throw validateError;
1057
+ }
1058
+ }
1059
+ const key = keyBuilderFromType$2(luvio, input);
1060
+ const ttlToUse = TTL$2;
1061
+ ingestShape(input, path, luvio, store, timestamp, ttlToUse, key, normalize$2, "insuranceclaim", VERSION$2, RepresentationType$2, equals$2);
1062
+ return createLink(key);
1063
+ };
1064
+ function getTypeCacheKeys$2(rootKeySet, luvio, input, fullPathFactory) {
1065
+ // root cache key (uses fullPathFactory if keyBuilderFromType isn't defined)
1066
+ const rootKey = keyBuilderFromType$2(luvio, input);
1067
+ rootKeySet.set(rootKey, {
1068
+ namespace: keyPrefix,
1069
+ representationName: RepresentationType$2,
1070
+ mergeable: false
1071
+ });
1072
+ }
1073
+
1074
+ function select$4(luvio, params) {
1075
+ return select$5();
1076
+ }
1077
+ function getResponseCacheKeys$2(storeKeyMap, luvio, resourceParams, response) {
1078
+ getTypeCacheKeys$2(storeKeyMap, luvio, response);
1079
+ }
1080
+ function ingestSuccess$2(luvio, resourceParams, response) {
1081
+ const { body } = response;
1082
+ const key = keyBuilderFromType$2(luvio, body);
1083
+ luvio.storeIngest(key, ingest$2, body);
1084
+ const snapshot = luvio.storeLookup({
1085
+ recordId: key,
1086
+ node: select$4(),
1087
+ variables: {},
1088
+ });
1089
+ if (process.env.NODE_ENV !== 'production') {
1090
+ if (snapshot.state !== 'Fulfilled') {
1091
+ throw new Error('Invalid network response. Expected resource response to result in Fulfilled snapshot');
1092
+ }
1093
+ }
1094
+ deepFreeze(snapshot.data);
1095
+ return snapshot;
1096
+ }
1097
+ function createResourceRequest$2(config) {
1098
+ const headers = {};
1099
+ return {
1100
+ baseUri: '/services/data/v66.0',
1101
+ basePath: '/connect/insurance/claims/' + config.urlParams.claimId + '/coverages/' + config.urlParams.coverageId + '/calculate-adjustments',
1102
+ method: 'post',
1103
+ body: config.body,
1104
+ urlParams: config.urlParams,
1105
+ queryParams: {},
1106
+ headers,
1107
+ priority: 'normal',
1108
+ };
1109
+ }
1110
+
1111
+ const adapterName$2 = 'CalculateAdjustments';
1112
+ const CalculateAdjustments_ConfigPropertyMetadata = [
1113
+ generateParamConfigMetadata('claimId', true, 0 /* UrlParameter */, 0 /* String */),
1114
+ generateParamConfigMetadata('coverageId', true, 0 /* UrlParameter */, 0 /* String */),
1115
+ generateParamConfigMetadata('claimedAmount', true, 2 /* Body */, 2 /* Number */),
1116
+ ];
1117
+ const CalculateAdjustments_ConfigPropertyNames = /*#__PURE__*/ buildAdapterValidationConfig(adapterName$2, CalculateAdjustments_ConfigPropertyMetadata);
1118
+ const createResourceParams$2 = /*#__PURE__*/ createResourceParams$7(CalculateAdjustments_ConfigPropertyMetadata);
1119
+ function typeCheckConfig$2(untrustedConfig) {
1120
+ const config = {};
1121
+ typeCheckConfig$7(untrustedConfig, config, CalculateAdjustments_ConfigPropertyMetadata);
1122
+ return config;
1123
+ }
1124
+ function validateAdapterConfig$2(untrustedConfig, configPropertyNames) {
1125
+ if (!untrustedIsObject(untrustedConfig)) {
1126
+ return null;
1127
+ }
1128
+ if (process.env.NODE_ENV !== 'production') {
1129
+ validateConfig(untrustedConfig, configPropertyNames);
1130
+ }
1131
+ const config = typeCheckConfig$2(untrustedConfig);
1132
+ if (!areRequiredParametersPresent(config, configPropertyNames)) {
1133
+ return null;
1134
+ }
1135
+ return config;
1136
+ }
1137
+ function buildNetworkSnapshot$2(luvio, config, options) {
1138
+ const resourceParams = createResourceParams$2(config);
1139
+ const request = createResourceRequest$2(resourceParams);
1140
+ return luvio.dispatchResourceRequest(request, options)
1141
+ .then((response) => {
1142
+ return luvio.handleSuccessResponse(() => {
1143
+ const snapshot = ingestSuccess$2(luvio, resourceParams, response);
1144
+ return luvio.storeBroadcast().then(() => snapshot);
1145
+ }, () => {
1146
+ const cache = new StoreKeyMap();
1147
+ getResponseCacheKeys$2(cache, luvio, resourceParams, response.body);
1148
+ return cache;
1149
+ });
1150
+ }, (response) => {
1151
+ deepFreeze(response);
1152
+ throw response;
1153
+ });
1154
+ }
1155
+ const CalculateAdjustmentsAdapterFactory = (luvio) => {
1156
+ return function CalculateAdjustments(untrustedConfig) {
1157
+ const config = validateAdapterConfig$2(untrustedConfig, CalculateAdjustments_ConfigPropertyNames);
1158
+ // Invalid or incomplete config
1159
+ if (config === null) {
1160
+ throw new Error('Invalid config for "CalculateAdjustments"');
1161
+ }
1162
+ return buildNetworkSnapshot$2(luvio, config);
1163
+ };
1164
+ };
1165
+
1166
+ function validate$2(obj, path = 'InsPolicyLmtCalcStandingNode') {
1167
+ const v_error = (() => {
1168
+ if (typeof obj !== 'object' || ArrayIsArray(obj) || obj === null) {
1169
+ return new TypeError('Expected "object" but received "' + typeof obj + '" (at "' + path + '")');
1170
+ }
1171
+ const obj_applicableActions = obj.applicableActions;
1172
+ const path_applicableActions = path + '.applicableActions';
1173
+ if (!ArrayIsArray(obj_applicableActions)) {
1174
+ return new TypeError('Expected "array" but received "' + typeof obj_applicableActions + '" (at "' + path_applicableActions + '")');
1175
+ }
1176
+ for (let i = 0; i < obj_applicableActions.length; i++) {
1177
+ const obj_applicableActions_item = obj_applicableActions[i];
1178
+ const path_applicableActions_item = path_applicableActions + '[' + i + ']';
1179
+ if (typeof obj_applicableActions_item !== 'string') {
1180
+ return new TypeError('Expected "string" but received "' + typeof obj_applicableActions_item + '" (at "' + path_applicableActions_item + '")');
1181
+ }
1182
+ }
1183
+ const obj_category = obj.category;
1184
+ const path_category = path + '.category';
1185
+ if (typeof obj_category !== 'string') {
1186
+ return new TypeError('Expected "string" but received "' + typeof obj_category + '" (at "' + path_category + '")');
1187
+ }
1188
+ if (obj.claimCoverageId !== undefined) {
1189
+ const obj_claimCoverageId = obj.claimCoverageId;
1190
+ const path_claimCoverageId = path + '.claimCoverageId';
1191
+ if (typeof obj_claimCoverageId !== 'string') {
1192
+ return new TypeError('Expected "string" but received "' + typeof obj_claimCoverageId + '" (at "' + path_claimCoverageId + '")');
1193
+ }
1194
+ }
1195
+ if (obj.claimId !== undefined) {
1196
+ const obj_claimId = obj.claimId;
1197
+ const path_claimId = path + '.claimId';
1198
+ if (typeof obj_claimId !== 'string') {
1199
+ return new TypeError('Expected "string" but received "' + typeof obj_claimId + '" (at "' + path_claimId + '")');
1200
+ }
1201
+ }
1202
+ const obj_durationType = obj.durationType;
1203
+ const path_durationType = path + '.durationType';
1204
+ if (typeof obj_durationType !== 'string') {
1205
+ return new TypeError('Expected "string" but received "' + typeof obj_durationType + '" (at "' + path_durationType + '")');
1206
+ }
1207
+ if (obj.initialAmount !== undefined) {
1208
+ obj.initialAmount;
1209
+ }
1210
+ if (obj.initialValue !== undefined) {
1211
+ const obj_initialValue = obj.initialValue;
1212
+ const path_initialValue = path + '.initialValue';
1213
+ if (typeof obj_initialValue !== 'number' || (typeof obj_initialValue === 'number' && Math.floor(obj_initialValue) !== obj_initialValue)) {
1214
+ return new TypeError('Expected "integer" but received "' + typeof obj_initialValue + '" (at "' + path_initialValue + '")');
1215
+ }
1216
+ }
1217
+ if (obj.itemType !== undefined) {
1218
+ const obj_itemType = obj.itemType;
1219
+ const path_itemType = path + '.itemType';
1220
+ if (typeof obj_itemType !== 'string') {
1221
+ return new TypeError('Expected "string" but received "' + typeof obj_itemType + '" (at "' + path_itemType + '")');
1222
+ }
1223
+ }
1224
+ if (obj.parentMappedScopeId !== undefined) {
1225
+ const obj_parentMappedScopeId = obj.parentMappedScopeId;
1226
+ const path_parentMappedScopeId = path + '.parentMappedScopeId';
1227
+ if (typeof obj_parentMappedScopeId !== 'string') {
1228
+ return new TypeError('Expected "string" but received "' + typeof obj_parentMappedScopeId + '" (at "' + path_parentMappedScopeId + '")');
1229
+ }
1230
+ }
1231
+ if (obj.pendingAmount !== undefined) {
1232
+ obj.pendingAmount;
1233
+ }
1234
+ if (obj.pendingValue !== undefined) {
1235
+ const obj_pendingValue = obj.pendingValue;
1236
+ const path_pendingValue = path + '.pendingValue';
1237
+ if (typeof obj_pendingValue !== 'number' || (typeof obj_pendingValue === 'number' && Math.floor(obj_pendingValue) !== obj_pendingValue)) {
1238
+ return new TypeError('Expected "integer" but received "' + typeof obj_pendingValue + '" (at "' + path_pendingValue + '")');
1239
+ }
1240
+ }
1241
+ if (obj.policyAssetId !== undefined) {
1242
+ const obj_policyAssetId = obj.policyAssetId;
1243
+ const path_policyAssetId = path + '.policyAssetId';
1244
+ if (typeof obj_policyAssetId !== 'string') {
1245
+ return new TypeError('Expected "string" but received "' + typeof obj_policyAssetId + '" (at "' + path_policyAssetId + '")');
1246
+ }
1247
+ }
1248
+ if (obj.policyCoverageId !== undefined) {
1249
+ const obj_policyCoverageId = obj.policyCoverageId;
1250
+ const path_policyCoverageId = path + '.policyCoverageId';
1251
+ if (typeof obj_policyCoverageId !== 'string') {
1252
+ return new TypeError('Expected "string" but received "' + typeof obj_policyCoverageId + '" (at "' + path_policyCoverageId + '")');
1253
+ }
1254
+ }
1255
+ const obj_policyLimitId = obj.policyLimitId;
1256
+ const path_policyLimitId = path + '.policyLimitId';
1257
+ if (typeof obj_policyLimitId !== 'string') {
1258
+ return new TypeError('Expected "string" but received "' + typeof obj_policyLimitId + '" (at "' + path_policyLimitId + '")');
1259
+ }
1260
+ const obj_policyLimitStandingKey = obj.policyLimitStandingKey;
1261
+ const path_policyLimitStandingKey = path + '.policyLimitStandingKey';
1262
+ if (typeof obj_policyLimitStandingKey !== 'string') {
1263
+ return new TypeError('Expected "string" but received "' + typeof obj_policyLimitStandingKey + '" (at "' + path_policyLimitStandingKey + '")');
1264
+ }
1265
+ if (obj.policyParticipantId !== undefined) {
1266
+ const obj_policyParticipantId = obj.policyParticipantId;
1267
+ const path_policyParticipantId = path + '.policyParticipantId';
1268
+ if (typeof obj_policyParticipantId !== 'string') {
1269
+ return new TypeError('Expected "string" but received "' + typeof obj_policyParticipantId + '" (at "' + path_policyParticipantId + '")');
1270
+ }
1271
+ }
1272
+ if (obj.predictedRemainingAmount !== undefined) {
1273
+ obj.predictedRemainingAmount;
1274
+ }
1275
+ if (obj.predictedRemainingValue !== undefined) {
1276
+ const obj_predictedRemainingValue = obj.predictedRemainingValue;
1277
+ const path_predictedRemainingValue = path + '.predictedRemainingValue';
1278
+ if (typeof obj_predictedRemainingValue !== 'number' || (typeof obj_predictedRemainingValue === 'number' && Math.floor(obj_predictedRemainingValue) !== obj_predictedRemainingValue)) {
1279
+ return new TypeError('Expected "integer" but received "' + typeof obj_predictedRemainingValue + '" (at "' + path_predictedRemainingValue + '")');
1280
+ }
1281
+ }
1282
+ if (obj.prodtAttrMappedScopeId !== undefined) {
1283
+ const obj_prodtAttrMappedScopeId = obj.prodtAttrMappedScopeId;
1284
+ const path_prodtAttrMappedScopeId = path + '.prodtAttrMappedScopeId';
1285
+ if (typeof obj_prodtAttrMappedScopeId !== 'string') {
1286
+ return new TypeError('Expected "string" but received "' + typeof obj_prodtAttrMappedScopeId + '" (at "' + path_prodtAttrMappedScopeId + '")');
1287
+ }
1288
+ }
1289
+ if (obj.remainingAmount !== undefined) {
1290
+ obj.remainingAmount;
1291
+ }
1292
+ if (obj.remainingValue !== undefined) {
1293
+ const obj_remainingValue = obj.remainingValue;
1294
+ const path_remainingValue = path + '.remainingValue';
1295
+ if (typeof obj_remainingValue !== 'number' || (typeof obj_remainingValue === 'number' && Math.floor(obj_remainingValue) !== obj_remainingValue)) {
1296
+ return new TypeError('Expected "integer" but received "' + typeof obj_remainingValue + '" (at "' + path_remainingValue + '")');
1297
+ }
1298
+ }
1299
+ const obj_scope = obj.scope;
1300
+ const path_scope = path + '.scope';
1301
+ if (typeof obj_scope !== 'string') {
1302
+ return new TypeError('Expected "string" but received "' + typeof obj_scope + '" (at "' + path_scope + '")');
1303
+ }
1304
+ if (obj.totalUsedAmount !== undefined) {
1305
+ obj.totalUsedAmount;
1306
+ }
1307
+ if (obj.totalUsedValue !== undefined) {
1308
+ const obj_totalUsedValue = obj.totalUsedValue;
1309
+ const path_totalUsedValue = path + '.totalUsedValue';
1310
+ if (typeof obj_totalUsedValue !== 'number' || (typeof obj_totalUsedValue === 'number' && Math.floor(obj_totalUsedValue) !== obj_totalUsedValue)) {
1311
+ return new TypeError('Expected "integer" but received "' + typeof obj_totalUsedValue + '" (at "' + path_totalUsedValue + '")');
1312
+ }
1313
+ }
1314
+ })();
1315
+ return v_error === undefined ? null : v_error;
1316
+ }
1317
+
1318
+ const TTL$1 = 1000;
1319
+ const VERSION$1 = "f72bbc3e75993fc4d8c776d6241c197b";
1320
+ function validate$1(obj, path = 'InsPolicyLmtCalcStandingRepresentation') {
1321
+ const v_error = (() => {
1322
+ if (typeof obj !== 'object' || ArrayIsArray(obj) || obj === null) {
1323
+ return new TypeError('Expected "object" but received "' + typeof obj + '" (at "' + path + '")');
1324
+ }
1325
+ if (obj.errors !== undefined) {
1326
+ const obj_errors = obj.errors;
1327
+ const path_errors = path + '.errors';
1328
+ if (!ArrayIsArray(obj_errors)) {
1329
+ return new TypeError('Expected "array" but received "' + typeof obj_errors + '" (at "' + path_errors + '")');
1330
+ }
1331
+ for (let i = 0; i < obj_errors.length; i++) {
1332
+ const obj_errors_item = obj_errors[i];
1333
+ const path_errors_item = path_errors + '[' + i + ']';
1334
+ const referencepath_errors_itemValidationError = validate$a(obj_errors_item, path_errors_item);
1335
+ if (referencepath_errors_itemValidationError !== null) {
1336
+ let message = 'Object doesn\'t match ErrorDetail (at "' + path_errors_item + '")\n';
1337
+ message += referencepath_errors_itemValidationError.message.split('\n').map((line) => '\t' + line).join('\n');
1338
+ return new TypeError(message);
1339
+ }
1340
+ }
1341
+ }
1342
+ if (obj.insPolicyLmtCalcStandingNodes !== undefined) {
1343
+ const obj_insPolicyLmtCalcStandingNodes = obj.insPolicyLmtCalcStandingNodes;
1344
+ const path_insPolicyLmtCalcStandingNodes = path + '.insPolicyLmtCalcStandingNodes';
1345
+ if (!ArrayIsArray(obj_insPolicyLmtCalcStandingNodes)) {
1346
+ return new TypeError('Expected "array" but received "' + typeof obj_insPolicyLmtCalcStandingNodes + '" (at "' + path_insPolicyLmtCalcStandingNodes + '")');
1347
+ }
1348
+ for (let i = 0; i < obj_insPolicyLmtCalcStandingNodes.length; i++) {
1349
+ const obj_insPolicyLmtCalcStandingNodes_item = obj_insPolicyLmtCalcStandingNodes[i];
1350
+ const path_insPolicyLmtCalcStandingNodes_item = path_insPolicyLmtCalcStandingNodes + '[' + i + ']';
1351
+ const referencepath_insPolicyLmtCalcStandingNodes_itemValidationError = validate$2(obj_insPolicyLmtCalcStandingNodes_item, path_insPolicyLmtCalcStandingNodes_item);
1352
+ if (referencepath_insPolicyLmtCalcStandingNodes_itemValidationError !== null) {
1353
+ let message = 'Object doesn\'t match InsPolicyLmtCalcStandingNode (at "' + path_insPolicyLmtCalcStandingNodes_item + '")\n';
1354
+ message += referencepath_insPolicyLmtCalcStandingNodes_itemValidationError.message.split('\n').map((line) => '\t' + line).join('\n');
1355
+ return new TypeError(message);
1356
+ }
1357
+ }
1358
+ }
1359
+ const obj_isSuccess = obj.isSuccess;
1360
+ const path_isSuccess = path + '.isSuccess';
1361
+ if (typeof obj_isSuccess !== 'boolean') {
1362
+ return new TypeError('Expected "boolean" but received "' + typeof obj_isSuccess + '" (at "' + path_isSuccess + '")');
1363
+ }
1364
+ })();
1365
+ return v_error === undefined ? null : v_error;
1366
+ }
1367
+ const RepresentationType$1 = 'InsPolicyLmtCalcStandingRepresentation';
1368
+ function keyBuilder$1(luvio, config) {
1369
+ return keyPrefix + '::' + RepresentationType$1 + ':' + config.message;
1370
+ }
1371
+ function keyBuilderFromType$1(luvio, object) {
1372
+ const keyParams = {
1373
+ message: object.isSuccess
1374
+ };
1375
+ return keyBuilder$1(luvio, keyParams);
1376
+ }
1377
+ function normalize$1(input, existing, path, luvio, store, timestamp) {
1378
+ return input;
1379
+ }
1380
+ const select$3 = function InsPolicyLmtCalcStandingRepresentationSelect() {
1381
+ return {
1382
+ kind: 'Fragment',
1383
+ version: VERSION$1,
1384
+ private: [],
1385
+ opaque: true
1386
+ };
1387
+ };
1388
+ function equals$1(existing, incoming) {
1389
+ if (JSONStringify(incoming) !== JSONStringify(existing)) {
1390
+ return false;
1391
+ }
1392
+ return true;
1393
+ }
1394
+ const ingest$1 = function InsPolicyLmtCalcStandingRepresentationIngest(input, path, luvio, store, timestamp) {
1395
+ if (process.env.NODE_ENV !== 'production') {
1396
+ const validateError = validate$1(input);
1397
+ if (validateError !== null) {
1398
+ throw validateError;
1399
+ }
1400
+ }
1401
+ const key = keyBuilderFromType$1(luvio, input);
1402
+ const ttlToUse = TTL$1;
1403
+ ingestShape(input, path, luvio, store, timestamp, ttlToUse, key, normalize$1, "insuranceclaim", VERSION$1, RepresentationType$1, equals$1);
1404
+ return createLink(key);
1405
+ };
1406
+ function getTypeCacheKeys$1(rootKeySet, luvio, input, fullPathFactory) {
1407
+ // root cache key (uses fullPathFactory if keyBuilderFromType isn't defined)
1408
+ const rootKey = keyBuilderFromType$1(luvio, input);
1409
+ rootKeySet.set(rootKey, {
1410
+ namespace: keyPrefix,
1411
+ representationName: RepresentationType$1,
1412
+ mergeable: false
1413
+ });
1414
+ }
1415
+
1416
+ function select$2(luvio, params) {
1417
+ return select$3();
1418
+ }
1419
+ function getResponseCacheKeys$1(storeKeyMap, luvio, resourceParams, response) {
1420
+ getTypeCacheKeys$1(storeKeyMap, luvio, response);
1421
+ }
1422
+ function ingestSuccess$1(luvio, resourceParams, response) {
1423
+ const { body } = response;
1424
+ const key = keyBuilderFromType$1(luvio, body);
1425
+ luvio.storeIngest(key, ingest$1, body);
1426
+ const snapshot = luvio.storeLookup({
1427
+ recordId: key,
1428
+ node: select$2(),
1429
+ variables: {},
1430
+ });
1431
+ if (process.env.NODE_ENV !== 'production') {
1432
+ if (snapshot.state !== 'Fulfilled') {
1433
+ throw new Error('Invalid network response. Expected resource response to result in Fulfilled snapshot');
1434
+ }
1435
+ }
1436
+ deepFreeze(snapshot.data);
1437
+ return snapshot;
1438
+ }
1439
+ function createResourceRequest$1(config) {
1440
+ const headers = {};
1441
+ return {
1442
+ baseUri: '/services/data/v66.0',
1443
+ basePath: '/connect/insurance/policy-limit/calculate-standings',
1444
+ method: 'post',
1445
+ body: config.body,
1446
+ urlParams: {},
1447
+ queryParams: {},
1448
+ headers,
1449
+ priority: 'normal',
1450
+ };
1451
+ }
1452
+
1453
+ const adapterName$1 = 'PolicyLimitStandingCalculation';
1454
+ const PolicyLimitStandingCalculation_ConfigPropertyMetadata = [
1455
+ generateParamConfigMetadata('claimId', false, 2 /* Body */, 0 /* String */),
1456
+ generateParamConfigMetadata('claimCoverageId', false, 2 /* Body */, 0 /* String */),
1457
+ generateParamConfigMetadata('options', false, 2 /* Body */, 4 /* Unsupported */),
1458
+ generateParamConfigMetadata('policyAssetId', false, 2 /* Body */, 0 /* String */),
1459
+ generateParamConfigMetadata('policyCoverageId', false, 2 /* Body */, 0 /* String */),
1460
+ generateParamConfigMetadata('policyId', false, 2 /* Body */, 0 /* String */),
1461
+ generateParamConfigMetadata('policyParticipantId', false, 2 /* Body */, 0 /* String */),
1462
+ ];
1463
+ const PolicyLimitStandingCalculation_ConfigPropertyNames = /*#__PURE__*/ buildAdapterValidationConfig(adapterName$1, PolicyLimitStandingCalculation_ConfigPropertyMetadata);
1464
+ const createResourceParams$1 = /*#__PURE__*/ createResourceParams$7(PolicyLimitStandingCalculation_ConfigPropertyMetadata);
1465
+ function typeCheckConfig$1(untrustedConfig) {
1466
+ const config = {};
1467
+ typeCheckConfig$7(untrustedConfig, config, PolicyLimitStandingCalculation_ConfigPropertyMetadata);
1468
+ const untrustedConfig_options = untrustedConfig.options;
1469
+ config.options = untrustedConfig_options;
1470
+ return config;
1471
+ }
1472
+ function validateAdapterConfig$1(untrustedConfig, configPropertyNames) {
1473
+ if (!untrustedIsObject(untrustedConfig)) {
1474
+ return null;
1475
+ }
1476
+ if (process.env.NODE_ENV !== 'production') {
1477
+ validateConfig(untrustedConfig, configPropertyNames);
1478
+ }
1479
+ const config = typeCheckConfig$1(untrustedConfig);
1480
+ if (!areRequiredParametersPresent(config, configPropertyNames)) {
1481
+ return null;
1482
+ }
1483
+ return config;
1484
+ }
1485
+ function buildNetworkSnapshot$1(luvio, config, options) {
1486
+ const resourceParams = createResourceParams$1(config);
1487
+ const request = createResourceRequest$1(resourceParams);
1488
+ return luvio.dispatchResourceRequest(request, options)
1489
+ .then((response) => {
1490
+ return luvio.handleSuccessResponse(() => {
1491
+ const snapshot = ingestSuccess$1(luvio, resourceParams, response);
1492
+ return luvio.storeBroadcast().then(() => snapshot);
1493
+ }, () => {
1494
+ const cache = new StoreKeyMap();
1495
+ getResponseCacheKeys$1(cache, luvio, resourceParams, response.body);
1496
+ return cache;
1497
+ });
1498
+ }, (response) => {
1499
+ deepFreeze(response);
1500
+ throw response;
1501
+ });
1502
+ }
1503
+ const PolicyLimitStandingCalculationAdapterFactory = (luvio) => {
1504
+ return function PolicyLimitStandingCalculation(untrustedConfig) {
1505
+ const config = validateAdapterConfig$1(untrustedConfig, PolicyLimitStandingCalculation_ConfigPropertyNames);
1506
+ // Invalid or incomplete config
1507
+ if (config === null) {
1508
+ throw new Error('Invalid config for "PolicyLimitStandingCalculation"');
1509
+ }
1510
+ return buildNetworkSnapshot$1(luvio, config);
1511
+ };
1512
+ };
1513
+
1514
+ const TTL = 1000;
1515
+ const VERSION = "ce95b6e905d0d174a54ba2aa4d3791c4";
1516
+ function validate(obj, path = 'VerifyPolicyCoverageRepresentation') {
1517
+ const v_error = (() => {
1518
+ if (typeof obj !== 'object' || ArrayIsArray(obj) || obj === null) {
1519
+ return new TypeError('Expected "object" but received "' + typeof obj + '" (at "' + path + '")');
1520
+ }
1521
+ if (obj.errors !== undefined) {
1522
+ const obj_errors = obj.errors;
1523
+ const path_errors = path + '.errors';
1524
+ if (!ArrayIsArray(obj_errors)) {
1525
+ return new TypeError('Expected "array" but received "' + typeof obj_errors + '" (at "' + path_errors + '")');
1526
+ }
1527
+ for (let i = 0; i < obj_errors.length; i++) {
1528
+ const obj_errors_item = obj_errors[i];
1529
+ const path_errors_item = path_errors + '[' + i + ']';
1530
+ const referencepath_errors_itemValidationError = validate$a(obj_errors_item, path_errors_item);
1531
+ if (referencepath_errors_itemValidationError !== null) {
1532
+ let message = 'Object doesn\'t match ErrorDetail (at "' + path_errors_item + '")\n';
1533
+ message += referencepath_errors_itemValidationError.message.split('\n').map((line) => '\t' + line).join('\n');
1534
+ return new TypeError(message);
1535
+ }
1536
+ }
1537
+ }
1538
+ const obj_isSuccess = obj.isSuccess;
1539
+ const path_isSuccess = path + '.isSuccess';
1540
+ if (typeof obj_isSuccess !== 'boolean') {
1541
+ return new TypeError('Expected "boolean" but received "' + typeof obj_isSuccess + '" (at "' + path_isSuccess + '")');
1542
+ }
1543
+ })();
1544
+ return v_error === undefined ? null : v_error;
1545
+ }
1546
+ const RepresentationType = 'VerifyPolicyCoverageRepresentation';
1547
+ function keyBuilder(luvio, config) {
1548
+ return keyPrefix + '::' + RepresentationType + ':' + config.isSuccess;
1549
+ }
1550
+ function keyBuilderFromType(luvio, object) {
1551
+ const keyParams = {
1552
+ isSuccess: object.isSuccess
1553
+ };
1554
+ return keyBuilder(luvio, keyParams);
1555
+ }
1556
+ function normalize(input, existing, path, luvio, store, timestamp) {
1557
+ return input;
1558
+ }
1559
+ const select$1 = function VerifyPolicyCoverageRepresentationSelect() {
1560
+ return {
1561
+ kind: 'Fragment',
1562
+ version: VERSION,
1563
+ private: [],
1564
+ opaque: true
1565
+ };
1566
+ };
1567
+ function equals(existing, incoming) {
1568
+ if (JSONStringify(incoming) !== JSONStringify(existing)) {
1569
+ return false;
1570
+ }
1571
+ return true;
1572
+ }
1573
+ const ingest = function VerifyPolicyCoverageRepresentationIngest(input, path, luvio, store, timestamp) {
1574
+ if (process.env.NODE_ENV !== 'production') {
1575
+ const validateError = validate(input);
1576
+ if (validateError !== null) {
1577
+ throw validateError;
1578
+ }
1579
+ }
1580
+ const key = keyBuilderFromType(luvio, input);
1581
+ const ttlToUse = TTL;
1582
+ ingestShape(input, path, luvio, store, timestamp, ttlToUse, key, normalize, "insuranceclaim", VERSION, RepresentationType, equals);
1583
+ return createLink(key);
1584
+ };
1585
+ function getTypeCacheKeys(rootKeySet, luvio, input, fullPathFactory) {
1586
+ // root cache key (uses fullPathFactory if keyBuilderFromType isn't defined)
1587
+ const rootKey = keyBuilderFromType(luvio, input);
1588
+ rootKeySet.set(rootKey, {
1589
+ namespace: keyPrefix,
1590
+ representationName: RepresentationType,
1591
+ mergeable: false
1592
+ });
1593
+ }
1594
+
1595
+ function select(luvio, params) {
1596
+ return select$1();
1597
+ }
1598
+ function getResponseCacheKeys(storeKeyMap, luvio, resourceParams, response) {
1599
+ getTypeCacheKeys(storeKeyMap, luvio, response);
1600
+ }
1601
+ function ingestSuccess(luvio, resourceParams, response) {
1602
+ const { body } = response;
1603
+ const key = keyBuilderFromType(luvio, body);
1604
+ luvio.storeIngest(key, ingest, body);
1605
+ const snapshot = luvio.storeLookup({
1606
+ recordId: key,
1607
+ node: select(),
1608
+ variables: {},
1609
+ });
1610
+ if (process.env.NODE_ENV !== 'production') {
1611
+ if (snapshot.state !== 'Fulfilled') {
1612
+ throw new Error('Invalid network response. Expected resource response to result in Fulfilled snapshot');
1613
+ }
1614
+ }
1615
+ deepFreeze(snapshot.data);
1616
+ return snapshot;
1617
+ }
1618
+ function createResourceRequest(config) {
1619
+ const headers = {};
1620
+ return {
1621
+ baseUri: '/services/data/v66.0',
1622
+ basePath: '/connect/insurance/policies/' + config.urlParams.policyId + '/coverages/' + config.urlParams.coverageId + '/verify',
1623
+ method: 'post',
1624
+ body: config.body,
1625
+ urlParams: config.urlParams,
1626
+ queryParams: {},
1627
+ headers,
1628
+ priority: 'normal',
1629
+ };
1630
+ }
1631
+
1632
+ const adapterName = 'postVerifyPolicyCoverage';
1633
+ const postVerifyPolicyCoverage_ConfigPropertyMetadata = [
1634
+ generateParamConfigMetadata('coverageId', true, 0 /* UrlParameter */, 0 /* String */),
1635
+ generateParamConfigMetadata('policyId', true, 0 /* UrlParameter */, 0 /* String */),
1636
+ generateParamConfigMetadata('insuredAssetOrParticipantId', false, 2 /* Body */, 0 /* String */),
1637
+ generateParamConfigMetadata('lossDate', true, 2 /* Body */, 0 /* String */),
1638
+ ];
1639
+ const postVerifyPolicyCoverage_ConfigPropertyNames = /*#__PURE__*/ buildAdapterValidationConfig(adapterName, postVerifyPolicyCoverage_ConfigPropertyMetadata);
1640
+ const createResourceParams = /*#__PURE__*/ createResourceParams$7(postVerifyPolicyCoverage_ConfigPropertyMetadata);
1641
+ function typeCheckConfig(untrustedConfig) {
1642
+ const config = {};
1643
+ typeCheckConfig$7(untrustedConfig, config, postVerifyPolicyCoverage_ConfigPropertyMetadata);
1644
+ return config;
1645
+ }
1646
+ function validateAdapterConfig(untrustedConfig, configPropertyNames) {
1647
+ if (!untrustedIsObject(untrustedConfig)) {
1648
+ return null;
1649
+ }
1650
+ if (process.env.NODE_ENV !== 'production') {
1651
+ validateConfig(untrustedConfig, configPropertyNames);
1652
+ }
1653
+ const config = typeCheckConfig(untrustedConfig);
1654
+ if (!areRequiredParametersPresent(config, configPropertyNames)) {
1655
+ return null;
1656
+ }
1657
+ return config;
1658
+ }
1659
+ function buildNetworkSnapshot(luvio, config, options) {
1660
+ const resourceParams = createResourceParams(config);
1661
+ const request = createResourceRequest(resourceParams);
1662
+ return luvio.dispatchResourceRequest(request, options)
1663
+ .then((response) => {
1664
+ return luvio.handleSuccessResponse(() => {
1665
+ const snapshot = ingestSuccess(luvio, resourceParams, response);
1666
+ return luvio.storeBroadcast().then(() => snapshot);
1667
+ }, () => {
1668
+ const cache = new StoreKeyMap();
1669
+ getResponseCacheKeys(cache, luvio, resourceParams, response.body);
1670
+ return cache;
1671
+ });
1672
+ }, (response) => {
1673
+ deepFreeze(response);
1674
+ throw response;
1675
+ });
1676
+ }
1677
+ const postVerifyPolicyCoverageAdapterFactory = (luvio) => {
1678
+ return function postVerifyPolicyCoverage(untrustedConfig) {
1679
+ const config = validateAdapterConfig(untrustedConfig, postVerifyPolicyCoverage_ConfigPropertyNames);
1680
+ // Invalid or incomplete config
1681
+ if (config === null) {
1682
+ throw new Error('Invalid config for "postVerifyPolicyCoverage"');
1683
+ }
1684
+ return buildNetworkSnapshot(luvio, config);
1685
+ };
1686
+ };
1687
+
1688
+ export { CalculateAdjustmentsAdapterFactory, CancelClaimCoveragePaymentDetailAdapterFactory, CreateClaimCoveragePaymentDetailAdapterFactory, DeleteClaimCoveragePaymentDetailAdapterFactory, PayClaimCoveragePaymentDetailAdapterFactory, PolicyLimitStandingCalculationAdapterFactory, postVerifyPolicyCoverageAdapterFactory };