mirror of
https://github.com/NapNeko/NapCatQQ.git
synced 2025-07-19 12:03:37 +00:00
Compare commits
478 Commits
Author | SHA1 | Date | |
---|---|---|---|
![]() |
52c6927c44 | ||
![]() |
a16e0a21a2 | ||
![]() |
e796b21157 | ||
![]() |
1c6bc478b4 | ||
![]() |
98f39c6388 | ||
![]() |
570c83571b | ||
![]() |
c0c38d89e0 | ||
![]() |
b866cfc03c | ||
![]() |
28c2755b37 | ||
![]() |
57bfc5c73a | ||
![]() |
0f3f7d53a3 | ||
![]() |
529e50fd7f | ||
![]() |
2fa283f91d | ||
![]() |
029a9ade93 | ||
![]() |
f1ca8b15c8 | ||
![]() |
4d8edd5da9 | ||
![]() |
6c63990653 | ||
![]() |
5b521409c6 | ||
![]() |
3268fc1014 | ||
![]() |
19afb4941b | ||
![]() |
40e5111d41 | ||
![]() |
a3a40e1e74 | ||
![]() |
101caa6826 | ||
![]() |
875fed8d77 | ||
![]() |
69e28eb000 | ||
![]() |
e5d3a8360c | ||
![]() |
4545d9285b | ||
![]() |
6702024805 | ||
![]() |
78bad4842b | ||
![]() |
b9a913cfed | ||
![]() |
6f5a6f353f | ||
![]() |
790c4f589d | ||
![]() |
cd1bd3461f | ||
![]() |
0280dcd6a8 | ||
![]() |
fc337292bc | ||
![]() |
fb1daa0e21 | ||
![]() |
579b9dc0c2 | ||
![]() |
dedd0be352 | ||
![]() |
1c7d9c3513 | ||
![]() |
0c7dfe2af4 | ||
![]() |
8d1351a8a3 | ||
![]() |
e6e68a6036 | ||
![]() |
24658edc45 | ||
![]() |
09eaa3116a | ||
![]() |
e9bff466b5 | ||
![]() |
5d77f50160 | ||
![]() |
2ab91e363f | ||
![]() |
34d881426f | ||
![]() |
13ecaa0ad4 | ||
![]() |
ce6185b1f7 | ||
![]() |
2cfde6b75a | ||
![]() |
37d0354751 | ||
![]() |
0a0edcf203 | ||
![]() |
d6aad2ea28 | ||
![]() |
63084506ee | ||
![]() |
c5d313574f | ||
![]() |
caab998212 | ||
![]() |
aa037cc3d9 | ||
![]() |
642bffe374 | ||
![]() |
d682b154fc | ||
![]() |
d4a06d98cf | ||
![]() |
856b5e16b1 | ||
![]() |
a0aa208860 | ||
![]() |
037a11e04f | ||
![]() |
bd8a1d715f | ||
![]() |
54ab1dc091 | ||
![]() |
9471e63857 | ||
![]() |
fa4a403f38 | ||
![]() |
d608d65bf4 | ||
![]() |
c0f2df172a | ||
![]() |
788ef5d81c | ||
![]() |
1c6b5cffe1 | ||
![]() |
c04382b623 | ||
![]() |
0bbe51f8fd | ||
![]() |
ff7d7d15a0 | ||
![]() |
4b3d083d3a | ||
![]() |
a566dd390b | ||
![]() |
7d1442da04 | ||
![]() |
17fc982f55 | ||
![]() |
ba417e2274 | ||
![]() |
d345094b75 | ||
![]() |
6da477480d | ||
![]() |
e274088c06 | ||
![]() |
1bcaa73c5c | ||
![]() |
ca94e8f621 | ||
![]() |
1c4e198f59 | ||
![]() |
fdd13f9c66 | ||
![]() |
4333ab624e | ||
![]() |
9fe1eb3a42 | ||
![]() |
ad251a7682 | ||
![]() |
1fa740de2d | ||
![]() |
466b89064a | ||
![]() |
2748cb0ba3 | ||
![]() |
aef0d5bdde | ||
![]() |
c71e8f024a | ||
![]() |
9411f07321 | ||
![]() |
9b2a5c9bbf | ||
![]() |
2b275523a0 | ||
![]() |
31fe2f6da4 | ||
![]() |
f95db623a5 | ||
![]() |
a46313e483 | ||
![]() |
31c330826e | ||
![]() |
c4cf800142 | ||
![]() |
b64a2b0006 | ||
![]() |
a3702f2270 | ||
![]() |
d221b1d470 | ||
![]() |
0b22a6bc1d | ||
![]() |
07e8acd003 | ||
![]() |
9fce617c57 | ||
![]() |
8d5c736975 | ||
![]() |
4ccec05186 | ||
![]() |
a4f456f002 | ||
![]() |
fbdb941c27 | ||
![]() |
a41cd42e8d | ||
![]() |
77521e4627 | ||
![]() |
b6a1242bac | ||
![]() |
2f325cfe26 | ||
![]() |
193b0ad0f0 | ||
![]() |
ed476b7793 | ||
![]() |
720fd94b7f | ||
![]() |
ff87da105c | ||
![]() |
a875e65536 | ||
![]() |
0b2c6bb662 | ||
![]() |
e44e2fbbb7 | ||
![]() |
b3c93644fd | ||
![]() |
a56b7ff636 | ||
![]() |
c724236930 | ||
![]() |
4853320b2b | ||
![]() |
ba1acb6ac1 | ||
![]() |
f32a6320fc | ||
![]() |
9f914ce36a | ||
![]() |
b037644e5a | ||
![]() |
afd8c59f83 | ||
![]() |
8aa4af3e91 | ||
![]() |
630a8a2b97 | ||
![]() |
dc34c4d00c | ||
![]() |
fb42729dec | ||
![]() |
b06989216a | ||
![]() |
e5144f08cd | ||
![]() |
c4a60190e8 | ||
![]() |
efe9e4fa4c | ||
![]() |
45800b1559 | ||
![]() |
b0b2b8104f | ||
![]() |
8dbc012825 | ||
![]() |
a434176063 | ||
![]() |
a013f750c7 | ||
![]() |
aa1f49d02f | ||
![]() |
7125a26309 | ||
![]() |
329a35ebf0 | ||
![]() |
d30043f595 | ||
![]() |
745dfa1911 | ||
![]() |
76203f49a7 | ||
![]() |
870a915377 | ||
![]() |
c174fce227 | ||
![]() |
2b6e42e919 | ||
![]() |
df73e1e5a3 | ||
![]() |
3e902311d4 | ||
![]() |
64a0037265 | ||
![]() |
bcd4e38093 | ||
![]() |
181a77d627 | ||
![]() |
b353595ba9 | ||
![]() |
75e3bb4f17 | ||
![]() |
d2fa9192d4 | ||
![]() |
4bcadc2de4 | ||
![]() |
8ddff74260 | ||
![]() |
95940fdb64 | ||
![]() |
9cd5708948 | ||
![]() |
d361683d79 | ||
![]() |
9ad17a01f7 | ||
![]() |
22ca1d443c | ||
![]() |
2662e875ca | ||
![]() |
8ae0d07ec1 | ||
![]() |
76a9edb7f5 | ||
![]() |
0ccb464e5b | ||
![]() |
bef600efa2 | ||
![]() |
58a182cd33 | ||
![]() |
aa43334f41 | ||
![]() |
a2a4c97f6c | ||
![]() |
4217ba99fd | ||
![]() |
589725f5cc | ||
![]() |
3fea4602f8 | ||
![]() |
8ea6aae875 | ||
![]() |
2c70b2af68 | ||
![]() |
54a2cbcb42 | ||
![]() |
fdef821c60 | ||
![]() |
dfa798a35d | ||
![]() |
39b8eb6ff1 | ||
![]() |
6cf71f67a9 | ||
![]() |
f2e919725e | ||
![]() |
869599126e | ||
![]() |
3b1b200f6f | ||
![]() |
93c646e3e4 | ||
![]() |
3552f80a21 | ||
![]() |
66d3a63998 | ||
![]() |
6447825978 | ||
![]() |
18b7df9fca | ||
![]() |
c3781cab96 | ||
![]() |
776098dba6 | ||
![]() |
8d1b4f61e7 | ||
![]() |
c13e2bdb96 | ||
![]() |
4682254157 | ||
![]() |
d7ca6b9213 | ||
![]() |
4a76afbde8 | ||
![]() |
a68349c23a | ||
![]() |
920e005366 | ||
![]() |
659f339020 | ||
![]() |
3ee2d463af | ||
![]() |
686ddb5460 | ||
![]() |
e5d62488b7 | ||
![]() |
eb93dd5005 | ||
![]() |
6999d02d2d | ||
![]() |
790e2b1427 | ||
![]() |
a29c7cdfe4 | ||
![]() |
6b7cd692a6 | ||
![]() |
4d3925872a | ||
![]() |
2bd0f6934a | ||
![]() |
51783f17ed | ||
![]() |
ce3aef3526 | ||
![]() |
ee70afdfbb | ||
![]() |
d96c4a56a2 | ||
![]() |
9a39513dea | ||
![]() |
8f22d63315 | ||
![]() |
7f2a5bb95e | ||
![]() |
0118dbd5fb | ||
![]() |
09405de26c | ||
![]() |
efa5ee0e57 | ||
![]() |
80d558f37a | ||
![]() |
901adc3fc7 | ||
![]() |
01417be954 | ||
![]() |
43b780cbe6 | ||
![]() |
e83f36a12f | ||
![]() |
77e3fc4ab0 | ||
![]() |
eafd1adaba | ||
![]() |
6b53abb7c9 | ||
![]() |
f994c5d284 | ||
![]() |
6fda220107 | ||
![]() |
da290ed1c3 | ||
![]() |
7e9cd80a1c | ||
![]() |
379b7413d8 | ||
![]() |
9181a4df16 | ||
![]() |
df982afd51 | ||
![]() |
5c2c3b4317 | ||
![]() |
92d1309103 | ||
![]() |
c43ee3c1d6 | ||
![]() |
e0726e5283 | ||
![]() |
5f3775584b | ||
![]() |
77873d63c5 | ||
![]() |
9e6b09765e | ||
![]() |
1ad6ea4049 | ||
![]() |
7c41da1cb9 | ||
![]() |
adcf4bfc53 | ||
![]() |
7a6321a9c1 | ||
![]() |
d56b27a7b0 | ||
![]() |
ed7657ab5f | ||
![]() |
a414838416 | ||
![]() |
93646577dc | ||
![]() |
46db66038e | ||
![]() |
efc4e9ce56 | ||
![]() |
8d5eac7f80 | ||
![]() |
7b94e49b81 | ||
![]() |
c35fd4bdc8 | ||
![]() |
98590e2d90 | ||
![]() |
e6da0e5dd5 | ||
![]() |
cb2baf747d | ||
![]() |
a2f2eb03ce | ||
![]() |
5c6acbb780 | ||
![]() |
1be7031199 | ||
![]() |
ed6399bde9 | ||
![]() |
6709893781 | ||
![]() |
686a426cda | ||
![]() |
4f90bc7813 | ||
![]() |
e307b289ae | ||
![]() |
3baeff61a7 | ||
![]() |
93ab9d12ee | ||
![]() |
36e1317792 | ||
![]() |
fa3e90a021 | ||
![]() |
782a69cf13 | ||
![]() |
d495f351c0 | ||
![]() |
30bd3d2d52 | ||
![]() |
ff5a21cca5 | ||
![]() |
f8abb73c92 | ||
![]() |
e97f323d9a | ||
![]() |
3d27a4c05d | ||
![]() |
9dbc13dbe4 | ||
![]() |
c46a4c75b1 | ||
![]() |
0bded73f16 | ||
![]() |
1333733684 | ||
![]() |
003be934de | ||
![]() |
93ef20d358 | ||
![]() |
94e1a6f0ba | ||
![]() |
8661d09d57 | ||
![]() |
0e5e21dc4e | ||
![]() |
3b25c4987c | ||
![]() |
2212eb17aa | ||
![]() |
768bac1db8 | ||
![]() |
3aef75085f | ||
![]() |
ce8bef638a | ||
![]() |
f0a0c90304 | ||
![]() |
cd6c32b21d | ||
![]() |
b31876d2d1 | ||
![]() |
ebab8a190e | ||
![]() |
1b7ce8e7a5 | ||
![]() |
646bb6bd79 | ||
![]() |
5a84b97ca9 | ||
![]() |
6d41b5a4a1 | ||
![]() |
a8bce36f3b | ||
![]() |
ac2132f8ba | ||
![]() |
cab4b57abe | ||
![]() |
938fb30359 | ||
![]() |
62346d7d9d | ||
![]() |
cf1e5ca64b | ||
![]() |
7d2d683d96 | ||
![]() |
fe5042f1c3 | ||
![]() |
a1dd76aee0 | ||
![]() |
d1c91be167 | ||
![]() |
9748d99f34 | ||
![]() |
c90ffbeb62 | ||
![]() |
eb7fafeabf | ||
![]() |
3e50629462 | ||
![]() |
65281a4554 | ||
![]() |
454ec09d6a | ||
![]() |
60e3c6858d | ||
![]() |
f911f5b4fc | ||
![]() |
ad1694d291 | ||
![]() |
1130965f26 | ||
![]() |
fe1f28998b | ||
![]() |
45727fce05 | ||
![]() |
d5c23e5add | ||
![]() |
e3a8285f6c | ||
![]() |
a791221cf6 | ||
![]() |
b954d9b403 | ||
![]() |
5e7e24a271 | ||
![]() |
ffb1e598f6 | ||
![]() |
bc2da8a645 | ||
![]() |
6f2be3ed30 | ||
![]() |
033a7bffb3 | ||
![]() |
f2b2ea61a1 | ||
![]() |
6f0783acc4 | ||
![]() |
ce60aa3823 | ||
![]() |
8075e70606 | ||
![]() |
4402fc2d0a | ||
![]() |
3e3ecda551 | ||
![]() |
50beb8f346 | ||
![]() |
8e033e3e06 | ||
![]() |
dc029a318b | ||
![]() |
8e91bc2c8e | ||
![]() |
0ff5b4e90b | ||
![]() |
20dec19bfe | ||
![]() |
d261fbff26 | ||
![]() |
6594b33bcc | ||
![]() |
a1bb6cc1b1 | ||
![]() |
7ce195b68e | ||
![]() |
16d8d04aaa | ||
![]() |
59565f7d90 | ||
![]() |
43784a2495 | ||
![]() |
3811d7469e | ||
![]() |
c72b40a1e1 | ||
![]() |
f00933969d | ||
![]() |
759adc45e3 | ||
![]() |
27ecf78372 | ||
![]() |
c91b83a7ba | ||
![]() |
39373ee63a | ||
![]() |
2db64c69ae | ||
![]() |
a699b71c02 | ||
![]() |
6c07d22cda | ||
![]() |
a2ee900ed5 | ||
![]() |
e709f31b99 | ||
![]() |
35afb12756 | ||
![]() |
9bed9fe162 | ||
![]() |
4ff5553804 | ||
![]() |
32213be7a7 | ||
![]() |
84894a73e1 | ||
![]() |
b6ea185ce7 | ||
![]() |
814ac0f731 | ||
![]() |
a40bb29da3 | ||
![]() |
e9b90079c0 | ||
![]() |
dba383c27e | ||
![]() |
42059b5817 | ||
![]() |
f92a17c01b | ||
![]() |
d6552ce333 | ||
![]() |
0db89bde5a | ||
![]() |
56a12185d4 | ||
![]() |
c40170db5d | ||
![]() |
1df3e9c414 | ||
![]() |
b1570df8b9 | ||
![]() |
023fd1ce36 | ||
![]() |
a7fe74bc0c | ||
![]() |
26c9abd9da | ||
![]() |
a5e34645c5 | ||
![]() |
b2831c0a19 | ||
![]() |
648c1ea0f9 | ||
![]() |
9cd927e06a | ||
![]() |
4272413f55 | ||
![]() |
e1711b7af6 | ||
![]() |
f7d3f27d45 | ||
![]() |
3a7a47f82d | ||
![]() |
cc211706d5 | ||
![]() |
22f74be4cd | ||
![]() |
5a00d14f94 | ||
![]() |
ecb4e7bf9f | ||
![]() |
56e5b546e1 | ||
![]() |
272f5a2f4f | ||
![]() |
ddcbe78a01 | ||
![]() |
00b6c964e2 | ||
![]() |
d7d2b06ecc | ||
![]() |
fafc59360d | ||
![]() |
19e105785e | ||
![]() |
b87ac09e43 | ||
![]() |
af9092d7c7 | ||
![]() |
24a1ffd652 | ||
![]() |
662813cc58 | ||
![]() |
d890b78290 | ||
![]() |
58747d7d4a | ||
![]() |
0773a4f39c | ||
![]() |
66cc7f8a1f | ||
![]() |
01ab40bf4a | ||
![]() |
4c09147fd1 | ||
![]() |
f9f426d788 | ||
![]() |
ff8fa1bf31 | ||
![]() |
59f99e4f6a | ||
![]() |
7449ce9c3b | ||
![]() |
f6bc8f0a1f | ||
![]() |
4d10b8cdee | ||
![]() |
5a61c5de09 | ||
![]() |
f84d0db811 | ||
![]() |
36ce3b08fe | ||
![]() |
da8ea5b545 | ||
![]() |
fad3dbf4cd | ||
![]() |
034d12c347 | ||
![]() |
c94dbf1d9a | ||
![]() |
e516687a9e | ||
![]() |
4a2f77b0a6 | ||
![]() |
7b29ecba71 | ||
![]() |
11241b8e07 | ||
![]() |
52bbd1f20b | ||
![]() |
4044750515 | ||
![]() |
b670c546b9 | ||
![]() |
f37bbf93cb | ||
![]() |
87311ab41a | ||
![]() |
ecb4d1845c | ||
![]() |
35c232ab25 | ||
![]() |
df0be2e251 | ||
![]() |
871b3a102b | ||
![]() |
02299e3892 | ||
![]() |
6af4d6f5b8 | ||
![]() |
4fb5700367 | ||
![]() |
8579276381 | ||
![]() |
7ba60b22c5 | ||
![]() |
031932f41c | ||
![]() |
079d0a89b1 | ||
![]() |
c4fdce6d64 | ||
![]() |
5604c2b29f | ||
![]() |
74b5ab2b47 | ||
![]() |
c29cbfe123 | ||
![]() |
6fe5cb1ffd | ||
![]() |
7edd5a7a8e | ||
![]() |
c1edc1b99b | ||
![]() |
4d1d890f72 | ||
![]() |
fe0f82fa2b | ||
![]() |
84083a65a8 | ||
![]() |
fc91c6bc08 | ||
![]() |
09120171ba | ||
![]() |
a362f920dc | ||
![]() |
9d7729f548 | ||
![]() |
ed56e177cf | ||
![]() |
9db28bd502 | ||
![]() |
aded70eb2e | ||
![]() |
dfbad85465 | ||
![]() |
52076fe182 | ||
![]() |
5575c3cb13 | ||
![]() |
637d32efff | ||
![]() |
fd54658e53 | ||
![]() |
2f39a8d76e | ||
![]() |
6a3e793500 | ||
![]() |
3b3ffeda6b | ||
![]() |
f7d92a3b11 | ||
![]() |
d9d9ba8bf1 | ||
![]() |
d66ab7d389 |
11
.github/workflows/build.yml
vendored
11
.github/workflows/build.yml
vendored
@@ -1,6 +1,11 @@
|
||||
name: "Build"
|
||||
on:
|
||||
workflow_dispatch:
|
||||
push:
|
||||
branches:
|
||||
- main
|
||||
|
||||
permissions: write-all
|
||||
|
||||
jobs:
|
||||
build-linux:
|
||||
@@ -9,7 +14,7 @@ jobs:
|
||||
strategy:
|
||||
fail-fast: false
|
||||
matrix:
|
||||
target_platform: [linux,darwin]
|
||||
target_platform: [linux]
|
||||
target_arch: [x64, arm64]
|
||||
steps:
|
||||
- name: Clone Main Repository
|
||||
@@ -17,6 +22,7 @@ jobs:
|
||||
with:
|
||||
repository: 'NapNeko/NapCatQQ'
|
||||
submodules: true
|
||||
ref: main
|
||||
token: ${{ secrets.NAPCAT_BUILD }}
|
||||
- name: Use Node.js 20.X
|
||||
uses: actions/setup-node@v4
|
||||
@@ -48,6 +54,7 @@ jobs:
|
||||
with:
|
||||
repository: 'NapNeko/NapCatQQ'
|
||||
submodules: true
|
||||
ref: main
|
||||
token: ${{ secrets.NAPCAT_BUILD }}
|
||||
- name: Use Node.js 20.X
|
||||
uses: actions/setup-node@v4
|
||||
@@ -64,4 +71,4 @@ jobs:
|
||||
uses: actions/upload-artifact@v4
|
||||
with:
|
||||
name: NapCat.${{ matrix.target_platform }}.${{ matrix.target_arch }}
|
||||
path: dist
|
||||
path: dist
|
||||
|
58
.github/workflows/release.yml
vendored
58
.github/workflows/release.yml
vendored
@@ -1,16 +1,42 @@
|
||||
name: "release"
|
||||
|
||||
on:
|
||||
push:
|
||||
tags:
|
||||
- "v*"
|
||||
|
||||
permissions: write-all
|
||||
|
||||
jobs:
|
||||
check-version:
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- name: Clone Repository
|
||||
uses: actions/checkout@v4
|
||||
with:
|
||||
ref: main
|
||||
token: ${{ secrets.GITHUB_TOKEN }}
|
||||
|
||||
- name: Extract version from tag
|
||||
run: echo "VERSION=${GITHUB_REF#refs/tags/v}" >> $GITHUB_ENV
|
||||
|
||||
- name: Use Node.js 20.X
|
||||
uses: actions/setup-node@v4
|
||||
with:
|
||||
node-version: 20.x
|
||||
|
||||
- name: Check Version
|
||||
run: |
|
||||
ls
|
||||
node ./script/checkVersion.cjs
|
||||
sh ./checkVersion.sh
|
||||
build-linux:
|
||||
needs: [check-version]
|
||||
runs-on: ubuntu-latest
|
||||
strategy:
|
||||
fail-fast: false
|
||||
matrix:
|
||||
target_platform: [linux,darwin]
|
||||
target_platform: [linux]
|
||||
target_arch: [x64, arm64]
|
||||
steps:
|
||||
- name: Clone Main Repository
|
||||
@@ -18,13 +44,17 @@ jobs:
|
||||
with:
|
||||
repository: 'NapNeko/NapCatQQ'
|
||||
submodules: true
|
||||
ref: main
|
||||
token: ${{ secrets.NAPCAT_BUILD }}
|
||||
- name: Use Node.js 20.X
|
||||
uses: actions/setup-node@v4
|
||||
with:
|
||||
node-version: 20.x
|
||||
node-version: 20.x
|
||||
|
||||
- name: Build NuCat Linux
|
||||
run: |
|
||||
export NAPCAT_BUILDSYS=${{ matrix.target_platform }}
|
||||
export NAPCAT_BUILDARCH=${{ matrix.target_arch }}
|
||||
npm i --arch=${{ matrix.target_arch }} --platform=${{ matrix.target_platform }}
|
||||
npm run build:prod
|
||||
cd dist
|
||||
@@ -37,6 +67,7 @@ jobs:
|
||||
path: dist
|
||||
build-win32:
|
||||
runs-on: ubuntu-latest
|
||||
needs: [check-version]
|
||||
strategy:
|
||||
fail-fast: false
|
||||
matrix:
|
||||
@@ -48,23 +79,30 @@ jobs:
|
||||
with:
|
||||
repository: 'NapNeko/NapCatQQ'
|
||||
submodules: true
|
||||
ref: main
|
||||
token: ${{ secrets.NAPCAT_BUILD }}
|
||||
|
||||
- name: Use Node.js 20.X
|
||||
uses: actions/setup-node@v4
|
||||
with:
|
||||
node-version: 20.x
|
||||
|
||||
- name: Build NuCat Linux
|
||||
run: |
|
||||
export NAPCAT_BUILDSYS=${{ matrix.target_platform }}
|
||||
export NAPCAT_BUILDARCH=${{ matrix.target_arch }}
|
||||
npm i --arch=${{ matrix.target_arch }} --platform=${{ matrix.target_platform }}
|
||||
npm run build:prod
|
||||
cd dist
|
||||
npm i --omit=dev --arch=${{ matrix.target_arch }} --platform=${{ matrix.target_platform }}
|
||||
cd ..
|
||||
|
||||
- name: Upload Artifact
|
||||
uses: actions/upload-artifact@v4
|
||||
with:
|
||||
name: NapCat.${{ matrix.target_platform }}.${{ matrix.target_arch }}
|
||||
path: dist
|
||||
|
||||
release-napcat:
|
||||
needs: [build-win32,build-linux]
|
||||
runs-on: ubuntu-latest
|
||||
@@ -78,15 +116,23 @@ jobs:
|
||||
base=$(basename "$dir")
|
||||
zip -r "${base}.zip" "$dir"
|
||||
done
|
||||
|
||||
- name: Extract version from tag
|
||||
run: echo "VERSION=${GITHUB_REF#refs/tags/v}" >> $GITHUB_ENV
|
||||
|
||||
- name: Clone Changes Log
|
||||
run: curl -o CHANGELOG.md https://fastly.jsdelivr.net/gh/NapNeko/NapCatQQ@main/CHANGELOG.md
|
||||
|
||||
- name: Create Release Draft and Upload Artifacts
|
||||
uses: softprops/action-gh-release@v1
|
||||
with:
|
||||
name: NapCat V0.0.0
|
||||
token: ${{ secrets.NAPCAT_BUILD }}
|
||||
name: NapCat V${{ env.VERSION }}
|
||||
token: ${{ secrets.GITHUB_TOKEN }}
|
||||
body_path: CHANGELOG.md
|
||||
files: |
|
||||
NapCat.win32.x64.zip
|
||||
NapCat.linux.x64.zip
|
||||
NapCat.linux.arm64.zip
|
||||
NapCat.darwin.x64.zip
|
||||
NapCat.darwin.arm64.zip
|
||||
# NapCat.darwin.x64.zip
|
||||
# NapCat.darwin.arm64.zip
|
||||
draft: true
|
||||
|
4
.gitignore
vendored
4
.gitignore
vendored
@@ -1,11 +1,10 @@
|
||||
# Logs
|
||||
|
||||
# Develop
|
||||
node_modules/
|
||||
package-lock.json
|
||||
out/
|
||||
dist/
|
||||
src/core.lib/common/
|
||||
test
|
||||
|
||||
# Editor
|
||||
.vscode/*
|
||||
@@ -14,3 +13,4 @@ src/core.lib/common/
|
||||
|
||||
# Build
|
||||
*.db
|
||||
checkVersion.sh
|
15
CHANGELOG.md
Normal file
15
CHANGELOG.md
Normal file
@@ -0,0 +1,15 @@
|
||||
# v1.3.0
|
||||
|
||||
QQ Version: Windows 9.9.9-23424 / Linux 3.2.7-23361
|
||||
|
||||
## 修复与优化
|
||||
* 修复了一个导致每个图片都自动下载的 bug
|
||||
* 再一次修复图片URL,支持 Win/Linux X64 获取Rkey,暂时不支持arm64
|
||||
* 修复了设置消息群聊与私聊已读接口
|
||||
* 修复无法获取进群申请人员信息
|
||||
## 新增与调整
|
||||
* 再一次对获取Cookies与获取群成员优化,分别添加30/60/120分钟缓存
|
||||
* 新增 WebUi 支持远程配置设置 详细参考官方教程
|
||||
* 新增二维码过期自动刷新功能
|
||||
|
||||
新增的 API 详细见[API文档](https://napneko.github.io/zh-CN/develop/extends_api)
|
21
LICENSE
Normal file
21
LICENSE
Normal file
@@ -0,0 +1,21 @@
|
||||
MIT License
|
||||
|
||||
Copyright (c) 2024 NapCatQQ
|
||||
|
||||
Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
of this software and associated documentation files (the "Software"), to deal
|
||||
in the Software without restriction, including without limitation the rights
|
||||
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||
copies of the Software, and to permit persons to whom the Software is
|
||||
furnished to do so, subject to the following conditions:
|
||||
|
||||
The above copyright notice and this permission notice shall be included in all
|
||||
copies or substantial portions of the Software.
|
||||
|
||||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
||||
SOFTWARE.
|
156
README.md
156
README.md
@@ -4,162 +4,30 @@
|
||||
|
||||
## 项目介绍
|
||||
|
||||
NapCatQQ(瞌睡猫QQ,不准叫我NCQQ!),像睡着了一样在后台低占用运行的无头(没有界面)的NTQQ
|
||||
NapCatQQ 是基于 PC NTQQ 本体实现一套无头 Bot 框架。
|
||||
|
||||
目前测试在 Windows 上表现优秀,最低可达只占用内存 **20M**左右
|
||||
名字寓意 瞌睡猫QQ,像睡着了一样在后台低占用运行的无需GUI界面的NTQQ。
|
||||
|
||||
由于 Linux 上的 QQ 图形依赖较多,会导致内存占用小高,大约 **100+M**,目前正在研究如何优化
|
||||
## 如何使用
|
||||
|
||||
具体占用会因人而异,QQ 群、好友越多占用越高
|
||||
可前往 [Release](https://github.com/NapNeko/NapCatQQ/releases/) 页面下载最新版本
|
||||
|
||||
## 下载
|
||||
**首次使用** 请务必前往 [官方文档](https://napneko.github.io/) 查看使用文档与教程
|
||||
|
||||
前往 Release 页面下载最新版本
|
||||
|
||||
## 启动
|
||||
|
||||
NapCat 是基于 官方NTQQ 实现的Bot框架,因此先需要安装官方QQ,**注意同个账号不能同时登录原版 QQ 和 NapCatQQ**
|
||||
|
||||
*如果没有安装 QQ 请往后翻查看安装方法*
|
||||
|
||||
修改 `config/onebot11.json`内容,并重名为 `onebot11_<你的QQ号>.json`,如`onebot11_1234567.json`
|
||||
|
||||
json 配置内容参数解释:
|
||||
|
||||
```json5
|
||||
{
|
||||
// 是否启用http服务,如果启用,可以通过http接口发送消息
|
||||
"enableHttp": false,
|
||||
// http服务端口
|
||||
"httpPort": 3000,
|
||||
// 是否启用正向websocket服务
|
||||
"enableWs": false,
|
||||
// 正向websocket服务端口
|
||||
"wsPort": 3001,
|
||||
// 是否启用反向websocket服务
|
||||
"enableWsReverse": false,
|
||||
// 反向websocket对接的地址, 如["ws://127.0.0.1:8080/onebot/v11/ws"]
|
||||
"wsReverseUrls": [],
|
||||
// 是否启用http上报服务
|
||||
"enableHttpPost": false,
|
||||
// http上报地址, 如["http://127.0.0.1:8080/onebot/v11/http"]
|
||||
"httpPostUrls": [],
|
||||
// http上报密钥,可为空
|
||||
"httpSecret": "",
|
||||
// 消息上报格式,array为消息组,string为cq码字符串
|
||||
"messagePostFormat": "array",
|
||||
// 是否上报自己发送的消息
|
||||
"reportSelfMessage": false,
|
||||
// 是否开启调试模式,开启后上报消息会携带一个raw字段,为原始消息内容
|
||||
"debug": false,
|
||||
// 调用get_file接口时如果获取不到url则使用base64字段返回文件内容
|
||||
"enableLocalFile2Url": true,
|
||||
// ws心跳间隔,单位毫秒
|
||||
"heartInterval": 30000,
|
||||
// access_token,可以为空
|
||||
"token": ""
|
||||
}
|
||||
|
||||
```
|
||||
|
||||
### Windows 启动
|
||||
|
||||
运行`powershell ./napcat.ps1`, 或者 `napcat.bat`,如果出现乱码,可以尝试运行`napcat-utf8.ps1` 或 `napcat-utf8.bat`
|
||||
|
||||
*如果出现 powershell 运行不了,以管理员身份打开 powershell,输入 `Set-ExecutionPolicy RemoteSigned`*
|
||||
|
||||
### Linux 启动
|
||||
|
||||
运行`napcat.sh`
|
||||
|
||||
## 使用无需扫码快速登录
|
||||
|
||||
前提是你已经成功登录过QQ,可以加参数` -q <你的QQ>` 进行登录,如`napcat.sh -q 1234567`
|
||||
|
||||
## 安装
|
||||
|
||||
### Linux安装
|
||||
|
||||
#### 安装 Linux QQ(22741),已经安装了的可以跳过
|
||||
|
||||
目前还在研究怎么精简安装,暂时只能安装官方QQ整体依赖
|
||||
|
||||
下载QQ
|
||||
|
||||
[deb x86版本](https://dldir1.qq.com/qqfile/qq/QQNT/Linux/QQ_3.2.7_240403_amd64_01.deb)
|
||||
[deb arm版本](https://dldir1.qq.com/qqfile/qq/QQNT/Linux/QQ_3.2.7_240403_arm64_01.deb)
|
||||
|
||||
[rpm x86版本](https://dldir1.qq.com/qqfile/qq/QQNT/Linux/QQ_3.2.7_240403_x86_64_01.rpm)
|
||||
[rpm arm版本](https://dldir1.qq.com/qqfile/qq/QQNT/Linux/QQ_3.2.7_240403_aarch64_01.rpm)
|
||||
|
||||
```bash
|
||||
sudo apt install ./qq.deb
|
||||
```
|
||||
|
||||
```bash
|
||||
安装QQ的依赖
|
||||
sudo apt install libgbm1 libasound2
|
||||
```
|
||||
|
||||
### Windows 安装
|
||||
|
||||
#### 安装Windows QQ(22741),已经安装了的可以跳过
|
||||
|
||||
[Windows版本QQ下载](https://dldir1.qq.com/qqfile/qq/QQNT/Windows/QQ_9.9.9_240403_x64_01.exe)
|
||||
|
||||
### 编译安装 NapCat
|
||||
|
||||
**如果你是直接下载编译好的版本,可以跳过这一步**
|
||||
|
||||
准备环境 [node18.18](https://nodejs.org/download/release/v18.18.2/)
|
||||
|
||||
```
|
||||
export NODE_ENV=production
|
||||
npm install
|
||||
```
|
||||
|
||||
## 常见问题
|
||||
|
||||
### 二维码无法扫描
|
||||
|
||||
NapCat 会自动保存二维码到目录,可以手动打开图片扫描
|
||||
|
||||
如果没有条件访问本地目录,可以将二维码解析的 url 复制到二维码生成网站上生成二维码,然后手机QQ扫描
|
||||
|
||||
### 语音、视频发送失败
|
||||
|
||||
需要配置 ffmpeg,将 ffmpeg 目录加入环境变量,如果仍未生效,可以修改 napcat 启动脚本加入 FFMPEG_PATH 变量指定到 ffmpeg
|
||||
程序的完整路径
|
||||
|
||||
如 Windows 上修改 napcat.ps1,在第一行加入
|
||||
|
||||
```powershell
|
||||
$env:FFMPEG_PATH="d:\ffmpeg\bin\ffmpeg.exe"
|
||||
```
|
||||
|
||||
### 出现 error code v2:-1 之类的提示
|
||||
|
||||
不用管,这是正常现象,是因为 QQ 本身的问题,不影响使用
|
||||
|
||||
## API 文档
|
||||
|
||||
参考 [LLOneBot](https://llonebot.github.io/zh-CN/develop/api) 的文档
|
||||
|
||||
<!--
|
||||
QQ群:545402644
|
||||
-->
|
||||
|
||||
## 声明
|
||||
## 项目声明
|
||||
|
||||
* 请不要在无关地方宣传NapCatQQ,本项目只是用于学习 node 相关知识,切勿用于违法用途
|
||||
|
||||
* NapCat 不会收集用户隐私信息,但是未来可能会为了更好的利于 NapCat 的优化会收集一些设备信息,如 cpu 架构,系统版本等
|
||||
|
||||
## 相关链接
|
||||
|
||||
[TG群](https://t.me/+nLZEnpne-pQ1OWFl)
|
||||
[Telegram Link](https://t.me/+nLZEnpne-pQ1OWFl)
|
||||
|
||||
## 鸣谢名单
|
||||
[OpenShamrock]()
|
||||
|
||||
[Lagrange]()
|
||||
[Lagrange](https://github.com/LagrangeDev/Lagrange.Core)
|
||||
|
||||
<!--
|
||||
QQ群:545402644
|
||||
-->
|
||||
|
12
package.json
12
package.json
@@ -2,14 +2,15 @@
|
||||
"name": "napcat",
|
||||
"private": true,
|
||||
"type": "module",
|
||||
"version": "1.0.2",
|
||||
"version": "1.3.0",
|
||||
"scripts": {
|
||||
"watch:dev": "vite --mode development",
|
||||
"watch:prod": "vite --mode production",
|
||||
"build:dev": "vite build --mode development",
|
||||
"build:prod": "vite build --mode production",
|
||||
"build": "npm run build:dev",
|
||||
"build:core": "cd ./src/core && vite build --mode production",
|
||||
"build:core": "cd ./src/core && npm run build && cd ../.. && node ./script/copy-core.cjs",
|
||||
"build:webui": "cd ./src/webui && vite build",
|
||||
"watch": "npm run watch:dev",
|
||||
"debug-win": "powershell dist/napcat.ps1",
|
||||
"lint": "eslint --fix src/**/*.{js,ts}",
|
||||
@@ -21,6 +22,7 @@
|
||||
"@rollup/plugin-commonjs": "^25.0.7",
|
||||
"@rollup/plugin-node-resolve": "^15.2.3",
|
||||
"@rollup/plugin-typescript": "^11.1.6",
|
||||
"@types/cors": "^2.8.17",
|
||||
"@types/express": "^4.17.21",
|
||||
"@types/figlet": "^1.5.8",
|
||||
"@types/fluent-ffmpeg": "^2.1.24",
|
||||
@@ -47,17 +49,17 @@
|
||||
},
|
||||
"dependencies": {
|
||||
"commander": "^12.0.0",
|
||||
"cors": "^2.8.5",
|
||||
"express": "^5.0.0-beta.2",
|
||||
"fast-xml-parser": "^4.3.6",
|
||||
"file-type": "^19.0.0",
|
||||
"fluent-ffmpeg": "^2.1.2",
|
||||
"image-size": "^1.1.1",
|
||||
"log4js": "^6.9.1",
|
||||
"protobufjs": "^7.2.6",
|
||||
"qrcode-terminal": "^0.12.0",
|
||||
"silk-wasm": "^3.3.4",
|
||||
"sqlite3": "^5.1.7",
|
||||
"uuid": "^9.0.1",
|
||||
"ws": "^8.16.0",
|
||||
"yaml": "^2.4.1"
|
||||
"ws": "^8.16.0"
|
||||
}
|
||||
}
|
||||
|
13
script/checkVersion.cjs
Normal file
13
script/checkVersion.cjs
Normal file
@@ -0,0 +1,13 @@
|
||||
let fs = require("fs");
|
||||
let process = require("process")
|
||||
console.log("[NapCat] [CheckVersion] 开始检测当前仓库版本...");
|
||||
let currentVersion = require("../package.json").version;
|
||||
let targetVersion = process.env.VERSION;
|
||||
console.log("[NapCat] [CheckVersion] currentVersion:", currentVersion, " targetVersion:", targetVersion);
|
||||
// fs.mkdirSync("./dist");
|
||||
if (currentVersion === targetVersion) {
|
||||
fs.writeFileSync("./checkVersion.sh", "#!/bin/bashe\necho \"CheckVersion Is Done\"")
|
||||
} else {
|
||||
let runscript = "sed -i 's/\"version\": \"" + currentVersion + "\"/\"version\": \"" + targetVersion + "\"/g' package.json";
|
||||
fs.writeFileSync("./checkVersion.sh", "#!/bin/bashe\ngit config --global user.email \"bot@test.wumiao.wang\"\n git config --global user.name \"Version\"\n" + runscript + "\ngit add .\n git commit -m \"chore:version change\"\n git push -u origin main")
|
||||
}
|
32
script/copy-core.cjs
Normal file
32
script/copy-core.cjs
Normal file
@@ -0,0 +1,32 @@
|
||||
let fs = require('fs');
|
||||
let path = require('path');
|
||||
|
||||
const coreDistDir = path.join(path.resolve(__dirname, '../'), 'src/core/dist/core/src');
|
||||
const coreLibDir = path.join(path.resolve(__dirname, '../'), 'src/core.lib/src');
|
||||
|
||||
function copyDir(currentPath, outputDir) {
|
||||
fs.readdir(currentPath, { withFileTypes: true }, (err, entries) => {
|
||||
if (err?.errno === -4058) return;
|
||||
|
||||
entries.forEach(entry => {
|
||||
const localBasePath = path.join(currentPath, entry.name);
|
||||
const outputLocalBasePath = path.join(outputDir, entry.name);
|
||||
|
||||
if (entry.isDirectory()) {
|
||||
// 如果是目录,递归调用
|
||||
if (!fs.existsSync(outputLocalBasePath)) {
|
||||
fs.mkdirSync(outputLocalBasePath, { recursive: true });
|
||||
}
|
||||
copyDir(localBasePath, outputLocalBasePath);
|
||||
}
|
||||
else{
|
||||
// 如果是文件,直接复制
|
||||
fs.copyFile(localBasePath, outputLocalBasePath, (err) => {
|
||||
if (err) throw err;
|
||||
});
|
||||
}
|
||||
});
|
||||
});
|
||||
}
|
||||
|
||||
copyDir(coreDistDir, coreLibDir);
|
21
script/gen-version.ts
Normal file
21
script/gen-version.ts
Normal file
@@ -0,0 +1,21 @@
|
||||
import fs from 'fs'
|
||||
import path from 'path'
|
||||
import { version } from '../src/onebot11/version'
|
||||
|
||||
const manifestPath = path.join(__dirname, '../package.json')
|
||||
|
||||
function readManifest (): any {
|
||||
if (fs.existsSync(manifestPath)) {
|
||||
return JSON.parse(fs.readFileSync(manifestPath, 'utf-8'))
|
||||
}
|
||||
}
|
||||
|
||||
function writeManifest (manifest: any) {
|
||||
fs.writeFileSync(manifestPath, JSON.stringify(manifest, null, 2))
|
||||
}
|
||||
|
||||
const manifest = readManifest()
|
||||
if (version !== manifest.version) {
|
||||
manifest.version = version
|
||||
writeManifest(manifest)
|
||||
}
|
3
script/napcat-custom.bat
Normal file
3
script/napcat-custom.bat
Normal file
@@ -0,0 +1,3 @@
|
||||
chcp 65001
|
||||
set ELECTRON_RUN_AS_NODE=1
|
||||
"H:\Program Files\QQNT最新版\QQ.exe" %~dp0/napcat.cjs %*
|
@@ -1,85 +0,0 @@
|
||||
import {
|
||||
type Friend,
|
||||
type FriendRequest,
|
||||
type Group,
|
||||
type GroupMember, GroupNotify,
|
||||
type SelfInfo
|
||||
} from '@/core/qqnt/entities';
|
||||
import { isNumeric } from './utils/helper';
|
||||
import { log } from '@/common/utils/log';
|
||||
|
||||
export const selfInfo: SelfInfo = {
|
||||
uid: '',
|
||||
uin: '',
|
||||
nick: '',
|
||||
online: true
|
||||
};
|
||||
|
||||
// groupCode -> Group
|
||||
export const groups: Map<string, Group> = new Map<string, Group>();
|
||||
|
||||
// 群号 -> 群成员map(uid=>GroupMember)
|
||||
export const groupMembers: Map<string, Map<string, GroupMember>> = new Map<string, Map<string, GroupMember>>();
|
||||
|
||||
// uid -> Friend
|
||||
export const friends: Map<string, Friend> = new Map<string, Friend>();
|
||||
|
||||
export const friendRequests: Record<string, FriendRequest> = {}; // flag->FriendRequest
|
||||
export const groupNotifies: Record<string, GroupNotify> = {}; // flag->GroupNotify
|
||||
|
||||
export const napCatError = {
|
||||
ffmpegError: '',
|
||||
httpServerError: '',
|
||||
wsServerError: '',
|
||||
otherError: 'NapCat未能正常启动,请检查日志查看错误'
|
||||
};
|
||||
|
||||
export async function getFriend(uinOrUid: string): Promise<Friend | undefined> {
|
||||
uinOrUid = uinOrUid.toString();
|
||||
if (isNumeric(uinOrUid)) {
|
||||
const friendList = Array.from(friends.values());
|
||||
return friendList.find(friend => friend.uin === uinOrUid);
|
||||
} else {
|
||||
return friends.get(uinOrUid);
|
||||
}
|
||||
}
|
||||
|
||||
export async function getGroup(qq: string): Promise<Group | undefined> {
|
||||
const group = groups.get(qq.toString());
|
||||
return group;
|
||||
}
|
||||
|
||||
export async function getGroupMember(groupQQ: string | number, memberUinOrUid: string | number) {
|
||||
groupQQ = groupQQ.toString();
|
||||
memberUinOrUid = memberUinOrUid.toString();
|
||||
const members = groupMembers.get(groupQQ);
|
||||
if (!members) {
|
||||
return null;
|
||||
}
|
||||
// log('getGroupMember', members);
|
||||
if (isNumeric(memberUinOrUid)) {
|
||||
return Array.from(members.values()).find(member => member.uin === memberUinOrUid);
|
||||
} else {
|
||||
return members.get(memberUinOrUid);
|
||||
}
|
||||
}
|
||||
|
||||
export async function refreshGroupMembers(groupQQ: string) {
|
||||
// const group = groups.find(group => group.groupCode === groupQQ)
|
||||
// if (group) {
|
||||
// group.members = await NTQQGroupApi.getGroupMembers(groupQQ)
|
||||
// }
|
||||
}
|
||||
|
||||
export const uid2UinMap: Record<string, string> = {}; // 一串加密的字符串(uid) -> qq号
|
||||
|
||||
export function getUidByUin(uin: string) {
|
||||
for (const uid in uid2UinMap) {
|
||||
if (uid2UinMap[uid] === uin) {
|
||||
return uid;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
export const tempGroupCodeMap: Record<string, string> = {}; // peerUid => 群号
|
||||
|
@@ -1,17 +1,19 @@
|
||||
import express, { Express, Request, Response } from 'express';
|
||||
import cors from 'cors';
|
||||
import http from 'http';
|
||||
import { log } from '../utils/log';
|
||||
import { log, logDebug, logError } from '../utils/log';
|
||||
import { ob11Config } from '@/onebot11/config';
|
||||
|
||||
type RegisterHandler = (res: Response, payload: any) => Promise<any>
|
||||
|
||||
export abstract class HttpServerBase {
|
||||
name: string = 'LLOneBot';
|
||||
name: string = 'NapCatQQ';
|
||||
private readonly expressAPP: Express;
|
||||
private server: http.Server | null = null;
|
||||
|
||||
constructor() {
|
||||
this.expressAPP = express();
|
||||
this.expressAPP.use(cors());
|
||||
this.expressAPP.use(express.urlencoded({ extended: true, limit: '5000mb' }));
|
||||
this.expressAPP.use((req, res, next) => {
|
||||
// 兼容处理没有带content-type的请求
|
||||
@@ -21,7 +23,7 @@ export abstract class HttpServerBase {
|
||||
// 调用原始的express.json()处理器
|
||||
originalJson(req, res, (err) => {
|
||||
if (err) {
|
||||
log('Error parsing JSON:', err);
|
||||
logError('Error parsing JSON:', err);
|
||||
return res.status(400).send('Invalid JSON');
|
||||
}
|
||||
next();
|
||||
@@ -35,14 +37,14 @@ export abstract class HttpServerBase {
|
||||
const authHeader = req.get('authorization');
|
||||
if (authHeader) {
|
||||
clientToken = authHeader.split('Bearer ').pop() || '';
|
||||
log('receive http header token', clientToken);
|
||||
logDebug('receive http header token', clientToken);
|
||||
} else if (req.query.access_token) {
|
||||
if (Array.isArray(req.query.access_token)) {
|
||||
clientToken = req.query.access_token[0].toString();
|
||||
} else {
|
||||
clientToken = req.query.access_token.toString();
|
||||
}
|
||||
log('receive http url token', clientToken);
|
||||
logDebug('receive http url token', clientToken);
|
||||
}
|
||||
|
||||
if (serverToken && clientToken != serverToken) {
|
||||
@@ -51,14 +53,14 @@ export abstract class HttpServerBase {
|
||||
next();
|
||||
}
|
||||
|
||||
start(port: number) {
|
||||
start(port: number, host: string) {
|
||||
try {
|
||||
this.expressAPP.get('/', (req: Request, res: Response) => {
|
||||
res.send(`${this.name}已启动`);
|
||||
});
|
||||
this.listen(port);
|
||||
this.listen(port, host);
|
||||
} catch (e: any) {
|
||||
log('HTTP服务启动失败', e.toString());
|
||||
logError('HTTP服务启动失败', e.toString());
|
||||
// llonebotError.httpServerError = "HTTP服务启动失败, " + e.toString()
|
||||
}
|
||||
}
|
||||
@@ -71,9 +73,9 @@ export abstract class HttpServerBase {
|
||||
}
|
||||
}
|
||||
|
||||
restart(port: number) {
|
||||
restart(port: number, host: string) {
|
||||
this.stop();
|
||||
this.start(port);
|
||||
this.start(port, host);
|
||||
}
|
||||
|
||||
abstract handleFailed(res: Response, payload: any, err: any): void
|
||||
@@ -86,7 +88,7 @@ export abstract class HttpServerBase {
|
||||
// @ts-expect-error wait fix
|
||||
if (!this.expressAPP[method]) {
|
||||
const err = `${this.name} register router failed,${method} not exist`;
|
||||
log(err);
|
||||
logError(err);
|
||||
throw err;
|
||||
}
|
||||
// @ts-expect-error wait fix
|
||||
@@ -94,8 +96,10 @@ export abstract class HttpServerBase {
|
||||
let payload = req.body;
|
||||
if (method == 'get') {
|
||||
payload = req.query;
|
||||
} else if (req.query) {
|
||||
payload = { ...req.query, ...req.body };
|
||||
}
|
||||
log('收到http请求', url, payload);
|
||||
logDebug('收到http请求', url, payload);
|
||||
try {
|
||||
res.send(await handler(res, payload));
|
||||
} catch (e: any) {
|
||||
@@ -104,10 +108,15 @@ export abstract class HttpServerBase {
|
||||
});
|
||||
}
|
||||
|
||||
protected listen(port: number) {
|
||||
this.server = this.expressAPP.listen(port, '0.0.0.0', () => {
|
||||
const info = `${this.name} started 0.0.0.0:${port}`;
|
||||
log(info);
|
||||
});
|
||||
protected listen(port: number, host: string = '0.0.0.0') {
|
||||
host = host || '0.0.0.0';
|
||||
try {
|
||||
this.server = this.expressAPP.listen(port, host, () => {
|
||||
const info = `${this.name} started ${host}:${port}`;
|
||||
log(info);
|
||||
});
|
||||
}catch (e: any) {
|
||||
logError('HTTP服务启动失败, 请检查监听的ip地址和端口', e.stack.toString());
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@@ -27,11 +27,16 @@ export class WebsocketServerBase {
|
||||
constructor() {
|
||||
}
|
||||
|
||||
start(port: number) {
|
||||
start(port: number, host: string = '') {
|
||||
try {
|
||||
this.ws = new WebSocketServer({ port });
|
||||
this.ws = new WebSocketServer({
|
||||
port ,
|
||||
host: '',
|
||||
maxPayload: 1024 * 1024 * 1024
|
||||
});
|
||||
log(`ws服务启动成功, ${host}:${port}`);
|
||||
} catch (e: any) {
|
||||
throw Error('ws服务启动失败, ' + e.toString());
|
||||
throw Error('ws服务启动失败, 请检查监听的ip和端口' + e.toString());
|
||||
}
|
||||
this.ws.on('connection', (wsClient, req) => {
|
||||
const url: string = req.url!.split('?').shift() || '/';
|
||||
|
35
src/common/utils/AsyncQueue.ts
Normal file
35
src/common/utils/AsyncQueue.ts
Normal file
@@ -0,0 +1,35 @@
|
||||
import { sleep } from '@/common/utils/helper';
|
||||
|
||||
type AsyncQueueTask = (() => void) | (()=>Promise<void>);
|
||||
|
||||
|
||||
export class AsyncQueue {
|
||||
private tasks: (AsyncQueueTask)[] = [];
|
||||
|
||||
public addTask(task: AsyncQueueTask) {
|
||||
this.tasks.push(task);
|
||||
// console.log('addTask', this.tasks.length);
|
||||
if (this.tasks.length === 1) {
|
||||
this.runQueue().then().catch(()=>{});
|
||||
}
|
||||
}
|
||||
|
||||
private async runQueue() {
|
||||
// console.log('runQueue', this.tasks.length);
|
||||
while (this.tasks.length > 0) {
|
||||
const task = this.tasks[0];
|
||||
// console.log('typeof task', typeof task);
|
||||
try {
|
||||
const taskRet = task();
|
||||
// console.log('type of taskRet', typeof taskRet, taskRet);
|
||||
if (taskRet instanceof Promise) {
|
||||
await taskRet;
|
||||
}
|
||||
} catch (e) {
|
||||
console.error(e);
|
||||
}
|
||||
this.tasks.shift();
|
||||
await sleep(100);
|
||||
}
|
||||
}
|
||||
}
|
67
src/common/utils/ConfigBase.ts
Normal file
67
src/common/utils/ConfigBase.ts
Normal file
@@ -0,0 +1,67 @@
|
||||
import path from 'node:path';
|
||||
import fs from 'node:fs';
|
||||
import { log, logDebug, logError } from '@/common/utils/log';
|
||||
|
||||
const configDir = path.resolve(__dirname, 'config');
|
||||
fs.mkdirSync(configDir, { recursive: true });
|
||||
|
||||
|
||||
export class ConfigBase<T>{
|
||||
|
||||
constructor() {
|
||||
}
|
||||
|
||||
protected getKeys(): string[] | null {
|
||||
// 决定 key 在json配置文件中的顺序
|
||||
return null;
|
||||
}
|
||||
|
||||
getConfigDir(){
|
||||
const configDir = path.resolve(__dirname, 'config');
|
||||
fs.mkdirSync(configDir, { recursive: true });
|
||||
return configDir;
|
||||
}
|
||||
getConfigPath(): string {
|
||||
throw new Error('Method not implemented.');
|
||||
}
|
||||
|
||||
read() {
|
||||
const configPath = this.getConfigPath();
|
||||
if (!fs.existsSync(configPath)) {
|
||||
try{
|
||||
fs.writeFileSync(configPath, JSON.stringify(this, this.getKeys(), 2));
|
||||
log(`配置文件${configPath}已创建\n如果修改此文件后需要重启 NapCat 生效`);
|
||||
}
|
||||
catch (e: any) {
|
||||
logError(`创建配置文件 ${configPath} 时发生错误:`, e.message);
|
||||
}
|
||||
return this;
|
||||
}
|
||||
try {
|
||||
const data = JSON.parse(fs.readFileSync(configPath, 'utf-8'));
|
||||
logDebug(`配置文件${configPath}已加载`, data);
|
||||
Object.assign(this, data);
|
||||
// eslint-disable-next-line @typescript-eslint/ban-ts-comment
|
||||
// @ts-expect-error
|
||||
this.save(this); // 保存一次,让新版本的字段写入
|
||||
return this;
|
||||
} catch (e: any) {
|
||||
if (e instanceof SyntaxError) {
|
||||
logError(`配置文件 ${configPath} 格式错误,请检查配置文件:`, e.message);
|
||||
} else {
|
||||
logError(`读取配置文件 ${configPath} 时发生错误:`, e.message);
|
||||
}
|
||||
return this;
|
||||
}
|
||||
}
|
||||
|
||||
save(config: T) {
|
||||
Object.assign(this, config);
|
||||
const configPath = this.getConfigPath();
|
||||
try {
|
||||
fs.writeFileSync(configPath, JSON.stringify(this, this.getKeys(), 2));
|
||||
} catch (e: any) {
|
||||
logError(`保存配置文件 ${configPath} 时发生错误:`, e.message);
|
||||
}
|
||||
}
|
||||
}
|
@@ -37,24 +37,36 @@ type QQVersionConfigInfo = {
|
||||
}
|
||||
|
||||
let _qqVersionConfigInfo: QQVersionConfigInfo = {
|
||||
'baseVersion': '9.9.9-22578',
|
||||
'curVersion': '9.9.9-22578',
|
||||
'baseVersion': '9.9.9-23361',
|
||||
'curVersion': '9.9.9-23361',
|
||||
'prevVersion': '',
|
||||
'onErrorVersions': [],
|
||||
'buildId': '22578'
|
||||
'buildId': '23361'
|
||||
};
|
||||
|
||||
if (fs.existsSync(configVersionInfoPath)) {
|
||||
_qqVersionConfigInfo = JSON.parse(fs.readFileSync(configVersionInfoPath).toString());
|
||||
try {
|
||||
const _ =JSON.parse(fs.readFileSync(configVersionInfoPath).toString());
|
||||
_qqVersionConfigInfo = Object.assign(_qqVersionConfigInfo, _);
|
||||
} catch (e) {
|
||||
console.error('Load QQ version config info failed, Use default version', e);
|
||||
}
|
||||
}
|
||||
|
||||
export const qqVersionConfigInfo: QQVersionConfigInfo = _qqVersionConfigInfo;
|
||||
|
||||
export const qqPkgInfo: QQPkgInfo = require(pkgInfoPath);
|
||||
// platform_type: 3,
|
||||
// app_type: 4,
|
||||
// app_version: '9.9.9-23159',
|
||||
// qua: 'V1_WIN_NQ_9.9.9_23159_GW_B',
|
||||
// appid: '537213764',
|
||||
// platVer: '10.0.26100',
|
||||
// clientVer: '9.9.9-23159',
|
||||
|
||||
let _appid: string = '537213335'; // 默认为 Windows 平台的 appid
|
||||
let _appid: string = '537213803'; // 默认为 Windows 平台的 appid
|
||||
if (systemPlatform === 'linux') {
|
||||
_appid = '537213710';
|
||||
_appid = '537213827';
|
||||
}
|
||||
// todo: mac 平台的 appid
|
||||
export const appid = _appid;
|
||||
|
@@ -1,7 +1,7 @@
|
||||
import fs from 'fs';
|
||||
import { encode, getDuration, getWavFileInfo, isWav } from 'silk-wasm';
|
||||
import fsPromise from 'fs/promises';
|
||||
import { log } from './log';
|
||||
import { log, logError } from './log';
|
||||
import path from 'node:path';
|
||||
import { v4 as uuidv4 } from 'uuid';
|
||||
import { spawn } from 'node:child_process';
|
||||
@@ -129,7 +129,7 @@ export async function encodeSilk(filePath: string) {
|
||||
};
|
||||
}
|
||||
} catch (error: any) {
|
||||
log('convert silk failed', error.stack);
|
||||
logError('convert silk failed', error.stack);
|
||||
return {};
|
||||
}
|
||||
}
|
||||
|
19
src/common/utils/cpmodule.ts
Normal file
19
src/common/utils/cpmodule.ts
Normal file
@@ -0,0 +1,19 @@
|
||||
import * as os from 'os';
|
||||
import path from 'node:path';
|
||||
import fs from 'fs';
|
||||
|
||||
export function getModuleWithArchName(moduleName: string) {
|
||||
const systemPlatform = os.platform();
|
||||
const cpuArch = os.arch();
|
||||
return `${moduleName}-${systemPlatform}-${cpuArch}.node`;
|
||||
}
|
||||
|
||||
export function cpModule(moduleName: string) {
|
||||
const currentDir = path.resolve(__dirname);
|
||||
const fileName = `./${getModuleWithArchName(moduleName)}`;
|
||||
try {
|
||||
fs.copyFileSync(path.join(currentDir, fileName), path.join(currentDir, `${moduleName}.node`));
|
||||
} catch (e) {
|
||||
|
||||
}
|
||||
}
|
@@ -1,323 +0,0 @@
|
||||
import { ElementType, FileElement, PicElement, PttElement, RawMessage, VideoElement } from '@/core/qqnt/entities';
|
||||
|
||||
import sqlite3 from 'sqlite3';
|
||||
import { log } from '@/common/utils/log';
|
||||
|
||||
type DBMsg = {
|
||||
id: number,
|
||||
longId: string,
|
||||
seq: number,
|
||||
peerUid: string,
|
||||
msg: string
|
||||
}
|
||||
|
||||
type DBFile = {
|
||||
name: string; // 文件名
|
||||
path: string;
|
||||
url: string;
|
||||
size: number;
|
||||
uuid: string;
|
||||
msgId: string;
|
||||
elementId: string;
|
||||
element: PicElement | VideoElement | FileElement | PttElement;
|
||||
elementType: ElementType.PIC | ElementType.VIDEO | ElementType.FILE | ElementType.PTT;
|
||||
}
|
||||
|
||||
|
||||
class DBUtilBase {
|
||||
protected db: sqlite3.Database | undefined;
|
||||
|
||||
createConnection(dbPath: string) {
|
||||
if (this.db) {
|
||||
return;
|
||||
}
|
||||
this.db = new sqlite3.Database(dbPath, sqlite3.OPEN_READWRITE | sqlite3.OPEN_CREATE, (err) => {
|
||||
if (err) {
|
||||
log('Could not connect to database', err);
|
||||
return;
|
||||
}
|
||||
this.createTable();
|
||||
});
|
||||
}
|
||||
|
||||
protected createTable() {
|
||||
throw new Error('Method not implemented.');
|
||||
}
|
||||
|
||||
close() {
|
||||
this.db?.close();
|
||||
}
|
||||
}
|
||||
|
||||
class DBUtil extends DBUtilBase {
|
||||
private msgCache: Map<string, RawMessage> = new Map<string, RawMessage>();
|
||||
|
||||
constructor() {
|
||||
super();
|
||||
const interval = 1000 * 60 * 10; // 10分钟清理一次缓存
|
||||
setInterval(() => {
|
||||
log('清理消息缓存');
|
||||
this.msgCache.forEach((msg, key) => {
|
||||
if ((Date.now() - parseInt(msg.msgTime) * 1000) > interval) {
|
||||
this.msgCache.delete(key);
|
||||
}
|
||||
});
|
||||
}, interval);
|
||||
}
|
||||
|
||||
|
||||
protected createTable() {
|
||||
// 消息记录
|
||||
const createTableSQL = `
|
||||
CREATE TABLE IF NOT EXISTS msgs (
|
||||
id INTEGER PRIMARY KEY AUTOINCREMENT,
|
||||
long_id TEXT NOT NULL UNIQUE,
|
||||
seq INTEGER NOT NULL,
|
||||
peer_uid TEXT NOT NULL,
|
||||
msg TEXT NOT NULL
|
||||
)`;
|
||||
this.db!.run(createTableSQL, function (err) {
|
||||
if (err) {
|
||||
log('Could not create table', err);
|
||||
}
|
||||
});
|
||||
|
||||
// 文件缓存
|
||||
const createFileTableSQL = `
|
||||
CREATE TABLE IF NOT EXISTS files (
|
||||
id INTEGER PRIMARY KEY AUTOINCREMENT,
|
||||
name TEXT NOT NULL,
|
||||
path TEXT NOT NULL,
|
||||
url TEXT,
|
||||
size INTEGER NOT NULL,
|
||||
uuid TEXT,
|
||||
elementType INTEGER,
|
||||
element TEXT NOT NULL,
|
||||
elementId TEXT NOT NULL,
|
||||
msgId TEXT NOT NULL
|
||||
)`;
|
||||
this.db!.run(createFileTableSQL, function (err) {
|
||||
if (err) {
|
||||
log('Could not create table files', err);
|
||||
}
|
||||
});
|
||||
|
||||
// 接收到的临时会话消息uid
|
||||
const createTempUinTableSQL = `
|
||||
CREATE TABLE IF NOT EXISTS temp_uins (
|
||||
id INTEGER PRIMARY KEY AUTOINCREMENT,
|
||||
uid TEXT,
|
||||
uin TEXT
|
||||
)`;
|
||||
this.db!.run(createTempUinTableSQL, function (err) {
|
||||
if (err) {
|
||||
log('Could not create table temp_uins', err);
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
private async getMsg(query: string, params: any[]) {
|
||||
const stmt = this.db!.prepare(query);
|
||||
return new Promise<RawMessage | null>((resolve, reject) => {
|
||||
stmt.get(...params, (err: any, row: DBMsg) => {
|
||||
// log("getMsg", row, err);
|
||||
if (err) {
|
||||
log('Could not get msg by short id', err);
|
||||
resolve(null);
|
||||
}
|
||||
try {
|
||||
const msg = JSON.parse(row.msg);
|
||||
msg.id = row.id;
|
||||
return resolve(msg);
|
||||
} catch (e) {
|
||||
return resolve(null);
|
||||
}
|
||||
});
|
||||
});
|
||||
}
|
||||
|
||||
async getMsgByShortId(shortId: number): Promise<RawMessage | null> {
|
||||
const getStmt = 'SELECT * FROM msgs WHERE id = ?';
|
||||
return this.getMsg(getStmt, [shortId]);
|
||||
}
|
||||
|
||||
async getMsgByLongId(longId: string): Promise<RawMessage | null> {
|
||||
if (this.msgCache.has(longId)) {
|
||||
return this.msgCache.get(longId)!;
|
||||
}
|
||||
return this.getMsg('SELECT * FROM msgs WHERE long_id = ?', [longId]);
|
||||
}
|
||||
|
||||
async getMsgBySeq(peerUid: string, seq: string): Promise<RawMessage | null> {
|
||||
const stmt = 'SELECT * FROM msgs WHERE peer_uid = ? AND seq = ?';
|
||||
return this.getMsg(stmt, [peerUid, seq]);
|
||||
}
|
||||
|
||||
async addMsg(msg: RawMessage, update = true): Promise<number> {
|
||||
log('正在记录消息到数据库', msg.msgId);
|
||||
const existMsg = await this.getMsgByLongId(msg.msgId);
|
||||
if (existMsg) {
|
||||
// log('消息已存在,更新数据库', msg.msgId);
|
||||
if (update) this.updateMsg(msg).then();
|
||||
return existMsg.id!;
|
||||
}
|
||||
const stmt = this.db!.prepare('INSERT INTO msgs (long_id, seq, peer_uid, msg) VALUES (?, ?, ?, ?)');
|
||||
|
||||
// const runAsync = promisify(stmt.run.bind(stmt));
|
||||
return new Promise((resolve, reject) => {
|
||||
// eslint-disable-next-line @typescript-eslint/no-this-alias
|
||||
const dbInstance = this;
|
||||
stmt.run(msg.msgId, msg.msgSeq, msg.peerUid, JSON.stringify(msg), function (err: any) {
|
||||
if (err) {
|
||||
if (err.errno === 19) {
|
||||
// log('消息已存在,更新数据库', msg.msgId);
|
||||
dbInstance.getMsgByLongId(msg.msgId).then((msg: RawMessage | null) => {
|
||||
if (msg) {
|
||||
dbInstance.msgCache.set(msg.msgId, msg);
|
||||
// log('获取消息短id成功', msg.id);
|
||||
resolve(msg.id!);
|
||||
} else {
|
||||
log('db could not get msg by long id', err);
|
||||
resolve(-1);
|
||||
}
|
||||
});
|
||||
} else {
|
||||
log('db could not add msg', err);
|
||||
resolve(-1);
|
||||
}
|
||||
} else {
|
||||
// log("addMsg", this);
|
||||
// eslint-disable-next-line @typescript-eslint/ban-ts-comment
|
||||
// @ts-expect-error
|
||||
msg.id = this.lastID;
|
||||
dbInstance.msgCache.set(msg.msgId, msg);
|
||||
// eslint-disable-next-line @typescript-eslint/ban-ts-comment
|
||||
// log('获取消息短id成功', this.lastID);
|
||||
// eslint-disable-next-line @typescript-eslint/ban-ts-comment
|
||||
// @ts-expect-error
|
||||
resolve(this.lastID);
|
||||
}
|
||||
});
|
||||
});
|
||||
}
|
||||
|
||||
async updateMsg(msg: RawMessage) {
|
||||
const existMsg = this.msgCache.get(msg.msgId);
|
||||
if (existMsg) {
|
||||
Object.assign(existMsg, msg);
|
||||
}
|
||||
const stmt = this.db!.prepare('UPDATE msgs SET msg = ?, seq = ? WHERE long_id = ?');
|
||||
try {
|
||||
stmt.run(JSON.stringify(msg), msg.msgSeq, msg.msgId);
|
||||
} catch (e) {
|
||||
log('updateMsg db error', e);
|
||||
}
|
||||
}
|
||||
|
||||
async addFileCache(file: DBFile) {
|
||||
const stmt = this.db!.prepare('INSERT INTO files (name, path, url, size, uuid, elementType ,element, elementId, msgId) VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?)');
|
||||
return new Promise((resolve, reject) => {
|
||||
stmt.run(file.name, file.path, file.url, file.size, file.uuid,
|
||||
file.elementType,
|
||||
JSON.stringify(file.element),
|
||||
file.elementId,
|
||||
file.msgId,
|
||||
function (err: any) {
|
||||
if (err) {
|
||||
log('db could not add file', err);
|
||||
reject(err);
|
||||
}
|
||||
resolve(null);
|
||||
});
|
||||
});
|
||||
}
|
||||
|
||||
private async getFileCache(query: string, params: any[]) {
|
||||
const stmt = this.db!.prepare(query);
|
||||
return new Promise<DBFile | null>((resolve, reject) => {
|
||||
stmt.get(...params, (err: any, row: DBFile & { element: string }) => {
|
||||
if (err) {
|
||||
log('db could not get file cache', err);
|
||||
reject(err);
|
||||
}
|
||||
if (row) {
|
||||
row.element = JSON.parse(row.element);
|
||||
}
|
||||
resolve(row);
|
||||
});
|
||||
});
|
||||
}
|
||||
|
||||
async getFileCacheByName(name: string): Promise<DBFile | null> {
|
||||
return this.getFileCache('SELECT * FROM files WHERE name = ?', [name]);
|
||||
}
|
||||
|
||||
async getFileCacheByUuid(uuid: string): Promise<DBFile | null> {
|
||||
return this.getFileCache('SELECT * FROM files WHERE uuid = ?', [uuid]);
|
||||
}
|
||||
|
||||
// todo: 是否所有的文件都有uuid?语音消息有没有uuid?
|
||||
async updateFileCache(file: DBFile) {
|
||||
const stmt = this.db!.prepare('UPDATE files SET path = ?, url = ? WHERE uuid = ?');
|
||||
return new Promise((resolve, reject) => {
|
||||
stmt.run(file.path, file.url, function (err: any) {
|
||||
if (err) {
|
||||
log('db could not update file cache', err);
|
||||
reject(err);
|
||||
}
|
||||
resolve(null);
|
||||
});
|
||||
});
|
||||
}
|
||||
|
||||
// 被动收到的临时会话消息uin->uid
|
||||
async getReceivedTempUinMap() {
|
||||
const stmt = 'SELECT * FROM temp_uins';
|
||||
return new Promise<Record<string, string>>((resolve, reject) => {
|
||||
this.db!.all(stmt, (err, rows: { uin: string, uid: string }[]) => {
|
||||
if (err) {
|
||||
log('db could not get temp uin map', err);
|
||||
reject(err);
|
||||
}
|
||||
const map: Record<string, string> = {};
|
||||
rows.forEach(row => {
|
||||
map[row.uin] = row.uid;
|
||||
});
|
||||
resolve(map);
|
||||
});
|
||||
});
|
||||
}
|
||||
|
||||
// 通过uin获取临时会话消息uid
|
||||
async getUidByTempUin(uid: string) {
|
||||
const stmt = 'SELECT * FROM temp_uins WHERE uin = ?';
|
||||
return new Promise<string>((resolve, reject) => {
|
||||
this.db!.get(stmt, [uid], (err, row: { uin: string, uid: string }) => {
|
||||
if (err) {
|
||||
log('db could not get temp uin map', err);
|
||||
reject(err);
|
||||
}
|
||||
resolve(row?.uid);
|
||||
});
|
||||
});
|
||||
}
|
||||
|
||||
async addTempUin(uin: string, uid: string) {
|
||||
const existUid = await this.getUidByTempUin(uin);
|
||||
if (!existUid) {
|
||||
const stmt = this.db!.prepare('INSERT INTO temp_uins (uin, uid) VALUES (?, ?)');
|
||||
return new Promise((resolve, reject) => {
|
||||
stmt.run(uin, uid, function (err: any) {
|
||||
if (err) {
|
||||
log('db could not add temp uin', err);
|
||||
reject(err);
|
||||
}
|
||||
resolve(null);
|
||||
});
|
||||
});
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
export const dbUtil = new DBUtil();
|
@@ -4,14 +4,13 @@ import crypto from 'crypto';
|
||||
import util from 'util';
|
||||
import path from 'node:path';
|
||||
import { log } from './log';
|
||||
import { dbUtil } from './db';
|
||||
import { dbUtil } from '@/core/utils/db';
|
||||
import * as fileType from 'file-type';
|
||||
import { v4 as uuidv4 } from 'uuid';
|
||||
import { napCatCore } from '@/core';
|
||||
import os from 'node:os';
|
||||
|
||||
export const getNapCatDir = () => {
|
||||
const p = path.join(napCatCore.wrapper.dataPath, 'NapCat');
|
||||
const p = path.join(napCatCore.dataPath, 'NapCat');
|
||||
fs.mkdirSync(p, { recursive: true });
|
||||
return p;
|
||||
};
|
||||
@@ -194,6 +193,7 @@ export async function uri2local(uri: string, fileName: string | null = null): Pr
|
||||
// res.ext = pathInfo.ext
|
||||
}
|
||||
}
|
||||
fileName = fileName.replace(/[/\\:*?"<>|]/g, '_');
|
||||
res.fileName = fileName;
|
||||
filePath = path.join(getTempDir(), uuidv4() + fileName);
|
||||
fs.writeFileSync(filePath, buffer);
|
||||
|
@@ -1,5 +1,4 @@
|
||||
import crypto from 'node:crypto';
|
||||
import { resolve } from 'dns';
|
||||
|
||||
export function sleep(ms: number): Promise<void> {
|
||||
return new Promise(resolve => setTimeout(resolve, ms));
|
||||
@@ -19,3 +18,20 @@ export function isNull(value: any) {
|
||||
export function isNumeric(str: string) {
|
||||
return /^\d+$/.test(str);
|
||||
}
|
||||
|
||||
export function truncateString(obj: any, maxLength = 500) {
|
||||
if (obj !== null && typeof obj === 'object') {
|
||||
Object.keys(obj).forEach(key => {
|
||||
if (typeof obj[key] === 'string') {
|
||||
// 如果是字符串且超过指定长度,则截断
|
||||
if (obj[key].length > maxLength) {
|
||||
obj[key] = obj[key].substring(0, maxLength) + '...';
|
||||
}
|
||||
} else if (typeof obj[key] === 'object') {
|
||||
// 如果是对象或数组,则递归调用
|
||||
truncateString(obj[key], maxLength);
|
||||
}
|
||||
});
|
||||
}
|
||||
return obj;
|
||||
}
|
||||
|
@@ -1,4 +1,116 @@
|
||||
import log4js, { Configuration } from 'log4js';
|
||||
import { truncateString } from '@/common/utils/helper';
|
||||
import path from 'node:path';
|
||||
import { SelfInfo } from '@/core';
|
||||
|
||||
export enum LogLevel {
|
||||
DEBUG = 'debug',
|
||||
INFO = 'info',
|
||||
WARN = 'warn',
|
||||
ERROR = 'error',
|
||||
FATAL = 'fatal',
|
||||
}
|
||||
|
||||
const logDir = path.join(path.resolve(__dirname), 'logs');
|
||||
|
||||
function getFormattedTimestamp() {
|
||||
const now = new Date();
|
||||
const year = now.getFullYear();
|
||||
const month = (now.getMonth() + 1).toString().padStart(2, '0');
|
||||
const day = now.getDate().toString().padStart(2, '0');
|
||||
const hours = now.getHours().toString().padStart(2, '0');
|
||||
const minutes = now.getMinutes().toString().padStart(2, '0');
|
||||
const seconds = now.getSeconds().toString().padStart(2, '0');
|
||||
return `${year}-${month}-${day}_${hours}-${minutes}-${seconds}`;
|
||||
}
|
||||
|
||||
const filename = `${getFormattedTimestamp()}.log`;
|
||||
const logPath = path.join(logDir, filename);
|
||||
|
||||
const logConfig: Configuration = {
|
||||
appenders: {
|
||||
FileAppender: { // 输出到文件的appender
|
||||
type: 'file',
|
||||
filename: logPath, // 指定日志文件的位置和文件名
|
||||
maxLoogSize: 10485760, // 日志文件的最大大小(单位:字节),这里设置为10MB
|
||||
layout: {
|
||||
type: 'pattern',
|
||||
pattern: '%d{yyyy-MM-dd hh:mm:ss} [%p] - %m'
|
||||
}
|
||||
},
|
||||
ConsoleAppender: { // 输出到控制台的appender
|
||||
type: 'console',
|
||||
layout: {
|
||||
type: 'pattern',
|
||||
pattern: '%d{yyyy-MM-dd hh:mm:ss} [%p] - %m'
|
||||
}
|
||||
}
|
||||
},
|
||||
categories: {
|
||||
default: { appenders: ['FileAppender', 'ConsoleAppender'], level: 'debug' }, // 默认情况下同时输出到文件和控制台
|
||||
file: { appenders: ['FileAppender'], level: 'debug' },
|
||||
console: { appenders: ['ConsoleAppender'], level: 'debug' }
|
||||
}
|
||||
};
|
||||
|
||||
log4js.configure(logConfig);
|
||||
|
||||
|
||||
export function setLogLevel(fileLogLevel: LogLevel, consoleLogLevel: LogLevel) {
|
||||
logConfig.categories.file.level = fileLogLevel;
|
||||
logConfig.categories.console.level = consoleLogLevel;
|
||||
log4js.configure(logConfig);
|
||||
}
|
||||
|
||||
export function setLogSelfInfo(selfInfo: SelfInfo) {
|
||||
// eslint-disable-next-line @typescript-eslint/ban-ts-comment
|
||||
// @ts-expect-error
|
||||
logConfig.appenders.FileAppender.layout.pattern = logConfig.appenders.ConsoleAppender.layout.pattern =
|
||||
`%d{yyyy-MM-dd hh:mm:ss} [%p] ${selfInfo.nick}(${selfInfo.uin}) %m`;
|
||||
log4js.configure(logConfig);
|
||||
}
|
||||
|
||||
let fileLogEnabled = true;
|
||||
let consoleLogEnabled = true;
|
||||
export function enableFileLog(enable: boolean) {
|
||||
fileLogEnabled = enable;
|
||||
}
|
||||
export function enableConsoleLog(enable: boolean) {
|
||||
consoleLogEnabled = enable;
|
||||
}
|
||||
|
||||
function formatMsg(msg: any[]){
|
||||
let logMsg = '';
|
||||
for (const msgItem of msg) {
|
||||
// 判断是否是对象
|
||||
if (typeof msgItem === 'object') {
|
||||
const obj = JSON.parse(JSON.stringify(msgItem, null, 2));
|
||||
logMsg += JSON.stringify(truncateString(obj)) + ' ';
|
||||
continue;
|
||||
}
|
||||
logMsg += msgItem + ' ';
|
||||
}
|
||||
return '\n' + logMsg + '\n';
|
||||
}
|
||||
|
||||
function _log(level: LogLevel, ...args: any[]){
|
||||
if (consoleLogEnabled){
|
||||
log4js.getLogger('console')[level](formatMsg(args));
|
||||
}
|
||||
if (fileLogEnabled){
|
||||
log4js.getLogger('file')[level](formatMsg(args));
|
||||
}
|
||||
}
|
||||
|
||||
export function log(...args: any[]) {
|
||||
console.log(...args);
|
||||
}
|
||||
// info 等级
|
||||
_log(LogLevel.INFO, ...args);
|
||||
}
|
||||
|
||||
export function logDebug(...args: any[]) {
|
||||
_log(LogLevel.DEBUG, ...args);
|
||||
}
|
||||
|
||||
export function logError(...args: any[]) {
|
||||
_log(LogLevel.ERROR, ...args);
|
||||
}
|
||||
|
@@ -1,7 +1,7 @@
|
||||
// QQ等级换算
|
||||
import { QQLevel } from '../../ntqqapi/types';
|
||||
import { QQLevel } from '../../core/src/entities';
|
||||
|
||||
export function calcQQLevel(level: QQLevel) {
|
||||
const { crownNum, sunNum, moonNum, starNum } = level;
|
||||
return crownNum * 64 + sunNum * 16 + moonNum * 4 + starNum;
|
||||
}
|
||||
}
|
||||
|
57
src/common/utils/request.ts
Normal file
57
src/common/utils/request.ts
Normal file
@@ -0,0 +1,57 @@
|
||||
const https = require('node:https');
|
||||
export async function HttpGetCookies(url: string): Promise<Map<string, string>> {
|
||||
return new Promise((resolve, reject) => {
|
||||
const result: Map<string, string> = new Map<string, string>();
|
||||
const req = https.get(url, (res: any) => {
|
||||
res.on('data', (data: any) => {
|
||||
});
|
||||
res.on('end', () => {
|
||||
try {
|
||||
const responseCookies = res.headers['set-cookie'];
|
||||
for (const line of responseCookies) {
|
||||
const parts = line.split(';');
|
||||
const [key, value] = parts[0].split('=');
|
||||
result.set(key, value);
|
||||
}
|
||||
} catch (e) {
|
||||
}
|
||||
resolve(result);
|
||||
|
||||
});
|
||||
});
|
||||
req.on('error', (error: any) => {
|
||||
resolve(result);
|
||||
// console.log(error)
|
||||
});
|
||||
req.end();
|
||||
});
|
||||
|
||||
}
|
||||
export async function HttpPostCookies(url: string): Promise<Map<string, string>> {
|
||||
return new Promise((resolve, reject) => {
|
||||
const result: Map<string, string> = new Map<string, string>();
|
||||
const req = https.get(url, (res: any) => {
|
||||
res.on('data', (data: any) => {
|
||||
});
|
||||
res.on('end', () => {
|
||||
try {
|
||||
const responseCookies = res.headers['set-cookie'];
|
||||
for (const line of responseCookies) {
|
||||
const parts = line.split(';');
|
||||
const [key, value] = parts[0].split('=');
|
||||
result.set(key, value);
|
||||
}
|
||||
} catch (e) {
|
||||
}
|
||||
resolve(result);
|
||||
|
||||
});
|
||||
});
|
||||
req.on('error', (error: any) => {
|
||||
resolve(result);
|
||||
// console.log(error)
|
||||
});
|
||||
req.end();
|
||||
});
|
||||
|
||||
}
|
@@ -2,8 +2,9 @@ import os from 'node:os';
|
||||
import path from 'node:path';
|
||||
|
||||
export const systemPlatform = os.platform();
|
||||
export const cpuArch = os.arch();
|
||||
export const systemVersion = os.release();
|
||||
export const hostname = os.hostname();
|
||||
const homeDir = os.homedir();
|
||||
export const downloadsPath = path.join(homeDir, 'Downloads');
|
||||
export const systemName = os.type();
|
||||
export const systemName = os.type();
|
||||
|
@@ -1,5 +1,5 @@
|
||||
import { request } from 'https';
|
||||
export function noifyLoginStatus() {
|
||||
import { request } from 'node:https';
|
||||
export function postLoginStatus() {
|
||||
const req = request(
|
||||
{
|
||||
hostname: 'napcat.wumiao.wang',
|
||||
@@ -16,11 +16,16 @@ export function noifyLoginStatus() {
|
||||
res.on('data', (chunk) => {
|
||||
//data += chunk;
|
||||
});
|
||||
res.on('error', (err) => {
|
||||
});
|
||||
res.on('end', () => {
|
||||
//console.log('Response:', data);
|
||||
});
|
||||
}
|
||||
);
|
||||
req.on('error', (e) => {
|
||||
// console.error('Request error:', e);
|
||||
});
|
||||
const StatesData = {
|
||||
type: 'event',
|
||||
payload: {
|
||||
@@ -29,10 +34,11 @@ export function noifyLoginStatus() {
|
||||
'screen': '1920x1080',
|
||||
'language': 'zh-CN',
|
||||
'title': 'OneBot.Login',
|
||||
'url': '/login/onebot11',
|
||||
'url': '/login/onebot11/1.3.0',
|
||||
'referrer': 'https://napcat.demo.cn/login?type=onebot11'
|
||||
}
|
||||
};
|
||||
req.write(JSON.stringify(StatesData));
|
||||
|
||||
req.end();
|
||||
}
|
||||
}
|
||||
|
@@ -41,4 +41,4 @@ export async function checkVersion(): Promise<string> {
|
||||
}
|
||||
reject('get verison error!');
|
||||
});
|
||||
}
|
||||
}
|
||||
|
@@ -16,8 +16,7 @@ export async function getVideoInfo(filePath: string) {
|
||||
size: number,
|
||||
filePath: string
|
||||
}>((resolve, reject) => {
|
||||
// todo: 从配置文件中读取ffmpeg路径
|
||||
const ffmpegPath = './ffmpeg';
|
||||
const ffmpegPath = process.env.FFMPEG_PATH;
|
||||
ffmpegPath && ffmpeg.setFfmpegPath(ffmpegPath);
|
||||
ffmpeg(filePath).ffprobe((err: any, metadata: any) => {
|
||||
if (err) {
|
||||
@@ -27,7 +26,7 @@ export async function getVideoInfo(filePath: string) {
|
||||
if (videoStream) {
|
||||
console.log(`视频尺寸: ${videoStream.width}x${videoStream.height}`);
|
||||
} else {
|
||||
console.log('未找到视频流信息。');
|
||||
return reject('未找到视频流信息。');
|
||||
}
|
||||
resolve({
|
||||
width: videoStream.width, height: videoStream.height,
|
||||
@@ -85,4 +84,4 @@ export function checkFfmpeg(newPath: string | null = null): Promise<boolean> {
|
||||
resolve(false);
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
|
1
src/core
Submodule
1
src/core
Submodule
Submodule src/core added at b506d4cbdd
BIN
src/core.lib/MoeHoo-linux-x64.node
Normal file
BIN
src/core.lib/MoeHoo-linux-x64.node
Normal file
Binary file not shown.
BIN
src/core.lib/MoeHoo-win32-x64.node
Normal file
BIN
src/core.lib/MoeHoo-win32-x64.node
Normal file
Binary file not shown.
@@ -1,5 +1,5 @@
|
||||
interface IDependsAdapter {
|
||||
onMSFStatusChange(args: unknown): void;
|
||||
onMSFStatusChange(arg1: number, arg2: number): void;
|
||||
onMSFSsoError(args: unknown): void;
|
||||
getGroupCode(args: unknown): void;
|
||||
}
|
||||
@@ -7,7 +7,7 @@ export interface NodeIDependsAdapter extends IDependsAdapter {
|
||||
new (adapter: IDependsAdapter): NodeIDependsAdapter;
|
||||
}
|
||||
export declare class DependsAdapter implements IDependsAdapter {
|
||||
onMSFStatusChange(args: unknown): void;
|
||||
onMSFStatusChange(arg1: number, arg2: number): void;
|
||||
onMSFSsoError(args: unknown): void;
|
||||
getGroupCode(args: unknown): void;
|
||||
}
|
1
src/core.lib/src/adapters/NodeIDependsAdapter.js
Normal file
1
src/core.lib/src/adapters/NodeIDependsAdapter.js
Normal file
@@ -0,0 +1 @@
|
||||
var _0x20f3a3=_0xab98;function _0x199d(){var _0x242524=['867835orpyol','4820904NfmEhM','1317316mJNiBq','getGroupCode','450140cGAuXI','20613waHIrp','8oFAhmM','onMSFSsoError','204bbaYtT','4929841hhAgzJ','40438130xxOPUR','onMSFStatusChange','30YvLOjS'];_0x199d=function(){return _0x242524;};return _0x199d();}(function(_0x5cd7da,_0x2c9531){var _0x5a5abb=_0xab98,_0x5e2994=_0x5cd7da();while(!![]){try{var _0x25997b=-parseInt(_0x5a5abb(0x7f))/0x1+parseInt(_0x5a5abb(0x7a))/0x2*(-parseInt(_0x5a5abb(0x77))/0x3)+-parseInt(_0x5a5abb(0x81))/0x4+parseInt(_0x5a5abb(0x83))/0x5*(-parseInt(_0x5a5abb(0x7e))/0x6)+-parseInt(_0x5a5abb(0x7b))/0x7+parseInt(_0x5a5abb(0x78))/0x8*(-parseInt(_0x5a5abb(0x80))/0x9)+parseInt(_0x5a5abb(0x7c))/0xa;if(_0x25997b===_0x2c9531)break;else _0x5e2994['push'](_0x5e2994['shift']());}catch(_0x3ba8b5){_0x5e2994['push'](_0x5e2994['shift']());}}}(_0x199d,0x6f444));function _0xab98(_0x1f2e57,_0x4954bf){var _0x199dc8=_0x199d();return _0xab98=function(_0xab9882,_0x1ff8bb){_0xab9882=_0xab9882-0x77;var _0x3c4334=_0x199dc8[_0xab9882];return _0x3c4334;},_0xab98(_0x1f2e57,_0x4954bf);}export class DependsAdapter{[_0x20f3a3(0x7d)](_0x488b05,_0x25a4d5){}[_0x20f3a3(0x79)](_0x22e500){}[_0x20f3a3(0x82)](_0x35a823){}}
|
1
src/core.lib/src/adapters/NodeIDispatcherAdapter.js
Normal file
1
src/core.lib/src/adapters/NodeIDispatcherAdapter.js
Normal file
@@ -0,0 +1 @@
|
||||
var _0x3a826a=_0x50c0;(function(_0x58209d,_0x457985){var _0x4e7f7f=_0x50c0,_0x6c4dd4=_0x58209d();while(!![]){try{var _0x4cd98f=parseInt(_0x4e7f7f(0xb4))/0x1+parseInt(_0x4e7f7f(0xbe))/0x2*(parseInt(_0x4e7f7f(0xb6))/0x3)+parseInt(_0x4e7f7f(0xb8))/0x4+-parseInt(_0x4e7f7f(0xb7))/0x5*(-parseInt(_0x4e7f7f(0xbf))/0x6)+parseInt(_0x4e7f7f(0xb5))/0x7*(parseInt(_0x4e7f7f(0xbd))/0x8)+-parseInt(_0x4e7f7f(0xc0))/0x9+parseInt(_0x4e7f7f(0xbc))/0xa*(-parseInt(_0x4e7f7f(0xbb))/0xb);if(_0x4cd98f===_0x457985)break;else _0x6c4dd4['push'](_0x6c4dd4['shift']());}catch(_0x554e0f){_0x6c4dd4['push'](_0x6c4dd4['shift']());}}}(_0x5bbf,0x2ebf4));export class DispatcherAdapter{[_0x3a826a(0xb9)](_0x3985c1){}['dispatchCall'](_0x54a892){}[_0x3a826a(0xba)](_0x14b0dc){}}function _0x50c0(_0x165ac0,_0x11c111){var _0x5bbf85=_0x5bbf();return _0x50c0=function(_0x50c011,_0x2b2384){_0x50c011=_0x50c011-0xb4;var _0x466d72=_0x5bbf85[_0x50c011];return _0x466d72;},_0x50c0(_0x165ac0,_0x11c111);}function _0x5bbf(){var _0x52ff37=['1491652WULToR','dispatchRequest','dispatchCallWithJson','2235827oVrwUv','30KzTwbU','136WfIqPO','18IwgFaa','16722NvbGSt','3430728zqiFyT','75305fnfONu','131222lMZVkq','124578SapZzq','75GkdEQt'];_0x5bbf=function(){return _0x52ff37;};return _0x5bbf();}
|
1
src/core.lib/src/adapters/NodeIGlobalAdapter.js
Normal file
1
src/core.lib/src/adapters/NodeIGlobalAdapter.js
Normal file
@@ -0,0 +1 @@
|
||||
function _0x1594(_0x58c29b,_0x44acfd){var _0x4d164b=_0x4d16();return _0x1594=function(_0x1594d5,_0x1525fc){_0x1594d5=_0x1594d5-0x198;var _0x1c1815=_0x4d164b[_0x1594d5];return _0x1c1815;},_0x1594(_0x58c29b,_0x44acfd);}var _0x175dc0=_0x1594;(function(_0x1b3e3d,_0x5116e4){var _0x17fe4f=_0x1594,_0x36c543=_0x1b3e3d();while(!![]){try{var _0x6b9ab7=parseInt(_0x17fe4f(0x19f))/0x1*(-parseInt(_0x17fe4f(0x19d))/0x2)+parseInt(_0x17fe4f(0x1a4))/0x3+-parseInt(_0x17fe4f(0x19b))/0x4+parseInt(_0x17fe4f(0x1a6))/0x5*(-parseInt(_0x17fe4f(0x19a))/0x6)+parseInt(_0x17fe4f(0x1a8))/0x7+-parseInt(_0x17fe4f(0x1a2))/0x8*(-parseInt(_0x17fe4f(0x1a3))/0x9)+parseInt(_0x17fe4f(0x1a0))/0xa*(parseInt(_0x17fe4f(0x19c))/0xb);if(_0x6b9ab7===_0x5116e4)break;else _0x36c543['push'](_0x36c543['shift']());}catch(_0x42cd0b){_0x36c543['push'](_0x36c543['shift']());}}}(_0x4d16,0x2199c));function _0x4d16(){var _0x2d8922=['1419546mxJbdk','446484HoiEEq','44yRWgfw','2XpkqmL','onUpdateGeneralFlag','185044fHAWUd','749790oMOrHe','onShowErrUITips','149672nKQepV','18zczhAP','504006SYbXob','onInstallFinished','5OkkvYy','onGetSrvCalTime','1158836BJpeXd','onGetOfflineMsg','onLog'];_0x4d16=function(){return _0x2d8922;};return _0x4d16();}export class GlobalAdapter{[_0x175dc0(0x199)](..._0x3e4b79){}[_0x175dc0(0x1a7)](..._0x987740){}[_0x175dc0(0x1a1)](..._0x292841){}['fixPicImgType'](..._0x415237){}['getAppSetting'](..._0x3934ab){}[_0x175dc0(0x1a5)](..._0x486c90){}[_0x175dc0(0x19e)](..._0x1b54fe){}[_0x175dc0(0x198)](..._0x466ac8){}}
|
1
src/core.lib/src/adapters/index.js
Normal file
1
src/core.lib/src/adapters/index.js
Normal file
@@ -0,0 +1 @@
|
||||
(function(_0x58f3c0,_0x4da555){var _0x533787=_0x47f5,_0x20e107=_0x58f3c0();while(!![]){try{var _0x1ecc8a=parseInt(_0x533787(0xa8))/0x1+parseInt(_0x533787(0xa5))/0x2+parseInt(_0x533787(0xaa))/0x3+-parseInt(_0x533787(0xab))/0x4+-parseInt(_0x533787(0xa7))/0x5+parseInt(_0x533787(0xa6))/0x6+-parseInt(_0x533787(0xa9))/0x7;if(_0x1ecc8a===_0x4da555)break;else _0x20e107['push'](_0x20e107['shift']());}catch(_0x45e3c2){_0x20e107['push'](_0x20e107['shift']());}}}(_0x4522,0xd51f1));export*from'./NodeIDependsAdapter';function _0x4522(){var _0x35130d=['1885660uvyoQv','2176134RkNlVH','10342008dNTcpR','1718020vzZflV','591401KlIhxJ','12755001GAlbSX','320913ocIGre'];_0x4522=function(){return _0x35130d;};return _0x4522();}export*from'./NodeIDispatcherAdapter';function _0x47f5(_0x5209cd,_0x119af6){var _0x4522f9=_0x4522();return _0x47f5=function(_0x47f51e,_0x4a3f72){_0x47f51e=_0x47f51e-0xa5;var _0x5460ce=_0x4522f9[_0x47f51e];return _0x5460ce;},_0x47f5(_0x5209cd,_0x119af6);}export*from'./NodeIGlobalAdapter';
|
33
src/core.lib/src/apis/file.d.ts
vendored
Normal file
33
src/core.lib/src/apis/file.d.ts
vendored
Normal file
@@ -0,0 +1,33 @@
|
||||
import { CacheFileListItem, CacheFileType, ChatCacheListItemBasic, ChatType, ElementType, RawMessage } from '@/core/entities';
|
||||
import { GeneralCallResult } from '@/core';
|
||||
import * as fileType from 'file-type';
|
||||
import { ISizeCalculationResult } from 'image-size/dist/types/interface';
|
||||
export declare class NTQQFileApi {
|
||||
static getFileType(filePath: string): Promise<fileType.FileTypeResult | undefined>;
|
||||
static copyFile(filePath: string, destPath: string): Promise<void>;
|
||||
static getFileSize(filePath: string): Promise<number>;
|
||||
static uploadFile(filePath: string, elementType?: ElementType, elementSubType?: number): Promise<{
|
||||
md5: string;
|
||||
fileName: string;
|
||||
path: string;
|
||||
fileSize: number;
|
||||
ext: string;
|
||||
}>;
|
||||
static downloadMedia(msgId: string, chatType: ChatType, peerUid: string, elementId: string, thumbPath: string, sourcePath: string, timeout?: number, force?: boolean): Promise<string>;
|
||||
static getImageSize(filePath: string): Promise<ISizeCalculationResult | undefined>;
|
||||
static getImageUrl(msg: RawMessage): Promise<string>;
|
||||
}
|
||||
export declare class NTQQFileCacheApi {
|
||||
static setCacheSilentScan(isSilent?: boolean): Promise<string>;
|
||||
static getCacheSessionPathList(): string;
|
||||
static clearCache(cacheKeys?: Array<string>): unknown;
|
||||
static addCacheScannedPaths(pathMap?: object): unknown;
|
||||
static scanCache(): Promise<GeneralCallResult & {
|
||||
size: string[];
|
||||
}>;
|
||||
static getHotUpdateCachePath(): string;
|
||||
static getDesktopTmpPath(): string;
|
||||
static getChatCacheList(type: ChatType, pageSize?: number, pageIndex?: number): unknown;
|
||||
static getFileCacheInfo(fileType: CacheFileType, pageSize?: number, lastRecord?: CacheFileListItem): void;
|
||||
static clearChatCache(chats?: ChatCacheListItemBasic[], fileKeys?: string[]): Promise<unknown>;
|
||||
}
|
1
src/core.lib/src/apis/file.js
Normal file
1
src/core.lib/src/apis/file.js
Normal file
File diff suppressed because one or more lines are too long
@@ -1,5 +1,5 @@
|
||||
import { FriendRequest } from '@/core/qqnt/entities';
|
||||
import { FriendRequest, User } from '@/core/entities';
|
||||
export declare class NTQQFriendApi {
|
||||
static getFriends(forced?: boolean): Promise<void>;
|
||||
static getFriends(forced?: boolean): Promise<User[]>;
|
||||
static handleFriendRequest(request: FriendRequest, accept: boolean): Promise<void>;
|
||||
}
|
1
src/core.lib/src/apis/friend.js
Normal file
1
src/core.lib/src/apis/friend.js
Normal file
@@ -0,0 +1 @@
|
||||
const _0x5d90db=_0x6e1f;(function(_0x24d76c,_0x417026){const _0x3934dc=_0x6e1f,_0x409f34=_0x24d76c();while(!![]){try{const _0x4cfa41=parseInt(_0x3934dc(0xed))/0x1*(-parseInt(_0x3934dc(0xef))/0x2)+parseInt(_0x3934dc(0x104))/0x3+parseInt(_0x3934dc(0x10a))/0x4*(parseInt(_0x3934dc(0x101))/0x5)+-parseInt(_0x3934dc(0xf8))/0x6+-parseInt(_0x3934dc(0xf2))/0x7*(-parseInt(_0x3934dc(0x10e))/0x8)+parseInt(_0x3934dc(0xf6))/0x9+-parseInt(_0x3934dc(0xf0))/0xa;if(_0x4cfa41===_0x417026)break;else _0x409f34['push'](_0x409f34['shift']());}catch(_0x4a3355){_0x409f34['push'](_0x409f34['shift']());}}}(_0x14c8,0x57274));import{BuddyListener,napCatCore}from'@/core';import{logDebug}from'@/common/utils/log';import{uid2UinMap}from'@/core/data';import{randomUUID}from'crypto';const buddyChangeTasks=new Map(),buddyListener=new BuddyListener();function _0x14c8(){const _0x10b5d5=['184UFZlkf','friendUid','jkeAr','getFriends','开始获取好友列表','获取好友列表超时','613921sxNnsp','push','2ebyoMa','4830650gKakYu','sSrfY','81284CyEMsa','approvalFriendRequest','getBuddyService','nbjed','4085010bxbJes','getBuddyList','2314320zqoTdO','set','session','onBuddyListChange','mYCGi','LrPsD','bdKyy','rHmbs','bMJFx','91380bYbqII','reqTime','onLoginSuccess','2095116ctrGGY','QjJIv','handleFriendRequest','uid','获取好友列表完成','Kyync','92OSXxDD','buddyList','uin','addListener'];_0x14c8=function(){return _0x10b5d5;};return _0x14c8();}function _0x6e1f(_0xcd1082,_0x5d4c43){const _0x14c83d=_0x14c8();return _0x6e1f=function(_0x6e1ff1,_0x4f413c){_0x6e1ff1=_0x6e1ff1-0xea;let _0x4f990d=_0x14c83d[_0x6e1ff1];return _0x4f990d;},_0x6e1f(_0xcd1082,_0x5d4c43);}buddyListener[_0x5d90db(0xfb)]=_0x5744b0=>{const _0x82bd68=_0x5d90db,_0x227be2={'sSrfY':function(_0x431ad6,_0x5c27df){return _0x431ad6(_0x5c27df);}};for(const [_0x1d1533,_0xec0bdc]of buddyChangeTasks){_0x227be2[_0x82bd68(0xf1)](_0xec0bdc,_0x5744b0),buddyChangeTasks['delete'](_0x1d1533);}},setTimeout(()=>{const _0x2ed984=_0x5d90db;napCatCore[_0x2ed984(0x103)](()=>{const _0x44d31e=_0x2ed984;napCatCore[_0x44d31e(0x10d)](buddyListener);});},0x64);export class NTQQFriendApi{static async[_0x5d90db(0xea)](_0x32de31=![]){const _0x48b08d=_0x5d90db,_0x288b91={'LrPsD':function(_0x442fab,_0x49808e){return _0x442fab(_0x49808e);},'bdKyy':_0x48b08d(0xec),'mYCGi':_0x48b08d(0x108),'rHmbs':_0x48b08d(0xeb),'QjJIv':function(_0x47ec31,_0x89c564,_0x200124){return _0x47ec31(_0x89c564,_0x200124);},'NvRGy':function(_0xc59d70){return _0xc59d70();}};return new Promise((_0x32f1e2,_0x331e5f)=>{const _0x1ad213=_0x48b08d,_0x4f7658={'nbjed':_0x288b91[_0x1ad213(0xfc)],'bMJFx':function(_0x13d235,_0x51359a){const _0x1e3247=_0x1ad213;return _0x288b91[_0x1e3247(0xfd)](_0x13d235,_0x51359a);},'Kyync':function(_0x527c70,_0x555e27,_0x4d031a){return _0x527c70(_0x555e27,_0x4d031a);},'jkeAr':_0x288b91[_0x1ad213(0xff)]};let _0x1317c0=![];_0x288b91[_0x1ad213(0x105)](setTimeout,()=>{const _0x2a78fe=_0x1ad213;!_0x1317c0&&(_0x288b91[_0x2a78fe(0xfd)](logDebug,_0x288b91[_0x2a78fe(0xfe)]),_0x331e5f('获取好友列表超时'));},0x1388);const _0x254032=[],_0x321bb8=_0x304f26=>{const _0x7f8575=_0x1ad213;for(const _0x440f1c of _0x304f26){for(const _0x40aae7 of _0x440f1c[_0x7f8575(0x10b)]){_0x254032[_0x7f8575(0xee)](_0x40aae7),uid2UinMap[_0x40aae7[_0x7f8575(0x107)]]=_0x40aae7[_0x7f8575(0x10c)];}}_0x1317c0=!![],logDebug(_0x4f7658[_0x7f8575(0xf5)],_0x254032),_0x4f7658[_0x7f8575(0x100)](_0x32f1e2,_0x254032);};buddyChangeTasks[_0x1ad213(0xf9)](_0x288b91['NvRGy'](randomUUID),_0x321bb8),napCatCore[_0x1ad213(0xfa)][_0x1ad213(0xf4)]()[_0x1ad213(0xf7)](_0x32de31)['then'](_0x1e963c=>{const _0x1bea4b=_0x1ad213;_0x4f7658[_0x1bea4b(0x109)](logDebug,_0x4f7658[_0x1bea4b(0x110)],_0x1e963c);});});}static async[_0x5d90db(0x106)](_0x15a498,_0x30ed3c){const _0x4a1120=_0x5d90db;napCatCore[_0x4a1120(0xfa)][_0x4a1120(0xf4)]()?.[_0x4a1120(0xf3)]({'friendUid':_0x15a498[_0x4a1120(0x10f)],'reqTime':_0x15a498[_0x4a1120(0x102)],'accept':_0x30ed3c});}}
|
@@ -1,20 +1,20 @@
|
||||
import { GroupMember, GroupRequestOperateTypes, GroupMemberRole, GroupNotify } from '../entities';
|
||||
import { GroupMember, GroupRequestOperateTypes, GroupMemberRole, GroupNotify, Group } from '../entities';
|
||||
export declare class NTQQGroupApi {
|
||||
static getGroups(forced?: boolean): Promise<void>;
|
||||
static getGroupMembers(groupQQ: string, num?: number): Promise<void | GroupMember[]>;
|
||||
static getGroups(forced?: boolean): Promise<Group[]>;
|
||||
static getGroupMembers(groupQQ: string, num?: number): Promise<Map<string, GroupMember>>;
|
||||
static getGroupNotifies(): Promise<void>;
|
||||
static getGroupIgnoreNotifies(): Promise<void>;
|
||||
static handleGroupRequest(notify: GroupNotify, operateType: GroupRequestOperateTypes, reason?: string): Promise<void | undefined>;
|
||||
static quitGroup(groupQQ: string): Promise<void | undefined>;
|
||||
static kickMember(groupQQ: string, kickUids: string[], refuseForever?: boolean, kickReason?: string): Promise<void | undefined>;
|
||||
static handleGroupRequest(notify: GroupNotify, operateType: GroupRequestOperateTypes, reason?: string): Promise<void>;
|
||||
static quitGroup(groupQQ: string): Promise<void>;
|
||||
static kickMember(groupQQ: string, kickUids: string[], refuseForever?: boolean, kickReason?: string): Promise<void>;
|
||||
static banMember(groupQQ: string, memList: Array<{
|
||||
uid: string;
|
||||
timeStamp: number;
|
||||
}>): Promise<void | undefined>;
|
||||
static banGroup(groupQQ: string, shutUp: boolean): Promise<void | undefined>;
|
||||
static setMemberCard(groupQQ: string, memberUid: string, cardName: string): Promise<void | undefined>;
|
||||
static setMemberRole(groupQQ: string, memberUid: string, role: GroupMemberRole): Promise<void | undefined>;
|
||||
static setGroupName(groupQQ: string, groupName: string): Promise<void | undefined>;
|
||||
}>): Promise<void>;
|
||||
static banGroup(groupQQ: string, shutUp: boolean): Promise<void>;
|
||||
static setMemberCard(groupQQ: string, memberUid: string, cardName: string): Promise<void>;
|
||||
static setMemberRole(groupQQ: string, memberUid: string, role: GroupMemberRole): Promise<void>;
|
||||
static setGroupName(groupQQ: string, groupName: string): Promise<void>;
|
||||
static setGroupTitle(groupQQ: string, uid: string, title: string): Promise<void>;
|
||||
static publishGroupBulletin(groupQQ: string, title: string, content: string): void;
|
||||
}
|
1
src/core.lib/src/apis/group.js
Normal file
1
src/core.lib/src/apis/group.js
Normal file
File diff suppressed because one or more lines are too long
@@ -4,4 +4,3 @@ export * from './group';
|
||||
export * from './msg';
|
||||
export * from './user';
|
||||
export * from './webapi';
|
||||
export * from './window';
|
1
src/core.lib/src/apis/index.js
Normal file
1
src/core.lib/src/apis/index.js
Normal file
@@ -0,0 +1 @@
|
||||
function _0x2aaa(){var _0x43042b=['301592lbSBZw','86690FyvJbk','9iBNAOX','3306471SdIbmQ','340DWpBjj','7233EAgzRw','4537464FpTHSS','38145pavdea','166LvmfHD','473LCHAEB','15180dJtWDO'];_0x2aaa=function(){return _0x43042b;};return _0x2aaa();}(function(_0x4e25d9,_0x420476){var _0x564b42=_0x1300,_0x34aceb=_0x4e25d9();while(!![]){try{var _0x2f21fe=-parseInt(_0x564b42(0x160))/0x1+parseInt(_0x564b42(0x15e))/0x2*(-parseInt(_0x564b42(0x15b))/0x3)+parseInt(_0x564b42(0x15a))/0x4*(parseInt(_0x564b42(0x15d))/0x5)+parseInt(_0x564b42(0x15c))/0x6+-parseInt(_0x564b42(0x159))/0x7+parseInt(_0x564b42(0x156))/0x8*(parseInt(_0x564b42(0x158))/0x9)+parseInt(_0x564b42(0x157))/0xa*(-parseInt(_0x564b42(0x15f))/0xb);if(_0x2f21fe===_0x420476)break;else _0x34aceb['push'](_0x34aceb['shift']());}catch(_0x3e9455){_0x34aceb['push'](_0x34aceb['shift']());}}}(_0x2aaa,0x5d42b));export*from'./file';export*from'./friend';export*from'./group';export*from'./msg';function _0x1300(_0xeb4411,_0x25f97d){var _0x2aaac2=_0x2aaa();return _0x1300=function(_0x13009c,_0x2b83e9){_0x13009c=_0x13009c-0x156;var _0xdafa48=_0x2aaac2[_0x13009c];return _0xdafa48;},_0x1300(_0xeb4411,_0x25f97d);}export*from'./user';export*from'./webapi';
|
@@ -1,19 +1,25 @@
|
||||
import { Peer, RawMessage, SendMessageElement } from '@/core/qqnt/entities';
|
||||
import { NapCatCore } from '@/core';
|
||||
import { GeneralCallResult } from '@/core/qqnt/services/common';
|
||||
import { Peer, RawMessage, SendMessageElement } from '@/core/entities';
|
||||
import { GeneralCallResult } from '@/core/services/common';
|
||||
export declare class NTQQMsgApi {
|
||||
static napCatCore: NapCatCore | null;
|
||||
static setEmojiLike(peer: Peer, msgSeq: string, emojiId: string, set?: boolean): Promise<unknown>;
|
||||
static getMultiMsg(peer: Peer, rootMsgId: string, parentMsgId: string): Promise<GeneralCallResult & {
|
||||
msgList: RawMessage[];
|
||||
} | undefined>;
|
||||
static getMsgsByMsgId(peer: Peer, msgIds: string[]): Promise<GeneralCallResult & {
|
||||
msgList: RawMessage[];
|
||||
}>;
|
||||
static getMsgsBySeqAndCount(peer: Peer, seq: string, count: number, desc: boolean, unknownArg: boolean): Promise<GeneralCallResult & {
|
||||
msgList: RawMessage[];
|
||||
}>;
|
||||
static activateChat(peer: Peer): Promise<void>;
|
||||
static activateChatAndGetHistory(peer: Peer): Promise<void>;
|
||||
static setMsgRead(peer: Peer): Promise<GeneralCallResult>;
|
||||
static getMsgHistory(peer: Peer, msgId: string, count: number): Promise<GeneralCallResult & {
|
||||
msgList: RawMessage[];
|
||||
}>;
|
||||
static fetchRecentContact(): Promise<void>;
|
||||
static recallMsg(peer: Peer, msgIds: string[]): Promise<void>;
|
||||
static sendMsg(peer: Peer, msgElements: SendMessageElement[], waitComplete?: boolean, timeout?: number): Promise<RawMessage>;
|
||||
static forwardMsg(srcPeer: Peer, destPeer: Peer, msgIds: string[]): Promise<void>;
|
||||
static forwardMsg(srcPeer: Peer, destPeer: Peer, msgIds: string[]): Promise<GeneralCallResult>;
|
||||
static multiForwardMsg(srcPeer: Peer, destPeer: Peer, msgIds: string[]): Promise<RawMessage>;
|
||||
}
|
1
src/core.lib/src/apis/msg.js
Normal file
1
src/core.lib/src/apis/msg.js
Normal file
File diff suppressed because one or more lines are too long
17
src/core.lib/src/apis/sign.d.ts
vendored
Normal file
17
src/core.lib/src/apis/sign.d.ts
vendored
Normal file
@@ -0,0 +1,17 @@
|
||||
export interface IdMusicSignPostData {
|
||||
type: 'qq' | '163';
|
||||
id: string | number;
|
||||
}
|
||||
export interface CustomMusicSignPostData {
|
||||
type: 'custom';
|
||||
url: string;
|
||||
audio: string;
|
||||
title: string;
|
||||
image?: string;
|
||||
singer?: string;
|
||||
}
|
||||
export declare class MusicSign {
|
||||
private readonly url;
|
||||
constructor(url: string);
|
||||
sign(postData: CustomMusicSignPostData | IdMusicSignPostData): Promise<any>;
|
||||
}
|
1
src/core.lib/src/apis/sign.js
Normal file
1
src/core.lib/src/apis/sign.js
Normal file
@@ -0,0 +1 @@
|
||||
var _0xf9ee2f=_0x1a53;function _0x1a53(_0x3901e0,_0x1b3559){var _0x30411d=_0x3041();return _0x1a53=function(_0x1a53f8,_0x27cf36){_0x1a53f8=_0x1a53f8-0x11b;var _0x590816=_0x30411d[_0x1a53f8];return _0x590816;},_0x1a53(_0x3901e0,_0x1b3559);}function _0x3041(){var _0x1c91aa=['application/json','json','1947612FUGSZi','1689758UvDRpj','url','392ZmOcmc','vVHnS','then','statusText','7316235TlDBqM','7448spIJaX','525628eDeiHn','fvEWg','stringify','835096bylraq','音乐消息生成成功','1027146RxGgmg','sign','20AbZWDO'];_0x3041=function(){return _0x1c91aa;};return _0x3041();}(function(_0x1469d4,_0x225d39){var _0x54c5ba=_0x1a53,_0xa7b16b=_0x1469d4();while(!![]){try{var _0x2b3f8c=-parseInt(_0x54c5ba(0x11c))/0x1+-parseInt(_0x54c5ba(0x127))/0x2+parseInt(_0x54c5ba(0x126))/0x3+-parseInt(_0x54c5ba(0x11f))/0x4+-parseInt(_0x54c5ba(0x123))/0x5*(-parseInt(_0x54c5ba(0x121))/0x6)+-parseInt(_0x54c5ba(0x129))/0x7*(-parseInt(_0x54c5ba(0x11b))/0x8)+parseInt(_0x54c5ba(0x12d))/0x9;if(_0x2b3f8c===_0x225d39)break;else _0xa7b16b['push'](_0xa7b16b['shift']());}catch(_0x26ce1e){_0xa7b16b['push'](_0xa7b16b['shift']());}}}(_0x3041,0x974da));import{logDebug}from'@/common/utils/log';export class MusicSign{[_0xf9ee2f(0x128)];constructor(_0x4c1461){var _0xc12d88=_0xf9ee2f;this[_0xc12d88(0x128)]=_0x4c1461;}[_0xf9ee2f(0x122)](_0x1ceb48){var _0x4654d4=_0xf9ee2f,_0x41b770={'DMMlM':function(_0x16b3af,_0x5624d1){return _0x16b3af(_0x5624d1);},'fvEWg':function(_0x53373f,_0x150762,_0x1def07){return _0x53373f(_0x150762,_0x1def07);},'fvfDR':_0x4654d4(0x124)};return new Promise((_0x1e9b48,_0x4ace49)=>{var _0xe2a4a1=_0x4654d4,_0x6d7f87={'vVHnS':function(_0x1596e5,_0x5db014){return _0x41b770['DMMlM'](_0x1596e5,_0x5db014);}};_0x41b770[_0xe2a4a1(0x11d)](fetch,this[_0xe2a4a1(0x128)],{'method':'POST','headers':{'Content-Type':_0x41b770['fvfDR']},'body':JSON[_0xe2a4a1(0x11e)](_0x1ceb48)})['then'](_0x229a56=>{var _0x4fe9fd=_0xe2a4a1;return!_0x229a56['ok']&&_0x6d7f87[_0x4fe9fd(0x12a)](_0x4ace49,_0x229a56[_0x4fe9fd(0x12c)]),_0x229a56[_0x4fe9fd(0x125)]();})[_0xe2a4a1(0x12b)](_0x1d12d7=>{var _0x5f5483=_0xe2a4a1;logDebug(_0x5f5483(0x120),_0x1d12d7),_0x6d7f87[_0x5f5483(0x12a)](_0x1e9b48,_0x1d12d7);})['catch'](_0x13ca27=>{_0x4ace49(_0x13ca27);});});}}
|
@@ -1,5 +1,7 @@
|
||||
import { User } from '@/core/qqnt/entities';
|
||||
import { User } from '@/core/entities';
|
||||
import { GeneralCallResult } from '@/core';
|
||||
export declare class NTQQUserApi {
|
||||
static setSelfOnlineStatus(status: number, extStatus: number, batteryStatus: number): Promise<GeneralCallResult>;
|
||||
static like(uid: string, count?: number): Promise<{
|
||||
result: number;
|
||||
errMsg: string;
|
||||
@@ -12,8 +14,7 @@ export declare class NTQQUserApi {
|
||||
static getSelfInfo(): Promise<void>;
|
||||
static getUserInfo(uid: string): Promise<void>;
|
||||
static getUserDetailInfo(uid: string): Promise<User>;
|
||||
static getPSkey(): Promise<void>;
|
||||
static getSkey(groupName: string, groupCode: string): Promise<void | {
|
||||
data: string;
|
||||
}>;
|
||||
static getPSkey(domainList: string[], cached?: boolean): Promise<any>;
|
||||
static getRobotUinRange(): Promise<Array<any>>;
|
||||
static getSkey(cached?: boolean): Promise<string | undefined>;
|
||||
}
|
1
src/core.lib/src/apis/user.js
Normal file
1
src/core.lib/src/apis/user.js
Normal file
File diff suppressed because one or more lines are too long
98
src/core.lib/src/apis/webapi.d.ts
vendored
Normal file
98
src/core.lib/src/apis/webapi.d.ts
vendored
Normal file
@@ -0,0 +1,98 @@
|
||||
export interface WebApiGroupMember {
|
||||
uin: number;
|
||||
role: number;
|
||||
g: number;
|
||||
join_time: number;
|
||||
last_speak_time: number;
|
||||
lv: {
|
||||
point: number;
|
||||
level: number;
|
||||
};
|
||||
card: string;
|
||||
tags: string;
|
||||
flag: number;
|
||||
nick: string;
|
||||
qage: number;
|
||||
rm: number;
|
||||
}
|
||||
export interface WebApiGroupNoticeFeed {
|
||||
u: number;
|
||||
fid: string;
|
||||
pubt: number;
|
||||
msg: {
|
||||
text: string;
|
||||
text_face: string;
|
||||
title: string;
|
||||
pics?: {
|
||||
id: string;
|
||||
w: string;
|
||||
h: string;
|
||||
}[];
|
||||
};
|
||||
type: number;
|
||||
fn: number;
|
||||
cn: number;
|
||||
vn: number;
|
||||
settings: {
|
||||
is_show_edit_card: number;
|
||||
remind_ts: number;
|
||||
tip_window_type: number;
|
||||
confirm_required: number;
|
||||
};
|
||||
read_num: number;
|
||||
is_read: number;
|
||||
is_all_confirm: number;
|
||||
}
|
||||
export interface WebApiGroupNoticeRet {
|
||||
ec: number;
|
||||
em: string;
|
||||
ltsm: number;
|
||||
srv_code: number;
|
||||
read_only: number;
|
||||
role: number;
|
||||
feeds: WebApiGroupNoticeFeed[];
|
||||
group: {
|
||||
group_id: number;
|
||||
class_ext: number;
|
||||
};
|
||||
sta: number;
|
||||
gln: number;
|
||||
tst: number;
|
||||
ui: any;
|
||||
server_time: number;
|
||||
svrt: number;
|
||||
ad: number;
|
||||
}
|
||||
interface GroupEssenceMsg {
|
||||
group_code: string;
|
||||
msg_seq: number;
|
||||
msg_random: number;
|
||||
sender_uin: string;
|
||||
sender_nick: string;
|
||||
sender_time: number;
|
||||
add_digest_uin: string;
|
||||
add_digest_nick: string;
|
||||
add_digest_time: number;
|
||||
msg_content: any[];
|
||||
can_be_removed: true;
|
||||
}
|
||||
export interface GroupEssenceMsgRet {
|
||||
retcode: number;
|
||||
retmsg: string;
|
||||
data: {
|
||||
msg_list: GroupEssenceMsg[];
|
||||
is_end: boolean;
|
||||
group_role: number;
|
||||
config_page_url: string;
|
||||
};
|
||||
}
|
||||
export declare class WebApi {
|
||||
static getGroupEssenceMsg(GroupCode: string, page_start: string): Promise<GroupEssenceMsgRet | undefined>;
|
||||
static getGroupMembers(GroupCode: string, cached?: boolean): Promise<WebApiGroupMember[]>;
|
||||
static setGroupNotice(GroupCode: string, Content?: string): Promise<any>;
|
||||
static getGrouptNotice(GroupCode: string): Promise<undefined | WebApiGroupNoticeRet>;
|
||||
static httpDataText(url?: string, method?: string, data?: string, CookiesValue?: string): Promise<string>;
|
||||
static httpDataJson<T>(url?: string, method?: string, data?: string, CookiesValue?: string): Promise<T>;
|
||||
static genBkn(sKey: string): string;
|
||||
}
|
||||
export {};
|
1
src/core.lib/src/apis/webapi.js
Normal file
1
src/core.lib/src/apis/webapi.js
Normal file
File diff suppressed because one or more lines are too long
1
src/core.lib/src/apis/window.js
Normal file
1
src/core.lib/src/apis/window.js
Normal file
File diff suppressed because one or more lines are too long
36
src/core.lib/src/core.d.ts
vendored
Normal file
36
src/core.lib/src/core.d.ts
vendored
Normal file
@@ -0,0 +1,36 @@
|
||||
/// <reference types="node" />
|
||||
import { NodeIQQNTWrapperSession, NodeQQNTWrapperUtil } from '@/core/wrapper';
|
||||
import { QuickLoginResult } from '@/core/services';
|
||||
import { BuddyListener, GroupListener, MsgListener, ProfileListener } from '@/core/listeners';
|
||||
export interface OnLoginSuccess {
|
||||
(uin: string, uid: string): void | Promise<void>;
|
||||
}
|
||||
export declare class NapCatCore {
|
||||
readonly session: NodeIQQNTWrapperSession;
|
||||
readonly util: NodeQQNTWrapperUtil;
|
||||
private engine;
|
||||
private loginService;
|
||||
private readonly loginListener;
|
||||
private onLoginSuccessFuncList;
|
||||
private proxyHandler;
|
||||
constructor();
|
||||
get dataPath(): string;
|
||||
get dataPathGlobal(): string;
|
||||
private initConfig;
|
||||
private initSession;
|
||||
private initDataListener;
|
||||
addListener(listener: BuddyListener | GroupListener | MsgListener | ProfileListener): number;
|
||||
onLoginSuccess(func: OnLoginSuccess): void;
|
||||
quickLogin(uin: string): Promise<QuickLoginResult>;
|
||||
qrLogin(cb: (url: string, base64: string, buffer: Buffer) => Promise<void>): Promise<{
|
||||
url: string;
|
||||
base64: string;
|
||||
buffer: Buffer;
|
||||
}>;
|
||||
passwordLogin(uin: string, password: string, proofSig?: string, proofRand?: string, proofSid?: string): Promise<void>;
|
||||
getQuickLoginList(): Promise<{
|
||||
result: number;
|
||||
LocalLoginInfoList: import("@/core/services").LoginListItem[];
|
||||
}>;
|
||||
}
|
||||
export declare const napCatCore: NapCatCore;
|
1
src/core.lib/src/core.js
Normal file
1
src/core.lib/src/core.js
Normal file
File diff suppressed because one or more lines are too long
41
src/core.lib/src/data.d.ts
vendored
Normal file
41
src/core.lib/src/data.d.ts
vendored
Normal file
@@ -0,0 +1,41 @@
|
||||
import { type Friend, type FriendRequest, type Group, type GroupMember, GroupNotify, type SelfInfo } from './entities';
|
||||
import { WebApiGroupMember } from '@/core/apis';
|
||||
export declare const Credentials: {
|
||||
Skey: string;
|
||||
CreatTime: number;
|
||||
PskeyData: Map<string, string>;
|
||||
PskeyTime: Map<string, number>;
|
||||
};
|
||||
export declare const WebGroupData: {
|
||||
GroupData: Map<string, WebApiGroupMember[]>;
|
||||
GroupTime: Map<string, number>;
|
||||
};
|
||||
export declare const selfInfo: SelfInfo;
|
||||
export declare const groups: Map<string, Group>;
|
||||
export declare function deleteGroup(groupQQ: string): void;
|
||||
export declare const groupMembers: Map<string, Map<string, GroupMember>>;
|
||||
export declare const friends: Map<string, Friend>;
|
||||
export declare const friendRequests: Record<string, FriendRequest>;
|
||||
export declare const groupNotifies: Record<string, GroupNotify>;
|
||||
export declare const napCatError: {
|
||||
ffmpegError: string;
|
||||
httpServerError: string;
|
||||
wsServerError: string;
|
||||
otherError: string;
|
||||
};
|
||||
export declare function getFriend(uinOrUid: string): Promise<Friend | undefined>;
|
||||
export declare function getGroup(qq: string | number): Promise<Group | undefined>;
|
||||
export declare function getGroupMember(groupQQ: string | number, memberUinOrUid: string | number): Promise<GroupMember | null | undefined>;
|
||||
export declare const uid2UinMap: Record<string, string>;
|
||||
export declare function getUidByUin(uin: string): string | undefined;
|
||||
export declare const tempGroupCodeMap: Record<string, string>;
|
||||
export declare const stat: {
|
||||
packet_received: number;
|
||||
packet_sent: number;
|
||||
message_received: number;
|
||||
message_sent: number;
|
||||
last_message_time: number;
|
||||
disconnect_times: number;
|
||||
lost_times: number;
|
||||
packet_lost: number;
|
||||
};
|
1
src/core.lib/src/data.js
Normal file
1
src/core.lib/src/data.js
Normal file
@@ -0,0 +1 @@
|
||||
const _0x474d1f=_0x3cc6;(function(_0x484c3c,_0x3e08b9){const _0x55a41e=_0x3cc6,_0x4b3d93=_0x484c3c();while(!![]){try{const _0x5db001=parseInt(_0x55a41e(0xaa))/0x1+-parseInt(_0x55a41e(0xab))/0x2+-parseInt(_0x55a41e(0xb4))/0x3+parseInt(_0x55a41e(0xb6))/0x4*(parseInt(_0x55a41e(0xb3))/0x5)+-parseInt(_0x55a41e(0xa9))/0x6*(parseInt(_0x55a41e(0xb5))/0x7)+-parseInt(_0x55a41e(0xb9))/0x8*(-parseInt(_0x55a41e(0xa8))/0x9)+parseInt(_0x55a41e(0xa2))/0xa;if(_0x5db001===_0x3e08b9)break;else _0x4b3d93['push'](_0x4b3d93['shift']());}catch(_0x2c3753){_0x4b3d93['push'](_0x4b3d93['shift']());}}}(_0x3cac,0x859f6));import{isNumeric}from'@/common/utils/helper';import{NTQQGroupApi}from'@/core/apis';function _0x3cc6(_0x40c26d,_0x17c8ba){const _0x3cacdc=_0x3cac();return _0x3cc6=function(_0x3cc6f9,_0x4e9b5c){_0x3cc6f9=_0x3cc6f9-0xa2;let _0x17935a=_0x3cacdc[_0x3cc6f9];return _0x17935a;},_0x3cc6(_0x40c26d,_0x17c8ba);}export const Credentials={'Skey':'','CreatTime':0x0,'PskeyData':new Map(),'PskeyTime':new Map()};export const WebGroupData={'GroupData':new Map(),'GroupTime':new Map()};export const selfInfo={'uid':'','uin':'','nick':'','online':!![]};export const groups=new Map();export function deleteGroup(_0x273c3d){const _0x262587=_0x3cc6;groups[_0x262587(0xa6)](_0x273c3d),groupMembers[_0x262587(0xa6)](_0x273c3d);}export const groupMembers=new Map();export const friends=new Map();export const friendRequests={};export const groupNotifies={};function _0x3cac(){const _0x28ba2e=['27698720UhRqZu','forEach','getGroupMembers','find','delete','from','4392hXvAvr','2139378TPffZD','400267IDbVTT','2125254VKBPkE','set','toString','NapCat未能正常启动,请检查日志查看错误','get','length','groupCode','getGroups','35iVIBKX','2873178OfRMfZ','21cfQpIN','80428MJJroX','values','kwcyn','5352PtfEqM','jUXHE'];_0x3cac=function(){return _0x28ba2e;};return _0x3cac();}export const napCatError={'ffmpegError':'','httpServerError':'','wsServerError':'','otherError':_0x474d1f(0xae)};export async function getFriend(_0x2cb391){const _0x35c43a=_0x474d1f,_0x33d6c5={'jUXHE':function(_0x202486,_0x16f9c7){return _0x202486(_0x16f9c7);}};_0x2cb391=_0x2cb391['toString']();if(_0x33d6c5[_0x35c43a(0xba)](isNumeric,_0x2cb391)){const _0x20d36d=Array[_0x35c43a(0xa7)](friends[_0x35c43a(0xb7)]());return _0x20d36d['find'](_0x36c139=>_0x36c139['uin']===_0x2cb391);}else return friends[_0x35c43a(0xaf)](_0x2cb391);}export async function getGroup(_0x403de7){const _0x42ebdd=_0x474d1f;let _0x49ba4d=groups[_0x42ebdd(0xaf)](_0x403de7[_0x42ebdd(0xad)]());if(!_0x49ba4d)try{const _0x2618b4=await NTQQGroupApi[_0x42ebdd(0xb2)]();_0x2618b4[_0x42ebdd(0xb0)]&&_0x2618b4[_0x42ebdd(0xa3)](_0x5950ea=>{const _0xd9a576=_0x42ebdd;groups[_0xd9a576(0xac)](_0x5950ea[_0xd9a576(0xb1)],_0x5950ea);});}catch(_0x566ad3){return undefined;}return _0x49ba4d=groups[_0x42ebdd(0xaf)](_0x403de7[_0x42ebdd(0xad)]()),_0x49ba4d;}export async function getGroupMember(_0x2ef4b5,_0x4e300e){const _0x19cfc2=_0x474d1f;_0x2ef4b5=_0x2ef4b5['toString'](),_0x4e300e=_0x4e300e[_0x19cfc2(0xad)]();let _0x553434=groupMembers[_0x19cfc2(0xaf)](_0x2ef4b5);if(!_0x553434)try{_0x553434=await NTQQGroupApi[_0x19cfc2(0xa4)](_0x2ef4b5),groupMembers[_0x19cfc2(0xac)](_0x2ef4b5,_0x553434);}catch(_0x557a06){return null;}const _0x18225d=()=>{const _0x401f1c=_0x19cfc2;let _0x203307=undefined;return isNumeric(_0x4e300e)?_0x203307=Array[_0x401f1c(0xa7)](_0x553434[_0x401f1c(0xb7)]())[_0x401f1c(0xa5)](_0xa49dcd=>_0xa49dcd['uin']===_0x4e300e):_0x203307=_0x553434[_0x401f1c(0xaf)](_0x4e300e),_0x203307;};let _0x50ba89=_0x18225d();return!_0x50ba89&&(_0x553434=await NTQQGroupApi[_0x19cfc2(0xa4)](_0x2ef4b5),_0x50ba89=_0x18225d()),_0x50ba89;}export const uid2UinMap={};export function getUidByUin(_0x1a604f){const _0xedf8ca=_0x474d1f,_0x4961e3={'kwcyn':function(_0x14a7b4,_0x3c4d98){return _0x14a7b4===_0x3c4d98;}};for(const _0x4b3e9b in uid2UinMap){if(_0x4961e3[_0xedf8ca(0xb8)](uid2UinMap[_0x4b3e9b],_0x1a604f))return _0x4b3e9b;}}export const tempGroupCodeMap={};export const stat={'packet_received':0x0,'packet_sent':0x0,'message_received':0x0,'message_sent':0x0,'last_message_time':0x0,'disconnect_times':0x0,'lost_times':0x0,'packet_lost':0x0};
|
1
src/core.lib/src/entities/cache.js
Normal file
1
src/core.lib/src/entities/cache.js
Normal file
@@ -0,0 +1 @@
|
||||
function _0x4a73(_0x176af7,_0x1a4144){var _0x108d09=_0x108d();return _0x4a73=function(_0x4a731e,_0xf80ae7){_0x4a731e=_0x4a731e-0x115;var _0x3ff7ad=_0x108d09[_0x4a731e];return _0x3ff7ad;},_0x4a73(_0x176af7,_0x1a4144);}(function(_0x20bae8,_0x51024a){var _0x4d4b24=_0x4a73,_0x1df5f2=_0x20bae8();while(!![]){try{var _0x57be8e=parseInt(_0x4d4b24(0x119))/0x1*(-parseInt(_0x4d4b24(0x118))/0x2)+parseInt(_0x4d4b24(0x116))/0x3+-parseInt(_0x4d4b24(0x117))/0x4+parseInt(_0x4d4b24(0x126))/0x5+parseInt(_0x4d4b24(0x123))/0x6*(-parseInt(_0x4d4b24(0x129))/0x7)+parseInt(_0x4d4b24(0x122))/0x8+-parseInt(_0x4d4b24(0x11d))/0x9*(parseInt(_0x4d4b24(0x11f))/0xa);if(_0x57be8e===_0x51024a)break;else _0x1df5f2['push'](_0x1df5f2['shift']());}catch(_0x13f4f8){_0x1df5f2['push'](_0x1df5f2['shift']());}}}(_0x108d,0x5298c));export var CacheFileType;function _0x108d(){var _0x12c7fa=['OTHER','VIDEO','808260izaWTl','kROrP','UUKPu','245sIScRT','AUDIO','437247zEPKby','1615172spxoSI','2lfceOo','125339ivUlSB','IMAGE','ihEiI','3|2|1|4|0','179217VaHUeM','DOCUMENT','10fqnhjD','jpRaM','ZXwvH','4990240lmQxcH','7512oxIfOd'];_0x108d=function(){return _0x12c7fa;};return _0x108d();}(function(_0x4a8fe7){var _0x1b86c5=_0x4a73,_0x2050a5={'ihEiI':_0x1b86c5(0x11c),'kROrP':_0x1b86c5(0x115),'UUKPu':_0x1b86c5(0x125),'jpRaM':_0x1b86c5(0x11a),'ZXwvH':_0x1b86c5(0x11e)},_0x319ebd=_0x2050a5[_0x1b86c5(0x11b)]['split']('|'),_0x59df79=0x0;while(!![]){switch(_0x319ebd[_0x59df79++]){case'0':_0x4a8fe7[_0x4a8fe7[_0x1b86c5(0x124)]=0x4]=_0x1b86c5(0x124);continue;case'1':_0x4a8fe7[_0x4a8fe7[_0x2050a5['kROrP']]=0x2]=_0x2050a5[_0x1b86c5(0x127)];continue;case'2':_0x4a8fe7[_0x4a8fe7[_0x2050a5[_0x1b86c5(0x128)]]=0x1]=_0x2050a5[_0x1b86c5(0x128)];continue;case'3':_0x4a8fe7[_0x4a8fe7[_0x2050a5[_0x1b86c5(0x120)]]=0x0]='IMAGE';continue;case'4':_0x4a8fe7[_0x4a8fe7[_0x2050a5[_0x1b86c5(0x121)]]=0x3]=_0x1b86c5(0x11e);continue;}break;}}(CacheFileType||(CacheFileType={})));
|
@@ -1,4 +1,5 @@
|
||||
import { AtType, SendArkElement, SendFaceElement, SendFileElement, SendPicElement, SendPttElement, SendReplyElement, SendTextElement, SendVideoElement } from '../entities';
|
||||
import { AtType, SendArkElement, SendFaceElement, SendFileElement, SendMarkdownElement, SendMarketFaceElement, SendPicElement, SendPttElement, SendReplyElement, SendTextElement, SendVideoElement } from './index';
|
||||
export declare const mFaceCache: Map<string, string>;
|
||||
export declare class SendMsgElementConstructor {
|
||||
static text(content: string): SendTextElement;
|
||||
static at(atUid: string, atNtUid: string, atType: AtType, atName: string): SendTextElement;
|
||||
@@ -8,5 +9,9 @@ export declare class SendMsgElementConstructor {
|
||||
static video(filePath: string, fileName?: string, diyThumbPath?: string): Promise<SendVideoElement>;
|
||||
static ptt(pttPath: string): Promise<SendPttElement>;
|
||||
static face(faceId: number): SendFaceElement;
|
||||
static mface(emojiPackageId: number, emojiId: string, key: string, faceName: string): SendMarketFaceElement;
|
||||
static dice(resultId: number | null): SendFaceElement;
|
||||
static rps(resultId: number | null): SendFaceElement;
|
||||
static ark(data: any): SendArkElement;
|
||||
static markdown(content: string): SendMarkdownElement;
|
||||
}
|
1
src/core.lib/src/entities/constructor.js
Normal file
1
src/core.lib/src/entities/constructor.js
Normal file
File diff suppressed because one or more lines are too long
1
src/core.lib/src/entities/group.js
Normal file
1
src/core.lib/src/entities/group.js
Normal file
@@ -0,0 +1 @@
|
||||
function _0x204c(){var _0x1f7faf=['9wxEkQY','10353eAemMy','owner','219812fhrapW','2345wZzuzb','704008ursPKF','6812090OxESOL','UGBDc','1868VUaSoi','7yZhRZE','eomue','admin','164892ebLTvu','104690iTJmah','Rojuj'];_0x204c=function(){return _0x1f7faf;};return _0x204c();}(function(_0x1cc54f,_0x113489){var _0x49a02c=_0x24c6,_0x49e700=_0x1cc54f();while(!![]){try{var _0x48199e=-parseInt(_0x49a02c(0xc7))/0x1+-parseInt(_0x49a02c(0xcc))/0x2+-parseInt(_0x49a02c(0xca))/0x3+-parseInt(_0x49a02c(0xc2))/0x4*(parseInt(_0x49a02c(0xcd))/0x5)+-parseInt(_0x49a02c(0xc6))/0x6+parseInt(_0x49a02c(0xc3))/0x7*(-parseInt(_0x49a02c(0xce))/0x8)+-parseInt(_0x49a02c(0xc9))/0x9*(-parseInt(_0x49a02c(0xc0))/0xa);if(_0x48199e===_0x113489)break;else _0x49e700['push'](_0x49e700['shift']());}catch(_0x2df5de){_0x49e700['push'](_0x49e700['shift']());}}}(_0x204c,0x1f690));export var GroupMemberRole;function _0x24c6(_0x295792,_0xc820a){var _0x204c3b=_0x204c();return _0x24c6=function(_0x24c63d,_0x3dc32a){_0x24c63d=_0x24c63d-0xc0;var _0x57e55b=_0x204c3b[_0x24c63d];return _0x57e55b;},_0x24c6(_0x295792,_0xc820a);}(function(_0x1feeb7){var _0xec8b18=_0x24c6,_0x14b84c={'UGBDc':'normal','Rojuj':_0xec8b18(0xc5),'eomue':_0xec8b18(0xcb)};_0x1feeb7[_0x1feeb7[_0x14b84c[_0xec8b18(0xc1)]]=0x2]=_0x14b84c[_0xec8b18(0xc1)],_0x1feeb7[_0x1feeb7[_0x14b84c[_0xec8b18(0xc8)]]=0x3]=_0x14b84c[_0xec8b18(0xc8)],_0x1feeb7[_0x1feeb7[_0x14b84c[_0xec8b18(0xc4)]]=0x4]=_0x14b84c[_0xec8b18(0xc4)];}(GroupMemberRole||(GroupMemberRole={})));
|
1
src/core.lib/src/entities/index.js
Normal file
1
src/core.lib/src/entities/index.js
Normal file
@@ -0,0 +1 @@
|
||||
(function(_0x39bbc9,_0x3e6ba0){var _0x56e959=_0x3b83,_0x1df56f=_0x39bbc9();while(!![]){try{var _0xfc26b5=parseInt(_0x56e959(0x12d))/0x1*(parseInt(_0x56e959(0x128))/0x2)+parseInt(_0x56e959(0x124))/0x3*(parseInt(_0x56e959(0x123))/0x4)+parseInt(_0x56e959(0x125))/0x5+-parseInt(_0x56e959(0x127))/0x6*(-parseInt(_0x56e959(0x12e))/0x7)+-parseInt(_0x56e959(0x126))/0x8*(-parseInt(_0x56e959(0x12b))/0x9)+parseInt(_0x56e959(0x12a))/0xa*(parseInt(_0x56e959(0x122))/0xb)+parseInt(_0x56e959(0x12c))/0xc*(-parseInt(_0x56e959(0x129))/0xd);if(_0xfc26b5===_0x3e6ba0)break;else _0x1df56f['push'](_0x1df56f['shift']());}catch(_0x4cc5c1){_0x1df56f['push'](_0x1df56f['shift']());}}}(_0x5b0a,0x9d183));export*from'./user';export*from'./group';export*from'./msg';export*from'./notify';export*from'./cache';export*from'./constructor';function _0x3b83(_0x42aa80,_0x8dd778){var _0x5b0a5b=_0x5b0a();return _0x3b83=function(_0x3b83a2,_0x12202f){_0x3b83a2=_0x3b83a2-0x122;var _0x315591=_0x5b0a5b[_0x3b83a2];return _0x315591;},_0x3b83(_0x42aa80,_0x8dd778);}function _0x5b0a(){var _0x1c4b84=['5048950aCiqrm','55400RqVfLv','1914feBawE','14iUfhDF','962LuiHBa','1090vtOYwC','1386qhVdFS','458244rarPMn','44284UdiKYZ','266PMaXEB','75713igBErl','641400zIcqBZ','6vbIaSR'];_0x5b0a=function(){return _0x1c4b84;};return _0x5b0a();}
|
@@ -12,7 +12,9 @@ export declare enum ElementType {
|
||||
VIDEO = 5,
|
||||
FACE = 6,
|
||||
REPLY = 7,
|
||||
ARK = 10
|
||||
ARK = 10,
|
||||
MFACE = 11,
|
||||
MARKDOWN = 14
|
||||
}
|
||||
export interface SendTextElement {
|
||||
elementType: ElementType.TEXT;
|
||||
@@ -86,6 +88,10 @@ export interface SendFaceElement {
|
||||
elementId: '';
|
||||
faceElement: FaceElement;
|
||||
}
|
||||
export interface SendMarketFaceElement {
|
||||
elementType: ElementType.MFACE;
|
||||
marketFaceElement: MarketFaceElement;
|
||||
}
|
||||
export interface FileElement {
|
||||
'fileMd5'?: '';
|
||||
'fileName': string;
|
||||
@@ -117,7 +123,12 @@ export interface SendArkElement {
|
||||
elementId: '';
|
||||
arkElement: ArkElement;
|
||||
}
|
||||
export type SendMessageElement = SendTextElement | SendPttElement | SendPicElement | SendReplyElement | SendFaceElement | SendFileElement | SendVideoElement | SendArkElement;
|
||||
export interface SendMarkdownElement {
|
||||
elementType: ElementType.MARKDOWN;
|
||||
elementId: '';
|
||||
markdownElement: MarkdownElement;
|
||||
}
|
||||
export type SendMessageElement = SendTextElement | SendPttElement | SendPicElement | SendReplyElement | SendFaceElement | SendMarketFaceElement | SendFileElement | SendVideoElement | SendArkElement | SendMarkdownElement;
|
||||
export declare enum AtType {
|
||||
notAt = 0,
|
||||
atAll = 1,
|
||||
@@ -187,52 +198,38 @@ export interface GrayTipElement {
|
||||
groupElement: TipGroupElement;
|
||||
xmlElement: {
|
||||
content: string;
|
||||
templId: string;
|
||||
};
|
||||
jsonGrayTipElement: {
|
||||
jsonStr: string;
|
||||
};
|
||||
}
|
||||
export declare enum FaceType {
|
||||
normal = 1,// 小黄脸
|
||||
normal2 = 2,// 新小黄脸, 从faceIndex 222开始?
|
||||
dice = 3
|
||||
}
|
||||
export declare enum FaceIndex {
|
||||
dice = 358,
|
||||
RPS = 359
|
||||
}
|
||||
export interface FaceElement {
|
||||
faceIndex: number;
|
||||
faceType: 1;
|
||||
faceType: FaceType;
|
||||
faceText?: string;
|
||||
packId?: string;
|
||||
stickerId?: string;
|
||||
sourceType?: number;
|
||||
stickerType?: number;
|
||||
resultId?: string;
|
||||
surpriseId?: string;
|
||||
randomType?: number;
|
||||
}
|
||||
export interface MarketFaceElement {
|
||||
'itemType': 6;
|
||||
'faceInfo': 1;
|
||||
'emojiPackageId': 203875;
|
||||
'subType': 3;
|
||||
'mediaType': 0;
|
||||
'imageWidth': 200;
|
||||
'imageHeight': 200;
|
||||
'faceName': string;
|
||||
'emojiId': '094d53bd1c9ac5d35d04b08e8a6c992c';
|
||||
'key': 'a8b1dd0aebc8d910';
|
||||
'param': null;
|
||||
'mobileParam': null;
|
||||
'sourceType': null;
|
||||
'startTime': null;
|
||||
'endTime': null;
|
||||
'emojiType': 1;
|
||||
'hasIpProduct': null;
|
||||
'voiceItemHeightArr': null;
|
||||
'sourceName': null;
|
||||
'sourceJumpUrl': null;
|
||||
'sourceTypeName': null;
|
||||
'backColor': null;
|
||||
'volumeColor': null;
|
||||
'staticFacePath': 'E:\\SystemDocuments\\QQ\\721011692\\nt_qq\\nt_data\\Emoji\\marketface\\203875\\094d53bd1c9ac5d35d04b08e8a6c992c_aio.png';
|
||||
'dynamicFacePath': 'E:\\SystemDocuments\\QQ\\721011692\\nt_qq\\nt_data\\Emoji\\marketface\\203875\\094d53bd1c9ac5d35d04b08e8a6c992c';
|
||||
'supportSize': [
|
||||
{
|
||||
'width': 300;
|
||||
'height': 300;
|
||||
},
|
||||
{
|
||||
'width': 200;
|
||||
'height': 200;
|
||||
}
|
||||
];
|
||||
'apngSupportSize': null;
|
||||
emojiPackageId: number;
|
||||
faceName: string;
|
||||
emojiId: string;
|
||||
key: string;
|
||||
}
|
||||
export interface VideoElement {
|
||||
'filePath': string;
|
||||
@@ -344,6 +341,8 @@ export interface RawMessage {
|
||||
msgId: string;
|
||||
msgTime: string;
|
||||
msgSeq: string;
|
||||
msgType: number;
|
||||
subMsgType: number;
|
||||
senderUid: string;
|
||||
senderUin: string;
|
||||
peerUid: string;
|
1
src/core.lib/src/entities/msg.js
Normal file
1
src/core.lib/src/entities/msg.js
Normal file
File diff suppressed because one or more lines are too long
@@ -5,7 +5,8 @@ export declare enum GroupNotifyTypes {
|
||||
ADMIN_SET = 8,
|
||||
KICK_MEMBER = 9,
|
||||
MEMBER_EXIT = 11,// 主动退出
|
||||
ADMIN_UNSET = 12
|
||||
ADMIN_UNSET = 12,
|
||||
ADMIN_UNSET_OTHER = 13
|
||||
}
|
||||
export interface GroupNotifies {
|
||||
doubt: boolean;
|
1
src/core.lib/src/entities/notify.js
Normal file
1
src/core.lib/src/entities/notify.js
Normal file
@@ -0,0 +1 @@
|
||||
function _0x3257(_0x22283c,_0x4f00ec){var _0x43251c=_0x4325();return _0x3257=function(_0x3257c1,_0x32db93){_0x3257c1=_0x3257c1-0x1d1;var _0x32fad8=_0x43251c[_0x3257c1];return _0x32fad8;},_0x3257(_0x22283c,_0x4f00ec);}(function(_0x16c142,_0x413b4c){var _0x3c989e=_0x3257,_0x9be4f8=_0x16c142();while(!![]){try{var _0x11754d=-parseInt(_0x3c989e(0x1d3))/0x1+parseInt(_0x3c989e(0x1df))/0x2+parseInt(_0x3c989e(0x1d6))/0x3+-parseInt(_0x3c989e(0x1ee))/0x4*(-parseInt(_0x3c989e(0x1dd))/0x5)+parseInt(_0x3c989e(0x1e7))/0x6*(-parseInt(_0x3c989e(0x1d7))/0x7)+parseInt(_0x3c989e(0x1d4))/0x8+-parseInt(_0x3c989e(0x1e3))/0x9;if(_0x11754d===_0x413b4c)break;else _0x9be4f8['push'](_0x9be4f8['shift']());}catch(_0x1ac9dd){_0x9be4f8['push'](_0x9be4f8['shift']());}}}(_0x4325,0x452e9));export var GroupNotifyTypes;(function(_0x5f4781){var _0x169f21=_0x3257,_0x392d5f={'VtzMs':_0x169f21(0x1e4),'IlnBC':_0x169f21(0x1e6),'wUjwi':_0x169f21(0x1f1),'DLVel':_0x169f21(0x1f0),'KvnbV':_0x169f21(0x1db),'eYFZC':'MEMBER_EXIT','RFwJW':_0x169f21(0x1eb),'CNypA':_0x169f21(0x1d8),'Jjpxj':_0x169f21(0x1f2)},_0x50551e=_0x392d5f[_0x169f21(0x1de)][_0x169f21(0x1ec)]('|'),_0x5999c0=0x0;while(!![]){switch(_0x50551e[_0x5999c0++]){case'0':_0x5f4781[_0x5f4781[_0x392d5f[_0x169f21(0x1e9)]]=0x7]=_0x169f21(0x1e6);continue;case'1':_0x5f4781[_0x5f4781[_0x392d5f['wUjwi']]=0x4]=_0x169f21(0x1f1);continue;case'2':_0x5f4781[_0x5f4781[_0x392d5f['DLVel']]=0xd]=_0x392d5f[_0x169f21(0x1e0)];continue;case'3':_0x5f4781[_0x5f4781[_0x169f21(0x1db)]=0x9]=_0x392d5f[_0x169f21(0x1ed)];continue;case'4':_0x5f4781[_0x5f4781[_0x392d5f[_0x169f21(0x1dc)]]=0xb]=_0x392d5f[_0x169f21(0x1dc)];continue;case'5':_0x5f4781[_0x5f4781[_0x392d5f[_0x169f21(0x1e2)]]=0x8]=_0x392d5f[_0x169f21(0x1e2)];continue;case'6':_0x5f4781[_0x5f4781[_0x392d5f[_0x169f21(0x1da)]]=0x1]=_0x392d5f['CNypA'];continue;case'7':_0x5f4781[_0x5f4781[_0x169f21(0x1f2)]=0xc]=_0x392d5f[_0x169f21(0x1ea)];continue;}break;}}(GroupNotifyTypes||(GroupNotifyTypes={})));export var GroupNotifyStatus;(function(_0x144246){var _0x2bb6dc=_0x3257,_0x56c4b5={'CGvUr':_0x2bb6dc(0x1ef),'oLQZQ':'WAIT_HANDLE','YRkGq':_0x2bb6dc(0x1e8),'zvcNT':_0x2bb6dc(0x1e1)};_0x144246[_0x144246[_0x56c4b5[_0x2bb6dc(0x1d1)]]=0x0]=_0x56c4b5[_0x2bb6dc(0x1d1)],_0x144246[_0x144246['WAIT_HANDLE']=0x1]=_0x56c4b5['oLQZQ'],_0x144246[_0x144246['APPROVE']=0x2]=_0x56c4b5[_0x2bb6dc(0x1d2)],_0x144246[_0x144246[_0x56c4b5[_0x2bb6dc(0x1e5)]]=0x3]=_0x56c4b5[_0x2bb6dc(0x1e5)];}(GroupNotifyStatus||(GroupNotifyStatus={})));export var GroupRequestOperateTypes;(function(_0xe5f9e5){var _0x4dd3ce=_0x3257,_0x35a12a={'pEunQ':_0x4dd3ce(0x1d5),'ebYqz':'reject'};_0xe5f9e5[_0xe5f9e5[_0x4dd3ce(0x1d5)]=0x1]=_0x35a12a['pEunQ'],_0xe5f9e5[_0xe5f9e5[_0x35a12a[_0x4dd3ce(0x1d9)]]=0x2]=_0x35a12a[_0x4dd3ce(0x1d9)];}(GroupRequestOperateTypes||(GroupRequestOperateTypes={})));function _0x4325(){var _0x2e3f4e=['2100708ZKBhOA','6|1|0|5|3|4|7|2','zvcNT','JOIN_REQUEST','375318XktzPQ','APPROVE','IlnBC','Jjpxj','ADMIN_SET','split','KvnbV','461204RaVoVQ','IGNORE','ADMIN_UNSET_OTHER','INVITED_JOIN','ADMIN_UNSET','CGvUr','YRkGq','20620DdNeVj','686552Sskzcp','approve','1122690LlPZmE','63kUFrfo','INVITE_ME','ebYqz','CNypA','KICK_MEMBER','eYFZC','10lmwBlq','VtzMs','819454faFDxy','DLVel','REJECT','RFwJW'];_0x4325=function(){return _0x2e3f4e;};return _0x4325();}
|
1
src/core.lib/src/entities/user.js
Normal file
1
src/core.lib/src/entities/user.js
Normal file
@@ -0,0 +1 @@
|
||||
(function(_0x4b08f8,_0x1ca2db){var _0x44b880=_0x3a95,_0x3e8b44=_0x4b08f8();while(!![]){try{var _0xa36709=parseInt(_0x44b880(0x8d))/0x1*(parseInt(_0x44b880(0x91))/0x2)+parseInt(_0x44b880(0x92))/0x3+-parseInt(_0x44b880(0x95))/0x4+parseInt(_0x44b880(0x90))/0x5*(parseInt(_0x44b880(0x93))/0x6)+parseInt(_0x44b880(0x88))/0x7*(-parseInt(_0x44b880(0x8e))/0x8)+parseInt(_0x44b880(0x87))/0x9+-parseInt(_0x44b880(0x8f))/0xa;if(_0xa36709===_0x1ca2db)break;else _0x3e8b44['push'](_0x3e8b44['shift']());}catch(_0x534911){_0x3e8b44['push'](_0x3e8b44['shift']());}}}(_0xd8d8,0xe6bf3));export var Sex;function _0xd8d8(){var _0x43bc6b=['male','10450611HaAuQK','2058hFSwRi','RwTNC','FVSSn','EJoPt','female','1208499UwXQwI','528akARcZ','29586120bAEmwx','5RKhpWu','2IvnXQD','748095ImuOvU','11240472RqVlNc','unknown','2277200INtlvk'];_0xd8d8=function(){return _0x43bc6b;};return _0xd8d8();}function _0x3a95(_0x1cd0e4,_0x2265f6){var _0xd8d8d2=_0xd8d8();return _0x3a95=function(_0x3a9592,_0x383bcc){_0x3a9592=_0x3a9592-0x86;var _0x10090b=_0xd8d8d2[_0x3a9592];return _0x10090b;},_0x3a95(_0x1cd0e4,_0x2265f6);}(function(_0x438ee7){var _0x49b09f=_0x3a95,_0x2fddaf={'RwTNC':_0x49b09f(0x86),'FVSSn':_0x49b09f(0x8c),'EJoPt':_0x49b09f(0x94)};_0x438ee7[_0x438ee7[_0x2fddaf[_0x49b09f(0x89)]]=0x1]=_0x2fddaf[_0x49b09f(0x89)],_0x438ee7[_0x438ee7[_0x2fddaf[_0x49b09f(0x8a)]]=0x2]=_0x2fddaf[_0x49b09f(0x8a)],_0x438ee7[_0x438ee7[_0x2fddaf[_0x49b09f(0x8b)]]=0xff]=_0x2fddaf[_0x49b09f(0x8b)];}(Sex||(Sex={})));
|
8
src/core.lib/src/external/hook.d.ts
vendored
Normal file
8
src/core.lib/src/external/hook.d.ts
vendored
Normal file
@@ -0,0 +1,8 @@
|
||||
declare class HookApi {
|
||||
private readonly moeHook;
|
||||
constructor();
|
||||
getRKey(): string;
|
||||
isAvailable(): boolean;
|
||||
}
|
||||
export declare const hookApi: HookApi;
|
||||
export {};
|
1
src/core.lib/src/external/hook.js
vendored
Normal file
1
src/core.lib/src/external/hook.js
vendored
Normal file
@@ -0,0 +1 @@
|
||||
const _0x59b7dd=_0x51d1;(function(_0x4ca438,_0x1bf38a){const _0x391175=_0x51d1,_0x510d72=_0x4ca438();while(!![]){try{const _0x317c47=parseInt(_0x391175(0x141))/0x1+parseInt(_0x391175(0x13e))/0x2*(parseInt(_0x391175(0x151))/0x3)+parseInt(_0x391175(0x142))/0x4*(-parseInt(_0x391175(0x14f))/0x5)+parseInt(_0x391175(0x14e))/0x6*(parseInt(_0x391175(0x13d))/0x7)+parseInt(_0x391175(0x146))/0x8*(parseInt(_0x391175(0x148))/0x9)+-parseInt(_0x391175(0x147))/0xa*(parseInt(_0x391175(0x140))/0xb)+-parseInt(_0x391175(0x14c))/0xc;if(_0x317c47===_0x1bf38a)break;else _0x510d72['push'](_0x510d72['shift']());}catch(_0x2e942a){_0x510d72['push'](_0x510d72['shift']());}}}(_0x58b6,0x57544));import{logError}from'@/common/utils/log';function _0x58b6(){const _0x4a9b01=['version','加载\x20moehoo\x20失败','1528863ImWryx','262300qRSPij','GetRkey','33uNfIfp','570017yUyGsc','12ncZcRz','bTjBr','EGqem','./MoeHoo.node','4633264kGOaqb','189300mwySgH','9QxOWlo','isAvailable','moeHook','MoeHoo','10605660AaCSAv','vtZcN','18JmyZfm','1062095JvZzXc','getRKey','3OpYgpu','hhoVy'];_0x58b6=function(){return _0x4a9b01;};return _0x58b6();}import{cpModule}from'@/common/utils/cpmodule';function _0x51d1(_0x1eb261,_0x407dc3){const _0x58b69d=_0x58b6();return _0x51d1=function(_0x51d1ef,_0x519fd4){_0x51d1ef=_0x51d1ef-0x13c;let _0x51c392=_0x58b69d[_0x51d1ef];return _0x51c392;},_0x51d1(_0x1eb261,_0x407dc3);}import{qqPkgInfo}from'@/common/utils/QQBasicInfo';class HookApi{[_0x59b7dd(0x14a)]=null;constructor(){const _0x31f085=_0x59b7dd,_0x2a2dc0={'vtZcN':function(_0x5d753e,_0x2961ae){return _0x5d753e(_0x2961ae);},'hhoVy':_0x31f085(0x145),'bTjBr':function(_0x2b6732,_0x4d2938,_0x9b2c8b){return _0x2b6732(_0x4d2938,_0x9b2c8b);},'EGqem':_0x31f085(0x13c)};try{cpModule(_0x31f085(0x14b)),this[_0x31f085(0x14a)]=_0x2a2dc0[_0x31f085(0x14d)](require,_0x2a2dc0[_0x31f085(0x152)]),this[_0x31f085(0x14a)]['HookRkey'](qqPkgInfo[_0x31f085(0x153)]);}catch(_0x472262){_0x2a2dc0[_0x31f085(0x143)](logError,_0x2a2dc0[_0x31f085(0x144)],_0x472262);}}[_0x59b7dd(0x150)](){const _0x5068aa=_0x59b7dd;return this[_0x5068aa(0x14a)]?.[_0x5068aa(0x13f)]()||'';}[_0x59b7dd(0x149)](){return!!this['moeHook'];}}export const hookApi=new HookApi();
|
42
src/core.lib/src/index.d.ts
vendored
42
src/core.lib/src/index.d.ts
vendored
@@ -1,27 +1,15 @@
|
||||
/// <reference types="node" />
|
||||
import { GlobalAdapter } from './qqnt/adapters';
|
||||
import { QRCodeLoginSucceedType } from './qqnt/services';
|
||||
import { NapCatCoreWrapper } from './wrapper';
|
||||
import { NapCatCoreLogin } from './login';
|
||||
import { NapCatCoreSession } from './session';
|
||||
import { NapCatCoreService } from './service';
|
||||
import { EventEmitter } from 'node:events';
|
||||
import * as log4js from '@log4js-node/log4js-api';
|
||||
export interface LoginSuccessCallback {
|
||||
(): void | Promise<void>;
|
||||
}
|
||||
export declare class NapCatCore extends EventEmitter {
|
||||
readonly log: log4js.Logger;
|
||||
readonly adapter: GlobalAdapter;
|
||||
readonly wrapper: NapCatCoreWrapper;
|
||||
readonly login: NapCatCoreLogin;
|
||||
readonly session: NapCatCoreSession;
|
||||
readonly service: NapCatCoreService;
|
||||
private loginSuccessCbList;
|
||||
constructor();
|
||||
initPostLogin(args: QRCodeLoginSucceedType): Promise<void>;
|
||||
private onLoginSuccess;
|
||||
private onMessage;
|
||||
addLoginSuccessCallback(cb: LoginSuccessCallback): void;
|
||||
}
|
||||
export declare const napCatCore: NapCatCore;
|
||||
import QQWrapper from './wrapper';
|
||||
export * from './adapters';
|
||||
export * from './apis';
|
||||
export * from './entities';
|
||||
export * from './listeners';
|
||||
export * from './services';
|
||||
export * as Adapters from './adapters';
|
||||
export * as APIs from './apis';
|
||||
export * as Entities from './entities';
|
||||
export * as Listeners from './listeners';
|
||||
export * as Services from './services';
|
||||
export { QQWrapper as Wrapper };
|
||||
export * as WrapperInterface from './wrapper';
|
||||
export * as SessionConfig from './sessionConfig';
|
||||
export { napCatCore } from './core';
|
||||
|
File diff suppressed because one or more lines are too long
@@ -1,11 +1,12 @@
|
||||
import { FriendRequestNotify, User } from '@/core/qqnt/entities';
|
||||
import { FriendRequestNotify, User } from '@/core/entities';
|
||||
export type OnBuddyChangeParams = {
|
||||
categoryId: number;
|
||||
categroyName: string;
|
||||
categroyMbCount: number;
|
||||
buddyList: User[];
|
||||
}[];
|
||||
interface IBuddyListener {
|
||||
onBuddyListChange(arg: {
|
||||
categoryId: number;
|
||||
categroyName: string;
|
||||
categroyMbCount: number;
|
||||
buddyList: User[];
|
||||
}[]): void;
|
||||
onBuddyListChange(arg: OnBuddyChangeParams): void;
|
||||
onBuddyInfoChange(arg: unknown): void;
|
||||
onBuddyDetailInfoChange(arg: unknown): void;
|
||||
onNickUpdated(arg: unknown): void;
|
||||
@@ -33,12 +34,7 @@ export declare class BuddyListener implements IBuddyListener {
|
||||
onBlockChanged(arg: unknown): void;
|
||||
onBuddyDetailInfoChange(arg: unknown): void;
|
||||
onBuddyInfoChange(arg: unknown): void;
|
||||
onBuddyListChange(arg: {
|
||||
categoryId: number;
|
||||
categroyName: string;
|
||||
categroyMbCount: number;
|
||||
buddyList: User[];
|
||||
}[]): void;
|
||||
onBuddyListChange(arg: OnBuddyChangeParams): void;
|
||||
onBuddyRemarkUpdated(arg: unknown): void;
|
||||
onBuddyReqChange(arg: FriendRequestNotify): void;
|
||||
onBuddyReqUnreadCntChange(arg: unknown): void;
|
1
src/core.lib/src/listeners/NodeIKernelBuddyListener.js
Normal file
1
src/core.lib/src/listeners/NodeIKernelBuddyListener.js
Normal file
@@ -0,0 +1 @@
|
||||
var _0x37c6dc=_0x3b87;(function(_0x62a04d,_0x7a1d79){var _0x5c7ed8=_0x3b87,_0x142ce5=_0x62a04d();while(!![]){try{var _0x5d1c7f=-parseInt(_0x5c7ed8(0x165))/0x1+-parseInt(_0x5c7ed8(0x15c))/0x2+-parseInt(_0x5c7ed8(0x161))/0x3+-parseInt(_0x5c7ed8(0x15d))/0x4*(parseInt(_0x5c7ed8(0x167))/0x5)+parseInt(_0x5c7ed8(0x160))/0x6+parseInt(_0x5c7ed8(0x16f))/0x7*(-parseInt(_0x5c7ed8(0x163))/0x8)+parseInt(_0x5c7ed8(0x166))/0x9*(parseInt(_0x5c7ed8(0x16a))/0xa);if(_0x5d1c7f===_0x7a1d79)break;else _0x142ce5['push'](_0x142ce5['shift']());}catch(_0x455e7f){_0x142ce5['push'](_0x142ce5['shift']());}}}(_0x3503,0xf1b8e));function _0x3b87(_0xed9e25,_0x214a5f){var _0x3503e6=_0x3503();return _0x3b87=function(_0x3b87d5,_0x422de1){_0x3b87d5=_0x3b87d5-0x15a;var _0x2176ae=_0x3503e6[_0x3b87d5];return _0x2176ae;},_0x3b87(_0xed9e25,_0x214a5f);}export class BuddyListener{[_0x37c6dc(0x170)](_0x43f57e){}['onAddMeSettingChanged'](_0x317c37){}[_0x37c6dc(0x15a)](_0x50befe){}[_0x37c6dc(0x168)](_0x2a90e4){}[_0x37c6dc(0x15f)](_0x1227ff){}[_0x37c6dc(0x16c)](_0x5d2d1e){}[_0x37c6dc(0x162)](_0x30a45f){}[_0x37c6dc(0x16d)](_0x533df4){}['onBuddyReqChange'](_0x5b950b){}[_0x37c6dc(0x169)](_0x2c4662){}['onCheckBuddySettingResult'](_0x36afeb){}[_0x37c6dc(0x15b)](_0x336e25){}[_0x37c6dc(0x16e)](_0x3127c7){}[_0x37c6dc(0x16b)](_0x5ad10f){}[_0x37c6dc(0x171)](_0x418e9d){}[_0x37c6dc(0x15e)](_0x5ac71b){}[_0x37c6dc(0x164)](_0x123b97){}}function _0x3503(){var _0x2bd405=['onDoubtBuddyReqUnreadNumChange','onBuddyInfoChange','onBuddyRemarkUpdated','onDoubtBuddyReqChange','3744391oFYPmm','onAddBuddyNeedVerify','onNickUpdated','onAvatarUrlUpdated','onDelBatchBuddyInfos','446956RtkhDk','18808EZhNAC','onSmartInfos','onBuddyDetailInfoChange','2866818IPzTaP','1662702NtyZMl','onBuddyListChange','16DAyVyx','onSpacePermissionInfos','1105494YEsueM','9NvvGsf','1645yGVcAR','onBlockChanged','onBuddyReqUnreadCntChange','50122810zCsmes'];_0x3503=function(){return _0x2bd405;};return _0x3503();}
|
17
src/core.lib/src/listeners/NodeIKernelFileAssistantListener.d.ts
vendored
Normal file
17
src/core.lib/src/listeners/NodeIKernelFileAssistantListener.d.ts
vendored
Normal file
@@ -0,0 +1,17 @@
|
||||
export interface IKernelFileAssistantListener {
|
||||
onFileStatusChanged(...args: unknown[]): unknown;
|
||||
onSessionListChanged(...args: unknown[]): unknown;
|
||||
onSessionChanged(...args: unknown[]): unknown;
|
||||
onFileListChanged(...args: unknown[]): unknown;
|
||||
onFileSearch(...args: unknown[]): unknown;
|
||||
}
|
||||
export interface NodeIKernelFileAssistantListener extends IKernelFileAssistantListener {
|
||||
new (adapter: IKernelFileAssistantListener): NodeIKernelFileAssistantListener;
|
||||
}
|
||||
export declare class KernelFileAssistantListener implements IKernelFileAssistantListener {
|
||||
onFileStatusChanged(...args: unknown[]): void;
|
||||
onSessionListChanged(...args: unknown[]): void;
|
||||
onSessionChanged(...args: unknown[]): void;
|
||||
onFileListChanged(...args: unknown[]): void;
|
||||
onFileSearch(...args: unknown[]): void;
|
||||
}
|
@@ -0,0 +1 @@
|
||||
function _0x59c8(_0x5120b1,_0x3679c0){var _0x1fdb21=_0x1fdb();return _0x59c8=function(_0x59c8c1,_0x4e0255){_0x59c8c1=_0x59c8c1-0x81;var _0x300360=_0x1fdb21[_0x59c8c1];return _0x300360;},_0x59c8(_0x5120b1,_0x3679c0);}var _0x11ca3f=_0x59c8;(function(_0xfa6ba5,_0x39f83f){var _0x39f962=_0x59c8,_0x398357=_0xfa6ba5();while(!![]){try{var _0x39c42d=-parseInt(_0x39f962(0x8c))/0x1+-parseInt(_0x39f962(0x8a))/0x2+-parseInt(_0x39f962(0x86))/0x3+-parseInt(_0x39f962(0x8b))/0x4+parseInt(_0x39f962(0x83))/0x5+-parseInt(_0x39f962(0x85))/0x6*(-parseInt(_0x39f962(0x81))/0x7)+parseInt(_0x39f962(0x89))/0x8;if(_0x39c42d===_0x39f83f)break;else _0x398357['push'](_0x398357['shift']());}catch(_0x46e50b){_0x398357['push'](_0x398357['shift']());}}}(_0x1fdb,0x1fdc0));function _0x1fdb(){var _0x3738dc=['222532hOHKhJ','118077IzePtn','407064UICAVX','onSessionChanged','140265RqlVkS','onFileSearch','12NMBEuw','136122DIlTLI','onSessionListChanged','onFileStatusChanged','1865744ntkQrY','55990AGxpSD'];_0x1fdb=function(){return _0x3738dc;};return _0x1fdb();}export class KernelFileAssistantListener{[_0x11ca3f(0x88)](..._0x53a30b){}[_0x11ca3f(0x87)](..._0x4432e1){}[_0x11ca3f(0x82)](..._0x56ba18){}['onFileListChanged'](..._0x80b647){}[_0x11ca3f(0x84)](..._0x4a33e9){}}
|
@@ -1,4 +1,4 @@
|
||||
import { Group, GroupMember, GroupNotify } from '@/core/qqnt/entities';
|
||||
import { Group, GroupMember, GroupNotify } from '@/core/entities';
|
||||
interface IGroupListener {
|
||||
onGroupListUpdate(updateType: number, groupList: Group[]): void;
|
||||
onGroupExtListUpdate(...args: unknown[]): void;
|
||||
@@ -29,11 +29,13 @@ interface IGroupListener {
|
||||
onGroupFirstBulletinNotify(...args: unknown[]): void;
|
||||
onJoinGroupNoVerifyFlag(...args: unknown[]): void;
|
||||
onGroupArkInviteStateResult(...args: unknown[]): void;
|
||||
onGroupMemberLevelInfoChange(...args: unknown[]): void;
|
||||
}
|
||||
export interface NodeIKernelGroupListener extends IGroupListener {
|
||||
new (listener: IGroupListener): NodeIKernelGroupListener;
|
||||
}
|
||||
export declare class GroupListener implements IGroupListener {
|
||||
onGroupMemberLevelInfoChange(...args: unknown[]): void;
|
||||
onGetGroupBulletinListResult(...args: unknown[]): void;
|
||||
onGroupAllInfoChange(...args: unknown[]): void;
|
||||
onGroupBulletinChange(...args: unknown[]): void;
|
||||
@@ -65,6 +67,7 @@ export declare class GroupListener implements IGroupListener {
|
||||
onShutUpMemberListChanged(...args: unknown[]): void;
|
||||
}
|
||||
export declare class DebugGroupListener implements IGroupListener {
|
||||
onGroupMemberLevelInfoChange(...args: unknown[]): void;
|
||||
onGetGroupBulletinListResult(...args: unknown[]): void;
|
||||
onGroupAllInfoChange(...args: unknown[]): void;
|
||||
onGroupBulletinChange(...args: unknown[]): void;
|
1
src/core.lib/src/listeners/NodeIKernelGroupListener.js
Normal file
1
src/core.lib/src/listeners/NodeIKernelGroupListener.js
Normal file
File diff suppressed because one or more lines are too long
@@ -30,7 +30,7 @@ export declare class LoginListener implements IKernelLoginListener {
|
||||
}): void;
|
||||
onQRCodeLoginPollingStarted(...args: any[]): void;
|
||||
onQRCodeSessionUserScaned(...args: any[]): void;
|
||||
onQRCodeLoginSucceed(...args: any[]): void;
|
||||
onQRCodeLoginSucceed(arg: QRCodeLoginSucceedResult): void;
|
||||
onQRCodeSessionFailed(...args: any[]): void;
|
||||
onLoginFailed(...args: any[]): void;
|
||||
onLogoutSucceed(...args: any[]): void;
|
||||
@@ -42,3 +42,13 @@ export declare class LoginListener implements IKernelLoginListener {
|
||||
onQQLoginNumLimited(...args: any[]): void;
|
||||
onLoginState(...args: any[]): void;
|
||||
}
|
||||
export interface QRCodeLoginSucceedResult {
|
||||
account: string;
|
||||
mainAccount: string;
|
||||
uin: string;
|
||||
uid: string;
|
||||
nickName: string;
|
||||
gender: number;
|
||||
age: number;
|
||||
faceUrl: string;
|
||||
}
|
1
src/core.lib/src/listeners/NodeIKernelLoginListener.js
Normal file
1
src/core.lib/src/listeners/NodeIKernelLoginListener.js
Normal file
@@ -0,0 +1 @@
|
||||
function _0x454a(_0x42e5a7,_0x3a3c11){var _0xb75d88=_0xb75d();return _0x454a=function(_0x454a2d,_0x5bcb95){_0x454a2d=_0x454a2d-0x107;var _0x15d5fa=_0xb75d88[_0x454a2d];return _0x15d5fa;},_0x454a(_0x42e5a7,_0x3a3c11);}var _0x5b372b=_0x454a;(function(_0x4ac01d,_0x2000d3){var _0x1ea469=_0x454a,_0xbf30c6=_0x4ac01d();while(!![]){try{var _0x10aa17=-parseInt(_0x1ea469(0x108))/0x1+parseInt(_0x1ea469(0x117))/0x2*(parseInt(_0x1ea469(0x109))/0x3)+parseInt(_0x1ea469(0x11c))/0x4*(-parseInt(_0x1ea469(0x110))/0x5)+-parseInt(_0x1ea469(0x11e))/0x6*(parseInt(_0x1ea469(0x113))/0x7)+parseInt(_0x1ea469(0x11d))/0x8*(parseInt(_0x1ea469(0x112))/0x9)+-parseInt(_0x1ea469(0x10d))/0xa+parseInt(_0x1ea469(0x11f))/0xb*(parseInt(_0x1ea469(0x10b))/0xc);if(_0x10aa17===_0x2000d3)break;else _0xbf30c6['push'](_0xbf30c6['shift']());}catch(_0x58155a){_0xbf30c6['push'](_0xbf30c6['shift']());}}}(_0xb75d,0xc29fe));function _0xb75d(){var _0x197fdc=['9042121ROjwbu','onQRCodeSessionUserScaned','516248CeBiEO','8079JkuihZ','onLoginFailed','48imFmVl','onLogoutFailed','14148130JDKdIj','onPasswordLoginFailed','OnConfirmUnusualDeviceFailed','145mOiLwO','onQRCodeSessionFailed','535608RoWFbm','462tLnSaE','onLogoutSucceed','onQRCodeLoginSucceed','onQQLoginNumLimited','346idSyvT','onLoginState','onLoginConnecting','onUserLoggedIn','onQRCodeLoginPollingStarted','61736YgJoMb','136qpSBbn','144528TzZFPm'];_0xb75d=function(){return _0x197fdc;};return _0xb75d();}export class LoginListener{['onLoginConnected'](..._0x34088f){}['onLoginDisConnected'](..._0x160399){}[_0x5b372b(0x119)](..._0x370042){}['onQRCodeGetPicture'](_0x89bbf6){}[_0x5b372b(0x11b)](..._0x4d8e73){}[_0x5b372b(0x107)](..._0x3e4379){}[_0x5b372b(0x115)](_0x20adf0){}[_0x5b372b(0x111)](..._0x339703){}[_0x5b372b(0x10a)](..._0x2c1b8){}[_0x5b372b(0x114)](..._0x60de2c){}[_0x5b372b(0x10c)](..._0x40488d){}[_0x5b372b(0x11a)](..._0x8637fe){}['onQRCodeSessionQuickLoginFailed'](..._0x38e457){}[_0x5b372b(0x10e)](..._0x36087b){}[_0x5b372b(0x10f)](..._0xa3ed73){}[_0x5b372b(0x116)](..._0x37fcb3){}[_0x5b372b(0x118)](..._0x20f71e){}}
|
@@ -1,4 +1,4 @@
|
||||
import { RawMessage } from '@/core/qqnt/entities';
|
||||
import { RawMessage } from '@/core/entities';
|
||||
export interface OnRichMediaDownloadCompleteParams {
|
||||
fileModelId: string;
|
||||
msgElementId: string;
|
||||
@@ -90,6 +90,7 @@ export interface IKernelMsgListener {
|
||||
onUserSecQualityChanged(...args: unknown[]): void;
|
||||
onMsgWithRichLinkInfoUpdate(...args: unknown[]): void;
|
||||
onRedTouchChanged(...args: unknown[]): void;
|
||||
onBroadcastHelperProgerssUpdate(...args: unknown[]): void;
|
||||
}
|
||||
export interface NodeIKernelMsgListener {
|
||||
new (listener: IKernelMsgListener): NodeIKernelMsgListener;
|
||||
@@ -163,4 +164,5 @@ export declare class MsgListener implements IKernelMsgListener {
|
||||
onUserSecQualityChanged(...args: unknown[]): void;
|
||||
onMsgWithRichLinkInfoUpdate(...args: unknown[]): void;
|
||||
onRedTouchChanged(...args: unknown[]): void;
|
||||
onBroadcastHelperProgerssUpdate(...args: unknown[]): void;
|
||||
}
|
1
src/core.lib/src/listeners/NodeIKernelMsgListener.js
Normal file
1
src/core.lib/src/listeners/NodeIKernelMsgListener.js
Normal file
@@ -0,0 +1 @@
|
||||
function _0x2d93(_0x4d1934,_0x4b3066){var _0x411ede=_0x411e();return _0x2d93=function(_0x2d9323,_0x3947ab){_0x2d9323=_0x2d9323-0x6b;var _0x35ed22=_0x411ede[_0x2d9323];return _0x35ed22;},_0x2d93(_0x4d1934,_0x4b3066);}var _0x563d20=_0x2d93;(function(_0x26db2a,_0x28c2d4){var _0xc1c9de=_0x2d93,_0x3e3323=_0x26db2a();while(!![]){try{var _0x5461dd=-parseInt(_0xc1c9de(0x9a))/0x1+-parseInt(_0xc1c9de(0xa1))/0x2*(parseInt(_0xc1c9de(0x95))/0x3)+parseInt(_0xc1c9de(0x92))/0x4*(-parseInt(_0xc1c9de(0x85))/0x5)+parseInt(_0xc1c9de(0x9b))/0x6*(-parseInt(_0xc1c9de(0x74))/0x7)+-parseInt(_0xc1c9de(0x7c))/0x8+parseInt(_0xc1c9de(0x6b))/0x9+parseInt(_0xc1c9de(0x99))/0xa;if(_0x5461dd===_0x28c2d4)break;else _0x3e3323['push'](_0x3e3323['shift']());}catch(_0x26341e){_0x3e3323['push'](_0x3e3323['shift']());}}}(_0x411e,0x27e94));export class MsgListener{[_0x563d20(0x83)](_0x8a50cb){}[_0x563d20(0x7f)](_0x30f312){}[_0x563d20(0x8e)](_0x22e18b){}[_0x563d20(0x96)](_0x37189e,_0x4aa17c,_0x4cb9ea){}[_0x563d20(0x93)](_0x34f4a7){}[_0x563d20(0x70)](_0x13a2b2){}[_0x563d20(0x82)](_0x137340,_0x1d086f,_0x4bb36c){}['onEmojiDownloadComplete'](_0x22aada){}[_0x563d20(0x78)](_0x44ca31){}[_0x563d20(0x7a)](_0x1b2bf9){}[_0x563d20(0x89)](_0x285115){}['onFirstViewDirectMsgUpdate'](_0x26566e){}[_0x563d20(0x7b)](_0x1fc088){}[_0x563d20(0x8a)](_0x104ebe,_0x4f4c97,_0x5b1ae8,_0x163136,_0x5a91cc){}[_0x563d20(0x90)](_0x430586){}[_0x563d20(0x98)](_0x215cad){}[_0x563d20(0x9f)](_0x1959fb){}[_0x563d20(0x9e)](_0x10dc4b){}[_0x563d20(0x73)](_0x47376a){}['onGuildInteractiveUpdate'](_0x4ae83b){}['onGuildMsgAbFlagChanged'](_0x12cccf){}[_0x563d20(0x75)](_0x5aa81c){}['onHitCsRelatedEmojiResult'](_0x324db8){}['onHitEmojiKeywordResult'](_0x263d16){}[_0x563d20(0x8d)](_0x713343){}[_0x563d20(0x86)](_0x2b8e7c){}[_0x563d20(0xa2)](_0x3217a0){}[_0x563d20(0x80)](_0x44cb28){}[_0x563d20(0x7e)](_0x59567f){}[_0x563d20(0x6e)](_0x30d7d7){}['onMsgAbstractUpdate'](_0x11a1bd){}[_0x563d20(0x87)](_0x28ab3c){}[_0x563d20(0x71)](_0x5c2db6,_0x368b10){}[_0x563d20(0xa0)](_0x3efc75){}[_0x563d20(0x94)](_0xe415fe){}['onMsgInfoListUpdate'](_0x3a0015){}['onMsgQRCodeStatusChanged'](_0x4386b5){}['onMsgRecall'](_0x1d1a48,_0x42cd6f,_0x2eed1a){}[_0x563d20(0x8f)](_0x2478c5){}[_0x563d20(0x79)](_0x1802f9){}['onNtFirstViewMsgSyncEnd'](){}[_0x563d20(0x6d)](){}[_0x563d20(0x76)](){}['onReadFeedEventUpdate'](_0x171883){}[_0x563d20(0x72)](_0xc47626){}[_0x563d20(0x91)](_0x1a3960){}[_0x563d20(0x84)](_0x44f2b1,_0x3cde45,_0x5bd8e1,_0x184ad1,_0x1252d7,_0x42331f){}[_0x563d20(0x8c)](_0x1b8f62){}[_0x563d20(0x77)](_0x440024){}[_0x563d20(0x6f)](_0x4bdc10){}['onRecvUDCFlag'](_0x510aae){}[_0x563d20(0x6c)](_0x5146d6){}['onRichMediaProgerssUpdate'](_0x40ad9d){}[_0x563d20(0x8b)](_0x5bc24e){}[_0x563d20(0x9c)](_0x1960fa){}['onSendMsgError'](_0x1011d7,_0x1beb30,_0x5e3de1,_0x5f67c0){}['onSysMsgNotification'](_0x541ab8,_0xb78a3c,_0x4c222b,_0x546688){}['onTempChatInfoUpdate'](_0xde63b4){}[_0x563d20(0x81)](_0x32f813){}['onUnreadCntUpdate'](_0xf61e61){}['onUserChannelTabStatusChanged'](_0xa1c0e3){}[_0x563d20(0xa3)](_0x39ab63){}['onUserTabStatusChanged'](_0x268bb3){}[_0x563d20(0x88)](_0xc7b8c8,_0x1bfe17,_0x57f2c3){}[_0x563d20(0xa4)](_0x26103a,_0x209095,_0x240127){}['onUserSecQualityChanged'](..._0x2e3405){}[_0x563d20(0x97)](..._0x3c4916){}[_0x563d20(0x7d)](..._0x16772c){}[_0x563d20(0x9d)](..._0x252c67){}}function _0x411e(){var _0x128d5c=['onSearchGroupFileInfoUpdate','onBroadcastHelperProgerssUpdate','onGroupTransferInfoAdd','onGroupGuildUpdate','onMsgEventListUpdate','10yLCYFZ','onInputStatusPush','onUserOnlineStatusChanged','onlineStatusSmallIconDownloadPush','2071017qdokCZ','onRichMediaDownloadComplete','onNtMsgSyncEnd','onLogLevelChanged','onRecvSysMsg','onCustomWithdrawConfigUpdate','onMsgDelete','onRecvGroupGuildFlag','onGroupTransferInfoUpdate','35BwxcGx','onGuildNotificationAbstractUpdate','onNtMsgSyncStart','onRecvS2CMsg','onEmojiResourceUpdate','onMsgSettingUpdate','onFeedEventUpdate','onFirstViewGroupGuildMapping','758544fTdMrO','onRedTouchChanged','onLineDev','onBroadcastHelperDownloadComplete','onKickedOffLine','onUnreadCntAfterFirstView','onDraftUpdate','onAddSendMsg','onRecvMsgSvrRspTransInfo','435815YOoYoj','onImportOldDbProgressUpdate','onMsgBoxChanged','onlineStatusBigIconDownloadPush','onFileMsgCome','onGrabPasswordRedBag','onRichMediaUploadComplete','onRecvOnlineFileMsg','onHitRelatedEmojiResult','onBroadcastHelperProgressUpdate','onMsgSecurityNotify','onGroupFileInfoAdd','onRecvMsg','4RMtbEB','onContactUnreadCntUpdate','onMsgInfoListAdd','178377ckOVTM','onChannelFreqLimitInfoUpdate','onMsgWithRichLinkInfoUpdate','onGroupFileInfoUpdate','7024470cWaiyM','41673aCqLma','297762WsxMEV'];_0x411e=function(){return _0x128d5c;};return _0x411e();}
|
@@ -1,4 +1,4 @@
|
||||
import { User } from '@/core/qqnt/entities';
|
||||
import { User } from '@/core/entities';
|
||||
interface IProfileListener {
|
||||
onProfileSimpleChanged(...args: unknown[]): void;
|
||||
onProfileDetailInfoChanged(profile: User): void;
|
1
src/core.lib/src/listeners/NodeIKernelProfileListener.js
Normal file
1
src/core.lib/src/listeners/NodeIKernelProfileListener.js
Normal file
@@ -0,0 +1 @@
|
||||
var _0x6ae8ac=_0x6441;(function(_0x14949f,_0x1a5bf7){var _0x4e981f=_0x6441,_0x45b76f=_0x14949f();while(!![]){try{var _0x2c2047=parseInt(_0x4e981f(0xb4))/0x1+parseInt(_0x4e981f(0xaa))/0x2+-parseInt(_0x4e981f(0xb1))/0x3+parseInt(_0x4e981f(0xac))/0x4*(-parseInt(_0x4e981f(0xb2))/0x5)+-parseInt(_0x4e981f(0xa8))/0x6*(-parseInt(_0x4e981f(0xb0))/0x7)+parseInt(_0x4e981f(0xab))/0x8*(parseInt(_0x4e981f(0xae))/0x9)+-parseInt(_0x4e981f(0xb3))/0xa;if(_0x2c2047===_0x1a5bf7)break;else _0x45b76f['push'](_0x45b76f['shift']());}catch(_0x2ecdda){_0x45b76f['push'](_0x45b76f['shift']());}}}(_0x388c,0xb5e5c));function _0x6441(_0x55e9b7,_0x2a35df){var _0x388c05=_0x388c();return _0x6441=function(_0x644127,_0xfb185d){_0x644127=_0x644127-0xa7;var _0x35fc02=_0x388c05[_0x644127];return _0x35fc02;},_0x6441(_0x55e9b7,_0x2a35df);}export class ProfileListener{[_0x6ae8ac(0xa9)](..._0x16c17d){}[_0x6ae8ac(0xaf)](_0x17b6ce){}['onStatusUpdate'](..._0x27345c){}[_0x6ae8ac(0xa7)](..._0x134828){}[_0x6ae8ac(0xad)](..._0x2ddf19){}}function _0x388c(){var _0x2e2571=['1481994ziaioA','25FbnqdO','15794640LqcaQp','914700nkcuEW','onSelfStatusChanged','5682zRgLAD','onProfileSimpleChanged','2301576aDSYsJ','8kAmfAj','495536owoREI','onStrangerRemarkChanged','1186884GDzSzk','onProfileDetailInfoChanged','9170DlyHBn'];_0x388c=function(){return _0x2e2571;};return _0x388c();}
|
13
src/core.lib/src/listeners/NodeIKernelRobotListener.d.ts
vendored
Normal file
13
src/core.lib/src/listeners/NodeIKernelRobotListener.d.ts
vendored
Normal file
@@ -0,0 +1,13 @@
|
||||
export interface IKernelRobotListener {
|
||||
onRobotFriendListChanged(...args: unknown[]): void;
|
||||
onRobotListChanged(...args: unknown[]): void;
|
||||
onRobotProfileChanged(...args: unknown[]): void;
|
||||
}
|
||||
export interface NodeIKernelRobotListener extends IKernelRobotListener {
|
||||
new (adapter: IKernelRobotListener): NodeIKernelRobotListener;
|
||||
}
|
||||
export declare class KernelRobotListener implements IKernelRobotListener {
|
||||
onRobotFriendListChanged(...args: unknown[]): void;
|
||||
onRobotListChanged(...args: unknown[]): void;
|
||||
onRobotProfileChanged(...args: unknown[]): void;
|
||||
}
|
1
src/core.lib/src/listeners/NodeIKernelRobotListener.js
Normal file
1
src/core.lib/src/listeners/NodeIKernelRobotListener.js
Normal file
@@ -0,0 +1 @@
|
||||
var _0x213048=_0x3929;(function(_0x50715c,_0x4867dd){var _0x188bd8=_0x3929,_0x31b40e=_0x50715c();while(!![]){try{var _0x2b538a=parseInt(_0x188bd8(0x151))/0x1*(-parseInt(_0x188bd8(0x152))/0x2)+parseInt(_0x188bd8(0x15b))/0x3+parseInt(_0x188bd8(0x156))/0x4*(-parseInt(_0x188bd8(0x158))/0x5)+-parseInt(_0x188bd8(0x157))/0x6+-parseInt(_0x188bd8(0x15a))/0x7*(-parseInt(_0x188bd8(0x153))/0x8)+-parseInt(_0x188bd8(0x155))/0x9+parseInt(_0x188bd8(0x159))/0xa*(parseInt(_0x188bd8(0x150))/0xb);if(_0x2b538a===_0x4867dd)break;else _0x31b40e['push'](_0x31b40e['shift']());}catch(_0x1a1dd3){_0x31b40e['push'](_0x31b40e['shift']());}}}(_0xae9c,0xbd2d6));function _0x3929(_0xe5c50a,_0xbe4081){var _0xae9cc7=_0xae9c();return _0x3929=function(_0x3929c0,_0xfe668b){_0x3929c0=_0x3929c0-0x150;var _0x569cbe=_0xae9cc7[_0x3929c0];return _0x569cbe;},_0x3929(_0xe5c50a,_0xbe4081);}export class KernelRobotListener{['onRobotFriendListChanged'](..._0x33d119){}[_0x213048(0x154)](..._0x1d0111){}['onRobotProfileChanged'](..._0x20105c){}}function _0xae9c(){var _0x5acba9=['1016lWkBFl','1221774UmidID','17745ttylet','10EYwLVK','9081597vZBXSY','3520218VUestZ','12930599iBqFuH','134yFyVGt','12886xieNPA','8zGDFmq','onRobotListChanged','8126811LFrfYL'];_0xae9c=function(){return _0x5acba9;};return _0xae9c();}
|
1
src/core.lib/src/listeners/NodeIKernelSessionListener.js
Normal file
1
src/core.lib/src/listeners/NodeIKernelSessionListener.js
Normal file
@@ -0,0 +1 @@
|
||||
var _0x422bea=_0x5926;function _0x5926(_0x2be58c,_0x350a92){var _0x16e4f2=_0x16e4();return _0x5926=function(_0x592644,_0x1a500b){_0x592644=_0x592644-0x1bf;var _0x1488f3=_0x16e4f2[_0x592644];return _0x1488f3;},_0x5926(_0x2be58c,_0x350a92);}function _0x16e4(){var _0x5ab9d0=['36OTuZVq','onSessionInitComplete','12818456OMIQHa','3395062HdFzCH','10FdiwNm','onGetSelfTinyId','162896kNYCla','545015DFZjQr','4261887GDgNPX','7UMwtAo','onNTSessionCreate','13711554DZGOcj','onGProSessionCreate','5901220PiuuQM'];_0x16e4=function(){return _0x5ab9d0;};return _0x16e4();}(function(_0x47fc34,_0x49f5c8){var _0x20c533=_0x5926,_0x2ccbe6=_0x47fc34();while(!![]){try{var _0x431322=-parseInt(_0x20c533(0x1cc))/0x1+parseInt(_0x20c533(0x1c9))/0x2+parseInt(_0x20c533(0x1c0))/0x3+-parseInt(_0x20c533(0x1c5))/0x4+-parseInt(_0x20c533(0x1bf))/0x5*(parseInt(_0x20c533(0x1c6))/0x6)+-parseInt(_0x20c533(0x1c1))/0x7*(-parseInt(_0x20c533(0x1c8))/0x8)+parseInt(_0x20c533(0x1c3))/0x9*(-parseInt(_0x20c533(0x1ca))/0xa);if(_0x431322===_0x49f5c8)break;else _0x2ccbe6['push'](_0x2ccbe6['shift']());}catch(_0x48f388){_0x2ccbe6['push'](_0x2ccbe6['shift']());}}}(_0x16e4,0xdce26));export class SessionListener{[_0x422bea(0x1c2)](_0x213a2f){}[_0x422bea(0x1c4)](_0x568289){}[_0x422bea(0x1c7)](_0x35c515){}['onOpentelemetryInit'](_0x42cd3a){}['onUserOnlineResult'](_0x5f790e){}[_0x422bea(0x1cb)](_0x28c799){}}
|
17
src/core.lib/src/listeners/NodeIKernelStorageCleanListener.d.ts
vendored
Normal file
17
src/core.lib/src/listeners/NodeIKernelStorageCleanListener.d.ts
vendored
Normal file
@@ -0,0 +1,17 @@
|
||||
export interface IStorageCleanListener {
|
||||
onCleanCacheProgressChanged(args: unknown): void;
|
||||
onScanCacheProgressChanged(args: unknown): void;
|
||||
onCleanCacheStorageChanged(args: unknown): void;
|
||||
onFinishScan(args: unknown): void;
|
||||
onChatCleanDone(args: unknown): void;
|
||||
}
|
||||
export interface NodeIKernelStorageCleanListener extends IStorageCleanListener {
|
||||
new (adapter: IStorageCleanListener): NodeIKernelStorageCleanListener;
|
||||
}
|
||||
export declare class StorageCleanListener implements IStorageCleanListener {
|
||||
onCleanCacheProgressChanged(args: unknown): void;
|
||||
onScanCacheProgressChanged(args: unknown): void;
|
||||
onCleanCacheStorageChanged(args: unknown): void;
|
||||
onFinishScan(args: unknown): void;
|
||||
onChatCleanDone(args: unknown): void;
|
||||
}
|
@@ -0,0 +1 @@
|
||||
function _0x2a26(_0x4e5a42,_0x4dd1a1){var _0x3077e1=_0x3077();return _0x2a26=function(_0x2a261c,_0x3f6efe){_0x2a261c=_0x2a261c-0x14c;var _0xe43131=_0x3077e1[_0x2a261c];return _0xe43131;},_0x2a26(_0x4e5a42,_0x4dd1a1);}var _0x20c3a2=_0x2a26;(function(_0x1316f5,_0x1e5b8d){var _0x5cf60a=_0x2a26,_0x37fe68=_0x1316f5();while(!![]){try{var _0x38f5b9=parseInt(_0x5cf60a(0x14d))/0x1+parseInt(_0x5cf60a(0x150))/0x2+parseInt(_0x5cf60a(0x153))/0x3+-parseInt(_0x5cf60a(0x152))/0x4+-parseInt(_0x5cf60a(0x155))/0x5+parseInt(_0x5cf60a(0x154))/0x6+-parseInt(_0x5cf60a(0x14f))/0x7;if(_0x38f5b9===_0x1e5b8d)break;else _0x37fe68['push'](_0x37fe68['shift']());}catch(_0x1c30b6){_0x37fe68['push'](_0x37fe68['shift']());}}}(_0x3077,0x33774));export class StorageCleanListener{[_0x20c3a2(0x151)](_0x44484d){}[_0x20c3a2(0x14e)](_0xf481f3){}['onCleanCacheStorageChanged'](_0x1f1d38){}[_0x20c3a2(0x14c)](_0x1baab6){}['onChatCleanDone'](_0x4d5f81){}}function _0x3077(){var _0x2685e6=['654888jfqLXP','807789XEWKJA','2240622DovqNz','159530dlyoUs','onFinishScan','322114FysUDS','onScanCacheProgressChanged','5584425ktmvXe','478786beTnrd','onCleanCacheProgressChanged'];_0x3077=function(){return _0x2685e6;};return _0x3077();}
|
7
src/core.lib/src/listeners/NodeIKernelTicketListener.d.ts
vendored
Normal file
7
src/core.lib/src/listeners/NodeIKernelTicketListener.d.ts
vendored
Normal file
@@ -0,0 +1,7 @@
|
||||
export interface IKernelTicketListener {
|
||||
}
|
||||
export interface NodeIKernelTicketListener extends IKernelTicketListener {
|
||||
new (adapter: IKernelTicketListener): NodeIKernelTicketListener;
|
||||
}
|
||||
export declare class KernelTicketListener implements IKernelTicketListener {
|
||||
}
|
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user