@honeybbq/teamspeak 0.0.1 → 1.0.0-beta.7
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/LICENSE +21 -0
- package/README.md +726 -2
- package/dist/client/abort.d.ts +5 -0
- package/dist/client/abort.d.ts.map +1 -0
- package/dist/client/abort.js +23 -0
- package/dist/client/abort.js.map +1 -0
- package/dist/client/address.d.ts +17 -0
- package/dist/client/address.d.ts.map +1 -0
- package/dist/client/address.js +66 -0
- package/dist/client/address.js.map +1 -0
- package/dist/client/api/voice.d.ts +24 -0
- package/dist/client/api/voice.d.ts.map +1 -0
- package/dist/client/api/voice.js +33 -0
- package/dist/client/api/voice.js.map +1 -0
- package/dist/client/capabilities.d.ts +68 -0
- package/dist/client/capabilities.d.ts.map +1 -0
- package/dist/client/capabilities.js +59 -0
- package/dist/client/capabilities.js.map +1 -0
- package/dist/client/client.d.ts +196 -0
- package/dist/client/client.d.ts.map +1 -0
- package/dist/client/client.js +1523 -0
- package/dist/client/client.js.map +1 -0
- package/dist/client/commands.d.ts +66 -0
- package/dist/client/commands.d.ts.map +1 -0
- package/dist/client/commands.js +162 -0
- package/dist/client/commands.js.map +1 -0
- package/dist/client/crypto/crypt-ops.d.ts +7 -0
- package/dist/client/crypto/crypt-ops.d.ts.map +1 -0
- package/dist/client/crypto/crypt-ops.js +2 -0
- package/dist/client/crypto/crypt-ops.js.map +1 -0
- package/dist/client/crypto/crypt.d.ts +37 -0
- package/dist/client/crypto/crypt.d.ts.map +1 -0
- package/dist/client/crypto/crypt.js +203 -0
- package/dist/client/crypto/crypt.js.map +1 -0
- package/dist/client/crypto/eax.d.ts +12 -0
- package/dist/client/crypto/eax.d.ts.map +1 -0
- package/dist/client/crypto/eax.js +118 -0
- package/dist/client/crypto/eax.js.map +1 -0
- package/dist/client/crypto/identity.d.ts +97 -0
- package/dist/client/crypto/identity.d.ts.map +1 -0
- package/dist/client/crypto/identity.js +412 -0
- package/dist/client/crypto/identity.js.map +1 -0
- package/dist/client/crypto/index.d.ts +7 -0
- package/dist/client/crypto/index.d.ts.map +1 -0
- package/dist/client/crypto/index.js +5 -0
- package/dist/client/crypto/index.js.map +1 -0
- package/dist/client/crypto/primitives.d.ts +43 -0
- package/dist/client/crypto/primitives.d.ts.map +1 -0
- package/dist/client/crypto/primitives.js +116 -0
- package/dist/client/crypto/primitives.js.map +1 -0
- package/dist/client/diagnostics.d.ts +45 -0
- package/dist/client/diagnostics.d.ts.map +1 -0
- package/dist/client/diagnostics.js +30 -0
- package/dist/client/diagnostics.js.map +1 -0
- package/dist/client/discovery/index.d.ts +2 -0
- package/dist/client/discovery/index.d.ts.map +1 -0
- package/dist/client/discovery/index.js +2 -0
- package/dist/client/discovery/index.js.map +1 -0
- package/dist/client/discovery/resolver.d.ts +26 -0
- package/dist/client/discovery/resolver.d.ts.map +1 -0
- package/dist/client/discovery/resolver.js +275 -0
- package/dist/client/discovery/resolver.js.map +1 -0
- package/dist/client/errors.d.ts +82 -0
- package/dist/client/errors.d.ts.map +1 -0
- package/dist/client/errors.js +201 -0
- package/dist/client/errors.js.map +1 -0
- package/dist/client/events.d.ts +3 -0
- package/dist/client/events.d.ts.map +1 -0
- package/dist/client/events.js +8 -0
- package/dist/client/events.js.map +1 -0
- package/dist/client/handshake/crypt-handshake.d.ts +17 -0
- package/dist/client/handshake/crypt-handshake.d.ts.map +1 -0
- package/dist/client/handshake/crypt-handshake.js +128 -0
- package/dist/client/handshake/crypt-handshake.js.map +1 -0
- package/dist/client/handshake/crypt-init2.d.ts +7 -0
- package/dist/client/handshake/crypt-init2.d.ts.map +1 -0
- package/dist/client/handshake/crypt-init2.js +37 -0
- package/dist/client/handshake/crypt-init2.js.map +1 -0
- package/dist/client/handshake/index.d.ts +4 -0
- package/dist/client/handshake/index.d.ts.map +1 -0
- package/dist/client/handshake/index.js +4 -0
- package/dist/client/handshake/index.js.map +1 -0
- package/dist/client/handshake/license.d.ts +35 -0
- package/dist/client/handshake/license.d.ts.map +1 -0
- package/dist/client/handshake/license.js +169 -0
- package/dist/client/handshake/license.js.map +1 -0
- package/dist/client/handshake.d.ts +27 -0
- package/dist/client/handshake.d.ts.map +1 -0
- package/dist/client/handshake.js +126 -0
- package/dist/client/handshake.js.map +1 -0
- package/dist/client/helpers.d.ts +6 -0
- package/dist/client/helpers.d.ts.map +1 -0
- package/dist/client/helpers.js +13 -0
- package/dist/client/helpers.js.map +1 -0
- package/dist/client/hooks.d.ts +7 -0
- package/dist/client/hooks.d.ts.map +1 -0
- package/dist/client/hooks.js +28 -0
- package/dist/client/hooks.js.map +1 -0
- package/dist/client/index.d.ts +26 -0
- package/dist/client/index.d.ts.map +1 -0
- package/dist/client/index.js +28 -0
- package/dist/client/index.js.map +1 -0
- package/dist/client/reconnect.d.ts +12 -0
- package/dist/client/reconnect.d.ts.map +1 -0
- package/dist/client/reconnect.js +44 -0
- package/dist/client/reconnect.js.map +1 -0
- package/dist/client/throttle.d.ts +20 -0
- package/dist/client/throttle.d.ts.map +1 -0
- package/dist/client/throttle.js +83 -0
- package/dist/client/throttle.js.map +1 -0
- package/dist/client/trace.d.ts +223 -0
- package/dist/client/trace.d.ts.map +1 -0
- package/dist/client/trace.js +13 -0
- package/dist/client/trace.js.map +1 -0
- package/dist/client/transfer.d.ts +111 -0
- package/dist/client/transfer.d.ts.map +1 -0
- package/dist/client/transfer.js +243 -0
- package/dist/client/transfer.js.map +1 -0
- package/dist/client/transport/generation-window.d.ts +30 -0
- package/dist/client/transport/generation-window.d.ts.map +1 -0
- package/dist/client/transport/generation-window.js +97 -0
- package/dist/client/transport/generation-window.js.map +1 -0
- package/dist/client/transport/handler.d.ts +61 -0
- package/dist/client/transport/handler.d.ts.map +1 -0
- package/dist/client/transport/handler.js +793 -0
- package/dist/client/transport/handler.js.map +1 -0
- package/dist/client/transport/index.d.ts +6 -0
- package/dist/client/transport/index.d.ts.map +1 -0
- package/dist/client/transport/index.js +5 -0
- package/dist/client/transport/index.js.map +1 -0
- package/dist/client/transport/packet.d.ts +36 -0
- package/dist/client/transport/packet.d.ts.map +1 -0
- package/dist/client/transport/packet.js +55 -0
- package/dist/client/transport/packet.js.map +1 -0
- package/dist/client/transport/quicklz.d.ts +24 -0
- package/dist/client/transport/quicklz.d.ts.map +1 -0
- package/dist/client/transport/quicklz.js +179 -0
- package/dist/client/transport/quicklz.js.map +1 -0
- package/dist/client/types.d.ts +226 -0
- package/dist/client/types.d.ts.map +1 -0
- package/dist/client/types.js +39 -0
- package/dist/client/types.js.map +1 -0
- package/dist/core/api/channels.d.ts +182 -0
- package/dist/core/api/channels.d.ts.map +1 -0
- package/dist/core/api/channels.js +155 -0
- package/dist/core/api/channels.js.map +1 -0
- package/dist/core/api/clients.d.ts +304 -0
- package/dist/core/api/clients.d.ts.map +1 -0
- package/dist/core/api/clients.js +260 -0
- package/dist/core/api/clients.js.map +1 -0
- package/dist/core/api/command.d.ts +305 -0
- package/dist/core/api/command.d.ts.map +1 -0
- package/dist/core/api/command.js +363 -0
- package/dist/core/api/command.js.map +1 -0
- package/dist/core/api/files.d.ts +153 -0
- package/dist/core/api/files.d.ts.map +1 -0
- package/dist/core/api/files.js +181 -0
- package/dist/core/api/files.js.map +1 -0
- package/dist/core/api/groups.d.ts +248 -0
- package/dist/core/api/groups.d.ts.map +1 -0
- package/dist/core/api/groups.js +271 -0
- package/dist/core/api/groups.js.map +1 -0
- package/dist/core/api/moderation.d.ts +205 -0
- package/dist/core/api/moderation.d.ts.map +1 -0
- package/dist/core/api/moderation.js +209 -0
- package/dist/core/api/moderation.js.map +1 -0
- package/dist/core/api/parse.d.ts +16 -0
- package/dist/core/api/parse.d.ts.map +1 -0
- package/dist/core/api/parse.js +40 -0
- package/dist/core/api/parse.js.map +1 -0
- package/dist/core/api/server.d.ts +310 -0
- package/dist/core/api/server.d.ts.map +1 -0
- package/dist/core/api/server.js +290 -0
- package/dist/core/api/server.js.map +1 -0
- package/dist/core/command/command.d.ts +20 -0
- package/dist/core/command/command.d.ts.map +1 -0
- package/dist/core/command/command.js +112 -0
- package/dist/core/command/command.js.map +1 -0
- package/dist/core/command/ids.d.ts +125 -0
- package/dist/core/command/ids.d.ts.map +1 -0
- package/dist/core/command/ids.js +85 -0
- package/dist/core/command/ids.js.map +1 -0
- package/dist/core/command/parser.d.ts +17 -0
- package/dist/core/command/parser.d.ts.map +1 -0
- package/dist/core/command/parser.js +65 -0
- package/dist/core/command/parser.js.map +1 -0
- package/dist/core/command/request.d.ts +61 -0
- package/dist/core/command/request.d.ts.map +1 -0
- package/dist/core/command/request.js +64 -0
- package/dist/core/command/request.js.map +1 -0
- package/dist/core/command/responses.d.ts +59 -0
- package/dist/core/command/responses.d.ts.map +1 -0
- package/dist/core/command/responses.js +74 -0
- package/dist/core/command/responses.js.map +1 -0
- package/dist/core/command-name.d.ts +333 -0
- package/dist/core/command-name.d.ts.map +1 -0
- package/dist/core/command-name.js +331 -0
- package/dist/core/command-name.js.map +1 -0
- package/dist/core/enums.d.ts +146 -0
- package/dist/core/enums.d.ts.map +1 -0
- package/dist/core/enums.js +132 -0
- package/dist/core/enums.js.map +1 -0
- package/dist/core/errorcode.d.ts +413 -0
- package/dist/core/errorcode.d.ts.map +1 -0
- package/dist/core/errorcode.js +410 -0
- package/dist/core/errorcode.js.map +1 -0
- package/dist/core/errors.d.ts +111 -0
- package/dist/core/errors.d.ts.map +1 -0
- package/dist/core/errors.js +233 -0
- package/dist/core/errors.js.map +1 -0
- package/dist/core/events.d.ts +207 -0
- package/dist/core/events.d.ts.map +1 -0
- package/dist/core/events.js +6 -0
- package/dist/core/events.js.map +1 -0
- package/dist/core/helpers.d.ts +42 -0
- package/dist/core/helpers.d.ts.map +1 -0
- package/dist/core/helpers.js +156 -0
- package/dist/core/helpers.js.map +1 -0
- package/dist/core/index.d.ts +35 -0
- package/dist/core/index.d.ts.map +1 -0
- package/dist/core/index.js +34 -0
- package/dist/core/index.js.map +1 -0
- package/dist/core/internal.d.ts +23 -0
- package/dist/core/internal.d.ts.map +1 -0
- package/dist/core/internal.js +20 -0
- package/dist/core/internal.js.map +1 -0
- package/dist/core/middleware.d.ts +14 -0
- package/dist/core/middleware.d.ts.map +1 -0
- package/dist/core/middleware.js +18 -0
- package/dist/core/middleware.js.map +1 -0
- package/dist/core/notification-name.d.ts +154 -0
- package/dist/core/notification-name.d.ts.map +1 -0
- package/dist/core/notification-name.js +152 -0
- package/dist/core/notification-name.js.map +1 -0
- package/dist/core/notifications.d.ts +43 -0
- package/dist/core/notifications.d.ts.map +1 -0
- package/dist/core/notifications.js +116 -0
- package/dist/core/notifications.js.map +1 -0
- package/dist/core/permission-name.d.ts +533 -0
- package/dist/core/permission-name.d.ts.map +1 -0
- package/dist/core/permission-name.js +531 -0
- package/dist/core/permission-name.js.map +1 -0
- package/dist/core/permission.d.ts +31 -0
- package/dist/core/permission.d.ts.map +1 -0
- package/dist/core/permission.js +20 -0
- package/dist/core/permission.js.map +1 -0
- package/dist/core/property-name.d.ts +403 -0
- package/dist/core/property-name.d.ts.map +1 -0
- package/dist/core/property-name.js +405 -0
- package/dist/core/property-name.js.map +1 -0
- package/dist/core/reason.d.ts +39 -0
- package/dist/core/reason.d.ts.map +1 -0
- package/dist/core/reason.js +36 -0
- package/dist/core/reason.js.map +1 -0
- package/dist/core/reconnect.d.ts +59 -0
- package/dist/core/reconnect.d.ts.map +1 -0
- package/dist/core/reconnect.js +55 -0
- package/dist/core/reconnect.js.map +1 -0
- package/dist/core/types.d.ts +110 -0
- package/dist/core/types.d.ts.map +1 -0
- package/dist/core/types.js +27 -0
- package/dist/core/types.js.map +1 -0
- package/dist/query/client.d.ts +194 -0
- package/dist/query/client.d.ts.map +1 -0
- package/dist/query/client.js +967 -0
- package/dist/query/client.js.map +1 -0
- package/dist/query/errors.d.ts +61 -0
- package/dist/query/errors.d.ts.map +1 -0
- package/dist/query/errors.js +100 -0
- package/dist/query/errors.js.map +1 -0
- package/dist/query/index.d.ts +36 -0
- package/dist/query/index.d.ts.map +1 -0
- package/dist/query/index.js +34 -0
- package/dist/query/index.js.map +1 -0
- package/dist/query/knownhosts.d.ts +61 -0
- package/dist/query/knownhosts.d.ts.map +1 -0
- package/dist/query/knownhosts.js +223 -0
- package/dist/query/knownhosts.js.map +1 -0
- package/dist/query/lines.d.ts +14 -0
- package/dist/query/lines.d.ts.map +1 -0
- package/dist/query/lines.js +29 -0
- package/dist/query/lines.js.map +1 -0
- package/dist/query/options.d.ts +187 -0
- package/dist/query/options.d.ts.map +1 -0
- package/dist/query/options.js +213 -0
- package/dist/query/options.js.map +1 -0
- package/dist/query/reconnect.d.ts +29 -0
- package/dist/query/reconnect.d.ts.map +1 -0
- package/dist/query/reconnect.js +87 -0
- package/dist/query/reconnect.js.map +1 -0
- package/dist/query/ssh.d.ts +345 -0
- package/dist/query/ssh.d.ts.map +1 -0
- package/dist/query/ssh.js +241 -0
- package/dist/query/ssh.js.map +1 -0
- package/dist/query/stream.d.ts +38 -0
- package/dist/query/stream.d.ts.map +1 -0
- package/dist/query/stream.js +70 -0
- package/dist/query/stream.js.map +1 -0
- package/dist/query/tcp.d.ts +38 -0
- package/dist/query/tcp.d.ts.map +1 -0
- package/dist/query/tcp.js +53 -0
- package/dist/query/tcp.js.map +1 -0
- package/dist/query/transport.d.ts +36 -0
- package/dist/query/transport.d.ts.map +1 -0
- package/dist/query/transport.js +2 -0
- package/dist/query/transport.js.map +1 -0
- package/dist/query/web.d.ts +54 -0
- package/dist/query/web.d.ts.map +1 -0
- package/dist/query/web.js +146 -0
- package/dist/query/web.js.map +1 -0
- package/dist/versions/index.d.ts +3094 -0
- package/dist/versions/index.d.ts.map +1 -0
- package/dist/versions/index.js +9237 -0
- package/dist/versions/index.js.map +1 -0
- package/package.json +118 -4
- package/src/client/abort.ts +24 -0
- package/src/client/address.ts +74 -0
- package/src/client/api/voice.ts +61 -0
- package/src/client/capabilities.ts +106 -0
- package/src/client/client.ts +1809 -0
- package/src/client/commands.ts +193 -0
- package/src/client/crypto/crypt-ops.ts +6 -0
- package/src/client/crypto/crypt.ts +275 -0
- package/src/client/crypto/eax.ts +152 -0
- package/src/client/crypto/identity.ts +484 -0
- package/src/client/crypto/index.ts +21 -0
- package/src/client/crypto/primitives.ts +141 -0
- package/src/client/diagnostics.ts +58 -0
- package/src/client/discovery/index.ts +1 -0
- package/src/client/discovery/resolver.ts +325 -0
- package/src/client/errors.ts +217 -0
- package/src/client/events.ts +12 -0
- package/src/client/handshake/crypt-handshake.ts +157 -0
- package/src/client/handshake/crypt-init2.ts +48 -0
- package/src/client/handshake/index.ts +3 -0
- package/src/client/handshake/license.ts +208 -0
- package/src/client/handshake.ts +150 -0
- package/src/client/helpers.ts +10 -0
- package/src/client/hooks.ts +30 -0
- package/src/client/index.ts +93 -0
- package/src/client/reconnect.ts +43 -0
- package/src/client/throttle.ts +92 -0
- package/src/client/trace.ts +237 -0
- package/src/client/transfer.ts +436 -0
- package/src/client/transport/generation-window.ts +108 -0
- package/src/client/transport/handler.ts +926 -0
- package/src/client/transport/index.ts +14 -0
- package/src/client/transport/packet.ts +69 -0
- package/src/client/transport/quicklz.ts +209 -0
- package/src/client/types.ts +268 -0
- package/src/core/api/channels.ts +396 -0
- package/src/core/api/clients.ts +654 -0
- package/src/core/api/command.ts +563 -0
- package/src/core/api/files.ts +405 -0
- package/src/core/api/groups.ts +622 -0
- package/src/core/api/moderation.ts +525 -0
- package/src/core/api/parse.ts +52 -0
- package/src/core/api/server.ts +709 -0
- package/src/core/command/command.ts +125 -0
- package/src/core/command/ids.ts +149 -0
- package/src/core/command/parser.ts +68 -0
- package/src/core/command/request.ts +119 -0
- package/src/core/command/responses.ts +114 -0
- package/src/core/command-name.ts +334 -0
- package/src/core/enums.ts +167 -0
- package/src/core/errorcode.ts +412 -0
- package/src/core/errors.ts +258 -0
- package/src/core/events.ts +219 -0
- package/src/core/helpers.ts +161 -0
- package/src/core/index.ts +126 -0
- package/src/core/internal.ts +23 -0
- package/src/core/middleware.ts +24 -0
- package/src/core/notification-name.ts +155 -0
- package/src/core/notifications.ts +157 -0
- package/src/core/permission-name.ts +538 -0
- package/src/core/permission.ts +34 -0
- package/src/core/property-name.ts +411 -0
- package/src/core/reason.ts +38 -0
- package/src/core/reconnect.ts +98 -0
- package/src/core/types.ts +138 -0
- package/src/query/client.ts +1132 -0
- package/src/query/errors.ts +108 -0
- package/src/query/index.ts +65 -0
- package/src/query/knownhosts.ts +257 -0
- package/src/query/lines.ts +28 -0
- package/src/query/options.ts +388 -0
- package/src/query/reconnect.ts +84 -0
- package/src/query/ssh.ts +614 -0
- package/src/query/stream.ts +91 -0
- package/src/query/tcp.ts +85 -0
- package/src/query/transport.ts +35 -0
- package/src/query/web.ts +195 -0
- package/src/versions/index.ts +10774 -0
|
@@ -0,0 +1,155 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The names of the notifications a TeamSpeak server sends, for matching the
|
|
3
|
+
* `notification` event:
|
|
4
|
+
*
|
|
5
|
+
* ```ts
|
|
6
|
+
* client.on(EventName.Notification, (n) => {
|
|
7
|
+
* if (n.name === NotificationName.ChannelEdited) { ... }
|
|
8
|
+
* });
|
|
9
|
+
* ```
|
|
10
|
+
*
|
|
11
|
+
* Many are also how the voice protocol answers a command, which the client
|
|
12
|
+
* already pairs with its command. A server may send notifications this table
|
|
13
|
+
* does not name, which is why `NotificationEvent.name` is not limited to it.
|
|
14
|
+
*/
|
|
15
|
+
const notificationNameValues = {
|
|
16
|
+
/** `notifybanlist`: Reply to banlist: one row per ban rule on the virtual server. */
|
|
17
|
+
BanList: "notifybanlist",
|
|
18
|
+
/** `notifychannelchanged`: A channel's properties changed and this client should fetch them again. */
|
|
19
|
+
ChannelChanged: "notifychannelchanged",
|
|
20
|
+
/** `notifychannelclientpermlist`: Reply to channelclientpermlist: one row per permission set for a client in a channel. */
|
|
21
|
+
ChannelClientPermList: "notifychannelclientpermlist",
|
|
22
|
+
/** `notifychannelcreated`: A channel was created: it carries the new channel's properties and who created it. */
|
|
23
|
+
ChannelCreated: "notifychannelcreated",
|
|
24
|
+
/** `notifychanneldeleted`: A channel was deleted, with who deleted it. */
|
|
25
|
+
ChannelDeleted: "notifychanneldeleted",
|
|
26
|
+
/** `notifychanneldescriptionchanged`: A channel's description changed; the new text is fetched with channelgetdescription. */
|
|
27
|
+
ChannelDescriptionChanged: "notifychanneldescriptionchanged",
|
|
28
|
+
/** `notifychanneledited`: A channel was edited and these are its changed properties; it is also the reply to channelgetdescription, carrying the description. */
|
|
29
|
+
ChannelEdited: "notifychanneledited",
|
|
30
|
+
/** `notifychannelgroupclientlist`: Reply to channelgroupclientlist: one row per client assigned to a channel group in a channel. */
|
|
31
|
+
ChannelGroupClientList: "notifychannelgroupclientlist",
|
|
32
|
+
/** `notifychannelgrouplist`: Reply to channelgrouplist, and sent by the server on joining: one row per channel group. */
|
|
33
|
+
ChannelGroupList: "notifychannelgrouplist",
|
|
34
|
+
/** `notifychannelgrouppermlist`: Reply to channelgrouppermlist: one row per permission set on a channel group. */
|
|
35
|
+
ChannelGroupPermList: "notifychannelgrouppermlist",
|
|
36
|
+
/** `notifychannelmoved`: A channel was moved under another parent channel or reordered, with who moved it. */
|
|
37
|
+
ChannelMoved: "notifychannelmoved",
|
|
38
|
+
/** `notifychannelpasswordchanged`: A channel's password was set or changed. */
|
|
39
|
+
ChannelPasswordChanged: "notifychannelpasswordchanged",
|
|
40
|
+
/** `notifychannelpermhints`: The permissions this client holds on a channel changed; a bit set of hints tells which kinds of permission changed. */
|
|
41
|
+
ChannelPermHints: "notifychannelpermhints",
|
|
42
|
+
/** `notifychannelpermlist`: Reply to channelpermlist: one row per permission set on a channel. */
|
|
43
|
+
ChannelPermList: "notifychannelpermlist",
|
|
44
|
+
/** `notifychannelsubscribed`: This client is now subscribed to a channel, so it will see the clients in it. */
|
|
45
|
+
ChannelSubscribed: "notifychannelsubscribed",
|
|
46
|
+
/** `notifychannelunsubscribed`: This client is no longer subscribed to a channel, so the clients in it have gone out of view. */
|
|
47
|
+
ChannelUnsubscribed: "notifychannelunsubscribed",
|
|
48
|
+
/** `notifyclientchannelgroupchanged`: A client's channel group in a channel changed, with who changed it. */
|
|
49
|
+
ClientChannelGroupChanged: "notifyclientchannelgroupchanged",
|
|
50
|
+
/** `notifyclientchatclosed`: A client closed its private chat with this client. */
|
|
51
|
+
ClientChatClosed: "notifyclientchatclosed",
|
|
52
|
+
/** `notifyclientchatcomposing`: A client is typing a private message to this client. */
|
|
53
|
+
ClientChatComposing: "notifyclientchatcomposing",
|
|
54
|
+
/** `notifyclientdbfind`: Reply to clientdbfind: one row per matching client in the database. */
|
|
55
|
+
ClientDBFind: "notifyclientdbfind",
|
|
56
|
+
/** `notifyclientdbidfromuid`: Reply to clientgetdbidfromuid: the database id of the client with that unique id. */
|
|
57
|
+
ClientDBIDFromUID: "notifyclientdbidfromuid",
|
|
58
|
+
/** `notifyclientdblist`: Reply to clientdblist: one row per client known to the server. */
|
|
59
|
+
ClientDBList: "notifyclientdblist",
|
|
60
|
+
/** `notifycliententerview`: A client came into view: it connected, or moved into a channel this client is subscribed to. */
|
|
61
|
+
ClientEnterView: "notifycliententerview",
|
|
62
|
+
/** `notifyclientids`: Reply to clientgetids: the online client ids that belong to a unique id. */
|
|
63
|
+
ClientIDs: "notifyclientids",
|
|
64
|
+
/** `notifyclientleftview`: A client went out of view: it disconnected, was kicked or banned, or moved out of the subscribed channels. */
|
|
65
|
+
ClientLeftView: "notifyclientleftview",
|
|
66
|
+
/** `notifyclientmoved`: A client moved to another channel, with the reason and who moved it. */
|
|
67
|
+
ClientMoved: "notifyclientmoved",
|
|
68
|
+
/** `notifyclientnamefromdbid`: Reply to clientgetnamefromdbid: the unique id and nickname of the client with that database id. */
|
|
69
|
+
ClientNameFromDBID: "notifyclientnamefromdbid",
|
|
70
|
+
/** `notifyclientnamefromuid`: Reply to clientgetnamefromuid: the database id and nickname of the client with that unique id. */
|
|
71
|
+
ClientNameFromUID: "notifyclientnamefromuid",
|
|
72
|
+
/** `notifyclientneededpermissions`: A command failed or a feature is unavailable because this client lacks a permission; it names the permission id and the value needed. */
|
|
73
|
+
ClientNeededPermissions: "notifyclientneededpermissions",
|
|
74
|
+
/** `notifyclientpermhints`: The permissions this client holds changed; a bit set of hints tells which kinds of permission changed. */
|
|
75
|
+
ClientPermHints: "notifyclientpermhints",
|
|
76
|
+
/** `notifyclientpermlist`: Reply to clientpermlist: one row per permission set on a client. */
|
|
77
|
+
ClientPermList: "notifyclientpermlist",
|
|
78
|
+
/** `notifyclientpoke`: Another client poked this client with a message. */
|
|
79
|
+
ClientPoke: "notifyclientpoke",
|
|
80
|
+
/** `notifyclientserverqueryloginpassword`: Reply to clientsetserverquerylogin: the generated ServerQuery password. */
|
|
81
|
+
ClientServerQueryLoginPassword: "notifyclientserverqueryloginpassword",
|
|
82
|
+
/** `notifyclientuidfromclid`: Reply to clientgetuidfromclid: the unique id and nickname of the client with that client id. */
|
|
83
|
+
ClientUIDFromCLID: "notifyclientuidfromclid",
|
|
84
|
+
/** `notifyclientupdated`: A client in view changed some of its properties, such as its nickname, mute state or away message. */
|
|
85
|
+
ClientUpdated: "notifyclientupdated",
|
|
86
|
+
/** `notifycomplainlist`: Reply to complainlist: one row per complaint. */
|
|
87
|
+
ComplainList: "notifycomplainlist",
|
|
88
|
+
/** `notifyconnectioninfo`: A client's connection statistics, sent in answer to a request for them (getconnectioninfo). */
|
|
89
|
+
ConnectionInfo: "notifyconnectioninfo",
|
|
90
|
+
/** `notifyconnectioninforequest`: The server asks this client to report its own connection statistics with setconnectioninfo. */
|
|
91
|
+
ConnectionInfoRequest: "notifyconnectioninforequest",
|
|
92
|
+
/** `notifyfileinfo`: Reply to ftgetfileinfo: one row per file, with its size and modification time. */
|
|
93
|
+
FileInfo: "notifyfileinfo",
|
|
94
|
+
/** `notifyfilelist`: Reply to ftgetfilelist: one row per file or directory in a channel's file repository. */
|
|
95
|
+
FileList: "notifyfilelist",
|
|
96
|
+
/** `notifyfilelistfinished`: The server has sent every notifyfilelist row for a channel path. */
|
|
97
|
+
FileListFinished: "notifyfilelistfinished",
|
|
98
|
+
/** `notifyfiletransferlist`: Reply to ftlist: one row per running file transfer. */
|
|
99
|
+
FileTransferList: "notifyfiletransferlist",
|
|
100
|
+
/** `notifymessage`: Reply to messageget: an offline message with its subject and body. */
|
|
101
|
+
Message: "notifymessage",
|
|
102
|
+
/** `notifymessagelist`: Reply to messagelist: one row per offline message in this client's inbox. */
|
|
103
|
+
MessageList: "notifymessagelist",
|
|
104
|
+
/** `notifypermfind`: Reply to permfind: one row per place a permission is assigned. */
|
|
105
|
+
PermFind: "notifypermfind",
|
|
106
|
+
/** `notifypermissionlist`: Reply to permissionlist: one row per permission the server knows, with its id, name and description. */
|
|
107
|
+
PermissionList: "notifypermissionlist",
|
|
108
|
+
/** `notifypermoverview`: Reply to permoverview: one row per permission assignment that applies to a client in a channel. */
|
|
109
|
+
PermOverview: "notifypermoverview",
|
|
110
|
+
/** `notifyplugincmd`: A plugin command another client sent with plugincmd, to this client's channel or to it directly. */
|
|
111
|
+
PluginCmd: "notifyplugincmd",
|
|
112
|
+
/** `notifyserverconnectioninfo`: Reply to serverrequestconnectioninfo: the virtual server's traffic and bandwidth statistics. */
|
|
113
|
+
ServerConnectionInfo: "notifyserverconnectioninfo",
|
|
114
|
+
/** `notifyserveredited`: The virtual server's settings were edited, with who edited them and the settings that changed. */
|
|
115
|
+
ServerEdited: "notifyserveredited",
|
|
116
|
+
/** `notifyservergroupclientadded`: A client was added to a server group, with who added it. */
|
|
117
|
+
ServerGroupClientAdded: "notifyservergroupclientadded",
|
|
118
|
+
/** `notifyservergroupclientdeleted`: A client was removed from a server group, with who removed it. */
|
|
119
|
+
ServerGroupClientDeleted: "notifyservergroupclientdeleted",
|
|
120
|
+
/** `notifyservergroupclientlist`: Reply to servergroupclientlist: one row per client in a server group. */
|
|
121
|
+
ServerGroupClientList: "notifyservergroupclientlist",
|
|
122
|
+
/** `notifyservergrouplist`: Reply to servergrouplist, and sent by the server on joining: one row per server group. */
|
|
123
|
+
ServerGroupList: "notifyservergrouplist",
|
|
124
|
+
/** `notifyservergrouppermlist`: Reply to servergrouppermlist: one row per permission set on a server group. */
|
|
125
|
+
ServerGroupPermList: "notifyservergrouppermlist",
|
|
126
|
+
/** `notifyservergroupsbyclientid`: Reply to servergroupsbyclientid: one row per server group a client belongs to. */
|
|
127
|
+
ServerGroupsByClientID: "notifyservergroupsbyclientid",
|
|
128
|
+
/** `notifyserverlog`: Reply to logview: a chunk of the server log with the position to read on from. */
|
|
129
|
+
ServerLog: "notifyserverlog",
|
|
130
|
+
/** `notifyservertemppasswordlist`: Reply to servertemppasswordlist: one row per active temporary server password. */
|
|
131
|
+
ServerTempPasswordList: "notifyservertemppasswordlist",
|
|
132
|
+
/** `notifyserverupdated`: The virtual server's statistics and settings, sent when they change or when this client asks for them. */
|
|
133
|
+
ServerUpdated: "notifyserverupdated",
|
|
134
|
+
/** `notifystartdownload`: Reply to ftinitdownload: the key, port and size to start a download on the file transfer port. */
|
|
135
|
+
StartDownload: "notifystartdownload",
|
|
136
|
+
/** `notifystartupload`: Reply to ftinitupload: the key, port and offset to start an upload on the file transfer port. */
|
|
137
|
+
StartUpload: "notifystartupload",
|
|
138
|
+
/** `notifystatusfiletransfer`: A file transfer ended or failed: it carries the status code and message for the transfer's client-side id. */
|
|
139
|
+
StatusFileTransfer: "notifystatusfiletransfer",
|
|
140
|
+
/** `notifytextmessage`: A text message arrived, to this client, its channel or the whole server, with who sent it. */
|
|
141
|
+
TextMessage: "notifytextmessage",
|
|
142
|
+
/** `notifytokenadd`: Reply to privilegekeyadd: the new privilege key. */
|
|
143
|
+
TokenAdd: "notifytokenadd",
|
|
144
|
+
/** `notifytokenlist`: Reply to privilegekeylist: one row per privilege key. */
|
|
145
|
+
TokenList: "notifytokenlist",
|
|
146
|
+
/** `notifytokenused`: A privilege key was used, with who used it and the groups it granted. */
|
|
147
|
+
TokenUsed: "notifytokenused",
|
|
148
|
+
} as const;
|
|
149
|
+
|
|
150
|
+
/** The notification names; see {@link NotificationName}'s entries for what each carries. */
|
|
151
|
+
export const NotificationName: typeof notificationNameValues =
|
|
152
|
+
/* @__PURE__ */ Object.freeze(notificationNameValues);
|
|
153
|
+
|
|
154
|
+
/** A notification name a TeamSpeak 3.13 or 6 server sends. */
|
|
155
|
+
export type NotificationName = (typeof NotificationName)[keyof typeof NotificationName];
|
|
@@ -0,0 +1,157 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The notifications a server pushes, read as the events every client
|
|
3
|
+
* delivers.
|
|
4
|
+
*
|
|
5
|
+
* The voice protocol and ServerQuery carry the same notifications — a move is
|
|
6
|
+
* `notifyclientmoved` on both — and only their framing differs, which each
|
|
7
|
+
* client's own reader takes care of. So the parsing lives here, and both
|
|
8
|
+
* clients call it rather than keeping a copy each.
|
|
9
|
+
*
|
|
10
|
+
* A result is one notification's worth: the event it makes, plus what only the
|
|
11
|
+
* client can decide, such as whether a client that left view was itself.
|
|
12
|
+
*/
|
|
13
|
+
|
|
14
|
+
import { asChannelID, asClientID, asUID } from "./command/ids.js";
|
|
15
|
+
import { parseClient } from "./api/parse.js";
|
|
16
|
+
import { parseInt10, parseUint16, parseUint64 } from "./helpers.js";
|
|
17
|
+
import type { Command } from "./command/command.js";
|
|
18
|
+
import type {
|
|
19
|
+
ClientEnterEvent,
|
|
20
|
+
ClientLeaveEvent,
|
|
21
|
+
ClientMovedEvent,
|
|
22
|
+
PokeEvent,
|
|
23
|
+
TextMessageEvent,
|
|
24
|
+
} from "./events.js";
|
|
25
|
+
|
|
26
|
+
/** What one notification amounts to. */
|
|
27
|
+
export type NotificationResult =
|
|
28
|
+
| { kind: "clientEnter"; info: ClientEnterEvent }
|
|
29
|
+
| { kind: "clientLeave"; event: ClientLeaveEvent; isSelf: boolean }
|
|
30
|
+
| { kind: "clientMoved"; event: ClientMovedEvent }
|
|
31
|
+
| { kind: "textMessage"; message: TextMessageEvent }
|
|
32
|
+
| { kind: "poked"; event: PokeEvent }
|
|
33
|
+
| { kind: "unknown" };
|
|
34
|
+
|
|
35
|
+
/**
|
|
36
|
+
* Read a notification. `cmd` is the parsed notification line, `selfCLID` this
|
|
37
|
+
* client's own id (0 when it is not known yet), and `clients` the clients the
|
|
38
|
+
* caller knows, which the enter and leave notifications keep current and the
|
|
39
|
+
* others read: a text message carries no groups, and a move of the client's
|
|
40
|
+
* own carries no invoker.
|
|
41
|
+
*/
|
|
42
|
+
export function handleNotification(
|
|
43
|
+
cmd: Command,
|
|
44
|
+
selfCLID: number,
|
|
45
|
+
clients: Map<number, ClientEnterEvent>,
|
|
46
|
+
): NotificationResult {
|
|
47
|
+
switch (cmd.name) {
|
|
48
|
+
case "notifycliententerview":
|
|
49
|
+
return handleClientEnterView(cmd, clients);
|
|
50
|
+
case "notifyclientleftview":
|
|
51
|
+
return handleClientLeftView(cmd, selfCLID, clients);
|
|
52
|
+
case "notifyclientmoved":
|
|
53
|
+
return handleClientMoved(cmd, clients);
|
|
54
|
+
case "notifytextmessage":
|
|
55
|
+
return handleTextMessage(cmd, clients);
|
|
56
|
+
case "notifyclientpoke":
|
|
57
|
+
return handleClientPoked(cmd);
|
|
58
|
+
default:
|
|
59
|
+
return { kind: "unknown" };
|
|
60
|
+
}
|
|
61
|
+
}
|
|
62
|
+
|
|
63
|
+
function handleClientEnterView(
|
|
64
|
+
cmd: Command,
|
|
65
|
+
clients: Map<number, ClientEnterEvent>,
|
|
66
|
+
): NotificationResult {
|
|
67
|
+
const info = parseClient(cmd.params);
|
|
68
|
+
// No client has id 0: a row without one describes nobody.
|
|
69
|
+
if (info.id === 0) return { kind: "unknown" };
|
|
70
|
+
clients.set(info.id, info);
|
|
71
|
+
return { kind: "clientEnter", info };
|
|
72
|
+
}
|
|
73
|
+
|
|
74
|
+
function handleClientLeftView(
|
|
75
|
+
cmd: Command,
|
|
76
|
+
selfCLID: number,
|
|
77
|
+
clients: Map<number, ClientEnterEvent>,
|
|
78
|
+
): NotificationResult {
|
|
79
|
+
const clid = asClientID(parseUint16(cmd.params["clid"] ?? ""));
|
|
80
|
+
if (clid === 0) return { kind: "unknown" };
|
|
81
|
+
const isSelf = clid === selfCLID;
|
|
82
|
+
clients.delete(clid);
|
|
83
|
+
return {
|
|
84
|
+
kind: "clientLeave",
|
|
85
|
+
event: {
|
|
86
|
+
clientID: clid,
|
|
87
|
+
reason: parseInt10(cmd.params["reasonid"] ?? ""),
|
|
88
|
+
reasonMessage: cmd.params["reasonmsg"] ?? "",
|
|
89
|
+
invokerID: asClientID(parseUint16(cmd.params["invokerid"] ?? "")),
|
|
90
|
+
invokerName: cmd.params["invokername"] ?? "",
|
|
91
|
+
invokerUID: asUID(cmd.params["invokeruid"] ?? ""),
|
|
92
|
+
},
|
|
93
|
+
isSelf,
|
|
94
|
+
};
|
|
95
|
+
}
|
|
96
|
+
|
|
97
|
+
function handleClientMoved(
|
|
98
|
+
cmd: Command,
|
|
99
|
+
clients: Map<number, ClientEnterEvent>,
|
|
100
|
+
): NotificationResult {
|
|
101
|
+
const clid = asClientID(parseUint16(cmd.params["clid"] ?? ""));
|
|
102
|
+
const ctid = asChannelID(parseUint64(cmd.params["ctid"] ?? ""));
|
|
103
|
+
if (clid === 0) return { kind: "unknown" };
|
|
104
|
+
|
|
105
|
+
const existing = clients.get(clid);
|
|
106
|
+
if (existing) clients.set(clid, { ...existing, channelID: ctid });
|
|
107
|
+
|
|
108
|
+
// A move the client made itself names no invoker, so the fields are empty;
|
|
109
|
+
// the client it knows by `clid` is who that was.
|
|
110
|
+
const invokerID = asClientID(parseUint16(cmd.params["invokerid"] ?? ""));
|
|
111
|
+
const invoker = clients.get(invokerID === 0 ? clid : invokerID);
|
|
112
|
+
|
|
113
|
+
return {
|
|
114
|
+
kind: "clientMoved",
|
|
115
|
+
event: {
|
|
116
|
+
clientID: clid,
|
|
117
|
+
targetChannelID: ctid,
|
|
118
|
+
reason: parseInt10(cmd.params["reasonid"] ?? ""),
|
|
119
|
+
reasonMessage: cmd.params["reasonmsg"] ?? "",
|
|
120
|
+
invokerID,
|
|
121
|
+
invokerName: cmd.params["invokername"] ?? invoker?.nickname ?? "",
|
|
122
|
+
invokerUID: asUID(cmd.params["invokeruid"] ?? invoker?.uid ?? ""),
|
|
123
|
+
},
|
|
124
|
+
};
|
|
125
|
+
}
|
|
126
|
+
|
|
127
|
+
function handleTextMessage(
|
|
128
|
+
cmd: Command,
|
|
129
|
+
clients: Map<number, ClientEnterEvent>,
|
|
130
|
+
): NotificationResult {
|
|
131
|
+
const invokerID = asClientID(parseUint16(cmd.params["invokerid"] ?? ""));
|
|
132
|
+
const invokerInfo = clients.get(invokerID);
|
|
133
|
+
|
|
134
|
+
const message: TextMessageEvent = {
|
|
135
|
+
targetMode: parseInt10(cmd.params["targetmode"] ?? ""),
|
|
136
|
+
targetID: asClientID(parseUint16(cmd.params["target"] ?? "")),
|
|
137
|
+
invokerID,
|
|
138
|
+
invokerName: cmd.params["invokername"] ?? "",
|
|
139
|
+
invokerUID: asUID(cmd.params["invokeruid"] ?? invokerInfo?.uid ?? ""),
|
|
140
|
+
message: cmd.params["msg"] ?? "",
|
|
141
|
+
invokerGroups: invokerInfo?.serverGroups,
|
|
142
|
+
};
|
|
143
|
+
|
|
144
|
+
return { kind: "textMessage", message };
|
|
145
|
+
}
|
|
146
|
+
|
|
147
|
+
function handleClientPoked(cmd: Command): NotificationResult {
|
|
148
|
+
return {
|
|
149
|
+
kind: "poked",
|
|
150
|
+
event: {
|
|
151
|
+
invokerID: asClientID(parseUint16(cmd.params["invokerid"] ?? "")),
|
|
152
|
+
invokerName: cmd.params["invokername"] ?? "",
|
|
153
|
+
invokerUID: asUID(cmd.params["invokeruid"] ?? ""),
|
|
154
|
+
message: cmd.params["msg"] ?? "",
|
|
155
|
+
},
|
|
156
|
+
};
|
|
157
|
+
}
|