fix(storage): rename S3 configuration and change stream interfaces to storage-oriented types

This commit is contained in:
2026-03-14 23:27:25 +00:00
parent 2da2d57df1
commit a829f76d4b
21 changed files with 2133 additions and 2014 deletions

View File

@@ -7,7 +7,7 @@ import type * as interfaces from '../interfaces/index.js';
* or accepts programmatic configuration.
*/
export class TsViewConfig {
private s3Config: interfaces.IS3Config | null = null;
private storageConfig: interfaces.IStorageConfig | null = null;
private mongoConfig: interfaces.IMongoConfig | null = null;
/**
@@ -29,7 +29,7 @@ export class TsViewConfig {
// Parse S3 config
if (envConfig.S3_HOST || envConfig.S3_ENDPOINT) {
this.s3Config = {
this.storageConfig = {
endpoint: envConfig.S3_ENDPOINT || envConfig.S3_HOST || '',
port: envConfig.S3_PORT ? parseInt(envConfig.S3_PORT, 10) : undefined,
accessKey: envConfig.S3_ACCESSKEY || '',
@@ -69,8 +69,8 @@ export class TsViewConfig {
/**
* Set S3 configuration programmatically
*/
public setS3Config(config: interfaces.IS3Config): void {
this.s3Config = config;
public setStorageConfig(config: interfaces.IStorageConfig): void {
this.storageConfig = config;
}
/**
@@ -83,8 +83,8 @@ export class TsViewConfig {
/**
* Get S3 configuration
*/
public getS3Config(): interfaces.IS3Config | null {
return this.s3Config;
public getStorageConfig(): interfaces.IStorageConfig | null {
return this.storageConfig;
}
/**
@@ -97,8 +97,8 @@ export class TsViewConfig {
/**
* Check if S3 is configured
*/
public hasS3(): boolean {
return this.s3Config !== null && !!this.s3Config.endpoint && !!this.s3Config.accessKey;
public hasStorage(): boolean {
return this.storageConfig !== null && !!this.storageConfig.endpoint && !!this.storageConfig.accessKey;
}
/**