@luckylillia-dev/plugin-onebot11 0.0.0-placeholder → 1.0.3
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/LICENSE +339 -0
- package/README.md +2 -2
- package/lib/client/index.js +10 -0
- package/lib/client/module.js +1270 -0
- package/lib/client/style.css +2 -0
- package/lib/index.js +25853 -0
- package/lib/index.js.map +7 -0
- package/lib/types/config.d.ts +76 -0
- package/lib/types/index.d.ts +7 -0
- package/package.json +114 -4
|
@@ -0,0 +1,76 @@
|
|
|
1
|
+
export interface BaseConnectConfig {
|
|
2
|
+
type: string
|
|
3
|
+
name?: string
|
|
4
|
+
enable: boolean
|
|
5
|
+
token: string
|
|
6
|
+
reportSelfMessage: boolean
|
|
7
|
+
reportOfflineMessage: boolean
|
|
8
|
+
messageFormat: 'array' | 'string'
|
|
9
|
+
debug: boolean
|
|
10
|
+
filter?: Record<string, unknown>
|
|
11
|
+
}
|
|
12
|
+
|
|
13
|
+
export interface WsConnectConfig extends BaseConnectConfig {
|
|
14
|
+
type: 'ws'
|
|
15
|
+
host: string
|
|
16
|
+
port: number
|
|
17
|
+
heartInterval: number // ms
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
export interface WsReverseConnectConfig extends BaseConnectConfig {
|
|
21
|
+
type: 'ws-reverse'
|
|
22
|
+
url: string
|
|
23
|
+
heartInterval: number // ms
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
export interface HttpConnectConfig extends BaseConnectConfig {
|
|
27
|
+
type: 'http'
|
|
28
|
+
host: string
|
|
29
|
+
port: number
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
export interface HttpPostConnectConfig extends BaseConnectConfig {
|
|
33
|
+
type: 'http-post'
|
|
34
|
+
url: string
|
|
35
|
+
enableHeart: boolean
|
|
36
|
+
heartInterval: number // ms
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
export interface OB11Config {
|
|
40
|
+
enable: boolean
|
|
41
|
+
connect: (WsConnectConfig | WsReverseConnectConfig | HttpConnectConfig | HttpPostConnectConfig)[]
|
|
42
|
+
// /** @deprecated */
|
|
43
|
+
// token?: string
|
|
44
|
+
// /** @deprecated */
|
|
45
|
+
// httpPort?: number
|
|
46
|
+
// /** @deprecated */
|
|
47
|
+
// httpPostUrls?: string[]
|
|
48
|
+
// /** @deprecated */
|
|
49
|
+
// httpSecret?: string
|
|
50
|
+
// /** @deprecated */
|
|
51
|
+
// wsPort?: number
|
|
52
|
+
// /** @deprecated */
|
|
53
|
+
// wsReverseUrls?: string[]
|
|
54
|
+
// /** @deprecated */
|
|
55
|
+
// enableHttp?: boolean
|
|
56
|
+
// /** @deprecated */
|
|
57
|
+
// enableHttpPost?: boolean
|
|
58
|
+
// /** @deprecated */
|
|
59
|
+
// enableWs?: boolean
|
|
60
|
+
// /** @deprecated */
|
|
61
|
+
// enableWsReverse?: boolean
|
|
62
|
+
// /** @deprecated */
|
|
63
|
+
// messagePostFormat?: 'array' | 'string'
|
|
64
|
+
// /** @deprecated */
|
|
65
|
+
// enableHttpHeart?: boolean
|
|
66
|
+
// /**
|
|
67
|
+
// * 快速操作回复自动引用原消息
|
|
68
|
+
// * @deprecated
|
|
69
|
+
// */
|
|
70
|
+
// enableQOAutoQuote?: boolean
|
|
71
|
+
// /** @deprecated */
|
|
72
|
+
// reportSelfMessage?: boolean
|
|
73
|
+
}
|
|
74
|
+
|
|
75
|
+
|
|
76
|
+
export interface Config { msgCacheExpire: number; musicCardSignUrl: string; ffmpeg: string }
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import type { Context, Schema } from '@luckylillia-dev/plugin-sdk'
|
|
2
|
+
import type { OB11Config } from './config'
|
|
3
|
+
export type Config = Omit<OB11Config, 'enable'>
|
|
4
|
+
export declare const Config: Schema<Config>
|
|
5
|
+
export declare const name: string
|
|
6
|
+
export declare const inject: string[]
|
|
7
|
+
export declare function apply(ctx: Context, config: Config): Promise<void>
|
package/package.json
CHANGED
|
@@ -1,13 +1,123 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@luckylillia-dev/plugin-onebot11",
|
|
3
|
-
"version": "
|
|
4
|
-
"
|
|
5
|
-
"
|
|
3
|
+
"version": "1.0.3",
|
|
4
|
+
"type": "module",
|
|
5
|
+
"description": "OneBot 11 HTTP and WebSocket adapter for LuckyLillia NTQQ",
|
|
6
|
+
"main": "./lib/index.js",
|
|
7
|
+
"types": "./lib/types/index.d.ts",
|
|
8
|
+
"exports": {
|
|
9
|
+
".": {
|
|
10
|
+
"types": "./lib/types/index.d.ts",
|
|
11
|
+
"default": "./lib/index.js"
|
|
12
|
+
},
|
|
13
|
+
"./package.json": "./package.json"
|
|
14
|
+
},
|
|
15
|
+
"files": [
|
|
16
|
+
"lib",
|
|
17
|
+
"README.md",
|
|
18
|
+
"LICENSE"
|
|
19
|
+
],
|
|
20
|
+
"author": "LuckyLilliaDev",
|
|
6
21
|
"repository": {
|
|
7
22
|
"type": "git",
|
|
8
23
|
"url": "git+https://github.com/LuckyLilliaDev/lucky-lillia-plugin-onebot11.git"
|
|
9
24
|
},
|
|
25
|
+
"license": "GPL-2.0",
|
|
26
|
+
"engines": {
|
|
27
|
+
"node": ">=22.15"
|
|
28
|
+
},
|
|
29
|
+
"keywords": [
|
|
30
|
+
"luckylillia-plugin",
|
|
31
|
+
"onebot11"
|
|
32
|
+
],
|
|
33
|
+
"scripts": {
|
|
34
|
+
"build": "node scripts/build.mjs",
|
|
35
|
+
"check": "tsc --noEmit",
|
|
36
|
+
"test": "vitest run test/unit",
|
|
37
|
+
"prepack": "npm run check && npm run build"
|
|
38
|
+
},
|
|
39
|
+
"dependencies": {
|
|
40
|
+
"@hono/node-server": "^2.1.1",
|
|
41
|
+
"hono": "^4.13.5",
|
|
42
|
+
"sift": "^17.1.3",
|
|
43
|
+
"ws": "^8.21.3"
|
|
44
|
+
},
|
|
45
|
+
"peerDependencies": {
|
|
46
|
+
"@luckylillia-dev/plugin-sdk": "^1.0.1",
|
|
47
|
+
"@luckylillia-dev/plugin-nt-protocol": "^1.0.0",
|
|
48
|
+
"cordis": "4.0.0-rc.11",
|
|
49
|
+
"cosmokit": "^1.8.1",
|
|
50
|
+
"schemastery": "^3.18.0",
|
|
51
|
+
"react": "^19.0.0",
|
|
52
|
+
"react-dom": "^19.0.0"
|
|
53
|
+
},
|
|
54
|
+
"peerDependenciesMeta": {
|
|
55
|
+
"@luckylillia-dev/plugin-nt-protocol": {
|
|
56
|
+
"optional": true
|
|
57
|
+
},
|
|
58
|
+
"react": {
|
|
59
|
+
"optional": true
|
|
60
|
+
},
|
|
61
|
+
"react-dom": {
|
|
62
|
+
"optional": true
|
|
63
|
+
}
|
|
64
|
+
},
|
|
65
|
+
"devDependencies": {
|
|
66
|
+
"@luckylillia-dev/plugin-sdk": "npm:@luckylillia/plugin-sdk@^1.0.1",
|
|
67
|
+
"@types/node": "^24.12.4",
|
|
68
|
+
"@types/ws": "^8.18.1",
|
|
69
|
+
"@types/react": "^19.0.0",
|
|
70
|
+
"@types/react-dom": "^19.0.0",
|
|
71
|
+
"@tailwindcss/postcss": "^4.2.0",
|
|
72
|
+
"cordis": "4.0.0-rc.11",
|
|
73
|
+
"cosmokit": "^1.8.1",
|
|
74
|
+
"schemastery": "^3.18.0",
|
|
75
|
+
"esbuild": "~0.28.0",
|
|
76
|
+
"lucide-react": "^0.575.0",
|
|
77
|
+
"postcss": "^8.5.0",
|
|
78
|
+
"react": "^19.2.0",
|
|
79
|
+
"react-dom": "^19.2.0",
|
|
80
|
+
"tailwindcss": "^4.2.0",
|
|
81
|
+
"typescript": "^5.9.3",
|
|
82
|
+
"vitest": "^4.1.11"
|
|
83
|
+
},
|
|
10
84
|
"publishConfig": {
|
|
11
|
-
"access": "public"
|
|
85
|
+
"access": "public",
|
|
86
|
+
"registry": "https://registry.npmjs.org"
|
|
87
|
+
},
|
|
88
|
+
"llbot": {
|
|
89
|
+
"category": "adapter",
|
|
90
|
+
"title": "OneBot 11",
|
|
91
|
+
"icon": "radio",
|
|
92
|
+
"description": "通过 NTQQ 提供 OneBot 11 HTTP、正向和反向 WebSocket、HTTP POST 上报。",
|
|
93
|
+
"dependencies": {
|
|
94
|
+
"@luckylillia-dev/plugin-nt-protocol": "^1.0.0"
|
|
95
|
+
},
|
|
96
|
+
"service": {
|
|
97
|
+
"implements": [
|
|
98
|
+
"onebot"
|
|
99
|
+
],
|
|
100
|
+
"required": [
|
|
101
|
+
"ntOnebot",
|
|
102
|
+
"qqProtocol",
|
|
103
|
+
"app",
|
|
104
|
+
"store",
|
|
105
|
+
"ntUserApi",
|
|
106
|
+
"ntFriendApi",
|
|
107
|
+
"ntGroupApi",
|
|
108
|
+
"ntMsgApi",
|
|
109
|
+
"ntFileApi",
|
|
110
|
+
"ntSystemApi",
|
|
111
|
+
"ntWebApi"
|
|
112
|
+
],
|
|
113
|
+
"labels": {
|
|
114
|
+
"ntOnebot": "NTQQ 账号接口",
|
|
115
|
+
"qqProtocol": "NTQQ 协议",
|
|
116
|
+
"app": "NTQQ 账号登录",
|
|
117
|
+
"store": "NTQQ 消息缓存",
|
|
118
|
+
"onebot": "OneBot 11"
|
|
119
|
+
}
|
|
120
|
+
},
|
|
121
|
+
"webui": "./lib/client/index.js"
|
|
12
122
|
}
|
|
13
123
|
}
|