import { Service } from "moleculer"; import { Request, Response } from 'express'; import { KnModel, KnHandler, LoggerInterface, DBConnector, TrackingInfo, OperationInfo, DBField, KnSetting, FieldSetting } from "will-db"; import { ResultSet, RecordSet } from "will-sql"; import { JSONReply } from "will-api"; import { UserTokenInfo, PasswordPolicyInfo, PasswordVerify, AuthenTokenData } from "will-lib" import { DH } from "will-dh"; export declare class ActivateHandler extends SchemeHandler { model: KnModel; activateInfo: ActivateInfo | undefined; activateCategory: string; handlers: { name: string; }[]; invalidate(context: ContextInfo): Promise; activate(context: ContextInfo): Promise; inactivate(context: ContextInfo): Promise; removal(context: ContextInfo): Promise; createActivateKey(): string; createActivateInfo(data?: any, invalidatetimes?: number): ActivateInfo; protected assignParameters(context: ContextInfo, sql: SQLInterface, action?: string, mode?: string): void; protected validateActivateInfo(info: ActivateInfo): ValidateInfo; doCreate(context: ContextInfo, model: KnModel, invalidatetimes?: number): Promise; createActivation(db: DBConnector, info: ActivateInfo, context?: any): Promise; validateKeyFields(context: ContextInfo): ValidateInfo; protected doRetrieve(context: ContextInfo, model: KnModel): Promise; doRetrieving(context: ContextInfo, db: DBConnector): Promise; performRetrieving(db: DBConnector, info: ActivateInfo, context?: any): Promise; getActivateInfo(db: DBConnector, info: ActivateInfo, context?: any): Promise; doActivate(context: ContextInfo, model: KnModel): Promise; doActivating(context: ContextInfo, db: DBConnector): Promise; performActivating(db: DBConnector, info: ActivateInfo, context?: any): Promise; updateActivation(db: DBConnector, info: ActivateInfo, context?: any): Promise; updateActivateByKeyAndUser(db: DBConnector, info: ActivateInfo, context?: any): Promise; updateActivateByKey(db: DBConnector, info: ActivateInfo, context?: any): Promise; deleteActivateUser(db: DBConnector, info: ActivateInfo, context?: any): Promise; deleteActivateUserCategory(db: DBConnector, info: ActivateInfo, context?: any): Promise; deleteActivateUserKey(db: DBConnector, info: ActivateInfo, context?: any): Promise; deleteActivateKey(db: DBConnector, info: ActivateInfo, context?: any): Promise; deleteExpiration(db: DBConnector, curtime?: number, context?: any): Promise; moveToHistoryByUser(db: DBConnector, info: ActivateInfo, context?: any): Promise; moveToHistoryByKey(db: DBConnector, info: ActivateInfo, context?: any): Promise; doInvalidate(context: ContextInfo, model: KnModel): Promise; doInvalidating(context: ContextInfo, db: DBConnector): Promise; performInvalidating(db: DBConnector, info: ActivateInfo, invalidatetimes?: number): Promise; doInactivate(context: ContextInfo, model: KnModel): Promise; doInactivating(context: ContextInfo, db: DBConnector): Promise; /** * To invalidate and activate transaction */ performInactivating(db: DBConnector, info: ActivateInfo, invalidatetimes?: number, context?: any): Promise; protected doUpdate(context: ContextInfo, model: KnModel): Promise; protected doRemove(context: ContextInfo, model: KnModel): Promise; doRemoving(context: ContextInfo, db: DBConnector): Promise; deleteActivation(db: DBConnector, info: ActivateInfo, context?: any): Promise; protected doRemoval(context: ContextInfo, model: KnModel): Promise; doRemovaling(context: ContextInfo, db: DBConnector): Promise; performRemovaling(db: DBConnector, info: ActivateInfo, context?: any): Promise; performRemoval(db: DBConnector, info: ActivateInfo, context?: any): Promise; } export declare class AssureHandler { static isExceptPath(req: any): boolean; static doAuthorizeFilter(ctx: ContextInfo, req: any): Promise; static doAuthenticateFilter(ctx: ContextInfo, req: any): Promise; static doAuthorize(ctx: ContextInfo): Promise; static doAuthenticate(ctx: ContextInfo): Promise; } export declare class AttachHandler extends SchemeHandler { model: KnModel; handlers: { name: string; }[]; get(context: ContextInfo): Promise; protected doGet(context: ContextInfo, model: KnModel): Promise; attach(context: ContextInfo): Promise; protected doAttach(context: ContextInfo, model: KnModel): Promise; } export declare class AuthenticateHandler extends SchemeHandler { model: KnModel; handlers: { name: string; }[]; authenticate(context: ContextInfo): Promise; protected doAuthenticate(context: ContextInfo, model: KnModel): Promise; } export declare class AuthorizeHandler extends SchemeHandler { model: KnModel; handlers: { name: string; }[]; authorize(context: ContextInfo): Promise; doAuthorize(context: ContextInfo, model: KnModel): Promise; getAuthorizeTokenInfo(db: DBConnector, token: string): Promise; getAuthorizeToken(db: DBConnector, atoken: AuthenTokenData, verifyTokenNotFound?: boolean, verifyAnonymousToken?: boolean): Promise; } export declare class BaseHandler extends KnHandler { accessor?: Accessor; section: string; constructor(model?: KnModel, settings?: KnSetting, accessor?: Accessor); protected getAccessor(conn: DBConnector, useruuid: string): Promise; protected retainAccessor(conn: DBConnector, useruuid: string): Promise; protected getHeaderParameter(context: ContextInfo, parameterName: string): string | undefined; protected isInPageSetting(key: string, model: KnModel): boolean; getCurrentUser(): string; getAuthorizationInfo(context: ContextInfo): AuthorizationInfo | undefined; getTokenKey(context: ContextInfo): string | undefined; getUserTokenInfo(context: ContextInfo, onlyMeta?: boolean, db?: DBConnector): Promise; getUserTokenInfoByToken(context: ContextInfo, db?: DBConnector): Promise; getUserDiffie(userInfo: UserTokenInfo | undefined, verifyHandShaked?: boolean, uncheckTokenStatus?: boolean): Promise; getUserDH(context: ContextInfo, verifyHandShaked?: boolean, uncheckTokenStatus?: boolean): Promise; getAuthenToken(context: ContextInfo, verifyTokenKey?: boolean, verifyIdentifier?: boolean): Promise; verifyAuthenToken(token?: string, verifyTokenKey?: boolean, verifyIdentifier?: boolean): Promise; exposeContext(context: ContextInfo, includeChiperData?: boolean): Promise; isCipherData(context: ContextInfo): boolean; isCipherText(context: ContextInfo): boolean; isCipherDataAccept(context: ContextInfo): boolean; isCipherTextAccept(context: ContextInfo): boolean; /** * try to encrypt data if found user DH * @param context * @param data * @returns cipher string */ encryptData(context: ContextInfo, data?: any, verifyHandShaked?: boolean): Promise; /** * try to encrypt data when header accept-type is json/cipher * @param context * @param data * @returns json format { data: ? } */ cipherData(context: ContextInfo, data?: any, verifyHandShaked?: boolean): Promise; /** * try to encrypt data when header accept-type is text/cipher * @param context * @param data * @returns cipher string */ cipherText(context: ContextInfo, data?: any, verifyHandShaked?: boolean): Promise; createJSONReply(method: string, data?: any, model?: string): JSONReply; createCipherData(context: ContextInfo, method: string, data?: any, verifyHandShaked?: boolean, model?: string): Promise; validateAuthenToken(context: ContextInfo): Promise; validateParameters(params: any, ...args: string[]): ValidateInfo; recordNotFound(): Promise; notImplementation(): Promise; createRecordSet(result?: ResultSet): RecordSet; } export declare class CaptchaHandler extends SchemeHandler { model: KnModel; handlers: { name: string; }[]; verify(context: ContextInfo): Promise; protected doCreate(context: ContextInfo, model: KnModel): Promise; protected doVerify(context: ContextInfo, model: KnModel): Promise; } export declare class ChangePasswordHandler extends SchemeHandler { model: KnModel; handlers: { name: string; }[]; change(context: ContextInfo): Promise; policy(context: ContextInfo): Promise<{ policy: string[]; }>; policies(context: ContextInfo): Promise; protected doChange(context: ContextInfo, model: KnModel): Promise; checkChangePassword(puserid: string, puserpass: string, pcnfpass: string): VerifyError | null; processChangePassword(db: DBConnector, puserid: string, puserpass: string, poldpass: string): Promise; changeUserPassword(db: DBConnector, userid: string, pwd: string, newpwd: string, site?: string, date?: Date): Promise; protected doPolicy(context: ContextInfo, model: KnModel): Promise<{ policy: string[]; }>; protected doPolicies(context: ContextInfo, model: KnModel): Promise; } export declare class DataTableHandler extends SchemeHandler { model: KnModel; handlers: { name: string; }[]; protected doGet(context: ContextInfo, model: KnModel): Promise; protected getDataSet(context: ContextInfo, model: KnModel): Promise; protected buildDataTableQuery(knsql: KnSQL, datasetting: DataTableSetting): void; fetchDataTable(db: DBConnector, setting: DataTableSetting, disableColumnSchema?: boolean, context?: any): Promise; /** * To get data table as array * @param db connection * @param datasettings * @param disableColumnSchema * @returns */ getDataTable(db: DBConnector, datasettings: DataTableSetting[], disableColumnSchema?: boolean, context?: any): Promise; fetchDataCategory(db: DBConnector, setting: DataMapEntitySetting, disableColumnSchema?: boolean, context?: any): Promise<[DataTableResultSet, DataMapEntitySetting]>; /** * To get data table as map * @param db connection * @param datasettings * @param disableColumnSchema * @returns */ getDataCategory(db: DBConnector, datasettings: DataMapEntitySetting[], disableColumnSchema?: boolean, context?: any): Promise; protected doList(context: any, model: KnModel): Promise; protected doFind(context: any, model: KnModel): Promise; category(context: ContextInfo): Promise; protected doCategory(context: ContextInfo, model: KnModel): Promise; config(context: ContextInfo): Promise; protected doConfig(context: ContextInfo, model: KnModel): Promise; } export declare class DiffieHandler extends SchemeHandler { model: KnModel; handlers: { name: string; }[]; dh(context: ContextInfo): Promise; diffie(context: ContextInfo): Promise; doDiffie(context: ContextInfo, model: KnModel): Promise; createDiffie(context: ContextInfo): Promise; createDiffieInfo(dh: DH): DiffieInfo; doSaveDiffie(context: ContextInfo, model: KnModel, dh: DH): Promise; saveDiffie(db: DBConnector, userInfo: UserTokenInfo, dh: DH, context?: any): Promise; protected doUpdate(context: any, model: KnModel): Promise; encrypt(context: ContextInfo): Promise; decrypt(context: ContextInfo): Promise; } export declare class ForgotPasswordHandler extends SchemeHandler { model: KnModel; handlers: { name: string; }[]; password(context: ContextInfo): Promise; protected doPassword(context: ContextInfo, model: KnModel): Promise; getUserInfoByEmail(db: DBConnector, email: string, context?: any): Promise; getUserInfoById(db: DBConnector, id: string, context?: any): Promise; composeMailMessage(db: DBConnector, record: any, eng?: boolean, template?: string, templatetype?: string): Promise<[string, TemplateInfo | undefined]>; performForgotPassword(context: ContextInfo, model: KnModel, db: DBConnector, userinfo: UserInfo, date?: Date): Promise; doSendMail(context: ContextInfo, model: KnModel, info: MailInfo): Promise; forgotPassword(db: DBConnector, info: UserInfo, date?: Date): Promise; } export declare class LabelHandler extends SchemeHandler { model: KnModel; handlers: { name: string; }[]; protected validateRequireFields(context: any, model: KnModel, action: string): Promise; protected doGet(context: ContextInfo, model: KnModel): Promise; protected doList(context: any, model: KnModel): Promise; } export declare class LoggingHandler extends BaseHandler { model: KnModel; trackInfo?: TrackingInfo; insert(context: any): Promise; protected doInsert(context: any, model: KnModel): Promise; } export declare class LoginHandler extends SchemeHandler { model: KnModel; handlers: { name: string; }[]; logincallback(context: ContextInfo): Promise; logoutcallback(context: ContextInfo): Promise; anonymouslogin(context: ContextInfo): Promise; protected doLoginCallback(context: ContextInfo, model: KnModel): Promise; processLogin(context: ContextInfo, db: DBConnector, useruuid: string, token: string): Promise; composeResponseInfo(row: any): LoginInfoContents; processLoginByNonce(context: ContextInfo, db: DBConnector, nonce: string, code: string): Promise; protected doLogoutCallback(context: ContextInfo, model: KnModel): Promise; processLogout(db: DBConnector, token: string, context?: any): Promise; doAnonymousLogin(context: ContextInfo, model: KnModel): Promise; saveAnonymousToken(context: ContextInfo, model: KnModel, authdata: AuthenTokenData, authtoken: string): Promise; } export declare class OneTimeHandler extends ActivateHandler { createActivateKey(): string; performInvalidating(db: DBConnector, info: ActivateInfo, invalidatetimes?: number): Promise; validateKeyFields(context: ContextInfo): ValidateInfo; updateActivation(db: DBConnector, info: ActivateInfo): Promise; protected doRemove(context: ContextInfo, model: KnModel): Promise; } export declare class PasswordPolicyHandler extends ChangePasswordHandler { protected doExecute(context: any, model: KnModel): Promise; } export declare class ProgramHandler extends SchemeHandler { model: KnModel; handlers: { name: string; }[]; protected doGet(context: ContextInfo, model: KnModel): Promise; protected doRetrieve(context: ContextInfo, model: KnModel): Promise; performRetrieving(context: ContextInfo, db: DBConnector): Promise; getDataSource(context: ContextInfo): Promise; } export declare class SchemeHandler extends SystemHandler { get(context: ContextInfo): Promise; edit(context: ContextInfo): Promise; html(context: ContextInfo): Promise; protected doEdit(context: ContextInfo, model: KnModel): Promise; protected doGet(context: ContextInfo, model: KnModel): Promise; protected doHtml(context: ContextInfo, model: KnModel): Promise; protected doClear(context: ContextInfo, model: KnModel): Promise; protected doCreate(context: ContextInfo, model: KnModel): Promise; protected doExecute(context: ContextInfo, model: KnModel): Promise; protected doList(context: ContextInfo, model: KnModel): Promise; protected doFind(context: ContextInfo, model: KnModel): Promise; protected doInsert(context: ContextInfo, model: KnModel): Promise; protected doRetrieve(context: ContextInfo, model: KnModel): Promise; protected doUpdate(context: ContextInfo, model: KnModel): Promise; protected doRemove(context: ContextInfo, model: KnModel): Promise; protected doCollect(context: ContextInfo, model: KnModel): Promise; } export declare class SigninHandler extends SchemeHandler { model: KnModel; handlers: { name: string; }[]; protected getSigninInfo(context: ContextInfo): SigninInfo; signin(context: ContextInfo): Promise; protected doSignin(context: ContextInfo, model: KnModel): Promise; doSigninByDomain(context: ContextInfo, model: KnModel, signinfo: SigninInfo, db: DBConnector): Promise; doSigninByConfigure(context: ContextInfo, model: KnModel, signinfo: SigninInfo, db: DBConnector): Promise; processTwoFactor(context: ContextInfo, db: DBConnector, row: any): Promise; processSigninInternalSystem(context: ContextInfo, model: KnModel, signinfo: SigninInfo, db: DBConnector, loginfo?: Object): Promise; processSigninActiveDirectory(context: ContextInfo, model: KnModel, signinfo: SigninInfo, db: DBConnector, config?: ActiveConfig, loginfo?: Object): Promise; processSigninPromptSystem(context: ContextInfo, model: KnModel, signinfo: SigninInfo, db: DBConnector, config?: PromptConfig, loginfo?: Object): Promise; composeResponseBody(body: Map, token: UserToken, username: string, row: any, tempmatch?: boolean, dhinfo?: DiffieInfo): void; createUserAccess(db: DBConnector, usrinfo: UserAccessInfo, context?: any): Promise; createUserToken(db: DBConnector, usrinfo: UserAccessInfo, useruuid: string, authtoken: string, tokentype?: string, expireins?: number, context?: any): Promise; createDiffie(context: ContextInfo, db: DBConnector, token: UserToken): Promise; updateUserAccessing(context: ContextInfo, model: KnModel, info: AccessingInfo): Promise; updateUserAccess(db: DBConnector, userid: string, context?: any): Promise; updateUserLock(db: DBConnector, username: string, lockflag: string, context?: any): Promise; accesstoken(context: ContextInfo): Promise>; account(context: ContextInfo): Promise>; protected doAccessToken(context: ContextInfo, model: KnModel): Promise>; processAccessToken(db: DBConnector, useruuid: string, fetching?: boolean, context?: any): Promise>; fetchtoken(context: ContextInfo): Promise>; protected doFetchToken(context: ContextInfo, model: KnModel): Promise>; signout(context: ContextInfo): Promise>; doSignout(context: ContextInfo, model: KnModel): Promise>; processSignout(db: DBConnector, useruuid: string, context?: any): Promise>; loginWow(userid: string, pwd: string, site?: string): Promise; validatetoken(context: ContextInfo): Promise; } export declare class SystemHandler extends BaseHandler { protected exposeOperation(context: any, model: KnModel, operation: OperationInfo): Promise; callFunctional(context: ContextInfo, info: FunctionalInfo, functional: Function): Promise; track(context: ContextInfo, info: TrackingInfo): Promise; } export declare class TwoFactorHandler extends SchemeHandler { model: KnModel; handlers: { name: string; }[]; factorInfo: FactorInfo | undefined; generate(context: ContextInfo): Promise; verify(context: ContextInfo): Promise; confirm(context: ContextInfo): Promise; createFactorInfo(data: any): FactorInfo; genterateFactor(info: FactorInfo): Promise; verifyFactor(info: FactorInfo, factorcode: string): Promise; composeFactorUri(info: any): string; doGenerate(context: ContextInfo, model: KnModel): Promise; doGenerating(context: ContextInfo, db: DBConnector, findByUser?: boolean): Promise; doVerify(context: ContextInfo, model: KnModel): Promise; doVerifying(context: ContextInfo, db: DBConnector, findByUser?: boolean): Promise; doGet(context: ContextInfo, model: KnModel): Promise; doConfirm(context: ContextInfo, model: KnModel): Promise; doConfirming(context: ContextInfo, db: DBConnector): Promise; validateRequireFields(context: ContextInfo, model: KnModel, action?: string): Promise; doRetrieve(context: ContextInfo, model: KnModel): Promise; doRetrieving(context: ContextInfo, db: DBConnector): Promise; performRetrieving(db: DBConnector, id: string, findByUser?: boolean, context?: any): Promise; getFactorInfo(db: DBConnector, id: string, findByUser?: boolean, context?: any): Promise; getConfigure(db: DBConnector, context?: any): Promise; doCreate(context: ContextInfo, model: KnModel): Promise; doClear(context: ContextInfo, model: KnModel): Promise; doInsert(context: ContextInfo, model: KnModel): Promise; doUpdate(context: ContextInfo, model: KnModel): Promise; doRemove(context: ContextInfo, model: KnModel): Promise; performCreating(context: any, model: KnModel, db: DBConnector): Promise; performCreateFactor(context: any, db: DBConnector, data: any): Promise; performClearing(context: any, model: KnModel, db: DBConnector): Promise; createFactor(db: DBConnector, info: FactorInfo, edituser?: string, context?: any): Promise; deleteFactor(db: DBConnector, factorid: string, context?: any): Promise; removeFactor(db: DBConnector, factorid: string, context?: any): Promise; moveToHistory(db: DBConnector, factorid: string, context?: any): Promise; confirmFactor(db: DBConnector, factorid: string, edituser?: string, context?: any): Promise; updateUserFactor(db: DBConnector, useruuid: string, factorcode: string, context?: any): Promise; } export declare class Accessor { readonly useruuid: string; readonly userid: string; readonly authtoken: string; readonly userinfo?: any; constructor(useruuid: string, userid: string, authtoken: string, userinfo?: any); } export const RESERVED_PARAMETERS: string[] = ["program", "subprog", "language", "authtoken", "action", "caption", "ciphertext"]; export const RESERVED_FIELDS: string[] = ["authtoken","ciphertext","language","tokenkey"]; export const INSERT_MODES = ["create", "insert", "add", "entry", "enter", "entrance"]; export const UPDATE_MODES = ["retrieve", "find", "list", "get", "query", "view", "search", "retrieval", "edit", "update", "modify"]; export const RETRIEVE_MODES = ["retrieve", "get", "retrieval", "edit", "view", "query"]; export const DELETE_MODES = ["delete", "remove", "reset", "erase", "clear"]; export const COLLECT_MODES = ["collect", "find", "list", "query", "search", "inquiry", "enquiry"]; export interface LoginInfoContents { authToken: string; userUuid: string; textures: any[]; email: string; displayName: string; userPrincipalName: string; userContents: any; accessContents: any; info?: any; } export interface LogoutInfoContents { authToken: string; } export interface AnonymousInfoContents { userUuid: string; authToken: string; } export interface ContextInfo { params: any; meta: any; options?: any; } export interface AuthorizationInfo { authorization: string; client?: string; } export interface SigninInfo { username: string; password: string; site?: string; } export interface DiffieInfo { prime: string; generator: string; publickey: string; } export interface UserAccessInfo { userid: string; site?: string; code?: string; state?: string; nonce?: string; loginfo?: Object; } export interface AccessingInfo { userid?: string; username?: string; lockflag?: string; } export interface CipherData { data: string; } export interface ValidateInfo { valid: boolean; info?: string; options?: any; } export interface DataSet { [name: string]: any; } export interface DataEntity { [name: string]: DataSet; } export interface DataTable { action: string; dataset: DataSet; entity: DataEntity | Array; meta?: DataSet; renderer?: string; error?: any; } export interface DataTableSetting { tableName: string; keyField: string; addonFields?: string; orderFields?: string; checkActive?: boolean; checkSite?: boolean; siteOnly?: boolean; addonFilters?: string; captionFields?: string; nameen?: string; nameth?: string; options?: any; } export interface DataTableResultSet { tablename: string; resultset: ResultSet; options?: any; } export interface DataMapSetting { keyName: string; valueNames: string[]; groupId?: string; groupNames?: string[]; categoryName?: string; options?: any; } export interface DataMapEntitySetting extends DataTableSetting { setting?: DataMapSetting; } export interface DataMapRecordSetting extends DataTableResultSet { setting: DataMapSetting; } export interface FormatInfo { name?: string; value: any; rs?: any; field?: DBField; } export interface LabelItem { name: string; value: string; } export interface LabelData { language: string; label: LabelItem[]; } export interface FunctionalInfo extends OperationInfo { raw: boolean; } export interface TemplateInfo { subjecttitle: string; contents: string; contexts: string; info?: any; } export interface UserInfo { found: boolean; userid: string; email: string; site?: string; username?: string; userpassword?: string; usernameen?: string; usernameth?: string; info?: any; } export interface ActivateInfo { activatekey: string; activateuser: string; transtime: number; expiretime: number; activatecount: number; activatetimes: number; expiredate?: Date; activatecategory?: string; activatestatus?: string; activatelink?: string; activatepage?: string; activateremark?: string; activateparameter?: string; activatemessage?: string; activatecontents?: string; activatedate?: Date; activatetime?: Date; info?: any; } export interface FactorConfigInfo { factorconfig: boolean; factorverify: boolean; issuer: string; info?: any; } export interface FactorInfo extends FactorConfigInfo { userid: string; email: string; factorfound: boolean; factorid: string; factorkey: string; factorflag: string; factorurl?: string; factorremark?: string; factorimage?: string; } export interface FactorTokenInfo { valid: boolean; token: string; info?: any; } export interface FactorVerifyInfo { verified: boolean; delta: number; info?: any; } export declare class UserToken { useruuid: string; expiretimes: number; code: string; state: string; nonce: string; authtoken: string; constructor(useruuid: string, expiretimes: number, code: string, state: string, nonce: string, authtoken: string); } export declare class VerifyError extends Error { readonly code: number; readonly errno: number | undefined; readonly state: string | undefined; constructor(message: string, code: number, errno?: number, state?: string); } export declare abstract class BaseRouter { readonly service: Service; readonly logger: LoggerInterface; dir: string; constructor(service: Service, dir?: string); buildContext(req: Request, pid?: string): ContextInfo; createContext(req: Request, pid?: string): Promise; cipherData(context: ContextInfo, data?: any, verifyHandShaked?: boolean): Promise; cipherText(context: ContextInfo, data?: any, verifyHandShaked?: boolean): Promise; createCipherData(context: ContextInfo, method: string, data?: any, verifyHandShaked?: boolean, model?: string): Promise; call(serviceName: string, req: Request): Promise; authorize(req: Request): Promise; protected verifyToken(req: Request, res: Response): Promise; protected verifyAuthenToken(req: Request): Promise; protected getAuthorizeToken(req: Request): string | undefined; } export declare class CallbackRouter extends BaseRouter { doLoginCallback(req: Request, res: Response): Promise; doLogoutCallback(req: Request, res: Response): Promise; doAnonymousLogin(req: Request, res: Response): Promise; doSignin(req: Request, res: Response): Promise; doFetchToken(req: Request, res: Response): Promise; doAccessToken(req: Request, res: Response): Promise; doSignout(req: Request, res: Response): Promise; } export declare class DiffieRouter extends BaseRouter { doDiffie(req: Request, res: Response): Promise; doEncrypt(req: Request, res: Response): Promise; doDecrypt(req: Request, res: Response): Promise; doUpdate(req: Request, res: Response): Promise; } export declare class UploadRouter extends BaseRouter { private fileuploader; private uploadfile; constructor(service: Service, dir?: string, paramname?: string, fileTypes?: RegExp, fileSize?: number); private buildMulter; doUpload(req: Request, res: Response): void; protected doUploadFile(req: Request, res: Response): Promise; } export declare class LabelConfig { configname: string; language: string; label: DataEntity; constructor(configname: string, language?: string); load(workdir?: string, labelpath?: string): Promise; get(key: string, defaultLabel?: string, language?: string): any; } export declare class LabelUtility { labelname: string; constructor(labelname: string); load(workdir?: string, labelpath?: string): Promise; build(ary: LabelData[]): DataEntity; loadAndBuild(workdir?: string, labelpath?: string): Promise; } export declare class NotifyConfig { getConfigValue(db: DBConnector, category: string, colname: string, context?: any): Promise; getConfigCategory(db: DBConnector, category: string, context?: any): Promise; getApproveURL(db: DBConnector, context?: any): Promise; getActivateURL(db: DBConnector, context?: any): Promise; getConfigTemplate(db: DBConnector, template: string, templatetype: string, context?: any): Promise; isVerifyConfig(db: DBConnector, category: string, colname: string, context?: any): Promise; } export declare class PageUtility { progid: string; context: ContextInfo; constructor(progid: string, context: ContextInfo); isEnglish(): boolean; isThai(): boolean; isLanguage(language: string): boolean; isExecuteMode(mode: string): boolean; isInsertMode(mode?: string): boolean; isUpdateMode(mode?: string): boolean; isRetrieveMode(mode?: string): boolean; isDeleteMode(mode?: string): boolean; isCollectMode(mode?: string): boolean; format(info: FormatInfo): any; checked(checker: string, value: any): string; selected(checker: string, value: any): string; } export declare class Responser { static createError(model: string, method: string, err: any): JSONReply; static createDbError(model: string, method: string, err: any): JSONReply; static responseError(res: Response, err: any, model: string, method: string): void; } export declare class TheUtility { static createMapEntities(rs: ResultSet, setting: DataMapSetting): Map; static createDataEntity(records: DataMapRecordSetting[]): DataEntity; static getDefaultLanguage(context?: any): string; static isEnglish(context: any): boolean; static isThai(context: any): boolean; static isLanguage(context: any, language: string): boolean; static isReservedParameter(parameter: string): boolean; static transformData(rs: any, fields?: FieldSetting, formatter?: Function): DataSet; static formatData(info: FormatInfo): any; }