@regulaforensics/idv-capture-web 3.6.420-nightly → 3.6.422-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/README.md +19 -0
- package/dist/index.d.ts +49 -2
- package/dist/main.iife.js +30 -32
- package/dist/main.js +17671 -16565
- package/package.json +4 -4
package/README.md
CHANGED
|
@@ -197,6 +197,24 @@ if (startWorkflowResult.error) {
|
|
|
197
197
|
console.log('WORKFLOW FINISHED:', startWorkflowResult);
|
|
198
198
|
```
|
|
199
199
|
|
|
200
|
+
### Start Login
|
|
201
|
+
|
|
202
|
+
```javascript
|
|
203
|
+
const startLoginResult = await service.startLogin({
|
|
204
|
+
applicationId: 'your_application_id',
|
|
205
|
+
baseUrl: 'https://your.host.com',
|
|
206
|
+
metadata: { anyMetadata: 'Any Metadata' },
|
|
207
|
+
locale: 'en-us',
|
|
208
|
+
});
|
|
209
|
+
|
|
210
|
+
// Error handling
|
|
211
|
+
if (typeof startLoginResult !== 'string') {
|
|
212
|
+
console.error(startLoginResult);
|
|
213
|
+
} else {
|
|
214
|
+
console.log('IAM AUTH CODE:', startLoginResult);
|
|
215
|
+
}
|
|
216
|
+
```
|
|
217
|
+
|
|
200
218
|
## Events
|
|
201
219
|
|
|
202
220
|
You can subscribe to service events such as status updates, errors, and workflow progress by assigning a listener:
|
|
@@ -248,6 +266,7 @@ console.log(service.version);
|
|
|
248
266
|
| `getWorkFlows(params?)` | Returns a list of available workflows. | `async getWorkFlows(params?: WorkflowListRequest): Promise<WorkflowListCompletion>` | Useful for dynamically displaying workflows to users. |
|
|
249
267
|
| `prepareWorkflow({ workflowId })` | Prepares the service for the given workflow. Checks module and step compatibility. | `async prepareWorkflow({ workflowId }: { workflowId: string }): Promise<PrepareWorkflowCompletion>` | Must be called after configure. Validates workflow and modules. |
|
|
250
268
|
| `startWorkflow(config?)` | Starts the workflow. Show the web component before running and remove it after completion. | `async startWorkflow(config?: StartWorkflowConfig): Promise<WorkflowCompletion>` | Display the component before calling. Pass locale/metadata if needed. |
|
|
269
|
+
| `startLogin(config)` | Runs the IAM login flow: IAM auth start, configure, prepare, and start workflow. Returns the IAM auth code on success. | `async startLogin(config: LoginConfig): Promise<StartLoginCompletion>` | Requires `initialize` first. Display the component before calling. |
|
|
251
270
|
| `deinitialize()` | Deinitializes the service. Run `initialize` again to restart. Recommended after completing work. | `async deinitialize(): Promise<DeinitializeCompletion>` | Clean up resources after finishing a workflow. Use `initialize` to start again. |
|
|
252
271
|
|
|
253
272
|
## Examples
|
package/dist/index.d.ts
CHANGED
|
@@ -91,6 +91,18 @@ declare class BaseInitializationError extends BaseError {
|
|
|
91
91
|
});
|
|
92
92
|
}
|
|
93
93
|
|
|
94
|
+
export declare class BaseLoginError extends BaseError {
|
|
95
|
+
private static readonly MODULE;
|
|
96
|
+
private static readonly ERROR_ENUM_NAME;
|
|
97
|
+
private static readonly SHORT_CODE;
|
|
98
|
+
constructor({ errorCode, message, underlyingError, underlyingBaseError, }: {
|
|
99
|
+
errorCode: LoginError;
|
|
100
|
+
message?: string;
|
|
101
|
+
underlyingError?: string;
|
|
102
|
+
underlyingBaseError?: BaseError;
|
|
103
|
+
});
|
|
104
|
+
}
|
|
105
|
+
|
|
94
106
|
export declare abstract class BaseModule<TModuleProps = unknown, TModulesConfig = unknown> extends HTMLElement {
|
|
95
107
|
abstract props: IdvModuleProps<TModuleProps, TModulesConfig> | null;
|
|
96
108
|
abstract setProps(config: IdvModuleProps<TModuleProps, TModulesConfig>): void;
|
|
@@ -318,7 +330,8 @@ declare type IdvBusinessLogicControllerProps = {
|
|
|
318
330
|
setAndInitFetchService: () => Promise<void>;
|
|
319
331
|
isFinalWaitingUi: boolean;
|
|
320
332
|
setFinalWaitingUi: (isWaitingUi: boolean) => void;
|
|
321
|
-
|
|
333
|
+
_setFinalStepAndStopProcess: (stepId?: string) => void;
|
|
334
|
+
_setIamAuthCodeAndStopProcess: (step: WorkflowStep) => void;
|
|
322
335
|
resetSession: () => void;
|
|
323
336
|
resetFetchService: () => void;
|
|
324
337
|
_decodeMessageFromWebSocket: (eventData: MessageEvent['data']) => WebSocketDecodedSessionMessage | null;
|
|
@@ -378,6 +391,7 @@ declare class IdvFetchService {
|
|
|
378
391
|
private _fetchWorkflow;
|
|
379
392
|
private _fetchStep;
|
|
380
393
|
private _fetchSessionLogs;
|
|
394
|
+
private _fetchStartIamAuth;
|
|
381
395
|
connectByUserPass(config: ConnectionConfigCore): Promise<{
|
|
382
396
|
code: FetchResultCode.SUCCESS;
|
|
383
397
|
data: {
|
|
@@ -442,6 +456,12 @@ declare class IdvFetchService {
|
|
|
442
456
|
data: SessionData;
|
|
443
457
|
} | FetchErrorResult>;
|
|
444
458
|
pushLogs(sessionId: string, pushLogsParams: PushLogsParams): Promise<Record<string, unknown>>;
|
|
459
|
+
startIamAuth({ applicationId, baseUrl, metadata, locale, }: {
|
|
460
|
+
applicationId: string;
|
|
461
|
+
baseUrl: string;
|
|
462
|
+
metadata?: Record<string, unknown>;
|
|
463
|
+
locale?: string;
|
|
464
|
+
}): Promise<Record<string, unknown>>;
|
|
445
465
|
private _postStartUpload;
|
|
446
466
|
private _postFileChunk;
|
|
447
467
|
private _uploadFileInChunks;
|
|
@@ -485,6 +505,12 @@ declare type IdvIntegrationControllerProps = {
|
|
|
485
505
|
location?: GeoCoords | null;
|
|
486
506
|
}) => Promise<WorkflowCompletion>;
|
|
487
507
|
deinitialize: () => Promise<DeinitializeCompletion>;
|
|
508
|
+
startIamAuth: (params: {
|
|
509
|
+
applicationId: string;
|
|
510
|
+
baseUrl: string;
|
|
511
|
+
metadata?: Record<string, unknown>;
|
|
512
|
+
locale?: string;
|
|
513
|
+
}) => Promise<Record<string, unknown>>;
|
|
488
514
|
};
|
|
489
515
|
|
|
490
516
|
export declare class IdvIntegrationService {
|
|
@@ -499,6 +525,7 @@ export declare class IdvIntegrationService {
|
|
|
499
525
|
}): Promise<PrepareWorkflowCompletion>;
|
|
500
526
|
startWorkflow(config?: StartWorkflowConfig): Promise<WorkflowCompletion>;
|
|
501
527
|
deinitialize(): Promise<DeinitializeCompletion>;
|
|
528
|
+
startLogin(config: LoginConfig): Promise<StartLoginCompletion>;
|
|
502
529
|
/** service commands */
|
|
503
530
|
get version(): string;
|
|
504
531
|
get currentSessionId(): string | null;
|
|
@@ -612,7 +639,7 @@ export declare class IdvWebComponent extends LitElement {
|
|
|
612
639
|
isProcessing: boolean;
|
|
613
640
|
loadedModules: [] | LoadedModule[];
|
|
614
641
|
modulesConfig: Record<string, any>;
|
|
615
|
-
|
|
642
|
+
storeNonce: string | undefined;
|
|
616
643
|
connectedCallback(): void;
|
|
617
644
|
_listenerFromModule: (module: string, data: any) => void;
|
|
618
645
|
_isProcessingCallback: (isProcessing: boolean) => void;
|
|
@@ -652,6 +679,24 @@ declare type LoadedModule = {
|
|
|
652
679
|
component: any;
|
|
653
680
|
};
|
|
654
681
|
|
|
682
|
+
export declare type LoginConfig = {
|
|
683
|
+
applicationId: string;
|
|
684
|
+
baseUrl: string;
|
|
685
|
+
metadata?: Record<string, unknown>;
|
|
686
|
+
locale?: string;
|
|
687
|
+
};
|
|
688
|
+
|
|
689
|
+
export declare enum LoginError {
|
|
690
|
+
INITIALIZATION_REQUIRED = 0,
|
|
691
|
+
ALREADY_IN_PROCESS = 1,
|
|
692
|
+
START_COMMAND_FAILURE = 2,
|
|
693
|
+
MISSING_CONFIGURATION = 3,
|
|
694
|
+
PREPARE_WORKFLOW_FAILURE = 4,
|
|
695
|
+
EXECUTION_WORKFLOW_FAILURE = 5,
|
|
696
|
+
MISSING_AUTH_CODE = 6,
|
|
697
|
+
AUTH_FAILURE = 7
|
|
698
|
+
}
|
|
699
|
+
|
|
655
700
|
export declare type ModuleClass<TModuleProps = unknown, TModulesConfig = unknown> = IdvModuleStaticMethods & (new (...args: any[]) => BaseModule<TModuleProps, TModulesConfig>);
|
|
656
701
|
|
|
657
702
|
declare type PerformType = (typeof PerformTypes)[keyof typeof PerformTypes] | undefined;
|
|
@@ -762,6 +807,8 @@ declare type StartConfig = {
|
|
|
762
807
|
port?: number;
|
|
763
808
|
};
|
|
764
809
|
|
|
810
|
+
export declare type StartLoginCompletion = string | BaseLoginError;
|
|
811
|
+
|
|
765
812
|
export declare enum StartSessionError {
|
|
766
813
|
HTTP_ISSUE = 0,
|
|
767
814
|
PROVIDER_ERROR = 1,
|