@ncukondo/reference-manager 0.14.1 → 0.15.0
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/README.md +64 -16
- package/bin/reference-manager.js +0 -0
- package/dist/chunks/{action-menu-CVSizwXm.js → action-menu-DvwR6nMj.js} +3 -3
- package/dist/chunks/{action-menu-CVSizwXm.js.map → action-menu-DvwR6nMj.js.map} +1 -1
- package/dist/chunks/{file-watcher-D2Y-SlcE.js → file-watcher-B_WpVHSV.js} +18 -18
- package/dist/chunks/{file-watcher-D2Y-SlcE.js.map → file-watcher-B_WpVHSV.js.map} +1 -1
- package/dist/chunks/index-B_WCu-ZQ.js +10 -0
- package/dist/chunks/index-B_WCu-ZQ.js.map +1 -0
- package/dist/chunks/{index-CXoDLO8W.js → index-Bv5IgsL-.js} +1522 -409
- package/dist/chunks/index-Bv5IgsL-.js.map +1 -0
- package/dist/chunks/{index-DapYyqAC.js → index-DHgeuWGP.js} +112 -35
- package/dist/chunks/index-DHgeuWGP.js.map +1 -0
- package/dist/chunks/{loader-C1EpnyPm.js → loader-4FFB4igw.js} +66 -27
- package/dist/chunks/loader-4FFB4igw.js.map +1 -0
- package/dist/chunks/{reference-select-DSVwE9iu.js → reference-select-B9w9CLa1.js} +3 -3
- package/dist/chunks/{reference-select-DSVwE9iu.js.map → reference-select-B9w9CLa1.js.map} +1 -1
- package/dist/chunks/{style-select-CYo0O7MZ.js → style-select-BNQHC79W.js} +2 -2
- package/dist/chunks/{style-select-CYo0O7MZ.js.map → style-select-BNQHC79W.js.map} +1 -1
- package/dist/chunks/{tty-CDBIQraQ.js → tty-BMyaEOhX.js} +2 -2
- package/dist/chunks/tty-BMyaEOhX.js.map +1 -0
- package/dist/cli/commands/attach.d.ts +204 -0
- package/dist/cli/commands/attach.d.ts.map +1 -0
- package/dist/cli/commands/cite.d.ts +1 -1
- package/dist/cli/commands/export.d.ts +1 -1
- package/dist/cli/commands/fulltext.d.ts +2 -2
- package/dist/cli/commands/fulltext.d.ts.map +1 -1
- package/dist/cli/commands/list.d.ts +2 -1
- package/dist/cli/commands/list.d.ts.map +1 -1
- package/dist/cli/commands/search.d.ts +3 -2
- package/dist/cli/commands/search.d.ts.map +1 -1
- package/dist/cli/completion.d.ts.map +1 -1
- package/dist/cli/index.d.ts.map +1 -1
- package/dist/cli/server-client.d.ts +37 -1
- package/dist/cli/server-client.d.ts.map +1 -1
- package/dist/cli.js +2 -2
- package/dist/config/defaults.d.ts +7 -1
- package/dist/config/defaults.d.ts.map +1 -1
- package/dist/config/key-parser.d.ts +1 -1
- package/dist/config/loader.d.ts.map +1 -1
- package/dist/config/schema.d.ts +22 -8
- package/dist/config/schema.d.ts.map +1 -1
- package/dist/features/attachments/directory-manager.d.ts +40 -0
- package/dist/features/attachments/directory-manager.d.ts.map +1 -0
- package/dist/features/attachments/directory.d.ts +36 -0
- package/dist/features/attachments/directory.d.ts.map +1 -0
- package/dist/features/attachments/filename.d.ts +30 -0
- package/dist/features/attachments/filename.d.ts.map +1 -0
- package/dist/features/attachments/types.d.ts +38 -0
- package/dist/features/attachments/types.d.ts.map +1 -0
- package/dist/features/fulltext/manager.d.ts +1 -1
- package/dist/features/fulltext/manager.d.ts.map +1 -1
- package/dist/features/interactive/tty.d.ts +2 -2
- package/dist/features/operations/attachments/add.d.ts +42 -0
- package/dist/features/operations/attachments/add.d.ts.map +1 -0
- package/dist/features/operations/attachments/detach.d.ts +38 -0
- package/dist/features/operations/attachments/detach.d.ts.map +1 -0
- package/dist/features/operations/attachments/get.d.ts +35 -0
- package/dist/features/operations/attachments/get.d.ts.map +1 -0
- package/dist/features/operations/attachments/index.d.ts +16 -0
- package/dist/features/operations/attachments/index.d.ts.map +1 -0
- package/dist/features/operations/attachments/list.d.ts +32 -0
- package/dist/features/operations/attachments/list.d.ts.map +1 -0
- package/dist/features/operations/attachments/open.d.ts +39 -0
- package/dist/features/operations/attachments/open.d.ts.map +1 -0
- package/dist/features/operations/attachments/sync.d.ts +50 -0
- package/dist/features/operations/attachments/sync.d.ts.map +1 -0
- package/dist/features/operations/fulltext/attach.d.ts +8 -2
- package/dist/features/operations/fulltext/attach.d.ts.map +1 -1
- package/dist/features/operations/fulltext/detach.d.ts +9 -3
- package/dist/features/operations/fulltext/detach.d.ts.map +1 -1
- package/dist/features/operations/fulltext/get.d.ts +8 -2
- package/dist/features/operations/fulltext/get.d.ts.map +1 -1
- package/dist/features/operations/fulltext/open.d.ts +8 -2
- package/dist/features/operations/fulltext/open.d.ts.map +1 -1
- package/dist/features/operations/fulltext-adapter/fulltext-adapter.d.ts +39 -0
- package/dist/features/operations/fulltext-adapter/fulltext-adapter.d.ts.map +1 -0
- package/dist/features/operations/fulltext-adapter/index.d.ts +7 -0
- package/dist/features/operations/fulltext-adapter/index.d.ts.map +1 -0
- package/dist/features/operations/index.d.ts +1 -0
- package/dist/features/operations/index.d.ts.map +1 -1
- package/dist/features/operations/library-operations.d.ts +43 -0
- package/dist/features/operations/library-operations.d.ts.map +1 -1
- package/dist/features/operations/operations-library.d.ts +7 -0
- package/dist/features/operations/operations-library.d.ts.map +1 -1
- package/dist/features/operations/remove.d.ts +1 -0
- package/dist/features/operations/remove.d.ts.map +1 -1
- package/dist/index.js +15 -15
- package/dist/index.js.map +1 -1
- package/dist/server.js +3 -3
- package/dist/utils/opener.d.ts +6 -1
- package/dist/utils/opener.d.ts.map +1 -1
- package/dist/utils/path.d.ts +28 -0
- package/dist/utils/path.d.ts.map +1 -0
- package/package.json +2 -1
- package/dist/chunks/index-CXoDLO8W.js.map +0 -1
- package/dist/chunks/index-DapYyqAC.js.map +0 -1
- package/dist/chunks/loader-C1EpnyPm.js.map +0 -1
- package/dist/chunks/tty-CDBIQraQ.js.map +0 -1
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Filename utilities for attachments
|
|
3
|
+
*
|
|
4
|
+
* File format: {role}[-{label-slug}].{ext}
|
|
5
|
+
* Examples:
|
|
6
|
+
* - fulltext.pdf
|
|
7
|
+
* - supplement-table-s1.xlsx
|
|
8
|
+
* - notes-reading-analysis.md
|
|
9
|
+
*/
|
|
10
|
+
interface ParsedFilename {
|
|
11
|
+
role: string;
|
|
12
|
+
ext: string;
|
|
13
|
+
label?: string;
|
|
14
|
+
}
|
|
15
|
+
/**
|
|
16
|
+
* Convert a human-readable label to a filesystem-safe slug
|
|
17
|
+
*/
|
|
18
|
+
export declare function slugifyLabel(label: string): string;
|
|
19
|
+
/**
|
|
20
|
+
* Generate filename from role, extension, and optional label
|
|
21
|
+
*/
|
|
22
|
+
export declare function generateFilename(role: string, ext: string, label?: string): string;
|
|
23
|
+
/**
|
|
24
|
+
* Parse filename to extract role, extension, and label
|
|
25
|
+
*
|
|
26
|
+
* Returns null for empty filenames
|
|
27
|
+
*/
|
|
28
|
+
export declare function parseFilename(filename: string): ParsedFilename | null;
|
|
29
|
+
export {};
|
|
30
|
+
//# sourceMappingURL=filename.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"filename.d.ts","sourceRoot":"","sources":["../../../src/features/attachments/filename.ts"],"names":[],"mappings":"AAEA;;;;;;;;GAQG;AAEH,UAAU,cAAc;IACtB,IAAI,EAAE,MAAM,CAAC;IACb,GAAG,EAAE,MAAM,CAAC;IACZ,KAAK,CAAC,EAAE,MAAM,CAAC;CAChB;AAED;;GAEG;AACH,wBAAgB,YAAY,CAAC,KAAK,EAAE,MAAM,GAAG,MAAM,CAMlD;AAED;;GAEG;AACH,wBAAgB,gBAAgB,CAAC,IAAI,EAAE,MAAM,EAAE,GAAG,EAAE,MAAM,EAAE,KAAK,CAAC,EAAE,MAAM,GAAG,MAAM,CAMlF;AAED;;;;GAIG;AACH,wBAAgB,aAAa,CAAC,QAAQ,EAAE,MAAM,GAAG,cAAc,GAAG,IAAI,CAmCrE"}
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Attachment file metadata stored in reference's custom field
|
|
3
|
+
*/
|
|
4
|
+
export interface AttachmentFile {
|
|
5
|
+
/** Filename without path (e.g., "fulltext.pdf") */
|
|
6
|
+
filename: string;
|
|
7
|
+
/** Role identifier (e.g., "fulltext", "supplement", "notes") */
|
|
8
|
+
role: string;
|
|
9
|
+
/** Human-readable label (optional) */
|
|
10
|
+
label?: string;
|
|
11
|
+
}
|
|
12
|
+
/**
|
|
13
|
+
* Attachments container stored in reference's custom.attachments field
|
|
14
|
+
*/
|
|
15
|
+
export interface Attachments {
|
|
16
|
+
/** Directory name relative to attachments base (e.g., "Smith-2024-PMID12345678-123e4567") */
|
|
17
|
+
directory: string;
|
|
18
|
+
/** List of attached files */
|
|
19
|
+
files: AttachmentFile[];
|
|
20
|
+
}
|
|
21
|
+
/**
|
|
22
|
+
* Reserved role identifiers with special constraints
|
|
23
|
+
*/
|
|
24
|
+
export declare const RESERVED_ROLES: readonly ["fulltext", "supplement", "notes", "draft"];
|
|
25
|
+
export type ReservedRole = (typeof RESERVED_ROLES)[number];
|
|
26
|
+
/**
|
|
27
|
+
* Check if a role is a reserved role
|
|
28
|
+
*/
|
|
29
|
+
export declare function isReservedRole(role: string): role is ReservedRole;
|
|
30
|
+
/**
|
|
31
|
+
* Get file extension from filename (without leading dot)
|
|
32
|
+
*/
|
|
33
|
+
export declare function getExtension(filename: string): string;
|
|
34
|
+
/**
|
|
35
|
+
* Check if fulltext files satisfy the constraint: max 2 files (1 PDF + 1 Markdown)
|
|
36
|
+
*/
|
|
37
|
+
export declare function isValidFulltextFiles(files: AttachmentFile[]): boolean;
|
|
38
|
+
//# sourceMappingURL=types.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../src/features/attachments/types.ts"],"names":[],"mappings":"AAEA;;GAEG;AACH,MAAM,WAAW,cAAc;IAC7B,mDAAmD;IACnD,QAAQ,EAAE,MAAM,CAAC;IACjB,gEAAgE;IAChE,IAAI,EAAE,MAAM,CAAC;IACb,sCAAsC;IACtC,KAAK,CAAC,EAAE,MAAM,CAAC;CAChB;AAED;;GAEG;AACH,MAAM,WAAW,WAAW;IAC1B,6FAA6F;IAC7F,SAAS,EAAE,MAAM,CAAC;IAClB,6BAA6B;IAC7B,KAAK,EAAE,cAAc,EAAE,CAAC;CACzB;AAED;;GAEG;AACH,eAAO,MAAM,cAAc,uDAAwD,CAAC;AAEpF,MAAM,MAAM,YAAY,GAAG,CAAC,OAAO,cAAc,CAAC,CAAC,MAAM,CAAC,CAAC;AAE3D;;GAEG;AACH,wBAAgB,cAAc,CAAC,IAAI,EAAE,MAAM,GAAG,IAAI,IAAI,YAAY,CAEjE;AAED;;GAEG;AACH,wBAAgB,YAAY,CAAC,QAAQ,EAAE,MAAM,GAAG,MAAM,CAGrD;AAED;;GAEG;AACH,wBAAgB,oBAAoB,CAAC,KAAK,EAAE,cAAc,EAAE,GAAG,OAAO,CAiBrE"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"manager.d.ts","sourceRoot":"","sources":["../../../src/features/fulltext/manager.ts"],"names":[],"mappings":"AAAA;;GAEG;AAKH,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,8BAA8B,CAAC;
|
|
1
|
+
{"version":3,"file":"manager.d.ts","sourceRoot":"","sources":["../../../src/features/fulltext/manager.ts"],"names":[],"mappings":"AAAA;;GAEG;AAKH,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,8BAA8B,CAAC;AAG5D,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,YAAY,CAAC;AAE/C;;GAEG;AACH,qBAAa,eAAgB,SAAQ,KAAK;aAGtB,KAAK,CAAC,EAAE,KAAK;gBAD7B,OAAO,EAAE,MAAM,EACC,KAAK,CAAC,EAAE,KAAK,YAAA;CAKhC;AAED;;GAEG;AACH,qBAAa,wBAAyB,SAAQ,KAAK;aAE/B,MAAM,EAAE,MAAM;aACd,IAAI,EAAE,YAAY;gBADlB,MAAM,EAAE,MAAM,EACd,IAAI,EAAE,YAAY;CAKrC;AAED;;GAEG;AACH,MAAM,WAAW,aAAa;IAC5B,iDAAiD;IACjD,IAAI,CAAC,EAAE,OAAO,CAAC;IACf,0EAA0E;IAC1E,KAAK,CAAC,EAAE,OAAO,CAAC;CACjB;AAED;;GAEG;AACH,MAAM,WAAW,YAAY;IAC3B,yBAAyB;IACzB,QAAQ,EAAE,MAAM,CAAC;IACjB,+DAA+D;IAC/D,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,4CAA4C;IAC5C,WAAW,EAAE,OAAO,CAAC;IACrB,2EAA2E;IAC3E,cAAc,CAAC,EAAE,MAAM,CAAC;CACzB;AAED;;GAEG;AACH,MAAM,WAAW,aAAa;IAC5B,mEAAmE;IACnE,WAAW,CAAC,EAAE,OAAO,CAAC;CACvB;AAED;;GAEG;AACH,MAAM,WAAW,YAAY;IAC3B,wBAAwB;IACxB,QAAQ,EAAE,MAAM,CAAC;IACjB,yCAAyC;IACzC,OAAO,EAAE,OAAO,CAAC;CAClB;AAED;;GAEG;AACH,qBAAa,eAAe;IACd,OAAO,CAAC,QAAQ,CAAC,iBAAiB;gBAAjB,iBAAiB,EAAE,MAAM;IAEtD;;OAEG;IACG,eAAe,IAAI,OAAO,CAAC,IAAI,CAAC;IAItC;;OAEG;IACG,UAAU,CACd,IAAI,EAAE,OAAO,EACb,UAAU,EAAE,MAAM,EAClB,IAAI,EAAE,YAAY,EAClB,OAAO,CAAC,EAAE,aAAa,GACtB,OAAO,CAAC,YAAY,CAAC;IAyCxB;;OAEG;IACH,OAAO,CAAC,kBAAkB;IAM1B;;;OAGG;YACW,qBAAqB;IAkBnC;;OAEG;YACW,cAAc;IAgB5B;;;OAGG;IACH,WAAW,CAAC,IAAI,EAAE,OAAO,EAAE,IAAI,EAAE,YAAY,GAAG,MAAM,GAAG,IAAI;IAQ7D;;OAEG;IACG,UAAU,CACd,IAAI,EAAE,OAAO,EACb,IAAI,EAAE,YAAY,EAClB,OAAO,CAAC,EAAE,aAAa,GACtB,OAAO,CAAC,YAAY,CAAC;IAuBxB;;OAEG;IACH,gBAAgB,CAAC,IAAI,EAAE,OAAO,GAAG,YAAY,EAAE;IAc/C;;;OAGG;IACH,aAAa,CAAC,IAAI,EAAE,OAAO,EAAE,IAAI,CAAC,EAAE,YAAY,GAAG,OAAO;IAO1D;;OAEG;IACH,OAAO,CAAC,mBAAmB;CAO5B"}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* TTY detection for
|
|
2
|
+
* TTY detection for TUI mode
|
|
3
3
|
*/
|
|
4
4
|
/**
|
|
5
5
|
* Error thrown when TTY is required but not available
|
|
@@ -12,7 +12,7 @@ export declare class TTYError extends Error {
|
|
|
12
12
|
* Check if the current environment is a TTY
|
|
13
13
|
*
|
|
14
14
|
* Throws TTYError if stdin or stdout is not a TTY,
|
|
15
|
-
* which means
|
|
15
|
+
* which means TUI mode cannot be used.
|
|
16
16
|
*
|
|
17
17
|
* @throws {TTYError} If not running in a TTY
|
|
18
18
|
*/
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Attachment add operation
|
|
3
|
+
*/
|
|
4
|
+
import type { ILibrary, IdentifierType } from "../../../core/library-interface.js";
|
|
5
|
+
/**
|
|
6
|
+
* Options for addAttachment operation
|
|
7
|
+
*/
|
|
8
|
+
export interface AddAttachmentOptions {
|
|
9
|
+
/** Reference identifier (id or uuid) */
|
|
10
|
+
identifier: string;
|
|
11
|
+
/** Path to the file to attach */
|
|
12
|
+
filePath: string;
|
|
13
|
+
/** Role for the attachment */
|
|
14
|
+
role: string;
|
|
15
|
+
/** Human-readable label (optional) */
|
|
16
|
+
label?: string;
|
|
17
|
+
/** Move file instead of copy */
|
|
18
|
+
move?: boolean;
|
|
19
|
+
/** Force overwrite existing file */
|
|
20
|
+
force?: boolean;
|
|
21
|
+
/** Identifier type */
|
|
22
|
+
idType?: IdentifierType;
|
|
23
|
+
/** Base directory for attachments */
|
|
24
|
+
attachmentsDirectory: string;
|
|
25
|
+
}
|
|
26
|
+
/**
|
|
27
|
+
* Result of addAttachment operation
|
|
28
|
+
*/
|
|
29
|
+
export interface AddAttachmentResult {
|
|
30
|
+
success: boolean;
|
|
31
|
+
filename?: string;
|
|
32
|
+
directory?: string;
|
|
33
|
+
overwritten?: boolean;
|
|
34
|
+
existingFile?: string;
|
|
35
|
+
requiresConfirmation?: boolean;
|
|
36
|
+
error?: string;
|
|
37
|
+
}
|
|
38
|
+
/**
|
|
39
|
+
* Add an attachment to a reference
|
|
40
|
+
*/
|
|
41
|
+
export declare function addAttachment(library: ILibrary, options: AddAttachmentOptions): Promise<AddAttachmentResult>;
|
|
42
|
+
//# sourceMappingURL=add.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"add.d.ts","sourceRoot":"","sources":["../../../../src/features/operations/attachments/add.ts"],"names":[],"mappings":"AAAA;;GAEG;AAKH,OAAO,KAAK,EAAE,QAAQ,EAAE,cAAc,EAAE,MAAM,oCAAoC,CAAC;AAWnF;;GAEG;AACH,MAAM,WAAW,oBAAoB;IACnC,wCAAwC;IACxC,UAAU,EAAE,MAAM,CAAC;IACnB,iCAAiC;IACjC,QAAQ,EAAE,MAAM,CAAC;IACjB,8BAA8B;IAC9B,IAAI,EAAE,MAAM,CAAC;IACb,sCAAsC;IACtC,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,gCAAgC;IAChC,IAAI,CAAC,EAAE,OAAO,CAAC;IACf,oCAAoC;IACpC,KAAK,CAAC,EAAE,OAAO,CAAC;IAChB,sBAAsB;IACtB,MAAM,CAAC,EAAE,cAAc,CAAC;IACxB,qCAAqC;IACrC,oBAAoB,EAAE,MAAM,CAAC;CAC9B;AAED;;GAEG;AACH,MAAM,WAAW,mBAAmB;IAClC,OAAO,EAAE,OAAO,CAAC;IACjB,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,WAAW,CAAC,EAAE,OAAO,CAAC;IACtB,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,oBAAoB,CAAC,EAAE,OAAO,CAAC;IAC/B,KAAK,CAAC,EAAE,MAAM,CAAC;CAChB;AAkHD;;GAEG;AACH,wBAAsB,aAAa,CACjC,OAAO,EAAE,QAAQ,EACjB,OAAO,EAAE,oBAAoB,GAC5B,OAAO,CAAC,mBAAmB,CAAC,CA+F9B"}
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Attachment detach operation
|
|
3
|
+
*/
|
|
4
|
+
import type { ILibrary, IdentifierType } from "../../../core/library-interface.js";
|
|
5
|
+
/**
|
|
6
|
+
* Options for detachAttachment operation
|
|
7
|
+
*/
|
|
8
|
+
export interface DetachAttachmentOptions {
|
|
9
|
+
/** Reference identifier */
|
|
10
|
+
identifier: string;
|
|
11
|
+
/** Filename to detach */
|
|
12
|
+
filename?: string;
|
|
13
|
+
/** Detach by role instead of filename */
|
|
14
|
+
role?: string;
|
|
15
|
+
/** Detach all files of the role */
|
|
16
|
+
all?: boolean;
|
|
17
|
+
/** Delete file from disk */
|
|
18
|
+
removeFiles?: boolean;
|
|
19
|
+
/** Identifier type */
|
|
20
|
+
idType?: IdentifierType;
|
|
21
|
+
/** Base directory for attachments */
|
|
22
|
+
attachmentsDirectory: string;
|
|
23
|
+
}
|
|
24
|
+
/**
|
|
25
|
+
* Result of detachAttachment operation
|
|
26
|
+
*/
|
|
27
|
+
export interface DetachAttachmentResult {
|
|
28
|
+
success: boolean;
|
|
29
|
+
detached: string[];
|
|
30
|
+
deleted: string[];
|
|
31
|
+
directoryDeleted?: boolean;
|
|
32
|
+
error?: string;
|
|
33
|
+
}
|
|
34
|
+
/**
|
|
35
|
+
* Detach an attachment from a reference
|
|
36
|
+
*/
|
|
37
|
+
export declare function detachAttachment(library: ILibrary, options: DetachAttachmentOptions): Promise<DetachAttachmentResult>;
|
|
38
|
+
//# sourceMappingURL=detach.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"detach.d.ts","sourceRoot":"","sources":["../../../../src/features/operations/attachments/detach.ts"],"names":[],"mappings":"AAAA;;GAEG;AAKH,OAAO,KAAK,EAAE,QAAQ,EAAE,cAAc,EAAE,MAAM,oCAAoC,CAAC;AAInF;;GAEG;AACH,MAAM,WAAW,uBAAuB;IACtC,2BAA2B;IAC3B,UAAU,EAAE,MAAM,CAAC;IACnB,yBAAyB;IACzB,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,yCAAyC;IACzC,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,mCAAmC;IACnC,GAAG,CAAC,EAAE,OAAO,CAAC;IACd,4BAA4B;IAC5B,WAAW,CAAC,EAAE,OAAO,CAAC;IACtB,sBAAsB;IACtB,MAAM,CAAC,EAAE,cAAc,CAAC;IACxB,qCAAqC;IACrC,oBAAoB,EAAE,MAAM,CAAC;CAC9B;AAED;;GAEG;AACH,MAAM,WAAW,sBAAsB;IACrC,OAAO,EAAE,OAAO,CAAC;IACjB,QAAQ,EAAE,MAAM,EAAE,CAAC;IACnB,OAAO,EAAE,MAAM,EAAE,CAAC;IAClB,gBAAgB,CAAC,EAAE,OAAO,CAAC;IAC3B,KAAK,CAAC,EAAE,MAAM,CAAC;CAChB;AAwFD;;GAEG;AACH,wBAAsB,gBAAgB,CACpC,OAAO,EAAE,QAAQ,EACjB,OAAO,EAAE,uBAAuB,GAC/B,OAAO,CAAC,sBAAsB,CAAC,CA2DjC"}
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Attachment get operation
|
|
3
|
+
*/
|
|
4
|
+
import type { ILibrary, IdentifierType } from "../../../core/library-interface.js";
|
|
5
|
+
/**
|
|
6
|
+
* Options for getAttachment operation
|
|
7
|
+
*/
|
|
8
|
+
export interface GetAttachmentOptions {
|
|
9
|
+
/** Reference identifier */
|
|
10
|
+
identifier: string;
|
|
11
|
+
/** Filename to get */
|
|
12
|
+
filename?: string;
|
|
13
|
+
/** Get by role instead of filename */
|
|
14
|
+
role?: string;
|
|
15
|
+
/** Identifier type */
|
|
16
|
+
idType?: IdentifierType;
|
|
17
|
+
/** Output content to stdout */
|
|
18
|
+
stdout?: boolean;
|
|
19
|
+
/** Base directory for attachments */
|
|
20
|
+
attachmentsDirectory: string;
|
|
21
|
+
}
|
|
22
|
+
/**
|
|
23
|
+
* Result of getAttachment operation
|
|
24
|
+
*/
|
|
25
|
+
export interface GetAttachmentResult {
|
|
26
|
+
success: boolean;
|
|
27
|
+
path?: string;
|
|
28
|
+
content?: Buffer;
|
|
29
|
+
error?: string;
|
|
30
|
+
}
|
|
31
|
+
/**
|
|
32
|
+
* Get an attachment file path or content
|
|
33
|
+
*/
|
|
34
|
+
export declare function getAttachment(library: ILibrary, options: GetAttachmentOptions): Promise<GetAttachmentResult>;
|
|
35
|
+
//# sourceMappingURL=get.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"get.d.ts","sourceRoot":"","sources":["../../../../src/features/operations/attachments/get.ts"],"names":[],"mappings":"AAAA;;GAEG;AAKH,OAAO,KAAK,EAAE,QAAQ,EAAE,cAAc,EAAE,MAAM,oCAAoC,CAAC;AAInF;;GAEG;AACH,MAAM,WAAW,oBAAoB;IACnC,2BAA2B;IAC3B,UAAU,EAAE,MAAM,CAAC;IACnB,sBAAsB;IACtB,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,sCAAsC;IACtC,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,sBAAsB;IACtB,MAAM,CAAC,EAAE,cAAc,CAAC;IACxB,+BAA+B;IAC/B,MAAM,CAAC,EAAE,OAAO,CAAC;IACjB,qCAAqC;IACrC,oBAAoB,EAAE,MAAM,CAAC;CAC9B;AAED;;GAEG;AACH,MAAM,WAAW,mBAAmB;IAClC,OAAO,EAAE,OAAO,CAAC;IACjB,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,KAAK,CAAC,EAAE,MAAM,CAAC;CAChB;AAmBD;;GAEG;AACH,wBAAsB,aAAa,CACjC,OAAO,EAAE,QAAQ,EACjB,OAAO,EAAE,oBAAoB,GAC5B,OAAO,CAAC,mBAAmB,CAAC,CAqD9B"}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Attachment operations - unified exports
|
|
3
|
+
*/
|
|
4
|
+
export { addAttachment } from "./add.js";
|
|
5
|
+
export type { AddAttachmentOptions, AddAttachmentResult } from "./add.js";
|
|
6
|
+
export { listAttachments } from "./list.js";
|
|
7
|
+
export type { ListAttachmentsOptions, ListAttachmentsResult } from "./list.js";
|
|
8
|
+
export { getAttachment } from "./get.js";
|
|
9
|
+
export type { GetAttachmentOptions, GetAttachmentResult } from "./get.js";
|
|
10
|
+
export { detachAttachment } from "./detach.js";
|
|
11
|
+
export type { DetachAttachmentOptions, DetachAttachmentResult } from "./detach.js";
|
|
12
|
+
export { syncAttachments } from "./sync.js";
|
|
13
|
+
export type { SyncAttachmentOptions, SyncAttachmentResult, InferredFile } from "./sync.js";
|
|
14
|
+
export { openAttachment } from "./open.js";
|
|
15
|
+
export type { OpenAttachmentOptions, OpenAttachmentResult } from "./open.js";
|
|
16
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/features/operations/attachments/index.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH,OAAO,EAAE,aAAa,EAAE,MAAM,UAAU,CAAC;AACzC,YAAY,EAAE,oBAAoB,EAAE,mBAAmB,EAAE,MAAM,UAAU,CAAC;AAE1E,OAAO,EAAE,eAAe,EAAE,MAAM,WAAW,CAAC;AAC5C,YAAY,EAAE,sBAAsB,EAAE,qBAAqB,EAAE,MAAM,WAAW,CAAC;AAE/E,OAAO,EAAE,aAAa,EAAE,MAAM,UAAU,CAAC;AACzC,YAAY,EAAE,oBAAoB,EAAE,mBAAmB,EAAE,MAAM,UAAU,CAAC;AAE1E,OAAO,EAAE,gBAAgB,EAAE,MAAM,aAAa,CAAC;AAC/C,YAAY,EAAE,uBAAuB,EAAE,sBAAsB,EAAE,MAAM,aAAa,CAAC;AAEnF,OAAO,EAAE,eAAe,EAAE,MAAM,WAAW,CAAC;AAC5C,YAAY,EAAE,qBAAqB,EAAE,oBAAoB,EAAE,YAAY,EAAE,MAAM,WAAW,CAAC;AAE3F,OAAO,EAAE,cAAc,EAAE,MAAM,WAAW,CAAC;AAC3C,YAAY,EAAE,qBAAqB,EAAE,oBAAoB,EAAE,MAAM,WAAW,CAAC"}
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Attachment list operation
|
|
3
|
+
*/
|
|
4
|
+
import type { ILibrary, IdentifierType } from "../../../core/library-interface.js";
|
|
5
|
+
import type { AttachmentFile } from "../../attachments/types.js";
|
|
6
|
+
/**
|
|
7
|
+
* Options for listAttachments operation
|
|
8
|
+
*/
|
|
9
|
+
export interface ListAttachmentsOptions {
|
|
10
|
+
/** Reference identifier */
|
|
11
|
+
identifier: string;
|
|
12
|
+
/** Identifier type */
|
|
13
|
+
idType?: IdentifierType;
|
|
14
|
+
/** Filter by role */
|
|
15
|
+
role?: string;
|
|
16
|
+
/** Base directory for attachments */
|
|
17
|
+
attachmentsDirectory: string;
|
|
18
|
+
}
|
|
19
|
+
/**
|
|
20
|
+
* Result of listAttachments operation
|
|
21
|
+
*/
|
|
22
|
+
export interface ListAttachmentsResult {
|
|
23
|
+
success: boolean;
|
|
24
|
+
directory?: string;
|
|
25
|
+
files: AttachmentFile[];
|
|
26
|
+
error?: string;
|
|
27
|
+
}
|
|
28
|
+
/**
|
|
29
|
+
* List attachments for a reference
|
|
30
|
+
*/
|
|
31
|
+
export declare function listAttachments(library: ILibrary, options: ListAttachmentsOptions): Promise<ListAttachmentsResult>;
|
|
32
|
+
//# sourceMappingURL=list.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"list.d.ts","sourceRoot":"","sources":["../../../../src/features/operations/attachments/list.ts"],"names":[],"mappings":"AAAA;;GAEG;AAGH,OAAO,KAAK,EAAE,QAAQ,EAAE,cAAc,EAAE,MAAM,oCAAoC,CAAC;AACnF,OAAO,KAAK,EAAE,cAAc,EAAe,MAAM,4BAA4B,CAAC;AAE9E;;GAEG;AACH,MAAM,WAAW,sBAAsB;IACrC,2BAA2B;IAC3B,UAAU,EAAE,MAAM,CAAC;IACnB,sBAAsB;IACtB,MAAM,CAAC,EAAE,cAAc,CAAC;IACxB,qBAAqB;IACrB,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,qCAAqC;IACrC,oBAAoB,EAAE,MAAM,CAAC;CAC9B;AAED;;GAEG;AACH,MAAM,WAAW,qBAAqB;IACpC,OAAO,EAAE,OAAO,CAAC;IACjB,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,KAAK,EAAE,cAAc,EAAE,CAAC;IACxB,KAAK,CAAC,EAAE,MAAM,CAAC;CAChB;AAED;;GAEG;AACH,wBAAsB,eAAe,CACnC,OAAO,EAAE,QAAQ,EACjB,OAAO,EAAE,sBAAsB,GAC9B,OAAO,CAAC,qBAAqB,CAAC,CAiChC"}
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Attachment open operation
|
|
3
|
+
*
|
|
4
|
+
* Opens attachments directory or specific file with system application.
|
|
5
|
+
*/
|
|
6
|
+
import type { ILibrary, IdentifierType } from "../../../core/library-interface.js";
|
|
7
|
+
/**
|
|
8
|
+
* Options for openAttachment operation
|
|
9
|
+
*/
|
|
10
|
+
export interface OpenAttachmentOptions {
|
|
11
|
+
/** Reference identifier (id or uuid) */
|
|
12
|
+
identifier: string;
|
|
13
|
+
/** Specific filename to open */
|
|
14
|
+
filename?: string;
|
|
15
|
+
/** Role to open (opens first matching file) */
|
|
16
|
+
role?: string;
|
|
17
|
+
/** Print path instead of opening */
|
|
18
|
+
print?: boolean;
|
|
19
|
+
/** Identifier type */
|
|
20
|
+
idType?: IdentifierType;
|
|
21
|
+
/** Base directory for attachments */
|
|
22
|
+
attachmentsDirectory: string;
|
|
23
|
+
}
|
|
24
|
+
/**
|
|
25
|
+
* Result of openAttachment operation
|
|
26
|
+
*/
|
|
27
|
+
export interface OpenAttachmentResult {
|
|
28
|
+
success: boolean;
|
|
29
|
+
/** Path that was opened or would be opened */
|
|
30
|
+
path?: string;
|
|
31
|
+
/** Whether the directory was created */
|
|
32
|
+
directoryCreated?: boolean;
|
|
33
|
+
error?: string;
|
|
34
|
+
}
|
|
35
|
+
/**
|
|
36
|
+
* Open attachment directory or file
|
|
37
|
+
*/
|
|
38
|
+
export declare function openAttachment(library: ILibrary, options: OpenAttachmentOptions): Promise<OpenAttachmentResult>;
|
|
39
|
+
//# sourceMappingURL=open.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"open.d.ts","sourceRoot":"","sources":["../../../../src/features/operations/attachments/open.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAKH,OAAO,KAAK,EAAE,QAAQ,EAAE,cAAc,EAAE,MAAM,oCAAoC,CAAC;AAMnF;;GAEG;AACH,MAAM,WAAW,qBAAqB;IACpC,wCAAwC;IACxC,UAAU,EAAE,MAAM,CAAC;IACnB,gCAAgC;IAChC,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,+CAA+C;IAC/C,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,oCAAoC;IACpC,KAAK,CAAC,EAAE,OAAO,CAAC;IAChB,sBAAsB;IACtB,MAAM,CAAC,EAAE,cAAc,CAAC;IACxB,qCAAqC;IACrC,oBAAoB,EAAE,MAAM,CAAC;CAC9B;AAED;;GAEG;AACH,MAAM,WAAW,oBAAoB;IACnC,OAAO,EAAE,OAAO,CAAC;IACjB,8CAA8C;IAC9C,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,wCAAwC;IACxC,gBAAgB,CAAC,EAAE,OAAO,CAAC;IAC3B,KAAK,CAAC,EAAE,MAAM,CAAC;CAChB;AA+HD;;GAEG;AACH,wBAAsB,cAAc,CAClC,OAAO,EAAE,QAAQ,EACjB,OAAO,EAAE,qBAAqB,GAC7B,OAAO,CAAC,oBAAoB,CAAC,CAoD/B"}
|
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Attachment sync operation
|
|
3
|
+
*
|
|
4
|
+
* Synchronizes metadata with files on disk:
|
|
5
|
+
* - Detects new files not in metadata
|
|
6
|
+
* - Detects missing files (in metadata but not on disk)
|
|
7
|
+
* - Infers role/label from filename pattern
|
|
8
|
+
*/
|
|
9
|
+
import type { ILibrary, IdentifierType } from "../../../core/library-interface.js";
|
|
10
|
+
/**
|
|
11
|
+
* Options for syncAttachments operation
|
|
12
|
+
*/
|
|
13
|
+
export interface SyncAttachmentOptions {
|
|
14
|
+
/** Reference identifier (id or uuid) */
|
|
15
|
+
identifier: string;
|
|
16
|
+
/** Apply changes (add new files to metadata) */
|
|
17
|
+
yes?: boolean;
|
|
18
|
+
/** Remove missing files from metadata */
|
|
19
|
+
fix?: boolean;
|
|
20
|
+
/** Identifier type */
|
|
21
|
+
idType?: IdentifierType;
|
|
22
|
+
/** Base directory for attachments */
|
|
23
|
+
attachmentsDirectory: string;
|
|
24
|
+
}
|
|
25
|
+
/**
|
|
26
|
+
* Inferred file from disk
|
|
27
|
+
*/
|
|
28
|
+
export interface InferredFile {
|
|
29
|
+
filename: string;
|
|
30
|
+
role: string;
|
|
31
|
+
label?: string;
|
|
32
|
+
}
|
|
33
|
+
/**
|
|
34
|
+
* Result of syncAttachments operation
|
|
35
|
+
*/
|
|
36
|
+
export interface SyncAttachmentResult {
|
|
37
|
+
success: boolean;
|
|
38
|
+
/** Files on disk but not in metadata */
|
|
39
|
+
newFiles: InferredFile[];
|
|
40
|
+
/** Files in metadata but not on disk */
|
|
41
|
+
missingFiles: string[];
|
|
42
|
+
/** Whether changes were applied */
|
|
43
|
+
applied: boolean;
|
|
44
|
+
error?: string;
|
|
45
|
+
}
|
|
46
|
+
/**
|
|
47
|
+
* Synchronize attachments metadata with files on disk
|
|
48
|
+
*/
|
|
49
|
+
export declare function syncAttachments(library: ILibrary, options: SyncAttachmentOptions): Promise<SyncAttachmentResult>;
|
|
50
|
+
//# sourceMappingURL=sync.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"sync.d.ts","sourceRoot":"","sources":["../../../../src/features/operations/attachments/sync.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAKH,OAAO,KAAK,EAAE,QAAQ,EAAE,cAAc,EAAE,MAAM,oCAAoC,CAAC;AAKnF;;GAEG;AACH,MAAM,WAAW,qBAAqB;IACpC,wCAAwC;IACxC,UAAU,EAAE,MAAM,CAAC;IACnB,gDAAgD;IAChD,GAAG,CAAC,EAAE,OAAO,CAAC;IACd,yCAAyC;IACzC,GAAG,CAAC,EAAE,OAAO,CAAC;IACd,sBAAsB;IACtB,MAAM,CAAC,EAAE,cAAc,CAAC;IACxB,qCAAqC;IACrC,oBAAoB,EAAE,MAAM,CAAC;CAC9B;AAED;;GAEG;AACH,MAAM,WAAW,YAAY;IAC3B,QAAQ,EAAE,MAAM,CAAC;IACjB,IAAI,EAAE,MAAM,CAAC;IACb,KAAK,CAAC,EAAE,MAAM,CAAC;CAChB;AAED;;GAEG;AACH,MAAM,WAAW,oBAAoB;IACnC,OAAO,EAAE,OAAO,CAAC;IACjB,wCAAwC;IACxC,QAAQ,EAAE,YAAY,EAAE,CAAC;IACzB,wCAAwC;IACxC,YAAY,EAAE,MAAM,EAAE,CAAC;IACvB,mCAAmC;IACnC,OAAO,EAAE,OAAO,CAAC;IACjB,KAAK,CAAC,EAAE,MAAM,CAAC;CAChB;AAyID;;GAEG;AACH,wBAAsB,eAAe,CACnC,OAAO,EAAE,QAAQ,EACjB,OAAO,EAAE,qBAAqB,GAC7B,OAAO,CAAC,oBAAoB,CAAC,CAiD/B"}
|
|
@@ -1,8 +1,14 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* Fulltext attach operation
|
|
3
|
+
*
|
|
4
|
+
* Uses attachments system internally with role='fulltext'.
|
|
3
5
|
*/
|
|
4
6
|
import type { ILibrary, IdentifierType } from "../../../core/library-interface.js";
|
|
5
|
-
import { type
|
|
7
|
+
import { type FulltextFormat } from "../fulltext-adapter/index.js";
|
|
8
|
+
/**
|
|
9
|
+
* Fulltext type (matches existing FulltextType for backward compatibility)
|
|
10
|
+
*/
|
|
11
|
+
export type FulltextType = FulltextFormat;
|
|
6
12
|
/**
|
|
7
13
|
* Options for fulltextAttach operation
|
|
8
14
|
*/
|
|
@@ -19,7 +25,7 @@ export interface FulltextAttachOptions {
|
|
|
19
25
|
force?: boolean | undefined;
|
|
20
26
|
/** Identifier type: 'id' (default), 'uuid', 'doi', 'pmid', or 'isbn' */
|
|
21
27
|
idType?: IdentifierType | undefined;
|
|
22
|
-
/** Directory for
|
|
28
|
+
/** Directory for attachments (replaces fulltextDirectory) */
|
|
23
29
|
fulltextDirectory: string;
|
|
24
30
|
/** Content from stdin */
|
|
25
31
|
stdinContent?: Buffer | undefined;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"attach.d.ts","sourceRoot":"","sources":["../../../../src/features/operations/fulltext/attach.ts"],"names":[],"mappings":"AAAA
|
|
1
|
+
{"version":3,"file":"attach.d.ts","sourceRoot":"","sources":["../../../../src/features/operations/fulltext/attach.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAMH,OAAO,KAAK,EAAE,QAAQ,EAAE,cAAc,EAAE,MAAM,oCAAoC,CAAC;AAEnF,OAAO,EAEL,KAAK,cAAc,EAEpB,MAAM,8BAA8B,CAAC;AAEtC;;GAEG;AACH,MAAM,MAAM,YAAY,GAAG,cAAc,CAAC;AAE1C;;GAEG;AACH,MAAM,WAAW,qBAAqB;IACpC,wCAAwC;IACxC,UAAU,EAAE,MAAM,CAAC;IACnB,iCAAiC;IACjC,QAAQ,CAAC,EAAE,MAAM,GAAG,SAAS,CAAC;IAC9B,2CAA2C;IAC3C,IAAI,CAAC,EAAE,YAAY,GAAG,SAAS,CAAC;IAChC,gCAAgC;IAChC,IAAI,CAAC,EAAE,OAAO,GAAG,SAAS,CAAC;IAC3B,oCAAoC;IACpC,KAAK,CAAC,EAAE,OAAO,GAAG,SAAS,CAAC;IAC5B,wEAAwE;IACxE,MAAM,CAAC,EAAE,cAAc,GAAG,SAAS,CAAC;IACpC,6DAA6D;IAC7D,iBAAiB,EAAE,MAAM,CAAC;IAC1B,yBAAyB;IACzB,YAAY,CAAC,EAAE,MAAM,GAAG,SAAS,CAAC;CACnC;AAED;;GAEG;AACH,MAAM,WAAW,oBAAoB;IACnC,OAAO,EAAE,OAAO,CAAC;IACjB,QAAQ,CAAC,EAAE,MAAM,GAAG,SAAS,CAAC;IAC9B,IAAI,CAAC,EAAE,YAAY,GAAG,SAAS,CAAC;IAChC,WAAW,CAAC,EAAE,OAAO,GAAG,SAAS,CAAC;IAClC,YAAY,CAAC,EAAE,MAAM,GAAG,SAAS,CAAC;IAClC,oBAAoB,CAAC,EAAE,OAAO,GAAG,SAAS,CAAC;IAC3C,KAAK,CAAC,EAAE,MAAM,GAAG,SAAS,CAAC;CAC5B;AAiHD;;;;;;GAMG;AACH,wBAAsB,cAAc,CAClC,OAAO,EAAE,QAAQ,EACjB,OAAO,EAAE,qBAAqB,GAC7B,OAAO,CAAC,oBAAoB,CAAC,CAuD/B"}
|
|
@@ -1,8 +1,14 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* Fulltext detach operation
|
|
3
|
+
*
|
|
4
|
+
* Uses attachments system internally with role='fulltext'.
|
|
3
5
|
*/
|
|
4
6
|
import type { ILibrary, IdentifierType } from "../../../core/library-interface.js";
|
|
5
|
-
import { type
|
|
7
|
+
import { type FulltextFormat } from "../fulltext-adapter/index.js";
|
|
8
|
+
/**
|
|
9
|
+
* Fulltext type (matches existing FulltextType for backward compatibility)
|
|
10
|
+
*/
|
|
11
|
+
export type FulltextType = FulltextFormat;
|
|
6
12
|
/**
|
|
7
13
|
* Options for fulltextDetach operation
|
|
8
14
|
*/
|
|
@@ -12,10 +18,10 @@ export interface FulltextDetachOptions {
|
|
|
12
18
|
/** Specific type to detach (pdf or markdown) */
|
|
13
19
|
type?: FulltextType | undefined;
|
|
14
20
|
/** Delete the file from disk */
|
|
15
|
-
|
|
21
|
+
removeFiles?: boolean | undefined;
|
|
16
22
|
/** Identifier type: 'id' (default), 'uuid', 'doi', 'pmid', or 'isbn' */
|
|
17
23
|
idType?: IdentifierType | undefined;
|
|
18
|
-
/** Directory for
|
|
24
|
+
/** Directory for attachments (replaces fulltextDirectory) */
|
|
19
25
|
fulltextDirectory: string;
|
|
20
26
|
}
|
|
21
27
|
/**
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"detach.d.ts","sourceRoot":"","sources":["../../../../src/features/operations/fulltext/detach.ts"],"names":[],"mappings":"AAAA
|
|
1
|
+
{"version":3,"file":"detach.d.ts","sourceRoot":"","sources":["../../../../src/features/operations/fulltext/detach.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAGH,OAAO,KAAK,EAAE,QAAQ,EAAE,cAAc,EAAE,MAAM,oCAAoC,CAAC;AAGnF,OAAO,EACL,KAAK,cAAc,EAIpB,MAAM,8BAA8B,CAAC;AAEtC;;GAEG;AACH,MAAM,MAAM,YAAY,GAAG,cAAc,CAAC;AAE1C;;GAEG;AACH,MAAM,WAAW,qBAAqB;IACpC,wCAAwC;IACxC,UAAU,EAAE,MAAM,CAAC;IACnB,gDAAgD;IAChD,IAAI,CAAC,EAAE,YAAY,GAAG,SAAS,CAAC;IAChC,gCAAgC;IAChC,WAAW,CAAC,EAAE,OAAO,GAAG,SAAS,CAAC;IAClC,wEAAwE;IACxE,MAAM,CAAC,EAAE,cAAc,GAAG,SAAS,CAAC;IACpC,6DAA6D;IAC7D,iBAAiB,EAAE,MAAM,CAAC;CAC3B;AAED;;GAEG;AACH,MAAM,WAAW,oBAAoB;IACnC,OAAO,EAAE,OAAO,CAAC;IACjB,QAAQ,CAAC,EAAE,YAAY,EAAE,CAAC;IAC1B,OAAO,CAAC,EAAE,YAAY,EAAE,CAAC;IACzB,KAAK,CAAC,EAAE,MAAM,CAAC;CAChB;AAyED;;;;;;GAMG;AACH,wBAAsB,cAAc,CAClC,OAAO,EAAE,QAAQ,EACjB,OAAO,EAAE,qBAAqB,GAC7B,OAAO,CAAC,oBAAoB,CAAC,CAoC/B"}
|
|
@@ -1,8 +1,14 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* Fulltext get operation
|
|
3
|
+
*
|
|
4
|
+
* Uses attachments system internally with role='fulltext'.
|
|
3
5
|
*/
|
|
4
6
|
import type { ILibrary, IdentifierType } from "../../../core/library-interface.js";
|
|
5
|
-
import { type
|
|
7
|
+
import { type FulltextFormat } from "../fulltext-adapter/index.js";
|
|
8
|
+
/**
|
|
9
|
+
* Fulltext type (matches existing FulltextType for backward compatibility)
|
|
10
|
+
*/
|
|
11
|
+
export type FulltextType = FulltextFormat;
|
|
6
12
|
/**
|
|
7
13
|
* Options for fulltextGet operation
|
|
8
14
|
*/
|
|
@@ -15,7 +21,7 @@ export interface FulltextGetOptions {
|
|
|
15
21
|
stdout?: boolean | undefined;
|
|
16
22
|
/** Identifier type: 'id' (default), 'uuid', 'doi', 'pmid', or 'isbn' */
|
|
17
23
|
idType?: IdentifierType | undefined;
|
|
18
|
-
/** Directory for
|
|
24
|
+
/** Directory for attachments (replaces fulltextDirectory) */
|
|
19
25
|
fulltextDirectory: string;
|
|
20
26
|
}
|
|
21
27
|
/**
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"get.d.ts","sourceRoot":"","sources":["../../../../src/features/operations/fulltext/get.ts"],"names":[],"mappings":"AAAA
|
|
1
|
+
{"version":3,"file":"get.d.ts","sourceRoot":"","sources":["../../../../src/features/operations/fulltext/get.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAKH,OAAO,KAAK,EAAE,QAAQ,EAAE,cAAc,EAAE,MAAM,oCAAoC,CAAC;AAGnF,OAAO,EACL,KAAK,cAAc,EAIpB,MAAM,8BAA8B,CAAC;AAEtC;;GAEG;AACH,MAAM,MAAM,YAAY,GAAG,cAAc,CAAC;AAE1C;;GAEG;AACH,MAAM,WAAW,kBAAkB;IACjC,wCAAwC;IACxC,UAAU,EAAE,MAAM,CAAC;IACnB,6CAA6C;IAC7C,IAAI,CAAC,EAAE,YAAY,GAAG,SAAS,CAAC;IAChC,mDAAmD;IACnD,MAAM,CAAC,EAAE,OAAO,GAAG,SAAS,CAAC;IAC7B,wEAAwE;IACxE,MAAM,CAAC,EAAE,cAAc,GAAG,SAAS,CAAC;IACpC,6DAA6D;IAC7D,iBAAiB,EAAE,MAAM,CAAC;CAC3B;AAED;;GAEG;AACH,MAAM,WAAW,iBAAiB;IAChC,OAAO,EAAE,OAAO,CAAC;IACjB,KAAK,CAAC,EAAE;QACN,GAAG,CAAC,EAAE,MAAM,CAAC;QACb,QAAQ,CAAC,EAAE,MAAM,CAAC;KACnB,CAAC;IACF,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,KAAK,CAAC,EAAE,MAAM,CAAC;CAChB;AAmFD;;;;;;GAMG;AACH,wBAAsB,WAAW,CAC/B,OAAO,EAAE,QAAQ,EACjB,OAAO,EAAE,kBAAkB,GAC1B,OAAO,CAAC,iBAAiB,CAAC,CAkC5B"}
|
|
@@ -1,8 +1,14 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* Fulltext open operation
|
|
3
|
+
*
|
|
4
|
+
* Uses attachments system internally with role='fulltext'.
|
|
3
5
|
*/
|
|
4
6
|
import type { ILibrary, IdentifierType } from "../../../core/library-interface.js";
|
|
5
|
-
import type
|
|
7
|
+
import { type FulltextFormat } from "../fulltext-adapter/index.js";
|
|
8
|
+
/**
|
|
9
|
+
* Fulltext type (matches existing FulltextType for backward compatibility)
|
|
10
|
+
*/
|
|
11
|
+
export type FulltextType = FulltextFormat;
|
|
6
12
|
/**
|
|
7
13
|
* Options for fulltextOpen operation
|
|
8
14
|
*/
|
|
@@ -13,7 +19,7 @@ export interface FulltextOpenOptions {
|
|
|
13
19
|
type?: FulltextType | undefined;
|
|
14
20
|
/** Identifier type: 'id' (default), 'uuid', 'doi', 'pmid', or 'isbn' */
|
|
15
21
|
idType?: IdentifierType | undefined;
|
|
16
|
-
/** Directory for
|
|
22
|
+
/** Directory for attachments (replaces fulltextDirectory) */
|
|
17
23
|
fulltextDirectory: string;
|
|
18
24
|
}
|
|
19
25
|
/**
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"open.d.ts","sourceRoot":"","sources":["../../../../src/features/operations/fulltext/open.ts"],"names":[],"mappings":"AAAA
|
|
1
|
+
{"version":3,"file":"open.d.ts","sourceRoot":"","sources":["../../../../src/features/operations/fulltext/open.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAKH,OAAO,KAAK,EAAE,QAAQ,EAAE,cAAc,EAAE,MAAM,oCAAoC,CAAC;AAGnF,OAAO,EACL,KAAK,cAAc,EAGpB,MAAM,8BAA8B,CAAC;AAEtC;;GAEG;AACH,MAAM,MAAM,YAAY,GAAG,cAAc,CAAC;AAE1C;;GAEG;AACH,MAAM,WAAW,mBAAmB;IAClC,wCAAwC;IACxC,UAAU,EAAE,MAAM,CAAC;IACnB,8CAA8C;IAC9C,IAAI,CAAC,EAAE,YAAY,GAAG,SAAS,CAAC;IAChC,wEAAwE;IACxE,MAAM,CAAC,EAAE,cAAc,GAAG,SAAS,CAAC;IACpC,6DAA6D;IAC7D,iBAAiB,EAAE,MAAM,CAAC;CAC3B;AAED;;GAEG;AACH,MAAM,WAAW,kBAAkB;IACjC,OAAO,EAAE,OAAO,CAAC;IACjB,UAAU,CAAC,EAAE,YAAY,CAAC;IAC1B,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,KAAK,CAAC,EAAE,MAAM,CAAC;CAChB;AA4BD;;;;;;GAMG;AACH,wBAAsB,YAAY,CAChC,OAAO,EAAE,QAAQ,EACjB,OAAO,EAAE,mBAAmB,GAC3B,OAAO,CAAC,kBAAkB,CAAC,CAoD7B"}
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Fulltext-to-attachments adapter utilities
|
|
3
|
+
*
|
|
4
|
+
* Maps fulltext command options and data to the new attachments system.
|
|
5
|
+
* This adapter enables the fulltext command to use attachments backend
|
|
6
|
+
* while maintaining backward-compatible interface.
|
|
7
|
+
*/
|
|
8
|
+
import type { AttachmentFile, Attachments } from "../../attachments/types.js";
|
|
9
|
+
/**
|
|
10
|
+
* The role used for fulltext files in the attachments system
|
|
11
|
+
*/
|
|
12
|
+
export declare const FULLTEXT_ROLE: "fulltext";
|
|
13
|
+
/**
|
|
14
|
+
* Fulltext format type (matching existing FulltextType)
|
|
15
|
+
*/
|
|
16
|
+
export type FulltextFormat = "pdf" | "markdown";
|
|
17
|
+
/**
|
|
18
|
+
* Convert fulltext format to file extension
|
|
19
|
+
*/
|
|
20
|
+
export declare function formatToExtension(format: FulltextFormat): string;
|
|
21
|
+
/**
|
|
22
|
+
* Convert file extension to fulltext format
|
|
23
|
+
* Returns undefined if extension is not a valid fulltext format
|
|
24
|
+
*/
|
|
25
|
+
export declare function extensionToFormat(ext: string): FulltextFormat | undefined;
|
|
26
|
+
/**
|
|
27
|
+
* Get the standard filename for a fulltext file
|
|
28
|
+
* Following the naming convention: fulltext.{ext}
|
|
29
|
+
*/
|
|
30
|
+
export declare function getFulltextFilename(format: FulltextFormat): string;
|
|
31
|
+
/**
|
|
32
|
+
* Find a fulltext file of specific format in attachments
|
|
33
|
+
*/
|
|
34
|
+
export declare function findFulltextFile(attachments: Attachments | undefined, format: FulltextFormat): AttachmentFile | undefined;
|
|
35
|
+
/**
|
|
36
|
+
* Find all fulltext files in attachments
|
|
37
|
+
*/
|
|
38
|
+
export declare function findFulltextFiles(attachments: Attachments | undefined): AttachmentFile[];
|
|
39
|
+
//# sourceMappingURL=fulltext-adapter.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"fulltext-adapter.d.ts","sourceRoot":"","sources":["../../../../src/features/operations/fulltext-adapter/fulltext-adapter.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH,OAAO,KAAK,EAAE,cAAc,EAAE,WAAW,EAAE,MAAM,4BAA4B,CAAC;AAG9E;;GAEG;AACH,eAAO,MAAM,aAAa,EAAG,UAAmB,CAAC;AAEjD;;GAEG;AACH,MAAM,MAAM,cAAc,GAAG,KAAK,GAAG,UAAU,CAAC;AAEhD;;GAEG;AACH,wBAAgB,iBAAiB,CAAC,MAAM,EAAE,cAAc,GAAG,MAAM,CAEhE;AAED;;;GAGG;AACH,wBAAgB,iBAAiB,CAAC,GAAG,EAAE,MAAM,GAAG,cAAc,GAAG,SAAS,CAKzE;AAED;;;GAGG;AACH,wBAAgB,mBAAmB,CAAC,MAAM,EAAE,cAAc,GAAG,MAAM,CAGlE;AAED;;GAEG;AACH,wBAAgB,gBAAgB,CAC9B,WAAW,EAAE,WAAW,GAAG,SAAS,EACpC,MAAM,EAAE,cAAc,GACrB,cAAc,GAAG,SAAS,CAc5B;AAED;;GAEG;AACH,wBAAgB,iBAAiB,CAAC,WAAW,EAAE,WAAW,GAAG,SAAS,GAAG,cAAc,EAAE,CAMxF"}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Fulltext-to-attachments adapter module
|
|
3
|
+
*
|
|
4
|
+
* Provides utilities for mapping fulltext operations to attachments backend.
|
|
5
|
+
*/
|
|
6
|
+
export { FULLTEXT_ROLE, type FulltextFormat, formatToExtension, extensionToFormat, getFulltextFilename, findFulltextFile, findFulltextFiles, } from "./fulltext-adapter.js";
|
|
7
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/features/operations/fulltext-adapter/index.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,EACL,aAAa,EACb,KAAK,cAAc,EACnB,iBAAiB,EACjB,iBAAiB,EACjB,mBAAmB,EACnB,gBAAgB,EAChB,iBAAiB,GAClB,MAAM,uBAAuB,CAAC"}
|
|
@@ -12,6 +12,7 @@ export type { SearchOperationOptions, SearchResult } from "./search.js";
|
|
|
12
12
|
export type { ListOptions, ListResult } from "./list.js";
|
|
13
13
|
export type { CiteOperationOptions, CiteResult, CiteItemResult } from "./cite.js";
|
|
14
14
|
export type { AddReferencesOptions, AddReferencesResult } from "./add.js";
|
|
15
|
+
export type { AddAttachmentOptions, AddAttachmentResult, ListAttachmentsOptions, ListAttachmentsResult, GetAttachmentOptions, GetAttachmentResult, DetachAttachmentOptions, DetachAttachmentResult, SyncAttachmentOptions, SyncAttachmentResult, OpenAttachmentOptions, OpenAttachmentResult, } from "./attachments/index.js";
|
|
15
16
|
export type { AddJsonOutput, RemoveJsonOutput, UpdateJsonOutput, } from "./json-output.js";
|
|
16
17
|
export { formatAddJsonOutput, formatRemoveJsonOutput, formatUpdateJsonOutput, } from "./json-output.js";
|
|
17
18
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/features/operations/index.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAGH,YAAY,EACV,kBAAkB,EAClB,aAAa,EACb,YAAY,GACb,MAAM,yBAAyB,CAAC;AAGjC,OAAO,EAAE,iBAAiB,EAAE,MAAM,yBAAyB,CAAC;AAG5D,YAAY,EAAE,sBAAsB,EAAE,YAAY,EAAE,MAAM,aAAa,CAAC;AACxE,YAAY,EAAE,WAAW,EAAE,UAAU,EAAE,MAAM,WAAW,CAAC;AACzD,YAAY,EAAE,oBAAoB,EAAE,UAAU,EAAE,cAAc,EAAE,MAAM,WAAW,CAAC;AAClF,YAAY,EAAE,oBAAoB,EAAE,mBAAmB,EAAE,MAAM,UAAU,CAAC;AAG1E,YAAY,EACV,aAAa,EACb,gBAAgB,EAChB,gBAAgB,GACjB,MAAM,kBAAkB,CAAC;AAC1B,OAAO,EACL,mBAAmB,EACnB,sBAAsB,EACtB,sBAAsB,GACvB,MAAM,kBAAkB,CAAC"}
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/features/operations/index.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAGH,YAAY,EACV,kBAAkB,EAClB,aAAa,EACb,YAAY,GACb,MAAM,yBAAyB,CAAC;AAGjC,OAAO,EAAE,iBAAiB,EAAE,MAAM,yBAAyB,CAAC;AAG5D,YAAY,EAAE,sBAAsB,EAAE,YAAY,EAAE,MAAM,aAAa,CAAC;AACxE,YAAY,EAAE,WAAW,EAAE,UAAU,EAAE,MAAM,WAAW,CAAC;AACzD,YAAY,EAAE,oBAAoB,EAAE,UAAU,EAAE,cAAc,EAAE,MAAM,WAAW,CAAC;AAClF,YAAY,EAAE,oBAAoB,EAAE,mBAAmB,EAAE,MAAM,UAAU,CAAC;AAG1E,YAAY,EACV,oBAAoB,EACpB,mBAAmB,EACnB,sBAAsB,EACtB,qBAAqB,EACrB,oBAAoB,EACpB,mBAAmB,EACnB,uBAAuB,EACvB,sBAAsB,EACtB,qBAAqB,EACrB,oBAAoB,EACpB,qBAAqB,EACrB,oBAAoB,GACrB,MAAM,wBAAwB,CAAC;AAGhC,YAAY,EACV,aAAa,EACb,gBAAgB,EAChB,gBAAgB,GACjB,MAAM,kBAAkB,CAAC;AAC1B,OAAO,EACL,mBAAmB,EACnB,sBAAsB,EACtB,sBAAsB,GACvB,MAAM,kBAAkB,CAAC"}
|