feat(core): Standardize S3 storage config using @tsclass/tsclass IS3Descriptor and wire it into RegistryStorage and plugins exports; update README and package dependencies.

This commit is contained in:
2025-11-23 23:54:41 +00:00
parent b1bb6af312
commit b3da95e6c1
8 changed files with 38 additions and 20 deletions

View File

@@ -18,14 +18,8 @@ export class RegistryStorage implements IStorageBackend {
* Initialize the storage backend
*/
public async init(): Promise<void> {
this.smartBucket = new plugins.smartbucket.SmartBucket({
accessKey: this.config.accessKey,
accessSecret: this.config.accessSecret,
endpoint: this.config.endpoint,
port: this.config.port || 443,
useSsl: this.config.useSsl !== false,
region: this.config.region || 'us-east-1',
});
// Pass config as IS3Descriptor to SmartBucket (bucketName is extra, SmartBucket ignores it)
this.smartBucket = new plugins.smartbucket.SmartBucket(this.config as plugins.tsclass.storage.IS3Descriptor);
// Ensure bucket exists
await this.smartBucket.createBucket(this.bucketName).catch(() => {

View File

@@ -2,6 +2,8 @@
* Core interfaces for the composable registry system
*/
import type * as plugins from '../plugins.js';
/**
* Registry protocol types
*/
@@ -40,14 +42,9 @@ export interface ICredentials {
/**
* Storage backend configuration
* Extends IS3Descriptor from @tsclass/tsclass with bucketName
*/
export interface IStorageConfig {
accessKey: string;
accessSecret: string;
endpoint: string;
port?: number;
useSsl?: boolean;
region?: string;
export interface IStorageConfig extends plugins.tsclass.storage.IS3Descriptor {
bucketName: string;
}