@wavezfm/api 0.7.32 → 0.7.34
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 +3 -0
- package/dist/index.d.ts +5 -0
- package/dist/resources/roomBot.d.ts +7 -1
- package/dist/resources/roomBot.js +9 -0
- package/dist/resources/roomBot.js.map +1 -1
- package/dist/types.d.ts +8 -3
- package/package.json +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -2,6 +2,9 @@
|
|
|
2
2
|
|
|
3
3
|
## Unreleased
|
|
4
4
|
|
|
5
|
+
- Add `roomBot.getScheduledEvents(roomId)` for approved active/upcoming room and global calendar events, including start/end timestamps. Existing `getEvents` continues to return presence history.
|
|
6
|
+
- Add `roomBot.setVip(roomId, userId, enabled)` and optional `isVip` in user-update payloads. VIP can coexist with the main room role.
|
|
7
|
+
|
|
5
8
|
- Add `user.getBotEmojiLibrary/createBotEmoji/updateBotEmoji/deleteBotEmoji` for the authenticated owner's shared bot emoji library, and read-only `roomBot.getOwnerEmojis` with bot authentication.
|
|
6
9
|
- Type optional decimal-string bot `numericId`, owner-library emoji snapshots, and `room.regenerateBotToken`. Existing string identifiers accept public numeric bot IDs, token UUIDs and `room-bot:<UUID>` where supported by the server. Room/user targets and emoji shortcode syntax are unchanged.
|
|
7
10
|
|
package/dist/index.d.ts
CHANGED
|
@@ -673,6 +673,11 @@ export declare function createApiClient(config: ApiClientConfig): {
|
|
|
673
673
|
review(eventId: string, decision: "approved" | "rejected"): Promise<import("./types.js").ApiSuccessResponse<import("./types.js").RoomEventMutationResponse>>;
|
|
674
674
|
};
|
|
675
675
|
roomBot: {
|
|
676
|
+
getScheduledEvents(roomId: string): Promise<import("./types.js").ApiSuccessResponse<import("./types.js").RoomEventListResponse>>;
|
|
677
|
+
setVip(roomId: string, userId: string, isVip: boolean): Promise<import("./types.js").ApiSuccessResponse<{
|
|
678
|
+
userId: string;
|
|
679
|
+
isVip: boolean;
|
|
680
|
+
}>>;
|
|
676
681
|
getOwnerEmojis(roomId: string): Promise<import("./types.js").ApiSuccessResponse<import("./types.js").BotEmojiLibrary>>;
|
|
677
682
|
renameSelf(roomId: string, botName: string): Promise<import("./types.js").ApiSuccessResponse<import("./types.js").RoomBotSettings>>;
|
|
678
683
|
getState(roomId: string): Promise<import("./types.js").ApiSuccessResponse<import("./types.js").RoomBotState>>;
|
|
@@ -1,5 +1,11 @@
|
|
|
1
|
-
import type { ApiLike, BotEmojiLibrary, ApiSuccessResponse, ChatImageUploadResponse, ChatMessage, RoomBotEventsResponse, RoomBotEditMessageInput, RoomBotQueueAddResponse, RoomQueueSnapshot, RoomBotSendMessageInput, RoomBotSendMessageResponse, RoomPresenceEventFilterType, RoomBotState, RoomBotSettings, RoomCustomEmoji, RoomLinkFiltersUpdateInput, RoomSettingsUpdateInput } from "../types.js";
|
|
1
|
+
import type { ApiLike, BotEmojiLibrary, ApiSuccessResponse, ChatImageUploadResponse, ChatMessage, RoomBotEventsResponse, RoomBotEditMessageInput, RoomBotQueueAddResponse, RoomQueueSnapshot, RoomBotSendMessageInput, RoomBotSendMessageResponse, RoomPresenceEventFilterType, RoomBotState, RoomBotSettings, RoomEventListResponse, RoomCustomEmoji, RoomLinkFiltersUpdateInput, RoomSettingsUpdateInput } from "../types.js";
|
|
2
2
|
export declare function createRoomBotResource(api: ApiLike): {
|
|
3
|
+
/** Approved active/upcoming calendar events for this room and the platform. */
|
|
4
|
+
getScheduledEvents(roomId: string): Promise<ApiSuccessResponse<RoomEventListResponse>>;
|
|
5
|
+
setVip(roomId: string, userId: string, isVip: boolean): Promise<ApiSuccessResponse<{
|
|
6
|
+
userId: string;
|
|
7
|
+
isVip: boolean;
|
|
8
|
+
}>>;
|
|
3
9
|
getOwnerEmojis(roomId: string): Promise<ApiSuccessResponse<BotEmojiLibrary>>;
|
|
4
10
|
renameSelf(roomId: string, botName: string): Promise<ApiSuccessResponse<RoomBotSettings>>;
|
|
5
11
|
getState(roomId: string): Promise<ApiSuccessResponse<RoomBotState>>;
|
|
@@ -4,6 +4,15 @@ function isFormDataInput(value) {
|
|
|
4
4
|
}
|
|
5
5
|
export function createRoomBotResource(api) {
|
|
6
6
|
return {
|
|
7
|
+
/** Approved active/upcoming calendar events for this room and the platform. */
|
|
8
|
+
getScheduledEvents(roomId) {
|
|
9
|
+
return api.get(`/bot/rooms/${encodeURIComponent(roomId)}/scheduled-events`, {
|
|
10
|
+
authMode: "room-bot", cache: "no-store",
|
|
11
|
+
});
|
|
12
|
+
},
|
|
13
|
+
setVip(roomId, userId, isVip) {
|
|
14
|
+
return api.put(`/bot/rooms/${encodeURIComponent(roomId)}/roles/${encodeURIComponent(userId)}`, { isVip }, { authMode: "room-bot" });
|
|
15
|
+
},
|
|
7
16
|
getOwnerEmojis(roomId) {
|
|
8
17
|
return api.get(`/bot/rooms/${encodeURIComponent(roomId)}/owner-emojis`, {
|
|
9
18
|
authMode: "room-bot", cache: "no-store",
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"roomBot.js","sourceRoot":"","sources":["../../src/resources/roomBot.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,sBAAsB,EAAE,MAAM,uBAAuB,CAAC;
|
|
1
|
+
{"version":3,"file":"roomBot.js","sourceRoot":"","sources":["../../src/resources/roomBot.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,sBAAsB,EAAE,MAAM,uBAAuB,CAAC;AAsB/D,SAAS,eAAe,CAAC,KAAc;IACnC,OAAO,OAAO,QAAQ,KAAK,WAAW,IAAI,KAAK,YAAY,QAAQ,CAAC;AACxE,CAAC;AAED,MAAM,UAAU,qBAAqB,CAAC,GAAY;IAC9C,OAAO;QACH,+EAA+E;QAC/E,kBAAkB,CAAC,MAAc;YAC7B,OAAO,GAAG,CAAC,GAAG,CAAwB,cAAc,kBAAkB,CAAC,MAAM,CAAC,mBAAmB,EAAE;gBAC/F,QAAQ,EAAE,UAAU,EAAE,KAAK,EAAE,UAAU;aAC1C,CAAC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210,9 +210,11 @@ export interface RoomActiveUser {
|
|
|
210
210
|
avatarFrameCount?: number;
|
|
211
211
|
guest?: boolean;
|
|
212
212
|
role?: RoomRoleName | string;
|
|
213
|
-
/**
|
|
213
|
+
/** Actual room assignment, independent of platform privileges. */
|
|
214
214
|
roomRole?: RoomRoleName | string;
|
|
215
215
|
assignedRoomRole?: RoomRoleName | string;
|
|
216
|
+
/** Authorization role including platform privileges; use for bot command checks. */
|
|
217
|
+
effectiveRoomRole?: RoomRoleName | string;
|
|
216
218
|
platformRole?: string | null;
|
|
217
219
|
platformRoles?: string[];
|
|
218
220
|
customGlobalRoles?: unknown[];
|
|
@@ -1538,6 +1540,7 @@ export interface RoomBotUserUpdatedPayload extends Record<string, unknown> {
|
|
|
1538
1540
|
role?: string;
|
|
1539
1541
|
roomRole?: string;
|
|
1540
1542
|
customRoomRoleId?: string | null;
|
|
1543
|
+
isVip?: boolean;
|
|
1541
1544
|
actor?: RoomActionActor;
|
|
1542
1545
|
previousRole?: string;
|
|
1543
1546
|
previousCustomRoomRoleId?: string | null;
|
|
@@ -1617,11 +1620,13 @@ export interface BotPrivateCommand {
|
|
|
1617
1620
|
userId: string;
|
|
1618
1621
|
username: string;
|
|
1619
1622
|
displayUsername: string;
|
|
1620
|
-
/**
|
|
1623
|
+
/** Actual assigned room role. */
|
|
1621
1624
|
roomRole: string;
|
|
1622
|
-
/**
|
|
1625
|
+
/** Actual assigned room role alias. */
|
|
1623
1626
|
role?: string;
|
|
1624
1627
|
assignedRoomRole?: string;
|
|
1628
|
+
/** Admin/Developer >= Host; Ambassador >= Manager. */
|
|
1629
|
+
effectiveRoomRole?: string;
|
|
1625
1630
|
platformRole?: string;
|
|
1626
1631
|
platformRoles: string[];
|
|
1627
1632
|
isRoomOwner: boolean;
|