@quatrain/storage-supabase 1.1.15 → 1.1.17
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.
|
@@ -76,8 +76,7 @@ class SupabaseStorageAdapter extends storage_1.AbstractStorageAdapter {
|
|
|
76
76
|
const { error } = yield this._client
|
|
77
77
|
.from(file.bucket)
|
|
78
78
|
.upload(file.ref, new Blob([node_fs_1.default.readFileSync(stream)]), {
|
|
79
|
-
|
|
80
|
-
upsert: false,
|
|
79
|
+
upsert: true,
|
|
81
80
|
contentType: file.contentType,
|
|
82
81
|
});
|
|
83
82
|
if (error !== null) {
|
|
@@ -114,7 +113,6 @@ class SupabaseStorageAdapter extends storage_1.AbstractStorageAdapter {
|
|
|
114
113
|
.copy(file.ref, destFile.ref, {
|
|
115
114
|
destinationBucket: destFile.bucket,
|
|
116
115
|
});
|
|
117
|
-
console.log(response);
|
|
118
116
|
}
|
|
119
117
|
catch (err) {
|
|
120
118
|
console.error(err);
|
|
@@ -124,7 +122,7 @@ class SupabaseStorageAdapter extends storage_1.AbstractStorageAdapter {
|
|
|
124
122
|
move(file, destFile) {
|
|
125
123
|
return __awaiter(this, void 0, void 0, function* () {
|
|
126
124
|
storage_1.Storage.info(`Moving file ${file.ref} to ${destFile.ref} in same bucket ${file.bucket}`);
|
|
127
|
-
const {
|
|
125
|
+
const { error } = yield this._client
|
|
128
126
|
.from(file.bucket)
|
|
129
127
|
.move(file.ref, destFile.ref);
|
|
130
128
|
if (error !== null) {
|
|
@@ -136,7 +134,7 @@ class SupabaseStorageAdapter extends storage_1.AbstractStorageAdapter {
|
|
|
136
134
|
}
|
|
137
135
|
getUrl(file, expiresIn = 3600) {
|
|
138
136
|
return __awaiter(this, void 0, void 0, function* () {
|
|
139
|
-
storage_1.Storage.
|
|
137
|
+
storage_1.Storage.debug(`Getting signed url for file ${file.ref} in bucket ${file.bucket}`);
|
|
140
138
|
const { data, error } = yield this._client
|
|
141
139
|
.from(file.bucket)
|
|
142
140
|
.createSignedUrl(file.ref, expiresIn, { download: true });
|
|
@@ -159,8 +157,7 @@ class SupabaseStorageAdapter extends storage_1.AbstractStorageAdapter {
|
|
|
159
157
|
}
|
|
160
158
|
getReadable(file) {
|
|
161
159
|
return __awaiter(this, void 0, void 0, function* () {
|
|
162
|
-
storage_1.Storage.
|
|
163
|
-
console.log(file);
|
|
160
|
+
storage_1.Storage.debug(`GET Readable : ${file.ref}`);
|
|
164
161
|
const path = (0, path_1.join)((0, os_1.tmpdir)(), String(Date.now()));
|
|
165
162
|
const item = yield this.download(file, { path, onlyContent: true });
|
|
166
163
|
const buffer = Buffer.from(item.toString(), 'base64');
|
|
@@ -172,7 +169,7 @@ class SupabaseStorageAdapter extends storage_1.AbstractStorageAdapter {
|
|
|
172
169
|
}
|
|
173
170
|
stream(file, res) {
|
|
174
171
|
return __awaiter(this, void 0, void 0, function* () {
|
|
175
|
-
storage_1.Storage.
|
|
172
|
+
storage_1.Storage.debug(`GET Stream : ${file.ref}`);
|
|
176
173
|
const path = (0, path_1.join)((0, os_1.tmpdir)(), String(Date.now()));
|
|
177
174
|
const item = yield this.download(file, { path, onlyContent: true });
|
|
178
175
|
const buffer = Buffer.from(item.toString(), 'base64');
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@quatrain/storage-supabase",
|
|
3
|
-
"version": "1.1.
|
|
3
|
+
"version": "1.1.17",
|
|
4
4
|
"description": "Storage adapter for Supabase Storage",
|
|
5
5
|
"main": "lib/index.js",
|
|
6
6
|
"types": "lib/index.d.ts",
|
|
@@ -14,7 +14,7 @@
|
|
|
14
14
|
"@tsconfig/recommended": "^1.0.1",
|
|
15
15
|
"@types/jest": "^27.0.3",
|
|
16
16
|
"@types/node": "^22.10.1",
|
|
17
|
-
"jest": "^
|
|
17
|
+
"jest": "^30.2.0",
|
|
18
18
|
"jest-node-exports-resolver": "^1.1.6",
|
|
19
19
|
"trace-unhandled": "^2.0.1",
|
|
20
20
|
"ts-jest": "^27.1.2",
|
|
@@ -22,10 +22,10 @@
|
|
|
22
22
|
"typescript": "^5.1.5"
|
|
23
23
|
},
|
|
24
24
|
"dependencies": {
|
|
25
|
-
"@quatrain/core": "^1.1.
|
|
26
|
-
"@quatrain/storage": "^1.1.
|
|
25
|
+
"@quatrain/core": "^1.1.24",
|
|
26
|
+
"@quatrain/storage": "^1.1.23",
|
|
27
27
|
"@supabase/storage-js": "^2.7.2",
|
|
28
|
-
"@supabase/supabase-js": "^2.
|
|
28
|
+
"@supabase/supabase-js": "^2.87.3"
|
|
29
29
|
},
|
|
30
30
|
"scripts": {
|
|
31
31
|
"test-ci": "jest --runInBand",
|