plugin-file-preview-auth 1.2.0 → 1.2.1
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/externalVersion.js
CHANGED
|
@@ -11,9 +11,9 @@ module.exports = {
|
|
|
11
11
|
"react": "18.2.0",
|
|
12
12
|
"@ant-design/icons": "5.6.1",
|
|
13
13
|
"antd": "5.24.2",
|
|
14
|
-
"@nocobase/client": "2.0.
|
|
15
|
-
"@nocobase/plugin-ai": "2.0.
|
|
16
|
-
"@nocobase/plugin-file-manager": "2.0.
|
|
17
|
-
"@nocobase/actions": "2.0.
|
|
18
|
-
"@nocobase/server": "2.0.
|
|
14
|
+
"@nocobase/client": "2.0.47",
|
|
15
|
+
"@nocobase/plugin-ai": "2.0.47",
|
|
16
|
+
"@nocobase/plugin-file-manager": "2.0.47",
|
|
17
|
+
"@nocobase/actions": "2.0.47",
|
|
18
|
+
"@nocobase/server": "2.0.47"
|
|
19
19
|
};
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* DUMMY COLLECTION
|
|
3
|
+
* This collection is created to prevent NocoBase workflow/ACL from throwing the error:
|
|
4
|
+
* '[Workflow pre-action]: collection "filePreviewAuth" not found'
|
|
5
|
+
*
|
|
6
|
+
* Since 'filePreviewAuth' is registered as a resourcer in plugin.ts, NocoBase
|
|
7
|
+
* implicitly looks for a collection with the same name.
|
|
8
|
+
* We set dumpRules: 'skip' and avoid timestamps to ensure this collection
|
|
9
|
+
* is completely ignored during backups/migrations and doesn't pollute the actual DB.
|
|
10
|
+
*/
|
|
11
|
+
declare const _default: {
|
|
12
|
+
name: string;
|
|
13
|
+
dumpRules: string;
|
|
14
|
+
autoGenId: boolean;
|
|
15
|
+
createdAt: boolean;
|
|
16
|
+
updatedAt: boolean;
|
|
17
|
+
fields: {
|
|
18
|
+
name: string;
|
|
19
|
+
type: string;
|
|
20
|
+
}[];
|
|
21
|
+
};
|
|
22
|
+
export default _default;
|
|
@@ -0,0 +1,44 @@
|
|
|
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 file_preview_auth_exports = {};
|
|
28
|
+
__export(file_preview_auth_exports, {
|
|
29
|
+
default: () => file_preview_auth_default
|
|
30
|
+
});
|
|
31
|
+
module.exports = __toCommonJS(file_preview_auth_exports);
|
|
32
|
+
var file_preview_auth_default = {
|
|
33
|
+
name: "filePreviewAuth",
|
|
34
|
+
dumpRules: "skip",
|
|
35
|
+
autoGenId: true,
|
|
36
|
+
createdAt: false,
|
|
37
|
+
updatedAt: false,
|
|
38
|
+
fields: [
|
|
39
|
+
{
|
|
40
|
+
name: "name",
|
|
41
|
+
type: "string"
|
|
42
|
+
}
|
|
43
|
+
]
|
|
44
|
+
};
|
package/dist/server/plugin.d.ts
CHANGED
package/dist/server/plugin.js
CHANGED
|
@@ -7,9 +7,11 @@
|
|
|
7
7
|
* For more information, please refer to: https://www.nocobase.com/agreement.
|
|
8
8
|
*/
|
|
9
9
|
|
|
10
|
+
var __create = Object.create;
|
|
10
11
|
var __defProp = Object.defineProperty;
|
|
11
12
|
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
12
13
|
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
14
|
+
var __getProtoOf = Object.getPrototypeOf;
|
|
13
15
|
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
14
16
|
var __export = (target, all) => {
|
|
15
17
|
for (var name in all)
|
|
@@ -23,6 +25,14 @@ var __copyProps = (to, from, except, desc) => {
|
|
|
23
25
|
}
|
|
24
26
|
return to;
|
|
25
27
|
};
|
|
28
|
+
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
|
|
29
|
+
// If the importer is in node compatibility mode or this is not an ESM
|
|
30
|
+
// file that has been converted to a CommonJS file using a Babel-
|
|
31
|
+
// compatible transform (i.e. "__esModule" has not been set), then set
|
|
32
|
+
// "default" to the CommonJS "module.exports" for node compatibility.
|
|
33
|
+
isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
|
|
34
|
+
mod
|
|
35
|
+
));
|
|
26
36
|
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
27
37
|
var plugin_exports = {};
|
|
28
38
|
__export(plugin_exports, {
|
|
@@ -32,10 +42,14 @@ __export(plugin_exports, {
|
|
|
32
42
|
module.exports = __toCommonJS(plugin_exports);
|
|
33
43
|
var import_server = require("@nocobase/server");
|
|
34
44
|
var import_excel_parser_handler = require("./excel-parser-handler");
|
|
45
|
+
var import_path = __toESM(require("path"));
|
|
35
46
|
const FILE_PREVIEW_WORK_CONTEXT_TYPE = "file-preview";
|
|
36
47
|
const MAX_AI_CONTEXT_CHARS = 5e4;
|
|
37
48
|
class PluginFilePreviewAuthServer extends import_server.Plugin {
|
|
38
49
|
cache;
|
|
50
|
+
async beforeLoad() {
|
|
51
|
+
await this.db.import({ directory: import_path.default.resolve(__dirname, "collections") });
|
|
52
|
+
}
|
|
39
53
|
async load() {
|
|
40
54
|
this.cache = await this.app.cacheManager.createCache({ name: "file-preview-auth" });
|
|
41
55
|
this.registerExcelParser();
|
package/package.json
CHANGED
|
@@ -6,7 +6,7 @@
|
|
|
6
6
|
"description": "Preview PDF, image, and text files with Bearer token authentication via blob URLs.",
|
|
7
7
|
"description.vi-VN": "Xem trước file PDF, hình ảnh và văn bản với xác thực Bearer token qua blob URL.",
|
|
8
8
|
"description.zh-CN": "通过 Bearer 令牌认证和 Blob URL 预览 PDF、图片和文本文件。",
|
|
9
|
-
"version": "1.2.
|
|
9
|
+
"version": "1.2.1",
|
|
10
10
|
"main": "dist/server/index.js",
|
|
11
11
|
"files": [
|
|
12
12
|
"dist",
|