@quatrain/storage-s3 1.2.3 → 1.2.5

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -61,7 +61,7 @@ export declare class S3StorageAdapter extends AbstractStorageAdapter {
61
61
  * @param extra - Extra parameters such as 'cacheControl'.
62
62
  * @returns A promise resolving to the generated URL and expiration payload.
63
63
  */
64
- _getUrl(file: FileType, expiresIn?: number, action?: any, extra?: any): Promise<{
64
+ getUrl(file: FileType, expiresIn?: number, action?: any, extra?: any): Promise<{
65
65
  url: string;
66
66
  expiresIn: number;
67
67
  }>;
@@ -158,7 +158,7 @@ class S3StorageAdapter extends storage_1.AbstractStorageAdapter {
158
158
  * @param extra - Extra parameters such as 'cacheControl'.
159
159
  * @returns A promise resolving to the generated URL and expiration payload.
160
160
  */
161
- _getUrl(file_1) {
161
+ getUrl(file_1) {
162
162
  return __awaiter(this, arguments, void 0, function* (file, expiresIn = 3600, action = 'read', extra = {}) {
163
163
  const commandArgs = {
164
164
  Bucket: file.bucket,
@@ -209,7 +209,7 @@ class S3StorageAdapter extends storage_1.AbstractStorageAdapter {
209
209
  });
210
210
  const item = yield ((_a = this._client) === null || _a === void 0 ? void 0 : _a.send(command));
211
211
  const ByteArray = yield ((_b = item === null || item === void 0 ? void 0 : item.Body) === null || _b === void 0 ? void 0 : _b.transformToByteArray());
212
- const buffer = Buffer.from(ByteArray, 'base64');
212
+ const buffer = Buffer.from(ByteArray);
213
213
  const readable = new node_stream_1.Readable();
214
214
  readable.push(buffer);
215
215
  readable.push(null);
@@ -250,7 +250,7 @@ class S3StorageAdapter extends storage_1.AbstractStorageAdapter {
250
250
  });
251
251
  const item = yield this._client.send(command);
252
252
  const ByteArray = yield ((_a = item.Body) === null || _a === void 0 ? void 0 : _a.transformToByteArray());
253
- const buffer = Buffer.from(ByteArray, 'base64');
253
+ const buffer = Buffer.from(ByteArray);
254
254
  const readable = new node_stream_1.Readable();
255
255
  readable.push(buffer);
256
256
  readable.push(null);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@quatrain/storage-s3",
3
- "version": "1.2.3",
3
+ "version": "1.2.5",
4
4
  "description": "Storage adapter for S3 compatible services",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",
@@ -33,7 +33,7 @@
33
33
  "dependencies": {
34
34
  "@aws-sdk/client-s3": "^3.337.0",
35
35
  "@aws-sdk/s3-request-presigner": "^3.342.0",
36
- "@quatrain/storage": "^1.2.4",
36
+ "@quatrain/storage": "^1.2.6",
37
37
  "fs-extra": "^11.2.0"
38
38
  },
39
39
  "scripts": {
@@ -185,7 +185,7 @@ export class S3StorageAdapter extends AbstractStorageAdapter {
185
185
  * @param extra - Extra parameters such as 'cacheControl'.
186
186
  * @returns A promise resolving to the generated URL and expiration payload.
187
187
  */
188
- async _getUrl(file: FileType, expiresIn = 3600, action: any = 'read', extra: any = {}) {
188
+ async getUrl(file: FileType, expiresIn = 3600, action: any = 'read', extra: any = {}) {
189
189
  const commandArgs: any = {
190
190
  Bucket: file.bucket,
191
191
  Key: encodeURI(file.ref),
@@ -236,7 +236,7 @@ export class S3StorageAdapter extends AbstractStorageAdapter {
236
236
  })
237
237
  const item = await this._client?.send(command)
238
238
  const ByteArray: any = await item?.Body?.transformToByteArray()
239
- const buffer = Buffer.from(ByteArray, 'base64')
239
+ const buffer = Buffer.from(ByteArray)
240
240
  const readable = new Readable()
241
241
  readable.push(buffer)
242
242
  readable.push(null)
@@ -281,7 +281,7 @@ export class S3StorageAdapter extends AbstractStorageAdapter {
281
281
  })
282
282
  const item = await this._client.send(command)
283
283
  const ByteArray: any = await item.Body?.transformToByteArray()
284
- const buffer = Buffer.from(ByteArray, 'base64')
284
+ const buffer = Buffer.from(ByteArray)
285
285
  const readable = new Readable()
286
286
  readable.push(buffer)
287
287
  readable.push(null)