@del-internet/sdk-radius
Version:
TypeScript package to interacts with radius service
38 lines (37 loc) • 1.82 kB
TypeScript
import AvonClient from '@avonjs/client';
import type { Connection, CreatePayload, Debugger, ProfilePayload, UpdatePayload, User } from './types';
export default class Client {
protected config: Connection;
protected debugger: Debugger;
constructor(config: Connection);
protected get client(): AvonClient;
paginate(page?: number, perPage?: number, filters?: Record<string, string>): Promise<{
data: User[];
count: number;
}>;
search(username: string, perPage?: number): Promise<{
data: User[];
count: number;
}>;
exists(username: string): Promise<boolean>;
createUser(user: CreatePayload): Promise<User>;
updateUser(username: string, user: UpdatePayload | ProfilePayload): Promise<Record<string, never>>;
setUserSpeed(username: string, profile: ProfilePayload): Promise<Record<string, never>>;
viewUser(username: string): Promise<User>;
findUser(username: string): Promise<User>;
deleteUser(username: string): Promise<Record<string, never>>;
attachStaticIp(username: string, ip: string): Promise<Record<string, never>>;
detachStaticIp(username: string): Promise<Record<string, never>>;
attachIpV6(username: string, ip: string): Promise<Record<string, never>>;
detachIpV6(username: string): Promise<Record<string, never>>;
block(username: string): Promise<Record<string, never>>;
coa(username: string): Promise<Record<string, never>>;
protected securityHeaders(payload?: {}): {
[x: string]: string;
};
protected cleanObject<T>(data: Record<string, unknown>): T;
protected stringify(payload?: {}): string;
protected handleResponse<T = Record<string, never>>(response: Response): Promise<T>;
protected debug(...args: unknown[]): void;
debugUsing(debugUsing: Debugger): this;
}