@did-space/s3-driver 0.3.10 → 0.3.11
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.js +8 -3
- package/package.json +3 -3
package/dist/operator/index.js
CHANGED
|
@@ -28,6 +28,7 @@ const mime_types_1 = __importDefault(require("mime-types"));
|
|
|
28
28
|
const isEmpty_1 = __importDefault(require("lodash/isEmpty"));
|
|
29
29
|
const debug_1 = __importDefault(require("debug"));
|
|
30
30
|
const p_all_1 = __importDefault(require("p-all"));
|
|
31
|
+
const lodash_1 = require("lodash");
|
|
31
32
|
const common_1 = require("../utils/common");
|
|
32
33
|
const { version: s3ClientVersion } = require('@aws-sdk/client-s3/package.json');
|
|
33
34
|
const { version: libStorageVersion } = require('@aws-sdk/lib-storage/package.json');
|
|
@@ -297,6 +298,7 @@ class S3SpaceOperator {
|
|
|
297
298
|
lastModified: new Date(content.LastModified).getTime(),
|
|
298
299
|
editable: core_1.Space.editable(key),
|
|
299
300
|
mimeType: mime_types_1.default.lookup(name) || 'unknown',
|
|
301
|
+
absolutePath: content.Key,
|
|
300
302
|
});
|
|
301
303
|
});
|
|
302
304
|
folders.push(...((_e = response === null || response === void 0 ? void 0 : response.CommonPrefixes) !== null && _e !== void 0 ? _e : []).map((c) => c.Prefix));
|
|
@@ -327,6 +329,7 @@ class S3SpaceOperator {
|
|
|
327
329
|
lastModified,
|
|
328
330
|
editable: false,
|
|
329
331
|
mimeType: mime_types_1.default.lookup(name) || 'unknown',
|
|
332
|
+
absolutePath: folderKey,
|
|
330
333
|
});
|
|
331
334
|
})));
|
|
332
335
|
return objects;
|
|
@@ -370,6 +373,7 @@ class S3SpaceOperator {
|
|
|
370
373
|
lastModified: new Date(content.LastModified).getTime(),
|
|
371
374
|
editable: core_1.Space.editable(key),
|
|
372
375
|
mimeType: mime_types_1.default.lookup(name) || 'unknown',
|
|
376
|
+
absolutePath: key,
|
|
373
377
|
});
|
|
374
378
|
});
|
|
375
379
|
}
|
|
@@ -425,10 +429,10 @@ class S3SpaceOperator {
|
|
|
425
429
|
list(options) {
|
|
426
430
|
var _a;
|
|
427
431
|
return __awaiter(this, void 0, void 0, function* () {
|
|
428
|
-
const
|
|
432
|
+
const absolutePath = (0, path_1.join)(this.options.root, options.key);
|
|
429
433
|
const response = yield this.s3Client.send(new client_s3_1.ListObjectsCommand({
|
|
430
434
|
Bucket: this.options.bucket,
|
|
431
|
-
Prefix:
|
|
435
|
+
Prefix: absolutePath,
|
|
432
436
|
}));
|
|
433
437
|
const [content] = (_a = response === null || response === void 0 ? void 0 : response.Contents) !== null && _a !== void 0 ? _a : [];
|
|
434
438
|
if (!content) {
|
|
@@ -442,12 +446,13 @@ class S3SpaceOperator {
|
|
|
442
446
|
lastModified: new Date(content.LastModified).getTime(),
|
|
443
447
|
editable: core_1.Space.editable(options.key),
|
|
444
448
|
mimeType: mime_types_1.default.lookup(options.key) || 'unknown',
|
|
449
|
+
absolutePath,
|
|
445
450
|
};
|
|
446
451
|
});
|
|
447
452
|
}
|
|
448
453
|
writeAsOwner(key, data, options) {
|
|
449
454
|
return __awaiter(this, void 0, void 0, function* () {
|
|
450
|
-
debug('writeAsOwner.before', JSON.stringify({ key, options }));
|
|
455
|
+
debug('writeAsOwner.before', JSON.stringify({ key, options: (0, lodash_1.omit)(options, 'data') }));
|
|
451
456
|
const $key = (0, common_1.getSafeKey)((options === null || options === void 0 ? void 0 : options.useGlobal) ? key : (0, path_1.join)(this.options.root, key));
|
|
452
457
|
debug('writeAsOwner.$$key', $key);
|
|
453
458
|
const upload = new lib_storage_1.Upload({
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@did-space/s3-driver",
|
|
3
|
-
"version": "0.3.
|
|
3
|
+
"version": "0.3.11",
|
|
4
4
|
"publishConfig": {
|
|
5
5
|
"access": "public"
|
|
6
6
|
},
|
|
@@ -38,7 +38,7 @@
|
|
|
38
38
|
"dependencies": {
|
|
39
39
|
"@aws-sdk/client-s3": "3.370.0",
|
|
40
40
|
"@aws-sdk/lib-storage": "3.370.0",
|
|
41
|
-
"@did-space/core": "0.3.
|
|
41
|
+
"@did-space/core": "0.3.11",
|
|
42
42
|
"debug": "^4.3.4",
|
|
43
43
|
"js-yaml": "^4.1.0",
|
|
44
44
|
"lodash": "^4.17.21",
|
|
@@ -61,5 +61,5 @@
|
|
|
61
61
|
"ts-jest": "^28.0.6",
|
|
62
62
|
"typescript": "^4.9.5"
|
|
63
63
|
},
|
|
64
|
-
"gitHead": "
|
|
64
|
+
"gitHead": "c6d855ee4ae889b24a3ba7575059f03c348353f9"
|
|
65
65
|
}
|