@authme/engine 2.2.0 → 2.2.1-rc.3

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.
Files changed (40) hide show
  1. package/assets/engine-worker.js +1 -504
  2. package/assets/ml_engine_web.js +1 -1
  3. package/assets/ml_engine_web.simd.js +1 -1
  4. package/assets/ml_engine_web.simd.wasm +0 -0
  5. package/assets/ml_engine_web.wasm +0 -0
  6. package/assets/ml_engine_web_version.txt +1 -1
  7. package/index.cjs +617 -0
  8. package/index.js +609 -0
  9. package/package.json +11 -13
  10. package/src/index.d.ts +4 -3
  11. package/src/lib/engine.d.ts +52 -42
  12. package/src/lib/enum/auth.enum.d.ts +3 -3
  13. package/src/lib/enum/fas-recognition.enum.d.ts +46 -0
  14. package/src/lib/enum/id-recognition.enum.d.ts +64 -0
  15. package/src/lib/enum/index.d.ts +4 -2
  16. package/src/lib/enum/module.enum.d.ts +8 -8
  17. package/src/lib/interface/basic-type.interface.d.ts +12 -12
  18. package/src/lib/interface/config.interface.d.ts +7 -7
  19. package/src/lib/interface/index.d.ts +3 -3
  20. package/src/lib/interface/worker-command.interface.d.ts +7 -7
  21. package/src/lib/version.d.ts +1 -0
  22. package/CHANGELOG.md +0 -400
  23. package/src/index.js +0 -7
  24. package/src/index.js.map +0 -1
  25. package/src/lib/engine.js +0 -345
  26. package/src/lib/engine.js.map +0 -1
  27. package/src/lib/enum/auth.enum.js +0 -8
  28. package/src/lib/enum/auth.enum.js.map +0 -1
  29. package/src/lib/enum/index.js +0 -6
  30. package/src/lib/enum/index.js.map +0 -1
  31. package/src/lib/enum/module.enum.js +0 -13
  32. package/src/lib/enum/module.enum.js.map +0 -1
  33. package/src/lib/interface/basic-type.interface.js +0 -3
  34. package/src/lib/interface/basic-type.interface.js.map +0 -1
  35. package/src/lib/interface/config.interface.js +0 -10
  36. package/src/lib/interface/config.interface.js.map +0 -1
  37. package/src/lib/interface/index.js +0 -7
  38. package/src/lib/interface/index.js.map +0 -1
  39. package/src/lib/interface/worker-command.interface.js +0 -3
  40. package/src/lib/interface/worker-command.interface.js.map +0 -1
@@ -1,42 +1,52 @@
1
- import { Observable } from 'rxjs';
2
- import { EngineModule } from './enum';
3
- import { EngineDebugInfo, MlEngineConfig } from './interface';
4
- export declare abstract class AuthmeFunctionModule {
5
- init(config: MlEngineConfig): Promise<void>;
6
- static getVersion(): string;
7
- }
8
- export declare class MlEngine {
9
- static instance: MlEngine | null;
10
- private worker;
11
- path: string;
12
- private workerMessage$;
13
- private config;
14
- constructor(config: MlEngineConfig);
15
- init(): Promise<void>;
16
- run(module: string, command: string, value?: any): Observable<any>;
17
- setConfig(config: MlEngineConfig): Promise<any>;
18
- getConfig(): MlEngineConfig;
19
- loadEngine(): Promise<any>;
20
- debug$(): Observable<string>;
21
- }
22
- export declare abstract class AuthmeEngineModuleBase<T = any> {
23
- protected engine: MlEngine;
24
- protected initialized: boolean;
25
- protected initializing: boolean;
26
- protected setSized: boolean;
27
- protected received: boolean;
28
- protected moduleName: EngineModule;
29
- constructor(engine: MlEngine);
30
- _engineRunAsync(command: string, value?: any): Promise<any>;
31
- init(): Promise<boolean>;
32
- startSession(): Promise<void>;
33
- stop(): Promise<void>;
34
- getReport(): Promise<string>;
35
- recognition(data: Uint8Array | Uint8ClampedArray): Promise<T & EngineDebugInfo>;
36
- getDebugImageData(data: Uint8Array | Uint8ClampedArray): Promise<Uint8Array>;
37
- setFrameSize(width: number, height: number): Promise<boolean>;
38
- getParams(): Promise<any>;
39
- setParams(params: any): Promise<any>;
40
- setMaskPosition(positions: number[][]): Promise<any>;
41
- destroy(): Promise<boolean>;
42
- }
1
+ import { EngineModule } from './enum';
2
+ import { EngineDebugInfo, MlEngineConfig } from './interface';
3
+ export declare abstract class AuthmeFunctionModule {
4
+ init(config: MlEngineConfig): Promise<void>;
5
+ static getVersion(): string;
6
+ }
7
+ export declare class MlEngine {
8
+ private static _ENGINE_CACHE;
9
+ private config;
10
+ private workerAndStreamPromise;
11
+ private preloadPromise;
12
+ constructor(config: MlEngineConfig);
13
+ private _run;
14
+ private _makeWorkerAndStreamAsync;
15
+ private _backgroundPreloadAsync;
16
+ terminateWorkerAsync(): Promise<void>;
17
+ private _preloadAndWaitReadyAsync;
18
+ private _checkEnumConsistencyAsync;
19
+ run<TResp = unknown>(module: string, command: string, value?: unknown): Promise<TResp>;
20
+ getConfig(): MlEngineConfig;
21
+ setConfig(config: MlEngineConfig): Promise<void>;
22
+ private _loadEngineAsync;
23
+ }
24
+ export declare abstract class AuthmeEngineModuleBase<T = any> {
25
+ private static _MODEL_CACHE;
26
+ private _initPromise;
27
+ protected engine: MlEngine;
28
+ protected initialized: boolean;
29
+ protected initializing: boolean;
30
+ protected setSized: boolean;
31
+ protected received: boolean;
32
+ protected moduleName: EngineModule;
33
+ constructor(engine: MlEngine);
34
+ private _engineRunAsync;
35
+ private _init;
36
+ init(): Promise<boolean>;
37
+ preloadAsync(): Promise<boolean>;
38
+ startSession(): Promise<void>;
39
+ stop(): Promise<void>;
40
+ getReport(): Promise<string>;
41
+ recognition(data: Uint8Array | Uint8ClampedArray): Promise<T & EngineDebugInfo>;
42
+ getDebugImageData(data: Uint8Array | Uint8ClampedArray): Promise<Uint8Array>;
43
+ setFrameSize(width: number, height: number): Promise<boolean>;
44
+ getParams(): Promise<{
45
+ timeoutSec: number;
46
+ fFASTh: number;
47
+ }>;
48
+ setParams(params: any): Promise<unknown>;
49
+ setMaskPosition(positions: number[][]): Promise<unknown>;
50
+ destroy(): Promise<boolean>;
51
+ static reset_MODEL_CACHE(): void;
52
+ }
@@ -1,3 +1,3 @@
1
- export declare enum EAuthMeSDKAuthStatus {
2
- Pass = "EAuthMeSDKAuthStatus_Pass"
3
- }
1
+ export declare enum EAuthMeEngineReturnCode {
2
+ Pass = "EAuthMeEngineReturnCode_eAuthMe_Engine_Authorization_Pass"
3
+ }
@@ -0,0 +1,46 @@
1
+ export declare enum EAuthMeFASServiceStatus {
2
+ Failed = "EAuthMeFASServiceStatus_Failed",
3
+ NoFace = "EAuthMeFASServiceStatus_NoFace",
4
+ FaceNotAtCenter = "EAuthMeFASServiceStatus_FaceNotAtCenter",
5
+ FaceTooSmall = "EAuthMeFASServiceStatus_FaceTooSmall",
6
+ FaceTooLarge = "EAuthMeFASServiceStatus_FaceTooLarge",
7
+ NeedFaceToCamera = "EAuthMeFASServiceStatus_NeedFaceToCamera",
8
+ FaceMasked = "EAuthMeFASServiceStatus_FaceMasked",
9
+ NeedOpenMouth = "EAuthMeFASServiceStatus_NeedOpenMouth",
10
+ NeedCloseMouth = "EAuthMeFASServiceStatus_NeedCloseMouth",
11
+ NeedSmile = "EAuthMeFASServiceStatus_NeedSmile",
12
+ NeedOpenEyes = "EAuthMeFASServiceStatus_NeedOpenEyes",
13
+ NeedMoreFrame = "EAuthMeFASServiceStatus_NeedMoreFrame",
14
+ Error = "EAuthMeFASServiceStatus_Error",
15
+ Pass = "EAuthMeFASServiceStatus_Pass"
16
+ }
17
+ export declare enum EAuthMeFASServiceStage {
18
+ Passive = "EAuthMeFASServiceStage_Passive",
19
+ OpenMouth = "EAuthMeFASServiceStage_OpenMouth",
20
+ CloseMouth = "EAuthMeFASServiceStage_CloseMouth",
21
+ Smile = "EAuthMeFASServiceStage_Smile",
22
+ Done = "EAuthMeFASServiceStage_Done"
23
+ }
24
+ export declare enum EAuthMeEyeStatus {
25
+ Eye_Close = "EAuthMeEyeStatus_Eye_Close",
26
+ Eye_Open = "EAuthMeEyeStatus_Eye_Open"
27
+ }
28
+ export declare enum EAuthMeMouthStatus {
29
+ Mouth_Close = "EAuthMeMouthStatus_Mouth_Close",
30
+ Mouth_Open = "EAuthMeMouthStatus_Mouth_Open"
31
+ }
32
+ export declare enum EAuthMeFacePose {
33
+ Unknown = "EAuthMeFacePose_Unknown",
34
+ LeftProfile = "EAuthMeFacePose_LeftProfile",
35
+ LeftFrontal = "EAuthMeFacePose_LeftFrontal",
36
+ Frontal = "EAuthMeFacePose_Frontal",
37
+ RightFrontal = "EAuthMeFacePose_RightFrontal",
38
+ RightProfile = "EAuthMeFacePose_RightProfile",
39
+ UpFrontal = "EAuthMeFacePose_UpFrontal",
40
+ DownFrontal = "EAuthMeFacePose_DownFrontal"
41
+ }
42
+ export declare enum EAuthMeFaceAntiSpoofingStatus {
43
+ FrameNotEnough = "EAuthMeFaceAntiSpoofingStatus_FrameNotEnough",
44
+ Real = "EAuthMeFaceAntiSpoofingStatus_Real",
45
+ Spoof = "EAuthMeFaceAntiSpoofingStatus_Spoof"
46
+ }
@@ -0,0 +1,64 @@
1
+ export declare enum EAuthMeCardClass {
2
+ Invalid = "EAuthMeCardClass_Invalid",
3
+ Unknown = "EAuthMeCardClass_UnknownCard",
4
+ Passport = "EAuthMeCardClass_Passport",
5
+ TWN_IDCard_Front = "EAuthMeCardClass_TWN_IDCard_Front",
6
+ TWN_IDCard_Back = "EAuthMeCardClass_TWN_IDCard_Back",
7
+ TWN_DriverLicense_Front = "EAuthMeCardClass_TWN_DriverLicense_Front",
8
+ TWN_DriverLicense_Back = "EAuthMeCardClass_TWN_DriverLicense_Back",
9
+ TWN_ResidentCard_Front = "EAuthMeCardClass_TWN_ResidentCard_Front",
10
+ TWN_ResidentCard_Back = "EAuthMeCardClass_TWN_ResidentCard_Back",
11
+ TWN_HealthCard_Front = "EAuthMeCardClass_TWN_HealthCard_Front",
12
+ TWN_VehiclesLicense_Front = "EAuthMeCardClass_TWN_VehiclesLicense_Front"
13
+ }
14
+ export declare enum EAuthMeIDCardMetalTagStatus {
15
+ NotFound = "EAuthMeIDCardMetalTagStatus_NotFound",
16
+ Bright = "EAuthMeIDCardMetalTagStatus_Bright",
17
+ Dark = "EAuthMeIDCardMetalTagStatus_Dark"
18
+ }
19
+ export declare enum EAuthMeCardMatchStatus {
20
+ None = "EAuthMeCardMatchStatus_None",
21
+ Mismatch = "EAuthMeCardMatchStatus_Mismatch",
22
+ NeedMoreFrame = "EAuthMeCardMatchStatus_NeedMoreFrame",
23
+ Match = "EAuthMeCardMatchStatus_Match"
24
+ }
25
+ export declare enum EAuthMeCardOCRStatus {
26
+ NoCard = "EAuthMeCardOCRStatus_NoCard",
27
+ WrongCardType = "EAuthMeCardOCRStatus_WrongCardType",
28
+ PositionNotMatch = "EAuthMeCardOCRStatus_PositionNotMatch",
29
+ Reflective = "EAuthMeCardOCRStatus_Reflective",
30
+ Blur = "EAuthMeCardOCRStatus_Blur",
31
+ Pass = "EAuthMeCardOCRStatus_Pass",
32
+ Error = "EAuthMeCardOCRStatus_Error"
33
+ }
34
+ export declare enum EAuthMeIDCardAntiFraudStatus {
35
+ Failed = "EAuthMeIDCardAntiFraudStatus_Failed",
36
+ NoCard = "EAuthMeIDCardAntiFraudStatus_NoCard",
37
+ WrongCardType = "EAuthMeIDCardAntiFraudStatus_WrongCardType",
38
+ Reflective = "EAuthMeIDCardAntiFraudStatus_Reflective",
39
+ Blur = "EAuthMeIDCardAntiFraudStatus_Blur",
40
+ Gray = "EAuthMeIDCardAntiFraudStatus_Gray",
41
+ PositionNotMatch = "EAuthMeIDCardAntiFraudStatus_PositionNotMatch",
42
+ NeedMoreFrame = "EAuthMeIDCardAntiFraudStatus_NeedMoreFrame",
43
+ Pass = "EAuthMeIDCardAntiFraudStatus_Pass",
44
+ Error = "EAuthMeIDCardAntiFraudStatus_Error"
45
+ }
46
+ export declare enum EAuthMeMRZRecogStatus {
47
+ Success = "EAuthMeMRZRecogStatus_Success",
48
+ WrongFormat = "EAuthMeMRZRecogStatus_WrongFormat"
49
+ }
50
+ export declare enum EAuthMePassportServiceStatus {
51
+ Success = "EAuthMePassportServiceStatus_Success",
52
+ NotFound = "EAuthMePassportServiceStatus_NotFound",
53
+ RecogFailed = "EAuthMePassportServiceStatus_RecogFailed",
54
+ Error = "EAuthMePassportServiceStatus_Error"
55
+ }
56
+ export declare enum EAuthMeIDCardAntiFraudStage {
57
+ Frontal = "EAuthMeIDCardAntiFraudStage_Frontal",
58
+ Up = "EAuthMeIDCardAntiFraudStage_Up",
59
+ Down = "EAuthMeIDCardAntiFraudStage_Down",
60
+ Left = "EAuthMeIDCardAntiFraudStage_Left",
61
+ Right = "EAuthMeIDCardAntiFraudStage_Right",
62
+ IgnoreCardMatch = "EAuthMeIDCardAntiFraudStage_IgnoreCardMatch",
63
+ Done = "EAuthMeIDCardAntiFraudStage_Done"
64
+ }
@@ -1,2 +1,4 @@
1
- export * from './module.enum';
2
- export * from './auth.enum';
1
+ export * from './module.enum';
2
+ export * from './auth.enum';
3
+ export * from './id-recognition.enum';
4
+ export * from './fas-recognition.enum';
@@ -1,8 +1,8 @@
1
- export declare enum EngineModule {
2
- Fas = "Fas",
3
- IdCardAntiFraud = "IdCardAntiFraud",
4
- CardOCR = "CardOCR",
5
- PassportService = "PassportService",
6
- DEBUG = "DEBUG",
7
- Core = "Core"
8
- }
1
+ export declare enum EngineModule {
2
+ Fas = "Fas",
3
+ IdCardAntiFraud = "IdCardAntiFraud",
4
+ CardOCR = "CardOCR",
5
+ PassportService = "PassportService",
6
+ DEBUG = "DEBUG",
7
+ Core = "Core"
8
+ }
@@ -1,12 +1,12 @@
1
- export interface AuthMeRectFloat {
2
- fLeft: number;
3
- fTop: number;
4
- fRight: number;
5
- fBottom: number;
6
- }
7
- export interface EngineDebugInfo {
8
- debugInfo: {
9
- inferenceTime: number;
10
- debugImage?: Uint8Array;
11
- };
12
- }
1
+ export interface AuthMeRectFloat {
2
+ fLeft: number;
3
+ fTop: number;
4
+ fRight: number;
5
+ fBottom: number;
6
+ }
7
+ export interface EngineDebugInfo {
8
+ debugInfo: {
9
+ inferenceTime: number;
10
+ debugImage?: Uint8Array;
11
+ };
12
+ }
@@ -1,7 +1,7 @@
1
- export interface MlEngineConfig {
2
- token?: string;
3
- scriptPath?: string;
4
- apiBaseUrl?: string;
5
- dataTransferMethod?: 'binary' | 'base64';
6
- }
7
- export declare const defaultMlEngineConfig: MlEngineConfig;
1
+ export interface MlEngineConfig {
2
+ token?: string;
3
+ scriptPath?: string;
4
+ apiBaseUrl?: string;
5
+ dataTransferMethod?: 'binary' | 'base64';
6
+ }
7
+ export declare const defaultMlEngineConfig: MlEngineConfig;
@@ -1,3 +1,3 @@
1
- export * from './worker-command.interface';
2
- export * from './basic-type.interface';
3
- export * from './config.interface';
1
+ export * from './worker-command.interface';
2
+ export * from './basic-type.interface';
3
+ export * from './config.interface';
@@ -1,7 +1,7 @@
1
- import { EngineModule } from '../enum';
2
- export interface WorkerCommand {
3
- module: EngineModule;
4
- command: string;
5
- id: any;
6
- value?: any;
7
- }
1
+ import { EngineModule } from '../enum';
2
+ export interface WorkerCommand {
3
+ module: EngineModule;
4
+ command: string;
5
+ id: any;
6
+ value?: any;
7
+ }
@@ -0,0 +1 @@
1
+ export declare const version: string;