auth-mn
Version:
375 lines (374 loc) • 11.8 kB
TypeScript
export declare const jsonToQueryString: (params: Record<string, any>) => string;
export declare const ObjectId: () => string;
export type Config = {
token: string;
env: "prod" | "staging";
hosts: {
MAIN: string;
WALLET: string;
};
auth: {
username: string;
password: string;
};
logger: boolean;
};
export declare const config: Config;
export declare const setHost: ({ MAIN, WALLET }: {
MAIN: string;
WALLET: string;
}, ENV: "staging" | "prod") => void;
export declare const setLogger: (status: boolean) => void;
declare const _default: {
auth: {
TOKEN: (auth: {
username: string;
password: string;
}) => Promise<string>;
};
ObjectId: () => string;
notification: {
SinglePushNoti: (body: {
user_id: number;
target_app: "AVDAR-STORE" | "AUTH-APP" | "E-SIM" | "SELLER-PANDA";
body: {
title: string;
body: string;
icon: string;
image?: string;
button?: {
title: string;
url: string;
} | null;
};
}) => Promise<{
success: boolean;
data: null;
message: string;
}>;
SMS: (body: {
text: string;
to: string;
from: string;
}) => Promise<{
success: boolean;
data: null;
message: string;
}>;
MAIL: (body: {
type: "notification" | "otp" | "custom";
form?: {
name?: string;
email?: string;
};
to: string[];
subject: string;
body: {
name: string;
title?: string;
desc?: string;
otp?: string | number;
button?: {
text: string;
url: string | null;
};
footer_text?: string;
};
}) => Promise<{
success: boolean;
data: null;
message: string;
}>;
_3RD: {
TOKI: (body: {
accountId: string;
title: string;
body: string;
url: string;
buttonName: string;
imageURL?: string;
icon: string;
}) => Promise<{
success: boolean;
data: null;
message: string;
}>;
HIPAY: (body: {
customerId: string;
message: string;
}) => Promise<{
success: boolean;
data: null;
message: string;
}>;
};
};
socket: {
ShowToast: (body: {
user_id: number;
type: "info" | "warning";
text: string;
}) => Promise<{
success: boolean;
data: null;
message: string;
}>;
ShowStatus: (body: {
user_id: number;
id: string;
type?: "Loading" | "Success" | "Failure";
title?: string;
amount?: number | string;
desc?: string;
footer?: {
text: string;
buttons: {
text: string;
fun: "href" | "close" | "exit";
href?: string | null;
}[];
};
show?: boolean;
expired_date?: Date;
start_date?: Date;
}) => Promise<{
success: boolean;
data: null;
message: string;
}>;
ShowOrderStatus: (body: {
user_id: number;
order_id: string;
}) => Promise<{
success: boolean;
data: null;
message: string;
}>;
EMIT: (body: {
user_id: number;
emit_name: string;
data: any;
}[]) => Promise<{
success: boolean;
data: null;
message: string;
}>;
};
find: {
USER: (body: {
user_id: number;
user_name: string;
nick_name: string;
exp: number;
primary_email?: string | null;
primary_phone?: string | null;
emails: import("./find").UserEmailItem[];
phone_numbers: import("./find").UserPhoneItem[];
auth_profiles: import("./find").UserAuthProfiles;
profile_image_url: string;
date_of_birth: Date | null;
gender?: import("./find").Gender;
sign_up_date: Date | null;
last_login: Date | null;
wallets: import("./find").UserWalletItem[];
preferences: import("./find").UserPreferences;
status: import("./find").UserStatus;
security: import("./find").UserSecurity;
verify_info: import("./find").UserVerifyInfo;
dynamic_info: Record<string, any>;
apps: import("./find").UserAppItem[];
search_string?: string;
delFlg?: boolean;
order_index?: number;
}) => Promise<{
success: boolean;
data: {
user_id: number;
user_name: string;
nick_name: string;
exp: number;
primary_email?: string | null;
primary_phone?: string | null;
emails: import("./find").UserEmailItem[];
phone_numbers: import("./find").UserPhoneItem[];
auth_profiles: import("./find").UserAuthProfiles;
profile_image_url: string;
date_of_birth: Date | null;
gender?: import("./find").Gender;
sign_up_date: Date | null;
last_login: Date | null;
wallets: import("./find").UserWalletItem[];
preferences: import("./find").UserPreferences;
status: import("./find").UserStatus;
security: import("./find").UserSecurity;
verify_info: import("./find").UserVerifyInfo;
dynamic_info: Record<string, any>;
apps: import("./find").UserAppItem[];
search_string?: string;
delFlg?: boolean;
order_index?: number;
}[];
message: string;
}>;
MERCHANT: (body: {
_id?: string;
user_id: number;
user_name?: string;
phone_number?: string;
user_role?: "merchant" | "sub-merchant";
avatar?: string;
authority?: string[];
user_email?: string;
password?: string;
show_router?: string[];
show_id?: string[];
merchant: {
toki_id: string;
hipay: string;
};
wallet_id?: string;
wallet_key?: string;
delFlg?: boolean;
createdAt?: Date;
updatedAt?: Date;
}) => Promise<{
success: boolean;
data: {
_id?: string;
user_id: number;
user_name?: string;
phone_number?: string;
user_role?: "merchant" | "sub-merchant";
avatar?: string;
authority?: string[];
user_email?: string;
password?: string;
show_router?: string[];
show_id?: string[];
merchant: {
toki_id: string;
hipay: string;
};
wallet_id?: string;
wallet_key?: string;
delFlg?: boolean;
createdAt?: Date;
updatedAt?: Date;
}[];
message: string;
}>;
ADMIN: (body: {
_id?: string;
user_id?: number;
user_name?: string;
phone_number?: number;
user_role?: "admin" | "sub-admin" | "super-admin";
avatar?: string;
authority?: string[];
user_email?: string;
password?: string;
show_router?: string[];
show_id?: string[];
delFlg?: boolean;
createdAt?: Date;
updatedAt?: Date;
}) => Promise<{
success: boolean;
data: {
_id?: string;
user_id?: number;
user_name?: string;
phone_number?: number;
user_role?: "admin" | "sub-admin" | "super-admin";
avatar?: string;
authority?: string[];
user_email?: string;
password?: string;
show_router?: string[];
show_id?: string[];
delFlg?: boolean;
createdAt?: Date;
updatedAt?: Date;
}[];
message: string;
}>;
CLIENT: (body: {
_id?: string;
user_id?: number;
user_name?: string;
phone_number?: number;
user_role?: "crm" | "sub-crm";
avatar?: string;
authority?: string[];
user_email?: string;
password?: string;
show_router?: string[];
show_id?: string[];
RefundFun?: boolean;
delFlg?: boolean;
createdAt?: Date;
updatedAt?: Date;
}) => Promise<{
success: boolean;
data: {
_id?: string;
user_id?: number;
user_name?: string;
phone_number?: number;
user_role?: "crm" | "sub-crm";
avatar?: string;
authority?: string[];
user_email?: string;
password?: string;
show_router?: string[];
show_id?: string[];
RefundFun?: boolean;
delFlg?: boolean;
createdAt?: Date;
updatedAt?: Date;
}[];
message: string;
}>;
CRM: (body: {
_id?: string;
user_id?: number;
user_name?: string;
phone_number?: number;
user_role?: "crm" | "sub-crm";
avatar?: string;
authority?: string[];
user_email?: string;
password?: string;
show_router?: string[];
show_id?: string[];
RefundFun?: boolean;
delFlg?: boolean;
createdAt?: Date;
updatedAt?: Date;
}) => Promise<{
success: boolean;
data: {
_id?: string;
user_id?: number;
user_name?: string;
phone_number?: number;
user_role?: "crm" | "sub-crm";
avatar?: string;
authority?: string[];
user_email?: string;
password?: string;
show_router?: string[];
show_id?: string[];
RefundFun?: boolean;
delFlg?: boolean;
createdAt?: Date;
updatedAt?: Date;
}[];
message: string;
}>;
};
};
export default _default;
export { default as notification } from "./notification";
export { default as socket } from "./socket";
export { default as find } from "./find";