wx2tg-puppet 2.2.5 → 3.0.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.
@@ -143,6 +143,12 @@ const say = (content, toWxid, ats) => __awaiter(void 0, void 0, void 0, function
143
143
  formData.append('wxid', (config === null || config === void 0 ? void 0 : config.wxid) || '');
144
144
  formData.append('file', fileBlob, fileName);
145
145
  const res = yield ToolsApi_1.toolsApi.UploadFileBinary(formData);
146
+ // const fileBase64 = await content.toBase64()
147
+ //
148
+ // const res = await toolsApi.UploadAppAttachApi({
149
+ // "Wxid": config?.wxid,
150
+ // "fileData": fileBase64
151
+ // })
146
152
  if (res.data.Code !== 0) {
147
153
  throw new Error(`上传文件失败: ${res.data.Message}`);
148
154
  }
@@ -33,6 +33,8 @@ declare class ToolsApi {
33
33
  UpdateStepNumberApi(body: any): Promise<AxiosResponse<ApiResponse>>;
34
34
  /** 文件上传 */
35
35
  UploadFile(body: any): Promise<AxiosResponse<ApiResponse>>;
36
+ /** 文件上传 */
37
+ UploadAppAttachApi(body: any): Promise<AxiosResponse<ApiResponse>>;
36
38
  /** 二进制文件上传 */
37
39
  UploadFileBinary(formData: FormData): Promise<AxiosResponse<ApiResponse>>;
38
40
  /** 设置/删除代理IP */
@@ -67,6 +67,10 @@ class ToolsApi {
67
67
  UploadFile(body) {
68
68
  return axiosInstance_1.axiosInstance.post('/Tools/UploadFile', body);
69
69
  }
70
+ /** 文件上传 */
71
+ UploadAppAttachApi(body) {
72
+ return axiosInstance_1.axiosInstance.post('/Tools/UploadAppAttachApi', body);
73
+ }
70
74
  /** 二进制文件上传 */
71
75
  UploadFileBinary(formData) {
72
76
  return axiosInstance_1.axiosInstance.post('/Tools/UploadFileBinary', formData, {
package/dist/index.js CHANGED
@@ -192,7 +192,7 @@ class WxBot extends events_1.EventEmitter {
192
192
  }
193
193
  const data = response.data;
194
194
  this.uuid = data.Data.Uuid;
195
- const match = data.Data.QrUrl.match(/[?&]data=([^&]+)/);
195
+ const match = data.Data.QrUrl.match(/[?&](url|data)=([^&]+)/);
196
196
  if (match && match[1]) {
197
197
  const qrLink = decodeURIComponent(match[1]);
198
198
  this.emit('scan', {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "wx2tg-puppet",
3
- "version": "2.2.5",
3
+ "version": "3.0.1",
4
4
  "main": "dist/index.js",
5
5
  "types": "dist/index.d.ts",
6
6
  "files": [