paper-search-cli 0.3.1 → 0.3.2
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 +1 -1
- package/README.zh.md +1 -1
- package/dist/capabilities/body-snippet-search/handler.d.ts +9 -0
- package/dist/capabilities/body-snippet-search/handler.d.ts.map +1 -0
- package/dist/capabilities/body-snippet-search/handler.js +17 -0
- package/dist/capabilities/body-snippet-search/handler.js.map +1 -0
- package/dist/capabilities/body-snippet-search/index.d.ts +7 -0
- package/dist/capabilities/body-snippet-search/index.d.ts.map +1 -0
- package/dist/capabilities/body-snippet-search/index.js +6 -0
- package/dist/capabilities/body-snippet-search/index.js.map +1 -0
- package/dist/capabilities/body-snippet-search/schemas.d.ts +36 -0
- package/dist/capabilities/body-snippet-search/schemas.d.ts.map +1 -0
- package/dist/capabilities/body-snippet-search/schemas.js +16 -0
- package/dist/capabilities/body-snippet-search/schemas.js.map +1 -0
- package/dist/capabilities/body-snippet-search/service.d.ts +4 -0
- package/dist/capabilities/body-snippet-search/service.d.ts.map +1 -0
- package/dist/capabilities/body-snippet-search/service.js +4 -0
- package/dist/capabilities/body-snippet-search/service.js.map +1 -0
- package/dist/capabilities/body-snippet-search/tools.d.ts +187 -0
- package/dist/capabilities/body-snippet-search/tools.d.ts.map +1 -0
- package/dist/capabilities/body-snippet-search/tools.js +49 -0
- package/dist/capabilities/body-snippet-search/tools.js.map +1 -0
- package/dist/capabilities/body-snippet-search/types.d.ts +14 -0
- package/dist/capabilities/body-snippet-search/types.d.ts.map +1 -0
- package/dist/capabilities/body-snippet-search/types.js +2 -0
- package/dist/capabilities/body-snippet-search/types.js.map +1 -0
- package/dist/capabilities/citation-expansion/CitationService.d.ts +47 -0
- package/dist/capabilities/citation-expansion/CitationService.d.ts.map +1 -0
- package/dist/capabilities/citation-expansion/CitationService.js +243 -0
- package/dist/capabilities/citation-expansion/CitationService.js.map +1 -0
- package/dist/capabilities/citation-expansion/handler.d.ts +36 -0
- package/dist/capabilities/citation-expansion/handler.d.ts.map +1 -0
- package/dist/capabilities/citation-expansion/handler.js +44 -0
- package/dist/capabilities/citation-expansion/handler.js.map +1 -0
- package/dist/capabilities/citation-expansion/index.d.ts +6 -0
- package/dist/capabilities/citation-expansion/index.d.ts.map +1 -0
- package/dist/capabilities/citation-expansion/index.js +5 -0
- package/dist/capabilities/citation-expansion/index.js.map +1 -0
- package/dist/capabilities/citation-expansion/schemas.d.ts +28 -0
- package/dist/capabilities/citation-expansion/schemas.d.ts.map +1 -0
- package/dist/capabilities/citation-expansion/schemas.js +13 -0
- package/dist/capabilities/citation-expansion/schemas.js.map +1 -0
- package/dist/capabilities/citation-expansion/tools.d.ts +82 -0
- package/dist/capabilities/citation-expansion/tools.d.ts.map +1 -0
- package/dist/capabilities/citation-expansion/tools.js +48 -0
- package/dist/capabilities/citation-expansion/tools.js.map +1 -0
- package/dist/capabilities/citation-expansion/types.d.ts +22 -0
- package/dist/capabilities/citation-expansion/types.d.ts.map +1 -0
- package/dist/capabilities/citation-expansion/types.js +2 -0
- package/dist/capabilities/citation-expansion/types.js.map +1 -0
- package/dist/capabilities/journal-metrics/JournalMetricsService.d.ts +3 -0
- package/dist/capabilities/journal-metrics/JournalMetricsService.d.ts.map +1 -0
- package/dist/capabilities/journal-metrics/JournalMetricsService.js +142 -0
- package/dist/capabilities/journal-metrics/JournalMetricsService.js.map +1 -0
- package/dist/capabilities/journal-metrics/handler.d.ts +12 -0
- package/dist/capabilities/journal-metrics/handler.d.ts.map +1 -0
- package/dist/capabilities/journal-metrics/handler.js +38 -0
- package/dist/capabilities/journal-metrics/handler.js.map +1 -0
- package/dist/capabilities/journal-metrics/index.d.ts +6 -0
- package/dist/capabilities/journal-metrics/index.d.ts.map +1 -0
- package/dist/capabilities/journal-metrics/index.js +5 -0
- package/dist/capabilities/journal-metrics/index.js.map +1 -0
- package/dist/capabilities/journal-metrics/schemas.d.ts +28 -0
- package/dist/capabilities/journal-metrics/schemas.d.ts.map +1 -0
- package/dist/capabilities/journal-metrics/schemas.js +13 -0
- package/dist/capabilities/journal-metrics/schemas.js.map +1 -0
- package/dist/capabilities/journal-metrics/tools.d.ts +67 -0
- package/dist/capabilities/journal-metrics/tools.d.ts.map +1 -0
- package/dist/capabilities/journal-metrics/tools.js +27 -0
- package/dist/capabilities/journal-metrics/tools.js.map +1 -0
- package/dist/capabilities/journal-metrics/types.d.ts +36 -0
- package/dist/capabilities/journal-metrics/types.d.ts.map +1 -0
- package/dist/capabilities/journal-metrics/types.js +2 -0
- package/dist/capabilities/journal-metrics/types.js.map +1 -0
- package/dist/capabilities/metadata-search/MultiSourceSearchService.d.ts +9 -0
- package/dist/capabilities/metadata-search/MultiSourceSearchService.d.ts.map +1 -0
- package/dist/capabilities/metadata-search/MultiSourceSearchService.js +78 -0
- package/dist/capabilities/metadata-search/MultiSourceSearchService.js.map +1 -0
- package/dist/capabilities/metadata-search/handler.d.ts +23 -0
- package/dist/capabilities/metadata-search/handler.d.ts.map +1 -0
- package/dist/capabilities/metadata-search/handler.js +163 -0
- package/dist/capabilities/metadata-search/handler.js.map +1 -0
- package/dist/capabilities/metadata-search/index.d.ts +6 -0
- package/dist/capabilities/metadata-search/index.d.ts.map +1 -0
- package/dist/capabilities/metadata-search/index.js +5 -0
- package/dist/capabilities/metadata-search/index.js.map +1 -0
- package/dist/capabilities/metadata-search/schemas.d.ts +83 -0
- package/dist/capabilities/metadata-search/schemas.d.ts.map +1 -0
- package/dist/capabilities/metadata-search/schemas.js +81 -0
- package/dist/capabilities/metadata-search/schemas.js.map +1 -0
- package/dist/capabilities/metadata-search/tools.d.ts +178 -0
- package/dist/capabilities/metadata-search/tools.d.ts.map +1 -0
- package/dist/capabilities/metadata-search/tools.js +75 -0
- package/dist/capabilities/metadata-search/tools.js.map +1 -0
- package/dist/capabilities/metadata-search/types.d.ts +13 -0
- package/dist/capabilities/metadata-search/types.d.ts.map +1 -0
- package/dist/capabilities/metadata-search/types.js +2 -0
- package/dist/capabilities/metadata-search/types.js.map +1 -0
- package/dist/capabilities/pdf-discovery/DownloadTier.d.ts +22 -0
- package/dist/capabilities/pdf-discovery/DownloadTier.d.ts.map +1 -0
- package/dist/capabilities/pdf-discovery/DownloadTier.js +2 -0
- package/dist/capabilities/pdf-discovery/DownloadTier.js.map +1 -0
- package/dist/capabilities/pdf-discovery/OpenAccessFallbackService.d.ts +10 -0
- package/dist/capabilities/pdf-discovery/OpenAccessFallbackService.d.ts.map +1 -0
- package/dist/capabilities/pdf-discovery/OpenAccessFallbackService.js +53 -0
- package/dist/capabilities/pdf-discovery/OpenAccessFallbackService.js.map +1 -0
- package/dist/capabilities/pdf-discovery/handler.d.ts +19 -0
- package/dist/capabilities/pdf-discovery/handler.d.ts.map +1 -0
- package/dist/capabilities/pdf-discovery/handler.js +56 -0
- package/dist/capabilities/pdf-discovery/handler.js.map +1 -0
- package/dist/capabilities/pdf-discovery/index.d.ts +7 -0
- package/dist/capabilities/pdf-discovery/index.d.ts.map +1 -0
- package/dist/capabilities/pdf-discovery/index.js +5 -0
- package/dist/capabilities/pdf-discovery/index.js.map +1 -0
- package/dist/capabilities/pdf-discovery/schemas.d.ts +37 -0
- package/dist/capabilities/pdf-discovery/schemas.d.ts.map +1 -0
- package/dist/capabilities/pdf-discovery/schemas.js +22 -0
- package/dist/capabilities/pdf-discovery/schemas.js.map +1 -0
- package/dist/capabilities/pdf-discovery/tiers/directPdfUrl.d.ts +3 -0
- package/dist/capabilities/pdf-discovery/tiers/directPdfUrl.d.ts.map +1 -0
- package/dist/capabilities/pdf-discovery/tiers/directPdfUrl.js +27 -0
- package/dist/capabilities/pdf-discovery/tiers/directPdfUrl.js.map +1 -0
- package/dist/capabilities/pdf-discovery/tiers/primary.d.ts +3 -0
- package/dist/capabilities/pdf-discovery/tiers/primary.d.ts.map +1 -0
- package/dist/capabilities/pdf-discovery/tiers/primary.js +21 -0
- package/dist/capabilities/pdf-discovery/tiers/primary.js.map +1 -0
- package/dist/capabilities/pdf-discovery/tiers/repositories.d.ts +3 -0
- package/dist/capabilities/pdf-discovery/tiers/repositories.d.ts.map +1 -0
- package/dist/capabilities/pdf-discovery/tiers/repositories.js +35 -0
- package/dist/capabilities/pdf-discovery/tiers/repositories.js.map +1 -0
- package/dist/capabilities/pdf-discovery/tiers/scihub.d.ts +3 -0
- package/dist/capabilities/pdf-discovery/tiers/scihub.d.ts.map +1 -0
- package/dist/capabilities/pdf-discovery/tiers/scihub.js +21 -0
- package/dist/capabilities/pdf-discovery/tiers/scihub.js.map +1 -0
- package/dist/capabilities/pdf-discovery/tiers/unpaywall.d.ts +3 -0
- package/dist/capabilities/pdf-discovery/tiers/unpaywall.d.ts.map +1 -0
- package/dist/capabilities/pdf-discovery/tiers/unpaywall.js +29 -0
- package/dist/capabilities/pdf-discovery/tiers/unpaywall.js.map +1 -0
- package/dist/capabilities/pdf-discovery/tools.d.ts +114 -0
- package/dist/capabilities/pdf-discovery/tools.d.ts.map +1 -0
- package/dist/capabilities/pdf-discovery/tools.js +42 -0
- package/dist/capabilities/pdf-discovery/tools.js.map +1 -0
- package/dist/capabilities/pdf-discovery/types.d.ts +19 -0
- package/dist/capabilities/pdf-discovery/types.d.ts.map +1 -0
- package/dist/capabilities/pdf-discovery/types.js +2 -0
- package/dist/capabilities/pdf-discovery/types.js.map +1 -0
- package/dist/cli.js +6 -6
- package/dist/cli.js.map +1 -1
- package/dist/core/capabilityProfile.d.ts +1 -17
- package/dist/core/capabilityProfile.d.ts.map +1 -1
- package/dist/core/capabilityProfile.js +1 -166
- package/dist/core/capabilityProfile.js.map +1 -1
- package/dist/core/diagnostics.d.ts +1 -42
- package/dist/core/diagnostics.d.ts.map +1 -1
- package/dist/core/diagnostics.js +1 -585
- package/dist/core/diagnostics.js.map +1 -1
- package/dist/core/handleToolCall.d.ts +1 -0
- package/dist/core/handleToolCall.d.ts.map +1 -1
- package/dist/core/handleToolCall.js +265 -509
- package/dist/core/handleToolCall.js.map +1 -1
- package/dist/core/httpPolicies.d.ts +2 -0
- package/dist/core/httpPolicies.d.ts.map +1 -0
- package/dist/core/httpPolicies.js +2 -0
- package/dist/core/httpPolicies.js.map +1 -0
- package/dist/core/liveSmoke.d.ts +1 -41
- package/dist/core/liveSmoke.d.ts.map +1 -1
- package/dist/core/liveSmoke.js +1 -225
- package/dist/core/liveSmoke.js.map +1 -1
- package/dist/core/platformFactories.d.ts +2 -0
- package/dist/core/platformFactories.d.ts.map +1 -0
- package/dist/core/platformFactories.js +2 -0
- package/dist/core/platformFactories.js.map +1 -0
- package/dist/core/platformMetadata.d.ts +1 -27
- package/dist/core/platformMetadata.d.ts.map +1 -1
- package/dist/core/platformMetadata.js +1 -257
- package/dist/core/platformMetadata.js.map +1 -1
- package/dist/core/schemas.d.ts +10 -202
- package/dist/core/schemas.d.ts.map +1 -1
- package/dist/core/schemas.js +11 -118
- package/dist/core/schemas.js.map +1 -1
- package/dist/core/searchers.d.ts +24 -24
- package/dist/core/searchers.d.ts.map +1 -1
- package/dist/core/searchers.js +14 -79
- package/dist/core/searchers.js.map +1 -1
- package/dist/core/textReports.d.ts +1 -20
- package/dist/core/textReports.d.ts.map +1 -1
- package/dist/core/textReports.js +1 -84
- package/dist/core/textReports.js.map +1 -1
- package/dist/core/tools.d.ts.map +1 -1
- package/dist/core/tools.js +15 -237
- package/dist/core/tools.js.map +1 -1
- package/dist/infrastructure/cache/RequestCache.d.ts +26 -0
- package/dist/infrastructure/cache/RequestCache.d.ts.map +1 -0
- package/dist/infrastructure/cache/RequestCache.js +66 -0
- package/dist/infrastructure/cache/RequestCache.js.map +1 -0
- package/dist/infrastructure/http/ErrorHandler.d.ts +99 -0
- package/dist/infrastructure/http/ErrorHandler.d.ts.map +1 -0
- package/dist/infrastructure/http/ErrorHandler.js +266 -0
- package/dist/infrastructure/http/ErrorHandler.js.map +1 -0
- package/dist/infrastructure/http/HttpClient.d.ts +31 -0
- package/dist/infrastructure/http/HttpClient.d.ts.map +1 -0
- package/dist/infrastructure/http/HttpClient.js +50 -0
- package/dist/infrastructure/http/HttpClient.js.map +1 -0
- package/dist/infrastructure/pdf/PDFExtractor.d.ts +34 -0
- package/dist/infrastructure/pdf/PDFExtractor.d.ts.map +1 -0
- package/dist/infrastructure/pdf/PDFExtractor.js +130 -0
- package/dist/infrastructure/pdf/PDFExtractor.js.map +1 -0
- package/dist/infrastructure/pdf/PdfDownload.d.ts +7 -0
- package/dist/infrastructure/pdf/PdfDownload.d.ts.map +1 -0
- package/dist/infrastructure/pdf/PdfDownload.js +175 -0
- package/dist/infrastructure/pdf/PdfDownload.js.map +1 -0
- package/dist/infrastructure/rate-limit/RateLimiter.d.ts +50 -0
- package/dist/infrastructure/rate-limit/RateLimiter.d.ts.map +1 -0
- package/dist/infrastructure/rate-limit/RateLimiter.js +128 -0
- package/dist/infrastructure/rate-limit/RateLimiter.js.map +1 -0
- package/dist/infrastructure/security/SecurityUtils.d.ts +80 -0
- package/dist/infrastructure/security/SecurityUtils.d.ts.map +1 -0
- package/dist/infrastructure/security/SecurityUtils.js +357 -0
- package/dist/infrastructure/security/SecurityUtils.js.map +1 -0
- package/dist/management/capability-profile/index.d.ts +18 -0
- package/dist/management/capability-profile/index.d.ts.map +1 -0
- package/dist/management/capability-profile/index.js +167 -0
- package/dist/management/capability-profile/index.js.map +1 -0
- package/dist/management/config/index.d.ts +2 -0
- package/dist/management/config/index.d.ts.map +1 -0
- package/dist/management/config/index.js +2 -0
- package/dist/management/config/index.js.map +1 -0
- package/dist/management/diagnostics/index.d.ts +43 -0
- package/dist/management/diagnostics/index.d.ts.map +1 -0
- package/dist/management/diagnostics/index.js +586 -0
- package/dist/management/diagnostics/index.js.map +1 -0
- package/dist/management/reports/index.d.ts +21 -0
- package/dist/management/reports/index.d.ts.map +1 -0
- package/dist/management/reports/index.js +85 -0
- package/dist/management/reports/index.js.map +1 -0
- package/dist/management/skills/index.d.ts +2 -0
- package/dist/management/skills/index.d.ts.map +1 -0
- package/dist/management/skills/index.js +2 -0
- package/dist/management/skills/index.js.map +1 -0
- package/dist/management/smoke/index.d.ts +42 -0
- package/dist/management/smoke/index.d.ts.map +1 -0
- package/dist/management/smoke/index.js +226 -0
- package/dist/management/smoke/index.js.map +1 -0
- package/dist/registry/aliases.d.ts +2 -0
- package/dist/registry/aliases.d.ts.map +1 -0
- package/dist/registry/aliases.js +2 -0
- package/dist/registry/aliases.js.map +1 -0
- package/dist/registry/httpPolicies.d.ts +3 -0
- package/dist/registry/httpPolicies.d.ts.map +1 -0
- package/dist/registry/httpPolicies.js +17 -0
- package/dist/registry/httpPolicies.js.map +1 -0
- package/dist/registry/platformFactories.d.ts +8 -0
- package/dist/registry/platformFactories.d.ts.map +1 -0
- package/dist/registry/platformFactories.js +55 -0
- package/dist/registry/platformFactories.js.map +1 -0
- package/dist/registry/platformMetadata.d.ts +39 -0
- package/dist/registry/platformMetadata.d.ts.map +1 -0
- package/dist/registry/platformMetadata.js +321 -0
- package/dist/registry/platformMetadata.js.map +1 -0
- package/dist/services/CitationService.d.ts +2 -65
- package/dist/services/CitationService.d.ts.map +1 -1
- package/dist/services/CitationService.js +1 -242
- package/dist/services/CitationService.js.map +1 -1
- package/dist/services/JournalMetricsService.d.ts +2 -37
- package/dist/services/JournalMetricsService.d.ts.map +1 -1
- package/dist/services/JournalMetricsService.js +1 -141
- package/dist/services/JournalMetricsService.js.map +1 -1
- package/dist/services/MultiSourceSearchService.d.ts +2 -18
- package/dist/services/MultiSourceSearchService.d.ts.map +1 -1
- package/dist/services/MultiSourceSearchService.js +1 -77
- package/dist/services/MultiSourceSearchService.js.map +1 -1
- package/dist/services/OpenAccessFallbackService.d.ts +3 -40
- package/dist/services/OpenAccessFallbackService.d.ts.map +1 -1
- package/dist/services/OpenAccessFallbackService.js +1 -146
- package/dist/services/OpenAccessFallbackService.js.map +1 -1
- package/dist/utils/ErrorHandler.d.ts +2 -98
- package/dist/utils/ErrorHandler.d.ts.map +1 -1
- package/dist/utils/ErrorHandler.js +2 -265
- package/dist/utils/ErrorHandler.js.map +1 -1
- package/dist/utils/HttpClient.d.ts +1 -5
- package/dist/utils/HttpClient.d.ts.map +1 -1
- package/dist/utils/HttpClient.js +1 -29
- package/dist/utils/HttpClient.js.map +1 -1
- package/dist/utils/PDFExtractor.d.ts +2 -33
- package/dist/utils/PDFExtractor.d.ts.map +1 -1
- package/dist/utils/PDFExtractor.js +2 -129
- package/dist/utils/PDFExtractor.js.map +1 -1
- package/dist/utils/PdfDownload.d.ts +1 -6
- package/dist/utils/PdfDownload.d.ts.map +1 -1
- package/dist/utils/PdfDownload.js +1 -141
- package/dist/utils/PdfDownload.js.map +1 -1
- package/dist/utils/RateLimiter.d.ts +1 -49
- package/dist/utils/RateLimiter.d.ts.map +1 -1
- package/dist/utils/RateLimiter.js +1 -127
- package/dist/utils/RateLimiter.js.map +1 -1
- package/dist/utils/RequestCache.d.ts +2 -25
- package/dist/utils/RequestCache.d.ts.map +1 -1
- package/dist/utils/RequestCache.js +2 -65
- package/dist/utils/RequestCache.js.map +1 -1
- package/dist/utils/SecurityUtils.d.ts +2 -79
- package/dist/utils/SecurityUtils.d.ts.map +1 -1
- package/dist/utils/SecurityUtils.js +2 -356
- package/dist/utils/SecurityUtils.js.map +1 -1
- package/package.json +1 -1
|
@@ -0,0 +1,321 @@
|
|
|
1
|
+
export const PLATFORM_METADATA = [
|
|
2
|
+
{
|
|
3
|
+
id: 'crossref',
|
|
4
|
+
displayName: 'Crossref',
|
|
5
|
+
sourceKind: 'official-api',
|
|
6
|
+
defaultInAll: true,
|
|
7
|
+
supportedOptions: ['maxResults', 'year', 'author', 'sortBy', 'sortOrder'],
|
|
8
|
+
schemaKind: 'crossref',
|
|
9
|
+
supportsDoiLookup: true,
|
|
10
|
+
capabilityGroups: ['metadata_search']
|
|
11
|
+
},
|
|
12
|
+
{
|
|
13
|
+
id: 'openalex',
|
|
14
|
+
displayName: 'OpenAlex',
|
|
15
|
+
sourceKind: 'official-api',
|
|
16
|
+
defaultInAll: true,
|
|
17
|
+
supportedOptions: ['maxResults', 'year'],
|
|
18
|
+
schemaKind: 'openalex',
|
|
19
|
+
supportsDoiLookup: true,
|
|
20
|
+
capabilityGroups: ['metadata_search', 'pdf_discovery']
|
|
21
|
+
},
|
|
22
|
+
{
|
|
23
|
+
id: 'pubmed',
|
|
24
|
+
displayName: 'PubMed',
|
|
25
|
+
sourceKind: 'official-api',
|
|
26
|
+
defaultInAll: true,
|
|
27
|
+
optionalConfigKeys: [['PUBMED_API_KEY'], ['NCBI_EMAIL'], ['NCBI_TOOL']],
|
|
28
|
+
supportedOptions: ['maxResults', 'year', 'author', 'journal', 'sortBy'],
|
|
29
|
+
schemaKind: 'pubmed',
|
|
30
|
+
supportsDoiLookup: true,
|
|
31
|
+
capabilityGroups: ['metadata_search']
|
|
32
|
+
},
|
|
33
|
+
{
|
|
34
|
+
id: 'pmc',
|
|
35
|
+
aliases: ['pubmed_central'],
|
|
36
|
+
displayName: 'PubMed Central',
|
|
37
|
+
sourceKind: 'official-api',
|
|
38
|
+
defaultInAll: true,
|
|
39
|
+
supportedOptions: ['maxResults', 'year'],
|
|
40
|
+
schemaKind: 'pmc-style',
|
|
41
|
+
supportsDoiLookup: true,
|
|
42
|
+
isRepository: true,
|
|
43
|
+
capabilityGroups: ['metadata_search', 'pdf_discovery']
|
|
44
|
+
},
|
|
45
|
+
{
|
|
46
|
+
id: 'europepmc',
|
|
47
|
+
aliases: ['europe_pmc'],
|
|
48
|
+
displayName: 'Europe PMC',
|
|
49
|
+
sourceKind: 'official-api',
|
|
50
|
+
defaultInAll: true,
|
|
51
|
+
supportedOptions: ['maxResults', 'year'],
|
|
52
|
+
schemaKind: 'pmc-style',
|
|
53
|
+
supportsDoiLookup: true,
|
|
54
|
+
isRepository: true,
|
|
55
|
+
capabilityGroups: ['metadata_search', 'pdf_discovery']
|
|
56
|
+
},
|
|
57
|
+
{
|
|
58
|
+
id: 'arxiv',
|
|
59
|
+
displayName: 'arXiv',
|
|
60
|
+
sourceKind: 'official-api',
|
|
61
|
+
defaultInAll: true,
|
|
62
|
+
supportedOptions: ['maxResults', 'year', 'author', 'category', 'sortBy', 'sortOrder'],
|
|
63
|
+
schemaKind: 'arxiv',
|
|
64
|
+
capabilityGroups: ['metadata_search', 'pdf_discovery']
|
|
65
|
+
},
|
|
66
|
+
{
|
|
67
|
+
id: 'biorxiv',
|
|
68
|
+
displayName: 'bioRxiv',
|
|
69
|
+
sourceKind: 'official-api',
|
|
70
|
+
defaultInAll: true,
|
|
71
|
+
supportedOptions: ['maxResults', 'days', 'category'],
|
|
72
|
+
schemaKind: 'biorxiv',
|
|
73
|
+
capabilityGroups: ['metadata_search', 'pdf_discovery']
|
|
74
|
+
},
|
|
75
|
+
{
|
|
76
|
+
id: 'medrxiv',
|
|
77
|
+
displayName: 'medRxiv',
|
|
78
|
+
sourceKind: 'official-api',
|
|
79
|
+
defaultInAll: true,
|
|
80
|
+
supportedOptions: ['maxResults', 'days', 'category'],
|
|
81
|
+
schemaKind: 'medrxiv',
|
|
82
|
+
capabilityGroups: ['metadata_search', 'pdf_discovery']
|
|
83
|
+
},
|
|
84
|
+
{
|
|
85
|
+
id: 'semantic',
|
|
86
|
+
displayName: 'Semantic Scholar',
|
|
87
|
+
sourceKind: 'official-api',
|
|
88
|
+
defaultInAll: true,
|
|
89
|
+
optionalConfigKeys: [['SEMANTIC_SCHOLAR_API_KEY']],
|
|
90
|
+
supportedOptions: ['maxResults', 'year', 'fieldsOfStudy', 'sortBy'],
|
|
91
|
+
schemaKind: 'semantic-scholar',
|
|
92
|
+
supportsDoiLookup: true,
|
|
93
|
+
capabilityGroups: ['metadata_search', 'citation_expansion', 'body_snippet_search', 'pdf_discovery']
|
|
94
|
+
},
|
|
95
|
+
{
|
|
96
|
+
id: 'iacr',
|
|
97
|
+
displayName: 'IACR ePrint',
|
|
98
|
+
sourceKind: 'html',
|
|
99
|
+
defaultInAll: true,
|
|
100
|
+
supportedOptions: ['maxResults', 'fetchDetails'],
|
|
101
|
+
schemaKind: 'iacr',
|
|
102
|
+
capabilityGroups: ['metadata_search', 'pdf_discovery']
|
|
103
|
+
},
|
|
104
|
+
{
|
|
105
|
+
id: 'core',
|
|
106
|
+
displayName: 'CORE',
|
|
107
|
+
sourceKind: 'official-api',
|
|
108
|
+
defaultInAll: true,
|
|
109
|
+
optionalConfigKeys: [['CORE_API_KEY']],
|
|
110
|
+
supportedOptions: ['maxResults', 'year'],
|
|
111
|
+
schemaKind: 'core',
|
|
112
|
+
isRepository: true,
|
|
113
|
+
capabilityGroups: ['metadata_search', 'pdf_discovery']
|
|
114
|
+
},
|
|
115
|
+
{
|
|
116
|
+
id: 'openaire',
|
|
117
|
+
displayName: 'OpenAIRE',
|
|
118
|
+
sourceKind: 'official-api',
|
|
119
|
+
defaultInAll: true,
|
|
120
|
+
optionalConfigKeys: [['OPENAIRE_API_KEY']],
|
|
121
|
+
supportedOptions: ['maxResults', 'year'],
|
|
122
|
+
schemaKind: 'pmc-style',
|
|
123
|
+
isRepository: true,
|
|
124
|
+
capabilityGroups: ['metadata_search', 'pdf_discovery']
|
|
125
|
+
},
|
|
126
|
+
{
|
|
127
|
+
id: 'googlescholar',
|
|
128
|
+
aliases: ['scholar', 'google_scholar'],
|
|
129
|
+
displayName: 'Google Scholar',
|
|
130
|
+
sourceKind: 'html',
|
|
131
|
+
defaultInAll: true,
|
|
132
|
+
supportedOptions: ['maxResults', 'year', 'author'],
|
|
133
|
+
schemaKind: 'google-scholar',
|
|
134
|
+
capabilityGroups: ['metadata_search']
|
|
135
|
+
},
|
|
136
|
+
{
|
|
137
|
+
id: 'webofscience',
|
|
138
|
+
aliases: ['wos'],
|
|
139
|
+
displayName: 'Web of Science',
|
|
140
|
+
sourceKind: 'official-api',
|
|
141
|
+
defaultInAll: true,
|
|
142
|
+
configKeys: [['WOS_API_KEY']],
|
|
143
|
+
optionalConfigKeys: [['WOS_API_VERSION']],
|
|
144
|
+
supportedOptions: ['maxResults', 'year', 'author', 'journal', 'sortBy', 'sortOrder'],
|
|
145
|
+
schemaKind: 'webofscience',
|
|
146
|
+
capabilityGroups: ['metadata_search', 'entitled_access']
|
|
147
|
+
},
|
|
148
|
+
{
|
|
149
|
+
id: 'sciencedirect',
|
|
150
|
+
displayName: 'ScienceDirect',
|
|
151
|
+
sourceKind: 'official-api',
|
|
152
|
+
defaultInAll: true,
|
|
153
|
+
configKeys: [['ELSEVIER_API_KEY']],
|
|
154
|
+
supportedOptions: ['maxResults', 'year', 'author', 'journal', 'openAccess'],
|
|
155
|
+
schemaKind: 'sciencedirect',
|
|
156
|
+
capabilityGroups: ['metadata_search', 'pdf_discovery', 'entitled_access']
|
|
157
|
+
},
|
|
158
|
+
{
|
|
159
|
+
id: 'springer',
|
|
160
|
+
aliases: ['springerlink'],
|
|
161
|
+
displayName: 'Springer Nature',
|
|
162
|
+
sourceKind: 'official-api',
|
|
163
|
+
defaultInAll: true,
|
|
164
|
+
configKeys: [['SPRINGER_API_KEY']],
|
|
165
|
+
optionalConfigKeys: [['SPRINGER_OPENACCESS_API_KEY']],
|
|
166
|
+
supportedOptions: ['maxResults', 'year', 'author', 'journal', 'openAccess', 'subject', 'type'],
|
|
167
|
+
schemaKind: 'springer',
|
|
168
|
+
capabilityGroups: ['metadata_search', 'pdf_discovery', 'entitled_access']
|
|
169
|
+
},
|
|
170
|
+
{
|
|
171
|
+
id: 'scopus',
|
|
172
|
+
displayName: 'Scopus',
|
|
173
|
+
sourceKind: 'official-api',
|
|
174
|
+
defaultInAll: true,
|
|
175
|
+
configKeys: [['ELSEVIER_API_KEY']],
|
|
176
|
+
optionalConfigKeys: [['SCOPUS_SEARCH_API_KEY']],
|
|
177
|
+
supportedOptions: ['maxResults', 'year', 'author', 'journal', 'affiliation', 'subject', 'openAccess', 'documentType'],
|
|
178
|
+
schemaKind: 'scopus',
|
|
179
|
+
capabilityGroups: ['metadata_search', 'pdf_discovery', 'entitled_access']
|
|
180
|
+
},
|
|
181
|
+
{
|
|
182
|
+
id: 'scihub',
|
|
183
|
+
displayName: 'Sci-Hub',
|
|
184
|
+
sourceKind: 'html',
|
|
185
|
+
defaultInAll: true,
|
|
186
|
+
supportedOptions: ['maxResults'],
|
|
187
|
+
schemaKind: 'scihub',
|
|
188
|
+
capabilityGroups: ['pdf_discovery']
|
|
189
|
+
},
|
|
190
|
+
{
|
|
191
|
+
id: 'unpaywall',
|
|
192
|
+
displayName: 'Unpaywall',
|
|
193
|
+
sourceKind: 'official-api',
|
|
194
|
+
defaultInAll: true,
|
|
195
|
+
configKeys: [['PAPER_SEARCH_UNPAYWALL_EMAIL', 'UNPAYWALL_EMAIL']],
|
|
196
|
+
supportedOptions: ['maxResults'],
|
|
197
|
+
schemaKind: 'unpaywall',
|
|
198
|
+
isRepository: true,
|
|
199
|
+
capabilityGroups: ['metadata_search', 'pdf_discovery']
|
|
200
|
+
},
|
|
201
|
+
{
|
|
202
|
+
id: 'dblp',
|
|
203
|
+
displayName: 'DBLP',
|
|
204
|
+
sourceKind: 'official-api',
|
|
205
|
+
defaultInAll: true,
|
|
206
|
+
directTool: true,
|
|
207
|
+
toolName: 'search_dblp',
|
|
208
|
+
supportedOptions: ['maxResults', 'year', 'author', 'journal', 'sortBy', 'sortOrder'],
|
|
209
|
+
schemaKind: 'generic',
|
|
210
|
+
capabilityGroups: ['metadata_search'],
|
|
211
|
+
description: 'Search DBLP computer-science bibliography using the official public search API'
|
|
212
|
+
},
|
|
213
|
+
{
|
|
214
|
+
id: 'ieee',
|
|
215
|
+
displayName: 'IEEE Xplore',
|
|
216
|
+
sourceKind: 'official-api',
|
|
217
|
+
defaultInAll: true,
|
|
218
|
+
directTool: true,
|
|
219
|
+
toolName: 'search_ieee',
|
|
220
|
+
configKeys: [['IEEE_API_KEY']],
|
|
221
|
+
supportedOptions: ['maxResults', 'year', 'author', 'journal', 'sortBy', 'sortOrder', 'articleTitle', 'startRecord'],
|
|
222
|
+
schemaKind: 'generic',
|
|
223
|
+
capabilityGroups: ['metadata_search', 'entitled_access'],
|
|
224
|
+
description: 'Search IEEE Xplore metadata using the official API. Requires IEEE_API_KEY.'
|
|
225
|
+
},
|
|
226
|
+
{
|
|
227
|
+
id: 'acm',
|
|
228
|
+
displayName: 'ACM Digital Library',
|
|
229
|
+
sourceKind: 'metadata-proxy',
|
|
230
|
+
defaultInAll: true,
|
|
231
|
+
directTool: true,
|
|
232
|
+
toolName: 'search_acm',
|
|
233
|
+
supportedOptions: ['maxResults', 'year', 'author', 'sortBy', 'sortOrder'],
|
|
234
|
+
schemaKind: 'generic',
|
|
235
|
+
capabilityGroups: ['metadata_search'],
|
|
236
|
+
description: 'Search ACM metadata through Crossref/OpenAlex-style metadata, constrained to ACM DOI records'
|
|
237
|
+
},
|
|
238
|
+
{
|
|
239
|
+
id: 'usenix',
|
|
240
|
+
displayName: 'USENIX',
|
|
241
|
+
sourceKind: 'metadata-proxy',
|
|
242
|
+
defaultInAll: true,
|
|
243
|
+
directTool: true,
|
|
244
|
+
toolName: 'search_usenix',
|
|
245
|
+
supportedOptions: ['maxResults', 'year', 'author', 'journal', 'sortBy', 'sortOrder'],
|
|
246
|
+
schemaKind: 'generic',
|
|
247
|
+
capabilityGroups: ['metadata_search'],
|
|
248
|
+
description: 'Search USENIX-related paper metadata through DBLP-backed discovery'
|
|
249
|
+
},
|
|
250
|
+
{
|
|
251
|
+
id: 'openreview',
|
|
252
|
+
displayName: 'OpenReview',
|
|
253
|
+
sourceKind: 'official-api',
|
|
254
|
+
defaultInAll: true,
|
|
255
|
+
directTool: true,
|
|
256
|
+
toolName: 'search_openreview',
|
|
257
|
+
supportedOptions: ['maxResults', 'year', 'author', 'journal', 'venue'],
|
|
258
|
+
schemaKind: 'generic',
|
|
259
|
+
capabilityGroups: ['metadata_search'],
|
|
260
|
+
description: 'Search public OpenReview notes using OpenReview APIs'
|
|
261
|
+
}
|
|
262
|
+
];
|
|
263
|
+
export const SEARCH_PLATFORM_IDS = PLATFORM_METADATA.map(platform => platform.id);
|
|
264
|
+
export const SEARCH_PLATFORM_VALUES = PLATFORM_METADATA.flatMap(platform => [
|
|
265
|
+
platform.id,
|
|
266
|
+
...(platform.aliases || [])
|
|
267
|
+
]);
|
|
268
|
+
export const DEFAULT_ALL_SOURCES = PLATFORM_METADATA
|
|
269
|
+
.filter(platform => platform.defaultInAll)
|
|
270
|
+
.map(platform => platform.id);
|
|
271
|
+
const ALIAS_TO_CANONICAL = new Map();
|
|
272
|
+
const METADATA_BY_ID = new Map();
|
|
273
|
+
const GENERIC_TOOL_ALIASES = new Map([
|
|
274
|
+
['search_springerlink', 'springerlink']
|
|
275
|
+
]);
|
|
276
|
+
for (const platform of PLATFORM_METADATA) {
|
|
277
|
+
METADATA_BY_ID.set(platform.id, platform);
|
|
278
|
+
for (const alias of platform.aliases || []) {
|
|
279
|
+
ALIAS_TO_CANONICAL.set(alias, platform.id);
|
|
280
|
+
}
|
|
281
|
+
}
|
|
282
|
+
export function resolvePlatformId(platform) {
|
|
283
|
+
const normalized = platform.trim().toLowerCase();
|
|
284
|
+
return ALIAS_TO_CANONICAL.get(normalized) || normalized;
|
|
285
|
+
}
|
|
286
|
+
export function isPlatformAlias(platform) {
|
|
287
|
+
return ALIAS_TO_CANONICAL.has(platform.trim().toLowerCase());
|
|
288
|
+
}
|
|
289
|
+
export function isKnownSearchPlatform(platform) {
|
|
290
|
+
const canonical = resolvePlatformId(platform);
|
|
291
|
+
return METADATA_BY_ID.has(canonical);
|
|
292
|
+
}
|
|
293
|
+
export function getPlatformMetadata(platform) {
|
|
294
|
+
return METADATA_BY_ID.get(resolvePlatformId(platform));
|
|
295
|
+
}
|
|
296
|
+
export function getDefaultAllSources() {
|
|
297
|
+
return [...DEFAULT_ALL_SOURCES];
|
|
298
|
+
}
|
|
299
|
+
export function getAliasMap() {
|
|
300
|
+
return Object.fromEntries(ALIAS_TO_CANONICAL.entries());
|
|
301
|
+
}
|
|
302
|
+
export function getGenericSearchToolPlatform(toolName) {
|
|
303
|
+
const aliasPlatform = GENERIC_TOOL_ALIASES.get(toolName);
|
|
304
|
+
if (aliasPlatform)
|
|
305
|
+
return aliasPlatform;
|
|
306
|
+
const platform = getGenericPlatformToolDescriptors().find(item => item.toolName === toolName);
|
|
307
|
+
return platform?.id;
|
|
308
|
+
}
|
|
309
|
+
export function getGenericSearchToolNames() {
|
|
310
|
+
return [
|
|
311
|
+
...getGenericPlatformToolDescriptors().map(item => item.toolName),
|
|
312
|
+
...GENERIC_TOOL_ALIASES.keys()
|
|
313
|
+
];
|
|
314
|
+
}
|
|
315
|
+
export function getPlatformToolDescriptors() {
|
|
316
|
+
return PLATFORM_METADATA.filter(platform => platform.directTool && platform.toolName);
|
|
317
|
+
}
|
|
318
|
+
export function getGenericPlatformToolDescriptors() {
|
|
319
|
+
return getPlatformToolDescriptors().filter(platform => platform.schemaKind === 'generic');
|
|
320
|
+
}
|
|
321
|
+
//# sourceMappingURL=platformMetadata.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"platformMetadata.js","sourceRoot":"","sources":["../../src/registry/platformMetadata.ts"],"names":[],"mappings":"AAmDA,MAAM,CAAC,MAAM,iBAAiB,GAAuB;IACnD;QACE,EAAE,EAAE,UAAU;QACd,WAAW,EAAE,UAAU;QACvB,UAAU,EAAE,cAAc;QAC1B,YAAY,EAAE,IAAI;QAClB,gBAAgB,EAAE,CAAC,YAAY,EAAE,MAAM,EAAE,QAAQ,EAAE,QAAQ,EAAE,WAAW,CAAC;QACzE,UAAU,EAAE,UAAU;QACtB,iBAAiB,EAAE,IAAI;QACvB,gBAAgB,EAAE,CAAC,iBAAiB,CAAC;KACtC;IACD;QACE,EAAE,EAAE,UAAU;QACd,WAAW,EAAE,UAAU;QACvB,UAAU,EAAE,cAAc;QAC1B,YAAY,EAAE,IAAI;QAClB,gBAAgB,EAAE,CAAC,YAAY,EAAE,MAAM,CAAC;QACxC,UAAU,EAAE,UAAU;QACtB,iBAAiB,EAAE,IAAI;QACvB,gBAAgB,EAAE,CAAC,iBAAiB,EAAE,eAAe,CAAC;KACvD;IACD;QACE,EAAE,EAAE,QAAQ;Q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C,OAAO,0BAA0B,EAAE,CAAC,MAAM,CAAC,QAAQ,CAAC,EAAE,CAAC,QAAQ,CAAC,UAAU,KAAK,SAAS,CAAC,CAAC;AAC5F,CAAC"}
|
|
@@ -1,66 +1,3 @@
|
|
|
1
|
-
export
|
|
2
|
-
|
|
3
|
-
title: string;
|
|
4
|
-
citationCount: number;
|
|
5
|
-
referenceCount: number;
|
|
6
|
-
influentialCitationCount?: number;
|
|
7
|
-
year?: number;
|
|
8
|
-
authors?: Array<{
|
|
9
|
-
name: string;
|
|
10
|
-
authorId?: string;
|
|
11
|
-
}>;
|
|
12
|
-
venue?: string;
|
|
13
|
-
doi?: string;
|
|
14
|
-
url?: string;
|
|
15
|
-
}
|
|
16
|
-
export interface BatchCitationRequest {
|
|
17
|
-
paperId?: string;
|
|
18
|
-
doi?: string;
|
|
19
|
-
arxivId?: string;
|
|
20
|
-
title?: string;
|
|
21
|
-
}
|
|
22
|
-
export declare class CitationService {
|
|
23
|
-
private client;
|
|
24
|
-
private cache;
|
|
25
|
-
private rateLimiter;
|
|
26
|
-
private apiKey?;
|
|
27
|
-
constructor(apiKey?: string);
|
|
28
|
-
/**
|
|
29
|
-
* Get citation data for a single paper by ID
|
|
30
|
-
*/
|
|
31
|
-
getCitationData(paperId: string, forceRefresh?: boolean): Promise<CitationData | null>;
|
|
32
|
-
/**
|
|
33
|
-
* Get citation data by DOI
|
|
34
|
-
*/
|
|
35
|
-
getCitationDataByDoi(doi: string, forceRefresh?: boolean): Promise<CitationData | null>;
|
|
36
|
-
/**
|
|
37
|
-
* Get citation data by arXiv ID
|
|
38
|
-
*/
|
|
39
|
-
getCitationDataByArxiv(arxivId: string, forceRefresh?: boolean): Promise<CitationData | null>;
|
|
40
|
-
/**
|
|
41
|
-
* Batch lookup citations for multiple papers
|
|
42
|
-
*/
|
|
43
|
-
batchLookup(requests: BatchCitationRequest[]): Promise<Map<string, CitationData | null>>;
|
|
44
|
-
/**
|
|
45
|
-
* Get references for a paper
|
|
46
|
-
*/
|
|
47
|
-
getReferences(paperId: string, limit?: number): Promise<CitationData[]>;
|
|
48
|
-
/**
|
|
49
|
-
* Get citations for a paper
|
|
50
|
-
*/
|
|
51
|
-
getCitations(paperId: string, limit?: number): Promise<CitationData[]>;
|
|
52
|
-
/**
|
|
53
|
-
* Parse Semantic Scholar response to CitationData
|
|
54
|
-
*/
|
|
55
|
-
private parseCitationData;
|
|
56
|
-
/**
|
|
57
|
-
* Get cache statistics
|
|
58
|
-
*/
|
|
59
|
-
getCacheStats(): import("../utils/RequestCache.js").CacheStats;
|
|
60
|
-
/**
|
|
61
|
-
* Clear cache
|
|
62
|
-
*/
|
|
63
|
-
clearCache(): void;
|
|
64
|
-
}
|
|
65
|
-
export default CitationService;
|
|
1
|
+
export { CitationService, default } from '../capabilities/citation-expansion/CitationService.js';
|
|
2
|
+
export type { BatchCitationRequest, CitationData } from '../capabilities/citation-expansion/types.js';
|
|
66
3
|
//# sourceMappingURL=CitationService.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"CitationService.d.ts","sourceRoot":"","sources":["../../src/services/CitationService.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"CitationService.d.ts","sourceRoot":"","sources":["../../src/services/CitationService.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,eAAe,EAAE,OAAO,EAAE,MAAM,uDAAuD,CAAC;AAEjG,YAAY,EAAE,oBAAoB,EAAE,YAAY,EAAE,MAAM,6CAA6C,CAAC"}
|
|
@@ -1,243 +1,2 @@
|
|
|
1
|
-
|
|
2
|
-
import { RequestCache } from '../utils/RequestCache.js';
|
|
3
|
-
import { RateLimiter } from '../utils/RateLimiter.js';
|
|
4
|
-
import { ErrorHandler } from '../utils/ErrorHandler.js';
|
|
5
|
-
import { TIMEOUTS, USER_AGENT } from '../config/constants.js';
|
|
6
|
-
import { logDebug, logWarn } from '../utils/Logger.js';
|
|
7
|
-
export class CitationService {
|
|
8
|
-
client;
|
|
9
|
-
cache;
|
|
10
|
-
rateLimiter;
|
|
11
|
-
apiKey;
|
|
12
|
-
constructor(apiKey) {
|
|
13
|
-
this.apiKey = apiKey || process.env.SEMANTIC_SCHOLAR_API_KEY;
|
|
14
|
-
this.client = axios.create({
|
|
15
|
-
baseURL: 'https://api.semanticscholar.org/graph/v1',
|
|
16
|
-
timeout: TIMEOUTS.DEFAULT,
|
|
17
|
-
headers: {
|
|
18
|
-
'Accept': 'application/json',
|
|
19
|
-
'User-Agent': USER_AGENT,
|
|
20
|
-
...(this.apiKey ? { 'x-api-key': this.apiKey } : {})
|
|
21
|
-
}
|
|
22
|
-
});
|
|
23
|
-
// Semantic Scholar rate limits: 100 req/5min (free), 1000 req/5min (paid)
|
|
24
|
-
const requestsPerMinute = this.apiKey ? 180 : 18;
|
|
25
|
-
this.rateLimiter = new RateLimiter({
|
|
26
|
-
requestsPerSecond: requestsPerMinute / 60,
|
|
27
|
-
burstCapacity: Math.max(3, Math.floor(requestsPerMinute / 20))
|
|
28
|
-
});
|
|
29
|
-
this.cache = new RequestCache({
|
|
30
|
-
maxSize: 500,
|
|
31
|
-
ttlMs: 86400000 // 24 hours
|
|
32
|
-
});
|
|
33
|
-
}
|
|
34
|
-
/**
|
|
35
|
-
* Get citation data for a single paper by ID
|
|
36
|
-
*/
|
|
37
|
-
async getCitationData(paperId, forceRefresh = false) {
|
|
38
|
-
try {
|
|
39
|
-
// Check cache first
|
|
40
|
-
if (!forceRefresh) {
|
|
41
|
-
const cacheKey = this.cache.generateKey('citation', paperId, {});
|
|
42
|
-
const cached = this.cache.get(cacheKey);
|
|
43
|
-
if (cached) {
|
|
44
|
-
return cached;
|
|
45
|
-
}
|
|
46
|
-
}
|
|
47
|
-
await this.rateLimiter.waitForPermission();
|
|
48
|
-
const fields = [
|
|
49
|
-
'paperId',
|
|
50
|
-
'title',
|
|
51
|
-
'citationCount',
|
|
52
|
-
'referenceCount',
|
|
53
|
-
'influentialCitationCount',
|
|
54
|
-
'year',
|
|
55
|
-
'authors',
|
|
56
|
-
'venue',
|
|
57
|
-
'externalIds',
|
|
58
|
-
'url'
|
|
59
|
-
].join(',');
|
|
60
|
-
const response = await ErrorHandler.retryWithBackoff(() => this.client.get(`/paper/${paperId}`, {
|
|
61
|
-
params: { fields }
|
|
62
|
-
}), { context: 'Semantic Scholar citation lookup' });
|
|
63
|
-
if (response.status !== 200 || !response.data) {
|
|
64
|
-
return null;
|
|
65
|
-
}
|
|
66
|
-
const data = this.parseCitationData(response.data);
|
|
67
|
-
// Cache the result
|
|
68
|
-
const cacheKey = this.cache.generateKey('citation', paperId, {});
|
|
69
|
-
this.cache.set(cacheKey, data);
|
|
70
|
-
return data;
|
|
71
|
-
}
|
|
72
|
-
catch (error) {
|
|
73
|
-
logWarn(`Error fetching citation data for ${paperId}:`, error.message);
|
|
74
|
-
return null;
|
|
75
|
-
}
|
|
76
|
-
}
|
|
77
|
-
/**
|
|
78
|
-
* Get citation data by DOI
|
|
79
|
-
*/
|
|
80
|
-
async getCitationDataByDoi(doi, forceRefresh = false) {
|
|
81
|
-
try {
|
|
82
|
-
const paperId = `DOI:${doi}`;
|
|
83
|
-
return await this.getCitationData(paperId, forceRefresh);
|
|
84
|
-
}
|
|
85
|
-
catch (error) {
|
|
86
|
-
logWarn(`Error fetching citation data by DOI ${doi}:`, error.message);
|
|
87
|
-
return null;
|
|
88
|
-
}
|
|
89
|
-
}
|
|
90
|
-
/**
|
|
91
|
-
* Get citation data by arXiv ID
|
|
92
|
-
*/
|
|
93
|
-
async getCitationDataByArxiv(arxivId, forceRefresh = false) {
|
|
94
|
-
try {
|
|
95
|
-
const paperId = `ARXIV:${arxivId}`;
|
|
96
|
-
return await this.getCitationData(paperId, forceRefresh);
|
|
97
|
-
}
|
|
98
|
-
catch (error) {
|
|
99
|
-
logWarn(`Error fetching citation data by arXiv ID ${arxivId}:`, error.message);
|
|
100
|
-
return null;
|
|
101
|
-
}
|
|
102
|
-
}
|
|
103
|
-
/**
|
|
104
|
-
* Batch lookup citations for multiple papers
|
|
105
|
-
*/
|
|
106
|
-
async batchLookup(requests) {
|
|
107
|
-
const results = new Map();
|
|
108
|
-
for (const request of requests) {
|
|
109
|
-
let paperId = null;
|
|
110
|
-
let key;
|
|
111
|
-
if (request.paperId) {
|
|
112
|
-
paperId = request.paperId;
|
|
113
|
-
key = request.paperId;
|
|
114
|
-
}
|
|
115
|
-
else if (request.doi) {
|
|
116
|
-
paperId = `DOI:${request.doi}`;
|
|
117
|
-
key = request.doi;
|
|
118
|
-
}
|
|
119
|
-
else if (request.arxivId) {
|
|
120
|
-
paperId = `ARXIV:${request.arxivId}`;
|
|
121
|
-
key = request.arxivId;
|
|
122
|
-
}
|
|
123
|
-
else if (request.title) {
|
|
124
|
-
key = request.title;
|
|
125
|
-
// Search by title (not implemented in this version)
|
|
126
|
-
results.set(key, null);
|
|
127
|
-
continue;
|
|
128
|
-
}
|
|
129
|
-
else {
|
|
130
|
-
continue;
|
|
131
|
-
}
|
|
132
|
-
try {
|
|
133
|
-
const data = await this.getCitationData(paperId);
|
|
134
|
-
results.set(key, data);
|
|
135
|
-
}
|
|
136
|
-
catch (error) {
|
|
137
|
-
logDebug(`Error in batch lookup for ${key}:`, error);
|
|
138
|
-
results.set(key, null);
|
|
139
|
-
}
|
|
140
|
-
}
|
|
141
|
-
return results;
|
|
142
|
-
}
|
|
143
|
-
/**
|
|
144
|
-
* Get references for a paper
|
|
145
|
-
*/
|
|
146
|
-
async getReferences(paperId, limit = 100) {
|
|
147
|
-
try {
|
|
148
|
-
await this.rateLimiter.waitForPermission();
|
|
149
|
-
const fields = [
|
|
150
|
-
'paperId',
|
|
151
|
-
'title',
|
|
152
|
-
'citationCount',
|
|
153
|
-
'referenceCount',
|
|
154
|
-
'year',
|
|
155
|
-
'authors',
|
|
156
|
-
'venue',
|
|
157
|
-
'externalIds',
|
|
158
|
-
'url'
|
|
159
|
-
].join(',');
|
|
160
|
-
const response = await ErrorHandler.retryWithBackoff(() => this.client.get(`/paper/${paperId}/references`, {
|
|
161
|
-
params: { fields, limit }
|
|
162
|
-
}), { context: 'Semantic Scholar references lookup' });
|
|
163
|
-
if (response.status !== 200 || !response.data?.data) {
|
|
164
|
-
return [];
|
|
165
|
-
}
|
|
166
|
-
return response.data.data
|
|
167
|
-
.map((item) => item.citedPaper)
|
|
168
|
-
.filter((paper) => paper)
|
|
169
|
-
.map((paper) => this.parseCitationData(paper));
|
|
170
|
-
}
|
|
171
|
-
catch (error) {
|
|
172
|
-
logWarn(`Error fetching references for ${paperId}:`, error.message);
|
|
173
|
-
return [];
|
|
174
|
-
}
|
|
175
|
-
}
|
|
176
|
-
/**
|
|
177
|
-
* Get citations for a paper
|
|
178
|
-
*/
|
|
179
|
-
async getCitations(paperId, limit = 100) {
|
|
180
|
-
try {
|
|
181
|
-
await this.rateLimiter.waitForPermission();
|
|
182
|
-
const fields = [
|
|
183
|
-
'paperId',
|
|
184
|
-
'title',
|
|
185
|
-
'citationCount',
|
|
186
|
-
'referenceCount',
|
|
187
|
-
'year',
|
|
188
|
-
'authors',
|
|
189
|
-
'venue',
|
|
190
|
-
'externalIds',
|
|
191
|
-
'url'
|
|
192
|
-
].join(',');
|
|
193
|
-
const response = await ErrorHandler.retryWithBackoff(() => this.client.get(`/paper/${paperId}/citations`, {
|
|
194
|
-
params: { fields, limit }
|
|
195
|
-
}), { context: 'Semantic Scholar citations lookup' });
|
|
196
|
-
if (response.status !== 200 || !response.data?.data) {
|
|
197
|
-
return [];
|
|
198
|
-
}
|
|
199
|
-
return response.data.data
|
|
200
|
-
.map((item) => item.citingPaper)
|
|
201
|
-
.filter((paper) => paper)
|
|
202
|
-
.map((paper) => this.parseCitationData(paper));
|
|
203
|
-
}
|
|
204
|
-
catch (error) {
|
|
205
|
-
logWarn(`Error fetching citations for ${paperId}:`, error.message);
|
|
206
|
-
return [];
|
|
207
|
-
}
|
|
208
|
-
}
|
|
209
|
-
/**
|
|
210
|
-
* Parse Semantic Scholar response to CitationData
|
|
211
|
-
*/
|
|
212
|
-
parseCitationData(data) {
|
|
213
|
-
return {
|
|
214
|
-
paperId: data.paperId,
|
|
215
|
-
title: data.title,
|
|
216
|
-
citationCount: data.citationCount || 0,
|
|
217
|
-
referenceCount: data.referenceCount || 0,
|
|
218
|
-
influentialCitationCount: data.influentialCitationCount,
|
|
219
|
-
year: data.year,
|
|
220
|
-
authors: data.authors?.map((author) => ({
|
|
221
|
-
name: author.name,
|
|
222
|
-
authorId: author.authorId
|
|
223
|
-
})),
|
|
224
|
-
venue: data.venue,
|
|
225
|
-
doi: data.externalIds?.DOI,
|
|
226
|
-
url: data.url
|
|
227
|
-
};
|
|
228
|
-
}
|
|
229
|
-
/**
|
|
230
|
-
* Get cache statistics
|
|
231
|
-
*/
|
|
232
|
-
getCacheStats() {
|
|
233
|
-
return this.cache.getStats();
|
|
234
|
-
}
|
|
235
|
-
/**
|
|
236
|
-
* Clear cache
|
|
237
|
-
*/
|
|
238
|
-
clearCache() {
|
|
239
|
-
this.cache.clear();
|
|
240
|
-
}
|
|
241
|
-
}
|
|
242
|
-
export default CitationService;
|
|
1
|
+
export { CitationService, default } from '../capabilities/citation-expansion/CitationService.js';
|
|
243
2
|
//# sourceMappingURL=CitationService.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"CitationService.js","sourceRoot":"","sources":["../../src/services/CitationService.ts"],"names":[],"mappings":"AAAA,OAAO,
|
|
1
|
+
{"version":3,"file":"CitationService.js","sourceRoot":"","sources":["../../src/services/CitationService.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,eAAe,EAAE,OAAO,EAAE,MAAM,uDAAuD,CAAC"}
|