feat: adding storage system ping method in order to test.

This commit is contained in:
charlesgauthereau
2026-01-17 22:41:39 +01:00
parent 5b980fb382
commit bce1c5d9b8
6 changed files with 68 additions and 7 deletions
+5 -2
View File
@@ -4,13 +4,14 @@ import type {
StorageResult,
} from '../types';
import {uploadLocal, getLocal, deleteLocal} from './local';
import {deleteS3, getS3, uploadS3} from "@/features/storages/providers/s3";
import {uploadLocal, getLocal, deleteLocal, pingLocal} from './local';
import {deleteS3, getS3, pingS3, uploadS3} from "@/features/storages/providers/s3";
type ProviderHandler = {
upload: (config: any, input: StorageInput & { action: 'upload' }) => Promise<StorageResult>;
get: (config: any, input: StorageInput & { action: 'get' }) => Promise<StorageResult>;
delete: (config: any, input: StorageInput & { action: 'delete' }) => Promise<StorageResult>;
ping: (config: any, input: { action: 'ping' }) => Promise<StorageResult>;
};
const handlers: Record<StorageProviderKind, ProviderHandler> = {
@@ -18,11 +19,13 @@ const handlers: Record<StorageProviderKind, ProviderHandler> = {
upload: uploadLocal,
get: getLocal,
delete: deleteLocal,
ping: pingLocal,
},
s3: {
upload: uploadS3,
get: getS3,
delete: deleteS3,
ping: pingS3,
},
// gcs: null as any,
// azure: null as any,