polyv-live-cli 1.2.29-rc.0 → 1.2.29
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 +422 -81
- package/dist/commands/account.commands.d.ts.map +1 -1
- package/dist/commands/account.commands.js +0 -298
- package/dist/commands/account.commands.js.map +1 -1
- package/dist/commands/ai.commands.d.ts +1 -4
- package/dist/commands/ai.commands.d.ts.map +1 -1
- package/dist/commands/ai.commands.js +6 -245
- package/dist/commands/ai.commands.js.map +1 -1
- package/dist/commands/card-push.commands.d.ts +0 -1
- package/dist/commands/card-push.commands.d.ts.map +1 -1
- package/dist/commands/card-push.commands.js +0 -66
- package/dist/commands/card-push.commands.js.map +1 -1
- package/dist/commands/channel.commands.d.ts +1 -6
- package/dist/commands/channel.commands.d.ts.map +1 -1
- package/dist/commands/channel.commands.js +0 -752
- package/dist/commands/channel.commands.js.map +1 -1
- package/dist/commands/chat.commands.d.ts +0 -10
- package/dist/commands/chat.commands.d.ts.map +1 -1
- package/dist/commands/chat.commands.js +0 -397
- package/dist/commands/chat.commands.js.map +1 -1
- package/dist/commands/checkin.commands.d.ts.map +1 -1
- package/dist/commands/checkin.commands.js +0 -34
- package/dist/commands/checkin.commands.js.map +1 -1
- package/dist/commands/coupon.commands.d.ts +0 -2
- package/dist/commands/coupon.commands.d.ts.map +1 -1
- package/dist/commands/coupon.commands.js +0 -140
- package/dist/commands/coupon.commands.js.map +1 -1
- package/dist/commands/document.commands.d.ts.map +1 -1
- package/dist/commands/document.commands.js +0 -79
- package/dist/commands/document.commands.js.map +1 -1
- package/dist/commands/donate.commands.d.ts.map +1 -1
- package/dist/commands/donate.commands.js +0 -42
- package/dist/commands/donate.commands.js.map +1 -1
- package/dist/commands/index.d.ts +0 -5
- package/dist/commands/index.d.ts.map +1 -1
- package/dist/commands/index.js +1 -11
- package/dist/commands/index.js.map +1 -1
- package/dist/commands/lottery.commands.d.ts +0 -3
- package/dist/commands/lottery.commands.d.ts.map +1 -1
- package/dist/commands/lottery.commands.js +18 -381
- package/dist/commands/lottery.commands.js.map +1 -1
- package/dist/commands/monitor.commands.d.ts.map +1 -1
- package/dist/commands/monitor.commands.js +0 -54
- package/dist/commands/monitor.commands.js.map +1 -1
- package/dist/commands/platform.commands.d.ts.map +1 -1
- package/dist/commands/platform.commands.js +0 -377
- package/dist/commands/platform.commands.js.map +1 -1
- package/dist/commands/playback.commands.d.ts.map +1 -1
- package/dist/commands/playback.commands.js +0 -115
- package/dist/commands/playback.commands.js.map +1 -1
- package/dist/commands/player.commands.d.ts.map +1 -1
- package/dist/commands/player.commands.js +0 -202
- package/dist/commands/player.commands.js.map +1 -1
- package/dist/commands/product.commands.d.ts +0 -3
- package/dist/commands/product.commands.d.ts.map +1 -1
- package/dist/commands/product.commands.js +0 -388
- package/dist/commands/product.commands.js.map +1 -1
- package/dist/commands/promotion.commands.d.ts.map +1 -1
- package/dist/commands/promotion.commands.js +0 -2
- package/dist/commands/promotion.commands.js.map +1 -1
- package/dist/commands/qa.commands.d.ts +0 -2
- package/dist/commands/qa.commands.d.ts.map +1 -1
- package/dist/commands/qa.commands.js +0 -164
- package/dist/commands/qa.commands.js.map +1 -1
- package/dist/commands/questionnaire.commands.d.ts +0 -2
- package/dist/commands/questionnaire.commands.d.ts.map +1 -1
- package/dist/commands/questionnaire.commands.js +0 -115
- package/dist/commands/questionnaire.commands.js.map +1 -1
- package/dist/commands/record.commands.d.ts.map +1 -1
- package/dist/commands/record.commands.js +0 -154
- package/dist/commands/record.commands.js.map +1 -1
- package/dist/commands/session.commands.d.ts.map +1 -1
- package/dist/commands/session.commands.js +0 -95
- package/dist/commands/session.commands.js.map +1 -1
- package/dist/commands/statistics.commands.d.ts.map +1 -1
- package/dist/commands/statistics.commands.js +0 -200
- package/dist/commands/statistics.commands.js.map +1 -1
- package/dist/commands/stream.commands.d.ts.map +1 -1
- package/dist/commands/stream.commands.js +0 -115
- package/dist/commands/stream.commands.js.map +1 -1
- package/dist/commands/transmit.commands.d.ts +0 -1
- package/dist/commands/transmit.commands.d.ts.map +1 -1
- package/dist/commands/transmit.commands.js +0 -33
- package/dist/commands/transmit.commands.js.map +1 -1
- package/dist/commands/viewer.commands.d.ts.map +1 -1
- package/dist/commands/viewer.commands.js +0 -274
- package/dist/commands/viewer.commands.js.map +1 -1
- package/dist/handlers/card-push.handler.d.ts +2 -5
- package/dist/handlers/card-push.handler.d.ts.map +1 -1
- package/dist/handlers/card-push.handler.js +0 -34
- package/dist/handlers/card-push.handler.js.map +1 -1
- package/dist/handlers/channel.handler.d.ts +0 -50
- package/dist/handlers/channel.handler.d.ts.map +1 -1
- package/dist/handlers/channel.handler.js +0 -421
- package/dist/handlers/channel.handler.js.map +1 -1
- package/dist/handlers/chat.handler.d.ts +1 -238
- package/dist/handlers/chat.handler.d.ts.map +1 -1
- package/dist/handlers/chat.handler.js +0 -379
- package/dist/handlers/chat.handler.js.map +1 -1
- package/dist/handlers/checkin.handler.d.ts +1 -4
- package/dist/handlers/checkin.handler.d.ts.map +1 -1
- package/dist/handlers/checkin.handler.js +0 -41
- package/dist/handlers/checkin.handler.js.map +1 -1
- package/dist/handlers/coupon.handler.d.ts +0 -27
- package/dist/handlers/coupon.handler.d.ts.map +1 -1
- package/dist/handlers/coupon.handler.js +0 -117
- package/dist/handlers/coupon.handler.js.map +1 -1
- package/dist/handlers/document.handler.d.ts +0 -17
- package/dist/handlers/document.handler.d.ts.map +1 -1
- package/dist/handlers/document.handler.js +0 -67
- package/dist/handlers/document.handler.js.map +1 -1
- package/dist/handlers/donate.handler.d.ts +1 -4
- package/dist/handlers/donate.handler.d.ts.map +1 -1
- package/dist/handlers/donate.handler.js +0 -47
- package/dist/handlers/donate.handler.js.map +1 -1
- package/dist/handlers/lottery.handler.d.ts +3 -29
- package/dist/handlers/lottery.handler.d.ts.map +1 -1
- package/dist/handlers/lottery.handler.js +75 -328
- package/dist/handlers/lottery.handler.js.map +1 -1
- package/dist/handlers/platform.handler.d.ts +2 -19
- package/dist/handlers/platform.handler.d.ts.map +1 -1
- package/dist/handlers/platform.handler.js +12 -187
- package/dist/handlers/platform.handler.js.map +1 -1
- package/dist/handlers/playback.handler.d.ts +0 -20
- package/dist/handlers/playback.handler.d.ts.map +1 -1
- package/dist/handlers/playback.handler.js +0 -91
- package/dist/handlers/playback.handler.js.map +1 -1
- package/dist/handlers/player.handler.d.ts +0 -22
- package/dist/handlers/player.handler.d.ts.map +1 -1
- package/dist/handlers/player.handler.js +0 -61
- package/dist/handlers/player.handler.js.map +1 -1
- package/dist/handlers/product.handler.d.ts +1 -141
- package/dist/handlers/product.handler.d.ts.map +1 -1
- package/dist/handlers/product.handler.js +0 -288
- package/dist/handlers/product.handler.js.map +1 -1
- package/dist/handlers/promotion.handler.d.ts.map +1 -1
- package/dist/handlers/promotion.handler.js +0 -2
- package/dist/handlers/promotion.handler.js.map +1 -1
- package/dist/handlers/qa-questionnaire.handler.d.ts +1 -15
- package/dist/handlers/qa-questionnaire.handler.d.ts.map +1 -1
- package/dist/handlers/qa-questionnaire.handler.js +0 -179
- package/dist/handlers/qa-questionnaire.handler.js.map +1 -1
- package/dist/handlers/record.handler.d.ts +0 -32
- package/dist/handlers/record.handler.d.ts.map +1 -1
- package/dist/handlers/record.handler.js +0 -146
- package/dist/handlers/record.handler.js.map +1 -1
- package/dist/handlers/session.handler.d.ts +0 -20
- package/dist/handlers/session.handler.d.ts.map +1 -1
- package/dist/handlers/session.handler.js +0 -68
- package/dist/handlers/session.handler.js.map +1 -1
- package/dist/handlers/statistics.handler.d.ts +0 -4
- package/dist/handlers/statistics.handler.d.ts.map +1 -1
- package/dist/handlers/statistics.handler.js +0 -11
- package/dist/handlers/statistics.handler.js.map +1 -1
- package/dist/handlers/stream.handler.d.ts +1 -73
- package/dist/handlers/stream.handler.d.ts.map +1 -1
- package/dist/handlers/stream.handler.js +0 -120
- package/dist/handlers/stream.handler.js.map +1 -1
- package/dist/handlers/transmit.handler.d.ts +1 -8
- package/dist/handlers/transmit.handler.d.ts.map +1 -1
- package/dist/handlers/transmit.handler.js +0 -26
- package/dist/handlers/transmit.handler.js.map +1 -1
- package/dist/handlers/viewer.handler.d.ts +1 -29
- package/dist/handlers/viewer.handler.d.ts.map +1 -1
- package/dist/handlers/viewer.handler.js +8 -399
- package/dist/handlers/viewer.handler.js.map +1 -1
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +19 -114
- package/dist/index.js.map +1 -1
- package/dist/services/ai-digital-human-service.d.ts +0 -2
- package/dist/services/ai-digital-human-service.d.ts.map +1 -1
- package/dist/services/ai-digital-human-service.js +15 -14
- package/dist/services/ai-digital-human-service.js.map +1 -1
- package/dist/services/card-push-service.d.ts +1 -6
- package/dist/services/card-push-service.d.ts.map +1 -1
- package/dist/services/card-push-service.js +18 -51
- package/dist/services/card-push-service.js.map +1 -1
- package/dist/services/channel.service.sdk.d.ts +0 -73
- package/dist/services/channel.service.sdk.d.ts.map +1 -1
- package/dist/services/channel.service.sdk.js +0 -508
- package/dist/services/channel.service.sdk.js.map +1 -1
- package/dist/services/chat.service.sdk.d.ts +0 -170
- package/dist/services/chat.service.sdk.d.ts.map +1 -1
- package/dist/services/chat.service.sdk.js +0 -256
- package/dist/services/chat.service.sdk.js.map +1 -1
- package/dist/services/checkin-service.d.ts +1 -2
- package/dist/services/checkin-service.d.ts.map +1 -1
- package/dist/services/checkin-service.js +0 -12
- package/dist/services/checkin-service.js.map +1 -1
- package/dist/services/document.service.sdk.d.ts +0 -13
- package/dist/services/document.service.sdk.d.ts.map +1 -1
- package/dist/services/document.service.sdk.js +0 -28
- package/dist/services/document.service.sdk.js.map +1 -1
- package/dist/services/donate-service.d.ts +1 -4
- package/dist/services/donate-service.d.ts.map +1 -1
- package/dist/services/donate-service.js +9 -69
- package/dist/services/donate-service.js.map +1 -1
- package/dist/services/lottery-service.d.ts +1 -25
- package/dist/services/lottery-service.d.ts.map +1 -1
- package/dist/services/lottery-service.js +9 -327
- package/dist/services/lottery-service.js.map +1 -1
- package/dist/services/platform-label-service.d.ts +0 -1
- package/dist/services/platform-label-service.d.ts.map +1 -1
- package/dist/services/platform-label-service.js +6 -20
- package/dist/services/platform-label-service.js.map +1 -1
- package/dist/services/platform-service.d.ts +1 -12
- package/dist/services/platform-service.d.ts.map +1 -1
- package/dist/services/platform-service.js +2 -46
- package/dist/services/platform-service.js.map +1 -1
- package/dist/services/playback.service.sdk.d.ts +0 -27
- package/dist/services/playback.service.sdk.d.ts.map +1 -1
- package/dist/services/playback.service.sdk.js +2 -38
- package/dist/services/playback.service.sdk.js.map +1 -1
- package/dist/services/player.service.sdk.d.ts +0 -12
- package/dist/services/player.service.sdk.d.ts.map +1 -1
- package/dist/services/player.service.sdk.js +0 -36
- package/dist/services/player.service.sdk.js.map +1 -1
- package/dist/services/product.service.sdk.d.ts +1 -78
- package/dist/services/product.service.sdk.d.ts.map +1 -1
- package/dist/services/product.service.sdk.js +0 -470
- package/dist/services/product.service.sdk.js.map +1 -1
- package/dist/services/promotion-service.d.ts +0 -2
- package/dist/services/promotion-service.d.ts.map +1 -1
- package/dist/services/promotion-service.js +21 -34
- package/dist/services/promotion-service.js.map +1 -1
- package/dist/services/qa-questionnaire-service.d.ts +1 -12
- package/dist/services/qa-questionnaire-service.d.ts.map +1 -1
- package/dist/services/qa-questionnaire-service.js +9 -158
- package/dist/services/qa-questionnaire-service.js.map +1 -1
- package/dist/services/record.service.sdk.d.ts +0 -67
- package/dist/services/record.service.sdk.d.ts.map +1 -1
- package/dist/services/record.service.sdk.js +3 -60
- package/dist/services/record.service.sdk.js.map +1 -1
- package/dist/services/session.service.sdk.d.ts +0 -34
- package/dist/services/session.service.sdk.d.ts.map +1 -1
- package/dist/services/session.service.sdk.js +0 -36
- package/dist/services/session.service.sdk.js.map +1 -1
- package/dist/services/statistics.service.sdk.d.ts +0 -21
- package/dist/services/statistics.service.sdk.d.ts.map +1 -1
- package/dist/services/statistics.service.sdk.js +0 -99
- package/dist/services/statistics.service.sdk.js.map +1 -1
- package/dist/services/stream.service.sdk.d.ts +0 -19
- package/dist/services/stream.service.sdk.d.ts.map +1 -1
- package/dist/services/stream.service.sdk.js +0 -109
- package/dist/services/stream.service.sdk.js.map +1 -1
- package/dist/services/transmit-service.d.ts +0 -7
- package/dist/services/transmit-service.d.ts.map +1 -1
- package/dist/services/transmit-service.js +14 -28
- package/dist/services/transmit-service.js.map +1 -1
- package/dist/services/viewer-service.d.ts +1 -15
- package/dist/services/viewer-service.d.ts.map +1 -1
- package/dist/services/viewer-service.js +0 -118
- package/dist/services/viewer-service.js.map +1 -1
- package/dist/setup/resource-handlers.js +3 -2
- package/dist/setup/resource-handlers.js.map +1 -1
- package/dist/types/auth-source.types.d.ts +2 -2
- package/dist/types/auth-source.types.js +2 -2
- package/dist/types/auth-source.types.js.map +1 -1
- package/dist/types/card-push.d.ts +0 -15
- package/dist/types/card-push.d.ts.map +1 -1
- package/dist/types/chat.d.ts +0 -12
- package/dist/types/chat.d.ts.map +1 -1
- package/dist/types/checkin.d.ts +0 -9
- package/dist/types/checkin.d.ts.map +1 -1
- package/dist/types/donate.d.ts +0 -39
- package/dist/types/donate.d.ts.map +1 -1
- package/dist/types/interaction.d.ts +0 -87
- package/dist/types/interaction.d.ts.map +1 -1
- package/dist/types/lottery.d.ts +17 -57
- package/dist/types/lottery.d.ts.map +1 -1
- package/dist/types/platform.d.ts +0 -69
- package/dist/types/platform.d.ts.map +1 -1
- package/dist/types/product.d.ts +0 -82
- package/dist/types/product.d.ts.map +1 -1
- package/dist/types/promotion.d.ts +0 -1
- package/dist/types/promotion.d.ts.map +1 -1
- package/dist/types/qa.d.ts +0 -111
- package/dist/types/qa.d.ts.map +1 -1
- package/dist/types/record.d.ts +0 -1
- package/dist/types/record.d.ts.map +1 -1
- package/dist/types/viewer.d.ts +0 -103
- package/dist/types/viewer.d.ts.map +1 -1
- package/package.json +3 -3
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { BaseHandler } from './base.handler';
|
|
2
|
-
import { ChatSendOptions, ChatListOptions, ChatDeleteOptions, ChatBanOptions, ChatUnbanOptions, ChatKickOptions, ChatUnkickOptions, ChatBannedListOptions, ChatKickedListOptions, ChatServiceConfig
|
|
2
|
+
import { ChatSendOptions, ChatListOptions, ChatDeleteOptions, ChatBanOptions, ChatUnbanOptions, ChatKickOptions, ChatUnkickOptions, ChatBannedListOptions, ChatKickedListOptions, ChatServiceConfig } from '../types/chat';
|
|
3
3
|
import { AuthConfig } from '../types/auth';
|
|
4
4
|
export declare class ChatHandler extends BaseHandler {
|
|
5
5
|
private readonly chatService;
|
|
@@ -7,243 +7,6 @@ export declare class ChatHandler extends BaseHandler {
|
|
|
7
7
|
sendAdminMessage(options: ChatSendOptions): Promise<void>;
|
|
8
8
|
listMessages(options: ChatListOptions): Promise<void>;
|
|
9
9
|
deleteMessage(options: ChatDeleteOptions): Promise<void>;
|
|
10
|
-
getGroupLoginTimes(options: {
|
|
11
|
-
channelId: string;
|
|
12
|
-
output?: OutputFormat;
|
|
13
|
-
}): Promise<void>;
|
|
14
|
-
sendHiddenMessage(options: {
|
|
15
|
-
channelId: string;
|
|
16
|
-
userId: string;
|
|
17
|
-
content?: string;
|
|
18
|
-
imgUrl?: string;
|
|
19
|
-
output?: OutputFormat;
|
|
20
|
-
}): Promise<void>;
|
|
21
|
-
sendHiddenByAdmin(options: {
|
|
22
|
-
channelId: string;
|
|
23
|
-
content: string;
|
|
24
|
-
role: string;
|
|
25
|
-
output?: OutputFormat;
|
|
26
|
-
}): Promise<void>;
|
|
27
|
-
countOnlineUser(options: {
|
|
28
|
-
channelId: string;
|
|
29
|
-
output?: OutputFormat;
|
|
30
|
-
}): Promise<void>;
|
|
31
|
-
removeChatContents(options: {
|
|
32
|
-
channelId: string;
|
|
33
|
-
ids: string[];
|
|
34
|
-
force?: boolean;
|
|
35
|
-
output?: OutputFormat;
|
|
36
|
-
}): Promise<void>;
|
|
37
|
-
listSpeak(options: {
|
|
38
|
-
startTime?: number;
|
|
39
|
-
endTime?: number;
|
|
40
|
-
cursor?: string;
|
|
41
|
-
size?: number;
|
|
42
|
-
output?: OutputFormat;
|
|
43
|
-
}): Promise<void>;
|
|
44
|
-
alertToSpecial(options: {
|
|
45
|
-
channelId: string;
|
|
46
|
-
title: string;
|
|
47
|
-
message: string;
|
|
48
|
-
force?: boolean;
|
|
49
|
-
output?: OutputFormat;
|
|
50
|
-
}): Promise<void>;
|
|
51
|
-
auditMessage(options: {
|
|
52
|
-
channelId: string;
|
|
53
|
-
msgId: string;
|
|
54
|
-
viewerId: string;
|
|
55
|
-
nickName: string;
|
|
56
|
-
content: string;
|
|
57
|
-
avatar?: string;
|
|
58
|
-
sessionId?: string;
|
|
59
|
-
viewerType?: string;
|
|
60
|
-
force?: boolean;
|
|
61
|
-
output?: OutputFormat;
|
|
62
|
-
}): Promise<void>;
|
|
63
|
-
sendCustomMessage(options: {
|
|
64
|
-
channelId: string;
|
|
65
|
-
content?: string;
|
|
66
|
-
imgUrl?: string;
|
|
67
|
-
joinHistoryList?: boolean;
|
|
68
|
-
watchType?: string;
|
|
69
|
-
important?: boolean;
|
|
70
|
-
force?: boolean;
|
|
71
|
-
output?: OutputFormat;
|
|
72
|
-
}): Promise<void>;
|
|
73
|
-
sendCustomMessageEncode(options: {
|
|
74
|
-
channelId: string;
|
|
75
|
-
content?: string;
|
|
76
|
-
imgUrl?: string;
|
|
77
|
-
joinHistoryList?: 0 | 1;
|
|
78
|
-
watchType?: string;
|
|
79
|
-
force?: boolean;
|
|
80
|
-
output?: OutputFormat;
|
|
81
|
-
}): Promise<void>;
|
|
82
|
-
emitByUserId(options: {
|
|
83
|
-
roomId: string;
|
|
84
|
-
userIds: string[];
|
|
85
|
-
payload: string;
|
|
86
|
-
force?: boolean;
|
|
87
|
-
output?: OutputFormat;
|
|
88
|
-
}): Promise<void>;
|
|
89
|
-
listUserBadwords(options: {
|
|
90
|
-
output?: OutputFormat;
|
|
91
|
-
}): Promise<void>;
|
|
92
|
-
addBadwords(options: {
|
|
93
|
-
userId: string;
|
|
94
|
-
words: string[];
|
|
95
|
-
channelId?: string;
|
|
96
|
-
force?: boolean;
|
|
97
|
-
output?: OutputFormat;
|
|
98
|
-
}): Promise<void>;
|
|
99
|
-
deleteUserBadword(options: {
|
|
100
|
-
words: string;
|
|
101
|
-
force?: boolean;
|
|
102
|
-
output?: OutputFormat;
|
|
103
|
-
}): Promise<void>;
|
|
104
|
-
addBannedIp(options: {
|
|
105
|
-
channelId: string;
|
|
106
|
-
ip: string;
|
|
107
|
-
force?: boolean;
|
|
108
|
-
output?: OutputFormat;
|
|
109
|
-
}): Promise<void>;
|
|
110
|
-
listUserBanned(options: {
|
|
111
|
-
page?: number;
|
|
112
|
-
size?: number;
|
|
113
|
-
output?: OutputFormat;
|
|
114
|
-
}): Promise<void>;
|
|
115
|
-
listForbidUsers(options: {
|
|
116
|
-
viewerId?: string;
|
|
117
|
-
nickName?: string;
|
|
118
|
-
pageNumber?: number;
|
|
119
|
-
pageSize?: number;
|
|
120
|
-
output?: OutputFormat;
|
|
121
|
-
}): Promise<void>;
|
|
122
|
-
deleteChannelBanned(options: {
|
|
123
|
-
channelId: string;
|
|
124
|
-
type: 'ip' | 'badword';
|
|
125
|
-
content: string;
|
|
126
|
-
force?: boolean;
|
|
127
|
-
output?: OutputFormat;
|
|
128
|
-
}): Promise<void>;
|
|
129
|
-
listBulletins(options: {
|
|
130
|
-
channelId: string;
|
|
131
|
-
pageNumber?: number;
|
|
132
|
-
pageSize?: number;
|
|
133
|
-
sort?: string;
|
|
134
|
-
output?: OutputFormat;
|
|
135
|
-
}): Promise<void>;
|
|
136
|
-
addBulletin(options: {
|
|
137
|
-
channelId: string;
|
|
138
|
-
content: string;
|
|
139
|
-
isTop?: 'Y' | 'N';
|
|
140
|
-
isPop?: 'Y' | 'N';
|
|
141
|
-
force?: boolean;
|
|
142
|
-
output?: OutputFormat;
|
|
143
|
-
}): Promise<void>;
|
|
144
|
-
cleanNotices(options: {
|
|
145
|
-
channelId: string;
|
|
146
|
-
force?: boolean;
|
|
147
|
-
output?: OutputFormat;
|
|
148
|
-
}): Promise<void>;
|
|
149
|
-
listQa(options: {
|
|
150
|
-
channelId: string;
|
|
151
|
-
pageNumber?: number;
|
|
152
|
-
pageSize?: number;
|
|
153
|
-
output?: OutputFormat;
|
|
154
|
-
}): Promise<void>;
|
|
155
|
-
updateCensorEnabled(options: {
|
|
156
|
-
channelId: string;
|
|
157
|
-
enabled?: 'Y' | 'N';
|
|
158
|
-
force?: boolean;
|
|
159
|
-
output?: OutputFormat;
|
|
160
|
-
}): Promise<void>;
|
|
161
|
-
getAdminInfo(options: {
|
|
162
|
-
channelId: string;
|
|
163
|
-
output?: OutputFormat;
|
|
164
|
-
}): Promise<void>;
|
|
165
|
-
updateAdminInfo(options: {
|
|
166
|
-
channelId: string;
|
|
167
|
-
nickname: string;
|
|
168
|
-
actor: string;
|
|
169
|
-
avatar?: string;
|
|
170
|
-
force?: boolean;
|
|
171
|
-
output?: OutputFormat;
|
|
172
|
-
}): Promise<void>;
|
|
173
|
-
getTeacherInfo(options: {
|
|
174
|
-
channelId: string;
|
|
175
|
-
output?: OutputFormat;
|
|
176
|
-
}): Promise<void>;
|
|
177
|
-
updateTeacherInfo(options: {
|
|
178
|
-
channelId: string;
|
|
179
|
-
nickname?: string;
|
|
180
|
-
actor?: string;
|
|
181
|
-
passwd?: string;
|
|
182
|
-
avatar?: string;
|
|
183
|
-
force?: boolean;
|
|
184
|
-
output?: OutputFormat;
|
|
185
|
-
}): Promise<void>;
|
|
186
|
-
getUserList(options: {
|
|
187
|
-
roomId: string;
|
|
188
|
-
page?: number;
|
|
189
|
-
len?: number;
|
|
190
|
-
toGetSubRooms?: boolean;
|
|
191
|
-
output?: OutputFormat;
|
|
192
|
-
}): Promise<void>;
|
|
193
|
-
getRobotSetting(options: {
|
|
194
|
-
channelId: string;
|
|
195
|
-
output?: OutputFormat;
|
|
196
|
-
}): Promise<void>;
|
|
197
|
-
getRobotStats(options: {
|
|
198
|
-
channelId: string;
|
|
199
|
-
output?: OutputFormat;
|
|
200
|
-
}): Promise<void>;
|
|
201
|
-
updateRobotSetting(options: {
|
|
202
|
-
channelId: string;
|
|
203
|
-
robotNumber: number;
|
|
204
|
-
addRobotModel: 'timely' | 'fixed_time';
|
|
205
|
-
changeTime?: number;
|
|
206
|
-
virtualBookingNumber?: number;
|
|
207
|
-
force?: boolean;
|
|
208
|
-
output?: OutputFormat;
|
|
209
|
-
}): Promise<void>;
|
|
210
|
-
updateRobotListSetting(options: {
|
|
211
|
-
channelId: string;
|
|
212
|
-
robotNumber: number;
|
|
213
|
-
addRobotModel: 'timely' | 'fixed_time';
|
|
214
|
-
changeTime?: number;
|
|
215
|
-
virtualBookingNumber?: number;
|
|
216
|
-
robotList?: Array<{
|
|
217
|
-
name: string;
|
|
218
|
-
avatar: string;
|
|
219
|
-
}>;
|
|
220
|
-
robotRandomMemberEnabled?: 'Y' | 'N';
|
|
221
|
-
force?: boolean;
|
|
222
|
-
output?: OutputFormat;
|
|
223
|
-
}): Promise<void>;
|
|
224
|
-
pauseRobot(options: {
|
|
225
|
-
channelId: string;
|
|
226
|
-
force?: boolean;
|
|
227
|
-
output?: OutputFormat;
|
|
228
|
-
}): Promise<void>;
|
|
229
|
-
batchUpdateChatEnabled(options: {
|
|
230
|
-
channelIds: string[];
|
|
231
|
-
chatEnabled: 'Y' | 'N';
|
|
232
|
-
force?: boolean;
|
|
233
|
-
output?: OutputFormat;
|
|
234
|
-
}): Promise<void>;
|
|
235
|
-
logoutWatchViewer(options: {
|
|
236
|
-
channelId: string;
|
|
237
|
-
token?: string;
|
|
238
|
-
force?: boolean;
|
|
239
|
-
output?: OutputFormat;
|
|
240
|
-
}): Promise<void>;
|
|
241
|
-
private validateRequiredOptions;
|
|
242
|
-
private compactOptions;
|
|
243
|
-
private validateContentOrImage;
|
|
244
|
-
private validateYN;
|
|
245
|
-
private confirmIfNeeded;
|
|
246
|
-
private displayGenericResult;
|
|
247
10
|
private displaySendResult;
|
|
248
11
|
private displayListResult;
|
|
249
12
|
private displayMessagesTable;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"chat.handler.d.ts","sourceRoot":"","sources":["../../src/handlers/chat.handler.ts"],"names":[],"mappings":"AAMA,OAAO,EAAE,WAAW,EAAE,MAAM,gBAAgB,CAAC;AAE7C,OAAO,EACL,eAAe,EACf,eAAe,EACf,iBAAiB,EACjB,cAAc,EACd,gBAAgB,EAChB,eAAe,EACf,iBAAiB,EACjB,qBAAqB,EACrB,qBAAqB,EACrB,iBAAiB,
|
|
1
|
+
{"version":3,"file":"chat.handler.d.ts","sourceRoot":"","sources":["../../src/handlers/chat.handler.ts"],"names":[],"mappings":"AAMA,OAAO,EAAE,WAAW,EAAE,MAAM,gBAAgB,CAAC;AAE7C,OAAO,EACL,eAAe,EACf,eAAe,EACf,iBAAiB,EACjB,cAAc,EACd,gBAAgB,EAChB,eAAe,EACf,iBAAiB,EACjB,qBAAqB,EACrB,qBAAqB,EACrB,iBAAiB,EAElB,MAAM,eAAe,CAAC;AACvB,OAAO,EAAE,UAAU,EAAE,MAAM,eAAe,CAAC;AAS3C,qBAAa,WAAY,SAAQ,WAAW;IAC1C,OAAO,CAAC,QAAQ,CAAC,WAAW,CAAiB;gBAOjC,UAAU,EAAE,UAAU,EAAE,aAAa,EAAE,iBAAiB;IA0B9D,gBAAgB,CAAC,OAAO,EAAE,eAAe,GAAG,OAAO,CAAC,IAAI,CAAC;IAoCzD,YAAY,CAAC,OAAO,EAAE,eAAe,GAAG,OAAO,CAAC,IAAI,CAAC;IA2CrD,aAAa,CAAC,OAAO,EAAE,iBAAiB,GAAG,OAAO,CAAC,IAAI,CAAC;IAuC9D,OAAO,CAAC,iBAAiB;IAczB,OAAO,CAAC,iBAAiB;IAsBzB,OAAO,CAAC,oBAAoB;IAY5B,OAAO,CAAC,mBAAmB;IAmB3B,OAAO,CAAC,eAAe;IA4BjB,OAAO,CAAC,OAAO,EAAE,cAAc,GAAG,OAAO,CAAC,IAAI,CAAC;IA0C/C,SAAS,CAAC,OAAO,EAAE,gBAAgB,GAAG,OAAO,CAAC,IAAI,CAAC;IA+CnD,QAAQ,CAAC,OAAO,EAAE,eAAe,GAAG,OAAO,CAAC,IAAI,CAAC;IA0CjD,UAAU,CAAC,OAAO,EAAE,iBAAiB,GAAG,OAAO,CAAC,IAAI,CAAC;IA6CrD,UAAU,CAAC,OAAO,EAAE,qBAAqB,GAAG,OAAO,CAAC,IAAI,CAAC;IAqCzD,UAAU,CAAC,OAAO,EAAE,qBAAqB,GAAG,OAAO,CAAC,IAAI,CAAC;IAc/D,OAAO,CAAC,mBAAmB;IAyB3B,OAAO,CAAC,mBAAmB;IAiC3B,OAAO,CAAC,qBAAqB;IAyB7B,OAAO,CAAC,kBAAkB;IAyB1B,OAAO,CAAC,mBAAmB;IA6B3B,OAAO,CAAC,yBAAyB;IAyBjC,OAAO,CAAC,yBAAyB;IAuBjC,OAAO,CAAC,gBAAgB;IAcxB,OAAO,CAAC,kBAAkB;IAc1B,OAAO,CAAC,iBAAiB;IAezB,OAAO,CAAC,mBAAmB;IAe3B,OAAO,CAAC,uBAAuB;IAsB/B,OAAO,CAAC,uBAAuB;CAsBhC"}
|
|
@@ -47,385 +47,6 @@ class ChatHandler extends base_handler_1.BaseHandler {
|
|
|
47
47
|
this.displayDeleteResult(options);
|
|
48
48
|
}, 'chat.delete');
|
|
49
49
|
}
|
|
50
|
-
async getGroupLoginTimes(options) {
|
|
51
|
-
return this.executeWithErrorHandling(async () => {
|
|
52
|
-
if (!options.channelId || options.channelId.trim() === '') {
|
|
53
|
-
throw new errors_1.PolyVValidationError('channelId is required', 'channelId', options.channelId, 'validation_failed');
|
|
54
|
-
}
|
|
55
|
-
this.displayData(await this.chatService.getGroupLoginTimes({ channelId: options.channelId }), options.output || 'table');
|
|
56
|
-
}, 'chat.group-login-times.get');
|
|
57
|
-
}
|
|
58
|
-
async sendHiddenMessage(options) {
|
|
59
|
-
return this.executeWithErrorHandling(async () => {
|
|
60
|
-
this.validateRequiredOptions(options, ['channelId', 'userId']);
|
|
61
|
-
this.validateContentOrImage(options);
|
|
62
|
-
const result = await this.chatService.sendChat(options);
|
|
63
|
-
this.displayGenericResult(result, options.output, 'Hidden message sent successfully');
|
|
64
|
-
}, 'chat.message.hidden-send');
|
|
65
|
-
}
|
|
66
|
-
async sendHiddenByAdmin(options) {
|
|
67
|
-
return this.executeWithErrorHandling(async () => {
|
|
68
|
-
this.validateRequiredOptions(options, ['channelId', 'content', 'role']);
|
|
69
|
-
const result = await this.chatService.sendHiddenByAdmin(options);
|
|
70
|
-
this.displayGenericResult(result, options.output, 'Admin hidden message sent successfully');
|
|
71
|
-
}, 'chat.message.admin-send');
|
|
72
|
-
}
|
|
73
|
-
async countOnlineUser(options) {
|
|
74
|
-
return this.executeWithErrorHandling(async () => {
|
|
75
|
-
this.validateRequiredOptions(options, ['channelId']);
|
|
76
|
-
const result = await this.chatService.getChatOnlineCount(options.channelId);
|
|
77
|
-
this.displayGenericResult({ channelId: options.channelId, onlineUserCount: result }, options.output);
|
|
78
|
-
}, 'chat.message.online-count');
|
|
79
|
-
}
|
|
80
|
-
async removeChatContents(options) {
|
|
81
|
-
return this.executeWithErrorHandling(async () => {
|
|
82
|
-
this.validateRequiredOptions(options, ['channelId', 'ids']);
|
|
83
|
-
if (!(await this.confirmIfNeeded(options.force, `Remove chat message(s) ${options.ids.join(',')} from channel ${options.channelId}?`)))
|
|
84
|
-
return;
|
|
85
|
-
const result = await this.chatService.removeChatContents({
|
|
86
|
-
channelId: options.channelId,
|
|
87
|
-
ids: options.ids,
|
|
88
|
-
});
|
|
89
|
-
this.displayGenericResult(result, options.output, 'Chat message(s) removed successfully');
|
|
90
|
-
}, 'chat.message.remove-contents');
|
|
91
|
-
}
|
|
92
|
-
async listSpeak(options) {
|
|
93
|
-
return this.executeWithErrorHandling(async () => {
|
|
94
|
-
const result = await this.chatService.getSpeakList(options);
|
|
95
|
-
this.displayGenericResult(result, options.output);
|
|
96
|
-
}, 'chat.message.speak-list');
|
|
97
|
-
}
|
|
98
|
-
async alertToSpecial(options) {
|
|
99
|
-
return this.executeWithErrorHandling(async () => {
|
|
100
|
-
this.validateRequiredOptions(options, ['channelId', 'title', 'message']);
|
|
101
|
-
if (!(await this.confirmIfNeeded(options.force, `Send popup alert to channel ${options.channelId}?`)))
|
|
102
|
-
return;
|
|
103
|
-
const result = await this.chatService.alertToSpecial(options);
|
|
104
|
-
this.displayGenericResult(result, options.output, 'Popup alert sent successfully');
|
|
105
|
-
}, 'chat.message.alert-special');
|
|
106
|
-
}
|
|
107
|
-
async auditMessage(options) {
|
|
108
|
-
return this.executeWithErrorHandling(async () => {
|
|
109
|
-
this.validateRequiredOptions(options, ['channelId', 'msgId', 'viewerId', 'nickName', 'content']);
|
|
110
|
-
if (!(await this.confirmIfNeeded(options.force, `Submit audited chat message ${options.msgId}?`)))
|
|
111
|
-
return;
|
|
112
|
-
const result = await this.chatService.messageAudit({
|
|
113
|
-
channelId: options.channelId,
|
|
114
|
-
messages: [{
|
|
115
|
-
msgId: options.msgId,
|
|
116
|
-
viewerId: options.viewerId,
|
|
117
|
-
nickName: options.nickName,
|
|
118
|
-
content: options.content,
|
|
119
|
-
avatar: options.avatar,
|
|
120
|
-
sessionId: options.sessionId,
|
|
121
|
-
viewerType: options.viewerType
|
|
122
|
-
}]
|
|
123
|
-
});
|
|
124
|
-
this.displayGenericResult(result, options.output, 'Audited message submitted successfully');
|
|
125
|
-
}, 'chat.message.audit');
|
|
126
|
-
}
|
|
127
|
-
async sendCustomMessage(options) {
|
|
128
|
-
return this.executeWithErrorHandling(async () => {
|
|
129
|
-
this.validateRequiredOptions(options, ['channelId']);
|
|
130
|
-
this.validateContentOrImage(options);
|
|
131
|
-
if (!(await this.confirmIfNeeded(options.force, `Send custom message to channel ${options.channelId}?`)))
|
|
132
|
-
return;
|
|
133
|
-
const result = await this.chatService.sendCustomMessage(options);
|
|
134
|
-
this.displayGenericResult(result ?? { success: true }, options.output, 'Custom message sent successfully');
|
|
135
|
-
}, 'chat.message.custom-send');
|
|
136
|
-
}
|
|
137
|
-
async sendCustomMessageEncode(options) {
|
|
138
|
-
return this.executeWithErrorHandling(async () => {
|
|
139
|
-
this.validateRequiredOptions(options, ['channelId']);
|
|
140
|
-
this.validateContentOrImage(options);
|
|
141
|
-
if (!(await this.confirmIfNeeded(options.force, `Send encoded custom message to channel ${options.channelId}?`)))
|
|
142
|
-
return;
|
|
143
|
-
const result = await this.chatService.sendCustomMessageEncode(options);
|
|
144
|
-
this.displayGenericResult(result ?? { success: true }, options.output, 'Encoded custom message sent successfully');
|
|
145
|
-
}, 'chat.message.custom-send-encode');
|
|
146
|
-
}
|
|
147
|
-
async emitByUserId(options) {
|
|
148
|
-
return this.executeWithErrorHandling(async () => {
|
|
149
|
-
this.validateRequiredOptions(options, ['roomId', 'payload']);
|
|
150
|
-
if (!options.userIds || options.userIds.length === 0) {
|
|
151
|
-
throw new errors_1.PolyVValidationError('userIds is required', 'userIds', options.userIds, 'validation_failed');
|
|
152
|
-
}
|
|
153
|
-
if (!(await this.confirmIfNeeded(options.force, `Broadcast message to ${options.userIds.length} users in room ${options.roomId}?`)))
|
|
154
|
-
return;
|
|
155
|
-
const result = await this.chatService.emitByUserId(options);
|
|
156
|
-
this.displayGenericResult(result ?? { success: true }, options.output, 'Broadcast message sent successfully');
|
|
157
|
-
}, 'chat.message.emit-by-user-id');
|
|
158
|
-
}
|
|
159
|
-
async listUserBadwords(options) {
|
|
160
|
-
return this.executeWithErrorHandling(async () => {
|
|
161
|
-
const result = await this.chatService.getUserBadwordList();
|
|
162
|
-
this.displayGenericResult(result, options.output);
|
|
163
|
-
}, 'chat.badword.list');
|
|
164
|
-
}
|
|
165
|
-
async addBadwords(options) {
|
|
166
|
-
return this.executeWithErrorHandling(async () => {
|
|
167
|
-
this.validateRequiredOptions(options, ['userId']);
|
|
168
|
-
if (!options.words || options.words.length === 0) {
|
|
169
|
-
throw new errors_1.PolyVValidationError('words is required', 'words', options.words, 'validation_failed');
|
|
170
|
-
}
|
|
171
|
-
if (!(await this.confirmIfNeeded(options.force, `Add ${options.words.length} badword(s)?`)))
|
|
172
|
-
return;
|
|
173
|
-
const result = await this.chatService.addBadwords(options);
|
|
174
|
-
this.displayGenericResult(result, options.output, 'Badwords added successfully');
|
|
175
|
-
}, 'chat.badword.add');
|
|
176
|
-
}
|
|
177
|
-
async deleteUserBadword(options) {
|
|
178
|
-
return this.executeWithErrorHandling(async () => {
|
|
179
|
-
this.validateRequiredOptions(options, ['words']);
|
|
180
|
-
if (!(await this.confirmIfNeeded(options.force, `Delete account badword(s): ${options.words}?`)))
|
|
181
|
-
return;
|
|
182
|
-
const result = await this.chatService.deleteUserBadword({ words: options.words });
|
|
183
|
-
this.displayGenericResult(result, options.output, 'Account badwords deleted successfully');
|
|
184
|
-
}, 'chat.badword.delete');
|
|
185
|
-
}
|
|
186
|
-
async addBannedIp(options) {
|
|
187
|
-
return this.executeWithErrorHandling(async () => {
|
|
188
|
-
this.validateRequiredOptions(options, ['channelId', 'ip']);
|
|
189
|
-
if (!(await this.confirmIfNeeded(options.force, `Ban IP ${options.ip} in channel ${options.channelId}?`)))
|
|
190
|
-
return;
|
|
191
|
-
const result = await this.chatService.addBannedIp({ channelId: options.channelId, ip: options.ip });
|
|
192
|
-
this.displayGenericResult(result, options.output, 'IP banned successfully');
|
|
193
|
-
}, 'chat.banned.ip-add');
|
|
194
|
-
}
|
|
195
|
-
async listUserBanned(options) {
|
|
196
|
-
return this.executeWithErrorHandling(async () => {
|
|
197
|
-
const result = await this.chatService.getUserBannedList(this.compactOptions({ page: options.page, size: options.size }));
|
|
198
|
-
this.displayGenericResult(result, options.output);
|
|
199
|
-
}, 'chat.banned.user-list');
|
|
200
|
-
}
|
|
201
|
-
async listForbidUsers(options) {
|
|
202
|
-
return this.executeWithErrorHandling(async () => {
|
|
203
|
-
const result = await this.chatService.getForbidUserList(options);
|
|
204
|
-
this.displayGenericResult(result, options.output);
|
|
205
|
-
}, 'chat.banned.forbid-list');
|
|
206
|
-
}
|
|
207
|
-
async deleteChannelBanned(options) {
|
|
208
|
-
return this.executeWithErrorHandling(async () => {
|
|
209
|
-
this.validateRequiredOptions(options, ['channelId', 'type', 'content']);
|
|
210
|
-
if (options.type !== 'ip' && options.type !== 'badword') {
|
|
211
|
-
throw new errors_1.PolyVValidationError('type must be ip or badword', 'type', options.type, 'validation_failed');
|
|
212
|
-
}
|
|
213
|
-
if (!(await this.confirmIfNeeded(options.force, `Delete ${options.type} from channel ${options.channelId}: ${options.content}?`)))
|
|
214
|
-
return;
|
|
215
|
-
const result = await this.chatService.deleteChannelBanned(options);
|
|
216
|
-
this.displayGenericResult(result, options.output, 'Channel banned item deleted successfully');
|
|
217
|
-
}, 'chat.banned.delete');
|
|
218
|
-
}
|
|
219
|
-
async listBulletins(options) {
|
|
220
|
-
return this.executeWithErrorHandling(async () => {
|
|
221
|
-
this.validateRequiredOptions(options, ['channelId']);
|
|
222
|
-
const result = await this.chatService.listBulletins(this.compactOptions({
|
|
223
|
-
channelId: options.channelId,
|
|
224
|
-
pageNumber: options.pageNumber || 1,
|
|
225
|
-
pageSize: options.pageSize || 20,
|
|
226
|
-
sort: options.sort
|
|
227
|
-
}));
|
|
228
|
-
this.displayGenericResult(result, options.output);
|
|
229
|
-
}, 'chat.notice.list');
|
|
230
|
-
}
|
|
231
|
-
async addBulletin(options) {
|
|
232
|
-
return this.executeWithErrorHandling(async () => {
|
|
233
|
-
this.validateRequiredOptions(options, ['channelId', 'content']);
|
|
234
|
-
this.validateYN('isTop', options.isTop);
|
|
235
|
-
this.validateYN('isPop', options.isPop);
|
|
236
|
-
if (!(await this.confirmIfNeeded(options.force, `Add notice to channel ${options.channelId}?`)))
|
|
237
|
-
return;
|
|
238
|
-
const result = await this.chatService.addBulletin(options);
|
|
239
|
-
this.displayGenericResult(result, options.output, 'Notice added successfully');
|
|
240
|
-
}, 'chat.notice.add');
|
|
241
|
-
}
|
|
242
|
-
async cleanNotices(options) {
|
|
243
|
-
return this.executeWithErrorHandling(async () => {
|
|
244
|
-
this.validateRequiredOptions(options, ['channelId']);
|
|
245
|
-
if (!(await this.confirmIfNeeded(options.force, `Clear all notices for channel ${options.channelId}?`)))
|
|
246
|
-
return;
|
|
247
|
-
const result = await this.chatService.cleanNotices({ channelId: options.channelId });
|
|
248
|
-
this.displayGenericResult(result ?? { success: true }, options.output, 'Notices cleared successfully');
|
|
249
|
-
}, 'chat.notice.clean');
|
|
250
|
-
}
|
|
251
|
-
async listQa(options) {
|
|
252
|
-
return this.executeWithErrorHandling(async () => {
|
|
253
|
-
this.validateRequiredOptions(options, ['channelId']);
|
|
254
|
-
const result = await this.chatService.listQa({
|
|
255
|
-
channelId: options.channelId,
|
|
256
|
-
pageNumber: options.pageNumber || 1,
|
|
257
|
-
pageSize: options.pageSize || 20
|
|
258
|
-
});
|
|
259
|
-
this.displayGenericResult(result, options.output);
|
|
260
|
-
}, 'chat.qa.list');
|
|
261
|
-
}
|
|
262
|
-
async updateCensorEnabled(options) {
|
|
263
|
-
return this.executeWithErrorHandling(async () => {
|
|
264
|
-
this.validateRequiredOptions(options, ['channelId']);
|
|
265
|
-
this.validateYN('enabled', options.enabled);
|
|
266
|
-
if (!(await this.confirmIfNeeded(options.force, `Update chat censor setting for channel ${options.channelId}?`)))
|
|
267
|
-
return;
|
|
268
|
-
const result = await this.chatService.updateCensorEnabled(this.compactOptions({
|
|
269
|
-
channelId: options.channelId,
|
|
270
|
-
enabled: options.enabled
|
|
271
|
-
}));
|
|
272
|
-
this.displayGenericResult(result, options.output, 'Chat censor setting updated successfully');
|
|
273
|
-
}, 'chat.censor.update');
|
|
274
|
-
}
|
|
275
|
-
async getAdminInfo(options) {
|
|
276
|
-
return this.executeWithErrorHandling(async () => {
|
|
277
|
-
this.validateRequiredOptions(options, ['channelId']);
|
|
278
|
-
const result = await this.chatService.getAdminInfo({ channelId: options.channelId });
|
|
279
|
-
this.displayGenericResult(result, options.output);
|
|
280
|
-
}, 'chat.role.admin-get');
|
|
281
|
-
}
|
|
282
|
-
async updateAdminInfo(options) {
|
|
283
|
-
return this.executeWithErrorHandling(async () => {
|
|
284
|
-
this.validateRequiredOptions(options, ['channelId', 'nickname', 'actor']);
|
|
285
|
-
if (!(await this.confirmIfNeeded(options.force, `Update admin info for channel ${options.channelId}?`)))
|
|
286
|
-
return;
|
|
287
|
-
const result = await this.chatService.updateAdminInfo(options);
|
|
288
|
-
this.displayGenericResult(result, options.output, 'Admin info updated successfully');
|
|
289
|
-
}, 'chat.role.admin-update');
|
|
290
|
-
}
|
|
291
|
-
async getTeacherInfo(options) {
|
|
292
|
-
return this.executeWithErrorHandling(async () => {
|
|
293
|
-
this.validateRequiredOptions(options, ['channelId']);
|
|
294
|
-
const result = await this.chatService.getTeacherInfo({ channelId: options.channelId });
|
|
295
|
-
this.displayGenericResult(result, options.output);
|
|
296
|
-
}, 'chat.role.teacher-get');
|
|
297
|
-
}
|
|
298
|
-
async updateTeacherInfo(options) {
|
|
299
|
-
return this.executeWithErrorHandling(async () => {
|
|
300
|
-
this.validateRequiredOptions(options, ['channelId']);
|
|
301
|
-
if (!(await this.confirmIfNeeded(options.force, `Update teacher info for channel ${options.channelId}?`)))
|
|
302
|
-
return;
|
|
303
|
-
const result = await this.chatService.updateTeacherInfo(options);
|
|
304
|
-
this.displayGenericResult(result, options.output, 'Teacher info updated successfully');
|
|
305
|
-
}, 'chat.role.teacher-update');
|
|
306
|
-
}
|
|
307
|
-
async getUserList(options) {
|
|
308
|
-
return this.executeWithErrorHandling(async () => {
|
|
309
|
-
this.validateRequiredOptions(options, ['roomId']);
|
|
310
|
-
const result = await this.chatService.getUserList(options);
|
|
311
|
-
this.displayGenericResult(result, options.output);
|
|
312
|
-
}, 'chat.role.user-list');
|
|
313
|
-
}
|
|
314
|
-
async getRobotSetting(options) {
|
|
315
|
-
return this.executeWithErrorHandling(async () => {
|
|
316
|
-
this.validateRequiredOptions(options, ['channelId']);
|
|
317
|
-
const result = await this.chatService.getRobotSetting({ channelId: options.channelId });
|
|
318
|
-
this.displayGenericResult(result, options.output);
|
|
319
|
-
}, 'chat.robot.setting-get');
|
|
320
|
-
}
|
|
321
|
-
async getRobotStats(options) {
|
|
322
|
-
return this.executeWithErrorHandling(async () => {
|
|
323
|
-
this.validateRequiredOptions(options, ['channelId']);
|
|
324
|
-
const result = await this.chatService.getRobotStats({ channelId: options.channelId });
|
|
325
|
-
this.displayGenericResult(result, options.output);
|
|
326
|
-
}, 'chat.robot.stats');
|
|
327
|
-
}
|
|
328
|
-
async updateRobotSetting(options) {
|
|
329
|
-
return this.executeWithErrorHandling(async () => {
|
|
330
|
-
this.validateRequiredOptions(options, ['channelId', 'robotNumber', 'addRobotModel']);
|
|
331
|
-
if (!(await this.confirmIfNeeded(options.force, `Update robot setting for channel ${options.channelId}?`)))
|
|
332
|
-
return;
|
|
333
|
-
const result = await this.chatService.updateRobotSetting(options);
|
|
334
|
-
this.displayGenericResult(result ?? { success: true }, options.output, 'Robot setting updated successfully');
|
|
335
|
-
}, 'chat.robot.setting-update');
|
|
336
|
-
}
|
|
337
|
-
async updateRobotListSetting(options) {
|
|
338
|
-
return this.executeWithErrorHandling(async () => {
|
|
339
|
-
this.validateRequiredOptions(options, ['channelId', 'robotNumber', 'addRobotModel']);
|
|
340
|
-
this.validateYN('robotRandomMemberEnabled', options.robotRandomMemberEnabled);
|
|
341
|
-
if (!(await this.confirmIfNeeded(options.force, `Update robot list setting for channel ${options.channelId}?`)))
|
|
342
|
-
return;
|
|
343
|
-
const result = await this.chatService.updateRobotListSetting(options);
|
|
344
|
-
this.displayGenericResult(result ?? { success: true }, options.output, 'Robot list setting updated successfully');
|
|
345
|
-
}, 'chat.robot.list-update');
|
|
346
|
-
}
|
|
347
|
-
async pauseRobot(options) {
|
|
348
|
-
return this.executeWithErrorHandling(async () => {
|
|
349
|
-
this.validateRequiredOptions(options, ['channelId']);
|
|
350
|
-
if (!(await this.confirmIfNeeded(options.force, `Pause robot growth for channel ${options.channelId}?`)))
|
|
351
|
-
return;
|
|
352
|
-
const result = await this.chatService.pauseRobot({ channelId: options.channelId });
|
|
353
|
-
this.displayGenericResult(result ?? { success: true }, options.output, 'Robot paused successfully');
|
|
354
|
-
}, 'chat.robot.pause');
|
|
355
|
-
}
|
|
356
|
-
async batchUpdateChatEnabled(options) {
|
|
357
|
-
return this.executeWithErrorHandling(async () => {
|
|
358
|
-
if (!options.channelIds || options.channelIds.length === 0) {
|
|
359
|
-
throw new errors_1.PolyVValidationError('channelIds is required', 'channelIds', options.channelIds, 'validation_failed');
|
|
360
|
-
}
|
|
361
|
-
this.validateYN('chatEnabled', options.chatEnabled);
|
|
362
|
-
if (!(await this.confirmIfNeeded(options.force, `Update chat switch for channel(s) ${options.channelIds.join(',')}?`)))
|
|
363
|
-
return;
|
|
364
|
-
const result = await this.chatService.batchUpdateChatEnabled({
|
|
365
|
-
channelIds: options.channelIds,
|
|
366
|
-
chatEnabled: options.chatEnabled,
|
|
367
|
-
});
|
|
368
|
-
this.displayGenericResult(result ?? { success: true }, options.output, 'Chat switch updated successfully');
|
|
369
|
-
}, 'chat.enabled.update');
|
|
370
|
-
}
|
|
371
|
-
async logoutWatchViewer(options) {
|
|
372
|
-
return this.executeWithErrorHandling(async () => {
|
|
373
|
-
this.validateRequiredOptions(options, ['channelId']);
|
|
374
|
-
if (!(await this.confirmIfNeeded(options.force, `Log out viewer from watch page for channel ${options.channelId}?`)))
|
|
375
|
-
return;
|
|
376
|
-
const result = await this.chatService.logoutWatchViewer({
|
|
377
|
-
channelId: options.channelId,
|
|
378
|
-
...(options.token ? { token: options.token } : {}),
|
|
379
|
-
});
|
|
380
|
-
this.displayGenericResult(result ?? { success: true }, options.output, 'Watch viewer logged out successfully');
|
|
381
|
-
}, 'chat.viewer.logout');
|
|
382
|
-
}
|
|
383
|
-
validateRequiredOptions(options, fields) {
|
|
384
|
-
const missing = fields.filter((field) => {
|
|
385
|
-
const value = options[field];
|
|
386
|
-
return value === undefined || value === null || (typeof value === 'string' && value.trim() === '');
|
|
387
|
-
});
|
|
388
|
-
if (missing.length > 0) {
|
|
389
|
-
throw new errors_1.PolyVValidationError(`Missing required options: ${missing.join(', ')}`, 'options', options, 'validation_failed');
|
|
390
|
-
}
|
|
391
|
-
if (options.output && !['table', 'json'].includes(options.output)) {
|
|
392
|
-
throw new errors_1.PolyVValidationError('output must be either "table" or "json"', 'output', options.output, 'validation_failed');
|
|
393
|
-
}
|
|
394
|
-
}
|
|
395
|
-
compactOptions(options) {
|
|
396
|
-
return Object.fromEntries(Object.entries(options).filter(([, value]) => value !== undefined));
|
|
397
|
-
}
|
|
398
|
-
validateContentOrImage(options) {
|
|
399
|
-
if (!options.content && !options.imgUrl) {
|
|
400
|
-
throw new errors_1.PolyVValidationError('content or imgUrl is required', 'content', options, 'validation_failed');
|
|
401
|
-
}
|
|
402
|
-
}
|
|
403
|
-
validateYN(field, value) {
|
|
404
|
-
if (value !== undefined && value !== 'Y' && value !== 'N') {
|
|
405
|
-
throw new errors_1.PolyVValidationError(`${field} must be Y or N`, field, value, 'validation_failed');
|
|
406
|
-
}
|
|
407
|
-
}
|
|
408
|
-
async confirmIfNeeded(force, message) {
|
|
409
|
-
if (force) {
|
|
410
|
-
return true;
|
|
411
|
-
}
|
|
412
|
-
const confirmed = await (0, confirmation_1.confirmDeletion)(message, 'yes');
|
|
413
|
-
if (!confirmed) {
|
|
414
|
-
this.displayInfo('Operation cancelled');
|
|
415
|
-
}
|
|
416
|
-
return confirmed;
|
|
417
|
-
}
|
|
418
|
-
displayGenericResult(result, format, successMessage) {
|
|
419
|
-
if (successMessage && format !== 'json') {
|
|
420
|
-
this.displaySuccess(successMessage);
|
|
421
|
-
}
|
|
422
|
-
if (result !== undefined) {
|
|
423
|
-
this.displayData(result, format || 'table');
|
|
424
|
-
}
|
|
425
|
-
else if (format === 'json') {
|
|
426
|
-
this.displayData({ success: true }, 'json');
|
|
427
|
-
}
|
|
428
|
-
}
|
|
429
50
|
displaySendResult(result, format) {
|
|
430
51
|
const data = {
|
|
431
52
|
success: result.success,
|