@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.
- package/dist/client/Config.d.ts +8 -0
- package/dist/client/HttpClient.d.ts +13 -0
- package/dist/components/MainSDKFlow.d.ts +6 -0
- package/dist/components/steps/IdentityForm.d.ts +10 -0
- package/dist/components/steps/LivenessFlow.d.ts +13 -0
- package/dist/components/steps/LivenessPreCheck.d.ts +8 -0
- package/dist/components/steps/LoadingScreen.d.ts +6 -0
- package/dist/components/steps/SuccessConfirmation.d.ts +6 -0
- package/dist/components/steps/UploadingScreen.d.ts +6 -0
- package/dist/components/steps/WelcomeScreen.d.ts +8 -0
- package/dist/components/ui/Dropdown.d.ts +14 -0
- package/dist/components/ui/SessionTimeout.d.ts +4 -0
- package/dist/components/ui/toast/ToastContainer.d.ts +1 -0
- package/dist/components/ui/toast/index.d.ts +15 -0
- package/dist/index.d.ts +4 -34
- package/dist/index.js +84 -17
- package/dist/main.d.ts +13 -0
- package/dist/utils/constants.d.ts +8 -0
- package/dist/utils/index.d.ts +13 -0
- package/dist/utils/livenessHelpers.d.ts +3 -0
- package/dist/utils/types.d.ts +76 -0
- package/dist/vite.svg +1 -0
- package/dist/web-sdk.css +1 -0
- package/package.json +15 -6
- package/dist/index.cjs +0 -17
- package/dist/index.d.cts +0 -34
- package/dist/loading-5HD36QXU.svg +0 -14
- package/dist/shield-checkmark-JBZCUXJC.png +0 -0
- package/dist/success-GHUHNWON.svg +0 -4
- package/dist/trash-KETR47RP.svg +0 -7
|
@@ -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,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,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 @@
|
|
|
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
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
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';
|