@wavezfm/api 0.1.6 → 0.1.8

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 CHANGED
@@ -17,10 +17,10 @@ bun add @wavezfm/api
17
17
  ## Quick Start
18
18
 
19
19
  ```ts
20
- import { createApiClient } from '@wavezfm/api';
20
+ import { createApiClient } from "@wavezfm/api";
21
21
 
22
22
  const client = createApiClient({
23
- baseURL: 'https://api.wavez.fm',
23
+ baseURL: "https://api.wavez.fm",
24
24
  });
25
25
 
26
26
  const rooms = await client.room.list();
@@ -31,13 +31,13 @@ console.log(rooms.data);
31
31
 
32
32
  ```ts
33
33
  createApiClient({
34
- baseURL: 'https://api.wavez.fm', // required
35
- timeout: 15_000, // optional, default: 30000
36
- logging: false, // optional
37
- headers: { 'X-App-Version': '1.0.0' }, // optional
38
- credentials: 'include', // optional, default: include
39
- locale: 'en', // optional, default: en
40
- })
34
+ baseURL: "https://api.wavez.fm",
35
+ timeout: 15_000,
36
+ logging: false,
37
+ headers: { "X-App-Version": "1.0.0" },
38
+ credentials: "include",
39
+ locale: "en",
40
+ });
41
41
  ```
42
42
 
43
43
  The client accepts:
@@ -51,228 +51,217 @@ You can localize SDK-generated errors with `locale` or override specific message
51
51
 
52
52
  ```ts
53
53
  const client = createApiClient({
54
- baseURL: 'https://api.wavez.fm',
55
- locale: 'en',
54
+ baseURL: "https://api.wavez.fm",
55
+ locale: "en",
56
56
  messages: {
57
- roomBotCreatePrefixLengthInvalid: 'Custom prefix length message.',
57
+ roomBotCreatePrefixLengthInvalid: "Custom prefix length message.",
58
58
  },
59
59
  });
60
60
  ```
61
61
 
62
- ## Browser Session Auth
62
+ ## API Surfaces
63
63
 
64
- WavezFM uses session cookies for most user-authenticated routes.
64
+ This SDK exposes three distinct surfaces. They do not authenticate the same way.
65
65
 
66
- ```ts
67
- const client = createApiClient({
68
- baseURL: 'https://api.wavez.fm',
69
- });
66
+ ### Site / Browser API
70
67
 
71
- await client.auth.login({
72
- email: 'user@example.com',
73
- password: 'secret',
74
- });
68
+ Use this for the normal site routes:
75
69
 
76
- const me = await client.auth.me();
77
- if (me.data) {
78
- console.log(me.data.displayUsername ?? me.data.username);
79
- }
80
- ```
70
+ - auth
71
+ - settings
72
+ - users
73
+ - rooms
74
+ - playlists
75
+ - chat
76
+ - billing
77
+ - shop
81
78
 
82
- For server-side Node integrations, room-bot routes are the best fit. Regular user routes rely on the browser session/cookie flow used by the site.
79
+ Auth mode:
83
80
 
84
- ## Room Bots
81
+ - browser session cookies
82
+ - same protections used by the site
85
83
 
86
- ```ts
87
- const client = createApiClient({
88
- baseURL: 'https://api.wavez.fm',
89
- });
84
+ This is also where bot tokens are created with `client.room.createBotToken(...)`.
90
85
 
91
- const created = await client.room.createBotToken('room-id', {
92
- botName: 'Night Shift Bot',
93
- commandPrefix: '!',
94
- permissions: ['read_state', 'read_chat', 'send_chat', 'manage_room'],
95
- });
86
+ ### Room Bot HTTP API
96
87
 
97
- const roomBotToken = created.data.token;
88
+ Use this for backend automation scoped to one room:
98
89
 
99
- // Persist this token in your backend or environment store.
100
- client.api.setRoomBotToken(roomBotToken);
90
+ - room state
91
+ - room event history
92
+ - bot chat send/read
93
+ - queue actions
94
+ - moderation and room management
101
95
 
102
- const state = await client.roomBot.getState('room-id');
103
- console.log(state.data.bot);
104
- ```
96
+ Auth mode:
105
97
 
106
- Important:
98
+ - room bot token with `client.api.setRoomBotToken(...)`
107
99
 
108
- - the plain bot token is returned by `client.room.createBotToken(...)`
109
- - it is only available in that creation response
110
- - store it securely on your backend after creation
111
- - later, load it back with `client.api.setRoomBotToken(...)`
100
+ ### Room Bot Realtime API
112
101
 
113
- ## Realtime Room Bots
102
+ Use this for low-latency bot behavior:
114
103
 
115
- ```ts
116
- import { createRoomBotRealtimeClient, formatMentionText } from '@wavezfm/api';
104
+ - chat listeners
105
+ - queue/playback/vote listeners
106
+ - command reactions
117
107
 
118
- const bot = createRoomBotRealtimeClient({
119
- baseURL: 'https://api.wavez.fm',
120
- botToken: process.env.WAVEZ_ROOM_BOT_TOKEN!,
121
- roomId: 'room-id',
122
- locale: 'en',
123
- autoReconnect: true,
124
- });
108
+ Auth mode:
125
109
 
126
- bot.on('message_created', (packet) => {
127
- console.log(packet.payload);
110
+ - room bot token over WebSocket
111
+
112
+ ## Site / Browser API
113
+
114
+ WavezFM uses session cookies for most user-authenticated routes.
115
+
116
+ ```ts
117
+ const client = createApiClient({
118
+ baseURL: "https://api.wavez.fm",
128
119
  });
129
120
 
130
- await bot.connect();
131
- bot.sendChat({
132
- content: `${formatMentionText('Agente MIB')} estou em modo AFK agora.`,
121
+ await client.auth.login({
122
+ email: "user@example.com",
123
+ password: "secret",
133
124
  });
125
+
126
+ const me = await client.auth.me();
127
+ if (me.data) {
128
+ console.log(me.data.displayUsername ?? me.data.username);
129
+ }
134
130
  ```
135
131
 
136
- The realtime helper automatically retries abnormal disconnects such as WebSocket close code `1006` by default. Fatal closes like revoked/invalid auth are not retried.
132
+ For server-side integrations, prefer the room-bot surfaces below. Regular user routes are browser-first.
137
133
 
138
- ## Resources
134
+ ### Site Resources
139
135
 
140
- All resources are exposed from the pre-configured client:
136
+ All site resources are exposed from the pre-configured client:
141
137
 
142
138
  ```ts
143
- const client = createApiClient({ baseURL: 'https://api.wavez.fm' });
139
+ const client = createApiClient({ baseURL: "https://api.wavez.fm" });
144
140
  ```
145
141
 
146
- ### Auth
142
+ #### Auth
147
143
 
148
144
  ```ts
149
145
  await client.auth.login({ email, password });
150
146
  await client.auth.register({ email, password, name, username });
151
- const me = await client.auth.me(); // returns `null` in `data` when there is no active session
147
+ const me = await client.auth.me();
152
148
  await client.auth.getPendingTwoFactor();
153
149
  await client.auth.sendPendingTwoFactorCode();
154
- await client.auth.verifyPendingTwoFactor({ code: '123456' });
150
+ await client.auth.verifyPendingTwoFactor({ code: "123456" });
155
151
  ```
156
152
 
157
- ### Settings
153
+ #### Settings
158
154
 
159
155
  ```ts
160
156
  await client.settings.get();
161
157
  await client.settings.update({
162
- bio: 'Late-night selector',
163
- presenceStatus: 'busy',
158
+ bio: "Late-night selector",
159
+ presenceStatus: "busy",
164
160
  showChatBadge: true,
165
161
  });
166
162
  await client.settings.getTwoFactor();
167
- await client.settings.startEmailTwoFactor({ password: 'secret' });
168
- await client.settings.startAuthenticatorTwoFactor({ password: 'secret' });
169
- await client.settings.disableTwoFactor({ password: 'secret' });
163
+ await client.settings.startEmailTwoFactor({ password: "secret" });
164
+ await client.settings.startAuthenticatorTwoFactor({ password: "secret" });
165
+ await client.settings.disableTwoFactor({ password: "secret" });
170
166
  ```
171
167
 
172
- ### Users
168
+ #### Users
173
169
 
174
170
  ```ts
175
- await client.user.getById('user-id');
176
- await client.user.getByUsername('haru');
177
- await client.user.getBadges('user-id');
171
+ await client.user.getById("user-id");
172
+ await client.user.getByUsername("haru");
173
+ await client.user.getBadges("user-id");
178
174
  await client.user.listAllBadges();
179
175
  ```
180
176
 
181
- ### Rooms
177
+ #### Rooms
182
178
 
183
179
  ```ts
184
180
  await client.room.list();
185
181
  await client.room.featured();
186
- await client.room.getBySlug('wavezfm-lounge');
187
- await client.room.getWaitlist('wavezfm-lounge');
188
- await client.room.create({ slug: 'my-room', name: 'My Room' });
189
- await client.room.join('wavezfm-lounge');
190
- await client.room.favorite('room-id');
191
- await client.room.getManagement('room-id');
192
- const createdBot = await client.room.createBotToken('room-id', {
193
- botName: 'Night Shift Bot',
194
- commandPrefix: '!',
195
- permissions: ['read_state', 'read_chat', 'send_chat', 'manage_room'],
196
- });
197
-
198
- client.api.setRoomBotToken(createdBot.data.token);
182
+ await client.room.getBySlug("wavezfm-lounge");
183
+ await client.room.getWaitlist("wavezfm-lounge");
184
+ await client.room.create({ slug: "my-room", name: "My Room" });
185
+ await client.room.join("wavezfm-lounge");
186
+ await client.room.favorite("room-id");
187
+ await client.room.getManagement("room-id");
199
188
  ```
200
189
 
201
- ### Playlists
190
+ #### Playlists
202
191
 
203
192
  ```ts
204
193
  await client.playlist.list();
205
- await client.playlist.create('My Playlist');
206
- await client.playlist.update('playlist-id', { name: 'Late Night Set' });
207
- await client.playlist.getTracks('playlist-id');
208
- await client.playlist.previewUrl('https://youtube.com/watch?v=dQw4w9WgXcQ');
209
- await client.playlist.addTrack('playlist-id', {
210
- source: 'youtube',
211
- sourceId: 'dQw4w9WgXcQ',
194
+ await client.playlist.create("My Playlist");
195
+ await client.playlist.update("playlist-id", { name: "Late Night Set" });
196
+ await client.playlist.getTracks("playlist-id");
197
+ await client.playlist.previewUrl("https://youtube.com/watch?v=dQw4w9WgXcQ");
198
+ await client.playlist.addTrack("playlist-id", {
199
+ source: "youtube",
200
+ sourceId: "dQw4w9WgXcQ",
212
201
  });
213
- await client.playlist.reorderTracks('playlist-id', ['track-a', 'track-b']);
202
+ await client.playlist.reorderTracks("playlist-id", ["track-a", "track-b"]);
214
203
  await client.playlist.startSpotifyImport({
215
- playlistId: 'playlist-id',
216
- url: 'https://open.spotify.com/playlist/...',
204
+ playlistId: "playlist-id",
205
+ url: "https://open.spotify.com/playlist/...",
217
206
  });
218
207
  ```
219
208
 
220
- ### Sources
209
+ #### Sources
221
210
 
222
211
  ```ts
223
- await client.source.searchYouTube('lofi hip hop', 10);
224
- await client.source.searchSoundCloud('nightcore', 10);
225
- await client.source.searchAll('ambient');
212
+ await client.source.searchYouTube("lofi hip hop", 10);
213
+ await client.source.searchSoundCloud("nightcore", 10);
214
+ await client.source.searchAll("ambient");
226
215
  ```
227
216
 
228
- ### Chat
217
+ #### Chat
229
218
 
230
219
  ```ts
231
- await client.chat.getMessages('room-id', 0, 50);
232
- await client.chat.getMessagesBySlug('wavezfm-lounge', 0, 50);
233
- await client.chat.updateMessage('room-id', 'message-id', {
234
- content: 'edited message',
220
+ await client.chat.getMessages("room-id", 0, 50);
221
+ await client.chat.getMessagesBySlug("wavezfm-lounge", 0, 50);
222
+ await client.chat.updateMessage("room-id", "message-id", {
223
+ content: "edited message",
235
224
  });
236
- await client.chat.pinMessage('room-id', 'message-id');
237
- await client.chat.clearChat('room-id');
225
+ await client.chat.pinMessage("room-id", "message-id");
226
+ await client.chat.clearChat("room-id");
238
227
  ```
239
228
 
240
- ### Friends / Fans
229
+ #### Friends / Fans
241
230
 
242
231
  ```ts
243
232
  await client.friend.list();
244
233
  await client.friend.pending();
245
- await client.friend.sendRequest('user-id');
246
- await client.friend.acceptRequest('request-id');
247
- await client.friend.follow('user-id');
234
+ await client.friend.sendRequest("user-id");
235
+ await client.friend.acceptRequest("request-id");
236
+ await client.friend.follow("user-id");
248
237
  await client.friend.followers();
249
238
  ```
250
239
 
251
- ### Shop
240
+ #### Shop
252
241
 
253
242
  ```ts
254
243
  await client.shop.getCatalog();
255
244
  await client.shop.getWallet();
256
- await client.shop.purchase({ itemId: 'badge-id' });
257
- await client.shop.equip('avatar-id');
245
+ await client.shop.purchase({ itemId: "badge-id" });
246
+ await client.shop.equip("avatar-id");
258
247
  await client.shop.getInventory();
259
248
  ```
260
249
 
261
- ### Billing
250
+ #### Billing
262
251
 
263
252
  ```ts
264
- await client.billing.createSubscriptionCheckout({ cycle: 'monthly' });
253
+ await client.billing.createSubscriptionCheckout({ cycle: "monthly" });
265
254
  await client.billing.createDiamondCheckout({ quantity: 1000 });
266
- await client.billing.createRoomDonationCheckout('room-id', { amountCents: 500 });
255
+ await client.billing.createRoomDonationCheckout("room-id", { amountCents: 500 });
267
256
  await client.billing.createGlobalDonationCheckout({ amountCents: 1000 });
268
257
  await client.billing.createDiamondGiftCheckout({
269
- recipientUsername: 'haru',
258
+ recipientUsername: "haru",
270
259
  quantity: 500,
271
260
  });
272
261
  await client.billing.listPendingGifts();
273
262
  ```
274
263
 
275
- ### System
264
+ #### System
276
265
 
277
266
  ```ts
278
267
  await client.system.status();
@@ -280,37 +269,125 @@ await client.system.publicStats();
280
269
  await client.system.health();
281
270
  ```
282
271
 
283
- ### Room Bots
272
+ ## Room Bot HTTP API
273
+
274
+ Room bot tokens are created from the site/session surface, then used on the bot surface.
275
+
276
+ ```ts
277
+ const client = createApiClient({
278
+ baseURL: "https://api.wavez.fm",
279
+ });
280
+
281
+ const created = await client.room.createBotToken("room-id", {
282
+ botName: "Night Shift Bot",
283
+ commandPrefix: "!",
284
+ permissions: ["read_state", "read_chat", "send_chat", "manage_room"],
285
+ });
286
+
287
+ const roomBotToken = created.data.token;
288
+
289
+ // Store this in your backend or environment store.
290
+ client.api.setRoomBotToken(roomBotToken);
291
+ ```
292
+
293
+ Important:
294
+
295
+ - the plain bot token is returned by `client.room.createBotToken(...)`
296
+ - it is only available in that creation response
297
+ - store it securely on your backend after creation
298
+ - later, load it back with `client.api.setRoomBotToken(...)`
299
+
300
+ ### Bot Resources
284
301
 
285
302
  ```ts
286
303
  client.api.setRoomBotToken(process.env.WAVEZ_ROOM_BOT_TOKEN!);
287
304
 
288
- await client.roomBot.getState('room-id');
289
- await client.roomBot.getEvents('room-id', {
305
+ await client.roomBot.getState("room-id");
306
+ await client.roomBot.getQueueStatus("room-id");
307
+ await client.roomBot.getMessages("room-id");
308
+ await client.roomBot.getEvents("room-id", {
290
309
  limit: 25,
291
- types: ['user_joined', 'user_left'],
310
+ types: ["user_joined", "waitlist_join", "left"],
292
311
  });
293
- await client.roomBot.getMessages('room-id');
294
- await client.roomBot.addToQueue('room-id', 'user-id');
295
- await client.roomBot.sendMessage('room-id', { content: '!lockqueue' });
296
- await client.roomBot.updateSettings('room-id', {
312
+ await client.roomBot.addToQueue("room-id", "user-id");
313
+ await client.roomBot.sendMessage("room-id", {
314
+ content: "!lockqueue",
315
+ });
316
+ await client.roomBot.editMessage("room-id", "message-id", {
317
+ content: "!lockqueue agora",
318
+ });
319
+ await client.roomBot.updateSettings("room-id", {
297
320
  queueLocked: true,
298
321
  commandAnnouncement: {
299
- commandId: 'lockqueue',
300
- actorUsername: 'Night Shift Bot',
322
+ commandId: "lockqueue",
323
+ actorUsername: "Night Shift Bot",
301
324
  },
302
325
  });
303
326
  ```
304
327
 
328
+ `roomBot.getEvents()` is the normalized HTTP history surface.
329
+
330
+ Returned `event` values:
331
+
332
+ - `user_joined`
333
+ - `waitlist_join`
334
+ - `left`
335
+
336
+ Accepted filter aliases in `types` for backward compatibility:
337
+
338
+ - `queue_joined` -> `waitlist_join`
339
+ - `user_left` -> `left`
340
+
341
+ ## Room Bot Realtime API
342
+
343
+ ```ts
344
+ import {
345
+ createRoomBotRealtimeClient,
346
+ formatMentionText,
347
+ } from "@wavezfm/api";
348
+
349
+ const bot = createRoomBotRealtimeClient({
350
+ baseURL: "https://api.wavez.fm",
351
+ botToken: process.env.WAVEZ_ROOM_BOT_TOKEN!,
352
+ roomId: "room-id",
353
+ locale: "en",
354
+ autoReconnect: true,
355
+ });
356
+
357
+ bot.on("message_created", (packet) => {
358
+ console.log(packet.payload);
359
+ });
360
+
361
+ bot.on("queue_joined", (packet) => {
362
+ console.log(packet.payload);
363
+ });
364
+
365
+ await bot.connect();
366
+ bot.sendChat({
367
+ content: `${formatMentionText("Agente MIB")} estou em modo AFK agora.`,
368
+ });
369
+ ```
370
+
371
+ The realtime helper automatically retries abnormal disconnects such as WebSocket close code `1006` by default. Fatal closes like revoked or invalid auth are not retried.
372
+
373
+ Important:
374
+
375
+ - realtime packet names are the raw WebSocket event names
376
+ - examples: `message_created`, `user_left`, `queue_joined`, `track_started`
377
+ - they are not normalized to the HTTP history names
378
+
305
379
  ## Error Handling
306
380
 
307
381
  All methods throw `ApiError` on failure.
308
382
 
309
383
  ```ts
310
- import { ApiError } from '@wavezfm/api';
384
+ import { ApiError } from "@wavezfm/api";
311
385
 
312
386
  try {
313
- await client.auth.login({ email: 'bad@example.com', password: 'bad' });
387
+ await client.auth.login({
388
+ email: "bad@example.com",
389
+ password: "bad",
390
+ });
314
391
  } catch (error) {
315
392
  if (error instanceof ApiError) {
316
393
  console.log(error.message);
@@ -324,9 +401,9 @@ try {
324
401
  ## Token Management
325
402
 
326
403
  ```ts
327
- const client = createApiClient({ baseURL: 'https://api.wavez.fm' });
404
+ const client = createApiClient({ baseURL: "https://api.wavez.fm" });
328
405
 
329
- client.api.setAuthToken('optional-bearer-token');
406
+ client.api.setAuthToken("optional-bearer-token");
330
407
  client.api.setRoomBotToken(process.env.WAVEZ_ROOM_BOT_TOKEN!);
331
408
 
332
409
  client.api.getAuthToken();
@@ -338,11 +415,11 @@ client.api.getRoomBotToken();
338
415
  For maximum tree-shaking, import only what you need:
339
416
 
340
417
  ```ts
341
- import { createApi } from '@wavezfm/api';
342
- import { createRoomResource } from '@wavezfm/api/resources/room';
343
- import { createRoomBotResource } from '@wavezfm/api/resources/room-bot';
418
+ import { createApi } from "@wavezfm/api";
419
+ import { createRoomResource } from "@wavezfm/api/resources/room";
420
+ import { createRoomBotResource } from "@wavezfm/api/resources/room-bot";
344
421
 
345
- const api = createApi({ baseURL: 'https://api.wavez.fm' });
422
+ const api = createApi({ baseURL: "https://api.wavez.fm" });
346
423
  const room = createRoomResource(api);
347
424
  const roomBot = createRoomBotResource(api);
348
425
  ```
@@ -357,13 +434,16 @@ import type {
357
434
  MediaSearchResult,
358
435
  ChatMessage,
359
436
  RoomBotState,
437
+ RoomPresenceEventType,
438
+ RoomPresenceEventFilterType,
360
439
  WsPacket,
361
- } from '@wavezfm/api';
440
+ } from "@wavezfm/api";
362
441
  ```
363
442
 
364
443
  ## Notes
365
444
 
366
- - user/session routes are browser-first because the backend uses cookies and same-origin protections
367
- - room-bot routes are ideal for backend integrations and automation
445
+ - site/session routes are browser-first because the backend uses cookies and same-origin protections
446
+ - room-bot HTTP routes are backend-first and scoped to one room
447
+ - room-bot realtime uses raw WebSocket packet names
368
448
  - the package is tree-shakable through factory exports in `resources/*`
369
449
  - the realtime helper expects native `WebSocket` or a custom `websocketFactory`
package/dist/index.d.ts CHANGED
@@ -15,7 +15,7 @@ export { createRoomBotResource } from "./resources/roomBot.js";
15
15
  export { parseRoomQueueSnapshot } from "./utils/roomQueue.js";
16
16
  export { formatMentionText } from "./utils/chat.js";
17
17
  export { createRoomBotRealtimeClient } from "./realtime/roomBot.js";
18
- export type { ApiClientConfig, ApiLike, ApiQuery, ApiQueryValue, ApiRequestOptions, ApiSuccessResponse, AuthMode, AuthUser, BadgeAssignment, ChatMessage, CheckoutSessionResponse, InventoryResponse, InventoryCatalogEntry, InventoryCatalogItem, MediaSearchResult, PlaylistSummary, PlaylistTrack, RoomBotPermission, RoomQueueEntry, RoomQueuePlayback, RoomQueueSnapshot, RoomQueueStatusResponse, RoomQueueUser, RoomQueueViewerStatus, RoomBotMessageReplyInput, RoomBotEventsResponse, RoomBotQueueAddResponse, RoomBotRealtimeClient, RoomBotRealtimeOptions, RoomBotSendMessageInput, RoomBotState, RoomBotToken, RoomPresenceEvent, RoomPresenceEventType, RoomSummary, WavezApiLocale, WavezApiMessageKey, WavezApiMessages, WavezApiMessageValues, StoreCatalogResponse, StoreCatalogItem, StoreCatalogSection, SystemDonationGoal, SystemPublicStats, SystemStatus, TwoFactorStatus, UserSettings, UserProfile, WalletBalance, WebSocketLike, WsPacket, } from "./types.js";
18
+ export type { ApiClientConfig, ApiLike, ApiQuery, ApiQueryValue, ApiRequestOptions, ApiSuccessResponse, AuthMode, AuthUser, BadgeAssignment, ChatMessage, CheckoutSessionResponse, InventoryResponse, InventoryCatalogEntry, InventoryCatalogItem, MediaSearchResult, PlaylistSummary, PlaylistTrack, RoomBotPermission, RoomQueueEntry, RoomQueuePlayback, RoomQueueSnapshot, RoomQueueStatusResponse, RoomQueueUser, RoomQueueViewerStatus, RoomBotEditMessageInput, RoomBotMessageReplyInput, RoomBotEventsResponse, RoomPresenceEventFilterType, RoomBotQueueAddResponse, RoomBotRealtimeClient, RoomBotRealtimeOptions, RoomBotSendMessageInput, RoomBotState, RoomBotToken, RoomPresenceEvent, RoomPresenceEventType, RoomSummary, WavezApiLocale, WavezApiMessageKey, WavezApiMessages, WavezApiMessageValues, StoreCatalogResponse, StoreCatalogItem, StoreCatalogSection, SystemDonationGoal, SystemPublicStats, SystemStatus, TwoFactorStatus, UserSettings, UserProfile, WalletBalance, WebSocketLike, WsPacket, } from "./types.js";
19
19
  import type { ApiClientConfig } from "./types.js";
20
20
  export declare function createApiClient(config: ApiClientConfig): {
21
21
  api: import("./core/api.js").WavezApi;
@@ -352,9 +352,12 @@ export declare function createApiClient(config: ApiClientConfig): {
352
352
  getEvents(roomId: string, options?: {
353
353
  limit?: number;
354
354
  since?: string | null;
355
- types?: import("./types.js").RoomPresenceEventType[];
355
+ types?: import("./types.js").RoomPresenceEventFilterType[];
356
356
  }): Promise<import("./types.js").ApiSuccessResponse<import("./types.js").RoomBotEventsResponse>>;
357
357
  sendMessage(roomId: string, input: import("./types.js").RoomBotSendMessageInput): Promise<import("./types.js").ApiSuccessResponse<Record<string, unknown>>>;
358
+ editMessage(roomId: string, messageId: string, input: import("./types.js").RoomBotEditMessageInput): Promise<import("./types.js").ApiSuccessResponse<{
359
+ message: import("./types.js").ChatMessage | null;
360
+ }>>;
358
361
  addToQueue(roomId: string, userId: string): Promise<import("./types.js").ApiSuccessResponse<import("./types.js").RoomBotQueueAddResponse>>;
359
362
  deleteMessage(roomId: string, messageId: string, message?: Record<string, unknown>): Promise<import("./types.js").ApiSuccessResponse<{
360
363
  success: true;
package/dist/index.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,MAAM,oBAAoB,CAAC;AAC9C,OAAO,EAAE,SAAS,EAAE,QAAQ,EAAE,MAAM,eAAe,CAAC;AAEpD,OAAO,EAAE,kBAAkB,EAAE,MAAM,qBAAqB,CAAC;AACzD,OAAO,EAAE,sBAAsB,EAAE,MAAM,yBAAyB,CAAC;AACjE,OAAO,EAAE,kBAAkB,EAAE,MAAM,qBAAqB,CAAC;AACzD,OAAO,EAAE,kBAAkB,EAAE,MAAM,qBAAqB,CAAC;AACzD,OAAO,EAAE,sBAAsB,EAAE,MAAM,yBAAyB,CAAC;AACjE,OAAO,EAAE,oBAAoB,EAAE,MAAM,uBAA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AAC;QAC7B,QAAQ,EAAE,sBAAsB,CAAC,GAAG,CAAC;QACrC,IAAI,EAAE,kBAAkB,CAAC,GAAG,CAAC;QAC7B,IAAI,EAAE,kBAAkB,CAAC,GAAG,CAAC;QAC7B,QAAQ,EAAE,sBAAsB,CAAC,GAAG,CAAC;QACrC,MAAM,EAAE,oBAAoB,CAAC,GAAG,CAAC;QACjC,IAAI,EAAE,kBAAkB,CAAC,GAAG,CAAC;QAC7B,MAAM,EAAE,oBAAoB,CAAC,GAAG,CAAC;QACjC,IAAI,EAAE,kBAAkB,CAAC,GAAG,CAAC;QAC7B,OAAO,EAAE,qBAAqB,CAAC,GAAG,CAAC;QACnC,MAAM,EAAE,oBAAoB,CAAC,GAAG,CAAC;QACjC,OAAO,EAAE,qBAAqB,CAAC,GAAG,CAAC;KACtC,CAAC;AACN,CAAC"}
@@ -1,4 +1,4 @@
1
- import type { ApiLike, ApiSuccessResponse, RoomBotEventsResponse, RoomBotQueueAddResponse, RoomQueueSnapshot, RoomBotSendMessageInput, RoomPresenceEventType, RoomBotState } from "../types.js";
1
+ import type { ApiLike, ApiSuccessResponse, ChatMessage, RoomBotEventsResponse, RoomBotEditMessageInput, RoomBotQueueAddResponse, RoomQueueSnapshot, RoomBotSendMessageInput, RoomPresenceEventFilterType, RoomBotState } from "../types.js";
2
2
  export declare function createRoomBotResource(api: ApiLike): {
3
3
  getState(roomId: string): Promise<ApiSuccessResponse<RoomBotState>>;
4
4
  getQueueStatus(roomId: string, options?: {
@@ -13,9 +13,12 @@ export declare function createRoomBotResource(api: ApiLike): {
13
13
  getEvents(roomId: string, options?: {
14
14
  limit?: number;
15
15
  since?: string | null;
16
- types?: RoomPresenceEventType[];
16
+ types?: RoomPresenceEventFilterType[];
17
17
  }): Promise<ApiSuccessResponse<RoomBotEventsResponse>>;
18
18
  sendMessage(roomId: string, input: RoomBotSendMessageInput): Promise<ApiSuccessResponse<Record<string, unknown>>>;
19
+ editMessage(roomId: string, messageId: string, input: RoomBotEditMessageInput): Promise<ApiSuccessResponse<{
20
+ message: ChatMessage | null;
21
+ }>>;
19
22
  addToQueue(roomId: string, userId: string): Promise<ApiSuccessResponse<RoomBotQueueAddResponse>>;
20
23
  deleteMessage(roomId: string, messageId: string, message?: Record<string, unknown>): Promise<ApiSuccessResponse<{
21
24
  success: true;
@@ -42,6 +42,9 @@ export function createRoomBotResource(api) {
42
42
  sendMessage(roomId, input) {
43
43
  return api.post(`/bot/rooms/${encodeURIComponent(roomId)}/messages`, input, { authMode: "room-bot" });
44
44
  },
45
+ editMessage(roomId, messageId, input) {
46
+ return api.patch(`/bot/rooms/${encodeURIComponent(roomId)}/messages/${encodeURIComponent(messageId)}`, input, { authMode: "room-bot" });
47
+ },
45
48
  addToQueue(roomId, userId) {
46
49
  return api.post(`/bot/rooms/${encodeURIComponent(roomId)}/queue`, { userId }, { authMode: "room-bot" });
47
50
  },
@@ -1 +1 @@
1
- {"version":3,"file":"roomBot.js","sourceRoot":"","sources":["../../src/resources/roomBot.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,sBAAsB,EAAE,MAAM,uBAAuB,CAAC;AAY/D,MAAM,UAAU,qBAAqB,CAAC,GAAY;IAC9C,OAAO;QACH,QAAQ,CAAC,MAAc;YACnB,OAAO,GAAG,CAAC,GAAG,CACV,cAAc,kBAAkB,CAAC,MAAM,CAAC,QAAQ,EAChD,EAAE,QAAQ,EAAE,UAAU,EAAE,CAC3B,CAAC;QACN,CAAC;QAED,KAAK,CAAC,cAAc,CAChB,MAAc,EACd,OAGC;YAED,MAAM,QAAQ,GAAG,MAAM,GAAG,CAAC,GAAG,CAC1B,cAAc,kBAAkB,CAAC,MAAM,CAAC,QAAQ,EAChD,EAAE,QAAQ,EAAE,UAAU,EAAE,CAC3B,CAAC;YAEF,OAAO;gBACH,GAAG,QAAQ;gBACX,IAAI,EAAE,sBAAsB,CAAC,QAAQ,CAAC,IAAI,CAAC,QAAQ,EAAE;oBACjD,YAAY,EACR,OAAO,EAAE,YAAY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N,CAAC;QAED,cAAc,CAAC,MAAc,EAAE,MAAc,EAAE,OAAgB;YAC3D,OAAO,GAAG,CAAC,GAAG,CACV,cAAc,kBAAkB,CAAC,MAAM,CAAC,iBAAiB,kBAAkB,CAAC,MAAM,CAAC,EAAE,EACrF,EAAE,OAAO,EAAE,EACX,EAAE,QAAQ,EAAE,UAAU,EAAE,CAC3B,CAAC;QACN,CAAC;QAED,KAAK,CAAC,MAAc,EAAE,MAAc;YAChC,OAAO,GAAG,CAAC,MAAM,CACb,cAAc,kBAAkB,CAAC,MAAM,CAAC,SAAS,kBAAkB,CAAC,MAAM,CAAC,EAAE,EAC7E;gBACI,QAAQ,EAAE,UAAU;aACvB,CACJ,CAAC;QACN,CAAC;QAED,WAAW,CAAC,MAAc,EAAE,KAA8B;YACtD,OAAO,GAAG,CAAC,IAAI,CACX,cAAc,kBAAkB,CAAC,MAAM,CAAC,SAAS,EACjD,KAAK,EACL,EAAE,QAAQ,EAAE,UAAU,EAAE,CAC3B,CAAC;QACN,CAAC;QAED,WAAW,CACP,MAAc,EACd,OAAe,EACf,KAA8B;YAE9B,OAAO,GAAG,CAAC,KAAK,CACZ,cAAc,kBAAkB,CAAC,MAAM,CAAC,WAAW,kBAAkB,CAAC,OAAO,CAAC,EAAE,EAChF,KAAK,EACL,EAAE,QAAQ,EAAE,UAAU,EAAE,CAC3B,CAAC;QACN,CAAC;QAED,WAAW,CAAC,MAAc,EAAE,OAAe;YACvC,OAAO,GAAG,CAAC,MAAM,CACb,cAAc,kBAAkB,CAAC,MAAM,CAAC,WAAW,kBAAkB,CAAC,OAAO,CAAC,EAAE,EAChF;gBACI,QAAQ,EAAE,UAAU;aACvB,CACJ,CAAC;QACN,CAAC;KACJ,CAAC;AACN,CAAC"}
package/dist/types.d.ts CHANGED
@@ -339,7 +339,8 @@ export interface RoomBotState {
339
339
  snapshot: Record<string, unknown>;
340
340
  customEmojis: unknown[];
341
341
  }
342
- export type RoomPresenceEventType = "user_joined" | "user_left";
342
+ export type RoomPresenceEventType = "user_joined" | "left" | "waitlist_join";
343
+ export type RoomPresenceEventFilterType = RoomPresenceEventType | "user_left" | "queue_joined";
343
344
  export interface RoomPresenceEvent {
344
345
  id: string;
345
346
  roomId: string;
@@ -365,6 +366,10 @@ export interface RoomBotSendMessageInput {
365
366
  content: string;
366
367
  replyTo?: RoomBotMessageReplyInput | null;
367
368
  }
369
+ export interface RoomBotEditMessageInput {
370
+ content: string;
371
+ message?: Record<string, unknown>;
372
+ }
368
373
  export interface SystemPublicStats {
369
374
  rooms?: number;
370
375
  onlineUsers?: number;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@wavezfm/api",
3
- "version": "0.1.6",
3
+ "version": "0.1.8",
4
4
  "description": "Official JavaScript/TypeScript API client for WavezFM.",
5
5
  "type": "module",
6
6
  "license": "MIT",