@zhin.js/adapter-line 3.0.1 → 3.0.2
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 +18 -0
- package/adapters/line.js +33 -0
- package/commands/endpoint/add/[name:string].js +3 -0
- package/commands/endpoint/list.js +3 -0
- package/commands/endpoint/remove/[name:string].js +3 -0
- package/package.json +11 -11
- package/plugin.js +14 -0
- package/plugin.ts +0 -14
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,23 @@
|
|
|
1
1
|
# @zhin.js/adapter-line
|
|
2
2
|
|
|
3
|
+
## 3.0.2
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- d5cd4aa: Publish Plugin Runtime entry points and convention modules as JavaScript so
|
|
8
|
+
installed npm plugins load on Node without TypeScript stripping. Workspace
|
|
9
|
+
development continues to prefer TypeScript sources for local HMR.
|
|
10
|
+
|
|
11
|
+
Remove the unconsumed legacy game hub APIs from game-kit; game navigation and
|
|
12
|
+
records now use ordinary convention commands owned by the game hub plugin.
|
|
13
|
+
|
|
14
|
+
- Updated dependencies [d5cd4aa]
|
|
15
|
+
- @zhin.js/command@1.0.4
|
|
16
|
+
- zhin.js@5.0.2
|
|
17
|
+
- @zhin.js/adapter@1.1.2
|
|
18
|
+
- @zhin.js/core@1.4.2
|
|
19
|
+
- @zhin.js/agent@1.0.7
|
|
20
|
+
|
|
3
21
|
## 3.0.1
|
|
4
22
|
|
|
5
23
|
### Patch Changes
|
package/adapters/line.js
ADDED
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
// Generated by build-plugin-runtime-entries.mjs. Do not edit.
|
|
2
|
+
/**
|
|
3
|
+
* Convention entry: discover `adapters/line.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 { LineEndpoint } from "../lib/endpoint.js";
|
|
9
|
+
import { resolveLineConfig, } from "../lib/protocol.js";
|
|
10
|
+
import { lineRuntimeStateToken } from "../lib/line-runtime-state.js";
|
|
11
|
+
export { LineEndpoint } from "../lib/endpoint.js";
|
|
12
|
+
export default defineAdapter({
|
|
13
|
+
capabilities: ['inbound', 'outbound'],
|
|
14
|
+
// LINE Messaging API 媒体消息仅消费远程 URL;无按钮交互面,交互段降级纯文本。
|
|
15
|
+
segments: {
|
|
16
|
+
outboundMedia: ['url'],
|
|
17
|
+
interactive: 'text',
|
|
18
|
+
},
|
|
19
|
+
create(context) {
|
|
20
|
+
const config = resolveLineConfig(context.config);
|
|
21
|
+
// 注册到插件运行时状态(line endpoint list 的"运行中"数据源)
|
|
22
|
+
context.use(lineRuntimeStateToken).endpoints.set(config.name, {
|
|
23
|
+
name: config.name,
|
|
24
|
+
mode: 'webhook',
|
|
25
|
+
});
|
|
26
|
+
return new LineEndpoint({
|
|
27
|
+
id: context.id,
|
|
28
|
+
gateway: context.use(messageGatewayToken),
|
|
29
|
+
http: context.use(httpHostToken),
|
|
30
|
+
config,
|
|
31
|
+
});
|
|
32
|
+
},
|
|
33
|
+
});
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@zhin.js/adapter-line",
|
|
3
|
-
"version": "3.0.
|
|
3
|
+
"version": "3.0.2",
|
|
4
4
|
"description": "Zhin.js LINE Messaging API adapter for Plugin Runtime (HTTP webhook)",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "./lib/index.js",
|
|
@@ -32,21 +32,21 @@
|
|
|
32
32
|
"directory": "plugins/adapters/line"
|
|
33
33
|
},
|
|
34
34
|
"dependencies": {
|
|
35
|
-
"@zhin.js/adapter": "1.1.
|
|
36
|
-
"@zhin.js/command": "1.0.
|
|
37
|
-
"@zhin.js/core": "1.4.
|
|
35
|
+
"@zhin.js/adapter": "1.1.2",
|
|
36
|
+
"@zhin.js/command": "1.0.4",
|
|
37
|
+
"@zhin.js/core": "1.4.2",
|
|
38
38
|
"@zhin.js/host-http": "1.0.3",
|
|
39
39
|
"@zhin.js/logger": "1.0.75",
|
|
40
40
|
"@zhin.js/plugin-runtime": "1.1.1"
|
|
41
41
|
},
|
|
42
42
|
"peerDependencies": {
|
|
43
43
|
"zod": "^4.0.0",
|
|
44
|
-
"@zhin.js/adapter": "1.1.
|
|
45
|
-
"@zhin.js/agent": "1.0.
|
|
46
|
-
"@zhin.js/core": "1.4.
|
|
44
|
+
"@zhin.js/adapter": "1.1.2",
|
|
45
|
+
"@zhin.js/agent": "1.0.7",
|
|
46
|
+
"@zhin.js/core": "1.4.2",
|
|
47
47
|
"@zhin.js/host-http": "1.0.3",
|
|
48
48
|
"@zhin.js/plugin-runtime": "1.1.1",
|
|
49
|
-
"zhin.js": "5.0.
|
|
49
|
+
"zhin.js": "5.0.2"
|
|
50
50
|
},
|
|
51
51
|
"peerDependenciesMeta": {
|
|
52
52
|
"zhin.js": {
|
|
@@ -64,12 +64,12 @@
|
|
|
64
64
|
"typescript": "^6.0.3",
|
|
65
65
|
"vitest": "^4.1.10",
|
|
66
66
|
"zod": "^4.4.3",
|
|
67
|
-
"@zhin.js/agent": "1.0.
|
|
67
|
+
"@zhin.js/agent": "1.0.7"
|
|
68
68
|
},
|
|
69
69
|
"files": [
|
|
70
70
|
"adapters",
|
|
71
71
|
"commands",
|
|
72
|
-
"plugin.
|
|
72
|
+
"plugin.js",
|
|
73
73
|
"schema.json",
|
|
74
74
|
"src",
|
|
75
75
|
"lib",
|
|
@@ -87,7 +87,7 @@
|
|
|
87
87
|
"zhin": {
|
|
88
88
|
"protocol": 1,
|
|
89
89
|
"type": "plugin",
|
|
90
|
-
"entry": "./plugin.
|
|
90
|
+
"entry": "./plugin.js",
|
|
91
91
|
"engine": "^1.0.0",
|
|
92
92
|
"runtime": "trusted",
|
|
93
93
|
"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 { lineRuntimeStateToken } from "./lib/line-runtime-state.js";
|
|
5
|
+
export default definePlugin({
|
|
6
|
+
name: 'line',
|
|
7
|
+
metadata: {
|
|
8
|
+
displayName: 'LINE Messaging API Adapter',
|
|
9
|
+
},
|
|
10
|
+
setup(context) {
|
|
11
|
+
// 运行中 endpoint 注册表(line endpoint list 的"运行中"数据源)
|
|
12
|
+
context.resources.provide(lineRuntimeStateToken, 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 { lineRuntimeStateToken } from './src/line-runtime-state.js';
|
|
4
|
-
|
|
5
|
-
export default definePlugin({
|
|
6
|
-
name: 'line',
|
|
7
|
-
metadata: {
|
|
8
|
-
displayName: 'LINE Messaging API Adapter',
|
|
9
|
-
},
|
|
10
|
-
setup(context) {
|
|
11
|
-
// 运行中 endpoint 注册表(line endpoint list 的"运行中"数据源)
|
|
12
|
-
context.resources.provide(lineRuntimeStateToken, createEndpointRuntimeState());
|
|
13
|
-
},
|
|
14
|
-
});
|