@zhin.js/adapter-wechat-mp 3.0.1 → 3.0.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.
package/package.json CHANGED
@@ -1,26 +1,36 @@
1
1
  {
2
2
  "name": "@zhin.js/adapter-wechat-mp",
3
- "version": "3.0.1",
3
+ "version": "3.0.3",
4
4
  "type": "module",
5
- "description": "Zhin.js adapter for WeChat Official Account (微信公众号)",
5
+ "description": "Zhin.js WeChat Official Account adapter for Plugin Runtime (HTTP webhook)",
6
6
  "main": "./lib/index.js",
7
7
  "types": "./lib/index.d.ts",
8
8
  "dependencies": {
9
- "xml2js": "^0.6.2",
10
9
  "axios": "^1.18.0",
11
- "form-data": "^4.0.6"
10
+ "xml2js": "^0.6.2",
11
+ "@zhin.js/adapter": "1.0.1",
12
+ "@zhin.js/core": "1.3.5",
13
+ "@zhin.js/host-http": "1.0.1",
14
+ "@zhin.js/logger": "1.0.75",
15
+ "@zhin.js/plugin-runtime": "1.0.1"
12
16
  },
13
17
  "peerDependencies": {
14
- "@zhin.js/host-router": "2.0.2",
15
- "zhin.js": "4.1.1"
18
+ "@zhin.js/adapter": "1.0.1",
19
+ "@zhin.js/core": "1.3.5",
20
+ "@zhin.js/host-http": "1.0.1",
21
+ "@zhin.js/plugin-runtime": "1.0.1",
22
+ "zhin.js": "4.1.3"
23
+ },
24
+ "peerDependenciesMeta": {
25
+ "zhin.js": {
26
+ "optional": true
27
+ }
16
28
  },
17
29
  "devDependencies": {
18
- "@types/koa": "^3.0.3",
19
30
  "@types/node": "^26.1.0",
20
31
  "@types/xml2js": "^0.4.14",
21
32
  "typescript": "^6.0.3",
22
- "zhin.js": "4.1.1",
23
- "@zhin.js/host-router": "2.0.2"
33
+ "vitest": "^4.1.10"
24
34
  },
25
35
  "keywords": [
26
36
  "zhin",
@@ -46,9 +56,12 @@
46
56
  "directory": "plugins/adapters/wechat-mp"
47
57
  },
48
58
  "files": [
59
+ "adapters",
60
+ "plugin.ts",
61
+ "schema.json",
49
62
  "src",
50
63
  "lib",
51
- "skills",
64
+ "agent",
52
65
  "README.md",
53
66
  "CHANGELOG.md"
54
67
  ],
@@ -66,9 +79,23 @@
66
79
  "engines": {
67
80
  "node": "^20.19.0 || >=22.12.0"
68
81
  },
82
+ "zhin": {
83
+ "protocol": 1,
84
+ "type": "plugin",
85
+ "entry": "./plugin.ts",
86
+ "engine": "^1.0.0",
87
+ "runtime": "trusted",
88
+ "features": [
89
+ {
90
+ "package": "@zhin.js/adapter",
91
+ "api": "^1.0.0"
92
+ }
93
+ ],
94
+ "plugins": []
95
+ },
69
96
  "scripts": {
70
- "build": "pnpm build:node",
97
+ "build": "tsc",
71
98
  "clean": "rimraf lib",
72
- "build:node": "tsc"
99
+ "test": "NODE_OPTIONS=--experimental-strip-types vitest run --root ../../.. plugins/adapters/wechat-mp/tests"
73
100
  }
74
101
  }
package/plugin.ts ADDED
@@ -0,0 +1,8 @@
1
+ import { definePlugin } from '@zhin.js/plugin-runtime';
2
+
3
+ export default definePlugin({
4
+ name: 'wechat-mp',
5
+ metadata: {
6
+ displayName: 'WeChat Official Account Adapter',
7
+ },
8
+ });
package/schema.json ADDED
@@ -0,0 +1,38 @@
1
+ {
2
+ "$schema": "https://json-schema.org/draft/2020-12/schema",
3
+ "type": "object",
4
+ "additionalProperties": false,
5
+ "properties": {
6
+ "name": {
7
+ "type": "string",
8
+ "default": "wechat-mp-bot"
9
+ },
10
+ "appId": { "type": "string" },
11
+ "appSecret": { "type": "string" },
12
+ "token": { "type": "string" },
13
+ "encodingAESKey": { "type": "string" },
14
+ "path": {
15
+ "type": "string",
16
+ "default": "/wechat/webhook"
17
+ },
18
+ "encrypt": {
19
+ "type": "boolean",
20
+ "default": false
21
+ },
22
+ "encryptMode": {
23
+ "type": "string",
24
+ "enum": ["plain", "compatible", "secure"],
25
+ "description": "Default follows encrypt: 'plain' when encrypt=false, 'compatible' when encrypt=true"
26
+ },
27
+ "replyMode": {
28
+ "type": "string",
29
+ "enum": ["passive", "customer_service"],
30
+ "default": "passive"
31
+ },
32
+ "passiveReplyTimeoutMs": {
33
+ "type": "number",
34
+ "default": 4500
35
+ }
36
+ },
37
+ "required": ["appId", "appSecret", "token"]
38
+ }