@punks/backend-entity-manager 0.0.481 → 0.0.483
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/cjs/index.js +18 -0
- package/dist/cjs/index.js.map +1 -1
- package/dist/cjs/types/abstractions/buckets.d.ts +5 -0
- package/dist/cjs/types/platforms/nest/decorators/entity.d.ts +1 -0
- package/dist/cjs/types/platforms/nest/plugins/buckets/aws-s3/provider/bucket.d.ts +2 -1
- package/dist/cjs/types/platforms/nest/plugins/buckets/testing/mock.d.ts +2 -1
- package/dist/esm/index.js +18 -0
- package/dist/esm/index.js.map +1 -1
- package/dist/esm/types/abstractions/buckets.d.ts +5 -0
- package/dist/esm/types/platforms/nest/decorators/entity.d.ts +1 -0
- package/dist/esm/types/platforms/nest/plugins/buckets/aws-s3/provider/bucket.d.ts +2 -1
- package/dist/esm/types/platforms/nest/plugins/buckets/testing/mock.d.ts +2 -1
- package/dist/index.d.ts +9 -1
- package/package.json +1 -1
package/dist/cjs/index.js
CHANGED
|
@@ -35787,6 +35787,18 @@ exports.AwsS3BucketProvider = class AwsS3BucketProvider {
|
|
|
35787
35787
|
throw new AwsS3BucketError(`AWS BUCKET | downloadFile | ${input.bucket} | ${input.filePath} | Error -> ${e.message}`);
|
|
35788
35788
|
}
|
|
35789
35789
|
}
|
|
35790
|
+
async fileExists(input) {
|
|
35791
|
+
try {
|
|
35792
|
+
const result = await this.client.send(new clientS3.GetObjectCommand({
|
|
35793
|
+
Bucket: input.bucket,
|
|
35794
|
+
Key: input.filePath,
|
|
35795
|
+
}));
|
|
35796
|
+
return (result.ContentLength ?? 0) > 0;
|
|
35797
|
+
}
|
|
35798
|
+
catch (e) {
|
|
35799
|
+
throw new AwsS3BucketError(`AwsS3Bucket | fileExists | Error -> ${e.message}`);
|
|
35800
|
+
}
|
|
35801
|
+
}
|
|
35790
35802
|
async filePublicUrlCreate(input) {
|
|
35791
35803
|
try {
|
|
35792
35804
|
return await s3RequestPresigner.getSignedUrl(this.client, new clientS3.GetObjectCommand({
|
|
@@ -36026,6 +36038,12 @@ exports.InMemoryBucketProvider = class InMemoryBucketProvider {
|
|
|
36026
36038
|
const folderKey = `${input.bucket}/${input.path}`;
|
|
36027
36039
|
return !!this.inMemoryFolders[folderKey];
|
|
36028
36040
|
}
|
|
36041
|
+
async fileExists(input) {
|
|
36042
|
+
// Implement fileExists logic here
|
|
36043
|
+
// Check if the file exists in inMemoryStorage
|
|
36044
|
+
const fileKey = `${input.bucket}/${input.filePath}`;
|
|
36045
|
+
return !!this.inMemoryStorage[fileKey];
|
|
36046
|
+
}
|
|
36029
36047
|
async fileDownload(input) {
|
|
36030
36048
|
// Implement fileDownload logic here
|
|
36031
36049
|
// Retrieve the file content from inMemoryStorage based on the filePath
|