@quatrain/storage-s3 1.1.12 → 1.1.13
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/lib/S3StorageAdapter.js +5 -5
- package/package.json +2 -2
package/lib/S3StorageAdapter.js
CHANGED
|
@@ -28,7 +28,7 @@ class S3StorageAdapter extends storage_1.AbstractStorageAdapter {
|
|
|
28
28
|
},
|
|
29
29
|
};
|
|
30
30
|
this._client = new client_s3_1.S3Client(config);
|
|
31
|
-
storage_1.Storage.info(`AWS Storage Adapter initialized in ${this._params.
|
|
31
|
+
storage_1.Storage.info(`AWS Storage Adapter initialized in ${this._params.endpoint || this._params.region}`);
|
|
32
32
|
}
|
|
33
33
|
getDriver() {
|
|
34
34
|
return this._client;
|
|
@@ -59,7 +59,7 @@ class S3StorageAdapter extends storage_1.AbstractStorageAdapter {
|
|
|
59
59
|
}
|
|
60
60
|
copy(file, destFile) {
|
|
61
61
|
return __awaiter(this, void 0, void 0, function* () {
|
|
62
|
-
storage_1.Storage.debug(`Copying file ${file.ref} to ${destFile.ref}`);
|
|
62
|
+
storage_1.Storage.debug(`Copying file ${file.bucket}/${file.ref} to ${file.bucket}/${destFile.ref}`);
|
|
63
63
|
const command = new client_s3_1.CopyObjectCommand({
|
|
64
64
|
CopySource: encodeURI(`${file.bucket}/${file.ref}`),
|
|
65
65
|
Bucket: file.bucket,
|
|
@@ -83,7 +83,7 @@ class S3StorageAdapter extends storage_1.AbstractStorageAdapter {
|
|
|
83
83
|
move(file, destFile) {
|
|
84
84
|
return __awaiter(this, void 0, void 0, function* () {
|
|
85
85
|
try {
|
|
86
|
-
storage_1.Storage.debug(`Moving file
|
|
86
|
+
storage_1.Storage.debug(`Moving file ${file.bucket}/${file.ref} to ${file.bucket}/${destFile.ref}`);
|
|
87
87
|
yield this.copy(file, destFile);
|
|
88
88
|
yield this.delete(file);
|
|
89
89
|
}
|
|
@@ -100,7 +100,7 @@ class S3StorageAdapter extends storage_1.AbstractStorageAdapter {
|
|
|
100
100
|
Bucket: file.bucket,
|
|
101
101
|
Key: encodeURI(file.ref),
|
|
102
102
|
});
|
|
103
|
-
storage_1.Storage.debug(`Creating public url for ${file.ref}`);
|
|
103
|
+
storage_1.Storage.debug(`Creating public url for ${file.bucket}/${file.ref}`);
|
|
104
104
|
const url = yield (0, s3_request_presigner_1.getSignedUrl)(this._client, command, { expiresIn });
|
|
105
105
|
return { url, expiresIn };
|
|
106
106
|
});
|
|
@@ -108,7 +108,7 @@ class S3StorageAdapter extends storage_1.AbstractStorageAdapter {
|
|
|
108
108
|
delete(file) {
|
|
109
109
|
var _a;
|
|
110
110
|
return __awaiter(this, void 0, void 0, function* () {
|
|
111
|
-
storage_1.Storage.debug(`Deleting file ${file.ref}`);
|
|
111
|
+
storage_1.Storage.debug(`Deleting file ${file.bucket}/${file.ref}`);
|
|
112
112
|
const command = new client_s3_1.DeleteObjectCommand({
|
|
113
113
|
Bucket: file.bucket,
|
|
114
114
|
Key: file.ref,
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@quatrain/storage-s3",
|
|
3
|
-
"version": "1.1.
|
|
3
|
+
"version": "1.1.13",
|
|
4
4
|
"description": "Storage adapter for S3 compatible services",
|
|
5
5
|
"main": "lib/index.js",
|
|
6
6
|
"types": "lib/index.d.ts",
|
|
@@ -24,7 +24,7 @@
|
|
|
24
24
|
"dependencies": {
|
|
25
25
|
"@aws-sdk/client-s3": "^3.337.0",
|
|
26
26
|
"@aws-sdk/s3-request-presigner": "^3.342.0",
|
|
27
|
-
"@quatrain/storage": "^1.1.
|
|
27
|
+
"@quatrain/storage": "^1.1.16",
|
|
28
28
|
"fs-extra": "^11.2.0"
|
|
29
29
|
},
|
|
30
30
|
"scripts": {
|