export default class AmeliaSendbird { /** * Main entrypoint for Gate API */ private GATE_API; /** * Response from loginToDashboard */ private last_login_at; private account_locked; private use_lock_30mins; private use_lock_90days_no_login; private use_lock_5times_wrong_pw; private use_pw_policy; private use_change_pw_every_90days; private token; /** * Response from verifyDashboardToken */ private organizations; private userInfo; /** * Cached applications from last * recovery from server */ private applications; /** * Cached users for this application / * organization */ private users; /** * Constructon */ constructor(); /** * Login to Sendbird Dashboard. * * @param userEmail Email to login user to Dashboard. * @param userPassword Password to login user to Dashboard. * @param callback (error: any, data: any) Data will contain: { * last_login_at: "2021-12-14 19:35:52", * account_locked: false, * use_lock_30mins: true, * use_lock_90days_no_login: false, * use_lock_5times_wrong_pw: false, * use_pw_policy: false, * use_change_pw_every_90days: false, * token: "..." * } */ loginToDashboard(userEmail: string, userPassword: string | null, callback: any): void; /** * Verify your token with Sendbird Dashboard. * Check if your session is valid. * * @param token Last token recovered from loginToDashboard(...) * @param callback (error: any, success: boolean) Success will be true * if the token is valid. */ verifyDashboardToken(token: string | null, callback: any): void; /** * Returns the token after a loginToDashboard(...) or * after calling verifyDashboardToken(...) * * @returns String with the last recovered token. */ getToken(): string | null; /** * Get all organisations (according your last login) * * @returns Aray with your Organizations. */ getOrganizations(): any[]; /** * Get your organisation's ID (according your last login) * * @returns String with the ID of your Sendbird organization. */ getOrgId(): any; /** * Get your organisation name (according your last login) * * @returns String with the name of your Sendbird organization. */ getOrgName(): any; /** * Returns the signed user after performing a loginToDashboard(...) * * @returns User object according to last login. */ getSignedUser(): any; /** * Get members of this organization (according to last login) * * @returns Array of members from your organization. */ getOrgMembers(): any; /** * Gets your last login time to Sendbird Dashboard. * * @returns Number with the timestamp of your last login. */ getLastLoginTime(): string | null; /** * Returns if your Sendbird account is locked or not. * * @returns Boolean value. True will indicate your Sendbird account is locked. */ getIsAccountLocked(): boolean; /** * Returns if your Sendbird account will be locked after 3o minutes of inactivity. * * @returns Boolean value. True means your account will be locked. */ getUseLock30mins(): boolean; /** * Returns if your Sendbird account will be locked after 90 days of no login. * * @returns Boolean value. True means your account will be locked after 90 days of no login. */ getUseLock90DaysNoLogin(): boolean; /** * Returns if your Sendbird account will be locked after 5 incorrect passwords. * * @returns Boolean value. True means your account will be locked after 5 incorrect passwords. */ getUseLock5TimesWrongPassword(): boolean; /** * Returns if your Sendbird account uses strict password policy. * * @returns Boolean value. True means your account needs a strong password. */ getUsePasswordPolicy(): boolean; /** * Returns if your Sendbird account needs to be reset every 90 days. * * @returns Boolean value. True means your account needs to change the passsword after 90 days. */ getUseChangePasswordEvery90Days(): boolean; /** * Get a list of my applications. * * @param callback (error: any, applications: Array) Returns all your Sendbird applications. */ getApplications(callback: any, nextUrl?: string | null): void; /** * Gets any application details. * Returns the value in the "application" parameter from the callback. * * @param applicationId Sendbird application (you must get one from www.sendbird.com) * @param callback Return value (error: any, application: any) */ getApplicationDetails(applicationId: string, callback: any): void; /** * Get details about current chat plan. * Data object in the callback contains the selected plan details. * * @param callback (error: any, data: any) */ getPlanDetails(callback: any): void; /** * Get ALL users in your organization. * You will ask for the first 100 users. * "users" return value will contain "results", "next" and "prv". * If you want more users, send us the "next" URL. * * @param applicationId You Sendbird application ID. * @param userCount Total users to retrieve from Sendbird servers. * @param callback (error: any, users: Array) * @param next URL you must send if you have more users to retrieve. */ getUsers(applicationId: string, userCount: number, callback: any, next?: string): void; /** * Get users by nickname in your organization. * You will ask for the first 100 users. * "users" return value will contain "results", "next" and "prv". * If you want more users, send us the "next" URL. * * @param applicationId You Sendbird application ID. * @param nickname Nickname you want to recover. * @param userCount Total users to retrieve. * @param callback (error: any, users: Array) * @param next URL you must send if you have more users to retrieve. */ getUserByNickname(applicationId: string, nickname: string, userCount: number, callback: any, next?: string): void; /** * Get users by nickname (starts with) in your organization. * You will ask for the first 100 users. * "users" return value will contain "results", "next" and "prv". * If you want more users, send us the "next" URL. * * @param applicationId You Sendbird application ID. * @param nickname Nickname you want to recover. * @param userCount Total users to retrieve. * @param callback (error: any, users: Array) * @param next URL you must send if you have more users to retrieve. */ getUserByNicknameStartsWith(applicationId: string, nickname: string, userCount: number, callback: any, next?: string): void; private getOrganizationValue; }