@did-space/fs-driver 0.2.130 → 0.2.132
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/operator/index.d.ts
CHANGED
|
@@ -18,7 +18,13 @@ export declare class FsSpaceOperator implements SpaceOperatorProtocol {
|
|
|
18
18
|
destroySpace(): Promise<void>;
|
|
19
19
|
isSpaceCreated(): Promise<boolean>;
|
|
20
20
|
getSpaceSize(): Promise<number>;
|
|
21
|
-
|
|
21
|
+
/**
|
|
22
|
+
* @description @jianchao 这个 getStatusAsOwner 应该 join blocklet 的 data dir,目前不修改,因为需要充分测试
|
|
23
|
+
* @param {string} path
|
|
24
|
+
* @return {*} {Promise<PathStatus>}
|
|
25
|
+
* @memberof FsSpaceOperator
|
|
26
|
+
*/
|
|
27
|
+
getStatusAsOwner(path: string): Promise<PathStatus>;
|
|
22
28
|
createAppSpace(options: AppSpaceOptions): Promise<void>;
|
|
23
29
|
destroyAppSpace(options: AppSpaceOptions): Promise<void>;
|
|
24
30
|
getAppSpacePath(options: AppSpaceOptions): Promise<string>;
|
package/dist/operator/index.js
CHANGED
|
@@ -40,11 +40,17 @@ class FsSpaceOperator {
|
|
|
40
40
|
}
|
|
41
41
|
getSpaceSize() {
|
|
42
42
|
return __awaiter(this, void 0, void 0, function* () {
|
|
43
|
-
const pathStatus = yield this.
|
|
43
|
+
const pathStatus = yield this.getStatusAsOwner(this.options.root);
|
|
44
44
|
return pathStatus.size;
|
|
45
45
|
});
|
|
46
46
|
}
|
|
47
|
-
|
|
47
|
+
/**
|
|
48
|
+
* @description @jianchao 这个 getStatusAsOwner 应该 join blocklet 的 data dir,目前不修改,因为需要充分测试
|
|
49
|
+
* @param {string} path
|
|
50
|
+
* @return {*} {Promise<PathStatus>}
|
|
51
|
+
* @memberof FsSpaceOperator
|
|
52
|
+
*/
|
|
53
|
+
getStatusAsOwner(path) {
|
|
48
54
|
const files = filehound_1.default.create()
|
|
49
55
|
.paths(path)
|
|
50
56
|
.includeFileStats()
|
|
@@ -152,7 +158,7 @@ class FsSpaceOperator {
|
|
|
152
158
|
let { size } = fileStat;
|
|
153
159
|
let lastModified = new Date(fileStat.mtime).getTime();
|
|
154
160
|
if (isDir) {
|
|
155
|
-
const pathStatus = yield this.
|
|
161
|
+
const pathStatus = yield this.getStatusAsOwner(objectKey);
|
|
156
162
|
size = pathStatus.size;
|
|
157
163
|
lastModified = pathStatus.lastModified;
|
|
158
164
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@did-space/fs-driver",
|
|
3
|
-
"version": "0.2.
|
|
3
|
+
"version": "0.2.132",
|
|
4
4
|
"publishConfig": {
|
|
5
5
|
"access": "public"
|
|
6
6
|
},
|
|
@@ -32,7 +32,7 @@
|
|
|
32
32
|
]
|
|
33
33
|
},
|
|
34
34
|
"dependencies": {
|
|
35
|
-
"@did-space/core": "0.2.
|
|
35
|
+
"@did-space/core": "0.2.132",
|
|
36
36
|
"filehound": "^1.17.6",
|
|
37
37
|
"fs-extra": "^10.1.0",
|
|
38
38
|
"hasha": "^5.2.2",
|
|
@@ -55,5 +55,5 @@
|
|
|
55
55
|
"ts-jest": "^28.0.6",
|
|
56
56
|
"typescript": "^4.9.5"
|
|
57
57
|
},
|
|
58
|
-
"gitHead": "
|
|
58
|
+
"gitHead": "72e410dd3ce245e4b5d66d998c3042c1eda1352d"
|
|
59
59
|
}
|