@wavezfm/api 0.1.9 → 0.3.0

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.
Files changed (38) hide show
  1. package/CHANGELOG.md +31 -0
  2. package/README.md +34 -431
  3. package/dist/index.d.ts +217 -31
  4. package/dist/index.js.map +1 -1
  5. package/dist/realtime/roomBot.js +50 -0
  6. package/dist/realtime/roomBot.js.map +1 -1
  7. package/dist/resources/billing.d.ts +80 -1
  8. package/dist/resources/billing.js +32 -0
  9. package/dist/resources/billing.js.map +1 -1
  10. package/dist/resources/chat.d.ts +3 -1
  11. package/dist/resources/chat.js +19 -0
  12. package/dist/resources/chat.js.map +1 -1
  13. package/dist/resources/friend.d.ts +1 -12
  14. package/dist/resources/friend.js +3 -18
  15. package/dist/resources/friend.js.map +1 -1
  16. package/dist/resources/playlist.d.ts +33 -8
  17. package/dist/resources/playlist.js +29 -3
  18. package/dist/resources/playlist.js.map +1 -1
  19. package/dist/resources/room.d.ts +32 -3
  20. package/dist/resources/room.js +53 -6
  21. package/dist/resources/room.js.map +1 -1
  22. package/dist/resources/roomBot.d.ts +8 -3
  23. package/dist/resources/roomBot.js +7 -2
  24. package/dist/resources/roomBot.js.map +1 -1
  25. package/dist/resources/settings.d.ts +52 -2
  26. package/dist/resources/settings.js +32 -0
  27. package/dist/resources/settings.js.map +1 -1
  28. package/dist/resources/shop.d.ts +5 -0
  29. package/dist/resources/shop.js +3 -0
  30. package/dist/resources/shop.js.map +1 -1
  31. package/dist/resources/source.d.ts +6 -6
  32. package/dist/resources/source.js +6 -3
  33. package/dist/resources/source.js.map +1 -1
  34. package/dist/resources/system.d.ts +3 -1
  35. package/dist/resources/system.js +6 -0
  36. package/dist/resources/system.js.map +1 -1
  37. package/dist/types.d.ts +210 -3
  38. package/package.json +4 -2
package/dist/types.d.ts CHANGED
@@ -65,6 +65,8 @@ export interface AuthUser {
65
65
  displayName?: string | null;
66
66
  name?: string | null;
67
67
  bio?: string | null;
68
+ country?: string | null;
69
+ countryCode?: string | null;
68
70
  image?: string | null;
69
71
  avatar?: string | null;
70
72
  avatarId?: string | null;
@@ -84,12 +86,22 @@ export interface AuthUser {
84
86
  colorTheme?: string | null;
85
87
  timeFormat?: "12h" | "24h" | string | null;
86
88
  notifyChatMentions?: boolean;
89
+ notifyFanToasts?: boolean;
87
90
  playMentionSound?: boolean;
91
+ playWhisperSound?: boolean;
88
92
  lastFmScrobblingEnabled?: boolean;
89
93
  presenceStatus?: string | null;
90
94
  selectedBadgeIds?: string[];
91
95
  selectedBadges?: BadgeAssignment[];
92
96
  showChatBadge?: boolean;
97
+ showFanRelationsOnProfile?: boolean;
98
+ showSuperfansOnProfile?: boolean;
99
+ showOnlineRoomOnProfile?: boolean;
100
+ showLastSeenOnProfile?: boolean;
101
+ blockUnknownWhispers?: boolean;
102
+ autoOpenIncomingWhispers?: boolean;
103
+ sfwMode?: boolean;
104
+ sfwModeAudioEnabled?: boolean;
93
105
  subscriptionStatus?: string | null;
94
106
  subscriptionCycle?: string | null;
95
107
  subscriptionCurrentPeriodStartAt?: string | null;
@@ -130,6 +142,51 @@ export interface RoomSummary {
130
142
  } | null;
131
143
  [key: string]: unknown;
132
144
  }
145
+ export type RoomExternalMediaProvider = "youtube" | "kick" | "google_drive" | "dailymotion" | "direct_mp3" | "direct_mp4" | "direct_m3u" | "direct_m3u8";
146
+ export interface RoomExternalMediaSubtitleTrack {
147
+ label: string;
148
+ language: string;
149
+ url: string;
150
+ filename: string;
151
+ sourceFormat: "srt" | "vtt";
152
+ default?: boolean;
153
+ }
154
+ export interface RoomExternalMediaMetadataResponse {
155
+ success: true;
156
+ data: {
157
+ canonicalUrl: string;
158
+ title: string | null;
159
+ durationMs: number | null;
160
+ subtitles: RoomExternalMediaSubtitleTrack[];
161
+ };
162
+ }
163
+ export interface RoomExternalMediaValidationResponse {
164
+ success: true;
165
+ data: {
166
+ canonicalUrl: string;
167
+ provider: RoomExternalMediaProvider;
168
+ available: boolean;
169
+ code: string | null;
170
+ live: boolean;
171
+ };
172
+ }
173
+ export interface RoomPlaybackHistoryEntry {
174
+ id: string;
175
+ trackId: string;
176
+ title: string;
177
+ artist: string;
178
+ djId: string;
179
+ djUsername: string;
180
+ djDisplayUsername: string | null;
181
+ source: "youtube" | "soundcloud";
182
+ sourceId: string;
183
+ thumbnailUrl: string | null;
184
+ durationMs: number;
185
+ woots: number;
186
+ grabs: number;
187
+ mehs: number;
188
+ playedAt: string;
189
+ }
133
190
  export interface RoomQueueUser {
134
191
  internalId: string;
135
192
  publicId?: number | null;
@@ -216,16 +273,109 @@ export interface PlaylistTrack {
216
273
  artist?: string;
217
274
  durationMs?: number;
218
275
  thumbnailUrl?: string | null;
276
+ position?: number;
277
+ isLive?: boolean;
278
+ clipStartMs?: number | null;
279
+ clipEndMs?: number | null;
219
280
  [key: string]: unknown;
220
281
  }
282
+ export interface PlaylistTrackSearchResult {
283
+ playlist: PlaylistSummary;
284
+ track: PlaylistTrack;
285
+ }
286
+ export interface PlaylistTrackAvailabilityInput {
287
+ source: string;
288
+ sourceId: string;
289
+ }
290
+ export interface PlaylistTrackAvailabilityResult {
291
+ source: "youtube" | "soundcloud";
292
+ sourceId: string;
293
+ status: "available" | "unavailable" | "unknown";
294
+ reason: string | null;
295
+ }
296
+ export interface PlaylistJsonTrack {
297
+ source: "youtube" | "soundcloud";
298
+ sourceId: string;
299
+ title: string;
300
+ artist: string;
301
+ durationMs: number;
302
+ thumbnailUrl: string | null;
303
+ isLive: boolean;
304
+ clipStartMs?: number | null;
305
+ clipEndMs?: number | null;
306
+ }
307
+ export interface PlaylistJsonExport {
308
+ schema: "wavezfm.playlist.v1";
309
+ exportedAt: string;
310
+ playlist: {
311
+ name: string;
312
+ trackCount: number;
313
+ };
314
+ tracks: PlaylistJsonTrack[];
315
+ }
316
+ export interface PlaylistJsonImportResult {
317
+ source: "json";
318
+ playlistId: string;
319
+ playlistName: string;
320
+ sourcePlaylistName: string;
321
+ totalTracks: number;
322
+ importedTracks: number;
323
+ duplicateTracks: number;
324
+ failedTracks: number;
325
+ truncated: boolean;
326
+ }
221
327
  export interface MediaSearchResult {
222
328
  source: string;
223
329
  sourceId: string;
224
330
  title: string;
225
331
  artist?: string;
332
+ durationMs?: number;
226
333
  thumbnailUrl?: string | null;
334
+ isLive?: boolean;
227
335
  [key: string]: unknown;
228
336
  }
337
+ export interface MediaSearchResponse {
338
+ items: MediaSearchResult[];
339
+ nextPageToken: string | null;
340
+ previousPageToken: string | null;
341
+ }
342
+ export interface ChatMediaPreviewResponse {
343
+ previewUrl: string;
344
+ }
345
+ export interface ChatImageUploadResponse {
346
+ url: string;
347
+ expiresAt: string;
348
+ contentType: "image/gif" | "image/jpeg" | "image/png" | "image/webp";
349
+ size: number;
350
+ }
351
+ export interface GifFavorite {
352
+ id: string;
353
+ title: string;
354
+ previewUrl: string;
355
+ gifUrl: string;
356
+ width: number | null;
357
+ height: number | null;
358
+ addedAt: string;
359
+ }
360
+ export interface LastFmAccountProfile {
361
+ username: string;
362
+ displayName: string | null;
363
+ avatarUrl: string | null;
364
+ }
365
+ export type LastFmLinkStatus = {
366
+ status: "idle" | "pending";
367
+ } | {
368
+ status: "linked";
369
+ username: string;
370
+ } | {
371
+ status: "error";
372
+ error: string;
373
+ };
374
+ export interface LastFmWriteResponse {
375
+ success: boolean;
376
+ skipped?: boolean;
377
+ code?: string;
378
+ }
229
379
  export interface ChatMessage {
230
380
  id: string;
231
381
  userId: string;
@@ -238,6 +388,9 @@ export interface ChatMessage {
238
388
  role?: string;
239
389
  roomRole?: string;
240
390
  platformRole?: string | null;
391
+ ephemeral?: boolean;
392
+ persisted?: boolean;
393
+ targetUserIds?: string[];
241
394
  [key: string]: unknown;
242
395
  }
243
396
  export interface WalletBalance {
@@ -264,10 +417,27 @@ export interface StoreCatalogResponse {
264
417
  backgroundSections?: StoreCatalogSection[];
265
418
  badgeSections?: StoreCatalogSection[];
266
419
  videoFrameSections?: StoreCatalogSection[];
420
+ miscItems?: MiscStoreItem[];
267
421
  premiumShopEnabled?: boolean;
268
422
  badgeShopEnabled?: boolean;
269
423
  videoFrameShopEnabled?: boolean;
270
424
  backgroundShopEnabled?: boolean;
425
+ miscShopEnabled?: boolean;
426
+ [key: string]: unknown;
427
+ }
428
+ export interface MiscStoreItem {
429
+ id: string;
430
+ kind: "xp_boost" | "display_name_change" | string;
431
+ name: string;
432
+ namePtBr?: string | null;
433
+ nameEnUs?: string | null;
434
+ description?: string;
435
+ descriptionPtBr?: string | null;
436
+ descriptionEnUs?: string | null;
437
+ currency: "coins" | "diamonds" | string;
438
+ price: number;
439
+ xpMultiplierPercent?: number | null;
440
+ durationMinutes?: number | null;
271
441
  [key: string]: unknown;
272
442
  }
273
443
  export interface StoreCatalogSection {
@@ -396,6 +566,16 @@ export interface RoomBotMessageReplyInput {
396
566
  export interface RoomBotSendMessageInput {
397
567
  content: string;
398
568
  replyTo?: RoomBotMessageReplyInput | null;
569
+ /** Deliver the message live without storing it in room chat history. */
570
+ ephemeral?: boolean;
571
+ /** Restrict an ephemeral message to one currently connected user ID. */
572
+ targetUserId?: string;
573
+ /** Restrict an ephemeral message to up to 50 currently connected user IDs. */
574
+ targetUserIds?: string[];
575
+ }
576
+ export interface RoomBotSendMessageResponse {
577
+ bot: RoomBotState["bot"];
578
+ message: ChatMessage;
399
579
  }
400
580
  export interface RoomBotEditMessageInput {
401
581
  content: string;
@@ -428,6 +608,7 @@ export interface SystemStatus {
428
608
  badgeShopEnabled: boolean;
429
609
  videoFrameShopEnabled: boolean;
430
610
  backgroundShopEnabled: boolean;
611
+ miscShopEnabled?: boolean;
431
612
  spotifyEnabled: boolean;
432
613
  soundcloudEnabled: boolean;
433
614
  globalDonationGoal: SystemDonationGoal | null;
@@ -438,19 +619,43 @@ export interface SystemStatus {
438
619
  [key: string]: unknown;
439
620
  }
440
621
  export interface CheckoutSessionResponse {
441
- checkoutUrl: string;
622
+ uiMode?: "hosted" | "elements" | "mercadopago" | string;
623
+ checkoutUrl: string | null;
624
+ clientSecret?: string | null;
625
+ publishableKey?: string | null;
442
626
  [key: string]: unknown;
443
627
  }
628
+ export interface NotificationCenterStatus {
629
+ clearedAt: string | null;
630
+ }
631
+ export interface NotificationCenterClearResponse {
632
+ ok: true;
633
+ clearedAt: string;
634
+ }
444
635
  export interface UserSettings {
636
+ userId?: string;
445
637
  bio?: string | null;
446
- colorTheme?: string | null;
638
+ country?: string | null;
639
+ countryCode?: string | null;
640
+ colorTheme?: "wavezfm" | "wavezfm-black" | string | null;
447
641
  timeFormat?: "12h" | "24h" | string | null;
448
642
  notifyChatMentions?: boolean;
643
+ notifyFanToasts?: boolean;
449
644
  playMentionSound?: boolean;
645
+ playWhisperSound?: boolean;
450
646
  lastFmScrobblingEnabled?: boolean;
451
- presenceStatus?: "online" | "busy" | "away" | string | null;
647
+ presenceStatus?: "online" | "busy" | "away" | "invisible" | string | null;
452
648
  selectedBadgeIds?: string[];
453
649
  showChatBadge?: boolean;
650
+ showFanRelationsOnProfile?: boolean;
651
+ showSuperfansOnProfile?: boolean;
652
+ showOnlineRoomOnProfile?: boolean;
653
+ showLastSeenOnProfile?: boolean;
654
+ blockUnknownWhispers?: boolean;
655
+ autoOpenIncomingWhispers?: boolean;
656
+ sfwMode?: boolean;
657
+ sfwModeAudioEnabled?: boolean;
658
+ activeViolationCount?: number;
454
659
  [key: string]: unknown;
455
660
  }
456
661
  export interface TwoFactorStatus {
@@ -483,6 +688,8 @@ export interface RoomBotRealtimeOptions {
483
688
  autoReconnect?: boolean;
484
689
  reconnectDelayMs?: number;
485
690
  reconnectMaxDelayMs?: number;
691
+ heartbeatIntervalMs?: number;
692
+ heartbeatTimeoutMs?: number;
486
693
  logging?: boolean;
487
694
  protocols?: string | string[];
488
695
  locale?: WavezApiLocale;
package/package.json CHANGED
@@ -1,7 +1,8 @@
1
1
  {
2
2
  "name": "@wavezfm/api",
3
- "version": "0.1.9",
3
+ "version": "0.3.0",
4
4
  "description": "Official JavaScript/TypeScript API client for WavezFM.",
5
+ "homepage": "https://docs.wavez.fm/docs",
5
6
  "type": "module",
6
7
  "license": "MIT",
7
8
  "sideEffects": false,
@@ -10,7 +11,8 @@
10
11
  "types": "./dist/index.d.ts",
11
12
  "files": [
12
13
  "dist",
13
- "README.md"
14
+ "README.md",
15
+ "CHANGELOG.md"
14
16
  ],
15
17
  "scripts": {
16
18
  "build": "tsc -p tsconfig.json",