@honeybbq/teamspeak-client 1.0.0-beta.2 → 1.0.0-beta.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +1 -1
- package/dist/client.d.ts.map +1 -1
- package/dist/index.d.ts +1 -1
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js.map +1 -1
- package/dist/notifications.d.ts +1 -1
- package/dist/notifications.d.ts.map +1 -1
- package/dist/types.d.ts +1 -110
- package/dist/types.d.ts.map +1 -1
- package/package.json +3 -3
- package/src/client.ts +2 -2
- package/src/index.ts +0 -8
- package/src/notifications.ts +1 -1
- package/src/types.ts +8 -123
package/dist/notifications.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import type { Command } from "@honeybbq/teamspeak-core/internal";
|
|
2
|
-
import type { ClientEnterEvent, ClientLeaveEvent, ClientMovedEvent, TextMessageEvent, PokeEvent } from "
|
|
2
|
+
import type { ClientEnterEvent, ClientLeaveEvent, ClientMovedEvent, TextMessageEvent, PokeEvent } from "@honeybbq/teamspeak-core";
|
|
3
3
|
export type NotificationResult = {
|
|
4
4
|
kind: "clientEnter";
|
|
5
5
|
info: ClientEnterEvent;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"notifications.d.ts","sourceRoot":"","sources":["../src/notifications.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,mCAAmC,CAAC;AACjE,OAAO,KAAK,EACV,gBAAgB,EAChB,gBAAgB,EAChB,gBAAgB,EAChB,gBAAgB,EAChB,SAAS,EACV,MAAM,
|
|
1
|
+
{"version":3,"file":"notifications.d.ts","sourceRoot":"","sources":["../src/notifications.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,mCAAmC,CAAC;AACjE,OAAO,KAAK,EACV,gBAAgB,EAChB,gBAAgB,EAChB,gBAAgB,EAChB,gBAAgB,EAChB,SAAS,EACV,MAAM,0BAA0B,CAAC;AASlC,MAAM,MAAM,kBAAkB,GAC1B;IAAE,IAAI,EAAE,aAAa,CAAC;IAAC,IAAI,EAAE,gBAAgB,CAAA;CAAE,GAC/C;IAAE,IAAI,EAAE,aAAa,CAAC;IAAC,KAAK,EAAE,gBAAgB,CAAC;IAAC,MAAM,EAAE,OAAO,CAAA;CAAE,GACjE;IAAE,IAAI,EAAE,aAAa,CAAC;IAAC,KAAK,EAAE,gBAAgB,CAAC;IAAC,aAAa,EAAE,MAAM,CAAA;CAAE,GACvE;IAAE,IAAI,EAAE,aAAa,CAAC;IAAC,OAAO,EAAE,gBAAgB,CAAA;CAAE,GAClD;IAAE,IAAI,EAAE,OAAO,CAAC;IAAC,KAAK,EAAE,SAAS,CAAA;CAAE,GACnC;IAAE,IAAI,EAAE,SAAS,CAAA;CAAE,CAAC;AAExB,wBAAgB,kBAAkB,CAChC,GAAG,EAAE,OAAO,EACZ,QAAQ,EAAE,MAAM,EAChB,OAAO,EAAE,GAAG,CAAC,MAAM,EAAE,gBAAgB,CAAC,EACtC,SAAS,EAAE,MAAM,GAChB,kBAAkB,CAepB"}
|
package/dist/types.d.ts
CHANGED
|
@@ -1,115 +1,6 @@
|
|
|
1
|
-
import type {
|
|
1
|
+
import type { ClientEnterEvent, ClientLeaveEvent, ClientMovedEvent, CommandMiddleware, KickedEvent, Logger, NotificationEvent, PokeEvent, TextMessageEvent, VoiceDataEvent } from "@honeybbq/teamspeak-core";
|
|
2
2
|
import type { Duplex } from "node:stream";
|
|
3
3
|
import type { ReconnectOptions } from "./reconnect.js";
|
|
4
|
-
/** A text message, sent privately, to a channel, or to the whole server. */
|
|
5
|
-
export interface TextMessageEvent {
|
|
6
|
-
/** The sender's nickname. */
|
|
7
|
-
readonly invokerName: string;
|
|
8
|
-
/** The sender's unique identifier. */
|
|
9
|
-
readonly invokerUID: UID;
|
|
10
|
-
/** The message, unescaped. */
|
|
11
|
-
readonly message: string;
|
|
12
|
-
/** The sender's server groups, as this client last saw them. */
|
|
13
|
-
readonly invokerGroups: readonly ServerGroupID[];
|
|
14
|
-
/**
|
|
15
|
-
* Private, channel or server; compare it with `TextMessageTarget`. A plain
|
|
16
|
-
* number, since a server may send a mode that table does not name.
|
|
17
|
-
*/
|
|
18
|
-
readonly targetMode: number;
|
|
19
|
-
/**
|
|
20
|
-
* The client a private message was sent to. Channel and server messages
|
|
21
|
-
* carry no target, so it is 0 for them.
|
|
22
|
-
*/
|
|
23
|
-
readonly targetID: ClientID;
|
|
24
|
-
/** The sender. */
|
|
25
|
-
readonly invokerID: ClientID;
|
|
26
|
-
}
|
|
27
|
-
/** A client changing channel, of its own accord or moved by someone. */
|
|
28
|
-
export interface ClientMovedEvent {
|
|
29
|
-
/** Who moved the client; the client itself for a move of its own. */
|
|
30
|
-
readonly invokerName: string;
|
|
31
|
-
/** The mover's unique identifier. */
|
|
32
|
-
readonly invokerUID: UID;
|
|
33
|
-
/** The channel the client is now in. */
|
|
34
|
-
readonly targetChannelID: ChannelID;
|
|
35
|
-
/** Why the client moved; compare it with `Reason`. */
|
|
36
|
-
readonly reason: number;
|
|
37
|
-
/** The client that moved. */
|
|
38
|
-
readonly clientID: ClientID;
|
|
39
|
-
/** The mover. */
|
|
40
|
-
readonly invokerID: ClientID;
|
|
41
|
-
}
|
|
42
|
-
/**
|
|
43
|
-
* A client going out of view: leaving the server, kicked or banned from it, or
|
|
44
|
-
* in a channel that stopped being subscribed.
|
|
45
|
-
*/
|
|
46
|
-
export interface ClientLeaveEvent {
|
|
47
|
-
/** The reason given for a kick or a ban, or the client's own parting message. */
|
|
48
|
-
readonly reasonMessage: string;
|
|
49
|
-
/** Why the client left; compare it with `Reason`. */
|
|
50
|
-
readonly reason: number;
|
|
51
|
-
/** The client that left. */
|
|
52
|
-
readonly clientID: ClientID;
|
|
53
|
-
/** Who kicked or banned the client; empty otherwise. */
|
|
54
|
-
readonly invokerName: string;
|
|
55
|
-
/** The kicker's unique identifier; empty unless kicked or banned. */
|
|
56
|
-
readonly invokerUID: UID;
|
|
57
|
-
/** The kicker; 0 unless kicked or banned. */
|
|
58
|
-
readonly invokerID: ClientID;
|
|
59
|
-
}
|
|
60
|
-
/** This client being kicked from its channel or the server. */
|
|
61
|
-
export interface KickedEvent {
|
|
62
|
-
/** The reason the invoker gave. */
|
|
63
|
-
readonly reasonMessage: string;
|
|
64
|
-
/** `Reason.KickChannel`, `Reason.KickServer` or `Reason.KickServerBan`. */
|
|
65
|
-
readonly reason: number;
|
|
66
|
-
/** Who kicked this client. */
|
|
67
|
-
readonly invokerName: string;
|
|
68
|
-
/** The kicker's unique identifier. */
|
|
69
|
-
readonly invokerUID: UID;
|
|
70
|
-
/** The kicker. */
|
|
71
|
-
readonly invokerID: ClientID;
|
|
72
|
-
}
|
|
73
|
-
/**
|
|
74
|
-
* A client coming into view: the same record `listClients` returns, so one
|
|
75
|
-
* type describes a client however it was learned of; its own id is `id`, as
|
|
76
|
-
* in every record. The fields only `clientlist -times` reports are undefined
|
|
77
|
-
* here.
|
|
78
|
-
*/
|
|
79
|
-
export type ClientEnterEvent = ClientEntry;
|
|
80
|
-
/** This client being poked. */
|
|
81
|
-
export interface PokeEvent {
|
|
82
|
-
/** Who poked. */
|
|
83
|
-
readonly invokerName: string;
|
|
84
|
-
/** The poker's unique identifier. */
|
|
85
|
-
readonly invokerUID: UID;
|
|
86
|
-
/** The poker. */
|
|
87
|
-
readonly invokerID: ClientID;
|
|
88
|
-
/** The poke's message, unescaped. */
|
|
89
|
-
readonly message: string;
|
|
90
|
-
}
|
|
91
|
-
/** Audio from another client, in the channel or whispered. */
|
|
92
|
-
export interface VoiceDataEvent {
|
|
93
|
-
/** Who is speaking. */
|
|
94
|
-
readonly clientID: ClientID;
|
|
95
|
-
/**
|
|
96
|
-
* How the audio is encoded; compare it with `Codec`. A plain number, since a
|
|
97
|
-
* server may relay a codec that table does not name.
|
|
98
|
-
*/
|
|
99
|
-
readonly codec: number;
|
|
100
|
-
/** One encoded frame, copied: it stays valid after the listener returns. */
|
|
101
|
-
readonly data: Uint8Array;
|
|
102
|
-
}
|
|
103
|
-
/**
|
|
104
|
-
* A notification from the server, as it arrived: the escape hatch for one the
|
|
105
|
-
* SDK does not model. Match its `name` against `NotificationName`.
|
|
106
|
-
*/
|
|
107
|
-
export interface NotificationEvent {
|
|
108
|
-
/** The notification's name, such as `notifyserveredited`; `NotificationName` lists the known ones. */
|
|
109
|
-
readonly name: NotificationName | (string & {});
|
|
110
|
-
/** Its parameters, unescaped. */
|
|
111
|
-
readonly params: Readonly<Record<string, string>>;
|
|
112
|
-
}
|
|
113
4
|
/**
|
|
114
5
|
* The events `Client.on()` takes, and what each delivers. May gain events in a
|
|
115
6
|
* minor release; code that handles every event generically should expect
|
package/dist/types.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../src/types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACV,
|
|
1
|
+
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../src/types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACV,gBAAgB,EAChB,gBAAgB,EAChB,gBAAgB,EAChB,iBAAiB,EACjB,WAAW,EACX,MAAM,EACN,iBAAiB,EACjB,SAAS,EACT,gBAAgB,EAChB,cAAc,EACf,MAAM,0BAA0B,CAAC;AAClC,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,aAAa,CAAC;AAC1C,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,gBAAgB,CAAC;AAIvD;;;;GAIG;AACH,MAAM,WAAW,QAAQ;IACvB,gEAAgE;IAChE,WAAW,EAAE,gBAAgB,CAAC;IAC9B,qFAAqF;IACrF,WAAW,EAAE,gBAAgB,CAAC;IAC9B,kCAAkC;IAClC,WAAW,EAAE,gBAAgB,CAAC;IAC9B,iCAAiC;IACjC,WAAW,EAAE,gBAAgB,CAAC;IAC9B,+BAA+B;IAC/B,KAAK,EAAE,SAAS,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E,GAAG,SAAS,CAAC;IAClE,sEAAsE;IACtE,QAAQ,CAAC,cAAc,CAAC,EAAE,MAAM,GAAG,SAAS,CAAC;IAC7C,8EAA8E;IAC9E,QAAQ,CAAC,cAAc,CAAC,EAAE,MAAM,GAAG,SAAS,CAAC;IAC7C,qFAAqF;IACrF,QAAQ,CAAC,sBAAsB,CAAC,EAAE,MAAM,GAAG,SAAS,CAAC;CACtD"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@honeybbq/teamspeak-client",
|
|
3
|
-
"version": "1.0.0-beta.
|
|
3
|
+
"version": "1.0.0-beta.3",
|
|
4
4
|
"description": "A clean-room TeamSpeak client for Node.js, speaking the voice protocol the way the TeamSpeak application does",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"client",
|
|
@@ -37,10 +37,10 @@
|
|
|
37
37
|
},
|
|
38
38
|
"dependencies": {
|
|
39
39
|
"@noble/curves": "^2.0.1",
|
|
40
|
-
"@honeybbq/teamspeak-core": "1.0.0-beta.
|
|
40
|
+
"@honeybbq/teamspeak-core": "1.0.0-beta.3"
|
|
41
41
|
},
|
|
42
42
|
"engines": {
|
|
43
|
-
"node": ">=
|
|
43
|
+
"node": ">=22.12"
|
|
44
44
|
},
|
|
45
45
|
"scripts": {
|
|
46
46
|
"build": "vite build && tsc -p tsconfig.build.json",
|
package/src/client.ts
CHANGED
|
@@ -3,8 +3,6 @@ import {
|
|
|
3
3
|
type ClientOptions,
|
|
4
4
|
type EventMiddleware,
|
|
5
5
|
type AddrResolver,
|
|
6
|
-
type ClientEnterEvent,
|
|
7
|
-
type KickedEvent,
|
|
8
6
|
type Listener,
|
|
9
7
|
type ServerEvent,
|
|
10
8
|
type ServerEventName,
|
|
@@ -13,8 +11,10 @@ import {
|
|
|
13
11
|
} from "./types.js";
|
|
14
12
|
import {
|
|
15
13
|
type ChannelID,
|
|
14
|
+
type ClientEnterEvent,
|
|
16
15
|
type ClientID,
|
|
17
16
|
type Codec,
|
|
17
|
+
type KickedEvent,
|
|
18
18
|
type CommandMiddleware,
|
|
19
19
|
type CommandOptions,
|
|
20
20
|
type UID,
|
package/src/index.ts
CHANGED
|
@@ -12,14 +12,6 @@ export * from "@honeybbq/teamspeak-core";
|
|
|
12
12
|
export { Client, ClientStatus } from "./client.js";
|
|
13
13
|
|
|
14
14
|
export type {
|
|
15
|
-
TextMessageEvent,
|
|
16
|
-
ClientMovedEvent,
|
|
17
|
-
ClientLeaveEvent,
|
|
18
|
-
KickedEvent,
|
|
19
|
-
NotificationEvent,
|
|
20
|
-
ClientEnterEvent,
|
|
21
|
-
PokeEvent,
|
|
22
|
-
VoiceDataEvent,
|
|
23
15
|
EventMap,
|
|
24
16
|
EventMiddleware,
|
|
25
17
|
Listener,
|
package/src/notifications.ts
CHANGED
package/src/types.ts
CHANGED
|
@@ -1,135 +1,20 @@
|
|
|
1
1
|
import type {
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
2
|
+
ClientEnterEvent,
|
|
3
|
+
ClientLeaveEvent,
|
|
4
|
+
ClientMovedEvent,
|
|
5
5
|
CommandMiddleware,
|
|
6
|
+
KickedEvent,
|
|
6
7
|
Logger,
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
8
|
+
NotificationEvent,
|
|
9
|
+
PokeEvent,
|
|
10
|
+
TextMessageEvent,
|
|
11
|
+
VoiceDataEvent,
|
|
10
12
|
} from "@honeybbq/teamspeak-core";
|
|
11
13
|
import type { Duplex } from "node:stream";
|
|
12
14
|
import type { ReconnectOptions } from "./reconnect.js";
|
|
13
15
|
|
|
14
16
|
// ---- Events ---------------------------------------------------------------
|
|
15
17
|
|
|
16
|
-
/** A text message, sent privately, to a channel, or to the whole server. */
|
|
17
|
-
export interface TextMessageEvent {
|
|
18
|
-
/** The sender's nickname. */
|
|
19
|
-
readonly invokerName: string;
|
|
20
|
-
/** The sender's unique identifier. */
|
|
21
|
-
readonly invokerUID: UID;
|
|
22
|
-
/** The message, unescaped. */
|
|
23
|
-
readonly message: string;
|
|
24
|
-
/** The sender's server groups, as this client last saw them. */
|
|
25
|
-
readonly invokerGroups: readonly ServerGroupID[];
|
|
26
|
-
/**
|
|
27
|
-
* Private, channel or server; compare it with `TextMessageTarget`. A plain
|
|
28
|
-
* number, since a server may send a mode that table does not name.
|
|
29
|
-
*/
|
|
30
|
-
readonly targetMode: number;
|
|
31
|
-
/**
|
|
32
|
-
* The client a private message was sent to. Channel and server messages
|
|
33
|
-
* carry no target, so it is 0 for them.
|
|
34
|
-
*/
|
|
35
|
-
readonly targetID: ClientID;
|
|
36
|
-
/** The sender. */
|
|
37
|
-
readonly invokerID: ClientID;
|
|
38
|
-
}
|
|
39
|
-
|
|
40
|
-
/** A client changing channel, of its own accord or moved by someone. */
|
|
41
|
-
export interface ClientMovedEvent {
|
|
42
|
-
/** Who moved the client; the client itself for a move of its own. */
|
|
43
|
-
readonly invokerName: string;
|
|
44
|
-
/** The mover's unique identifier. */
|
|
45
|
-
readonly invokerUID: UID;
|
|
46
|
-
/** The channel the client is now in. */
|
|
47
|
-
readonly targetChannelID: ChannelID;
|
|
48
|
-
/** Why the client moved; compare it with `Reason`. */
|
|
49
|
-
readonly reason: number;
|
|
50
|
-
/** The client that moved. */
|
|
51
|
-
readonly clientID: ClientID;
|
|
52
|
-
/** The mover. */
|
|
53
|
-
readonly invokerID: ClientID;
|
|
54
|
-
}
|
|
55
|
-
|
|
56
|
-
/**
|
|
57
|
-
* A client going out of view: leaving the server, kicked or banned from it, or
|
|
58
|
-
* in a channel that stopped being subscribed.
|
|
59
|
-
*/
|
|
60
|
-
export interface ClientLeaveEvent {
|
|
61
|
-
/** The reason given for a kick or a ban, or the client's own parting message. */
|
|
62
|
-
readonly reasonMessage: string;
|
|
63
|
-
/** Why the client left; compare it with `Reason`. */
|
|
64
|
-
readonly reason: number;
|
|
65
|
-
/** The client that left. */
|
|
66
|
-
readonly clientID: ClientID;
|
|
67
|
-
/** Who kicked or banned the client; empty otherwise. */
|
|
68
|
-
readonly invokerName: string;
|
|
69
|
-
/** The kicker's unique identifier; empty unless kicked or banned. */
|
|
70
|
-
readonly invokerUID: UID;
|
|
71
|
-
/** The kicker; 0 unless kicked or banned. */
|
|
72
|
-
readonly invokerID: ClientID;
|
|
73
|
-
}
|
|
74
|
-
|
|
75
|
-
/** This client being kicked from its channel or the server. */
|
|
76
|
-
export interface KickedEvent {
|
|
77
|
-
/** The reason the invoker gave. */
|
|
78
|
-
readonly reasonMessage: string;
|
|
79
|
-
/** `Reason.KickChannel`, `Reason.KickServer` or `Reason.KickServerBan`. */
|
|
80
|
-
readonly reason: number;
|
|
81
|
-
/** Who kicked this client. */
|
|
82
|
-
readonly invokerName: string;
|
|
83
|
-
/** The kicker's unique identifier. */
|
|
84
|
-
readonly invokerUID: UID;
|
|
85
|
-
/** The kicker. */
|
|
86
|
-
readonly invokerID: ClientID;
|
|
87
|
-
}
|
|
88
|
-
|
|
89
|
-
/**
|
|
90
|
-
* A client coming into view: the same record `listClients` returns, so one
|
|
91
|
-
* type describes a client however it was learned of; its own id is `id`, as
|
|
92
|
-
* in every record. The fields only `clientlist -times` reports are undefined
|
|
93
|
-
* here.
|
|
94
|
-
*/
|
|
95
|
-
export type ClientEnterEvent = ClientEntry;
|
|
96
|
-
|
|
97
|
-
/** This client being poked. */
|
|
98
|
-
export interface PokeEvent {
|
|
99
|
-
/** Who poked. */
|
|
100
|
-
readonly invokerName: string;
|
|
101
|
-
/** The poker's unique identifier. */
|
|
102
|
-
readonly invokerUID: UID;
|
|
103
|
-
/** The poker. */
|
|
104
|
-
readonly invokerID: ClientID;
|
|
105
|
-
/** The poke's message, unescaped. */
|
|
106
|
-
readonly message: string;
|
|
107
|
-
}
|
|
108
|
-
|
|
109
|
-
/** Audio from another client, in the channel or whispered. */
|
|
110
|
-
export interface VoiceDataEvent {
|
|
111
|
-
/** Who is speaking. */
|
|
112
|
-
readonly clientID: ClientID;
|
|
113
|
-
/**
|
|
114
|
-
* How the audio is encoded; compare it with `Codec`. A plain number, since a
|
|
115
|
-
* server may relay a codec that table does not name.
|
|
116
|
-
*/
|
|
117
|
-
readonly codec: number;
|
|
118
|
-
/** One encoded frame, copied: it stays valid after the listener returns. */
|
|
119
|
-
readonly data: Uint8Array;
|
|
120
|
-
}
|
|
121
|
-
|
|
122
|
-
/**
|
|
123
|
-
* A notification from the server, as it arrived: the escape hatch for one the
|
|
124
|
-
* SDK does not model. Match its `name` against `NotificationName`.
|
|
125
|
-
*/
|
|
126
|
-
export interface NotificationEvent {
|
|
127
|
-
/** The notification's name, such as `notifyserveredited`; `NotificationName` lists the known ones. */
|
|
128
|
-
readonly name: NotificationName | (string & {});
|
|
129
|
-
/** Its parameters, unescaped. */
|
|
130
|
-
readonly params: Readonly<Record<string, string>>;
|
|
131
|
-
}
|
|
132
|
-
|
|
133
18
|
/**
|
|
134
19
|
* The events `Client.on()` takes, and what each delivers. May gain events in a
|
|
135
20
|
* minor release; code that handles every event generically should expect
|