@ncukondo/reference-manager 0.1.0 → 0.3.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 +40 -0
- package/dist/chunks/detector-DHztTaFY.js +619 -0
- package/dist/chunks/detector-DHztTaFY.js.map +1 -0
- package/dist/chunks/{detector-BF8Mcc72.js → loader-mQ25o6cV.js} +303 -664
- package/dist/chunks/loader-mQ25o6cV.js.map +1 -0
- package/dist/chunks/search-Be9vzUIH.js +29541 -0
- package/dist/chunks/search-Be9vzUIH.js.map +1 -0
- package/dist/cli/commands/add.d.ts +44 -16
- package/dist/cli/commands/add.d.ts.map +1 -1
- package/dist/cli/commands/cite.d.ts +49 -0
- package/dist/cli/commands/cite.d.ts.map +1 -0
- package/dist/cli/commands/fulltext.d.ts +101 -0
- package/dist/cli/commands/fulltext.d.ts.map +1 -0
- package/dist/cli/commands/index.d.ts +14 -10
- package/dist/cli/commands/index.d.ts.map +1 -1
- package/dist/cli/commands/list.d.ts +23 -6
- package/dist/cli/commands/list.d.ts.map +1 -1
- package/dist/cli/commands/remove.d.ts +47 -12
- package/dist/cli/commands/remove.d.ts.map +1 -1
- package/dist/cli/commands/search.d.ts +24 -7
- package/dist/cli/commands/search.d.ts.map +1 -1
- package/dist/cli/commands/update.d.ts +26 -13
- package/dist/cli/commands/update.d.ts.map +1 -1
- package/dist/cli/execution-context.d.ts +60 -0
- package/dist/cli/execution-context.d.ts.map +1 -0
- package/dist/cli/helpers.d.ts +18 -0
- package/dist/cli/helpers.d.ts.map +1 -1
- package/dist/cli/index.d.ts.map +1 -1
- package/dist/cli/server-client.d.ts +73 -10
- package/dist/cli/server-client.d.ts.map +1 -1
- package/dist/cli.js +1200 -528
- package/dist/cli.js.map +1 -1
- package/dist/config/csl-styles.d.ts +83 -0
- package/dist/config/csl-styles.d.ts.map +1 -0
- package/dist/config/defaults.d.ts +10 -0
- package/dist/config/defaults.d.ts.map +1 -1
- package/dist/config/loader.d.ts.map +1 -1
- package/dist/config/schema.d.ts +84 -0
- package/dist/config/schema.d.ts.map +1 -1
- package/dist/core/csl-json/types.d.ts +15 -3
- package/dist/core/csl-json/types.d.ts.map +1 -1
- package/dist/core/library.d.ts +60 -0
- package/dist/core/library.d.ts.map +1 -1
- package/dist/features/format/bibtex.d.ts +6 -0
- package/dist/features/format/bibtex.d.ts.map +1 -0
- package/dist/features/format/citation-csl.d.ts +41 -0
- package/dist/features/format/citation-csl.d.ts.map +1 -0
- package/dist/features/format/citation-fallback.d.ts +24 -0
- package/dist/features/format/citation-fallback.d.ts.map +1 -0
- package/dist/features/format/index.d.ts +10 -0
- package/dist/features/format/index.d.ts.map +1 -0
- package/dist/features/format/json.d.ts +6 -0
- package/dist/features/format/json.d.ts.map +1 -0
- package/dist/features/format/pretty.d.ts +6 -0
- package/dist/features/format/pretty.d.ts.map +1 -0
- package/dist/features/fulltext/filename.d.ts +17 -0
- package/dist/features/fulltext/filename.d.ts.map +1 -0
- package/dist/features/fulltext/index.d.ts +7 -0
- package/dist/features/fulltext/index.d.ts.map +1 -0
- package/dist/features/fulltext/manager.d.ts +109 -0
- package/dist/features/fulltext/manager.d.ts.map +1 -0
- package/dist/features/fulltext/types.d.ts +12 -0
- package/dist/features/fulltext/types.d.ts.map +1 -0
- package/dist/features/import/cache.d.ts +37 -0
- package/dist/features/import/cache.d.ts.map +1 -0
- package/dist/features/import/detector.d.ts +42 -0
- package/dist/features/import/detector.d.ts.map +1 -0
- package/dist/features/import/fetcher.d.ts +49 -0
- package/dist/features/import/fetcher.d.ts.map +1 -0
- package/dist/features/import/importer.d.ts +61 -0
- package/dist/features/import/importer.d.ts.map +1 -0
- package/dist/features/import/index.d.ts +8 -0
- package/dist/features/import/index.d.ts.map +1 -0
- package/dist/features/import/normalizer.d.ts +15 -0
- package/dist/features/import/normalizer.d.ts.map +1 -0
- package/dist/features/import/parser.d.ts +33 -0
- package/dist/features/import/parser.d.ts.map +1 -0
- package/dist/features/import/rate-limiter.d.ts +45 -0
- package/dist/features/import/rate-limiter.d.ts.map +1 -0
- package/dist/features/operations/add.d.ts +65 -0
- package/dist/features/operations/add.d.ts.map +1 -0
- package/dist/features/operations/cite.d.ts +48 -0
- package/dist/features/operations/cite.d.ts.map +1 -0
- package/dist/features/operations/list.d.ts +28 -0
- package/dist/features/operations/list.d.ts.map +1 -0
- package/dist/features/operations/remove.d.ts +29 -0
- package/dist/features/operations/remove.d.ts.map +1 -0
- package/dist/features/operations/search.d.ts +30 -0
- package/dist/features/operations/search.d.ts.map +1 -0
- package/dist/features/operations/update.d.ts +39 -0
- package/dist/features/operations/update.d.ts.map +1 -0
- package/dist/index.js +18 -16
- package/dist/index.js.map +1 -1
- package/dist/server/index.d.ts +3 -1
- package/dist/server/index.d.ts.map +1 -1
- package/dist/server/routes/add.d.ts +11 -0
- package/dist/server/routes/add.d.ts.map +1 -0
- package/dist/server/routes/cite.d.ts +9 -0
- package/dist/server/routes/cite.d.ts.map +1 -0
- package/dist/server/routes/list.d.ts +25 -0
- package/dist/server/routes/list.d.ts.map +1 -0
- package/dist/server/routes/references.d.ts.map +1 -1
- package/dist/server/routes/search.d.ts +26 -0
- package/dist/server/routes/search.d.ts.map +1 -0
- package/dist/server.js +215 -32
- package/dist/server.js.map +1 -1
- package/package.json +15 -4
- package/dist/chunks/detector-BF8Mcc72.js.map +0 -1
- package/dist/cli/output/bibtex.d.ts +0 -6
- package/dist/cli/output/bibtex.d.ts.map +0 -1
- package/dist/cli/output/index.d.ts +0 -7
- package/dist/cli/output/index.d.ts.map +0 -1
- package/dist/cli/output/json.d.ts +0 -6
- package/dist/cli/output/json.d.ts.map +0 -1
- package/dist/cli/output/pretty.d.ts +0 -6
- package/dist/cli/output/pretty.d.ts.map +0 -1
|
@@ -22,6 +22,16 @@ export declare function getDefaultUserConfigPath(): string;
|
|
|
22
22
|
* Uses .reference-manager.config.toml
|
|
23
23
|
*/
|
|
24
24
|
export declare function getDefaultCurrentDirConfigFilename(): string;
|
|
25
|
+
/**
|
|
26
|
+
* Get the default CSL directory
|
|
27
|
+
* Uses ~/.reference-manager/csl/
|
|
28
|
+
*/
|
|
29
|
+
export declare function getDefaultCslDirectory(): string;
|
|
30
|
+
/**
|
|
31
|
+
* Get the default fulltext directory
|
|
32
|
+
* Uses ~/.reference-manager/fulltext/
|
|
33
|
+
*/
|
|
34
|
+
export declare function getDefaultFulltextDirectory(): string;
|
|
25
35
|
/**
|
|
26
36
|
* Default configuration
|
|
27
37
|
*/
|
|
@@ -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;;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,MAgC3B,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"loader.d.ts","sourceRoot":"","sources":["../../src/config/loader.ts"],"names":[],"mappings":"AAAA;;GAEG;
|
|
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;AA+ID;;;;;;;;;GASG;AACH,wBAAgB,UAAU,CAAC,OAAO,GAAE,iBAAsB,GAAG,MAAM,CAwClE"}
|
package/dist/config/schema.d.ts
CHANGED
|
@@ -35,6 +35,40 @@ export declare const serverConfigSchema: z.ZodObject<{
|
|
|
35
35
|
autoStart: z.ZodBoolean;
|
|
36
36
|
autoStopMinutes: z.ZodNumber;
|
|
37
37
|
}, z.core.$strip>;
|
|
38
|
+
/**
|
|
39
|
+
* Citation format schema
|
|
40
|
+
*/
|
|
41
|
+
export declare const citationFormatSchema: z.ZodEnum<{
|
|
42
|
+
text: "text";
|
|
43
|
+
html: "html";
|
|
44
|
+
rtf: "rtf";
|
|
45
|
+
}>;
|
|
46
|
+
/**
|
|
47
|
+
* Citation configuration schema
|
|
48
|
+
*/
|
|
49
|
+
export declare const citationConfigSchema: z.ZodObject<{
|
|
50
|
+
defaultStyle: z.ZodString;
|
|
51
|
+
cslDirectory: z.ZodArray<z.ZodString>;
|
|
52
|
+
defaultLocale: z.ZodString;
|
|
53
|
+
defaultFormat: z.ZodEnum<{
|
|
54
|
+
text: "text";
|
|
55
|
+
html: "html";
|
|
56
|
+
rtf: "rtf";
|
|
57
|
+
}>;
|
|
58
|
+
}, z.core.$strip>;
|
|
59
|
+
/**
|
|
60
|
+
* PubMed API configuration schema
|
|
61
|
+
*/
|
|
62
|
+
export declare const pubmedConfigSchema: z.ZodObject<{
|
|
63
|
+
email: z.ZodOptional<z.ZodString>;
|
|
64
|
+
apiKey: z.ZodOptional<z.ZodString>;
|
|
65
|
+
}, z.core.$strip>;
|
|
66
|
+
/**
|
|
67
|
+
* Fulltext storage configuration schema
|
|
68
|
+
*/
|
|
69
|
+
export declare const fulltextConfigSchema: z.ZodObject<{
|
|
70
|
+
directory: z.ZodString;
|
|
71
|
+
}, z.core.$strip>;
|
|
38
72
|
/**
|
|
39
73
|
* Complete configuration schema
|
|
40
74
|
*/
|
|
@@ -61,6 +95,23 @@ export declare const configSchema: z.ZodObject<{
|
|
|
61
95
|
autoStart: z.ZodBoolean;
|
|
62
96
|
autoStopMinutes: z.ZodNumber;
|
|
63
97
|
}, z.core.$strip>;
|
|
98
|
+
citation: z.ZodObject<{
|
|
99
|
+
defaultStyle: z.ZodString;
|
|
100
|
+
cslDirectory: z.ZodArray<z.ZodString>;
|
|
101
|
+
defaultLocale: z.ZodString;
|
|
102
|
+
defaultFormat: z.ZodEnum<{
|
|
103
|
+
text: "text";
|
|
104
|
+
html: "html";
|
|
105
|
+
rtf: "rtf";
|
|
106
|
+
}>;
|
|
107
|
+
}, z.core.$strip>;
|
|
108
|
+
pubmed: z.ZodObject<{
|
|
109
|
+
email: z.ZodOptional<z.ZodString>;
|
|
110
|
+
apiKey: z.ZodOptional<z.ZodString>;
|
|
111
|
+
}, z.core.$strip>;
|
|
112
|
+
fulltext: z.ZodObject<{
|
|
113
|
+
directory: z.ZodString;
|
|
114
|
+
}, z.core.$strip>;
|
|
64
115
|
}, z.core.$strip>;
|
|
65
116
|
/**
|
|
66
117
|
* Partial configuration schema (for TOML files)
|
|
@@ -102,6 +153,32 @@ export declare const partialConfigSchema: z.ZodObject<{
|
|
|
102
153
|
autoStopMinutes: z.ZodOptional<z.ZodNumber>;
|
|
103
154
|
auto_stop_minutes: z.ZodOptional<z.ZodNumber>;
|
|
104
155
|
}, z.core.$strip>>;
|
|
156
|
+
citation: z.ZodOptional<z.ZodObject<{
|
|
157
|
+
defaultStyle: z.ZodOptional<z.ZodString>;
|
|
158
|
+
default_style: z.ZodOptional<z.ZodString>;
|
|
159
|
+
cslDirectory: z.ZodOptional<z.ZodUnion<readonly [z.ZodString, z.ZodArray<z.ZodString>]>>;
|
|
160
|
+
csl_directory: z.ZodOptional<z.ZodUnion<readonly [z.ZodString, z.ZodArray<z.ZodString>]>>;
|
|
161
|
+
defaultLocale: z.ZodOptional<z.ZodString>;
|
|
162
|
+
default_locale: z.ZodOptional<z.ZodString>;
|
|
163
|
+
defaultFormat: z.ZodOptional<z.ZodEnum<{
|
|
164
|
+
text: "text";
|
|
165
|
+
html: "html";
|
|
166
|
+
rtf: "rtf";
|
|
167
|
+
}>>;
|
|
168
|
+
default_format: z.ZodOptional<z.ZodEnum<{
|
|
169
|
+
text: "text";
|
|
170
|
+
html: "html";
|
|
171
|
+
rtf: "rtf";
|
|
172
|
+
}>>;
|
|
173
|
+
}, z.core.$strip>>;
|
|
174
|
+
pubmed: z.ZodOptional<z.ZodObject<{
|
|
175
|
+
email: z.ZodOptional<z.ZodString>;
|
|
176
|
+
apiKey: z.ZodOptional<z.ZodString>;
|
|
177
|
+
api_key: z.ZodOptional<z.ZodString>;
|
|
178
|
+
}, z.core.$strip>>;
|
|
179
|
+
fulltext: z.ZodOptional<z.ZodObject<{
|
|
180
|
+
directory: z.ZodOptional<z.ZodString>;
|
|
181
|
+
}, z.core.$strip>>;
|
|
105
182
|
}, z.core.$loose>;
|
|
106
183
|
/**
|
|
107
184
|
* Inferred types from schemas
|
|
@@ -110,6 +187,10 @@ export type LogLevel = z.infer<typeof logLevelSchema>;
|
|
|
110
187
|
export type BackupConfig = z.infer<typeof backupConfigSchema>;
|
|
111
188
|
export type WatchConfig = z.infer<typeof watchConfigSchema>;
|
|
112
189
|
export type ServerConfig = z.infer<typeof serverConfigSchema>;
|
|
190
|
+
export type CitationFormat = z.infer<typeof citationFormatSchema>;
|
|
191
|
+
export type CitationConfig = z.infer<typeof citationConfigSchema>;
|
|
192
|
+
export type PubmedConfig = z.infer<typeof pubmedConfigSchema>;
|
|
193
|
+
export type FulltextConfig = z.infer<typeof fulltextConfigSchema>;
|
|
113
194
|
export type Config = z.infer<typeof configSchema>;
|
|
114
195
|
export type PartialConfig = z.infer<typeof partialConfigSchema>;
|
|
115
196
|
/**
|
|
@@ -121,6 +202,9 @@ export type DeepPartialConfig = {
|
|
|
121
202
|
backup?: Partial<BackupConfig>;
|
|
122
203
|
watch?: Partial<WatchConfig>;
|
|
123
204
|
server?: Partial<ServerConfig>;
|
|
205
|
+
citation?: Partial<CitationConfig>;
|
|
206
|
+
pubmed?: Partial<PubmedConfig>;
|
|
207
|
+
fulltext?: Partial<FulltextConfig>;
|
|
124
208
|
};
|
|
125
209
|
/**
|
|
126
210
|
* Normalize snake_case fields to camelCase
|
|
@@ -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;;GAEG;AACH,eAAO,MAAM,iBAAiB;;;;;;iBAM5B,CAAC;AAEH;;GAEG;AACH,eAAO,MAAM,kBAAkB;;;iBAG7B,CAAC;AAEH;;GAEG;AACH,eAAO,MAAM,YAAY
|
|
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,MA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AC9D,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;AAyKF;;GAEG;AACH,wBAAgB,sBAAsB,CAAC,OAAO,EAAE,aAAa,GAAG,iBAAiB,CAmEhF"}
|
|
@@ -4,7 +4,11 @@ declare const CslCustomSchema: z.ZodObject<{
|
|
|
4
4
|
created_at: z.ZodString;
|
|
5
5
|
timestamp: z.ZodString;
|
|
6
6
|
additional_urls: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
7
|
-
|
|
7
|
+
fulltext: z.ZodOptional<z.ZodObject<{
|
|
8
|
+
pdf: z.ZodOptional<z.ZodString>;
|
|
9
|
+
markdown: z.ZodOptional<z.ZodString>;
|
|
10
|
+
}, z.core.$strip>>;
|
|
11
|
+
}, z.core.$loose>;
|
|
8
12
|
export declare const CslItemSchema: z.ZodObject<{
|
|
9
13
|
id: z.ZodString;
|
|
10
14
|
type: z.ZodString;
|
|
@@ -59,7 +63,11 @@ export declare const CslItemSchema: z.ZodObject<{
|
|
|
59
63
|
created_at: z.ZodString;
|
|
60
64
|
timestamp: z.ZodString;
|
|
61
65
|
additional_urls: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
62
|
-
|
|
66
|
+
fulltext: z.ZodOptional<z.ZodObject<{
|
|
67
|
+
pdf: z.ZodOptional<z.ZodString>;
|
|
68
|
+
markdown: z.ZodOptional<z.ZodString>;
|
|
69
|
+
}, z.core.$strip>>;
|
|
70
|
+
}, z.core.$loose>>;
|
|
63
71
|
}, z.core.$loose>;
|
|
64
72
|
export declare const CslLibrarySchema: z.ZodArray<z.ZodObject<{
|
|
65
73
|
id: z.ZodString;
|
|
@@ -115,7 +123,11 @@ export declare const CslLibrarySchema: z.ZodArray<z.ZodObject<{
|
|
|
115
123
|
created_at: z.ZodString;
|
|
116
124
|
timestamp: z.ZodString;
|
|
117
125
|
additional_urls: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
118
|
-
|
|
126
|
+
fulltext: z.ZodOptional<z.ZodObject<{
|
|
127
|
+
pdf: z.ZodOptional<z.ZodString>;
|
|
128
|
+
markdown: z.ZodOptional<z.ZodString>;
|
|
129
|
+
}, z.core.$strip>>;
|
|
130
|
+
}, z.core.$loose>>;
|
|
119
131
|
}, z.core.$loose>>;
|
|
120
132
|
export type CslCustom = z.infer<typeof CslCustomSchema>;
|
|
121
133
|
export type CslItem = z.infer<typeof CslItemSchema>;
|
|
@@ -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;
|
|
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;;;;;;;;;iBAQL,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"}
|
package/dist/core/library.d.ts
CHANGED
|
@@ -1,5 +1,25 @@
|
|
|
1
1
|
import type { CslItem } from "./csl-json/types";
|
|
2
2
|
import { Reference } from "./reference";
|
|
3
|
+
/**
|
|
4
|
+
* Options for update operations
|
|
5
|
+
*/
|
|
6
|
+
export interface UpdateOptions {
|
|
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
|
+
}
|
|
3
23
|
/**
|
|
4
24
|
* Library manager for CSL-JSON references
|
|
5
25
|
*/
|
|
@@ -32,6 +52,20 @@ export declare class Library {
|
|
|
32
52
|
* Remove a reference by ID
|
|
33
53
|
*/
|
|
34
54
|
removeById(id: string): boolean;
|
|
55
|
+
/**
|
|
56
|
+
* Update a reference by UUID.
|
|
57
|
+
* @param uuid - The UUID of the reference to update
|
|
58
|
+
* @param updates - Partial updates to apply to the reference
|
|
59
|
+
* @returns true if the reference was found and updated, false otherwise
|
|
60
|
+
*/
|
|
61
|
+
updateByUuid(uuid: string, updates: Partial<CslItem>, options?: UpdateOptions): UpdateResult;
|
|
62
|
+
/**
|
|
63
|
+
* Update a reference by ID.
|
|
64
|
+
* @param id - The ID of the reference to update
|
|
65
|
+
* @param updates - Partial updates to apply to the reference
|
|
66
|
+
* @returns true if the reference was found and updated, false otherwise
|
|
67
|
+
*/
|
|
68
|
+
updateById(id: string, updates: Partial<CslItem>, options?: UpdateOptions): UpdateResult;
|
|
35
69
|
/**
|
|
36
70
|
* Find a reference by UUID
|
|
37
71
|
*/
|
|
@@ -69,5 +103,31 @@ export declare class Library {
|
|
|
69
103
|
* Remove reference from all indices and array
|
|
70
104
|
*/
|
|
71
105
|
private removeReference;
|
|
106
|
+
/**
|
|
107
|
+
* Update a reference with partial updates.
|
|
108
|
+
* Preserves uuid and created_at, updates timestamp.
|
|
109
|
+
*/
|
|
110
|
+
private updateReference;
|
|
111
|
+
/**
|
|
112
|
+
* Resolve the new ID, handling collisions based on options.
|
|
113
|
+
*/
|
|
114
|
+
private resolveNewId;
|
|
115
|
+
/**
|
|
116
|
+
* Build the updated CslItem, preserving uuid and created_at.
|
|
117
|
+
*/
|
|
118
|
+
private buildUpdatedItem;
|
|
119
|
+
/**
|
|
120
|
+
* Remove a reference from all indices.
|
|
121
|
+
*/
|
|
122
|
+
private removeFromIndices;
|
|
123
|
+
/**
|
|
124
|
+
* Generate an alphabetic suffix for ID collision resolution.
|
|
125
|
+
* 0 -> 'a', 1 -> 'b', ..., 25 -> 'z', 26 -> 'aa', etc.
|
|
126
|
+
*/
|
|
127
|
+
private generateSuffix;
|
|
128
|
+
/**
|
|
129
|
+
* Resolve ID collision by appending alphabetic suffix.
|
|
130
|
+
*/
|
|
131
|
+
private resolveIdCollision;
|
|
72
132
|
}
|
|
73
133
|
//# sourceMappingURL=library.d.ts.map
|
|
@@ -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,EAAE,SAAS,EAAE,MAAM,aAAa,CAAC;AAExC;;GAEG;AACH,qBAAa,OAAO;IAClB,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;;OAEG;IACH,GAAG,CAAC,IAAI,EAAE,OAAO,GAAG,IAAI;IAYxB;;OAEG;IACH,YAAY,CAAC,IAAI,EAAE,MAAM,GAAG,OAAO;IASnC;;OAEG;IACH,UAAU,CAAC,EAAE,EAAE,MAAM,GAAG,OAAO;IAS/B;;OAEG;IACH,UAAU,CAAC,IAAI,EAAE,MAAM,GAAG,SAAS,GAAG,SAAS;IAI/C;;OAEG;IACH,QAAQ,CAAC,EAAE,EAAE,MAAM,GAAG,SAAS,GAAG,SAAS;IAI3C;;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;IACH,MAAM,IAAI,SAAS,EAAE;IAIrB;;OAEG;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gB,YAAY,CAAC,KAAK,EAAE,OAAO,EAAE,GAAG,MAAM,CAMrD"}
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
import "@citation-js/plugin-csl";
|
|
2
|
+
import type { CslItem } from "../../core/csl-json/types.js";
|
|
3
|
+
/**
|
|
4
|
+
* Options for CSL citation formatting
|
|
5
|
+
*/
|
|
6
|
+
export type CitationFormatOptions = {
|
|
7
|
+
/**
|
|
8
|
+
* CSL style name (e.g., 'apa', 'vancouver', 'chicago')
|
|
9
|
+
* @default 'apa'
|
|
10
|
+
*/
|
|
11
|
+
style?: string;
|
|
12
|
+
/**
|
|
13
|
+
* Output format: text, html, or rtf
|
|
14
|
+
* @default 'text'
|
|
15
|
+
*/
|
|
16
|
+
format?: "text" | "html" | "rtf";
|
|
17
|
+
/**
|
|
18
|
+
* Locale code (e.g., 'en-US', 'en-GB')
|
|
19
|
+
* @default 'en-US'
|
|
20
|
+
*/
|
|
21
|
+
locale?: string;
|
|
22
|
+
};
|
|
23
|
+
/**
|
|
24
|
+
* Format CSL-JSON items as bibliography using CSL processor.
|
|
25
|
+
* Falls back to simplified format if CSL processing fails.
|
|
26
|
+
*
|
|
27
|
+
* @param items - Array of CSL-JSON items
|
|
28
|
+
* @param options - Formatting options
|
|
29
|
+
* @returns Formatted bibliography entries
|
|
30
|
+
*/
|
|
31
|
+
export declare function formatBibliographyCSL(items: CslItem[], options: CitationFormatOptions): string;
|
|
32
|
+
/**
|
|
33
|
+
* Format CSL-JSON items as in-text citations using CSL processor.
|
|
34
|
+
* Falls back to simplified format if CSL processing fails.
|
|
35
|
+
*
|
|
36
|
+
* @param items - Array of CSL-JSON items
|
|
37
|
+
* @param options - Formatting options
|
|
38
|
+
* @returns Formatted in-text citation(s)
|
|
39
|
+
*/
|
|
40
|
+
export declare function formatInTextCSL(items: CslItem[], options: CitationFormatOptions): string;
|
|
41
|
+
//# sourceMappingURL=citation-csl.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"citation-csl.d.ts","sourceRoot":"","sources":["../../../src/features/format/citation-csl.ts"],"names":[],"mappings":"AACA,OAAO,yBAAyB,CAAC;AACjC,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,8BAA8B,CAAC;AAG5D;;GAEG;AACH,MAAM,MAAM,qBAAqB,GAAG;IAClC;;;OAGG;IACH,KAAK,CAAC,EAAE,MAAM,CAAC;IAEf;;;OAGG;IACH,MAAM,CAAC,EAAE,MAAM,GAAG,MAAM,GAAG,KAAK,CAAC;IAEjC;;;OAGG;IACH,MAAM,CAAC,EAAE,MAAM,CAAC;CACjB,CAAC;AAEF;;;;;;;GAOG;AACH,wBAAgB,qBAAqB,CAAC,KAAK,EAAE,OAAO,EAAE,EAAE,OAAO,EAAE,qBAAqB,GAAG,MAAM,CA+B9F;AAED;;;;;;;GAOG;AACH,wBAAgB,eAAe,CAAC,KAAK,EAAE,OAAO,EAAE,EAAE,OAAO,EAAE,qBAAqB,GAAG,MAAM,CA+BxF"}
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import type { CslItem } from "../../core/csl-json/types.js";
|
|
2
|
+
/**
|
|
3
|
+
* Format CSL-JSON items as simplified AMA-like bibliography entries.
|
|
4
|
+
*
|
|
5
|
+
* Format: FirstAuthor [et al]. JournalAbbrev. YYYY;volume(issue):pages. PMID:xxxxx [or DOI:xxxxx]. Title.
|
|
6
|
+
*
|
|
7
|
+
* Multiple items are separated by double newlines.
|
|
8
|
+
*
|
|
9
|
+
* @param items - Array of CSL-JSON items
|
|
10
|
+
* @returns Formatted bibliography entries separated by double newlines
|
|
11
|
+
*/
|
|
12
|
+
export declare function formatBibliography(items: CslItem[]): string;
|
|
13
|
+
/**
|
|
14
|
+
* Format CSL-JSON items as simplified in-text citations.
|
|
15
|
+
*
|
|
16
|
+
* Format: (FirstAuthor et al, YYYY)
|
|
17
|
+
*
|
|
18
|
+
* Multiple items are separated by semicolons and enclosed in parentheses.
|
|
19
|
+
*
|
|
20
|
+
* @param items - Array of CSL-JSON items
|
|
21
|
+
* @returns Formatted in-text citation(s) enclosed in parentheses
|
|
22
|
+
*/
|
|
23
|
+
export declare function formatInText(items: CslItem[]): string;
|
|
24
|
+
//# sourceMappingURL=citation-fallback.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"citation-fallback.d.ts","sourceRoot":"","sources":["../../../src/features/format/citation-fallback.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,8BAA8B,CAAC;AAwK5D;;;;;;;;;GASG;AACH,wBAAgB,kBAAkB,CAAC,KAAK,EAAE,OAAO,EAAE,GAAG,MAAM,CAM3D;AAED;;;;;;;;;GASG;AACH,wBAAgB,YAAY,CAAC,KAAK,EAAE,OAAO,EAAE,GAAG,MAAM,CAOrD"}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Output formatters for reference data
|
|
3
|
+
*/
|
|
4
|
+
export { formatJson } from "./json.js";
|
|
5
|
+
export { formatPretty } from "./pretty.js";
|
|
6
|
+
export { formatBibtex } from "./bibtex.js";
|
|
7
|
+
export { formatBibliography, formatInText } from "./citation-fallback.js";
|
|
8
|
+
export { formatBibliographyCSL, formatInTextCSL } from "./citation-csl.js";
|
|
9
|
+
export type { CitationFormatOptions } from "./citation-csl.js";
|
|
10
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/features/format/index.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH,OAAO,EAAE,UAAU,EAAE,MAAM,WAAW,CAAC;AACvC,OAAO,EAAE,YAAY,EAAE,MAAM,aAAa,CAAC;AAC3C,OAAO,EAAE,YAAY,EAAE,MAAM,aAAa,CAAC;AAC3C,OAAO,EAAE,kBAAkB,EAAE,YAAY,EAAE,MAAM,wBAAwB,CAAC;AAC1E,OAAO,EAAE,qBAAqB,EAAE,eAAe,EAAE,MAAM,mBAAmB,CAAC;AAC3E,YAAY,EAAE,qBAAqB,EAAE,MAAM,mBAAmB,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"json.d.ts","sourceRoot":"","sources":["../../../src/features/format/json.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,8BAA8B,CAAC;AAE5D;;GAEG;AACH,wBAAgB,UAAU,CAAC,KAAK,EAAE,OAAO,EAAE,GAAG,MAAM,CAEnD"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"pretty.d.ts","sourceRoot":"","sources":["../../../src/features/format/pretty.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,8BAA8B,CAAC;AA+E5D;;GAEG;AACH,wBAAgB,YAAY,CAAC,KAAK,EAAE,OAAO,EAAE,GAAG,MAAM,CAMrD"}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Fulltext filename generation
|
|
3
|
+
*/
|
|
4
|
+
import type { CslItem } from "../../core/csl-json/types.js";
|
|
5
|
+
import { type FulltextType } from "./types.js";
|
|
6
|
+
/**
|
|
7
|
+
* Generate a filename for a fulltext file.
|
|
8
|
+
*
|
|
9
|
+
* Format: {id}[-PMID{PMID}]-{uuid}.{ext}
|
|
10
|
+
*
|
|
11
|
+
* @param item - CSL item to generate filename for
|
|
12
|
+
* @param type - Fulltext type (pdf or markdown)
|
|
13
|
+
* @returns Generated filename
|
|
14
|
+
* @throws Error if custom.uuid is missing
|
|
15
|
+
*/
|
|
16
|
+
export declare function generateFulltextFilename(item: CslItem, type: FulltextType): string;
|
|
17
|
+
//# sourceMappingURL=filename.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"filename.d.ts","sourceRoot":"","sources":["../../../src/features/fulltext/filename.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,8BAA8B,CAAC;AAC5D,OAAO,EAAuB,KAAK,YAAY,EAAE,MAAM,YAAY,CAAC;AAEpE;;;;;;;;;GASG;AACH,wBAAgB,wBAAwB,CAAC,IAAI,EAAE,OAAO,EAAE,IAAI,EAAE,YAAY,GAAG,MAAM,CAkBlF"}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Fulltext management exports
|
|
3
|
+
*/
|
|
4
|
+
export * from "./types.js";
|
|
5
|
+
export { generateFulltextFilename } from "./filename.js";
|
|
6
|
+
export { FulltextManager, FulltextIOError, FulltextNotAttachedError, type AttachOptions, type AttachResult, type DetachOptions, type DetachResult, } from "./manager.js";
|
|
7
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/features/fulltext/index.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH,cAAc,YAAY,CAAC;AAC3B,OAAO,EAAE,wBAAwB,EAAE,MAAM,eAAe,CAAC;AACzD,OAAO,EACL,eAAe,EACf,eAAe,EACf,wBAAwB,EACxB,KAAK,aAAa,EAClB,KAAK,YAAY,EACjB,KAAK,aAAa,EAClB,KAAK,YAAY,GAClB,MAAM,cAAc,CAAC"}
|
|
@@ -0,0 +1,109 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Fulltext file management
|
|
3
|
+
*/
|
|
4
|
+
import type { CslItem } from "../../core/csl-json/types.js";
|
|
5
|
+
import type { FulltextType } from "./types.js";
|
|
6
|
+
/**
|
|
7
|
+
* Error thrown when fulltext I/O operation fails
|
|
8
|
+
*/
|
|
9
|
+
export declare class FulltextIOError extends Error {
|
|
10
|
+
readonly cause?: Error | undefined;
|
|
11
|
+
constructor(message: string, cause?: Error | undefined);
|
|
12
|
+
}
|
|
13
|
+
/**
|
|
14
|
+
* Error thrown when trying to detach non-attached fulltext
|
|
15
|
+
*/
|
|
16
|
+
export declare class FulltextNotAttachedError extends Error {
|
|
17
|
+
readonly itemId: string;
|
|
18
|
+
readonly type: FulltextType;
|
|
19
|
+
constructor(itemId: string, type: FulltextType);
|
|
20
|
+
}
|
|
21
|
+
/**
|
|
22
|
+
* Options for attachFile
|
|
23
|
+
*/
|
|
24
|
+
export interface AttachOptions {
|
|
25
|
+
/** Move file instead of copy (default: false) */
|
|
26
|
+
move?: boolean;
|
|
27
|
+
/** Overwrite existing attachment without confirmation (default: false) */
|
|
28
|
+
force?: boolean;
|
|
29
|
+
}
|
|
30
|
+
/**
|
|
31
|
+
* Result of attachFile operation
|
|
32
|
+
*/
|
|
33
|
+
export interface AttachResult {
|
|
34
|
+
/** Generated filename */
|
|
35
|
+
filename: string;
|
|
36
|
+
/** Existing filename if already attached (when force=false) */
|
|
37
|
+
existingFile?: string;
|
|
38
|
+
/** Whether existing file was overwritten */
|
|
39
|
+
overwritten: boolean;
|
|
40
|
+
/** Old filename that was deleted (when force=true and filename changed) */
|
|
41
|
+
deletedOldFile?: string;
|
|
42
|
+
}
|
|
43
|
+
/**
|
|
44
|
+
* Options for detachFile
|
|
45
|
+
*/
|
|
46
|
+
export interface DetachOptions {
|
|
47
|
+
/** Delete file from disk (default: false, metadata-only detach) */
|
|
48
|
+
delete?: boolean;
|
|
49
|
+
}
|
|
50
|
+
/**
|
|
51
|
+
* Result of detachFile operation
|
|
52
|
+
*/
|
|
53
|
+
export interface DetachResult {
|
|
54
|
+
/** Detached filename */
|
|
55
|
+
filename: string;
|
|
56
|
+
/** Whether file was deleted from disk */
|
|
57
|
+
deleted: boolean;
|
|
58
|
+
}
|
|
59
|
+
/**
|
|
60
|
+
* Manages fulltext file operations
|
|
61
|
+
*/
|
|
62
|
+
export declare class FulltextManager {
|
|
63
|
+
private readonly fulltextDirectory;
|
|
64
|
+
constructor(fulltextDirectory: string);
|
|
65
|
+
/**
|
|
66
|
+
* Ensure the fulltext directory exists
|
|
67
|
+
*/
|
|
68
|
+
ensureDirectory(): Promise<void>;
|
|
69
|
+
/**
|
|
70
|
+
* Attach a file to a reference
|
|
71
|
+
*/
|
|
72
|
+
attachFile(item: CslItem, sourcePath: string, type: FulltextType, options?: AttachOptions): Promise<AttachResult>;
|
|
73
|
+
/**
|
|
74
|
+
* Validate that source file exists
|
|
75
|
+
*/
|
|
76
|
+
private validateSourceFile;
|
|
77
|
+
/**
|
|
78
|
+
* Delete old file if force mode and filename changed
|
|
79
|
+
* @returns Deleted filename or undefined
|
|
80
|
+
*/
|
|
81
|
+
private deleteOldFileIfNeeded;
|
|
82
|
+
/**
|
|
83
|
+
* Copy or move file to destination
|
|
84
|
+
*/
|
|
85
|
+
private copyOrMoveFile;
|
|
86
|
+
/**
|
|
87
|
+
* Get the full path for an attached file
|
|
88
|
+
* @returns Full path or null if not attached
|
|
89
|
+
*/
|
|
90
|
+
getFilePath(item: CslItem, type: FulltextType): string | null;
|
|
91
|
+
/**
|
|
92
|
+
* Detach a file from a reference
|
|
93
|
+
*/
|
|
94
|
+
detachFile(item: CslItem, type: FulltextType, options?: DetachOptions): Promise<DetachResult>;
|
|
95
|
+
/**
|
|
96
|
+
* Get list of attached fulltext types
|
|
97
|
+
*/
|
|
98
|
+
getAttachedTypes(item: CslItem): FulltextType[];
|
|
99
|
+
/**
|
|
100
|
+
* Check if item has attachment
|
|
101
|
+
* @param type Optional type to check; if omitted, checks for any attachment
|
|
102
|
+
*/
|
|
103
|
+
hasAttachment(item: CslItem, type?: FulltextType): boolean;
|
|
104
|
+
/**
|
|
105
|
+
* Get existing filename from item metadata
|
|
106
|
+
*/
|
|
107
|
+
private getExistingFilename;
|
|
108
|
+
}
|
|
109
|
+
//# sourceMappingURL=manager.d.ts.map
|
|
@@ -0,0 +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,8BAA8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AE,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"}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Fulltext management types
|
|
3
|
+
*/
|
|
4
|
+
/**
|
|
5
|
+
* Supported fulltext file types
|
|
6
|
+
*/
|
|
7
|
+
export type FulltextType = "pdf" | "markdown";
|
|
8
|
+
/**
|
|
9
|
+
* File extensions for each fulltext type
|
|
10
|
+
*/
|
|
11
|
+
export declare const FULLTEXT_EXTENSIONS: Record<FulltextType, string>;
|
|
12
|
+
//# sourceMappingURL=types.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../src/features/fulltext/types.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH;;GAEG;AACH,MAAM,MAAM,YAAY,GAAG,KAAK,GAAG,UAAU,CAAC;AAE9C;;GAEG;AACH,eAAO,MAAM,mBAAmB,EAAE,MAAM,CAAC,YAAY,EAAE,MAAM,CAG5D,CAAC"}
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Response cache for PMID and DOI metadata
|
|
3
|
+
*
|
|
4
|
+
* In-memory cache with TTL to avoid redundant API calls.
|
|
5
|
+
* - Per ADR-001: No persistent cache files on disk
|
|
6
|
+
* - Cache is warm during interactive sessions (server mode)
|
|
7
|
+
* - CLI invocations start fresh
|
|
8
|
+
*/
|
|
9
|
+
import type { CslItem } from "../../core/csl-json/types.js";
|
|
10
|
+
/**
|
|
11
|
+
* Cache configuration
|
|
12
|
+
*/
|
|
13
|
+
export interface CacheConfig {
|
|
14
|
+
/** Time-to-live in milliseconds (default: 1 hour) */
|
|
15
|
+
ttlMs?: number;
|
|
16
|
+
}
|
|
17
|
+
/**
|
|
18
|
+
* Get cached PMID result
|
|
19
|
+
*/
|
|
20
|
+
export declare function getPmidFromCache(pmid: string): CslItem | undefined;
|
|
21
|
+
/**
|
|
22
|
+
* Cache PMID result
|
|
23
|
+
*/
|
|
24
|
+
export declare function cachePmidResult(pmid: string, item: CslItem, config?: CacheConfig): void;
|
|
25
|
+
/**
|
|
26
|
+
* Get cached DOI result
|
|
27
|
+
*/
|
|
28
|
+
export declare function getDoiFromCache(doi: string): CslItem | undefined;
|
|
29
|
+
/**
|
|
30
|
+
* Cache DOI result
|
|
31
|
+
*/
|
|
32
|
+
export declare function cacheDoiResult(doi: string, item: CslItem, config?: CacheConfig): void;
|
|
33
|
+
/**
|
|
34
|
+
* Reset all caches (for test isolation)
|
|
35
|
+
*/
|
|
36
|
+
export declare function resetCache(): void;
|
|
37
|
+
//# sourceMappingURL=cache.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"cache.d.ts","sourceRoot":"","sources":["../../../src/features/import/cache.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAEH,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,8BAA8B,CAAC;AAK5D;;GAEG;AACH,MAAM,WAAW,WAAW;IAC1B,qDAAqD;IACrD,KAAK,CAAC,EAAE,MAAM,CAAC;CAChB;AAyDD;;GAEG;AACH,wBAAgB,gBAAgB,CAAC,IAAI,EAAE,MAAM,GAAG,OAAO,GAAG,SAAS,CAElE;AAED;;GAEG;AACH,wBAAgB,eAAe,CAAC,IAAI,EAAE,MAAM,EAAE,IAAI,EAAE,OAAO,EAAE,MAAM,CAAC,EAAE,WAAW,GAAG,IAAI,CAEvF;AAED;;GAEG;AACH,wBAAgB,eAAe,CAAC,GAAG,EAAE,MAAM,GAAG,OAAO,GAAG,SAAS,CAEhE;AAED;;GAEG;AACH,wBAAgB,cAAc,CAAC,GAAG,EAAE,MAAM,EAAE,IAAI,EAAE,OAAO,EAAE,MAAM,CAAC,EAAE,WAAW,GAAG,IAAI,CAErF;AAED;;GAEG;AACH,wBAAgB,UAAU,IAAI,IAAI,CAGjC"}
|