@zhin.js/adapter-icqq 1.1.18 → 1.1.19
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 +37 -0
- package/README.md +12 -8
- package/adapters/icqq/index.js +4 -28
- package/adapters/icqq/index.ts +3 -34
- package/commands/icqq/endpoint/definition.js +3 -25
- package/commands/icqq/endpoint/definition.ts +3 -24
- package/commands/icqq/login/code/index.js +3 -3
- package/commands/icqq/login/code/index.ts +3 -3
- package/commands/icqq/login/confirm/index.js +3 -3
- package/commands/icqq/login/confirm/index.ts +3 -3
- package/commands/icqq/login/definition.js +2 -2
- package/commands/icqq/login/definition.ts +2 -2
- package/commands/icqq/login/qr/index.js +3 -3
- package/commands/icqq/login/qr/index.ts +3 -3
- package/commands/icqq/login/retry/index.js +3 -3
- package/commands/icqq/login/retry/index.ts +3 -3
- package/commands/icqq/login/status/index.js +3 -3
- package/commands/icqq/login/status/index.ts +3 -3
- package/lib/adapter.d.ts +13 -0
- package/lib/adapter.js +27 -0
- package/lib/client.d.ts +6 -9
- package/lib/client.js +1 -3
- package/lib/console-spec.js +11 -1
- package/lib/console.d.ts +1 -7
- package/lib/console.js +2 -5
- package/lib/endpoint.d.ts +6 -16
- package/lib/endpoint.js +195 -143
- package/lib/group-moderation.d.ts +6 -3
- package/lib/group-moderation.js +9 -8
- package/lib/group-scene.d.ts +3 -3
- package/lib/group-scene.js +8 -7
- package/lib/icqq-login-assist.d.ts +3 -1
- package/lib/icqq-login-assist.js +3 -1
- package/lib/icqq-login-control.d.ts +8 -2
- package/lib/icqq-login-control.js +22 -5
- package/lib/index.d.ts +2 -1
- package/lib/index.js +1 -1
- package/lib/protocol.d.ts +3 -0
- package/package.json +18 -18
- package/plugin.js +1 -8
- package/src/adapter.ts +29 -0
- package/src/client.ts +6 -11
- package/src/console-spec.ts +9 -0
- package/src/console.ts +2 -6
- package/src/endpoint.ts +205 -153
- package/src/group-moderation.ts +10 -10
- package/src/group-scene.ts +8 -8
- package/src/icqq-login-assist.ts +6 -2
- package/src/icqq-login-control.ts +20 -8
- package/src/index.ts +2 -1
- package/src/protocol.ts +3 -0
- package/lib/icqq-runtime-state.d.ts +0 -1
- package/lib/icqq-runtime-state.js +0 -6
- package/src/icqq-runtime-state.ts +0 -7
package/lib/console.js
CHANGED
|
@@ -4,13 +4,10 @@
|
|
|
4
4
|
* 页面绑定 `pages/index`,读取 / 写入分别要求 `<adapter>:read` / `<adapter>:write`。
|
|
5
5
|
*/
|
|
6
6
|
import { createAdapterConsoleRpc } from 'zhin.js/adapter';
|
|
7
|
-
import { icqqRuntimeStateToken } from './icqq-runtime-state.js';
|
|
8
7
|
import { icqqConsoleSpec } from './console-spec.js';
|
|
9
|
-
export function createIcqqConsoleRpc(
|
|
10
|
-
const state = resources.use(icqqRuntimeStateToken);
|
|
8
|
+
export function createIcqqConsoleRpc(getConfig) {
|
|
11
9
|
return createAdapterConsoleRpc({
|
|
12
10
|
...icqqConsoleSpec,
|
|
13
|
-
running: () => state.endpoints.values(),
|
|
14
11
|
getConfig,
|
|
15
|
-
}
|
|
12
|
+
});
|
|
16
13
|
}
|
package/lib/endpoint.d.ts
CHANGED
|
@@ -1,8 +1,5 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
3
|
-
import type { EndpointContentPort } from '@zhin.js/adapter';
|
|
4
|
-
import { type LoginAssist } from '@zhin.js/core';
|
|
5
|
-
import { type EndpointSendResult } from '@zhin.js/im-contract';
|
|
1
|
+
import { endpointSpec, type Endpoint, type EndpointSpecification, type AdapterOutageNotifier } from 'zhin.js/adapter';
|
|
2
|
+
import { type LoginAssist, type LoginAssistEndpointIdentity } from '@zhin.js/core';
|
|
6
3
|
import type { CapabilityId } from 'zhin.js';
|
|
7
4
|
import type { IcqqLoginControl } from './icqq-login-control.js';
|
|
8
5
|
import { type IcqqInboundMessage, type ResolvedIcqqConfig } from './protocol.js';
|
|
@@ -10,27 +7,20 @@ import { ManagedIcqqClient } from './managed-client.js';
|
|
|
10
7
|
export interface IcqqEndpointOptions {
|
|
11
8
|
readonly id: CapabilityId;
|
|
12
9
|
readonly config: ResolvedIcqqConfig;
|
|
10
|
+
readonly signal?: AbortSignal;
|
|
11
|
+
readonly endpointIdentity?: LoginAssistEndpointIdentity;
|
|
13
12
|
readonly loginAssist: LoginAssist;
|
|
14
13
|
readonly locale?: import('zhin.js/i18n').Locale;
|
|
15
14
|
/** Out-of-band outage notifier; absent in tests/hosts without outbound. */
|
|
16
15
|
readonly notifier?: AdapterOutageNotifier;
|
|
17
16
|
}
|
|
18
|
-
export declare class IcqqEndpoint extends Endpoint
|
|
17
|
+
export declare class IcqqEndpoint extends ManagedIcqqClient implements Endpoint {
|
|
19
18
|
#private;
|
|
20
|
-
readonly
|
|
19
|
+
readonly [endpointSpec]: EndpointSpecification;
|
|
21
20
|
readonly endpointName: string;
|
|
22
|
-
readonly content: EndpointContentPort;
|
|
23
21
|
readonly loginControl: IcqqLoginControl;
|
|
24
|
-
readonly management: EndpointManagement;
|
|
25
|
-
readonly control: EndpointControl;
|
|
26
22
|
constructor(options: IcqqEndpointOptions);
|
|
27
23
|
/** Force a login attempt (manual recovery command). */
|
|
28
24
|
relogin(): Promise<void>;
|
|
29
|
-
get transportState(): EndpointTransportState;
|
|
30
|
-
start(signal: AbortSignal): Promise<void>;
|
|
31
|
-
open(): void;
|
|
32
|
-
close(): Promise<void>;
|
|
33
|
-
stop(): Promise<void>;
|
|
34
|
-
send({ conversation, payload }: EndpointSendRequest): Promise<EndpointSendResult>;
|
|
35
25
|
admit(msg: IcqqInboundMessage): Promise<void>;
|
|
36
26
|
}
|