UNPKG

casdoor-nodejs-sdk

Version:
38 lines (37 loc) 1.18 kB
import { AxiosResponse } from 'axios'; import { User } from './user'; import { Config } from './config'; import Request from './request'; export interface Model { owner: string; name: string; createdTime: string; updatedTime?: string; displayName: string; manager?: string; contactEmail?: string; type?: string; parentId?: string; isTopModel?: boolean; users?: User[]; title?: string; key?: string; children?: Model[]; isEnabled?: boolean; modelText: string; } export declare class ModelSDK { private config; private readonly request; constructor(config: Config, request: Request); getModels(): Promise<AxiosResponse<{ data: Model[]; }, any>>; getModel(id: string): Promise<AxiosResponse<{ data: Model; }, any>>; modifyModel(method: string, model: Model): Promise<AxiosResponse<Record<string, unknown>, any>>; addModel(model: Model): Promise<AxiosResponse<Record<string, unknown>, any>>; updateModel(model: Model): Promise<AxiosResponse<Record<string, unknown>, any>>; deleteModel(model: Model): Promise<AxiosResponse<Record<string, unknown>, any>>; }