fsd-oss 0.13.3 → 0.14.0
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/index.js +7 -9
- package/package.json +5 -5
package/lib/index.js
CHANGED
|
@@ -117,7 +117,7 @@ class OSSAdapter {
|
|
|
117
117
|
try {
|
|
118
118
|
position = await this.size(path);
|
|
119
119
|
}
|
|
120
|
-
catch (
|
|
120
|
+
catch (_e) { }
|
|
121
121
|
await this._oss.append(p, data, { position });
|
|
122
122
|
}
|
|
123
123
|
async createReadStream(path, options) {
|
|
@@ -143,7 +143,7 @@ class OSSAdapter {
|
|
|
143
143
|
}
|
|
144
144
|
async createWriteStream(path, options) {
|
|
145
145
|
debug('createWriteStream %s', path);
|
|
146
|
-
if (options
|
|
146
|
+
if (options?.start)
|
|
147
147
|
throw new Error('fsd-oss read stream does not support start options');
|
|
148
148
|
const { root } = this._options;
|
|
149
149
|
let p = slash(Path.join(root, path)).substring(1);
|
|
@@ -152,7 +152,6 @@ class OSSAdapter {
|
|
|
152
152
|
return stream;
|
|
153
153
|
}
|
|
154
154
|
async unlink(path) {
|
|
155
|
-
var _a;
|
|
156
155
|
debug('unlink %s', path);
|
|
157
156
|
const { root } = this._options;
|
|
158
157
|
let p = slash(Path.join(root, path)).substring(1);
|
|
@@ -165,7 +164,7 @@ class OSSAdapter {
|
|
|
165
164
|
maxKeys: 1000
|
|
166
165
|
});
|
|
167
166
|
continuationToken = list.NextContinuationToken;
|
|
168
|
-
if (
|
|
167
|
+
if (list.Contents?.length) {
|
|
169
168
|
let objects = list.Contents.map((o) => o.Key);
|
|
170
169
|
await this._oss.deleteMulti(objects, {
|
|
171
170
|
quiet: true
|
|
@@ -285,7 +284,6 @@ class OSSAdapter {
|
|
|
285
284
|
return url;
|
|
286
285
|
}
|
|
287
286
|
async copy(path, dest) {
|
|
288
|
-
var _a;
|
|
289
287
|
debug('copy %s to %s', path, dest);
|
|
290
288
|
if (!(await this.exists(path)))
|
|
291
289
|
throw new Error('The source path is not exists!');
|
|
@@ -303,7 +301,7 @@ class OSSAdapter {
|
|
|
303
301
|
});
|
|
304
302
|
debug('list result: %O', list);
|
|
305
303
|
continuationToken = list.NextContinuationToken;
|
|
306
|
-
if (
|
|
304
|
+
if (list.Contents?.length) {
|
|
307
305
|
await eachLimit(list.Contents, 10, async (object) => {
|
|
308
306
|
debug(' -> copy %s', object.Key);
|
|
309
307
|
let relative = slash(Path.relative(from, object.Key));
|
|
@@ -342,7 +340,7 @@ class OSSAdapter {
|
|
|
342
340
|
await this._oss.head(p);
|
|
343
341
|
return true;
|
|
344
342
|
}
|
|
345
|
-
catch (
|
|
343
|
+
catch (_e) {
|
|
346
344
|
return false;
|
|
347
345
|
}
|
|
348
346
|
}
|
|
@@ -354,7 +352,7 @@ class OSSAdapter {
|
|
|
354
352
|
await this._oss.head(p);
|
|
355
353
|
return true;
|
|
356
354
|
}
|
|
357
|
-
catch (
|
|
355
|
+
catch (_e) {
|
|
358
356
|
return false;
|
|
359
357
|
}
|
|
360
358
|
}
|
|
@@ -365,7 +363,7 @@ class OSSAdapter {
|
|
|
365
363
|
await this._oss.head(p);
|
|
366
364
|
return true;
|
|
367
365
|
}
|
|
368
|
-
catch (
|
|
366
|
+
catch (_e) {
|
|
369
367
|
return false;
|
|
370
368
|
}
|
|
371
369
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "fsd-oss",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.14.0",
|
|
4
4
|
"description": "Aliyun OSS adapter for fsd",
|
|
5
5
|
"main": "lib/index.js",
|
|
6
6
|
"types": "index.d.ts",
|
|
@@ -12,15 +12,15 @@
|
|
|
12
12
|
"author": "Liang <liang@miaomo.cc> (https://github.com/liangxingchen)",
|
|
13
13
|
"license": "MIT",
|
|
14
14
|
"dependencies": {
|
|
15
|
-
"@alicloud/pop-core": "^1.
|
|
16
|
-
"akita": "^1.0
|
|
15
|
+
"@alicloud/pop-core": "^1.8.0",
|
|
16
|
+
"akita": "^1.1.0",
|
|
17
17
|
"async": "*",
|
|
18
18
|
"crypto-js": "^4.2.0",
|
|
19
|
-
"debug": "^4.
|
|
19
|
+
"debug": "^4.4.0",
|
|
20
20
|
"mime-types": "^2.1.35",
|
|
21
21
|
"minimatch": "^3.1.2",
|
|
22
22
|
"slash": "^3.0.0",
|
|
23
23
|
"xml2js": "^0.6.2"
|
|
24
24
|
},
|
|
25
|
-
"gitHead": "
|
|
25
|
+
"gitHead": "74e32bf47242909f040eb6012dda56e5c5a668a0"
|
|
26
26
|
}
|