Files
docmost/apps/server/src/integrations/storage/interfaces/storage.interface.ts
T
Philipinho a821e37028 Refactoring
* Refactor workspace membership system
* Create setup endpoint
* Use Passport.js
* Several updates and fixes
2024-03-16 22:58:12 +00:00

34 lines
783 B
TypeScript

import { S3ClientConfig } from '@aws-sdk/client-s3';
export enum StorageOption {
LOCAL = 'local',
S3 = 's3',
}
export type StorageConfig =
| { driver: StorageOption.LOCAL; config: LocalStorageConfig }
| { driver: StorageOption.S3; config: S3StorageConfig };
export interface LocalStorageConfig {
storagePath: string;
}
export interface S3StorageConfig
extends Omit<S3ClientConfig, 'endpoint' | 'bucket'> {
endpoint: string; // Enforce endpoint
bucket: string; // Enforce bucket
baseUrl?: string; // Optional CDN URL for assets
}
export interface StorageOptions {
disk: StorageConfig;
}
export interface StorageOptionsFactory {
createStorageOptions(): Promise<StorageConfig> | StorageConfig;
}
export interface StorageModuleOptions {
imports?: any[];
}