@wavezfm/api 0.7.14 → 0.7.16
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/CHANGELOG.md +14 -0
- package/README.md +82 -0
- package/dist/index.d.ts +15 -1
- package/dist/index.js +3 -0
- package/dist/index.js.map +1 -1
- package/dist/resources/privateMessages.d.ts +9 -0
- package/dist/resources/privateMessages.js +12 -0
- package/dist/resources/privateMessages.js.map +1 -0
- package/dist/resources/shop.d.ts +3 -1
- package/dist/resources/shop.js +8 -0
- package/dist/resources/shop.js.map +1 -1
- package/dist/resources/system.d.ts +9 -1
- package/dist/resources/system.js +12 -0
- package/dist/resources/system.js.map +1 -1
- package/dist/types.d.ts +190 -0
- package/package.json +5 -1
package/CHANGELOG.md
CHANGED
|
@@ -2,6 +2,20 @@
|
|
|
2
2
|
|
|
3
3
|
## Unreleased
|
|
4
4
|
|
|
5
|
+
### Public XP settings (October 2)
|
|
6
|
+
|
|
7
|
+
- Typed nullable `SystemStatus.progressionXp` and exported `SystemProgressionXp` for current base rewards, cooldowns, DJ requirements and the shared daily reward allowance through the existing `client.system.status()` method.
|
|
8
|
+
|
|
9
|
+
### Purchase history (October 2)
|
|
10
|
+
|
|
11
|
+
- Added session-authenticated `client.shop.getPurchaseHistory(options)` with exported pagination, search, category and purchase detail types. Results include completed shop transactions and repeated Extras; historical currencies that were not recorded remain null. External purchases are identified without inventing their fiat amount.
|
|
12
|
+
|
|
13
|
+
### API synchronization (October 1, after 0.7.14)
|
|
14
|
+
|
|
15
|
+
- Added session-authenticated `client.privateMessages.openConversation()` and `sendMessage()` with typed conversation/message responses and optional `clientMessageId`. Callers reuse the same UUID v4 and content to retry one send; the SDK does not retry automatically.
|
|
16
|
+
- Added admin-session `system.createGlobalAlert()`, `createRoomAlert()` and `createUserAlert()` with typed text responses and appearance inputs, including `iconBeforeTitle`. Chat messages now expose typed `systemColor` and `systemAppearance` fields.
|
|
17
|
+
- Playback timing, literal whole-word blacklist matching, YouTube metadata refresh and Stripe dependency changes retain the existing HTTP routes and response shapes.
|
|
18
|
+
|
|
5
19
|
### API synchronization (September 26–October 1)
|
|
6
20
|
|
|
7
21
|
- Removed `settings.replaceGifFavorites()`: the server rejects legacy whole-list `PUT` requests with `409 GIF_FAVORITES_RELOAD_REQUIRED`. Use `upsertGifFavorite()` and `removeGifFavorite()`; both return the current list. Favorite reads now use `no-store`, and metadata-only updates support `updateExistingOnly`.
|
package/README.md
CHANGED
|
@@ -104,6 +104,55 @@ npm run typecheck
|
|
|
104
104
|
npm run build
|
|
105
105
|
```
|
|
106
106
|
|
|
107
|
+
## Private-message retries and system alerts
|
|
108
|
+
|
|
109
|
+
The helpers in this section are available in the local SDK build and await the
|
|
110
|
+
next package release. Use a session-authenticated user client with the headers
|
|
111
|
+
required by your deployment for these mutations.
|
|
112
|
+
|
|
113
|
+
```ts
|
|
114
|
+
const { data: conversation } = await client.privateMessages.openConversation({
|
|
115
|
+
recipientUserId: 'recipient-id',
|
|
116
|
+
});
|
|
117
|
+
const input = {
|
|
118
|
+
content: 'Hello!',
|
|
119
|
+
clientMessageId: crypto.randomUUID(),
|
|
120
|
+
};
|
|
121
|
+
const { data } = await client.privateMessages.sendMessage(conversation.id, input);
|
|
122
|
+
console.log(data.message.id);
|
|
123
|
+
```
|
|
124
|
+
|
|
125
|
+
Generate `clientMessageId` once per send and keep the same UUID v4 and content
|
|
126
|
+
when retrying after an uncertain failure. The updated server returns the same
|
|
127
|
+
saved message for the same sender and conversation. Omitting the field keeps
|
|
128
|
+
server-generated IDs. Membership and user-block checks still apply, and an ID
|
|
129
|
+
conflict cannot overwrite another message. The SDK does not retry automatically.
|
|
130
|
+
It also does not generate `clientMessageId`; callers choose whether to provide it.
|
|
131
|
+
|
|
132
|
+
Administrative system alerts accept `appearance.iconBeforeTitle`, which defaults
|
|
133
|
+
to `false`, and preserve the appearance in the realtime payload:
|
|
134
|
+
|
|
135
|
+
```ts
|
|
136
|
+
await client.system.createRoomAlert('room-id', {
|
|
137
|
+
delivery: 'popup',
|
|
138
|
+
message: 'The room will restart shortly.',
|
|
139
|
+
appearance: { icon: 'warning', iconBeforeTitle: true },
|
|
140
|
+
});
|
|
141
|
+
```
|
|
142
|
+
|
|
143
|
+
`createGlobalAlert(input)` and `createRoomAlert(roomId, input)` default to `chat`.
|
|
144
|
+
`createUserAlert(userId, input)` defaults to `popup`; user-targeted chat delivery
|
|
145
|
+
also requires `roomId` in the input. All three require an admin session. Messages
|
|
146
|
+
accept 3–1,000 characters, and optional titles accept 3–80 characters after
|
|
147
|
+
trimming; empty titles use the localized default. With `bilingual: true`, provide
|
|
148
|
+
both `messagePtBr` and `messageEnUs`, with optional localized titles.
|
|
149
|
+
|
|
150
|
+
Appearance colors use six-digit hex strings. Icons accept `info`, `brand`,
|
|
151
|
+
`warning`, `bell`, `gift` or `none`; positions accept `left`, `top` or `right`.
|
|
152
|
+
Integer ranges are 16–96 for `iconSize`, 320–960 for `width`, 14–40 for
|
|
153
|
+
`titleSize`, and 12–24 for `textSize`. HTTP responses return normalized text in
|
|
154
|
+
`{ success, alert }`; color, appearance and delivery are sent through realtime.
|
|
155
|
+
|
|
107
156
|
## License
|
|
108
157
|
|
|
109
158
|
MIT
|
|
@@ -145,6 +194,39 @@ avatar animation rates accept 1–60 FPS per frame count.
|
|
|
145
194
|
|
|
146
195
|
Call `client.room.removeGuestPresence(slug)` when leaving a guest preview. Private room access and banner uploads are available through `verifyPrivateAccess()` and `uploadBanner()`. See the Frontend API reference for validation rules and examples.
|
|
147
196
|
|
|
197
|
+
`client.system.status()` includes nullable `progressionXp` with current base
|
|
198
|
+
woot/DJ rewards, cooldowns, DJ eligibility requirements, and the shared daily
|
|
199
|
+
allowance in equivalent reward hours. `dailyXpCostMs` is the cost of one reward
|
|
200
|
+
against that allowance, independent of XP multipliers. It resets at 00:00 UTC;
|
|
201
|
+
`dailyLimit.enabled: false` disables the daily cap while cooldowns still apply.
|
|
202
|
+
An absent or null `progressionXp` means the configuration is unavailable.
|
|
203
|
+
|
|
204
|
+
## Purchase history
|
|
205
|
+
|
|
206
|
+
```ts
|
|
207
|
+
const { data: history } = await client.shop.getPurchaseHistory({
|
|
208
|
+
page: 1,
|
|
209
|
+
pageSize: 12,
|
|
210
|
+
q: 'avatar',
|
|
211
|
+
category: 'avatar',
|
|
212
|
+
});
|
|
213
|
+
```
|
|
214
|
+
|
|
215
|
+
This session-authenticated method returns completed shop transactions, including
|
|
216
|
+
repeated Extras, through `/store/purchase-history`. Results provide `items`,
|
|
217
|
+
`page`, `pageSize`, `total` and `totalPages`; the default page size is 12 and the
|
|
218
|
+
maximum is 50. Categories are `all`, `avatar`, `background`, `badge`, `videoframe`,
|
|
219
|
+
`misc` and `unknown`. Searches match the purchased name, collection, description,
|
|
220
|
+
item ID or transaction ID.
|
|
221
|
+
|
|
222
|
+
Each item records its date and absolute wallet charge. A null `currency` means
|
|
223
|
+
the older purchase did not record its currency; do not use today's catalog price
|
|
224
|
+
or currency as a substitute. `currency: 'external'` identifies external checkout
|
|
225
|
+
with no recorded fiat amount, and must not be displayed as a free purchase.
|
|
226
|
+
Inventory grants, rewards, diamond top-ups and subscription payments are not
|
|
227
|
+
part of this list. Updated server startup applies migration 0149 before serving
|
|
228
|
+
the endpoint.
|
|
229
|
+
|
|
148
230
|
## GIF favorites
|
|
149
231
|
|
|
150
232
|
Favorites now use individual mutations so a stale tab cannot replace the saved
|
package/dist/index.d.ts
CHANGED
|
@@ -7,6 +7,7 @@ export { createRoomResource } from "./resources/room.js";
|
|
|
7
7
|
export { createPlaylistResource } from "./resources/playlist.js";
|
|
8
8
|
export { createSourceResource } from "./resources/source.js";
|
|
9
9
|
export { createChatResource } from "./resources/chat.js";
|
|
10
|
+
export { createPrivateMessagesResource } from "./resources/privateMessages.js";
|
|
10
11
|
export { createFriendResource } from "./resources/friend.js";
|
|
11
12
|
export { createUserBlocksResource } from "./resources/userBlocks.js";
|
|
12
13
|
export { createGiveawaysResource } from "./resources/giveaways.js";
|
|
@@ -18,7 +19,7 @@ export { createRoomBotResource } from "./resources/roomBot.js";
|
|
|
18
19
|
export { parseRoomQueueSnapshot } from "./utils/roomQueue.js";
|
|
19
20
|
export { formatMentionText } from "./utils/chat.js";
|
|
20
21
|
export { createRoomBotRealtimeClient } from "./realtime/roomBot.js";
|
|
21
|
-
export type { BotPrivateCommand, CountryFlagSettings, TeamDirectory, StageHoverSettings, UserProfileOptions, ApiClientConfig, ApiLike, ApiQuery, ApiQueryValue, ApiRequestOptions, ApiSuccessResponse, AuthMode, AuthUser, BadgeAssignment, ChatImageUploadResponse, ChatLinkReview, ChatMediaPreviewResponse, ChatMessage, CheckoutSessionResponse, GifFavorite, Giveaway, GiveawayEntry, GiveawayJoinEligibility, GiveawayListResponse, GiveawayMutationResponse, GiveawayPrizeDeliveryStatus, GiveawayPrizeType, GiveawayScope, GiveawayStatus, InventoryResponse, InventoryCatalogEntry, InventoryCatalogItem, LastFmAccountProfile, LastFmLinkStatus, LastFmWriteResponse, MediaSearchResponse, MediaSearchResult, MiscShopUserState, MiscStoreCurrency, MiscStoreItemKind, MiscStoreRenderMode, NotificationCenterClearResponse, NotificationCenterStatus, PlaylistExternalImportResult, PlaylistExternalImportSource, PlaylistJsonExport, PlaylistJsonImportResult, PlaylistJsonTrack, PlaylistSummary, PlaylistTrack, PlaylistTrackAvailabilityInput, PlaylistTrackAvailabilityResult, PlaylistTrackSearchResult, RoomBotPermission, RoomExternalMediaMetadataResponse, RoomExternalMediaProvider, RoomExternalMediaSubtitleTrack, RoomExternalMediaValidationResponse, RoomActiveUser, RoomCustomEmoji, RoomLinkFiltersUpdateInput, RoomGuestPresenceResponse, RoomGuestViewer, RoomGlobalLimits, RoomGlobalLimitsUpdateInput, RoomPlaybackHistoryEntry, RoomPermission, RoomPermissionOverrideMap, RoomQueueEntry, RoomQueuePlayback, RoomQueueSnapshot, RoomQueueStatusResponse, RoomQueueUser, RoomQueueViewerStatus, RoomRoleName, RoomSettingsUpdateInput, RoomStateSnapshot, RoomBotEditMessageInput, RoomBotChatEmbed, RoomBotMessageReplyInput, RoomBotEventsResponse, RoomPresenceEventFilterType, RoomBotQueueAddResponse, RoomBotRealtimeClient, RoomBotRealtimeSendMessageInput, RoomBotRealtimeOptions, RoomBotSendMessageInput, RoomBotSendMessageResponse, RoomBotState, RoomBotToken, RoomBotSettings, RoomBotSettingsUpdateInput, RoomPresenceEvent, RoomPresenceEventType, RoomSummary, RoomEvent, RoomEventApprovalStatus, RoomEventListResponse, RoomEventMutationResponse, RoomEventScope, RoomEventStatus, RoomEventSubmissionInput, WavezApiLocale, WavezApiMessageKey, WavezApiMessages, WavezApiMessageValues, StoreCatalogResponse, StoreCatalogItem, StoreCatalogSection, MiscStoreItem, AdminSystemHealth, AdminSystemStatus, SystemDonationGoal, SystemHealth, SystemPublicStats, SystemStatus, TwoFactorStatus, UserSettings, UserProfile, UserBlockState, WalletBalance, WebSocketLike, WsPacket, } from "./types.js";
|
|
22
|
+
export type { BotPrivateCommand, CountryFlagSettings, TeamDirectory, StageHoverSettings, UserProfileOptions, ApiClientConfig, ApiLike, ApiQuery, ApiQueryValue, ApiRequestOptions, ApiSuccessResponse, AuthMode, AuthUser, BadgeAssignment, ChatImageUploadResponse, ChatLinkReview, ChatMediaPreviewResponse, ChatMessage, CheckoutSessionResponse, GifFavorite, Giveaway, GiveawayEntry, GiveawayJoinEligibility, GiveawayListResponse, GiveawayMutationResponse, GiveawayPrizeDeliveryStatus, GiveawayPrizeType, GiveawayScope, GiveawayStatus, InventoryResponse, InventoryCatalogEntry, InventoryCatalogItem, PurchaseHistoryCategory, PurchaseHistoryCurrency, PurchaseHistoryItem, PurchaseHistoryOptions, PurchaseHistoryResponse, LastFmAccountProfile, LastFmLinkStatus, LastFmWriteResponse, MediaSearchResponse, MediaSearchResult, MiscShopUserState, MiscStoreCurrency, MiscStoreItemKind, MiscStoreRenderMode, NotificationCenterClearResponse, NotificationCenterStatus, PlaylistExternalImportResult, PlaylistExternalImportSource, PlaylistJsonExport, PlaylistJsonImportResult, PlaylistJsonTrack, PlaylistSummary, PlaylistTrack, PlaylistTrackAvailabilityInput, PlaylistTrackAvailabilityResult, PlaylistTrackSearchResult, PrivateConversation, PrivateMessage, PrivateMessageCustomEmoji, PrivateMessageReply, PrivateMessageSendInput, PrivateMessageSendResponse, PrivateMessageUser, RoomBotPermission, RoomExternalMediaMetadataResponse, RoomExternalMediaProvider, RoomExternalMediaSubtitleTrack, RoomExternalMediaValidationResponse, RoomActiveUser, RoomCustomEmoji, RoomLinkFiltersUpdateInput, RoomGuestPresenceResponse, RoomGuestViewer, RoomGlobalLimits, RoomGlobalLimitsUpdateInput, RoomPlaybackHistoryEntry, RoomPermission, RoomPermissionOverrideMap, RoomQueueEntry, RoomQueuePlayback, RoomQueueSnapshot, RoomQueueStatusResponse, RoomQueueUser, RoomQueueViewerStatus, RoomRoleName, RoomSettingsUpdateInput, RoomStateSnapshot, RoomBotEditMessageInput, RoomBotChatEmbed, RoomBotMessageReplyInput, RoomBotEventsResponse, RoomPresenceEventFilterType, RoomBotQueueAddResponse, RoomBotRealtimeClient, RoomBotRealtimeSendMessageInput, RoomBotRealtimeOptions, RoomBotSendMessageInput, RoomBotSendMessageResponse, RoomBotState, RoomBotToken, RoomBotSettings, RoomBotSettingsUpdateInput, RoomPresenceEvent, RoomPresenceEventType, RoomSummary, RoomSystemAlert, RoomEvent, RoomEventApprovalStatus, RoomEventListResponse, RoomEventMutationResponse, RoomEventScope, RoomEventStatus, RoomEventSubmissionInput, WavezApiLocale, WavezApiMessageKey, WavezApiMessages, WavezApiMessageValues, StoreCatalogResponse, StoreCatalogItem, StoreCatalogSection, MiscStoreItem, AdminSystemHealth, AdminSystemStatus, SystemDonationGoal, SystemAlert, SystemAlertAppearance, SystemAlertInput, SystemAlertResponse, SystemHealth, SystemPublicStats, SystemProgressionXp, SystemStatus, TwoFactorStatus, UserSettings, UserSystemAlert, UserProfile, UserBlockState, WalletBalance, WebSocketLike, WsPacket, } from "./types.js";
|
|
22
23
|
import type { ApiClientConfig } from "./types.js";
|
|
23
24
|
export declare function createApiClient(config: ApiClientConfig): {
|
|
24
25
|
api: import("./core/api.js").WavezApi;
|
|
@@ -410,6 +411,13 @@ export declare function createApiClient(config: ApiClientConfig): {
|
|
|
410
411
|
success: true;
|
|
411
412
|
}>>;
|
|
412
413
|
};
|
|
414
|
+
privateMessages: {
|
|
415
|
+
openConversation(input: {
|
|
416
|
+
recipientUserId?: string | null;
|
|
417
|
+
recipientUsername?: string | null;
|
|
418
|
+
}): Promise<import("./types.js").ApiSuccessResponse<import("./types.js").PrivateConversation>>;
|
|
419
|
+
sendMessage(conversationId: string, input: import("./types.js").PrivateMessageSendInput): Promise<import("./types.js").ApiSuccessResponse<import("./types.js").PrivateMessageSendResponse>>;
|
|
420
|
+
};
|
|
413
421
|
friend: {
|
|
414
422
|
follow(userId: string): Promise<import("./types.js").ApiSuccessResponse<{
|
|
415
423
|
success: true;
|
|
@@ -449,6 +457,7 @@ export declare function createApiClient(config: ApiClientConfig): {
|
|
|
449
457
|
}): Promise<import("./types.js").ApiSuccessResponse<Record<string, unknown>>>;
|
|
450
458
|
equip(itemId: string): Promise<import("./types.js").ApiSuccessResponse<Record<string, unknown>>>;
|
|
451
459
|
getInventory(): Promise<import("./types.js").ApiSuccessResponse<import("./types.js").InventoryResponse>>;
|
|
460
|
+
getPurchaseHistory(options?: import("./types.js").PurchaseHistoryOptions): Promise<import("./types.js").ApiSuccessResponse<import("./types.js").PurchaseHistoryResponse>>;
|
|
452
461
|
};
|
|
453
462
|
billing: {
|
|
454
463
|
getCheckoutSessionStatus(sessionId: string): Promise<import("./types.js").ApiSuccessResponse<{
|
|
@@ -575,6 +584,11 @@ export declare function createApiClient(config: ApiClientConfig): {
|
|
|
575
584
|
markGiftSeen(giftId: string): Promise<import("./types.js").ApiSuccessResponse<Record<string, unknown>>>;
|
|
576
585
|
};
|
|
577
586
|
system: {
|
|
587
|
+
createGlobalAlert(input: import("./types.js").SystemAlertInput): Promise<import("./types.js").ApiSuccessResponse<import("./types.js").SystemAlertResponse<import("./types.js").SystemAlert>>>;
|
|
588
|
+
createRoomAlert(roomId: string, input: import("./types.js").SystemAlertInput): Promise<import("./types.js").ApiSuccessResponse<import("./types.js").SystemAlertResponse<import("./types.js").RoomSystemAlert>>>;
|
|
589
|
+
createUserAlert(userId: string, input: import("./types.js").SystemAlertInput & {
|
|
590
|
+
roomId?: string | null;
|
|
591
|
+
}): Promise<import("./types.js").ApiSuccessResponse<import("./types.js").SystemAlertResponse<import("./types.js").UserSystemAlert>>>;
|
|
578
592
|
getTeam(): Promise<import("./types.js").ApiSuccessResponse<import("./types.js").TeamDirectory>>;
|
|
579
593
|
getCountryFlags(): Promise<import("./types.js").ApiSuccessResponse<import("./types.js").CountryFlagSettings>>;
|
|
580
594
|
updateCountryFlags(input: import("./types.js").CountryFlagSettings): Promise<import("./types.js").ApiSuccessResponse<import("./types.js").CountryFlagSettings>>;
|
package/dist/index.js
CHANGED
|
@@ -7,6 +7,7 @@ export { createRoomResource } from "./resources/room.js";
|
|
|
7
7
|
export { createPlaylistResource } from "./resources/playlist.js";
|
|
8
8
|
export { createSourceResource } from "./resources/source.js";
|
|
9
9
|
export { createChatResource } from "./resources/chat.js";
|
|
10
|
+
export { createPrivateMessagesResource } from "./resources/privateMessages.js";
|
|
10
11
|
export { createFriendResource } from "./resources/friend.js";
|
|
11
12
|
export { createUserBlocksResource } from "./resources/userBlocks.js";
|
|
12
13
|
export { createGiveawaysResource } from "./resources/giveaways.js";
|
|
@@ -26,6 +27,7 @@ import { createRoomResource } from "./resources/room.js";
|
|
|
26
27
|
import { createPlaylistResource } from "./resources/playlist.js";
|
|
27
28
|
import { createSourceResource } from "./resources/source.js";
|
|
28
29
|
import { createChatResource } from "./resources/chat.js";
|
|
30
|
+
import { createPrivateMessagesResource } from "./resources/privateMessages.js";
|
|
29
31
|
import { createFriendResource } from "./resources/friend.js";
|
|
30
32
|
import { createUserBlocksResource } from "./resources/userBlocks.js";
|
|
31
33
|
import { createGiveawaysResource } from "./resources/giveaways.js";
|
|
@@ -45,6 +47,7 @@ export function createApiClient(config) {
|
|
|
45
47
|
playlist: createPlaylistResource(api),
|
|
46
48
|
source: createSourceResource(api),
|
|
47
49
|
chat: createChatResource(api),
|
|
50
|
+
privateMessages: createPrivateMessagesResource(api),
|
|
48
51
|
friend: createFriendResource(api),
|
|
49
52
|
userBlocks: createUserBlocksResource(api),
|
|
50
53
|
giveaways: createGiveawaysResource(api),
|
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,uBAAuB,CAAC;AAC7D,OAAO,EAAE,kBAAkB,EAAE,MAAM,qBAAqB,CAAC;AACzD,OAAO,EAAE,oBAAoB,EAAE,MAAM,uBAAuB,CAAC;AAC7D,OAAO,EAAE,wBAAwB,EAAE,MAAM,2BAA2B,CAAC;AACrE,OAAO,EAAE,uBAAuB,EAAE,MAAM,0BAA0B,CAAC;AACnE,OAAO,EAAE,kBAAkB,EAAE,MAAM,qBAAqB,CAAC;AACzD,OAAO,EAAE,qBAAqB,EAAE,MAAM,wBAAwB,CAAC;AAC/D,OAAO,EAAE,oBAAoB,EAAE,MAAM,uBAAuB,CAAC;AAC7D,OAAO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B,OAAO;QACH,GAAG;QACH,IAAI,EAAE,kBAAkB,CAAC,GAAG,CAAC;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,eAAe,EAAE,6BAA6B,CAAC,GAAG,CAAC;QACnD,MAAM,EAAE,oBAAoB,CAAC,GAAG,CAAC;QACjC,UAAU,EAAE,wBAAwB,CAAC,GAAG,CAAC;QACzC,SAAS,EAAE,uBAAuB,CAAC,GAAG,CAAC;QACvC,IAAI,EAAE,kBAAkB,CAAC,GAAG,CAAC;QAC7B,OAAO,EAAE,qBAAqB,CAAC,GAAG,CAAC;QACnC,MAAM,EAAE,oBAAoB,CAAC,GAAG,CAAC;QACjC,MAAM,EAAE,oBAAoB,CAAC,GAAG,CAAC;QACjC,OAAO,EAAE,qBAAqB,CAAC,GAAG,CAAC;KACtC,CAAC;AACN,CAAC"}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import type { ApiLike, PrivateConversation, PrivateMessageSendInput, PrivateMessageSendResponse } from "../types.js";
|
|
2
|
+
export declare function createPrivateMessagesResource(api: ApiLike): {
|
|
3
|
+
openConversation(input: {
|
|
4
|
+
recipientUserId?: string | null;
|
|
5
|
+
recipientUsername?: string | null;
|
|
6
|
+
}): Promise<import("../types.js").ApiSuccessResponse<PrivateConversation>>;
|
|
7
|
+
/** Session-authenticated. Retries must reuse the original clientMessageId. */
|
|
8
|
+
sendMessage(conversationId: string, input: PrivateMessageSendInput): Promise<import("../types.js").ApiSuccessResponse<PrivateMessageSendResponse>>;
|
|
9
|
+
};
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
export function createPrivateMessagesResource(api) {
|
|
2
|
+
return {
|
|
3
|
+
openConversation(input) {
|
|
4
|
+
return api.post("/private-messages/conversations", input);
|
|
5
|
+
},
|
|
6
|
+
/** Session-authenticated. Retries must reuse the original clientMessageId. */
|
|
7
|
+
sendMessage(conversationId, input) {
|
|
8
|
+
return api.post(`/private-messages/conversations/${encodeURIComponent(conversationId)}/messages`, input);
|
|
9
|
+
},
|
|
10
|
+
};
|
|
11
|
+
}
|
|
12
|
+
//# sourceMappingURL=privateMessages.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"privateMessages.js","sourceRoot":"","sources":["../../src/resources/privateMessages.ts"],"names":[],"mappings":"AAOA,MAAM,UAAU,6BAA6B,CAAC,GAAY;IACtD,OAAO;QACH,gBAAgB,CAAC,KAGhB;YACG,OAAO,GAAG,CAAC,IAAI,CACX,iCAAiC,EACjC,KAAK,CACR,CAAC;QACN,CAAC;QAED,8EAA8E;QAC9E,WAAW,CAAC,cAAsB,EAAE,KAA8B;YAC9D,OAAO,GAAG,CAAC,IAAI,CACX,mCAAmC,kBAAkB,CAAC,cAAc,CAAC,WAAW,EAChF,KAAK,CACR,CAAC;QACN,CAAC;KACJ,CAAC;AACN,CAAC"}
|
package/dist/resources/shop.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type { ApiLike, InventoryResponse, MiscShopUserState, StoreCatalogResponse, WalletBalance } from "../types.js";
|
|
1
|
+
import type { ApiLike, InventoryResponse, MiscShopUserState, PurchaseHistoryOptions, PurchaseHistoryResponse, StoreCatalogResponse, WalletBalance } from "../types.js";
|
|
2
2
|
export declare function createShopResource(api: ApiLike): {
|
|
3
3
|
getCatalog(): Promise<import("../types.js").ApiSuccessResponse<StoreCatalogResponse>>;
|
|
4
4
|
getWallet(): Promise<import("../types.js").ApiSuccessResponse<WalletBalance>>;
|
|
@@ -17,4 +17,6 @@ export declare function createShopResource(api: ApiLike): {
|
|
|
17
17
|
}): Promise<import("../types.js").ApiSuccessResponse<Record<string, unknown>>>;
|
|
18
18
|
equip(itemId: string): Promise<import("../types.js").ApiSuccessResponse<Record<string, unknown>>>;
|
|
19
19
|
getInventory(): Promise<import("../types.js").ApiSuccessResponse<InventoryResponse>>;
|
|
20
|
+
/** Completed shop purchases, including repeated Extras; session-authenticated. */
|
|
21
|
+
getPurchaseHistory(options?: PurchaseHistoryOptions): Promise<import("../types.js").ApiSuccessResponse<PurchaseHistoryResponse>>;
|
|
20
22
|
};
|
package/dist/resources/shop.js
CHANGED
|
@@ -23,6 +23,14 @@ export function createShopResource(api) {
|
|
|
23
23
|
getInventory() {
|
|
24
24
|
return api.get("/inventory");
|
|
25
25
|
},
|
|
26
|
+
/** Completed shop purchases, including repeated Extras; session-authenticated. */
|
|
27
|
+
getPurchaseHistory(options) {
|
|
28
|
+
return api.get("/store/purchase-history", {
|
|
29
|
+
query: options ? { ...options } : undefined,
|
|
30
|
+
cache: "no-store",
|
|
31
|
+
authMode: "session",
|
|
32
|
+
});
|
|
33
|
+
},
|
|
26
34
|
};
|
|
27
35
|
}
|
|
28
36
|
//# sourceMappingURL=shop.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"shop.js","sourceRoot":"","sources":["../../src/resources/shop.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"shop.js","sourceRoot":"","sources":["../../src/resources/shop.ts"],"names":[],"mappings":"AAUA,MAAM,UAAU,kBAAkB,CAAC,GAAY;IAC3C,OAAO;QACH,UAAU;YACN,OAAO,GAAG,CAAC,GAAG,CAAuB,QAAQ,EAAE;gBAC3C,QAAQ,EAAE,MAAM;aACnB,CAAC,CAAC;QACP,CAAC;QAED,SAAS;YACL,OAAO,GAAG,CAAC,GAAG,CAAgB,SAAS,CAAC,CAAC;QAC7C,CAAC;QAED,gBAAgB;YACZ,OAAO,GAAG,CAAC,GAAG,CAAoB,wBAAwB,CAAC,CAAC;QAChE,CAAC;QAED,QAAQ,CAAC,KAAkD;YACvD,OAAO,GAAG,CAAC,IAAI,CAA0B,iBAAiB,EAAE,KAAK,CAAC,CAAC;QACvE,CAAC;QAED,YAAY,CAAC,KAOZ;YACG,OAAO,GAAG,CAAC,IAAI,CACX,sBAAsB,EACtB,KAAK,CACR,CAAC;QACN,CAAC;QAED,KAAK,CAAC,MAAc;YAChB,OAAO,GAAG,CAAC,IAAI,CAA0B,cAAc,EAAE,EAAE,MAAM,EAAE,CAAC,CAAC;QACzE,CAAC;QAED,YAAY;YACR,OAAO,GAAG,CAAC,GAAG,CAAoB,YAAY,CAAC,CAAC;QACpD,CAAC;QAED,kFAAkF;QAClF,kBAAkB,CAAC,OAAgC;YAC/C,OAAO,GAAG,CAAC,GAAG,CAA0B,yBAAyB,EAAE;gBAC/D,KAAK,EAAE,OAAO,CAAC,CAAC,CAAC,EAAE,GAAG,OAAO,EAAE,CAAC,CAAC,CAAC,SAAS;gBAC3C,KAAK,EAAE,UAAU;gBACjB,QAAQ,EAAE,SAAS;aACtB,CAAC,CAAC;QACP,CAAC;KACJ,CAAC;AACN,CAAC"}
|
|
@@ -1,5 +1,13 @@
|
|
|
1
|
-
import type { AdminSystemHealth, AdminSystemStatus, ApiLike, CountryFlagSettings, StageHoverSettings, TeamDirectory, NotificationCenterClearResponse, NotificationCenterStatus, RoomGlobalLimits, RoomGlobalLimitsUpdateInput, SystemHealth, SystemPublicStats, SystemStatus } from "../types.js";
|
|
1
|
+
import type { AdminSystemHealth, AdminSystemStatus, ApiLike, CountryFlagSettings, StageHoverSettings, TeamDirectory, NotificationCenterClearResponse, NotificationCenterStatus, RoomGlobalLimits, RoomGlobalLimitsUpdateInput, RoomSystemAlert, SystemAlertInput, SystemAlertResponse, SystemHealth, SystemPublicStats, SystemStatus, UserSystemAlert } from "../types.js";
|
|
2
2
|
export declare function createSystemResource(api: ApiLike): {
|
|
3
|
+
/** Requires an admin session. Delivery defaults to room chat. */
|
|
4
|
+
createGlobalAlert(input: SystemAlertInput): Promise<import("../types.js").ApiSuccessResponse<SystemAlertResponse<import("../types.js").SystemAlert>>>;
|
|
5
|
+
/** Requires an admin session. Delivery defaults to room chat. */
|
|
6
|
+
createRoomAlert(roomId: string, input: SystemAlertInput): Promise<import("../types.js").ApiSuccessResponse<SystemAlertResponse<RoomSystemAlert>>>;
|
|
7
|
+
/** Requires an admin session. Defaults to popup; chat requires a roomId. */
|
|
8
|
+
createUserAlert(userId: string, input: SystemAlertInput & {
|
|
9
|
+
roomId?: string | null;
|
|
10
|
+
}): Promise<import("../types.js").ApiSuccessResponse<SystemAlertResponse<UserSystemAlert>>>;
|
|
3
11
|
getTeam(): Promise<import("../types.js").ApiSuccessResponse<TeamDirectory>>;
|
|
4
12
|
getCountryFlags(): Promise<import("../types.js").ApiSuccessResponse<CountryFlagSettings>>;
|
|
5
13
|
updateCountryFlags(input: CountryFlagSettings): Promise<import("../types.js").ApiSuccessResponse<CountryFlagSettings>>;
|
package/dist/resources/system.js
CHANGED
|
@@ -1,5 +1,17 @@
|
|
|
1
1
|
export function createSystemResource(api) {
|
|
2
2
|
return {
|
|
3
|
+
/** Requires an admin session. Delivery defaults to room chat. */
|
|
4
|
+
createGlobalAlert(input) {
|
|
5
|
+
return api.post("/admin/system-alerts", input);
|
|
6
|
+
},
|
|
7
|
+
/** Requires an admin session. Delivery defaults to room chat. */
|
|
8
|
+
createRoomAlert(roomId, input) {
|
|
9
|
+
return api.post(`/admin/rooms/${encodeURIComponent(roomId)}/system-alerts`, input);
|
|
10
|
+
},
|
|
11
|
+
/** Requires an admin session. Defaults to popup; chat requires a roomId. */
|
|
12
|
+
createUserAlert(userId, input) {
|
|
13
|
+
return api.post(`/admin/users/${encodeURIComponent(userId)}/system-alerts`, input);
|
|
14
|
+
},
|
|
3
15
|
getTeam() {
|
|
4
16
|
return api.get("/team", { authMode: "none" });
|
|
5
17
|
},
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"system.js","sourceRoot":"","sources":["../../src/resources/system.ts"],"names":[],"mappings":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AAM,EAAE,CAAC,CAAC;QAClF,CAAC;QAED,eAAe;YACX,OAAO,GAAG,CAAC,GAAG,CAAmB,2BAA2B,CAAC,CAAC;QAClE,CAAC;QAED,gBAAgB,CAAC,KAAkC;YAC/C,OAAO,GAAG,CAAC,GAAG,CAAmB,2BAA2B,EAAE,KAAK,CAAC,CAAC;QACzE,CAAC;QAED,MAAM;YACF,OAAO,GAAG,CAAC,GAAG,CAAe,gBAAgB,EAAE;gBAC3C,QAAQ,EAAE,MAAM;aACnB,CAAC,CAAC;QACP,CAAC;QAED,WAAW;YACP,OAAO,GAAG,CAAC,GAAG,CAAoB,sBAAsB,CAAC,CAAC;QAC9D,CAAC;QAED,WAAW;YACP,OAAO,GAAG,CAAC,GAAG,CAAoB,sBAAsB,CAAC,CAAC;QAC9D,CAAC;QAED,WAAW;YACP,OAAO,GAAG,CAAC,GAAG,CAAoB,sBAAsB,EAAE;gBACtD,QAAQ,EAAE,MAAM;aACnB,CAAC,CAAC;QACP,CAAC;QAED,2BAA2B;YACvB,OAAO,GAAG,CAAC,GAAG,CACV,8BAA8B,CACjC,CAAC;QACN,CAAC;QAED,uBAAuB;YACnB,OAAO,GAAG,CAAC,IAAI,CACX,6BAA6B,EAC7B,EAAE,CACL,CAAC;QACN,CAAC;QAED,MAAM;YACF,OAAO,GAAG,CAAC,GAAG,CAAe,GAAG,CAAC,UAAU,CAAC,SAAS,CAAC,EAAE;gBACpD,QAAQ,EAAE,MAAM;aACnB,CAAC,CAAC;QACP,CAAC;KACJ,CAAC;AACN,CAAC"}
|
package/dist/types.d.ts
CHANGED
|
@@ -578,8 +578,139 @@ export interface ChatMessage {
|
|
|
578
578
|
targetUserIds?: string[];
|
|
579
579
|
/** Structured card supplied by a room bot, when present. */
|
|
580
580
|
embed?: RoomBotChatEmbed | null;
|
|
581
|
+
systemColor?: string | null;
|
|
582
|
+
systemAppearance?: SystemAlertAppearance | null;
|
|
581
583
|
[key: string]: unknown;
|
|
582
584
|
}
|
|
585
|
+
/** Appearance values accepted by the administrative system-alert endpoints. */
|
|
586
|
+
export interface SystemAlertAppearance {
|
|
587
|
+
background?: string;
|
|
588
|
+
border?: string;
|
|
589
|
+
titleColor?: string;
|
|
590
|
+
textColor?: string;
|
|
591
|
+
iconColor?: string;
|
|
592
|
+
iconBackground?: string;
|
|
593
|
+
iconBackgroundEnabled?: boolean;
|
|
594
|
+
/** Defaults to false. Places the icon before the title when enabled. */
|
|
595
|
+
iconBeforeTitle?: boolean;
|
|
596
|
+
icon?: "info" | "brand" | "warning" | "bell" | "gift" | "none";
|
|
597
|
+
iconPosition?: "left" | "top" | "right";
|
|
598
|
+
iconSize?: number;
|
|
599
|
+
width?: number;
|
|
600
|
+
titleSize?: number;
|
|
601
|
+
textSize?: number;
|
|
602
|
+
}
|
|
603
|
+
export interface SystemAlertInput {
|
|
604
|
+
color?: string;
|
|
605
|
+
appearance?: SystemAlertAppearance | null;
|
|
606
|
+
delivery?: "chat" | "popup";
|
|
607
|
+
bilingual?: boolean;
|
|
608
|
+
fallbackLocale?: string | null;
|
|
609
|
+
title?: string | null;
|
|
610
|
+
message?: string | null;
|
|
611
|
+
titlePtBr?: string | null;
|
|
612
|
+
messagePtBr?: string | null;
|
|
613
|
+
titleEnUs?: string | null;
|
|
614
|
+
messageEnUs?: string | null;
|
|
615
|
+
}
|
|
616
|
+
/** Text returned by HTTP; appearance, color and delivery are realtime fields. */
|
|
617
|
+
export interface SystemAlert {
|
|
618
|
+
bilingual: boolean;
|
|
619
|
+
title: string;
|
|
620
|
+
message: string;
|
|
621
|
+
titlePtBr: string | null;
|
|
622
|
+
messagePtBr: string | null;
|
|
623
|
+
titleEnUs: string | null;
|
|
624
|
+
messageEnUs: string | null;
|
|
625
|
+
}
|
|
626
|
+
export interface RoomSystemAlert extends SystemAlert {
|
|
627
|
+
roomId: string;
|
|
628
|
+
}
|
|
629
|
+
export interface UserSystemAlert extends SystemAlert {
|
|
630
|
+
targetUserId: string;
|
|
631
|
+
targetUsername: string;
|
|
632
|
+
targetDisplayUsername: string;
|
|
633
|
+
roomId: string | null;
|
|
634
|
+
roomName: string | null;
|
|
635
|
+
}
|
|
636
|
+
export interface SystemAlertResponse<TAlert extends SystemAlert = SystemAlert> {
|
|
637
|
+
success: true;
|
|
638
|
+
alert: TAlert;
|
|
639
|
+
}
|
|
640
|
+
export interface PrivateMessageCustomEmoji {
|
|
641
|
+
id: string;
|
|
642
|
+
shortcode: string;
|
|
643
|
+
imageUrl: string;
|
|
644
|
+
source?: "room" | "favorite";
|
|
645
|
+
roomId?: string | null;
|
|
646
|
+
roomName?: string | null;
|
|
647
|
+
roomLogoUrl?: string | null;
|
|
648
|
+
roomSlug?: string | null;
|
|
649
|
+
roomIsPrivate?: boolean;
|
|
650
|
+
createdById?: string | null;
|
|
651
|
+
createdByUsername?: string | null;
|
|
652
|
+
createdAt?: string | null;
|
|
653
|
+
}
|
|
654
|
+
export interface PrivateMessageUser {
|
|
655
|
+
id: string;
|
|
656
|
+
username: string;
|
|
657
|
+
displayUsername: string;
|
|
658
|
+
avatar: string | null;
|
|
659
|
+
platformRole: string;
|
|
660
|
+
platformRoles: string[];
|
|
661
|
+
presenceStatus: "online" | "busy" | "away" | "offline";
|
|
662
|
+
}
|
|
663
|
+
export interface PrivateMessageReply {
|
|
664
|
+
id: string;
|
|
665
|
+
userId: string;
|
|
666
|
+
username: string;
|
|
667
|
+
content: string;
|
|
668
|
+
customEmojis: PrivateMessageCustomEmoji[];
|
|
669
|
+
deleted: boolean;
|
|
670
|
+
}
|
|
671
|
+
export interface PrivateMessage {
|
|
672
|
+
id: string;
|
|
673
|
+
conversationId: string;
|
|
674
|
+
senderUserId: string;
|
|
675
|
+
recipientUserId: string;
|
|
676
|
+
content: string;
|
|
677
|
+
customEmojis: PrivateMessageCustomEmoji[];
|
|
678
|
+
createdAt: string;
|
|
679
|
+
editedAt: string | null;
|
|
680
|
+
originalContent: string | null;
|
|
681
|
+
readAt: string | null;
|
|
682
|
+
replyTo: PrivateMessageReply | null;
|
|
683
|
+
reactions: Array<{
|
|
684
|
+
emoji: string;
|
|
685
|
+
count: number;
|
|
686
|
+
userIds: string[];
|
|
687
|
+
customEmoji?: PrivateMessageCustomEmoji | null;
|
|
688
|
+
}>;
|
|
689
|
+
}
|
|
690
|
+
export interface PrivateConversation {
|
|
691
|
+
id: string;
|
|
692
|
+
participantAId: string;
|
|
693
|
+
participantBId: string;
|
|
694
|
+
createdAt: string;
|
|
695
|
+
updatedAt: string;
|
|
696
|
+
participants: PrivateMessageUser[];
|
|
697
|
+
lastMessage: PrivateMessage | null;
|
|
698
|
+
unreadCount: number;
|
|
699
|
+
}
|
|
700
|
+
export interface PrivateMessageSendInput {
|
|
701
|
+
content: string;
|
|
702
|
+
/** Optional UUID v4. Reuse the same ID and content when retrying a send. */
|
|
703
|
+
clientMessageId?: string;
|
|
704
|
+
roomId?: string | null;
|
|
705
|
+
customEmojiIds?: string[];
|
|
706
|
+
replyTo?: {
|
|
707
|
+
id?: string | null;
|
|
708
|
+
} | null;
|
|
709
|
+
}
|
|
710
|
+
export interface PrivateMessageSendResponse {
|
|
711
|
+
conversation: PrivateConversation;
|
|
712
|
+
message: PrivateMessage;
|
|
713
|
+
}
|
|
583
714
|
export interface WalletBalance {
|
|
584
715
|
coins: number;
|
|
585
716
|
diamonds: number;
|
|
@@ -752,6 +883,37 @@ export interface RoomBotState {
|
|
|
752
883
|
snapshot: RoomStateSnapshot;
|
|
753
884
|
customEmojis: RoomCustomEmoji[];
|
|
754
885
|
}
|
|
886
|
+
export type PurchaseHistoryCategory = "avatar" | "background" | "badge" | "videoframe" | "misc" | "unknown";
|
|
887
|
+
export type PurchaseHistoryCurrency = "coins" | "diamonds" | "free" | "external";
|
|
888
|
+
export interface PurchaseHistoryOptions {
|
|
889
|
+
page?: number;
|
|
890
|
+
pageSize?: number;
|
|
891
|
+
q?: string;
|
|
892
|
+
category?: PurchaseHistoryCategory | "all";
|
|
893
|
+
}
|
|
894
|
+
export interface PurchaseHistoryItem {
|
|
895
|
+
id: string;
|
|
896
|
+
itemId: string | null;
|
|
897
|
+
name: string;
|
|
898
|
+
category: PurchaseHistoryCategory;
|
|
899
|
+
collection: string | null;
|
|
900
|
+
imageUrl: string | null;
|
|
901
|
+
frameCount?: number;
|
|
902
|
+
frameWidth?: number;
|
|
903
|
+
/** Absolute recorded wallet charge; external fiat amounts are not tracked here. */
|
|
904
|
+
amount: number;
|
|
905
|
+
/** Null means the historical purchase currency was not recorded. */
|
|
906
|
+
currency: PurchaseHistoryCurrency | null;
|
|
907
|
+
purchasedAt: string;
|
|
908
|
+
description: string;
|
|
909
|
+
}
|
|
910
|
+
export interface PurchaseHistoryResponse {
|
|
911
|
+
items: PurchaseHistoryItem[];
|
|
912
|
+
page: number;
|
|
913
|
+
pageSize: number;
|
|
914
|
+
total: number;
|
|
915
|
+
totalPages: number;
|
|
916
|
+
}
|
|
755
917
|
/** Extensible room snapshot returned by bot state and room realtime events. */
|
|
756
918
|
export interface RoomStateSnapshot extends Record<string, unknown> {
|
|
757
919
|
roomId?: string;
|
|
@@ -868,7 +1030,35 @@ export interface SystemDonationGoal {
|
|
|
868
1030
|
raisedCents: number;
|
|
869
1031
|
[key: string]: unknown;
|
|
870
1032
|
}
|
|
1033
|
+
export interface SystemProgressionXp {
|
|
1034
|
+
dailyLimit: {
|
|
1035
|
+
enabled: boolean;
|
|
1036
|
+
/** Shared equivalent reward hours; this is not a fixed XP amount. */
|
|
1037
|
+
hours: number;
|
|
1038
|
+
resetTimeUtc: "00:00";
|
|
1039
|
+
};
|
|
1040
|
+
globalCooldownMs: number;
|
|
1041
|
+
woot: {
|
|
1042
|
+
xp: number;
|
|
1043
|
+
cooldownMs: number;
|
|
1044
|
+
dailyXpCostMs: number;
|
|
1045
|
+
};
|
|
1046
|
+
dj: {
|
|
1047
|
+
xp: number;
|
|
1048
|
+
cooldownMs: number;
|
|
1049
|
+
replayCooldownMs: number;
|
|
1050
|
+
dailyXpCostMs: number;
|
|
1051
|
+
minDurationMs: number;
|
|
1052
|
+
minPlaybackMs: number;
|
|
1053
|
+
minPlaybackPercent: number;
|
|
1054
|
+
maxRequiredPlaybackMs: number;
|
|
1055
|
+
minWoots: number;
|
|
1056
|
+
minHumans: number;
|
|
1057
|
+
};
|
|
1058
|
+
}
|
|
871
1059
|
export interface SystemStatus {
|
|
1060
|
+
/** Null when XP configuration is unavailable; omitted by older servers. */
|
|
1061
|
+
progressionXp?: SystemProgressionXp | null;
|
|
872
1062
|
donationCurrencySelectionEnabled?: boolean;
|
|
873
1063
|
customPronounsEnabled?: boolean;
|
|
874
1064
|
teamPageEnabled?: boolean;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@wavezfm/api",
|
|
3
|
-
"version": "0.7.
|
|
3
|
+
"version": "0.7.16",
|
|
4
4
|
"description": "Official JavaScript/TypeScript API client for WavezFM.",
|
|
5
5
|
"homepage": "https://docs.wavez.fm/docs",
|
|
6
6
|
"repository": {
|
|
@@ -65,6 +65,10 @@
|
|
|
65
65
|
"types": "./dist/resources/chat.d.ts",
|
|
66
66
|
"import": "./dist/resources/chat.js"
|
|
67
67
|
},
|
|
68
|
+
"./resources/private-messages": {
|
|
69
|
+
"types": "./dist/resources/privateMessages.d.ts",
|
|
70
|
+
"import": "./dist/resources/privateMessages.js"
|
|
71
|
+
},
|
|
68
72
|
"./resources/friend": {
|
|
69
73
|
"types": "./dist/resources/friend.d.ts",
|
|
70
74
|
"import": "./dist/resources/friend.js"
|