import { RichInfo } from './RichInfo'; import { QualifiedUserPreKeyBundleMap } from './UserPreKeyBundleMap'; import { BackendFeatures } from '../APIClient'; import { ClientPreKey, PreKeyBundle } from '../auth/'; import { VerificationActionType } from '../auth/VerificationActionType'; import { PublicClient, QualifiedPublicClients } from '../client/'; import { QualifiedUserClients } from '../conversation/'; import { HttpClient, RequestCancelable } from '../http/'; import { CONVERSATION_PROTOCOL } from '../team'; import { Activate, ActivationResponse, CheckHandles, CompletePasswordReset, HandleInfo, LimitedQualifiedUserIdList, NewPasswordReset, QualifiedHandle, QualifiedId, SearchResult, SendActivationCode, User, VerifyDelete } from '../user/'; type PrekeysResponse = { qualified_user_client_prekeys: QualifiedUserPreKeyBundleMap; failed_to_list?: QualifiedId[]; }; type UsersReponse = { found: User[]; failed?: QualifiedId[]; not_found?: QualifiedId[]; }; export declare class UserAPI { private readonly client; private readonly backendFeatures; static readonly DEFAULT_USERS_CHUNK_SIZE = 50; static readonly DEFAULT_USERS_PREKEY_BUNDLE_CHUNK_SIZE = 128; static readonly URL: { ACTIVATE: string; BY_HANDLE: string; CALLS: string; CLIENTS: string; CONFIG: string; CONTACTS: string; DELETE: string; EMAIL: string; HANDLES: string; LIST_CLIENTS: string; LIST_PREKEYS: string; LIST_USERS: string; PASSWORD_RESET: string; PRE_KEYS: string; PROPERTIES: string; RICH_INFO: string; SEARCH: string; SEND: string; USERS: string; V2: string; VERIFICATION: string; SUPPORTED_PROTOCOLS: string; }; constructor(client: HttpClient, backendFeatures: BackendFeatures); /** * Clear all properties. * @see https://staging-nginz-https.zinfra.io/swagger-ui/#!/users/clearProperties */ deleteProperties(): Promise; /** * Delete a property. * @param propertyKey The property key to delete * @see https://staging-nginz-https.zinfra.io/swagger-ui/#!/users/deleteProperty */ deleteProperty(propertyKey: string): Promise; /** * Activate (i.e. confirm) an email address. * @param activationCode Activation code * @param activationKey Activation key * @see https://staging-nginz-https.zinfra.io/swagger-ui/#!/users/activate */ getActivation(activationCode: string, activationKey: string): Promise; /** * Retrieve TURN server addresses and credentials. * @see https://staging-nginz-https.zinfra.io/swagger-ui/#!/users/getCallsConfig */ getCallsConfiguration(): Promise; /** * Get a specific client of a user. * @param userId The user ID * @param clientId The client ID * @see https://staging-nginz-https.zinfra.io/swagger-ui/#!/users/getUserClient */ getClient(userId: QualifiedId, clientId: string): Promise; /** * Get a prekey for a specific client of a user. * @param userId The user ID * @param clientId The client ID * @see https://staging-nginz-https.zinfra.io/swagger-ui/#!/users/getPrekey */ getClientPreKey(userId: QualifiedId, clientId: string): Promise; /** * Get all of a user's clients. * @param userId The user ID * @see https://staging-nginz-https.zinfra.io/swagger-ui/#!/users/getUserClients */ getClients(userId: QualifiedId): Promise; /** * @deprecated use getSearchContacts instead * Get information on a user handle. * @param handle The user's handle * @see https://staging-nginz-https.zinfra.io/swagger-ui/#!/users/getUserHandleInfo */ getHandle(handle: string): Promise; /** * List all property keys. * @see https://staging-nginz-https.zinfra.io/swagger-ui/#!/users/listPropertyKeys */ getProperties(): Promise; /** * Get a property value. * @param propertyKey The property key to get * @see https://staging-nginz-https.zinfra.io/swagger-ui/#!/users/getProperty */ getProperty(propertyKey: string): Promise; /** * Search for users. * @param query The search query * @param domain The domain where the user should be hosted * @param limit Number of results to return * @see https://staging-nginz-https.zinfra.io/swagger-ui/#!/users/search */ getSearchContacts(query: string, limit?: number, domain?: string): Promise>; /** * Get a user by ID. * @note If you want to get all properties (`sso_id`, `managed_by`, etc.) for your own user, use "/self". * Otherwise you will get a user payload with a limited set of properties (what's publicly available). * @see https://staging-nginz-https.zinfra.io/swagger-ui/#!/users/user */ getUser(userId: string | QualifiedId): Promise; getUserPreKeys(userId: QualifiedId): Promise; getUserSupportedProtocols(userId: QualifiedId): Promise; /** * @deprecated use getUser, getSearchContacts or postListUsers instead * List users. * Note: The 'ids' and 'handles' parameters are mutually exclusive. * @param parameters Multiple user's handles or IDs * @see https://staging-nginz-https.zinfra.io/swagger-ui/#!/users/users */ getUsers(parameters: { ids: string[]; } | { handles: string[]; }, limit?: number): Promise; /** * List users. * @param userIds Multiple user's IDs * @see https://staging-nginz-https.zinfra.io/swagger-ui/#!/users/users */ getUsersByIds(userIds: string[]): Promise; /** * Check if a user ID exists. */ headUsers(userId: string | QualifiedId): Promise; /** * Activate (i.e. confirm) an email address. * Note: Activation only succeeds once and the number of failed attempts for a valid key is limited. * @param activationData Data to activate an account * @see https://staging-nginz-https.zinfra.io/swagger-ui/#!/users/activate_0 */ postActivation(activationData: Activate): Promise; /** * Send (or resend) an email activation code. * @param activationCodeData Data to send an activation code * @see https://staging-nginz-https.zinfra.io/swagger-ui/#!/users/sendActivationCode */ postActivationCode(activationCodeData: SendActivationCode): Promise; /** * Generates a verification code to be sent to the email address provided * @param email users email address * @param action whether the action is for a SCIM code generation or a user login */ postVerificationCode(email: string, action: VerificationActionType): Promise; /** * Verify account deletion with a code. * @param verificationData Data to verify the account deletion * @see https://staging-nginz-https.zinfra.io/swagger-ui/#!/users/verifyDeleteUser */ postDelete(verificationData: VerifyDelete): Promise; /** * Check availability of user handles. * @param handles The handles to check * @see https://staging-nginz-https.zinfra.io/swagger-ui/#!/users/checkUserHandles */ postHandles(handles: CheckHandles): Promise; /** * Check availability of a single user handle. * @param handle The handle to check * @see https://staging-nginz-https.zinfra.io/swagger-ui/#!/users/checkUserHandle */ headHandle(handle: string): Promise; /** * @deprecated use getSearchContacts instead * Get a user by fully qualified handle. * @param handle The handle of a user to search for */ getUserByHandle(handle: QualifiedHandle): Promise; private postMultiPreKeyBundlesChunk; /** * List users. * Note: The 'qualified_ids' and 'qualified_handles' parameters are mutually exclusive. */ postListUsers(users: { qualified_ids: QualifiedId[]; } | { qualified_handles: QualifiedHandle[]; }): Promise; /** * Get client infos from a list of users. */ postListClients(userIdList: LimitedQualifiedUserIdList): Promise; /** * Given a map of qualified user IDs to client IDs return a prekey for each one. * @param userClientMap A map of the qualified user's clients */ postMultiPreKeyBundles(userClientMap: QualifiedUserClients, limit?: number): Promise; /** * Initiate or complete a password reset. * @param resetData The data needed to initiate or complete the reset * @see https://staging-nginz-https.zinfra.io/swagger-ui/#!/users/beginPasswordReset * @see https://staging-nginz-https.zinfra.io/swagger-ui/#!/users/completePasswordReset */ postPasswordReset(resetData: NewPasswordReset | CompletePasswordReset): Promise; /** * Set a user property. * @param propertyKey The property key to set * @param propertyData The property data to set * @see https://staging-nginz-https.zinfra.io/swagger-ui/#!/users/setProperty */ putProperty(propertyKey: string, propertyData: T): Promise; /** * Get rich info of a user * @param userId The user ID * @see https://staging-nginz-https.zinfra.io/swagger-ui/#!/users/getRichInfo */ getRichInfo(userId: string): Promise; /** * Resend email address validation * @param userId The user ID * @see https://staging-nginz-https.zinfra.io/api/swagger-ui/#/default/put_users__uid__email */ putRevalidateEmail(userId: string, email: string): Promise; /** * Mark a user as searchable / non-searchable * @param userId * @param searchable * @see https://staging-nginz-https.zinfra.io/api/swagger-ui/#/default/post_users__uid__searchable */ postUserSearchable(userId: string, searchable: boolean): Promise; } export {}; //# sourceMappingURL=UserAPI.d.ts.map