node-easywechat 2.12.1 → 2.12.3

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.
@@ -0,0 +1,21 @@
1
+ # 2.x 所有提交自动构建并测试
2
+
3
+ name: Build 2.x
4
+
5
+ on:
6
+ push:
7
+ branches:
8
+ - '2.x'
9
+
10
+ jobs:
11
+ build:
12
+ runs-on: ubuntu-latest
13
+ steps:
14
+ - uses: actions/checkout@v3
15
+ - uses: actions/setup-node@v3
16
+ with:
17
+ node-version: 16
18
+ - run: npm install
19
+ - run: npm run build
20
+ - run: npm test
21
+
@@ -0,0 +1,21 @@
1
+ # 3.x 所有提交自动构建并测试
2
+
3
+ name: Build 3.x
4
+
5
+ on:
6
+ push:
7
+ branches:
8
+ - '3.x'
9
+
10
+ jobs:
11
+ build:
12
+ runs-on: ubuntu-latest
13
+ steps:
14
+ - uses: actions/checkout@v3
15
+ - uses: actions/setup-node@v3
16
+ with:
17
+ node-version: 16
18
+ - run: npm install
19
+ - run: npm run build
20
+ - run: npm test
21
+
@@ -0,0 +1,24 @@
1
+ # 构建、测试并发布2.x分支
2
+
3
+ name: Publish 2.x to npm
4
+
5
+ on:
6
+ push:
7
+ tags:
8
+ - v2.*
9
+
10
+ jobs:
11
+ publish-npm:
12
+ runs-on: ubuntu-latest
13
+ steps:
14
+ - uses: actions/checkout@v3
15
+ - uses: actions/setup-node@v3
16
+ with:
17
+ node-version: 16
18
+ registry-url: https://registry.npmjs.org/
19
+ - run: npm install
20
+ - run: npm run build
21
+ - run: npm test
22
+ - run: npm publish --tag second
23
+ env:
24
+ NODE_AUTH_TOKEN: ${{secrets.npm_token}}
@@ -0,0 +1,24 @@
1
+ # 构建、测试并发布3.x分支
2
+
3
+ name: Publish 3.x to npm
4
+
5
+ on:
6
+ push:
7
+ tags:
8
+ - v3.*
9
+
10
+ jobs:
11
+ publish-npm:
12
+ runs-on: ubuntu-latest
13
+ steps:
14
+ - uses: actions/checkout@v3
15
+ - uses: actions/setup-node@v3
16
+ with:
17
+ node-version: 16
18
+ registry-url: https://registry.npmjs.org/
19
+ - run: npm install
20
+ - run: npm run build
21
+ - run: npm test
22
+ - run: npm publish --tag latest
23
+ env:
24
+ NODE_AUTH_TOKEN: ${{secrets.npm_token}}
package/CHANGELOG.md CHANGED
@@ -1,6 +1,15 @@
1
1
  # CHANGELOG
2
2
 
3
3
 
4
+ ## v2.12.3 (2023-04-11)
5
+
6
+ ## v2.12.2 (2023-03-27)
7
+
8
+ - Fix: 2.x版本调整为npm的second标签
9
+ - Fix: 转发客服消息,客服账号非必填
10
+
11
+ ## v2.12.1 (2023-02-02)
12
+
4
13
  ## v2.12.0 (2023-01-04)
5
14
 
6
15
  - Feat: 企业微信新增更新任务卡片消息、更新模版卡片消息两个接口
package/README.md CHANGED
@@ -1,11 +1,12 @@
1
1
 
2
2
  ## EasyWechat for Node.js
3
3
 
4
- [![Build Status](https://app.travis-ci.com/hpyer/node-easywechat.svg?branch=2.x)](https://app.travis-ci.com/hpyer/node-easywechat) [![npm](https://img.shields.io/npm/v/node-easywechat.svg)](https://www.npmjs.com/package/node-easywechat) [![License](https://img.shields.io/npm/l/node-easywechat.svg)](LICENSE)
4
+ ![Build 2.x](https://github.com/hpyer/node-easywechat/actions/workflows/build-2.yml/badge.svg)
5
+ [![npm](https://img.shields.io/npm/v/node-easywechat.svg)](https://www.npmjs.com/package/node-easywechat) [![License](https://img.shields.io/npm/l/node-easywechat.svg)](LICENSE)
5
6
 
6
7
  **注:2.x分支针对 EasyWechat 的 5.x版本(由于4.x与5.x的结构基本一致,就不升级大版本了)。**
7
8
 
8
- ~~若您需要 EasyWechat 的 3.x版本,请切换到 [1.x](https://github.com/hpyer/node-easywechat/tree/1.x) 分支。~~ **1.0版本已废弃**
9
+ 若您需要 EasyWechat 的 5.x版本,请切换到 [3.x](https://github.com/hpyer/node-easywechat/tree/3.x) 分支。
9
10
 
10
11
  [EasyWechat](https://github.com/w7corp/easywechat) 是一个由 `安正超` 大神用 PHP 开发的开源的微信非官方 SDK(现由微擎团队团队维护)。其功能强大,使用方便,个人一直很喜欢,所以近日将其在 Node.js 上实现。本人会尽量还原其配置项以及接口的调用方式,但毕竟语言环境不同,具体的实现方式会有些许差别,还请各位开发者见谅。
11
12
 
@@ -14,7 +15,7 @@
14
15
 
15
16
  ### 安装
16
17
 
17
- `npm install -S node-easywechat`
18
+ `npm install -S node-easywechat@second`
18
19
 
19
20
  ### 使用说明
20
21
 
@@ -2,6 +2,6 @@ import { Message } from './Message';
2
2
  export declare class Transfer extends Message {
3
3
  protected type: string;
4
4
  protected properties: Array<string>;
5
- constructor(account: string);
5
+ constructor(account?: string);
6
6
  toXmlArray(): object;
7
7
  }
@@ -248,6 +248,8 @@ exports.singleItem = singleItem;
248
248
  const parseXml = function (xml) {
249
249
  return __awaiter(this, void 0, void 0, function* () {
250
250
  let res = yield xml2js_1.default.parseStringPromise(xml);
251
+ // fix [Object: null prototype]
252
+ res = JSON.parse(JSON.stringify(res));
251
253
  res = (0, exports.singleItem)(res);
252
254
  if (res['xml'])
253
255
  res = res['xml'];
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "node-easywechat",
3
- "version": "2.12.1",
3
+ "version": "2.12.3",
4
4
  "description": "EasyWechat SDK for Node.js (NOT OFFICIAL)",
5
5
  "main": "dist/index.js",
6
6
  "scripts": {
@@ -32,6 +32,6 @@
32
32
  "node-socialite": "^1.3.0",
33
33
  "qs": "^6.10.3",
34
34
  "raw-body": "^2.5.1",
35
- "xml2js": "^0.4.23"
35
+ "xml2js": "^0.5.0"
36
36
  }
37
37
  }