wx2tg-puppet 2.0.5 → 2.0.7
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/dist/action/common.d.ts +3 -3
- package/dist/action/common.js +15 -7
- package/dist/api/FavorApi.d.ts +26 -6
- package/dist/api/FinderApi.d.ts +18 -16
- package/dist/api/FriendApi.d.ts +74 -12
- package/dist/api/FriendCircleApi.d.ts +12 -10
- package/dist/api/GroupApi.d.ts +62 -19
- package/dist/api/LabelApi.d.ts +8 -6
- package/dist/api/LoginApi.d.ts +85 -43
- package/dist/api/MsgApi.d.ts +98 -18
- package/dist/api/OfficialAccountsApi.d.ts +9 -7
- package/dist/api/QWContactApi.d.ts +5 -3
- package/dist/api/SayHelloApi.d.ts +4 -2
- package/dist/api/ToolsApi.d.ts +22 -18
- package/dist/api/ToolsApi.js +8 -0
- package/dist/api/UserApi.d.ts +84 -18
- package/dist/api/WxappApi.d.ts +16 -14
- package/dist/core/Contact.d.ts +2 -2
- package/dist/core/Friendship.js +6 -0
- package/dist/core/Message.d.ts +4 -3
- package/dist/core/Message.js +3 -1
- package/dist/core/Room.d.ts +2 -2
- package/dist/core/Room.js +2 -0
- package/dist/index.d.ts +1 -1
- package/dist/index.js +9 -9
- package/dist/types/ApiResponse.d.ts +14 -0
- package/dist/types/ApiResponse.js +2 -0
- package/dist/types/MessageType.d.ts +29 -0
- package/dist/types/MessageType.js +32 -0
- package/dist/utils/axiosInstance.d.ts +1 -1
- package/package.json +1 -2
package/dist/index.js
CHANGED
|
@@ -37,7 +37,7 @@ const WEVIDEO_1 = require("./core/WEVIDEO");
|
|
|
37
37
|
Object.defineProperty(exports, "WeVideo", { enumerable: true, get: function () { return WEVIDEO_1.WeVideo; } });
|
|
38
38
|
const URLLINK_1 = require("./core/URLLINK");
|
|
39
39
|
Object.defineProperty(exports, "UrlLink", { enumerable: true, get: function () { return URLLINK_1.UrlLink; } });
|
|
40
|
-
const MessageType_1 = require("./
|
|
40
|
+
const MessageType_1 = require("./types/MessageType");
|
|
41
41
|
const Friendship_1 = require("./core/Friendship");
|
|
42
42
|
const UserApi_1 = require("./api/UserApi");
|
|
43
43
|
const ContactEntity_1 = require("./entities/ContactEntity");
|
|
@@ -59,6 +59,8 @@ class WxBot extends events_1.EventEmitter {
|
|
|
59
59
|
qrcode(style) {
|
|
60
60
|
return __awaiter(this, void 0, void 0, function* () {
|
|
61
61
|
const config = yield config_service_1.configService.get();
|
|
62
|
+
if (!config)
|
|
63
|
+
return null;
|
|
62
64
|
const res = yield UserApi_1.userApi.GetQRCode({
|
|
63
65
|
"Style": style || 8,
|
|
64
66
|
"Wxid": config === null || config === void 0 ? void 0 : config.wxid
|
|
@@ -84,7 +86,6 @@ class WxBot extends events_1.EventEmitter {
|
|
|
84
86
|
response = yield LoginApi_1.loginApi.LoginGetQRCar({
|
|
85
87
|
"DeviceID": (config === null || config === void 0 ? void 0 : config.deviceId) || "",
|
|
86
88
|
"DeviceName": (config === null || config === void 0 ? void 0 : config.DeviceName) || "",
|
|
87
|
-
"OSModel": "",
|
|
88
89
|
"Proxy": {
|
|
89
90
|
"ProxyIp": "",
|
|
90
91
|
"ProxyPassword": "",
|
|
@@ -96,7 +97,6 @@ class WxBot extends events_1.EventEmitter {
|
|
|
96
97
|
response = yield LoginApi_1.loginApi.LoginGetQRMac({
|
|
97
98
|
"DeviceID": (config === null || config === void 0 ? void 0 : config.deviceId) || "",
|
|
98
99
|
"DeviceName": (config === null || config === void 0 ? void 0 : config.DeviceName) || "",
|
|
99
|
-
"OSModel": "",
|
|
100
100
|
"Proxy": {
|
|
101
101
|
"ProxyIp": "",
|
|
102
102
|
"ProxyPassword": "",
|
|
@@ -108,7 +108,6 @@ class WxBot extends events_1.EventEmitter {
|
|
|
108
108
|
response = yield LoginApi_1.loginApi.LoginGetQRPad({
|
|
109
109
|
"DeviceID": (config === null || config === void 0 ? void 0 : config.deviceId) || "",
|
|
110
110
|
"DeviceName": (config === null || config === void 0 ? void 0 : config.DeviceName) || "",
|
|
111
|
-
"OSModel": "",
|
|
112
111
|
"Proxy": {
|
|
113
112
|
"ProxyIp": "",
|
|
114
113
|
"ProxyPassword": "",
|
|
@@ -120,7 +119,6 @@ class WxBot extends events_1.EventEmitter {
|
|
|
120
119
|
response = yield LoginApi_1.loginApi.LoginGetQRWin({
|
|
121
120
|
"DeviceID": (config === null || config === void 0 ? void 0 : config.deviceId) || "",
|
|
122
121
|
"DeviceName": (config === null || config === void 0 ? void 0 : config.DeviceName) || "",
|
|
123
|
-
"OSModel": "",
|
|
124
122
|
"Proxy": {
|
|
125
123
|
"ProxyIp": "",
|
|
126
124
|
"ProxyPassword": "",
|
|
@@ -132,7 +130,6 @@ class WxBot extends events_1.EventEmitter {
|
|
|
132
130
|
response = yield LoginApi_1.loginApi.LoginGetQRx({
|
|
133
131
|
"DeviceID": (config === null || config === void 0 ? void 0 : config.deviceId) || "",
|
|
134
132
|
"DeviceName": (config === null || config === void 0 ? void 0 : config.DeviceName) || "",
|
|
135
|
-
"OSModel": "",
|
|
136
133
|
"Proxy": {
|
|
137
134
|
"ProxyIp": "",
|
|
138
135
|
"ProxyPassword": "",
|
|
@@ -145,7 +142,6 @@ class WxBot extends events_1.EventEmitter {
|
|
|
145
142
|
response = yield LoginApi_1.loginApi.LoginGetQR({
|
|
146
143
|
"DeviceID": (config === null || config === void 0 ? void 0 : config.deviceId) || "",
|
|
147
144
|
"DeviceName": (config === null || config === void 0 ? void 0 : config.DeviceName) || "",
|
|
148
|
-
"OSModel": "",
|
|
149
145
|
"Proxy": {
|
|
150
146
|
"ProxyIp": "",
|
|
151
147
|
"ProxyPassword": "",
|
|
@@ -296,7 +292,7 @@ class WxBot extends events_1.EventEmitter {
|
|
|
296
292
|
this.msgInterval = setInterval(() => __awaiter(this, void 0, void 0, function* () {
|
|
297
293
|
var _a;
|
|
298
294
|
const resp = yield MsgApi_1.msgApi.Sync({
|
|
299
|
-
"
|
|
295
|
+
"Wxid": userName,
|
|
300
296
|
"Scene": 0,
|
|
301
297
|
"Synckey": ""
|
|
302
298
|
});
|
|
@@ -419,7 +415,11 @@ class WxBot extends events_1.EventEmitter {
|
|
|
419
415
|
this.clearAllIntervals(); // 确保清理所有定时器
|
|
420
416
|
const config = yield config_service_1.configService.get();
|
|
421
417
|
if (config && config.wxid) {
|
|
422
|
-
const resp = yield MsgApi_1.msgApi.Sync(
|
|
418
|
+
const resp = yield MsgApi_1.msgApi.Sync({
|
|
419
|
+
"Wxid": config.wxid,
|
|
420
|
+
"Scene": 0,
|
|
421
|
+
"Synckey": ""
|
|
422
|
+
});
|
|
423
423
|
if (resp.data.Code === 0) {
|
|
424
424
|
yield this.loginSuccess(config.wxid);
|
|
425
425
|
}
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
export declare const MessageType: {
|
|
2
|
+
Unknown: string;
|
|
3
|
+
FileStart: string;
|
|
4
|
+
File: string;
|
|
5
|
+
Voice: string;
|
|
6
|
+
Contact: string;
|
|
7
|
+
Emoji: string;
|
|
8
|
+
Image: string;
|
|
9
|
+
Text: string;
|
|
10
|
+
Video: string;
|
|
11
|
+
Url: string;
|
|
12
|
+
RoomInvitation: string;
|
|
13
|
+
MiniApp: string;
|
|
14
|
+
AppMsg: string;
|
|
15
|
+
Link: string;
|
|
16
|
+
AddFriend: string;
|
|
17
|
+
Quote: string;
|
|
18
|
+
Transfer: string;
|
|
19
|
+
RedPacket: string;
|
|
20
|
+
VideoAccount: string;
|
|
21
|
+
Revoke: string;
|
|
22
|
+
Pat: string;
|
|
23
|
+
Location: string;
|
|
24
|
+
FunctionMsg: string;
|
|
25
|
+
NewMonmentTimeline: string;
|
|
26
|
+
ChatHistroy: string;
|
|
27
|
+
Voip: string;
|
|
28
|
+
RealTimeLocation: string;
|
|
29
|
+
};
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.MessageType = void 0;
|
|
4
|
+
exports.MessageType = {
|
|
5
|
+
Unknown: 'unknown', // 未知类型
|
|
6
|
+
FileStart: 'file_start', // 文件开始
|
|
7
|
+
File: 'file', // 文件发送结束
|
|
8
|
+
Voice: 'voice', // 语音
|
|
9
|
+
Contact: 'contact', // 名片
|
|
10
|
+
Emoji: 'emoji', // 表情
|
|
11
|
+
Image: 'image', // 图片
|
|
12
|
+
Text: 'text', // 文本
|
|
13
|
+
Video: 'video', // 视频
|
|
14
|
+
Url: 'link', // 链接
|
|
15
|
+
RoomInvitation: 'room_invitation', // 群邀请
|
|
16
|
+
MiniApp: 'mini_app', // 小程序消息
|
|
17
|
+
AppMsg: 'app_msg', // app消息
|
|
18
|
+
Link: 'link', // 公众号链接
|
|
19
|
+
AddFriend: 'add_friend', // 添加好友通知
|
|
20
|
+
Quote: 'quote', // 引用消息
|
|
21
|
+
Transfer: 'transfer', //转账
|
|
22
|
+
RedPacket: 'red_packet', //红包
|
|
23
|
+
VideoAccount: 'video_account', // 视频号消息
|
|
24
|
+
Revoke: 'revoke', // 撤回消息
|
|
25
|
+
Pat: 'pat', // 拍一拍
|
|
26
|
+
Location: 'location', // 位置消息
|
|
27
|
+
FunctionMsg: 'function_msg', // 微信团队消息
|
|
28
|
+
NewMonmentTimeline: 'new_monment_timeline', // 朋友圈更新
|
|
29
|
+
ChatHistroy: 'chat_histroy', // 聊天记录
|
|
30
|
+
Voip: 'voip', // voip消息
|
|
31
|
+
RealTimeLocation: 'real_time_location', // 实时位置共享
|
|
32
|
+
};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export declare const axiosInstance:
|
|
1
|
+
export declare const axiosInstance: import("axios").AxiosInstance;
|
|
2
2
|
export declare function setBaseUrl(baseUrl: string): void;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "wx2tg-puppet",
|
|
3
|
-
"version": "2.0.
|
|
3
|
+
"version": "2.0.7",
|
|
4
4
|
"main": "dist/index.js",
|
|
5
5
|
"types": "dist/index.d.ts",
|
|
6
6
|
"files": [
|
|
@@ -23,7 +23,6 @@
|
|
|
23
23
|
"license": "ISC",
|
|
24
24
|
"description": "微信机器人核心库,可作为依赖被其他项目引入。",
|
|
25
25
|
"devDependencies": {
|
|
26
|
-
"@types/axios": "^0.9.36",
|
|
27
26
|
"@types/json-bigint": "^1.0.4",
|
|
28
27
|
"@types/qrcode-terminal": "^0.12.2",
|
|
29
28
|
"ts-node": "^10.9.2",
|