@salesforce/lds-adapters-industries-education 1.109.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 (32) hide show
  1. package/LICENSE.txt +82 -0
  2. package/dist/es/es2018/industries-education.js +1450 -0
  3. package/dist/types/src/generated/adapters/adapter-utils.d.ts +66 -0
  4. package/dist/types/src/generated/adapters/getAvailableTimeSlots.d.ts +27 -0
  5. package/dist/types/src/generated/adapters/getAvailableTopics.d.ts +25 -0
  6. package/dist/types/src/generated/adapters/getSuccessTeam.d.ts +26 -0
  7. package/dist/types/src/generated/artifacts/main.d.ts +3 -0
  8. package/dist/types/src/generated/artifacts/sfdc.d.ts +7 -0
  9. package/dist/types/src/generated/resources/getConnectEducationAppointmentBookingAvailableTopics.d.ts +12 -0
  10. package/dist/types/src/generated/resources/getConnectEducationSuccessTeamByAccountId.d.ts +15 -0
  11. package/dist/types/src/generated/resources/postConnectEducationAppointmentBookingAvailableTimeSlots.d.ts +16 -0
  12. package/dist/types/src/generated/types/AvailableStaff.d.ts +60 -0
  13. package/dist/types/src/generated/types/AvailableTeam.d.ts +48 -0
  14. package/dist/types/src/generated/types/AvailableTimeSlotsInputRepresentation.d.ts +44 -0
  15. package/dist/types/src/generated/types/AvailableTimeSlotsInputRepresentationData.d.ts +30 -0
  16. package/dist/types/src/generated/types/AvailableTimeSlotsOuputRepresentation.d.ts +30 -0
  17. package/dist/types/src/generated/types/AvailableTopic.d.ts +42 -0
  18. package/dist/types/src/generated/types/AvailableTopicsOutputRepresentation.d.ts +30 -0
  19. package/dist/types/src/generated/types/GetSuccessTeamResult.d.ts +40 -0
  20. package/dist/types/src/generated/types/ServiceAppointment.d.ts +38 -0
  21. package/dist/types/src/generated/types/ServiceLocation.d.ts +32 -0
  22. package/dist/types/src/generated/types/SuccessTeamOutputRepresentation.d.ts +30 -0
  23. package/dist/types/src/generated/types/TimeSlot.d.ts +38 -0
  24. package/dist/types/src/generated/types/WorkType.d.ts +35 -0
  25. package/dist/types/src/generated/types/type-utils.d.ts +39 -0
  26. package/dist/umd/es2018/industries-education.js +1460 -0
  27. package/dist/umd/es5/industries-education.js +1468 -0
  28. package/package.json +72 -0
  29. package/sfdc/index.d.ts +1 -0
  30. package/sfdc/index.js +1498 -0
  31. package/src/raml/api.raml +340 -0
  32. package/src/raml/luvio.raml +24 -0
@@ -0,0 +1,1450 @@
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 = 'education';
52
+
53
+ const { freeze: ObjectFreeze, keys: ObjectKeys, create: ObjectCreate, assign: ObjectAssign } = Object;
54
+ const { isArray: ArrayIsArray } = Array;
55
+ const { stringify: JSONStringify } = JSON;
56
+ function equalsArray(a, b, equalsItem) {
57
+ const aLength = a.length;
58
+ const bLength = b.length;
59
+ if (aLength !== bLength) {
60
+ return false;
61
+ }
62
+ for (let i = 0; i < aLength; i++) {
63
+ if (equalsItem(a[i], b[i]) === false) {
64
+ return false;
65
+ }
66
+ }
67
+ return true;
68
+ }
69
+ function equalsObject(a, b, equalsProp) {
70
+ const aKeys = ObjectKeys(a).sort();
71
+ const bKeys = ObjectKeys(b).sort();
72
+ const aKeysLength = aKeys.length;
73
+ const bKeysLength = bKeys.length;
74
+ if (aKeysLength !== bKeysLength) {
75
+ return false;
76
+ }
77
+ for (let i = 0; i < aKeys.length; i++) {
78
+ const key = aKeys[i];
79
+ if (key !== bKeys[i]) {
80
+ return false;
81
+ }
82
+ if (equalsProp(a[key], b[key]) === false) {
83
+ return false;
84
+ }
85
+ }
86
+ return true;
87
+ }
88
+ function createLink(ref) {
89
+ return {
90
+ __ref: serializeStructuredKey(ref),
91
+ };
92
+ }
93
+
94
+ function validate$7(obj, path = 'AvailableTimeSlotsInputRepresentation') {
95
+ const v_error = (() => {
96
+ if (typeof obj !== 'object' || ArrayIsArray(obj) || obj === null) {
97
+ return new TypeError('Expected "object" but received "' + typeof obj + '" (at "' + path + '")');
98
+ }
99
+ if (obj.endTime !== undefined) {
100
+ const obj_endTime = obj.endTime;
101
+ const path_endTime = path + '.endTime';
102
+ if (typeof obj_endTime !== 'string') {
103
+ return new TypeError('Expected "string" but received "' + typeof obj_endTime + '" (at "' + path_endTime + '")');
104
+ }
105
+ }
106
+ const obj_engagementChannelTypeIds = obj.engagementChannelTypeIds;
107
+ const path_engagementChannelTypeIds = path + '.engagementChannelTypeIds';
108
+ if (!ArrayIsArray(obj_engagementChannelTypeIds)) {
109
+ return new TypeError('Expected "array" but received "' + typeof obj_engagementChannelTypeIds + '" (at "' + path_engagementChannelTypeIds + '")');
110
+ }
111
+ for (let i = 0; i < obj_engagementChannelTypeIds.length; i++) {
112
+ const obj_engagementChannelTypeIds_item = obj_engagementChannelTypeIds[i];
113
+ const path_engagementChannelTypeIds_item = path_engagementChannelTypeIds + '[' + i + ']';
114
+ if (typeof obj_engagementChannelTypeIds_item !== 'string') {
115
+ return new TypeError('Expected "string" but received "' + typeof obj_engagementChannelTypeIds_item + '" (at "' + path_engagementChannelTypeIds_item + '")');
116
+ }
117
+ }
118
+ const obj_serviceResourceIds = obj.serviceResourceIds;
119
+ const path_serviceResourceIds = path + '.serviceResourceIds';
120
+ if (!ArrayIsArray(obj_serviceResourceIds)) {
121
+ return new TypeError('Expected "array" but received "' + typeof obj_serviceResourceIds + '" (at "' + path_serviceResourceIds + '")');
122
+ }
123
+ for (let i = 0; i < obj_serviceResourceIds.length; i++) {
124
+ const obj_serviceResourceIds_item = obj_serviceResourceIds[i];
125
+ const path_serviceResourceIds_item = path_serviceResourceIds + '[' + i + ']';
126
+ if (typeof obj_serviceResourceIds_item !== 'string') {
127
+ return new TypeError('Expected "string" but received "' + typeof obj_serviceResourceIds_item + '" (at "' + path_serviceResourceIds_item + '")');
128
+ }
129
+ }
130
+ const obj_serviceTerritoryIds = obj.serviceTerritoryIds;
131
+ const path_serviceTerritoryIds = path + '.serviceTerritoryIds';
132
+ if (!ArrayIsArray(obj_serviceTerritoryIds)) {
133
+ return new TypeError('Expected "array" but received "' + typeof obj_serviceTerritoryIds + '" (at "' + path_serviceTerritoryIds + '")');
134
+ }
135
+ for (let i = 0; i < obj_serviceTerritoryIds.length; i++) {
136
+ const obj_serviceTerritoryIds_item = obj_serviceTerritoryIds[i];
137
+ const path_serviceTerritoryIds_item = path_serviceTerritoryIds + '[' + i + ']';
138
+ if (typeof obj_serviceTerritoryIds_item !== 'string') {
139
+ return new TypeError('Expected "string" but received "' + typeof obj_serviceTerritoryIds_item + '" (at "' + path_serviceTerritoryIds_item + '")');
140
+ }
141
+ }
142
+ if (obj.startTime !== undefined) {
143
+ const obj_startTime = obj.startTime;
144
+ const path_startTime = path + '.startTime';
145
+ if (typeof obj_startTime !== 'string') {
146
+ return new TypeError('Expected "string" but received "' + typeof obj_startTime + '" (at "' + path_startTime + '")');
147
+ }
148
+ }
149
+ const obj_workTypeGroupId = obj.workTypeGroupId;
150
+ const path_workTypeGroupId = path + '.workTypeGroupId';
151
+ if (typeof obj_workTypeGroupId !== 'string') {
152
+ return new TypeError('Expected "string" but received "' + typeof obj_workTypeGroupId + '" (at "' + path_workTypeGroupId + '")');
153
+ }
154
+ })();
155
+ return v_error === undefined ? null : v_error;
156
+ }
157
+
158
+ const VERSION$6 = "cfd94fbef61f52ffe43428e23e7a68c8";
159
+ function validate$6(obj, path = 'TimeSlot') {
160
+ const v_error = (() => {
161
+ if (typeof obj !== 'object' || ArrayIsArray(obj) || obj === null) {
162
+ return new TypeError('Expected "object" but received "' + typeof obj + '" (at "' + path + '")');
163
+ }
164
+ if (obj.endTime !== undefined) {
165
+ const obj_endTime = obj.endTime;
166
+ const path_endTime = path + '.endTime';
167
+ if (typeof obj_endTime !== 'string') {
168
+ return new TypeError('Expected "string" but received "' + typeof obj_endTime + '" (at "' + path_endTime + '")');
169
+ }
170
+ }
171
+ if (obj.serviceResourceId !== undefined) {
172
+ const obj_serviceResourceId = obj.serviceResourceId;
173
+ const path_serviceResourceId = path + '.serviceResourceId';
174
+ if (typeof obj_serviceResourceId !== 'string') {
175
+ return new TypeError('Expected "string" but received "' + typeof obj_serviceResourceId + '" (at "' + path_serviceResourceId + '")');
176
+ }
177
+ }
178
+ if (obj.serviceTerritoryId !== undefined) {
179
+ const obj_serviceTerritoryId = obj.serviceTerritoryId;
180
+ const path_serviceTerritoryId = path + '.serviceTerritoryId';
181
+ if (typeof obj_serviceTerritoryId !== 'string') {
182
+ return new TypeError('Expected "string" but received "' + typeof obj_serviceTerritoryId + '" (at "' + path_serviceTerritoryId + '")');
183
+ }
184
+ }
185
+ if (obj.startTime !== undefined) {
186
+ const obj_startTime = obj.startTime;
187
+ const path_startTime = path + '.startTime';
188
+ if (typeof obj_startTime !== 'string') {
189
+ return new TypeError('Expected "string" but received "' + typeof obj_startTime + '" (at "' + path_startTime + '")');
190
+ }
191
+ }
192
+ })();
193
+ return v_error === undefined ? null : v_error;
194
+ }
195
+ const select$9 = function TimeSlotSelect() {
196
+ return {
197
+ kind: 'Fragment',
198
+ version: VERSION$6,
199
+ private: [],
200
+ selections: [
201
+ {
202
+ name: 'endTime',
203
+ kind: 'Scalar',
204
+ required: false
205
+ },
206
+ {
207
+ name: 'serviceResourceId',
208
+ kind: 'Scalar',
209
+ required: false
210
+ },
211
+ {
212
+ name: 'serviceTerritoryId',
213
+ kind: 'Scalar',
214
+ required: false
215
+ },
216
+ {
217
+ name: 'startTime',
218
+ kind: 'Scalar',
219
+ required: false
220
+ }
221
+ ]
222
+ };
223
+ };
224
+ function equals$6(existing, incoming) {
225
+ const existing_endTime = existing.endTime;
226
+ const incoming_endTime = incoming.endTime;
227
+ // if at least one of these optionals is defined
228
+ if (existing_endTime !== undefined || incoming_endTime !== undefined) {
229
+ // if one of these is not defined we know the other is defined and therefore
230
+ // not equal
231
+ if (existing_endTime === undefined || incoming_endTime === undefined) {
232
+ return false;
233
+ }
234
+ if (!(existing_endTime === incoming_endTime)) {
235
+ return false;
236
+ }
237
+ }
238
+ const existing_serviceResourceId = existing.serviceResourceId;
239
+ const incoming_serviceResourceId = incoming.serviceResourceId;
240
+ // if at least one of these optionals is defined
241
+ if (existing_serviceResourceId !== undefined || incoming_serviceResourceId !== undefined) {
242
+ // if one of these is not defined we know the other is defined and therefore
243
+ // not equal
244
+ if (existing_serviceResourceId === undefined || incoming_serviceResourceId === undefined) {
245
+ return false;
246
+ }
247
+ if (!(existing_serviceResourceId === incoming_serviceResourceId)) {
248
+ return false;
249
+ }
250
+ }
251
+ const existing_serviceTerritoryId = existing.serviceTerritoryId;
252
+ const incoming_serviceTerritoryId = incoming.serviceTerritoryId;
253
+ // if at least one of these optionals is defined
254
+ if (existing_serviceTerritoryId !== undefined || incoming_serviceTerritoryId !== undefined) {
255
+ // if one of these is not defined we know the other is defined and therefore
256
+ // not equal
257
+ if (existing_serviceTerritoryId === undefined || incoming_serviceTerritoryId === undefined) {
258
+ return false;
259
+ }
260
+ if (!(existing_serviceTerritoryId === incoming_serviceTerritoryId)) {
261
+ return false;
262
+ }
263
+ }
264
+ const existing_startTime = existing.startTime;
265
+ const incoming_startTime = incoming.startTime;
266
+ // if at least one of these optionals is defined
267
+ if (existing_startTime !== undefined || incoming_startTime !== undefined) {
268
+ // if one of these is not defined we know the other is defined and therefore
269
+ // not equal
270
+ if (existing_startTime === undefined || incoming_startTime === undefined) {
271
+ return false;
272
+ }
273
+ if (!(existing_startTime === incoming_startTime)) {
274
+ return false;
275
+ }
276
+ }
277
+ return true;
278
+ }
279
+
280
+ const VERSION$5 = "9c2ef94b89ee532c50c8423528617441";
281
+ function validate$5(obj, path = 'AvailableTimeSlotsOuputRepresentation') {
282
+ const v_error = (() => {
283
+ if (typeof obj !== 'object' || ArrayIsArray(obj) || obj === null) {
284
+ return new TypeError('Expected "object" but received "' + typeof obj + '" (at "' + path + '")');
285
+ }
286
+ const obj_timeSlots = obj.timeSlots;
287
+ const path_timeSlots = path + '.timeSlots';
288
+ if (!ArrayIsArray(obj_timeSlots)) {
289
+ return new TypeError('Expected "array" but received "' + typeof obj_timeSlots + '" (at "' + path_timeSlots + '")');
290
+ }
291
+ for (let i = 0; i < obj_timeSlots.length; i++) {
292
+ const obj_timeSlots_item = obj_timeSlots[i];
293
+ const path_timeSlots_item = path_timeSlots + '[' + i + ']';
294
+ const referencepath_timeSlots_itemValidationError = validate$6(obj_timeSlots_item, path_timeSlots_item);
295
+ if (referencepath_timeSlots_itemValidationError !== null) {
296
+ let message = 'Object doesn\'t match TimeSlot (at "' + path_timeSlots_item + '")\n';
297
+ message += referencepath_timeSlots_itemValidationError.message.split('\n').map((line) => '\t' + line).join('\n');
298
+ return new TypeError(message);
299
+ }
300
+ }
301
+ })();
302
+ return v_error === undefined ? null : v_error;
303
+ }
304
+ const RepresentationType$2 = 'AvailableTimeSlotsOuputRepresentation';
305
+ function normalize$2(input, existing, path, luvio, store, timestamp) {
306
+ return input;
307
+ }
308
+ const select$8 = function AvailableTimeSlotsOuputRepresentationSelect() {
309
+ const { selections: TimeSlot__selections, opaque: TimeSlot__opaque, } = select$9();
310
+ return {
311
+ kind: 'Fragment',
312
+ version: VERSION$5,
313
+ private: [],
314
+ selections: [
315
+ {
316
+ name: 'timeSlots',
317
+ kind: 'Object',
318
+ plural: true,
319
+ selections: TimeSlot__selections
320
+ }
321
+ ]
322
+ };
323
+ };
324
+ function equals$5(existing, incoming) {
325
+ const existing_timeSlots = existing.timeSlots;
326
+ const incoming_timeSlots = incoming.timeSlots;
327
+ const equals_timeSlots_items = equalsArray(existing_timeSlots, incoming_timeSlots, (existing_timeSlots_item, incoming_timeSlots_item) => {
328
+ if (!(equals$6(existing_timeSlots_item, incoming_timeSlots_item))) {
329
+ return false;
330
+ }
331
+ });
332
+ if (equals_timeSlots_items === false) {
333
+ return false;
334
+ }
335
+ return true;
336
+ }
337
+ const ingest$2 = function AvailableTimeSlotsOuputRepresentationIngest(input, path, luvio, store, timestamp) {
338
+ if (process.env.NODE_ENV !== 'production') {
339
+ const validateError = validate$5(input);
340
+ if (validateError !== null) {
341
+ throw validateError;
342
+ }
343
+ }
344
+ const key = path.fullPath;
345
+ const existingRecord = store.readEntry(key);
346
+ const ttlToUse = path.ttl !== undefined ? path.ttl : 360000;
347
+ let incomingRecord = normalize$2(input, store.readEntry(key), {
348
+ fullPath: key,
349
+ parent: path.parent,
350
+ propertyName: path.propertyName,
351
+ ttl: ttlToUse
352
+ });
353
+ if (existingRecord === undefined || equals$5(existingRecord, incomingRecord) === false) {
354
+ luvio.storePublish(key, incomingRecord);
355
+ }
356
+ if (ttlToUse !== undefined) {
357
+ const storeMetadataParams = {
358
+ ttl: ttlToUse,
359
+ namespace: "education",
360
+ version: VERSION$5,
361
+ representationName: RepresentationType$2,
362
+ };
363
+ luvio.publishStoreMetadata(key, storeMetadataParams);
364
+ }
365
+ return createLink(key);
366
+ };
367
+ function getTypeCacheKeys$2(luvio, input, fullPathFactory) {
368
+ const rootKeySet = new StoreKeyMap();
369
+ // root cache key (uses fullPathFactory if keyBuilderFromType isn't defined)
370
+ const rootKey = fullPathFactory();
371
+ rootKeySet.set(rootKey, {
372
+ namespace: keyPrefix,
373
+ representationName: RepresentationType$2,
374
+ mergeable: false
375
+ });
376
+ return rootKeySet;
377
+ }
378
+
379
+ function select$7(luvio, params) {
380
+ return select$8();
381
+ }
382
+ function keyBuilder$5(luvio, params) {
383
+ return keyPrefix + '::AvailableTimeSlotsOuputRepresentation:(' + (params.body.availableTimeSlotsInput.endTime === undefined ? 'availableTimeSlotsInput.endTime' : 'availableTimeSlotsInput.endTime:' + params.body.availableTimeSlotsInput.endTime) + '::' + 'availableTimeSlotsInput.engagementChannelTypeIds:' + params.body.availableTimeSlotsInput.engagementChannelTypeIds + '::' + 'availableTimeSlotsInput.serviceResourceIds:' + params.body.availableTimeSlotsInput.serviceResourceIds + '::' + 'availableTimeSlotsInput.serviceTerritoryIds:' + params.body.availableTimeSlotsInput.serviceTerritoryIds + '::' + (params.body.availableTimeSlotsInput.startTime === undefined ? 'availableTimeSlotsInput.startTime' : 'availableTimeSlotsInput.startTime:' + params.body.availableTimeSlotsInput.startTime) + '::' + 'availableTimeSlotsInput.workTypeGroupId:' + params.body.availableTimeSlotsInput.workTypeGroupId + ')';
384
+ }
385
+ function getResponseCacheKeys$2(luvio, resourceParams, response) {
386
+ return getTypeCacheKeys$2(luvio, response, () => keyBuilder$5(luvio, resourceParams));
387
+ }
388
+ function ingestSuccess$2(luvio, resourceParams, response, snapshotRefresh) {
389
+ const { body } = response;
390
+ const key = keyBuilder$5(luvio, resourceParams);
391
+ luvio.storeIngest(key, ingest$2, body);
392
+ const snapshot = luvio.storeLookup({
393
+ recordId: key,
394
+ node: select$7(),
395
+ variables: {},
396
+ }, snapshotRefresh);
397
+ if (process.env.NODE_ENV !== 'production') {
398
+ if (snapshot.state !== 'Fulfilled') {
399
+ throw new Error('Invalid network response. Expected resource response to result in Fulfilled snapshot');
400
+ }
401
+ }
402
+ return snapshot;
403
+ }
404
+ function ingestError$2(luvio, params, error, snapshotRefresh) {
405
+ const key = keyBuilder$5(luvio, params);
406
+ const errorSnapshot = luvio.errorSnapshot(error, snapshotRefresh);
407
+ luvio.storeIngestError(key, errorSnapshot);
408
+ return errorSnapshot;
409
+ }
410
+ function createResourceRequest$2(config) {
411
+ const headers = {};
412
+ return {
413
+ baseUri: '/services/data/v58.0',
414
+ basePath: '/connect/education/appointment-booking/available-time-slots',
415
+ method: 'post',
416
+ body: config.body,
417
+ urlParams: {},
418
+ queryParams: {},
419
+ headers,
420
+ priority: 'normal',
421
+ };
422
+ }
423
+
424
+ const getAvailableTimeSlots_ConfigPropertyNames = {
425
+ displayName: 'getAvailableTimeSlots',
426
+ parameters: {
427
+ required: ['availableTimeSlotsInput'],
428
+ optional: []
429
+ }
430
+ };
431
+ function createResourceParams$2(config) {
432
+ const resourceParams = {
433
+ body: {
434
+ availableTimeSlotsInput: config.availableTimeSlotsInput
435
+ }
436
+ };
437
+ return resourceParams;
438
+ }
439
+ function keyBuilder$4(luvio, config) {
440
+ const resourceParams = createResourceParams$2(config);
441
+ return keyBuilder$5(luvio, resourceParams);
442
+ }
443
+ function typeCheckConfig$2(untrustedConfig) {
444
+ const config = {};
445
+ const untrustedConfig_availableTimeSlotsInput = untrustedConfig.availableTimeSlotsInput;
446
+ const referenceAvailableTimeSlotsInputRepresentationValidationError = validate$7(untrustedConfig_availableTimeSlotsInput);
447
+ if (referenceAvailableTimeSlotsInputRepresentationValidationError === null) {
448
+ config.availableTimeSlotsInput = untrustedConfig_availableTimeSlotsInput;
449
+ }
450
+ return config;
451
+ }
452
+ function validateAdapterConfig$2(untrustedConfig, configPropertyNames) {
453
+ if (!untrustedIsObject(untrustedConfig)) {
454
+ return null;
455
+ }
456
+ if (process.env.NODE_ENV !== 'production') {
457
+ validateConfig(untrustedConfig, configPropertyNames);
458
+ }
459
+ const config = typeCheckConfig$2(untrustedConfig);
460
+ if (!areRequiredParametersPresent(config, configPropertyNames)) {
461
+ return null;
462
+ }
463
+ return config;
464
+ }
465
+ function adapterFragment$2(luvio, config) {
466
+ createResourceParams$2(config);
467
+ return select$7();
468
+ }
469
+ function onFetchResponseSuccess$2(luvio, config, resourceParams, response) {
470
+ const snapshot = ingestSuccess$2(luvio, resourceParams, response, {
471
+ config,
472
+ resolve: () => buildNetworkSnapshot$2(luvio, config, snapshotRefreshOptions)
473
+ });
474
+ return luvio.storeBroadcast().then(() => snapshot);
475
+ }
476
+ function onFetchResponseError$2(luvio, config, resourceParams, response) {
477
+ const snapshot = ingestError$2(luvio, resourceParams, response, {
478
+ config,
479
+ resolve: () => buildNetworkSnapshot$2(luvio, config, snapshotRefreshOptions)
480
+ });
481
+ return luvio.storeBroadcast().then(() => snapshot);
482
+ }
483
+ function buildNetworkSnapshot$2(luvio, config, options) {
484
+ const resourceParams = createResourceParams$2(config);
485
+ const request = createResourceRequest$2(resourceParams);
486
+ return luvio.dispatchResourceRequest(request, options)
487
+ .then((response) => {
488
+ return luvio.handleSuccessResponse(() => onFetchResponseSuccess$2(luvio, config, resourceParams, response), () => getResponseCacheKeys$2(luvio, resourceParams, response.body));
489
+ }, (response) => {
490
+ return luvio.handleErrorResponse(() => onFetchResponseError$2(luvio, config, resourceParams, response));
491
+ });
492
+ }
493
+ function buildNetworkSnapshotCachePolicy$2(context, coercedAdapterRequestContext) {
494
+ const { luvio, config } = context;
495
+ const { networkPriority, requestCorrelator, eventObservers } = coercedAdapterRequestContext;
496
+ const dispatchOptions = {
497
+ resourceRequestContext: {
498
+ requestCorrelator,
499
+ luvioRequestMethod: 'get',
500
+ },
501
+ eventObservers
502
+ };
503
+ if (networkPriority !== 'normal') {
504
+ dispatchOptions.overrides = {
505
+ priority: networkPriority
506
+ };
507
+ }
508
+ return buildNetworkSnapshot$2(luvio, config, dispatchOptions);
509
+ }
510
+ function buildCachedSnapshotCachePolicy$2(context, storeLookup) {
511
+ const { luvio, config } = context;
512
+ const selector = {
513
+ recordId: keyBuilder$4(luvio, config),
514
+ node: adapterFragment$2(luvio, config),
515
+ variables: {},
516
+ };
517
+ const cacheSnapshot = storeLookup(selector, {
518
+ config,
519
+ resolve: () => buildNetworkSnapshot$2(luvio, config, snapshotRefreshOptions)
520
+ });
521
+ return cacheSnapshot;
522
+ }
523
+ const getAvailableTimeSlotsAdapterFactory = (luvio) => function education__getAvailableTimeSlots(untrustedConfig, requestContext) {
524
+ const config = validateAdapterConfig$2(untrustedConfig, getAvailableTimeSlots_ConfigPropertyNames);
525
+ // Invalid or incomplete config
526
+ if (config === null) {
527
+ return null;
528
+ }
529
+ return luvio.applyCachePolicy((requestContext || {}), { config, luvio }, // BuildSnapshotContext
530
+ buildCachedSnapshotCachePolicy$2, buildNetworkSnapshotCachePolicy$2);
531
+ };
532
+
533
+ const VERSION$4 = "c470aba735607497dd11c1fcd34489d1";
534
+ function validate$4(obj, path = 'AvailableTopic') {
535
+ const v_error = (() => {
536
+ if (typeof obj !== 'object' || ArrayIsArray(obj) || obj === null) {
537
+ return new TypeError('Expected "object" but received "' + typeof obj + '" (at "' + path + '")');
538
+ }
539
+ if (obj.parentWorkTypeGroupName !== undefined) {
540
+ const obj_parentWorkTypeGroupName = obj.parentWorkTypeGroupName;
541
+ const path_parentWorkTypeGroupName = path + '.parentWorkTypeGroupName';
542
+ if (typeof obj_parentWorkTypeGroupName !== 'string') {
543
+ return new TypeError('Expected "string" but received "' + typeof obj_parentWorkTypeGroupName + '" (at "' + path_parentWorkTypeGroupName + '")');
544
+ }
545
+ }
546
+ if (obj.serviceTerritoryWorkTypes !== undefined) {
547
+ const obj_serviceTerritoryWorkTypes = obj.serviceTerritoryWorkTypes;
548
+ const path_serviceTerritoryWorkTypes = path + '.serviceTerritoryWorkTypes';
549
+ if (typeof obj_serviceTerritoryWorkTypes !== 'object' || ArrayIsArray(obj_serviceTerritoryWorkTypes) || obj_serviceTerritoryWorkTypes === null) {
550
+ return new TypeError('Expected "object" but received "' + typeof obj_serviceTerritoryWorkTypes + '" (at "' + path_serviceTerritoryWorkTypes + '")');
551
+ }
552
+ const obj_serviceTerritoryWorkTypes_keys = ObjectKeys(obj_serviceTerritoryWorkTypes);
553
+ for (let i = 0; i < obj_serviceTerritoryWorkTypes_keys.length; i++) {
554
+ const key = obj_serviceTerritoryWorkTypes_keys[i];
555
+ const obj_serviceTerritoryWorkTypes_prop = obj_serviceTerritoryWorkTypes[key];
556
+ const path_serviceTerritoryWorkTypes_prop = path_serviceTerritoryWorkTypes + '["' + key + '"]';
557
+ if (obj_serviceTerritoryWorkTypes_prop === undefined) {
558
+ return new TypeError('Expected "defined" but received "' + typeof obj_serviceTerritoryWorkTypes_prop + '" (at "' + path_serviceTerritoryWorkTypes_prop + '")');
559
+ }
560
+ }
561
+ }
562
+ if (obj.workTypeGroupId !== undefined) {
563
+ const obj_workTypeGroupId = obj.workTypeGroupId;
564
+ const path_workTypeGroupId = path + '.workTypeGroupId';
565
+ if (typeof obj_workTypeGroupId !== 'string') {
566
+ return new TypeError('Expected "string" but received "' + typeof obj_workTypeGroupId + '" (at "' + path_workTypeGroupId + '")');
567
+ }
568
+ }
569
+ if (obj.workTypeGroupName !== undefined) {
570
+ const obj_workTypeGroupName = obj.workTypeGroupName;
571
+ const path_workTypeGroupName = path + '.workTypeGroupName';
572
+ if (typeof obj_workTypeGroupName !== 'string') {
573
+ return new TypeError('Expected "string" but received "' + typeof obj_workTypeGroupName + '" (at "' + path_workTypeGroupName + '")');
574
+ }
575
+ }
576
+ })();
577
+ return v_error === undefined ? null : v_error;
578
+ }
579
+ const select$6 = function AvailableTopicSelect() {
580
+ return {
581
+ kind: 'Fragment',
582
+ version: VERSION$4,
583
+ private: [],
584
+ selections: [
585
+ {
586
+ name: 'parentWorkTypeGroupName',
587
+ kind: 'Scalar',
588
+ required: false
589
+ },
590
+ {
591
+ name: 'serviceTerritoryWorkTypes',
592
+ kind: 'Object',
593
+ // any
594
+ },
595
+ {
596
+ name: 'workTypeGroupId',
597
+ kind: 'Scalar',
598
+ required: false
599
+ },
600
+ {
601
+ name: 'workTypeGroupName',
602
+ kind: 'Scalar',
603
+ required: false
604
+ }
605
+ ]
606
+ };
607
+ };
608
+ function equals$4(existing, incoming) {
609
+ const existing_parentWorkTypeGroupName = existing.parentWorkTypeGroupName;
610
+ const incoming_parentWorkTypeGroupName = incoming.parentWorkTypeGroupName;
611
+ // if at least one of these optionals is defined
612
+ if (existing_parentWorkTypeGroupName !== undefined || incoming_parentWorkTypeGroupName !== undefined) {
613
+ // if one of these is not defined we know the other is defined and therefore
614
+ // not equal
615
+ if (existing_parentWorkTypeGroupName === undefined || incoming_parentWorkTypeGroupName === undefined) {
616
+ return false;
617
+ }
618
+ if (!(existing_parentWorkTypeGroupName === incoming_parentWorkTypeGroupName)) {
619
+ return false;
620
+ }
621
+ }
622
+ const existing_workTypeGroupId = existing.workTypeGroupId;
623
+ const incoming_workTypeGroupId = incoming.workTypeGroupId;
624
+ // if at least one of these optionals is defined
625
+ if (existing_workTypeGroupId !== undefined || incoming_workTypeGroupId !== undefined) {
626
+ // if one of these is not defined we know the other is defined and therefore
627
+ // not equal
628
+ if (existing_workTypeGroupId === undefined || incoming_workTypeGroupId === undefined) {
629
+ return false;
630
+ }
631
+ if (!(existing_workTypeGroupId === incoming_workTypeGroupId)) {
632
+ return false;
633
+ }
634
+ }
635
+ const existing_workTypeGroupName = existing.workTypeGroupName;
636
+ const incoming_workTypeGroupName = incoming.workTypeGroupName;
637
+ // if at least one of these optionals is defined
638
+ if (existing_workTypeGroupName !== undefined || incoming_workTypeGroupName !== undefined) {
639
+ // if one of these is not defined we know the other is defined and therefore
640
+ // not equal
641
+ if (existing_workTypeGroupName === undefined || incoming_workTypeGroupName === undefined) {
642
+ return false;
643
+ }
644
+ if (!(existing_workTypeGroupName === incoming_workTypeGroupName)) {
645
+ return false;
646
+ }
647
+ }
648
+ const existing_serviceTerritoryWorkTypes = existing.serviceTerritoryWorkTypes;
649
+ const incoming_serviceTerritoryWorkTypes = incoming.serviceTerritoryWorkTypes;
650
+ // if at least one of these optionals is defined
651
+ if (existing_serviceTerritoryWorkTypes !== undefined || incoming_serviceTerritoryWorkTypes !== undefined) {
652
+ // if one of these is not defined we know the other is defined and therefore
653
+ // not equal
654
+ if (existing_serviceTerritoryWorkTypes === undefined || incoming_serviceTerritoryWorkTypes === undefined) {
655
+ return false;
656
+ }
657
+ const equals_serviceTerritoryWorkTypes_props = equalsObject(existing_serviceTerritoryWorkTypes, incoming_serviceTerritoryWorkTypes, (existing_serviceTerritoryWorkTypes_prop, incoming_serviceTerritoryWorkTypes_prop) => {
658
+ if (JSONStringify(incoming_serviceTerritoryWorkTypes_prop) !== JSONStringify(existing_serviceTerritoryWorkTypes_prop)) {
659
+ return false;
660
+ }
661
+ });
662
+ if (equals_serviceTerritoryWorkTypes_props === false) {
663
+ return false;
664
+ }
665
+ }
666
+ return true;
667
+ }
668
+
669
+ const VERSION$3 = "3cb0110faf688dc57056aa83be527181";
670
+ function validate$3(obj, path = 'AvailableTopicsOutputRepresentation') {
671
+ const v_error = (() => {
672
+ if (typeof obj !== 'object' || ArrayIsArray(obj) || obj === null) {
673
+ return new TypeError('Expected "object" but received "' + typeof obj + '" (at "' + path + '")');
674
+ }
675
+ const obj_topics = obj.topics;
676
+ const path_topics = path + '.topics';
677
+ if (!ArrayIsArray(obj_topics)) {
678
+ return new TypeError('Expected "array" but received "' + typeof obj_topics + '" (at "' + path_topics + '")');
679
+ }
680
+ for (let i = 0; i < obj_topics.length; i++) {
681
+ const obj_topics_item = obj_topics[i];
682
+ const path_topics_item = path_topics + '[' + i + ']';
683
+ const referencepath_topics_itemValidationError = validate$4(obj_topics_item, path_topics_item);
684
+ if (referencepath_topics_itemValidationError !== null) {
685
+ let message = 'Object doesn\'t match AvailableTopic (at "' + path_topics_item + '")\n';
686
+ message += referencepath_topics_itemValidationError.message.split('\n').map((line) => '\t' + line).join('\n');
687
+ return new TypeError(message);
688
+ }
689
+ }
690
+ })();
691
+ return v_error === undefined ? null : v_error;
692
+ }
693
+ const RepresentationType$1 = 'AvailableTopicsOutputRepresentation';
694
+ function normalize$1(input, existing, path, luvio, store, timestamp) {
695
+ return input;
696
+ }
697
+ const select$5 = function AvailableTopicsOutputRepresentationSelect() {
698
+ const { selections: AvailableTopic__selections, opaque: AvailableTopic__opaque, } = select$6();
699
+ return {
700
+ kind: 'Fragment',
701
+ version: VERSION$3,
702
+ private: [],
703
+ selections: [
704
+ {
705
+ name: 'topics',
706
+ kind: 'Object',
707
+ plural: true,
708
+ selections: AvailableTopic__selections
709
+ }
710
+ ]
711
+ };
712
+ };
713
+ function equals$3(existing, incoming) {
714
+ const existing_topics = existing.topics;
715
+ const incoming_topics = incoming.topics;
716
+ const equals_topics_items = equalsArray(existing_topics, incoming_topics, (existing_topics_item, incoming_topics_item) => {
717
+ if (!(equals$4(existing_topics_item, incoming_topics_item))) {
718
+ return false;
719
+ }
720
+ });
721
+ if (equals_topics_items === false) {
722
+ return false;
723
+ }
724
+ return true;
725
+ }
726
+ const ingest$1 = function AvailableTopicsOutputRepresentationIngest(input, path, luvio, store, timestamp) {
727
+ if (process.env.NODE_ENV !== 'production') {
728
+ const validateError = validate$3(input);
729
+ if (validateError !== null) {
730
+ throw validateError;
731
+ }
732
+ }
733
+ const key = path.fullPath;
734
+ const existingRecord = store.readEntry(key);
735
+ const ttlToUse = path.ttl !== undefined ? path.ttl : 360000;
736
+ let incomingRecord = normalize$1(input, store.readEntry(key), {
737
+ fullPath: key,
738
+ parent: path.parent,
739
+ propertyName: path.propertyName,
740
+ ttl: ttlToUse
741
+ });
742
+ if (existingRecord === undefined || equals$3(existingRecord, incomingRecord) === false) {
743
+ luvio.storePublish(key, incomingRecord);
744
+ }
745
+ if (ttlToUse !== undefined) {
746
+ const storeMetadataParams = {
747
+ ttl: ttlToUse,
748
+ namespace: "education",
749
+ version: VERSION$3,
750
+ representationName: RepresentationType$1,
751
+ };
752
+ luvio.publishStoreMetadata(key, storeMetadataParams);
753
+ }
754
+ return createLink(key);
755
+ };
756
+ function getTypeCacheKeys$1(luvio, input, fullPathFactory) {
757
+ const rootKeySet = new StoreKeyMap();
758
+ // root cache key (uses fullPathFactory if keyBuilderFromType isn't defined)
759
+ const rootKey = fullPathFactory();
760
+ rootKeySet.set(rootKey, {
761
+ namespace: keyPrefix,
762
+ representationName: RepresentationType$1,
763
+ mergeable: false
764
+ });
765
+ return rootKeySet;
766
+ }
767
+
768
+ function select$4(luvio, params) {
769
+ return select$5();
770
+ }
771
+ function keyBuilder$3(luvio, params) {
772
+ return keyPrefix + '::AvailableTopicsOutputRepresentation:(' + ')';
773
+ }
774
+ function getResponseCacheKeys$1(luvio, resourceParams, response) {
775
+ return getTypeCacheKeys$1(luvio, response, () => keyBuilder$3());
776
+ }
777
+ function ingestSuccess$1(luvio, resourceParams, response, snapshotRefresh) {
778
+ const { body } = response;
779
+ const key = keyBuilder$3();
780
+ luvio.storeIngest(key, ingest$1, body);
781
+ const snapshot = luvio.storeLookup({
782
+ recordId: key,
783
+ node: select$4(),
784
+ variables: {},
785
+ }, snapshotRefresh);
786
+ if (process.env.NODE_ENV !== 'production') {
787
+ if (snapshot.state !== 'Fulfilled') {
788
+ throw new Error('Invalid network response. Expected resource response to result in Fulfilled snapshot');
789
+ }
790
+ }
791
+ return snapshot;
792
+ }
793
+ function ingestError$1(luvio, params, error, snapshotRefresh) {
794
+ const key = keyBuilder$3();
795
+ const errorSnapshot = luvio.errorSnapshot(error, snapshotRefresh);
796
+ luvio.storeIngestError(key, errorSnapshot);
797
+ return errorSnapshot;
798
+ }
799
+ function createResourceRequest$1(config) {
800
+ const headers = {};
801
+ return {
802
+ baseUri: '/services/data/v58.0',
803
+ basePath: '/connect/education/appointment-booking/available-topics',
804
+ method: 'get',
805
+ body: null,
806
+ urlParams: {},
807
+ queryParams: {},
808
+ headers,
809
+ priority: 'normal',
810
+ };
811
+ }
812
+
813
+ const getAvailableTopics_ConfigPropertyNames = {
814
+ displayName: 'getAvailableTopics',
815
+ parameters: {
816
+ required: [],
817
+ optional: []
818
+ }
819
+ };
820
+ function createResourceParams$1(config) {
821
+ const resourceParams = {};
822
+ return resourceParams;
823
+ }
824
+ function keyBuilder$2(luvio, config) {
825
+ return keyBuilder$3();
826
+ }
827
+ function typeCheckConfig$1(untrustedConfig) {
828
+ const config = {};
829
+ return config;
830
+ }
831
+ function validateAdapterConfig$1(untrustedConfig, configPropertyNames) {
832
+ if (!untrustedIsObject(untrustedConfig)) {
833
+ return null;
834
+ }
835
+ if (process.env.NODE_ENV !== 'production') {
836
+ validateConfig(untrustedConfig, configPropertyNames);
837
+ }
838
+ const config = typeCheckConfig$1();
839
+ if (!areRequiredParametersPresent(config, configPropertyNames)) {
840
+ return null;
841
+ }
842
+ return config;
843
+ }
844
+ function adapterFragment$1(luvio, config) {
845
+ return select$4();
846
+ }
847
+ function onFetchResponseSuccess$1(luvio, config, resourceParams, response) {
848
+ const snapshot = ingestSuccess$1(luvio, resourceParams, response, {
849
+ config,
850
+ resolve: () => buildNetworkSnapshot$1(luvio, config, snapshotRefreshOptions)
851
+ });
852
+ return luvio.storeBroadcast().then(() => snapshot);
853
+ }
854
+ function onFetchResponseError$1(luvio, config, resourceParams, response) {
855
+ const snapshot = ingestError$1(luvio, resourceParams, response, {
856
+ config,
857
+ resolve: () => buildNetworkSnapshot$1(luvio, config, snapshotRefreshOptions)
858
+ });
859
+ return luvio.storeBroadcast().then(() => snapshot);
860
+ }
861
+ function buildNetworkSnapshot$1(luvio, config, options) {
862
+ const resourceParams = createResourceParams$1();
863
+ const request = createResourceRequest$1();
864
+ return luvio.dispatchResourceRequest(request, options)
865
+ .then((response) => {
866
+ return luvio.handleSuccessResponse(() => onFetchResponseSuccess$1(luvio, config, resourceParams, response), () => getResponseCacheKeys$1(luvio, resourceParams, response.body));
867
+ }, (response) => {
868
+ return luvio.handleErrorResponse(() => onFetchResponseError$1(luvio, config, resourceParams, response));
869
+ });
870
+ }
871
+ function buildNetworkSnapshotCachePolicy$1(context, coercedAdapterRequestContext) {
872
+ const { luvio, config } = context;
873
+ const { networkPriority, requestCorrelator, eventObservers } = coercedAdapterRequestContext;
874
+ const dispatchOptions = {
875
+ resourceRequestContext: {
876
+ requestCorrelator,
877
+ luvioRequestMethod: undefined,
878
+ },
879
+ eventObservers
880
+ };
881
+ if (networkPriority !== 'normal') {
882
+ dispatchOptions.overrides = {
883
+ priority: networkPriority
884
+ };
885
+ }
886
+ return buildNetworkSnapshot$1(luvio, config, dispatchOptions);
887
+ }
888
+ function buildCachedSnapshotCachePolicy$1(context, storeLookup) {
889
+ const { luvio, config } = context;
890
+ const selector = {
891
+ recordId: keyBuilder$2(),
892
+ node: adapterFragment$1(),
893
+ variables: {},
894
+ };
895
+ const cacheSnapshot = storeLookup(selector, {
896
+ config,
897
+ resolve: () => buildNetworkSnapshot$1(luvio, config, snapshotRefreshOptions)
898
+ });
899
+ return cacheSnapshot;
900
+ }
901
+ const getAvailableTopicsAdapterFactory = (luvio) => function education__getAvailableTopics(untrustedConfig, requestContext) {
902
+ const config = validateAdapterConfig$1(untrustedConfig, getAvailableTopics_ConfigPropertyNames);
903
+ // Invalid or incomplete config
904
+ if (config === null) {
905
+ return null;
906
+ }
907
+ return luvio.applyCachePolicy((requestContext || {}), { config, luvio }, // BuildSnapshotContext
908
+ buildCachedSnapshotCachePolicy$1, buildNetworkSnapshotCachePolicy$1);
909
+ };
910
+
911
+ const VERSION$2 = "256a3344cb09454a859ca2f0645eb0bc";
912
+ function validate$2(obj, path = 'AvailableTeam') {
913
+ const v_error = (() => {
914
+ if (typeof obj !== 'object' || ArrayIsArray(obj) || obj === null) {
915
+ return new TypeError('Expected "object" but received "' + typeof obj + '" (at "' + path + '")');
916
+ }
917
+ if (obj.canSelfSchedule !== undefined) {
918
+ const obj_canSelfSchedule = obj.canSelfSchedule;
919
+ const path_canSelfSchedule = path + '.canSelfSchedule';
920
+ if (typeof obj_canSelfSchedule !== 'boolean') {
921
+ return new TypeError('Expected "boolean" but received "' + typeof obj_canSelfSchedule + '" (at "' + path_canSelfSchedule + '")');
922
+ }
923
+ }
924
+ if (obj.caseId !== undefined) {
925
+ const obj_caseId = obj.caseId;
926
+ const path_caseId = path + '.caseId';
927
+ if (typeof obj_caseId !== 'string') {
928
+ return new TypeError('Expected "string" but received "' + typeof obj_caseId + '" (at "' + path_caseId + '")');
929
+ }
930
+ }
931
+ if (obj.caseRecordTypeName !== undefined) {
932
+ const obj_caseRecordTypeName = obj.caseRecordTypeName;
933
+ const path_caseRecordTypeName = path + '.caseRecordTypeName';
934
+ if (typeof obj_caseRecordTypeName !== 'string') {
935
+ return new TypeError('Expected "string" but received "' + typeof obj_caseRecordTypeName + '" (at "' + path_caseRecordTypeName + '")');
936
+ }
937
+ }
938
+ if (obj.members !== undefined) {
939
+ const obj_members = obj.members;
940
+ const path_members = path + '.members';
941
+ if (typeof obj_members !== 'object' || ArrayIsArray(obj_members) || obj_members === null) {
942
+ return new TypeError('Expected "object" but received "' + typeof obj_members + '" (at "' + path_members + '")');
943
+ }
944
+ const obj_members_keys = ObjectKeys(obj_members);
945
+ for (let i = 0; i < obj_members_keys.length; i++) {
946
+ const key = obj_members_keys[i];
947
+ const obj_members_prop = obj_members[key];
948
+ const path_members_prop = path_members + '["' + key + '"]';
949
+ if (obj_members_prop === undefined) {
950
+ return new TypeError('Expected "defined" but received "' + typeof obj_members_prop + '" (at "' + path_members_prop + '")');
951
+ }
952
+ }
953
+ }
954
+ if (obj.name !== undefined) {
955
+ const obj_name = obj.name;
956
+ const path_name = path + '.name';
957
+ if (typeof obj_name !== 'string') {
958
+ return new TypeError('Expected "string" but received "' + typeof obj_name + '" (at "' + path_name + '")');
959
+ }
960
+ }
961
+ if (obj.teamId !== undefined) {
962
+ const obj_teamId = obj.teamId;
963
+ const path_teamId = path + '.teamId';
964
+ if (typeof obj_teamId !== 'string') {
965
+ return new TypeError('Expected "string" but received "' + typeof obj_teamId + '" (at "' + path_teamId + '")');
966
+ }
967
+ }
968
+ })();
969
+ return v_error === undefined ? null : v_error;
970
+ }
971
+ const select$3 = function AvailableTeamSelect() {
972
+ return {
973
+ kind: 'Fragment',
974
+ version: VERSION$2,
975
+ private: [],
976
+ selections: [
977
+ {
978
+ name: 'canSelfSchedule',
979
+ kind: 'Scalar',
980
+ required: false
981
+ },
982
+ {
983
+ name: 'caseId',
984
+ kind: 'Scalar',
985
+ required: false
986
+ },
987
+ {
988
+ name: 'caseRecordTypeName',
989
+ kind: 'Scalar',
990
+ required: false
991
+ },
992
+ {
993
+ name: 'members',
994
+ kind: 'Object',
995
+ // any
996
+ },
997
+ {
998
+ name: 'name',
999
+ kind: 'Scalar',
1000
+ required: false
1001
+ },
1002
+ {
1003
+ name: 'teamId',
1004
+ kind: 'Scalar',
1005
+ required: false
1006
+ }
1007
+ ]
1008
+ };
1009
+ };
1010
+ function equals$2(existing, incoming) {
1011
+ const existing_canSelfSchedule = existing.canSelfSchedule;
1012
+ const incoming_canSelfSchedule = incoming.canSelfSchedule;
1013
+ // if at least one of these optionals is defined
1014
+ if (existing_canSelfSchedule !== undefined || incoming_canSelfSchedule !== undefined) {
1015
+ // if one of these is not defined we know the other is defined and therefore
1016
+ // not equal
1017
+ if (existing_canSelfSchedule === undefined || incoming_canSelfSchedule === undefined) {
1018
+ return false;
1019
+ }
1020
+ if (!(existing_canSelfSchedule === incoming_canSelfSchedule)) {
1021
+ return false;
1022
+ }
1023
+ }
1024
+ const existing_caseId = existing.caseId;
1025
+ const incoming_caseId = incoming.caseId;
1026
+ // if at least one of these optionals is defined
1027
+ if (existing_caseId !== undefined || incoming_caseId !== undefined) {
1028
+ // if one of these is not defined we know the other is defined and therefore
1029
+ // not equal
1030
+ if (existing_caseId === undefined || incoming_caseId === undefined) {
1031
+ return false;
1032
+ }
1033
+ if (!(existing_caseId === incoming_caseId)) {
1034
+ return false;
1035
+ }
1036
+ }
1037
+ const existing_caseRecordTypeName = existing.caseRecordTypeName;
1038
+ const incoming_caseRecordTypeName = incoming.caseRecordTypeName;
1039
+ // if at least one of these optionals is defined
1040
+ if (existing_caseRecordTypeName !== undefined || incoming_caseRecordTypeName !== undefined) {
1041
+ // if one of these is not defined we know the other is defined and therefore
1042
+ // not equal
1043
+ if (existing_caseRecordTypeName === undefined || incoming_caseRecordTypeName === undefined) {
1044
+ return false;
1045
+ }
1046
+ if (!(existing_caseRecordTypeName === incoming_caseRecordTypeName)) {
1047
+ return false;
1048
+ }
1049
+ }
1050
+ const existing_name = existing.name;
1051
+ const incoming_name = incoming.name;
1052
+ // if at least one of these optionals is defined
1053
+ if (existing_name !== undefined || incoming_name !== undefined) {
1054
+ // if one of these is not defined we know the other is defined and therefore
1055
+ // not equal
1056
+ if (existing_name === undefined || incoming_name === undefined) {
1057
+ return false;
1058
+ }
1059
+ if (!(existing_name === incoming_name)) {
1060
+ return false;
1061
+ }
1062
+ }
1063
+ const existing_teamId = existing.teamId;
1064
+ const incoming_teamId = incoming.teamId;
1065
+ // if at least one of these optionals is defined
1066
+ if (existing_teamId !== undefined || incoming_teamId !== undefined) {
1067
+ // if one of these is not defined we know the other is defined and therefore
1068
+ // not equal
1069
+ if (existing_teamId === undefined || incoming_teamId === undefined) {
1070
+ return false;
1071
+ }
1072
+ if (!(existing_teamId === incoming_teamId)) {
1073
+ return false;
1074
+ }
1075
+ }
1076
+ const existing_members = existing.members;
1077
+ const incoming_members = incoming.members;
1078
+ // if at least one of these optionals is defined
1079
+ if (existing_members !== undefined || incoming_members !== undefined) {
1080
+ // if one of these is not defined we know the other is defined and therefore
1081
+ // not equal
1082
+ if (existing_members === undefined || incoming_members === undefined) {
1083
+ return false;
1084
+ }
1085
+ const equals_members_props = equalsObject(existing_members, incoming_members, (existing_members_prop, incoming_members_prop) => {
1086
+ if (JSONStringify(incoming_members_prop) !== JSONStringify(existing_members_prop)) {
1087
+ return false;
1088
+ }
1089
+ });
1090
+ if (equals_members_props === false) {
1091
+ return false;
1092
+ }
1093
+ }
1094
+ return true;
1095
+ }
1096
+
1097
+ const VERSION$1 = "4fc48796f6987d3512fb81d3baf6479c";
1098
+ function validate$1(obj, path = 'GetSuccessTeamResult') {
1099
+ const v_error = (() => {
1100
+ if (typeof obj !== 'object' || ArrayIsArray(obj) || obj === null) {
1101
+ return new TypeError('Expected "object" but received "' + typeof obj + '" (at "' + path + '")');
1102
+ }
1103
+ const obj_assignedStaff = obj.assignedStaff;
1104
+ const path_assignedStaff = path + '.assignedStaff';
1105
+ if (typeof obj_assignedStaff !== 'object' || ArrayIsArray(obj_assignedStaff) || obj_assignedStaff === null) {
1106
+ return new TypeError('Expected "object" but received "' + typeof obj_assignedStaff + '" (at "' + path_assignedStaff + '")');
1107
+ }
1108
+ const obj_assignedStaff_keys = ObjectKeys(obj_assignedStaff);
1109
+ for (let i = 0; i < obj_assignedStaff_keys.length; i++) {
1110
+ const key = obj_assignedStaff_keys[i];
1111
+ const obj_assignedStaff_prop = obj_assignedStaff[key];
1112
+ const path_assignedStaff_prop = path_assignedStaff + '["' + key + '"]';
1113
+ if (obj_assignedStaff_prop === undefined) {
1114
+ return new TypeError('Expected "defined" but received "' + typeof obj_assignedStaff_prop + '" (at "' + path_assignedStaff_prop + '")');
1115
+ }
1116
+ }
1117
+ const obj_assignedTeams = obj.assignedTeams;
1118
+ const path_assignedTeams = path + '.assignedTeams';
1119
+ if (!ArrayIsArray(obj_assignedTeams)) {
1120
+ return new TypeError('Expected "array" but received "' + typeof obj_assignedTeams + '" (at "' + path_assignedTeams + '")');
1121
+ }
1122
+ for (let i = 0; i < obj_assignedTeams.length; i++) {
1123
+ const obj_assignedTeams_item = obj_assignedTeams[i];
1124
+ const path_assignedTeams_item = path_assignedTeams + '[' + i + ']';
1125
+ const referencepath_assignedTeams_itemValidationError = validate$2(obj_assignedTeams_item, path_assignedTeams_item);
1126
+ if (referencepath_assignedTeams_itemValidationError !== null) {
1127
+ let message = 'Object doesn\'t match AvailableTeam (at "' + path_assignedTeams_item + '")\n';
1128
+ message += referencepath_assignedTeams_itemValidationError.message.split('\n').map((line) => '\t' + line).join('\n');
1129
+ return new TypeError(message);
1130
+ }
1131
+ }
1132
+ const obj_unassignedTeams = obj.unassignedTeams;
1133
+ const path_unassignedTeams = path + '.unassignedTeams';
1134
+ if (!ArrayIsArray(obj_unassignedTeams)) {
1135
+ return new TypeError('Expected "array" but received "' + typeof obj_unassignedTeams + '" (at "' + path_unassignedTeams + '")');
1136
+ }
1137
+ for (let i = 0; i < obj_unassignedTeams.length; i++) {
1138
+ const obj_unassignedTeams_item = obj_unassignedTeams[i];
1139
+ const path_unassignedTeams_item = path_unassignedTeams + '[' + i + ']';
1140
+ const referencepath_unassignedTeams_itemValidationError = validate$2(obj_unassignedTeams_item, path_unassignedTeams_item);
1141
+ if (referencepath_unassignedTeams_itemValidationError !== null) {
1142
+ let message = 'Object doesn\'t match AvailableTeam (at "' + path_unassignedTeams_item + '")\n';
1143
+ message += referencepath_unassignedTeams_itemValidationError.message.split('\n').map((line) => '\t' + line).join('\n');
1144
+ return new TypeError(message);
1145
+ }
1146
+ }
1147
+ })();
1148
+ return v_error === undefined ? null : v_error;
1149
+ }
1150
+ const select$2 = function GetSuccessTeamResultSelect() {
1151
+ const { selections: AvailableTeam__selections, opaque: AvailableTeam__opaque, } = select$3();
1152
+ return {
1153
+ kind: 'Fragment',
1154
+ version: VERSION$1,
1155
+ private: [],
1156
+ selections: [
1157
+ {
1158
+ name: 'assignedStaff',
1159
+ kind: 'Object',
1160
+ // any
1161
+ },
1162
+ {
1163
+ name: 'assignedTeams',
1164
+ kind: 'Object',
1165
+ plural: true,
1166
+ selections: AvailableTeam__selections
1167
+ },
1168
+ {
1169
+ name: 'unassignedTeams',
1170
+ kind: 'Object',
1171
+ plural: true,
1172
+ selections: AvailableTeam__selections
1173
+ }
1174
+ ]
1175
+ };
1176
+ };
1177
+ function equals$1(existing, incoming) {
1178
+ const existing_assignedStaff = existing.assignedStaff;
1179
+ const incoming_assignedStaff = incoming.assignedStaff;
1180
+ const equals_assignedStaff_props = equalsObject(existing_assignedStaff, incoming_assignedStaff, (existing_assignedStaff_prop, incoming_assignedStaff_prop) => {
1181
+ if (JSONStringify(incoming_assignedStaff_prop) !== JSONStringify(existing_assignedStaff_prop)) {
1182
+ return false;
1183
+ }
1184
+ });
1185
+ if (equals_assignedStaff_props === false) {
1186
+ return false;
1187
+ }
1188
+ const existing_assignedTeams = existing.assignedTeams;
1189
+ const incoming_assignedTeams = incoming.assignedTeams;
1190
+ const equals_assignedTeams_items = equalsArray(existing_assignedTeams, incoming_assignedTeams, (existing_assignedTeams_item, incoming_assignedTeams_item) => {
1191
+ if (!(equals$2(existing_assignedTeams_item, incoming_assignedTeams_item))) {
1192
+ return false;
1193
+ }
1194
+ });
1195
+ if (equals_assignedTeams_items === false) {
1196
+ return false;
1197
+ }
1198
+ const existing_unassignedTeams = existing.unassignedTeams;
1199
+ const incoming_unassignedTeams = incoming.unassignedTeams;
1200
+ const equals_unassignedTeams_items = equalsArray(existing_unassignedTeams, incoming_unassignedTeams, (existing_unassignedTeams_item, incoming_unassignedTeams_item) => {
1201
+ if (!(equals$2(existing_unassignedTeams_item, incoming_unassignedTeams_item))) {
1202
+ return false;
1203
+ }
1204
+ });
1205
+ if (equals_unassignedTeams_items === false) {
1206
+ return false;
1207
+ }
1208
+ return true;
1209
+ }
1210
+
1211
+ const VERSION = "bb85bc85ab5fe2cd81d05e073d1bccf5";
1212
+ function validate(obj, path = 'SuccessTeamOutputRepresentation') {
1213
+ const v_error = (() => {
1214
+ if (typeof obj !== 'object' || ArrayIsArray(obj) || obj === null) {
1215
+ return new TypeError('Expected "object" but received "' + typeof obj + '" (at "' + path + '")');
1216
+ }
1217
+ const obj_result = obj.result;
1218
+ const path_result = path + '.result';
1219
+ const referencepath_resultValidationError = validate$1(obj_result, path_result);
1220
+ if (referencepath_resultValidationError !== null) {
1221
+ let message = 'Object doesn\'t match GetSuccessTeamResult (at "' + path_result + '")\n';
1222
+ message += referencepath_resultValidationError.message.split('\n').map((line) => '\t' + line).join('\n');
1223
+ return new TypeError(message);
1224
+ }
1225
+ })();
1226
+ return v_error === undefined ? null : v_error;
1227
+ }
1228
+ const RepresentationType = 'SuccessTeamOutputRepresentation';
1229
+ function normalize(input, existing, path, luvio, store, timestamp) {
1230
+ return input;
1231
+ }
1232
+ const select$1 = function SuccessTeamOutputRepresentationSelect() {
1233
+ const { selections: GetSuccessTeamResult__selections, opaque: GetSuccessTeamResult__opaque, } = select$2();
1234
+ return {
1235
+ kind: 'Fragment',
1236
+ version: VERSION,
1237
+ private: [],
1238
+ selections: [
1239
+ {
1240
+ name: 'result',
1241
+ kind: 'Object',
1242
+ selections: GetSuccessTeamResult__selections
1243
+ }
1244
+ ]
1245
+ };
1246
+ };
1247
+ function equals(existing, incoming) {
1248
+ const existing_result = existing.result;
1249
+ const incoming_result = incoming.result;
1250
+ if (!(equals$1(existing_result, incoming_result))) {
1251
+ return false;
1252
+ }
1253
+ return true;
1254
+ }
1255
+ const ingest = function SuccessTeamOutputRepresentationIngest(input, path, luvio, store, timestamp) {
1256
+ if (process.env.NODE_ENV !== 'production') {
1257
+ const validateError = validate(input);
1258
+ if (validateError !== null) {
1259
+ throw validateError;
1260
+ }
1261
+ }
1262
+ const key = path.fullPath;
1263
+ const existingRecord = store.readEntry(key);
1264
+ const ttlToUse = path.ttl !== undefined ? path.ttl : 360000;
1265
+ let incomingRecord = normalize(input, store.readEntry(key), {
1266
+ fullPath: key,
1267
+ parent: path.parent,
1268
+ propertyName: path.propertyName,
1269
+ ttl: ttlToUse
1270
+ });
1271
+ if (existingRecord === undefined || equals(existingRecord, incomingRecord) === false) {
1272
+ luvio.storePublish(key, incomingRecord);
1273
+ }
1274
+ if (ttlToUse !== undefined) {
1275
+ const storeMetadataParams = {
1276
+ ttl: ttlToUse,
1277
+ namespace: "education",
1278
+ version: VERSION,
1279
+ representationName: RepresentationType,
1280
+ };
1281
+ luvio.publishStoreMetadata(key, storeMetadataParams);
1282
+ }
1283
+ return createLink(key);
1284
+ };
1285
+ function getTypeCacheKeys(luvio, input, fullPathFactory) {
1286
+ const rootKeySet = new StoreKeyMap();
1287
+ // root cache key (uses fullPathFactory if keyBuilderFromType isn't defined)
1288
+ const rootKey = fullPathFactory();
1289
+ rootKeySet.set(rootKey, {
1290
+ namespace: keyPrefix,
1291
+ representationName: RepresentationType,
1292
+ mergeable: false
1293
+ });
1294
+ return rootKeySet;
1295
+ }
1296
+
1297
+ function select(luvio, params) {
1298
+ return select$1();
1299
+ }
1300
+ function keyBuilder$1(luvio, params) {
1301
+ return keyPrefix + '::SuccessTeamOutputRepresentation:(' + 'accountId:' + params.urlParams.accountId + ')';
1302
+ }
1303
+ function getResponseCacheKeys(luvio, resourceParams, response) {
1304
+ return getTypeCacheKeys(luvio, response, () => keyBuilder$1(luvio, resourceParams));
1305
+ }
1306
+ function ingestSuccess(luvio, resourceParams, response, snapshotRefresh) {
1307
+ const { body } = response;
1308
+ const key = keyBuilder$1(luvio, resourceParams);
1309
+ luvio.storeIngest(key, ingest, body);
1310
+ const snapshot = luvio.storeLookup({
1311
+ recordId: key,
1312
+ node: select(),
1313
+ variables: {},
1314
+ }, snapshotRefresh);
1315
+ if (process.env.NODE_ENV !== 'production') {
1316
+ if (snapshot.state !== 'Fulfilled') {
1317
+ throw new Error('Invalid network response. Expected resource response to result in Fulfilled snapshot');
1318
+ }
1319
+ }
1320
+ return snapshot;
1321
+ }
1322
+ function ingestError(luvio, params, error, snapshotRefresh) {
1323
+ const key = keyBuilder$1(luvio, params);
1324
+ const errorSnapshot = luvio.errorSnapshot(error, snapshotRefresh);
1325
+ luvio.storeIngestError(key, errorSnapshot);
1326
+ return errorSnapshot;
1327
+ }
1328
+ function createResourceRequest(config) {
1329
+ const headers = {};
1330
+ return {
1331
+ baseUri: '/services/data/v58.0',
1332
+ basePath: '/connect/education/' + config.urlParams.accountId + '/success-team',
1333
+ method: 'get',
1334
+ body: null,
1335
+ urlParams: config.urlParams,
1336
+ queryParams: {},
1337
+ headers,
1338
+ priority: 'normal',
1339
+ };
1340
+ }
1341
+
1342
+ const getSuccessTeam_ConfigPropertyNames = {
1343
+ displayName: 'getSuccessTeam',
1344
+ parameters: {
1345
+ required: ['accountId'],
1346
+ optional: []
1347
+ }
1348
+ };
1349
+ function createResourceParams(config) {
1350
+ const resourceParams = {
1351
+ urlParams: {
1352
+ accountId: config.accountId
1353
+ }
1354
+ };
1355
+ return resourceParams;
1356
+ }
1357
+ function keyBuilder(luvio, config) {
1358
+ const resourceParams = createResourceParams(config);
1359
+ return keyBuilder$1(luvio, resourceParams);
1360
+ }
1361
+ function typeCheckConfig(untrustedConfig) {
1362
+ const config = {};
1363
+ const untrustedConfig_accountId = untrustedConfig.accountId;
1364
+ if (typeof untrustedConfig_accountId === 'string') {
1365
+ config.accountId = untrustedConfig_accountId;
1366
+ }
1367
+ return config;
1368
+ }
1369
+ function validateAdapterConfig(untrustedConfig, configPropertyNames) {
1370
+ if (!untrustedIsObject(untrustedConfig)) {
1371
+ return null;
1372
+ }
1373
+ if (process.env.NODE_ENV !== 'production') {
1374
+ validateConfig(untrustedConfig, configPropertyNames);
1375
+ }
1376
+ const config = typeCheckConfig(untrustedConfig);
1377
+ if (!areRequiredParametersPresent(config, configPropertyNames)) {
1378
+ return null;
1379
+ }
1380
+ return config;
1381
+ }
1382
+ function adapterFragment(luvio, config) {
1383
+ createResourceParams(config);
1384
+ return select();
1385
+ }
1386
+ function onFetchResponseSuccess(luvio, config, resourceParams, response) {
1387
+ const snapshot = ingestSuccess(luvio, resourceParams, response, {
1388
+ config,
1389
+ resolve: () => buildNetworkSnapshot(luvio, config, snapshotRefreshOptions)
1390
+ });
1391
+ return luvio.storeBroadcast().then(() => snapshot);
1392
+ }
1393
+ function onFetchResponseError(luvio, config, resourceParams, response) {
1394
+ const snapshot = ingestError(luvio, resourceParams, response, {
1395
+ config,
1396
+ resolve: () => buildNetworkSnapshot(luvio, config, snapshotRefreshOptions)
1397
+ });
1398
+ return luvio.storeBroadcast().then(() => snapshot);
1399
+ }
1400
+ function buildNetworkSnapshot(luvio, config, options) {
1401
+ const resourceParams = createResourceParams(config);
1402
+ const request = createResourceRequest(resourceParams);
1403
+ return luvio.dispatchResourceRequest(request, options)
1404
+ .then((response) => {
1405
+ return luvio.handleSuccessResponse(() => onFetchResponseSuccess(luvio, config, resourceParams, response), () => getResponseCacheKeys(luvio, resourceParams, response.body));
1406
+ }, (response) => {
1407
+ return luvio.handleErrorResponse(() => onFetchResponseError(luvio, config, resourceParams, response));
1408
+ });
1409
+ }
1410
+ function buildNetworkSnapshotCachePolicy(context, coercedAdapterRequestContext) {
1411
+ const { luvio, config } = context;
1412
+ const { networkPriority, requestCorrelator, eventObservers } = coercedAdapterRequestContext;
1413
+ const dispatchOptions = {
1414
+ resourceRequestContext: {
1415
+ requestCorrelator,
1416
+ luvioRequestMethod: undefined,
1417
+ },
1418
+ eventObservers
1419
+ };
1420
+ if (networkPriority !== 'normal') {
1421
+ dispatchOptions.overrides = {
1422
+ priority: networkPriority
1423
+ };
1424
+ }
1425
+ return buildNetworkSnapshot(luvio, config, dispatchOptions);
1426
+ }
1427
+ function buildCachedSnapshotCachePolicy(context, storeLookup) {
1428
+ const { luvio, config } = context;
1429
+ const selector = {
1430
+ recordId: keyBuilder(luvio, config),
1431
+ node: adapterFragment(luvio, config),
1432
+ variables: {},
1433
+ };
1434
+ const cacheSnapshot = storeLookup(selector, {
1435
+ config,
1436
+ resolve: () => buildNetworkSnapshot(luvio, config, snapshotRefreshOptions)
1437
+ });
1438
+ return cacheSnapshot;
1439
+ }
1440
+ const getSuccessTeamAdapterFactory = (luvio) => function education__getSuccessTeam(untrustedConfig, requestContext) {
1441
+ const config = validateAdapterConfig(untrustedConfig, getSuccessTeam_ConfigPropertyNames);
1442
+ // Invalid or incomplete config
1443
+ if (config === null) {
1444
+ return null;
1445
+ }
1446
+ return luvio.applyCachePolicy((requestContext || {}), { config, luvio }, // BuildSnapshotContext
1447
+ buildCachedSnapshotCachePolicy, buildNetworkSnapshotCachePolicy);
1448
+ };
1449
+
1450
+ export { getAvailableTimeSlotsAdapterFactory, getAvailableTopicsAdapterFactory, getSuccessTeamAdapterFactory };