@salesforce/lds-adapters-industries-public-sector 1.100.2

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 (93) hide show
  1. package/LICENSE.txt +82 -0
  2. package/dist/es/es2018/industries-public-sector.js +4434 -0
  3. package/dist/types/src/generated/adapters/adapter-utils.d.ts +66 -0
  4. package/dist/types/src/generated/adapters/createBenefitDisbursements.d.ts +15 -0
  5. package/dist/types/src/generated/adapters/createCarePlanTasks.d.ts +16 -0
  6. package/dist/types/src/generated/adapters/getCarePlanBenefitSessionDetails.d.ts +26 -0
  7. package/dist/types/src/generated/adapters/getCarePlanDefinition.d.ts +27 -0
  8. package/dist/types/src/generated/adapters/getCarePlanDetails.d.ts +27 -0
  9. package/dist/types/src/generated/adapters/getCarePlanTasks.d.ts +27 -0
  10. package/dist/types/src/generated/adapters/getCarePlanTemplateDetails.d.ts +27 -0
  11. package/dist/types/src/generated/adapters/postCarePlanDetails.d.ts +15 -0
  12. package/dist/types/src/generated/adapters/postCarePlanTemplateDetails.d.ts +17 -0
  13. package/dist/types/src/generated/adapters/updateCarePlanDetails.d.ts +16 -0
  14. package/dist/types/src/generated/adapters/updateCarePlanTasks.d.ts +16 -0
  15. package/dist/types/src/generated/artifacts/main.d.ts +11 -0
  16. package/dist/types/src/generated/artifacts/sfdc.d.ts +20 -0
  17. package/dist/types/src/generated/resources/getConnectCareplanBenefitSessionInfoByCarePlanId.d.ts +15 -0
  18. package/dist/types/src/generated/resources/getConnectCareplanCarePlansByCarePlanId.d.ts +16 -0
  19. package/dist/types/src/generated/resources/getConnectCareplanCarePlansTasksByCarePlanId.d.ts +18 -0
  20. package/dist/types/src/generated/resources/getConnectCareplanCareplanTemplatesByCarePlanTemplateId.d.ts +16 -0
  21. package/dist/types/src/generated/resources/getConnectCareplanDefinitionsByDefinitionId.d.ts +16 -0
  22. package/dist/types/src/generated/resources/patchConnectCareplanCarePlansByCarePlanId.d.ts +16 -0
  23. package/dist/types/src/generated/resources/patchConnectCareplanCarePlansTasksByCarePlanId.d.ts +16 -0
  24. package/dist/types/src/generated/resources/postConnectBenefitDisbursements.d.ts +13 -0
  25. package/dist/types/src/generated/resources/postConnectCareplanCarePlans.d.ts +13 -0
  26. package/dist/types/src/generated/resources/postConnectCareplanCarePlansTasksByCarePlanId.d.ts +16 -0
  27. package/dist/types/src/generated/resources/postConnectCareplanCareplanTemplatesActionsByActionTypeAndCarePlanTemplateId.d.ts +17 -0
  28. package/dist/types/src/generated/types/ActionPlanTemplateItemRepresentation.d.ts +44 -0
  29. package/dist/types/src/generated/types/ActionPlanTemplateItemsRepresentation.d.ts +30 -0
  30. package/dist/types/src/generated/types/ActionPlanTemplateListRepresentation.d.ts +30 -0
  31. package/dist/types/src/generated/types/ActionPlanTemplateRepresentation.d.ts +36 -0
  32. package/dist/types/src/generated/types/AdhocCarePlanTaskListInputRepresentation.d.ts +30 -0
  33. package/dist/types/src/generated/types/BenefitAssignmentInputRepresentation.d.ts +71 -0
  34. package/dist/types/src/generated/types/BenefitAssignmentListInputRepresentation.d.ts +30 -0
  35. package/dist/types/src/generated/types/BenefitAssignmentListRepresentation.d.ts +30 -0
  36. package/dist/types/src/generated/types/BenefitAssignmentRepresentation.d.ts +80 -0
  37. package/dist/types/src/generated/types/BenefitDisbursementForBenefitSessionInputRepresentation.d.ts +47 -0
  38. package/dist/types/src/generated/types/BenefitDisbursementListInputRepresentation.d.ts +30 -0
  39. package/dist/types/src/generated/types/BenefitDisbursementsForBenefitSessionInputRepresentation.d.ts +33 -0
  40. package/dist/types/src/generated/types/BenefitDisbursementsForBenefitSessionInputRepresentationWrapper.d.ts +29 -0
  41. package/dist/types/src/generated/types/BenefitListRepresentation.d.ts +30 -0
  42. package/dist/types/src/generated/types/BenefitOutputRepresentation.d.ts +57 -0
  43. package/dist/types/src/generated/types/CarePlanBenefitSessionInfoListRepresentation.d.ts +30 -0
  44. package/dist/types/src/generated/types/CarePlanBenefitSessionInfoRepresentation.d.ts +38 -0
  45. package/dist/types/src/generated/types/CarePlanBenefitSessionOutputRepresentation.d.ts +34 -0
  46. package/dist/types/src/generated/types/CarePlanDefinitionOutputRepresentation.d.ts +46 -0
  47. package/dist/types/src/generated/types/CarePlanInputRepresentation.d.ts +69 -0
  48. package/dist/types/src/generated/types/CarePlanInputRepresentationWrapper.d.ts +29 -0
  49. package/dist/types/src/generated/types/CarePlanRepresentation.d.ts +92 -0
  50. package/dist/types/src/generated/types/CarePlanSessionEnrolleeInfoListRepresentation.d.ts +30 -0
  51. package/dist/types/src/generated/types/CarePlanSessionEnrolleeInfoRepresentation.d.ts +44 -0
  52. package/dist/types/src/generated/types/CarePlanTaskInputRepresentation.d.ts +50 -0
  53. package/dist/types/src/generated/types/CarePlanTaskListInputRepresentation.d.ts +30 -0
  54. package/dist/types/src/generated/types/CarePlanTaskListRepresentation.d.ts +30 -0
  55. package/dist/types/src/generated/types/CarePlanTaskRepresentation.d.ts +60 -0
  56. package/dist/types/src/generated/types/CarePlanTasksInputRepresentation.d.ts +37 -0
  57. package/dist/types/src/generated/types/CarePlanTasksMapInputRepresentation.d.ts +34 -0
  58. package/dist/types/src/generated/types/CarePlanTasksMapInputRepresentationWrapper.d.ts +29 -0
  59. package/dist/types/src/generated/types/CarePlanTasksMapRepresentation.d.ts +35 -0
  60. package/dist/types/src/generated/types/CarePlanTasksRepresentation.d.ts +30 -0
  61. package/dist/types/src/generated/types/CarePlanTemplateAssociationsInputRepresentation.d.ts +32 -0
  62. package/dist/types/src/generated/types/CarePlanTemplateAssociationsInputRepresentationWrapper.d.ts +29 -0
  63. package/dist/types/src/generated/types/CarePlanTemplateBenefitInputRepresentation.d.ts +32 -0
  64. package/dist/types/src/generated/types/CarePlanTemplateBenefitListInputRepresentation.d.ts +30 -0
  65. package/dist/types/src/generated/types/CarePlanTemplateBenefitListRepresentation.d.ts +30 -0
  66. package/dist/types/src/generated/types/CarePlanTemplateBenefitRepresentation.d.ts +36 -0
  67. package/dist/types/src/generated/types/CarePlanTemplateGoalInputRepresentation.d.ts +32 -0
  68. package/dist/types/src/generated/types/CarePlanTemplateGoalListInputRepresentation.d.ts +30 -0
  69. package/dist/types/src/generated/types/CarePlanTemplateGoalListRepresentation.d.ts +30 -0
  70. package/dist/types/src/generated/types/CarePlanTemplateGoalRepresentation.d.ts +35 -0
  71. package/dist/types/src/generated/types/CarePlanTemplateRepresentation.d.ts +58 -0
  72. package/dist/types/src/generated/types/CustomFieldInputRepresentation.d.ts +35 -0
  73. package/dist/types/src/generated/types/CustomFieldListInputRepresentation.d.ts +30 -0
  74. package/dist/types/src/generated/types/CustomFieldListRepresentation.d.ts +30 -0
  75. package/dist/types/src/generated/types/CustomFieldRepresentation.d.ts +35 -0
  76. package/dist/types/src/generated/types/ExcludedCarePlanTaskInputRepresentation.d.ts +29 -0
  77. package/dist/types/src/generated/types/GenericOutputRepresentation.d.ts +47 -0
  78. package/dist/types/src/generated/types/GoalAssignmentInputRepresentation.d.ts +71 -0
  79. package/dist/types/src/generated/types/GoalAssignmentListInputRepresentation.d.ts +30 -0
  80. package/dist/types/src/generated/types/GoalAssignmentListRepresentation.d.ts +30 -0
  81. package/dist/types/src/generated/types/GoalAssignmentRepresentation.d.ts +87 -0
  82. package/dist/types/src/generated/types/GoalDefinitionListRepresentation.d.ts +30 -0
  83. package/dist/types/src/generated/types/GoalDefinitionOutputRepresentation.d.ts +53 -0
  84. package/dist/types/src/generated/types/type-utils.d.ts +39 -0
  85. package/dist/types/src/main.d.ts +3 -0
  86. package/dist/types/src/sfdc.d.ts +3 -0
  87. package/dist/umd/es2018/industries-public-sector.js +4454 -0
  88. package/dist/umd/es5/industries-public-sector.js +4506 -0
  89. package/package.json +73 -0
  90. package/sfdc/index.d.ts +1 -0
  91. package/sfdc/index.js +4645 -0
  92. package/src/raml/api.raml +1341 -0
  93. package/src/raml/luvio.raml +123 -0
@@ -0,0 +1,4506 @@
1
+ /**
2
+ * Copyright (c) 2022, Salesforce, Inc.,
3
+ * All rights reserved.
4
+ * For full license text, see the LICENSE.txt file
5
+ */
6
+
7
+ (function (global, factory) {
8
+ typeof exports === 'object' && typeof module !== 'undefined' ? factory(exports, require('@luvio/engine')) :
9
+ typeof define === 'function' && define.amd ? define(['exports', '@luvio/engine'], factory) :
10
+ (global = typeof globalThis !== 'undefined' ? globalThis : global || self, factory(global["industriesPublic-sector"] = {}, global.engine));
11
+ })(this, (function (exports, engine) { 'use strict';
12
+
13
+ var ObjectPrototypeHasOwnProperty = Object.prototype.hasOwnProperty;
14
+ var ObjectKeys$1 = Object.keys;
15
+ var ArrayIsArray$1 = Array.isArray;
16
+ /**
17
+ * Validates an adapter config is well-formed.
18
+ * @param config The config to validate.
19
+ * @param adapter The adapter validation configuration.
20
+ * @param oneOf The keys the config must contain at least one of.
21
+ * @throws A TypeError if config doesn't satisfy the adapter's config validation.
22
+ */
23
+ function validateConfig(config, adapter, oneOf) {
24
+ var displayName = adapter.displayName;
25
+ var _a = adapter.parameters, required = _a.required, optional = _a.optional, unsupported = _a.unsupported;
26
+ if (config === undefined ||
27
+ required.every(function (req) { return ObjectPrototypeHasOwnProperty.call(config, req); }) === false) {
28
+ throw new TypeError("adapter ".concat(displayName, " configuration must specify ").concat(required.sort().join(', ')));
29
+ }
30
+ if (oneOf && oneOf.some(function (req) { return ObjectPrototypeHasOwnProperty.call(config, req); }) === false) {
31
+ throw new TypeError("adapter ".concat(displayName, " configuration must specify one of ").concat(oneOf.sort().join(', ')));
32
+ }
33
+ if (unsupported !== undefined &&
34
+ unsupported.some(function (req) { return ObjectPrototypeHasOwnProperty.call(config, req); })) {
35
+ throw new TypeError("adapter ".concat(displayName, " does not yet support ").concat(unsupported.sort().join(', ')));
36
+ }
37
+ var supported = required.concat(optional);
38
+ if (ObjectKeys$1(config).some(function (key) { return !supported.includes(key); })) {
39
+ throw new TypeError("adapter ".concat(displayName, " configuration supports only ").concat(supported.sort().join(', ')));
40
+ }
41
+ }
42
+ function untrustedIsObject(untrusted) {
43
+ return typeof untrusted === 'object' && untrusted !== null && ArrayIsArray$1(untrusted) === false;
44
+ }
45
+ function areRequiredParametersPresent(config, configPropertyNames) {
46
+ return configPropertyNames.parameters.required.every(function (req) { return req in config; });
47
+ }
48
+ var snapshotRefreshOptions = {
49
+ overrides: {
50
+ headers: {
51
+ 'Cache-Control': 'no-cache',
52
+ },
53
+ }
54
+ };
55
+ var keyPrefix = 'public-sector';
56
+
57
+ var ObjectFreeze = Object.freeze, ObjectKeys = Object.keys;
58
+ var ArrayIsArray = Array.isArray;
59
+ var JSONStringify = JSON.stringify;
60
+ function deepFreeze$v(value) {
61
+ // No need to freeze primitives
62
+ if (typeof value !== 'object' || value === null) {
63
+ return;
64
+ }
65
+ if (ArrayIsArray(value)) {
66
+ for (var i = 0, len = value.length; i < len; i += 1) {
67
+ deepFreeze$v(value[i]);
68
+ }
69
+ }
70
+ else {
71
+ var keys = ObjectKeys(value);
72
+ for (var i = 0, len = keys.length; i < len; i += 1) {
73
+ deepFreeze$v(value[keys[i]]);
74
+ }
75
+ }
76
+ ObjectFreeze(value);
77
+ }
78
+ function createLink(ref) {
79
+ return {
80
+ __ref: engine.serializeStructuredKey(ref),
81
+ };
82
+ }
83
+
84
+ function validate$P(obj, path) {
85
+ if (path === void 0) { path = 'BenefitDisbursementForBenefitSessionInputRepresentation'; }
86
+ var v_error = (function () {
87
+ if (typeof obj !== 'object' || ArrayIsArray(obj) || obj === null) {
88
+ return new TypeError('Expected "object" but received "' + typeof obj + '" (at "' + path + '")');
89
+ }
90
+ var obj_actualCompletionDate = obj.actualCompletionDate;
91
+ var path_actualCompletionDate = path + '.actualCompletionDate';
92
+ if (typeof obj_actualCompletionDate !== 'string') {
93
+ return new TypeError('Expected "string" but received "' + typeof obj_actualCompletionDate + '" (at "' + path_actualCompletionDate + '")');
94
+ }
95
+ if (obj.benefitCategory !== undefined) {
96
+ var obj_benefitCategory = obj.benefitCategory;
97
+ var path_benefitCategory = path + '.benefitCategory';
98
+ if (typeof obj_benefitCategory !== 'string') {
99
+ return new TypeError('Expected "string" but received "' + typeof obj_benefitCategory + '" (at "' + path_benefitCategory + '")');
100
+ }
101
+ }
102
+ var obj_benefitSessionId = obj.benefitSessionId;
103
+ var path_benefitSessionId = path + '.benefitSessionId';
104
+ if (typeof obj_benefitSessionId !== 'string') {
105
+ return new TypeError('Expected "string" but received "' + typeof obj_benefitSessionId + '" (at "' + path_benefitSessionId + '")');
106
+ }
107
+ if (obj.description !== undefined) {
108
+ var obj_description = obj.description;
109
+ var path_description = path + '.description';
110
+ if (typeof obj_description !== 'string') {
111
+ return new TypeError('Expected "string" but received "' + typeof obj_description + '" (at "' + path_description + '")');
112
+ }
113
+ }
114
+ if (obj.disbursementStatus !== undefined) {
115
+ var obj_disbursementStatus = obj.disbursementStatus;
116
+ var path_disbursementStatus = path + '.disbursementStatus';
117
+ if (typeof obj_disbursementStatus !== 'string') {
118
+ return new TypeError('Expected "string" but received "' + typeof obj_disbursementStatus + '" (at "' + path_disbursementStatus + '")');
119
+ }
120
+ }
121
+ if (obj.endDate !== undefined) {
122
+ var obj_endDate = obj.endDate;
123
+ var path_endDate = path + '.endDate';
124
+ if (typeof obj_endDate !== 'string') {
125
+ return new TypeError('Expected "string" but received "' + typeof obj_endDate + '" (at "' + path_endDate + '")');
126
+ }
127
+ }
128
+ if (obj.startDate !== undefined) {
129
+ var obj_startDate = obj.startDate;
130
+ var path_startDate = path + '.startDate';
131
+ if (typeof obj_startDate !== 'string') {
132
+ return new TypeError('Expected "string" but received "' + typeof obj_startDate + '" (at "' + path_startDate + '")');
133
+ }
134
+ }
135
+ })();
136
+ return v_error === undefined ? null : v_error;
137
+ }
138
+
139
+ function validate$O(obj, path) {
140
+ if (path === void 0) { path = 'BenefitDisbursementListInputRepresentation'; }
141
+ var v_error = (function () {
142
+ if (typeof obj !== 'object' || ArrayIsArray(obj) || obj === null) {
143
+ return new TypeError('Expected "object" but received "' + typeof obj + '" (at "' + path + '")');
144
+ }
145
+ var obj_records = obj.records;
146
+ var path_records = path + '.records';
147
+ if (!ArrayIsArray(obj_records)) {
148
+ return new TypeError('Expected "array" but received "' + typeof obj_records + '" (at "' + path_records + '")');
149
+ }
150
+ for (var i = 0; i < obj_records.length; i++) {
151
+ var obj_records_item = obj_records[i];
152
+ var path_records_item = path_records + '[' + i + ']';
153
+ var referencepath_records_itemValidationError = validate$P(obj_records_item, path_records_item);
154
+ if (referencepath_records_itemValidationError !== null) {
155
+ var message = 'Object doesn\'t match BenefitDisbursementForBenefitSessionInputRepresentation (at "' + path_records_item + '")\n';
156
+ message += referencepath_records_itemValidationError.message.split('\n').map(function (line) { return '\t' + line; }).join('\n');
157
+ return new TypeError(message);
158
+ }
159
+ }
160
+ })();
161
+ return v_error === undefined ? null : v_error;
162
+ }
163
+
164
+ function validate$N(obj, path) {
165
+ if (path === void 0) { path = 'BenefitDisbursementsForBenefitSessionInputRepresentation'; }
166
+ var v_error = (function () {
167
+ if (typeof obj !== 'object' || ArrayIsArray(obj) || obj === null) {
168
+ return new TypeError('Expected "object" but received "' + typeof obj + '" (at "' + path + '")');
169
+ }
170
+ var obj_benefitAssignmentId = obj.benefitAssignmentId;
171
+ var path_benefitAssignmentId = path + '.benefitAssignmentId';
172
+ if (typeof obj_benefitAssignmentId !== 'string') {
173
+ return new TypeError('Expected "string" but received "' + typeof obj_benefitAssignmentId + '" (at "' + path_benefitAssignmentId + '")');
174
+ }
175
+ var obj_benefitDisbursements = obj.benefitDisbursements;
176
+ var path_benefitDisbursements = path + '.benefitDisbursements';
177
+ var referencepath_benefitDisbursementsValidationError = validate$O(obj_benefitDisbursements, path_benefitDisbursements);
178
+ if (referencepath_benefitDisbursementsValidationError !== null) {
179
+ var message = 'Object doesn\'t match BenefitDisbursementListInputRepresentation (at "' + path_benefitDisbursements + '")\n';
180
+ message += referencepath_benefitDisbursementsValidationError.message.split('\n').map(function (line) { return '\t' + line; }).join('\n');
181
+ return new TypeError(message);
182
+ }
183
+ })();
184
+ return v_error === undefined ? null : v_error;
185
+ }
186
+
187
+ var VERSION$5 = "e187a2dda299808dd271b80c30c55942";
188
+ function validate$M(obj, path) {
189
+ if (path === void 0) { path = 'GenericOutputRepresentation'; }
190
+ var v_error = (function () {
191
+ if (typeof obj !== 'object' || ArrayIsArray(obj) || obj === null) {
192
+ return new TypeError('Expected "object" but received "' + typeof obj + '" (at "' + path + '")');
193
+ }
194
+ if (obj.code !== undefined) {
195
+ var obj_code = obj.code;
196
+ var path_code = path + '.code';
197
+ if (typeof obj_code !== 'string') {
198
+ return new TypeError('Expected "string" but received "' + typeof obj_code + '" (at "' + path_code + '")');
199
+ }
200
+ }
201
+ var obj_id = obj.id;
202
+ var path_id = path + '.id';
203
+ if (typeof obj_id !== 'string') {
204
+ return new TypeError('Expected "string" but received "' + typeof obj_id + '" (at "' + path_id + '")');
205
+ }
206
+ if (obj.isSuccess !== undefined) {
207
+ var obj_isSuccess = obj.isSuccess;
208
+ var path_isSuccess = path + '.isSuccess';
209
+ if (typeof obj_isSuccess !== 'boolean') {
210
+ return new TypeError('Expected "boolean" but received "' + typeof obj_isSuccess + '" (at "' + path_isSuccess + '")');
211
+ }
212
+ }
213
+ if (obj.message !== undefined) {
214
+ var obj_message = obj.message;
215
+ var path_message = path + '.message';
216
+ if (typeof obj_message !== 'string') {
217
+ return new TypeError('Expected "string" but received "' + typeof obj_message + '" (at "' + path_message + '")');
218
+ }
219
+ }
220
+ })();
221
+ return v_error === undefined ? null : v_error;
222
+ }
223
+ var RepresentationType$5 = 'GenericOutputRepresentation';
224
+ function keyBuilder$d(luvio, config) {
225
+ return keyPrefix + '::' + RepresentationType$5 + ':' + config.id;
226
+ }
227
+ function keyBuilderFromType$3(luvio, object) {
228
+ var keyParams = {
229
+ id: object.id
230
+ };
231
+ return keyBuilder$d(luvio, keyParams);
232
+ }
233
+ function normalize$5(input, existing, path, luvio, store, timestamp) {
234
+ return input;
235
+ }
236
+ var select$g = function GenericOutputRepresentationSelect() {
237
+ return {
238
+ kind: 'Fragment',
239
+ version: VERSION$5,
240
+ private: [],
241
+ opaque: true
242
+ };
243
+ };
244
+ function equals$5(existing, incoming) {
245
+ if (JSONStringify(incoming) !== JSONStringify(existing)) {
246
+ return false;
247
+ }
248
+ return true;
249
+ }
250
+ function deepFreeze$u(input) {
251
+ ObjectFreeze(input);
252
+ }
253
+ var ingest$5 = function GenericOutputRepresentationIngest(input, path, luvio, store, timestamp) {
254
+ if (process.env.NODE_ENV !== 'production') {
255
+ var validateError = validate$M(input);
256
+ if (validateError !== null) {
257
+ throw validateError;
258
+ }
259
+ }
260
+ var key = keyBuilderFromType$3(luvio, input);
261
+ var existingRecord = store.readEntry(key);
262
+ var ttlToUse = path.ttl !== undefined ? path.ttl : 360000;
263
+ var incomingRecord = normalize$5(input, store.readEntry(key), {
264
+ fullPath: key,
265
+ parent: path.parent,
266
+ propertyName: path.propertyName,
267
+ ttl: ttlToUse
268
+ });
269
+ deepFreeze$u(input);
270
+ if (existingRecord === undefined || equals$5(existingRecord, incomingRecord) === false) {
271
+ luvio.storePublish(key, incomingRecord);
272
+ }
273
+ if (ttlToUse !== undefined) {
274
+ var storeMetadataParams = {
275
+ ttl: ttlToUse,
276
+ namespace: "public-sector",
277
+ version: VERSION$5,
278
+ representationName: RepresentationType$5,
279
+ };
280
+ luvio.publishStoreMetadata(key, storeMetadataParams);
281
+ }
282
+ return createLink(key);
283
+ };
284
+ function getTypeCacheKeys$5(luvio, input, fullPathFactory) {
285
+ var rootKeySet = new engine.StoreKeyMap();
286
+ // root cache key (uses fullPathFactory if keyBuilderFromType isn't defined)
287
+ var rootKey = keyBuilderFromType$3(luvio, input);
288
+ rootKeySet.set(rootKey, {
289
+ namespace: keyPrefix,
290
+ representationName: RepresentationType$5,
291
+ mergeable: false
292
+ });
293
+ return rootKeySet;
294
+ }
295
+
296
+ function select$f(luvio, params) {
297
+ return select$g();
298
+ }
299
+ function getResponseCacheKeys$a(luvio, resourceParams, response) {
300
+ return getTypeCacheKeys$5(luvio, response);
301
+ }
302
+ function ingestSuccess$a(luvio, resourceParams, response) {
303
+ var body = response.body;
304
+ var key = keyBuilderFromType$3(luvio, body);
305
+ luvio.storeIngest(key, ingest$5, body);
306
+ var snapshot = luvio.storeLookup({
307
+ recordId: key,
308
+ node: select$f(),
309
+ variables: {},
310
+ });
311
+ if (process.env.NODE_ENV !== 'production') {
312
+ if (snapshot.state !== 'Fulfilled') {
313
+ throw new Error('Invalid network response. Expected resource response to result in Fulfilled snapshot');
314
+ }
315
+ }
316
+ return snapshot;
317
+ }
318
+ function createResourceRequest$a(config) {
319
+ var headers = {};
320
+ return {
321
+ baseUri: '/services/data/v58.0',
322
+ basePath: '/connect/benefit-disbursements',
323
+ method: 'post',
324
+ body: config.body,
325
+ urlParams: {},
326
+ queryParams: {},
327
+ headers: headers,
328
+ priority: 'normal',
329
+ };
330
+ }
331
+
332
+ var createBenefitDisbursements_ConfigPropertyNames = {
333
+ displayName: 'createBenefitDisbursements',
334
+ parameters: {
335
+ required: ['benefitDisbursementRecord'],
336
+ optional: []
337
+ }
338
+ };
339
+ function createResourceParams$a(config) {
340
+ var resourceParams = {
341
+ body: {
342
+ benefitDisbursementRecord: config.benefitDisbursementRecord
343
+ }
344
+ };
345
+ return resourceParams;
346
+ }
347
+ function typeCheckConfig$a(untrustedConfig) {
348
+ var config = {};
349
+ var untrustedConfig_benefitDisbursementRecord = untrustedConfig.benefitDisbursementRecord;
350
+ var referenceBenefitDisbursementsForBenefitSessionInputRepresentationValidationError = validate$N(untrustedConfig_benefitDisbursementRecord);
351
+ if (referenceBenefitDisbursementsForBenefitSessionInputRepresentationValidationError === null) {
352
+ config.benefitDisbursementRecord = untrustedConfig_benefitDisbursementRecord;
353
+ }
354
+ return config;
355
+ }
356
+ function validateAdapterConfig$a(untrustedConfig, configPropertyNames) {
357
+ if (!untrustedIsObject(untrustedConfig)) {
358
+ return null;
359
+ }
360
+ if (process.env.NODE_ENV !== 'production') {
361
+ validateConfig(untrustedConfig, configPropertyNames);
362
+ }
363
+ var config = typeCheckConfig$a(untrustedConfig);
364
+ if (!areRequiredParametersPresent(config, configPropertyNames)) {
365
+ return null;
366
+ }
367
+ return config;
368
+ }
369
+ function buildNetworkSnapshot$a(luvio, config, options) {
370
+ var resourceParams = createResourceParams$a(config);
371
+ var request = createResourceRequest$a(resourceParams);
372
+ return luvio.dispatchResourceRequest(request, options)
373
+ .then(function (response) {
374
+ return luvio.handleSuccessResponse(function () {
375
+ var snapshot = ingestSuccess$a(luvio, resourceParams, response);
376
+ return luvio.storeBroadcast().then(function () { return snapshot; });
377
+ }, function () { return getResponseCacheKeys$a(luvio, resourceParams, response.body); });
378
+ }, function (response) {
379
+ deepFreeze$v(response);
380
+ throw response;
381
+ });
382
+ }
383
+ var createBenefitDisbursementsAdapterFactory = function (luvio) {
384
+ return function createBenefitDisbursements(untrustedConfig) {
385
+ var config = validateAdapterConfig$a(untrustedConfig, createBenefitDisbursements_ConfigPropertyNames);
386
+ // Invalid or incomplete config
387
+ if (config === null) {
388
+ throw new Error('Invalid config for "createBenefitDisbursements"');
389
+ }
390
+ return buildNetworkSnapshot$a(luvio, config);
391
+ };
392
+ };
393
+
394
+ function validate$L(obj, path) {
395
+ if (path === void 0) { path = 'CarePlanSessionEnrolleeInfoRepresentation'; }
396
+ var v_error = (function () {
397
+ if (typeof obj !== 'object' || ArrayIsArray(obj) || obj === null) {
398
+ return new TypeError('Expected "object" but received "' + typeof obj + '" (at "' + path + '")');
399
+ }
400
+ if (obj.benefitAssignmentId !== undefined) {
401
+ var obj_benefitAssignmentId = obj.benefitAssignmentId;
402
+ var path_benefitAssignmentId = path + '.benefitAssignmentId';
403
+ if (typeof obj_benefitAssignmentId !== 'string') {
404
+ return new TypeError('Expected "string" but received "' + typeof obj_benefitAssignmentId + '" (at "' + path_benefitAssignmentId + '")');
405
+ }
406
+ }
407
+ if (obj.benefitEndDate !== undefined) {
408
+ var obj_benefitEndDate = obj.benefitEndDate;
409
+ var path_benefitEndDate = path + '.benefitEndDate';
410
+ if (typeof obj_benefitEndDate !== 'string') {
411
+ return new TypeError('Expected "string" but received "' + typeof obj_benefitEndDate + '" (at "' + path_benefitEndDate + '")');
412
+ }
413
+ }
414
+ if (obj.benefitStartDate !== undefined) {
415
+ var obj_benefitStartDate = obj.benefitStartDate;
416
+ var path_benefitStartDate = path + '.benefitStartDate';
417
+ if (typeof obj_benefitStartDate !== 'string') {
418
+ return new TypeError('Expected "string" but received "' + typeof obj_benefitStartDate + '" (at "' + path_benefitStartDate + '")');
419
+ }
420
+ }
421
+ var obj_enrolleeId = obj.enrolleeId;
422
+ var path_enrolleeId = path + '.enrolleeId';
423
+ if (typeof obj_enrolleeId !== 'string') {
424
+ return new TypeError('Expected "string" but received "' + typeof obj_enrolleeId + '" (at "' + path_enrolleeId + '")');
425
+ }
426
+ var obj_enrolleeName = obj.enrolleeName;
427
+ var path_enrolleeName = path + '.enrolleeName';
428
+ if (typeof obj_enrolleeName !== 'string') {
429
+ return new TypeError('Expected "string" but received "' + typeof obj_enrolleeName + '" (at "' + path_enrolleeName + '")');
430
+ }
431
+ if (obj.sessionsEnrolled !== undefined) {
432
+ var obj_sessionsEnrolled = obj.sessionsEnrolled;
433
+ var path_sessionsEnrolled = path + '.sessionsEnrolled';
434
+ if (typeof obj_sessionsEnrolled !== 'number' || (typeof obj_sessionsEnrolled === 'number' && Math.floor(obj_sessionsEnrolled) !== obj_sessionsEnrolled)) {
435
+ return new TypeError('Expected "integer" but received "' + typeof obj_sessionsEnrolled + '" (at "' + path_sessionsEnrolled + '")');
436
+ }
437
+ }
438
+ })();
439
+ return v_error === undefined ? null : v_error;
440
+ }
441
+ function deepFreeze$t(input) {
442
+ ObjectFreeze(input);
443
+ }
444
+
445
+ function validate$K(obj, path) {
446
+ if (path === void 0) { path = 'CarePlanSessionEnrolleeInfoListRepresentation'; }
447
+ var v_error = (function () {
448
+ if (typeof obj !== 'object' || ArrayIsArray(obj) || obj === null) {
449
+ return new TypeError('Expected "object" but received "' + typeof obj + '" (at "' + path + '")');
450
+ }
451
+ if (obj.records !== undefined) {
452
+ var obj_records = obj.records;
453
+ var path_records = path + '.records';
454
+ if (!ArrayIsArray(obj_records)) {
455
+ return new TypeError('Expected "array" but received "' + typeof obj_records + '" (at "' + path_records + '")');
456
+ }
457
+ for (var i = 0; i < obj_records.length; i++) {
458
+ var obj_records_item = obj_records[i];
459
+ var path_records_item = path_records + '[' + i + ']';
460
+ var referencepath_records_itemValidationError = validate$L(obj_records_item, path_records_item);
461
+ if (referencepath_records_itemValidationError !== null) {
462
+ var message = 'Object doesn\'t match CarePlanSessionEnrolleeInfoRepresentation (at "' + path_records_item + '")\n';
463
+ message += referencepath_records_itemValidationError.message.split('\n').map(function (line) { return '\t' + line; }).join('\n');
464
+ return new TypeError(message);
465
+ }
466
+ }
467
+ }
468
+ })();
469
+ return v_error === undefined ? null : v_error;
470
+ }
471
+ function deepFreeze$s(input) {
472
+ var input_records = input.records;
473
+ if (input_records !== undefined) {
474
+ for (var i = 0; i < input_records.length; i++) {
475
+ var input_records_item = input_records[i];
476
+ deepFreeze$t(input_records_item);
477
+ }
478
+ ObjectFreeze(input_records);
479
+ }
480
+ ObjectFreeze(input);
481
+ }
482
+
483
+ function validate$J(obj, path) {
484
+ if (path === void 0) { path = 'CarePlanBenefitSessionInfoRepresentation'; }
485
+ var v_error = (function () {
486
+ if (typeof obj !== 'object' || ArrayIsArray(obj) || obj === null) {
487
+ return new TypeError('Expected "object" but received "' + typeof obj + '" (at "' + path + '")');
488
+ }
489
+ if (obj.assignmentCount !== undefined) {
490
+ var obj_assignmentCount = obj.assignmentCount;
491
+ var path_assignmentCount = path + '.assignmentCount';
492
+ if (typeof obj_assignmentCount !== 'number' || (typeof obj_assignmentCount === 'number' && Math.floor(obj_assignmentCount) !== obj_assignmentCount)) {
493
+ return new TypeError('Expected "integer" but received "' + typeof obj_assignmentCount + '" (at "' + path_assignmentCount + '")');
494
+ }
495
+ }
496
+ if (obj.benefitId !== undefined) {
497
+ var obj_benefitId = obj.benefitId;
498
+ var path_benefitId = path + '.benefitId';
499
+ if (typeof obj_benefitId !== 'string') {
500
+ return new TypeError('Expected "string" but received "' + typeof obj_benefitId + '" (at "' + path_benefitId + '")');
501
+ }
502
+ }
503
+ if (obj.benefitName !== undefined) {
504
+ var obj_benefitName = obj.benefitName;
505
+ var path_benefitName = path + '.benefitName';
506
+ if (typeof obj_benefitName !== 'string') {
507
+ return new TypeError('Expected "string" but received "' + typeof obj_benefitName + '" (at "' + path_benefitName + '")');
508
+ }
509
+ }
510
+ if (obj.sessionEnrolleeInfo !== undefined) {
511
+ var obj_sessionEnrolleeInfo = obj.sessionEnrolleeInfo;
512
+ var path_sessionEnrolleeInfo = path + '.sessionEnrolleeInfo';
513
+ var referencepath_sessionEnrolleeInfoValidationError = validate$K(obj_sessionEnrolleeInfo, path_sessionEnrolleeInfo);
514
+ if (referencepath_sessionEnrolleeInfoValidationError !== null) {
515
+ var message = 'Object doesn\'t match CarePlanSessionEnrolleeInfoListRepresentation (at "' + path_sessionEnrolleeInfo + '")\n';
516
+ message += referencepath_sessionEnrolleeInfoValidationError.message.split('\n').map(function (line) { return '\t' + line; }).join('\n');
517
+ return new TypeError(message);
518
+ }
519
+ }
520
+ })();
521
+ return v_error === undefined ? null : v_error;
522
+ }
523
+ function deepFreeze$r(input) {
524
+ var input_sessionEnrolleeInfo = input.sessionEnrolleeInfo;
525
+ if (input_sessionEnrolleeInfo !== undefined) {
526
+ deepFreeze$s(input_sessionEnrolleeInfo);
527
+ }
528
+ ObjectFreeze(input);
529
+ }
530
+
531
+ function validate$I(obj, path) {
532
+ if (path === void 0) { path = 'CarePlanBenefitSessionInfoListRepresentation'; }
533
+ var v_error = (function () {
534
+ if (typeof obj !== 'object' || ArrayIsArray(obj) || obj === null) {
535
+ return new TypeError('Expected "object" but received "' + typeof obj + '" (at "' + path + '")');
536
+ }
537
+ if (obj.records !== undefined) {
538
+ var obj_records = obj.records;
539
+ var path_records = path + '.records';
540
+ if (!ArrayIsArray(obj_records)) {
541
+ return new TypeError('Expected "array" but received "' + typeof obj_records + '" (at "' + path_records + '")');
542
+ }
543
+ for (var i = 0; i < obj_records.length; i++) {
544
+ var obj_records_item = obj_records[i];
545
+ var path_records_item = path_records + '[' + i + ']';
546
+ var referencepath_records_itemValidationError = validate$J(obj_records_item, path_records_item);
547
+ if (referencepath_records_itemValidationError !== null) {
548
+ var message = 'Object doesn\'t match CarePlanBenefitSessionInfoRepresentation (at "' + path_records_item + '")\n';
549
+ message += referencepath_records_itemValidationError.message.split('\n').map(function (line) { return '\t' + line; }).join('\n');
550
+ return new TypeError(message);
551
+ }
552
+ }
553
+ }
554
+ })();
555
+ return v_error === undefined ? null : v_error;
556
+ }
557
+ function deepFreeze$q(input) {
558
+ var input_records = input.records;
559
+ if (input_records !== undefined) {
560
+ for (var i = 0; i < input_records.length; i++) {
561
+ var input_records_item = input_records[i];
562
+ deepFreeze$r(input_records_item);
563
+ }
564
+ ObjectFreeze(input_records);
565
+ }
566
+ ObjectFreeze(input);
567
+ }
568
+
569
+ var TTL$4 = 1000;
570
+ var VERSION$4 = "4cd6754154931e3d1e321640fa64f477";
571
+ function validate$H(obj, path) {
572
+ if (path === void 0) { path = 'CarePlanBenefitSessionOutputRepresentation'; }
573
+ var v_error = (function () {
574
+ if (typeof obj !== 'object' || ArrayIsArray(obj) || obj === null) {
575
+ return new TypeError('Expected "object" but received "' + typeof obj + '" (at "' + path + '")');
576
+ }
577
+ if (obj.benefitSessionInfo !== undefined) {
578
+ var obj_benefitSessionInfo = obj.benefitSessionInfo;
579
+ var path_benefitSessionInfo = path + '.benefitSessionInfo';
580
+ var referencepath_benefitSessionInfoValidationError = validate$I(obj_benefitSessionInfo, path_benefitSessionInfo);
581
+ if (referencepath_benefitSessionInfoValidationError !== null) {
582
+ var message = 'Object doesn\'t match CarePlanBenefitSessionInfoListRepresentation (at "' + path_benefitSessionInfo + '")\n';
583
+ message += referencepath_benefitSessionInfoValidationError.message.split('\n').map(function (line) { return '\t' + line; }).join('\n');
584
+ return new TypeError(message);
585
+ }
586
+ }
587
+ if (obj.carePlanId !== undefined) {
588
+ var obj_carePlanId = obj.carePlanId;
589
+ var path_carePlanId = path + '.carePlanId';
590
+ if (typeof obj_carePlanId !== 'string') {
591
+ return new TypeError('Expected "string" but received "' + typeof obj_carePlanId + '" (at "' + path_carePlanId + '")');
592
+ }
593
+ }
594
+ })();
595
+ return v_error === undefined ? null : v_error;
596
+ }
597
+ var RepresentationType$4 = 'CarePlanBenefitSessionOutputRepresentation';
598
+ function normalize$4(input, existing, path, luvio, store, timestamp) {
599
+ return input;
600
+ }
601
+ var select$e = function CarePlanBenefitSessionOutputRepresentationSelect() {
602
+ return {
603
+ kind: 'Fragment',
604
+ version: VERSION$4,
605
+ private: [],
606
+ opaque: true
607
+ };
608
+ };
609
+ function equals$4(existing, incoming) {
610
+ if (JSONStringify(incoming) !== JSONStringify(existing)) {
611
+ return false;
612
+ }
613
+ return true;
614
+ }
615
+ function deepFreeze$p(input) {
616
+ var input_benefitSessionInfo = input.benefitSessionInfo;
617
+ if (input_benefitSessionInfo !== undefined) {
618
+ deepFreeze$q(input_benefitSessionInfo);
619
+ }
620
+ ObjectFreeze(input);
621
+ }
622
+ var ingest$4 = function CarePlanBenefitSessionOutputRepresentationIngest(input, path, luvio, store, timestamp) {
623
+ if (process.env.NODE_ENV !== 'production') {
624
+ var validateError = validate$H(input);
625
+ if (validateError !== null) {
626
+ throw validateError;
627
+ }
628
+ }
629
+ var key = path.fullPath;
630
+ var existingRecord = store.readEntry(key);
631
+ var ttlToUse = TTL$4;
632
+ var incomingRecord = normalize$4(input, store.readEntry(key), {
633
+ fullPath: key,
634
+ parent: path.parent,
635
+ propertyName: path.propertyName,
636
+ ttl: ttlToUse
637
+ });
638
+ deepFreeze$p(input);
639
+ if (existingRecord === undefined || equals$4(existingRecord, incomingRecord) === false) {
640
+ luvio.storePublish(key, incomingRecord);
641
+ }
642
+ {
643
+ var storeMetadataParams = {
644
+ ttl: ttlToUse,
645
+ namespace: "public-sector",
646
+ version: VERSION$4,
647
+ representationName: RepresentationType$4,
648
+ };
649
+ luvio.publishStoreMetadata(key, storeMetadataParams);
650
+ }
651
+ return createLink(key);
652
+ };
653
+ function getTypeCacheKeys$4(luvio, input, fullPathFactory) {
654
+ var rootKeySet = new engine.StoreKeyMap();
655
+ // root cache key (uses fullPathFactory if keyBuilderFromType isn't defined)
656
+ var rootKey = fullPathFactory();
657
+ rootKeySet.set(rootKey, {
658
+ namespace: keyPrefix,
659
+ representationName: RepresentationType$4,
660
+ mergeable: false
661
+ });
662
+ return rootKeySet;
663
+ }
664
+
665
+ function select$d(luvio, params) {
666
+ return select$e();
667
+ }
668
+ function keyBuilder$c(luvio, params) {
669
+ return keyPrefix + '::CarePlanBenefitSessionOutputRepresentation:(' + 'carePlanId:' + params.urlParams.carePlanId + ')';
670
+ }
671
+ function getResponseCacheKeys$9(luvio, resourceParams, response) {
672
+ return getTypeCacheKeys$4(luvio, response, function () { return keyBuilder$c(luvio, resourceParams); });
673
+ }
674
+ function ingestSuccess$9(luvio, resourceParams, response, snapshotRefresh) {
675
+ var body = response.body;
676
+ var key = keyBuilder$c(luvio, resourceParams);
677
+ luvio.storeIngest(key, ingest$4, body);
678
+ var snapshot = luvio.storeLookup({
679
+ recordId: key,
680
+ node: select$d(),
681
+ variables: {},
682
+ }, snapshotRefresh);
683
+ if (process.env.NODE_ENV !== 'production') {
684
+ if (snapshot.state !== 'Fulfilled') {
685
+ throw new Error('Invalid network response. Expected resource response to result in Fulfilled snapshot');
686
+ }
687
+ }
688
+ return snapshot;
689
+ }
690
+ function ingestError$4(luvio, params, error, snapshotRefresh) {
691
+ var key = keyBuilder$c(luvio, params);
692
+ var errorSnapshot = luvio.errorSnapshot(error, snapshotRefresh);
693
+ var storeMetadataParams = {
694
+ ttl: TTL$4,
695
+ namespace: keyPrefix,
696
+ version: VERSION$4,
697
+ representationName: RepresentationType$4
698
+ };
699
+ luvio.storeIngestError(key, errorSnapshot, storeMetadataParams);
700
+ return errorSnapshot;
701
+ }
702
+ function createResourceRequest$9(config) {
703
+ var headers = {};
704
+ return {
705
+ baseUri: '/services/data/v58.0',
706
+ basePath: '/connect/careplan/benefit-session-info/' + config.urlParams.carePlanId + '',
707
+ method: 'get',
708
+ body: null,
709
+ urlParams: config.urlParams,
710
+ queryParams: {},
711
+ headers: headers,
712
+ priority: 'normal',
713
+ };
714
+ }
715
+
716
+ var getCarePlanBenefitSessionDetails_ConfigPropertyNames = {
717
+ displayName: 'getCarePlanBenefitSessionDetails',
718
+ parameters: {
719
+ required: ['carePlanId'],
720
+ optional: []
721
+ }
722
+ };
723
+ function createResourceParams$9(config) {
724
+ var resourceParams = {
725
+ urlParams: {
726
+ carePlanId: config.carePlanId
727
+ }
728
+ };
729
+ return resourceParams;
730
+ }
731
+ function keyBuilder$b(luvio, config) {
732
+ var resourceParams = createResourceParams$9(config);
733
+ return keyBuilder$c(luvio, resourceParams);
734
+ }
735
+ function typeCheckConfig$9(untrustedConfig) {
736
+ var config = {};
737
+ var untrustedConfig_carePlanId = untrustedConfig.carePlanId;
738
+ if (typeof untrustedConfig_carePlanId === 'string') {
739
+ config.carePlanId = untrustedConfig_carePlanId;
740
+ }
741
+ return config;
742
+ }
743
+ function validateAdapterConfig$9(untrustedConfig, configPropertyNames) {
744
+ if (!untrustedIsObject(untrustedConfig)) {
745
+ return null;
746
+ }
747
+ if (process.env.NODE_ENV !== 'production') {
748
+ validateConfig(untrustedConfig, configPropertyNames);
749
+ }
750
+ var config = typeCheckConfig$9(untrustedConfig);
751
+ if (!areRequiredParametersPresent(config, configPropertyNames)) {
752
+ return null;
753
+ }
754
+ return config;
755
+ }
756
+ function adapterFragment$4(luvio, config) {
757
+ createResourceParams$9(config);
758
+ return select$d();
759
+ }
760
+ function onFetchResponseSuccess$4(luvio, config, resourceParams, response) {
761
+ var snapshot = ingestSuccess$9(luvio, resourceParams, response, {
762
+ config: config,
763
+ resolve: function () { return buildNetworkSnapshot$9(luvio, config, snapshotRefreshOptions); }
764
+ });
765
+ return luvio.storeBroadcast().then(function () { return snapshot; });
766
+ }
767
+ function onFetchResponseError$4(luvio, config, resourceParams, response) {
768
+ var snapshot = ingestError$4(luvio, resourceParams, response, {
769
+ config: config,
770
+ resolve: function () { return buildNetworkSnapshot$9(luvio, config, snapshotRefreshOptions); }
771
+ });
772
+ return luvio.storeBroadcast().then(function () { return snapshot; });
773
+ }
774
+ function buildNetworkSnapshot$9(luvio, config, options) {
775
+ var resourceParams = createResourceParams$9(config);
776
+ var request = createResourceRequest$9(resourceParams);
777
+ return luvio.dispatchResourceRequest(request, options)
778
+ .then(function (response) {
779
+ return luvio.handleSuccessResponse(function () { return onFetchResponseSuccess$4(luvio, config, resourceParams, response); }, function () { return getResponseCacheKeys$9(luvio, resourceParams, response.body); });
780
+ }, function (response) {
781
+ return luvio.handleErrorResponse(function () { return onFetchResponseError$4(luvio, config, resourceParams, response); });
782
+ });
783
+ }
784
+ function buildNetworkSnapshotCachePolicy$4(context, coercedAdapterRequestContext) {
785
+ var luvio = context.luvio, config = context.config;
786
+ var networkPriority = coercedAdapterRequestContext.networkPriority, requestCorrelator = coercedAdapterRequestContext.requestCorrelator, eventObservers = coercedAdapterRequestContext.eventObservers;
787
+ var dispatchOptions = {
788
+ resourceRequestContext: {
789
+ requestCorrelator: requestCorrelator,
790
+ luvioRequestMethod: undefined,
791
+ },
792
+ eventObservers: eventObservers
793
+ };
794
+ if (networkPriority !== 'normal') {
795
+ dispatchOptions.overrides = {
796
+ priority: networkPriority
797
+ };
798
+ }
799
+ return buildNetworkSnapshot$9(luvio, config, dispatchOptions);
800
+ }
801
+ function buildCachedSnapshotCachePolicy$4(context, storeLookup) {
802
+ var luvio = context.luvio, config = context.config;
803
+ var selector = {
804
+ recordId: keyBuilder$b(luvio, config),
805
+ node: adapterFragment$4(luvio, config),
806
+ variables: {},
807
+ };
808
+ var cacheSnapshot = storeLookup(selector, {
809
+ config: config,
810
+ resolve: function () { return buildNetworkSnapshot$9(luvio, config, snapshotRefreshOptions); }
811
+ });
812
+ return cacheSnapshot;
813
+ }
814
+ var getCarePlanBenefitSessionDetailsAdapterFactory = function (luvio) { return function publicSector__getCarePlanBenefitSessionDetails(untrustedConfig, requestContext) {
815
+ var config = validateAdapterConfig$9(untrustedConfig, getCarePlanBenefitSessionDetails_ConfigPropertyNames);
816
+ // Invalid or incomplete config
817
+ if (config === null) {
818
+ return null;
819
+ }
820
+ return luvio.applyCachePolicy((requestContext || {}), { config: config, luvio: luvio }, // BuildSnapshotContext
821
+ buildCachedSnapshotCachePolicy$4, buildNetworkSnapshotCachePolicy$4);
822
+ }; };
823
+
824
+ function validate$G(obj, path) {
825
+ if (path === void 0) { path = 'CarePlanTaskInputRepresentation'; }
826
+ var v_error = (function () {
827
+ if (typeof obj !== 'object' || ArrayIsArray(obj) || obj === null) {
828
+ return new TypeError('Expected "object" but received "' + typeof obj + '" (at "' + path + '")');
829
+ }
830
+ if (obj.assignedTo !== undefined) {
831
+ var obj_assignedTo = obj.assignedTo;
832
+ var path_assignedTo = path + '.assignedTo';
833
+ if (typeof obj_assignedTo !== 'string') {
834
+ return new TypeError('Expected "string" but received "' + typeof obj_assignedTo + '" (at "' + path_assignedTo + '")');
835
+ }
836
+ }
837
+ if (obj.comment !== undefined) {
838
+ var obj_comment = obj.comment;
839
+ var path_comment = path + '.comment';
840
+ if (typeof obj_comment !== 'string') {
841
+ return new TypeError('Expected "string" but received "' + typeof obj_comment + '" (at "' + path_comment + '")');
842
+ }
843
+ }
844
+ if (obj.dueDate !== undefined) {
845
+ var obj_dueDate = obj.dueDate;
846
+ var path_dueDate = path + '.dueDate';
847
+ if (typeof obj_dueDate !== 'string') {
848
+ return new TypeError('Expected "string" but received "' + typeof obj_dueDate + '" (at "' + path_dueDate + '")');
849
+ }
850
+ }
851
+ if (obj.id !== undefined) {
852
+ var obj_id = obj.id;
853
+ var path_id = path + '.id';
854
+ if (typeof obj_id !== 'string') {
855
+ return new TypeError('Expected "string" but received "' + typeof obj_id + '" (at "' + path_id + '")');
856
+ }
857
+ }
858
+ if (obj.isRequired !== undefined) {
859
+ var obj_isRequired = obj.isRequired;
860
+ var path_isRequired = path + '.isRequired';
861
+ if (typeof obj_isRequired !== 'boolean') {
862
+ return new TypeError('Expected "boolean" but received "' + typeof obj_isRequired + '" (at "' + path_isRequired + '")');
863
+ }
864
+ }
865
+ if (obj.priority !== undefined) {
866
+ var obj_priority = obj.priority;
867
+ var path_priority = path + '.priority';
868
+ if (typeof obj_priority !== 'string') {
869
+ return new TypeError('Expected "string" but received "' + typeof obj_priority + '" (at "' + path_priority + '")');
870
+ }
871
+ }
872
+ if (obj.status !== undefined) {
873
+ var obj_status = obj.status;
874
+ var path_status = path + '.status';
875
+ if (typeof obj_status !== 'string') {
876
+ return new TypeError('Expected "string" but received "' + typeof obj_status + '" (at "' + path_status + '")');
877
+ }
878
+ }
879
+ if (obj.subject !== undefined) {
880
+ var obj_subject = obj.subject;
881
+ var path_subject = path + '.subject';
882
+ if (typeof obj_subject !== 'string') {
883
+ return new TypeError('Expected "string" but received "' + typeof obj_subject + '" (at "' + path_subject + '")');
884
+ }
885
+ }
886
+ })();
887
+ return v_error === undefined ? null : v_error;
888
+ }
889
+
890
+ function validate$F(obj, path) {
891
+ if (path === void 0) { path = 'CustomFieldInputRepresentation'; }
892
+ var v_error = (function () {
893
+ if (typeof obj !== 'object' || ArrayIsArray(obj) || obj === null) {
894
+ return new TypeError('Expected "object" but received "' + typeof obj + '" (at "' + path + '")');
895
+ }
896
+ if (obj.dataType !== undefined) {
897
+ var obj_dataType = obj.dataType;
898
+ var path_dataType = path + '.dataType';
899
+ if (typeof obj_dataType !== 'string') {
900
+ return new TypeError('Expected "string" but received "' + typeof obj_dataType + '" (at "' + path_dataType + '")');
901
+ }
902
+ }
903
+ var obj_fieldName = obj.fieldName;
904
+ var path_fieldName = path + '.fieldName';
905
+ if (typeof obj_fieldName !== 'string') {
906
+ return new TypeError('Expected "string" but received "' + typeof obj_fieldName + '" (at "' + path_fieldName + '")');
907
+ }
908
+ var obj_fieldValue = obj.fieldValue;
909
+ var path_fieldValue = path + '.fieldValue';
910
+ if (obj_fieldValue === undefined) {
911
+ return new TypeError('Expected "defined" but received "' + typeof obj_fieldValue + '" (at "' + path_fieldValue + '")');
912
+ }
913
+ })();
914
+ return v_error === undefined ? null : v_error;
915
+ }
916
+
917
+ function validate$E(obj, path) {
918
+ if (path === void 0) { path = 'CustomFieldListInputRepresentation'; }
919
+ var v_error = (function () {
920
+ if (typeof obj !== 'object' || ArrayIsArray(obj) || obj === null) {
921
+ return new TypeError('Expected "object" but received "' + typeof obj + '" (at "' + path + '")');
922
+ }
923
+ var obj_records = obj.records;
924
+ var path_records = path + '.records';
925
+ if (!ArrayIsArray(obj_records)) {
926
+ return new TypeError('Expected "array" but received "' + typeof obj_records + '" (at "' + path_records + '")');
927
+ }
928
+ for (var i = 0; i < obj_records.length; i++) {
929
+ var obj_records_item = obj_records[i];
930
+ var path_records_item = path_records + '[' + i + ']';
931
+ var referencepath_records_itemValidationError = validate$F(obj_records_item, path_records_item);
932
+ if (referencepath_records_itemValidationError !== null) {
933
+ var message = 'Object doesn\'t match CustomFieldInputRepresentation (at "' + path_records_item + '")\n';
934
+ message += referencepath_records_itemValidationError.message.split('\n').map(function (line) { return '\t' + line; }).join('\n');
935
+ return new TypeError(message);
936
+ }
937
+ }
938
+ })();
939
+ return v_error === undefined ? null : v_error;
940
+ }
941
+
942
+ function validate$D(obj, path) {
943
+ if (path === void 0) { path = 'BenefitAssignmentInputRepresentation'; }
944
+ var v_error = (function () {
945
+ if (typeof obj !== 'object' || ArrayIsArray(obj) || obj === null) {
946
+ return new TypeError('Expected "object" but received "' + typeof obj + '" (at "' + path + '")');
947
+ }
948
+ if (obj.benefitAssignmentTasks !== undefined) {
949
+ var obj_benefitAssignmentTasks = obj.benefitAssignmentTasks;
950
+ var path_benefitAssignmentTasks = path + '.benefitAssignmentTasks';
951
+ var referencepath_benefitAssignmentTasksValidationError = validate$G(obj_benefitAssignmentTasks, path_benefitAssignmentTasks);
952
+ if (referencepath_benefitAssignmentTasksValidationError !== null) {
953
+ var message = 'Object doesn\'t match CarePlanTaskInputRepresentation (at "' + path_benefitAssignmentTasks + '")\n';
954
+ message += referencepath_benefitAssignmentTasksValidationError.message.split('\n').map(function (line) { return '\t' + line; }).join('\n');
955
+ return new TypeError(message);
956
+ }
957
+ }
958
+ if (obj.benefitDisbursements !== undefined) {
959
+ var obj_benefitDisbursements = obj.benefitDisbursements;
960
+ var path_benefitDisbursements = path + '.benefitDisbursements';
961
+ var referencepath_benefitDisbursementsValidationError = validate$O(obj_benefitDisbursements, path_benefitDisbursements);
962
+ if (referencepath_benefitDisbursementsValidationError !== null) {
963
+ var message = 'Object doesn\'t match BenefitDisbursementListInputRepresentation (at "' + path_benefitDisbursements + '")\n';
964
+ message += referencepath_benefitDisbursementsValidationError.message.split('\n').map(function (line) { return '\t' + line; }).join('\n');
965
+ return new TypeError(message);
966
+ }
967
+ }
968
+ if (obj.benefitFrequency !== undefined) {
969
+ var obj_benefitFrequency = obj.benefitFrequency;
970
+ var path_benefitFrequency = path + '.benefitFrequency';
971
+ if (typeof obj_benefitFrequency !== 'string') {
972
+ return new TypeError('Expected "string" but received "' + typeof obj_benefitFrequency + '" (at "' + path_benefitFrequency + '")');
973
+ }
974
+ }
975
+ var obj_benefitId = obj.benefitId;
976
+ var path_benefitId = path + '.benefitId';
977
+ if (typeof obj_benefitId !== 'string') {
978
+ return new TypeError('Expected "string" but received "' + typeof obj_benefitId + '" (at "' + path_benefitId + '")');
979
+ }
980
+ if (obj.customFields !== undefined) {
981
+ var obj_customFields = obj.customFields;
982
+ var path_customFields = path + '.customFields';
983
+ var referencepath_customFieldsValidationError = validate$E(obj_customFields, path_customFields);
984
+ if (referencepath_customFieldsValidationError !== null) {
985
+ var message = 'Object doesn\'t match CustomFieldListInputRepresentation (at "' + path_customFields + '")\n';
986
+ message += referencepath_customFieldsValidationError.message.split('\n').map(function (line) { return '\t' + line; }).join('\n');
987
+ return new TypeError(message);
988
+ }
989
+ }
990
+ if (obj.endDate !== undefined) {
991
+ var obj_endDate = obj.endDate;
992
+ var path_endDate = path + '.endDate';
993
+ if (typeof obj_endDate !== 'string') {
994
+ return new TypeError('Expected "string" but received "' + typeof obj_endDate + '" (at "' + path_endDate + '")');
995
+ }
996
+ }
997
+ if (obj.enrollmentCount !== undefined) {
998
+ var obj_enrollmentCount = obj.enrollmentCount;
999
+ var path_enrollmentCount = path + '.enrollmentCount';
1000
+ if (typeof obj_enrollmentCount !== 'number' || (typeof obj_enrollmentCount === 'number' && Math.floor(obj_enrollmentCount) !== obj_enrollmentCount)) {
1001
+ return new TypeError('Expected "integer" but received "' + typeof obj_enrollmentCount + '" (at "' + path_enrollmentCount + '")');
1002
+ }
1003
+ }
1004
+ if (obj.entitlementAmount !== undefined) {
1005
+ obj.entitlementAmount;
1006
+ }
1007
+ if (obj.id !== undefined) {
1008
+ var obj_id = obj.id;
1009
+ var path_id = path + '.id';
1010
+ if (typeof obj_id !== 'string') {
1011
+ return new TypeError('Expected "string" but received "' + typeof obj_id + '" (at "' + path_id + '")');
1012
+ }
1013
+ }
1014
+ if (obj.maximumAmount !== undefined) {
1015
+ obj.maximumAmount;
1016
+ }
1017
+ var obj_participantId = obj.participantId;
1018
+ var path_participantId = path + '.participantId';
1019
+ if (typeof obj_participantId !== 'string') {
1020
+ return new TypeError('Expected "string" but received "' + typeof obj_participantId + '" (at "' + path_participantId + '")');
1021
+ }
1022
+ if (obj.payoutFrequency !== undefined) {
1023
+ var obj_payoutFrequency = obj.payoutFrequency;
1024
+ var path_payoutFrequency = path + '.payoutFrequency';
1025
+ if (typeof obj_payoutFrequency !== 'string') {
1026
+ return new TypeError('Expected "string" but received "' + typeof obj_payoutFrequency + '" (at "' + path_payoutFrequency + '")');
1027
+ }
1028
+ }
1029
+ if (obj.priority !== undefined) {
1030
+ var obj_priority = obj.priority;
1031
+ var path_priority = path + '.priority';
1032
+ if (typeof obj_priority !== 'string') {
1033
+ return new TypeError('Expected "string" but received "' + typeof obj_priority + '" (at "' + path_priority + '")');
1034
+ }
1035
+ }
1036
+ if (obj.startDate !== undefined) {
1037
+ var obj_startDate = obj.startDate;
1038
+ var path_startDate = path + '.startDate';
1039
+ if (typeof obj_startDate !== 'string') {
1040
+ return new TypeError('Expected "string" but received "' + typeof obj_startDate + '" (at "' + path_startDate + '")');
1041
+ }
1042
+ }
1043
+ if (obj.status !== undefined) {
1044
+ var obj_status = obj.status;
1045
+ var path_status = path + '.status';
1046
+ if (typeof obj_status !== 'string') {
1047
+ return new TypeError('Expected "string" but received "' + typeof obj_status + '" (at "' + path_status + '")');
1048
+ }
1049
+ }
1050
+ })();
1051
+ return v_error === undefined ? null : v_error;
1052
+ }
1053
+
1054
+ function validate$C(obj, path) {
1055
+ if (path === void 0) { path = 'BenefitAssignmentListInputRepresentation'; }
1056
+ var v_error = (function () {
1057
+ if (typeof obj !== 'object' || ArrayIsArray(obj) || obj === null) {
1058
+ return new TypeError('Expected "object" but received "' + typeof obj + '" (at "' + path + '")');
1059
+ }
1060
+ var obj_records = obj.records;
1061
+ var path_records = path + '.records';
1062
+ if (!ArrayIsArray(obj_records)) {
1063
+ return new TypeError('Expected "array" but received "' + typeof obj_records + '" (at "' + path_records + '")');
1064
+ }
1065
+ for (var i = 0; i < obj_records.length; i++) {
1066
+ var obj_records_item = obj_records[i];
1067
+ var path_records_item = path_records + '[' + i + ']';
1068
+ var referencepath_records_itemValidationError = validate$D(obj_records_item, path_records_item);
1069
+ if (referencepath_records_itemValidationError !== null) {
1070
+ var message = 'Object doesn\'t match BenefitAssignmentInputRepresentation (at "' + path_records_item + '")\n';
1071
+ message += referencepath_records_itemValidationError.message.split('\n').map(function (line) { return '\t' + line; }).join('\n');
1072
+ return new TypeError(message);
1073
+ }
1074
+ }
1075
+ })();
1076
+ return v_error === undefined ? null : v_error;
1077
+ }
1078
+
1079
+ function validate$B(obj, path) {
1080
+ if (path === void 0) { path = 'GoalAssignmentInputRepresentation'; }
1081
+ var v_error = (function () {
1082
+ if (typeof obj !== 'object' || ArrayIsArray(obj) || obj === null) {
1083
+ return new TypeError('Expected "object" but received "' + typeof obj + '" (at "' + path + '")');
1084
+ }
1085
+ if (obj.associatedBenefitAssignments !== undefined) {
1086
+ var obj_associatedBenefitAssignments = obj.associatedBenefitAssignments;
1087
+ var path_associatedBenefitAssignments = path + '.associatedBenefitAssignments';
1088
+ var referencepath_associatedBenefitAssignmentsValidationError = validate$C(obj_associatedBenefitAssignments, path_associatedBenefitAssignments);
1089
+ if (referencepath_associatedBenefitAssignmentsValidationError !== null) {
1090
+ var message = 'Object doesn\'t match BenefitAssignmentListInputRepresentation (at "' + path_associatedBenefitAssignments + '")\n';
1091
+ message += referencepath_associatedBenefitAssignmentsValidationError.message.split('\n').map(function (line) { return '\t' + line; }).join('\n');
1092
+ return new TypeError(message);
1093
+ }
1094
+ }
1095
+ if (obj.associatedSubGoalAssignments !== undefined) {
1096
+ var obj_associatedSubGoalAssignments = obj.associatedSubGoalAssignments;
1097
+ var path_associatedSubGoalAssignments = path + '.associatedSubGoalAssignments';
1098
+ var referencepath_associatedSubGoalAssignmentsValidationError = validate$A(obj_associatedSubGoalAssignments, path_associatedSubGoalAssignments);
1099
+ if (referencepath_associatedSubGoalAssignmentsValidationError !== null) {
1100
+ var message = 'Object doesn\'t match GoalAssignmentListInputRepresentation (at "' + path_associatedSubGoalAssignments + '")\n';
1101
+ message += referencepath_associatedSubGoalAssignmentsValidationError.message.split('\n').map(function (line) { return '\t' + line; }).join('\n');
1102
+ return new TypeError(message);
1103
+ }
1104
+ }
1105
+ if (obj.completionDate !== undefined) {
1106
+ var obj_completionDate = obj.completionDate;
1107
+ var path_completionDate = path + '.completionDate';
1108
+ if (typeof obj_completionDate !== 'string') {
1109
+ return new TypeError('Expected "string" but received "' + typeof obj_completionDate + '" (at "' + path_completionDate + '")');
1110
+ }
1111
+ }
1112
+ if (obj.completionPercentage !== undefined) {
1113
+ obj.completionPercentage;
1114
+ }
1115
+ if (obj.customFields !== undefined) {
1116
+ var obj_customFields = obj.customFields;
1117
+ var path_customFields = path + '.customFields';
1118
+ var referencepath_customFieldsValidationError = validate$E(obj_customFields, path_customFields);
1119
+ if (referencepath_customFieldsValidationError !== null) {
1120
+ var message = 'Object doesn\'t match CustomFieldListInputRepresentation (at "' + path_customFields + '")\n';
1121
+ message += referencepath_customFieldsValidationError.message.split('\n').map(function (line) { return '\t' + line; }).join('\n');
1122
+ return new TypeError(message);
1123
+ }
1124
+ }
1125
+ if (obj.description !== undefined) {
1126
+ var obj_description = obj.description;
1127
+ var path_description = path + '.description';
1128
+ if (typeof obj_description !== 'string') {
1129
+ return new TypeError('Expected "string" but received "' + typeof obj_description + '" (at "' + path_description + '")');
1130
+ }
1131
+ }
1132
+ if (obj.goalAssigneeId !== undefined) {
1133
+ var obj_goalAssigneeId = obj.goalAssigneeId;
1134
+ var path_goalAssigneeId = path + '.goalAssigneeId';
1135
+ if (typeof obj_goalAssigneeId !== 'string') {
1136
+ return new TypeError('Expected "string" but received "' + typeof obj_goalAssigneeId + '" (at "' + path_goalAssigneeId + '")');
1137
+ }
1138
+ }
1139
+ if (obj.goalAssignmentTasks !== undefined) {
1140
+ var obj_goalAssignmentTasks = obj.goalAssignmentTasks;
1141
+ var path_goalAssignmentTasks = path + '.goalAssignmentTasks';
1142
+ var referencepath_goalAssignmentTasksValidationError = validate$G(obj_goalAssignmentTasks, path_goalAssignmentTasks);
1143
+ if (referencepath_goalAssignmentTasksValidationError !== null) {
1144
+ var message = 'Object doesn\'t match CarePlanTaskInputRepresentation (at "' + path_goalAssignmentTasks + '")\n';
1145
+ message += referencepath_goalAssignmentTasksValidationError.message.split('\n').map(function (line) { return '\t' + line; }).join('\n');
1146
+ return new TypeError(message);
1147
+ }
1148
+ }
1149
+ var obj_goalDefinitionId = obj.goalDefinitionId;
1150
+ var path_goalDefinitionId = path + '.goalDefinitionId';
1151
+ if (typeof obj_goalDefinitionId !== 'string') {
1152
+ return new TypeError('Expected "string" but received "' + typeof obj_goalDefinitionId + '" (at "' + path_goalDefinitionId + '")');
1153
+ }
1154
+ if (obj.id !== undefined) {
1155
+ var obj_id = obj.id;
1156
+ var path_id = path + '.id';
1157
+ if (typeof obj_id !== 'string') {
1158
+ return new TypeError('Expected "string" but received "' + typeof obj_id + '" (at "' + path_id + '")');
1159
+ }
1160
+ }
1161
+ if (obj.priority !== undefined) {
1162
+ var obj_priority = obj.priority;
1163
+ var path_priority = path + '.priority';
1164
+ if (typeof obj_priority !== 'string') {
1165
+ return new TypeError('Expected "string" but received "' + typeof obj_priority + '" (at "' + path_priority + '")');
1166
+ }
1167
+ }
1168
+ if (obj.startDate !== undefined) {
1169
+ var obj_startDate = obj.startDate;
1170
+ var path_startDate = path + '.startDate';
1171
+ if (typeof obj_startDate !== 'string') {
1172
+ return new TypeError('Expected "string" but received "' + typeof obj_startDate + '" (at "' + path_startDate + '")');
1173
+ }
1174
+ }
1175
+ if (obj.status !== undefined) {
1176
+ var obj_status = obj.status;
1177
+ var path_status = path + '.status';
1178
+ if (typeof obj_status !== 'string') {
1179
+ return new TypeError('Expected "string" but received "' + typeof obj_status + '" (at "' + path_status + '")');
1180
+ }
1181
+ }
1182
+ if (obj.targetCompletionDate !== undefined) {
1183
+ var obj_targetCompletionDate = obj.targetCompletionDate;
1184
+ var path_targetCompletionDate = path + '.targetCompletionDate';
1185
+ if (typeof obj_targetCompletionDate !== 'string') {
1186
+ return new TypeError('Expected "string" but received "' + typeof obj_targetCompletionDate + '" (at "' + path_targetCompletionDate + '")');
1187
+ }
1188
+ }
1189
+ })();
1190
+ return v_error === undefined ? null : v_error;
1191
+ }
1192
+
1193
+ function validate$A(obj, path) {
1194
+ if (path === void 0) { path = 'GoalAssignmentListInputRepresentation'; }
1195
+ var v_error = (function () {
1196
+ if (typeof obj !== 'object' || ArrayIsArray(obj) || obj === null) {
1197
+ return new TypeError('Expected "object" but received "' + typeof obj + '" (at "' + path + '")');
1198
+ }
1199
+ var obj_records = obj.records;
1200
+ var path_records = path + '.records';
1201
+ if (!ArrayIsArray(obj_records)) {
1202
+ return new TypeError('Expected "array" but received "' + typeof obj_records + '" (at "' + path_records + '")');
1203
+ }
1204
+ for (var i = 0; i < obj_records.length; i++) {
1205
+ var obj_records_item = obj_records[i];
1206
+ var path_records_item = path_records + '[' + i + ']';
1207
+ var referencepath_records_itemValidationError = validate$B(obj_records_item, path_records_item);
1208
+ if (referencepath_records_itemValidationError !== null) {
1209
+ var message = 'Object doesn\'t match GoalAssignmentInputRepresentation (at "' + path_records_item + '")\n';
1210
+ message += referencepath_records_itemValidationError.message.split('\n').map(function (line) { return '\t' + line; }).join('\n');
1211
+ return new TypeError(message);
1212
+ }
1213
+ }
1214
+ })();
1215
+ return v_error === undefined ? null : v_error;
1216
+ }
1217
+
1218
+ function validate$z(obj, path) {
1219
+ if (path === void 0) { path = 'CarePlanInputRepresentation'; }
1220
+ var v_error = (function () {
1221
+ if (typeof obj !== 'object' || ArrayIsArray(obj) || obj === null) {
1222
+ return new TypeError('Expected "object" but received "' + typeof obj + '" (at "' + path + '")');
1223
+ }
1224
+ if (obj.benefitAssignments !== undefined) {
1225
+ var obj_benefitAssignments = obj.benefitAssignments;
1226
+ var path_benefitAssignments = path + '.benefitAssignments';
1227
+ var referencepath_benefitAssignmentsValidationError = validate$C(obj_benefitAssignments, path_benefitAssignments);
1228
+ if (referencepath_benefitAssignmentsValidationError !== null) {
1229
+ var message = 'Object doesn\'t match BenefitAssignmentListInputRepresentation (at "' + path_benefitAssignments + '")\n';
1230
+ message += referencepath_benefitAssignmentsValidationError.message.split('\n').map(function (line) { return '\t' + line; }).join('\n');
1231
+ return new TypeError(message);
1232
+ }
1233
+ }
1234
+ if (obj.carePlanTasks !== undefined) {
1235
+ var obj_carePlanTasks = obj.carePlanTasks;
1236
+ var path_carePlanTasks = path + '.carePlanTasks';
1237
+ var referencepath_carePlanTasksValidationError = validate$G(obj_carePlanTasks, path_carePlanTasks);
1238
+ if (referencepath_carePlanTasksValidationError !== null) {
1239
+ var message = 'Object doesn\'t match CarePlanTaskInputRepresentation (at "' + path_carePlanTasks + '")\n';
1240
+ message += referencepath_carePlanTasksValidationError.message.split('\n').map(function (line) { return '\t' + line; }).join('\n');
1241
+ return new TypeError(message);
1242
+ }
1243
+ }
1244
+ if (obj.carePlanTemplateId !== undefined) {
1245
+ var obj_carePlanTemplateId = obj.carePlanTemplateId;
1246
+ var path_carePlanTemplateId = path + '.carePlanTemplateId';
1247
+ if (typeof obj_carePlanTemplateId !== 'string') {
1248
+ return new TypeError('Expected "string" but received "' + typeof obj_carePlanTemplateId + '" (at "' + path_carePlanTemplateId + '")');
1249
+ }
1250
+ }
1251
+ var obj_caseId = obj.caseId;
1252
+ var path_caseId = path + '.caseId';
1253
+ if (typeof obj_caseId !== 'string') {
1254
+ return new TypeError('Expected "string" but received "' + typeof obj_caseId + '" (at "' + path_caseId + '")');
1255
+ }
1256
+ if (obj.customFields !== undefined) {
1257
+ var obj_customFields = obj.customFields;
1258
+ var path_customFields = path + '.customFields';
1259
+ var referencepath_customFieldsValidationError = validate$E(obj_customFields, path_customFields);
1260
+ if (referencepath_customFieldsValidationError !== null) {
1261
+ var message = 'Object doesn\'t match CustomFieldListInputRepresentation (at "' + path_customFields + '")\n';
1262
+ message += referencepath_customFieldsValidationError.message.split('\n').map(function (line) { return '\t' + line; }).join('\n');
1263
+ return new TypeError(message);
1264
+ }
1265
+ }
1266
+ if (obj.description !== undefined) {
1267
+ var obj_description = obj.description;
1268
+ var path_description = path + '.description';
1269
+ if (typeof obj_description !== 'string') {
1270
+ return new TypeError('Expected "string" but received "' + typeof obj_description + '" (at "' + path_description + '")');
1271
+ }
1272
+ }
1273
+ if (obj.endDate !== undefined) {
1274
+ var obj_endDate = obj.endDate;
1275
+ var path_endDate = path + '.endDate';
1276
+ if (typeof obj_endDate !== 'string') {
1277
+ return new TypeError('Expected "string" but received "' + typeof obj_endDate + '" (at "' + path_endDate + '")');
1278
+ }
1279
+ }
1280
+ if (obj.goalAssignments !== undefined) {
1281
+ var obj_goalAssignments = obj.goalAssignments;
1282
+ var path_goalAssignments = path + '.goalAssignments';
1283
+ var referencepath_goalAssignmentsValidationError = validate$A(obj_goalAssignments, path_goalAssignments);
1284
+ if (referencepath_goalAssignmentsValidationError !== null) {
1285
+ var message = 'Object doesn\'t match GoalAssignmentListInputRepresentation (at "' + path_goalAssignments + '")\n';
1286
+ message += referencepath_goalAssignmentsValidationError.message.split('\n').map(function (line) { return '\t' + line; }).join('\n');
1287
+ return new TypeError(message);
1288
+ }
1289
+ }
1290
+ if (obj.id !== undefined) {
1291
+ var obj_id = obj.id;
1292
+ var path_id = path + '.id';
1293
+ if (typeof obj_id !== 'string') {
1294
+ return new TypeError('Expected "string" but received "' + typeof obj_id + '" (at "' + path_id + '")');
1295
+ }
1296
+ }
1297
+ if (obj.medicationTherapyReview !== undefined) {
1298
+ var obj_medicationTherapyReview = obj.medicationTherapyReview;
1299
+ var path_medicationTherapyReview = path + '.medicationTherapyReview';
1300
+ if (typeof obj_medicationTherapyReview !== 'string') {
1301
+ return new TypeError('Expected "string" but received "' + typeof obj_medicationTherapyReview + '" (at "' + path_medicationTherapyReview + '")');
1302
+ }
1303
+ }
1304
+ var obj_name = obj.name;
1305
+ var path_name = path + '.name';
1306
+ if (typeof obj_name !== 'string') {
1307
+ return new TypeError('Expected "string" but received "' + typeof obj_name + '" (at "' + path_name + '")');
1308
+ }
1309
+ var obj_participantId = obj.participantId;
1310
+ var path_participantId = path + '.participantId';
1311
+ if (typeof obj_participantId !== 'string') {
1312
+ return new TypeError('Expected "string" but received "' + typeof obj_participantId + '" (at "' + path_participantId + '")');
1313
+ }
1314
+ if (obj.startDate !== undefined) {
1315
+ var obj_startDate = obj.startDate;
1316
+ var path_startDate = path + '.startDate';
1317
+ if (typeof obj_startDate !== 'string') {
1318
+ return new TypeError('Expected "string" but received "' + typeof obj_startDate + '" (at "' + path_startDate + '")');
1319
+ }
1320
+ }
1321
+ var obj_status = obj.status;
1322
+ var path_status = path + '.status';
1323
+ if (typeof obj_status !== 'string') {
1324
+ return new TypeError('Expected "string" but received "' + typeof obj_status + '" (at "' + path_status + '")');
1325
+ }
1326
+ })();
1327
+ return v_error === undefined ? null : v_error;
1328
+ }
1329
+
1330
+ function select$c(luvio, params) {
1331
+ return select$g();
1332
+ }
1333
+ function getResponseCacheKeys$8(luvio, resourceParams, response) {
1334
+ return getTypeCacheKeys$5(luvio, response);
1335
+ }
1336
+ function ingestSuccess$8(luvio, resourceParams, response) {
1337
+ var body = response.body;
1338
+ var key = keyBuilderFromType$3(luvio, body);
1339
+ luvio.storeIngest(key, ingest$5, body);
1340
+ var snapshot = luvio.storeLookup({
1341
+ recordId: key,
1342
+ node: select$c(),
1343
+ variables: {},
1344
+ });
1345
+ if (process.env.NODE_ENV !== 'production') {
1346
+ if (snapshot.state !== 'Fulfilled') {
1347
+ throw new Error('Invalid network response. Expected resource response to result in Fulfilled snapshot');
1348
+ }
1349
+ }
1350
+ return snapshot;
1351
+ }
1352
+ function createResourceRequest$8(config) {
1353
+ var headers = {};
1354
+ return {
1355
+ baseUri: '/services/data/v58.0',
1356
+ basePath: '/connect/careplan/care-plans',
1357
+ method: 'post',
1358
+ body: config.body,
1359
+ urlParams: {},
1360
+ queryParams: {},
1361
+ headers: headers,
1362
+ priority: 'normal',
1363
+ };
1364
+ }
1365
+
1366
+ var postCarePlanDetails_ConfigPropertyNames = {
1367
+ displayName: 'postCarePlanDetails',
1368
+ parameters: {
1369
+ required: ['carePlanRecord'],
1370
+ optional: []
1371
+ }
1372
+ };
1373
+ function createResourceParams$8(config) {
1374
+ var resourceParams = {
1375
+ body: {
1376
+ carePlanRecord: config.carePlanRecord
1377
+ }
1378
+ };
1379
+ return resourceParams;
1380
+ }
1381
+ function typeCheckConfig$8(untrustedConfig) {
1382
+ var config = {};
1383
+ var untrustedConfig_carePlanRecord = untrustedConfig.carePlanRecord;
1384
+ var referenceCarePlanInputRepresentationValidationError = validate$z(untrustedConfig_carePlanRecord);
1385
+ if (referenceCarePlanInputRepresentationValidationError === null) {
1386
+ config.carePlanRecord = untrustedConfig_carePlanRecord;
1387
+ }
1388
+ return config;
1389
+ }
1390
+ function validateAdapterConfig$8(untrustedConfig, configPropertyNames) {
1391
+ if (!untrustedIsObject(untrustedConfig)) {
1392
+ return null;
1393
+ }
1394
+ if (process.env.NODE_ENV !== 'production') {
1395
+ validateConfig(untrustedConfig, configPropertyNames);
1396
+ }
1397
+ var config = typeCheckConfig$8(untrustedConfig);
1398
+ if (!areRequiredParametersPresent(config, configPropertyNames)) {
1399
+ return null;
1400
+ }
1401
+ return config;
1402
+ }
1403
+ function buildNetworkSnapshot$8(luvio, config, options) {
1404
+ var resourceParams = createResourceParams$8(config);
1405
+ var request = createResourceRequest$8(resourceParams);
1406
+ return luvio.dispatchResourceRequest(request, options)
1407
+ .then(function (response) {
1408
+ return luvio.handleSuccessResponse(function () {
1409
+ var snapshot = ingestSuccess$8(luvio, resourceParams, response);
1410
+ return luvio.storeBroadcast().then(function () { return snapshot; });
1411
+ }, function () { return getResponseCacheKeys$8(luvio, resourceParams, response.body); });
1412
+ }, function (response) {
1413
+ deepFreeze$v(response);
1414
+ throw response;
1415
+ });
1416
+ }
1417
+ var postCarePlanDetailsAdapterFactory = function (luvio) {
1418
+ return function postCarePlanDetails(untrustedConfig) {
1419
+ var config = validateAdapterConfig$8(untrustedConfig, postCarePlanDetails_ConfigPropertyNames);
1420
+ // Invalid or incomplete config
1421
+ if (config === null) {
1422
+ throw new Error('Invalid config for "postCarePlanDetails"');
1423
+ }
1424
+ return buildNetworkSnapshot$8(luvio, config);
1425
+ };
1426
+ };
1427
+
1428
+ function validate$y(obj, path) {
1429
+ if (path === void 0) { path = 'CarePlanTaskRepresentation'; }
1430
+ var v_error = (function () {
1431
+ if (typeof obj !== 'object' || ArrayIsArray(obj) || obj === null) {
1432
+ return new TypeError('Expected "object" but received "' + typeof obj + '" (at "' + path + '")');
1433
+ }
1434
+ if (obj.assignedTo !== undefined) {
1435
+ var obj_assignedTo = obj.assignedTo;
1436
+ var path_assignedTo = path + '.assignedTo';
1437
+ if (typeof obj_assignedTo !== 'string') {
1438
+ return new TypeError('Expected "string" but received "' + typeof obj_assignedTo + '" (at "' + path_assignedTo + '")');
1439
+ }
1440
+ }
1441
+ if (obj.comment !== undefined) {
1442
+ var obj_comment = obj.comment;
1443
+ var path_comment = path + '.comment';
1444
+ if (typeof obj_comment !== 'string') {
1445
+ return new TypeError('Expected "string" but received "' + typeof obj_comment + '" (at "' + path_comment + '")');
1446
+ }
1447
+ }
1448
+ if (obj.dependentTasks !== undefined) {
1449
+ var obj_dependentTasks = obj.dependentTasks;
1450
+ var path_dependentTasks = path + '.dependentTasks';
1451
+ var referencepath_dependentTasksValidationError = validate$x(obj_dependentTasks, path_dependentTasks);
1452
+ if (referencepath_dependentTasksValidationError !== null) {
1453
+ var message = 'Object doesn\'t match CarePlanTaskListRepresentation (at "' + path_dependentTasks + '")\n';
1454
+ message += referencepath_dependentTasksValidationError.message.split('\n').map(function (line) { return '\t' + line; }).join('\n');
1455
+ return new TypeError(message);
1456
+ }
1457
+ }
1458
+ if (obj.displayOrder !== undefined) {
1459
+ var obj_displayOrder = obj.displayOrder;
1460
+ var path_displayOrder = path + '.displayOrder';
1461
+ if (typeof obj_displayOrder !== 'number' || (typeof obj_displayOrder === 'number' && Math.floor(obj_displayOrder) !== obj_displayOrder)) {
1462
+ return new TypeError('Expected "integer" but received "' + typeof obj_displayOrder + '" (at "' + path_displayOrder + '")');
1463
+ }
1464
+ }
1465
+ if (obj.dueDate !== undefined) {
1466
+ var obj_dueDate = obj.dueDate;
1467
+ var path_dueDate = path + '.dueDate';
1468
+ if (typeof obj_dueDate !== 'string') {
1469
+ return new TypeError('Expected "string" but received "' + typeof obj_dueDate + '" (at "' + path_dueDate + '")');
1470
+ }
1471
+ }
1472
+ var obj_id = obj.id;
1473
+ var path_id = path + '.id';
1474
+ if (typeof obj_id !== 'string') {
1475
+ return new TypeError('Expected "string" but received "' + typeof obj_id + '" (at "' + path_id + '")');
1476
+ }
1477
+ if (obj.isRequired !== undefined) {
1478
+ var obj_isRequired = obj.isRequired;
1479
+ var path_isRequired = path + '.isRequired';
1480
+ if (typeof obj_isRequired !== 'boolean') {
1481
+ return new TypeError('Expected "boolean" but received "' + typeof obj_isRequired + '" (at "' + path_isRequired + '")');
1482
+ }
1483
+ }
1484
+ if (obj.priority !== undefined) {
1485
+ var obj_priority = obj.priority;
1486
+ var path_priority = path + '.priority';
1487
+ if (typeof obj_priority !== 'string') {
1488
+ return new TypeError('Expected "string" but received "' + typeof obj_priority + '" (at "' + path_priority + '")');
1489
+ }
1490
+ }
1491
+ if (obj.relatedTo !== undefined) {
1492
+ var obj_relatedTo = obj.relatedTo;
1493
+ var path_relatedTo = path + '.relatedTo';
1494
+ if (typeof obj_relatedTo !== 'string') {
1495
+ return new TypeError('Expected "string" but received "' + typeof obj_relatedTo + '" (at "' + path_relatedTo + '")');
1496
+ }
1497
+ }
1498
+ if (obj.status !== undefined) {
1499
+ var obj_status = obj.status;
1500
+ var path_status = path + '.status';
1501
+ if (typeof obj_status !== 'string') {
1502
+ return new TypeError('Expected "string" but received "' + typeof obj_status + '" (at "' + path_status + '")');
1503
+ }
1504
+ }
1505
+ if (obj.subject !== undefined) {
1506
+ var obj_subject = obj.subject;
1507
+ var path_subject = path + '.subject';
1508
+ if (typeof obj_subject !== 'string') {
1509
+ return new TypeError('Expected "string" but received "' + typeof obj_subject + '" (at "' + path_subject + '")');
1510
+ }
1511
+ }
1512
+ })();
1513
+ return v_error === undefined ? null : v_error;
1514
+ }
1515
+ function deepFreeze$o(input) {
1516
+ var input_dependentTasks = input.dependentTasks;
1517
+ if (input_dependentTasks !== undefined) {
1518
+ deepFreeze$n(input_dependentTasks);
1519
+ }
1520
+ ObjectFreeze(input);
1521
+ }
1522
+
1523
+ function validate$x(obj, path) {
1524
+ if (path === void 0) { path = 'CarePlanTaskListRepresentation'; }
1525
+ var v_error = (function () {
1526
+ if (typeof obj !== 'object' || ArrayIsArray(obj) || obj === null) {
1527
+ return new TypeError('Expected "object" but received "' + typeof obj + '" (at "' + path + '")');
1528
+ }
1529
+ if (obj.records !== undefined) {
1530
+ var obj_records = obj.records;
1531
+ var path_records = path + '.records';
1532
+ if (!ArrayIsArray(obj_records)) {
1533
+ return new TypeError('Expected "array" but received "' + typeof obj_records + '" (at "' + path_records + '")');
1534
+ }
1535
+ for (var i = 0; i < obj_records.length; i++) {
1536
+ var obj_records_item = obj_records[i];
1537
+ var path_records_item = path_records + '[' + i + ']';
1538
+ var referencepath_records_itemValidationError = validate$y(obj_records_item, path_records_item);
1539
+ if (referencepath_records_itemValidationError !== null) {
1540
+ var message = 'Object doesn\'t match CarePlanTaskRepresentation (at "' + path_records_item + '")\n';
1541
+ message += referencepath_records_itemValidationError.message.split('\n').map(function (line) { return '\t' + line; }).join('\n');
1542
+ return new TypeError(message);
1543
+ }
1544
+ }
1545
+ }
1546
+ })();
1547
+ return v_error === undefined ? null : v_error;
1548
+ }
1549
+ function deepFreeze$n(input) {
1550
+ var input_records = input.records;
1551
+ if (input_records !== undefined) {
1552
+ for (var i = 0; i < input_records.length; i++) {
1553
+ var input_records_item = input_records[i];
1554
+ deepFreeze$o(input_records_item);
1555
+ }
1556
+ ObjectFreeze(input_records);
1557
+ }
1558
+ ObjectFreeze(input);
1559
+ }
1560
+
1561
+ function validate$w(obj, path) {
1562
+ if (path === void 0) { path = 'CarePlanTasksRepresentation'; }
1563
+ var v_error = (function () {
1564
+ if (typeof obj !== 'object' || ArrayIsArray(obj) || obj === null) {
1565
+ return new TypeError('Expected "object" but received "' + typeof obj + '" (at "' + path + '")');
1566
+ }
1567
+ var obj_tasks = obj.tasks;
1568
+ var path_tasks = path + '.tasks';
1569
+ var referencepath_tasksValidationError = validate$x(obj_tasks, path_tasks);
1570
+ if (referencepath_tasksValidationError !== null) {
1571
+ var message = 'Object doesn\'t match CarePlanTaskListRepresentation (at "' + path_tasks + '")\n';
1572
+ message += referencepath_tasksValidationError.message.split('\n').map(function (line) { return '\t' + line; }).join('\n');
1573
+ return new TypeError(message);
1574
+ }
1575
+ })();
1576
+ return v_error === undefined ? null : v_error;
1577
+ }
1578
+ function deepFreeze$m(input) {
1579
+ var input_tasks = input.tasks;
1580
+ deepFreeze$n(input_tasks);
1581
+ ObjectFreeze(input);
1582
+ }
1583
+
1584
+ function validate$v(obj, path) {
1585
+ if (path === void 0) { path = 'CustomFieldRepresentation'; }
1586
+ var v_error = (function () {
1587
+ if (typeof obj !== 'object' || ArrayIsArray(obj) || obj === null) {
1588
+ return new TypeError('Expected "object" but received "' + typeof obj + '" (at "' + path + '")');
1589
+ }
1590
+ if (obj.dataType !== undefined) {
1591
+ var obj_dataType = obj.dataType;
1592
+ var path_dataType = path + '.dataType';
1593
+ if (typeof obj_dataType !== 'string') {
1594
+ return new TypeError('Expected "string" but received "' + typeof obj_dataType + '" (at "' + path_dataType + '")');
1595
+ }
1596
+ }
1597
+ var obj_fieldName = obj.fieldName;
1598
+ var path_fieldName = path + '.fieldName';
1599
+ if (typeof obj_fieldName !== 'string') {
1600
+ return new TypeError('Expected "string" but received "' + typeof obj_fieldName + '" (at "' + path_fieldName + '")');
1601
+ }
1602
+ var obj_fieldValue = obj.fieldValue;
1603
+ var path_fieldValue = path + '.fieldValue';
1604
+ if (obj_fieldValue === undefined) {
1605
+ return new TypeError('Expected "defined" but received "' + typeof obj_fieldValue + '" (at "' + path_fieldValue + '")');
1606
+ }
1607
+ })();
1608
+ return v_error === undefined ? null : v_error;
1609
+ }
1610
+ function deepFreeze$l(input) {
1611
+ var input_fieldValue = input.fieldValue;
1612
+ deepFreeze$v(input_fieldValue);
1613
+ ObjectFreeze(input);
1614
+ }
1615
+
1616
+ function validate$u(obj, path) {
1617
+ if (path === void 0) { path = 'CustomFieldListRepresentation'; }
1618
+ var v_error = (function () {
1619
+ if (typeof obj !== 'object' || ArrayIsArray(obj) || obj === null) {
1620
+ return new TypeError('Expected "object" but received "' + typeof obj + '" (at "' + path + '")');
1621
+ }
1622
+ var obj_records = obj.records;
1623
+ var path_records = path + '.records';
1624
+ if (!ArrayIsArray(obj_records)) {
1625
+ return new TypeError('Expected "array" but received "' + typeof obj_records + '" (at "' + path_records + '")');
1626
+ }
1627
+ for (var i = 0; i < obj_records.length; i++) {
1628
+ var obj_records_item = obj_records[i];
1629
+ var path_records_item = path_records + '[' + i + ']';
1630
+ var referencepath_records_itemValidationError = validate$v(obj_records_item, path_records_item);
1631
+ if (referencepath_records_itemValidationError !== null) {
1632
+ var message = 'Object doesn\'t match CustomFieldRepresentation (at "' + path_records_item + '")\n';
1633
+ message += referencepath_records_itemValidationError.message.split('\n').map(function (line) { return '\t' + line; }).join('\n');
1634
+ return new TypeError(message);
1635
+ }
1636
+ }
1637
+ })();
1638
+ return v_error === undefined ? null : v_error;
1639
+ }
1640
+ function deepFreeze$k(input) {
1641
+ var input_records = input.records;
1642
+ for (var i = 0; i < input_records.length; i++) {
1643
+ var input_records_item = input_records[i];
1644
+ deepFreeze$l(input_records_item);
1645
+ }
1646
+ ObjectFreeze(input_records);
1647
+ ObjectFreeze(input);
1648
+ }
1649
+
1650
+ function validate$t(obj, path) {
1651
+ if (path === void 0) { path = 'BenefitAssignmentRepresentation'; }
1652
+ var v_error = (function () {
1653
+ if (typeof obj !== 'object' || ArrayIsArray(obj) || obj === null) {
1654
+ return new TypeError('Expected "object" but received "' + typeof obj + '" (at "' + path + '")');
1655
+ }
1656
+ if (obj.benefitAssignmentTasks !== undefined) {
1657
+ var obj_benefitAssignmentTasks = obj.benefitAssignmentTasks;
1658
+ var path_benefitAssignmentTasks = path + '.benefitAssignmentTasks';
1659
+ var referencepath_benefitAssignmentTasksValidationError = validate$w(obj_benefitAssignmentTasks, path_benefitAssignmentTasks);
1660
+ if (referencepath_benefitAssignmentTasksValidationError !== null) {
1661
+ var message = 'Object doesn\'t match CarePlanTasksRepresentation (at "' + path_benefitAssignmentTasks + '")\n';
1662
+ message += referencepath_benefitAssignmentTasksValidationError.message.split('\n').map(function (line) { return '\t' + line; }).join('\n');
1663
+ return new TypeError(message);
1664
+ }
1665
+ }
1666
+ if (obj.benefitFrequency !== undefined) {
1667
+ var obj_benefitFrequency = obj.benefitFrequency;
1668
+ var path_benefitFrequency = path + '.benefitFrequency';
1669
+ if (typeof obj_benefitFrequency !== 'string') {
1670
+ return new TypeError('Expected "string" but received "' + typeof obj_benefitFrequency + '" (at "' + path_benefitFrequency + '")');
1671
+ }
1672
+ }
1673
+ var obj_benefitId = obj.benefitId;
1674
+ var path_benefitId = path + '.benefitId';
1675
+ if (typeof obj_benefitId !== 'string') {
1676
+ return new TypeError('Expected "string" but received "' + typeof obj_benefitId + '" (at "' + path_benefitId + '")');
1677
+ }
1678
+ var obj_benefitName = obj.benefitName;
1679
+ var path_benefitName = path + '.benefitName';
1680
+ if (typeof obj_benefitName !== 'string') {
1681
+ return new TypeError('Expected "string" but received "' + typeof obj_benefitName + '" (at "' + path_benefitName + '")');
1682
+ }
1683
+ if (obj.customFields !== undefined) {
1684
+ var obj_customFields = obj.customFields;
1685
+ var path_customFields = path + '.customFields';
1686
+ var referencepath_customFieldsValidationError = validate$u(obj_customFields, path_customFields);
1687
+ if (referencepath_customFieldsValidationError !== null) {
1688
+ var message = 'Object doesn\'t match CustomFieldListRepresentation (at "' + path_customFields + '")\n';
1689
+ message += referencepath_customFieldsValidationError.message.split('\n').map(function (line) { return '\t' + line; }).join('\n');
1690
+ return new TypeError(message);
1691
+ }
1692
+ }
1693
+ if (obj.endDate !== undefined) {
1694
+ var obj_endDate = obj.endDate;
1695
+ var path_endDate = path + '.endDate';
1696
+ if (typeof obj_endDate !== 'string') {
1697
+ return new TypeError('Expected "string" but received "' + typeof obj_endDate + '" (at "' + path_endDate + '")');
1698
+ }
1699
+ }
1700
+ if (obj.enrollmentCount !== undefined) {
1701
+ var obj_enrollmentCount = obj.enrollmentCount;
1702
+ var path_enrollmentCount = path + '.enrollmentCount';
1703
+ if (typeof obj_enrollmentCount !== 'number' || (typeof obj_enrollmentCount === 'number' && Math.floor(obj_enrollmentCount) !== obj_enrollmentCount)) {
1704
+ return new TypeError('Expected "integer" but received "' + typeof obj_enrollmentCount + '" (at "' + path_enrollmentCount + '")');
1705
+ }
1706
+ }
1707
+ if (obj.entitlementAmount !== undefined) {
1708
+ obj.entitlementAmount;
1709
+ }
1710
+ var obj_id = obj.id;
1711
+ var path_id = path + '.id';
1712
+ if (typeof obj_id !== 'string') {
1713
+ return new TypeError('Expected "string" but received "' + typeof obj_id + '" (at "' + path_id + '")');
1714
+ }
1715
+ if (obj.maximumAmount !== undefined) {
1716
+ obj.maximumAmount;
1717
+ }
1718
+ var obj_participantId = obj.participantId;
1719
+ var path_participantId = path + '.participantId';
1720
+ if (typeof obj_participantId !== 'string') {
1721
+ return new TypeError('Expected "string" but received "' + typeof obj_participantId + '" (at "' + path_participantId + '")');
1722
+ }
1723
+ if (obj.participantName !== undefined) {
1724
+ var obj_participantName = obj.participantName;
1725
+ var path_participantName = path + '.participantName';
1726
+ if (typeof obj_participantName !== 'string') {
1727
+ return new TypeError('Expected "string" but received "' + typeof obj_participantName + '" (at "' + path_participantName + '")');
1728
+ }
1729
+ }
1730
+ if (obj.payoutFrequency !== undefined) {
1731
+ var obj_payoutFrequency = obj.payoutFrequency;
1732
+ var path_payoutFrequency = path + '.payoutFrequency';
1733
+ if (typeof obj_payoutFrequency !== 'string') {
1734
+ return new TypeError('Expected "string" but received "' + typeof obj_payoutFrequency + '" (at "' + path_payoutFrequency + '")');
1735
+ }
1736
+ }
1737
+ if (obj.priority !== undefined) {
1738
+ var obj_priority = obj.priority;
1739
+ var path_priority = path + '.priority';
1740
+ if (typeof obj_priority !== 'string') {
1741
+ return new TypeError('Expected "string" but received "' + typeof obj_priority + '" (at "' + path_priority + '")');
1742
+ }
1743
+ }
1744
+ if (obj.startDate !== undefined) {
1745
+ var obj_startDate = obj.startDate;
1746
+ var path_startDate = path + '.startDate';
1747
+ if (typeof obj_startDate !== 'string') {
1748
+ return new TypeError('Expected "string" but received "' + typeof obj_startDate + '" (at "' + path_startDate + '")');
1749
+ }
1750
+ }
1751
+ if (obj.status !== undefined) {
1752
+ var obj_status = obj.status;
1753
+ var path_status = path + '.status';
1754
+ if (typeof obj_status !== 'string') {
1755
+ return new TypeError('Expected "string" but received "' + typeof obj_status + '" (at "' + path_status + '")');
1756
+ }
1757
+ }
1758
+ if (obj.taskJobStatus !== undefined) {
1759
+ var obj_taskJobStatus = obj.taskJobStatus;
1760
+ var path_taskJobStatus = path + '.taskJobStatus';
1761
+ if (typeof obj_taskJobStatus !== 'string') {
1762
+ return new TypeError('Expected "string" but received "' + typeof obj_taskJobStatus + '" (at "' + path_taskJobStatus + '")');
1763
+ }
1764
+ }
1765
+ if (obj.taskJobStatusReason !== undefined) {
1766
+ var obj_taskJobStatusReason = obj.taskJobStatusReason;
1767
+ var path_taskJobStatusReason = path + '.taskJobStatusReason';
1768
+ if (typeof obj_taskJobStatusReason !== 'string') {
1769
+ return new TypeError('Expected "string" but received "' + typeof obj_taskJobStatusReason + '" (at "' + path_taskJobStatusReason + '")');
1770
+ }
1771
+ }
1772
+ })();
1773
+ return v_error === undefined ? null : v_error;
1774
+ }
1775
+ function deepFreeze$j(input) {
1776
+ var input_benefitAssignmentTasks = input.benefitAssignmentTasks;
1777
+ if (input_benefitAssignmentTasks !== undefined) {
1778
+ deepFreeze$m(input_benefitAssignmentTasks);
1779
+ }
1780
+ var input_customFields = input.customFields;
1781
+ if (input_customFields !== undefined) {
1782
+ deepFreeze$k(input_customFields);
1783
+ }
1784
+ ObjectFreeze(input);
1785
+ }
1786
+
1787
+ function validate$s(obj, path) {
1788
+ if (path === void 0) { path = 'BenefitAssignmentListRepresentation'; }
1789
+ var v_error = (function () {
1790
+ if (typeof obj !== 'object' || ArrayIsArray(obj) || obj === null) {
1791
+ return new TypeError('Expected "object" but received "' + typeof obj + '" (at "' + path + '")');
1792
+ }
1793
+ var obj_records = obj.records;
1794
+ var path_records = path + '.records';
1795
+ if (!ArrayIsArray(obj_records)) {
1796
+ return new TypeError('Expected "array" but received "' + typeof obj_records + '" (at "' + path_records + '")');
1797
+ }
1798
+ for (var i = 0; i < obj_records.length; i++) {
1799
+ var obj_records_item = obj_records[i];
1800
+ var path_records_item = path_records + '[' + i + ']';
1801
+ var referencepath_records_itemValidationError = validate$t(obj_records_item, path_records_item);
1802
+ if (referencepath_records_itemValidationError !== null) {
1803
+ var message = 'Object doesn\'t match BenefitAssignmentRepresentation (at "' + path_records_item + '")\n';
1804
+ message += referencepath_records_itemValidationError.message.split('\n').map(function (line) { return '\t' + line; }).join('\n');
1805
+ return new TypeError(message);
1806
+ }
1807
+ }
1808
+ })();
1809
+ return v_error === undefined ? null : v_error;
1810
+ }
1811
+ function deepFreeze$i(input) {
1812
+ var input_records = input.records;
1813
+ for (var i = 0; i < input_records.length; i++) {
1814
+ var input_records_item = input_records[i];
1815
+ deepFreeze$j(input_records_item);
1816
+ }
1817
+ ObjectFreeze(input_records);
1818
+ ObjectFreeze(input);
1819
+ }
1820
+
1821
+ function validate$r(obj, path) {
1822
+ if (path === void 0) { path = 'GoalAssignmentRepresentation'; }
1823
+ var v_error = (function () {
1824
+ if (typeof obj !== 'object' || ArrayIsArray(obj) || obj === null) {
1825
+ return new TypeError('Expected "object" but received "' + typeof obj + '" (at "' + path + '")');
1826
+ }
1827
+ if (obj.associatedBenefitAssignments !== undefined) {
1828
+ var obj_associatedBenefitAssignments = obj.associatedBenefitAssignments;
1829
+ var path_associatedBenefitAssignments = path + '.associatedBenefitAssignments';
1830
+ var referencepath_associatedBenefitAssignmentsValidationError = validate$s(obj_associatedBenefitAssignments, path_associatedBenefitAssignments);
1831
+ if (referencepath_associatedBenefitAssignmentsValidationError !== null) {
1832
+ var message = 'Object doesn\'t match BenefitAssignmentListRepresentation (at "' + path_associatedBenefitAssignments + '")\n';
1833
+ message += referencepath_associatedBenefitAssignmentsValidationError.message.split('\n').map(function (line) { return '\t' + line; }).join('\n');
1834
+ return new TypeError(message);
1835
+ }
1836
+ }
1837
+ if (obj.associatedSubGoalAssignments !== undefined) {
1838
+ var obj_associatedSubGoalAssignments = obj.associatedSubGoalAssignments;
1839
+ var path_associatedSubGoalAssignments = path + '.associatedSubGoalAssignments';
1840
+ var referencepath_associatedSubGoalAssignmentsValidationError = validate$q(obj_associatedSubGoalAssignments, path_associatedSubGoalAssignments);
1841
+ if (referencepath_associatedSubGoalAssignmentsValidationError !== null) {
1842
+ var message = 'Object doesn\'t match GoalAssignmentListRepresentation (at "' + path_associatedSubGoalAssignments + '")\n';
1843
+ message += referencepath_associatedSubGoalAssignmentsValidationError.message.split('\n').map(function (line) { return '\t' + line; }).join('\n');
1844
+ return new TypeError(message);
1845
+ }
1846
+ }
1847
+ if (obj.completionDate !== undefined) {
1848
+ var obj_completionDate = obj.completionDate;
1849
+ var path_completionDate = path + '.completionDate';
1850
+ if (typeof obj_completionDate !== 'string') {
1851
+ return new TypeError('Expected "string" but received "' + typeof obj_completionDate + '" (at "' + path_completionDate + '")');
1852
+ }
1853
+ }
1854
+ if (obj.completionPercentage !== undefined) {
1855
+ obj.completionPercentage;
1856
+ }
1857
+ if (obj.customFields !== undefined) {
1858
+ var obj_customFields = obj.customFields;
1859
+ var path_customFields = path + '.customFields';
1860
+ var referencepath_customFieldsValidationError = validate$u(obj_customFields, path_customFields);
1861
+ if (referencepath_customFieldsValidationError !== null) {
1862
+ var message = 'Object doesn\'t match CustomFieldListRepresentation (at "' + path_customFields + '")\n';
1863
+ message += referencepath_customFieldsValidationError.message.split('\n').map(function (line) { return '\t' + line; }).join('\n');
1864
+ return new TypeError(message);
1865
+ }
1866
+ }
1867
+ if (obj.description !== undefined) {
1868
+ var obj_description = obj.description;
1869
+ var path_description = path + '.description';
1870
+ if (typeof obj_description !== 'string') {
1871
+ return new TypeError('Expected "string" but received "' + typeof obj_description + '" (at "' + path_description + '")');
1872
+ }
1873
+ }
1874
+ if (obj.goalAssigneeId !== undefined) {
1875
+ var obj_goalAssigneeId = obj.goalAssigneeId;
1876
+ var path_goalAssigneeId = path + '.goalAssigneeId';
1877
+ if (typeof obj_goalAssigneeId !== 'string') {
1878
+ return new TypeError('Expected "string" but received "' + typeof obj_goalAssigneeId + '" (at "' + path_goalAssigneeId + '")');
1879
+ }
1880
+ }
1881
+ if (obj.goalAssigneeName !== undefined) {
1882
+ var obj_goalAssigneeName = obj.goalAssigneeName;
1883
+ var path_goalAssigneeName = path + '.goalAssigneeName';
1884
+ if (typeof obj_goalAssigneeName !== 'string') {
1885
+ return new TypeError('Expected "string" but received "' + typeof obj_goalAssigneeName + '" (at "' + path_goalAssigneeName + '")');
1886
+ }
1887
+ }
1888
+ if (obj.goalAssignmentTasks !== undefined) {
1889
+ var obj_goalAssignmentTasks = obj.goalAssignmentTasks;
1890
+ var path_goalAssignmentTasks = path + '.goalAssignmentTasks';
1891
+ var referencepath_goalAssignmentTasksValidationError = validate$w(obj_goalAssignmentTasks, path_goalAssignmentTasks);
1892
+ if (referencepath_goalAssignmentTasksValidationError !== null) {
1893
+ var message = 'Object doesn\'t match CarePlanTasksRepresentation (at "' + path_goalAssignmentTasks + '")\n';
1894
+ message += referencepath_goalAssignmentTasksValidationError.message.split('\n').map(function (line) { return '\t' + line; }).join('\n');
1895
+ return new TypeError(message);
1896
+ }
1897
+ }
1898
+ var obj_goalDefinitionId = obj.goalDefinitionId;
1899
+ var path_goalDefinitionId = path + '.goalDefinitionId';
1900
+ if (typeof obj_goalDefinitionId !== 'string') {
1901
+ return new TypeError('Expected "string" but received "' + typeof obj_goalDefinitionId + '" (at "' + path_goalDefinitionId + '")');
1902
+ }
1903
+ var obj_goalDefinitionName = obj.goalDefinitionName;
1904
+ var path_goalDefinitionName = path + '.goalDefinitionName';
1905
+ if (typeof obj_goalDefinitionName !== 'string') {
1906
+ return new TypeError('Expected "string" but received "' + typeof obj_goalDefinitionName + '" (at "' + path_goalDefinitionName + '")');
1907
+ }
1908
+ if (obj.goalType !== undefined) {
1909
+ var obj_goalType = obj.goalType;
1910
+ var path_goalType = path + '.goalType';
1911
+ if (typeof obj_goalType !== 'string') {
1912
+ return new TypeError('Expected "string" but received "' + typeof obj_goalType + '" (at "' + path_goalType + '")');
1913
+ }
1914
+ }
1915
+ var obj_id = obj.id;
1916
+ var path_id = path + '.id';
1917
+ if (typeof obj_id !== 'string') {
1918
+ return new TypeError('Expected "string" but received "' + typeof obj_id + '" (at "' + path_id + '")');
1919
+ }
1920
+ if (obj.priority !== undefined) {
1921
+ var obj_priority = obj.priority;
1922
+ var path_priority = path + '.priority';
1923
+ if (typeof obj_priority !== 'string') {
1924
+ return new TypeError('Expected "string" but received "' + typeof obj_priority + '" (at "' + path_priority + '")');
1925
+ }
1926
+ }
1927
+ if (obj.startDate !== undefined) {
1928
+ var obj_startDate = obj.startDate;
1929
+ var path_startDate = path + '.startDate';
1930
+ if (typeof obj_startDate !== 'string') {
1931
+ return new TypeError('Expected "string" but received "' + typeof obj_startDate + '" (at "' + path_startDate + '")');
1932
+ }
1933
+ }
1934
+ if (obj.status !== undefined) {
1935
+ var obj_status = obj.status;
1936
+ var path_status = path + '.status';
1937
+ if (typeof obj_status !== 'string') {
1938
+ return new TypeError('Expected "string" but received "' + typeof obj_status + '" (at "' + path_status + '")');
1939
+ }
1940
+ }
1941
+ if (obj.targetCompletionDate !== undefined) {
1942
+ var obj_targetCompletionDate = obj.targetCompletionDate;
1943
+ var path_targetCompletionDate = path + '.targetCompletionDate';
1944
+ if (typeof obj_targetCompletionDate !== 'string') {
1945
+ return new TypeError('Expected "string" but received "' + typeof obj_targetCompletionDate + '" (at "' + path_targetCompletionDate + '")');
1946
+ }
1947
+ }
1948
+ if (obj.taskJobStatus !== undefined) {
1949
+ var obj_taskJobStatus = obj.taskJobStatus;
1950
+ var path_taskJobStatus = path + '.taskJobStatus';
1951
+ if (typeof obj_taskJobStatus !== 'string') {
1952
+ return new TypeError('Expected "string" but received "' + typeof obj_taskJobStatus + '" (at "' + path_taskJobStatus + '")');
1953
+ }
1954
+ }
1955
+ if (obj.taskJobStatusReason !== undefined) {
1956
+ var obj_taskJobStatusReason = obj.taskJobStatusReason;
1957
+ var path_taskJobStatusReason = path + '.taskJobStatusReason';
1958
+ if (typeof obj_taskJobStatusReason !== 'string') {
1959
+ return new TypeError('Expected "string" but received "' + typeof obj_taskJobStatusReason + '" (at "' + path_taskJobStatusReason + '")');
1960
+ }
1961
+ }
1962
+ })();
1963
+ return v_error === undefined ? null : v_error;
1964
+ }
1965
+ function deepFreeze$h(input) {
1966
+ var input_associatedBenefitAssignments = input.associatedBenefitAssignments;
1967
+ if (input_associatedBenefitAssignments !== undefined) {
1968
+ deepFreeze$i(input_associatedBenefitAssignments);
1969
+ }
1970
+ var input_associatedSubGoalAssignments = input.associatedSubGoalAssignments;
1971
+ if (input_associatedSubGoalAssignments !== undefined) {
1972
+ deepFreeze$g(input_associatedSubGoalAssignments);
1973
+ }
1974
+ var input_customFields = input.customFields;
1975
+ if (input_customFields !== undefined) {
1976
+ deepFreeze$k(input_customFields);
1977
+ }
1978
+ var input_goalAssignmentTasks = input.goalAssignmentTasks;
1979
+ if (input_goalAssignmentTasks !== undefined) {
1980
+ deepFreeze$m(input_goalAssignmentTasks);
1981
+ }
1982
+ ObjectFreeze(input);
1983
+ }
1984
+
1985
+ function validate$q(obj, path) {
1986
+ if (path === void 0) { path = 'GoalAssignmentListRepresentation'; }
1987
+ var v_error = (function () {
1988
+ if (typeof obj !== 'object' || ArrayIsArray(obj) || obj === null) {
1989
+ return new TypeError('Expected "object" but received "' + typeof obj + '" (at "' + path + '")');
1990
+ }
1991
+ var obj_records = obj.records;
1992
+ var path_records = path + '.records';
1993
+ if (!ArrayIsArray(obj_records)) {
1994
+ return new TypeError('Expected "array" but received "' + typeof obj_records + '" (at "' + path_records + '")');
1995
+ }
1996
+ for (var i = 0; i < obj_records.length; i++) {
1997
+ var obj_records_item = obj_records[i];
1998
+ var path_records_item = path_records + '[' + i + ']';
1999
+ var referencepath_records_itemValidationError = validate$r(obj_records_item, path_records_item);
2000
+ if (referencepath_records_itemValidationError !== null) {
2001
+ var message = 'Object doesn\'t match GoalAssignmentRepresentation (at "' + path_records_item + '")\n';
2002
+ message += referencepath_records_itemValidationError.message.split('\n').map(function (line) { return '\t' + line; }).join('\n');
2003
+ return new TypeError(message);
2004
+ }
2005
+ }
2006
+ })();
2007
+ return v_error === undefined ? null : v_error;
2008
+ }
2009
+ function deepFreeze$g(input) {
2010
+ var input_records = input.records;
2011
+ for (var i = 0; i < input_records.length; i++) {
2012
+ var input_records_item = input_records[i];
2013
+ deepFreeze$h(input_records_item);
2014
+ }
2015
+ ObjectFreeze(input_records);
2016
+ ObjectFreeze(input);
2017
+ }
2018
+
2019
+ var TTL$3 = 1000;
2020
+ var VERSION$3 = "d8ff11296664e4369c0a7abd4a12e98b";
2021
+ function validate$p(obj, path) {
2022
+ if (path === void 0) { path = 'CarePlanRepresentation'; }
2023
+ var v_error = (function () {
2024
+ if (typeof obj !== 'object' || ArrayIsArray(obj) || obj === null) {
2025
+ return new TypeError('Expected "object" but received "' + typeof obj + '" (at "' + path + '")');
2026
+ }
2027
+ if (obj.benefitAssignments !== undefined) {
2028
+ var obj_benefitAssignments = obj.benefitAssignments;
2029
+ var path_benefitAssignments = path + '.benefitAssignments';
2030
+ var referencepath_benefitAssignmentsValidationError = validate$s(obj_benefitAssignments, path_benefitAssignments);
2031
+ if (referencepath_benefitAssignmentsValidationError !== null) {
2032
+ var message = 'Object doesn\'t match BenefitAssignmentListRepresentation (at "' + path_benefitAssignments + '")\n';
2033
+ message += referencepath_benefitAssignmentsValidationError.message.split('\n').map(function (line) { return '\t' + line; }).join('\n');
2034
+ return new TypeError(message);
2035
+ }
2036
+ }
2037
+ if (obj.carePlanTasks !== undefined) {
2038
+ var obj_carePlanTasks = obj.carePlanTasks;
2039
+ var path_carePlanTasks = path + '.carePlanTasks';
2040
+ var referencepath_carePlanTasksValidationError = validate$w(obj_carePlanTasks, path_carePlanTasks);
2041
+ if (referencepath_carePlanTasksValidationError !== null) {
2042
+ var message = 'Object doesn\'t match CarePlanTasksRepresentation (at "' + path_carePlanTasks + '")\n';
2043
+ message += referencepath_carePlanTasksValidationError.message.split('\n').map(function (line) { return '\t' + line; }).join('\n');
2044
+ return new TypeError(message);
2045
+ }
2046
+ }
2047
+ if (obj.carePlanTemplateId !== undefined) {
2048
+ var obj_carePlanTemplateId = obj.carePlanTemplateId;
2049
+ var path_carePlanTemplateId = path + '.carePlanTemplateId';
2050
+ if (typeof obj_carePlanTemplateId !== 'string') {
2051
+ return new TypeError('Expected "string" but received "' + typeof obj_carePlanTemplateId + '" (at "' + path_carePlanTemplateId + '")');
2052
+ }
2053
+ }
2054
+ if (obj.carePlanTemplateName !== undefined) {
2055
+ var obj_carePlanTemplateName = obj.carePlanTemplateName;
2056
+ var path_carePlanTemplateName = path + '.carePlanTemplateName';
2057
+ if (typeof obj_carePlanTemplateName !== 'string') {
2058
+ return new TypeError('Expected "string" but received "' + typeof obj_carePlanTemplateName + '" (at "' + path_carePlanTemplateName + '")');
2059
+ }
2060
+ }
2061
+ var obj_caseId = obj.caseId;
2062
+ var path_caseId = path + '.caseId';
2063
+ if (typeof obj_caseId !== 'string') {
2064
+ return new TypeError('Expected "string" but received "' + typeof obj_caseId + '" (at "' + path_caseId + '")');
2065
+ }
2066
+ if (obj.customFields !== undefined) {
2067
+ var obj_customFields = obj.customFields;
2068
+ var path_customFields = path + '.customFields';
2069
+ var referencepath_customFieldsValidationError = validate$u(obj_customFields, path_customFields);
2070
+ if (referencepath_customFieldsValidationError !== null) {
2071
+ var message = 'Object doesn\'t match CustomFieldListRepresentation (at "' + path_customFields + '")\n';
2072
+ message += referencepath_customFieldsValidationError.message.split('\n').map(function (line) { return '\t' + line; }).join('\n');
2073
+ return new TypeError(message);
2074
+ }
2075
+ }
2076
+ if (obj.description !== undefined) {
2077
+ var obj_description = obj.description;
2078
+ var path_description = path + '.description';
2079
+ if (typeof obj_description !== 'string') {
2080
+ return new TypeError('Expected "string" but received "' + typeof obj_description + '" (at "' + path_description + '")');
2081
+ }
2082
+ }
2083
+ if (obj.endDate !== undefined) {
2084
+ var obj_endDate = obj.endDate;
2085
+ var path_endDate = path + '.endDate';
2086
+ if (typeof obj_endDate !== 'string') {
2087
+ return new TypeError('Expected "string" but received "' + typeof obj_endDate + '" (at "' + path_endDate + '")');
2088
+ }
2089
+ }
2090
+ if (obj.goalAssignments !== undefined) {
2091
+ var obj_goalAssignments = obj.goalAssignments;
2092
+ var path_goalAssignments = path + '.goalAssignments';
2093
+ var referencepath_goalAssignmentsValidationError = validate$q(obj_goalAssignments, path_goalAssignments);
2094
+ if (referencepath_goalAssignmentsValidationError !== null) {
2095
+ var message = 'Object doesn\'t match GoalAssignmentListRepresentation (at "' + path_goalAssignments + '")\n';
2096
+ message += referencepath_goalAssignmentsValidationError.message.split('\n').map(function (line) { return '\t' + line; }).join('\n');
2097
+ return new TypeError(message);
2098
+ }
2099
+ }
2100
+ var obj_id = obj.id;
2101
+ var path_id = path + '.id';
2102
+ if (typeof obj_id !== 'string') {
2103
+ return new TypeError('Expected "string" but received "' + typeof obj_id + '" (at "' + path_id + '")');
2104
+ }
2105
+ if (obj.medicationTherapyReview !== undefined) {
2106
+ var obj_medicationTherapyReview = obj.medicationTherapyReview;
2107
+ var path_medicationTherapyReview = path + '.medicationTherapyReview';
2108
+ if (typeof obj_medicationTherapyReview !== 'string') {
2109
+ return new TypeError('Expected "string" but received "' + typeof obj_medicationTherapyReview + '" (at "' + path_medicationTherapyReview + '")');
2110
+ }
2111
+ }
2112
+ var obj_name = obj.name;
2113
+ var path_name = path + '.name';
2114
+ if (typeof obj_name !== 'string') {
2115
+ return new TypeError('Expected "string" but received "' + typeof obj_name + '" (at "' + path_name + '")');
2116
+ }
2117
+ var obj_participantId = obj.participantId;
2118
+ var path_participantId = path + '.participantId';
2119
+ if (typeof obj_participantId !== 'string') {
2120
+ return new TypeError('Expected "string" but received "' + typeof obj_participantId + '" (at "' + path_participantId + '")');
2121
+ }
2122
+ if (obj.participantName !== undefined) {
2123
+ var obj_participantName = obj.participantName;
2124
+ var path_participantName = path + '.participantName';
2125
+ if (typeof obj_participantName !== 'string') {
2126
+ return new TypeError('Expected "string" but received "' + typeof obj_participantName + '" (at "' + path_participantName + '")');
2127
+ }
2128
+ }
2129
+ if (obj.startDate !== undefined) {
2130
+ var obj_startDate = obj.startDate;
2131
+ var path_startDate = path + '.startDate';
2132
+ if (typeof obj_startDate !== 'string') {
2133
+ return new TypeError('Expected "string" but received "' + typeof obj_startDate + '" (at "' + path_startDate + '")');
2134
+ }
2135
+ }
2136
+ var obj_status = obj.status;
2137
+ var path_status = path + '.status';
2138
+ if (typeof obj_status !== 'string') {
2139
+ return new TypeError('Expected "string" but received "' + typeof obj_status + '" (at "' + path_status + '")');
2140
+ }
2141
+ if (obj.taskJobStatus !== undefined) {
2142
+ var obj_taskJobStatus = obj.taskJobStatus;
2143
+ var path_taskJobStatus = path + '.taskJobStatus';
2144
+ if (typeof obj_taskJobStatus !== 'string') {
2145
+ return new TypeError('Expected "string" but received "' + typeof obj_taskJobStatus + '" (at "' + path_taskJobStatus + '")');
2146
+ }
2147
+ }
2148
+ if (obj.taskJobStatusReason !== undefined) {
2149
+ var obj_taskJobStatusReason = obj.taskJobStatusReason;
2150
+ var path_taskJobStatusReason = path + '.taskJobStatusReason';
2151
+ if (typeof obj_taskJobStatusReason !== 'string') {
2152
+ return new TypeError('Expected "string" but received "' + typeof obj_taskJobStatusReason + '" (at "' + path_taskJobStatusReason + '")');
2153
+ }
2154
+ }
2155
+ })();
2156
+ return v_error === undefined ? null : v_error;
2157
+ }
2158
+ var RepresentationType$3 = 'CarePlanRepresentation';
2159
+ function keyBuilder$a(luvio, config) {
2160
+ return keyPrefix + '::' + RepresentationType$3 + ':' + config.id;
2161
+ }
2162
+ function keyBuilderFromType$2(luvio, object) {
2163
+ var keyParams = {
2164
+ id: object.id
2165
+ };
2166
+ return keyBuilder$a(luvio, keyParams);
2167
+ }
2168
+ function normalize$3(input, existing, path, luvio, store, timestamp) {
2169
+ return input;
2170
+ }
2171
+ var select$b = function CarePlanRepresentationSelect() {
2172
+ return {
2173
+ kind: 'Fragment',
2174
+ version: VERSION$3,
2175
+ private: [],
2176
+ opaque: true
2177
+ };
2178
+ };
2179
+ function equals$3(existing, incoming) {
2180
+ if (JSONStringify(incoming) !== JSONStringify(existing)) {
2181
+ return false;
2182
+ }
2183
+ return true;
2184
+ }
2185
+ function deepFreeze$f(input) {
2186
+ var input_benefitAssignments = input.benefitAssignments;
2187
+ if (input_benefitAssignments !== undefined) {
2188
+ deepFreeze$i(input_benefitAssignments);
2189
+ }
2190
+ var input_carePlanTasks = input.carePlanTasks;
2191
+ if (input_carePlanTasks !== undefined) {
2192
+ deepFreeze$m(input_carePlanTasks);
2193
+ }
2194
+ var input_customFields = input.customFields;
2195
+ if (input_customFields !== undefined) {
2196
+ deepFreeze$k(input_customFields);
2197
+ }
2198
+ var input_goalAssignments = input.goalAssignments;
2199
+ if (input_goalAssignments !== undefined) {
2200
+ deepFreeze$g(input_goalAssignments);
2201
+ }
2202
+ ObjectFreeze(input);
2203
+ }
2204
+ var ingest$3 = function CarePlanRepresentationIngest(input, path, luvio, store, timestamp) {
2205
+ if (process.env.NODE_ENV !== 'production') {
2206
+ var validateError = validate$p(input);
2207
+ if (validateError !== null) {
2208
+ throw validateError;
2209
+ }
2210
+ }
2211
+ var key = keyBuilderFromType$2(luvio, input);
2212
+ var existingRecord = store.readEntry(key);
2213
+ var ttlToUse = TTL$3;
2214
+ var incomingRecord = normalize$3(input, store.readEntry(key), {
2215
+ fullPath: key,
2216
+ parent: path.parent,
2217
+ propertyName: path.propertyName,
2218
+ ttl: ttlToUse
2219
+ });
2220
+ deepFreeze$f(input);
2221
+ if (existingRecord === undefined || equals$3(existingRecord, incomingRecord) === false) {
2222
+ luvio.storePublish(key, incomingRecord);
2223
+ }
2224
+ {
2225
+ var storeMetadataParams = {
2226
+ ttl: ttlToUse,
2227
+ namespace: "public-sector",
2228
+ version: VERSION$3,
2229
+ representationName: RepresentationType$3,
2230
+ };
2231
+ luvio.publishStoreMetadata(key, storeMetadataParams);
2232
+ }
2233
+ return createLink(key);
2234
+ };
2235
+ function getTypeCacheKeys$3(luvio, input, fullPathFactory) {
2236
+ var rootKeySet = new engine.StoreKeyMap();
2237
+ // root cache key (uses fullPathFactory if keyBuilderFromType isn't defined)
2238
+ var rootKey = keyBuilderFromType$2(luvio, input);
2239
+ rootKeySet.set(rootKey, {
2240
+ namespace: keyPrefix,
2241
+ representationName: RepresentationType$3,
2242
+ mergeable: false
2243
+ });
2244
+ return rootKeySet;
2245
+ }
2246
+ var notifyUpdateAvailableFactory$1 = function (luvio) {
2247
+ return function notifyCarePlanUpdateAvailable(configs) {
2248
+ if (process.env.NODE_ENV !== 'production') {
2249
+ var requiredKeyParams_1 = ['id'];
2250
+ configs.forEach(function (config) {
2251
+ if (false === requiredKeyParams_1.every(function (req) { return req in config; })) {
2252
+ throw new Error("one of the configs did not contain all required parameters: ".concat(JSONStringify(ObjectKeys(config))));
2253
+ }
2254
+ });
2255
+ }
2256
+ var keys = configs.map(function (c) { return keyBuilder$a(luvio, c); });
2257
+ return luvio.notifyStoreUpdateAvailable(keys);
2258
+ };
2259
+ };
2260
+
2261
+ function select$a(luvio, params) {
2262
+ return select$b();
2263
+ }
2264
+ function keyBuilder$9(luvio, params) {
2265
+ return keyBuilder$a(luvio, {
2266
+ id: params.urlParams.carePlanId
2267
+ });
2268
+ }
2269
+ function getResponseCacheKeys$7(luvio, resourceParams, response) {
2270
+ return getTypeCacheKeys$3(luvio, response);
2271
+ }
2272
+ function ingestSuccess$7(luvio, resourceParams, response, snapshotRefresh) {
2273
+ var body = response.body;
2274
+ var key = keyBuilder$9(luvio, resourceParams);
2275
+ luvio.storeIngest(key, ingest$3, body);
2276
+ var snapshot = luvio.storeLookup({
2277
+ recordId: key,
2278
+ node: select$a(),
2279
+ variables: {},
2280
+ }, snapshotRefresh);
2281
+ if (process.env.NODE_ENV !== 'production') {
2282
+ if (snapshot.state !== 'Fulfilled') {
2283
+ throw new Error('Invalid network response. Expected resource response to result in Fulfilled snapshot');
2284
+ }
2285
+ }
2286
+ return snapshot;
2287
+ }
2288
+ function ingestError$3(luvio, params, error, snapshotRefresh) {
2289
+ var key = keyBuilder$9(luvio, params);
2290
+ var errorSnapshot = luvio.errorSnapshot(error, snapshotRefresh);
2291
+ var storeMetadataParams = {
2292
+ ttl: TTL$3,
2293
+ namespace: keyPrefix,
2294
+ version: VERSION$3,
2295
+ representationName: RepresentationType$3
2296
+ };
2297
+ luvio.storeIngestError(key, errorSnapshot, storeMetadataParams);
2298
+ return errorSnapshot;
2299
+ }
2300
+ function createResourceRequest$7(config) {
2301
+ var headers = {};
2302
+ return {
2303
+ baseUri: '/services/data/v58.0',
2304
+ basePath: '/connect/careplan/care-plans/' + config.urlParams.carePlanId + '',
2305
+ method: 'get',
2306
+ body: null,
2307
+ urlParams: config.urlParams,
2308
+ queryParams: {},
2309
+ headers: headers,
2310
+ priority: 'normal',
2311
+ };
2312
+ }
2313
+
2314
+ var getCarePlanDetails_ConfigPropertyNames = {
2315
+ displayName: 'getCarePlanDetails',
2316
+ parameters: {
2317
+ required: ['carePlanId'],
2318
+ optional: []
2319
+ }
2320
+ };
2321
+ function createResourceParams$7(config) {
2322
+ var resourceParams = {
2323
+ urlParams: {
2324
+ carePlanId: config.carePlanId
2325
+ }
2326
+ };
2327
+ return resourceParams;
2328
+ }
2329
+ function keyBuilder$8(luvio, config) {
2330
+ var resourceParams = createResourceParams$7(config);
2331
+ return keyBuilder$9(luvio, resourceParams);
2332
+ }
2333
+ function typeCheckConfig$7(untrustedConfig) {
2334
+ var config = {};
2335
+ var untrustedConfig_carePlanId = untrustedConfig.carePlanId;
2336
+ if (typeof untrustedConfig_carePlanId === 'string') {
2337
+ config.carePlanId = untrustedConfig_carePlanId;
2338
+ }
2339
+ return config;
2340
+ }
2341
+ function validateAdapterConfig$7(untrustedConfig, configPropertyNames) {
2342
+ if (!untrustedIsObject(untrustedConfig)) {
2343
+ return null;
2344
+ }
2345
+ if (process.env.NODE_ENV !== 'production') {
2346
+ validateConfig(untrustedConfig, configPropertyNames);
2347
+ }
2348
+ var config = typeCheckConfig$7(untrustedConfig);
2349
+ if (!areRequiredParametersPresent(config, configPropertyNames)) {
2350
+ return null;
2351
+ }
2352
+ return config;
2353
+ }
2354
+ function adapterFragment$3(luvio, config) {
2355
+ createResourceParams$7(config);
2356
+ return select$a();
2357
+ }
2358
+ function onFetchResponseSuccess$3(luvio, config, resourceParams, response) {
2359
+ var snapshot = ingestSuccess$7(luvio, resourceParams, response, {
2360
+ config: config,
2361
+ resolve: function () { return buildNetworkSnapshot$7(luvio, config, snapshotRefreshOptions); }
2362
+ });
2363
+ return luvio.storeBroadcast().then(function () { return snapshot; });
2364
+ }
2365
+ function onFetchResponseError$3(luvio, config, resourceParams, response) {
2366
+ var snapshot = ingestError$3(luvio, resourceParams, response, {
2367
+ config: config,
2368
+ resolve: function () { return buildNetworkSnapshot$7(luvio, config, snapshotRefreshOptions); }
2369
+ });
2370
+ return luvio.storeBroadcast().then(function () { return snapshot; });
2371
+ }
2372
+ function buildNetworkSnapshot$7(luvio, config, options) {
2373
+ var resourceParams = createResourceParams$7(config);
2374
+ var request = createResourceRequest$7(resourceParams);
2375
+ return luvio.dispatchResourceRequest(request, options)
2376
+ .then(function (response) {
2377
+ return luvio.handleSuccessResponse(function () { return onFetchResponseSuccess$3(luvio, config, resourceParams, response); }, function () { return getResponseCacheKeys$7(luvio, resourceParams, response.body); });
2378
+ }, function (response) {
2379
+ return luvio.handleErrorResponse(function () { return onFetchResponseError$3(luvio, config, resourceParams, response); });
2380
+ });
2381
+ }
2382
+ function buildNetworkSnapshotCachePolicy$3(context, coercedAdapterRequestContext) {
2383
+ var luvio = context.luvio, config = context.config;
2384
+ var networkPriority = coercedAdapterRequestContext.networkPriority, requestCorrelator = coercedAdapterRequestContext.requestCorrelator, eventObservers = coercedAdapterRequestContext.eventObservers;
2385
+ var dispatchOptions = {
2386
+ resourceRequestContext: {
2387
+ requestCorrelator: requestCorrelator,
2388
+ luvioRequestMethod: undefined,
2389
+ },
2390
+ eventObservers: eventObservers
2391
+ };
2392
+ if (networkPriority !== 'normal') {
2393
+ dispatchOptions.overrides = {
2394
+ priority: networkPriority
2395
+ };
2396
+ }
2397
+ return buildNetworkSnapshot$7(luvio, config, dispatchOptions);
2398
+ }
2399
+ function buildCachedSnapshotCachePolicy$3(context, storeLookup) {
2400
+ var luvio = context.luvio, config = context.config;
2401
+ var selector = {
2402
+ recordId: keyBuilder$8(luvio, config),
2403
+ node: adapterFragment$3(luvio, config),
2404
+ variables: {},
2405
+ };
2406
+ var cacheSnapshot = storeLookup(selector, {
2407
+ config: config,
2408
+ resolve: function () { return buildNetworkSnapshot$7(luvio, config, snapshotRefreshOptions); }
2409
+ });
2410
+ return cacheSnapshot;
2411
+ }
2412
+ var getCarePlanDetailsAdapterFactory = function (luvio) { return function publicSector__getCarePlanDetails(untrustedConfig, requestContext) {
2413
+ var config = validateAdapterConfig$7(untrustedConfig, getCarePlanDetails_ConfigPropertyNames);
2414
+ // Invalid or incomplete config
2415
+ if (config === null) {
2416
+ return null;
2417
+ }
2418
+ return luvio.applyCachePolicy((requestContext || {}), { config: config, luvio: luvio }, // BuildSnapshotContext
2419
+ buildCachedSnapshotCachePolicy$3, buildNetworkSnapshotCachePolicy$3);
2420
+ }; };
2421
+
2422
+ function select$9(luvio, params) {
2423
+ return select$g();
2424
+ }
2425
+ function getResponseCacheKeys$6(luvio, resourceParams, response) {
2426
+ return getTypeCacheKeys$5(luvio, response);
2427
+ }
2428
+ function ingestSuccess$6(luvio, resourceParams, response) {
2429
+ var body = response.body;
2430
+ var key = keyBuilderFromType$3(luvio, body);
2431
+ luvio.storeIngest(key, ingest$5, body);
2432
+ var snapshot = luvio.storeLookup({
2433
+ recordId: key,
2434
+ node: select$9(),
2435
+ variables: {},
2436
+ });
2437
+ if (process.env.NODE_ENV !== 'production') {
2438
+ if (snapshot.state !== 'Fulfilled') {
2439
+ throw new Error('Invalid network response. Expected resource response to result in Fulfilled snapshot');
2440
+ }
2441
+ }
2442
+ return snapshot;
2443
+ }
2444
+ function createResourceRequest$6(config) {
2445
+ var headers = {};
2446
+ return {
2447
+ baseUri: '/services/data/v58.0',
2448
+ basePath: '/connect/careplan/care-plans/' + config.urlParams.carePlanId + '',
2449
+ method: 'patch',
2450
+ body: config.body,
2451
+ urlParams: config.urlParams,
2452
+ queryParams: {},
2453
+ headers: headers,
2454
+ priority: 'normal',
2455
+ };
2456
+ }
2457
+
2458
+ var updateCarePlanDetails_ConfigPropertyNames = {
2459
+ displayName: 'updateCarePlanDetails',
2460
+ parameters: {
2461
+ required: ['carePlanId', 'carePlanRecord'],
2462
+ optional: []
2463
+ }
2464
+ };
2465
+ function createResourceParams$6(config) {
2466
+ var resourceParams = {
2467
+ urlParams: {
2468
+ carePlanId: config.carePlanId
2469
+ },
2470
+ body: {
2471
+ carePlanRecord: config.carePlanRecord
2472
+ }
2473
+ };
2474
+ return resourceParams;
2475
+ }
2476
+ function typeCheckConfig$6(untrustedConfig) {
2477
+ var config = {};
2478
+ var untrustedConfig_carePlanId = untrustedConfig.carePlanId;
2479
+ if (typeof untrustedConfig_carePlanId === 'string') {
2480
+ config.carePlanId = untrustedConfig_carePlanId;
2481
+ }
2482
+ var untrustedConfig_carePlanRecord = untrustedConfig.carePlanRecord;
2483
+ var referenceCarePlanInputRepresentationValidationError = validate$z(untrustedConfig_carePlanRecord);
2484
+ if (referenceCarePlanInputRepresentationValidationError === null) {
2485
+ config.carePlanRecord = untrustedConfig_carePlanRecord;
2486
+ }
2487
+ return config;
2488
+ }
2489
+ function validateAdapterConfig$6(untrustedConfig, configPropertyNames) {
2490
+ if (!untrustedIsObject(untrustedConfig)) {
2491
+ return null;
2492
+ }
2493
+ if (process.env.NODE_ENV !== 'production') {
2494
+ validateConfig(untrustedConfig, configPropertyNames);
2495
+ }
2496
+ var config = typeCheckConfig$6(untrustedConfig);
2497
+ if (!areRequiredParametersPresent(config, configPropertyNames)) {
2498
+ return null;
2499
+ }
2500
+ return config;
2501
+ }
2502
+ function buildNetworkSnapshot$6(luvio, config, options) {
2503
+ var resourceParams = createResourceParams$6(config);
2504
+ var request = createResourceRequest$6(resourceParams);
2505
+ return luvio.dispatchResourceRequest(request, options)
2506
+ .then(function (response) {
2507
+ return luvio.handleSuccessResponse(function () {
2508
+ var snapshot = ingestSuccess$6(luvio, resourceParams, response);
2509
+ return luvio.storeBroadcast().then(function () { return snapshot; });
2510
+ }, function () { return getResponseCacheKeys$6(luvio, resourceParams, response.body); });
2511
+ }, function (response) {
2512
+ deepFreeze$v(response);
2513
+ throw response;
2514
+ });
2515
+ }
2516
+ var updateCarePlanDetailsAdapterFactory = function (luvio) {
2517
+ return function updateCarePlanDetails(untrustedConfig) {
2518
+ var config = validateAdapterConfig$6(untrustedConfig, updateCarePlanDetails_ConfigPropertyNames);
2519
+ // Invalid or incomplete config
2520
+ if (config === null) {
2521
+ throw new Error('Invalid config for "updateCarePlanDetails"');
2522
+ }
2523
+ return buildNetworkSnapshot$6(luvio, config);
2524
+ };
2525
+ };
2526
+
2527
+ var TTL$2 = 1000;
2528
+ var VERSION$2 = "e080b5a7d64773ce3f2394c99e154024";
2529
+ function validate$o(obj, path) {
2530
+ if (path === void 0) { path = 'CarePlanTasksMapRepresentation'; }
2531
+ var v_error = (function () {
2532
+ if (typeof obj !== 'object' || ArrayIsArray(obj) || obj === null) {
2533
+ return new TypeError('Expected "object" but received "' + typeof obj + '" (at "' + path + '")');
2534
+ }
2535
+ var obj_parentEntityTasks = obj.parentEntityTasks;
2536
+ var path_parentEntityTasks = path + '.parentEntityTasks';
2537
+ if (typeof obj_parentEntityTasks !== 'object' || ArrayIsArray(obj_parentEntityTasks) || obj_parentEntityTasks === null) {
2538
+ return new TypeError('Expected "object" but received "' + typeof obj_parentEntityTasks + '" (at "' + path_parentEntityTasks + '")');
2539
+ }
2540
+ var obj_parentEntityTasks_keys = ObjectKeys(obj_parentEntityTasks);
2541
+ for (var i = 0; i < obj_parentEntityTasks_keys.length; i++) {
2542
+ var key = obj_parentEntityTasks_keys[i];
2543
+ var obj_parentEntityTasks_prop = obj_parentEntityTasks[key];
2544
+ var path_parentEntityTasks_prop = path_parentEntityTasks + '["' + key + '"]';
2545
+ var referencepath_parentEntityTasks_propValidationError = validate$w(obj_parentEntityTasks_prop, path_parentEntityTasks_prop);
2546
+ if (referencepath_parentEntityTasks_propValidationError !== null) {
2547
+ var message = 'Object doesn\'t match CarePlanTasksRepresentation (at "' + path_parentEntityTasks_prop + '")\n';
2548
+ message += referencepath_parentEntityTasks_propValidationError.message.split('\n').map(function (line) { return '\t' + line; }).join('\n');
2549
+ return new TypeError(message);
2550
+ }
2551
+ }
2552
+ })();
2553
+ return v_error === undefined ? null : v_error;
2554
+ }
2555
+ var RepresentationType$2 = 'CarePlanTasksMapRepresentation';
2556
+ function normalize$2(input, existing, path, luvio, store, timestamp) {
2557
+ return input;
2558
+ }
2559
+ var select$8 = function CarePlanTasksMapRepresentationSelect() {
2560
+ return {
2561
+ kind: 'Fragment',
2562
+ version: VERSION$2,
2563
+ private: [],
2564
+ opaque: true
2565
+ };
2566
+ };
2567
+ function equals$2(existing, incoming) {
2568
+ if (JSONStringify(incoming) !== JSONStringify(existing)) {
2569
+ return false;
2570
+ }
2571
+ return true;
2572
+ }
2573
+ function deepFreeze$e(input) {
2574
+ var input_parentEntityTasks = input.parentEntityTasks;
2575
+ var input_parentEntityTasks_keys = Object.keys(input_parentEntityTasks);
2576
+ var input_parentEntityTasks_length = input_parentEntityTasks_keys.length;
2577
+ for (var i = 0; i < input_parentEntityTasks_length; i++) {
2578
+ var key = input_parentEntityTasks_keys[i];
2579
+ var input_parentEntityTasks_prop = input_parentEntityTasks[key];
2580
+ deepFreeze$m(input_parentEntityTasks_prop);
2581
+ }
2582
+ ObjectFreeze(input_parentEntityTasks);
2583
+ ObjectFreeze(input);
2584
+ }
2585
+ var ingest$2 = function CarePlanTasksMapRepresentationIngest(input, path, luvio, store, timestamp) {
2586
+ if (process.env.NODE_ENV !== 'production') {
2587
+ var validateError = validate$o(input);
2588
+ if (validateError !== null) {
2589
+ throw validateError;
2590
+ }
2591
+ }
2592
+ var key = path.fullPath;
2593
+ var existingRecord = store.readEntry(key);
2594
+ var ttlToUse = TTL$2;
2595
+ var incomingRecord = normalize$2(input, store.readEntry(key), {
2596
+ fullPath: key,
2597
+ parent: path.parent,
2598
+ propertyName: path.propertyName,
2599
+ ttl: ttlToUse
2600
+ });
2601
+ deepFreeze$e(input);
2602
+ if (existingRecord === undefined || equals$2(existingRecord, incomingRecord) === false) {
2603
+ luvio.storePublish(key, incomingRecord);
2604
+ }
2605
+ {
2606
+ var storeMetadataParams = {
2607
+ ttl: ttlToUse,
2608
+ namespace: "public-sector",
2609
+ version: VERSION$2,
2610
+ representationName: RepresentationType$2,
2611
+ };
2612
+ luvio.publishStoreMetadata(key, storeMetadataParams);
2613
+ }
2614
+ return createLink(key);
2615
+ };
2616
+ function getTypeCacheKeys$2(luvio, input, fullPathFactory) {
2617
+ var rootKeySet = new engine.StoreKeyMap();
2618
+ // root cache key (uses fullPathFactory if keyBuilderFromType isn't defined)
2619
+ var rootKey = fullPathFactory();
2620
+ rootKeySet.set(rootKey, {
2621
+ namespace: keyPrefix,
2622
+ representationName: RepresentationType$2,
2623
+ mergeable: false
2624
+ });
2625
+ return rootKeySet;
2626
+ }
2627
+
2628
+ function select$7(luvio, params) {
2629
+ return select$8();
2630
+ }
2631
+ function keyBuilder$7(luvio, params) {
2632
+ return keyPrefix + '::CarePlanTasksMapRepresentation:(' + 'pageOffset:' + params.queryParams.pageOffset + ',' + 'carePlanId:' + params.urlParams.carePlanId + ')';
2633
+ }
2634
+ function getResponseCacheKeys$5(luvio, resourceParams, response) {
2635
+ return getTypeCacheKeys$2(luvio, response, function () { return keyBuilder$7(luvio, resourceParams); });
2636
+ }
2637
+ function ingestSuccess$5(luvio, resourceParams, response, snapshotRefresh) {
2638
+ var body = response.body;
2639
+ var key = keyBuilder$7(luvio, resourceParams);
2640
+ luvio.storeIngest(key, ingest$2, body);
2641
+ var snapshot = luvio.storeLookup({
2642
+ recordId: key,
2643
+ node: select$7(),
2644
+ variables: {},
2645
+ }, snapshotRefresh);
2646
+ if (process.env.NODE_ENV !== 'production') {
2647
+ if (snapshot.state !== 'Fulfilled') {
2648
+ throw new Error('Invalid network response. Expected resource response to result in Fulfilled snapshot');
2649
+ }
2650
+ }
2651
+ return snapshot;
2652
+ }
2653
+ function ingestError$2(luvio, params, error, snapshotRefresh) {
2654
+ var key = keyBuilder$7(luvio, params);
2655
+ var errorSnapshot = luvio.errorSnapshot(error, snapshotRefresh);
2656
+ var storeMetadataParams = {
2657
+ ttl: TTL$2,
2658
+ namespace: keyPrefix,
2659
+ version: VERSION$2,
2660
+ representationName: RepresentationType$2
2661
+ };
2662
+ luvio.storeIngestError(key, errorSnapshot, storeMetadataParams);
2663
+ return errorSnapshot;
2664
+ }
2665
+ function createResourceRequest$5(config) {
2666
+ var headers = {};
2667
+ return {
2668
+ baseUri: '/services/data/v58.0',
2669
+ basePath: '/connect/careplan/care-plans/' + config.urlParams.carePlanId + '/tasks',
2670
+ method: 'get',
2671
+ body: null,
2672
+ urlParams: config.urlParams,
2673
+ queryParams: config.queryParams,
2674
+ headers: headers,
2675
+ priority: 'normal',
2676
+ };
2677
+ }
2678
+
2679
+ var getCarePlanTasks_ConfigPropertyNames = {
2680
+ displayName: 'getCarePlanTasks',
2681
+ parameters: {
2682
+ required: ['carePlanId'],
2683
+ optional: ['pageOffset']
2684
+ }
2685
+ };
2686
+ function createResourceParams$5(config) {
2687
+ var resourceParams = {
2688
+ urlParams: {
2689
+ carePlanId: config.carePlanId
2690
+ },
2691
+ queryParams: {
2692
+ pageOffset: config.pageOffset
2693
+ }
2694
+ };
2695
+ return resourceParams;
2696
+ }
2697
+ function keyBuilder$6(luvio, config) {
2698
+ var resourceParams = createResourceParams$5(config);
2699
+ return keyBuilder$7(luvio, resourceParams);
2700
+ }
2701
+ function typeCheckConfig$5(untrustedConfig) {
2702
+ var config = {};
2703
+ var untrustedConfig_carePlanId = untrustedConfig.carePlanId;
2704
+ if (typeof untrustedConfig_carePlanId === 'string') {
2705
+ config.carePlanId = untrustedConfig_carePlanId;
2706
+ }
2707
+ var untrustedConfig_pageOffset = untrustedConfig.pageOffset;
2708
+ if (typeof untrustedConfig_pageOffset === 'number' && Math.floor(untrustedConfig_pageOffset) === untrustedConfig_pageOffset) {
2709
+ config.pageOffset = untrustedConfig_pageOffset;
2710
+ }
2711
+ return config;
2712
+ }
2713
+ function validateAdapterConfig$5(untrustedConfig, configPropertyNames) {
2714
+ if (!untrustedIsObject(untrustedConfig)) {
2715
+ return null;
2716
+ }
2717
+ if (process.env.NODE_ENV !== 'production') {
2718
+ validateConfig(untrustedConfig, configPropertyNames);
2719
+ }
2720
+ var config = typeCheckConfig$5(untrustedConfig);
2721
+ if (!areRequiredParametersPresent(config, configPropertyNames)) {
2722
+ return null;
2723
+ }
2724
+ return config;
2725
+ }
2726
+ function adapterFragment$2(luvio, config) {
2727
+ createResourceParams$5(config);
2728
+ return select$7();
2729
+ }
2730
+ function onFetchResponseSuccess$2(luvio, config, resourceParams, response) {
2731
+ var snapshot = ingestSuccess$5(luvio, resourceParams, response, {
2732
+ config: config,
2733
+ resolve: function () { return buildNetworkSnapshot$5(luvio, config, snapshotRefreshOptions); }
2734
+ });
2735
+ return luvio.storeBroadcast().then(function () { return snapshot; });
2736
+ }
2737
+ function onFetchResponseError$2(luvio, config, resourceParams, response) {
2738
+ var snapshot = ingestError$2(luvio, resourceParams, response, {
2739
+ config: config,
2740
+ resolve: function () { return buildNetworkSnapshot$5(luvio, config, snapshotRefreshOptions); }
2741
+ });
2742
+ return luvio.storeBroadcast().then(function () { return snapshot; });
2743
+ }
2744
+ function buildNetworkSnapshot$5(luvio, config, options) {
2745
+ var resourceParams = createResourceParams$5(config);
2746
+ var request = createResourceRequest$5(resourceParams);
2747
+ return luvio.dispatchResourceRequest(request, options)
2748
+ .then(function (response) {
2749
+ return luvio.handleSuccessResponse(function () { return onFetchResponseSuccess$2(luvio, config, resourceParams, response); }, function () { return getResponseCacheKeys$5(luvio, resourceParams, response.body); });
2750
+ }, function (response) {
2751
+ return luvio.handleErrorResponse(function () { return onFetchResponseError$2(luvio, config, resourceParams, response); });
2752
+ });
2753
+ }
2754
+ function buildNetworkSnapshotCachePolicy$2(context, coercedAdapterRequestContext) {
2755
+ var luvio = context.luvio, config = context.config;
2756
+ var networkPriority = coercedAdapterRequestContext.networkPriority, requestCorrelator = coercedAdapterRequestContext.requestCorrelator, eventObservers = coercedAdapterRequestContext.eventObservers;
2757
+ var dispatchOptions = {
2758
+ resourceRequestContext: {
2759
+ requestCorrelator: requestCorrelator,
2760
+ luvioRequestMethod: undefined,
2761
+ },
2762
+ eventObservers: eventObservers
2763
+ };
2764
+ if (networkPriority !== 'normal') {
2765
+ dispatchOptions.overrides = {
2766
+ priority: networkPriority
2767
+ };
2768
+ }
2769
+ return buildNetworkSnapshot$5(luvio, config, dispatchOptions);
2770
+ }
2771
+ function buildCachedSnapshotCachePolicy$2(context, storeLookup) {
2772
+ var luvio = context.luvio, config = context.config;
2773
+ var selector = {
2774
+ recordId: keyBuilder$6(luvio, config),
2775
+ node: adapterFragment$2(luvio, config),
2776
+ variables: {},
2777
+ };
2778
+ var cacheSnapshot = storeLookup(selector, {
2779
+ config: config,
2780
+ resolve: function () { return buildNetworkSnapshot$5(luvio, config, snapshotRefreshOptions); }
2781
+ });
2782
+ return cacheSnapshot;
2783
+ }
2784
+ var getCarePlanTasksAdapterFactory = function (luvio) { return function publicSector__getCarePlanTasks(untrustedConfig, requestContext) {
2785
+ var config = validateAdapterConfig$5(untrustedConfig, getCarePlanTasks_ConfigPropertyNames);
2786
+ // Invalid or incomplete config
2787
+ if (config === null) {
2788
+ return null;
2789
+ }
2790
+ return luvio.applyCachePolicy((requestContext || {}), { config: config, luvio: luvio }, // BuildSnapshotContext
2791
+ buildCachedSnapshotCachePolicy$2, buildNetworkSnapshotCachePolicy$2);
2792
+ }; };
2793
+
2794
+ function validate$n(obj, path) {
2795
+ if (path === void 0) { path = 'AdhocCarePlanTaskListInputRepresentation'; }
2796
+ var v_error = (function () {
2797
+ if (typeof obj !== 'object' || ArrayIsArray(obj) || obj === null) {
2798
+ return new TypeError('Expected "object" but received "' + typeof obj + '" (at "' + path + '")');
2799
+ }
2800
+ var obj_records = obj.records;
2801
+ var path_records = path + '.records';
2802
+ if (!ArrayIsArray(obj_records)) {
2803
+ return new TypeError('Expected "array" but received "' + typeof obj_records + '" (at "' + path_records + '")');
2804
+ }
2805
+ for (var i = 0; i < obj_records.length; i++) {
2806
+ var obj_records_item = obj_records[i];
2807
+ var path_records_item = path_records + '[' + i + ']';
2808
+ var referencepath_records_itemValidationError = validate$G(obj_records_item, path_records_item);
2809
+ if (referencepath_records_itemValidationError !== null) {
2810
+ var message = 'Object doesn\'t match CarePlanTaskInputRepresentation (at "' + path_records_item + '")\n';
2811
+ message += referencepath_records_itemValidationError.message.split('\n').map(function (line) { return '\t' + line; }).join('\n');
2812
+ return new TypeError(message);
2813
+ }
2814
+ }
2815
+ })();
2816
+ return v_error === undefined ? null : v_error;
2817
+ }
2818
+
2819
+ function validate$m(obj, path) {
2820
+ if (path === void 0) { path = 'ExcludedCarePlanTaskInputRepresentation'; }
2821
+ var v_error = (function () {
2822
+ if (typeof obj !== 'object' || ArrayIsArray(obj) || obj === null) {
2823
+ return new TypeError('Expected "object" but received "' + typeof obj + '" (at "' + path + '")');
2824
+ }
2825
+ var obj_tasks = obj.tasks;
2826
+ var path_tasks = path + '.tasks';
2827
+ if (!ArrayIsArray(obj_tasks)) {
2828
+ return new TypeError('Expected "array" but received "' + typeof obj_tasks + '" (at "' + path_tasks + '")');
2829
+ }
2830
+ for (var i = 0; i < obj_tasks.length; i++) {
2831
+ var obj_tasks_item = obj_tasks[i];
2832
+ var path_tasks_item = path_tasks + '[' + i + ']';
2833
+ if (typeof obj_tasks_item !== 'string') {
2834
+ return new TypeError('Expected "string" but received "' + typeof obj_tasks_item + '" (at "' + path_tasks_item + '")');
2835
+ }
2836
+ }
2837
+ })();
2838
+ return v_error === undefined ? null : v_error;
2839
+ }
2840
+
2841
+ function validate$l(obj, path) {
2842
+ if (path === void 0) { path = 'CarePlanTaskListInputRepresentation'; }
2843
+ var v_error = (function () {
2844
+ if (typeof obj !== 'object' || ArrayIsArray(obj) || obj === null) {
2845
+ return new TypeError('Expected "object" but received "' + typeof obj + '" (at "' + path + '")');
2846
+ }
2847
+ var obj_records = obj.records;
2848
+ var path_records = path + '.records';
2849
+ if (!ArrayIsArray(obj_records)) {
2850
+ return new TypeError('Expected "array" but received "' + typeof obj_records + '" (at "' + path_records + '")');
2851
+ }
2852
+ for (var i = 0; i < obj_records.length; i++) {
2853
+ var obj_records_item = obj_records[i];
2854
+ var path_records_item = path_records + '[' + i + ']';
2855
+ var referencepath_records_itemValidationError = validate$G(obj_records_item, path_records_item);
2856
+ if (referencepath_records_itemValidationError !== null) {
2857
+ var message = 'Object doesn\'t match CarePlanTaskInputRepresentation (at "' + path_records_item + '")\n';
2858
+ message += referencepath_records_itemValidationError.message.split('\n').map(function (line) { return '\t' + line; }).join('\n');
2859
+ return new TypeError(message);
2860
+ }
2861
+ }
2862
+ })();
2863
+ return v_error === undefined ? null : v_error;
2864
+ }
2865
+
2866
+ function validate$k(obj, path) {
2867
+ if (path === void 0) { path = 'CarePlanTasksInputRepresentation'; }
2868
+ var v_error = (function () {
2869
+ if (typeof obj !== 'object' || ArrayIsArray(obj) || obj === null) {
2870
+ return new TypeError('Expected "object" but received "' + typeof obj + '" (at "' + path + '")');
2871
+ }
2872
+ var obj_adhocTasks = obj.adhocTasks;
2873
+ var path_adhocTasks = path + '.adhocTasks';
2874
+ var referencepath_adhocTasksValidationError = validate$n(obj_adhocTasks, path_adhocTasks);
2875
+ if (referencepath_adhocTasksValidationError !== null) {
2876
+ var message = 'Object doesn\'t match AdhocCarePlanTaskListInputRepresentation (at "' + path_adhocTasks + '")\n';
2877
+ message += referencepath_adhocTasksValidationError.message.split('\n').map(function (line) { return '\t' + line; }).join('\n');
2878
+ return new TypeError(message);
2879
+ }
2880
+ var obj_excludedTasks = obj.excludedTasks;
2881
+ var path_excludedTasks = path + '.excludedTasks';
2882
+ var referencepath_excludedTasksValidationError = validate$m(obj_excludedTasks, path_excludedTasks);
2883
+ if (referencepath_excludedTasksValidationError !== null) {
2884
+ var message = 'Object doesn\'t match ExcludedCarePlanTaskInputRepresentation (at "' + path_excludedTasks + '")\n';
2885
+ message += referencepath_excludedTasksValidationError.message.split('\n').map(function (line) { return '\t' + line; }).join('\n');
2886
+ return new TypeError(message);
2887
+ }
2888
+ var obj_tasks = obj.tasks;
2889
+ var path_tasks = path + '.tasks';
2890
+ var referencepath_tasksValidationError = validate$l(obj_tasks, path_tasks);
2891
+ if (referencepath_tasksValidationError !== null) {
2892
+ var message = 'Object doesn\'t match CarePlanTaskListInputRepresentation (at "' + path_tasks + '")\n';
2893
+ message += referencepath_tasksValidationError.message.split('\n').map(function (line) { return '\t' + line; }).join('\n');
2894
+ return new TypeError(message);
2895
+ }
2896
+ })();
2897
+ return v_error === undefined ? null : v_error;
2898
+ }
2899
+
2900
+ function validate$j(obj, path) {
2901
+ if (path === void 0) { path = 'CarePlanTasksMapInputRepresentation'; }
2902
+ var v_error = (function () {
2903
+ if (typeof obj !== 'object' || ArrayIsArray(obj) || obj === null) {
2904
+ return new TypeError('Expected "object" but received "' + typeof obj + '" (at "' + path + '")');
2905
+ }
2906
+ var obj_parentEntityTasks = obj.parentEntityTasks;
2907
+ var path_parentEntityTasks = path + '.parentEntityTasks';
2908
+ if (typeof obj_parentEntityTasks !== 'object' || ArrayIsArray(obj_parentEntityTasks) || obj_parentEntityTasks === null) {
2909
+ return new TypeError('Expected "object" but received "' + typeof obj_parentEntityTasks + '" (at "' + path_parentEntityTasks + '")');
2910
+ }
2911
+ var obj_parentEntityTasks_keys = ObjectKeys(obj_parentEntityTasks);
2912
+ for (var i = 0; i < obj_parentEntityTasks_keys.length; i++) {
2913
+ var key = obj_parentEntityTasks_keys[i];
2914
+ var obj_parentEntityTasks_prop = obj_parentEntityTasks[key];
2915
+ var path_parentEntityTasks_prop = path_parentEntityTasks + '["' + key + '"]';
2916
+ var referencepath_parentEntityTasks_propValidationError = validate$k(obj_parentEntityTasks_prop, path_parentEntityTasks_prop);
2917
+ if (referencepath_parentEntityTasks_propValidationError !== null) {
2918
+ var message = 'Object doesn\'t match CarePlanTasksInputRepresentation (at "' + path_parentEntityTasks_prop + '")\n';
2919
+ message += referencepath_parentEntityTasks_propValidationError.message.split('\n').map(function (line) { return '\t' + line; }).join('\n');
2920
+ return new TypeError(message);
2921
+ }
2922
+ }
2923
+ })();
2924
+ return v_error === undefined ? null : v_error;
2925
+ }
2926
+
2927
+ function select$6(luvio, params) {
2928
+ return select$g();
2929
+ }
2930
+ function getResponseCacheKeys$4(luvio, resourceParams, response) {
2931
+ return getTypeCacheKeys$5(luvio, response);
2932
+ }
2933
+ function ingestSuccess$4(luvio, resourceParams, response) {
2934
+ var body = response.body;
2935
+ var key = keyBuilderFromType$3(luvio, body);
2936
+ luvio.storeIngest(key, ingest$5, body);
2937
+ var snapshot = luvio.storeLookup({
2938
+ recordId: key,
2939
+ node: select$6(),
2940
+ variables: {},
2941
+ });
2942
+ if (process.env.NODE_ENV !== 'production') {
2943
+ if (snapshot.state !== 'Fulfilled') {
2944
+ throw new Error('Invalid network response. Expected resource response to result in Fulfilled snapshot');
2945
+ }
2946
+ }
2947
+ return snapshot;
2948
+ }
2949
+ function createResourceRequest$4(config) {
2950
+ var headers = {};
2951
+ return {
2952
+ baseUri: '/services/data/v58.0',
2953
+ basePath: '/connect/careplan/care-plans/' + config.urlParams.carePlanId + '/tasks',
2954
+ method: 'patch',
2955
+ body: config.body,
2956
+ urlParams: config.urlParams,
2957
+ queryParams: {},
2958
+ headers: headers,
2959
+ priority: 'normal',
2960
+ };
2961
+ }
2962
+
2963
+ var updateCarePlanTasks_ConfigPropertyNames = {
2964
+ displayName: 'updateCarePlanTasks',
2965
+ parameters: {
2966
+ required: ['carePlanId', 'carePlanRecord'],
2967
+ optional: []
2968
+ }
2969
+ };
2970
+ function createResourceParams$4(config) {
2971
+ var resourceParams = {
2972
+ urlParams: {
2973
+ carePlanId: config.carePlanId
2974
+ },
2975
+ body: {
2976
+ carePlanRecord: config.carePlanRecord
2977
+ }
2978
+ };
2979
+ return resourceParams;
2980
+ }
2981
+ function typeCheckConfig$4(untrustedConfig) {
2982
+ var config = {};
2983
+ var untrustedConfig_carePlanId = untrustedConfig.carePlanId;
2984
+ if (typeof untrustedConfig_carePlanId === 'string') {
2985
+ config.carePlanId = untrustedConfig_carePlanId;
2986
+ }
2987
+ var untrustedConfig_carePlanRecord = untrustedConfig.carePlanRecord;
2988
+ var referenceCarePlanTasksMapInputRepresentationValidationError = validate$j(untrustedConfig_carePlanRecord);
2989
+ if (referenceCarePlanTasksMapInputRepresentationValidationError === null) {
2990
+ config.carePlanRecord = untrustedConfig_carePlanRecord;
2991
+ }
2992
+ return config;
2993
+ }
2994
+ function validateAdapterConfig$4(untrustedConfig, configPropertyNames) {
2995
+ if (!untrustedIsObject(untrustedConfig)) {
2996
+ return null;
2997
+ }
2998
+ if (process.env.NODE_ENV !== 'production') {
2999
+ validateConfig(untrustedConfig, configPropertyNames);
3000
+ }
3001
+ var config = typeCheckConfig$4(untrustedConfig);
3002
+ if (!areRequiredParametersPresent(config, configPropertyNames)) {
3003
+ return null;
3004
+ }
3005
+ return config;
3006
+ }
3007
+ function buildNetworkSnapshot$4(luvio, config, options) {
3008
+ var resourceParams = createResourceParams$4(config);
3009
+ var request = createResourceRequest$4(resourceParams);
3010
+ return luvio.dispatchResourceRequest(request, options)
3011
+ .then(function (response) {
3012
+ return luvio.handleSuccessResponse(function () {
3013
+ var snapshot = ingestSuccess$4(luvio, resourceParams, response);
3014
+ return luvio.storeBroadcast().then(function () { return snapshot; });
3015
+ }, function () { return getResponseCacheKeys$4(luvio, resourceParams, response.body); });
3016
+ }, function (response) {
3017
+ deepFreeze$v(response);
3018
+ throw response;
3019
+ });
3020
+ }
3021
+ var updateCarePlanTasksAdapterFactory = function (luvio) {
3022
+ return function updateCarePlanTasks(untrustedConfig) {
3023
+ var config = validateAdapterConfig$4(untrustedConfig, updateCarePlanTasks_ConfigPropertyNames);
3024
+ // Invalid or incomplete config
3025
+ if (config === null) {
3026
+ throw new Error('Invalid config for "updateCarePlanTasks"');
3027
+ }
3028
+ return buildNetworkSnapshot$4(luvio, config);
3029
+ };
3030
+ };
3031
+
3032
+ function select$5(luvio, params) {
3033
+ return select$g();
3034
+ }
3035
+ function getResponseCacheKeys$3(luvio, resourceParams, response) {
3036
+ return getTypeCacheKeys$5(luvio, response);
3037
+ }
3038
+ function ingestSuccess$3(luvio, resourceParams, response) {
3039
+ var body = response.body;
3040
+ var key = keyBuilderFromType$3(luvio, body);
3041
+ luvio.storeIngest(key, ingest$5, body);
3042
+ var snapshot = luvio.storeLookup({
3043
+ recordId: key,
3044
+ node: select$5(),
3045
+ variables: {},
3046
+ });
3047
+ if (process.env.NODE_ENV !== 'production') {
3048
+ if (snapshot.state !== 'Fulfilled') {
3049
+ throw new Error('Invalid network response. Expected resource response to result in Fulfilled snapshot');
3050
+ }
3051
+ }
3052
+ return snapshot;
3053
+ }
3054
+ function createResourceRequest$3(config) {
3055
+ var headers = {};
3056
+ return {
3057
+ baseUri: '/services/data/v58.0',
3058
+ basePath: '/connect/careplan/care-plans/' + config.urlParams.carePlanId + '/tasks',
3059
+ method: 'post',
3060
+ body: config.body,
3061
+ urlParams: config.urlParams,
3062
+ queryParams: {},
3063
+ headers: headers,
3064
+ priority: 'normal',
3065
+ };
3066
+ }
3067
+
3068
+ var createCarePlanTasks_ConfigPropertyNames = {
3069
+ displayName: 'createCarePlanTasks',
3070
+ parameters: {
3071
+ required: ['carePlanId', 'carePlanRecord'],
3072
+ optional: []
3073
+ }
3074
+ };
3075
+ function createResourceParams$3(config) {
3076
+ var resourceParams = {
3077
+ urlParams: {
3078
+ carePlanId: config.carePlanId
3079
+ },
3080
+ body: {
3081
+ carePlanRecord: config.carePlanRecord
3082
+ }
3083
+ };
3084
+ return resourceParams;
3085
+ }
3086
+ function typeCheckConfig$3(untrustedConfig) {
3087
+ var config = {};
3088
+ var untrustedConfig_carePlanId = untrustedConfig.carePlanId;
3089
+ if (typeof untrustedConfig_carePlanId === 'string') {
3090
+ config.carePlanId = untrustedConfig_carePlanId;
3091
+ }
3092
+ var untrustedConfig_carePlanRecord = untrustedConfig.carePlanRecord;
3093
+ var referenceCarePlanTasksMapInputRepresentationValidationError = validate$j(untrustedConfig_carePlanRecord);
3094
+ if (referenceCarePlanTasksMapInputRepresentationValidationError === null) {
3095
+ config.carePlanRecord = untrustedConfig_carePlanRecord;
3096
+ }
3097
+ return config;
3098
+ }
3099
+ function validateAdapterConfig$3(untrustedConfig, configPropertyNames) {
3100
+ if (!untrustedIsObject(untrustedConfig)) {
3101
+ return null;
3102
+ }
3103
+ if (process.env.NODE_ENV !== 'production') {
3104
+ validateConfig(untrustedConfig, configPropertyNames);
3105
+ }
3106
+ var config = typeCheckConfig$3(untrustedConfig);
3107
+ if (!areRequiredParametersPresent(config, configPropertyNames)) {
3108
+ return null;
3109
+ }
3110
+ return config;
3111
+ }
3112
+ function buildNetworkSnapshot$3(luvio, config, options) {
3113
+ var resourceParams = createResourceParams$3(config);
3114
+ var request = createResourceRequest$3(resourceParams);
3115
+ return luvio.dispatchResourceRequest(request, options)
3116
+ .then(function (response) {
3117
+ return luvio.handleSuccessResponse(function () {
3118
+ var snapshot = ingestSuccess$3(luvio, resourceParams, response);
3119
+ return luvio.storeBroadcast().then(function () { return snapshot; });
3120
+ }, function () { return getResponseCacheKeys$3(luvio, resourceParams, response.body); });
3121
+ }, function (response) {
3122
+ deepFreeze$v(response);
3123
+ throw response;
3124
+ });
3125
+ }
3126
+ var createCarePlanTasksAdapterFactory = function (luvio) {
3127
+ return function createCarePlanTasks(untrustedConfig) {
3128
+ var config = validateAdapterConfig$3(untrustedConfig, createCarePlanTasks_ConfigPropertyNames);
3129
+ // Invalid or incomplete config
3130
+ if (config === null) {
3131
+ throw new Error('Invalid config for "createCarePlanTasks"');
3132
+ }
3133
+ return buildNetworkSnapshot$3(luvio, config);
3134
+ };
3135
+ };
3136
+
3137
+ function validate$i(obj, path) {
3138
+ if (path === void 0) { path = 'ActionPlanTemplateItemRepresentation'; }
3139
+ var v_error = (function () {
3140
+ if (typeof obj !== 'object' || ArrayIsArray(obj) || obj === null) {
3141
+ return new TypeError('Expected "object" but received "' + typeof obj + '" (at "' + path + '")');
3142
+ }
3143
+ if (obj.actionPlanTemplateVersion !== undefined) {
3144
+ var obj_actionPlanTemplateVersion = obj.actionPlanTemplateVersion;
3145
+ var path_actionPlanTemplateVersion = path + '.actionPlanTemplateVersion';
3146
+ if (typeof obj_actionPlanTemplateVersion !== 'string') {
3147
+ return new TypeError('Expected "string" but received "' + typeof obj_actionPlanTemplateVersion + '" (at "' + path_actionPlanTemplateVersion + '")');
3148
+ }
3149
+ }
3150
+ if (obj.displayOrder !== undefined) {
3151
+ var obj_displayOrder = obj.displayOrder;
3152
+ var path_displayOrder = path + '.displayOrder';
3153
+ if (typeof obj_displayOrder !== 'number' || (typeof obj_displayOrder === 'number' && Math.floor(obj_displayOrder) !== obj_displayOrder)) {
3154
+ return new TypeError('Expected "integer" but received "' + typeof obj_displayOrder + '" (at "' + path_displayOrder + '")');
3155
+ }
3156
+ }
3157
+ var obj_id = obj.id;
3158
+ var path_id = path + '.id';
3159
+ if (typeof obj_id !== 'string') {
3160
+ return new TypeError('Expected "string" but received "' + typeof obj_id + '" (at "' + path_id + '")');
3161
+ }
3162
+ if (obj.isRequired !== undefined) {
3163
+ var obj_isRequired = obj.isRequired;
3164
+ var path_isRequired = path + '.isRequired';
3165
+ if (typeof obj_isRequired !== 'boolean') {
3166
+ return new TypeError('Expected "boolean" but received "' + typeof obj_isRequired + '" (at "' + path_isRequired + '")');
3167
+ }
3168
+ }
3169
+ var obj_itemEntityType = obj.itemEntityType;
3170
+ var path_itemEntityType = path + '.itemEntityType';
3171
+ if (typeof obj_itemEntityType !== 'string') {
3172
+ return new TypeError('Expected "string" but received "' + typeof obj_itemEntityType + '" (at "' + path_itemEntityType + '")');
3173
+ }
3174
+ var obj_name = obj.name;
3175
+ var path_name = path + '.name';
3176
+ if (typeof obj_name !== 'string') {
3177
+ return new TypeError('Expected "string" but received "' + typeof obj_name + '" (at "' + path_name + '")');
3178
+ }
3179
+ })();
3180
+ return v_error === undefined ? null : v_error;
3181
+ }
3182
+ function deepFreeze$d(input) {
3183
+ ObjectFreeze(input);
3184
+ }
3185
+
3186
+ function validate$h(obj, path) {
3187
+ if (path === void 0) { path = 'ActionPlanTemplateItemsRepresentation'; }
3188
+ var v_error = (function () {
3189
+ if (typeof obj !== 'object' || ArrayIsArray(obj) || obj === null) {
3190
+ return new TypeError('Expected "object" but received "' + typeof obj + '" (at "' + path + '")');
3191
+ }
3192
+ var obj_records = obj.records;
3193
+ var path_records = path + '.records';
3194
+ if (!ArrayIsArray(obj_records)) {
3195
+ return new TypeError('Expected "array" but received "' + typeof obj_records + '" (at "' + path_records + '")');
3196
+ }
3197
+ for (var i = 0; i < obj_records.length; i++) {
3198
+ var obj_records_item = obj_records[i];
3199
+ var path_records_item = path_records + '[' + i + ']';
3200
+ var referencepath_records_itemValidationError = validate$i(obj_records_item, path_records_item);
3201
+ if (referencepath_records_itemValidationError !== null) {
3202
+ var message = 'Object doesn\'t match ActionPlanTemplateItemRepresentation (at "' + path_records_item + '")\n';
3203
+ message += referencepath_records_itemValidationError.message.split('\n').map(function (line) { return '\t' + line; }).join('\n');
3204
+ return new TypeError(message);
3205
+ }
3206
+ }
3207
+ })();
3208
+ return v_error === undefined ? null : v_error;
3209
+ }
3210
+ function deepFreeze$c(input) {
3211
+ var input_records = input.records;
3212
+ for (var i = 0; i < input_records.length; i++) {
3213
+ var input_records_item = input_records[i];
3214
+ deepFreeze$d(input_records_item);
3215
+ }
3216
+ ObjectFreeze(input_records);
3217
+ ObjectFreeze(input);
3218
+ }
3219
+
3220
+ function validate$g(obj, path) {
3221
+ if (path === void 0) { path = 'ActionPlanTemplateRepresentation'; }
3222
+ var v_error = (function () {
3223
+ if (typeof obj !== 'object' || ArrayIsArray(obj) || obj === null) {
3224
+ return new TypeError('Expected "object" but received "' + typeof obj + '" (at "' + path + '")');
3225
+ }
3226
+ if (obj.actionPlanTemplateItems !== undefined) {
3227
+ var obj_actionPlanTemplateItems = obj.actionPlanTemplateItems;
3228
+ var path_actionPlanTemplateItems = path + '.actionPlanTemplateItems';
3229
+ var referencepath_actionPlanTemplateItemsValidationError = validate$h(obj_actionPlanTemplateItems, path_actionPlanTemplateItems);
3230
+ if (referencepath_actionPlanTemplateItemsValidationError !== null) {
3231
+ var message = 'Object doesn\'t match ActionPlanTemplateItemsRepresentation (at "' + path_actionPlanTemplateItems + '")\n';
3232
+ message += referencepath_actionPlanTemplateItemsValidationError.message.split('\n').map(function (line) { return '\t' + line; }).join('\n');
3233
+ return new TypeError(message);
3234
+ }
3235
+ }
3236
+ var obj_id = obj.id;
3237
+ var path_id = path + '.id';
3238
+ if (typeof obj_id !== 'string') {
3239
+ return new TypeError('Expected "string" but received "' + typeof obj_id + '" (at "' + path_id + '")');
3240
+ }
3241
+ var obj_status = obj.status;
3242
+ var path_status = path + '.status';
3243
+ if (typeof obj_status !== 'string') {
3244
+ return new TypeError('Expected "string" but received "' + typeof obj_status + '" (at "' + path_status + '")');
3245
+ }
3246
+ })();
3247
+ return v_error === undefined ? null : v_error;
3248
+ }
3249
+ function deepFreeze$b(input) {
3250
+ var input_actionPlanTemplateItems = input.actionPlanTemplateItems;
3251
+ if (input_actionPlanTemplateItems !== undefined) {
3252
+ deepFreeze$c(input_actionPlanTemplateItems);
3253
+ }
3254
+ ObjectFreeze(input);
3255
+ }
3256
+
3257
+ function validate$f(obj, path) {
3258
+ if (path === void 0) { path = 'ActionPlanTemplateListRepresentation'; }
3259
+ var v_error = (function () {
3260
+ if (typeof obj !== 'object' || ArrayIsArray(obj) || obj === null) {
3261
+ return new TypeError('Expected "object" but received "' + typeof obj + '" (at "' + path + '")');
3262
+ }
3263
+ var obj_records = obj.records;
3264
+ var path_records = path + '.records';
3265
+ if (!ArrayIsArray(obj_records)) {
3266
+ return new TypeError('Expected "array" but received "' + typeof obj_records + '" (at "' + path_records + '")');
3267
+ }
3268
+ for (var i = 0; i < obj_records.length; i++) {
3269
+ var obj_records_item = obj_records[i];
3270
+ var path_records_item = path_records + '[' + i + ']';
3271
+ var referencepath_records_itemValidationError = validate$g(obj_records_item, path_records_item);
3272
+ if (referencepath_records_itemValidationError !== null) {
3273
+ var message = 'Object doesn\'t match ActionPlanTemplateRepresentation (at "' + path_records_item + '")\n';
3274
+ message += referencepath_records_itemValidationError.message.split('\n').map(function (line) { return '\t' + line; }).join('\n');
3275
+ return new TypeError(message);
3276
+ }
3277
+ }
3278
+ })();
3279
+ return v_error === undefined ? null : v_error;
3280
+ }
3281
+ function deepFreeze$a(input) {
3282
+ var input_records = input.records;
3283
+ for (var i = 0; i < input_records.length; i++) {
3284
+ var input_records_item = input_records[i];
3285
+ deepFreeze$b(input_records_item);
3286
+ }
3287
+ ObjectFreeze(input_records);
3288
+ ObjectFreeze(input);
3289
+ }
3290
+
3291
+ function validate$e(obj, path) {
3292
+ if (path === void 0) { path = 'BenefitOutputRepresentation'; }
3293
+ var v_error = (function () {
3294
+ if (typeof obj !== 'object' || ArrayIsArray(obj) || obj === null) {
3295
+ return new TypeError('Expected "object" but received "' + typeof obj + '" (at "' + path + '")');
3296
+ }
3297
+ if (obj.associatedActionPlanTemplates !== undefined) {
3298
+ var obj_associatedActionPlanTemplates = obj.associatedActionPlanTemplates;
3299
+ var path_associatedActionPlanTemplates = path + '.associatedActionPlanTemplates';
3300
+ var referencepath_associatedActionPlanTemplatesValidationError = validate$f(obj_associatedActionPlanTemplates, path_associatedActionPlanTemplates);
3301
+ if (referencepath_associatedActionPlanTemplatesValidationError !== null) {
3302
+ var message = 'Object doesn\'t match ActionPlanTemplateListRepresentation (at "' + path_associatedActionPlanTemplates + '")\n';
3303
+ message += referencepath_associatedActionPlanTemplatesValidationError.message.split('\n').map(function (line) { return '\t' + line; }).join('\n');
3304
+ return new TypeError(message);
3305
+ }
3306
+ }
3307
+ if (obj.benefitFrequency !== undefined) {
3308
+ var obj_benefitFrequency = obj.benefitFrequency;
3309
+ var path_benefitFrequency = path + '.benefitFrequency';
3310
+ if (typeof obj_benefitFrequency !== 'string') {
3311
+ return new TypeError('Expected "string" but received "' + typeof obj_benefitFrequency + '" (at "' + path_benefitFrequency + '")');
3312
+ }
3313
+ }
3314
+ if (obj.enrollmentCount !== undefined) {
3315
+ var obj_enrollmentCount = obj.enrollmentCount;
3316
+ var path_enrollmentCount = path + '.enrollmentCount';
3317
+ if (typeof obj_enrollmentCount !== 'number' || (typeof obj_enrollmentCount === 'number' && Math.floor(obj_enrollmentCount) !== obj_enrollmentCount)) {
3318
+ return new TypeError('Expected "integer" but received "' + typeof obj_enrollmentCount + '" (at "' + path_enrollmentCount + '")');
3319
+ }
3320
+ }
3321
+ var obj_id = obj.id;
3322
+ var path_id = path + '.id';
3323
+ if (typeof obj_id !== 'string') {
3324
+ return new TypeError('Expected "string" but received "' + typeof obj_id + '" (at "' + path_id + '")');
3325
+ }
3326
+ var obj_isActive = obj.isActive;
3327
+ var path_isActive = path + '.isActive';
3328
+ if (typeof obj_isActive !== 'boolean') {
3329
+ return new TypeError('Expected "boolean" but received "' + typeof obj_isActive + '" (at "' + path_isActive + '")');
3330
+ }
3331
+ if (obj.maximumAmount !== undefined) {
3332
+ obj.maximumAmount;
3333
+ }
3334
+ var obj_name = obj.name;
3335
+ var path_name = path + '.name';
3336
+ if (typeof obj_name !== 'string') {
3337
+ return new TypeError('Expected "string" but received "' + typeof obj_name + '" (at "' + path_name + '")');
3338
+ }
3339
+ if (obj.payoutFrequency !== undefined) {
3340
+ var obj_payoutFrequency = obj.payoutFrequency;
3341
+ var path_payoutFrequency = path + '.payoutFrequency';
3342
+ if (typeof obj_payoutFrequency !== 'string') {
3343
+ return new TypeError('Expected "string" but received "' + typeof obj_payoutFrequency + '" (at "' + path_payoutFrequency + '")');
3344
+ }
3345
+ }
3346
+ if (obj.programId !== undefined) {
3347
+ var obj_programId = obj.programId;
3348
+ var path_programId = path + '.programId';
3349
+ if (typeof obj_programId !== 'string') {
3350
+ return new TypeError('Expected "string" but received "' + typeof obj_programId + '" (at "' + path_programId + '")');
3351
+ }
3352
+ }
3353
+ if (obj.status !== undefined) {
3354
+ var obj_status = obj.status;
3355
+ var path_status = path + '.status';
3356
+ if (typeof obj_status !== 'string') {
3357
+ return new TypeError('Expected "string" but received "' + typeof obj_status + '" (at "' + path_status + '")');
3358
+ }
3359
+ }
3360
+ })();
3361
+ return v_error === undefined ? null : v_error;
3362
+ }
3363
+ function deepFreeze$9(input) {
3364
+ var input_associatedActionPlanTemplates = input.associatedActionPlanTemplates;
3365
+ if (input_associatedActionPlanTemplates !== undefined) {
3366
+ deepFreeze$a(input_associatedActionPlanTemplates);
3367
+ }
3368
+ ObjectFreeze(input);
3369
+ }
3370
+
3371
+ function validate$d(obj, path) {
3372
+ if (path === void 0) { path = 'CarePlanTemplateBenefitRepresentation'; }
3373
+ var v_error = (function () {
3374
+ if (typeof obj !== 'object' || ArrayIsArray(obj) || obj === null) {
3375
+ return new TypeError('Expected "object" but received "' + typeof obj + '" (at "' + path + '")');
3376
+ }
3377
+ var obj_associatedBenefit = obj.associatedBenefit;
3378
+ var path_associatedBenefit = path + '.associatedBenefit';
3379
+ var referencepath_associatedBenefitValidationError = validate$e(obj_associatedBenefit, path_associatedBenefit);
3380
+ if (referencepath_associatedBenefitValidationError !== null) {
3381
+ var message = 'Object doesn\'t match BenefitOutputRepresentation (at "' + path_associatedBenefit + '")\n';
3382
+ message += referencepath_associatedBenefitValidationError.message.split('\n').map(function (line) { return '\t' + line; }).join('\n');
3383
+ return new TypeError(message);
3384
+ }
3385
+ var obj_id = obj.id;
3386
+ var path_id = path + '.id';
3387
+ if (typeof obj_id !== 'string') {
3388
+ return new TypeError('Expected "string" but received "' + typeof obj_id + '" (at "' + path_id + '")');
3389
+ }
3390
+ if (obj.priority !== undefined) {
3391
+ var obj_priority = obj.priority;
3392
+ var path_priority = path + '.priority';
3393
+ if (typeof obj_priority !== 'string') {
3394
+ return new TypeError('Expected "string" but received "' + typeof obj_priority + '" (at "' + path_priority + '")');
3395
+ }
3396
+ }
3397
+ })();
3398
+ return v_error === undefined ? null : v_error;
3399
+ }
3400
+ function deepFreeze$8(input) {
3401
+ var input_associatedBenefit = input.associatedBenefit;
3402
+ deepFreeze$9(input_associatedBenefit);
3403
+ ObjectFreeze(input);
3404
+ }
3405
+
3406
+ function validate$c(obj, path) {
3407
+ if (path === void 0) { path = 'CarePlanTemplateBenefitListRepresentation'; }
3408
+ var v_error = (function () {
3409
+ if (typeof obj !== 'object' || ArrayIsArray(obj) || obj === null) {
3410
+ return new TypeError('Expected "object" but received "' + typeof obj + '" (at "' + path + '")');
3411
+ }
3412
+ var obj_records = obj.records;
3413
+ var path_records = path + '.records';
3414
+ if (!ArrayIsArray(obj_records)) {
3415
+ return new TypeError('Expected "array" but received "' + typeof obj_records + '" (at "' + path_records + '")');
3416
+ }
3417
+ for (var i = 0; i < obj_records.length; i++) {
3418
+ var obj_records_item = obj_records[i];
3419
+ var path_records_item = path_records + '[' + i + ']';
3420
+ var referencepath_records_itemValidationError = validate$d(obj_records_item, path_records_item);
3421
+ if (referencepath_records_itemValidationError !== null) {
3422
+ var message = 'Object doesn\'t match CarePlanTemplateBenefitRepresentation (at "' + path_records_item + '")\n';
3423
+ message += referencepath_records_itemValidationError.message.split('\n').map(function (line) { return '\t' + line; }).join('\n');
3424
+ return new TypeError(message);
3425
+ }
3426
+ }
3427
+ })();
3428
+ return v_error === undefined ? null : v_error;
3429
+ }
3430
+ function deepFreeze$7(input) {
3431
+ var input_records = input.records;
3432
+ for (var i = 0; i < input_records.length; i++) {
3433
+ var input_records_item = input_records[i];
3434
+ deepFreeze$8(input_records_item);
3435
+ }
3436
+ ObjectFreeze(input_records);
3437
+ ObjectFreeze(input);
3438
+ }
3439
+
3440
+ function validate$b(obj, path) {
3441
+ if (path === void 0) { path = 'BenefitListRepresentation'; }
3442
+ var v_error = (function () {
3443
+ if (typeof obj !== 'object' || ArrayIsArray(obj) || obj === null) {
3444
+ return new TypeError('Expected "object" but received "' + typeof obj + '" (at "' + path + '")');
3445
+ }
3446
+ var obj_records = obj.records;
3447
+ var path_records = path + '.records';
3448
+ if (!ArrayIsArray(obj_records)) {
3449
+ return new TypeError('Expected "array" but received "' + typeof obj_records + '" (at "' + path_records + '")');
3450
+ }
3451
+ for (var i = 0; i < obj_records.length; i++) {
3452
+ var obj_records_item = obj_records[i];
3453
+ var path_records_item = path_records + '[' + i + ']';
3454
+ var referencepath_records_itemValidationError = validate$e(obj_records_item, path_records_item);
3455
+ if (referencepath_records_itemValidationError !== null) {
3456
+ var message = 'Object doesn\'t match BenefitOutputRepresentation (at "' + path_records_item + '")\n';
3457
+ message += referencepath_records_itemValidationError.message.split('\n').map(function (line) { return '\t' + line; }).join('\n');
3458
+ return new TypeError(message);
3459
+ }
3460
+ }
3461
+ })();
3462
+ return v_error === undefined ? null : v_error;
3463
+ }
3464
+ function deepFreeze$6(input) {
3465
+ var input_records = input.records;
3466
+ for (var i = 0; i < input_records.length; i++) {
3467
+ var input_records_item = input_records[i];
3468
+ deepFreeze$9(input_records_item);
3469
+ }
3470
+ ObjectFreeze(input_records);
3471
+ ObjectFreeze(input);
3472
+ }
3473
+
3474
+ function validate$a(obj, path) {
3475
+ if (path === void 0) { path = 'GoalDefinitionListRepresentation'; }
3476
+ var v_error = (function () {
3477
+ if (typeof obj !== 'object' || ArrayIsArray(obj) || obj === null) {
3478
+ return new TypeError('Expected "object" but received "' + typeof obj + '" (at "' + path + '")');
3479
+ }
3480
+ var obj_records = obj.records;
3481
+ var path_records = path + '.records';
3482
+ if (!ArrayIsArray(obj_records)) {
3483
+ return new TypeError('Expected "array" but received "' + typeof obj_records + '" (at "' + path_records + '")');
3484
+ }
3485
+ for (var i = 0; i < obj_records.length; i++) {
3486
+ var obj_records_item = obj_records[i];
3487
+ var path_records_item = path_records + '[' + i + ']';
3488
+ var referencepath_records_itemValidationError = validate$9(obj_records_item, path_records_item);
3489
+ if (referencepath_records_itemValidationError !== null) {
3490
+ var message = 'Object doesn\'t match GoalDefinitionOutputRepresentation (at "' + path_records_item + '")\n';
3491
+ message += referencepath_records_itemValidationError.message.split('\n').map(function (line) { return '\t' + line; }).join('\n');
3492
+ return new TypeError(message);
3493
+ }
3494
+ }
3495
+ })();
3496
+ return v_error === undefined ? null : v_error;
3497
+ }
3498
+ function deepFreeze$5(input) {
3499
+ var input_records = input.records;
3500
+ for (var i = 0; i < input_records.length; i++) {
3501
+ var input_records_item = input_records[i];
3502
+ deepFreeze$4(input_records_item);
3503
+ }
3504
+ ObjectFreeze(input_records);
3505
+ ObjectFreeze(input);
3506
+ }
3507
+
3508
+ function validate$9(obj, path) {
3509
+ if (path === void 0) { path = 'GoalDefinitionOutputRepresentation'; }
3510
+ var v_error = (function () {
3511
+ if (typeof obj !== 'object' || ArrayIsArray(obj) || obj === null) {
3512
+ return new TypeError('Expected "object" but received "' + typeof obj + '" (at "' + path + '")');
3513
+ }
3514
+ if (obj.associatedActionPlanTemplates !== undefined) {
3515
+ var obj_associatedActionPlanTemplates = obj.associatedActionPlanTemplates;
3516
+ var path_associatedActionPlanTemplates = path + '.associatedActionPlanTemplates';
3517
+ var referencepath_associatedActionPlanTemplatesValidationError = validate$f(obj_associatedActionPlanTemplates, path_associatedActionPlanTemplates);
3518
+ if (referencepath_associatedActionPlanTemplatesValidationError !== null) {
3519
+ var message = 'Object doesn\'t match ActionPlanTemplateListRepresentation (at "' + path_associatedActionPlanTemplates + '")\n';
3520
+ message += referencepath_associatedActionPlanTemplatesValidationError.message.split('\n').map(function (line) { return '\t' + line; }).join('\n');
3521
+ return new TypeError(message);
3522
+ }
3523
+ }
3524
+ if (obj.associatedBenefits !== undefined) {
3525
+ var obj_associatedBenefits = obj.associatedBenefits;
3526
+ var path_associatedBenefits = path + '.associatedBenefits';
3527
+ var referencepath_associatedBenefitsValidationError = validate$b(obj_associatedBenefits, path_associatedBenefits);
3528
+ if (referencepath_associatedBenefitsValidationError !== null) {
3529
+ var message = 'Object doesn\'t match BenefitListRepresentation (at "' + path_associatedBenefits + '")\n';
3530
+ message += referencepath_associatedBenefitsValidationError.message.split('\n').map(function (line) { return '\t' + line; }).join('\n');
3531
+ return new TypeError(message);
3532
+ }
3533
+ }
3534
+ if (obj.associatedSubGoals !== undefined) {
3535
+ var obj_associatedSubGoals = obj.associatedSubGoals;
3536
+ var path_associatedSubGoals = path + '.associatedSubGoals';
3537
+ var referencepath_associatedSubGoalsValidationError = validate$a(obj_associatedSubGoals, path_associatedSubGoals);
3538
+ if (referencepath_associatedSubGoalsValidationError !== null) {
3539
+ var message = 'Object doesn\'t match GoalDefinitionListRepresentation (at "' + path_associatedSubGoals + '")\n';
3540
+ message += referencepath_associatedSubGoalsValidationError.message.split('\n').map(function (line) { return '\t' + line; }).join('\n');
3541
+ return new TypeError(message);
3542
+ }
3543
+ }
3544
+ var obj_id = obj.id;
3545
+ var path_id = path + '.id';
3546
+ if (typeof obj_id !== 'string') {
3547
+ return new TypeError('Expected "string" but received "' + typeof obj_id + '" (at "' + path_id + '")');
3548
+ }
3549
+ var obj_name = obj.name;
3550
+ var path_name = path + '.name';
3551
+ if (typeof obj_name !== 'string') {
3552
+ return new TypeError('Expected "string" but received "' + typeof obj_name + '" (at "' + path_name + '")');
3553
+ }
3554
+ if (obj.status !== undefined) {
3555
+ var obj_status = obj.status;
3556
+ var path_status = path + '.status';
3557
+ if (typeof obj_status !== 'string') {
3558
+ return new TypeError('Expected "string" but received "' + typeof obj_status + '" (at "' + path_status + '")');
3559
+ }
3560
+ }
3561
+ if (obj.type !== undefined) {
3562
+ var obj_type = obj.type;
3563
+ var path_type = path + '.type';
3564
+ if (typeof obj_type !== 'string') {
3565
+ return new TypeError('Expected "string" but received "' + typeof obj_type + '" (at "' + path_type + '")');
3566
+ }
3567
+ }
3568
+ if (obj.usageType !== undefined) {
3569
+ var obj_usageType = obj.usageType;
3570
+ var path_usageType = path + '.usageType';
3571
+ if (typeof obj_usageType !== 'string') {
3572
+ return new TypeError('Expected "string" but received "' + typeof obj_usageType + '" (at "' + path_usageType + '")');
3573
+ }
3574
+ }
3575
+ })();
3576
+ return v_error === undefined ? null : v_error;
3577
+ }
3578
+ function deepFreeze$4(input) {
3579
+ var input_associatedActionPlanTemplates = input.associatedActionPlanTemplates;
3580
+ if (input_associatedActionPlanTemplates !== undefined) {
3581
+ deepFreeze$a(input_associatedActionPlanTemplates);
3582
+ }
3583
+ var input_associatedBenefits = input.associatedBenefits;
3584
+ if (input_associatedBenefits !== undefined) {
3585
+ deepFreeze$6(input_associatedBenefits);
3586
+ }
3587
+ var input_associatedSubGoals = input.associatedSubGoals;
3588
+ if (input_associatedSubGoals !== undefined) {
3589
+ deepFreeze$5(input_associatedSubGoals);
3590
+ }
3591
+ ObjectFreeze(input);
3592
+ }
3593
+
3594
+ function validate$8(obj, path) {
3595
+ if (path === void 0) { path = 'CarePlanTemplateGoalRepresentation'; }
3596
+ var v_error = (function () {
3597
+ if (typeof obj !== 'object' || ArrayIsArray(obj) || obj === null) {
3598
+ return new TypeError('Expected "object" but received "' + typeof obj + '" (at "' + path + '")');
3599
+ }
3600
+ var obj_associatedGoalDefinition = obj.associatedGoalDefinition;
3601
+ var path_associatedGoalDefinition = path + '.associatedGoalDefinition';
3602
+ var referencepath_associatedGoalDefinitionValidationError = validate$9(obj_associatedGoalDefinition, path_associatedGoalDefinition);
3603
+ if (referencepath_associatedGoalDefinitionValidationError !== null) {
3604
+ var message = 'Object doesn\'t match GoalDefinitionOutputRepresentation (at "' + path_associatedGoalDefinition + '")\n';
3605
+ message += referencepath_associatedGoalDefinitionValidationError.message.split('\n').map(function (line) { return '\t' + line; }).join('\n');
3606
+ return new TypeError(message);
3607
+ }
3608
+ var obj_id = obj.id;
3609
+ var path_id = path + '.id';
3610
+ if (typeof obj_id !== 'string') {
3611
+ return new TypeError('Expected "string" but received "' + typeof obj_id + '" (at "' + path_id + '")');
3612
+ }
3613
+ if (obj.priority !== undefined) {
3614
+ var obj_priority = obj.priority;
3615
+ var path_priority = path + '.priority';
3616
+ if (typeof obj_priority !== 'string') {
3617
+ return new TypeError('Expected "string" but received "' + typeof obj_priority + '" (at "' + path_priority + '")');
3618
+ }
3619
+ }
3620
+ })();
3621
+ return v_error === undefined ? null : v_error;
3622
+ }
3623
+ function deepFreeze$3(input) {
3624
+ var input_associatedGoalDefinition = input.associatedGoalDefinition;
3625
+ deepFreeze$4(input_associatedGoalDefinition);
3626
+ ObjectFreeze(input);
3627
+ }
3628
+
3629
+ function validate$7(obj, path) {
3630
+ if (path === void 0) { path = 'CarePlanTemplateGoalListRepresentation'; }
3631
+ var v_error = (function () {
3632
+ if (typeof obj !== 'object' || ArrayIsArray(obj) || obj === null) {
3633
+ return new TypeError('Expected "object" but received "' + typeof obj + '" (at "' + path + '")');
3634
+ }
3635
+ var obj_records = obj.records;
3636
+ var path_records = path + '.records';
3637
+ if (!ArrayIsArray(obj_records)) {
3638
+ return new TypeError('Expected "array" but received "' + typeof obj_records + '" (at "' + path_records + '")');
3639
+ }
3640
+ for (var i = 0; i < obj_records.length; i++) {
3641
+ var obj_records_item = obj_records[i];
3642
+ var path_records_item = path_records + '[' + i + ']';
3643
+ var referencepath_records_itemValidationError = validate$8(obj_records_item, path_records_item);
3644
+ if (referencepath_records_itemValidationError !== null) {
3645
+ var message = 'Object doesn\'t match CarePlanTemplateGoalRepresentation (at "' + path_records_item + '")\n';
3646
+ message += referencepath_records_itemValidationError.message.split('\n').map(function (line) { return '\t' + line; }).join('\n');
3647
+ return new TypeError(message);
3648
+ }
3649
+ }
3650
+ })();
3651
+ return v_error === undefined ? null : v_error;
3652
+ }
3653
+ function deepFreeze$2(input) {
3654
+ var input_records = input.records;
3655
+ for (var i = 0; i < input_records.length; i++) {
3656
+ var input_records_item = input_records[i];
3657
+ deepFreeze$3(input_records_item);
3658
+ }
3659
+ ObjectFreeze(input_records);
3660
+ ObjectFreeze(input);
3661
+ }
3662
+
3663
+ var TTL$1 = 1000;
3664
+ var VERSION$1 = "ed2b1975e84db70243832a0e9da9fce9";
3665
+ function validate$6(obj, path) {
3666
+ if (path === void 0) { path = 'CarePlanTemplateRepresentation'; }
3667
+ var v_error = (function () {
3668
+ if (typeof obj !== 'object' || ArrayIsArray(obj) || obj === null) {
3669
+ return new TypeError('Expected "object" but received "' + typeof obj + '" (at "' + path + '")');
3670
+ }
3671
+ if (obj.associatedActionPlanTemplates !== undefined) {
3672
+ var obj_associatedActionPlanTemplates = obj.associatedActionPlanTemplates;
3673
+ var path_associatedActionPlanTemplates = path + '.associatedActionPlanTemplates';
3674
+ var referencepath_associatedActionPlanTemplatesValidationError = validate$f(obj_associatedActionPlanTemplates, path_associatedActionPlanTemplates);
3675
+ if (referencepath_associatedActionPlanTemplatesValidationError !== null) {
3676
+ var message = 'Object doesn\'t match ActionPlanTemplateListRepresentation (at "' + path_associatedActionPlanTemplates + '")\n';
3677
+ message += referencepath_associatedActionPlanTemplatesValidationError.message.split('\n').map(function (line) { return '\t' + line; }).join('\n');
3678
+ return new TypeError(message);
3679
+ }
3680
+ }
3681
+ if (obj.carePlanTemplateBenefits !== undefined) {
3682
+ var obj_carePlanTemplateBenefits = obj.carePlanTemplateBenefits;
3683
+ var path_carePlanTemplateBenefits = path + '.carePlanTemplateBenefits';
3684
+ var referencepath_carePlanTemplateBenefitsValidationError = validate$c(obj_carePlanTemplateBenefits, path_carePlanTemplateBenefits);
3685
+ if (referencepath_carePlanTemplateBenefitsValidationError !== null) {
3686
+ var message = 'Object doesn\'t match CarePlanTemplateBenefitListRepresentation (at "' + path_carePlanTemplateBenefits + '")\n';
3687
+ message += referencepath_carePlanTemplateBenefitsValidationError.message.split('\n').map(function (line) { return '\t' + line; }).join('\n');
3688
+ return new TypeError(message);
3689
+ }
3690
+ }
3691
+ if (obj.carePlanTemplateGoals !== undefined) {
3692
+ var obj_carePlanTemplateGoals = obj.carePlanTemplateGoals;
3693
+ var path_carePlanTemplateGoals = path + '.carePlanTemplateGoals';
3694
+ var referencepath_carePlanTemplateGoalsValidationError = validate$7(obj_carePlanTemplateGoals, path_carePlanTemplateGoals);
3695
+ if (referencepath_carePlanTemplateGoalsValidationError !== null) {
3696
+ var message = 'Object doesn\'t match CarePlanTemplateGoalListRepresentation (at "' + path_carePlanTemplateGoals + '")\n';
3697
+ message += referencepath_carePlanTemplateGoalsValidationError.message.split('\n').map(function (line) { return '\t' + line; }).join('\n');
3698
+ return new TypeError(message);
3699
+ }
3700
+ }
3701
+ var obj_id = obj.id;
3702
+ var path_id = path + '.id';
3703
+ if (typeof obj_id !== 'string') {
3704
+ return new TypeError('Expected "string" but received "' + typeof obj_id + '" (at "' + path_id + '")');
3705
+ }
3706
+ var obj_name = obj.name;
3707
+ var path_name = path + '.name';
3708
+ if (typeof obj_name !== 'string') {
3709
+ return new TypeError('Expected "string" but received "' + typeof obj_name + '" (at "' + path_name + '")');
3710
+ }
3711
+ var obj_status = obj.status;
3712
+ var path_status = path + '.status';
3713
+ if (typeof obj_status !== 'string') {
3714
+ return new TypeError('Expected "string" but received "' + typeof obj_status + '" (at "' + path_status + '")');
3715
+ }
3716
+ })();
3717
+ return v_error === undefined ? null : v_error;
3718
+ }
3719
+ var RepresentationType$1 = 'CarePlanTemplateRepresentation';
3720
+ function keyBuilder$5(luvio, config) {
3721
+ return keyPrefix + '::' + RepresentationType$1 + ':' + config.id;
3722
+ }
3723
+ function keyBuilderFromType$1(luvio, object) {
3724
+ var keyParams = {
3725
+ id: object.id
3726
+ };
3727
+ return keyBuilder$5(luvio, keyParams);
3728
+ }
3729
+ function normalize$1(input, existing, path, luvio, store, timestamp) {
3730
+ return input;
3731
+ }
3732
+ var select$4 = function CarePlanTemplateRepresentationSelect() {
3733
+ return {
3734
+ kind: 'Fragment',
3735
+ version: VERSION$1,
3736
+ private: [],
3737
+ opaque: true
3738
+ };
3739
+ };
3740
+ function equals$1(existing, incoming) {
3741
+ if (JSONStringify(incoming) !== JSONStringify(existing)) {
3742
+ return false;
3743
+ }
3744
+ return true;
3745
+ }
3746
+ function deepFreeze$1(input) {
3747
+ var input_associatedActionPlanTemplates = input.associatedActionPlanTemplates;
3748
+ if (input_associatedActionPlanTemplates !== undefined) {
3749
+ deepFreeze$a(input_associatedActionPlanTemplates);
3750
+ }
3751
+ var input_carePlanTemplateBenefits = input.carePlanTemplateBenefits;
3752
+ if (input_carePlanTemplateBenefits !== undefined) {
3753
+ deepFreeze$7(input_carePlanTemplateBenefits);
3754
+ }
3755
+ var input_carePlanTemplateGoals = input.carePlanTemplateGoals;
3756
+ if (input_carePlanTemplateGoals !== undefined) {
3757
+ deepFreeze$2(input_carePlanTemplateGoals);
3758
+ }
3759
+ ObjectFreeze(input);
3760
+ }
3761
+ var ingest$1 = function CarePlanTemplateRepresentationIngest(input, path, luvio, store, timestamp) {
3762
+ if (process.env.NODE_ENV !== 'production') {
3763
+ var validateError = validate$6(input);
3764
+ if (validateError !== null) {
3765
+ throw validateError;
3766
+ }
3767
+ }
3768
+ var key = keyBuilderFromType$1(luvio, input);
3769
+ var existingRecord = store.readEntry(key);
3770
+ var ttlToUse = TTL$1;
3771
+ var incomingRecord = normalize$1(input, store.readEntry(key), {
3772
+ fullPath: key,
3773
+ parent: path.parent,
3774
+ propertyName: path.propertyName,
3775
+ ttl: ttlToUse
3776
+ });
3777
+ deepFreeze$1(input);
3778
+ if (existingRecord === undefined || equals$1(existingRecord, incomingRecord) === false) {
3779
+ luvio.storePublish(key, incomingRecord);
3780
+ }
3781
+ {
3782
+ var storeMetadataParams = {
3783
+ ttl: ttlToUse,
3784
+ namespace: "public-sector",
3785
+ version: VERSION$1,
3786
+ representationName: RepresentationType$1,
3787
+ };
3788
+ luvio.publishStoreMetadata(key, storeMetadataParams);
3789
+ }
3790
+ return createLink(key);
3791
+ };
3792
+ function getTypeCacheKeys$1(luvio, input, fullPathFactory) {
3793
+ var rootKeySet = new engine.StoreKeyMap();
3794
+ // root cache key (uses fullPathFactory if keyBuilderFromType isn't defined)
3795
+ var rootKey = keyBuilderFromType$1(luvio, input);
3796
+ rootKeySet.set(rootKey, {
3797
+ namespace: keyPrefix,
3798
+ representationName: RepresentationType$1,
3799
+ mergeable: false
3800
+ });
3801
+ return rootKeySet;
3802
+ }
3803
+ var notifyUpdateAvailableFactory = function (luvio) {
3804
+ return function notifyCarePlanTemplateUpdateAvailable(configs) {
3805
+ if (process.env.NODE_ENV !== 'production') {
3806
+ var requiredKeyParams_1 = ['id'];
3807
+ configs.forEach(function (config) {
3808
+ if (false === requiredKeyParams_1.every(function (req) { return req in config; })) {
3809
+ throw new Error("one of the configs did not contain all required parameters: ".concat(JSONStringify(ObjectKeys(config))));
3810
+ }
3811
+ });
3812
+ }
3813
+ var keys = configs.map(function (c) { return keyBuilder$5(luvio, c); });
3814
+ return luvio.notifyStoreUpdateAvailable(keys);
3815
+ };
3816
+ };
3817
+
3818
+ function select$3(luvio, params) {
3819
+ return select$4();
3820
+ }
3821
+ function keyBuilder$4(luvio, params) {
3822
+ return keyBuilder$5(luvio, {
3823
+ id: params.urlParams.carePlanTemplateId
3824
+ });
3825
+ }
3826
+ function getResponseCacheKeys$2(luvio, resourceParams, response) {
3827
+ return getTypeCacheKeys$1(luvio, response);
3828
+ }
3829
+ function ingestSuccess$2(luvio, resourceParams, response, snapshotRefresh) {
3830
+ var body = response.body;
3831
+ var key = keyBuilder$4(luvio, resourceParams);
3832
+ luvio.storeIngest(key, ingest$1, body);
3833
+ var snapshot = luvio.storeLookup({
3834
+ recordId: key,
3835
+ node: select$3(),
3836
+ variables: {},
3837
+ }, snapshotRefresh);
3838
+ if (process.env.NODE_ENV !== 'production') {
3839
+ if (snapshot.state !== 'Fulfilled') {
3840
+ throw new Error('Invalid network response. Expected resource response to result in Fulfilled snapshot');
3841
+ }
3842
+ }
3843
+ return snapshot;
3844
+ }
3845
+ function ingestError$1(luvio, params, error, snapshotRefresh) {
3846
+ var key = keyBuilder$4(luvio, params);
3847
+ var errorSnapshot = luvio.errorSnapshot(error, snapshotRefresh);
3848
+ var storeMetadataParams = {
3849
+ ttl: TTL$1,
3850
+ namespace: keyPrefix,
3851
+ version: VERSION$1,
3852
+ representationName: RepresentationType$1
3853
+ };
3854
+ luvio.storeIngestError(key, errorSnapshot, storeMetadataParams);
3855
+ return errorSnapshot;
3856
+ }
3857
+ function createResourceRequest$2(config) {
3858
+ var headers = {};
3859
+ return {
3860
+ baseUri: '/services/data/v58.0',
3861
+ basePath: '/connect/careplan/careplan-templates/' + config.urlParams.carePlanTemplateId + '',
3862
+ method: 'get',
3863
+ body: null,
3864
+ urlParams: config.urlParams,
3865
+ queryParams: {},
3866
+ headers: headers,
3867
+ priority: 'normal',
3868
+ };
3869
+ }
3870
+
3871
+ var getCarePlanTemplateDetails_ConfigPropertyNames = {
3872
+ displayName: 'getCarePlanTemplateDetails',
3873
+ parameters: {
3874
+ required: ['carePlanTemplateId'],
3875
+ optional: []
3876
+ }
3877
+ };
3878
+ function createResourceParams$2(config) {
3879
+ var resourceParams = {
3880
+ urlParams: {
3881
+ carePlanTemplateId: config.carePlanTemplateId
3882
+ }
3883
+ };
3884
+ return resourceParams;
3885
+ }
3886
+ function keyBuilder$3(luvio, config) {
3887
+ var resourceParams = createResourceParams$2(config);
3888
+ return keyBuilder$4(luvio, resourceParams);
3889
+ }
3890
+ function typeCheckConfig$2(untrustedConfig) {
3891
+ var config = {};
3892
+ var untrustedConfig_carePlanTemplateId = untrustedConfig.carePlanTemplateId;
3893
+ if (typeof untrustedConfig_carePlanTemplateId === 'string') {
3894
+ config.carePlanTemplateId = untrustedConfig_carePlanTemplateId;
3895
+ }
3896
+ return config;
3897
+ }
3898
+ function validateAdapterConfig$2(untrustedConfig, configPropertyNames) {
3899
+ if (!untrustedIsObject(untrustedConfig)) {
3900
+ return null;
3901
+ }
3902
+ if (process.env.NODE_ENV !== 'production') {
3903
+ validateConfig(untrustedConfig, configPropertyNames);
3904
+ }
3905
+ var config = typeCheckConfig$2(untrustedConfig);
3906
+ if (!areRequiredParametersPresent(config, configPropertyNames)) {
3907
+ return null;
3908
+ }
3909
+ return config;
3910
+ }
3911
+ function adapterFragment$1(luvio, config) {
3912
+ createResourceParams$2(config);
3913
+ return select$3();
3914
+ }
3915
+ function onFetchResponseSuccess$1(luvio, config, resourceParams, response) {
3916
+ var snapshot = ingestSuccess$2(luvio, resourceParams, response, {
3917
+ config: config,
3918
+ resolve: function () { return buildNetworkSnapshot$2(luvio, config, snapshotRefreshOptions); }
3919
+ });
3920
+ return luvio.storeBroadcast().then(function () { return snapshot; });
3921
+ }
3922
+ function onFetchResponseError$1(luvio, config, resourceParams, response) {
3923
+ var snapshot = ingestError$1(luvio, resourceParams, response, {
3924
+ config: config,
3925
+ resolve: function () { return buildNetworkSnapshot$2(luvio, config, snapshotRefreshOptions); }
3926
+ });
3927
+ return luvio.storeBroadcast().then(function () { return snapshot; });
3928
+ }
3929
+ function buildNetworkSnapshot$2(luvio, config, options) {
3930
+ var resourceParams = createResourceParams$2(config);
3931
+ var request = createResourceRequest$2(resourceParams);
3932
+ return luvio.dispatchResourceRequest(request, options)
3933
+ .then(function (response) {
3934
+ return luvio.handleSuccessResponse(function () { return onFetchResponseSuccess$1(luvio, config, resourceParams, response); }, function () { return getResponseCacheKeys$2(luvio, resourceParams, response.body); });
3935
+ }, function (response) {
3936
+ return luvio.handleErrorResponse(function () { return onFetchResponseError$1(luvio, config, resourceParams, response); });
3937
+ });
3938
+ }
3939
+ function buildNetworkSnapshotCachePolicy$1(context, coercedAdapterRequestContext) {
3940
+ var luvio = context.luvio, config = context.config;
3941
+ var networkPriority = coercedAdapterRequestContext.networkPriority, requestCorrelator = coercedAdapterRequestContext.requestCorrelator, eventObservers = coercedAdapterRequestContext.eventObservers;
3942
+ var dispatchOptions = {
3943
+ resourceRequestContext: {
3944
+ requestCorrelator: requestCorrelator,
3945
+ luvioRequestMethod: undefined,
3946
+ },
3947
+ eventObservers: eventObservers
3948
+ };
3949
+ if (networkPriority !== 'normal') {
3950
+ dispatchOptions.overrides = {
3951
+ priority: networkPriority
3952
+ };
3953
+ }
3954
+ return buildNetworkSnapshot$2(luvio, config, dispatchOptions);
3955
+ }
3956
+ function buildCachedSnapshotCachePolicy$1(context, storeLookup) {
3957
+ var luvio = context.luvio, config = context.config;
3958
+ var selector = {
3959
+ recordId: keyBuilder$3(luvio, config),
3960
+ node: adapterFragment$1(luvio, config),
3961
+ variables: {},
3962
+ };
3963
+ var cacheSnapshot = storeLookup(selector, {
3964
+ config: config,
3965
+ resolve: function () { return buildNetworkSnapshot$2(luvio, config, snapshotRefreshOptions); }
3966
+ });
3967
+ return cacheSnapshot;
3968
+ }
3969
+ var getCarePlanTemplateDetailsAdapterFactory = function (luvio) { return function publicSector__getCarePlanTemplateDetails(untrustedConfig, requestContext) {
3970
+ var config = validateAdapterConfig$2(untrustedConfig, getCarePlanTemplateDetails_ConfigPropertyNames);
3971
+ // Invalid or incomplete config
3972
+ if (config === null) {
3973
+ return null;
3974
+ }
3975
+ return luvio.applyCachePolicy((requestContext || {}), { config: config, luvio: luvio }, // BuildSnapshotContext
3976
+ buildCachedSnapshotCachePolicy$1, buildNetworkSnapshotCachePolicy$1);
3977
+ }; };
3978
+
3979
+ function validate$5(obj, path) {
3980
+ if (path === void 0) { path = 'CarePlanTemplateBenefitInputRepresentation'; }
3981
+ var v_error = (function () {
3982
+ if (typeof obj !== 'object' || ArrayIsArray(obj) || obj === null) {
3983
+ return new TypeError('Expected "object" but received "' + typeof obj + '" (at "' + path + '")');
3984
+ }
3985
+ var obj_benefitId = obj.benefitId;
3986
+ var path_benefitId = path + '.benefitId';
3987
+ if (typeof obj_benefitId !== 'string') {
3988
+ return new TypeError('Expected "string" but received "' + typeof obj_benefitId + '" (at "' + path_benefitId + '")');
3989
+ }
3990
+ if (obj.priority !== undefined) {
3991
+ var obj_priority = obj.priority;
3992
+ var path_priority = path + '.priority';
3993
+ if (typeof obj_priority !== 'string') {
3994
+ return new TypeError('Expected "string" but received "' + typeof obj_priority + '" (at "' + path_priority + '")');
3995
+ }
3996
+ }
3997
+ })();
3998
+ return v_error === undefined ? null : v_error;
3999
+ }
4000
+
4001
+ function validate$4(obj, path) {
4002
+ if (path === void 0) { path = 'CarePlanTemplateBenefitListInputRepresentation'; }
4003
+ var v_error = (function () {
4004
+ if (typeof obj !== 'object' || ArrayIsArray(obj) || obj === null) {
4005
+ return new TypeError('Expected "object" but received "' + typeof obj + '" (at "' + path + '")');
4006
+ }
4007
+ var obj_records = obj.records;
4008
+ var path_records = path + '.records';
4009
+ if (!ArrayIsArray(obj_records)) {
4010
+ return new TypeError('Expected "array" but received "' + typeof obj_records + '" (at "' + path_records + '")');
4011
+ }
4012
+ for (var i = 0; i < obj_records.length; i++) {
4013
+ var obj_records_item = obj_records[i];
4014
+ var path_records_item = path_records + '[' + i + ']';
4015
+ var referencepath_records_itemValidationError = validate$5(obj_records_item, path_records_item);
4016
+ if (referencepath_records_itemValidationError !== null) {
4017
+ var message = 'Object doesn\'t match CarePlanTemplateBenefitInputRepresentation (at "' + path_records_item + '")\n';
4018
+ message += referencepath_records_itemValidationError.message.split('\n').map(function (line) { return '\t' + line; }).join('\n');
4019
+ return new TypeError(message);
4020
+ }
4021
+ }
4022
+ })();
4023
+ return v_error === undefined ? null : v_error;
4024
+ }
4025
+
4026
+ function validate$3(obj, path) {
4027
+ if (path === void 0) { path = 'CarePlanTemplateGoalInputRepresentation'; }
4028
+ var v_error = (function () {
4029
+ if (typeof obj !== 'object' || ArrayIsArray(obj) || obj === null) {
4030
+ return new TypeError('Expected "object" but received "' + typeof obj + '" (at "' + path + '")');
4031
+ }
4032
+ var obj_goalDefinitionId = obj.goalDefinitionId;
4033
+ var path_goalDefinitionId = path + '.goalDefinitionId';
4034
+ if (typeof obj_goalDefinitionId !== 'string') {
4035
+ return new TypeError('Expected "string" but received "' + typeof obj_goalDefinitionId + '" (at "' + path_goalDefinitionId + '")');
4036
+ }
4037
+ if (obj.priority !== undefined) {
4038
+ var obj_priority = obj.priority;
4039
+ var path_priority = path + '.priority';
4040
+ if (typeof obj_priority !== 'string') {
4041
+ return new TypeError('Expected "string" but received "' + typeof obj_priority + '" (at "' + path_priority + '")');
4042
+ }
4043
+ }
4044
+ })();
4045
+ return v_error === undefined ? null : v_error;
4046
+ }
4047
+
4048
+ function validate$2(obj, path) {
4049
+ if (path === void 0) { path = 'CarePlanTemplateGoalListInputRepresentation'; }
4050
+ var v_error = (function () {
4051
+ if (typeof obj !== 'object' || ArrayIsArray(obj) || obj === null) {
4052
+ return new TypeError('Expected "object" but received "' + typeof obj + '" (at "' + path + '")');
4053
+ }
4054
+ var obj_records = obj.records;
4055
+ var path_records = path + '.records';
4056
+ if (!ArrayIsArray(obj_records)) {
4057
+ return new TypeError('Expected "array" but received "' + typeof obj_records + '" (at "' + path_records + '")');
4058
+ }
4059
+ for (var i = 0; i < obj_records.length; i++) {
4060
+ var obj_records_item = obj_records[i];
4061
+ var path_records_item = path_records + '[' + i + ']';
4062
+ var referencepath_records_itemValidationError = validate$3(obj_records_item, path_records_item);
4063
+ if (referencepath_records_itemValidationError !== null) {
4064
+ var message = 'Object doesn\'t match CarePlanTemplateGoalInputRepresentation (at "' + path_records_item + '")\n';
4065
+ message += referencepath_records_itemValidationError.message.split('\n').map(function (line) { return '\t' + line; }).join('\n');
4066
+ return new TypeError(message);
4067
+ }
4068
+ }
4069
+ })();
4070
+ return v_error === undefined ? null : v_error;
4071
+ }
4072
+
4073
+ function validate$1(obj, path) {
4074
+ if (path === void 0) { path = 'CarePlanTemplateAssociationsInputRepresentation'; }
4075
+ var v_error = (function () {
4076
+ if (typeof obj !== 'object' || ArrayIsArray(obj) || obj === null) {
4077
+ return new TypeError('Expected "object" but received "' + typeof obj + '" (at "' + path + '")');
4078
+ }
4079
+ if (obj.carePlanTemplateBenefits !== undefined) {
4080
+ var obj_carePlanTemplateBenefits = obj.carePlanTemplateBenefits;
4081
+ var path_carePlanTemplateBenefits = path + '.carePlanTemplateBenefits';
4082
+ var referencepath_carePlanTemplateBenefitsValidationError = validate$4(obj_carePlanTemplateBenefits, path_carePlanTemplateBenefits);
4083
+ if (referencepath_carePlanTemplateBenefitsValidationError !== null) {
4084
+ var message = 'Object doesn\'t match CarePlanTemplateBenefitListInputRepresentation (at "' + path_carePlanTemplateBenefits + '")\n';
4085
+ message += referencepath_carePlanTemplateBenefitsValidationError.message.split('\n').map(function (line) { return '\t' + line; }).join('\n');
4086
+ return new TypeError(message);
4087
+ }
4088
+ }
4089
+ if (obj.carePlanTemplateGoals !== undefined) {
4090
+ var obj_carePlanTemplateGoals = obj.carePlanTemplateGoals;
4091
+ var path_carePlanTemplateGoals = path + '.carePlanTemplateGoals';
4092
+ var referencepath_carePlanTemplateGoalsValidationError = validate$2(obj_carePlanTemplateGoals, path_carePlanTemplateGoals);
4093
+ if (referencepath_carePlanTemplateGoalsValidationError !== null) {
4094
+ var message = 'Object doesn\'t match CarePlanTemplateGoalListInputRepresentation (at "' + path_carePlanTemplateGoals + '")\n';
4095
+ message += referencepath_carePlanTemplateGoalsValidationError.message.split('\n').map(function (line) { return '\t' + line; }).join('\n');
4096
+ return new TypeError(message);
4097
+ }
4098
+ }
4099
+ })();
4100
+ return v_error === undefined ? null : v_error;
4101
+ }
4102
+
4103
+ function select$2(luvio, params) {
4104
+ return select$g();
4105
+ }
4106
+ function getResponseCacheKeys$1(luvio, resourceParams, response) {
4107
+ return getTypeCacheKeys$5(luvio, response);
4108
+ }
4109
+ function ingestSuccess$1(luvio, resourceParams, response) {
4110
+ var body = response.body;
4111
+ var key = keyBuilderFromType$3(luvio, body);
4112
+ luvio.storeIngest(key, ingest$5, body);
4113
+ var snapshot = luvio.storeLookup({
4114
+ recordId: key,
4115
+ node: select$2(),
4116
+ variables: {},
4117
+ });
4118
+ if (process.env.NODE_ENV !== 'production') {
4119
+ if (snapshot.state !== 'Fulfilled') {
4120
+ throw new Error('Invalid network response. Expected resource response to result in Fulfilled snapshot');
4121
+ }
4122
+ }
4123
+ return snapshot;
4124
+ }
4125
+ function createResourceRequest$1(config) {
4126
+ var headers = {};
4127
+ return {
4128
+ baseUri: '/services/data/v58.0',
4129
+ basePath: '/connect/careplan/careplan-templates/' + config.urlParams.carePlanTemplateId + '/actions/' + config.urlParams.actionType + '',
4130
+ method: 'post',
4131
+ body: config.body,
4132
+ urlParams: config.urlParams,
4133
+ queryParams: {},
4134
+ headers: headers,
4135
+ priority: 'normal',
4136
+ };
4137
+ }
4138
+
4139
+ var postCarePlanTemplateDetails_ConfigPropertyNames = {
4140
+ displayName: 'postCarePlanTemplateDetails',
4141
+ parameters: {
4142
+ required: ['actionType', 'carePlanTemplateId', 'carePlanTemplateRecord'],
4143
+ optional: []
4144
+ }
4145
+ };
4146
+ function createResourceParams$1(config) {
4147
+ var resourceParams = {
4148
+ urlParams: {
4149
+ actionType: config.actionType, carePlanTemplateId: config.carePlanTemplateId
4150
+ },
4151
+ body: {
4152
+ carePlanTemplateRecord: config.carePlanTemplateRecord
4153
+ }
4154
+ };
4155
+ return resourceParams;
4156
+ }
4157
+ function typeCheckConfig$1(untrustedConfig) {
4158
+ var config = {};
4159
+ var untrustedConfig_actionType = untrustedConfig.actionType;
4160
+ if (typeof untrustedConfig_actionType === 'string') {
4161
+ config.actionType = untrustedConfig_actionType;
4162
+ }
4163
+ var untrustedConfig_carePlanTemplateId = untrustedConfig.carePlanTemplateId;
4164
+ if (typeof untrustedConfig_carePlanTemplateId === 'string') {
4165
+ config.carePlanTemplateId = untrustedConfig_carePlanTemplateId;
4166
+ }
4167
+ var untrustedConfig_carePlanTemplateRecord = untrustedConfig.carePlanTemplateRecord;
4168
+ var referenceCarePlanTemplateAssociationsInputRepresentationValidationError = validate$1(untrustedConfig_carePlanTemplateRecord);
4169
+ if (referenceCarePlanTemplateAssociationsInputRepresentationValidationError === null) {
4170
+ config.carePlanTemplateRecord = untrustedConfig_carePlanTemplateRecord;
4171
+ }
4172
+ return config;
4173
+ }
4174
+ function validateAdapterConfig$1(untrustedConfig, configPropertyNames) {
4175
+ if (!untrustedIsObject(untrustedConfig)) {
4176
+ return null;
4177
+ }
4178
+ if (process.env.NODE_ENV !== 'production') {
4179
+ validateConfig(untrustedConfig, configPropertyNames);
4180
+ }
4181
+ var config = typeCheckConfig$1(untrustedConfig);
4182
+ if (!areRequiredParametersPresent(config, configPropertyNames)) {
4183
+ return null;
4184
+ }
4185
+ return config;
4186
+ }
4187
+ function buildNetworkSnapshot$1(luvio, config, options) {
4188
+ var resourceParams = createResourceParams$1(config);
4189
+ var request = createResourceRequest$1(resourceParams);
4190
+ return luvio.dispatchResourceRequest(request, options)
4191
+ .then(function (response) {
4192
+ return luvio.handleSuccessResponse(function () {
4193
+ var snapshot = ingestSuccess$1(luvio, resourceParams, response);
4194
+ return luvio.storeBroadcast().then(function () { return snapshot; });
4195
+ }, function () { return getResponseCacheKeys$1(luvio, resourceParams, response.body); });
4196
+ }, function (response) {
4197
+ deepFreeze$v(response);
4198
+ throw response;
4199
+ });
4200
+ }
4201
+ var postCarePlanTemplateDetailsAdapterFactory = function (luvio) {
4202
+ return function postCarePlanTemplateDetails(untrustedConfig) {
4203
+ var config = validateAdapterConfig$1(untrustedConfig, postCarePlanTemplateDetails_ConfigPropertyNames);
4204
+ // Invalid or incomplete config
4205
+ if (config === null) {
4206
+ throw new Error('Invalid config for "postCarePlanTemplateDetails"');
4207
+ }
4208
+ return buildNetworkSnapshot$1(luvio, config);
4209
+ };
4210
+ };
4211
+
4212
+ var TTL = 1000;
4213
+ var VERSION = "fbf7cba26704c3290e3e60d976782048";
4214
+ function validate(obj, path) {
4215
+ if (path === void 0) { path = 'CarePlanDefinitionOutputRepresentation'; }
4216
+ var v_error = (function () {
4217
+ if (typeof obj !== 'object' || ArrayIsArray(obj) || obj === null) {
4218
+ return new TypeError('Expected "object" but received "' + typeof obj + '" (at "' + path + '")');
4219
+ }
4220
+ if (obj.benefitDefinition !== undefined) {
4221
+ var obj_benefitDefinition = obj.benefitDefinition;
4222
+ var path_benefitDefinition = path + '.benefitDefinition';
4223
+ var referencepath_benefitDefinitionValidationError = validate$e(obj_benefitDefinition, path_benefitDefinition);
4224
+ if (referencepath_benefitDefinitionValidationError !== null) {
4225
+ var message = 'Object doesn\'t match BenefitOutputRepresentation (at "' + path_benefitDefinition + '")\n';
4226
+ message += referencepath_benefitDefinitionValidationError.message.split('\n').map(function (line) { return '\t' + line; }).join('\n');
4227
+ return new TypeError(message);
4228
+ }
4229
+ }
4230
+ if (obj.goalDefinition !== undefined) {
4231
+ var obj_goalDefinition = obj.goalDefinition;
4232
+ var path_goalDefinition = path + '.goalDefinition';
4233
+ var referencepath_goalDefinitionValidationError = validate$9(obj_goalDefinition, path_goalDefinition);
4234
+ if (referencepath_goalDefinitionValidationError !== null) {
4235
+ var message = 'Object doesn\'t match GoalDefinitionOutputRepresentation (at "' + path_goalDefinition + '")\n';
4236
+ message += referencepath_goalDefinitionValidationError.message.split('\n').map(function (line) { return '\t' + line; }).join('\n');
4237
+ return new TypeError(message);
4238
+ }
4239
+ }
4240
+ var obj_id = obj.id;
4241
+ var path_id = path + '.id';
4242
+ if (typeof obj_id !== 'string') {
4243
+ return new TypeError('Expected "string" but received "' + typeof obj_id + '" (at "' + path_id + '")');
4244
+ }
4245
+ })();
4246
+ return v_error === undefined ? null : v_error;
4247
+ }
4248
+ var RepresentationType = 'CarePlanDefinitionOutputRepresentation';
4249
+ function keyBuilder$2(luvio, config) {
4250
+ return keyPrefix + '::' + RepresentationType + ':' + config.id;
4251
+ }
4252
+ function keyBuilderFromType(luvio, object) {
4253
+ var keyParams = {
4254
+ id: object.id
4255
+ };
4256
+ return keyBuilder$2(luvio, keyParams);
4257
+ }
4258
+ function normalize(input, existing, path, luvio, store, timestamp) {
4259
+ return input;
4260
+ }
4261
+ var select$1 = function CarePlanDefinitionOutputRepresentationSelect() {
4262
+ return {
4263
+ kind: 'Fragment',
4264
+ version: VERSION,
4265
+ private: [],
4266
+ opaque: true
4267
+ };
4268
+ };
4269
+ function equals(existing, incoming) {
4270
+ if (JSONStringify(incoming) !== JSONStringify(existing)) {
4271
+ return false;
4272
+ }
4273
+ return true;
4274
+ }
4275
+ function deepFreeze(input) {
4276
+ var input_benefitDefinition = input.benefitDefinition;
4277
+ if (input_benefitDefinition !== undefined) {
4278
+ deepFreeze$9(input_benefitDefinition);
4279
+ }
4280
+ var input_goalDefinition = input.goalDefinition;
4281
+ if (input_goalDefinition !== undefined) {
4282
+ deepFreeze$4(input_goalDefinition);
4283
+ }
4284
+ ObjectFreeze(input);
4285
+ }
4286
+ var ingest = function CarePlanDefinitionOutputRepresentationIngest(input, path, luvio, store, timestamp) {
4287
+ if (process.env.NODE_ENV !== 'production') {
4288
+ var validateError = validate(input);
4289
+ if (validateError !== null) {
4290
+ throw validateError;
4291
+ }
4292
+ }
4293
+ var key = keyBuilderFromType(luvio, input);
4294
+ var existingRecord = store.readEntry(key);
4295
+ var ttlToUse = TTL;
4296
+ var incomingRecord = normalize(input, store.readEntry(key), {
4297
+ fullPath: key,
4298
+ parent: path.parent,
4299
+ propertyName: path.propertyName,
4300
+ ttl: ttlToUse
4301
+ });
4302
+ deepFreeze(input);
4303
+ if (existingRecord === undefined || equals(existingRecord, incomingRecord) === false) {
4304
+ luvio.storePublish(key, incomingRecord);
4305
+ }
4306
+ {
4307
+ var storeMetadataParams = {
4308
+ ttl: ttlToUse,
4309
+ namespace: "public-sector",
4310
+ version: VERSION,
4311
+ representationName: RepresentationType,
4312
+ };
4313
+ luvio.publishStoreMetadata(key, storeMetadataParams);
4314
+ }
4315
+ return createLink(key);
4316
+ };
4317
+ function getTypeCacheKeys(luvio, input, fullPathFactory) {
4318
+ var rootKeySet = new engine.StoreKeyMap();
4319
+ // root cache key (uses fullPathFactory if keyBuilderFromType isn't defined)
4320
+ var rootKey = keyBuilderFromType(luvio, input);
4321
+ rootKeySet.set(rootKey, {
4322
+ namespace: keyPrefix,
4323
+ representationName: RepresentationType,
4324
+ mergeable: false
4325
+ });
4326
+ return rootKeySet;
4327
+ }
4328
+
4329
+ function select(luvio, params) {
4330
+ return select$1();
4331
+ }
4332
+ function keyBuilder$1(luvio, params) {
4333
+ return keyBuilder$2(luvio, {
4334
+ id: params.urlParams.definitionId
4335
+ });
4336
+ }
4337
+ function getResponseCacheKeys(luvio, resourceParams, response) {
4338
+ return getTypeCacheKeys(luvio, response);
4339
+ }
4340
+ function ingestSuccess(luvio, resourceParams, response, snapshotRefresh) {
4341
+ var body = response.body;
4342
+ var key = keyBuilder$1(luvio, resourceParams);
4343
+ luvio.storeIngest(key, ingest, body);
4344
+ var snapshot = luvio.storeLookup({
4345
+ recordId: key,
4346
+ node: select(),
4347
+ variables: {},
4348
+ }, snapshotRefresh);
4349
+ if (process.env.NODE_ENV !== 'production') {
4350
+ if (snapshot.state !== 'Fulfilled') {
4351
+ throw new Error('Invalid network response. Expected resource response to result in Fulfilled snapshot');
4352
+ }
4353
+ }
4354
+ return snapshot;
4355
+ }
4356
+ function ingestError(luvio, params, error, snapshotRefresh) {
4357
+ var key = keyBuilder$1(luvio, params);
4358
+ var errorSnapshot = luvio.errorSnapshot(error, snapshotRefresh);
4359
+ var storeMetadataParams = {
4360
+ ttl: TTL,
4361
+ namespace: keyPrefix,
4362
+ version: VERSION,
4363
+ representationName: RepresentationType
4364
+ };
4365
+ luvio.storeIngestError(key, errorSnapshot, storeMetadataParams);
4366
+ return errorSnapshot;
4367
+ }
4368
+ function createResourceRequest(config) {
4369
+ var headers = {};
4370
+ return {
4371
+ baseUri: '/services/data/v58.0',
4372
+ basePath: '/connect/careplan/definitions/' + config.urlParams.definitionId + '',
4373
+ method: 'get',
4374
+ body: null,
4375
+ urlParams: config.urlParams,
4376
+ queryParams: {},
4377
+ headers: headers,
4378
+ priority: 'normal',
4379
+ };
4380
+ }
4381
+
4382
+ var getCarePlanDefinition_ConfigPropertyNames = {
4383
+ displayName: 'getCarePlanDefinition',
4384
+ parameters: {
4385
+ required: ['definitionId'],
4386
+ optional: []
4387
+ }
4388
+ };
4389
+ function createResourceParams(config) {
4390
+ var resourceParams = {
4391
+ urlParams: {
4392
+ definitionId: config.definitionId
4393
+ }
4394
+ };
4395
+ return resourceParams;
4396
+ }
4397
+ function keyBuilder(luvio, config) {
4398
+ var resourceParams = createResourceParams(config);
4399
+ return keyBuilder$1(luvio, resourceParams);
4400
+ }
4401
+ function typeCheckConfig(untrustedConfig) {
4402
+ var config = {};
4403
+ var untrustedConfig_definitionId = untrustedConfig.definitionId;
4404
+ if (typeof untrustedConfig_definitionId === 'string') {
4405
+ config.definitionId = untrustedConfig_definitionId;
4406
+ }
4407
+ return config;
4408
+ }
4409
+ function validateAdapterConfig(untrustedConfig, configPropertyNames) {
4410
+ if (!untrustedIsObject(untrustedConfig)) {
4411
+ return null;
4412
+ }
4413
+ if (process.env.NODE_ENV !== 'production') {
4414
+ validateConfig(untrustedConfig, configPropertyNames);
4415
+ }
4416
+ var config = typeCheckConfig(untrustedConfig);
4417
+ if (!areRequiredParametersPresent(config, configPropertyNames)) {
4418
+ return null;
4419
+ }
4420
+ return config;
4421
+ }
4422
+ function adapterFragment(luvio, config) {
4423
+ createResourceParams(config);
4424
+ return select();
4425
+ }
4426
+ function onFetchResponseSuccess(luvio, config, resourceParams, response) {
4427
+ var snapshot = ingestSuccess(luvio, resourceParams, response, {
4428
+ config: config,
4429
+ resolve: function () { return buildNetworkSnapshot(luvio, config, snapshotRefreshOptions); }
4430
+ });
4431
+ return luvio.storeBroadcast().then(function () { return snapshot; });
4432
+ }
4433
+ function onFetchResponseError(luvio, config, resourceParams, response) {
4434
+ var snapshot = ingestError(luvio, resourceParams, response, {
4435
+ config: config,
4436
+ resolve: function () { return buildNetworkSnapshot(luvio, config, snapshotRefreshOptions); }
4437
+ });
4438
+ return luvio.storeBroadcast().then(function () { return snapshot; });
4439
+ }
4440
+ function buildNetworkSnapshot(luvio, config, options) {
4441
+ var resourceParams = createResourceParams(config);
4442
+ var request = createResourceRequest(resourceParams);
4443
+ return luvio.dispatchResourceRequest(request, options)
4444
+ .then(function (response) {
4445
+ return luvio.handleSuccessResponse(function () { return onFetchResponseSuccess(luvio, config, resourceParams, response); }, function () { return getResponseCacheKeys(luvio, resourceParams, response.body); });
4446
+ }, function (response) {
4447
+ return luvio.handleErrorResponse(function () { return onFetchResponseError(luvio, config, resourceParams, response); });
4448
+ });
4449
+ }
4450
+ function buildNetworkSnapshotCachePolicy(context, coercedAdapterRequestContext) {
4451
+ var luvio = context.luvio, config = context.config;
4452
+ var networkPriority = coercedAdapterRequestContext.networkPriority, requestCorrelator = coercedAdapterRequestContext.requestCorrelator, eventObservers = coercedAdapterRequestContext.eventObservers;
4453
+ var dispatchOptions = {
4454
+ resourceRequestContext: {
4455
+ requestCorrelator: requestCorrelator,
4456
+ luvioRequestMethod: undefined,
4457
+ },
4458
+ eventObservers: eventObservers
4459
+ };
4460
+ if (networkPriority !== 'normal') {
4461
+ dispatchOptions.overrides = {
4462
+ priority: networkPriority
4463
+ };
4464
+ }
4465
+ return buildNetworkSnapshot(luvio, config, dispatchOptions);
4466
+ }
4467
+ function buildCachedSnapshotCachePolicy(context, storeLookup) {
4468
+ var luvio = context.luvio, config = context.config;
4469
+ var selector = {
4470
+ recordId: keyBuilder(luvio, config),
4471
+ node: adapterFragment(luvio, config),
4472
+ variables: {},
4473
+ };
4474
+ var cacheSnapshot = storeLookup(selector, {
4475
+ config: config,
4476
+ resolve: function () { return buildNetworkSnapshot(luvio, config, snapshotRefreshOptions); }
4477
+ });
4478
+ return cacheSnapshot;
4479
+ }
4480
+ var getCarePlanDefinitionAdapterFactory = function (luvio) { return function publicSector__getCarePlanDefinition(untrustedConfig, requestContext) {
4481
+ var config = validateAdapterConfig(untrustedConfig, getCarePlanDefinition_ConfigPropertyNames);
4482
+ // Invalid or incomplete config
4483
+ if (config === null) {
4484
+ return null;
4485
+ }
4486
+ return luvio.applyCachePolicy((requestContext || {}), { config: config, luvio: luvio }, // BuildSnapshotContext
4487
+ buildCachedSnapshotCachePolicy, buildNetworkSnapshotCachePolicy);
4488
+ }; };
4489
+
4490
+ exports.createBenefitDisbursementsAdapterFactory = createBenefitDisbursementsAdapterFactory;
4491
+ exports.createCarePlanTasksAdapterFactory = createCarePlanTasksAdapterFactory;
4492
+ exports.getCarePlanBenefitSessionDetailsAdapterFactory = getCarePlanBenefitSessionDetailsAdapterFactory;
4493
+ exports.getCarePlanDefinitionAdapterFactory = getCarePlanDefinitionAdapterFactory;
4494
+ exports.getCarePlanDetailsAdapterFactory = getCarePlanDetailsAdapterFactory;
4495
+ exports.getCarePlanTasksAdapterFactory = getCarePlanTasksAdapterFactory;
4496
+ exports.getCarePlanTemplateDetailsAdapterFactory = getCarePlanTemplateDetailsAdapterFactory;
4497
+ exports.notifyCarePlanTemplateUpdateAvailableFactory = notifyUpdateAvailableFactory;
4498
+ exports.notifyCarePlanUpdateAvailableFactory = notifyUpdateAvailableFactory$1;
4499
+ exports.postCarePlanDetailsAdapterFactory = postCarePlanDetailsAdapterFactory;
4500
+ exports.postCarePlanTemplateDetailsAdapterFactory = postCarePlanTemplateDetailsAdapterFactory;
4501
+ exports.updateCarePlanDetailsAdapterFactory = updateCarePlanDetailsAdapterFactory;
4502
+ exports.updateCarePlanTasksAdapterFactory = updateCarePlanTasksAdapterFactory;
4503
+
4504
+ Object.defineProperty(exports, '__esModule', { value: true });
4505
+
4506
+ }));