Replace nap-proto-core with napcat-protobuf package
Switched all imports from '@napneko/nap-proto-core' to the new 'napcat-protobuf' package across napcat-core and related packages. Updated dependencies and references to support the new package structure, improving maintainability and workspace integration.
This commit is contained in:
1 parent
a703bbfef7
commit
4f850cd4dc
98 files changed
+363
-109
No files matched your search
@@ -1,6 +1,6 @@
|
||||
import type { LoginRuntimeType } from '../types/data';
|
||||
import store from 'napcat-common/src/store';
|
||||
import { napCatVersion } from 'napcat-common/src/version';
|
||||
import type { LoginRuntimeType } from '../types';
|
||||
|
||||
const LoginRuntime: LoginRuntimeType = {
|
||||
LoginCurrentTime: Date.now(),
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
import crypto from 'crypto';
|
||||
import store from 'napcat-common/src/store';
|
||||
import type { WebUiCredentialJson, WebUiCredentialInnerJson } from '@/napcat-webui-backend/types';
|
||||
export class AuthHelper {
|
||||
private static readonly secretKey = Math.random().toString(36).slice(2);
|
||||
|
||||
|
||||
@@ -3,6 +3,7 @@
|
||||
*/
|
||||
|
||||
import express from 'express';
|
||||
import type { WebUiConfigType } from './types';
|
||||
import { createServer } from 'http';
|
||||
import { randomUUID } from 'node:crypto';
|
||||
import { createServer as createHttpsServer } from 'https';
|
||||
|
||||
@@ -4,6 +4,7 @@ import { getInitialWebUiToken } from '@/napcat-webui-backend/index';
|
||||
|
||||
import { AuthHelper } from '@/napcat-webui-backend/helper/SignToken';
|
||||
import { sendError } from '@/napcat-webui-backend/utils/response';
|
||||
import type { WebUiCredentialJson } from '@/napcat-webui-backend/types';
|
||||
|
||||
// 鉴权中间件
|
||||
export async function auth (req: Request, res: Response, next: NextFunction) {
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
// import './init-dynamic-dirname';
|
||||
import { WebUiConfig } from '../index';
|
||||
import { AuthHelper } from '../helper/SignToken';
|
||||
import type { WebUiCredentialJson } from '@/napcat-webui-backend/types';
|
||||
import { LogWrapper } from 'napcat-common/src/log';
|
||||
import { WebSocket, WebSocketServer } from 'ws';
|
||||
import os from 'os';
|
||||
|
||||
@@ -1,6 +0,0 @@
|
||||
interface WebUiConfigType {
|
||||
host: string;
|
||||
port: number;
|
||||
token: string;
|
||||
loginRate: number;
|
||||
}
|
||||
+19
-1
@@ -1,7 +1,23 @@
|
||||
import type { LoginListItem, SelfInfo } from 'napcat-core';
|
||||
import type { OneBotConfig } from 'napcat-onebot/config/config';
|
||||
|
||||
interface LoginRuntimeType {
|
||||
export interface WebUiConfigType {
|
||||
host: string;
|
||||
port: number;
|
||||
token: string;
|
||||
loginRate: number;
|
||||
}
|
||||
export interface WebUiCredentialInnerJson {
|
||||
CreatedTime: number;
|
||||
HashEncoded: string;
|
||||
}
|
||||
|
||||
export interface WebUiCredentialJson {
|
||||
Data: WebUiCredentialInnerJson;
|
||||
Hmac: string;
|
||||
}
|
||||
|
||||
export interface LoginRuntimeType {
|
||||
LoginCurrentTime: number;
|
||||
LoginCurrentRate: number;
|
||||
QQLoginStatus: boolean;
|
||||
@@ -20,3 +36,5 @@ interface LoginRuntimeType {
|
||||
};
|
||||
NapCatVersion: string;
|
||||
}
|
||||
|
||||
export default {};
|
||||
@@ -1,7 +0,0 @@
|
||||
interface APIResponse<T> {
|
||||
code: number;
|
||||
message: string;
|
||||
data: T;
|
||||
}
|
||||
|
||||
type Protocol = 'http' | 'https' | 'ws' | 'wss';
|
||||
@@ -1,9 +0,0 @@
|
||||
interface WebUiCredentialInnerJson {
|
||||
CreatedTime: number;
|
||||
HashEncoded: string;
|
||||
}
|
||||
|
||||
interface WebUiCredentialJson {
|
||||
Data: WebUiCredentialInnerJson;
|
||||
Hmac: string;
|
||||
}
|
||||
Reference in new issue
Block a user