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