@zhin.js/adapter-lark 6.0.14 → 7.0.0
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 +14 -0
- package/adapters/lark.js +1 -0
- package/adapters/lark.ts +1 -0
- package/lib/endpoint.d.ts +2 -1
- package/lib/endpoint.js +2 -0
- package/package.json +11 -11
- package/src/endpoint.ts +9 -1
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,19 @@
|
|
|
1
1
|
# @zhin.js/adapter-lark
|
|
2
2
|
|
|
3
|
+
## 7.0.0
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- f2c532f: Expose exact per-Endpoint message operations through one validated Adapter capability model, route Core control calls through declared active capabilities, and connect existing recall, edit, reaction, and typing implementations across platform adapters.
|
|
8
|
+
- Updated dependencies [b10d058]
|
|
9
|
+
- Updated dependencies [f2c532f]
|
|
10
|
+
- Updated dependencies [3dbf990]
|
|
11
|
+
- @zhin.js/host-http@1.0.12
|
|
12
|
+
- @zhin.js/adapter@1.2.0
|
|
13
|
+
- @zhin.js/core@1.5.13
|
|
14
|
+
- @zhin.js/agent@1.1.15
|
|
15
|
+
- zhin.js@6.0.13
|
|
16
|
+
|
|
3
17
|
## 6.0.14
|
|
4
18
|
|
|
5
19
|
### Patch Changes
|
package/adapters/lark.js
CHANGED
|
@@ -11,6 +11,7 @@ import { larkRuntimeStateToken } from "../lib/lark-runtime-state.js";
|
|
|
11
11
|
export { LarkEndpoint } from "../lib/endpoint.js";
|
|
12
12
|
export default defineAdapter({
|
|
13
13
|
capabilities: ['inbound', 'outbound'],
|
|
14
|
+
operations: ['recall'],
|
|
14
15
|
// image 段 canonical MediaRef 经 /im/v1/images 物化为 image_key
|
|
15
16
|
// (base64 解码 / path 读盘 / url 下载后上传,kind=file 平台引用直通);
|
|
16
17
|
// canonical Markdown 由 endpoint codec 转为 lark_md 消息卡片;
|
package/adapters/lark.ts
CHANGED
|
@@ -16,6 +16,7 @@ export type { LarkEndpointOptions, LarkFetch } from '../src/endpoint.js';
|
|
|
16
16
|
|
|
17
17
|
export default defineAdapter<LarkAdapterConfig>({
|
|
18
18
|
capabilities: ['inbound', 'outbound'],
|
|
19
|
+
operations: ['recall'],
|
|
19
20
|
// image 段 canonical MediaRef 经 /im/v1/images 物化为 image_key
|
|
20
21
|
// (base64 解码 / path 读盘 / url 下载后上传,kind=file 平台引用直通);
|
|
21
22
|
// canonical Markdown 由 endpoint codec 转为 lark_md 消息卡片;
|
package/lib/endpoint.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type
|
|
1
|
+
import { type EndpointControl, type EndpointInstance, type EndpointManagement, type EndpointSendRequest } from 'zhin.js/adapter';
|
|
2
2
|
import type { MessageGateway, SideEventGateway } from '@zhin.js/core/runtime';
|
|
3
3
|
import type { HttpHost } from '@zhin.js/host-http';
|
|
4
4
|
import type { CapabilityId } from 'zhin.js';
|
|
@@ -33,6 +33,7 @@ export declare class LarkEndpoint implements EndpointInstance {
|
|
|
33
33
|
* listChannels(无频道/guild 概念)、写操作(审批/踢人/禁言等本轮不在范围内)。
|
|
34
34
|
*/
|
|
35
35
|
readonly management: EndpointManagement;
|
|
36
|
+
readonly control: EndpointControl;
|
|
36
37
|
constructor(options: LarkEndpointOptions);
|
|
37
38
|
/** Used by webhook handler. */
|
|
38
39
|
get isOpen(): boolean;
|
package/lib/endpoint.js
CHANGED
|
@@ -3,6 +3,7 @@
|
|
|
3
3
|
*/
|
|
4
4
|
import { readFile } from 'node:fs/promises';
|
|
5
5
|
import { basename } from 'node:path';
|
|
6
|
+
import { createRecallEndpointControl, } from 'zhin.js/adapter';
|
|
6
7
|
import { formatCompact, getAdapterLogger } from '@zhin.js/logger';
|
|
7
8
|
import { registerLarkAgentEndpoint } from './lark-agent-deps.js';
|
|
8
9
|
import { buildImageUploadForm, readOutboundImageMedia, resolveMediaBinary, } from './media-upload.js';
|
|
@@ -38,6 +39,7 @@ export class LarkEndpoint {
|
|
|
38
39
|
},
|
|
39
40
|
listGroupMembers: (groupId) => this.#listAllPages(`/im/v1/chats/${encodeURIComponent(groupId)}/members`, { member_id_type: 'open_id' }),
|
|
40
41
|
});
|
|
42
|
+
control = createRecallEndpointControl((id) => this.recallMessage(id));
|
|
41
43
|
#routeReleases = [];
|
|
42
44
|
#accessToken = { token: '', expires_in: 0, timestamp: 0 };
|
|
43
45
|
#refreshPromise = null;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@zhin.js/adapter-lark",
|
|
3
|
-
"version": "
|
|
3
|
+
"version": "7.0.0",
|
|
4
4
|
"description": "Zhin.js Lark/Feishu (飞书) 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/lark"
|
|
35
35
|
},
|
|
36
36
|
"dependencies": {
|
|
37
|
-
"@zhin.js/adapter": "1.
|
|
38
|
-
"@zhin.js/core": "1.5.
|
|
39
|
-
"@zhin.js/host-http": "1.0.
|
|
37
|
+
"@zhin.js/adapter": "1.2.0",
|
|
38
|
+
"@zhin.js/core": "1.5.13",
|
|
39
|
+
"@zhin.js/host-http": "1.0.12",
|
|
40
40
|
"@zhin.js/im-contract": "1.0.4",
|
|
41
41
|
"@zhin.js/logger": "1.0.76"
|
|
42
42
|
},
|
|
43
43
|
"peerDependencies": {
|
|
44
44
|
"zod": "^4.0.0",
|
|
45
|
-
"@zhin.js/adapter": "1.
|
|
46
|
-
"@zhin.js/agent": "1.1.
|
|
45
|
+
"@zhin.js/adapter": "1.2.0",
|
|
46
|
+
"@zhin.js/agent": "1.1.15",
|
|
47
47
|
"@zhin.js/command": "1.0.15",
|
|
48
|
-
"@zhin.js/core": "1.5.
|
|
49
|
-
"@zhin.js/host-http": "1.0.
|
|
48
|
+
"@zhin.js/core": "1.5.13",
|
|
49
|
+
"@zhin.js/host-http": "1.0.12",
|
|
50
50
|
"@zhin.js/permission": "1.0.3",
|
|
51
|
-
"zhin.js": "6.0.
|
|
51
|
+
"zhin.js": "6.0.13"
|
|
52
52
|
},
|
|
53
53
|
"peerDependenciesMeta": {
|
|
54
54
|
"@zhin.js/agent": {
|
|
@@ -69,8 +69,8 @@
|
|
|
69
69
|
"typescript": "^6.0.3",
|
|
70
70
|
"vitest": "^4.1.10",
|
|
71
71
|
"zod": "^4.4.3",
|
|
72
|
-
"@zhin.js/agent": "1.1.
|
|
73
|
-
"zhin.js": "6.0.
|
|
72
|
+
"@zhin.js/agent": "1.1.15",
|
|
73
|
+
"zhin.js": "6.0.13"
|
|
74
74
|
},
|
|
75
75
|
"files": [
|
|
76
76
|
"adapters",
|
package/src/endpoint.ts
CHANGED
|
@@ -3,7 +3,14 @@
|
|
|
3
3
|
*/
|
|
4
4
|
import { readFile } from 'node:fs/promises';
|
|
5
5
|
import { basename } from 'node:path';
|
|
6
|
-
import
|
|
6
|
+
import {
|
|
7
|
+
createRecallEndpointControl,
|
|
8
|
+
type EndpointControl,
|
|
9
|
+
type EndpointGroup,
|
|
10
|
+
type EndpointInstance,
|
|
11
|
+
type EndpointManagement,
|
|
12
|
+
type EndpointSendRequest,
|
|
13
|
+
} from 'zhin.js/adapter';
|
|
7
14
|
import type { MessageGateway, SideEventGateway } from '@zhin.js/core/runtime';
|
|
8
15
|
import type { HttpHost, HttpRouteRegistration } from '@zhin.js/host-http';
|
|
9
16
|
import { formatCompact, getAdapterLogger } from '@zhin.js/logger';
|
|
@@ -86,6 +93,7 @@ export class LarkEndpoint implements EndpointInstance {
|
|
|
86
93
|
{ member_id_type: 'open_id' },
|
|
87
94
|
),
|
|
88
95
|
});
|
|
96
|
+
readonly control: EndpointControl = createRecallEndpointControl((id) => this.recallMessage(id));
|
|
89
97
|
#routeReleases: HttpRouteRegistration[] = [];
|
|
90
98
|
#accessToken: AccessToken = { token: '', expires_in: 0, timestamp: 0 };
|
|
91
99
|
#refreshPromise: Promise<string> | null = null;
|