wx2tg-puppet 2.1.9 → 2.2.1

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.
@@ -1,27 +1,32 @@
1
1
  import { ApiResponse } from '../types/ApiResponse';
2
2
  import { AxiosResponse } from 'axios';
3
+ export interface ProxyInfo {
4
+ ProxyIp: string;
5
+ ProxyPassword: string;
6
+ ProxyUser: string;
7
+ }
3
8
  export interface LoginA16LoginParam {
4
9
  A16: string;
5
10
  DeviceName: string;
6
11
  Password: string;
7
- Proxy?: any;
12
+ Proxy?: ProxyInfo;
8
13
  UserName: string;
9
14
  }
10
15
  export interface LoginData62LoginReq {
11
16
  Data62: string;
12
17
  DeviceName: string;
13
18
  Password: string;
14
- Proxy?: any;
19
+ Proxy?: ProxyInfo;
15
20
  UserName: string;
16
21
  }
17
22
  export interface LoginData62SMSAgainReq {
18
23
  Cookie: string;
19
- Proxy?: any;
24
+ Proxy?: ProxyInfo;
20
25
  Url: string;
21
26
  }
22
27
  export interface LoginData62SMSVerifyReq {
23
28
  Cookie: string;
24
- Proxy?: any;
29
+ Proxy?: ProxyInfo;
25
30
  Sms: string;
26
31
  Url: string;
27
32
  }
@@ -32,7 +37,7 @@ export interface LoginExtDeviceLoginConfirmParam {
32
37
  export interface LoginGetQRReq {
33
38
  DeviceID: string;
34
39
  DeviceName: string;
35
- Proxy?: any;
40
+ Proxy?: ProxyInfo;
36
41
  }
37
42
  export interface LoginVerificationcodeParam {
38
43
  Code: string;
@@ -46,7 +46,6 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
46
46
  };
47
47
  Object.defineProperty(exports, "__esModule", { value: true });
48
48
  exports.ResponseMsg = exports.Message = void 0;
49
- const message_service_1 = require("../services/message.service");
50
49
  const MessageType_1 = require("../types/MessageType");
51
50
  const Contact_1 = require("./Contact");
52
51
  const Room_1 = require("./Room");
@@ -93,7 +92,7 @@ function retryDownload(downloadFn) {
93
92
  class Message {
94
93
  constructor(msg) {
95
94
  this.msg = msg;
96
- message_service_1.messageService.upsertByMsgId(msg.MsgId, msg);
95
+ // messageService.upsertByMsgId(msg.MsgId, msg);
97
96
  this.newMsgId = msg.NewMsgId;
98
97
  this.fromId = msg.FromUserName;
99
98
  this._pushContent = msg.Content;
package/dist/index.d.ts CHANGED
@@ -15,6 +15,9 @@ export interface WxBotOptions {
15
15
  deviceType: 'ipad' | 'car' | 'mac' | 'pad' | 'win' | 'ipadX' | string;
16
16
  mode?: 'polling' | 'callback' | string;
17
17
  callbackPort?: number;
18
+ ProxyIp?: string;
19
+ ProxyPassword?: string;
20
+ ProxyUser?: string;
18
21
  }
19
22
  export declare class WxBot extends EventEmitter {
20
23
  baseUrl: string;
@@ -22,6 +25,9 @@ export declare class WxBot extends EventEmitter {
22
25
  deviceType: 'ipad' | 'car' | 'mac' | 'pad' | 'win' | 'ipadX' | string;
23
26
  mode: 'polling' | 'callback' | string;
24
27
  callbackPort: number;
28
+ ProxyIp?: string;
29
+ ProxyPassword?: string;
30
+ ProxyUser?: string;
25
31
  private uuid;
26
32
  private interval;
27
33
  private heartbeatInterval;
@@ -30,7 +36,7 @@ export declare class WxBot extends EventEmitter {
30
36
  private recentMsgIds;
31
37
  private syncFailureCount;
32
38
  private httpServer;
33
- constructor({ baseUrl, databasePath, deviceType, mode, callbackPort }: WxBotOptions);
39
+ constructor({ baseUrl, databasePath, deviceType, mode, callbackPort, ProxyIp, ProxyPassword, ProxyUser }: WxBotOptions);
34
40
  qrcode(style?: number): Promise<{
35
41
  qrCode: any;
36
42
  } | null>;
package/dist/index.js CHANGED
@@ -78,7 +78,7 @@ const room_service_1 = require("./services/room.service");
78
78
  const message_service_1 = require("./services/message.service");
79
79
  const http = __importStar(require("http"));
80
80
  class WxBot extends events_1.EventEmitter {
81
- constructor({ baseUrl, databasePath, deviceType = 'ipad', mode = 'polling', callbackPort = 8056 }) {
81
+ constructor({ baseUrl, databasePath, deviceType = 'ipad', mode = 'polling', callbackPort = 8056, ProxyIp, ProxyPassword, ProxyUser }) {
82
82
  super();
83
83
  this.uuid = '';
84
84
  this.interval = null;
@@ -93,6 +93,9 @@ class WxBot extends events_1.EventEmitter {
93
93
  this.deviceType = deviceType;
94
94
  this.mode = mode;
95
95
  this.callbackPort = callbackPort;
96
+ this.ProxyIp = ProxyIp;
97
+ this.ProxyPassword = ProxyPassword;
98
+ this.ProxyUser = ProxyUser;
96
99
  (0, axiosInstance_1.setBaseUrl)(baseUrl);
97
100
  }
98
101
  qrcode(style) {
@@ -126,9 +129,9 @@ class WxBot extends events_1.EventEmitter {
126
129
  "DeviceID": (config === null || config === void 0 ? void 0 : config.deviceId) || "",
127
130
  "DeviceName": (config === null || config === void 0 ? void 0 : config.DeviceName) || "",
128
131
  "Proxy": {
129
- "ProxyIp": "",
130
- "ProxyPassword": "",
131
- "ProxyUser": ""
132
+ "ProxyIp": this.ProxyIp || "",
133
+ "ProxyPassword": this.ProxyPassword || "",
134
+ "ProxyUser": this.ProxyUser || ""
132
135
  }
133
136
  });
134
137
  break;
@@ -137,9 +140,9 @@ class WxBot extends events_1.EventEmitter {
137
140
  "DeviceID": (config === null || config === void 0 ? void 0 : config.deviceId) || "",
138
141
  "DeviceName": (config === null || config === void 0 ? void 0 : config.DeviceName) || "",
139
142
  "Proxy": {
140
- "ProxyIp": "",
141
- "ProxyPassword": "",
142
- "ProxyUser": ""
143
+ "ProxyIp": this.ProxyIp || "",
144
+ "ProxyPassword": this.ProxyPassword || "",
145
+ "ProxyUser": this.ProxyUser || ""
143
146
  }
144
147
  });
145
148
  break;
@@ -148,9 +151,9 @@ class WxBot extends events_1.EventEmitter {
148
151
  "DeviceID": (config === null || config === void 0 ? void 0 : config.deviceId) || "",
149
152
  "DeviceName": (config === null || config === void 0 ? void 0 : config.DeviceName) || "",
150
153
  "Proxy": {
151
- "ProxyIp": "",
152
- "ProxyPassword": "",
153
- "ProxyUser": ""
154
+ "ProxyIp": this.ProxyIp || "",
155
+ "ProxyPassword": this.ProxyPassword || "",
156
+ "ProxyUser": this.ProxyUser || ""
154
157
  }
155
158
  });
156
159
  break;
@@ -159,9 +162,9 @@ class WxBot extends events_1.EventEmitter {
159
162
  "DeviceID": (config === null || config === void 0 ? void 0 : config.deviceId) || "",
160
163
  "DeviceName": (config === null || config === void 0 ? void 0 : config.DeviceName) || "",
161
164
  "Proxy": {
162
- "ProxyIp": "",
163
- "ProxyPassword": "",
164
- "ProxyUser": ""
165
+ "ProxyIp": this.ProxyIp || "",
166
+ "ProxyPassword": this.ProxyPassword || "",
167
+ "ProxyUser": this.ProxyUser || ""
165
168
  }
166
169
  });
167
170
  break;
@@ -170,9 +173,9 @@ class WxBot extends events_1.EventEmitter {
170
173
  "DeviceID": (config === null || config === void 0 ? void 0 : config.deviceId) || "",
171
174
  "DeviceName": (config === null || config === void 0 ? void 0 : config.DeviceName) || "",
172
175
  "Proxy": {
173
- "ProxyIp": "",
174
- "ProxyPassword": "",
175
- "ProxyUser": ""
176
+ "ProxyIp": this.ProxyIp || "",
177
+ "ProxyPassword": this.ProxyPassword || "",
178
+ "ProxyUser": this.ProxyUser || ""
176
179
  }
177
180
  });
178
181
  break;
@@ -182,9 +185,9 @@ class WxBot extends events_1.EventEmitter {
182
185
  "DeviceID": (config === null || config === void 0 ? void 0 : config.deviceId) || "",
183
186
  "DeviceName": (config === null || config === void 0 ? void 0 : config.DeviceName) || "",
184
187
  "Proxy": {
185
- "ProxyIp": "",
186
- "ProxyPassword": "",
187
- "ProxyUser": ""
188
+ "ProxyIp": this.ProxyIp || "",
189
+ "ProxyPassword": this.ProxyPassword || "",
190
+ "ProxyUser": this.ProxyUser || ""
188
191
  }
189
192
  });
190
193
  break;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "wx2tg-puppet",
3
- "version": "2.1.9",
3
+ "version": "2.2.1",
4
4
  "main": "dist/index.js",
5
5
  "types": "dist/index.d.ts",
6
6
  "files": [