@nocobase/plugin-file-manager 2.1.0-beta.2 → 2.1.0-beta.20
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/LICENSE +201 -661
- package/README.md +79 -10
- package/dist/client/index.js +1 -1
- package/dist/client/models/uploadFieldUtils.d.ts +56 -0
- package/dist/externalVersion.js +9 -9
- package/dist/node_modules/@aws-sdk/client-s3/dist-cjs/index.js +190 -190
- package/dist/node_modules/@aws-sdk/client-s3/package.json +1 -1
- package/dist/node_modules/@aws-sdk/lib-storage/dist-cjs/index.js +195 -195
- package/dist/node_modules/@aws-sdk/lib-storage/node_modules/buffer/index.d.ts +186 -0
- package/dist/node_modules/@aws-sdk/lib-storage/node_modules/buffer/index.js +1794 -0
- package/dist/node_modules/@aws-sdk/lib-storage/node_modules/buffer/package.json +82 -0
- package/dist/node_modules/@aws-sdk/lib-storage/package.json +1 -1
- package/dist/node_modules/ali-oss/lib/client.js +14 -14
- package/dist/node_modules/ali-oss/package.json +1 -1
- package/dist/node_modules/mime-match/index.js +1 -1
- package/dist/node_modules/mime-match/package.json +1 -1
- package/dist/node_modules/mime-types/index.js +3 -3
- package/dist/node_modules/mime-types/package.json +1 -1
- package/dist/node_modules/mkdirp/index.js +1 -1
- package/dist/node_modules/mkdirp/package.json +1 -1
- package/dist/node_modules/multer-cos/index.js +14 -14
- package/dist/node_modules/multer-cos/package.json +1 -1
- package/dist/node_modules/url-join/lib/url-join.js +1 -1
- package/dist/node_modules/url-join/package.json +1 -1
- package/dist/server/storages/local.js +7 -3
- package/dist/server/utils.d.ts +1 -0
- package/dist/server/utils.js +21 -2
- package/package.json +4 -3
|
@@ -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":"2026-
|
|
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":"2026-04-27T01:21:07.378Z"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
(
|
|
1
|
+
(()=>{var e={821:function(e){(function(r,i,t){if(true&&e.exports)e.exports=t();else if(typeof define==="function"&&define.amd)define(t);else i[r]=t()})("urljoin",this,(function(){function normalize(e){var r=[];if(e.length===0){return""}if(typeof e[0]!=="string"){throw new TypeError("Url must be a string. Received "+e[0])}if(e[0].match(/^[^/:]+:\/*$/)&&e.length>1){var i=e.shift();e[0]=i+e[0]}if(e[0].match(/^file:\/\/\//)){e[0]=e[0].replace(/^([^/:]+):\/*/,"$1:///")}else{e[0]=e[0].replace(/^([^/:]+):\/*/,"$1://")}for(var t=0;t<e.length;t++){var n=e[t];if(typeof n!=="string"){throw new TypeError("Url must be a string. Received "+n)}if(n===""){continue}if(t>0){n=n.replace(/^[\/]+/,"")}if(t<e.length-1){n=n.replace(/[\/]+$/,"")}else{n=n.replace(/[\/]+$/,"/")}r.push(n)}var a=r.join("/");a=a.replace(/\/(\?|&|#[^!])/g,"$1");var f=a.split("?");a=f.shift()+(f.length>0?"?":"")+f.join("&");return a}return function(){var e;if(typeof arguments[0]==="object"){e=arguments[0]}else{e=[].slice.call(arguments)}return normalize(e)}}))}};var r={};function __nccwpck_require__(i){var t=r[i];if(t!==undefined){return t.exports}var n=r[i]={exports:{}};var a=true;try{e[i].call(n.exports,n,n.exports,__nccwpck_require__);a=false}finally{if(a)delete r[i]}return n.exports}if(typeof __nccwpck_require__!=="undefined")__nccwpck_require__.ab=__dirname+"/";var i=__nccwpck_require__(821);module.exports=i})();
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"name":"url-join","version":"4.0.1","description":"Join urls and normalize as in path.join.","main":"lib/url-join.js","scripts":{"test":"mocha --require should"},"repository":{"type":"git","url":"git://github.com/jfromaniello/url-join.git"},"keywords":["url","join"],"author":"José F. Romaniello <jfromaniello@gmail.com> (http://joseoncode.com)","license":"MIT","devDependencies":{"conventional-changelog":"^1.1.10","mocha":"^3.2.0","should":"~1.2.1"},"_lastModified":"2026-
|
|
1
|
+
{"name":"url-join","version":"4.0.1","description":"Join urls and normalize as in path.join.","main":"lib/url-join.js","scripts":{"test":"mocha --require should"},"repository":{"type":"git","url":"git://github.com/jfromaniello/url-join.git"},"keywords":["url","join"],"author":"José F. Romaniello <jfromaniello@gmail.com> (http://joseoncode.com)","license":"MIT","devDependencies":{"conventional-changelog":"^1.1.10","mocha":"^3.2.0","should":"~1.2.1"},"_lastModified":"2026-04-27T01:20:56.897Z"}
|
|
@@ -52,11 +52,15 @@ var import_constants = require("../../constants");
|
|
|
52
52
|
var import_utils2 = require("../utils");
|
|
53
53
|
const DEFAULT_BASE_URL = "/storage/uploads";
|
|
54
54
|
function getDocumentRoot(storage) {
|
|
55
|
-
|
|
56
|
-
|
|
55
|
+
var _a;
|
|
56
|
+
const raw = ((_a = storage == null ? void 0 : storage.options) == null ? void 0 : _a.documentRoot) ?? process.env.LOCAL_STORAGE_DEST ?? (0, import_utils.storagePathJoin)("uploads");
|
|
57
|
+
if (import_path.default.isAbsolute(raw)) {
|
|
58
|
+
return raw;
|
|
59
|
+
}
|
|
60
|
+
return (0, import_utils2.normalizeDocumentRoot)(raw);
|
|
57
61
|
}
|
|
58
62
|
function resolveSafePath(documentRoot, filePath, filename) {
|
|
59
|
-
const root =
|
|
63
|
+
const root = (0, import_utils2.normalizeDocumentRoot)(documentRoot);
|
|
60
64
|
const target = import_path.default.resolve(root, filePath || "", filename || "");
|
|
61
65
|
const relative = import_path.default.relative(root, target);
|
|
62
66
|
if (relative.startsWith("..") || import_path.default.isAbsolute(relative)) {
|
package/dist/server/utils.d.ts
CHANGED
|
@@ -12,3 +12,4 @@ export declare const diskFilenameGetter: (storage: any) => (req: any, file: any,
|
|
|
12
12
|
export declare function getFileKey(record: any): any;
|
|
13
13
|
export declare function ensureUrlEncoded(value: any): any;
|
|
14
14
|
export declare function encodeURL(url: any): any;
|
|
15
|
+
export declare function normalizeDocumentRoot(documentRoot?: string): string;
|
package/dist/server/utils.js
CHANGED
|
@@ -41,7 +41,8 @@ __export(utils_exports, {
|
|
|
41
41
|
encodeURL: () => encodeURL,
|
|
42
42
|
ensureUrlEncoded: () => ensureUrlEncoded,
|
|
43
43
|
getFileKey: () => getFileKey,
|
|
44
|
-
getFilename: () => getFilename
|
|
44
|
+
getFilename: () => getFilename,
|
|
45
|
+
normalizeDocumentRoot: () => normalizeDocumentRoot
|
|
45
46
|
});
|
|
46
47
|
module.exports = __toCommonJS(utils_exports);
|
|
47
48
|
var import_utils = require("@nocobase/utils");
|
|
@@ -140,6 +141,23 @@ function encodeURL(url) {
|
|
|
140
141
|
return url;
|
|
141
142
|
}
|
|
142
143
|
}
|
|
144
|
+
function isStorageRelativeDocumentRoot(documentRoot) {
|
|
145
|
+
return documentRoot === "storage" || documentRoot.startsWith("storage/") || documentRoot === "./storage" || documentRoot.startsWith("./storage/");
|
|
146
|
+
}
|
|
147
|
+
function normalizeDocumentRoot(documentRoot) {
|
|
148
|
+
if (!documentRoot) {
|
|
149
|
+
return (0, import_utils.storagePathJoin)("uploads");
|
|
150
|
+
}
|
|
151
|
+
if (import_path.default.isAbsolute(documentRoot)) {
|
|
152
|
+
return documentRoot;
|
|
153
|
+
}
|
|
154
|
+
const normalizedDocumentRoot = documentRoot.replace(/\\/g, "/");
|
|
155
|
+
if (isStorageRelativeDocumentRoot(normalizedDocumentRoot)) {
|
|
156
|
+
const relativePath = normalizedDocumentRoot.replace(/^\.?\/?storage(?:\/|$)/, "").replace(/^[/\\]+/, "");
|
|
157
|
+
return relativePath ? (0, import_utils.storagePathJoin)(relativePath) : (0, import_utils.storagePathJoin)();
|
|
158
|
+
}
|
|
159
|
+
return import_path.default.resolve(process.cwd(), documentRoot);
|
|
160
|
+
}
|
|
143
161
|
// Annotate the CommonJS export names for ESM import in node:
|
|
144
162
|
0 && (module.exports = {
|
|
145
163
|
cloudFilenameGetter,
|
|
@@ -147,5 +165,6 @@ function encodeURL(url) {
|
|
|
147
165
|
encodeURL,
|
|
148
166
|
ensureUrlEncoded,
|
|
149
167
|
getFileKey,
|
|
150
|
-
getFilename
|
|
168
|
+
getFilename,
|
|
169
|
+
normalizeDocumentRoot
|
|
151
170
|
});
|
package/package.json
CHANGED
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@nocobase/plugin-file-manager",
|
|
3
|
-
"version": "2.1.0-beta.
|
|
3
|
+
"version": "2.1.0-beta.20",
|
|
4
4
|
"displayName": "File manager",
|
|
5
5
|
"displayName.ru-RU": "Менеджер файлов",
|
|
6
6
|
"displayName.zh-CN": "文件管理器",
|
|
7
7
|
"description": "Provides files storage services with files collection template and attachment field.",
|
|
8
8
|
"description.ru-RU": "Предоставляет сервисы хранения файлов, шаблон коллекции файлов и поле вложений.",
|
|
9
9
|
"description.zh-CN": "提供文件存储服务,并提供了文件表模板和附件字段。",
|
|
10
|
-
"license": "
|
|
10
|
+
"license": "Apache-2.0",
|
|
11
11
|
"main": "./dist/server/index.js",
|
|
12
12
|
"homepage": "https://docs.nocobase.com/handbook/file-manager",
|
|
13
13
|
"homepage.ru-RU": "https://docs-ru.nocobase.com/handbook/file-manager",
|
|
@@ -47,6 +47,7 @@
|
|
|
47
47
|
"@nocobase/actions": "2.x",
|
|
48
48
|
"@nocobase/client": "2.x",
|
|
49
49
|
"@nocobase/database": "2.x",
|
|
50
|
+
"@nocobase/plugin-data-source-main": "2.x",
|
|
50
51
|
"@nocobase/server": "2.x",
|
|
51
52
|
"@nocobase/test": "2.x",
|
|
52
53
|
"@nocobase/utils": "2.x"
|
|
@@ -55,5 +56,5 @@
|
|
|
55
56
|
"Collections",
|
|
56
57
|
"Collection fields"
|
|
57
58
|
],
|
|
58
|
-
"gitHead": "
|
|
59
|
+
"gitHead": "5515f27380c0c5410f7d1e5e5858364fcd838e5e"
|
|
59
60
|
}
|