@salesforce/lds-adapters-platform-flow 1.464.0 → 1.466.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 { createResourceParams as createResourceParams$3, typeCheckConfig as typeCheckConfig$3, deepFreeze, StoreKeyMap } from '@luvio/engine';
7
+ import { createResourceParams as createResourceParams$4, typeCheckConfig as typeCheckConfig$4, deepFreeze, StoreKeyMap } from '@luvio/engine';
8
8
 
9
9
  const { keys: ObjectKeys$1, create: ObjectCreate$1, assign: ObjectAssign } = Object;
10
10
  const { isArray: ArrayIsArray$1 } = Array;
@@ -134,13 +134,13 @@ function getTypeCacheKeys(rootKeySet, luvio, input, fullPathFactory) {
134
134
  });
135
135
  }
136
136
 
137
- function keyBuilder$2(luvio, params) {
137
+ function keyBuilder$3(luvio, params) {
138
138
  return keyPrefix + '::FlowRuntimeResponseRepresentation:(' + 'flowDevName:' + params.body.flowDevName + '::' + (params.body.flowVersionId === undefined ? 'flowVersionId' : 'flowVersionId:' + params.body.flowVersionId) + '::' + (params.body.arguments === undefined ? 'arguments' : 'arguments:' + params.body.arguments) + '::' + (params.body.enableTrace === undefined ? 'enableTrace' : 'enableTrace:' + params.body.enableTrace) + '::' + (params.body.enableRollbackMode === undefined ? 'enableRollbackMode' : 'enableRollbackMode:' + params.body.enableRollbackMode) + '::' + (params.body.useLatestSubflow === undefined ? 'useLatestSubflow' : 'useLatestSubflow:' + params.body.useLatestSubflow) + '::' + (params.body.debugAsUserId === undefined ? 'debugAsUserId' : 'debugAsUserId:' + params.body.debugAsUserId) + '::' + (params.body.isBuilderDebug === undefined ? 'isBuilderDebug' : 'isBuilderDebug:' + params.body.isBuilderDebug) + ')';
139
139
  }
140
- function getResponseCacheKeys$2(storeKeyMap, luvio, resourceParams, response) {
141
- getTypeCacheKeys(storeKeyMap, luvio, response, () => keyBuilder$2(luvio, resourceParams));
140
+ function getResponseCacheKeys$3(storeKeyMap, luvio, resourceParams, response) {
141
+ getTypeCacheKeys(storeKeyMap, luvio, response, () => keyBuilder$3(luvio, resourceParams));
142
142
  }
143
- function createResourceRequest$2(config) {
143
+ function createResourceRequest$3(config) {
144
144
  const headers = {};
145
145
  return {
146
146
  baseUri: '/services/data/v69.0',
@@ -154,7 +154,7 @@ function createResourceRequest$2(config) {
154
154
  };
155
155
  }
156
156
 
157
- const adapterName$2 = 'startFlow';
157
+ const adapterName$3 = 'startFlow';
158
158
  const startFlow_ConfigPropertyMetadata = [
159
159
  generateParamConfigMetadata('flowDevName', true, 2 /* Body */, 0 /* String */),
160
160
  generateParamConfigMetadata('flowVersionId', false, 2 /* Body */, 0 /* String */),
@@ -165,30 +165,30 @@ const startFlow_ConfigPropertyMetadata = [
165
165
  generateParamConfigMetadata('debugAsUserId', false, 2 /* Body */, 0 /* String */),
166
166
  generateParamConfigMetadata('isBuilderDebug', false, 2 /* Body */, 1 /* Boolean */),
167
167
  ];
168
- const startFlow_ConfigPropertyNames = /*#__PURE__*/ buildAdapterValidationConfig(adapterName$2, startFlow_ConfigPropertyMetadata);
169
- const createResourceParams$2 = /*#__PURE__*/ createResourceParams$3(startFlow_ConfigPropertyMetadata);
170
- function typeCheckConfig$2(untrustedConfig) {
168
+ const startFlow_ConfigPropertyNames = /*#__PURE__*/ buildAdapterValidationConfig(adapterName$3, startFlow_ConfigPropertyMetadata);
169
+ const createResourceParams$3 = /*#__PURE__*/ createResourceParams$4(startFlow_ConfigPropertyMetadata);
170
+ function typeCheckConfig$3(untrustedConfig) {
171
171
  const config = {};
172
- typeCheckConfig$3(untrustedConfig, config, startFlow_ConfigPropertyMetadata);
172
+ typeCheckConfig$4(untrustedConfig, config, startFlow_ConfigPropertyMetadata);
173
173
  return config;
174
174
  }
175
- function validateAdapterConfig$2(untrustedConfig, configPropertyNames) {
175
+ function validateAdapterConfig$3(untrustedConfig, configPropertyNames) {
176
176
  if (!untrustedIsObject(untrustedConfig)) {
177
177
  return null;
178
178
  }
179
179
  if (process.env.NODE_ENV !== 'production') {
180
180
  validateConfig(untrustedConfig, configPropertyNames);
181
181
  }
182
- const config = typeCheckConfig$2(untrustedConfig);
182
+ const config = typeCheckConfig$3(untrustedConfig);
183
183
  if (!areRequiredParametersPresent(config, configPropertyNames)) {
184
184
  return null;
185
185
  }
186
186
  return config;
187
187
  }
188
188
 
189
- function buildNetworkSnapshot$2(luvio, config, options) {
190
- const resourceParams = createResourceParams$2(config);
191
- const request = createResourceRequest$2(resourceParams);
189
+ function buildNetworkSnapshot$3(luvio, config, options) {
190
+ const resourceParams = createResourceParams$3(config);
191
+ const request = createResourceRequest$3(resourceParams);
192
192
  return luvio
193
193
  .dispatchResourceRequest(request, options)
194
194
  .then((response) => {
@@ -197,7 +197,7 @@ function buildNetworkSnapshot$2(luvio, config, options) {
197
197
  return Promise.resolve(response.body);
198
198
  }, () => {
199
199
  const cacheKeys = new StoreKeyMap();
200
- getResponseCacheKeys$2(cacheKeys, luvio, resourceParams, response.body);
200
+ getResponseCacheKeys$3(cacheKeys, luvio, resourceParams, response.body);
201
201
  return cacheKeys;
202
202
  });
203
203
  }, (response) => {
@@ -209,21 +209,21 @@ function buildNetworkSnapshot$2(luvio, config, options) {
209
209
  });
210
210
  }
211
211
  const startFlowAdapterFactory = (luvio) => function flowRuntime__startFlow(untrustedConfig) {
212
- const config = validateAdapterConfig$2(untrustedConfig, startFlow_ConfigPropertyNames);
212
+ const config = validateAdapterConfig$3(untrustedConfig, startFlow_ConfigPropertyNames);
213
213
  // Invalid or incomplete config
214
214
  if (config === null) {
215
215
  return null;
216
216
  }
217
- return buildNetworkSnapshot$2(luvio, config);
217
+ return buildNetworkSnapshot$3(luvio, config);
218
218
  };
219
219
 
220
- function keyBuilder$1(luvio, params) {
220
+ function keyBuilder$2(luvio, params) {
221
221
  return keyPrefix + '::FlowRuntimeResponseRepresentation:(' + 'request.action:' + params.body.request.action + '::' + 'request.serializedState:' + params.body.request.serializedState + '::' + (params.body.request.fields === undefined ? undefined : ('[' + params.body.request.fields.map(element => 'request.fields.field:' + element.field + '::' + (element.isVisible === undefined ? 'request.fields.isVisible' : 'request.fields.isVisible:' + element.isVisible) + '::' + (element.value === undefined ? 'request.fields.value' : 'request.fields.value:' + element.value)).join(',') + ']')) + '::' + (params.body.request.uiElementVisited === undefined ? 'request.uiElementVisited' : 'request.uiElementVisited:' + params.body.request.uiElementVisited) + '::' + (params.body.request.enableTrace === undefined ? 'request.enableTrace' : 'request.enableTrace:' + params.body.request.enableTrace) + '::' + stableJSONStringify(params.body.request.lcErrors) + '::' + (params.body.request.isBuilderDebug === undefined ? 'request.isBuilderDebug' : 'request.isBuilderDebug:' + params.body.request.isBuilderDebug) + ')';
222
222
  }
223
- function getResponseCacheKeys$1(storeKeyMap, luvio, resourceParams, response) {
224
- getTypeCacheKeys(storeKeyMap, luvio, response, () => keyBuilder$1(luvio, resourceParams));
223
+ function getResponseCacheKeys$2(storeKeyMap, luvio, resourceParams, response) {
224
+ getTypeCacheKeys(storeKeyMap, luvio, response, () => keyBuilder$2(luvio, resourceParams));
225
225
  }
226
- function createResourceRequest$1(config) {
226
+ function createResourceRequest$2(config) {
227
227
  const headers = {};
228
228
  return {
229
229
  baseUri: '/services/data/v69.0',
@@ -237,7 +237,7 @@ function createResourceRequest$1(config) {
237
237
  };
238
238
  }
239
239
 
240
- function validate$2(obj, path = 'FlowRuntimeNavigationFieldValue') {
240
+ function validate$3(obj, path = 'FlowRuntimeNavigationFieldValue') {
241
241
  const v_error = (() => {
242
242
  if (typeof obj !== 'object' || ArrayIsArray$1(obj) || obj === null) {
243
243
  return new TypeError('Expected "object" but received "' + typeof obj + '" (at "' + path + '")');
@@ -286,7 +286,7 @@ function validate$2(obj, path = 'FlowRuntimeNavigationFieldValue') {
286
286
  return v_error === undefined ? null : v_error;
287
287
  }
288
288
 
289
- function validate$1(obj, path = 'FlowRuntimeHashbagRepresentation') {
289
+ function validate$2(obj, path = 'FlowRuntimeHashbagRepresentation') {
290
290
  const v_error = (() => {
291
291
  if (typeof obj !== 'object' || ArrayIsArray$1(obj) || obj === null) {
292
292
  return new TypeError('Expected "object" but received "' + typeof obj + '" (at "' + path + '")');
@@ -304,7 +304,7 @@ function validate$1(obj, path = 'FlowRuntimeHashbagRepresentation') {
304
304
  return v_error === undefined ? null : v_error;
305
305
  }
306
306
 
307
- function validate(obj, path = 'FlowRuntimeNavigateFlowRepresentation') {
307
+ function validate$1(obj, path = 'FlowRuntimeNavigateFlowRepresentation') {
308
308
  const v_error = (() => {
309
309
  if (typeof obj !== 'object' || ArrayIsArray$1(obj) || obj === null) {
310
310
  return new TypeError('Expected "object" but received "' + typeof obj + '" (at "' + path + '")');
@@ -330,7 +330,7 @@ function validate(obj, path = 'FlowRuntimeNavigateFlowRepresentation') {
330
330
  for (let i = 0; i < obj_fields.length; i++) {
331
331
  const obj_fields_item = obj_fields[i];
332
332
  const path_fields_item = path_fields + '[' + i + ']';
333
- const referencepath_fields_itemValidationError = validate$2(obj_fields_item, path_fields_item);
333
+ const referencepath_fields_itemValidationError = validate$3(obj_fields_item, path_fields_item);
334
334
  if (referencepath_fields_itemValidationError !== null) {
335
335
  let message = 'Object doesn\'t match FlowRuntimeNavigationFieldValue (at "' + path_fields_item + '")\n';
336
336
  message += referencepath_fields_itemValidationError.message.split('\n').map((line) => '\t' + line).join('\n');
@@ -348,7 +348,7 @@ function validate(obj, path = 'FlowRuntimeNavigateFlowRepresentation') {
348
348
  if (obj.lcErrors !== undefined) {
349
349
  const obj_lcErrors = obj.lcErrors;
350
350
  const path_lcErrors = path + '.lcErrors';
351
- const referencepath_lcErrorsValidationError = validate$1(obj_lcErrors, path_lcErrors);
351
+ const referencepath_lcErrorsValidationError = validate$2(obj_lcErrors, path_lcErrors);
352
352
  if (referencepath_lcErrorsValidationError !== null) {
353
353
  let message = 'Object doesn\'t match FlowRuntimeHashbagRepresentation (at "' + path_lcErrors + '")\n';
354
354
  message += referencepath_lcErrorsValidationError.message.split('\n').map((line) => '\t' + line).join('\n');
@@ -371,21 +371,97 @@ function validate(obj, path = 'FlowRuntimeNavigateFlowRepresentation') {
371
371
  return v_error === undefined ? null : v_error;
372
372
  }
373
373
 
374
- const adapterName$1 = 'navigateFlow';
374
+ const adapterName$2 = 'navigateFlow';
375
375
  const navigateFlow_ConfigPropertyMetadata = [
376
376
  generateParamConfigMetadata('request', true, 2 /* Body */, 4 /* Unsupported */),
377
377
  ];
378
- const navigateFlow_ConfigPropertyNames = /*#__PURE__*/ buildAdapterValidationConfig(adapterName$1, navigateFlow_ConfigPropertyMetadata);
379
- const createResourceParams$1 = /*#__PURE__*/ createResourceParams$3(navigateFlow_ConfigPropertyMetadata);
380
- function typeCheckConfig$1(untrustedConfig) {
378
+ const navigateFlow_ConfigPropertyNames = /*#__PURE__*/ buildAdapterValidationConfig(adapterName$2, navigateFlow_ConfigPropertyMetadata);
379
+ const createResourceParams$2 = /*#__PURE__*/ createResourceParams$4(navigateFlow_ConfigPropertyMetadata);
380
+ function typeCheckConfig$2(untrustedConfig) {
381
381
  const config = {};
382
382
  const untrustedConfig_request = untrustedConfig.request;
383
- const referenceFlowRuntimeNavigateFlowRepresentationValidationError = validate(untrustedConfig_request);
383
+ const referenceFlowRuntimeNavigateFlowRepresentationValidationError = validate$1(untrustedConfig_request);
384
384
  if (referenceFlowRuntimeNavigateFlowRepresentationValidationError === null) {
385
385
  config.request = untrustedConfig_request;
386
386
  }
387
387
  return config;
388
388
  }
389
+ function validateAdapterConfig$2(untrustedConfig, configPropertyNames) {
390
+ if (!untrustedIsObject(untrustedConfig)) {
391
+ return null;
392
+ }
393
+ if (process.env.NODE_ENV !== 'production') {
394
+ validateConfig(untrustedConfig, configPropertyNames);
395
+ }
396
+ const config = typeCheckConfig$2(untrustedConfig);
397
+ if (!areRequiredParametersPresent(config, configPropertyNames)) {
398
+ return null;
399
+ }
400
+ return config;
401
+ }
402
+
403
+ function buildNetworkSnapshot$2(luvio, config, context) {
404
+ const resourceParams = createResourceParams$2(config);
405
+ const request = createResourceRequest$2(resourceParams);
406
+ return luvio
407
+ .dispatchResourceRequest(request, context)
408
+ .then((response) => {
409
+ return luvio.handleSuccessResponse(() => {
410
+ deepFreeze(response.body);
411
+ return Promise.resolve(response.body);
412
+ }, () => {
413
+ const cacheKeys = new StoreKeyMap();
414
+ getResponseCacheKeys$2(cacheKeys, luvio, resourceParams, response.body);
415
+ return cacheKeys;
416
+ });
417
+ }, (response) => {
418
+ return luvio.handleErrorResponse(() => {
419
+ // We want to throw these exceptions to be caught in the runtime layer
420
+ // eslint-disable-next-line @salesforce/lds/no-error-in-production
421
+ throw new Error(response.body.message || response.body.error || response.body);
422
+ });
423
+ });
424
+ }
425
+ const navigateFlowAdapterFactory = (luvio) => function flowRuntime__navigateFlow(untrustedConfig) {
426
+ const config = validateAdapterConfig$2(untrustedConfig, navigateFlow_ConfigPropertyNames);
427
+ // Invalid or incomplete config
428
+ if (config === null) {
429
+ return null;
430
+ }
431
+ return buildNetworkSnapshot$2(luvio, config);
432
+ };
433
+
434
+ function keyBuilder$1(luvio, params) {
435
+ return keyPrefix + '::FlowRuntimeResponseRepresentation:(' + 'pausedInterviewId:' + params.body.pausedInterviewId + ')';
436
+ }
437
+ function getResponseCacheKeys$1(storeKeyMap, luvio, resourceParams, response) {
438
+ getTypeCacheKeys(storeKeyMap, luvio, response, () => keyBuilder$1(luvio, resourceParams));
439
+ }
440
+ function createResourceRequest$1(config) {
441
+ const headers = {};
442
+ return {
443
+ baseUri: '/services/data/v69.0',
444
+ basePath: '/connect/interaction/runtime/resumeFlow',
445
+ method: 'post',
446
+ body: config.body,
447
+ urlParams: {},
448
+ queryParams: {},
449
+ headers,
450
+ priority: 'normal',
451
+ };
452
+ }
453
+
454
+ const adapterName$1 = 'resumeFlow';
455
+ const resumeFlow_ConfigPropertyMetadata = [
456
+ generateParamConfigMetadata('pausedInterviewId', true, 2 /* Body */, 0 /* String */),
457
+ ];
458
+ const resumeFlow_ConfigPropertyNames = /*#__PURE__*/ buildAdapterValidationConfig(adapterName$1, resumeFlow_ConfigPropertyMetadata);
459
+ const createResourceParams$1 = /*#__PURE__*/ createResourceParams$4(resumeFlow_ConfigPropertyMetadata);
460
+ function typeCheckConfig$1(untrustedConfig) {
461
+ const config = {};
462
+ typeCheckConfig$4(untrustedConfig, config, resumeFlow_ConfigPropertyMetadata);
463
+ return config;
464
+ }
389
465
  function validateAdapterConfig$1(untrustedConfig, configPropertyNames) {
390
466
  if (!untrustedIsObject(untrustedConfig)) {
391
467
  return null;
@@ -400,11 +476,11 @@ function validateAdapterConfig$1(untrustedConfig, configPropertyNames) {
400
476
  return config;
401
477
  }
402
478
 
403
- function buildNetworkSnapshot$1(luvio, config, context) {
479
+ function buildNetworkSnapshot$1(luvio, config, options) {
404
480
  const resourceParams = createResourceParams$1(config);
405
481
  const request = createResourceRequest$1(resourceParams);
406
482
  return luvio
407
- .dispatchResourceRequest(request, context)
483
+ .dispatchResourceRequest(request, options)
408
484
  .then((response) => {
409
485
  return luvio.handleSuccessResponse(() => {
410
486
  deepFreeze(response.body);
@@ -422,8 +498,8 @@ function buildNetworkSnapshot$1(luvio, config, context) {
422
498
  });
423
499
  });
424
500
  }
425
- const navigateFlowAdapterFactory = (luvio) => function flowRuntime__navigateFlow(untrustedConfig) {
426
- const config = validateAdapterConfig$1(untrustedConfig, navigateFlow_ConfigPropertyNames);
501
+ const resumeFlowAdapterFactory = (luvio) => function flowRuntime__resumeFlow(untrustedConfig) {
502
+ const config = validateAdapterConfig$1(untrustedConfig, resumeFlow_ConfigPropertyNames);
427
503
  // Invalid or incomplete config
428
504
  if (config === null) {
429
505
  return null;
@@ -432,7 +508,7 @@ const navigateFlowAdapterFactory = (luvio) => function flowRuntime__navigateFlow
432
508
  };
433
509
 
434
510
  function keyBuilder(luvio, params) {
435
- return keyPrefix + '::FlowRuntimeResponseRepresentation:(' + 'pausedInterviewId:' + params.body.pausedInterviewId + ')';
511
+ return keyPrefix + '::FlowRuntimeResponseRepresentation:(' + 'request.interviewGuid:' + params.body.request.interviewGuid + '::' + 'request.correlationId:' + params.body.request.correlationId + '::' + 'request.actionType:' + params.body.request.actionType + ')';
436
512
  }
437
513
  function getResponseCacheKeys(storeKeyMap, luvio, resourceParams, response) {
438
514
  getTypeCacheKeys(storeKeyMap, luvio, response, () => keyBuilder(luvio, resourceParams));
@@ -441,7 +517,7 @@ function createResourceRequest(config) {
441
517
  const headers = {};
442
518
  return {
443
519
  baseUri: '/services/data/v69.0',
444
- basePath: '/connect/interaction/runtime/resumeFlow',
520
+ basePath: '/connect/interaction/runtime/pollForAsyncAction',
445
521
  method: 'post',
446
522
  body: config.body,
447
523
  urlParams: {},
@@ -451,15 +527,43 @@ function createResourceRequest(config) {
451
527
  };
452
528
  }
453
529
 
454
- const adapterName = 'resumeFlow';
455
- const resumeFlow_ConfigPropertyMetadata = [
456
- generateParamConfigMetadata('pausedInterviewId', true, 2 /* Body */, 0 /* String */),
530
+ function validate(obj, path = 'FlowRuntimePollForAsyncActionRepresentation') {
531
+ const v_error = (() => {
532
+ if (typeof obj !== 'object' || ArrayIsArray$1(obj) || obj === null) {
533
+ return new TypeError('Expected "object" but received "' + typeof obj + '" (at "' + path + '")');
534
+ }
535
+ const obj_actionType = obj.actionType;
536
+ const path_actionType = path + '.actionType';
537
+ if (typeof obj_actionType !== 'string') {
538
+ return new TypeError('Expected "string" but received "' + typeof obj_actionType + '" (at "' + path_actionType + '")');
539
+ }
540
+ const obj_correlationId = obj.correlationId;
541
+ const path_correlationId = path + '.correlationId';
542
+ if (typeof obj_correlationId !== 'string') {
543
+ return new TypeError('Expected "string" but received "' + typeof obj_correlationId + '" (at "' + path_correlationId + '")');
544
+ }
545
+ const obj_interviewGuid = obj.interviewGuid;
546
+ const path_interviewGuid = path + '.interviewGuid';
547
+ if (typeof obj_interviewGuid !== 'string') {
548
+ return new TypeError('Expected "string" but received "' + typeof obj_interviewGuid + '" (at "' + path_interviewGuid + '")');
549
+ }
550
+ })();
551
+ return v_error === undefined ? null : v_error;
552
+ }
553
+
554
+ const adapterName = 'pollForAsyncAction';
555
+ const pollForAsyncAction_ConfigPropertyMetadata = [
556
+ generateParamConfigMetadata('request', true, 2 /* Body */, 4 /* Unsupported */),
457
557
  ];
458
- const resumeFlow_ConfigPropertyNames = /*#__PURE__*/ buildAdapterValidationConfig(adapterName, resumeFlow_ConfigPropertyMetadata);
459
- const createResourceParams = /*#__PURE__*/ createResourceParams$3(resumeFlow_ConfigPropertyMetadata);
558
+ const pollForAsyncAction_ConfigPropertyNames = /*#__PURE__*/ buildAdapterValidationConfig(adapterName, pollForAsyncAction_ConfigPropertyMetadata);
559
+ const createResourceParams = /*#__PURE__*/ createResourceParams$4(pollForAsyncAction_ConfigPropertyMetadata);
460
560
  function typeCheckConfig(untrustedConfig) {
461
561
  const config = {};
462
- typeCheckConfig$3(untrustedConfig, config, resumeFlow_ConfigPropertyMetadata);
562
+ const untrustedConfig_request = untrustedConfig.request;
563
+ const referenceFlowRuntimePollForAsyncActionRepresentationValidationError = validate(untrustedConfig_request);
564
+ if (referenceFlowRuntimePollForAsyncActionRepresentationValidationError === null) {
565
+ config.request = untrustedConfig_request;
566
+ }
463
567
  return config;
464
568
  }
465
569
  function validateAdapterConfig(untrustedConfig, configPropertyNames) {
@@ -476,11 +580,11 @@ function validateAdapterConfig(untrustedConfig, configPropertyNames) {
476
580
  return config;
477
581
  }
478
582
 
479
- function buildNetworkSnapshot(luvio, config, options) {
583
+ function buildNetworkSnapshot(luvio, config, context) {
480
584
  const resourceParams = createResourceParams(config);
481
585
  const request = createResourceRequest(resourceParams);
482
586
  return luvio
483
- .dispatchResourceRequest(request, options)
587
+ .dispatchResourceRequest(request, context)
484
588
  .then((response) => {
485
589
  return luvio.handleSuccessResponse(() => {
486
590
  deepFreeze(response.body);
@@ -498,8 +602,8 @@ function buildNetworkSnapshot(luvio, config, options) {
498
602
  });
499
603
  });
500
604
  }
501
- const resumeFlowAdapterFactory = (luvio) => function flowRuntime__resumeFlow(untrustedConfig) {
502
- const config = validateAdapterConfig(untrustedConfig, resumeFlow_ConfigPropertyNames);
605
+ const pollForAsyncActionAdapterFactory = (luvio) => function flowRuntime__pollForAsyncAction(untrustedConfig) {
606
+ const config = validateAdapterConfig(untrustedConfig, pollForAsyncAction_ConfigPropertyNames);
503
607
  // Invalid or incomplete config
504
608
  if (config === null) {
505
609
  return null;
@@ -507,4 +611,4 @@ const resumeFlowAdapterFactory = (luvio) => function flowRuntime__resumeFlow(unt
507
611
  return buildNetworkSnapshot(luvio, config);
508
612
  };
509
613
 
510
- export { navigateFlowAdapterFactory, resumeFlowAdapterFactory, startFlowAdapterFactory };
614
+ export { navigateFlowAdapterFactory, pollForAsyncActionAdapterFactory, resumeFlowAdapterFactory, startFlowAdapterFactory };
@@ -0,0 +1,6 @@
1
+ import type { Luvio as $64$luvio_engine_Luvio, DispatchResourceRequestContext } from '@luvio/engine';
2
+ import type { FlowRuntimeResponseRepresentation as types_FlowRuntimeResponseRepresentation_FlowRuntimeResponseRepresentation } from '../generated/types/FlowRuntimeResponseRepresentation';
3
+ import type { PollForAsyncActionConfig } from '../generated/adapters/pollForAsyncAction';
4
+ export { adapterName } from '../generated/adapters/pollForAsyncAction';
5
+ export declare function buildNetworkSnapshot(luvio: $64$luvio_engine_Luvio, config: PollForAsyncActionConfig, context?: DispatchResourceRequestContext): Promise<types_FlowRuntimeResponseRepresentation_FlowRuntimeResponseRepresentation>;
6
+ export declare const pollForAsyncActionAdapterFactory: any;
@@ -1,3 +1,4 @@
1
1
  export { startFlowAdapterFactory } from '../adapters/startFlow';
2
2
  export { navigateFlowAdapterFactory } from '../adapters/navigateFlow';
3
3
  export { resumeFlowAdapterFactory } from '../adapters/resumeFlow';
4
+ export { pollForAsyncActionAdapterFactory } from '../adapters/pollForAsyncAction';
@@ -1,4 +1,5 @@
1
1
  declare let navigateFlow: any;
2
2
  declare let resumeFlow: any;
3
3
  declare let startFlow: any;
4
- export { navigateFlow, resumeFlow, startFlow };
4
+ declare let pollForAsyncAction: any;
5
+ export { navigateFlow, resumeFlow, startFlow, pollForAsyncAction };
@@ -0,0 +1,28 @@
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 } from './adapter-utils';
3
+ import { FlowRuntimePollForAsyncActionRepresentation as types_FlowRuntimePollForAsyncActionRepresentation_FlowRuntimePollForAsyncActionRepresentation } from '../types/FlowRuntimePollForAsyncActionRepresentation';
4
+ import { ResourceRequestConfig as resources_postConnectInteractionRuntimePollForAsyncAction_ResourceRequestConfig } from '../resources/postConnectInteractionRuntimePollForAsyncAction';
5
+ import { FlowRuntimeResponseRepresentation as types_FlowRuntimeResponseRepresentation_FlowRuntimeResponseRepresentation } from '../types/FlowRuntimeResponseRepresentation';
6
+ export declare const adapterName = "pollForAsyncAction";
7
+ export declare const pollForAsyncAction_ConfigPropertyMetadata: $64$luvio_engine_AdapterConfigMetadata[];
8
+ export declare const pollForAsyncAction_ConfigPropertyNames: adapter$45$utils_AdapterValidationConfig;
9
+ export interface PollForAsyncActionConfig {
10
+ request: types_FlowRuntimePollForAsyncActionRepresentation_FlowRuntimePollForAsyncActionRepresentation;
11
+ }
12
+ export declare const createResourceParams: (config: PollForAsyncActionConfig) => resources_postConnectInteractionRuntimePollForAsyncAction_ResourceRequestConfig;
13
+ export declare function keyBuilder(luvio: $64$luvio_engine_Luvio, config: PollForAsyncActionConfig): string;
14
+ export declare function keyBuilder_StructuredKey(luvio: $64$luvio_engine_Luvio, config: PollForAsyncActionConfig): $64$luvio_engine_NormalizedKeyMetadata;
15
+ export declare function typeCheckConfig(untrustedConfig: adapter$45$utils_Untrusted<PollForAsyncActionConfig>): adapter$45$utils_Untrusted<PollForAsyncActionConfig>;
16
+ export declare function validateAdapterConfig(untrustedConfig: unknown, configPropertyNames: adapter$45$utils_AdapterValidationConfig): PollForAsyncActionConfig | null;
17
+ export declare function adapterFragment(luvio: $64$luvio_engine_Luvio, config: PollForAsyncActionConfig): $64$luvio_engine_Fragment;
18
+ export declare function buildCachedSnapshot(luvio: $64$luvio_engine_Luvio, config: PollForAsyncActionConfig): $64$luvio_engine_Snapshot<types_FlowRuntimeResponseRepresentation_FlowRuntimeResponseRepresentation, any>;
19
+ export declare function onFetchResponseSuccess(luvio: $64$luvio_engine_Luvio, config: PollForAsyncActionConfig, resourceParams: resources_postConnectInteractionRuntimePollForAsyncAction_ResourceRequestConfig, response: $64$luvio_engine_FetchResponse<types_FlowRuntimeResponseRepresentation_FlowRuntimeResponseRepresentation>): Promise<import("@luvio/engine").FulfilledSnapshot<types_FlowRuntimeResponseRepresentation_FlowRuntimeResponseRepresentation, {}> | import("@luvio/engine").StaleSnapshot<types_FlowRuntimeResponseRepresentation_FlowRuntimeResponseRepresentation, {}> | import("@luvio/engine").PendingSnapshot<types_FlowRuntimeResponseRepresentation_FlowRuntimeResponseRepresentation, any>>;
20
+ export declare function onFetchResponseError(luvio: $64$luvio_engine_Luvio, config: PollForAsyncActionConfig, resourceParams: resources_postConnectInteractionRuntimePollForAsyncAction_ResourceRequestConfig, response: $64$luvio_engine_ErrorResponse): Promise<import("@luvio/engine").ErrorSnapshot>;
21
+ export declare function buildNetworkSnapshot(luvio: $64$luvio_engine_Luvio, config: PollForAsyncActionConfig, options?: $64$luvio_engine_DispatchResourceRequestContext): Promise<$64$luvio_engine_Snapshot<types_FlowRuntimeResponseRepresentation_FlowRuntimeResponseRepresentation, any>>;
22
+ export type BuildSnapshotContext = {
23
+ luvio: $64$luvio_engine_Luvio;
24
+ config: PollForAsyncActionConfig;
25
+ };
26
+ export declare function buildNetworkSnapshotCachePolicy(context: BuildSnapshotContext, coercedAdapterRequestContext: $64$luvio_engine_CoercedAdapterRequestContext): Promise<$64$luvio_engine_Snapshot<types_FlowRuntimeResponseRepresentation_FlowRuntimeResponseRepresentation, any>>;
27
+ export declare function buildCachedSnapshotCachePolicy(context: BuildSnapshotContext, storeLookup: $64$luvio_engine_StoreLookup<types_FlowRuntimeResponseRepresentation_FlowRuntimeResponseRepresentation>): $64$luvio_engine_Snapshot<types_FlowRuntimeResponseRepresentation_FlowRuntimeResponseRepresentation, any>;
28
+ export declare const pollForAsyncActionAdapterFactory: $64$luvio_engine_AdapterFactory<PollForAsyncActionConfig, types_FlowRuntimeResponseRepresentation_FlowRuntimeResponseRepresentation>;
@@ -1,3 +1,4 @@
1
1
  export { startFlowAdapterFactory } from '../adapters/startFlow';
2
2
  export { navigateFlowAdapterFactory } from '../adapters/navigateFlow';
3
3
  export { resumeFlowAdapterFactory } from '../adapters/resumeFlow';
4
+ export { pollForAsyncActionAdapterFactory } from '../adapters/pollForAsyncAction';
@@ -1,7 +1,9 @@
1
1
  declare let navigateFlow: any;
2
+ declare let pollForAsyncAction: any;
2
3
  declare let resumeFlow: any;
3
4
  declare let startFlow: any;
4
5
  declare let navigateFlow_imperative: any;
6
+ declare let pollForAsyncAction_imperative: any;
5
7
  declare let resumeFlow_imperative: any;
6
8
  declare let startFlow_imperative: any;
7
- export { navigateFlow, resumeFlow, startFlow, navigateFlow_imperative, resumeFlow_imperative, startFlow_imperative, };
9
+ export { navigateFlow, pollForAsyncAction, resumeFlow, startFlow, navigateFlow_imperative, pollForAsyncAction_imperative, resumeFlow_imperative, startFlow_imperative, };
@@ -0,0 +1,16 @@
1
+ import { FlowRuntimePollForAsyncActionRepresentation as types_FlowRuntimePollForAsyncActionRepresentation_FlowRuntimePollForAsyncActionRepresentation } from '../types/FlowRuntimePollForAsyncActionRepresentation';
2
+ 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';
3
+ import { FlowRuntimeResponseRepresentation as types_FlowRuntimeResponseRepresentation_FlowRuntimeResponseRepresentation } from '../types/FlowRuntimeResponseRepresentation';
4
+ export interface ResourceRequestConfig {
5
+ body: {
6
+ request: types_FlowRuntimePollForAsyncActionRepresentation_FlowRuntimePollForAsyncActionRepresentation;
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_FlowRuntimeResponseRepresentation_FlowRuntimeResponseRepresentation): void;
13
+ export declare function ingestSuccess(luvio: $64$luvio_engine_Luvio, resourceParams: ResourceRequestConfig, response: $64$luvio_engine_FetchResponse<types_FlowRuntimeResponseRepresentation_FlowRuntimeResponseRepresentation>, snapshotRefresh?: $64$luvio_engine_SnapshotRefresh<types_FlowRuntimeResponseRepresentation_FlowRuntimeResponseRepresentation>): $64$luvio_engine_FulfilledSnapshot<types_FlowRuntimeResponseRepresentation_FlowRuntimeResponseRepresentation, {}> | $64$luvio_engine_StaleSnapshot<types_FlowRuntimeResponseRepresentation_FlowRuntimeResponseRepresentation, {}> | $64$luvio_engine_PendingSnapshot<types_FlowRuntimeResponseRepresentation_FlowRuntimeResponseRepresentation, any>;
14
+ export declare function ingestError(luvio: $64$luvio_engine_Luvio, params: ResourceRequestConfig, error: $64$luvio_engine_ErrorResponse, snapshotRefresh?: $64$luvio_engine_SnapshotRefresh<types_FlowRuntimeResponseRepresentation_FlowRuntimeResponseRepresentation>): $64$luvio_engine_ErrorSnapshot;
15
+ export declare function createResourceRequest(config: ResourceRequestConfig): $64$luvio_engine_ResourceRequest;
16
+ export default createResourceRequest;
@@ -0,0 +1,31 @@
1
+ import { IngestPath as $64$luvio_engine_IngestPath, Luvio as $64$luvio_engine_Luvio, Store as $64$luvio_engine_Store, FragmentSelection as $64$luvio_engine_FragmentSelection, ResourceIngest as $64$luvio_engine_ResourceIngest, DurableStoreKeyMetadataMap as $64$luvio_engine_DurableStoreKeyMetadataMap, NormalizedKeyMetadata as $64$luvio_engine_NormalizedKeyMetadata } from '@luvio/engine';
2
+ export declare const VERSION = "011be367240b9c8a2c705bc31d2b0e7b";
3
+ export declare function validate(obj: any, path?: string): TypeError | null;
4
+ export declare const RepresentationType: string;
5
+ export declare function normalize(input: FlowRuntimePollForAsyncActionRepresentation, existing: FlowRuntimePollForAsyncActionRepresentationNormalized, path: $64$luvio_engine_IngestPath, luvio: $64$luvio_engine_Luvio, store: $64$luvio_engine_Store, timestamp: number): FlowRuntimePollForAsyncActionRepresentationNormalized;
6
+ export declare const select: () => $64$luvio_engine_FragmentSelection;
7
+ export declare function equals(existing: FlowRuntimePollForAsyncActionRepresentationNormalized, incoming: FlowRuntimePollForAsyncActionRepresentationNormalized): boolean;
8
+ export declare const ingest: $64$luvio_engine_ResourceIngest;
9
+ export declare function getTypeCacheKeys(rootKeySet: $64$luvio_engine_DurableStoreKeyMetadataMap, luvio: $64$luvio_engine_Luvio, input: FlowRuntimePollForAsyncActionRepresentation, fullPathFactory: () => string | $64$luvio_engine_NormalizedKeyMetadata): void;
10
+ /**
11
+ *
12
+ *
13
+ * Keys:
14
+ * (none)
15
+ */
16
+ export interface FlowRuntimePollForAsyncActionRepresentationNormalized {
17
+ actionType: string;
18
+ correlationId: string;
19
+ interviewGuid: string;
20
+ }
21
+ /**
22
+ *
23
+ *
24
+ * Keys:
25
+ * (none)
26
+ */
27
+ export interface FlowRuntimePollForAsyncActionRepresentation {
28
+ actionType: string;
29
+ correlationId: string;
30
+ interviewGuid: string;
31
+ }
@@ -0,0 +1,28 @@
1
+ import { FlowRuntimePollForAsyncActionRepresentation as FlowRuntimePollForAsyncActionRepresentation_FlowRuntimePollForAsyncActionRepresentation } from './FlowRuntimePollForAsyncActionRepresentation';
2
+ import { IngestPath as $64$luvio_engine_IngestPath, Luvio as $64$luvio_engine_Luvio, Store as $64$luvio_engine_Store, FragmentSelection as $64$luvio_engine_FragmentSelection, ResourceIngest as $64$luvio_engine_ResourceIngest, DurableStoreKeyMetadataMap as $64$luvio_engine_DurableStoreKeyMetadataMap, NormalizedKeyMetadata as $64$luvio_engine_NormalizedKeyMetadata } from '@luvio/engine';
3
+ export declare const VERSION = "f551c90d974dfc5e018fdc95819108ea";
4
+ export declare function validate(obj: any, path?: string): TypeError | null;
5
+ export declare const RepresentationType: string;
6
+ export declare function normalize(input: FlowRuntimePollForAsyncActionWrapperRepresentation, existing: FlowRuntimePollForAsyncActionWrapperRepresentationNormalized, path: $64$luvio_engine_IngestPath, luvio: $64$luvio_engine_Luvio, store: $64$luvio_engine_Store, timestamp: number): FlowRuntimePollForAsyncActionWrapperRepresentationNormalized;
7
+ export declare const select: () => $64$luvio_engine_FragmentSelection;
8
+ export declare function equals(existing: FlowRuntimePollForAsyncActionWrapperRepresentationNormalized, incoming: FlowRuntimePollForAsyncActionWrapperRepresentationNormalized): boolean;
9
+ export declare const ingest: $64$luvio_engine_ResourceIngest;
10
+ export declare function getTypeCacheKeys(rootKeySet: $64$luvio_engine_DurableStoreKeyMetadataMap, luvio: $64$luvio_engine_Luvio, input: FlowRuntimePollForAsyncActionWrapperRepresentation, fullPathFactory: () => string | $64$luvio_engine_NormalizedKeyMetadata): void;
11
+ /**
12
+ *
13
+ *
14
+ * Keys:
15
+ * (none)
16
+ */
17
+ export interface FlowRuntimePollForAsyncActionWrapperRepresentationNormalized {
18
+ request: FlowRuntimePollForAsyncActionRepresentation_FlowRuntimePollForAsyncActionRepresentation;
19
+ }
20
+ /**
21
+ *
22
+ *
23
+ * Keys:
24
+ * (none)
25
+ */
26
+ export interface FlowRuntimePollForAsyncActionWrapperRepresentation {
27
+ request: FlowRuntimePollForAsyncActionRepresentation_FlowRuntimePollForAsyncActionRepresentation;
28
+ }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@salesforce/lds-adapters-platform-flow",
3
- "version": "1.464.0",
3
+ "version": "1.466.0",
4
4
  "license": "SEE LICENSE IN LICENSE.txt",
5
5
  "description": "Flow Runtime APIs",
6
6
  "main": "dist/es/es2018/platform-flow.js",
@@ -35,10 +35,10 @@
35
35
  "release:core": "../../scripts/release/core.js --adapter=lds-adapters-platform-flow"
36
36
  },
37
37
  "dependencies": {
38
- "@salesforce/lds-bindings": "^1.464.0"
38
+ "@salesforce/lds-bindings": "^1.466.0"
39
39
  },
40
40
  "devDependencies": {
41
- "@salesforce/lds-compiler-plugins": "^1.464.0"
41
+ "@salesforce/lds-compiler-plugins": "^1.466.0"
42
42
  },
43
43
  "nx": {
44
44
  "targets": {
package/sfdc/index.js CHANGED
@@ -14,7 +14,7 @@
14
14
  /* proxy-compat-disable */
15
15
  import { createLDSAdapter } from 'force/ldsBindings';
16
16
  import { withDefaultLuvio } from 'force/ldsEngine';
17
- import { createResourceParams as createResourceParams$3, deepFreeze, StoreKeyMap, typeCheckConfig as typeCheckConfig$3 } from 'force/luvioEngine';
17
+ import { createResourceParams as createResourceParams$4, deepFreeze, StoreKeyMap, typeCheckConfig as typeCheckConfig$4 } from 'force/luvioEngine';
18
18
 
19
19
  const { keys: ObjectKeys$1, create: ObjectCreate$1, assign: ObjectAssign } = Object;
20
20
  const { isArray: ArrayIsArray$1 } = Array;
@@ -144,13 +144,13 @@ function getTypeCacheKeys(rootKeySet, luvio, input, fullPathFactory) {
144
144
  });
145
145
  }
146
146
 
147
- function keyBuilder$2(luvio, params) {
147
+ function keyBuilder$3(luvio, params) {
148
148
  return keyPrefix + '::FlowRuntimeResponseRepresentation:(' + 'request.action:' + params.body.request.action + '::' + 'request.serializedState:' + params.body.request.serializedState + '::' + (params.body.request.fields === undefined ? undefined : ('[' + params.body.request.fields.map(element => 'request.fields.field:' + element.field + '::' + (element.isVisible === undefined ? 'request.fields.isVisible' : 'request.fields.isVisible:' + element.isVisible) + '::' + (element.value === undefined ? 'request.fields.value' : 'request.fields.value:' + element.value)).join(',') + ']')) + '::' + (params.body.request.uiElementVisited === undefined ? 'request.uiElementVisited' : 'request.uiElementVisited:' + params.body.request.uiElementVisited) + '::' + (params.body.request.enableTrace === undefined ? 'request.enableTrace' : 'request.enableTrace:' + params.body.request.enableTrace) + '::' + stableJSONStringify(params.body.request.lcErrors) + '::' + (params.body.request.isBuilderDebug === undefined ? 'request.isBuilderDebug' : 'request.isBuilderDebug:' + params.body.request.isBuilderDebug) + ')';
149
149
  }
150
- function getResponseCacheKeys$2(storeKeyMap, luvio, resourceParams, response) {
151
- getTypeCacheKeys(storeKeyMap, luvio, response, () => keyBuilder$2(luvio, resourceParams));
150
+ function getResponseCacheKeys$3(storeKeyMap, luvio, resourceParams, response) {
151
+ getTypeCacheKeys(storeKeyMap, luvio, response, () => keyBuilder$3(luvio, resourceParams));
152
152
  }
153
- function createResourceRequest$2(config) {
153
+ function createResourceRequest$3(config) {
154
154
  const headers = {};
155
155
  return {
156
156
  baseUri: '/services/data/v69.0',
@@ -164,7 +164,7 @@ function createResourceRequest$2(config) {
164
164
  };
165
165
  }
166
166
 
167
- function validate$2(obj, path = 'FlowRuntimeNavigationFieldValue') {
167
+ function validate$3(obj, path = 'FlowRuntimeNavigationFieldValue') {
168
168
  const v_error = (() => {
169
169
  if (typeof obj !== 'object' || ArrayIsArray$1(obj) || obj === null) {
170
170
  return new TypeError('Expected "object" but received "' + typeof obj + '" (at "' + path + '")');
@@ -213,7 +213,7 @@ function validate$2(obj, path = 'FlowRuntimeNavigationFieldValue') {
213
213
  return v_error === undefined ? null : v_error;
214
214
  }
215
215
 
216
- function validate$1(obj, path = 'FlowRuntimeHashbagRepresentation') {
216
+ function validate$2(obj, path = 'FlowRuntimeHashbagRepresentation') {
217
217
  const v_error = (() => {
218
218
  if (typeof obj !== 'object' || ArrayIsArray$1(obj) || obj === null) {
219
219
  return new TypeError('Expected "object" but received "' + typeof obj + '" (at "' + path + '")');
@@ -231,7 +231,7 @@ function validate$1(obj, path = 'FlowRuntimeHashbagRepresentation') {
231
231
  return v_error === undefined ? null : v_error;
232
232
  }
233
233
 
234
- function validate(obj, path = 'FlowRuntimeNavigateFlowRepresentation') {
234
+ function validate$1(obj, path = 'FlowRuntimeNavigateFlowRepresentation') {
235
235
  const v_error = (() => {
236
236
  if (typeof obj !== 'object' || ArrayIsArray$1(obj) || obj === null) {
237
237
  return new TypeError('Expected "object" but received "' + typeof obj + '" (at "' + path + '")');
@@ -257,7 +257,7 @@ function validate(obj, path = 'FlowRuntimeNavigateFlowRepresentation') {
257
257
  for (let i = 0; i < obj_fields.length; i++) {
258
258
  const obj_fields_item = obj_fields[i];
259
259
  const path_fields_item = path_fields + '[' + i + ']';
260
- const referencepath_fields_itemValidationError = validate$2(obj_fields_item, path_fields_item);
260
+ const referencepath_fields_itemValidationError = validate$3(obj_fields_item, path_fields_item);
261
261
  if (referencepath_fields_itemValidationError !== null) {
262
262
  let message = 'Object doesn\'t match FlowRuntimeNavigationFieldValue (at "' + path_fields_item + '")\n';
263
263
  message += referencepath_fields_itemValidationError.message.split('\n').map((line) => '\t' + line).join('\n');
@@ -275,7 +275,7 @@ function validate(obj, path = 'FlowRuntimeNavigateFlowRepresentation') {
275
275
  if (obj.lcErrors !== undefined) {
276
276
  const obj_lcErrors = obj.lcErrors;
277
277
  const path_lcErrors = path + '.lcErrors';
278
- const referencepath_lcErrorsValidationError = validate$1(obj_lcErrors, path_lcErrors);
278
+ const referencepath_lcErrorsValidationError = validate$2(obj_lcErrors, path_lcErrors);
279
279
  if (referencepath_lcErrorsValidationError !== null) {
280
280
  let message = 'Object doesn\'t match FlowRuntimeHashbagRepresentation (at "' + path_lcErrors + '")\n';
281
281
  message += referencepath_lcErrorsValidationError.message.split('\n').map((line) => '\t' + line).join('\n');
@@ -298,21 +298,97 @@ function validate(obj, path = 'FlowRuntimeNavigateFlowRepresentation') {
298
298
  return v_error === undefined ? null : v_error;
299
299
  }
300
300
 
301
- const adapterName$2 = 'navigateFlow';
301
+ const adapterName$3 = 'navigateFlow';
302
302
  const navigateFlow_ConfigPropertyMetadata = [
303
303
  generateParamConfigMetadata('request', true, 2 /* Body */, 4 /* Unsupported */),
304
304
  ];
305
- const navigateFlow_ConfigPropertyNames = /*#__PURE__*/ buildAdapterValidationConfig(adapterName$2, navigateFlow_ConfigPropertyMetadata);
306
- const createResourceParams$2 = /*#__PURE__*/ createResourceParams$3(navigateFlow_ConfigPropertyMetadata);
307
- function typeCheckConfig$2(untrustedConfig) {
305
+ const navigateFlow_ConfigPropertyNames = /*#__PURE__*/ buildAdapterValidationConfig(adapterName$3, navigateFlow_ConfigPropertyMetadata);
306
+ const createResourceParams$3 = /*#__PURE__*/ createResourceParams$4(navigateFlow_ConfigPropertyMetadata);
307
+ function typeCheckConfig$3(untrustedConfig) {
308
308
  const config = {};
309
309
  const untrustedConfig_request = untrustedConfig.request;
310
- const referenceFlowRuntimeNavigateFlowRepresentationValidationError = validate(untrustedConfig_request);
310
+ const referenceFlowRuntimeNavigateFlowRepresentationValidationError = validate$1(untrustedConfig_request);
311
311
  if (referenceFlowRuntimeNavigateFlowRepresentationValidationError === null) {
312
312
  config.request = untrustedConfig_request;
313
313
  }
314
314
  return config;
315
315
  }
316
+ function validateAdapterConfig$3(untrustedConfig, configPropertyNames) {
317
+ if (!untrustedIsObject(untrustedConfig)) {
318
+ return null;
319
+ }
320
+ if (process.env.NODE_ENV !== 'production') {
321
+ validateConfig(untrustedConfig, configPropertyNames);
322
+ }
323
+ const config = typeCheckConfig$3(untrustedConfig);
324
+ if (!areRequiredParametersPresent(config, configPropertyNames)) {
325
+ return null;
326
+ }
327
+ return config;
328
+ }
329
+
330
+ function buildNetworkSnapshot$3(luvio, config, context) {
331
+ const resourceParams = createResourceParams$3(config);
332
+ const request = createResourceRequest$3(resourceParams);
333
+ return luvio
334
+ .dispatchResourceRequest(request, context)
335
+ .then((response) => {
336
+ return luvio.handleSuccessResponse(() => {
337
+ deepFreeze(response.body);
338
+ return Promise.resolve(response.body);
339
+ }, () => {
340
+ const cacheKeys = new StoreKeyMap();
341
+ getResponseCacheKeys$3(cacheKeys, luvio, resourceParams, response.body);
342
+ return cacheKeys;
343
+ });
344
+ }, (response) => {
345
+ return luvio.handleErrorResponse(() => {
346
+ // We want to throw these exceptions to be caught in the runtime layer
347
+ // eslint-disable-next-line @salesforce/lds/no-error-in-production
348
+ throw new Error(response.body.message || response.body.error || response.body);
349
+ });
350
+ });
351
+ }
352
+ const navigateFlowAdapterFactory = (luvio) => function flowRuntime__navigateFlow(untrustedConfig) {
353
+ const config = validateAdapterConfig$3(untrustedConfig, navigateFlow_ConfigPropertyNames);
354
+ // Invalid or incomplete config
355
+ if (config === null) {
356
+ return null;
357
+ }
358
+ return buildNetworkSnapshot$3(luvio, config);
359
+ };
360
+
361
+ function keyBuilder$2(luvio, params) {
362
+ return keyPrefix + '::FlowRuntimeResponseRepresentation:(' + 'pausedInterviewId:' + params.body.pausedInterviewId + ')';
363
+ }
364
+ function getResponseCacheKeys$2(storeKeyMap, luvio, resourceParams, response) {
365
+ getTypeCacheKeys(storeKeyMap, luvio, response, () => keyBuilder$2(luvio, resourceParams));
366
+ }
367
+ function createResourceRequest$2(config) {
368
+ const headers = {};
369
+ return {
370
+ baseUri: '/services/data/v69.0',
371
+ basePath: '/connect/interaction/runtime/resumeFlow',
372
+ method: 'post',
373
+ body: config.body,
374
+ urlParams: {},
375
+ queryParams: {},
376
+ headers,
377
+ priority: 'normal',
378
+ };
379
+ }
380
+
381
+ const adapterName$2 = 'resumeFlow';
382
+ const resumeFlow_ConfigPropertyMetadata = [
383
+ generateParamConfigMetadata('pausedInterviewId', true, 2 /* Body */, 0 /* String */),
384
+ ];
385
+ const resumeFlow_ConfigPropertyNames = /*#__PURE__*/ buildAdapterValidationConfig(adapterName$2, resumeFlow_ConfigPropertyMetadata);
386
+ const createResourceParams$2 = /*#__PURE__*/ createResourceParams$4(resumeFlow_ConfigPropertyMetadata);
387
+ function typeCheckConfig$2(untrustedConfig) {
388
+ const config = {};
389
+ typeCheckConfig$4(untrustedConfig, config, resumeFlow_ConfigPropertyMetadata);
390
+ return config;
391
+ }
316
392
  function validateAdapterConfig$2(untrustedConfig, configPropertyNames) {
317
393
  if (!untrustedIsObject(untrustedConfig)) {
318
394
  return null;
@@ -327,11 +403,11 @@ function validateAdapterConfig$2(untrustedConfig, configPropertyNames) {
327
403
  return config;
328
404
  }
329
405
 
330
- function buildNetworkSnapshot$2(luvio, config, context) {
406
+ function buildNetworkSnapshot$2(luvio, config, options) {
331
407
  const resourceParams = createResourceParams$2(config);
332
408
  const request = createResourceRequest$2(resourceParams);
333
409
  return luvio
334
- .dispatchResourceRequest(request, context)
410
+ .dispatchResourceRequest(request, options)
335
411
  .then((response) => {
336
412
  return luvio.handleSuccessResponse(() => {
337
413
  deepFreeze(response.body);
@@ -349,8 +425,8 @@ function buildNetworkSnapshot$2(luvio, config, context) {
349
425
  });
350
426
  });
351
427
  }
352
- const navigateFlowAdapterFactory = (luvio) => function flowRuntime__navigateFlow(untrustedConfig) {
353
- const config = validateAdapterConfig$2(untrustedConfig, navigateFlow_ConfigPropertyNames);
428
+ const resumeFlowAdapterFactory = (luvio) => function flowRuntime__resumeFlow(untrustedConfig) {
429
+ const config = validateAdapterConfig$2(untrustedConfig, resumeFlow_ConfigPropertyNames);
354
430
  // Invalid or incomplete config
355
431
  if (config === null) {
356
432
  return null;
@@ -359,7 +435,7 @@ const navigateFlowAdapterFactory = (luvio) => function flowRuntime__navigateFlow
359
435
  };
360
436
 
361
437
  function keyBuilder$1(luvio, params) {
362
- return keyPrefix + '::FlowRuntimeResponseRepresentation:(' + 'pausedInterviewId:' + params.body.pausedInterviewId + ')';
438
+ return keyPrefix + '::FlowRuntimeResponseRepresentation:(' + 'flowDevName:' + params.body.flowDevName + '::' + (params.body.flowVersionId === undefined ? 'flowVersionId' : 'flowVersionId:' + params.body.flowVersionId) + '::' + (params.body.arguments === undefined ? 'arguments' : 'arguments:' + params.body.arguments) + '::' + (params.body.enableTrace === undefined ? 'enableTrace' : 'enableTrace:' + params.body.enableTrace) + '::' + (params.body.enableRollbackMode === undefined ? 'enableRollbackMode' : 'enableRollbackMode:' + params.body.enableRollbackMode) + '::' + (params.body.useLatestSubflow === undefined ? 'useLatestSubflow' : 'useLatestSubflow:' + params.body.useLatestSubflow) + '::' + (params.body.debugAsUserId === undefined ? 'debugAsUserId' : 'debugAsUserId:' + params.body.debugAsUserId) + '::' + (params.body.isBuilderDebug === undefined ? 'isBuilderDebug' : 'isBuilderDebug:' + params.body.isBuilderDebug) + ')';
363
439
  }
364
440
  function getResponseCacheKeys$1(storeKeyMap, luvio, resourceParams, response) {
365
441
  getTypeCacheKeys(storeKeyMap, luvio, response, () => keyBuilder$1(luvio, resourceParams));
@@ -368,7 +444,7 @@ function createResourceRequest$1(config) {
368
444
  const headers = {};
369
445
  return {
370
446
  baseUri: '/services/data/v69.0',
371
- basePath: '/connect/interaction/runtime/resumeFlow',
447
+ basePath: '/connect/interaction/runtime/startFlow',
372
448
  method: 'post',
373
449
  body: config.body,
374
450
  urlParams: {},
@@ -378,15 +454,22 @@ function createResourceRequest$1(config) {
378
454
  };
379
455
  }
380
456
 
381
- const adapterName$1 = 'resumeFlow';
382
- const resumeFlow_ConfigPropertyMetadata = [
383
- generateParamConfigMetadata('pausedInterviewId', true, 2 /* Body */, 0 /* String */),
457
+ const adapterName$1 = 'startFlow';
458
+ const startFlow_ConfigPropertyMetadata = [
459
+ generateParamConfigMetadata('flowDevName', true, 2 /* Body */, 0 /* String */),
460
+ generateParamConfigMetadata('flowVersionId', false, 2 /* Body */, 0 /* String */),
461
+ generateParamConfigMetadata('arguments', false, 2 /* Body */, 0 /* String */),
462
+ generateParamConfigMetadata('enableTrace', false, 2 /* Body */, 1 /* Boolean */),
463
+ generateParamConfigMetadata('enableRollbackMode', false, 2 /* Body */, 1 /* Boolean */),
464
+ generateParamConfigMetadata('useLatestSubflow', false, 2 /* Body */, 1 /* Boolean */),
465
+ generateParamConfigMetadata('debugAsUserId', false, 2 /* Body */, 0 /* String */),
466
+ generateParamConfigMetadata('isBuilderDebug', false, 2 /* Body */, 1 /* Boolean */),
384
467
  ];
385
- const resumeFlow_ConfigPropertyNames = /*#__PURE__*/ buildAdapterValidationConfig(adapterName$1, resumeFlow_ConfigPropertyMetadata);
386
- const createResourceParams$1 = /*#__PURE__*/ createResourceParams$3(resumeFlow_ConfigPropertyMetadata);
468
+ const startFlow_ConfigPropertyNames = /*#__PURE__*/ buildAdapterValidationConfig(adapterName$1, startFlow_ConfigPropertyMetadata);
469
+ const createResourceParams$1 = /*#__PURE__*/ createResourceParams$4(startFlow_ConfigPropertyMetadata);
387
470
  function typeCheckConfig$1(untrustedConfig) {
388
471
  const config = {};
389
- typeCheckConfig$3(untrustedConfig, config, resumeFlow_ConfigPropertyMetadata);
472
+ typeCheckConfig$4(untrustedConfig, config, startFlow_ConfigPropertyMetadata);
390
473
  return config;
391
474
  }
392
475
  function validateAdapterConfig$1(untrustedConfig, configPropertyNames) {
@@ -425,8 +508,8 @@ function buildNetworkSnapshot$1(luvio, config, options) {
425
508
  });
426
509
  });
427
510
  }
428
- const resumeFlowAdapterFactory = (luvio) => function flowRuntime__resumeFlow(untrustedConfig) {
429
- const config = validateAdapterConfig$1(untrustedConfig, resumeFlow_ConfigPropertyNames);
511
+ const startFlowAdapterFactory = (luvio) => function flowRuntime__startFlow(untrustedConfig) {
512
+ const config = validateAdapterConfig$1(untrustedConfig, startFlow_ConfigPropertyNames);
430
513
  // Invalid or incomplete config
431
514
  if (config === null) {
432
515
  return null;
@@ -435,7 +518,7 @@ const resumeFlowAdapterFactory = (luvio) => function flowRuntime__resumeFlow(unt
435
518
  };
436
519
 
437
520
  function keyBuilder(luvio, params) {
438
- return keyPrefix + '::FlowRuntimeResponseRepresentation:(' + 'flowDevName:' + params.body.flowDevName + '::' + (params.body.flowVersionId === undefined ? 'flowVersionId' : 'flowVersionId:' + params.body.flowVersionId) + '::' + (params.body.arguments === undefined ? 'arguments' : 'arguments:' + params.body.arguments) + '::' + (params.body.enableTrace === undefined ? 'enableTrace' : 'enableTrace:' + params.body.enableTrace) + '::' + (params.body.enableRollbackMode === undefined ? 'enableRollbackMode' : 'enableRollbackMode:' + params.body.enableRollbackMode) + '::' + (params.body.useLatestSubflow === undefined ? 'useLatestSubflow' : 'useLatestSubflow:' + params.body.useLatestSubflow) + '::' + (params.body.debugAsUserId === undefined ? 'debugAsUserId' : 'debugAsUserId:' + params.body.debugAsUserId) + '::' + (params.body.isBuilderDebug === undefined ? 'isBuilderDebug' : 'isBuilderDebug:' + params.body.isBuilderDebug) + ')';
521
+ return keyPrefix + '::FlowRuntimeResponseRepresentation:(' + 'request.interviewGuid:' + params.body.request.interviewGuid + '::' + 'request.correlationId:' + params.body.request.correlationId + '::' + 'request.actionType:' + params.body.request.actionType + ')';
439
522
  }
440
523
  function getResponseCacheKeys(storeKeyMap, luvio, resourceParams, response) {
441
524
  getTypeCacheKeys(storeKeyMap, luvio, response, () => keyBuilder(luvio, resourceParams));
@@ -444,7 +527,7 @@ function createResourceRequest(config) {
444
527
  const headers = {};
445
528
  return {
446
529
  baseUri: '/services/data/v69.0',
447
- basePath: '/connect/interaction/runtime/startFlow',
530
+ basePath: '/connect/interaction/runtime/pollForAsyncAction',
448
531
  method: 'post',
449
532
  body: config.body,
450
533
  urlParams: {},
@@ -454,22 +537,43 @@ function createResourceRequest(config) {
454
537
  };
455
538
  }
456
539
 
457
- const adapterName = 'startFlow';
458
- const startFlow_ConfigPropertyMetadata = [
459
- generateParamConfigMetadata('flowDevName', true, 2 /* Body */, 0 /* String */),
460
- generateParamConfigMetadata('flowVersionId', false, 2 /* Body */, 0 /* String */),
461
- generateParamConfigMetadata('arguments', false, 2 /* Body */, 0 /* String */),
462
- generateParamConfigMetadata('enableTrace', false, 2 /* Body */, 1 /* Boolean */),
463
- generateParamConfigMetadata('enableRollbackMode', false, 2 /* Body */, 1 /* Boolean */),
464
- generateParamConfigMetadata('useLatestSubflow', false, 2 /* Body */, 1 /* Boolean */),
465
- generateParamConfigMetadata('debugAsUserId', false, 2 /* Body */, 0 /* String */),
466
- generateParamConfigMetadata('isBuilderDebug', false, 2 /* Body */, 1 /* Boolean */),
540
+ function validate(obj, path = 'FlowRuntimePollForAsyncActionRepresentation') {
541
+ const v_error = (() => {
542
+ if (typeof obj !== 'object' || ArrayIsArray$1(obj) || obj === null) {
543
+ return new TypeError('Expected "object" but received "' + typeof obj + '" (at "' + path + '")');
544
+ }
545
+ const obj_actionType = obj.actionType;
546
+ const path_actionType = path + '.actionType';
547
+ if (typeof obj_actionType !== 'string') {
548
+ return new TypeError('Expected "string" but received "' + typeof obj_actionType + '" (at "' + path_actionType + '")');
549
+ }
550
+ const obj_correlationId = obj.correlationId;
551
+ const path_correlationId = path + '.correlationId';
552
+ if (typeof obj_correlationId !== 'string') {
553
+ return new TypeError('Expected "string" but received "' + typeof obj_correlationId + '" (at "' + path_correlationId + '")');
554
+ }
555
+ const obj_interviewGuid = obj.interviewGuid;
556
+ const path_interviewGuid = path + '.interviewGuid';
557
+ if (typeof obj_interviewGuid !== 'string') {
558
+ return new TypeError('Expected "string" but received "' + typeof obj_interviewGuid + '" (at "' + path_interviewGuid + '")');
559
+ }
560
+ })();
561
+ return v_error === undefined ? null : v_error;
562
+ }
563
+
564
+ const adapterName = 'pollForAsyncAction';
565
+ const pollForAsyncAction_ConfigPropertyMetadata = [
566
+ generateParamConfigMetadata('request', true, 2 /* Body */, 4 /* Unsupported */),
467
567
  ];
468
- const startFlow_ConfigPropertyNames = /*#__PURE__*/ buildAdapterValidationConfig(adapterName, startFlow_ConfigPropertyMetadata);
469
- const createResourceParams = /*#__PURE__*/ createResourceParams$3(startFlow_ConfigPropertyMetadata);
568
+ const pollForAsyncAction_ConfigPropertyNames = /*#__PURE__*/ buildAdapterValidationConfig(adapterName, pollForAsyncAction_ConfigPropertyMetadata);
569
+ const createResourceParams = /*#__PURE__*/ createResourceParams$4(pollForAsyncAction_ConfigPropertyMetadata);
470
570
  function typeCheckConfig(untrustedConfig) {
471
571
  const config = {};
472
- typeCheckConfig$3(untrustedConfig, config, startFlow_ConfigPropertyMetadata);
572
+ const untrustedConfig_request = untrustedConfig.request;
573
+ const referenceFlowRuntimePollForAsyncActionRepresentationValidationError = validate(untrustedConfig_request);
574
+ if (referenceFlowRuntimePollForAsyncActionRepresentationValidationError === null) {
575
+ config.request = untrustedConfig_request;
576
+ }
473
577
  return config;
474
578
  }
475
579
  function validateAdapterConfig(untrustedConfig, configPropertyNames) {
@@ -486,11 +590,11 @@ function validateAdapterConfig(untrustedConfig, configPropertyNames) {
486
590
  return config;
487
591
  }
488
592
 
489
- function buildNetworkSnapshot(luvio, config, options) {
593
+ function buildNetworkSnapshot(luvio, config, context) {
490
594
  const resourceParams = createResourceParams(config);
491
595
  const request = createResourceRequest(resourceParams);
492
596
  return luvio
493
- .dispatchResourceRequest(request, options)
597
+ .dispatchResourceRequest(request, context)
494
598
  .then((response) => {
495
599
  return luvio.handleSuccessResponse(() => {
496
600
  deepFreeze(response.body);
@@ -508,8 +612,8 @@ function buildNetworkSnapshot(luvio, config, options) {
508
612
  });
509
613
  });
510
614
  }
511
- const startFlowAdapterFactory = (luvio) => function flowRuntime__startFlow(untrustedConfig) {
512
- const config = validateAdapterConfig(untrustedConfig, startFlow_ConfigPropertyNames);
615
+ const pollForAsyncActionAdapterFactory = (luvio) => function flowRuntime__pollForAsyncAction(untrustedConfig) {
616
+ const config = validateAdapterConfig(untrustedConfig, pollForAsyncAction_ConfigPropertyNames);
513
617
  // Invalid or incomplete config
514
618
  if (config === null) {
515
619
  return null;
@@ -520,16 +624,18 @@ const startFlowAdapterFactory = (luvio) => function flowRuntime__startFlow(untru
520
624
  let navigateFlow;
521
625
  let resumeFlow;
522
626
  let startFlow;
627
+ let pollForAsyncAction;
523
628
  function bindExportsTo(luvio) {
524
629
  return {
525
- navigateFlow: createLDSAdapter(luvio, adapterName$2, navigateFlowAdapterFactory),
526
- resumeFlow: createLDSAdapter(luvio, adapterName$1, resumeFlowAdapterFactory),
527
- startFlow: createLDSAdapter(luvio, adapterName, startFlowAdapterFactory),
630
+ navigateFlow: createLDSAdapter(luvio, adapterName$3, navigateFlowAdapterFactory),
631
+ resumeFlow: createLDSAdapter(luvio, adapterName$2, resumeFlowAdapterFactory),
632
+ startFlow: createLDSAdapter(luvio, adapterName$1, startFlowAdapterFactory),
633
+ pollForAsyncAction: createLDSAdapter(luvio, adapterName, pollForAsyncActionAdapterFactory),
528
634
  };
529
635
  }
530
636
  withDefaultLuvio((luvio) => {
531
- ({ navigateFlow, resumeFlow, startFlow } = bindExportsTo(luvio));
637
+ ({ navigateFlow, resumeFlow, startFlow, pollForAsyncAction } = bindExportsTo(luvio));
532
638
  });
533
639
 
534
- export { navigateFlow, resumeFlow, startFlow };
535
- // version: 1.464.0-b35c0e7723
640
+ export { navigateFlow, pollForAsyncAction, resumeFlow, startFlow };
641
+ // version: 1.466.0-ba624febc8
package/src/raml/api.raml CHANGED
@@ -114,6 +114,26 @@ types:
114
114
  type: string
115
115
  required: true
116
116
 
117
+ FlowRuntimePollForAsyncActionWrapperRepresentation:
118
+ type: object
119
+ properties:
120
+ request:
121
+ type: FlowRuntimePollForAsyncActionRepresentation
122
+ required: true
123
+
124
+ FlowRuntimePollForAsyncActionRepresentation:
125
+ type: object
126
+ properties:
127
+ interviewGuid:
128
+ type: string
129
+ required: true
130
+ correlationId:
131
+ type: string
132
+ required: true
133
+ actionType:
134
+ type: string
135
+ required: true
136
+
117
137
  FlowRuntimeNavigationResult:
118
138
  type: object
119
139
  properties:
@@ -166,3 +186,16 @@ types:
166
186
  body:
167
187
  application/json:
168
188
  type: FlowRuntimeResumeFlowRepresentation
189
+
190
+ /connect/interaction/runtime/pollForAsyncAction:
191
+ post:
192
+ responses:
193
+ '200':
194
+ description: Success
195
+ body:
196
+ application/json:
197
+ type: FlowRuntimeResponseRepresentation
198
+ body:
199
+ application/json:
200
+ type: FlowRuntimePollForAsyncActionWrapperRepresentation
201
+ (oas-body-name): request
@@ -28,3 +28,9 @@ types:
28
28
  (luvio.adapter):
29
29
  name: resumeFlow
30
30
  (luvio.method): get
31
+
32
+ /connect/interaction/runtime/pollForAsyncAction:
33
+ post:
34
+ (luvio.adapter):
35
+ name: pollForAsyncAction
36
+ (luvio.method): get