plugin-file-preview-auth 1.1.4 → 1.1.9

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.
@@ -1,60 +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
- import type { Context } from '@nocobase/actions';
10
- interface AttachmentLike {
11
- id?: string | number;
12
- filename?: string;
13
- name?: string;
14
- mimetype?: string;
15
- extname?: string;
16
- url?: string;
17
- storageId?: number;
18
- size?: number;
19
- meta?: Record<string, any>;
20
- [key: string]: any;
21
- }
22
- interface InternalParseResult {
23
- text: string;
24
- handled: boolean;
25
- }
26
- export interface InternalParserHandler {
27
- name: string;
28
- supports(attachment: AttachmentLike): boolean;
29
- parse(attachment: AttachmentLike, ctx: Context): Promise<InternalParseResult>;
30
- }
31
- /**
32
- * Server-side Excel parser handler.
33
- *
34
- * Uses SheetJS (xlsx) — the same library already bundled by this plugin for
35
- * client-side XLSX preview — to extract plain text from .xlsx/.xls files on
36
- * the server.
37
- *
38
- * Each worksheet is converted to CSV and separated by a section header so LLMs
39
- * can distinguish sheet boundaries:
40
- *
41
- * === Sheet: Sheet1 ===
42
- * col1,col2,col3
43
- * val1,val2,val3
44
- *
45
- * === Sheet: Sheet2 ===
46
- * ...
47
- *
48
- * This handler is registered into plugin-document-parser's InternalParserRegistry
49
- * by PluginFilePreviewAuthServer with `prepend: true` so it takes priority over
50
- * any other handlers that might be registered later.
51
- *
52
- * File bytes are fetched via plugin-document-parser's public `fetchFileBuffer`
53
- * helper, which transparently handles both S3 URLs and local file paths.
54
- */
55
- export declare class ExcelParserHandler implements InternalParserHandler {
56
- readonly name = "file-preview-auth-excel-parser";
57
- supports(attachment: AttachmentLike): boolean;
58
- parse(attachment: AttachmentLike, ctx: Context): Promise<InternalParseResult>;
59
- }
60
- export {};
@@ -1,9 +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
- export { default } from './plugin';
@@ -1,20 +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
- import { Plugin } from '@nocobase/server';
10
- export declare class PluginFilePreviewAuthServer extends Plugin {
11
- load(): Promise<void>;
12
- private registerDownloadApi;
13
- /**
14
- * Register Excel handler into plugin-document-parser's InternalParserRegistry.
15
- * Uses prepend:true so SheetJS takes priority over the AI-loader fallback.
16
- * Silent no-op when plugin-document-parser is not loaded.
17
- */
18
- private registerExcelParser;
19
- }
20
- export default PluginFilePreviewAuthServer;