dfs-adapter 0.0.6 → 1.0.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/fastdfs.js +1 -1
- package/lib/http.js +1 -1
- package/lib/minio.js +8 -3
- package/lib/native.js +1 -1
- package/lib/oss.js +1 -1
- package/package.json +3 -3
package/lib/fastdfs.js
CHANGED
|
@@ -76,7 +76,7 @@ class HttpDfs extends declare_1.Dfs {
|
|
|
76
76
|
}
|
|
77
77
|
async getAccess(path) {
|
|
78
78
|
if (this.options.access) {
|
|
79
|
-
return
|
|
79
|
+
return this.options.access + path;
|
|
80
80
|
}
|
|
81
81
|
const { domain, group } = this.options;
|
|
82
82
|
return `${domain}/${group}${path}`;
|
package/lib/http.js
CHANGED
package/lib/minio.js
CHANGED
|
@@ -25,10 +25,11 @@ var __importStar = (this && this.__importStar) || function (mod) {
|
|
|
25
25
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
26
26
|
const declare_1 = require("./declare");
|
|
27
27
|
const minio = __importStar(require("minio"));
|
|
28
|
+
const net = __importStar(require("net"));
|
|
28
29
|
class MinioDfs extends declare_1.Dfs {
|
|
29
30
|
client;
|
|
30
31
|
constructor(options, context) {
|
|
31
|
-
super({ accessKey: '', secretKey: '', ...options }, context);
|
|
32
|
+
super({ accessKey: '', secretKey: '', useSSL: false, ...options }, context);
|
|
32
33
|
this.client = new minio.Client(this.options);
|
|
33
34
|
}
|
|
34
35
|
async startup() {
|
|
@@ -60,9 +61,13 @@ class MinioDfs extends declare_1.Dfs {
|
|
|
60
61
|
}
|
|
61
62
|
async getAccess(path) {
|
|
62
63
|
if (this.options.access) {
|
|
63
|
-
return `${this.options.access}
|
|
64
|
+
return `${this.options.access}${path}`;
|
|
64
65
|
}
|
|
65
|
-
|
|
66
|
+
let hostname = this.options.endPoint;
|
|
67
|
+
if (net.isIPv6(hostname)) {
|
|
68
|
+
hostname = `[${hostname}]`;
|
|
69
|
+
}
|
|
70
|
+
return `${this.options.useSSL ? 'https' : 'http'}://${hostname}:${this.options.port}/${this.options.bucketName}${path}`;
|
|
66
71
|
}
|
|
67
72
|
}
|
|
68
73
|
exports.default = MinioDfs;
|
package/lib/native.js
CHANGED
package/lib/oss.js
CHANGED
|
@@ -51,7 +51,7 @@ class OssDfs extends declare_1.Dfs {
|
|
|
51
51
|
}
|
|
52
52
|
async getAccess(path) {
|
|
53
53
|
if (this.options.access) {
|
|
54
|
-
return
|
|
54
|
+
return this.options.access + path;
|
|
55
55
|
}
|
|
56
56
|
return this.client.getObjectUrl(path, this.options.access);
|
|
57
57
|
}
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "dfs-adapter",
|
|
3
|
-
"version": "0.0
|
|
4
|
-
"description": "oss minio
|
|
3
|
+
"version": "1.0.0",
|
|
4
|
+
"description": "oss minio fastdfs native",
|
|
5
5
|
"main": "./lib/index",
|
|
6
6
|
"files": [
|
|
7
7
|
"lib/"
|
|
@@ -30,7 +30,7 @@
|
|
|
30
30
|
"axios": "^1.6.1",
|
|
31
31
|
"babel-plugin-transform-decorators-legacy": "^1.3.5",
|
|
32
32
|
"form-data": "^4.0.0",
|
|
33
|
-
"minio": "^
|
|
33
|
+
"minio": "^8.0.0",
|
|
34
34
|
"vweb-core": "^3.0.14",
|
|
35
35
|
"vweb-mvc": "^1.2.18"
|
|
36
36
|
},
|