marzban-sdk
Version:
The Marzban SDK is a fully typed client library for interacting with the Marzban API. It works in both browser and Node.js environments
2,144 lines (2,139 loc) • 126 kB
text/typescript
import { AxiosInstance, RawAxiosRequestConfig, AxiosPromise } from 'axios';
/**
* MarzbanAPI
* Unified GUI Censorship Resistant Solution Powered by Xray
*
* The version of the OpenAPI document: 0.8.4
*
*
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
* https://openapi-generator.tech
* Do not edit the class manually.
*/
interface ConfigurationParameters {
apiKey?: string | Promise<string> | ((name: string) => string) | ((name: string) => Promise<string>);
username?: string;
password?: string;
accessToken?: string | Promise<string> | ((name?: string, scopes?: string[]) => string) | ((name?: string, scopes?: string[]) => Promise<string>);
basePath?: string;
serverIndex?: number;
baseOptions?: any;
formDataCtor?: new () => any;
}
declare class Configuration {
/**
* parameter for apiKey security
* @param name security name
* @memberof Configuration
*/
apiKey?: string | Promise<string> | ((name: string) => string) | ((name: string) => Promise<string>);
/**
* parameter for basic security
*
* @type {string}
* @memberof Configuration
*/
username?: string;
/**
* parameter for basic security
*
* @type {string}
* @memberof Configuration
*/
password?: string;
/**
* parameter for oauth2 security
* @param name security name
* @param scopes oauth2 scope
* @memberof Configuration
*/
accessToken?: string | Promise<string> | ((name?: string, scopes?: string[]) => string) | ((name?: string, scopes?: string[]) => Promise<string>);
/**
* override base path
*
* @type {string}
* @memberof Configuration
*/
basePath?: string;
/**
* override server index
*
* @type {number}
* @memberof Configuration
*/
serverIndex?: number;
/**
* base options for axios calls
*
* @type {any}
* @memberof Configuration
*/
baseOptions?: any;
/**
* The FormData constructor that will be used to create multipart form data
* requests. You can inject this here so that execution environments that
* do not support the FormData class can still run the generated client.
*
* @type {new () => FormData}
*/
formDataCtor?: new () => any;
constructor(param?: ConfigurationParameters);
/**
* Check if the given MIME is a JSON MIME.
* JSON MIME examples:
* application/json
* application/json; charset=UTF8
* APPLICATION/JSON
* application/vnd.company+json
* @param mime - MIME (Multipurpose Internet Mail Extensions)
* @return True if the given MIME is JSON, false otherwise.
*/
isJsonMime(mime: string): boolean;
}
/**
* MarzbanAPI
* Unified GUI Censorship Resistant Solution Powered by Xray
*
* The version of the OpenAPI document: 0.8.4
*
*
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
* https://openapi-generator.tech
* Do not edit the class manually.
*/
/**
*
* @export
* @interface RequestArgs
*/
interface RequestArgs {
url: string;
options: RawAxiosRequestConfig;
}
/**
*
* @export
* @class BaseAPI
*/
declare class BaseAPI {
protected basePath: string;
protected axios: AxiosInstance;
protected configuration: Configuration | undefined;
constructor(configuration?: Configuration, basePath?: string, axios?: AxiosInstance);
}
/**
* MarzbanAPI
* Unified GUI Censorship Resistant Solution Powered by Xray
*
* The version of the OpenAPI document: 0.8.4
*
*
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
* https://openapi-generator.tech
* Do not edit the class manually.
*/
/**
*
* @export
* @interface Admin
*/
interface Admin {
/**
*
* @type {string}
* @memberof Admin
*/
'username': string;
/**
*
* @type {boolean}
* @memberof Admin
*/
'is_sudo': boolean;
/**
*
* @type {number}
* @memberof Admin
*/
'telegram_id'?: number | null;
/**
*
* @type {string}
* @memberof Admin
*/
'discord_webhook'?: string | null;
/**
*
* @type {number}
* @memberof Admin
*/
'users_usage'?: number | null;
}
/**
*
* @export
* @interface AdminCreate
*/
interface AdminCreate {
/**
*
* @type {string}
* @memberof AdminCreate
*/
'username': string;
/**
*
* @type {boolean}
* @memberof AdminCreate
*/
'is_sudo': boolean;
/**
*
* @type {number}
* @memberof AdminCreate
*/
'telegram_id'?: number | null;
/**
*
* @type {string}
* @memberof AdminCreate
*/
'discord_webhook'?: string | null;
/**
*
* @type {number}
* @memberof AdminCreate
*/
'users_usage'?: number | null;
/**
*
* @type {string}
* @memberof AdminCreate
*/
'password': string;
}
/**
*
* @export
* @interface AdminModify
*/
interface AdminModify {
/**
*
* @type {string}
* @memberof AdminModify
*/
'password'?: string | null;
/**
*
* @type {boolean}
* @memberof AdminModify
*/
'is_sudo': boolean;
/**
*
* @type {number}
* @memberof AdminModify
*/
'telegram_id'?: number | null;
/**
*
* @type {string}
* @memberof AdminModify
*/
'discord_webhook'?: string | null;
}
/**
*
* @export
* @interface Conflict
*/
interface Conflict {
/**
*
* @type {string}
* @memberof Conflict
*/
'detail'?: string;
}
/**
*
* @export
* @interface CoreStats
*/
interface CoreStats {
/**
*
* @type {string}
* @memberof CoreStats
*/
'version': string;
/**
*
* @type {boolean}
* @memberof CoreStats
*/
'started': boolean;
/**
*
* @type {string}
* @memberof CoreStats
*/
'logs_websocket': string;
}
/**
*
* @export
* @interface Forbidden
*/
interface Forbidden {
/**
*
* @type {string}
* @memberof Forbidden
*/
'detail'?: string;
}
/**
*
* @export
* @interface HTTPException
*/
interface HTTPException {
/**
*
* @type {string}
* @memberof HTTPException
*/
'detail': string;
}
/**
*
* @export
* @interface HTTPValidationError
*/
interface HTTPValidationError {
/**
*
* @type {Array<ValidationError>}
* @memberof HTTPValidationError
*/
'detail'?: Array<ValidationError>;
}
/**
*
* @export
* @interface NextPlanModel
*/
interface NextPlanModel {
/**
*
* @type {number}
* @memberof NextPlanModel
*/
'data_limit'?: number | null;
/**
*
* @type {number}
* @memberof NextPlanModel
*/
'expire'?: number | null;
/**
*
* @type {boolean}
* @memberof NextPlanModel
*/
'add_remaining_traffic'?: boolean;
/**
*
* @type {boolean}
* @memberof NextPlanModel
*/
'fire_on_either'?: boolean;
}
/**
*
* @export
* @interface NodeCreate
*/
interface NodeCreate {
/**
*
* @type {string}
* @memberof NodeCreate
*/
'name': string;
/**
*
* @type {string}
* @memberof NodeCreate
*/
'address': string;
/**
*
* @type {number}
* @memberof NodeCreate
*/
'port'?: number;
/**
*
* @type {number}
* @memberof NodeCreate
*/
'api_port'?: number;
/**
*
* @type {number}
* @memberof NodeCreate
*/
'usage_coefficient'?: number;
/**
*
* @type {boolean}
* @memberof NodeCreate
*/
'add_as_new_host'?: boolean;
}
/**
*
* @export
* @interface NodeModify
*/
interface NodeModify {
/**
*
* @type {string}
* @memberof NodeModify
*/
'name'?: string | null;
/**
*
* @type {string}
* @memberof NodeModify
*/
'address'?: string | null;
/**
*
* @type {number}
* @memberof NodeModify
*/
'port'?: number | null;
/**
*
* @type {number}
* @memberof NodeModify
*/
'api_port'?: number | null;
/**
*
* @type {number}
* @memberof NodeModify
*/
'usage_coefficient'?: number | null;
/**
*
* @type {NodeStatus}
* @memberof NodeModify
*/
'status'?: NodeStatus | null;
}
/**
*
* @export
* @interface NodeResponse
*/
interface NodeResponse {
/**
*
* @type {string}
* @memberof NodeResponse
*/
'name': string;
/**
*
* @type {string}
* @memberof NodeResponse
*/
'address': string;
/**
*
* @type {number}
* @memberof NodeResponse
*/
'port'?: number;
/**
*
* @type {number}
* @memberof NodeResponse
*/
'api_port'?: number;
/**
*
* @type {number}
* @memberof NodeResponse
*/
'usage_coefficient'?: number;
/**
*
* @type {number}
* @memberof NodeResponse
*/
'id': number;
/**
*
* @type {string}
* @memberof NodeResponse
*/
'xray_version'?: string | null;
/**
*
* @type {NodeStatus}
* @memberof NodeResponse
*/
'status': NodeStatus;
/**
*
* @type {string}
* @memberof NodeResponse
*/
'message'?: string | null;
}
/**
*
* @export
* @interface NodeSettings
*/
interface NodeSettings {
/**
*
* @type {string}
* @memberof NodeSettings
*/
'min_node_version'?: string;
/**
*
* @type {string}
* @memberof NodeSettings
*/
'certificate': string;
}
/**
*
* @export
* @enum {string}
*/
declare const NodeStatus: {
readonly Connected: "connected";
readonly Connecting: "connecting";
readonly Error: "error";
readonly Disabled: "disabled";
};
type NodeStatus = typeof NodeStatus[keyof typeof NodeStatus];
/**
*
* @export
* @interface NodeUsageResponse
*/
interface NodeUsageResponse {
/**
*
* @type {number}
* @memberof NodeUsageResponse
*/
'node_id'?: number | null;
/**
*
* @type {string}
* @memberof NodeUsageResponse
*/
'node_name': string;
/**
*
* @type {number}
* @memberof NodeUsageResponse
*/
'uplink': number;
/**
*
* @type {number}
* @memberof NodeUsageResponse
*/
'downlink': number;
}
/**
*
* @export
* @interface NodesUsageResponse
*/
interface NodesUsageResponse {
/**
*
* @type {Array<NodeUsageResponse>}
* @memberof NodesUsageResponse
*/
'usages': Array<NodeUsageResponse>;
}
/**
*
* @export
* @interface NotFound
*/
interface NotFound {
/**
*
* @type {string}
* @memberof NotFound
*/
'detail'?: string;
}
/**
*
* @export
* @interface Port
*/
interface Port {
}
/**
*
* @export
* @interface ProxyHost
*/
interface ProxyHost {
/**
*
* @type {string}
* @memberof ProxyHost
*/
'remark': string;
/**
*
* @type {string}
* @memberof ProxyHost
*/
'address': string;
/**
*
* @type {number}
* @memberof ProxyHost
*/
'port'?: number | null;
/**
*
* @type {string}
* @memberof ProxyHost
*/
'sni'?: string | null;
/**
*
* @type {string}
* @memberof ProxyHost
*/
'host'?: string | null;
/**
*
* @type {string}
* @memberof ProxyHost
*/
'path'?: string | null;
/**
*
* @type {ProxyHostSecurity}
* @memberof ProxyHost
*/
'security'?: ProxyHostSecurity;
/**
*
* @type {ProxyHostALPN}
* @memberof ProxyHost
*/
'alpn'?: ProxyHostALPN;
/**
*
* @type {ProxyHostFingerprint}
* @memberof ProxyHost
*/
'fingerprint'?: ProxyHostFingerprint;
/**
*
* @type {boolean}
* @memberof ProxyHost
*/
'allowinsecure'?: boolean | null;
/**
*
* @type {boolean}
* @memberof ProxyHost
*/
'is_disabled'?: boolean | null;
/**
*
* @type {boolean}
* @memberof ProxyHost
*/
'mux_enable'?: boolean | null;
/**
*
* @type {string}
* @memberof ProxyHost
*/
'fragment_setting'?: string | null;
/**
*
* @type {string}
* @memberof ProxyHost
*/
'noise_setting'?: string | null;
/**
*
* @type {boolean}
* @memberof ProxyHost
*/
'random_user_agent'?: boolean | null;
/**
*
* @type {boolean}
* @memberof ProxyHost
*/
'use_sni_as_host'?: boolean | null;
}
/**
*
* @export
* @enum {string}
*/
declare const ProxyHostALPN: {
readonly Empty: "";
readonly H3: "h3";
readonly H2: "h2";
readonly Http11: "http/1.1";
readonly H3h2http11: "h3,h2,http/1.1";
readonly H3h2: "h3,h2";
readonly H2http11: "h2,http/1.1";
};
type ProxyHostALPN = typeof ProxyHostALPN[keyof typeof ProxyHostALPN];
/**
*
* @export
* @enum {string}
*/
declare const ProxyHostFingerprint: {
readonly Empty: "";
readonly Chrome: "chrome";
readonly Firefox: "firefox";
readonly Safari: "safari";
readonly Ios: "ios";
readonly Android: "android";
readonly Edge: "edge";
readonly _360: "360";
readonly Qq: "qq";
readonly Random: "random";
readonly Randomized: "randomized";
};
type ProxyHostFingerprint = typeof ProxyHostFingerprint[keyof typeof ProxyHostFingerprint];
/**
*
* @export
* @enum {string}
*/
declare const ProxyHostSecurity: {
readonly InboundDefault: "inbound_default";
readonly None: "none";
readonly Tls: "tls";
};
type ProxyHostSecurity = typeof ProxyHostSecurity[keyof typeof ProxyHostSecurity];
/**
*
* @export
* @interface ProxyInbound
*/
interface ProxyInbound {
/**
*
* @type {string}
* @memberof ProxyInbound
*/
'tag': string;
/**
*
* @type {ProxyTypes}
* @memberof ProxyInbound
*/
'protocol': ProxyTypes;
/**
*
* @type {string}
* @memberof ProxyInbound
*/
'network': string;
/**
*
* @type {string}
* @memberof ProxyInbound
*/
'tls': string;
/**
*
* @type {Port}
* @memberof ProxyInbound
*/
'port': Port;
}
/**
*
* @export
* @enum {string}
*/
declare const ProxyTypes: {
readonly Vmess: "vmess";
readonly Vless: "vless";
readonly Trojan: "trojan";
readonly Shadowsocks: "shadowsocks";
};
type ProxyTypes = typeof ProxyTypes[keyof typeof ProxyTypes];
/**
*
* @export
* @interface SubscriptionUserResponse
*/
interface SubscriptionUserResponse {
/**
*
* @type {object}
* @memberof SubscriptionUserResponse
*/
'proxies': object;
/**
*
* @type {number}
* @memberof SubscriptionUserResponse
*/
'expire'?: number | null;
/**
*
* @type {number}
* @memberof SubscriptionUserResponse
*/
'data_limit'?: number | null;
/**
*
* @type {UserDataLimitResetStrategy}
* @memberof SubscriptionUserResponse
*/
'data_limit_reset_strategy'?: UserDataLimitResetStrategy;
/**
*
* @type {string}
* @memberof SubscriptionUserResponse
*/
'sub_updated_at'?: string | null;
/**
*
* @type {string}
* @memberof SubscriptionUserResponse
*/
'sub_last_user_agent'?: string | null;
/**
*
* @type {string}
* @memberof SubscriptionUserResponse
*/
'online_at'?: string | null;
/**
*
* @type {number}
* @memberof SubscriptionUserResponse
*/
'on_hold_expire_duration'?: number | null;
/**
*
* @type {string}
* @memberof SubscriptionUserResponse
*/
'on_hold_timeout'?: string | null;
/**
*
* @type {NextPlanModel}
* @memberof SubscriptionUserResponse
*/
'next_plan'?: NextPlanModel | null;
/**
*
* @type {string}
* @memberof SubscriptionUserResponse
*/
'username': string;
/**
*
* @type {UserStatus}
* @memberof SubscriptionUserResponse
*/
'status': UserStatus;
/**
*
* @type {number}
* @memberof SubscriptionUserResponse
*/
'used_traffic': number;
/**
*
* @type {number}
* @memberof SubscriptionUserResponse
*/
'lifetime_used_traffic'?: number;
/**
*
* @type {string}
* @memberof SubscriptionUserResponse
*/
'created_at': string;
/**
*
* @type {Array<string>}
* @memberof SubscriptionUserResponse
*/
'links'?: Array<string>;
/**
*
* @type {string}
* @memberof SubscriptionUserResponse
*/
'subscription_url'?: string;
}
/**
*
* @export
* @interface SystemStats
*/
interface SystemStats {
/**
*
* @type {string}
* @memberof SystemStats
*/
'version': string;
/**
*
* @type {number}
* @memberof SystemStats
*/
'mem_total': number;
/**
*
* @type {number}
* @memberof SystemStats
*/
'mem_used': number;
/**
*
* @type {number}
* @memberof SystemStats
*/
'cpu_cores': number;
/**
*
* @type {number}
* @memberof SystemStats
*/
'cpu_usage': number;
/**
*
* @type {number}
* @memberof SystemStats
*/
'total_user': number;
/**
*
* @type {number}
* @memberof SystemStats
*/
'online_users': number;
/**
*
* @type {number}
* @memberof SystemStats
*/
'users_active': number;
/**
*
* @type {number}
* @memberof SystemStats
*/
'users_on_hold': number;
/**
*
* @type {number}
* @memberof SystemStats
*/
'users_disabled': number;
/**
*
* @type {number}
* @memberof SystemStats
*/
'users_expired': number;
/**
*
* @type {number}
* @memberof SystemStats
*/
'users_limited': number;
/**
*
* @type {number}
* @memberof SystemStats
*/
'incoming_bandwidth': number;
/**
*
* @type {number}
* @memberof SystemStats
*/
'outgoing_bandwidth': number;
/**
*
* @type {number}
* @memberof SystemStats
*/
'incoming_bandwidth_speed': number;
/**
*
* @type {number}
* @memberof SystemStats
*/
'outgoing_bandwidth_speed': number;
}
/**
*
* @export
* @interface Token
*/
interface Token {
/**
*
* @type {string}
* @memberof Token
*/
'access_token': string;
/**
*
* @type {string}
* @memberof Token
*/
'token_type'?: string;
}
/**
*
* @export
* @interface Unauthorized
*/
interface Unauthorized {
/**
*
* @type {string}
* @memberof Unauthorized
*/
'detail'?: string;
}
/**
*
* @export
* @interface UserCreate
*/
interface UserCreate {
/**
*
* @type {{ [key: string]: object; }}
* @memberof UserCreate
*/
'proxies'?: {
[key: string]: object;
};
/**
*
* @type {number}
* @memberof UserCreate
*/
'expire'?: number | null;
/**
*
* @type {number}
* @memberof UserCreate
*/
'data_limit'?: number | null;
/**
*
* @type {UserDataLimitResetStrategy}
* @memberof UserCreate
*/
'data_limit_reset_strategy'?: UserDataLimitResetStrategy;
/**
*
* @type {{ [key: string]: Array<string>; }}
* @memberof UserCreate
*/
'inbounds'?: {
[key: string]: Array<string>;
};
/**
*
* @type {string}
* @memberof UserCreate
*/
'note'?: string | null;
/**
*
* @type {string}
* @memberof UserCreate
*/
'sub_updated_at'?: string | null;
/**
*
* @type {string}
* @memberof UserCreate
*/
'sub_last_user_agent'?: string | null;
/**
*
* @type {string}
* @memberof UserCreate
*/
'online_at'?: string | null;
/**
*
* @type {number}
* @memberof UserCreate
*/
'on_hold_expire_duration'?: number | null;
/**
*
* @type {string}
* @memberof UserCreate
*/
'on_hold_timeout'?: string | null;
/**
*
* @type {number}
* @memberof UserCreate
*/
'auto_delete_in_days'?: number | null;
/**
*
* @type {NextPlanModel}
* @memberof UserCreate
*/
'next_plan'?: NextPlanModel | null;
/**
*
* @type {string}
* @memberof UserCreate
*/
'username': string;
/**
*
* @type {UserStatusCreate}
* @memberof UserCreate
*/
'status'?: UserStatusCreate;
}
/**
*
* @export
* @enum {string}
*/
declare const UserDataLimitResetStrategy: {
readonly NoReset: "no_reset";
readonly Day: "day";
readonly Week: "week";
readonly Month: "month";
readonly Year: "year";
};
type UserDataLimitResetStrategy = typeof UserDataLimitResetStrategy[keyof typeof UserDataLimitResetStrategy];
/**
*
* @export
* @interface UserModify
*/
interface UserModify {
/**
*
* @type {{ [key: string]: object; }}
* @memberof UserModify
*/
'proxies'?: {
[key: string]: object;
};
/**
*
* @type {number}
* @memberof UserModify
*/
'expire'?: number | null;
/**
*
* @type {number}
* @memberof UserModify
*/
'data_limit'?: number | null;
/**
*
* @type {UserDataLimitResetStrategy}
* @memberof UserModify
*/
'data_limit_reset_strategy'?: UserDataLimitResetStrategy;
/**
*
* @type {{ [key: string]: Array<string>; }}
* @memberof UserModify
*/
'inbounds'?: {
[key: string]: Array<string>;
};
/**
*
* @type {string}
* @memberof UserModify
*/
'note'?: string | null;
/**
*
* @type {string}
* @memberof UserModify
*/
'sub_updated_at'?: string | null;
/**
*
* @type {string}
* @memberof UserModify
*/
'sub_last_user_agent'?: string | null;
/**
*
* @type {string}
* @memberof UserModify
*/
'online_at'?: string | null;
/**
*
* @type {number}
* @memberof UserModify
*/
'on_hold_expire_duration'?: number | null;
/**
*
* @type {string}
* @memberof UserModify
*/
'on_hold_timeout'?: string | null;
/**
*
* @type {number}
* @memberof UserModify
*/
'auto_delete_in_days'?: number | null;
/**
*
* @type {NextPlanModel}
* @memberof UserModify
*/
'next_plan'?: NextPlanModel | null;
/**
*
* @type {UserStatusModify}
* @memberof UserModify
*/
'status'?: UserStatusModify;
}
/**
*
* @export
* @interface UserResponse
*/
interface UserResponse {
/**
*
* @type {object}
* @memberof UserResponse
*/
'proxies': object;
/**
*
* @type {number}
* @memberof UserResponse
*/
'expire'?: number | null;
/**
*
* @type {number}
* @memberof UserResponse
*/
'data_limit'?: number | null;
/**
*
* @type {UserDataLimitResetStrategy}
* @memberof UserResponse
*/
'data_limit_reset_strategy'?: UserDataLimitResetStrategy;
/**
*
* @type {{ [key: string]: Array<string>; }}
* @memberof UserResponse
*/
'inbounds'?: {
[key: string]: Array<string>;
};
/**
*
* @type {string}
* @memberof UserResponse
*/
'note'?: string | null;
/**
*
* @type {string}
* @memberof UserResponse
*/
'sub_updated_at'?: string | null;
/**
*
* @type {string}
* @memberof UserResponse
*/
'sub_last_user_agent'?: string | null;
/**
*
* @type {string}
* @memberof UserResponse
*/
'online_at'?: string | null;
/**
*
* @type {number}
* @memberof UserResponse
*/
'on_hold_expire_duration'?: number | null;
/**
*
* @type {string}
* @memberof UserResponse
*/
'on_hold_timeout'?: string | null;
/**
*
* @type {number}
* @memberof UserResponse
*/
'auto_delete_in_days'?: number | null;
/**
*
* @type {NextPlanModel}
* @memberof UserResponse
*/
'next_plan'?: NextPlanModel | null;
/**
*
* @type {string}
* @memberof UserResponse
*/
'username': string;
/**
*
* @type {UserStatus}
* @memberof UserResponse
*/
'status': UserStatus;
/**
*
* @type {number}
* @memberof UserResponse
*/
'used_traffic': number;
/**
*
* @type {number}
* @memberof UserResponse
*/
'lifetime_used_traffic'?: number;
/**
*
* @type {string}
* @memberof UserResponse
*/
'created_at': string;
/**
*
* @type {Array<string>}
* @memberof UserResponse
*/
'links'?: Array<string>;
/**
*
* @type {string}
* @memberof UserResponse
*/
'subscription_url'?: string;
/**
*
* @type {{ [key: string]: Array<string>; }}
* @memberof UserResponse
*/
'excluded_inbounds'?: {
[key: string]: Array<string>;
};
/**
*
* @type {Admin}
* @memberof UserResponse
*/
'admin'?: Admin | null;
}
/**
*
* @export
* @enum {string}
*/
declare const UserStatus: {
readonly Active: "active";
readonly Disabled: "disabled";
readonly Limited: "limited";
readonly Expired: "expired";
readonly OnHold: "on_hold";
};
type UserStatus = typeof UserStatus[keyof typeof UserStatus];
/**
*
* @export
* @enum {string}
*/
declare const UserStatusCreate: {
readonly Active: "active";
readonly OnHold: "on_hold";
};
type UserStatusCreate = typeof UserStatusCreate[keyof typeof UserStatusCreate];
/**
*
* @export
* @enum {string}
*/
declare const UserStatusModify: {
readonly Active: "active";
readonly Disabled: "disabled";
readonly OnHold: "on_hold";
};
type UserStatusModify = typeof UserStatusModify[keyof typeof UserStatusModify];
/**
*
* @export
* @interface UserTemplateCreate
*/
interface UserTemplateCreate {
/**
*
* @type {string}
* @memberof UserTemplateCreate
*/
'name'?: string | null;
/**
*
* @type {number}
* @memberof UserTemplateCreate
*/
'data_limit'?: number | null;
/**
*
* @type {number}
* @memberof UserTemplateCreate
*/
'expire_duration'?: number | null;
/**
*
* @type {string}
* @memberof UserTemplateCreate
*/
'username_prefix'?: string | null;
/**
*
* @type {string}
* @memberof UserTemplateCreate
*/
'username_suffix'?: string | null;
/**
*
* @type {{ [key: string]: Array<string>; }}
* @memberof UserTemplateCreate
*/
'inbounds'?: {
[key: string]: Array<string>;
};
}
/**
*
* @export
* @interface UserTemplateModify
*/
interface UserTemplateModify {
/**
*
* @type {string}
* @memberof UserTemplateModify
*/
'name'?: string | null;
/**
*
* @type {number}
* @memberof UserTemplateModify
*/
'data_limit'?: number | null;
/**
*
* @type {number}
* @memberof UserTemplateModify
*/
'expire_duration'?: number | null;
/**
*
* @type {string}
* @memberof UserTemplateModify
*/
'username_prefix'?: string | null;
/**
*
* @type {string}
* @memberof UserTemplateModify
*/
'username_suffix'?: string | null;
/**
*
* @type {{ [key: string]: Array<string>; }}
* @memberof UserTemplateModify
*/
'inbounds'?: {
[key: string]: Array<string>;
};
}
/**
*
* @export
* @interface UserTemplateResponse
*/
interface UserTemplateResponse {
/**
*
* @type {string}
* @memberof UserTemplateResponse
*/
'name'?: string | null;
/**
*
* @type {number}
* @memberof UserTemplateResponse
*/
'data_limit'?: number | null;
/**
*
* @type {number}
* @memberof UserTemplateResponse
*/
'expire_duration'?: number | null;
/**
*
* @type {string}
* @memberof UserTemplateResponse
*/
'username_prefix'?: string | null;
/**
*
* @type {string}
* @memberof UserTemplateResponse
*/
'username_suffix'?: string | null;
/**
*
* @type {{ [key: string]: Array<string>; }}
* @memberof UserTemplateResponse
*/
'inbounds'?: {
[key: string]: Array<string>;
};
/**
*
* @type {number}
* @memberof UserTemplateResponse
*/
'id': number;
}
/**
*
* @export
* @interface UserUsageResponse
*/
interface UserUsageResponse {
/**
*
* @type {number}
* @memberof UserUsageResponse
*/
'node_id'?: number | null;
/**
*
* @type {string}
* @memberof UserUsageResponse
*/
'node_name': string;
/**
*
* @type {number}
* @memberof UserUsageResponse
*/
'used_traffic': number;
}
/**
*
* @export
* @interface UserUsagesResponse
*/
interface UserUsagesResponse {
/**
*
* @type {string}
* @memberof UserUsagesResponse
*/
'username': string;
/**
*
* @type {Array<UserUsageResponse>}
* @memberof UserUsagesResponse
*/
'usages': Array<UserUsageResponse>;
}
/**
*
* @export
* @interface UsersResponse
*/
interface UsersResponse {
/**
*
* @type {Array<UserResponse>}
* @memberof UsersResponse
*/
'users': Array<UserResponse>;
/**
*
* @type {number}
* @memberof UsersResponse
*/
'total': number;
}
/**
*
* @export
* @interface UsersUsagesResponse
*/
interface UsersUsagesResponse {
/**
*
* @type {Array<UserUsageResponse>}
* @memberof UsersUsagesResponse
*/
'usages': Array<UserUsageResponse>;
}
/**
*
* @export
* @interface ValidationError
*/
interface ValidationError {
/**
*
* @type {Array<ValidationErrorLocInner>}
* @memberof ValidationError
*/
'loc': Array<ValidationErrorLocInner>;
/**
*
* @type {string}
* @memberof ValidationError
*/
'msg': string;
/**
*
* @type {string}
* @memberof ValidationError
*/
'type': string;
}
/**
*
* @export
* @interface ValidationErrorLocInner
*/
interface ValidationErrorLocInner {
}
/**
* AdminApi - axios parameter creator
* @export
*/
declare const AdminApiAxiosParamCreator: (configuration?: Configuration) => {
/**
* Activate all disabled users under a specific admin
* @summary Activate All Disabled Users
* @param {string} username
* @param {*} [options] Override http request option.
* @throws {RequiredError}
*/
activateAllDisabledUsers: (username: string, options?: RawAxiosRequestConfig) => Promise<RequestArgs>;
/**
* Authenticate an admin and issue a token.
* @summary Admin Token
* @param {string} username
* @param {string} password
* @param {string | null} [grantType]
* @param {string} [scope]
* @param {string | null} [clientId]
* @param {string | null} [clientSecret]
* @param {*} [options] Override http request option.
* @throws {RequiredError}
*/
adminToken: (username: string, password: string, grantType?: string | null, scope?: string, clientId?: string | null, clientSecret?: string | null, options?: RawAxiosRequestConfig) => Promise<RequestArgs>;
/**
* Create a new admin if the current admin has sudo privileges.
* @summary Create Admin
* @param {AdminCreate} adminCreate
* @param {*} [options] Override http request option.
* @throws {RequiredError}
*/
createAdmin: (adminCreate: AdminCreate, options?: RawAxiosRequestConfig) => Promise<RequestArgs>;
/**
* Disable all active users under a specific admin
* @summary Disable All Active Users
* @param {string} username
* @param {*} [options] Override http request option.
* @throws {RequiredError}
*/
disableAllActiveUsers: (username: string, options?: RawAxiosRequestConfig) => Promise<RequestArgs>;
/**
* Retrieve the usage of given admin.
* @summary Get Admin Usage
* @param {string} username
* @param {*} [options] Override http request option.
* @throws {RequiredError}
*/
getAdminUsage: (username: string, options?: RawAxiosRequestConfig) => Promise<RequestArgs>;
/**
* Fetch a list of admins with optional filters for pagination and username.
* @summary Get Admins
* @param {number | null} [offset]
* @param {number | null} [limit]
* @param {string | null} [username]
* @param {*} [options] Override http request option.
* @throws {RequiredError}
*/
getAdmins: (offset?: number | null, limit?: number | null, username?: string | null, options?: RawAxiosRequestConfig) => Promise<RequestArgs>;
/**
* Retrieve the current authenticated admin.
* @summary Get Current Admin
* @param {*} [options] Override http request option.
* @throws {RequiredError}
*/
getCurrentAdmin: (options?: RawAxiosRequestConfig) => Promise<RequestArgs>;
/**
* Modify an existing admin\'s details.
* @summary Modify Admin
* @param {string} username
* @param {AdminModify} adminModify
* @param {*} [options] Override http request option.
* @throws {RequiredError}
*/
modifyAdmin: (username: string, adminModify: AdminModify, options?: RawAxiosRequestConfig) => Promise<RequestArgs>;
/**
* Remove an admin from the database.
* @summary Remove Admin
* @param {string} username
* @param {*} [options] Override http request option.
* @throws {RequiredError}
*/
removeAdmin: (username: string, options?: RawAxiosRequestConfig) => Promise<RequestArgs>;
/**
* Resets usage of admin.
* @summary Reset Admin Usage
* @param {string} username
* @param {*} [options] Override http request option.
* @throws {RequiredError}
*/
resetAdminUsage: (username: string, options?: RawAxiosRequestConfig) => Promise<RequestArgs>;
};
/**
* AdminApi - functional programming interface
* @export
*/
declare const AdminApiFp: (configuration?: Configuration) => {
/**
* Activate all disabled users under a specific admin
* @summary Activate All Disabled Users
* @param {string} username
* @param {*} [options] Override http request option.
* @throws {RequiredError}
*/
activateAllDisabledUsers(username: string, options?: RawAxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise<any>>;
/**
* Authenticate an admin and issue a token.
* @summary Admin Token
* @param {string} username
* @param {string} password
* @param {string | null} [grantType]
* @param {string} [scope]
* @param {string | null} [clientId]
* @param {string | null} [clientSecret]
* @param {*} [options] Override http request option.
* @throws {RequiredError}
*/
adminToken(username: string, password: string, grantType?: string | null, scope?: string, clientId?: string | null, clientSecret?: string | null, options?: RawAxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise<Token>>;
/**
* Create a new admin if the current admin has sudo privileges.
* @summary Create Admin
* @param {AdminCreate} adminCreate
* @param {*} [options] Override http request option.
* @throws {RequiredError}
*/
createAdmin(adminCreate: AdminCreate, options?: RawAxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise<Admin>>;
/**
* Disable all active users under a specific admin
* @summary Disable All Active Users
* @param {string} username
* @param {*} [options] Override http request option.
* @throws {RequiredError}
*/
disableAllActiveUsers(username: string, options?: RawAxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise<any>>;
/**
* Retrieve the usage of given admin.
* @summary Get Admin Usage
* @param {string} username
* @param {*} [options] Override http request option.
* @throws {RequiredError}
*/
getAdminUsage(username: string, options?: RawAxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise<number>>;
/**
* Fetch a list of admins with optional filters for pagination and username.
* @summary Get Admins
* @param {number | null} [offset]
* @param {number | null} [limit]
* @param {string | null} [username]
* @param {*} [options] Override http request option.
* @throws {RequiredError}
*/
getAdmins(offset?: number | null, limit?: number | null, username?: string | null, options?: RawAxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise<Array<Admin>>>;
/**
* Retrieve the current authenticated admin.
* @summary Get Current Admin
* @param {*} [options] Override http request option.
* @throws {RequiredError}
*/
getCurrentAdmin(options?: RawAxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise<Admin>>;
/**
* Modify an existing admin\'s details.
* @summary Modify Admin
* @param {string} username
* @param {AdminModify} adminModify
* @param {*} [options] Override http request option.
* @throws {RequiredError}
*/
modifyAdmin(username: string, adminModify: AdminModify, options?: RawAxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise<Admin>>;
/**
* Remove an admin from the database.
* @summary Remove Admin
* @param {string} username
* @param {*} [options] Override http request option.
* @throws {RequiredError}
*/
removeAdmin(username: string, options?: RawAxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise<any>>;
/**
* Resets usage of admin.
* @summary Reset Admin Usage
* @param {string} username
* @param {*} [options] Override http request option.
* @throws {RequiredError}
*/
resetAdminUsage(username: string, options?: RawAxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise<Admin>>;
};
/**
* AdminApi - factory interface
* @export
*/
declare const AdminApiFactory: (configuration?: Configuration, basePath?: string, axios?: AxiosInstance) => {
/**
* Activate all disabled users under a specific admin
* @summary Activate All Disabled Users
* @param {string} username
* @param {*} [options] Override http request option.
* @throws {RequiredError}
*/
activateAllDisabledUsers(username: string, options?: RawAxiosRequestConfig): AxiosPromise<any>;
/**
* Authenticate an admin and issue a token.
* @summary Admin Token
* @param {string} username
* @param {string} password
* @param {string | null} [grantType]
* @param {string} [scope]
* @param {string | null} [clientId]
* @param {string | null} [clientSecret]
* @param {*} [options] Override http request option.
* @throws {RequiredError}
*/
adminToken(username: string, password: string, grantType?: string | null, scope?: string, clientId?: string | null, clientSecret?: string | null, options?: RawAxiosRequestConfig): AxiosPromise<Token>;
/**
* Create a new admin if the current admin has sudo privileges.
* @summary Create Admin
* @param {AdminCreate} adminCreate
* @param {*} [options] Override http request option.
* @throws {RequiredError}
*/
createAdmin(adminCreate: AdminCreate, options?: RawAxiosRequestConfig): AxiosPromise<Admin>;
/**
* Disable all active users under a specific admin
* @summary Disable All Active Users
* @param {string} username
* @param {*} [options] Override http request option.
* @throws {RequiredError}
*/
disableAllActiveUsers(username: string, options?: RawAxiosRequestConfig): AxiosPromise<any>;
/**
* Retrieve the usage of given admin.
* @summary Get Admin Usage
* @param {string} username
* @param {*} [options] Override http request option.
* @throws {RequiredError}
*/
getAdminUsage(username: string, options?: RawAxiosRequestConfig): AxiosPromise<number>;
/**
* Fetch a list of admins with optional filters for pagination and username.
* @summary Get Admins
* @param {number | null} [offset]
* @param {number | null} [limit]
* @param {string | null} [username]
* @param {*} [options] Override http request option.
* @throws {RequiredError}
*/
getAdmins(offset?: number | null, limit?: number | null, username?: string | null, options?: RawAxiosRequestConfig): AxiosPromise<Array<Admin>>;
/**
* Retrieve the current authenticated admin.
* @summary Get Current Admin
* @param {*} [options] Override http request option.
* @throws {RequiredError}
*/
getCurrentAdmin(options?: RawAxiosRequestConfig): AxiosPromise<Admin>;
/**
* Modify an existing admin\'s details.
* @summary Modify Admin
* @param {string} username
* @param {AdminModify} adminModify
* @param {*} [options] Override http request option.
* @throws {RequiredError}
*/
modifyAdmin(username: string, adminModify: AdminModify, options?: RawAxiosRequestConfig): AxiosPromise<Admin>;
/**
* Remove an admin from the database.
* @summary Remove Admin
* @param {string} username
* @param {*} [options] Override http request option.
* @throws {RequiredError}
*/
removeAdmin(username: string, options?: RawAxiosRequestConfig): AxiosPromise<any>;
/**
* Resets usage of admin.
* @summary Reset Admin Usage
* @param {string} username
* @param {*} [options] Override http request option.
* @throws {RequiredError}
*/
resetAdminUsage(username: string, options?: RawAxiosRequestConfig): AxiosPromise<Admin>;
};
/**
* AdminApi - object-oriented interface
* @export
* @class AdminApi
* @extends {BaseAPI}
*/
declare class AdminApi extends BaseAPI {
/**
* Activate all disabled users under a specific admin
* @summary Activate All Disabled Users
* @param {string} username
* @param {*} [options] Override http request option.
* @throws {RequiredError}
* @memberof AdminApi
*/
activateAllDisabledUsers(username: string, options?: RawAxiosRequestConfig): Promise<any>;
/**
* Authenticate an admin and issue a token.
* @summary Admin Token
* @param {string} username
* @param {string} password
* @param {string | null} [grantType]
* @param {string} [scope]
* @param {string | null} [clientId]
* @param {string | null} [clientSecret]
* @param {*} [options] Override http request option.
* @throws {RequiredError}
* @memberof AdminApi
*/
adminToken(username: string, password: string, grantType?: string | null, scope?: string, clientId?: string | null, clientSecret?: string | null, options?: RawAxiosRequestConfig): Promise<Token>;
/**
* Create a new admin if the current admin has sudo privileges.
* @summary Create Admin
* @param {AdminCreate} adminCreate
* @param {*} [options] Override http request option.
* @throws {RequiredError}
* @memberof AdminApi
*/
createAdmin(adminCreate: AdminCreate, options?: RawAxiosRequestConfig): Promise<Admin>;
/**
* Disable all active users under a specific admin
* @summary Disable All Active Users
* @param {string} username
* @param {*} [options] Override http request option.
* @throws {RequiredError}
* @memberof AdminApi
*/
disableAllActiveUsers(username: string, options?: RawAxiosRequestConfig): Promise<any>;
/**
* Retrieve the usage of given admin.
* @summary Get Admin Usage
* @param {string} username
* @param {*} [options] Override http request option.
* @throws {RequiredError}
* @memberof AdminApi
*/
getAdminUsage(username: string, options?: RawAxiosRequestConfig): Promise<number>;
/**
* Fetch a list of admins with optional filters for pagination and username.
* @summary Get Admins
* @param {number | null} [offset]
* @param {number | null} [limit]
* @param {string | null} [username]
* @param {*} [options] Override http request option.
* @throws {RequiredError}
* @memberof AdminApi
*/
getAdmins(offset?: number | null, limit?: number | null, username?: string | null, options?: RawAxiosRequestConfig): Promise<Admin[]>;
/**
* Retrieve the current authenticated admin.
* @summary Get Current Admin
* @param {*} [options] Override http request option.
* @throws {RequiredError}
* @memberof AdminApi
*/
getCurrentAdmin(options?: RawAxiosRequestConfig): Promise<Admin>;
/**
* Modify an existing admin\'s details.
* @summary Modify Admin
* @param {string} username
* @param {AdminModify} adminModify
* @param {*} [options] Override http request option.
* @throws {RequiredError}
* @memberof AdminApi
*/
modifyAdmin(username: string, adminModify: AdminModify, options?: RawAxiosRequestConfig): Promise<Admin>;
/**
* Remove an admin from the database.
* @summary Remove Admin
* @param {string} username
* @param {*} [options] Override http request option.
* @throws {RequiredError}
* @memberof AdminApi
*/
removeAdmin(username: string, options?: RawAxiosRequestConfig): Promise<any>;
/**
* Resets usage of admin.
* @summary Reset Admin Usage
* @param {string} username
* @param {*} [options] Override http request option.
* @throws {RequiredError}
* @memberof AdminApi
*/
resetAdminUsage(username: string, options?: RawAxiosRequestConfig): Promise<Admin>;
}
/**
* CoreApi - axios parameter creator
* @export
*/
declare const CoreApiAxiosParamCreator: (configuration?: Configuration) => {
/**
* Get the current core configuration.
* @summary Get Core Config
* @param {*} [options] Override http request option.
* @throws {RequiredError}
*/
getCoreConfig: (options?: RawAxiosRequestConfig) => Promise<RequestArgs>;
/**
* Retrieve core statistics such as version and uptime.
* @summary Get Core Stats
* @param {*} [options] Override http request option.
* @throws {RequiredError}
*/
getCoreStats: (options?: RawAxiosRequestConfig) => Promise<RequestArgs>;
/**
* Modify the core configuration and restart the core.
* @summary Modify Core Config
* @param {object} body
* @param {*} [options] Override http request option.
* @throws {RequiredError}
*/
modifyCoreConfig: (body: object, options?: RawAxiosRequestConfig) => Promise<RequestArgs>;
/**
* Restart the core and all connected nodes.
* @summary Restart Core
* @param {*} [options] Override http request option.
* @throws {RequiredError}
*/
restartCore: (options?: RawAxiosRequestConfig) => Promise<RequestArgs>;
};
/**
* CoreApi - functional programming interface
* @export
*/
declare const CoreApiFp: (configuration?: Configuration) => {
/**
* Get the current core configuration.
* @summary Get Core Config
* @param {*} [options] Override http request option.
* @throws {RequiredError}
*/
getCoreConfig(options?: RawAxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise<object>>;
/**
* Retrieve core statistics such as version and uptime.
* @summary Get Core Stats
* @param {*} [options] Override http request option.
* @throws {RequiredError}
*/
getCoreStats(options?: RawAxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise<CoreStats>>;
/**
* Modify the core configuration and restart the core.
* @summary Modify Core Config
* @param {object} body
* @param {*} [options] Override http request option.
* @throws {RequiredError}
*/
modifyCoreConfig(body: object, options?: RawAxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise<object>>;
/**
* Restart the core and all connected nodes.
* @summary Restart Core
* @param {*} [options] Override http request option.
* @throws {RequiredError}
*/
restartCore(options?: RawAxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise<any>>;
};
/**
* CoreApi - factory interface
* @export
*/
declare const CoreApiFactory: (configuration?: Configuration, basePath?: string, axios?: AxiosInstance) => {
/**
* Get the current core configuration.
* @summary Get Core Config
* @param {*} [options] Override http request option.
* @throws {RequiredError}
*/
getCoreConfig(options?: RawAxiosRequestConfig): AxiosPromise<object>;
/**
* Retrieve core statistics such as version a