@nocobase/plugin-file-manager 1.5.19 → 1.5.21
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/client/index.js +1 -1
- package/dist/client/templates/file.d.ts +0 -24
- package/dist/externalVersion.js +7 -7
- package/dist/node_modules/@aws-sdk/client-s3/package.json +1 -1
- package/dist/node_modules/iconv-lite/.github/dependabot.yml +11 -0
- package/dist/node_modules/iconv-lite/.idea/codeStyles/Project.xml +47 -0
- package/dist/node_modules/iconv-lite/.idea/codeStyles/codeStyleConfig.xml +5 -0
- package/dist/node_modules/iconv-lite/.idea/iconv-lite.iml +12 -0
- package/dist/node_modules/iconv-lite/.idea/inspectionProfiles/Project_Default.xml +6 -0
- package/dist/node_modules/iconv-lite/.idea/modules.xml +8 -0
- package/dist/node_modules/iconv-lite/.idea/vcs.xml +6 -0
- package/dist/node_modules/iconv-lite/LICENSE +21 -0
- package/dist/node_modules/iconv-lite/encodings/dbcs-codec.js +597 -0
- package/dist/node_modules/iconv-lite/encodings/dbcs-data.js +188 -0
- package/dist/node_modules/iconv-lite/encodings/index.js +23 -0
- package/dist/node_modules/iconv-lite/encodings/internal.js +198 -0
- package/dist/node_modules/iconv-lite/encodings/sbcs-codec.js +72 -0
- package/dist/node_modules/iconv-lite/encodings/sbcs-data-generated.js +451 -0
- package/dist/node_modules/iconv-lite/encodings/sbcs-data.js +179 -0
- package/dist/node_modules/iconv-lite/encodings/tables/big5-added.json +122 -0
- package/dist/node_modules/iconv-lite/encodings/tables/cp936.json +264 -0
- package/dist/node_modules/iconv-lite/encodings/tables/cp949.json +273 -0
- package/dist/node_modules/iconv-lite/encodings/tables/cp950.json +177 -0
- package/dist/node_modules/iconv-lite/encodings/tables/eucjp.json +182 -0
- package/dist/node_modules/iconv-lite/encodings/tables/gb18030-ranges.json +1 -0
- package/dist/node_modules/iconv-lite/encodings/tables/gbk-added.json +56 -0
- package/dist/node_modules/iconv-lite/encodings/tables/shiftjis.json +125 -0
- package/dist/node_modules/iconv-lite/encodings/utf16.js +197 -0
- package/dist/node_modules/iconv-lite/encodings/utf32.js +319 -0
- package/dist/node_modules/iconv-lite/encodings/utf7.js +290 -0
- package/dist/node_modules/iconv-lite/lib/bom-handling.js +52 -0
- package/dist/node_modules/iconv-lite/lib/index.d.ts +41 -0
- package/dist/node_modules/iconv-lite/lib/index.js +1 -0
- package/dist/node_modules/iconv-lite/lib/streams.js +109 -0
- package/dist/node_modules/iconv-lite/package.json +1 -0
- package/dist/node_modules/mime-match/package.json +1 -1
- package/dist/node_modules/mkdirp/package.json +1 -1
- package/dist/node_modules/multer-aliyun-oss/package.json +1 -1
- package/dist/node_modules/multer-cos/package.json +1 -1
- package/dist/node_modules/multer-s3/package.json +1 -1
- package/dist/server/utils.js +4 -2
- package/package.json +3 -2
|
@@ -0,0 +1,109 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
var Buffer = require("safer-buffer").Buffer;
|
|
4
|
+
|
|
5
|
+
// NOTE: Due to 'stream' module being pretty large (~100Kb, significant in browser environments),
|
|
6
|
+
// we opt to dependency-inject it instead of creating a hard dependency.
|
|
7
|
+
module.exports = function(stream_module) {
|
|
8
|
+
var Transform = stream_module.Transform;
|
|
9
|
+
|
|
10
|
+
// == Encoder stream =======================================================
|
|
11
|
+
|
|
12
|
+
function IconvLiteEncoderStream(conv, options) {
|
|
13
|
+
this.conv = conv;
|
|
14
|
+
options = options || {};
|
|
15
|
+
options.decodeStrings = false; // We accept only strings, so we don't need to decode them.
|
|
16
|
+
Transform.call(this, options);
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
IconvLiteEncoderStream.prototype = Object.create(Transform.prototype, {
|
|
20
|
+
constructor: { value: IconvLiteEncoderStream }
|
|
21
|
+
});
|
|
22
|
+
|
|
23
|
+
IconvLiteEncoderStream.prototype._transform = function(chunk, encoding, done) {
|
|
24
|
+
if (typeof chunk != 'string')
|
|
25
|
+
return done(new Error("Iconv encoding stream needs strings as its input."));
|
|
26
|
+
try {
|
|
27
|
+
var res = this.conv.write(chunk);
|
|
28
|
+
if (res && res.length) this.push(res);
|
|
29
|
+
done();
|
|
30
|
+
}
|
|
31
|
+
catch (e) {
|
|
32
|
+
done(e);
|
|
33
|
+
}
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
IconvLiteEncoderStream.prototype._flush = function(done) {
|
|
37
|
+
try {
|
|
38
|
+
var res = this.conv.end();
|
|
39
|
+
if (res && res.length) this.push(res);
|
|
40
|
+
done();
|
|
41
|
+
}
|
|
42
|
+
catch (e) {
|
|
43
|
+
done(e);
|
|
44
|
+
}
|
|
45
|
+
}
|
|
46
|
+
|
|
47
|
+
IconvLiteEncoderStream.prototype.collect = function(cb) {
|
|
48
|
+
var chunks = [];
|
|
49
|
+
this.on('error', cb);
|
|
50
|
+
this.on('data', function(chunk) { chunks.push(chunk); });
|
|
51
|
+
this.on('end', function() {
|
|
52
|
+
cb(null, Buffer.concat(chunks));
|
|
53
|
+
});
|
|
54
|
+
return this;
|
|
55
|
+
}
|
|
56
|
+
|
|
57
|
+
|
|
58
|
+
// == Decoder stream =======================================================
|
|
59
|
+
|
|
60
|
+
function IconvLiteDecoderStream(conv, options) {
|
|
61
|
+
this.conv = conv;
|
|
62
|
+
options = options || {};
|
|
63
|
+
options.encoding = this.encoding = 'utf8'; // We output strings.
|
|
64
|
+
Transform.call(this, options);
|
|
65
|
+
}
|
|
66
|
+
|
|
67
|
+
IconvLiteDecoderStream.prototype = Object.create(Transform.prototype, {
|
|
68
|
+
constructor: { value: IconvLiteDecoderStream }
|
|
69
|
+
});
|
|
70
|
+
|
|
71
|
+
IconvLiteDecoderStream.prototype._transform = function(chunk, encoding, done) {
|
|
72
|
+
if (!Buffer.isBuffer(chunk) && !(chunk instanceof Uint8Array))
|
|
73
|
+
return done(new Error("Iconv decoding stream needs buffers as its input."));
|
|
74
|
+
try {
|
|
75
|
+
var res = this.conv.write(chunk);
|
|
76
|
+
if (res && res.length) this.push(res, this.encoding);
|
|
77
|
+
done();
|
|
78
|
+
}
|
|
79
|
+
catch (e) {
|
|
80
|
+
done(e);
|
|
81
|
+
}
|
|
82
|
+
}
|
|
83
|
+
|
|
84
|
+
IconvLiteDecoderStream.prototype._flush = function(done) {
|
|
85
|
+
try {
|
|
86
|
+
var res = this.conv.end();
|
|
87
|
+
if (res && res.length) this.push(res, this.encoding);
|
|
88
|
+
done();
|
|
89
|
+
}
|
|
90
|
+
catch (e) {
|
|
91
|
+
done(e);
|
|
92
|
+
}
|
|
93
|
+
}
|
|
94
|
+
|
|
95
|
+
IconvLiteDecoderStream.prototype.collect = function(cb) {
|
|
96
|
+
var res = '';
|
|
97
|
+
this.on('error', cb);
|
|
98
|
+
this.on('data', function(chunk) { res += chunk; });
|
|
99
|
+
this.on('end', function() {
|
|
100
|
+
cb(null, res);
|
|
101
|
+
});
|
|
102
|
+
return this;
|
|
103
|
+
}
|
|
104
|
+
|
|
105
|
+
return {
|
|
106
|
+
IconvLiteEncoderStream: IconvLiteEncoderStream,
|
|
107
|
+
IconvLiteDecoderStream: IconvLiteDecoderStream,
|
|
108
|
+
};
|
|
109
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"name":"iconv-lite","description":"Convert character encodings in pure javascript.","version":"0.6.3","license":"MIT","keywords":["iconv","convert","charset","icu"],"author":"Alexander Shtuchkin <ashtuchkin@gmail.com>","main":"./lib/index.js","typings":"./lib/index.d.ts","homepage":"https://github.com/ashtuchkin/iconv-lite","bugs":"https://github.com/ashtuchkin/iconv-lite/issues","repository":{"type":"git","url":"git://github.com/ashtuchkin/iconv-lite.git"},"engines":{"node":">=0.10.0"},"scripts":{"coverage":"c8 _mocha --grep .","test":"mocha --reporter spec --grep ."},"browser":{"stream":false},"devDependencies":{"async":"^3.2.0","c8":"^7.2.0","errto":"^0.2.1","iconv":"^2.3.5","mocha":"^3.5.3","request":"^2.88.2","semver":"^6.3.0","unorm":"^1.6.0"},"dependencies":{"safer-buffer":">= 2.1.2 < 3.0.0"},"_lastModified":"2025-03-05T15:43:08.763Z"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"name":"mime-match","version":"1.0.2","description":"A simple function to check whether a mimetype matches the specified mimetype (with wildcard support)","main":"index.js","scripts":{"test":"node test.js","gendocs":"gendocs > README.md"},"repository":{"type":"git","url":"https://github.com/DamonOehlman/mime-match.git"},"keywords":["mime","wildcard"],"author":"Damon Oehlman <damon.oehlman@gmail.com>","license":"ISC","bugs":{"url":"https://github.com/DamonOehlman/mime-match/issues"},"homepage":"https://github.com/DamonOehlman/mime-match","dependencies":{"wildcard":"^1.1.0"},"devDependencies":{"tape":"^4.5.1"},"_lastModified":"2025-03-
|
|
1
|
+
{"name":"mime-match","version":"1.0.2","description":"A simple function to check whether a mimetype matches the specified mimetype (with wildcard support)","main":"index.js","scripts":{"test":"node test.js","gendocs":"gendocs > README.md"},"repository":{"type":"git","url":"https://github.com/DamonOehlman/mime-match.git"},"keywords":["mime","wildcard"],"author":"Damon Oehlman <damon.oehlman@gmail.com>","license":"ISC","bugs":{"url":"https://github.com/DamonOehlman/mime-match/issues"},"homepage":"https://github.com/DamonOehlman/mime-match","dependencies":{"wildcard":"^1.1.0"},"devDependencies":{"tape":"^4.5.1"},"_lastModified":"2025-03-05T15:43:08.866Z"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"name":"mkdirp","description":"Recursively mkdir, like `mkdir -p`","version":"0.5.6","publishConfig":{"tag":"legacy"},"author":"James Halliday <mail@substack.net> (http://substack.net)","main":"index.js","keywords":["mkdir","directory"],"repository":{"type":"git","url":"https://github.com/substack/node-mkdirp.git"},"scripts":{"test":"tap test/*.js"},"dependencies":{"minimist":"^1.2.6"},"devDependencies":{"tap":"^16.0.1"},"bin":"bin/cmd.js","license":"MIT","files":["bin","index.js"],"_lastModified":"2025-03-
|
|
1
|
+
{"name":"mkdirp","description":"Recursively mkdir, like `mkdir -p`","version":"0.5.6","publishConfig":{"tag":"legacy"},"author":"James Halliday <mail@substack.net> (http://substack.net)","main":"index.js","keywords":["mkdir","directory"],"repository":{"type":"git","url":"https://github.com/substack/node-mkdirp.git"},"scripts":{"test":"tap test/*.js"},"dependencies":{"minimist":"^1.2.6"},"devDependencies":{"tap":"^16.0.1"},"bin":"bin/cmd.js","license":"MIT","files":["bin","index.js"],"_lastModified":"2025-03-05T15:43:13.930Z"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"name":"multer-aliyun-oss","version":"2.1.3","description":"Multer Storage for AliYun OSS","main":"index.js","scripts":{},"author":"AngusYoung","license":"ISC","repository":{"type":"git","url":"git+https://github.com/ay86/multer-aliyun-oss.git"},"keywords":["multer","storage","aliyun","oss"],"dependencies":{"ali-oss":"^6.1.0"},"_lastModified":"2025-03-
|
|
1
|
+
{"name":"multer-aliyun-oss","version":"2.1.3","description":"Multer Storage for AliYun OSS","main":"index.js","scripts":{},"author":"AngusYoung","license":"ISC","repository":{"type":"git","url":"git+https://github.com/ay86/multer-aliyun-oss.git"},"keywords":["multer","storage","aliyun","oss"],"dependencies":{"ali-oss":"^6.1.0"},"_lastModified":"2025-03-05T15:43:13.833Z"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"_from":"multer-cos","_id":"multer-cos@1.0.2","_inBundle":false,"_integrity":"sha512-4F8P1VTCSNhiem+BFJFLe3Ixco6cIuAQ6j7U+PBRvdbBJRZgq5Q+vaDMMBWJ1HmPGOOP3AyKS5yk2f0nbFoqqA==","_location":"/multer-cos","_phantomChildren":{},"_requested":{"type":"tag","registry":true,"raw":"multer-cos","name":"multer-cos","escapedName":"multer-cos","rawSpec":"","saveSpec":null,"fetchSpec":"latest"},"_requiredBy":["#USER","/"],"_resolved":"https://registry.npmjs.org/multer-cos/-/multer-cos-1.0.2.tgz","_shasum":"95c7c06cdee1b9311675a895481f9d946de6dcf3","_spec":"multer-cos","_where":"/Users/lanbo/workplace/websocket","author":{"name":"lanbosm"},"bugs":{"url":"https://github.com/lanbosm/multer-COS/issues"},"bundleDependencies":false,"deprecated":false,"description":"Streaming multer storage engine for QCloud COS","devDependencies":{"cos-nodejs-sdk-v5":"^2.2.6","dotenv":"^5.0.1","multer":"^1.3.0"},"engines":{"node":">= 6.10.0"},"homepage":"https://github.com/lanbosm/multer-COS#readme","keywords":["express","multer","COS"],"license":"MIT","main":"index.js","name":"multer-cos","repository":{"type":"git","url":"git+ssh://git@github.com/lanbosm/multer-COS.git"},"scripts":{"test":"echo \"Error: no test specified\" && exit 1"},"version":"1.0.3","_lastModified":"2025-03-
|
|
1
|
+
{"_from":"multer-cos","_id":"multer-cos@1.0.2","_inBundle":false,"_integrity":"sha512-4F8P1VTCSNhiem+BFJFLe3Ixco6cIuAQ6j7U+PBRvdbBJRZgq5Q+vaDMMBWJ1HmPGOOP3AyKS5yk2f0nbFoqqA==","_location":"/multer-cos","_phantomChildren":{},"_requested":{"type":"tag","registry":true,"raw":"multer-cos","name":"multer-cos","escapedName":"multer-cos","rawSpec":"","saveSpec":null,"fetchSpec":"latest"},"_requiredBy":["#USER","/"],"_resolved":"https://registry.npmjs.org/multer-cos/-/multer-cos-1.0.2.tgz","_shasum":"95c7c06cdee1b9311675a895481f9d946de6dcf3","_spec":"multer-cos","_where":"/Users/lanbo/workplace/websocket","author":{"name":"lanbosm"},"bugs":{"url":"https://github.com/lanbosm/multer-COS/issues"},"bundleDependencies":false,"deprecated":false,"description":"Streaming multer storage engine for QCloud COS","devDependencies":{"cos-nodejs-sdk-v5":"^2.2.6","dotenv":"^5.0.1","multer":"^1.3.0"},"engines":{"node":">= 6.10.0"},"homepage":"https://github.com/lanbosm/multer-COS#readme","keywords":["express","multer","COS"],"license":"MIT","main":"index.js","name":"multer-cos","repository":{"type":"git","url":"git+ssh://git@github.com/lanbosm/multer-COS.git"},"scripts":{"test":"echo \"Error: no test specified\" && exit 1"},"version":"1.0.3","_lastModified":"2025-03-05T15:43:21.305Z"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"name":"multer-s3","version":"3.0.1","description":"Streaming multer storage engine for AWS S3","main":"index.js","scripts":{"test":"standard && mocha test/basic.js"},"engines":{"node":">= 12.0.0"},"repository":{"type":"git","url":"git+https://github.com/badunk/multer-s3.git"},"keywords":["multer","s3","amazon","aws"],"author":"badunk","license":"MIT","bugs":{"url":"https://github.com/badunk/multer-s3/issues"},"homepage":"https://github.com/badunk/multer-s3#readme","dependencies":{"@aws-sdk/lib-storage":"^3.46.0","file-type":"^3.3.0","html-comment-regex":"^1.1.2","run-parallel":"^1.1.6"},"peerDependencies":{"@aws-sdk/client-s3":"^3.0.0"},"devDependencies":{"express":"^4.13.1","form-data":"^1.0.0-rc3","mocha":"^2.2.5","multer":"^1.1.0","on-finished":"^2.3.0","standard":"^5.4.1","xtend":"^4.0.1"},"_lastModified":"2025-03-
|
|
1
|
+
{"name":"multer-s3","version":"3.0.1","description":"Streaming multer storage engine for AWS S3","main":"index.js","scripts":{"test":"standard && mocha test/basic.js"},"engines":{"node":">= 12.0.0"},"repository":{"type":"git","url":"git+https://github.com/badunk/multer-s3.git"},"keywords":["multer","s3","amazon","aws"],"author":"badunk","license":"MIT","bugs":{"url":"https://github.com/badunk/multer-s3/issues"},"homepage":"https://github.com/badunk/multer-s3#readme","dependencies":{"@aws-sdk/lib-storage":"^3.46.0","file-type":"^3.3.0","html-comment-regex":"^1.1.2","run-parallel":"^1.1.6"},"peerDependencies":{"@aws-sdk/client-s3":"^3.0.0"},"devDependencies":{"express":"^4.13.1","form-data":"^1.0.0-rc3","mocha":"^2.2.5","multer":"^1.1.0","on-finished":"^2.3.0","standard":"^5.4.1","xtend":"^4.0.1"},"_lastModified":"2025-03-05T15:43:17.237Z"}
|
package/dist/server/utils.js
CHANGED
|
@@ -42,10 +42,12 @@ __export(utils_exports, {
|
|
|
42
42
|
});
|
|
43
43
|
module.exports = __toCommonJS(utils_exports);
|
|
44
44
|
var import_utils = require("@nocobase/utils");
|
|
45
|
+
var import_iconv_lite = __toESM(require("iconv-lite"));
|
|
45
46
|
var import_path = __toESM(require("path"));
|
|
46
47
|
function getFilename(req, file, cb) {
|
|
47
|
-
const
|
|
48
|
-
|
|
48
|
+
const originalname = import_iconv_lite.default.decode(Buffer.from(file.originalname, "binary"), "utf8");
|
|
49
|
+
const baseName = import_path.default.basename(originalname, import_path.default.extname(originalname));
|
|
50
|
+
cb(null, `${baseName}-${(0, import_utils.uid)(6)}${import_path.default.extname(originalname)}`);
|
|
49
51
|
}
|
|
50
52
|
const cloudFilenameGetter = (storage) => (req, file, cb) => {
|
|
51
53
|
getFilename(req, file, (err, filename) => {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@nocobase/plugin-file-manager",
|
|
3
|
-
"version": "1.5.
|
|
3
|
+
"version": "1.5.21",
|
|
4
4
|
"displayName": "File manager",
|
|
5
5
|
"displayName.zh-CN": "文件管理器",
|
|
6
6
|
"description": "Provides files storage services with files collection template and attachment field.",
|
|
@@ -20,6 +20,7 @@
|
|
|
20
20
|
"@types/multer": "^1.4.5",
|
|
21
21
|
"antd": "5.x",
|
|
22
22
|
"cos-nodejs-sdk-v5": "^2.11.14",
|
|
23
|
+
"iconv-lite": "^0.6.3",
|
|
23
24
|
"koa-static": "^5.0.0",
|
|
24
25
|
"mime-match": "^1.0.2",
|
|
25
26
|
"mkdirp": "~0.5.4",
|
|
@@ -43,5 +44,5 @@
|
|
|
43
44
|
"Collections",
|
|
44
45
|
"Collection fields"
|
|
45
46
|
],
|
|
46
|
-
"gitHead": "
|
|
47
|
+
"gitHead": "5464963b6d2af7667b96efec60af2aaf5360ecd2"
|
|
47
48
|
}
|