@nocobase/plugin-file-manager 1.7.0-beta.2 → 1.7.0-beta.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.
Files changed (46) hide show
  1. package/dist/client/index.d.ts +13 -0
  2. package/dist/client/index.js +1 -1
  3. package/dist/{server/FileModel.d.ts → common/constants.d.ts} +1 -4
  4. package/dist/common/constants.js +36 -0
  5. package/dist/externalVersion.js +10 -10
  6. package/dist/locale/de-DE.json +1 -1
  7. package/dist/locale/it-IT.json +4 -7
  8. package/dist/locale/ja-JP.json +1 -1
  9. package/dist/locale/nl-NL.json +35 -17
  10. package/dist/locale/zh-CN.json +1 -1
  11. package/dist/node_modules/@aws-sdk/client-s3/dist-cjs/index.js +834 -834
  12. package/dist/node_modules/@aws-sdk/client-s3/package.json +1 -1
  13. package/dist/node_modules/mime-match/package.json +1 -1
  14. package/dist/node_modules/mkdirp/package.json +1 -1
  15. package/dist/node_modules/multer-aliyun-oss/index.js +3 -3
  16. package/dist/node_modules/multer-aliyun-oss/package.json +1 -1
  17. package/dist/node_modules/multer-cos/index.js +5 -5
  18. package/dist/node_modules/multer-cos/package.json +1 -1
  19. package/dist/node_modules/multer-s3/index.js +837 -837
  20. package/dist/node_modules/multer-s3/package.json +1 -1
  21. package/dist/node_modules/url-join/.travis.yml +5 -0
  22. package/dist/node_modules/url-join/LICENSE +21 -0
  23. package/dist/node_modules/url-join/bin/changelog +28 -0
  24. package/dist/node_modules/url-join/lib/url-join.js +1 -0
  25. package/dist/node_modules/url-join/package.json +1 -0
  26. package/dist/node_modules/url-join/test/tests.js +151 -0
  27. package/dist/server/actions/attachments.d.ts +0 -11
  28. package/dist/server/actions/attachments.js +10 -39
  29. package/dist/server/actions/index.js +19 -0
  30. package/dist/server/actions/storages.js +4 -1
  31. package/dist/server/collections/storages.js +8 -4
  32. package/dist/server/index.d.ts +1 -0
  33. package/dist/server/index.js +3 -0
  34. package/dist/server/server.d.ts +6 -6
  35. package/dist/server/server.js +110 -56
  36. package/dist/server/storages/index.d.ts +11 -5
  37. package/dist/server/storages/index.js +49 -2
  38. package/dist/server/storages/local.d.ts +1 -1
  39. package/dist/server/storages/local.js +12 -5
  40. package/dist/server/storages/s3.d.ts +4 -0
  41. package/dist/server/storages/s3.js +36 -12
  42. package/dist/server/storages/tx-cos.js +4 -4
  43. package/dist/server/utils.d.ts +3 -1
  44. package/dist/server/utils.js +25 -2
  45. package/package.json +8 -7
  46. package/dist/server/FileModel.js +0 -58
@@ -1,58 +0,0 @@
1
- /**
2
- * This file is part of the NocoBase (R) project.
3
- * Copyright (c) 2020-2024 NocoBase Co., Ltd.
4
- * Authors: NocoBase Team.
5
- *
6
- * This project is dual-licensed under AGPL-3.0 and NocoBase Commercial License.
7
- * For more information, please refer to: https://www.nocobase.com/agreement.
8
- */
9
-
10
- var __defProp = Object.defineProperty;
11
- var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
12
- var __getOwnPropNames = Object.getOwnPropertyNames;
13
- var __hasOwnProp = Object.prototype.hasOwnProperty;
14
- var __export = (target, all) => {
15
- for (var name in all)
16
- __defProp(target, name, { get: all[name], enumerable: true });
17
- };
18
- var __copyProps = (to, from, except, desc) => {
19
- if (from && typeof from === "object" || typeof from === "function") {
20
- for (let key of __getOwnPropNames(from))
21
- if (!__hasOwnProp.call(to, key) && key !== except)
22
- __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
23
- }
24
- return to;
25
- };
26
- var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
27
- var FileModel_exports = {};
28
- __export(FileModel_exports, {
29
- FileModel: () => FileModel
30
- });
31
- module.exports = __toCommonJS(FileModel_exports);
32
- var import_database = require("@nocobase/database");
33
- var import_constants = require("../constants");
34
- const currentStorage = [import_constants.STORAGE_TYPE_LOCAL, import_constants.STORAGE_TYPE_ALI_OSS, import_constants.STORAGE_TYPE_S3, import_constants.STORAGE_TYPE_TX_COS];
35
- class FileModel extends import_database.Model {
36
- toJSON() {
37
- var _a, _b, _c, _d, _e;
38
- const json = super.toJSON();
39
- const fileStorages = (_a = this.constructor["database"]) == null ? void 0 : _a["_fileStorages"];
40
- if (json.storageId && fileStorages && fileStorages.has(json.storageId)) {
41
- const storage = fileStorages.get(json.storageId);
42
- if (currentStorage.includes(storage == null ? void 0 : storage.type) && ((_b = storage == null ? void 0 : storage.options) == null ? void 0 : _b.thumbnailRule)) {
43
- json["preview"] = `${json["url"]}${((_c = storage == null ? void 0 : storage.options) == null ? void 0 : _c.thumbnailRule) || ""}`;
44
- }
45
- if ((_d = storage == null ? void 0 : storage.options) == null ? void 0 : _d.thumbnailRule) {
46
- json["thumbnailRule"] = (_e = storage == null ? void 0 : storage.options) == null ? void 0 : _e.thumbnailRule;
47
- }
48
- if ((storage == null ? void 0 : storage.type) === "local" && process.env.APP_PUBLIC_PATH) {
49
- json["url"] = process.env.APP_PUBLIC_PATH.replace(/\/$/g, "") + json.url;
50
- }
51
- }
52
- return json;
53
- }
54
- }
55
- // Annotate the CommonJS export names for ESM import in node:
56
- 0 && (module.exports = {
57
- FileModel
58
- });