diff --git a/app/api/agent/[agentId]/status/helpers.ts b/app/api/agent/[agentId]/status/helpers.ts index ca8605fd..83d9e051 100644 --- a/app/api/agent/[agentId]/status/helpers.ts +++ b/app/api/agent/[agentId]/status/helpers.ts @@ -7,8 +7,8 @@ import { db, db as dbClient } from "@/db"; import { and, eq, inArray } from "drizzle-orm"; import { dbmsEnumSchema, EDbmsSchema } from "@/db/schema/types"; import { withUpdatedAt } from "@/db/utils"; -import type { StorageInput } from "@/features/storages/storages.types"; -import { dispatchStorage } from "@/features/storages/storages.dispatch"; +import type { StorageInput } from "@/features/storages/types"; +import { dispatchStorage } from "@/features/storages/utils/storages.dispatch"; import { Setting } from "@/db/schema/01_setting"; import { logger } from "@/lib/logger"; import { isUUID } from "@/utils/text"; diff --git a/app/api/files/backups/route.ts b/app/api/files/backups/route.ts index 55b1627b..14334b62 100644 --- a/app/api/files/backups/route.ts +++ b/app/api/files/backups/route.ts @@ -1,7 +1,7 @@ import {NextResponse} from "next/server"; import path from "path"; -import type {StorageInput} from "@/features/storages/storages.types"; -import {dispatchStorage} from "@/features/storages/storages.dispatch"; +import type {StorageInput} from "@/features/storages/types"; +import {dispatchStorage} from "@/features/storages/utils/storages.dispatch"; import {Readable} from "node:stream"; import {logger} from "@/lib/logger"; diff --git a/app/api/files/images/[fileName]/route.ts b/app/api/files/images/[fileName]/route.ts index bc183122..0c91f329 100644 --- a/app/api/files/images/[fileName]/route.ts +++ b/app/api/files/images/[fileName]/route.ts @@ -1,8 +1,8 @@ import {NextResponse} from "next/server"; import {auth} from "@/lib/auth/auth"; import {headers} from "next/headers"; -import {StorageInput} from "@/features/storages/storages.types"; -import {dispatchStorage} from "@/features/storages/storages.dispatch"; +import {StorageInput} from "@/features/storages/types"; +import {dispatchStorage} from "@/features/storages/utils/storages.dispatch"; import {Readable} from "node:stream"; import {logger} from "@/lib/logger"; diff --git a/src/features/channel/components/channel-test-button.tsx b/src/features/channel/components/channel-test-button.tsx index 01709e48..549b8d43 100644 --- a/src/features/channel/components/channel-test-button.tsx +++ b/src/features/channel/components/channel-test-button.tsx @@ -12,8 +12,8 @@ import {useIsMobile} from "@/hooks/use-mobile"; import {cn} from "@/lib/utils"; import {StorageChannel} from "@/db/schema/12_storage-channel"; import {ChannelKind} from "@/features/channel/components/channels-helpers"; -import type {StorageInput} from "@/features/storages/storages.types"; -import {dispatchStorage} from "@/features/storages/storages.dispatch"; +import type {StorageInput} from "@/features/storages/types"; +import {dispatchStorage} from "@/features/storages/utils/storages.dispatch"; type NotifierTestChannelButtonProps = { diff --git a/src/features/channel/components/storages/az-blob.ts b/src/features/channel/components/storages/az-blob.ts index 0ed81ee6..ebcbb28e 100644 --- a/src/features/channel/components/storages/az-blob.ts +++ b/src/features/channel/components/storages/az-blob.ts @@ -6,7 +6,7 @@ import { StorageMetaData, StorageResult, StorageUploadInput -} from '@/features/storages/storages.types'; +} from '@/features/storages/types'; import {Readable} from "node:stream"; type BlobConfig = { diff --git a/src/features/channel/components/storages/google-drive/index.ts b/src/features/channel/components/storages/google-drive/index.ts index a0da8ace..a575d8a7 100644 --- a/src/features/channel/components/storages/google-drive/index.ts +++ b/src/features/channel/components/storages/google-drive/index.ts @@ -6,7 +6,7 @@ import { StorageMetaData, StorageResult, StorageUploadInput -} from '@/features/storages/storages.types'; +} from '@/features/storages/types'; import {GoogleDriveConfig} from "@/features/channel/components/storages/google-drive/types"; import { ensureFolderPath, @@ -14,7 +14,7 @@ import { getGoogleDriveClient, resolveFilePath } from "@/features/channel/components/storages/google-drive/helpers"; import {Readable} from "node:stream"; -import {generateFileUrl} from "@/features/storages/storages.helpers"; +import {generateFileUrl} from "@/features/storages/utils/storages.helpers"; export async function uploadGoogleDrive( config: GoogleDriveConfig, diff --git a/src/features/channel/components/storages/index.ts b/src/features/channel/components/storages/index.ts index 7431d266..bb9d196f 100644 --- a/src/features/channel/components/storages/index.ts +++ b/src/features/channel/components/storages/index.ts @@ -2,7 +2,7 @@ import { StorageProviderKind, StorageInput, StorageResult, -} from '@/features/storages/storages.types'; +} from '@/features/storages/types'; import {uploadLocal, getLocal, deleteLocal, pingLocal, copyLocal} from './local'; import {copyS3, deleteS3, getS3, pingS3, uploadS3} from "@/features/channel/components/storages/s3"; diff --git a/src/features/channel/components/storages/local.ts b/src/features/channel/components/storages/local.ts index 8dbe8502..afe494c7 100644 --- a/src/features/channel/components/storages/local.ts +++ b/src/features/channel/components/storages/local.ts @@ -8,9 +8,9 @@ import { StorageMetaData, StorageResult, StorageUploadInput, -} from '@/features/storages/storages.types'; +} from '@/features/storages/types'; import fs from "node:fs"; -import { generateFileUrl } from "@/features/storages/storages.helpers"; +import { generateFileUrl } from "@/features/storages/utils/storages.helpers"; import { Readable } from "node:stream"; import { env } from "@/env.mjs"; diff --git a/src/features/channel/components/storages/s3.ts b/src/features/channel/components/storages/s3.ts index 908b29c1..fc4672c7 100644 --- a/src/features/channel/components/storages/s3.ts +++ b/src/features/channel/components/storages/s3.ts @@ -6,7 +6,7 @@ import { StorageMetaData, StorageResult, StorageUploadInput -} from '@/features/storages/storages.types'; +} from '@/features/storages/types'; import {Readable} from "node:stream"; type S3Config = { diff --git a/src/features/database/actions/backup-actions.action.ts b/src/features/database/actions/backup-actions.action.ts index bb183608..7847e05b 100644 --- a/src/features/database/actions/backup-actions.action.ts +++ b/src/features/database/actions/backup-actions.action.ts @@ -2,8 +2,8 @@ import {userAction} from "@/lib/safe-actions/actions"; import {ServerActionResult} from "@/types/action-type"; import {z} from "zod"; -import type {StorageInput} from "@/features/storages/storages.types"; -import {dispatchStorage} from "@/features/storages/storages.dispatch"; +import type {StorageInput} from "@/features/storages/types"; +import {dispatchStorage} from "@/features/storages/utils/storages.dispatch"; import {db} from "@/db"; import {and, eq, isNull, ne, sql} from "drizzle-orm"; import * as drizzleDb from "@/db"; diff --git a/src/features/database/actions/import.action.ts b/src/features/database/actions/import.action.ts index 155ef709..ad14738b 100644 --- a/src/features/database/actions/import.action.ts +++ b/src/features/database/actions/import.action.ts @@ -7,7 +7,7 @@ import {Backup} from "@/db/schema/07_database"; import {v4 as uuidv4} from "uuid"; import {eq} from "drizzle-orm"; import {z} from "zod"; -import {storeBackupFiles} from "@/features/storages/storages.helpers"; +import {storeBackupFiles} from "@/features/storages/utils/storages.helpers"; import {getFileExtension} from "@/utils/common"; diff --git a/src/features/migration/actions/migration.action.ts b/src/features/migration/actions/migration.action.ts index 1dabf9cd..23e9cfff 100644 --- a/src/features/migration/actions/migration.action.ts +++ b/src/features/migration/actions/migration.action.ts @@ -5,7 +5,7 @@ import {z} from "zod"; import {db} from "@/db"; import * as drizzleDb from "@/db"; import {eq, inArray} from "drizzle-orm"; -import {dispatchStorage} from "@/features/storages/storages.dispatch"; +import {dispatchStorage} from "@/features/storages/utils/storages.dispatch"; import {v4 as uuidv4} from "uuid"; import {getTodayISODate} from "@/utils/date-formatting"; import {withUpdatedAt} from "@/db/utils"; diff --git a/src/features/storages/storages.types.ts b/src/features/storages/types/index.ts similarity index 100% rename from src/features/storages/storages.types.ts rename to src/features/storages/types/index.ts diff --git a/src/features/storages/storages.dispatch.ts b/src/features/storages/utils/storages.dispatch.ts similarity index 98% rename from src/features/storages/storages.dispatch.ts rename to src/features/storages/utils/storages.dispatch.ts index 2a9a6f44..e44fd659 100644 --- a/src/features/storages/storages.dispatch.ts +++ b/src/features/storages/utils/storages.dispatch.ts @@ -5,7 +5,7 @@ import {Json} from "drizzle-zod"; import * as drizzleDb from '@/db'; import {db} from '@/db'; -import type {StorageInput, StorageProviderKind, StorageResult,} from '@/features/storages/storages.types'; +import type {StorageInput, StorageProviderKind, StorageResult,} from '@/features/storages/types'; import {dispatchViaProvider} from "@/features/channel/storages"; import {StorageChannel} from "@/db/schema/12_storage-channel"; import { diff --git a/src/features/storages/storages.helpers.ts b/src/features/storages/utils/storages.helpers.ts similarity index 97% rename from src/features/storages/storages.helpers.ts rename to src/features/storages/utils/storages.helpers.ts index cb4fbe82..ec05586f 100644 --- a/src/features/storages/storages.helpers.ts +++ b/src/features/storages/utils/storages.helpers.ts @@ -1,12 +1,12 @@ import {Backup, DatabaseWith} from "@/db/schema/07_database"; -import {dispatchStorage} from "@/features/storages/storages.dispatch"; +import {dispatchStorage} from "@/features/storages/utils/storages.dispatch"; import type { StorageGetInput, StorageInput, StorageMetaData, StorageResult, StorageUploadInput -} from "@/features/storages/storages.types"; +} from "@/features/storages/types"; import * as drizzleDb from "@/db"; import {withUpdatedAt} from "@/db/utils"; import {eq} from "drizzle-orm"; diff --git a/src/features/upload/upload.action.ts b/src/features/upload/upload.action.ts index 1cf46d4f..501a19ec 100644 --- a/src/features/upload/upload.action.ts +++ b/src/features/upload/upload.action.ts @@ -7,8 +7,8 @@ import {db} from "@/db"; import {eq} from "drizzle-orm"; import * as drizzleDb from "@/db"; import {ServerActionResult} from "@/types/action-type"; -import {dispatchStorage} from "@/features/storages/storages.dispatch"; -import {StorageInput} from "@/features/storages/storages.types"; +import {dispatchStorage} from "@/features/storages/utils/storages.dispatch"; +import {StorageInput} from "@/features/storages/types"; import sharp from "sharp"; const log = logger.child({module: "features/upload/upload.action"}); diff --git a/src/lib/tasks/database/utils/delete.ts b/src/lib/tasks/database/utils/delete.ts index 27b99eec..f84552a5 100644 --- a/src/lib/tasks/database/utils/delete.ts +++ b/src/lib/tasks/database/utils/delete.ts @@ -7,8 +7,8 @@ import { db } from "@/db"; import * as drizzleDb from "@/db"; import { and, eq } from "drizzle-orm"; import { withUpdatedAt } from "@/db/utils"; -import type { StorageInput } from "@/features/storages/storages.types"; -import { dispatchStorage } from "@/features/storages/storages.dispatch"; +import type { StorageInput } from "@/features/storages/types"; +import { dispatchStorage } from "@/features/storages/utils/storages.dispatch"; export const deleteBackupCronAction = action .schema( diff --git a/src/utils/init/setting.ts b/src/utils/init/setting.ts index d69e5773..35cfefef 100644 --- a/src/utils/init/setting.ts +++ b/src/utils/init/setting.ts @@ -2,7 +2,7 @@ import { db } from "@/db"; import { env } from "@/env.mjs"; import * as drizzleDb from "@/db"; import { eq } from "drizzle-orm"; -import { StorageProviderKind } from "@/features/storages/storages.types"; +import { StorageProviderKind } from "@/features/storages/types"; import { withUpdatedAt } from "@/db/utils"; export async function createSettingsIfNotExist() {