import { Service } from '../service'; import { Client } from '../client'; import type { Models } from '../models'; import { PasswordVersion } from '../enums/password-version'; import { ProviderType } from '../enums/provider-type'; export declare class Users extends Service { constructor(client: Client); /** * List users * * Get a list of all the project's users. You can use the query params to * filter your results. * * @param {string[]} queries * @param {string} search * @throws {AppwriteException} * @returns {Promise} */ list(queries?: string[], search?: string): Promise>; /** * Create user * * Create a new user. * * @param {string} userId * @param {string} email * @param {string} phone * @param {string} password * @param {string} name * @throws {AppwriteException} * @returns {Promise} */ create(userId: string, email?: string, phone?: string, password?: string, name?: string): Promise>; /** * Create user with Argon2 password * * Create a new user. Password provided must be hashed with the * [Argon2](https://en.wikipedia.org/wiki/Argon2) algorithm. Use the [POST * /users](https://appwrite.io/docs/server/users#usersCreate) endpoint to * create users with a plain text password. * * @param {string} userId * @param {string} email * @param {string} password * @param {string} name * @throws {AppwriteException} * @returns {Promise} */ createArgon2User(userId: string, email: string, password: string, name?: string): Promise>; /** * Create user with bcrypt password * * Create a new user. Password provided must be hashed with the * [Bcrypt](https://en.wikipedia.org/wiki/Bcrypt) algorithm. Use the [POST * /users](https://appwrite.io/docs/server/users#usersCreate) endpoint to * create users with a plain text password. * * @param {string} userId * @param {string} email * @param {string} password * @param {string} name * @throws {AppwriteException} * @returns {Promise} */ createBcryptUser(userId: string, email: string, password: string, name?: string): Promise>; /** * List Identities * * Get identities for all users. * * @param {string} queries * @param {string} search * @throws {AppwriteException} * @returns {Promise} */ listIdentities(queries?: string, search?: string): Promise; /** * Delete identity * * Delete an identity by its unique ID. * * @param {string} identityId * @throws {AppwriteException} * @returns {Promise} */ deleteIdentity(identityId: string): Promise<{}>; /** * Create user with MD5 password * * Create a new user. Password provided must be hashed with the * [MD5](https://en.wikipedia.org/wiki/MD5) algorithm. Use the [POST * /users](https://appwrite.io/docs/server/users#usersCreate) endpoint to * create users with a plain text password. * * @param {string} userId * @param {string} email * @param {string} password * @param {string} name * @throws {AppwriteException} * @returns {Promise} */ createMD5User(userId: string, email: string, password: string, name?: string): Promise>; /** * Create user with PHPass password * * Create a new user. Password provided must be hashed with the * [PHPass](https://www.openwall.com/phpass/) algorithm. Use the [POST * /users](https://appwrite.io/docs/server/users#usersCreate) endpoint to * create users with a plain text password. * * @param {string} userId * @param {string} email * @param {string} password * @param {string} name * @throws {AppwriteException} * @returns {Promise} */ createPHPassUser(userId: string, email: string, password: string, name?: string): Promise>; /** * Create user with Scrypt password * * Create a new user. Password provided must be hashed with the * [Scrypt](https://github.com/Tarsnap/scrypt) algorithm. Use the [POST * /users](https://appwrite.io/docs/server/users#usersCreate) endpoint to * create users with a plain text password. * * @param {string} userId * @param {string} email * @param {string} password * @param {string} passwordSalt * @param {number} passwordCpu * @param {number} passwordMemory * @param {number} passwordParallel * @param {number} passwordLength * @param {string} name * @throws {AppwriteException} * @returns {Promise} */ createScryptUser(userId: string, email: string, password: string, passwordSalt: string, passwordCpu: number, passwordMemory: number, passwordParallel: number, passwordLength: number, name?: string): Promise>; /** * Create user with Scrypt modified password * * Create a new user. Password provided must be hashed with the [Scrypt * Modified](https://gist.github.com/Meldiron/eecf84a0225eccb5a378d45bb27462cc) * algorithm. Use the [POST * /users](https://appwrite.io/docs/server/users#usersCreate) endpoint to * create users with a plain text password. * * @param {string} userId * @param {string} email * @param {string} password * @param {string} passwordSalt * @param {string} passwordSaltSeparator * @param {string} passwordSignerKey * @param {string} name * @throws {AppwriteException} * @returns {Promise} */ createScryptModifiedUser(userId: string, email: string, password: string, passwordSalt: string, passwordSaltSeparator: string, passwordSignerKey: string, name?: string): Promise>; /** * Create user with SHA password * * Create a new user. Password provided must be hashed with the * [SHA](https://en.wikipedia.org/wiki/Secure_Hash_Algorithm) algorithm. Use * the [POST /users](https://appwrite.io/docs/server/users#usersCreate) * endpoint to create users with a plain text password. * * @param {string} userId * @param {string} email * @param {string} password * @param {PasswordVersion} passwordVersion * @param {string} name * @throws {AppwriteException} * @returns {Promise} */ createSHAUser(userId: string, email: string, password: string, passwordVersion?: PasswordVersion, name?: string): Promise>; /** * Get user * * Get a user by its unique ID. * * @param {string} userId * @throws {AppwriteException} * @returns {Promise} */ get(userId: string): Promise>; /** * Delete user * * Delete a user by its unique ID, thereby releasing it's ID. Since ID is * released and can be reused, all user-related resources like documents or * storage files should be deleted before user deletion. If you want to keep * ID reserved, use the * [updateStatus](https://appwrite.io/docs/server/users#usersUpdateStatus) * endpoint instead. * * @param {string} userId * @throws {AppwriteException} * @returns {Promise} */ delete(userId: string): Promise<{}>; /** * Update email * * Update the user email by its unique ID. * * @param {string} userId * @param {string} email * @throws {AppwriteException} * @returns {Promise} */ updateEmail(userId: string, email: string): Promise>; /** * Update user labels * * Update the user labels by its unique ID. * * Labels can be used to grant access to resources. While teams are a way for * user's to share access to a resource, labels can be defined by the * developer to grant access without an invitation. See the [Permissions * docs](https://appwrite.io/docs/permissions) for more info. * * @param {string} userId * @param {string[]} labels * @throws {AppwriteException} * @returns {Promise} */ updateLabels(userId: string, labels: string[]): Promise>; /** * List user logs * * Get the user activity logs list by its unique ID. * * @param {string} userId * @param {string[]} queries * @throws {AppwriteException} * @returns {Promise} */ listLogs(userId: string, queries?: string[]): Promise; /** * List user memberships * * Get the user membership list by its unique ID. * * @param {string} userId * @throws {AppwriteException} * @returns {Promise} */ listMemberships(userId: string): Promise; /** * Update name * * Update the user name by its unique ID. * * @param {string} userId * @param {string} name * @throws {AppwriteException} * @returns {Promise} */ updateName(userId: string, name: string): Promise>; /** * Update password * * Update the user password by its unique ID. * * @param {string} userId * @param {string} password * @throws {AppwriteException} * @returns {Promise} */ updatePassword(userId: string, password: string): Promise>; /** * Update phone * * Update the user phone by its unique ID. * * @param {string} userId * @param {string} number * @throws {AppwriteException} * @returns {Promise} */ updatePhone(userId: string, number: string): Promise>; /** * Get user preferences * * Get the user preferences by its unique ID. * * @param {string} userId * @throws {AppwriteException} * @returns {Promise} */ getPrefs(userId: string): Promise; /** * Update user preferences * * Update the user preferences by its unique ID. The object you pass is stored * as is, and replaces any previous value. The maximum allowed prefs size is * 64kB and throws error if exceeded. * * @param {string} userId * @param {object} prefs * @throws {AppwriteException} * @returns {Promise} */ updatePrefs(userId: string, prefs: object): Promise; /** * List user sessions * * Get the user sessions list by its unique ID. * * @param {string} userId * @throws {AppwriteException} * @returns {Promise} */ listSessions(userId: string): Promise; /** * Create session * * * @param {string} userId * @throws {AppwriteException} * @returns {Promise} */ createSession(userId: string): Promise; /** * Delete user sessions * * Delete all user's sessions by using the user's unique ID. * * @param {string} userId * @throws {AppwriteException} * @returns {Promise} */ deleteSessions(userId: string): Promise<{}>; /** * Delete user session * * Delete a user sessions by its unique ID. * * @param {string} userId * @param {string} sessionId * @throws {AppwriteException} * @returns {Promise} */ deleteSession(userId: string, sessionId: string): Promise<{}>; /** * Update user status * * Update the user status by its unique ID. Use this endpoint as an * alternative to deleting a user if you want to keep user's ID reserved. * * @param {string} userId * @param {boolean} status * @throws {AppwriteException} * @returns {Promise} */ updateStatus(userId: string, status: boolean): Promise>; /** * List User Targets * * * @param {string} userId * @param {string} queries * @throws {AppwriteException} * @returns {Promise} */ listTargets(userId: string, queries?: string): Promise; /** * Create User Target * * * @param {string} userId * @param {string} targetId * @param {ProviderType} providerType * @param {string} identifier * @param {string} providerId * @param {string} name * @throws {AppwriteException} * @returns {Promise} */ createTarget(userId: string, targetId: string, providerType: ProviderType, identifier: string, providerId?: string, name?: string): Promise; /** * Get User Target * * * @param {string} userId * @param {string} targetId * @throws {AppwriteException} * @returns {Promise} */ getTarget(userId: string, targetId: string): Promise; /** * Update User target * * * @param {string} userId * @param {string} targetId * @param {string} identifier * @param {string} providerId * @param {string} name * @throws {AppwriteException} * @returns {Promise} */ updateTarget(userId: string, targetId: string, identifier?: string, providerId?: string, name?: string): Promise; /** * Delete user target * * * @param {string} userId * @param {string} targetId * @throws {AppwriteException} * @returns {Promise} */ deleteTarget(userId: string, targetId: string): Promise<{}>; /** * Create token * * Returns a custom token with a secret key for creating a session. If the * provided user ID has not be registered, a new user will be created. Use the * returned user ID and secret and submit a request to the [PUT * /account/sessions/custom](https://appwrite.io/docs/references/cloud/client-web/account#updateCustomSession) * endpoint to complete the login process. By default, the secret sent in the * response is valid for 15 minutes. * * @param {string} userId * @param {number} length * @param {number} expire * @throws {AppwriteException} * @returns {Promise} */ createToken(userId: string, length?: number, expire?: number): Promise; /** * Update email verification * * Update the user email verification status by its unique ID. * * @param {string} userId * @param {boolean} emailVerification * @throws {AppwriteException} * @returns {Promise} */ updateEmailVerification(userId: string, emailVerification: boolean): Promise>; /** * Update phone verification * * Update the user phone verification status by its unique ID. * * @param {string} userId * @param {boolean} phoneVerification * @throws {AppwriteException} * @returns {Promise} */ updatePhoneVerification(userId: string, phoneVerification: boolean): Promise>; }