@zhin.js/adapter-wecom 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/CHANGELOG.md CHANGED
@@ -1,5 +1,32 @@
1
1
  # @zhin.js/adapter-wecom
2
2
 
3
+ ## 3.0.3
4
+
5
+ ### Patch Changes
6
+
7
+ - Updated dependencies [f346346]
8
+ - @zhin.js/agent@1.0.8
9
+ - @zhin.js/core@1.4.2
10
+ - zhin.js@5.0.2
11
+
12
+ ## 3.0.2
13
+
14
+ ### Patch Changes
15
+
16
+ - d5cd4aa: Publish Plugin Runtime entry points and convention modules as JavaScript so
17
+ installed npm plugins load on Node without TypeScript stripping. Workspace
18
+ development continues to prefer TypeScript sources for local HMR.
19
+
20
+ Remove the unconsumed legacy game hub APIs from game-kit; game navigation and
21
+ records now use ordinary convention commands owned by the game hub plugin.
22
+
23
+ - Updated dependencies [d5cd4aa]
24
+ - @zhin.js/command@1.0.4
25
+ - zhin.js@5.0.2
26
+ - @zhin.js/adapter@1.1.2
27
+ - @zhin.js/core@1.4.2
28
+ - @zhin.js/agent@1.0.7
29
+
3
30
  ## 3.0.1
4
31
 
5
32
  ### Patch Changes
@@ -0,0 +1,35 @@
1
+ // Generated by build-plugin-runtime-entries.mjs. Do not edit.
2
+ /**
3
+ * Convention entry: discover `adapters/wecom.ts` → defineAdapter.
4
+ * Implementation lives under `src/` (endpoint / webhook / protocol).
5
+ */
6
+ import { defineAdapter } from '@zhin.js/adapter';
7
+ import { messageGatewayToken } from '@zhin.js/core/runtime';
8
+ import { httpHostToken } from '@zhin.js/host-http';
9
+ import { WecomEndpoint } from "../lib/endpoint.js";
10
+ import { resolveWecomConfig, } from "../lib/protocol.js";
11
+ import { wecomRuntimeStateToken } from "../lib/wecom-runtime-state.js";
12
+ export { WecomEndpoint } from "../lib/endpoint.js";
13
+ export default defineAdapter({
14
+ capabilities: ['inbound', 'outbound'],
15
+ // image 段经 /cgi-bin/media/upload 物化为 media_id(url 下载后上传);
16
+ // 无卡片交互面,交互段降级纯文本。
17
+ segments: {
18
+ outboundMedia: ['url', 'upload'],
19
+ interactive: 'text',
20
+ },
21
+ create(context) {
22
+ const config = resolveWecomConfig(context.config);
23
+ // 注册到插件运行时状态(wecom endpoint list 的"运行中"数据源)
24
+ context.use(wecomRuntimeStateToken).endpoints.set(config.name, {
25
+ name: config.name,
26
+ mode: 'webhook',
27
+ });
28
+ return new WecomEndpoint({
29
+ id: context.id,
30
+ gateway: context.use(messageGatewayToken),
31
+ http: context.use(httpHostToken),
32
+ config,
33
+ });
34
+ },
35
+ });
@@ -0,0 +1,3 @@
1
+ // Generated by build-plugin-runtime-entries.mjs. Do not edit.
2
+ import { wecomEndpointCommands } from "../../../lib/wecom-endpoint-commands.js";
3
+ export default wecomEndpointCommands.add;
@@ -0,0 +1,3 @@
1
+ // Generated by build-plugin-runtime-entries.mjs. Do not edit.
2
+ import { wecomEndpointCommands } from "../../lib/wecom-endpoint-commands.js";
3
+ export default wecomEndpointCommands.list;
@@ -0,0 +1,3 @@
1
+ // Generated by build-plugin-runtime-entries.mjs. Do not edit.
2
+ import { wecomEndpointCommands } from "../../../lib/wecom-endpoint-commands.js";
3
+ export default wecomEndpointCommands.remove;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@zhin.js/adapter-wecom",
3
- "version": "3.0.1",
3
+ "version": "3.0.3",
4
4
  "description": "Zhin.js WeCom (企业微信) adapter for Plugin Runtime (HTTP webhook)",
5
5
  "type": "module",
6
6
  "main": "./lib/index.js",
@@ -34,21 +34,21 @@
34
34
  "directory": "plugins/adapters/wecom"
35
35
  },
36
36
  "dependencies": {
37
- "@zhin.js/adapter": "1.1.1",
38
- "@zhin.js/command": "1.0.3",
39
- "@zhin.js/core": "1.4.1",
37
+ "@zhin.js/adapter": "1.1.2",
38
+ "@zhin.js/command": "1.0.4",
39
+ "@zhin.js/core": "1.4.2",
40
40
  "@zhin.js/host-http": "1.0.3",
41
41
  "@zhin.js/logger": "1.0.75",
42
42
  "@zhin.js/plugin-runtime": "1.1.1"
43
43
  },
44
44
  "peerDependencies": {
45
45
  "zod": "^4.0.0",
46
- "@zhin.js/adapter": "1.1.1",
47
- "@zhin.js/agent": "1.0.6",
48
- "@zhin.js/core": "1.4.1",
46
+ "@zhin.js/adapter": "1.1.2",
47
+ "@zhin.js/agent": "1.0.8",
48
+ "@zhin.js/core": "1.4.2",
49
49
  "@zhin.js/host-http": "1.0.3",
50
50
  "@zhin.js/plugin-runtime": "1.1.1",
51
- "zhin.js": "5.0.1"
51
+ "zhin.js": "5.0.2"
52
52
  },
53
53
  "peerDependenciesMeta": {
54
54
  "zhin.js": {
@@ -66,13 +66,13 @@
66
66
  "typescript": "^6.0.3",
67
67
  "vitest": "^4.1.10",
68
68
  "zod": "^4.4.3",
69
- "@zhin.js/agent": "1.0.6",
70
- "zhin.js": "5.0.1"
69
+ "@zhin.js/agent": "1.0.8",
70
+ "zhin.js": "5.0.2"
71
71
  },
72
72
  "files": [
73
73
  "adapters",
74
74
  "commands",
75
- "plugin.ts",
75
+ "plugin.js",
76
76
  "schema.json",
77
77
  "src",
78
78
  "lib",
@@ -90,7 +90,7 @@
90
90
  "zhin": {
91
91
  "protocol": 1,
92
92
  "type": "plugin",
93
- "entry": "./plugin.ts",
93
+ "entry": "./plugin.js",
94
94
  "engine": "^1.0.0",
95
95
  "runtime": "trusted",
96
96
  "features": [
package/plugin.js ADDED
@@ -0,0 +1,16 @@
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 { registerWecomPlatformPermitChecker } from "./lib/platform-permit.js";
5
+ import { wecomRuntimeStateToken } from "./lib/wecom-runtime-state.js";
6
+ export default definePlugin({
7
+ name: 'wecom',
8
+ metadata: {
9
+ displayName: 'WeCom (企业微信) Adapter',
10
+ },
11
+ setup(context) {
12
+ // 运行中 endpoint 注册表(wecom endpoint list 的"运行中"数据源)
13
+ context.resources.provide(wecomRuntimeStateToken, createEndpointRuntimeState());
14
+ return registerWecomPlatformPermitChecker();
15
+ },
16
+ });
package/plugin.ts DELETED
@@ -1,16 +0,0 @@
1
- import { createEndpointRuntimeState } from '@zhin.js/adapter';
2
- import { definePlugin } from '@zhin.js/plugin-runtime';
3
- import { registerWecomPlatformPermitChecker } from './src/platform-permit.js';
4
- import { wecomRuntimeStateToken } from './src/wecom-runtime-state.js';
5
-
6
- export default definePlugin({
7
- name: 'wecom',
8
- metadata: {
9
- displayName: 'WeCom (企业微信) Adapter',
10
- },
11
- setup(context) {
12
- // 运行中 endpoint 注册表(wecom endpoint list 的"运行中"数据源)
13
- context.resources.provide(wecomRuntimeStateToken, createEndpointRuntimeState());
14
- return registerWecomPlatformPermitChecker();
15
- },
16
- });