@did-space/s3-driver 0.2.116 → 0.2.118
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/config/index.js +4 -12
- package/dist/operator/index.js +12 -16
- package/package.json +4 -4
package/dist/config/index.js
CHANGED
|
@@ -56,9 +56,7 @@ class S3SpaceConfig {
|
|
|
56
56
|
// @see: https://stackoverflow.com/questions/20207063/how-can-i-delete-folder-on-s3-with-node-js
|
|
57
57
|
// FIXME: @yejianchao 目前只能删除空文件夹
|
|
58
58
|
destroyConfig() {
|
|
59
|
-
return
|
|
60
|
-
return undefined;
|
|
61
|
-
});
|
|
59
|
+
return undefined;
|
|
62
60
|
}
|
|
63
61
|
set(key, value) {
|
|
64
62
|
return __awaiter(this, void 0, void 0, function* () {
|
|
@@ -116,19 +114,13 @@ class S3SpaceConfig {
|
|
|
116
114
|
});
|
|
117
115
|
}
|
|
118
116
|
setListable(options, status) {
|
|
119
|
-
return
|
|
120
|
-
return this.setPermission(options, core_1.Scopes['list:object'], status);
|
|
121
|
-
});
|
|
117
|
+
return this.setPermission(options, core_1.Scopes['list:object'], status);
|
|
122
118
|
}
|
|
123
119
|
setReadable(options, status) {
|
|
124
|
-
return
|
|
125
|
-
return this.setPermission(options, core_1.Scopes['read:object'], status);
|
|
126
|
-
});
|
|
120
|
+
return this.setPermission(options, core_1.Scopes['read:object'], status);
|
|
127
121
|
}
|
|
128
122
|
setWritable(options, status) {
|
|
129
|
-
return
|
|
130
|
-
return this.setPermission(options, core_1.Scopes['write:object'], status);
|
|
131
|
-
});
|
|
123
|
+
return this.setPermission(options, core_1.Scopes['write:object'], status);
|
|
132
124
|
}
|
|
133
125
|
isListable(options) {
|
|
134
126
|
return __awaiter(this, void 0, void 0, function* () {
|
package/dist/operator/index.js
CHANGED
|
@@ -42,16 +42,12 @@ class S3SpaceOperator {
|
|
|
42
42
|
});
|
|
43
43
|
}
|
|
44
44
|
isSpaceCreated() {
|
|
45
|
-
return
|
|
46
|
-
return this.existsAsOwner('/');
|
|
47
|
-
});
|
|
45
|
+
return this.existsAsOwner('/');
|
|
48
46
|
}
|
|
49
47
|
destroySpace() {
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
throw new Error('Method not implemented.');
|
|
54
|
-
});
|
|
48
|
+
// @see: https://stackoverflow.com/questions/20207063/how-can-i-delete-folder-on-s3-with-node-js
|
|
49
|
+
// FIXME: @yejianchao 目前只能删除空文件夹
|
|
50
|
+
throw new Error('Method not implemented.');
|
|
55
51
|
}
|
|
56
52
|
/**
|
|
57
53
|
* FIXME: @yejianchao 对于 s3 而言,获得 folder 的 size 只能遍历所有文件获得,更可恶的是 ListObjectsCommand 每次只能返回 1000 个对象,此处后续需要改进
|
|
@@ -115,16 +111,13 @@ class S3SpaceOperator {
|
|
|
115
111
|
}
|
|
116
112
|
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
|
117
113
|
destroyAppSpace(options) {
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
throw new Error('Method not implemented.');
|
|
122
|
-
});
|
|
114
|
+
// @see: https://stackoverflow.com/questions/20207063/how-can-i-delete-folder-on-s3-with-node-js
|
|
115
|
+
// FIXME: @yejianchao 目前只能删除空文件夹
|
|
116
|
+
throw new Error('Method not implemented.');
|
|
123
117
|
}
|
|
124
118
|
getAppSpacePath(options) {
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
});
|
|
119
|
+
// @ts-expect-error
|
|
120
|
+
return (0, path_1.join)(this.options.root, S3SpaceOperator.APPS, options.appDid);
|
|
128
121
|
}
|
|
129
122
|
getObjectKey(options) {
|
|
130
123
|
return __awaiter(this, void 0, void 0, function* () {
|
|
@@ -299,6 +292,9 @@ class S3SpaceOperator {
|
|
|
299
292
|
var _d;
|
|
300
293
|
return __awaiter(this, void 0, void 0, function* () {
|
|
301
294
|
const prefix = (0, url_join_1.default)(this.options.root, options.key);
|
|
295
|
+
if (!(yield this.existsAsOwner(options.key))) {
|
|
296
|
+
return [];
|
|
297
|
+
}
|
|
302
298
|
// 以 非递归的方式 && 显示文件夹 的方式列出当前文件
|
|
303
299
|
if (!options.recursive) {
|
|
304
300
|
return this.listsOneLevel(options);
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@did-space/s3-driver",
|
|
3
|
-
"version": "0.2.
|
|
3
|
+
"version": "0.2.118",
|
|
4
4
|
"publishConfig": {
|
|
5
5
|
"access": "public"
|
|
6
6
|
},
|
|
@@ -34,14 +34,14 @@
|
|
|
34
34
|
"dependencies": {
|
|
35
35
|
"@aws-sdk/client-s3": "^3.241.0",
|
|
36
36
|
"@aws-sdk/lib-storage": "^3.241.0",
|
|
37
|
-
"@did-space/core": "0.2.
|
|
37
|
+
"@did-space/core": "0.2.118",
|
|
38
38
|
"js-yaml": "^4.1.0",
|
|
39
39
|
"lodash": "^4.17.21",
|
|
40
40
|
"mime-types": "^2.1.35",
|
|
41
41
|
"url-join": "4"
|
|
42
42
|
},
|
|
43
43
|
"devDependencies": {
|
|
44
|
-
"@arcblock/eslint-config-ts": "^0.2.
|
|
44
|
+
"@arcblock/eslint-config-ts": "^0.2.4",
|
|
45
45
|
"@aws-sdk/types": "^3.241.0",
|
|
46
46
|
"@types/fs-extra": "^9.0.13",
|
|
47
47
|
"@types/jest": "^28.1.5",
|
|
@@ -57,5 +57,5 @@
|
|
|
57
57
|
"ts-jest": "^28.0.6",
|
|
58
58
|
"typescript": "^4.9.5"
|
|
59
59
|
},
|
|
60
|
-
"gitHead": "
|
|
60
|
+
"gitHead": "ae24b656fb484cb1147c3bccce6d4c8f956e7c30"
|
|
61
61
|
}
|