@dsh-plugin/dsh-synapse 0.1.0-dev.41044228975 → 0.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE +661 -661
- package/README.md +0 -14
- package/package.json +1 -1
- package/vendor/gugle-chat-bot/LICENSE +661 -661
- package/vendor/gugle-chat-bot/package.json +57 -57
- package/vendor/gugle-chat-bot/src/allow-rule.yml +9345 -9345
- package/vendor/gugle-chat-bot/src/api.json +4284 -4284
- package/vendor/gugle-chat-bot/src/command/index.ts +141 -141
- package/vendor/gugle-chat-bot/src/config/features.ts +547 -547
- package/vendor/gugle-chat-bot/src/config/index.ts +184 -184
- package/vendor/gugle-chat-bot/src/config/manager.ts +356 -356
- package/vendor/gugle-chat-bot/src/constants/index.ts +13 -13
- package/vendor/gugle-chat-bot/src/custom.ts +548 -548
- package/vendor/gugle-chat-bot/src/event/index.ts +118 -118
- package/vendor/gugle-chat-bot/src/features/admin/index.ts +414 -414
- package/vendor/gugle-chat-bot/src/features/bili/image/impl/video.ts +39 -39
- package/vendor/gugle-chat-bot/src/features/bili/image/index.ts +37 -37
- package/vendor/gugle-chat-bot/src/features/bili/index.ts +65 -65
- package/vendor/gugle-chat-bot/src/features/bili/template/style/video.css +97 -97
- package/vendor/gugle-chat-bot/src/features/bili/template/video.html +56 -56
- package/vendor/gugle-chat-bot/src/features/discord-bridge/index.ts +1128 -1128
- package/vendor/gugle-chat-bot/src/features/discord-bridge/markdown.ts +105 -105
- package/vendor/gugle-chat-bot/src/features/discord-bridge/slash.ts +355 -355
- package/vendor/gugle-chat-bot/src/features/discord-bridge/source.ts +96 -96
- package/vendor/gugle-chat-bot/src/features/discord-bridge/template/message.html +14 -14
- package/vendor/gugle-chat-bot/src/features/discord-bridge/template/style/message.css +144 -144
- package/vendor/gugle-chat-bot/src/features/github/api.ts +93 -93
- package/vendor/gugle-chat-bot/src/features/github/binding.ts +161 -161
- package/vendor/gugle-chat-bot/src/features/github/image/impl/issue.ts +132 -132
- package/vendor/gugle-chat-bot/src/features/github/image/impl/pr.ts +144 -144
- package/vendor/gugle-chat-bot/src/features/github/image/impl/release.ts +160 -160
- package/vendor/gugle-chat-bot/src/features/github/image/index.ts +310 -310
- package/vendor/gugle-chat-bot/src/features/github/index.ts +302 -302
- package/vendor/gugle-chat-bot/src/features/github/template/issue.html +118 -118
- package/vendor/gugle-chat-bot/src/features/github/template/pull_request.html +125 -125
- package/vendor/gugle-chat-bot/src/features/github/template/release.html +53 -53
- package/vendor/gugle-chat-bot/src/features/github/template/style/issue.css +468 -468
- package/vendor/gugle-chat-bot/src/features/github/template/style/pull_request.css +468 -468
- package/vendor/gugle-chat-bot/src/features/github/template/style/release.css +412 -412
- package/vendor/gugle-chat-bot/src/features/hermes/client.ts +184 -184
- package/vendor/gugle-chat-bot/src/features/hermes/config.ts +210 -210
- package/vendor/gugle-chat-bot/src/features/hermes/context.ts +67 -67
- package/vendor/gugle-chat-bot/src/features/hermes/history.ts +86 -86
- package/vendor/gugle-chat-bot/src/features/hermes/index.ts +1533 -1533
- package/vendor/gugle-chat-bot/src/features/hermes/message.ts +319 -319
- package/vendor/gugle-chat-bot/src/features/hermes/reaction.ts +181 -181
- package/vendor/gugle-chat-bot/src/features/hermes/render.ts +118 -118
- package/vendor/gugle-chat-bot/src/features/hermes/reply-units.ts +331 -331
- package/vendor/gugle-chat-bot/src/features/hermes/skills.ts +406 -406
- package/vendor/gugle-chat-bot/src/features/hermes/template/approval.html +30 -30
- package/vendor/gugle-chat-bot/src/features/hermes/template/progress.html +21 -21
- package/vendor/gugle-chat-bot/src/features/hermes/template/style/approval.css +81 -81
- package/vendor/gugle-chat-bot/src/features/hermes/template/style/progress.css +120 -120
- package/vendor/gugle-chat-bot/src/features/hermes/trigger.ts +86 -86
- package/vendor/gugle-chat-bot/src/features/hermes/types.ts +327 -327
- package/vendor/gugle-chat-bot/src/features/management/index.ts +156 -156
- package/vendor/gugle-chat-bot/src/features/minecraft/index.ts +127 -127
- package/vendor/gugle-chat-bot/src/features/modrinth/index.ts +71 -71
- package/vendor/gugle-chat-bot/src/features/parentheses/index.ts +117 -117
- package/vendor/gugle-chat-bot/src/features/peak-valley-timer/index.ts +451 -451
- package/vendor/gugle-chat-bot/src/features/poke/index.ts +24 -24
- package/vendor/gugle-chat-bot/src/features/version-tracker/index.ts +77 -77
- package/vendor/gugle-chat-bot/src/features/welcome/index.ts +57 -57
- package/vendor/gugle-chat-bot/src/github-ip.json +5814 -5814
- package/vendor/gugle-chat-bot/src/image/index.ts +278 -278
- package/vendor/gugle-chat-bot/src/index.ts +695 -695
- package/vendor/gugle-chat-bot/src/logger/index.ts +54 -54
- package/vendor/gugle-chat-bot/src/result.json +359 -359
- package/vendor/gugle-chat-bot/src/type/bili.d.ts +825 -825
- package/vendor/gugle-chat-bot/src/type/event.d.ts +146 -146
- package/vendor/gugle-chat-bot/src/type/github.d.ts +446 -446
- package/vendor/gugle-chat-bot/src/type/index.d.ts +254 -254
- package/vendor/gugle-chat-bot/tsconfig.json +46 -46
- package/scripts/dump-npm-latest.mjs +0 -30
|
@@ -1,254 +1,254 @@
|
|
|
1
|
-
export interface Sender {
|
|
2
|
-
user_id: number;
|
|
3
|
-
nickname: string;
|
|
4
|
-
card: string;
|
|
5
|
-
}
|
|
6
|
-
|
|
7
|
-
export type GroupSender = Sender & {
|
|
8
|
-
role: 'member' | 'owner' | 'admin';
|
|
9
|
-
};
|
|
10
|
-
|
|
11
|
-
export interface TextMessage {
|
|
12
|
-
type: 'text';
|
|
13
|
-
data: {
|
|
14
|
-
text: string;
|
|
15
|
-
};
|
|
16
|
-
}
|
|
17
|
-
|
|
18
|
-
export interface AtMessage {
|
|
19
|
-
type: 'at';
|
|
20
|
-
data: {
|
|
21
|
-
qq: number;
|
|
22
|
-
};
|
|
23
|
-
}
|
|
24
|
-
|
|
25
|
-
export interface ImageMessage {
|
|
26
|
-
type: 'image';
|
|
27
|
-
data: {
|
|
28
|
-
file: string;
|
|
29
|
-
/** NapCat/OneBot 下发的可访问直链(接收消息时存在,转发用) */
|
|
30
|
-
url?: string;
|
|
31
|
-
};
|
|
32
|
-
}
|
|
33
|
-
|
|
34
|
-
export interface FaceMessage {
|
|
35
|
-
type: 'face';
|
|
36
|
-
data: {
|
|
37
|
-
id: number;
|
|
38
|
-
};
|
|
39
|
-
}
|
|
40
|
-
|
|
41
|
-
export interface JsonMessage {
|
|
42
|
-
type: 'json';
|
|
43
|
-
data: {
|
|
44
|
-
data: string;
|
|
45
|
-
};
|
|
46
|
-
}
|
|
47
|
-
|
|
48
|
-
export interface RecordMessage {
|
|
49
|
-
type: 'record';
|
|
50
|
-
data: {
|
|
51
|
-
file: string;
|
|
52
|
-
/** NapCat/OneBot 下发的可访问直链(接收消息时存在,转发用) */
|
|
53
|
-
url?: string;
|
|
54
|
-
};
|
|
55
|
-
}
|
|
56
|
-
|
|
57
|
-
export interface VideoMessage {
|
|
58
|
-
type: 'video';
|
|
59
|
-
data: {
|
|
60
|
-
file: string;
|
|
61
|
-
/** NapCat/OneBot 下发的可访问直链(接收消息时存在,转发用) */
|
|
62
|
-
url?: string;
|
|
63
|
-
};
|
|
64
|
-
}
|
|
65
|
-
|
|
66
|
-
export interface ReplyMessage {
|
|
67
|
-
type: 'reply';
|
|
68
|
-
data: {
|
|
69
|
-
id: number;
|
|
70
|
-
};
|
|
71
|
-
}
|
|
72
|
-
|
|
73
|
-
export interface EnumMusicMessageData {
|
|
74
|
-
type: '163' | 'qq';
|
|
75
|
-
id: string;
|
|
76
|
-
}
|
|
77
|
-
|
|
78
|
-
export interface CustomMusicMessageData {
|
|
79
|
-
type: 'custom';
|
|
80
|
-
url: string;
|
|
81
|
-
audio: string;
|
|
82
|
-
title: string;
|
|
83
|
-
image: string;
|
|
84
|
-
}
|
|
85
|
-
|
|
86
|
-
export type MusicMessageData = EnumMusicMessageData | CustomMusicMessageData;
|
|
87
|
-
|
|
88
|
-
export interface MusicMessage {
|
|
89
|
-
type: 'music';
|
|
90
|
-
data: MusicMessageData;
|
|
91
|
-
}
|
|
92
|
-
|
|
93
|
-
export interface DiceMessage {
|
|
94
|
-
type: 'dice';
|
|
95
|
-
}
|
|
96
|
-
|
|
97
|
-
export interface RpsMessage {
|
|
98
|
-
type: 'rps';
|
|
99
|
-
}
|
|
100
|
-
|
|
101
|
-
export interface FileMessage {
|
|
102
|
-
type: 'file';
|
|
103
|
-
data: {
|
|
104
|
-
file: string;
|
|
105
|
-
/** NapCat/OneBot 下发的可访问直链(接收消息时存在,转发用) */
|
|
106
|
-
url?: string;
|
|
107
|
-
};
|
|
108
|
-
}
|
|
109
|
-
|
|
110
|
-
export type Message =
|
|
111
|
-
| TextMessage
|
|
112
|
-
| AtMessage
|
|
113
|
-
| FaceMessage
|
|
114
|
-
| JsonMessage
|
|
115
|
-
| RecordMessage
|
|
116
|
-
| VideoMessage
|
|
117
|
-
| ImageMessage
|
|
118
|
-
| ReplyMessage
|
|
119
|
-
| MusicMessage
|
|
120
|
-
| DiceMessage
|
|
121
|
-
| RpsMessage
|
|
122
|
-
| FileMessage;
|
|
123
|
-
|
|
124
|
-
export interface NodeMessage {
|
|
125
|
-
type: 'node';
|
|
126
|
-
data: {
|
|
127
|
-
user_id: number;
|
|
128
|
-
nickname: string;
|
|
129
|
-
content: Message[];
|
|
130
|
-
};
|
|
131
|
-
}
|
|
132
|
-
|
|
133
|
-
export interface ForwardMessage {
|
|
134
|
-
type: 'forward';
|
|
135
|
-
data: {
|
|
136
|
-
id: string;
|
|
137
|
-
};
|
|
138
|
-
}
|
|
139
|
-
|
|
140
|
-
export type SentMessage = Message[] | NodeMessage[];
|
|
141
|
-
|
|
142
|
-
export type ReceiveMessage = Message[] | ForwardMessage[];
|
|
143
|
-
|
|
144
|
-
export interface MetaEventWSMSG {
|
|
145
|
-
post_type: 'meta_event';
|
|
146
|
-
time: number;
|
|
147
|
-
self_id: number;
|
|
148
|
-
}
|
|
149
|
-
|
|
150
|
-
export type HeartbeatMetaEventWSMSG = MetaEventWSMSG & {
|
|
151
|
-
meta_event_type: 'heartbeat';
|
|
152
|
-
status: { online: boolean; good: boolean };
|
|
153
|
-
interval: number;
|
|
154
|
-
};
|
|
155
|
-
|
|
156
|
-
export type LifecycleMetaEventWSMSG = MetaEventWSMSG & {
|
|
157
|
-
meta_event_type: 'lifecycle';
|
|
158
|
-
sub_type: 'connect';
|
|
159
|
-
};
|
|
160
|
-
|
|
161
|
-
export type AllMetaEventWSMSG = LifecycleMetaEventWSMSG | HeartbeatMetaEventWSMSG;
|
|
162
|
-
|
|
163
|
-
export interface MessageWSMSG {
|
|
164
|
-
post_type: 'message';
|
|
165
|
-
self_id: number;
|
|
166
|
-
user_id: number;
|
|
167
|
-
time: number;
|
|
168
|
-
message_id: number;
|
|
169
|
-
message_seq: number;
|
|
170
|
-
real_id: number;
|
|
171
|
-
real_seq: string;
|
|
172
|
-
raw_message: string;
|
|
173
|
-
font: number;
|
|
174
|
-
sub_type: 'friend' | 'normal';
|
|
175
|
-
message: ReceiveMessage;
|
|
176
|
-
}
|
|
177
|
-
|
|
178
|
-
export type GroupMessageWSMSG = MessageWSMSG & {
|
|
179
|
-
message_type: 'group';
|
|
180
|
-
sender: GroupSender;
|
|
181
|
-
group_id: number;
|
|
182
|
-
group_name: string;
|
|
183
|
-
};
|
|
184
|
-
|
|
185
|
-
export type PrivateMessageWSMSG = MessageWSMSG & {
|
|
186
|
-
message_type: 'private';
|
|
187
|
-
sender: Sender;
|
|
188
|
-
target_id: number;
|
|
189
|
-
};
|
|
190
|
-
|
|
191
|
-
export type AllMessageWSMSG = GroupMessageWSMSG | PrivateMessageWSMSG;
|
|
192
|
-
|
|
193
|
-
export type NoticeWSMSG = {
|
|
194
|
-
post_type: 'notice';
|
|
195
|
-
};
|
|
196
|
-
|
|
197
|
-
export type NotifyNoticeWSMSG = NoticeWSMSG & {
|
|
198
|
-
notice_type: 'notify';
|
|
199
|
-
sub_type: 'poke' | string;
|
|
200
|
-
group_id?: number;
|
|
201
|
-
target_id: number;
|
|
202
|
-
self_id: number;
|
|
203
|
-
user_id: number;
|
|
204
|
-
};
|
|
205
|
-
|
|
206
|
-
export type GroupDecreaseNoticeWSMSG = NoticeWSMSG & {
|
|
207
|
-
notice_type: 'group_decrease';
|
|
208
|
-
self_id: number;
|
|
209
|
-
group_id: number;
|
|
210
|
-
user_id: number;
|
|
211
|
-
sub_type: 'kick' | 'leave';
|
|
212
|
-
operator_id: number;
|
|
213
|
-
};
|
|
214
|
-
|
|
215
|
-
export type GroupIncreaseNoticeWSMSG = NoticeWSMSG & {
|
|
216
|
-
notice_type: 'group_increase';
|
|
217
|
-
self_id: number;
|
|
218
|
-
group_id: number;
|
|
219
|
-
user_id: number;
|
|
220
|
-
sub_type: 'invite' | 'approve';
|
|
221
|
-
operator_id: number;
|
|
222
|
-
};
|
|
223
|
-
|
|
224
|
-
export type AllNoticeWSMSG = NotifyNoticeWSMSG | GroupDecreaseNoticeWSMSG | GroupIncreaseNoticeWSMSG;
|
|
225
|
-
|
|
226
|
-
export type RequestWSMSG = {
|
|
227
|
-
post_type: 'request';
|
|
228
|
-
};
|
|
229
|
-
|
|
230
|
-
export type GroupRequestWSMSG = RequestWSMSG & {
|
|
231
|
-
request_type: 'group';
|
|
232
|
-
self_id: number;
|
|
233
|
-
group_id: number;
|
|
234
|
-
user_id: number;
|
|
235
|
-
comment: string;
|
|
236
|
-
flag: string;
|
|
237
|
-
sub_type: 'add';
|
|
238
|
-
};
|
|
239
|
-
|
|
240
|
-
export type AllRequestWSMSG = GroupRequestWSMSG;
|
|
241
|
-
|
|
242
|
-
export type WSMSG = AllMetaEventWSMSG | AllMessageWSMSG | AllNoticeWSMSG | AllRequestWSMSG;
|
|
243
|
-
|
|
244
|
-
export interface LoginInfoData {
|
|
245
|
-
user_id: number;
|
|
246
|
-
nickname: string;
|
|
247
|
-
}
|
|
248
|
-
|
|
249
|
-
export interface LoginInfo {
|
|
250
|
-
retcode: number;
|
|
251
|
-
data: LoginInfoData;
|
|
252
|
-
message: string;
|
|
253
|
-
wording: string;
|
|
254
|
-
}
|
|
1
|
+
export interface Sender {
|
|
2
|
+
user_id: number;
|
|
3
|
+
nickname: string;
|
|
4
|
+
card: string;
|
|
5
|
+
}
|
|
6
|
+
|
|
7
|
+
export type GroupSender = Sender & {
|
|
8
|
+
role: 'member' | 'owner' | 'admin';
|
|
9
|
+
};
|
|
10
|
+
|
|
11
|
+
export interface TextMessage {
|
|
12
|
+
type: 'text';
|
|
13
|
+
data: {
|
|
14
|
+
text: string;
|
|
15
|
+
};
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
export interface AtMessage {
|
|
19
|
+
type: 'at';
|
|
20
|
+
data: {
|
|
21
|
+
qq: number;
|
|
22
|
+
};
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
export interface ImageMessage {
|
|
26
|
+
type: 'image';
|
|
27
|
+
data: {
|
|
28
|
+
file: string;
|
|
29
|
+
/** NapCat/OneBot 下发的可访问直链(接收消息时存在,转发用) */
|
|
30
|
+
url?: string;
|
|
31
|
+
};
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
export interface FaceMessage {
|
|
35
|
+
type: 'face';
|
|
36
|
+
data: {
|
|
37
|
+
id: number;
|
|
38
|
+
};
|
|
39
|
+
}
|
|
40
|
+
|
|
41
|
+
export interface JsonMessage {
|
|
42
|
+
type: 'json';
|
|
43
|
+
data: {
|
|
44
|
+
data: string;
|
|
45
|
+
};
|
|
46
|
+
}
|
|
47
|
+
|
|
48
|
+
export interface RecordMessage {
|
|
49
|
+
type: 'record';
|
|
50
|
+
data: {
|
|
51
|
+
file: string;
|
|
52
|
+
/** NapCat/OneBot 下发的可访问直链(接收消息时存在,转发用) */
|
|
53
|
+
url?: string;
|
|
54
|
+
};
|
|
55
|
+
}
|
|
56
|
+
|
|
57
|
+
export interface VideoMessage {
|
|
58
|
+
type: 'video';
|
|
59
|
+
data: {
|
|
60
|
+
file: string;
|
|
61
|
+
/** NapCat/OneBot 下发的可访问直链(接收消息时存在,转发用) */
|
|
62
|
+
url?: string;
|
|
63
|
+
};
|
|
64
|
+
}
|
|
65
|
+
|
|
66
|
+
export interface ReplyMessage {
|
|
67
|
+
type: 'reply';
|
|
68
|
+
data: {
|
|
69
|
+
id: number;
|
|
70
|
+
};
|
|
71
|
+
}
|
|
72
|
+
|
|
73
|
+
export interface EnumMusicMessageData {
|
|
74
|
+
type: '163' | 'qq';
|
|
75
|
+
id: string;
|
|
76
|
+
}
|
|
77
|
+
|
|
78
|
+
export interface CustomMusicMessageData {
|
|
79
|
+
type: 'custom';
|
|
80
|
+
url: string;
|
|
81
|
+
audio: string;
|
|
82
|
+
title: string;
|
|
83
|
+
image: string;
|
|
84
|
+
}
|
|
85
|
+
|
|
86
|
+
export type MusicMessageData = EnumMusicMessageData | CustomMusicMessageData;
|
|
87
|
+
|
|
88
|
+
export interface MusicMessage {
|
|
89
|
+
type: 'music';
|
|
90
|
+
data: MusicMessageData;
|
|
91
|
+
}
|
|
92
|
+
|
|
93
|
+
export interface DiceMessage {
|
|
94
|
+
type: 'dice';
|
|
95
|
+
}
|
|
96
|
+
|
|
97
|
+
export interface RpsMessage {
|
|
98
|
+
type: 'rps';
|
|
99
|
+
}
|
|
100
|
+
|
|
101
|
+
export interface FileMessage {
|
|
102
|
+
type: 'file';
|
|
103
|
+
data: {
|
|
104
|
+
file: string;
|
|
105
|
+
/** NapCat/OneBot 下发的可访问直链(接收消息时存在,转发用) */
|
|
106
|
+
url?: string;
|
|
107
|
+
};
|
|
108
|
+
}
|
|
109
|
+
|
|
110
|
+
export type Message =
|
|
111
|
+
| TextMessage
|
|
112
|
+
| AtMessage
|
|
113
|
+
| FaceMessage
|
|
114
|
+
| JsonMessage
|
|
115
|
+
| RecordMessage
|
|
116
|
+
| VideoMessage
|
|
117
|
+
| ImageMessage
|
|
118
|
+
| ReplyMessage
|
|
119
|
+
| MusicMessage
|
|
120
|
+
| DiceMessage
|
|
121
|
+
| RpsMessage
|
|
122
|
+
| FileMessage;
|
|
123
|
+
|
|
124
|
+
export interface NodeMessage {
|
|
125
|
+
type: 'node';
|
|
126
|
+
data: {
|
|
127
|
+
user_id: number;
|
|
128
|
+
nickname: string;
|
|
129
|
+
content: Message[];
|
|
130
|
+
};
|
|
131
|
+
}
|
|
132
|
+
|
|
133
|
+
export interface ForwardMessage {
|
|
134
|
+
type: 'forward';
|
|
135
|
+
data: {
|
|
136
|
+
id: string;
|
|
137
|
+
};
|
|
138
|
+
}
|
|
139
|
+
|
|
140
|
+
export type SentMessage = Message[] | NodeMessage[];
|
|
141
|
+
|
|
142
|
+
export type ReceiveMessage = Message[] | ForwardMessage[];
|
|
143
|
+
|
|
144
|
+
export interface MetaEventWSMSG {
|
|
145
|
+
post_type: 'meta_event';
|
|
146
|
+
time: number;
|
|
147
|
+
self_id: number;
|
|
148
|
+
}
|
|
149
|
+
|
|
150
|
+
export type HeartbeatMetaEventWSMSG = MetaEventWSMSG & {
|
|
151
|
+
meta_event_type: 'heartbeat';
|
|
152
|
+
status: { online: boolean; good: boolean };
|
|
153
|
+
interval: number;
|
|
154
|
+
};
|
|
155
|
+
|
|
156
|
+
export type LifecycleMetaEventWSMSG = MetaEventWSMSG & {
|
|
157
|
+
meta_event_type: 'lifecycle';
|
|
158
|
+
sub_type: 'connect';
|
|
159
|
+
};
|
|
160
|
+
|
|
161
|
+
export type AllMetaEventWSMSG = LifecycleMetaEventWSMSG | HeartbeatMetaEventWSMSG;
|
|
162
|
+
|
|
163
|
+
export interface MessageWSMSG {
|
|
164
|
+
post_type: 'message';
|
|
165
|
+
self_id: number;
|
|
166
|
+
user_id: number;
|
|
167
|
+
time: number;
|
|
168
|
+
message_id: number;
|
|
169
|
+
message_seq: number;
|
|
170
|
+
real_id: number;
|
|
171
|
+
real_seq: string;
|
|
172
|
+
raw_message: string;
|
|
173
|
+
font: number;
|
|
174
|
+
sub_type: 'friend' | 'normal';
|
|
175
|
+
message: ReceiveMessage;
|
|
176
|
+
}
|
|
177
|
+
|
|
178
|
+
export type GroupMessageWSMSG = MessageWSMSG & {
|
|
179
|
+
message_type: 'group';
|
|
180
|
+
sender: GroupSender;
|
|
181
|
+
group_id: number;
|
|
182
|
+
group_name: string;
|
|
183
|
+
};
|
|
184
|
+
|
|
185
|
+
export type PrivateMessageWSMSG = MessageWSMSG & {
|
|
186
|
+
message_type: 'private';
|
|
187
|
+
sender: Sender;
|
|
188
|
+
target_id: number;
|
|
189
|
+
};
|
|
190
|
+
|
|
191
|
+
export type AllMessageWSMSG = GroupMessageWSMSG | PrivateMessageWSMSG;
|
|
192
|
+
|
|
193
|
+
export type NoticeWSMSG = {
|
|
194
|
+
post_type: 'notice';
|
|
195
|
+
};
|
|
196
|
+
|
|
197
|
+
export type NotifyNoticeWSMSG = NoticeWSMSG & {
|
|
198
|
+
notice_type: 'notify';
|
|
199
|
+
sub_type: 'poke' | string;
|
|
200
|
+
group_id?: number;
|
|
201
|
+
target_id: number;
|
|
202
|
+
self_id: number;
|
|
203
|
+
user_id: number;
|
|
204
|
+
};
|
|
205
|
+
|
|
206
|
+
export type GroupDecreaseNoticeWSMSG = NoticeWSMSG & {
|
|
207
|
+
notice_type: 'group_decrease';
|
|
208
|
+
self_id: number;
|
|
209
|
+
group_id: number;
|
|
210
|
+
user_id: number;
|
|
211
|
+
sub_type: 'kick' | 'leave';
|
|
212
|
+
operator_id: number;
|
|
213
|
+
};
|
|
214
|
+
|
|
215
|
+
export type GroupIncreaseNoticeWSMSG = NoticeWSMSG & {
|
|
216
|
+
notice_type: 'group_increase';
|
|
217
|
+
self_id: number;
|
|
218
|
+
group_id: number;
|
|
219
|
+
user_id: number;
|
|
220
|
+
sub_type: 'invite' | 'approve';
|
|
221
|
+
operator_id: number;
|
|
222
|
+
};
|
|
223
|
+
|
|
224
|
+
export type AllNoticeWSMSG = NotifyNoticeWSMSG | GroupDecreaseNoticeWSMSG | GroupIncreaseNoticeWSMSG;
|
|
225
|
+
|
|
226
|
+
export type RequestWSMSG = {
|
|
227
|
+
post_type: 'request';
|
|
228
|
+
};
|
|
229
|
+
|
|
230
|
+
export type GroupRequestWSMSG = RequestWSMSG & {
|
|
231
|
+
request_type: 'group';
|
|
232
|
+
self_id: number;
|
|
233
|
+
group_id: number;
|
|
234
|
+
user_id: number;
|
|
235
|
+
comment: string;
|
|
236
|
+
flag: string;
|
|
237
|
+
sub_type: 'add';
|
|
238
|
+
};
|
|
239
|
+
|
|
240
|
+
export type AllRequestWSMSG = GroupRequestWSMSG;
|
|
241
|
+
|
|
242
|
+
export type WSMSG = AllMetaEventWSMSG | AllMessageWSMSG | AllNoticeWSMSG | AllRequestWSMSG;
|
|
243
|
+
|
|
244
|
+
export interface LoginInfoData {
|
|
245
|
+
user_id: number;
|
|
246
|
+
nickname: string;
|
|
247
|
+
}
|
|
248
|
+
|
|
249
|
+
export interface LoginInfo {
|
|
250
|
+
retcode: number;
|
|
251
|
+
data: LoginInfoData;
|
|
252
|
+
message: string;
|
|
253
|
+
wording: string;
|
|
254
|
+
}
|
|
@@ -1,46 +1,46 @@
|
|
|
1
|
-
{
|
|
2
|
-
// Visit https://aka.ms/tsconfig to read more about this file
|
|
3
|
-
"compilerOptions": {
|
|
4
|
-
// File Layout
|
|
5
|
-
"rootDir": "./src",
|
|
6
|
-
"outDir": "./dist",
|
|
7
|
-
"baseUrl": "./",
|
|
8
|
-
"paths": {
|
|
9
|
-
"@/*": ["src/*"]
|
|
10
|
-
},
|
|
11
|
-
// Environment Settings
|
|
12
|
-
// See also https://aka.ms/tsconfig/module
|
|
13
|
-
"module": "commonjs",
|
|
14
|
-
"target": "es2017",
|
|
15
|
-
// For nodejs:
|
|
16
|
-
// "lib": ["esnext"],
|
|
17
|
-
"types": ["node"],
|
|
18
|
-
// and npm install -D @types/node
|
|
19
|
-
|
|
20
|
-
// Other Outputs
|
|
21
|
-
"sourceMap": true,
|
|
22
|
-
"declaration": true,
|
|
23
|
-
"declarationMap": true,
|
|
24
|
-
// Stricter Typechecking Options
|
|
25
|
-
"noUncheckedIndexedAccess": true,
|
|
26
|
-
"exactOptionalPropertyTypes": true,
|
|
27
|
-
// Style Options
|
|
28
|
-
// "noImplicitReturns": true,
|
|
29
|
-
// "noImplicitOverride": true,
|
|
30
|
-
// "noUnusedLocals": true,
|
|
31
|
-
// "noUnusedParameters": true,
|
|
32
|
-
// "noFallthroughCasesInSwitch": true,
|
|
33
|
-
// "noPropertyAccessFromIndexSignature": true,
|
|
34
|
-
|
|
35
|
-
// Recommended Options
|
|
36
|
-
"strict": true,
|
|
37
|
-
"jsx": "react-jsx",
|
|
38
|
-
// "verbatimModuleSyntax": true,
|
|
39
|
-
"esModuleInterop": true,
|
|
40
|
-
"isolatedModules": true,
|
|
41
|
-
"noUncheckedSideEffectImports": true,
|
|
42
|
-
"moduleDetection": "force",
|
|
43
|
-
"skipLibCheck": true
|
|
44
|
-
},
|
|
45
|
-
"exclude": ["node_modules", "dist", "scripts"]
|
|
46
|
-
}
|
|
1
|
+
{
|
|
2
|
+
// Visit https://aka.ms/tsconfig to read more about this file
|
|
3
|
+
"compilerOptions": {
|
|
4
|
+
// File Layout
|
|
5
|
+
"rootDir": "./src",
|
|
6
|
+
"outDir": "./dist",
|
|
7
|
+
"baseUrl": "./",
|
|
8
|
+
"paths": {
|
|
9
|
+
"@/*": ["src/*"]
|
|
10
|
+
},
|
|
11
|
+
// Environment Settings
|
|
12
|
+
// See also https://aka.ms/tsconfig/module
|
|
13
|
+
"module": "commonjs",
|
|
14
|
+
"target": "es2017",
|
|
15
|
+
// For nodejs:
|
|
16
|
+
// "lib": ["esnext"],
|
|
17
|
+
"types": ["node"],
|
|
18
|
+
// and npm install -D @types/node
|
|
19
|
+
|
|
20
|
+
// Other Outputs
|
|
21
|
+
"sourceMap": true,
|
|
22
|
+
"declaration": true,
|
|
23
|
+
"declarationMap": true,
|
|
24
|
+
// Stricter Typechecking Options
|
|
25
|
+
"noUncheckedIndexedAccess": true,
|
|
26
|
+
"exactOptionalPropertyTypes": true,
|
|
27
|
+
// Style Options
|
|
28
|
+
// "noImplicitReturns": true,
|
|
29
|
+
// "noImplicitOverride": true,
|
|
30
|
+
// "noUnusedLocals": true,
|
|
31
|
+
// "noUnusedParameters": true,
|
|
32
|
+
// "noFallthroughCasesInSwitch": true,
|
|
33
|
+
// "noPropertyAccessFromIndexSignature": true,
|
|
34
|
+
|
|
35
|
+
// Recommended Options
|
|
36
|
+
"strict": true,
|
|
37
|
+
"jsx": "react-jsx",
|
|
38
|
+
// "verbatimModuleSyntax": true,
|
|
39
|
+
"esModuleInterop": true,
|
|
40
|
+
"isolatedModules": true,
|
|
41
|
+
"noUncheckedSideEffectImports": true,
|
|
42
|
+
"moduleDetection": "force",
|
|
43
|
+
"skipLibCheck": true
|
|
44
|
+
},
|
|
45
|
+
"exclude": ["node_modules", "dist", "scripts"]
|
|
46
|
+
}
|
|
@@ -1,30 +0,0 @@
|
|
|
1
|
-
import { readFileSync, writeFileSync } from 'node:fs';
|
|
2
|
-
|
|
3
|
-
// 与其他 DSH 插件保持一致:正式版发布后将 registry 的 latest 元数据回写仓库。
|
|
4
|
-
const registry = (process.env.NPM_REGISTRY ?? 'https://registry.npmjs.org').replace(/\/+$/, '');
|
|
5
|
-
const pkg = JSON.parse(readFileSync(new URL('../package.json', import.meta.url), 'utf8'));
|
|
6
|
-
const response = await fetch(`${registry}/${encodeURIComponent(pkg.name)}`, {
|
|
7
|
-
signal: AbortSignal.timeout(30_000),
|
|
8
|
-
});
|
|
9
|
-
if (!response.ok) {
|
|
10
|
-
throw new Error(`Registry request failed: ${response.status} ${response.statusText} (${registry})`);
|
|
11
|
-
}
|
|
12
|
-
const metadata = await response.json();
|
|
13
|
-
const latest = metadata['dist-tags']?.latest;
|
|
14
|
-
if (!latest) throw new Error(`${pkg.name}: no latest dist-tag on ${registry}`);
|
|
15
|
-
const version = metadata.versions?.[latest];
|
|
16
|
-
if (!version) throw new Error(`${pkg.name}: metadata for ${latest} missing on ${registry}`);
|
|
17
|
-
|
|
18
|
-
// 不包含执行时间;同一正式版本重复运行不会产生空提交。
|
|
19
|
-
const dump = {
|
|
20
|
-
name: pkg.name,
|
|
21
|
-
latest,
|
|
22
|
-
publishedAt: metadata.time?.[latest] ?? null,
|
|
23
|
-
dist: {
|
|
24
|
-
tarball: version.dist?.tarball ?? null,
|
|
25
|
-
integrity: version.dist?.integrity ?? null,
|
|
26
|
-
unpackedSize: version.dist?.unpackedSize ?? null,
|
|
27
|
-
},
|
|
28
|
-
};
|
|
29
|
-
writeFileSync(new URL('../npm-latest.json', import.meta.url), `${JSON.stringify(dump, null, 2)}\n`);
|
|
30
|
-
console.log(`npm-latest.json: ${pkg.name}@${latest} (published ${dump.publishedAt})`);
|