openalex-research-mcp 0.4.0 → 0.5.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/QUICKSTART.md CHANGED
@@ -69,36 +69,52 @@ Which countries are leading research in renewable energy?
69
69
 
70
70
  ## Available Tools
71
71
 
72
- The server provides 18 specialized tools:
73
-
74
- **Literature Search:**
75
- - `search_works` - Advanced search for papers
76
- - `get_work` - Get detailed paper information
77
- - `get_related_works` - Find similar papers
78
- - `search_by_topic` - Explore specific research domains
79
- - `autocomplete_search` - Fast typeahead search
72
+ The server provides 31 specialized tools:
73
+
74
+ **Literature Search & Discovery:**
75
+ - `search_works` - Advanced search with Boolean operators, venue/institution filters
76
+ - `get_work` - Get complete metadata for a specific work
77
+ - `get_related_works` - Find similar papers based on citations and topics
78
+ - `search_by_topic` - Explore literature in specific research domains
79
+ - `autocomplete_search` - Fast typeahead search for all entity types
80
+
81
+ **Credibility-Gated Search (Journal & Conference Presets):**
82
+ - `list_journal_presets` - List all available journal/conference and institution group presets
83
+ - `search_in_journal_list` - Search within a named preset (UTD24, FT50, AJG tiers, etc.)
84
+ - `search_works_in_venue` - Search within a specific venue by name, ISSN, or ID
85
+ - `get_top_venues_for_field` - Discover top journals/conferences ranked by h-index
86
+ - `check_venue_quality` - Inspect h-index, impact, and indexing status of any venue
80
87
 
81
88
  **Citation Analysis:**
82
- - `get_work_citations` - Who cites this paper
83
- - `get_work_references` - What this paper cites
84
- - `get_citation_network` - Complete citation graph
85
- - `get_top_cited_works` - Most influential papers
86
-
87
- **Author & Institutions:**
88
- - `search_authors` - Find researchers
89
- - `get_author_works` - Author's publications
90
- - `get_author_collaborators` - Co-authorship networks
91
- - `search_institutions` - Find universities/organizations
92
-
93
- **Research Trends:**
94
- - `analyze_topic_trends` - Track research evolution
95
- - `compare_research_areas` - Compare different fields
96
- - `get_trending_topics` - Discover emerging areas
97
- - `analyze_geographic_distribution` - Global research mapping
89
+ - `get_work_citations` - Forward citation analysis (who cites this work)
90
+ - `get_work_references` - Backward citation analysis (what this work cites)
91
+ - `get_citation_network` - Build citation networks (forward + backward)
92
+ - `get_top_cited_works` - Find the most influential papers in a field
93
+
94
+ **Author & Institution Analysis:**
95
+ - `search_authors` - Find researchers with h-index and citation metrics
96
+ - `search_authors_by_expertise` - Find experts in a topic ranked by h-index
97
+ - `get_author_profile` - Full profile: h-index, i10-index, top works, recent works
98
+ - `get_author_works` - Analyze an author's publication history
99
+ - `get_author_collaborators` - Map co-authorship networks
100
+ - `search_institutions` - Find academic institutions
101
+
102
+ **High-Value Citation Finding:**
103
+ - `find_review_articles` - Find review papers and meta-analyses
104
+ - `find_seminal_papers` - Find foundational "must-cite" papers
105
+ - `find_open_access_version` - Find freely available versions of papers
106
+ - `batch_resolve_references` - Validate up to 20 DOIs/IDs at once
107
+
108
+ **Research Landscape & Trends:**
109
+ - `analyze_topic_trends` - Track research evolution over time
110
+ - `compare_research_areas` - Compare activity across different fields
111
+ - `get_trending_topics` - Discover emerging research areas
112
+ - `analyze_geographic_distribution` - Map global research activity
98
113
 
99
114
  **Entity Lookup:**
100
- - `get_entity` - Get any OpenAlex entity
101
- - `search_sources` - Find journals/venues
115
+ - `get_entity` - Get any OpenAlex entity (works, authors, sources, etc.)
116
+ - `search_sources` - Find journals/conferences sorted by h-index
117
+ - `health_check` - Verify server and API connectivity
102
118
 
103
119
  ## Tips
104
120
 
package/README.md CHANGED
@@ -24,6 +24,25 @@ This auto-detects your Claude Desktop config, prompts for your email and optiona
24
24
  - 🎓 **Curated journal presets** — UTD24, FT50, AJG/ABS tiers, top AI conferences, and more
25
25
  - 🏛️ **Institution group presets** — Ivy League, Top US, INSEAD+London, and more
26
26
 
27
+ ## Use as a Claude Skill (lightweight alternative)
28
+
29
+ The same OpenAlex access is also packaged as a **Claude Skill** under
30
+ [`skill/`](skill/) — a token-frugal alternative to the always-on MCP server.
31
+ A skill loads into the agent's context only when invoked and shells out to a
32
+ small zero-dependency CLI, so it costs nothing while idle. Use the **MCP server**
33
+ in MCP clients (Claude Desktop, TypingMind); use the **skill** in coding agents
34
+ (Claude Code, etc.) that already have shell access.
35
+
36
+ ```bash
37
+ chmod +x skill/bin/openalex && export PATH="$PWD/skill/bin:$PATH"
38
+ export OPENALEX_EMAIL="you@example.com" # optional: faster polite pool
39
+ openalex works "supply chain network" -n 5
40
+ ```
41
+
42
+ See [`skill/README.md`](skill/README.md) for install and the MCP-vs-skill
43
+ trade-off. (The industry is steadily shifting routine API access from always-on
44
+ MCP servers toward on-demand skills — this repo ships both.)
45
+
27
46
  ## Features
28
47
 
29
48
  Access 240+ million scholarly works through 31 specialized tools:
@@ -184,7 +203,9 @@ export OPENALEX_API_KEY="your-api-key"
184
203
  Add to your Claude Desktop config file:
185
204
 
186
205
  **MacOS**: `~/Library/Application Support/Claude/claude_desktop_config.json`
187
- **Windows**: `%APPDATA%/Claude/claude_desktop_config.json`
206
+ **Windows**: `%LOCALAPPDATA%\Packages\Claude_<id>\LocalCache\Roaming\Claude\claude_desktop_config.json`
207
+
208
+ > **Tip:** In Claude Desktop, go to **File → Settings → Developer → Edit Config** to open the correct config file directly. The `npx openalex-research-mcp setup` command also auto-detects the path.
188
209
 
189
210
  **If you installed via npm/npx:**
190
211
  ```json
@@ -441,7 +462,28 @@ MIT
441
462
 
442
463
  ## Contributing
443
464
 
444
- Contributions are welcome! Please feel free to submit issues or pull requests.
465
+ Contributions are welcome! Here's how to get involved:
466
+
467
+ ### Reporting bugs
468
+
469
+ - Search [existing issues](https://github.com/oksure/openalex-research-mcp/issues) before opening a new one.
470
+ - Include a clear description of what you expected vs. what happened.
471
+ - If the bug involves an API call, paste the relevant curl command or error message so it can be reproduced quickly (see the [OpenAlex API docs](https://docs.openalex.org) for reference).
472
+
473
+ ### Requesting features
474
+
475
+ - Open an issue with the `enhancement` label.
476
+ - Describe the use case and, if possible, sketch the desired tool name, input parameters, and example output.
477
+
478
+ ### Submitting pull requests
479
+
480
+ 1. **Fork** the repo and create a branch from `master` (e.g. `fix/my-bug` or `feat/my-feature`).
481
+ 2. **Make your changes** following the patterns in [CLAUDE.md](CLAUDE.md) (two-layer architecture, `summarizeWork` for list results, `getFullWorkDetails` for single-work lookups, etc.).
482
+ 3. **Add tests** — run `npm test` (vitest) to make sure all 26+ existing tests still pass, and add new tests in `tests/` for any new behaviour.
483
+ 4. **Build** with `npm run build` to confirm there are no TypeScript errors.
484
+ 5. **Open a PR** against `master` with a clear description of the problem and fix, including any curl-level reproduction steps for API-related bugs.
485
+
486
+ > **Note on API quirks:** Before adding new filter logic, check the "OpenAlex API Quirks & Common Bugs" section in [CLAUDE.md](CLAUDE.md) — several non-obvious behaviours (date filters, sort suffixes, DOI encoding) are documented there.
445
487
 
446
488
  ## Resources
447
489
 
package/build/config.d.ts CHANGED
@@ -1,3 +1,5 @@
1
+ export declare const VERSION: string;
2
+ export declare function debug(...args: unknown[]): void;
1
3
  export declare const CONFIG: {
2
4
  API: {
3
5
  BASE_URL: string;
@@ -8,6 +10,7 @@ export declare const CONFIG: {
8
10
  };
9
11
  RETRY: {
10
12
  MAX_RETRIES: number;
13
+ MAX_429_RETRIES: number;
11
14
  INITIAL_DELAY_MS: number;
12
15
  MAX_DELAY_MS: number;
13
16
  BACKOFF_FACTOR: number;
@@ -1 +1 @@
1
- {"version":3,"file":"config.d.ts","sourceRoot":"","sources":["../src/config.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,MAAM;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CA6BlB,CAAC"}
1
+ {"version":3,"file":"config.d.ts","sourceRoot":"","sources":["../src/config.ts"],"names":[],"mappings":"AAOA,eAAO,MAAM,OAAO,EAAE,MAAoE,CAAC;AAI3F,wBAAgB,KAAK,CAAC,GAAG,IAAI,EAAE,OAAO,EAAE,GAAG,IAAI,CAE9C;AAED,eAAO,MAAM,MAAM;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CA8BlB,CAAC"}
package/build/config.js CHANGED
@@ -1,3 +1,16 @@
1
+ import { createRequire } from 'node:module';
2
+ // Read the package version at runtime so the server's advertised version never
3
+ // drifts from package.json. createRequire resolves relative to this module's
4
+ // location (build/config.js → ../package.json = package root), and npm always
5
+ // ships package.json with the package, so this works both locally and installed.
6
+ const require = createRequire(import.meta.url);
7
+ export const VERSION = require('../package.json').version;
8
+ // Debug logging gated on OPENALEX_DEBUG env var (stderr is safe for MCP stdio servers)
9
+ const DEBUG_ENABLED = process.env.OPENALEX_DEBUG === '1' || process.env.OPENALEX_DEBUG === 'true';
10
+ export function debug(...args) {
11
+ if (DEBUG_ENABLED)
12
+ console.error('[openalex]', ...args);
13
+ }
1
14
  export const CONFIG = {
2
15
  API: {
3
16
  BASE_URL: 'https://api.openalex.org',
@@ -8,6 +21,7 @@ export const CONFIG = {
8
21
  },
9
22
  RETRY: {
10
23
  MAX_RETRIES: 3,
24
+ MAX_429_RETRIES: 3,
11
25
  INITIAL_DELAY_MS: 1000,
12
26
  MAX_DELAY_MS: 10000,
13
27
  BACKOFF_FACTOR: 2,
@@ -1 +1 @@
1
- {"version":3,"file":"config.js","sourceRoot":"","sources":["../src/config.ts"],"names":[],"mappings":"AAAA,MAAM,CAAC,MAAM,MAAM,GAAG;IACpB,GAAG,EAAE;QACH,QAAQ,EAAE,0BAA0B;QACpC,OAAO,EAAE,KAAK;QACd,UAAU,EAAE;YACV,mBAAmB,EAAE,EAAE;YACvB,gBAAgB,EAAE,MAAM;SACzB;QACD,KAAK,EAAE;YACL,WAAW,EAAE,CAAC;YACd,gBAAgB,EAAE,IAAI;YACtB,YAAY,EAAE,KAAK;YACnB,cAAc,EAAE,CAAC;SAClB;KACF;IACD,KAAK,EAAE;QACL,MAAM,EAAE,CAAC,GAAG,EAAE,GAAG,IAAI,EAAE,YAAY;QACnC,QAAQ,EAAE,IAAI;KACf;IACD,GAAG,EAAE;QACH,iBAAiB,EAAE,EAAE;QACrB,aAAa,EAAE,GAAG;QAClB,sBAAsB,EAAE,CAAC;QACzB,mBAAmB,EAAE,GAA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BAAsB,EAAE,CAAC;QACzB,mBAAmB,EAAE,GAAG;QACxB,UAAU,EAAE,CAAC;QACb,YAAY,EAAE,EAAE;QAChB,UAAU,EAAE,CAAC;QACb,6BAA6B,EAAE,EAAE;KAClC;CACF,CAAC"}
@@ -0,0 +1,3 @@
1
+ import { FilterOptions } from './openalex-client.js';
2
+ export declare function buildFilter(params: any): FilterOptions;
3
+ //# sourceMappingURL=filter.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"filter.d.ts","sourceRoot":"","sources":["../src/filter.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,aAAa,EAAE,MAAM,sBAAsB,CAAC;AAIrD,wBAAgB,WAAW,CAAC,MAAM,EAAE,GAAG,GAAG,aAAa,CAwDtD"}
@@ -0,0 +1,61 @@
1
+ // buildFilter — maps MCP tool parameters to OpenAlex API filter format.
2
+ // Exported so it can be unit-tested directly.
3
+ import { INSTITUTION_GROUPS } from './presets.js';
4
+ import { debug } from './config.js';
5
+ export function buildFilter(params) {
6
+ const filter = {};
7
+ // Handle publication year range (all tools now use from_year/to_year)
8
+ const fromYear = params.from_year || params.from_publication_year;
9
+ const toYear = params.to_year || params.to_publication_year;
10
+ if (fromYear && toYear) {
11
+ filter['publication_year'] = `${fromYear}-${toYear}`;
12
+ }
13
+ else if (fromYear) {
14
+ filter['publication_year'] = `>${fromYear - 1}`;
15
+ }
16
+ else if (toYear) {
17
+ filter['publication_year'] = `<${toYear + 1}`;
18
+ }
19
+ if (params.cited_by_count) {
20
+ filter['cited_by_count'] = params.cited_by_count;
21
+ }
22
+ if (params.is_oa !== undefined) {
23
+ filter['is_oa'] = params.is_oa;
24
+ }
25
+ if (params.type) {
26
+ filter['type'] = params.type;
27
+ }
28
+ if (params.works_count) {
29
+ filter['works_count'] = params.works_count;
30
+ }
31
+ if (params.country_code) {
32
+ filter['country_code'] = params.country_code;
33
+ }
34
+ if (params.institution) {
35
+ filter['institutions.display_name'] = params.institution;
36
+ }
37
+ if (params.institution_group) {
38
+ const group = INSTITUTION_GROUPS[params.institution_group];
39
+ if (group) {
40
+ filter['authorships.institutions.display_name'] = group.institutions.join('|');
41
+ }
42
+ }
43
+ else if (params.author_institution) {
44
+ filter['authorships.institutions.display_name'] = params.author_institution;
45
+ }
46
+ if (params.source_id) {
47
+ filter['primary_location.source.id'] = params.source_id;
48
+ }
49
+ if (params.source_name) {
50
+ filter['primary_location.source.display_name.search'] = params.source_name;
51
+ }
52
+ if (params.source_issn) {
53
+ filter['primary_location.source.issn'] = params.source_issn;
54
+ }
55
+ if (params.min_citations !== undefined && params.min_citations > 0) {
56
+ filter['cited_by_count'] = `>${params.min_citations - 1}`;
57
+ }
58
+ debug('buildFilter result:', JSON.stringify(filter));
59
+ return filter;
60
+ }
61
+ //# sourceMappingURL=filter.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"filter.js","sourceRoot":"","sources":["../src/filter.ts"],"names":[],"mappings":"AAAA,wEAAwE;AACxE,8CAA8C;AAG9C,OAAO,EAAE,kBAAkB,EAAE,MAAM,cAAc,CAAC;AAClD,OAAO,EAAE,KAAK,EAAE,MAAM,aAAa,CAAC;AAEpC,MAAM,UAAU,WAAW,CAAC,MAAW;IACrC,MAAM,MAAM,GAAkB,EAAE,CAAC;IAEjC,sEAAsE;IACtE,MAAM,QAAQ,GAAG,MAAM,CAAC,SAAS,IAAI,MAAM,CAAC,qBAAqB,CAAC;IAClE,MAAM,MAAM,GAAG,MAAM,CAAC,OAAO,IAAI,MAAM,CAAC,mBAAmB,CAAC;IAE5D,IAAI,QAAQ,IAAI,MAAM,EAAE,CAAC;QACvB,MAAM,CAAC,kBAAkB,CAAC,GAAG,GAAG,QAAQ,IAAI,MAAM,EAAE,CAAC;IACvD,CAAC;SAAM,IAAI,QAAQ,EAAE,CAAC;QACpB,MAAM,CAAC,kBAAkB,CAAC,GAAG,IAAI,QAAQ,GAAG,CAAC,EAAE,CAAC;IAClD,CAAC;SAAM,IAAI,MAAM,EAAE,CAAC;QACl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A4B,CAAC,GAAG,MAAM,CAAC,SAAS,CAAC;IAC1D,CAAC;IACD,IAAI,MAAM,CAAC,WAAW,EAAE,CAAC;QACvB,MAAM,CAAC,6CAA6C,CAAC,GAAG,MAAM,CAAC,WAAW,CAAC;IAC7E,CAAC;IACD,IAAI,MAAM,CAAC,WAAW,EAAE,CAAC;QACvB,MAAM,CAAC,8BAA8B,CAAC,GAAG,MAAM,CAAC,WAAW,CAAC;IAC9D,CAAC;IACD,IAAI,MAAM,CAAC,aAAa,KAAK,SAAS,IAAI,MAAM,CAAC,aAAa,GAAG,CAAC,EAAE,CAAC;QACnE,MAAM,CAAC,gBAAgB,CAAC,GAAG,IAAI,MAAM,CAAC,aAAa,GAAG,CAAC,EAAE,CAAC;IAC5D,CAAC;IAED,KAAK,CAAC,qBAAqB,EAAE,IAAI,CAAC,SAAS,CAAC,MAAM,CAAC,CAAC,CAAC;IACrD,OAAO,MAAM,CAAC;AAChB,CAAC"}
@@ -0,0 +1,138 @@
1
+ export declare function reconstructAbstract(invertedIndex: any): string;
2
+ export declare function summarizeWork(work: any): {
3
+ id: any;
4
+ doi: any;
5
+ title: any;
6
+ publication_year: any;
7
+ publication_date: any;
8
+ cited_by_count: any;
9
+ type: any;
10
+ authors: any;
11
+ authors_truncated: boolean;
12
+ primary_topic: {
13
+ display_name: any;
14
+ field: any;
15
+ subfield: any;
16
+ } | null;
17
+ open_access: {
18
+ is_oa: any;
19
+ oa_status: any;
20
+ oa_url: any;
21
+ };
22
+ landing_page_url: any;
23
+ pdf_url: any;
24
+ source: any;
25
+ source_id: any;
26
+ source_issn_l: any;
27
+ source_type: any;
28
+ fwci: any;
29
+ abstract: string | null;
30
+ };
31
+ export declare function summarizeAuthor(author: any): {
32
+ id: any;
33
+ name: any;
34
+ orcid: any;
35
+ works_count: any;
36
+ cited_by_count: any;
37
+ h_index: any;
38
+ i10_index: any;
39
+ two_year_mean_citedness: any;
40
+ last_known_institutions: any;
41
+ top_topics: any;
42
+ };
43
+ export declare function summarizeSource(source: any): {
44
+ id: any;
45
+ display_name: any;
46
+ issn_l: any;
47
+ issn: any;
48
+ type: any;
49
+ h_index: any;
50
+ two_year_mean_citedness: any;
51
+ works_count: any;
52
+ cited_by_count: any;
53
+ is_oa: any;
54
+ is_in_doaj: any;
55
+ homepage_url: any;
56
+ host_organization: any;
57
+ topics: any;
58
+ };
59
+ export declare function summarizeInstitution(inst: any): {
60
+ id: any;
61
+ display_name: any;
62
+ ror: any;
63
+ country_code: any;
64
+ type: any;
65
+ homepage_url: any;
66
+ works_count: any;
67
+ cited_by_count: any;
68
+ h_index: any;
69
+ i10_index: any;
70
+ two_year_mean_citedness: any;
71
+ geo: {
72
+ city: any;
73
+ region: any;
74
+ country: any;
75
+ } | null;
76
+ associated_institutions: any;
77
+ top_topics: any;
78
+ };
79
+ export declare function summarizeWorksList(response: any): {
80
+ meta: {
81
+ count: any;
82
+ page: any;
83
+ per_page: any;
84
+ };
85
+ results: any;
86
+ };
87
+ export declare function getFullWorkDetails(work: any): {
88
+ id: any;
89
+ doi: any;
90
+ title: any;
91
+ publication_year: any;
92
+ publication_date: any;
93
+ cited_by_count: any;
94
+ type: any;
95
+ authors: any;
96
+ primary_topic: {
97
+ id: any;
98
+ display_name: any;
99
+ score: any;
100
+ field: any;
101
+ subfield: any;
102
+ domain: any;
103
+ } | null;
104
+ topics: any;
105
+ open_access: {
106
+ is_oa: any;
107
+ oa_status: any;
108
+ oa_url: any;
109
+ any_repository_has_fulltext: any;
110
+ };
111
+ landing_page_url: any;
112
+ pdf_url: any;
113
+ primary_location: {
114
+ is_oa: any;
115
+ landing_page_url: any;
116
+ pdf_url: any;
117
+ source: {
118
+ id: any;
119
+ display_name: any;
120
+ issn_l: any;
121
+ issn: any;
122
+ type: any;
123
+ host_organization: any;
124
+ } | null;
125
+ license: any;
126
+ version: any;
127
+ } | null;
128
+ abstract: string | null;
129
+ biblio: any;
130
+ referenced_works_count: any;
131
+ cited_by_percentile_year: any;
132
+ fwci: any;
133
+ keywords: any;
134
+ grants: any;
135
+ referenced_works: any;
136
+ related_works: any;
137
+ };
138
+ //# sourceMappingURL=formatters.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"formatters.d.ts","sourceRoot":"","sources":["../src/formatters.ts"],"names":[],"mappings":"AAGA,wBAAgB,mBAAmB,CAAC,aAAa,EAAE,GAAG,GAAG,MAAM,CAa9D;AAED,wBAAgB,aAAa,CAAC,IAAI,EAAE,GAAG;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAkCtC;AAED,wBAAgB,eAAe,CAAC,MAAM,EAAE,GAAG;;;;;;;;;;;EAoB1C;AAED,wBAAgB,eAAe,CAAC,MAAM,EAAE,GAAG;;;;;;;;;;;;;;;EAiB1C;AAED,wBAAgB,oBAAoB,CAAC,IAAI,EAAE,GAAG;;;;;;;;;;;;;;;;;;;EAwB7C;AAED,wBAAgB,kBAAkB,CAAC,QAAQ,EAAE,GAAG;;;;;;;EAS/C;AAED,wBAAgB,kBAAkB,CAAC,IAAI,EAAE,GAAG;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAgF3C"}
@@ -0,0 +1,205 @@
1
+ // Response formatting helpers — pure functions for summarizing OpenAlex API responses.
2
+ // Two-tier strategy: summarized results for list operations, full details for single-work lookups.
3
+ export function reconstructAbstract(invertedIndex) {
4
+ const words = {};
5
+ for (const [word, positions] of Object.entries(invertedIndex)) {
6
+ if (Array.isArray(positions)) {
7
+ positions.forEach((pos) => {
8
+ words[pos] = word;
9
+ });
10
+ }
11
+ }
12
+ const sortedPositions = Object.keys(words).map(Number).sort((a, b) => a - b);
13
+ return sortedPositions.map(pos => words[pos]).join(' ');
14
+ }
15
+ export function summarizeWork(work) {
16
+ return {
17
+ id: work.id,
18
+ doi: work.doi,
19
+ title: work.title || work.display_name,
20
+ publication_year: work.publication_year,
21
+ publication_date: work.publication_date,
22
+ cited_by_count: work.cited_by_count,
23
+ type: work.type,
24
+ authors: work.authorships?.slice(0, 5).map((a) => ({
25
+ name: a.author?.display_name,
26
+ institutions: a.institutions?.slice(0, 2).map((i) => i.display_name)
27
+ })) || [],
28
+ authors_truncated: work.authorships?.length > 5,
29
+ primary_topic: work.primary_topic ? {
30
+ display_name: work.primary_topic.display_name,
31
+ field: work.primary_topic.field?.display_name,
32
+ subfield: work.primary_topic.subfield?.display_name
33
+ } : null,
34
+ open_access: {
35
+ is_oa: work.open_access?.is_oa,
36
+ oa_status: work.open_access?.oa_status,
37
+ oa_url: work.open_access?.oa_url
38
+ },
39
+ landing_page_url: work.primary_location?.landing_page_url,
40
+ pdf_url: work.best_oa_location?.pdf_url,
41
+ source: work.primary_location?.source?.display_name,
42
+ source_id: work.primary_location?.source?.id,
43
+ source_issn_l: work.primary_location?.source?.issn_l,
44
+ source_type: work.primary_location?.source?.type,
45
+ fwci: work.fwci ?? null,
46
+ abstract: work.abstract_inverted_index ?
47
+ reconstructAbstract(work.abstract_inverted_index).substring(0, 600) : null
48
+ };
49
+ }
50
+ export function summarizeAuthor(author) {
51
+ return {
52
+ id: author.id,
53
+ name: author.display_name,
54
+ orcid: author.orcid,
55
+ works_count: author.works_count,
56
+ cited_by_count: author.cited_by_count,
57
+ h_index: author.summary_stats?.h_index ?? null,
58
+ i10_index: author.summary_stats?.i10_index ?? null,
59
+ two_year_mean_citedness: author.summary_stats?.['2yr_mean_citedness'] ?? null,
60
+ last_known_institutions: author.last_known_institutions?.slice(0, 2).map((i) => ({
61
+ display_name: i.display_name,
62
+ country_code: i.country_code,
63
+ type: i.type
64
+ })) || [],
65
+ top_topics: author.topics?.slice(0, 4).map((t) => ({
66
+ name: t.display_name,
67
+ count: t.count
68
+ })) || []
69
+ };
70
+ }
71
+ export function summarizeSource(source) {
72
+ return {
73
+ id: source.id,
74
+ display_name: source.display_name,
75
+ issn_l: source.issn_l,
76
+ issn: source.issn,
77
+ type: source.type,
78
+ h_index: source.summary_stats?.h_index ?? null,
79
+ two_year_mean_citedness: source.summary_stats?.['2yr_mean_citedness'] ?? null,
80
+ works_count: source.works_count,
81
+ cited_by_count: source.cited_by_count,
82
+ is_oa: source.is_oa,
83
+ is_in_doaj: source.is_in_doaj,
84
+ homepage_url: source.homepage_url,
85
+ host_organization: source.host_organization_name,
86
+ topics: source.topics?.slice(0, 4).map((t) => t.display_name) || []
87
+ };
88
+ }
89
+ export function summarizeInstitution(inst) {
90
+ return {
91
+ id: inst.id,
92
+ display_name: inst.display_name,
93
+ ror: inst.ror,
94
+ country_code: inst.country_code,
95
+ type: inst.type,
96
+ homepage_url: inst.homepage_url,
97
+ works_count: inst.works_count,
98
+ cited_by_count: inst.cited_by_count,
99
+ h_index: inst.summary_stats?.h_index ?? null,
100
+ i10_index: inst.summary_stats?.i10_index ?? null,
101
+ two_year_mean_citedness: inst.summary_stats?.['2yr_mean_citedness'] ?? null,
102
+ geo: inst.geo ? {
103
+ city: inst.geo.city,
104
+ region: inst.geo.region,
105
+ country: inst.geo.country,
106
+ } : null,
107
+ associated_institutions: inst.associated_institutions?.slice(0, 3).map((a) => ({
108
+ display_name: a.display_name,
109
+ relationship: a.relationship,
110
+ })) || [],
111
+ top_topics: inst.topics?.slice(0, 4).map((t) => t.display_name) || [],
112
+ };
113
+ }
114
+ export function summarizeWorksList(response) {
115
+ return {
116
+ meta: {
117
+ count: response.meta?.count,
118
+ page: response.meta?.page,
119
+ per_page: response.meta?.per_page
120
+ },
121
+ results: response.results?.map(summarizeWork) || []
122
+ };
123
+ }
124
+ export function getFullWorkDetails(work) {
125
+ return {
126
+ id: work.id,
127
+ doi: work.doi,
128
+ title: work.title || work.display_name,
129
+ publication_year: work.publication_year,
130
+ publication_date: work.publication_date,
131
+ cited_by_count: work.cited_by_count,
132
+ type: work.type,
133
+ authors: work.authorships?.map((a, index) => ({
134
+ position: index === 0 ? 'first' : index === work.authorships.length - 1 ? 'last' : 'middle',
135
+ author_position: a.author_position,
136
+ name: a.author?.display_name,
137
+ id: a.author?.id,
138
+ orcid: a.author?.orcid,
139
+ institutions: a.institutions?.map((i) => ({
140
+ id: i.id,
141
+ display_name: i.display_name,
142
+ ror: i.ror,
143
+ country_code: i.country_code,
144
+ type: i.type
145
+ })) || [],
146
+ countries: a.countries || [],
147
+ is_corresponding: a.is_corresponding,
148
+ raw_affiliation_strings: a.raw_affiliation_strings || []
149
+ })) || [],
150
+ primary_topic: work.primary_topic ? {
151
+ id: work.primary_topic.id,
152
+ display_name: work.primary_topic.display_name,
153
+ score: work.primary_topic.score,
154
+ field: work.primary_topic.field?.display_name,
155
+ subfield: work.primary_topic.subfield?.display_name,
156
+ domain: work.primary_topic.domain?.display_name
157
+ } : null,
158
+ topics: work.topics?.slice(0, 5).map((t) => ({
159
+ id: t.id,
160
+ display_name: t.display_name,
161
+ score: t.score
162
+ })) || [],
163
+ open_access: {
164
+ is_oa: work.open_access?.is_oa,
165
+ oa_status: work.open_access?.oa_status,
166
+ oa_url: work.open_access?.oa_url,
167
+ any_repository_has_fulltext: work.open_access?.any_repository_has_fulltext
168
+ },
169
+ landing_page_url: work.primary_location?.landing_page_url,
170
+ pdf_url: work.best_oa_location?.pdf_url,
171
+ primary_location: work.primary_location ? {
172
+ is_oa: work.primary_location.is_oa,
173
+ landing_page_url: work.primary_location.landing_page_url,
174
+ pdf_url: work.primary_location.pdf_url,
175
+ source: work.primary_location.source ? {
176
+ id: work.primary_location.source.id,
177
+ display_name: work.primary_location.source.display_name,
178
+ issn_l: work.primary_location.source.issn_l,
179
+ issn: work.primary_location.source.issn,
180
+ type: work.primary_location.source.type,
181
+ host_organization: work.primary_location.source.host_organization_name
182
+ } : null,
183
+ license: work.primary_location.license,
184
+ version: work.primary_location.version
185
+ } : null,
186
+ abstract: work.abstract_inverted_index ?
187
+ reconstructAbstract(work.abstract_inverted_index) : null,
188
+ biblio: work.biblio,
189
+ referenced_works_count: work.referenced_works_count,
190
+ cited_by_percentile_year: work.cited_by_percentile_year,
191
+ fwci: work.fwci,
192
+ keywords: work.keywords?.slice(0, 10).map((k) => ({
193
+ keyword: k.keyword || k.display_name,
194
+ score: k.score
195
+ })) || [],
196
+ grants: work.grants?.slice(0, 5).map((g) => ({
197
+ funder: g.funder,
198
+ funder_display_name: g.funder_display_name,
199
+ award_id: g.award_id
200
+ })) || [],
201
+ referenced_works: work.referenced_works || [],
202
+ related_works: work.related_works || []
203
+ };
204
+ }
205
+ //# sourceMappingURL=formatters.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"formatters.js","sourceRoot":"","sources":["../src/formatters.ts"],"names":[],"mappings":"AAAA,uFAAuF;AACvF,mGAAmG;AAEnG,MAAM,UAAU,mBAAmB,CAAC,aAAkB;IACpD,MAAM,KAAK,GAA8B,EAAE,CAAC;IAE5C,KAAK,MAAM,CAAC,IAAI,EAAE,SAAS,CAAC,IAAI,MAAM,CAAC,OAAO,CAAC,aAAa,CAAC,EAAE,CAAC;QAC9D,IAAI,KAAK,CAAC,OAAO,CAAC,SAAS,CAAC,EAAE,CAAC;YAC7B,SAAS,CAAC,OAAO,CAAC,CAAC,GAAW,EAAE,EAAE;gBAChC,KAAK,CAAC,GAAG,CAAC,GAAG,IAAI,CAAC;YACpB,CAAC,CAAC,CAAC;QACL,CAAC;IACH,CAAC;IAED,MAAM,eAAe,GAAG,MAAM,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC,GAAG,CAAC,MAAM,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,EAAE,CAAC,EAAE,EAAE,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC;IAC7E,OAAO,eAAe,CAAC,GAAG,CAAC,GAAG,CAAC,EAAE,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC;AAC1D,CAAC;AAED,MAAM,UAAU,aAAa,CAAC,IAAS;IACrC,OAAO;QACL,EAAE,EAAE,IAAI,CAAC,EAAE;QACX,GAAG,EAAE,IAAI,CAAC,GAAG;QACb,KAAK,EAAE,IAAI,CAAC,KAAK,IAAI,IAAI,CAAC,Y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