@zhin.js/adapter-weixin-ilink 1.0.0 → 1.1.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 +453 -0
- package/README.md +18 -41
- package/adapters/weixin-ilink.js +32 -0
- package/adapters/weixin-ilink.ts +43 -0
- package/commands/endpoint/add/[id].js +3 -0
- package/commands/endpoint/add/[id].ts +3 -0
- package/commands/endpoint/list.js +3 -0
- package/commands/endpoint/list.ts +3 -0
- package/commands/endpoint/remove/[id].js +3 -0
- package/commands/endpoint/remove/[id].ts +3 -0
- package/lib/aes-ecb.d.ts +0 -1
- package/lib/aes-ecb.js +0 -1
- package/lib/cdn-upload.d.ts +0 -1
- package/lib/cdn-upload.js +0 -1
- package/lib/cdn-url.d.ts +0 -1
- package/lib/cdn-url.js +0 -1
- package/lib/client.d.ts +34 -0
- package/lib/client.js +72 -0
- package/lib/context-store.d.ts +1 -2
- package/lib/context-store.js +1 -2
- package/lib/credentials.d.ts +6 -7
- package/lib/credentials.js +12 -13
- package/lib/endpoint.d.ts +37 -0
- package/lib/endpoint.js +418 -0
- package/lib/ilink-api.d.ts +1 -1
- package/lib/ilink-api.js +5 -2
- package/lib/ilink-config-cache.d.ts +0 -1
- package/lib/ilink-config-cache.js +0 -1
- package/lib/ilink-logger.d.ts +0 -1
- package/lib/ilink-logger.js +0 -1
- package/lib/ilink-meta.d.ts +0 -1
- package/lib/ilink-meta.js +0 -1
- package/lib/ilink-random.d.ts +0 -1
- package/lib/ilink-random.js +0 -1
- package/lib/ilink-redact.d.ts +0 -1
- package/lib/ilink-redact.js +0 -1
- package/lib/ilink-session-guard.d.ts +0 -1
- package/lib/ilink-session-guard.js +0 -1
- package/lib/ilink-types.d.ts +0 -1
- package/lib/ilink-types.js +0 -1
- package/lib/index.d.ts +5 -20
- package/lib/index.js +3 -38
- package/lib/login.d.ts +4 -6
- package/lib/login.js +73 -68
- package/lib/media-download.d.ts +1 -2
- package/lib/media-download.js +1 -2
- package/lib/mime.d.ts +0 -1
- package/lib/mime.js +0 -1
- package/lib/outbound-media.d.ts +4 -5
- package/lib/outbound-media.js +85 -86
- package/lib/pic-decrypt.d.ts +0 -1
- package/lib/pic-decrypt.js +0 -1
- package/lib/protocol.d.ts +63 -0
- package/lib/protocol.js +127 -0
- package/lib/silk-transcode.d.ts +0 -1
- package/lib/silk-transcode.js +0 -1
- package/lib/types.d.ts +2 -26
- package/lib/types.js +0 -1
- package/lib/upload.d.ts +1 -2
- package/lib/upload.js +1 -2
- package/lib/weixin-ilink-endpoint-commands.d.ts +1 -0
- package/lib/weixin-ilink-endpoint-commands.js +16 -0
- package/lib/weixin-ilink-runtime-state.d.ts +1 -0
- package/lib/weixin-ilink-runtime-state.js +6 -0
- package/lib/weixin-inbound.d.ts +10 -3
- package/lib/weixin-inbound.js +46 -23
- package/lib/weixin-send-media.d.ts +0 -1
- package/lib/weixin-send-media.js +0 -1
- package/lib/weixin-send.d.ts +1 -2
- package/lib/weixin-send.js +2 -3
- package/package.json +48 -35
- package/plugin.js +14 -0
- package/schema.json +88 -0
- package/src/client.ts +85 -0
- package/src/context-store.ts +2 -0
- package/src/credentials.ts +12 -12
- package/src/endpoint.ts +531 -0
- package/src/ilink-api.ts +5 -1
- package/src/index.ts +28 -56
- package/src/login.ts +89 -75
- package/src/media-download.ts +1 -2
- package/src/outbound-media.ts +97 -97
- package/src/protocol.ts +189 -0
- package/src/silk-wasm.d.ts +6 -2
- package/src/types.ts +6 -25
- package/src/upload.ts +2 -2
- package/src/weixin-ilink-endpoint-commands.ts +17 -0
- package/src/weixin-ilink-runtime-state.ts +7 -0
- package/src/weixin-inbound.ts +48 -18
- package/src/weixin-send.ts +4 -4
- package/client/LoginAssistPanel.tsx +0 -200
- package/client/WeixinIlinkManagement.tsx +0 -139
- package/client/index.tsx +0 -11
- package/client/tsconfig.json +0 -13
- package/client/utils/api.ts +0 -30
- package/dist/index.js +0 -29
- package/lib/adapter.d.ts +0 -11
- package/lib/adapter.d.ts.map +0 -1
- package/lib/adapter.js +0 -14
- package/lib/adapter.js.map +0 -1
- package/lib/aes-ecb.d.ts.map +0 -1
- package/lib/aes-ecb.js.map +0 -1
- package/lib/bot.d.ts +0 -37
- package/lib/bot.d.ts.map +0 -1
- package/lib/bot.js +0 -383
- package/lib/bot.js.map +0 -1
- package/lib/cdn-upload.d.ts.map +0 -1
- package/lib/cdn-upload.js.map +0 -1
- package/lib/cdn-upload.test.d.ts +0 -2
- package/lib/cdn-upload.test.d.ts.map +0 -1
- package/lib/cdn-upload.test.js +0 -150
- package/lib/cdn-upload.test.js.map +0 -1
- package/lib/cdn-url.d.ts.map +0 -1
- package/lib/cdn-url.js.map +0 -1
- package/lib/context-store.d.ts.map +0 -1
- package/lib/context-store.js.map +0 -1
- package/lib/credentials.d.ts.map +0 -1
- package/lib/credentials.js.map +0 -1
- package/lib/ilink-api.d.ts.map +0 -1
- package/lib/ilink-api.js.map +0 -1
- package/lib/ilink-config-cache.d.ts.map +0 -1
- package/lib/ilink-config-cache.js.map +0 -1
- package/lib/ilink-logger.d.ts.map +0 -1
- package/lib/ilink-logger.js.map +0 -1
- package/lib/ilink-meta.d.ts.map +0 -1
- package/lib/ilink-meta.js.map +0 -1
- package/lib/ilink-random.d.ts.map +0 -1
- package/lib/ilink-random.js.map +0 -1
- package/lib/ilink-redact.d.ts.map +0 -1
- package/lib/ilink-redact.js.map +0 -1
- package/lib/ilink-session-guard.d.ts.map +0 -1
- package/lib/ilink-session-guard.js.map +0 -1
- package/lib/ilink-types.d.ts.map +0 -1
- package/lib/ilink-types.js.map +0 -1
- package/lib/index.d.ts.map +0 -1
- package/lib/index.js.map +0 -1
- package/lib/login-assist-routes.d.ts +0 -7
- package/lib/login-assist-routes.d.ts.map +0 -1
- package/lib/login-assist-routes.js +0 -29
- package/lib/login-assist-routes.js.map +0 -1
- package/lib/login.d.ts.map +0 -1
- package/lib/login.js.map +0 -1
- package/lib/media-download.d.ts.map +0 -1
- package/lib/media-download.js.map +0 -1
- package/lib/mime.d.ts.map +0 -1
- package/lib/mime.js.map +0 -1
- package/lib/mime.test.d.ts +0 -2
- package/lib/mime.test.d.ts.map +0 -1
- package/lib/mime.test.js +0 -62
- package/lib/mime.test.js.map +0 -1
- package/lib/outbound-media.d.ts.map +0 -1
- package/lib/outbound-media.js.map +0 -1
- package/lib/pic-decrypt.d.ts.map +0 -1
- package/lib/pic-decrypt.js.map +0 -1
- package/lib/routes.d.ts +0 -8
- package/lib/routes.d.ts.map +0 -1
- package/lib/routes.js +0 -29
- package/lib/routes.js.map +0 -1
- package/lib/silk-transcode.d.ts.map +0 -1
- package/lib/silk-transcode.js.map +0 -1
- package/lib/silk-transcode.test.d.ts +0 -2
- package/lib/silk-transcode.test.d.ts.map +0 -1
- package/lib/silk-transcode.test.js +0 -53
- package/lib/silk-transcode.test.js.map +0 -1
- package/lib/types.d.ts.map +0 -1
- package/lib/types.js.map +0 -1
- package/lib/typing-indicator.d.ts +0 -32
- package/lib/typing-indicator.d.ts.map +0 -1
- package/lib/typing-indicator.js +0 -95
- package/lib/typing-indicator.js.map +0 -1
- package/lib/upload.d.ts.map +0 -1
- package/lib/upload.js.map +0 -1
- package/lib/upload.test.d.ts +0 -2
- package/lib/upload.test.d.ts.map +0 -1
- package/lib/upload.test.js +0 -250
- package/lib/upload.test.js.map +0 -1
- package/lib/weixin-inbound.d.ts.map +0 -1
- package/lib/weixin-inbound.js.map +0 -1
- package/lib/weixin-send-media.d.ts.map +0 -1
- package/lib/weixin-send-media.js.map +0 -1
- package/lib/weixin-send.d.ts.map +0 -1
- package/lib/weixin-send.js.map +0 -1
- package/src/adapter.ts +0 -16
- package/src/bot.ts +0 -483
- package/src/login-assist-routes.ts +0 -36
- package/src/routes.ts +0 -39
- package/src/typing-indicator.ts +0 -139
package/lib/aes-ecb.d.ts
CHANGED
|
@@ -4,4 +4,3 @@ export declare function encryptAesEcb(plaintext: Buffer, key: Buffer): Buffer;
|
|
|
4
4
|
export declare function decryptAesEcb(ciphertext: Buffer, key: Buffer): Buffer;
|
|
5
5
|
/** Compute AES-128-ECB ciphertext size (PKCS7 padding to 16-byte boundary). */
|
|
6
6
|
export declare function aesEcbPaddedSize(plaintextSize: number): number;
|
|
7
|
-
//# sourceMappingURL=aes-ecb.d.ts.map
|
package/lib/aes-ecb.js
CHANGED
package/lib/cdn-upload.d.ts
CHANGED
package/lib/cdn-upload.js
CHANGED
package/lib/cdn-url.d.ts
CHANGED
package/lib/cdn-url.js
CHANGED
|
@@ -11,4 +11,3 @@ export function buildCdnDownloadUrl(encryptedQueryParam, cdnBaseUrl) {
|
|
|
11
11
|
export function buildCdnUploadUrl(params) {
|
|
12
12
|
return `${params.cdnBaseUrl}/upload?encrypted_query_param=${encodeURIComponent(params.uploadParam)}&filekey=${encodeURIComponent(params.filekey)}`;
|
|
13
13
|
}
|
|
14
|
-
//# sourceMappingURL=cdn-url.js.map
|
package/lib/client.d.ts
ADDED
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
import type { WeixinIlinkCredentials } from './credentials.js';
|
|
2
|
+
import type { WeixinConfigManager } from './ilink-config-cache.js';
|
|
3
|
+
import type { ResolvedWeixinIlinkConfig } from './protocol.js';
|
|
4
|
+
import { sendMessageWeixin } from './weixin-send.js';
|
|
5
|
+
/** Direct iLink API client backed by the Endpoint's live authenticated session. */
|
|
6
|
+
export declare class WeixinIlinkClient {
|
|
7
|
+
readonly config: ResolvedWeixinIlinkConfig;
|
|
8
|
+
private readonly resolveCredentials;
|
|
9
|
+
private readonly resolveConfigManager;
|
|
10
|
+
private readonly sendTextImpl;
|
|
11
|
+
constructor(config: ResolvedWeixinIlinkConfig, resolveCredentials: () => WeixinIlinkCredentials | null, resolveConfigManager: () => WeixinConfigManager | undefined, sendTextImpl: typeof sendMessageWeixin);
|
|
12
|
+
get credentials(): WeixinIlinkCredentials;
|
|
13
|
+
get authenticated(): boolean;
|
|
14
|
+
get apiBaseUrl(): string;
|
|
15
|
+
get cdnBaseUrl(): string;
|
|
16
|
+
contextToken(userId: string): string | undefined;
|
|
17
|
+
sendText(to: string, text: string): Promise<{
|
|
18
|
+
messageId: string;
|
|
19
|
+
}>;
|
|
20
|
+
sendMedia(to: string, filePath: string, text?: string): Promise<{
|
|
21
|
+
messageId: string;
|
|
22
|
+
}>;
|
|
23
|
+
sendTyping(userId: string, status: number): Promise<boolean>;
|
|
24
|
+
}
|
|
25
|
+
export type WeixinIlinkClientEventMap = Record<string, unknown>;
|
|
26
|
+
declare module '@zhin.js/feature-kit' {
|
|
27
|
+
interface AdapterClientRegistry {
|
|
28
|
+
readonly 'weixin-ilink': {
|
|
29
|
+
readonly client: WeixinIlinkClient;
|
|
30
|
+
readonly events: WeixinIlinkClientEventMap;
|
|
31
|
+
};
|
|
32
|
+
}
|
|
33
|
+
}
|
|
34
|
+
export declare const weixinIlinkClient: import("@zhin.js/adapter").EndpointClientToken<WeixinIlinkClient, WeixinIlinkClientEventMap>;
|
package/lib/client.js
ADDED
|
@@ -0,0 +1,72 @@
|
|
|
1
|
+
import { getContextToken } from './context-store.js';
|
|
2
|
+
import { sendTyping } from './ilink-api.js';
|
|
3
|
+
import { sendWeixinMediaFile } from './weixin-send-media.js';
|
|
4
|
+
import { defineEndpointClient } from 'zhin.js/adapter';
|
|
5
|
+
/** Direct iLink API client backed by the Endpoint's live authenticated session. */
|
|
6
|
+
export class WeixinIlinkClient {
|
|
7
|
+
config;
|
|
8
|
+
resolveCredentials;
|
|
9
|
+
resolveConfigManager;
|
|
10
|
+
sendTextImpl;
|
|
11
|
+
constructor(config, resolveCredentials, resolveConfigManager, sendTextImpl) {
|
|
12
|
+
this.config = config;
|
|
13
|
+
this.resolveCredentials = resolveCredentials;
|
|
14
|
+
this.resolveConfigManager = resolveConfigManager;
|
|
15
|
+
this.sendTextImpl = sendTextImpl;
|
|
16
|
+
}
|
|
17
|
+
get credentials() {
|
|
18
|
+
const credentials = this.resolveCredentials();
|
|
19
|
+
if (!credentials?.botToken)
|
|
20
|
+
throw new Error('weixin-ilink client not authenticated');
|
|
21
|
+
return credentials;
|
|
22
|
+
}
|
|
23
|
+
get authenticated() {
|
|
24
|
+
return Boolean(this.resolveCredentials()?.botToken);
|
|
25
|
+
}
|
|
26
|
+
get apiBaseUrl() {
|
|
27
|
+
return this.resolveCredentials()?.baseUrl ?? this.config.baseUrl;
|
|
28
|
+
}
|
|
29
|
+
get cdnBaseUrl() {
|
|
30
|
+
return this.config.cdnBaseUrl;
|
|
31
|
+
}
|
|
32
|
+
contextToken(userId) {
|
|
33
|
+
return getContextToken(this.config.id, userId);
|
|
34
|
+
}
|
|
35
|
+
async sendText(to, text) {
|
|
36
|
+
const contextToken = this.contextToken(to);
|
|
37
|
+
if (!contextToken)
|
|
38
|
+
throw new Error(`missing context_token for peer ${to}`);
|
|
39
|
+
return this.sendTextImpl({
|
|
40
|
+
to,
|
|
41
|
+
text,
|
|
42
|
+
opts: { baseUrl: this.apiBaseUrl, token: this.credentials.botToken, contextToken },
|
|
43
|
+
});
|
|
44
|
+
}
|
|
45
|
+
async sendMedia(to, filePath, text = '') {
|
|
46
|
+
const contextToken = this.contextToken(to);
|
|
47
|
+
if (!contextToken)
|
|
48
|
+
throw new Error(`missing context_token for peer ${to}`);
|
|
49
|
+
return sendWeixinMediaFile({
|
|
50
|
+
filePath,
|
|
51
|
+
to,
|
|
52
|
+
text,
|
|
53
|
+
opts: { baseUrl: this.apiBaseUrl, token: this.credentials.botToken, contextToken },
|
|
54
|
+
cdnBaseUrl: this.cdnBaseUrl,
|
|
55
|
+
});
|
|
56
|
+
}
|
|
57
|
+
async sendTyping(userId, status) {
|
|
58
|
+
const manager = this.resolveConfigManager();
|
|
59
|
+
if (!this.authenticated || !manager)
|
|
60
|
+
return false;
|
|
61
|
+
const cfg = await manager.getForUser(userId, this.contextToken(userId));
|
|
62
|
+
if (!cfg.typingTicket)
|
|
63
|
+
return false;
|
|
64
|
+
await sendTyping({
|
|
65
|
+
baseUrl: this.apiBaseUrl,
|
|
66
|
+
token: this.credentials.botToken,
|
|
67
|
+
body: { ilink_user_id: userId, typing_ticket: cfg.typingTicket, status },
|
|
68
|
+
});
|
|
69
|
+
return true;
|
|
70
|
+
}
|
|
71
|
+
}
|
|
72
|
+
export const weixinIlinkClient = defineEndpointClient('weixin-ilink');
|
package/lib/context-store.d.ts
CHANGED
|
@@ -1,2 +1 @@
|
|
|
1
|
-
export { setContextToken, getContextToken, restoreContextTokens, clearContextTokensForAccount, bodyFromItemList, isMediaItem, } from "./weixin-inbound.js";
|
|
2
|
-
//# sourceMappingURL=context-store.d.ts.map
|
|
1
|
+
export { setContextToken, getContextToken, listContextTokenUserIds, restoreContextTokens, clearContextTokensForAccount, flushContextTokenPersist, bodyFromItemList, isMediaItem, } from "./weixin-inbound.js";
|
package/lib/context-store.js
CHANGED
|
@@ -1,2 +1 @@
|
|
|
1
|
-
export { setContextToken, getContextToken, restoreContextTokens, clearContextTokensForAccount, bodyFromItemList, isMediaItem, } from "./weixin-inbound.js";
|
|
2
|
-
//# sourceMappingURL=context-store.js.map
|
|
1
|
+
export { setContextToken, getContextToken, listContextTokenUserIds, restoreContextTokens, clearContextTokensForAccount, flushContextTokenPersist, bodyFromItemList, isMediaItem, } from "./weixin-inbound.js";
|
package/lib/credentials.d.ts
CHANGED
|
@@ -6,10 +6,9 @@ export interface WeixinIlinkCredentials {
|
|
|
6
6
|
updatedAt?: string;
|
|
7
7
|
}
|
|
8
8
|
export declare function resolveStateDir(): string;
|
|
9
|
-
export declare function credentialsPath(
|
|
10
|
-
export declare function loadCredentials(
|
|
11
|
-
export declare function saveCredentials(
|
|
12
|
-
export declare function syncBufPath(
|
|
13
|
-
export declare function loadSyncBuf(
|
|
14
|
-
export declare function saveSyncBuf(
|
|
15
|
-
//# sourceMappingURL=credentials.d.ts.map
|
|
9
|
+
export declare function credentialsPath(endpointId: string): string;
|
|
10
|
+
export declare function loadCredentials(endpointId: string): WeixinIlinkCredentials | null;
|
|
11
|
+
export declare function saveCredentials(endpointId: string, creds: WeixinIlinkCredentials): void;
|
|
12
|
+
export declare function syncBufPath(endpointId: string): string;
|
|
13
|
+
export declare function loadSyncBuf(endpointId: string): string;
|
|
14
|
+
export declare function saveSyncBuf(endpointId: string, buf: string): void;
|
package/lib/credentials.js
CHANGED
|
@@ -6,11 +6,11 @@ export function resolveStateDir() {
|
|
|
6
6
|
? path.join(process.env.ZHIN_DATA_DIR, "weixin-ilink")
|
|
7
7
|
: DEFAULT_DATA_DIR;
|
|
8
8
|
}
|
|
9
|
-
export function credentialsPath(
|
|
10
|
-
return path.join(resolveStateDir(), `${
|
|
9
|
+
export function credentialsPath(endpointId) {
|
|
10
|
+
return path.join(resolveStateDir(), `${endpointId}.json`);
|
|
11
11
|
}
|
|
12
|
-
export function loadCredentials(
|
|
13
|
-
const file = credentialsPath(
|
|
12
|
+
export function loadCredentials(endpointId) {
|
|
13
|
+
const file = credentialsPath(endpointId);
|
|
14
14
|
try {
|
|
15
15
|
if (!fs.existsSync(file))
|
|
16
16
|
return null;
|
|
@@ -24,16 +24,16 @@ export function loadCredentials(botName) {
|
|
|
24
24
|
return null;
|
|
25
25
|
}
|
|
26
26
|
}
|
|
27
|
-
export function saveCredentials(
|
|
28
|
-
const file = credentialsPath(
|
|
27
|
+
export function saveCredentials(endpointId, creds) {
|
|
28
|
+
const file = credentialsPath(endpointId);
|
|
29
29
|
fs.mkdirSync(path.dirname(file), { recursive: true });
|
|
30
30
|
fs.writeFileSync(file, JSON.stringify({ ...creds, updatedAt: new Date().toISOString() }, null, 2), "utf-8");
|
|
31
31
|
}
|
|
32
|
-
export function syncBufPath(
|
|
33
|
-
return path.join(resolveStateDir(), `${
|
|
32
|
+
export function syncBufPath(endpointId) {
|
|
33
|
+
return path.join(resolveStateDir(), `${endpointId}.sync-buf`);
|
|
34
34
|
}
|
|
35
|
-
export function loadSyncBuf(
|
|
36
|
-
const file = syncBufPath(
|
|
35
|
+
export function loadSyncBuf(endpointId) {
|
|
36
|
+
const file = syncBufPath(endpointId);
|
|
37
37
|
try {
|
|
38
38
|
return fs.existsSync(file) ? fs.readFileSync(file, "utf-8") : "";
|
|
39
39
|
}
|
|
@@ -41,9 +41,8 @@ export function loadSyncBuf(botName) {
|
|
|
41
41
|
return "";
|
|
42
42
|
}
|
|
43
43
|
}
|
|
44
|
-
export function saveSyncBuf(
|
|
45
|
-
const file = syncBufPath(
|
|
44
|
+
export function saveSyncBuf(endpointId, buf) {
|
|
45
|
+
const file = syncBufPath(endpointId);
|
|
46
46
|
fs.mkdirSync(path.dirname(file), { recursive: true });
|
|
47
47
|
fs.writeFileSync(file, buf, "utf-8");
|
|
48
48
|
}
|
|
49
|
-
//# sourceMappingURL=credentials.js.map
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
import { Endpoint } from 'zhin.js/adapter';
|
|
2
|
+
import type { EndpointControl, EndpointManagement, EndpointSendRequest } from 'zhin.js/adapter';
|
|
3
|
+
import type { CapabilityId } from 'zhin.js';
|
|
4
|
+
import { getUpdates, notifyStart, notifyStop } from './ilink-api.js';
|
|
5
|
+
import { type WeixinIlinkCredentials } from './credentials.js';
|
|
6
|
+
import { sendMessageWeixin } from './weixin-send.js';
|
|
7
|
+
import { type ResolvedWeixinIlinkConfig, type WeixinMessageWithMedia } from './protocol.js';
|
|
8
|
+
import { WeixinIlinkClient } from './client.js';
|
|
9
|
+
export type WeixinIlinkSendText = typeof sendMessageWeixin;
|
|
10
|
+
export type WeixinIlinkNotifyStart = typeof notifyStart;
|
|
11
|
+
export type WeixinIlinkNotifyStop = typeof notifyStop;
|
|
12
|
+
export type WeixinIlinkGetUpdates = typeof getUpdates;
|
|
13
|
+
export interface WeixinIlinkEndpointOptions {
|
|
14
|
+
readonly id: CapabilityId;
|
|
15
|
+
readonly config: ResolvedWeixinIlinkConfig;
|
|
16
|
+
readonly resolveCredentials?: (config: ResolvedWeixinIlinkConfig, signal?: AbortSignal) => Promise<WeixinIlinkCredentials>;
|
|
17
|
+
/** Test / internal: override network side effects. */
|
|
18
|
+
readonly notifyStart?: WeixinIlinkNotifyStart;
|
|
19
|
+
readonly notifyStop?: WeixinIlinkNotifyStop;
|
|
20
|
+
readonly getUpdates?: WeixinIlinkGetUpdates;
|
|
21
|
+
readonly sendText?: WeixinIlinkSendText;
|
|
22
|
+
}
|
|
23
|
+
export declare class WeixinIlinkEndpoint extends Endpoint<WeixinIlinkClient> {
|
|
24
|
+
#private;
|
|
25
|
+
readonly client: WeixinIlinkClient;
|
|
26
|
+
readonly management: EndpointManagement;
|
|
27
|
+
readonly control: EndpointControl;
|
|
28
|
+
constructor(options: WeixinIlinkEndpointOptions);
|
|
29
|
+
get hasCredentials(): boolean;
|
|
30
|
+
start(): Promise<void>;
|
|
31
|
+
open(): void;
|
|
32
|
+
close(): void;
|
|
33
|
+
stop(): Promise<void>;
|
|
34
|
+
send({ conversation, payload }: EndpointSendRequest): Promise<string>;
|
|
35
|
+
/** Test / internal: admit a parsed message when the endpoint is open. */
|
|
36
|
+
admit(msg: WeixinMessageWithMedia): void;
|
|
37
|
+
}
|