@yidun/livedetect-sdk-h5 2.3.1 → 2.3.2
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,23 @@
|
|
|
1
|
+
interface IriskOptions {
|
|
2
|
+
productId: string;
|
|
3
|
+
apiServer: string;
|
|
4
|
+
staticServer: string;
|
|
5
|
+
errorToken: string;
|
|
6
|
+
offlineToken: string;
|
|
7
|
+
}
|
|
8
|
+
interface GetTokenOptions {
|
|
9
|
+
timeout?: number;
|
|
10
|
+
}
|
|
11
|
+
export default class Irisk {
|
|
12
|
+
private readonly options;
|
|
13
|
+
private guardian;
|
|
14
|
+
private loadStatus;
|
|
15
|
+
private loadPromise;
|
|
16
|
+
private readonly jsPath;
|
|
17
|
+
constructor(options: IriskOptions);
|
|
18
|
+
init(): Promise<void>;
|
|
19
|
+
getToken(options?: GetTokenOptions): Promise<string>;
|
|
20
|
+
private loadScript;
|
|
21
|
+
private createGuardian;
|
|
22
|
+
}
|
|
23
|
+
export {};
|
|
@@ -8,6 +8,7 @@ import { Camera } from './modules/camera';
|
|
|
8
8
|
import { Progress } from './modules/progress';
|
|
9
9
|
import { Footer } from './modules/footer';
|
|
10
10
|
import { Record as VideoRecord } from './modules/record';
|
|
11
|
+
import IriskModule from './irisk.js';
|
|
11
12
|
declare class NELiveDetection extends EventEmitter implements Dispose {
|
|
12
13
|
bdFaceSdk: any;
|
|
13
14
|
options: Required<Options>;
|
|
@@ -23,11 +24,15 @@ declare class NELiveDetection extends EventEmitter implements Dispose {
|
|
|
23
24
|
readonly progress: Progress;
|
|
24
25
|
readonly footer: Footer;
|
|
25
26
|
readonly record: VideoRecord;
|
|
27
|
+
private iriskModule;
|
|
28
|
+
private iriskEnable;
|
|
29
|
+
private iriskToken;
|
|
26
30
|
constructor(options: Options);
|
|
27
31
|
mount(container?: Options['container']): void;
|
|
28
32
|
mergeOptionsFromServer(): Promise<void>;
|
|
29
33
|
initBdFaceSdk(isEmitReady?: boolean): Promise<void>;
|
|
30
|
-
|
|
34
|
+
initIriskModule(): IriskModule;
|
|
35
|
+
start(): Promise<void>;
|
|
31
36
|
restart(): Promise<void>;
|
|
32
37
|
dispose(): void;
|
|
33
38
|
private canUseSDK;
|
|
@@ -23,6 +23,13 @@ export interface Options extends PirvateOptions {
|
|
|
23
23
|
lang?: Lang;
|
|
24
24
|
apiServer?: string;
|
|
25
25
|
preload?: boolean;
|
|
26
|
+
riskConfig?: {
|
|
27
|
+
enable: 1 | 2;
|
|
28
|
+
pn: string;
|
|
29
|
+
apiServer: string;
|
|
30
|
+
token: string;
|
|
31
|
+
offlineToken: string;
|
|
32
|
+
};
|
|
26
33
|
isSupport?: (ua: BrandVersion) => boolean;
|
|
27
34
|
onMount?: (instance?: NELiveDetection) => void;
|
|
28
35
|
onReady?: (instance?: NELiveDetection) => void;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@yidun/livedetect-sdk-h5",
|
|
3
|
-
"version": "2.3.
|
|
3
|
+
"version": "2.3.2",
|
|
4
4
|
"description": "活体检测 H5",
|
|
5
5
|
"main": "dist/NELiveDetection.umd.js",
|
|
6
6
|
"module": "dist/es/NELiveDetection.esm.js",
|
|
@@ -23,7 +23,7 @@
|
|
|
23
23
|
},
|
|
24
24
|
"lint-staged": {
|
|
25
25
|
"*.{ts,tsx,js}": [
|
|
26
|
-
"eslint --config .eslintrc.js"
|
|
26
|
+
"eslint --config .eslintrc.js --fix"
|
|
27
27
|
],
|
|
28
28
|
"*.{css,less,scss}": [
|
|
29
29
|
"stylelint --config .stylelintrc.js"
|
|
@@ -103,7 +103,8 @@
|
|
|
103
103
|
"typescript": "^4.6.3"
|
|
104
104
|
},
|
|
105
105
|
"dependencies": {
|
|
106
|
-
"@yidun/snaker": "^0.4.3"
|
|
106
|
+
"@yidun/snaker": "^0.4.3",
|
|
107
|
+
"load-script": "^2.0.0"
|
|
107
108
|
},
|
|
108
109
|
"volta": {
|
|
109
110
|
"node": "18.20.5"
|