@salesforce/lds-adapters-industries-field-service 1.293.0 → 1.294.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.
@@ -4,7 +4,7 @@
4
4
  * For full license text, see the LICENSE.txt file
5
5
  */
6
6
 
7
- import { serializeStructuredKey, ingestShape, deepFreeze, StoreKeyMap, createResourceParams as createResourceParams$2, typeCheckConfig as typeCheckConfig$2 } from '@luvio/engine';
7
+ import { serializeStructuredKey, ingestShape, deepFreeze, buildNetworkSnapshotCachePolicy as buildNetworkSnapshotCachePolicy$1, typeCheckConfig as typeCheckConfig$4, StoreKeyMap, createResourceParams as createResourceParams$4 } from '@luvio/engine';
8
8
 
9
9
  const { hasOwnProperty: ObjectPrototypeHasOwnProperty } = Object.prototype;
10
10
  const { keys: ObjectKeys, create: ObjectCreate } = Object;
@@ -41,6 +41,13 @@ function untrustedIsObject(untrusted) {
41
41
  function areRequiredParametersPresent(config, configPropertyNames) {
42
42
  return configPropertyNames.parameters.required.every(req => req in config);
43
43
  }
44
+ const snapshotRefreshOptions = {
45
+ overrides: {
46
+ headers: {
47
+ 'Cache-Control': 'no-cache',
48
+ },
49
+ }
50
+ };
44
51
  function generateParamConfigMetadata(name, required, resourceType, typeCheckShape, isArrayShape = false, coerceFn) {
45
52
  return {
46
53
  name,
@@ -65,12 +72,476 @@ function buildAdapterValidationConfig(displayName, paramsMeta) {
65
72
  const keyPrefix = 'field-service';
66
73
 
67
74
  const { isArray: ArrayIsArray } = Array;
75
+ function equalsArray(a, b, equalsItem) {
76
+ const aLength = a.length;
77
+ const bLength = b.length;
78
+ if (aLength !== bLength) {
79
+ return false;
80
+ }
81
+ for (let i = 0; i < aLength; i++) {
82
+ if (equalsItem(a[i], b[i]) === false) {
83
+ return false;
84
+ }
85
+ }
86
+ return true;
87
+ }
68
88
  function createLink(ref) {
69
89
  return {
70
90
  __ref: serializeStructuredKey(ref),
71
91
  };
72
92
  }
73
93
 
94
+ const VERSION$3 = "2f0233a95128b9599e2fdc4792332572";
95
+ function validate$4(obj, path = 'AppointmentSlotRepresentation') {
96
+ const v_error = (() => {
97
+ if (typeof obj !== 'object' || ArrayIsArray(obj) || obj === null) {
98
+ return new TypeError('Expected "object" but received "' + typeof obj + '" (at "' + path + '")');
99
+ }
100
+ const obj_finishInterval = obj.finishInterval;
101
+ const path_finishInterval = path + '.finishInterval';
102
+ if (typeof obj_finishInterval !== 'string') {
103
+ return new TypeError('Expected "string" but received "' + typeof obj_finishInterval + '" (at "' + path_finishInterval + '")');
104
+ }
105
+ obj.grade;
106
+ const obj_startInterval = obj.startInterval;
107
+ const path_startInterval = path + '.startInterval';
108
+ if (typeof obj_startInterval !== 'string') {
109
+ return new TypeError('Expected "string" but received "' + typeof obj_startInterval + '" (at "' + path_startInterval + '")');
110
+ }
111
+ })();
112
+ return v_error === undefined ? null : v_error;
113
+ }
114
+ const select$7 = function AppointmentSlotRepresentationSelect() {
115
+ return {
116
+ kind: 'Fragment',
117
+ version: VERSION$3,
118
+ private: [],
119
+ selections: [
120
+ {
121
+ name: 'finishInterval',
122
+ kind: 'Scalar'
123
+ },
124
+ {
125
+ name: 'grade',
126
+ kind: 'Scalar'
127
+ },
128
+ {
129
+ name: 'startInterval',
130
+ kind: 'Scalar'
131
+ }
132
+ ]
133
+ };
134
+ };
135
+ function equals$3(existing, incoming) {
136
+ const existing_finishInterval = existing.finishInterval;
137
+ const incoming_finishInterval = incoming.finishInterval;
138
+ if (!(existing_finishInterval === incoming_finishInterval)) {
139
+ return false;
140
+ }
141
+ const existing_startInterval = existing.startInterval;
142
+ const incoming_startInterval = incoming.startInterval;
143
+ if (!(existing_startInterval === incoming_startInterval)) {
144
+ return false;
145
+ }
146
+ const existing_grade = existing.grade;
147
+ const incoming_grade = incoming.grade;
148
+ if (!(existing_grade === incoming_grade)) {
149
+ return false;
150
+ }
151
+ return true;
152
+ }
153
+
154
+ const TTL$2 = 1000;
155
+ const VERSION$2 = "adf3d4fd725138657e26bece6c0bc136";
156
+ function validate$3(obj, path = 'AppointmentSchedulingRepresentation') {
157
+ const v_error = (() => {
158
+ if (typeof obj !== 'object' || ArrayIsArray(obj) || obj === null) {
159
+ return new TypeError('Expected "object" but received "' + typeof obj + '" (at "' + path + '")');
160
+ }
161
+ const obj_appointmentSlots = obj.appointmentSlots;
162
+ const path_appointmentSlots = path + '.appointmentSlots';
163
+ if (!ArrayIsArray(obj_appointmentSlots)) {
164
+ return new TypeError('Expected "array" but received "' + typeof obj_appointmentSlots + '" (at "' + path_appointmentSlots + '")');
165
+ }
166
+ for (let i = 0; i < obj_appointmentSlots.length; i++) {
167
+ const obj_appointmentSlots_item = obj_appointmentSlots[i];
168
+ const path_appointmentSlots_item = path_appointmentSlots + '[' + i + ']';
169
+ const referencepath_appointmentSlots_itemValidationError = validate$4(obj_appointmentSlots_item, path_appointmentSlots_item);
170
+ if (referencepath_appointmentSlots_itemValidationError !== null) {
171
+ let message = 'Object doesn\'t match AppointmentSlotRepresentation (at "' + path_appointmentSlots_item + '")\n';
172
+ message += referencepath_appointmentSlots_itemValidationError.message.split('\n').map((line) => '\t' + line).join('\n');
173
+ return new TypeError(message);
174
+ }
175
+ }
176
+ const obj_errorCode = obj.errorCode;
177
+ const path_errorCode = path + '.errorCode';
178
+ if (typeof obj_errorCode !== 'string') {
179
+ return new TypeError('Expected "string" but received "' + typeof obj_errorCode + '" (at "' + path_errorCode + '")');
180
+ }
181
+ const obj_errorMessage = obj.errorMessage;
182
+ const path_errorMessage = path + '.errorMessage';
183
+ if (typeof obj_errorMessage !== 'string') {
184
+ return new TypeError('Expected "string" but received "' + typeof obj_errorMessage + '" (at "' + path_errorMessage + '")');
185
+ }
186
+ const obj_isSuccess = obj.isSuccess;
187
+ const path_isSuccess = path + '.isSuccess';
188
+ if (typeof obj_isSuccess !== 'boolean') {
189
+ return new TypeError('Expected "boolean" but received "' + typeof obj_isSuccess + '" (at "' + path_isSuccess + '")');
190
+ }
191
+ const obj_resourceId = obj.resourceId;
192
+ const path_resourceId = path + '.resourceId';
193
+ if (typeof obj_resourceId !== 'string') {
194
+ return new TypeError('Expected "string" but received "' + typeof obj_resourceId + '" (at "' + path_resourceId + '")');
195
+ }
196
+ const obj_serviceAppointmentId = obj.serviceAppointmentId;
197
+ const path_serviceAppointmentId = path + '.serviceAppointmentId';
198
+ if (typeof obj_serviceAppointmentId !== 'string') {
199
+ return new TypeError('Expected "string" but received "' + typeof obj_serviceAppointmentId + '" (at "' + path_serviceAppointmentId + '")');
200
+ }
201
+ })();
202
+ return v_error === undefined ? null : v_error;
203
+ }
204
+ const RepresentationType$2 = 'AppointmentSchedulingRepresentation';
205
+ function keyBuilder$4(luvio, config) {
206
+ return keyPrefix + '::' + RepresentationType$2 + ':' + config.id;
207
+ }
208
+ function keyBuilderFromType$2(luvio, object) {
209
+ const keyParams = {
210
+ id: object.serviceAppointmentId
211
+ };
212
+ return keyBuilder$4(luvio, keyParams);
213
+ }
214
+ function normalize$2(input, existing, path, luvio, store, timestamp) {
215
+ return input;
216
+ }
217
+ const select$6 = function AppointmentSchedulingRepresentationSelect() {
218
+ const { selections: AppointmentSlotRepresentation__selections, opaque: AppointmentSlotRepresentation__opaque, } = select$7();
219
+ return {
220
+ kind: 'Fragment',
221
+ version: VERSION$2,
222
+ private: [],
223
+ selections: [
224
+ {
225
+ name: 'appointmentSlots',
226
+ kind: 'Object',
227
+ plural: true,
228
+ selections: AppointmentSlotRepresentation__selections
229
+ },
230
+ {
231
+ name: 'errorCode',
232
+ kind: 'Scalar'
233
+ },
234
+ {
235
+ name: 'errorMessage',
236
+ kind: 'Scalar'
237
+ },
238
+ {
239
+ name: 'isSuccess',
240
+ kind: 'Scalar'
241
+ },
242
+ {
243
+ name: 'resourceId',
244
+ kind: 'Scalar'
245
+ },
246
+ {
247
+ name: 'serviceAppointmentId',
248
+ kind: 'Scalar'
249
+ }
250
+ ]
251
+ };
252
+ };
253
+ function equals$2(existing, incoming) {
254
+ const existing_isSuccess = existing.isSuccess;
255
+ const incoming_isSuccess = incoming.isSuccess;
256
+ if (!(existing_isSuccess === incoming_isSuccess)) {
257
+ return false;
258
+ }
259
+ const existing_errorCode = existing.errorCode;
260
+ const incoming_errorCode = incoming.errorCode;
261
+ if (!(existing_errorCode === incoming_errorCode)) {
262
+ return false;
263
+ }
264
+ const existing_errorMessage = existing.errorMessage;
265
+ const incoming_errorMessage = incoming.errorMessage;
266
+ if (!(existing_errorMessage === incoming_errorMessage)) {
267
+ return false;
268
+ }
269
+ const existing_resourceId = existing.resourceId;
270
+ const incoming_resourceId = incoming.resourceId;
271
+ if (!(existing_resourceId === incoming_resourceId)) {
272
+ return false;
273
+ }
274
+ const existing_serviceAppointmentId = existing.serviceAppointmentId;
275
+ const incoming_serviceAppointmentId = incoming.serviceAppointmentId;
276
+ if (!(existing_serviceAppointmentId === incoming_serviceAppointmentId)) {
277
+ return false;
278
+ }
279
+ const existing_appointmentSlots = existing.appointmentSlots;
280
+ const incoming_appointmentSlots = incoming.appointmentSlots;
281
+ const equals_appointmentSlots_items = equalsArray(existing_appointmentSlots, incoming_appointmentSlots, (existing_appointmentSlots_item, incoming_appointmentSlots_item) => {
282
+ if (!(equals$3(existing_appointmentSlots_item, incoming_appointmentSlots_item))) {
283
+ return false;
284
+ }
285
+ });
286
+ if (equals_appointmentSlots_items === false) {
287
+ return false;
288
+ }
289
+ return true;
290
+ }
291
+ const ingest$2 = function AppointmentSchedulingRepresentationIngest(input, path, luvio, store, timestamp) {
292
+ if (process.env.NODE_ENV !== 'production') {
293
+ const validateError = validate$3(input);
294
+ if (validateError !== null) {
295
+ throw validateError;
296
+ }
297
+ }
298
+ const key = keyBuilderFromType$2(luvio, input);
299
+ const ttlToUse = TTL$2;
300
+ ingestShape(input, path, luvio, store, timestamp, ttlToUse, key, normalize$2, "field-service", VERSION$2, RepresentationType$2, equals$2);
301
+ return createLink(key);
302
+ };
303
+ function getTypeCacheKeys$2(rootKeySet, luvio, input, fullPathFactory) {
304
+ // root cache key (uses fullPathFactory if keyBuilderFromType isn't defined)
305
+ const rootKey = keyBuilderFromType$2(luvio, input);
306
+ rootKeySet.set(rootKey, {
307
+ namespace: keyPrefix,
308
+ representationName: RepresentationType$2,
309
+ mergeable: false
310
+ });
311
+ }
312
+
313
+ function select$5(luvio, params) {
314
+ return select$6();
315
+ }
316
+ function keyBuilder$3(luvio, params) {
317
+ return keyBuilder$4(luvio, {
318
+ id: params.urlParams.serviceAppointmentId
319
+ });
320
+ }
321
+ function getResponseCacheKeys$3(storeKeyMap, luvio, resourceParams, response) {
322
+ getTypeCacheKeys$2(storeKeyMap, luvio, response);
323
+ }
324
+ function ingestSuccess$3(luvio, resourceParams, response, snapshotRefresh) {
325
+ const { body } = response;
326
+ const key = keyBuilder$3(luvio, resourceParams);
327
+ luvio.storeIngest(key, ingest$2, body);
328
+ const snapshot = luvio.storeLookup({
329
+ recordId: key,
330
+ node: select$5(),
331
+ variables: {},
332
+ }, snapshotRefresh);
333
+ if (process.env.NODE_ENV !== 'production') {
334
+ if (snapshot.state !== 'Fulfilled') {
335
+ throw new Error('Invalid network response. Expected resource response to result in Fulfilled snapshot');
336
+ }
337
+ }
338
+ deepFreeze(snapshot.data);
339
+ return snapshot;
340
+ }
341
+ function ingestError(luvio, params, error, snapshotRefresh) {
342
+ const key = keyBuilder$3(luvio, params);
343
+ const errorSnapshot = luvio.errorSnapshot(error, snapshotRefresh);
344
+ const storeMetadataParams = {
345
+ ttl: TTL$2,
346
+ namespace: keyPrefix,
347
+ version: VERSION$2,
348
+ representationName: RepresentationType$2
349
+ };
350
+ luvio.storeIngestError(key, errorSnapshot, storeMetadataParams);
351
+ return errorSnapshot;
352
+ }
353
+ function createResourceRequest$3(config) {
354
+ const headers = {};
355
+ return {
356
+ baseUri: '/services/data/v62.0',
357
+ basePath: '/connect/industries-field-service/appointment-scheduling/slots/' + config.urlParams.serviceAppointmentId + '/' + config.urlParams.schedulingPolicyId + '',
358
+ method: 'get',
359
+ body: null,
360
+ urlParams: config.urlParams,
361
+ queryParams: {},
362
+ headers,
363
+ priority: 'normal',
364
+ };
365
+ }
366
+
367
+ const adapterName$3 = 'getAppointmentSlots';
368
+ const getAppointmentSlots_ConfigPropertyMetadata = [
369
+ generateParamConfigMetadata('serviceAppointmentId', true, 0 /* UrlParameter */, 0 /* String */),
370
+ generateParamConfigMetadata('schedulingPolicyId', true, 0 /* UrlParameter */, 0 /* String */),
371
+ ];
372
+ const getAppointmentSlots_ConfigPropertyNames = /*#__PURE__*/ buildAdapterValidationConfig(adapterName$3, getAppointmentSlots_ConfigPropertyMetadata);
373
+ const createResourceParams$3 = /*#__PURE__*/ createResourceParams$4(getAppointmentSlots_ConfigPropertyMetadata);
374
+ function keyBuilder$2(luvio, config) {
375
+ const resourceParams = createResourceParams$3(config);
376
+ return keyBuilder$3(luvio, resourceParams);
377
+ }
378
+ function typeCheckConfig$3(untrustedConfig) {
379
+ const config = {};
380
+ typeCheckConfig$4(untrustedConfig, config, getAppointmentSlots_ConfigPropertyMetadata);
381
+ return config;
382
+ }
383
+ function validateAdapterConfig$3(untrustedConfig, configPropertyNames) {
384
+ if (!untrustedIsObject(untrustedConfig)) {
385
+ return null;
386
+ }
387
+ if (process.env.NODE_ENV !== 'production') {
388
+ validateConfig(untrustedConfig, configPropertyNames);
389
+ }
390
+ const config = typeCheckConfig$3(untrustedConfig);
391
+ if (!areRequiredParametersPresent(config, configPropertyNames)) {
392
+ return null;
393
+ }
394
+ return config;
395
+ }
396
+ function adapterFragment(luvio, config) {
397
+ createResourceParams$3(config);
398
+ return select$5();
399
+ }
400
+ function onFetchResponseSuccess(luvio, config, resourceParams, response) {
401
+ const snapshot = ingestSuccess$3(luvio, resourceParams, response, {
402
+ config,
403
+ resolve: () => buildNetworkSnapshot$3(luvio, config, snapshotRefreshOptions)
404
+ });
405
+ return luvio.storeBroadcast().then(() => snapshot);
406
+ }
407
+ function onFetchResponseError(luvio, config, resourceParams, response) {
408
+ const snapshot = ingestError(luvio, resourceParams, response, {
409
+ config,
410
+ resolve: () => buildNetworkSnapshot$3(luvio, config, snapshotRefreshOptions)
411
+ });
412
+ return luvio.storeBroadcast().then(() => snapshot);
413
+ }
414
+ function buildNetworkSnapshot$3(luvio, config, options) {
415
+ const resourceParams = createResourceParams$3(config);
416
+ const request = createResourceRequest$3(resourceParams);
417
+ return luvio.dispatchResourceRequest(request, options)
418
+ .then((response) => {
419
+ return luvio.handleSuccessResponse(() => onFetchResponseSuccess(luvio, config, resourceParams, response), () => {
420
+ const cache = new StoreKeyMap();
421
+ getResponseCacheKeys$3(cache, luvio, resourceParams, response.body);
422
+ return cache;
423
+ });
424
+ }, (response) => {
425
+ return luvio.handleErrorResponse(() => onFetchResponseError(luvio, config, resourceParams, response));
426
+ });
427
+ }
428
+ function buildNetworkSnapshotCachePolicy(context, coercedAdapterRequestContext) {
429
+ return buildNetworkSnapshotCachePolicy$1(context, coercedAdapterRequestContext, buildNetworkSnapshot$3, undefined, false);
430
+ }
431
+ function buildCachedSnapshotCachePolicy(context, storeLookup) {
432
+ const { luvio, config } = context;
433
+ const selector = {
434
+ recordId: keyBuilder$2(luvio, config),
435
+ node: adapterFragment(luvio, config),
436
+ variables: {},
437
+ };
438
+ const cacheSnapshot = storeLookup(selector, {
439
+ config,
440
+ resolve: () => buildNetworkSnapshot$3(luvio, config, snapshotRefreshOptions)
441
+ });
442
+ return cacheSnapshot;
443
+ }
444
+ const getAppointmentSlotsAdapterFactory = (luvio) => function fieldService__getAppointmentSlots(untrustedConfig, requestContext) {
445
+ const config = validateAdapterConfig$3(untrustedConfig, getAppointmentSlots_ConfigPropertyNames);
446
+ // Invalid or incomplete config
447
+ if (config === null) {
448
+ return null;
449
+ }
450
+ return luvio.applyCachePolicy((requestContext || {}), { config, luvio }, // BuildSnapshotContext
451
+ buildCachedSnapshotCachePolicy, buildNetworkSnapshotCachePolicy);
452
+ };
453
+
454
+ function select$4(luvio, params) {
455
+ return select$6();
456
+ }
457
+ function getResponseCacheKeys$2(storeKeyMap, luvio, resourceParams, response) {
458
+ getTypeCacheKeys$2(storeKeyMap, luvio, response);
459
+ }
460
+ function ingestSuccess$2(luvio, resourceParams, response) {
461
+ const { body } = response;
462
+ const key = keyBuilderFromType$2(luvio, body);
463
+ luvio.storeIngest(key, ingest$2, body);
464
+ const snapshot = luvio.storeLookup({
465
+ recordId: key,
466
+ node: select$4(),
467
+ variables: {},
468
+ });
469
+ if (process.env.NODE_ENV !== 'production') {
470
+ if (snapshot.state !== 'Fulfilled') {
471
+ throw new Error('Invalid network response. Expected resource response to result in Fulfilled snapshot');
472
+ }
473
+ }
474
+ deepFreeze(snapshot.data);
475
+ return snapshot;
476
+ }
477
+ function createResourceRequest$2(config) {
478
+ const headers = {};
479
+ return {
480
+ baseUri: '/services/data/v62.0',
481
+ basePath: '/connect/industries-field-service/appointment-scheduling/slots/' + config.urlParams.serviceAppointmentId + '/' + config.urlParams.schedulingPolicyId + '',
482
+ method: 'put',
483
+ body: null,
484
+ urlParams: config.urlParams,
485
+ queryParams: {},
486
+ headers,
487
+ priority: 'normal',
488
+ };
489
+ }
490
+
491
+ const adapterName$2 = 'bookAppointmentSlot';
492
+ const bookAppointmentSlot_ConfigPropertyMetadata = [
493
+ generateParamConfigMetadata('serviceAppointmentId', true, 0 /* UrlParameter */, 0 /* String */),
494
+ generateParamConfigMetadata('schedulingPolicyId', true, 0 /* UrlParameter */, 0 /* String */),
495
+ ];
496
+ const bookAppointmentSlot_ConfigPropertyNames = /*#__PURE__*/ buildAdapterValidationConfig(adapterName$2, bookAppointmentSlot_ConfigPropertyMetadata);
497
+ const createResourceParams$2 = /*#__PURE__*/ createResourceParams$4(bookAppointmentSlot_ConfigPropertyMetadata);
498
+ function typeCheckConfig$2(untrustedConfig) {
499
+ const config = {};
500
+ typeCheckConfig$4(untrustedConfig, config, bookAppointmentSlot_ConfigPropertyMetadata);
501
+ return config;
502
+ }
503
+ function validateAdapterConfig$2(untrustedConfig, configPropertyNames) {
504
+ if (!untrustedIsObject(untrustedConfig)) {
505
+ return null;
506
+ }
507
+ if (process.env.NODE_ENV !== 'production') {
508
+ validateConfig(untrustedConfig, configPropertyNames);
509
+ }
510
+ const config = typeCheckConfig$2(untrustedConfig);
511
+ if (!areRequiredParametersPresent(config, configPropertyNames)) {
512
+ return null;
513
+ }
514
+ return config;
515
+ }
516
+ function buildNetworkSnapshot$2(luvio, config, options) {
517
+ const resourceParams = createResourceParams$2(config);
518
+ const request = createResourceRequest$2(resourceParams);
519
+ return luvio.dispatchResourceRequest(request, options)
520
+ .then((response) => {
521
+ return luvio.handleSuccessResponse(() => {
522
+ const snapshot = ingestSuccess$2(luvio, resourceParams, response);
523
+ return luvio.storeBroadcast().then(() => snapshot);
524
+ }, () => {
525
+ const cache = new StoreKeyMap();
526
+ getResponseCacheKeys$2(cache, luvio, resourceParams, response.body);
527
+ return cache;
528
+ });
529
+ }, (response) => {
530
+ deepFreeze(response);
531
+ throw response;
532
+ });
533
+ }
534
+ const bookAppointmentSlotAdapterFactory = (luvio) => {
535
+ return function bookAppointmentSlot(untrustedConfig) {
536
+ const config = validateAdapterConfig$2(untrustedConfig, bookAppointmentSlot_ConfigPropertyNames);
537
+ // Invalid or incomplete config
538
+ if (config === null) {
539
+ throw new Error('Invalid config for "bookAppointmentSlot"');
540
+ }
541
+ return buildNetworkSnapshot$2(luvio, config);
542
+ };
543
+ };
544
+
74
545
  const TTL$1 = 300;
75
546
  const VERSION$1 = "5c4aa8faf25b64f7b7f98f8739c11b45";
76
547
  function validate$2(obj, path = 'ProductServiceCampaignItemsFromListRepresentation') {
@@ -254,10 +725,10 @@ const createProductServiceCampaign_ConfigPropertyMetadata = [
254
725
  generateParamConfigMetadata('actionableListId', true, 2 /* Body */, 0 /* String */),
255
726
  ];
256
727
  const createProductServiceCampaign_ConfigPropertyNames = /*#__PURE__*/ buildAdapterValidationConfig(adapterName$1, createProductServiceCampaign_ConfigPropertyMetadata);
257
- const createResourceParams$1 = /*#__PURE__*/ createResourceParams$2(createProductServiceCampaign_ConfigPropertyMetadata);
728
+ const createResourceParams$1 = /*#__PURE__*/ createResourceParams$4(createProductServiceCampaign_ConfigPropertyMetadata);
258
729
  function typeCheckConfig$1(untrustedConfig) {
259
730
  const config = {};
260
- typeCheckConfig$2(untrustedConfig, config, createProductServiceCampaign_ConfigPropertyMetadata);
731
+ typeCheckConfig$4(untrustedConfig, config, createProductServiceCampaign_ConfigPropertyMetadata);
261
732
  return config;
262
733
  }
263
734
  function validateAdapterConfig$1(untrustedConfig, configPropertyNames) {
@@ -505,10 +976,10 @@ const priceItemWithCoverage_ConfigPropertyMetadata = [
505
976
  generateParamConfigMetadata('pricingProcedure', true, 2 /* Body */, 0 /* String */),
506
977
  ];
507
978
  const priceItemWithCoverage_ConfigPropertyNames = /*#__PURE__*/ buildAdapterValidationConfig(adapterName, priceItemWithCoverage_ConfigPropertyMetadata);
508
- const createResourceParams = /*#__PURE__*/ createResourceParams$2(priceItemWithCoverage_ConfigPropertyMetadata);
979
+ const createResourceParams = /*#__PURE__*/ createResourceParams$4(priceItemWithCoverage_ConfigPropertyMetadata);
509
980
  function typeCheckConfig(untrustedConfig) {
510
981
  const config = {};
511
- typeCheckConfig$2(untrustedConfig, config, priceItemWithCoverage_ConfigPropertyMetadata);
982
+ typeCheckConfig$4(untrustedConfig, config, priceItemWithCoverage_ConfigPropertyMetadata);
512
983
  const untrustedConfig_assetCoverageMap = untrustedConfig.assetCoverageMap;
513
984
  if (untrustedIsObject(untrustedConfig_assetCoverageMap)) {
514
985
  const untrustedConfig_assetCoverageMap_object = {};
@@ -571,4 +1042,4 @@ const priceItemWithCoverageAdapterFactory = (luvio) => {
571
1042
  };
572
1043
  };
573
1044
 
574
- export { createProductServiceCampaignAdapterFactory, priceItemWithCoverageAdapterFactory };
1045
+ export { bookAppointmentSlotAdapterFactory, createProductServiceCampaignAdapterFactory, getAppointmentSlotsAdapterFactory, priceItemWithCoverageAdapterFactory };
@@ -0,0 +1,16 @@
1
+ import { AdapterConfigMetadata as $64$luvio_engine_AdapterConfigMetadata, Luvio as $64$luvio_engine_Luvio, DispatchResourceRequestContext as $64$luvio_engine_DispatchResourceRequestContext, AdapterFactory as $64$luvio_engine_AdapterFactory } from '@luvio/engine';
2
+ import { Untrusted as adapter$45$utils_Untrusted, AdapterValidationConfig as adapter$45$utils_AdapterValidationConfig } from './adapter-utils';
3
+ import { ResourceRequestConfig as resources_putConnectIndustriesFieldServiceAppointmentSchedulingSlotsByServiceAppointmentIdAndSchedulingPolicyId_ResourceRequestConfig } from '../resources/putConnectIndustriesFieldServiceAppointmentSchedulingSlotsByServiceAppointmentIdAndSchedulingPolicyId';
4
+ import { AppointmentSchedulingRepresentation as types_AppointmentSchedulingRepresentation_AppointmentSchedulingRepresentation } from '../types/AppointmentSchedulingRepresentation';
5
+ export declare const adapterName = "bookAppointmentSlot";
6
+ export declare const bookAppointmentSlot_ConfigPropertyMetadata: $64$luvio_engine_AdapterConfigMetadata[];
7
+ export declare const bookAppointmentSlot_ConfigPropertyNames: adapter$45$utils_AdapterValidationConfig;
8
+ export interface BookAppointmentSlotConfig {
9
+ serviceAppointmentId: string;
10
+ schedulingPolicyId: string;
11
+ }
12
+ export declare const createResourceParams: (config: BookAppointmentSlotConfig) => resources_putConnectIndustriesFieldServiceAppointmentSchedulingSlotsByServiceAppointmentIdAndSchedulingPolicyId_ResourceRequestConfig;
13
+ export declare function typeCheckConfig(untrustedConfig: adapter$45$utils_Untrusted<BookAppointmentSlotConfig>): adapter$45$utils_Untrusted<BookAppointmentSlotConfig>;
14
+ export declare function validateAdapterConfig(untrustedConfig: unknown, configPropertyNames: adapter$45$utils_AdapterValidationConfig): BookAppointmentSlotConfig | null;
15
+ export declare function buildNetworkSnapshot(luvio: $64$luvio_engine_Luvio, config: BookAppointmentSlotConfig, options?: $64$luvio_engine_DispatchResourceRequestContext): Promise<import("@luvio/engine").FulfilledSnapshot<types_AppointmentSchedulingRepresentation_AppointmentSchedulingRepresentation, {}> | import("@luvio/engine").StaleSnapshot<types_AppointmentSchedulingRepresentation_AppointmentSchedulingRepresentation, {}> | import("@luvio/engine").PendingSnapshot<types_AppointmentSchedulingRepresentation_AppointmentSchedulingRepresentation, any>>;
16
+ export declare const bookAppointmentSlotAdapterFactory: $64$luvio_engine_AdapterFactory<BookAppointmentSlotConfig, types_AppointmentSchedulingRepresentation_AppointmentSchedulingRepresentation>;
@@ -0,0 +1,29 @@
1
+ import { AdapterConfigMetadata as $64$luvio_engine_AdapterConfigMetadata, Luvio as $64$luvio_engine_Luvio, NormalizedKeyMetadata as $64$luvio_engine_NormalizedKeyMetadata, Fragment as $64$luvio_engine_Fragment, Snapshot as $64$luvio_engine_Snapshot, FetchResponse as $64$luvio_engine_FetchResponse, ErrorResponse as $64$luvio_engine_ErrorResponse, DispatchResourceRequestContext as $64$luvio_engine_DispatchResourceRequestContext, CoercedAdapterRequestContext as $64$luvio_engine_CoercedAdapterRequestContext, StoreLookup as $64$luvio_engine_StoreLookup, AdapterFactory as $64$luvio_engine_AdapterFactory } from '@luvio/engine';
2
+ import { Untrusted as adapter$45$utils_Untrusted, AdapterValidationConfig as adapter$45$utils_AdapterValidationConfig, UncoercedConfiguration as adapter$45$utils_UncoercedConfiguration } from './adapter-utils';
3
+ import { ResourceRequestConfig as resources_getConnectIndustriesFieldServiceAppointmentSchedulingSlotsByServiceAppointmentIdAndSchedulingPolicyId_ResourceRequestConfig } from '../resources/getConnectIndustriesFieldServiceAppointmentSchedulingSlotsByServiceAppointmentIdAndSchedulingPolicyId';
4
+ import { AppointmentSchedulingRepresentation as types_AppointmentSchedulingRepresentation_AppointmentSchedulingRepresentation, KeyParams as types_AppointmentSchedulingRepresentation_KeyParams } from '../types/AppointmentSchedulingRepresentation';
5
+ export declare const adapterName = "getAppointmentSlots";
6
+ export declare const getAppointmentSlots_ConfigPropertyMetadata: $64$luvio_engine_AdapterConfigMetadata[];
7
+ export declare const getAppointmentSlots_ConfigPropertyNames: adapter$45$utils_AdapterValidationConfig;
8
+ export interface GetAppointmentSlotsConfig {
9
+ serviceAppointmentId: string;
10
+ schedulingPolicyId: string;
11
+ }
12
+ export declare const createResourceParams: (config: GetAppointmentSlotsConfig) => resources_getConnectIndustriesFieldServiceAppointmentSchedulingSlotsByServiceAppointmentIdAndSchedulingPolicyId_ResourceRequestConfig;
13
+ export declare function keyBuilder(luvio: $64$luvio_engine_Luvio, config: GetAppointmentSlotsConfig): string;
14
+ export declare function keyBuilder_StructuredKey(luvio: $64$luvio_engine_Luvio, config: GetAppointmentSlotsConfig): $64$luvio_engine_NormalizedKeyMetadata;
15
+ export declare function typeCheckConfig(untrustedConfig: adapter$45$utils_Untrusted<GetAppointmentSlotsConfig>): adapter$45$utils_Untrusted<GetAppointmentSlotsConfig>;
16
+ export declare function validateAdapterConfig(untrustedConfig: unknown, configPropertyNames: adapter$45$utils_AdapterValidationConfig): GetAppointmentSlotsConfig | null;
17
+ export declare function adapterFragment(luvio: $64$luvio_engine_Luvio, config: GetAppointmentSlotsConfig): $64$luvio_engine_Fragment;
18
+ export declare function buildCachedSnapshot(luvio: $64$luvio_engine_Luvio, config: GetAppointmentSlotsConfig): $64$luvio_engine_Snapshot<types_AppointmentSchedulingRepresentation_AppointmentSchedulingRepresentation, any>;
19
+ export declare function onFetchResponseSuccess(luvio: $64$luvio_engine_Luvio, config: GetAppointmentSlotsConfig, resourceParams: resources_getConnectIndustriesFieldServiceAppointmentSchedulingSlotsByServiceAppointmentIdAndSchedulingPolicyId_ResourceRequestConfig, response: $64$luvio_engine_FetchResponse<types_AppointmentSchedulingRepresentation_AppointmentSchedulingRepresentation>): Promise<import("@luvio/engine").FulfilledSnapshot<types_AppointmentSchedulingRepresentation_AppointmentSchedulingRepresentation, {}> | import("@luvio/engine").StaleSnapshot<types_AppointmentSchedulingRepresentation_AppointmentSchedulingRepresentation, {}> | import("@luvio/engine").PendingSnapshot<types_AppointmentSchedulingRepresentation_AppointmentSchedulingRepresentation, any>>;
20
+ export declare function onFetchResponseError(luvio: $64$luvio_engine_Luvio, config: GetAppointmentSlotsConfig, resourceParams: resources_getConnectIndustriesFieldServiceAppointmentSchedulingSlotsByServiceAppointmentIdAndSchedulingPolicyId_ResourceRequestConfig, response: $64$luvio_engine_ErrorResponse): Promise<import("@luvio/engine").ErrorSnapshot>;
21
+ export declare function buildNetworkSnapshot(luvio: $64$luvio_engine_Luvio, config: GetAppointmentSlotsConfig, options?: $64$luvio_engine_DispatchResourceRequestContext): Promise<$64$luvio_engine_Snapshot<types_AppointmentSchedulingRepresentation_AppointmentSchedulingRepresentation, any>>;
22
+ export type BuildSnapshotContext = {
23
+ luvio: $64$luvio_engine_Luvio;
24
+ config: GetAppointmentSlotsConfig;
25
+ };
26
+ export declare function buildNetworkSnapshotCachePolicy(context: BuildSnapshotContext, coercedAdapterRequestContext: $64$luvio_engine_CoercedAdapterRequestContext): Promise<$64$luvio_engine_Snapshot<types_AppointmentSchedulingRepresentation_AppointmentSchedulingRepresentation, any>>;
27
+ export declare function buildCachedSnapshotCachePolicy(context: BuildSnapshotContext, storeLookup: $64$luvio_engine_StoreLookup<types_AppointmentSchedulingRepresentation_AppointmentSchedulingRepresentation>): $64$luvio_engine_Snapshot<types_AppointmentSchedulingRepresentation_AppointmentSchedulingRepresentation, any>;
28
+ export declare const getAppointmentSlotsAdapterFactory: $64$luvio_engine_AdapterFactory<GetAppointmentSlotsConfig, types_AppointmentSchedulingRepresentation_AppointmentSchedulingRepresentation>;
29
+ export declare const notifyChangeFactory: (luvio: $64$luvio_engine_Luvio, options?: $64$luvio_engine_DispatchResourceRequestContext) => (configs: adapter$45$utils_UncoercedConfiguration<types_AppointmentSchedulingRepresentation_KeyParams, any>[]) => void;
@@ -1,2 +1,4 @@
1
+ export { getAppointmentSlotsAdapterFactory } from '../adapters/getAppointmentSlots';
2
+ export { bookAppointmentSlotAdapterFactory } from '../adapters/bookAppointmentSlot';
1
3
  export { createProductServiceCampaignAdapterFactory } from '../adapters/createProductServiceCampaign';
2
4
  export { priceItemWithCoverageAdapterFactory } from '../adapters/priceItemWithCoverage';
@@ -1,3 +1,7 @@
1
+ declare let bookAppointmentSlot: any;
1
2
  declare let createProductServiceCampaign: any;
3
+ declare let getAppointmentSlots: any;
4
+ declare let getAppointmentSlotsNotifyChange: any;
2
5
  declare let priceItemWithCoverage: any;
3
- export { createProductServiceCampaign, priceItemWithCoverage };
6
+ declare let getAppointmentSlots_imperative: any;
7
+ export { bookAppointmentSlot, createProductServiceCampaign, getAppointmentSlots, getAppointmentSlotsNotifyChange, priceItemWithCoverage, getAppointmentSlots_imperative, };
@@ -0,0 +1,17 @@
1
+ import { Luvio as $64$luvio_engine_Luvio, Fragment as $64$luvio_engine_Fragment, NormalizedKeyMetadata as $64$luvio_engine_NormalizedKeyMetadata, FetchResponse as $64$luvio_engine_FetchResponse, SnapshotRefresh as $64$luvio_engine_SnapshotRefresh, FulfilledSnapshot as $64$luvio_engine_FulfilledSnapshot, StaleSnapshot as $64$luvio_engine_StaleSnapshot, PendingSnapshot as $64$luvio_engine_PendingSnapshot, ErrorResponse as $64$luvio_engine_ErrorResponse, ErrorSnapshot as $64$luvio_engine_ErrorSnapshot, ResourceRequest as $64$luvio_engine_ResourceRequest } from '@luvio/engine';
2
+ import { AppointmentSchedulingRepresentation as types_AppointmentSchedulingRepresentation_AppointmentSchedulingRepresentation } from '../types/AppointmentSchedulingRepresentation';
3
+ export interface ResourceRequestConfig {
4
+ urlParams: {
5
+ serviceAppointmentId: string;
6
+ schedulingPolicyId: string;
7
+ };
8
+ }
9
+ export declare function select(luvio: $64$luvio_engine_Luvio, params: ResourceRequestConfig): $64$luvio_engine_Fragment;
10
+ export declare function keyBuilder(luvio: $64$luvio_engine_Luvio, params: ResourceRequestConfig): string;
11
+ export declare function keyBuilder_StructuredKey(luvio: $64$luvio_engine_Luvio, params: ResourceRequestConfig): $64$luvio_engine_NormalizedKeyMetadata;
12
+ export declare function getResponseCacheKeys(storeKeyMap: any, luvio: $64$luvio_engine_Luvio, resourceParams: ResourceRequestConfig, response: types_AppointmentSchedulingRepresentation_AppointmentSchedulingRepresentation): void;
13
+ export declare function ingestSuccess(luvio: $64$luvio_engine_Luvio, resourceParams: ResourceRequestConfig, response: $64$luvio_engine_FetchResponse<types_AppointmentSchedulingRepresentation_AppointmentSchedulingRepresentation>, snapshotRefresh?: $64$luvio_engine_SnapshotRefresh<types_AppointmentSchedulingRepresentation_AppointmentSchedulingRepresentation>): $64$luvio_engine_FulfilledSnapshot<types_AppointmentSchedulingRepresentation_AppointmentSchedulingRepresentation, {}> | $64$luvio_engine_StaleSnapshot<types_AppointmentSchedulingRepresentation_AppointmentSchedulingRepresentation, {}> | $64$luvio_engine_PendingSnapshot<types_AppointmentSchedulingRepresentation_AppointmentSchedulingRepresentation, any>;
14
+ export declare function ingestError(luvio: $64$luvio_engine_Luvio, params: ResourceRequestConfig, error: $64$luvio_engine_ErrorResponse, snapshotRefresh?: $64$luvio_engine_SnapshotRefresh<types_AppointmentSchedulingRepresentation_AppointmentSchedulingRepresentation>): $64$luvio_engine_ErrorSnapshot;
15
+ export declare function createResourceRequest(config: ResourceRequestConfig): $64$luvio_engine_ResourceRequest;
16
+ export default createResourceRequest;
17
+ export declare function createResourceRequestFromRepresentation(representation: types_AppointmentSchedulingRepresentation_AppointmentSchedulingRepresentation): $64$luvio_engine_ResourceRequest;
@@ -0,0 +1,13 @@
1
+ import { Luvio as $64$luvio_engine_Luvio, Fragment as $64$luvio_engine_Fragment, FetchResponse as $64$luvio_engine_FetchResponse, FulfilledSnapshot as $64$luvio_engine_FulfilledSnapshot, StaleSnapshot as $64$luvio_engine_StaleSnapshot, PendingSnapshot as $64$luvio_engine_PendingSnapshot, ResourceRequest as $64$luvio_engine_ResourceRequest } from '@luvio/engine';
2
+ import { AppointmentSchedulingRepresentation as types_AppointmentSchedulingRepresentation_AppointmentSchedulingRepresentation } from '../types/AppointmentSchedulingRepresentation';
3
+ export interface ResourceRequestConfig {
4
+ urlParams: {
5
+ serviceAppointmentId: string;
6
+ schedulingPolicyId: string;
7
+ };
8
+ }
9
+ export declare function select(luvio: $64$luvio_engine_Luvio, params: ResourceRequestConfig): $64$luvio_engine_Fragment;
10
+ export declare function getResponseCacheKeys(storeKeyMap: any, luvio: $64$luvio_engine_Luvio, resourceParams: ResourceRequestConfig, response: types_AppointmentSchedulingRepresentation_AppointmentSchedulingRepresentation): void;
11
+ export declare function ingestSuccess(luvio: $64$luvio_engine_Luvio, resourceParams: ResourceRequestConfig, response: $64$luvio_engine_FetchResponse<types_AppointmentSchedulingRepresentation_AppointmentSchedulingRepresentation>): $64$luvio_engine_FulfilledSnapshot<types_AppointmentSchedulingRepresentation_AppointmentSchedulingRepresentation, {}> | $64$luvio_engine_StaleSnapshot<types_AppointmentSchedulingRepresentation_AppointmentSchedulingRepresentation, {}> | $64$luvio_engine_PendingSnapshot<types_AppointmentSchedulingRepresentation_AppointmentSchedulingRepresentation, any>;
12
+ export declare function createResourceRequest(config: ResourceRequestConfig): $64$luvio_engine_ResourceRequest;
13
+ export default createResourceRequest;