@nocobase/plugin-file-manager 1.4.24 → 1.4.25

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.
@@ -8,7 +8,7 @@
8
8
  */
9
9
 
10
10
  module.exports = {
11
- "@nocobase/client": "1.4.24",
11
+ "@nocobase/client": "1.4.25",
12
12
  "react": "18.2.0",
13
13
  "antd": "5.12.8",
14
14
  "@ant-design/icons": "5.2.6",
@@ -18,10 +18,10 @@ module.exports = {
18
18
  "@formily/antd-v5": "1.1.9",
19
19
  "@formily/core": "2.3.0",
20
20
  "@formily/react": "2.3.0",
21
- "@nocobase/database": "1.4.24",
22
- "@nocobase/server": "1.4.24",
23
- "@nocobase/utils": "1.4.24",
24
- "@nocobase/test": "1.4.24",
25
- "@nocobase/actions": "1.4.24",
26
- "multer": "1.4.4"
21
+ "@nocobase/database": "1.4.25",
22
+ "multer": "1.4.4",
23
+ "@nocobase/server": "1.4.25",
24
+ "@nocobase/utils": "1.4.25",
25
+ "@nocobase/test": "1.4.25",
26
+ "@nocobase/actions": "1.4.25"
27
27
  };
@@ -1 +1 @@
1
- {"name":"@aws-sdk/client-s3","description":"AWS SDK for JavaScript S3 Client for Node.js, Browser and React Native","version":"3.474.0","scripts":{"build":"concurrently 'yarn:build:cjs' 'yarn:build:es' 'yarn:build:types'","build:cjs":"tsc -p tsconfig.cjs.json","build:es":"tsc -p tsconfig.es.json","build:include:deps":"lerna run --scope $npm_package_name --include-dependencies build","build:types":"tsc -p tsconfig.types.json","build:types:downlevel":"downlevel-dts dist-types dist-types/ts3.4","clean":"rimraf ./dist-* && rimraf *.tsbuildinfo","extract:docs":"api-extractor run --local","generate:client":"node ../../scripts/generate-clients/single-service --solo s3","test":"yarn test:unit","test:e2e":"yarn test:e2e:node && yarn test:e2e:browser","test:e2e:browser":"ts-mocha test/**/*.browser.ispec.ts && karma start karma.conf.js","test:e2e:node":"jest --c jest.config.e2e.js","test:unit":"ts-mocha test/unit/**/*.spec.ts"},"main":"./dist-cjs/index.js","types":"./dist-types/index.d.ts","module":"./dist-es/index.js","sideEffects":false,"dependencies":{"@aws-crypto/sha1-browser":"3.0.0","@aws-crypto/sha256-browser":"3.0.0","@aws-crypto/sha256-js":"3.0.0","@aws-sdk/client-sts":"3.474.0","@aws-sdk/core":"3.474.0","@aws-sdk/credential-provider-node":"3.474.0","@aws-sdk/middleware-bucket-endpoint":"3.470.0","@aws-sdk/middleware-expect-continue":"3.468.0","@aws-sdk/middleware-flexible-checksums":"3.468.0","@aws-sdk/middleware-host-header":"3.468.0","@aws-sdk/middleware-location-constraint":"3.468.0","@aws-sdk/middleware-logger":"3.468.0","@aws-sdk/middleware-recursion-detection":"3.468.0","@aws-sdk/middleware-sdk-s3":"3.474.0","@aws-sdk/middleware-signing":"3.468.0","@aws-sdk/middleware-ssec":"3.468.0","@aws-sdk/middleware-user-agent":"3.470.0","@aws-sdk/region-config-resolver":"3.470.0","@aws-sdk/signature-v4-multi-region":"3.474.0","@aws-sdk/types":"3.468.0","@aws-sdk/util-endpoints":"3.470.0","@aws-sdk/util-user-agent-browser":"3.468.0","@aws-sdk/util-user-agent-node":"3.470.0","@aws-sdk/xml-builder":"3.472.0","@smithy/config-resolver":"^2.0.21","@smithy/eventstream-serde-browser":"^2.0.15","@smithy/eventstream-serde-config-resolver":"^2.0.15","@smithy/eventstream-serde-node":"^2.0.15","@smithy/fetch-http-handler":"^2.3.1","@smithy/hash-blob-browser":"^2.0.16","@smithy/hash-node":"^2.0.17","@smithy/hash-stream-node":"^2.0.17","@smithy/invalid-dependency":"^2.0.15","@smithy/md5-js":"^2.0.17","@smithy/middleware-content-length":"^2.0.17","@smithy/middleware-endpoint":"^2.2.3","@smithy/middleware-retry":"^2.0.24","@smithy/middleware-serde":"^2.0.15","@smithy/middleware-stack":"^2.0.9","@smithy/node-config-provider":"^2.1.8","@smithy/node-http-handler":"^2.2.1","@smithy/protocol-http":"^3.0.11","@smithy/smithy-client":"^2.1.18","@smithy/types":"^2.7.0","@smithy/url-parser":"^2.0.15","@smithy/util-base64":"^2.0.1","@smithy/util-body-length-browser":"^2.0.1","@smithy/util-body-length-node":"^2.1.0","@smithy/util-defaults-mode-browser":"^2.0.22","@smithy/util-defaults-mode-node":"^2.0.29","@smithy/util-endpoints":"^1.0.7","@smithy/util-retry":"^2.0.8","@smithy/util-stream":"^2.0.23","@smithy/util-utf8":"^2.0.2","@smithy/util-waiter":"^2.0.15","fast-xml-parser":"4.2.5","tslib":"^2.5.0"},"devDependencies":{"@smithy/service-client-documentation-generator":"^2.0.0","@tsconfig/node14":"1.0.3","@types/chai":"^4.2.11","@types/mocha":"^8.0.4","@types/node":"^14.14.31","concurrently":"7.0.0","downlevel-dts":"0.10.1","rimraf":"3.0.2","typescript":"~4.9.5"},"engines":{"node":">=14.0.0"},"typesVersions":{"<4.0":{"dist-types/*":["dist-types/ts3.4/*"]}},"files":["dist-*/**"],"author":{"name":"AWS SDK for JavaScript Team","url":"https://aws.amazon.com/javascript/"},"license":"Apache-2.0","browser":{"./dist-es/runtimeConfig":"./dist-es/runtimeConfig.browser"},"react-native":{"./dist-es/runtimeConfig":"./dist-es/runtimeConfig.native"},"homepage":"https://github.com/aws/aws-sdk-js-v3/tree/main/clients/client-s3","repository":{"type":"git","url":"https://github.com/aws/aws-sdk-js-v3.git","directory":"clients/client-s3"},"_lastModified":"2025-01-14T12:50:43.889Z"}
1
+ {"name":"@aws-sdk/client-s3","description":"AWS SDK for JavaScript S3 Client for Node.js, Browser and React Native","version":"3.474.0","scripts":{"build":"concurrently 'yarn:build:cjs' 'yarn:build:es' 'yarn:build:types'","build:cjs":"tsc -p tsconfig.cjs.json","build:es":"tsc -p tsconfig.es.json","build:include:deps":"lerna run --scope $npm_package_name --include-dependencies build","build:types":"tsc -p tsconfig.types.json","build:types:downlevel":"downlevel-dts dist-types dist-types/ts3.4","clean":"rimraf ./dist-* && rimraf *.tsbuildinfo","extract:docs":"api-extractor run --local","generate:client":"node ../../scripts/generate-clients/single-service --solo s3","test":"yarn test:unit","test:e2e":"yarn test:e2e:node && yarn test:e2e:browser","test:e2e:browser":"ts-mocha test/**/*.browser.ispec.ts && karma start karma.conf.js","test:e2e:node":"jest --c jest.config.e2e.js","test:unit":"ts-mocha test/unit/**/*.spec.ts"},"main":"./dist-cjs/index.js","types":"./dist-types/index.d.ts","module":"./dist-es/index.js","sideEffects":false,"dependencies":{"@aws-crypto/sha1-browser":"3.0.0","@aws-crypto/sha256-browser":"3.0.0","@aws-crypto/sha256-js":"3.0.0","@aws-sdk/client-sts":"3.474.0","@aws-sdk/core":"3.474.0","@aws-sdk/credential-provider-node":"3.474.0","@aws-sdk/middleware-bucket-endpoint":"3.470.0","@aws-sdk/middleware-expect-continue":"3.468.0","@aws-sdk/middleware-flexible-checksums":"3.468.0","@aws-sdk/middleware-host-header":"3.468.0","@aws-sdk/middleware-location-constraint":"3.468.0","@aws-sdk/middleware-logger":"3.468.0","@aws-sdk/middleware-recursion-detection":"3.468.0","@aws-sdk/middleware-sdk-s3":"3.474.0","@aws-sdk/middleware-signing":"3.468.0","@aws-sdk/middleware-ssec":"3.468.0","@aws-sdk/middleware-user-agent":"3.470.0","@aws-sdk/region-config-resolver":"3.470.0","@aws-sdk/signature-v4-multi-region":"3.474.0","@aws-sdk/types":"3.468.0","@aws-sdk/util-endpoints":"3.470.0","@aws-sdk/util-user-agent-browser":"3.468.0","@aws-sdk/util-user-agent-node":"3.470.0","@aws-sdk/xml-builder":"3.472.0","@smithy/config-resolver":"^2.0.21","@smithy/eventstream-serde-browser":"^2.0.15","@smithy/eventstream-serde-config-resolver":"^2.0.15","@smithy/eventstream-serde-node":"^2.0.15","@smithy/fetch-http-handler":"^2.3.1","@smithy/hash-blob-browser":"^2.0.16","@smithy/hash-node":"^2.0.17","@smithy/hash-stream-node":"^2.0.17","@smithy/invalid-dependency":"^2.0.15","@smithy/md5-js":"^2.0.17","@smithy/middleware-content-length":"^2.0.17","@smithy/middleware-endpoint":"^2.2.3","@smithy/middleware-retry":"^2.0.24","@smithy/middleware-serde":"^2.0.15","@smithy/middleware-stack":"^2.0.9","@smithy/node-config-provider":"^2.1.8","@smithy/node-http-handler":"^2.2.1","@smithy/protocol-http":"^3.0.11","@smithy/smithy-client":"^2.1.18","@smithy/types":"^2.7.0","@smithy/url-parser":"^2.0.15","@smithy/util-base64":"^2.0.1","@smithy/util-body-length-browser":"^2.0.1","@smithy/util-body-length-node":"^2.1.0","@smithy/util-defaults-mode-browser":"^2.0.22","@smithy/util-defaults-mode-node":"^2.0.29","@smithy/util-endpoints":"^1.0.7","@smithy/util-retry":"^2.0.8","@smithy/util-stream":"^2.0.23","@smithy/util-utf8":"^2.0.2","@smithy/util-waiter":"^2.0.15","fast-xml-parser":"4.2.5","tslib":"^2.5.0"},"devDependencies":{"@smithy/service-client-documentation-generator":"^2.0.0","@tsconfig/node14":"1.0.3","@types/chai":"^4.2.11","@types/mocha":"^8.0.4","@types/node":"^14.14.31","concurrently":"7.0.0","downlevel-dts":"0.10.1","rimraf":"3.0.2","typescript":"~4.9.5"},"engines":{"node":">=14.0.0"},"typesVersions":{"<4.0":{"dist-types/*":["dist-types/ts3.4/*"]}},"files":["dist-*/**"],"author":{"name":"AWS SDK for JavaScript Team","url":"https://aws.amazon.com/javascript/"},"license":"Apache-2.0","browser":{"./dist-es/runtimeConfig":"./dist-es/runtimeConfig.browser"},"react-native":{"./dist-es/runtimeConfig":"./dist-es/runtimeConfig.native"},"homepage":"https://github.com/aws/aws-sdk-js-v3/tree/main/clients/client-s3","repository":{"type":"git","url":"https://github.com/aws/aws-sdk-js-v3.git","directory":"clients/client-s3"},"_lastModified":"2025-01-15T21:53:15.160Z"}
@@ -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-01-14T12:50:34.574Z"}
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-01-15T21:53:05.699Z"}
@@ -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-01-14T12:50:39.583Z"}
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-01-15T21:53:10.752Z"}
@@ -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-01-14T12:50:39.502Z"}
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-01-15T21:53:10.674Z"}
@@ -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-01-14T12:50:51.671Z"}
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-01-15T21:53:23.098Z"}
@@ -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-01-14T12:50:48.081Z"}
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-01-15T21:53:19.438Z"}
@@ -6,5 +6,8 @@
6
6
  * This project is dual-licensed under AGPL-3.0 and NocoBase Commercial License.
7
7
  * For more information, please refer to: https://www.nocobase.com/agreement.
8
8
  */
9
+ import { StorageEngine } from 'multer';
9
10
  export * from '../constants';
10
- export { default } from './server';
11
+ export { AttachmentModel, default, IStorage, PluginFileManagerServer, StorageModel } from './server';
12
+ export { StorageType } from './storages';
13
+ export { StorageEngine };
@@ -37,12 +37,26 @@ var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__ge
37
37
  var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
38
38
  var server_exports = {};
39
39
  __export(server_exports, {
40
+ AttachmentModel: () => import_server.AttachmentModel,
41
+ IStorage: () => import_server.IStorage,
42
+ PluginFileManagerServer: () => import_server.PluginFileManagerServer,
43
+ StorageEngine: () => import_multer.StorageEngine,
44
+ StorageModel: () => import_server.StorageModel,
45
+ StorageType: () => import_storages.StorageType,
40
46
  default: () => import_server.default
41
47
  });
42
48
  module.exports = __toCommonJS(server_exports);
49
+ var import_multer = require("multer");
43
50
  __reExport(server_exports, require("../constants"), module.exports);
44
51
  var import_server = __toESM(require("./server"));
52
+ var import_storages = require("./storages");
45
53
  // Annotate the CommonJS export names for ESM import in node:
46
54
  0 && (module.exports = {
55
+ AttachmentModel,
56
+ IStorage,
57
+ PluginFileManagerServer,
58
+ StorageEngine,
59
+ StorageModel,
60
+ StorageType,
47
61
  ...require("../constants")
48
62
  });
@@ -22,9 +22,10 @@ export type UploadFileOptions = {
22
22
  storageName?: string;
23
23
  documentRoot?: string;
24
24
  };
25
- export default class PluginFileManagerServer extends Plugin {
25
+ export declare class PluginFileManagerServer extends Plugin {
26
26
  storageTypes: Registry<IStorage>;
27
27
  storagesCache: Map<number, StorageModel>;
28
+ registerStorageType(type: string, options: IStorage): void;
28
29
  createFileRecord(options: FileRecordOptions): Promise<any>;
29
30
  uploadFile(options: UploadFileOptions): Promise<any>;
30
31
  loadStorages(options?: {
@@ -35,3 +36,4 @@ export default class PluginFileManagerServer extends Plugin {
35
36
  beforeLoad(): Promise<void>;
36
37
  load(): Promise<void>;
37
38
  }
39
+ export default PluginFileManagerServer;
@@ -36,7 +36,8 @@ var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__ge
36
36
  var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
37
37
  var server_exports = {};
38
38
  __export(server_exports, {
39
- default: () => PluginFileManagerServer
39
+ PluginFileManagerServer: () => PluginFileManagerServer,
40
+ default: () => server_default
40
41
  });
41
42
  module.exports = __toCommonJS(server_exports);
42
43
  var import_server = require("@nocobase/server");
@@ -56,6 +57,9 @@ const DEFAULT_STORAGE_TYPE = import_constants.STORAGE_TYPE_LOCAL;
56
57
  class PluginFileManagerServer extends import_server.Plugin {
57
58
  storageTypes = new import_utils.Registry();
58
59
  storagesCache = /* @__PURE__ */ new Map();
60
+ registerStorageType(type, options) {
61
+ this.storageTypes.register(type, options);
62
+ }
59
63
  async createFileRecord(options) {
60
64
  const { values, storageName, collectionName, filePath, transaction } = options;
61
65
  const collection = this.db.getCollection(collectionName);
@@ -226,3 +230,8 @@ class PluginFileManagerServer extends import_server.Plugin {
226
230
  this.app.db.interfaceManager.registerInterfaceType("attachment", import_attachment_interface.AttachmentInterface);
227
231
  }
228
232
  }
233
+ var server_default = PluginFileManagerServer;
234
+ // Annotate the CommonJS export names for ESM import in node:
235
+ 0 && (module.exports = {
236
+ PluginFileManagerServer
237
+ });
@@ -6,8 +6,8 @@
6
6
  * This project is dual-licensed under AGPL-3.0 and NocoBase Commercial License.
7
7
  * For more information, please refer to: https://www.nocobase.com/agreement.
8
8
  */
9
- import { StorageEngine } from 'multer';
10
9
  import Application from '@nocobase/server';
10
+ import { StorageEngine } from 'multer';
11
11
  export interface StorageModel {
12
12
  id?: number;
13
13
  title: string;
@@ -39,6 +39,6 @@ export interface IStorage {
39
39
  }
40
40
  export declare abstract class StorageType implements IStorage {
41
41
  abstract make(storage: StorageModel): StorageEngine;
42
- abstract defaults(): StorageModel;
43
42
  abstract delete(storage: StorageModel, records: AttachmentModel[]): Promise<[number, AttachmentModel[]]>;
43
+ defaults(): StorageModel;
44
44
  }
@@ -30,6 +30,9 @@ __export(storages_exports, {
30
30
  });
31
31
  module.exports = __toCommonJS(storages_exports);
32
32
  class StorageType {
33
+ defaults() {
34
+ return {};
35
+ }
33
36
  }
34
37
  // Annotate the CommonJS export names for ESM import in node:
35
38
  0 && (module.exports = {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@nocobase/plugin-file-manager",
3
- "version": "1.4.24",
3
+ "version": "1.4.25",
4
4
  "displayName": "File manager",
5
5
  "displayName.zh-CN": "文件管理器",
6
6
  "description": "Provides files storage services with files collection template and attachment field.",
@@ -43,5 +43,5 @@
43
43
  "Collections",
44
44
  "Collection fields"
45
45
  ],
46
- "gitHead": "dd08bdca511a3b91a77345f90b522509bbb8738c"
46
+ "gitHead": "1a03757687ce47568c604a4b9bd648c151bbd6e2"
47
47
  }