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