@zhin.js/adapter-icqq 8.0.10 → 8.0.11
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 +12 -0
- package/adapters/icqq.js +2 -2
- package/adapters/icqq.ts +2 -2
- package/lib/endpoint.d.ts +2 -2
- package/lib/icqq-endpoint-commands.js +2 -2
- package/lib/icqq-runtime-state.js +1 -1
- package/lib/protocol.js +1 -1
- package/package.json +11 -14
- package/plugin.js +2 -2
- package/src/endpoint.ts +2 -2
- package/src/icqq-endpoint-commands.ts +2 -2
- package/src/icqq-runtime-state.ts +1 -1
- package/src/protocol.ts +1 -1
- package/src/icqqjs-icqq.d.ts +0 -88
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,17 @@
|
|
|
1
1
|
# @zhin.js/adapter-icqq
|
|
2
2
|
|
|
3
|
+
## 8.0.11
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- eb84b77: fix: 更新文档,建立正确的依赖关系
|
|
8
|
+
- Updated dependencies [d3920e9]
|
|
9
|
+
- @zhin.js/core@1.5.10
|
|
10
|
+
- zhin.js@6.0.10
|
|
11
|
+
- @zhin.js/adapter@1.1.10
|
|
12
|
+
- @zhin.js/tool@1.0.11
|
|
13
|
+
- @zhin.js/agent@1.1.11
|
|
14
|
+
|
|
3
15
|
## 8.0.10
|
|
4
16
|
|
|
5
17
|
### Patch Changes
|
package/adapters/icqq.js
CHANGED
|
@@ -2,10 +2,10 @@
|
|
|
2
2
|
/**
|
|
3
3
|
* Convention entry: discover `adapters/icqq.ts` → defineAdapter.
|
|
4
4
|
*/
|
|
5
|
-
import { defineAdapter } from '
|
|
5
|
+
import { defineAdapter } from 'zhin.js/adapter';
|
|
6
6
|
import { messageGatewayToken } from '@zhin.js/core/runtime';
|
|
7
7
|
import { formatCompact, getLogger } from '@zhin.js/logger';
|
|
8
|
-
import { databaseHostToken, INBOX_TABLE_NOTICE, INBOX_TABLE_REQUEST, runtimeEventPublisherToken, } from '
|
|
8
|
+
import { databaseHostToken, INBOX_TABLE_NOTICE, INBOX_TABLE_REQUEST, runtimeEventPublisherToken, } from 'zhin.js';
|
|
9
9
|
import { IcqqEndpoint } from "../lib/endpoint.js";
|
|
10
10
|
import { icqqRuntimeStateToken } from "../lib/icqq-runtime-state.js";
|
|
11
11
|
import { resolveIcqqConfig, } from "../lib/protocol.js";
|
package/adapters/icqq.ts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* Convention entry: discover `adapters/icqq.ts` → defineAdapter.
|
|
3
3
|
*/
|
|
4
|
-
import { defineAdapter, type AdapterContext } from '
|
|
4
|
+
import { defineAdapter, type AdapterContext } from 'zhin.js/adapter';
|
|
5
5
|
import { messageGatewayToken } from '@zhin.js/core/runtime';
|
|
6
6
|
import { formatCompact, getLogger } from '@zhin.js/logger';
|
|
7
7
|
import {
|
|
@@ -10,7 +10,7 @@ import {
|
|
|
10
10
|
INBOX_TABLE_REQUEST,
|
|
11
11
|
runtimeEventPublisherToken,
|
|
12
12
|
type Token,
|
|
13
|
-
} from '
|
|
13
|
+
} from 'zhin.js';
|
|
14
14
|
import { IcqqEndpoint, type IcqqInboxHooks } from '../src/endpoint.js';
|
|
15
15
|
import { icqqRuntimeStateToken } from '../src/icqq-runtime-state.js';
|
|
16
16
|
import {
|
package/lib/endpoint.d.ts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { Client } from '@icqqjs/icqq';
|
|
2
|
-
import type { EndpointControl, EndpointInstance, EndpointManagement, EndpointSendRequest } from '
|
|
2
|
+
import type { EndpointControl, EndpointInstance, EndpointManagement, EndpointSendRequest } from 'zhin.js/adapter';
|
|
3
3
|
import type { MessageGateway } from '@zhin.js/core/runtime';
|
|
4
|
-
import type { CapabilityId } from '
|
|
4
|
+
import type { CapabilityId } from 'zhin.js';
|
|
5
5
|
import { type IcqqInboundMessage, type ResolvedIcqqConfig } from './protocol.js';
|
|
6
6
|
export interface IcqqInboxHooks {
|
|
7
7
|
recordRequest(row: Record<string, unknown>): void | Promise<void>;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { addEndpointToConfig, createEndpointCommands } from '
|
|
2
|
-
import { defineCommand } from '
|
|
1
|
+
import { addEndpointToConfig, createEndpointCommands } from 'zhin.js/adapter';
|
|
2
|
+
import { defineCommand } from 'zhin.js/command';
|
|
3
3
|
import { icqqRuntimeStateToken } from './icqq-runtime-state.js';
|
|
4
4
|
export const icqqEndpointCommands = createEndpointCommands({
|
|
5
5
|
adapterKey: 'icqq',
|
|
@@ -2,5 +2,5 @@
|
|
|
2
2
|
* ICQQ 插件实例的运行时状态:adapter create() 注册的 endpoint 列表。
|
|
3
3
|
* 由 plugin.ts setup() provide,adapter create 与 `icqq.endpoint` 命令共享(同一 owner generation)。
|
|
4
4
|
*/
|
|
5
|
-
import { defineEndpointRuntimeStateToken } from '
|
|
5
|
+
import { defineEndpointRuntimeStateToken } from 'zhin.js/adapter';
|
|
6
6
|
export const icqqRuntimeStateToken = defineEndpointRuntimeStateToken('icqq');
|
package/lib/protocol.js
CHANGED
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@zhin.js/adapter-icqq",
|
|
3
|
-
"version": "8.0.
|
|
3
|
+
"version": "8.0.11",
|
|
4
4
|
"description": "Zhin.js ICQQ adapter — direct connection to @icqqjs/icqq",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "./lib/index.js",
|
|
@@ -34,23 +34,20 @@
|
|
|
34
34
|
"directory": "plugins/adapters/icqq"
|
|
35
35
|
},
|
|
36
36
|
"dependencies": {
|
|
37
|
-
"@zhin.js/adapter": "1.1.
|
|
38
|
-
"@zhin.js/
|
|
39
|
-
"@zhin.js/core": "1.5.9",
|
|
40
|
-
"@zhin.js/tool": "1.0.10",
|
|
37
|
+
"@zhin.js/adapter": "1.1.10",
|
|
38
|
+
"@zhin.js/core": "1.5.10",
|
|
41
39
|
"@zhin.js/im-contract": "1.0.3",
|
|
40
|
+
"@zhin.js/logger": "1.0.76",
|
|
42
41
|
"@zhin.js/permission": "1.0.2",
|
|
43
|
-
"@zhin.js/
|
|
44
|
-
"@zhin.js/logger": "1.0.76"
|
|
42
|
+
"@zhin.js/tool": "1.0.11"
|
|
45
43
|
},
|
|
46
44
|
"peerDependencies": {
|
|
47
45
|
"@icqqjs/icqq": "^1.12.2",
|
|
48
46
|
"zod": "^4.0.0",
|
|
49
|
-
"@zhin.js/adapter": "1.1.
|
|
50
|
-
"@zhin.js/agent": "1.1.
|
|
51
|
-
"@zhin.js/core": "1.5.
|
|
52
|
-
"
|
|
53
|
-
"zhin.js": "6.0.9"
|
|
47
|
+
"@zhin.js/adapter": "1.1.10",
|
|
48
|
+
"@zhin.js/agent": "1.1.11",
|
|
49
|
+
"@zhin.js/core": "1.5.10",
|
|
50
|
+
"zhin.js": "6.0.10"
|
|
54
51
|
},
|
|
55
52
|
"peerDependenciesMeta": {
|
|
56
53
|
"zhin.js": {
|
|
@@ -72,8 +69,8 @@
|
|
|
72
69
|
"typescript": "^6.0.3",
|
|
73
70
|
"vitest": "^4.1.10",
|
|
74
71
|
"zod": "^4.4.3",
|
|
75
|
-
"@zhin.js/agent": "1.1.
|
|
76
|
-
"zhin.js": "6.0.
|
|
72
|
+
"@zhin.js/agent": "1.1.11",
|
|
73
|
+
"zhin.js": "6.0.10"
|
|
77
74
|
},
|
|
78
75
|
"files": [
|
|
79
76
|
"adapters",
|
package/plugin.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
// Generated by build-plugin-runtime-entries.mjs. Do not edit.
|
|
2
|
-
import { createEndpointRuntimeState } from '
|
|
3
|
-
import { definePlugin } from '
|
|
2
|
+
import { createEndpointRuntimeState } from 'zhin.js/adapter';
|
|
3
|
+
import { definePlugin } from 'zhin.js';
|
|
4
4
|
import { permissionHostToken, createSceneRolePlatformChecker } from '@zhin.js/permission';
|
|
5
5
|
import { icqqRuntimeStateToken } from "./lib/icqq-runtime-state.js";
|
|
6
6
|
// Module-level guard: multiple icqq instances (icqq, icqq-2, …) share this
|
package/src/endpoint.ts
CHANGED
|
@@ -10,11 +10,11 @@ import type {
|
|
|
10
10
|
EndpointInstance,
|
|
11
11
|
EndpointManagement,
|
|
12
12
|
EndpointSendRequest,
|
|
13
|
-
} from '
|
|
13
|
+
} from 'zhin.js/adapter';
|
|
14
14
|
import type { MessageGateway } from '@zhin.js/core/runtime';
|
|
15
15
|
import type { MessageRef } from '@zhin.js/im-contract';
|
|
16
16
|
import { formatCompact, getAdapterLogger, truncatePreview } from '@zhin.js/logger';
|
|
17
|
-
import type { CapabilityId } from '
|
|
17
|
+
import type { CapabilityId } from 'zhin.js';
|
|
18
18
|
import { registerIcqqAgentEndpoint } from './icqq-agent-deps.js';
|
|
19
19
|
import {
|
|
20
20
|
InboundMessageDeduper,
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { addEndpointToConfig, createEndpointCommands } from '
|
|
2
|
-
import { defineCommand } from '
|
|
1
|
+
import { addEndpointToConfig, createEndpointCommands } from 'zhin.js/adapter';
|
|
2
|
+
import { defineCommand } from 'zhin.js/command';
|
|
3
3
|
import { icqqRuntimeStateToken } from './icqq-runtime-state.js';
|
|
4
4
|
|
|
5
5
|
export const icqqEndpointCommands = createEndpointCommands({
|
|
@@ -2,6 +2,6 @@
|
|
|
2
2
|
* ICQQ 插件实例的运行时状态:adapter create() 注册的 endpoint 列表。
|
|
3
3
|
* 由 plugin.ts setup() provide,adapter create 与 `icqq.endpoint` 命令共享(同一 owner generation)。
|
|
4
4
|
*/
|
|
5
|
-
import { defineEndpointRuntimeStateToken } from '
|
|
5
|
+
import { defineEndpointRuntimeStateToken } from 'zhin.js/adapter';
|
|
6
6
|
|
|
7
7
|
export const icqqRuntimeStateToken = defineEndpointRuntimeStateToken('icqq');
|
package/src/protocol.ts
CHANGED
package/src/icqqjs-icqq.d.ts
DELETED
|
@@ -1,88 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Fallback types when `@icqqjs/icqq` peer is not installed.
|
|
3
|
-
* Prefer package types when the real dependency is present.
|
|
4
|
-
*/
|
|
5
|
-
declare module '@icqqjs/icqq' {
|
|
6
|
-
export interface Config extends Record<string, unknown> {
|
|
7
|
-
sign_api_addr?: string;
|
|
8
|
-
ver?: string;
|
|
9
|
-
platform?: number;
|
|
10
|
-
auto_server?: boolean;
|
|
11
|
-
autoReconnect?: boolean;
|
|
12
|
-
}
|
|
13
|
-
|
|
14
|
-
export type Sendable = string | Record<string, unknown> | unknown[];
|
|
15
|
-
|
|
16
|
-
export interface ParsedGroupMessageId {
|
|
17
|
-
group_id: number;
|
|
18
|
-
user_id: number;
|
|
19
|
-
seq: number;
|
|
20
|
-
rand: number;
|
|
21
|
-
time: number;
|
|
22
|
-
pktnum: number;
|
|
23
|
-
}
|
|
24
|
-
|
|
25
|
-
export function parseGroupMessageId(msgid: string): ParsedGroupMessageId;
|
|
26
|
-
|
|
27
|
-
export interface GroupHandle {
|
|
28
|
-
setReaction(seq: number, emoji: string): Promise<unknown>;
|
|
29
|
-
delReaction(seq: number, reactionId: string): Promise<unknown>;
|
|
30
|
-
}
|
|
31
|
-
|
|
32
|
-
export interface FriendInfo {
|
|
33
|
-
user_id: number;
|
|
34
|
-
nickname: string;
|
|
35
|
-
remark?: string;
|
|
36
|
-
}
|
|
37
|
-
|
|
38
|
-
export interface GroupInfo {
|
|
39
|
-
group_id: number;
|
|
40
|
-
group_name: string;
|
|
41
|
-
}
|
|
42
|
-
|
|
43
|
-
export interface GroupMemberInfo {
|
|
44
|
-
user_id: number;
|
|
45
|
-
nickname?: string;
|
|
46
|
-
card?: string;
|
|
47
|
-
role?: string;
|
|
48
|
-
}
|
|
49
|
-
|
|
50
|
-
export class Client {
|
|
51
|
-
uin: number;
|
|
52
|
-
fl: Map<number, FriendInfo>;
|
|
53
|
-
gl: Map<number, GroupInfo>;
|
|
54
|
-
config: Config;
|
|
55
|
-
dir?: string;
|
|
56
|
-
status?: number;
|
|
57
|
-
|
|
58
|
-
constructor(uin?: number | Config, config?: Config);
|
|
59
|
-
|
|
60
|
-
on(event: string, listener: (...args: unknown[]) => void): this;
|
|
61
|
-
off(event: string, listener?: (...args: unknown[]) => void): this;
|
|
62
|
-
emit(event: string, ...args: unknown[]): boolean;
|
|
63
|
-
|
|
64
|
-
login(password?: string | number): Promise<void>;
|
|
65
|
-
logout?(keepalive?: boolean): Promise<void>;
|
|
66
|
-
terminate(): void;
|
|
67
|
-
|
|
68
|
-
sendPrivateMsg(userId: number, message: Sendable): Promise<{ message_id?: unknown }>;
|
|
69
|
-
sendGroupMsg(groupId: number, message: Sendable): Promise<{ message_id?: unknown }>;
|
|
70
|
-
sendTempMsg(groupId: number, userId: number, message: Sendable): Promise<{ message_id?: unknown }>;
|
|
71
|
-
sendGuildMsg(guildId: string, channelId: string, message: Sendable): Promise<{ message_id?: unknown }>;
|
|
72
|
-
|
|
73
|
-
deleteMsg(messageId: string): Promise<boolean>;
|
|
74
|
-
getSystemMsg(): Promise<unknown[]>;
|
|
75
|
-
setFriendAddRequest(flag: string, approve: boolean, remark?: string): Promise<boolean>;
|
|
76
|
-
setGroupAddRequest(flag: string, approve: boolean, reason?: string): Promise<boolean>;
|
|
77
|
-
deleteFriend(userId: number): Promise<boolean>;
|
|
78
|
-
setGroupKick(groupId: number, userId: number): Promise<boolean>;
|
|
79
|
-
setGroupBan(groupId: number, userId: number, duration: number): Promise<boolean>;
|
|
80
|
-
setGroupAdmin(groupId: number, userId: number, enabled: boolean): Promise<boolean>;
|
|
81
|
-
getGroupMemberList(groupId: number): Promise<Map<number, GroupMemberInfo>>;
|
|
82
|
-
|
|
83
|
-
getGuildList(): Array<{ guild_id: string; guild_name: string }>;
|
|
84
|
-
getChannelList(guildId: string): Array<{ guild_id: string; channel_id: string; channel_name: string }>;
|
|
85
|
-
|
|
86
|
-
pickGroup(groupId: number): GroupHandle;
|
|
87
|
-
}
|
|
88
|
-
}
|