@hdriel/aws-utils 1.3.0 → 1.3.2
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.
- package/dist/index.cjs +2 -5
- package/dist/index.d.cts +2 -4
- package/dist/index.d.ts +2 -4
- package/dist/index.js +2 -5
- package/package.json +1 -1
package/dist/index.cjs
CHANGED
|
@@ -293,7 +293,6 @@ var import_archiver = __toESM(require("archiver"), 1);
|
|
|
293
293
|
var import_node_stream2 = require("stream");
|
|
294
294
|
var import_multer_s3 = __toESM(require("multer-s3"), 1);
|
|
295
295
|
var import_multer = __toESM(require("multer"), 1);
|
|
296
|
-
var import_p_limit = __toESM(require("p-limit"), 1);
|
|
297
296
|
var import_client_s35 = require("@aws-sdk/client-s3");
|
|
298
297
|
|
|
299
298
|
// src/utils/consts.ts
|
|
@@ -1337,10 +1336,9 @@ var S3File = class extends S3Directory {
|
|
|
1337
1336
|
var pump = (0, import_util.promisify)(import_stream.pipeline);
|
|
1338
1337
|
var S3Stream = class _S3Stream extends S3File {
|
|
1339
1338
|
constructor(_a) {
|
|
1340
|
-
var _b = _a, { maxUploadFileSizeRestriction = "10GB"
|
|
1339
|
+
var _b = _a, { maxUploadFileSizeRestriction = "10GB" } = _b, props = __objRest(_b, ["maxUploadFileSizeRestriction"]);
|
|
1341
1340
|
super(props);
|
|
1342
1341
|
__publicField(this, "maxUploadFileSizeRestriction");
|
|
1343
|
-
__publicField(this, "s3Limiter");
|
|
1344
1342
|
__publicField(this, "streamImageFileCtrl", ({
|
|
1345
1343
|
fileKey: _fileKey,
|
|
1346
1344
|
queryField = "file",
|
|
@@ -1432,7 +1430,6 @@ var S3Stream = class _S3Stream extends S3File {
|
|
|
1432
1430
|
});
|
|
1433
1431
|
});
|
|
1434
1432
|
this.maxUploadFileSizeRestriction = maxUploadFileSizeRestriction;
|
|
1435
|
-
this.s3Limiter = concurrencyVideoLimit ? (0, import_p_limit.default)(concurrencyVideoLimit) : null;
|
|
1436
1433
|
}
|
|
1437
1434
|
getObjectFileStream(_0) {
|
|
1438
1435
|
return __async(this, arguments, function* (fileKey, {
|
|
@@ -1470,7 +1467,7 @@ var S3Stream = class _S3Stream extends S3File {
|
|
|
1470
1467
|
Bucket: this.bucket,
|
|
1471
1468
|
Key: normalizedKey
|
|
1472
1469
|
}, Range ? { Range } : {}));
|
|
1473
|
-
const data =
|
|
1470
|
+
const data = yield this.execute(cmd, { abortSignal });
|
|
1474
1471
|
const body = data.Body;
|
|
1475
1472
|
if (!body) return null;
|
|
1476
1473
|
return {
|
package/dist/index.d.cts
CHANGED
|
@@ -316,12 +316,10 @@ declare class S3File extends S3Directory {
|
|
|
316
316
|
|
|
317
317
|
type S3StreamProps = S3FileProps & {
|
|
318
318
|
maxUploadFileSizeRestriction?: ByteUnitStringValue;
|
|
319
|
-
concurrencyVideoLimit?: number | null;
|
|
320
319
|
};
|
|
321
320
|
declare class S3Stream extends S3File {
|
|
322
321
|
private readonly maxUploadFileSizeRestriction;
|
|
323
|
-
|
|
324
|
-
constructor({ maxUploadFileSizeRestriction, concurrencyVideoLimit, ...props }: S3StreamProps);
|
|
322
|
+
constructor({ maxUploadFileSizeRestriction, ...props }: S3StreamProps);
|
|
325
323
|
getObjectFileStream(fileKey: string, { Range, checkFileExists, abortSignal, }?: {
|
|
326
324
|
Range?: string;
|
|
327
325
|
checkFileExists?: boolean;
|
|
@@ -485,4 +483,4 @@ declare class AWSConfigSharingUtil {
|
|
|
485
483
|
};
|
|
486
484
|
}
|
|
487
485
|
|
|
488
|
-
export { ACLs, AWSConfigSharingUtil, type BucketInfo, type FILE_EXT, type FILE_TYPE, IamUtil, type IamUtilProps, type LambdaPayloadResponse, LambdaUtil, type LambdaUtilProps, S3LocalstackUtil, S3Util, type S3UtilProps, SUPPORTED_IFRAME_EXTENSIONS, SnsUtil, type SnsUtilProps, type TreeDirectoryItem, type TreeFileItem, type UploadedS3File };
|
|
486
|
+
export { ACLs, AWSConfigSharingUtil, type BucketInfo, type FILE_EXT, type FILE_TYPE, type FileUploadResponse, IamUtil, type IamUtilProps, type LambdaPayloadResponse, LambdaUtil, type LambdaUtilProps, S3LocalstackUtil, S3Util, type S3UtilProps, SUPPORTED_IFRAME_EXTENSIONS, SnsUtil, type SnsUtilProps, type TreeDirectoryItem, type TreeFileItem, type UploadedS3File };
|
package/dist/index.d.ts
CHANGED
|
@@ -316,12 +316,10 @@ declare class S3File extends S3Directory {
|
|
|
316
316
|
|
|
317
317
|
type S3StreamProps = S3FileProps & {
|
|
318
318
|
maxUploadFileSizeRestriction?: ByteUnitStringValue;
|
|
319
|
-
concurrencyVideoLimit?: number | null;
|
|
320
319
|
};
|
|
321
320
|
declare class S3Stream extends S3File {
|
|
322
321
|
private readonly maxUploadFileSizeRestriction;
|
|
323
|
-
|
|
324
|
-
constructor({ maxUploadFileSizeRestriction, concurrencyVideoLimit, ...props }: S3StreamProps);
|
|
322
|
+
constructor({ maxUploadFileSizeRestriction, ...props }: S3StreamProps);
|
|
325
323
|
getObjectFileStream(fileKey: string, { Range, checkFileExists, abortSignal, }?: {
|
|
326
324
|
Range?: string;
|
|
327
325
|
checkFileExists?: boolean;
|
|
@@ -485,4 +483,4 @@ declare class AWSConfigSharingUtil {
|
|
|
485
483
|
};
|
|
486
484
|
}
|
|
487
485
|
|
|
488
|
-
export { ACLs, AWSConfigSharingUtil, type BucketInfo, type FILE_EXT, type FILE_TYPE, IamUtil, type IamUtilProps, type LambdaPayloadResponse, LambdaUtil, type LambdaUtilProps, S3LocalstackUtil, S3Util, type S3UtilProps, SUPPORTED_IFRAME_EXTENSIONS, SnsUtil, type SnsUtilProps, type TreeDirectoryItem, type TreeFileItem, type UploadedS3File };
|
|
486
|
+
export { ACLs, AWSConfigSharingUtil, type BucketInfo, type FILE_EXT, type FILE_TYPE, type FileUploadResponse, IamUtil, type IamUtilProps, type LambdaPayloadResponse, LambdaUtil, type LambdaUtilProps, S3LocalstackUtil, S3Util, type S3UtilProps, SUPPORTED_IFRAME_EXTENSIONS, SnsUtil, type SnsUtilProps, type TreeDirectoryItem, type TreeFileItem, type UploadedS3File };
|
package/dist/index.js
CHANGED
|
@@ -253,7 +253,6 @@ import archiver from "archiver";
|
|
|
253
253
|
import { Readable as Readable2 } from "stream";
|
|
254
254
|
import multerS3 from "multer-s3";
|
|
255
255
|
import multer from "multer";
|
|
256
|
-
import pLimit from "p-limit";
|
|
257
256
|
import { GetObjectCommand as GetObjectCommand2 } from "@aws-sdk/client-s3";
|
|
258
257
|
|
|
259
258
|
// src/utils/consts.ts
|
|
@@ -1325,10 +1324,9 @@ var S3File = class extends S3Directory {
|
|
|
1325
1324
|
var pump = promisify(pipeline);
|
|
1326
1325
|
var S3Stream = class _S3Stream extends S3File {
|
|
1327
1326
|
constructor(_a) {
|
|
1328
|
-
var _b = _a, { maxUploadFileSizeRestriction = "10GB"
|
|
1327
|
+
var _b = _a, { maxUploadFileSizeRestriction = "10GB" } = _b, props = __objRest(_b, ["maxUploadFileSizeRestriction"]);
|
|
1329
1328
|
super(props);
|
|
1330
1329
|
__publicField(this, "maxUploadFileSizeRestriction");
|
|
1331
|
-
__publicField(this, "s3Limiter");
|
|
1332
1330
|
__publicField(this, "streamImageFileCtrl", ({
|
|
1333
1331
|
fileKey: _fileKey,
|
|
1334
1332
|
queryField = "file",
|
|
@@ -1420,7 +1418,6 @@ var S3Stream = class _S3Stream extends S3File {
|
|
|
1420
1418
|
});
|
|
1421
1419
|
});
|
|
1422
1420
|
this.maxUploadFileSizeRestriction = maxUploadFileSizeRestriction;
|
|
1423
|
-
this.s3Limiter = concurrencyVideoLimit ? pLimit(concurrencyVideoLimit) : null;
|
|
1424
1421
|
}
|
|
1425
1422
|
getObjectFileStream(_0) {
|
|
1426
1423
|
return __async(this, arguments, function* (fileKey, {
|
|
@@ -1458,7 +1455,7 @@ var S3Stream = class _S3Stream extends S3File {
|
|
|
1458
1455
|
Bucket: this.bucket,
|
|
1459
1456
|
Key: normalizedKey
|
|
1460
1457
|
}, Range ? { Range } : {}));
|
|
1461
|
-
const data =
|
|
1458
|
+
const data = yield this.execute(cmd, { abortSignal });
|
|
1462
1459
|
const body = data.Body;
|
|
1463
1460
|
if (!body) return null;
|
|
1464
1461
|
return {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@hdriel/aws-utils",
|
|
3
|
-
"version": "1.3.
|
|
3
|
+
"version": "1.3.2",
|
|
4
4
|
"description": "Simplified AWS SDK (v3) utilities for S3 (upload, download, streaming) with TypeScript support",
|
|
5
5
|
"author": "Hadriel Benjo (https://github.com/hdriel)",
|
|
6
6
|
"type": "module",
|