UNPKG

@directus/sdk

Version:

Directus JavaScript SDK

76 lines (74 loc) 2.42 kB
import { RestCommand } from "../../types.cjs"; //#region src/rest/commands/utils/users.d.ts /** * Invite a new user by email. * * @param email User email to invite. * @param role Role of the new user. * @param invite_url Provide a custom invite url which the link in the email will lead to. The invite token will be passed as a parameter. * * @returns Nothing */ declare const inviteUser: <Schema>(email: string, role: string, invite_url?: string) => RestCommand<void, Schema>; /** * Accept your invite. The invite user endpoint sends the email a link to the Admin App. * * @param token Accept invite token. * @param password Password for the user. * * @returns Nothing */ declare const acceptUserInvite: <Schema>(token: string, password: string) => RestCommand<void, Schema>; /** * Register a new user. * * @param email The new user email. * @param password The new user password. * @param options Optional registration fields. * * @returns Nothing */ declare const registerUser: <Schema>(email: string, password: string, options?: { verification_url?: string; first_name?: string; last_name?: string; }) => RestCommand<void, Schema>; /** * Verify a registered user email using a token sent to the address. * * @param token Accept registration token. * * @returns Nothing */ declare const registerUserVerify: <Schema>(token: string) => RestCommand<void, Schema>; /** * Generates a secret and returns the URL to be used in an authenticator app. * * @param password The user's password. * * @returns A two-factor secret */ declare const generateTwoFactorSecret: <Schema>(password: string) => RestCommand<{ secret: string; otpauth_url: string; }, Schema>; /** * Adds a TFA secret to the user account. * * @param secret The TFA secret from tfa/generate. * @param otp OTP generated with the secret, to recheck if the user has a correct TFA setup * * @returns Nothing */ declare const enableTwoFactor: <Schema>(secret: string, otp: string) => RestCommand<void, Schema>; /** * Disables two-factor authentication by removing the OTP secret from the user. * * @param otp One-time password generated by the authenticator app. * * @returns Nothing */ declare const disableTwoFactor: <Schema>(otp: string) => RestCommand<void, Schema>; //#endregion export { acceptUserInvite, disableTwoFactor, enableTwoFactor, generateTwoFactorSecret, inviteUser, registerUser, registerUserVerify }; //# sourceMappingURL=users.d.cts.map