ekyc-sdk-arm
Version:
Automated Recognition Module
198 lines (197 loc) • 5.22 kB
TypeScript
interface Config {
questions: number;
question_timeout_in_second: number;
retry_verification: number;
retry_proof: number;
session_expired_in_second: number;
question_list: string[];
}
interface RequestCreateSession {
cust_uuid: string;
}
interface ResponseCreateSession {
config: Config;
session_id: string;
round: number;
new_session: boolean;
}
interface RequestSaveTransaction {
session_id: string;
round: number;
question_no: number;
image: File;
question: Question;
is_timeout: boolean;
}
declare type ResponseSaveTransaction = {
session_type: ProcessType;
result: ResponseTransactionResult;
session_status: boolean;
};
declare type ResponseTransactionResult = SaveTransactionDetail | SaveTransactionError | ErrorAPIResponse | ResponseGetResult;
declare type SaveTransactionError = {
session_id: string;
details: {
id: string;
created_at: Date;
question_code: Question;
question_no: number;
reason: string;
result: boolean;
round: number;
s3_path: string;
session_id: string;
update_at: Date;
};
condition_valid: boolean;
};
declare type SaveTransactionDetail = {
session_id: string;
is_timeout: boolean;
session_status: boolean;
details: {
glasses: {
dark_glasses: boolean;
eye_open: boolean;
have_glasses: boolean;
};
headpose: boolean;
headwear: boolean;
mouth_open: boolean;
face_left: boolean;
face_right: boolean;
sharpness: number;
smiling: boolean;
confidence: number;
bounding_box: {
Width: number;
Height: number;
Left: number;
Top: number;
};
} | {};
session: {
id: string;
created_at: Date;
question_code: Question;
question_no: number;
reason: string;
result: boolean;
round: number;
s3_path: string;
session_id: string;
update_at: Date;
} | {};
result: ResponseGetResult | {};
condition_valid: boolean;
};
interface ResponseCheckStatus {
cust_uuid: string;
activities: ActivitiesModel[];
}
interface ActivitiesModel {
name: string;
service_status: boolean;
maximum_fail_attempt: boolean;
}
interface RequestGetResult {
session_id: string;
}
interface ResponseGetResult {
cust_uuid: string;
status: boolean;
data: GetResultQuestion[];
pid: string;
compare_verify: boolean;
}
interface GetResultQuestion {
no: number;
code: Question;
result: boolean;
reason: string;
}
interface RequestVerify {
cust_uuid: string;
source_image: File;
}
interface ResponseVerify {
cust_uuid: string;
details: {
glasses: {
dark_glasses: boolean;
eye_open: boolean;
have_glasses: boolean;
};
headpose: boolean;
headwear: boolean;
mouth_open: boolean;
sharpness: number;
smiling: boolean;
confidence: number;
bounding_box: {
Width: number;
Height: number;
Left: number;
Top: number;
};
};
image_resolution: {
width: number;
height: number;
};
condition_valid: boolean;
face_condition_verify: {
not_headwear: boolean;
not_smiling: boolean;
not_dark_glasses: boolean;
eye_open: boolean;
headpose: boolean;
mouth_not_open: boolean;
};
pid: string;
}
interface ResponseDetectFace {
num_faces: number;
detect_face: boolean;
face_left: boolean;
face_right: boolean;
face_center: boolean;
open_month: boolean;
smiling: boolean;
ry: number;
rx: number;
}
interface ErrorAPIResponse {
error: ErrorObject;
}
interface ErrorObject {
type: string;
message: string;
}
interface ResultProcessSession {
session_status: boolean;
code: ProcessType;
response: ResponseSaveTransaction | ResponseGetResult;
}
interface ResponseCurrentQuestion {
questions: string[];
current_question: string;
question_no: number;
}
declare enum Question {
'FacingLeft' = "FacingLeft",
'FacingRight' = "FacingRight",
'MouthOpen' = "MouthOpen",
'Smiling' = "Smiling"
}
declare enum ProcessType {
'GET_RESULT' = "GET_RESULT",
'SAVE_TRANSACTION' = "SAVE_TRANSACTION",
'ERROR_API' = "ERROR_API"
}
declare enum TypeCall {
'CONSUMER' = "CONSUMER",
'APIKEY' = "APIKEY",
'JWT' = "JWT"
}
export { Config, RequestCreateSession, ResponseCreateSession, RequestSaveTransaction, RequestGetResult, ResponseGetResult, RequestVerify, ResponseVerify, Question, ResponseDetectFace, TypeCall, ErrorAPIResponse, ResultProcessSession, ResponseSaveTransaction, SaveTransactionError, SaveTransactionDetail, ResponseCheckStatus, ProcessType, ResponseCurrentQuestion };