refactor: move all utility files to /common

This commit is contained in:
Wesley F. Young
2024-08-27 10:17:19 +08:00
parent 035d256d4e
commit 17e680f7af
63 changed files with 71 additions and 71 deletions

View File

@@ -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';

View File

@@ -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',

View File

@@ -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[];

View File

@@ -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[];

View File

@@ -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',

View File

@@ -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',

View File

@@ -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';

View File

@@ -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,

View File

@@ -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 = {

View File

@@ -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 = {