casdoor-nodejs-sdk
Version:
Node.js client SDK for Casdoor
60 lines (59 loc) • 1.8 kB
TypeScript
import { AxiosResponse } from 'axios';
import { Config } from './config';
import Request from './request';
interface AccountItem {
name: string;
visible: boolean;
viewRule: string;
modifyRule: string;
}
export interface ThemeData {
themeType: string;
colorPrimary: string;
borderRadius: number;
isCompact: boolean;
isEnabled: boolean;
}
interface MfaItem {
name: string;
rule: string;
}
export interface Organization {
owner: string;
name: string;
createdTime: string;
displayName: string;
websiteUrl: string;
favicon?: string;
passwordType: string;
passwordSalt?: string;
passwordOptions?: string[];
countryCodes?: string[];
defaultAvatar?: string;
defaultApplication?: string;
tags?: string[];
languages?: string[];
themeData?: ThemeData;
masterPassword?: string;
initScore: number;
enableSoftDeletion: boolean;
isProfilePublic: boolean;
mfaItems?: MfaItem[];
accountItems?: AccountItem[];
}
export declare class OrganizationSDK {
private config;
private readonly request;
constructor(config: Config, request: Request);
getOrganizations(): Promise<AxiosResponse<{
data: Organization[];
}, any>>;
getOrganization(id: string): Promise<AxiosResponse<{
data: Organization;
}, any>>;
modifyOrganization(method: string, organization: Organization): Promise<AxiosResponse<Record<string, unknown>, any>>;
addOrganization(organization: Organization): Promise<AxiosResponse<Record<string, unknown>, any>>;
updateOrganization(organization: Organization): Promise<AxiosResponse<Record<string, unknown>, any>>;
deleteOrganization(organization: Organization): Promise<AxiosResponse<Record<string, unknown>, any>>;
}
export {};