@zhin.js/adapter-wechat-mp 4.0.1 → 4.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/CHANGELOG.md CHANGED
@@ -1,5 +1,30 @@
1
1
  # @zhin.js/adapter-wechat-mp
2
2
 
3
+ ## 4.0.3
4
+
5
+ ### Patch Changes
6
+
7
+ - Updated dependencies [45b3256]
8
+ - @zhin.js/core@1.4.3
9
+ - zhin.js@5.0.3
10
+
11
+ ## 4.0.2
12
+
13
+ ### Patch Changes
14
+
15
+ - d5cd4aa: Publish Plugin Runtime entry points and convention modules as JavaScript so
16
+ installed npm plugins load on Node without TypeScript stripping. Workspace
17
+ development continues to prefer TypeScript sources for local HMR.
18
+
19
+ Remove the unconsumed legacy game hub APIs from game-kit; game navigation and
20
+ records now use ordinary convention commands owned by the game hub plugin.
21
+
22
+ - Updated dependencies [d5cd4aa]
23
+ - @zhin.js/command@1.0.4
24
+ - zhin.js@5.0.2
25
+ - @zhin.js/adapter@1.1.2
26
+ - @zhin.js/core@1.4.2
27
+
3
28
  ## 4.0.1
4
29
 
5
30
  ### Patch Changes
@@ -0,0 +1,34 @@
1
+ // Generated by build-plugin-runtime-entries.mjs. Do not edit.
2
+ /**
3
+ * Convention entry: discover `adapters/wechat-mp.ts` → defineAdapter.
4
+ */
5
+ import { defineAdapter } from '@zhin.js/adapter';
6
+ import { messageGatewayToken } from '@zhin.js/core/runtime';
7
+ import { httpHostToken } from '@zhin.js/host-http';
8
+ import { WeChatMpEndpoint } from "../lib/endpoint.js";
9
+ import { resolveWeChatMpConfig, } from "../lib/protocol.js";
10
+ import { wechatMpRuntimeStateToken } from "../lib/wechat-mp-runtime-state.js";
11
+ export { WeChatMpEndpoint } from "../lib/endpoint.js";
12
+ export default defineAdapter({
13
+ capabilities: ['inbound', 'outbound'],
14
+ // 客服消息图片经 /cgi-bin/media/upload 物化为 media_id(url 下载后上传);
15
+ // 公众号无卡片交互面,交互段降级纯文本。
16
+ segments: {
17
+ outboundMedia: ['url', 'upload'],
18
+ interactive: 'text',
19
+ },
20
+ create(context) {
21
+ const config = resolveWeChatMpConfig(context.config);
22
+ // 注册到插件运行时状态(wechat-mp endpoint list 的"运行中"数据源)
23
+ context.use(wechatMpRuntimeStateToken).endpoints.set(config.name, {
24
+ name: config.name,
25
+ mode: 'webhook',
26
+ });
27
+ return new WeChatMpEndpoint({
28
+ id: context.id,
29
+ gateway: context.use(messageGatewayToken),
30
+ http: context.use(httpHostToken),
31
+ config,
32
+ });
33
+ },
34
+ });
@@ -0,0 +1,3 @@
1
+ // Generated by build-plugin-runtime-entries.mjs. Do not edit.
2
+ import { wechatMpEndpointCommands } from "../../../lib/wechat-mp-endpoint-commands.js";
3
+ export default wechatMpEndpointCommands.add;
@@ -0,0 +1,3 @@
1
+ // Generated by build-plugin-runtime-entries.mjs. Do not edit.
2
+ import { wechatMpEndpointCommands } from "../../lib/wechat-mp-endpoint-commands.js";
3
+ export default wechatMpEndpointCommands.list;
@@ -0,0 +1,3 @@
1
+ // Generated by build-plugin-runtime-entries.mjs. Do not edit.
2
+ import { wechatMpEndpointCommands } from "../../../lib/wechat-mp-endpoint-commands.js";
3
+ export default wechatMpEndpointCommands.remove;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@zhin.js/adapter-wechat-mp",
3
- "version": "4.0.1",
3
+ "version": "4.0.3",
4
4
  "type": "module",
5
5
  "description": "Zhin.js WeChat Official Account adapter for Plugin Runtime (HTTP webhook)",
6
6
  "main": "./lib/index.js",
@@ -8,19 +8,19 @@
8
8
  "dependencies": {
9
9
  "axios": "^1.18.0",
10
10
  "xml2js": "^0.6.2",
11
- "@zhin.js/adapter": "1.1.1",
12
- "@zhin.js/command": "1.0.3",
13
- "@zhin.js/core": "1.4.1",
11
+ "@zhin.js/adapter": "1.1.2",
12
+ "@zhin.js/command": "1.0.4",
13
+ "@zhin.js/core": "1.4.3",
14
14
  "@zhin.js/host-http": "1.0.3",
15
15
  "@zhin.js/logger": "1.0.75",
16
16
  "@zhin.js/plugin-runtime": "1.1.1"
17
17
  },
18
18
  "peerDependencies": {
19
- "@zhin.js/adapter": "1.1.1",
20
- "@zhin.js/core": "1.4.1",
19
+ "@zhin.js/adapter": "1.1.2",
20
+ "@zhin.js/core": "1.4.3",
21
21
  "@zhin.js/host-http": "1.0.3",
22
22
  "@zhin.js/plugin-runtime": "1.1.1",
23
- "zhin.js": "5.0.1"
23
+ "zhin.js": "5.0.3"
24
24
  },
25
25
  "peerDependenciesMeta": {
26
26
  "zhin.js": {
@@ -59,7 +59,7 @@
59
59
  "files": [
60
60
  "adapters",
61
61
  "commands",
62
- "plugin.ts",
62
+ "plugin.js",
63
63
  "schema.json",
64
64
  "src",
65
65
  "lib",
@@ -84,7 +84,7 @@
84
84
  "zhin": {
85
85
  "protocol": 1,
86
86
  "type": "plugin",
87
- "entry": "./plugin.ts",
87
+ "entry": "./plugin.js",
88
88
  "engine": "^1.0.0",
89
89
  "runtime": "trusted",
90
90
  "features": [
package/plugin.js ADDED
@@ -0,0 +1,14 @@
1
+ // Generated by build-plugin-runtime-entries.mjs. Do not edit.
2
+ import { createEndpointRuntimeState } from '@zhin.js/adapter';
3
+ import { definePlugin } from '@zhin.js/plugin-runtime';
4
+ import { wechatMpRuntimeStateToken } from "./lib/wechat-mp-runtime-state.js";
5
+ export default definePlugin({
6
+ name: 'wechat-mp',
7
+ metadata: {
8
+ displayName: 'WeChat Official Account Adapter',
9
+ },
10
+ setup(context) {
11
+ // 运行中 endpoint 注册表(wechat-mp endpoint list 的"运行中"数据源)
12
+ context.resources.provide(wechatMpRuntimeStateToken, createEndpointRuntimeState());
13
+ },
14
+ });
package/plugin.ts DELETED
@@ -1,14 +0,0 @@
1
- import { createEndpointRuntimeState } from '@zhin.js/adapter';
2
- import { definePlugin } from '@zhin.js/plugin-runtime';
3
- import { wechatMpRuntimeStateToken } from './src/wechat-mp-runtime-state.js';
4
-
5
- export default definePlugin({
6
- name: 'wechat-mp',
7
- metadata: {
8
- displayName: 'WeChat Official Account Adapter',
9
- },
10
- setup(context) {
11
- // 运行中 endpoint 注册表(wechat-mp endpoint list 的"运行中"数据源)
12
- context.resources.provide(wechatMpRuntimeStateToken, createEndpointRuntimeState());
13
- },
14
- });