@nocobase/plugin-file-manager
Version:
Provides files storage services with files collection template and attachment field.
117 lines (115 loc) • 3.1 kB
JavaScript
/**
* This file is part of the NocoBase (R) project.
* Copyright (c) 2020-2024 NocoBase Co., Ltd.
* Authors: NocoBase Team.
*
* This project is dual-licensed under AGPL-3.0 and NocoBase Commercial License.
* For more information, please refer to: https://www.nocobase.com/agreement.
*/
var __defProp = Object.defineProperty;
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
var __getOwnPropNames = Object.getOwnPropertyNames;
var __hasOwnProp = Object.prototype.hasOwnProperty;
var __export = (target, all) => {
for (var name in all)
__defProp(target, name, { get: all[name], enumerable: true });
};
var __copyProps = (to, from, except, desc) => {
if (from && typeof from === "object" || typeof from === "function") {
for (let key of __getOwnPropNames(from))
if (!__hasOwnProp.call(to, key) && key !== except)
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
}
return to;
};
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
var storages_exports = {};
__export(storages_exports, {
default: () => storages_default
});
module.exports = __toCommonJS(storages_exports);
var storages_default = {
dumpRules: "required",
migrationRules: ["overwrite", "schema-only"],
name: "storages",
dataCategory: "system",
shared: true,
fields: [
{
name: "id",
type: "snowflakeId",
primaryKey: true,
allowNull: false
},
{
title: "\u5B58\u50A8\u5F15\u64CE\u540D\u79F0",
comment: "\u5B58\u50A8\u5F15\u64CE\u540D\u79F0",
type: "string",
name: "title",
translation: true,
trim: true
},
{
title: "\u82F1\u6587\u6807\u8BC6",
// comment: '英文标识,用于代码层面配置',
type: "uid",
name: "name",
unique: true,
trim: true
},
{
comment: "\u7C7B\u578B\u6807\u8BC6\uFF0C\u5982 local/ali-oss \u7B49",
type: "string",
name: "type"
},
{
comment: "\u914D\u7F6E\u9879",
type: "jsonb",
name: "options",
defaultValue: {}
},
{
comment: "\u6587\u4EF6\u89C4\u5219",
type: "jsonb",
name: "rules",
defaultValue: {}
},
{
comment: "\u5B58\u50A8\u76F8\u5BF9\u8DEF\u5F84\u6A21\u677F",
type: "text",
name: "path",
defaultValue: "",
trim: true
},
{
comment: "\u8BBF\u95EE\u5730\u5740\u524D\u7F00",
type: "string",
name: "baseUrl",
defaultValue: "",
trim: true
},
{
comment: "\u91CD\u547D\u540D\u6A21\u5F0F",
type: "string",
name: "renameMode",
defaultValue: "appendRandomID"
},
// TODO(feature): 需要使用一个实现了可设置默认值的字段
{
comment: "\u9ED8\u8BA4\u5F15\u64CE",
type: "radio",
name: "default",
defaultValue: false
},
{
type: "boolean",
name: "paranoid",
defaultValue: false
},
{
type: "json",
name: "settings",
defaultValue: {}
}
]
};