UNPKG

logto-auth-node-sdk

Version:

A comprehensive Logto authentication client library with circuit breaker pattern support

40 lines (39 loc) 2.58 kB
import { LogtoConfig, OrganizationResponse, UserResponse } from './types/logto-types'; import { LogtoCreateOrganizationDto } from './dto/logto-create-organization.dto'; import { LogtoCreateUserDto } from './dto/logto-create-user.dto'; import { LogtoUpdateUserPasswordDto } from './dto/logto-update-user-password.dto'; import { LogtoUpdateUserDto } from './dto/logto-update-user.dto'; import { LogtoUpdateOrganizationDto } from './dto/logto-update-organization.dto'; import { LogtoAddUsersToOrganizationDto } from './dto/logto-add-users-to-organization.dto'; import { LogtoVerifyUserPasswordDto } from './dto/logto-verify-user-password.dto'; import { LogtoUpdateUserCustomDataDto } from './dto/logto-update-user-custom-data.dto'; import { LogtoUpdateUserSuspensionDto } from './dto/logto-update-user-suspension.dto'; export declare class LogtoClient { private config; private readonly axiosInstance; private readonly circuitBreaker; private accessToken; private tokenExpiresAt; constructor(config: LogtoConfig); private initCircuits; private getAccessToken; private getHeaders; private executeWithBackoff; createOrganization(organizationData: LogtoCreateOrganizationDto): Promise<OrganizationResponse>; getOrganization(organizationId: string): Promise<OrganizationResponse>; updateOrganization(organizationId: string, organizationData: LogtoUpdateOrganizationDto): Promise<OrganizationResponse>; deleteOrganization(organizationId: string): Promise<void>; addUsersToOrganization(organizationId: string, userData: LogtoAddUsersToOrganizationDto): Promise<void>; removeUserFromOrganization(organizationId: string, userId: string): Promise<void>; createUser(userData: LogtoCreateUserDto): Promise<UserResponse>; getUser(userId: string): Promise<UserResponse>; updateUser(userId: string, userData: LogtoUpdateUserDto): Promise<UserResponse>; deleteUser(userId: string): Promise<void>; updateUserPassword(userId: string, passwordData: LogtoUpdateUserPasswordDto): Promise<void>; verifyUserPassword(userId: string, passwordData: LogtoVerifyUserPasswordDto): Promise<boolean>; updateUserSuspensionStatus(userId: string, suspensionData: LogtoUpdateUserSuspensionDto): Promise<UserResponse>; updateUserCustomData(userId: string, customData: LogtoUpdateUserCustomDataDto): Promise<UserResponse>; getCircuitBreakerStatus(circuitName: string): import(".").Circuit | undefined; getAllCircuitBreakers(): Map<string, import(".").Circuit>; resetCircuitBreaker(circuitName: string): void; }