node-easywechat 3.7.5 → 3.7.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.
@@ -10,11 +10,19 @@ on:
10
10
  jobs:
11
11
  build:
12
12
  runs-on: ubuntu-latest
13
+ permissions:
14
+ id-token: write
15
+ strategy:
16
+ matrix:
17
+ node-version: [16.x, 18.x, 20.x, 22.x, 24.x]
13
18
  steps:
14
- - uses: actions/checkout@v3
15
- - uses: actions/setup-node@v3
19
+ - uses: actions/checkout@v4
16
20
  with:
17
- node-version: 16
21
+ show-progress: false
22
+ - uses: actions/setup-node@v4
23
+ with:
24
+ node-version: ${{ matrix.node-version }}
25
+ registry-url: 'https://registry.npmjs.org'
18
26
  - run: npm install
19
27
  - run: npm run build
20
28
  - run: npm test
@@ -10,6 +10,8 @@ on:
10
10
  jobs:
11
11
  publish-npm:
12
12
  runs-on: ubuntu-latest
13
+ permissions:
14
+ id-token: write
13
15
  steps:
14
16
  - uses: actions/checkout@v3
15
17
  - uses: actions/setup-node@v3
@@ -19,6 +21,6 @@ jobs:
19
21
  - run: npm install
20
22
  - run: npm run build
21
23
  - run: npm test
22
- - run: npm publish --tag second
24
+ - run: npm publish --tag second --provenance --access public
23
25
  env:
24
26
  NODE_AUTH_TOKEN: ${{secrets.npm_token}}
@@ -10,15 +10,19 @@ on:
10
10
  jobs:
11
11
  publish-npm:
12
12
  runs-on: ubuntu-latest
13
+ permissions:
14
+ id-token: write
13
15
  steps:
14
- - uses: actions/checkout@v3
15
- - uses: actions/setup-node@v3
16
+ - uses: actions/checkout@v4
17
+ with:
18
+ show-progress: false
19
+ - uses: actions/setup-node@v4
16
20
  with:
17
21
  node-version: 16
18
- registry-url: https://registry.npmjs.org/
22
+ registry-url: 'https://registry.npmjs.org'
19
23
  - run: npm install
20
24
  - run: npm run build
21
25
  - run: npm test
22
- - run: npm publish --tag latest
26
+ - run: npm publish --tag latest --provenance --access public
23
27
  env:
24
28
  NODE_AUTH_TOKEN: ${{secrets.npm_token}}
package/CHANGELOG.md CHANGED
@@ -1,6 +1,14 @@
1
1
  # CHANGELOG
2
2
 
3
3
 
4
+ ## v3.7.7 (2025-07-22)
5
+
6
+ - Fix: 升级依赖包,并修复ts错误
7
+
8
+ ## v3.7.6 (2024-12-03)
9
+
10
+ - Fix: 小程序和视频号模块token和aes_key改为非必填 (#98)
11
+
4
12
  ## v3.7.5 (2024-11-16)
5
13
 
6
14
  - Feat: 企业微信开放平台模块,新增生成授权页地址、获取企业永久授权码两个方法
@@ -69,11 +69,6 @@ class Application {
69
69
  }
70
70
  getServer() {
71
71
  if (!this.server) {
72
- let token = this.getAccount().getToken();
73
- let aesKey = this.getAccount().getAesKey();
74
- if (!token || !aesKey) {
75
- throw new Error('token or aes_key cannot be empty.');
76
- }
77
72
  this.server = new Server_1.default(this.getRequest(), this.getAccount().getAesKey() ? this.getEncryptor() : null);
78
73
  }
79
74
  else {
@@ -1,3 +1,4 @@
1
+ import { WithImplicitCoercion } from 'buffer';
1
2
  import { CipherGCMTypes, BinaryLike, CipherKey } from 'crypto';
2
3
  export declare class AES {
3
4
  /**
@@ -6,7 +6,7 @@ export declare class PrivateKey {
6
6
  * 获取私钥内容
7
7
  * @returns
8
8
  */
9
- getKey(): Buffer;
9
+ getKey(): Buffer<ArrayBufferLike>;
10
10
  /**
11
11
  * 获取密码
12
12
  * @returns
@@ -16,5 +16,5 @@ export declare class PrivateKey {
16
16
  * 转为字符串
17
17
  * @returns
18
18
  */
19
- toString(): Buffer;
19
+ toString(): Buffer<ArrayBufferLike>;
20
20
  }
@@ -11,7 +11,7 @@ export declare class PublicKey {
11
11
  * 获取证书内容
12
12
  * @returns
13
13
  */
14
- getValue(): Buffer;
14
+ getValue(): Buffer<ArrayBufferLike>;
15
15
  /**
16
16
  * 转为字符串
17
17
  * @returns
@@ -71,11 +71,6 @@ class Application {
71
71
  }
72
72
  getServer() {
73
73
  if (!this.server) {
74
- let token = this.getAccount().getToken();
75
- let aesKey = this.getAccount().getAesKey();
76
- if (!token || !aesKey) {
77
- throw new Error('token or aes_key cannot be empty.');
78
- }
79
74
  this.server = new Server_1.default(this.getRequest(), this.getAccount().getAesKey() ? this.getEncryptor() : null);
80
75
  }
81
76
  else {
@@ -15,13 +15,23 @@ var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (
15
15
  }) : function(o, v) {
16
16
  o["default"] = v;
17
17
  });
18
- var __importStar = (this && this.__importStar) || function (mod) {
19
- if (mod && mod.__esModule) return mod;
20
- var result = {};
21
- if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
22
- __setModuleDefault(result, mod);
23
- return result;
24
- };
18
+ var __importStar = (this && this.__importStar) || (function () {
19
+ var ownKeys = function(o) {
20
+ ownKeys = Object.getOwnPropertyNames || function (o) {
21
+ var ar = [];
22
+ for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
23
+ return ar;
24
+ };
25
+ return ownKeys(o);
26
+ };
27
+ return function (mod) {
28
+ if (mod && mod.__esModule) return mod;
29
+ var result = {};
30
+ if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
31
+ __setModuleDefault(result, mod);
32
+ return result;
33
+ };
34
+ })();
25
35
  var __importDefault = (this && this.__importDefault) || function (mod) {
26
36
  return (mod && mod.__esModule) ? mod : { "default": mod };
27
37
  };
@@ -15,13 +15,23 @@ var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (
15
15
  }) : function(o, v) {
16
16
  o["default"] = v;
17
17
  });
18
- var __importStar = (this && this.__importStar) || function (mod) {
19
- if (mod && mod.__esModule) return mod;
20
- var result = {};
21
- if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
22
- __setModuleDefault(result, mod);
23
- return result;
24
- };
18
+ var __importStar = (this && this.__importStar) || (function () {
19
+ var ownKeys = function(o) {
20
+ ownKeys = Object.getOwnPropertyNames || function (o) {
21
+ var ar = [];
22
+ for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
23
+ return ar;
24
+ };
25
+ return ownKeys(o);
26
+ };
27
+ return function (mod) {
28
+ if (mod && mod.__esModule) return mod;
29
+ var result = {};
30
+ if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
31
+ __setModuleDefault(result, mod);
32
+ return result;
33
+ };
34
+ })();
25
35
  var __importDefault = (this && this.__importDefault) || function (mod) {
26
36
  return (mod && mod.__esModule) ? mod : { "default": mod };
27
37
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "node-easywechat",
3
- "version": "3.7.5",
3
+ "version": "3.7.7",
4
4
  "description": "EasyWechat SDK for Node.js (NOT OFFICIAL)",
5
5
  "main": "dist/index.js",
6
6
  "scripts": {
@@ -22,20 +22,21 @@
22
22
  "node": ">=15.6.0"
23
23
  },
24
24
  "devDependencies": {
25
- "@types/node": "^20.14.15",
25
+ "@types/node": "^20.19.9",
26
26
  "axios-mock-adapter": "^1.22.0",
27
- "mocha": "^9.2.2",
27
+ "mocha": "^11.7.1",
28
28
  "package-release": "^1.0.3",
29
- "typescript": "^5.5.4"
29
+ "typescript": "^5.8.3"
30
30
  },
31
31
  "dependencies": {
32
- "axios": "^1.7.4",
32
+ "axios": "^1.10.0",
33
33
  "axios-retry": "^4.5.0",
34
- "form-data": "^4.0.0",
34
+ "form-data": "^4.0.4",
35
35
  "merge": "^2.1.1",
36
36
  "node-socialite": "^1.4.1",
37
- "qs": "^6.13.0",
37
+ "qs": "^6.14.0",
38
38
  "raw-body": "^2.5.2",
39
39
  "xml2js": "^0.6.2"
40
- }
40
+ },
41
+ "packageManager": "pnpm@10.12.4+sha512.5ea8b0deed94ed68691c9bad4c955492705c5eeb8a87ef86bc62c74a26b037b08ff9570f108b2e4dbd1dd1a9186fea925e527f141c648e85af45631074680184"
41
42
  }