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