UNPKG

2n-helios-client

Version:

2n client for Node

41 lines (40 loc) 1.6 kB
declare class Helios { #private; ip: string; user: string; pass: string; constructor(params: { ip: string; user: string; pass: string; }); /** Gets a log of successful entries within the specified days. */ log: (days?: number) => Promise<any>; /** Gets the status of the specified entry switch. */ status: (sw?: number) => Promise<"Temporarily Opened" | "Unlocked" | "Locked" | undefined>; /** Opens, locks or unlocks the specified entry switch. */ switch: (action: "open" | "lock" | "unlock", sw?: number) => Promise<true | undefined>; /** Gets all users. */ getUsers: () => Promise<any>; /** Gets a specified user based on it's uuid. */ getUser: (id: string) => Promise<any>; removeUser: (id: string) => Promise<true | undefined>; /** Updates a specified user's access pin or fingerprint. */ updateUserAccess: (id: string, params: { pin: number; fpt: string; }) => Promise<true | undefined>; /** Adds a new user. */ addUser: (name: string, email: string, params: { pin: number; fpt: string; }, uuid: number) => Promise<{ success: boolean; id: any; } | undefined>; /** Remove a stored fingerprint for a user. */ removeBio: (id: string, finger: number) => Promise<any>; /** Starts fingerprint enrollment and updates the specified user if successful. */ enrollBio: (id: string, finger: number | undefined, reader: number | undefined, callback: (state: number) => number) => Promise<void>; } export default Helios;