@smartcomply/web-sdk 1.0.0 → 1.0.1

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.
@@ -0,0 +1,8 @@
1
+ export declare const BASE_URL: string;
2
+ export interface SDKConfig {
3
+ timeout?: number;
4
+ session: string;
5
+ onSuccess?: (data: any) => void;
6
+ onError?: (error: any) => void;
7
+ onExpire?: () => void;
8
+ }
@@ -0,0 +1,13 @@
1
+ import { SDKConfig } from './Config';
2
+ export declare class HttpClient {
3
+ private baseUrl;
4
+ private timeout;
5
+ private session;
6
+ private onError;
7
+ private destroy;
8
+ constructor(config: SDKConfig, destroy?: Function);
9
+ request<T>(method: string, path: string, body?: unknown, headers?: Record<string, string>): Promise<T>;
10
+ post<T>(path: string, data: any, headers?: Record<string, string>): Promise<T>;
11
+ patch<T>(path: string, data: any, headers?: Record<string, string>): Promise<T>;
12
+ get<T>(path: string): Promise<T>;
13
+ }
@@ -0,0 +1,6 @@
1
+ import { default as SmartComply } from '../main';
2
+ type Props = {
3
+ sdkInstance: SmartComply;
4
+ };
5
+ declare const MainSDKFlow: ({ sdkInstance }: Props) => import("react/jsx-runtime").JSX.Element;
6
+ export default MainSDKFlow;
@@ -0,0 +1,10 @@
1
+ import { SDK, TSDKTheme } from '../../utils/types';
2
+ type Props = {
3
+ config: SDK;
4
+ onSubmit: (identifier: string, identifier_type: string, country: string) => void;
5
+ selectedTheme: TSDKTheme;
6
+ handleIdUpdate: (file: File | undefined, cropped: File | undefined) => void;
7
+ idFile: File | undefined;
8
+ };
9
+ export default function IdentityForm({ config, selectedTheme, onSubmit, handleIdUpdate, idFile, }: Props): import("react/jsx-runtime").JSX.Element;
10
+ export {};
@@ -0,0 +1,13 @@
1
+ import { SDKConfig } from '../../client/Config';
2
+ import { IDConfirmationFormPayload, SDK } from '../../utils/types';
3
+ interface Props {
4
+ sdkInstance: SDKConfig;
5
+ updateStep: (step: string) => void;
6
+ config: SDK;
7
+ idFile: File | undefined;
8
+ snapshotFile: File | undefined;
9
+ identityFormData: IDConfirmationFormPayload | undefined;
10
+ handleDetectionPass: () => void;
11
+ }
12
+ declare const LivenessFlow: ({ sdkInstance, updateStep, config, idFile, snapshotFile, identityFormData, handleDetectionPass }: Props) => import("react/jsx-runtime").JSX.Element;
13
+ export default LivenessFlow;
@@ -0,0 +1,8 @@
1
+ import { SDK, TSDKTheme } from '../../utils/types';
2
+ type Props = {
3
+ config: SDK;
4
+ onStart: () => void;
5
+ selectedTheme: TSDKTheme;
6
+ };
7
+ export default function LivenessPreCheck({ selectedTheme, onStart }: Props): import("react/jsx-runtime").JSX.Element;
8
+ export {};
@@ -0,0 +1,6 @@
1
+ import { TSDKTheme } from '../../utils/types';
2
+ type Props = {
3
+ selectedTheme: TSDKTheme;
4
+ };
5
+ export default function LoadingScreen({ selectedTheme }: Props): import("react/jsx-runtime").JSX.Element;
6
+ export {};
@@ -0,0 +1,6 @@
1
+ type Props = {
2
+ redirect_url?: string;
3
+ destroy: () => void;
4
+ };
5
+ export default function SuccessConfirmation({ redirect_url, destroy }: Props): import("react/jsx-runtime").JSX.Element;
6
+ export {};
@@ -0,0 +1,6 @@
1
+ type Props = {
2
+ onComplete: () => void;
3
+ canClose: boolean;
4
+ };
5
+ export default function UploadingScreen({ onComplete, canClose }: Props): import("react/jsx-runtime").JSX.Element;
6
+ export {};
@@ -0,0 +1,8 @@
1
+ import { SDK, TSDKTheme } from '../../utils/types';
2
+ type Props = {
3
+ config: SDK;
4
+ onNext: () => void;
5
+ selectedTheme: TSDKTheme;
6
+ };
7
+ export default function WelcomeScreen({ config, selectedTheme, onNext, }: Props): import("react/jsx-runtime").JSX.Element;
8
+ export {};
@@ -0,0 +1,14 @@
1
+ import { TSDKTheme } from '../../utils/types';
2
+ export interface DropdownOption {
3
+ label: string;
4
+ value: string;
5
+ }
6
+ interface DropdownProps {
7
+ options: DropdownOption[];
8
+ value: string;
9
+ onChange: (value: string) => void;
10
+ selectedTheme: TSDKTheme;
11
+ placeholder?: string;
12
+ }
13
+ export default function Dropdown({ options, value, onChange, selectedTheme, placeholder, }: DropdownProps): import("react/jsx-runtime").JSX.Element;
14
+ export {};
@@ -0,0 +1,4 @@
1
+ export default function SessionTimeout({ destroy, onExpire }: {
2
+ destroy: Function;
3
+ onExpire?: Function;
4
+ }): import("react/jsx-runtime").JSX.Element;
@@ -0,0 +1 @@
1
+ export default function ToastContainer(): import("react/jsx-runtime").JSX.Element;
@@ -0,0 +1,15 @@
1
+ type ToastType = "success" | "error" | "loading";
2
+ export interface ToastItem {
3
+ id: string;
4
+ message: string;
5
+ type: ToastType;
6
+ }
7
+ type Listener = (toasts: ToastItem[]) => void;
8
+ export declare const toast: {
9
+ subscribe(listener: Listener): () => void;
10
+ success(message: string): void;
11
+ error(message: string): void;
12
+ loading(message: string): `${string}-${string}-${string}-${string}-${string}`;
13
+ dismiss(id?: string): void;
14
+ };
15
+ export {};
package/dist/index.d.ts CHANGED
@@ -1,34 +1,4 @@
1
- interface SDKConfig {
2
- timeout?: number;
3
- session: string;
4
- onSuccess?: (data: any) => void;
5
- onError?: (error: any) => void;
6
- onExpire?: () => void;
7
- }
8
-
9
- declare class HttpClient {
10
- private baseUrl;
11
- private timeout;
12
- private session;
13
- private onError;
14
- private destroy;
15
- constructor(config: SDKConfig, destroy?: Function);
16
- request<T>(method: string, path: string, body?: unknown, headers?: Record<string, string>): Promise<T>;
17
- post<T>(path: string, data: any, headers?: Record<string, string>): Promise<T>;
18
- patch<T>(path: string, data: any, headers?: Record<string, string>): Promise<T>;
19
- get<T>(path: string): Promise<T>;
20
- }
21
-
22
- declare class SmartComply {
23
- private http;
24
- private config;
25
- private root;
26
- private containerId;
27
- constructor(config: SDKConfig);
28
- getConfig(): SDKConfig;
29
- getHttp(): HttpClient;
30
- launch(): void;
31
- destroy: () => void;
32
- }
33
-
34
- export { type SDKConfig, SmartComply, SmartComply as default };
1
+ import { default as SmartComply } from './main';
2
+ export default SmartComply;
3
+ export { SmartComply };
4
+ export type { SDKConfig } from './client/Config';