import { AxiosResponse } from 'axios'; import { ALL_PERMISSIONS } from '../index'; import Entity from './shared/entity'; import { Event } from './shared/eventstore-client/EventstoreClient'; import { ServiceClientWithEventstore } from './shared/service-client/ServiceClientWithEventstore'; export interface MessageResponse { message: string; } export interface TokenResponse { token: string; } export interface IdentityProperties { custodian?: string | null; permissions?: ALL_PERMISSIONS; } export interface Identity extends Entity, IdentityProperties { } export interface GetIdentitiesResponse { identities: Identity[]; continuationToken?: string; } export interface GetIdentitiesRequest { limit?: number; continuationToken?: string; } export declare enum IdentityType { Admin = "Admin", User = "User", Custodian = "Custodian" } export interface ConnectIdentity extends Identity { type: IdentityType; } export declare enum ConnectionType { PASSWORDLESS = "PASSWORDLESS", USERNAME = "USERNAME" } export interface User { id: string; username: string; email?: string; phoneNumber?: string; nickname: string; name?: string; userMetadata: { [key: string]: string; }; appMetadata: { useMfa: boolean; identity: Pick & Partial; termsAccepted: boolean; }; connection?: ConnectionType; } export declare type CreateIdentity = IdentityProperties; export declare type UpdateIdentity = Partial; export declare type PERMISSIONS = typeof CREATE | typeof CREATE_SAME_CUSTODIAN | typeof CREATE_ANY | typeof CREATE_PERMISSIONS | typeof DELETE | typeof GET_ALL | typeof GET | typeof UPDATE | typeof UPDATE_PERMISSIONS | typeof UPDATE_ANY | typeof UPDATE_SAME_CUSTODIAN | typeof CREATE_API_KEY | typeof GET_EVENTS_ANY | typeof GET_EVENTS_CREATED | typeof GET_EVENTS_DELETED | typeof GET_EVENTS_UPDATED | typeof GENERATE_TOKEN; export declare const CREATE = "IDENTITY:CREATE"; export declare const CREATE_SAME_CUSTODIAN = "IDENTITY:CREATE:SAME_CUSTODIAN"; export declare const CREATE_ANY = "IDENTITY:CREATE:ANY"; export declare const CREATE_PERMISSIONS = "IDENTITY:CREATE:PERMISSIONS"; export declare const CREATE_API_KEY = "IDENTITY:CREATE:API_KEY"; export declare const DELETE = "IDENTITY:DELETE"; export declare const GET = "IDENTITY:GET"; export declare const GET_ALL = "IDENTITY:GET_ALL"; export declare const UPDATE = "IDENTITY:UPDATE"; export declare const UPDATE_SAME_CUSTODIAN = "IDENTITY:UPDATE:SAME_CUSTODIAN"; export declare const UPDATE_ANY = "IDENTITY:UPDATE:ANY"; export declare const UPDATE_PERMISSIONS = "IDENTITY:UPDATE:PERMISSIONS"; export declare const GET_EVENTS_ANY = "IDENTITY:GET_EVENTS:ANY"; export declare const GET_EVENTS_CREATED = "IDENTITY:GET_EVENTS:CREATED"; export declare const GET_EVENTS_DELETED = "IDENTITY:GET_EVENTS:DELETED"; export declare const GET_EVENTS_UPDATED = "IDENTITY:GET_EVENTS:UPDATED"; export declare const GENERATE_TOKEN = "IDENTITY:GENERATE_TOKEN"; export declare const PERMISSION_NAMES: { CREATE: string; CREATE_SAME_CUSTODIAN: string; CREATE_ANY: string; CREATE_PERMISSIONS: string; DELETE: string; GET: string; GET_ALL: string; UPDATE: string; UPDATE_PERMISSIONS: string; UPDATE_ANY: string; UPDATE_SAME_CUSTODIAN: string; CREATE_API_KEY: string; GET_EVENTS_ANY: string; GET_EVENTS_CREATED: string; GET_EVENTS_DELETED: string; GET_EVENTS_UPDATED: string; GENERATE_TOKEN: string; }; export interface CreatedEvent extends Event { type: 'CREATED'; data: Identity; } export interface UpdatedEvent extends Event { type: 'UPDATED'; data: UpdateIdentity; } export interface DeletedEvent extends Event { type: 'DELETED'; } export declare type IdentityEvents = CreatedEvent | DeletedEvent | UpdatedEvent; export declare class IdentityClient extends ServiceClientWithEventstore { getAll(options?: GetIdentitiesRequest): Promise>; get(identityId: string): Promise>; create(newIdentity: CreateIdentity): Promise>; createApiKey(identityId: string): Promise>; update(identityId: string, updateIdentity: UpdateIdentity): Promise>; delete(identityId: string): Promise>; generateToken(identityId: string): Promise>; acceptTerms(): Promise>; searchPasswordless(phoneOrEmail: string): Promise>; }