@ncukondo/reference-manager 0.3.0 → 0.4.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 +267 -109
- package/dist/chunks/file-watcher-B-SiUw5f.js +1557 -0
- package/dist/chunks/file-watcher-B-SiUw5f.js.map +1 -0
- package/dist/chunks/{search-Be9vzUIH.js → index-DLIGxQaB.js} +399 -89
- package/dist/chunks/index-DLIGxQaB.js.map +1 -0
- package/dist/chunks/loader-DuzyKV70.js +394 -0
- package/dist/chunks/loader-DuzyKV70.js.map +1 -0
- package/dist/cli/commands/add.d.ts +3 -3
- package/dist/cli/commands/add.d.ts.map +1 -1
- package/dist/cli/commands/cite.d.ts +3 -3
- package/dist/cli/commands/cite.d.ts.map +1 -1
- package/dist/cli/commands/fulltext.d.ts +5 -34
- package/dist/cli/commands/fulltext.d.ts.map +1 -1
- package/dist/cli/commands/list.d.ts +3 -3
- package/dist/cli/commands/list.d.ts.map +1 -1
- package/dist/cli/commands/mcp.d.ts +16 -0
- package/dist/cli/commands/mcp.d.ts.map +1 -0
- package/dist/cli/commands/remove.d.ts +3 -3
- package/dist/cli/commands/remove.d.ts.map +1 -1
- package/dist/cli/commands/search.d.ts +3 -3
- package/dist/cli/commands/search.d.ts.map +1 -1
- package/dist/cli/commands/server.d.ts +2 -0
- package/dist/cli/commands/server.d.ts.map +1 -1
- package/dist/cli/commands/update.d.ts +3 -3
- package/dist/cli/commands/update.d.ts.map +1 -1
- package/dist/cli/execution-context.d.ts +23 -36
- package/dist/cli/execution-context.d.ts.map +1 -1
- package/dist/cli/index.d.ts.map +1 -1
- package/dist/cli/server-client.d.ts +24 -40
- package/dist/cli/server-client.d.ts.map +1 -1
- package/dist/cli/server-detection.d.ts +1 -0
- package/dist/cli/server-detection.d.ts.map +1 -1
- package/dist/cli.js +21060 -317
- package/dist/cli.js.map +1 -1
- package/dist/config/defaults.d.ts.map +1 -1
- package/dist/config/loader.d.ts.map +1 -1
- package/dist/config/schema.d.ts +2 -3
- package/dist/config/schema.d.ts.map +1 -1
- package/dist/core/csl-json/types.d.ts +3 -0
- package/dist/core/csl-json/types.d.ts.map +1 -1
- package/dist/core/library-interface.d.ts +100 -0
- package/dist/core/library-interface.d.ts.map +1 -0
- package/dist/core/library.d.ts +29 -46
- package/dist/core/library.d.ts.map +1 -1
- package/dist/features/operations/add.d.ts +2 -2
- package/dist/features/operations/add.d.ts.map +1 -1
- package/dist/features/operations/cite.d.ts +2 -2
- package/dist/features/operations/cite.d.ts.map +1 -1
- package/dist/features/operations/fulltext/attach.d.ts +47 -0
- package/dist/features/operations/fulltext/attach.d.ts.map +1 -0
- package/dist/features/operations/fulltext/detach.d.ts +38 -0
- package/dist/features/operations/fulltext/detach.d.ts.map +1 -0
- package/dist/features/operations/fulltext/get.d.ts +41 -0
- package/dist/features/operations/fulltext/get.d.ts.map +1 -0
- package/dist/features/operations/fulltext/index.d.ts +9 -0
- package/dist/features/operations/fulltext/index.d.ts.map +1 -0
- package/dist/features/operations/index.d.ts +15 -0
- package/dist/features/operations/index.d.ts.map +1 -0
- package/dist/features/operations/library-operations.d.ts +64 -0
- package/dist/features/operations/library-operations.d.ts.map +1 -0
- package/dist/features/operations/list.d.ts +2 -2
- package/dist/features/operations/list.d.ts.map +1 -1
- package/dist/features/operations/operations-library.d.ts +36 -0
- package/dist/features/operations/operations-library.d.ts.map +1 -0
- package/dist/features/operations/remove.d.ts +4 -4
- package/dist/features/operations/remove.d.ts.map +1 -1
- package/dist/features/operations/search.d.ts +2 -2
- package/dist/features/operations/search.d.ts.map +1 -1
- package/dist/features/operations/update.d.ts +2 -2
- package/dist/features/operations/update.d.ts.map +1 -1
- package/dist/features/search/matcher.d.ts.map +1 -1
- package/dist/features/search/normalizer.d.ts +12 -0
- package/dist/features/search/normalizer.d.ts.map +1 -1
- package/dist/features/search/tokenizer.d.ts.map +1 -1
- package/dist/features/search/types.d.ts +1 -1
- package/dist/features/search/types.d.ts.map +1 -1
- package/dist/features/search/uppercase.d.ts +41 -0
- package/dist/features/search/uppercase.d.ts.map +1 -0
- package/dist/index.js +24 -192
- package/dist/index.js.map +1 -1
- package/dist/mcp/context.d.ts +19 -0
- package/dist/mcp/context.d.ts.map +1 -0
- package/dist/mcp/index.d.ts +20 -0
- package/dist/mcp/index.d.ts.map +1 -0
- package/dist/mcp/resources/index.d.ts +10 -0
- package/dist/mcp/resources/index.d.ts.map +1 -0
- package/dist/mcp/resources/library.d.ts +26 -0
- package/dist/mcp/resources/library.d.ts.map +1 -0
- package/dist/mcp/tools/add.d.ts +17 -0
- package/dist/mcp/tools/add.d.ts.map +1 -0
- package/dist/mcp/tools/cite.d.ts +15 -0
- package/dist/mcp/tools/cite.d.ts.map +1 -0
- package/dist/mcp/tools/fulltext.d.ts +51 -0
- package/dist/mcp/tools/fulltext.d.ts.map +1 -0
- package/dist/mcp/tools/index.d.ts +12 -0
- package/dist/mcp/tools/index.d.ts.map +1 -0
- package/dist/mcp/tools/list.d.ts +13 -0
- package/dist/mcp/tools/list.d.ts.map +1 -0
- package/dist/mcp/tools/remove.d.ts +19 -0
- package/dist/mcp/tools/remove.d.ts.map +1 -0
- package/dist/mcp/tools/search.d.ts +13 -0
- package/dist/mcp/tools/search.d.ts.map +1 -0
- package/dist/server/index.d.ts +23 -1
- package/dist/server/index.d.ts.map +1 -1
- package/dist/server/routes/references.d.ts.map +1 -1
- package/dist/server.js +5 -271
- package/dist/server.js.map +1 -1
- package/package.json +2 -1
- package/dist/chunks/detector-DHztTaFY.js +0 -619
- package/dist/chunks/detector-DHztTaFY.js.map +0 -1
- package/dist/chunks/loader-mQ25o6cV.js +0 -1054
- package/dist/chunks/loader-mQ25o6cV.js.map +0 -1
- package/dist/chunks/search-Be9vzUIH.js.map +0 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"defaults.d.ts","sourceRoot":"","sources":["../../src/config/defaults.ts"],"names":[],"mappings":"AAAA;;GAEG;AAKH,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,aAAa,CAAC;AAE1C;;;GAGG;AACH,wBAAgB,yBAAyB,IAAI,MAAM,CAElD;AAED;;;GAGG;AACH,wBAAgB,qBAAqB,IAAI,MAAM,CAE9C;AAED;;;GAGG;AACH,wBAAgB,wBAAwB,IAAI,MAAM,CAEjD;AAED;;;GAGG;AACH,wBAAgB,kCAAkC,IAAI,MAAM,CAE3D;AAED;;;GAGG;AACH,wBAAgB,sBAAsB,IAAI,MAAM,CAE/C;AAED;;;GAGG;AACH,wBAAgB,2BAA2B,IAAI,MAAM,CAEpD;AAED;;GAEG;AACH,eAAO,MAAM,aAAa,EAAE,
|
|
1
|
+
{"version":3,"file":"defaults.d.ts","sourceRoot":"","sources":["../../src/config/defaults.ts"],"names":[],"mappings":"AAAA;;GAEG;AAKH,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,aAAa,CAAC;AAE1C;;;GAGG;AACH,wBAAgB,yBAAyB,IAAI,MAAM,CAElD;AAED;;;GAGG;AACH,wBAAgB,qBAAqB,IAAI,MAAM,CAE9C;AAED;;;GAGG;AACH,wBAAgB,wBAAwB,IAAI,MAAM,CAEjD;AAED;;;GAGG;AACH,wBAAgB,kCAAkC,IAAI,MAAM,CAE3D;AAED;;;GAGG;AACH,wBAAgB,sBAAsB,IAAI,MAAM,CAE/C;AAED;;;GAGG;AACH,wBAAgB,2BAA2B,IAAI,MAAM,CAEpD;AAED;;GAEG;AACH,eAAO,MAAM,aAAa,EAAE,MA+B3B,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"loader.d.ts","sourceRoot":"","sources":["../../src/config/loader.ts"],"names":[],"mappings":"AAAA;;GAEG;AAWH,OAAO,EACL,KAAK,MAAM,EAMZ,MAAM,aAAa,CAAC;AAErB;;GAEG;AACH,MAAM,WAAW,iBAAiB;IAChC,yDAAyD;IACzD,GAAG,CAAC,EAAE,MAAM,CAAC;IACb,mEAAmE;IACnE,cAAc,CAAC,EAAE,MAAM,CAAC;IACxB,6BAA6B;IAC7B,SAAS,CAAC,EAAE,OAAO,CAAC,MAAM,CAAC,CAAC;CAC7B;
|
|
1
|
+
{"version":3,"file":"loader.d.ts","sourceRoot":"","sources":["../../src/config/loader.ts"],"names":[],"mappings":"AAAA;;GAEG;AAWH,OAAO,EACL,KAAK,MAAM,EAMZ,MAAM,aAAa,CAAC;AAErB;;GAEG;AACH,MAAM,WAAW,iBAAiB;IAChC,yDAAyD;IACzD,GAAG,CAAC,EAAE,MAAM,CAAC;IACb,mEAAmE;IACnE,cAAc,CAAC,EAAE,MAAM,CAAC;IACxB,6BAA6B;IAC7B,SAAS,CAAC,EAAE,OAAO,CAAC,MAAM,CAAC,CAAC;CAC7B;AA8ID;;;;;;;;;GASG;AACH,wBAAgB,UAAU,CAAC,OAAO,GAAE,iBAAsB,GAAG,MAAM,CAwClE"}
|
package/dist/config/schema.d.ts
CHANGED
|
@@ -20,9 +20,10 @@ export declare const backupConfigSchema: z.ZodObject<{
|
|
|
20
20
|
}, z.core.$strip>;
|
|
21
21
|
/**
|
|
22
22
|
* File watching configuration schema
|
|
23
|
+
* Note: File watching is always enabled in server mode (HTTP/MCP).
|
|
24
|
+
* CLI mode does not use file watching.
|
|
23
25
|
*/
|
|
24
26
|
export declare const watchConfigSchema: z.ZodObject<{
|
|
25
|
-
enabled: z.ZodBoolean;
|
|
26
27
|
debounceMs: z.ZodNumber;
|
|
27
28
|
pollIntervalMs: z.ZodNumber;
|
|
28
29
|
retryIntervalMs: z.ZodNumber;
|
|
@@ -85,7 +86,6 @@ export declare const configSchema: z.ZodObject<{
|
|
|
85
86
|
directory: z.ZodString;
|
|
86
87
|
}, z.core.$strip>;
|
|
87
88
|
watch: z.ZodObject<{
|
|
88
|
-
enabled: z.ZodBoolean;
|
|
89
89
|
debounceMs: z.ZodNumber;
|
|
90
90
|
pollIntervalMs: z.ZodNumber;
|
|
91
91
|
retryIntervalMs: z.ZodNumber;
|
|
@@ -137,7 +137,6 @@ export declare const partialConfigSchema: z.ZodObject<{
|
|
|
137
137
|
directory: z.ZodOptional<z.ZodString>;
|
|
138
138
|
}, z.core.$strip>>;
|
|
139
139
|
watch: z.ZodOptional<z.ZodObject<{
|
|
140
|
-
enabled: z.ZodOptional<z.ZodBoolean>;
|
|
141
140
|
debounceMs: z.ZodOptional<z.ZodNumber>;
|
|
142
141
|
debounce_ms: z.ZodOptional<z.ZodNumber>;
|
|
143
142
|
pollIntervalMs: z.ZodOptional<z.ZodNumber>;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"schema.d.ts","sourceRoot":"","sources":["../../src/config/schema.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAExB;;GAEG;AACH,eAAO,MAAM,cAAc;;;;EAAsC,CAAC;AAElE;;GAEG;AACH,eAAO,MAAM,kBAAkB;;;;iBAI7B,CAAC;AAEH
|
|
1
|
+
{"version":3,"file":"schema.d.ts","sourceRoot":"","sources":["../../src/config/schema.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAExB;;GAEG;AACH,eAAO,MAAM,cAAc;;;;EAAsC,CAAC;AAElE;;GAEG;AACH,eAAO,MAAM,kBAAkB;;;;iBAI7B,CAAC;AAEH;;;;GAIG;AACH,eAAO,MAAM,iBAAiB;;;;;iBAK5B,CAAC;AAEH;;GAEG;AACH,eAAO,MAAM,kBAAkB;;;iBAG7B,CAAC;AAEH;;GAEG;AACH,eAAO,MAAM,oBAAoB;;;;EAAkC,CAAC;AAEpE;;GAEG;AACH,eAAO,MAAM,oBAAoB;;;;;;;;;iBAK/B,CAAC;AAEH;;GAEG;AACH,eAAO,MAAM,kBAAkB;;;iBAG7B,CAAC;AAEH;;GAEG;AACH,eAAO,MAAM,oBAAoB;;iBAE/B,CAAC;AAEH;;GAEG;AACH,eAAO,MAAM,YAAY;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;iBASvB,CAAC;AAEH;;;GAGG;AACH,eAAO,MAAM,mBAAmB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;iBA2DhB,CAAC;AAEjB;;GAEG;AACH,MAAM,MAAM,QAAQ,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,cAAc,CAAC,CAAC;AACtD,MAAM,MAAM,YAAY,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,kBAAkB,CAAC,CAAC;AAC9D,MAAM,MAAM,WAAW,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,iBAAiB,CAAC,CAAC;AAC5D,MAAM,MAAM,YAAY,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,kBAAkB,CAAC,CAAC;AAC9D,MAAM,MAAM,cAAc,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,oBAAoB,CAAC,CAAC;AAClE,MAAM,MAAM,cAAc,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,oBAAoB,CAAC,CAAC;AAClE,MAAM,MAAM,YAAY,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,kBAAkB,CAAC,CAAC;AAC9D,MAAM,MAAM,cAAc,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,oBAAoB,CAAC,CAAC;AAClE,MAAM,MAAM,MAAM,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,YAAY,CAAC,CAAC;AAClD,MAAM,MAAM,aAAa,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,mBAAmB,CAAC,CAAC;AAEhE;;GAEG;AACH,MAAM,MAAM,iBAAiB,GAAG;IAC9B,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,QAAQ,CAAC,EAAE,QAAQ,CAAC;IACpB,MAAM,CAAC,EAAE,OAAO,CAAC,YAAY,CAAC,CAAC;IAC/B,KAAK,CAAC,EAAE,OAAO,CAAC,WAAW,CAAC,CAAC;IAC7B,MAAM,CAAC,EAAE,OAAO,CAAC,YAAY,CAAC,CAAC;IAC/B,QAAQ,CAAC,EAAE,OAAO,CAAC,cAAc,CAAC,CAAC;IACnC,MAAM,CAAC,EAAE,OAAO,CAAC,YAAY,CAAC,CAAC;IAC/B,QAAQ,CAAC,EAAE,OAAO,CAAC,cAAc,CAAC,CAAC;CACpC,CAAC;AAoKF;;GAEG;AACH,wBAAgB,sBAAsB,CAAC,OAAO,EAAE,aAAa,GAAG,iBAAiB,CAmEhF"}
|
|
@@ -8,6 +8,7 @@ declare const CslCustomSchema: z.ZodObject<{
|
|
|
8
8
|
pdf: z.ZodOptional<z.ZodString>;
|
|
9
9
|
markdown: z.ZodOptional<z.ZodString>;
|
|
10
10
|
}, z.core.$strip>>;
|
|
11
|
+
tags: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
11
12
|
}, z.core.$loose>;
|
|
12
13
|
export declare const CslItemSchema: z.ZodObject<{
|
|
13
14
|
id: z.ZodString;
|
|
@@ -67,6 +68,7 @@ export declare const CslItemSchema: z.ZodObject<{
|
|
|
67
68
|
pdf: z.ZodOptional<z.ZodString>;
|
|
68
69
|
markdown: z.ZodOptional<z.ZodString>;
|
|
69
70
|
}, z.core.$strip>>;
|
|
71
|
+
tags: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
70
72
|
}, z.core.$loose>>;
|
|
71
73
|
}, z.core.$loose>;
|
|
72
74
|
export declare const CslLibrarySchema: z.ZodArray<z.ZodObject<{
|
|
@@ -127,6 +129,7 @@ export declare const CslLibrarySchema: z.ZodArray<z.ZodObject<{
|
|
|
127
129
|
pdf: z.ZodOptional<z.ZodString>;
|
|
128
130
|
markdown: z.ZodOptional<z.ZodString>;
|
|
129
131
|
}, z.core.$strip>>;
|
|
132
|
+
tags: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
130
133
|
}, z.core.$loose>>;
|
|
131
134
|
}, z.core.$loose>>;
|
|
132
135
|
export type CslCustom = z.infer<typeof CslCustomSchema>;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../src/core/csl-json/types.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AA4BxB,QAAA,MAAM,eAAe
|
|
1
|
+
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../src/core/csl-json/types.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AA4BxB,QAAA,MAAM,eAAe;;;;;;;;;;iBASL,CAAC;AAGjB,eAAO,MAAM,aAAa;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;iBA2BV,CAAC;AAGjB,eAAO,MAAM,gBAAgB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;kBAAyB,CAAC;AAEvD,MAAM,MAAM,SAAS,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,eAAe,CAAC,CAAC;AACxD,MAAM,MAAM,OAAO,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,aAAa,CAAC,CAAC;AACpD,MAAM,MAAM,UAAU,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,gBAAgB,CAAC,CAAC"}
|
|
@@ -0,0 +1,100 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* ILibrary - Common interface for library implementations.
|
|
3
|
+
*
|
|
4
|
+
* Both Library (local file-based) and ServerClient (HTTP-based) implement this interface,
|
|
5
|
+
* allowing operations to work with either implementation interchangeably.
|
|
6
|
+
*
|
|
7
|
+
* Design notes:
|
|
8
|
+
* - All methods are async to support HTTP-based implementations (ServerClient)
|
|
9
|
+
* - Methods return CslItem directly (not Reference) for simplicity and HTTP compatibility
|
|
10
|
+
* - Library internally uses Reference for ID generation and indexing, but exposes CslItem via ILibrary
|
|
11
|
+
* - ServerClient naturally returns CslItem from HTTP responses
|
|
12
|
+
*/
|
|
13
|
+
import type { CslItem } from "./csl-json/types.js";
|
|
14
|
+
/**
|
|
15
|
+
* Options for find operations.
|
|
16
|
+
*/
|
|
17
|
+
export interface FindOptions {
|
|
18
|
+
/** If true, treat the identifier as UUID; otherwise treat as citation ID (default: false) */
|
|
19
|
+
byUuid?: boolean;
|
|
20
|
+
}
|
|
21
|
+
/**
|
|
22
|
+
* Options for remove operations.
|
|
23
|
+
* Currently identical to FindOptions, but defined separately for clarity and future extensibility.
|
|
24
|
+
*/
|
|
25
|
+
export type RemoveOptions = FindOptions;
|
|
26
|
+
/**
|
|
27
|
+
* Result of a remove operation.
|
|
28
|
+
*/
|
|
29
|
+
export interface RemoveResult {
|
|
30
|
+
/** Whether the removal was successful */
|
|
31
|
+
removed: boolean;
|
|
32
|
+
/** The removed item (only when removed=true, may be undefined if not available from server) */
|
|
33
|
+
removedItem?: CslItem;
|
|
34
|
+
}
|
|
35
|
+
export interface UpdateOptions {
|
|
36
|
+
/** How to handle ID collision: 'fail' (default) or 'suffix' */
|
|
37
|
+
onIdCollision?: "fail" | "suffix";
|
|
38
|
+
/** If true, treat the identifier as UUID; otherwise treat as citation ID (default: false) */
|
|
39
|
+
byUuid?: boolean;
|
|
40
|
+
}
|
|
41
|
+
/**
|
|
42
|
+
* Result of an update operation.
|
|
43
|
+
*/
|
|
44
|
+
export interface UpdateResult {
|
|
45
|
+
/** Whether the update was successful */
|
|
46
|
+
updated: boolean;
|
|
47
|
+
/** The updated item (only when updated=true) */
|
|
48
|
+
item?: CslItem;
|
|
49
|
+
/** True if ID collision occurred (only when updated=false and onIdCollision='fail') */
|
|
50
|
+
idCollision?: boolean;
|
|
51
|
+
/** True if the ID was changed due to collision resolution */
|
|
52
|
+
idChanged?: boolean;
|
|
53
|
+
/** The new ID after collision resolution (only when idChanged=true) */
|
|
54
|
+
newId?: string;
|
|
55
|
+
}
|
|
56
|
+
/**
|
|
57
|
+
* Common interface for library implementations.
|
|
58
|
+
*/
|
|
59
|
+
export interface ILibrary {
|
|
60
|
+
/**
|
|
61
|
+
* Find a reference by citation ID or UUID.
|
|
62
|
+
* @param identifier - The citation ID or UUID of the reference to find
|
|
63
|
+
* @param options - Find options (byUuid to use UUID lookup)
|
|
64
|
+
* @returns The CSL item if found, undefined otherwise
|
|
65
|
+
*/
|
|
66
|
+
find(identifier: string, options?: FindOptions): Promise<CslItem | undefined>;
|
|
67
|
+
/**
|
|
68
|
+
* Get all references.
|
|
69
|
+
* @returns Array of all CSL items in the library
|
|
70
|
+
*/
|
|
71
|
+
getAll(): Promise<CslItem[]>;
|
|
72
|
+
/**
|
|
73
|
+
* Add a new reference to the library.
|
|
74
|
+
* @param item - The CSL item to add
|
|
75
|
+
* @returns The added CSL item (with generated ID and UUID if not present)
|
|
76
|
+
*/
|
|
77
|
+
add(item: CslItem): Promise<CslItem>;
|
|
78
|
+
/**
|
|
79
|
+
* Update a reference by citation ID or UUID.
|
|
80
|
+
* @param identifier - The citation ID or UUID of the reference to update
|
|
81
|
+
* @param updates - Partial CSL item with fields to update
|
|
82
|
+
* @param options - Update options (byUuid to use UUID lookup, onIdCollision for collision handling)
|
|
83
|
+
* @returns Update result indicating success/failure, updated item, and any ID changes
|
|
84
|
+
*/
|
|
85
|
+
update(identifier: string, updates: Partial<CslItem>, options?: UpdateOptions): Promise<UpdateResult>;
|
|
86
|
+
/**
|
|
87
|
+
* Remove a reference by citation ID or UUID.
|
|
88
|
+
* @param identifier - The citation ID or UUID of the reference to remove
|
|
89
|
+
* @param options - Remove options (byUuid to use UUID lookup)
|
|
90
|
+
* @returns Remove result with removed status and optionally the removed item
|
|
91
|
+
*/
|
|
92
|
+
remove(identifier: string, options?: RemoveOptions): Promise<RemoveResult>;
|
|
93
|
+
/**
|
|
94
|
+
* Save the library to persistent storage.
|
|
95
|
+
* For Library: writes to file
|
|
96
|
+
* For ServerClient: no-op (HTTP requests are already persisted)
|
|
97
|
+
*/
|
|
98
|
+
save(): Promise<void>;
|
|
99
|
+
}
|
|
100
|
+
//# sourceMappingURL=library-interface.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"library-interface.d.ts","sourceRoot":"","sources":["../../src/core/library-interface.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;GAWG;AAEH,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,qBAAqB,CAAC;AAEnD;;GAEG;AACH,MAAM,WAAW,WAAW;IAC1B,6FAA6F;IAC7F,MAAM,CAAC,EAAE,OAAO,CAAC;CAClB;AAED;;;GAGG;AACH,MAAM,MAAM,aAAa,GAAG,WAAW,CAAC;AAExC;;GAEG;AACH,MAAM,WAAW,YAAY;IAC3B,yCAAyC;IACzC,OAAO,EAAE,OAAO,CAAC;IACjB,+FAA+F;IAC/F,WAAW,CAAC,EAAE,OAAO,CAAC;CACvB;AAED,MAAM,WAAW,aAAa;IAC5B,+DAA+D;IAC/D,aAAa,CAAC,EAAE,MAAM,GAAG,QAAQ,CAAC;IAClC,6FAA6F;IAC7F,MAAM,CAAC,EAAE,OAAO,CAAC;CAClB;AAED;;GAEG;AACH,MAAM,WAAW,YAAY;IAC3B,wCAAwC;IACxC,OAAO,EAAE,OAAO,CAAC;IACjB,gDAAgD;IAChD,IAAI,CAAC,EAAE,OAAO,CAAC;IACf,uFAAuF;IACvF,WAAW,CAAC,EAAE,OAAO,CAAC;IACtB,6DAA6D;IAC7D,SAAS,CAAC,EAAE,OAAO,CAAC;IACpB,uEAAuE;IACvE,KAAK,CAAC,EAAE,MAAM,CAAC;CAChB;AAED;;GAEG;AACH,MAAM,WAAW,QAAQ;IAKvB;;;;;OAKG;IACH,IAAI,CAAC,UAAU,EAAE,MAAM,EAAE,OAAO,CAAC,EAAE,WAAW,GAAG,OAAO,CAAC,OAAO,GAAG,SAAS,CAAC,CAAC;IAE9E;;;OAGG;IACH,MAAM,IAAI,OAAO,CAAC,OAAO,EAAE,CAAC,CAAC;IAM7B;;;;OAIG;IACH,GAAG,CAAC,IAAI,EAAE,OAAO,GAAG,OAAO,CAAC,OAAO,CAAC,CAAC;IAErC;;;;;;OAMG;IACH,MAAM,CACJ,UAAU,EAAE,MAAM,EAClB,OAAO,EAAE,OAAO,CAAC,OAAO,CAAC,EACzB,OAAO,CAAC,EAAE,aAAa,GACtB,OAAO,CAAC,YAAY,CAAC,CAAC;IAEzB;;;;;OAKG;IACH,MAAM,CAAC,UAAU,EAAE,MAAM,EAAE,OAAO,CAAC,EAAE,aAAa,GAAG,OAAO,CAAC,YAAY,CAAC,CAAC;IAM3E;;;;OAIG;IACH,IAAI,IAAI,OAAO,CAAC,IAAI,CAAC,CAAC;CACvB"}
|
package/dist/core/library.d.ts
CHANGED
|
@@ -1,29 +1,12 @@
|
|
|
1
1
|
import type { CslItem } from "./csl-json/types";
|
|
2
|
+
import type { FindOptions, ILibrary, RemoveOptions, RemoveResult, UpdateOptions, UpdateResult } from "./library-interface.js";
|
|
2
3
|
import { Reference } from "./reference";
|
|
4
|
+
export type { FindOptions, ILibrary, UpdateOptions, UpdateResult } from "./library-interface.js";
|
|
3
5
|
/**
|
|
4
|
-
*
|
|
6
|
+
* Library manager for CSL-JSON references.
|
|
7
|
+
* Implements ILibrary interface for use with operations layer.
|
|
5
8
|
*/
|
|
6
|
-
export
|
|
7
|
-
/** How to handle ID collision: 'fail' (default) or 'suffix' */
|
|
8
|
-
onIdCollision?: "fail" | "suffix";
|
|
9
|
-
}
|
|
10
|
-
/**
|
|
11
|
-
* Result of an update operation
|
|
12
|
-
*/
|
|
13
|
-
export interface UpdateResult {
|
|
14
|
-
/** Whether the update was successful */
|
|
15
|
-
updated: boolean;
|
|
16
|
-
/** True if ID collision occurred (only when updated=false and onIdCollision='fail') */
|
|
17
|
-
idCollision?: boolean;
|
|
18
|
-
/** True if the ID was changed due to collision resolution */
|
|
19
|
-
idChanged?: boolean;
|
|
20
|
-
/** The new ID after collision resolution (only when idChanged=true) */
|
|
21
|
-
newId?: string;
|
|
22
|
-
}
|
|
23
|
-
/**
|
|
24
|
-
* Library manager for CSL-JSON references
|
|
25
|
-
*/
|
|
26
|
-
export declare class Library {
|
|
9
|
+
export declare class Library implements ILibrary {
|
|
27
10
|
private filePath;
|
|
28
11
|
private references;
|
|
29
12
|
private currentHash;
|
|
@@ -41,39 +24,39 @@ export declare class Library {
|
|
|
41
24
|
*/
|
|
42
25
|
save(): Promise<void>;
|
|
43
26
|
/**
|
|
44
|
-
*
|
|
27
|
+
* Reloads the library from file if it was modified externally.
|
|
28
|
+
* Self-writes (detected via hash comparison) are skipped.
|
|
29
|
+
* @returns true if reload occurred, false if skipped (self-write detected)
|
|
45
30
|
*/
|
|
46
|
-
|
|
31
|
+
reload(): Promise<boolean>;
|
|
47
32
|
/**
|
|
48
|
-
*
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
/**
|
|
52
|
-
* Remove a reference by ID
|
|
33
|
+
* Add a reference to the library
|
|
34
|
+
* @param item - The CSL item to add
|
|
35
|
+
* @returns The added CSL item (with generated ID and UUID)
|
|
53
36
|
*/
|
|
54
|
-
|
|
37
|
+
add(item: CslItem): Promise<CslItem>;
|
|
55
38
|
/**
|
|
56
|
-
*
|
|
57
|
-
* @param
|
|
58
|
-
* @param
|
|
59
|
-
* @returns
|
|
39
|
+
* Remove a reference by citation ID or UUID.
|
|
40
|
+
* @param identifier - The citation ID or UUID of the reference to remove
|
|
41
|
+
* @param options - Remove options (byUuid to use UUID lookup)
|
|
42
|
+
* @returns Remove result with removed status and the removed item
|
|
60
43
|
*/
|
|
61
|
-
|
|
44
|
+
remove(identifier: string, options?: RemoveOptions): Promise<RemoveResult>;
|
|
62
45
|
/**
|
|
63
|
-
* Update a reference by ID.
|
|
64
|
-
* @param
|
|
46
|
+
* Update a reference by citation ID or UUID.
|
|
47
|
+
* @param identifier - The citation ID or UUID of the reference to update
|
|
65
48
|
* @param updates - Partial updates to apply to the reference
|
|
66
|
-
* @
|
|
67
|
-
|
|
68
|
-
updateById(id: string, updates: Partial<CslItem>, options?: UpdateOptions): UpdateResult;
|
|
69
|
-
/**
|
|
70
|
-
* Find a reference by UUID
|
|
49
|
+
* @param options - Update options (byUuid to use UUID lookup, onIdCollision for collision handling)
|
|
50
|
+
* @returns Update result with updated item, success status, and any ID changes
|
|
71
51
|
*/
|
|
72
|
-
|
|
52
|
+
update(identifier: string, updates: Partial<CslItem>, options?: UpdateOptions): Promise<UpdateResult>;
|
|
73
53
|
/**
|
|
74
|
-
* Find a reference by ID
|
|
54
|
+
* Find a reference by citation ID or UUID.
|
|
55
|
+
* @param identifier - The citation ID or UUID of the reference to find
|
|
56
|
+
* @param options - Find options (byUuid to use UUID lookup)
|
|
57
|
+
* @returns The CSL item if found, undefined otherwise
|
|
75
58
|
*/
|
|
76
|
-
|
|
59
|
+
find(identifier: string, options?: FindOptions): Promise<CslItem | undefined>;
|
|
77
60
|
/**
|
|
78
61
|
* Find a reference by DOI
|
|
79
62
|
*/
|
|
@@ -85,7 +68,7 @@ export declare class Library {
|
|
|
85
68
|
/**
|
|
86
69
|
* Get all references
|
|
87
70
|
*/
|
|
88
|
-
getAll():
|
|
71
|
+
getAll(): Promise<CslItem[]>;
|
|
89
72
|
/**
|
|
90
73
|
* Get the file path
|
|
91
74
|
*/
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"library.d.ts","sourceRoot":"","sources":["../../src/core/library.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,kBAAkB,CAAC;AAChD,OAAO,
|
|
1
|
+
{"version":3,"file":"library.d.ts","sourceRoot":"","sources":["../../src/core/library.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,kBAAkB,CAAC;AAChD,OAAO,KAAK,EACV,WAAW,EACX,QAAQ,EACR,aAAa,EACb,YAAY,EACZ,aAAa,EACb,YAAY,EACb,MAAM,wBAAwB,CAAC;AAChC,OAAO,EAAE,SAAS,EAAE,MAAM,aAAa,CAAC;AAGxC,YAAY,EAAE,WAAW,EAAE,QAAQ,EAAE,aAAa,EAAE,YAAY,EAAE,MAAM,wBAAwB,CAAC;AAEjG;;;GAGG;AACH,qBAAa,OAAQ,YAAW,QAAQ;IACtC,OAAO,CAAC,QAAQ,CAAS;IACzB,OAAO,CAAC,UAAU,CAAmB;IACrC,OAAO,CAAC,WAAW,CAAuB;IAG1C,OAAO,CAAC,SAAS,CAAqC;IACtD,OAAO,CAAC,OAAO,CAAqC;IACpD,OAAO,CAAC,QAAQ,CAAqC;IACrD,OAAO,CAAC,SAAS,CAAqC;IAEtD,OAAO;IAWP;;OAEG;WACU,IAAI,CAAC,QAAQ,EAAE,MAAM,GAAG,OAAO,CAAC,OAAO,CAAC;IAQrD;;OAEG;IACG,IAAI,IAAI,OAAO,CAAC,IAAI,CAAC;IAO3B;;;;OAIG;IACG,MAAM,IAAI,OAAO,CAAC,OAAO,CAAC;IA8BhC;;;;OAIG;IACG,GAAG,CAAC,IAAI,EAAE,OAAO,GAAG,OAAO,CAAC,OAAO,CAAC;IAe1C;;;;;OAKG;IACG,MAAM,CAAC,UAAU,EAAE,MAAM,EAAE,OAAO,GAAE,aAAkB,GAAG,OAAO,CAAC,YAAY,CAAC;IAWpF;;;;;;OAMG;IACG,MAAM,CACV,UAAU,EAAE,MAAM,EAClB,OAAO,EAAE,OAAO,CAAC,OAAO,CAAC,EACzB,OAAO,GAAE,aAAkB,GAC1B,OAAO,CAAC,YAAY,CAAC;IAWxB;;;;;OAKG;IACG,IAAI,CAAC,UAAU,EAAE,MAAM,EAAE,OAAO,GAAE,WAAgB,GAAG,OAAO,CAAC,OAAO,GAAG,SAAS,CAAC;IAMvF;;OAEG;IACH,SAAS,CAAC,GAAG,EAAE,MAAM,GAAG,SAAS,GAAG,SAAS;IAI7C;;OAEG;IACH,UAAU,CAAC,IAAI,EAAE,MAAM,GAAG,SAAS,GAAG,SAAS;IAI/C;;OAEG;IACG,MAAM,IAAI,OAAO,CAAC,OAAO,EAAE,CAAC;IAIlC;;OAEG;IACH,WAAW,IAAI,MAAM;IAIrB;;;OAGG;IACH,cAAc,IAAI,MAAM,GAAG,IAAI;IAI/B;;OAEG;IACH,OAAO,CAAC,YAAY;IAoBpB;;OAEG;IACH,OAAO,CAAC,eAAe;IAUvB;;;OAGG;IACH,OAAO,CAAC,eAAe;IAwCvB;;OAEG;IACH,OAAO,CAAC,YAAY;IA0BpB;;OAEG;IACH,OAAO,CAAC,gBAAgB;IAoBxB;;OAEG;IACH,OAAO,CAAC,iBAAiB;IAezB;;;OAGG;IACH,OAAO,CAAC,cAAc;IAatB;;OAEG;IACH,OAAO,CAAC,kBAAkB;CAgB3B"}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type {
|
|
1
|
+
import type { ILibrary } from "../../core/library-interface.js";
|
|
2
2
|
import type { InputFormat } from "../import/detector.js";
|
|
3
3
|
import type { PubmedConfig } from "../import/fetcher.js";
|
|
4
4
|
/**
|
|
@@ -61,5 +61,5 @@ export interface AddReferencesResult {
|
|
|
61
61
|
* @param options - Add options
|
|
62
62
|
* @returns Result with added, failed, and skipped items
|
|
63
63
|
*/
|
|
64
|
-
export declare function addReferences(inputs: string[], library:
|
|
64
|
+
export declare function addReferences(inputs: string[], library: ILibrary, options: AddReferencesOptions): Promise<AddReferencesResult>;
|
|
65
65
|
//# sourceMappingURL=add.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"add.d.ts","sourceRoot":"","sources":["../../../src/features/operations/add.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,
|
|
1
|
+
{"version":3,"file":"add.d.ts","sourceRoot":"","sources":["../../../src/features/operations/add.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,iCAAiC,CAAC;AAEhE,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,uBAAuB,CAAC;AACzD,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,sBAAsB,CAAC;AAOzD;;GAEG;AACH,MAAM,WAAW,oBAAoB;IACnC,+BAA+B;IAC/B,KAAK,CAAC,EAAE,OAAO,CAAC;IAChB,4CAA4C;IAC5C,MAAM,CAAC,EAAE,WAAW,GAAG,MAAM,CAAC;IAC9B,+BAA+B;IAC/B,YAAY,CAAC,EAAE,YAAY,CAAC;IAC5B,gFAAgF;IAChF,YAAY,CAAC,EAAE,MAAM,CAAC;CACvB;AAED;;GAEG;AACH,MAAM,WAAW,SAAS;IACxB,EAAE,EAAE,MAAM,CAAC;IACX,KAAK,EAAE,MAAM,CAAC;IACd,kDAAkD;IAClD,SAAS,CAAC,EAAE,OAAO,CAAC;IACpB,8CAA8C;IAC9C,UAAU,CAAC,EAAE,MAAM,CAAC;CACrB;AAED;;GAEG;AACH,MAAM,WAAW,UAAU;IACzB,MAAM,EAAE,MAAM,CAAC;IACf,KAAK,EAAE,MAAM,CAAC;CACf;AAED;;GAEG;AACH,MAAM,WAAW,WAAW;IAC1B,MAAM,EAAE,MAAM,CAAC;IACf,UAAU,EAAE,MAAM,CAAC;CACpB;AAED;;GAEG;AACH,MAAM,WAAW,mBAAmB;IAClC,KAAK,EAAE,SAAS,EAAE,CAAC;IACnB,MAAM,EAAE,UAAU,EAAE,CAAC;IACrB,OAAO,EAAE,WAAW,EAAE,CAAC;CACxB;AAED;;;;;;;;;;;;;GAaG;AACH,wBAAsB,aAAa,CACjC,MAAM,EAAE,MAAM,EAAE,EAChB,OAAO,EAAE,QAAQ,EACjB,OAAO,EAAE,oBAAoB,GAC5B,OAAO,CAAC,mBAAmB,CAAC,CAwC9B"}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type {
|
|
1
|
+
import type { ILibrary } from "../../core/library-interface.js";
|
|
2
2
|
/**
|
|
3
3
|
* Options for citeReferences operation
|
|
4
4
|
*/
|
|
@@ -44,5 +44,5 @@ export interface CiteResult {
|
|
|
44
44
|
* @param options - Citation options including identifiers and style settings
|
|
45
45
|
* @returns Results array with citation or error for each identifier
|
|
46
46
|
*/
|
|
47
|
-
export declare function citeReferences(library:
|
|
47
|
+
export declare function citeReferences(library: ILibrary, options: CiteOperationOptions): Promise<CiteResult>;
|
|
48
48
|
//# sourceMappingURL=cite.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"cite.d.ts","sourceRoot":"","sources":["../../../src/features/operations/cite.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,
|
|
1
|
+
{"version":3,"file":"cite.d.ts","sourceRoot":"","sources":["../../../src/features/operations/cite.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,iCAAiC,CAAC;AAQhE;;GAEG;AACH,MAAM,WAAW,oBAAoB;IACnC,qCAAqC;IACrC,WAAW,EAAE,MAAM,EAAE,CAAC;IACtB,mFAAmF;IACnF,MAAM,CAAC,EAAE,OAAO,CAAC;IACjB,yCAAyC;IACzC,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,8BAA8B;IAC9B,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,wDAAwD;IACxD,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,sCAAsC;IACtC,MAAM,CAAC,EAAE,MAAM,GAAG,MAAM,GAAG,KAAK,CAAC;IACjC,iEAAiE;IACjE,MAAM,CAAC,EAAE,OAAO,CAAC;CAClB;AAED;;GAEG;AACH,MAAM,MAAM,cAAc,GACtB;IAAE,OAAO,EAAE,IAAI,CAAC;IAAC,UAAU,EAAE,MAAM,CAAC;IAAC,QAAQ,EAAE,MAAM,CAAA;CAAE,GACvD;IAAE,OAAO,EAAE,KAAK,CAAC;IAAC,UAAU,EAAE,MAAM,CAAC;IAAC,KAAK,EAAE,MAAM,CAAA;CAAE,CAAC;AAE1D;;GAEG;AACH,MAAM,WAAW,UAAU;IACzB,kCAAkC;IAClC,OAAO,EAAE,cAAc,EAAE,CAAC;CAC3B;AAsED;;;;;;GAMG;AACH,wBAAsB,cAAc,CAClC,OAAO,EAAE,QAAQ,EACjB,OAAO,EAAE,oBAAoB,GAC5B,OAAO,CAAC,UAAU,CAAC,CAerB"}
|
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Fulltext attach operation
|
|
3
|
+
*/
|
|
4
|
+
import type { ILibrary } from "../../../core/library-interface.js";
|
|
5
|
+
import { type FulltextType } from "../../fulltext/index.js";
|
|
6
|
+
/**
|
|
7
|
+
* Options for fulltextAttach operation
|
|
8
|
+
*/
|
|
9
|
+
export interface FulltextAttachOptions {
|
|
10
|
+
/** Reference identifier (id or uuid) */
|
|
11
|
+
identifier: string;
|
|
12
|
+
/** Path to the file to attach */
|
|
13
|
+
filePath?: string | undefined;
|
|
14
|
+
/** Explicit file type (pdf or markdown) */
|
|
15
|
+
type?: FulltextType | undefined;
|
|
16
|
+
/** Move file instead of copy */
|
|
17
|
+
move?: boolean | undefined;
|
|
18
|
+
/** Force overwrite existing file */
|
|
19
|
+
force?: boolean | undefined;
|
|
20
|
+
/** Use uuid instead of id for lookup */
|
|
21
|
+
byUuid?: boolean | undefined;
|
|
22
|
+
/** Directory for fulltext files */
|
|
23
|
+
fulltextDirectory: string;
|
|
24
|
+
/** Content from stdin */
|
|
25
|
+
stdinContent?: Buffer | undefined;
|
|
26
|
+
}
|
|
27
|
+
/**
|
|
28
|
+
* Result of fulltextAttach operation
|
|
29
|
+
*/
|
|
30
|
+
export interface FulltextAttachResult {
|
|
31
|
+
success: boolean;
|
|
32
|
+
filename?: string | undefined;
|
|
33
|
+
type?: FulltextType | undefined;
|
|
34
|
+
overwritten?: boolean | undefined;
|
|
35
|
+
existingFile?: string | undefined;
|
|
36
|
+
requiresConfirmation?: boolean | undefined;
|
|
37
|
+
error?: string | undefined;
|
|
38
|
+
}
|
|
39
|
+
/**
|
|
40
|
+
* Attach a fulltext file to a reference.
|
|
41
|
+
*
|
|
42
|
+
* @param library - The library containing the reference
|
|
43
|
+
* @param options - Attach options
|
|
44
|
+
* @returns Result of the attach operation
|
|
45
|
+
*/
|
|
46
|
+
export declare function fulltextAttach(library: ILibrary, options: FulltextAttachOptions): Promise<FulltextAttachResult>;
|
|
47
|
+
//# sourceMappingURL=attach.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"attach.d.ts","sourceRoot":"","sources":["../../../../src/features/operations/fulltext/attach.ts"],"names":[],"mappings":"AAAA;;GAEG;AAOH,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,oCAAoC,CAAC;AACnE,OAAO,EAAoC,KAAK,YAAY,EAAE,MAAM,yBAAyB,CAAC;AAG9F;;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,wCAAwC;IACxC,MAAM,CAAC,EAAE,OAAO,GAAG,SAAS,CAAC;IAC7B,mCAAmC;IACnC,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;AAuHD;;;;;;GAMG;AACH,wBAAsB,cAAc,CAClC,OAAO,EAAE,QAAQ,EACjB,OAAO,EAAE,qBAAqB,GAC7B,OAAO,CAAC,oBAAoB,CAAC,CAqE/B"}
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Fulltext detach operation
|
|
3
|
+
*/
|
|
4
|
+
import type { ILibrary } from "../../../core/library-interface.js";
|
|
5
|
+
import { type FulltextType } from "../../fulltext/index.js";
|
|
6
|
+
/**
|
|
7
|
+
* Options for fulltextDetach operation
|
|
8
|
+
*/
|
|
9
|
+
export interface FulltextDetachOptions {
|
|
10
|
+
/** Reference identifier (id or uuid) */
|
|
11
|
+
identifier: string;
|
|
12
|
+
/** Specific type to detach (pdf or markdown) */
|
|
13
|
+
type?: FulltextType | undefined;
|
|
14
|
+
/** Delete the file from disk */
|
|
15
|
+
delete?: boolean | undefined;
|
|
16
|
+
/** Use uuid instead of id for lookup */
|
|
17
|
+
byUuid?: boolean | undefined;
|
|
18
|
+
/** Directory for fulltext files */
|
|
19
|
+
fulltextDirectory: string;
|
|
20
|
+
}
|
|
21
|
+
/**
|
|
22
|
+
* Result of fulltextDetach operation
|
|
23
|
+
*/
|
|
24
|
+
export interface FulltextDetachResult {
|
|
25
|
+
success: boolean;
|
|
26
|
+
detached?: FulltextType[];
|
|
27
|
+
deleted?: FulltextType[];
|
|
28
|
+
error?: string;
|
|
29
|
+
}
|
|
30
|
+
/**
|
|
31
|
+
* Detach fulltext file(s) from a reference.
|
|
32
|
+
*
|
|
33
|
+
* @param library - The library containing the reference
|
|
34
|
+
* @param options - Detach options
|
|
35
|
+
* @returns Result of the detach operation
|
|
36
|
+
*/
|
|
37
|
+
export declare function fulltextDetach(library: ILibrary, options: FulltextDetachOptions): Promise<FulltextDetachResult>;
|
|
38
|
+
//# sourceMappingURL=detach.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"detach.d.ts","sourceRoot":"","sources":["../../../../src/features/operations/fulltext/detach.ts"],"names":[],"mappings":"AAAA;;GAEG;AAGH,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,oCAAoC,CAAC;AACnE,OAAO,EAIL,KAAK,YAAY,EAClB,MAAM,yBAAyB,CAAC;AAGjC;;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,MAAM,CAAC,EAAE,OAAO,GAAG,SAAS,CAAC;IAC7B,wCAAwC;IACxC,MAAM,CAAC,EAAE,OAAO,GAAG,SAAS,CAAC;IAC7B,mCAAmC;IACnC,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;AAqDD;;;;;;GAMG;AACH,wBAAsB,cAAc,CAClC,OAAO,EAAE,QAAQ,EACjB,OAAO,EAAE,qBAAqB,GAC7B,OAAO,CAAC,oBAAoB,CAAC,CA0C/B"}
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Fulltext get operation
|
|
3
|
+
*/
|
|
4
|
+
import type { ILibrary } from "../../../core/library-interface.js";
|
|
5
|
+
import { type FulltextType } from "../../fulltext/index.js";
|
|
6
|
+
/**
|
|
7
|
+
* Options for fulltextGet operation
|
|
8
|
+
*/
|
|
9
|
+
export interface FulltextGetOptions {
|
|
10
|
+
/** Reference identifier (id or uuid) */
|
|
11
|
+
identifier: string;
|
|
12
|
+
/** Specific type to get (pdf or markdown) */
|
|
13
|
+
type?: FulltextType | undefined;
|
|
14
|
+
/** If true, return file content instead of path */
|
|
15
|
+
stdout?: boolean | undefined;
|
|
16
|
+
/** Use uuid instead of id for lookup */
|
|
17
|
+
byUuid?: boolean | undefined;
|
|
18
|
+
/** Directory for fulltext files */
|
|
19
|
+
fulltextDirectory: string;
|
|
20
|
+
}
|
|
21
|
+
/**
|
|
22
|
+
* Result of fulltextGet operation
|
|
23
|
+
*/
|
|
24
|
+
export interface FulltextGetResult {
|
|
25
|
+
success: boolean;
|
|
26
|
+
paths?: {
|
|
27
|
+
pdf?: string;
|
|
28
|
+
markdown?: string;
|
|
29
|
+
};
|
|
30
|
+
content?: Buffer;
|
|
31
|
+
error?: string;
|
|
32
|
+
}
|
|
33
|
+
/**
|
|
34
|
+
* Get fulltext file paths or content for a reference.
|
|
35
|
+
*
|
|
36
|
+
* @param library - The library containing the reference
|
|
37
|
+
* @param options - Get options
|
|
38
|
+
* @returns Result with file paths or content
|
|
39
|
+
*/
|
|
40
|
+
export declare function fulltextGet(library: ILibrary, options: FulltextGetOptions): Promise<FulltextGetResult>;
|
|
41
|
+
//# sourceMappingURL=get.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"get.d.ts","sourceRoot":"","sources":["../../../../src/features/operations/fulltext/get.ts"],"names":[],"mappings":"AAAA;;GAEG;AAIH,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,oCAAoC,CAAC;AACnE,OAAO,EAAmB,KAAK,YAAY,EAAE,MAAM,yBAAyB,CAAC;AAE7E;;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,wCAAwC;IACxC,MAAM,CAAC,EAAE,OAAO,GAAG,SAAS,CAAC;IAC7B,mCAAmC;IACnC,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;AAmDD;;;;;;GAMG;AACH,wBAAsB,WAAW,CAC/B,OAAO,EAAE,QAAQ,EACjB,OAAO,EAAE,kBAAkB,GAC1B,OAAO,CAAC,iBAAiB,CAAC,CAwB5B"}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Fulltext operations module
|
|
3
|
+
*
|
|
4
|
+
* Provides operations for managing fulltext files attached to references.
|
|
5
|
+
*/
|
|
6
|
+
export { fulltextAttach, type FulltextAttachOptions, type FulltextAttachResult } from "./attach.js";
|
|
7
|
+
export { fulltextGet, type FulltextGetOptions, type FulltextGetResult } from "./get.js";
|
|
8
|
+
export { fulltextDetach, type FulltextDetachOptions, type FulltextDetachResult } from "./detach.js";
|
|
9
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/features/operations/fulltext/index.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,EAAE,cAAc,EAAE,KAAK,qBAAqB,EAAE,KAAK,oBAAoB,EAAE,MAAM,aAAa,CAAC;AACpG,OAAO,EAAE,WAAW,EAAE,KAAK,kBAAkB,EAAE,KAAK,iBAAiB,EAAE,MAAM,UAAU,CAAC;AACxF,OAAO,EAAE,cAAc,EAAE,KAAK,qBAAqB,EAAE,KAAK,oBAAoB,EAAE,MAAM,aAAa,CAAC"}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Operations module exports
|
|
3
|
+
*
|
|
4
|
+
* Re-exports ILibraryOperations interface and OperationsLibrary class
|
|
5
|
+
* for CLI unification pattern.
|
|
6
|
+
*
|
|
7
|
+
* See: spec/decisions/ADR-009-ilibrary-operations-pattern.md
|
|
8
|
+
*/
|
|
9
|
+
export type { ILibraryOperations, ImportOptions, ImportResult, } from "./library-operations.js";
|
|
10
|
+
export { OperationsLibrary } from "./operations-library.js";
|
|
11
|
+
export type { SearchOperationOptions, SearchResult } from "./search.js";
|
|
12
|
+
export type { ListOptions, ListResult } from "./list.js";
|
|
13
|
+
export type { CiteOperationOptions, CiteResult, CiteItemResult } from "./cite.js";
|
|
14
|
+
export type { AddReferencesOptions, AddReferencesResult } from "./add.js";
|
|
15
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +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"}
|
|
@@ -0,0 +1,64 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* ILibraryOperations interface
|
|
3
|
+
*
|
|
4
|
+
* Extends ILibrary with high-level operations for CLI unification.
|
|
5
|
+
* Both OperationsLibrary (local) and ServerClient (server) implement this interface,
|
|
6
|
+
* allowing CLI commands to use a single interface without branching.
|
|
7
|
+
*
|
|
8
|
+
* See: spec/decisions/ADR-009-ilibrary-operations-pattern.md
|
|
9
|
+
*/
|
|
10
|
+
import type { ILibrary } from "../../core/library-interface.js";
|
|
11
|
+
import type { AddReferencesOptions, AddReferencesResult } from "./add.js";
|
|
12
|
+
import type { CiteOperationOptions, CiteResult } from "./cite.js";
|
|
13
|
+
import type { ListOptions, ListResult } from "./list.js";
|
|
14
|
+
import type { SearchOperationOptions, SearchResult } from "./search.js";
|
|
15
|
+
/**
|
|
16
|
+
* Options for import operation
|
|
17
|
+
*
|
|
18
|
+
* Extends AddReferencesOptions since import is the high-level version of add.
|
|
19
|
+
*/
|
|
20
|
+
export type ImportOptions = AddReferencesOptions;
|
|
21
|
+
/**
|
|
22
|
+
* Result of import operation
|
|
23
|
+
*/
|
|
24
|
+
export type ImportResult = AddReferencesResult;
|
|
25
|
+
/**
|
|
26
|
+
* High-level library operations interface
|
|
27
|
+
*
|
|
28
|
+
* Extends ILibrary with search, list, cite, and import methods.
|
|
29
|
+
* This interface is implemented by:
|
|
30
|
+
* - OperationsLibrary: Wraps Library and uses operation functions
|
|
31
|
+
* - ServerClient: Makes HTTP requests to server endpoints
|
|
32
|
+
*/
|
|
33
|
+
export interface ILibraryOperations extends ILibrary {
|
|
34
|
+
/**
|
|
35
|
+
* Search references by query
|
|
36
|
+
*
|
|
37
|
+
* @param options - Search options including query and format
|
|
38
|
+
* @returns Search results with formatted items
|
|
39
|
+
*/
|
|
40
|
+
search(options: SearchOperationOptions): Promise<SearchResult>;
|
|
41
|
+
/**
|
|
42
|
+
* List all references
|
|
43
|
+
*
|
|
44
|
+
* @param options - List options including format
|
|
45
|
+
* @returns List results with formatted items
|
|
46
|
+
*/
|
|
47
|
+
list(options?: ListOptions): Promise<ListResult>;
|
|
48
|
+
/**
|
|
49
|
+
* Generate citations for references
|
|
50
|
+
*
|
|
51
|
+
* @param options - Citation options including identifiers, style, and format
|
|
52
|
+
* @returns Citation results
|
|
53
|
+
*/
|
|
54
|
+
cite(options: CiteOperationOptions): Promise<CiteResult>;
|
|
55
|
+
/**
|
|
56
|
+
* Import references from various sources
|
|
57
|
+
*
|
|
58
|
+
* @param inputs - Array of inputs (PMID, DOI, BibTeX, RIS, file paths)
|
|
59
|
+
* @param options - Import options
|
|
60
|
+
* @returns Import results with added, failed, and skipped items
|
|
61
|
+
*/
|
|
62
|
+
import(inputs: string[], options?: ImportOptions): Promise<ImportResult>;
|
|
63
|
+
}
|
|
64
|
+
//# sourceMappingURL=library-operations.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"library-operations.d.ts","sourceRoot":"","sources":["../../../src/features/operations/library-operations.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AAEH,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,iCAAiC,CAAC;AAChE,OAAO,KAAK,EAAE,oBAAoB,EAAE,mBAAmB,EAAE,MAAM,UAAU,CAAC;AAC1E,OAAO,KAAK,EAAE,oBAAoB,EAAE,UAAU,EAAE,MAAM,WAAW,CAAC;AAClE,OAAO,KAAK,EAAE,WAAW,EAAE,UAAU,EAAE,MAAM,WAAW,CAAC;AACzD,OAAO,KAAK,EAAE,sBAAsB,EAAE,YAAY,EAAE,MAAM,aAAa,CAAC;AAExE;;;;GAIG;AACH,MAAM,MAAM,aAAa,GAAG,oBAAoB,CAAC;AAEjD;;GAEG;AACH,MAAM,MAAM,YAAY,GAAG,mBAAmB,CAAC;AAE/C;;;;;;;GAOG;AACH,MAAM,WAAW,kBAAmB,SAAQ,QAAQ;IAClD;;;;;OAKG;IACH,MAAM,CAAC,OAAO,EAAE,sBAAsB,GAAG,OAAO,CAAC,YAAY,CAAC,CAAC;IAE/D;;;;;OAKG;IACH,IAAI,CAAC,OAAO,CAAC,EAAE,WAAW,GAAG,OAAO,CAAC,UAAU,CAAC,CAAC;IAEjD;;;;;OAKG;IACH,IAAI,CAAC,OAAO,EAAE,oBAAoB,GAAG,OAAO,CAAC,UAAU,CAAC,CAAC;IAEzD;;;;;;OAMG;IACH,MAAM,CAAC,MAAM,EAAE,MAAM,EAAE,EAAE,OAAO,CAAC,EAAE,aAAa,GAAG,OAAO,CAAC,YAAY,CAAC,CAAC;CAC1E"}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type {
|
|
1
|
+
import type { ILibrary } from "../../core/library-interface.js";
|
|
2
2
|
/**
|
|
3
3
|
* Output format options for list operation
|
|
4
4
|
*/
|
|
@@ -24,5 +24,5 @@ export interface ListResult {
|
|
|
24
24
|
* @param options - Formatting options
|
|
25
25
|
* @returns Formatted strings for each reference
|
|
26
26
|
*/
|
|
27
|
-
export declare function listReferences(library:
|
|
27
|
+
export declare function listReferences(library: ILibrary, options: ListOptions): Promise<ListResult>;
|
|
28
28
|
//# sourceMappingURL=list.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"list.d.ts","sourceRoot":"","sources":["../../../src/features/operations/list.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,
|
|
1
|
+
{"version":3,"file":"list.d.ts","sourceRoot":"","sources":["../../../src/features/operations/list.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,iCAAiC,CAAC;AAGhE;;GAEG;AACH,MAAM,MAAM,UAAU,GAAG,QAAQ,GAAG,MAAM,GAAG,QAAQ,GAAG,UAAU,GAAG,MAAM,CAAC;AAE5E;;GAEG;AACH,MAAM,WAAW,WAAW;IAC1B,wCAAwC;IACxC,MAAM,CAAC,EAAE,UAAU,CAAC;CACrB;AAED;;GAEG;AACH,MAAM,WAAW,UAAU;IACzB,2CAA2C;IAC3C,KAAK,EAAE,MAAM,EAAE,CAAC;CACjB;AAED;;;;;;GAMG;AACH,wBAAsB,cAAc,CAAC,OAAO,EAAE,QAAQ,EAAE,OAAO,EAAE,WAAW,GAAG,OAAO,CAAC,UAAU,CAAC,CA4BjG"}
|