node-easywechat 3.5.15 → 3.5.17

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/CHANGELOG.md CHANGED
@@ -1,6 +1,14 @@
1
1
  # CHANGELOG
2
2
 
3
3
 
4
+ ## v3.5.17 (2023-12-20)
5
+
6
+ - Fix: 修复TS问题 (#62)
7
+
8
+ ## v3.5.16 (2023-12-20)
9
+
10
+ - Fix: 优化消息类型,允许未定义字段的存在 (#62)
11
+
4
12
  ## v3.5.15 (2023-12-20)
5
13
 
6
14
  - Fix: 微信支付的敏感信息加密机增加获取公钥序列号的方法 (#57)
@@ -26,6 +26,6 @@ declare class Message {
26
26
  */
27
27
  toString(): string;
28
28
  }
29
- interface Message extends HasAttributesMixin {
29
+ interface Message extends Record<string, any>, HasAttributesMixin {
30
30
  }
31
31
  export = Message;
@@ -26,6 +26,8 @@ class Message {
26
26
  this.originContent = originContent;
27
27
  return new Proxy(this, {
28
28
  set: function (obj, key, val) {
29
+ if (typeof key === 'symbol')
30
+ key = key.toString();
29
31
  if (typeof obj[key] !== 'undefined') {
30
32
  obj[key] = val;
31
33
  }
@@ -35,6 +37,8 @@ class Message {
35
37
  return true;
36
38
  },
37
39
  get: function (obj, key) {
40
+ if (typeof key === 'symbol')
41
+ key = key.toString();
38
42
  if (typeof obj[key] !== 'undefined') {
39
43
  return obj[key];
40
44
  }
@@ -4,28 +4,28 @@ import axios from 'axios';
4
4
  declare module 'axios' {
5
5
 
6
6
  interface AxiosInstance {
7
- <T = Recordable, R = AxiosResponse<T>>(config: AxiosRequestConfig): Promise<R>;
8
- request<T = Recordable, R = AxiosResponse<T>>(config: AxiosRequestConfig): Promise<R>;
9
- get<T = Recordable, R = AxiosResponse<T>>(url: string, config?: AxiosRequestConfig): Promise<R>;
10
- delete<T = Recordable, R = AxiosResponse<T>>(url: string, config?: AxiosRequestConfig): Promise<R>;
11
- head<T = Recordable, R = AxiosResponse<T>>(url: string, config?: AxiosRequestConfig): Promise<R>;
12
- post<T = Recordable, R = AxiosResponse<T>>(url: string, data?: Recordable, config?: AxiosRequestConfig): Promise<R>;
13
- put<T = Recordable, R = AxiosResponse<T>>(url: string, data?: Recordable, config?: AxiosRequestConfig): Promise<R>;
14
- patch<T = Recordable, R = AxiosResponse<T>>(url: string, data?: Recordable, config?: AxiosRequestConfig): Promise<R>;
7
+ <T = Record<string, any>, R = AxiosResponse<T>>(config: AxiosRequestConfig): Promise<R>;
8
+ request<T = Record<string, any>, R = AxiosResponse<T>>(config: AxiosRequestConfig): Promise<R>;
9
+ get<T = Record<string, any>, R = AxiosResponse<T>>(url: string, config?: AxiosRequestConfig): Promise<R>;
10
+ delete<T = Record<string, any>, R = AxiosResponse<T>>(url: string, config?: AxiosRequestConfig): Promise<R>;
11
+ head<T = Record<string, any>, R = AxiosResponse<T>>(url: string, config?: AxiosRequestConfig): Promise<R>;
12
+ post<T = Record<string, any>, R = AxiosResponse<T>>(url: string, data?: Record<string, any>, config?: AxiosRequestConfig): Promise<R>;
13
+ put<T = Record<string, any>, R = AxiosResponse<T>>(url: string, data?: Record<string, any>, config?: AxiosRequestConfig): Promise<R>;
14
+ patch<T = Record<string, any>, R = AxiosResponse<T>>(url: string, data?: Record<string, any>, config?: AxiosRequestConfig): Promise<R>;
15
15
  }
16
16
 
17
17
  interface AxiosRequestConfig {
18
18
  /**
19
19
  * 要发送的xml数据,会自动解析并赋值到data属性,同时设置content-type=text/xml
20
20
  */
21
- xml?: string | Recordable;
21
+ xml?: string | Record<string, any>;
22
22
  /**
23
23
  * 要发送的json数据,会自动解析并赋值到data属性,同时设置content-type=application/json
24
24
  */
25
- json?: string | Recordable;
25
+ json?: string | Record<string, any>;
26
26
  /**
27
27
  * 要发送的FormData数据,会自动解析并赋值到data属性,同时设置根据内容提取headers
28
28
  */
29
- formData?: Recordable;
29
+ formData?: Record<string, any>;
30
30
  }
31
31
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "node-easywechat",
3
- "version": "3.5.15",
3
+ "version": "3.5.17",
4
4
  "description": "EasyWechat SDK for Node.js (NOT OFFICIAL)",
5
5
  "main": "dist/index.js",
6
6
  "scripts": {
@@ -1,2 +0,0 @@
1
-
2
- type Recordable<T = any> = Record<string, T>;