@@ -34,17 +34,20 @@ exports.syncObjectsFromS3 = async () => {
3434 const start = new Date ( ) ;
3535 const client = new S3Client ( {
3636 region : settings . region ,
37+ endpoint : settings . endpoint ,
3738 credentials : {
3839 accessKeyId : settings . accessKeyId ,
3940 secretAccessKey : settings . secretAccessKey ,
4041 } ,
4142 } ) ;
43+
4244 const scanObjects = async continuationToken => {
4345 const pathSet = new Set ( ) ;
4446 const result = await client . send ( new ListObjectsV2Command ( {
4547 Bucket : settings . bucket ,
4648 ContinuationToken : continuationToken ,
4749 } ) ) ;
50+
4851 const convertS3Object = ( { Key, Size, LastModified, StorageClass} ) => ( {
4952 type : Key . slice ( - 1 ) === '/' ? OBJECT_TYPE . FOLDER : OBJECT_TYPE . FILE ,
5053 path : Key ,
@@ -105,6 +108,7 @@ exports.syncObjectsFromS3 = async () => {
105108exports . headObject = ( path , options ) => {
106109 const client = new S3Client ( {
107110 region : settings . region ,
111+ endpoint : settings . endpoint ,
108112 credentials : {
109113 accessKeyId : settings . accessKeyId ,
110114 secretAccessKey : settings . secretAccessKey ,
@@ -127,6 +131,7 @@ exports.headObject = (path, options) => {
127131exports . getSignedUrl = ( path , { expiresIn = 24 * 60 * 60 } = { } ) => {
128132 const client = new S3Client ( {
129133 region : settings . region ,
134+ endpoint : settings . endpoint ,
130135 credentials : {
131136 accessKeyId : settings . accessKeyId ,
132137 secretAccessKey : settings . secretAccessKey ,
@@ -148,6 +153,7 @@ exports.getSignedUrl = (path, {expiresIn = 24 * 60 * 60} = {}) => {
148153exports . getObject = path => {
149154 const client = new S3Client ( {
150155 region : settings . region ,
156+ endpoint : settings . endpoint ,
151157 credentials : {
152158 accessKeyId : settings . accessKeyId ,
153159 secretAccessKey : settings . secretAccessKey ,
@@ -170,6 +176,7 @@ exports.getObject = path => {
170176exports . putObject = ( path , options = { } ) => {
171177 const client = new S3Client ( {
172178 region : settings . region ,
179+ endpoint : settings . endpoint ,
173180 credentials : {
174181 accessKeyId : settings . accessKeyId ,
175182 secretAccessKey : settings . secretAccessKey ,
@@ -195,6 +202,7 @@ exports.putObject = (path, options = {}) => {
195202exports . upload = ( { path, content, options, onProgress} ) => {
196203 const client = new S3Client ( {
197204 region : settings . region ,
205+ endpoint : settings . endpoint ,
198206 credentials : {
199207 accessKeyId : settings . accessKeyId ,
200208 secretAccessKey : settings . secretAccessKey ,
@@ -225,6 +233,7 @@ exports.upload = ({path, content, options, onProgress}) => {
225233exports . deleteObjects = paths => {
226234 const client = new S3Client ( {
227235 region : settings . region ,
236+ endpoint : settings . endpoint ,
228237 credentials : {
229238 accessKeyId : settings . accessKeyId ,
230239 secretAccessKey : settings . secretAccessKey ,
0 commit comments