mirror of
https://github.com/NapNeko/NapCatQQ.git
synced 2024-11-21 09:36:35 +00:00
NapCatQQ
This commit is contained in:
parent
b2061347a5
commit
14e6c6d9a6
21
.editorconfig
Normal file
21
.editorconfig
Normal file
@ -0,0 +1,21 @@
|
|||||||
|
# EditorConfig is awesome: https://EditorConfig.org
|
||||||
|
|
||||||
|
# top-most EditorConfig file
|
||||||
|
root = true
|
||||||
|
|
||||||
|
# Unix-style newlines with a newline ending every file
|
||||||
|
[*]
|
||||||
|
end_of_line = lf
|
||||||
|
insert_final_newline = true
|
||||||
|
|
||||||
|
# Matches multiple files with brace expansion notation
|
||||||
|
# Set default charset
|
||||||
|
charset = utf-8
|
||||||
|
|
||||||
|
# 2 space indentation
|
||||||
|
[*.{cjs,mjs,js,jsx,ts,tsx,css,scss,sass,html,json}]
|
||||||
|
indent_style = space
|
||||||
|
indent_size = 2
|
||||||
|
|
||||||
|
# Unfortunately, EditorConfig doesn't support space configuration inside import braces directly.
|
||||||
|
# You'll need to rely on your linter/formatter like ESLint or Prettier for that.
|
1
.env.development
Normal file
1
.env.development
Normal file
@ -0,0 +1 @@
|
|||||||
|
VITE_BUILD_TYPE = Development
|
1
.env.production
Normal file
1
.env.production
Normal file
@ -0,0 +1 @@
|
|||||||
|
VITE_BUILD_TYPE = Production
|
67
.eslintrc.cjs
Normal file
67
.eslintrc.cjs
Normal file
@ -0,0 +1,67 @@
|
|||||||
|
module.exports = {
|
||||||
|
'env': {
|
||||||
|
'es2021': true,
|
||||||
|
'node': true
|
||||||
|
},
|
||||||
|
'ignorePatterns': ['src/core/'],
|
||||||
|
'extends': [
|
||||||
|
'eslint:recommended',
|
||||||
|
'plugin:@typescript-eslint/recommended'
|
||||||
|
],
|
||||||
|
'overrides': [
|
||||||
|
{
|
||||||
|
'env': {
|
||||||
|
'node': true
|
||||||
|
},
|
||||||
|
'files': [
|
||||||
|
'.eslintrc.{js,cjs}'
|
||||||
|
],
|
||||||
|
'parserOptions': {
|
||||||
|
'sourceType': 'script'
|
||||||
|
}
|
||||||
|
}
|
||||||
|
],
|
||||||
|
'parser': '@typescript-eslint/parser',
|
||||||
|
'parserOptions': {
|
||||||
|
'ecmaVersion': 'latest',
|
||||||
|
'sourceType': 'module'
|
||||||
|
},
|
||||||
|
'plugins': [
|
||||||
|
'@typescript-eslint',
|
||||||
|
'import'
|
||||||
|
],
|
||||||
|
'settings': {
|
||||||
|
'import/parsers': {
|
||||||
|
'@typescript-eslint/parser': ['.ts']
|
||||||
|
},
|
||||||
|
'import/resolver': {
|
||||||
|
'typescript': {
|
||||||
|
'alwaysTryTypes': true
|
||||||
|
}
|
||||||
|
}
|
||||||
|
},
|
||||||
|
'rules': {
|
||||||
|
'indent': [
|
||||||
|
'error',
|
||||||
|
2
|
||||||
|
],
|
||||||
|
'linebreak-style': [
|
||||||
|
'error',
|
||||||
|
'unix'
|
||||||
|
],
|
||||||
|
'quotes': [
|
||||||
|
'error',
|
||||||
|
'single'
|
||||||
|
],
|
||||||
|
'semi': [
|
||||||
|
'error',
|
||||||
|
'always'
|
||||||
|
],
|
||||||
|
'no-unused-vars': 'off',
|
||||||
|
'no-async-promise-executor': 'off',
|
||||||
|
'@typescript-eslint/no-explicit-any': 'off',
|
||||||
|
'@typescript-eslint/no-unused-vars': 'off',
|
||||||
|
'@typescript-eslint/no-var-requires': 'off',
|
||||||
|
'object-curly-spacing': ['error', 'always'],
|
||||||
|
}
|
||||||
|
};
|
11
.github/dependabot.yml
vendored
Normal file
11
.github/dependabot.yml
vendored
Normal file
@ -0,0 +1,11 @@
|
|||||||
|
# To get started with Dependabot version updates, you'll need to specify which
|
||||||
|
# package ecosystems to update and where the package manifests are located.
|
||||||
|
# Please see the documentation for all configuration options:
|
||||||
|
# https://docs.github.com/code-security/dependabot/dependabot-version-updates/configuration-options-for-the-dependabot.yml-file
|
||||||
|
|
||||||
|
version: 2
|
||||||
|
updates:
|
||||||
|
- package-ecosystem: "npm" # See documentation for possible values
|
||||||
|
directory: "/" # Location of package manifests
|
||||||
|
schedule:
|
||||||
|
interval: "daily"
|
23
.github/workflows/release.yml
vendored
Normal file
23
.github/workflows/release.yml
vendored
Normal file
@ -0,0 +1,23 @@
|
|||||||
|
name: "publish"
|
||||||
|
on:
|
||||||
|
push:
|
||||||
|
tags:
|
||||||
|
- "v*"
|
||||||
|
|
||||||
|
jobs:
|
||||||
|
build-and-publish:
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
steps:
|
||||||
|
- name: checkout
|
||||||
|
uses: actions/checkout@v3
|
||||||
|
|
||||||
|
- name: setup node
|
||||||
|
uses: actions/setup-node@v2
|
||||||
|
with:
|
||||||
|
node-version: 18
|
||||||
|
|
||||||
|
- name: install dependenies
|
||||||
|
run: export ELECTRON_SKIP_BINARY_DOWNLOAD=1 && npm install
|
||||||
|
|
||||||
|
- name: build
|
||||||
|
run: npm run build:prod
|
16
.gitignore
vendored
Normal file
16
.gitignore
vendored
Normal file
@ -0,0 +1,16 @@
|
|||||||
|
# Logs
|
||||||
|
|
||||||
|
# Develop
|
||||||
|
node_modules/
|
||||||
|
package-lock.json
|
||||||
|
out/
|
||||||
|
dist/
|
||||||
|
src/core.lib/common/
|
||||||
|
|
||||||
|
# Editor
|
||||||
|
.vscode/*
|
||||||
|
!.vscode/extensions.json
|
||||||
|
.idea/*
|
||||||
|
|
||||||
|
# Build
|
||||||
|
*.db
|
4
.gitmodules
vendored
Normal file
4
.gitmodules
vendored
Normal file
@ -0,0 +1,4 @@
|
|||||||
|
[submodule "src/core"]
|
||||||
|
path = src/core
|
||||||
|
url = https://github.com/NapNeko/core.git
|
||||||
|
branch = master
|
140
README.md
140
README.md
@ -4,14 +4,144 @@
|
|||||||
|
|
||||||
## 项目介绍
|
## 项目介绍
|
||||||
|
|
||||||
NapCatQQ(瞌睡猫QQ,不准叫我NCQQ!),像睡着了一样在后台低占用运行的无头NTQQ
|
NapCatQQ(瞌睡猫QQ,不准叫我NCQQ!),像睡着了一样在后台低占用运行的无头(没有界面)的NTQQ
|
||||||
|
|
||||||
NapCat 是基于 官方NTQQ 实现的Bot框架
|
目前测试在 Windows 上表现优秀,最低可达只占用内存 **20M**左右
|
||||||
|
|
||||||
## 测试版本
|
由于 Linux 上的 QQ 图形依赖较多,会导致内存占用小高,大约 **100+M**,目前正在研究如何优化
|
||||||
前往 Action 下载最新测试版
|
|
||||||
|
|
||||||
[跳转链接](https://github.com/NapNeko/NapCat.Build/actions)
|
|
||||||
|
## 启动
|
||||||
|
|
||||||
|
NapCat 是基于 官方NTQQ 实现的Bot框架,因此先需要安装官方QQ
|
||||||
|
|
||||||
|
*如果没有安装 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`
|
||||||
|
|
||||||
|
### Linux 启动
|
||||||
|
|
||||||
|
运行`napcat.sh`
|
||||||
|
|
||||||
|
## 使用无需扫码快速登录
|
||||||
|
|
||||||
|
前提是你已经成功登录过QQ,可以加参数` -q <你的QQ>` 进行登录,如`napcat.sh -q 1234567`
|
||||||
|
|
||||||
|
## 安装
|
||||||
|
|
||||||
|
### Linux安装
|
||||||
|
|
||||||
|
#### 安装 Linux QQ(22741),已经安装了的可以跳过
|
||||||
|
|
||||||
|
目前还在研究怎么精简安装,暂时只能安装官方QQ整体依赖
|
||||||
|
|
||||||
|
```bash
|
||||||
|
下载QQ的deb包
|
||||||
|
|
||||||
|
[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
|
||||||
|
|
||||||
|
```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 本身的问题,不影响使用
|
||||||
|
|
||||||
|
|
||||||
|
<!--
|
||||||
|
QQ群:545402644
|
||||||
|
-->
|
||||||
|
|
||||||
## 声明
|
## 声明
|
||||||
|
|
||||||
|
15
script/debug-gc.ps1
Normal file
15
script/debug-gc.ps1
Normal file
@ -0,0 +1,15 @@
|
|||||||
|
function Get-QQpath {
|
||||||
|
try {
|
||||||
|
$key = Get-ItemProperty -Path "HKLM:\SOFTWARE\WOW6432Node\Microsoft\Windows\CurrentVersion\Uninstall\QQ"
|
||||||
|
$uninstallString = $key.UninstallString
|
||||||
|
return [System.IO.Path]::GetDirectoryName($uninstallString) + "\QQ.exe"
|
||||||
|
}
|
||||||
|
catch {
|
||||||
|
throw "Error getting UninstallString: $_"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
$params = $args -join " "
|
||||||
|
$QQpath = Get-QQpath
|
||||||
|
$Bootfile = Join-Path (Get-Location) "\dist\inject.cjs"
|
||||||
|
$env:ELECTRON_RUN_AS_NODE = 1
|
||||||
|
Start-Process powershell -ArgumentList "-noexit", "-noprofile", "-command &{& '$QQpath' --expose-gc $Bootfile $params}"
|
17
script/napcat-log.ps1
Normal file
17
script/napcat-log.ps1
Normal file
@ -0,0 +1,17 @@
|
|||||||
|
function Get-QQpath {
|
||||||
|
try {
|
||||||
|
$key = Get-ItemProperty -Path "HKLM:\SOFTWARE\WOW6432Node\Microsoft\Windows\CurrentVersion\Uninstall\QQ"
|
||||||
|
$uninstallString = $key.UninstallString
|
||||||
|
return [System.IO.Path]::GetDirectoryName($uninstallString) + "\QQ.exe"
|
||||||
|
}
|
||||||
|
catch {
|
||||||
|
return "D:\QQ.exe"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
$params = $args -join " "
|
||||||
|
$QQpath = Get-QQpath
|
||||||
|
$Bootfile = Join-Path $PSScriptRoot "napcat.cjs"
|
||||||
|
$env:ELECTRON_RUN_AS_NODE = 1
|
||||||
|
$argumentList = '-noexit', '-noprofile', "-command `"$QQpath`" `"$Bootfile`" $params"
|
||||||
|
Start-Process powershell -ArgumentList $argumentList -RedirectStandardOutput "log.txt" -RedirectStandardError "error.txt"
|
||||||
|
powershell Get-Content -Wait -Encoding UTF8 log.txt
|
22
script/napcat-utf8.bat
Normal file
22
script/napcat-utf8.bat
Normal file
@ -0,0 +1,22 @@
|
|||||||
|
@echo off
|
||||||
|
setlocal enabledelayedexpansion
|
||||||
|
chcp 65001
|
||||||
|
:loop_read
|
||||||
|
for /f "tokens=3" %%a in ('reg query "HKEY_LOCAL_MACHINE\SOFTWARE\WOW6432Node\Microsoft\Windows\CurrentVersion\Uninstall\QQ" /v "UninstallString"') do (
|
||||||
|
set "RetString=%%a"
|
||||||
|
goto :napcat_boot
|
||||||
|
)
|
||||||
|
|
||||||
|
goto :loop_read
|
||||||
|
|
||||||
|
:napcat_boot
|
||||||
|
for %%a in ("!RetString!") do (
|
||||||
|
set "pathWithoutUninstall=%%~dpa"
|
||||||
|
set "fileName=%%~na"
|
||||||
|
set "extension=%%~xa"
|
||||||
|
)
|
||||||
|
|
||||||
|
set "QQPath=!pathWithoutUninstall!QQ.exe"
|
||||||
|
set ELECTRON_RUN_AS_NODE=1
|
||||||
|
echo !QQPath!
|
||||||
|
!QQPath! ./napcat.cjs
|
15
script/napcat-utf8.ps1
Normal file
15
script/napcat-utf8.ps1
Normal file
@ -0,0 +1,15 @@
|
|||||||
|
function Get-QQpath {
|
||||||
|
try {
|
||||||
|
$key = Get-ItemProperty -Path "HKLM:\SOFTWARE\WOW6432Node\Microsoft\Windows\CurrentVersion\Uninstall\QQ"
|
||||||
|
$uninstallString = $key.UninstallString
|
||||||
|
return [System.IO.Path]::GetDirectoryName($uninstallString) + "\QQ.exe"
|
||||||
|
}
|
||||||
|
catch {
|
||||||
|
return "D:\QQ.exe"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
$params = $args -join " "
|
||||||
|
$QQpath = Get-QQpath
|
||||||
|
$Bootfile = Join-Path $PSScriptRoot "napcat.cjs"
|
||||||
|
$env:ELECTRON_RUN_AS_NODE = 1
|
||||||
|
Start-Process powershell -ArgumentList "-noexit", "-noprofile", "-command &{& chcp 65001;& '$QQpath' $Bootfile $params}"
|
22
script/napcat.bat
Normal file
22
script/napcat.bat
Normal file
@ -0,0 +1,22 @@
|
|||||||
|
@echo off
|
||||||
|
setlocal enabledelayedexpansion
|
||||||
|
|
||||||
|
:loop_read
|
||||||
|
for /f "tokens=3" %%a in ('reg query "HKEY_LOCAL_MACHINE\SOFTWARE\WOW6432Node\Microsoft\Windows\CurrentVersion\Uninstall\QQ" /v "UninstallString"') do (
|
||||||
|
set "RetString=%%a"
|
||||||
|
goto :napcat_boot
|
||||||
|
)
|
||||||
|
|
||||||
|
goto :loop_read
|
||||||
|
|
||||||
|
:napcat_boot
|
||||||
|
for %%a in ("!RetString!") do (
|
||||||
|
set "pathWithoutUninstall=%%~dpa"
|
||||||
|
set "fileName=%%~na"
|
||||||
|
set "extension=%%~xa"
|
||||||
|
)
|
||||||
|
|
||||||
|
set "QQPath=!pathWithoutUninstall!QQ.exe"
|
||||||
|
set ELECTRON_RUN_AS_NODE=1
|
||||||
|
echo !QQPath!
|
||||||
|
!QQPath! ./napcat.cjs
|
15
script/napcat.ps1
Normal file
15
script/napcat.ps1
Normal file
@ -0,0 +1,15 @@
|
|||||||
|
function Get-QQpath {
|
||||||
|
try {
|
||||||
|
$key = Get-ItemProperty -Path "HKLM:\SOFTWARE\WOW6432Node\Microsoft\Windows\CurrentVersion\Uninstall\QQ"
|
||||||
|
$uninstallString = $key.UninstallString
|
||||||
|
return [System.IO.Path]::GetDirectoryName($uninstallString) + "\QQ.exe"
|
||||||
|
}
|
||||||
|
catch {
|
||||||
|
return "D:\QQ.exe"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
$params = $args -join " "
|
||||||
|
$QQpath = Get-QQpath
|
||||||
|
$Bootfile = Join-Path $PSScriptRoot "napcat.cjs"
|
||||||
|
$env:ELECTRON_RUN_AS_NODE = 1
|
||||||
|
Start-Process powershell -ArgumentList "-noexit", "-noprofile", "-command &{& '$QQpath' $Bootfile $params}"
|
4
script/napcat.sh
Normal file
4
script/napcat.sh
Normal file
@ -0,0 +1,4 @@
|
|||||||
|
#!/bin/bash
|
||||||
|
SCRIPT_DIR=$(realpath $(dirname "${BASH_SOURCE[0]}"))
|
||||||
|
export ELECTRON_RUN_AS_NODE=1
|
||||||
|
/opt/QQ/qq ${SCRIPT_DIR}/napcat.cjs $@
|
85
src/common/data.ts
Normal file
85
src/common/data.ts
Normal file
@ -0,0 +1,85 @@
|
|||||||
|
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 => 群号
|
||||||
|
|
113
src/common/server/http.ts
Normal file
113
src/common/server/http.ts
Normal file
@ -0,0 +1,113 @@
|
|||||||
|
import express, { Express, Request, Response } from 'express';
|
||||||
|
import http from 'http';
|
||||||
|
import { log } from '../utils/log';
|
||||||
|
import { ob11Config } from '@/onebot11/config';
|
||||||
|
|
||||||
|
type RegisterHandler = (res: Response, payload: any) => Promise<any>
|
||||||
|
|
||||||
|
export abstract class HttpServerBase {
|
||||||
|
name: string = 'LLOneBot';
|
||||||
|
private readonly expressAPP: Express;
|
||||||
|
private server: http.Server | null = null;
|
||||||
|
|
||||||
|
constructor() {
|
||||||
|
this.expressAPP = express();
|
||||||
|
this.expressAPP.use(express.urlencoded({ extended: true, limit: '5000mb' }));
|
||||||
|
this.expressAPP.use((req, res, next) => {
|
||||||
|
// 兼容处理没有带content-type的请求
|
||||||
|
// log("req.headers['content-type']", req.headers['content-type'])
|
||||||
|
req.headers['content-type'] = 'application/json';
|
||||||
|
const originalJson = express.json({ limit: '5000mb' });
|
||||||
|
// 调用原始的express.json()处理器
|
||||||
|
originalJson(req, res, (err) => {
|
||||||
|
if (err) {
|
||||||
|
log('Error parsing JSON:', err);
|
||||||
|
return res.status(400).send('Invalid JSON');
|
||||||
|
}
|
||||||
|
next();
|
||||||
|
});
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
authorize(req: Request, res: Response, next: () => void) {
|
||||||
|
const serverToken = ob11Config.token;
|
||||||
|
let clientToken = '';
|
||||||
|
const authHeader = req.get('authorization');
|
||||||
|
if (authHeader) {
|
||||||
|
clientToken = authHeader.split('Bearer ').pop() || '';
|
||||||
|
log('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);
|
||||||
|
}
|
||||||
|
|
||||||
|
if (serverToken && clientToken != serverToken) {
|
||||||
|
return res.status(403).send(JSON.stringify({ message: 'token verify failed!' }));
|
||||||
|
}
|
||||||
|
next();
|
||||||
|
}
|
||||||
|
|
||||||
|
start(port: number) {
|
||||||
|
try {
|
||||||
|
this.expressAPP.get('/', (req: Request, res: Response) => {
|
||||||
|
res.send(`${this.name}已启动`);
|
||||||
|
});
|
||||||
|
this.listen(port);
|
||||||
|
} catch (e: any) {
|
||||||
|
log('HTTP服务启动失败', e.toString());
|
||||||
|
// llonebotError.httpServerError = "HTTP服务启动失败, " + e.toString()
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
stop() {
|
||||||
|
// llonebotError.httpServerError = ""
|
||||||
|
if (this.server) {
|
||||||
|
this.server.close();
|
||||||
|
this.server = null;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
restart(port: number) {
|
||||||
|
this.stop();
|
||||||
|
this.start(port);
|
||||||
|
}
|
||||||
|
|
||||||
|
abstract handleFailed(res: Response, payload: any, err: any): void
|
||||||
|
|
||||||
|
registerRouter(method: 'post' | 'get' | string, url: string, handler: RegisterHandler) {
|
||||||
|
if (!url.startsWith('/')) {
|
||||||
|
url = '/' + url;
|
||||||
|
}
|
||||||
|
|
||||||
|
// @ts-expect-error wait fix
|
||||||
|
if (!this.expressAPP[method]) {
|
||||||
|
const err = `${this.name} register router failed,${method} not exist`;
|
||||||
|
log(err);
|
||||||
|
throw err;
|
||||||
|
}
|
||||||
|
// @ts-expect-error wait fix
|
||||||
|
this.expressAPP[method](url, this.authorize, async (req: Request, res: Response) => {
|
||||||
|
let payload = req.body;
|
||||||
|
if (method == 'get') {
|
||||||
|
payload = req.query;
|
||||||
|
}
|
||||||
|
log('收到http请求', url, payload);
|
||||||
|
try {
|
||||||
|
res.send(await handler(res, payload));
|
||||||
|
} catch (e: any) {
|
||||||
|
this.handleFailed(res, payload, e.stack.toString());
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
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);
|
||||||
|
});
|
||||||
|
}
|
||||||
|
}
|
99
src/common/server/websocket.ts
Normal file
99
src/common/server/websocket.ts
Normal file
@ -0,0 +1,99 @@
|
|||||||
|
import { WebSocket, WebSocketServer } from 'ws';
|
||||||
|
import urlParse from 'url';
|
||||||
|
import { IncomingMessage } from 'node:http';
|
||||||
|
import { log } from '@/common/utils/log';
|
||||||
|
|
||||||
|
class WebsocketClientBase {
|
||||||
|
private wsClient: WebSocket | undefined;
|
||||||
|
|
||||||
|
constructor() {
|
||||||
|
}
|
||||||
|
|
||||||
|
send(msg: string) {
|
||||||
|
if (this.wsClient && this.wsClient.readyState == WebSocket.OPEN) {
|
||||||
|
this.wsClient.send(msg);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
onMessage(msg: string) {
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
export class WebsocketServerBase {
|
||||||
|
private ws: WebSocketServer | null = null;
|
||||||
|
public token: string = '';
|
||||||
|
|
||||||
|
constructor() {
|
||||||
|
}
|
||||||
|
|
||||||
|
start(port: number) {
|
||||||
|
try {
|
||||||
|
this.ws = new WebSocketServer({ port });
|
||||||
|
} catch (e: any) {
|
||||||
|
throw Error('ws服务启动失败, ' + e.toString());
|
||||||
|
}
|
||||||
|
this.ws.on('connection', (wsClient, req) => {
|
||||||
|
const url: string = req.url!.split('?').shift() || '/';
|
||||||
|
this.authorize(wsClient, req);
|
||||||
|
this.onConnect(wsClient, url, req);
|
||||||
|
wsClient.on('message', async (msg) => {
|
||||||
|
this.onMessage(wsClient, url, msg.toString());
|
||||||
|
});
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
stop() {
|
||||||
|
this.ws && this.ws.close((err) => {
|
||||||
|
log('ws server close failed!', err);
|
||||||
|
});
|
||||||
|
this.ws = null;
|
||||||
|
}
|
||||||
|
|
||||||
|
restart(port: number) {
|
||||||
|
this.stop();
|
||||||
|
this.start(port);
|
||||||
|
}
|
||||||
|
|
||||||
|
authorize(wsClient: WebSocket, req: IncomingMessage) {
|
||||||
|
const url = req.url!.split('?').shift();
|
||||||
|
log('ws connect', url);
|
||||||
|
let clientToken: string = '';
|
||||||
|
const authHeader = req.headers['authorization'];
|
||||||
|
if (authHeader) {
|
||||||
|
clientToken = authHeader.split('Bearer ').pop() || '';
|
||||||
|
log('receive ws header token', clientToken);
|
||||||
|
} else {
|
||||||
|
const parsedUrl = urlParse.parse(req.url || '/', true);
|
||||||
|
const urlToken = parsedUrl.query.access_token;
|
||||||
|
if (urlToken) {
|
||||||
|
if (Array.isArray(urlToken)) {
|
||||||
|
clientToken = urlToken[0];
|
||||||
|
} else {
|
||||||
|
clientToken = urlToken;
|
||||||
|
}
|
||||||
|
log('receive ws url token', clientToken);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if (this.token && clientToken != this.token) {
|
||||||
|
this.authorizeFailed(wsClient);
|
||||||
|
return wsClient.close();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
authorizeFailed(wsClient: WebSocket) {
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
onConnect(wsClient: WebSocket, url: string, req: IncomingMessage) {
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
onMessage(wsClient: WebSocket, url: string, msg: string) {
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
sendHeart() {
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
60
src/common/utils/QQBasicInfo.ts
Normal file
60
src/common/utils/QQBasicInfo.ts
Normal file
@ -0,0 +1,60 @@
|
|||||||
|
import path from 'node:path';
|
||||||
|
import fs from 'node:fs';
|
||||||
|
import os from 'node:os';
|
||||||
|
import { systemPlatform } from '@/common/utils/system';
|
||||||
|
|
||||||
|
export const exePath = process.execPath;
|
||||||
|
|
||||||
|
export const pkgInfoPath = path.join(path.dirname(exePath), 'resources', 'app', 'package.json');
|
||||||
|
let configVersionInfoPath;
|
||||||
|
|
||||||
|
if (os.platform() !== 'linux') {
|
||||||
|
configVersionInfoPath = path.join(path.dirname(exePath), 'resources', 'app', 'versions', 'config.json');
|
||||||
|
} else {
|
||||||
|
const userPath = os.homedir();
|
||||||
|
const appDataPath = path.resolve(userPath, './.config/QQ');
|
||||||
|
configVersionInfoPath = path.resolve(appDataPath, './versions/config.json');
|
||||||
|
}
|
||||||
|
|
||||||
|
if (typeof configVersionInfoPath !== 'string') {
|
||||||
|
throw new Error('Something went wrong when load QQ info path');
|
||||||
|
}
|
||||||
|
|
||||||
|
export { configVersionInfoPath };
|
||||||
|
|
||||||
|
type QQPkgInfo = {
|
||||||
|
version: string;
|
||||||
|
buildVersion: string;
|
||||||
|
platform: string;
|
||||||
|
eleArch: string;
|
||||||
|
}
|
||||||
|
type QQVersionConfigInfo = {
|
||||||
|
baseVersion: string;
|
||||||
|
curVersion: string;
|
||||||
|
prevVersion: string;
|
||||||
|
onErrorVersions: Array<any>;
|
||||||
|
buildId: string;
|
||||||
|
}
|
||||||
|
|
||||||
|
let _qqVersionConfigInfo: QQVersionConfigInfo = {
|
||||||
|
'baseVersion': '9.9.9-22578',
|
||||||
|
'curVersion': '9.9.9-22578',
|
||||||
|
'prevVersion': '',
|
||||||
|
'onErrorVersions': [],
|
||||||
|
'buildId': '22578'
|
||||||
|
};
|
||||||
|
|
||||||
|
if (fs.existsSync(configVersionInfoPath)) {
|
||||||
|
_qqVersionConfigInfo = JSON.parse(fs.readFileSync(configVersionInfoPath).toString());
|
||||||
|
}
|
||||||
|
|
||||||
|
export const qqVersionConfigInfo: QQVersionConfigInfo = _qqVersionConfigInfo;
|
||||||
|
|
||||||
|
export const qqPkgInfo: QQPkgInfo = require(pkgInfoPath);
|
||||||
|
|
||||||
|
let _appid: string = '537213335'; // 默认为 Windows 平台的 appid
|
||||||
|
if (systemPlatform === 'linux') {
|
||||||
|
_appid = '537213710';
|
||||||
|
}
|
||||||
|
// todo: mac 平台的 appid
|
||||||
|
export const appid = _appid;
|
135
src/common/utils/audio.ts
Normal file
135
src/common/utils/audio.ts
Normal file
@ -0,0 +1,135 @@
|
|||||||
|
import fs from 'fs';
|
||||||
|
import { encode, getDuration, getWavFileInfo, isWav } from 'silk-wasm';
|
||||||
|
import fsPromise from 'fs/promises';
|
||||||
|
import { log } from './log';
|
||||||
|
import path from 'node:path';
|
||||||
|
import { v4 as uuidv4 } from 'uuid';
|
||||||
|
import { spawn } from 'node:child_process';
|
||||||
|
import { getTempDir } from '@/common/utils/file';
|
||||||
|
|
||||||
|
let TEMP_DIR = './';
|
||||||
|
setTimeout(() => {
|
||||||
|
TEMP_DIR = getTempDir();
|
||||||
|
}, 100);
|
||||||
|
export async function encodeSilk(filePath: string) {
|
||||||
|
function getFileHeader(filePath: string) {
|
||||||
|
// 定义要读取的字节数
|
||||||
|
const bytesToRead = 7;
|
||||||
|
try {
|
||||||
|
const buffer = fs.readFileSync(filePath, {
|
||||||
|
encoding: null,
|
||||||
|
flag: 'r',
|
||||||
|
});
|
||||||
|
|
||||||
|
const fileHeader = buffer.toString('hex', 0, bytesToRead);
|
||||||
|
return fileHeader;
|
||||||
|
} catch (err) {
|
||||||
|
console.error('读取文件错误:', err);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
async function isWavFile(filePath: string) {
|
||||||
|
return isWav(fs.readFileSync(filePath));
|
||||||
|
}
|
||||||
|
|
||||||
|
async function guessDuration(pttPath: string) {
|
||||||
|
const pttFileInfo = await fsPromise.stat(pttPath);
|
||||||
|
let duration = pttFileInfo.size / 1024 / 3; // 3kb/s
|
||||||
|
duration = Math.floor(duration);
|
||||||
|
duration = Math.max(1, duration);
|
||||||
|
log('通过文件大小估算语音的时长:', duration);
|
||||||
|
return duration;
|
||||||
|
}
|
||||||
|
|
||||||
|
// function verifyDuration(oriDuration: number, guessDuration: number) {
|
||||||
|
// // 单位都是秒
|
||||||
|
// if (oriDuration - guessDuration > 10) {
|
||||||
|
// return guessDuration
|
||||||
|
// }
|
||||||
|
// oriDuration = Math.max(1, oriDuration)
|
||||||
|
// return oriDuration
|
||||||
|
// }
|
||||||
|
// async function getAudioSampleRate(filePath: string) {
|
||||||
|
// try {
|
||||||
|
// const mm = await import('music-metadata');
|
||||||
|
// const metadata = await mm.parseFile(filePath);
|
||||||
|
// log(`${filePath}采样率`, metadata.format.sampleRate);
|
||||||
|
// return metadata.format.sampleRate;
|
||||||
|
// } catch (error) {
|
||||||
|
// log(`${filePath}采样率获取失败`, error.stack);
|
||||||
|
// // console.error(error);
|
||||||
|
// }
|
||||||
|
// }
|
||||||
|
|
||||||
|
try {
|
||||||
|
const pttPath = path.join(TEMP_DIR, uuidv4());
|
||||||
|
if (getFileHeader(filePath) !== '02232153494c4b') {
|
||||||
|
log(`语音文件${filePath}需要转换成silk`);
|
||||||
|
const _isWav = await isWavFile(filePath);
|
||||||
|
const pcmPath = pttPath + '.pcm';
|
||||||
|
let sampleRate = 0;
|
||||||
|
const convert = () => {
|
||||||
|
return new Promise<Buffer>((resolve, reject) => {
|
||||||
|
// todo: 通过配置文件获取ffmpeg路径
|
||||||
|
const ffmpegPath = process.env.FFMPEG_PATH || 'ffmpeg';
|
||||||
|
const cp = spawn(ffmpegPath, ['-y', '-i', filePath, '-ar', '24000', '-ac', '1', '-f', 's16le', pcmPath]);
|
||||||
|
cp.on('error', err => {
|
||||||
|
log('FFmpeg处理转换出错: ', err.message);
|
||||||
|
return reject(err);
|
||||||
|
});
|
||||||
|
cp.on('exit', (code, signal) => {
|
||||||
|
const EXIT_CODES = [0, 255];
|
||||||
|
if (code == null || EXIT_CODES.includes(code)) {
|
||||||
|
sampleRate = 24000;
|
||||||
|
const data = fs.readFileSync(pcmPath);
|
||||||
|
fs.unlink(pcmPath, (err) => {
|
||||||
|
});
|
||||||
|
return resolve(data);
|
||||||
|
}
|
||||||
|
log(`FFmpeg exit: code=${code ?? 'unknown'} sig=${signal ?? 'unknown'}`);
|
||||||
|
reject(Error('FFmpeg处理转换失败'));
|
||||||
|
});
|
||||||
|
});
|
||||||
|
};
|
||||||
|
let input: Buffer;
|
||||||
|
if (!_isWav) {
|
||||||
|
input = await convert();
|
||||||
|
} else {
|
||||||
|
input = fs.readFileSync(filePath);
|
||||||
|
const allowSampleRate = [8000, 12000, 16000, 24000, 32000, 44100, 48000];
|
||||||
|
const { fmt } = getWavFileInfo(input);
|
||||||
|
// log(`wav文件信息`, fmt)
|
||||||
|
if (!allowSampleRate.includes(fmt.sampleRate)) {
|
||||||
|
input = await convert();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
const silk = await encode(input, sampleRate);
|
||||||
|
fs.writeFileSync(pttPath, silk.data);
|
||||||
|
log(`语音文件${filePath}转换成功!`, pttPath, '时长:', silk.duration);
|
||||||
|
return {
|
||||||
|
converted: true,
|
||||||
|
path: pttPath,
|
||||||
|
duration: silk.duration / 1000
|
||||||
|
};
|
||||||
|
} else {
|
||||||
|
const silk = fs.readFileSync(filePath);
|
||||||
|
let duration = 0;
|
||||||
|
try {
|
||||||
|
duration = getDuration(silk) / 1000;
|
||||||
|
} catch (e: any) {
|
||||||
|
log('获取语音文件时长失败, 使用文件大小推测时长', filePath, e.stack);
|
||||||
|
duration = await guessDuration(filePath);
|
||||||
|
}
|
||||||
|
|
||||||
|
return {
|
||||||
|
converted: false,
|
||||||
|
path: filePath,
|
||||||
|
duration,
|
||||||
|
};
|
||||||
|
}
|
||||||
|
} catch (error: any) {
|
||||||
|
log('convert silk failed', error.stack);
|
||||||
|
return {};
|
||||||
|
}
|
||||||
|
}
|
323
src/common/utils/db.ts
Normal file
323
src/common/utils/db.ts
Normal file
@ -0,0 +1,323 @@
|
|||||||
|
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();
|
273
src/common/utils/file.ts
Normal file
273
src/common/utils/file.ts
Normal file
@ -0,0 +1,273 @@
|
|||||||
|
import fs from 'fs';
|
||||||
|
import fsPromise from 'fs/promises';
|
||||||
|
import crypto from 'crypto';
|
||||||
|
import util from 'util';
|
||||||
|
import path from 'node:path';
|
||||||
|
import { log } from './log';
|
||||||
|
import { dbUtil } from './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');
|
||||||
|
fs.mkdirSync(p, { recursive: true });
|
||||||
|
return p;
|
||||||
|
};
|
||||||
|
export const getTempDir = () => {
|
||||||
|
const p = path.join(getNapCatDir(), 'temp');
|
||||||
|
// 创建临时目录
|
||||||
|
if (!fs.existsSync(p)) {
|
||||||
|
fs.mkdirSync(p, { recursive: true });
|
||||||
|
}
|
||||||
|
return p;
|
||||||
|
};
|
||||||
|
|
||||||
|
|
||||||
|
export function isGIF(path: string) {
|
||||||
|
const buffer = Buffer.alloc(4);
|
||||||
|
const fd = fs.openSync(path, 'r');
|
||||||
|
fs.readSync(fd, buffer, 0, 4, 0);
|
||||||
|
fs.closeSync(fd);
|
||||||
|
return buffer.toString() === 'GIF8';
|
||||||
|
}
|
||||||
|
|
||||||
|
// 定义一个异步函数来检查文件是否存在
|
||||||
|
export function checkFileReceived(path: string, timeout: number = 3000): Promise<void> {
|
||||||
|
return new Promise((resolve, reject) => {
|
||||||
|
const startTime = Date.now();
|
||||||
|
|
||||||
|
function check() {
|
||||||
|
if (fs.existsSync(path)) {
|
||||||
|
resolve();
|
||||||
|
} else if (Date.now() - startTime > timeout) {
|
||||||
|
reject(new Error(`文件不存在: ${path}`));
|
||||||
|
} else {
|
||||||
|
setTimeout(check, 100);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
check();
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
export async function file2base64(path: string) {
|
||||||
|
const readFile = util.promisify(fs.readFile);
|
||||||
|
const result = {
|
||||||
|
err: '',
|
||||||
|
data: ''
|
||||||
|
};
|
||||||
|
try {
|
||||||
|
// 读取文件内容
|
||||||
|
// if (!fs.existsSync(path)){
|
||||||
|
// path = path.replace("\\Ori\\", "\\Thumb\\");
|
||||||
|
// }
|
||||||
|
try {
|
||||||
|
await checkFileReceived(path, 5000);
|
||||||
|
} catch (e: any) {
|
||||||
|
result.err = e.toString();
|
||||||
|
return result;
|
||||||
|
}
|
||||||
|
const data = await readFile(path);
|
||||||
|
// 转换为Base64编码
|
||||||
|
result.data = data.toString('base64');
|
||||||
|
} catch (err: any) {
|
||||||
|
result.err = err.toString();
|
||||||
|
}
|
||||||
|
return result;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
export function calculateFileMD5(filePath: string): Promise<string> {
|
||||||
|
return new Promise((resolve, reject) => {
|
||||||
|
// 创建一个流式读取器
|
||||||
|
const stream = fs.createReadStream(filePath);
|
||||||
|
const hash = crypto.createHash('md5');
|
||||||
|
|
||||||
|
stream.on('data', (data: Buffer) => {
|
||||||
|
// 当读取到数据时,更新哈希对象的状态
|
||||||
|
hash.update(data);
|
||||||
|
});
|
||||||
|
|
||||||
|
stream.on('end', () => {
|
||||||
|
// 文件读取完成,计算哈希
|
||||||
|
const md5 = hash.digest('hex');
|
||||||
|
resolve(md5);
|
||||||
|
});
|
||||||
|
|
||||||
|
stream.on('error', (err: Error) => {
|
||||||
|
// 处理可能的读取错误
|
||||||
|
reject(err);
|
||||||
|
});
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
export interface HttpDownloadOptions {
|
||||||
|
url: string;
|
||||||
|
headers?: Record<string, string> | string;
|
||||||
|
}
|
||||||
|
|
||||||
|
export async function httpDownload(options: string | HttpDownloadOptions): Promise<Buffer> {
|
||||||
|
const chunks: Buffer[] = [];
|
||||||
|
let url: string;
|
||||||
|
let headers: Record<string, string> = {
|
||||||
|
'User-Agent': 'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/94.0.4606.71 Safari/537.36'
|
||||||
|
};
|
||||||
|
if (typeof options === 'string') {
|
||||||
|
url = options;
|
||||||
|
} else {
|
||||||
|
url = options.url;
|
||||||
|
if (options.headers) {
|
||||||
|
if (typeof options.headers === 'string') {
|
||||||
|
headers = JSON.parse(options.headers);
|
||||||
|
} else {
|
||||||
|
headers = options.headers;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
const fetchRes = await fetch(url, headers);
|
||||||
|
if (!fetchRes.ok) throw new Error(`下载文件失败: ${fetchRes.statusText}`);
|
||||||
|
|
||||||
|
const blob = await fetchRes.blob();
|
||||||
|
const buffer = await blob.arrayBuffer();
|
||||||
|
return Buffer.from(buffer);
|
||||||
|
}
|
||||||
|
|
||||||
|
type Uri2LocalRes = {
|
||||||
|
success: boolean,
|
||||||
|
errMsg: string,
|
||||||
|
fileName: string,
|
||||||
|
ext: string,
|
||||||
|
path: string,
|
||||||
|
isLocal: boolean
|
||||||
|
}
|
||||||
|
|
||||||
|
export async function uri2local(uri: string, fileName: string | null = null): Promise<Uri2LocalRes> {
|
||||||
|
const res = {
|
||||||
|
success: false,
|
||||||
|
errMsg: '',
|
||||||
|
fileName: '',
|
||||||
|
ext: '',
|
||||||
|
path: '',
|
||||||
|
isLocal: false
|
||||||
|
};
|
||||||
|
if (!fileName) {
|
||||||
|
fileName = uuidv4();
|
||||||
|
}
|
||||||
|
let filePath = path.join(getTempDir(), fileName);
|
||||||
|
let url = null;
|
||||||
|
try {
|
||||||
|
url = new URL(uri);
|
||||||
|
} catch (e: any) {
|
||||||
|
res.errMsg = `uri ${uri} 解析失败,` + e.toString() + ` 可能${uri}不存在`;
|
||||||
|
return res;
|
||||||
|
}
|
||||||
|
|
||||||
|
// log("uri protocol", url.protocol, uri);
|
||||||
|
if (url.protocol == 'base64:') {
|
||||||
|
// base64转成文件
|
||||||
|
const base64Data = uri.split('base64://')[1];
|
||||||
|
try {
|
||||||
|
const buffer = Buffer.from(base64Data, 'base64');
|
||||||
|
fs.writeFileSync(filePath, buffer);
|
||||||
|
|
||||||
|
} catch (e: any) {
|
||||||
|
res.errMsg = 'base64文件下载失败,' + e.toString();
|
||||||
|
return res;
|
||||||
|
}
|
||||||
|
} else if (url.protocol == 'http:' || url.protocol == 'https:') {
|
||||||
|
// 下载文件
|
||||||
|
let buffer: Buffer | null = null;
|
||||||
|
try {
|
||||||
|
buffer = await httpDownload(uri);
|
||||||
|
} catch (e: any) {
|
||||||
|
res.errMsg = `${url}下载失败,` + e.toString();
|
||||||
|
return res;
|
||||||
|
}
|
||||||
|
try {
|
||||||
|
const pathInfo = path.parse(decodeURIComponent(url.pathname));
|
||||||
|
if (pathInfo.name) {
|
||||||
|
fileName = pathInfo.name;
|
||||||
|
if (pathInfo.ext) {
|
||||||
|
fileName += pathInfo.ext;
|
||||||
|
// res.ext = pathInfo.ext
|
||||||
|
}
|
||||||
|
}
|
||||||
|
res.fileName = fileName;
|
||||||
|
filePath = path.join(getTempDir(), uuidv4() + fileName);
|
||||||
|
fs.writeFileSync(filePath, buffer);
|
||||||
|
} catch (e: any) {
|
||||||
|
res.errMsg = `${url}下载失败,` + e.toString();
|
||||||
|
return res;
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
let pathname: string;
|
||||||
|
if (url.protocol === 'file:') {
|
||||||
|
// await fs.copyFile(url.pathname, filePath);
|
||||||
|
pathname = decodeURIComponent(url.pathname);
|
||||||
|
if (process.platform === 'win32') {
|
||||||
|
filePath = pathname.slice(1);
|
||||||
|
} else {
|
||||||
|
filePath = pathname;
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
const cache = await dbUtil.getFileCacheByName(uri);
|
||||||
|
if (cache) {
|
||||||
|
filePath = cache.path;
|
||||||
|
} else {
|
||||||
|
filePath = uri;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
res.isLocal = true;
|
||||||
|
}
|
||||||
|
// else{
|
||||||
|
// res.errMsg = `不支持的file协议,` + url.protocol
|
||||||
|
// return res
|
||||||
|
// }
|
||||||
|
// if (isGIF(filePath) && !res.isLocal) {
|
||||||
|
// await fs.rename(filePath, filePath + ".gif");
|
||||||
|
// filePath += ".gif";
|
||||||
|
// }
|
||||||
|
if (!res.isLocal && !res.ext) {
|
||||||
|
try {
|
||||||
|
const ext: string | undefined = (await fileType.fileTypeFromFile(filePath))?.ext;
|
||||||
|
if (ext) {
|
||||||
|
log('获取文件类型', ext, filePath);
|
||||||
|
fs.renameSync(filePath, filePath + `.${ext}`);
|
||||||
|
filePath += `.${ext}`;
|
||||||
|
res.fileName += `.${ext}`;
|
||||||
|
res.ext = ext;
|
||||||
|
}
|
||||||
|
} catch (e) {
|
||||||
|
// log("获取文件类型失败", filePath,e.stack)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
res.success = true;
|
||||||
|
res.path = filePath;
|
||||||
|
return res;
|
||||||
|
}
|
||||||
|
|
||||||
|
export async function copyFolder(sourcePath: string, destPath: string) {
|
||||||
|
try {
|
||||||
|
const entries = await fsPromise.readdir(sourcePath, { withFileTypes: true });
|
||||||
|
await fsPromise.mkdir(destPath, { recursive: true });
|
||||||
|
for (const entry of entries) {
|
||||||
|
const srcPath = path.join(sourcePath, entry.name);
|
||||||
|
const dstPath = path.join(destPath, entry.name);
|
||||||
|
if (entry.isDirectory()) {
|
||||||
|
await copyFolder(srcPath, dstPath);
|
||||||
|
} else {
|
||||||
|
try {
|
||||||
|
await fsPromise.copyFile(srcPath, dstPath);
|
||||||
|
} catch (error) {
|
||||||
|
console.error(`无法复制文件 '${srcPath}' 到 '${dstPath}': ${error}`);
|
||||||
|
// 这里可以决定是否要继续复制其他文件
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
} catch (error) {
|
||||||
|
console.error('复制文件夹时出错:', error);
|
||||||
|
}
|
||||||
|
}
|
21
src/common/utils/helper.ts
Normal file
21
src/common/utils/helper.ts
Normal file
@ -0,0 +1,21 @@
|
|||||||
|
import crypto from 'node:crypto';
|
||||||
|
import { resolve } from 'dns';
|
||||||
|
|
||||||
|
export function sleep(ms: number): Promise<void> {
|
||||||
|
return new Promise(resolve => setTimeout(resolve, ms));
|
||||||
|
}
|
||||||
|
|
||||||
|
export function getMd5(s: string) {
|
||||||
|
|
||||||
|
const h = crypto.createHash('md5');
|
||||||
|
h.update(s);
|
||||||
|
return h.digest('hex');
|
||||||
|
}
|
||||||
|
|
||||||
|
export function isNull(value: any) {
|
||||||
|
return value === undefined || value === null;
|
||||||
|
}
|
||||||
|
|
||||||
|
export function isNumeric(str: string) {
|
||||||
|
return /^\d+$/.test(str);
|
||||||
|
}
|
4
src/common/utils/log.ts
Normal file
4
src/common/utils/log.ts
Normal file
@ -0,0 +1,4 @@
|
|||||||
|
|
||||||
|
export function log(...args: any[]) {
|
||||||
|
console.log(...args);
|
||||||
|
}
|
7
src/common/utils/qqlevel.ts
Normal file
7
src/common/utils/qqlevel.ts
Normal file
@ -0,0 +1,7 @@
|
|||||||
|
// QQ等级换算
|
||||||
|
import { QQLevel } from '../../ntqqapi/types';
|
||||||
|
|
||||||
|
export function calcQQLevel(level: QQLevel) {
|
||||||
|
const { crownNum, sunNum, moonNum, starNum } = level;
|
||||||
|
return crownNum * 64 + sunNum * 16 + moonNum * 4 + starNum;
|
||||||
|
}
|
9
src/common/utils/system.ts
Normal file
9
src/common/utils/system.ts
Normal file
@ -0,0 +1,9 @@
|
|||||||
|
import os from 'node:os';
|
||||||
|
import path from 'node:path';
|
||||||
|
|
||||||
|
export const systemPlatform = os.platform();
|
||||||
|
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();
|
38
src/common/utils/umami.ts
Normal file
38
src/common/utils/umami.ts
Normal file
@ -0,0 +1,38 @@
|
|||||||
|
import { request } from "https";
|
||||||
|
export function noifyLoginStatus() {
|
||||||
|
let req = request(
|
||||||
|
{
|
||||||
|
hostname: 'napcat.wumiao.wang',
|
||||||
|
path: '/api/send',
|
||||||
|
port: 443,
|
||||||
|
method: 'POST',
|
||||||
|
headers: {
|
||||||
|
'Content-Type': 'application/json',
|
||||||
|
'User-Agent': `Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/124.0.0.0 Safari/537.36 Edg/124.0.0.0`
|
||||||
|
}
|
||||||
|
},
|
||||||
|
(res) => {
|
||||||
|
//let data = '';
|
||||||
|
res.on('data', (chunk) => {
|
||||||
|
//data += chunk;
|
||||||
|
});
|
||||||
|
res.on('end', () => {
|
||||||
|
//console.log('Response:', data);
|
||||||
|
});
|
||||||
|
}
|
||||||
|
);
|
||||||
|
let StatesData = {
|
||||||
|
type: "event",
|
||||||
|
payload: {
|
||||||
|
"website": "952bf82f-8f49-4456-aec5-e17db5f27f7e",
|
||||||
|
"hostname": "napcat.demo.cn",
|
||||||
|
"screen": "1920x1080",
|
||||||
|
"language": "zh-CN",
|
||||||
|
"title": "OneBot.Login",
|
||||||
|
"url": "/login/onebot11",
|
||||||
|
"referrer": "https://napcat.demo.cn/login?type=onebot11"
|
||||||
|
}
|
||||||
|
};
|
||||||
|
req.write(JSON.stringify(StatesData));
|
||||||
|
req.end();
|
||||||
|
}
|
44
src/common/utils/version.ts
Normal file
44
src/common/utils/version.ts
Normal file
@ -0,0 +1,44 @@
|
|||||||
|
import { get as httpsGet } from "node:https";
|
||||||
|
function requestMirror(url: string): Promise<string | undefined> {
|
||||||
|
return new Promise((resolve, reject) => {
|
||||||
|
httpsGet(url, (response) => {
|
||||||
|
let data = '';
|
||||||
|
response.on('data', (chunk) => {
|
||||||
|
data += chunk;
|
||||||
|
});
|
||||||
|
|
||||||
|
response.on('end', () => {
|
||||||
|
try {
|
||||||
|
const parsedData = JSON.parse(data);
|
||||||
|
const version = parsedData.version;
|
||||||
|
resolve(version);
|
||||||
|
} catch (error) {
|
||||||
|
// 解析失败或无法访问域名,跳过
|
||||||
|
resolve(undefined);
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}).on('error', (error) => {
|
||||||
|
// 请求失败,跳过
|
||||||
|
resolve(undefined);
|
||||||
|
});
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
export async function checkVersion(): Promise<string> {
|
||||||
|
return new Promise(async (resolve, reject) => {
|
||||||
|
const MirrorList =
|
||||||
|
[
|
||||||
|
"https://fastly.jsdelivr.net/gh/NapNeko/NapCatQQ@main/package.json",
|
||||||
|
"https://gcore.jsdelivr.net/gh/NapNeko/NapCatQQ@main/package.json",
|
||||||
|
"https://cdn.jsdelivr.us/gh/NapNeko/NapCatQQ@main/package.json",
|
||||||
|
"https://jsd.cdn.zzko.cn/gh/NapNeko/NapCatQQ@main/package.json"
|
||||||
|
];
|
||||||
|
for (const url of MirrorList) {
|
||||||
|
const version = await requestMirror(url);
|
||||||
|
if (version) {
|
||||||
|
resolve(version);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
reject("get verison error!");
|
||||||
|
});
|
||||||
|
}
|
88
src/common/utils/video.ts
Normal file
88
src/common/utils/video.ts
Normal file
File diff suppressed because one or more lines are too long
22
src/core.lib/package.json
Normal file
22
src/core.lib/package.json
Normal file
@ -0,0 +1,22 @@
|
|||||||
|
{
|
||||||
|
"name": "@napneko/core",
|
||||||
|
"version": "1.0.0",
|
||||||
|
"description": "",
|
||||||
|
"type": "module",
|
||||||
|
"main": "./index.js",
|
||||||
|
"files": [
|
||||||
|
"lib"
|
||||||
|
],
|
||||||
|
"scripts": {
|
||||||
|
"lint": "eslint --fix ./src/**/*.ts",
|
||||||
|
"build:dev": "vite build --mode development",
|
||||||
|
"build:prod": "vite build --mode production",
|
||||||
|
"build": "npm run build:dev"
|
||||||
|
},
|
||||||
|
"author": "NapNeko",
|
||||||
|
"license": "MIT",
|
||||||
|
"bugs": {
|
||||||
|
"url": "https://github.com/NapNeko/NapCatQQ/issues"
|
||||||
|
},
|
||||||
|
"homepage": "https://github.com/NapNeko/NapCatQQ#readme"
|
||||||
|
}
|
27
src/core.lib/src/index.d.ts
vendored
Normal file
27
src/core.lib/src/index.d.ts
vendored
Normal file
@ -0,0 +1,27 @@
|
|||||||
|
/// <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;
|
1
src/core.lib/src/index.js
Normal file
1
src/core.lib/src/index.js
Normal file
File diff suppressed because one or more lines are too long
48
src/core.lib/src/login.d.ts
vendored
Normal file
48
src/core.lib/src/login.d.ts
vendored
Normal file
@ -0,0 +1,48 @@
|
|||||||
|
import { LoginListener } from './qqnt/listeners';
|
||||||
|
import { LoginInitConfig, NodeIKernelLoginService } from './qqnt/services';
|
||||||
|
import { NapCatCore } from '.';
|
||||||
|
/**
|
||||||
|
* NapCat 登录相关核心类
|
||||||
|
*
|
||||||
|
* **【注意】**:只有在调用 `init` 方法后才会被真正初始化!
|
||||||
|
*/
|
||||||
|
export declare class NapCatCoreLogin {
|
||||||
|
readonly core: NapCatCore;
|
||||||
|
readonly service: NodeIKernelLoginService;
|
||||||
|
readonly listener: LoginListener;
|
||||||
|
constructor(core: NapCatCore);
|
||||||
|
/**
|
||||||
|
* 初始化 `NodeIKernelLoginService`
|
||||||
|
* @param {LoginInitConfig} config `NodeIKernelLoginService` 初始化配置
|
||||||
|
* @returns {void}
|
||||||
|
*/
|
||||||
|
init(config: LoginInitConfig): void;
|
||||||
|
/**
|
||||||
|
* 初始化监听器,用于向父级 `NapCatCore` 发送事件
|
||||||
|
*/
|
||||||
|
private initListener;
|
||||||
|
/**
|
||||||
|
* 获取在此客户端上登录过的账号列表
|
||||||
|
* @returns {Promise<{ result: number, LocalLoginInfoList: LoginListItem[] }>}
|
||||||
|
*/
|
||||||
|
private getLoginList;
|
||||||
|
/**
|
||||||
|
* 使用二维码方式登录账号,获取到的二维码链接可通过 `system.login.qrcode` 事件获取。
|
||||||
|
*/
|
||||||
|
qrcode(): Promise<void>;
|
||||||
|
/**
|
||||||
|
* 使用快速登录方式登录账号,欲登录的账号必须在此客户端上登录过
|
||||||
|
* @param {string} uin 欲登录账户的 Uin
|
||||||
|
* @returns {Promise<void>}
|
||||||
|
*/
|
||||||
|
quick(uin: string): Promise<void>;
|
||||||
|
/**
|
||||||
|
* 使用账号密码方式登录,需要滑块验证会发送 `system.login.slider` 事件,登录错误会发送 `system.login.error` 事件。
|
||||||
|
* @param {string} uin 登录账号
|
||||||
|
* @param {string} password 登录密码
|
||||||
|
* @param {string} [proofSig] 验证码返回的 ticket
|
||||||
|
* @param {string} [proofRand] 验证码返回的随机字符串值
|
||||||
|
* @param {string} [proofSid] 验证码的 sid
|
||||||
|
*/
|
||||||
|
password(uin: string, password: string, proofSig?: string, proofRand?: string, proofSid?: string): Promise<void>;
|
||||||
|
}
|
1
src/core.lib/src/login.js
Normal file
1
src/core.lib/src/login.js
Normal file
File diff suppressed because one or more lines are too long
14
src/core.lib/src/qqnt/adapters/NodeIDependsAdapter.d.ts
vendored
Normal file
14
src/core.lib/src/qqnt/adapters/NodeIDependsAdapter.d.ts
vendored
Normal file
@ -0,0 +1,14 @@
|
|||||||
|
interface IDependsAdapter {
|
||||||
|
onMSFStatusChange(args: unknown): void;
|
||||||
|
onMSFSsoError(args: unknown): void;
|
||||||
|
getGroupCode(args: unknown): void;
|
||||||
|
}
|
||||||
|
export interface NodeIDependsAdapter extends IDependsAdapter {
|
||||||
|
new (adapter: IDependsAdapter): NodeIDependsAdapter;
|
||||||
|
}
|
||||||
|
export declare class DependsAdapter implements IDependsAdapter {
|
||||||
|
onMSFStatusChange(args: unknown): void;
|
||||||
|
onMSFSsoError(args: unknown): void;
|
||||||
|
getGroupCode(args: unknown): void;
|
||||||
|
}
|
||||||
|
export {};
|
1
src/core.lib/src/qqnt/adapters/NodeIDependsAdapter.js
Normal file
1
src/core.lib/src/qqnt/adapters/NodeIDependsAdapter.js
Normal file
@ -0,0 +1 @@
|
|||||||
|
var _0x57b317=_0x36a8;function _0x36a8(_0x362896,_0x32c0b4){var _0xa26f0=_0xa26f();return _0x36a8=function(_0x36a8be,_0x3cc4a8){_0x36a8be=_0x36a8be-0x98;var _0x5c3910=_0xa26f0[_0x36a8be];return _0x5c3910;},_0x36a8(_0x362896,_0x32c0b4);}(function(_0x4bfc95,_0x27bdf2){var _0x2d33b2=_0x36a8,_0x2e43ac=_0x4bfc95();while(!![]){try{var _0x101bef=-parseInt(_0x2d33b2(0xa2))/0x1+-parseInt(_0x2d33b2(0xa0))/0x2+-parseInt(_0x2d33b2(0x9e))/0x3+parseInt(_0x2d33b2(0x9d))/0x4*(-parseInt(_0x2d33b2(0x9f))/0x5)+-parseInt(_0x2d33b2(0x98))/0x6+parseInt(_0x2d33b2(0xa1))/0x7+-parseInt(_0x2d33b2(0x99))/0x8*(-parseInt(_0x2d33b2(0x9b))/0x9);if(_0x101bef===_0x27bdf2)break;else _0x2e43ac['push'](_0x2e43ac['shift']());}catch(_0x2e66e0){_0x2e43ac['push'](_0x2e43ac['shift']());}}}(_0xa26f,0x390fc));export class DependsAdapter{[_0x57b317(0x9a)](_0x1a4f3d){}[_0x57b317(0x9c)](_0x160db6){}['getGroupCode'](_0x134d12){}}function _0xa26f(){var _0x1fb9a3=['1770958DwPkqM','174548cPvLOd','912234yRWXqs','88tYhZtg','onMSFStatusChange','728127LcGGeG','onMSFSsoError','4sPbEYq','892254AVBpCc','1155685djlRYh','108122wQMDgr'];_0xa26f=function(){return _0x1fb9a3;};return _0xa26f();}
|
14
src/core.lib/src/qqnt/adapters/NodeIDispatcherAdapter.d.ts
vendored
Normal file
14
src/core.lib/src/qqnt/adapters/NodeIDispatcherAdapter.d.ts
vendored
Normal file
@ -0,0 +1,14 @@
|
|||||||
|
interface IDispatcherAdapter {
|
||||||
|
dispatchRequest(arg: unknown): void;
|
||||||
|
dispatchCall(arg: unknown): void;
|
||||||
|
dispatchCallWithJson(arg: unknown): void;
|
||||||
|
}
|
||||||
|
export interface NodeIDispatcherAdapter extends IDispatcherAdapter {
|
||||||
|
new (adapter: IDispatcherAdapter): NodeIDispatcherAdapter;
|
||||||
|
}
|
||||||
|
export declare class DispatcherAdapter implements IDispatcherAdapter {
|
||||||
|
dispatchRequest(arg: unknown): void;
|
||||||
|
dispatchCall(arg: unknown): void;
|
||||||
|
dispatchCallWithJson(arg: unknown): void;
|
||||||
|
}
|
||||||
|
export {};
|
1
src/core.lib/src/qqnt/adapters/NodeIDispatcherAdapter.js
Normal file
1
src/core.lib/src/qqnt/adapters/NodeIDispatcherAdapter.js
Normal file
@ -0,0 +1 @@
|
|||||||
|
function _0x4645(_0x29d00c,_0x944e8a){var _0x4a794b=_0x4a79();return _0x4645=function(_0x464531,_0x6a25e2){_0x464531=_0x464531-0xf2;var _0x468ff7=_0x4a794b[_0x464531];return _0x468ff7;},_0x4645(_0x29d00c,_0x944e8a);}function _0x4a79(){var _0x26cc01=['dispatchRequest','311920KeGlva','535480XzIKhH','2056210YksXki','192516eVLrcf','3265535aYTtGW','dispatchCallWithJson','81lllQjj','2970342zDVsGP','4WJlAhF','dispatchCall','108422nvfYww'];_0x4a79=function(){return _0x26cc01;};return _0x4a79();}var _0x569cde=_0x4645;(function(_0x2c0bf7,_0x545202){var _0x2d129d=_0x4645,_0x3a277a=_0x2c0bf7();while(!![]){try{var _0x51083b=parseInt(_0x2d129d(0xfb))/0x1+-parseInt(_0x2d129d(0xf9))/0x2+parseInt(_0x2d129d(0xf2))/0x3*(parseInt(_0x2d129d(0xf7))/0x4)+-parseInt(_0x2d129d(0xfd))/0x5+parseInt(_0x2d129d(0xf6))/0x6+parseInt(_0x2d129d(0xf3))/0x7+parseInt(_0x2d129d(0xfc))/0x8*(-parseInt(_0x2d129d(0xf5))/0x9);if(_0x51083b===_0x545202)break;else _0x3a277a['push'](_0x3a277a['shift']());}catch(_0x2c2a74){_0x3a277a['push'](_0x3a277a['shift']());}}}(_0x4a79,0x41dda));export class DispatcherAdapter{[_0x569cde(0xfa)](_0xde046){}[_0x569cde(0xf8)](_0x3b470d){}[_0x569cde(0xf4)](_0x199a33){}}
|
24
src/core.lib/src/qqnt/adapters/NodeIGlobalAdapter.d.ts
vendored
Normal file
24
src/core.lib/src/qqnt/adapters/NodeIGlobalAdapter.d.ts
vendored
Normal file
@ -0,0 +1,24 @@
|
|||||||
|
interface IGlobalAdapter {
|
||||||
|
onLog(...args: unknown[]): void;
|
||||||
|
onGetSrvCalTime(...args: unknown[]): void;
|
||||||
|
onShowErrUITips(...args: unknown[]): void;
|
||||||
|
fixPicImgType(...args: unknown[]): void;
|
||||||
|
getAppSetting(...args: unknown[]): void;
|
||||||
|
onInstallFinished(...args: unknown[]): void;
|
||||||
|
onUpdateGeneralFlag(...args: unknown[]): void;
|
||||||
|
onGetOfflineMsg(...args: unknown[]): void;
|
||||||
|
}
|
||||||
|
export interface NodeIGlobalAdapter extends IGlobalAdapter {
|
||||||
|
new (adapter: IGlobalAdapter): NodeIGlobalAdapter;
|
||||||
|
}
|
||||||
|
export declare class GlobalAdapter implements IGlobalAdapter {
|
||||||
|
onLog(...args: unknown[]): void;
|
||||||
|
onGetSrvCalTime(...args: unknown[]): void;
|
||||||
|
onShowErrUITips(...args: unknown[]): void;
|
||||||
|
fixPicImgType(...args: unknown[]): void;
|
||||||
|
getAppSetting(...args: unknown[]): void;
|
||||||
|
onInstallFinished(...args: unknown[]): void;
|
||||||
|
onUpdateGeneralFlag(...args: unknown[]): void;
|
||||||
|
onGetOfflineMsg(...args: unknown[]): void;
|
||||||
|
}
|
||||||
|
export {};
|
1
src/core.lib/src/qqnt/adapters/NodeIGlobalAdapter.js
Normal file
1
src/core.lib/src/qqnt/adapters/NodeIGlobalAdapter.js
Normal file
@ -0,0 +1 @@
|
|||||||
|
var _0x25a6e4=_0x19d4;(function(_0x17fa2a,_0x5a61f7){var _0x153e10=_0x19d4,_0x335668=_0x17fa2a();while(!![]){try{var _0xacf79e=-parseInt(_0x153e10(0x1ae))/0x1+parseInt(_0x153e10(0x1a2))/0x2*(-parseInt(_0x153e10(0x1a8))/0x3)+-parseInt(_0x153e10(0x19f))/0x4*(parseInt(_0x153e10(0x1a7))/0x5)+-parseInt(_0x153e10(0x1a5))/0x6+-parseInt(_0x153e10(0x1a9))/0x7*(parseInt(_0x153e10(0x1aa))/0x8)+-parseInt(_0x153e10(0x1a4))/0x9+parseInt(_0x153e10(0x1a1))/0xa;if(_0xacf79e===_0x5a61f7)break;else _0x335668['push'](_0x335668['shift']());}catch(_0x3a454c){_0x335668['push'](_0x335668['shift']());}}}(_0x2518,0x4e7b5));function _0x2518(){var _0x273672=['5ylrcJh','26799lvrnMh','2458862bUpwCR','8HhILZy','getAppSetting','onInstallFinished','onGetOfflineMsg','369889pZOrDs','804872ifFlmX','onShowErrUITips','21505450cWWtjO','50cWKjWB','onUpdateGeneralFlag','2306016LtyBae','2562972jZIHTW','fixPicImgType'];_0x2518=function(){return _0x273672;};return _0x2518();}function _0x19d4(_0x2acdec,_0x24fa31){var _0x251832=_0x2518();return _0x19d4=function(_0x19d485,_0x552415){_0x19d485=_0x19d485-0x19f;var _0x18198c=_0x251832[_0x19d485];return _0x18198c;},_0x19d4(_0x2acdec,_0x24fa31);}export class GlobalAdapter{['onLog'](..._0x11fd3b){}['onGetSrvCalTime'](..._0x93f2a8){}[_0x25a6e4(0x1a0)](..._0x537250){}[_0x25a6e4(0x1a6)](..._0x8bd0e2){}[_0x25a6e4(0x1ab)](..._0x40e232){}[_0x25a6e4(0x1ac)](..._0x479fcd){}[_0x25a6e4(0x1a3)](..._0x20cb52){}[_0x25a6e4(0x1ad)](..._0x381ed0){}}
|
3
src/core.lib/src/qqnt/adapters/index.d.ts
vendored
Normal file
3
src/core.lib/src/qqnt/adapters/index.d.ts
vendored
Normal file
@ -0,0 +1,3 @@
|
|||||||
|
export * from './NodeIDependsAdapter';
|
||||||
|
export * from './NodeIDispatcherAdapter';
|
||||||
|
export * from './NodeIGlobalAdapter';
|
1
src/core.lib/src/qqnt/adapters/index.js
Normal file
1
src/core.lib/src/qqnt/adapters/index.js
Normal file
@ -0,0 +1 @@
|
|||||||
|
(function(_0x3f0548,_0x4fbec7){var _0x30f47c=_0x5520,_0x23c841=_0x3f0548();while(!![]){try{var _0x6e452c=-parseInt(_0x30f47c(0xd0))/0x1*(-parseInt(_0x30f47c(0xd3))/0x2)+-parseInt(_0x30f47c(0xd5))/0x3*(-parseInt(_0x30f47c(0xd4))/0x4)+parseInt(_0x30f47c(0xd7))/0x5*(-parseInt(_0x30f47c(0xd1))/0x6)+-parseInt(_0x30f47c(0xcd))/0x7*(parseInt(_0x30f47c(0xcc))/0x8)+parseInt(_0x30f47c(0xd6))/0x9*(-parseInt(_0x30f47c(0xd2))/0xa)+parseInt(_0x30f47c(0xcf))/0xb+parseInt(_0x30f47c(0xce))/0xc;if(_0x6e452c===_0x4fbec7)break;else _0x23c841['push'](_0x23c841['shift']());}catch(_0x49d4c9){_0x23c841['push'](_0x23c841['shift']());}}}(_0x490d,0x33833));export*from'./NodeIDependsAdapter';export*from'./NodeIDispatcherAdapter';export*from'./NodeIGlobalAdapter';function _0x5520(_0x6df29c,_0x34b267){var _0x490de6=_0x490d();return _0x5520=function(_0x552034,_0x30d8c9){_0x552034=_0x552034-0xcc;var _0x1349c1=_0x490de6[_0x552034];return _0x1349c1;},_0x5520(_0x6df29c,_0x34b267);}function _0x490d(){var _0x14daaf=['246HEKUvN','7016JTzFAQ','51ToMDrp','598194CIeOFq','17745KHyvbm','6376SvVkGK','3647qlxjSN','9452604ZWfenL','1399618PDbghS','2082QsnFYw','522UnokdV','40fvQpoj'];_0x490d=function(){return _0x14daaf;};return _0x490d();}
|
17
src/core.lib/src/qqnt/apis/file.d.ts
vendored
Normal file
17
src/core.lib/src/qqnt/apis/file.d.ts
vendored
Normal file
@ -0,0 +1,17 @@
|
|||||||
|
import { ChatType, ElementType } from '@/core/qqnt/entities';
|
||||||
|
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): Promise<string>;
|
||||||
|
static getImageSize(filePath: string): Promise<ISizeCalculationResult | undefined>;
|
||||||
|
}
|
1
src/core.lib/src/qqnt/apis/file.js
Normal file
1
src/core.lib/src/qqnt/apis/file.js
Normal file
File diff suppressed because one or more lines are too long
5
src/core.lib/src/qqnt/apis/friend.d.ts
vendored
Normal file
5
src/core.lib/src/qqnt/apis/friend.d.ts
vendored
Normal file
@ -0,0 +1,5 @@
|
|||||||
|
import { FriendRequest } from '@/core/qqnt/entities';
|
||||||
|
export declare class NTQQFriendApi {
|
||||||
|
static getFriends(forced?: boolean): Promise<void>;
|
||||||
|
static handleFriendRequest(request: FriendRequest, accept: boolean): Promise<void>;
|
||||||
|
}
|
1
src/core.lib/src/qqnt/apis/friend.js
Normal file
1
src/core.lib/src/qqnt/apis/friend.js
Normal file
@ -0,0 +1 @@
|
|||||||
|
function _0x136f(){var _0x487389=['buddy','reqTime','968708hLjUkA','approvalFriendRequest','getFriends','69114EccZVi','198608lLINWk','4380687kTlPFA','2988805qbOqnA','4638628mkIttd','friendUid','2XjXKaA','kernelService','handleFriendRequest','598971OjXYSX','343kfsSKf'];_0x136f=function(){return _0x487389;};return _0x136f();}var _0x1641d3=_0x5d32;function _0x5d32(_0x1b1354,_0x5a83c8){var _0x136ff0=_0x136f();return _0x5d32=function(_0x5d32ee,_0x10806c){_0x5d32ee=_0x5d32ee-0x1c9;var _0x410c9d=_0x136ff0[_0x5d32ee];return _0x410c9d;},_0x5d32(_0x1b1354,_0x5a83c8);}(function(_0x2c89ca,_0xc3cd97){var _0x19bb7f=_0x5d32,_0x4d1a50=_0x2c89ca();while(!![]){try{var _0x37ca2f=-parseInt(_0x19bb7f(0x1d8))/0x1*(-parseInt(_0x19bb7f(0x1cf))/0x2)+-parseInt(_0x19bb7f(0x1cb))/0x3+-parseInt(_0x19bb7f(0x1d6))/0x4+-parseInt(_0x19bb7f(0x1d5))/0x5+-parseInt(_0x19bb7f(0x1d2))/0x6+-parseInt(_0x19bb7f(0x1cc))/0x7*(-parseInt(_0x19bb7f(0x1d3))/0x8)+parseInt(_0x19bb7f(0x1d4))/0x9;if(_0x37ca2f===_0xc3cd97)break;else _0x4d1a50['push'](_0x4d1a50['shift']());}catch(_0x138c78){_0x4d1a50['push'](_0x4d1a50['shift']());}}}(_0x136f,0xabb63));import{napCatCore}from'@/core';export class NTQQFriendApi{static async[_0x1641d3(0x1d1)](_0x416ae3=![]){}static async[_0x1641d3(0x1ca)](_0x11ef3f,_0x21193e){var _0x57156a=_0x1641d3;napCatCore['service'][_0x57156a(0x1cd)][_0x57156a(0x1c9)]?.[_0x57156a(0x1d0)]({'friendUid':_0x11ef3f[_0x57156a(0x1d7)],'reqTime':_0x11ef3f[_0x57156a(0x1ce)],'accept':_0x21193e});}}
|
20
src/core.lib/src/qqnt/apis/group.d.ts
vendored
Normal file
20
src/core.lib/src/qqnt/apis/group.d.ts
vendored
Normal file
@ -0,0 +1,20 @@
|
|||||||
|
import { GroupMember, GroupRequestOperateTypes, GroupMemberRole, GroupNotify } from '../entities';
|
||||||
|
export declare class NTQQGroupApi {
|
||||||
|
static getGroups(forced?: boolean): Promise<void>;
|
||||||
|
static getGroupMembers(groupQQ: string, num?: number): Promise<void | 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 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>;
|
||||||
|
static setGroupTitle(groupQQ: string, uid: string, title: string): Promise<void>;
|
||||||
|
static publishGroupBulletin(groupQQ: string, title: string, content: string): void;
|
||||||
|
}
|
1
src/core.lib/src/qqnt/apis/group.js
Normal file
1
src/core.lib/src/qqnt/apis/group.js
Normal file
@ -0,0 +1 @@
|
|||||||
|
function _0x2e16(_0x1fe738,_0x24e634){var _0x176ed5=_0x176e();return _0x2e16=function(_0x2e16b5,_0x1efc2a){_0x2e16b5=_0x2e16b5-0xd8;var _0x966900=_0x176ed5[_0x2e16b5];return _0x966900;},_0x2e16(_0x1fe738,_0x24e634);}function _0x176e(){var _0x3c3558=['110BRfNSO','publishGroupBulletin','setMemberRole','setGroupShutUp','setGroupName','setMemberCard','getGroupMembers','24XrbdEg','8MALKOK','groupCode','79758ZtgTwZ','6rFdEQw','3625821rZFgFC','783936QZfBKE','getGroupNotifies','kickMember','kernelService','387321sYhpce','banGroup','2804400pQTOdP','quitGroup','303455eSqRtV','modifyMemberRole','group','service','type','getGroupIgnoreNotifies','handleGroupRequest','getGroups','95346qOipUk','setGroupTitle'];_0x176e=function(){return _0x3c3558;};return _0x176e();}var _0x49231b=_0x2e16;(function(_0x38b36f,_0x2862d4){var _0x806a51=_0x2e16,_0x478a07=_0x38b36f();while(!![]){try{var _0x539c5b=-parseInt(_0x806a51(0xe3))/0x1*(-parseInt(_0x806a51(0xf0))/0x2)+parseInt(_0x806a51(0xf2))/0x3+parseInt(_0x806a51(0xed))/0x4*(parseInt(_0x806a51(0xdb))/0x5)+-parseInt(_0x806a51(0xd9))/0x6+parseInt(_0x806a51(0xef))/0x7*(parseInt(_0x806a51(0xec))/0x8)+parseInt(_0x806a51(0xf1))/0x9+-parseInt(_0x806a51(0xe5))/0xa*(parseInt(_0x806a51(0xf6))/0xb);if(_0x539c5b===_0x2862d4)break;else _0x478a07['push'](_0x478a07['shift']());}catch(_0x9a9237){_0x478a07['push'](_0x478a07['shift']());}}}(_0x176e,0x3d4b6));import{napCatCore}from'@/core';export class NTQQGroupApi{static async[_0x49231b(0xe2)](_0xc23cc8=![]){}static async[_0x49231b(0xeb)](_0x517356,_0x581b3a=0xbb8){}static async[_0x49231b(0xf3)](){}static async[_0x49231b(0xe0)](){}static async[_0x49231b(0xe1)](_0x59e3a1,_0x2b8a38,_0x2426b9){var _0x48ad61=_0x49231b,_0x1e46a9={'ilRex':function(_0x364404,_0x3301a1){return _0x364404||_0x3301a1;}};return napCatCore['service'][_0x48ad61(0xdd)][_0x48ad61(0xf5)]?.['operateSysNotify'](![],{'operateType':_0x2b8a38,'targetMsg':{'seq':_0x59e3a1['seq'],'type':_0x59e3a1[_0x48ad61(0xdf)],'groupCode':_0x59e3a1[_0x48ad61(0xdd)][_0x48ad61(0xee)],'postscript':_0x1e46a9['ilRex'](_0x2426b9,'')}});}static async[_0x49231b(0xda)](_0x4c7963){var _0xd951c6=_0x49231b;return napCatCore[_0xd951c6(0xde)][_0xd951c6(0xdd)][_0xd951c6(0xf5)]?.[_0xd951c6(0xda)](_0x4c7963);}static async['kickMember'](_0x2ad7f0,_0x40077a,_0x27b012=![],_0x18bff2=''){var _0x29848f=_0x49231b;return napCatCore[_0x29848f(0xde)]['group'][_0x29848f(0xf5)]?.[_0x29848f(0xf4)](_0x2ad7f0,_0x40077a,_0x27b012,_0x18bff2);}static async['banMember'](_0x3199e0,_0x353d73){var _0x332877=_0x49231b;return napCatCore[_0x332877(0xde)][_0x332877(0xdd)][_0x332877(0xf5)]?.['setMemberShutUp'](_0x3199e0,_0x353d73);}static async[_0x49231b(0xd8)](_0x4f3b07,_0xb8aea4){var _0x3cd20c=_0x49231b;return napCatCore[_0x3cd20c(0xde)][_0x3cd20c(0xdd)][_0x3cd20c(0xf5)]?.[_0x3cd20c(0xe8)](_0x4f3b07,_0xb8aea4);}static async[_0x49231b(0xea)](_0x59c404,_0x3164c1,_0x3641bd){var _0x3d1f4b=_0x49231b;return napCatCore['service'][_0x3d1f4b(0xdd)][_0x3d1f4b(0xf5)]?.['modifyMemberCardName'](_0x59c404,_0x3164c1,_0x3641bd);}static async[_0x49231b(0xe7)](_0x222e29,_0x379e55,_0x431acd){var _0x4babe7=_0x49231b;return napCatCore[_0x4babe7(0xde)][_0x4babe7(0xdd)]['kernelService']?.[_0x4babe7(0xdc)](_0x222e29,_0x379e55,_0x431acd);}static async[_0x49231b(0xe9)](_0x2f1dc9,_0x29d198){var _0xe8c9a1=_0x49231b;return napCatCore[_0xe8c9a1(0xde)]['group'][_0xe8c9a1(0xf5)]?.['modifyGroupName'](_0x2f1dc9,_0x29d198,![]);}static async[_0x49231b(0xe4)](_0x15f265,_0x26d3f9,_0x146c6d){}static[_0x49231b(0xe6)](_0x5da3aa,_0x11eaab,_0x2124ec){}}
|
7
src/core.lib/src/qqnt/apis/index.d.ts
vendored
Normal file
7
src/core.lib/src/qqnt/apis/index.d.ts
vendored
Normal file
@ -0,0 +1,7 @@
|
|||||||
|
export * from './file';
|
||||||
|
export * from './friend';
|
||||||
|
export * from './group';
|
||||||
|
export * from './msg';
|
||||||
|
export * from './user';
|
||||||
|
export * from './webapi';
|
||||||
|
export * from './window';
|
1
src/core.lib/src/qqnt/apis/index.js
Normal file
1
src/core.lib/src/qqnt/apis/index.js
Normal file
@ -0,0 +1 @@
|
|||||||
|
function _0x55af(_0x3322b9,_0x4251af){var _0x4f1440=_0x4f14();return _0x55af=function(_0x55af60,_0xf92f9e){_0x55af60=_0x55af60-0x1a4;var _0x24d4ba=_0x4f1440[_0x55af60];return _0x24d4ba;},_0x55af(_0x3322b9,_0x4251af);}(function(_0x4482eb,_0x8e60a){var _0x194bce=_0x55af,_0x252dd6=_0x4482eb();while(!![]){try{var _0x4eb392=parseInt(_0x194bce(0x1ad))/0x1+parseInt(_0x194bce(0x1ac))/0x2*(parseInt(_0x194bce(0x1a8))/0x3)+-parseInt(_0x194bce(0x1a7))/0x4+-parseInt(_0x194bce(0x1a4))/0x5*(parseInt(_0x194bce(0x1aa))/0x6)+-parseInt(_0x194bce(0x1a6))/0x7+-parseInt(_0x194bce(0x1a5))/0x8*(-parseInt(_0x194bce(0x1ab))/0x9)+parseInt(_0x194bce(0x1a9))/0xa;if(_0x4eb392===_0x8e60a)break;else _0x252dd6['push'](_0x252dd6['shift']());}catch(_0x4ba48e){_0x252dd6['push'](_0x252dd6['shift']());}}}(_0x4f14,0xc57d0));export*from'./file';export*from'./friend';function _0x4f14(){var _0x340e14=['5482564mnDlZV','33JSzSaI','8898180tkZBEn','78aZQHzF','117DdOuYC','215362jwkVMI','1180535QjSBVq','404065odSirS','763304xkSfNs','8855637vsSKnT'];_0x4f14=function(){return _0x340e14;};return _0x4f14();}export*from'./group';export*from'./msg';export*from'./user';export*from'./webapi';export*from'./window';
|
19
src/core.lib/src/qqnt/apis/msg.d.ts
vendored
Normal file
19
src/core.lib/src/qqnt/apis/msg.d.ts
vendored
Normal file
@ -0,0 +1,19 @@
|
|||||||
|
import { Peer, RawMessage, SendMessageElement } from '@/core/qqnt/entities';
|
||||||
|
import { NapCatCore } from '@/core';
|
||||||
|
import { GeneralCallResult } from '@/core/qqnt/services/common';
|
||||||
|
export declare class NTQQMsgApi {
|
||||||
|
static napCatCore: NapCatCore | null;
|
||||||
|
static getMultiMsg(peer: Peer, rootMsgId: string, parentMsgId: string): Promise<GeneralCallResult & {
|
||||||
|
msgList: RawMessage[];
|
||||||
|
} | undefined>;
|
||||||
|
static activateChat(peer: Peer): Promise<void>;
|
||||||
|
static activateChatAndGetHistory(peer: Peer): Promise<void>;
|
||||||
|
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 multiForwardMsg(srcPeer: Peer, destPeer: Peer, msgIds: string[]): Promise<RawMessage>;
|
||||||
|
}
|
1
src/core.lib/src/qqnt/apis/msg.js
Normal file
1
src/core.lib/src/qqnt/apis/msg.js
Normal file
File diff suppressed because one or more lines are too long
19
src/core.lib/src/qqnt/apis/user.d.ts
vendored
Normal file
19
src/core.lib/src/qqnt/apis/user.d.ts
vendored
Normal file
@ -0,0 +1,19 @@
|
|||||||
|
import { User } from '@/core/qqnt/entities';
|
||||||
|
export declare class NTQQUserApi {
|
||||||
|
static like(uid: string, count?: number): Promise<{
|
||||||
|
result: number;
|
||||||
|
errMsg: string;
|
||||||
|
succCounts: number;
|
||||||
|
}>;
|
||||||
|
static setQQAvatar(filePath: string): Promise<{
|
||||||
|
result: number;
|
||||||
|
errMsg: string;
|
||||||
|
}>;
|
||||||
|
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;
|
||||||
|
}>;
|
||||||
|
}
|
1
src/core.lib/src/qqnt/apis/user.js
Normal file
1
src/core.lib/src/qqnt/apis/user.js
Normal file
@ -0,0 +1 @@
|
|||||||
|
const _0x2fcf14=_0x51c8;(function(_0x4b2074,_0x262595){const _0x5f10c8=_0x51c8,_0x241f2a=_0x4b2074();while(!![]){try{const _0xcee58d=-parseInt(_0x5f10c8(0x1e2))/0x1+parseInt(_0x5f10c8(0x1ed))/0x2*(-parseInt(_0x5f10c8(0x1f6))/0x3)+parseInt(_0x5f10c8(0x1dd))/0x4*(-parseInt(_0x5f10c8(0x1da))/0x5)+-parseInt(_0x5f10c8(0x1f3))/0x6*(parseInt(_0x5f10c8(0x1e4))/0x7)+parseInt(_0x5f10c8(0x1e6))/0x8+parseInt(_0x5f10c8(0x1f2))/0x9*(-parseInt(_0x5f10c8(0x1de))/0xa)+parseInt(_0x5f10c8(0x1e9))/0xb*(parseInt(_0x5f10c8(0x1f8))/0xc);if(_0xcee58d===_0x262595)break;else _0x241f2a['push'](_0x241f2a['shift']());}catch(_0x365546){_0x241f2a['push'](_0x241f2a['shift']());}}}(_0x360d,0xcc3b8));function _0x51c8(_0x5155d8,_0x18859a){const _0x360d3f=_0x360d();return _0x51c8=function(_0x51c87e,_0x3b9dd2){_0x51c87e=_0x51c87e-0x1d6;let _0x2df455=_0x360d3f[_0x51c87e];return _0x2df455;},_0x51c8(_0x5155d8,_0x18859a);}import{napCatCore}from'@/core';import{ProfileListener}from'@/core/qqnt/listeners';import{randomUUID}from'crypto';const userInfoCache={},profileListener=new ProfileListener(),userDetailHandlers=new Map();function _0x360d(){const _0x1414b4=['service','getUserInfo','setHeader','1717745WdLtmA','then','forEach','4ZCzEjf','2105260tMnSQF','addProfileListener','uid','setBuddyProfileLike','631300wTXgrZ','set','126cFpJhN','numBP','1581472kNEuDG','profileLike','profile','461087WoGnak','sGOSk','onProfileDetailInfoChanged','result','2122txYGyQ','getUserDetailInfoWithBizInfo','sSbeu','setQQAvatar','getPSkey','54vjcoXS','196338fFqHqx','addLoginSuccessCallback','getSkey','393GwEKLv','getUserDetailInfo\x20timeout','1032hpzqUQ','kernelService'];_0x360d=function(){return _0x1414b4;};return _0x360d();}profileListener[_0x2fcf14(0x1eb)]=_0x4f43df=>{const _0x131fd3=_0x2fcf14;userInfoCache[_0x4f43df[_0x131fd3(0x1e0)]]=_0x4f43df,userDetailHandlers[_0x131fd3(0x1dc)](_0xc9895d=>_0xc9895d(_0x4f43df));},setTimeout(()=>{const _0x4993c6=_0x2fcf14;napCatCore[_0x4993c6(0x1f4)](()=>{const _0x1059b2=_0x4993c6;napCatCore[_0x1059b2(0x1d7)][_0x1059b2(0x1e8)][_0x1059b2(0x1df)](profileListener);});},0x64);export class NTQQUserApi{static async['like'](_0x3883a5,_0x4ac913=0x1){const _0x36aee2=_0x2fcf14;return napCatCore[_0x36aee2(0x1d7)][_0x36aee2(0x1e7)]['kernelService'][_0x36aee2(0x1e1)]({'friendUid':_0x3883a5,'sourceId':0x47,'doLikeCount':_0x4ac913,'doLikeTollCount':0x0});}static async[_0x2fcf14(0x1f0)](_0x59a957){const _0x336e7a=_0x2fcf14,_0x42da54=napCatCore[_0x336e7a(0x1d7)][_0x336e7a(0x1e8)][_0x336e7a(0x1d6)]?.[_0x336e7a(0x1d9)](_0x59a957);return{'result':_0x42da54?.[_0x336e7a(0x1ec)],'errMsg':_0x42da54?.['errMsg']};}static async['getSelfInfo'](){}static async[_0x2fcf14(0x1d8)](_0x37b088){}static async['getUserDetailInfo'](_0x5706fe){const _0x3646bb=_0x2fcf14,_0x31742b={'sGOSk':function(_0x300d49,_0x290712){return _0x300d49(_0x290712);},'OaVYQ':_0x3646bb(0x1f7),'sSbeu':function(_0x1be533,_0x2a30c2){return _0x1be533===_0x2a30c2;},'WLFVD':function(_0x55c6fe){return _0x55c6fe();},'numBP':function(_0x5e29f7,_0x47a6eb,_0x570b10){return _0x5e29f7(_0x47a6eb,_0x570b10);}},_0x579a72=napCatCore[_0x3646bb(0x1d7)]['profile'][_0x3646bb(0x1d6)];return new Promise((_0x1fb245,_0x2b7600)=>{const _0x15c507=_0x3646bb,_0x4bc433=_0x31742b['WLFVD'](randomUUID);let _0x1196ff=![];_0x31742b[_0x15c507(0x1e5)](setTimeout,()=>{const _0x32d6a2=_0x15c507;!_0x1196ff&&_0x31742b[_0x32d6a2(0x1ea)](_0x2b7600,_0x31742b['OaVYQ']);},0x1388),userDetailHandlers[_0x15c507(0x1e3)](_0x4bc433,_0x11b418=>{const _0x57c2a7=_0x15c507;_0x31742b[_0x57c2a7(0x1ef)](_0x11b418['uid'],_0x5706fe)&&(_0x1196ff=!![],userDetailHandlers['delete'](_0x4bc433),_0x1fb245(_0x11b418));}),_0x579a72[_0x15c507(0x1ee)](_0x5706fe,[0x0])[_0x15c507(0x1db)](_0x29bd1e=>{});});}static async[_0x2fcf14(0x1f1)](){}static async[_0x2fcf14(0x1f5)](_0x51814e,_0x1eb586){}}
|
13
src/core.lib/src/qqnt/apis/webapi.d.ts
vendored
Normal file
13
src/core.lib/src/qqnt/apis/webapi.d.ts
vendored
Normal file
@ -0,0 +1,13 @@
|
|||||||
|
export declare class WebApi {
|
||||||
|
private static bkn;
|
||||||
|
private static skey;
|
||||||
|
private static pskey;
|
||||||
|
private static cookie;
|
||||||
|
private defaultHeaders;
|
||||||
|
constructor();
|
||||||
|
addGroupDigest(groupCode: string, msgSeq: string): Promise<any>;
|
||||||
|
getGroupDigest(groupCode: string): Promise<any>;
|
||||||
|
private genBkn;
|
||||||
|
private init;
|
||||||
|
private request;
|
||||||
|
}
|
1
src/core.lib/src/qqnt/apis/webapi.js
Normal file
1
src/core.lib/src/qqnt/apis/webapi.js
Normal file
@ -0,0 +1 @@
|
|||||||
|
function _0x259a(_0x1b9711,_0x27a337){const _0x5d7d26=_0x5d7d();return _0x259a=function(_0x259aed,_0x51a275){_0x259aed=_0x259aed-0x1a6;let _0x49c585=_0x5d7d26[_0x259aed];return _0x49c585;},_0x259a(_0x1b9711,_0x27a337);}const _0x1d44f9=_0x259a;function _0x5d7d(){const _0x39f97c=['qrGuG','&msg_seq=','https://qun.qq.com/cgi-bin/group_digest/digest_list?random=665&X-CROSS-ORIGIN=fetch&group_code=','HRZJE','28nprdIM','16737147XokBSw','3162156lIVlJc','&msg_random=444021292','218354wIQpum','getGroupDigest','genBkn','pskey','RAglJ','nAOaX','json','headers','request','addGroupDigest','init','charCodeAt','2566616EeBMzW','SUnoY','include','GET','cookie','toString','Htqvv','bkn','defaultHeaders','4EdNICD','2641620XwewlF','4633585gGPEBp','lOhDm','615640HQEWdu','&bkn='];_0x5d7d=function(){return _0x39f97c;};return _0x5d7d();}(function(_0x29dbc2,_0x1f61fd){const _0x45bbf4=_0x259a,_0x58236a=_0x29dbc2();while(!![]){try{const _0x5d557f=parseInt(_0x45bbf4(0x1b7))/0x1+-parseInt(_0x45bbf4(0x1c3))/0x2+parseInt(_0x45bbf4(0x1b5))/0x3*(-parseInt(_0x45bbf4(0x1a9))/0x4)+parseInt(_0x45bbf4(0x1ab))/0x5+parseInt(_0x45bbf4(0x1aa))/0x6+-parseInt(_0x45bbf4(0x1b3))/0x7*(parseInt(_0x45bbf4(0x1ad))/0x8)+parseInt(_0x45bbf4(0x1b4))/0x9;if(_0x5d557f===_0x1f61fd)break;else _0x58236a['push'](_0x58236a['shift']());}catch(_0x4f27f8){_0x58236a['push'](_0x58236a['shift']());}}}(_0x5d7d,0xc3464));import{log}from'@/common/utils/log';export class WebApi{static [_0x1d44f9(0x1a7)];static ['skey'];static [_0x1d44f9(0x1ba)];static [_0x1d44f9(0x1c7)];[_0x1d44f9(0x1a8)]={'User-Agent':'QQ/8.9.28.635\x20CFNetwork/1312\x20Darwin/21.0.0'};constructor(){}async[_0x1d44f9(0x1c0)](_0x19bac9,_0x34b30e){const _0x5458ef=_0x1d44f9,_0x40814e='https://qun.qq.com/cgi-bin/group_digest/cancel_digest?random=665&X-CROSS-ORIGIN=fetch&group_code='+_0x19bac9+_0x5458ef(0x1b0)+_0x34b30e+_0x5458ef(0x1b6),_0x285b21=await this['request'](_0x40814e);return await _0x285b21[_0x5458ef(0x1bd)]();}async[_0x1d44f9(0x1b8)](_0x5f6465){const _0x2330c7=_0x1d44f9,_0x3e440a={'Htqvv':function(_0x1dee82,_0x3d4f6d){return _0x1dee82(_0x3d4f6d);}},_0x3af767=_0x2330c7(0x1b1)+_0x5f6465+'&page_start=0&page_limit=20',_0x5f000b=await this[_0x2330c7(0x1bf)](_0x3af767);return _0x3e440a[_0x2330c7(0x1a6)](log,_0x5f000b[_0x2330c7(0x1be)]),await _0x5f000b[_0x2330c7(0x1bd)]();}[_0x1d44f9(0x1b9)](_0x1d0bf6){const _0x59e03c=_0x1d44f9,_0x2cf436={'SUTmQ':function(_0x177bec,_0xdcbe98){return _0x177bec<_0xdcbe98;},'RAglJ':function(_0x4c0694,_0x4b9e5d){return _0x4c0694+_0x4b9e5d;},'SUnoY':function(_0x370d8c,_0x3d141c){return _0x370d8c<<_0x3d141c;},'qrGuG':function(_0x31baff,_0x5bddcc){return _0x31baff&_0x5bddcc;}};_0x1d0bf6=_0x1d0bf6||'';let _0x2c07e3=0x1505;for(let _0x21d4d1=0x0;_0x2cf436['SUTmQ'](_0x21d4d1,_0x1d0bf6['length']);_0x21d4d1++){const _0xd49f72=_0x1d0bf6[_0x59e03c(0x1c2)](_0x21d4d1);_0x2c07e3=_0x2cf436[_0x59e03c(0x1bb)](_0x2c07e3+_0x2cf436[_0x59e03c(0x1c4)](_0x2c07e3,0x5),_0xd49f72);}return _0x2cf436[_0x59e03c(0x1af)](_0x2c07e3,0x7fffffff)[_0x59e03c(0x1c8)]();}async[_0x1d44f9(0x1c1)](){if(!WebApi['bkn']){}}async['request'](_0x50aa56,_0x5b0a36=_0x1d44f9(0x1c6),_0x62f02a={}){const _0x4194c5=_0x1d44f9,_0x5c7129={'wOKDy':_0x4194c5(0x1ae),'nAOaX':_0x4194c5(0x1c5),'HRZJE':function(_0x364283,_0x5786da,_0xfdddda,_0x192eb4){return _0x364283(_0x5786da,_0xfdddda,_0x192eb4);},'lOhDm':function(_0x16e2f3,_0x1a8c32,_0x35dda0){return _0x16e2f3(_0x1a8c32,_0x35dda0);}};await this['init'](),_0x50aa56+=_0x5c7129['wOKDy']+WebApi['bkn'];const _0x4dc4c2={...this['defaultHeaders'],..._0x62f02a,'Cookie':WebApi[_0x4194c5(0x1c7)],'credentials':_0x5c7129[_0x4194c5(0x1bc)]};_0x5c7129[_0x4194c5(0x1b2)](log,'request',_0x50aa56,_0x4dc4c2);const _0x138d74={'method':_0x5b0a36,'headers':_0x4dc4c2};return _0x5c7129[_0x4194c5(0x1ac)](fetch,_0x50aa56,_0x138d74);}}
|
11
src/core.lib/src/qqnt/apis/window.d.ts
vendored
Normal file
11
src/core.lib/src/qqnt/apis/window.d.ts
vendored
Normal file
@ -0,0 +1,11 @@
|
|||||||
|
export interface NTQQWindow {
|
||||||
|
windowName: string;
|
||||||
|
windowUrlHash: string;
|
||||||
|
}
|
||||||
|
export declare class NTQQWindows {
|
||||||
|
static GroupHomeWorkWindow: NTQQWindow;
|
||||||
|
static GroupNotifyFilterWindow: NTQQWindow;
|
||||||
|
static GroupEssenceWindow: NTQQWindow;
|
||||||
|
}
|
||||||
|
export declare class NTQQWindowApi {
|
||||||
|
}
|
1
src/core.lib/src/qqnt/apis/window.js
Normal file
1
src/core.lib/src/qqnt/apis/window.js
Normal file
@ -0,0 +1 @@
|
|||||||
|
var _0x5811b1=_0x1b27;(function(_0x2c452c,_0x325f2e){var _0x571cbe=_0x1b27,_0x41c785=_0x2c452c();while(!![]){try{var _0x27a39f=-parseInt(_0x571cbe(0x10a))/0x1*(parseInt(_0x571cbe(0xff))/0x2)+parseInt(_0x571cbe(0x109))/0x3+-parseInt(_0x571cbe(0x104))/0x4*(parseInt(_0x571cbe(0xfd))/0x5)+-parseInt(_0x571cbe(0xfe))/0x6+parseInt(_0x571cbe(0xfb))/0x7*(-parseInt(_0x571cbe(0x103))/0x8)+-parseInt(_0x571cbe(0xfc))/0x9+-parseInt(_0x571cbe(0x100))/0xa*(-parseInt(_0x571cbe(0x106))/0xb);if(_0x27a39f===_0x325f2e)break;else _0x41c785['push'](_0x41c785['shift']());}catch(_0x23c487){_0x41c785['push'](_0x41c785['shift']());}}}(_0x5c44,0xae894));function _0x1b27(_0x1557f4,_0x3d2e9e){var _0x5c44cb=_0x5c44();return _0x1b27=function(_0x1b2736,_0x54d018){_0x1b2736=_0x1b2736-0xfb;var _0x47d46d=_0x5c44cb[_0x1b2736];return _0x47d46d;},_0x1b27(_0x1557f4,_0x3d2e9e);}export class NTQQWindows{static ['GroupHomeWorkWindow']={'windowName':_0x5811b1(0x101),'windowUrlHash':_0x5811b1(0x107)};static [_0x5811b1(0x105)]={'windowName':_0x5811b1(0x105),'windowUrlHash':'#/group-notify-filter'};static [_0x5811b1(0x102)]={'windowName':_0x5811b1(0x102),'windowUrlHash':_0x5811b1(0x108)};}export class NTQQWindowApi{}function _0x5c44(){var _0x48df20=['58840qvqEfd','GroupHomeWorkWindow','GroupEssenceWindow','518944YSwNAE','128xftkxA','GroupNotifyFilterWindow','4279Agnxeo','#/group-home-work','#/group-essence','1891380ABbPkG','1367oewWPE','84fzDtKk','7141716XHlRNS','30315VziGyZ','2466840rrUofs','40XWkrdP'];_0x5c44=function(){return _0x48df20;};return _0x5c44();}
|
58
src/core.lib/src/qqnt/entities/cache.d.ts
vendored
Normal file
58
src/core.lib/src/qqnt/entities/cache.d.ts
vendored
Normal file
@ -0,0 +1,58 @@
|
|||||||
|
import { ChatType } from './msg';
|
||||||
|
export interface CacheScanResult {
|
||||||
|
result: number;
|
||||||
|
size: [
|
||||||
|
string,
|
||||||
|
string,
|
||||||
|
string,
|
||||||
|
string,
|
||||||
|
string,
|
||||||
|
string,
|
||||||
|
string,
|
||||||
|
string,
|
||||||
|
string
|
||||||
|
];
|
||||||
|
}
|
||||||
|
export interface ChatCacheList {
|
||||||
|
pageCount: number;
|
||||||
|
infos: ChatCacheListItem[];
|
||||||
|
}
|
||||||
|
export interface ChatCacheListItem {
|
||||||
|
chatType: ChatType;
|
||||||
|
basicChatCacheInfo: ChatCacheListItemBasic;
|
||||||
|
guildChatCacheInfo: unknown[];
|
||||||
|
}
|
||||||
|
export interface ChatCacheListItemBasic {
|
||||||
|
chatSize: string;
|
||||||
|
chatTime: string;
|
||||||
|
uid: string;
|
||||||
|
uin: string;
|
||||||
|
remarkName: string;
|
||||||
|
nickName: string;
|
||||||
|
chatType?: ChatType;
|
||||||
|
isChecked?: boolean;
|
||||||
|
}
|
||||||
|
export declare enum CacheFileType {
|
||||||
|
IMAGE = 0,
|
||||||
|
VIDEO = 1,
|
||||||
|
AUDIO = 2,
|
||||||
|
DOCUMENT = 3,
|
||||||
|
OTHER = 4
|
||||||
|
}
|
||||||
|
export interface CacheFileList {
|
||||||
|
infos: CacheFileListItem[];
|
||||||
|
}
|
||||||
|
export interface CacheFileListItem {
|
||||||
|
fileSize: string;
|
||||||
|
fileTime: string;
|
||||||
|
fileKey: string;
|
||||||
|
elementId: string;
|
||||||
|
elementIdStr: string;
|
||||||
|
fileType: CacheFileType;
|
||||||
|
path: string;
|
||||||
|
fileName: string;
|
||||||
|
senderId: string;
|
||||||
|
previewPath: string;
|
||||||
|
senderName: string;
|
||||||
|
isChecked?: boolean;
|
||||||
|
}
|
1
src/core.lib/src/qqnt/entities/cache.js
Normal file
1
src/core.lib/src/qqnt/entities/cache.js
Normal file
@ -0,0 +1 @@
|
|||||||
|
(function(_0x4f558f,_0x3d5d0a){var _0x53741d=_0x4e77,_0x1e567c=_0x4f558f();while(!![]){try{var _0x24be65=parseInt(_0x53741d(0x1c9))/0x1+-parseInt(_0x53741d(0x1c8))/0x2+-parseInt(_0x53741d(0x1cb))/0x3*(parseInt(_0x53741d(0x1c2))/0x4)+parseInt(_0x53741d(0x1d0))/0x5+parseInt(_0x53741d(0x1c1))/0x6+-parseInt(_0x53741d(0x1c4))/0x7*(parseInt(_0x53741d(0x1cf))/0x8)+-parseInt(_0x53741d(0x1c0))/0x9;if(_0x24be65===_0x3d5d0a)break;else _0x1e567c['push'](_0x1e567c['shift']());}catch(_0x47dbc8){_0x1e567c['push'](_0x1e567c['shift']());}}}(_0x4471,0xc801e));export var CacheFileType;function _0x4e77(_0xc9c32d,_0x11bf9c){var _0x44713f=_0x4471();return _0x4e77=function(_0x4e772f,_0x10fabe){_0x4e772f=_0x4e772f-0x1bf;var _0x2b02e5=_0x44713f[_0x4e772f];return _0x2b02e5;},_0x4e77(_0xc9c32d,_0x11bf9c);}function _0x4471(){var _0x5ada04=['1537921rkwNyv','3|1|4|2|0','12hWfcjq','pSJjv','cBhUo','split','4562672iQfBMK','1628855djlRgU','DOCUMENT','uDtes','KgoRy','1197702ZPFDWj','1046046YXSIfz','251824jeIdER','OTHER','7wcFfgX','osuEc','VIDEO','IMAGE','527134AHvlPR'];_0x4471=function(){return _0x5ada04;};return _0x4471();}(function(_0xd3ea3a){var _0x1afd11=_0x4e77,_0x977432={'YGtuD':_0x1afd11(0x1ca),'cBhUo':_0x1afd11(0x1c3),'KgoRy':_0x1afd11(0x1c6),'uDtes':_0x1afd11(0x1d1),'osuEc':_0x1afd11(0x1c7),'pSJjv':'AUDIO'},_0x46fd8e=_0x977432['YGtuD'][_0x1afd11(0x1ce)]('|'),_0x1ff8cd=0x0;while(!![]){switch(_0x46fd8e[_0x1ff8cd++]){case'0':_0xd3ea3a[_0xd3ea3a[_0x977432['cBhUo']]=0x4]=_0x977432[_0x1afd11(0x1cd)];continue;case'1':_0xd3ea3a[_0xd3ea3a[_0x977432['KgoRy']]=0x1]=_0x977432[_0x1afd11(0x1bf)];continue;case'2':_0xd3ea3a[_0xd3ea3a[_0x977432[_0x1afd11(0x1d2)]]=0x3]=_0x977432[_0x1afd11(0x1d2)];continue;case'3':_0xd3ea3a[_0xd3ea3a[_0x977432[_0x1afd11(0x1c5)]]=0x0]=_0x1afd11(0x1c7);continue;case'4':_0xd3ea3a[_0xd3ea3a[_0x977432[_0x1afd11(0x1cc)]]=0x2]=_0x977432[_0x1afd11(0x1cc)];continue;}break;}}(CacheFileType||(CacheFileType={})));
|
12
src/core.lib/src/qqnt/entities/constructor.d.ts
vendored
Normal file
12
src/core.lib/src/qqnt/entities/constructor.d.ts
vendored
Normal file
@ -0,0 +1,12 @@
|
|||||||
|
import { AtType, SendArkElement, SendFaceElement, SendFileElement, SendPicElement, SendPttElement, SendReplyElement, SendTextElement, SendVideoElement } from '../entities';
|
||||||
|
export declare class SendMsgElementConstructor {
|
||||||
|
static text(content: string): SendTextElement;
|
||||||
|
static at(atUid: string, atNtUid: string, atType: AtType, atName: string): SendTextElement;
|
||||||
|
static reply(msgSeq: string, msgId: string, senderUin: string, senderUinStr: string): SendReplyElement;
|
||||||
|
static pic(picPath: string, summary?: string, subType?: 0 | 1): Promise<SendPicElement>;
|
||||||
|
static file(filePath: string, fileName?: string): Promise<SendFileElement>;
|
||||||
|
static video(filePath: string, fileName?: string, diyThumbPath?: string): Promise<SendVideoElement>;
|
||||||
|
static ptt(pttPath: string): Promise<SendPttElement>;
|
||||||
|
static face(faceId: number): SendFaceElement;
|
||||||
|
static ark(data: any): SendArkElement;
|
||||||
|
}
|
1
src/core.lib/src/qqnt/entities/constructor.js
Normal file
1
src/core.lib/src/qqnt/entities/constructor.js
Normal file
File diff suppressed because one or more lines are too long
52
src/core.lib/src/qqnt/entities/group.d.ts
vendored
Normal file
52
src/core.lib/src/qqnt/entities/group.d.ts
vendored
Normal file
@ -0,0 +1,52 @@
|
|||||||
|
import { QQLevel, Sex } from './user';
|
||||||
|
export interface Group {
|
||||||
|
groupCode: string;
|
||||||
|
maxMember: number;
|
||||||
|
memberCount: number;
|
||||||
|
groupName: string;
|
||||||
|
groupStatus: 0;
|
||||||
|
memberRole: 2;
|
||||||
|
isTop: boolean;
|
||||||
|
toppedTimestamp: '0';
|
||||||
|
privilegeFlag: number;
|
||||||
|
isConf: boolean;
|
||||||
|
hasModifyConfGroupFace: boolean;
|
||||||
|
hasModifyConfGroupName: boolean;
|
||||||
|
remarkName: string;
|
||||||
|
hasMemo: boolean;
|
||||||
|
groupShutupExpireTime: string;
|
||||||
|
personShutupExpireTime: string;
|
||||||
|
discussToGroupUin: string;
|
||||||
|
discussToGroupMaxMsgSeq: number;
|
||||||
|
discussToGroupTime: number;
|
||||||
|
groupFlagExt: number;
|
||||||
|
authGroupType: number;
|
||||||
|
groupCreditLevel: number;
|
||||||
|
groupFlagExt3: number;
|
||||||
|
groupOwnerId: {
|
||||||
|
'memberUin': string;
|
||||||
|
'memberUid': string;
|
||||||
|
};
|
||||||
|
}
|
||||||
|
export declare enum GroupMemberRole {
|
||||||
|
normal = 2,
|
||||||
|
admin = 3,
|
||||||
|
owner = 4
|
||||||
|
}
|
||||||
|
export interface GroupMember {
|
||||||
|
memberSpecialTitle?: string;
|
||||||
|
avatarPath: string;
|
||||||
|
cardName: string;
|
||||||
|
cardType: number;
|
||||||
|
isDelete: boolean;
|
||||||
|
nick: string;
|
||||||
|
qid: string;
|
||||||
|
remark: string;
|
||||||
|
role: GroupMemberRole;
|
||||||
|
shutUpTime: number;
|
||||||
|
uid: string;
|
||||||
|
uin: string;
|
||||||
|
isRobot: boolean;
|
||||||
|
sex?: Sex;
|
||||||
|
qqLevel?: QQLevel;
|
||||||
|
}
|
1
src/core.lib/src/qqnt/entities/group.js
Normal file
1
src/core.lib/src/qqnt/entities/group.js
Normal file
@ -0,0 +1 @@
|
|||||||
|
(function(_0x3b809c,_0x12e711){var _0x4cfe1e=_0x3df0,_0x55527b=_0x3b809c();while(!![]){try{var _0x3fcec8=-parseInt(_0x4cfe1e(0x197))/0x1+parseInt(_0x4cfe1e(0x19c))/0x2*(parseInt(_0x4cfe1e(0x19b))/0x3)+-parseInt(_0x4cfe1e(0x190))/0x4*(parseInt(_0x4cfe1e(0x195))/0x5)+parseInt(_0x4cfe1e(0x192))/0x6+parseInt(_0x4cfe1e(0x193))/0x7+-parseInt(_0x4cfe1e(0x194))/0x8+parseInt(_0x4cfe1e(0x18f))/0x9;if(_0x3fcec8===_0x12e711)break;else _0x55527b['push'](_0x55527b['shift']());}catch(_0x2144bb){_0x55527b['push'](_0x55527b['shift']());}}}(_0x58b6,0x95498));function _0x3df0(_0x2c142e,_0xeb1da3){var _0x58b6a0=_0x58b6();return _0x3df0=function(_0x3df075,_0x57dcda){_0x3df075=_0x3df075-0x18e;var _0x5a154c=_0x58b6a0[_0x3df075];return _0x5a154c;},_0x3df0(_0x2c142e,_0xeb1da3);}function _0x58b6(){var _0x456557=['480149gxGskS','admin','iXpHz','JWprw','1011849FDTpgR','2wJNXBH','owner','6720813HBNPqr','84328PCWAki','normal','2989332Ymgxzx','1769110XWnlev','549912zvFFtB','160notdSQ','fLDzT'];_0x58b6=function(){return _0x456557;};return _0x58b6();}export var GroupMemberRole;(function(_0x5f0330){var _0x5944b4=_0x3df0,_0x6c7a25={'fLDzT':_0x5944b4(0x191),'JWprw':_0x5944b4(0x198),'iXpHz':_0x5944b4(0x18e)};_0x5f0330[_0x5f0330[_0x6c7a25[_0x5944b4(0x196)]]=0x2]=_0x6c7a25[_0x5944b4(0x196)],_0x5f0330[_0x5f0330[_0x6c7a25[_0x5944b4(0x19a)]]=0x3]=_0x6c7a25[_0x5944b4(0x19a)],_0x5f0330[_0x5f0330[_0x5944b4(0x18e)]=0x4]=_0x6c7a25[_0x5944b4(0x199)];}(GroupMemberRole||(GroupMemberRole={})));
|
6
src/core.lib/src/qqnt/entities/index.d.ts
vendored
Normal file
6
src/core.lib/src/qqnt/entities/index.d.ts
vendored
Normal file
@ -0,0 +1,6 @@
|
|||||||
|
export * from './user';
|
||||||
|
export * from './group';
|
||||||
|
export * from './msg';
|
||||||
|
export * from './notify';
|
||||||
|
export * from './cache';
|
||||||
|
export * from './constructor';
|
1
src/core.lib/src/qqnt/entities/index.js
Normal file
1
src/core.lib/src/qqnt/entities/index.js
Normal file
@ -0,0 +1 @@
|
|||||||
|
(function(_0x4aec37,_0x5727e8){var _0x2bf161=_0x156b,_0x2e030b=_0x4aec37();while(!![]){try{var _0x37e072=-parseInt(_0x2bf161(0x1c3))/0x1*(parseInt(_0x2bf161(0x1ca))/0x2)+parseInt(_0x2bf161(0x1cc))/0x3+-parseInt(_0x2bf161(0x1c8))/0x4*(-parseInt(_0x2bf161(0x1cb))/0x5)+parseInt(_0x2bf161(0x1c4))/0x6+parseInt(_0x2bf161(0x1c7))/0x7+parseInt(_0x2bf161(0x1c5))/0x8*(-parseInt(_0x2bf161(0x1c6))/0x9)+-parseInt(_0x2bf161(0x1c9))/0xa;if(_0x37e072===_0x5727e8)break;else _0x2e030b['push'](_0x2e030b['shift']());}catch(_0x52560f){_0x2e030b['push'](_0x2e030b['shift']());}}}(_0x1597,0x518f4));export*from'./user';export*from'./group';export*from'./msg';function _0x156b(_0x307b38,_0x498ea9){var _0x1597a5=_0x1597();return _0x156b=function(_0x156b28,_0x241555){_0x156b28=_0x156b28-0x1c3;var _0x44f011=_0x1597a5[_0x156b28];return _0x44f011;},_0x156b(_0x307b38,_0x498ea9);}export*from'./notify';export*from'./cache';export*from'./constructor';function _0x1597(){var _0x5a94e3=['27HSZtIO','1690010IevKNb','16Dxmetv','4445660SDEyGC','6njCwBw','403825VOnQHg','1234608xWmbtB','175774RztaFW','2347662fUZhOR','163592kIZpDR'];_0x1597=function(){return _0x5a94e3;};return _0x1597();}
|
383
src/core.lib/src/qqnt/entities/msg.d.ts
vendored
Normal file
383
src/core.lib/src/qqnt/entities/msg.d.ts
vendored
Normal file
@ -0,0 +1,383 @@
|
|||||||
|
import { GroupMemberRole } from './group';
|
||||||
|
export interface Peer {
|
||||||
|
chatType: ChatType;
|
||||||
|
peerUid: string;
|
||||||
|
guildId?: '';
|
||||||
|
}
|
||||||
|
export declare enum ElementType {
|
||||||
|
TEXT = 1,
|
||||||
|
PIC = 2,
|
||||||
|
FILE = 3,
|
||||||
|
PTT = 4,
|
||||||
|
VIDEO = 5,
|
||||||
|
FACE = 6,
|
||||||
|
REPLY = 7,
|
||||||
|
ARK = 10
|
||||||
|
}
|
||||||
|
export interface SendTextElement {
|
||||||
|
elementType: ElementType.TEXT;
|
||||||
|
elementId: '';
|
||||||
|
textElement: {
|
||||||
|
content: string;
|
||||||
|
atType: number;
|
||||||
|
atUid: string;
|
||||||
|
atTinyId: string;
|
||||||
|
atNtUid: string;
|
||||||
|
};
|
||||||
|
}
|
||||||
|
export interface SendPttElement {
|
||||||
|
elementType: ElementType.PTT;
|
||||||
|
elementId: '';
|
||||||
|
pttElement: {
|
||||||
|
fileName: string;
|
||||||
|
filePath: string;
|
||||||
|
md5HexStr: string;
|
||||||
|
fileSize: number;
|
||||||
|
duration: number;
|
||||||
|
formatType: number;
|
||||||
|
voiceType: number;
|
||||||
|
voiceChangeType: number;
|
||||||
|
canConvert2Text: boolean;
|
||||||
|
waveAmplitudes: number[];
|
||||||
|
fileSubId: '';
|
||||||
|
playState: number;
|
||||||
|
autoConvertText: number;
|
||||||
|
};
|
||||||
|
}
|
||||||
|
export declare enum PicType {
|
||||||
|
gif = 2000,
|
||||||
|
jpg = 1000
|
||||||
|
}
|
||||||
|
export declare enum PicSubType {
|
||||||
|
normal = 0,// 普通图片,大图
|
||||||
|
face = 1
|
||||||
|
}
|
||||||
|
export interface SendPicElement {
|
||||||
|
elementType: ElementType.PIC;
|
||||||
|
elementId: '';
|
||||||
|
picElement: {
|
||||||
|
md5HexStr: string;
|
||||||
|
fileSize: number | string;
|
||||||
|
picWidth: number;
|
||||||
|
picHeight: number;
|
||||||
|
fileName: string;
|
||||||
|
sourcePath: string;
|
||||||
|
original: boolean;
|
||||||
|
picType: PicType;
|
||||||
|
picSubType: PicSubType;
|
||||||
|
fileUuid: string;
|
||||||
|
fileSubId: string;
|
||||||
|
thumbFileSize: number;
|
||||||
|
summary: string;
|
||||||
|
};
|
||||||
|
}
|
||||||
|
export interface SendReplyElement {
|
||||||
|
elementType: ElementType.REPLY;
|
||||||
|
elementId: '';
|
||||||
|
replyElement: {
|
||||||
|
replayMsgSeq: string;
|
||||||
|
replayMsgId: string;
|
||||||
|
senderUin: string;
|
||||||
|
senderUinStr: string;
|
||||||
|
};
|
||||||
|
}
|
||||||
|
export interface SendFaceElement {
|
||||||
|
elementType: ElementType.FACE;
|
||||||
|
elementId: '';
|
||||||
|
faceElement: FaceElement;
|
||||||
|
}
|
||||||
|
export interface FileElement {
|
||||||
|
'fileMd5'?: '';
|
||||||
|
'fileName': string;
|
||||||
|
'filePath': string;
|
||||||
|
fileSize: string;
|
||||||
|
'picHeight'?: number;
|
||||||
|
'picWidth'?: number;
|
||||||
|
'picThumbPath'?: Map<number, string>;
|
||||||
|
'file10MMd5'?: '';
|
||||||
|
'fileSha'?: '';
|
||||||
|
'fileSha3'?: '';
|
||||||
|
'fileUuid'?: '';
|
||||||
|
'fileSubId'?: '';
|
||||||
|
'thumbFileSize'?: number;
|
||||||
|
fileBizId?: number;
|
||||||
|
}
|
||||||
|
export interface SendFileElement {
|
||||||
|
elementType: ElementType.FILE;
|
||||||
|
elementId: '';
|
||||||
|
fileElement: FileElement;
|
||||||
|
}
|
||||||
|
export interface SendVideoElement {
|
||||||
|
elementType: ElementType.VIDEO;
|
||||||
|
elementId: '';
|
||||||
|
videoElement: VideoElement;
|
||||||
|
}
|
||||||
|
export interface SendArkElement {
|
||||||
|
elementType: ElementType.ARK;
|
||||||
|
elementId: '';
|
||||||
|
arkElement: ArkElement;
|
||||||
|
}
|
||||||
|
export type SendMessageElement = SendTextElement | SendPttElement | SendPicElement | SendReplyElement | SendFaceElement | SendFileElement | SendVideoElement | SendArkElement;
|
||||||
|
export declare enum AtType {
|
||||||
|
notAt = 0,
|
||||||
|
atAll = 1,
|
||||||
|
atUser = 2
|
||||||
|
}
|
||||||
|
export declare enum ChatType {
|
||||||
|
friend = 1,
|
||||||
|
group = 2,
|
||||||
|
temp = 100
|
||||||
|
}
|
||||||
|
export interface PttElement {
|
||||||
|
canConvert2Text: boolean;
|
||||||
|
duration: number;
|
||||||
|
fileBizId: null;
|
||||||
|
fileId: number;
|
||||||
|
fileName: string;
|
||||||
|
filePath: string;
|
||||||
|
fileSize: string;
|
||||||
|
fileSubId: string;
|
||||||
|
fileUuid: string;
|
||||||
|
formatType: string;
|
||||||
|
invalidState: number;
|
||||||
|
md5HexStr: string;
|
||||||
|
playState: number;
|
||||||
|
progress: number;
|
||||||
|
text: string;
|
||||||
|
transferStatus: number;
|
||||||
|
translateStatus: number;
|
||||||
|
voiceChangeType: number;
|
||||||
|
voiceType: number;
|
||||||
|
waveAmplitudes: number[];
|
||||||
|
}
|
||||||
|
export interface ArkElement {
|
||||||
|
bytesData: string;
|
||||||
|
linkInfo: null;
|
||||||
|
subElementType: null;
|
||||||
|
}
|
||||||
|
export declare const IMAGE_HTTP_HOST = "https://gchat.qpic.cn";
|
||||||
|
export declare const IMAGE_HTTP_HOST_NT = "https://multimedia.nt.qq.com.cn";
|
||||||
|
export interface PicElement {
|
||||||
|
originImageUrl: string;
|
||||||
|
originImageMd5?: string;
|
||||||
|
sourcePath: string;
|
||||||
|
thumbPath: Map<number, string>;
|
||||||
|
picWidth: number;
|
||||||
|
picHeight: number;
|
||||||
|
fileSize: number;
|
||||||
|
fileName: string;
|
||||||
|
fileUuid: string;
|
||||||
|
md5HexStr?: string;
|
||||||
|
}
|
||||||
|
export declare enum GrayTipElementSubType {
|
||||||
|
INVITE_NEW_MEMBER = 12,
|
||||||
|
MEMBER_NEW_TITLE = 17
|
||||||
|
}
|
||||||
|
export interface GrayTipElement {
|
||||||
|
subElementType: GrayTipElementSubType;
|
||||||
|
revokeElement: {
|
||||||
|
operatorRole: string;
|
||||||
|
operatorUid: string;
|
||||||
|
operatorNick: string;
|
||||||
|
operatorRemark: string;
|
||||||
|
operatorMemRemark?: string;
|
||||||
|
wording: string;
|
||||||
|
};
|
||||||
|
aioOpGrayTipElement: TipAioOpGrayTipElement;
|
||||||
|
groupElement: TipGroupElement;
|
||||||
|
xmlElement: {
|
||||||
|
content: string;
|
||||||
|
};
|
||||||
|
jsonGrayTipElement: {
|
||||||
|
jsonStr: string;
|
||||||
|
};
|
||||||
|
}
|
||||||
|
export interface FaceElement {
|
||||||
|
faceIndex: number;
|
||||||
|
faceType: 1;
|
||||||
|
}
|
||||||
|
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;
|
||||||
|
}
|
||||||
|
export interface VideoElement {
|
||||||
|
'filePath': string;
|
||||||
|
'fileName': string;
|
||||||
|
'videoMd5'?: string;
|
||||||
|
'thumbMd5'?: string;
|
||||||
|
'fileTime'?: number;
|
||||||
|
'thumbSize'?: number;
|
||||||
|
'fileFormat'?: number;
|
||||||
|
'fileSize'?: string;
|
||||||
|
'thumbWidth'?: number;
|
||||||
|
'thumbHeight'?: number;
|
||||||
|
'busiType'?: 0;
|
||||||
|
'subBusiType'?: 0;
|
||||||
|
'thumbPath'?: Map<number, any>;
|
||||||
|
'transferStatus'?: 0;
|
||||||
|
'progress'?: 0;
|
||||||
|
'invalidState'?: 0;
|
||||||
|
'fileUuid'?: string;
|
||||||
|
'fileSubId'?: '';
|
||||||
|
'fileBizId'?: null;
|
||||||
|
'originVideoMd5'?: '';
|
||||||
|
'import_rich_media_context'?: null;
|
||||||
|
'sourceVideoCodecFormat'?: number;
|
||||||
|
}
|
||||||
|
export interface MarkdownElement {
|
||||||
|
content: string;
|
||||||
|
}
|
||||||
|
export interface InlineKeyboardElementRowButton {
|
||||||
|
'id': '';
|
||||||
|
'label': string;
|
||||||
|
'visitedLabel': string;
|
||||||
|
'style': 1;
|
||||||
|
'type': 2;
|
||||||
|
'clickLimit': 0;
|
||||||
|
'unsupportTips': '请升级新版手机QQ';
|
||||||
|
'data': string;
|
||||||
|
'atBotShowChannelList': false;
|
||||||
|
'permissionType': 2;
|
||||||
|
'specifyRoleIds': [];
|
||||||
|
'specifyTinyids': [];
|
||||||
|
'isReply': false;
|
||||||
|
'anchor': 0;
|
||||||
|
'enter': false;
|
||||||
|
'subscribeDataTemplateIds': [];
|
||||||
|
}
|
||||||
|
export interface InlineKeyboardElement {
|
||||||
|
rows: [
|
||||||
|
{
|
||||||
|
buttons: InlineKeyboardElementRowButton[];
|
||||||
|
}
|
||||||
|
];
|
||||||
|
}
|
||||||
|
export interface TipAioOpGrayTipElement {
|
||||||
|
operateType: number;
|
||||||
|
peerUid: string;
|
||||||
|
fromGrpCodeOfTmpChat: string;
|
||||||
|
}
|
||||||
|
export declare enum TipGroupElementType {
|
||||||
|
memberIncrease = 1,
|
||||||
|
kicked = 3,// 被移出群
|
||||||
|
ban = 8
|
||||||
|
}
|
||||||
|
export interface TipGroupElement {
|
||||||
|
'type': TipGroupElementType;
|
||||||
|
'role': 0;
|
||||||
|
'groupName': string;
|
||||||
|
'memberUid': string;
|
||||||
|
'memberNick': string;
|
||||||
|
'memberRemark': string;
|
||||||
|
'adminUid': string;
|
||||||
|
'adminNick': string;
|
||||||
|
'adminRemark': string;
|
||||||
|
'createGroup': null;
|
||||||
|
'memberAdd'?: {
|
||||||
|
'showType': 1;
|
||||||
|
'otherAdd': null;
|
||||||
|
'otherAddByOtherQRCode': null;
|
||||||
|
'otherAddByYourQRCode': null;
|
||||||
|
'youAddByOtherQRCode': null;
|
||||||
|
'otherInviteOther': null;
|
||||||
|
'otherInviteYou': null;
|
||||||
|
'youInviteOther': null;
|
||||||
|
};
|
||||||
|
'shutUp'?: {
|
||||||
|
'curTime': string;
|
||||||
|
'duration': string;
|
||||||
|
'admin': {
|
||||||
|
'uid': string;
|
||||||
|
'card': string;
|
||||||
|
'name': string;
|
||||||
|
'role': GroupMemberRole;
|
||||||
|
};
|
||||||
|
'member': {
|
||||||
|
'uid': string;
|
||||||
|
'card': string;
|
||||||
|
'name': string;
|
||||||
|
'role': GroupMemberRole;
|
||||||
|
};
|
||||||
|
};
|
||||||
|
}
|
||||||
|
export interface MultiForwardMsgElement {
|
||||||
|
xmlContent: string;
|
||||||
|
resId: string;
|
||||||
|
fileName: string;
|
||||||
|
}
|
||||||
|
export interface RawMessage {
|
||||||
|
id?: number;
|
||||||
|
msgId: string;
|
||||||
|
msgTime: string;
|
||||||
|
msgSeq: string;
|
||||||
|
senderUid: string;
|
||||||
|
senderUin: string;
|
||||||
|
peerUid: string;
|
||||||
|
peerUin: string;
|
||||||
|
sendNickName: string;
|
||||||
|
sendMemberName?: string;
|
||||||
|
chatType: ChatType;
|
||||||
|
sendStatus?: number;
|
||||||
|
recallTime: string;
|
||||||
|
elements: {
|
||||||
|
elementId: string;
|
||||||
|
elementType: ElementType;
|
||||||
|
replyElement: {
|
||||||
|
senderUid: string;
|
||||||
|
sourceMsgIsIncPic: boolean;
|
||||||
|
sourceMsgText: string;
|
||||||
|
replayMsgSeq: string;
|
||||||
|
};
|
||||||
|
textElement: {
|
||||||
|
atType: AtType;
|
||||||
|
atUid: string;
|
||||||
|
content: string;
|
||||||
|
atNtUid: string;
|
||||||
|
};
|
||||||
|
picElement: PicElement;
|
||||||
|
pttElement: PttElement;
|
||||||
|
arkElement: ArkElement;
|
||||||
|
grayTipElement: GrayTipElement;
|
||||||
|
faceElement: FaceElement;
|
||||||
|
videoElement: VideoElement;
|
||||||
|
fileElement: FileElement;
|
||||||
|
marketFaceElement: MarketFaceElement;
|
||||||
|
inlineKeyboardElement: InlineKeyboardElement;
|
||||||
|
markdownElement: MarkdownElement;
|
||||||
|
multiForwardMsgElement: MultiForwardMsgElement;
|
||||||
|
}[];
|
||||||
|
}
|
1
src/core.lib/src/qqnt/entities/msg.js
Normal file
1
src/core.lib/src/qqnt/entities/msg.js
Normal file
@ -0,0 +1 @@
|
|||||||
|
var _0x380a5d=_0x93f1;(function(_0x583bb8,_0x2a3307){var _0x2228db=_0x93f1,_0xe558cc=_0x583bb8();while(!![]){try{var _0x2de15e=parseInt(_0x2228db(0x91))/0x1+-parseInt(_0x2228db(0xa4))/0x2*(parseInt(_0x2228db(0x7f))/0x3)+-parseInt(_0x2228db(0x98))/0x4*(parseInt(_0x2228db(0x81))/0x5)+parseInt(_0x2228db(0xa2))/0x6*(parseInt(_0x2228db(0xac))/0x7)+parseInt(_0x2228db(0x99))/0x8+-parseInt(_0x2228db(0xaa))/0x9*(parseInt(_0x2228db(0x94))/0xa)+-parseInt(_0x2228db(0x8c))/0xb;if(_0x2de15e===_0x2a3307)break;else _0xe558cc['push'](_0xe558cc['shift']());}catch(_0x5bef68){_0xe558cc['push'](_0xe558cc['shift']());}}}(_0x3c91,0xd224c));export var ElementType;(function(_0x3ba10c){var _0x5874fe=_0x93f1,_0x48b110={'KdIkA':'2|3|1|0|6|7|4|5','xylON':'PTT','DHCPs':_0x5874fe(0x7a),'JvYWJ':_0x5874fe(0x83),'OiOJU':'ARK','AthuZ':_0x5874fe(0xa1),'aLVAo':_0x5874fe(0xa5)},_0x4759c1=_0x48b110['KdIkA'][_0x5874fe(0x97)]('|'),_0x170c07=0x0;while(!![]){switch(_0x4759c1[_0x170c07++]){case'0':_0x3ba10c[_0x3ba10c[_0x48b110[_0x5874fe(0x9a)]]=0x4]=_0x48b110['xylON'];continue;case'1':_0x3ba10c[_0x3ba10c[_0x5874fe(0x86)]=0x3]='FILE';continue;case'2':_0x3ba10c[_0x3ba10c[_0x48b110[_0x5874fe(0xa3)]]=0x1]=_0x48b110[_0x5874fe(0xa3)];continue;case'3':_0x3ba10c[_0x3ba10c[_0x48b110[_0x5874fe(0x88)]]=0x2]=_0x5874fe(0x83);continue;case'4':_0x3ba10c[_0x3ba10c[_0x5874fe(0x8a)]=0x7]=_0x5874fe(0x8a);continue;case'5':_0x3ba10c[_0x3ba10c[_0x5874fe(0x89)]=0xa]=_0x48b110[_0x5874fe(0x9e)];continue;case'6':_0x3ba10c[_0x3ba10c[_0x5874fe(0xa1)]=0x5]=_0x48b110[_0x5874fe(0x90)];continue;case'7':_0x3ba10c[_0x3ba10c[_0x48b110[_0x5874fe(0x8b)]]=0x6]=_0x48b110[_0x5874fe(0x8b)];continue;}break;}}(ElementType||(ElementType={})));export var PicType;(function(_0x5d58b6){var _0x4d64a6=_0x93f1,_0x95eff1={'EERpa':'gif','eaMSH':_0x4d64a6(0x7e)};_0x5d58b6[_0x5d58b6[_0x95eff1['EERpa']]=0x7d0]=_0x95eff1[_0x4d64a6(0x9d)],_0x5d58b6[_0x5d58b6[_0x95eff1['eaMSH']]=0x3e8]=_0x4d64a6(0x7e);}(PicType||(PicType={})));export var PicSubType;(function(_0x1d8184){var _0x5c9ccf=_0x93f1,_0x1d04b8={'ggouO':_0x5c9ccf(0x8f),'mkcOS':_0x5c9ccf(0x84)};_0x1d8184[_0x1d8184[_0x1d04b8[_0x5c9ccf(0x7d)]]=0x0]=_0x5c9ccf(0x8f),_0x1d8184[_0x1d8184[_0x1d04b8['mkcOS']]=0x1]=_0x1d04b8[_0x5c9ccf(0xab)];}(PicSubType||(PicSubType={})));export var AtType;(function(_0x27d290){var _0x13b14d=_0x93f1,_0x26a76b={'Xdmya':_0x13b14d(0x87),'IbfBx':'atAll','mfxcn':_0x13b14d(0x9c)};_0x27d290[_0x27d290[_0x13b14d(0x87)]=0x0]=_0x26a76b[_0x13b14d(0x8e)],_0x27d290[_0x27d290[_0x26a76b[_0x13b14d(0xa6)]]=0x1]=_0x26a76b[_0x13b14d(0xa6)],_0x27d290[_0x27d290[_0x26a76b[_0x13b14d(0x85)]]=0x2]='atUser';}(AtType||(AtType={})));function _0x93f1(_0x3bf496,_0x2fca5a){var _0x3c9149=_0x3c91();return _0x93f1=function(_0x93f1ed,_0x2d5a2d){_0x93f1ed=_0x93f1ed-0x79;var _0x3cae91=_0x3c9149[_0x93f1ed];return _0x3cae91;},_0x93f1(_0x3bf496,_0x2fca5a);}export var ChatType;(function(_0x126265){var _0x3f7311=_0x93f1,_0x335da8={'FzQcX':_0x3f7311(0x95),'YxHnj':_0x3f7311(0x80),'IdwfN':_0x3f7311(0x7b)};_0x126265[_0x126265[_0x335da8[_0x3f7311(0xa7)]]=0x1]=_0x335da8[_0x3f7311(0xa7)],_0x126265[_0x126265[_0x335da8[_0x3f7311(0xa0)]]=0x2]=_0x335da8[_0x3f7311(0xa0)],_0x126265[_0x126265[_0x335da8[_0x3f7311(0xa9)]]=0x64]=_0x335da8['IdwfN'];}(ChatType||(ChatType={})));export const IMAGE_HTTP_HOST='https://gchat.qpic.cn';export const IMAGE_HTTP_HOST_NT=_0x380a5d(0x9b);export var GrayTipElementSubType;function _0x3c91(){var _0x4ea8a4=['AthuZ','1402566wFyNKz','ban','kicked','5356090oZphpv','friend','zZHnf','split','4zGBcQl','10918240rEkfzF','xylON','https://multimedia.nt.qq.com.cn','atUser','EERpa','OiOJU','MEMBER_NEW_TITLE','YxHnj','VIDEO','146766mETWuf','DHCPs','2562214MbtQsu','FACE','IbfBx','FzQcX','dRcSI','IdwfN','9seQAGF','mkcOS','490hvsLYe','QEFau','TEXT','temp','WbbAO','ggouO','jpg','3mVCOsj','group','5690145dJFXHJ','Avzfl','PIC','face','mfxcn','FILE','notAt','JvYWJ','ARK','REPLY','aLVAo','7305353ImqxAs','INVITE_NEW_MEMBER','Xdmya','normal'];_0x3c91=function(){return _0x4ea8a4;};return _0x3c91();}(function(_0x33dac3){var _0xa7fdfa=_0x380a5d,_0x78b66d={'zZHnf':_0xa7fdfa(0x8d),'Avzfl':_0xa7fdfa(0x9f)};_0x33dac3[_0x33dac3[_0x78b66d[_0xa7fdfa(0x96)]]=0xc]=_0x78b66d[_0xa7fdfa(0x96)],_0x33dac3[_0x33dac3[_0x78b66d[_0xa7fdfa(0x82)]]=0x11]=_0x78b66d['Avzfl'];}(GrayTipElementSubType||(GrayTipElementSubType={})));export var TipGroupElementType;(function(_0x4d4c90){var _0x4523ef=_0x380a5d,_0x25ba23={'QEFau':'memberIncrease','WbbAO':_0x4523ef(0x93),'dRcSI':_0x4523ef(0x92)};_0x4d4c90[_0x4d4c90[_0x25ba23[_0x4523ef(0x79)]]=0x1]=_0x25ba23[_0x4523ef(0x79)],_0x4d4c90[_0x4d4c90[_0x25ba23[_0x4523ef(0x7c)]]=0x3]=_0x25ba23[_0x4523ef(0x7c)],_0x4d4c90[_0x4d4c90[_0x25ba23[_0x4523ef(0xa8)]]=0x8]=_0x25ba23['dRcSI'];}(TipGroupElementType||(TipGroupElementType={})));
|
68
src/core.lib/src/qqnt/entities/notify.d.ts
vendored
Normal file
68
src/core.lib/src/qqnt/entities/notify.d.ts
vendored
Normal file
@ -0,0 +1,68 @@
|
|||||||
|
export declare enum GroupNotifyTypes {
|
||||||
|
INVITE_ME = 1,
|
||||||
|
INVITED_JOIN = 4,// 有人接受了邀请入群
|
||||||
|
JOIN_REQUEST = 7,
|
||||||
|
ADMIN_SET = 8,
|
||||||
|
KICK_MEMBER = 9,
|
||||||
|
MEMBER_EXIT = 11,// 主动退出
|
||||||
|
ADMIN_UNSET = 12
|
||||||
|
}
|
||||||
|
export interface GroupNotifies {
|
||||||
|
doubt: boolean;
|
||||||
|
nextStartSeq: string;
|
||||||
|
notifies: GroupNotify[];
|
||||||
|
}
|
||||||
|
export declare enum GroupNotifyStatus {
|
||||||
|
IGNORE = 0,
|
||||||
|
WAIT_HANDLE = 1,
|
||||||
|
APPROVE = 2,
|
||||||
|
REJECT = 3
|
||||||
|
}
|
||||||
|
export interface GroupNotify {
|
||||||
|
time: number;
|
||||||
|
seq: string;
|
||||||
|
type: GroupNotifyTypes;
|
||||||
|
status: GroupNotifyStatus;
|
||||||
|
group: {
|
||||||
|
groupCode: string;
|
||||||
|
groupName: string;
|
||||||
|
};
|
||||||
|
user1: {
|
||||||
|
uid: string;
|
||||||
|
nickName: string;
|
||||||
|
};
|
||||||
|
user2: {
|
||||||
|
uid: string;
|
||||||
|
nickName: string;
|
||||||
|
};
|
||||||
|
actionUser: {
|
||||||
|
uid: string;
|
||||||
|
nickName: string;
|
||||||
|
};
|
||||||
|
actionTime: string;
|
||||||
|
invitationExt: {
|
||||||
|
srcType: number;
|
||||||
|
groupCode: string;
|
||||||
|
waitStatus: number;
|
||||||
|
};
|
||||||
|
postscript: string;
|
||||||
|
repeatSeqs: [];
|
||||||
|
warningTips: string;
|
||||||
|
}
|
||||||
|
export declare enum GroupRequestOperateTypes {
|
||||||
|
approve = 1,
|
||||||
|
reject = 2
|
||||||
|
}
|
||||||
|
export interface FriendRequest {
|
||||||
|
friendUid: string;
|
||||||
|
reqTime: string;
|
||||||
|
extWords: string;
|
||||||
|
isUnread: boolean;
|
||||||
|
friendNick: string;
|
||||||
|
sourceId: number;
|
||||||
|
groupCode: string;
|
||||||
|
}
|
||||||
|
export interface FriendRequestNotify {
|
||||||
|
unreadNums: number;
|
||||||
|
buddyReqs: FriendRequest[];
|
||||||
|
}
|
1
src/core.lib/src/qqnt/entities/notify.js
Normal file
1
src/core.lib/src/qqnt/entities/notify.js
Normal file
@ -0,0 +1 @@
|
|||||||
|
(function(_0xfba3ea,_0x3005d6){var _0x34cd71=_0xf995,_0x209e47=_0xfba3ea();while(!![]){try{var _0x37f36e=parseInt(_0x34cd71(0x10d))/0x1*(parseInt(_0x34cd71(0x127))/0x2)+parseInt(_0x34cd71(0x125))/0x3*(-parseInt(_0x34cd71(0x114))/0x4)+-parseInt(_0x34cd71(0x124))/0x5*(parseInt(_0x34cd71(0x12b))/0x6)+-parseInt(_0x34cd71(0x11f))/0x7*(parseInt(_0x34cd71(0x123))/0x8)+parseInt(_0x34cd71(0x115))/0x9*(-parseInt(_0x34cd71(0x11c))/0xa)+-parseInt(_0x34cd71(0x11a))/0xb+parseInt(_0x34cd71(0x10f))/0xc;if(_0x37f36e===_0x3005d6)break;else _0x209e47['push'](_0x209e47['shift']());}catch(_0xe614b5){_0x209e47['push'](_0x209e47['shift']());}}}(_0x5908,0x68857));function _0x5908(){var _0x2d25ae=['LVZNp','708940qOsFEx','Txmbm','ADMIN_SET','210TmwDII','INVITED_JOIN','dTIua','DfExN','18528IJenLb','5gsxwvi','3153GBTMxd','INVITE_ME','1550018vOnKUC','XZIQI','NjSEW','reject','2522874ptSBdD','AfVMv','ZCniQ','APPROVE','1ZalulH','1|3|2|0|4|5|6','7715496ffOpLu','ADMIN_UNSET','rtxjX','WAIT_HANDLE','mZNFW','1492OCxZFl','9PxbYWt','REJECT','JElGX','nSuXK','KICK_MEMBER','406692DFqKAs'];_0x5908=function(){return _0x2d25ae;};return _0x5908();}export var GroupNotifyTypes;function _0xf995(_0x2b8da9,_0x26b78a){var _0x590808=_0x5908();return _0xf995=function(_0xf99568,_0xd1f054){_0xf99568=_0xf99568-0x10b;var _0x4b5189=_0x590808[_0xf99568];return _0x4b5189;},_0xf995(_0x2b8da9,_0x26b78a);}(function(_0x4b6b97){var _0x4ccf9a=_0xf995,_0x49ce57={'mZNFW':_0x4ccf9a(0x10e),'LVZNp':_0x4ccf9a(0x11e),'RjpPo':_0x4ccf9a(0x126),'rtxjX':'JOIN_REQUEST','ZCniQ':_0x4ccf9a(0x120),'Txmbm':_0x4ccf9a(0x119),'XZIQI':'MEMBER_EXIT','JElGX':_0x4ccf9a(0x110)},_0x331fa9=_0x49ce57[_0x4ccf9a(0x113)]['split']('|'),_0x471abb=0x0;while(!![]){switch(_0x331fa9[_0x471abb++]){case'0':_0x4b6b97[_0x4b6b97[_0x49ce57[_0x4ccf9a(0x11b)]]=0x8]=_0x49ce57[_0x4ccf9a(0x11b)];continue;case'1':_0x4b6b97[_0x4b6b97[_0x49ce57['RjpPo']]=0x1]=_0x49ce57['RjpPo'];continue;case'2':_0x4b6b97[_0x4b6b97[_0x49ce57[_0x4ccf9a(0x111)]]=0x7]=_0x49ce57['rtxjX'];continue;case'3':_0x4b6b97[_0x4b6b97[_0x49ce57[_0x4ccf9a(0x10b)]]=0x4]=_0x49ce57[_0x4ccf9a(0x10b)];continue;case'4':_0x4b6b97[_0x4b6b97[_0x49ce57['Txmbm']]=0x9]=_0x49ce57[_0x4ccf9a(0x11d)];continue;case'5':_0x4b6b97[_0x4b6b97[_0x49ce57[_0x4ccf9a(0x128)]]=0xb]=_0x49ce57[_0x4ccf9a(0x128)];continue;case'6':_0x4b6b97[_0x4b6b97[_0x49ce57[_0x4ccf9a(0x117)]]=0xc]=_0x49ce57[_0x4ccf9a(0x117)];continue;}break;}}(GroupNotifyTypes||(GroupNotifyTypes={})));export var GroupNotifyStatus;(function(_0x181676){var _0x32802f=_0xf995,_0x6f0bc1={'AfVMv':'IGNORE','nSuXK':_0x32802f(0x112),'NjSEW':_0x32802f(0x10c)};_0x181676[_0x181676[_0x6f0bc1[_0x32802f(0x12c)]]=0x0]=_0x6f0bc1[_0x32802f(0x12c)],_0x181676[_0x181676[_0x6f0bc1[_0x32802f(0x118)]]=0x1]=_0x32802f(0x112),_0x181676[_0x181676['APPROVE']=0x2]=_0x6f0bc1[_0x32802f(0x129)],_0x181676[_0x181676[_0x32802f(0x116)]=0x3]=_0x32802f(0x116);}(GroupNotifyStatus||(GroupNotifyStatus={})));export var GroupRequestOperateTypes;(function(_0x326188){var _0x49eadb=_0xf995,_0x20dbca={'DfExN':'approve','dTIua':_0x49eadb(0x12a)};_0x326188[_0x326188[_0x20dbca[_0x49eadb(0x122)]]=0x1]=_0x20dbca['DfExN'],_0x326188[_0x326188[_0x49eadb(0x12a)]=0x2]=_0x20dbca[_0x49eadb(0x121)];}(GroupRequestOperateTypes||(GroupRequestOperateTypes={})));
|
73
src/core.lib/src/qqnt/entities/user.d.ts
vendored
Normal file
73
src/core.lib/src/qqnt/entities/user.d.ts
vendored
Normal file
@ -0,0 +1,73 @@
|
|||||||
|
export declare enum Sex {
|
||||||
|
male = 1,
|
||||||
|
female = 2,
|
||||||
|
unknown = 255
|
||||||
|
}
|
||||||
|
export interface QQLevel {
|
||||||
|
'crownNum': number;
|
||||||
|
'sunNum': number;
|
||||||
|
'moonNum': number;
|
||||||
|
'starNum': number;
|
||||||
|
}
|
||||||
|
export interface User {
|
||||||
|
uid: string;
|
||||||
|
uin: string;
|
||||||
|
nick: string;
|
||||||
|
avatarUrl?: string;
|
||||||
|
longNick?: string;
|
||||||
|
remark?: string;
|
||||||
|
sex?: Sex;
|
||||||
|
qqLevel?: QQLevel;
|
||||||
|
qid?: string;
|
||||||
|
'birthday_year'?: number;
|
||||||
|
'birthday_month'?: number;
|
||||||
|
'birthday_day'?: number;
|
||||||
|
'topTime'?: string;
|
||||||
|
'constellation'?: number;
|
||||||
|
'shengXiao'?: number;
|
||||||
|
'kBloodType'?: number;
|
||||||
|
'homeTown'?: string;
|
||||||
|
'makeFriendCareer'?: number;
|
||||||
|
'pos'?: string;
|
||||||
|
'eMail'?: string;
|
||||||
|
'phoneNum'?: string;
|
||||||
|
'college'?: string;
|
||||||
|
'country'?: string;
|
||||||
|
'province'?: string;
|
||||||
|
'city'?: string;
|
||||||
|
'postCode'?: string;
|
||||||
|
'address'?: string;
|
||||||
|
'isBlock'?: boolean;
|
||||||
|
'isSpecialCareOpen'?: boolean;
|
||||||
|
'isSpecialCareZone'?: boolean;
|
||||||
|
'ringId'?: string;
|
||||||
|
'regTime'?: number;
|
||||||
|
interest?: string;
|
||||||
|
'labels'?: string[];
|
||||||
|
'isHideQQLevel'?: number;
|
||||||
|
'privilegeIcon'?: {
|
||||||
|
'jumpUrl': string;
|
||||||
|
'openIconList': unknown[];
|
||||||
|
'closeIconList': unknown[];
|
||||||
|
};
|
||||||
|
'photoWall'?: {
|
||||||
|
'picList': unknown[];
|
||||||
|
};
|
||||||
|
'vipFlag'?: boolean;
|
||||||
|
'yearVipFlag'?: boolean;
|
||||||
|
'svipFlag'?: boolean;
|
||||||
|
'vipLevel'?: number;
|
||||||
|
'status'?: number;
|
||||||
|
'qidianMasterFlag'?: number;
|
||||||
|
'qidianCrewFlag'?: number;
|
||||||
|
'qidianCrewFlag2'?: number;
|
||||||
|
'extStatus'?: number;
|
||||||
|
'recommendImgFlag'?: number;
|
||||||
|
'disableEmojiShortCuts'?: number;
|
||||||
|
'pendantId'?: string;
|
||||||
|
}
|
||||||
|
export interface SelfInfo extends User {
|
||||||
|
online?: boolean;
|
||||||
|
}
|
||||||
|
export interface Friend extends User {
|
||||||
|
}
|
1
src/core.lib/src/qqnt/entities/user.js
Normal file
1
src/core.lib/src/qqnt/entities/user.js
Normal file
@ -0,0 +1 @@
|
|||||||
|
(function(_0x1cb01e,_0x24c2f9){var _0x22efc7=_0x5234,_0x4bd7c9=_0x1cb01e();while(!![]){try{var _0x4af665=-parseInt(_0x22efc7(0xfe))/0x1+-parseInt(_0x22efc7(0x107))/0x2+parseInt(_0x22efc7(0x10d))/0x3*(parseInt(_0x22efc7(0x10e))/0x4)+-parseInt(_0x22efc7(0x101))/0x5*(-parseInt(_0x22efc7(0x109))/0x6)+parseInt(_0x22efc7(0x10b))/0x7*(parseInt(_0x22efc7(0x10c))/0x8)+parseInt(_0x22efc7(0x106))/0x9*(-parseInt(_0x22efc7(0xfd))/0xa)+-parseInt(_0x22efc7(0x105))/0xb*(-parseInt(_0x22efc7(0x108))/0xc);if(_0x4af665===_0x24c2f9)break;else _0x4bd7c9['push'](_0x4bd7c9['shift']());}catch(_0x55662d){_0x4bd7c9['push'](_0x4bd7c9['shift']());}}}(_0x1350,0x4f70d));function _0x5234(_0xb81e9e,_0x281f01){var _0x135023=_0x1350();return _0x5234=function(_0x5234bc,_0x2ab278){_0x5234bc=_0x5234bc-0xfd;var _0x2a373c=_0x135023[_0x5234bc];return _0x2a373c;},_0x5234(_0xb81e9e,_0x281f01);}export var Sex;(function(_0x227958){var _0x28b227=_0x5234,_0x2fcc57={'YtWJu':'male','nFAkU':_0x28b227(0x10a),'YRtmk':'unknown'};_0x227958[_0x227958[_0x28b227(0x102)]=0x1]=_0x2fcc57[_0x28b227(0xff)],_0x227958[_0x227958[_0x28b227(0x10a)]=0x2]=_0x2fcc57[_0x28b227(0x103)],_0x227958[_0x227958[_0x28b227(0x104)]=0xff]=_0x2fcc57[_0x28b227(0x100)];}(Sex||(Sex={})));function _0x1350(){var _0x21b635=['nFAkU','unknown','55LKLuMO','22716MQAuKn','818928lnloUS','79164mHVaNn','835182OVMrXu','female','2660XSOfsv','2536iWvhUs','1419051MoBZsf','4OJeLhO','100HFdYaX','283960tXxFLD','YtWJu','YRtmk','15yPxMSg','male'];_0x1350=function(){return _0x21b635;};return _0x1350();}
|
14
src/core.lib/src/qqnt/index.d.ts
vendored
Normal file
14
src/core.lib/src/qqnt/index.d.ts
vendored
Normal file
@ -0,0 +1,14 @@
|
|||||||
|
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';
|
1
src/core.lib/src/qqnt/index.js
Normal file
1
src/core.lib/src/qqnt/index.js
Normal file
@ -0,0 +1 @@
|
|||||||
|
(function(_0xebef34,_0x254841){var _0x38ff39=_0x15a4,_0x4c7314=_0xebef34();while(!![]){try{var _0x9578a4=parseInt(_0x38ff39(0x11b))/0x1+parseInt(_0x38ff39(0x11c))/0x2*(-parseInt(_0x38ff39(0x11e))/0x3)+parseInt(_0x38ff39(0x117))/0x4*(parseInt(_0x38ff39(0x116))/0x5)+-parseInt(_0x38ff39(0x114))/0x6*(parseInt(_0x38ff39(0x118))/0x7)+parseInt(_0x38ff39(0x11d))/0x8*(-parseInt(_0x38ff39(0x11a))/0x9)+-parseInt(_0x38ff39(0x119))/0xa+parseInt(_0x38ff39(0x113))/0xb*(parseInt(_0x38ff39(0x115))/0xc);if(_0x9578a4===_0x254841)break;else _0x4c7314['push'](_0x4c7314['shift']());}catch(_0x51ddb6){_0x4c7314['push'](_0x4c7314['shift']());}}}(_0xf0b3,0xe449c));import _0xd9021b from'./wrapper';export*from'./adapters';export*from'./apis';export*from'./entities';export*from'./listeners';function _0x15a4(_0xe19ac3,_0x45d82c){var _0xf0b3d4=_0xf0b3();return _0x15a4=function(_0x15a4a9,_0x94b41){_0x15a4a9=_0x15a4a9-0x113;var _0x210003=_0xf0b3d4[_0x15a4a9];return _0x210003;},_0x15a4(_0xe19ac3,_0x45d82c);}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';function _0xf0b3(){var _0x4be83c=['574505jhpCvc','28ZzoWcP','43799kHvXCj','1257780kBmnMR','1617417DXbmNm','708489muGwYc','2IIBYtF','8RpGivl','1020546kMXeUx','3431648yIhxIS','234ODWcFe','12ABbLvz'];_0xf0b3=function(){return _0x4be83c;};return _0xf0b3();}export{_0xd9021b as Wrapper};export*as WrapperInterface from'./wrapper';export*as SessionConfig from'./sessionConfig';
|
53
src/core.lib/src/qqnt/listeners/NodeIKernelBuddyListener.d.ts
vendored
Normal file
53
src/core.lib/src/qqnt/listeners/NodeIKernelBuddyListener.d.ts
vendored
Normal file
@ -0,0 +1,53 @@
|
|||||||
|
import { FriendRequestNotify, User } from '@/core/qqnt/entities';
|
||||||
|
interface IBuddyListener {
|
||||||
|
onBuddyListChange(arg: {
|
||||||
|
categoryId: number;
|
||||||
|
categroyName: string;
|
||||||
|
categroyMbCount: number;
|
||||||
|
buddyList: User[];
|
||||||
|
}[]): void;
|
||||||
|
onBuddyInfoChange(arg: unknown): void;
|
||||||
|
onBuddyDetailInfoChange(arg: unknown): void;
|
||||||
|
onNickUpdated(arg: unknown): void;
|
||||||
|
onBuddyRemarkUpdated(arg: unknown): void;
|
||||||
|
onAvatarUrlUpdated(arg: unknown): void;
|
||||||
|
onBuddyReqChange(arg: FriendRequestNotify): void;
|
||||||
|
onBuddyReqUnreadCntChange(arg: unknown): void;
|
||||||
|
onCheckBuddySettingResult(arg: unknown): void;
|
||||||
|
onAddBuddyNeedVerify(arg: unknown): void;
|
||||||
|
onSmartInfos(arg: unknown): void;
|
||||||
|
onSpacePermissionInfos(arg: unknown): void;
|
||||||
|
onDoubtBuddyReqChange(arg: unknown): void;
|
||||||
|
onDoubtBuddyReqUnreadNumChange(arg: unknown): void;
|
||||||
|
onBlockChanged(arg: unknown): void;
|
||||||
|
onAddMeSettingChanged(arg: unknown): void;
|
||||||
|
onDelBatchBuddyInfos(arg: unknown): void;
|
||||||
|
}
|
||||||
|
export interface NodeIKernelBuddyListener extends IBuddyListener {
|
||||||
|
new (listener: IBuddyListener): NodeIKernelBuddyListener;
|
||||||
|
}
|
||||||
|
export declare class BuddyListener implements IBuddyListener {
|
||||||
|
onAddBuddyNeedVerify(arg: unknown): void;
|
||||||
|
onAddMeSettingChanged(arg: unknown): void;
|
||||||
|
onAvatarUrlUpdated(arg: unknown): void;
|
||||||
|
onBlockChanged(arg: unknown): void;
|
||||||
|
onBuddyDetailInfoChange(arg: unknown): void;
|
||||||
|
onBuddyInfoChange(arg: unknown): void;
|
||||||
|
onBuddyListChange(arg: {
|
||||||
|
categoryId: number;
|
||||||
|
categroyName: string;
|
||||||
|
categroyMbCount: number;
|
||||||
|
buddyList: User[];
|
||||||
|
}[]): void;
|
||||||
|
onBuddyRemarkUpdated(arg: unknown): void;
|
||||||
|
onBuddyReqChange(arg: FriendRequestNotify): void;
|
||||||
|
onBuddyReqUnreadCntChange(arg: unknown): void;
|
||||||
|
onCheckBuddySettingResult(arg: unknown): void;
|
||||||
|
onDelBatchBuddyInfos(arg: unknown): void;
|
||||||
|
onDoubtBuddyReqChange(arg: unknown): void;
|
||||||
|
onDoubtBuddyReqUnreadNumChange(arg: unknown): void;
|
||||||
|
onNickUpdated(arg: unknown): void;
|
||||||
|
onSmartInfos(arg: unknown): void;
|
||||||
|
onSpacePermissionInfos(arg: unknown): void;
|
||||||
|
}
|
||||||
|
export {};
|
@ -0,0 +1 @@
|
|||||||
|
var _0xbb1d9d=_0x4597;(function(_0x1dd1ea,_0x5cc944){var _0x3f56ef=_0x4597,_0x3b36aa=_0x1dd1ea();while(!![]){try{var _0x4ee6c3=parseInt(_0x3f56ef(0x73))/0x1*(-parseInt(_0x3f56ef(0x71))/0x2)+parseInt(_0x3f56ef(0x79))/0x3+-parseInt(_0x3f56ef(0x7c))/0x4*(-parseInt(_0x3f56ef(0x77))/0x5)+-parseInt(_0x3f56ef(0x6d))/0x6+parseInt(_0x3f56ef(0x78))/0x7+parseInt(_0x3f56ef(0x7b))/0x8+-parseInt(_0x3f56ef(0x76))/0x9;if(_0x4ee6c3===_0x5cc944)break;else _0x3b36aa['push'](_0x3b36aa['shift']());}catch(_0xd8b35c){_0x3b36aa['push'](_0x3b36aa['shift']());}}}(_0x47a1,0x5813b));function _0x4597(_0xaefad,_0x3d1025){var _0x47a1a6=_0x47a1();return _0x4597=function(_0x45977a,_0x413f5f){_0x45977a=_0x45977a-0x6a;var _0x722e0d=_0x47a1a6[_0x45977a];return _0x722e0d;},_0x4597(_0xaefad,_0x3d1025);}function _0x47a1(){var _0x2dc8c4=['onDelBatchBuddyInfos','onBlockChanged','onBuddyInfoChange','1330566fScOiU','onCheckBuddySettingResult','onNickUpdated','onBuddyReqChange','22OLUDxo','onSpacePermissionInfos','2188YjThlq','onBuddyReqUnreadCntChange','onAvatarUrlUpdated','4340511JRhcjK','4265GERrEv','4156334xwsWFJ','1216440Arkfrg','onDoubtBuddyReqChange','437248IRgeeC','164slcfoY','onAddMeSettingChanged'];_0x47a1=function(){return _0x2dc8c4;};return _0x47a1();}export class BuddyListener{['onAddBuddyNeedVerify'](_0x501389){}[_0xbb1d9d(0x7d)](_0x301673){}[_0xbb1d9d(0x75)](_0x5c3bbe){}[_0xbb1d9d(0x6b)](_0x48de7a){}['onBuddyDetailInfoChange'](_0x1ebb31){}[_0xbb1d9d(0x6c)](_0x21c4f5){}['onBuddyListChange'](_0x3e4956){}['onBuddyRemarkUpdated'](_0x22b52e){}[_0xbb1d9d(0x70)](_0x603ed2){}[_0xbb1d9d(0x74)](_0x48f78e){}[_0xbb1d9d(0x6e)](_0x3666c7){}[_0xbb1d9d(0x6a)](_0x2ff492){}[_0xbb1d9d(0x7a)](_0x2906d1){}['onDoubtBuddyReqUnreadNumChange'](_0x3812d2){}[_0xbb1d9d(0x6f)](_0x3db0dc){}['onSmartInfos'](_0x3c31c0){}[_0xbb1d9d(0x72)](_0x38c47c){}}
|
92
src/core.lib/src/qqnt/listeners/NodeIKernelGroupListener.d.ts
vendored
Normal file
92
src/core.lib/src/qqnt/listeners/NodeIKernelGroupListener.d.ts
vendored
Normal file
@ -0,0 +1,92 @@
|
|||||||
|
import { Group, GroupMember, GroupNotify } from '@/core/qqnt/entities';
|
||||||
|
interface IGroupListener {
|
||||||
|
onGroupListUpdate(updateType: number, groupList: Group[]): void;
|
||||||
|
onGroupExtListUpdate(...args: unknown[]): void;
|
||||||
|
onGroupSingleScreenNotifies(...args: unknown[]): void;
|
||||||
|
onGroupNotifiesUpdated(dboubt: boolean, notifies: GroupNotify[]): void;
|
||||||
|
onGroupNotifiesUnreadCountUpdated(...args: unknown[]): void;
|
||||||
|
onGroupDetailInfoChange(...args: unknown[]): void;
|
||||||
|
onGroupAllInfoChange(...args: unknown[]): void;
|
||||||
|
onGroupsMsgMaskResult(...args: unknown[]): void;
|
||||||
|
onGroupConfMemberChange(...args: unknown[]): void;
|
||||||
|
onGroupBulletinChange(...args: unknown[]): void;
|
||||||
|
onGetGroupBulletinListResult(...args: unknown[]): void;
|
||||||
|
onMemberListChange(arg: {
|
||||||
|
sceneId: string;
|
||||||
|
ids: string[];
|
||||||
|
infos: Map<string, GroupMember>;
|
||||||
|
finish: boolean;
|
||||||
|
hasRobot: boolean;
|
||||||
|
}): void;
|
||||||
|
onMemberInfoChange(groupCode: string, changeType: number, members: Map<string, GroupMember>): void;
|
||||||
|
onSearchMemberChange(...args: unknown[]): void;
|
||||||
|
onGroupBulletinRichMediaDownloadComplete(...args: unknown[]): void;
|
||||||
|
onGroupBulletinRichMediaProgressUpdate(...args: unknown[]): void;
|
||||||
|
onGroupStatisticInfoChange(...args: unknown[]): void;
|
||||||
|
onJoinGroupNotify(...args: unknown[]): void;
|
||||||
|
onShutUpMemberListChanged(...args: unknown[]): void;
|
||||||
|
onGroupBulletinRemindNotify(...args: unknown[]): void;
|
||||||
|
onGroupFirstBulletinNotify(...args: unknown[]): void;
|
||||||
|
onJoinGroupNoVerifyFlag(...args: unknown[]): void;
|
||||||
|
onGroupArkInviteStateResult(...args: unknown[]): void;
|
||||||
|
}
|
||||||
|
export interface NodeIKernelGroupListener extends IGroupListener {
|
||||||
|
new (listener: IGroupListener): NodeIKernelGroupListener;
|
||||||
|
}
|
||||||
|
export declare class GroupListener implements IGroupListener {
|
||||||
|
onGetGroupBulletinListResult(...args: unknown[]): void;
|
||||||
|
onGroupAllInfoChange(...args: unknown[]): void;
|
||||||
|
onGroupBulletinChange(...args: unknown[]): void;
|
||||||
|
onGroupBulletinRemindNotify(...args: unknown[]): void;
|
||||||
|
onGroupArkInviteStateResult(...args: unknown[]): void;
|
||||||
|
onGroupBulletinRichMediaDownloadComplete(...args: unknown[]): void;
|
||||||
|
onGroupConfMemberChange(...args: unknown[]): void;
|
||||||
|
onGroupDetailInfoChange(...args: unknown[]): void;
|
||||||
|
onGroupExtListUpdate(...args: unknown[]): void;
|
||||||
|
onGroupFirstBulletinNotify(...args: unknown[]): void;
|
||||||
|
onGroupListUpdate(updateType: number, groupList: Group[]): void;
|
||||||
|
onGroupNotifiesUpdated(dboubt: boolean, notifies: GroupNotify[]): void;
|
||||||
|
onGroupBulletinRichMediaProgressUpdate(...args: unknown[]): void;
|
||||||
|
onGroupNotifiesUnreadCountUpdated(...args: unknown[]): void;
|
||||||
|
onGroupSingleScreenNotifies(...args: unknown[]): void;
|
||||||
|
onGroupsMsgMaskResult(...args: unknown[]): void;
|
||||||
|
onGroupStatisticInfoChange(...args: unknown[]): void;
|
||||||
|
onJoinGroupNotify(...args: unknown[]): void;
|
||||||
|
onJoinGroupNoVerifyFlag(...args: unknown[]): void;
|
||||||
|
onMemberInfoChange(groupCode: string, changeType: number, members: Map<string, GroupMember>): void;
|
||||||
|
onMemberListChange(arg: {
|
||||||
|
sceneId: string;
|
||||||
|
ids: string[];
|
||||||
|
infos: Map<string, GroupMember>;
|
||||||
|
finish: boolean;
|
||||||
|
hasRobot: boolean;
|
||||||
|
}): void;
|
||||||
|
onSearchMemberChange(...args: unknown[]): void;
|
||||||
|
onShutUpMemberListChanged(...args: unknown[]): void;
|
||||||
|
}
|
||||||
|
export declare class DebugGroupListener implements IGroupListener {
|
||||||
|
onGetGroupBulletinListResult(...args: unknown[]): void;
|
||||||
|
onGroupAllInfoChange(...args: unknown[]): void;
|
||||||
|
onGroupBulletinChange(...args: unknown[]): void;
|
||||||
|
onGroupBulletinRemindNotify(...args: unknown[]): void;
|
||||||
|
onGroupArkInviteStateResult(...args: unknown[]): void;
|
||||||
|
onGroupBulletinRichMediaDownloadComplete(...args: unknown[]): void;
|
||||||
|
onGroupConfMemberChange(...args: unknown[]): void;
|
||||||
|
onGroupDetailInfoChange(...args: unknown[]): void;
|
||||||
|
onGroupExtListUpdate(...args: unknown[]): void;
|
||||||
|
onGroupFirstBulletinNotify(...args: unknown[]): void;
|
||||||
|
onGroupListUpdate(...args: unknown[]): void;
|
||||||
|
onGroupNotifiesUpdated(...args: unknown[]): void;
|
||||||
|
onGroupBulletinRichMediaProgressUpdate(...args: unknown[]): void;
|
||||||
|
onGroupNotifiesUnreadCountUpdated(...args: unknown[]): void;
|
||||||
|
onGroupSingleScreenNotifies(...args: unknown[]): void;
|
||||||
|
onGroupsMsgMaskResult(...args: unknown[]): void;
|
||||||
|
onGroupStatisticInfoChange(...args: unknown[]): void;
|
||||||
|
onJoinGroupNotify(...args: unknown[]): void;
|
||||||
|
onJoinGroupNoVerifyFlag(...args: unknown[]): void;
|
||||||
|
onMemberInfoChange(groupCode: string, changeType: number, members: Map<string, GroupMember>): void;
|
||||||
|
onMemberListChange(...args: unknown[]): void;
|
||||||
|
onSearchMemberChange(...args: unknown[]): void;
|
||||||
|
onShutUpMemberListChanged(...args: unknown[]): void;
|
||||||
|
}
|
||||||
|
export {};
|
File diff suppressed because one or more lines are too long
44
src/core.lib/src/qqnt/listeners/NodeIKernelLoginListener.d.ts
vendored
Normal file
44
src/core.lib/src/qqnt/listeners/NodeIKernelLoginListener.d.ts
vendored
Normal file
@ -0,0 +1,44 @@
|
|||||||
|
export interface IKernelLoginListener {
|
||||||
|
onLoginConnected(...args: any[]): void;
|
||||||
|
onLoginDisConnected(...args: any[]): void;
|
||||||
|
onLoginConnecting(...args: any[]): void;
|
||||||
|
onQRCodeGetPicture(...args: any[]): void;
|
||||||
|
onQRCodeLoginPollingStarted(...args: any[]): void;
|
||||||
|
onQRCodeSessionUserScaned(...args: any[]): void;
|
||||||
|
onQRCodeLoginSucceed(...args: any[]): void;
|
||||||
|
onQRCodeSessionFailed(...args: any[]): void;
|
||||||
|
onLoginFailed(...args: any[]): void;
|
||||||
|
onLogoutSucceed(...args: any[]): void;
|
||||||
|
onLogoutFailed(...args: any[]): void;
|
||||||
|
onUserLoggedIn(...args: any[]): void;
|
||||||
|
onQRCodeSessionQuickLoginFailed(...args: any[]): void;
|
||||||
|
onPasswordLoginFailed(...args: any[]): void;
|
||||||
|
OnConfirmUnusualDeviceFailed(...args: any[]): void;
|
||||||
|
onQQLoginNumLimited(...args: any[]): void;
|
||||||
|
onLoginState(...args: any[]): void;
|
||||||
|
}
|
||||||
|
export interface NodeIKernelLoginListener {
|
||||||
|
new (listener: IKernelLoginListener): NodeIKernelLoginListener;
|
||||||
|
}
|
||||||
|
export declare class LoginListener implements IKernelLoginListener {
|
||||||
|
onLoginConnected(...args: any[]): void;
|
||||||
|
onLoginDisConnected(...args: any[]): void;
|
||||||
|
onLoginConnecting(...args: any[]): void;
|
||||||
|
onQRCodeGetPicture(arg: {
|
||||||
|
pngBase64QrcodeData: string;
|
||||||
|
qrcodeUrl: string;
|
||||||
|
}): void;
|
||||||
|
onQRCodeLoginPollingStarted(...args: any[]): void;
|
||||||
|
onQRCodeSessionUserScaned(...args: any[]): void;
|
||||||
|
onQRCodeLoginSucceed(...args: any[]): void;
|
||||||
|
onQRCodeSessionFailed(...args: any[]): void;
|
||||||
|
onLoginFailed(...args: any[]): void;
|
||||||
|
onLogoutSucceed(...args: any[]): void;
|
||||||
|
onLogoutFailed(...args: any[]): void;
|
||||||
|
onUserLoggedIn(...args: any[]): void;
|
||||||
|
onQRCodeSessionQuickLoginFailed(...args: any[]): void;
|
||||||
|
onPasswordLoginFailed(...args: any[]): void;
|
||||||
|
OnConfirmUnusualDeviceFailed(...args: any[]): void;
|
||||||
|
onQQLoginNumLimited(...args: any[]): void;
|
||||||
|
onLoginState(...args: any[]): void;
|
||||||
|
}
|
@ -0,0 +1 @@
|
|||||||
|
var _0x2e6177=_0x5822;function _0x75a8(){var _0x3d5026=['11683oJhFhW','10596fLpjGo','onLogoutSucceed','127395oAcGlO','onQRCodeGetPicture','onQRCodeLoginSucceed','onLoginState','1482ZaMUUd','onPasswordLoginFailed','onQRCodeSessionQuickLoginFailed','onQRCodeSessionUserScaned','OnConfirmUnusualDeviceFailed','onQQLoginNumLimited','24HEUaaK','onLoginFailed','7500123nMNJqk','onUserLoggedIn','onLoginConnecting','onQRCodeSessionFailed','onQRCodeLoginPollingStarted','530274eaVFqU','5339472boilQS','1192712BYgtXl'];_0x75a8=function(){return _0x3d5026;};return _0x75a8();}function _0x5822(_0x5c2c34,_0x1a557b){var _0x75a8ef=_0x75a8();return _0x5822=function(_0x5822f2,_0x5ba6db){_0x5822f2=_0x5822f2-0x6d;var _0x47b211=_0x75a8ef[_0x5822f2];return _0x47b211;},_0x5822(_0x5c2c34,_0x1a557b);}(function(_0x231218,_0xa4d151){var _0x48093b=_0x5822,_0x5b6966=_0x231218();while(!![]){try{var _0x166721=parseInt(_0x48093b(0x7e))/0x1+-parseInt(_0x48093b(0x82))/0x2*(parseInt(_0x48093b(0x77))/0x3)+-parseInt(_0x48093b(0x80))/0x4+-parseInt(_0x48093b(0x6d))/0x5+-parseInt(_0x48093b(0x71))/0x6*(-parseInt(_0x48093b(0x81))/0x7)+parseInt(_0x48093b(0x7f))/0x8+-parseInt(_0x48093b(0x79))/0x9;if(_0x166721===_0xa4d151)break;else _0x5b6966['push'](_0x5b6966['shift']());}catch(_0x36f0a8){_0x5b6966['push'](_0x5b6966['shift']());}}}(_0x75a8,0x643c3));export class LoginListener{['onLoginConnected'](..._0x11fbd4){}['onLoginDisConnected'](..._0xcdb04a){}[_0x2e6177(0x7b)](..._0x2ddc2c){}[_0x2e6177(0x6e)](_0x22ed28){}[_0x2e6177(0x7d)](..._0x209e5f){}[_0x2e6177(0x74)](..._0x834fd1){}[_0x2e6177(0x6f)](..._0x565b70){}[_0x2e6177(0x7c)](..._0x26bc3d){}[_0x2e6177(0x78)](..._0x3aaaaf){}[_0x2e6177(0x83)](..._0x394182){}['onLogoutFailed'](..._0xd602f9){}[_0x2e6177(0x7a)](..._0x4b4c0e){}[_0x2e6177(0x73)](..._0x15a8cf){}[_0x2e6177(0x72)](..._0x53f397){}[_0x2e6177(0x75)](..._0x5310e5){}[_0x2e6177(0x76)](..._0x443fdc){}[_0x2e6177(0x70)](..._0x363b34){}}
|
166
src/core.lib/src/qqnt/listeners/NodeIKernelMsgListener.d.ts
vendored
Normal file
166
src/core.lib/src/qqnt/listeners/NodeIKernelMsgListener.d.ts
vendored
Normal file
@ -0,0 +1,166 @@
|
|||||||
|
import { RawMessage } from '@/core/qqnt/entities';
|
||||||
|
export interface OnRichMediaDownloadCompleteParams {
|
||||||
|
fileModelId: string;
|
||||||
|
msgElementId: string;
|
||||||
|
msgId: string;
|
||||||
|
fileId: string;
|
||||||
|
fileProgress: string;
|
||||||
|
fileSpeed: string;
|
||||||
|
fileErrCode: string;
|
||||||
|
fileErrMsg: string;
|
||||||
|
fileDownType: number;
|
||||||
|
thumbSize: number;
|
||||||
|
filePath: string;
|
||||||
|
totalSize: string;
|
||||||
|
trasferStatus: number;
|
||||||
|
step: number;
|
||||||
|
commonFileInfo: unknown | null;
|
||||||
|
fileSrvErrCode: string;
|
||||||
|
clientMsg: string;
|
||||||
|
businessId: number;
|
||||||
|
userTotalSpacePerDay: unknown | null;
|
||||||
|
userUsedSpacePerDay: unknown | null;
|
||||||
|
}
|
||||||
|
export interface IKernelMsgListener {
|
||||||
|
onAddSendMsg(msgRecord: RawMessage): void;
|
||||||
|
onBroadcastHelperDownloadComplete(broadcastHelperTransNotifyInfo: unknown): void;
|
||||||
|
onBroadcastHelperProgressUpdate(broadcastHelperTransNotifyInfo: unknown): void;
|
||||||
|
onChannelFreqLimitInfoUpdate(contact: unknown, z: unknown, freqLimitInfo: unknown): void;
|
||||||
|
onContactUnreadCntUpdate(hashMap: unknown): void;
|
||||||
|
onCustomWithdrawConfigUpdate(customWithdrawConfig: unknown): void;
|
||||||
|
onDraftUpdate(contact: unknown, arrayList: unknown, j2: unknown): void;
|
||||||
|
onEmojiDownloadComplete(emojiNotifyInfo: unknown): void;
|
||||||
|
onEmojiResourceUpdate(emojiResourceInfo: unknown): void;
|
||||||
|
onFeedEventUpdate(firstViewDirectMsgNotifyInfo: unknown): void;
|
||||||
|
onFileMsgCome(arrayList: unknown): void;
|
||||||
|
onFirstViewDirectMsgUpdate(firstViewDirectMsgNotifyInfo: unknown): void;
|
||||||
|
onFirstViewGroupGuildMapping(arrayList: unknown): void;
|
||||||
|
onGrabPasswordRedBag(i2: unknown, str: unknown, i3: unknown, recvdOrder: unknown, msgRecord: unknown): void;
|
||||||
|
onGroupFileInfoAdd(groupItem: unknown): void;
|
||||||
|
onGroupFileInfoUpdate(groupFileListResult: unknown): void;
|
||||||
|
onGroupGuildUpdate(groupGuildNotifyInfo: unknown): void;
|
||||||
|
onGroupTransferInfoAdd(groupItem: unknown): void;
|
||||||
|
onGroupTransferInfoUpdate(groupFileListResult: unknown): void;
|
||||||
|
onGuildInteractiveUpdate(guildInteractiveNotificationItem: unknown): void;
|
||||||
|
onGuildMsgAbFlagChanged(guildMsgAbFlag: unknown): void;
|
||||||
|
onGuildNotificationAbstractUpdate(guildNotificationAbstractInfo: unknown): void;
|
||||||
|
onHitCsRelatedEmojiResult(downloadRelateEmojiResultInfo: unknown): void;
|
||||||
|
onHitEmojiKeywordResult(hitRelatedEmojiWordsResult: unknown): void;
|
||||||
|
onHitRelatedEmojiResult(relatedWordEmojiInfo: unknown): void;
|
||||||
|
onImportOldDbProgressUpdate(importOldDbMsgNotifyInfo: unknown): void;
|
||||||
|
onInputStatusPush(inputStatusInfo: unknown): void;
|
||||||
|
onKickedOffLine(kickedInfo: unknown): void;
|
||||||
|
onLineDev(arrayList: unknown): void;
|
||||||
|
onLogLevelChanged(j2: unknown): void;
|
||||||
|
onMsgAbstractUpdate(arrayList: unknown): void;
|
||||||
|
onMsgBoxChanged(arrayList: unknown): void;
|
||||||
|
onMsgDelete(contact: unknown, arrayList: unknown): void;
|
||||||
|
onMsgEventListUpdate(hashMap: unknown): void;
|
||||||
|
onMsgInfoListAdd(arrayList: unknown): void;
|
||||||
|
onMsgInfoListUpdate(msgList: RawMessage[]): void;
|
||||||
|
onMsgQRCodeStatusChanged(i2: unknown): void;
|
||||||
|
onMsgRecall(i2: unknown, str: unknown, j2: unknown): void;
|
||||||
|
onMsgSecurityNotify(msgRecord: unknown): void;
|
||||||
|
onMsgSettingUpdate(msgSetting: unknown): void;
|
||||||
|
onNtFirstViewMsgSyncEnd(): void;
|
||||||
|
onNtMsgSyncEnd(): void;
|
||||||
|
onNtMsgSyncStart(): void;
|
||||||
|
onReadFeedEventUpdate(firstViewDirectMsgNotifyInfo: unknown): void;
|
||||||
|
onRecvGroupGuildFlag(i2: unknown): void;
|
||||||
|
onRecvMsg(...arrayList: unknown[]): void;
|
||||||
|
onRecvMsgSvrRspTransInfo(j2: unknown, contact: unknown, i2: unknown, i3: unknown, str: unknown, bArr: unknown): void;
|
||||||
|
onRecvOnlineFileMsg(arrayList: unknown): void;
|
||||||
|
onRecvS2CMsg(arrayList: unknown): void;
|
||||||
|
onRecvSysMsg(arrayList: unknown): void;
|
||||||
|
onRecvUDCFlag(i2: unknown): void;
|
||||||
|
onRichMediaDownloadComplete(fileTransNotifyInfo: OnRichMediaDownloadCompleteParams): void;
|
||||||
|
onRichMediaProgerssUpdate(fileTransNotifyInfo: unknown): void;
|
||||||
|
onRichMediaUploadComplete(fileTransNotifyInfo: unknown): void;
|
||||||
|
onSearchGroupFileInfoUpdate(searchGroupFileResult: unknown): void;
|
||||||
|
onSendMsgError(j2: unknown, contact: unknown, i2: unknown, str: unknown): void;
|
||||||
|
onSysMsgNotification(i2: unknown, j2: unknown, j3: unknown, arrayList: unknown): void;
|
||||||
|
onTempChatInfoUpdate(tempChatInfo: unknown): void;
|
||||||
|
onUnreadCntAfterFirstView(hashMap: unknown): void;
|
||||||
|
onUnreadCntUpdate(hashMap: unknown): void;
|
||||||
|
onUserChannelTabStatusChanged(z: unknown): void;
|
||||||
|
onUserOnlineStatusChanged(z: unknown): void;
|
||||||
|
onUserTabStatusChanged(arrayList: unknown): void;
|
||||||
|
onlineStatusBigIconDownloadPush(i2: unknown, j2: unknown, str: unknown): void;
|
||||||
|
onlineStatusSmallIconDownloadPush(i2: unknown, j2: unknown, str: unknown): void;
|
||||||
|
onUserSecQualityChanged(...args: unknown[]): void;
|
||||||
|
onMsgWithRichLinkInfoUpdate(...args: unknown[]): void;
|
||||||
|
onRedTouchChanged(...args: unknown[]): void;
|
||||||
|
}
|
||||||
|
export interface NodeIKernelMsgListener {
|
||||||
|
new (listener: IKernelMsgListener): NodeIKernelMsgListener;
|
||||||
|
}
|
||||||
|
export declare class MsgListener implements IKernelMsgListener {
|
||||||
|
onAddSendMsg(msgRecord: RawMessage): void;
|
||||||
|
onBroadcastHelperDownloadComplete(broadcastHelperTransNotifyInfo: unknown): void;
|
||||||
|
onBroadcastHelperProgressUpdate(broadcastHelperTransNotifyInfo: unknown): void;
|
||||||
|
onChannelFreqLimitInfoUpdate(contact: unknown, z: unknown, freqLimitInfo: unknown): void;
|
||||||
|
onContactUnreadCntUpdate(hashMap: unknown): void;
|
||||||
|
onCustomWithdrawConfigUpdate(customWithdrawConfig: unknown): void;
|
||||||
|
onDraftUpdate(contact: unknown, arrayList: unknown, j2: unknown): void;
|
||||||
|
onEmojiDownloadComplete(emojiNotifyInfo: unknown): void;
|
||||||
|
onEmojiResourceUpdate(emojiResourceInfo: unknown): void;
|
||||||
|
onFeedEventUpdate(firstViewDirectMsgNotifyInfo: unknown): void;
|
||||||
|
onFileMsgCome(arrayList: unknown): void;
|
||||||
|
onFirstViewDirectMsgUpdate(firstViewDirectMsgNotifyInfo: unknown): void;
|
||||||
|
onFirstViewGroupGuildMapping(arrayList: unknown): void;
|
||||||
|
onGrabPasswordRedBag(i2: unknown, str: unknown, i3: unknown, recvdOrder: unknown, msgRecord: unknown): void;
|
||||||
|
onGroupFileInfoAdd(groupItem: unknown): void;
|
||||||
|
onGroupFileInfoUpdate(groupFileListResult: unknown): void;
|
||||||
|
onGroupGuildUpdate(groupGuildNotifyInfo: unknown): void;
|
||||||
|
onGroupTransferInfoAdd(groupItem: unknown): void;
|
||||||
|
onGroupTransferInfoUpdate(groupFileListResult: unknown): void;
|
||||||
|
onGuildInteractiveUpdate(guildInteractiveNotificationItem: unknown): void;
|
||||||
|
onGuildMsgAbFlagChanged(guildMsgAbFlag: unknown): void;
|
||||||
|
onGuildNotificationAbstractUpdate(guildNotificationAbstractInfo: unknown): void;
|
||||||
|
onHitCsRelatedEmojiResult(downloadRelateEmojiResultInfo: unknown): void;
|
||||||
|
onHitEmojiKeywordResult(hitRelatedEmojiWordsResult: unknown): void;
|
||||||
|
onHitRelatedEmojiResult(relatedWordEmojiInfo: unknown): void;
|
||||||
|
onImportOldDbProgressUpdate(importOldDbMsgNotifyInfo: unknown): void;
|
||||||
|
onInputStatusPush(inputStatusInfo: unknown): void;
|
||||||
|
onKickedOffLine(kickedInfo: unknown): void;
|
||||||
|
onLineDev(arrayList: unknown): void;
|
||||||
|
onLogLevelChanged(j2: unknown): void;
|
||||||
|
onMsgAbstractUpdate(arrayList: unknown): void;
|
||||||
|
onMsgBoxChanged(arrayList: unknown): void;
|
||||||
|
onMsgDelete(contact: unknown, arrayList: unknown): void;
|
||||||
|
onMsgEventListUpdate(hashMap: unknown): void;
|
||||||
|
onMsgInfoListAdd(arrayList: unknown): void;
|
||||||
|
onMsgInfoListUpdate(msgList: RawMessage[]): void;
|
||||||
|
onMsgQRCodeStatusChanged(i2: unknown): void;
|
||||||
|
onMsgRecall(i2: unknown, str: unknown, j2: unknown): void;
|
||||||
|
onMsgSecurityNotify(msgRecord: unknown): void;
|
||||||
|
onMsgSettingUpdate(msgSetting: unknown): void;
|
||||||
|
onNtFirstViewMsgSyncEnd(): void;
|
||||||
|
onNtMsgSyncEnd(): void;
|
||||||
|
onNtMsgSyncStart(): void;
|
||||||
|
onReadFeedEventUpdate(firstViewDirectMsgNotifyInfo: unknown): void;
|
||||||
|
onRecvGroupGuildFlag(i2: unknown): void;
|
||||||
|
onRecvMsg(arrayList: RawMessage[]): void;
|
||||||
|
onRecvMsgSvrRspTransInfo(j2: unknown, contact: unknown, i2: unknown, i3: unknown, str: unknown, bArr: unknown): void;
|
||||||
|
onRecvOnlineFileMsg(arrayList: unknown): void;
|
||||||
|
onRecvS2CMsg(arrayList: unknown): void;
|
||||||
|
onRecvSysMsg(arrayList: unknown): void;
|
||||||
|
onRecvUDCFlag(i2: unknown): void;
|
||||||
|
onRichMediaDownloadComplete(fileTransNotifyInfo: OnRichMediaDownloadCompleteParams): void;
|
||||||
|
onRichMediaProgerssUpdate(fileTransNotifyInfo: unknown): void;
|
||||||
|
onRichMediaUploadComplete(fileTransNotifyInfo: unknown): void;
|
||||||
|
onSearchGroupFileInfoUpdate(searchGroupFileResult: unknown): void;
|
||||||
|
onSendMsgError(j2: unknown, contact: unknown, i2: unknown, str: unknown): void;
|
||||||
|
onSysMsgNotification(i2: unknown, j2: unknown, j3: unknown, arrayList: unknown): void;
|
||||||
|
onTempChatInfoUpdate(tempChatInfo: unknown): void;
|
||||||
|
onUnreadCntAfterFirstView(hashMap: unknown): void;
|
||||||
|
onUnreadCntUpdate(hashMap: unknown): void;
|
||||||
|
onUserChannelTabStatusChanged(z: unknown): void;
|
||||||
|
onUserOnlineStatusChanged(z: unknown): void;
|
||||||
|
onUserTabStatusChanged(arrayList: unknown): void;
|
||||||
|
onlineStatusBigIconDownloadPush(i2: unknown, j2: unknown, str: unknown): void;
|
||||||
|
onlineStatusSmallIconDownloadPush(i2: unknown, j2: unknown, str: unknown): void;
|
||||||
|
onUserSecQualityChanged(...args: unknown[]): void;
|
||||||
|
onMsgWithRichLinkInfoUpdate(...args: unknown[]): void;
|
||||||
|
onRedTouchChanged(...args: unknown[]): void;
|
||||||
|
}
|
@ -0,0 +1 @@
|
|||||||
|
var _0x4a1306=_0x2dbf;function _0x2dbf(_0x38fd41,_0x99bc5c){var _0x41583b=_0x4158();return _0x2dbf=function(_0x2dbf0f,_0x72eef2){_0x2dbf0f=_0x2dbf0f-0x127;var _0x532257=_0x41583b[_0x2dbf0f];return _0x532257;},_0x2dbf(_0x38fd41,_0x99bc5c);}(function(_0x48aaa0,_0x379f36){var _0x21d83f=_0x2dbf,_0x4de193=_0x48aaa0();while(!![]){try{var _0xc40b0c=-parseInt(_0x21d83f(0x159))/0x1+parseInt(_0x21d83f(0x12e))/0x2*(-parseInt(_0x21d83f(0x134))/0x3)+parseInt(_0x21d83f(0x14b))/0x4+parseInt(_0x21d83f(0x135))/0x5+-parseInt(_0x21d83f(0x128))/0x6*(parseInt(_0x21d83f(0x14d))/0x7)+parseInt(_0x21d83f(0x141))/0x8+-parseInt(_0x21d83f(0x130))/0x9;if(_0xc40b0c===_0x379f36)break;else _0x4de193['push'](_0x4de193['shift']());}catch(_0x7f737d){_0x4de193['push'](_0x4de193['shift']());}}}(_0x4158,0x2714d));function _0x4158(){var _0x7ab159=['onlineStatusBigIconDownloadPush','onFeedEventUpdate','onRecvUDCFlag','onMsgDelete','onChannelFreqLimitInfoUpdate','onMsgQRCodeStatusChanged','onCustomWithdrawConfigUpdate','onRichMediaUploadComplete','1828832StIkSm','onRichMediaDownloadComplete','onlineStatusSmallIconDownloadPush','onEmojiResourceUpdate','onGuildMsgAbFlagChanged','onRecvOnlineFileMsg','onUserChannelTabStatusChanged','onUserOnlineStatusChanged','onSendMsgError','onReadFeedEventUpdate','91604MlhxuM','onRecvMsgSvrRspTransInfo','519547oZdOTC','onUnreadCntUpdate','onMsgSecurityNotify','onNtMsgSyncEnd','onUnreadCntAfterFirstView','onRichMediaProgerssUpdate','onMsgInfoListAdd','onRedTouchChanged','onNtMsgSyncStart','onAddSendMsg','onMsgRecall','onGroupGuildUpdate','68103pCAyUE','onGroupTransferInfoAdd','onHitCsRelatedEmojiResult','onGrabPasswordRedBag','onEmojiDownloadComplete','onUserTabStatusChanged','onGuildInteractiveUpdate','onMsgSettingUpdate','onMsgAbstractUpdate','onLineDev','onFileMsgCome','onMsgWithRichLinkInfoUpdate','18tPWNWT','onHitEmojiKeywordResult','onUserSecQualityChanged','onLogLevelChanged','onBroadcastHelperProgressUpdate','onImportOldDbProgressUpdate','14sOGspa','onMsgEventListUpdate','634041VZGvZW','onTempChatInfoUpdate','onRecvSysMsg','onGroupFileInfoAdd','12936HANJEG','1499855DtiEqw','onFirstViewGroupGuildMapping','onNtFirstViewMsgSyncEnd','onKickedOffLine'];_0x4158=function(){return _0x7ab159;};return _0x4158();}export class MsgListener{[_0x4a1306(0x156)](_0xa4ed18){}['onBroadcastHelperDownloadComplete'](_0x3071de){}[_0x4a1306(0x12c)](_0x3f5869){}[_0x4a1306(0x13d)](_0x25617d,_0x59028a,_0x3970e6){}['onContactUnreadCntUpdate'](_0x1dc532){}[_0x4a1306(0x13f)](_0x4526c0){}['onDraftUpdate'](_0x3da467,_0x4fd248,_0x4d1d4a){}[_0x4a1306(0x15d)](_0x1873ae){}[_0x4a1306(0x144)](_0x9f545a){}[_0x4a1306(0x13a)](_0x3a2ab4){}[_0x4a1306(0x163)](_0x6c66b3){}['onFirstViewDirectMsgUpdate'](_0x129aa3){}[_0x4a1306(0x136)](_0x593aa6){}[_0x4a1306(0x15c)](_0x352cc4,_0x22862d,_0x363b20,_0x1fd27f,_0x21a9f6){}[_0x4a1306(0x133)](_0x459b4b){}['onGroupFileInfoUpdate'](_0x510623){}[_0x4a1306(0x158)](_0x37d385){}[_0x4a1306(0x15a)](_0x30abcc){}['onGroupTransferInfoUpdate'](_0x340289){}[_0x4a1306(0x15f)](_0x22732b){}[_0x4a1306(0x145)](_0xc90842){}['onGuildNotificationAbstractUpdate'](_0x57af91){}[_0x4a1306(0x15b)](_0x20445c){}[_0x4a1306(0x129)](_0x4a78ce){}['onHitRelatedEmojiResult'](_0x33f6db){}[_0x4a1306(0x12d)](_0x3672a7){}['onInputStatusPush'](_0x5fd1a9){}[_0x4a1306(0x138)](_0x2e5b9c){}[_0x4a1306(0x162)](_0x50b5e9){}[_0x4a1306(0x12b)](_0x2b9522){}[_0x4a1306(0x161)](_0x9e7422){}['onMsgBoxChanged'](_0x5299fc){}[_0x4a1306(0x13c)](_0x2bdc6a,_0x2103bc){}[_0x4a1306(0x12f)](_0x38e260){}[_0x4a1306(0x153)](_0x424122){}['onMsgInfoListUpdate'](_0x26c26b){}[_0x4a1306(0x13e)](_0x2bee6d){}[_0x4a1306(0x157)](_0x3638f5,_0x59ee12,_0x488bb8){}[_0x4a1306(0x14f)](_0x314e52){}[_0x4a1306(0x160)](_0x3e176d){}[_0x4a1306(0x137)](){}[_0x4a1306(0x150)](){}[_0x4a1306(0x155)](){}[_0x4a1306(0x14a)](_0x37f7c2){}['onRecvGroupGuildFlag'](_0x48af1d){}['onRecvMsg'](_0x361cbc){}[_0x4a1306(0x14c)](_0x5e3e44,_0x25efc2,_0x563d7d,_0xb5bbfe,_0x5b319f,_0x37b786){}[_0x4a1306(0x146)](_0x9e2641){}['onRecvS2CMsg'](_0xa51c0c){}[_0x4a1306(0x132)](_0x47d627){}[_0x4a1306(0x13b)](_0x1d59a3){}[_0x4a1306(0x142)](_0x3e24a7){}[_0x4a1306(0x152)](_0x241bbb){}[_0x4a1306(0x140)](_0x1de099){}['onSearchGroupFileInfoUpdate'](_0x55eaff){}[_0x4a1306(0x149)](_0x400d50,_0xa64101,_0x33d014,_0x2ce6e8){}['onSysMsgNotification'](_0x2796ba,_0x5e529b,_0x42ee2c,_0x928b5e){}[_0x4a1306(0x131)](_0x2d3a78){}[_0x4a1306(0x151)](_0x26e8ca){}[_0x4a1306(0x14e)](_0x175eeb){}[_0x4a1306(0x147)](_0x5c7e6b){}[_0x4a1306(0x148)](_0x50094e){}[_0x4a1306(0x15e)](_0x364e59){}[_0x4a1306(0x139)](_0x71a425,_0x27bbc8,_0x455745){}[_0x4a1306(0x143)](_0x37b0af,_0x3ec7b7,_0x213932){}[_0x4a1306(0x12a)](..._0x5f102f){}[_0x4a1306(0x127)](..._0x48a4cd){}[_0x4a1306(0x154)](..._0x312ea0){}}
|
19
src/core.lib/src/qqnt/listeners/NodeIKernelProfileListener .d.ts
vendored
Normal file
19
src/core.lib/src/qqnt/listeners/NodeIKernelProfileListener .d.ts
vendored
Normal file
@ -0,0 +1,19 @@
|
|||||||
|
import { User } from '@/core/qqnt/entities';
|
||||||
|
interface IProfileListener {
|
||||||
|
onProfileSimpleChanged(...args: unknown[]): void;
|
||||||
|
onProfileDetailInfoChanged(profile: User): void;
|
||||||
|
onStatusUpdate(...args: unknown[]): void;
|
||||||
|
onSelfStatusChanged(...args: unknown[]): void;
|
||||||
|
onStrangerRemarkChanged(...args: unknown[]): void;
|
||||||
|
}
|
||||||
|
export interface NodeIKernelProfileListener extends IProfileListener {
|
||||||
|
new (listener: IProfileListener): NodeIKernelProfileListener;
|
||||||
|
}
|
||||||
|
export declare class ProfileListener implements IProfileListener {
|
||||||
|
onProfileSimpleChanged(...args: unknown[]): void;
|
||||||
|
onProfileDetailInfoChanged(profile: User): void;
|
||||||
|
onStatusUpdate(...args: unknown[]): void;
|
||||||
|
onSelfStatusChanged(...args: unknown[]): void;
|
||||||
|
onStrangerRemarkChanged(...args: unknown[]): void;
|
||||||
|
}
|
||||||
|
export {};
|
@ -0,0 +1 @@
|
|||||||
|
function _0xa02b(){var _0x38b05f=['3WHcKni','onProfileDetailInfoChanged','2318520meNvvA','9HiOAZq','15xirqUi','912810wgZoGe','onStatusUpdate','12vlqEyM','410568BVbeyP','22OpMqRq','40652zuoprD','onStrangerRemarkChanged','2021692eBeQXU','1769565vVqUcL','1055298TvJtNI'];_0xa02b=function(){return _0x38b05f;};return _0xa02b();}function _0x24d7(_0x6389c8,_0x1a7f4c){var _0xa02b55=_0xa02b();return _0x24d7=function(_0x24d720,_0x34c9a7){_0x24d720=_0x24d720-0x1a2;var _0x5386c4=_0xa02b55[_0x24d720];return _0x5386c4;},_0x24d7(_0x6389c8,_0x1a7f4c);}var _0x3581e7=_0x24d7;(function(_0xc786b7,_0x3c1b81){var _0x41992c=_0x24d7,_0x1136a9=_0xc786b7();while(!![]){try{var _0x1267e1=-parseInt(_0x41992c(0x1a7))/0x1*(parseInt(_0x41992c(0x1a4))/0x2)+-parseInt(_0x41992c(0x1ac))/0x3*(-parseInt(_0x41992c(0x1a9))/0x4)+-parseInt(_0x41992c(0x1b0))/0x5*(-parseInt(_0x41992c(0x1ab))/0x6)+-parseInt(_0x41992c(0x1aa))/0x7+-parseInt(_0x41992c(0x1ae))/0x8*(parseInt(_0x41992c(0x1af))/0x9)+parseInt(_0x41992c(0x1a2))/0xa+parseInt(_0x41992c(0x1a6))/0xb*(-parseInt(_0x41992c(0x1a5))/0xc);if(_0x1267e1===_0x3c1b81)break;else _0x1136a9['push'](_0x1136a9['shift']());}catch(_0x515b59){_0x1136a9['push'](_0x1136a9['shift']());}}}(_0xa02b,0x41c5b));export class ProfileListener{['onProfileSimpleChanged'](..._0x461b64){}[_0x3581e7(0x1ad)](_0x1deda0){}[_0x3581e7(0x1a3)](..._0x6740ba){}['onSelfStatusChanged'](..._0x19bc69){}[_0x3581e7(0x1a8)](..._0x481248){}}
|
19
src/core.lib/src/qqnt/listeners/NodeIKernelSessionListener.d.ts
vendored
Normal file
19
src/core.lib/src/qqnt/listeners/NodeIKernelSessionListener.d.ts
vendored
Normal file
@ -0,0 +1,19 @@
|
|||||||
|
export interface ISessionListener {
|
||||||
|
onNTSessionCreate(args: unknown): void;
|
||||||
|
onGProSessionCreate(args: unknown): void;
|
||||||
|
onSessionInitComplete(args: unknown): void;
|
||||||
|
onOpentelemetryInit(args: unknown): void;
|
||||||
|
onUserOnlineResult(args: unknown): void;
|
||||||
|
onGetSelfTinyId(args: unknown): void;
|
||||||
|
}
|
||||||
|
export interface NodeIKernelSessionListener extends ISessionListener {
|
||||||
|
new (adapter: ISessionListener): NodeIKernelSessionListener;
|
||||||
|
}
|
||||||
|
export declare class SessionListener implements ISessionListener {
|
||||||
|
onNTSessionCreate(args: unknown): void;
|
||||||
|
onGProSessionCreate(args: unknown): void;
|
||||||
|
onSessionInitComplete(args: unknown): void;
|
||||||
|
onOpentelemetryInit(args: unknown): void;
|
||||||
|
onUserOnlineResult(args: unknown): void;
|
||||||
|
onGetSelfTinyId(args: unknown): void;
|
||||||
|
}
|
@ -0,0 +1 @@
|
|||||||
|
var _0x38fd0d=_0xf381;function _0x2330(){var _0x1ecf00=['139286iTHYqj','onUserOnlineResult','1320992NMjMTt','100VrEbtn','onGetSelfTinyId','1uJtDES','415010XUkzAP','onNTSessionCreate','6JAroNX','4407kFZeMi','311210oJXcNJ','onGProSessionCreate','250VbPYcf','onOpentelemetryInit','1686036cBOPAJ','42317sQoTDU','9nUBayg'];_0x2330=function(){return _0x1ecf00;};return _0x2330();}(function(_0x10a438,_0x5e6570){var _0x3e2558=_0xf381,_0x1b6791=_0x10a438();while(!![]){try{var _0x4f3bc6=parseInt(_0x3e2558(0x184))/0x1*(-parseInt(_0x3e2558(0x189))/0x2)+parseInt(_0x3e2558(0x188))/0x3*(-parseInt(_0x3e2558(0x182))/0x4)+-parseInt(_0x3e2558(0x185))/0x5+parseInt(_0x3e2558(0x187))/0x6*(-parseInt(_0x3e2558(0x17f))/0x7)+-parseInt(_0x3e2558(0x181))/0x8*(-parseInt(_0x3e2558(0x17e))/0x9)+-parseInt(_0x3e2558(0x18b))/0xa*(-parseInt(_0x3e2558(0x17d))/0xb)+parseInt(_0x3e2558(0x17c))/0xc;if(_0x4f3bc6===_0x5e6570)break;else _0x1b6791['push'](_0x1b6791['shift']());}catch(_0x5933ba){_0x1b6791['push'](_0x1b6791['shift']());}}}(_0x2330,0x1a04c));function _0xf381(_0x235bea,_0x3f1ac8){var _0x233055=_0x2330();return _0xf381=function(_0xf3814,_0x3db72e){_0xf3814=_0xf3814-0x17b;var _0x40dca2=_0x233055[_0xf3814];return _0x40dca2;},_0xf381(_0x235bea,_0x3f1ac8);}export class SessionListener{[_0x38fd0d(0x186)](_0x5710e4){}[_0x38fd0d(0x18a)](_0x5df262){}['onSessionInitComplete'](_0x3cc829){}[_0x38fd0d(0x17b)](_0x1c961d){}[_0x38fd0d(0x180)](_0x3763b1){}[_0x38fd0d(0x183)](_0x34b926){}}
|
6
src/core.lib/src/qqnt/listeners/index.d.ts
vendored
Normal file
6
src/core.lib/src/qqnt/listeners/index.d.ts
vendored
Normal file
@ -0,0 +1,6 @@
|
|||||||
|
export * from './NodeIKernelSessionListener';
|
||||||
|
export * from './NodeIKernelLoginListener';
|
||||||
|
export * from './NodeIKernelMsgListener';
|
||||||
|
export * from './NodeIKernelGroupListener';
|
||||||
|
export * from './NodeIKernelBuddyListener';
|
||||||
|
export * from './NodeIKernelProfileListener ';
|
1
src/core.lib/src/qqnt/listeners/index.js
Normal file
1
src/core.lib/src/qqnt/listeners/index.js
Normal file
@ -0,0 +1 @@
|
|||||||
|
function _0x11be(){var _0x437266=['3qBCYSX','28ggHEEs','1166216woSBCP','272972NsOsYC','87410Niolyw','1921532sXiaHi','36tmOJqF','2608260ymgbbU','517WVEJlS','9emAsQD','137748GzgQBv','53166mzwvzi'];_0x11be=function(){return _0x437266;};return _0x11be();}(function(_0xcfbc2b,_0x4ee88c){var _0x4106a8=_0x3048,_0x3991f2=_0xcfbc2b();while(!![]){try{var _0x396463=parseInt(_0x4106a8(0xf3))/0x1*(-parseInt(_0x4106a8(0xf5))/0x2)+-parseInt(_0x4106a8(0xf4))/0x3*(-parseInt(_0x4106a8(0xed))/0x4)+parseInt(_0x4106a8(0xef))/0x5+-parseInt(_0x4106a8(0xee))/0x6*(parseInt(_0x4106a8(0xf7))/0x7)+parseInt(_0x4106a8(0xf6))/0x8*(-parseInt(_0x4106a8(0xf1))/0x9)+-parseInt(_0x4106a8(0xf8))/0xa+-parseInt(_0x4106a8(0xf0))/0xb*(-parseInt(_0x4106a8(0xf2))/0xc);if(_0x396463===_0x4ee88c)break;else _0x3991f2['push'](_0x3991f2['shift']());}catch(_0x2bdc5c){_0x3991f2['push'](_0x3991f2['shift']());}}}(_0x11be,0x63c9a));export*from'./NodeIKernelSessionListener';export*from'./NodeIKernelLoginListener';export*from'./NodeIKernelMsgListener';export*from'./NodeIKernelGroupListener';function _0x3048(_0x2bca97,_0x3acd32){var _0x11befa=_0x11be();return _0x3048=function(_0x30480c,_0x13397b){_0x30480c=_0x30480c-0xed;var _0x1559a9=_0x11befa[_0x30480c];return _0x1559a9;},_0x3048(_0x2bca97,_0x3acd32);}export*from'./NodeIKernelBuddyListener';export*from'./NodeIKernelProfileListener\x20';
|
17
src/core.lib/src/qqnt/services/NodeIKernelAvatarService.d.ts
vendored
Normal file
17
src/core.lib/src/qqnt/services/NodeIKernelAvatarService.d.ts
vendored
Normal file
@ -0,0 +1,17 @@
|
|||||||
|
export interface NodeIKernelAvatarService {
|
||||||
|
addAvatarListener(...args: unknown[]): unknown;
|
||||||
|
removeAvatarListener(...args: unknown[]): unknown;
|
||||||
|
getAvatarPath(...args: unknown[]): unknown;
|
||||||
|
forceDownloadAvatar(...args: unknown[]): unknown;
|
||||||
|
getGroupAvatarPath(...args: unknown[]): unknown;
|
||||||
|
getConfGroupAvatarPath(...args: unknown[]): unknown;
|
||||||
|
forceDownloadGroupAvatar(...args: unknown[]): unknown;
|
||||||
|
getGroupPortraitPath(...args: unknown[]): unknown;
|
||||||
|
forceDownloadGroupPortrait(...args: unknown[]): unknown;
|
||||||
|
getAvatarPaths(...args: unknown[]): unknown;
|
||||||
|
getGroupAvatarPaths(...args: unknown[]): unknown;
|
||||||
|
getConfGroupAvatarPaths(...args: unknown[]): unknown;
|
||||||
|
getAvatarPathByUin(...args: unknown[]): unknown;
|
||||||
|
forceDownloadAvatarByUin(...args: unknown[]): unknown;
|
||||||
|
isNull(): boolean;
|
||||||
|
}
|
@ -0,0 +1 @@
|
|||||||
|
export{};
|
55
src/core.lib/src/qqnt/services/NodeIKernelBuddyService.d.ts
vendored
Normal file
55
src/core.lib/src/qqnt/services/NodeIKernelBuddyService.d.ts
vendored
Normal file
@ -0,0 +1,55 @@
|
|||||||
|
import { Friend } from '@/core/qqnt/entities';
|
||||||
|
import { GeneralCallResult } from '@/core/qqnt/services/common';
|
||||||
|
import { NodeIKernelBuddyListener } from '@/core/qqnt/listeners';
|
||||||
|
export interface NodeIKernelBuddyService {
|
||||||
|
friends: Friend[];
|
||||||
|
getFriend(uidOrUin: string): Promise<Friend>;
|
||||||
|
addKernelBuddyListener(listener: NodeIKernelBuddyListener): void;
|
||||||
|
removeKernelBuddyListener(listener: unknown): void;
|
||||||
|
getBuddyList(bool: boolean): Promise<GeneralCallResult>;
|
||||||
|
getBuddyNick(uid: number): string;
|
||||||
|
getBuddyRemark(uid: number): string;
|
||||||
|
setBuddyRemark(uid: number, remark: string): void;
|
||||||
|
getAvatarUrl(uid: number): string;
|
||||||
|
isBuddy(uid: number): boolean;
|
||||||
|
getCategoryNameWithUid(uid: number): string;
|
||||||
|
getTargetBuddySetting(uid: number): unknown;
|
||||||
|
getTargetBuddySettingByType(uid: number, type: number): unknown;
|
||||||
|
getBuddyReqUnreadCnt(): number;
|
||||||
|
getBuddyReq(): unknown;
|
||||||
|
delBuddyReq(uid: number): void;
|
||||||
|
clearBuddyReqUnreadCnt(): void;
|
||||||
|
reqToAddFriends(uid: number, msg: string): void;
|
||||||
|
setSpacePermission(uid: number, permission: number): void;
|
||||||
|
approvalFriendRequest(arg: {
|
||||||
|
friendUid: string;
|
||||||
|
reqTime: string;
|
||||||
|
accept: boolean;
|
||||||
|
}): Promise<void>;
|
||||||
|
delBuddy(uid: number): void;
|
||||||
|
delBatchBuddy(uids: number[]): void;
|
||||||
|
getSmartInfos(uid: number): unknown;
|
||||||
|
setBuddyCategory(uid: number, category: number): void;
|
||||||
|
setBatchBuddyCategory(uids: number[], category: number): void;
|
||||||
|
addCategory(category: string): void;
|
||||||
|
delCategory(category: string): void;
|
||||||
|
renameCategory(oldCategory: string, newCategory: string): void;
|
||||||
|
resortCategory(categorys: string[]): void;
|
||||||
|
pullCategory(uid: number, category: string): void;
|
||||||
|
setTop(uid: number, isTop: boolean): void;
|
||||||
|
SetSpecialCare(uid: number, isSpecialCare: boolean): void;
|
||||||
|
setMsgNotify(uid: number, isNotify: boolean): void;
|
||||||
|
hasBuddyList(): boolean;
|
||||||
|
setBlock(uid: number, isBlock: boolean): void;
|
||||||
|
isBlocked(uid: number): boolean;
|
||||||
|
modifyAddMeSetting(setting: unknown): void;
|
||||||
|
getAddMeSetting(): unknown;
|
||||||
|
getDoubtBuddyReq(): unknown;
|
||||||
|
getDoubtBuddyUnreadNum(): number;
|
||||||
|
approvalDoubtBuddyReq(uid: number, isAgree: boolean): void;
|
||||||
|
delDoubtBuddyReq(uid: number): void;
|
||||||
|
delAllDoubtBuddyReq(): void;
|
||||||
|
reportDoubtBuddyReqUnread(): void;
|
||||||
|
getBuddyRecommendContactArkJson(): unknown;
|
||||||
|
isNull(): boolean;
|
||||||
|
}
|
@ -0,0 +1 @@
|
|||||||
|
export{};
|
19
src/core.lib/src/qqnt/services/NodeIKernelFileAssistantService.d.ts
vendored
Normal file
19
src/core.lib/src/qqnt/services/NodeIKernelFileAssistantService.d.ts
vendored
Normal file
@ -0,0 +1,19 @@
|
|||||||
|
export interface NodeIKernelFileAssistantService {
|
||||||
|
addKernelFileAssistantListener(...args: unknown[]): unknown;
|
||||||
|
removeKernelFileAssistantListener(...args: unknown[]): unknown;
|
||||||
|
getFileAssistantList(...args: unknown[]): unknown;
|
||||||
|
getMoreFileAssistantList(...args: unknown[]): unknown;
|
||||||
|
getFileSessionList(...args: unknown[]): unknown;
|
||||||
|
searchFile(...args: unknown[]): unknown;
|
||||||
|
resetSearchFileSortType(...args: unknown[]): unknown;
|
||||||
|
searchMoreFile(...args: unknown[]): unknown;
|
||||||
|
cancelSearchFile(...args: unknown[]): unknown;
|
||||||
|
downloadFile(...args: unknown[]): unknown;
|
||||||
|
forwardFile(...args: unknown[]): unknown;
|
||||||
|
cancelFileAction(...args: unknown[]): unknown;
|
||||||
|
retryFileAction(...args: unknown[]): unknown;
|
||||||
|
deleteFile(...args: unknown[]): unknown;
|
||||||
|
saveAs(...args: unknown[]): unknown;
|
||||||
|
saveAsWithRename(...args: unknown[]): unknown;
|
||||||
|
isNull(): boolean;
|
||||||
|
}
|
@ -0,0 +1 @@
|
|||||||
|
export{};
|
84
src/core.lib/src/qqnt/services/NodeIKernelGroupService.d.ts
vendored
Normal file
84
src/core.lib/src/qqnt/services/NodeIKernelGroupService.d.ts
vendored
Normal file
@ -0,0 +1,84 @@
|
|||||||
|
import { NodeIKernelGroupListener } from '@/core/qqnt/listeners/NodeIKernelGroupListener';
|
||||||
|
import { GroupMember, GroupMemberRole, GroupNotifyTypes, GroupRequestOperateTypes } from '@/core/qqnt/entities';
|
||||||
|
import { GeneralCallResult } from '@/core/qqnt/services/common';
|
||||||
|
export interface NodeIKernelGroupService {
|
||||||
|
addKernelGroupListener(listener: NodeIKernelGroupListener): void;
|
||||||
|
removeKernelGroupListener(listenerId: unknown): void;
|
||||||
|
createMemberListScene(groupCode: string, scene: string): string;
|
||||||
|
destroyMemberListScene(): void;
|
||||||
|
getNextMemberList(sceneId: string, a: undefined, num: number): Promise<{
|
||||||
|
errCode: number;
|
||||||
|
errMsg: string;
|
||||||
|
result: {
|
||||||
|
ids: string[];
|
||||||
|
infos: Map<string, GroupMember>;
|
||||||
|
finish: boolean;
|
||||||
|
hasRobot: boolean;
|
||||||
|
};
|
||||||
|
}>;
|
||||||
|
getPrevMemberList(): unknown;
|
||||||
|
monitorMemberList(): unknown;
|
||||||
|
searchMember(uid: string): unknown;
|
||||||
|
getMemberInfo(uid: string): unknown;
|
||||||
|
kickMember(groupCode: string, memberUids: string[], refuseForever: boolean, kickReason: string): Promise<void>;
|
||||||
|
modifyMemberRole(groupCode: string, uid: string, role: GroupMemberRole): void;
|
||||||
|
modifyMemberCardName(groupCode: string, uid: string, cardName: string): void;
|
||||||
|
getTransferableMemberInfo(uid: string): unknown;
|
||||||
|
transferGroup(uid: string): void;
|
||||||
|
getGroupList(force: boolean): Promise<GeneralCallResult>;
|
||||||
|
getGroupExtList(force: boolean): Promise<GeneralCallResult>;
|
||||||
|
getGroupDetailInfo(groupCode: string): unknown;
|
||||||
|
getGroupAllInfo(): unknown;
|
||||||
|
getDiscussExistInfo(): unknown;
|
||||||
|
getGroupConfMember(): unknown;
|
||||||
|
getGroupMsgMask(): unknown;
|
||||||
|
getGroupPortrait(): void;
|
||||||
|
modifyGroupName(groupCode: string, groupName: string, arg: false): void;
|
||||||
|
modifyGroupRemark(groupCode: string, remark: string): void;
|
||||||
|
modifyGroupDetailInfo(groupCode: string, arg: unknown): void;
|
||||||
|
setGroupMsgMask(groupCode: string, arg: unknown): void;
|
||||||
|
changeGroupShieldSettingTemp(groupCode: string, arg: unknown): void;
|
||||||
|
inviteToGroup(arg: unknown): void;
|
||||||
|
inviteMembersToGroup(args: unknown[]): void;
|
||||||
|
inviteMembersToGroupWithMsg(args: unknown): void;
|
||||||
|
createGroup(arg: unknown): void;
|
||||||
|
createGroupWithMembers(arg: unknown): void;
|
||||||
|
quitGroup(groupCode: string): void;
|
||||||
|
destroyGroup(groupCode: string): void;
|
||||||
|
getSingleScreenNotifies(groupCode: string, ...args: unknown[]): void;
|
||||||
|
clearGroupNotifies(groupCode: string): void;
|
||||||
|
getGroupNotifiesUnreadCount(groupCode: string): void;
|
||||||
|
clearGroupNotifiesUnreadCount(groupCode: string): void;
|
||||||
|
operateSysNotify(doubt: boolean, operateMsg: {
|
||||||
|
'operateType': GroupRequestOperateTypes;
|
||||||
|
'targetMsg': {
|
||||||
|
'seq': string;
|
||||||
|
'type': GroupNotifyTypes;
|
||||||
|
'groupCode': string;
|
||||||
|
'postscript': string;
|
||||||
|
};
|
||||||
|
}): Promise<void>;
|
||||||
|
setTop(groupCode: string, isTop: boolean): void;
|
||||||
|
getGroupBulletin(groupCode: string): unknown;
|
||||||
|
deleteGroupBulletin(groupCode: string, seq: string): void;
|
||||||
|
publishGroupBulletin(groupCode: string, arg: unknown): void;
|
||||||
|
publishInstructionForNewcomers(groupCode: string, arg: unknown): void;
|
||||||
|
uploadGroupBulletinPic(groupCode: string, arg: unknown): void;
|
||||||
|
downloadGroupBulletinRichMedia(groupCode: string): unknown;
|
||||||
|
getGroupBulletinList(groupCode: string): unknown;
|
||||||
|
getGroupStatisticInfo(groupCode: string): unknown;
|
||||||
|
getGroupRemainAtTimes(groupCode: string): number;
|
||||||
|
getJoinGroupNoVerifyFlag(groupCode: string): unknown;
|
||||||
|
getGroupArkInviteState(groupCode: string): unknown;
|
||||||
|
reqToJoinGroup(groupCode: string, arg: unknown): void;
|
||||||
|
setGroupShutUp(groupCode: string, shutUp: boolean): void;
|
||||||
|
getGroupShutUpMemberList(groupCode: string): unknown[];
|
||||||
|
setMemberShutUp(groupCode: string, memberTimes: {
|
||||||
|
uid: string;
|
||||||
|
timeStamp: number;
|
||||||
|
}[]): Promise<void>;
|
||||||
|
getGroupRecommendContactArkJson(groupCode: string): unknown;
|
||||||
|
getJoinGroupLink(groupCode: string): unknown;
|
||||||
|
modifyGroupExtInfo(groupCode: string, arg: unknown): void;
|
||||||
|
isNull(): boolean;
|
||||||
|
}
|
@ -0,0 +1 @@
|
|||||||
|
export{};
|
76
src/core.lib/src/qqnt/services/NodeIKernelLoginService.d.ts
vendored
Normal file
76
src/core.lib/src/qqnt/services/NodeIKernelLoginService.d.ts
vendored
Normal file
@ -0,0 +1,76 @@
|
|||||||
|
import { NodeIKernelLoginListener } from '@/core/qqnt/listeners/NodeIKernelLoginListener';
|
||||||
|
export interface LoginInitConfig {
|
||||||
|
machineId: '';
|
||||||
|
appid: string;
|
||||||
|
platVer: string;
|
||||||
|
commonPath: string;
|
||||||
|
clientVer: string;
|
||||||
|
hostName: string;
|
||||||
|
}
|
||||||
|
export interface passwordLoginRetType {
|
||||||
|
result: string;
|
||||||
|
loginErrorInfo: {
|
||||||
|
step: number;
|
||||||
|
errMsg: string;
|
||||||
|
proofWaterUrl: string;
|
||||||
|
newDevicePullQrCodeSig: string;
|
||||||
|
jumpUrl: string;
|
||||||
|
jumpWord: string;
|
||||||
|
tipsTitle: string;
|
||||||
|
tipsContent: string;
|
||||||
|
};
|
||||||
|
}
|
||||||
|
export interface passwordLoginArgType {
|
||||||
|
uin: string;
|
||||||
|
passwordMd5: string;
|
||||||
|
step: number;
|
||||||
|
newDeviceLoginSig: string;
|
||||||
|
proofWaterSig: string;
|
||||||
|
proofWaterRand: string;
|
||||||
|
proofWaterSid: string;
|
||||||
|
}
|
||||||
|
export interface QRCodeLoginSucceedType {
|
||||||
|
account: string;
|
||||||
|
mainAccount: string;
|
||||||
|
uin: string;
|
||||||
|
uid: string;
|
||||||
|
nickName: string;
|
||||||
|
gender: number;
|
||||||
|
age: number;
|
||||||
|
faceUrl: string;
|
||||||
|
}
|
||||||
|
export interface LoginListItem {
|
||||||
|
uin: string;
|
||||||
|
uid: string;
|
||||||
|
nickName: string;
|
||||||
|
faceUrl: string;
|
||||||
|
facePath: string;
|
||||||
|
loginType: 1;
|
||||||
|
isQuickLogin: boolean;
|
||||||
|
isAutoLogin: boolean;
|
||||||
|
}
|
||||||
|
export interface NodeIKernelLoginService {
|
||||||
|
new (): NodeIKernelLoginService;
|
||||||
|
addKernelLoginListener(listener: NodeIKernelLoginListener): void;
|
||||||
|
initConfig(config: LoginInitConfig): void;
|
||||||
|
getLoginMiscData(cb: (r: unknown) => void): void;
|
||||||
|
getLoginList(): Promise<{
|
||||||
|
result: number;
|
||||||
|
LocalLoginInfoList: LoginListItem[];
|
||||||
|
}>;
|
||||||
|
quickLoginWithUin(uin: string): Promise<{
|
||||||
|
result: string;
|
||||||
|
loginErrorInfo: {
|
||||||
|
step: number;
|
||||||
|
errMsg: string;
|
||||||
|
proofWaterUrl: string;
|
||||||
|
newDevicePullQrCodeSig: string;
|
||||||
|
jumpUrl: string;
|
||||||
|
jumpWord: string;
|
||||||
|
tipsTitle: string;
|
||||||
|
tipsContent: string;
|
||||||
|
};
|
||||||
|
}>;
|
||||||
|
passwordLogin(param: passwordLoginArgType): Promise<any>;
|
||||||
|
getQRCodePicture(): boolean;
|
||||||
|
}
|
@ -0,0 +1 @@
|
|||||||
|
export{};
|
299
src/core.lib/src/qqnt/services/NodeIKernelMsgService.d.ts
vendored
Normal file
299
src/core.lib/src/qqnt/services/NodeIKernelMsgService.d.ts
vendored
Normal file
@ -0,0 +1,299 @@
|
|||||||
|
import { ElementType, Peer, RawMessage, SendMessageElement } from '@/core/qqnt/entities';
|
||||||
|
import { NodeIKernelMsgListener } from '@/core/qqnt/listeners/NodeIKernelMsgListener';
|
||||||
|
import { GeneralCallResult } from '@/core/qqnt/services/common';
|
||||||
|
export interface NodeIKernelMsgService {
|
||||||
|
addKernelMsgListener(nodeIKernelMsgListener: NodeIKernelMsgListener): void;
|
||||||
|
sendMsg(msgId: string, peer: Peer, msgElements: SendMessageElement[], map: Map<any, any>): Promise<unknown>;
|
||||||
|
recallMsg(peer: Peer, msgIds: string[]): Promise<GeneralCallResult>;
|
||||||
|
addKernelMsgImportToolListener(...args: unknown[]): unknown;
|
||||||
|
removeKernelMsgListener(...args: unknown[]): unknown;
|
||||||
|
addKernelTempChatSigListener(...args: unknown[]): unknown;
|
||||||
|
removeKernelTempChatSigListener(...args: unknown[]): unknown;
|
||||||
|
setAutoReplyTextList(...args: unknown[]): unknown;
|
||||||
|
getAutoReplyTextList(...args: unknown[]): unknown;
|
||||||
|
getOnLineDev(...args: unknown[]): unknown;
|
||||||
|
kickOffLine(...args: unknown[]): unknown;
|
||||||
|
setStatus(...args: unknown[]): unknown;
|
||||||
|
fetchStatusMgrInfo(...args: unknown[]): unknown;
|
||||||
|
fetchStatusUnitedConfigInfo(...args: unknown[]): unknown;
|
||||||
|
getOnlineStatusSmallIconBasePath(...args: unknown[]): unknown;
|
||||||
|
getOnlineStatusSmallIconFileNameByUrl(...args: unknown[]): unknown;
|
||||||
|
downloadOnlineStatusSmallIconByUrl(...args: unknown[]): unknown;
|
||||||
|
getOnlineStatusBigIconBasePath(...args: unknown[]): unknown;
|
||||||
|
downloadOnlineStatusBigIconByUrl(...args: unknown[]): unknown;
|
||||||
|
getOnlineStatusCommonPath(...args: unknown[]): unknown;
|
||||||
|
getOnlineStatusCommonFileNameByUrl(...args: unknown[]): unknown;
|
||||||
|
downloadOnlineStatusCommonByUrl(...args: unknown[]): unknown;
|
||||||
|
setToken(...args: unknown[]): unknown;
|
||||||
|
switchForeGround(...args: unknown[]): unknown;
|
||||||
|
switchBackGround(...args: unknown[]): unknown;
|
||||||
|
setTokenForMqq(...args: unknown[]): unknown;
|
||||||
|
switchForeGroundForMqq(...args: unknown[]): unknown;
|
||||||
|
switchBackGroundForMqq(...args: unknown[]): unknown;
|
||||||
|
getMsgSetting(...args: unknown[]): unknown;
|
||||||
|
setMsgSetting(...args: unknown[]): unknown;
|
||||||
|
addSendMsg(...args: unknown[]): unknown;
|
||||||
|
cancelSendMsg(...args: unknown[]): unknown;
|
||||||
|
switchToOfflineSendMsg(...args: unknown[]): unknown;
|
||||||
|
reqToOfflineSendMsg(...args: unknown[]): unknown;
|
||||||
|
refuseReceiveOnlineFileMsg(...args: unknown[]): unknown;
|
||||||
|
resendMsg(...args: unknown[]): unknown;
|
||||||
|
recallMsg(...args: unknown[]): unknown;
|
||||||
|
reeditRecallMsg(...args: unknown[]): unknown;
|
||||||
|
forwardMsg(...args: unknown[]): unknown;
|
||||||
|
forwardMsgWithComment(...args: unknown[]): unknown;
|
||||||
|
forwardSubMsgWithComment(...args: unknown[]): unknown;
|
||||||
|
forwardRichMsgInVist(...args: unknown[]): unknown;
|
||||||
|
forwardFile(...args: unknown[]): unknown;
|
||||||
|
multiForwardMsg(...args: unknown[]): unknown;
|
||||||
|
multiForwardMsgWithComment(...args: unknown[]): unknown;
|
||||||
|
deleteRecallMsg(...args: unknown[]): unknown;
|
||||||
|
deleteRecallMsgForLocal(...args: unknown[]): unknown;
|
||||||
|
addLocalGrayTipMsg(...args: unknown[]): unknown;
|
||||||
|
addLocalJsonGrayTipMsg(...args: unknown[]): unknown;
|
||||||
|
addLocalJsonGrayTipMsgExt(...args: unknown[]): unknown;
|
||||||
|
IsLocalJsonTipValid(...args: unknown[]): unknown;
|
||||||
|
addLocalAVRecordMsg(...args: unknown[]): unknown;
|
||||||
|
addLocalTofuRecordMsg(...args: unknown[]): unknown;
|
||||||
|
addLocalRecordMsg(...args: unknown[]): unknown;
|
||||||
|
deleteMsg(...args: unknown[]): unknown;
|
||||||
|
updateElementExtBufForUI(...args: unknown[]): unknown;
|
||||||
|
updateMsgRecordExtPbBufForUI(...args: unknown[]): unknown;
|
||||||
|
startMsgSync(...args: unknown[]): unknown;
|
||||||
|
startGuildMsgSync(...args: unknown[]): unknown;
|
||||||
|
isGuildChannelSync(...args: unknown[]): unknown;
|
||||||
|
getMsgUniqueId(...args: unknown[]): unknown;
|
||||||
|
isMsgMatched(...args: unknown[]): unknown;
|
||||||
|
getOnlineFileMsgs(...args: unknown[]): unknown;
|
||||||
|
getAllOnlineFileMsgs(...args: unknown[]): unknown;
|
||||||
|
getLatestDbMsgs(...args: unknown[]): unknown;
|
||||||
|
getLastMessageList(...args: unknown[]): unknown;
|
||||||
|
getAioFirstViewLatestMsgs(...args: unknown[]): unknown;
|
||||||
|
getMsgs(...args: unknown[]): unknown;
|
||||||
|
getMsgsIncludeSelf(peer: Peer, msgId: string, count: number, queryOrder: boolean): Promise<GeneralCallResult & {
|
||||||
|
msgList: RawMessage[];
|
||||||
|
}>;
|
||||||
|
getMsgsWithMsgTimeAndClientSeqForC2C(...args: unknown[]): unknown;
|
||||||
|
getMsgsWithStatus(...args: unknown[]): unknown;
|
||||||
|
getMsgsBySeqRange(...args: unknown[]): unknown;
|
||||||
|
getMsgsBySeqAndCount(...args: unknown[]): unknown;
|
||||||
|
getMsgsByMsgId(...args: unknown[]): unknown;
|
||||||
|
getRecallMsgsByMsgId(...args: unknown[]): unknown;
|
||||||
|
getMsgsBySeqList(...args: unknown[]): unknown;
|
||||||
|
getSingleMsg(...args: unknown[]): unknown;
|
||||||
|
getSourceOfReplyMsg(...args: unknown[]): unknown;
|
||||||
|
getSourceOfReplyMsgV2(...args: unknown[]): unknown;
|
||||||
|
getMsgByClientSeqAndTime(...args: unknown[]): unknown;
|
||||||
|
getSourceOfReplyMsgByClientSeqAndTime(...args: unknown[]): unknown;
|
||||||
|
getMsgsByTypeFilter(...args: unknown[]): unknown;
|
||||||
|
getMsgsByTypeFilters(...args: unknown[]): unknown;
|
||||||
|
getMsgWithAbstractByFilterParam(...args: unknown[]): unknown;
|
||||||
|
queryMsgsWithFilter(...args: unknown[]): unknown;
|
||||||
|
queryMsgsWithFilterVer2(...args: unknown[]): unknown;
|
||||||
|
queryMsgsWithFilterEx(...args: unknown[]): unknown;
|
||||||
|
queryFileMsgsDesktop(...args: unknown[]): unknown;
|
||||||
|
setMsgRichInfoFlag(...args: unknown[]): unknown;
|
||||||
|
queryPicOrVideoMsgs(...args: unknown[]): unknown;
|
||||||
|
queryPicOrVideoMsgsDesktop(...args: unknown[]): unknown;
|
||||||
|
queryEmoticonMsgs(...args: unknown[]): unknown;
|
||||||
|
queryTroopEmoticonMsgs(...args: unknown[]): unknown;
|
||||||
|
queryMsgsAndAbstractsWithFilter(...args: unknown[]): unknown;
|
||||||
|
setFocusOnGuild(...args: unknown[]): unknown;
|
||||||
|
setFocusSession(...args: unknown[]): unknown;
|
||||||
|
enableFilterUnreadInfoNotify(...args: unknown[]): unknown;
|
||||||
|
enableFilterMsgAbstractNotify(...args: unknown[]): unknown;
|
||||||
|
onScenesChangeForSilenceMode(...args: unknown[]): unknown;
|
||||||
|
getContactUnreadCnt(...args: unknown[]): unknown;
|
||||||
|
getUnreadCntInfo(...args: unknown[]): unknown;
|
||||||
|
getGuildUnreadCntInfo(...args: unknown[]): unknown;
|
||||||
|
getGuildUnreadCntTabInfo(...args: unknown[]): unknown;
|
||||||
|
getAllGuildUnreadCntInfo(...args: unknown[]): unknown;
|
||||||
|
getAllJoinGuildCnt(...args: unknown[]): unknown;
|
||||||
|
getAllDirectSessionUnreadCntInfo(...args: unknown[]): unknown;
|
||||||
|
getCategoryUnreadCntInfo(...args: unknown[]): unknown;
|
||||||
|
getGuildFeedsUnreadCntInfo(...args: unknown[]): unknown;
|
||||||
|
setUnVisibleChannelCntInfo(...args: unknown[]): unknown;
|
||||||
|
setUnVisibleChannelTypeCntInfo(...args: unknown[]): unknown;
|
||||||
|
setVisibleGuildCntInfo(...args: unknown[]): unknown;
|
||||||
|
setMsgRead(...args: unknown[]): unknown;
|
||||||
|
setAllC2CAndGroupMsgRead(...args: unknown[]): unknown;
|
||||||
|
setGuildMsgRead(...args: unknown[]): unknown;
|
||||||
|
setAllGuildMsgRead(...args: unknown[]): unknown;
|
||||||
|
setMsgReadAndReport(...args: unknown[]): unknown;
|
||||||
|
setSpecificMsgReadAndReport(...args: unknown[]): unknown;
|
||||||
|
setLocalMsgRead(...args: unknown[]): unknown;
|
||||||
|
setGroupGuildMsgRead(...args: unknown[]): unknown;
|
||||||
|
getGuildGroupTransData(...args: unknown[]): unknown;
|
||||||
|
setGroupGuildBubbleRead(...args: unknown[]): unknown;
|
||||||
|
getGuildGroupBubble(...args: unknown[]): unknown;
|
||||||
|
fetchGroupGuildUnread(...args: unknown[]): unknown;
|
||||||
|
setGroupGuildFlag(...args: unknown[]): unknown;
|
||||||
|
setGuildUDCFlag(...args: unknown[]): unknown;
|
||||||
|
setGuildTabUserFlag(...args: unknown[]): unknown;
|
||||||
|
setBuildMode(...args: unknown[]): unknown;
|
||||||
|
setConfigurationServiceData(...args: unknown[]): unknown;
|
||||||
|
setMarkUnreadFlag(...args: unknown[]): unknown;
|
||||||
|
getChannelEventFlow(...args: unknown[]): unknown;
|
||||||
|
getMsgEventFlow(...args: unknown[]): unknown;
|
||||||
|
getRichMediaFilePathForMobileQQSend(...args: unknown[]): unknown;
|
||||||
|
getRichMediaFilePathForGuild(arg: {
|
||||||
|
md5HexStr: string;
|
||||||
|
fileName: string;
|
||||||
|
elementType: ElementType;
|
||||||
|
elementSubType: number;
|
||||||
|
thumbSize: 0;
|
||||||
|
needCreate: true;
|
||||||
|
downloadType: 1;
|
||||||
|
file_uuid: '';
|
||||||
|
}): string;
|
||||||
|
assembleMobileQQRichMediaFilePath(...args: unknown[]): unknown;
|
||||||
|
getFileThumbSavePathForSend(...args: unknown[]): unknown;
|
||||||
|
getFileThumbSavePath(...args: unknown[]): unknown;
|
||||||
|
translatePtt2Text(...args: unknown[]): unknown;
|
||||||
|
setPttPlayedState(...args: unknown[]): unknown;
|
||||||
|
fetchFavEmojiList(...args: unknown[]): unknown;
|
||||||
|
addFavEmoji(...args: unknown[]): unknown;
|
||||||
|
fetchMarketEmoticonList(...args: unknown[]): unknown;
|
||||||
|
fetchMarketEmoticonShowImage(...args: unknown[]): unknown;
|
||||||
|
fetchMarketEmoticonAioImage(...args: unknown[]): unknown;
|
||||||
|
fetchMarketEmotionJsonFile(...args: unknown[]): unknown;
|
||||||
|
getMarketEmoticonPath(...args: unknown[]): unknown;
|
||||||
|
getMarketEmoticonPathBySync(...args: unknown[]): unknown;
|
||||||
|
fetchMarketEmoticonFaceImages(...args: unknown[]): unknown;
|
||||||
|
fetchMarketEmoticonAuthDetail(...args: unknown[]): unknown;
|
||||||
|
getFavMarketEmoticonInfo(...args: unknown[]): unknown;
|
||||||
|
addRecentUsedFace(...args: unknown[]): unknown;
|
||||||
|
getRecentUsedFaceList(...args: unknown[]): unknown;
|
||||||
|
getMarketEmoticonEncryptKeys(...args: unknown[]): unknown;
|
||||||
|
downloadEmojiPic(...args: unknown[]): unknown;
|
||||||
|
deleteFavEmoji(...args: unknown[]): unknown;
|
||||||
|
modifyFavEmojiDesc(...args: unknown[]): unknown;
|
||||||
|
queryFavEmojiByDesc(...args: unknown[]): unknown;
|
||||||
|
getHotPicInfoListSearchString(...args: unknown[]): unknown;
|
||||||
|
getHotPicSearchResult(...args: unknown[]): unknown;
|
||||||
|
getHotPicHotWords(...args: unknown[]): unknown;
|
||||||
|
getHotPicJumpInfo(...args: unknown[]): unknown;
|
||||||
|
getEmojiResourcePath(...args: unknown[]): unknown;
|
||||||
|
JoinDragonGroupEmoji(...args: unknown[]): unknown;
|
||||||
|
getMsgAbstracts(...args: unknown[]): unknown;
|
||||||
|
getMsgAbstract(...args: unknown[]): unknown;
|
||||||
|
getMsgAbstractList(...args: unknown[]): unknown;
|
||||||
|
getMsgAbstractListBySeqRange(...args: unknown[]): unknown;
|
||||||
|
refreshMsgAbstracts(...args: unknown[]): unknown;
|
||||||
|
refreshMsgAbstractsByGuildIds(...args: unknown[]): unknown;
|
||||||
|
getRichMediaElement(...args: unknown[]): unknown;
|
||||||
|
cancelGetRichMediaElement(...args: unknown[]): unknown;
|
||||||
|
refuseGetRichMediaElement(...args: unknown[]): unknown;
|
||||||
|
switchToOfflineGetRichMediaElement(...args: unknown[]): unknown;
|
||||||
|
downloadRichMedia(...args: unknown[]): unknown;
|
||||||
|
getFirstUnreadMsgSeq(...args: unknown[]): unknown;
|
||||||
|
getFirstUnreadCommonMsg(...args: unknown[]): unknown;
|
||||||
|
getFirstUnreadAtmeMsg(...args: unknown[]): unknown;
|
||||||
|
getFirstUnreadAtallMsg(...args: unknown[]): unknown;
|
||||||
|
getNavigateInfo(...args: unknown[]): unknown;
|
||||||
|
getChannelFreqLimitInfo(...args: unknown[]): unknown;
|
||||||
|
getRecentUseEmojiList(...args: unknown[]): unknown;
|
||||||
|
getRecentEmojiList(...args: unknown[]): unknown;
|
||||||
|
setMsgEmojiLikes(...args: unknown[]): unknown;
|
||||||
|
getMsgEmojiLikesList(...args: unknown[]): unknown;
|
||||||
|
setMsgEmojiLikesForRole(...args: unknown[]): unknown;
|
||||||
|
clickInlineKeyboardButton(...args: unknown[]): unknown;
|
||||||
|
setCurOnScreenMsg(...args: unknown[]): unknown;
|
||||||
|
setCurOnScreenMsgForMsgEvent(...args: unknown[]): unknown;
|
||||||
|
getMiscData(...args: unknown[]): unknown;
|
||||||
|
setMiscData(...args: unknown[]): unknown;
|
||||||
|
getBookmarkData(...args: unknown[]): unknown;
|
||||||
|
setBookmarkData(...args: unknown[]): unknown;
|
||||||
|
sendShowInputStatusReq(...args: unknown[]): unknown;
|
||||||
|
queryCalendar(...args: unknown[]): unknown;
|
||||||
|
queryFirstMsgSeq(...args: unknown[]): unknown;
|
||||||
|
queryRoamCalendar(...args: unknown[]): unknown;
|
||||||
|
queryFirstRoamMsg(...args: unknown[]): unknown;
|
||||||
|
fetchLongMsg(...args: unknown[]): unknown;
|
||||||
|
fetchLongMsgWithCb(...args: unknown[]): unknown;
|
||||||
|
setIsStopKernelFetchLongMsg(...args: unknown[]): unknown;
|
||||||
|
insertGameResultAsMsgToDb(...args: unknown[]): unknown;
|
||||||
|
getMultiMsg(...args: unknown[]): Promise<GeneralCallResult & {
|
||||||
|
msgList: RawMessage[];
|
||||||
|
}>;
|
||||||
|
setDraft(...args: unknown[]): unknown;
|
||||||
|
getDraft(...args: unknown[]): unknown;
|
||||||
|
deleteDraft(...args: unknown[]): unknown;
|
||||||
|
getRecentHiddenSesionList(...args: unknown[]): unknown;
|
||||||
|
setRecentHiddenSession(...args: unknown[]): unknown;
|
||||||
|
delRecentHiddenSession(...args: unknown[]): unknown;
|
||||||
|
getCurHiddenSession(...args: unknown[]): unknown;
|
||||||
|
setCurHiddenSession(...args: unknown[]): unknown;
|
||||||
|
setReplyDraft(...args: unknown[]): unknown;
|
||||||
|
getReplyDraft(...args: unknown[]): unknown;
|
||||||
|
deleteReplyDraft(...args: unknown[]): unknown;
|
||||||
|
getFirstUnreadAtMsg(...args: unknown[]): unknown;
|
||||||
|
clearMsgRecords(...args: unknown[]): unknown;
|
||||||
|
IsExistOldDb(...args: unknown[]): unknown;
|
||||||
|
canImportOldDbMsg(...args: unknown[]): unknown;
|
||||||
|
setPowerStatus(...args: unknown[]): unknown;
|
||||||
|
canProcessDataMigration(...args: unknown[]): unknown;
|
||||||
|
importOldDbMsg(...args: unknown[]): unknown;
|
||||||
|
stopImportOldDbMsgAndroid(...args: unknown[]): unknown;
|
||||||
|
isMqqDataImportFinished(...args: unknown[]): unknown;
|
||||||
|
getMqqDataImportTableNames(...args: unknown[]): unknown;
|
||||||
|
getCurChatImportStatusByUin(...args: unknown[]): unknown;
|
||||||
|
getDataImportUserLevel(...args: unknown[]): unknown;
|
||||||
|
getMsgQRCode(...args: unknown[]): unknown;
|
||||||
|
getGuestMsgAbstracts(...args: unknown[]): unknown;
|
||||||
|
getGuestMsgByRange(...args: unknown[]): unknown;
|
||||||
|
getGuestMsgAbstractByRange(...args: unknown[]): unknown;
|
||||||
|
registerSysMsgNotification(...args: unknown[]): unknown;
|
||||||
|
unregisterSysMsgNotification(...args: unknown[]): unknown;
|
||||||
|
enterOrExitAio(...args: unknown[]): unknown;
|
||||||
|
prepareTempChat(...args: unknown[]): unknown;
|
||||||
|
getTempChatInfo(...args: unknown[]): unknown;
|
||||||
|
setContactLocalTop(...args: unknown[]): unknown;
|
||||||
|
switchAnonymousChat(...args: unknown[]): unknown;
|
||||||
|
renameAnonyChatNick(...args: unknown[]): unknown;
|
||||||
|
getAnonymousInfo(...args: unknown[]): unknown;
|
||||||
|
updateAnonymousInfo(...args: unknown[]): unknown;
|
||||||
|
sendSummonMsg(...args: unknown[]): unknown;
|
||||||
|
outputGuildUnreadInfo(...args: unknown[]): unknown;
|
||||||
|
checkMsgWithUrl(...args: unknown[]): unknown;
|
||||||
|
checkTabListStatus(...args: unknown[]): unknown;
|
||||||
|
getABatchOfContactMsgBoxInfo(...args: unknown[]): unknown;
|
||||||
|
insertMsgToMsgBox(...args: unknown[]): unknown;
|
||||||
|
isHitEmojiKeyword(...args: unknown[]): unknown;
|
||||||
|
getKeyWordRelatedEmoji(...args: unknown[]): unknown;
|
||||||
|
recordEmoji(...args: unknown[]): unknown;
|
||||||
|
fetchGetHitEmotionsByWord(...args: unknown[]): unknown;
|
||||||
|
deleteAllRoamMsgs(...args: unknown[]): unknown;
|
||||||
|
packRedBag(...args: unknown[]): unknown;
|
||||||
|
grabRedBag(...args: unknown[]): unknown;
|
||||||
|
pullDetail(...args: unknown[]): unknown;
|
||||||
|
selectPasswordRedBag(...args: unknown[]): unknown;
|
||||||
|
pullRedBagPasswordList(...args: unknown[]): unknown;
|
||||||
|
requestTianshuAdv(...args: unknown[]): unknown;
|
||||||
|
tianshuReport(...args: unknown[]): unknown;
|
||||||
|
tianshuMultiReport(...args: unknown[]): unknown;
|
||||||
|
GetMsgSubType(...args: unknown[]): unknown;
|
||||||
|
setIKernelPublicAccountAdapter(...args: unknown[]): unknown;
|
||||||
|
createUidFromTinyId(...args: unknown[]): unknown;
|
||||||
|
dataMigrationGetDataAvaiableContactList(...args: unknown[]): unknown;
|
||||||
|
dataMigrationGetMsgList(...args: unknown[]): unknown;
|
||||||
|
dataMigrationStopOperation(...args: unknown[]): unknown;
|
||||||
|
dataMigrationImportMsgPbRecord(...args: unknown[]): unknown;
|
||||||
|
dataMigrationGetResourceLocalDestinyPath(...args: unknown[]): unknown;
|
||||||
|
dataMigrationSetIOSPathPrefix(...args: unknown[]): unknown;
|
||||||
|
getServiceAssistantSwitch(...args: unknown[]): unknown;
|
||||||
|
setServiceAssistantSwitch(...args: unknown[]): unknown;
|
||||||
|
setSubscribeFolderUsingSmallRedPoint(...args: unknown[]): unknown;
|
||||||
|
clearGuildNoticeRedPoint(...args: unknown[]): unknown;
|
||||||
|
clearFeedNoticeRedPoint(...args: unknown[]): unknown;
|
||||||
|
clearFeedSquareRead(...args: unknown[]): unknown;
|
||||||
|
IsC2CStyleChatType(...args: unknown[]): unknown;
|
||||||
|
IsTempChatType(...args: unknown[]): unknown;
|
||||||
|
getGuildInteractiveNotification(...args: unknown[]): unknown;
|
||||||
|
getGuildNotificationAbstract(...args: unknown[]): unknown;
|
||||||
|
setFocusOnBase(...args: unknown[]): unknown;
|
||||||
|
queryArkInfo(...args: unknown[]): unknown;
|
||||||
|
queryUserSecQuality(...args: unknown[]): unknown;
|
||||||
|
getGuildMsgAbFlag(...args: unknown[]): unknown;
|
||||||
|
getGroupMsgStorageTime(...args: unknown[]): unknown;
|
||||||
|
}
|
Some files were not shown because too many files have changed in this diff Show More
Loading…
x
Reference in New Issue
Block a user