node-ts
Version:
TeamSpeak® 3 Server Query client for node.js implemented using TypeScript
1,193 lines (1,192 loc) • 37.9 kB
TypeScript
/**
* @autor Niklas Mollenhauer <holzig@outlook.com>
* @autor Tim Kluge <timklge@wh2.tu-dresden.de>
*/
import { EventEmitter } from "node:events";
/** Represents a Key-Value object. */
type MapLike<T> = Record<string, T>;
/**
* Client that can be used to connect to a TeamSpeak server query API.
*/
export declare class TeamSpeakClient extends EventEmitter {
private queue;
private _executing;
private socket;
private isConnected;
private static readonly DefaultHost;
private static readonly DefaultPort;
private readonly host;
private readonly port;
/**
* Creates a new instance of TeamSpeakClient for a specific remote host:port.
* @param {string = TeamSpeakClient.DefaultHost} host Remote host of the TeamSpeak server. Can be an IP address or a host name.
* @param {number = TeamSpeakClient.DefaultPort} port TCP port of the server query instance of the remote host.
* @constructor
*/
constructor(host?: string, port?: number);
connect(): Promise<void>;
/**
* Gets called on an opened connection
*/
private onConnect;
private handleSingleLine;
/**
* Sends a command to the server
*/
send(cmd: "login", params: LoginParams): Promise<CallbackData<GenericResponseData>>;
send(cmd: "logout"): Promise<CallbackData<GenericResponseData>>;
send(cmd: "version"): Promise<CallbackData<VersionResponseData>>;
send(cmd: "hostinfo"): Promise<CallbackData<HostInfoResponseData>>;
send(cmd: "instanceinfo"): Promise<CallbackData<InstanceInfoResponseData>>;
send(cmd: "instanceedit", params: InstanceEditParams): Promise<CallbackData<GenericResponseData>>;
send(cmd: "bindinglist"): Promise<CallbackData<BindingListResponseData>>;
send(cmd: "use", params: UseParams): Promise<CallbackData<GenericResponseData>>;
send(cmd: "serverlist", params: MapLike<any>, options: string[]): Promise<CallbackData<ServerListResponseData>>;
send(cmd: "serverdelete", params: ServerDeleteParams): Promise<CallbackData<GenericResponseData>>;
send(cmd: "serverstart", params: ServerStartStopParams): Promise<CallbackData<GenericResponseData>>;
send(cmd: "serverstop", params: ServerStartStopParams): Promise<CallbackData<GenericResponseData>>;
send(cmd: "serverprocessstop"): Promise<CallbackData<GenericResponseData>>;
send(cmd: "serverinfo"): Promise<CallbackData<ServerInfoResponseData>>;
send(cmd: "serverrequestconnectioninfo"): Promise<CallbackData<ServerRequstConnectionInfoResponseData>>;
send(cmd: "serveredit", params: ServerEditParams): Promise<CallbackData<GenericResponseData>>;
send(cmd: "servernotifyregister", params: RegisterNotificationsParams): Promise<CallbackData<GenericResponseData>>;
send(cmd: "sendtextmessage", params: SendTextMessageParams): Promise<CallbackData<GenericResponseData>>;
send(cmd: "logadd", params: LogAddParams): Promise<CallbackData<GenericResponseData>>;
send(cmd: "gm", params: GmParams): Promise<CallbackData<GenericResponseData>>;
send(cmd: "channellist", params: MapLike<any>, options: string[]): Promise<CallbackData<ChannelListResponseData>>;
send(cmd: "channelinfo", params: ChannelInfoParams): Promise<CallbackData<ChannelInfoResponseData>>;
send(cmd: "channeldelete", params: ChannelDeleteParams): Promise<CallbackData<GenericResponseData>>;
send(cmd: "clientlist", params: ClientListParams): Promise<CallbackData<ClientListResponseData>>;
send(cmd: "clientinfo", params: ClientInfoParams): Promise<CallbackData<ClientInfoResponseData>>;
send(cmd: "clientdbdelete", params: ClientDBDeleteParams): Promise<CallbackData<GenericResponseData>>;
send(cmd: "clientmove", params: ClientMoveParams): Promise<CallbackData<GenericResponseData>>;
send(cmd: "clientkick", params: ClientKickParams): Promise<CallbackData<GenericResponseData>>;
send(cmd: "clientpoke", params: ClientPokeParams): Promise<CallbackData<GenericResponseData>>;
send(cmd: "clientpermlist", params: ClientPermListParams, options: string[]): Promise<CallbackData<ClientPermListResponseData>>;
send(cmd: "clientaddperm", params: ClientAddPermParams): Promise<CallbackData<GenericResponseData>>;
send(cmd: "clientdelperm", param: ClientDeleteParams): Promise<CallbackData<GenericResponseData>>;
send(cmd: "messagedel", params: MessageDeleteParams): Promise<CallbackData<GenericResponseData>>;
send(cmd: "complaindelall", params: ComplainDeleteAllParams): Promise<CallbackData<GenericResponseData>>;
send(cmd: "complaindel", params: ComplainDeleteParams): Promise<CallbackData<GenericResponseData>>;
send(cmd: "banclient", params: BanClientParams): Promise<CallbackData<GenericResponseData>>;
send(cmd: "banlist"): Promise<CallbackData<BanListResponseData>>;
send(cmd: "banadd", params: BanAddParams): Promise<CallbackData<GenericResponseData>>;
send(cmd: "bandel", params: BanDeleteParams): Promise<CallbackData<GenericResponseData>>;
send(cmd: "bandelall"): Promise<CallbackData<GenericResponseData>>;
send(cmd: "ftstop", params: FtStopParams): Promise<CallbackData<GenericResponseData>>;
send(cmd: string, params: MapLike<any>, options: string[]): Promise<CallbackData<QueryResponseItem>>;
subscribeChannelEvents(channelId: number): Promise<CallbackData<QueryResponseItem>>;
subscribeServerEvents(): Promise<CallbackData<QueryResponseItem>>;
subscribeServerTextEvents(): Promise<CallbackData<QueryResponseItem>>;
subscribeChannelTextEvents(): Promise<CallbackData<QueryResponseItem>>;
subscribePrivateTextEvents(): Promise<CallbackData<QueryResponseItem>>;
on(event: "cliententerview", listener: (data: any) => void): this;
on(event: "clientleftview", listener: (data: any) => void): this;
on(event: "serveredited", listener: (data: any) => void): this;
on(event: "channeldescriptionchanged", listener: (data: any) => void): this;
on(event: "channelpasswordchanged", listener: (data: any) => void): this;
on(event: "channelmoved", listener: (data: any) => void): this;
on(event: "channeledited", listener: (data: any) => void): this;
on(event: "channelcreated", listener: (data: any) => void): this;
on(event: "channeldeleted", listener: (data: any) => void): this;
on(event: "clientmoved", listener: (data: any) => void): this;
on(event: "textmessage", listener: (data: TextMessageNotificationData) => void): this;
on(event: "tokenused", listener: (data: any) => void): this;
on(event: "error", listener: (err: Error) => void): this;
on(event: "close", listener: (queue: QueryCommand[]) => void): this;
once(event: "cliententerview", listener: (data: any) => void): this;
once(event: "clientleftview", listener: (data: any) => void): this;
once(event: "serveredited", listener: (data: any) => void): this;
once(event: "channeldescriptionchanged", listener: (data: any) => void): this;
once(event: "channelpasswordchanged", listener: (data: any) => void): this;
once(event: "channelmoved", listener: (data: any) => void): this;
once(event: "channeledited", listener: (data: any) => void): this;
once(event: "channelcreated", listener: (data: any) => void): this;
once(event: "channeldeleted", listener: (data: any) => void): this;
once(event: "clientmoved", listener: (data: any) => void): this;
once(event: "textmessage", listener: (data: TextMessageNotificationData) => void): this;
once(event: "tokenused", listener: (data: any) => void): this;
once(event: "error", listener: (err: Error) => void): this;
once(event: "close", listener: (queue: QueryCommand[]) => void): this;
/**
* Parses a query API response.
*/
private parseResponse;
/**
* Gets pending commands that are going to be sent to the server. Note that they have been parsed - Access pending[0].text to get the full text representation of the command.
* @return {QueryCommand[]} Pending commands that are going to be sent to the server.
*/
get pending(): QueryCommand[];
/**
* Clears the queue of pending commands so that any command that is currently queued won't be executed.
* @return {QueryCommand[]} Array of commands that have been removed from the queue.
*/
clearPending(): QueryCommand[];
/**
* Checks the current command queue and sends them if needed.
*/
private checkQueue;
/**
* Sets the socket to timeout after timeout milliseconds of inactivity on the socket. By default net.Socket do not have a timeout.
*/
setTimeout(timeout: number): void;
unsetTimeout(): void;
}
/**
* Represents common data returned by the api.
*/
export interface CallbackData<T extends QueryResponseItem> {
cmd?: string;
options?: string[];
text?: string;
parameters: MapLike<Object>;
error: QueryError;
response: T[];
rawResponse: string;
}
export interface LoginParams extends MapLike<any> {
client_login_name: string;
client_login_password: string;
}
export interface VersionResponseData extends QueryResponseItem {
version: string;
build: number;
platform: string;
}
export interface UseParams extends MapLike<any> {
sid: number;
}
export interface ServerListResponseData extends QueryResponseItem {
virtualserver_id: number;
virtualserver_port: number;
virtualserver_status: string;
virtualserver_clientsonline: number;
}
export interface ServerDeleteParams extends UseParams {
}
export interface ServerStartStopParams extends UseParams {
}
export interface ClientListResponseData extends QueryResponseItem {
}
export interface ClientListParams extends MapLike<any> {
}
/**
* Specialized callback data for a failed request.
*/
export interface ErrorResponseData extends QueryResponseItem {
}
/**
* Represents common data returned by the api during a successful response.
*/
export interface QueryResponseItem extends MapLike<any> {
}
/**
* Item that represents a query error.
*/
export interface QueryError {
/**
* The error id.
* @type {number}
*/
id: number;
/**
* Error message.
* @type {string}
*/
msg: string;
/**
* Permission that the client does not have.
* @type {number}
*/
failed_permid?: number;
}
/**
* Represents an item in the processing queue for the api.
*/
export interface QueryCommand {
cmd: string;
options: string[];
parameters: MapLike<Object>;
text: string;
resolveFunction: (data: CallbackData<any>) => void;
rejectFunction: (reason: any) => void;
response?: QueryResponseItem[];
rawResponse?: string;
error?: QueryError;
}
export interface TextMessageNotificationData {
targetmode: TextMessageTargetMode;
msg: string;
/**
* only present in messages of type "textprivate
*/
target?: number;
}
/**
* @todo move to seperate file
* @todo check for encoding mess up/invisible chars caused by copy/pasting from the documentation PDF
* @todo more discrete typings using enums/interfaces/etc
* @todo lower case imported interfaces
*/
export interface HostInfoResponseData extends QueryResponseItem {
instance_uptime: number;
host_timestamp_utc: number;
virtualservers_running_total: number;
connection_filetransfer_bandwidth_sent: number;
}
export interface InstanceInfoResponseData extends QueryResponseItem {
}
export interface GenericResponseData extends QueryResponseItem {
}
export interface ServerRequstConnectionInfoResponseData extends QueryResponseItem, ServerConnectionProperties {
}
export interface ServerEditParams extends MapLike<any>, VirtualServerPropertiesChangable {
}
export interface ServerInfoResponseData extends QueryResponseItem, VirtualServerProperties {
}
export interface RegisterNotificationsParamsGeneric extends QueryResponseItem {
event: "server" | "textserver" | "textchannel" | "textprivate";
}
export interface RegisterNotificationsChannelParams extends QueryResponseItem {
event: "channel";
id: number;
}
export type RegisterNotificationsParams = RegisterNotificationsParamsGeneric | RegisterNotificationsChannelParams;
export interface SendTextMessageParams extends QueryResponseItem {
targetmode: TextMessageTargetMode;
target: number;
msg: string;
}
export interface InstanceEditParams extends MapLike<any>, InstancePropertiesChangable {
}
export interface GmParams extends MapLike<any> {
msg: string;
}
export interface ChannelListResponseData extends QueryResponseItem {
cid: number;
pid: number;
channel_order: number;
channel_name: string;
channel_topic: string;
total_clients: number;
}
export interface ChannelInfoParams extends MapLike<any> {
cid: number;
}
export interface ChannelInfoResponseData extends QueryResponseItem, ChannelProperties {
}
export interface ChannelDeleteParams extends MapLike<any>, ChannelInfoParams {
force: YesNo;
}
export interface ClientInfoResponseData extends QueryResponseItem, ClientProperties {
}
export interface ClientInfoParams extends MapLike<any> {
clid: number;
}
export interface ClientDBDeleteParams extends MapLike<any> {
cldbid: number;
}
export interface ClientMoveParams extends MapLike<any> {
clid: number[];
cid: number;
cpw?: string;
}
export interface ClientKickParams extends MapLike<any> {
clid: number[];
reasonid: ReasonIdentifier;
reasonmsg: string;
}
export interface ClientPokeParams extends MapLike<any> {
clid: number;
msg: string;
}
export interface ClientPermListParams extends MapLike<any> {
cldbid: number;
}
export interface ClientPermListResponseData extends QueryResponseItem {
cldbid?: number;
permid: number;
permvalue: number;
permnegated: YesNo;
permskip: number;
}
export interface ClientAddPermParams extends MapLike<any> {
cldbid: number;
permid?: number[];
permsid?: string[];
permvalue: number[];
permskip: YesNo[];
}
export interface ClientDeleteParams extends MapLike<any> {
cldbid: number;
permid: number[];
permsid: string[];
}
export interface MessageDeleteParams extends MapLike<any> {
msgid: number;
}
export interface ComplainDeleteAllParams extends MapLike<any> {
tcldbid: number;
}
export interface ComplainDeleteParams extends MapLike<any> {
tcldbid: number;
fcldbid: number;
}
export interface BanClientParams extends MapLike<any> {
clid: number;
time?: number;
banreason?: string;
}
export interface BanListResponseData extends QueryResponseItem {
banid: number;
ip: string;
created: number;
invokername: string;
invokercldbid: number;
invokeruid: string;
reason: string;
enforcements: number;
}
export interface BanAddParams extends MapLike<any> {
ip?: string;
name?: string;
uid?: string;
time?: number;
banreason?: string;
}
export interface BanDeleteParams extends MapLike<any> {
banid: number;
}
export interface FtStopParams extends MapLike<any> {
serverftfid: number;
delete: YesNo;
}
export interface LogAddParams extends MapLike<any> {
loglevel: LogLevel;
logmsg: string;
}
export interface InstancePropertiesChangable {
/**
* Default ServerQuery group ID
*/
serverinstance_guest_serverquery_group: any;
/**
* Default template group ID for administrators on new virtual servers (used to create initial token)
*/
serverinstance_template_serveradmin_group: any;
/**
* TCP port used for file transfers
*/
serverinstance_filetransfer_port: number;
/**
* Max bandwidth available for outgoing file transfers (Bytes/s)
*/
serverinstance_max_download_total_bandwitdh: number;
/**
* Max bandwidth available for incoming file transfers (Bytes/s)
*/
serverinstance_max_upload_total_bandwitdh: number;
/**
* Default server group ID used in templates
*/
serverinstance_template_serverdefault_group: any;
/**
* Default channel group ID used in templates
*/
serverinstance_template_channeldefault_group: any;
/**
* Default channel administrator group ID used in templates
*/
serverinstance_template_channeladmin_group: any;
/**
* Max number of commands allowed in <serverinstance_serverquery_flood_time> seconds
*/
serverinstance_serverquery_flood_commands: number;
/**
* Timeframe in seconds for <serverinstance_serverquery_flood_commands> commands
*/
serverinstance_serverquery_flood_time: number;
/**
* Time in seconds used for automatic bans triggered by the ServerQuery flood protection
*/
serverinstance_serverquery_flood_ban_time: number;
}
export interface BindingListResponseData extends QueryResponseItem {
}
export interface VirtualServerPropertiesChangable {
/**
* Name of the virtual server
*/
virtualserver_name: string;
/**
* Welcome message of the virtual server
*/
virtualserver_welcomemessage: string;
/**
* Number of slots available on the virtual server
*/
virtualserver_maxclients: number;
/**
* Password of the virtual server
*/
virtualserver_password: string;
/**
* Host message of the virtual server
*/
virtualserver_hostmessage: string;
/**
* Host message mode of the virtual server (see Definitions)
*/
virtualserver_hostmessage_mode: any;
/**
* Default server group ID
*/
virtualserver_default_server_group: any;
/**
* Default channel group ID
*/
virtualserver_default_channel_group: any;
/**
* Default channel administrator group ID
*/
virtualserver_default_channel_admin_group: any;
/**
* Max bandwidth for outgoing file transfers on the virtual server (Bytes/s)
*/
virtualserver_max_download_total_bandwidth: number;
/**
* Max bandwidth for incoming file transfers on the virtual server (Bytes/s)
*/
virtualserver_max_upload_total_bandwidth: number;
/**
* Host banner URL opened on click
*/
virtualserver_hostbanner_url: string;
/**
* Host banner URL used as image source
*/
virtualserver_hostbanner_gfx_url: string;
/**
* Interval for reloading the banner on client-side
*/
virtualserver_hostbanner_gfx_interval: any;
/**
* Number of complaints needed to ban a client automatically
*/
virtualserver_complain_autoban_count: number;
/**
* Time in seconds used for automatic bans triggered by complaints
*/
virtualserver_complain_autoban_time: number;
/**
* Time in seconds before a complaint is deleted automatically
*/
virtualserver_complain_remove_time: number;
/**
* Number of clients in the same channel needed to force silence
*/
virtualserver_min_clients_in_channel_before_forced_silence: number;
/**
* Client volume lowered automatically while a priority speaker is talking
*/
virtualserver_priority_speaker_dimm_modificator: any;
/**
* Anti-flood points removed from a client for being good
*/
virtualserver_antiflood_points_tick_reduce: any;
/**
* Anti-flood points needed to block commands being executed by the client
*/
virtualserver_antiflood_points_needed_command_block: any;
/**
* Anti-flood points needed to block incoming connections from the client
*/
virtualserver_antiflood_points_needed_ip_block: any;
/**
* The display mode for the virtual servers hostbanner (see Definitions)
*/
virtualserver_hostbanner_mode: any;
/**
* Text used for the tooltip of the host button on client-side
*/
virtualserver_hostbutton_tooltip: string;
/**
* Text used for the tooltip of the host button on client-side
*/
virtualserver_hostbutton_gfx_url: string;
/**
* URL opened on click on the host button
*/
virtualserver_hostbutton_url: string;
/**
* Download quota for the virtual server (MByte)
*/
virtualserver_download_quota: number;
/**
* Download quota for the virtual server (MByte)
*/
virtualserver_upload_quota: number;
/**
* Machine ID identifying the server instance associated with the virtual server in the database
*/
virtualserver_machine_id: any;
/**
* UDP port the virtual server is listening on
*/
virtualserver_port: number;
/**
* Indicates whether the server starts automatically with the server instance or not
*/
virtualserver_autostart: any;
/**
* Status of the virtual server (online | virtual online | offline | booting up | shutting down | …)
*/
virtualserver_status: string;
/**
* Indicates whether the server logs events related to clients or not
*/
virtualserver_log_client: any;
/**
* Indicates whether the server logs events related to ServerQuery clients or not
*/
virtualserver_log_query: any;
/**
* Indicates whether the server logs events related to channels or not
*/
virtualserver_log_channel: any;
/**
* Indicates whether the server logs events related to permissions or not
*/
virtualserver_log_permissions: any;
/**
* Indicates whether the server logs events related to server changes or not
*/
virtualserver_log_server: any;
/**
* Indicates whether the server logs events related to file transfers or not
*/
virtualserver_log_filetransfer: any;
/**
* Min client version required to connect
*/
virtualserver_min_client_version: any;
/**
* Minimum client identity security level required to connect to the virtual server
*/
virtualserver_needed_identity_security_level: any;
/**
* Phonetic name of the virtual server
*/
virtualserver_name_phonetic: any;
/**
* CRC32 checksum of the virtual server icon
*/
virtualserver_icon_id: any;
/**
* Number of reserved slots available on the virtual server
*/
virtualserver_reserved_slots: number;
/**
* Indicates whether the server appears in the global web server list or not
*/
virtualserver_weblist_enabled: any;
/**
* The global codec encryption mode of the virtual server
*/
virtualserver_codec_encryption_mode: any;
}
export interface ServerConnectionProperties {
/**
* Current bandwidth used for outgoing file transfers (Bytes/s)
*/
connection_filetransfer_bandwidth_sent: number;
/**
* Current bandwidth used for incoming file transfers (Bytes/s)
*/
connection_filetransfer_bandwidth_received: number;
/**
* Total amount of packets sent
*/
connection_packets_sent_total: number;
/**
* Total amount of packets received
*/
connection_packets_received_total: number;
/**
* Total amount of bytes sent
*/
connection_bytes_sent_total: number;
/**
* Total amount of bytes received
*/
connection_bytes_received_total: number;
/**
* Average bandwidth used for outgoing data in the last second (Bytes/s)
*/
connection_bandwidth_sent_last_second_total: number;
/**
* Average bandwidth used for incoming data in the last second (Bytes/s)
*/
connection_bandwidth_received_last_second_total: number;
/**
* Average bandwidth used for outgoing data in the last minute (Bytes/s)
*/
connection_bandwidth_sent_last_minute_total: number;
/**
* Average bandwidth used for incoming data in the last minute (Bytes/s)
*/
connection_bandwidth_received_last_minute_total: number;
}
export interface VirtualServerPropertiesReadOnly extends ServerConnectionProperties {
/**
* Indicates whether the server has a password set or not
*/
virtualserver_flag_password: any;
/**
* Number of clients connected to the virtual server
*/
virtualserver_clientsonline: number;
/**
* Number of ServerQuery clients connected to the virtual server
*/
virtualserver_queryclientsonline: number;
/**
* Number of channels created on the virtual server
*/
virtualserver_channelsonline: number;
/**
* Creation date and time of the virtual server as UTC timestamp
*/
virtualserver_created: any;
/**
* Uptime in seconds
*/
virtualserver_uptime: number;
/**
* Operating system the server is running on
*/
virtualserver_platform: string;
/**
* Server version information including build number
*/
virtualserver_version: any;
/**
* Indicates whether the initial privilege key for the virtual server has been used or not
*/
virtualserver_ask_for_privilegekey: any;
/**
* Total number of clients connected to the virtual server since it was last started
*/
virtualserver_client_connections: number;
/**
* Total number of ServerQuery clients connected to the virtual server since it was last started
*/
virtualserver_query_client_connections: number;
/**
* Number of bytes downloaded from the virtual server on the current month
*/
virtualserver_month_bytes_downloaded: number;
/**
* Number of bytes uploaded to the virtual server on the current month
*/
virtualserver_month_bytes_uploaded: number;
/**
* Number of bytes downloaded from the virtual server since it was last started
*/
virtualserver_total_bytes_downloaded: number;
/**
* Number of bytes uploaded to the virtual server since it was last started
*/
virtualserver_total_bytes_uploaded: number;
/**
* Unique ID of the virtual server
*/
virtualserver_unique_identifer: any;
/**
* Database ID of the virtual server
*/
virtualserver_id: any;
/**
* The average packet loss for speech data on the virtual server
*/
virtualserver_total_packetloss_speech: number;
/**
* The average packet loss for keepalive data on the virtual server
*/
virtualserver_total_packetloss_keepalive: number;
/**
* The average packet loss for control data on the virtual server
*/
virtualserver_total_packetloss_control: number;
/**
* The average packet loss for all data on the virtual server
*/
virtualserver_total_packetloss_total: number;
/**
* The average ping of all clients connected to the virtual server
*/
virtualserver_total_ping: number;
/**
* The IPv4 address the virtual server is listening on
*/
virtualserver_ip: any;
/**
* The directory where the virtual servers filebase is located
*/
virtualserver_filebase: string;
}
export interface VirtualServerProperties extends VirtualServerPropertiesReadOnly, VirtualServerPropertiesChangable {
}
export interface ChannelPropertiesChangable {
/**
* Name of the channel
*/
channel_name: string;
/**
* Topic of the channel
*/
channel_topic: string;
/**
* Description of the channel
*/
channel_description: string;
/**
* Password of the channel
*/
channel_password: string;
/**
* Codec used by the channel (see Definitions)
*/
channel_codec: Codec;
/**
* Codec quality used by the channel
*/
channel_codec_quality: any;
/**
* Individual max number of clients for the channel
*/
channel_maxclients: number;
/**
* Individual max number of clients for the channel family
*/
channel_maxfamilyclients: number;
/**
* ID of the channel below which the channel is positioned
*/
channel_order: number;
/**
* Indicates whether the channel is permanent or not
*/
channel_flag_permanent: any;
/**
* Indicates whether the channel is semi-permanent or not
*/
channel_flag_semi_permanent: any;
/**
* Indicates whether the channel is temporary or not
*/
channel_flag_temporary: any;
/**
* Indicates whether the channel is the virtual servers default channel or not
*/
channel_flag_default: any;
/**
* Indicates whether the channel has a max clients limit or not
*/
channel_flag_maxclients_unlimited: any;
/**
* Indicates whether the channel has a max family clients limit or not
*/
channel_flag_maxfamilyclients_unlimited: any;
/**
* Indicates whether the channel inherits the max family clients from his parent channel or not
*/
channel_flag_maxfamilyclients_inherited: any;
/**
* Needed talk power for this channel
*/
channel_needed_talk_power: any;
/**
* Phonetic name of the channel
*/
channel_name_phonetic: string;
/**
* CRC32 checksum of the channel icon
*/
channel_icon_id: any;
/**
* Indicates whether speech data transmitted in this channel is encrypted or not
*/
channel_codec_is_unencrypted: any;
/**
* The channels parent ID
*/
CPID: number;
}
export interface ChannelPropertiesReadOnly {
/**
* Indicates whether the channel has a password set or not
*/
channel_flag_password: any;
/**
* Path of the channels file repository
*/
channel_filepath: string;
/**
* Indicates whether the channel is silenced or not
*/
channel_forced_silence: any;
/**
* The channels ID
*/
cid: number;
}
export interface ChannelProperties extends ChannelPropertiesReadOnly, ChannelPropertiesChangable {
}
export interface ClientPropertiesChangable {
/**
* Nickname of the client
*/
client_nickname: string;
/**
* Indicates whether the client is able to talk or not
*/
client_is_talker: any;
/**
* Brief description of the client
*/
client_description: string;
/**
* Indicates whether the client is a channel commander or not
*/
client_is_channel_commander: any;
/**
* CRC32 checksum of the client icon
*/
client_icon_id: any;
}
export interface ClientPropertiesReadOnly {
/**
* Unique ID of the client
*/
client_unique_identifier: any;
/**
* Client version information including build number
*/
client_version: any;
/**
* Operating system the client is running on
*/
client_platform: any;
/**
* Indicates whether the client has their microphone muted or not
*/
client_input_muted: any;
/**
* Indicates whether the client has their speakers muted or not
*/
client_output_muted: any;
/**
* Indicates whether the client has enabled their capture device or not
*/
client_input_hardware: any;
/**
* Indicates whether the client has enabled their playback device or not
*/
client_output_hardware: any;
/**
* Default channel of the client
*/
client_default_channel: any;
/**
* Username of a ServerQuery client
*/
client_login_name: any;
/**
* Database ID of the client
*/
client_database_id: any;
/**
* Current channel group ID of the client
*/
client_channel_group_id: any;
/**
* Current server group IDs of the client separated by a comma
*/
client_server_groups: any;
/**
* Creation date and time of the clients first connection to the server as UTC timestamp
*/
client_created: any;
/**
* Creation date and time of the clients last connection to the server as UTC timestamp
*/
client_lastconnected: any;
/**
* Total number of connections from this client since the server was started
*/
client_totalconnections: any;
/**
* Indicates whether the client is away or not
*/
client_away: any;
/**
* Away message of the client
*/
client_away_message: any;
/**
* Indicates whether the client is a ServerQuery client or not
*/
client_type: any;
/**
* Indicates whether the client has set an avatar or not
*/
client_flag_avatar: any;
/**
* The clients current talk power
*/
client_talk_power: any;
/**
* Indicates whether the client is requesting talk power or not
*/
client_talk_request: any;
/**
* The clients current talk power request message
*/
client_talk_request_msg: any;
/**
* Number of bytes downloaded by the client on the current month
*/
client_month_bytes_downloaded: any;
/**
* Number of bytes uploaded by the client on the current month
*/
client_month_bytes_uploaded: any;
/**
* Number of bytes downloaded by the client since the server was started
*/
client_total_bytes_downloaded: any;
/**
* Number of bytes uploaded by the client since the server was started
*/
client_total_bytes_uploaded: any;
/**
* Indicates whether the client is a priority speaker or not
*/
client_is_priority_speaker: any;
/**
* Number of unread offline messages in this clients inbox
*/
client_unread_messages: any;
/**
* Phonetic name of the client
*/
client_nickname_phonetic: any;
/**
* The clients current ServerQuery view power
*/
client_needed_serverquery_view_power: any;
/**
* Current bandwidth used for outgoing file transfers (Bytes/s)
*/
connection_filetransfer_bandwidth_sent: any;
/**
* Current bandwidth used for incoming file transfers (Bytes/s)
*/
connection_filetransfer_bandwidth_received: any;
/**
* Total amount of packets sent
*/
connection_packets_sent_total: any;
/**
* Total amount of packets received
*/
connection_packets_received_total: any;
/**
* Total amount of bytes sent
*/
connection_bytes_sent_total: any;
/**
* Total amount of bytes received
*/
connection_bytes_received_total: any;
/**
* Average bandwidth used for outgoing data in the last second (Bytes/s)
*/
connection_bandwidth_sent_last_second_total: any;
/**
* Average bandwidth used for incoming data in the last second (Bytes/s)
*/
connection_bandwidth_received_last_second_total: any;
/**
* Average bandwidth used for outgoing data in the last minute (Bytes/s)
*/
connection_bandwidth_sent_last_minute_total: any;
/**
* Average bandwidth used for incoming data in the last minute (Bytes/s)
*/
connection_bandwidth_received_last_minute_total: any;
/**
* The IPv4 address of the client
*/
connection_client_ip: any;
/**
* The country identifier of the client (i.e. DE)
*/
client_country: any;
}
export interface ClientProperties extends ClientPropertiesReadOnly, ClientPropertiesChangable {
}
export declare enum YesNo {
No = 0,
Yes = 1
}
export declare enum HostMessageMode {
/**
* 1: display message in chatlog
*/
LOG = 1,
/**
* 2: display message in modal dialog
*/
MODAL = 2,
/**
* 3: display message in modal dialog and close connection
*/
MODALQUIT = 3
}
export declare enum HostBannerMode {
/**
* 0: do not adjust
*/
NOADJUST = 0,
/**
* 1: adjust but ignore aspect ratio (like TeamSpeak 2)
*/
IGNOREASPECT = 1,
/**
* 2: adjust and keep aspect ratio
*/
KEEPASPECT = 2
}
export declare enum Codec {
/**
* 0: speex narrowband (mono, 16bit, 8kHz)
*/
SPEEX_NARROWBAND = 0,
/**
* 1: speex wideband (mono, 16bit, 16kHz)
*/
SPEEX_WIDEBAND = 1,
/**
* 2: speex ultra-wideband (mono, 16bit, 32kHz)
*/
SPEEX_ULTRAWIDEBAND = 2,
/**
* 3: celt mono (mono, 16bit, 48kHz)
*/
CELT_MONO = 3
}
export declare enum CodecEncryptionMode {
/**
* 0: configure per channel
*/
INDIVIDUAL = 0,
/**
* 1: globally disabled
*/
DISABLED = 1,
/**
* 2: globally enabled
*/
ENABLED = 2
}
export declare enum TextMessageTargetMode {
/**
* 1: target is a client
*/
CLIENT = 1,
/**
* 2: target is a channel
*/
CHANNEL = 2,
/**
* 3: target is a virtual server
*/
SERVER = 3
}
export declare enum LogLevel {
/**
* 1: everything that is really bad
*/
ERROR = 1,
/**
* 2: everything that might be bad
*/
WARNING = 2,
/**
* 3: output that might help find a problem
*/
DEBUG = 3,
/**
* 4: informational output
*/
INFO = 4
}
export declare enum ReasonIdentifier {
/**
* 4: kick client from channel
*/
CHANNEL = 4,
/**
* 5: kick client from server
*/
SERVER = 5
}
export declare enum PermissionGroupDatabaseTypes {
/**
* 0: template group (used for new virtual servers)
*/
TEMPLATE = 0,
/**
* 1: regular group (used for regular clients)
*/
REGULAR = 1,
/**
* 2: global query group (used for ServerQuery clients)
*/
QUERY = 2
}
export declare enum PermissionGroupTypes {
/**
* 0: server group permission
*/
SERVER_GROUP = 0,
/**
* 1: client specific permission
*/
GLOBAL_CLIENT = 1,
/**
* 2: channel specific permission
*/
CHANNEL = 2,
/**
* 3: channel group permission
*/
CHANNEL_GROUP = 3,
/**
* 4: channel-client specific permission
*/
CHANNEL_CLIENT = 4
}
export declare enum TokenType {
/**
* 0: server group token (id1={groupID} id2=0)
*/
SERVER_GROUP = 0,
/**
* 1: channel group token (id1={groupID} id2={channelID})
*/
CHANNEL_GROUP = 1
}
export {};