@salesforce/lds-adapters-industries-scheduler 0.131.0

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