@salesforce/lds-adapters-industries-stagemanagement 1.443.0 → 1.445.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, buildNetworkSnapshotCachePolicy as buildNetworkSnapshotCachePolicy$1, typeCheckConfig as typeCheckConfig$1, StoreKeyMap, createResourceParams as createResourceParams$1 } from '@luvio/engine';
7
+ import { serializeStructuredKey, ingestShape, deepFreeze, buildNetworkSnapshotCachePolicy as buildNetworkSnapshotCachePolicy$2, typeCheckConfig as typeCheckConfig$3, StoreKeyMap, createResourceParams as createResourceParams$3 } from '@luvio/engine';
8
8
 
9
9
  const { hasOwnProperty: ObjectPrototypeHasOwnProperty } = Object.prototype;
10
10
  const { keys: ObjectKeys$1, create: ObjectCreate$1 } = Object;
@@ -80,7 +80,7 @@ function createLink(ref) {
80
80
  };
81
81
  }
82
82
 
83
- function validate$3(obj, path = 'FulfillmentStepInfo') {
83
+ function validate$7(obj, path = 'FulfillmentStepInfo') {
84
84
  const v_error = (() => {
85
85
  if (typeof obj !== 'object' || ArrayIsArray(obj) || obj === null) {
86
86
  return new TypeError('Expected "object" but received "' + typeof obj + '" (at "' + path + '")');
@@ -147,7 +147,7 @@ function validate$3(obj, path = 'FulfillmentStepInfo') {
147
147
  return v_error === undefined ? null : v_error;
148
148
  }
149
149
 
150
- function validate$2(obj, path = 'StageTransitionEntryInfo') {
150
+ function validate$6(obj, path = 'StageTransitionEntryInfo') {
151
151
  const v_error = (() => {
152
152
  if (typeof obj !== 'object' || ArrayIsArray(obj) || obj === null) {
153
153
  return new TypeError('Expected "object" but received "' + typeof obj + '" (at "' + path + '")');
@@ -165,7 +165,7 @@ function validate$2(obj, path = 'StageTransitionEntryInfo') {
165
165
  for (let i = 0; i < obj_fulfillmentSteps.length; i++) {
166
166
  const obj_fulfillmentSteps_item = obj_fulfillmentSteps[i];
167
167
  const path_fulfillmentSteps_item = path_fulfillmentSteps + '[' + i + ']';
168
- const referencepath_fulfillmentSteps_itemValidationError = validate$3(obj_fulfillmentSteps_item, path_fulfillmentSteps_item);
168
+ const referencepath_fulfillmentSteps_itemValidationError = validate$7(obj_fulfillmentSteps_item, path_fulfillmentSteps_item);
169
169
  if (referencepath_fulfillmentSteps_itemValidationError !== null) {
170
170
  let message = 'Object doesn\'t match FulfillmentStepInfo (at "' + path_fulfillmentSteps_item + '")\n';
171
171
  message += referencepath_fulfillmentSteps_itemValidationError.message.split('\n').map((line) => '\t' + line).join('\n');
@@ -191,7 +191,7 @@ function validate$2(obj, path = 'StageTransitionEntryInfo') {
191
191
  return v_error === undefined ? null : v_error;
192
192
  }
193
193
 
194
- function validate$1(obj, path = 'StageValueInfo') {
194
+ function validate$5(obj, path = 'StageValueInfo') {
195
195
  const v_error = (() => {
196
196
  if (typeof obj !== 'object' || ArrayIsArray(obj) || obj === null) {
197
197
  return new TypeError('Expected "object" but received "' + typeof obj + '" (at "' + path + '")');
@@ -204,7 +204,7 @@ function validate$1(obj, path = 'StageValueInfo') {
204
204
  for (let i = 0; i < obj_fulfillmentSteps.length; i++) {
205
205
  const obj_fulfillmentSteps_item = obj_fulfillmentSteps[i];
206
206
  const path_fulfillmentSteps_item = path_fulfillmentSteps + '[' + i + ']';
207
- const referencepath_fulfillmentSteps_itemValidationError = validate$3(obj_fulfillmentSteps_item, path_fulfillmentSteps_item);
207
+ const referencepath_fulfillmentSteps_itemValidationError = validate$7(obj_fulfillmentSteps_item, path_fulfillmentSteps_item);
208
208
  if (referencepath_fulfillmentSteps_itemValidationError !== null) {
209
209
  let message = 'Object doesn\'t match FulfillmentStepInfo (at "' + path_fulfillmentSteps_item + '")\n';
210
210
  message += referencepath_fulfillmentSteps_itemValidationError.message.split('\n').map((line) => '\t' + line).join('\n');
@@ -229,7 +229,7 @@ function validate$1(obj, path = 'StageValueInfo') {
229
229
  for (let i = 0; i < obj_stageTransitions.length; i++) {
230
230
  const obj_stageTransitions_item = obj_stageTransitions[i];
231
231
  const path_stageTransitions_item = path_stageTransitions + '[' + i + ']';
232
- const referencepath_stageTransitions_itemValidationError = validate$2(obj_stageTransitions_item, path_stageTransitions_item);
232
+ const referencepath_stageTransitions_itemValidationError = validate$6(obj_stageTransitions_item, path_stageTransitions_item);
233
233
  if (referencepath_stageTransitions_itemValidationError !== null) {
234
234
  let message = 'Object doesn\'t match StageTransitionEntryInfo (at "' + path_stageTransitions_item + '")\n';
235
235
  message += referencepath_stageTransitions_itemValidationError.message.split('\n').map((line) => '\t' + line).join('\n');
@@ -240,9 +240,9 @@ function validate$1(obj, path = 'StageValueInfo') {
240
240
  return v_error === undefined ? null : v_error;
241
241
  }
242
242
 
243
- const TTL = 10000;
244
- const VERSION = "80703a0eccf6c5549ed2d91cd6b613c4";
245
- function validate(obj, path = 'StageMgmtKanbanVisualization') {
243
+ const TTL$2 = 10000;
244
+ const VERSION$2 = "80703a0eccf6c5549ed2d91cd6b613c4";
245
+ function validate$4(obj, path = 'StageMgmtKanbanVisualization') {
246
246
  const v_error = (() => {
247
247
  if (typeof obj !== 'object' || ArrayIsArray(obj) || obj === null) {
248
248
  return new TypeError('Expected "object" but received "' + typeof obj + '" (at "' + path + '")');
@@ -255,7 +255,7 @@ function validate(obj, path = 'StageMgmtKanbanVisualization') {
255
255
  for (let i = 0; i < obj_stages.length; i++) {
256
256
  const obj_stages_item = obj_stages[i];
257
257
  const path_stages_item = path_stages + '[' + i + ']';
258
- const referencepath_stages_itemValidationError = validate$1(obj_stages_item, path_stages_item);
258
+ const referencepath_stages_itemValidationError = validate$5(obj_stages_item, path_stages_item);
259
259
  if (referencepath_stages_itemValidationError !== null) {
260
260
  let message = 'Object doesn\'t match StageValueInfo (at "' + path_stages_item + '")\n';
261
261
  message += referencepath_stages_itemValidationError.message.split('\n').map((line) => '\t' + line).join('\n');
@@ -265,62 +265,62 @@ function validate(obj, path = 'StageMgmtKanbanVisualization') {
265
265
  })();
266
266
  return v_error === undefined ? null : v_error;
267
267
  }
268
- const RepresentationType = 'StageMgmtKanbanVisualization';
269
- function normalize(input, existing, path, luvio, store, timestamp) {
268
+ const RepresentationType$2 = 'StageMgmtKanbanVisualization';
269
+ function normalize$2(input, existing, path, luvio, store, timestamp) {
270
270
  return input;
271
271
  }
272
- const select$1 = function StageMgmtKanbanVisualizationSelect() {
272
+ const select$5 = function StageMgmtKanbanVisualizationSelect() {
273
273
  return {
274
274
  kind: 'Fragment',
275
- version: VERSION,
275
+ version: VERSION$2,
276
276
  private: [],
277
277
  opaque: true
278
278
  };
279
279
  };
280
- function equals(existing, incoming) {
280
+ function equals$2(existing, incoming) {
281
281
  if (JSONStringify(incoming) !== JSONStringify(existing)) {
282
282
  return false;
283
283
  }
284
284
  return true;
285
285
  }
286
- const ingest = function StageMgmtKanbanVisualizationIngest(input, path, luvio, store, timestamp) {
286
+ const ingest$2 = function StageMgmtKanbanVisualizationIngest(input, path, luvio, store, timestamp) {
287
287
  if (process.env.NODE_ENV !== 'production') {
288
- const validateError = validate(input);
288
+ const validateError = validate$4(input);
289
289
  if (validateError !== null) {
290
290
  throw validateError;
291
291
  }
292
292
  }
293
293
  const key = path.fullPath;
294
- const ttlToUse = TTL;
295
- ingestShape(input, path, luvio, store, timestamp, ttlToUse, key, normalize, "stage-management-connect-api", VERSION, RepresentationType, equals);
294
+ const ttlToUse = TTL$2;
295
+ ingestShape(input, path, luvio, store, timestamp, ttlToUse, key, normalize$2, "stage-management-connect-api", VERSION$2, RepresentationType$2, equals$2);
296
296
  return createLink(key);
297
297
  };
298
- function getTypeCacheKeys(rootKeySet, luvio, input, fullPathFactory) {
298
+ function getTypeCacheKeys$2(rootKeySet, luvio, input, fullPathFactory) {
299
299
  // root cache key (uses fullPathFactory if keyBuilderFromType isn't defined)
300
300
  const rootKey = fullPathFactory();
301
301
  rootKeySet.set(rootKey, {
302
302
  namespace: keyPrefix,
303
- representationName: RepresentationType,
303
+ representationName: RepresentationType$2,
304
304
  mergeable: false
305
305
  });
306
306
  }
307
307
 
308
- function select(luvio, params) {
309
- return select$1();
308
+ function select$4(luvio, params) {
309
+ return select$5();
310
310
  }
311
- function keyBuilder$1(luvio, params) {
311
+ function keyBuilder$4(luvio, params) {
312
312
  return keyPrefix + '::StageMgmtKanbanVisualization:(' + 'recordId:' + params.urlParams.recordId + ')';
313
313
  }
314
- function getResponseCacheKeys(storeKeyMap, luvio, resourceParams, response) {
315
- getTypeCacheKeys(storeKeyMap, luvio, response, () => keyBuilder$1(luvio, resourceParams));
314
+ function getResponseCacheKeys$2(storeKeyMap, luvio, resourceParams, response) {
315
+ getTypeCacheKeys$2(storeKeyMap, luvio, response, () => keyBuilder$4(luvio, resourceParams));
316
316
  }
317
- function ingestSuccess(luvio, resourceParams, response, snapshotRefresh) {
317
+ function ingestSuccess$2(luvio, resourceParams, response, snapshotRefresh) {
318
318
  const { body } = response;
319
- const key = keyBuilder$1(luvio, resourceParams);
320
- luvio.storeIngest(key, ingest, body);
319
+ const key = keyBuilder$4(luvio, resourceParams);
320
+ luvio.storeIngest(key, ingest$2, body);
321
321
  const snapshot = luvio.storeLookup({
322
322
  recordId: key,
323
- node: select(),
323
+ node: select$4(),
324
324
  variables: {},
325
325
  }, snapshotRefresh);
326
326
  if (process.env.NODE_ENV !== 'production') {
@@ -331,19 +331,19 @@ function ingestSuccess(luvio, resourceParams, response, snapshotRefresh) {
331
331
  deepFreeze(snapshot.data);
332
332
  return snapshot;
333
333
  }
334
- function ingestError(luvio, params, error, snapshotRefresh) {
335
- const key = keyBuilder$1(luvio, params);
334
+ function ingestError$1(luvio, params, error, snapshotRefresh) {
335
+ const key = keyBuilder$4(luvio, params);
336
336
  const errorSnapshot = luvio.errorSnapshot(error, snapshotRefresh);
337
337
  const storeMetadataParams = {
338
- ttl: TTL,
338
+ ttl: TTL$2,
339
339
  namespace: keyPrefix,
340
- version: VERSION,
341
- representationName: RepresentationType
340
+ version: VERSION$2,
341
+ representationName: RepresentationType$2
342
342
  };
343
343
  luvio.storeIngestError(key, errorSnapshot, storeMetadataParams);
344
344
  return errorSnapshot;
345
345
  }
346
- function createResourceRequest(config) {
346
+ function createResourceRequest$2(config) {
347
347
  const headers = {};
348
348
  return {
349
349
  baseUri: '/services/data/v68.0',
@@ -357,60 +357,332 @@ function createResourceRequest(config) {
357
357
  };
358
358
  }
359
359
 
360
- const adapterName = 'getStageDetails';
360
+ const adapterName$2 = 'getStageDetails';
361
361
  const getStageDetails_ConfigPropertyMetadata = [
362
362
  generateParamConfigMetadata('recordId', true, 0 /* UrlParameter */, 0 /* String */),
363
363
  ];
364
- const getStageDetails_ConfigPropertyNames = /*#__PURE__*/ buildAdapterValidationConfig(adapterName, getStageDetails_ConfigPropertyMetadata);
365
- const createResourceParams = /*#__PURE__*/ createResourceParams$1(getStageDetails_ConfigPropertyMetadata);
366
- function keyBuilder(luvio, config) {
367
- const resourceParams = createResourceParams(config);
368
- return keyBuilder$1(luvio, resourceParams);
364
+ const getStageDetails_ConfigPropertyNames = /*#__PURE__*/ buildAdapterValidationConfig(adapterName$2, getStageDetails_ConfigPropertyMetadata);
365
+ const createResourceParams$2 = /*#__PURE__*/ createResourceParams$3(getStageDetails_ConfigPropertyMetadata);
366
+ function keyBuilder$3(luvio, config) {
367
+ const resourceParams = createResourceParams$2(config);
368
+ return keyBuilder$4(luvio, resourceParams);
369
369
  }
370
- function typeCheckConfig(untrustedConfig) {
370
+ function typeCheckConfig$2(untrustedConfig) {
371
371
  const config = {};
372
- typeCheckConfig$1(untrustedConfig, config, getStageDetails_ConfigPropertyMetadata);
372
+ typeCheckConfig$3(untrustedConfig, config, getStageDetails_ConfigPropertyMetadata);
373
373
  return config;
374
374
  }
375
- function validateAdapterConfig(untrustedConfig, configPropertyNames) {
375
+ function validateAdapterConfig$2(untrustedConfig, configPropertyNames) {
376
376
  if (!untrustedIsObject(untrustedConfig)) {
377
377
  return null;
378
378
  }
379
379
  if (process.env.NODE_ENV !== 'production') {
380
380
  validateConfig(untrustedConfig, configPropertyNames);
381
381
  }
382
- const config = typeCheckConfig(untrustedConfig);
382
+ const config = typeCheckConfig$2(untrustedConfig);
383
+ if (!areRequiredParametersPresent(config, configPropertyNames)) {
384
+ return null;
385
+ }
386
+ return config;
387
+ }
388
+ function adapterFragment$1(luvio, config) {
389
+ createResourceParams$2(config);
390
+ return select$4();
391
+ }
392
+ function onFetchResponseSuccess$1(luvio, config, resourceParams, response) {
393
+ const snapshot = ingestSuccess$2(luvio, resourceParams, response, {
394
+ config,
395
+ resolve: () => buildNetworkSnapshot$2(luvio, config, snapshotRefreshOptions)
396
+ });
397
+ return luvio.storeBroadcast().then(() => snapshot);
398
+ }
399
+ function onFetchResponseError$1(luvio, config, resourceParams, response) {
400
+ const snapshot = ingestError$1(luvio, resourceParams, response, {
401
+ config,
402
+ resolve: () => buildNetworkSnapshot$2(luvio, config, snapshotRefreshOptions)
403
+ });
404
+ return luvio.storeBroadcast().then(() => snapshot);
405
+ }
406
+ function buildNetworkSnapshot$2(luvio, config, options) {
407
+ const resourceParams = createResourceParams$2(config);
408
+ const request = createResourceRequest$2(resourceParams);
409
+ return luvio.dispatchResourceRequest(request, options)
410
+ .then((response) => {
411
+ return luvio.handleSuccessResponse(() => onFetchResponseSuccess$1(luvio, config, resourceParams, response), () => {
412
+ const cache = new StoreKeyMap();
413
+ getResponseCacheKeys$2(cache, luvio, resourceParams, response.body);
414
+ return cache;
415
+ });
416
+ }, (response) => {
417
+ return luvio.handleErrorResponse(() => onFetchResponseError$1(luvio, config, resourceParams, response));
418
+ });
419
+ }
420
+ function buildNetworkSnapshotCachePolicy$1(context, coercedAdapterRequestContext) {
421
+ return buildNetworkSnapshotCachePolicy$2(context, coercedAdapterRequestContext, buildNetworkSnapshot$2, undefined, false);
422
+ }
423
+ function buildCachedSnapshotCachePolicy$1(context, storeLookup) {
424
+ const { luvio, config } = context;
425
+ const selector = {
426
+ recordId: keyBuilder$3(luvio, config),
427
+ node: adapterFragment$1(luvio, config),
428
+ variables: {},
429
+ };
430
+ const cacheSnapshot = storeLookup(selector, {
431
+ config,
432
+ resolve: () => buildNetworkSnapshot$2(luvio, config, snapshotRefreshOptions)
433
+ });
434
+ return cacheSnapshot;
435
+ }
436
+ const getStageDetailsAdapterFactory = (luvio) => function stageManagementConnectApi__getStageDetails(untrustedConfig, requestContext) {
437
+ const config = validateAdapterConfig$2(untrustedConfig, getStageDetails_ConfigPropertyNames);
438
+ // Invalid or incomplete config
439
+ if (config === null) {
440
+ return null;
441
+ }
442
+ return luvio.applyCachePolicy((requestContext || {}), { config, luvio }, // BuildSnapshotContext
443
+ buildCachedSnapshotCachePolicy$1, buildNetworkSnapshotCachePolicy$1);
444
+ };
445
+
446
+ function validate$3(obj, path = 'AdhocReasonInfo') {
447
+ const v_error = (() => {
448
+ if (typeof obj !== 'object' || ArrayIsArray(obj) || obj === null) {
449
+ return new TypeError('Expected "object" but received "' + typeof obj + '" (at "' + path + '")');
450
+ }
451
+ const obj_label = obj.label;
452
+ const path_label = path + '.label';
453
+ if (typeof obj_label !== 'string') {
454
+ return new TypeError('Expected "string" but received "' + typeof obj_label + '" (at "' + path_label + '")');
455
+ }
456
+ const obj_value = obj.value;
457
+ const path_value = path + '.value';
458
+ if (typeof obj_value !== 'string') {
459
+ return new TypeError('Expected "string" but received "' + typeof obj_value + '" (at "' + path_value + '")');
460
+ }
461
+ })();
462
+ return v_error === undefined ? null : v_error;
463
+ }
464
+
465
+ function validate$2(obj, path = 'AdhocStepInfo') {
466
+ const v_error = (() => {
467
+ if (typeof obj !== 'object' || ArrayIsArray(obj) || obj === null) {
468
+ return new TypeError('Expected "object" but received "' + typeof obj + '" (at "' + path + '")');
469
+ }
470
+ const obj_name = obj.name;
471
+ const path_name = path + '.name';
472
+ if (typeof obj_name !== 'string') {
473
+ return new TypeError('Expected "string" but received "' + typeof obj_name + '" (at "' + path_name + '")');
474
+ }
475
+ const obj_stepDefId = obj.stepDefId;
476
+ const path_stepDefId = path + '.stepDefId';
477
+ if (typeof obj_stepDefId !== 'string') {
478
+ return new TypeError('Expected "string" but received "' + typeof obj_stepDefId + '" (at "' + path_stepDefId + '")');
479
+ }
480
+ const obj_stepType = obj.stepType;
481
+ const path_stepType = path + '.stepType';
482
+ if (typeof obj_stepType !== 'string') {
483
+ return new TypeError('Expected "string" but received "' + typeof obj_stepType + '" (at "' + path_stepType + '")');
484
+ }
485
+ })();
486
+ return v_error === undefined ? null : v_error;
487
+ }
488
+
489
+ const TTL$1 = 10000;
490
+ const VERSION$1 = "958ec88475c3582c5fa5b07244726475";
491
+ function validate$1(obj, path = 'AdhocStepsResponse') {
492
+ const v_error = (() => {
493
+ if (typeof obj !== 'object' || ArrayIsArray(obj) || obj === null) {
494
+ return new TypeError('Expected "object" but received "' + typeof obj + '" (at "' + path + '")');
495
+ }
496
+ const obj_adhocReasons = obj.adhocReasons;
497
+ const path_adhocReasons = path + '.adhocReasons';
498
+ if (!ArrayIsArray(obj_adhocReasons)) {
499
+ return new TypeError('Expected "array" but received "' + typeof obj_adhocReasons + '" (at "' + path_adhocReasons + '")');
500
+ }
501
+ for (let i = 0; i < obj_adhocReasons.length; i++) {
502
+ const obj_adhocReasons_item = obj_adhocReasons[i];
503
+ const path_adhocReasons_item = path_adhocReasons + '[' + i + ']';
504
+ const referencepath_adhocReasons_itemValidationError = validate$3(obj_adhocReasons_item, path_adhocReasons_item);
505
+ if (referencepath_adhocReasons_itemValidationError !== null) {
506
+ let message = 'Object doesn\'t match AdhocReasonInfo (at "' + path_adhocReasons_item + '")\n';
507
+ message += referencepath_adhocReasons_itemValidationError.message.split('\n').map((line) => '\t' + line).join('\n');
508
+ return new TypeError(message);
509
+ }
510
+ }
511
+ const obj_availableAdhocSteps = obj.availableAdhocSteps;
512
+ const path_availableAdhocSteps = path + '.availableAdhocSteps';
513
+ if (!ArrayIsArray(obj_availableAdhocSteps)) {
514
+ return new TypeError('Expected "array" but received "' + typeof obj_availableAdhocSteps + '" (at "' + path_availableAdhocSteps + '")');
515
+ }
516
+ for (let i = 0; i < obj_availableAdhocSteps.length; i++) {
517
+ const obj_availableAdhocSteps_item = obj_availableAdhocSteps[i];
518
+ const path_availableAdhocSteps_item = path_availableAdhocSteps + '[' + i + ']';
519
+ const referencepath_availableAdhocSteps_itemValidationError = validate$2(obj_availableAdhocSteps_item, path_availableAdhocSteps_item);
520
+ if (referencepath_availableAdhocSteps_itemValidationError !== null) {
521
+ let message = 'Object doesn\'t match AdhocStepInfo (at "' + path_availableAdhocSteps_item + '")\n';
522
+ message += referencepath_availableAdhocSteps_itemValidationError.message.split('\n').map((line) => '\t' + line).join('\n');
523
+ return new TypeError(message);
524
+ }
525
+ }
526
+ const obj_currentStageValueId = obj.currentStageValueId;
527
+ const path_currentStageValueId = path + '.currentStageValueId';
528
+ if (typeof obj_currentStageValueId !== 'string') {
529
+ return new TypeError('Expected "string" but received "' + typeof obj_currentStageValueId + '" (at "' + path_currentStageValueId + '")');
530
+ }
531
+ const obj_stageDefinitionId = obj.stageDefinitionId;
532
+ const path_stageDefinitionId = path + '.stageDefinitionId';
533
+ if (typeof obj_stageDefinitionId !== 'string') {
534
+ return new TypeError('Expected "string" but received "' + typeof obj_stageDefinitionId + '" (at "' + path_stageDefinitionId + '")');
535
+ }
536
+ })();
537
+ return v_error === undefined ? null : v_error;
538
+ }
539
+ const RepresentationType$1 = 'AdhocStepsResponse';
540
+ function normalize$1(input, existing, path, luvio, store, timestamp) {
541
+ return input;
542
+ }
543
+ const select$3 = function AdhocStepsResponseSelect() {
544
+ return {
545
+ kind: 'Fragment',
546
+ version: VERSION$1,
547
+ private: [],
548
+ opaque: true
549
+ };
550
+ };
551
+ function equals$1(existing, incoming) {
552
+ if (JSONStringify(incoming) !== JSONStringify(existing)) {
553
+ return false;
554
+ }
555
+ return true;
556
+ }
557
+ const ingest$1 = function AdhocStepsResponseIngest(input, path, luvio, store, timestamp) {
558
+ if (process.env.NODE_ENV !== 'production') {
559
+ const validateError = validate$1(input);
560
+ if (validateError !== null) {
561
+ throw validateError;
562
+ }
563
+ }
564
+ const key = path.fullPath;
565
+ const ttlToUse = TTL$1;
566
+ ingestShape(input, path, luvio, store, timestamp, ttlToUse, key, normalize$1, "stage-management-connect-api", VERSION$1, RepresentationType$1, equals$1);
567
+ return createLink(key);
568
+ };
569
+ function getTypeCacheKeys$1(rootKeySet, luvio, input, fullPathFactory) {
570
+ // root cache key (uses fullPathFactory if keyBuilderFromType isn't defined)
571
+ const rootKey = fullPathFactory();
572
+ rootKeySet.set(rootKey, {
573
+ namespace: keyPrefix,
574
+ representationName: RepresentationType$1,
575
+ mergeable: false
576
+ });
577
+ }
578
+
579
+ function select$2(luvio, params) {
580
+ return select$3();
581
+ }
582
+ function keyBuilder$2(luvio, params) {
583
+ return keyPrefix + '::AdhocStepsResponse:(' + 'stageValue:' + params.queryParams.stageValue + ',' + 'recordId:' + params.urlParams.recordId + ')';
584
+ }
585
+ function getResponseCacheKeys$1(storeKeyMap, luvio, resourceParams, response) {
586
+ getTypeCacheKeys$1(storeKeyMap, luvio, response, () => keyBuilder$2(luvio, resourceParams));
587
+ }
588
+ function ingestSuccess$1(luvio, resourceParams, response, snapshotRefresh) {
589
+ const { body } = response;
590
+ const key = keyBuilder$2(luvio, resourceParams);
591
+ luvio.storeIngest(key, ingest$1, body);
592
+ const snapshot = luvio.storeLookup({
593
+ recordId: key,
594
+ node: select$2(),
595
+ variables: {},
596
+ }, snapshotRefresh);
597
+ if (process.env.NODE_ENV !== 'production') {
598
+ if (snapshot.state !== 'Fulfilled') {
599
+ throw new Error('Invalid network response. Expected resource response to result in Fulfilled snapshot');
600
+ }
601
+ }
602
+ deepFreeze(snapshot.data);
603
+ return snapshot;
604
+ }
605
+ function ingestError(luvio, params, error, snapshotRefresh) {
606
+ const key = keyBuilder$2(luvio, params);
607
+ const errorSnapshot = luvio.errorSnapshot(error, snapshotRefresh);
608
+ const storeMetadataParams = {
609
+ ttl: TTL$1,
610
+ namespace: keyPrefix,
611
+ version: VERSION$1,
612
+ representationName: RepresentationType$1
613
+ };
614
+ luvio.storeIngestError(key, errorSnapshot, storeMetadataParams);
615
+ return errorSnapshot;
616
+ }
617
+ function createResourceRequest$1(config) {
618
+ const headers = {};
619
+ return {
620
+ baseUri: '/services/data/v68.0',
621
+ basePath: '/connect/stage-management/adhoc-steps/' + config.urlParams.recordId + '',
622
+ method: 'get',
623
+ body: null,
624
+ urlParams: config.urlParams,
625
+ queryParams: config.queryParams,
626
+ headers,
627
+ priority: 'normal',
628
+ };
629
+ }
630
+
631
+ const adapterName$1 = 'getAdhocSteps';
632
+ const getAdhocSteps_ConfigPropertyMetadata = [
633
+ generateParamConfigMetadata('recordId', true, 0 /* UrlParameter */, 0 /* String */),
634
+ generateParamConfigMetadata('stageValue', true, 1 /* QueryParameter */, 0 /* String */),
635
+ ];
636
+ const getAdhocSteps_ConfigPropertyNames = /*#__PURE__*/ buildAdapterValidationConfig(adapterName$1, getAdhocSteps_ConfigPropertyMetadata);
637
+ const createResourceParams$1 = /*#__PURE__*/ createResourceParams$3(getAdhocSteps_ConfigPropertyMetadata);
638
+ function keyBuilder$1(luvio, config) {
639
+ const resourceParams = createResourceParams$1(config);
640
+ return keyBuilder$2(luvio, resourceParams);
641
+ }
642
+ function typeCheckConfig$1(untrustedConfig) {
643
+ const config = {};
644
+ typeCheckConfig$3(untrustedConfig, config, getAdhocSteps_ConfigPropertyMetadata);
645
+ return config;
646
+ }
647
+ function validateAdapterConfig$1(untrustedConfig, configPropertyNames) {
648
+ if (!untrustedIsObject(untrustedConfig)) {
649
+ return null;
650
+ }
651
+ if (process.env.NODE_ENV !== 'production') {
652
+ validateConfig(untrustedConfig, configPropertyNames);
653
+ }
654
+ const config = typeCheckConfig$1(untrustedConfig);
383
655
  if (!areRequiredParametersPresent(config, configPropertyNames)) {
384
656
  return null;
385
657
  }
386
658
  return config;
387
659
  }
388
660
  function adapterFragment(luvio, config) {
389
- createResourceParams(config);
390
- return select();
661
+ createResourceParams$1(config);
662
+ return select$2();
391
663
  }
392
664
  function onFetchResponseSuccess(luvio, config, resourceParams, response) {
393
- const snapshot = ingestSuccess(luvio, resourceParams, response, {
665
+ const snapshot = ingestSuccess$1(luvio, resourceParams, response, {
394
666
  config,
395
- resolve: () => buildNetworkSnapshot(luvio, config, snapshotRefreshOptions)
667
+ resolve: () => buildNetworkSnapshot$1(luvio, config, snapshotRefreshOptions)
396
668
  });
397
669
  return luvio.storeBroadcast().then(() => snapshot);
398
670
  }
399
671
  function onFetchResponseError(luvio, config, resourceParams, response) {
400
672
  const snapshot = ingestError(luvio, resourceParams, response, {
401
673
  config,
402
- resolve: () => buildNetworkSnapshot(luvio, config, snapshotRefreshOptions)
674
+ resolve: () => buildNetworkSnapshot$1(luvio, config, snapshotRefreshOptions)
403
675
  });
404
676
  return luvio.storeBroadcast().then(() => snapshot);
405
677
  }
406
- function buildNetworkSnapshot(luvio, config, options) {
407
- const resourceParams = createResourceParams(config);
408
- const request = createResourceRequest(resourceParams);
678
+ function buildNetworkSnapshot$1(luvio, config, options) {
679
+ const resourceParams = createResourceParams$1(config);
680
+ const request = createResourceRequest$1(resourceParams);
409
681
  return luvio.dispatchResourceRequest(request, options)
410
682
  .then((response) => {
411
683
  return luvio.handleSuccessResponse(() => onFetchResponseSuccess(luvio, config, resourceParams, response), () => {
412
684
  const cache = new StoreKeyMap();
413
- getResponseCacheKeys(cache, luvio, resourceParams, response.body);
685
+ getResponseCacheKeys$1(cache, luvio, resourceParams, response.body);
414
686
  return cache;
415
687
  });
416
688
  }, (response) => {
@@ -418,23 +690,23 @@ function buildNetworkSnapshot(luvio, config, options) {
418
690
  });
419
691
  }
420
692
  function buildNetworkSnapshotCachePolicy(context, coercedAdapterRequestContext) {
421
- return buildNetworkSnapshotCachePolicy$1(context, coercedAdapterRequestContext, buildNetworkSnapshot, undefined, false);
693
+ return buildNetworkSnapshotCachePolicy$2(context, coercedAdapterRequestContext, buildNetworkSnapshot$1, undefined, false);
422
694
  }
423
695
  function buildCachedSnapshotCachePolicy(context, storeLookup) {
424
696
  const { luvio, config } = context;
425
697
  const selector = {
426
- recordId: keyBuilder(luvio, config),
698
+ recordId: keyBuilder$1(luvio, config),
427
699
  node: adapterFragment(luvio, config),
428
700
  variables: {},
429
701
  };
430
702
  const cacheSnapshot = storeLookup(selector, {
431
703
  config,
432
- resolve: () => buildNetworkSnapshot(luvio, config, snapshotRefreshOptions)
704
+ resolve: () => buildNetworkSnapshot$1(luvio, config, snapshotRefreshOptions)
433
705
  });
434
706
  return cacheSnapshot;
435
707
  }
436
- const getStageDetailsAdapterFactory = (luvio) => function stageManagementConnectApi__getStageDetails(untrustedConfig, requestContext) {
437
- const config = validateAdapterConfig(untrustedConfig, getStageDetails_ConfigPropertyNames);
708
+ const getAdhocStepsAdapterFactory = (luvio) => function stageManagementConnectApi__getAdhocSteps(untrustedConfig, requestContext) {
709
+ const config = validateAdapterConfig$1(untrustedConfig, getAdhocSteps_ConfigPropertyNames);
438
710
  // Invalid or incomplete config
439
711
  if (config === null) {
440
712
  return null;
@@ -443,4 +715,168 @@ const getStageDetailsAdapterFactory = (luvio) => function stageManagementConnect
443
715
  buildCachedSnapshotCachePolicy, buildNetworkSnapshotCachePolicy);
444
716
  };
445
717
 
446
- export { getStageDetailsAdapterFactory };
718
+ const TTL = 10000;
719
+ const VERSION = "3353b6ef4230c3aebab2d81c4bb25c47";
720
+ function validate(obj, path = 'ScheduleAdhocStepsResponse') {
721
+ const v_error = (() => {
722
+ if (typeof obj !== 'object' || ArrayIsArray(obj) || obj === null) {
723
+ return new TypeError('Expected "object" but received "' + typeof obj + '" (at "' + path + '")');
724
+ }
725
+ const obj_fulfillmentPlanId = obj.fulfillmentPlanId;
726
+ const path_fulfillmentPlanId = path + '.fulfillmentPlanId';
727
+ if (typeof obj_fulfillmentPlanId !== 'string') {
728
+ return new TypeError('Expected "string" but received "' + typeof obj_fulfillmentPlanId + '" (at "' + path_fulfillmentPlanId + '")');
729
+ }
730
+ const obj_status = obj.status;
731
+ const path_status = path + '.status';
732
+ if (typeof obj_status !== 'string') {
733
+ return new TypeError('Expected "string" but received "' + typeof obj_status + '" (at "' + path_status + '")');
734
+ }
735
+ })();
736
+ return v_error === undefined ? null : v_error;
737
+ }
738
+ const RepresentationType = 'ScheduleAdhocStepsResponse';
739
+ function keyBuilder(luvio, config) {
740
+ return keyPrefix + '::' + RepresentationType + ':' + config.id;
741
+ }
742
+ function keyBuilderFromType(luvio, object) {
743
+ const keyParams = {
744
+ id: object.fulfillmentPlanId
745
+ };
746
+ return keyBuilder(luvio, keyParams);
747
+ }
748
+ function normalize(input, existing, path, luvio, store, timestamp) {
749
+ return input;
750
+ }
751
+ const select$1 = function ScheduleAdhocStepsResponseSelect() {
752
+ return {
753
+ kind: 'Fragment',
754
+ version: VERSION,
755
+ private: [],
756
+ opaque: true
757
+ };
758
+ };
759
+ function equals(existing, incoming) {
760
+ if (JSONStringify(incoming) !== JSONStringify(existing)) {
761
+ return false;
762
+ }
763
+ return true;
764
+ }
765
+ const ingest = function ScheduleAdhocStepsResponseIngest(input, path, luvio, store, timestamp) {
766
+ if (process.env.NODE_ENV !== 'production') {
767
+ const validateError = validate(input);
768
+ if (validateError !== null) {
769
+ throw validateError;
770
+ }
771
+ }
772
+ const key = keyBuilderFromType(luvio, input);
773
+ const ttlToUse = TTL;
774
+ ingestShape(input, path, luvio, store, timestamp, ttlToUse, key, normalize, "stage-management-connect-api", VERSION, RepresentationType, equals);
775
+ return createLink(key);
776
+ };
777
+ function getTypeCacheKeys(rootKeySet, luvio, input, fullPathFactory) {
778
+ // root cache key (uses fullPathFactory if keyBuilderFromType isn't defined)
779
+ const rootKey = keyBuilderFromType(luvio, input);
780
+ rootKeySet.set(rootKey, {
781
+ namespace: keyPrefix,
782
+ representationName: RepresentationType,
783
+ mergeable: false
784
+ });
785
+ }
786
+
787
+ function select(luvio, params) {
788
+ return select$1();
789
+ }
790
+ function getResponseCacheKeys(storeKeyMap, luvio, resourceParams, response) {
791
+ getTypeCacheKeys(storeKeyMap, luvio, response);
792
+ }
793
+ function ingestSuccess(luvio, resourceParams, response) {
794
+ const { body } = response;
795
+ const key = keyBuilderFromType(luvio, body);
796
+ luvio.storeIngest(key, ingest, body);
797
+ const snapshot = luvio.storeLookup({
798
+ recordId: key,
799
+ node: select(),
800
+ variables: {},
801
+ });
802
+ if (process.env.NODE_ENV !== 'production') {
803
+ if (snapshot.state !== 'Fulfilled') {
804
+ throw new Error('Invalid network response. Expected resource response to result in Fulfilled snapshot');
805
+ }
806
+ }
807
+ deepFreeze(snapshot.data);
808
+ return snapshot;
809
+ }
810
+ function createResourceRequest(config) {
811
+ const headers = {};
812
+ return {
813
+ baseUri: '/services/data/v68.0',
814
+ basePath: '/connect/stage-management/adhoc-steps',
815
+ method: 'post',
816
+ body: config.body,
817
+ urlParams: {},
818
+ queryParams: {},
819
+ headers,
820
+ priority: 'normal',
821
+ };
822
+ }
823
+
824
+ const adapterName = 'scheduleAdhocSteps';
825
+ const scheduleAdhocSteps_ConfigPropertyMetadata = [
826
+ generateParamConfigMetadata('referenceRecordId', true, 2 /* Body */, 0 /* String */),
827
+ generateParamConfigMetadata('currentStageValueId', true, 2 /* Body */, 0 /* String */),
828
+ generateParamConfigMetadata('stageDefinitionId', true, 2 /* Body */, 0 /* String */),
829
+ generateParamConfigMetadata('stepDefIds', true, 2 /* Body */, 0 /* String */, true),
830
+ generateParamConfigMetadata('adhocReason', true, 2 /* Body */, 0 /* String */),
831
+ generateParamConfigMetadata('adhocComments', true, 2 /* Body */, 0 /* String */),
832
+ ];
833
+ const scheduleAdhocSteps_ConfigPropertyNames = /*#__PURE__*/ buildAdapterValidationConfig(adapterName, scheduleAdhocSteps_ConfigPropertyMetadata);
834
+ const createResourceParams = /*#__PURE__*/ createResourceParams$3(scheduleAdhocSteps_ConfigPropertyMetadata);
835
+ function typeCheckConfig(untrustedConfig) {
836
+ const config = {};
837
+ typeCheckConfig$3(untrustedConfig, config, scheduleAdhocSteps_ConfigPropertyMetadata);
838
+ return config;
839
+ }
840
+ function validateAdapterConfig(untrustedConfig, configPropertyNames) {
841
+ if (!untrustedIsObject(untrustedConfig)) {
842
+ return null;
843
+ }
844
+ if (process.env.NODE_ENV !== 'production') {
845
+ validateConfig(untrustedConfig, configPropertyNames);
846
+ }
847
+ const config = typeCheckConfig(untrustedConfig);
848
+ if (!areRequiredParametersPresent(config, configPropertyNames)) {
849
+ return null;
850
+ }
851
+ return config;
852
+ }
853
+ function buildNetworkSnapshot(luvio, config, options) {
854
+ const resourceParams = createResourceParams(config);
855
+ const request = createResourceRequest(resourceParams);
856
+ return luvio.dispatchResourceRequest(request, options)
857
+ .then((response) => {
858
+ return luvio.handleSuccessResponse(() => {
859
+ const snapshot = ingestSuccess(luvio, resourceParams, response);
860
+ return luvio.storeBroadcast().then(() => snapshot);
861
+ }, () => {
862
+ const cache = new StoreKeyMap();
863
+ getResponseCacheKeys(cache, luvio, resourceParams, response.body);
864
+ return cache;
865
+ });
866
+ }, (response) => {
867
+ deepFreeze(response);
868
+ throw response;
869
+ });
870
+ }
871
+ const scheduleAdhocStepsAdapterFactory = (luvio) => {
872
+ return function scheduleAdhocSteps(untrustedConfig) {
873
+ const config = validateAdapterConfig(untrustedConfig, scheduleAdhocSteps_ConfigPropertyNames);
874
+ // Invalid or incomplete config
875
+ if (config === null) {
876
+ throw new Error('Invalid config for "scheduleAdhocSteps"');
877
+ }
878
+ return buildNetworkSnapshot(luvio, config);
879
+ };
880
+ };
881
+
882
+ export { getAdhocStepsAdapterFactory, getStageDetailsAdapterFactory, scheduleAdhocStepsAdapterFactory };