@salesforce/lds-adapters-industries-healthcloud 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.
Files changed (58) hide show
  1. package/LICENSE.txt +82 -0
  2. package/dist/es/es2018/industries-healthcloud.js +3340 -0
  3. package/dist/es/es2018/types/src/generated/adapters/adapter-utils.d.ts +66 -0
  4. package/dist/es/es2018/types/src/generated/adapters/bookSlotChain.d.ts +15 -0
  5. package/dist/es/es2018/types/src/generated/adapters/cancelSlotChain.d.ts +15 -0
  6. package/dist/es/es2018/types/src/generated/adapters/genericConnectApiGET.d.ts +33 -0
  7. package/dist/es/es2018/types/src/generated/adapters/genericConnectApiPOST.d.ts +16 -0
  8. package/dist/es/es2018/types/src/generated/adapters/getEntityDetailsInfo.d.ts +27 -0
  9. package/dist/es/es2018/types/src/generated/adapters/getSlots.d.ts +15 -0
  10. package/dist/es/es2018/types/src/generated/adapters/getWorkTypeServiceTerritories.d.ts +27 -0
  11. package/dist/es/es2018/types/src/generated/adapters/moveToNextStep.d.ts +15 -0
  12. package/dist/es/es2018/types/src/generated/adapters/rescheduleSlotChain.d.ts +15 -0
  13. package/dist/es/es2018/types/src/generated/artifacts/main.d.ts +9 -0
  14. package/dist/es/es2018/types/src/generated/artifacts/sfdc.d.ts +13 -0
  15. package/dist/es/es2018/types/src/generated/resources/getConnectHealthGenericByContext.d.ts +24 -0
  16. package/dist/es/es2018/types/src/generated/resources/postConnectHealthAdvancedTherapyManagementBookSlotChain.d.ts +13 -0
  17. package/dist/es/es2018/types/src/generated/resources/postConnectHealthAdvancedTherapyManagementCancelSlotChain.d.ts +13 -0
  18. package/dist/es/es2018/types/src/generated/resources/postConnectHealthAdvancedTherapyManagementFetchServiceTerritories.d.ts +16 -0
  19. package/dist/es/es2018/types/src/generated/resources/postConnectHealthAdvancedTherapyManagementGetSlots.d.ts +13 -0
  20. package/dist/es/es2018/types/src/generated/resources/postConnectHealthAdvancedTherapyManagementMoveToNextStep.d.ts +13 -0
  21. package/dist/es/es2018/types/src/generated/resources/postConnectHealthAdvancedTherapyManagementRescheduleSlotChain.d.ts +13 -0
  22. package/dist/es/es2018/types/src/generated/resources/postConnectHealthFetchEntityDetails.d.ts +16 -0
  23. package/dist/es/es2018/types/src/generated/resources/postConnectHealthGenericByContext.d.ts +16 -0
  24. package/dist/es/es2018/types/src/generated/types/BookSlotChainInputRepresentation.d.ts +36 -0
  25. package/dist/es/es2018/types/src/generated/types/BookSlotChainInputRepresentationWrapper.d.ts +30 -0
  26. package/dist/es/es2018/types/src/generated/types/BookSlotChainOutputRepresentation.d.ts +50 -0
  27. package/dist/es/es2018/types/src/generated/types/CancelSlotChainInputRepresentation.d.ts +38 -0
  28. package/dist/es/es2018/types/src/generated/types/CancelSlotChainInputRepresentationWrapper.d.ts +30 -0
  29. package/dist/es/es2018/types/src/generated/types/CancelSlotChainOutputRepresentation.d.ts +47 -0
  30. package/dist/es/es2018/types/src/generated/types/FetchEntityDetailsInputRepresentation.d.ts +42 -0
  31. package/dist/es/es2018/types/src/generated/types/FetchEntityDetailsInputRepresentationWrapper.d.ts +30 -0
  32. package/dist/es/es2018/types/src/generated/types/FetchEntityDetailsOutputRepresentation.d.ts +46 -0
  33. package/dist/es/es2018/types/src/generated/types/FetchEntityDetailsSearchConditionInputRepresentation.d.ts +35 -0
  34. package/dist/es/es2018/types/src/generated/types/FetchServiceTerritoriesInputRepresentation.d.ts +35 -0
  35. package/dist/es/es2018/types/src/generated/types/FetchServiceTerritoriesInputRepresentationWrapper.d.ts +30 -0
  36. package/dist/es/es2018/types/src/generated/types/FetchServiceTerritoriesOutputRepresentation.d.ts +42 -0
  37. package/dist/es/es2018/types/src/generated/types/GenericConnectApiGETOutputRepresentation.d.ts +42 -0
  38. package/dist/es/es2018/types/src/generated/types/GenericConnectApiPOSTInputRepresentation.d.ts +33 -0
  39. package/dist/es/es2018/types/src/generated/types/GenericConnectApiPOSTInputRepresentationWrapper.d.ts +30 -0
  40. package/dist/es/es2018/types/src/generated/types/GenericConnectApiPOSTOutputRepresentation.d.ts +48 -0
  41. package/dist/es/es2018/types/src/generated/types/GetSlotsInputRepresentation.d.ts +39 -0
  42. package/dist/es/es2018/types/src/generated/types/GetSlotsInputRepresentationWrapper.d.ts +30 -0
  43. package/dist/es/es2018/types/src/generated/types/GetSlotsOutputRepresentation.d.ts +55 -0
  44. package/dist/es/es2018/types/src/generated/types/MoveToNextStepInputRepresentation.d.ts +29 -0
  45. package/dist/es/es2018/types/src/generated/types/MoveToNextStepInputRepresentationWrapper.d.ts +30 -0
  46. package/dist/es/es2018/types/src/generated/types/MoveToNextStepOutputRepresentation.d.ts +56 -0
  47. package/dist/es/es2018/types/src/generated/types/RescheduleSlotChainInputRepresentation.d.ts +48 -0
  48. package/dist/es/es2018/types/src/generated/types/RescheduleSlotChainInputRepresentationWrapper.d.ts +30 -0
  49. package/dist/es/es2018/types/src/generated/types/RescheduleSlotChainOutputRepresentation.d.ts +50 -0
  50. package/dist/es/es2018/types/src/generated/types/SearchConditionInputRepresentation.d.ts +32 -0
  51. package/dist/es/es2018/types/src/generated/types/ServiceTerritoryRepresentation.d.ts +32 -0
  52. package/dist/es/es2018/types/src/generated/types/SlotInputRepresentation.d.ts +77 -0
  53. package/dist/es/es2018/types/src/generated/types/type-utils.d.ts +39 -0
  54. package/package.json +68 -0
  55. package/sfdc/index.d.ts +1 -0
  56. package/sfdc/index.js +3409 -0
  57. package/src/raml/api.raml +699 -0
  58. package/src/raml/luvio.raml +71 -0
package/sfdc/index.js ADDED
@@ -0,0 +1,3409 @@
1
+ /**
2
+ * Copyright (c) 2022, Salesforce, Inc.,
3
+ * All rights reserved.
4
+ * For full license text, see the LICENSE.txt file
5
+ */
6
+
7
+ /* *******************************************************************************************
8
+ * ATTENTION!
9
+ * THIS IS A GENERATED FILE FROM https://github.com/salesforce-experience-platform-emu/lds-lightning-platform
10
+ * If you would like to contribute to LDS, please follow the steps outlined in the git repo.
11
+ * Any changes made to this file in p4 will be automatically overwritten.
12
+ * *******************************************************************************************
13
+ */
14
+ /* proxy-compat-disable */
15
+ import { createInstrumentedAdapter, createLDSAdapter, createWireAdapterConstructor, createImperativeAdapter } from 'force/ldsBindings';
16
+ import { withDefaultLuvio } from 'force/ldsEngine';
17
+ import { serializeStructuredKey, StoreKeyMap } from 'force/luvioEngine';
18
+
19
+ const { hasOwnProperty: ObjectPrototypeHasOwnProperty } = Object.prototype;
20
+ const { keys: ObjectKeys$1, freeze: ObjectFreeze$1, create: ObjectCreate$1 } = Object;
21
+ const { isArray: ArrayIsArray$1 } = Array;
22
+ /**
23
+ * Validates an adapter config is well-formed.
24
+ * @param config The config to validate.
25
+ * @param adapter The adapter validation configuration.
26
+ * @param oneOf The keys the config must contain at least one of.
27
+ * @throws A TypeError if config doesn't satisfy the adapter's config validation.
28
+ */
29
+ function validateConfig(config, adapter, oneOf) {
30
+ const { displayName } = adapter;
31
+ const { required, optional, unsupported } = adapter.parameters;
32
+ if (config === undefined ||
33
+ required.every(req => ObjectPrototypeHasOwnProperty.call(config, req)) === false) {
34
+ throw new TypeError(`adapter ${displayName} configuration must specify ${required.sort().join(', ')}`);
35
+ }
36
+ if (oneOf && oneOf.some(req => ObjectPrototypeHasOwnProperty.call(config, req)) === false) {
37
+ throw new TypeError(`adapter ${displayName} configuration must specify one of ${oneOf.sort().join(', ')}`);
38
+ }
39
+ if (unsupported !== undefined &&
40
+ unsupported.some(req => ObjectPrototypeHasOwnProperty.call(config, req))) {
41
+ throw new TypeError(`adapter ${displayName} does not yet support ${unsupported.sort().join(', ')}`);
42
+ }
43
+ const supported = required.concat(optional);
44
+ if (ObjectKeys$1(config).some(key => !supported.includes(key))) {
45
+ throw new TypeError(`adapter ${displayName} configuration supports only ${supported.sort().join(', ')}`);
46
+ }
47
+ }
48
+ function untrustedIsObject(untrusted) {
49
+ return typeof untrusted === 'object' && untrusted !== null && ArrayIsArray$1(untrusted) === false;
50
+ }
51
+ function areRequiredParametersPresent(config, configPropertyNames) {
52
+ return configPropertyNames.parameters.required.every(req => req in config);
53
+ }
54
+ const snapshotRefreshOptions = {
55
+ overrides: {
56
+ headers: {
57
+ 'Cache-Control': 'no-cache',
58
+ },
59
+ }
60
+ };
61
+ const keyPrefix = 'healthcloud';
62
+
63
+ const { freeze: ObjectFreeze, keys: ObjectKeys, create: ObjectCreate, assign: ObjectAssign } = Object;
64
+ const { isArray: ArrayIsArray } = Array;
65
+ const { stringify: JSONStringify } = JSON;
66
+ function equalsArray(a, b, equalsItem) {
67
+ const aLength = a.length;
68
+ const bLength = b.length;
69
+ if (aLength !== bLength) {
70
+ return false;
71
+ }
72
+ for (let i = 0; i < aLength; i++) {
73
+ if (equalsItem(a[i], b[i]) === false) {
74
+ return false;
75
+ }
76
+ }
77
+ return true;
78
+ }
79
+ function equalsObject(a, b, equalsProp) {
80
+ const aKeys = ObjectKeys(a).sort();
81
+ const bKeys = ObjectKeys(b).sort();
82
+ const aKeysLength = aKeys.length;
83
+ const bKeysLength = bKeys.length;
84
+ if (aKeysLength !== bKeysLength) {
85
+ return false;
86
+ }
87
+ for (let i = 0; i < aKeys.length; i++) {
88
+ const key = aKeys[i];
89
+ if (key !== bKeys[i]) {
90
+ return false;
91
+ }
92
+ if (equalsProp(a[key], b[key]) === false) {
93
+ return false;
94
+ }
95
+ }
96
+ return true;
97
+ }
98
+ function deepFreeze$2(value) {
99
+ // No need to freeze primitives
100
+ if (typeof value !== 'object' || value === null) {
101
+ return;
102
+ }
103
+ if (ArrayIsArray(value)) {
104
+ for (let i = 0, len = value.length; i < len; i += 1) {
105
+ deepFreeze$2(value[i]);
106
+ }
107
+ }
108
+ else {
109
+ const keys = ObjectKeys(value);
110
+ for (let i = 0, len = keys.length; i < len; i += 1) {
111
+ deepFreeze$2(value[keys[i]]);
112
+ }
113
+ }
114
+ ObjectFreeze(value);
115
+ }
116
+ function createLink(ref) {
117
+ return {
118
+ __ref: serializeStructuredKey(ref),
119
+ };
120
+ }
121
+
122
+ function validate$j(obj, path = 'SlotInputRepresentation') {
123
+ const v_error = (() => {
124
+ if (typeof obj !== 'object' || ArrayIsArray(obj) || obj === null) {
125
+ return new TypeError('Expected "object" but received "' + typeof obj + '" (at "' + path + '")');
126
+ }
127
+ if (obj.additionalInformation !== undefined) {
128
+ const obj_additionalInformation = obj.additionalInformation;
129
+ const path_additionalInformation = path + '.additionalInformation';
130
+ if (typeof obj_additionalInformation !== 'string') {
131
+ return new TypeError('Expected "string" but received "' + typeof obj_additionalInformation + '" (at "' + path_additionalInformation + '")');
132
+ }
133
+ }
134
+ if (obj.appointmentType !== undefined) {
135
+ const obj_appointmentType = obj.appointmentType;
136
+ const path_appointmentType = path + '.appointmentType';
137
+ if (typeof obj_appointmentType !== 'string') {
138
+ return new TypeError('Expected "string" but received "' + typeof obj_appointmentType + '" (at "' + path_appointmentType + '")');
139
+ }
140
+ }
141
+ if (obj.city !== undefined) {
142
+ const obj_city = obj.city;
143
+ const path_city = path + '.city';
144
+ if (typeof obj_city !== 'string') {
145
+ return new TypeError('Expected "string" but received "' + typeof obj_city + '" (at "' + path_city + '")');
146
+ }
147
+ }
148
+ if (obj.comments !== undefined) {
149
+ const obj_comments = obj.comments;
150
+ const path_comments = path + '.comments';
151
+ if (typeof obj_comments !== 'string') {
152
+ return new TypeError('Expected "string" but received "' + typeof obj_comments + '" (at "' + path_comments + '")');
153
+ }
154
+ }
155
+ if (obj.contactId !== undefined) {
156
+ const obj_contactId = obj.contactId;
157
+ const path_contactId = path + '.contactId';
158
+ if (typeof obj_contactId !== 'string') {
159
+ return new TypeError('Expected "string" but received "' + typeof obj_contactId + '" (at "' + path_contactId + '")');
160
+ }
161
+ }
162
+ if (obj.country !== undefined) {
163
+ const obj_country = obj.country;
164
+ const path_country = path + '.country';
165
+ if (typeof obj_country !== 'string') {
166
+ return new TypeError('Expected "string" but received "' + typeof obj_country + '" (at "' + path_country + '")');
167
+ }
168
+ }
169
+ if (obj.description !== undefined) {
170
+ const obj_description = obj.description;
171
+ const path_description = path + '.description';
172
+ if (typeof obj_description !== 'string') {
173
+ return new TypeError('Expected "string" but received "' + typeof obj_description + '" (at "' + path_description + '")');
174
+ }
175
+ }
176
+ if (obj.postalCode !== undefined) {
177
+ const obj_postalCode = obj.postalCode;
178
+ const path_postalCode = path + '.postalCode';
179
+ if (typeof obj_postalCode !== 'string') {
180
+ return new TypeError('Expected "string" but received "' + typeof obj_postalCode + '" (at "' + path_postalCode + '")');
181
+ }
182
+ }
183
+ const obj_schedEndTime = obj.schedEndTime;
184
+ const path_schedEndTime = path + '.schedEndTime';
185
+ if (typeof obj_schedEndTime !== 'string') {
186
+ return new TypeError('Expected "string" but received "' + typeof obj_schedEndTime + '" (at "' + path_schedEndTime + '")');
187
+ }
188
+ const obj_schedStartTime = obj.schedStartTime;
189
+ const path_schedStartTime = path + '.schedStartTime';
190
+ if (typeof obj_schedStartTime !== 'string') {
191
+ return new TypeError('Expected "string" but received "' + typeof obj_schedStartTime + '" (at "' + path_schedStartTime + '")');
192
+ }
193
+ if (obj.serviceResourceId !== undefined) {
194
+ const obj_serviceResourceId = obj.serviceResourceId;
195
+ const path_serviceResourceId = path + '.serviceResourceId';
196
+ if (typeof obj_serviceResourceId !== 'string') {
197
+ return new TypeError('Expected "string" but received "' + typeof obj_serviceResourceId + '" (at "' + path_serviceResourceId + '")');
198
+ }
199
+ }
200
+ const obj_serviceTerritoryId = obj.serviceTerritoryId;
201
+ const path_serviceTerritoryId = path + '.serviceTerritoryId';
202
+ if (typeof obj_serviceTerritoryId !== 'string') {
203
+ return new TypeError('Expected "string" but received "' + typeof obj_serviceTerritoryId + '" (at "' + path_serviceTerritoryId + '")');
204
+ }
205
+ if (obj.state !== undefined) {
206
+ const obj_state = obj.state;
207
+ const path_state = path + '.state';
208
+ if (typeof obj_state !== 'string') {
209
+ return new TypeError('Expected "string" but received "' + typeof obj_state + '" (at "' + path_state + '")');
210
+ }
211
+ }
212
+ const obj_status = obj.status;
213
+ const path_status = path + '.status';
214
+ if (typeof obj_status !== 'string') {
215
+ return new TypeError('Expected "string" but received "' + typeof obj_status + '" (at "' + path_status + '")');
216
+ }
217
+ if (obj.street !== undefined) {
218
+ const obj_street = obj.street;
219
+ const path_street = path + '.street';
220
+ if (typeof obj_street !== 'string') {
221
+ return new TypeError('Expected "string" but received "' + typeof obj_street + '" (at "' + path_street + '")');
222
+ }
223
+ }
224
+ if (obj.subject !== undefined) {
225
+ const obj_subject = obj.subject;
226
+ const path_subject = path + '.subject';
227
+ if (typeof obj_subject !== 'string') {
228
+ return new TypeError('Expected "string" but received "' + typeof obj_subject + '" (at "' + path_subject + '")');
229
+ }
230
+ }
231
+ if (obj.workTypeId !== undefined) {
232
+ const obj_workTypeId = obj.workTypeId;
233
+ const path_workTypeId = path + '.workTypeId';
234
+ if (typeof obj_workTypeId !== 'string') {
235
+ return new TypeError('Expected "string" but received "' + typeof obj_workTypeId + '" (at "' + path_workTypeId + '")');
236
+ }
237
+ }
238
+ })();
239
+ return v_error === undefined ? null : v_error;
240
+ }
241
+
242
+ function validate$i(obj, path = 'BookSlotChainInputRepresentation') {
243
+ const v_error = (() => {
244
+ if (typeof obj !== 'object' || ArrayIsArray(obj) || obj === null) {
245
+ return new TypeError('Expected "object" but received "' + typeof obj + '" (at "' + path + '")');
246
+ }
247
+ const obj_careProgramEnrolleeId = obj.careProgramEnrolleeId;
248
+ const path_careProgramEnrolleeId = path + '.careProgramEnrolleeId';
249
+ if (typeof obj_careProgramEnrolleeId !== 'string') {
250
+ return new TypeError('Expected "string" but received "' + typeof obj_careProgramEnrolleeId + '" (at "' + path_careProgramEnrolleeId + '")');
251
+ }
252
+ const obj_slots = obj.slots;
253
+ const path_slots = path + '.slots';
254
+ if (!ArrayIsArray(obj_slots)) {
255
+ return new TypeError('Expected "array" but received "' + typeof obj_slots + '" (at "' + path_slots + '")');
256
+ }
257
+ for (let i = 0; i < obj_slots.length; i++) {
258
+ const obj_slots_item = obj_slots[i];
259
+ const path_slots_item = path_slots + '[' + i + ']';
260
+ const referencepath_slots_itemValidationError = validate$j(obj_slots_item, path_slots_item);
261
+ if (referencepath_slots_itemValidationError !== null) {
262
+ let message = 'Object doesn\'t match SlotInputRepresentation (at "' + path_slots_item + '")\n';
263
+ message += referencepath_slots_itemValidationError.message.split('\n').map((line) => '\t' + line).join('\n');
264
+ return new TypeError(message);
265
+ }
266
+ }
267
+ const obj_workProcedureId = obj.workProcedureId;
268
+ const path_workProcedureId = path + '.workProcedureId';
269
+ if (typeof obj_workProcedureId !== 'string') {
270
+ return new TypeError('Expected "string" but received "' + typeof obj_workProcedureId + '" (at "' + path_workProcedureId + '")');
271
+ }
272
+ })();
273
+ return v_error === undefined ? null : v_error;
274
+ }
275
+
276
+ const VERSION$8 = "887532f336104d21a2b8063efbba663c";
277
+ function validate$h(obj, path = 'BookSlotChainOutputRepresentation') {
278
+ const v_error = (() => {
279
+ if (typeof obj !== 'object' || ArrayIsArray(obj) || obj === null) {
280
+ return new TypeError('Expected "object" but received "' + typeof obj + '" (at "' + path + '")');
281
+ }
282
+ const obj_code = obj.code;
283
+ const path_code = path + '.code';
284
+ if (typeof obj_code !== 'string') {
285
+ return new TypeError('Expected "string" but received "' + typeof obj_code + '" (at "' + path_code + '")');
286
+ }
287
+ const obj_isSuccess = obj.isSuccess;
288
+ const path_isSuccess = path + '.isSuccess';
289
+ if (typeof obj_isSuccess !== 'boolean') {
290
+ return new TypeError('Expected "boolean" but received "' + typeof obj_isSuccess + '" (at "' + path_isSuccess + '")');
291
+ }
292
+ if (obj.message !== undefined) {
293
+ const obj_message = obj.message;
294
+ const path_message = path + '.message';
295
+ let obj_message_union0 = null;
296
+ const obj_message_union0_error = (() => {
297
+ if (typeof obj_message !== 'string') {
298
+ return new TypeError('Expected "string" but received "' + typeof obj_message + '" (at "' + path_message + '")');
299
+ }
300
+ })();
301
+ if (obj_message_union0_error != null) {
302
+ obj_message_union0 = obj_message_union0_error.message;
303
+ }
304
+ let obj_message_union1 = null;
305
+ const obj_message_union1_error = (() => {
306
+ if (obj_message !== null) {
307
+ return new TypeError('Expected "null" but received "' + typeof obj_message + '" (at "' + path_message + '")');
308
+ }
309
+ })();
310
+ if (obj_message_union1_error != null) {
311
+ obj_message_union1 = obj_message_union1_error.message;
312
+ }
313
+ if (obj_message_union0 && obj_message_union1) {
314
+ let message = 'Object doesn\'t match union (at "' + path_message + '")';
315
+ message += '\n' + obj_message_union0.split('\n').map((line) => '\t' + line).join('\n');
316
+ message += '\n' + obj_message_union1.split('\n').map((line) => '\t' + line).join('\n');
317
+ return new TypeError(message);
318
+ }
319
+ }
320
+ if (obj.serviceAppointmentGroupId !== undefined) {
321
+ const obj_serviceAppointmentGroupId = obj.serviceAppointmentGroupId;
322
+ const path_serviceAppointmentGroupId = path + '.serviceAppointmentGroupId';
323
+ let obj_serviceAppointmentGroupId_union0 = null;
324
+ const obj_serviceAppointmentGroupId_union0_error = (() => {
325
+ if (typeof obj_serviceAppointmentGroupId !== 'string') {
326
+ return new TypeError('Expected "string" but received "' + typeof obj_serviceAppointmentGroupId + '" (at "' + path_serviceAppointmentGroupId + '")');
327
+ }
328
+ })();
329
+ if (obj_serviceAppointmentGroupId_union0_error != null) {
330
+ obj_serviceAppointmentGroupId_union0 = obj_serviceAppointmentGroupId_union0_error.message;
331
+ }
332
+ let obj_serviceAppointmentGroupId_union1 = null;
333
+ const obj_serviceAppointmentGroupId_union1_error = (() => {
334
+ if (obj_serviceAppointmentGroupId !== null) {
335
+ return new TypeError('Expected "null" but received "' + typeof obj_serviceAppointmentGroupId + '" (at "' + path_serviceAppointmentGroupId + '")');
336
+ }
337
+ })();
338
+ if (obj_serviceAppointmentGroupId_union1_error != null) {
339
+ obj_serviceAppointmentGroupId_union1 = obj_serviceAppointmentGroupId_union1_error.message;
340
+ }
341
+ if (obj_serviceAppointmentGroupId_union0 && obj_serviceAppointmentGroupId_union1) {
342
+ let message = 'Object doesn\'t match union (at "' + path_serviceAppointmentGroupId + '")';
343
+ message += '\n' + obj_serviceAppointmentGroupId_union0.split('\n').map((line) => '\t' + line).join('\n');
344
+ message += '\n' + obj_serviceAppointmentGroupId_union1.split('\n').map((line) => '\t' + line).join('\n');
345
+ return new TypeError(message);
346
+ }
347
+ }
348
+ if (obj.serviceAppointmentIds !== undefined) {
349
+ const obj_serviceAppointmentIds = obj.serviceAppointmentIds;
350
+ const path_serviceAppointmentIds = path + '.serviceAppointmentIds';
351
+ if (!ArrayIsArray(obj_serviceAppointmentIds)) {
352
+ return new TypeError('Expected "array" but received "' + typeof obj_serviceAppointmentIds + '" (at "' + path_serviceAppointmentIds + '")');
353
+ }
354
+ for (let i = 0; i < obj_serviceAppointmentIds.length; i++) {
355
+ const obj_serviceAppointmentIds_item = obj_serviceAppointmentIds[i];
356
+ const path_serviceAppointmentIds_item = path_serviceAppointmentIds + '[' + i + ']';
357
+ if (typeof obj_serviceAppointmentIds_item !== 'string') {
358
+ return new TypeError('Expected "string" but received "' + typeof obj_serviceAppointmentIds_item + '" (at "' + path_serviceAppointmentIds_item + '")');
359
+ }
360
+ }
361
+ }
362
+ })();
363
+ return v_error === undefined ? null : v_error;
364
+ }
365
+ const RepresentationType$8 = 'BookSlotChainOutputRepresentation';
366
+ function keyBuilder$b(luvio, config) {
367
+ return keyPrefix + '::' + RepresentationType$8 + ':' + config.isSuccess;
368
+ }
369
+ function keyBuilderFromType$5(luvio, object) {
370
+ const keyParams = {
371
+ isSuccess: object.isSuccess
372
+ };
373
+ return keyBuilder$b(luvio, keyParams);
374
+ }
375
+ function normalize$8(input, existing, path, luvio, store, timestamp) {
376
+ return input;
377
+ }
378
+ const select$h = function BookSlotChainOutputRepresentationSelect() {
379
+ return {
380
+ kind: 'Fragment',
381
+ version: VERSION$8,
382
+ private: [],
383
+ selections: [
384
+ {
385
+ name: 'code',
386
+ kind: 'Scalar'
387
+ },
388
+ {
389
+ name: 'isSuccess',
390
+ kind: 'Scalar'
391
+ },
392
+ {
393
+ name: 'message',
394
+ kind: 'Scalar',
395
+ required: false
396
+ },
397
+ {
398
+ name: 'serviceAppointmentGroupId',
399
+ kind: 'Scalar',
400
+ required: false
401
+ },
402
+ {
403
+ name: 'serviceAppointmentIds',
404
+ kind: 'Scalar',
405
+ plural: true,
406
+ required: false
407
+ }
408
+ ]
409
+ };
410
+ };
411
+ function equals$8(existing, incoming) {
412
+ const existing_isSuccess = existing.isSuccess;
413
+ const incoming_isSuccess = incoming.isSuccess;
414
+ if (!(existing_isSuccess === incoming_isSuccess)) {
415
+ return false;
416
+ }
417
+ const existing_code = existing.code;
418
+ const incoming_code = incoming.code;
419
+ if (!(existing_code === incoming_code)) {
420
+ return false;
421
+ }
422
+ const existing_message = existing.message;
423
+ const incoming_message = incoming.message;
424
+ // if at least one of these optionals is defined
425
+ if (existing_message !== undefined || incoming_message !== undefined) {
426
+ // if one of these is not defined we know the other is defined and therefore
427
+ // not equal
428
+ if (existing_message === undefined || incoming_message === undefined) {
429
+ return false;
430
+ }
431
+ if (!(existing_message === incoming_message)) {
432
+ return false;
433
+ }
434
+ }
435
+ const existing_serviceAppointmentGroupId = existing.serviceAppointmentGroupId;
436
+ const incoming_serviceAppointmentGroupId = incoming.serviceAppointmentGroupId;
437
+ // if at least one of these optionals is defined
438
+ if (existing_serviceAppointmentGroupId !== undefined || incoming_serviceAppointmentGroupId !== undefined) {
439
+ // if one of these is not defined we know the other is defined and therefore
440
+ // not equal
441
+ if (existing_serviceAppointmentGroupId === undefined || incoming_serviceAppointmentGroupId === undefined) {
442
+ return false;
443
+ }
444
+ if (!(existing_serviceAppointmentGroupId === incoming_serviceAppointmentGroupId)) {
445
+ return false;
446
+ }
447
+ }
448
+ const existing_serviceAppointmentIds = existing.serviceAppointmentIds;
449
+ const incoming_serviceAppointmentIds = incoming.serviceAppointmentIds;
450
+ // if at least one of these optionals is defined
451
+ if (existing_serviceAppointmentIds !== undefined || incoming_serviceAppointmentIds !== undefined) {
452
+ // if one of these is not defined we know the other is defined and therefore
453
+ // not equal
454
+ if (existing_serviceAppointmentIds === undefined || incoming_serviceAppointmentIds === undefined) {
455
+ return false;
456
+ }
457
+ const equals_serviceAppointmentIds_items = equalsArray(existing_serviceAppointmentIds, incoming_serviceAppointmentIds, (existing_serviceAppointmentIds_item, incoming_serviceAppointmentIds_item) => {
458
+ if (!(existing_serviceAppointmentIds_item === incoming_serviceAppointmentIds_item)) {
459
+ return false;
460
+ }
461
+ });
462
+ if (equals_serviceAppointmentIds_items === false) {
463
+ return false;
464
+ }
465
+ }
466
+ return true;
467
+ }
468
+ const ingest$8 = function BookSlotChainOutputRepresentationIngest(input, path, luvio, store, timestamp) {
469
+ if (process.env.NODE_ENV !== 'production') {
470
+ const validateError = validate$h(input);
471
+ if (validateError !== null) {
472
+ throw validateError;
473
+ }
474
+ }
475
+ const key = keyBuilderFromType$5(luvio, input);
476
+ const existingRecord = store.readEntry(key);
477
+ const ttlToUse = path.ttl !== undefined ? path.ttl : 500;
478
+ let incomingRecord = normalize$8(input, store.readEntry(key), {
479
+ fullPath: key,
480
+ parent: path.parent,
481
+ propertyName: path.propertyName,
482
+ ttl: ttlToUse
483
+ });
484
+ if (existingRecord === undefined || equals$8(existingRecord, incomingRecord) === false) {
485
+ luvio.storePublish(key, incomingRecord);
486
+ }
487
+ if (ttlToUse !== undefined) {
488
+ const storeMetadataParams = {
489
+ ttl: ttlToUse,
490
+ namespace: "healthcloud",
491
+ version: VERSION$8,
492
+ representationName: RepresentationType$8,
493
+ };
494
+ luvio.publishStoreMetadata(key, storeMetadataParams);
495
+ }
496
+ return createLink(key);
497
+ };
498
+ function getTypeCacheKeys$8(luvio, input, fullPathFactory) {
499
+ const rootKeySet = new StoreKeyMap();
500
+ // root cache key (uses fullPathFactory if keyBuilderFromType isn't defined)
501
+ const rootKey = keyBuilderFromType$5(luvio, input);
502
+ rootKeySet.set(rootKey, {
503
+ namespace: keyPrefix,
504
+ representationName: RepresentationType$8,
505
+ mergeable: false
506
+ });
507
+ return rootKeySet;
508
+ }
509
+
510
+ function select$g(luvio, params) {
511
+ return select$h();
512
+ }
513
+ function getResponseCacheKeys$8(luvio, resourceParams, response) {
514
+ return getTypeCacheKeys$8(luvio, response);
515
+ }
516
+ function ingestSuccess$8(luvio, resourceParams, response) {
517
+ const { body } = response;
518
+ const key = keyBuilderFromType$5(luvio, body);
519
+ luvio.storeIngest(key, ingest$8, body);
520
+ const snapshot = luvio.storeLookup({
521
+ recordId: key,
522
+ node: select$g(),
523
+ variables: {},
524
+ });
525
+ if (process.env.NODE_ENV !== 'production') {
526
+ if (snapshot.state !== 'Fulfilled') {
527
+ throw new Error('Invalid network response. Expected resource response to result in Fulfilled snapshot');
528
+ }
529
+ }
530
+ return snapshot;
531
+ }
532
+ function createResourceRequest$8(config) {
533
+ const headers = {};
534
+ return {
535
+ baseUri: '/services/data/v58.0',
536
+ basePath: '/connect/health/advanced-therapy-management/book-slot-chain',
537
+ method: 'post',
538
+ body: config.body,
539
+ urlParams: {},
540
+ queryParams: {},
541
+ headers,
542
+ priority: 'normal',
543
+ };
544
+ }
545
+
546
+ const bookSlotChain_ConfigPropertyNames = {
547
+ displayName: 'bookSlotChain',
548
+ parameters: {
549
+ required: ['BookSlotChainInput'],
550
+ optional: []
551
+ }
552
+ };
553
+ function createResourceParams$8(config) {
554
+ const resourceParams = {
555
+ body: {
556
+ BookSlotChainInput: config.BookSlotChainInput
557
+ }
558
+ };
559
+ return resourceParams;
560
+ }
561
+ function typeCheckConfig$8(untrustedConfig) {
562
+ const config = {};
563
+ const untrustedConfig_BookSlotChainInput = untrustedConfig.BookSlotChainInput;
564
+ const referenceBookSlotChainInputRepresentationValidationError = validate$i(untrustedConfig_BookSlotChainInput);
565
+ if (referenceBookSlotChainInputRepresentationValidationError === null) {
566
+ config.BookSlotChainInput = untrustedConfig_BookSlotChainInput;
567
+ }
568
+ return config;
569
+ }
570
+ function validateAdapterConfig$8(untrustedConfig, configPropertyNames) {
571
+ if (!untrustedIsObject(untrustedConfig)) {
572
+ return null;
573
+ }
574
+ if (process.env.NODE_ENV !== 'production') {
575
+ validateConfig(untrustedConfig, configPropertyNames);
576
+ }
577
+ const config = typeCheckConfig$8(untrustedConfig);
578
+ if (!areRequiredParametersPresent(config, configPropertyNames)) {
579
+ return null;
580
+ }
581
+ return config;
582
+ }
583
+ function buildNetworkSnapshot$8(luvio, config, options) {
584
+ const resourceParams = createResourceParams$8(config);
585
+ const request = createResourceRequest$8(resourceParams);
586
+ return luvio.dispatchResourceRequest(request, options)
587
+ .then((response) => {
588
+ return luvio.handleSuccessResponse(() => {
589
+ const snapshot = ingestSuccess$8(luvio, resourceParams, response);
590
+ return luvio.storeBroadcast().then(() => snapshot);
591
+ }, () => getResponseCacheKeys$8(luvio, resourceParams, response.body));
592
+ }, (response) => {
593
+ deepFreeze$2(response);
594
+ throw response;
595
+ });
596
+ }
597
+ const bookSlotChainAdapterFactory = (luvio) => {
598
+ return function bookSlotChain(untrustedConfig) {
599
+ const config = validateAdapterConfig$8(untrustedConfig, bookSlotChain_ConfigPropertyNames);
600
+ // Invalid or incomplete config
601
+ if (config === null) {
602
+ throw new Error('Invalid config for "bookSlotChain"');
603
+ }
604
+ return buildNetworkSnapshot$8(luvio, config);
605
+ };
606
+ };
607
+
608
+ function validate$g(obj, path = 'CancelSlotChainInputRepresentation') {
609
+ const v_error = (() => {
610
+ if (typeof obj !== 'object' || ArrayIsArray(obj) || obj === null) {
611
+ return new TypeError('Expected "object" but received "' + typeof obj + '" (at "' + path + '")');
612
+ }
613
+ if (obj.cancelationReason !== undefined) {
614
+ const obj_cancelationReason = obj.cancelationReason;
615
+ const path_cancelationReason = path + '.cancelationReason';
616
+ if (typeof obj_cancelationReason !== 'string') {
617
+ return new TypeError('Expected "string" but received "' + typeof obj_cancelationReason + '" (at "' + path_cancelationReason + '")');
618
+ }
619
+ }
620
+ if (obj.serviceAppointmentGroupId !== undefined) {
621
+ const obj_serviceAppointmentGroupId = obj.serviceAppointmentGroupId;
622
+ const path_serviceAppointmentGroupId = path + '.serviceAppointmentGroupId';
623
+ if (typeof obj_serviceAppointmentGroupId !== 'string') {
624
+ return new TypeError('Expected "string" but received "' + typeof obj_serviceAppointmentGroupId + '" (at "' + path_serviceAppointmentGroupId + '")');
625
+ }
626
+ }
627
+ if (obj.slots !== undefined) {
628
+ const obj_slots = obj.slots;
629
+ const path_slots = path + '.slots';
630
+ if (!ArrayIsArray(obj_slots)) {
631
+ return new TypeError('Expected "array" but received "' + typeof obj_slots + '" (at "' + path_slots + '")');
632
+ }
633
+ for (let i = 0; i < obj_slots.length; i++) {
634
+ const obj_slots_item = obj_slots[i];
635
+ const path_slots_item = path_slots + '[' + i + ']';
636
+ if (typeof obj_slots_item !== 'string') {
637
+ return new TypeError('Expected "string" but received "' + typeof obj_slots_item + '" (at "' + path_slots_item + '")');
638
+ }
639
+ }
640
+ }
641
+ const obj_status = obj.status;
642
+ const path_status = path + '.status';
643
+ if (typeof obj_status !== 'string') {
644
+ return new TypeError('Expected "string" but received "' + typeof obj_status + '" (at "' + path_status + '")');
645
+ }
646
+ })();
647
+ return v_error === undefined ? null : v_error;
648
+ }
649
+
650
+ const VERSION$7 = "07afa0b60322d98e30127d781f0484ae";
651
+ function validate$f(obj, path = 'CancelSlotChainOutputRepresentation') {
652
+ const v_error = (() => {
653
+ if (typeof obj !== 'object' || ArrayIsArray(obj) || obj === null) {
654
+ return new TypeError('Expected "object" but received "' + typeof obj + '" (at "' + path + '")');
655
+ }
656
+ const obj_code = obj.code;
657
+ const path_code = path + '.code';
658
+ if (typeof obj_code !== 'string') {
659
+ return new TypeError('Expected "string" but received "' + typeof obj_code + '" (at "' + path_code + '")');
660
+ }
661
+ const obj_isSuccess = obj.isSuccess;
662
+ const path_isSuccess = path + '.isSuccess';
663
+ if (typeof obj_isSuccess !== 'boolean') {
664
+ return new TypeError('Expected "boolean" but received "' + typeof obj_isSuccess + '" (at "' + path_isSuccess + '")');
665
+ }
666
+ if (obj.message !== undefined) {
667
+ const obj_message = obj.message;
668
+ const path_message = path + '.message';
669
+ let obj_message_union0 = null;
670
+ const obj_message_union0_error = (() => {
671
+ if (typeof obj_message !== 'string') {
672
+ return new TypeError('Expected "string" but received "' + typeof obj_message + '" (at "' + path_message + '")');
673
+ }
674
+ })();
675
+ if (obj_message_union0_error != null) {
676
+ obj_message_union0 = obj_message_union0_error.message;
677
+ }
678
+ let obj_message_union1 = null;
679
+ const obj_message_union1_error = (() => {
680
+ if (obj_message !== null) {
681
+ return new TypeError('Expected "null" but received "' + typeof obj_message + '" (at "' + path_message + '")');
682
+ }
683
+ })();
684
+ if (obj_message_union1_error != null) {
685
+ obj_message_union1 = obj_message_union1_error.message;
686
+ }
687
+ if (obj_message_union0 && obj_message_union1) {
688
+ let message = 'Object doesn\'t match union (at "' + path_message + '")';
689
+ message += '\n' + obj_message_union0.split('\n').map((line) => '\t' + line).join('\n');
690
+ message += '\n' + obj_message_union1.split('\n').map((line) => '\t' + line).join('\n');
691
+ return new TypeError(message);
692
+ }
693
+ }
694
+ const obj_serviceAppointmentIds = obj.serviceAppointmentIds;
695
+ const path_serviceAppointmentIds = path + '.serviceAppointmentIds';
696
+ if (!ArrayIsArray(obj_serviceAppointmentIds)) {
697
+ return new TypeError('Expected "array" but received "' + typeof obj_serviceAppointmentIds + '" (at "' + path_serviceAppointmentIds + '")');
698
+ }
699
+ for (let i = 0; i < obj_serviceAppointmentIds.length; i++) {
700
+ const obj_serviceAppointmentIds_item = obj_serviceAppointmentIds[i];
701
+ const path_serviceAppointmentIds_item = path_serviceAppointmentIds + '[' + i + ']';
702
+ if (typeof obj_serviceAppointmentIds_item !== 'string') {
703
+ return new TypeError('Expected "string" but received "' + typeof obj_serviceAppointmentIds_item + '" (at "' + path_serviceAppointmentIds_item + '")');
704
+ }
705
+ }
706
+ })();
707
+ return v_error === undefined ? null : v_error;
708
+ }
709
+ const RepresentationType$7 = 'CancelSlotChainOutputRepresentation';
710
+ function keyBuilder$a(luvio, config) {
711
+ return keyPrefix + '::' + RepresentationType$7 + ':' + config.isSuccess;
712
+ }
713
+ function keyBuilderFromType$4(luvio, object) {
714
+ const keyParams = {
715
+ isSuccess: object.isSuccess
716
+ };
717
+ return keyBuilder$a(luvio, keyParams);
718
+ }
719
+ function normalize$7(input, existing, path, luvio, store, timestamp) {
720
+ return input;
721
+ }
722
+ const select$f = function CancelSlotChainOutputRepresentationSelect() {
723
+ return {
724
+ kind: 'Fragment',
725
+ version: VERSION$7,
726
+ private: [],
727
+ selections: [
728
+ {
729
+ name: 'code',
730
+ kind: 'Scalar'
731
+ },
732
+ {
733
+ name: 'isSuccess',
734
+ kind: 'Scalar'
735
+ },
736
+ {
737
+ name: 'message',
738
+ kind: 'Scalar',
739
+ required: false
740
+ },
741
+ {
742
+ name: 'serviceAppointmentIds',
743
+ kind: 'Scalar',
744
+ plural: true
745
+ }
746
+ ]
747
+ };
748
+ };
749
+ function equals$7(existing, incoming) {
750
+ const existing_isSuccess = existing.isSuccess;
751
+ const incoming_isSuccess = incoming.isSuccess;
752
+ if (!(existing_isSuccess === incoming_isSuccess)) {
753
+ return false;
754
+ }
755
+ const existing_code = existing.code;
756
+ const incoming_code = incoming.code;
757
+ if (!(existing_code === incoming_code)) {
758
+ return false;
759
+ }
760
+ const existing_message = existing.message;
761
+ const incoming_message = incoming.message;
762
+ // if at least one of these optionals is defined
763
+ if (existing_message !== undefined || incoming_message !== undefined) {
764
+ // if one of these is not defined we know the other is defined and therefore
765
+ // not equal
766
+ if (existing_message === undefined || incoming_message === undefined) {
767
+ return false;
768
+ }
769
+ if (!(existing_message === incoming_message)) {
770
+ return false;
771
+ }
772
+ }
773
+ const existing_serviceAppointmentIds = existing.serviceAppointmentIds;
774
+ const incoming_serviceAppointmentIds = incoming.serviceAppointmentIds;
775
+ const equals_serviceAppointmentIds_items = equalsArray(existing_serviceAppointmentIds, incoming_serviceAppointmentIds, (existing_serviceAppointmentIds_item, incoming_serviceAppointmentIds_item) => {
776
+ if (!(existing_serviceAppointmentIds_item === incoming_serviceAppointmentIds_item)) {
777
+ return false;
778
+ }
779
+ });
780
+ if (equals_serviceAppointmentIds_items === false) {
781
+ return false;
782
+ }
783
+ return true;
784
+ }
785
+ const ingest$7 = function CancelSlotChainOutputRepresentationIngest(input, path, luvio, store, timestamp) {
786
+ if (process.env.NODE_ENV !== 'production') {
787
+ const validateError = validate$f(input);
788
+ if (validateError !== null) {
789
+ throw validateError;
790
+ }
791
+ }
792
+ const key = keyBuilderFromType$4(luvio, input);
793
+ const existingRecord = store.readEntry(key);
794
+ const ttlToUse = path.ttl !== undefined ? path.ttl : 500;
795
+ let incomingRecord = normalize$7(input, store.readEntry(key), {
796
+ fullPath: key,
797
+ parent: path.parent,
798
+ propertyName: path.propertyName,
799
+ ttl: ttlToUse
800
+ });
801
+ if (existingRecord === undefined || equals$7(existingRecord, incomingRecord) === false) {
802
+ luvio.storePublish(key, incomingRecord);
803
+ }
804
+ if (ttlToUse !== undefined) {
805
+ const storeMetadataParams = {
806
+ ttl: ttlToUse,
807
+ namespace: "healthcloud",
808
+ version: VERSION$7,
809
+ representationName: RepresentationType$7,
810
+ };
811
+ luvio.publishStoreMetadata(key, storeMetadataParams);
812
+ }
813
+ return createLink(key);
814
+ };
815
+ function getTypeCacheKeys$7(luvio, input, fullPathFactory) {
816
+ const rootKeySet = new StoreKeyMap();
817
+ // root cache key (uses fullPathFactory if keyBuilderFromType isn't defined)
818
+ const rootKey = keyBuilderFromType$4(luvio, input);
819
+ rootKeySet.set(rootKey, {
820
+ namespace: keyPrefix,
821
+ representationName: RepresentationType$7,
822
+ mergeable: false
823
+ });
824
+ return rootKeySet;
825
+ }
826
+
827
+ function select$e(luvio, params) {
828
+ return select$f();
829
+ }
830
+ function getResponseCacheKeys$7(luvio, resourceParams, response) {
831
+ return getTypeCacheKeys$7(luvio, response);
832
+ }
833
+ function ingestSuccess$7(luvio, resourceParams, response) {
834
+ const { body } = response;
835
+ const key = keyBuilderFromType$4(luvio, body);
836
+ luvio.storeIngest(key, ingest$7, body);
837
+ const snapshot = luvio.storeLookup({
838
+ recordId: key,
839
+ node: select$e(),
840
+ variables: {},
841
+ });
842
+ if (process.env.NODE_ENV !== 'production') {
843
+ if (snapshot.state !== 'Fulfilled') {
844
+ throw new Error('Invalid network response. Expected resource response to result in Fulfilled snapshot');
845
+ }
846
+ }
847
+ return snapshot;
848
+ }
849
+ function createResourceRequest$7(config) {
850
+ const headers = {};
851
+ return {
852
+ baseUri: '/services/data/v58.0',
853
+ basePath: '/connect/health/advanced-therapy-management/cancel-slot-chain',
854
+ method: 'post',
855
+ body: config.body,
856
+ urlParams: {},
857
+ queryParams: {},
858
+ headers,
859
+ priority: 'normal',
860
+ };
861
+ }
862
+
863
+ const cancelSlotChain_ConfigPropertyNames = {
864
+ displayName: 'cancelSlotChain',
865
+ parameters: {
866
+ required: ['CancelSlotChainInput'],
867
+ optional: []
868
+ }
869
+ };
870
+ function createResourceParams$7(config) {
871
+ const resourceParams = {
872
+ body: {
873
+ CancelSlotChainInput: config.CancelSlotChainInput
874
+ }
875
+ };
876
+ return resourceParams;
877
+ }
878
+ function typeCheckConfig$7(untrustedConfig) {
879
+ const config = {};
880
+ const untrustedConfig_CancelSlotChainInput = untrustedConfig.CancelSlotChainInput;
881
+ const referenceCancelSlotChainInputRepresentationValidationError = validate$g(untrustedConfig_CancelSlotChainInput);
882
+ if (referenceCancelSlotChainInputRepresentationValidationError === null) {
883
+ config.CancelSlotChainInput = untrustedConfig_CancelSlotChainInput;
884
+ }
885
+ return config;
886
+ }
887
+ function validateAdapterConfig$7(untrustedConfig, configPropertyNames) {
888
+ if (!untrustedIsObject(untrustedConfig)) {
889
+ return null;
890
+ }
891
+ if (process.env.NODE_ENV !== 'production') {
892
+ validateConfig(untrustedConfig, configPropertyNames);
893
+ }
894
+ const config = typeCheckConfig$7(untrustedConfig);
895
+ if (!areRequiredParametersPresent(config, configPropertyNames)) {
896
+ return null;
897
+ }
898
+ return config;
899
+ }
900
+ function buildNetworkSnapshot$7(luvio, config, options) {
901
+ const resourceParams = createResourceParams$7(config);
902
+ const request = createResourceRequest$7(resourceParams);
903
+ return luvio.dispatchResourceRequest(request, options)
904
+ .then((response) => {
905
+ return luvio.handleSuccessResponse(() => {
906
+ const snapshot = ingestSuccess$7(luvio, resourceParams, response);
907
+ return luvio.storeBroadcast().then(() => snapshot);
908
+ }, () => getResponseCacheKeys$7(luvio, resourceParams, response.body));
909
+ }, (response) => {
910
+ deepFreeze$2(response);
911
+ throw response;
912
+ });
913
+ }
914
+ const cancelSlotChainAdapterFactory = (luvio) => {
915
+ return function cancelSlotChain(untrustedConfig) {
916
+ const config = validateAdapterConfig$7(untrustedConfig, cancelSlotChain_ConfigPropertyNames);
917
+ // Invalid or incomplete config
918
+ if (config === null) {
919
+ throw new Error('Invalid config for "cancelSlotChain"');
920
+ }
921
+ return buildNetworkSnapshot$7(luvio, config);
922
+ };
923
+ };
924
+
925
+ const VERSION$6 = "9a4b29dafb135f2d93c3bb0d73b2f500";
926
+ function validate$e(obj, path = 'GenericConnectApiGETOutputRepresentation') {
927
+ const v_error = (() => {
928
+ if (typeof obj !== 'object' || ArrayIsArray(obj) || obj === null) {
929
+ return new TypeError('Expected "object" but received "' + typeof obj + '" (at "' + path + '")');
930
+ }
931
+ if (obj.code !== undefined) {
932
+ const obj_code = obj.code;
933
+ const path_code = path + '.code';
934
+ if (typeof obj_code !== 'string') {
935
+ return new TypeError('Expected "string" but received "' + typeof obj_code + '" (at "' + path_code + '")');
936
+ }
937
+ }
938
+ const obj_message = obj.message;
939
+ const path_message = path + '.message';
940
+ if (typeof obj_message !== 'string') {
941
+ return new TypeError('Expected "string" but received "' + typeof obj_message + '" (at "' + path_message + '")');
942
+ }
943
+ if (obj.rowSpecificOutput !== undefined) {
944
+ const obj_rowSpecificOutput = obj.rowSpecificOutput;
945
+ const path_rowSpecificOutput = path + '.rowSpecificOutput';
946
+ if (!ArrayIsArray(obj_rowSpecificOutput)) {
947
+ return new TypeError('Expected "array" but received "' + typeof obj_rowSpecificOutput + '" (at "' + path_rowSpecificOutput + '")');
948
+ }
949
+ for (let i = 0; i < obj_rowSpecificOutput.length; i++) {
950
+ const obj_rowSpecificOutput_item = obj_rowSpecificOutput[i];
951
+ const path_rowSpecificOutput_item = path_rowSpecificOutput + '[' + i + ']';
952
+ if (typeof obj_rowSpecificOutput_item !== 'object' || ArrayIsArray(obj_rowSpecificOutput_item) || obj_rowSpecificOutput_item === null) {
953
+ return new TypeError('Expected "object" but received "' + typeof obj_rowSpecificOutput_item + '" (at "' + path_rowSpecificOutput_item + '")');
954
+ }
955
+ const obj_rowSpecificOutput_item_keys = ObjectKeys(obj_rowSpecificOutput_item);
956
+ for (let i = 0; i < obj_rowSpecificOutput_item_keys.length; i++) {
957
+ const key = obj_rowSpecificOutput_item_keys[i];
958
+ const obj_rowSpecificOutput_item_prop = obj_rowSpecificOutput_item[key];
959
+ const path_rowSpecificOutput_item_prop = path_rowSpecificOutput_item + '["' + key + '"]';
960
+ if (obj_rowSpecificOutput_item_prop === undefined) {
961
+ return new TypeError('Expected "defined" but received "' + typeof obj_rowSpecificOutput_item_prop + '" (at "' + path_rowSpecificOutput_item_prop + '")');
962
+ }
963
+ }
964
+ }
965
+ }
966
+ const obj_searchTerm = obj.searchTerm;
967
+ const path_searchTerm = path + '.searchTerm';
968
+ if (typeof obj_searchTerm !== 'string') {
969
+ return new TypeError('Expected "string" but received "' + typeof obj_searchTerm + '" (at "' + path_searchTerm + '")');
970
+ }
971
+ })();
972
+ return v_error === undefined ? null : v_error;
973
+ }
974
+ const RepresentationType$6 = 'GenericConnectApiGETOutputRepresentation';
975
+ function normalize$6(input, existing, path, luvio, store, timestamp) {
976
+ return input;
977
+ }
978
+ const select$d = function GenericConnectApiGETOutputRepresentationSelect() {
979
+ return {
980
+ kind: 'Fragment',
981
+ version: VERSION$6,
982
+ private: [],
983
+ opaque: true
984
+ };
985
+ };
986
+ function equals$6(existing, incoming) {
987
+ if (JSONStringify(incoming) !== JSONStringify(existing)) {
988
+ return false;
989
+ }
990
+ return true;
991
+ }
992
+ function deepFreeze$1(input) {
993
+ const input_rowSpecificOutput = input.rowSpecificOutput;
994
+ if (input_rowSpecificOutput !== undefined) {
995
+ for (let i = 0; i < input_rowSpecificOutput.length; i++) {
996
+ const input_rowSpecificOutput_item = input_rowSpecificOutput[i];
997
+ const input_rowSpecificOutput_item_keys = Object.keys(input_rowSpecificOutput_item);
998
+ const input_rowSpecificOutput_item_length = input_rowSpecificOutput_item_keys.length;
999
+ for (let i = 0; i < input_rowSpecificOutput_item_length; i++) {
1000
+ const key = input_rowSpecificOutput_item_keys[i];
1001
+ const input_rowSpecificOutput_item_prop = input_rowSpecificOutput_item[key];
1002
+ deepFreeze$2(input_rowSpecificOutput_item_prop);
1003
+ }
1004
+ ObjectFreeze(input_rowSpecificOutput_item);
1005
+ }
1006
+ ObjectFreeze(input_rowSpecificOutput);
1007
+ }
1008
+ ObjectFreeze(input);
1009
+ }
1010
+ const ingest$6 = function GenericConnectApiGETOutputRepresentationIngest(input, path, luvio, store, timestamp) {
1011
+ if (process.env.NODE_ENV !== 'production') {
1012
+ const validateError = validate$e(input);
1013
+ if (validateError !== null) {
1014
+ throw validateError;
1015
+ }
1016
+ }
1017
+ const key = path.fullPath;
1018
+ const existingRecord = store.readEntry(key);
1019
+ const ttlToUse = path.ttl !== undefined ? path.ttl : 500;
1020
+ let incomingRecord = normalize$6(input, store.readEntry(key), {
1021
+ fullPath: key,
1022
+ parent: path.parent,
1023
+ propertyName: path.propertyName,
1024
+ ttl: ttlToUse
1025
+ });
1026
+ deepFreeze$1(input);
1027
+ if (existingRecord === undefined || equals$6(existingRecord, incomingRecord) === false) {
1028
+ luvio.storePublish(key, incomingRecord);
1029
+ }
1030
+ if (ttlToUse !== undefined) {
1031
+ const storeMetadataParams = {
1032
+ ttl: ttlToUse,
1033
+ namespace: "healthcloud",
1034
+ version: VERSION$6,
1035
+ representationName: RepresentationType$6,
1036
+ };
1037
+ luvio.publishStoreMetadata(key, storeMetadataParams);
1038
+ }
1039
+ return createLink(key);
1040
+ };
1041
+ function getTypeCacheKeys$6(luvio, input, fullPathFactory) {
1042
+ const rootKeySet = new StoreKeyMap();
1043
+ // root cache key (uses fullPathFactory if keyBuilderFromType isn't defined)
1044
+ const rootKey = fullPathFactory();
1045
+ rootKeySet.set(rootKey, {
1046
+ namespace: keyPrefix,
1047
+ representationName: RepresentationType$6,
1048
+ mergeable: false
1049
+ });
1050
+ return rootKeySet;
1051
+ }
1052
+
1053
+ function select$c(luvio, params) {
1054
+ return select$d();
1055
+ }
1056
+ function keyBuilder$9(luvio, params) {
1057
+ return keyPrefix + '::GenericConnectApiGETOutputRepresentation:(' + 'fields:' + params.queryParams.fields + ',' + 'limitBy:' + params.queryParams.limitBy + ',' + 'offset:' + params.queryParams.offset + ',' + 'searchTerm:' + params.queryParams.searchTerm + ',' + 'sortBy:' + params.queryParams.sortBy + ',' + 'sortOrder:' + params.queryParams.sortOrder + ',' + 'values:' + params.queryParams.values + ',' + 'context:' + params.urlParams.context + ')';
1058
+ }
1059
+ function getResponseCacheKeys$6(luvio, resourceParams, response) {
1060
+ return getTypeCacheKeys$6(luvio, response, () => keyBuilder$9(luvio, resourceParams));
1061
+ }
1062
+ function ingestSuccess$6(luvio, resourceParams, response, snapshotRefresh) {
1063
+ const { body } = response;
1064
+ const key = keyBuilder$9(luvio, resourceParams);
1065
+ luvio.storeIngest(key, ingest$6, body);
1066
+ const snapshot = luvio.storeLookup({
1067
+ recordId: key,
1068
+ node: select$c(),
1069
+ variables: {},
1070
+ }, snapshotRefresh);
1071
+ if (process.env.NODE_ENV !== 'production') {
1072
+ if (snapshot.state !== 'Fulfilled') {
1073
+ throw new Error('Invalid network response. Expected resource response to result in Fulfilled snapshot');
1074
+ }
1075
+ }
1076
+ return snapshot;
1077
+ }
1078
+ function ingestError$2(luvio, params, error, snapshotRefresh) {
1079
+ const key = keyBuilder$9(luvio, params);
1080
+ const errorSnapshot = luvio.errorSnapshot(error, snapshotRefresh);
1081
+ luvio.storeIngestError(key, errorSnapshot);
1082
+ return errorSnapshot;
1083
+ }
1084
+ function createResourceRequest$6(config) {
1085
+ const headers = {};
1086
+ return {
1087
+ baseUri: '/services/data/v58.0',
1088
+ basePath: '/connect/health/generic/' + config.urlParams.context + '',
1089
+ method: 'get',
1090
+ body: null,
1091
+ urlParams: config.urlParams,
1092
+ queryParams: config.queryParams,
1093
+ headers,
1094
+ priority: 'normal',
1095
+ };
1096
+ }
1097
+
1098
+ const genericConnectApiGET_ConfigPropertyNames = {
1099
+ displayName: 'genericConnectApiGET',
1100
+ parameters: {
1101
+ required: ['context'],
1102
+ optional: ['fields', 'limitBy', 'offset', 'searchTerm', 'sortBy', 'sortOrder', 'values']
1103
+ }
1104
+ };
1105
+ function createResourceParams$6(config) {
1106
+ const resourceParams = {
1107
+ urlParams: {
1108
+ context: config.context
1109
+ },
1110
+ queryParams: {
1111
+ fields: config.fields, limitBy: config.limitBy, offset: config.offset, searchTerm: config.searchTerm, sortBy: config.sortBy, sortOrder: config.sortOrder, values: config.values
1112
+ }
1113
+ };
1114
+ return resourceParams;
1115
+ }
1116
+ function keyBuilder$8(luvio, config) {
1117
+ const resourceParams = createResourceParams$6(config);
1118
+ return keyBuilder$9(luvio, resourceParams);
1119
+ }
1120
+ function typeCheckConfig$6(untrustedConfig) {
1121
+ const config = {};
1122
+ const untrustedConfig_context = untrustedConfig.context;
1123
+ if (typeof untrustedConfig_context === 'string') {
1124
+ config.context = untrustedConfig_context;
1125
+ }
1126
+ const untrustedConfig_fields = untrustedConfig.fields;
1127
+ if (ArrayIsArray$1(untrustedConfig_fields)) {
1128
+ const untrustedConfig_fields_array = [];
1129
+ for (let i = 0, arrayLength = untrustedConfig_fields.length; i < arrayLength; i++) {
1130
+ const untrustedConfig_fields_item = untrustedConfig_fields[i];
1131
+ if (typeof untrustedConfig_fields_item === 'string') {
1132
+ untrustedConfig_fields_array.push(untrustedConfig_fields_item);
1133
+ }
1134
+ }
1135
+ config.fields = untrustedConfig_fields_array;
1136
+ }
1137
+ const untrustedConfig_limitBy = untrustedConfig.limitBy;
1138
+ if (typeof untrustedConfig_limitBy === 'string') {
1139
+ config.limitBy = untrustedConfig_limitBy;
1140
+ }
1141
+ const untrustedConfig_offset = untrustedConfig.offset;
1142
+ if (typeof untrustedConfig_offset === 'string') {
1143
+ config.offset = untrustedConfig_offset;
1144
+ }
1145
+ const untrustedConfig_searchTerm = untrustedConfig.searchTerm;
1146
+ if (typeof untrustedConfig_searchTerm === 'string') {
1147
+ config.searchTerm = untrustedConfig_searchTerm;
1148
+ }
1149
+ const untrustedConfig_sortBy = untrustedConfig.sortBy;
1150
+ if (typeof untrustedConfig_sortBy === 'string') {
1151
+ config.sortBy = untrustedConfig_sortBy;
1152
+ }
1153
+ const untrustedConfig_sortOrder = untrustedConfig.sortOrder;
1154
+ if (typeof untrustedConfig_sortOrder === 'string') {
1155
+ config.sortOrder = untrustedConfig_sortOrder;
1156
+ }
1157
+ const untrustedConfig_values = untrustedConfig.values;
1158
+ if (ArrayIsArray$1(untrustedConfig_values)) {
1159
+ const untrustedConfig_values_array = [];
1160
+ for (let i = 0, arrayLength = untrustedConfig_values.length; i < arrayLength; i++) {
1161
+ const untrustedConfig_values_item = untrustedConfig_values[i];
1162
+ if (typeof untrustedConfig_values_item === 'string') {
1163
+ untrustedConfig_values_array.push(untrustedConfig_values_item);
1164
+ }
1165
+ }
1166
+ config.values = untrustedConfig_values_array;
1167
+ }
1168
+ return config;
1169
+ }
1170
+ function validateAdapterConfig$6(untrustedConfig, configPropertyNames) {
1171
+ if (!untrustedIsObject(untrustedConfig)) {
1172
+ return null;
1173
+ }
1174
+ if (process.env.NODE_ENV !== 'production') {
1175
+ validateConfig(untrustedConfig, configPropertyNames);
1176
+ }
1177
+ const config = typeCheckConfig$6(untrustedConfig);
1178
+ if (!areRequiredParametersPresent(config, configPropertyNames)) {
1179
+ return null;
1180
+ }
1181
+ return config;
1182
+ }
1183
+ function adapterFragment$2(luvio, config) {
1184
+ createResourceParams$6(config);
1185
+ return select$c();
1186
+ }
1187
+ function onFetchResponseSuccess$2(luvio, config, resourceParams, response) {
1188
+ const snapshot = ingestSuccess$6(luvio, resourceParams, response, {
1189
+ config,
1190
+ resolve: () => buildNetworkSnapshot$6(luvio, config, snapshotRefreshOptions)
1191
+ });
1192
+ return luvio.storeBroadcast().then(() => snapshot);
1193
+ }
1194
+ function onFetchResponseError$2(luvio, config, resourceParams, response) {
1195
+ const snapshot = ingestError$2(luvio, resourceParams, response, {
1196
+ config,
1197
+ resolve: () => buildNetworkSnapshot$6(luvio, config, snapshotRefreshOptions)
1198
+ });
1199
+ return luvio.storeBroadcast().then(() => snapshot);
1200
+ }
1201
+ function buildNetworkSnapshot$6(luvio, config, options) {
1202
+ const resourceParams = createResourceParams$6(config);
1203
+ const request = createResourceRequest$6(resourceParams);
1204
+ return luvio.dispatchResourceRequest(request, options)
1205
+ .then((response) => {
1206
+ return luvio.handleSuccessResponse(() => onFetchResponseSuccess$2(luvio, config, resourceParams, response), () => getResponseCacheKeys$6(luvio, resourceParams, response.body));
1207
+ }, (response) => {
1208
+ return luvio.handleErrorResponse(() => onFetchResponseError$2(luvio, config, resourceParams, response));
1209
+ });
1210
+ }
1211
+ function buildNetworkSnapshotCachePolicy$2(context, coercedAdapterRequestContext) {
1212
+ const { luvio, config } = context;
1213
+ const { networkPriority, requestCorrelator, eventObservers } = coercedAdapterRequestContext;
1214
+ const dispatchOptions = {
1215
+ resourceRequestContext: {
1216
+ requestCorrelator,
1217
+ luvioRequestMethod: undefined,
1218
+ },
1219
+ eventObservers
1220
+ };
1221
+ if (networkPriority !== 'normal') {
1222
+ dispatchOptions.overrides = {
1223
+ priority: networkPriority
1224
+ };
1225
+ }
1226
+ return buildNetworkSnapshot$6(luvio, config, dispatchOptions);
1227
+ }
1228
+ function buildCachedSnapshotCachePolicy$2(context, storeLookup) {
1229
+ const { luvio, config } = context;
1230
+ const selector = {
1231
+ recordId: keyBuilder$8(luvio, config),
1232
+ node: adapterFragment$2(luvio, config),
1233
+ variables: {},
1234
+ };
1235
+ const cacheSnapshot = storeLookup(selector, {
1236
+ config,
1237
+ resolve: () => buildNetworkSnapshot$6(luvio, config, snapshotRefreshOptions)
1238
+ });
1239
+ return cacheSnapshot;
1240
+ }
1241
+ const genericConnectApiGETAdapterFactory = (luvio) => function healthcloud__genericConnectApiGET(untrustedConfig, requestContext) {
1242
+ const config = validateAdapterConfig$6(untrustedConfig, genericConnectApiGET_ConfigPropertyNames);
1243
+ // Invalid or incomplete config
1244
+ if (config === null) {
1245
+ return null;
1246
+ }
1247
+ return luvio.applyCachePolicy((requestContext || {}), { config, luvio }, // BuildSnapshotContext
1248
+ buildCachedSnapshotCachePolicy$2, buildNetworkSnapshotCachePolicy$2);
1249
+ };
1250
+
1251
+ function validate$d(obj, path = 'GenericConnectApiPOSTInputRepresentation') {
1252
+ const v_error = (() => {
1253
+ if (typeof obj !== 'object' || ArrayIsArray(obj) || obj === null) {
1254
+ return new TypeError('Expected "object" but received "' + typeof obj + '" (at "' + path + '")');
1255
+ }
1256
+ const obj_recordList = obj.recordList;
1257
+ const path_recordList = path + '.recordList';
1258
+ if (typeof obj_recordList !== 'object' || ArrayIsArray(obj_recordList) || obj_recordList === null) {
1259
+ return new TypeError('Expected "object" but received "' + typeof obj_recordList + '" (at "' + path_recordList + '")');
1260
+ }
1261
+ const obj_recordList_keys = ObjectKeys(obj_recordList);
1262
+ for (let i = 0; i < obj_recordList_keys.length; i++) {
1263
+ const key = obj_recordList_keys[i];
1264
+ const obj_recordList_prop = obj_recordList[key];
1265
+ const path_recordList_prop = path_recordList + '["' + key + '"]';
1266
+ if (!ArrayIsArray(obj_recordList_prop)) {
1267
+ return new TypeError('Expected "array" but received "' + typeof obj_recordList_prop + '" (at "' + path_recordList_prop + '")');
1268
+ }
1269
+ for (let i = 0; i < obj_recordList_prop.length; i++) {
1270
+ const obj_recordList_prop_item = obj_recordList_prop[i];
1271
+ const path_recordList_prop_item = path_recordList_prop + '[' + i + ']';
1272
+ if (obj_recordList_prop_item === undefined) {
1273
+ return new TypeError('Expected "defined" but received "' + typeof obj_recordList_prop_item + '" (at "' + path_recordList_prop_item + '")');
1274
+ }
1275
+ }
1276
+ }
1277
+ })();
1278
+ return v_error === undefined ? null : v_error;
1279
+ }
1280
+
1281
+ const VERSION$5 = "7b3913515d78cf7f964adb4e7095e8a5";
1282
+ function validate$c(obj, path = 'GenericConnectApiPOSTOutputRepresentation') {
1283
+ const v_error = (() => {
1284
+ if (typeof obj !== 'object' || ArrayIsArray(obj) || obj === null) {
1285
+ return new TypeError('Expected "object" but received "' + typeof obj + '" (at "' + path + '")');
1286
+ }
1287
+ if (obj.code !== undefined) {
1288
+ const obj_code = obj.code;
1289
+ const path_code = path + '.code';
1290
+ if (typeof obj_code !== 'string') {
1291
+ return new TypeError('Expected "string" but received "' + typeof obj_code + '" (at "' + path_code + '")');
1292
+ }
1293
+ }
1294
+ if (obj.createdIds !== undefined) {
1295
+ const obj_createdIds = obj.createdIds;
1296
+ const path_createdIds = path + '.createdIds';
1297
+ if (typeof obj_createdIds !== 'object' || ArrayIsArray(obj_createdIds) || obj_createdIds === null) {
1298
+ return new TypeError('Expected "object" but received "' + typeof obj_createdIds + '" (at "' + path_createdIds + '")');
1299
+ }
1300
+ const obj_createdIds_keys = ObjectKeys(obj_createdIds);
1301
+ for (let i = 0; i < obj_createdIds_keys.length; i++) {
1302
+ const key = obj_createdIds_keys[i];
1303
+ const obj_createdIds_prop = obj_createdIds[key];
1304
+ const path_createdIds_prop = path_createdIds + '["' + key + '"]';
1305
+ if (!ArrayIsArray(obj_createdIds_prop)) {
1306
+ return new TypeError('Expected "array" but received "' + typeof obj_createdIds_prop + '" (at "' + path_createdIds_prop + '")');
1307
+ }
1308
+ for (let i = 0; i < obj_createdIds_prop.length; i++) {
1309
+ const obj_createdIds_prop_item = obj_createdIds_prop[i];
1310
+ const path_createdIds_prop_item = path_createdIds_prop + '[' + i + ']';
1311
+ if (obj_createdIds_prop_item === undefined) {
1312
+ return new TypeError('Expected "defined" but received "' + typeof obj_createdIds_prop_item + '" (at "' + path_createdIds_prop_item + '")');
1313
+ }
1314
+ }
1315
+ }
1316
+ }
1317
+ const obj_message = obj.message;
1318
+ const path_message = path + '.message';
1319
+ if (typeof obj_message !== 'string') {
1320
+ return new TypeError('Expected "string" but received "' + typeof obj_message + '" (at "' + path_message + '")');
1321
+ }
1322
+ })();
1323
+ return v_error === undefined ? null : v_error;
1324
+ }
1325
+ const RepresentationType$5 = 'GenericConnectApiPOSTOutputRepresentation';
1326
+ function keyBuilder$7(luvio, config) {
1327
+ return keyPrefix + '::' + RepresentationType$5 + ':' + config.isSuccess;
1328
+ }
1329
+ function keyBuilderFromType$3(luvio, object) {
1330
+ const keyParams = {
1331
+ isSuccess: object.message
1332
+ };
1333
+ return keyBuilder$7(luvio, keyParams);
1334
+ }
1335
+ function normalize$5(input, existing, path, luvio, store, timestamp) {
1336
+ return input;
1337
+ }
1338
+ const select$b = function GenericConnectApiPOSTOutputRepresentationSelect() {
1339
+ return {
1340
+ kind: 'Fragment',
1341
+ version: VERSION$5,
1342
+ private: [],
1343
+ selections: [
1344
+ {
1345
+ name: 'code',
1346
+ kind: 'Scalar',
1347
+ required: false
1348
+ },
1349
+ {
1350
+ name: 'createdIds',
1351
+ kind: 'Object',
1352
+ // any
1353
+ },
1354
+ {
1355
+ name: 'message',
1356
+ kind: 'Scalar'
1357
+ }
1358
+ ]
1359
+ };
1360
+ };
1361
+ function equals$5(existing, incoming) {
1362
+ const existing_code = existing.code;
1363
+ const incoming_code = incoming.code;
1364
+ // if at least one of these optionals is defined
1365
+ if (existing_code !== undefined || incoming_code !== undefined) {
1366
+ // if one of these is not defined we know the other is defined and therefore
1367
+ // not equal
1368
+ if (existing_code === undefined || incoming_code === undefined) {
1369
+ return false;
1370
+ }
1371
+ if (!(existing_code === incoming_code)) {
1372
+ return false;
1373
+ }
1374
+ }
1375
+ const existing_message = existing.message;
1376
+ const incoming_message = incoming.message;
1377
+ if (!(existing_message === incoming_message)) {
1378
+ return false;
1379
+ }
1380
+ const existing_createdIds = existing.createdIds;
1381
+ const incoming_createdIds = incoming.createdIds;
1382
+ // if at least one of these optionals is defined
1383
+ if (existing_createdIds !== undefined || incoming_createdIds !== undefined) {
1384
+ // if one of these is not defined we know the other is defined and therefore
1385
+ // not equal
1386
+ if (existing_createdIds === undefined || incoming_createdIds === undefined) {
1387
+ return false;
1388
+ }
1389
+ const equals_createdIds_props = equalsObject(existing_createdIds, incoming_createdIds, (existing_createdIds_prop, incoming_createdIds_prop) => {
1390
+ const equals_createdIds_items = equalsArray(existing_createdIds_prop, incoming_createdIds_prop, (existing_createdIds_prop_item, incoming_createdIds_prop_item) => {
1391
+ if (JSONStringify(incoming_createdIds_prop_item) !== JSONStringify(existing_createdIds_prop_item)) {
1392
+ return false;
1393
+ }
1394
+ });
1395
+ if (equals_createdIds_items === false) {
1396
+ return false;
1397
+ }
1398
+ });
1399
+ if (equals_createdIds_props === false) {
1400
+ return false;
1401
+ }
1402
+ }
1403
+ return true;
1404
+ }
1405
+ const ingest$5 = function GenericConnectApiPOSTOutputRepresentationIngest(input, path, luvio, store, timestamp) {
1406
+ if (process.env.NODE_ENV !== 'production') {
1407
+ const validateError = validate$c(input);
1408
+ if (validateError !== null) {
1409
+ throw validateError;
1410
+ }
1411
+ }
1412
+ const key = keyBuilderFromType$3(luvio, input);
1413
+ const existingRecord = store.readEntry(key);
1414
+ const ttlToUse = path.ttl !== undefined ? path.ttl : 500;
1415
+ let incomingRecord = normalize$5(input, store.readEntry(key), {
1416
+ fullPath: key,
1417
+ parent: path.parent,
1418
+ propertyName: path.propertyName,
1419
+ ttl: ttlToUse
1420
+ });
1421
+ if (existingRecord === undefined || equals$5(existingRecord, incomingRecord) === false) {
1422
+ luvio.storePublish(key, incomingRecord);
1423
+ }
1424
+ if (ttlToUse !== undefined) {
1425
+ const storeMetadataParams = {
1426
+ ttl: ttlToUse,
1427
+ namespace: "healthcloud",
1428
+ version: VERSION$5,
1429
+ representationName: RepresentationType$5,
1430
+ };
1431
+ luvio.publishStoreMetadata(key, storeMetadataParams);
1432
+ }
1433
+ return createLink(key);
1434
+ };
1435
+ function getTypeCacheKeys$5(luvio, input, fullPathFactory) {
1436
+ const rootKeySet = new StoreKeyMap();
1437
+ // root cache key (uses fullPathFactory if keyBuilderFromType isn't defined)
1438
+ const rootKey = keyBuilderFromType$3(luvio, input);
1439
+ rootKeySet.set(rootKey, {
1440
+ namespace: keyPrefix,
1441
+ representationName: RepresentationType$5,
1442
+ mergeable: false
1443
+ });
1444
+ return rootKeySet;
1445
+ }
1446
+
1447
+ function select$a(luvio, params) {
1448
+ return select$b();
1449
+ }
1450
+ function getResponseCacheKeys$5(luvio, resourceParams, response) {
1451
+ return getTypeCacheKeys$5(luvio, response);
1452
+ }
1453
+ function ingestSuccess$5(luvio, resourceParams, response) {
1454
+ const { body } = response;
1455
+ const key = keyBuilderFromType$3(luvio, body);
1456
+ luvio.storeIngest(key, ingest$5, body);
1457
+ const snapshot = luvio.storeLookup({
1458
+ recordId: key,
1459
+ node: select$a(),
1460
+ variables: {},
1461
+ });
1462
+ if (process.env.NODE_ENV !== 'production') {
1463
+ if (snapshot.state !== 'Fulfilled') {
1464
+ throw new Error('Invalid network response. Expected resource response to result in Fulfilled snapshot');
1465
+ }
1466
+ }
1467
+ return snapshot;
1468
+ }
1469
+ function createResourceRequest$5(config) {
1470
+ const headers = {};
1471
+ return {
1472
+ baseUri: '/services/data/v58.0',
1473
+ basePath: '/connect/health/generic/' + config.urlParams.context + '',
1474
+ method: 'post',
1475
+ body: config.body,
1476
+ urlParams: config.urlParams,
1477
+ queryParams: {},
1478
+ headers,
1479
+ priority: 'normal',
1480
+ };
1481
+ }
1482
+
1483
+ const genericConnectApiPOST_ConfigPropertyNames = {
1484
+ displayName: 'genericConnectApiPOST',
1485
+ parameters: {
1486
+ required: ['context', 'GenericConnectApiPOSTInput'],
1487
+ optional: []
1488
+ }
1489
+ };
1490
+ function createResourceParams$5(config) {
1491
+ const resourceParams = {
1492
+ urlParams: {
1493
+ context: config.context
1494
+ },
1495
+ body: {
1496
+ GenericConnectApiPOSTInput: config.GenericConnectApiPOSTInput
1497
+ }
1498
+ };
1499
+ return resourceParams;
1500
+ }
1501
+ function typeCheckConfig$5(untrustedConfig) {
1502
+ const config = {};
1503
+ const untrustedConfig_context = untrustedConfig.context;
1504
+ if (typeof untrustedConfig_context === 'string') {
1505
+ config.context = untrustedConfig_context;
1506
+ }
1507
+ const untrustedConfig_GenericConnectApiPOSTInput = untrustedConfig.GenericConnectApiPOSTInput;
1508
+ const referenceGenericConnectApiPOSTInputRepresentationValidationError = validate$d(untrustedConfig_GenericConnectApiPOSTInput);
1509
+ if (referenceGenericConnectApiPOSTInputRepresentationValidationError === null) {
1510
+ config.GenericConnectApiPOSTInput = untrustedConfig_GenericConnectApiPOSTInput;
1511
+ }
1512
+ return config;
1513
+ }
1514
+ function validateAdapterConfig$5(untrustedConfig, configPropertyNames) {
1515
+ if (!untrustedIsObject(untrustedConfig)) {
1516
+ return null;
1517
+ }
1518
+ if (process.env.NODE_ENV !== 'production') {
1519
+ validateConfig(untrustedConfig, configPropertyNames);
1520
+ }
1521
+ const config = typeCheckConfig$5(untrustedConfig);
1522
+ if (!areRequiredParametersPresent(config, configPropertyNames)) {
1523
+ return null;
1524
+ }
1525
+ return config;
1526
+ }
1527
+ function buildNetworkSnapshot$5(luvio, config, options) {
1528
+ const resourceParams = createResourceParams$5(config);
1529
+ const request = createResourceRequest$5(resourceParams);
1530
+ return luvio.dispatchResourceRequest(request, options)
1531
+ .then((response) => {
1532
+ return luvio.handleSuccessResponse(() => {
1533
+ const snapshot = ingestSuccess$5(luvio, resourceParams, response);
1534
+ return luvio.storeBroadcast().then(() => snapshot);
1535
+ }, () => getResponseCacheKeys$5(luvio, resourceParams, response.body));
1536
+ }, (response) => {
1537
+ deepFreeze$2(response);
1538
+ throw response;
1539
+ });
1540
+ }
1541
+ const genericConnectApiPOSTAdapterFactory = (luvio) => {
1542
+ return function genericConnectApiPOST(untrustedConfig) {
1543
+ const config = validateAdapterConfig$5(untrustedConfig, genericConnectApiPOST_ConfigPropertyNames);
1544
+ // Invalid or incomplete config
1545
+ if (config === null) {
1546
+ throw new Error('Invalid config for "genericConnectApiPOST"');
1547
+ }
1548
+ return buildNetworkSnapshot$5(luvio, config);
1549
+ };
1550
+ };
1551
+
1552
+ function validate$b(obj, path = 'FetchEntityDetailsSearchConditionInputRepresentation') {
1553
+ const v_error = (() => {
1554
+ if (typeof obj !== 'object' || ArrayIsArray(obj) || obj === null) {
1555
+ return new TypeError('Expected "object" but received "' + typeof obj + '" (at "' + path + '")');
1556
+ }
1557
+ if (obj.field !== undefined) {
1558
+ const obj_field = obj.field;
1559
+ const path_field = path + '.field';
1560
+ if (typeof obj_field !== 'string') {
1561
+ return new TypeError('Expected "string" but received "' + typeof obj_field + '" (at "' + path_field + '")');
1562
+ }
1563
+ }
1564
+ if (obj.operand !== undefined) {
1565
+ const obj_operand = obj.operand;
1566
+ const path_operand = path + '.operand';
1567
+ if (typeof obj_operand !== 'string') {
1568
+ return new TypeError('Expected "string" but received "' + typeof obj_operand + '" (at "' + path_operand + '")');
1569
+ }
1570
+ }
1571
+ if (obj.value !== undefined) {
1572
+ const obj_value = obj.value;
1573
+ const path_value = path + '.value';
1574
+ if (obj_value === undefined) {
1575
+ return new TypeError('Expected "defined" but received "' + typeof obj_value + '" (at "' + path_value + '")');
1576
+ }
1577
+ }
1578
+ })();
1579
+ return v_error === undefined ? null : v_error;
1580
+ }
1581
+
1582
+ function validate$a(obj, path = 'FetchEntityDetailsInputRepresentation') {
1583
+ const v_error = (() => {
1584
+ if (typeof obj !== 'object' || ArrayIsArray(obj) || obj === null) {
1585
+ return new TypeError('Expected "object" but received "' + typeof obj + '" (at "' + path + '")');
1586
+ }
1587
+ if (obj.elevatedMode !== undefined) {
1588
+ const obj_elevatedMode = obj.elevatedMode;
1589
+ const path_elevatedMode = path + '.elevatedMode';
1590
+ if (typeof obj_elevatedMode !== 'boolean') {
1591
+ return new TypeError('Expected "boolean" but received "' + typeof obj_elevatedMode + '" (at "' + path_elevatedMode + '")');
1592
+ }
1593
+ }
1594
+ const obj_entityApiName = obj.entityApiName;
1595
+ const path_entityApiName = path + '.entityApiName';
1596
+ if (typeof obj_entityApiName !== 'string') {
1597
+ return new TypeError('Expected "string" but received "' + typeof obj_entityApiName + '" (at "' + path_entityApiName + '")');
1598
+ }
1599
+ const obj_filterLogic = obj.filterLogic;
1600
+ const path_filterLogic = path + '.filterLogic';
1601
+ if (typeof obj_filterLogic !== 'string') {
1602
+ return new TypeError('Expected "string" but received "' + typeof obj_filterLogic + '" (at "' + path_filterLogic + '")');
1603
+ }
1604
+ const obj_queryFieldsList = obj.queryFieldsList;
1605
+ const path_queryFieldsList = path + '.queryFieldsList';
1606
+ if (!ArrayIsArray(obj_queryFieldsList)) {
1607
+ return new TypeError('Expected "array" but received "' + typeof obj_queryFieldsList + '" (at "' + path_queryFieldsList + '")');
1608
+ }
1609
+ for (let i = 0; i < obj_queryFieldsList.length; i++) {
1610
+ const obj_queryFieldsList_item = obj_queryFieldsList[i];
1611
+ const path_queryFieldsList_item = path_queryFieldsList + '[' + i + ']';
1612
+ if (typeof obj_queryFieldsList_item !== 'string') {
1613
+ return new TypeError('Expected "string" but received "' + typeof obj_queryFieldsList_item + '" (at "' + path_queryFieldsList_item + '")');
1614
+ }
1615
+ }
1616
+ if (obj.whereConditionList !== undefined) {
1617
+ const obj_whereConditionList = obj.whereConditionList;
1618
+ const path_whereConditionList = path + '.whereConditionList';
1619
+ if (!ArrayIsArray(obj_whereConditionList)) {
1620
+ return new TypeError('Expected "array" but received "' + typeof obj_whereConditionList + '" (at "' + path_whereConditionList + '")');
1621
+ }
1622
+ for (let i = 0; i < obj_whereConditionList.length; i++) {
1623
+ const obj_whereConditionList_item = obj_whereConditionList[i];
1624
+ const path_whereConditionList_item = path_whereConditionList + '[' + i + ']';
1625
+ const referencepath_whereConditionList_itemValidationError = validate$b(obj_whereConditionList_item, path_whereConditionList_item);
1626
+ if (referencepath_whereConditionList_itemValidationError !== null) {
1627
+ let message = 'Object doesn\'t match FetchEntityDetailsSearchConditionInputRepresentation (at "' + path_whereConditionList_item + '")\n';
1628
+ message += referencepath_whereConditionList_itemValidationError.message.split('\n').map((line) => '\t' + line).join('\n');
1629
+ return new TypeError(message);
1630
+ }
1631
+ }
1632
+ }
1633
+ })();
1634
+ return v_error === undefined ? null : v_error;
1635
+ }
1636
+
1637
+ const VERSION$4 = "c0474ec7befad9e93c213556f8e55595";
1638
+ function validate$9(obj, path = 'FetchEntityDetailsOutputRepresentation') {
1639
+ const v_error = (() => {
1640
+ if (typeof obj !== 'object' || ArrayIsArray(obj) || obj === null) {
1641
+ return new TypeError('Expected "object" but received "' + typeof obj + '" (at "' + path + '")');
1642
+ }
1643
+ const obj_code = obj.code;
1644
+ const path_code = path + '.code';
1645
+ if (typeof obj_code !== 'string') {
1646
+ return new TypeError('Expected "string" but received "' + typeof obj_code + '" (at "' + path_code + '")');
1647
+ }
1648
+ const obj_fieldsToValueMap = obj.fieldsToValueMap;
1649
+ const path_fieldsToValueMap = path + '.fieldsToValueMap';
1650
+ if (typeof obj_fieldsToValueMap !== 'object' || ArrayIsArray(obj_fieldsToValueMap) || obj_fieldsToValueMap === null) {
1651
+ return new TypeError('Expected "object" but received "' + typeof obj_fieldsToValueMap + '" (at "' + path_fieldsToValueMap + '")');
1652
+ }
1653
+ const obj_fieldsToValueMap_keys = ObjectKeys(obj_fieldsToValueMap);
1654
+ for (let i = 0; i < obj_fieldsToValueMap_keys.length; i++) {
1655
+ const key = obj_fieldsToValueMap_keys[i];
1656
+ const obj_fieldsToValueMap_prop = obj_fieldsToValueMap[key];
1657
+ const path_fieldsToValueMap_prop = path_fieldsToValueMap + '["' + key + '"]';
1658
+ if (typeof obj_fieldsToValueMap_prop !== 'object' || ArrayIsArray(obj_fieldsToValueMap_prop) || obj_fieldsToValueMap_prop === null) {
1659
+ return new TypeError('Expected "object" but received "' + typeof obj_fieldsToValueMap_prop + '" (at "' + path_fieldsToValueMap_prop + '")');
1660
+ }
1661
+ const obj_fieldsToValueMap_prop_keys = ObjectKeys(obj_fieldsToValueMap_prop);
1662
+ for (let i = 0; i < obj_fieldsToValueMap_prop_keys.length; i++) {
1663
+ const key = obj_fieldsToValueMap_prop_keys[i];
1664
+ const obj_fieldsToValueMap_prop_prop = obj_fieldsToValueMap_prop[key];
1665
+ const path_fieldsToValueMap_prop_prop = path_fieldsToValueMap_prop + '["' + key + '"]';
1666
+ if (obj_fieldsToValueMap_prop_prop === undefined) {
1667
+ return new TypeError('Expected "defined" but received "' + typeof obj_fieldsToValueMap_prop_prop + '" (at "' + path_fieldsToValueMap_prop_prop + '")');
1668
+ }
1669
+ }
1670
+ }
1671
+ const obj_isSuccess = obj.isSuccess;
1672
+ const path_isSuccess = path + '.isSuccess';
1673
+ if (typeof obj_isSuccess !== 'boolean') {
1674
+ return new TypeError('Expected "boolean" but received "' + typeof obj_isSuccess + '" (at "' + path_isSuccess + '")');
1675
+ }
1676
+ if (obj.message !== undefined) {
1677
+ const obj_message = obj.message;
1678
+ const path_message = path + '.message';
1679
+ let obj_message_union0 = null;
1680
+ const obj_message_union0_error = (() => {
1681
+ if (typeof obj_message !== 'string') {
1682
+ return new TypeError('Expected "string" but received "' + typeof obj_message + '" (at "' + path_message + '")');
1683
+ }
1684
+ })();
1685
+ if (obj_message_union0_error != null) {
1686
+ obj_message_union0 = obj_message_union0_error.message;
1687
+ }
1688
+ let obj_message_union1 = null;
1689
+ const obj_message_union1_error = (() => {
1690
+ if (obj_message !== null) {
1691
+ return new TypeError('Expected "null" but received "' + typeof obj_message + '" (at "' + path_message + '")');
1692
+ }
1693
+ })();
1694
+ if (obj_message_union1_error != null) {
1695
+ obj_message_union1 = obj_message_union1_error.message;
1696
+ }
1697
+ if (obj_message_union0 && obj_message_union1) {
1698
+ let message = 'Object doesn\'t match union (at "' + path_message + '")';
1699
+ message += '\n' + obj_message_union0.split('\n').map((line) => '\t' + line).join('\n');
1700
+ message += '\n' + obj_message_union1.split('\n').map((line) => '\t' + line).join('\n');
1701
+ return new TypeError(message);
1702
+ }
1703
+ }
1704
+ })();
1705
+ return v_error === undefined ? null : v_error;
1706
+ }
1707
+ const RepresentationType$4 = 'FetchEntityDetailsOutputRepresentation';
1708
+ function normalize$4(input, existing, path, luvio, store, timestamp) {
1709
+ return input;
1710
+ }
1711
+ const select$9 = function FetchEntityDetailsOutputRepresentationSelect() {
1712
+ return {
1713
+ kind: 'Fragment',
1714
+ version: VERSION$4,
1715
+ private: [],
1716
+ opaque: true
1717
+ };
1718
+ };
1719
+ function equals$4(existing, incoming) {
1720
+ if (JSONStringify(incoming) !== JSONStringify(existing)) {
1721
+ return false;
1722
+ }
1723
+ return true;
1724
+ }
1725
+ function deepFreeze(input) {
1726
+ const input_fieldsToValueMap = input.fieldsToValueMap;
1727
+ const input_fieldsToValueMap_keys = Object.keys(input_fieldsToValueMap);
1728
+ const input_fieldsToValueMap_length = input_fieldsToValueMap_keys.length;
1729
+ for (let i = 0; i < input_fieldsToValueMap_length; i++) {
1730
+ const key = input_fieldsToValueMap_keys[i];
1731
+ const input_fieldsToValueMap_prop = input_fieldsToValueMap[key];
1732
+ const input_fieldsToValueMap_prop_keys = Object.keys(input_fieldsToValueMap_prop);
1733
+ const input_fieldsToValueMap_prop_length = input_fieldsToValueMap_prop_keys.length;
1734
+ for (let i = 0; i < input_fieldsToValueMap_prop_length; i++) {
1735
+ const key = input_fieldsToValueMap_prop_keys[i];
1736
+ const input_fieldsToValueMap_prop_prop = input_fieldsToValueMap_prop[key];
1737
+ deepFreeze$2(input_fieldsToValueMap_prop_prop);
1738
+ }
1739
+ ObjectFreeze(input_fieldsToValueMap_prop);
1740
+ }
1741
+ ObjectFreeze(input_fieldsToValueMap);
1742
+ ObjectFreeze(input);
1743
+ }
1744
+ const ingest$4 = function FetchEntityDetailsOutputRepresentationIngest(input, path, luvio, store, timestamp) {
1745
+ if (process.env.NODE_ENV !== 'production') {
1746
+ const validateError = validate$9(input);
1747
+ if (validateError !== null) {
1748
+ throw validateError;
1749
+ }
1750
+ }
1751
+ const key = path.fullPath;
1752
+ const existingRecord = store.readEntry(key);
1753
+ const ttlToUse = path.ttl !== undefined ? path.ttl : 500;
1754
+ let incomingRecord = normalize$4(input, store.readEntry(key), {
1755
+ fullPath: key,
1756
+ parent: path.parent,
1757
+ propertyName: path.propertyName,
1758
+ ttl: ttlToUse
1759
+ });
1760
+ deepFreeze(input);
1761
+ if (existingRecord === undefined || equals$4(existingRecord, incomingRecord) === false) {
1762
+ luvio.storePublish(key, incomingRecord);
1763
+ }
1764
+ if (ttlToUse !== undefined) {
1765
+ const storeMetadataParams = {
1766
+ ttl: ttlToUse,
1767
+ namespace: "healthcloud",
1768
+ version: VERSION$4,
1769
+ representationName: RepresentationType$4,
1770
+ };
1771
+ luvio.publishStoreMetadata(key, storeMetadataParams);
1772
+ }
1773
+ return createLink(key);
1774
+ };
1775
+ function getTypeCacheKeys$4(luvio, input, fullPathFactory) {
1776
+ const rootKeySet = new StoreKeyMap();
1777
+ // root cache key (uses fullPathFactory if keyBuilderFromType isn't defined)
1778
+ const rootKey = fullPathFactory();
1779
+ rootKeySet.set(rootKey, {
1780
+ namespace: keyPrefix,
1781
+ representationName: RepresentationType$4,
1782
+ mergeable: false
1783
+ });
1784
+ return rootKeySet;
1785
+ }
1786
+
1787
+ function select$8(luvio, params) {
1788
+ return select$9();
1789
+ }
1790
+ function keyBuilder$6(luvio, params) {
1791
+ return keyPrefix + '::FetchEntityDetailsOutputRepresentation:(' + (params.body.fetchEntityDetailsInputParam.elevatedMode === undefined ? 'fetchEntityDetailsInputParam.elevatedMode' : 'fetchEntityDetailsInputParam.elevatedMode:' + params.body.fetchEntityDetailsInputParam.elevatedMode) + '::' + 'fetchEntityDetailsInputParam.entityApiName:' + params.body.fetchEntityDetailsInputParam.entityApiName + '::' + 'fetchEntityDetailsInputParam.filterLogic:' + params.body.fetchEntityDetailsInputParam.filterLogic + '::' + 'fetchEntityDetailsInputParam.queryFieldsList:' + params.body.fetchEntityDetailsInputParam.queryFieldsList + '::' + (params.body.fetchEntityDetailsInputParam.whereConditionList === undefined ? 'fetchEntityDetailsInputParam.whereConditionList' : 'fetchEntityDetailsInputParam.whereConditionList:' + params.body.fetchEntityDetailsInputParam.whereConditionList) + ')';
1792
+ }
1793
+ function getResponseCacheKeys$4(luvio, resourceParams, response) {
1794
+ return getTypeCacheKeys$4(luvio, response, () => keyBuilder$6(luvio, resourceParams));
1795
+ }
1796
+ function ingestSuccess$4(luvio, resourceParams, response, snapshotRefresh) {
1797
+ const { body } = response;
1798
+ const key = keyBuilder$6(luvio, resourceParams);
1799
+ luvio.storeIngest(key, ingest$4, body);
1800
+ const snapshot = luvio.storeLookup({
1801
+ recordId: key,
1802
+ node: select$8(),
1803
+ variables: {},
1804
+ }, snapshotRefresh);
1805
+ if (process.env.NODE_ENV !== 'production') {
1806
+ if (snapshot.state !== 'Fulfilled') {
1807
+ throw new Error('Invalid network response. Expected resource response to result in Fulfilled snapshot');
1808
+ }
1809
+ }
1810
+ return snapshot;
1811
+ }
1812
+ function ingestError$1(luvio, params, error, snapshotRefresh) {
1813
+ const key = keyBuilder$6(luvio, params);
1814
+ const errorSnapshot = luvio.errorSnapshot(error, snapshotRefresh);
1815
+ luvio.storeIngestError(key, errorSnapshot);
1816
+ return errorSnapshot;
1817
+ }
1818
+ function createResourceRequest$4(config) {
1819
+ const headers = {};
1820
+ return {
1821
+ baseUri: '/services/data/v58.0',
1822
+ basePath: '/connect/health/fetch-entity-details',
1823
+ method: 'post',
1824
+ body: config.body,
1825
+ urlParams: {},
1826
+ queryParams: {},
1827
+ headers,
1828
+ priority: 'normal',
1829
+ };
1830
+ }
1831
+
1832
+ const getEntityDetailsInfo_ConfigPropertyNames = {
1833
+ displayName: 'getEntityDetailsInfo',
1834
+ parameters: {
1835
+ required: ['fetchEntityDetailsInputParam'],
1836
+ optional: []
1837
+ }
1838
+ };
1839
+ function createResourceParams$4(config) {
1840
+ const resourceParams = {
1841
+ body: {
1842
+ fetchEntityDetailsInputParam: config.fetchEntityDetailsInputParam
1843
+ }
1844
+ };
1845
+ return resourceParams;
1846
+ }
1847
+ function keyBuilder$5(luvio, config) {
1848
+ const resourceParams = createResourceParams$4(config);
1849
+ return keyBuilder$6(luvio, resourceParams);
1850
+ }
1851
+ function typeCheckConfig$4(untrustedConfig) {
1852
+ const config = {};
1853
+ const untrustedConfig_fetchEntityDetailsInputParam = untrustedConfig.fetchEntityDetailsInputParam;
1854
+ const referenceFetchEntityDetailsInputRepresentationValidationError = validate$a(untrustedConfig_fetchEntityDetailsInputParam);
1855
+ if (referenceFetchEntityDetailsInputRepresentationValidationError === null) {
1856
+ config.fetchEntityDetailsInputParam = untrustedConfig_fetchEntityDetailsInputParam;
1857
+ }
1858
+ return config;
1859
+ }
1860
+ function validateAdapterConfig$4(untrustedConfig, configPropertyNames) {
1861
+ if (!untrustedIsObject(untrustedConfig)) {
1862
+ return null;
1863
+ }
1864
+ if (process.env.NODE_ENV !== 'production') {
1865
+ validateConfig(untrustedConfig, configPropertyNames);
1866
+ }
1867
+ const config = typeCheckConfig$4(untrustedConfig);
1868
+ if (!areRequiredParametersPresent(config, configPropertyNames)) {
1869
+ return null;
1870
+ }
1871
+ return config;
1872
+ }
1873
+ function adapterFragment$1(luvio, config) {
1874
+ createResourceParams$4(config);
1875
+ return select$8();
1876
+ }
1877
+ function onFetchResponseSuccess$1(luvio, config, resourceParams, response) {
1878
+ const snapshot = ingestSuccess$4(luvio, resourceParams, response, {
1879
+ config,
1880
+ resolve: () => buildNetworkSnapshot$4(luvio, config, snapshotRefreshOptions)
1881
+ });
1882
+ return luvio.storeBroadcast().then(() => snapshot);
1883
+ }
1884
+ function onFetchResponseError$1(luvio, config, resourceParams, response) {
1885
+ const snapshot = ingestError$1(luvio, resourceParams, response, {
1886
+ config,
1887
+ resolve: () => buildNetworkSnapshot$4(luvio, config, snapshotRefreshOptions)
1888
+ });
1889
+ return luvio.storeBroadcast().then(() => snapshot);
1890
+ }
1891
+ function buildNetworkSnapshot$4(luvio, config, options) {
1892
+ const resourceParams = createResourceParams$4(config);
1893
+ const request = createResourceRequest$4(resourceParams);
1894
+ return luvio.dispatchResourceRequest(request, options)
1895
+ .then((response) => {
1896
+ return luvio.handleSuccessResponse(() => onFetchResponseSuccess$1(luvio, config, resourceParams, response), () => getResponseCacheKeys$4(luvio, resourceParams, response.body));
1897
+ }, (response) => {
1898
+ return luvio.handleErrorResponse(() => onFetchResponseError$1(luvio, config, resourceParams, response));
1899
+ });
1900
+ }
1901
+ function buildNetworkSnapshotCachePolicy$1(context, coercedAdapterRequestContext) {
1902
+ const { luvio, config } = context;
1903
+ const { networkPriority, requestCorrelator, eventObservers } = coercedAdapterRequestContext;
1904
+ const dispatchOptions = {
1905
+ resourceRequestContext: {
1906
+ requestCorrelator,
1907
+ luvioRequestMethod: 'get',
1908
+ },
1909
+ eventObservers
1910
+ };
1911
+ if (networkPriority !== 'normal') {
1912
+ dispatchOptions.overrides = {
1913
+ priority: networkPriority
1914
+ };
1915
+ }
1916
+ return buildNetworkSnapshot$4(luvio, config, dispatchOptions);
1917
+ }
1918
+ function buildCachedSnapshotCachePolicy$1(context, storeLookup) {
1919
+ const { luvio, config } = context;
1920
+ const selector = {
1921
+ recordId: keyBuilder$5(luvio, config),
1922
+ node: adapterFragment$1(luvio, config),
1923
+ variables: {},
1924
+ };
1925
+ const cacheSnapshot = storeLookup(selector, {
1926
+ config,
1927
+ resolve: () => buildNetworkSnapshot$4(luvio, config, snapshotRefreshOptions)
1928
+ });
1929
+ return cacheSnapshot;
1930
+ }
1931
+ const getEntityDetailsInfoAdapterFactory = (luvio) => function healthcloud__getEntityDetailsInfo(untrustedConfig, requestContext) {
1932
+ const config = validateAdapterConfig$4(untrustedConfig, getEntityDetailsInfo_ConfigPropertyNames);
1933
+ // Invalid or incomplete config
1934
+ if (config === null) {
1935
+ return null;
1936
+ }
1937
+ return luvio.applyCachePolicy((requestContext || {}), { config, luvio }, // BuildSnapshotContext
1938
+ buildCachedSnapshotCachePolicy$1, buildNetworkSnapshotCachePolicy$1);
1939
+ };
1940
+
1941
+ function validate$8(obj, path = 'SearchConditionInputRepresentation') {
1942
+ const v_error = (() => {
1943
+ if (typeof obj !== 'object' || ArrayIsArray(obj) || obj === null) {
1944
+ return new TypeError('Expected "object" but received "' + typeof obj + '" (at "' + path + '")');
1945
+ }
1946
+ const obj_serviceTerritoryIds = obj.serviceTerritoryIds;
1947
+ const path_serviceTerritoryIds = path + '.serviceTerritoryIds';
1948
+ if (!ArrayIsArray(obj_serviceTerritoryIds)) {
1949
+ return new TypeError('Expected "array" but received "' + typeof obj_serviceTerritoryIds + '" (at "' + path_serviceTerritoryIds + '")');
1950
+ }
1951
+ for (let i = 0; i < obj_serviceTerritoryIds.length; i++) {
1952
+ const obj_serviceTerritoryIds_item = obj_serviceTerritoryIds[i];
1953
+ const path_serviceTerritoryIds_item = path_serviceTerritoryIds + '[' + i + ']';
1954
+ if (typeof obj_serviceTerritoryIds_item !== 'string') {
1955
+ return new TypeError('Expected "string" but received "' + typeof obj_serviceTerritoryIds_item + '" (at "' + path_serviceTerritoryIds_item + '")');
1956
+ }
1957
+ }
1958
+ const obj_workTypeId = obj.workTypeId;
1959
+ const path_workTypeId = path + '.workTypeId';
1960
+ if (typeof obj_workTypeId !== 'string') {
1961
+ return new TypeError('Expected "string" but received "' + typeof obj_workTypeId + '" (at "' + path_workTypeId + '")');
1962
+ }
1963
+ })();
1964
+ return v_error === undefined ? null : v_error;
1965
+ }
1966
+
1967
+ function validate$7(obj, path = 'GetSlotsInputRepresentation') {
1968
+ const v_error = (() => {
1969
+ if (typeof obj !== 'object' || ArrayIsArray(obj) || obj === null) {
1970
+ return new TypeError('Expected "object" but received "' + typeof obj + '" (at "' + path + '")');
1971
+ }
1972
+ if (obj.endTime !== undefined) {
1973
+ const obj_endTime = obj.endTime;
1974
+ const path_endTime = path + '.endTime';
1975
+ if (typeof obj_endTime !== 'string') {
1976
+ return new TypeError('Expected "string" but received "' + typeof obj_endTime + '" (at "' + path_endTime + '")');
1977
+ }
1978
+ }
1979
+ const obj_searchConditions = obj.searchConditions;
1980
+ const path_searchConditions = path + '.searchConditions';
1981
+ if (!ArrayIsArray(obj_searchConditions)) {
1982
+ return new TypeError('Expected "array" but received "' + typeof obj_searchConditions + '" (at "' + path_searchConditions + '")');
1983
+ }
1984
+ for (let i = 0; i < obj_searchConditions.length; i++) {
1985
+ const obj_searchConditions_item = obj_searchConditions[i];
1986
+ const path_searchConditions_item = path_searchConditions + '[' + i + ']';
1987
+ const referencepath_searchConditions_itemValidationError = validate$8(obj_searchConditions_item, path_searchConditions_item);
1988
+ if (referencepath_searchConditions_itemValidationError !== null) {
1989
+ let message = 'Object doesn\'t match SearchConditionInputRepresentation (at "' + path_searchConditions_item + '")\n';
1990
+ message += referencepath_searchConditions_itemValidationError.message.split('\n').map((line) => '\t' + line).join('\n');
1991
+ return new TypeError(message);
1992
+ }
1993
+ }
1994
+ const obj_startTime = obj.startTime;
1995
+ const path_startTime = path + '.startTime';
1996
+ if (typeof obj_startTime !== 'string') {
1997
+ return new TypeError('Expected "string" but received "' + typeof obj_startTime + '" (at "' + path_startTime + '")');
1998
+ }
1999
+ if (obj.workProcedureId !== undefined) {
2000
+ const obj_workProcedureId = obj.workProcedureId;
2001
+ const path_workProcedureId = path + '.workProcedureId';
2002
+ if (typeof obj_workProcedureId !== 'string') {
2003
+ return new TypeError('Expected "string" but received "' + typeof obj_workProcedureId + '" (at "' + path_workProcedureId + '")');
2004
+ }
2005
+ }
2006
+ })();
2007
+ return v_error === undefined ? null : v_error;
2008
+ }
2009
+
2010
+ const VERSION$3 = "e6278b7781b30d0e640478c1ad3865b6";
2011
+ function validate$6(obj, path = 'GetSlotsOutputRepresentation') {
2012
+ const v_error = (() => {
2013
+ if (typeof obj !== 'object' || ArrayIsArray(obj) || obj === null) {
2014
+ return new TypeError('Expected "object" but received "' + typeof obj + '" (at "' + path + '")');
2015
+ }
2016
+ const obj_code = obj.code;
2017
+ const path_code = path + '.code';
2018
+ if (typeof obj_code !== 'string') {
2019
+ return new TypeError('Expected "string" but received "' + typeof obj_code + '" (at "' + path_code + '")');
2020
+ }
2021
+ const obj_isSuccess = obj.isSuccess;
2022
+ const path_isSuccess = path + '.isSuccess';
2023
+ if (typeof obj_isSuccess !== 'boolean') {
2024
+ return new TypeError('Expected "boolean" but received "' + typeof obj_isSuccess + '" (at "' + path_isSuccess + '")');
2025
+ }
2026
+ if (obj.message !== undefined) {
2027
+ const obj_message = obj.message;
2028
+ const path_message = path + '.message';
2029
+ if (typeof obj_message !== 'string') {
2030
+ return new TypeError('Expected "string" but received "' + typeof obj_message + '" (at "' + path_message + '")');
2031
+ }
2032
+ }
2033
+ if (obj.workTypeDateTerritorySlotRepresentation !== undefined) {
2034
+ const obj_workTypeDateTerritorySlotRepresentation = obj.workTypeDateTerritorySlotRepresentation;
2035
+ const path_workTypeDateTerritorySlotRepresentation = path + '.workTypeDateTerritorySlotRepresentation';
2036
+ if (typeof obj_workTypeDateTerritorySlotRepresentation !== 'object' || ArrayIsArray(obj_workTypeDateTerritorySlotRepresentation) || obj_workTypeDateTerritorySlotRepresentation === null) {
2037
+ return new TypeError('Expected "object" but received "' + typeof obj_workTypeDateTerritorySlotRepresentation + '" (at "' + path_workTypeDateTerritorySlotRepresentation + '")');
2038
+ }
2039
+ const obj_workTypeDateTerritorySlotRepresentation_keys = ObjectKeys(obj_workTypeDateTerritorySlotRepresentation);
2040
+ for (let i = 0; i < obj_workTypeDateTerritorySlotRepresentation_keys.length; i++) {
2041
+ const key = obj_workTypeDateTerritorySlotRepresentation_keys[i];
2042
+ const obj_workTypeDateTerritorySlotRepresentation_prop = obj_workTypeDateTerritorySlotRepresentation[key];
2043
+ const path_workTypeDateTerritorySlotRepresentation_prop = path_workTypeDateTerritorySlotRepresentation + '["' + key + '"]';
2044
+ if (typeof obj_workTypeDateTerritorySlotRepresentation_prop !== 'object' || ArrayIsArray(obj_workTypeDateTerritorySlotRepresentation_prop) || obj_workTypeDateTerritorySlotRepresentation_prop === null) {
2045
+ return new TypeError('Expected "object" but received "' + typeof obj_workTypeDateTerritorySlotRepresentation_prop + '" (at "' + path_workTypeDateTerritorySlotRepresentation_prop + '")');
2046
+ }
2047
+ const obj_workTypeDateTerritorySlotRepresentation_prop_keys = ObjectKeys(obj_workTypeDateTerritorySlotRepresentation_prop);
2048
+ for (let i = 0; i < obj_workTypeDateTerritorySlotRepresentation_prop_keys.length; i++) {
2049
+ const key = obj_workTypeDateTerritorySlotRepresentation_prop_keys[i];
2050
+ const obj_workTypeDateTerritorySlotRepresentation_prop_prop = obj_workTypeDateTerritorySlotRepresentation_prop[key];
2051
+ const path_workTypeDateTerritorySlotRepresentation_prop_prop = path_workTypeDateTerritorySlotRepresentation_prop + '["' + key + '"]';
2052
+ if (!ArrayIsArray(obj_workTypeDateTerritorySlotRepresentation_prop_prop)) {
2053
+ return new TypeError('Expected "array" but received "' + typeof obj_workTypeDateTerritorySlotRepresentation_prop_prop + '" (at "' + path_workTypeDateTerritorySlotRepresentation_prop_prop + '")');
2054
+ }
2055
+ for (let i = 0; i < obj_workTypeDateTerritorySlotRepresentation_prop_prop.length; i++) {
2056
+ const obj_workTypeDateTerritorySlotRepresentation_prop_prop_item = obj_workTypeDateTerritorySlotRepresentation_prop_prop[i];
2057
+ const path_workTypeDateTerritorySlotRepresentation_prop_prop_item = path_workTypeDateTerritorySlotRepresentation_prop_prop + '[' + i + ']';
2058
+ if (obj_workTypeDateTerritorySlotRepresentation_prop_prop_item === undefined) {
2059
+ return new TypeError('Expected "defined" but received "' + typeof obj_workTypeDateTerritorySlotRepresentation_prop_prop_item + '" (at "' + path_workTypeDateTerritorySlotRepresentation_prop_prop_item + '")');
2060
+ }
2061
+ }
2062
+ }
2063
+ }
2064
+ }
2065
+ })();
2066
+ return v_error === undefined ? null : v_error;
2067
+ }
2068
+ const RepresentationType$3 = 'GetSlotsOutputRepresentation';
2069
+ function keyBuilder$4(luvio, config) {
2070
+ return keyPrefix + '::' + RepresentationType$3 + ':' + config.isSuccess;
2071
+ }
2072
+ function keyBuilderFromType$2(luvio, object) {
2073
+ const keyParams = {
2074
+ isSuccess: object.isSuccess
2075
+ };
2076
+ return keyBuilder$4(luvio, keyParams);
2077
+ }
2078
+ function normalize$3(input, existing, path, luvio, store, timestamp) {
2079
+ return input;
2080
+ }
2081
+ const select$7 = function GetSlotsOutputRepresentationSelect() {
2082
+ return {
2083
+ kind: 'Fragment',
2084
+ version: VERSION$3,
2085
+ private: [],
2086
+ selections: [
2087
+ {
2088
+ name: 'code',
2089
+ kind: 'Scalar'
2090
+ },
2091
+ {
2092
+ name: 'isSuccess',
2093
+ kind: 'Scalar'
2094
+ },
2095
+ {
2096
+ name: 'message',
2097
+ kind: 'Scalar',
2098
+ required: false
2099
+ },
2100
+ {
2101
+ name: 'workTypeDateTerritorySlotRepresentation',
2102
+ kind: 'Object',
2103
+ // any
2104
+ }
2105
+ ]
2106
+ };
2107
+ };
2108
+ function equals$3(existing, incoming) {
2109
+ const existing_isSuccess = existing.isSuccess;
2110
+ const incoming_isSuccess = incoming.isSuccess;
2111
+ if (!(existing_isSuccess === incoming_isSuccess)) {
2112
+ return false;
2113
+ }
2114
+ const existing_code = existing.code;
2115
+ const incoming_code = incoming.code;
2116
+ if (!(existing_code === incoming_code)) {
2117
+ return false;
2118
+ }
2119
+ const existing_message = existing.message;
2120
+ const incoming_message = incoming.message;
2121
+ // if at least one of these optionals is defined
2122
+ if (existing_message !== undefined || incoming_message !== undefined) {
2123
+ // if one of these is not defined we know the other is defined and therefore
2124
+ // not equal
2125
+ if (existing_message === undefined || incoming_message === undefined) {
2126
+ return false;
2127
+ }
2128
+ if (!(existing_message === incoming_message)) {
2129
+ return false;
2130
+ }
2131
+ }
2132
+ const existing_workTypeDateTerritorySlotRepresentation = existing.workTypeDateTerritorySlotRepresentation;
2133
+ const incoming_workTypeDateTerritorySlotRepresentation = incoming.workTypeDateTerritorySlotRepresentation;
2134
+ // if at least one of these optionals is defined
2135
+ if (existing_workTypeDateTerritorySlotRepresentation !== undefined || incoming_workTypeDateTerritorySlotRepresentation !== undefined) {
2136
+ // if one of these is not defined we know the other is defined and therefore
2137
+ // not equal
2138
+ if (existing_workTypeDateTerritorySlotRepresentation === undefined || incoming_workTypeDateTerritorySlotRepresentation === undefined) {
2139
+ return false;
2140
+ }
2141
+ const equals_workTypeDateTerritorySlotRepresentation_props = equalsObject(existing_workTypeDateTerritorySlotRepresentation, incoming_workTypeDateTerritorySlotRepresentation, (existing_workTypeDateTerritorySlotRepresentation_prop, incoming_workTypeDateTerritorySlotRepresentation_prop) => {
2142
+ const equals_workTypeDateTerritorySlotRepresentation_props = equalsObject(existing_workTypeDateTerritorySlotRepresentation_prop, incoming_workTypeDateTerritorySlotRepresentation_prop, (existing_workTypeDateTerritorySlotRepresentation_prop_prop, incoming_workTypeDateTerritorySlotRepresentation_prop_prop) => {
2143
+ const equals_workTypeDateTerritorySlotRepresentation_items = equalsArray(existing_workTypeDateTerritorySlotRepresentation_prop_prop, incoming_workTypeDateTerritorySlotRepresentation_prop_prop, (existing_workTypeDateTerritorySlotRepresentation_prop_prop_item, incoming_workTypeDateTerritorySlotRepresentation_prop_prop_item) => {
2144
+ if (JSONStringify(incoming_workTypeDateTerritorySlotRepresentation_prop_prop_item) !== JSONStringify(existing_workTypeDateTerritorySlotRepresentation_prop_prop_item)) {
2145
+ return false;
2146
+ }
2147
+ });
2148
+ if (equals_workTypeDateTerritorySlotRepresentation_items === false) {
2149
+ return false;
2150
+ }
2151
+ });
2152
+ if (equals_workTypeDateTerritorySlotRepresentation_props === false) {
2153
+ return false;
2154
+ }
2155
+ });
2156
+ if (equals_workTypeDateTerritorySlotRepresentation_props === false) {
2157
+ return false;
2158
+ }
2159
+ }
2160
+ return true;
2161
+ }
2162
+ const ingest$3 = function GetSlotsOutputRepresentationIngest(input, path, luvio, store, timestamp) {
2163
+ if (process.env.NODE_ENV !== 'production') {
2164
+ const validateError = validate$6(input);
2165
+ if (validateError !== null) {
2166
+ throw validateError;
2167
+ }
2168
+ }
2169
+ const key = keyBuilderFromType$2(luvio, input);
2170
+ const existingRecord = store.readEntry(key);
2171
+ const ttlToUse = path.ttl !== undefined ? path.ttl : 500;
2172
+ let incomingRecord = normalize$3(input, store.readEntry(key), {
2173
+ fullPath: key,
2174
+ parent: path.parent,
2175
+ propertyName: path.propertyName,
2176
+ ttl: ttlToUse
2177
+ });
2178
+ if (existingRecord === undefined || equals$3(existingRecord, incomingRecord) === false) {
2179
+ luvio.storePublish(key, incomingRecord);
2180
+ }
2181
+ if (ttlToUse !== undefined) {
2182
+ const storeMetadataParams = {
2183
+ ttl: ttlToUse,
2184
+ namespace: "healthcloud",
2185
+ version: VERSION$3,
2186
+ representationName: RepresentationType$3,
2187
+ };
2188
+ luvio.publishStoreMetadata(key, storeMetadataParams);
2189
+ }
2190
+ return createLink(key);
2191
+ };
2192
+ function getTypeCacheKeys$3(luvio, input, fullPathFactory) {
2193
+ const rootKeySet = new StoreKeyMap();
2194
+ // root cache key (uses fullPathFactory if keyBuilderFromType isn't defined)
2195
+ const rootKey = keyBuilderFromType$2(luvio, input);
2196
+ rootKeySet.set(rootKey, {
2197
+ namespace: keyPrefix,
2198
+ representationName: RepresentationType$3,
2199
+ mergeable: false
2200
+ });
2201
+ return rootKeySet;
2202
+ }
2203
+
2204
+ function select$6(luvio, params) {
2205
+ return select$7();
2206
+ }
2207
+ function getResponseCacheKeys$3(luvio, resourceParams, response) {
2208
+ return getTypeCacheKeys$3(luvio, response);
2209
+ }
2210
+ function ingestSuccess$3(luvio, resourceParams, response) {
2211
+ const { body } = response;
2212
+ const key = keyBuilderFromType$2(luvio, body);
2213
+ luvio.storeIngest(key, ingest$3, body);
2214
+ const snapshot = luvio.storeLookup({
2215
+ recordId: key,
2216
+ node: select$6(),
2217
+ variables: {},
2218
+ });
2219
+ if (process.env.NODE_ENV !== 'production') {
2220
+ if (snapshot.state !== 'Fulfilled') {
2221
+ throw new Error('Invalid network response. Expected resource response to result in Fulfilled snapshot');
2222
+ }
2223
+ }
2224
+ return snapshot;
2225
+ }
2226
+ function createResourceRequest$3(config) {
2227
+ const headers = {};
2228
+ return {
2229
+ baseUri: '/services/data/v58.0',
2230
+ basePath: '/connect/health/advanced-therapy-management/get-slots',
2231
+ method: 'post',
2232
+ body: config.body,
2233
+ urlParams: {},
2234
+ queryParams: {},
2235
+ headers,
2236
+ priority: 'normal',
2237
+ };
2238
+ }
2239
+
2240
+ const getSlots_ConfigPropertyNames = {
2241
+ displayName: 'getSlots',
2242
+ parameters: {
2243
+ required: ['getSlotsInput'],
2244
+ optional: []
2245
+ }
2246
+ };
2247
+ function createResourceParams$3(config) {
2248
+ const resourceParams = {
2249
+ body: {
2250
+ getSlotsInput: config.getSlotsInput
2251
+ }
2252
+ };
2253
+ return resourceParams;
2254
+ }
2255
+ function typeCheckConfig$3(untrustedConfig) {
2256
+ const config = {};
2257
+ const untrustedConfig_getSlotsInput = untrustedConfig.getSlotsInput;
2258
+ const referenceGetSlotsInputRepresentationValidationError = validate$7(untrustedConfig_getSlotsInput);
2259
+ if (referenceGetSlotsInputRepresentationValidationError === null) {
2260
+ config.getSlotsInput = untrustedConfig_getSlotsInput;
2261
+ }
2262
+ return config;
2263
+ }
2264
+ function validateAdapterConfig$3(untrustedConfig, configPropertyNames) {
2265
+ if (!untrustedIsObject(untrustedConfig)) {
2266
+ return null;
2267
+ }
2268
+ if (process.env.NODE_ENV !== 'production') {
2269
+ validateConfig(untrustedConfig, configPropertyNames);
2270
+ }
2271
+ const config = typeCheckConfig$3(untrustedConfig);
2272
+ if (!areRequiredParametersPresent(config, configPropertyNames)) {
2273
+ return null;
2274
+ }
2275
+ return config;
2276
+ }
2277
+ function buildNetworkSnapshot$3(luvio, config, options) {
2278
+ const resourceParams = createResourceParams$3(config);
2279
+ const request = createResourceRequest$3(resourceParams);
2280
+ return luvio.dispatchResourceRequest(request, options)
2281
+ .then((response) => {
2282
+ return luvio.handleSuccessResponse(() => {
2283
+ const snapshot = ingestSuccess$3(luvio, resourceParams, response);
2284
+ return luvio.storeBroadcast().then(() => snapshot);
2285
+ }, () => getResponseCacheKeys$3(luvio, resourceParams, response.body));
2286
+ }, (response) => {
2287
+ deepFreeze$2(response);
2288
+ throw response;
2289
+ });
2290
+ }
2291
+ const getSlotsAdapterFactory = (luvio) => {
2292
+ return function getSlots(untrustedConfig) {
2293
+ const config = validateAdapterConfig$3(untrustedConfig, getSlots_ConfigPropertyNames);
2294
+ // Invalid or incomplete config
2295
+ if (config === null) {
2296
+ throw new Error('Invalid config for "getSlots"');
2297
+ }
2298
+ return buildNetworkSnapshot$3(luvio, config);
2299
+ };
2300
+ };
2301
+
2302
+ function validate$5(obj, path = 'FetchServiceTerritoriesInputRepresentation') {
2303
+ const v_error = (() => {
2304
+ if (typeof obj !== 'object' || ArrayIsArray(obj) || obj === null) {
2305
+ return new TypeError('Expected "object" but received "' + typeof obj + '" (at "' + path + '")');
2306
+ }
2307
+ const obj_transplantCenterId = obj.transplantCenterId;
2308
+ const path_transplantCenterId = path + '.transplantCenterId';
2309
+ if (typeof obj_transplantCenterId !== 'string') {
2310
+ return new TypeError('Expected "string" but received "' + typeof obj_transplantCenterId + '" (at "' + path_transplantCenterId + '")');
2311
+ }
2312
+ const obj_workProcedureId = obj.workProcedureId;
2313
+ const path_workProcedureId = path + '.workProcedureId';
2314
+ if (typeof obj_workProcedureId !== 'string') {
2315
+ return new TypeError('Expected "string" but received "' + typeof obj_workProcedureId + '" (at "' + path_workProcedureId + '")');
2316
+ }
2317
+ const obj_workTypeIds = obj.workTypeIds;
2318
+ const path_workTypeIds = path + '.workTypeIds';
2319
+ if (!ArrayIsArray(obj_workTypeIds)) {
2320
+ return new TypeError('Expected "array" but received "' + typeof obj_workTypeIds + '" (at "' + path_workTypeIds + '")');
2321
+ }
2322
+ for (let i = 0; i < obj_workTypeIds.length; i++) {
2323
+ const obj_workTypeIds_item = obj_workTypeIds[i];
2324
+ const path_workTypeIds_item = path_workTypeIds + '[' + i + ']';
2325
+ if (typeof obj_workTypeIds_item !== 'string') {
2326
+ return new TypeError('Expected "string" but received "' + typeof obj_workTypeIds_item + '" (at "' + path_workTypeIds_item + '")');
2327
+ }
2328
+ }
2329
+ })();
2330
+ return v_error === undefined ? null : v_error;
2331
+ }
2332
+
2333
+ const VERSION$2 = "d320e1dbe94b8c22ed7cd5234606534e";
2334
+ function validate$4(obj, path = 'FetchServiceTerritoriesOutputRepresentation') {
2335
+ const v_error = (() => {
2336
+ if (typeof obj !== 'object' || ArrayIsArray(obj) || obj === null) {
2337
+ return new TypeError('Expected "object" but received "' + typeof obj + '" (at "' + path + '")');
2338
+ }
2339
+ const obj_code = obj.code;
2340
+ const path_code = path + '.code';
2341
+ if (typeof obj_code !== 'string') {
2342
+ return new TypeError('Expected "string" but received "' + typeof obj_code + '" (at "' + path_code + '")');
2343
+ }
2344
+ const obj_isSuccess = obj.isSuccess;
2345
+ const path_isSuccess = path + '.isSuccess';
2346
+ if (typeof obj_isSuccess !== 'boolean') {
2347
+ return new TypeError('Expected "boolean" but received "' + typeof obj_isSuccess + '" (at "' + path_isSuccess + '")');
2348
+ }
2349
+ if (obj.message !== undefined) {
2350
+ const obj_message = obj.message;
2351
+ const path_message = path + '.message';
2352
+ if (typeof obj_message !== 'string') {
2353
+ return new TypeError('Expected "string" but received "' + typeof obj_message + '" (at "' + path_message + '")');
2354
+ }
2355
+ }
2356
+ if (obj.workTypeServiceTerritoryMap !== undefined) {
2357
+ const obj_workTypeServiceTerritoryMap = obj.workTypeServiceTerritoryMap;
2358
+ const path_workTypeServiceTerritoryMap = path + '.workTypeServiceTerritoryMap';
2359
+ if (typeof obj_workTypeServiceTerritoryMap !== 'object' || ArrayIsArray(obj_workTypeServiceTerritoryMap) || obj_workTypeServiceTerritoryMap === null) {
2360
+ return new TypeError('Expected "object" but received "' + typeof obj_workTypeServiceTerritoryMap + '" (at "' + path_workTypeServiceTerritoryMap + '")');
2361
+ }
2362
+ const obj_workTypeServiceTerritoryMap_keys = ObjectKeys(obj_workTypeServiceTerritoryMap);
2363
+ for (let i = 0; i < obj_workTypeServiceTerritoryMap_keys.length; i++) {
2364
+ const key = obj_workTypeServiceTerritoryMap_keys[i];
2365
+ const obj_workTypeServiceTerritoryMap_prop = obj_workTypeServiceTerritoryMap[key];
2366
+ const path_workTypeServiceTerritoryMap_prop = path_workTypeServiceTerritoryMap + '["' + key + '"]';
2367
+ if (obj_workTypeServiceTerritoryMap_prop === undefined) {
2368
+ return new TypeError('Expected "defined" but received "' + typeof obj_workTypeServiceTerritoryMap_prop + '" (at "' + path_workTypeServiceTerritoryMap_prop + '")');
2369
+ }
2370
+ }
2371
+ }
2372
+ })();
2373
+ return v_error === undefined ? null : v_error;
2374
+ }
2375
+ const RepresentationType$2 = 'FetchServiceTerritoriesOutputRepresentation';
2376
+ function normalize$2(input, existing, path, luvio, store, timestamp) {
2377
+ return input;
2378
+ }
2379
+ const select$5 = function FetchServiceTerritoriesOutputRepresentationSelect() {
2380
+ return {
2381
+ kind: 'Fragment',
2382
+ version: VERSION$2,
2383
+ private: [],
2384
+ selections: [
2385
+ {
2386
+ name: 'code',
2387
+ kind: 'Scalar'
2388
+ },
2389
+ {
2390
+ name: 'isSuccess',
2391
+ kind: 'Scalar'
2392
+ },
2393
+ {
2394
+ name: 'message',
2395
+ kind: 'Scalar',
2396
+ required: false
2397
+ },
2398
+ {
2399
+ name: 'workTypeServiceTerritoryMap',
2400
+ kind: 'Object',
2401
+ // any
2402
+ }
2403
+ ]
2404
+ };
2405
+ };
2406
+ function equals$2(existing, incoming) {
2407
+ const existing_isSuccess = existing.isSuccess;
2408
+ const incoming_isSuccess = incoming.isSuccess;
2409
+ if (!(existing_isSuccess === incoming_isSuccess)) {
2410
+ return false;
2411
+ }
2412
+ const existing_code = existing.code;
2413
+ const incoming_code = incoming.code;
2414
+ if (!(existing_code === incoming_code)) {
2415
+ return false;
2416
+ }
2417
+ const existing_message = existing.message;
2418
+ const incoming_message = incoming.message;
2419
+ // if at least one of these optionals is defined
2420
+ if (existing_message !== undefined || incoming_message !== undefined) {
2421
+ // if one of these is not defined we know the other is defined and therefore
2422
+ // not equal
2423
+ if (existing_message === undefined || incoming_message === undefined) {
2424
+ return false;
2425
+ }
2426
+ if (!(existing_message === incoming_message)) {
2427
+ return false;
2428
+ }
2429
+ }
2430
+ const existing_workTypeServiceTerritoryMap = existing.workTypeServiceTerritoryMap;
2431
+ const incoming_workTypeServiceTerritoryMap = incoming.workTypeServiceTerritoryMap;
2432
+ // if at least one of these optionals is defined
2433
+ if (existing_workTypeServiceTerritoryMap !== undefined || incoming_workTypeServiceTerritoryMap !== undefined) {
2434
+ // if one of these is not defined we know the other is defined and therefore
2435
+ // not equal
2436
+ if (existing_workTypeServiceTerritoryMap === undefined || incoming_workTypeServiceTerritoryMap === undefined) {
2437
+ return false;
2438
+ }
2439
+ const equals_workTypeServiceTerritoryMap_props = equalsObject(existing_workTypeServiceTerritoryMap, incoming_workTypeServiceTerritoryMap, (existing_workTypeServiceTerritoryMap_prop, incoming_workTypeServiceTerritoryMap_prop) => {
2440
+ if (JSONStringify(incoming_workTypeServiceTerritoryMap_prop) !== JSONStringify(existing_workTypeServiceTerritoryMap_prop)) {
2441
+ return false;
2442
+ }
2443
+ });
2444
+ if (equals_workTypeServiceTerritoryMap_props === false) {
2445
+ return false;
2446
+ }
2447
+ }
2448
+ return true;
2449
+ }
2450
+ const ingest$2 = function FetchServiceTerritoriesOutputRepresentationIngest(input, path, luvio, store, timestamp) {
2451
+ if (process.env.NODE_ENV !== 'production') {
2452
+ const validateError = validate$4(input);
2453
+ if (validateError !== null) {
2454
+ throw validateError;
2455
+ }
2456
+ }
2457
+ const key = path.fullPath;
2458
+ const existingRecord = store.readEntry(key);
2459
+ const ttlToUse = path.ttl !== undefined ? path.ttl : 500;
2460
+ let incomingRecord = normalize$2(input, store.readEntry(key), {
2461
+ fullPath: key,
2462
+ parent: path.parent,
2463
+ propertyName: path.propertyName,
2464
+ ttl: ttlToUse
2465
+ });
2466
+ if (existingRecord === undefined || equals$2(existingRecord, incomingRecord) === false) {
2467
+ luvio.storePublish(key, incomingRecord);
2468
+ }
2469
+ if (ttlToUse !== undefined) {
2470
+ const storeMetadataParams = {
2471
+ ttl: ttlToUse,
2472
+ namespace: "healthcloud",
2473
+ version: VERSION$2,
2474
+ representationName: RepresentationType$2,
2475
+ };
2476
+ luvio.publishStoreMetadata(key, storeMetadataParams);
2477
+ }
2478
+ return createLink(key);
2479
+ };
2480
+ function getTypeCacheKeys$2(luvio, input, fullPathFactory) {
2481
+ const rootKeySet = new StoreKeyMap();
2482
+ // root cache key (uses fullPathFactory if keyBuilderFromType isn't defined)
2483
+ const rootKey = fullPathFactory();
2484
+ rootKeySet.set(rootKey, {
2485
+ namespace: keyPrefix,
2486
+ representationName: RepresentationType$2,
2487
+ mergeable: false
2488
+ });
2489
+ return rootKeySet;
2490
+ }
2491
+
2492
+ function select$4(luvio, params) {
2493
+ return select$5();
2494
+ }
2495
+ function keyBuilder$3(luvio, params) {
2496
+ return keyPrefix + '::FetchServiceTerritoriesOutputRepresentation:(' + 'getWorkTypeServiceTerritories.transplantCenterId:' + params.body.getWorkTypeServiceTerritories.transplantCenterId + '::' + 'getWorkTypeServiceTerritories.workProcedureId:' + params.body.getWorkTypeServiceTerritories.workProcedureId + '::' + 'getWorkTypeServiceTerritories.workTypeIds:' + params.body.getWorkTypeServiceTerritories.workTypeIds + ')';
2497
+ }
2498
+ function getResponseCacheKeys$2(luvio, resourceParams, response) {
2499
+ return getTypeCacheKeys$2(luvio, response, () => keyBuilder$3(luvio, resourceParams));
2500
+ }
2501
+ function ingestSuccess$2(luvio, resourceParams, response, snapshotRefresh) {
2502
+ const { body } = response;
2503
+ const key = keyBuilder$3(luvio, resourceParams);
2504
+ luvio.storeIngest(key, ingest$2, body);
2505
+ const snapshot = luvio.storeLookup({
2506
+ recordId: key,
2507
+ node: select$4(),
2508
+ variables: {},
2509
+ }, snapshotRefresh);
2510
+ if (process.env.NODE_ENV !== 'production') {
2511
+ if (snapshot.state !== 'Fulfilled') {
2512
+ throw new Error('Invalid network response. Expected resource response to result in Fulfilled snapshot');
2513
+ }
2514
+ }
2515
+ return snapshot;
2516
+ }
2517
+ function ingestError(luvio, params, error, snapshotRefresh) {
2518
+ const key = keyBuilder$3(luvio, params);
2519
+ const errorSnapshot = luvio.errorSnapshot(error, snapshotRefresh);
2520
+ luvio.storeIngestError(key, errorSnapshot);
2521
+ return errorSnapshot;
2522
+ }
2523
+ function createResourceRequest$2(config) {
2524
+ const headers = {};
2525
+ return {
2526
+ baseUri: '/services/data/v58.0',
2527
+ basePath: '/connect/health/advanced-therapy-management/fetch-service-territories',
2528
+ method: 'post',
2529
+ body: config.body,
2530
+ urlParams: {},
2531
+ queryParams: {},
2532
+ headers,
2533
+ priority: 'normal',
2534
+ };
2535
+ }
2536
+
2537
+ const getWorkTypeServiceTerritories_ConfigPropertyNames = {
2538
+ displayName: 'getWorkTypeServiceTerritories',
2539
+ parameters: {
2540
+ required: ['getWorkTypeServiceTerritories'],
2541
+ optional: []
2542
+ }
2543
+ };
2544
+ function createResourceParams$2(config) {
2545
+ const resourceParams = {
2546
+ body: {
2547
+ getWorkTypeServiceTerritories: config.getWorkTypeServiceTerritories
2548
+ }
2549
+ };
2550
+ return resourceParams;
2551
+ }
2552
+ function keyBuilder$2(luvio, config) {
2553
+ const resourceParams = createResourceParams$2(config);
2554
+ return keyBuilder$3(luvio, resourceParams);
2555
+ }
2556
+ function typeCheckConfig$2(untrustedConfig) {
2557
+ const config = {};
2558
+ const untrustedConfig_getWorkTypeServiceTerritories = untrustedConfig.getWorkTypeServiceTerritories;
2559
+ const referenceFetchServiceTerritoriesInputRepresentationValidationError = validate$5(untrustedConfig_getWorkTypeServiceTerritories);
2560
+ if (referenceFetchServiceTerritoriesInputRepresentationValidationError === null) {
2561
+ config.getWorkTypeServiceTerritories = untrustedConfig_getWorkTypeServiceTerritories;
2562
+ }
2563
+ return config;
2564
+ }
2565
+ function validateAdapterConfig$2(untrustedConfig, configPropertyNames) {
2566
+ if (!untrustedIsObject(untrustedConfig)) {
2567
+ return null;
2568
+ }
2569
+ if (process.env.NODE_ENV !== 'production') {
2570
+ validateConfig(untrustedConfig, configPropertyNames);
2571
+ }
2572
+ const config = typeCheckConfig$2(untrustedConfig);
2573
+ if (!areRequiredParametersPresent(config, configPropertyNames)) {
2574
+ return null;
2575
+ }
2576
+ return config;
2577
+ }
2578
+ function adapterFragment(luvio, config) {
2579
+ createResourceParams$2(config);
2580
+ return select$4();
2581
+ }
2582
+ function onFetchResponseSuccess(luvio, config, resourceParams, response) {
2583
+ const snapshot = ingestSuccess$2(luvio, resourceParams, response, {
2584
+ config,
2585
+ resolve: () => buildNetworkSnapshot$2(luvio, config, snapshotRefreshOptions)
2586
+ });
2587
+ return luvio.storeBroadcast().then(() => snapshot);
2588
+ }
2589
+ function onFetchResponseError(luvio, config, resourceParams, response) {
2590
+ const snapshot = ingestError(luvio, resourceParams, response, {
2591
+ config,
2592
+ resolve: () => buildNetworkSnapshot$2(luvio, config, snapshotRefreshOptions)
2593
+ });
2594
+ return luvio.storeBroadcast().then(() => snapshot);
2595
+ }
2596
+ function buildNetworkSnapshot$2(luvio, config, options) {
2597
+ const resourceParams = createResourceParams$2(config);
2598
+ const request = createResourceRequest$2(resourceParams);
2599
+ return luvio.dispatchResourceRequest(request, options)
2600
+ .then((response) => {
2601
+ return luvio.handleSuccessResponse(() => onFetchResponseSuccess(luvio, config, resourceParams, response), () => getResponseCacheKeys$2(luvio, resourceParams, response.body));
2602
+ }, (response) => {
2603
+ return luvio.handleErrorResponse(() => onFetchResponseError(luvio, config, resourceParams, response));
2604
+ });
2605
+ }
2606
+ function buildNetworkSnapshotCachePolicy(context, coercedAdapterRequestContext) {
2607
+ const { luvio, config } = context;
2608
+ const { networkPriority, requestCorrelator, eventObservers } = coercedAdapterRequestContext;
2609
+ const dispatchOptions = {
2610
+ resourceRequestContext: {
2611
+ requestCorrelator,
2612
+ luvioRequestMethod: 'get',
2613
+ },
2614
+ eventObservers
2615
+ };
2616
+ if (networkPriority !== 'normal') {
2617
+ dispatchOptions.overrides = {
2618
+ priority: networkPriority
2619
+ };
2620
+ }
2621
+ return buildNetworkSnapshot$2(luvio, config, dispatchOptions);
2622
+ }
2623
+ function buildCachedSnapshotCachePolicy(context, storeLookup) {
2624
+ const { luvio, config } = context;
2625
+ const selector = {
2626
+ recordId: keyBuilder$2(luvio, config),
2627
+ node: adapterFragment(luvio, config),
2628
+ variables: {},
2629
+ };
2630
+ const cacheSnapshot = storeLookup(selector, {
2631
+ config,
2632
+ resolve: () => buildNetworkSnapshot$2(luvio, config, snapshotRefreshOptions)
2633
+ });
2634
+ return cacheSnapshot;
2635
+ }
2636
+ const getWorkTypeServiceTerritoriesAdapterFactory = (luvio) => function healthcloud__getWorkTypeServiceTerritories(untrustedConfig, requestContext) {
2637
+ const config = validateAdapterConfig$2(untrustedConfig, getWorkTypeServiceTerritories_ConfigPropertyNames);
2638
+ // Invalid or incomplete config
2639
+ if (config === null) {
2640
+ return null;
2641
+ }
2642
+ return luvio.applyCachePolicy((requestContext || {}), { config, luvio }, // BuildSnapshotContext
2643
+ buildCachedSnapshotCachePolicy, buildNetworkSnapshotCachePolicy);
2644
+ };
2645
+
2646
+ function validate$3(obj, path = 'MoveToNextStepInputRepresentation') {
2647
+ const v_error = (() => {
2648
+ if (typeof obj !== 'object' || ArrayIsArray(obj) || obj === null) {
2649
+ return new TypeError('Expected "object" but received "' + typeof obj + '" (at "' + path + '")');
2650
+ }
2651
+ const obj_careProgramEnrolleeId = obj.careProgramEnrolleeId;
2652
+ const path_careProgramEnrolleeId = path + '.careProgramEnrolleeId';
2653
+ if (typeof obj_careProgramEnrolleeId !== 'string') {
2654
+ return new TypeError('Expected "string" but received "' + typeof obj_careProgramEnrolleeId + '" (at "' + path_careProgramEnrolleeId + '")');
2655
+ }
2656
+ })();
2657
+ return v_error === undefined ? null : v_error;
2658
+ }
2659
+
2660
+ const VERSION$1 = "f0f7338cd73b28f5f4f664d2162e1849";
2661
+ function validate$2(obj, path = 'MoveToNextStepOutputRepresentation') {
2662
+ const v_error = (() => {
2663
+ if (typeof obj !== 'object' || ArrayIsArray(obj) || obj === null) {
2664
+ return new TypeError('Expected "object" but received "' + typeof obj + '" (at "' + path + '")');
2665
+ }
2666
+ const obj_code = obj.code;
2667
+ const path_code = path + '.code';
2668
+ if (typeof obj_code !== 'string') {
2669
+ return new TypeError('Expected "string" but received "' + typeof obj_code + '" (at "' + path_code + '")');
2670
+ }
2671
+ const obj_isSuccess = obj.isSuccess;
2672
+ const path_isSuccess = path + '.isSuccess';
2673
+ if (typeof obj_isSuccess !== 'boolean') {
2674
+ return new TypeError('Expected "boolean" but received "' + typeof obj_isSuccess + '" (at "' + path_isSuccess + '")');
2675
+ }
2676
+ const obj_lastUpdatedWorkOrder = obj.lastUpdatedWorkOrder;
2677
+ const path_lastUpdatedWorkOrder = path + '.lastUpdatedWorkOrder';
2678
+ if (typeof obj_lastUpdatedWorkOrder !== 'string') {
2679
+ return new TypeError('Expected "string" but received "' + typeof obj_lastUpdatedWorkOrder + '" (at "' + path_lastUpdatedWorkOrder + '")');
2680
+ }
2681
+ const obj_lastUpdatedWorkOrderStep = obj.lastUpdatedWorkOrderStep;
2682
+ const path_lastUpdatedWorkOrderStep = path + '.lastUpdatedWorkOrderStep';
2683
+ if (typeof obj_lastUpdatedWorkOrderStep !== 'string') {
2684
+ return new TypeError('Expected "string" but received "' + typeof obj_lastUpdatedWorkOrderStep + '" (at "' + path_lastUpdatedWorkOrderStep + '")');
2685
+ }
2686
+ const obj_message = obj.message;
2687
+ const path_message = path + '.message';
2688
+ let obj_message_union0 = null;
2689
+ const obj_message_union0_error = (() => {
2690
+ if (typeof obj_message !== 'string') {
2691
+ return new TypeError('Expected "string" but received "' + typeof obj_message + '" (at "' + path_message + '")');
2692
+ }
2693
+ })();
2694
+ if (obj_message_union0_error != null) {
2695
+ obj_message_union0 = obj_message_union0_error.message;
2696
+ }
2697
+ let obj_message_union1 = null;
2698
+ const obj_message_union1_error = (() => {
2699
+ if (obj_message !== null) {
2700
+ return new TypeError('Expected "null" but received "' + typeof obj_message + '" (at "' + path_message + '")');
2701
+ }
2702
+ })();
2703
+ if (obj_message_union1_error != null) {
2704
+ obj_message_union1 = obj_message_union1_error.message;
2705
+ }
2706
+ if (obj_message_union0 && obj_message_union1) {
2707
+ let message = 'Object doesn\'t match union (at "' + path_message + '")';
2708
+ message += '\n' + obj_message_union0.split('\n').map((line) => '\t' + line).join('\n');
2709
+ message += '\n' + obj_message_union1.split('\n').map((line) => '\t' + line).join('\n');
2710
+ return new TypeError(message);
2711
+ }
2712
+ const obj_nextWorkOrder = obj.nextWorkOrder;
2713
+ const path_nextWorkOrder = path + '.nextWorkOrder';
2714
+ if (typeof obj_nextWorkOrder !== 'string') {
2715
+ return new TypeError('Expected "string" but received "' + typeof obj_nextWorkOrder + '" (at "' + path_nextWorkOrder + '")');
2716
+ }
2717
+ const obj_nextWorkOrderStep = obj.nextWorkOrderStep;
2718
+ const path_nextWorkOrderStep = path + '.nextWorkOrderStep';
2719
+ if (typeof obj_nextWorkOrderStep !== 'string') {
2720
+ return new TypeError('Expected "string" but received "' + typeof obj_nextWorkOrderStep + '" (at "' + path_nextWorkOrderStep + '")');
2721
+ }
2722
+ })();
2723
+ return v_error === undefined ? null : v_error;
2724
+ }
2725
+ const RepresentationType$1 = 'MoveToNextStepOutputRepresentation';
2726
+ function keyBuilder$1(luvio, config) {
2727
+ return keyPrefix + '::' + RepresentationType$1 + ':' + config.isSuccess;
2728
+ }
2729
+ function keyBuilderFromType$1(luvio, object) {
2730
+ const keyParams = {
2731
+ isSuccess: object.isSuccess
2732
+ };
2733
+ return keyBuilder$1(luvio, keyParams);
2734
+ }
2735
+ function normalize$1(input, existing, path, luvio, store, timestamp) {
2736
+ return input;
2737
+ }
2738
+ const select$3 = function MoveToNextStepOutputRepresentationSelect() {
2739
+ return {
2740
+ kind: 'Fragment',
2741
+ version: VERSION$1,
2742
+ private: [],
2743
+ selections: [
2744
+ {
2745
+ name: 'code',
2746
+ kind: 'Scalar'
2747
+ },
2748
+ {
2749
+ name: 'isSuccess',
2750
+ kind: 'Scalar'
2751
+ },
2752
+ {
2753
+ name: 'lastUpdatedWorkOrder',
2754
+ kind: 'Scalar'
2755
+ },
2756
+ {
2757
+ name: 'lastUpdatedWorkOrderStep',
2758
+ kind: 'Scalar'
2759
+ },
2760
+ {
2761
+ name: 'message',
2762
+ kind: 'Scalar'
2763
+ },
2764
+ {
2765
+ name: 'nextWorkOrder',
2766
+ kind: 'Scalar'
2767
+ },
2768
+ {
2769
+ name: 'nextWorkOrderStep',
2770
+ kind: 'Scalar'
2771
+ }
2772
+ ]
2773
+ };
2774
+ };
2775
+ function equals$1(existing, incoming) {
2776
+ const existing_isSuccess = existing.isSuccess;
2777
+ const incoming_isSuccess = incoming.isSuccess;
2778
+ if (!(existing_isSuccess === incoming_isSuccess)) {
2779
+ return false;
2780
+ }
2781
+ const existing_code = existing.code;
2782
+ const incoming_code = incoming.code;
2783
+ if (!(existing_code === incoming_code)) {
2784
+ return false;
2785
+ }
2786
+ const existing_lastUpdatedWorkOrder = existing.lastUpdatedWorkOrder;
2787
+ const incoming_lastUpdatedWorkOrder = incoming.lastUpdatedWorkOrder;
2788
+ if (!(existing_lastUpdatedWorkOrder === incoming_lastUpdatedWorkOrder)) {
2789
+ return false;
2790
+ }
2791
+ const existing_lastUpdatedWorkOrderStep = existing.lastUpdatedWorkOrderStep;
2792
+ const incoming_lastUpdatedWorkOrderStep = incoming.lastUpdatedWorkOrderStep;
2793
+ if (!(existing_lastUpdatedWorkOrderStep === incoming_lastUpdatedWorkOrderStep)) {
2794
+ return false;
2795
+ }
2796
+ const existing_nextWorkOrder = existing.nextWorkOrder;
2797
+ const incoming_nextWorkOrder = incoming.nextWorkOrder;
2798
+ if (!(existing_nextWorkOrder === incoming_nextWorkOrder)) {
2799
+ return false;
2800
+ }
2801
+ const existing_nextWorkOrderStep = existing.nextWorkOrderStep;
2802
+ const incoming_nextWorkOrderStep = incoming.nextWorkOrderStep;
2803
+ if (!(existing_nextWorkOrderStep === incoming_nextWorkOrderStep)) {
2804
+ return false;
2805
+ }
2806
+ const existing_message = existing.message;
2807
+ const incoming_message = incoming.message;
2808
+ if (!(existing_message === incoming_message)) {
2809
+ return false;
2810
+ }
2811
+ return true;
2812
+ }
2813
+ const ingest$1 = function MoveToNextStepOutputRepresentationIngest(input, path, luvio, store, timestamp) {
2814
+ if (process.env.NODE_ENV !== 'production') {
2815
+ const validateError = validate$2(input);
2816
+ if (validateError !== null) {
2817
+ throw validateError;
2818
+ }
2819
+ }
2820
+ const key = keyBuilderFromType$1(luvio, input);
2821
+ const existingRecord = store.readEntry(key);
2822
+ const ttlToUse = path.ttl !== undefined ? path.ttl : 500;
2823
+ let incomingRecord = normalize$1(input, store.readEntry(key), {
2824
+ fullPath: key,
2825
+ parent: path.parent,
2826
+ propertyName: path.propertyName,
2827
+ ttl: ttlToUse
2828
+ });
2829
+ if (existingRecord === undefined || equals$1(existingRecord, incomingRecord) === false) {
2830
+ luvio.storePublish(key, incomingRecord);
2831
+ }
2832
+ if (ttlToUse !== undefined) {
2833
+ const storeMetadataParams = {
2834
+ ttl: ttlToUse,
2835
+ namespace: "healthcloud",
2836
+ version: VERSION$1,
2837
+ representationName: RepresentationType$1,
2838
+ };
2839
+ luvio.publishStoreMetadata(key, storeMetadataParams);
2840
+ }
2841
+ return createLink(key);
2842
+ };
2843
+ function getTypeCacheKeys$1(luvio, input, fullPathFactory) {
2844
+ const rootKeySet = new StoreKeyMap();
2845
+ // root cache key (uses fullPathFactory if keyBuilderFromType isn't defined)
2846
+ const rootKey = keyBuilderFromType$1(luvio, input);
2847
+ rootKeySet.set(rootKey, {
2848
+ namespace: keyPrefix,
2849
+ representationName: RepresentationType$1,
2850
+ mergeable: false
2851
+ });
2852
+ return rootKeySet;
2853
+ }
2854
+
2855
+ function select$2(luvio, params) {
2856
+ return select$3();
2857
+ }
2858
+ function getResponseCacheKeys$1(luvio, resourceParams, response) {
2859
+ return getTypeCacheKeys$1(luvio, response);
2860
+ }
2861
+ function ingestSuccess$1(luvio, resourceParams, response) {
2862
+ const { body } = response;
2863
+ const key = keyBuilderFromType$1(luvio, body);
2864
+ luvio.storeIngest(key, ingest$1, body);
2865
+ const snapshot = luvio.storeLookup({
2866
+ recordId: key,
2867
+ node: select$2(),
2868
+ variables: {},
2869
+ });
2870
+ if (process.env.NODE_ENV !== 'production') {
2871
+ if (snapshot.state !== 'Fulfilled') {
2872
+ throw new Error('Invalid network response. Expected resource response to result in Fulfilled snapshot');
2873
+ }
2874
+ }
2875
+ return snapshot;
2876
+ }
2877
+ function createResourceRequest$1(config) {
2878
+ const headers = {};
2879
+ return {
2880
+ baseUri: '/services/data/v58.0',
2881
+ basePath: '/connect/health/advanced-therapy-management/move-to-next-step',
2882
+ method: 'post',
2883
+ body: config.body,
2884
+ urlParams: {},
2885
+ queryParams: {},
2886
+ headers,
2887
+ priority: 'normal',
2888
+ };
2889
+ }
2890
+
2891
+ const moveToNextStep_ConfigPropertyNames = {
2892
+ displayName: 'moveToNextStep',
2893
+ parameters: {
2894
+ required: ['MoveToNextStepInput'],
2895
+ optional: []
2896
+ }
2897
+ };
2898
+ function createResourceParams$1(config) {
2899
+ const resourceParams = {
2900
+ body: {
2901
+ MoveToNextStepInput: config.MoveToNextStepInput
2902
+ }
2903
+ };
2904
+ return resourceParams;
2905
+ }
2906
+ function typeCheckConfig$1(untrustedConfig) {
2907
+ const config = {};
2908
+ const untrustedConfig_MoveToNextStepInput = untrustedConfig.MoveToNextStepInput;
2909
+ const referenceMoveToNextStepInputRepresentationValidationError = validate$3(untrustedConfig_MoveToNextStepInput);
2910
+ if (referenceMoveToNextStepInputRepresentationValidationError === null) {
2911
+ config.MoveToNextStepInput = untrustedConfig_MoveToNextStepInput;
2912
+ }
2913
+ return config;
2914
+ }
2915
+ function validateAdapterConfig$1(untrustedConfig, configPropertyNames) {
2916
+ if (!untrustedIsObject(untrustedConfig)) {
2917
+ return null;
2918
+ }
2919
+ if (process.env.NODE_ENV !== 'production') {
2920
+ validateConfig(untrustedConfig, configPropertyNames);
2921
+ }
2922
+ const config = typeCheckConfig$1(untrustedConfig);
2923
+ if (!areRequiredParametersPresent(config, configPropertyNames)) {
2924
+ return null;
2925
+ }
2926
+ return config;
2927
+ }
2928
+ function buildNetworkSnapshot$1(luvio, config, options) {
2929
+ const resourceParams = createResourceParams$1(config);
2930
+ const request = createResourceRequest$1(resourceParams);
2931
+ return luvio.dispatchResourceRequest(request, options)
2932
+ .then((response) => {
2933
+ return luvio.handleSuccessResponse(() => {
2934
+ const snapshot = ingestSuccess$1(luvio, resourceParams, response);
2935
+ return luvio.storeBroadcast().then(() => snapshot);
2936
+ }, () => getResponseCacheKeys$1(luvio, resourceParams, response.body));
2937
+ }, (response) => {
2938
+ deepFreeze$2(response);
2939
+ throw response;
2940
+ });
2941
+ }
2942
+ const moveToNextStepAdapterFactory = (luvio) => {
2943
+ return function moveToNextStep(untrustedConfig) {
2944
+ const config = validateAdapterConfig$1(untrustedConfig, moveToNextStep_ConfigPropertyNames);
2945
+ // Invalid or incomplete config
2946
+ if (config === null) {
2947
+ throw new Error('Invalid config for "moveToNextStep"');
2948
+ }
2949
+ return buildNetworkSnapshot$1(luvio, config);
2950
+ };
2951
+ };
2952
+
2953
+ function validate$1(obj, path = 'RescheduleSlotChainInputRepresentation') {
2954
+ const v_error = (() => {
2955
+ if (typeof obj !== 'object' || ArrayIsArray(obj) || obj === null) {
2956
+ return new TypeError('Expected "object" but received "' + typeof obj + '" (at "' + path + '")');
2957
+ }
2958
+ const obj_careProgramEnrolleeId = obj.careProgramEnrolleeId;
2959
+ const path_careProgramEnrolleeId = path + '.careProgramEnrolleeId';
2960
+ if (typeof obj_careProgramEnrolleeId !== 'string') {
2961
+ return new TypeError('Expected "string" but received "' + typeof obj_careProgramEnrolleeId + '" (at "' + path_careProgramEnrolleeId + '")');
2962
+ }
2963
+ const obj_newSlotsInputRepresentation = obj.newSlotsInputRepresentation;
2964
+ const path_newSlotsInputRepresentation = path + '.newSlotsInputRepresentation';
2965
+ if (!ArrayIsArray(obj_newSlotsInputRepresentation)) {
2966
+ return new TypeError('Expected "array" but received "' + typeof obj_newSlotsInputRepresentation + '" (at "' + path_newSlotsInputRepresentation + '")');
2967
+ }
2968
+ for (let i = 0; i < obj_newSlotsInputRepresentation.length; i++) {
2969
+ const obj_newSlotsInputRepresentation_item = obj_newSlotsInputRepresentation[i];
2970
+ const path_newSlotsInputRepresentation_item = path_newSlotsInputRepresentation + '[' + i + ']';
2971
+ const referencepath_newSlotsInputRepresentation_itemValidationError = validate$j(obj_newSlotsInputRepresentation_item, path_newSlotsInputRepresentation_item);
2972
+ if (referencepath_newSlotsInputRepresentation_itemValidationError !== null) {
2973
+ let message = 'Object doesn\'t match SlotInputRepresentation (at "' + path_newSlotsInputRepresentation_item + '")\n';
2974
+ message += referencepath_newSlotsInputRepresentation_itemValidationError.message.split('\n').map((line) => '\t' + line).join('\n');
2975
+ return new TypeError(message);
2976
+ }
2977
+ }
2978
+ if (obj.rescheduleReason !== undefined) {
2979
+ const obj_rescheduleReason = obj.rescheduleReason;
2980
+ const path_rescheduleReason = path + '.rescheduleReason';
2981
+ if (typeof obj_rescheduleReason !== 'string') {
2982
+ return new TypeError('Expected "string" but received "' + typeof obj_rescheduleReason + '" (at "' + path_rescheduleReason + '")');
2983
+ }
2984
+ }
2985
+ const obj_serviceAppointmentGroupIdRescheduledSlots = obj.serviceAppointmentGroupIdRescheduledSlots;
2986
+ const path_serviceAppointmentGroupIdRescheduledSlots = path + '.serviceAppointmentGroupIdRescheduledSlots';
2987
+ if (typeof obj_serviceAppointmentGroupIdRescheduledSlots !== 'string') {
2988
+ return new TypeError('Expected "string" but received "' + typeof obj_serviceAppointmentGroupIdRescheduledSlots + '" (at "' + path_serviceAppointmentGroupIdRescheduledSlots + '")');
2989
+ }
2990
+ const obj_serviceAppointmentIdsRescheduledSlots = obj.serviceAppointmentIdsRescheduledSlots;
2991
+ const path_serviceAppointmentIdsRescheduledSlots = path + '.serviceAppointmentIdsRescheduledSlots';
2992
+ if (!ArrayIsArray(obj_serviceAppointmentIdsRescheduledSlots)) {
2993
+ return new TypeError('Expected "array" but received "' + typeof obj_serviceAppointmentIdsRescheduledSlots + '" (at "' + path_serviceAppointmentIdsRescheduledSlots + '")');
2994
+ }
2995
+ for (let i = 0; i < obj_serviceAppointmentIdsRescheduledSlots.length; i++) {
2996
+ const obj_serviceAppointmentIdsRescheduledSlots_item = obj_serviceAppointmentIdsRescheduledSlots[i];
2997
+ const path_serviceAppointmentIdsRescheduledSlots_item = path_serviceAppointmentIdsRescheduledSlots + '[' + i + ']';
2998
+ if (typeof obj_serviceAppointmentIdsRescheduledSlots_item !== 'string') {
2999
+ return new TypeError('Expected "string" but received "' + typeof obj_serviceAppointmentIdsRescheduledSlots_item + '" (at "' + path_serviceAppointmentIdsRescheduledSlots_item + '")');
3000
+ }
3001
+ }
3002
+ if (obj.status !== undefined) {
3003
+ const obj_status = obj.status;
3004
+ const path_status = path + '.status';
3005
+ if (typeof obj_status !== 'string') {
3006
+ return new TypeError('Expected "string" but received "' + typeof obj_status + '" (at "' + path_status + '")');
3007
+ }
3008
+ }
3009
+ const obj_workProcedureId = obj.workProcedureId;
3010
+ const path_workProcedureId = path + '.workProcedureId';
3011
+ if (typeof obj_workProcedureId !== 'string') {
3012
+ return new TypeError('Expected "string" but received "' + typeof obj_workProcedureId + '" (at "' + path_workProcedureId + '")');
3013
+ }
3014
+ })();
3015
+ return v_error === undefined ? null : v_error;
3016
+ }
3017
+
3018
+ const VERSION = "0a21004720a4a00b9cae62c2c6419360";
3019
+ function validate(obj, path = 'RescheduleSlotChainOutputRepresentation') {
3020
+ const v_error = (() => {
3021
+ if (typeof obj !== 'object' || ArrayIsArray(obj) || obj === null) {
3022
+ return new TypeError('Expected "object" but received "' + typeof obj + '" (at "' + path + '")');
3023
+ }
3024
+ const obj_code = obj.code;
3025
+ const path_code = path + '.code';
3026
+ if (typeof obj_code !== 'string') {
3027
+ return new TypeError('Expected "string" but received "' + typeof obj_code + '" (at "' + path_code + '")');
3028
+ }
3029
+ const obj_isSuccess = obj.isSuccess;
3030
+ const path_isSuccess = path + '.isSuccess';
3031
+ if (typeof obj_isSuccess !== 'boolean') {
3032
+ return new TypeError('Expected "boolean" but received "' + typeof obj_isSuccess + '" (at "' + path_isSuccess + '")');
3033
+ }
3034
+ if (obj.message !== undefined) {
3035
+ const obj_message = obj.message;
3036
+ const path_message = path + '.message';
3037
+ let obj_message_union0 = null;
3038
+ const obj_message_union0_error = (() => {
3039
+ if (typeof obj_message !== 'string') {
3040
+ return new TypeError('Expected "string" but received "' + typeof obj_message + '" (at "' + path_message + '")');
3041
+ }
3042
+ })();
3043
+ if (obj_message_union0_error != null) {
3044
+ obj_message_union0 = obj_message_union0_error.message;
3045
+ }
3046
+ let obj_message_union1 = null;
3047
+ const obj_message_union1_error = (() => {
3048
+ if (obj_message !== null) {
3049
+ return new TypeError('Expected "null" but received "' + typeof obj_message + '" (at "' + path_message + '")');
3050
+ }
3051
+ })();
3052
+ if (obj_message_union1_error != null) {
3053
+ obj_message_union1 = obj_message_union1_error.message;
3054
+ }
3055
+ if (obj_message_union0 && obj_message_union1) {
3056
+ let message = 'Object doesn\'t match union (at "' + path_message + '")';
3057
+ message += '\n' + obj_message_union0.split('\n').map((line) => '\t' + line).join('\n');
3058
+ message += '\n' + obj_message_union1.split('\n').map((line) => '\t' + line).join('\n');
3059
+ return new TypeError(message);
3060
+ }
3061
+ }
3062
+ if (obj.serviceAppointmentGroupIdBookedSlots !== undefined) {
3063
+ const obj_serviceAppointmentGroupIdBookedSlots = obj.serviceAppointmentGroupIdBookedSlots;
3064
+ const path_serviceAppointmentGroupIdBookedSlots = path + '.serviceAppointmentGroupIdBookedSlots';
3065
+ let obj_serviceAppointmentGroupIdBookedSlots_union0 = null;
3066
+ const obj_serviceAppointmentGroupIdBookedSlots_union0_error = (() => {
3067
+ if (typeof obj_serviceAppointmentGroupIdBookedSlots !== 'string') {
3068
+ return new TypeError('Expected "string" but received "' + typeof obj_serviceAppointmentGroupIdBookedSlots + '" (at "' + path_serviceAppointmentGroupIdBookedSlots + '")');
3069
+ }
3070
+ })();
3071
+ if (obj_serviceAppointmentGroupIdBookedSlots_union0_error != null) {
3072
+ obj_serviceAppointmentGroupIdBookedSlots_union0 = obj_serviceAppointmentGroupIdBookedSlots_union0_error.message;
3073
+ }
3074
+ let obj_serviceAppointmentGroupIdBookedSlots_union1 = null;
3075
+ const obj_serviceAppointmentGroupIdBookedSlots_union1_error = (() => {
3076
+ if (obj_serviceAppointmentGroupIdBookedSlots !== null) {
3077
+ return new TypeError('Expected "null" but received "' + typeof obj_serviceAppointmentGroupIdBookedSlots + '" (at "' + path_serviceAppointmentGroupIdBookedSlots + '")');
3078
+ }
3079
+ })();
3080
+ if (obj_serviceAppointmentGroupIdBookedSlots_union1_error != null) {
3081
+ obj_serviceAppointmentGroupIdBookedSlots_union1 = obj_serviceAppointmentGroupIdBookedSlots_union1_error.message;
3082
+ }
3083
+ if (obj_serviceAppointmentGroupIdBookedSlots_union0 && obj_serviceAppointmentGroupIdBookedSlots_union1) {
3084
+ let message = 'Object doesn\'t match union (at "' + path_serviceAppointmentGroupIdBookedSlots + '")';
3085
+ message += '\n' + obj_serviceAppointmentGroupIdBookedSlots_union0.split('\n').map((line) => '\t' + line).join('\n');
3086
+ message += '\n' + obj_serviceAppointmentGroupIdBookedSlots_union1.split('\n').map((line) => '\t' + line).join('\n');
3087
+ return new TypeError(message);
3088
+ }
3089
+ }
3090
+ if (obj.serviceAppointmentIdsBookedSlots !== undefined) {
3091
+ const obj_serviceAppointmentIdsBookedSlots = obj.serviceAppointmentIdsBookedSlots;
3092
+ const path_serviceAppointmentIdsBookedSlots = path + '.serviceAppointmentIdsBookedSlots';
3093
+ if (!ArrayIsArray(obj_serviceAppointmentIdsBookedSlots)) {
3094
+ return new TypeError('Expected "array" but received "' + typeof obj_serviceAppointmentIdsBookedSlots + '" (at "' + path_serviceAppointmentIdsBookedSlots + '")');
3095
+ }
3096
+ for (let i = 0; i < obj_serviceAppointmentIdsBookedSlots.length; i++) {
3097
+ const obj_serviceAppointmentIdsBookedSlots_item = obj_serviceAppointmentIdsBookedSlots[i];
3098
+ const path_serviceAppointmentIdsBookedSlots_item = path_serviceAppointmentIdsBookedSlots + '[' + i + ']';
3099
+ if (typeof obj_serviceAppointmentIdsBookedSlots_item !== 'string') {
3100
+ return new TypeError('Expected "string" but received "' + typeof obj_serviceAppointmentIdsBookedSlots_item + '" (at "' + path_serviceAppointmentIdsBookedSlots_item + '")');
3101
+ }
3102
+ }
3103
+ }
3104
+ })();
3105
+ return v_error === undefined ? null : v_error;
3106
+ }
3107
+ const RepresentationType = 'RescheduleSlotChainOutputRepresentation';
3108
+ function keyBuilder(luvio, config) {
3109
+ return keyPrefix + '::' + RepresentationType + ':' + config.isSuccess;
3110
+ }
3111
+ function keyBuilderFromType(luvio, object) {
3112
+ const keyParams = {
3113
+ isSuccess: object.isSuccess
3114
+ };
3115
+ return keyBuilder(luvio, keyParams);
3116
+ }
3117
+ function normalize(input, existing, path, luvio, store, timestamp) {
3118
+ return input;
3119
+ }
3120
+ const select$1 = function RescheduleSlotChainOutputRepresentationSelect() {
3121
+ return {
3122
+ kind: 'Fragment',
3123
+ version: VERSION,
3124
+ private: [],
3125
+ selections: [
3126
+ {
3127
+ name: 'code',
3128
+ kind: 'Scalar'
3129
+ },
3130
+ {
3131
+ name: 'isSuccess',
3132
+ kind: 'Scalar'
3133
+ },
3134
+ {
3135
+ name: 'message',
3136
+ kind: 'Scalar',
3137
+ required: false
3138
+ },
3139
+ {
3140
+ name: 'serviceAppointmentGroupIdBookedSlots',
3141
+ kind: 'Scalar',
3142
+ required: false
3143
+ },
3144
+ {
3145
+ name: 'serviceAppointmentIdsBookedSlots',
3146
+ kind: 'Scalar',
3147
+ plural: true,
3148
+ required: false
3149
+ }
3150
+ ]
3151
+ };
3152
+ };
3153
+ function equals(existing, incoming) {
3154
+ const existing_isSuccess = existing.isSuccess;
3155
+ const incoming_isSuccess = incoming.isSuccess;
3156
+ if (!(existing_isSuccess === incoming_isSuccess)) {
3157
+ return false;
3158
+ }
3159
+ const existing_code = existing.code;
3160
+ const incoming_code = incoming.code;
3161
+ if (!(existing_code === incoming_code)) {
3162
+ return false;
3163
+ }
3164
+ const existing_message = existing.message;
3165
+ const incoming_message = incoming.message;
3166
+ // if at least one of these optionals is defined
3167
+ if (existing_message !== undefined || incoming_message !== undefined) {
3168
+ // if one of these is not defined we know the other is defined and therefore
3169
+ // not equal
3170
+ if (existing_message === undefined || incoming_message === undefined) {
3171
+ return false;
3172
+ }
3173
+ if (!(existing_message === incoming_message)) {
3174
+ return false;
3175
+ }
3176
+ }
3177
+ const existing_serviceAppointmentGroupIdBookedSlots = existing.serviceAppointmentGroupIdBookedSlots;
3178
+ const incoming_serviceAppointmentGroupIdBookedSlots = incoming.serviceAppointmentGroupIdBookedSlots;
3179
+ // if at least one of these optionals is defined
3180
+ if (existing_serviceAppointmentGroupIdBookedSlots !== undefined || incoming_serviceAppointmentGroupIdBookedSlots !== undefined) {
3181
+ // if one of these is not defined we know the other is defined and therefore
3182
+ // not equal
3183
+ if (existing_serviceAppointmentGroupIdBookedSlots === undefined || incoming_serviceAppointmentGroupIdBookedSlots === undefined) {
3184
+ return false;
3185
+ }
3186
+ if (!(existing_serviceAppointmentGroupIdBookedSlots === incoming_serviceAppointmentGroupIdBookedSlots)) {
3187
+ return false;
3188
+ }
3189
+ }
3190
+ const existing_serviceAppointmentIdsBookedSlots = existing.serviceAppointmentIdsBookedSlots;
3191
+ const incoming_serviceAppointmentIdsBookedSlots = incoming.serviceAppointmentIdsBookedSlots;
3192
+ // if at least one of these optionals is defined
3193
+ if (existing_serviceAppointmentIdsBookedSlots !== undefined || incoming_serviceAppointmentIdsBookedSlots !== undefined) {
3194
+ // if one of these is not defined we know the other is defined and therefore
3195
+ // not equal
3196
+ if (existing_serviceAppointmentIdsBookedSlots === undefined || incoming_serviceAppointmentIdsBookedSlots === undefined) {
3197
+ return false;
3198
+ }
3199
+ const equals_serviceAppointmentIdsBookedSlots_items = equalsArray(existing_serviceAppointmentIdsBookedSlots, incoming_serviceAppointmentIdsBookedSlots, (existing_serviceAppointmentIdsBookedSlots_item, incoming_serviceAppointmentIdsBookedSlots_item) => {
3200
+ if (!(existing_serviceAppointmentIdsBookedSlots_item === incoming_serviceAppointmentIdsBookedSlots_item)) {
3201
+ return false;
3202
+ }
3203
+ });
3204
+ if (equals_serviceAppointmentIdsBookedSlots_items === false) {
3205
+ return false;
3206
+ }
3207
+ }
3208
+ return true;
3209
+ }
3210
+ const ingest = function RescheduleSlotChainOutputRepresentationIngest(input, path, luvio, store, timestamp) {
3211
+ if (process.env.NODE_ENV !== 'production') {
3212
+ const validateError = validate(input);
3213
+ if (validateError !== null) {
3214
+ throw validateError;
3215
+ }
3216
+ }
3217
+ const key = keyBuilderFromType(luvio, input);
3218
+ const existingRecord = store.readEntry(key);
3219
+ const ttlToUse = path.ttl !== undefined ? path.ttl : 500;
3220
+ let incomingRecord = normalize(input, store.readEntry(key), {
3221
+ fullPath: key,
3222
+ parent: path.parent,
3223
+ propertyName: path.propertyName,
3224
+ ttl: ttlToUse
3225
+ });
3226
+ if (existingRecord === undefined || equals(existingRecord, incomingRecord) === false) {
3227
+ luvio.storePublish(key, incomingRecord);
3228
+ }
3229
+ if (ttlToUse !== undefined) {
3230
+ const storeMetadataParams = {
3231
+ ttl: ttlToUse,
3232
+ namespace: "healthcloud",
3233
+ version: VERSION,
3234
+ representationName: RepresentationType,
3235
+ };
3236
+ luvio.publishStoreMetadata(key, storeMetadataParams);
3237
+ }
3238
+ return createLink(key);
3239
+ };
3240
+ function getTypeCacheKeys(luvio, input, fullPathFactory) {
3241
+ const rootKeySet = new StoreKeyMap();
3242
+ // root cache key (uses fullPathFactory if keyBuilderFromType isn't defined)
3243
+ const rootKey = keyBuilderFromType(luvio, input);
3244
+ rootKeySet.set(rootKey, {
3245
+ namespace: keyPrefix,
3246
+ representationName: RepresentationType,
3247
+ mergeable: false
3248
+ });
3249
+ return rootKeySet;
3250
+ }
3251
+
3252
+ function select(luvio, params) {
3253
+ return select$1();
3254
+ }
3255
+ function getResponseCacheKeys(luvio, resourceParams, response) {
3256
+ return getTypeCacheKeys(luvio, response);
3257
+ }
3258
+ function ingestSuccess(luvio, resourceParams, response) {
3259
+ const { body } = response;
3260
+ const key = keyBuilderFromType(luvio, body);
3261
+ luvio.storeIngest(key, ingest, body);
3262
+ const snapshot = luvio.storeLookup({
3263
+ recordId: key,
3264
+ node: select(),
3265
+ variables: {},
3266
+ });
3267
+ if (process.env.NODE_ENV !== 'production') {
3268
+ if (snapshot.state !== 'Fulfilled') {
3269
+ throw new Error('Invalid network response. Expected resource response to result in Fulfilled snapshot');
3270
+ }
3271
+ }
3272
+ return snapshot;
3273
+ }
3274
+ function createResourceRequest(config) {
3275
+ const headers = {};
3276
+ return {
3277
+ baseUri: '/services/data/v58.0',
3278
+ basePath: '/connect/health/advanced-therapy-management/reschedule-slot-chain',
3279
+ method: 'post',
3280
+ body: config.body,
3281
+ urlParams: {},
3282
+ queryParams: {},
3283
+ headers,
3284
+ priority: 'normal',
3285
+ };
3286
+ }
3287
+
3288
+ const rescheduleSlotChain_ConfigPropertyNames = {
3289
+ displayName: 'rescheduleSlotChain',
3290
+ parameters: {
3291
+ required: ['RescheduleSlotChainInput'],
3292
+ optional: []
3293
+ }
3294
+ };
3295
+ function createResourceParams(config) {
3296
+ const resourceParams = {
3297
+ body: {
3298
+ RescheduleSlotChainInput: config.RescheduleSlotChainInput
3299
+ }
3300
+ };
3301
+ return resourceParams;
3302
+ }
3303
+ function typeCheckConfig(untrustedConfig) {
3304
+ const config = {};
3305
+ const untrustedConfig_RescheduleSlotChainInput = untrustedConfig.RescheduleSlotChainInput;
3306
+ const referenceRescheduleSlotChainInputRepresentationValidationError = validate$1(untrustedConfig_RescheduleSlotChainInput);
3307
+ if (referenceRescheduleSlotChainInputRepresentationValidationError === null) {
3308
+ config.RescheduleSlotChainInput = untrustedConfig_RescheduleSlotChainInput;
3309
+ }
3310
+ return config;
3311
+ }
3312
+ function validateAdapterConfig(untrustedConfig, configPropertyNames) {
3313
+ if (!untrustedIsObject(untrustedConfig)) {
3314
+ return null;
3315
+ }
3316
+ if (process.env.NODE_ENV !== 'production') {
3317
+ validateConfig(untrustedConfig, configPropertyNames);
3318
+ }
3319
+ const config = typeCheckConfig(untrustedConfig);
3320
+ if (!areRequiredParametersPresent(config, configPropertyNames)) {
3321
+ return null;
3322
+ }
3323
+ return config;
3324
+ }
3325
+ function buildNetworkSnapshot(luvio, config, options) {
3326
+ const resourceParams = createResourceParams(config);
3327
+ const request = createResourceRequest(resourceParams);
3328
+ return luvio.dispatchResourceRequest(request, options)
3329
+ .then((response) => {
3330
+ return luvio.handleSuccessResponse(() => {
3331
+ const snapshot = ingestSuccess(luvio, resourceParams, response);
3332
+ return luvio.storeBroadcast().then(() => snapshot);
3333
+ }, () => getResponseCacheKeys(luvio, resourceParams, response.body));
3334
+ }, (response) => {
3335
+ deepFreeze$2(response);
3336
+ throw response;
3337
+ });
3338
+ }
3339
+ const rescheduleSlotChainAdapterFactory = (luvio) => {
3340
+ return function rescheduleSlotChain(untrustedConfig) {
3341
+ const config = validateAdapterConfig(untrustedConfig, rescheduleSlotChain_ConfigPropertyNames);
3342
+ // Invalid or incomplete config
3343
+ if (config === null) {
3344
+ throw new Error('Invalid config for "rescheduleSlotChain"');
3345
+ }
3346
+ return buildNetworkSnapshot(luvio, config);
3347
+ };
3348
+ };
3349
+
3350
+ let bookSlotChain;
3351
+ let cancelSlotChain;
3352
+ let genericConnectApiGET;
3353
+ let genericConnectApiPOST;
3354
+ let getEntityDetailsInfo;
3355
+ let getSlots;
3356
+ let getWorkTypeServiceTerritories;
3357
+ let moveToNextStep;
3358
+ let rescheduleSlotChain;
3359
+ // Imperative GET Adapters
3360
+ let genericConnectApiGET_imperative;
3361
+ let getEntityDetailsInfo_imperative;
3362
+ let getWorkTypeServiceTerritories_imperative;
3363
+ const genericConnectApiGETMetadata = { apiFamily: 'healthcloud', name: 'genericConnectApiGET' };
3364
+ const getEntityDetailsInfoMetadata = { apiFamily: 'healthcloud', name: 'getEntityDetailsInfo' };
3365
+ const getWorkTypeServiceTerritoriesMetadata = { apiFamily: 'healthcloud', name: 'getWorkTypeServiceTerritories' };
3366
+ function bindExportsTo(luvio) {
3367
+ // LDS Adapters
3368
+ const genericConnectApiGET_ldsAdapter = createInstrumentedAdapter(createLDSAdapter(luvio, 'genericConnectApiGET', genericConnectApiGETAdapterFactory), genericConnectApiGETMetadata);
3369
+ const getEntityDetailsInfo_ldsAdapter = createInstrumentedAdapter(createLDSAdapter(luvio, 'getEntityDetailsInfo', getEntityDetailsInfoAdapterFactory), getEntityDetailsInfoMetadata);
3370
+ const getWorkTypeServiceTerritories_ldsAdapter = createInstrumentedAdapter(createLDSAdapter(luvio, 'getWorkTypeServiceTerritories', getWorkTypeServiceTerritoriesAdapterFactory), getWorkTypeServiceTerritoriesMetadata);
3371
+ function unwrapSnapshotData(factory) {
3372
+ const adapter = factory(luvio);
3373
+ return (config) => adapter(config).then(snapshot => snapshot.data);
3374
+ }
3375
+ return {
3376
+ bookSlotChain: unwrapSnapshotData(bookSlotChainAdapterFactory),
3377
+ cancelSlotChain: unwrapSnapshotData(cancelSlotChainAdapterFactory),
3378
+ genericConnectApiGET: createWireAdapterConstructor(luvio, genericConnectApiGET_ldsAdapter, genericConnectApiGETMetadata),
3379
+ genericConnectApiPOST: unwrapSnapshotData(genericConnectApiPOSTAdapterFactory),
3380
+ getEntityDetailsInfo: createWireAdapterConstructor(luvio, getEntityDetailsInfo_ldsAdapter, getEntityDetailsInfoMetadata),
3381
+ getSlots: unwrapSnapshotData(getSlotsAdapterFactory),
3382
+ getWorkTypeServiceTerritories: createWireAdapterConstructor(luvio, getWorkTypeServiceTerritories_ldsAdapter, getWorkTypeServiceTerritoriesMetadata),
3383
+ moveToNextStep: unwrapSnapshotData(moveToNextStepAdapterFactory),
3384
+ rescheduleSlotChain: unwrapSnapshotData(rescheduleSlotChainAdapterFactory),
3385
+ // Imperative GET Adapters
3386
+ genericConnectApiGET_imperative: createImperativeAdapter(luvio, genericConnectApiGET_ldsAdapter, genericConnectApiGETMetadata),
3387
+ getEntityDetailsInfo_imperative: createImperativeAdapter(luvio, getEntityDetailsInfo_ldsAdapter, getEntityDetailsInfoMetadata),
3388
+ getWorkTypeServiceTerritories_imperative: createImperativeAdapter(luvio, getWorkTypeServiceTerritories_ldsAdapter, getWorkTypeServiceTerritoriesMetadata)
3389
+ };
3390
+ }
3391
+ withDefaultLuvio((luvio) => {
3392
+ ({
3393
+ bookSlotChain,
3394
+ cancelSlotChain,
3395
+ genericConnectApiGET,
3396
+ genericConnectApiPOST,
3397
+ getEntityDetailsInfo,
3398
+ getSlots,
3399
+ getWorkTypeServiceTerritories,
3400
+ moveToNextStep,
3401
+ rescheduleSlotChain,
3402
+ genericConnectApiGET_imperative,
3403
+ getEntityDetailsInfo_imperative,
3404
+ getWorkTypeServiceTerritories_imperative
3405
+ } = bindExportsTo(luvio));
3406
+ });
3407
+
3408
+ export { bookSlotChain, cancelSlotChain, genericConnectApiGET, genericConnectApiGET_imperative, genericConnectApiPOST, getEntityDetailsInfo, getEntityDetailsInfo_imperative, getSlots, getWorkTypeServiceTerritories, getWorkTypeServiceTerritories_imperative, moveToNextStep, rescheduleSlotChain };
3409
+ // version: 0.131.0-c1ec5b7de