casdoor-nodejs-sdk
Version:
Node.js client SDK for Casdoor
81 lines (80 loc) • 2.42 kB
TypeScript
import { Provider } from './provider';
import { Organization, ThemeData } from './organization';
import { AxiosResponse } from 'axios';
import { Config } from './config';
import Request from './request';
interface ProviderItem {
owner: string;
name: string;
canSignUp: boolean;
canSignIn: boolean;
canUnlink: boolean;
prompted: boolean;
alertType: string;
rule: string;
provider?: Provider;
}
interface SignupItem {
name: string;
visible: boolean;
required: boolean;
prompted: boolean;
rule: string;
}
export interface Application {
owner: string;
name: string;
createdTime: string;
displayName: string;
logo: string;
homepageUrl: string;
description: string;
organization: string;
cert?: string;
enablePassword?: boolean;
enableSignUp?: boolean;
enableSigninSession?: boolean;
enableCodeSignin?: boolean;
enableAutoSignin?: boolean;
enableSamlCompress?: boolean;
enableWebAuthn?: boolean;
enableLinkWithEmail?: boolean;
orgChoiceMode?: string;
samlReplyUrl?: string;
providers?: ProviderItem[];
signupItems?: SignupItem[];
grantTypes?: string[];
organizationObj?: Organization;
tags?: string[];
clientId?: string;
clientSecret?: string;
redirectUris?: string[];
tokenFormat?: string;
tokenFields?: string[];
expireInHours?: number;
refreshExpireInHours?: number;
signupUrl?: string;
signinUrl?: string;
forgetUrl?: string;
affiliationUrl?: string;
termsOfUse?: string;
signupHtml?: string;
signinHtml?: string;
themeData?: ThemeData;
}
export declare class ApplicationSDK {
private config;
private readonly request;
constructor(config: Config, request: Request);
getApplications(): Promise<AxiosResponse<{
data: Application[];
}, any>>;
getApplication(name: string): Promise<AxiosResponse<{
data: Application;
}, any>>;
modifyApplication(method: string, application: Application): Promise<AxiosResponse<Record<string, unknown>, any>>;
addApplication(application: Application): Promise<AxiosResponse<Record<string, unknown>, any>>;
updateApplication(application: Application): Promise<AxiosResponse<Record<string, unknown>, any>>;
deleteApplication(application: Application): Promise<AxiosResponse<Record<string, unknown>, any>>;
}
export {};