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