@regulaforensics/idv-capture-web 0.1.217-nightly → 0.1.248-nightly

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.d.ts CHANGED
@@ -1,3 +1,43 @@
1
+ import { CSSResult } from 'lit';
2
+ import { LitElement } from 'lit';
3
+ import { TemplateResult } from 'lit-html';
4
+
5
+ export declare type ApiKeyConnectionConfig = {
6
+ baseUrl: string;
7
+ apiKey: string;
8
+ ttl?: number;
9
+ };
10
+
11
+ declare type AuthTokenStoreData = {
12
+ apiKey: string;
13
+ authToken: string;
14
+ tokenExpiresAt: number;
15
+ };
16
+
17
+ declare class BaseConfigureError extends BaseError {
18
+ private static readonly MODULE;
19
+ private static readonly ERROR_ENUM_NAME;
20
+ private static readonly SHORT_CODE;
21
+ constructor({ errorCode, message, underlyingError, underlyingBaseError, }: {
22
+ errorCode: ConfigureError;
23
+ message?: string;
24
+ underlyingError?: string;
25
+ underlyingBaseError?: BaseError;
26
+ });
27
+ }
28
+
29
+ declare class BaseConnectionError extends BaseError {
30
+ private static readonly MODULE;
31
+ private static readonly ERROR_ENUM_NAME;
32
+ private static readonly SHORT_CODE;
33
+ constructor({ errorCode, message, underlyingError, underlyingBaseError, }: {
34
+ errorCode: ConnectionError;
35
+ message?: string;
36
+ underlyingError?: string;
37
+ underlyingBaseError?: BaseError;
38
+ });
39
+ }
40
+
1
41
  declare class BaseDeinitializationError extends BaseError {
2
42
  private static readonly MODULE;
3
43
  private static readonly ERROR_ENUM_NAME;
@@ -10,7 +50,7 @@ declare class BaseDeinitializationError extends BaseError {
10
50
  });
11
51
  }
12
52
 
13
- declare class BaseError {
53
+ export declare class BaseError {
14
54
  errorCode: number | string;
15
55
  errorCodeKey: string;
16
56
  message?: string;
@@ -50,6 +90,11 @@ declare class BaseInitializationError extends BaseError {
50
90
  });
51
91
  }
52
92
 
93
+ export declare abstract class BaseModule<TModuleProps = unknown, TModulesConfig = unknown> extends HTMLElement {
94
+ abstract props: IdvModuleProps<TModuleProps, TModulesConfig> | null;
95
+ abstract setProps(config: IdvModuleProps<TModuleProps, TModulesConfig>): void;
96
+ }
97
+
53
98
  declare class BasePrepareWorkflowError extends BaseError {
54
99
  private static readonly MODULE;
55
100
  private static readonly ERROR_ENUM_NAME;
@@ -62,24 +107,24 @@ declare class BasePrepareWorkflowError extends BaseError {
62
107
  });
63
108
  }
64
109
 
65
- declare class BaseScenarioError extends BaseError {
110
+ declare class BaseTokenInitializationError extends BaseError {
66
111
  private static readonly MODULE;
67
112
  private static readonly ERROR_ENUM_NAME;
68
113
  private static readonly SHORT_CODE;
69
114
  constructor({ errorCode, message, underlyingError, underlyingBaseError, }: {
70
- errorCode: ScenarioError;
115
+ errorCode: TokenInitializeError;
71
116
  message?: string;
72
117
  underlyingError?: string;
73
118
  underlyingBaseError?: BaseError;
74
119
  });
75
120
  }
76
121
 
77
- declare class BaseTokenInitializationError extends BaseError {
122
+ declare class BaseWorkflowError extends BaseError {
78
123
  private static readonly MODULE;
79
124
  private static readonly ERROR_ENUM_NAME;
80
125
  private static readonly SHORT_CODE;
81
126
  constructor({ errorCode, message, underlyingError, underlyingBaseError, }: {
82
- errorCode: TokenInitializeError;
127
+ errorCode: WorkflowError;
83
128
  message?: string;
84
129
  underlyingError?: string;
85
130
  underlyingBaseError?: BaseError;
@@ -87,31 +132,34 @@ declare class BaseTokenInitializationError extends BaseError {
87
132
  }
88
133
 
89
134
  export declare type ConfigureCompletion = {
90
- error?: BaseInitializationError;
135
+ error?: BaseConfigureError;
91
136
  };
92
137
 
93
- export declare type ConnectionByApiKeyConfig = {
138
+ declare enum ConfigureError {
139
+ CONNECTION_ISSUE = 0,
140
+ CONFIG_MISSED_OR_INVALID = 1,
141
+ INITIALIZATION_REQUIRED = 2,
142
+ SCENARIO_IN_PROGRESS = 3
143
+ }
144
+
145
+ declare type ConnectionByApiKeyConfigCore = {
94
146
  host: string;
95
- apiKey: string;
96
147
  isSecure?: boolean;
97
148
  port?: number;
98
- deviceDescriptor?: Record<string, unknown>;
99
- httpRetryCount?: number;
100
- httpTimeoutMs?: number;
149
+ apiKey: string;
150
+ authToken?: string;
151
+ tokenExpiresAt?: number;
152
+ deviceDescriptor: {
153
+ ttl: number;
154
+ };
101
155
  };
102
156
 
103
- export declare type ConnectionConfig = {
157
+ declare type ConnectionConfigCore = {
104
158
  host: string;
105
- httpRetryCount?: number;
106
- httpTimeoutMs?: number;
107
159
  isSecure?: boolean;
108
160
  password: string;
109
161
  port?: number;
110
- schema?: string;
111
162
  userName: string;
112
- deviceDescriptor?: {
113
- ttl?: number;
114
- } & Record<string, unknown>;
115
163
  };
116
164
 
117
165
  export declare enum ConnectionError {
@@ -119,6 +167,25 @@ export declare enum ConnectionError {
119
167
  PROVIDER_ERROR = 1
120
168
  }
121
169
 
170
+ declare type ContinueSessionResults = SessionData | WorkflowResult | {
171
+ error?: BaseWorkflowError;
172
+ };
173
+
174
+ export declare type CredentialConnectionConfig = {
175
+ baseUrl: string;
176
+ password: string;
177
+ userName: string;
178
+ };
179
+
180
+ declare type CurrentScreenConfig = {
181
+ templateId: string;
182
+ templateLayout?: Record<string, unknown>;
183
+ dataSource: Record<string, unknown> | null;
184
+ properties?: SessionPropertiesItem[];
185
+ sessionId?: string;
186
+ serviceToken?: string;
187
+ } & Record<string, any>;
188
+
122
189
  export declare enum DeinitializationError {
123
190
  INITIALIZATION_REQUIRED = 0,
124
191
  SCENARIO_IN_PROGRESS = 3
@@ -128,6 +195,72 @@ export declare type DeinitializeCompletion = {
128
195
  error?: BaseDeinitializationError;
129
196
  };
130
197
 
198
+ declare type FetchErrorResult = {
199
+ code: FetchResultCode.HTTP_ISSUE | FetchResultCode.PROVIDER_ERROR | FetchResultCode.DECODING_FAILED;
200
+ data: FetchState;
201
+ };
202
+
203
+ declare enum FetchResultCode {
204
+ SUCCESS = 0,
205
+ HTTP_ISSUE = 4,
206
+ PROVIDER_ERROR = 5,
207
+ DECODING_FAILED = 6
208
+ }
209
+
210
+ declare type FetchState = {
211
+ httpCode: number;
212
+ method: string;
213
+ url: string;
214
+ what?: string;
215
+ };
216
+
217
+ declare type IdvBusinessLogicControllerProps = {
218
+ connectByUserPass: (config: ConnectionConfigCore) => Promise<{
219
+ error?: BaseConnectionError;
220
+ }>;
221
+ connectByApiKey: (config: ConnectionByApiKeyConfigCore) => Promise<{
222
+ error?: BaseTokenInitializationError;
223
+ workflows?: string[];
224
+ authToken?: string;
225
+ }>;
226
+ connectByUrl: (urlWithToken: string) => Promise<{
227
+ error?: BaseTokenInitializationError;
228
+ workflows: string[];
229
+ }>;
230
+ workflowSessionCompletion: (data: WorkflowCompletion) => void;
231
+ setWorkflowSessionCompletion: (fn: (data: WorkflowCompletion) => void) => void;
232
+ loadModules: (modulesFromProps: any[]) => Promise<{
233
+ error?: BaseInitializationError;
234
+ }>;
235
+ setProcessingTemplate: (workflowSteps: any[]) => void;
236
+ isProcessing: boolean;
237
+ setIsProcessing: (isProcessing: boolean) => void;
238
+ _pushStep: (stepId: string, data: Record<string, any>) => Promise<{
239
+ error?: BaseWorkflowError;
240
+ }>;
241
+ _waitingForNextStep: () => Promise<{
242
+ sessionData: SessionData;
243
+ error?: undefined;
244
+ } | {
245
+ error: BaseWorkflowError;
246
+ sessionData?: undefined;
247
+ }>;
248
+ _findStepById: (stepId: string) => WorkflowStep | null;
249
+ pushStepWaitNextStepAndSet: (data: Record<string, any>) => void;
250
+ setNextStep: (workflow: Workflow, properties: SessionPropertiesItem[], nextStepId: string) => void;
251
+ onChangeScreen: (stepId: string | null) => void;
252
+ deinitializationIdv: () => Promise<{
253
+ error?: any;
254
+ }>;
255
+ fetchService: IdvFetchService | null;
256
+ setAndInitFetchService: () => Promise<void>;
257
+ isFinalWaitingUi: boolean;
258
+ setFinalWaitingUi: (isWaitingUi: boolean) => void;
259
+ setFinalStepAndStopProcess: (stepId?: string) => void;
260
+ resetSession: () => void;
261
+ resetFetchService: () => void;
262
+ };
263
+
131
264
  export declare type IdvEventTypes = (typeof IdvEventTypesEnum)[keyof typeof IdvEventTypesEnum];
132
265
 
133
266
  export declare const IdvEventTypesEnum: {
@@ -135,12 +268,148 @@ export declare const IdvEventTypesEnum: {
135
268
  readonly ERROR: "ERROR";
136
269
  };
137
270
 
271
+ declare class IdvFetchService {
272
+ private _connectionTokenExpirationBufferMs;
273
+ private _origin;
274
+ private _locale;
275
+ private _workflowId;
276
+ private _session;
277
+ private _apiKeyAuthToken;
278
+ private _connectionToken;
279
+ private _connect;
280
+ private _getErrorTextFromError;
281
+ private _setApiKeyAuthToken;
282
+ private _setConnectionToken;
283
+ private _getOriginFromConfig;
284
+ private _getOriginFromUrl;
285
+ private _getExpiresAtFromTtl;
286
+ private _getAuthorizationHeaderFromConnectionToken;
287
+ private _getAuthorizationHeaderFromBasicToken;
288
+ private _getAuthorizationHeaderFromAuthToken;
289
+ private _getApiKeyAuthTokenFromLs;
290
+ private _getApiKeyAuthTokenFromHeader;
291
+ _getValidApiKeyAuthToken(config: {
292
+ apiKey: string;
293
+ deviceDescriptor: {
294
+ ttl: number;
295
+ };
296
+ }, isFromSession: boolean): Promise<{
297
+ code: FetchResultCode.SUCCESS;
298
+ data: {
299
+ token: string;
300
+ expiresAt: number;
301
+ };
302
+ } | FetchErrorResult>;
303
+ private _getAuthorizationSearchParam;
304
+ private _getResponseTextFromBadResponse;
305
+ private _fetchPing;
306
+ private _fetchMe;
307
+ private _fetchConnection;
308
+ private _fetchEphemeral;
309
+ private _fetchSessionByWorkflowId;
310
+ private _fetchSessionState;
311
+ private _fetchWorkflows;
312
+ private _fetchWorkflow;
313
+ private _fetchStep;
314
+ private _fetchSessionLogs;
315
+ connectByUserPass(config: ConnectionConfigCore): Promise<{
316
+ code: FetchResultCode.SUCCESS;
317
+ data: {
318
+ workflows: string[];
319
+ };
320
+ } | FetchErrorResult>;
321
+ connectByApiKey(config: ConnectionByApiKeyConfigCore, isFromSession: boolean): Promise<{
322
+ code: FetchResultCode.SUCCESS;
323
+ data: {
324
+ authToken: string;
325
+ workflows: string[];
326
+ };
327
+ } | FetchErrorResult>;
328
+ connectByUrl(urlWithToken: string): Promise<{
329
+ code: FetchResultCode.SUCCESS;
330
+ data: {
331
+ workflows: string[];
332
+ };
333
+ } | FetchErrorResult>;
334
+ getConnectionToken(isFromSession: boolean): Promise<string>;
335
+ startSession(id: string, locale: string, metadata?: Record<string, unknown>): Promise<{
336
+ code: FetchResultCode.SUCCESS;
337
+ data: SessionData;
338
+ } | FetchErrorResult>;
339
+ continueSession(sessionId: string, locale: string): Promise<{
340
+ code: FetchResultCode.SUCCESS;
341
+ data: SessionData;
342
+ } | FetchErrorResult>;
343
+ listWorkflows(params?: {
344
+ limit: number;
345
+ skip: number;
346
+ }): Promise<{
347
+ code: FetchResultCode.SUCCESS;
348
+ data: {
349
+ count: number;
350
+ items: Workflow[];
351
+ };
352
+ } | FetchErrorResult>;
353
+ getWorkflow(workflowId: string): Promise<{
354
+ code: FetchResultCode.SUCCESS;
355
+ data: Workflow;
356
+ } | FetchErrorResult>;
357
+ pushData(stepId: string, data: any): Promise<{
358
+ code: FetchResultCode.SUCCESS;
359
+ data: SessionData;
360
+ } | FetchErrorResult>;
361
+ getSessionState(): Promise<{
362
+ code: FetchResultCode.SUCCESS;
363
+ data: SessionData;
364
+ } | FetchErrorResult>;
365
+ pushSessionLogs(pushSessionLogsParams: PushSessionLogsParams): Promise<Record<string, unknown>>;
366
+ }
367
+
368
+ declare type IdvIntegrationControllerProps = {
369
+ _isInitialized: boolean;
370
+ _isConnectedToPlatform: boolean;
371
+ _initializationInProgress: boolean;
372
+ _sessionIdFromUrl: null | string;
373
+ _ttl: number;
374
+ _continueSession: (locale: string, forceSessionId: string | null) => Promise<ContinueSessionResults>;
375
+ _checkIsSessionDataValid: (sessionData: SessionData | {
376
+ httpCode: number;
377
+ method: string;
378
+ url: string;
379
+ what?: string;
380
+ }) => SessionData | {
381
+ error?: BaseWorkflowError;
382
+ };
383
+ _checkAndSetApiTokenToLs: (sessionId: string) => void;
384
+ _runSocketConnection: (token: string) => Promise<{
385
+ error?: BaseWorkflowError;
386
+ }>;
387
+ _prepareDataForWorkflow: (sessionData: SessionData) => void;
388
+ initialize: (config: InitConfig) => Promise<{
389
+ error?: BaseInitializationError;
390
+ }>;
391
+ configureByUserPass: (config: CredentialConnectionConfig) => Promise<object | {
392
+ error?: BaseConfigureError;
393
+ }>;
394
+ configureWithUrl: (urlWithToken: string) => Promise<object | {
395
+ error?: BaseConfigureError;
396
+ }>;
397
+ configureByApiKey: (config: ApiKeyConnectionConfig) => Promise<object | {
398
+ error?: BaseConfigureError;
399
+ }>;
400
+ getWorkflows: (params?: WorkflowListRequest) => Promise<WorkflowListCompletion>;
401
+ prepareWorkflowAndPrepareUi: (workflowId: string) => Promise<PrepareWorkflowCompletion>;
402
+ startNewSession: (completion: (data: WorkflowCompletion) => void, locale: string, metadata?: Record<string, unknown>) => Promise<WorkflowCompletion>;
403
+ playWorkflow: () => void;
404
+ deinitialize: () => Promise<DeinitializeCompletion>;
405
+ };
406
+
138
407
  export declare class IdvIntegrationService {
139
408
  /** main commands */
140
409
  initialize(config: InitConfig): Promise<{
141
410
  error?: BaseInitializationError;
142
411
  }>;
143
- configure(config: ConnectionConfig | UrlConnectionConfig | ConnectionByApiKeyConfig): Promise<ConfigureCompletion | UrlConfigureCompletion>;
412
+ configure(config: CredentialConnectionConfig | TokenConnectionConfig | ApiKeyConnectionConfig): Promise<ConfigureCompletion | TokenConfigureCompletion>;
144
413
  getWorkFlows(params?: WorkflowListRequest): Promise<WorkflowListCompletion>;
145
414
  prepareWorkflow({ workflowId }: {
146
415
  workflowId: string;
@@ -160,12 +429,22 @@ export declare type IdvMessageEvent = {
160
429
  message?: IdvServiceMessages;
161
430
  };
162
431
 
163
- export declare const IdvModules: {
164
- readonly LIVENESS: "LIVENESS";
165
- readonly DOC_READER: "DOC_READER";
432
+ export declare type IdvModuleProps<TModuleProps, TModulesConfig> = {
433
+ isProcessing?: (isProcessing: boolean) => void;
434
+ moduleProps: TModuleProps;
435
+ modulesConfig?: TModulesConfig;
436
+ perform: (data: any) => void;
437
+ idvEventListener: (module: string, data: any) => void;
166
438
  };
167
439
 
168
- export declare type IdvModulesType = (typeof IdvModules)[keyof typeof IdvModules];
440
+ export declare interface IdvModuleStaticMethods {
441
+ displayName: string;
442
+ isReady(): boolean;
443
+ getSupportedTemplates(): string[];
444
+ initialize(modulesConfig: Record<string, unknown>): void;
445
+ deinitialize(): void;
446
+ getIdentifier(): string;
447
+ }
169
448
 
170
449
  export declare enum IdvServiceMessages {
171
450
  DID_START_SESSION = "DID_START_SESSION",
@@ -174,15 +453,70 @@ export declare enum IdvServiceMessages {
174
453
  DID_CONTINUE_REMOTE_SESSION = "DID_CONTINUE_REMOTE_SESSION"
175
454
  }
176
455
 
177
- export declare class IdvWebComponent extends HTMLElement {
178
- private _root;
179
- private _mounted;
456
+ declare type IdvStoreProps = {
457
+ sessionRestoreMode: boolean;
458
+ setSessionRestoreMode: (isEnabled: boolean) => void;
459
+ currentSessionData: {
460
+ sessionId: string;
461
+ workflowId: string;
462
+ } | null;
463
+ setCurrentSessionDataLsAndStore: (data: {
464
+ sessionId: string;
465
+ workflowId: string;
466
+ }) => void;
467
+ removeCurrentSessionDataLsAndStore: () => void;
468
+ getCurrentSessionDataLs: () => {
469
+ sessionId: string;
470
+ workflowId: string;
471
+ apiKey?: string;
472
+ } | null;
473
+ getCurrentSessionId: () => string | null;
474
+ modulesConfig: Record<string, any>;
475
+ layout: Record<string, any> | null;
476
+ sessionProperties: SessionPropertiesItem[];
477
+ setSessionProperties: (properties: SessionPropertiesItem[]) => void;
478
+ setLayout: (layout: Record<string, any>) => void;
479
+ workflow: Workflow | null;
480
+ setWorkflow: (workflow: Workflow) => void;
481
+ currentStepId: string | null;
482
+ setCurrentStepId: (stepId: string) => void;
483
+ listener: (message: IdvMessageEvent) => void | null;
484
+ setListener: (callback: (message: IdvMessageEvent) => void) => void;
485
+ workflowId: string | null;
486
+ setWorkflowId: (id: string) => void;
487
+ nonce?: string;
488
+ setNonce: (id: string) => void;
489
+ getNonce: () => string | undefined;
490
+ currentScreenConfig: CurrentScreenConfig | null;
491
+ externalModules: LoadedModule[] | [];
492
+ processingTransformedTemplate: WorkflowStepClientGui | null;
493
+ serviceToken?: string;
494
+ apiKeyAuthTokenCollection: AuthTokenStoreData | Record<string, unknown>;
495
+ setApiKeyAuthTokenCollection: (apiKey: string, authToken: string, tokenExpiresAt: number) => void;
496
+ setServiceSessionToken: (token: string) => void;
497
+ resetProps: () => void;
498
+ startConfig: StartConfig;
499
+ setStartConfig: (startConfig: StartConfig) => void;
500
+ };
501
+
502
+ export declare class IdvWebComponent extends LitElement {
503
+ static styles: CSSResult[];
504
+ private orientation;
505
+ store: IdvStoreProps & IdvIntegrationControllerProps & IdvBusinessLogicControllerProps;
506
+ currentScreenConfig: CurrentScreenConfig | null;
507
+ processingScreenFromWorkflow: WorkflowStepClientGui | null;
508
+ isProcessing: boolean;
509
+ loadedModules: [] | LoadedModule[];
510
+ modulesConfig: Record<string, any>;
180
511
  constructor();
181
- static get observedAttributes(): Array<string>;
182
- connectedCallback(): void;
512
+ _listenerFromModule: (module: string, data: any) => void;
513
+ _isProcessingCallback: (isProcessing: boolean) => void;
514
+ _performFromModule: (data: any) => void;
515
+ _processingScreen(): HTMLElement | TemplateResult<1>;
516
+ _currentScreen(): HTMLElement | null;
183
517
  get version(): string;
184
- private render;
185
518
  disconnectedCallback(): void;
519
+ render(): TemplateResult<1> | null;
186
520
  }
187
521
 
188
522
  export declare type InitConfig = {
@@ -205,6 +539,14 @@ export declare enum InitializeError {
205
539
  INITIALIZATION_IN_PROGRESS = 2
206
540
  }
207
541
 
542
+ declare type LoadedModule = {
543
+ id: string;
544
+ supportedTemplates: string[];
545
+ component: any;
546
+ };
547
+
548
+ export declare type ModuleClass<TModuleProps = unknown, TModulesConfig = unknown> = IdvModuleStaticMethods & (new (...args: any[]) => BaseModule<TModuleProps, TModulesConfig>);
549
+
208
550
  export declare type PrepareWorkflowCompletion = {
209
551
  workflow?: Workflow;
210
552
  error?: BasePrepareWorkflowError;
@@ -218,24 +560,23 @@ export declare enum PrepareWorkflowError {
218
560
  SCENARIO_IN_PROGRESS = 4
219
561
  }
220
562
 
221
- export declare enum ScenarioError {
222
- INITIALIZATION_REQUIRED = 0,
223
- PREPARED_REQUIRED = 1,
224
- START_SESSION_FAILED = 2,
225
- UNKNOWN_STEP = 3,
226
- MODULES_ISSUE = 4,
227
- ALREADY_STARTED = 5,
228
- INTERNAL_ISSUE = 6
229
- }
230
-
231
- declare type ScenarioResults = {
232
- sessionId?: string;
233
- finalStep?: {
234
- id: string;
235
- name: string;
236
- final: boolean;
563
+ declare type PushSessionLogsParams = {
564
+ body: {
565
+ log: string;
566
+ errorCode?: string;
567
+ deviceInfo?: Record<string, string>;
237
568
  };
238
- } & Record<string, any>;
569
+ };
570
+
571
+ export declare function registerModule<TModuleProps = unknown, TModulesConfig = unknown>(name: string, ModuleClass: ModuleClass<TModuleProps, TModulesConfig>): void;
572
+
573
+ declare type SessionData = {
574
+ id: string;
575
+ currentStep: string;
576
+ workflow: Workflow;
577
+ properties: SessionPropertiesItem[];
578
+ isProcessingFiles: boolean;
579
+ };
239
580
 
240
581
  export declare enum SessionError {
241
582
  HTTP_ISSUE = 0,
@@ -246,6 +587,31 @@ export declare enum SessionError {
246
587
  NOT_DATA_TYPE = 5
247
588
  }
248
589
 
590
+ /** sync with gui module */
591
+ declare type SessionPropertiesItem = {
592
+ id: string;
593
+ createdAt: string;
594
+ updatedAt: string;
595
+ createdBy: unknown;
596
+ updatedBy: unknown;
597
+ action: unknown;
598
+ step: string;
599
+ name: string;
600
+ path: unknown;
601
+ string: string;
602
+ array?: string[];
603
+ integer: unknown;
604
+ decimal: unknown;
605
+ object: unknown;
606
+ };
607
+
608
+ declare type StartConfig = {
609
+ host?: string;
610
+ isSecure?: boolean;
611
+ apiKey?: string;
612
+ port?: number;
613
+ };
614
+
249
615
  export declare enum StartSessionError {
250
616
  HTTP_ISSUE = 0,
251
617
  PROVIDER_ERROR = 1,
@@ -259,20 +625,20 @@ export declare type StartWorkflowConfig = {
259
625
  locale?: string;
260
626
  };
261
627
 
262
- declare enum TokenInitializeError {
263
- CONNECTION_ISSUE = 0,
264
- WORKFLOW_ISSUE = 1
265
- }
266
-
267
- export declare type UrlConfigureCompletion = {
628
+ export declare type TokenConfigureCompletion = {
268
629
  workflows: string[];
269
630
  error?: BaseTokenInitializationError;
270
631
  };
271
632
 
272
- export declare type UrlConnectionConfig = {
633
+ export declare type TokenConnectionConfig = {
273
634
  url: string;
274
635
  };
275
636
 
637
+ declare enum TokenInitializeError {
638
+ CONNECTION_ISSUE = 0,
639
+ WORKFLOW_ISSUE = 1
640
+ }
641
+
276
642
  declare type Workflow = {
277
643
  id: string;
278
644
  steps: Array<WorkflowStep>;
@@ -283,14 +649,18 @@ declare type Workflow = {
283
649
  } & Record<string, any>;
284
650
 
285
651
  export declare type WorkflowCompletion = {
286
- results?: ScenarioResults;
287
- error?: BaseScenarioError;
652
+ results?: WorkflowResult;
653
+ error?: BaseWorkflowError;
288
654
  };
289
655
 
290
656
  export declare enum WorkflowError {
291
- HTTP_ISSUE = 0,
292
- PROVIDER_ERROR = 1,
293
- DECODING_FAILED = 2
657
+ INITIALIZATION_REQUIRED = 0,
658
+ PREPARED_REQUIRED = 1,
659
+ START_SESSION_FAILED = 2,
660
+ UNKNOWN_STEP = 3,
661
+ MODULES_ISSUE = 4,
662
+ ALREADY_STARTED = 5,
663
+ INTERNAL_ISSUE = 6
294
664
  }
295
665
 
296
666
  export declare type WorkflowListCompletion = {
@@ -303,6 +673,21 @@ export declare type WorkflowListRequest = {
303
673
  skip: number;
304
674
  };
305
675
 
676
+ export declare enum WorkflowPlatformError {
677
+ HTTP_ISSUE = 0,
678
+ PROVIDER_ERROR = 1,
679
+ DECODING_FAILED = 2
680
+ }
681
+
682
+ declare type WorkflowResult = {
683
+ sessionId?: string;
684
+ finalStep?: {
685
+ id: string;
686
+ name: string;
687
+ final: boolean;
688
+ };
689
+ } & Record<string, any>;
690
+
306
691
  declare type WorkflowStep = {
307
692
  id: string;
308
693
  name: string;