mirror of
https://github.com/NapNeko/NapCatQQ.git
synced 2026-02-06 21:10:23 +00:00
refactor: move all utility files to /common
This commit is contained in:
@@ -1,6 +1,6 @@
|
||||
import { OB11Return } from '../types';
|
||||
|
||||
import { isNull } from '../../common/utils/helper';
|
||||
import { isNull } from '../../common/helper';
|
||||
|
||||
export class OB11Response {
|
||||
static res<T>(data: T, status: string, retcode: number, message: string = ''): OB11Return<T> {
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
import { FromSchema, JSONSchema } from 'json-schema-to-ts';
|
||||
import BaseAction from '../BaseAction';
|
||||
import { ActionName } from '../types';
|
||||
import { MessageUnique } from '@/common/utils/message-unique';
|
||||
import { MessageUnique } from '@/common/message-unique';
|
||||
|
||||
const SchemaData = {
|
||||
type: 'object',
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
import BaseAction from '../BaseAction';
|
||||
import { ActionName } from '../types';
|
||||
import { FromSchema, JSONSchema } from 'json-schema-to-ts';
|
||||
import { checkFileReceived, uri2local } from '@/common/utils/file';
|
||||
import { checkFileReceived, uri2local } from '@/common/file';
|
||||
import fs from 'fs';
|
||||
|
||||
const SchemaData = {
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
import BaseAction from '../BaseAction';
|
||||
import { ActionName, BaseCheckResult } from '../types';
|
||||
import * as fs from 'node:fs';
|
||||
import { checkFileReceived, uri2local } from '@/common/utils/file';
|
||||
import { checkFileReceived, uri2local } from '@/common/file';
|
||||
|
||||
interface Payload {
|
||||
file: string;
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
import BaseAction from '../BaseAction';
|
||||
import fs from 'fs/promises';
|
||||
import { UUIDConverter } from '@/common/utils/helper';
|
||||
import { UUIDConverter } from '@/common/helper';
|
||||
import { ActionName } from '../types';
|
||||
import { ChatType, ElementType, FileElement, Peer, RawMessage, VideoElement } from '@/core/entities';
|
||||
import { FromSchema, JSONSchema } from 'json-schema-to-ts';
|
||||
|
||||
@@ -2,7 +2,7 @@ import BaseAction from '../BaseAction';
|
||||
import { ActionName } from '../types';
|
||||
import fs from 'fs';
|
||||
import { join as joinPath } from 'node:path';
|
||||
import { calculateFileMD5, httpDownload } from '@/common/utils/file';
|
||||
import { calculateFileMD5, httpDownload } from '@/common/file';
|
||||
import { randomUUID } from 'crypto';
|
||||
import { FromSchema, JSONSchema } from 'json-schema-to-ts';
|
||||
|
||||
|
||||
@@ -2,7 +2,7 @@ import BaseAction from '../BaseAction';
|
||||
import { OB11ForwardMessage } from '@/onebot';
|
||||
import { ActionName } from '../types';
|
||||
import { FromSchema, JSONSchema } from 'json-schema-to-ts';
|
||||
import { MessageUnique } from '@/common/utils/message-unique';
|
||||
import { MessageUnique } from '@/common/message-unique';
|
||||
|
||||
const SchemaData = {
|
||||
type: 'object',
|
||||
|
||||
@@ -3,7 +3,7 @@ import { OB11Message } from '@/onebot';
|
||||
import { ActionName } from '../types';
|
||||
import { ChatType, RawMessage } from '@/core/entities';
|
||||
import { FromSchema, JSONSchema } from 'json-schema-to-ts';
|
||||
import { MessageUnique } from '@/common/utils/message-unique';
|
||||
import { MessageUnique } from '@/common/message-unique';
|
||||
|
||||
interface Response {
|
||||
messages: OB11Message[];
|
||||
|
||||
@@ -3,7 +3,7 @@ import { OB11Message } from '@/onebot';
|
||||
import { ActionName } from '../types';
|
||||
import { ChatType, Peer, RawMessage } from '@/core/entities';
|
||||
import { FromSchema, JSONSchema } from 'json-schema-to-ts';
|
||||
import { MessageUnique } from '@/common/utils/message-unique';
|
||||
import { MessageUnique } from '@/common/message-unique';
|
||||
|
||||
interface Response {
|
||||
messages: OB11Message[];
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
import BaseAction from '../BaseAction';
|
||||
import { ActionName } from '../types';
|
||||
import { JSONSchema } from 'json-schema-to-ts';
|
||||
import { sleep } from '@/common/utils/helper';
|
||||
import { sleep } from '@/common/helper';
|
||||
|
||||
const SchemaData = {
|
||||
type: 'object',
|
||||
|
||||
@@ -3,7 +3,7 @@ import { OB11User, OB11UserSex } from '@/onebot';
|
||||
import { OB11Entities } from '@/onebot/helper/entities';
|
||||
import { ActionName } from '../types';
|
||||
import { FromSchema, JSONSchema } from 'json-schema-to-ts';
|
||||
import { calcQQLevel } from '@/common/utils/helper';
|
||||
import { calcQQLevel } from '@/common/helper';
|
||||
|
||||
const SchemaData = {
|
||||
type: 'object',
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
import { checkFileReceived, uri2local } from '@/common/utils/file';
|
||||
import { checkFileReceived, uri2local } from '@/common/file';
|
||||
import BaseAction from '../BaseAction';
|
||||
import { ActionName } from '../types';
|
||||
import { unlink } from 'node:fs';
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
import BaseAction from '../BaseAction';
|
||||
import { ActionName, BaseCheckResult } from '../types';
|
||||
import * as fs from 'node:fs';
|
||||
import { checkFileReceived, uri2local } from '@/common/utils/file';
|
||||
import { checkFileReceived, uri2local } from '@/common/file';
|
||||
|
||||
interface Payload {
|
||||
file: string,
|
||||
|
||||
@@ -2,7 +2,7 @@ import BaseAction from '../BaseAction';
|
||||
import { ActionName } from '../types';
|
||||
import { ChatType } from '@/core/entities';
|
||||
import fs from 'fs';
|
||||
import { uri2local } from '@/common/utils/file';
|
||||
import { uri2local } from '@/common/file';
|
||||
import { FromSchema, JSONSchema } from 'json-schema-to-ts';
|
||||
|
||||
const SchemaData = {
|
||||
|
||||
@@ -2,7 +2,7 @@ import BaseAction from '../BaseAction';
|
||||
import { ActionName } from '../types';
|
||||
import { ChatType, Peer, SendFileElement } from '@/core/entities';
|
||||
import fs from 'fs';
|
||||
import { uri2local } from '@/common/utils/file';
|
||||
import { uri2local } from '@/common/file';
|
||||
import { FromSchema, JSONSchema } from 'json-schema-to-ts';
|
||||
|
||||
const SchemaData = {
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
import BaseAction from '../BaseAction';
|
||||
import { ActionName } from '../types';
|
||||
import { FromSchema, JSONSchema } from 'json-schema-to-ts';
|
||||
import { MessageUnique } from '@/common/utils/message-unique';
|
||||
import { MessageUnique } from '@/common/message-unique';
|
||||
|
||||
const SchemaData = {
|
||||
type: 'object',
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
import BaseAction from '../BaseAction';
|
||||
import { ActionName } from '../types';
|
||||
import { FromSchema, JSONSchema } from 'json-schema-to-ts';
|
||||
import { MessageUnique } from '@/common/utils/message-unique';
|
||||
import { MessageUnique } from '@/common/message-unique';
|
||||
|
||||
const SchemaData = {
|
||||
type: 'object',
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
import { ActionName } from '../types';
|
||||
import BaseAction from '../BaseAction';
|
||||
import { FromSchema, JSONSchema } from 'json-schema-to-ts';
|
||||
import { MessageUnique } from '@/common/utils/message-unique';
|
||||
import { MessageUnique } from '@/common/message-unique';
|
||||
import { NodeIKernelMsgListener } from '@/core';
|
||||
|
||||
const SchemaData = {
|
||||
|
||||
@@ -2,7 +2,7 @@ import BaseAction from '../BaseAction';
|
||||
import { ChatType, Peer } from '@/core/entities';
|
||||
import { ActionName } from '../types';
|
||||
import { FromSchema, JSONSchema } from 'json-schema-to-ts';
|
||||
import { MessageUnique } from '@/common/utils/message-unique';
|
||||
import { MessageUnique } from '@/common/message-unique';
|
||||
|
||||
const SchemaData = {
|
||||
type: 'object',
|
||||
|
||||
@@ -2,7 +2,7 @@ import { OB11Message } from '@/onebot';
|
||||
import BaseAction from '../BaseAction';
|
||||
import { ActionName } from '../types';
|
||||
import { FromSchema, JSONSchema } from 'json-schema-to-ts';
|
||||
import { MessageUnique } from '@/common/utils/message-unique';
|
||||
import { MessageUnique } from '@/common/message-unique';
|
||||
|
||||
|
||||
export type ReturnDataType = OB11Message
|
||||
|
||||
@@ -7,7 +7,7 @@ import {
|
||||
} from '@/onebot/types';
|
||||
import { ActionName, BaseCheckResult } from '@/onebot/action/types';
|
||||
import { decodeCQCode } from '@/onebot/helper/cqcode';
|
||||
import { MessageUnique } from '@/common/utils/message-unique';
|
||||
import { MessageUnique } from '@/common/message-unique';
|
||||
import { ChatType, ElementType, NapCatCore, Peer, RawMessage, SendMessageElement } from '@/core';
|
||||
import BaseAction from '../BaseAction';
|
||||
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
import { ActionName } from '../types';
|
||||
import BaseAction from '../BaseAction';
|
||||
import { FromSchema, JSONSchema } from 'json-schema-to-ts';
|
||||
import { MessageUnique } from '@/common/utils/message-unique';
|
||||
import { MessageUnique } from '@/common/message-unique';
|
||||
|
||||
const SchemaData = {
|
||||
type: 'object',
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
import BaseAction from '../BaseAction';
|
||||
import { ActionName } from '../types';
|
||||
import { napcat_version } from '@/common/framework/napcat';
|
||||
import { napcat_version } from '@/common/path';
|
||||
|
||||
export default class GetVersionInfo extends BaseAction<any, any> {
|
||||
actionName = ActionName.GetVersionInfo;
|
||||
|
||||
Reference in New Issue
Block a user