fix(core): update
This commit is contained in:
parent
bd8b05920f
commit
a9bb31c2a2
@ -3,6 +3,6 @@
|
||||
*/
|
||||
export const commitinfo = {
|
||||
name: '@push.rocks/smartbucket',
|
||||
version: '3.0.16',
|
||||
version: '3.0.17',
|
||||
description: 'A TypeScript library offering simple and cloud-agnostic object storage with advanced features like bucket creation, file and directory management, and data streaming.'
|
||||
}
|
||||
|
@ -14,18 +14,18 @@ export class SmartBucket {
|
||||
/**
|
||||
* the constructor of SmartBucket
|
||||
*/
|
||||
constructor(configArg: plugins.tsclass.storage.IS3Descriptor) {
|
||||
constructor(configArg: IS3Descriptor) {
|
||||
this.config = configArg;
|
||||
const endpoint = this.config.endpoint.startsWith('http://') || this.config.endpoint.startsWith('https://')
|
||||
? this.config.endpoint
|
||||
: `https://${this.config.endpoint}`;
|
||||
|
||||
const protocol = configArg.useSsl === false ? 'http' : 'https';
|
||||
const endpoint = `${protocol}://${configArg.endpoint}`;
|
||||
|
||||
this.s3Client = new plugins.s3.S3Client({
|
||||
endpoint,
|
||||
region: this.config.region || 'us-east-1',
|
||||
region: configArg.region || 'us-east-1',
|
||||
credentials: {
|
||||
accessKeyId: this.config.accessKey,
|
||||
secretAccessKey: this.config.accessSecret,
|
||||
accessKeyId: configArg.accessKey,
|
||||
secretAccessKey: configArg.accessSecret,
|
||||
},
|
||||
forcePathStyle: true, // Necessary for S3-compatible storage like MinIO or Wasabi
|
||||
});
|
||||
|
Loading…
Reference in New Issue
Block a user