@salesforce/lds-adapters-industries-healthcloud 1.100.2

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