diff --git a/service/README.md b/service/README.md index 6cdeceaf..eb7efe3d 100644 --- a/service/README.md +++ b/service/README.md @@ -23,15 +23,9 @@ Run tests: `./gradlew :service:test` Builds the `org_patents` Elasticsearch index for a given institution: fetches its OpenAlex authors, searches EPO/USPTO for patents matched via institution assignee and/or inventor name, and reindexes. Each patent is tagged with a `match_type` -(`institution`, `name`, or `both`, the latter being highest confidence). Every -inventor-name match counts outright only if the assignee is the institution itself; -everything else matched on name alone — a personal-assignee match or a third-party -assignee (e.g. an industry partner on a co-invented patent) — only counts if the -patent's primary IPC/CPC classification also maps to OpenAlex research topics that -appear on the author's own profile. This applies regardless of how common the name -looks in our local OpenAlex data — a name can appear unique there while still being -common globally in EPO/USPTO, so a bare name match alone is never a strong enough -signal on its own. +(`institution`, `name`, or `both`, the latter being highest confidence). An +inventor-name match counts only if the assignee is the institution itself or the +person themselves — this avoids pulling in unrelated patents via a shared name. ```bash python scripts/patents/index_org_patents.py --institution-id diff --git a/service/scripts/patents/data/eval_runs/.gitignore b/service/scripts/patents/data/eval_runs/.gitignore new file mode 100644 index 00000000..c8dacad2 --- /dev/null +++ b/service/scripts/patents/data/eval_runs/.gitignore @@ -0,0 +1,3 @@ +* +!.gitignore +!labeling_presentation.json diff --git a/service/scripts/patents/data/eval_runs/labeling_presentation.json b/service/scripts/patents/data/eval_runs/labeling_presentation.json new file mode 100644 index 00000000..06648f6e --- /dev/null +++ b/service/scripts/patents/data/eval_runs/labeling_presentation.json @@ -0,0 +1,1854 @@ +{ + "created_at": "presentation", + "goldset": "patents\\data\\keyword_patent_goldset_presentation.json", + "cases": [ + { + "id": "fuel-cell", + "description": "Fuel cell – expected IPC H01M", + "keywords": [ + { + "keyword": "fuel cell", + "keyword_level": "fine", + "topic_id": "https://openalex.org/T10409", + "topic_display_name": "Fuel Cells and Related Materials", + "subfield_name": "Electrical and Electronic Engineering", + "field_name": "Engineering", + "relevance_score": 1.0 + } + ], + "expected_ipc_prefixes": [ + "H01M" + ], + "mapping_status": "mapped", + "diagnostics": { + "search_path": "ipc", + "es_query_size_per_index": 100, + "raw_patents_after_dedupe": 195, + "filtered_by_ipc": 0, + "filtered_by_relevance_gate": 0, + "filtered_by_min_score": 0, + "passed_relevance_gate": 195, + "scored_before_cap": 195, + "returned": 100, + "max_patents_cap": 100, + "hit_return_cap": true, + "ipc_cluster_selections": [ + { + "topic_key": "T10409", + "subclass": "H01M", + "symbol": "H01M8/083", + "level": "subgroup", + "match_score": 0.9871, + "cluster_mass": 38.5803, + "relative_mass": 0.2423, + "reason": "dominant_relative_mass" + } + ] + }, + "instructions": "Set grade 0=irrelevant, 1=relevant, 2=highly relevant. Copy graded patent_ids into goldset relevance_grades.", + "candidates": [ + { + "patent_id": "US12087951", + "title": "Electrochemical cell integrates electrolysis and fuel cell functions", + "source": "USPTO", + "publication_year": "2024", + "match_score": 0.9923, + "ipc_score": 0.9871, + "topic_score": 1.0, + "text_score": 1.0, + "topic_match_kind": "topic_id", + "matched_keywords": [ + "fuel cell" + ], + "matched_ipc_symbols": [ + "H01M8/083" + ], + "text_retrieval": false, + "ipc": [ + "H01M 4/90 20060101AFI20240910BHUS", + "C25B 11/081 20210101ALI20240910BHUS", + "H01M 8/0656 20160101ALI20240910BHUS", + "H01M 8/083 20160101ALI20240910BHUS" + ], + "cpc": [ + "H01M 4/9058 20130101FI20240910BHUS", + "C25B 11/081 20210101LI20240910BHUS", + "H01M 8/0656 20130101LI20240910BHUS", + "H01M 8/083 20130101LI20240910BHUS" + ], + "application_number": "17068023", + "current_rank": 1, + "grade": 2, + "notes": "Brennstoffzellenfunktion ist zentraler Gegenstand." + }, + { + "patent_id": "US10916789", + "title": "Alkaline exchange membrane fuel cells system having a bi-polar plate", + "source": "USPTO", + "publication_year": "2021", + "match_score": 0.9923, + "ipc_score": 0.9871, + "topic_score": 1.0, + "text_score": 1.0, + "topic_match_kind": "topic_id", + "matched_keywords": [ + "fuel cell" + ], + "matched_ipc_symbols": [ + "H01M8/083" + ], + "text_retrieval": false, + "ipc": [ + "H01M 8/083 20160101AFI20210209BHUS", + "H01M 8/023 20160101ALI20210209BHUS", + "H01M 8/0289 20160101ALI20210209BHUS", + "H01M 8/0258 20160101ALI20210209BHUS", + "H01M 8/1062 20160101ALI20210209BHUS", + "H01M 8/1067 20160101ALI20210209BHUS", + "H01M 4/88 20060101ALI20210209BHUS", + "H01M 8/04119 20160101ALI20210209BHUS", + "H01M 8/0267 20160101ALN20210209BHUS", + "H01M 8/0234 20160101ALN20210209BHUS", + "H01M 8/0232 20160101ALN20210209BHUS", + "H01M 8/04029 20160101ALN20210209BHUS" + ], + "cpc": [ + "H01M 8/083 20130101FI20210209BHUS", + "H01M 4/881 20130101LI20210209BHUS", + "H01M 4/8807 20130101LI20210209BHUS", + "H01M 8/023 20130101LI20210209BHUS", + "H01M 8/0258 20130101LI20210209BHUS", + "H01M 8/0289 20130101LI20210209BHUS", + "H01M 8/04119 20130101LI20210209BHUS", + "H01M 8/1062 20130101LI20210209BHUS", + "H01M 8/1067 20130101LI20210209BHUS", + "H01M 8/0232 20130101LA20210209BHUS", + "H01M 8/0234 20130101LA20210209BHUS", + "H01M 8/0267 20130101LA20210209BHUS", + "H01M 8/04029 20130101LA20210209BHUS" + ], + "application_number": "16085648", + "current_rank": 2, + "grade": 2, + "notes": "Brennstoffzellensystem und Bipolarplatte sind zentral." + }, + { + "patent_id": "US10847825", + "title": "Chloralkali process", + "source": "USPTO", + "publication_year": "2020", + "match_score": 0.9923, + "ipc_score": 0.9871, + "topic_score": 1.0, + "text_score": 1.0, + "topic_match_kind": "topic_id", + "matched_keywords": [ + "fuel cell" + ], + "matched_ipc_symbols": [ + "H01M8/083" + ], + "text_retrieval": false, + "ipc": [ + "H01M 8/06 20160101AFI20201124BHUS", + "C25B 1/46 20060101ALI20201124BHUS", + "C25B 9/10 20060101ALI20201124BHUS", + "C25B 13/08 20060101ALI20201124BHUS", + "H01M 8/083 20160101ALI20201124BHUS" + ], + "cpc": [ + "H01M 8/0693 20130101FI20201124BHUS", + "C25B 1/46 20130101LI20201124BHUS", + "C25B 9/10 20130101LI20201124BHUS", + "C25B 13/08 20130101LI20201124BHUS", + "H01M 8/083 20130101LI20201124BHUS" + ], + "application_number": "15740882", + "current_rank": 3, + "grade": 0, + "notes": "Chloralkali-Verfahren; Brennstoffzelle ist nicht der zentrale Patentgegenstand." + }, + { + "patent_id": "US10847812", + "title": "Separator plate, membrane electrode assembly and fuel cell", + "source": "USPTO", + "publication_year": "2020", + "match_score": 0.9923, + "ipc_score": 0.9871, + "topic_score": 1.0, + "text_score": 1.0, + "topic_match_kind": "topic_id", + "matched_keywords": [ + "fuel cell" + ], + "matched_ipc_symbols": [ + "H01M8/083" + ], + "text_retrieval": false, + "ipc": [ + "H01M 8/0221 20160101AFI20201124BHUS", + "H01M 8/0258 20160101ALI20201124BHUS", + "H01M 8/1018 20160101ALI20201124BHUS", + "H01M 8/2418 20160101ALI20201124BHUS", + "H01M 8/0223 20160101ALI20201124BHUS", + "H01M 8/1004 20160101ALI20201124BHUS", + "H01M 8/1011 20160101ALN20201124BHUS", + "H01M 8/14 20060101ALN20201124BHUS", + "H01M 8/0267 20160101ALN20201124BHUS", + "H01M 8/083 20160101ALN20201124BHUS", + "H01M 8/124 20160101ALN20201124BHUS", + "H01M 8/086 20160101ALN20201124BHUS" + ], + "cpc": [ + "H01M 8/0221 20130101FI20201124BHUS", + "H01M 8/0223 20130101LI20201124BHUS", + "H01M 8/0258 20130101LI20201124BHUS", + "H01M 8/1004 20130101LI20201124BHUS", + "H01M 8/1018 20130101LI20201124BHUS", + "H01M 8/2418 20160201LI20201124BHUS", + "H01M 8/0267 20130101LA20201124BHUS", + "H01M 8/083 20130101LA20201124BHUS", + "H01M 8/086 20130101LA20201124BHUS", + "H01M 8/1011 20130101LA20201124BHUS", + "H01M 2008/1095 20130101LA20201124BHUS", + "H01M 2008/1293 20130101LA20201124BHUS", + "H01M 2008/147 20130101LA20201124BHUS" + ], + "application_number": "15852824", + "current_rank": 4, + "grade": 2, + "notes": "Brennstoffzellenkomponenten und Membran-Elektroden-Einheit sind zentral." + }, + { + "patent_id": "EP3549641", + "title": "FUEL TANK INERTING SYSTEM", + "source": "EPO", + "publication_year": "2019", + "match_score": 0.9923, + "ipc_score": 0.9871, + "topic_score": 1.0, + "text_score": 1.0, + "topic_match_kind": "topic_id", + "matched_keywords": [ + "fuel cell" + ], + "matched_ipc_symbols": [ + "H01M8/083" + ], + "text_retrieval": false, + "ipc": [ + "A62C 3/06 20060101AFI20190820BHEP", + "A62C 3/08 20060101ALI20190820BHEP", + "A62C 99/00 20100101ALI20190820BHEP", + "B01D 53/32 20060101ALI20190820BHEP", + "H01M 8/00 20160101ALI20190820BHEP", + "H01M 8/083 20160101ALI20190820BHEP" + ], + "cpc": [], + "application_number": "19167279.9", + "current_rank": 5, + "grade": 0, + "notes": "Tank-Inertisierung; Brennstoffzellentechnik ist höchstens eine Teilkomponente." + }, + { + "patent_id": "US10297888", + "title": "Method and system for storing electricity in metals", + "source": "USPTO", + "publication_year": "2019", + "match_score": 0.9923, + "ipc_score": 0.9871, + "topic_score": 1.0, + "text_score": 1.0, + "topic_match_kind": "topic_id", + "matched_keywords": [ + "fuel cell" + ], + "matched_ipc_symbols": [ + "H01M8/083" + ], + "text_retrieval": false, + "ipc": [ + "H01M 12/08 20060101AFI20190521BHUS", + "H01M 8/083 20160101ALI20190521BHUS", + "H01M 10/48 20060101ALI20190521BHUS", + "H01M 8/04828 20160101ALI20190521BHUS", + "H01M 10/44 20060101ALI20190521BHUS", + "H01M 8/18 20060101ALI20190521BHUS", + "H01M 8/04313 20160101ALI20190521BHUS", + "H01M 8/0444 20160101ALI20190521BHUS", + "H01M 8/04537 20160101ALI20190521BHUS" + ], + "cpc": [ + "H01M 12/08 20130101FI20190521BHUS", + "H01M 8/0444 20130101LI20190521BHUS", + "H01M 8/04537 20130101LI20190521BHUS", + "H01M 10/44 20130101LI20190521BHUS", + "H01M 10/48 20130101LI20190521BHUS", + "Y02E 60/128 20130101LA20190521BHUS" + ], + "application_number": "15053983", + "current_rank": 6, + "grade": 1, + "notes": "Elektrochemische Energiespeicherung mit technischer Nähe zu Brennstoffzellen." + }, + { + "patent_id": "US10096875", + "title": "System and method for increasing electrical efficiency of metal-air cell", + "source": "USPTO", + "publication_year": "2018", + "match_score": 0.9923, + "ipc_score": 0.9871, + "topic_score": 1.0, + "text_score": 1.0, + "topic_match_kind": "topic_id", + "matched_keywords": [ + "fuel cell" + ], + "matched_ipc_symbols": [ + "H01M8/083" + ], + "text_retrieval": false, + "ipc": [ + "H01M 4/36 20060101AFI20181009BHUS", + "H01M 12/08 20060101ALI20181009BHUS", + "H01M 2/40 20060101ALI20181009BHUS", + "H01M 8/083 20160101ALI20181009BHUS", + "H01M 12/06 20060101ALI20181009BHUS" + ], + "cpc": [ + "H01M 12/08 20130101FI20181009BHUS", + "H01M 2/40 20130101LI20181009BHUS", + "H01M 8/083 20130101LI20181009BHUS", + "H01M 12/065 20130101LI20181009BHUS", + "H01M 2300/0014 20130101LA20181009BHUS", + "Y02E 60/128 20130101LA20181009BHUS" + ], + "application_number": "14779753", + "current_rank": 7, + "grade": 1, + "notes": "Metall-Luft-Zelle; elektrochemisch verwandt, aber keine klassische Brennstoffzelle." + }, + { + "patent_id": "US10006461", + "title": "Electrolyte circulation in fuel cells stacks with reduced leakage current", + "source": "USPTO", + "publication_year": "2018", + "match_score": 0.9923, + "ipc_score": 0.9871, + "topic_score": 1.0, + "text_score": 1.0, + "topic_match_kind": "topic_id", + "matched_keywords": [ + "fuel cell" + ], + "matched_ipc_symbols": [ + "H01M8/083" + ], + "text_retrieval": false, + "ipc": [ + "H01M 8/08 20160101AFI20180626BHUS", + "F04D 13/10 20060101ALI20180626BHUS", + "H01M 8/083 20160101ALI20180626BHUS", + "H01M 8/24 20160101ALI20180626BHUS", + "H01M 8/2485 20160101ALI20180626BHUS", + "H01M 8/04276 20160101ALI20180626BHUS", + "H01M 8/04291 20160101ALI20180626BHUS", + "H01M 8/0289 20160101ALN20180626BHUS" + ], + "cpc": [ + "F04D 13/10 20130101FI20180626BHUS", + "H01M 8/04276 20130101LI20180626BHUS", + "H01M 8/04291 20130101LI20180626BHUS", + "H01M 8/083 20130101LI20180626BHUS", + "H01M 8/2445 20130101LI20180626BHUS", + "H01M 8/2485 20130101LI20180626BHUS", + "H01M 8/0289 20130101LA20180626BHUS" + ], + "application_number": "14402650", + "current_rank": 8, + "grade": 2, + "notes": "Elektrolytzirkulation in Brennstoffzellenstapeln ist zentral." + }, + { + "patent_id": "EP3188296", + "title": "ADJUSTMENT METHOD OF THE ELECTROLYTE COMPOSITION FOR A FUEL CELL SYSTEM", + "source": "EPO", + "publication_year": "2017", + "match_score": 0.9923, + "ipc_score": 0.9871, + "topic_score": 1.0, + "text_score": 1.0, + "topic_match_kind": "topic_id", + "matched_keywords": [ + "fuel cell" + ], + "matched_ipc_symbols": [ + "H01M8/083" + ], + "text_retrieval": false, + "ipc": [ + "H01M 8/0656 20160101AFI20170424BHEP", + "C25B 1/04 20060101ALI20170424BHEP", + "H01M 8/083 20160101ALI20170424BHEP", + "H01M 16/00 20060101ALI20170424BHEP", + "H01M 8/04276 20160101ALI20170424BHEP", + "H01M 8/0444 20160101ALI20170424BHEP", + "H01M 8/04791 20160101ALI20170424BHEP" + ], + "cpc": [], + "application_number": "16207072.6", + "current_rank": 9, + "grade": 2, + "notes": "Elektrolytzusammensetzung für ein Brennstoffzellensystem ist zentral." + }, + { + "patent_id": "US09564651", + "title": "Liquid electrolyte fuel cell system", + "source": "USPTO", + "publication_year": "2017", + "match_score": 0.9923, + "ipc_score": 0.9871, + "topic_score": 1.0, + "text_score": 1.0, + "topic_match_kind": "topic_id", + "matched_keywords": [ + "fuel cell" + ], + "matched_ipc_symbols": [ + "H01M8/083" + ], + "text_retrieval": false, + "ipc": [ + "H01M 8/08 20160101AFI20170207BHUS", + "H01M 8/04 20160101ALN20170207BHUS" + ], + "cpc": [ + "H01M 8/083 20130101FI20170207BHUS", + "H01M 8/04164 20130101LI20170207BHUS", + "H01M 8/04276 20130101LI20170207BHUS", + "H01M 8/0485 20130101LA20170207BHUS", + "H01M 2300/0014 20130101LA20170207BHUS", + "Y02E 60/50 20130101LA20170207BHUS" + ], + "application_number": "14370731", + "current_rank": 10, + "grade": 2, + "notes": "Flüssigelektrolyt-Brennstoffzellensystem ist zentral." + }, + { + "patent_id": "US09368819", + "title": "Systems and methods of securing immunity to air CO2 in alkaline fuel cells", + "source": "USPTO", + "publication_year": "2016", + "match_score": 0.9923, + "ipc_score": 0.9871, + "topic_score": 1.0, + "text_score": 1.0, + "topic_match_kind": "topic_id", + "matched_keywords": [ + "fuel cell" + ], + "matched_ipc_symbols": [ + "H01M8/083" + ], + "text_retrieval": false, + "ipc": [ + "H01M 8/06 20060101AFI20160614BHUS", + "H01M 8/08 20160101ALI20160614BHUS", + "H01M 8/10 20160101ALI20160614BHUS", + "H01M 10/46 20060101ALI20160614BHUS", + "H02J 7/00 20060101ALI20160614BHUS" + ], + "cpc": [ + "H01M 8/0668 20130101FI20160614BHUS", + "H01M 8/0693 20130101LI20160614BHUS", + "H01M 8/083 20130101LI20160614BHUS", + "H01M 8/1002 20130101LI20160614BHUS", + "H01M 10/46 20130101LI20160614BHUS", + "H02J 7/0063 20130101LI20160614BHUS", + "H01M 2300/0014 20130101LA20160614BHUS", + "H01M 2300/0082 20130101LA20160614BHUS" + ], + "application_number": "14957760", + "current_rank": 11, + "grade": 2, + "notes": "Schutz alkalischer Brennstoffzellen vor CO2 ist zentral." + }, + { + "patent_id": "US09214691", + "title": "Systems and methods of securing immunity to air CO2 in alkaline fuel cells", + "source": "USPTO", + "publication_year": "2015", + "match_score": 0.9923, + "ipc_score": 0.9871, + "topic_score": 1.0, + "text_score": 1.0, + "topic_match_kind": "topic_id", + "matched_keywords": [ + "fuel cell" + ], + "matched_ipc_symbols": [ + "H01M8/083" + ], + "text_retrieval": false, + "ipc": [ + "H01M 8/06 20060101AFI20151215BHUS", + "H01M 8/08 20060101ALI20151215BHUS" + ], + "cpc": [ + "H01M 8/0668 20130101FI20151215BHUS", + "H01M 8/083 20130101LI20151215BHUS", + "Y02E 60/50 20130101LA20151215BHUS" + ], + "application_number": "14552700", + "current_rank": 12, + "grade": 2, + "notes": "Schutz alkalischer Brennstoffzellen vor CO2 ist zentral." + }, + { + "patent_id": "US09083025", + "title": "Fuel cell stacks", + "source": "USPTO", + "publication_year": "2015", + "match_score": 0.9923, + "ipc_score": 0.9871, + "topic_score": 1.0, + "text_score": 1.0, + "topic_match_kind": "topic_id", + "matched_keywords": [ + "fuel cell" + ], + "matched_ipc_symbols": [ + "H01M8/083" + ], + "text_retrieval": false, + "ipc": [ + "H01M 8/04 20060101AFI20150714BHUS", + "H01M 8/08 20060101ALI20150714BHUS", + "H01M 8/24 20060101ALI20150714BHUS" + ], + "cpc": [ + "H01M 8/08 20130101FI20150714BHUS", + "H01M 8/083 20130101LI20150714BHUS", + "H01M 8/2445 20130101LI20150714BHUS", + "Y02E 60/50 20130101LA20150714BHUS" + ], + "application_number": "13695453", + "current_rank": 13, + "grade": 2, + "notes": "Brennstoffzellenstapel sind zentraler Gegenstand." + }, + { + "patent_id": "US08974984", + "title": "Power generation system using an alkaline fuel cell and fuel gas for alkaline fuel cells used in the system", + "source": "USPTO", + "publication_year": "2015", + "match_score": 0.9923, + "ipc_score": 0.9871, + "topic_score": 1.0, + "text_score": 1.0, + "topic_match_kind": "topic_id", + "matched_keywords": [ + "fuel cell" + ], + "matched_ipc_symbols": [ + "H01M8/083" + ], + "text_retrieval": false, + "ipc": [ + "H01M 8/22 20060101AFI20150310BHUS", + "H01M 8/08 20060101ALI20150310BHUS" + ], + "cpc": [ + "H01M 8/083 20130101FI20150310BHUS", + "H01M 8/222 20130101LI20150310BHUS", + "Y02E 60/50 20130101LA20150310BHUS" + ], + "application_number": "13387130", + "current_rank": 14, + "grade": 2, + "notes": "Stromerzeugung mit alkalischer Brennstoffzelle ist zentral." + }, + { + "patent_id": "US08974983", + "title": "Electrical conductive member and polymer electrolyte fuel cell using the same", + "source": "USPTO", + "publication_year": "2015", + "match_score": 0.9923, + "ipc_score": 0.9871, + "topic_score": 1.0, + "text_score": 1.0, + "topic_match_kind": "topic_id", + "matched_keywords": [ + "fuel cell" + ], + "matched_ipc_symbols": [ + "H01M8/083" + ], + "text_retrieval": false, + "ipc": [ + "H01M 8/10 20060101AFI20150310BHUS", + "H01M 8/02 20060101ALI20150310BHUS", + "H01M 8/08 20060101ALN20150310BHUS", + "H01M 8/12 20060101ALN20150310BHUS", + "H01M 8/14 20060101ALN20150310BHUS" + ], + "cpc": [ + "H01M 8/0213 20130101FI20150310BHUS", + "H01M 8/0228 20130101LI20150310BHUS", + "H01M 8/0254 20130101LA20150310BHUS", + "H01M 8/083 20130101LA20150310BHUS", + "H01M 8/086 20130101LA20150310BHUS", + "H01M 2008/1095 20130101LA20150310BHUS", + "H01M 2008/1293 20130101LA20150310BHUS", + "H01M 2008/147 20130101LA20150310BHUS", + "Y02E 60/50 20130101LA20150310BHUS", + "Y02E 60/525 20130101LA20150310BHUS", + "Y02E 60/526 20130101LA20150310BHUS" + ], + "application_number": "13130979", + "current_rank": 15, + "grade": 2, + "notes": "Leitfähiges Bauteil für Polymer-Elektrolyt-Brennstoffzellen ist zentral." + }, + { + "patent_id": "US08895198", + "title": "Systems and methods of securing immunity to air CO2 in alkaline fuel cells", + "source": "USPTO", + "publication_year": "2014", + "match_score": 0.9923, + "ipc_score": 0.9871, + "topic_score": 1.0, + "text_score": 1.0, + "topic_match_kind": "topic_id", + "matched_keywords": [ + "fuel cell" + ], + "matched_ipc_symbols": [ + "H01M8/083" + ], + "text_retrieval": false, + "ipc": [ + "H01M 8/06 20060101AFI20141125BHUS", + "H01M 8/08 20060101ALI20141125BHUS" + ], + "cpc": [ + "H01M 8/0668 20130101FI20141125BHUS", + "Y02E 60/50 20130101LA20141125BHUS", + "H01M 8/083 20130101LI20141125BHUS" + ], + "application_number": "12862746", + "current_rank": 16, + "grade": 2, + "notes": "Schutz alkalischer Brennstoffzellen vor CO2 ist zentral." + }, + { + "patent_id": "US08846266", + "title": "Carbohydrate anode for fuel cell and battery applications", + "source": "USPTO", + "publication_year": "2014", + "match_score": 0.9923, + "ipc_score": 0.9871, + "topic_score": 1.0, + "text_score": 1.0, + "topic_match_kind": "topic_id", + "matched_keywords": [ + "fuel cell" + ], + "matched_ipc_symbols": [ + "H01M8/083" + ], + "text_retrieval": false, + "ipc": [ + "H01M 8/08 20060101AFI20140930BHUS", + "H01M 8/22 20060101ALI20140930BHUS", + "H01M 4/96 20060101ALI20140930BHUS" + ], + "cpc": [ + "H01M 8/083 20130101FI20140930BHUS", + "H01M 4/96 20130101LI20140930BHUS", + "H01M 2300/0014 20130101LA20140930BHUS", + "Y02E 60/50 20130101LA20140930BHUS" + ], + "application_number": "12769598", + "current_rank": 17, + "grade": 2, + "notes": "Anode für Brennstoffzellenanwendungen ist zentral." + }, + { + "patent_id": "US12512484", + "title": "Alkaline fuel cell electrode catalyst, alkaline fuel cell, and methods of making and using an electrode catalyst", + "source": "USPTO", + "publication_year": "2025", + "match_score": 0.9423, + "ipc_score": 0.9871, + "topic_score": 1.0, + "text_score": 0.6666666666666666, + "topic_match_kind": "topic_id", + "matched_keywords": [ + "fuel cell" + ], + "matched_ipc_symbols": [ + "H01M8/083" + ], + "text_retrieval": false, + "ipc": [ + "H01M 4/90 20060101AFI20251230BHUS", + "H01M 4/88 20060101ALI20251230BHUS", + "H01M 8/083 20160101ALI20251230BHUS", + "H01M 4/86 20060101ALN20251230BHUS" + ], + "cpc": [ + "H01M 4/9016 20130101FI20251230BHUS", + "H01M 4/8882 20130101LI20251230BHUS", + "H01M 8/083 20130101LI20251230BHUS", + "H01M 2004/8689 20130101LA20251230BHUS" + ], + "application_number": "18081485", + "current_rank": 18, + "grade": 2, + "notes": "Elektrodenkatalysator und alkalische Brennstoffzelle sind zentral." + }, + { + "patent_id": "US12412912", + "title": "Electrochemical amine/nitrile redox method for ambient hydrogen storage", + "source": "USPTO", + "publication_year": "2025", + "match_score": 0.9423, + "ipc_score": 0.9871, + "topic_score": 1.0, + "text_score": 0.6666666666666666, + "topic_match_kind": "topic_id", + "matched_keywords": [ + "fuel cell" + ], + "matched_ipc_symbols": [ + "H01M8/083" + ], + "text_retrieval": false, + "ipc": [ + "H01M 8/04082 20160101AFI20250909BHUS", + "H01M 8/04089 20160101ALI20250909BHUS", + "H01M 8/083 20160101ALI20250909BHUS", + "H01M 8/2457 20160101ALI20250909BHUS" + ], + "cpc": [ + "H01M 8/04216 20130101FI20250909BHUS", + "H01M 8/04089 20130101LI20250909BHUS", + "H01M 8/083 20130101LI20250909BHUS", + "H01M 8/2457 20160201LI20250909BHUS", + "H01M 2300/0014 20130101LA20250909BHUS" + ], + "application_number": "17875171", + "current_rank": 19, + "grade": 1, + "notes": "Wasserstoffspeicherung mit Nähe zu Brennstoffzellensystemen, aber nicht zentral." + }, + { + "patent_id": "US12368175", + "title": "Solid oxide fuel cell comprising anode alkaline-based promoter loaded", + "source": "USPTO", + "publication_year": "2025", + "match_score": 0.9423, + "ipc_score": 0.9871, + "topic_score": 1.0, + "text_score": 0.6666666666666666, + "topic_match_kind": "topic_id", + "matched_keywords": [ + "fuel cell" + ], + "matched_ipc_symbols": [ + "H01M8/083" + ], + "text_retrieval": false, + "ipc": [ + "H01M 8/083 20160101AFI20250722BHUS", + "H01M 4/86 20060101ALI20250722BHUS", + "H01M 4/90 20060101ALI20250722BHUS", + "H01M 8/0217 20160101ALI20250722BHUS", + "H01M 8/12 20160101ALI20250722BHUS", + "H01M 8/1246 20160101ALI20250722BHUS" + ], + "cpc": [ + "H01M 8/083 20130101FI20250722BHUS", + "H01M 4/8621 20130101LI20250722BHUS", + "H01M 4/9033 20130101LI20250722BHUS", + "H01M 8/0217 20130101LI20250722BHUS", + "H01M 8/1246 20130101LI20250722BHUS", + "H01M 2008/1293 20130101LA20250722BHUS" + ], + "application_number": "18659291", + "current_rank": 20, + "grade": 2, + "notes": "Festoxid-Brennstoffzelle ist zentraler Gegenstand." + } + ], + "relevance_grades": { + "US12087951": 2, + "US10916789": 2, + "US10847825": 0, + "US10847812": 2, + "EP3549641": 0, + "US10297888": 1, + "US10096875": 1, + "US10006461": 2, + "EP3188296": 2, + "US09564651": 2, + "US09368819": 2, + "US09214691": 2, + "US09083025": 2, + "US08974984": 2, + "US08974983": 2, + "US08895198": 2, + "US08846266": 2, + "US12512484": 2, + "US12412912": 1, + "US12368175": 2 + }, + "relevant_patent_ids": [ + "US12087951", + "US10916789", + "US10847812", + "US10297888", + "US10096875", + "US10006461", + "EP3188296", + "US09564651", + "US09368819", + "US09214691", + "US09083025", + "US08974984", + "US08974983", + "US08895198", + "US08846266", + "US12512484", + "US12412912", + "US12368175" + ], + "irrelevant_patent_ids": [ + "US10847825", + "EP3549641" + ] + }, + { + "id": "speech-recognition", + "description": "Speech recognition – expected IPC G10L", + "keywords": [ + { + "keyword": "speech recognition", + "keyword_level": "fine", + "topic_id": "https://openalex.org/T10201", + "topic_display_name": "Speech Recognition and Synthesis", + "subfield_name": "Artificial Intelligence", + "field_name": "Computer Science", + "relevance_score": 1.0 + } + ], + "expected_ipc_prefixes": [ + "G10L" + ], + "mapping_status": "mapped", + "diagnostics": { + "search_path": "ipc", + "es_query_size_per_index": 100, + "raw_patents_after_dedupe": 198, + "filtered_by_ipc": 4, + "filtered_by_relevance_gate": 16, + "filtered_by_min_score": 0, + "passed_relevance_gate": 178, + "scored_before_cap": 178, + "returned": 100, + "max_patents_cap": 100, + "hit_return_cap": true, + "ipc_cluster_selections": [ + { + "topic_key": "T10201", + "subclass": "G10L", + "symbol": "G10L17/14", + "level": "subgroup", + "match_score": 0.8808, + "cluster_mass": 22.8896, + "relative_mass": 0.4213, + "reason": "dominant_relative_mass" + }, + { + "topic_key": "T10201", + "subclass": "H04M", + "symbol": "H04M2201/405", + "level": "subgroup", + "match_score": 0.8556, + "cluster_mass": 6.5654, + "relative_mass": 0.1209, + "reason": "cumulative_mass_tail" + } + ] + }, + "instructions": "Set grade 0=irrelevant, 1=relevant, 2=highly relevant. Copy graded patent_ids into goldset relevance_grades.", + "candidates": [ + { + "patent_id": "US12137183", + "title": "Semiautomated relay method and apparatus", + "source": "USPTO", + "publication_year": "2024", + "match_score": 0.8634, + "ipc_score": 0.8556, + "topic_score": 1.0, + "text_score": 0.6666666666666666, + "topic_match_kind": "topic_id", + "matched_keywords": [ + "speech recognition" + ], + "matched_ipc_symbols": [ + "H04M2201/405" + ], + "text_retrieval": false, + "ipc": [ + "G10L 15/00 20130101AFI20241105BHUS", + "G10L 15/01 20130101ALI20241105BHUS", + "G10L 15/06 20130101ALI20241105BHUS", + "G10L 15/22 20060101ALI20241105BHUS", + "G10L 15/26 20060101ALI20241105BHUS", + "G10L 21/10 20130101ALI20241105BHUS", + "H04M 1/247 20210101ALI20241105BHUS", + "H04M 1/72478 20210101ALI20241105BHUS", + "H04M 3/42 20060101ALI20241105BHUS", + "H04W 4/12 20090101ALI20241105BHUS", + "H04W 4/16 20090101ALI20241105BHUS", + "H04M 3/533 20060101ALN20241105BHUS" + ], + "cpc": [ + "H04M 3/42391 20130101FI20241105BHUS", + "G10L 15/01 20130101LI20241105BHUS", + "G10L 15/06 20130101LI20241105BHUS", + "G10L 15/22 20130101LI20241105BHUS", + "G10L 15/26 20130101LI20241105BHUS", + "G10L 21/10 20130101LI20241105BHUS", + "H04M 1/2475 20130101LI20241105BHUS", + "H04M 1/72478 20210101LI20241105BHUS", + "H04W 4/12 20130101LI20241105BHUS", + "H04W 4/16 20130101LI20241105BHUS", + "H04M 3/53366 20130101LA20241105BHUS", + "H04M 2201/18 20130101LA20241105BHUS", + "H04M 2201/40 20130101LA20241105BHUS", + "H04M 2201/405 20130101LA20241105BHUS" + ], + "application_number": "18123557", + "current_rank": 1, + "grade": 2, + "notes": "Spracherkennung und Transkription im Relay-System sind zentral." + }, + { + "patent_id": "US11627221", + "title": "Semiautomated relay method and apparatus", + "source": "USPTO", + "publication_year": "2023", + "match_score": 0.8634, + "ipc_score": 0.8556, + "topic_score": 1.0, + "text_score": 0.6666666666666666, + "topic_match_kind": "topic_id", + "matched_keywords": [ + "speech recognition" + ], + "matched_ipc_symbols": [ + "H04M2201/405" + ], + "text_retrieval": false, + "ipc": [ + "G10L 15/00 20130101AFI20230411BHUS", + "H04M 3/42 20060101ALI20230411BHUS", + "G10L 15/06 20130101ALI20230411BHUS", + "G10L 15/22 20060101ALI20230411BHUS", + "H04M 1/247 20210101ALI20230411BHUS", + "H04M 1/72478 20210101ALI20230411BHUS", + "G10L 15/26 20060101ALI20230411BHUS", + "H04W 4/12 20090101ALI20230411BHUS", + "H04W 4/16 20090101ALI20230411BHUS", + "G10L 21/10 20130101ALI20230411BHUS", + "G10L 15/01 20130101ALI20230411BHUS", + "H04M 3/533 20060101ALN20230411BHUS" + ], + "cpc": [ + "H04M 3/42391 20130101FI20230411BHUS", + "G10L 15/01 20130101LI20230411BHUS", + "G10L 15/06 20130101LI20230411BHUS", + "G10L 15/22 20130101LI20230411BHUS", + "G10L 15/26 20130101LI20230411BHUS", + "G10L 21/10 20130101LI20230411BHUS", + "H04M 1/2475 20130101LI20230411BHUS", + "H04M 1/72478 20210101LI20230411BHUS", + "H04W 4/12 20130101LI20230411BHUS", + "H04W 4/16 20130101LI20230411BHUS", + "H04M 3/53366 20130101LA20230411BHUS", + "H04M 2201/18 20130101LA20230411BHUS", + "H04M 2201/40 20130101LA20230411BHUS", + "H04M 2201/405 20130101LA20230411BHUS" + ], + "application_number": "16911691", + "current_rank": 2, + "grade": 2, + "notes": "Spracherkennung und Transkription im Relay-System sind zentral." + }, + { + "patent_id": "US11601548", + "title": "Captioned telephone services improvement", + "source": "USPTO", + "publication_year": "2023", + "match_score": 0.8634, + "ipc_score": 0.8556, + "topic_score": 1.0, + "text_score": 0.6666666666666666, + "topic_match_kind": "topic_id", + "matched_keywords": [ + "speech recognition" + ], + "matched_ipc_symbols": [ + "H04M2201/405" + ], + "text_retrieval": false, + "ipc": [ + "H04M 3/42 20060101AFI20230307BHUS", + "G10L 15/26 20060101ALI20230307BHUS", + "H04M 3/436 20060101ALI20230307BHUS" + ], + "cpc": [ + "H04M 3/42382 20130101FI20230307BHUS", + "G10L 15/26 20130101LI20230307BHUS", + "H04M 3/42391 20130101LI20230307BHUS", + "H04M 3/436 20130101LI20230307BHUS", + "H04M 2201/405 20130101LA20230307BHUS" + ], + "application_number": "17184006", + "current_rank": 3, + "grade": 2, + "notes": "Automatische Transkription für Telefondienste ist zentral." + }, + { + "patent_id": "US10742805", + "title": "Semiautomated relay method and apparatus", + "source": "USPTO", + "publication_year": "2020", + "match_score": 0.8634, + "ipc_score": 0.8556, + "topic_score": 1.0, + "text_score": 0.6666666666666666, + "topic_match_kind": "topic_id", + "matched_keywords": [ + "speech recognition" + ], + "matched_ipc_symbols": [ + "H04M2201/405" + ], + "text_retrieval": false, + "ipc": [ + "H04M 3/42 20060101AFI20200811BHUS", + "G10L 15/06 20130101ALI20200811BHUS", + "G10L 15/22 20060101ALI20200811BHUS", + "H04M 1/247 20060101ALI20200811BHUS", + "H04M 1/725 20060101ALI20200811BHUS", + "G10L 15/26 20060101ALI20200811BHUS", + "H04W 4/12 20090101ALI20200811BHUS", + "H04W 4/16 20090101ALI20200811BHUS", + "G10L 21/10 20130101ALI20200811BHUS", + "G10L 15/01 20130101ALI20200811BHUS", + "H04M 3/533 20060101ALN20200811BHUS" + ], + "cpc": [ + "H04M 3/42391 20130101FI20200811BHUS", + "G10L 15/01 20130101LI20200811BHUS", + "G10L 15/06 20130101LI20200811BHUS", + "G10L 15/22 20130101LI20200811BHUS", + "G10L 15/26 20130101LI20200811BHUS", + "G10L 15/265 20130101LI20200811BHUS", + "G10L 21/10 20130101LI20200811BHUS", + "H04M 1/2475 20130101LI20200811BHUS", + "H04M 1/72591 20130101LI20200811BHUS", + "H04W 4/12 20130101LI20200811BHUS", + "H04W 4/16 20130101LI20200811BHUS", + "H04M 3/53366 20130101LA20200811BHUS", + "H04M 2201/18 20130101LA20200811BHUS", + "H04M 2201/40 20130101LA20200811BHUS", + "H04M 2201/405 20130101LA20200811BHUS" + ], + "application_number": "15477958", + "current_rank": 4, + "grade": 2, + "notes": "Spracherkennung und Transkription im Relay-System sind zentral." + }, + { + "patent_id": "US09769314", + "title": "Personal voice-based information retrieval system", + "source": "USPTO", + "publication_year": "2017", + "match_score": 0.8634, + "ipc_score": 0.8556, + "topic_score": 1.0, + "text_score": 0.6666666666666666, + "topic_match_kind": "topic_id", + "matched_keywords": [ + "speech recognition" + ], + "matched_ipc_symbols": [ + "H04M2201/405" + ], + "text_retrieval": false, + "ipc": [ + "H04M 3/493 20060101AFI20170919BHUS", + "G06F 3/16 20060101ALI20170919BHUS", + "G10L 15/26 20060101ALI20170919BHUS", + "G06F 17/30 20060101ALI20170919BHUS", + "G10L 15/08 20060101ALI20170919BHUS", + "G10L 25/54 20130101ALI20170919BHUS", + "G10L 13/08 20130101ALI20170919BHUS", + "G10L 15/02 20060101ALI20170919BHUS", + "G10L 15/22 20060101ALI20170919BHUS", + "G10L 17/24 20130101ALN20170919BHUS", + "G10L 15/06 20130101ALN20170919BHUS", + "H04L 29/08 20060101ALN20170919BHUS" + ], + "cpc": [ + "H04M 3/4938 20130101FI20170919BHUS", + "G06F 3/167 20130101LI20170919BHUS", + "G06F 17/30769 20130101LI20170919BHUS", + "G06F 17/30861 20130101LI20170919BHUS", + "G10L 13/08 20130101LI20170919BHUS", + "G10L 15/02 20130101LI20170919BHUS", + "G10L 15/08 20130101LI20170919BHUS", + "G10L 15/22 20130101LI20170919BHUS", + "G10L 15/26 20130101LI20170919BHUS", + "G10L 25/54 20130101LI20170919BHUS", + "H04L 67/02 20130101LI20170919BHUS", + "G10L 15/06 20130101LA20170919BHUS", + "G10L 17/24 20130101LA20170919BHUS", + "G10L 2015/223 20130101LA20170919BHUS", + "H04L 29/0809 20130101LA20170919BHUS", + "H04M 2201/39 20130101LA20170919BHUS", + "H04M 2201/40 20130101LA20170919BHUS", + "H04M 2201/405 20130101LA20170919BHUS", + "H04M 2207/40 20130101LA20170919BHUS" + ], + "application_number": "15193517", + "current_rank": 5, + "grade": 2, + "notes": "Sprachbasierte Informationssuche mit Spracherkennung ist zentral." + }, + { + "patent_id": "US09685159", + "title": "Speaker recognition from telephone calls", + "source": "USPTO", + "publication_year": "2017", + "match_score": 0.8634, + "ipc_score": 0.8556, + "topic_score": 1.0, + "text_score": 0.6666666666666666, + "topic_match_kind": "topic_id", + "matched_keywords": [ + "speech recognition" + ], + "matched_ipc_symbols": [ + "H04M2201/405" + ], + "text_retrieval": false, + "ipc": [ + "G10L 17/00 20130101AFI20170620BHUS", + "G10L 17/02 20130101ALI20170620BHUS", + "G10L 17/06 20130101ALI20170620BHUS", + "H04M 3/22 20060101ALN20170620BHUS", + "H04M 3/436 20060101ALN20170620BHUS" + ], + "cpc": [ + "G10L 17/00 20130101FI20170620BHUS", + "G10L 17/02 20130101LI20170620BHUS", + "G10L 17/06 20130101LI20170620BHUS", + "H04M 3/2281 20130101LA20170620BHUS", + "H04M 3/436 20130101LA20170620BHUS", + "H04M 2201/405 20130101LA20170620BHUS", + "H04M 2201/41 20130101LA20170620BHUS" + ], + "application_number": "14817182", + "current_rank": 6, + "grade": 1, + "notes": "Sprechererkennung ist eng verwandt, aber nicht klassische Spracherkennung." + }, + { + "patent_id": "US09377992", + "title": "Personal voice-based information retrieval system", + "source": "USPTO", + "publication_year": "2016", + "match_score": 0.8634, + "ipc_score": 0.8556, + "topic_score": 1.0, + "text_score": 0.6666666666666666, + "topic_match_kind": "topic_id", + "matched_keywords": [ + "speech recognition" + ], + "matched_ipc_symbols": [ + "H04M2201/405" + ], + "text_retrieval": false, + "ipc": [ + "G06F 3/16 20060101AFI20160628BHUS", + "G10L 15/26 20060101ALI20160628BHUS", + "G10L 17/24 20130101ALN20160628BHUS", + "G10L 15/06 20130101ALN20160628BHUS", + "H04M 3/493 20060101ALN20160628BHUS", + "H04L 29/08 20060101ALN20160628BHUS" + ], + "cpc": [ + "G06F 3/167 20130101FI20160628BHUS", + "G10L 15/26 20130101LI20160628BHUS", + "G10L 15/06 20130101LA20160628BHUS", + "G10L 17/24 20130101LA20160628BHUS", + "H04L 29/0809 20130101LA20160628BHUS", + "H04M 3/4938 20130101LA20160628BHUS", + "H04M 2201/405 20130101LA20160628BHUS", + "H04M 2207/40 20130101LA20160628BHUS" + ], + "application_number": "12787801", + "current_rank": 7, + "grade": 2, + "notes": "Sprachbasierte Informationssuche mit Spracherkennung ist zentral." + }, + { + "patent_id": "US09736309", + "title": "Real-time transcription and interaction with a caller based on the transcription", + "source": "USPTO", + "publication_year": "2017", + "match_score": 0.862, + "ipc_score": 0.77, + "topic_score": 1.0, + "text_score": 1.0, + "topic_match_kind": "topic_id", + "matched_keywords": [ + "speech recognition" + ], + "matched_ipc_symbols": [ + "H04M2201/405" + ], + "text_retrieval": false, + "ipc": [ + "H04M 1/64 20060101AFI20170815BHUS", + "H04M 3/527 20060101ALI20170815BHUS", + "G10L 15/26 20060101ALI20170815BHUS", + "G10L 13/08 20130101ALI20170815BHUS", + "G10L 15/30 20130101ALI20170815BHUS" + ], + "cpc": [ + "H04M 3/527 20130101FI20170815BHUS", + "G10L 13/08 20130101LI20170815BHUS", + "G10L 15/26 20130101LI20170815BHUS", + "G10L 15/30 20130101LI20170815BHUS", + "H04M 2201/39 20130101LA20170815BHUS", + "H04M 2201/40 20130101LA20170815BHUS", + "H04M 2201/60 20130101LA20170815BHUS" + ], + "application_number": "15241555", + "current_rank": 8, + "grade": 2, + "notes": "Echtzeit-Transkription gesprochener Sprache ist zentral." + }, + { + "patent_id": "US12579986", + "title": "Systems and methods for distinguishing between human speech and machine generated speech", + "source": "USPTO", + "publication_year": "2026", + "match_score": 0.8285, + "ipc_score": 0.8808, + "topic_score": 1.0, + "text_score": 0.3333333333333333, + "topic_match_kind": "topic_id", + "matched_keywords": [ + "speech recognition" + ], + "matched_ipc_symbols": [ + "G10L17/14" + ], + "text_retrieval": false, + "ipc": [ + "G10L 17/14 20130101AFI20260317BHUS", + "G06F 40/30 20200101ALI20260317BHUS", + "G10L 15/26 20060101ALI20260317BHUS", + "G10L 17/00 20130101ALI20260317BHUS", + "G10L 17/02 20130101ALI20260317BHUS", + "G10L 17/22 20130101ALI20260317BHUS", + "G10L 17/26 20130101ALI20260317BHUS", + "H04M 3/51 20060101ALI20260317BHUS" + ], + "cpc": [ + "G10L 17/14 20130101FI20260317BHUS", + "G06F 40/30 20200101LI20260317BHUS", + "G10L 15/26 20130101LI20260317BHUS", + "G10L 17/00 20130101LI20260317BHUS", + "G10L 17/02 20130101LI20260317BHUS", + "G10L 17/22 20130101LI20260317BHUS", + "H04M 3/5166 20130101LI20260317BHUS" + ], + "application_number": "18602835", + "current_rank": 9, + "grade": 1, + "notes": "Klassifikation menschlicher und synthetischer Sprache ist fachlich angrenzend." + }, + { + "patent_id": "US10397400", + "title": "Electronic call assistant based on a caller-status and a callee-status", + "source": "USPTO", + "publication_year": "2019", + "match_score": 0.8285, + "ipc_score": 0.8808, + "topic_score": 1.0, + "text_score": 0.3333333333333333, + "topic_match_kind": "topic_id", + "matched_keywords": [ + "speech recognition" + ], + "matched_ipc_symbols": [ + "G10L17/14" + ], + "text_retrieval": false, + "ipc": [ + "H04M 3/493 20060101AFI20190827BHUS", + "G10L 17/14 20130101ALI20190827BHUS", + "A61B 5/00 20060101ALN20190827BHUS", + "G10L 15/26 20060101ALN20190827BHUS" + ], + "cpc": [ + "H04M 3/493 20130101FI20190827BHUS", + "G10L 17/14 20130101LI20190827BHUS", + "H04M 3/4936 20130101LI20190827BHUS", + "A61B 5/6802 20130101LA20190827BHUS", + "G10L 15/265 20130101LA20190827BHUS", + "H04M 2201/405 20130101LA20190827BHUS" + ], + "application_number": "15802695", + "current_rank": 10, + "grade": 0, + "notes": "Allgemeiner elektronischer Anrufassistent; Spracherkennung ist nicht zentral." + }, + { + "patent_id": "US09369577", + "title": "Transparent voice registration and verification method and system", + "source": "USPTO", + "publication_year": "2016", + "match_score": 0.8285, + "ipc_score": 0.8808, + "topic_score": 1.0, + "text_score": 0.3333333333333333, + "topic_match_kind": "topic_id", + "matched_keywords": [ + "speech recognition" + ], + "matched_ipc_symbols": [ + "G10L17/14" + ], + "text_retrieval": false, + "ipc": [ + "H04M 3/493 20060101AFI20160614BHUS", + "G10L 17/14 20130101ALI20160614BHUS", + "H04M 3/42 20060101ALI20160614BHUS", + "H04M 3/51 20060101ALI20160614BHUS", + "H04M 3/38 20060101ALI20160614BHUS", + "G10L 17/04 20130101ALN20160614BHUS" + ], + "cpc": [ + "H04M 3/4936 20130101FI20160614BHUS", + "G10L 17/14 20130101LI20160614BHUS", + "H04M 3/385 20130101LI20160614BHUS", + "H04M 3/42221 20130101LI20160614BHUS", + "H04M 3/51 20130101LI20160614BHUS", + "G10L 17/04 20130101LA20160614BHUS", + "H04M 2201/36 20130101LA20160614BHUS", + "H04M 2201/41 20130101LA20160614BHUS", + "H04M 2203/6045 20130101LA20160614BHUS" + ], + "application_number": "14526933", + "current_rank": 11, + "grade": 1, + "notes": "Stimmregistrierung und Sprecherverifikation sind fachlich angrenzend." + }, + { + "patent_id": "US12615335", + "title": "Voice fingerprinting system for detecting hoax emergency reports", + "source": "USPTO", + "publication_year": "2026", + "match_score": 0.8134, + "ipc_score": 0.8556, + "topic_score": 1.0, + "text_score": 0.3333333333333333, + "topic_match_kind": "topic_id", + "matched_keywords": [ + "speech recognition" + ], + "matched_ipc_symbols": [ + "H04M2201/405" + ], + "text_retrieval": false, + "ipc": [ + "G10L 15/00 20130101AFI20260428BHUS", + "G10L 17/02 20130101ALI20260428BHUS", + "G10L 17/04 20130101ALI20260428BHUS", + "G10L 17/06 20130101ALI20260428BHUS", + "G10L 17/18 20130101ALI20260428BHUS", + "G10L 25/18 20130101ALI20260428BHUS", + "G10L 25/24 20130101ALI20260428BHUS", + "H04M 3/22 20060101ALI20260428BHUS", + "H04M 3/51 20060101ALI20260428BHUS", + "G06Q 50/26 20120101ALN20260428BHUS" + ], + "cpc": [ + "H04M 3/5116 20130101FI20260428BHUS", + "G10L 17/02 20130101LI20260428BHUS", + "G10L 17/04 20130101LI20260428BHUS", + "G10L 17/06 20130101LI20260428BHUS", + "G10L 17/18 20130101LI20260428BHUS", + "G10L 25/18 20130101LI20260428BHUS", + "G10L 25/24 20130101LI20260428BHUS", + "H04M 3/2281 20130101LI20260428BHUS", + "H04M 3/5175 20130101LI20260428BHUS", + "H04M 3/5191 20130101LI20260428BHUS", + "G06Q 50/265 20130101LA20260428BHUS", + "H04M 2201/405 20130101LA20260428BHUS" + ], + "application_number": "18732780", + "current_rank": 12, + "grade": 1, + "notes": "Voice-Fingerprinting und Sprechererkennung sind fachlich angrenzend." + }, + { + "patent_id": "US12592239", + "title": "Active voice liveness detection system", + "source": "USPTO", + "publication_year": "2026", + "match_score": 0.8134, + "ipc_score": 0.8556, + "topic_score": 1.0, + "text_score": 0.3333333333333333, + "topic_match_kind": "topic_id", + "matched_keywords": [ + "speech recognition" + ], + "matched_ipc_symbols": [ + "H04M2201/405" + ], + "text_retrieval": false, + "ipc": [ + "G10L 17/26 20130101AFI20260331BHUS", + "G06F 21/32 20130101ALI20260331BHUS", + "G10L 15/02 20060101ALI20260331BHUS", + "G10L 17/00 20130101ALI20260331BHUS", + "G10L 17/02 20130101ALI20260331BHUS", + "G10L 17/04 20130101ALI20260331BHUS", + "G10L 17/08 20130101ALI20260331BHUS", + "G10L 17/18 20130101ALI20260331BHUS", + "G10L 25/30 20130101ALI20260331BHUS", + "G10L 25/51 20130101ALI20260331BHUS", + "G10L 25/60 20130101ALI20260331BHUS", + "H04M 3/22 20060101ALI20260331BHUS", + "H04M 3/42 20060101ALI20260331BHUS", + "H04M 3/51 20060101ALI20260331BHUS" + ], + "cpc": [ + "G10L 17/26 20130101FI20260331BHUS", + "G06F 21/32 20130101LI20260331BHUS", + "G10L 15/02 20130101LI20260331BHUS", + "G10L 17/00 20130101LI20260331BHUS", + "G10L 17/02 20130101LI20260331BHUS", + "G10L 17/04 20130101LI20260331BHUS", + "G10L 17/08 20130101LI20260331BHUS", + "G10L 17/18 20130101LI20260331BHUS", + "G10L 25/51 20130101LI20260331BHUS", + "G10L 25/60 20130101LI20260331BHUS", + "H04M 3/2281 20130101LI20260331BHUS", + "H04M 3/42221 20130101LI20260331BHUS", + "H04M 3/5175 20130101LI20260331BHUS", + "H04M 3/5183 20130101LI20260331BHUS", + "G10L 25/30 20130101LA20260331BHUS", + "H04M 2201/405 20130101LA20260331BHUS" + ], + "application_number": "18646310", + "current_rank": 13, + "grade": 1, + "notes": "Voice-Liveness-Erkennung ist biometrisch verwandt, aber keine klassische Spracherkennung." + }, + { + "patent_id": "US09571617", + "title": "Controlling mute function on telephone", + "source": "USPTO", + "publication_year": "2017", + "match_score": 0.8134, + "ipc_score": 0.8556, + "topic_score": 1.0, + "text_score": 0.3333333333333333, + "topic_match_kind": "topic_id", + "matched_keywords": [ + "speech recognition" + ], + "matched_ipc_symbols": [ + "H04M2201/405" + ], + "text_retrieval": false, + "ipc": [ + "H04M 3/00 20060101AFI20170214BHUS", + "H04M 1/19 20060101ALI20170214BHUS", + "H04M 1/247 20060101ALI20170214BHUS", + "G10L 15/22 20060101ALI20170214BHUS", + "G10L 17/04 20130101ALI20170214BHUS", + "G10L 17/06 20130101ALI20170214BHUS", + "G10L 25/84 20130101ALI20170214BHUS", + "H04M 1/60 20060101ALN20170214BHUS" + ], + "cpc": [ + "H04M 1/19 20130101FI20170214BHUS", + "G10L 15/22 20130101LI20170214BHUS", + "G10L 17/04 20130101LI20170214BHUS", + "G10L 17/06 20130101LI20170214BHUS", + "G10L 25/84 20130101LI20170214BHUS", + "H04M 1/247 20130101LI20170214BHUS", + "H04M 1/6033 20130101LI20170214BHUS", + "G10L 2015/223 20130101LA20170214BHUS", + "H04M 1/6008 20130101LA20170214BHUS", + "H04M 2201/405 20130101LA20170214BHUS", + "H04M 2203/258 20130101LA20170214BHUS", + "H04M 2250/74 20130101LA20170214BHUS" + ], + "application_number": "15168757", + "current_rank": 14, + "grade": 1, + "notes": "Sprachgesteuerte Stummschaltung; Spracherkennung ist eine relevante Teilfunktion." + }, + { + "patent_id": "US12482458", + "title": "Semiautomated relay method and apparatus", + "source": "USPTO", + "publication_year": "2025", + "match_score": 0.812, + "ipc_score": 0.77, + "topic_score": 1.0, + "text_score": 0.6666666666666666, + "topic_match_kind": "topic_id", + "matched_keywords": [ + "speech recognition" + ], + "matched_ipc_symbols": [ + "H04M2201/405" + ], + "text_retrieval": false, + "ipc": [ + "G10L 15/183 20130101AFI20251125BHUS", + "G10L 15/26 20060101ALI20251125BHUS", + "G10L 25/60 20130101ALI20251125BHUS", + "H04M 1/247 20210101ALI20251125BHUS", + "H04M 1/72433 20210101ALI20251125BHUS", + "H04M 1/72478 20210101ALI20251125BHUS", + "H04M 3/42 20060101ALI20251125BHUS" + ], + "cpc": [ + "G10L 15/183 20130101FI20251125BHUS", + "G10L 15/26 20130101LI20251125BHUS", + "G10L 25/60 20130101LI20251125BHUS", + "H04M 1/2475 20130101LI20251125BHUS", + "H04M 1/72433 20210101LI20251125BHUS", + "H04M 1/72478 20210101LI20251125BHUS", + "H04M 3/42391 20130101LI20251125BHUS", + "H04M 2201/40 20130101LA20251125BHUS", + "H04M 2201/60 20130101LA20251125BHUS" + ], + "application_number": "16422662", + "current_rank": 15, + "grade": 2, + "notes": "Spracherkennung und Transkription im Relay-System sind zentral." + }, + { + "patent_id": "US12132865", + "title": "Voice and speech recognition for call center feedback and quality assurance", + "source": "USPTO", + "publication_year": "2024", + "match_score": 0.812, + "ipc_score": 0.77, + "topic_score": 1.0, + "text_score": 0.6666666666666666, + "topic_match_kind": "topic_id", + "matched_keywords": [ + "speech recognition" + ], + "matched_ipc_symbols": [ + "H04M2201/405" + ], + "text_retrieval": false, + "ipc": [ + "H04M 3/51 20060101AFI20241029BHUS", + "G06F 40/205 20200101ALI20241029BHUS", + "G10L 17/04 20130101ALI20241029BHUS", + "G10L 17/08 20130101ALI20241029BHUS", + "G10L 25/51 20130101ALI20241029BHUS", + "G10L 25/63 20130101ALI20241029BHUS", + "G10L 25/87 20130101ALI20241029BHUS", + "H04M 3/42 20060101ALI20241029BHUS", + "G10L 15/26 20060101ALN20241029BHUS" + ], + "cpc": [ + "H04M 3/5175 20130101FI20241029BHUS", + "G06F 40/205 20200101LI20241029BHUS", + "G10L 17/04 20130101LI20241029BHUS", + "G10L 17/08 20130101LI20241029BHUS", + "G10L 25/51 20130101LI20241029BHUS", + "G10L 25/63 20130101LI20241029BHUS", + "H04M 3/42 20130101LI20241029BHUS", + "G10L 15/26 20130101LA20241029BHUS", + "G10L 25/87 20130101LA20241029BHUS", + "H04M 2201/40 20130101LA20241029BHUS", + "H04M 2201/41 20130101LA20241029BHUS", + "H04M 2203/40 20130101LA20241029BHUS", + "H04M 2203/401 20130101LA20241029BHUS" + ], + "application_number": "18376605", + "current_rank": 16, + "grade": 2, + "notes": "Sprach- und Sprecherkennung für Callcenter-Analyse sind zentral." + }, + { + "patent_id": "US12088761", + "title": "Voice and speech recognition for call center feedback and quality assurance", + "source": "USPTO", + "publication_year": "2024", + "match_score": 0.812, + "ipc_score": 0.77, + "topic_score": 1.0, + "text_score": 0.6666666666666666, + "topic_match_kind": "topic_id", + "matched_keywords": [ + "speech recognition" + ], + "matched_ipc_symbols": [ + "H04M2201/405" + ], + "text_retrieval": false, + "ipc": [ + "H04M 3/51 20060101AFI20240910BHUS", + "G06F 40/205 20200101ALI20240910BHUS", + "G10L 15/26 20060101ALI20240910BHUS", + "G10L 17/04 20130101ALI20240910BHUS", + "G10L 17/08 20130101ALI20240910BHUS", + "G10L 25/51 20130101ALI20240910BHUS", + "G10L 25/63 20130101ALI20240910BHUS", + "G10L 25/87 20130101ALI20240910BHUS", + "H04M 3/42 20060101ALI20240910BHUS" + ], + "cpc": [ + "H04M 3/5175 20130101FI20240910BHUS", + "G06F 40/205 20200101LI20240910BHUS", + "G10L 17/04 20130101LI20240910BHUS", + "G10L 17/08 20130101LI20240910BHUS", + "G10L 25/51 20130101LI20240910BHUS", + "G10L 25/63 20130101LI20240910BHUS", + "H04M 3/42 20130101LI20240910BHUS", + "G10L 15/26 20130101LA20240910BHUS", + "G10L 25/87 20130101LA20240910BHUS", + "H04M 2201/40 20130101LA20240910BHUS", + "H04M 2201/41 20130101LA20240910BHUS", + "H04M 2203/40 20130101LA20240910BHUS", + "H04M 2203/401 20130101LA20240910BHUS" + ], + "application_number": "18203094", + "current_rank": 17, + "grade": 2, + "notes": "Sprach- und Sprecherkennung für Callcenter-Analyse sind zentral." + }, + { + "patent_id": "US11811970", + "title": "Voice and speech recognition for call center feedback and quality assurance", + "source": "USPTO", + "publication_year": "2023", + "match_score": 0.812, + "ipc_score": 0.77, + "topic_score": 1.0, + "text_score": 0.6666666666666666, + "topic_match_kind": "topic_id", + "matched_keywords": [ + "speech recognition" + ], + "matched_ipc_symbols": [ + "H04M2201/405" + ], + "text_retrieval": false, + "ipc": [ + "H04M 3/51 20060101AFI20231107BHUS", + "G10L 17/04 20130101ALI20231107BHUS", + "G10L 25/51 20130101ALI20231107BHUS", + "G10L 25/63 20130101ALI20231107BHUS", + "G10L 25/87 20130101ALI20231107BHUS", + "H04M 3/42 20060101ALI20231107BHUS", + "G06F 40/205 20200101ALI20231107BHUS", + "G10L 17/08 20130101ALI20231107BHUS", + "G10L 15/26 20060101ALN20231107BHUS" + ], + "cpc": [ + "H04M 3/5175 20130101FI20231107BHUS", + "G06F 40/205 20200101LI20231107BHUS", + "G10L 17/04 20130101LI20231107BHUS", + "G10L 17/08 20130101LI20231107BHUS", + "G10L 25/51 20130101LI20231107BHUS", + "G10L 25/63 20130101LI20231107BHUS", + "H04M 3/42 20130101LI20231107BHUS", + "G10L 15/26 20130101LA20231107BHUS", + "G10L 25/87 20130101LA20231107BHUS", + "H04M 2201/40 20130101LA20231107BHUS", + "H04M 2201/41 20130101LA20231107BHUS", + "H04M 2203/40 20130101LA20231107BHUS", + "H04M 2203/401 20130101LA20231107BHUS" + ], + "application_number": "17690099", + "current_rank": 18, + "grade": 2, + "notes": "Sprach- und Sprecherkennung für Callcenter-Analyse sind zentral." + }, + { + "patent_id": "US11706338", + "title": "Voice and speech recognition for call center feedback and quality assurance", + "source": "USPTO", + "publication_year": "2023", + "match_score": 0.812, + "ipc_score": 0.77, + "topic_score": 1.0, + "text_score": 0.6666666666666666, + "topic_match_kind": "topic_id", + "matched_keywords": [ + "speech recognition" + ], + "matched_ipc_symbols": [ + "H04M2201/405" + ], + "text_retrieval": false, + "ipc": [ + "H04M 3/51 20060101AFI20230718BHUS", + "G10L 17/04 20130101ALI20230718BHUS", + "G10L 25/51 20130101ALI20230718BHUS", + "G10L 25/63 20130101ALI20230718BHUS", + "G10L 25/87 20130101ALI20230718BHUS", + "H04M 3/42 20060101ALI20230718BHUS", + "G06F 40/205 20200101ALI20230718BHUS", + "G10L 17/08 20130101ALI20230718BHUS", + "G10L 15/26 20060101ALN20230718BHUS" + ], + "cpc": [ + "H04M 3/5175 20130101FI20230718BHUS", + "G06F 40/205 20200101LI20230718BHUS", + "G10L 17/04 20130101LI20230718BHUS", + "G10L 17/08 20130101LI20230718BHUS", + "G10L 25/51 20130101LI20230718BHUS", + "G10L 25/63 20130101LI20230718BHUS", + "H04M 3/42 20130101LI20230718BHUS", + "G10L 15/26 20130101LA20230718BHUS", + "G10L 25/87 20130101LA20230718BHUS", + "H04M 2201/40 20130101LA20230718BHUS", + "H04M 2201/41 20130101LA20230718BHUS", + "H04M 2203/40 20130101LA20230718BHUS", + "H04M 2203/401 20130101LA20230718BHUS" + ], + "application_number": "17472557", + "current_rank": 19, + "grade": 2, + "notes": "Sprach- und Sprecherkennung für Callcenter-Analyse sind zentral." + }, + { + "patent_id": "US10863033", + "title": "Voice recognition system and voice recognition method", + "source": "USPTO", + "publication_year": "2020", + "match_score": 0.812, + "ipc_score": 0.77, + "topic_score": 1.0, + "text_score": 0.6666666666666666, + "topic_match_kind": "topic_id", + "matched_keywords": [ + "speech recognition" + ], + "matched_ipc_symbols": [ + "H04M2201/405" + ], + "text_retrieval": false, + "ipc": [ + "H04M 11/00 20060101AFI20201208BHUS", + "H04M 3/58 20060101ALI20201208BHUS", + "H04M 3/493 20060101ALI20201208BHUS", + "G10L 17/22 20130101ALI20201208BHUS", + "H04M 3/42 20060101ALI20201208BHUS", + "G10L 15/22 20060101ALI20201208BHUS" + ], + "cpc": [ + "H04M 3/58 20130101FI20201208BHUS", + "G10L 15/22 20130101LI20201208BHUS", + "G10L 17/22 20130101LI20201208BHUS", + "H04M 3/42221 20130101LI20201208BHUS", + "H04M 3/4931 20130101LI20201208BHUS", + "H04M 3/4936 20130101LI20201208BHUS", + "G10L 2015/223 20130101LA20201208BHUS", + "H04M 3/4933 20130101LA20201208BHUS", + "H04M 2201/18 20130101LA20201208BHUS", + "H04M 2201/39 20130101LA20201208BHUS", + "H04M 2201/40 20130101LA20201208BHUS" + ], + "application_number": "16432362", + "current_rank": 20, + "grade": 2, + "notes": "Sprach- und Stimmerkennung sind zentraler Gegenstand." + } + ], + "relevance_grades": { + "US12137183": 2, + "US11627221": 2, + "US11601548": 2, + "US10742805": 2, + "US09769314": 2, + "US09685159": 1, + "US09377992": 2, + "US09736309": 2, + "US12579986": 1, + "US10397400": 0, + "US09369577": 1, + "US12615335": 1, + "US12592239": 1, + "US09571617": 1, + "US12482458": 2, + "US12132865": 2, + "US12088761": 2, + "US11811970": 2, + "US11706338": 2, + "US10863033": 2 + }, + "relevant_patent_ids": [ + "US12137183", + "US11627221", + "US11601548", + "US10742805", + "US09769314", + "US09685159", + "US09377992", + "US09736309", + "US12579986", + "US09369577", + "US12615335", + "US12592239", + "US09571617", + "US12482458", + "US12132865", + "US12088761", + "US11811970", + "US11706338", + "US10863033" + ], + "irrelevant_patent_ids": [ + "US10397400" + ] + } + ], + "labeling_status": { + "completed": true, + "criterion": { + "0": "irrelevant / False Positive", + "1": "fachlich angrenzend oder relevante Teilanwendung", + "2": "Thema ist zentraler Patentgegenstand" + }, + "warning": "KI-gestützte Vorlabelierung anhand von Titel sowie IPC/CPC-Evidenz. Für einen wissenschaftlichen Goldstandard sollten Grenzfälle fachlich geprüft werden." + } +} \ No newline at end of file diff --git a/service/scripts/patents/data/keyword_patent_goldset_presentation.json b/service/scripts/patents/data/keyword_patent_goldset_presentation.json new file mode 100644 index 00000000..af14c599 --- /dev/null +++ b/service/scripts/patents/data/keyword_patent_goldset_presentation.json @@ -0,0 +1,1787 @@ +{ + "version": 1, + "presentation": true, + "description": "goldset for two IPC cases.", + "ks": [ + 5, + 10, + 20 + ], + "cases": [ + { + "id": "fuel-cell", + "description": "Fuel cell – expected IPC H01M", + "keywords": [ + { + "keyword": "fuel cell", + "keyword_level": "fine", + "topic_id": "https://openalex.org/T10409", + "topic_display_name": "Fuel Cells and Related Materials", + "subfield_name": "Electrical and Electronic Engineering", + "field_name": "Engineering", + "relevance_score": 1.0 + } + ], + "expected_ipc_prefixes": [ + "H01M" + ], + "relevant_patent_ids": [ + "US12087951", + "US10916789", + "US10847812", + "US10297888", + "US10096875", + "US10006461", + "EP3188296", + "US09564651", + "US09368819", + "US09214691", + "US09083025", + "US08974984", + "US08974983", + "US08895198", + "US08846266", + "US12512484", + "US12412912", + "US12368175" + ], + "irrelevant_patent_ids": [ + "US10847825", + "EP3549641" + ], + "relevance_grades": { + "US12087951": 2, + "US10916789": 2, + "US10847825": 0, + "US10847812": 2, + "EP3549641": 0, + "US10297888": 1, + "US10096875": 1, + "US10006461": 2, + "EP3188296": 2, + "US09564651": 2, + "US09368819": 2, + "US09214691": 2, + "US09083025": 2, + "US08974984": 2, + "US08974983": 2, + "US08895198": 2, + "US08846266": 2, + "US12512484": 2, + "US12412912": 1, + "US12368175": 2 + }, + "labeling_candidates": [ + { + "patent_id": "US12087951", + "title": "Electrochemical cell integrates electrolysis and fuel cell functions", + "source": "USPTO", + "publication_year": "2024", + "match_score": 0.9923, + "ipc_score": 0.9871, + "topic_score": 1.0, + "text_score": 1.0, + "topic_match_kind": "topic_id", + "matched_keywords": [ + "fuel cell" + ], + "matched_ipc_symbols": [ + "H01M8/083" + ], + "text_retrieval": false, + "ipc": [ + "H01M 4/90 20060101AFI20240910BHUS", + "C25B 11/081 20210101ALI20240910BHUS", + "H01M 8/0656 20160101ALI20240910BHUS", + "H01M 8/083 20160101ALI20240910BHUS" + ], + "cpc": [ + "H01M 4/9058 20130101FI20240910BHUS", + "C25B 11/081 20210101LI20240910BHUS", + "H01M 8/0656 20130101LI20240910BHUS", + "H01M 8/083 20130101LI20240910BHUS" + ], + "application_number": "17068023", + "current_rank": 1, + "grade": 2, + "notes": "Brennstoffzellenfunktion ist zentraler Gegenstand." + }, + { + "patent_id": "US10916789", + "title": "Alkaline exchange membrane fuel cells system having a bi-polar plate", + "source": "USPTO", + "publication_year": "2021", + "match_score": 0.9923, + "ipc_score": 0.9871, + "topic_score": 1.0, + "text_score": 1.0, + "topic_match_kind": "topic_id", + "matched_keywords": [ + "fuel cell" + ], + "matched_ipc_symbols": [ + "H01M8/083" + ], + "text_retrieval": false, + "ipc": [ + "H01M 8/083 20160101AFI20210209BHUS", + "H01M 8/023 20160101ALI20210209BHUS", + "H01M 8/0289 20160101ALI20210209BHUS", + "H01M 8/0258 20160101ALI20210209BHUS", + "H01M 8/1062 20160101ALI20210209BHUS", + "H01M 8/1067 20160101ALI20210209BHUS", + "H01M 4/88 20060101ALI20210209BHUS", + "H01M 8/04119 20160101ALI20210209BHUS", + "H01M 8/0267 20160101ALN20210209BHUS", + "H01M 8/0234 20160101ALN20210209BHUS", + "H01M 8/0232 20160101ALN20210209BHUS", + "H01M 8/04029 20160101ALN20210209BHUS" + ], + "cpc": [ + "H01M 8/083 20130101FI20210209BHUS", + "H01M 4/881 20130101LI20210209BHUS", + "H01M 4/8807 20130101LI20210209BHUS", + "H01M 8/023 20130101LI20210209BHUS", + "H01M 8/0258 20130101LI20210209BHUS", + "H01M 8/0289 20130101LI20210209BHUS", + "H01M 8/04119 20130101LI20210209BHUS", + "H01M 8/1062 20130101LI20210209BHUS", + "H01M 8/1067 20130101LI20210209BHUS", + "H01M 8/0232 20130101LA20210209BHUS", + "H01M 8/0234 20130101LA20210209BHUS", + "H01M 8/0267 20130101LA20210209BHUS", + "H01M 8/04029 20130101LA20210209BHUS" + ], + "application_number": "16085648", + "current_rank": 2, + "grade": 2, + "notes": "Brennstoffzellensystem und Bipolarplatte sind zentral." + }, + { + "patent_id": "US10847825", + "title": "Chloralkali process", + "source": "USPTO", + "publication_year": "2020", + "match_score": 0.9923, + "ipc_score": 0.9871, + "topic_score": 1.0, + "text_score": 1.0, + "topic_match_kind": "topic_id", + "matched_keywords": [ + "fuel cell" + ], + "matched_ipc_symbols": [ + "H01M8/083" + ], + "text_retrieval": false, + "ipc": [ + "H01M 8/06 20160101AFI20201124BHUS", + "C25B 1/46 20060101ALI20201124BHUS", + "C25B 9/10 20060101ALI20201124BHUS", + "C25B 13/08 20060101ALI20201124BHUS", + "H01M 8/083 20160101ALI20201124BHUS" + ], + "cpc": [ + "H01M 8/0693 20130101FI20201124BHUS", + "C25B 1/46 20130101LI20201124BHUS", + "C25B 9/10 20130101LI20201124BHUS", + "C25B 13/08 20130101LI20201124BHUS", + "H01M 8/083 20130101LI20201124BHUS" + ], + "application_number": "15740882", + "current_rank": 3, + "grade": 0, + "notes": "Chloralkali-Verfahren; Brennstoffzelle ist nicht der zentrale Patentgegenstand." + }, + { + "patent_id": "US10847812", + "title": "Separator plate, membrane electrode assembly and fuel cell", + "source": "USPTO", + "publication_year": "2020", + "match_score": 0.9923, + "ipc_score": 0.9871, + "topic_score": 1.0, + "text_score": 1.0, + "topic_match_kind": "topic_id", + "matched_keywords": [ + "fuel cell" + ], + "matched_ipc_symbols": [ + "H01M8/083" + ], + "text_retrieval": false, + "ipc": [ + "H01M 8/0221 20160101AFI20201124BHUS", + "H01M 8/0258 20160101ALI20201124BHUS", + "H01M 8/1018 20160101ALI20201124BHUS", + "H01M 8/2418 20160101ALI20201124BHUS", + "H01M 8/0223 20160101ALI20201124BHUS", + "H01M 8/1004 20160101ALI20201124BHUS", + "H01M 8/1011 20160101ALN20201124BHUS", + "H01M 8/14 20060101ALN20201124BHUS", + "H01M 8/0267 20160101ALN20201124BHUS", + "H01M 8/083 20160101ALN20201124BHUS", + "H01M 8/124 20160101ALN20201124BHUS", + "H01M 8/086 20160101ALN20201124BHUS" + ], + "cpc": [ + "H01M 8/0221 20130101FI20201124BHUS", + "H01M 8/0223 20130101LI20201124BHUS", + "H01M 8/0258 20130101LI20201124BHUS", + "H01M 8/1004 20130101LI20201124BHUS", + "H01M 8/1018 20130101LI20201124BHUS", + "H01M 8/2418 20160201LI20201124BHUS", + "H01M 8/0267 20130101LA20201124BHUS", + "H01M 8/083 20130101LA20201124BHUS", + "H01M 8/086 20130101LA20201124BHUS", + "H01M 8/1011 20130101LA20201124BHUS", + "H01M 2008/1095 20130101LA20201124BHUS", + "H01M 2008/1293 20130101LA20201124BHUS", + "H01M 2008/147 20130101LA20201124BHUS" + ], + "application_number": "15852824", + "current_rank": 4, + "grade": 2, + "notes": "Brennstoffzellenkomponenten und Membran-Elektroden-Einheit sind zentral." + }, + { + "patent_id": "EP3549641", + "title": "FUEL TANK INERTING SYSTEM", + "source": "EPO", + "publication_year": "2019", + "match_score": 0.9923, + "ipc_score": 0.9871, + "topic_score": 1.0, + "text_score": 1.0, + "topic_match_kind": "topic_id", + "matched_keywords": [ + "fuel cell" + ], + "matched_ipc_symbols": [ + "H01M8/083" + ], + "text_retrieval": false, + "ipc": [ + "A62C 3/06 20060101AFI20190820BHEP", + "A62C 3/08 20060101ALI20190820BHEP", + "A62C 99/00 20100101ALI20190820BHEP", + "B01D 53/32 20060101ALI20190820BHEP", + "H01M 8/00 20160101ALI20190820BHEP", + "H01M 8/083 20160101ALI20190820BHEP" + ], + "cpc": [], + "application_number": "19167279.9", + "current_rank": 5, + "grade": 0, + "notes": "Tank-Inertisierung; Brennstoffzellentechnik ist höchstens eine Teilkomponente." + }, + { + "patent_id": "US10297888", + "title": "Method and system for storing electricity in metals", + "source": "USPTO", + "publication_year": "2019", + "match_score": 0.9923, + "ipc_score": 0.9871, + "topic_score": 1.0, + "text_score": 1.0, + "topic_match_kind": "topic_id", + "matched_keywords": [ + "fuel cell" + ], + "matched_ipc_symbols": [ + "H01M8/083" + ], + "text_retrieval": false, + "ipc": [ + "H01M 12/08 20060101AFI20190521BHUS", + "H01M 8/083 20160101ALI20190521BHUS", + "H01M 10/48 20060101ALI20190521BHUS", + "H01M 8/04828 20160101ALI20190521BHUS", + "H01M 10/44 20060101ALI20190521BHUS", + "H01M 8/18 20060101ALI20190521BHUS", + "H01M 8/04313 20160101ALI20190521BHUS", + "H01M 8/0444 20160101ALI20190521BHUS", + "H01M 8/04537 20160101ALI20190521BHUS" + ], + "cpc": [ + "H01M 12/08 20130101FI20190521BHUS", + "H01M 8/0444 20130101LI20190521BHUS", + "H01M 8/04537 20130101LI20190521BHUS", + "H01M 10/44 20130101LI20190521BHUS", + "H01M 10/48 20130101LI20190521BHUS", + "Y02E 60/128 20130101LA20190521BHUS" + ], + "application_number": "15053983", + "current_rank": 6, + "grade": 1, + "notes": "Elektrochemische Energiespeicherung mit technischer Nähe zu Brennstoffzellen." + }, + { + "patent_id": "US10096875", + "title": "System and method for increasing electrical efficiency of metal-air cell", + "source": "USPTO", + "publication_year": "2018", + "match_score": 0.9923, + "ipc_score": 0.9871, + "topic_score": 1.0, + "text_score": 1.0, + "topic_match_kind": "topic_id", + "matched_keywords": [ + "fuel cell" + ], + "matched_ipc_symbols": [ + "H01M8/083" + ], + "text_retrieval": false, + "ipc": [ + "H01M 4/36 20060101AFI20181009BHUS", + "H01M 12/08 20060101ALI20181009BHUS", + "H01M 2/40 20060101ALI20181009BHUS", + "H01M 8/083 20160101ALI20181009BHUS", + "H01M 12/06 20060101ALI20181009BHUS" + ], + "cpc": [ + "H01M 12/08 20130101FI20181009BHUS", + "H01M 2/40 20130101LI20181009BHUS", + "H01M 8/083 20130101LI20181009BHUS", + "H01M 12/065 20130101LI20181009BHUS", + "H01M 2300/0014 20130101LA20181009BHUS", + "Y02E 60/128 20130101LA20181009BHUS" + ], + "application_number": "14779753", + "current_rank": 7, + "grade": 1, + "notes": "Metall-Luft-Zelle; elektrochemisch verwandt, aber keine klassische Brennstoffzelle." + }, + { + "patent_id": "US10006461", + "title": "Electrolyte circulation in fuel cells stacks with reduced leakage current", + "source": "USPTO", + "publication_year": "2018", + "match_score": 0.9923, + "ipc_score": 0.9871, + "topic_score": 1.0, + "text_score": 1.0, + "topic_match_kind": "topic_id", + "matched_keywords": [ + "fuel cell" + ], + "matched_ipc_symbols": [ + "H01M8/083" + ], + "text_retrieval": false, + "ipc": [ + "H01M 8/08 20160101AFI20180626BHUS", + "F04D 13/10 20060101ALI20180626BHUS", + "H01M 8/083 20160101ALI20180626BHUS", + "H01M 8/24 20160101ALI20180626BHUS", + "H01M 8/2485 20160101ALI20180626BHUS", + "H01M 8/04276 20160101ALI20180626BHUS", + "H01M 8/04291 20160101ALI20180626BHUS", + "H01M 8/0289 20160101ALN20180626BHUS" + ], + "cpc": [ + "F04D 13/10 20130101FI20180626BHUS", + "H01M 8/04276 20130101LI20180626BHUS", + "H01M 8/04291 20130101LI20180626BHUS", + "H01M 8/083 20130101LI20180626BHUS", + "H01M 8/2445 20130101LI20180626BHUS", + "H01M 8/2485 20130101LI20180626BHUS", + "H01M 8/0289 20130101LA20180626BHUS" + ], + "application_number": "14402650", + "current_rank": 8, + "grade": 2, + "notes": "Elektrolytzirkulation in Brennstoffzellenstapeln ist zentral." + }, + { + "patent_id": "EP3188296", + "title": "ADJUSTMENT METHOD OF THE ELECTROLYTE COMPOSITION FOR A FUEL CELL SYSTEM", + "source": "EPO", + "publication_year": "2017", + "match_score": 0.9923, + "ipc_score": 0.9871, + "topic_score": 1.0, + "text_score": 1.0, + "topic_match_kind": "topic_id", + "matched_keywords": [ + "fuel cell" + ], + "matched_ipc_symbols": [ + "H01M8/083" + ], + "text_retrieval": false, + "ipc": [ + "H01M 8/0656 20160101AFI20170424BHEP", + "C25B 1/04 20060101ALI20170424BHEP", + "H01M 8/083 20160101ALI20170424BHEP", + "H01M 16/00 20060101ALI20170424BHEP", + "H01M 8/04276 20160101ALI20170424BHEP", + "H01M 8/0444 20160101ALI20170424BHEP", + "H01M 8/04791 20160101ALI20170424BHEP" + ], + "cpc": [], + "application_number": "16207072.6", + "current_rank": 9, + "grade": 2, + "notes": "Elektrolytzusammensetzung für ein Brennstoffzellensystem ist zentral." + }, + { + "patent_id": "US09564651", + "title": "Liquid electrolyte fuel cell system", + "source": "USPTO", + "publication_year": "2017", + "match_score": 0.9923, + "ipc_score": 0.9871, + "topic_score": 1.0, + "text_score": 1.0, + "topic_match_kind": "topic_id", + "matched_keywords": [ + "fuel cell" + ], + "matched_ipc_symbols": [ + "H01M8/083" + ], + "text_retrieval": false, + "ipc": [ + "H01M 8/08 20160101AFI20170207BHUS", + "H01M 8/04 20160101ALN20170207BHUS" + ], + "cpc": [ + "H01M 8/083 20130101FI20170207BHUS", + "H01M 8/04164 20130101LI20170207BHUS", + "H01M 8/04276 20130101LI20170207BHUS", + "H01M 8/0485 20130101LA20170207BHUS", + "H01M 2300/0014 20130101LA20170207BHUS", + "Y02E 60/50 20130101LA20170207BHUS" + ], + "application_number": "14370731", + "current_rank": 10, + "grade": 2, + "notes": "Flüssigelektrolyt-Brennstoffzellensystem ist zentral." + }, + { + "patent_id": "US09368819", + "title": "Systems and methods of securing immunity to air CO2 in alkaline fuel cells", + "source": "USPTO", + "publication_year": "2016", + "match_score": 0.9923, + "ipc_score": 0.9871, + "topic_score": 1.0, + "text_score": 1.0, + "topic_match_kind": "topic_id", + "matched_keywords": [ + "fuel cell" + ], + "matched_ipc_symbols": [ + "H01M8/083" + ], + "text_retrieval": false, + "ipc": [ + "H01M 8/06 20060101AFI20160614BHUS", + "H01M 8/08 20160101ALI20160614BHUS", + "H01M 8/10 20160101ALI20160614BHUS", + "H01M 10/46 20060101ALI20160614BHUS", + "H02J 7/00 20060101ALI20160614BHUS" + ], + "cpc": [ + "H01M 8/0668 20130101FI20160614BHUS", + "H01M 8/0693 20130101LI20160614BHUS", + "H01M 8/083 20130101LI20160614BHUS", + "H01M 8/1002 20130101LI20160614BHUS", + "H01M 10/46 20130101LI20160614BHUS", + "H02J 7/0063 20130101LI20160614BHUS", + "H01M 2300/0014 20130101LA20160614BHUS", + "H01M 2300/0082 20130101LA20160614BHUS" + ], + "application_number": "14957760", + "current_rank": 11, + "grade": 2, + "notes": "Schutz alkalischer Brennstoffzellen vor CO2 ist zentral." + }, + { + "patent_id": "US09214691", + "title": "Systems and methods of securing immunity to air CO2 in alkaline fuel cells", + "source": "USPTO", + "publication_year": "2015", + "match_score": 0.9923, + "ipc_score": 0.9871, + "topic_score": 1.0, + "text_score": 1.0, + "topic_match_kind": "topic_id", + "matched_keywords": [ + "fuel cell" + ], + "matched_ipc_symbols": [ + "H01M8/083" + ], + "text_retrieval": false, + "ipc": [ + "H01M 8/06 20060101AFI20151215BHUS", + "H01M 8/08 20060101ALI20151215BHUS" + ], + "cpc": [ + "H01M 8/0668 20130101FI20151215BHUS", + "H01M 8/083 20130101LI20151215BHUS", + "Y02E 60/50 20130101LA20151215BHUS" + ], + "application_number": "14552700", + "current_rank": 12, + "grade": 2, + "notes": "Schutz alkalischer Brennstoffzellen vor CO2 ist zentral." + }, + { + "patent_id": "US09083025", + "title": "Fuel cell stacks", + "source": "USPTO", + "publication_year": "2015", + "match_score": 0.9923, + "ipc_score": 0.9871, + "topic_score": 1.0, + "text_score": 1.0, + "topic_match_kind": "topic_id", + "matched_keywords": [ + "fuel cell" + ], + "matched_ipc_symbols": [ + "H01M8/083" + ], + "text_retrieval": false, + "ipc": [ + "H01M 8/04 20060101AFI20150714BHUS", + "H01M 8/08 20060101ALI20150714BHUS", + "H01M 8/24 20060101ALI20150714BHUS" + ], + "cpc": [ + "H01M 8/08 20130101FI20150714BHUS", + "H01M 8/083 20130101LI20150714BHUS", + "H01M 8/2445 20130101LI20150714BHUS", + "Y02E 60/50 20130101LA20150714BHUS" + ], + "application_number": "13695453", + "current_rank": 13, + "grade": 2, + "notes": "Brennstoffzellenstapel sind zentraler Gegenstand." + }, + { + "patent_id": "US08974984", + "title": "Power generation system using an alkaline fuel cell and fuel gas for alkaline fuel cells used in the system", + "source": "USPTO", + "publication_year": "2015", + "match_score": 0.9923, + "ipc_score": 0.9871, + "topic_score": 1.0, + "text_score": 1.0, + "topic_match_kind": "topic_id", + "matched_keywords": [ + "fuel cell" + ], + "matched_ipc_symbols": [ + "H01M8/083" + ], + "text_retrieval": false, + "ipc": [ + "H01M 8/22 20060101AFI20150310BHUS", + "H01M 8/08 20060101ALI20150310BHUS" + ], + "cpc": [ + "H01M 8/083 20130101FI20150310BHUS", + "H01M 8/222 20130101LI20150310BHUS", + "Y02E 60/50 20130101LA20150310BHUS" + ], + "application_number": "13387130", + "current_rank": 14, + "grade": 2, + "notes": "Stromerzeugung mit alkalischer Brennstoffzelle ist zentral." + }, + { + "patent_id": "US08974983", + "title": "Electrical conductive member and polymer electrolyte fuel cell using the same", + "source": "USPTO", + "publication_year": "2015", + "match_score": 0.9923, + "ipc_score": 0.9871, + "topic_score": 1.0, + "text_score": 1.0, + "topic_match_kind": "topic_id", + "matched_keywords": [ + "fuel cell" + ], + "matched_ipc_symbols": [ + "H01M8/083" + ], + "text_retrieval": false, + "ipc": [ + "H01M 8/10 20060101AFI20150310BHUS", + "H01M 8/02 20060101ALI20150310BHUS", + "H01M 8/08 20060101ALN20150310BHUS", + "H01M 8/12 20060101ALN20150310BHUS", + "H01M 8/14 20060101ALN20150310BHUS" + ], + "cpc": [ + "H01M 8/0213 20130101FI20150310BHUS", + "H01M 8/0228 20130101LI20150310BHUS", + "H01M 8/0254 20130101LA20150310BHUS", + "H01M 8/083 20130101LA20150310BHUS", + "H01M 8/086 20130101LA20150310BHUS", + "H01M 2008/1095 20130101LA20150310BHUS", + "H01M 2008/1293 20130101LA20150310BHUS", + "H01M 2008/147 20130101LA20150310BHUS", + "Y02E 60/50 20130101LA20150310BHUS", + "Y02E 60/525 20130101LA20150310BHUS", + "Y02E 60/526 20130101LA20150310BHUS" + ], + "application_number": "13130979", + "current_rank": 15, + "grade": 2, + "notes": "Leitfähiges Bauteil für Polymer-Elektrolyt-Brennstoffzellen ist zentral." + }, + { + "patent_id": "US08895198", + "title": "Systems and methods of securing immunity to air CO2 in alkaline fuel cells", + "source": "USPTO", + "publication_year": "2014", + "match_score": 0.9923, + "ipc_score": 0.9871, + "topic_score": 1.0, + "text_score": 1.0, + "topic_match_kind": "topic_id", + "matched_keywords": [ + "fuel cell" + ], + "matched_ipc_symbols": [ + "H01M8/083" + ], + "text_retrieval": false, + "ipc": [ + "H01M 8/06 20060101AFI20141125BHUS", + "H01M 8/08 20060101ALI20141125BHUS" + ], + "cpc": [ + "H01M 8/0668 20130101FI20141125BHUS", + "Y02E 60/50 20130101LA20141125BHUS", + "H01M 8/083 20130101LI20141125BHUS" + ], + "application_number": "12862746", + "current_rank": 16, + "grade": 2, + "notes": "Schutz alkalischer Brennstoffzellen vor CO2 ist zentral." + }, + { + "patent_id": "US08846266", + "title": "Carbohydrate anode for fuel cell and battery applications", + "source": "USPTO", + "publication_year": "2014", + "match_score": 0.9923, + "ipc_score": 0.9871, + "topic_score": 1.0, + "text_score": 1.0, + "topic_match_kind": "topic_id", + "matched_keywords": [ + "fuel cell" + ], + "matched_ipc_symbols": [ + "H01M8/083" + ], + "text_retrieval": false, + "ipc": [ + "H01M 8/08 20060101AFI20140930BHUS", + "H01M 8/22 20060101ALI20140930BHUS", + "H01M 4/96 20060101ALI20140930BHUS" + ], + "cpc": [ + "H01M 8/083 20130101FI20140930BHUS", + "H01M 4/96 20130101LI20140930BHUS", + "H01M 2300/0014 20130101LA20140930BHUS", + "Y02E 60/50 20130101LA20140930BHUS" + ], + "application_number": "12769598", + "current_rank": 17, + "grade": 2, + "notes": "Anode für Brennstoffzellenanwendungen ist zentral." + }, + { + "patent_id": "US12512484", + "title": "Alkaline fuel cell electrode catalyst, alkaline fuel cell, and methods of making and using an electrode catalyst", + "source": "USPTO", + "publication_year": "2025", + "match_score": 0.9423, + "ipc_score": 0.9871, + "topic_score": 1.0, + "text_score": 0.6666666666666666, + "topic_match_kind": "topic_id", + "matched_keywords": [ + "fuel cell" + ], + "matched_ipc_symbols": [ + "H01M8/083" + ], + "text_retrieval": false, + "ipc": [ + "H01M 4/90 20060101AFI20251230BHUS", + "H01M 4/88 20060101ALI20251230BHUS", + "H01M 8/083 20160101ALI20251230BHUS", + "H01M 4/86 20060101ALN20251230BHUS" + ], + "cpc": [ + "H01M 4/9016 20130101FI20251230BHUS", + "H01M 4/8882 20130101LI20251230BHUS", + "H01M 8/083 20130101LI20251230BHUS", + "H01M 2004/8689 20130101LA20251230BHUS" + ], + "application_number": "18081485", + "current_rank": 18, + "grade": 2, + "notes": "Elektrodenkatalysator und alkalische Brennstoffzelle sind zentral." + }, + { + "patent_id": "US12412912", + "title": "Electrochemical amine/nitrile redox method for ambient hydrogen storage", + "source": "USPTO", + "publication_year": "2025", + "match_score": 0.9423, + "ipc_score": 0.9871, + "topic_score": 1.0, + "text_score": 0.6666666666666666, + "topic_match_kind": "topic_id", + "matched_keywords": [ + "fuel cell" + ], + "matched_ipc_symbols": [ + "H01M8/083" + ], + "text_retrieval": false, + "ipc": [ + "H01M 8/04082 20160101AFI20250909BHUS", + "H01M 8/04089 20160101ALI20250909BHUS", + "H01M 8/083 20160101ALI20250909BHUS", + "H01M 8/2457 20160101ALI20250909BHUS" + ], + "cpc": [ + "H01M 8/04216 20130101FI20250909BHUS", + "H01M 8/04089 20130101LI20250909BHUS", + "H01M 8/083 20130101LI20250909BHUS", + "H01M 8/2457 20160201LI20250909BHUS", + "H01M 2300/0014 20130101LA20250909BHUS" + ], + "application_number": "17875171", + "current_rank": 19, + "grade": 1, + "notes": "Wasserstoffspeicherung mit Nähe zu Brennstoffzellensystemen, aber nicht zentral." + }, + { + "patent_id": "US12368175", + "title": "Solid oxide fuel cell comprising anode alkaline-based promoter loaded", + "source": "USPTO", + "publication_year": "2025", + "match_score": 0.9423, + "ipc_score": 0.9871, + "topic_score": 1.0, + "text_score": 0.6666666666666666, + "topic_match_kind": "topic_id", + "matched_keywords": [ + "fuel cell" + ], + "matched_ipc_symbols": [ + "H01M8/083" + ], + "text_retrieval": false, + "ipc": [ + "H01M 8/083 20160101AFI20250722BHUS", + "H01M 4/86 20060101ALI20250722BHUS", + "H01M 4/90 20060101ALI20250722BHUS", + "H01M 8/0217 20160101ALI20250722BHUS", + "H01M 8/12 20160101ALI20250722BHUS", + "H01M 8/1246 20160101ALI20250722BHUS" + ], + "cpc": [ + "H01M 8/083 20130101FI20250722BHUS", + "H01M 4/8621 20130101LI20250722BHUS", + "H01M 4/9033 20130101LI20250722BHUS", + "H01M 8/0217 20130101LI20250722BHUS", + "H01M 8/1246 20130101LI20250722BHUS", + "H01M 2008/1293 20130101LA20250722BHUS" + ], + "application_number": "18659291", + "current_rank": 20, + "grade": 2, + "notes": "Festoxid-Brennstoffzelle ist zentraler Gegenstand." + } + ] + }, + { + "id": "speech-recognition", + "description": "Speech recognition – expected IPC G10L", + "keywords": [ + { + "keyword": "speech recognition", + "keyword_level": "fine", + "topic_id": "https://openalex.org/T10201", + "topic_display_name": "Speech Recognition and Synthesis", + "subfield_name": "Artificial Intelligence", + "field_name": "Computer Science", + "relevance_score": 1.0 + } + ], + "expected_ipc_prefixes": [ + "G10L" + ], + "relevant_patent_ids": [ + "US12137183", + "US11627221", + "US11601548", + "US10742805", + "US09769314", + "US09685159", + "US09377992", + "US09736309", + "US12579986", + "US09369577", + "US12615335", + "US12592239", + "US09571617", + "US12482458", + "US12132865", + "US12088761", + "US11811970", + "US11706338", + "US10863033" + ], + "irrelevant_patent_ids": [ + "US10397400" + ], + "relevance_grades": { + "US12137183": 2, + "US11627221": 2, + "US11601548": 2, + "US10742805": 2, + "US09769314": 2, + "US09685159": 1, + "US09377992": 2, + "US09736309": 2, + "US12579986": 1, + "US10397400": 0, + "US09369577": 1, + "US12615335": 1, + "US12592239": 1, + "US09571617": 1, + "US12482458": 2, + "US12132865": 2, + "US12088761": 2, + "US11811970": 2, + "US11706338": 2, + "US10863033": 2 + }, + "labeling_candidates": [ + { + "patent_id": "US12137183", + "title": "Semiautomated relay method and apparatus", + "source": "USPTO", + "publication_year": "2024", + "match_score": 0.8634, + "ipc_score": 0.8556, + "topic_score": 1.0, + "text_score": 0.6666666666666666, + "topic_match_kind": "topic_id", + "matched_keywords": [ + "speech recognition" + ], + "matched_ipc_symbols": [ + "H04M2201/405" + ], + "text_retrieval": false, + "ipc": [ + "G10L 15/00 20130101AFI20241105BHUS", + "G10L 15/01 20130101ALI20241105BHUS", + "G10L 15/06 20130101ALI20241105BHUS", + "G10L 15/22 20060101ALI20241105BHUS", + "G10L 15/26 20060101ALI20241105BHUS", + "G10L 21/10 20130101ALI20241105BHUS", + "H04M 1/247 20210101ALI20241105BHUS", + "H04M 1/72478 20210101ALI20241105BHUS", + "H04M 3/42 20060101ALI20241105BHUS", + "H04W 4/12 20090101ALI20241105BHUS", + "H04W 4/16 20090101ALI20241105BHUS", + "H04M 3/533 20060101ALN20241105BHUS" + ], + "cpc": [ + "H04M 3/42391 20130101FI20241105BHUS", + "G10L 15/01 20130101LI20241105BHUS", + "G10L 15/06 20130101LI20241105BHUS", + "G10L 15/22 20130101LI20241105BHUS", + "G10L 15/26 20130101LI20241105BHUS", + "G10L 21/10 20130101LI20241105BHUS", + "H04M 1/2475 20130101LI20241105BHUS", + "H04M 1/72478 20210101LI20241105BHUS", + "H04W 4/12 20130101LI20241105BHUS", + "H04W 4/16 20130101LI20241105BHUS", + "H04M 3/53366 20130101LA20241105BHUS", + "H04M 2201/18 20130101LA20241105BHUS", + "H04M 2201/40 20130101LA20241105BHUS", + "H04M 2201/405 20130101LA20241105BHUS" + ], + "application_number": "18123557", + "current_rank": 1, + "grade": 2, + "notes": "Spracherkennung und Transkription im Relay-System sind zentral." + }, + { + "patent_id": "US11627221", + "title": "Semiautomated relay method and apparatus", + "source": "USPTO", + "publication_year": "2023", + "match_score": 0.8634, + "ipc_score": 0.8556, + "topic_score": 1.0, + "text_score": 0.6666666666666666, + "topic_match_kind": "topic_id", + "matched_keywords": [ + "speech recognition" + ], + "matched_ipc_symbols": [ + "H04M2201/405" + ], + "text_retrieval": false, + "ipc": [ + "G10L 15/00 20130101AFI20230411BHUS", + "H04M 3/42 20060101ALI20230411BHUS", + "G10L 15/06 20130101ALI20230411BHUS", + "G10L 15/22 20060101ALI20230411BHUS", + "H04M 1/247 20210101ALI20230411BHUS", + "H04M 1/72478 20210101ALI20230411BHUS", + "G10L 15/26 20060101ALI20230411BHUS", + "H04W 4/12 20090101ALI20230411BHUS", + "H04W 4/16 20090101ALI20230411BHUS", + "G10L 21/10 20130101ALI20230411BHUS", + "G10L 15/01 20130101ALI20230411BHUS", + "H04M 3/533 20060101ALN20230411BHUS" + ], + "cpc": [ + "H04M 3/42391 20130101FI20230411BHUS", + "G10L 15/01 20130101LI20230411BHUS", + "G10L 15/06 20130101LI20230411BHUS", + "G10L 15/22 20130101LI20230411BHUS", + "G10L 15/26 20130101LI20230411BHUS", + "G10L 21/10 20130101LI20230411BHUS", + "H04M 1/2475 20130101LI20230411BHUS", + "H04M 1/72478 20210101LI20230411BHUS", + "H04W 4/12 20130101LI20230411BHUS", + "H04W 4/16 20130101LI20230411BHUS", + "H04M 3/53366 20130101LA20230411BHUS", + "H04M 2201/18 20130101LA20230411BHUS", + "H04M 2201/40 20130101LA20230411BHUS", + "H04M 2201/405 20130101LA20230411BHUS" + ], + "application_number": "16911691", + "current_rank": 2, + "grade": 2, + "notes": "Spracherkennung und Transkription im Relay-System sind zentral." + }, + { + "patent_id": "US11601548", + "title": "Captioned telephone services improvement", + "source": "USPTO", + "publication_year": "2023", + "match_score": 0.8634, + "ipc_score": 0.8556, + "topic_score": 1.0, + "text_score": 0.6666666666666666, + "topic_match_kind": "topic_id", + "matched_keywords": [ + "speech recognition" + ], + "matched_ipc_symbols": [ + "H04M2201/405" + ], + "text_retrieval": false, + "ipc": [ + "H04M 3/42 20060101AFI20230307BHUS", + "G10L 15/26 20060101ALI20230307BHUS", + "H04M 3/436 20060101ALI20230307BHUS" + ], + "cpc": [ + "H04M 3/42382 20130101FI20230307BHUS", + "G10L 15/26 20130101LI20230307BHUS", + "H04M 3/42391 20130101LI20230307BHUS", + "H04M 3/436 20130101LI20230307BHUS", + "H04M 2201/405 20130101LA20230307BHUS" + ], + "application_number": "17184006", + "current_rank": 3, + "grade": 2, + "notes": "Automatische Transkription für Telefondienste ist zentral." + }, + { + "patent_id": "US10742805", + "title": "Semiautomated relay method and apparatus", + "source": "USPTO", + "publication_year": "2020", + "match_score": 0.8634, + "ipc_score": 0.8556, + "topic_score": 1.0, + "text_score": 0.6666666666666666, + "topic_match_kind": "topic_id", + "matched_keywords": [ + "speech recognition" + ], + "matched_ipc_symbols": [ + "H04M2201/405" + ], + "text_retrieval": false, + "ipc": [ + "H04M 3/42 20060101AFI20200811BHUS", + "G10L 15/06 20130101ALI20200811BHUS", + "G10L 15/22 20060101ALI20200811BHUS", + "H04M 1/247 20060101ALI20200811BHUS", + "H04M 1/725 20060101ALI20200811BHUS", + "G10L 15/26 20060101ALI20200811BHUS", + "H04W 4/12 20090101ALI20200811BHUS", + "H04W 4/16 20090101ALI20200811BHUS", + "G10L 21/10 20130101ALI20200811BHUS", + "G10L 15/01 20130101ALI20200811BHUS", + "H04M 3/533 20060101ALN20200811BHUS" + ], + "cpc": [ + "H04M 3/42391 20130101FI20200811BHUS", + "G10L 15/01 20130101LI20200811BHUS", + "G10L 15/06 20130101LI20200811BHUS", + "G10L 15/22 20130101LI20200811BHUS", + "G10L 15/26 20130101LI20200811BHUS", + "G10L 15/265 20130101LI20200811BHUS", + "G10L 21/10 20130101LI20200811BHUS", + "H04M 1/2475 20130101LI20200811BHUS", + "H04M 1/72591 20130101LI20200811BHUS", + "H04W 4/12 20130101LI20200811BHUS", + "H04W 4/16 20130101LI20200811BHUS", + "H04M 3/53366 20130101LA20200811BHUS", + "H04M 2201/18 20130101LA20200811BHUS", + "H04M 2201/40 20130101LA20200811BHUS", + "H04M 2201/405 20130101LA20200811BHUS" + ], + "application_number": "15477958", + "current_rank": 4, + "grade": 2, + "notes": "Spracherkennung und Transkription im Relay-System sind zentral." + }, + { + "patent_id": "US09769314", + "title": "Personal voice-based information retrieval system", + "source": "USPTO", + "publication_year": "2017", + "match_score": 0.8634, + "ipc_score": 0.8556, + "topic_score": 1.0, + "text_score": 0.6666666666666666, + "topic_match_kind": "topic_id", + "matched_keywords": [ + "speech recognition" + ], + "matched_ipc_symbols": [ + "H04M2201/405" + ], + "text_retrieval": false, + "ipc": [ + "H04M 3/493 20060101AFI20170919BHUS", + "G06F 3/16 20060101ALI20170919BHUS", + "G10L 15/26 20060101ALI20170919BHUS", + "G06F 17/30 20060101ALI20170919BHUS", + "G10L 15/08 20060101ALI20170919BHUS", + "G10L 25/54 20130101ALI20170919BHUS", + "G10L 13/08 20130101ALI20170919BHUS", + "G10L 15/02 20060101ALI20170919BHUS", + "G10L 15/22 20060101ALI20170919BHUS", + "G10L 17/24 20130101ALN20170919BHUS", + "G10L 15/06 20130101ALN20170919BHUS", + "H04L 29/08 20060101ALN20170919BHUS" + ], + "cpc": [ + "H04M 3/4938 20130101FI20170919BHUS", + "G06F 3/167 20130101LI20170919BHUS", + "G06F 17/30769 20130101LI20170919BHUS", + "G06F 17/30861 20130101LI20170919BHUS", + "G10L 13/08 20130101LI20170919BHUS", + "G10L 15/02 20130101LI20170919BHUS", + "G10L 15/08 20130101LI20170919BHUS", + "G10L 15/22 20130101LI20170919BHUS", + "G10L 15/26 20130101LI20170919BHUS", + "G10L 25/54 20130101LI20170919BHUS", + "H04L 67/02 20130101LI20170919BHUS", + "G10L 15/06 20130101LA20170919BHUS", + "G10L 17/24 20130101LA20170919BHUS", + "G10L 2015/223 20130101LA20170919BHUS", + "H04L 29/0809 20130101LA20170919BHUS", + "H04M 2201/39 20130101LA20170919BHUS", + "H04M 2201/40 20130101LA20170919BHUS", + "H04M 2201/405 20130101LA20170919BHUS", + "H04M 2207/40 20130101LA20170919BHUS" + ], + "application_number": "15193517", + "current_rank": 5, + "grade": 2, + "notes": "Sprachbasierte Informationssuche mit Spracherkennung ist zentral." + }, + { + "patent_id": "US09685159", + "title": "Speaker recognition from telephone calls", + "source": "USPTO", + "publication_year": "2017", + "match_score": 0.8634, + "ipc_score": 0.8556, + "topic_score": 1.0, + "text_score": 0.6666666666666666, + "topic_match_kind": "topic_id", + "matched_keywords": [ + "speech recognition" + ], + "matched_ipc_symbols": [ + "H04M2201/405" + ], + "text_retrieval": false, + "ipc": [ + "G10L 17/00 20130101AFI20170620BHUS", + "G10L 17/02 20130101ALI20170620BHUS", + "G10L 17/06 20130101ALI20170620BHUS", + "H04M 3/22 20060101ALN20170620BHUS", + "H04M 3/436 20060101ALN20170620BHUS" + ], + "cpc": [ + "G10L 17/00 20130101FI20170620BHUS", + "G10L 17/02 20130101LI20170620BHUS", + "G10L 17/06 20130101LI20170620BHUS", + "H04M 3/2281 20130101LA20170620BHUS", + "H04M 3/436 20130101LA20170620BHUS", + "H04M 2201/405 20130101LA20170620BHUS", + "H04M 2201/41 20130101LA20170620BHUS" + ], + "application_number": "14817182", + "current_rank": 6, + "grade": 1, + "notes": "Sprechererkennung ist eng verwandt, aber nicht klassische Spracherkennung." + }, + { + "patent_id": "US09377992", + "title": "Personal voice-based information retrieval system", + "source": "USPTO", + "publication_year": "2016", + "match_score": 0.8634, + "ipc_score": 0.8556, + "topic_score": 1.0, + "text_score": 0.6666666666666666, + "topic_match_kind": "topic_id", + "matched_keywords": [ + "speech recognition" + ], + "matched_ipc_symbols": [ + "H04M2201/405" + ], + "text_retrieval": false, + "ipc": [ + "G06F 3/16 20060101AFI20160628BHUS", + "G10L 15/26 20060101ALI20160628BHUS", + "G10L 17/24 20130101ALN20160628BHUS", + "G10L 15/06 20130101ALN20160628BHUS", + "H04M 3/493 20060101ALN20160628BHUS", + "H04L 29/08 20060101ALN20160628BHUS" + ], + "cpc": [ + "G06F 3/167 20130101FI20160628BHUS", + "G10L 15/26 20130101LI20160628BHUS", + "G10L 15/06 20130101LA20160628BHUS", + "G10L 17/24 20130101LA20160628BHUS", + "H04L 29/0809 20130101LA20160628BHUS", + "H04M 3/4938 20130101LA20160628BHUS", + "H04M 2201/405 20130101LA20160628BHUS", + "H04M 2207/40 20130101LA20160628BHUS" + ], + "application_number": "12787801", + "current_rank": 7, + "grade": 2, + "notes": "Sprachbasierte Informationssuche mit Spracherkennung ist zentral." + }, + { + "patent_id": "US09736309", + "title": "Real-time transcription and interaction with a caller based on the transcription", + "source": "USPTO", + "publication_year": "2017", + "match_score": 0.862, + "ipc_score": 0.77, + "topic_score": 1.0, + "text_score": 1.0, + "topic_match_kind": "topic_id", + "matched_keywords": [ + "speech recognition" + ], + "matched_ipc_symbols": [ + "H04M2201/405" + ], + "text_retrieval": false, + "ipc": [ + "H04M 1/64 20060101AFI20170815BHUS", + "H04M 3/527 20060101ALI20170815BHUS", + "G10L 15/26 20060101ALI20170815BHUS", + "G10L 13/08 20130101ALI20170815BHUS", + "G10L 15/30 20130101ALI20170815BHUS" + ], + "cpc": [ + "H04M 3/527 20130101FI20170815BHUS", + "G10L 13/08 20130101LI20170815BHUS", + "G10L 15/26 20130101LI20170815BHUS", + "G10L 15/30 20130101LI20170815BHUS", + "H04M 2201/39 20130101LA20170815BHUS", + "H04M 2201/40 20130101LA20170815BHUS", + "H04M 2201/60 20130101LA20170815BHUS" + ], + "application_number": "15241555", + "current_rank": 8, + "grade": 2, + "notes": "Echtzeit-Transkription gesprochener Sprache ist zentral." + }, + { + "patent_id": "US12579986", + "title": "Systems and methods for distinguishing between human speech and machine generated speech", + "source": "USPTO", + "publication_year": "2026", + "match_score": 0.8285, + "ipc_score": 0.8808, + "topic_score": 1.0, + "text_score": 0.3333333333333333, + "topic_match_kind": "topic_id", + "matched_keywords": [ + "speech recognition" + ], + "matched_ipc_symbols": [ + "G10L17/14" + ], + "text_retrieval": false, + "ipc": [ + "G10L 17/14 20130101AFI20260317BHUS", + "G06F 40/30 20200101ALI20260317BHUS", + "G10L 15/26 20060101ALI20260317BHUS", + "G10L 17/00 20130101ALI20260317BHUS", + "G10L 17/02 20130101ALI20260317BHUS", + "G10L 17/22 20130101ALI20260317BHUS", + "G10L 17/26 20130101ALI20260317BHUS", + "H04M 3/51 20060101ALI20260317BHUS" + ], + "cpc": [ + "G10L 17/14 20130101FI20260317BHUS", + "G06F 40/30 20200101LI20260317BHUS", + "G10L 15/26 20130101LI20260317BHUS", + "G10L 17/00 20130101LI20260317BHUS", + "G10L 17/02 20130101LI20260317BHUS", + "G10L 17/22 20130101LI20260317BHUS", + "H04M 3/5166 20130101LI20260317BHUS" + ], + "application_number": "18602835", + "current_rank": 9, + "grade": 1, + "notes": "Klassifikation menschlicher und synthetischer Sprache ist fachlich angrenzend." + }, + { + "patent_id": "US10397400", + "title": "Electronic call assistant based on a caller-status and a callee-status", + "source": "USPTO", + "publication_year": "2019", + "match_score": 0.8285, + "ipc_score": 0.8808, + "topic_score": 1.0, + "text_score": 0.3333333333333333, + "topic_match_kind": "topic_id", + "matched_keywords": [ + "speech recognition" + ], + "matched_ipc_symbols": [ + "G10L17/14" + ], + "text_retrieval": false, + "ipc": [ + "H04M 3/493 20060101AFI20190827BHUS", + "G10L 17/14 20130101ALI20190827BHUS", + "A61B 5/00 20060101ALN20190827BHUS", + "G10L 15/26 20060101ALN20190827BHUS" + ], + "cpc": [ + "H04M 3/493 20130101FI20190827BHUS", + "G10L 17/14 20130101LI20190827BHUS", + "H04M 3/4936 20130101LI20190827BHUS", + "A61B 5/6802 20130101LA20190827BHUS", + "G10L 15/265 20130101LA20190827BHUS", + "H04M 2201/405 20130101LA20190827BHUS" + ], + "application_number": "15802695", + "current_rank": 10, + "grade": 0, + "notes": "Allgemeiner elektronischer Anrufassistent; Spracherkennung ist nicht zentral." + }, + { + "patent_id": "US09369577", + "title": "Transparent voice registration and verification method and system", + "source": "USPTO", + "publication_year": "2016", + "match_score": 0.8285, + "ipc_score": 0.8808, + "topic_score": 1.0, + "text_score": 0.3333333333333333, + "topic_match_kind": "topic_id", + "matched_keywords": [ + "speech recognition" + ], + "matched_ipc_symbols": [ + "G10L17/14" + ], + "text_retrieval": false, + "ipc": [ + "H04M 3/493 20060101AFI20160614BHUS", + "G10L 17/14 20130101ALI20160614BHUS", + "H04M 3/42 20060101ALI20160614BHUS", + "H04M 3/51 20060101ALI20160614BHUS", + "H04M 3/38 20060101ALI20160614BHUS", + "G10L 17/04 20130101ALN20160614BHUS" + ], + "cpc": [ + "H04M 3/4936 20130101FI20160614BHUS", + "G10L 17/14 20130101LI20160614BHUS", + "H04M 3/385 20130101LI20160614BHUS", + "H04M 3/42221 20130101LI20160614BHUS", + "H04M 3/51 20130101LI20160614BHUS", + "G10L 17/04 20130101LA20160614BHUS", + "H04M 2201/36 20130101LA20160614BHUS", + "H04M 2201/41 20130101LA20160614BHUS", + "H04M 2203/6045 20130101LA20160614BHUS" + ], + "application_number": "14526933", + "current_rank": 11, + "grade": 1, + "notes": "Stimmregistrierung und Sprecherverifikation sind fachlich angrenzend." + }, + { + "patent_id": "US12615335", + "title": "Voice fingerprinting system for detecting hoax emergency reports", + "source": "USPTO", + "publication_year": "2026", + "match_score": 0.8134, + "ipc_score": 0.8556, + "topic_score": 1.0, + "text_score": 0.3333333333333333, + "topic_match_kind": "topic_id", + "matched_keywords": [ + "speech recognition" + ], + "matched_ipc_symbols": [ + "H04M2201/405" + ], + "text_retrieval": false, + "ipc": [ + "G10L 15/00 20130101AFI20260428BHUS", + "G10L 17/02 20130101ALI20260428BHUS", + "G10L 17/04 20130101ALI20260428BHUS", + "G10L 17/06 20130101ALI20260428BHUS", + "G10L 17/18 20130101ALI20260428BHUS", + "G10L 25/18 20130101ALI20260428BHUS", + "G10L 25/24 20130101ALI20260428BHUS", + "H04M 3/22 20060101ALI20260428BHUS", + "H04M 3/51 20060101ALI20260428BHUS", + "G06Q 50/26 20120101ALN20260428BHUS" + ], + "cpc": [ + "H04M 3/5116 20130101FI20260428BHUS", + "G10L 17/02 20130101LI20260428BHUS", + "G10L 17/04 20130101LI20260428BHUS", + "G10L 17/06 20130101LI20260428BHUS", + "G10L 17/18 20130101LI20260428BHUS", + "G10L 25/18 20130101LI20260428BHUS", + "G10L 25/24 20130101LI20260428BHUS", + "H04M 3/2281 20130101LI20260428BHUS", + "H04M 3/5175 20130101LI20260428BHUS", + "H04M 3/5191 20130101LI20260428BHUS", + "G06Q 50/265 20130101LA20260428BHUS", + "H04M 2201/405 20130101LA20260428BHUS" + ], + "application_number": "18732780", + "current_rank": 12, + "grade": 1, + "notes": "Voice-Fingerprinting und Sprechererkennung sind fachlich angrenzend." + }, + { + "patent_id": "US12592239", + "title": "Active voice liveness detection system", + "source": "USPTO", + "publication_year": "2026", + "match_score": 0.8134, + "ipc_score": 0.8556, + "topic_score": 1.0, + "text_score": 0.3333333333333333, + "topic_match_kind": "topic_id", + "matched_keywords": [ + "speech recognition" + ], + "matched_ipc_symbols": [ + "H04M2201/405" + ], + "text_retrieval": false, + "ipc": [ + "G10L 17/26 20130101AFI20260331BHUS", + "G06F 21/32 20130101ALI20260331BHUS", + "G10L 15/02 20060101ALI20260331BHUS", + "G10L 17/00 20130101ALI20260331BHUS", + "G10L 17/02 20130101ALI20260331BHUS", + "G10L 17/04 20130101ALI20260331BHUS", + "G10L 17/08 20130101ALI20260331BHUS", + "G10L 17/18 20130101ALI20260331BHUS", + "G10L 25/30 20130101ALI20260331BHUS", + "G10L 25/51 20130101ALI20260331BHUS", + "G10L 25/60 20130101ALI20260331BHUS", + "H04M 3/22 20060101ALI20260331BHUS", + "H04M 3/42 20060101ALI20260331BHUS", + "H04M 3/51 20060101ALI20260331BHUS" + ], + "cpc": [ + "G10L 17/26 20130101FI20260331BHUS", + "G06F 21/32 20130101LI20260331BHUS", + "G10L 15/02 20130101LI20260331BHUS", + "G10L 17/00 20130101LI20260331BHUS", + "G10L 17/02 20130101LI20260331BHUS", + "G10L 17/04 20130101LI20260331BHUS", + "G10L 17/08 20130101LI20260331BHUS", + "G10L 17/18 20130101LI20260331BHUS", + "G10L 25/51 20130101LI20260331BHUS", + "G10L 25/60 20130101LI20260331BHUS", + "H04M 3/2281 20130101LI20260331BHUS", + "H04M 3/42221 20130101LI20260331BHUS", + "H04M 3/5175 20130101LI20260331BHUS", + "H04M 3/5183 20130101LI20260331BHUS", + "G10L 25/30 20130101LA20260331BHUS", + "H04M 2201/405 20130101LA20260331BHUS" + ], + "application_number": "18646310", + "current_rank": 13, + "grade": 1, + "notes": "Voice-Liveness-Erkennung ist biometrisch verwandt, aber keine klassische Spracherkennung." + }, + { + "patent_id": "US09571617", + "title": "Controlling mute function on telephone", + "source": "USPTO", + "publication_year": "2017", + "match_score": 0.8134, + "ipc_score": 0.8556, + "topic_score": 1.0, + "text_score": 0.3333333333333333, + "topic_match_kind": "topic_id", + "matched_keywords": [ + "speech recognition" + ], + "matched_ipc_symbols": [ + "H04M2201/405" + ], + "text_retrieval": false, + "ipc": [ + "H04M 3/00 20060101AFI20170214BHUS", + "H04M 1/19 20060101ALI20170214BHUS", + "H04M 1/247 20060101ALI20170214BHUS", + "G10L 15/22 20060101ALI20170214BHUS", + "G10L 17/04 20130101ALI20170214BHUS", + "G10L 17/06 20130101ALI20170214BHUS", + "G10L 25/84 20130101ALI20170214BHUS", + "H04M 1/60 20060101ALN20170214BHUS" + ], + "cpc": [ + "H04M 1/19 20130101FI20170214BHUS", + "G10L 15/22 20130101LI20170214BHUS", + "G10L 17/04 20130101LI20170214BHUS", + "G10L 17/06 20130101LI20170214BHUS", + "G10L 25/84 20130101LI20170214BHUS", + "H04M 1/247 20130101LI20170214BHUS", + "H04M 1/6033 20130101LI20170214BHUS", + "G10L 2015/223 20130101LA20170214BHUS", + "H04M 1/6008 20130101LA20170214BHUS", + "H04M 2201/405 20130101LA20170214BHUS", + "H04M 2203/258 20130101LA20170214BHUS", + "H04M 2250/74 20130101LA20170214BHUS" + ], + "application_number": "15168757", + "current_rank": 14, + "grade": 1, + "notes": "Sprachgesteuerte Stummschaltung; Spracherkennung ist eine relevante Teilfunktion." + }, + { + "patent_id": "US12482458", + "title": "Semiautomated relay method and apparatus", + "source": "USPTO", + "publication_year": "2025", + "match_score": 0.812, + "ipc_score": 0.77, + "topic_score": 1.0, + "text_score": 0.6666666666666666, + "topic_match_kind": "topic_id", + "matched_keywords": [ + "speech recognition" + ], + "matched_ipc_symbols": [ + "H04M2201/405" + ], + "text_retrieval": false, + "ipc": [ + "G10L 15/183 20130101AFI20251125BHUS", + "G10L 15/26 20060101ALI20251125BHUS", + "G10L 25/60 20130101ALI20251125BHUS", + "H04M 1/247 20210101ALI20251125BHUS", + "H04M 1/72433 20210101ALI20251125BHUS", + "H04M 1/72478 20210101ALI20251125BHUS", + "H04M 3/42 20060101ALI20251125BHUS" + ], + "cpc": [ + "G10L 15/183 20130101FI20251125BHUS", + "G10L 15/26 20130101LI20251125BHUS", + "G10L 25/60 20130101LI20251125BHUS", + "H04M 1/2475 20130101LI20251125BHUS", + "H04M 1/72433 20210101LI20251125BHUS", + "H04M 1/72478 20210101LI20251125BHUS", + "H04M 3/42391 20130101LI20251125BHUS", + "H04M 2201/40 20130101LA20251125BHUS", + "H04M 2201/60 20130101LA20251125BHUS" + ], + "application_number": "16422662", + "current_rank": 15, + "grade": 2, + "notes": "Spracherkennung und Transkription im Relay-System sind zentral." + }, + { + "patent_id": "US12132865", + "title": "Voice and speech recognition for call center feedback and quality assurance", + "source": "USPTO", + "publication_year": "2024", + "match_score": 0.812, + "ipc_score": 0.77, + "topic_score": 1.0, + "text_score": 0.6666666666666666, + "topic_match_kind": "topic_id", + "matched_keywords": [ + "speech recognition" + ], + "matched_ipc_symbols": [ + "H04M2201/405" + ], + "text_retrieval": false, + "ipc": [ + "H04M 3/51 20060101AFI20241029BHUS", + "G06F 40/205 20200101ALI20241029BHUS", + "G10L 17/04 20130101ALI20241029BHUS", + "G10L 17/08 20130101ALI20241029BHUS", + "G10L 25/51 20130101ALI20241029BHUS", + "G10L 25/63 20130101ALI20241029BHUS", + "G10L 25/87 20130101ALI20241029BHUS", + "H04M 3/42 20060101ALI20241029BHUS", + "G10L 15/26 20060101ALN20241029BHUS" + ], + "cpc": [ + "H04M 3/5175 20130101FI20241029BHUS", + "G06F 40/205 20200101LI20241029BHUS", + "G10L 17/04 20130101LI20241029BHUS", + "G10L 17/08 20130101LI20241029BHUS", + "G10L 25/51 20130101LI20241029BHUS", + "G10L 25/63 20130101LI20241029BHUS", + "H04M 3/42 20130101LI20241029BHUS", + "G10L 15/26 20130101LA20241029BHUS", + "G10L 25/87 20130101LA20241029BHUS", + "H04M 2201/40 20130101LA20241029BHUS", + "H04M 2201/41 20130101LA20241029BHUS", + "H04M 2203/40 20130101LA20241029BHUS", + "H04M 2203/401 20130101LA20241029BHUS" + ], + "application_number": "18376605", + "current_rank": 16, + "grade": 2, + "notes": "Sprach- und Sprecherkennung für Callcenter-Analyse sind zentral." + }, + { + "patent_id": "US12088761", + "title": "Voice and speech recognition for call center feedback and quality assurance", + "source": "USPTO", + "publication_year": "2024", + "match_score": 0.812, + "ipc_score": 0.77, + "topic_score": 1.0, + "text_score": 0.6666666666666666, + "topic_match_kind": "topic_id", + "matched_keywords": [ + "speech recognition" + ], + "matched_ipc_symbols": [ + "H04M2201/405" + ], + "text_retrieval": false, + "ipc": [ + "H04M 3/51 20060101AFI20240910BHUS", + "G06F 40/205 20200101ALI20240910BHUS", + "G10L 15/26 20060101ALI20240910BHUS", + "G10L 17/04 20130101ALI20240910BHUS", + "G10L 17/08 20130101ALI20240910BHUS", + "G10L 25/51 20130101ALI20240910BHUS", + "G10L 25/63 20130101ALI20240910BHUS", + "G10L 25/87 20130101ALI20240910BHUS", + "H04M 3/42 20060101ALI20240910BHUS" + ], + "cpc": [ + "H04M 3/5175 20130101FI20240910BHUS", + "G06F 40/205 20200101LI20240910BHUS", + "G10L 17/04 20130101LI20240910BHUS", + "G10L 17/08 20130101LI20240910BHUS", + "G10L 25/51 20130101LI20240910BHUS", + "G10L 25/63 20130101LI20240910BHUS", + "H04M 3/42 20130101LI20240910BHUS", + "G10L 15/26 20130101LA20240910BHUS", + "G10L 25/87 20130101LA20240910BHUS", + "H04M 2201/40 20130101LA20240910BHUS", + "H04M 2201/41 20130101LA20240910BHUS", + "H04M 2203/40 20130101LA20240910BHUS", + "H04M 2203/401 20130101LA20240910BHUS" + ], + "application_number": "18203094", + "current_rank": 17, + "grade": 2, + "notes": "Sprach- und Sprecherkennung für Callcenter-Analyse sind zentral." + }, + { + "patent_id": "US11811970", + "title": "Voice and speech recognition for call center feedback and quality assurance", + "source": "USPTO", + "publication_year": "2023", + "match_score": 0.812, + "ipc_score": 0.77, + "topic_score": 1.0, + "text_score": 0.6666666666666666, + "topic_match_kind": "topic_id", + "matched_keywords": [ + "speech recognition" + ], + "matched_ipc_symbols": [ + "H04M2201/405" + ], + "text_retrieval": false, + "ipc": [ + "H04M 3/51 20060101AFI20231107BHUS", + "G10L 17/04 20130101ALI20231107BHUS", + "G10L 25/51 20130101ALI20231107BHUS", + "G10L 25/63 20130101ALI20231107BHUS", + "G10L 25/87 20130101ALI20231107BHUS", + "H04M 3/42 20060101ALI20231107BHUS", + "G06F 40/205 20200101ALI20231107BHUS", + "G10L 17/08 20130101ALI20231107BHUS", + "G10L 15/26 20060101ALN20231107BHUS" + ], + "cpc": [ + "H04M 3/5175 20130101FI20231107BHUS", + "G06F 40/205 20200101LI20231107BHUS", + "G10L 17/04 20130101LI20231107BHUS", + "G10L 17/08 20130101LI20231107BHUS", + "G10L 25/51 20130101LI20231107BHUS", + "G10L 25/63 20130101LI20231107BHUS", + "H04M 3/42 20130101LI20231107BHUS", + "G10L 15/26 20130101LA20231107BHUS", + "G10L 25/87 20130101LA20231107BHUS", + "H04M 2201/40 20130101LA20231107BHUS", + "H04M 2201/41 20130101LA20231107BHUS", + "H04M 2203/40 20130101LA20231107BHUS", + "H04M 2203/401 20130101LA20231107BHUS" + ], + "application_number": "17690099", + "current_rank": 18, + "grade": 2, + "notes": "Sprach- und Sprecherkennung für Callcenter-Analyse sind zentral." + }, + { + "patent_id": "US11706338", + "title": "Voice and speech recognition for call center feedback and quality assurance", + "source": "USPTO", + "publication_year": "2023", + "match_score": 0.812, + "ipc_score": 0.77, + "topic_score": 1.0, + "text_score": 0.6666666666666666, + "topic_match_kind": "topic_id", + "matched_keywords": [ + "speech recognition" + ], + "matched_ipc_symbols": [ + "H04M2201/405" + ], + "text_retrieval": false, + "ipc": [ + "H04M 3/51 20060101AFI20230718BHUS", + "G10L 17/04 20130101ALI20230718BHUS", + "G10L 25/51 20130101ALI20230718BHUS", + "G10L 25/63 20130101ALI20230718BHUS", + "G10L 25/87 20130101ALI20230718BHUS", + "H04M 3/42 20060101ALI20230718BHUS", + "G06F 40/205 20200101ALI20230718BHUS", + "G10L 17/08 20130101ALI20230718BHUS", + "G10L 15/26 20060101ALN20230718BHUS" + ], + "cpc": [ + "H04M 3/5175 20130101FI20230718BHUS", + "G06F 40/205 20200101LI20230718BHUS", + "G10L 17/04 20130101LI20230718BHUS", + "G10L 17/08 20130101LI20230718BHUS", + "G10L 25/51 20130101LI20230718BHUS", + "G10L 25/63 20130101LI20230718BHUS", + "H04M 3/42 20130101LI20230718BHUS", + "G10L 15/26 20130101LA20230718BHUS", + "G10L 25/87 20130101LA20230718BHUS", + "H04M 2201/40 20130101LA20230718BHUS", + "H04M 2201/41 20130101LA20230718BHUS", + "H04M 2203/40 20130101LA20230718BHUS", + "H04M 2203/401 20130101LA20230718BHUS" + ], + "application_number": "17472557", + "current_rank": 19, + "grade": 2, + "notes": "Sprach- und Sprecherkennung für Callcenter-Analyse sind zentral." + }, + { + "patent_id": "US10863033", + "title": "Voice recognition system and voice recognition method", + "source": "USPTO", + "publication_year": "2020", + "match_score": 0.812, + "ipc_score": 0.77, + "topic_score": 1.0, + "text_score": 0.6666666666666666, + "topic_match_kind": "topic_id", + "matched_keywords": [ + "speech recognition" + ], + "matched_ipc_symbols": [ + "H04M2201/405" + ], + "text_retrieval": false, + "ipc": [ + "H04M 11/00 20060101AFI20201208BHUS", + "H04M 3/58 20060101ALI20201208BHUS", + "H04M 3/493 20060101ALI20201208BHUS", + "G10L 17/22 20130101ALI20201208BHUS", + "H04M 3/42 20060101ALI20201208BHUS", + "G10L 15/22 20060101ALI20201208BHUS" + ], + "cpc": [ + "H04M 3/58 20130101FI20201208BHUS", + "G10L 15/22 20130101LI20201208BHUS", + "G10L 17/22 20130101LI20201208BHUS", + "H04M 3/42221 20130101LI20201208BHUS", + "H04M 3/4931 20130101LI20201208BHUS", + "H04M 3/4936 20130101LI20201208BHUS", + "G10L 2015/223 20130101LA20201208BHUS", + "H04M 3/4933 20130101LA20201208BHUS", + "H04M 2201/18 20130101LA20201208BHUS", + "H04M 2201/39 20130101LA20201208BHUS", + "H04M 2201/40 20130101LA20201208BHUS" + ], + "application_number": "16432362", + "current_rank": 20, + "grade": 2, + "notes": "Sprach- und Stimmerkennung sind zentraler Gegenstand." + } + ] + } + ] +} \ No newline at end of file diff --git a/service/scripts/patents/evaluate_keyword_patent_search.py b/service/scripts/patents/evaluate_keyword_patent_search.py new file mode 100644 index 00000000..550876db --- /dev/null +++ b/service/scripts/patents/evaluate_keyword_patent_search.py @@ -0,0 +1,1147 @@ +#!/usr/bin/env python3 +""" +evaluate_keyword_patent_search.py — Systematic evaluation for keyword → patent search. + +Modes: + bootstrap Run live search for each gold case and write labeling candidates. + eval Score ranked results against gold labels (+ IPC proxy metrics). + ablation Re-score labeled rankings under alternate IPC/topic/text weights. + +Usage (from service/): + python scripts/patents/evaluate_keyword_patent_search.py bootstrap + python scripts/patents/evaluate_keyword_patent_search.py eval + python scripts/patents/evaluate_keyword_patent_search.py ablation + +Requires PATENT_ELASTICSEARCH credentials in src/main/inse/.env for live search. +After bootstrap, fill relevant_patent_ids / relevance_grades in the gold set +(or in the generated labeling JSON) and re-run eval. +""" +from __future__ import annotations + +import argparse +import asyncio +import json +import logging +import sys +from datetime import datetime, timezone +from pathlib import Path +from typing import Any + +current_dir = Path(__file__).resolve().parent +sys.path.insert(0, str(current_dir.parent.parent / "src" / "main")) + +from inse.patents.keywords.eval_metrics import ( # noqa: E402 + analyze_family_duplicates_in_top_k, + average_precision, + ipc_prefix_hit_rate, + mean, + mrr, + ndcg_at_k, + normalize_patent_id, + patent_family_key, + precision_at_k, + recall_at_k, + unique_family_precision_at_k, +) +from inse.patents.keywords.logic import ( # noqa: E402 + _DEFAULT_SCORE_WEIGHTS, + _MAX_PATENTS, + _compute_final_score, + get_patents_by_keywords, +) +from inse.patents.keywords.model import ( # noqa: E402 + KeywordPatentMatch, + KeywordPatentSearchDiagnostics, + KeywordPatentSearchItem, + PatentsByKeywordsRequest, +) + +logger = logging.getLogger(__name__) + +DEFAULT_GOLDSET = current_dir / "data" / "keyword_patent_goldset_presentation.json" +DEFAULT_OUT_DIR = current_dir / "data" / "eval_runs" +LITHIUM_CASE_PREFIX = "lithium-ion-batteries" +IPC_FOCUS_CASES = {"materials-chemistry"} | { + f"{LITHIUM_CASE_PREFIX}-de", + f"{LITHIUM_CASE_PREFIX}-en", + f"{LITHIUM_CASE_PREFIX}-de-en", +} + + +def _is_lithium_case(case_id: str) -> bool: + return case_id.startswith(LITHIUM_CASE_PREFIX) + + +def _family_key_from_match(match: KeywordPatentMatch) -> str: + return patent_family_key( + patent_id=match.patent.patent_id, + application_number=match.patent.application_number, + title=match.patent.title, + ) + + +def _family_metrics( + matches: list[KeywordPatentMatch], + ks: list[int], + grades: dict[str, float] | None = None, +) -> dict[str, Any]: + ranked_ids = [match.patent.patent_id for match in matches] + family_keys = [_family_key_from_match(match) for match in matches] + duplicates = { + f"@{k}": analyze_family_duplicates_in_top_k(family_keys, k) for k in ks + } + payload: dict[str, Any] = {"family_duplicates": duplicates} + if grades: + relevant_ids = list(grades.keys()) + payload["unique_family_precision"] = { + f"@{k}": round( + unique_family_precision_at_k(ranked_ids, family_keys, relevant_ids, k), + 4, + ) + for k in ks + } + return payload + + +def _load_json(path: Path) -> dict[str, Any]: + with path.open(encoding="utf-8") as handle: + return json.load(handle) + + +def _write_json(path: Path, payload: Any) -> None: + path.parent.mkdir(parents=True, exist_ok=True) + with path.open("w", encoding="utf-8") as handle: + json.dump(payload, handle, indent=2, ensure_ascii=False) + handle.write("\n") + + +def _keyword_items(case: dict[str, Any]) -> list[KeywordPatentSearchItem]: + return [KeywordPatentSearchItem.model_validate(item) for item in case["keywords"]] + + +def _patent_codes(match: KeywordPatentMatch) -> list[str]: + return [*match.patent.ipc, *match.patent.cpc] + + +def _match_to_dict(match: KeywordPatentMatch) -> dict[str, Any]: + payload: dict[str, Any] = { + "patent_id": match.patent.patent_id, + "title": match.patent.title, + "source": match.patent.source, + "publication_year": match.patent.publication_year, + "match_score": match.match_score, + "ipc_score": match.ipc_score, + "topic_score": match.topic_score, + "text_score": match.text_score, + "topic_match_kind": match.topic_match_kind, + "matched_keywords": match.matched_keywords, + "matched_ipc_symbols": match.matched_ipc_symbols, + "text_retrieval": match.text_retrieval, + "ipc": match.patent.ipc, + "cpc": match.patent.cpc, + "application_number": match.patent.application_number, + } + if match.keyword_evidence is not None: + payload["keyword_evidence"] = match.keyword_evidence.model_dump() + return payload + + +def _relevance_for_case(case: dict[str, Any]) -> dict[str, float]: + grades: dict[str, float] = {} + for patent_id, grade in (case.get("relevance_grades") or {}).items(): + grades[normalize_patent_id(patent_id)] = float(grade) + for patent_id in case.get("relevant_patent_ids") or []: + grades.setdefault(normalize_patent_id(patent_id), 1.0) + return {pid: grade for pid, grade in grades.items() if grade > 0} + + +def _proxy_metrics( + matches: list[KeywordPatentMatch], + case: dict[str, Any], + ks: list[int], + *, + mapping_status: str | None = None, +) -> dict[str, Any]: + ipc_lists = [_patent_codes(match) for match in matches] + prefixes = case.get("expected_ipc_prefixes") or [] + topic_rates = [] + text_rates = [] + for k in ks: + top = matches[:k] + if not top: + topic_rates.append(0.0) + text_rates.append(0.0) + continue + topic_rates.append(sum(1 for m in top if m.topic_score > 0) / len(top)) + text_rates.append(sum(1 for m in top if m.text_score > 0) / len(top)) + + text_path = mapping_status in {"uncertain", "no_mapping"} or any( + m.text_retrieval for m in matches[:10] + ) + ipc_hit = { + f"@{k}": round(ipc_prefix_hit_rate(ipc_lists, prefixes, k=k), 4) for k in ks + } + payload: dict[str, Any] = { + "retrieved": len(matches), + "ipc_prefix_hit_rate": ipc_hit, + "topic_score_rate": {f"@{k}": round(rate, 4) for k, rate in zip(ks, topic_rates)}, + "text_score_rate": {f"@{k}": round(rate, 4) for k, rate in zip(ks, text_rates)}, + "mean_match_score_at_10": round( + mean([m.match_score for m in matches[:10]]), + 4, + ), + "family_metrics": _family_metrics(matches, ks), + } + watch_prefixes = case.get("ipc_cluster_watch_prefixes") or [] + if watch_prefixes: + payload["ipc_cluster_watch_hit_rate"] = { + f"@{k}": round(ipc_prefix_hit_rate(ipc_lists, watch_prefixes, k=k), 4) + for k in ks + } + payload["ipc_cluster_watch_prefixes"] = list(watch_prefixes) + payload["ipc_cluster_watch_note"] = ( + "Separate analysis for notable mapping cluster; " + "not counted toward expected_ipc_prefixes battery proxy." + ) + if prefixes: + payload["expected_ipc_prefixes"] = list(prefixes) + if text_path: + payload["ipc_prefix_hit_rate_role"] = "post_hoc_plausibility_only" + payload["ipc_prefix_hit_rate_note"] = ( + "ipc_hit@k is a post-hoc plausibility check on patent classifications " + "after keyword text retrieval; IPC was not used to retrieve these results." + ) + else: + payload["ipc_prefix_hit_rate_role"] = "retrieval_aligned" + return payload + + +def _label_metrics( + ranked_ids: list[str], + grades: dict[str, float], + ks: list[int], +) -> dict[str, Any] | None: + if not grades: + return None + relevant_ids = list(grades.keys()) + family_keys = [ + patent_family_key(patent_id=pid, application_number=None, title=None) + for pid in ranked_ids + ] + return { + "labeled_relevant": len(relevant_ids), + "precision": {f"@{k}": round(precision_at_k(ranked_ids, relevant_ids, k), 4) for k in ks}, + "unique_family_precision": { + f"@{k}": round( + unique_family_precision_at_k(ranked_ids, family_keys, relevant_ids, k), + 4, + ) + for k in ks + }, + "recall": {f"@{k}": round(recall_at_k(ranked_ids, relevant_ids, k), 4) for k in ks}, + "ndcg": {f"@{k}": round(ndcg_at_k(ranked_ids, grades, k), 4) for k in ks}, + "map": round(average_precision(ranked_ids, relevant_ids), 4), + "mrr": round(mrr(ranked_ids, relevant_ids), 4), + } + + +def _label_metrics_for_matches( + matches: list[KeywordPatentMatch], + grades: dict[str, float], + ks: list[int], +) -> dict[str, Any] | None: + if not grades: + return None + ranked_ids = [match.patent.patent_id for match in matches] + family_keys = [_family_key_from_match(match) for match in matches] + relevant_ids = list(grades.keys()) + return { + "labeled_relevant": len(relevant_ids), + "precision": { + f"@{k}": round(precision_at_k(ranked_ids, relevant_ids, k), 4) for k in ks + }, + "unique_family_precision": { + f"@{k}": round( + unique_family_precision_at_k(ranked_ids, family_keys, relevant_ids, k), + 4, + ) + for k in ks + }, + "recall": {f"@{k}": round(recall_at_k(ranked_ids, relevant_ids, k), 4) for k in ks}, + "ndcg": {f"@{k}": round(ndcg_at_k(ranked_ids, grades, k), 4) for k in ks}, + "map": round(average_precision(ranked_ids, relevant_ids), 4), + "mrr": round(mrr(ranked_ids, relevant_ids), 4), + } + + +def _split_label_metrics( + matches: list[KeywordPatentMatch], + grades: dict[str, float], + ks: list[int], +) -> dict[str, Any]: + ipc_matches = [m for m in matches if not m.text_retrieval] + text_matches = [m for m in matches if m.text_retrieval] + return { + "overall": _label_metrics_for_matches(matches, grades, ks), + "ipc_path": { + "retrieved": len(ipc_matches), + "metrics": _label_metrics_for_matches(ipc_matches, grades, ks), + }, + "text_path": { + "retrieved": len(text_matches), + "metrics": _label_metrics_for_matches(text_matches, grades, ks), + }, + } + + +def _diagnostics_dict( + diagnostics: KeywordPatentSearchDiagnostics | None, +) -> dict[str, Any] | None: + if diagnostics is None: + return None + return diagnostics.model_dump() + + +def _aggregate(case_reports: list[dict[str, Any]], ks: list[int]) -> dict[str, Any]: + labeled = [report for report in case_reports if report.get("label_metrics")] + proxy_only = case_reports + + def avg_nested(key: str, metric: str) -> dict[str, float]: + out: dict[str, float] = {} + for k in ks: + values = [ + report[key][metric][f"@{k}"] + for report in (labeled if key == "label_metrics" else proxy_only) + if report.get(key) and f"@{k}" in report[key].get(metric, {}) + ] + out[f"@{k}"] = round(mean(values), 4) + return out + + def avg_path_metric(path_key: str, metric: str) -> dict[str, float]: + out: dict[str, float] = {} + for k in ks: + values = [] + for report in case_reports: + path = (report.get("label_metrics_split") or {}).get(path_key) or {} + metrics = path.get("metrics") or {} + if metrics and f"@{k}" in metrics.get(metric, {}): + values.append(metrics[metric][f"@{k}"]) + out[f"@{k}"] = round(mean(values), 4) if values else 0.0 + return out + + summary: dict[str, Any] = { + "cases_total": len(case_reports), + "cases_labeled": len(labeled), + "proxy": { + "ipc_prefix_hit_rate": avg_nested("proxy_metrics", "ipc_prefix_hit_rate"), + "topic_score_rate": avg_nested("proxy_metrics", "topic_score_rate"), + "text_score_rate": avg_nested("proxy_metrics", "text_score_rate"), + }, + } + if labeled: + summary["labels"] = { + "precision": avg_nested("label_metrics", "precision"), + "recall": avg_nested("label_metrics", "recall"), + "ndcg": avg_nested("label_metrics", "ndcg"), + "map": round(mean([r["label_metrics"]["map"] for r in labeled]), 4), + "mrr": round(mean([r["label_metrics"]["mrr"] for r in labeled]), 4), + "by_path": { + "ipc_path": { + "precision": avg_path_metric("ipc_path", "precision"), + "recall": avg_path_metric("ipc_path", "recall"), + "ndcg": avg_path_metric("ipc_path", "ndcg"), + }, + "text_path": { + "precision": avg_path_metric("text_path", "precision"), + "recall": avg_path_metric("text_path", "recall"), + "ndcg": avg_path_metric("text_path", "ndcg"), + }, + }, + } + return summary + + +def _ipc_clusters_for_report(diagnostics: dict[str, Any] | None) -> list[dict[str, Any]]: + return [ + { + "topic_key": selection.get("topic_key"), + "subclass": selection.get("subclass"), + "symbol": selection.get("symbol"), + "relative_mass": selection.get("relative_mass"), + } + for selection in (diagnostics or {}).get("ipc_cluster_selections") or [] + ] + + +def _top10_for_presentation(matches: list[KeywordPatentMatch]) -> list[dict[str, Any]]: + rows: list[dict[str, Any]] = [] + for match in matches[:10]: + rows.append( + { + "patent_id": match.patent.patent_id, + "title": match.patent.title, + "match_score": round(match.match_score, 4), + "ipc_score": round(match.ipc_score, 4), + "matched_ipc_symbols": list(match.matched_ipc_symbols), + } + ) + return rows + + +def _presentation_case_report( + case: dict[str, Any], + matches: list[KeywordPatentMatch], + mapping_status: str, + diagnostics: KeywordPatentSearchDiagnostics | None, + grades: dict[str, float], + ks: list[int], +) -> dict[str, Any]: + labels = _label_metrics_for_matches(matches, grades, ks) + proxy = _proxy_metrics( + matches, + case, + ks, + mapping_status=mapping_status, + ) + diagnostics_payload = _diagnostics_dict(diagnostics) + report: dict[str, Any] = { + "case_id": case["id"], + "mapping_status": mapping_status, + "search_path": (diagnostics_payload or {}).get("search_path"), + "ipc_cluster_selections": _ipc_clusters_for_report(diagnostics_payload), + "ipc_hit": proxy.get("ipc_prefix_hit_rate", {}), + "top_10": _top10_for_presentation(matches), + } + if labels: + report["precision"] = labels["precision"] + report["recall"] = labels["recall"] + report["ndcg"] = labels["ndcg"] + report["map"] = labels["map"] + report["mrr"] = labels["mrr"] + return report + + +def _presentation_aggregate( + case_reports: list[dict[str, Any]], + ks: list[int], +) -> dict[str, Any]: + labeled = [report for report in case_reports if report.get("precision")] + + def avg_at_k(metric: str) -> dict[str, float | None]: + out: dict[str, float | None] = {} + for k in ks: + values = [ + report[metric][f"@{k}"] + for report in labeled + if report.get(metric) and f"@{k}" in report[metric] + ] + out[f"@{k}"] = round(mean(values), 4) if values else None + return out + + def avg_scalar(metric: str) -> float | None: + values = [report[metric] for report in labeled if report.get(metric) is not None] + return round(mean(values), 4) if values else None + + ipc_values: dict[str, list[float]] = {f"@{k}": [] for k in ks} + for report in case_reports: + ipc_hit = report.get("ipc_hit") or {} + for k in ks: + key = f"@{k}" + if key in ipc_hit: + ipc_values[key].append(float(ipc_hit[key])) + + return { + "cases_total": len(case_reports), + "cases_labeled": len(labeled), + "precision": avg_at_k("precision"), + "recall": avg_at_k("recall"), + "ndcg": avg_at_k("ndcg"), + "map": avg_scalar("map"), + "mrr": avg_scalar("mrr"), + "ipc_hit": { + key: round(mean(values), 4) if values else None + for key, values in ipc_values.items() + }, + } + + +def _print_presentation_case(report: dict[str, Any], ks: list[int]) -> None: + print(f"\n=== {report['case_id']} ===") + print(f" mapping_status: {report.get('mapping_status')}") + print(f" search_path: {report.get('search_path')}") + print(" ipc_cluster_selections:") + for selection in report.get("ipc_cluster_selections") or []: + print( + " " + f"{selection.get('subclass')} {selection.get('symbol')} " + f"relative_mass={selection.get('relative_mass')}" + ) + ipc_hit = report.get("ipc_hit") or {} + print( + " ipc_hit: " + + " ".join(f"@{k}={ipc_hit.get(f'@{k}')}" for k in ks) + ) + if report.get("precision"): + print( + " precision: " + + " ".join(f"@{k}={report['precision'].get(f'@{k}')}" for k in ks) + ) + print( + " recall: " + + " ".join(f"@{k}={report['recall'].get(f'@{k}')}" for k in ks) + ) + print( + " ndcg: " + + " ".join(f"@{k}={report['ndcg'].get(f'@{k}')}" for k in ks) + ) + print(f" MAP: {report.get('map')} MRR: {report.get('mrr')}") + else: + print(" (no relevance labels — IPC proxy and top_10 only)") + print(" top_10:") + for rank, row in enumerate(report.get("top_10") or [], start=1): + symbols = ", ".join(row.get("matched_ipc_symbols") or []) or "(none)" + print( + f" {rank:2}. {row.get('patent_id')} " + f"match={row.get('match_score')} ipc={row.get('ipc_score')} " + f"symbols={symbols}" + ) + print(f" {row.get('title')}") + + +async def _run_case( + case: dict[str, Any], +) -> tuple[list[KeywordPatentMatch], str, KeywordPatentSearchDiagnostics | None]: + request = PatentsByKeywordsRequest(keywords=_keyword_items(case)) + response = await get_patents_by_keywords(request) + return list(response.patents), response.mapping_status, response.diagnostics + + +def _print_diagnostics(diagnostics: dict[str, Any] | None) -> None: + if not diagnostics: + print(" diagnostics: (none)") + return + print( + " diagnostics: " + f"path={diagnostics.get('search_path')} " + f"raw={diagnostics.get('raw_patents_after_dedupe')} " + f"passed_gate={diagnostics.get('passed_relevance_gate')} " + f"scored_before_cap={diagnostics.get('scored_before_cap')} " + f"returned={diagnostics.get('returned')} " + f"cap={diagnostics.get('max_patents_cap')} " + f"hit_cap={diagnostics.get('hit_return_cap')} " + f"es_size/index={diagnostics.get('es_query_size_per_index')}" + ) + print( + " filter_counts: " + f"ipc={diagnostics.get('filtered_by_ipc')} " + f"gate={diagnostics.get('filtered_by_relevance_gate')} " + f"min_score={diagnostics.get('filtered_by_min_score')}" + ) + + +def _print_ipc_clusters(case_id: str, diagnostics: dict[str, Any] | None) -> None: + if case_id not in IPC_FOCUS_CASES: + return + selections = (diagnostics or {}).get("ipc_cluster_selections") or [] + print(f" ipc_cluster_selections ({case_id}):") + if not selections: + print(" (none)") + return + for selection in selections: + print( + " " + f"topic={selection.get('topic_key')} " + f"subclass={selection.get('subclass')} " + f"symbol={selection.get('symbol')} " + f"level={selection.get('level')} " + f"relative_mass={selection.get('relative_mass')} " + f"cluster_mass={selection.get('cluster_mass')} " + f"reason={selection.get('reason')}" + ) + + +def _print_label_split(split: dict[str, Any] | None) -> None: + if not split: + return + for path_key, label in ( + ("ipc_path", "IPC-path labels"), + ("text_path", "Text-path labels"), + ): + path = split.get(path_key) or {} + metrics = path.get("metrics") + retrieved = path.get("retrieved", 0) + if retrieved == 0: + print(f" {label}: retrieved=0 (path unused for this case)") + continue + if not metrics: + print(f" {label}: retrieved={retrieved} (no labels overlapping this path)") + continue + print( + f" {label}: retrieved={retrieved} " + f"P@10={metrics['precision'].get('@10')} " + f"nDCG@10={metrics['ndcg'].get('@10')} " + f"MAP={metrics['map']} MRR={metrics['mrr']}" + ) + + +def _print_family_duplicates(proxy: dict[str, Any], ks: list[int]) -> None: + family = (proxy.get("family_metrics") or {}).get("family_duplicates") or {} + if not family: + return + print(" family_duplicates:") + for k in ks: + stats = family.get(f"@{k}") or {} + print( + f" @{k}: unique={stats.get('unique_families')} " + f"dup_entries={stats.get('duplicate_entries')} " + f"groups={len(stats.get('duplicate_groups') or [])}" + ) + for group in (stats.get("duplicate_groups") or [])[:3]: + print( + f" {group.get('family_key')} " + f"(count={group.get('count')})" + ) + + +def _print_top_candidates(top_results: list[dict[str, Any]], limit: int = 20) -> None: + print(f" top_{limit}_candidates:") + for rank, item in enumerate(top_results[:limit], start=1): + ipc = item.get("ipc") or [] + cpc = item.get("cpc") or [] + codes = ", ".join([*(ipc[:2]), *(cpc[:1])]) or "(none)" + print( + f" {rank:2}. {item.get('patent_id')} " + f"score={item.get('match_score')} " + f"text={item.get('text_retrieval')} " + f"ipc={codes}" + ) + + +def _print_lithium_case_detail(case_id: str, report: dict[str, Any], ks: list[int]) -> None: + if not _is_lithium_case(case_id): + return + proxy = report["proxy_metrics"] + diagnostics = report.get("diagnostics") or {} + print(f" search_path: {diagnostics.get('search_path')}") + print(f" passed_relevance_gate: {diagnostics.get('passed_relevance_gate')}") + prefixes = proxy.get("expected_ipc_prefixes") or ["H01M"] + print(f" battery_proxy_ipc ({', '.join(prefixes)}):") + for k in ks: + print(f" ipc_hit@{k}: {proxy['ipc_prefix_hit_rate'].get(f'@{k}')}") + watch = proxy.get("ipc_cluster_watch_hit_rate") + if watch: + watch_prefixes = proxy.get("ipc_cluster_watch_prefixes") or ["H01J"] + print(f" mapping_cluster_watch ({', '.join(watch_prefixes)}, not battery proxy):") + for k in ks: + print(f" cluster_hit@{k}: {watch.get(f'@{k}')}") + _print_ipc_clusters(case_id, diagnostics) + _print_family_duplicates(proxy, ks) + _print_top_candidates(report.get("top_results") or [], limit=20) + + +def _print_case_summary(case_id: str, report: dict[str, Any], ks: list[int] | None = None) -> None: + proxy = report["proxy_metrics"] + case_ks = ks or [5, 10, 20] + print(f"\n=== {case_id} ===") + print(f" mapping_status: {report.get('mapping_status')}") + print(f" retrieved: {proxy['retrieved']}") + ipc_role = proxy.get("ipc_prefix_hit_rate_role", "retrieval_aligned") + ipc_label = "ipc_hit@10" + if ipc_role == "post_hoc_plausibility_only": + ipc_label = "ipc_hit@10 (post-hoc plausibility only)" + print(f" {ipc_label}: {proxy['ipc_prefix_hit_rate'].get('@10')}") + print(f" topic_rate@10: {proxy['topic_score_rate'].get('@10')}") + print(f" text_rate@10: {proxy['text_score_rate'].get('@10')}") + _print_diagnostics(report.get("diagnostics")) + if _is_lithium_case(case_id): + _print_lithium_case_detail(case_id, report, case_ks) + else: + _print_ipc_clusters(case_id, report.get("diagnostics")) + _print_family_duplicates(proxy, case_ks) + labels = report.get("label_metrics") + if labels: + print(f" P@10 (overall): {labels['precision'].get('@10')}") + print(f" nDCG@10 (overall): {labels['ndcg'].get('@10')}") + print(f" MAP: {labels['map']} MRR: {labels['mrr']}") + else: + print(" (no relevance labels yet — proxy metrics only)") + _print_label_split(report.get("label_metrics_split")) + + +def _prior_labeling_paths(out_dir: Path) -> list[Path]: + return sorted(out_dir.glob("labeling_*.json")) + + +def _seed_grades_from_gold(case: dict[str, Any]) -> dict[str, dict[str, Any]]: + """patent_id -> {grade, notes} from goldset labels.""" + seeded: dict[str, dict[str, Any]] = {} + for patent_id, grade in (case.get("relevance_grades") or {}).items(): + seeded[normalize_patent_id(patent_id)] = { + "grade": float(grade), + "notes": "from goldset relevance_grades", + } + for patent_id in case.get("relevant_patent_ids") or []: + key = normalize_patent_id(patent_id) + seeded.setdefault( + key, + {"grade": 1.0, "notes": "from goldset relevant_patent_ids"}, + ) + for patent_id in case.get("irrelevant_patent_ids") or []: + key = normalize_patent_id(patent_id) + seeded.setdefault( + key, + {"grade": 0.0, "notes": "from goldset irrelevant_patent_ids"}, + ) + return seeded + + +def _load_prior_candidate_grades( + out_dir: Path, +) -> dict[str, dict[str, dict[str, Any]]]: + """case_id -> patent_id -> candidate payload (latest non-null grade wins).""" + by_case: dict[str, dict[str, dict[str, Any]]] = {} + for path in _prior_labeling_paths(out_dir): + try: + payload = _load_json(path) + except (OSError, json.JSONDecodeError) as exc: + logger.warning("Skipping prior labeling file %s: %s", path, exc) + continue + for case in payload.get("cases") or []: + case_id = case.get("id") + if not case_id: + continue + bucket = by_case.setdefault(case_id, {}) + for candidate in case.get("candidates") or []: + patent_id = normalize_patent_id(candidate.get("patent_id") or "") + if not patent_id: + continue + existing = bucket.get(patent_id) + grade = candidate.get("grade") + # Prefer entries that already have a grade; otherwise keep newest metadata. + if existing is None: + bucket[patent_id] = dict(candidate) + continue + if existing.get("grade") is None and grade is not None: + bucket[patent_id] = dict(candidate) + elif existing.get("grade") is None: + bucket[patent_id] = dict(candidate) + return by_case + + +def _merge_candidates( + *, + case: dict[str, Any], + new_ranked: list[dict[str, Any]], + prior_by_case: dict[str, dict[str, dict[str, Any]]], +) -> list[dict[str, Any]]: + """Merge new Top-N with prior pool and goldset grades for joint labeling.""" + case_id = case["id"] + prior = dict(prior_by_case.get(case_id) or {}) + gold_grades = _seed_grades_from_gold(case) + + merged: dict[str, dict[str, Any]] = {} + + # Start with prior pool (old hits stay available for labeling). + for patent_id, candidate in prior.items(): + item = dict(candidate) + item["patent_id"] = patent_id + item.setdefault("grade", None) + item.setdefault("notes", "") + item["in_prior_pool"] = True + item["in_current_top"] = False + merged[patent_id] = item + + # Overlay / add current bootstrap ranking. + for rank, item in enumerate(new_ranked, start=1): + patent_id = normalize_patent_id(item["patent_id"]) + base = dict(merged.get(patent_id) or {}) + previous_grade = base.get("grade") + previous_notes = base.get("notes") or "" + updated = { + **item, + "patent_id": patent_id, + "grade": previous_grade, + "notes": previous_notes, + "in_prior_pool": patent_id in prior, + "in_current_top": True, + "current_rank": rank, + } + merged[patent_id] = updated + + # Seed grades from goldset when still unlabeled. + for patent_id, seed in gold_grades.items(): + if patent_id in merged: + if merged[patent_id].get("grade") is None: + merged[patent_id]["grade"] = seed["grade"] + if not merged[patent_id].get("notes"): + merged[patent_id]["notes"] = seed["notes"] + continue + # Gold label for a patent not in current/prior retrieval — keep for metrics. + merged[patent_id] = { + "patent_id": patent_id, + "title": None, + "source": None, + "match_score": None, + "text_retrieval": None, + "grade": seed["grade"], + "notes": seed["notes"], + "in_prior_pool": False, + "in_current_top": False, + "from_goldset_only": True, + } + + def sort_key(candidate: dict[str, Any]) -> tuple: + current_rank = candidate.get("current_rank") + score = candidate.get("match_score") + return ( + 0 if candidate.get("in_current_top") else 1, + current_rank if isinstance(current_rank, int) else 10**9, + -(score if isinstance(score, (int, float)) else -1.0), + candidate.get("patent_id") or "", + ) + + return sorted(merged.values(), key=sort_key) + + +async def cmd_bootstrap(args: argparse.Namespace) -> int: + gold = _load_json(args.goldset) + ks = list(args.k or gold.get("ks") or [5, 10, 20]) + cases = gold["cases"] + if args.case: + cases = [case for case in cases if case["id"] == args.case] + if not cases: + logger.error("Unknown case id: %s", args.case) + return 1 + + out_dir = Path(args.out_dir) + prior_by_case = _load_prior_candidate_grades(out_dir) + prior_files = _prior_labeling_paths(out_dir) + print( + f"Merging with {len(prior_files)} prior labeling sheet(s); " + f"cases with prior candidates: {sorted(prior_by_case)}" + ) + + labeling_cases: list[dict[str, Any]] = [] + case_reports: list[dict[str, Any]] = [] + + for case in cases: + logger.info("Bootstrap case=%s", case["id"]) + matches, mapping_status, diagnostics = await _run_case(case) + ranked = [_match_to_dict(match) for match in matches] + grades = _relevance_for_case(case) + split = _split_label_metrics(matches, grades, ks) + diagnostics_payload = _diagnostics_dict(diagnostics) + report = { + "case_id": case["id"], + "mapping_status": mapping_status, + "proxy_metrics": _proxy_metrics( + matches, + case, + ks, + mapping_status=mapping_status, + ), + "label_metrics": split["overall"], + "label_metrics_split": split, + "diagnostics": diagnostics_payload, + "top_results": ranked[: args.top], + } + case_reports.append(report) + _print_case_summary(case["id"], report, ks) + + merged_candidates = _merge_candidates( + case=case, + new_ranked=ranked[: args.top], + prior_by_case=prior_by_case, + ) + labeling_cases.append( + { + "id": case["id"], + "description": case.get("description"), + "keywords": case["keywords"], + "expected_ipc_prefixes": case.get("expected_ipc_prefixes", []), + "mapping_status": mapping_status, + "diagnostics": diagnostics_payload, + "merge_stats": { + "current_top": sum( + 1 for c in merged_candidates if c.get("in_current_top") + ), + "from_prior_pool": sum( + 1 for c in merged_candidates if c.get("in_prior_pool") + ), + "total_candidates": len(merged_candidates), + "graded": sum( + 1 for c in merged_candidates if c.get("grade") is not None + ), + }, + "instructions": ( + "Set grade 0=irrelevant, 1=relevant, 2=highly relevant. " + "Pool merges current Top-N with prior labeling sheets and " + "goldset grades so old and new hits can be judged together. " + "Copy graded patent_ids into goldset relevant_patent_ids " + "and/or relevance_grades." + ), + "candidates": merged_candidates, + } + ) + + stamp = datetime.now(timezone.utc).strftime("%Y%m%dT%H%M%SZ") + labeling_path = out_dir / f"labeling_{stamp}.json" + report_path = out_dir / f"bootstrap_report_{stamp}.json" + + payload = { + "created_at": stamp, + "goldset": str(args.goldset), + "merged_prior_labeling_files": [str(path) for path in prior_files], + "summary": _aggregate(case_reports, ks), + "cases": labeling_cases, + "cap_explanation": ( + f"Each EPO/USPTO query uses size={_MAX_PATENTS} and the pipeline " + f"caps returned patents at {_MAX_PATENTS}. hit_return_cap=true means " + "at least that many candidates passed scoring before the final slice." + ), + } + _write_json(labeling_path, payload) + _write_json( + report_path, + { + "created_at": stamp, + "mode": "bootstrap", + "summary": payload["summary"], + "case_reports": case_reports, + "cap_explanation": payload["cap_explanation"], + }, + ) + + print("\n--- aggregate (proxy + label split) ---") + print(json.dumps(payload["summary"], indent=2)) + print(f"\n{payload['cap_explanation']}") + print(f"\nLabeling sheet (merged): {labeling_path}") + print(f"Report: {report_path}") + print( + "Next: grade candidates (grade=0/1/2), merge into goldset, then run: " + "python scripts/patents/evaluate_keyword_patent_search.py eval" + ) + print( + "Do not retune relevance gates or score weights until after this label round." + ) + return 0 + + +async def cmd_eval(args: argparse.Namespace) -> int: + gold = _load_json(args.goldset) + ks = list(args.k or gold.get("ks") or [5, 10, 20]) + presentation = bool(gold.get("presentation")) + cases = gold["cases"] + if args.case: + cases = [case for case in cases if case["id"] == args.case] + if not cases: + logger.error("Unknown case id: %s", args.case) + return 1 + + case_reports: list[dict[str, Any]] = [] + for case in cases: + logger.info("Eval case=%s", case["id"]) + matches, mapping_status, diagnostics = await _run_case(case) + grades = _relevance_for_case(case) + if presentation: + report = _presentation_case_report( + case, + matches, + mapping_status, + diagnostics, + grades, + ks, + ) + case_reports.append(report) + _print_presentation_case(report, ks) + continue + + split = _split_label_metrics(matches, grades, ks) + report = { + "case_id": case["id"], + "mapping_status": mapping_status, + "proxy_metrics": _proxy_metrics( + matches, + case, + ks, + mapping_status=mapping_status, + ), + "label_metrics": split["overall"], + "label_metrics_split": split, + "diagnostics": _diagnostics_dict(diagnostics), + "top_results": [_match_to_dict(match) for match in matches[: args.top]], + } + case_reports.append(report) + _print_case_summary(case["id"], report, ks) + + summary = ( + _presentation_aggregate(case_reports, ks) + if presentation + else _aggregate(case_reports, ks) + ) + stamp = datetime.now(timezone.utc).strftime("%Y%m%dT%H%M%SZ") + report_name = "presentation_eval_report" if presentation else "eval_report" + report_path = Path(args.out_dir) / f"{report_name}_{stamp}.json" + _write_json( + report_path, + { + "created_at": stamp, + "mode": "presentation_eval" if presentation else "eval", + "goldset": str(args.goldset), + "summary": summary, + "case_reports": case_reports, + }, + ) + + print("\n--- aggregate ---") + print(json.dumps(summary, indent=2)) + if summary.get("cases_labeled", 0) == 0: + print( + "\nNo relevance labels found. Grade candidates in labeling_presentation.json " + "or fill relevance_grades in the goldset, then re-run eval." + ) + print(f"\nReport: {report_path}") + return 0 + + +def _reweight_matches( + matches: list[KeywordPatentMatch], + weights: dict[str, float], +) -> list[KeywordPatentMatch]: + rescored = [ + match.model_copy( + update={ + "match_score": _compute_final_score( + match.ipc_score, + match.topic_score, + match.text_score, + weights=weights, + ) + } + ) + for match in matches + ] + rescored.sort( + key=lambda item: ( + item.match_score, + item.patent.publication_date or "", + item.patent.patent_id, + ), + reverse=True, + ) + return rescored + + +async def cmd_ablation(args: argparse.Namespace) -> int: + gold = _load_json(args.goldset) + ks = list(args.k or gold.get("ks") or [5, 10, 20]) + weight_sets = { + "default": dict(_DEFAULT_SCORE_WEIGHTS), + "ipc_heavy": {"ipc": 0.8, "topic": 0.15, "text": 0.05}, + "topic_heavy": {"ipc": 0.4, "topic": 0.45, "text": 0.15}, + "text_heavy": {"ipc": 0.4, "topic": 0.2, "text": 0.4}, + "balanced": {"ipc": 1 / 3, "topic": 1 / 3, "text": 1 / 3}, + } + + cases = gold["cases"] + if args.case: + cases = [case for case in cases if case["id"] == args.case] + + ablation_rows: list[dict[str, Any]] = [] + for case in cases: + logger.info("Ablation case=%s", case["id"]) + base_matches, _mapping_status, _diagnostics = await _run_case(case) + grades = _relevance_for_case(case) + for name, weights in weight_sets.items(): + matches = _reweight_matches(base_matches, weights) + ranked_ids = [m.patent.patent_id for m in matches] + row = { + "case_id": case["id"], + "weights_name": name, + "weights": weights, + "proxy_metrics": _proxy_metrics(matches, case, ks), + "label_metrics": _label_metrics(ranked_ids, grades, ks), + } + ablation_rows.append(row) + label = row["label_metrics"] + p10 = label["precision"]["@10"] if label else None + print( + f"{case['id']:24} {name:12} " + f"ipc_hit@10={row['proxy_metrics']['ipc_prefix_hit_rate']['@10']} " + f"P@10={p10}" + ) + + stamp = datetime.now(timezone.utc).strftime("%Y%m%dT%H%M%SZ") + report_path = Path(args.out_dir) / f"ablation_report_{stamp}.json" + _write_json( + report_path, + { + "created_at": stamp, + "mode": "ablation", + "weight_sets": weight_sets, + "rows": ablation_rows, + }, + ) + print(f"\nReport: {report_path}") + return 0 + + +def build_parser() -> argparse.ArgumentParser: + parser = argparse.ArgumentParser( + description="Evaluate keyword → patent search (P@k, nDCG, IPC proxy metrics).", + ) + parser.add_argument( + "mode", + choices=["bootstrap", "eval", "ablation"], + help="bootstrap=write labeling sheet; eval=score vs gold; ablation=weight variants", + ) + parser.add_argument( + "--goldset", + type=Path, + default=DEFAULT_GOLDSET, + help=f"Gold set JSON (default: {DEFAULT_GOLDSET})", + ) + parser.add_argument( + "--out-dir", + type=Path, + default=DEFAULT_OUT_DIR, + help=f"Output directory (default: {DEFAULT_OUT_DIR})", + ) + parser.add_argument("--case", type=str, default=None, help="Run a single case id") + parser.add_argument( + "--top", + type=int, + default=20, + help="How many top results to keep for labeling/report (default: 20)", + ) + parser.add_argument( + "-k", + action="append", + type=int, + dest="k", + help="Cutoffs for @k metrics (repeatable). Default from goldset.", + ) + parser.add_argument("-v", "--verbose", action="store_true") + return parser + + +def main() -> int: + parser = build_parser() + args = parser.parse_args() + logging.basicConfig( + level=logging.DEBUG if args.verbose else logging.INFO, + format="%(levelname)s %(message)s", + ) + + if args.mode == "bootstrap": + return asyncio.run(cmd_bootstrap(args)) + if args.mode == "eval": + return asyncio.run(cmd_eval(args)) + if args.mode == "ablation": + return asyncio.run(cmd_ablation(args)) + parser.error(f"Unknown mode: {args.mode}") + return 2 + + +if __name__ == "__main__": + raise SystemExit(main()) diff --git a/service/scripts/patents/index_org_patents.py b/service/scripts/patents/index_org_patents.py index 21023ca2..f7c5b469 100644 --- a/service/scripts/patents/index_org_patents.py +++ b/service/scripts/patents/index_org_patents.py @@ -4,13 +4,9 @@ index_org_patents.py — Build the org_patents Elasticsearch index for one insti Fetches all OpenAlex authors affiliated with the institution, searches EPO/USPTO for patents matched via institution assignee and/or author name (match_type: "institution", -"name", or "both"), deletes existing documents for the institution, and reindexes. -Every inventor-name match counts outright only if the assignee is the institution -itself; everything else (a personal-assignee match or a third-party assignee) only -counts if the patent's primary IPC/CPC classification also maps to OpenAlex research -topics that appear on the author's own profile — applied regardless of how common the -name looks in our local OpenAlex data, since a name can appear unique there while -still being common globally in EPO/USPTO. +"name", or "both"), deletes existing documents for the institution, and reindexes. An +inventor-name match counts only if the assignee is the institution itself or the +person themselves, to avoid pulling in unrelated patents via a shared name. Usage: python scripts/patents/index_org_patents.py --institution-id diff --git a/service/src/main/inse/auth/model.py b/service/src/main/inse/auth/model.py index 3b8d5d97..3b211935 100644 --- a/service/src/main/inse/auth/model.py +++ b/service/src/main/inse/auth/model.py @@ -256,6 +256,10 @@ class AccessTokenMetadata(BaseTokenData): effective_organization_id: uuid.UUID = Field( description="The unique identifier of the organization associated with this access token.", ) + effective_institution_id: str | None = Field( + default=None, + description="The OpenAlex institution ID associated with this access token, if applicable.", + ) def is_impersonating(self) -> bool: """Determine if the access token is being used for impersonation. @@ -303,6 +307,10 @@ class RefreshTokenMetadata(BaseTokenData): effective_organization_id: uuid.UUID = Field( description="The unique identifier of the organization associated with this access token.", ) + effective_institution_id: str | None = Field( + default=None, + description="The OpenAlex institution ID associated with this access token, if applicable.", + ) class RefreshToken(RefreshTokenMetadata): diff --git a/service/src/main/inse/auth/service.py b/service/src/main/inse/auth/service.py index 24f6fce0..39855a14 100644 --- a/service/src/main/inse/auth/service.py +++ b/service/src/main/inse/auth/service.py @@ -48,6 +48,7 @@ EFFECTIVE_ACCOUNT_ID_KEY = "effective_account_id" EFFECTIVE_ROLE_KEY = "effective_role" EFFECTIVE_ROLES_KEY = "effective_roles" EFFECTIVE_ORGANIZATION_ID_KEY = "effective_organization_id" +EFFECTIVE_INSTITUTION_ID_KEY = "effective_institution_id" EPOCH_KEY = "epoch" USER_FINGERPRINT_HASH_KEY = "user_fingerprint_hash" @@ -622,6 +623,7 @@ def _get_current_user_access_token_payload( effective_organization_id=uuid.UUID( access_token_payload[EFFECTIVE_ORGANIZATION_ID_KEY] ), + effective_institution_id=access_token_payload.get(EFFECTIVE_INSTITUTION_ID_KEY), user_fingerprint_hash=access_token_payload[USER_FINGERPRINT_HASH_KEY], ) @@ -667,6 +669,9 @@ def _get_current_user_refresh_token_payload( effective_organization_id=uuid.UUID( refresh_token_payload[EFFECTIVE_ORGANIZATION_ID_KEY] ), + effective_institution_id=refresh_token_payload.get( + EFFECTIVE_INSTITUTION_ID_KEY + ), ) logger.debug("Extracted refresh token payload: %s", refresh_token) @@ -779,6 +784,34 @@ def _get_account_organization(session: Session, account_id: uuid.UUID) -> uuid.U return account.organization_id +def _get_account_institution_id( + session: Session, account_id: uuid.UUID +) -> Optional[str]: + """Retrieves the OpenAlex institution ID for the given account ID. + + Args: + session (Session): The database session. + account_id (uuid.UUID): The unique identifier of the account for which to retrieve the OpenAlex institution ID. + + Returns: + Optional[str]: The OpenAlex institution ID associated with the given account ID, or None if not available. + """ + account = session.get(Account, account_id) + + if not account or account.deleted or not account.activated or account.id is None: + raise AccountNotFoundException + + organization = session.get(Organization, account.organization_id) + + if not organization: + raise HTTPException( + status_code=status.HTTP_404_NOT_FOUND, + detail="Organization not found.", + ) + + return organization.openalex_institution_id + + def _is_valid_impersonation( session: Session, real_account_id: uuid.UUID, effective_account_id: uuid.UUID ) -> bool: @@ -871,6 +904,9 @@ def get_access_token( organization_id = _get_account_organization( session=session, account_id=effective_account_id ) + effective_institution_id = _get_account_institution_id( + session=session, account_id=effective_account_id + ) user_fingerprint_hash = _set_access_fp_cookie(response=response) @@ -879,6 +915,7 @@ def get_access_token( effective_account_id=effective_account_id, effective_role=role, effective_organization_id=organization_id, + effective_institution_id=effective_institution_id, epoch=epoch, user_fingerprint_hash=user_fingerprint_hash, effective_roles=roles, @@ -889,6 +926,7 @@ def get_access_token( effective_account_id=effective_account_id, effective_role=role, effective_organization_id=organization_id, + effective_institution_id=effective_institution_id, epoch=epoch, effective_roles=roles, ) @@ -993,6 +1031,7 @@ def refresh_access_token( effective_account_id=refresh_token.effective_account_id, effective_role=refresh_token.effective_role, effective_organization_id=refresh_token.effective_organization_id, + effective_institution_id=refresh_token.effective_institution_id, epoch=refresh_token.epoch, user_fingerprint_hash=user_fingerprint_hash, effective_roles=refresh_token.effective_roles, @@ -1043,6 +1082,7 @@ def _set_refresh_token( effective_organization_id: uuid.UUID, epoch: int, effective_roles: list[UserRole] | None = None, + effective_institution_id: Optional[str] = None, ) -> RefreshTokenMetadata: """Builds a refresh token for the specified account IDs, role, organization ID, epoch, and fingerprint hash. @@ -1068,6 +1108,7 @@ def _set_refresh_token( EFFECTIVE_ROLE_KEY: effective_role.value, EFFECTIVE_ROLES_KEY: [role.value for role in effective_roles], EFFECTIVE_ORGANIZATION_ID_KEY: str(effective_organization_id), + EFFECTIVE_INSTITUTION_ID_KEY: effective_institution_id, EPOCH_KEY: epoch, } @@ -1096,6 +1137,7 @@ def _build_access_token( epoch: int, user_fingerprint_hash: str, effective_roles: list[UserRole] | None = None, + effective_institution_id: Optional[str] = None, ) -> AccessToken: """Builds an access token for the specified account IDs, role, organization ID, epoch, and fingerprint hash. @@ -1123,6 +1165,7 @@ def _build_access_token( EFFECTIVE_ORGANIZATION_ID_KEY: str(effective_organization_id), EPOCH_KEY: epoch, USER_FINGERPRINT_HASH_KEY: user_fingerprint_hash, + EFFECTIVE_INSTITUTION_ID_KEY: effective_institution_id, } raw_token = _build_token( @@ -1139,6 +1182,7 @@ def _build_access_token( effective_role=effective_role, effective_roles=effective_roles, effective_organization_id=effective_organization_id, + effective_institution_id=effective_institution_id, user_fingerprint_hash=user_fingerprint_hash, raw_token=raw_token, ) diff --git a/service/src/main/inse/authors/v2/model.py b/service/src/main/inse/authors/v2/model.py new file mode 100644 index 00000000..fdb0c63f --- /dev/null +++ b/service/src/main/inse/authors/v2/model.py @@ -0,0 +1,8 @@ +from inse.model import Page +from inse.models.openalex.author import Author + + +class AuthorPage(Page[Author]): + """A paginated response containing a list of authors.""" + + pass diff --git a/service/src/main/inse/authors/v2/router.py b/service/src/main/inse/authors/v2/router.py new file mode 100644 index 00000000..74fce377 --- /dev/null +++ b/service/src/main/inse/authors/v2/router.py @@ -0,0 +1,47 @@ +import logging +from typing import Annotated + +from fastapi import APIRouter, Query + +from inse.tags import Tags +from inse.authors.v2.model import AuthorPage + +import inse.authors.v2.service as authors_service + + +AUTHORS_V2_PREFIX = "/api/v2/authors" + +logger = logging.getLogger(__name__) + + +router = APIRouter(prefix=AUTHORS_V2_PREFIX, tags=[Tags.AUTHORS_V2]) + + +@router.get( + "/authors/id", + operation_id="getAuthorsByIds", + summary="Returns a paginated list of authors for a given list of author IDs.", +) +async def get_authors_by_ids( + author_ids: Annotated[ + list[str], + Query(description="A list of author IDs to retrieve."), + ] = [], +) -> AuthorPage: + return await authors_service.get_authors_by_ids(author_ids=author_ids or []) + + +@router.get( + "/autocomplete/selector", + operation_id="autocompleteAuthorsForSelector", + summary="Returns a paginated list of authors for a given search term based on their display name.", +) +async def autocomplete_authors_for_selector( + query: Annotated[ + str, + Query( + description="A search term to filter authors by (partial matches allowed)." + ), + ] = "", +) -> AuthorPage: + return await authors_service.autocomplete_authors_for_selector(query=query) diff --git a/service/src/main/inse/authors/v2/service.py b/service/src/main/inse/authors/v2/service.py new file mode 100644 index 00000000..428d7fed --- /dev/null +++ b/service/src/main/inse/authors/v2/service.py @@ -0,0 +1,97 @@ +from typing import Dict, List, Optional + +from inse.authors.v2.model import AuthorPage +from inse.integrations import elasticsearch +from inse.model import ESIndex +from inse.models.openalex.author import Author + + +async def search_authors( + page: int = 0, + size: int = 10, + query: Optional[Dict] = None, + source: Optional[List[str]] = None, + sort: Optional[List[dict]] = None, + body: Optional[dict] = None, +) -> AuthorPage: + """Searches for authors in the OpenAlex Elasticsearch index based on the provided parameters. + + Args: + page (int, optional): The page number for pagination (0-indexed). Defaults to 0. + size (int, optional): The number of results to return per page. Defaults to 10. + query (Optional[Dict], optional): The search query. Defaults to None. + source (Optional[List[str]], optional): The fields to include in the response. Defaults to None. + sort (Optional[List[dict]], optional): The sorting criteria. Defaults to None. + body (Optional[dict], optional): The request body for the search query. Defaults to None. + + Returns: + AuthorPage: A page of authors matching the search criteria. + """ + + response = await elasticsearch.search( + ESIndex.OPENALEX_AUTHORS, + query=query, + source=source, + size=size, + offset=size * page, + sort=sort, + body=body, + ) + + hits_block = response.get("hits", {}) + hits = hits_block.get("hits", []) + authors: List[Author] = [] + for hit in hits: + _source = hit.get("_source", {}) + authors.append(Author.from_dict(_source)) # type: ignore + return AuthorPage(elements=authors, total=len(authors), page=page, size=size) + + +async def autocomplete_authors_for_selector(query: str) -> AuthorPage: + """Autocompletes authors based on a search term for use in a selector component. + + Args: + query (str): The search term to filter authors by (partial matches allowed). + + Returns: + AuthorPage: A page of authors matching the search criteria. + """ + + return await search_authors( + page=0, + size=10, + query={"match_phrase_prefix": {"display_name": query}}, + source=[ + "id", + "display_name", + "orcid", + "last_known_institutions", + "works_count", + ], + ) + + +async def get_authors_by_ids(author_ids: List[str]) -> AuthorPage: + """Retrieves authors based on a list of author IDs. + + Args: + author_ids (List[str]): A list of author IDs to retrieve. + + Returns: + AuthorPage: A page of authors matching the provided IDs. + """ + if not author_ids: + return AuthorPage(elements=[], total=0, page=0, size=0) + + return await search_authors( + page=0, + size=len(author_ids), + query={"terms": {"id": author_ids}}, + source=[ + "id", + "display_name", + "orcid", + "last_known_institutions", + "works_count", + ], + ) diff --git a/service/src/main/inse/institutions/v2/model.py b/service/src/main/inse/institutions/v2/model.py new file mode 100644 index 00000000..8f7572ec --- /dev/null +++ b/service/src/main/inse/institutions/v2/model.py @@ -0,0 +1,8 @@ +from inse.model import Page +from inse.models.openalex.institution import Institution + + +class InstitutionPageV2(Page[Institution]): + """A paginated response containing a list of institutions.""" + + pass diff --git a/service/src/main/inse/institutions/v2/router.py b/service/src/main/inse/institutions/v2/router.py new file mode 100644 index 00000000..d86074b9 --- /dev/null +++ b/service/src/main/inse/institutions/v2/router.py @@ -0,0 +1,49 @@ +import logging +from typing import Annotated + +from fastapi import APIRouter, Query + +from inse.institutions.v2.model import InstitutionPageV2 +from inse.tags import Tags + + +logger = logging.getLogger(__name__) + + +INSTITUTIONS_v2_PREFIX = "/api/v2/institutions" + +router = APIRouter(prefix=INSTITUTIONS_v2_PREFIX, tags=[Tags.INSTITUTIONS_V2]) + + +@router.get( + "/ids", + operation_id="getInstitutionsByIds", + summary="Returns a list of institutions based on their IDs.", +) +async def get_institutions_by_ids( + institution_ids: Annotated[ + list[str], + Query(description="A list of institution IDs to retrieve."), + ] = [], +) -> InstitutionPageV2: + from inse.institutions.v2.service import get_institutions_by_ids + + return await get_institutions_by_ids(institution_ids=institution_ids or []) + + +@router.get( + "/autocomplete/selector", + operation_id="getInstitutionAutocompleteForSelector", + summary="Returns a list of institutions based on a search term for autocomplete functionality.", +) +async def get_institution_autocomplete( + query: Annotated[ + str, + Query( + description="A search term to filter institutions by (partial matches allowed)." + ), + ] = "", +) -> InstitutionPageV2: + from inse.institutions.v2.service import autocomplete_institutions_for_selector + + return await autocomplete_institutions_for_selector(query=query) diff --git a/service/src/main/inse/institutions/v2/service.py b/service/src/main/inse/institutions/v2/service.py new file mode 100644 index 00000000..47554ece --- /dev/null +++ b/service/src/main/inse/institutions/v2/service.py @@ -0,0 +1,141 @@ +import logging +from typing import Dict, List, Optional + +from inse.integrations import elasticsearch +from inse.model import ESIndex +from inse.models.openalex.institution import Institution +from inse.institutions.v2.model import InstitutionPageV2 + + +logger = logging.getLogger(__name__) + + +async def search_institutions( + page: int = 0, + size: int = 10, + query: Optional[Dict] = None, + source: Optional[List[str]] = None, + sort: Optional[List[Dict]] = None, + body: Optional[Dict] = None, +) -> InstitutionPageV2: + """Searches for institutions in the OpenAlex Elasticsearch index based on the provided parameters. + + Args: + page (int, optional): The page number to retrieve. Defaults to 0. + size (int, optional): The number of institutions to retrieve per page. Defaults to 10. + query (Optional[Dict], optional): The search query to filter institutions by. Defaults to None. + source (Optional[List[str]], optional): A list of fields to include in the response. Defaults to None. + sort (Optional[List[Dict]], optional): A list of sorting criteria. Defaults to None. + body (Optional[Dict], optional): The request body for the Elasticsearch search query. Defaults to None. + + Returns: + InstitutionPageV2: A page of institutions matching the search criteria. + """ + response = await elasticsearch.search( + ESIndex.OPENALEX_INSTITUTIONS, + query=query, + source=source, + size=size, + offset=size * page, + sort=sort, + body=body, + ) + + hits_block = response.get("hits", {}) + hits = hits_block.get("hits", []) + institutions: List[Institution] = [] + for hit in hits: + _source = hit.get("_source", {}) + institutions.append(Institution.from_dict(_source)) # type: ignore + return InstitutionPageV2( + elements=institutions, total=len(institutions), page=page, size=size + ) + + +async def get_institutions_by_ids(institution_ids: List[str]) -> InstitutionPageV2: + """Retrieves institutions based on a list of institution IDs. + + Args: + institution_ids (List[str]): A list of institution IDs to retrieve. + + Returns: + InstitutionPageV2: A page of institutions matching the provided IDs. + """ + logger.debug(f"Fetching institutions for IDs: {institution_ids}") + if not institution_ids: + return InstitutionPageV2(elements=[], total=0, page=0, size=0) + + return await search_institutions( + page=0, + size=len(institution_ids), + query={"terms": {"id": institution_ids}}, + source=[ + "id", + "display_name", + "display_name_alternatives", + "country_code", + "type", + "ror", + ], + ) + + +async def autocomplete_institutions( + query: str, page: int = 0, size: int = 10, source: Optional[List[str]] = None +) -> InstitutionPageV2: + """Autocompletes institutions based on a search term. + + Args: + query (str): The search term to autocomplete institutions with. + page (int, optional): The page number to retrieve. Defaults to 0. + size (int, optional): The number of institutions to retrieve per page. Defaults to 10. + source (Optional[List[str]], optional): A list of fields to include in the response. Defaults to None. + + Returns: + InstitutionPageV2: A page of institutions matching the autocomplete criteria. + """ + logger.debug(f"Autocomplete institutions for query: {query}") + if not query: + return InstitutionPageV2(elements=[], total=0, page=0, size=0) + + return await search_institutions( + page=page, + size=size, + query={ + "bool": { + "should": [ + {"match_phrase_prefix": {"display_name": query}}, + {"match_phrase_prefix": {"display_name_alternatives": query}}, + ] + } + }, + source=source, + ) + + +async def autocomplete_institutions_for_selector( + query: str, page: int = 0, size: int = 10 +) -> InstitutionPageV2: + """Autocompletes institutions based on a search term for use in a selector component. + + Args: + query (str): The search term to filter institutions by (partial matches allowed). + page (int, optional): The page number to retrieve. Defaults to 0. + size (int, optional): The number of institutions to retrieve per page. Defaults to 10. + + Returns: + InstitutionPageV2: A page of institutions matching the autocomplete criteria. + """ + return await autocomplete_institutions( + query=query, + page=page, + size=size, + source=[ + "id", + "display_name", + "display_name_alternatives", + "country_code", + "type", + "ror", + ], + ) diff --git a/service/src/main/inse/main.py b/service/src/main/inse/main.py index 1e9c0a78..1fa1b997 100644 --- a/service/src/main/inse/main.py +++ b/service/src/main/inse/main.py @@ -54,6 +54,9 @@ from inse.patents.service import ( ) from inse.works.v2.router import router as works_v2_router +from inse.authors.v2.router import router as authors_v2_router +from inse.institutions.v2.router import router as institutions_v2_router +from inse.topics.v2.router import router as topics_v2_router logger = logging.getLogger(__name__) @@ -102,7 +105,11 @@ app.include_router(service_router) app.include_router(auth_router) app.include_router(account_management_router) app.include_router(organization_management_router) + app.include_router(works_v2_router) +app.include_router(authors_v2_router) +app.include_router(institutions_v2_router) +app.include_router(topics_v2_router) app.include_router(dashboard_router) app.include_router(bookmarks_router) diff --git a/service/src/main/inse/model.py b/service/src/main/inse/model.py index 27cb2b8c..30f0a153 100644 --- a/service/src/main/inse/model.py +++ b/service/src/main/inse/model.py @@ -28,6 +28,8 @@ T = TypeVar("T", bound=BaseModel) class Page(BaseModel, Generic[T]): + """A generic page model that represents a paginated response containing elements of type T.""" + elements: List[T] = Field(default=[], description="The elements of the page.") page: int = Field(default=0, description="The page number. (0-based)") size: int = Field(default=20, description="The page size in elements.") @@ -116,4 +118,3 @@ class ESIndex(StrEnum): PROJECTS_CORDIS_EU_H2020_TOPICS = "projects_cordiseu_h2020_openalex_topics" PROJECTS_CORDIS_EU_HEUROPE_TOPICS = "projects_cordiseu_heurope_openalex_topics" PATENTS_OPENALEX_KEYWORDS = "patents_openalex_keywords" - diff --git a/service/src/main/inse/patents/keywords/eval_metrics.py b/service/src/main/inse/patents/keywords/eval_metrics.py new file mode 100644 index 00000000..887a713e --- /dev/null +++ b/service/src/main/inse/patents/keywords/eval_metrics.py @@ -0,0 +1,225 @@ +"""Ranking metrics for keyword → patent search evaluation.""" +from __future__ import annotations + +import math +from collections.abc import Iterable, Mapping, Sequence + + +def normalize_patent_id(patent_id: str) -> str: + return patent_id.strip().upper() + + +def precision_at_k( + ranked_ids: Sequence[str], + relevant_ids: Iterable[str], + k: int, +) -> float: + if k <= 0: + return 0.0 + relevant = {normalize_patent_id(pid) for pid in relevant_ids} + if not relevant: + return 0.0 + top = [normalize_patent_id(pid) for pid in ranked_ids[:k]] + hits = sum(1 for pid in top if pid in relevant) + return hits / k + + +def recall_at_k( + ranked_ids: Sequence[str], + relevant_ids: Iterable[str], + k: int, +) -> float: + relevant = {normalize_patent_id(pid) for pid in relevant_ids} + if not relevant or k <= 0: + return 0.0 + top = {normalize_patent_id(pid) for pid in ranked_ids[:k]} + return len(top & relevant) / len(relevant) + + +def average_precision( + ranked_ids: Sequence[str], + relevant_ids: Iterable[str], +) -> float: + relevant = {normalize_patent_id(pid) for pid in relevant_ids} + if not relevant: + return 0.0 + + hits = 0 + precision_sum = 0.0 + for idx, patent_id in enumerate(ranked_ids, start=1): + if normalize_patent_id(patent_id) not in relevant: + continue + hits += 1 + precision_sum += hits / idx + + if hits == 0: + return 0.0 + return precision_sum / len(relevant) + + +def dcg_at_k(gains: Sequence[float], k: int) -> float: + total = 0.0 + for idx, gain in enumerate(gains[:k], start=1): + total += gain / math.log2(idx + 1) + return total + + +def ndcg_at_k( + ranked_ids: Sequence[str], + relevance_grades: Mapping[str, float], + k: int, +) -> float: + if k <= 0 or not relevance_grades: + return 0.0 + + grades = { + normalize_patent_id(pid): float(grade) + for pid, grade in relevance_grades.items() + if float(grade) > 0 + } + if not grades: + return 0.0 + + gains = [ + grades.get(normalize_patent_id(pid), 0.0) for pid in ranked_ids[:k] + ] + ideal = sorted(grades.values(), reverse=True) + ideal_dcg = dcg_at_k(ideal, k) + if ideal_dcg <= 0: + return 0.0 + return dcg_at_k(gains, k) / ideal_dcg + + +def mrr( + ranked_ids: Sequence[str], + relevant_ids: Iterable[str], +) -> float: + relevant = {normalize_patent_id(pid) for pid in relevant_ids} + if not relevant: + return 0.0 + for idx, patent_id in enumerate(ranked_ids, start=1): + if normalize_patent_id(patent_id) in relevant: + return 1.0 / idx + return 0.0 + + +def ipc_prefix_hit_rate( + patent_ipc_lists: Sequence[Sequence[str]], + prefixes: Sequence[str], + *, + k: int | None = None, +) -> float: + """Share of patents whose IPC/CPC codes start with any expected prefix.""" + if not prefixes: + return 0.0 + subset = list(patent_ipc_lists[:k] if k is not None else patent_ipc_lists) + if not subset: + return 0.0 + + normalized_prefixes = [prefix.strip().upper() for prefix in prefixes if prefix.strip()] + if not normalized_prefixes: + return 0.0 + + hits = 0 + for codes in subset: + normalized_codes = [code.strip().upper().replace(" ", "") for code in codes] + if any( + code.startswith(prefix) + for code in normalized_codes + for prefix in normalized_prefixes + ): + hits += 1 + return hits / len(subset) + + +def mean(values: Sequence[float]) -> float: + if not values: + return 0.0 + return sum(values) / len(values) + + +def normalize_application_number(application_number: str | None) -> str | None: + if not application_number or not application_number.strip(): + return None + return application_number.strip().upper().replace(" ", "") + + +def normalize_title_key(title: str | None) -> str | None: + if not title or not title.strip(): + return None + return " ".join(title.lower().split()) + + +def patent_family_key( + *, + patent_id: str, + application_number: str | None = None, + title: str | None = None, +) -> str: + """Best-effort family key: application number, else normalized title, else patent id.""" + app = normalize_application_number(application_number) + if app: + return f"app:{app}" + title_key = normalize_title_key(title) + if title_key: + return f"title:{title_key}" + return f"id:{normalize_patent_id(patent_id)}" + + +def analyze_family_duplicates_in_top_k( + family_keys: Sequence[str], + k: int, +) -> dict[str, int | list[dict[str, str | int]]]: + top = list(family_keys[:k]) + counts: dict[str, int] = {} + for key in top: + counts[key] = counts.get(key, 0) + 1 + duplicate_groups = [ + {"family_key": key, "count": count} + for key, count in sorted(counts.items(), key=lambda item: -item[1]) + if count > 1 + ] + return { + "total_in_top_k": len(top), + "unique_families": len(counts), + "duplicate_entries": len(top) - len(counts), + "duplicate_groups": duplicate_groups, + } + + +def unique_family_precision_at_k( + ranked_ids: Sequence[str], + family_keys: Sequence[str], + relevant_ids: Iterable[str], + k: int, +) -> float: + """Precision@k counting at most one relevant hit per patent family in top-k.""" + if k <= 0: + return 0.0 + relevant = {normalize_patent_id(pid) for pid in relevant_ids} + if not relevant: + return 0.0 + + credited_families: set[str] = set() + hits = 0 + for patent_id, family_key in zip(ranked_ids[:k], family_keys[:k]): + if family_key in credited_families: + continue + credited_families.add(family_key) + if normalize_patent_id(patent_id) in relevant: + hits += 1 + return hits / k + + +def dedupe_ranked_ids_by_family( + ranked_ids: Sequence[str], + family_keys: Sequence[str], +) -> list[str]: + seen: set[str] = set() + deduped: list[str] = [] + for patent_id, family_key in zip(ranked_ids, family_keys): + if family_key in seen: + continue + seen.add(family_key) + deduped.append(normalize_patent_id(patent_id)) + return deduped diff --git a/service/src/main/inse/patents/keywords/logic.py b/service/src/main/inse/patents/keywords/logic.py index 47e51161..1e030675 100644 --- a/service/src/main/inse/patents/keywords/logic.py +++ b/service/src/main/inse/patents/keywords/logic.py @@ -5,6 +5,7 @@ import asyncio import logging import math import re +from dataclasses import dataclass, field import httpx @@ -30,28 +31,60 @@ from inse.patents.ipc_lookup import ( ) from inse.patents.ipc_search_client import IpcSearchClient from inse.patents.keywords.model import ( + KeywordEvidence, + KeywordPatentMappingStatus, KeywordPatentMatch, + KeywordPatentSearchDiagnostics, KeywordPatentSearchItem, PatentsByKeywordsRequest, PatentsByKeywordsResponse, ) -from inse.patents.keywords.reverse_lookup import IpcCodeMatch, KeywordIpcReverseLookup -from inse.patents.keywords.search_queries import IpcPatentSearchQueries +from inse.patents.keywords.reverse_lookup import ( + IpcCodeMatch, + KeywordIpcReverseLookup, + _topic_group_key as _match_topic_group_key, +) +from inse.patents.keywords.search_queries import ( + IpcPatentSearchQueries, + _search_terms_for_symbol, +) from inse.patents.patents_openalex_keywords.ipc_entries import infer_subclass, normalize_symbol from inse.patents.patents_openalex_keywords.resolver import PatentOpenAlexMappingResolver logger = logging.getLogger(__name__) _MAX_PATENTS = 100 -_MAX_IPC_CODES = 20 -_MAX_IPC_CODES_PER_KEYWORD = 2 +# Raw mapping candidates before cluster selection (avoid early truncation bias). +_MAX_IPC_LOOKUP_CANDIDATES = 200 +_MAX_IPC_CODES_PER_KEYWORD = 3 +_MAX_CLUSTERS_PER_TOPIC = 3 _MAX_PATENT_SEARCH_TERMS = 10 _MAX_SEARCH_KEYWORDS = 10 _MIN_KEYWORD_RELEVANCE = 0.0 _MIN_IPC_MATCH_SCORE = 0.65 +# Concentration gates: fragmented distributions return no IPC codes. +_MIN_CLUSTER_RELATIVE_MASS = 0.15 +_MIN_CLUSTER_TAIL_MASS = 0.10 +_MIN_LEADER_RELATIVE_MASS = 0.20 +_MIN_LEADER_MASS_RATIO = 1.5 +_TARGET_CUMULATIVE_CLUSTER_MASS = 0.75 _MIN_PATENT_MATCH_SCORE = 0.50 +_MIN_TEXT_PATENT_MATCH_SCORE = 0.30 _DEFAULT_SCORE_WEIGHTS = {"ipc": 0.60, "topic": 0.25, "text": 0.15} +# When IPC mapping is abstained, score only topic + text evidence. +_TEXT_SCORE_WEIGHTS = {"ipc": 0.0, "topic": 0.45, "text": 0.55} +# Also try title/abstract search when IPC mapping produced terms but scoring +# returned no patents (empty retrieval or over-filtering). +_TEXT_SEARCH_AFTER_EMPTY_IPC = True +_TOPIC_SCORE_TOPIC_ID = 1.0 +_TOPIC_SCORE_SUBFIELD = 0.7 +_TOPIC_SCORE_COMPATIBLE_FIELD = 0.3 +# Section/class are excluded from retrieval; subclass is allowed but weaker. _SEARCHABLE_IPC_LEVELS = frozenset({"subgroup", "group", "subclass"}) +_EXCLUDED_IPC_LEVELS = frozenset({"section", "class"}) +# Level weighting is applied once in reverse_lookup (_LEVEL_WEIGHTS). +# Cluster mass uses those scores as-is — no second level discount here. +_IPC_LEVEL_RANK = {"subgroup": 3, "group": 2, "subclass": 1} # Soft field overlap for natural-science / engineering patent domains. _SOFT_MATCH_FIELD_NAMES = frozenset( { @@ -133,100 +166,301 @@ _TEXT_STOPWORDS = frozenset( ) +@dataclass +class IpcSubclassCluster: + """Aggregated IPC evidence for one topic/keyword × subclass.""" + + topic_key: str + subclass: str + mass: float + relative_mass: float = 0.0 + members: list[IpcCodeMatch] = field(default_factory=list) + + @property + def best_match(self) -> IpcCodeMatch: + return max( + self.members, + key=lambda match: ( + _IPC_LEVEL_RANK.get(match.ipc_level, 0), + match.match_score, + ), + ) + + +@dataclass(frozen=True) +class IpcClusterSelection: + topic_key: str + subclass: str + cluster_mass: float + relative_mass: float + match: IpcCodeMatch + reason: str + + def _ipc_section(symbol: str) -> str: normalized = normalize_symbol(symbol) return normalized[:1] if normalized else "" -def _dominant_ipc_sections(ipc_matches: list[IpcCodeMatch], limit: int = 2) -> set[str]: - weights: dict[str, float] = {} +def _evidence_weight(match: IpcCodeMatch) -> float: + """Cluster mass uses reverse-lookup scores (already level-weighted once).""" + return match.match_score + + +def _subclass_key(symbol: str) -> str | None: + normalized = normalize_symbol(symbol) + if not normalized: + return None + return infer_subclass(normalized) + + +def _usable_ipc_matches(ipc_matches: list[IpcCodeMatch]) -> list[IpcCodeMatch]: + """Keep only real subgroup/group/subclass matches above the score floor.""" + usable: list[IpcCodeMatch] = [] for match in ipc_matches: - section = _ipc_section(match.ipc_symbol) - if not section: + if match.ipc_level in _EXCLUDED_IPC_LEVELS: continue - weights[section] = weights.get(section, 0.0) + match.match_score - ranked = sorted(weights.items(), key=lambda item: item[1], reverse=True) - return {section for section, _ in ranked[:limit]} - - -def _prefer_searchable_ipc_levels(ipc_matches: list[IpcCodeMatch]) -> list[IpcCodeMatch]: - searchable = [ - match for match in ipc_matches if match.ipc_level in _SEARCHABLE_IPC_LEVELS - ] - return searchable if searchable else ipc_matches - - -def _filter_ipc_matches_for_search(ipc_matches: list[IpcCodeMatch]) -> list[IpcCodeMatch]: - if not ipc_matches: - return [] - - ipc_matches = _prefer_searchable_ipc_levels(ipc_matches) - ranked = sorted(ipc_matches, key=lambda match: match.match_score, reverse=True) - strong = [ - match - for match in ranked - if match.match_score >= _MIN_IPC_MATCH_SCORE - ] - if not strong: - return [] - - dominant_sections = _dominant_ipc_sections(strong) - filtered: list[IpcCodeMatch] = [] - seen: set[tuple[str, str]] = set() - for match in strong: - key = (match.ipc_level, match.ipc_symbol) - if key in seen: + if match.ipc_level not in _SEARCHABLE_IPC_LEVELS: continue - if match.match_score >= 0.8: - filtered.append(match) - seen.add(key) + if match.match_score < _MIN_IPC_MATCH_SCORE: continue - if _ipc_section(match.ipc_symbol) in dominant_sections: - filtered.append(match) - seen.add(key) - - return filtered + if _subclass_key(match.ipc_symbol) is None: + continue + usable.append(match) + return usable -def _limit_matches_per_keyword( +def _aggregate_subclass_clusters( + topic_key: str, matches: list[IpcCodeMatch], - limit: int = _MAX_IPC_CODES_PER_KEYWORD, -) -> list[IpcCodeMatch]: - grouped: dict[str, list[IpcCodeMatch]] = {} +) -> list[IpcSubclassCluster]: + buckets: dict[str, IpcSubclassCluster] = {} for match in matches: - grouped.setdefault(match.source_keyword.casefold(), []).append(match) + subclass = _subclass_key(match.ipc_symbol) + if not subclass: + continue + cluster = buckets.get(subclass) + if cluster is None: + cluster = IpcSubclassCluster(topic_key=topic_key, subclass=subclass, mass=0.0) + buckets[subclass] = cluster + cluster.mass += _evidence_weight(match) + cluster.members.append(match) - result: list[IpcCodeMatch] = [] - for keyword_matches in grouped.values(): - keyword_matches.sort(key=lambda match: match.match_score, reverse=True) - result.extend(keyword_matches[:limit]) + clusters = list(buckets.values()) + total_mass = sum(cluster.mass for cluster in clusters) + if total_mass <= 0: + return [] + for cluster in clusters: + cluster.relative_mass = cluster.mass / total_mass + return sorted(clusters, key=lambda item: item.mass, reverse=True) - return sorted(result, key=lambda match: match.match_score, reverse=True) + +def _select_dominant_clusters( + clusters: list[IpcSubclassCluster], +) -> list[tuple[IpcSubclassCluster, str]]: + """Pick dominant subclass clusters by relative mass / clear leadership. + + Fragmented distributions (many similarly weak clusters) return empty — + the caller should treat that as ``uncertain`` IPC evidence. + """ + if not clusters: + return [] + + if len(clusters) == 1: + return [(clusters[0], "sole_cluster_evidence")] + + selected: list[tuple[IpcSubclassCluster, str]] = [] + cumulative = 0.0 + + for cluster in clusters: + if len(selected) >= _MAX_CLUSTERS_PER_TOPIC: + break + + if cluster.relative_mass >= _MIN_CLUSTER_RELATIVE_MASS: + selected.append((cluster, "dominant_relative_mass")) + cumulative += cluster.relative_mass + continue + + if ( + selected + and cumulative < _TARGET_CUMULATIVE_CLUSTER_MASS + and cluster.relative_mass >= _MIN_CLUSTER_TAIL_MASS + ): + selected.append((cluster, "cumulative_mass_tail")) + cumulative += cluster.relative_mass + continue + + if selected: + break + + if not selected: + leader = clusters[0] + runner_up = clusters[1] + if ( + leader.relative_mass >= _MIN_LEADER_RELATIVE_MASS + and leader.mass >= runner_up.mass * _MIN_LEADER_MASS_RATIO + ): + selected.append((leader, "mass_leader_with_gap")) + + # No fragmented_top_mass fallback: weak/flat distributions stay empty. + return selected + + +def _select_ipc_matches_for_topic( + topic_key: str, + matches: list[IpcCodeMatch], +) -> list[IpcClusterSelection]: + usable = _usable_ipc_matches(matches) + clusters = _aggregate_subclass_clusters(topic_key, usable) + selected_clusters = _select_dominant_clusters(clusters) + + if not selected_clusters and clusters: + top = clusters[0] + logger.info( + "IPC cluster uncertain: topic=%s clusters=%d top_subclass=%s " + "top_relative_mass=%.4f top_cluster_mass=%.4f reason=fragmented_uncertain", + topic_key, + len(clusters), + top.subclass, + top.relative_mass, + top.mass, + ) + + selections: list[IpcClusterSelection] = [] + for cluster, reason in selected_clusters: + best = cluster.best_match + selections.append( + IpcClusterSelection( + topic_key=topic_key, + subclass=cluster.subclass, + cluster_mass=round(cluster.mass, 4), + relative_mass=round(cluster.relative_mass, 4), + match=best, + reason=reason, + ) + ) + return selections + + +def _topic_group_key(match: IpcCodeMatch) -> str: + """Group by OpenAlex topic_id when present; else fall back to keyword.""" + return _match_topic_group_key(match.topic_id, match.source_keyword) + + +def _group_matches_by_topic( + ipc_matches: list[IpcCodeMatch], +) -> dict[str, list[IpcCodeMatch]]: + grouped: dict[str, list[IpcCodeMatch]] = {} + for match in ipc_matches: + key = _topic_group_key(match) + grouped.setdefault(key, []).append(match) + return grouped + + +def select_ipc_matches_by_cluster_mass( + ipc_matches: list[IpcCodeMatch], +) -> tuple[list[IpcCodeMatch], list[IpcClusterSelection]]: + """Data-driven IPC selection from real patents_openalex_keywords matches. + + Evidence is aggregated per topic_id (or keyword) × subclass, then dominant + clusters are chosen by relative mass / leadership gap. Fragmented evidence + yields an empty selection (uncertain) — no synthetic IPC codes. + """ + selections: list[IpcClusterSelection] = [] + for topic_key, topic_matches in _group_matches_by_topic(ipc_matches).items(): + topic_selections = _select_ipc_matches_for_topic(topic_key, topic_matches) + for selection in topic_selections[:_MAX_IPC_CODES_PER_KEYWORD]: + selections.append(selection) + logger.info( + "IPC cluster selected: topic=%s subclass=%s level=%s symbol=%s " + "score=%.4f cluster_mass=%.4f relative_mass=%.4f reason=%s", + selection.topic_key, + selection.subclass, + selection.match.ipc_level, + selection.match.ipc_symbol, + selection.match.match_score, + selection.cluster_mass, + selection.relative_mass, + selection.reason, + ) + + # Merge across topics: keep best real match per symbol. + best_by_symbol: dict[str, IpcCodeMatch] = {} + for selection in selections: + symbol = normalize_symbol(selection.match.ipc_symbol) + existing = best_by_symbol.get(symbol) + if existing is None or selection.match.match_score > existing.match_score: + best_by_symbol[symbol] = selection.match + + selected_matches = sorted( + best_by_symbol.values(), + key=lambda match: ( + _IPC_LEVEL_RANK.get(match.ipc_level, 0), + match.match_score, + ), + reverse=True, + ) + return selected_matches, selections + + +def _preferred_retrieval_symbols(match: IpcCodeMatch) -> list[str]: + """Prefer specific real symbols (subgroup/group) over broad subclass alone.""" + symbol = normalize_symbol(match.ipc_symbol) + if not symbol: + return [] + + ordered: list[str] = [] + if match.ipc_level in {"subgroup", "group"}: + # Keep the concrete matched symbol first for query expansion. + ordered.append(symbol) + parsed = parse_ipc_symbol(symbol) + if parsed is not None and parsed.main_group: + main_group = normalize_symbol(parsed.main_group) + if main_group and main_group not in ordered: + ordered.append(main_group) + + subclass = _subclass_key(symbol) + if subclass and subclass not in ordered: + ordered.append(subclass) + return ordered def _term_from_ipc_match(match: IpcCodeMatch) -> str | None: - symbol = normalize_symbol(match.ipc_symbol) - if not symbol: - return None - - return infer_subclass(symbol) + """Derive subclass prefix from a real match (used by tests / helpers).""" + return _subclass_key(match.ipc_symbol) def _patent_search_terms(ipc_matches: list[IpcCodeMatch]) -> list[str]: - filtered = _filter_ipc_matches_for_search(ipc_matches) - filtered = sorted(filtered, key=lambda match: match.match_score, reverse=True) + """Build EPO/USPTO search symbols from selected real matches. + + Subgroup/group matches contribute their concrete symbols (and main-group) + before the broader subclass prefix. Nothing is injected without mapping + evidence. Query builders expand these via ``_search_terms_for_symbol``. + """ + ranked = sorted( + ipc_matches, + key=lambda match: ( + _IPC_LEVEL_RANK.get(match.ipc_level, 0), + match.match_score, + ), + reverse=True, + ) terms: list[str] = [] seen: set[str] = set() - for match in filtered: + for match in ranked: if match.ipc_level not in _SEARCHABLE_IPC_LEVELS: continue - term = _term_from_ipc_match(match) - if not term or term in seen: - continue - seen.add(term) - terms.append(term) - if len(terms) >= _MAX_PATENT_SEARCH_TERMS: - break + for symbol in _preferred_retrieval_symbols(match): + # Only keep symbols that expand to usable ES match terms. + expanded = _search_terms_for_symbol(symbol) + if not expanded: + continue + if symbol in seen: + continue + seen.add(symbol) + terms.append(symbol) + if len(terms) >= _MAX_PATENT_SEARCH_TERMS: + return terms return terms @@ -344,14 +578,6 @@ def _normalized_field_name(name: str | None) -> str: return (name or "").strip().casefold() -def _patent_has_g06_code(patent: model.PatentEntry) -> bool: - for code in (*patent.ipc, *patent.cpc): - symbol = normalize_symbol(extract_ipc_symbol(code) or code) - if symbol.startswith("G06"): - return True - return False - - def _compatible_patent_fields(keyword_field: str) -> frozenset[str]: return _COMPATIBLE_FIELDS.get(keyword_field, frozenset({keyword_field})) @@ -379,23 +605,27 @@ def _keyword_overlap_criteria( ) -def _topics_overlap_keywords( +@dataclass(frozen=True) +class TopicEvidence: + match_kind: str + score: float + + +@dataclass(frozen=True) +class TextGateDecision: + accepted: bool + reason: str + + +def _compute_topic_evidence( patent_topics: list[MappedOpenAlexTopic], keyword_topic_ids: frozenset[str], keyword_subfield_names: frozenset[str], keyword_soft_field_names: frozenset[str], - *, - patent: model.PatentEntry | None = None, -) -> bool: - if ( - not keyword_topic_ids - and not keyword_subfield_names - and not keyword_soft_field_names - ): - return True - +) -> TopicEvidence: + """Graded topic overlap used for ranking (field is weak signal only).""" if not patent_topics: - return False + return TopicEvidence(match_kind="none", score=0.0) patent_topic_ids = { topic_id @@ -403,7 +633,7 @@ def _topics_overlap_keywords( if (topic_id := normalize_openalex_id(mapped.topic_id)) } if keyword_topic_ids & patent_topic_ids: - return True + return TopicEvidence(match_kind="topic_id", score=_TOPIC_SCORE_TOPIC_ID) patent_subfield_names = { (mapped.subfield_name or "").strip().casefold() @@ -411,7 +641,7 @@ def _topics_overlap_keywords( if (mapped.subfield_name or "").strip() } if keyword_subfield_names & patent_subfield_names: - return True + return TopicEvidence(match_kind="subfield", score=_TOPIC_SCORE_SUBFIELD) if keyword_soft_field_names: patent_field_names = { @@ -421,17 +651,64 @@ def _topics_overlap_keywords( } for keyword_field in keyword_soft_field_names: if patent_field_names & _compatible_patent_fields(keyword_field): - return True - if ( - patent is not None - and _patent_has_g06_code(patent) - and keyword_soft_field_names & {"engineering", "computer science"} - ): - return True + return TopicEvidence( + match_kind="compatible_field", + score=_TOPIC_SCORE_COMPATIBLE_FIELD, + ) + return TopicEvidence(match_kind="none", score=0.0) + + +def _topics_overlap_keywords( + patent_topics: list[MappedOpenAlexTopic], + keyword_topic_ids: frozenset[str], + keyword_subfield_names: frozenset[str], + keyword_soft_field_names: frozenset[str], + *, + patent: model.PatentEntry | None = None, +) -> bool: + """True when any graded topic signal is present (including weak field).""" + _ = patent + if ( + not keyword_topic_ids + and not keyword_subfield_names + and not keyword_soft_field_names + ): + return True + return ( + _compute_topic_evidence( + patent_topics, + keyword_topic_ids, + keyword_subfield_names, + keyword_soft_field_names, + ).score + > 0.0 + ) + + +def _topic_passes_relevance_gate(topic_evidence: TopicEvidence) -> bool: + """Compatible field alone must not pass the gate — only ranking signal.""" + return topic_evidence.match_kind in {"topic_id", "subfield"} + + +def _tokenize_words(text: str) -> list[str]: + return re.findall(r"[a-z0-9äöüß]+", (text or "").casefold()) + + +def _contains_token_sequence(haystack: list[str], needle: list[str]) -> bool: + if not needle or len(needle) > len(haystack): + return False + width = len(needle) + for index in range(len(haystack) - width + 1): + if haystack[index : index + width] == needle: + return True return False +def _token_set(tokens: list[str]) -> set[str]: + return set(tokens) + + def _text_search_terms(items: list[KeywordPatentSearchItem]) -> list[str]: terms: list[str] = [] seen: set[str] = set() @@ -442,14 +719,8 @@ def _text_search_terms(items: list[KeywordPatentSearchItem]) -> list[str]: item.topic_display_name, item.subfield_name, ): - normalized = (value or "").strip().casefold() - if not normalized: - continue - - words = re.findall(r"[a-zäöüß]{4,}", normalized) - - for word in words: - if word in _TEXT_STOPWORDS or word in seen: + for word in _tokenize_words(value or ""): + if len(word) < 4 or word in _TEXT_STOPWORDS or word in seen: continue seen.add(word) terms.append(word) @@ -457,23 +728,210 @@ def _text_search_terms(items: list[KeywordPatentSearchItem]) -> list[str]: return terms +def _text_search_phrases(items: list[KeywordPatentSearchItem]) -> list[str]: + """Full phrases for ES title/abstract retrieval (text path).""" + phrases: list[str] = [] + seen: set[str] = set() + for item in items: + for value in (item.keyword, item.topic_display_name): + cleaned = " ".join((value or "").strip().split()) + if len(cleaned) < 3: + continue + key = cleaned.casefold() + if key in seen: + continue + seen.add(key) + phrases.append(cleaned) + return phrases + + def _text_overlap_score( patent: model.PatentEntry, search_terms: list[str], ) -> float: - text = " ".join( - part - for part in [patent.title or "", patent.abstract or ""] - if part - ).casefold() - - if not search_terms or not text.strip(): + tokens = _token_set( + _tokenize_words( + " ".join( + part + for part in [patent.title or "", patent.abstract or ""] + if part + ) + ) + ) + if not search_terms or not tokens: return 0.0 - hits = sum(1 for term in search_terms if term in text) + hits = sum(1 for term in search_terms if term in tokens) return min(hits / 3, 1.0) +def _text_match_kind( + *, + phrase_in_title: bool, + phrase_in_abstract: bool, + full_token_match: bool, + partial_token_match: bool, +) -> str: + if phrase_in_title: + return "phrase_title" + if phrase_in_abstract: + return "phrase_abstract" + if full_token_match: + return "full_token" + if partial_token_match: + return "partial_token" + return "none" + + +def _collect_keyword_text_evidence( + patent: model.PatentEntry, + phrases: list[str], + search_terms: list[str], +) -> KeywordEvidence: + """Record phrase / full-token / partial-token evidence separately.""" + title_tokens = _tokenize_words(patent.title or "") + abstract_tokens = _tokenize_words(patent.abstract or "") + combined_tokens = _token_set(title_tokens + abstract_tokens) + + phrase_in_title = False + phrase_in_abstract = False + full_token_match = False + partial_token_match = False + matched_phrases: list[str] = [] + + for phrase in phrases: + phrase_tokens = _tokenize_words(phrase) + if not phrase_tokens: + continue + if _contains_token_sequence(title_tokens, phrase_tokens): + phrase_in_title = True + matched_phrases.append(phrase) + elif _contains_token_sequence(abstract_tokens, phrase_tokens): + phrase_in_abstract = True + matched_phrases.append(phrase) + + present = [token for token in phrase_tokens if token in combined_tokens] + if present and len(present) == len(phrase_tokens): + full_token_match = True + elif present: + partial_token_match = True + + matched_words = [term for term in search_terms if term in combined_tokens] + if matched_words and not full_token_match and not partial_token_match: + # Lone search-term hits without a covering phrase count as partial. + partial_token_match = True + + word_match_score = ( + min(len(matched_words) / 3, 1.0) if search_terms and matched_words else 0.0 + ) + kind = _text_match_kind( + phrase_in_title=phrase_in_title, + phrase_in_abstract=phrase_in_abstract, + full_token_match=full_token_match, + partial_token_match=partial_token_match, + ) + + return KeywordEvidence( + phrase_in_title=phrase_in_title, + phrase_in_abstract=phrase_in_abstract, + full_token_match=full_token_match, + partial_token_match=partial_token_match, + word_match_score=round(word_match_score, 4), + matched_phrases=list(dict.fromkeys(matched_phrases)), + matched_words=matched_words, + text_match_kind=kind, + ) + + +def _keyword_text_score(evidence: KeywordEvidence) -> float: + if evidence.phrase_in_title: + return 1.0 + if evidence.phrase_in_abstract: + return 0.85 + if evidence.full_token_match: + return 0.55 + if evidence.partial_token_match: + return 0.25 + return 0.0 + + +def _exact_topic_or_subfield_match( + patent_topics: list[MappedOpenAlexTopic], + keyword_topic_ids: frozenset[str], + keyword_subfield_names: frozenset[str], +) -> bool: + evidence = _compute_topic_evidence( + patent_topics, + keyword_topic_ids, + keyword_subfield_names, + frozenset(), + ) + return evidence.match_kind in {"topic_id", "subfield"} + + +def _keyword_text_passes_relevance_gate( + evidence: KeywordEvidence, + *, + topic_evidence: TopicEvidence, +) -> TextGateDecision: + """Keyword text acceptance policy (no domain hardcoding). + + Accept: + - phrase in title (strong) + - phrase in abstract (medium) + - exact topic/subfield together with full token text evidence + Reject: + - partial/general words alone + - compatible field alone + - exact topic/subfield without text evidence + """ + exact = topic_evidence.match_kind in {"topic_id", "subfield"} + + if evidence.phrase_in_title: + return TextGateDecision(True, "phrase_in_title") + if evidence.phrase_in_abstract: + return TextGateDecision(True, "phrase_in_abstract") + if exact and evidence.full_token_match: + return TextGateDecision( + True, + f"{topic_evidence.match_kind}_with_full_token_match", + ) + if exact and evidence.partial_token_match: + return TextGateDecision(False, "exact_topic_with_partial_tokens_only") + if exact: + return TextGateDecision(False, "exact_topic_without_text") + if topic_evidence.match_kind == "compatible_field": + return TextGateDecision(False, "compatible_field_only") + if evidence.partial_token_match or evidence.matched_words: + return TextGateDecision(False, "partial_or_loose_words_only") + return TextGateDecision(False, "insufficient_evidence") + + +def _matched_keyword_labels_from_evidence( + items: list[KeywordPatentSearchItem], + evidence: KeywordEvidence, +) -> list[str]: + matched: list[str] = [] + seen: set[str] = set() + phrase_keys = {phrase.casefold() for phrase in evidence.matched_phrases} + word_keys = set(evidence.matched_words) + + for item in items: + for value in (item.keyword, item.topic_display_name): + label = (value or "").strip() + if not label: + continue + key = label.casefold() + if key in seen: + continue + label_tokens = _tokenize_words(label) + if key in phrase_keys or any(token in word_keys for token in label_tokens): + seen.add(key) + matched.append(label) + break + return matched + + def _patent_passes_relevance_gate( patent_topics: list[MappedOpenAlexTopic], *, @@ -483,14 +941,14 @@ def _patent_passes_relevance_gate( patent: model.PatentEntry, text_score: float, ) -> bool: - has_topic_match = bool(patent_topics) and _topics_overlap_keywords( + _ = patent + topic_evidence = _compute_topic_evidence( patent_topics, keyword_topic_ids, keyword_subfield_names, keyword_soft_field_names, - patent=patent, ) - return has_topic_match or text_score > 0.0 + return _topic_passes_relevance_gate(topic_evidence) or text_score > 0.0 def _normalize_score_weights( @@ -599,26 +1057,407 @@ def _score_patent( _text_search_terms(search_keywords), ) - has_topic_match = bool(patent_topics) and _topics_overlap_keywords( + topic_evidence = _compute_topic_evidence( patent_topics or [], keyword_topic_ids or frozenset(), keyword_subfield_names or frozenset(), keyword_soft_field_names or frozenset(), - patent=patent, ) - if not has_topic_match and text_score == 0.0: + if not _topic_passes_relevance_gate(topic_evidence) and text_score == 0.0: return None - topic_score = 1.0 if has_topic_match else 0.0 - return ( - _compute_final_score(ipc_score, topic_score, text_score), + _compute_final_score(ipc_score, topic_evidence.score, text_score), matched_keywords, matched_symbols, ) +async def _fetch_patents_for_queries( + client: BasePatentSearchClient, + epo_query: dict, + uspto_query: dict, +) -> list[model.PatentEntry] | None: + """Run EPO+USPTO search. Returns None on configuration/transport failure.""" + try: + epo_data, uspto_data = await asyncio.gather( + client.search_epo(epo_query), + client.search_uspto(uspto_query), + ) + except MissingApiKeyError: + logger.warning("Patent search skipped: Elasticsearch API key not configured.") + return None + except httpx.HTTPError as exc: + logger.warning("Patent search failed: %s", exc) + return None + + return deduplicate_patents(parse_epo_hits(epo_data) + parse_uspto_hits(uspto_data)) + + +def _cluster_selection_dicts( + selections: list[IpcClusterSelection], +) -> list[dict]: + return [ + { + "topic_key": selection.topic_key, + "subclass": selection.subclass, + "symbol": selection.match.ipc_symbol, + "level": selection.match.ipc_level, + "match_score": selection.match.match_score, + "cluster_mass": selection.cluster_mass, + "relative_mass": selection.relative_mass, + "reason": selection.reason, + } + for selection in selections + ] + + +def _empty_diagnostics( + *, + search_path: str = "none", + ipc_cluster_selections: list[dict] | None = None, +) -> KeywordPatentSearchDiagnostics: + return KeywordPatentSearchDiagnostics( + search_path=search_path, + es_query_size_per_index=_MAX_PATENTS, + max_patents_cap=_MAX_PATENTS, + ipc_cluster_selections=list(ipc_cluster_selections or []), + ) + + +def _finalize_scored_patents( + scored: list[KeywordPatentMatch], + *, + raw_count: int, + filtered_by_ipc: int, + filtered_by_relevance_gate: int, + filtered_by_min_score: int, + passed_relevance_gate: int, + search_path: str, + ipc_cluster_selections: list[dict] | None = None, +) -> tuple[list[KeywordPatentMatch], KeywordPatentSearchDiagnostics]: + scored_before_cap = len(scored) + scored.sort( + key=lambda item: ( + item.match_score, + item.patent.publication_date or "", + item.patent.patent_id, + ), + reverse=True, + ) + returned = scored[:_MAX_PATENTS] + diagnostics = KeywordPatentSearchDiagnostics( + search_path=search_path, + es_query_size_per_index=_MAX_PATENTS, + raw_patents_after_dedupe=raw_count, + filtered_by_ipc=filtered_by_ipc, + filtered_by_relevance_gate=filtered_by_relevance_gate, + filtered_by_min_score=filtered_by_min_score, + passed_relevance_gate=passed_relevance_gate, + scored_before_cap=scored_before_cap, + returned=len(returned), + max_patents_cap=_MAX_PATENTS, + hit_return_cap=scored_before_cap >= _MAX_PATENTS, + ipc_cluster_selections=list(ipc_cluster_selections or []), + ) + return returned, diagnostics + + +async def _score_patents_with_ipc( + *, + raw_patents: list[model.PatentEntry], + ipc_matches: list[IpcCodeMatch], + text_search_terms: list[str], + keyword_topic_ids: frozenset[str], + keyword_subfield_names: frozenset[str], + keyword_soft_field_names: frozenset[str], + resolver: PatentOpenAlexMappingResolver, +) -> tuple[list[KeywordPatentMatch], dict[str, int]]: + patent_topics_by_key = await resolver.resolve_topics_for_patents(raw_patents) + scored: list[KeywordPatentMatch] = [] + filtered_by_ipc = 0 + filtered_by_relevance_gate = 0 + filtered_by_min_score = 0 + passed_relevance_gate = 0 + + for patent in raw_patents: + patent_topics = patent_topics_by_key.get(patent_map_key(patent), []) + ipc_result = _score_ipc_match(patent, ipc_matches) + if ipc_result is None: + filtered_by_ipc += 1 + continue + ipc_score, matched_keywords, matched_symbols = ipc_result + + topic_evidence = _compute_topic_evidence( + patent_topics, + keyword_topic_ids, + keyword_subfield_names, + keyword_soft_field_names, + ) + text_score = _text_overlap_score(patent, text_search_terms) + if not _topic_passes_relevance_gate(topic_evidence) and text_score == 0.0: + filtered_by_relevance_gate += 1 + logger.info( + "IPC path reject: id=%s topic_kind=%s topic_score=%.2f " + "text_score=%.2f reason=field_or_none_without_text", + patent.patent_id, + topic_evidence.match_kind, + topic_evidence.score, + text_score, + ) + continue + + passed_relevance_gate += 1 + score = _compute_final_score(ipc_score, topic_evidence.score, text_score) + if score < _MIN_PATENT_MATCH_SCORE: + filtered_by_min_score += 1 + continue + + logger.info( + "IPC path accept: id=%s topic_kind=%s topic_score=%.2f " + "text_score=%.2f final_score=%.4f", + patent.patent_id, + topic_evidence.match_kind, + topic_evidence.score, + text_score, + score, + ) + scored.append( + KeywordPatentMatch( + patent=patent, + match_score=score, + ipc_score=ipc_score, + topic_score=topic_evidence.score, + text_score=text_score, + matched_keywords=matched_keywords, + matched_ipc_symbols=matched_symbols, + text_retrieval=False, + topic_match_kind=topic_evidence.match_kind, + ) + ) + + logger.info( + "Keyword patent search: filtered_by_ipc=%d filtered_by_relevance_gate=%d " + "filtered_by_min_score=%d passed_relevance_gate=%d scored=%d", + filtered_by_ipc, + filtered_by_relevance_gate, + filtered_by_min_score, + passed_relevance_gate, + len(scored), + ) + return scored, { + "filtered_by_ipc": filtered_by_ipc, + "filtered_by_relevance_gate": filtered_by_relevance_gate, + "filtered_by_min_score": filtered_by_min_score, + "passed_relevance_gate": passed_relevance_gate, + } + + +async def _score_patents_text_search( + *, + raw_patents: list[model.PatentEntry], + search_keywords: list[KeywordPatentSearchItem], + phrases: list[str], + text_search_terms: list[str], + keyword_topic_ids: frozenset[str], + keyword_subfield_names: frozenset[str], + keyword_soft_field_names: frozenset[str], + resolver: PatentOpenAlexMappingResolver, +) -> tuple[list[KeywordPatentMatch], dict[str, int]]: + """Score patents without IPC using graded topic + structured text evidence.""" + patent_topics_by_key = await resolver.resolve_topics_for_patents(raw_patents) + scored: list[KeywordPatentMatch] = [] + filtered_by_relevance_gate = 0 + filtered_by_min_score = 0 + passed_relevance_gate = 0 + + for patent in raw_patents: + patent_topics = patent_topics_by_key.get(patent_map_key(patent), []) + evidence = _collect_keyword_text_evidence(patent, phrases, text_search_terms) + topic_evidence = _compute_topic_evidence( + patent_topics, + keyword_topic_ids, + keyword_subfield_names, + keyword_soft_field_names, + ) + decision = _keyword_text_passes_relevance_gate( + evidence, + topic_evidence=topic_evidence, + ) + if not decision.accepted: + filtered_by_relevance_gate += 1 + logger.info( + "Text reject: id=%s title=%s topic_kind=%s topic_score=%.2f " + "text_kind=%s phrase_title=%s phrase_abstract=%s " + "full_token=%s partial_token=%s reason=%s", + patent.patent_id, + patent.title, + topic_evidence.match_kind, + topic_evidence.score, + evidence.text_match_kind, + evidence.phrase_in_title, + evidence.phrase_in_abstract, + evidence.full_token_match, + evidence.partial_token_match, + decision.reason, + ) + continue + + passed_relevance_gate += 1 + text_score = _keyword_text_score(evidence) + # Field-only remains a weak ranking signal when already accepted via phrase. + score = _compute_final_score( + 0.0, + topic_evidence.score, + text_score, + weights=_TEXT_SCORE_WEIGHTS, + ) + if score < _MIN_TEXT_PATENT_MATCH_SCORE: + filtered_by_min_score += 1 + logger.info( + "Text reject: id=%s reason=below_min_score score=%.4f", + patent.patent_id, + score, + ) + continue + + logger.info( + "Text accept: id=%s title=%s topic_kind=%s topic_score=%.2f " + "text_kind=%s text_score=%.2f final_score=%.4f reason=%s", + patent.patent_id, + patent.title, + topic_evidence.match_kind, + topic_evidence.score, + evidence.text_match_kind, + text_score, + score, + decision.reason, + ) + scored.append( + KeywordPatentMatch( + patent=patent, + match_score=score, + ipc_score=0.0, + topic_score=topic_evidence.score, + text_score=text_score, + matched_keywords=_matched_keyword_labels_from_evidence( + search_keywords, + evidence, + ), + matched_ipc_symbols=[], + text_retrieval=True, + keyword_evidence=evidence, + topic_match_kind=topic_evidence.match_kind, + ) + ) + + logger.info( + "Keyword patent text search: filtered_by_relevance_gate=%d " + "filtered_by_min_score=%d passed_relevance_gate=%d scored=%d", + filtered_by_relevance_gate, + filtered_by_min_score, + passed_relevance_gate, + len(scored), + ) + return scored, { + "filtered_by_relevance_gate": filtered_by_relevance_gate, + "filtered_by_min_score": filtered_by_min_score, + "passed_relevance_gate": passed_relevance_gate, + } + + +async def _search_patents_text_search( + *, + client: BasePatentSearchClient, + queries: IpcPatentSearchQueries, + ipc_search: IpcSearchClient, + resolver: PatentOpenAlexMappingResolver, + search_keywords: list[KeywordPatentSearchItem], + keyword_topic_ids: frozenset[str], + keyword_subfield_names: frozenset[str], + keyword_soft_field_names: frozenset[str], + mapping_status: KeywordPatentMappingStatus, + ipc_cluster_selections: list[dict] | None = None, +) -> PatentsByKeywordsResponse: + cluster_dicts = list(ipc_cluster_selections or []) + phrases = _text_search_phrases(search_keywords) + text_search_terms = _text_search_terms(search_keywords) + if not phrases: + logger.info( + "Keyword patent text search: no phrases for keywords %s", + [item.keyword for item in search_keywords], + ) + return PatentsByKeywordsResponse( + patent_count=0, + patents=[], + mapping_status="no_patents_found", + diagnostics=_empty_diagnostics( + search_path="text", + ipc_cluster_selections=cluster_dicts, + ), + ) + + logger.info( + "Keyword patent text search: mapping_status=%s phrases=%s", + mapping_status, + phrases, + ) + raw_patents = await _fetch_patents_for_queries( + client, + queries.epo_query_by_text_phrases(phrases, size=_MAX_PATENTS), + queries.uspto_query_by_text_phrases(phrases, size=_MAX_PATENTS), + ) + if raw_patents is None: + return PatentsByKeywordsResponse( + patent_count=0, + patents=[], + mapping_status="search_error", + diagnostics=_empty_diagnostics( + search_path="text", + ipc_cluster_selections=cluster_dicts, + ), + ) + + logger.info("Keyword patent text search: raw_patents=%d", len(raw_patents)) + scored, filter_counts = await _score_patents_text_search( + raw_patents=raw_patents, + search_keywords=search_keywords, + phrases=phrases, + text_search_terms=text_search_terms, + keyword_topic_ids=keyword_topic_ids, + keyword_subfield_names=keyword_subfield_names, + keyword_soft_field_names=keyword_soft_field_names, + resolver=resolver, + ) + scored, diagnostics = _finalize_scored_patents( + scored, + raw_count=len(raw_patents), + filtered_by_ipc=0, + filtered_by_relevance_gate=filter_counts["filtered_by_relevance_gate"], + filtered_by_min_score=filter_counts["filtered_by_min_score"], + passed_relevance_gate=filter_counts["passed_relevance_gate"], + search_path="text", + ipc_cluster_selections=cluster_dicts, + ) + await enrich_patents_classifications([item.patent for item in scored], ipc_search) + + if not scored: + return PatentsByKeywordsResponse( + patent_count=0, + patents=[], + mapping_status="no_patents_found", + diagnostics=diagnostics, + ) + + return PatentsByKeywordsResponse( + patent_count=len(scored), + patents=scored, + mapping_status=mapping_status, + diagnostics=diagnostics, + ) + + async def get_patents_by_keywords( request: PatentsByKeywordsRequest, *, @@ -639,7 +1478,12 @@ async def get_patents_by_keywords( "Keyword patent search: no searchable keywords in %s", [item.keyword for item in request.keywords], ) - return PatentsByKeywordsResponse(patent_count=0, patents=[]) + return PatentsByKeywordsResponse( + patent_count=0, + patents=[], + mapping_status="no_mapping", + diagnostics=_empty_diagnostics(search_path="none"), + ) logger.info( "Keyword patent search: using keywords=%s (from %d requested)", @@ -658,152 +1502,116 @@ async def get_patents_by_keywords( _keyword_overlap_criteria(search_keywords) ) - ipc_matches = await lookup.lookup_ipc_codes( + raw_ipc_matches = await lookup.lookup_ipc_codes( search_keywords, - max_codes=_MAX_IPC_CODES, + max_codes=_MAX_IPC_LOOKUP_CANDIDATES, ) - ipc_matches = _filter_ipc_matches_for_search(ipc_matches) - ipc_matches = _limit_matches_per_keyword(ipc_matches) + had_usable_mapping = bool(_usable_ipc_matches(raw_ipc_matches)) + ipc_matches, cluster_selections = select_ipc_matches_by_cluster_mass(raw_ipc_matches) + cluster_dicts = _cluster_selection_dicts(cluster_selections) logger.info( - "Keyword patent search: search_keywords=%s ipc_matches=%s", + "Keyword patent search: search_keywords=%s selected_ipc=%s", [item.keyword for item in search_keywords], - [ - { - "symbol": match.ipc_symbol, - "level": match.ipc_level, - "score": match.match_score, - "keyword": match.source_keyword, - } - for match in ipc_matches - ], + cluster_dicts, ) - if not ipc_matches: - logger.info( - "Keyword patent search: no IPC codes after filtering for keywords %s", - [item.keyword for item in search_keywords], - ) - return PatentsByKeywordsResponse(patent_count=0, patents=[]) - symbols = _patent_search_terms(ipc_matches) + if not symbols: + mapping_status: KeywordPatentMappingStatus = ( + "uncertain" if had_usable_mapping else "no_mapping" + ) + logger.info( + "Keyword patent search: no IPC search terms for keywords %s " + "(mapping_status=%s) — trying keyword text search", + [item.keyword for item in search_keywords], + mapping_status, + ) + return await _search_patents_text_search( + client=client, + queries=queries, + ipc_search=ipc_search, + resolver=resolver, + search_keywords=search_keywords, + keyword_topic_ids=keyword_topic_ids, + keyword_subfield_names=keyword_subfield_names, + keyword_soft_field_names=keyword_soft_field_names, + mapping_status=mapping_status, + ipc_cluster_selections=cluster_dicts, + ) + text_search_terms = _text_search_terms(search_keywords) logger.info("Keyword patent search: patent_search_terms=%s", symbols) - if not symbols: - return PatentsByKeywordsResponse(patent_count=0, patents=[]) - try: - epo_data, uspto_data = await asyncio.gather( - client.search_epo( - queries.epo_query_by_ipc_symbols(symbols, size=_MAX_PATENTS) - ), - client.search_uspto( - queries.uspto_query_by_ipc_symbols(symbols, size=_MAX_PATENTS) - ), - ) - except MissingApiKeyError: - logger.warning("Patent search skipped: Elasticsearch API key not configured.") - return PatentsByKeywordsResponse(patent_count=0, patents=[]) - except httpx.HTTPError as exc: - logger.warning("Patent search failed: %s", exc) - return PatentsByKeywordsResponse(patent_count=0, patents=[]) - - raw_patents = deduplicate_patents( - parse_epo_hits(epo_data) + parse_uspto_hits(uspto_data) + raw_patents = await _fetch_patents_for_queries( + client, + queries.epo_query_by_ipc_symbols(symbols, size=_MAX_PATENTS), + queries.uspto_query_by_ipc_symbols(symbols, size=_MAX_PATENTS), ) + if raw_patents is None: + return PatentsByKeywordsResponse( + patent_count=0, + patents=[], + mapping_status="search_error", + diagnostics=_empty_diagnostics( + search_path="ipc", + ipc_cluster_selections=cluster_dicts, + ), + ) + logger.info("Keyword patent search: raw_patents=%d", len(raw_patents)) - patent_topics_by_key = await resolver.resolve_topics_for_patents(raw_patents) + scored, filter_counts = await _score_patents_with_ipc( + raw_patents=raw_patents, + ipc_matches=ipc_matches, + text_search_terms=text_search_terms, + keyword_topic_ids=keyword_topic_ids, + keyword_subfield_names=keyword_subfield_names, + keyword_soft_field_names=keyword_soft_field_names, + resolver=resolver, + ) + scored, diagnostics = _finalize_scored_patents( + scored, + raw_count=len(raw_patents), + filtered_by_ipc=filter_counts["filtered_by_ipc"], + filtered_by_relevance_gate=filter_counts["filtered_by_relevance_gate"], + filtered_by_min_score=filter_counts["filtered_by_min_score"], + passed_relevance_gate=filter_counts["passed_relevance_gate"], + search_path="ipc", + ipc_cluster_selections=cluster_dicts, + ) - scored: list[KeywordPatentMatch] = [] - filtered_by_ipc = 0 - filtered_by_relevance_gate = 0 - filtered_by_min_score = 0 - for patent in raw_patents: - patent_topics = patent_topics_by_key.get(patent_map_key(patent), []) - ipc_result = _score_ipc_match(patent, ipc_matches) - if ipc_result is None: - filtered_by_ipc += 1 - continue - ipc_score, matched_keywords, matched_symbols = ipc_result - - has_topic_match = bool(patent_topics) and _topics_overlap_keywords( - patent_topics, - keyword_topic_ids, - keyword_subfield_names, - keyword_soft_field_names, - patent=patent, + if scored: + await enrich_patents_classifications([item.patent for item in scored], ipc_search) + return PatentsByKeywordsResponse( + patent_count=len(scored), + patents=scored, + mapping_status="mapped", + diagnostics=diagnostics, ) - text_score = _text_overlap_score(patent, text_search_terms) - - if not has_topic_match and text_score == 0.0: - filtered_by_relevance_gate += 1 - continue - - topic_score = 1.0 if has_topic_match else 0.0 - - score = _compute_final_score(ipc_score, topic_score, text_score) - if score < _MIN_PATENT_MATCH_SCORE: - filtered_by_min_score += 1 - continue - - hierarchy_levels = sorted( - { - level - for symbol in matched_symbols - for code in (*patent.ipc, *patent.cpc) - if (level := _ipc_hierarchy_level(code, symbol)) - } - ) - logger.info( - "Patent candidate: id=%s title=%s ipc_score=%.4f " - "topic_score=%.4f text_score=%.4f final_score=%.4f " - "hierarchy_levels=%s matched_keywords=%s matched_symbols=%s", - patent.patent_id, - patent.title, - ipc_score, - topic_score, - text_score, - score, - hierarchy_levels, - matched_keywords, - matched_symbols, - ) - scored.append( - KeywordPatentMatch( - patent=patent, - match_score=score, - ipc_score=ipc_score, - topic_score=topic_score, - text_score=text_score, - matched_keywords=matched_keywords, - matched_ipc_symbols=matched_symbols, - ) + if not _TEXT_SEARCH_AFTER_EMPTY_IPC: + return PatentsByKeywordsResponse( + patent_count=0, + patents=[], + mapping_status="no_patents_found", + diagnostics=diagnostics, ) logger.info( - "Keyword patent search: filtered_by_ipc=%d filtered_by_relevance_gate=%d " - "filtered_by_min_score=%d final_patents=%d", - filtered_by_ipc, - filtered_by_relevance_gate, - filtered_by_min_score, - len(scored), + "Keyword patent search: IPC path yielded no scored patents — " + "trying keyword text search (policy=_TEXT_SEARCH_AFTER_EMPTY_IPC)" ) - - scored.sort( - key=lambda item: ( - item.match_score, - item.patent.publication_date or "", - item.patent.patent_id, - ), - reverse=True, - ) - scored = scored[:_MAX_PATENTS] - - patents = [item.patent for item in scored] - await enrich_patents_classifications(patents, ipc_search) - - return PatentsByKeywordsResponse( - patent_count=len(scored), - patents=scored, + return await _search_patents_text_search( + client=client, + queries=queries, + ipc_search=ipc_search, + resolver=resolver, + search_keywords=search_keywords, + keyword_topic_ids=keyword_topic_ids, + keyword_subfield_names=keyword_subfield_names, + keyword_soft_field_names=keyword_soft_field_names, + # IPC was selected but produced no usable hits; UI treats this like + # uncertain IPC evidence and labels patents via text_retrieval. + mapping_status="uncertain", + ipc_cluster_selections=cluster_dicts, ) diff --git a/service/src/main/inse/patents/keywords/model.py b/service/src/main/inse/patents/keywords/model.py index 56423282..978eb46b 100644 --- a/service/src/main/inse/patents/keywords/model.py +++ b/service/src/main/inse/patents/keywords/model.py @@ -1,10 +1,23 @@ -from typing import Literal +from enum import StrEnum from pydantic import BaseModel, Field from inse.patents.common.model import PatentEntry -KeywordPatentLevel = Literal["broad", "coarse", "fine", "custom"] + +class KeywordPatentLevel(StrEnum): + BROAD = "broad" + COARSE = "coarse" + FINE = "fine" + CUSTOM = "custom" + + +class KeywordPatentMappingStatus(StrEnum): + MAPPED = "mapped" + UNCERTAIN = "uncertain" + NO_MAPPING = "no_mapping" + NO_PATENTS_FOUND = "no_patents_found" + SEARCH_ERROR = "search_error" class KeywordPatentSearchItem(BaseModel): @@ -42,16 +55,86 @@ class PatentsByKeywordsRequest(BaseModel): ) +class KeywordEvidence(BaseModel): + """Traceable title/abstract evidence for keyword text retrieval.""" + + phrase_in_title: bool = False + phrase_in_abstract: bool = False + full_token_match: bool = False + partial_token_match: bool = False + word_match_score: float = 0.0 + matched_phrases: list[str] = Field(default_factory=list) + matched_words: list[str] = Field(default_factory=list) + text_match_kind: str = Field( + default="none", + description=( + "phrase_title | phrase_abstract | full_token | partial_token | none" + ), + ) + + class KeywordPatentMatch(BaseModel): patent: PatentEntry match_score: float = Field(description="Combined match quality score.") ipc_score: float = Field(description="IPC/CPC classification match score.") - topic_score: float = Field(description="OpenAlex topic overlap score (0 or 1).") + topic_score: float = Field( + description=( + "Graded OpenAlex topic overlap: 1.0 topic_id, 0.7 subfield, " + "0.3 compatible field, 0.0 none." + ), + ) text_score: float = Field(description="Title/abstract keyword overlap score.") matched_keywords: list[str] = Field(default_factory=list) matched_ipc_symbols: list[str] = Field(default_factory=list) + text_retrieval: bool = Field( + default=False, + description=( + "True when the patent was retrieved via title/abstract keyword search " + "because IPC mapping was uncertain, missing, or yielded no hits." + ), + ) + keyword_evidence: KeywordEvidence | None = Field( + default=None, + description="Structured text evidence when text_retrieval is true.", + ) + topic_match_kind: str | None = Field( + default=None, + description="topic_id | subfield | compatible_field | none", + ) + + +class KeywordPatentSearchDiagnostics(BaseModel): + """Pipeline counters for evaluation (no effect on ranking thresholds).""" + + search_path: str = Field( + description="ipc | text | none", + ) + es_query_size_per_index: int = 0 + raw_patents_after_dedupe: int = 0 + filtered_by_ipc: int = 0 + filtered_by_relevance_gate: int = 0 + filtered_by_min_score: int = 0 + passed_relevance_gate: int = 0 + scored_before_cap: int = 0 + returned: int = 0 + max_patents_cap: int = 0 + hit_return_cap: bool = False + ipc_cluster_selections: list[dict] = Field(default_factory=list) class PatentsByKeywordsResponse(BaseModel): patent_count: int patents: list[KeywordPatentMatch] + mapping_status: KeywordPatentMappingStatus = Field( + description=( + "IPC mapping outcome: mapped (IPC used), uncertain (fragmented evidence; " + "may include text-retrieved patents), no_mapping (no usable IPC evidence; " + "may include text-retrieved patents), no_patents_found (neither IPC nor " + "keyword text search produced relevant patents), or search_error (technical " + "failure talking to the search backend)." + ), + ) + diagnostics: KeywordPatentSearchDiagnostics | None = Field( + default=None, + description="Optional search-pipeline counters for evaluation/debugging.", + ) diff --git a/service/src/main/inse/patents/keywords/reverse_lookup.py b/service/src/main/inse/patents/keywords/reverse_lookup.py index 60806eba..5f29b445 100644 --- a/service/src/main/inse/patents/keywords/reverse_lookup.py +++ b/service/src/main/inse/patents/keywords/reverse_lookup.py @@ -24,10 +24,11 @@ logger = logging.getLogger(__name__) _LEVEL_WEIGHTS = { "subgroup": 1.0, "group": 0.92, - "subclass": 0.85, - "class": 0.75, - "section": 0.6, + # Subclass is allowed but clearly weaker than group/subgroup. + "subclass": 0.70, + # Section/class are excluded from keyword→patent retrieval. } +_EXCLUDED_IPC_LEVELS = frozenset({"section", "class"}) @dataclass(frozen=True) @@ -37,6 +38,7 @@ class IpcCodeMatch: match_score: float source_keyword: str match_type: str + topic_id: str | None = None def _keyword_variants(keyword: str) -> list[str]: @@ -83,7 +85,11 @@ def _weighted_score( relevance_score 0.0 while still mapping to valid OpenAlex topics. """ _ = relevance_score - level_weight = _LEVEL_WEIGHTS.get(ipc_level, 0.7) + if ipc_level in _EXCLUDED_IPC_LEVELS: + return 0.0 + level_weight = _LEVEL_WEIGHTS.get(ipc_level) + if level_weight is None: + return 0.0 return round(base_score * level_weight, 4) @@ -138,15 +144,46 @@ def clear_reverse_lookup_caches() -> None: _build_json_inverted_index.cache_clear() +def _item_topic_id(item: KeywordPatentSearchItem) -> str | None: + variants = _topic_id_variants_for_item(item) + if not variants: + return None + for variant in variants: + short = normalize_openalex_id(variant) + if short: + return short + return variants[0] + + +def _topic_group_key(topic_id: str | None, source_keyword: str = "") -> str: + """Stable topic bucket for evidence; must stay aligned with cluster grouping.""" + if topic_id: + short = normalize_openalex_id(topic_id) + return short or topic_id.strip() + keyword = (source_keyword or "").strip() + return f"keyword:{keyword.casefold() or 'unknown'}" + + def _merge_ipc_match( - matches: dict[tuple[str, str], IpcCodeMatch], + matches: dict[tuple[str, str, str], IpcCodeMatch], level: str, symbol: str, score: float, source_keyword: str, match_type: str, + topic_id: str | None = None, ) -> None: - key = (level, normalize_symbol(symbol)) + """Merge by topic × level × symbol so evidence for distinct topics is preserved. + + Global symbol collapse happens only after per-topic cluster selection. + """ + if level in _EXCLUDED_IPC_LEVELS or score <= 0: + return + key = ( + _topic_group_key(topic_id, source_keyword), + level, + normalize_symbol(symbol), + ) existing = matches.get(key) if existing is None or score > existing.match_score: matches[key] = IpcCodeMatch( @@ -155,6 +192,7 @@ def _merge_ipc_match( match_score=score, source_keyword=source_keyword, match_type=match_type, + topic_id=topic_id, ) @@ -166,10 +204,13 @@ def _matches_from_doc( ipc_symbol = normalize_symbol(str(doc.get("ipc_symbol") or "")) if not ipc_level or not ipc_symbol: return [] + if ipc_level in _EXCLUDED_IPC_LEVELS: + return [] keyword_variants = set(_keyword_variants(item.keyword)) topic_variants = set(_topic_id_variants_for_item(item)) topic_name = (item.topic_display_name or "").strip().casefold() + topic_id = _item_topic_id(item) found: list[IpcCodeMatch] = [] for match in doc.get("keyword_matches") or []: @@ -183,6 +224,8 @@ def _matches_from_doc( float(match.get("match_score") or 0.0), item.relevance_score, ) + if score <= 0: + break found.append( IpcCodeMatch( ipc_level=ipc_level, @@ -190,6 +233,7 @@ def _matches_from_doc( match_score=score, source_keyword=item.keyword, match_type="keyword", + topic_id=topic_id, ) ) break @@ -206,6 +250,8 @@ def _matches_from_doc( float(match.get("match_score") or 0.0), item.relevance_score, ) + if score <= 0: + break found.append( IpcCodeMatch( ipc_level=ipc_level, @@ -213,6 +259,7 @@ def _matches_from_doc( match_score=score, source_keyword=item.keyword, match_type="topic", + topic_id=topic_id, ) ) break @@ -222,15 +269,22 @@ def _matches_from_doc( def _json_lookup(items: list[KeywordPatentSearchItem]) -> list[IpcCodeMatch]: by_keyword, by_topic = _build_json_inverted_index() - merged: dict[tuple[str, str], IpcCodeMatch] = {} + merged: dict[tuple[str, str, str], IpcCodeMatch] = {} for item in items: + topic_id = _item_topic_id(item) for level, symbol, base_score, source_keyword, match_type in by_keyword.get( item.keyword.strip().casefold(), [] ): score = _weighted_score(level, base_score, item.relevance_score) _merge_ipc_match( - merged, level, symbol, score, item.keyword, match_type + merged, + level, + symbol, + score, + item.keyword, + match_type, + topic_id=topic_id, ) for variant in _topic_id_variants_for_item(item): @@ -239,14 +293,20 @@ def _json_lookup(items: list[KeywordPatentSearchItem]) -> list[IpcCodeMatch]: ): score = _weighted_score(level, base_score, item.relevance_score) _merge_ipc_match( - merged, level, symbol, score, item.keyword, match_type + merged, + level, + symbol, + score, + item.keyword, + match_type, + topic_id=topic_id, ) return sorted(merged.values(), key=lambda match: match.match_score, reverse=True) def _dedupe_ipc_matches(matches: list[IpcCodeMatch]) -> list[IpcCodeMatch]: - merged: dict[tuple[str, str], IpcCodeMatch] = {} + merged: dict[tuple[str, str, str], IpcCodeMatch] = {} for match in matches: _merge_ipc_match( merged, @@ -255,6 +315,7 @@ def _dedupe_ipc_matches(matches: list[IpcCodeMatch]) -> list[IpcCodeMatch]: match.match_score, match.source_keyword, match.match_type, + topic_id=match.topic_id, ) return sorted(merged.values(), key=lambda match: match.match_score, reverse=True) @@ -336,8 +397,13 @@ class KeywordIpcReverseLookup: self, items: list[KeywordPatentSearchItem], *, - max_codes: int = 40, + max_codes: int | None = 200, ) -> list[IpcCodeMatch]: + """Return mapping candidates for downstream cluster selection. + + ``max_codes`` caps raw candidates *after* dedupe. Pass a high value (or + ``None``) so relative cluster mass is not distorted by early truncation. + """ if not items: return [] @@ -360,6 +426,8 @@ class KeywordIpcReverseLookup: ) matches = _dedupe_ipc_matches(matches) + if max_codes is None: + return matches return matches[:max_codes] async def _lookup_via_elasticsearch( @@ -394,7 +462,7 @@ class KeywordIpcReverseLookup: response.raise_for_status() data = response.json() - merged: dict[tuple[str, str], IpcCodeMatch] = {} + merged: dict[tuple[str, str, str], IpcCodeMatch] = {} for hit in data.get("hits", {}).get("hits", []): doc = hit.get("_source", {}) for item in items: @@ -406,6 +474,7 @@ class KeywordIpcReverseLookup: match.match_score, match.source_keyword, match.match_type, + topic_id=match.topic_id, ) return sorted(merged.values(), key=lambda match: match.match_score, reverse=True) diff --git a/service/src/main/inse/patents/keywords/search_queries.py b/service/src/main/inse/patents/keywords/search_queries.py index 86a3ce9b..02139697 100644 --- a/service/src/main/inse/patents/keywords/search_queries.py +++ b/service/src/main/inse/patents/keywords/search_queries.py @@ -4,7 +4,7 @@ from __future__ import annotations from typing import Any from inse.patents.common.elastic_search_client import DEFAULT_SEARCH_SIZE -from inse.patents.ipc_lookup import parse_ipc_symbol +from inse.patents.ipc_lookup import display_ipc_symbol, parse_ipc_symbol from inse.patents.patents_openalex_keywords.ipc_entries import infer_subclass, normalize_symbol _PATENT_SOURCE_FIELDS = [ @@ -43,60 +43,201 @@ _USPTO_SOURCE_FIELDS = [ ] _MIN_MATCH_TERM_LEN = 4 +_MIN_TEXT_PHRASE_LEN = 3 + +# Prefer concrete group/subgroup hits over broad subclass prefixes. +_BOOST_SUBGROUP = 4.0 +_BOOST_MAIN_GROUP = 2.5 +_BOOST_SUBCLASS = 1.0 + +# Text search: prefer exact phrases in title over abstract / loose match. +_BOOST_TEXT_PHRASE_TITLE = 5.0 +_BOOST_TEXT_PHRASE_ABSTRACT = 3.0 +_BOOST_TEXT_MATCH_TITLE = 1.5 +_BOOST_TEXT_MATCH_ABSTRACT = 1.0 -def _search_terms_for_symbol(symbol: str) -> list[str]: - """Derive EPO/USPTO `match` terms from an IPC/CPC symbol. +def _add_term_boost(weights: dict[str, float], term: str, boost: float) -> None: + cleaned = term.strip() + if len(cleaned) < _MIN_MATCH_TERM_LEN: + return + weights[cleaned] = max(weights.get(cleaned, 0.0), boost) + + +def _weighted_search_terms_for_symbol(symbol: str) -> dict[str, float]: + """Derive EPO/USPTO `match` terms with specificity boosts. Patent indices store IPC values like ``B60L 53/14 20060101AFI...``. Wildcard/prefix on normalized symbols (``B60L*``) does not match; ``match`` - on subclass codes (``B60L``) does. + on subclass / group tokens does. Concrete group/subgroup terms are boosted + above broad subclass prefixes. """ normalized = normalize_symbol(symbol) if not normalized: - return [] - - terms: list[str] = [] - subclass = infer_subclass(normalized) - if subclass and len(subclass) >= _MIN_MATCH_TERM_LEN: - terms.append(subclass) + return {} + weights: dict[str, float] = {} keys = parse_ipc_symbol(normalized) + subclass = infer_subclass(normalized) + if not subclass and keys is not None and keys.subclass: + subclass = normalize_symbol(keys.subclass) + + def add_symbol_forms(value: str | None, boost: float) -> None: + if not value: + return + norm = normalize_symbol(value) + if not norm: + return + _add_term_boost(weights, norm, boost) + display = display_ipc_symbol(norm) + if display and display != norm: + _add_term_boost(weights, display, boost) + if keys is not None: - if keys.subclass and len(keys.subclass) >= _MIN_MATCH_TERM_LEN: - terms.append(normalize_symbol(keys.subclass)) - if keys.main_group and len(normalize_symbol(keys.main_group)) >= _MIN_MATCH_TERM_LEN: - terms.append(normalize_symbol(keys.main_group)) + if keys.subgroup: + add_symbol_forms(keys.subgroup, _BOOST_SUBGROUP) + if keys.main_group: + main_group = normalize_symbol(keys.main_group) + # Short subgroup digits are folded into main_group by the parser + # (e.g. C07C243/08) — treat those leaf symbols as subgroup-level. + if keys.subgroup is None and "/" in main_group: + add_symbol_forms(main_group, _BOOST_SUBGROUP) + else: + add_symbol_forms(main_group, _BOOST_MAIN_GROUP) - if len(normalized) >= _MIN_MATCH_TERM_LEN: - prefix = normalized[:_MIN_MATCH_TERM_LEN] - if prefix not in terms: - terms.append(prefix) + if subclass: + add_symbol_forms(subclass, _BOOST_SUBCLASS) + elif len(normalized) >= _MIN_MATCH_TERM_LEN: + _add_term_boost(weights, normalized[:_MIN_MATCH_TERM_LEN], _BOOST_SUBCLASS) - return list(dict.fromkeys(term for term in terms if len(term) >= _MIN_MATCH_TERM_LEN)) + return weights -def _ipc_match_clauses(field: str, terms: list[str]) -> list[dict[str, Any]]: +def _search_terms_for_symbol(symbol: str) -> list[str]: + """Derive EPO/USPTO `match` terms from an IPC/CPC symbol (boost order).""" + weights = _weighted_search_terms_for_symbol(symbol) + return [ + term + for term, _boost in sorted( + weights.items(), + key=lambda item: (-item[1], -len(item[0]), item[0]), + ) + ] + + +def _merge_term_boosts(symbols: list[str]) -> dict[str, float]: + merged: dict[str, float] = {} + for symbol in symbols: + for term, boost in _weighted_search_terms_for_symbol(symbol).items(): + merged[term] = max(merged.get(term, 0.0), boost) + return merged + + +def _ipc_match_clauses(field: str, term_boosts: dict[str, float]) -> list[dict[str, Any]]: clauses: list[dict[str, Any]] = [] - seen: set[tuple[str, str]] = set() - for term in terms: + for term, boost in sorted( + term_boosts.items(), + key=lambda item: (-item[1], -len(item[0]), item[0]), + ): if len(term) < _MIN_MATCH_TERM_LEN: continue - key = (field, term) + clauses.append( + { + "match": { + field: { + "query": term, + "boost": boost, + } + } + } + ) + return clauses + + +def _normalize_text_phrases(phrases: list[str]) -> list[str]: + cleaned: list[str] = [] + seen: set[str] = set() + for phrase in phrases: + value = " ".join((phrase or "").strip().split()) + if len(value) < _MIN_TEXT_PHRASE_LEN: + continue + key = value.casefold() if key in seen: continue seen.add(key) - clauses.append({"match": {field: term}}) + cleaned.append(value) + return cleaned + + +def _text_match_clauses( + phrases: list[str], + *, + title_fields: tuple[str, ...], + abstract_field: str, +) -> list[dict[str, Any]]: + """Build title/abstract should-clauses with phrase boosts over loose match.""" + clauses: list[dict[str, Any]] = [] + for phrase in _normalize_text_phrases(phrases): + for field in title_fields: + clauses.append( + { + "match_phrase": { + field: { + "query": phrase, + "boost": _BOOST_TEXT_PHRASE_TITLE, + } + } + } + ) + clauses.append( + { + "match": { + field: { + "query": phrase, + "operator": "and", + "boost": _BOOST_TEXT_MATCH_TITLE, + } + } + } + ) + clauses.append( + { + "match_phrase": { + abstract_field: { + "query": phrase, + "boost": _BOOST_TEXT_PHRASE_ABSTRACT, + } + } + } + ) + clauses.append( + { + "match": { + abstract_field: { + "query": phrase, + "operator": "and", + "boost": _BOOST_TEXT_MATCH_ABSTRACT, + } + } + } + ) return clauses class IpcPatentSearchQueries: def epo_query_by_ipc_terms( self, - terms: list[str], + terms: list[str] | dict[str, float], size: int = DEFAULT_SEARCH_SIZE, ) -> dict[str, Any]: - should = _ipc_match_clauses("ipc", terms) + _ipc_match_clauses("cpc", terms) + term_boosts = ( + terms + if isinstance(terms, dict) + else {term: _BOOST_SUBCLASS for term in terms} + ) + should = _ipc_match_clauses("ipc", term_boosts) + _ipc_match_clauses( + "cpc", term_boosts + ) query: dict[str, Any] = ( {"match_none": {}} if not should @@ -106,8 +247,8 @@ class IpcPatentSearchQueries: "size": size, "track_total_hits": True, "sort": [ + {"_score": {"order": "desc"}}, {"date_publication": {"order": "desc", "missing": "_last"}}, - "_doc", ], "_source": _PATENT_SOURCE_FIELDS, "query": query, @@ -115,10 +256,17 @@ class IpcPatentSearchQueries: def uspto_query_by_ipc_terms( self, - terms: list[str], + terms: list[str] | dict[str, float], size: int = DEFAULT_SEARCH_SIZE, ) -> dict[str, Any]: - should = _ipc_match_clauses("ipcr", terms) + _ipc_match_clauses("cpc", terms) + term_boosts = ( + terms + if isinstance(terms, dict) + else {term: _BOOST_SUBCLASS for term in terms} + ) + should = _ipc_match_clauses("ipcr", term_boosts) + _ipc_match_clauses( + "cpc", term_boosts + ) query: dict[str, Any] = ( {"match_none": {}} if not should @@ -128,8 +276,8 @@ class IpcPatentSearchQueries: "size": size, "track_total_hits": True, "sort": [ + {"_score": {"order": "desc"}}, {"publication_date": {"order": "desc", "missing": "_last"}}, - "_doc", ], "_source": _USPTO_SOURCE_FIELDS, "query": query, @@ -140,27 +288,63 @@ class IpcPatentSearchQueries: symbols: list[str], size: int = DEFAULT_SEARCH_SIZE, ) -> dict[str, Any]: - terms: list[str] = [] - seen: set[str] = set() - for symbol in symbols: - for term in _search_terms_for_symbol(symbol): - if term in seen: - continue - seen.add(term) - terms.append(term) - return self.epo_query_by_ipc_terms(terms, size=size) + return self.epo_query_by_ipc_terms(_merge_term_boosts(symbols), size=size) def uspto_query_by_ipc_symbols( self, symbols: list[str], size: int = DEFAULT_SEARCH_SIZE, ) -> dict[str, Any]: - terms: list[str] = [] - seen: set[str] = set() - for symbol in symbols: - for term in _search_terms_for_symbol(symbol): - if term in seen: - continue - seen.add(term) - terms.append(term) - return self.uspto_query_by_ipc_terms(terms, size=size) + return self.uspto_query_by_ipc_terms(_merge_term_boosts(symbols), size=size) + + def epo_query_by_text_phrases( + self, + phrases: list[str], + size: int = DEFAULT_SEARCH_SIZE, + ) -> dict[str, Any]: + should = _text_match_clauses( + phrases, + title_fields=("title_en", "title_de"), + abstract_field="abstract", + ) + query: dict[str, Any] = ( + {"match_none": {}} + if not should + else {"bool": {"should": should, "minimum_should_match": 1}} + ) + return { + "size": size, + "track_total_hits": True, + "sort": [ + {"_score": {"order": "desc"}}, + {"date_publication": {"order": "desc", "missing": "_last"}}, + ], + "_source": _PATENT_SOURCE_FIELDS, + "query": query, + } + + def uspto_query_by_text_phrases( + self, + phrases: list[str], + size: int = DEFAULT_SEARCH_SIZE, + ) -> dict[str, Any]: + should = _text_match_clauses( + phrases, + title_fields=("title",), + abstract_field="abstract", + ) + query: dict[str, Any] = ( + {"match_none": {}} + if not should + else {"bool": {"should": should, "minimum_should_match": 1}} + ) + return { + "size": size, + "track_total_hits": True, + "sort": [ + {"_score": {"order": "desc"}}, + {"publication_date": {"order": "desc", "missing": "_last"}}, + ], + "_source": _USPTO_SOURCE_FIELDS, + "query": query, + } diff --git a/service/src/main/inse/patents/keywords/test_eval_metrics.py b/service/src/main/inse/patents/keywords/test_eval_metrics.py new file mode 100644 index 00000000..c996c649 --- /dev/null +++ b/service/src/main/inse/patents/keywords/test_eval_metrics.py @@ -0,0 +1,74 @@ +"""Unit tests for keyword → patent evaluation metrics.""" +from __future__ import annotations + +from inse.patents.keywords.eval_metrics import ( + analyze_family_duplicates_in_top_k, + average_precision, + ipc_prefix_hit_rate, + mrr, + ndcg_at_k, + precision_at_k, + recall_at_k, + unique_family_precision_at_k, +) + + +def test_precision_at_k() -> None: + ranked = ["EP1", "EP2", "EP3", "EP4"] + relevant = ["EP2", "EP9"] + assert precision_at_k(ranked, relevant, 2) == 0.5 + assert precision_at_k(ranked, relevant, 4) == 0.25 + + +def test_recall_at_k() -> None: + ranked = ["EP1", "EP2", "EP3"] + relevant = ["EP2", "EP9"] + assert recall_at_k(ranked, relevant, 2) == 0.5 + assert recall_at_k(ranked, relevant, 3) == 0.5 + + +def test_average_precision() -> None: + ranked = ["EP1", "EP2", "EP3"] + relevant = ["EP2", "EP3"] + # hit@2 → 1/2, hit@3 → 2/3 → AP = (0.5 + 0.666...) / 2 + assert abs(average_precision(ranked, relevant) - ((0.5 + 2 / 3) / 2)) < 1e-9 + + +def test_ndcg_at_k() -> None: + ranked = ["EP1", "EP2", "EP3"] + grades = {"EP2": 2.0, "EP3": 1.0} + score = ndcg_at_k(ranked, grades, 3) + assert 0.0 < score < 1.0 + + +def test_mrr() -> None: + assert mrr(["EP1", "EP2", "EP3"], ["EP3"]) == 1 / 3 + assert mrr(["EP1", "EP2"], ["EP9"]) == 0.0 + + +def test_ipc_prefix_hit_rate() -> None: + ipc_lists = [ + ["C07C243/08"], + ["H01L21/02"], + ["C07D401/00", "A61K31/00"], + ] + assert ipc_prefix_hit_rate(ipc_lists, ["C07"], k=3) == 2 / 3 + assert ipc_prefix_hit_rate(ipc_lists, ["C07"], k=1) == 1.0 + + +def test_unique_family_precision_at_k() -> None: + ranked = ["EP1", "EP2", "EP3", "EP4"] + family_keys = ["app:1", "app:1", "app:2", "app:3"] + relevant = ["EP1", "EP2", "EP4"] + # top-3: EP1 relevant (family app:1), EP2 dup family skip, EP3 miss -> 1/3 + assert unique_family_precision_at_k(ranked, family_keys, relevant, 3) == 1 / 3 + # top-4: EP1 hit, EP2 skip, EP3 miss, EP4 hit -> 2/4 + assert unique_family_precision_at_k(ranked, family_keys, relevant, 4) == 0.5 + + +def test_analyze_family_duplicates_in_top_k() -> None: + keys = ["app:1", "app:1", "app:2", "title:foo"] + stats = analyze_family_duplicates_in_top_k(keys, 4) + assert stats["unique_families"] == 3 + assert stats["duplicate_entries"] == 1 + assert stats["duplicate_groups"][0]["count"] == 2 diff --git a/service/src/main/inse/patents/keywords/test_logic.py b/service/src/main/inse/patents/keywords/test_logic.py index 0a6af63c..b6f14912 100644 --- a/service/src/main/inse/patents/keywords/test_logic.py +++ b/service/src/main/inse/patents/keywords/test_logic.py @@ -4,32 +4,49 @@ from __future__ import annotations import asyncio from unittest.mock import AsyncMock, patch +import httpx + from inse.patents.authors.ipc_openalex_mapping import MappedOpenAlexTopic from inse.patents.common import model from inse.patents.keywords.logic import ( + TopicEvidence, _compute_final_score, + _compute_topic_evidence, + _collect_keyword_text_evidence, + _exact_topic_or_subfield_match, + _keyword_text_passes_relevance_gate, + _keyword_text_score, _filter_keywords_for_patent_search, _ipc_hierarchy_quality, _keyword_is_patent_searchable, - _limit_matches_per_keyword, _patent_passes_relevance_gate, _patent_search_terms, _score_ipc_match, _score_patent, + _select_dominant_clusters, + _aggregate_subclass_clusters, _term_from_ipc_match, _text_overlap_score, _text_search_terms, + _topic_passes_relevance_gate, _topics_overlap_keywords, + _usable_ipc_matches, get_patents_by_keywords, + select_ipc_matches_by_cluster_mass, ) from inse.patents.keywords.reverse_lookup import ( IpcCodeMatch, + _dedupe_ipc_matches, _json_lookup, _weighted_score, clear_reverse_lookup_caches, ) from inse.patents.keywords.model import KeywordPatentSearchItem, PatentsByKeywordsRequest -from inse.patents.keywords.search_queries import IpcPatentSearchQueries, _search_terms_for_symbol +from inse.patents.keywords.search_queries import ( + IpcPatentSearchQueries, + _search_terms_for_symbol, + _weighted_search_terms_for_symbol, +) def test_ipc_hierarchy_quality_exact_match() -> None: @@ -74,7 +91,166 @@ def test_patent_search_terms_deduplicates_chemistry_subclasses() -> None: IpcCodeMatch("subgroup", "B01J2219/00709", 0.8679, "Organische Chemie", "keyword"), ] terms = _patent_search_terms(ipc_matches) - assert terms == ["C25B", "C07C", "C09B", "D06L", "C02F", "B01J"] + assert "C25B3/03" in terms + assert "C07C243/08" in terms + assert "C09B68/48" in terms + assert terms.count("C09B68/48") == 1 + + +def test_usable_ipc_matches_excludes_section_and_class() -> None: + matches = [ + IpcCodeMatch("section", "C", 0.99, "Topic", "topic"), + IpcCodeMatch("class", "C07", 0.95, "Topic", "topic"), + IpcCodeMatch("subclass", "C07C", 0.80, "Topic", "topic"), + IpcCodeMatch("subgroup", "C07C243/08", 0.88, "Topic", "topic"), + ] + usable = _usable_ipc_matches(matches) + levels = {match.ipc_level for match in usable} + assert "section" not in levels + assert "class" not in levels + assert levels <= {"subclass", "group", "subgroup"} + + +def test_cluster_mass_prefers_dense_subclass_over_single_outlier() -> None: + """Many related subgroups in one subclass beat one high-score foreign outlier.""" + matches = [ + IpcCodeMatch("subgroup", "G01Q60/36", 0.95, "Robotics", "topic"), + IpcCodeMatch("subgroup", "B25J9/16", 0.78, "Robotics", "topic"), + IpcCodeMatch("subgroup", "B25J13/08", 0.76, "Robotics", "topic"), + IpcCodeMatch("subgroup", "B25J19/02", 0.74, "Robotics", "topic"), + IpcCodeMatch("group", "B25J9", 0.72, "Robotics", "topic"), + ] + selected, selections = select_ipc_matches_by_cluster_mass(matches) + by_subclass = {selection.subclass: selection for selection in selections} + assert "B25J" in by_subclass + g01q = by_subclass.get("G01Q") + assert g01q is None or by_subclass["B25J"].cluster_mass > g01q.cluster_mass + assert by_subclass["B25J"].relative_mass == max(s.relative_mass for s in selections) + assert selected + assert all(match.match_type != "domain_preference" for match in selected) + + +def test_cluster_selection_works_for_unseen_battery_topic() -> None: + matches = [ + IpcCodeMatch("subgroup", "H01M10/052", 0.88, "Battery technology", "topic", "TBAT"), + IpcCodeMatch("subgroup", "H01M4/58", 0.84, "Battery technology", "topic", "TBAT"), + IpcCodeMatch("subgroup", "H01M10/44", 0.80, "Battery technology", "topic", "TBAT"), + IpcCodeMatch("subgroup", "G01R31/36", 0.79, "Battery technology", "topic", "TBAT"), + ] + selected, selections = select_ipc_matches_by_cluster_mass(matches) + assert selections + assert {s.topic_key for s in selections} == {"TBAT"} + assert all(s.cluster_mass > 0 for s in selections) + assert all(s.reason for s in selections) + terms = _patent_search_terms(selected) + assert terms + assert any(term.startswith("H01M") for term in terms) + + +def test_cluster_selection_works_for_unseen_quantum_topic() -> None: + matches = [ + IpcCodeMatch("subgroup", "G06N10/00", 0.86, "Quantum computing", "topic", "TQ"), + IpcCodeMatch("subgroup", "G06N10/40", 0.83, "Quantum computing", "topic", "TQ"), + IpcCodeMatch("subclass", "G06N", 0.70, "Quantum computing", "topic", "TQ"), + IpcCodeMatch("subgroup", "H01L39/22", 0.75, "Quantum computing", "topic", "TQ"), + ] + selected, selections = select_ipc_matches_by_cluster_mass(matches) + assert selections + g06n = next(s for s in selections if s.subclass == "G06N") + assert g06n.relative_mass > 0 + assert all(m.ipc_level != "class" for m in selected) + assert "domain_preference" not in {m.match_type for m in selected} + + +def test_search_terms_prefer_specific_subgroup_symbol() -> None: + matches = [ + IpcCodeMatch("subgroup", "G06N3/08", 0.84, "Neural nets", "topic", "TNN"), + ] + terms = _patent_search_terms(matches) + assert terms[0] == "G06N3/08" + assert "G06N" in terms + + +def test_no_synthetic_matches_when_mapping_has_single_family() -> None: + """Sole concentrated family is accepted; nothing else is invented.""" + matches = [ + IpcCodeMatch("subgroup", "C12Q1/68", 0.92, "Unknown Topic X", "topic", "TX"), + ] + selected, selections = select_ipc_matches_by_cluster_mass(matches) + assert len(selections) == 1 + assert selections[0].subclass == "C12Q" + assert selections[0].reason == "sole_cluster_evidence" + assert selected[0].match_type == "topic" + terms = _patent_search_terms(selected) + assert terms[0] == "C12Q1/68" + + +def test_fragmented_weak_clusters_yield_no_ipc_selection() -> None: + """Many similarly weak subclasses must not force a fragmented pick.""" + matches = [ + IpcCodeMatch( + "subgroup", + f"A{index:02d}B1/00", + 0.70, + "Flat Topic", + "topic", + "TFLAT", + ) + for index in range(1, 16) + ] + selected, selections = select_ipc_matches_by_cluster_mass(matches) + assert selections == [] + assert selected == [] + assert _patent_search_terms(selected) == [] + + +def test_dedupe_preserves_same_symbol_for_distinct_topics() -> None: + """Identical IPC symbols for different topics must not collapse before clustering.""" + matches = [ + IpcCodeMatch("subgroup", "G06N3/08", 0.80, "Neural nets", "topic", "TNN"), + IpcCodeMatch("subgroup", "G06N3/08", 0.75, "Robotics", "topic", "TROB"), + IpcCodeMatch("subgroup", "G06N3/08", 0.90, "Neural nets", "topic", "TNN"), + ] + deduped = _dedupe_ipc_matches(matches) + by_topic = {match.topic_id: match for match in deduped} + assert set(by_topic) == {"TNN", "TROB"} + assert by_topic["TNN"].match_score == 0.90 + assert by_topic["TROB"].match_score == 0.75 + + selected, selections = select_ipc_matches_by_cluster_mass(deduped) + assert {selection.topic_key for selection in selections} == {"TNN", "TROB"} + assert len(selected) == 1 + assert selected[0].ipc_symbol == "G06N3/08" + assert selected[0].match_score == 0.90 + + +def test_aggregate_subclass_clusters_sums_scores_without_second_level_weight() -> None: + matches = [ + IpcCodeMatch("subgroup", "B60L50/50", 0.80, "EV", "topic", "TEV"), + IpcCodeMatch("subgroup", "B60L53/14", 0.80, "EV", "topic", "TEV"), + IpcCodeMatch("subclass", "B60L", 0.80, "EV", "topic", "TEV"), + ] + clusters = _aggregate_subclass_clusters("TEV", matches) + assert len(clusters) == 1 + assert clusters[0].subclass == "B60L" + assert abs(clusters[0].mass - 2.4) < 1e-9 + + +def test_dominant_clusters_skip_low_mass_tail() -> None: + clusters = _aggregate_subclass_clusters( + "Topic", + [ + IpcCodeMatch("subgroup", "A01B1/00", 0.90, "Topic", "topic"), + IpcCodeMatch("subgroup", "A01B3/00", 0.88, "Topic", "topic"), + IpcCodeMatch("subgroup", "A01B5/00", 0.86, "Topic", "topic"), + IpcCodeMatch("subgroup", "Z99Z1/00", 0.66, "Topic", "topic"), + ], + ) + selected = _select_dominant_clusters(clusters) + selected_subclasses = {cluster.subclass for cluster, _reason in selected} + assert "A01B" in selected_subclasses + # Tiny tail cluster should not be auto-selected. + assert "Z99Z" not in selected_subclasses def test_score_ipc_match_returns_only_best_evidence() -> None: @@ -148,6 +324,48 @@ def test_score_patent_uses_best_ipc_match() -> None: assert "G01S" in symbols +def test_compute_topic_evidence_is_graded() -> None: + topics = [ + MappedOpenAlexTopic( + topic_id="https://openalex.org/T999", + subfield_name="Organic Chemistry", + field_name="Chemistry", + ) + ] + exact = _compute_topic_evidence( + topics, + frozenset({"T999"}), + frozenset({"organic chemistry"}), + frozenset({"chemistry"}), + ) + assert exact.match_kind == "topic_id" + assert exact.score == 1.0 + + subfield = _compute_topic_evidence( + topics, + frozenset({"TOTHER"}), + frozenset({"organic chemistry"}), + frozenset({"chemistry"}), + ) + assert subfield.match_kind == "subfield" + assert subfield.score == 0.7 + + field_only = _compute_topic_evidence( + [ + MappedOpenAlexTopic( + topic_id="https://openalex.org/T1", + field_name="Materials Science", + ) + ], + frozenset({"TOTHER"}), + frozenset({"organic chemistry"}), + frozenset({"chemistry"}), + ) + assert field_only.match_kind == "compatible_field" + assert field_only.score == 0.3 + assert not _topic_passes_relevance_gate(field_only) + + def test_score_patent_requires_topic_overlap() -> None: patent = model.PatentEntry( patent_id="EP123", @@ -205,7 +423,45 @@ def test_score_patent_accepts_compatible_engineering_and_computer_science() -> N ) ], ) + # Compatible field alone is only a ranking signal; text evidence lets it pass. assert result is not None + score, _keywords, _symbols = result + assert score == _compute_final_score(0.9 * 0.75, 0.3, 2 / 3) + + +def test_score_patent_rejects_compatible_field_without_text() -> None: + patent = model.PatentEntry( + patent_id="EP456", + source="EPO", + ipc=["G06N 3/08"], + title="Unrelated apparatus", + abstract="No topical keywords here.", + ) + ipc_matches = [ + IpcCodeMatch("subclass", "G06N", 0.9, "Deep Learning", "keyword"), + ] + result = _score_patent( + patent, + ipc_matches, + patent_topics=[ + MappedOpenAlexTopic( + topic_id="https://openalex.org/T12072", + field_name="Computer Science", + ) + ], + keyword_topic_ids=frozenset({"T10653"}), + keyword_subfield_names=frozenset({"control and systems engineering"}), + keyword_soft_field_names=frozenset({"engineering"}), + search_keywords=[ + KeywordPatentSearchItem( + keyword="Deep Learning", + topic_id="https://openalex.org/T10653", + field_name="Engineering", + relevance_score=0.9, + ) + ], + ) + assert result is None def test_filter_keywords_for_patent_search_prefers_coarse_and_fine_over_broad() -> None: @@ -346,21 +602,20 @@ def test_topics_overlap_keywords_rejects_patents_without_topics() -> None: ) -def test_limit_matches_per_keyword() -> None: +def test_selection_is_computed_per_topic_then_merged() -> None: matches = [ - IpcCodeMatch("subclass", "C07C", 0.95, "Organic Chemistry", "keyword"), - IpcCodeMatch("group", "C07C31", 0.9, "Organic Chemistry", "keyword"), - IpcCodeMatch("subclass", "C01B", 0.88, "Inorganic Chemistry", "keyword"), - IpcCodeMatch("subclass", "C01C", 0.87, "Inorganic Chemistry", "keyword"), + IpcCodeMatch("subgroup", "C07C243/08", 0.90, "Organic A", "keyword", "TORG"), + IpcCodeMatch("subgroup", "C07C31/20", 0.88, "Organic B", "keyword", "TORG"), + IpcCodeMatch("subgroup", "C01B3/00", 0.90, "Inorganic A", "keyword", "TINORG"), + IpcCodeMatch("subgroup", "C01C1/00", 0.88, "Inorganic B", "keyword", "TINORG"), ] - limited = _limit_matches_per_keyword(matches, limit=2) - assert len(limited) == 4 - organic = [match for match in limited if match.source_keyword == "Organic Chemistry"] - inorganic = [match for match in limited if match.source_keyword == "Inorganic Chemistry"] - assert len(organic) == 2 - assert len(inorganic) == 2 - assert organic[0].ipc_symbol == "C07C" - assert inorganic[0].ipc_symbol == "C01B" + selected, selections = select_ipc_matches_by_cluster_mass(matches) + topics = {selection.topic_key for selection in selections} + assert topics == {"TORG", "TINORG"} + subclasses = {selection.subclass for selection in selections} + assert "C07C" in subclasses + assert "C01B" in subclasses or "C01C" in subclasses + assert selected def test_text_overlap_score_uses_title_and_abstract() -> None: @@ -377,6 +632,143 @@ def test_text_overlap_score_uses_title_and_abstract() -> None: assert score == 1.0 +def test_text_overlap_score_uses_word_boundaries_not_substrings() -> None: + patent = model.PatentEntry( + patent_id="EP1", + source="EPO", + title="Biochemistry overview", + abstract="Spectrochemical analysis.", + ) + # "chemistry" must not match inside "biochemistry" / "spectrochemical". + assert _text_overlap_score(patent, ["chemistry", "organic"]) == 0.0 + + +def test_fallback_rejects_mechanical_patent_for_organic_chemistry() -> None: + """Soft field / loose words must not accept a mechanical separator patent.""" + patent = model.PatentEntry( + patent_id="EP-MECH", + source="EPO", + title=( + "Rotating machine for separating materials in different " + "states of aggregation" + ), + abstract="Apparatus for mechanical separation of materials.", + ipc=["B01D45/12"], + ) + phrases = ["Organic Chemistry", "organische Chemie"] + terms = ["organic", "chemistry", "organische", "chemie"] + evidence = _collect_keyword_text_evidence(patent, phrases, terms) + + assert evidence.phrase_in_title is False + assert evidence.phrase_in_abstract is False + assert evidence.full_token_match is False + assert evidence.matched_phrases == [] + assert evidence.matched_words == [] + + field_only = TopicEvidence(match_kind="compatible_field", score=0.3) + assert not _keyword_text_passes_relevance_gate( + evidence, + topic_evidence=field_only, + ).accepted + exact = TopicEvidence(match_kind="topic_id", score=1.0) + assert not _keyword_text_passes_relevance_gate( + evidence, + topic_evidence=exact, + ).accepted + + +def test_fallback_accepts_strong_phrase_or_exact_topic_with_full_tokens() -> None: + phrase_patent = model.PatentEntry( + patent_id="EP-PHRASE", + source="EPO", + title="Process for organic chemistry synthesis", + abstract="Catalytic reactions.", + ) + phrases = ["organic chemistry"] + terms = ["organic", "chemistry"] + evidence = _collect_keyword_text_evidence(phrase_patent, phrases, terms) + assert evidence.phrase_in_title is True + assert evidence.text_match_kind == "phrase_title" + assert _keyword_text_score(evidence) == 1.0 + assert _keyword_text_passes_relevance_gate( + evidence, + topic_evidence=TopicEvidence(match_kind="none", score=0.0), + ).accepted + + full_token_patent = model.PatentEntry( + patent_id="EP-WORDS", + source="EPO", + title="Catalytic organic synthesis method", + abstract="Uses chemistry laboratory techniques.", + ) + full_evidence = _collect_keyword_text_evidence( + full_token_patent, + phrases, + terms, + ) + assert full_evidence.phrase_in_title is False + assert full_evidence.phrase_in_abstract is False + assert full_evidence.full_token_match is True + assert not _keyword_text_passes_relevance_gate( + full_evidence, + topic_evidence=TopicEvidence(match_kind="none", score=0.0), + ).accepted + assert _keyword_text_passes_relevance_gate( + full_evidence, + topic_evidence=TopicEvidence(match_kind="topic_id", score=1.0), + ).accepted + + partial_patent = model.PatentEntry( + patent_id="EP-PARTIAL", + source="EPO", + title="Organic polymer blend", + abstract="Industrial materials processing.", + ) + partial_evidence = _collect_keyword_text_evidence( + partial_patent, + phrases, + terms, + ) + assert partial_evidence.partial_token_match is True + assert partial_evidence.full_token_match is False + decision = _keyword_text_passes_relevance_gate( + partial_evidence, + topic_evidence=TopicEvidence(match_kind="topic_id", score=1.0), + ) + assert not decision.accepted + assert decision.reason == "exact_topic_with_partial_tokens_only" + + assert _exact_topic_or_subfield_match( + [ + MappedOpenAlexTopic( + topic_id="https://openalex.org/TORG", + topic_display_name="Organic Chemistry", + subfield_name="Organic Chemistry", + field_name="Chemistry", + ) + ], + frozenset({"TORG"}), + frozenset({"organic chemistry"}), + ) + + +def test_token_match_rejects_machine_inside_micromachined() -> None: + patent = model.PatentEntry( + patent_id="EP-MICRO", + source="EPO", + title="Micromachined sensor device", + abstract="Fabrication of micromachined structures.", + ) + assert _text_overlap_score(patent, ["machine", "learning"]) == 0.0 + evidence = _collect_keyword_text_evidence( + patent, + ["Machine Learning"], + ["machine", "learning"], + ) + assert evidence.matched_words == [] + assert evidence.full_token_match is False + + def test_patent_passes_relevance_gate_with_text_but_no_topics() -> None: patent = model.PatentEntry( patent_id="EP1", @@ -517,8 +909,10 @@ def test_get_patents_by_keywords_uses_symbol_queries() -> None: epo_symbols.assert_called_once() uspto_symbols.assert_called_once() - assert epo_symbols.call_args.args[0] == ["C07C"] - assert captured == ["epo", "uspto"] + assert epo_symbols.call_args.args[0][0] == "C07C243/08" + assert "C07C" in epo_symbols.call_args.args[0] + # IPC search returns empty → text fallback also queries EPO/USPTO. + assert captured == ["epo", "uspto", "epo", "uspto"] def test_text_search_terms_include_topic_metadata() -> None: @@ -541,8 +935,10 @@ def test_text_search_terms_include_topic_metadata() -> None: def test_weighted_score_applies_level_not_llm_relevance() -> None: score_high = _weighted_score("subclass", 0.8, 1.0) score_zero = _weighted_score("subclass", 0.8, 0.0) - assert score_high == round(0.8 * 0.85, 4) + assert score_high == round(0.8 * 0.70, 4) assert score_zero == score_high + assert _weighted_score("section", 0.9, 1.0) == 0.0 + assert _weighted_score("class", 0.9, 1.0) == 0.0 def test_search_terms_use_subclass_prefix() -> None: @@ -550,6 +946,233 @@ def test_search_terms_use_subclass_prefix() -> None: assert "G06N" in _search_terms_for_symbol("G06N") +def test_search_terms_include_concrete_subgroup_and_main_group() -> None: + terms = _search_terms_for_symbol("B60R2300/8086") + assert "B60R2300/8086" in terms + assert "B60R2300/80" in terms + assert "B60R" in terms + + weights = _weighted_search_terms_for_symbol("G06N3/08") + assert weights["G06N3/08"] > weights["G06N"] + assert weights["G06N3/08"] >= 4.0 + + +def _match_boost(clauses: list[dict], field: str, term: str) -> float | None: + for clause in clauses: + payload = clause.get("match", {}).get(field) + if isinstance(payload, dict) and payload.get("query") == term: + return float(payload.get("boost", 1.0)) + if payload == term: + return 1.0 + return None + + +def test_epo_and_uspto_queries_boost_specific_symbols_over_subclass() -> None: + queries = IpcPatentSearchQueries() + epo = queries.epo_query_by_ipc_symbols(["G06N3/08", "G06N"]) + uspto = queries.uspto_query_by_ipc_symbols(["G06N3/08", "G06N"]) + + epo_should = epo["query"]["bool"]["should"] + uspto_should = uspto["query"]["bool"]["should"] + + epo_specific = _match_boost(epo_should, "ipc", "G06N3/08") + epo_subclass = _match_boost(epo_should, "ipc", "G06N") + uspto_specific = _match_boost(uspto_should, "ipcr", "G06N3/08") + uspto_subclass = _match_boost(uspto_should, "ipcr", "G06N") + + assert epo_specific is not None and epo_subclass is not None + assert uspto_specific is not None and uspto_subclass is not None + assert epo_specific > epo_subclass + assert uspto_specific > uspto_subclass + assert _match_boost(epo_should, "cpc", "G06N3/08") == epo_specific + assert _match_boost(uspto_should, "cpc", "G06N3/08") == uspto_specific + assert epo["sort"][0] == {"_score": {"order": "desc"}} + assert uspto["sort"][0] == {"_score": {"order": "desc"}} + + +def test_text_queries_prefer_phrase_match_in_title() -> None: + queries = IpcPatentSearchQueries() + epo = queries.epo_query_by_text_phrases(["organic chemistry"]) + uspto = queries.uspto_query_by_text_phrases(["organic chemistry"]) + + epo_should = epo["query"]["bool"]["should"] + uspto_should = uspto["query"]["bool"]["should"] + + def clause_boost(clauses: list[dict], kind: str, field: str) -> float | None: + for clause in clauses: + payload = clause.get(kind, {}).get(field) + if isinstance(payload, dict) and payload.get("query") == "organic chemistry": + return float(payload.get("boost", 1.0)) + return None + + assert clause_boost(epo_should, "match_phrase", "title_en") == 5.0 + assert clause_boost(epo_should, "match_phrase", "abstract") == 3.0 + assert clause_boost(epo_should, "match", "title_en") == 1.5 + assert clause_boost(uspto_should, "match_phrase", "title") == 5.0 + assert epo["sort"][0] == {"_score": {"order": "desc"}} + + +def test_uncertain_mapping_uses_text_fallback_not_empty_list() -> None: + """Fragmented IPC abstention must fall back to title/abstract search.""" + patent = model.PatentEntry( + patent_id="EP123", + source="EPO", + title="Process for organic chemistry synthesis", + abstract="A catalytic method in organic chemistry.", + publication_date="20240101", + ipc=["C07C243/08"], + cpc=[], + ) + + async def fake_search_epo(query): + assert "match_phrase" in str(query) or "title_en" in str(query) + return { + "hits": { + "hits": [ + { + "_source": { + "doc_number": "123", + "country": "EP", + "kind": "A1", + "date_publication": "20240101", + "title_en": patent.title, + "abstract": patent.abstract, + "ipc": patent.ipc, + "cpc": [], + } + } + ] + } + } + + async def fake_search_uspto(query): + return {"hits": {"hits": []}} + + fragmented = [ + IpcCodeMatch( + "subgroup", + f"A{index:02d}B1/00", + 0.70, + "organische Chemie", + "topic", + "TORG", + ) + for index in range(1, 16) + ] + request = PatentsByKeywordsRequest( + keywords=[ + KeywordPatentSearchItem( + keyword="organische Chemie", + keyword_level="coarse", + topic_id="https://openalex.org/TORG", + topic_display_name="Organic Chemistry", + field_name="Chemistry", + relevance_score=1.0, + ) + ] + ) + + with patch( + "inse.patents.keywords.logic.KeywordIpcReverseLookup.lookup_ipc_codes", + new=AsyncMock(return_value=fragmented), + ), patch( + "inse.patents.keywords.logic.BasePatentSearchClient.search_epo", + new=AsyncMock(side_effect=fake_search_epo), + ), patch( + "inse.patents.keywords.logic.BasePatentSearchClient.search_uspto", + new=AsyncMock(side_effect=fake_search_uspto), + ), patch( + "inse.patents.keywords.logic.PatentOpenAlexMappingResolver.resolve_topics_for_patents", + new=AsyncMock(return_value={}), + ), patch( + "inse.patents.keywords.logic.enrich_patents_classifications", + new=AsyncMock(), + ), patch.object( + IpcPatentSearchQueries, + "epo_query_by_text_phrases", + wraps=IpcPatentSearchQueries().epo_query_by_text_phrases, + ) as epo_text: + response = asyncio.run(get_patents_by_keywords(request)) + + epo_text.assert_called_once() + assert response.mapping_status == "uncertain" + assert response.patent_count == 1 + assert response.patents[0].text_retrieval is True + assert response.patents[0].ipc_score == 0.0 + assert response.patents[0].text_score > 0.0 + assert response.patents[0].matched_ipc_symbols == [] + assert response.patents[0].keyword_evidence is not None + assert response.patents[0].keyword_evidence.phrase_in_title is True + assert response.patents[0].keyword_evidence.text_match_kind == "phrase_title" + + +def test_text_fallback_empty_yields_no_patents_found() -> None: + request = PatentsByKeywordsRequest( + keywords=[ + KeywordPatentSearchItem( + keyword="organische Chemie", + keyword_level="coarse", + topic_id="https://openalex.org/TORG", + topic_display_name="Organic Chemistry", + field_name="Chemistry", + relevance_score=1.0, + ) + ] + ) + + with patch( + "inse.patents.keywords.logic.KeywordIpcReverseLookup.lookup_ipc_codes", + new=AsyncMock(return_value=[]), + ), patch( + "inse.patents.keywords.logic.BasePatentSearchClient.search_epo", + new=AsyncMock(return_value={"hits": {"hits": []}}), + ), patch( + "inse.patents.keywords.logic.BasePatentSearchClient.search_uspto", + new=AsyncMock(return_value={"hits": {"hits": []}}), + ), patch( + "inse.patents.keywords.logic.PatentOpenAlexMappingResolver.resolve_topics_for_patents", + new=AsyncMock(return_value={}), + ), patch( + "inse.patents.keywords.logic.enrich_patents_classifications", + new=AsyncMock(), + ): + response = asyncio.run(get_patents_by_keywords(request)) + + assert response.mapping_status == "no_patents_found" + assert response.patent_count == 0 + assert response.patents == [] + + +def test_technical_search_failure_returns_search_error_not_no_patents_found() -> None: + request = PatentsByKeywordsRequest( + keywords=[ + KeywordPatentSearchItem( + keyword="organische Chemie", + keyword_level="coarse", + topic_id="https://openalex.org/TORG", + topic_display_name="Organic Chemistry", + field_name="Chemistry", + relevance_score=1.0, + ) + ] + ) + + with patch( + "inse.patents.keywords.logic.KeywordIpcReverseLookup.lookup_ipc_codes", + new=AsyncMock(return_value=[]), + ), patch( + "inse.patents.keywords.logic.BasePatentSearchClient.search_epo", + new=AsyncMock(side_effect=httpx.HTTPError("boom")), + ), patch( + "inse.patents.keywords.logic.BasePatentSearchClient.search_uspto", + new=AsyncMock(return_value={"hits": {"hits": []}}), + ): + response = asyncio.run(get_patents_by_keywords(request)) + + assert response.mapping_status == "search_error" + assert response.patent_count == 0 + + def test_json_lookup_returns_empty_without_mapping(monkeypatch) -> None: clear_reverse_lookup_caches() monkeypatch.setattr( diff --git a/service/src/main/inse/patents/org/logic.py b/service/src/main/inse/patents/org/logic.py index 561ae554..d0c93be7 100644 --- a/service/src/main/inse/patents/org/logic.py +++ b/service/src/main/inse/patents/org/logic.py @@ -14,8 +14,8 @@ from inse.models.openalex.author import Author from inse.patents.authors.identity import ( author_institution_names, patent_institution_match, + patent_personal_assignee_match, ) -from inse.patents.authors.ipc_openalex_mapping import normalize_openalex_id from inse.patents.authors.name_matching import filter_patents_by_author_name from inse.patents.common.elastic_search_client import MissingApiKeyError from inse.patents.common.model import PatentEntry @@ -26,12 +26,10 @@ from inse.patents.common.parsing import ( parse_epo_hits, parse_uspto_hits, patent_dedup_key, - patent_map_key, ) from inse.patents.institutions.logic import get_patents_by_institution_id from inse.patents.ipc_search_client import IpcSearchClient from inse.patents.patents_openalex_keywords.client import PatentsOpenAlexKeywordsClient -from inse.patents.patents_openalex_keywords.resolver import PatentOpenAlexMappingResolver from inse.patents.org.elastic_search_client import ( OrgPatentsSearchClient, fetch_authors_by_institution_name, @@ -219,68 +217,6 @@ def org_patent_to_es_document(patent: OrgPatentEntry) -> dict: } -MIN_CORROBORATING_TOPIC_OVERLAP = 2 - - -def primary_classification_codes(patent: PatentEntry) -> list[str]: - """Returns only the patent's primary IPC/CPC code(s) (marked "AFI" in the - raw EPO/USPTO string), falling back to all codes if none are marked. - - Patents can carry dozens of secondary/incidental classification codes - (marked "ALI") alongside their real subject. Resolving OpenAlex topics - from *all* of them gives some patents a huge, unfocused topic cloud — - confirmed against a real org_patents rebuild, where a 20-code patent - picked up 70+ unrelated topics, making a coincidental two-topic overlap - with an unrelated same-named author far more likely than intended. - """ - all_codes = [*patent.ipc, *patent.cpc] - primary = [code for code in all_codes if "AFI" in code] - return primary or all_codes - - -def topic_corroborated_patents( - patents: list[PatentEntry], - author: Author, - patent_topic_map: dict[str, list], -) -> list[PatentEntry]: - """Keeps only patents whose IPC/CPC-derived OpenAlex topics share at - least MIN_CORROBORATING_TOPIC_OVERLAP exact topic IDs with the author's - own research topics — used to disambiguate common inventor names where - institution/self-assignee matching alone isn't enough. - - Requiring a single shared topic ID was still too loose: broad, - genuinely common topics (e.g. "Image Processing Techniques") show up on - many unrelated patents *and* on many unrelated researchers' profiles, so - one coincidental overlap doesn't mean much (confirmed against a real - org_patents rebuild: match_type=name patents still ballooned to ~2000). - Two independent topic overlaps happening by chance is far less likely, - while a patent genuinely invented by the author would typically share - more than one topic with their own body of work. If the author has no - topic profile at all, there is nothing to corroborate against. - """ - author_topic_ids = { - normalize_openalex_id(topic.id) - for topic in (author.topics or []) - if topic.id - } - author_topic_ids.discard(None) - if not author_topic_ids: - return [] - - kept: list[PatentEntry] = [] - for patent in patents: - mapped_topics = patent_topic_map.get(patent_map_key(patent), []) - patent_topic_ids = { - normalize_openalex_id(topic.topic_id) - for topic in mapped_topics - if topic.topic_id - } - patent_topic_ids.discard(None) - if len(patent_topic_ids & author_topic_ids) >= MIN_CORROBORATING_TOPIC_OVERLAP: - kept.append(patent) - return kept - - async def _search_patents_by_author( author: Author, institution_name: str | None, @@ -315,48 +251,18 @@ async def _search_patents_by_author( return [] # Applied to every name-based hit, not gated behind an ambiguity check: - # the institution itself being the assignee is the only unambiguous - # case — accepted outright. Everything else matched on name alone, - # including a personal-assignee match (several different same-named - # people could each be listed as their own patent's assignee) or a - # third-party assignee (e.g. an industry partner on a co-invented - # patent — the normal case for academic patents, not a red flag by - # itself), only counts if the patent's IPC/CPC-derived OpenAlex topics - # also overlap with the author's own research topics. This + # a match only counts if the assignee is the institution itself or the + # person themselves — a bare name match on inventors is too weak a + # signal on its own once several same-named people are possible. This # intentionally does not rely on is_ambiguous_name: a name can look # unique in our local OpenAlex slice while still being common globally - # in EPO/USPTO, so a bare name-on-inventor match alone is never a - # strong enough signal on its own. + # in EPO/USPTO. inst_names = [institution_name] if institution_name else [] - strong_identity_matched = [ + return [ p for p in name_matched if patent_institution_match(p, inst_names) + or patent_personal_assignee_match(p, author_name) ] - matched_keys = {patent_dedup_key(p) for p in strong_identity_matched} - remaining = [p for p in name_matched if patent_dedup_key(p) not in matched_keys] - if not remaining: - return strong_identity_matched - - topic_matched: list[PatentEntry] = [] - try: - resolver = PatentOpenAlexMappingResolver() - primary_only = [ - patent.model_copy(update={ - "ipc": primary_classification_codes(patent), - "cpc": [], - }) - for patent in remaining - ] - patent_topic_map = await resolver.resolve_topics_for_patents(primary_only) - topic_matched = topic_corroborated_patents(remaining, author, patent_topic_map) - except Exception: - logger.warning( - "OpenAlex topic corroboration failed for author %s", - author_name, - exc_info=True, - ) - - return strong_identity_matched + topic_matched async def build_org_patents_for_institution( diff --git a/service/src/main/inse/patents/org/test_logic.py b/service/src/main/inse/patents/org/test_logic.py index 82a2aa21..60622812 100644 --- a/service/src/main/inse/patents/org/test_logic.py +++ b/service/src/main/inse/patents/org/test_logic.py @@ -1,14 +1,9 @@ from inse.models.openalex.author import Author -from inse.models.openalex.work_topic import WorkTopic -from inse.patents.authors.ipc_openalex_mapping import MappedOpenAlexTopic from inse.patents.common.model import PatentEntry -from inse.patents.common.parsing import patent_map_key from inse.patents.org.logic import ( merge_org_patents, org_patent_document_id, - primary_classification_codes, resolve_match_type, - topic_corroborated_patents, ) from inse.patents.org.model import MatchedAuthor @@ -107,108 +102,3 @@ def test_org_patent_document_id_is_stable() -> None: doc_id = org_patent_document_id("I62318514", patent) assert doc_id == "I62318514_EPO_EP1234567_20240101_A1" - - -def _author_with_topics(author_id: str, name: str, topic_ids: list[str]) -> Author: - return Author( - id=f"https://openalex.org/{author_id}", - display_name=name, - topics=[WorkTopic(id=tid, display_name=f"Topic {tid}") for tid in topic_ids], - ) - - -def _mapped_topics(*topic_ids: str) -> list[MappedOpenAlexTopic]: - return [ - MappedOpenAlexTopic(topic_id=tid, topic_display_name=f"Topic {tid}") - for tid in topic_ids - ] - - -def test_topic_corroborated_patents_keeps_two_overlapping_topics() -> None: - author = _author_with_topics( - "A123", "Wei Zhang", - ["https://openalex.org/T1", "https://openalex.org/T2"], - ) - patent = _patent("EP1") - patent_topic_map = { - patent_map_key(patent): _mapped_topics( - "https://openalex.org/T1", "https://openalex.org/T2", "https://openalex.org/T3" - ), - } - - result = topic_corroborated_patents([patent], author, patent_topic_map) - - assert result == [patent] - - -def test_topic_corroborated_patents_drops_single_coincidental_overlap() -> None: - """A single shared topic isn't enough — broad, common topics show up on - many unrelated patents and profiles by coincidence.""" - author = _author_with_topics( - "A123", "Xin Wang", - ["https://openalex.org/T1", "https://openalex.org/T9"], - ) - patent = _patent("EP2") - patent_topic_map = { - patent_map_key(patent): _mapped_topics( - "https://openalex.org/T1", "https://openalex.org/T2", "https://openalex.org/T3" - ), - } - - result = topic_corroborated_patents([patent], author, patent_topic_map) - - assert result == [] - - -def test_topic_corroborated_patents_drops_patent_without_mapped_topics() -> None: - author = _author_with_topics("A123", "Wei Zhang", ["https://openalex.org/T1"]) - patent = _patent("EP3") - - result = topic_corroborated_patents([patent], author, {}) - - assert result == [] - - -def test_topic_corroborated_patents_rejects_everything_without_author_topic_profile() -> None: - author = Author(id="https://openalex.org/A999", display_name="Wei Zhang") - patent = _patent("EP4") - patent_topic_map = { - patent_map_key(patent): _mapped_topics( - "https://openalex.org/T1", "https://openalex.org/T2" - ), - } - - result = topic_corroborated_patents([patent], author, patent_topic_map) - - assert result == [] - - -def test_primary_classification_codes_keeps_only_afi_marked_codes() -> None: - """A patent with many secondary ("ALI") codes alongside its one primary - ("AFI") code must only contribute the primary one — otherwise a large - secondary-code topic cloud makes coincidental multi-topic overlaps with - an unrelated same-named author far too easy (confirmed against a real - org_patents rebuild: a 20-code patent picked up 70+ topics).""" - patent = _patent("EP1") - patent.ipc = [ - "G06V 10/776 20220101AFI20250422BHUS", - "G01N 33/569 20060101ALI20250422BHUS", - "G06T 5/20 20060101ALI20250422BHUS", - ] - patent.cpc = ["G16H 30/40 20180101ALI20250422BHUS"] - - result = primary_classification_codes(patent) - - assert result == ["G06V 10/776 20220101AFI20250422BHUS"] - - -def test_primary_classification_codes_falls_back_to_all_codes_without_afi_marker() -> None: - patent = _patent("EP2") - patent.ipc = ["G06V 10/776 20220101ALI20250422BHUS"] - patent.cpc = ["G01N 33/569 20060101ALI20250422BHUS"] - - result = primary_classification_codes(patent) - - assert result == patent.ipc + patent.cpc - - diff --git a/service/src/main/inse/tags.py b/service/src/main/inse/tags.py index a5411f63..5eb73000 100644 --- a/service/src/main/inse/tags.py +++ b/service/src/main/inse/tags.py @@ -7,7 +7,6 @@ class Tags(StrEnum): INSTITUTIONS = "Institutions" TOPICS = "Topics" WORKS = "Works" - WORKS_V2 = "Works V2" NEWS = "News" PROJECTS = "Projects" AUTH = "Auth" @@ -15,3 +14,8 @@ class Tags(StrEnum): ORGANIZATION = "Organization" UNIVERSITY_RANKINGS = "University Rankings" DASHBOARD = "Dashboard" + + AUTHORS_V2 = "Authors V2" + INSTITUTIONS_V2 = "Institutions V2" + TOPICS_V2 = "Topics V2" + WORKS_V2 = "Works V2" diff --git a/service/src/main/inse/topics/v2/model.py b/service/src/main/inse/topics/v2/model.py new file mode 100644 index 00000000..92931d63 --- /dev/null +++ b/service/src/main/inse/topics/v2/model.py @@ -0,0 +1,6 @@ +from inse.model import Page +from inse.models.openalex.topic import Topic + + +class TopicPageV2(Page[Topic]): + pass diff --git a/service/src/main/inse/topics/v2/router.py b/service/src/main/inse/topics/v2/router.py new file mode 100644 index 00000000..fa571324 --- /dev/null +++ b/service/src/main/inse/topics/v2/router.py @@ -0,0 +1,47 @@ +import logging +from typing import Annotated + +from fastapi import APIRouter, Query + +from inse.tags import Tags + +import inse.topics.v2.service as topics_service +from inse.topics.v2.model import TopicPageV2 + + +TOPICS_V2_PREFIX = "/api/v2/topics" + +logger = logging.getLogger(__name__) + + +router = APIRouter(prefix=TOPICS_V2_PREFIX, tags=[Tags.TOPICS_V2]) + + +@router.get( + "/topics/id", + operation_id="getTopicsByIds", + summary="Returns a paginated list of topics for a given list of topic IDs.", +) +async def get_topics_by_ids( + topic_ids: Annotated[ + list[str], + Query(description="A list of topic IDs to retrieve."), + ] = [], +) -> TopicPageV2: + return await topics_service.get_topics_by_ids(topic_ids=topic_ids or []) + + +@router.get( + "/autocomplete/selector", + operation_id="autocompleteTopicsForSelector", + summary="Returns a paginated list of topics for a given search term based on their display name.", +) +async def autocomplete_topics_for_selector( + query: Annotated[ + str, + Query( + description="A search term to filter topics by (partial matches allowed)." + ), + ] = "", +) -> TopicPageV2: + return await topics_service.autocomplete_topics_for_selector(query=query) diff --git a/service/src/main/inse/topics/v2/service.py b/service/src/main/inse/topics/v2/service.py new file mode 100644 index 00000000..ab1715d5 --- /dev/null +++ b/service/src/main/inse/topics/v2/service.py @@ -0,0 +1,95 @@ +from typing import Dict, List, Optional + +from inse.integrations import elasticsearch +from inse.model import ESIndex +from inse.models.openalex.topic import Topic +from inse.topics.v2.model import TopicPageV2 + + +async def search_topics( + page: int = 0, + size: int = 10, + query: Optional[Dict] = None, + source: Optional[List[str]] = None, + sort: Optional[List[Dict]] = None, + body: Optional[Dict] = None, +) -> TopicPageV2: + """Searches for topics based on the provided criteria. + + Args: + page (int, optional): The page number to retrieve. Defaults to 0. + size (int, optional): The number of topics to retrieve per page. Defaults to 10. + query (Optional[Dict], optional): The search query. Defaults to None. + source (Optional[List[str]], optional): A list of fields to include in the response. Defaults to None. + sort (Optional[List[Dict]], optional): A list of sort criteria. Defaults to None. + body (Optional[Dict], optional): The request body for the search query. Defaults to None. + + Returns: + TopicPageV2: A page of topics matching the search criteria. + """ + response = await elasticsearch.search( + ESIndex.OPENALEX_TOPICS, + query=query, + source=source, + size=size, + offset=size * page, + sort=sort, + body=body, + ) + + hits_block = response.get("hits", {}) + hits = hits_block.get("hits", []) + topics: List[Topic] = [] + for hit in hits: + _source = hit.get("_source", {}) + topics.append(Topic.from_dict(_source)) # type: ignore + return TopicPageV2(elements=topics, total=len(topics), page=page, size=size) + + +async def autocomplete_topics_for_selector(query: str) -> TopicPageV2: + """Autocompletes topics based on a search term for use in a selector component. + + Args: + query (str): The search term to filter topics by (partial matches allowed). + + Returns: + TopicPageV2: A page of topics matching the autocomplete criteria. + """ + return await search_topics( + page=0, + size=10, + query={"match_phrase_prefix": {"display_name": query}}, + source=[ + "id", + "display_name", + "subfield", + "field", + "domain", + ], + ) + + +async def get_topics_by_ids(topic_ids: List[str]) -> TopicPageV2: + """Retrieves topics based on a list of topic IDs. + + Args: + topic_ids (List[str]): A list of topic IDs to retrieve. + + Returns: + TopicPageV2: A page of topics matching the provided IDs. + """ + if not topic_ids: + return TopicPageV2(elements=[], total=0, page=0, size=0) + + return await search_topics( + page=0, + size=len(topic_ids), + query={"terms": {"id": topic_ids}}, + source=[ + "id", + "display_name", + "subfield", + "field", + "domain", + ], + ) diff --git a/service/src/main/inse/works/v2/model.py b/service/src/main/inse/works/v2/model.py index c5bbb1b1..f1d732d1 100644 --- a/service/src/main/inse/works/v2/model.py +++ b/service/src/main/inse/works/v2/model.py @@ -17,7 +17,7 @@ class WorkSortBy(StrEnum): CITED_BY_COUNT = "cited_by_count" -class WorkPage(Page[Work]): +class WorkPageV2(Page[Work]): pass @@ -177,3 +177,14 @@ class WorkClassification(BaseModel): class WorkClassificationPage(Page[WorkClassification]): pass + + +class WorkClassificationMerge(BaseModel): + work: Work = Field(description="The OpenAlex work object.") + classification: Optional[WorkClassification] = Field( + default=None, description="The classification result for the work." + ) + + +class WorkClassificationMergePage(Page[WorkClassificationMerge]): + pass diff --git a/service/src/main/inse/works/v2/router.py b/service/src/main/inse/works/v2/router.py index d618ddb8..1d741428 100644 --- a/service/src/main/inse/works/v2/router.py +++ b/service/src/main/inse/works/v2/router.py @@ -1,5 +1,5 @@ import logging -from typing import Annotated, List, Optional +from typing import Annotated from fastapi import APIRouter, Path, Query @@ -7,16 +7,14 @@ from inse.tags import Tags from inse.model import SortDirection from inse.works.v2.model import ( WorkClassification, + WorkClassificationMergePage, WorkClassificationPage, - WorkPage, + WorkPageV2, WorkSortBy, ) -from inse.models.openalex.work_topic import WorkTopic -from inse.models.openalex.institution import Institution +from inse.auth.model import AccessTokenMetadata +from inse.auth.service import CurrentUserAccessTokenPayloadDep from inse.works.v2.service import get_works_by_keywords -from inse.models.openalex.author import Author -from inse.models.openalex.topic import Topic - WORKS_v2_PREFIX = "/api/v2/works" logger = logging.getLogger(__name__) @@ -68,7 +66,7 @@ async def get_author_works( sort_order: Annotated[ SortDirection, Query(description="The order to sort by.") ] = SortDirection.DESCENDING, -) -> WorkPage: +) -> WorkPageV2: from inse.works.v2.service import get_author_works return await get_author_works( @@ -88,7 +86,7 @@ async def get_author_works( @router.get( "/keyword/search", operation_id="getWorksByKeywords", - response_model=WorkPage, + response_model=WorkPageV2, summary="Search works by topics or raw keywords with filters." ) async def search_works_by_keywords( @@ -110,7 +108,7 @@ async def search_works_by_keywords( size: Annotated[int, Query(description="The number of works to retrieve per page.", ge=1, le=100)] = 10, sort_by: Annotated[WorkSortBy, Query(description="The field to sort by.")] = WorkSortBy.PUBLICATION_YEAR, sort_order: Annotated[SortDirection, Query(description="The order to sort by.")] = SortDirection.DESCENDING, -) -> WorkPage: +) -> WorkPageV2: return await get_works_by_keywords( topics=topics or [], keywords=keywords or [], @@ -174,7 +172,7 @@ async def get_institution_works( sort_order: Annotated[ SortDirection, Query(description="The order to sort by.") ] = SortDirection.DESCENDING, -) -> WorkPage: +) -> WorkPageV2: from inse.works.v2.service import get_institution_works return await get_institution_works( @@ -192,134 +190,40 @@ async def get_institution_works( ) -@router.get( - "/topics/search", - operation_id="getWorkTopicsByIds", - summary="Returns a list of work topics based on their IDs.", -) -async def get_work_topics_by_ids( - topic_ids: Annotated[ - list[str], - Query(description="A list of topic IDs to retrieve."), - ] = [], -) -> List[WorkTopic]: - from inse.works.v2.service import get_work_topics_by_ids - - return await get_work_topics_by_ids(topic_ids=topic_ids or []) - - -@router.get( - "/institutions/search", - operation_id="getInstitutionsByIds", - summary="Returns a list of institutions based on their IDs.", -) -async def get_institutions_by_ids( - institution_ids: Annotated[ - list[str], - Query(description="A list of institution IDs to retrieve."), - ] = [], -) -> List[Institution]: - from inse.works.v2.service import get_work_institutions_by_ids - - return await get_work_institutions_by_ids(institution_ids=institution_ids or []) - - -@router.get( - "/authors/search", - operation_id="getAuthorsByIds", - summary="Returns a list of authors based on their IDs.", -) -async def get_authors_by_ids( - author_ids: Annotated[ - list[str], - Query(description="A list of author IDs to retrieve."), - ] = [], -) -> List[Author]: - from inse.works.v2.service import get_work_authors_by_ids - - return await get_work_authors_by_ids(author_ids=author_ids or []) - - -@router.get( - "/topics/autocomplete", - operation_id="getTopicAutocomplete", - summary="Returns a list of work topics based on a search term for autocomplete functionality.", -) -async def get_topic_autocomplete( - query: Annotated[ - str, - Query( - description="A search term to filter topics by (partial matches allowed)." - ), - ] = "", -) -> List[Topic]: - from inse.works.v2.service import search_topics - - return await search_topics(query=query) - - -@router.get( - "/institutions/autocomplete", - operation_id="getInstitutionAutocomplete", - summary="Returns a list of institutions based on a search term for autocomplete functionality.", -) -async def get_institution_autocomplete( - query: Annotated[ - str, - Query( - description="A search term to filter institutions by (partial matches allowed)." - ), - ] = "", -) -> List[Institution]: - from inse.works.v2.service import search_institutions - - return await search_institutions(query=query) - - -@router.get( - "/authors/autocomplete", - operation_id="getAuthorAutocomplete", - summary="Returns a list of authors based on a search term for autocomplete functionality.", -) -async def get_author_autocomplete( - query: Annotated[ - str, - Query( - description="A search term to filter authors by (partial matches allowed)." - ), - ] = "", -) -> List[Author]: - from inse.works.v2.service import search_authors - - return await search_authors(query=query) - - @router.get( "/classification/author/{raw_oa_author_id}", - operation_id="getAuthorWorkClassifications", + operation_id="getWorkClassificationsByAuthorId", summary="Returns the classifications of an author's works based on their ID.", ) -async def get_author_work_classifications( +async def get_work_classifications_by_author_id( + access_token_metadata: Annotated[ + AccessTokenMetadata, CurrentUserAccessTokenPayloadDep + ], raw_oa_author_id: Annotated[str, Path(description="The raw OpenAlex author id.")], -) -> WorkClassificationPage: +) -> WorkClassificationMergePage: from inse.works.v2.service import get_work_classifications_by_author_id return await get_work_classifications_by_author_id( - raw_oa_author_id=raw_oa_author_id + access_token_metadata=access_token_metadata, raw_oa_author_id=raw_oa_author_id ) @router.get( - "/classification/work/{work_id}", + "/classification/work/{raw_oa_work_id}", operation_id="getWorkClassificationByWorkId", summary="Returns the classifications of a work based on its ID.", ) async def get_work_classification_by_work_id( - work_id: Annotated[str, Path(description="The OpenAlex work id.")], -) -> Optional[WorkClassification]: + access_token_metadata: Annotated[ + AccessTokenMetadata, CurrentUserAccessTokenPayloadDep + ], + raw_oa_work_id: Annotated[str, Path(description="The raw OpenAlex work id.")], +) -> WorkClassification | None: from inse.works.v2.service import get_work_classification_by_work_id - return await get_work_classification_by_work_id(work_id=work_id) + return await get_work_classification_by_work_id( + access_token_metadata=access_token_metadata, raw_oa_work_id=raw_oa_work_id + ) @router.get( @@ -328,6 +232,9 @@ async def get_work_classification_by_work_id( summary="Returns the classifications of works based on their IDs.", ) async def get_work_classifications_by_work_ids( + access_token_metadata: Annotated[ + AccessTokenMetadata, CurrentUserAccessTokenPayloadDep + ], work_ids: Annotated[ list[str], Query( @@ -353,6 +260,7 @@ async def get_work_classifications_by_work_ids( ) return await get_work_classifications_by_work_ids( + access_token_metadata=access_token_metadata, work_ids=work_ids or [], page=page, size=size, diff --git a/service/src/main/inse/works/v2/service.py b/service/src/main/inse/works/v2/service.py index 32f69e5e..80e7bada 100644 --- a/service/src/main/inse/works/v2/service.py +++ b/service/src/main/inse/works/v2/service.py @@ -1,26 +1,32 @@ import logging -from typing import List, Optional, Dict +from typing import Dict, List, Optional from fastapi import Query - from inse.integrations import elasticsearch from inse.model import ESIndex, SortDirection, ESCluster from inse.works.v2.model import ( WorkClassification, WorkClassificationPage, - WorkPage, + WorkClassificationMerge, + WorkClassificationMergePage, + WorkPageV2, WorkSortBy, ) -from inse.models.openalex.work_topic import WorkTopic -from inse.models.openalex.institution import Institution from inse.models.openalex.work import Work -from inse.models.openalex.author import Author -from inse.models.openalex.topic import Topic +from inse.auth.model import AccessTokenMetadata logger = logging.getLogger(__name__) logger.setLevel(logging.DEBUG) -def _authors_nested_query(author_ids: List[str]) -> dict: +def _authors_nested_query(author_ids: List[str]) -> Dict: + """Returns a nested query for filtering works by a list of author IDs. + + Args: + author_ids (List[str]): A list of author IDs to filter by. + + Returns: + Dict: A nested query for filtering works by the specified author IDs. + """ prefixed = [_prefix_id(aid) for aid in author_ids] return { "nested": { @@ -30,7 +36,15 @@ def _authors_nested_query(author_ids: List[str]) -> dict: } -def _institutions_nested_query(institution_ids: List[str]) -> dict: +def _institutions_nested_query(institution_ids: List[str]) -> Dict: + """Returns a nested query for filtering works by a list of institution IDs. + + Args: + institution_ids (List[str]): A list of institution IDs to filter by. + + Returns: + Dict: A nested query for filtering works by the specified institution IDs. + """ prefixed = [_prefix_id(iid) for iid in institution_ids] return { "nested": { @@ -45,7 +59,15 @@ def _institutions_nested_query(institution_ids: List[str]) -> dict: } -def _title_query(title: str = "") -> dict: +def _title_query(title: str) -> Dict: + """Returns a query for filtering works by title using a multi-match query. + + Args: + title (str): The title to filter works by. + + Returns: + Dict: A multi-match query for filtering works by the specified title. + """ return { "multi_match": { "query": title, @@ -60,13 +82,23 @@ def _title_query(title: str = "") -> dict: def _apply_common_filters( - must: list, + must: List, publication_years: Optional[List[int]], publication_types: Optional[List[str]], language_codes: Optional[List[str]], topic_ids: Optional[List[str]], title: Optional[str] = None, ) -> None: + """Applies common filters to the provided list of must conditions for filtering works. + + Args: + must (list): A list of must conditions to which the common filters will be appended. + publication_years (Optional[List[int]]): A list of publication years to filter by. + publication_types (Optional[List[str]]): A list of publication types to filter by. + language_codes (Optional[List[str]]): A list of language codes to filter by. + topic_ids (Optional[List[str]]): A list of topic IDs to filter by. + title (Optional[str], optional): The title to filter works by. Defaults to None. + """ if publication_years: must.append({"terms": {"publication_year": publication_years}}) if publication_types: @@ -81,17 +113,41 @@ def _apply_common_filters( must.append(_title_query(title)) -def _build_sort(sort_by: WorkSortBy, sort_order: SortDirection) -> list: +def _build_sort(sort_by: WorkSortBy, sort_order: SortDirection) -> List[Dict]: + """Builds a sort criteria list for sorting works based on the specified sort_by and sort_order. + + Args: + sort_by (WorkSortBy): The field to sort by. + sort_order (SortDirection): The direction to sort in. + + Returns: + List[Dict]: A list of sort criteria. + """ if sort_by == WorkSortBy.TITLE: return [{"title.keyword": sort_order.value}] return [{sort_by.value: sort_order.value}] async def _execute_works_search( - must: list, page: int, size: int, sort_by: WorkSortBy, sort_order: SortDirection -) -> WorkPage: - response = await elasticsearch.search( - ESIndex.OPENALEX_WORKS_WILDCARD, + must: List[Dict], + page: int, + size: int, + sort_by: WorkSortBy, + sort_order: SortDirection, +) -> WorkPageV2: + """Executes a search for works based on the provided must conditions, pagination, and sorting criteria. + + Args: + must (List[Dict]): A list of must conditions for filtering works. + page (int): The page number for pagination. + size (int): The number of results per page. + sort_by (WorkSortBy): The field to sort by. + sort_order (SortDirection): The direction to sort in. + + Returns: + WorkPageV2: The page of works matching the search criteria. + """ + return await search_works( source=[ "id", "title", @@ -106,21 +162,11 @@ async def _execute_works_search( "topics", ], query={"bool": {"must": must}}, + page=page, size=size, - offset=page * size, sort=_build_sort(sort_by, sort_order), ) - hits_block = response.get("hits", {}) - total = hits_block.get("total", {}).get("value", 0) - elements: List[Work] = [] - for hit in hits_block.get("hits", []): - work = Work.from_dict(hit.get("_source", {})) # type: ignore - if work is not None: - elements.append(work) - - return WorkPage(elements=elements, total=total, page=page, size=size) - async def get_works( page: int, @@ -136,7 +182,30 @@ async def get_works( language_codes: Optional[List[str]] = None, sort_by: WorkSortBy = WorkSortBy.PUBLICATION_YEAR, sort_order: SortDirection = SortDirection.DESCENDING, -) -> WorkPage: +) -> WorkPageV2: + """Searches for works based on the provided criteria. + + Args: + page (int): The page number for pagination. + size (int): The number of results per page. + raw_oa_author_id (Optional[str], optional): The ID of the author to filter by. Defaults to None. + raw_oa_institution_id (Optional[str], optional): The ID of the institution to filter by. Defaults to None. + title (Optional[str], optional): The title of the works to filter by. Defaults to None. + author_ids (Optional[List[str]], optional): A list of author IDs to filter by. Defaults to None. + institution_ids (Optional[List[str]], optional): A list of institution IDs to filter by. Defaults to None. + publication_years (Optional[List[int]], optional): A list of publication years to filter by. Defaults to None. + publication_types (Optional[List[str]], optional): A list of publication types to filter by. Defaults to None. + topic_ids (Optional[List[str]], optional): A list of topic IDs to filter by. Defaults to None. + language_codes (Optional[List[str]], optional): A list of language codes to filter by. Defaults to None. + sort_by (WorkSortBy, optional): The field to sort by. Defaults to WorkSortBy.PUBLICATION_YEAR. + sort_order (SortDirection, optional): The direction to sort in. Defaults to SortDirection.DESCENDING. + + Raises: + ValueError: If neither raw_oa_author_id nor raw_oa_institution_id is provided. + + Returns: + WorkPageV2: The page of works matching the criteria. + """ if not raw_oa_author_id and not raw_oa_institution_id: raise ValueError( "get_works requires at least one of raw_oa_author_id or raw_oa_institution_id" @@ -160,121 +229,6 @@ async def get_works( return await _execute_works_search(must, page, size, sort_by, sort_order) - -async def get_author_works( - raw_oa_author_id: str, - page: int, - size: int, - title: str = "", - publication_years: Optional[List[int]] = None, - publication_types: Optional[List[str]] = None, - institution_ids: Optional[List[str]] = None, - topic_ids: Optional[List[str]] = None, - language_codes: Optional[List[str]] = None, - sort_by: WorkSortBy = WorkSortBy.PUBLICATION_YEAR, - sort_order: SortDirection = SortDirection.DESCENDING, -) -> WorkPage: - return await get_works( - page=page, - size=size, - raw_oa_author_id=raw_oa_author_id, - title=title, - institution_ids=institution_ids, - publication_years=publication_years, - publication_types=publication_types, - topic_ids=topic_ids, - language_codes=language_codes, - sort_by=sort_by, - sort_order=sort_order, - ) - - -async def get_institution_works( - raw_oa_institution_id: str, - page: int, - size: int, - title: str = "", - publication_years: Optional[List[int]] = None, - publication_types: Optional[List[str]] = None, - author_ids: Optional[List[str]] = None, - topic_ids: Optional[List[str]] = None, - language_codes: Optional[List[str]] = None, - sort_by: WorkSortBy = WorkSortBy.PUBLICATION_YEAR, - sort_order: SortDirection = SortDirection.DESCENDING, -) -> WorkPage: - return await get_works( - page=page, - size=size, - raw_oa_institution_id=raw_oa_institution_id, - author_ids=author_ids, - title=title, - publication_years=publication_years, - publication_types=publication_types, - topic_ids=topic_ids, - language_codes=language_codes, - sort_by=sort_by, - sort_order=sort_order, - ) - - -async def get_work_topics_by_ids(topic_ids: List[str]) -> List[WorkTopic]: - logger.debug(f"Fetching work topics for IDs: {topic_ids}") - if not topic_ids: - return [] - - must = [{"terms": {"id": topic_ids}}] - - response = await elasticsearch.search( - ESIndex.OPENALEX_TOPICS, - source=["id", "display_name", "field", "domain"], - query={"bool": {"must": must}}, - size=len(topic_ids), - ) - - logger.debug(f"Elasticsearch response for work topics {topic_ids}: {response}") - hits_block = response.get("hits", {}) - hits = hits_block.get("hits", []) - topics: List[WorkTopic] = [] - for hit in hits: - source = hit.get("_source", {}) - logger.debug(f"Hit source for work topic {source.get('id', '')}: {source}") - topics.append(WorkTopic.from_dict(source)) # type: ignore - return topics - - -async def get_work_institutions_by_ids(institution_ids: List[str]) -> List[Institution]: - logger.debug(f"Fetching institutions for IDs: {institution_ids}") - if not institution_ids: - return [] - - must = [{"terms": {"id": institution_ids}}] - - response = await elasticsearch.search( - ESIndex.OPENALEX_INSTITUTIONS, - source=[ - "id", - "display_name", - "display_name_alternatives", - "country_code", - "type", - "ror", - ], - query={"bool": {"must": must}}, - size=len(institution_ids), - ) - - logger.debug( - f"Elasticsearch response for institutions {institution_ids}: {response}" - ) - hits_block = response.get("hits", {}) - hits = hits_block.get("hits", []) - institutions: List[Institution] = [] - for hit in hits: - source = hit.get("_source", {}) - logger.debug(f"Hit source for institution {source.get('id', '')}: {source}") - institutions.append(Institution.from_dict(source)) # type: ignore - return institutions - async def get_works_by_keywords( topics: Optional[List[str]] = Query(None, description="List of topics to match."), topic_ids: Optional[List[str]] = Query(None, description="List of topic IDs to match."), @@ -295,7 +249,7 @@ async def get_works_by_keywords( size: int = 10, sort_by: WorkSortBy = Query(WorkSortBy.PUBLICATION_YEAR), sort_order: SortDirection = Query(SortDirection.DESCENDING), -) -> WorkPage: +) -> WorkPageV2: #print(f"get_works_by_keywords called with topics={topics}, topic_ids={topic_ids}, filter_topic_ids={filter_topic_ids}, keywords={keywords}, fuzzy={fuzzy}, publication_year={publication_year}, publication_type={publication_type}, language={language},title={title}, institution_ids={institution_ids}, page={page}, size={size}, sort_by={sort_by}, sort_order={sort_order}") def _topics_nested_clause(should_clauses: List[Dict]) -> Dict: return { @@ -352,20 +306,11 @@ async def get_works_by_keywords( topic_clause = {"bool": {"must": keyword_clauses}} if not topic_clause: - return WorkPage(elements=[], total=0, page=page, size=size) + return WorkPageV2(elements=[], total=0, page=page, size=size) #filters must = [topic_clause] - # independent, additive topic filter — always applied, - # regardless of fuzzy/keyword search mode. - # if filter_topic_ids: - # must.append({ - # "bool": { - # "should": [_single_topic_id_match(tid) for tid in filter_topic_ids], - # "minimum_should_match": 1, - # } - # }) if title: must.append(_title_query(title)) @@ -428,145 +373,397 @@ async def get_works_by_keywords( if work is not None: elements.append(work) - return WorkPage(elements=elements, total=total, page=page, size=size) + return WorkPageV2(elements=elements, total=total, page=page, size=size) -async def get_work_authors_by_ids(author_ids: List[str]) -> List[Author]: - logger.debug(f"Fetching authors for IDs: {author_ids}") - if not author_ids: - return [] +async def get_author_works( + raw_oa_author_id: str, + page: int, + size: int, + title: str = "", + publication_years: Optional[List[int]] = None, + publication_types: Optional[List[str]] = None, + institution_ids: Optional[List[str]] = None, + topic_ids: Optional[List[str]] = None, + language_codes: Optional[List[str]] = None, + sort_by: WorkSortBy = WorkSortBy.PUBLICATION_YEAR, + sort_order: SortDirection = SortDirection.DESCENDING, +) -> WorkPageV2: + """Retrieves works for a specific author based on the provided criteria. - must = [{"terms": {"id": author_ids}}] + Args: + raw_oa_author_id (str): The ID of the author for whom to retrieve works. + page (int): The page number of the results to retrieve. + size (int): The number of results per page. + title (str, optional): The title of the works to filter by. Defaults to "". + publication_years (Optional[List[int]], optional): A list of publication years to filter by. Defaults to None. + publication_types (Optional[List[str]], optional): A list of publication types to filter by. Defaults to None. + institution_ids (Optional[List[str]], optional): A list of institution IDs to filter by. Defaults to None. + topic_ids (Optional[List[str]], optional): A list of topic IDs to filter by. Defaults to None. + language_codes (Optional[List[str]], optional): A list of language codes to filter by. Defaults to None. + sort_by (WorkSortBy, optional): The field by which to sort the results. Defaults to WorkSortBy.PUBLICATION_YEAR. + sort_order (SortDirection, optional): The direction to sort in. Defaults to SortDirection.DESCENDING. - response = await elasticsearch.search( - ESIndex.OPENALEX_AUTHORS, - source=[ - "id", - "display_name", - "orcid", - "last_known_institutions", - "works_count", - ], - query={"bool": {"must": must}}, - size=len(author_ids), + Returns: + WorkPageV2: The page of works matching the criteria. + """ + + return await get_works( + page=page, + size=size, + raw_oa_author_id=raw_oa_author_id, + title=title, + institution_ids=institution_ids, + publication_years=publication_years, + publication_types=publication_types, + topic_ids=topic_ids, + language_codes=language_codes, + sort_by=sort_by, + sort_order=sort_order, ) - logger.debug(f"Elasticsearch response for authors {author_ids}: {response}") - hits_block = response.get("hits", {}) - hits = hits_block.get("hits", []) - authors: List[Author] = [] - for hit in hits: - source = hit.get("_source", {}) - logger.debug(f"Hit source for author {source.get('id', '')}: {source}") - authors.append(Author.from_dict(source)) # type: ignore - return authors +async def get_institution_works( + raw_oa_institution_id: str, + page: int, + size: int, + title: str = "", + publication_years: Optional[List[int]] = None, + publication_types: Optional[List[str]] = None, + author_ids: Optional[List[str]] = None, + topic_ids: Optional[List[str]] = None, + language_codes: Optional[List[str]] = None, + sort_by: WorkSortBy = WorkSortBy.PUBLICATION_YEAR, + sort_order: SortDirection = SortDirection.DESCENDING, +) -> WorkPageV2: + """Retrieves works for a specific institution based on the provided criteria. -async def search_topics( - query: str, - size: int = 10, -) -> List[Topic]: - response = await elasticsearch.search( - ESIndex.OPENALEX_TOPICS, - source=[ - "id", - "display_name", - "subfield", - "field", - "domain", - ], - query={"match_bool_prefix": {"display_name": query}}, - size=min(size, 10), + Args: + raw_oa_institution_id (str): The ID of the institution for whom to retrieve works. + page (int): The page number of the results to retrieve. + size (int): The number of results per page. + title (str, optional): The title of the works to filter by. Defaults to "". + publication_years (Optional[List[int]], optional): A list of publication years to filter by. Defaults to None. + publication_types (Optional[List[str]], optional): A list of publication types to filter by. Defaults to None. + author_ids (Optional[List[str]], optional): A list of author IDs to filter by. Defaults to None. + topic_ids (Optional[List[str]], optional): A list of topic IDs to filter by. Defaults to None. + language_codes (Optional[List[str]], optional): A list of language codes to filter by. Defaults to None. + sort_by (WorkSortBy, optional): The field by which to sort the results. Defaults to WorkSortBy.PUBLICATION_YEAR. + sort_order (SortDirection, optional): The direction to sort in. Defaults to SortDirection.DESCENDING. + + Returns: + WorkPageV2: The page of works matching the criteria. + """ + + return await get_works( + page=page, + size=size, + raw_oa_institution_id=raw_oa_institution_id, + author_ids=author_ids, + title=title, + publication_years=publication_years, + publication_types=publication_types, + topic_ids=topic_ids, + language_codes=language_codes, + sort_by=sort_by, + sort_order=sort_order, ) - hits_block = response.get("hits", {}) - elements: List[Topic] = [] - for hit in hits_block.get("hits", []): - topic = Topic.from_dict(hit.get("_source", {})) # type: ignore - if topic is not None: - elements.append(topic) - - return elements - - -async def search_institutions( - query: str, - size: int = 10, -) -> List[Institution]: - response = await elasticsearch.search( - ESIndex.OPENALEX_INSTITUTIONS, - source=[ - "id", - "display_name", - "display_name_alternatives", - "country_code", - "type", - "ror", - ], - query={ - "bool": { - "should": [ - {"match_bool_prefix": {"display_name": query}}, - {"match_bool_prefix": {"display_name_alternatives": query}}, - ], - "minimum_should_match": 1, - } - }, - size=min(size, 10), - ) - - hits_block = response.get("hits", {}) - elements: List[Institution] = [] - for hit in hits_block.get("hits", []): - institution = Institution.from_dict(hit.get("_source", {})) # type: ignore - if institution is not None: - elements.append(institution) - - return elements - - -async def search_authors( - query: str, - size: int = 10, -) -> List[Author]: - response = await elasticsearch.search( - ESIndex.OPENALEX_AUTHORS, - source=[ - "id", - "display_name", - "orcid", - "last_known_institutions", - "works_count", - ], - query={"match_phrase_prefix": {"display_name": query}}, - size=min(size, 10), - ) - - hits_block = response.get("hits", {}) - elements: List[Author] = [] - for hit in hits_block.get("hits", []): - author = Author.from_dict(hit.get("_source", {})) # type: ignore - if author is not None: - elements.append(author) - - return elements - async def get_work_classifications_by_author_id( + access_token_metadata: AccessTokenMetadata, raw_oa_author_id: str +) -> WorkClassificationMergePage: + """Retrieves work classifications for a specific author, filtered by the effective institution ID from the access token metadata. + + Args: + access_token_metadata (AccessTokenMetadata): The access token metadata containing the effective institution ID. + raw_oa_author_id (str): The ID of the author for whom to retrieve work classifications. + + Returns: + WorkClassificationMergePage: The page of work classifications matching the criteria. + """ + raw_account_institution_id = access_token_metadata.effective_institution_id + + work_page = await _get_work_ids_with_publication_year_for_author_id( + raw_oa_author_id=raw_oa_author_id + ) + logger.debug( + f"Fetched {len(work_page.elements)} works for author {raw_oa_author_id} with publication year and institution {raw_account_institution_id}" + ) + + works_dict: Dict[str, Work] = { + work.id: work + for work in work_page.elements + if work.id is not None and work.publication_year is not None + } + work_ids = list(works_dict.keys()) + logger.debug( + f"Filtered to {len(work_ids)} works for author {raw_oa_author_id} with publication year and institution {raw_account_institution_id}" + ) + + allowed_work_ids: List[str] = [] + for work in works_dict.values(): + if work.id and _work_has_authorship_with_institution_id( + work, raw_account_institution_id + ): + allowed_work_ids.append(work.id) + + logger.debug( + f"Filtered to {len(allowed_work_ids)} works for author {raw_oa_author_id} that are associated with institution {raw_account_institution_id}" + ) + + # all works considered here are associated with the account institution, so we can fetch their classifications without further filtering + work_classification_page = await _get_work_classifications_by_work_ids( + work_ids=allowed_work_ids, page=0, size=len(allowed_work_ids) + ) + works_classifications_dict: Dict[str, WorkClassification] = { + work.work_id: work for work in work_classification_page.elements + } + logger.debug( + f"Fetched {len(works_classifications_dict)} work classifications for author {raw_oa_author_id} and institution {raw_account_institution_id}" + ) + + work_classification_merges: List[WorkClassificationMerge] = [ + WorkClassificationMerge( + work=works_dict[work_id], + classification=works_classifications_dict.get( + work_id, None + ), # None, if no classification exists for this work -> work is from another institution, or has not been classified yet + ) + for work_id in work_ids + ] + logger.debug( + f"Created {len(work_classification_merges)} work classification merges for author {raw_oa_author_id} and institution {raw_account_institution_id}" + ) + + return WorkClassificationMergePage( + elements=work_classification_merges, + total=len(work_classification_merges), + page=0, + size=len(work_classification_merges), + ) + + +async def get_work( + raw_oa_work_id: str, source: Optional[List[str]] = None +) -> Work | None: + """Retrieves a work based on its OpenAlex ID. + + Args: + raw_oa_work_id (str): The ID of the work to retrieve. + source (Optional[List[str]], optional): A list of fields to include in the response. Defaults to None. + + Returns: + Work | None: The retrieved work, or None if not found. + """ + + work_page = await search_works( + query={"term": {"id": _prefix_id(raw_oa_work_id)}}, + source=source, + page=0, + size=1, + ) + if work_page.elements: + return work_page.elements[0] + + return None + + +async def search_works( + query: Optional[Dict] = None, + source: Optional[List[str]] = None, + page: int = 0, + size: int = 10, + sort: Optional[List[Dict]] = None, +) -> WorkPageV2: + """Searches for works based on the provided criteria. + + Args: + query (Optional[Dict], optional): The search query. Defaults to None. + source (Optional[List[str]], optional): A list of fields to include in the response. Defaults to None. + page (int, optional): The page number. Defaults to 0. + size (int, optional): The number of results per page. Defaults to 10. + sort (Optional[List[Dict]], optional): The sorting criteria. Defaults to None. + + Returns: + WorkPageV2: The page of works matching the criteria. + """ + response = await elasticsearch.search( + ESIndex.OPENALEX_WORKS_WILDCARD, + source=source, + query=query, + size=size, + offset=page * size, + sort=sort, + ) + + hits_block = response.get("hits", {}) + total = hits_block.get("total", {}).get("value", 0) + works: List[Work] = [] + for hit in hits_block.get("hits", []): + work = Work.from_dict(hit.get("_source", {})) # type: ignore + if work is not None: + works.append(work) + + return WorkPageV2(elements=works, total=total, page=page, size=size) + + +async def _get_work_ids_with_publication_year_for_author_id( raw_oa_author_id: str, +) -> WorkPageV2: + """Retrieves works for a specific author, including only those works that have a publication year and are associated with the specified author ID. + + Args: + raw_oa_author_id (str): The ID of the author for which to retrieve works. + + Returns: + WorkPageV2: The page of works matching the criteria. + """ + + return await search_works( + query={ + "nested": { + "path": "authorships", + "query": { + "term": {"authorships.author.id": _prefix_id(raw_oa_author_id)} + }, + } + }, + source=["id", "publication_year", "authorships.institutions.id"], + size=10000, + ) + + +async def _get_works_by_work_ids_and_institution_id( + work_ids: List[str], raw_oa_institution_id: str | None +) -> WorkPageV2: + """Retrieves works based on a list of work IDs and filters them by the specified institution ID. + + Args: + work_ids (List[str]): The list of work IDs to retrieve. + raw_oa_institution_id (str | None): The ID of the institution by which to filter the works. + + Returns: + WorkPageV2: The page of works matching the criteria. + """ + + if not work_ids or not raw_oa_institution_id: + return WorkPageV2(elements=[], total=0, page=0, size=0) + + prefixed_work_ids = [_prefix_id(wid) for wid in work_ids] + prefixed_institution_id = _prefix_id(raw_oa_institution_id) + + return await search_works( + query={ + "bool": { + "must": [ + {"terms": {"id": prefixed_work_ids}}, + { + "nested": { + "path": "authorships", + "query": { + "nested": { + "path": "authorships.institutions", + "query": { + "term": { + "authorships.institutions.id": prefixed_institution_id + } + }, + } + }, + } + }, + ] + } + }, + source=[ + "id", + ], + size=len(work_ids), + ) + + +def _work_has_authorship_with_institution_id( + work: Work, institution_id: str | None +) -> bool: + """Checks if a work has at least one authorship associated with the specified institution ID. + + Args: + work (Work): The work to check for authorships. + institution_id (str | None): The ID of the institution to check for. + + Returns: + bool: True if the work has at least one authorship associated with the specified institution ID, False otherwise. + """ + + if not institution_id: + return False + + prefixed_institution_id = _prefix_id(institution_id) + for authorship in work.authorships or []: + for institution in authorship.institutions or []: + if institution.id == prefixed_institution_id: + return True + return False + + +async def search_work_classifications( + query: Optional[Dict] = None, + source: Optional[List[str]] = None, + page: int = 0, + size: int = 10, +) -> WorkClassificationPage: + """Searches for work classifications based on the provided criteria. + + Args: + query (Optional[Dict], optional): The search query. Defaults to None. + source (Optional[List[str]], optional): The fields to include in the response. Defaults to None. + page (int, optional): The page number. Defaults to 0. + size (int, optional): The number of results per page. Defaults to 10. + + Returns: + WorkClassificationPage: The page of work classifications matching the criteria. + """ + response = await elasticsearch.search( + ESIndex.WORK_CLASSIFICATIONS, + source=source, + query=query, + size=size, + offset=page * size, + ) + + hits_block = response.get("hits", {}) + total = hits_block.get("total", {}).get("value", 0) + classifications: List[WorkClassification] = [] + for hit in hits_block.get("hits", []): + classification = WorkClassification.from_dict(hit.get("_source", {})) # type: ignore + if classification is not None: + classifications.append(classification) + + return WorkClassificationPage( + elements=classifications, total=total, page=page, size=size + ) + + +async def _get_work_classifications_by_work_ids( + work_ids: List[str], page: int = 0, size: int = 10000, ) -> WorkClassificationPage: - must = [ - { - "nested": { - "path": "authors", - "query": {"term": {"authors.id": f"{_prefix_id(raw_oa_author_id)}"}}, - } - } - ] + """Retrieves work classifications based on a list of work IDs. - response = await elasticsearch.search( - ESIndex.WORK_CLASSIFICATIONS, + Args: + work_ids (List[str]): The list of work IDs to retrieve classifications for. + page (int, optional): The page number. Defaults to 0. + size (int, optional): The number of results per page. Defaults to 10000. + + Returns: + WorkClassificationPage: The page of work classifications matching the criteria. + """ + + work_ids = [_prefix_id(wid) for wid in work_ids] + + return await search_work_classifications( + query={"terms": {"work_id": work_ids}}, source=[ "work_id", "doi", @@ -576,99 +773,119 @@ async def get_work_classifications_by_author_id( "institutions", "topics", "classification", + "classification_meta", + "validation", ], - query={"bool": {"must": must}}, - size=size, - offset=page * size, - ) - - hits_block = response.get("hits", {}) - total = hits_block.get("total", {}).get("value", 0) - elements = [] - for hit in hits_block.get("hits", []): - classification = WorkClassification.from_dict(hit.get("_source", {})) # type: ignore - if classification is not None: - elements.append(classification) - - return WorkClassificationPage( - elements=elements, - total=total, page=page, size=size, ) -async def get_work_classification_by_work_id( - work_id: str, -) -> Optional[WorkClassification]: - response = await elasticsearch.search( - ESIndex.WORK_CLASSIFICATIONS, - source=[ - "work_id", - "doi", - "title", - "publication_year", - "authors", - "institutions", - "topics", - "classification", - "classification_meta", - "validation", - ], - query={"term": {"work_id": f"{_prefix_id(work_id)}"}}, - size=1, - ) - - hits = response.get("hits", {}).get("hits", []) - if not hits: - return None - - return WorkClassification.from_dict(hits[0].get("_source", {})) - - async def get_work_classifications_by_work_ids( + access_token_metadata: AccessTokenMetadata, work_ids: List[str], page: int = 0, size: int = 10000, ) -> WorkClassificationPage: - prefixed = [_prefix_id(wid) for wid in work_ids] + """Retrieves work classifications for a list of work IDs, filtered by the effective institution ID from the access token metadata. - logger.debug(f"Fetching work classifications for work IDs: {prefixed}") + Args: + access_token_metadata (AccessTokenMetadata): The access token metadata containing the effective institution ID. + work_ids (List[str]): The list of work IDs to retrieve classifications for. + page (int, optional): The page number. Defaults to 0. + size (int, optional): The number of results per page. Defaults to 10000. - response = await elasticsearch.search( + Returns: + WorkClassificationPage: The page of work classifications matching the criteria. + """ + raw_account_institution_id = access_token_metadata.effective_institution_id + + work_page = await _get_works_by_work_ids_and_institution_id( + work_ids=work_ids, raw_oa_institution_id=raw_account_institution_id + ) + + allowed_work_ids: List[str] = [ + work.id for work in work_page.elements if work.id is not None + ] + + return await _get_work_classifications_by_work_ids( + work_ids=allowed_work_ids, page=page, size=size + ) + + +async def _get_work_classification_by_work_id( + raw_oa_work_id: str, source: Optional[List[str]] = None +) -> Optional[WorkClassification]: + """Retrieves a work classification for a specific work ID. + + Args: + raw_oa_work_id (str): The work ID for which to retrieve classification. + source (Optional[List[str]], optional): The fields to include in the response. Defaults to None. + + Returns: + Optional[WorkClassification]: The work classification if found, otherwise None. + """ + + response = await elasticsearch.get( ESIndex.WORK_CLASSIFICATIONS, + doc_id=raw_oa_work_id, + source=source, + ) + + _source = response.get("_source") + if _source: + return WorkClassification.from_dict(_source) + + return None + + +async def get_work_classification_by_work_id( + access_token_metadata: AccessTokenMetadata, + raw_oa_work_id: str, +) -> Optional[WorkClassification]: + """Retrieves a work classification for a specific work ID, filtered by the effective institution ID from the access token metadata. + + Args: + access_token_metadata (AccessTokenMetadata): The access token metadata containing the effective institution ID. + raw_oa_work_id (str): The work ID for which to retrieve classification. + + Returns: + Optional[WorkClassification]: The work classification if found, otherwise None. + """ + + raw_account_institution_id = access_token_metadata.effective_institution_id + if not raw_account_institution_id: + return None + + work = await get_work( + raw_oa_work_id=raw_oa_work_id, source=["id", "authorships.institutions.id"] + ) + if not work: + return None + + if not _work_has_authorship_with_institution_id(work, raw_account_institution_id): + return None + + return await _get_work_classification_by_work_id( + raw_oa_work_id=raw_oa_work_id, source=[ "work_id", - "doi", - "title", - "publication_year", - "authors", - "institutions", - "topics", "classification", "classification_meta", "validation", ], - query={"terms": {"work_id": prefixed}}, - size=size, - offset=page * size, ) - hits_block = response.get("hits", {}) - total = hits_block.get("total", {}).get("value", 0) - elements: List[WorkClassification] = [] - for hit in hits_block.get("hits", []): - classification = WorkClassification.from_dict(hit.get("_source", {})) - if classification is not None: - elements.append(classification) - - p = WorkClassificationPage(elements=elements, total=total, page=page, size=size) - logger.debug(f"Returning WorkClassificationPage: {p}") - - return p - def _prefix_id(raw_id: str) -> str: + """Adds the OpenAlex prefix to an ID if it does not already have it. + + Args: + raw_id (str): The ID to prefix. + + Returns: + str: The ID with the OpenAlex prefix added if it was missing. + """ if not raw_id.startswith("https://openalex.org/"): return f"https://openalex.org/{raw_id}" return raw_id diff --git a/ude_person.http b/ude_person.http index 46eeccc8..e139e498 100644 --- a/ude_person.http +++ b/ude_person.http @@ -1193,6 +1193,11 @@ GET https://project.nes.uni-due.de/elastic/openalex-authors/_mapping Authorization: ApiKey am1wWXBaMEJEVWJoZkE5MnBaUlk6TWlvbW1LRlMzNjdDUHgzYmVkUmI5UQ== Content-Type: application/json +### + +GET https://project.nes.uni-due.de/elastic/openalex-authors/_search +Authorization: ApiKey am1wWXBaMEJEVWJoZkE5MnBaUlk6TWlvbW1LRlMzNjdDUHgzYmVkUmI5UQ== +Content-Type: application/json ### diff --git a/webapp/src/app/api/.openapi-generator/FILES b/webapp/src/app/api/.openapi-generator/FILES index 170b634e..a6fd90b6 100644 --- a/webapp/src/app/api/.openapi-generator/FILES +++ b/webapp/src/app/api/.openapi-generator/FILES @@ -5,12 +5,14 @@ api.base.service.ts api.module.ts api/api.ts api/auth.service.ts +api/authorsV2.service.ts api/bookmarks.service.ts api/companyConnections.service.ts api/dashboard.service.ts api/funding.service.ts api/iNSEService.service.ts api/institutions.service.ts +api/institutionsV2.service.ts api/keywords.service.ts api/news.service.ts api/organization.service.ts @@ -19,6 +21,7 @@ api/personNetwork.service.ts api/persons.service.ts api/projects.service.ts api/topics.service.ts +api/topicsV2.service.ts api/universityRankings.service.ts api/works.service.ts api/worksV2.service.ts @@ -36,6 +39,7 @@ model/authorAffiliationsInner.ts model/authorCountsByYearInner.ts model/authorIds.ts model/authorNetworkNode.ts +model/authorPage.ts model/authorParsedLongestName.ts model/authorPositionCount.ts model/authorSummaryStats.ts @@ -128,9 +132,7 @@ model/hEUWebLink.ts model/hTTPValidationError.ts model/idTokenMetadata.ts model/inseAccountManagementModelOrganizationProfile.ts -model/inseModelsOpenalexWorkPageWorkPage.ts model/inseOrganizationManagementModelOrganizationProfile.ts -model/inseWorksV2ModelWorkPage.ts model/institution.ts model/institutionFunderSummary.ts model/institutionGeo.ts @@ -138,11 +140,16 @@ model/institutionIds.ts model/institutionInformation.ts model/institutionNetworkNode.ts model/institutionPage.ts +model/institutionPageV2.ts model/institutionsListResponse.ts model/ipcClassification.ts model/keywordEntry.ts model/keywordEntryWithTopic.ts +model/keywordEvidence.ts +model/keywordPatentLevel.ts +model/keywordPatentMappingStatus.ts model/keywordPatentMatch.ts +model/keywordPatentSearchDiagnostics.ts model/keywordPatentSearchItem.ts model/keywordTopicMatch.ts model/keywords.ts @@ -200,6 +207,7 @@ model/topicHeatmap.ts model/topicHeatmapField.ts model/topicHeatmapValue.ts model/topicIds.ts +model/topicPageV2.ts model/topicSubfield.ts model/topicYearlyData.ts model/topics.ts @@ -225,6 +233,8 @@ model/workClassification.ts model/workClassificationAuthor.ts model/workClassificationDetails.ts model/workClassificationInstitution.ts +model/workClassificationMerge.ts +model/workClassificationMergePage.ts model/workClassificationMeta.ts model/workClassificationPage.ts model/workClassificationTopic.ts @@ -236,6 +246,8 @@ model/workIds.ts model/workKeyword.ts model/workMeshInner.ts model/workNetworkNode.ts +model/workPage.ts +model/workPageV2.ts model/workPrimaryCategory.ts model/workSortBy.ts model/workSustainableDevelopmentGoalsInner.ts diff --git a/webapp/src/app/api/README.md b/webapp/src/app/api/README.md index 2df9da7b..dfa7b6e7 100644 --- a/webapp/src/app/api/README.md +++ b/webapp/src/app/api/README.md @@ -46,10 +46,10 @@ npm link In your project: ```console -npm link +npm link ``` -**Note for Windows users:** The Angular CLI has troubles to use linked npm packages. +__Note for Windows users:__ The Angular CLI has troubles to use linked npm packages. Please refer to this issue for a solution / workaround. Published packages are not effected by this issue. @@ -58,22 +58,22 @@ Published packages are not effected by this issue. In your Angular project: ```typescript + import { ApplicationConfig } from '@angular/core'; import { provideHttpClient } from '@angular/common/http'; import { provideApi } from ''; export const appConfig: ApplicationConfig = { - providers: [ - // ... - provideHttpClient(), - provideApi(), - ], + providers: [ + // ... + provideHttpClient(), + provideApi() + ], }; ``` **NOTE** If you're still using `AppModule` and haven't [migrated](https://angular.dev/reference/migrations/standalone) yet, you can still import an Angular module: - ```typescript import { ApiModule } from ''; ``` @@ -86,11 +86,11 @@ import { provideHttpClient } from '@angular/common/http'; import { provideApi } from ''; export const appConfig: ApplicationConfig = { - providers: [ - // ... - provideHttpClient(), - provideApi('http://localhost:9999'), - ], + providers: [ + // ... + provideHttpClient(), + provideApi('http://localhost:9999') + ], }; ``` @@ -101,15 +101,15 @@ import { provideHttpClient } from '@angular/common/http'; import { provideApi } from ''; export const appConfig: ApplicationConfig = { - providers: [ - // ... - provideHttpClient(), - provideApi({ - withCredentials: true, - username: 'user', - password: 'password', - }), - ], + providers: [ + // ... + provideHttpClient(), + provideApi({ + withCredentials: true, + username: 'user', + password: 'password' + }) + ], }; ``` @@ -120,22 +120,21 @@ import { provideHttpClient } from '@angular/common/http'; import { provideApi, Configuration } from ''; export const appConfig: ApplicationConfig = { - providers: [ - // ... - provideHttpClient(), - { - provide: Configuration, - useFactory: (authService: AuthService) => - new Configuration({ - basePath: 'http://localhost:9999', - withCredentials: true, - username: authService.getUsername(), - password: authService.getPassword(), - }), - deps: [AuthService], - multi: false, - }, - ], + providers: [ + // ... + provideHttpClient(), + { + provide: Configuration, + useFactory: (authService: AuthService) => new Configuration({ + basePath: 'http://localhost:9999', + withCredentials: true, + username: authService.getUsername(), + password: authService.getPassword(), + }), + deps: [AuthService], + multi: false + } + ], }; ``` @@ -152,12 +151,12 @@ import { HttpClientModule } from '@angular/common/http'; import { environment } from '../environments/environment'; export const appConfig: ApplicationConfig = { - providers: [ - // ... - provideHttpClient(), - provideUserApi(environment.basePath), - provideAdminApi(environment.basePath), - ], + providers: [ + // ... + provideHttpClient(), + provideUserApi(environment.basePath), + provideAdminApi(environment.basePath), + ], }; ``` @@ -177,8 +176,8 @@ Example value for use in your Configuration-Provider: ```typescript new Configuration({ - encodeParam: (param: Param) => myFancyParamEncoder(param), -}); + encodeParam: (param: Param) => myFancyParamEncoder(param), +}) ``` [parameter-locations-url]: https://github.com/OAI/OpenAPI-Specification/blob/main/versions/3.1.0.md#parameter-locations diff --git a/webapp/src/app/api/api.base.service.ts b/webapp/src/app/api/api.base.service.ts index d9ec8f2e..dcf56358 100644 --- a/webapp/src/app/api/api.base.service.ts +++ b/webapp/src/app/api/api.base.service.ts @@ -1,109 +1,83 @@ /** * Innovation Search Engine API * - * + * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech * Do not edit the class manually. */ -import { - HttpHeaders, - HttpParams, - HttpParameterCodec, -} from '@angular/common/http'; +import { HttpHeaders, HttpParams, HttpParameterCodec } from '@angular/common/http'; import { CustomHttpParameterCodec } from './encoder'; import { Configuration } from './configuration'; export class BaseService { - protected basePath = 'http://localhost:8000'; - public defaultHeaders = new HttpHeaders(); - public configuration: Configuration; - public encoder: HttpParameterCodec; + protected basePath = 'http://localhost:8000'; + public defaultHeaders = new HttpHeaders(); + public configuration: Configuration; + public encoder: HttpParameterCodec; - constructor(basePath?: string | string[], configuration?: Configuration) { - this.configuration = configuration || new Configuration(); - if (typeof this.configuration.basePath !== 'string') { - const firstBasePath = Array.isArray(basePath) ? basePath[0] : undefined; - if (firstBasePath != undefined) { - basePath = firstBasePath; - } + constructor(basePath?: string|string[], configuration?: Configuration) { + this.configuration = configuration || new Configuration(); + if (typeof this.configuration.basePath !== 'string') { + const firstBasePath = Array.isArray(basePath) ? basePath[0] : undefined; + if (firstBasePath != undefined) { + basePath = firstBasePath; + } - if (typeof basePath !== 'string') { - basePath = this.basePath; - } - this.configuration.basePath = basePath; - } - this.encoder = this.configuration.encoder || new CustomHttpParameterCodec(); - } - - protected canConsumeForm(consumes: string[]): boolean { - return consumes.indexOf('multipart/form-data') !== -1; - } - - protected addToHttpParams( - httpParams: HttpParams, - value: any, - key?: string, - isDeep: boolean = false, - ): HttpParams { - // If the value is an object (but not a Date), recursively add its keys. - if (typeof value === 'object' && !(value instanceof Date)) { - return this.addToHttpParamsRecursive( - httpParams, - value, - isDeep ? key : undefined, - isDeep, - ); - } - return this.addToHttpParamsRecursive(httpParams, value, key); - } - - protected addToHttpParamsRecursive( - httpParams: HttpParams, - value?: any, - key?: string, - isDeep: boolean = false, - ): HttpParams { - if (value === null || value === undefined) { - return httpParams; - } - if (typeof value === 'object') { - // If JSON format is preferred, key must be provided. - if (key != null) { - return isDeep - ? Object.keys(value as Record).reduce( - (hp, k) => hp.append(`${key}[${k}]`, value[k]), - httpParams, - ) - : httpParams.append(key, JSON.stringify(value)); - } - // Otherwise, if it's an array, add each element. - if (Array.isArray(value)) { - value.forEach( - (elem) => - (httpParams = this.addToHttpParamsRecursive(httpParams, elem, key)), - ); - } else if (value instanceof Date) { - if (key != null) { - httpParams = httpParams.append(key, value.toISOString()); - } else { - throw Error('key may not be null if value is Date'); + if (typeof basePath !== 'string') { + basePath = this.basePath; + } + this.configuration.basePath = basePath; } - } else { - Object.keys(value).forEach((k) => { - const paramKey = key ? `${key}.${k}` : k; - httpParams = this.addToHttpParamsRecursive( - httpParams, - value[k], - paramKey, - ); - }); - } - return httpParams; - } else if (key != null) { - return httpParams.append(key, value); + this.encoder = this.configuration.encoder || new CustomHttpParameterCodec(); + } + + protected canConsumeForm(consumes: string[]): boolean { + return consumes.indexOf('multipart/form-data') !== -1; + } + + protected addToHttpParams(httpParams: HttpParams, value: any, key?: string, isDeep: boolean = false): HttpParams { + // If the value is an object (but not a Date), recursively add its keys. + if (typeof value === 'object' && !(value instanceof Date)) { + return this.addToHttpParamsRecursive(httpParams, value, isDeep ? key : undefined, isDeep); + } + return this.addToHttpParamsRecursive(httpParams, value, key); + } + + protected addToHttpParamsRecursive(httpParams: HttpParams, value?: any, key?: string, isDeep: boolean = false): HttpParams { + if (value === null || value === undefined) { + return httpParams; + } + if (typeof value === 'object') { + // If JSON format is preferred, key must be provided. + if (key != null) { + return isDeep + ? Object.keys(value as Record).reduce( + (hp, k) => hp.append(`${key}[${k}]`, value[k]), + httpParams, + ) + : httpParams.append(key, JSON.stringify(value)); + } + // Otherwise, if it's an array, add each element. + if (Array.isArray(value)) { + value.forEach(elem => httpParams = this.addToHttpParamsRecursive(httpParams, elem, key)); + } else if (value instanceof Date) { + if (key != null) { + httpParams = httpParams.append(key, value.toISOString()); + } else { + throw Error("key may not be null if value is Date"); + } + } else { + Object.keys(value).forEach(k => { + const paramKey = key ? `${key}.${k}` : k; + httpParams = this.addToHttpParamsRecursive(httpParams, value[k], paramKey); + }); + } + return httpParams; + } else if (key != null) { + return httpParams.append(key, value); + } + throw Error("key may not be null if value is not object or array"); } - throw Error('key may not be null if value is not object or array'); - } } diff --git a/webapp/src/app/api/api.module.ts b/webapp/src/app/api/api.module.ts index e29250f2..58d341fb 100644 --- a/webapp/src/app/api/api.module.ts +++ b/webapp/src/app/api/api.module.ts @@ -1,42 +1,30 @@ -import { - NgModule, - ModuleWithProviders, - SkipSelf, - Optional, -} from '@angular/core'; +import { NgModule, ModuleWithProviders, SkipSelf, Optional } from '@angular/core'; import { Configuration } from './configuration'; import { HttpClient } from '@angular/common/http'; + @NgModule({ - imports: [], + imports: [], declarations: [], - exports: [], - providers: [], + exports: [], + providers: [] }) export class ApiModule { - public static forRoot( - configurationFactory: () => Configuration, - ): ModuleWithProviders { - return { - ngModule: ApiModule, - providers: [{ provide: Configuration, useFactory: configurationFactory }], - }; - } + public static forRoot(configurationFactory: () => Configuration): ModuleWithProviders { + return { + ngModule: ApiModule, + providers: [ { provide: Configuration, useFactory: configurationFactory } ] + }; + } - constructor( - @Optional() @SkipSelf() parentModule: ApiModule, - @Optional() http: HttpClient, - ) { - if (parentModule) { - throw new Error( - 'ApiModule is already loaded. Import in your base AppModule only.', - ); + constructor( @Optional() @SkipSelf() parentModule: ApiModule, + @Optional() http: HttpClient) { + if (parentModule) { + throw new Error('ApiModule is already loaded. Import in your base AppModule only.'); + } + if (!http) { + throw new Error('You need to import the HttpClientModule in your AppModule! \n' + + 'See also https://github.com/angular/angular/issues/20575'); + } } - if (!http) { - throw new Error( - 'You need to import the HttpClientModule in your AppModule! \n' + - 'See also https://github.com/angular/angular/issues/20575', - ); - } - } } diff --git a/webapp/src/app/api/api/api.ts b/webapp/src/app/api/api/api.ts index d7bae3a8..5fe8de7d 100644 --- a/webapp/src/app/api/api/api.ts +++ b/webapp/src/app/api/api/api.ts @@ -1,5 +1,7 @@ export * from './auth.service'; import { AuthService } from './auth.service'; +export * from './authorsV2.service'; +import { AuthorsV2Service } from './authorsV2.service'; export * from './bookmarks.service'; import { BookmarksService } from './bookmarks.service'; export * from './companyConnections.service'; @@ -12,6 +14,8 @@ export * from './iNSEService.service'; import { INSEServiceService } from './iNSEService.service'; export * from './institutions.service'; import { InstitutionsService } from './institutions.service'; +export * from './institutionsV2.service'; +import { InstitutionsV2Service } from './institutionsV2.service'; export * from './keywords.service'; import { KeywordsService } from './keywords.service'; export * from './news.service'; @@ -28,29 +32,12 @@ export * from './projects.service'; import { ProjectsService } from './projects.service'; export * from './topics.service'; import { TopicsService } from './topics.service'; +export * from './topicsV2.service'; +import { TopicsV2Service } from './topicsV2.service'; export * from './universityRankings.service'; import { UniversityRankingsService } from './universityRankings.service'; export * from './works.service'; import { WorksService } from './works.service'; export * from './worksV2.service'; import { WorksV2Service } from './worksV2.service'; -export const APIS = [ - AuthService, - BookmarksService, - CompanyConnectionsService, - DashboardService, - FundingService, - INSEServiceService, - InstitutionsService, - KeywordsService, - NewsService, - OrganizationService, - PatentsService, - PersonNetworkService, - PersonsService, - ProjectsService, - TopicsService, - UniversityRankingsService, - WorksService, - WorksV2Service, -]; +export const APIS = [AuthService, AuthorsV2Service, BookmarksService, CompanyConnectionsService, DashboardService, FundingService, INSEServiceService, InstitutionsService, InstitutionsV2Service, KeywordsService, NewsService, OrganizationService, PatentsService, PersonNetworkService, PersonsService, ProjectsService, TopicsService, TopicsV2Service, UniversityRankingsService, WorksService, WorksV2Service]; diff --git a/webapp/src/app/api/api/auth.service.ts b/webapp/src/app/api/api/auth.service.ts index e504fdc9..a906d12f 100644 --- a/webapp/src/app/api/api/auth.service.ts +++ b/webapp/src/app/api/api/auth.service.ts @@ -1,7 +1,7 @@ /** * Innovation Search Engine API * - * + * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech @@ -9,18 +9,12 @@ */ /* tslint:disable:no-unused-variable member-ordering */ -import { Inject, Injectable, Optional } from '@angular/core'; -import { - HttpClient, - HttpHeaders, - HttpParams, - HttpResponse, - HttpEvent, - HttpParameterCodec, - HttpContext, -} from '@angular/common/http'; -import { CustomHttpParameterCodec } from '../encoder'; -import { Observable } from 'rxjs'; +import { Inject, Injectable, Optional } from '@angular/core'; +import { HttpClient, HttpHeaders, HttpParams, + HttpResponse, HttpEvent, HttpParameterCodec, HttpContext + } from '@angular/common/http'; +import { CustomHttpParameterCodec } from '../encoder'; +import { Observable } from 'rxjs'; // @ts-ignore import { AccessResponse } from '../model/accessResponse'; @@ -56,1749 +50,964 @@ import { OtkResponse } from '../model/otkResponse'; import { UpdateAccountRequest } from '../model/updateAccountRequest'; // @ts-ignore -import { BASE_PATH, COLLECTION_FORMATS } from '../variables'; -import { Configuration } from '../configuration'; +import { BASE_PATH, COLLECTION_FORMATS } from '../variables'; +import { Configuration } from '../configuration'; import { BaseService } from '../api.base.service'; + + @Injectable({ - providedIn: 'root', + providedIn: 'root' }) export class AuthService extends BaseService { - constructor( - protected httpClient: HttpClient, - @Optional() @Inject(BASE_PATH) basePath: string | string[], - @Optional() configuration?: Configuration, - ) { - super(basePath, configuration); - } - /** - * Change Password - * Change the user\'s password and invalidate existing tokens. - * @endpoint post /api/auth/v2/change-password - * @param bodyChangePassword - * @param secureFgpAcc - * @param observe set whether or not to return the data Observable as the body, response or events. defaults to returning the body. - * @param reportProgress flag to report request and response progress. - */ - public changePassword( - bodyChangePassword: BodyChangePassword, - secureFgpAcc?: string, - observe?: 'body', - reportProgress?: boolean, - options?: { - httpHeaderAccept?: 'application/json'; - context?: HttpContext; - transferCache?: boolean; - }, - ): Observable; - public changePassword( - bodyChangePassword: BodyChangePassword, - secureFgpAcc?: string, - observe?: 'response', - reportProgress?: boolean, - options?: { - httpHeaderAccept?: 'application/json'; - context?: HttpContext; - transferCache?: boolean; - }, - ): Observable>; - public changePassword( - bodyChangePassword: BodyChangePassword, - secureFgpAcc?: string, - observe?: 'events', - reportProgress?: boolean, - options?: { - httpHeaderAccept?: 'application/json'; - context?: HttpContext; - transferCache?: boolean; - }, - ): Observable>; - public changePassword( - bodyChangePassword: BodyChangePassword, - secureFgpAcc?: string, - observe: any = 'body', - reportProgress: boolean = false, - options?: { - httpHeaderAccept?: 'application/json'; - context?: HttpContext; - transferCache?: boolean; - }, - ): Observable { - if (bodyChangePassword === null || bodyChangePassword === undefined) { - throw new Error( - 'Required parameter bodyChangePassword was null or undefined when calling changePassword.', - ); + constructor(protected httpClient: HttpClient, @Optional() @Inject(BASE_PATH) basePath: string|string[], @Optional() configuration?: Configuration) { + super(basePath, configuration); } - let localVarHeaders = this.defaultHeaders; + /** + * Change Password + * Change the user\'s password and invalidate existing tokens. + * @endpoint post /api/auth/v2/change-password + * @param bodyChangePassword + * @param secureFgpAcc + * @param observe set whether or not to return the data Observable as the body, response or events. defaults to returning the body. + * @param reportProgress flag to report request and response progress. + */ + public changePassword(bodyChangePassword: BodyChangePassword, secureFgpAcc?: string, observe?: 'body', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable; + public changePassword(bodyChangePassword: BodyChangePassword, secureFgpAcc?: string, observe?: 'response', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable>; + public changePassword(bodyChangePassword: BodyChangePassword, secureFgpAcc?: string, observe?: 'events', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable>; + public changePassword(bodyChangePassword: BodyChangePassword, secureFgpAcc?: string, observe: any = 'body', reportProgress: boolean = false, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable { + if (bodyChangePassword === null || bodyChangePassword === undefined) { + throw new Error('Required parameter bodyChangePassword was null or undefined when calling changePassword.'); + } - // authentication (HTTPBearer) required - localVarHeaders = this.configuration.addCredentialToHeaders( - 'HTTPBearer', - 'Authorization', - localVarHeaders, - 'Bearer ', - ); + let localVarHeaders = this.defaultHeaders; - const localVarHttpHeaderAcceptSelected: string | undefined = - options?.httpHeaderAccept ?? - this.configuration.selectHeaderAccept(['application/json']); - if (localVarHttpHeaderAcceptSelected !== undefined) { - localVarHeaders = localVarHeaders.set( - 'Accept', - localVarHttpHeaderAcceptSelected, - ); + // authentication (HTTPBearer) required + localVarHeaders = this.configuration.addCredentialToHeaders('HTTPBearer', 'Authorization', localVarHeaders, 'Bearer '); + + const localVarHttpHeaderAcceptSelected: string | undefined = options?.httpHeaderAccept ?? this.configuration.selectHeaderAccept([ + 'application/json' + ]); + if (localVarHttpHeaderAcceptSelected !== undefined) { + localVarHeaders = localVarHeaders.set('Accept', localVarHttpHeaderAcceptSelected); + } + + const localVarHttpContext: HttpContext = options?.context ?? new HttpContext(); + + const localVarTransferCache: boolean = options?.transferCache ?? true; + + + // to determine the Content-Type header + const consumes: string[] = [ + 'application/json' + ]; + const httpContentTypeSelected: string | undefined = this.configuration.selectHeaderContentType(consumes); + if (httpContentTypeSelected !== undefined) { + localVarHeaders = localVarHeaders.set('Content-Type', httpContentTypeSelected); + } + + let responseType_: 'text' | 'json' | 'blob' = 'json'; + if (localVarHttpHeaderAcceptSelected) { + if (localVarHttpHeaderAcceptSelected.startsWith('text')) { + responseType_ = 'text'; + } else if (this.configuration.isJsonMime(localVarHttpHeaderAcceptSelected)) { + responseType_ = 'json'; + } else { + responseType_ = 'blob'; + } + } + + let localVarPath = `/api/auth/v2/change-password`; + const { basePath, withCredentials } = this.configuration; + return this.httpClient.request('post', `${basePath}${localVarPath}`, + { + context: localVarHttpContext, + body: bodyChangePassword, + responseType: responseType_, + ...(withCredentials ? { withCredentials } : {}), + headers: localVarHeaders, + observe: observe, + ...(localVarTransferCache !== undefined ? { transferCache: localVarTransferCache } : {}), + reportProgress: reportProgress + } + ); } - const localVarHttpContext: HttpContext = - options?.context ?? new HttpContext(); + /** + * Create Account + * @endpoint post /api/accounts + * @param createAccountRequest + * @param secureFgpAcc + * @param observe set whether or not to return the data Observable as the body, response or events. defaults to returning the body. + * @param reportProgress flag to report request and response progress. + */ + public createAccount(createAccountRequest: CreateAccountRequest, secureFgpAcc?: string, observe?: 'body', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable; + public createAccount(createAccountRequest: CreateAccountRequest, secureFgpAcc?: string, observe?: 'response', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable>; + public createAccount(createAccountRequest: CreateAccountRequest, secureFgpAcc?: string, observe?: 'events', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable>; + public createAccount(createAccountRequest: CreateAccountRequest, secureFgpAcc?: string, observe: any = 'body', reportProgress: boolean = false, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable { + if (createAccountRequest === null || createAccountRequest === undefined) { + throw new Error('Required parameter createAccountRequest was null or undefined when calling createAccount.'); + } - const localVarTransferCache: boolean = options?.transferCache ?? true; + let localVarHeaders = this.defaultHeaders; - // to determine the Content-Type header - const consumes: string[] = ['application/json']; - const httpContentTypeSelected: string | undefined = - this.configuration.selectHeaderContentType(consumes); - if (httpContentTypeSelected !== undefined) { - localVarHeaders = localVarHeaders.set( - 'Content-Type', - httpContentTypeSelected, - ); + // authentication (HTTPBearer) required + localVarHeaders = this.configuration.addCredentialToHeaders('HTTPBearer', 'Authorization', localVarHeaders, 'Bearer '); + + const localVarHttpHeaderAcceptSelected: string | undefined = options?.httpHeaderAccept ?? this.configuration.selectHeaderAccept([ + 'application/json' + ]); + if (localVarHttpHeaderAcceptSelected !== undefined) { + localVarHeaders = localVarHeaders.set('Accept', localVarHttpHeaderAcceptSelected); + } + + const localVarHttpContext: HttpContext = options?.context ?? new HttpContext(); + + const localVarTransferCache: boolean = options?.transferCache ?? true; + + + // to determine the Content-Type header + const consumes: string[] = [ + 'application/json' + ]; + const httpContentTypeSelected: string | undefined = this.configuration.selectHeaderContentType(consumes); + if (httpContentTypeSelected !== undefined) { + localVarHeaders = localVarHeaders.set('Content-Type', httpContentTypeSelected); + } + + let responseType_: 'text' | 'json' | 'blob' = 'json'; + if (localVarHttpHeaderAcceptSelected) { + if (localVarHttpHeaderAcceptSelected.startsWith('text')) { + responseType_ = 'text'; + } else if (this.configuration.isJsonMime(localVarHttpHeaderAcceptSelected)) { + responseType_ = 'json'; + } else { + responseType_ = 'blob'; + } + } + + let localVarPath = `/api/accounts`; + const { basePath, withCredentials } = this.configuration; + return this.httpClient.request('post', `${basePath}${localVarPath}`, + { + context: localVarHttpContext, + body: createAccountRequest, + responseType: responseType_, + ...(withCredentials ? { withCredentials } : {}), + headers: localVarHeaders, + observe: observe, + ...(localVarTransferCache !== undefined ? { transferCache: localVarTransferCache } : {}), + reportProgress: reportProgress + } + ); } - let responseType_: 'text' | 'json' | 'blob' = 'json'; - if (localVarHttpHeaderAcceptSelected) { - if (localVarHttpHeaderAcceptSelected.startsWith('text')) { - responseType_ = 'text'; - } else if ( - this.configuration.isJsonMime(localVarHttpHeaderAcceptSelected) - ) { - responseType_ = 'json'; - } else { - responseType_ = 'blob'; - } + /** + * Delete Account + * @endpoint delete /api/accounts/{account_id} + * @param accountId + * @param secureFgpAcc + * @param observe set whether or not to return the data Observable as the body, response or events. defaults to returning the body. + * @param reportProgress flag to report request and response progress. + */ + public deleteAccount(accountId: string, secureFgpAcc?: string, observe?: 'body', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable; + public deleteAccount(accountId: string, secureFgpAcc?: string, observe?: 'response', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable>; + public deleteAccount(accountId: string, secureFgpAcc?: string, observe?: 'events', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable>; + public deleteAccount(accountId: string, secureFgpAcc?: string, observe: any = 'body', reportProgress: boolean = false, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable { + if (accountId === null || accountId === undefined) { + throw new Error('Required parameter accountId was null or undefined when calling deleteAccount.'); + } + + let localVarHeaders = this.defaultHeaders; + + // authentication (HTTPBearer) required + localVarHeaders = this.configuration.addCredentialToHeaders('HTTPBearer', 'Authorization', localVarHeaders, 'Bearer '); + + const localVarHttpHeaderAcceptSelected: string | undefined = options?.httpHeaderAccept ?? this.configuration.selectHeaderAccept([ + 'application/json' + ]); + if (localVarHttpHeaderAcceptSelected !== undefined) { + localVarHeaders = localVarHeaders.set('Accept', localVarHttpHeaderAcceptSelected); + } + + const localVarHttpContext: HttpContext = options?.context ?? new HttpContext(); + + const localVarTransferCache: boolean = options?.transferCache ?? true; + + + let responseType_: 'text' | 'json' | 'blob' = 'json'; + if (localVarHttpHeaderAcceptSelected) { + if (localVarHttpHeaderAcceptSelected.startsWith('text')) { + responseType_ = 'text'; + } else if (this.configuration.isJsonMime(localVarHttpHeaderAcceptSelected)) { + responseType_ = 'json'; + } else { + responseType_ = 'blob'; + } + } + + let localVarPath = `/api/accounts/${this.configuration.encodeParam({name: "accountId", value: accountId, in: "path", style: "simple", explode: false, dataType: "string", dataFormat: "uuid"})}`; + const { basePath, withCredentials } = this.configuration; + return this.httpClient.request('delete', `${basePath}${localVarPath}`, + { + context: localVarHttpContext, + responseType: responseType_, + ...(withCredentials ? { withCredentials } : {}), + headers: localVarHeaders, + observe: observe, + ...(localVarTransferCache !== undefined ? { transferCache: localVarTransferCache } : {}), + reportProgress: reportProgress + } + ); } - let localVarPath = `/api/auth/v2/change-password`; - const { basePath, withCredentials } = this.configuration; - return this.httpClient.request('post', `${basePath}${localVarPath}`, { - context: localVarHttpContext, - body: bodyChangePassword, - responseType: responseType_, - ...(withCredentials ? { withCredentials } : {}), - headers: localVarHeaders, - observe: observe, - ...(localVarTransferCache !== undefined - ? { transferCache: localVarTransferCache } - : {}), - reportProgress: reportProgress, - }); - } + /** + * Get Access Token + * Retrieve an access token for the authenticated user. + * @endpoint post /api/auth/v2/access + * @param bodyGetAccessToken + * @param idToken + * @param observe set whether or not to return the data Observable as the body, response or events. defaults to returning the body. + * @param reportProgress flag to report request and response progress. + */ + public getAccessToken(bodyGetAccessToken: BodyGetAccessToken, idToken?: string, observe?: 'body', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable; + public getAccessToken(bodyGetAccessToken: BodyGetAccessToken, idToken?: string, observe?: 'response', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable>; + public getAccessToken(bodyGetAccessToken: BodyGetAccessToken, idToken?: string, observe?: 'events', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable>; + public getAccessToken(bodyGetAccessToken: BodyGetAccessToken, idToken?: string, observe: any = 'body', reportProgress: boolean = false, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable { + if (bodyGetAccessToken === null || bodyGetAccessToken === undefined) { + throw new Error('Required parameter bodyGetAccessToken was null or undefined when calling getAccessToken.'); + } - /** - * Create Account - * @endpoint post /api/accounts - * @param createAccountRequest - * @param secureFgpAcc - * @param observe set whether or not to return the data Observable as the body, response or events. defaults to returning the body. - * @param reportProgress flag to report request and response progress. - */ - public createAccount( - createAccountRequest: CreateAccountRequest, - secureFgpAcc?: string, - observe?: 'body', - reportProgress?: boolean, - options?: { - httpHeaderAccept?: 'application/json'; - context?: HttpContext; - transferCache?: boolean; - }, - ): Observable; - public createAccount( - createAccountRequest: CreateAccountRequest, - secureFgpAcc?: string, - observe?: 'response', - reportProgress?: boolean, - options?: { - httpHeaderAccept?: 'application/json'; - context?: HttpContext; - transferCache?: boolean; - }, - ): Observable>; - public createAccount( - createAccountRequest: CreateAccountRequest, - secureFgpAcc?: string, - observe?: 'events', - reportProgress?: boolean, - options?: { - httpHeaderAccept?: 'application/json'; - context?: HttpContext; - transferCache?: boolean; - }, - ): Observable>; - public createAccount( - createAccountRequest: CreateAccountRequest, - secureFgpAcc?: string, - observe: any = 'body', - reportProgress: boolean = false, - options?: { - httpHeaderAccept?: 'application/json'; - context?: HttpContext; - transferCache?: boolean; - }, - ): Observable { - if (createAccountRequest === null || createAccountRequest === undefined) { - throw new Error( - 'Required parameter createAccountRequest was null or undefined when calling createAccount.', - ); + let localVarHeaders = this.defaultHeaders; + + const localVarHttpHeaderAcceptSelected: string | undefined = options?.httpHeaderAccept ?? this.configuration.selectHeaderAccept([ + 'application/json' + ]); + if (localVarHttpHeaderAcceptSelected !== undefined) { + localVarHeaders = localVarHeaders.set('Accept', localVarHttpHeaderAcceptSelected); + } + + const localVarHttpContext: HttpContext = options?.context ?? new HttpContext(); + + const localVarTransferCache: boolean = options?.transferCache ?? true; + + + // to determine the Content-Type header + const consumes: string[] = [ + 'application/json' + ]; + const httpContentTypeSelected: string | undefined = this.configuration.selectHeaderContentType(consumes); + if (httpContentTypeSelected !== undefined) { + localVarHeaders = localVarHeaders.set('Content-Type', httpContentTypeSelected); + } + + let responseType_: 'text' | 'json' | 'blob' = 'json'; + if (localVarHttpHeaderAcceptSelected) { + if (localVarHttpHeaderAcceptSelected.startsWith('text')) { + responseType_ = 'text'; + } else if (this.configuration.isJsonMime(localVarHttpHeaderAcceptSelected)) { + responseType_ = 'json'; + } else { + responseType_ = 'blob'; + } + } + + let localVarPath = `/api/auth/v2/access`; + const { basePath, withCredentials } = this.configuration; + return this.httpClient.request('post', `${basePath}${localVarPath}`, + { + context: localVarHttpContext, + body: bodyGetAccessToken, + responseType: responseType_, + ...(withCredentials ? { withCredentials } : {}), + headers: localVarHeaders, + observe: observe, + ...(localVarTransferCache !== undefined ? { transferCache: localVarTransferCache } : {}), + reportProgress: reportProgress + } + ); } - let localVarHeaders = this.defaultHeaders; + /** + * Get Current Account + * @endpoint get /api/accounts/me + * @param secureFgpAcc + * @param observe set whether or not to return the data Observable as the body, response or events. defaults to returning the body. + * @param reportProgress flag to report request and response progress. + */ + public getCurrentAccount(secureFgpAcc?: string, observe?: 'body', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable; + public getCurrentAccount(secureFgpAcc?: string, observe?: 'response', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable>; + public getCurrentAccount(secureFgpAcc?: string, observe?: 'events', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable>; + public getCurrentAccount(secureFgpAcc?: string, observe: any = 'body', reportProgress: boolean = false, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable { - // authentication (HTTPBearer) required - localVarHeaders = this.configuration.addCredentialToHeaders( - 'HTTPBearer', - 'Authorization', - localVarHeaders, - 'Bearer ', - ); + let localVarHeaders = this.defaultHeaders; - const localVarHttpHeaderAcceptSelected: string | undefined = - options?.httpHeaderAccept ?? - this.configuration.selectHeaderAccept(['application/json']); - if (localVarHttpHeaderAcceptSelected !== undefined) { - localVarHeaders = localVarHeaders.set( - 'Accept', - localVarHttpHeaderAcceptSelected, - ); + // authentication (HTTPBearer) required + localVarHeaders = this.configuration.addCredentialToHeaders('HTTPBearer', 'Authorization', localVarHeaders, 'Bearer '); + + const localVarHttpHeaderAcceptSelected: string | undefined = options?.httpHeaderAccept ?? this.configuration.selectHeaderAccept([ + 'application/json' + ]); + if (localVarHttpHeaderAcceptSelected !== undefined) { + localVarHeaders = localVarHeaders.set('Accept', localVarHttpHeaderAcceptSelected); + } + + const localVarHttpContext: HttpContext = options?.context ?? new HttpContext(); + + const localVarTransferCache: boolean = options?.transferCache ?? true; + + + let responseType_: 'text' | 'json' | 'blob' = 'json'; + if (localVarHttpHeaderAcceptSelected) { + if (localVarHttpHeaderAcceptSelected.startsWith('text')) { + responseType_ = 'text'; + } else if (this.configuration.isJsonMime(localVarHttpHeaderAcceptSelected)) { + responseType_ = 'json'; + } else { + responseType_ = 'blob'; + } + } + + let localVarPath = `/api/accounts/me`; + const { basePath, withCredentials } = this.configuration; + return this.httpClient.request('get', `${basePath}${localVarPath}`, + { + context: localVarHttpContext, + responseType: responseType_, + ...(withCredentials ? { withCredentials } : {}), + headers: localVarHeaders, + observe: observe, + ...(localVarTransferCache !== undefined ? { transferCache: localVarTransferCache } : {}), + reportProgress: reportProgress + } + ); } - const localVarHttpContext: HttpContext = - options?.context ?? new HttpContext(); + /** + * Health Check + * @endpoint get /api/auth/v2/health + * @param observe set whether or not to return the data Observable as the body, response or events. defaults to returning the body. + * @param reportProgress flag to report request and response progress. + */ + public healthCheckApiAuthV2HealthGet(observe?: 'body', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable; + public healthCheckApiAuthV2HealthGet(observe?: 'response', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable>; + public healthCheckApiAuthV2HealthGet(observe?: 'events', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable>; + public healthCheckApiAuthV2HealthGet(observe: any = 'body', reportProgress: boolean = false, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable { - const localVarTransferCache: boolean = options?.transferCache ?? true; + let localVarHeaders = this.defaultHeaders; - // to determine the Content-Type header - const consumes: string[] = ['application/json']; - const httpContentTypeSelected: string | undefined = - this.configuration.selectHeaderContentType(consumes); - if (httpContentTypeSelected !== undefined) { - localVarHeaders = localVarHeaders.set( - 'Content-Type', - httpContentTypeSelected, - ); + const localVarHttpHeaderAcceptSelected: string | undefined = options?.httpHeaderAccept ?? this.configuration.selectHeaderAccept([ + 'application/json' + ]); + if (localVarHttpHeaderAcceptSelected !== undefined) { + localVarHeaders = localVarHeaders.set('Accept', localVarHttpHeaderAcceptSelected); + } + + const localVarHttpContext: HttpContext = options?.context ?? new HttpContext(); + + const localVarTransferCache: boolean = options?.transferCache ?? true; + + + let responseType_: 'text' | 'json' | 'blob' = 'json'; + if (localVarHttpHeaderAcceptSelected) { + if (localVarHttpHeaderAcceptSelected.startsWith('text')) { + responseType_ = 'text'; + } else if (this.configuration.isJsonMime(localVarHttpHeaderAcceptSelected)) { + responseType_ = 'json'; + } else { + responseType_ = 'blob'; + } + } + + let localVarPath = `/api/auth/v2/health`; + const { basePath, withCredentials } = this.configuration; + return this.httpClient.request('get', `${basePath}${localVarPath}`, + { + context: localVarHttpContext, + responseType: responseType_, + ...(withCredentials ? { withCredentials } : {}), + headers: localVarHeaders, + observe: observe, + ...(localVarTransferCache !== undefined ? { transferCache: localVarTransferCache } : {}), + reportProgress: reportProgress + } + ); } - let responseType_: 'text' | 'json' | 'blob' = 'json'; - if (localVarHttpHeaderAcceptSelected) { - if (localVarHttpHeaderAcceptSelected.startsWith('text')) { - responseType_ = 'text'; - } else if ( - this.configuration.isJsonMime(localVarHttpHeaderAcceptSelected) - ) { - responseType_ = 'json'; - } else { - responseType_ = 'blob'; - } + /** + * List Organizations + * @endpoint get /api/accounts/organizations + * @param secureFgpAcc + * @param observe set whether or not to return the data Observable as the body, response or events. defaults to returning the body. + * @param reportProgress flag to report request and response progress. + */ + public listAccountOrganizations(secureFgpAcc?: string, observe?: 'body', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable>; + public listAccountOrganizations(secureFgpAcc?: string, observe?: 'response', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable>>; + public listAccountOrganizations(secureFgpAcc?: string, observe?: 'events', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable>>; + public listAccountOrganizations(secureFgpAcc?: string, observe: any = 'body', reportProgress: boolean = false, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable { + + let localVarHeaders = this.defaultHeaders; + + // authentication (HTTPBearer) required + localVarHeaders = this.configuration.addCredentialToHeaders('HTTPBearer', 'Authorization', localVarHeaders, 'Bearer '); + + const localVarHttpHeaderAcceptSelected: string | undefined = options?.httpHeaderAccept ?? this.configuration.selectHeaderAccept([ + 'application/json' + ]); + if (localVarHttpHeaderAcceptSelected !== undefined) { + localVarHeaders = localVarHeaders.set('Accept', localVarHttpHeaderAcceptSelected); + } + + const localVarHttpContext: HttpContext = options?.context ?? new HttpContext(); + + const localVarTransferCache: boolean = options?.transferCache ?? true; + + + let responseType_: 'text' | 'json' | 'blob' = 'json'; + if (localVarHttpHeaderAcceptSelected) { + if (localVarHttpHeaderAcceptSelected.startsWith('text')) { + responseType_ = 'text'; + } else if (this.configuration.isJsonMime(localVarHttpHeaderAcceptSelected)) { + responseType_ = 'json'; + } else { + responseType_ = 'blob'; + } + } + + let localVarPath = `/api/accounts/organizations`; + const { basePath, withCredentials } = this.configuration; + return this.httpClient.request>('get', `${basePath}${localVarPath}`, + { + context: localVarHttpContext, + responseType: responseType_, + ...(withCredentials ? { withCredentials } : {}), + headers: localVarHeaders, + observe: observe, + ...(localVarTransferCache !== undefined ? { transferCache: localVarTransferCache } : {}), + reportProgress: reportProgress + } + ); } - let localVarPath = `/api/accounts`; - const { basePath, withCredentials } = this.configuration; - return this.httpClient.request( - 'post', - `${basePath}${localVarPath}`, - { - context: localVarHttpContext, - body: createAccountRequest, - responseType: responseType_, - ...(withCredentials ? { withCredentials } : {}), - headers: localVarHeaders, - observe: observe, - ...(localVarTransferCache !== undefined - ? { transferCache: localVarTransferCache } - : {}), - reportProgress: reportProgress, - }, - ); - } + /** + * List Accounts + * @endpoint get /api/accounts + * @param page + * @param pageSize + * @param offset + * @param search + * @param organizationId + * @param secureFgpAcc + * @param observe set whether or not to return the data Observable as the body, response or events. defaults to returning the body. + * @param reportProgress flag to report request and response progress. + */ + public listAccounts(page?: number, pageSize?: number, offset?: number, search?: string, organizationId?: string, secureFgpAcc?: string, observe?: 'body', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable; + public listAccounts(page?: number, pageSize?: number, offset?: number, search?: string, organizationId?: string, secureFgpAcc?: string, observe?: 'response', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable>; + public listAccounts(page?: number, pageSize?: number, offset?: number, search?: string, organizationId?: string, secureFgpAcc?: string, observe?: 'events', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable>; + public listAccounts(page?: number, pageSize?: number, offset?: number, search?: string, organizationId?: string, secureFgpAcc?: string, observe: any = 'body', reportProgress: boolean = false, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable { - /** - * Delete Account - * @endpoint delete /api/accounts/{account_id} - * @param accountId - * @param secureFgpAcc - * @param observe set whether or not to return the data Observable as the body, response or events. defaults to returning the body. - * @param reportProgress flag to report request and response progress. - */ - public deleteAccount( - accountId: string, - secureFgpAcc?: string, - observe?: 'body', - reportProgress?: boolean, - options?: { - httpHeaderAccept?: 'application/json'; - context?: HttpContext; - transferCache?: boolean; - }, - ): Observable; - public deleteAccount( - accountId: string, - secureFgpAcc?: string, - observe?: 'response', - reportProgress?: boolean, - options?: { - httpHeaderAccept?: 'application/json'; - context?: HttpContext; - transferCache?: boolean; - }, - ): Observable>; - public deleteAccount( - accountId: string, - secureFgpAcc?: string, - observe?: 'events', - reportProgress?: boolean, - options?: { - httpHeaderAccept?: 'application/json'; - context?: HttpContext; - transferCache?: boolean; - }, - ): Observable>; - public deleteAccount( - accountId: string, - secureFgpAcc?: string, - observe: any = 'body', - reportProgress: boolean = false, - options?: { - httpHeaderAccept?: 'application/json'; - context?: HttpContext; - transferCache?: boolean; - }, - ): Observable { - if (accountId === null || accountId === undefined) { - throw new Error( - 'Required parameter accountId was null or undefined when calling deleteAccount.', - ); + let localVarQueryParameters = new HttpParams({encoder: this.encoder}); + localVarQueryParameters = this.addToHttpParams(localVarQueryParameters, + page, 'page'); + localVarQueryParameters = this.addToHttpParams(localVarQueryParameters, + pageSize, 'page_size'); + localVarQueryParameters = this.addToHttpParams(localVarQueryParameters, + offset, 'offset'); + localVarQueryParameters = this.addToHttpParams(localVarQueryParameters, + search, 'search'); + localVarQueryParameters = this.addToHttpParams(localVarQueryParameters, + organizationId, 'organization_id'); + + let localVarHeaders = this.defaultHeaders; + + // authentication (HTTPBearer) required + localVarHeaders = this.configuration.addCredentialToHeaders('HTTPBearer', 'Authorization', localVarHeaders, 'Bearer '); + + const localVarHttpHeaderAcceptSelected: string | undefined = options?.httpHeaderAccept ?? this.configuration.selectHeaderAccept([ + 'application/json' + ]); + if (localVarHttpHeaderAcceptSelected !== undefined) { + localVarHeaders = localVarHeaders.set('Accept', localVarHttpHeaderAcceptSelected); + } + + const localVarHttpContext: HttpContext = options?.context ?? new HttpContext(); + + const localVarTransferCache: boolean = options?.transferCache ?? true; + + + let responseType_: 'text' | 'json' | 'blob' = 'json'; + if (localVarHttpHeaderAcceptSelected) { + if (localVarHttpHeaderAcceptSelected.startsWith('text')) { + responseType_ = 'text'; + } else if (this.configuration.isJsonMime(localVarHttpHeaderAcceptSelected)) { + responseType_ = 'json'; + } else { + responseType_ = 'blob'; + } + } + + let localVarPath = `/api/accounts`; + const { basePath, withCredentials } = this.configuration; + return this.httpClient.request('get', `${basePath}${localVarPath}`, + { + context: localVarHttpContext, + params: localVarQueryParameters, + responseType: responseType_, + ...(withCredentials ? { withCredentials } : {}), + headers: localVarHeaders, + observe: observe, + ...(localVarTransferCache !== undefined ? { transferCache: localVarTransferCache } : {}), + reportProgress: reportProgress + } + ); } - let localVarHeaders = this.defaultHeaders; + /** + * Login with One-Time Key + * Login using a one-time key (OTK) sent to the user\'s email. + * @endpoint post /api/auth/v2/login + * @param bodyLogin + * @param observe set whether or not to return the data Observable as the body, response or events. defaults to returning the body. + * @param reportProgress flag to report request and response progress. + */ + public login(bodyLogin: BodyLogin, observe?: 'body', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable; + public login(bodyLogin: BodyLogin, observe?: 'response', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable>; + public login(bodyLogin: BodyLogin, observe?: 'events', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable>; + public login(bodyLogin: BodyLogin, observe: any = 'body', reportProgress: boolean = false, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable { + if (bodyLogin === null || bodyLogin === undefined) { + throw new Error('Required parameter bodyLogin was null or undefined when calling login.'); + } - // authentication (HTTPBearer) required - localVarHeaders = this.configuration.addCredentialToHeaders( - 'HTTPBearer', - 'Authorization', - localVarHeaders, - 'Bearer ', - ); + let localVarHeaders = this.defaultHeaders; - const localVarHttpHeaderAcceptSelected: string | undefined = - options?.httpHeaderAccept ?? - this.configuration.selectHeaderAccept(['application/json']); - if (localVarHttpHeaderAcceptSelected !== undefined) { - localVarHeaders = localVarHeaders.set( - 'Accept', - localVarHttpHeaderAcceptSelected, - ); + const localVarHttpHeaderAcceptSelected: string | undefined = options?.httpHeaderAccept ?? this.configuration.selectHeaderAccept([ + 'application/json' + ]); + if (localVarHttpHeaderAcceptSelected !== undefined) { + localVarHeaders = localVarHeaders.set('Accept', localVarHttpHeaderAcceptSelected); + } + + const localVarHttpContext: HttpContext = options?.context ?? new HttpContext(); + + const localVarTransferCache: boolean = options?.transferCache ?? true; + + + // to determine the Content-Type header + const consumes: string[] = [ + 'application/json' + ]; + const httpContentTypeSelected: string | undefined = this.configuration.selectHeaderContentType(consumes); + if (httpContentTypeSelected !== undefined) { + localVarHeaders = localVarHeaders.set('Content-Type', httpContentTypeSelected); + } + + let responseType_: 'text' | 'json' | 'blob' = 'json'; + if (localVarHttpHeaderAcceptSelected) { + if (localVarHttpHeaderAcceptSelected.startsWith('text')) { + responseType_ = 'text'; + } else if (this.configuration.isJsonMime(localVarHttpHeaderAcceptSelected)) { + responseType_ = 'json'; + } else { + responseType_ = 'blob'; + } + } + + let localVarPath = `/api/auth/v2/login`; + const { basePath, withCredentials } = this.configuration; + return this.httpClient.request('post', `${basePath}${localVarPath}`, + { + context: localVarHttpContext, + body: bodyLogin, + responseType: responseType_, + ...(withCredentials ? { withCredentials } : {}), + headers: localVarHeaders, + observe: observe, + ...(localVarTransferCache !== undefined ? { transferCache: localVarTransferCache } : {}), + reportProgress: reportProgress + } + ); } - const localVarHttpContext: HttpContext = - options?.context ?? new HttpContext(); + /** + * Logout + * Logout the authenticated user. + * @endpoint post /api/auth/v2/logout + * @param secureFgpAcc + * @param observe set whether or not to return the data Observable as the body, response or events. defaults to returning the body. + * @param reportProgress flag to report request and response progress. + */ + public logout(secureFgpAcc?: string, observe?: 'body', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable; + public logout(secureFgpAcc?: string, observe?: 'response', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable>; + public logout(secureFgpAcc?: string, observe?: 'events', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable>; + public logout(secureFgpAcc?: string, observe: any = 'body', reportProgress: boolean = false, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable { - const localVarTransferCache: boolean = options?.transferCache ?? true; + let localVarHeaders = this.defaultHeaders; - let responseType_: 'text' | 'json' | 'blob' = 'json'; - if (localVarHttpHeaderAcceptSelected) { - if (localVarHttpHeaderAcceptSelected.startsWith('text')) { - responseType_ = 'text'; - } else if ( - this.configuration.isJsonMime(localVarHttpHeaderAcceptSelected) - ) { - responseType_ = 'json'; - } else { - responseType_ = 'blob'; - } + // authentication (HTTPBearer) required + localVarHeaders = this.configuration.addCredentialToHeaders('HTTPBearer', 'Authorization', localVarHeaders, 'Bearer '); + + const localVarHttpHeaderAcceptSelected: string | undefined = options?.httpHeaderAccept ?? this.configuration.selectHeaderAccept([ + 'application/json' + ]); + if (localVarHttpHeaderAcceptSelected !== undefined) { + localVarHeaders = localVarHeaders.set('Accept', localVarHttpHeaderAcceptSelected); + } + + const localVarHttpContext: HttpContext = options?.context ?? new HttpContext(); + + const localVarTransferCache: boolean = options?.transferCache ?? true; + + + let responseType_: 'text' | 'json' | 'blob' = 'json'; + if (localVarHttpHeaderAcceptSelected) { + if (localVarHttpHeaderAcceptSelected.startsWith('text')) { + responseType_ = 'text'; + } else if (this.configuration.isJsonMime(localVarHttpHeaderAcceptSelected)) { + responseType_ = 'json'; + } else { + responseType_ = 'blob'; + } + } + + let localVarPath = `/api/auth/v2/logout`; + const { basePath, withCredentials } = this.configuration; + return this.httpClient.request('post', `${basePath}${localVarPath}`, + { + context: localVarHttpContext, + responseType: responseType_, + ...(withCredentials ? { withCredentials } : {}), + headers: localVarHeaders, + observe: observe, + ...(localVarTransferCache !== undefined ? { transferCache: localVarTransferCache } : {}), + reportProgress: reportProgress + } + ); } - let localVarPath = `/api/accounts/${this.configuration.encodeParam({ name: 'accountId', value: accountId, in: 'path', style: 'simple', explode: false, dataType: 'string', dataFormat: 'uuid' })}`; - const { basePath, withCredentials } = this.configuration; - return this.httpClient.request( - 'delete', - `${basePath}${localVarPath}`, - { - context: localVarHttpContext, - responseType: responseType_, - ...(withCredentials ? { withCredentials } : {}), - headers: localVarHeaders, - observe: observe, - ...(localVarTransferCache !== undefined - ? { transferCache: localVarTransferCache } - : {}), - reportProgress: reportProgress, - }, - ); - } + /** + * Refresh Access Token + * Refresh the access token using a valid refresh token. + * @endpoint post /api/auth/v2/refresh + * @param refreshToken + * @param observe set whether or not to return the data Observable as the body, response or events. defaults to returning the body. + * @param reportProgress flag to report request and response progress. + */ + public refreshAccessToken(refreshToken?: string, observe?: 'body', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable; + public refreshAccessToken(refreshToken?: string, observe?: 'response', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable>; + public refreshAccessToken(refreshToken?: string, observe?: 'events', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable>; + public refreshAccessToken(refreshToken?: string, observe: any = 'body', reportProgress: boolean = false, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable { - /** - * Get Access Token - * Retrieve an access token for the authenticated user. - * @endpoint post /api/auth/v2/access - * @param bodyGetAccessToken - * @param idToken - * @param observe set whether or not to return the data Observable as the body, response or events. defaults to returning the body. - * @param reportProgress flag to report request and response progress. - */ - public getAccessToken( - bodyGetAccessToken: BodyGetAccessToken, - idToken?: string, - observe?: 'body', - reportProgress?: boolean, - options?: { - httpHeaderAccept?: 'application/json'; - context?: HttpContext; - transferCache?: boolean; - }, - ): Observable; - public getAccessToken( - bodyGetAccessToken: BodyGetAccessToken, - idToken?: string, - observe?: 'response', - reportProgress?: boolean, - options?: { - httpHeaderAccept?: 'application/json'; - context?: HttpContext; - transferCache?: boolean; - }, - ): Observable>; - public getAccessToken( - bodyGetAccessToken: BodyGetAccessToken, - idToken?: string, - observe?: 'events', - reportProgress?: boolean, - options?: { - httpHeaderAccept?: 'application/json'; - context?: HttpContext; - transferCache?: boolean; - }, - ): Observable>; - public getAccessToken( - bodyGetAccessToken: BodyGetAccessToken, - idToken?: string, - observe: any = 'body', - reportProgress: boolean = false, - options?: { - httpHeaderAccept?: 'application/json'; - context?: HttpContext; - transferCache?: boolean; - }, - ): Observable { - if (bodyGetAccessToken === null || bodyGetAccessToken === undefined) { - throw new Error( - 'Required parameter bodyGetAccessToken was null or undefined when calling getAccessToken.', - ); + let localVarHeaders = this.defaultHeaders; + + const localVarHttpHeaderAcceptSelected: string | undefined = options?.httpHeaderAccept ?? this.configuration.selectHeaderAccept([ + 'application/json' + ]); + if (localVarHttpHeaderAcceptSelected !== undefined) { + localVarHeaders = localVarHeaders.set('Accept', localVarHttpHeaderAcceptSelected); + } + + const localVarHttpContext: HttpContext = options?.context ?? new HttpContext(); + + const localVarTransferCache: boolean = options?.transferCache ?? true; + + + let responseType_: 'text' | 'json' | 'blob' = 'json'; + if (localVarHttpHeaderAcceptSelected) { + if (localVarHttpHeaderAcceptSelected.startsWith('text')) { + responseType_ = 'text'; + } else if (this.configuration.isJsonMime(localVarHttpHeaderAcceptSelected)) { + responseType_ = 'json'; + } else { + responseType_ = 'blob'; + } + } + + let localVarPath = `/api/auth/v2/refresh`; + const { basePath, withCredentials } = this.configuration; + return this.httpClient.request('post', `${basePath}${localVarPath}`, + { + context: localVarHttpContext, + responseType: responseType_, + ...(withCredentials ? { withCredentials } : {}), + headers: localVarHeaders, + observe: observe, + ...(localVarTransferCache !== undefined ? { transferCache: localVarTransferCache } : {}), + reportProgress: reportProgress + } + ); } - let localVarHeaders = this.defaultHeaders; + /** + * Request One-Time Key + * Request a one-time key (OTK) for authentication using email and password. + * @endpoint post /api/auth/v2/request-otk + * @param bodyRequestOtk + * @param observe set whether or not to return the data Observable as the body, response or events. defaults to returning the body. + * @param reportProgress flag to report request and response progress. + */ + public requestOtk(bodyRequestOtk: BodyRequestOtk, observe?: 'body', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable; + public requestOtk(bodyRequestOtk: BodyRequestOtk, observe?: 'response', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable>; + public requestOtk(bodyRequestOtk: BodyRequestOtk, observe?: 'events', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable>; + public requestOtk(bodyRequestOtk: BodyRequestOtk, observe: any = 'body', reportProgress: boolean = false, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable { + if (bodyRequestOtk === null || bodyRequestOtk === undefined) { + throw new Error('Required parameter bodyRequestOtk was null or undefined when calling requestOtk.'); + } - const localVarHttpHeaderAcceptSelected: string | undefined = - options?.httpHeaderAccept ?? - this.configuration.selectHeaderAccept(['application/json']); - if (localVarHttpHeaderAcceptSelected !== undefined) { - localVarHeaders = localVarHeaders.set( - 'Accept', - localVarHttpHeaderAcceptSelected, - ); + let localVarHeaders = this.defaultHeaders; + + const localVarHttpHeaderAcceptSelected: string | undefined = options?.httpHeaderAccept ?? this.configuration.selectHeaderAccept([ + 'application/json' + ]); + if (localVarHttpHeaderAcceptSelected !== undefined) { + localVarHeaders = localVarHeaders.set('Accept', localVarHttpHeaderAcceptSelected); + } + + const localVarHttpContext: HttpContext = options?.context ?? new HttpContext(); + + const localVarTransferCache: boolean = options?.transferCache ?? true; + + + // to determine the Content-Type header + const consumes: string[] = [ + 'application/json' + ]; + const httpContentTypeSelected: string | undefined = this.configuration.selectHeaderContentType(consumes); + if (httpContentTypeSelected !== undefined) { + localVarHeaders = localVarHeaders.set('Content-Type', httpContentTypeSelected); + } + + let responseType_: 'text' | 'json' | 'blob' = 'json'; + if (localVarHttpHeaderAcceptSelected) { + if (localVarHttpHeaderAcceptSelected.startsWith('text')) { + responseType_ = 'text'; + } else if (this.configuration.isJsonMime(localVarHttpHeaderAcceptSelected)) { + responseType_ = 'json'; + } else { + responseType_ = 'blob'; + } + } + + let localVarPath = `/api/auth/v2/request-otk`; + const { basePath, withCredentials } = this.configuration; + return this.httpClient.request('post', `${basePath}${localVarPath}`, + { + context: localVarHttpContext, + body: bodyRequestOtk, + responseType: responseType_, + ...(withCredentials ? { withCredentials } : {}), + headers: localVarHeaders, + observe: observe, + ...(localVarTransferCache !== undefined ? { transferCache: localVarTransferCache } : {}), + reportProgress: reportProgress + } + ); } - const localVarHttpContext: HttpContext = - options?.context ?? new HttpContext(); + /** + * Request Password Reset + * Request a one-time password reset link for the given email address. + * @endpoint post /api/auth/v2/request-password-reset + * @param bodyRequestPasswordReset + * @param observe set whether or not to return the data Observable as the body, response or events. defaults to returning the body. + * @param reportProgress flag to report request and response progress. + */ + public requestPasswordReset(bodyRequestPasswordReset: BodyRequestPasswordReset, observe?: 'body', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable; + public requestPasswordReset(bodyRequestPasswordReset: BodyRequestPasswordReset, observe?: 'response', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable>; + public requestPasswordReset(bodyRequestPasswordReset: BodyRequestPasswordReset, observe?: 'events', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable>; + public requestPasswordReset(bodyRequestPasswordReset: BodyRequestPasswordReset, observe: any = 'body', reportProgress: boolean = false, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable { + if (bodyRequestPasswordReset === null || bodyRequestPasswordReset === undefined) { + throw new Error('Required parameter bodyRequestPasswordReset was null or undefined when calling requestPasswordReset.'); + } - const localVarTransferCache: boolean = options?.transferCache ?? true; + let localVarHeaders = this.defaultHeaders; - // to determine the Content-Type header - const consumes: string[] = ['application/json']; - const httpContentTypeSelected: string | undefined = - this.configuration.selectHeaderContentType(consumes); - if (httpContentTypeSelected !== undefined) { - localVarHeaders = localVarHeaders.set( - 'Content-Type', - httpContentTypeSelected, - ); + const localVarHttpHeaderAcceptSelected: string | undefined = options?.httpHeaderAccept ?? this.configuration.selectHeaderAccept([ + 'application/json' + ]); + if (localVarHttpHeaderAcceptSelected !== undefined) { + localVarHeaders = localVarHeaders.set('Accept', localVarHttpHeaderAcceptSelected); + } + + const localVarHttpContext: HttpContext = options?.context ?? new HttpContext(); + + const localVarTransferCache: boolean = options?.transferCache ?? true; + + + // to determine the Content-Type header + const consumes: string[] = [ + 'application/json' + ]; + const httpContentTypeSelected: string | undefined = this.configuration.selectHeaderContentType(consumes); + if (httpContentTypeSelected !== undefined) { + localVarHeaders = localVarHeaders.set('Content-Type', httpContentTypeSelected); + } + + let responseType_: 'text' | 'json' | 'blob' = 'json'; + if (localVarHttpHeaderAcceptSelected) { + if (localVarHttpHeaderAcceptSelected.startsWith('text')) { + responseType_ = 'text'; + } else if (this.configuration.isJsonMime(localVarHttpHeaderAcceptSelected)) { + responseType_ = 'json'; + } else { + responseType_ = 'blob'; + } + } + + let localVarPath = `/api/auth/v2/request-password-reset`; + const { basePath, withCredentials } = this.configuration; + return this.httpClient.request('post', `${basePath}${localVarPath}`, + { + context: localVarHttpContext, + body: bodyRequestPasswordReset, + responseType: responseType_, + ...(withCredentials ? { withCredentials } : {}), + headers: localVarHeaders, + observe: observe, + ...(localVarTransferCache !== undefined ? { transferCache: localVarTransferCache } : {}), + reportProgress: reportProgress + } + ); } - let responseType_: 'text' | 'json' | 'blob' = 'json'; - if (localVarHttpHeaderAcceptSelected) { - if (localVarHttpHeaderAcceptSelected.startsWith('text')) { - responseType_ = 'text'; - } else if ( - this.configuration.isJsonMime(localVarHttpHeaderAcceptSelected) - ) { - responseType_ = 'json'; - } else { - responseType_ = 'blob'; - } + /** + * Reset Password + * Reset the user\'s password using a one-time password reset token. + * @endpoint post /api/auth/v2/reset-password + * @param bodyResetPassword + * @param observe set whether or not to return the data Observable as the body, response or events. defaults to returning the body. + * @param reportProgress flag to report request and response progress. + */ + public resetPassword(bodyResetPassword: BodyResetPassword, observe?: 'body', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable; + public resetPassword(bodyResetPassword: BodyResetPassword, observe?: 'response', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable>; + public resetPassword(bodyResetPassword: BodyResetPassword, observe?: 'events', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable>; + public resetPassword(bodyResetPassword: BodyResetPassword, observe: any = 'body', reportProgress: boolean = false, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable { + if (bodyResetPassword === null || bodyResetPassword === undefined) { + throw new Error('Required parameter bodyResetPassword was null or undefined when calling resetPassword.'); + } + + let localVarHeaders = this.defaultHeaders; + + const localVarHttpHeaderAcceptSelected: string | undefined = options?.httpHeaderAccept ?? this.configuration.selectHeaderAccept([ + 'application/json' + ]); + if (localVarHttpHeaderAcceptSelected !== undefined) { + localVarHeaders = localVarHeaders.set('Accept', localVarHttpHeaderAcceptSelected); + } + + const localVarHttpContext: HttpContext = options?.context ?? new HttpContext(); + + const localVarTransferCache: boolean = options?.transferCache ?? true; + + + // to determine the Content-Type header + const consumes: string[] = [ + 'application/json' + ]; + const httpContentTypeSelected: string | undefined = this.configuration.selectHeaderContentType(consumes); + if (httpContentTypeSelected !== undefined) { + localVarHeaders = localVarHeaders.set('Content-Type', httpContentTypeSelected); + } + + let responseType_: 'text' | 'json' | 'blob' = 'json'; + if (localVarHttpHeaderAcceptSelected) { + if (localVarHttpHeaderAcceptSelected.startsWith('text')) { + responseType_ = 'text'; + } else if (this.configuration.isJsonMime(localVarHttpHeaderAcceptSelected)) { + responseType_ = 'json'; + } else { + responseType_ = 'blob'; + } + } + + let localVarPath = `/api/auth/v2/reset-password`; + const { basePath, withCredentials } = this.configuration; + return this.httpClient.request('post', `${basePath}${localVarPath}`, + { + context: localVarHttpContext, + body: bodyResetPassword, + responseType: responseType_, + ...(withCredentials ? { withCredentials } : {}), + headers: localVarHeaders, + observe: observe, + ...(localVarTransferCache !== undefined ? { transferCache: localVarTransferCache } : {}), + reportProgress: reportProgress + } + ); } - let localVarPath = `/api/auth/v2/access`; - const { basePath, withCredentials } = this.configuration; - return this.httpClient.request( - 'post', - `${basePath}${localVarPath}`, - { - context: localVarHttpContext, - body: bodyGetAccessToken, - responseType: responseType_, - ...(withCredentials ? { withCredentials } : {}), - headers: localVarHeaders, - observe: observe, - ...(localVarTransferCache !== undefined - ? { transferCache: localVarTransferCache } - : {}), - reportProgress: reportProgress, - }, - ); - } + /** + * Update Account + * @endpoint put /api/accounts/{account_id} + * @param accountId + * @param updateAccountRequest + * @param secureFgpAcc + * @param observe set whether or not to return the data Observable as the body, response or events. defaults to returning the body. + * @param reportProgress flag to report request and response progress. + */ + public updateAccount(accountId: string, updateAccountRequest: UpdateAccountRequest, secureFgpAcc?: string, observe?: 'body', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable; + public updateAccount(accountId: string, updateAccountRequest: UpdateAccountRequest, secureFgpAcc?: string, observe?: 'response', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable>; + public updateAccount(accountId: string, updateAccountRequest: UpdateAccountRequest, secureFgpAcc?: string, observe?: 'events', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable>; + public updateAccount(accountId: string, updateAccountRequest: UpdateAccountRequest, secureFgpAcc?: string, observe: any = 'body', reportProgress: boolean = false, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable { + if (accountId === null || accountId === undefined) { + throw new Error('Required parameter accountId was null or undefined when calling updateAccount.'); + } + if (updateAccountRequest === null || updateAccountRequest === undefined) { + throw new Error('Required parameter updateAccountRequest was null or undefined when calling updateAccount.'); + } - /** - * Get Current Account - * @endpoint get /api/accounts/me - * @param secureFgpAcc - * @param observe set whether or not to return the data Observable as the body, response or events. defaults to returning the body. - * @param reportProgress flag to report request and response progress. - */ - public getCurrentAccount( - secureFgpAcc?: string, - observe?: 'body', - reportProgress?: boolean, - options?: { - httpHeaderAccept?: 'application/json'; - context?: HttpContext; - transferCache?: boolean; - }, - ): Observable; - public getCurrentAccount( - secureFgpAcc?: string, - observe?: 'response', - reportProgress?: boolean, - options?: { - httpHeaderAccept?: 'application/json'; - context?: HttpContext; - transferCache?: boolean; - }, - ): Observable>; - public getCurrentAccount( - secureFgpAcc?: string, - observe?: 'events', - reportProgress?: boolean, - options?: { - httpHeaderAccept?: 'application/json'; - context?: HttpContext; - transferCache?: boolean; - }, - ): Observable>; - public getCurrentAccount( - secureFgpAcc?: string, - observe: any = 'body', - reportProgress: boolean = false, - options?: { - httpHeaderAccept?: 'application/json'; - context?: HttpContext; - transferCache?: boolean; - }, - ): Observable { - let localVarHeaders = this.defaultHeaders; + let localVarHeaders = this.defaultHeaders; - // authentication (HTTPBearer) required - localVarHeaders = this.configuration.addCredentialToHeaders( - 'HTTPBearer', - 'Authorization', - localVarHeaders, - 'Bearer ', - ); + // authentication (HTTPBearer) required + localVarHeaders = this.configuration.addCredentialToHeaders('HTTPBearer', 'Authorization', localVarHeaders, 'Bearer '); - const localVarHttpHeaderAcceptSelected: string | undefined = - options?.httpHeaderAccept ?? - this.configuration.selectHeaderAccept(['application/json']); - if (localVarHttpHeaderAcceptSelected !== undefined) { - localVarHeaders = localVarHeaders.set( - 'Accept', - localVarHttpHeaderAcceptSelected, - ); + const localVarHttpHeaderAcceptSelected: string | undefined = options?.httpHeaderAccept ?? this.configuration.selectHeaderAccept([ + 'application/json' + ]); + if (localVarHttpHeaderAcceptSelected !== undefined) { + localVarHeaders = localVarHeaders.set('Accept', localVarHttpHeaderAcceptSelected); + } + + const localVarHttpContext: HttpContext = options?.context ?? new HttpContext(); + + const localVarTransferCache: boolean = options?.transferCache ?? true; + + + // to determine the Content-Type header + const consumes: string[] = [ + 'application/json' + ]; + const httpContentTypeSelected: string | undefined = this.configuration.selectHeaderContentType(consumes); + if (httpContentTypeSelected !== undefined) { + localVarHeaders = localVarHeaders.set('Content-Type', httpContentTypeSelected); + } + + let responseType_: 'text' | 'json' | 'blob' = 'json'; + if (localVarHttpHeaderAcceptSelected) { + if (localVarHttpHeaderAcceptSelected.startsWith('text')) { + responseType_ = 'text'; + } else if (this.configuration.isJsonMime(localVarHttpHeaderAcceptSelected)) { + responseType_ = 'json'; + } else { + responseType_ = 'blob'; + } + } + + let localVarPath = `/api/accounts/${this.configuration.encodeParam({name: "accountId", value: accountId, in: "path", style: "simple", explode: false, dataType: "string", dataFormat: "uuid"})}`; + const { basePath, withCredentials } = this.configuration; + return this.httpClient.request('put', `${basePath}${localVarPath}`, + { + context: localVarHttpContext, + body: updateAccountRequest, + responseType: responseType_, + ...(withCredentials ? { withCredentials } : {}), + headers: localVarHeaders, + observe: observe, + ...(localVarTransferCache !== undefined ? { transferCache: localVarTransferCache } : {}), + reportProgress: reportProgress + } + ); } - const localVarHttpContext: HttpContext = - options?.context ?? new HttpContext(); - - const localVarTransferCache: boolean = options?.transferCache ?? true; - - let responseType_: 'text' | 'json' | 'blob' = 'json'; - if (localVarHttpHeaderAcceptSelected) { - if (localVarHttpHeaderAcceptSelected.startsWith('text')) { - responseType_ = 'text'; - } else if ( - this.configuration.isJsonMime(localVarHttpHeaderAcceptSelected) - ) { - responseType_ = 'json'; - } else { - responseType_ = 'blob'; - } - } - - let localVarPath = `/api/accounts/me`; - const { basePath, withCredentials } = this.configuration; - return this.httpClient.request( - 'get', - `${basePath}${localVarPath}`, - { - context: localVarHttpContext, - responseType: responseType_, - ...(withCredentials ? { withCredentials } : {}), - headers: localVarHeaders, - observe: observe, - ...(localVarTransferCache !== undefined - ? { transferCache: localVarTransferCache } - : {}), - reportProgress: reportProgress, - }, - ); - } - - /** - * Health Check - * @endpoint get /api/auth/v2/health - * @param observe set whether or not to return the data Observable as the body, response or events. defaults to returning the body. - * @param reportProgress flag to report request and response progress. - */ - public healthCheckApiAuthV2HealthGet( - observe?: 'body', - reportProgress?: boolean, - options?: { - httpHeaderAccept?: 'application/json'; - context?: HttpContext; - transferCache?: boolean; - }, - ): Observable; - public healthCheckApiAuthV2HealthGet( - observe?: 'response', - reportProgress?: boolean, - options?: { - httpHeaderAccept?: 'application/json'; - context?: HttpContext; - transferCache?: boolean; - }, - ): Observable>; - public healthCheckApiAuthV2HealthGet( - observe?: 'events', - reportProgress?: boolean, - options?: { - httpHeaderAccept?: 'application/json'; - context?: HttpContext; - transferCache?: boolean; - }, - ): Observable>; - public healthCheckApiAuthV2HealthGet( - observe: any = 'body', - reportProgress: boolean = false, - options?: { - httpHeaderAccept?: 'application/json'; - context?: HttpContext; - transferCache?: boolean; - }, - ): Observable { - let localVarHeaders = this.defaultHeaders; - - const localVarHttpHeaderAcceptSelected: string | undefined = - options?.httpHeaderAccept ?? - this.configuration.selectHeaderAccept(['application/json']); - if (localVarHttpHeaderAcceptSelected !== undefined) { - localVarHeaders = localVarHeaders.set( - 'Accept', - localVarHttpHeaderAcceptSelected, - ); - } - - const localVarHttpContext: HttpContext = - options?.context ?? new HttpContext(); - - const localVarTransferCache: boolean = options?.transferCache ?? true; - - let responseType_: 'text' | 'json' | 'blob' = 'json'; - if (localVarHttpHeaderAcceptSelected) { - if (localVarHttpHeaderAcceptSelected.startsWith('text')) { - responseType_ = 'text'; - } else if ( - this.configuration.isJsonMime(localVarHttpHeaderAcceptSelected) - ) { - responseType_ = 'json'; - } else { - responseType_ = 'blob'; - } - } - - let localVarPath = `/api/auth/v2/health`; - const { basePath, withCredentials } = this.configuration; - return this.httpClient.request('get', `${basePath}${localVarPath}`, { - context: localVarHttpContext, - responseType: responseType_, - ...(withCredentials ? { withCredentials } : {}), - headers: localVarHeaders, - observe: observe, - ...(localVarTransferCache !== undefined - ? { transferCache: localVarTransferCache } - : {}), - reportProgress: reportProgress, - }); - } - - /** - * List Organizations - * @endpoint get /api/accounts/organizations - * @param secureFgpAcc - * @param observe set whether or not to return the data Observable as the body, response or events. defaults to returning the body. - * @param reportProgress flag to report request and response progress. - */ - public listAccountOrganizations( - secureFgpAcc?: string, - observe?: 'body', - reportProgress?: boolean, - options?: { - httpHeaderAccept?: 'application/json'; - context?: HttpContext; - transferCache?: boolean; - }, - ): Observable>; - public listAccountOrganizations( - secureFgpAcc?: string, - observe?: 'response', - reportProgress?: boolean, - options?: { - httpHeaderAccept?: 'application/json'; - context?: HttpContext; - transferCache?: boolean; - }, - ): Observable< - HttpResponse> - >; - public listAccountOrganizations( - secureFgpAcc?: string, - observe?: 'events', - reportProgress?: boolean, - options?: { - httpHeaderAccept?: 'application/json'; - context?: HttpContext; - transferCache?: boolean; - }, - ): Observable< - HttpEvent> - >; - public listAccountOrganizations( - secureFgpAcc?: string, - observe: any = 'body', - reportProgress: boolean = false, - options?: { - httpHeaderAccept?: 'application/json'; - context?: HttpContext; - transferCache?: boolean; - }, - ): Observable { - let localVarHeaders = this.defaultHeaders; - - // authentication (HTTPBearer) required - localVarHeaders = this.configuration.addCredentialToHeaders( - 'HTTPBearer', - 'Authorization', - localVarHeaders, - 'Bearer ', - ); - - const localVarHttpHeaderAcceptSelected: string | undefined = - options?.httpHeaderAccept ?? - this.configuration.selectHeaderAccept(['application/json']); - if (localVarHttpHeaderAcceptSelected !== undefined) { - localVarHeaders = localVarHeaders.set( - 'Accept', - localVarHttpHeaderAcceptSelected, - ); - } - - const localVarHttpContext: HttpContext = - options?.context ?? new HttpContext(); - - const localVarTransferCache: boolean = options?.transferCache ?? true; - - let responseType_: 'text' | 'json' | 'blob' = 'json'; - if (localVarHttpHeaderAcceptSelected) { - if (localVarHttpHeaderAcceptSelected.startsWith('text')) { - responseType_ = 'text'; - } else if ( - this.configuration.isJsonMime(localVarHttpHeaderAcceptSelected) - ) { - responseType_ = 'json'; - } else { - responseType_ = 'blob'; - } - } - - let localVarPath = `/api/accounts/organizations`; - const { basePath, withCredentials } = this.configuration; - return this.httpClient.request< - Array - >('get', `${basePath}${localVarPath}`, { - context: localVarHttpContext, - responseType: responseType_, - ...(withCredentials ? { withCredentials } : {}), - headers: localVarHeaders, - observe: observe, - ...(localVarTransferCache !== undefined - ? { transferCache: localVarTransferCache } - : {}), - reportProgress: reportProgress, - }); - } - - /** - * List Accounts - * @endpoint get /api/accounts - * @param page - * @param pageSize - * @param offset - * @param search - * @param organizationId - * @param secureFgpAcc - * @param observe set whether or not to return the data Observable as the body, response or events. defaults to returning the body. - * @param reportProgress flag to report request and response progress. - */ - public listAccounts( - page?: number, - pageSize?: number, - offset?: number, - search?: string, - organizationId?: string, - secureFgpAcc?: string, - observe?: 'body', - reportProgress?: boolean, - options?: { - httpHeaderAccept?: 'application/json'; - context?: HttpContext; - transferCache?: boolean; - }, - ): Observable; - public listAccounts( - page?: number, - pageSize?: number, - offset?: number, - search?: string, - organizationId?: string, - secureFgpAcc?: string, - observe?: 'response', - reportProgress?: boolean, - options?: { - httpHeaderAccept?: 'application/json'; - context?: HttpContext; - transferCache?: boolean; - }, - ): Observable>; - public listAccounts( - page?: number, - pageSize?: number, - offset?: number, - search?: string, - organizationId?: string, - secureFgpAcc?: string, - observe?: 'events', - reportProgress?: boolean, - options?: { - httpHeaderAccept?: 'application/json'; - context?: HttpContext; - transferCache?: boolean; - }, - ): Observable>; - public listAccounts( - page?: number, - pageSize?: number, - offset?: number, - search?: string, - organizationId?: string, - secureFgpAcc?: string, - observe: any = 'body', - reportProgress: boolean = false, - options?: { - httpHeaderAccept?: 'application/json'; - context?: HttpContext; - transferCache?: boolean; - }, - ): Observable { - let localVarQueryParameters = new HttpParams({ encoder: this.encoder }); - localVarQueryParameters = this.addToHttpParams( - localVarQueryParameters, - page, - 'page', - ); - localVarQueryParameters = this.addToHttpParams( - localVarQueryParameters, - pageSize, - 'page_size', - ); - localVarQueryParameters = this.addToHttpParams( - localVarQueryParameters, - offset, - 'offset', - ); - localVarQueryParameters = this.addToHttpParams( - localVarQueryParameters, - search, - 'search', - ); - localVarQueryParameters = this.addToHttpParams( - localVarQueryParameters, - organizationId, - 'organization_id', - ); - - let localVarHeaders = this.defaultHeaders; - - // authentication (HTTPBearer) required - localVarHeaders = this.configuration.addCredentialToHeaders( - 'HTTPBearer', - 'Authorization', - localVarHeaders, - 'Bearer ', - ); - - const localVarHttpHeaderAcceptSelected: string | undefined = - options?.httpHeaderAccept ?? - this.configuration.selectHeaderAccept(['application/json']); - if (localVarHttpHeaderAcceptSelected !== undefined) { - localVarHeaders = localVarHeaders.set( - 'Accept', - localVarHttpHeaderAcceptSelected, - ); - } - - const localVarHttpContext: HttpContext = - options?.context ?? new HttpContext(); - - const localVarTransferCache: boolean = options?.transferCache ?? true; - - let responseType_: 'text' | 'json' | 'blob' = 'json'; - if (localVarHttpHeaderAcceptSelected) { - if (localVarHttpHeaderAcceptSelected.startsWith('text')) { - responseType_ = 'text'; - } else if ( - this.configuration.isJsonMime(localVarHttpHeaderAcceptSelected) - ) { - responseType_ = 'json'; - } else { - responseType_ = 'blob'; - } - } - - let localVarPath = `/api/accounts`; - const { basePath, withCredentials } = this.configuration; - return this.httpClient.request( - 'get', - `${basePath}${localVarPath}`, - { - context: localVarHttpContext, - params: localVarQueryParameters, - responseType: responseType_, - ...(withCredentials ? { withCredentials } : {}), - headers: localVarHeaders, - observe: observe, - ...(localVarTransferCache !== undefined - ? { transferCache: localVarTransferCache } - : {}), - reportProgress: reportProgress, - }, - ); - } - - /** - * Login with One-Time Key - * Login using a one-time key (OTK) sent to the user\'s email. - * @endpoint post /api/auth/v2/login - * @param bodyLogin - * @param observe set whether or not to return the data Observable as the body, response or events. defaults to returning the body. - * @param reportProgress flag to report request and response progress. - */ - public login( - bodyLogin: BodyLogin, - observe?: 'body', - reportProgress?: boolean, - options?: { - httpHeaderAccept?: 'application/json'; - context?: HttpContext; - transferCache?: boolean; - }, - ): Observable; - public login( - bodyLogin: BodyLogin, - observe?: 'response', - reportProgress?: boolean, - options?: { - httpHeaderAccept?: 'application/json'; - context?: HttpContext; - transferCache?: boolean; - }, - ): Observable>; - public login( - bodyLogin: BodyLogin, - observe?: 'events', - reportProgress?: boolean, - options?: { - httpHeaderAccept?: 'application/json'; - context?: HttpContext; - transferCache?: boolean; - }, - ): Observable>; - public login( - bodyLogin: BodyLogin, - observe: any = 'body', - reportProgress: boolean = false, - options?: { - httpHeaderAccept?: 'application/json'; - context?: HttpContext; - transferCache?: boolean; - }, - ): Observable { - if (bodyLogin === null || bodyLogin === undefined) { - throw new Error( - 'Required parameter bodyLogin was null or undefined when calling login.', - ); - } - - let localVarHeaders = this.defaultHeaders; - - const localVarHttpHeaderAcceptSelected: string | undefined = - options?.httpHeaderAccept ?? - this.configuration.selectHeaderAccept(['application/json']); - if (localVarHttpHeaderAcceptSelected !== undefined) { - localVarHeaders = localVarHeaders.set( - 'Accept', - localVarHttpHeaderAcceptSelected, - ); - } - - const localVarHttpContext: HttpContext = - options?.context ?? new HttpContext(); - - const localVarTransferCache: boolean = options?.transferCache ?? true; - - // to determine the Content-Type header - const consumes: string[] = ['application/json']; - const httpContentTypeSelected: string | undefined = - this.configuration.selectHeaderContentType(consumes); - if (httpContentTypeSelected !== undefined) { - localVarHeaders = localVarHeaders.set( - 'Content-Type', - httpContentTypeSelected, - ); - } - - let responseType_: 'text' | 'json' | 'blob' = 'json'; - if (localVarHttpHeaderAcceptSelected) { - if (localVarHttpHeaderAcceptSelected.startsWith('text')) { - responseType_ = 'text'; - } else if ( - this.configuration.isJsonMime(localVarHttpHeaderAcceptSelected) - ) { - responseType_ = 'json'; - } else { - responseType_ = 'blob'; - } - } - - let localVarPath = `/api/auth/v2/login`; - const { basePath, withCredentials } = this.configuration; - return this.httpClient.request( - 'post', - `${basePath}${localVarPath}`, - { - context: localVarHttpContext, - body: bodyLogin, - responseType: responseType_, - ...(withCredentials ? { withCredentials } : {}), - headers: localVarHeaders, - observe: observe, - ...(localVarTransferCache !== undefined - ? { transferCache: localVarTransferCache } - : {}), - reportProgress: reportProgress, - }, - ); - } - - /** - * Logout - * Logout the authenticated user. - * @endpoint post /api/auth/v2/logout - * @param secureFgpAcc - * @param observe set whether or not to return the data Observable as the body, response or events. defaults to returning the body. - * @param reportProgress flag to report request and response progress. - */ - public logout( - secureFgpAcc?: string, - observe?: 'body', - reportProgress?: boolean, - options?: { - httpHeaderAccept?: 'application/json'; - context?: HttpContext; - transferCache?: boolean; - }, - ): Observable; - public logout( - secureFgpAcc?: string, - observe?: 'response', - reportProgress?: boolean, - options?: { - httpHeaderAccept?: 'application/json'; - context?: HttpContext; - transferCache?: boolean; - }, - ): Observable>; - public logout( - secureFgpAcc?: string, - observe?: 'events', - reportProgress?: boolean, - options?: { - httpHeaderAccept?: 'application/json'; - context?: HttpContext; - transferCache?: boolean; - }, - ): Observable>; - public logout( - secureFgpAcc?: string, - observe: any = 'body', - reportProgress: boolean = false, - options?: { - httpHeaderAccept?: 'application/json'; - context?: HttpContext; - transferCache?: boolean; - }, - ): Observable { - let localVarHeaders = this.defaultHeaders; - - // authentication (HTTPBearer) required - localVarHeaders = this.configuration.addCredentialToHeaders( - 'HTTPBearer', - 'Authorization', - localVarHeaders, - 'Bearer ', - ); - - const localVarHttpHeaderAcceptSelected: string | undefined = - options?.httpHeaderAccept ?? - this.configuration.selectHeaderAccept(['application/json']); - if (localVarHttpHeaderAcceptSelected !== undefined) { - localVarHeaders = localVarHeaders.set( - 'Accept', - localVarHttpHeaderAcceptSelected, - ); - } - - const localVarHttpContext: HttpContext = - options?.context ?? new HttpContext(); - - const localVarTransferCache: boolean = options?.transferCache ?? true; - - let responseType_: 'text' | 'json' | 'blob' = 'json'; - if (localVarHttpHeaderAcceptSelected) { - if (localVarHttpHeaderAcceptSelected.startsWith('text')) { - responseType_ = 'text'; - } else if ( - this.configuration.isJsonMime(localVarHttpHeaderAcceptSelected) - ) { - responseType_ = 'json'; - } else { - responseType_ = 'blob'; - } - } - - let localVarPath = `/api/auth/v2/logout`; - const { basePath, withCredentials } = this.configuration; - return this.httpClient.request('post', `${basePath}${localVarPath}`, { - context: localVarHttpContext, - responseType: responseType_, - ...(withCredentials ? { withCredentials } : {}), - headers: localVarHeaders, - observe: observe, - ...(localVarTransferCache !== undefined - ? { transferCache: localVarTransferCache } - : {}), - reportProgress: reportProgress, - }); - } - - /** - * Refresh Access Token - * Refresh the access token using a valid refresh token. - * @endpoint post /api/auth/v2/refresh - * @param refreshToken - * @param observe set whether or not to return the data Observable as the body, response or events. defaults to returning the body. - * @param reportProgress flag to report request and response progress. - */ - public refreshAccessToken( - refreshToken?: string, - observe?: 'body', - reportProgress?: boolean, - options?: { - httpHeaderAccept?: 'application/json'; - context?: HttpContext; - transferCache?: boolean; - }, - ): Observable; - public refreshAccessToken( - refreshToken?: string, - observe?: 'response', - reportProgress?: boolean, - options?: { - httpHeaderAccept?: 'application/json'; - context?: HttpContext; - transferCache?: boolean; - }, - ): Observable>; - public refreshAccessToken( - refreshToken?: string, - observe?: 'events', - reportProgress?: boolean, - options?: { - httpHeaderAccept?: 'application/json'; - context?: HttpContext; - transferCache?: boolean; - }, - ): Observable>; - public refreshAccessToken( - refreshToken?: string, - observe: any = 'body', - reportProgress: boolean = false, - options?: { - httpHeaderAccept?: 'application/json'; - context?: HttpContext; - transferCache?: boolean; - }, - ): Observable { - let localVarHeaders = this.defaultHeaders; - - const localVarHttpHeaderAcceptSelected: string | undefined = - options?.httpHeaderAccept ?? - this.configuration.selectHeaderAccept(['application/json']); - if (localVarHttpHeaderAcceptSelected !== undefined) { - localVarHeaders = localVarHeaders.set( - 'Accept', - localVarHttpHeaderAcceptSelected, - ); - } - - const localVarHttpContext: HttpContext = - options?.context ?? new HttpContext(); - - const localVarTransferCache: boolean = options?.transferCache ?? true; - - let responseType_: 'text' | 'json' | 'blob' = 'json'; - if (localVarHttpHeaderAcceptSelected) { - if (localVarHttpHeaderAcceptSelected.startsWith('text')) { - responseType_ = 'text'; - } else if ( - this.configuration.isJsonMime(localVarHttpHeaderAcceptSelected) - ) { - responseType_ = 'json'; - } else { - responseType_ = 'blob'; - } - } - - let localVarPath = `/api/auth/v2/refresh`; - const { basePath, withCredentials } = this.configuration; - return this.httpClient.request( - 'post', - `${basePath}${localVarPath}`, - { - context: localVarHttpContext, - responseType: responseType_, - ...(withCredentials ? { withCredentials } : {}), - headers: localVarHeaders, - observe: observe, - ...(localVarTransferCache !== undefined - ? { transferCache: localVarTransferCache } - : {}), - reportProgress: reportProgress, - }, - ); - } - - /** - * Request One-Time Key - * Request a one-time key (OTK) for authentication using email and password. - * @endpoint post /api/auth/v2/request-otk - * @param bodyRequestOtk - * @param observe set whether or not to return the data Observable as the body, response or events. defaults to returning the body. - * @param reportProgress flag to report request and response progress. - */ - public requestOtk( - bodyRequestOtk: BodyRequestOtk, - observe?: 'body', - reportProgress?: boolean, - options?: { - httpHeaderAccept?: 'application/json'; - context?: HttpContext; - transferCache?: boolean; - }, - ): Observable; - public requestOtk( - bodyRequestOtk: BodyRequestOtk, - observe?: 'response', - reportProgress?: boolean, - options?: { - httpHeaderAccept?: 'application/json'; - context?: HttpContext; - transferCache?: boolean; - }, - ): Observable>; - public requestOtk( - bodyRequestOtk: BodyRequestOtk, - observe?: 'events', - reportProgress?: boolean, - options?: { - httpHeaderAccept?: 'application/json'; - context?: HttpContext; - transferCache?: boolean; - }, - ): Observable>; - public requestOtk( - bodyRequestOtk: BodyRequestOtk, - observe: any = 'body', - reportProgress: boolean = false, - options?: { - httpHeaderAccept?: 'application/json'; - context?: HttpContext; - transferCache?: boolean; - }, - ): Observable { - if (bodyRequestOtk === null || bodyRequestOtk === undefined) { - throw new Error( - 'Required parameter bodyRequestOtk was null or undefined when calling requestOtk.', - ); - } - - let localVarHeaders = this.defaultHeaders; - - const localVarHttpHeaderAcceptSelected: string | undefined = - options?.httpHeaderAccept ?? - this.configuration.selectHeaderAccept(['application/json']); - if (localVarHttpHeaderAcceptSelected !== undefined) { - localVarHeaders = localVarHeaders.set( - 'Accept', - localVarHttpHeaderAcceptSelected, - ); - } - - const localVarHttpContext: HttpContext = - options?.context ?? new HttpContext(); - - const localVarTransferCache: boolean = options?.transferCache ?? true; - - // to determine the Content-Type header - const consumes: string[] = ['application/json']; - const httpContentTypeSelected: string | undefined = - this.configuration.selectHeaderContentType(consumes); - if (httpContentTypeSelected !== undefined) { - localVarHeaders = localVarHeaders.set( - 'Content-Type', - httpContentTypeSelected, - ); - } - - let responseType_: 'text' | 'json' | 'blob' = 'json'; - if (localVarHttpHeaderAcceptSelected) { - if (localVarHttpHeaderAcceptSelected.startsWith('text')) { - responseType_ = 'text'; - } else if ( - this.configuration.isJsonMime(localVarHttpHeaderAcceptSelected) - ) { - responseType_ = 'json'; - } else { - responseType_ = 'blob'; - } - } - - let localVarPath = `/api/auth/v2/request-otk`; - const { basePath, withCredentials } = this.configuration; - return this.httpClient.request( - 'post', - `${basePath}${localVarPath}`, - { - context: localVarHttpContext, - body: bodyRequestOtk, - responseType: responseType_, - ...(withCredentials ? { withCredentials } : {}), - headers: localVarHeaders, - observe: observe, - ...(localVarTransferCache !== undefined - ? { transferCache: localVarTransferCache } - : {}), - reportProgress: reportProgress, - }, - ); - } - - /** - * Request Password Reset - * Request a one-time password reset link for the given email address. - * @endpoint post /api/auth/v2/request-password-reset - * @param bodyRequestPasswordReset - * @param observe set whether or not to return the data Observable as the body, response or events. defaults to returning the body. - * @param reportProgress flag to report request and response progress. - */ - public requestPasswordReset( - bodyRequestPasswordReset: BodyRequestPasswordReset, - observe?: 'body', - reportProgress?: boolean, - options?: { - httpHeaderAccept?: 'application/json'; - context?: HttpContext; - transferCache?: boolean; - }, - ): Observable; - public requestPasswordReset( - bodyRequestPasswordReset: BodyRequestPasswordReset, - observe?: 'response', - reportProgress?: boolean, - options?: { - httpHeaderAccept?: 'application/json'; - context?: HttpContext; - transferCache?: boolean; - }, - ): Observable>; - public requestPasswordReset( - bodyRequestPasswordReset: BodyRequestPasswordReset, - observe?: 'events', - reportProgress?: boolean, - options?: { - httpHeaderAccept?: 'application/json'; - context?: HttpContext; - transferCache?: boolean; - }, - ): Observable>; - public requestPasswordReset( - bodyRequestPasswordReset: BodyRequestPasswordReset, - observe: any = 'body', - reportProgress: boolean = false, - options?: { - httpHeaderAccept?: 'application/json'; - context?: HttpContext; - transferCache?: boolean; - }, - ): Observable { - if ( - bodyRequestPasswordReset === null || - bodyRequestPasswordReset === undefined - ) { - throw new Error( - 'Required parameter bodyRequestPasswordReset was null or undefined when calling requestPasswordReset.', - ); - } - - let localVarHeaders = this.defaultHeaders; - - const localVarHttpHeaderAcceptSelected: string | undefined = - options?.httpHeaderAccept ?? - this.configuration.selectHeaderAccept(['application/json']); - if (localVarHttpHeaderAcceptSelected !== undefined) { - localVarHeaders = localVarHeaders.set( - 'Accept', - localVarHttpHeaderAcceptSelected, - ); - } - - const localVarHttpContext: HttpContext = - options?.context ?? new HttpContext(); - - const localVarTransferCache: boolean = options?.transferCache ?? true; - - // to determine the Content-Type header - const consumes: string[] = ['application/json']; - const httpContentTypeSelected: string | undefined = - this.configuration.selectHeaderContentType(consumes); - if (httpContentTypeSelected !== undefined) { - localVarHeaders = localVarHeaders.set( - 'Content-Type', - httpContentTypeSelected, - ); - } - - let responseType_: 'text' | 'json' | 'blob' = 'json'; - if (localVarHttpHeaderAcceptSelected) { - if (localVarHttpHeaderAcceptSelected.startsWith('text')) { - responseType_ = 'text'; - } else if ( - this.configuration.isJsonMime(localVarHttpHeaderAcceptSelected) - ) { - responseType_ = 'json'; - } else { - responseType_ = 'blob'; - } - } - - let localVarPath = `/api/auth/v2/request-password-reset`; - const { basePath, withCredentials } = this.configuration; - return this.httpClient.request('post', `${basePath}${localVarPath}`, { - context: localVarHttpContext, - body: bodyRequestPasswordReset, - responseType: responseType_, - ...(withCredentials ? { withCredentials } : {}), - headers: localVarHeaders, - observe: observe, - ...(localVarTransferCache !== undefined - ? { transferCache: localVarTransferCache } - : {}), - reportProgress: reportProgress, - }); - } - - /** - * Reset Password - * Reset the user\'s password using a one-time password reset token. - * @endpoint post /api/auth/v2/reset-password - * @param bodyResetPassword - * @param observe set whether or not to return the data Observable as the body, response or events. defaults to returning the body. - * @param reportProgress flag to report request and response progress. - */ - public resetPassword( - bodyResetPassword: BodyResetPassword, - observe?: 'body', - reportProgress?: boolean, - options?: { - httpHeaderAccept?: 'application/json'; - context?: HttpContext; - transferCache?: boolean; - }, - ): Observable; - public resetPassword( - bodyResetPassword: BodyResetPassword, - observe?: 'response', - reportProgress?: boolean, - options?: { - httpHeaderAccept?: 'application/json'; - context?: HttpContext; - transferCache?: boolean; - }, - ): Observable>; - public resetPassword( - bodyResetPassword: BodyResetPassword, - observe?: 'events', - reportProgress?: boolean, - options?: { - httpHeaderAccept?: 'application/json'; - context?: HttpContext; - transferCache?: boolean; - }, - ): Observable>; - public resetPassword( - bodyResetPassword: BodyResetPassword, - observe: any = 'body', - reportProgress: boolean = false, - options?: { - httpHeaderAccept?: 'application/json'; - context?: HttpContext; - transferCache?: boolean; - }, - ): Observable { - if (bodyResetPassword === null || bodyResetPassword === undefined) { - throw new Error( - 'Required parameter bodyResetPassword was null or undefined when calling resetPassword.', - ); - } - - let localVarHeaders = this.defaultHeaders; - - const localVarHttpHeaderAcceptSelected: string | undefined = - options?.httpHeaderAccept ?? - this.configuration.selectHeaderAccept(['application/json']); - if (localVarHttpHeaderAcceptSelected !== undefined) { - localVarHeaders = localVarHeaders.set( - 'Accept', - localVarHttpHeaderAcceptSelected, - ); - } - - const localVarHttpContext: HttpContext = - options?.context ?? new HttpContext(); - - const localVarTransferCache: boolean = options?.transferCache ?? true; - - // to determine the Content-Type header - const consumes: string[] = ['application/json']; - const httpContentTypeSelected: string | undefined = - this.configuration.selectHeaderContentType(consumes); - if (httpContentTypeSelected !== undefined) { - localVarHeaders = localVarHeaders.set( - 'Content-Type', - httpContentTypeSelected, - ); - } - - let responseType_: 'text' | 'json' | 'blob' = 'json'; - if (localVarHttpHeaderAcceptSelected) { - if (localVarHttpHeaderAcceptSelected.startsWith('text')) { - responseType_ = 'text'; - } else if ( - this.configuration.isJsonMime(localVarHttpHeaderAcceptSelected) - ) { - responseType_ = 'json'; - } else { - responseType_ = 'blob'; - } - } - - let localVarPath = `/api/auth/v2/reset-password`; - const { basePath, withCredentials } = this.configuration; - return this.httpClient.request('post', `${basePath}${localVarPath}`, { - context: localVarHttpContext, - body: bodyResetPassword, - responseType: responseType_, - ...(withCredentials ? { withCredentials } : {}), - headers: localVarHeaders, - observe: observe, - ...(localVarTransferCache !== undefined - ? { transferCache: localVarTransferCache } - : {}), - reportProgress: reportProgress, - }); - } - - /** - * Update Account - * @endpoint put /api/accounts/{account_id} - * @param accountId - * @param updateAccountRequest - * @param secureFgpAcc - * @param observe set whether or not to return the data Observable as the body, response or events. defaults to returning the body. - * @param reportProgress flag to report request and response progress. - */ - public updateAccount( - accountId: string, - updateAccountRequest: UpdateAccountRequest, - secureFgpAcc?: string, - observe?: 'body', - reportProgress?: boolean, - options?: { - httpHeaderAccept?: 'application/json'; - context?: HttpContext; - transferCache?: boolean; - }, - ): Observable; - public updateAccount( - accountId: string, - updateAccountRequest: UpdateAccountRequest, - secureFgpAcc?: string, - observe?: 'response', - reportProgress?: boolean, - options?: { - httpHeaderAccept?: 'application/json'; - context?: HttpContext; - transferCache?: boolean; - }, - ): Observable>; - public updateAccount( - accountId: string, - updateAccountRequest: UpdateAccountRequest, - secureFgpAcc?: string, - observe?: 'events', - reportProgress?: boolean, - options?: { - httpHeaderAccept?: 'application/json'; - context?: HttpContext; - transferCache?: boolean; - }, - ): Observable>; - public updateAccount( - accountId: string, - updateAccountRequest: UpdateAccountRequest, - secureFgpAcc?: string, - observe: any = 'body', - reportProgress: boolean = false, - options?: { - httpHeaderAccept?: 'application/json'; - context?: HttpContext; - transferCache?: boolean; - }, - ): Observable { - if (accountId === null || accountId === undefined) { - throw new Error( - 'Required parameter accountId was null or undefined when calling updateAccount.', - ); - } - if (updateAccountRequest === null || updateAccountRequest === undefined) { - throw new Error( - 'Required parameter updateAccountRequest was null or undefined when calling updateAccount.', - ); - } - - let localVarHeaders = this.defaultHeaders; - - // authentication (HTTPBearer) required - localVarHeaders = this.configuration.addCredentialToHeaders( - 'HTTPBearer', - 'Authorization', - localVarHeaders, - 'Bearer ', - ); - - const localVarHttpHeaderAcceptSelected: string | undefined = - options?.httpHeaderAccept ?? - this.configuration.selectHeaderAccept(['application/json']); - if (localVarHttpHeaderAcceptSelected !== undefined) { - localVarHeaders = localVarHeaders.set( - 'Accept', - localVarHttpHeaderAcceptSelected, - ); - } - - const localVarHttpContext: HttpContext = - options?.context ?? new HttpContext(); - - const localVarTransferCache: boolean = options?.transferCache ?? true; - - // to determine the Content-Type header - const consumes: string[] = ['application/json']; - const httpContentTypeSelected: string | undefined = - this.configuration.selectHeaderContentType(consumes); - if (httpContentTypeSelected !== undefined) { - localVarHeaders = localVarHeaders.set( - 'Content-Type', - httpContentTypeSelected, - ); - } - - let responseType_: 'text' | 'json' | 'blob' = 'json'; - if (localVarHttpHeaderAcceptSelected) { - if (localVarHttpHeaderAcceptSelected.startsWith('text')) { - responseType_ = 'text'; - } else if ( - this.configuration.isJsonMime(localVarHttpHeaderAcceptSelected) - ) { - responseType_ = 'json'; - } else { - responseType_ = 'blob'; - } - } - - let localVarPath = `/api/accounts/${this.configuration.encodeParam({ name: 'accountId', value: accountId, in: 'path', style: 'simple', explode: false, dataType: 'string', dataFormat: 'uuid' })}`; - const { basePath, withCredentials } = this.configuration; - return this.httpClient.request( - 'put', - `${basePath}${localVarPath}`, - { - context: localVarHttpContext, - body: updateAccountRequest, - responseType: responseType_, - ...(withCredentials ? { withCredentials } : {}), - headers: localVarHeaders, - observe: observe, - ...(localVarTransferCache !== undefined - ? { transferCache: localVarTransferCache } - : {}), - reportProgress: reportProgress, - }, - ); - } } diff --git a/webapp/src/app/api/api/authorsV2.service.ts b/webapp/src/app/api/api/authorsV2.service.ts new file mode 100644 index 00000000..9b1deb23 --- /dev/null +++ b/webapp/src/app/api/api/authorsV2.service.ts @@ -0,0 +1,158 @@ +/** + * Innovation Search Engine API + * + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ +/* tslint:disable:no-unused-variable member-ordering */ + +import { Inject, Injectable, Optional } from '@angular/core'; +import { HttpClient, HttpHeaders, HttpParams, + HttpResponse, HttpEvent, HttpParameterCodec, HttpContext + } from '@angular/common/http'; +import { CustomHttpParameterCodec } from '../encoder'; +import { Observable } from 'rxjs'; + +// @ts-ignore +import { AuthorPage } from '../model/authorPage'; +// @ts-ignore +import { HTTPValidationError } from '../model/hTTPValidationError'; + +// @ts-ignore +import { BASE_PATH, COLLECTION_FORMATS } from '../variables'; +import { Configuration } from '../configuration'; +import { BaseService } from '../api.base.service'; + + + +@Injectable({ + providedIn: 'root' +}) +export class AuthorsV2Service extends BaseService { + + constructor(protected httpClient: HttpClient, @Optional() @Inject(BASE_PATH) basePath: string|string[], @Optional() configuration?: Configuration) { + super(basePath, configuration); + } + + /** + * Returns a paginated list of authors for a given search term based on their display name. + * @endpoint get /api/v2/authors/autocomplete/selector + * @param query A search term to filter authors by (partial matches allowed). + * @param observe set whether or not to return the data Observable as the body, response or events. defaults to returning the body. + * @param reportProgress flag to report request and response progress. + */ + public autocompleteAuthorsForSelector(query?: string, observe?: 'body', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable; + public autocompleteAuthorsForSelector(query?: string, observe?: 'response', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable>; + public autocompleteAuthorsForSelector(query?: string, observe?: 'events', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable>; + public autocompleteAuthorsForSelector(query?: string, observe: any = 'body', reportProgress: boolean = false, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable { + + let localVarQueryParameters = new HttpParams({encoder: this.encoder}); + localVarQueryParameters = this.addToHttpParams(localVarQueryParameters, + query, 'query'); + + let localVarHeaders = this.defaultHeaders; + + const localVarHttpHeaderAcceptSelected: string | undefined = options?.httpHeaderAccept ?? this.configuration.selectHeaderAccept([ + 'application/json' + ]); + if (localVarHttpHeaderAcceptSelected !== undefined) { + localVarHeaders = localVarHeaders.set('Accept', localVarHttpHeaderAcceptSelected); + } + + const localVarHttpContext: HttpContext = options?.context ?? new HttpContext(); + + const localVarTransferCache: boolean = options?.transferCache ?? true; + + + let responseType_: 'text' | 'json' | 'blob' = 'json'; + if (localVarHttpHeaderAcceptSelected) { + if (localVarHttpHeaderAcceptSelected.startsWith('text')) { + responseType_ = 'text'; + } else if (this.configuration.isJsonMime(localVarHttpHeaderAcceptSelected)) { + responseType_ = 'json'; + } else { + responseType_ = 'blob'; + } + } + + let localVarPath = `/api/v2/authors/autocomplete/selector`; + const { basePath, withCredentials } = this.configuration; + return this.httpClient.request('get', `${basePath}${localVarPath}`, + { + context: localVarHttpContext, + params: localVarQueryParameters, + responseType: responseType_, + ...(withCredentials ? { withCredentials } : {}), + headers: localVarHeaders, + observe: observe, + ...(localVarTransferCache !== undefined ? { transferCache: localVarTransferCache } : {}), + reportProgress: reportProgress + } + ); + } + + /** + * Returns a paginated list of authors for a given list of author IDs. + * @endpoint get /api/v2/authors/authors/id + * @param authorIds A list of author IDs to retrieve. + * @param observe set whether or not to return the data Observable as the body, response or events. defaults to returning the body. + * @param reportProgress flag to report request and response progress. + */ + public getAuthorsByIds(authorIds?: Array, observe?: 'body', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable; + public getAuthorsByIds(authorIds?: Array, observe?: 'response', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable>; + public getAuthorsByIds(authorIds?: Array, observe?: 'events', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable>; + public getAuthorsByIds(authorIds?: Array, observe: any = 'body', reportProgress: boolean = false, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable { + + let localVarQueryParameters = new HttpParams({encoder: this.encoder}); + if (authorIds) { + authorIds.forEach((element) => { + localVarQueryParameters = this.addToHttpParams(localVarQueryParameters, + element, 'author_ids'); + }) + } + + let localVarHeaders = this.defaultHeaders; + + const localVarHttpHeaderAcceptSelected: string | undefined = options?.httpHeaderAccept ?? this.configuration.selectHeaderAccept([ + 'application/json' + ]); + if (localVarHttpHeaderAcceptSelected !== undefined) { + localVarHeaders = localVarHeaders.set('Accept', localVarHttpHeaderAcceptSelected); + } + + const localVarHttpContext: HttpContext = options?.context ?? new HttpContext(); + + const localVarTransferCache: boolean = options?.transferCache ?? true; + + + let responseType_: 'text' | 'json' | 'blob' = 'json'; + if (localVarHttpHeaderAcceptSelected) { + if (localVarHttpHeaderAcceptSelected.startsWith('text')) { + responseType_ = 'text'; + } else if (this.configuration.isJsonMime(localVarHttpHeaderAcceptSelected)) { + responseType_ = 'json'; + } else { + responseType_ = 'blob'; + } + } + + let localVarPath = `/api/v2/authors/authors/id`; + const { basePath, withCredentials } = this.configuration; + return this.httpClient.request('get', `${basePath}${localVarPath}`, + { + context: localVarHttpContext, + params: localVarQueryParameters, + responseType: responseType_, + ...(withCredentials ? { withCredentials } : {}), + headers: localVarHeaders, + observe: observe, + ...(localVarTransferCache !== undefined ? { transferCache: localVarTransferCache } : {}), + reportProgress: reportProgress + } + ); + } + +} diff --git a/webapp/src/app/api/api/bookmarks.service.ts b/webapp/src/app/api/api/bookmarks.service.ts index 198f796e..3e0ec2e8 100644 --- a/webapp/src/app/api/api/bookmarks.service.ts +++ b/webapp/src/app/api/api/bookmarks.service.ts @@ -1,7 +1,7 @@ /** * Innovation Search Engine API * - * + * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech @@ -9,18 +9,12 @@ */ /* tslint:disable:no-unused-variable member-ordering */ -import { Inject, Injectable, Optional } from '@angular/core'; -import { - HttpClient, - HttpHeaders, - HttpParams, - HttpResponse, - HttpEvent, - HttpParameterCodec, - HttpContext, -} from '@angular/common/http'; -import { CustomHttpParameterCodec } from '../encoder'; -import { Observable } from 'rxjs'; +import { Inject, Injectable, Optional } from '@angular/core'; +import { HttpClient, HttpHeaders, HttpParams, + HttpResponse, HttpEvent, HttpParameterCodec, HttpContext + } from '@angular/common/http'; +import { CustomHttpParameterCodec } from '../encoder'; +import { Observable } from 'rxjs'; // @ts-ignore import { CreatePersonBookmark } from '../model/createPersonBookmark'; @@ -30,375 +24,206 @@ import { HTTPValidationError } from '../model/hTTPValidationError'; import { PersonBookmarkResponse } from '../model/personBookmarkResponse'; // @ts-ignore -import { BASE_PATH, COLLECTION_FORMATS } from '../variables'; -import { Configuration } from '../configuration'; +import { BASE_PATH, COLLECTION_FORMATS } from '../variables'; +import { Configuration } from '../configuration'; import { BaseService } from '../api.base.service'; + + @Injectable({ - providedIn: 'root', + providedIn: 'root' }) export class BookmarksService extends BaseService { - constructor( - protected httpClient: HttpClient, - @Optional() @Inject(BASE_PATH) basePath: string | string[], - @Optional() configuration?: Configuration, - ) { - super(basePath, configuration); - } - /** - * Bookmark Person - * @endpoint put /api/bookmarks/persons/{person_id} - * @param personId - * @param createPersonBookmark - * @param secureFgpAcc - * @param observe set whether or not to return the data Observable as the body, response or events. defaults to returning the body. - * @param reportProgress flag to report request and response progress. - */ - public bookmarkPerson( - personId: string, - createPersonBookmark: CreatePersonBookmark, - secureFgpAcc?: string, - observe?: 'body', - reportProgress?: boolean, - options?: { - httpHeaderAccept?: 'application/json'; - context?: HttpContext; - transferCache?: boolean; - }, - ): Observable; - public bookmarkPerson( - personId: string, - createPersonBookmark: CreatePersonBookmark, - secureFgpAcc?: string, - observe?: 'response', - reportProgress?: boolean, - options?: { - httpHeaderAccept?: 'application/json'; - context?: HttpContext; - transferCache?: boolean; - }, - ): Observable>; - public bookmarkPerson( - personId: string, - createPersonBookmark: CreatePersonBookmark, - secureFgpAcc?: string, - observe?: 'events', - reportProgress?: boolean, - options?: { - httpHeaderAccept?: 'application/json'; - context?: HttpContext; - transferCache?: boolean; - }, - ): Observable>; - public bookmarkPerson( - personId: string, - createPersonBookmark: CreatePersonBookmark, - secureFgpAcc?: string, - observe: any = 'body', - reportProgress: boolean = false, - options?: { - httpHeaderAccept?: 'application/json'; - context?: HttpContext; - transferCache?: boolean; - }, - ): Observable { - if (personId === null || personId === undefined) { - throw new Error( - 'Required parameter personId was null or undefined when calling bookmarkPerson.', - ); - } - if (createPersonBookmark === null || createPersonBookmark === undefined) { - throw new Error( - 'Required parameter createPersonBookmark was null or undefined when calling bookmarkPerson.', - ); + constructor(protected httpClient: HttpClient, @Optional() @Inject(BASE_PATH) basePath: string|string[], @Optional() configuration?: Configuration) { + super(basePath, configuration); } - let localVarHeaders = this.defaultHeaders; + /** + * Bookmark Person + * @endpoint put /api/bookmarks/persons/{person_id} + * @param personId + * @param createPersonBookmark + * @param secureFgpAcc + * @param observe set whether or not to return the data Observable as the body, response or events. defaults to returning the body. + * @param reportProgress flag to report request and response progress. + */ + public bookmarkPerson(personId: string, createPersonBookmark: CreatePersonBookmark, secureFgpAcc?: string, observe?: 'body', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable; + public bookmarkPerson(personId: string, createPersonBookmark: CreatePersonBookmark, secureFgpAcc?: string, observe?: 'response', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable>; + public bookmarkPerson(personId: string, createPersonBookmark: CreatePersonBookmark, secureFgpAcc?: string, observe?: 'events', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable>; + public bookmarkPerson(personId: string, createPersonBookmark: CreatePersonBookmark, secureFgpAcc?: string, observe: any = 'body', reportProgress: boolean = false, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable { + if (personId === null || personId === undefined) { + throw new Error('Required parameter personId was null or undefined when calling bookmarkPerson.'); + } + if (createPersonBookmark === null || createPersonBookmark === undefined) { + throw new Error('Required parameter createPersonBookmark was null or undefined when calling bookmarkPerson.'); + } - // authentication (HTTPBearer) required - localVarHeaders = this.configuration.addCredentialToHeaders( - 'HTTPBearer', - 'Authorization', - localVarHeaders, - 'Bearer ', - ); + let localVarHeaders = this.defaultHeaders; - const localVarHttpHeaderAcceptSelected: string | undefined = - options?.httpHeaderAccept ?? - this.configuration.selectHeaderAccept(['application/json']); - if (localVarHttpHeaderAcceptSelected !== undefined) { - localVarHeaders = localVarHeaders.set( - 'Accept', - localVarHttpHeaderAcceptSelected, - ); + // authentication (HTTPBearer) required + localVarHeaders = this.configuration.addCredentialToHeaders('HTTPBearer', 'Authorization', localVarHeaders, 'Bearer '); + + const localVarHttpHeaderAcceptSelected: string | undefined = options?.httpHeaderAccept ?? this.configuration.selectHeaderAccept([ + 'application/json' + ]); + if (localVarHttpHeaderAcceptSelected !== undefined) { + localVarHeaders = localVarHeaders.set('Accept', localVarHttpHeaderAcceptSelected); + } + + const localVarHttpContext: HttpContext = options?.context ?? new HttpContext(); + + const localVarTransferCache: boolean = options?.transferCache ?? true; + + + // to determine the Content-Type header + const consumes: string[] = [ + 'application/json' + ]; + const httpContentTypeSelected: string | undefined = this.configuration.selectHeaderContentType(consumes); + if (httpContentTypeSelected !== undefined) { + localVarHeaders = localVarHeaders.set('Content-Type', httpContentTypeSelected); + } + + let responseType_: 'text' | 'json' | 'blob' = 'json'; + if (localVarHttpHeaderAcceptSelected) { + if (localVarHttpHeaderAcceptSelected.startsWith('text')) { + responseType_ = 'text'; + } else if (this.configuration.isJsonMime(localVarHttpHeaderAcceptSelected)) { + responseType_ = 'json'; + } else { + responseType_ = 'blob'; + } + } + + let localVarPath = `/api/bookmarks/persons/${this.configuration.encodeParam({name: "personId", value: personId, in: "path", style: "simple", explode: false, dataType: "string", dataFormat: undefined})}`; + const { basePath, withCredentials } = this.configuration; + return this.httpClient.request('put', `${basePath}${localVarPath}`, + { + context: localVarHttpContext, + body: createPersonBookmark, + responseType: responseType_, + ...(withCredentials ? { withCredentials } : {}), + headers: localVarHeaders, + observe: observe, + ...(localVarTransferCache !== undefined ? { transferCache: localVarTransferCache } : {}), + reportProgress: reportProgress + } + ); } - const localVarHttpContext: HttpContext = - options?.context ?? new HttpContext(); + /** + * List Person Bookmarks + * @endpoint get /api/bookmarks/persons + * @param secureFgpAcc + * @param observe set whether or not to return the data Observable as the body, response or events. defaults to returning the body. + * @param reportProgress flag to report request and response progress. + */ + public listPersonBookmarks(secureFgpAcc?: string, observe?: 'body', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable>; + public listPersonBookmarks(secureFgpAcc?: string, observe?: 'response', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable>>; + public listPersonBookmarks(secureFgpAcc?: string, observe?: 'events', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable>>; + public listPersonBookmarks(secureFgpAcc?: string, observe: any = 'body', reportProgress: boolean = false, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable { - const localVarTransferCache: boolean = options?.transferCache ?? true; + let localVarHeaders = this.defaultHeaders; - // to determine the Content-Type header - const consumes: string[] = ['application/json']; - const httpContentTypeSelected: string | undefined = - this.configuration.selectHeaderContentType(consumes); - if (httpContentTypeSelected !== undefined) { - localVarHeaders = localVarHeaders.set( - 'Content-Type', - httpContentTypeSelected, - ); + // authentication (HTTPBearer) required + localVarHeaders = this.configuration.addCredentialToHeaders('HTTPBearer', 'Authorization', localVarHeaders, 'Bearer '); + + const localVarHttpHeaderAcceptSelected: string | undefined = options?.httpHeaderAccept ?? this.configuration.selectHeaderAccept([ + 'application/json' + ]); + if (localVarHttpHeaderAcceptSelected !== undefined) { + localVarHeaders = localVarHeaders.set('Accept', localVarHttpHeaderAcceptSelected); + } + + const localVarHttpContext: HttpContext = options?.context ?? new HttpContext(); + + const localVarTransferCache: boolean = options?.transferCache ?? true; + + + let responseType_: 'text' | 'json' | 'blob' = 'json'; + if (localVarHttpHeaderAcceptSelected) { + if (localVarHttpHeaderAcceptSelected.startsWith('text')) { + responseType_ = 'text'; + } else if (this.configuration.isJsonMime(localVarHttpHeaderAcceptSelected)) { + responseType_ = 'json'; + } else { + responseType_ = 'blob'; + } + } + + let localVarPath = `/api/bookmarks/persons`; + const { basePath, withCredentials } = this.configuration; + return this.httpClient.request>('get', `${basePath}${localVarPath}`, + { + context: localVarHttpContext, + responseType: responseType_, + ...(withCredentials ? { withCredentials } : {}), + headers: localVarHeaders, + observe: observe, + ...(localVarTransferCache !== undefined ? { transferCache: localVarTransferCache } : {}), + reportProgress: reportProgress + } + ); } - let responseType_: 'text' | 'json' | 'blob' = 'json'; - if (localVarHttpHeaderAcceptSelected) { - if (localVarHttpHeaderAcceptSelected.startsWith('text')) { - responseType_ = 'text'; - } else if ( - this.configuration.isJsonMime(localVarHttpHeaderAcceptSelected) - ) { - responseType_ = 'json'; - } else { - responseType_ = 'blob'; - } + /** + * Remove Person Bookmark + * @endpoint delete /api/bookmarks/persons/{person_id} + * @param personId + * @param secureFgpAcc + * @param observe set whether or not to return the data Observable as the body, response or events. defaults to returning the body. + * @param reportProgress flag to report request and response progress. + */ + public removePersonBookmark(personId: string, secureFgpAcc?: string, observe?: 'body', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable; + public removePersonBookmark(personId: string, secureFgpAcc?: string, observe?: 'response', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable>; + public removePersonBookmark(personId: string, secureFgpAcc?: string, observe?: 'events', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable>; + public removePersonBookmark(personId: string, secureFgpAcc?: string, observe: any = 'body', reportProgress: boolean = false, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable { + if (personId === null || personId === undefined) { + throw new Error('Required parameter personId was null or undefined when calling removePersonBookmark.'); + } + + let localVarHeaders = this.defaultHeaders; + + // authentication (HTTPBearer) required + localVarHeaders = this.configuration.addCredentialToHeaders('HTTPBearer', 'Authorization', localVarHeaders, 'Bearer '); + + const localVarHttpHeaderAcceptSelected: string | undefined = options?.httpHeaderAccept ?? this.configuration.selectHeaderAccept([ + 'application/json' + ]); + if (localVarHttpHeaderAcceptSelected !== undefined) { + localVarHeaders = localVarHeaders.set('Accept', localVarHttpHeaderAcceptSelected); + } + + const localVarHttpContext: HttpContext = options?.context ?? new HttpContext(); + + const localVarTransferCache: boolean = options?.transferCache ?? true; + + + let responseType_: 'text' | 'json' | 'blob' = 'json'; + if (localVarHttpHeaderAcceptSelected) { + if (localVarHttpHeaderAcceptSelected.startsWith('text')) { + responseType_ = 'text'; + } else if (this.configuration.isJsonMime(localVarHttpHeaderAcceptSelected)) { + responseType_ = 'json'; + } else { + responseType_ = 'blob'; + } + } + + let localVarPath = `/api/bookmarks/persons/${this.configuration.encodeParam({name: "personId", value: personId, in: "path", style: "simple", explode: false, dataType: "string", dataFormat: undefined})}`; + const { basePath, withCredentials } = this.configuration; + return this.httpClient.request('delete', `${basePath}${localVarPath}`, + { + context: localVarHttpContext, + responseType: responseType_, + ...(withCredentials ? { withCredentials } : {}), + headers: localVarHeaders, + observe: observe, + ...(localVarTransferCache !== undefined ? { transferCache: localVarTransferCache } : {}), + reportProgress: reportProgress + } + ); } - let localVarPath = `/api/bookmarks/persons/${this.configuration.encodeParam({ name: 'personId', value: personId, in: 'path', style: 'simple', explode: false, dataType: 'string', dataFormat: undefined })}`; - const { basePath, withCredentials } = this.configuration; - return this.httpClient.request( - 'put', - `${basePath}${localVarPath}`, - { - context: localVarHttpContext, - body: createPersonBookmark, - responseType: responseType_, - ...(withCredentials ? { withCredentials } : {}), - headers: localVarHeaders, - observe: observe, - ...(localVarTransferCache !== undefined - ? { transferCache: localVarTransferCache } - : {}), - reportProgress: reportProgress, - }, - ); - } - - /** - * List Person Bookmarks - * @endpoint get /api/bookmarks/persons - * @param secureFgpAcc - * @param observe set whether or not to return the data Observable as the body, response or events. defaults to returning the body. - * @param reportProgress flag to report request and response progress. - */ - public listPersonBookmarks( - secureFgpAcc?: string, - observe?: 'body', - reportProgress?: boolean, - options?: { - httpHeaderAccept?: 'application/json'; - context?: HttpContext; - transferCache?: boolean; - }, - ): Observable>; - public listPersonBookmarks( - secureFgpAcc?: string, - observe?: 'response', - reportProgress?: boolean, - options?: { - httpHeaderAccept?: 'application/json'; - context?: HttpContext; - transferCache?: boolean; - }, - ): Observable>>; - public listPersonBookmarks( - secureFgpAcc?: string, - observe?: 'events', - reportProgress?: boolean, - options?: { - httpHeaderAccept?: 'application/json'; - context?: HttpContext; - transferCache?: boolean; - }, - ): Observable>>; - public listPersonBookmarks( - secureFgpAcc?: string, - observe: any = 'body', - reportProgress: boolean = false, - options?: { - httpHeaderAccept?: 'application/json'; - context?: HttpContext; - transferCache?: boolean; - }, - ): Observable { - let localVarHeaders = this.defaultHeaders; - - // authentication (HTTPBearer) required - localVarHeaders = this.configuration.addCredentialToHeaders( - 'HTTPBearer', - 'Authorization', - localVarHeaders, - 'Bearer ', - ); - - const localVarHttpHeaderAcceptSelected: string | undefined = - options?.httpHeaderAccept ?? - this.configuration.selectHeaderAccept(['application/json']); - if (localVarHttpHeaderAcceptSelected !== undefined) { - localVarHeaders = localVarHeaders.set( - 'Accept', - localVarHttpHeaderAcceptSelected, - ); - } - - const localVarHttpContext: HttpContext = - options?.context ?? new HttpContext(); - - const localVarTransferCache: boolean = options?.transferCache ?? true; - - let responseType_: 'text' | 'json' | 'blob' = 'json'; - if (localVarHttpHeaderAcceptSelected) { - if (localVarHttpHeaderAcceptSelected.startsWith('text')) { - responseType_ = 'text'; - } else if ( - this.configuration.isJsonMime(localVarHttpHeaderAcceptSelected) - ) { - responseType_ = 'json'; - } else { - responseType_ = 'blob'; - } - } - - let localVarPath = `/api/bookmarks/persons`; - const { basePath, withCredentials } = this.configuration; - return this.httpClient.request>( - 'get', - `${basePath}${localVarPath}`, - { - context: localVarHttpContext, - responseType: responseType_, - ...(withCredentials ? { withCredentials } : {}), - headers: localVarHeaders, - observe: observe, - ...(localVarTransferCache !== undefined - ? { transferCache: localVarTransferCache } - : {}), - reportProgress: reportProgress, - }, - ); - } - - /** - * Remove Person Bookmark - * @endpoint delete /api/bookmarks/persons/{person_id} - * @param personId - * @param secureFgpAcc - * @param observe set whether or not to return the data Observable as the body, response or events. defaults to returning the body. - * @param reportProgress flag to report request and response progress. - */ - public removePersonBookmark( - personId: string, - secureFgpAcc?: string, - observe?: 'body', - reportProgress?: boolean, - options?: { - httpHeaderAccept?: 'application/json'; - context?: HttpContext; - transferCache?: boolean; - }, - ): Observable; - public removePersonBookmark( - personId: string, - secureFgpAcc?: string, - observe?: 'response', - reportProgress?: boolean, - options?: { - httpHeaderAccept?: 'application/json'; - context?: HttpContext; - transferCache?: boolean; - }, - ): Observable>; - public removePersonBookmark( - personId: string, - secureFgpAcc?: string, - observe?: 'events', - reportProgress?: boolean, - options?: { - httpHeaderAccept?: 'application/json'; - context?: HttpContext; - transferCache?: boolean; - }, - ): Observable>; - public removePersonBookmark( - personId: string, - secureFgpAcc?: string, - observe: any = 'body', - reportProgress: boolean = false, - options?: { - httpHeaderAccept?: 'application/json'; - context?: HttpContext; - transferCache?: boolean; - }, - ): Observable { - if (personId === null || personId === undefined) { - throw new Error( - 'Required parameter personId was null or undefined when calling removePersonBookmark.', - ); - } - - let localVarHeaders = this.defaultHeaders; - - // authentication (HTTPBearer) required - localVarHeaders = this.configuration.addCredentialToHeaders( - 'HTTPBearer', - 'Authorization', - localVarHeaders, - 'Bearer ', - ); - - const localVarHttpHeaderAcceptSelected: string | undefined = - options?.httpHeaderAccept ?? - this.configuration.selectHeaderAccept(['application/json']); - if (localVarHttpHeaderAcceptSelected !== undefined) { - localVarHeaders = localVarHeaders.set( - 'Accept', - localVarHttpHeaderAcceptSelected, - ); - } - - const localVarHttpContext: HttpContext = - options?.context ?? new HttpContext(); - - const localVarTransferCache: boolean = options?.transferCache ?? true; - - let responseType_: 'text' | 'json' | 'blob' = 'json'; - if (localVarHttpHeaderAcceptSelected) { - if (localVarHttpHeaderAcceptSelected.startsWith('text')) { - responseType_ = 'text'; - } else if ( - this.configuration.isJsonMime(localVarHttpHeaderAcceptSelected) - ) { - responseType_ = 'json'; - } else { - responseType_ = 'blob'; - } - } - - let localVarPath = `/api/bookmarks/persons/${this.configuration.encodeParam({ name: 'personId', value: personId, in: 'path', style: 'simple', explode: false, dataType: 'string', dataFormat: undefined })}`; - const { basePath, withCredentials } = this.configuration; - return this.httpClient.request( - 'delete', - `${basePath}${localVarPath}`, - { - context: localVarHttpContext, - responseType: responseType_, - ...(withCredentials ? { withCredentials } : {}), - headers: localVarHeaders, - observe: observe, - ...(localVarTransferCache !== undefined - ? { transferCache: localVarTransferCache } - : {}), - reportProgress: reportProgress, - }, - ); - } } diff --git a/webapp/src/app/api/api/companyConnections.service.ts b/webapp/src/app/api/api/companyConnections.service.ts index 6ad850ea..cbc5f803 100644 --- a/webapp/src/app/api/api/companyConnections.service.ts +++ b/webapp/src/app/api/api/companyConnections.service.ts @@ -1,7 +1,7 @@ /** * Innovation Search Engine API * - * + * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech @@ -9,18 +9,12 @@ */ /* tslint:disable:no-unused-variable member-ordering */ -import { Inject, Injectable, Optional } from '@angular/core'; -import { - HttpClient, - HttpHeaders, - HttpParams, - HttpResponse, - HttpEvent, - HttpParameterCodec, - HttpContext, -} from '@angular/common/http'; -import { CustomHttpParameterCodec } from '../encoder'; -import { Observable } from 'rxjs'; +import { Inject, Injectable, Optional } from '@angular/core'; +import { HttpClient, HttpHeaders, HttpParams, + HttpResponse, HttpEvent, HttpParameterCodec, HttpContext + } from '@angular/common/http'; +import { CustomHttpParameterCodec } from '../encoder'; +import { Observable } from 'rxjs'; // @ts-ignore import { CompanyConnectionsResponse } from '../model/companyConnectionsResponse'; @@ -28,121 +22,74 @@ import { CompanyConnectionsResponse } from '../model/companyConnectionsResponse' import { HTTPValidationError } from '../model/hTTPValidationError'; // @ts-ignore -import { BASE_PATH, COLLECTION_FORMATS } from '../variables'; -import { Configuration } from '../configuration'; +import { BASE_PATH, COLLECTION_FORMATS } from '../variables'; +import { Configuration } from '../configuration'; import { BaseService } from '../api.base.service'; + + @Injectable({ - providedIn: 'root', + providedIn: 'root' }) export class CompanyConnectionsService extends BaseService { - constructor( - protected httpClient: HttpClient, - @Optional() @Inject(BASE_PATH) basePath: string | string[], - @Optional() configuration?: Configuration, - ) { - super(basePath, configuration); - } - /** - * Get possible company connections by OpenAlex author ID. - * @endpoint get /api/inse-service/authors/{author_id}/company-connections - * @param authorId - * @param observe set whether or not to return the data Observable as the body, response or events. defaults to returning the body. - * @param reportProgress flag to report request and response progress. - */ - public getCompanyConnectionsByAuthor( - authorId: string, - observe?: 'body', - reportProgress?: boolean, - options?: { - httpHeaderAccept?: 'application/json'; - context?: HttpContext; - transferCache?: boolean; - }, - ): Observable; - public getCompanyConnectionsByAuthor( - authorId: string, - observe?: 'response', - reportProgress?: boolean, - options?: { - httpHeaderAccept?: 'application/json'; - context?: HttpContext; - transferCache?: boolean; - }, - ): Observable>; - public getCompanyConnectionsByAuthor( - authorId: string, - observe?: 'events', - reportProgress?: boolean, - options?: { - httpHeaderAccept?: 'application/json'; - context?: HttpContext; - transferCache?: boolean; - }, - ): Observable>; - public getCompanyConnectionsByAuthor( - authorId: string, - observe: any = 'body', - reportProgress: boolean = false, - options?: { - httpHeaderAccept?: 'application/json'; - context?: HttpContext; - transferCache?: boolean; - }, - ): Observable { - if (authorId === null || authorId === undefined) { - throw new Error( - 'Required parameter authorId was null or undefined when calling getCompanyConnectionsByAuthor.', - ); + constructor(protected httpClient: HttpClient, @Optional() @Inject(BASE_PATH) basePath: string|string[], @Optional() configuration?: Configuration) { + super(basePath, configuration); } - let localVarHeaders = this.defaultHeaders; + /** + * Get possible company connections by OpenAlex author ID. + * @endpoint get /api/inse-service/authors/{author_id}/company-connections + * @param authorId + * @param observe set whether or not to return the data Observable as the body, response or events. defaults to returning the body. + * @param reportProgress flag to report request and response progress. + */ + public getCompanyConnectionsByAuthor(authorId: string, observe?: 'body', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable; + public getCompanyConnectionsByAuthor(authorId: string, observe?: 'response', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable>; + public getCompanyConnectionsByAuthor(authorId: string, observe?: 'events', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable>; + public getCompanyConnectionsByAuthor(authorId: string, observe: any = 'body', reportProgress: boolean = false, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable { + if (authorId === null || authorId === undefined) { + throw new Error('Required parameter authorId was null or undefined when calling getCompanyConnectionsByAuthor.'); + } - const localVarHttpHeaderAcceptSelected: string | undefined = - options?.httpHeaderAccept ?? - this.configuration.selectHeaderAccept(['application/json']); - if (localVarHttpHeaderAcceptSelected !== undefined) { - localVarHeaders = localVarHeaders.set( - 'Accept', - localVarHttpHeaderAcceptSelected, - ); + let localVarHeaders = this.defaultHeaders; + + const localVarHttpHeaderAcceptSelected: string | undefined = options?.httpHeaderAccept ?? this.configuration.selectHeaderAccept([ + 'application/json' + ]); + if (localVarHttpHeaderAcceptSelected !== undefined) { + localVarHeaders = localVarHeaders.set('Accept', localVarHttpHeaderAcceptSelected); + } + + const localVarHttpContext: HttpContext = options?.context ?? new HttpContext(); + + const localVarTransferCache: boolean = options?.transferCache ?? true; + + + let responseType_: 'text' | 'json' | 'blob' = 'json'; + if (localVarHttpHeaderAcceptSelected) { + if (localVarHttpHeaderAcceptSelected.startsWith('text')) { + responseType_ = 'text'; + } else if (this.configuration.isJsonMime(localVarHttpHeaderAcceptSelected)) { + responseType_ = 'json'; + } else { + responseType_ = 'blob'; + } + } + + let localVarPath = `/api/inse-service/authors/${this.configuration.encodeParam({name: "authorId", value: authorId, in: "path", style: "simple", explode: false, dataType: "string", dataFormat: undefined})}/company-connections`; + const { basePath, withCredentials } = this.configuration; + return this.httpClient.request('get', `${basePath}${localVarPath}`, + { + context: localVarHttpContext, + responseType: responseType_, + ...(withCredentials ? { withCredentials } : {}), + headers: localVarHeaders, + observe: observe, + ...(localVarTransferCache !== undefined ? { transferCache: localVarTransferCache } : {}), + reportProgress: reportProgress + } + ); } - const localVarHttpContext: HttpContext = - options?.context ?? new HttpContext(); - - const localVarTransferCache: boolean = options?.transferCache ?? true; - - let responseType_: 'text' | 'json' | 'blob' = 'json'; - if (localVarHttpHeaderAcceptSelected) { - if (localVarHttpHeaderAcceptSelected.startsWith('text')) { - responseType_ = 'text'; - } else if ( - this.configuration.isJsonMime(localVarHttpHeaderAcceptSelected) - ) { - responseType_ = 'json'; - } else { - responseType_ = 'blob'; - } - } - - let localVarPath = `/api/inse-service/authors/${this.configuration.encodeParam({ name: 'authorId', value: authorId, in: 'path', style: 'simple', explode: false, dataType: 'string', dataFormat: undefined })}/company-connections`; - const { basePath, withCredentials } = this.configuration; - return this.httpClient.request( - 'get', - `${basePath}${localVarPath}`, - { - context: localVarHttpContext, - responseType: responseType_, - ...(withCredentials ? { withCredentials } : {}), - headers: localVarHeaders, - observe: observe, - ...(localVarTransferCache !== undefined - ? { transferCache: localVarTransferCache } - : {}), - reportProgress: reportProgress, - }, - ); - } } diff --git a/webapp/src/app/api/api/dashboard.service.ts b/webapp/src/app/api/api/dashboard.service.ts index 247dfab8..5bf6b615 100644 --- a/webapp/src/app/api/api/dashboard.service.ts +++ b/webapp/src/app/api/api/dashboard.service.ts @@ -1,7 +1,7 @@ /** * Innovation Search Engine API * - * + * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech @@ -9,18 +9,12 @@ */ /* tslint:disable:no-unused-variable member-ordering */ -import { Inject, Injectable, Optional } from '@angular/core'; -import { - HttpClient, - HttpHeaders, - HttpParams, - HttpResponse, - HttpEvent, - HttpParameterCodec, - HttpContext, -} from '@angular/common/http'; -import { CustomHttpParameterCodec } from '../encoder'; -import { Observable } from 'rxjs'; +import { Inject, Injectable, Optional } from '@angular/core'; +import { HttpClient, HttpHeaders, HttpParams, + HttpResponse, HttpEvent, HttpParameterCodec, HttpContext + } from '@angular/common/http'; +import { CustomHttpParameterCodec } from '../encoder'; +import { Observable } from 'rxjs'; // @ts-ignore import { DashboardStatisticValue } from '../model/dashboardStatisticValue'; @@ -34,897 +28,477 @@ import { TopAuthorStatistics } from '../model/topAuthorStatistics'; import { TopicHeatmap } from '../model/topicHeatmap'; // @ts-ignore -import { BASE_PATH, COLLECTION_FORMATS } from '../variables'; -import { Configuration } from '../configuration'; +import { BASE_PATH, COLLECTION_FORMATS } from '../variables'; +import { Configuration } from '../configuration'; import { BaseService } from '../api.base.service'; + + @Injectable({ - providedIn: 'root', + providedIn: 'root' }) export class DashboardService extends BaseService { - constructor( - protected httpClient: HttpClient, - @Optional() @Inject(BASE_PATH) basePath: string | string[], - @Optional() configuration?: Configuration, - ) { - super(basePath, configuration); - } - /** - * Dashboard Bmbf Projects - * @endpoint get /api/dashboard/statistics/projects/bmbf - * @param secureFgpAcc - * @param observe set whether or not to return the data Observable as the body, response or events. defaults to returning the body. - * @param reportProgress flag to report request and response progress. - */ - public getDashboardBmbfProjects( - secureFgpAcc?: string, - observe?: 'body', - reportProgress?: boolean, - options?: { - httpHeaderAccept?: 'application/json'; - context?: HttpContext; - transferCache?: boolean; - }, - ): Observable; - public getDashboardBmbfProjects( - secureFgpAcc?: string, - observe?: 'response', - reportProgress?: boolean, - options?: { - httpHeaderAccept?: 'application/json'; - context?: HttpContext; - transferCache?: boolean; - }, - ): Observable>; - public getDashboardBmbfProjects( - secureFgpAcc?: string, - observe?: 'events', - reportProgress?: boolean, - options?: { - httpHeaderAccept?: 'application/json'; - context?: HttpContext; - transferCache?: boolean; - }, - ): Observable>; - public getDashboardBmbfProjects( - secureFgpAcc?: string, - observe: any = 'body', - reportProgress: boolean = false, - options?: { - httpHeaderAccept?: 'application/json'; - context?: HttpContext; - transferCache?: boolean; - }, - ): Observable { - let localVarHeaders = this.defaultHeaders; - - // authentication (HTTPBearer) required - localVarHeaders = this.configuration.addCredentialToHeaders( - 'HTTPBearer', - 'Authorization', - localVarHeaders, - 'Bearer ', - ); - - const localVarHttpHeaderAcceptSelected: string | undefined = - options?.httpHeaderAccept ?? - this.configuration.selectHeaderAccept(['application/json']); - if (localVarHttpHeaderAcceptSelected !== undefined) { - localVarHeaders = localVarHeaders.set( - 'Accept', - localVarHttpHeaderAcceptSelected, - ); + constructor(protected httpClient: HttpClient, @Optional() @Inject(BASE_PATH) basePath: string|string[], @Optional() configuration?: Configuration) { + super(basePath, configuration); } - const localVarHttpContext: HttpContext = - options?.context ?? new HttpContext(); + /** + * Dashboard Bmbf Projects + * @endpoint get /api/dashboard/statistics/projects/bmbf + * @param secureFgpAcc + * @param observe set whether or not to return the data Observable as the body, response or events. defaults to returning the body. + * @param reportProgress flag to report request and response progress. + */ + public getDashboardBmbfProjects(secureFgpAcc?: string, observe?: 'body', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable; + public getDashboardBmbfProjects(secureFgpAcc?: string, observe?: 'response', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable>; + public getDashboardBmbfProjects(secureFgpAcc?: string, observe?: 'events', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable>; + public getDashboardBmbfProjects(secureFgpAcc?: string, observe: any = 'body', reportProgress: boolean = false, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable { - const localVarTransferCache: boolean = options?.transferCache ?? true; + let localVarHeaders = this.defaultHeaders; - let responseType_: 'text' | 'json' | 'blob' = 'json'; - if (localVarHttpHeaderAcceptSelected) { - if (localVarHttpHeaderAcceptSelected.startsWith('text')) { - responseType_ = 'text'; - } else if ( - this.configuration.isJsonMime(localVarHttpHeaderAcceptSelected) - ) { - responseType_ = 'json'; - } else { - responseType_ = 'blob'; - } + // authentication (HTTPBearer) required + localVarHeaders = this.configuration.addCredentialToHeaders('HTTPBearer', 'Authorization', localVarHeaders, 'Bearer '); + + const localVarHttpHeaderAcceptSelected: string | undefined = options?.httpHeaderAccept ?? this.configuration.selectHeaderAccept([ + 'application/json' + ]); + if (localVarHttpHeaderAcceptSelected !== undefined) { + localVarHeaders = localVarHeaders.set('Accept', localVarHttpHeaderAcceptSelected); + } + + const localVarHttpContext: HttpContext = options?.context ?? new HttpContext(); + + const localVarTransferCache: boolean = options?.transferCache ?? true; + + + let responseType_: 'text' | 'json' | 'blob' = 'json'; + if (localVarHttpHeaderAcceptSelected) { + if (localVarHttpHeaderAcceptSelected.startsWith('text')) { + responseType_ = 'text'; + } else if (this.configuration.isJsonMime(localVarHttpHeaderAcceptSelected)) { + responseType_ = 'json'; + } else { + responseType_ = 'blob'; + } + } + + let localVarPath = `/api/dashboard/statistics/projects/bmbf`; + const { basePath, withCredentials } = this.configuration; + return this.httpClient.request('get', `${basePath}${localVarPath}`, + { + context: localVarHttpContext, + responseType: responseType_, + ...(withCredentials ? { withCredentials } : {}), + headers: localVarHeaders, + observe: observe, + ...(localVarTransferCache !== undefined ? { transferCache: localVarTransferCache } : {}), + reportProgress: reportProgress + } + ); } - let localVarPath = `/api/dashboard/statistics/projects/bmbf`; - const { basePath, withCredentials } = this.configuration; - return this.httpClient.request( - 'get', - `${basePath}${localVarPath}`, - { - context: localVarHttpContext, - responseType: responseType_, - ...(withCredentials ? { withCredentials } : {}), - headers: localVarHeaders, - observe: observe, - ...(localVarTransferCache !== undefined - ? { transferCache: localVarTransferCache } - : {}), - reportProgress: reportProgress, - }, - ); - } + /** + * Dashboard Dfg Projects + * @endpoint get /api/dashboard/statistics/projects/dfg + * @param secureFgpAcc + * @param observe set whether or not to return the data Observable as the body, response or events. defaults to returning the body. + * @param reportProgress flag to report request and response progress. + */ + public getDashboardDfgProjects(secureFgpAcc?: string, observe?: 'body', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable; + public getDashboardDfgProjects(secureFgpAcc?: string, observe?: 'response', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable>; + public getDashboardDfgProjects(secureFgpAcc?: string, observe?: 'events', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable>; + public getDashboardDfgProjects(secureFgpAcc?: string, observe: any = 'body', reportProgress: boolean = false, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable { - /** - * Dashboard Dfg Projects - * @endpoint get /api/dashboard/statistics/projects/dfg - * @param secureFgpAcc - * @param observe set whether or not to return the data Observable as the body, response or events. defaults to returning the body. - * @param reportProgress flag to report request and response progress. - */ - public getDashboardDfgProjects( - secureFgpAcc?: string, - observe?: 'body', - reportProgress?: boolean, - options?: { - httpHeaderAccept?: 'application/json'; - context?: HttpContext; - transferCache?: boolean; - }, - ): Observable; - public getDashboardDfgProjects( - secureFgpAcc?: string, - observe?: 'response', - reportProgress?: boolean, - options?: { - httpHeaderAccept?: 'application/json'; - context?: HttpContext; - transferCache?: boolean; - }, - ): Observable>; - public getDashboardDfgProjects( - secureFgpAcc?: string, - observe?: 'events', - reportProgress?: boolean, - options?: { - httpHeaderAccept?: 'application/json'; - context?: HttpContext; - transferCache?: boolean; - }, - ): Observable>; - public getDashboardDfgProjects( - secureFgpAcc?: string, - observe: any = 'body', - reportProgress: boolean = false, - options?: { - httpHeaderAccept?: 'application/json'; - context?: HttpContext; - transferCache?: boolean; - }, - ): Observable { - let localVarHeaders = this.defaultHeaders; + let localVarHeaders = this.defaultHeaders; - // authentication (HTTPBearer) required - localVarHeaders = this.configuration.addCredentialToHeaders( - 'HTTPBearer', - 'Authorization', - localVarHeaders, - 'Bearer ', - ); + // authentication (HTTPBearer) required + localVarHeaders = this.configuration.addCredentialToHeaders('HTTPBearer', 'Authorization', localVarHeaders, 'Bearer '); - const localVarHttpHeaderAcceptSelected: string | undefined = - options?.httpHeaderAccept ?? - this.configuration.selectHeaderAccept(['application/json']); - if (localVarHttpHeaderAcceptSelected !== undefined) { - localVarHeaders = localVarHeaders.set( - 'Accept', - localVarHttpHeaderAcceptSelected, - ); + const localVarHttpHeaderAcceptSelected: string | undefined = options?.httpHeaderAccept ?? this.configuration.selectHeaderAccept([ + 'application/json' + ]); + if (localVarHttpHeaderAcceptSelected !== undefined) { + localVarHeaders = localVarHeaders.set('Accept', localVarHttpHeaderAcceptSelected); + } + + const localVarHttpContext: HttpContext = options?.context ?? new HttpContext(); + + const localVarTransferCache: boolean = options?.transferCache ?? true; + + + let responseType_: 'text' | 'json' | 'blob' = 'json'; + if (localVarHttpHeaderAcceptSelected) { + if (localVarHttpHeaderAcceptSelected.startsWith('text')) { + responseType_ = 'text'; + } else if (this.configuration.isJsonMime(localVarHttpHeaderAcceptSelected)) { + responseType_ = 'json'; + } else { + responseType_ = 'blob'; + } + } + + let localVarPath = `/api/dashboard/statistics/projects/dfg`; + const { basePath, withCredentials } = this.configuration; + return this.httpClient.request('get', `${basePath}${localVarPath}`, + { + context: localVarHttpContext, + responseType: responseType_, + ...(withCredentials ? { withCredentials } : {}), + headers: localVarHeaders, + observe: observe, + ...(localVarTransferCache !== undefined ? { transferCache: localVarTransferCache } : {}), + reportProgress: reportProgress + } + ); } - const localVarHttpContext: HttpContext = - options?.context ?? new HttpContext(); + /** + * Dashboard Eu Projects + * @endpoint get /api/dashboard/statistics/projects/eu + * @param secureFgpAcc + * @param observe set whether or not to return the data Observable as the body, response or events. defaults to returning the body. + * @param reportProgress flag to report request and response progress. + */ + public getDashboardEuProjects(secureFgpAcc?: string, observe?: 'body', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable; + public getDashboardEuProjects(secureFgpAcc?: string, observe?: 'response', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable>; + public getDashboardEuProjects(secureFgpAcc?: string, observe?: 'events', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable>; + public getDashboardEuProjects(secureFgpAcc?: string, observe: any = 'body', reportProgress: boolean = false, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable { - const localVarTransferCache: boolean = options?.transferCache ?? true; + let localVarHeaders = this.defaultHeaders; - let responseType_: 'text' | 'json' | 'blob' = 'json'; - if (localVarHttpHeaderAcceptSelected) { - if (localVarHttpHeaderAcceptSelected.startsWith('text')) { - responseType_ = 'text'; - } else if ( - this.configuration.isJsonMime(localVarHttpHeaderAcceptSelected) - ) { - responseType_ = 'json'; - } else { - responseType_ = 'blob'; - } + // authentication (HTTPBearer) required + localVarHeaders = this.configuration.addCredentialToHeaders('HTTPBearer', 'Authorization', localVarHeaders, 'Bearer '); + + const localVarHttpHeaderAcceptSelected: string | undefined = options?.httpHeaderAccept ?? this.configuration.selectHeaderAccept([ + 'application/json' + ]); + if (localVarHttpHeaderAcceptSelected !== undefined) { + localVarHeaders = localVarHeaders.set('Accept', localVarHttpHeaderAcceptSelected); + } + + const localVarHttpContext: HttpContext = options?.context ?? new HttpContext(); + + const localVarTransferCache: boolean = options?.transferCache ?? true; + + + let responseType_: 'text' | 'json' | 'blob' = 'json'; + if (localVarHttpHeaderAcceptSelected) { + if (localVarHttpHeaderAcceptSelected.startsWith('text')) { + responseType_ = 'text'; + } else if (this.configuration.isJsonMime(localVarHttpHeaderAcceptSelected)) { + responseType_ = 'json'; + } else { + responseType_ = 'blob'; + } + } + + let localVarPath = `/api/dashboard/statistics/projects/eu`; + const { basePath, withCredentials } = this.configuration; + return this.httpClient.request('get', `${basePath}${localVarPath}`, + { + context: localVarHttpContext, + responseType: responseType_, + ...(withCredentials ? { withCredentials } : {}), + headers: localVarHeaders, + observe: observe, + ...(localVarTransferCache !== undefined ? { transferCache: localVarTransferCache } : {}), + reportProgress: reportProgress + } + ); } - let localVarPath = `/api/dashboard/statistics/projects/dfg`; - const { basePath, withCredentials } = this.configuration; - return this.httpClient.request( - 'get', - `${basePath}${localVarPath}`, - { - context: localVarHttpContext, - responseType: responseType_, - ...(withCredentials ? { withCredentials } : {}), - headers: localVarHeaders, - observe: observe, - ...(localVarTransferCache !== undefined - ? { transferCache: localVarTransferCache } - : {}), - reportProgress: reportProgress, - }, - ); - } + /** + * Dashboard Persons + * @endpoint get /api/dashboard/statistics/persons + * @param secureFgpAcc + * @param observe set whether or not to return the data Observable as the body, response or events. defaults to returning the body. + * @param reportProgress flag to report request and response progress. + */ + public getDashboardPersons(secureFgpAcc?: string, observe?: 'body', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable; + public getDashboardPersons(secureFgpAcc?: string, observe?: 'response', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable>; + public getDashboardPersons(secureFgpAcc?: string, observe?: 'events', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable>; + public getDashboardPersons(secureFgpAcc?: string, observe: any = 'body', reportProgress: boolean = false, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable { - /** - * Dashboard Eu Projects - * @endpoint get /api/dashboard/statistics/projects/eu - * @param secureFgpAcc - * @param observe set whether or not to return the data Observable as the body, response or events. defaults to returning the body. - * @param reportProgress flag to report request and response progress. - */ - public getDashboardEuProjects( - secureFgpAcc?: string, - observe?: 'body', - reportProgress?: boolean, - options?: { - httpHeaderAccept?: 'application/json'; - context?: HttpContext; - transferCache?: boolean; - }, - ): Observable; - public getDashboardEuProjects( - secureFgpAcc?: string, - observe?: 'response', - reportProgress?: boolean, - options?: { - httpHeaderAccept?: 'application/json'; - context?: HttpContext; - transferCache?: boolean; - }, - ): Observable>; - public getDashboardEuProjects( - secureFgpAcc?: string, - observe?: 'events', - reportProgress?: boolean, - options?: { - httpHeaderAccept?: 'application/json'; - context?: HttpContext; - transferCache?: boolean; - }, - ): Observable>; - public getDashboardEuProjects( - secureFgpAcc?: string, - observe: any = 'body', - reportProgress: boolean = false, - options?: { - httpHeaderAccept?: 'application/json'; - context?: HttpContext; - transferCache?: boolean; - }, - ): Observable { - let localVarHeaders = this.defaultHeaders; + let localVarHeaders = this.defaultHeaders; - // authentication (HTTPBearer) required - localVarHeaders = this.configuration.addCredentialToHeaders( - 'HTTPBearer', - 'Authorization', - localVarHeaders, - 'Bearer ', - ); + // authentication (HTTPBearer) required + localVarHeaders = this.configuration.addCredentialToHeaders('HTTPBearer', 'Authorization', localVarHeaders, 'Bearer '); - const localVarHttpHeaderAcceptSelected: string | undefined = - options?.httpHeaderAccept ?? - this.configuration.selectHeaderAccept(['application/json']); - if (localVarHttpHeaderAcceptSelected !== undefined) { - localVarHeaders = localVarHeaders.set( - 'Accept', - localVarHttpHeaderAcceptSelected, - ); + const localVarHttpHeaderAcceptSelected: string | undefined = options?.httpHeaderAccept ?? this.configuration.selectHeaderAccept([ + 'application/json' + ]); + if (localVarHttpHeaderAcceptSelected !== undefined) { + localVarHeaders = localVarHeaders.set('Accept', localVarHttpHeaderAcceptSelected); + } + + const localVarHttpContext: HttpContext = options?.context ?? new HttpContext(); + + const localVarTransferCache: boolean = options?.transferCache ?? true; + + + let responseType_: 'text' | 'json' | 'blob' = 'json'; + if (localVarHttpHeaderAcceptSelected) { + if (localVarHttpHeaderAcceptSelected.startsWith('text')) { + responseType_ = 'text'; + } else if (this.configuration.isJsonMime(localVarHttpHeaderAcceptSelected)) { + responseType_ = 'json'; + } else { + responseType_ = 'blob'; + } + } + + let localVarPath = `/api/dashboard/statistics/persons`; + const { basePath, withCredentials } = this.configuration; + return this.httpClient.request('get', `${basePath}${localVarPath}`, + { + context: localVarHttpContext, + responseType: responseType_, + ...(withCredentials ? { withCredentials } : {}), + headers: localVarHeaders, + observe: observe, + ...(localVarTransferCache !== undefined ? { transferCache: localVarTransferCache } : {}), + reportProgress: reportProgress + } + ); } - const localVarHttpContext: HttpContext = - options?.context ?? new HttpContext(); + /** + * Dashboard Publications + * @endpoint get /api/dashboard/statistics/publications + * @param secureFgpAcc + * @param observe set whether or not to return the data Observable as the body, response or events. defaults to returning the body. + * @param reportProgress flag to report request and response progress. + */ + public getDashboardPublications(secureFgpAcc?: string, observe?: 'body', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable; + public getDashboardPublications(secureFgpAcc?: string, observe?: 'response', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable>; + public getDashboardPublications(secureFgpAcc?: string, observe?: 'events', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable>; + public getDashboardPublications(secureFgpAcc?: string, observe: any = 'body', reportProgress: boolean = false, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable { - const localVarTransferCache: boolean = options?.transferCache ?? true; + let localVarHeaders = this.defaultHeaders; - let responseType_: 'text' | 'json' | 'blob' = 'json'; - if (localVarHttpHeaderAcceptSelected) { - if (localVarHttpHeaderAcceptSelected.startsWith('text')) { - responseType_ = 'text'; - } else if ( - this.configuration.isJsonMime(localVarHttpHeaderAcceptSelected) - ) { - responseType_ = 'json'; - } else { - responseType_ = 'blob'; - } + // authentication (HTTPBearer) required + localVarHeaders = this.configuration.addCredentialToHeaders('HTTPBearer', 'Authorization', localVarHeaders, 'Bearer '); + + const localVarHttpHeaderAcceptSelected: string | undefined = options?.httpHeaderAccept ?? this.configuration.selectHeaderAccept([ + 'application/json' + ]); + if (localVarHttpHeaderAcceptSelected !== undefined) { + localVarHeaders = localVarHeaders.set('Accept', localVarHttpHeaderAcceptSelected); + } + + const localVarHttpContext: HttpContext = options?.context ?? new HttpContext(); + + const localVarTransferCache: boolean = options?.transferCache ?? true; + + + let responseType_: 'text' | 'json' | 'blob' = 'json'; + if (localVarHttpHeaderAcceptSelected) { + if (localVarHttpHeaderAcceptSelected.startsWith('text')) { + responseType_ = 'text'; + } else if (this.configuration.isJsonMime(localVarHttpHeaderAcceptSelected)) { + responseType_ = 'json'; + } else { + responseType_ = 'blob'; + } + } + + let localVarPath = `/api/dashboard/statistics/publications`; + const { basePath, withCredentials } = this.configuration; + return this.httpClient.request('get', `${basePath}${localVarPath}`, + { + context: localVarHttpContext, + responseType: responseType_, + ...(withCredentials ? { withCredentials } : {}), + headers: localVarHeaders, + observe: observe, + ...(localVarTransferCache !== undefined ? { transferCache: localVarTransferCache } : {}), + reportProgress: reportProgress + } + ); } - let localVarPath = `/api/dashboard/statistics/projects/eu`; - const { basePath, withCredentials } = this.configuration; - return this.httpClient.request( - 'get', - `${basePath}${localVarPath}`, - { - context: localVarHttpContext, - responseType: responseType_, - ...(withCredentials ? { withCredentials } : {}), - headers: localVarHeaders, - observe: observe, - ...(localVarTransferCache !== undefined - ? { transferCache: localVarTransferCache } - : {}), - reportProgress: reportProgress, - }, - ); - } + /** + * Dashboard Statistics + * @endpoint get /api/dashboard/statistics + * @param secureFgpAcc + * @param observe set whether or not to return the data Observable as the body, response or events. defaults to returning the body. + * @param reportProgress flag to report request and response progress. + */ + public getDashboardStatistics(secureFgpAcc?: string, observe?: 'body', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable; + public getDashboardStatistics(secureFgpAcc?: string, observe?: 'response', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable>; + public getDashboardStatistics(secureFgpAcc?: string, observe?: 'events', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable>; + public getDashboardStatistics(secureFgpAcc?: string, observe: any = 'body', reportProgress: boolean = false, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable { - /** - * Dashboard Persons - * @endpoint get /api/dashboard/statistics/persons - * @param secureFgpAcc - * @param observe set whether or not to return the data Observable as the body, response or events. defaults to returning the body. - * @param reportProgress flag to report request and response progress. - */ - public getDashboardPersons( - secureFgpAcc?: string, - observe?: 'body', - reportProgress?: boolean, - options?: { - httpHeaderAccept?: 'application/json'; - context?: HttpContext; - transferCache?: boolean; - }, - ): Observable; - public getDashboardPersons( - secureFgpAcc?: string, - observe?: 'response', - reportProgress?: boolean, - options?: { - httpHeaderAccept?: 'application/json'; - context?: HttpContext; - transferCache?: boolean; - }, - ): Observable>; - public getDashboardPersons( - secureFgpAcc?: string, - observe?: 'events', - reportProgress?: boolean, - options?: { - httpHeaderAccept?: 'application/json'; - context?: HttpContext; - transferCache?: boolean; - }, - ): Observable>; - public getDashboardPersons( - secureFgpAcc?: string, - observe: any = 'body', - reportProgress: boolean = false, - options?: { - httpHeaderAccept?: 'application/json'; - context?: HttpContext; - transferCache?: boolean; - }, - ): Observable { - let localVarHeaders = this.defaultHeaders; + let localVarHeaders = this.defaultHeaders; - // authentication (HTTPBearer) required - localVarHeaders = this.configuration.addCredentialToHeaders( - 'HTTPBearer', - 'Authorization', - localVarHeaders, - 'Bearer ', - ); + // authentication (HTTPBearer) required + localVarHeaders = this.configuration.addCredentialToHeaders('HTTPBearer', 'Authorization', localVarHeaders, 'Bearer '); - const localVarHttpHeaderAcceptSelected: string | undefined = - options?.httpHeaderAccept ?? - this.configuration.selectHeaderAccept(['application/json']); - if (localVarHttpHeaderAcceptSelected !== undefined) { - localVarHeaders = localVarHeaders.set( - 'Accept', - localVarHttpHeaderAcceptSelected, - ); + const localVarHttpHeaderAcceptSelected: string | undefined = options?.httpHeaderAccept ?? this.configuration.selectHeaderAccept([ + 'application/json' + ]); + if (localVarHttpHeaderAcceptSelected !== undefined) { + localVarHeaders = localVarHeaders.set('Accept', localVarHttpHeaderAcceptSelected); + } + + const localVarHttpContext: HttpContext = options?.context ?? new HttpContext(); + + const localVarTransferCache: boolean = options?.transferCache ?? true; + + + let responseType_: 'text' | 'json' | 'blob' = 'json'; + if (localVarHttpHeaderAcceptSelected) { + if (localVarHttpHeaderAcceptSelected.startsWith('text')) { + responseType_ = 'text'; + } else if (this.configuration.isJsonMime(localVarHttpHeaderAcceptSelected)) { + responseType_ = 'json'; + } else { + responseType_ = 'blob'; + } + } + + let localVarPath = `/api/dashboard/statistics`; + const { basePath, withCredentials } = this.configuration; + return this.httpClient.request('get', `${basePath}${localVarPath}`, + { + context: localVarHttpContext, + responseType: responseType_, + ...(withCredentials ? { withCredentials } : {}), + headers: localVarHeaders, + observe: observe, + ...(localVarTransferCache !== undefined ? { transferCache: localVarTransferCache } : {}), + reportProgress: reportProgress + } + ); } - const localVarHttpContext: HttpContext = - options?.context ?? new HttpContext(); + /** + * Dashboard Top Authors + * @endpoint get /api/dashboard/top-authors + * @param worksPeriod + * @param secureFgpAcc + * @param observe set whether or not to return the data Observable as the body, response or events. defaults to returning the body. + * @param reportProgress flag to report request and response progress. + */ + public getDashboardTopAuthors(worksPeriod?: 'all_time' | 'last_5_years', secureFgpAcc?: string, observe?: 'body', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable; + public getDashboardTopAuthors(worksPeriod?: 'all_time' | 'last_5_years', secureFgpAcc?: string, observe?: 'response', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable>; + public getDashboardTopAuthors(worksPeriod?: 'all_time' | 'last_5_years', secureFgpAcc?: string, observe?: 'events', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable>; + public getDashboardTopAuthors(worksPeriod?: 'all_time' | 'last_5_years', secureFgpAcc?: string, observe: any = 'body', reportProgress: boolean = false, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable { - const localVarTransferCache: boolean = options?.transferCache ?? true; + let localVarQueryParameters = new HttpParams({encoder: this.encoder}); + localVarQueryParameters = this.addToHttpParams(localVarQueryParameters, + worksPeriod, 'works_period'); - let responseType_: 'text' | 'json' | 'blob' = 'json'; - if (localVarHttpHeaderAcceptSelected) { - if (localVarHttpHeaderAcceptSelected.startsWith('text')) { - responseType_ = 'text'; - } else if ( - this.configuration.isJsonMime(localVarHttpHeaderAcceptSelected) - ) { - responseType_ = 'json'; - } else { - responseType_ = 'blob'; - } + let localVarHeaders = this.defaultHeaders; + + // authentication (HTTPBearer) required + localVarHeaders = this.configuration.addCredentialToHeaders('HTTPBearer', 'Authorization', localVarHeaders, 'Bearer '); + + const localVarHttpHeaderAcceptSelected: string | undefined = options?.httpHeaderAccept ?? this.configuration.selectHeaderAccept([ + 'application/json' + ]); + if (localVarHttpHeaderAcceptSelected !== undefined) { + localVarHeaders = localVarHeaders.set('Accept', localVarHttpHeaderAcceptSelected); + } + + const localVarHttpContext: HttpContext = options?.context ?? new HttpContext(); + + const localVarTransferCache: boolean = options?.transferCache ?? true; + + + let responseType_: 'text' | 'json' | 'blob' = 'json'; + if (localVarHttpHeaderAcceptSelected) { + if (localVarHttpHeaderAcceptSelected.startsWith('text')) { + responseType_ = 'text'; + } else if (this.configuration.isJsonMime(localVarHttpHeaderAcceptSelected)) { + responseType_ = 'json'; + } else { + responseType_ = 'blob'; + } + } + + let localVarPath = `/api/dashboard/top-authors`; + const { basePath, withCredentials } = this.configuration; + return this.httpClient.request('get', `${basePath}${localVarPath}`, + { + context: localVarHttpContext, + params: localVarQueryParameters, + responseType: responseType_, + ...(withCredentials ? { withCredentials } : {}), + headers: localVarHeaders, + observe: observe, + ...(localVarTransferCache !== undefined ? { transferCache: localVarTransferCache } : {}), + reportProgress: reportProgress + } + ); } - let localVarPath = `/api/dashboard/statistics/persons`; - const { basePath, withCredentials } = this.configuration; - return this.httpClient.request( - 'get', - `${basePath}${localVarPath}`, - { - context: localVarHttpContext, - responseType: responseType_, - ...(withCredentials ? { withCredentials } : {}), - headers: localVarHeaders, - observe: observe, - ...(localVarTransferCache !== undefined - ? { transferCache: localVarTransferCache } - : {}), - reportProgress: reportProgress, - }, - ); - } + /** + * Dashboard Topic Heatmap + * @endpoint get /api/dashboard/topic-heatmap + * @param fromYear + * @param toYear + * @param limit + * @param secureFgpAcc + * @param observe set whether or not to return the data Observable as the body, response or events. defaults to returning the body. + * @param reportProgress flag to report request and response progress. + */ + public getDashboardTopicHeatmap(fromYear?: number, toYear?: number, limit?: number, secureFgpAcc?: string, observe?: 'body', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable; + public getDashboardTopicHeatmap(fromYear?: number, toYear?: number, limit?: number, secureFgpAcc?: string, observe?: 'response', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable>; + public getDashboardTopicHeatmap(fromYear?: number, toYear?: number, limit?: number, secureFgpAcc?: string, observe?: 'events', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable>; + public getDashboardTopicHeatmap(fromYear?: number, toYear?: number, limit?: number, secureFgpAcc?: string, observe: any = 'body', reportProgress: boolean = false, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable { - /** - * Dashboard Publications - * @endpoint get /api/dashboard/statistics/publications - * @param secureFgpAcc - * @param observe set whether or not to return the data Observable as the body, response or events. defaults to returning the body. - * @param reportProgress flag to report request and response progress. - */ - public getDashboardPublications( - secureFgpAcc?: string, - observe?: 'body', - reportProgress?: boolean, - options?: { - httpHeaderAccept?: 'application/json'; - context?: HttpContext; - transferCache?: boolean; - }, - ): Observable; - public getDashboardPublications( - secureFgpAcc?: string, - observe?: 'response', - reportProgress?: boolean, - options?: { - httpHeaderAccept?: 'application/json'; - context?: HttpContext; - transferCache?: boolean; - }, - ): Observable>; - public getDashboardPublications( - secureFgpAcc?: string, - observe?: 'events', - reportProgress?: boolean, - options?: { - httpHeaderAccept?: 'application/json'; - context?: HttpContext; - transferCache?: boolean; - }, - ): Observable>; - public getDashboardPublications( - secureFgpAcc?: string, - observe: any = 'body', - reportProgress: boolean = false, - options?: { - httpHeaderAccept?: 'application/json'; - context?: HttpContext; - transferCache?: boolean; - }, - ): Observable { - let localVarHeaders = this.defaultHeaders; + let localVarQueryParameters = new HttpParams({encoder: this.encoder}); + localVarQueryParameters = this.addToHttpParams(localVarQueryParameters, + fromYear, 'from_year'); + localVarQueryParameters = this.addToHttpParams(localVarQueryParameters, + toYear, 'to_year'); + localVarQueryParameters = this.addToHttpParams(localVarQueryParameters, + limit, 'limit'); - // authentication (HTTPBearer) required - localVarHeaders = this.configuration.addCredentialToHeaders( - 'HTTPBearer', - 'Authorization', - localVarHeaders, - 'Bearer ', - ); + let localVarHeaders = this.defaultHeaders; - const localVarHttpHeaderAcceptSelected: string | undefined = - options?.httpHeaderAccept ?? - this.configuration.selectHeaderAccept(['application/json']); - if (localVarHttpHeaderAcceptSelected !== undefined) { - localVarHeaders = localVarHeaders.set( - 'Accept', - localVarHttpHeaderAcceptSelected, - ); + // authentication (HTTPBearer) required + localVarHeaders = this.configuration.addCredentialToHeaders('HTTPBearer', 'Authorization', localVarHeaders, 'Bearer '); + + const localVarHttpHeaderAcceptSelected: string | undefined = options?.httpHeaderAccept ?? this.configuration.selectHeaderAccept([ + 'application/json' + ]); + if (localVarHttpHeaderAcceptSelected !== undefined) { + localVarHeaders = localVarHeaders.set('Accept', localVarHttpHeaderAcceptSelected); + } + + const localVarHttpContext: HttpContext = options?.context ?? new HttpContext(); + + const localVarTransferCache: boolean = options?.transferCache ?? true; + + + let responseType_: 'text' | 'json' | 'blob' = 'json'; + if (localVarHttpHeaderAcceptSelected) { + if (localVarHttpHeaderAcceptSelected.startsWith('text')) { + responseType_ = 'text'; + } else if (this.configuration.isJsonMime(localVarHttpHeaderAcceptSelected)) { + responseType_ = 'json'; + } else { + responseType_ = 'blob'; + } + } + + let localVarPath = `/api/dashboard/topic-heatmap`; + const { basePath, withCredentials } = this.configuration; + return this.httpClient.request('get', `${basePath}${localVarPath}`, + { + context: localVarHttpContext, + params: localVarQueryParameters, + responseType: responseType_, + ...(withCredentials ? { withCredentials } : {}), + headers: localVarHeaders, + observe: observe, + ...(localVarTransferCache !== undefined ? { transferCache: localVarTransferCache } : {}), + reportProgress: reportProgress + } + ); } - const localVarHttpContext: HttpContext = - options?.context ?? new HttpContext(); - - const localVarTransferCache: boolean = options?.transferCache ?? true; - - let responseType_: 'text' | 'json' | 'blob' = 'json'; - if (localVarHttpHeaderAcceptSelected) { - if (localVarHttpHeaderAcceptSelected.startsWith('text')) { - responseType_ = 'text'; - } else if ( - this.configuration.isJsonMime(localVarHttpHeaderAcceptSelected) - ) { - responseType_ = 'json'; - } else { - responseType_ = 'blob'; - } - } - - let localVarPath = `/api/dashboard/statistics/publications`; - const { basePath, withCredentials } = this.configuration; - return this.httpClient.request( - 'get', - `${basePath}${localVarPath}`, - { - context: localVarHttpContext, - responseType: responseType_, - ...(withCredentials ? { withCredentials } : {}), - headers: localVarHeaders, - observe: observe, - ...(localVarTransferCache !== undefined - ? { transferCache: localVarTransferCache } - : {}), - reportProgress: reportProgress, - }, - ); - } - - /** - * Dashboard Statistics - * @endpoint get /api/dashboard/statistics - * @param secureFgpAcc - * @param observe set whether or not to return the data Observable as the body, response or events. defaults to returning the body. - * @param reportProgress flag to report request and response progress. - */ - public getDashboardStatistics( - secureFgpAcc?: string, - observe?: 'body', - reportProgress?: boolean, - options?: { - httpHeaderAccept?: 'application/json'; - context?: HttpContext; - transferCache?: boolean; - }, - ): Observable; - public getDashboardStatistics( - secureFgpAcc?: string, - observe?: 'response', - reportProgress?: boolean, - options?: { - httpHeaderAccept?: 'application/json'; - context?: HttpContext; - transferCache?: boolean; - }, - ): Observable>; - public getDashboardStatistics( - secureFgpAcc?: string, - observe?: 'events', - reportProgress?: boolean, - options?: { - httpHeaderAccept?: 'application/json'; - context?: HttpContext; - transferCache?: boolean; - }, - ): Observable>; - public getDashboardStatistics( - secureFgpAcc?: string, - observe: any = 'body', - reportProgress: boolean = false, - options?: { - httpHeaderAccept?: 'application/json'; - context?: HttpContext; - transferCache?: boolean; - }, - ): Observable { - let localVarHeaders = this.defaultHeaders; - - // authentication (HTTPBearer) required - localVarHeaders = this.configuration.addCredentialToHeaders( - 'HTTPBearer', - 'Authorization', - localVarHeaders, - 'Bearer ', - ); - - const localVarHttpHeaderAcceptSelected: string | undefined = - options?.httpHeaderAccept ?? - this.configuration.selectHeaderAccept(['application/json']); - if (localVarHttpHeaderAcceptSelected !== undefined) { - localVarHeaders = localVarHeaders.set( - 'Accept', - localVarHttpHeaderAcceptSelected, - ); - } - - const localVarHttpContext: HttpContext = - options?.context ?? new HttpContext(); - - const localVarTransferCache: boolean = options?.transferCache ?? true; - - let responseType_: 'text' | 'json' | 'blob' = 'json'; - if (localVarHttpHeaderAcceptSelected) { - if (localVarHttpHeaderAcceptSelected.startsWith('text')) { - responseType_ = 'text'; - } else if ( - this.configuration.isJsonMime(localVarHttpHeaderAcceptSelected) - ) { - responseType_ = 'json'; - } else { - responseType_ = 'blob'; - } - } - - let localVarPath = `/api/dashboard/statistics`; - const { basePath, withCredentials } = this.configuration; - return this.httpClient.request( - 'get', - `${basePath}${localVarPath}`, - { - context: localVarHttpContext, - responseType: responseType_, - ...(withCredentials ? { withCredentials } : {}), - headers: localVarHeaders, - observe: observe, - ...(localVarTransferCache !== undefined - ? { transferCache: localVarTransferCache } - : {}), - reportProgress: reportProgress, - }, - ); - } - - /** - * Dashboard Top Authors - * @endpoint get /api/dashboard/top-authors - * @param worksPeriod - * @param secureFgpAcc - * @param observe set whether or not to return the data Observable as the body, response or events. defaults to returning the body. - * @param reportProgress flag to report request and response progress. - */ - public getDashboardTopAuthors( - worksPeriod?: 'all_time' | 'last_5_years', - secureFgpAcc?: string, - observe?: 'body', - reportProgress?: boolean, - options?: { - httpHeaderAccept?: 'application/json'; - context?: HttpContext; - transferCache?: boolean; - }, - ): Observable; - public getDashboardTopAuthors( - worksPeriod?: 'all_time' | 'last_5_years', - secureFgpAcc?: string, - observe?: 'response', - reportProgress?: boolean, - options?: { - httpHeaderAccept?: 'application/json'; - context?: HttpContext; - transferCache?: boolean; - }, - ): Observable>; - public getDashboardTopAuthors( - worksPeriod?: 'all_time' | 'last_5_years', - secureFgpAcc?: string, - observe?: 'events', - reportProgress?: boolean, - options?: { - httpHeaderAccept?: 'application/json'; - context?: HttpContext; - transferCache?: boolean; - }, - ): Observable>; - public getDashboardTopAuthors( - worksPeriod?: 'all_time' | 'last_5_years', - secureFgpAcc?: string, - observe: any = 'body', - reportProgress: boolean = false, - options?: { - httpHeaderAccept?: 'application/json'; - context?: HttpContext; - transferCache?: boolean; - }, - ): Observable { - let localVarQueryParameters = new HttpParams({ encoder: this.encoder }); - localVarQueryParameters = this.addToHttpParams( - localVarQueryParameters, - worksPeriod, - 'works_period', - ); - - let localVarHeaders = this.defaultHeaders; - - // authentication (HTTPBearer) required - localVarHeaders = this.configuration.addCredentialToHeaders( - 'HTTPBearer', - 'Authorization', - localVarHeaders, - 'Bearer ', - ); - - const localVarHttpHeaderAcceptSelected: string | undefined = - options?.httpHeaderAccept ?? - this.configuration.selectHeaderAccept(['application/json']); - if (localVarHttpHeaderAcceptSelected !== undefined) { - localVarHeaders = localVarHeaders.set( - 'Accept', - localVarHttpHeaderAcceptSelected, - ); - } - - const localVarHttpContext: HttpContext = - options?.context ?? new HttpContext(); - - const localVarTransferCache: boolean = options?.transferCache ?? true; - - let responseType_: 'text' | 'json' | 'blob' = 'json'; - if (localVarHttpHeaderAcceptSelected) { - if (localVarHttpHeaderAcceptSelected.startsWith('text')) { - responseType_ = 'text'; - } else if ( - this.configuration.isJsonMime(localVarHttpHeaderAcceptSelected) - ) { - responseType_ = 'json'; - } else { - responseType_ = 'blob'; - } - } - - let localVarPath = `/api/dashboard/top-authors`; - const { basePath, withCredentials } = this.configuration; - return this.httpClient.request( - 'get', - `${basePath}${localVarPath}`, - { - context: localVarHttpContext, - params: localVarQueryParameters, - responseType: responseType_, - ...(withCredentials ? { withCredentials } : {}), - headers: localVarHeaders, - observe: observe, - ...(localVarTransferCache !== undefined - ? { transferCache: localVarTransferCache } - : {}), - reportProgress: reportProgress, - }, - ); - } - - /** - * Dashboard Topic Heatmap - * @endpoint get /api/dashboard/topic-heatmap - * @param fromYear - * @param toYear - * @param limit - * @param secureFgpAcc - * @param observe set whether or not to return the data Observable as the body, response or events. defaults to returning the body. - * @param reportProgress flag to report request and response progress. - */ - public getDashboardTopicHeatmap( - fromYear?: number, - toYear?: number, - limit?: number, - secureFgpAcc?: string, - observe?: 'body', - reportProgress?: boolean, - options?: { - httpHeaderAccept?: 'application/json'; - context?: HttpContext; - transferCache?: boolean; - }, - ): Observable; - public getDashboardTopicHeatmap( - fromYear?: number, - toYear?: number, - limit?: number, - secureFgpAcc?: string, - observe?: 'response', - reportProgress?: boolean, - options?: { - httpHeaderAccept?: 'application/json'; - context?: HttpContext; - transferCache?: boolean; - }, - ): Observable>; - public getDashboardTopicHeatmap( - fromYear?: number, - toYear?: number, - limit?: number, - secureFgpAcc?: string, - observe?: 'events', - reportProgress?: boolean, - options?: { - httpHeaderAccept?: 'application/json'; - context?: HttpContext; - transferCache?: boolean; - }, - ): Observable>; - public getDashboardTopicHeatmap( - fromYear?: number, - toYear?: number, - limit?: number, - secureFgpAcc?: string, - observe: any = 'body', - reportProgress: boolean = false, - options?: { - httpHeaderAccept?: 'application/json'; - context?: HttpContext; - transferCache?: boolean; - }, - ): Observable { - let localVarQueryParameters = new HttpParams({ encoder: this.encoder }); - localVarQueryParameters = this.addToHttpParams( - localVarQueryParameters, - fromYear, - 'from_year', - ); - localVarQueryParameters = this.addToHttpParams( - localVarQueryParameters, - toYear, - 'to_year', - ); - localVarQueryParameters = this.addToHttpParams( - localVarQueryParameters, - limit, - 'limit', - ); - - let localVarHeaders = this.defaultHeaders; - - // authentication (HTTPBearer) required - localVarHeaders = this.configuration.addCredentialToHeaders( - 'HTTPBearer', - 'Authorization', - localVarHeaders, - 'Bearer ', - ); - - const localVarHttpHeaderAcceptSelected: string | undefined = - options?.httpHeaderAccept ?? - this.configuration.selectHeaderAccept(['application/json']); - if (localVarHttpHeaderAcceptSelected !== undefined) { - localVarHeaders = localVarHeaders.set( - 'Accept', - localVarHttpHeaderAcceptSelected, - ); - } - - const localVarHttpContext: HttpContext = - options?.context ?? new HttpContext(); - - const localVarTransferCache: boolean = options?.transferCache ?? true; - - let responseType_: 'text' | 'json' | 'blob' = 'json'; - if (localVarHttpHeaderAcceptSelected) { - if (localVarHttpHeaderAcceptSelected.startsWith('text')) { - responseType_ = 'text'; - } else if ( - this.configuration.isJsonMime(localVarHttpHeaderAcceptSelected) - ) { - responseType_ = 'json'; - } else { - responseType_ = 'blob'; - } - } - - let localVarPath = `/api/dashboard/topic-heatmap`; - const { basePath, withCredentials } = this.configuration; - return this.httpClient.request( - 'get', - `${basePath}${localVarPath}`, - { - context: localVarHttpContext, - params: localVarQueryParameters, - responseType: responseType_, - ...(withCredentials ? { withCredentials } : {}), - headers: localVarHeaders, - observe: observe, - ...(localVarTransferCache !== undefined - ? { transferCache: localVarTransferCache } - : {}), - reportProgress: reportProgress, - }, - ); - } } diff --git a/webapp/src/app/api/api/funding.service.ts b/webapp/src/app/api/api/funding.service.ts index f1f0a1a7..46772768 100644 --- a/webapp/src/app/api/api/funding.service.ts +++ b/webapp/src/app/api/api/funding.service.ts @@ -1,7 +1,7 @@ /** * Innovation Search Engine API * - * + * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech @@ -9,18 +9,12 @@ */ /* tslint:disable:no-unused-variable member-ordering */ -import { Inject, Injectable, Optional } from '@angular/core'; -import { - HttpClient, - HttpHeaders, - HttpParams, - HttpResponse, - HttpEvent, - HttpParameterCodec, - HttpContext, -} from '@angular/common/http'; -import { CustomHttpParameterCodec } from '../encoder'; -import { Observable } from 'rxjs'; +import { Inject, Injectable, Optional } from '@angular/core'; +import { HttpClient, HttpHeaders, HttpParams, + HttpResponse, HttpEvent, HttpParameterCodec, HttpContext + } from '@angular/common/http'; +import { CustomHttpParameterCodec } from '../encoder'; +import { Observable } from 'rxjs'; // @ts-ignore import { FundersByAuthorResponse } from '../model/fundersByAuthorResponse'; @@ -30,246 +24,138 @@ import { HTTPValidationError } from '../model/hTTPValidationError'; import { PublicationsByAuthorResponse } from '../model/publicationsByAuthorResponse'; // @ts-ignore -import { BASE_PATH, COLLECTION_FORMATS } from '../variables'; -import { Configuration } from '../configuration'; +import { BASE_PATH, COLLECTION_FORMATS } from '../variables'; +import { Configuration } from '../configuration'; import { BaseService } from '../api.base.service'; + + @Injectable({ - providedIn: 'root', + providedIn: 'root' }) export class FundingService extends BaseService { - constructor( - protected httpClient: HttpClient, - @Optional() @Inject(BASE_PATH) basePath: string | string[], - @Optional() configuration?: Configuration, - ) { - super(basePath, configuration); - } - /** - * Get funding organizations by author. - * @endpoint get /api/inse-service/authors/{author_id}/funders - * @param authorId - * @param observe set whether or not to return the data Observable as the body, response or events. defaults to returning the body. - * @param reportProgress flag to report request and response progress. - */ - public getFundersByAuthor( - authorId: string, - observe?: 'body', - reportProgress?: boolean, - options?: { - httpHeaderAccept?: 'application/json'; - context?: HttpContext; - transferCache?: boolean; - }, - ): Observable; - public getFundersByAuthor( - authorId: string, - observe?: 'response', - reportProgress?: boolean, - options?: { - httpHeaderAccept?: 'application/json'; - context?: HttpContext; - transferCache?: boolean; - }, - ): Observable>; - public getFundersByAuthor( - authorId: string, - observe?: 'events', - reportProgress?: boolean, - options?: { - httpHeaderAccept?: 'application/json'; - context?: HttpContext; - transferCache?: boolean; - }, - ): Observable>; - public getFundersByAuthor( - authorId: string, - observe: any = 'body', - reportProgress: boolean = false, - options?: { - httpHeaderAccept?: 'application/json'; - context?: HttpContext; - transferCache?: boolean; - }, - ): Observable { - if (authorId === null || authorId === undefined) { - throw new Error( - 'Required parameter authorId was null or undefined when calling getFundersByAuthor.', - ); + constructor(protected httpClient: HttpClient, @Optional() @Inject(BASE_PATH) basePath: string|string[], @Optional() configuration?: Configuration) { + super(basePath, configuration); } - let localVarHeaders = this.defaultHeaders; + /** + * Get funding organizations by author. + * @endpoint get /api/inse-service/authors/{author_id}/funders + * @param authorId + * @param observe set whether or not to return the data Observable as the body, response or events. defaults to returning the body. + * @param reportProgress flag to report request and response progress. + */ + public getFundersByAuthor(authorId: string, observe?: 'body', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable; + public getFundersByAuthor(authorId: string, observe?: 'response', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable>; + public getFundersByAuthor(authorId: string, observe?: 'events', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable>; + public getFundersByAuthor(authorId: string, observe: any = 'body', reportProgress: boolean = false, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable { + if (authorId === null || authorId === undefined) { + throw new Error('Required parameter authorId was null or undefined when calling getFundersByAuthor.'); + } - const localVarHttpHeaderAcceptSelected: string | undefined = - options?.httpHeaderAccept ?? - this.configuration.selectHeaderAccept(['application/json']); - if (localVarHttpHeaderAcceptSelected !== undefined) { - localVarHeaders = localVarHeaders.set( - 'Accept', - localVarHttpHeaderAcceptSelected, - ); + let localVarHeaders = this.defaultHeaders; + + const localVarHttpHeaderAcceptSelected: string | undefined = options?.httpHeaderAccept ?? this.configuration.selectHeaderAccept([ + 'application/json' + ]); + if (localVarHttpHeaderAcceptSelected !== undefined) { + localVarHeaders = localVarHeaders.set('Accept', localVarHttpHeaderAcceptSelected); + } + + const localVarHttpContext: HttpContext = options?.context ?? new HttpContext(); + + const localVarTransferCache: boolean = options?.transferCache ?? true; + + + let responseType_: 'text' | 'json' | 'blob' = 'json'; + if (localVarHttpHeaderAcceptSelected) { + if (localVarHttpHeaderAcceptSelected.startsWith('text')) { + responseType_ = 'text'; + } else if (this.configuration.isJsonMime(localVarHttpHeaderAcceptSelected)) { + responseType_ = 'json'; + } else { + responseType_ = 'blob'; + } + } + + let localVarPath = `/api/inse-service/authors/${this.configuration.encodeParam({name: "authorId", value: authorId, in: "path", style: "simple", explode: false, dataType: "string", dataFormat: undefined})}/funders`; + const { basePath, withCredentials } = this.configuration; + return this.httpClient.request('get', `${basePath}${localVarPath}`, + { + context: localVarHttpContext, + responseType: responseType_, + ...(withCredentials ? { withCredentials } : {}), + headers: localVarHeaders, + observe: observe, + ...(localVarTransferCache !== undefined ? { transferCache: localVarTransferCache } : {}), + reportProgress: reportProgress + } + ); } - const localVarHttpContext: HttpContext = - options?.context ?? new HttpContext(); + /** + * Get funded publications by author. + * @endpoint get /api/inse-service/authors/{author_id}/publications + * @param authorId + * @param page + * @param pageSize + * @param observe set whether or not to return the data Observable as the body, response or events. defaults to returning the body. + * @param reportProgress flag to report request and response progress. + */ + public getPublicationsByAuthor(authorId: string, page?: number, pageSize?: number, observe?: 'body', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable; + public getPublicationsByAuthor(authorId: string, page?: number, pageSize?: number, observe?: 'response', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable>; + public getPublicationsByAuthor(authorId: string, page?: number, pageSize?: number, observe?: 'events', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable>; + public getPublicationsByAuthor(authorId: string, page?: number, pageSize?: number, observe: any = 'body', reportProgress: boolean = false, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable { + if (authorId === null || authorId === undefined) { + throw new Error('Required parameter authorId was null or undefined when calling getPublicationsByAuthor.'); + } - const localVarTransferCache: boolean = options?.transferCache ?? true; + let localVarQueryParameters = new HttpParams({encoder: this.encoder}); + localVarQueryParameters = this.addToHttpParams(localVarQueryParameters, + page, 'page'); + localVarQueryParameters = this.addToHttpParams(localVarQueryParameters, + pageSize, 'page_size'); - let responseType_: 'text' | 'json' | 'blob' = 'json'; - if (localVarHttpHeaderAcceptSelected) { - if (localVarHttpHeaderAcceptSelected.startsWith('text')) { - responseType_ = 'text'; - } else if ( - this.configuration.isJsonMime(localVarHttpHeaderAcceptSelected) - ) { - responseType_ = 'json'; - } else { - responseType_ = 'blob'; - } + let localVarHeaders = this.defaultHeaders; + + const localVarHttpHeaderAcceptSelected: string | undefined = options?.httpHeaderAccept ?? this.configuration.selectHeaderAccept([ + 'application/json' + ]); + if (localVarHttpHeaderAcceptSelected !== undefined) { + localVarHeaders = localVarHeaders.set('Accept', localVarHttpHeaderAcceptSelected); + } + + const localVarHttpContext: HttpContext = options?.context ?? new HttpContext(); + + const localVarTransferCache: boolean = options?.transferCache ?? true; + + + let responseType_: 'text' | 'json' | 'blob' = 'json'; + if (localVarHttpHeaderAcceptSelected) { + if (localVarHttpHeaderAcceptSelected.startsWith('text')) { + responseType_ = 'text'; + } else if (this.configuration.isJsonMime(localVarHttpHeaderAcceptSelected)) { + responseType_ = 'json'; + } else { + responseType_ = 'blob'; + } + } + + let localVarPath = `/api/inse-service/authors/${this.configuration.encodeParam({name: "authorId", value: authorId, in: "path", style: "simple", explode: false, dataType: "string", dataFormat: undefined})}/publications`; + const { basePath, withCredentials } = this.configuration; + return this.httpClient.request('get', `${basePath}${localVarPath}`, + { + context: localVarHttpContext, + params: localVarQueryParameters, + responseType: responseType_, + ...(withCredentials ? { withCredentials } : {}), + headers: localVarHeaders, + observe: observe, + ...(localVarTransferCache !== undefined ? { transferCache: localVarTransferCache } : {}), + reportProgress: reportProgress + } + ); } - let localVarPath = `/api/inse-service/authors/${this.configuration.encodeParam({ name: 'authorId', value: authorId, in: 'path', style: 'simple', explode: false, dataType: 'string', dataFormat: undefined })}/funders`; - const { basePath, withCredentials } = this.configuration; - return this.httpClient.request( - 'get', - `${basePath}${localVarPath}`, - { - context: localVarHttpContext, - responseType: responseType_, - ...(withCredentials ? { withCredentials } : {}), - headers: localVarHeaders, - observe: observe, - ...(localVarTransferCache !== undefined - ? { transferCache: localVarTransferCache } - : {}), - reportProgress: reportProgress, - }, - ); - } - - /** - * Get funded publications by author. - * @endpoint get /api/inse-service/authors/{author_id}/publications - * @param authorId - * @param page - * @param pageSize - * @param observe set whether or not to return the data Observable as the body, response or events. defaults to returning the body. - * @param reportProgress flag to report request and response progress. - */ - public getPublicationsByAuthor( - authorId: string, - page?: number, - pageSize?: number, - observe?: 'body', - reportProgress?: boolean, - options?: { - httpHeaderAccept?: 'application/json'; - context?: HttpContext; - transferCache?: boolean; - }, - ): Observable; - public getPublicationsByAuthor( - authorId: string, - page?: number, - pageSize?: number, - observe?: 'response', - reportProgress?: boolean, - options?: { - httpHeaderAccept?: 'application/json'; - context?: HttpContext; - transferCache?: boolean; - }, - ): Observable>; - public getPublicationsByAuthor( - authorId: string, - page?: number, - pageSize?: number, - observe?: 'events', - reportProgress?: boolean, - options?: { - httpHeaderAccept?: 'application/json'; - context?: HttpContext; - transferCache?: boolean; - }, - ): Observable>; - public getPublicationsByAuthor( - authorId: string, - page?: number, - pageSize?: number, - observe: any = 'body', - reportProgress: boolean = false, - options?: { - httpHeaderAccept?: 'application/json'; - context?: HttpContext; - transferCache?: boolean; - }, - ): Observable { - if (authorId === null || authorId === undefined) { - throw new Error( - 'Required parameter authorId was null or undefined when calling getPublicationsByAuthor.', - ); - } - - let localVarQueryParameters = new HttpParams({ encoder: this.encoder }); - localVarQueryParameters = this.addToHttpParams( - localVarQueryParameters, - page, - 'page', - ); - localVarQueryParameters = this.addToHttpParams( - localVarQueryParameters, - pageSize, - 'page_size', - ); - - let localVarHeaders = this.defaultHeaders; - - const localVarHttpHeaderAcceptSelected: string | undefined = - options?.httpHeaderAccept ?? - this.configuration.selectHeaderAccept(['application/json']); - if (localVarHttpHeaderAcceptSelected !== undefined) { - localVarHeaders = localVarHeaders.set( - 'Accept', - localVarHttpHeaderAcceptSelected, - ); - } - - const localVarHttpContext: HttpContext = - options?.context ?? new HttpContext(); - - const localVarTransferCache: boolean = options?.transferCache ?? true; - - let responseType_: 'text' | 'json' | 'blob' = 'json'; - if (localVarHttpHeaderAcceptSelected) { - if (localVarHttpHeaderAcceptSelected.startsWith('text')) { - responseType_ = 'text'; - } else if ( - this.configuration.isJsonMime(localVarHttpHeaderAcceptSelected) - ) { - responseType_ = 'json'; - } else { - responseType_ = 'blob'; - } - } - - let localVarPath = `/api/inse-service/authors/${this.configuration.encodeParam({ name: 'authorId', value: authorId, in: 'path', style: 'simple', explode: false, dataType: 'string', dataFormat: undefined })}/publications`; - const { basePath, withCredentials } = this.configuration; - return this.httpClient.request( - 'get', - `${basePath}${localVarPath}`, - { - context: localVarHttpContext, - params: localVarQueryParameters, - responseType: responseType_, - ...(withCredentials ? { withCredentials } : {}), - headers: localVarHeaders, - observe: observe, - ...(localVarTransferCache !== undefined - ? { transferCache: localVarTransferCache } - : {}), - reportProgress: reportProgress, - }, - ); - } } diff --git a/webapp/src/app/api/api/iNSEService.service.ts b/webapp/src/app/api/api/iNSEService.service.ts index da26fff7..1149c309 100644 --- a/webapp/src/app/api/api/iNSEService.service.ts +++ b/webapp/src/app/api/api/iNSEService.service.ts @@ -1,7 +1,7 @@ /** * Innovation Search Engine API * - * + * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech @@ -9,355 +9,205 @@ */ /* tslint:disable:no-unused-variable member-ordering */ -import { Inject, Injectable, Optional } from '@angular/core'; -import { - HttpClient, - HttpHeaders, - HttpParams, - HttpResponse, - HttpEvent, - HttpParameterCodec, - HttpContext, -} from '@angular/common/http'; -import { CustomHttpParameterCodec } from '../encoder'; -import { Observable } from 'rxjs'; +import { Inject, Injectable, Optional } from '@angular/core'; +import { HttpClient, HttpHeaders, HttpParams, + HttpResponse, HttpEvent, HttpParameterCodec, HttpContext + } from '@angular/common/http'; +import { CustomHttpParameterCodec } from '../encoder'; +import { Observable } from 'rxjs'; // @ts-ignore import { HTTPValidationError } from '../model/hTTPValidationError'; // @ts-ignore -import { BASE_PATH, COLLECTION_FORMATS } from '../variables'; -import { Configuration } from '../configuration'; +import { BASE_PATH, COLLECTION_FORMATS } from '../variables'; +import { Configuration } from '../configuration'; import { BaseService } from '../api.base.service'; + + @Injectable({ - providedIn: 'root', + providedIn: 'root' }) export class INSEServiceService extends BaseService { - constructor( - protected httpClient: HttpClient, - @Optional() @Inject(BASE_PATH) basePath: string | string[], - @Optional() configuration?: Configuration, - ) { - super(basePath, configuration); - } - /** - * Builds the topic hierarchy cache. - * @endpoint get /api/inse-service/topics/cache - * @param pageSize Page size for each search page. - * @param saveJson Persist cache JSON to data folder. - * @param observe set whether or not to return the data Observable as the body, response or events. defaults to returning the body. - * @param reportProgress flag to report request and response progress. - */ - public buildTopicCache( - pageSize?: number, - saveJson?: boolean, - observe?: 'body', - reportProgress?: boolean, - options?: { - httpHeaderAccept?: 'application/json'; - context?: HttpContext; - transferCache?: boolean; - }, - ): Observable; - public buildTopicCache( - pageSize?: number, - saveJson?: boolean, - observe?: 'response', - reportProgress?: boolean, - options?: { - httpHeaderAccept?: 'application/json'; - context?: HttpContext; - transferCache?: boolean; - }, - ): Observable>; - public buildTopicCache( - pageSize?: number, - saveJson?: boolean, - observe?: 'events', - reportProgress?: boolean, - options?: { - httpHeaderAccept?: 'application/json'; - context?: HttpContext; - transferCache?: boolean; - }, - ): Observable>; - public buildTopicCache( - pageSize?: number, - saveJson?: boolean, - observe: any = 'body', - reportProgress: boolean = false, - options?: { - httpHeaderAccept?: 'application/json'; - context?: HttpContext; - transferCache?: boolean; - }, - ): Observable { - let localVarQueryParameters = new HttpParams({ encoder: this.encoder }); - localVarQueryParameters = this.addToHttpParams( - localVarQueryParameters, - pageSize, - 'page_size', - ); - localVarQueryParameters = this.addToHttpParams( - localVarQueryParameters, - saveJson, - 'save_json', - ); - - let localVarHeaders = this.defaultHeaders; - - const localVarHttpHeaderAcceptSelected: string | undefined = - options?.httpHeaderAccept ?? - this.configuration.selectHeaderAccept(['application/json']); - if (localVarHttpHeaderAcceptSelected !== undefined) { - localVarHeaders = localVarHeaders.set( - 'Accept', - localVarHttpHeaderAcceptSelected, - ); + constructor(protected httpClient: HttpClient, @Optional() @Inject(BASE_PATH) basePath: string|string[], @Optional() configuration?: Configuration) { + super(basePath, configuration); } - const localVarHttpContext: HttpContext = - options?.context ?? new HttpContext(); + /** + * Builds the topic hierarchy cache. + * @endpoint get /api/inse-service/topics/cache + * @param pageSize Page size for each search page. + * @param saveJson Persist cache JSON to data folder. + * @param observe set whether or not to return the data Observable as the body, response or events. defaults to returning the body. + * @param reportProgress flag to report request and response progress. + */ + public buildTopicCache(pageSize?: number, saveJson?: boolean, observe?: 'body', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable; + public buildTopicCache(pageSize?: number, saveJson?: boolean, observe?: 'response', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable>; + public buildTopicCache(pageSize?: number, saveJson?: boolean, observe?: 'events', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable>; + public buildTopicCache(pageSize?: number, saveJson?: boolean, observe: any = 'body', reportProgress: boolean = false, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable { - const localVarTransferCache: boolean = options?.transferCache ?? true; + let localVarQueryParameters = new HttpParams({encoder: this.encoder}); + localVarQueryParameters = this.addToHttpParams(localVarQueryParameters, + pageSize, 'page_size'); + localVarQueryParameters = this.addToHttpParams(localVarQueryParameters, + saveJson, 'save_json'); - let responseType_: 'text' | 'json' | 'blob' = 'json'; - if (localVarHttpHeaderAcceptSelected) { - if (localVarHttpHeaderAcceptSelected.startsWith('text')) { - responseType_ = 'text'; - } else if ( - this.configuration.isJsonMime(localVarHttpHeaderAcceptSelected) - ) { - responseType_ = 'json'; - } else { - responseType_ = 'blob'; - } - } + let localVarHeaders = this.defaultHeaders; - let localVarPath = `/api/inse-service/topics/cache`; - const { basePath, withCredentials } = this.configuration; - return this.httpClient.request( - 'get', - `${basePath}${localVarPath}`, - { - context: localVarHttpContext, - params: localVarQueryParameters, - responseType: responseType_, - ...(withCredentials ? { withCredentials } : {}), - headers: localVarHeaders, - observe: observe, - ...(localVarTransferCache !== undefined - ? { transferCache: localVarTransferCache } - : {}), - reportProgress: reportProgress, - }, - ); - } + const localVarHttpHeaderAcceptSelected: string | undefined = options?.httpHeaderAccept ?? this.configuration.selectHeaderAccept([ + 'application/json' + ]); + if (localVarHttpHeaderAcceptSelected !== undefined) { + localVarHeaders = localVarHeaders.set('Accept', localVarHttpHeaderAcceptSelected); + } - /** - * Counts topic hierarchy occurrences from cache. - * @endpoint get /api/inse-service/topics/count - * @param topic Topic names (repeat parameter). - * @param observe set whether or not to return the data Observable as the body, response or events. defaults to returning the body. - * @param reportProgress flag to report request and response progress. - */ - public countTopicHierarchy( - topic: Array, - observe?: 'body', - reportProgress?: boolean, - options?: { - httpHeaderAccept?: 'application/json'; - context?: HttpContext; - transferCache?: boolean; - }, - ): Observable; - public countTopicHierarchy( - topic: Array, - observe?: 'response', - reportProgress?: boolean, - options?: { - httpHeaderAccept?: 'application/json'; - context?: HttpContext; - transferCache?: boolean; - }, - ): Observable>; - public countTopicHierarchy( - topic: Array, - observe?: 'events', - reportProgress?: boolean, - options?: { - httpHeaderAccept?: 'application/json'; - context?: HttpContext; - transferCache?: boolean; - }, - ): Observable>; - public countTopicHierarchy( - topic: Array, - observe: any = 'body', - reportProgress: boolean = false, - options?: { - httpHeaderAccept?: 'application/json'; - context?: HttpContext; - transferCache?: boolean; - }, - ): Observable { - if (topic === null || topic === undefined) { - throw new Error( - 'Required parameter topic was null or undefined when calling countTopicHierarchy.', - ); - } + const localVarHttpContext: HttpContext = options?.context ?? new HttpContext(); - let localVarQueryParameters = new HttpParams({ encoder: this.encoder }); - if (topic) { - topic.forEach((element) => { - localVarQueryParameters = this.addToHttpParams( - localVarQueryParameters, - element, - 'topic', + const localVarTransferCache: boolean = options?.transferCache ?? true; + + + let responseType_: 'text' | 'json' | 'blob' = 'json'; + if (localVarHttpHeaderAcceptSelected) { + if (localVarHttpHeaderAcceptSelected.startsWith('text')) { + responseType_ = 'text'; + } else if (this.configuration.isJsonMime(localVarHttpHeaderAcceptSelected)) { + responseType_ = 'json'; + } else { + responseType_ = 'blob'; + } + } + + let localVarPath = `/api/inse-service/topics/cache`; + const { basePath, withCredentials } = this.configuration; + return this.httpClient.request('get', `${basePath}${localVarPath}`, + { + context: localVarHttpContext, + params: localVarQueryParameters, + responseType: responseType_, + ...(withCredentials ? { withCredentials } : {}), + headers: localVarHeaders, + observe: observe, + ...(localVarTransferCache !== undefined ? { transferCache: localVarTransferCache } : {}), + reportProgress: reportProgress + } ); - }); } - let localVarHeaders = this.defaultHeaders; + /** + * Counts topic hierarchy occurrences from cache. + * @endpoint get /api/inse-service/topics/count + * @param topic Topic names (repeat parameter). + * @param observe set whether or not to return the data Observable as the body, response or events. defaults to returning the body. + * @param reportProgress flag to report request and response progress. + */ + public countTopicHierarchy(topic: Array, observe?: 'body', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable; + public countTopicHierarchy(topic: Array, observe?: 'response', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable>; + public countTopicHierarchy(topic: Array, observe?: 'events', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable>; + public countTopicHierarchy(topic: Array, observe: any = 'body', reportProgress: boolean = false, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable { + if (topic === null || topic === undefined) { + throw new Error('Required parameter topic was null or undefined when calling countTopicHierarchy.'); + } - const localVarHttpHeaderAcceptSelected: string | undefined = - options?.httpHeaderAccept ?? - this.configuration.selectHeaderAccept(['application/json']); - if (localVarHttpHeaderAcceptSelected !== undefined) { - localVarHeaders = localVarHeaders.set( - 'Accept', - localVarHttpHeaderAcceptSelected, - ); + let localVarQueryParameters = new HttpParams({encoder: this.encoder}); + if (topic) { + topic.forEach((element) => { + localVarQueryParameters = this.addToHttpParams(localVarQueryParameters, + element, 'topic'); + }) + } + + let localVarHeaders = this.defaultHeaders; + + const localVarHttpHeaderAcceptSelected: string | undefined = options?.httpHeaderAccept ?? this.configuration.selectHeaderAccept([ + 'application/json' + ]); + if (localVarHttpHeaderAcceptSelected !== undefined) { + localVarHeaders = localVarHeaders.set('Accept', localVarHttpHeaderAcceptSelected); + } + + const localVarHttpContext: HttpContext = options?.context ?? new HttpContext(); + + const localVarTransferCache: boolean = options?.transferCache ?? true; + + + let responseType_: 'text' | 'json' | 'blob' = 'json'; + if (localVarHttpHeaderAcceptSelected) { + if (localVarHttpHeaderAcceptSelected.startsWith('text')) { + responseType_ = 'text'; + } else if (this.configuration.isJsonMime(localVarHttpHeaderAcceptSelected)) { + responseType_ = 'json'; + } else { + responseType_ = 'blob'; + } + } + + let localVarPath = `/api/inse-service/topics/count`; + const { basePath, withCredentials } = this.configuration; + return this.httpClient.request('get', `${basePath}${localVarPath}`, + { + context: localVarHttpContext, + params: localVarQueryParameters, + responseType: responseType_, + ...(withCredentials ? { withCredentials } : {}), + headers: localVarHeaders, + observe: observe, + ...(localVarTransferCache !== undefined ? { transferCache: localVarTransferCache } : {}), + reportProgress: reportProgress + } + ); } - const localVarHttpContext: HttpContext = - options?.context ?? new HttpContext(); + /** + * Returns the nested topic hierarchy (Domains -> Fields -> Subfields -> Topics). + * @endpoint get /api/inse-service/topics/hierarchy + * @param observe set whether or not to return the data Observable as the body, response or events. defaults to returning the body. + * @param reportProgress flag to report request and response progress. + */ + public getTopicHierarchy(observe?: 'body', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable; + public getTopicHierarchy(observe?: 'response', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable>; + public getTopicHierarchy(observe?: 'events', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable>; + public getTopicHierarchy(observe: any = 'body', reportProgress: boolean = false, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable { - const localVarTransferCache: boolean = options?.transferCache ?? true; + let localVarHeaders = this.defaultHeaders; - let responseType_: 'text' | 'json' | 'blob' = 'json'; - if (localVarHttpHeaderAcceptSelected) { - if (localVarHttpHeaderAcceptSelected.startsWith('text')) { - responseType_ = 'text'; - } else if ( - this.configuration.isJsonMime(localVarHttpHeaderAcceptSelected) - ) { - responseType_ = 'json'; - } else { - responseType_ = 'blob'; - } + const localVarHttpHeaderAcceptSelected: string | undefined = options?.httpHeaderAccept ?? this.configuration.selectHeaderAccept([ + 'application/json' + ]); + if (localVarHttpHeaderAcceptSelected !== undefined) { + localVarHeaders = localVarHeaders.set('Accept', localVarHttpHeaderAcceptSelected); + } + + const localVarHttpContext: HttpContext = options?.context ?? new HttpContext(); + + const localVarTransferCache: boolean = options?.transferCache ?? true; + + + let responseType_: 'text' | 'json' | 'blob' = 'json'; + if (localVarHttpHeaderAcceptSelected) { + if (localVarHttpHeaderAcceptSelected.startsWith('text')) { + responseType_ = 'text'; + } else if (this.configuration.isJsonMime(localVarHttpHeaderAcceptSelected)) { + responseType_ = 'json'; + } else { + responseType_ = 'blob'; + } + } + + let localVarPath = `/api/inse-service/topics/hierarchy`; + const { basePath, withCredentials } = this.configuration; + return this.httpClient.request('get', `${basePath}${localVarPath}`, + { + context: localVarHttpContext, + responseType: responseType_, + ...(withCredentials ? { withCredentials } : {}), + headers: localVarHeaders, + observe: observe, + ...(localVarTransferCache !== undefined ? { transferCache: localVarTransferCache } : {}), + reportProgress: reportProgress + } + ); } - let localVarPath = `/api/inse-service/topics/count`; - const { basePath, withCredentials } = this.configuration; - return this.httpClient.request( - 'get', - `${basePath}${localVarPath}`, - { - context: localVarHttpContext, - params: localVarQueryParameters, - responseType: responseType_, - ...(withCredentials ? { withCredentials } : {}), - headers: localVarHeaders, - observe: observe, - ...(localVarTransferCache !== undefined - ? { transferCache: localVarTransferCache } - : {}), - reportProgress: reportProgress, - }, - ); - } - - /** - * Returns the nested topic hierarchy (Domains -> Fields -> Subfields -> Topics). - * @endpoint get /api/inse-service/topics/hierarchy - * @param observe set whether or not to return the data Observable as the body, response or events. defaults to returning the body. - * @param reportProgress flag to report request and response progress. - */ - public getTopicHierarchy( - observe?: 'body', - reportProgress?: boolean, - options?: { - httpHeaderAccept?: 'application/json'; - context?: HttpContext; - transferCache?: boolean; - }, - ): Observable; - public getTopicHierarchy( - observe?: 'response', - reportProgress?: boolean, - options?: { - httpHeaderAccept?: 'application/json'; - context?: HttpContext; - transferCache?: boolean; - }, - ): Observable>; - public getTopicHierarchy( - observe?: 'events', - reportProgress?: boolean, - options?: { - httpHeaderAccept?: 'application/json'; - context?: HttpContext; - transferCache?: boolean; - }, - ): Observable>; - public getTopicHierarchy( - observe: any = 'body', - reportProgress: boolean = false, - options?: { - httpHeaderAccept?: 'application/json'; - context?: HttpContext; - transferCache?: boolean; - }, - ): Observable { - let localVarHeaders = this.defaultHeaders; - - const localVarHttpHeaderAcceptSelected: string | undefined = - options?.httpHeaderAccept ?? - this.configuration.selectHeaderAccept(['application/json']); - if (localVarHttpHeaderAcceptSelected !== undefined) { - localVarHeaders = localVarHeaders.set( - 'Accept', - localVarHttpHeaderAcceptSelected, - ); - } - - const localVarHttpContext: HttpContext = - options?.context ?? new HttpContext(); - - const localVarTransferCache: boolean = options?.transferCache ?? true; - - let responseType_: 'text' | 'json' | 'blob' = 'json'; - if (localVarHttpHeaderAcceptSelected) { - if (localVarHttpHeaderAcceptSelected.startsWith('text')) { - responseType_ = 'text'; - } else if ( - this.configuration.isJsonMime(localVarHttpHeaderAcceptSelected) - ) { - responseType_ = 'json'; - } else { - responseType_ = 'blob'; - } - } - - let localVarPath = `/api/inse-service/topics/hierarchy`; - const { basePath, withCredentials } = this.configuration; - return this.httpClient.request( - 'get', - `${basePath}${localVarPath}`, - { - context: localVarHttpContext, - responseType: responseType_, - ...(withCredentials ? { withCredentials } : {}), - headers: localVarHeaders, - observe: observe, - ...(localVarTransferCache !== undefined - ? { transferCache: localVarTransferCache } - : {}), - reportProgress: reportProgress, - }, - ); - } } diff --git a/webapp/src/app/api/api/institutions.service.ts b/webapp/src/app/api/api/institutions.service.ts index b837e00e..641a3b13 100644 --- a/webapp/src/app/api/api/institutions.service.ts +++ b/webapp/src/app/api/api/institutions.service.ts @@ -1,7 +1,7 @@ /** * Innovation Search Engine API * - * + * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech @@ -9,18 +9,12 @@ */ /* tslint:disable:no-unused-variable member-ordering */ -import { Inject, Injectable, Optional } from '@angular/core'; -import { - HttpClient, - HttpHeaders, - HttpParams, - HttpResponse, - HttpEvent, - HttpParameterCodec, - HttpContext, -} from '@angular/common/http'; -import { CustomHttpParameterCodec } from '../encoder'; -import { Observable } from 'rxjs'; +import { Inject, Injectable, Optional } from '@angular/core'; +import { HttpClient, HttpHeaders, HttpParams, + HttpResponse, HttpEvent, HttpParameterCodec, HttpContext + } from '@angular/common/http'; +import { CustomHttpParameterCodec } from '../encoder'; +import { Observable } from 'rxjs'; // @ts-ignore import { AutocompleteResponse } from '../model/autocompleteResponse'; @@ -34,591 +28,295 @@ import { InstitutionPage } from '../model/institutionPage'; import { InstitutionsListResponse } from '../model/institutionsListResponse'; // @ts-ignore -import { BASE_PATH, COLLECTION_FORMATS } from '../variables'; -import { Configuration } from '../configuration'; +import { BASE_PATH, COLLECTION_FORMATS } from '../variables'; +import { Configuration } from '../configuration'; import { BaseService } from '../api.base.service'; + + @Injectable({ - providedIn: 'root', + providedIn: 'root' }) export class InstitutionsService extends BaseService { - constructor( - protected httpClient: HttpClient, - @Optional() @Inject(BASE_PATH) basePath: string | string[], - @Optional() configuration?: Configuration, - ) { - super(basePath, configuration); - } - /** - * Returns institution options for autocomplete inputs. - * @endpoint get /api/inse-service/institutions/autocomplete - * @param query Institution search text, for example \'Duisburg Essen\'. - * @param countryCode Optional ISO country code filter. - * @param type Optional institution type filter. - * @param limit Maximum number of autocomplete options. - * @param observe set whether or not to return the data Observable as the body, response or events. defaults to returning the body. - * @param reportProgress flag to report request and response progress. - */ - public autocompleteInstitutions( - query: string, - countryCode?: string, - type?: string, - limit?: number, - observe?: 'body', - reportProgress?: boolean, - options?: { - httpHeaderAccept?: 'application/json'; - context?: HttpContext; - transferCache?: boolean; - }, - ): Observable; - public autocompleteInstitutions( - query: string, - countryCode?: string, - type?: string, - limit?: number, - observe?: 'response', - reportProgress?: boolean, - options?: { - httpHeaderAccept?: 'application/json'; - context?: HttpContext; - transferCache?: boolean; - }, - ): Observable>; - public autocompleteInstitutions( - query: string, - countryCode?: string, - type?: string, - limit?: number, - observe?: 'events', - reportProgress?: boolean, - options?: { - httpHeaderAccept?: 'application/json'; - context?: HttpContext; - transferCache?: boolean; - }, - ): Observable>; - public autocompleteInstitutions( - query: string, - countryCode?: string, - type?: string, - limit?: number, - observe: any = 'body', - reportProgress: boolean = false, - options?: { - httpHeaderAccept?: 'application/json'; - context?: HttpContext; - transferCache?: boolean; - }, - ): Observable { - if (query === null || query === undefined) { - throw new Error( - 'Required parameter query was null or undefined when calling autocompleteInstitutions.', - ); + constructor(protected httpClient: HttpClient, @Optional() @Inject(BASE_PATH) basePath: string|string[], @Optional() configuration?: Configuration) { + super(basePath, configuration); } - let localVarQueryParameters = new HttpParams({ encoder: this.encoder }); - localVarQueryParameters = this.addToHttpParams( - localVarQueryParameters, - query, - 'query', - ); - localVarQueryParameters = this.addToHttpParams( - localVarQueryParameters, - countryCode, - 'countryCode', - ); - localVarQueryParameters = this.addToHttpParams( - localVarQueryParameters, - type, - 'type', - ); - localVarQueryParameters = this.addToHttpParams( - localVarQueryParameters, - limit, - 'limit', - ); + /** + * Returns institution options for autocomplete inputs. + * @endpoint get /api/inse-service/institutions/autocomplete + * @param query Institution search text, for example \'Duisburg Essen\'. + * @param countryCode Optional ISO country code filter. + * @param type Optional institution type filter. + * @param limit Maximum number of autocomplete options. + * @param observe set whether or not to return the data Observable as the body, response or events. defaults to returning the body. + * @param reportProgress flag to report request and response progress. + */ + public autocompleteInstitutions(query: string, countryCode?: string, type?: string, limit?: number, observe?: 'body', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable; + public autocompleteInstitutions(query: string, countryCode?: string, type?: string, limit?: number, observe?: 'response', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable>; + public autocompleteInstitutions(query: string, countryCode?: string, type?: string, limit?: number, observe?: 'events', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable>; + public autocompleteInstitutions(query: string, countryCode?: string, type?: string, limit?: number, observe: any = 'body', reportProgress: boolean = false, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable { + if (query === null || query === undefined) { + throw new Error('Required parameter query was null or undefined when calling autocompleteInstitutions.'); + } - let localVarHeaders = this.defaultHeaders; + let localVarQueryParameters = new HttpParams({encoder: this.encoder}); + localVarQueryParameters = this.addToHttpParams(localVarQueryParameters, + query, 'query'); + localVarQueryParameters = this.addToHttpParams(localVarQueryParameters, + countryCode, 'countryCode'); + localVarQueryParameters = this.addToHttpParams(localVarQueryParameters, + type, 'type'); + localVarQueryParameters = this.addToHttpParams(localVarQueryParameters, + limit, 'limit'); - const localVarHttpHeaderAcceptSelected: string | undefined = - options?.httpHeaderAccept ?? - this.configuration.selectHeaderAccept(['application/json']); - if (localVarHttpHeaderAcceptSelected !== undefined) { - localVarHeaders = localVarHeaders.set( - 'Accept', - localVarHttpHeaderAcceptSelected, - ); + let localVarHeaders = this.defaultHeaders; + + const localVarHttpHeaderAcceptSelected: string | undefined = options?.httpHeaderAccept ?? this.configuration.selectHeaderAccept([ + 'application/json' + ]); + if (localVarHttpHeaderAcceptSelected !== undefined) { + localVarHeaders = localVarHeaders.set('Accept', localVarHttpHeaderAcceptSelected); + } + + const localVarHttpContext: HttpContext = options?.context ?? new HttpContext(); + + const localVarTransferCache: boolean = options?.transferCache ?? true; + + + let responseType_: 'text' | 'json' | 'blob' = 'json'; + if (localVarHttpHeaderAcceptSelected) { + if (localVarHttpHeaderAcceptSelected.startsWith('text')) { + responseType_ = 'text'; + } else if (this.configuration.isJsonMime(localVarHttpHeaderAcceptSelected)) { + responseType_ = 'json'; + } else { + responseType_ = 'blob'; + } + } + + let localVarPath = `/api/inse-service/institutions/autocomplete`; + const { basePath, withCredentials } = this.configuration; + return this.httpClient.request('get', `${basePath}${localVarPath}`, + { + context: localVarHttpContext, + params: localVarQueryParameters, + responseType: responseType_, + ...(withCredentials ? { withCredentials } : {}), + headers: localVarHeaders, + observe: observe, + ...(localVarTransferCache !== undefined ? { transferCache: localVarTransferCache } : {}), + reportProgress: reportProgress + } + ); } - const localVarHttpContext: HttpContext = - options?.context ?? new HttpContext(); + /** + * Returns a single institution by ID. + * Returns a single institution by its OpenAlex ID. + * @endpoint get /api/inse-service/institutions/{id} + * @param id + * @param observe set whether or not to return the data Observable as the body, response or events. defaults to returning the body. + * @param reportProgress flag to report request and response progress. + */ + public getInstitutionById(id: string, observe?: 'body', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable; + public getInstitutionById(id: string, observe?: 'response', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable>; + public getInstitutionById(id: string, observe?: 'events', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable>; + public getInstitutionById(id: string, observe: any = 'body', reportProgress: boolean = false, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable { + if (id === null || id === undefined) { + throw new Error('Required parameter id was null or undefined when calling getInstitutionById.'); + } - const localVarTransferCache: boolean = options?.transferCache ?? true; + let localVarHeaders = this.defaultHeaders; - let responseType_: 'text' | 'json' | 'blob' = 'json'; - if (localVarHttpHeaderAcceptSelected) { - if (localVarHttpHeaderAcceptSelected.startsWith('text')) { - responseType_ = 'text'; - } else if ( - this.configuration.isJsonMime(localVarHttpHeaderAcceptSelected) - ) { - responseType_ = 'json'; - } else { - responseType_ = 'blob'; - } + const localVarHttpHeaderAcceptSelected: string | undefined = options?.httpHeaderAccept ?? this.configuration.selectHeaderAccept([ + 'application/json' + ]); + if (localVarHttpHeaderAcceptSelected !== undefined) { + localVarHeaders = localVarHeaders.set('Accept', localVarHttpHeaderAcceptSelected); + } + + const localVarHttpContext: HttpContext = options?.context ?? new HttpContext(); + + const localVarTransferCache: boolean = options?.transferCache ?? true; + + + let responseType_: 'text' | 'json' | 'blob' = 'json'; + if (localVarHttpHeaderAcceptSelected) { + if (localVarHttpHeaderAcceptSelected.startsWith('text')) { + responseType_ = 'text'; + } else if (this.configuration.isJsonMime(localVarHttpHeaderAcceptSelected)) { + responseType_ = 'json'; + } else { + responseType_ = 'blob'; + } + } + + let localVarPath = `/api/inse-service/institutions/${this.configuration.encodeParam({name: "id", value: id, in: "path", style: "simple", explode: false, dataType: "string", dataFormat: undefined})}`; + const { basePath, withCredentials } = this.configuration; + return this.httpClient.request('get', `${basePath}${localVarPath}`, + { + context: localVarHttpContext, + responseType: responseType_, + ...(withCredentials ? { withCredentials } : {}), + headers: localVarHeaders, + observe: observe, + ...(localVarTransferCache !== undefined ? { transferCache: localVarTransferCache } : {}), + reportProgress: reportProgress + } + ); } - let localVarPath = `/api/inse-service/institutions/autocomplete`; - const { basePath, withCredentials } = this.configuration; - return this.httpClient.request( - 'get', - `${basePath}${localVarPath}`, - { - context: localVarHttpContext, - params: localVarQueryParameters, - responseType: responseType_, - ...(withCredentials ? { withCredentials } : {}), - headers: localVarHeaders, - observe: observe, - ...(localVarTransferCache !== undefined - ? { transferCache: localVarTransferCache } - : {}), - reportProgress: reportProgress, - }, - ); - } + /** + * Returns a list of OpenAlex institutions. + * @endpoint get /api/inse-service/institutions + * @param search Full-text search, for example \'Duisburg Essen\'. + * @param filter OpenAlex filter, for example \'country_code:DE,type:education\'. + * @param sort Sort field, for example \'works_count:desc\'. + * @param groupBy OpenAlex group_by field, for example \'country_code\'. + * @param perPage Results per page. + * @param page Page number. Use cursor for deep pagination. + * @param cursor Cursor pagination token. Use \'*\' to start. + * @param sample Random sample size. Cannot be combined with sort or page. + * @param select Comma-separated fields to return. + * @param observe set whether or not to return the data Observable as the body, response or events. defaults to returning the body. + * @param reportProgress flag to report request and response progress. + */ + public listInstitutions(search?: string, filter?: string, sort?: string, groupBy?: string, perPage?: number, page?: number, cursor?: string, sample?: number, select?: string, observe?: 'body', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable; + public listInstitutions(search?: string, filter?: string, sort?: string, groupBy?: string, perPage?: number, page?: number, cursor?: string, sample?: number, select?: string, observe?: 'response', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable>; + public listInstitutions(search?: string, filter?: string, sort?: string, groupBy?: string, perPage?: number, page?: number, cursor?: string, sample?: number, select?: string, observe?: 'events', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable>; + public listInstitutions(search?: string, filter?: string, sort?: string, groupBy?: string, perPage?: number, page?: number, cursor?: string, sample?: number, select?: string, observe: any = 'body', reportProgress: boolean = false, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable { - /** - * Returns a single institution by ID. - * Returns a single institution by its OpenAlex ID. - * @endpoint get /api/inse-service/institutions/{id} - * @param id - * @param observe set whether or not to return the data Observable as the body, response or events. defaults to returning the body. - * @param reportProgress flag to report request and response progress. - */ - public getInstitutionById( - id: string, - observe?: 'body', - reportProgress?: boolean, - options?: { - httpHeaderAccept?: 'application/json'; - context?: HttpContext; - transferCache?: boolean; - }, - ): Observable; - public getInstitutionById( - id: string, - observe?: 'response', - reportProgress?: boolean, - options?: { - httpHeaderAccept?: 'application/json'; - context?: HttpContext; - transferCache?: boolean; - }, - ): Observable>; - public getInstitutionById( - id: string, - observe?: 'events', - reportProgress?: boolean, - options?: { - httpHeaderAccept?: 'application/json'; - context?: HttpContext; - transferCache?: boolean; - }, - ): Observable>; - public getInstitutionById( - id: string, - observe: any = 'body', - reportProgress: boolean = false, - options?: { - httpHeaderAccept?: 'application/json'; - context?: HttpContext; - transferCache?: boolean; - }, - ): Observable { - if (id === null || id === undefined) { - throw new Error( - 'Required parameter id was null or undefined when calling getInstitutionById.', - ); + let localVarQueryParameters = new HttpParams({encoder: this.encoder}); + localVarQueryParameters = this.addToHttpParams(localVarQueryParameters, + search, 'search'); + localVarQueryParameters = this.addToHttpParams(localVarQueryParameters, + filter, 'filter'); + localVarQueryParameters = this.addToHttpParams(localVarQueryParameters, + sort, 'sort'); + localVarQueryParameters = this.addToHttpParams(localVarQueryParameters, + groupBy, 'group_by'); + localVarQueryParameters = this.addToHttpParams(localVarQueryParameters, + perPage, 'per_page'); + localVarQueryParameters = this.addToHttpParams(localVarQueryParameters, + page, 'page'); + localVarQueryParameters = this.addToHttpParams(localVarQueryParameters, + cursor, 'cursor'); + localVarQueryParameters = this.addToHttpParams(localVarQueryParameters, + sample, 'sample'); + localVarQueryParameters = this.addToHttpParams(localVarQueryParameters, + select, 'select'); + + let localVarHeaders = this.defaultHeaders; + + const localVarHttpHeaderAcceptSelected: string | undefined = options?.httpHeaderAccept ?? this.configuration.selectHeaderAccept([ + 'application/json' + ]); + if (localVarHttpHeaderAcceptSelected !== undefined) { + localVarHeaders = localVarHeaders.set('Accept', localVarHttpHeaderAcceptSelected); + } + + const localVarHttpContext: HttpContext = options?.context ?? new HttpContext(); + + const localVarTransferCache: boolean = options?.transferCache ?? true; + + + let responseType_: 'text' | 'json' | 'blob' = 'json'; + if (localVarHttpHeaderAcceptSelected) { + if (localVarHttpHeaderAcceptSelected.startsWith('text')) { + responseType_ = 'text'; + } else if (this.configuration.isJsonMime(localVarHttpHeaderAcceptSelected)) { + responseType_ = 'json'; + } else { + responseType_ = 'blob'; + } + } + + let localVarPath = `/api/inse-service/institutions`; + const { basePath, withCredentials } = this.configuration; + return this.httpClient.request('get', `${basePath}${localVarPath}`, + { + context: localVarHttpContext, + params: localVarQueryParameters, + responseType: responseType_, + ...(withCredentials ? { withCredentials } : {}), + headers: localVarHeaders, + observe: observe, + ...(localVarTransferCache !== undefined ? { transferCache: localVarTransferCache } : {}), + reportProgress: reportProgress + } + ); } - let localVarHeaders = this.defaultHeaders; + /** + * Searches for institutions by name. + * Searches for institutions by name with pagination. + * @endpoint get /api/inse-service/institutions/search + * @param name Institution name to search for, for example \'University of Duisburg Essen\'. + * @param page Page number (0-indexed). + * @param size Number of institutions per page. + * @param sortBy Field to sort by, either \'relevance\', \'name\', \'works_count\', or \'citations_count\'. + * @param sortingDirection Sorting direction, either \'asc\' or \'desc\'. + * @param observe set whether or not to return the data Observable as the body, response or events. defaults to returning the body. + * @param reportProgress flag to report request and response progress. + */ + public searchInstitutionsByName(name?: string, page?: number, size?: number, sortBy?: 'relevance' | 'name' | 'works_count' | 'citations_count', sortingDirection?: 'asc' | 'desc', observe?: 'body', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable; + public searchInstitutionsByName(name?: string, page?: number, size?: number, sortBy?: 'relevance' | 'name' | 'works_count' | 'citations_count', sortingDirection?: 'asc' | 'desc', observe?: 'response', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable>; + public searchInstitutionsByName(name?: string, page?: number, size?: number, sortBy?: 'relevance' | 'name' | 'works_count' | 'citations_count', sortingDirection?: 'asc' | 'desc', observe?: 'events', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable>; + public searchInstitutionsByName(name?: string, page?: number, size?: number, sortBy?: 'relevance' | 'name' | 'works_count' | 'citations_count', sortingDirection?: 'asc' | 'desc', observe: any = 'body', reportProgress: boolean = false, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable { - const localVarHttpHeaderAcceptSelected: string | undefined = - options?.httpHeaderAccept ?? - this.configuration.selectHeaderAccept(['application/json']); - if (localVarHttpHeaderAcceptSelected !== undefined) { - localVarHeaders = localVarHeaders.set( - 'Accept', - localVarHttpHeaderAcceptSelected, - ); + let localVarQueryParameters = new HttpParams({encoder: this.encoder}); + localVarQueryParameters = this.addToHttpParams(localVarQueryParameters, + name, 'name'); + localVarQueryParameters = this.addToHttpParams(localVarQueryParameters, + page, 'page'); + localVarQueryParameters = this.addToHttpParams(localVarQueryParameters, + size, 'size'); + localVarQueryParameters = this.addToHttpParams(localVarQueryParameters, + sortBy, 'sort_by'); + localVarQueryParameters = this.addToHttpParams(localVarQueryParameters, + sortingDirection, 'sorting_direction'); + + let localVarHeaders = this.defaultHeaders; + + const localVarHttpHeaderAcceptSelected: string | undefined = options?.httpHeaderAccept ?? this.configuration.selectHeaderAccept([ + 'application/json' + ]); + if (localVarHttpHeaderAcceptSelected !== undefined) { + localVarHeaders = localVarHeaders.set('Accept', localVarHttpHeaderAcceptSelected); + } + + const localVarHttpContext: HttpContext = options?.context ?? new HttpContext(); + + const localVarTransferCache: boolean = options?.transferCache ?? true; + + + let responseType_: 'text' | 'json' | 'blob' = 'json'; + if (localVarHttpHeaderAcceptSelected) { + if (localVarHttpHeaderAcceptSelected.startsWith('text')) { + responseType_ = 'text'; + } else if (this.configuration.isJsonMime(localVarHttpHeaderAcceptSelected)) { + responseType_ = 'json'; + } else { + responseType_ = 'blob'; + } + } + + let localVarPath = `/api/inse-service/institutions/search`; + const { basePath, withCredentials } = this.configuration; + return this.httpClient.request('get', `${basePath}${localVarPath}`, + { + context: localVarHttpContext, + params: localVarQueryParameters, + responseType: responseType_, + ...(withCredentials ? { withCredentials } : {}), + headers: localVarHeaders, + observe: observe, + ...(localVarTransferCache !== undefined ? { transferCache: localVarTransferCache } : {}), + reportProgress: reportProgress + } + ); } - const localVarHttpContext: HttpContext = - options?.context ?? new HttpContext(); - - const localVarTransferCache: boolean = options?.transferCache ?? true; - - let responseType_: 'text' | 'json' | 'blob' = 'json'; - if (localVarHttpHeaderAcceptSelected) { - if (localVarHttpHeaderAcceptSelected.startsWith('text')) { - responseType_ = 'text'; - } else if ( - this.configuration.isJsonMime(localVarHttpHeaderAcceptSelected) - ) { - responseType_ = 'json'; - } else { - responseType_ = 'blob'; - } - } - - let localVarPath = `/api/inse-service/institutions/${this.configuration.encodeParam({ name: 'id', value: id, in: 'path', style: 'simple', explode: false, dataType: 'string', dataFormat: undefined })}`; - const { basePath, withCredentials } = this.configuration; - return this.httpClient.request( - 'get', - `${basePath}${localVarPath}`, - { - context: localVarHttpContext, - responseType: responseType_, - ...(withCredentials ? { withCredentials } : {}), - headers: localVarHeaders, - observe: observe, - ...(localVarTransferCache !== undefined - ? { transferCache: localVarTransferCache } - : {}), - reportProgress: reportProgress, - }, - ); - } - - /** - * Returns a list of OpenAlex institutions. - * @endpoint get /api/inse-service/institutions - * @param search Full-text search, for example \'Duisburg Essen\'. - * @param filter OpenAlex filter, for example \'country_code:DE,type:education\'. - * @param sort Sort field, for example \'works_count:desc\'. - * @param groupBy OpenAlex group_by field, for example \'country_code\'. - * @param perPage Results per page. - * @param page Page number. Use cursor for deep pagination. - * @param cursor Cursor pagination token. Use \'*\' to start. - * @param sample Random sample size. Cannot be combined with sort or page. - * @param select Comma-separated fields to return. - * @param observe set whether or not to return the data Observable as the body, response or events. defaults to returning the body. - * @param reportProgress flag to report request and response progress. - */ - public listInstitutions( - search?: string, - filter?: string, - sort?: string, - groupBy?: string, - perPage?: number, - page?: number, - cursor?: string, - sample?: number, - select?: string, - observe?: 'body', - reportProgress?: boolean, - options?: { - httpHeaderAccept?: 'application/json'; - context?: HttpContext; - transferCache?: boolean; - }, - ): Observable; - public listInstitutions( - search?: string, - filter?: string, - sort?: string, - groupBy?: string, - perPage?: number, - page?: number, - cursor?: string, - sample?: number, - select?: string, - observe?: 'response', - reportProgress?: boolean, - options?: { - httpHeaderAccept?: 'application/json'; - context?: HttpContext; - transferCache?: boolean; - }, - ): Observable>; - public listInstitutions( - search?: string, - filter?: string, - sort?: string, - groupBy?: string, - perPage?: number, - page?: number, - cursor?: string, - sample?: number, - select?: string, - observe?: 'events', - reportProgress?: boolean, - options?: { - httpHeaderAccept?: 'application/json'; - context?: HttpContext; - transferCache?: boolean; - }, - ): Observable>; - public listInstitutions( - search?: string, - filter?: string, - sort?: string, - groupBy?: string, - perPage?: number, - page?: number, - cursor?: string, - sample?: number, - select?: string, - observe: any = 'body', - reportProgress: boolean = false, - options?: { - httpHeaderAccept?: 'application/json'; - context?: HttpContext; - transferCache?: boolean; - }, - ): Observable { - let localVarQueryParameters = new HttpParams({ encoder: this.encoder }); - localVarQueryParameters = this.addToHttpParams( - localVarQueryParameters, - search, - 'search', - ); - localVarQueryParameters = this.addToHttpParams( - localVarQueryParameters, - filter, - 'filter', - ); - localVarQueryParameters = this.addToHttpParams( - localVarQueryParameters, - sort, - 'sort', - ); - localVarQueryParameters = this.addToHttpParams( - localVarQueryParameters, - groupBy, - 'group_by', - ); - localVarQueryParameters = this.addToHttpParams( - localVarQueryParameters, - perPage, - 'per_page', - ); - localVarQueryParameters = this.addToHttpParams( - localVarQueryParameters, - page, - 'page', - ); - localVarQueryParameters = this.addToHttpParams( - localVarQueryParameters, - cursor, - 'cursor', - ); - localVarQueryParameters = this.addToHttpParams( - localVarQueryParameters, - sample, - 'sample', - ); - localVarQueryParameters = this.addToHttpParams( - localVarQueryParameters, - select, - 'select', - ); - - let localVarHeaders = this.defaultHeaders; - - const localVarHttpHeaderAcceptSelected: string | undefined = - options?.httpHeaderAccept ?? - this.configuration.selectHeaderAccept(['application/json']); - if (localVarHttpHeaderAcceptSelected !== undefined) { - localVarHeaders = localVarHeaders.set( - 'Accept', - localVarHttpHeaderAcceptSelected, - ); - } - - const localVarHttpContext: HttpContext = - options?.context ?? new HttpContext(); - - const localVarTransferCache: boolean = options?.transferCache ?? true; - - let responseType_: 'text' | 'json' | 'blob' = 'json'; - if (localVarHttpHeaderAcceptSelected) { - if (localVarHttpHeaderAcceptSelected.startsWith('text')) { - responseType_ = 'text'; - } else if ( - this.configuration.isJsonMime(localVarHttpHeaderAcceptSelected) - ) { - responseType_ = 'json'; - } else { - responseType_ = 'blob'; - } - } - - let localVarPath = `/api/inse-service/institutions`; - const { basePath, withCredentials } = this.configuration; - return this.httpClient.request( - 'get', - `${basePath}${localVarPath}`, - { - context: localVarHttpContext, - params: localVarQueryParameters, - responseType: responseType_, - ...(withCredentials ? { withCredentials } : {}), - headers: localVarHeaders, - observe: observe, - ...(localVarTransferCache !== undefined - ? { transferCache: localVarTransferCache } - : {}), - reportProgress: reportProgress, - }, - ); - } - - /** - * Searches for institutions by name. - * Searches for institutions by name with pagination. - * @endpoint get /api/inse-service/institutions/search - * @param name Institution name to search for, for example \'University of Duisburg Essen\'. - * @param page Page number (0-indexed). - * @param size Number of institutions per page. - * @param sortBy Field to sort by, either \'relevance\', \'name\', \'works_count\', or \'citations_count\'. - * @param sortingDirection Sorting direction, either \'asc\' or \'desc\'. - * @param observe set whether or not to return the data Observable as the body, response or events. defaults to returning the body. - * @param reportProgress flag to report request and response progress. - */ - public searchInstitutionsByName( - name?: string, - page?: number, - size?: number, - sortBy?: 'relevance' | 'name' | 'works_count' | 'citations_count', - sortingDirection?: 'asc' | 'desc', - observe?: 'body', - reportProgress?: boolean, - options?: { - httpHeaderAccept?: 'application/json'; - context?: HttpContext; - transferCache?: boolean; - }, - ): Observable; - public searchInstitutionsByName( - name?: string, - page?: number, - size?: number, - sortBy?: 'relevance' | 'name' | 'works_count' | 'citations_count', - sortingDirection?: 'asc' | 'desc', - observe?: 'response', - reportProgress?: boolean, - options?: { - httpHeaderAccept?: 'application/json'; - context?: HttpContext; - transferCache?: boolean; - }, - ): Observable>; - public searchInstitutionsByName( - name?: string, - page?: number, - size?: number, - sortBy?: 'relevance' | 'name' | 'works_count' | 'citations_count', - sortingDirection?: 'asc' | 'desc', - observe?: 'events', - reportProgress?: boolean, - options?: { - httpHeaderAccept?: 'application/json'; - context?: HttpContext; - transferCache?: boolean; - }, - ): Observable>; - public searchInstitutionsByName( - name?: string, - page?: number, - size?: number, - sortBy?: 'relevance' | 'name' | 'works_count' | 'citations_count', - sortingDirection?: 'asc' | 'desc', - observe: any = 'body', - reportProgress: boolean = false, - options?: { - httpHeaderAccept?: 'application/json'; - context?: HttpContext; - transferCache?: boolean; - }, - ): Observable { - let localVarQueryParameters = new HttpParams({ encoder: this.encoder }); - localVarQueryParameters = this.addToHttpParams( - localVarQueryParameters, - name, - 'name', - ); - localVarQueryParameters = this.addToHttpParams( - localVarQueryParameters, - page, - 'page', - ); - localVarQueryParameters = this.addToHttpParams( - localVarQueryParameters, - size, - 'size', - ); - localVarQueryParameters = this.addToHttpParams( - localVarQueryParameters, - sortBy, - 'sort_by', - ); - localVarQueryParameters = this.addToHttpParams( - localVarQueryParameters, - sortingDirection, - 'sorting_direction', - ); - - let localVarHeaders = this.defaultHeaders; - - const localVarHttpHeaderAcceptSelected: string | undefined = - options?.httpHeaderAccept ?? - this.configuration.selectHeaderAccept(['application/json']); - if (localVarHttpHeaderAcceptSelected !== undefined) { - localVarHeaders = localVarHeaders.set( - 'Accept', - localVarHttpHeaderAcceptSelected, - ); - } - - const localVarHttpContext: HttpContext = - options?.context ?? new HttpContext(); - - const localVarTransferCache: boolean = options?.transferCache ?? true; - - let responseType_: 'text' | 'json' | 'blob' = 'json'; - if (localVarHttpHeaderAcceptSelected) { - if (localVarHttpHeaderAcceptSelected.startsWith('text')) { - responseType_ = 'text'; - } else if ( - this.configuration.isJsonMime(localVarHttpHeaderAcceptSelected) - ) { - responseType_ = 'json'; - } else { - responseType_ = 'blob'; - } - } - - let localVarPath = `/api/inse-service/institutions/search`; - const { basePath, withCredentials } = this.configuration; - return this.httpClient.request( - 'get', - `${basePath}${localVarPath}`, - { - context: localVarHttpContext, - params: localVarQueryParameters, - responseType: responseType_, - ...(withCredentials ? { withCredentials } : {}), - headers: localVarHeaders, - observe: observe, - ...(localVarTransferCache !== undefined - ? { transferCache: localVarTransferCache } - : {}), - reportProgress: reportProgress, - }, - ); - } } diff --git a/webapp/src/app/api/api/institutionsV2.service.ts b/webapp/src/app/api/api/institutionsV2.service.ts new file mode 100644 index 00000000..d0e3c555 --- /dev/null +++ b/webapp/src/app/api/api/institutionsV2.service.ts @@ -0,0 +1,158 @@ +/** + * Innovation Search Engine API + * + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ +/* tslint:disable:no-unused-variable member-ordering */ + +import { Inject, Injectable, Optional } from '@angular/core'; +import { HttpClient, HttpHeaders, HttpParams, + HttpResponse, HttpEvent, HttpParameterCodec, HttpContext + } from '@angular/common/http'; +import { CustomHttpParameterCodec } from '../encoder'; +import { Observable } from 'rxjs'; + +// @ts-ignore +import { HTTPValidationError } from '../model/hTTPValidationError'; +// @ts-ignore +import { InstitutionPageV2 } from '../model/institutionPageV2'; + +// @ts-ignore +import { BASE_PATH, COLLECTION_FORMATS } from '../variables'; +import { Configuration } from '../configuration'; +import { BaseService } from '../api.base.service'; + + + +@Injectable({ + providedIn: 'root' +}) +export class InstitutionsV2Service extends BaseService { + + constructor(protected httpClient: HttpClient, @Optional() @Inject(BASE_PATH) basePath: string|string[], @Optional() configuration?: Configuration) { + super(basePath, configuration); + } + + /** + * Returns a list of institutions based on a search term for autocomplete functionality. + * @endpoint get /api/v2/institutions/autocomplete/selector + * @param query A search term to filter institutions by (partial matches allowed). + * @param observe set whether or not to return the data Observable as the body, response or events. defaults to returning the body. + * @param reportProgress flag to report request and response progress. + */ + public getInstitutionAutocompleteForSelector(query?: string, observe?: 'body', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable; + public getInstitutionAutocompleteForSelector(query?: string, observe?: 'response', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable>; + public getInstitutionAutocompleteForSelector(query?: string, observe?: 'events', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable>; + public getInstitutionAutocompleteForSelector(query?: string, observe: any = 'body', reportProgress: boolean = false, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable { + + let localVarQueryParameters = new HttpParams({encoder: this.encoder}); + localVarQueryParameters = this.addToHttpParams(localVarQueryParameters, + query, 'query'); + + let localVarHeaders = this.defaultHeaders; + + const localVarHttpHeaderAcceptSelected: string | undefined = options?.httpHeaderAccept ?? this.configuration.selectHeaderAccept([ + 'application/json' + ]); + if (localVarHttpHeaderAcceptSelected !== undefined) { + localVarHeaders = localVarHeaders.set('Accept', localVarHttpHeaderAcceptSelected); + } + + const localVarHttpContext: HttpContext = options?.context ?? new HttpContext(); + + const localVarTransferCache: boolean = options?.transferCache ?? true; + + + let responseType_: 'text' | 'json' | 'blob' = 'json'; + if (localVarHttpHeaderAcceptSelected) { + if (localVarHttpHeaderAcceptSelected.startsWith('text')) { + responseType_ = 'text'; + } else if (this.configuration.isJsonMime(localVarHttpHeaderAcceptSelected)) { + responseType_ = 'json'; + } else { + responseType_ = 'blob'; + } + } + + let localVarPath = `/api/v2/institutions/autocomplete/selector`; + const { basePath, withCredentials } = this.configuration; + return this.httpClient.request('get', `${basePath}${localVarPath}`, + { + context: localVarHttpContext, + params: localVarQueryParameters, + responseType: responseType_, + ...(withCredentials ? { withCredentials } : {}), + headers: localVarHeaders, + observe: observe, + ...(localVarTransferCache !== undefined ? { transferCache: localVarTransferCache } : {}), + reportProgress: reportProgress + } + ); + } + + /** + * Returns a list of institutions based on their IDs. + * @endpoint get /api/v2/institutions/ids + * @param institutionIds A list of institution IDs to retrieve. + * @param observe set whether or not to return the data Observable as the body, response or events. defaults to returning the body. + * @param reportProgress flag to report request and response progress. + */ + public getInstitutionsByIds(institutionIds?: Array, observe?: 'body', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable; + public getInstitutionsByIds(institutionIds?: Array, observe?: 'response', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable>; + public getInstitutionsByIds(institutionIds?: Array, observe?: 'events', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable>; + public getInstitutionsByIds(institutionIds?: Array, observe: any = 'body', reportProgress: boolean = false, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable { + + let localVarQueryParameters = new HttpParams({encoder: this.encoder}); + if (institutionIds) { + institutionIds.forEach((element) => { + localVarQueryParameters = this.addToHttpParams(localVarQueryParameters, + element, 'institution_ids'); + }) + } + + let localVarHeaders = this.defaultHeaders; + + const localVarHttpHeaderAcceptSelected: string | undefined = options?.httpHeaderAccept ?? this.configuration.selectHeaderAccept([ + 'application/json' + ]); + if (localVarHttpHeaderAcceptSelected !== undefined) { + localVarHeaders = localVarHeaders.set('Accept', localVarHttpHeaderAcceptSelected); + } + + const localVarHttpContext: HttpContext = options?.context ?? new HttpContext(); + + const localVarTransferCache: boolean = options?.transferCache ?? true; + + + let responseType_: 'text' | 'json' | 'blob' = 'json'; + if (localVarHttpHeaderAcceptSelected) { + if (localVarHttpHeaderAcceptSelected.startsWith('text')) { + responseType_ = 'text'; + } else if (this.configuration.isJsonMime(localVarHttpHeaderAcceptSelected)) { + responseType_ = 'json'; + } else { + responseType_ = 'blob'; + } + } + + let localVarPath = `/api/v2/institutions/ids`; + const { basePath, withCredentials } = this.configuration; + return this.httpClient.request('get', `${basePath}${localVarPath}`, + { + context: localVarHttpContext, + params: localVarQueryParameters, + responseType: responseType_, + ...(withCredentials ? { withCredentials } : {}), + headers: localVarHeaders, + observe: observe, + ...(localVarTransferCache !== undefined ? { transferCache: localVarTransferCache } : {}), + reportProgress: reportProgress + } + ); + } + +} diff --git a/webapp/src/app/api/api/keywords.service.ts b/webapp/src/app/api/api/keywords.service.ts index 6aed478b..fa73019b 100644 --- a/webapp/src/app/api/api/keywords.service.ts +++ b/webapp/src/app/api/api/keywords.service.ts @@ -1,7 +1,7 @@ /** * Innovation Search Engine API * - * + * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech @@ -9,18 +9,12 @@ */ /* tslint:disable:no-unused-variable member-ordering */ -import { Inject, Injectable, Optional } from '@angular/core'; -import { - HttpClient, - HttpHeaders, - HttpParams, - HttpResponse, - HttpEvent, - HttpParameterCodec, - HttpContext, -} from '@angular/common/http'; -import { CustomHttpParameterCodec } from '../encoder'; -import { Observable } from 'rxjs'; +import { Inject, Injectable, Optional } from '@angular/core'; +import { HttpClient, HttpHeaders, HttpParams, + HttpResponse, HttpEvent, HttpParameterCodec, HttpContext + } from '@angular/common/http'; +import { CustomHttpParameterCodec } from '../encoder'; +import { Observable } from 'rxjs'; // @ts-ignore import { ExtractedKeywordsResponse } from '../model/extractedKeywordsResponse'; @@ -34,250 +28,149 @@ import { PatentsByKeywordsRequest } from '../model/patentsByKeywordsRequest'; import { PatentsByKeywordsResponse } from '../model/patentsByKeywordsResponse'; // @ts-ignore -import { BASE_PATH, COLLECTION_FORMATS } from '../variables'; -import { Configuration } from '../configuration'; +import { BASE_PATH, COLLECTION_FORMATS } from '../variables'; +import { Configuration } from '../configuration'; import { BaseService } from '../api.base.service'; + + @Injectable({ - providedIn: 'root', + providedIn: 'root' }) export class KeywordsService extends BaseService { - constructor( - protected httpClient: HttpClient, - @Optional() @Inject(BASE_PATH) basePath: string | string[], - @Optional() configuration?: Configuration, - ) { - super(basePath, configuration); - } - /** - * Extracts keywords from text. - * @endpoint post /api/inse-service/keywords/extract - * @param keywordsRequest - * @param observe set whether or not to return the data Observable as the body, response or events. defaults to returning the body. - * @param reportProgress flag to report request and response progress. - */ - public extractKeywords( - keywordsRequest: KeywordsRequest, - observe?: 'body', - reportProgress?: boolean, - options?: { - httpHeaderAccept?: 'application/json'; - context?: HttpContext; - transferCache?: boolean; - }, - ): Observable; - public extractKeywords( - keywordsRequest: KeywordsRequest, - observe?: 'response', - reportProgress?: boolean, - options?: { - httpHeaderAccept?: 'application/json'; - context?: HttpContext; - transferCache?: boolean; - }, - ): Observable>; - public extractKeywords( - keywordsRequest: KeywordsRequest, - observe?: 'events', - reportProgress?: boolean, - options?: { - httpHeaderAccept?: 'application/json'; - context?: HttpContext; - transferCache?: boolean; - }, - ): Observable>; - public extractKeywords( - keywordsRequest: KeywordsRequest, - observe: any = 'body', - reportProgress: boolean = false, - options?: { - httpHeaderAccept?: 'application/json'; - context?: HttpContext; - transferCache?: boolean; - }, - ): Observable { - if (keywordsRequest === null || keywordsRequest === undefined) { - throw new Error( - 'Required parameter keywordsRequest was null or undefined when calling extractKeywords.', - ); + constructor(protected httpClient: HttpClient, @Optional() @Inject(BASE_PATH) basePath: string|string[], @Optional() configuration?: Configuration) { + super(basePath, configuration); } - let localVarHeaders = this.defaultHeaders; + /** + * Extracts keywords from text. + * @endpoint post /api/inse-service/keywords/extract + * @param keywordsRequest + * @param observe set whether or not to return the data Observable as the body, response or events. defaults to returning the body. + * @param reportProgress flag to report request and response progress. + */ + public extractKeywords(keywordsRequest: KeywordsRequest, observe?: 'body', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable; + public extractKeywords(keywordsRequest: KeywordsRequest, observe?: 'response', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable>; + public extractKeywords(keywordsRequest: KeywordsRequest, observe?: 'events', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable>; + public extractKeywords(keywordsRequest: KeywordsRequest, observe: any = 'body', reportProgress: boolean = false, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable { + if (keywordsRequest === null || keywordsRequest === undefined) { + throw new Error('Required parameter keywordsRequest was null or undefined when calling extractKeywords.'); + } - const localVarHttpHeaderAcceptSelected: string | undefined = - options?.httpHeaderAccept ?? - this.configuration.selectHeaderAccept(['application/json']); - if (localVarHttpHeaderAcceptSelected !== undefined) { - localVarHeaders = localVarHeaders.set( - 'Accept', - localVarHttpHeaderAcceptSelected, - ); + let localVarHeaders = this.defaultHeaders; + + const localVarHttpHeaderAcceptSelected: string | undefined = options?.httpHeaderAccept ?? this.configuration.selectHeaderAccept([ + 'application/json' + ]); + if (localVarHttpHeaderAcceptSelected !== undefined) { + localVarHeaders = localVarHeaders.set('Accept', localVarHttpHeaderAcceptSelected); + } + + const localVarHttpContext: HttpContext = options?.context ?? new HttpContext(); + + const localVarTransferCache: boolean = options?.transferCache ?? true; + + + // to determine the Content-Type header + const consumes: string[] = [ + 'application/json' + ]; + const httpContentTypeSelected: string | undefined = this.configuration.selectHeaderContentType(consumes); + if (httpContentTypeSelected !== undefined) { + localVarHeaders = localVarHeaders.set('Content-Type', httpContentTypeSelected); + } + + let responseType_: 'text' | 'json' | 'blob' = 'json'; + if (localVarHttpHeaderAcceptSelected) { + if (localVarHttpHeaderAcceptSelected.startsWith('text')) { + responseType_ = 'text'; + } else if (this.configuration.isJsonMime(localVarHttpHeaderAcceptSelected)) { + responseType_ = 'json'; + } else { + responseType_ = 'blob'; + } + } + + let localVarPath = `/api/inse-service/keywords/extract`; + const { basePath, withCredentials } = this.configuration; + return this.httpClient.request('post', `${basePath}${localVarPath}`, + { + context: localVarHttpContext, + body: keywordsRequest, + responseType: responseType_, + ...(withCredentials ? { withCredentials } : {}), + headers: localVarHeaders, + observe: observe, + ...(localVarTransferCache !== undefined ? { transferCache: localVarTransferCache } : {}), + reportProgress: reportProgress + } + ); } - const localVarHttpContext: HttpContext = - options?.context ?? new HttpContext(); + /** + * Find patents matching extracted OpenAlex keywords. + * @endpoint post /api/inse-service/keywords/patents + * @param patentsByKeywordsRequest + * @param observe set whether or not to return the data Observable as the body, response or events. defaults to returning the body. + * @param reportProgress flag to report request and response progress. + */ + public getPatentsByKeywords(patentsByKeywordsRequest: PatentsByKeywordsRequest, observe?: 'body', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable; + public getPatentsByKeywords(patentsByKeywordsRequest: PatentsByKeywordsRequest, observe?: 'response', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable>; + public getPatentsByKeywords(patentsByKeywordsRequest: PatentsByKeywordsRequest, observe?: 'events', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable>; + public getPatentsByKeywords(patentsByKeywordsRequest: PatentsByKeywordsRequest, observe: any = 'body', reportProgress: boolean = false, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable { + if (patentsByKeywordsRequest === null || patentsByKeywordsRequest === undefined) { + throw new Error('Required parameter patentsByKeywordsRequest was null or undefined when calling getPatentsByKeywords.'); + } - const localVarTransferCache: boolean = options?.transferCache ?? true; + let localVarHeaders = this.defaultHeaders; - // to determine the Content-Type header - const consumes: string[] = ['application/json']; - const httpContentTypeSelected: string | undefined = - this.configuration.selectHeaderContentType(consumes); - if (httpContentTypeSelected !== undefined) { - localVarHeaders = localVarHeaders.set( - 'Content-Type', - httpContentTypeSelected, - ); + const localVarHttpHeaderAcceptSelected: string | undefined = options?.httpHeaderAccept ?? this.configuration.selectHeaderAccept([ + 'application/json' + ]); + if (localVarHttpHeaderAcceptSelected !== undefined) { + localVarHeaders = localVarHeaders.set('Accept', localVarHttpHeaderAcceptSelected); + } + + const localVarHttpContext: HttpContext = options?.context ?? new HttpContext(); + + const localVarTransferCache: boolean = options?.transferCache ?? true; + + + // to determine the Content-Type header + const consumes: string[] = [ + 'application/json' + ]; + const httpContentTypeSelected: string | undefined = this.configuration.selectHeaderContentType(consumes); + if (httpContentTypeSelected !== undefined) { + localVarHeaders = localVarHeaders.set('Content-Type', httpContentTypeSelected); + } + + let responseType_: 'text' | 'json' | 'blob' = 'json'; + if (localVarHttpHeaderAcceptSelected) { + if (localVarHttpHeaderAcceptSelected.startsWith('text')) { + responseType_ = 'text'; + } else if (this.configuration.isJsonMime(localVarHttpHeaderAcceptSelected)) { + responseType_ = 'json'; + } else { + responseType_ = 'blob'; + } + } + + let localVarPath = `/api/inse-service/keywords/patents`; + const { basePath, withCredentials } = this.configuration; + return this.httpClient.request('post', `${basePath}${localVarPath}`, + { + context: localVarHttpContext, + body: patentsByKeywordsRequest, + responseType: responseType_, + ...(withCredentials ? { withCredentials } : {}), + headers: localVarHeaders, + observe: observe, + ...(localVarTransferCache !== undefined ? { transferCache: localVarTransferCache } : {}), + reportProgress: reportProgress + } + ); } - let responseType_: 'text' | 'json' | 'blob' = 'json'; - if (localVarHttpHeaderAcceptSelected) { - if (localVarHttpHeaderAcceptSelected.startsWith('text')) { - responseType_ = 'text'; - } else if ( - this.configuration.isJsonMime(localVarHttpHeaderAcceptSelected) - ) { - responseType_ = 'json'; - } else { - responseType_ = 'blob'; - } - } - - let localVarPath = `/api/inse-service/keywords/extract`; - const { basePath, withCredentials } = this.configuration; - return this.httpClient.request( - 'post', - `${basePath}${localVarPath}`, - { - context: localVarHttpContext, - body: keywordsRequest, - responseType: responseType_, - ...(withCredentials ? { withCredentials } : {}), - headers: localVarHeaders, - observe: observe, - ...(localVarTransferCache !== undefined - ? { transferCache: localVarTransferCache } - : {}), - reportProgress: reportProgress, - }, - ); - } - - /** - * Find patents matching extracted OpenAlex keywords. - * @endpoint post /api/inse-service/keywords/patents - * @param patentsByKeywordsRequest - * @param observe set whether or not to return the data Observable as the body, response or events. defaults to returning the body. - * @param reportProgress flag to report request and response progress. - */ - public getPatentsByKeywords( - patentsByKeywordsRequest: PatentsByKeywordsRequest, - observe?: 'body', - reportProgress?: boolean, - options?: { - httpHeaderAccept?: 'application/json'; - context?: HttpContext; - transferCache?: boolean; - }, - ): Observable; - public getPatentsByKeywords( - patentsByKeywordsRequest: PatentsByKeywordsRequest, - observe?: 'response', - reportProgress?: boolean, - options?: { - httpHeaderAccept?: 'application/json'; - context?: HttpContext; - transferCache?: boolean; - }, - ): Observable>; - public getPatentsByKeywords( - patentsByKeywordsRequest: PatentsByKeywordsRequest, - observe?: 'events', - reportProgress?: boolean, - options?: { - httpHeaderAccept?: 'application/json'; - context?: HttpContext; - transferCache?: boolean; - }, - ): Observable>; - public getPatentsByKeywords( - patentsByKeywordsRequest: PatentsByKeywordsRequest, - observe: any = 'body', - reportProgress: boolean = false, - options?: { - httpHeaderAccept?: 'application/json'; - context?: HttpContext; - transferCache?: boolean; - }, - ): Observable { - if ( - patentsByKeywordsRequest === null || - patentsByKeywordsRequest === undefined - ) { - throw new Error( - 'Required parameter patentsByKeywordsRequest was null or undefined when calling getPatentsByKeywords.', - ); - } - - let localVarHeaders = this.defaultHeaders; - - const localVarHttpHeaderAcceptSelected: string | undefined = - options?.httpHeaderAccept ?? - this.configuration.selectHeaderAccept(['application/json']); - if (localVarHttpHeaderAcceptSelected !== undefined) { - localVarHeaders = localVarHeaders.set( - 'Accept', - localVarHttpHeaderAcceptSelected, - ); - } - - const localVarHttpContext: HttpContext = - options?.context ?? new HttpContext(); - - const localVarTransferCache: boolean = options?.transferCache ?? true; - - // to determine the Content-Type header - const consumes: string[] = ['application/json']; - const httpContentTypeSelected: string | undefined = - this.configuration.selectHeaderContentType(consumes); - if (httpContentTypeSelected !== undefined) { - localVarHeaders = localVarHeaders.set( - 'Content-Type', - httpContentTypeSelected, - ); - } - - let responseType_: 'text' | 'json' | 'blob' = 'json'; - if (localVarHttpHeaderAcceptSelected) { - if (localVarHttpHeaderAcceptSelected.startsWith('text')) { - responseType_ = 'text'; - } else if ( - this.configuration.isJsonMime(localVarHttpHeaderAcceptSelected) - ) { - responseType_ = 'json'; - } else { - responseType_ = 'blob'; - } - } - - let localVarPath = `/api/inse-service/keywords/patents`; - const { basePath, withCredentials } = this.configuration; - return this.httpClient.request( - 'post', - `${basePath}${localVarPath}`, - { - context: localVarHttpContext, - body: patentsByKeywordsRequest, - responseType: responseType_, - ...(withCredentials ? { withCredentials } : {}), - headers: localVarHeaders, - observe: observe, - ...(localVarTransferCache !== undefined - ? { transferCache: localVarTransferCache } - : {}), - reportProgress: reportProgress, - }, - ); - } } diff --git a/webapp/src/app/api/api/news.service.ts b/webapp/src/app/api/api/news.service.ts index eb6e0f11..8ff477cf 100644 --- a/webapp/src/app/api/api/news.service.ts +++ b/webapp/src/app/api/api/news.service.ts @@ -1,7 +1,7 @@ /** * Innovation Search Engine API * - * + * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech @@ -9,18 +9,12 @@ */ /* tslint:disable:no-unused-variable member-ordering */ -import { Inject, Injectable, Optional } from '@angular/core'; -import { - HttpClient, - HttpHeaders, - HttpParams, - HttpResponse, - HttpEvent, - HttpParameterCodec, - HttpContext, -} from '@angular/common/http'; -import { CustomHttpParameterCodec } from '../encoder'; -import { Observable } from 'rxjs'; +import { Inject, Injectable, Optional } from '@angular/core'; +import { HttpClient, HttpHeaders, HttpParams, + HttpResponse, HttpEvent, HttpParameterCodec, HttpContext + } from '@angular/common/http'; +import { CustomHttpParameterCodec } from '../encoder'; +import { Observable } from 'rxjs'; // @ts-ignore import { HTTPValidationError } from '../model/hTTPValidationError'; @@ -30,1151 +24,567 @@ import { NewsArticleDetail } from '../model/newsArticleDetail'; import { NewsPage } from '../model/newsPage'; // @ts-ignore -import { BASE_PATH, COLLECTION_FORMATS } from '../variables'; -import { Configuration } from '../configuration'; +import { BASE_PATH, COLLECTION_FORMATS } from '../variables'; +import { Configuration } from '../configuration'; import { BaseService } from '../api.base.service'; + + @Injectable({ - providedIn: 'root', + providedIn: 'root' }) export class NewsService extends BaseService { - constructor( - protected httpClient: HttpClient, - @Optional() @Inject(BASE_PATH) basePath: string | string[], - @Optional() configuration?: Configuration, - ) { - super(basePath, configuration); - } - /** - * Returns news articles in which the given person is mentioned. - * @endpoint get /api/news/by-author - * @param authorId OpenAlex author id, e.g. A5034365278. - * @param page Page number (1-based). - * @param pageSize Articles per page. - * @param sortOrder Sort order: \'desc\' (newest first) or \'asc\' (oldest first). - * @param query Optional search term, matched against title/author. - * @param observe set whether or not to return the data Observable as the body, response or events. defaults to returning the body. - * @param reportProgress flag to report request and response progress. - */ - public getNewsByAuthor( - authorId: string, - page?: number, - pageSize?: number, - sortOrder?: string, - query?: string, - observe?: 'body', - reportProgress?: boolean, - options?: { - httpHeaderAccept?: 'application/json'; - context?: HttpContext; - transferCache?: boolean; - }, - ): Observable; - public getNewsByAuthor( - authorId: string, - page?: number, - pageSize?: number, - sortOrder?: string, - query?: string, - observe?: 'response', - reportProgress?: boolean, - options?: { - httpHeaderAccept?: 'application/json'; - context?: HttpContext; - transferCache?: boolean; - }, - ): Observable>; - public getNewsByAuthor( - authorId: string, - page?: number, - pageSize?: number, - sortOrder?: string, - query?: string, - observe?: 'events', - reportProgress?: boolean, - options?: { - httpHeaderAccept?: 'application/json'; - context?: HttpContext; - transferCache?: boolean; - }, - ): Observable>; - public getNewsByAuthor( - authorId: string, - page?: number, - pageSize?: number, - sortOrder?: string, - query?: string, - observe: any = 'body', - reportProgress: boolean = false, - options?: { - httpHeaderAccept?: 'application/json'; - context?: HttpContext; - transferCache?: boolean; - }, - ): Observable { - if (authorId === null || authorId === undefined) { - throw new Error( - 'Required parameter authorId was null or undefined when calling getNewsByAuthor.', - ); + constructor(protected httpClient: HttpClient, @Optional() @Inject(BASE_PATH) basePath: string|string[], @Optional() configuration?: Configuration) { + super(basePath, configuration); } - let localVarQueryParameters = new HttpParams({ encoder: this.encoder }); - localVarQueryParameters = this.addToHttpParams( - localVarQueryParameters, - authorId, - 'authorId', - ); - localVarQueryParameters = this.addToHttpParams( - localVarQueryParameters, - page, - 'page', - ); - localVarQueryParameters = this.addToHttpParams( - localVarQueryParameters, - pageSize, - 'pageSize', - ); - localVarQueryParameters = this.addToHttpParams( - localVarQueryParameters, - sortOrder, - 'sortOrder', - ); - localVarQueryParameters = this.addToHttpParams( - localVarQueryParameters, - query, - 'query', - ); + /** + * Returns news articles in which the given person is mentioned. + * @endpoint get /api/news/by-author + * @param authorId OpenAlex author id, e.g. A5034365278. + * @param page Page number (1-based). + * @param pageSize Articles per page. + * @param sortOrder Sort order: \'desc\' (newest first) or \'asc\' (oldest first). + * @param query Optional search term, matched against title/author. + * @param observe set whether or not to return the data Observable as the body, response or events. defaults to returning the body. + * @param reportProgress flag to report request and response progress. + */ + public getNewsByAuthor(authorId: string, page?: number, pageSize?: number, sortOrder?: string, query?: string, observe?: 'body', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable; + public getNewsByAuthor(authorId: string, page?: number, pageSize?: number, sortOrder?: string, query?: string, observe?: 'response', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable>; + public getNewsByAuthor(authorId: string, page?: number, pageSize?: number, sortOrder?: string, query?: string, observe?: 'events', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable>; + public getNewsByAuthor(authorId: string, page?: number, pageSize?: number, sortOrder?: string, query?: string, observe: any = 'body', reportProgress: boolean = false, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable { + if (authorId === null || authorId === undefined) { + throw new Error('Required parameter authorId was null or undefined when calling getNewsByAuthor.'); + } - let localVarHeaders = this.defaultHeaders; + let localVarQueryParameters = new HttpParams({encoder: this.encoder}); + localVarQueryParameters = this.addToHttpParams(localVarQueryParameters, + authorId, 'authorId'); + localVarQueryParameters = this.addToHttpParams(localVarQueryParameters, + page, 'page'); + localVarQueryParameters = this.addToHttpParams(localVarQueryParameters, + pageSize, 'pageSize'); + localVarQueryParameters = this.addToHttpParams(localVarQueryParameters, + sortOrder, 'sortOrder'); + localVarQueryParameters = this.addToHttpParams(localVarQueryParameters, + query, 'query'); - const localVarHttpHeaderAcceptSelected: string | undefined = - options?.httpHeaderAccept ?? - this.configuration.selectHeaderAccept(['application/json']); - if (localVarHttpHeaderAcceptSelected !== undefined) { - localVarHeaders = localVarHeaders.set( - 'Accept', - localVarHttpHeaderAcceptSelected, - ); + let localVarHeaders = this.defaultHeaders; + + const localVarHttpHeaderAcceptSelected: string | undefined = options?.httpHeaderAccept ?? this.configuration.selectHeaderAccept([ + 'application/json' + ]); + if (localVarHttpHeaderAcceptSelected !== undefined) { + localVarHeaders = localVarHeaders.set('Accept', localVarHttpHeaderAcceptSelected); + } + + const localVarHttpContext: HttpContext = options?.context ?? new HttpContext(); + + const localVarTransferCache: boolean = options?.transferCache ?? true; + + + let responseType_: 'text' | 'json' | 'blob' = 'json'; + if (localVarHttpHeaderAcceptSelected) { + if (localVarHttpHeaderAcceptSelected.startsWith('text')) { + responseType_ = 'text'; + } else if (this.configuration.isJsonMime(localVarHttpHeaderAcceptSelected)) { + responseType_ = 'json'; + } else { + responseType_ = 'blob'; + } + } + + let localVarPath = `/api/news/by-author`; + const { basePath, withCredentials } = this.configuration; + return this.httpClient.request('get', `${basePath}${localVarPath}`, + { + context: localVarHttpContext, + params: localVarQueryParameters, + responseType: responseType_, + ...(withCredentials ? { withCredentials } : {}), + headers: localVarHeaders, + observe: observe, + ...(localVarTransferCache !== undefined ? { transferCache: localVarTransferCache } : {}), + reportProgress: reportProgress + } + ); } - const localVarHttpContext: HttpContext = - options?.context ?? new HttpContext(); + /** + * Returns news articles in which the given person is mentioned. + * @endpoint get /api/news/by-author + * @param authorId OpenAlex author id, e.g. A5034365278. + * @param page Page number (1-based). + * @param pageSize Articles per page. + * @param sortOrder Sort order: \'desc\' (newest first) or \'asc\' (oldest first). + * @param query Optional search term, matched against title/author. + * @param observe set whether or not to return the data Observable as the body, response or events. defaults to returning the body. + * @param reportProgress flag to report request and response progress. + */ + public getNewsByAuthor_1(authorId: string, page?: number, pageSize?: number, sortOrder?: string, query?: string, observe?: 'body', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable; + public getNewsByAuthor_1(authorId: string, page?: number, pageSize?: number, sortOrder?: string, query?: string, observe?: 'response', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable>; + public getNewsByAuthor_1(authorId: string, page?: number, pageSize?: number, sortOrder?: string, query?: string, observe?: 'events', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable>; + public getNewsByAuthor_1(authorId: string, page?: number, pageSize?: number, sortOrder?: string, query?: string, observe: any = 'body', reportProgress: boolean = false, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable { + if (authorId === null || authorId === undefined) { + throw new Error('Required parameter authorId was null or undefined when calling getNewsByAuthor_1.'); + } - const localVarTransferCache: boolean = options?.transferCache ?? true; + let localVarQueryParameters = new HttpParams({encoder: this.encoder}); + localVarQueryParameters = this.addToHttpParams(localVarQueryParameters, + authorId, 'authorId'); + localVarQueryParameters = this.addToHttpParams(localVarQueryParameters, + page, 'page'); + localVarQueryParameters = this.addToHttpParams(localVarQueryParameters, + pageSize, 'pageSize'); + localVarQueryParameters = this.addToHttpParams(localVarQueryParameters, + sortOrder, 'sortOrder'); + localVarQueryParameters = this.addToHttpParams(localVarQueryParameters, + query, 'query'); - let responseType_: 'text' | 'json' | 'blob' = 'json'; - if (localVarHttpHeaderAcceptSelected) { - if (localVarHttpHeaderAcceptSelected.startsWith('text')) { - responseType_ = 'text'; - } else if ( - this.configuration.isJsonMime(localVarHttpHeaderAcceptSelected) - ) { - responseType_ = 'json'; - } else { - responseType_ = 'blob'; - } + let localVarHeaders = this.defaultHeaders; + + const localVarHttpHeaderAcceptSelected: string | undefined = options?.httpHeaderAccept ?? this.configuration.selectHeaderAccept([ + 'application/json' + ]); + if (localVarHttpHeaderAcceptSelected !== undefined) { + localVarHeaders = localVarHeaders.set('Accept', localVarHttpHeaderAcceptSelected); + } + + const localVarHttpContext: HttpContext = options?.context ?? new HttpContext(); + + const localVarTransferCache: boolean = options?.transferCache ?? true; + + + let responseType_: 'text' | 'json' | 'blob' = 'json'; + if (localVarHttpHeaderAcceptSelected) { + if (localVarHttpHeaderAcceptSelected.startsWith('text')) { + responseType_ = 'text'; + } else if (this.configuration.isJsonMime(localVarHttpHeaderAcceptSelected)) { + responseType_ = 'json'; + } else { + responseType_ = 'blob'; + } + } + + let localVarPath = `/api/news/by-author`; + const { basePath, withCredentials } = this.configuration; + return this.httpClient.request('get', `${basePath}${localVarPath}`, + { + context: localVarHttpContext, + params: localVarQueryParameters, + responseType: responseType_, + ...(withCredentials ? { withCredentials } : {}), + headers: localVarHeaders, + observe: observe, + ...(localVarTransferCache !== undefined ? { transferCache: localVarTransferCache } : {}), + reportProgress: reportProgress + } + ); } - let localVarPath = `/api/news/by-author`; - const { basePath, withCredentials } = this.configuration; - return this.httpClient.request( - 'get', - `${basePath}${localVarPath}`, - { - context: localVarHttpContext, - params: localVarQueryParameters, - responseType: responseType_, - ...(withCredentials ? { withCredentials } : {}), - headers: localVarHeaders, - observe: observe, - ...(localVarTransferCache !== undefined - ? { transferCache: localVarTransferCache } - : {}), - reportProgress: reportProgress, - }, - ); - } + /** + * Returns a single news article including its full content. + * @endpoint get /api/news/{news_id} + * @param newsId The unique id of the news article (Elasticsearch _id). + * @param observe set whether or not to return the data Observable as the body, response or events. defaults to returning the body. + * @param reportProgress flag to report request and response progress. + */ + public getNewsById(newsId: string, observe?: 'body', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable; + public getNewsById(newsId: string, observe?: 'response', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable>; + public getNewsById(newsId: string, observe?: 'events', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable>; + public getNewsById(newsId: string, observe: any = 'body', reportProgress: boolean = false, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable { + if (newsId === null || newsId === undefined) { + throw new Error('Required parameter newsId was null or undefined when calling getNewsById.'); + } - /** - * Returns news articles in which the given person is mentioned. - * @endpoint get /api/news/by-author - * @param authorId OpenAlex author id, e.g. A5034365278. - * @param page Page number (1-based). - * @param pageSize Articles per page. - * @param sortOrder Sort order: \'desc\' (newest first) or \'asc\' (oldest first). - * @param query Optional search term, matched against title/author. - * @param observe set whether or not to return the data Observable as the body, response or events. defaults to returning the body. - * @param reportProgress flag to report request and response progress. - */ - public getNewsByAuthor_1( - authorId: string, - page?: number, - pageSize?: number, - sortOrder?: string, - query?: string, - observe?: 'body', - reportProgress?: boolean, - options?: { - httpHeaderAccept?: 'application/json'; - context?: HttpContext; - transferCache?: boolean; - }, - ): Observable; - public getNewsByAuthor_1( - authorId: string, - page?: number, - pageSize?: number, - sortOrder?: string, - query?: string, - observe?: 'response', - reportProgress?: boolean, - options?: { - httpHeaderAccept?: 'application/json'; - context?: HttpContext; - transferCache?: boolean; - }, - ): Observable>; - public getNewsByAuthor_1( - authorId: string, - page?: number, - pageSize?: number, - sortOrder?: string, - query?: string, - observe?: 'events', - reportProgress?: boolean, - options?: { - httpHeaderAccept?: 'application/json'; - context?: HttpContext; - transferCache?: boolean; - }, - ): Observable>; - public getNewsByAuthor_1( - authorId: string, - page?: number, - pageSize?: number, - sortOrder?: string, - query?: string, - observe: any = 'body', - reportProgress: boolean = false, - options?: { - httpHeaderAccept?: 'application/json'; - context?: HttpContext; - transferCache?: boolean; - }, - ): Observable { - if (authorId === null || authorId === undefined) { - throw new Error( - 'Required parameter authorId was null or undefined when calling getNewsByAuthor_1.', - ); + let localVarHeaders = this.defaultHeaders; + + const localVarHttpHeaderAcceptSelected: string | undefined = options?.httpHeaderAccept ?? this.configuration.selectHeaderAccept([ + 'application/json' + ]); + if (localVarHttpHeaderAcceptSelected !== undefined) { + localVarHeaders = localVarHeaders.set('Accept', localVarHttpHeaderAcceptSelected); + } + + const localVarHttpContext: HttpContext = options?.context ?? new HttpContext(); + + const localVarTransferCache: boolean = options?.transferCache ?? true; + + + let responseType_: 'text' | 'json' | 'blob' = 'json'; + if (localVarHttpHeaderAcceptSelected) { + if (localVarHttpHeaderAcceptSelected.startsWith('text')) { + responseType_ = 'text'; + } else if (this.configuration.isJsonMime(localVarHttpHeaderAcceptSelected)) { + responseType_ = 'json'; + } else { + responseType_ = 'blob'; + } + } + + let localVarPath = `/api/news/${this.configuration.encodeParam({name: "newsId", value: newsId, in: "path", style: "simple", explode: false, dataType: "string", dataFormat: undefined})}`; + const { basePath, withCredentials } = this.configuration; + return this.httpClient.request('get', `${basePath}${localVarPath}`, + { + context: localVarHttpContext, + responseType: responseType_, + ...(withCredentials ? { withCredentials } : {}), + headers: localVarHeaders, + observe: observe, + ...(localVarTransferCache !== undefined ? { transferCache: localVarTransferCache } : {}), + reportProgress: reportProgress + } + ); } - let localVarQueryParameters = new HttpParams({ encoder: this.encoder }); - localVarQueryParameters = this.addToHttpParams( - localVarQueryParameters, - authorId, - 'authorId', - ); - localVarQueryParameters = this.addToHttpParams( - localVarQueryParameters, - page, - 'page', - ); - localVarQueryParameters = this.addToHttpParams( - localVarQueryParameters, - pageSize, - 'pageSize', - ); - localVarQueryParameters = this.addToHttpParams( - localVarQueryParameters, - sortOrder, - 'sortOrder', - ); - localVarQueryParameters = this.addToHttpParams( - localVarQueryParameters, - query, - 'query', - ); + /** + * Returns a single news article including its full content. + * @endpoint get /api/news/{news_id} + * @param newsId The unique id of the news article (Elasticsearch _id). + * @param observe set whether or not to return the data Observable as the body, response or events. defaults to returning the body. + * @param reportProgress flag to report request and response progress. + */ + public getNewsById_2(newsId: string, observe?: 'body', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable; + public getNewsById_2(newsId: string, observe?: 'response', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable>; + public getNewsById_2(newsId: string, observe?: 'events', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable>; + public getNewsById_2(newsId: string, observe: any = 'body', reportProgress: boolean = false, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable { + if (newsId === null || newsId === undefined) { + throw new Error('Required parameter newsId was null or undefined when calling getNewsById_2.'); + } - let localVarHeaders = this.defaultHeaders; + let localVarHeaders = this.defaultHeaders; - const localVarHttpHeaderAcceptSelected: string | undefined = - options?.httpHeaderAccept ?? - this.configuration.selectHeaderAccept(['application/json']); - if (localVarHttpHeaderAcceptSelected !== undefined) { - localVarHeaders = localVarHeaders.set( - 'Accept', - localVarHttpHeaderAcceptSelected, - ); + const localVarHttpHeaderAcceptSelected: string | undefined = options?.httpHeaderAccept ?? this.configuration.selectHeaderAccept([ + 'application/json' + ]); + if (localVarHttpHeaderAcceptSelected !== undefined) { + localVarHeaders = localVarHeaders.set('Accept', localVarHttpHeaderAcceptSelected); + } + + const localVarHttpContext: HttpContext = options?.context ?? new HttpContext(); + + const localVarTransferCache: boolean = options?.transferCache ?? true; + + + let responseType_: 'text' | 'json' | 'blob' = 'json'; + if (localVarHttpHeaderAcceptSelected) { + if (localVarHttpHeaderAcceptSelected.startsWith('text')) { + responseType_ = 'text'; + } else if (this.configuration.isJsonMime(localVarHttpHeaderAcceptSelected)) { + responseType_ = 'json'; + } else { + responseType_ = 'blob'; + } + } + + let localVarPath = `/api/news/${this.configuration.encodeParam({name: "newsId", value: newsId, in: "path", style: "simple", explode: false, dataType: "string", dataFormat: undefined})}`; + const { basePath, withCredentials } = this.configuration; + return this.httpClient.request('get', `${basePath}${localVarPath}`, + { + context: localVarHttpContext, + responseType: responseType_, + ...(withCredentials ? { withCredentials } : {}), + headers: localVarHeaders, + observe: observe, + ...(localVarTransferCache !== undefined ? { transferCache: localVarTransferCache } : {}), + reportProgress: reportProgress + } + ); } - const localVarHttpContext: HttpContext = - options?.context ?? new HttpContext(); + /** + * Returns a page of news articles, newest first. + * @endpoint get /api/news + * @param page Page number (1-based). + * @param pageSize Articles per page. + * @param sortOrder Sort order: \'desc\' (newest first) or \'asc\' (oldest first). + * @param relevance Comma-separated relevance filter: \'relevant\', \'not_relevant\'. + * @param yearFrom Earliest publication year (inclusive). + * @param yearTo Latest publication year (inclusive). + * @param observe set whether or not to return the data Observable as the body, response or events. defaults to returning the body. + * @param reportProgress flag to report request and response progress. + */ + public listNews(page?: number, pageSize?: number, sortOrder?: string, relevance?: string, yearFrom?: number, yearTo?: number, observe?: 'body', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable; + public listNews(page?: number, pageSize?: number, sortOrder?: string, relevance?: string, yearFrom?: number, yearTo?: number, observe?: 'response', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable>; + public listNews(page?: number, pageSize?: number, sortOrder?: string, relevance?: string, yearFrom?: number, yearTo?: number, observe?: 'events', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable>; + public listNews(page?: number, pageSize?: number, sortOrder?: string, relevance?: string, yearFrom?: number, yearTo?: number, observe: any = 'body', reportProgress: boolean = false, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable { - const localVarTransferCache: boolean = options?.transferCache ?? true; + let localVarQueryParameters = new HttpParams({encoder: this.encoder}); + localVarQueryParameters = this.addToHttpParams(localVarQueryParameters, + page, 'page'); + localVarQueryParameters = this.addToHttpParams(localVarQueryParameters, + pageSize, 'pageSize'); + localVarQueryParameters = this.addToHttpParams(localVarQueryParameters, + sortOrder, 'sortOrder'); + localVarQueryParameters = this.addToHttpParams(localVarQueryParameters, + relevance, 'relevance'); + localVarQueryParameters = this.addToHttpParams(localVarQueryParameters, + yearFrom, 'yearFrom'); + localVarQueryParameters = this.addToHttpParams(localVarQueryParameters, + yearTo, 'yearTo'); - let responseType_: 'text' | 'json' | 'blob' = 'json'; - if (localVarHttpHeaderAcceptSelected) { - if (localVarHttpHeaderAcceptSelected.startsWith('text')) { - responseType_ = 'text'; - } else if ( - this.configuration.isJsonMime(localVarHttpHeaderAcceptSelected) - ) { - responseType_ = 'json'; - } else { - responseType_ = 'blob'; - } + let localVarHeaders = this.defaultHeaders; + + const localVarHttpHeaderAcceptSelected: string | undefined = options?.httpHeaderAccept ?? this.configuration.selectHeaderAccept([ + 'application/json' + ]); + if (localVarHttpHeaderAcceptSelected !== undefined) { + localVarHeaders = localVarHeaders.set('Accept', localVarHttpHeaderAcceptSelected); + } + + const localVarHttpContext: HttpContext = options?.context ?? new HttpContext(); + + const localVarTransferCache: boolean = options?.transferCache ?? true; + + + let responseType_: 'text' | 'json' | 'blob' = 'json'; + if (localVarHttpHeaderAcceptSelected) { + if (localVarHttpHeaderAcceptSelected.startsWith('text')) { + responseType_ = 'text'; + } else if (this.configuration.isJsonMime(localVarHttpHeaderAcceptSelected)) { + responseType_ = 'json'; + } else { + responseType_ = 'blob'; + } + } + + let localVarPath = `/api/news`; + const { basePath, withCredentials } = this.configuration; + return this.httpClient.request('get', `${basePath}${localVarPath}`, + { + context: localVarHttpContext, + params: localVarQueryParameters, + responseType: responseType_, + ...(withCredentials ? { withCredentials } : {}), + headers: localVarHeaders, + observe: observe, + ...(localVarTransferCache !== undefined ? { transferCache: localVarTransferCache } : {}), + reportProgress: reportProgress + } + ); } - let localVarPath = `/api/news/by-author`; - const { basePath, withCredentials } = this.configuration; - return this.httpClient.request( - 'get', - `${basePath}${localVarPath}`, - { - context: localVarHttpContext, - params: localVarQueryParameters, - responseType: responseType_, - ...(withCredentials ? { withCredentials } : {}), - headers: localVarHeaders, - observe: observe, - ...(localVarTransferCache !== undefined - ? { transferCache: localVarTransferCache } - : {}), - reportProgress: reportProgress, - }, - ); - } + /** + * Returns a page of news articles, newest first. + * @endpoint get /api/news + * @param page Page number (1-based). + * @param pageSize Articles per page. + * @param sortOrder Sort order: \'desc\' (newest first) or \'asc\' (oldest first). + * @param relevance Comma-separated relevance filter: \'relevant\', \'not_relevant\'. + * @param yearFrom Earliest publication year (inclusive). + * @param yearTo Latest publication year (inclusive). + * @param observe set whether or not to return the data Observable as the body, response or events. defaults to returning the body. + * @param reportProgress flag to report request and response progress. + */ + public listNews_3(page?: number, pageSize?: number, sortOrder?: string, relevance?: string, yearFrom?: number, yearTo?: number, observe?: 'body', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable; + public listNews_3(page?: number, pageSize?: number, sortOrder?: string, relevance?: string, yearFrom?: number, yearTo?: number, observe?: 'response', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable>; + public listNews_3(page?: number, pageSize?: number, sortOrder?: string, relevance?: string, yearFrom?: number, yearTo?: number, observe?: 'events', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable>; + public listNews_3(page?: number, pageSize?: number, sortOrder?: string, relevance?: string, yearFrom?: number, yearTo?: number, observe: any = 'body', reportProgress: boolean = false, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable { - /** - * Returns a single news article including its full content. - * @endpoint get /api/news/{news_id} - * @param newsId The unique id of the news article (Elasticsearch _id). - * @param observe set whether or not to return the data Observable as the body, response or events. defaults to returning the body. - * @param reportProgress flag to report request and response progress. - */ - public getNewsById( - newsId: string, - observe?: 'body', - reportProgress?: boolean, - options?: { - httpHeaderAccept?: 'application/json'; - context?: HttpContext; - transferCache?: boolean; - }, - ): Observable; - public getNewsById( - newsId: string, - observe?: 'response', - reportProgress?: boolean, - options?: { - httpHeaderAccept?: 'application/json'; - context?: HttpContext; - transferCache?: boolean; - }, - ): Observable>; - public getNewsById( - newsId: string, - observe?: 'events', - reportProgress?: boolean, - options?: { - httpHeaderAccept?: 'application/json'; - context?: HttpContext; - transferCache?: boolean; - }, - ): Observable>; - public getNewsById( - newsId: string, - observe: any = 'body', - reportProgress: boolean = false, - options?: { - httpHeaderAccept?: 'application/json'; - context?: HttpContext; - transferCache?: boolean; - }, - ): Observable { - if (newsId === null || newsId === undefined) { - throw new Error( - 'Required parameter newsId was null or undefined when calling getNewsById.', - ); + let localVarQueryParameters = new HttpParams({encoder: this.encoder}); + localVarQueryParameters = this.addToHttpParams(localVarQueryParameters, + page, 'page'); + localVarQueryParameters = this.addToHttpParams(localVarQueryParameters, + pageSize, 'pageSize'); + localVarQueryParameters = this.addToHttpParams(localVarQueryParameters, + sortOrder, 'sortOrder'); + localVarQueryParameters = this.addToHttpParams(localVarQueryParameters, + relevance, 'relevance'); + localVarQueryParameters = this.addToHttpParams(localVarQueryParameters, + yearFrom, 'yearFrom'); + localVarQueryParameters = this.addToHttpParams(localVarQueryParameters, + yearTo, 'yearTo'); + + let localVarHeaders = this.defaultHeaders; + + const localVarHttpHeaderAcceptSelected: string | undefined = options?.httpHeaderAccept ?? this.configuration.selectHeaderAccept([ + 'application/json' + ]); + if (localVarHttpHeaderAcceptSelected !== undefined) { + localVarHeaders = localVarHeaders.set('Accept', localVarHttpHeaderAcceptSelected); + } + + const localVarHttpContext: HttpContext = options?.context ?? new HttpContext(); + + const localVarTransferCache: boolean = options?.transferCache ?? true; + + + let responseType_: 'text' | 'json' | 'blob' = 'json'; + if (localVarHttpHeaderAcceptSelected) { + if (localVarHttpHeaderAcceptSelected.startsWith('text')) { + responseType_ = 'text'; + } else if (this.configuration.isJsonMime(localVarHttpHeaderAcceptSelected)) { + responseType_ = 'json'; + } else { + responseType_ = 'blob'; + } + } + + let localVarPath = `/api/news`; + const { basePath, withCredentials } = this.configuration; + return this.httpClient.request('get', `${basePath}${localVarPath}`, + { + context: localVarHttpContext, + params: localVarQueryParameters, + responseType: responseType_, + ...(withCredentials ? { withCredentials } : {}), + headers: localVarHeaders, + observe: observe, + ...(localVarTransferCache !== undefined ? { transferCache: localVarTransferCache } : {}), + reportProgress: reportProgress + } + ); } - let localVarHeaders = this.defaultHeaders; + /** + * Searches news articles by full text (full_content). + * @endpoint get /api/news/search + * @param query Search term, matched against the full text (full_content). + * @param page Page number (1-based). + * @param pageSize Articles per page. + * @param relevance Comma-separated relevance filter: \'relevant\', \'not_relevant\'. + * @param yearFrom Earliest publication year (inclusive). + * @param yearTo Latest publication year (inclusive). + * @param observe set whether or not to return the data Observable as the body, response or events. defaults to returning the body. + * @param reportProgress flag to report request and response progress. + */ + public searchNews(query: string, page?: number, pageSize?: number, relevance?: string, yearFrom?: number, yearTo?: number, observe?: 'body', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable; + public searchNews(query: string, page?: number, pageSize?: number, relevance?: string, yearFrom?: number, yearTo?: number, observe?: 'response', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable>; + public searchNews(query: string, page?: number, pageSize?: number, relevance?: string, yearFrom?: number, yearTo?: number, observe?: 'events', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable>; + public searchNews(query: string, page?: number, pageSize?: number, relevance?: string, yearFrom?: number, yearTo?: number, observe: any = 'body', reportProgress: boolean = false, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable { + if (query === null || query === undefined) { + throw new Error('Required parameter query was null or undefined when calling searchNews.'); + } - const localVarHttpHeaderAcceptSelected: string | undefined = - options?.httpHeaderAccept ?? - this.configuration.selectHeaderAccept(['application/json']); - if (localVarHttpHeaderAcceptSelected !== undefined) { - localVarHeaders = localVarHeaders.set( - 'Accept', - localVarHttpHeaderAcceptSelected, - ); + let localVarQueryParameters = new HttpParams({encoder: this.encoder}); + localVarQueryParameters = this.addToHttpParams(localVarQueryParameters, + query, 'query'); + localVarQueryParameters = this.addToHttpParams(localVarQueryParameters, + page, 'page'); + localVarQueryParameters = this.addToHttpParams(localVarQueryParameters, + pageSize, 'pageSize'); + localVarQueryParameters = this.addToHttpParams(localVarQueryParameters, + relevance, 'relevance'); + localVarQueryParameters = this.addToHttpParams(localVarQueryParameters, + yearFrom, 'yearFrom'); + localVarQueryParameters = this.addToHttpParams(localVarQueryParameters, + yearTo, 'yearTo'); + + let localVarHeaders = this.defaultHeaders; + + const localVarHttpHeaderAcceptSelected: string | undefined = options?.httpHeaderAccept ?? this.configuration.selectHeaderAccept([ + 'application/json' + ]); + if (localVarHttpHeaderAcceptSelected !== undefined) { + localVarHeaders = localVarHeaders.set('Accept', localVarHttpHeaderAcceptSelected); + } + + const localVarHttpContext: HttpContext = options?.context ?? new HttpContext(); + + const localVarTransferCache: boolean = options?.transferCache ?? true; + + + let responseType_: 'text' | 'json' | 'blob' = 'json'; + if (localVarHttpHeaderAcceptSelected) { + if (localVarHttpHeaderAcceptSelected.startsWith('text')) { + responseType_ = 'text'; + } else if (this.configuration.isJsonMime(localVarHttpHeaderAcceptSelected)) { + responseType_ = 'json'; + } else { + responseType_ = 'blob'; + } + } + + let localVarPath = `/api/news/search`; + const { basePath, withCredentials } = this.configuration; + return this.httpClient.request('get', `${basePath}${localVarPath}`, + { + context: localVarHttpContext, + params: localVarQueryParameters, + responseType: responseType_, + ...(withCredentials ? { withCredentials } : {}), + headers: localVarHeaders, + observe: observe, + ...(localVarTransferCache !== undefined ? { transferCache: localVarTransferCache } : {}), + reportProgress: reportProgress + } + ); } - const localVarHttpContext: HttpContext = - options?.context ?? new HttpContext(); + /** + * Searches news articles by full text (full_content). + * @endpoint get /api/news/search + * @param query Search term, matched against the full text (full_content). + * @param page Page number (1-based). + * @param pageSize Articles per page. + * @param relevance Comma-separated relevance filter: \'relevant\', \'not_relevant\'. + * @param yearFrom Earliest publication year (inclusive). + * @param yearTo Latest publication year (inclusive). + * @param observe set whether or not to return the data Observable as the body, response or events. defaults to returning the body. + * @param reportProgress flag to report request and response progress. + */ + public searchNews_4(query: string, page?: number, pageSize?: number, relevance?: string, yearFrom?: number, yearTo?: number, observe?: 'body', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable; + public searchNews_4(query: string, page?: number, pageSize?: number, relevance?: string, yearFrom?: number, yearTo?: number, observe?: 'response', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable>; + public searchNews_4(query: string, page?: number, pageSize?: number, relevance?: string, yearFrom?: number, yearTo?: number, observe?: 'events', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable>; + public searchNews_4(query: string, page?: number, pageSize?: number, relevance?: string, yearFrom?: number, yearTo?: number, observe: any = 'body', reportProgress: boolean = false, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable { + if (query === null || query === undefined) { + throw new Error('Required parameter query was null or undefined when calling searchNews_4.'); + } - const localVarTransferCache: boolean = options?.transferCache ?? true; + let localVarQueryParameters = new HttpParams({encoder: this.encoder}); + localVarQueryParameters = this.addToHttpParams(localVarQueryParameters, + query, 'query'); + localVarQueryParameters = this.addToHttpParams(localVarQueryParameters, + page, 'page'); + localVarQueryParameters = this.addToHttpParams(localVarQueryParameters, + pageSize, 'pageSize'); + localVarQueryParameters = this.addToHttpParams(localVarQueryParameters, + relevance, 'relevance'); + localVarQueryParameters = this.addToHttpParams(localVarQueryParameters, + yearFrom, 'yearFrom'); + localVarQueryParameters = this.addToHttpParams(localVarQueryParameters, + yearTo, 'yearTo'); - let responseType_: 'text' | 'json' | 'blob' = 'json'; - if (localVarHttpHeaderAcceptSelected) { - if (localVarHttpHeaderAcceptSelected.startsWith('text')) { - responseType_ = 'text'; - } else if ( - this.configuration.isJsonMime(localVarHttpHeaderAcceptSelected) - ) { - responseType_ = 'json'; - } else { - responseType_ = 'blob'; - } + let localVarHeaders = this.defaultHeaders; + + const localVarHttpHeaderAcceptSelected: string | undefined = options?.httpHeaderAccept ?? this.configuration.selectHeaderAccept([ + 'application/json' + ]); + if (localVarHttpHeaderAcceptSelected !== undefined) { + localVarHeaders = localVarHeaders.set('Accept', localVarHttpHeaderAcceptSelected); + } + + const localVarHttpContext: HttpContext = options?.context ?? new HttpContext(); + + const localVarTransferCache: boolean = options?.transferCache ?? true; + + + let responseType_: 'text' | 'json' | 'blob' = 'json'; + if (localVarHttpHeaderAcceptSelected) { + if (localVarHttpHeaderAcceptSelected.startsWith('text')) { + responseType_ = 'text'; + } else if (this.configuration.isJsonMime(localVarHttpHeaderAcceptSelected)) { + responseType_ = 'json'; + } else { + responseType_ = 'blob'; + } + } + + let localVarPath = `/api/news/search`; + const { basePath, withCredentials } = this.configuration; + return this.httpClient.request('get', `${basePath}${localVarPath}`, + { + context: localVarHttpContext, + params: localVarQueryParameters, + responseType: responseType_, + ...(withCredentials ? { withCredentials } : {}), + headers: localVarHeaders, + observe: observe, + ...(localVarTransferCache !== undefined ? { transferCache: localVarTransferCache } : {}), + reportProgress: reportProgress + } + ); } - let localVarPath = `/api/news/${this.configuration.encodeParam({ name: 'newsId', value: newsId, in: 'path', style: 'simple', explode: false, dataType: 'string', dataFormat: undefined })}`; - const { basePath, withCredentials } = this.configuration; - return this.httpClient.request( - 'get', - `${basePath}${localVarPath}`, - { - context: localVarHttpContext, - responseType: responseType_, - ...(withCredentials ? { withCredentials } : {}), - headers: localVarHeaders, - observe: observe, - ...(localVarTransferCache !== undefined - ? { transferCache: localVarTransferCache } - : {}), - reportProgress: reportProgress, - }, - ); - } - - /** - * Returns a single news article including its full content. - * @endpoint get /api/news/{news_id} - * @param newsId The unique id of the news article (Elasticsearch _id). - * @param observe set whether or not to return the data Observable as the body, response or events. defaults to returning the body. - * @param reportProgress flag to report request and response progress. - */ - public getNewsById_2( - newsId: string, - observe?: 'body', - reportProgress?: boolean, - options?: { - httpHeaderAccept?: 'application/json'; - context?: HttpContext; - transferCache?: boolean; - }, - ): Observable; - public getNewsById_2( - newsId: string, - observe?: 'response', - reportProgress?: boolean, - options?: { - httpHeaderAccept?: 'application/json'; - context?: HttpContext; - transferCache?: boolean; - }, - ): Observable>; - public getNewsById_2( - newsId: string, - observe?: 'events', - reportProgress?: boolean, - options?: { - httpHeaderAccept?: 'application/json'; - context?: HttpContext; - transferCache?: boolean; - }, - ): Observable>; - public getNewsById_2( - newsId: string, - observe: any = 'body', - reportProgress: boolean = false, - options?: { - httpHeaderAccept?: 'application/json'; - context?: HttpContext; - transferCache?: boolean; - }, - ): Observable { - if (newsId === null || newsId === undefined) { - throw new Error( - 'Required parameter newsId was null or undefined when calling getNewsById_2.', - ); - } - - let localVarHeaders = this.defaultHeaders; - - const localVarHttpHeaderAcceptSelected: string | undefined = - options?.httpHeaderAccept ?? - this.configuration.selectHeaderAccept(['application/json']); - if (localVarHttpHeaderAcceptSelected !== undefined) { - localVarHeaders = localVarHeaders.set( - 'Accept', - localVarHttpHeaderAcceptSelected, - ); - } - - const localVarHttpContext: HttpContext = - options?.context ?? new HttpContext(); - - const localVarTransferCache: boolean = options?.transferCache ?? true; - - let responseType_: 'text' | 'json' | 'blob' = 'json'; - if (localVarHttpHeaderAcceptSelected) { - if (localVarHttpHeaderAcceptSelected.startsWith('text')) { - responseType_ = 'text'; - } else if ( - this.configuration.isJsonMime(localVarHttpHeaderAcceptSelected) - ) { - responseType_ = 'json'; - } else { - responseType_ = 'blob'; - } - } - - let localVarPath = `/api/news/${this.configuration.encodeParam({ name: 'newsId', value: newsId, in: 'path', style: 'simple', explode: false, dataType: 'string', dataFormat: undefined })}`; - const { basePath, withCredentials } = this.configuration; - return this.httpClient.request( - 'get', - `${basePath}${localVarPath}`, - { - context: localVarHttpContext, - responseType: responseType_, - ...(withCredentials ? { withCredentials } : {}), - headers: localVarHeaders, - observe: observe, - ...(localVarTransferCache !== undefined - ? { transferCache: localVarTransferCache } - : {}), - reportProgress: reportProgress, - }, - ); - } - - /** - * Returns a page of news articles, newest first. - * @endpoint get /api/news - * @param page Page number (1-based). - * @param pageSize Articles per page. - * @param sortOrder Sort order: \'desc\' (newest first) or \'asc\' (oldest first). - * @param relevance Comma-separated relevance filter: \'relevant\', \'not_relevant\'. - * @param yearFrom Earliest publication year (inclusive). - * @param yearTo Latest publication year (inclusive). - * @param observe set whether or not to return the data Observable as the body, response or events. defaults to returning the body. - * @param reportProgress flag to report request and response progress. - */ - public listNews( - page?: number, - pageSize?: number, - sortOrder?: string, - relevance?: string, - yearFrom?: number, - yearTo?: number, - observe?: 'body', - reportProgress?: boolean, - options?: { - httpHeaderAccept?: 'application/json'; - context?: HttpContext; - transferCache?: boolean; - }, - ): Observable; - public listNews( - page?: number, - pageSize?: number, - sortOrder?: string, - relevance?: string, - yearFrom?: number, - yearTo?: number, - observe?: 'response', - reportProgress?: boolean, - options?: { - httpHeaderAccept?: 'application/json'; - context?: HttpContext; - transferCache?: boolean; - }, - ): Observable>; - public listNews( - page?: number, - pageSize?: number, - sortOrder?: string, - relevance?: string, - yearFrom?: number, - yearTo?: number, - observe?: 'events', - reportProgress?: boolean, - options?: { - httpHeaderAccept?: 'application/json'; - context?: HttpContext; - transferCache?: boolean; - }, - ): Observable>; - public listNews( - page?: number, - pageSize?: number, - sortOrder?: string, - relevance?: string, - yearFrom?: number, - yearTo?: number, - observe: any = 'body', - reportProgress: boolean = false, - options?: { - httpHeaderAccept?: 'application/json'; - context?: HttpContext; - transferCache?: boolean; - }, - ): Observable { - let localVarQueryParameters = new HttpParams({ encoder: this.encoder }); - localVarQueryParameters = this.addToHttpParams( - localVarQueryParameters, - page, - 'page', - ); - localVarQueryParameters = this.addToHttpParams( - localVarQueryParameters, - pageSize, - 'pageSize', - ); - localVarQueryParameters = this.addToHttpParams( - localVarQueryParameters, - sortOrder, - 'sortOrder', - ); - localVarQueryParameters = this.addToHttpParams( - localVarQueryParameters, - relevance, - 'relevance', - ); - localVarQueryParameters = this.addToHttpParams( - localVarQueryParameters, - yearFrom, - 'yearFrom', - ); - localVarQueryParameters = this.addToHttpParams( - localVarQueryParameters, - yearTo, - 'yearTo', - ); - - let localVarHeaders = this.defaultHeaders; - - const localVarHttpHeaderAcceptSelected: string | undefined = - options?.httpHeaderAccept ?? - this.configuration.selectHeaderAccept(['application/json']); - if (localVarHttpHeaderAcceptSelected !== undefined) { - localVarHeaders = localVarHeaders.set( - 'Accept', - localVarHttpHeaderAcceptSelected, - ); - } - - const localVarHttpContext: HttpContext = - options?.context ?? new HttpContext(); - - const localVarTransferCache: boolean = options?.transferCache ?? true; - - let responseType_: 'text' | 'json' | 'blob' = 'json'; - if (localVarHttpHeaderAcceptSelected) { - if (localVarHttpHeaderAcceptSelected.startsWith('text')) { - responseType_ = 'text'; - } else if ( - this.configuration.isJsonMime(localVarHttpHeaderAcceptSelected) - ) { - responseType_ = 'json'; - } else { - responseType_ = 'blob'; - } - } - - let localVarPath = `/api/news`; - const { basePath, withCredentials } = this.configuration; - return this.httpClient.request( - 'get', - `${basePath}${localVarPath}`, - { - context: localVarHttpContext, - params: localVarQueryParameters, - responseType: responseType_, - ...(withCredentials ? { withCredentials } : {}), - headers: localVarHeaders, - observe: observe, - ...(localVarTransferCache !== undefined - ? { transferCache: localVarTransferCache } - : {}), - reportProgress: reportProgress, - }, - ); - } - - /** - * Returns a page of news articles, newest first. - * @endpoint get /api/news - * @param page Page number (1-based). - * @param pageSize Articles per page. - * @param sortOrder Sort order: \'desc\' (newest first) or \'asc\' (oldest first). - * @param relevance Comma-separated relevance filter: \'relevant\', \'not_relevant\'. - * @param yearFrom Earliest publication year (inclusive). - * @param yearTo Latest publication year (inclusive). - * @param observe set whether or not to return the data Observable as the body, response or events. defaults to returning the body. - * @param reportProgress flag to report request and response progress. - */ - public listNews_3( - page?: number, - pageSize?: number, - sortOrder?: string, - relevance?: string, - yearFrom?: number, - yearTo?: number, - observe?: 'body', - reportProgress?: boolean, - options?: { - httpHeaderAccept?: 'application/json'; - context?: HttpContext; - transferCache?: boolean; - }, - ): Observable; - public listNews_3( - page?: number, - pageSize?: number, - sortOrder?: string, - relevance?: string, - yearFrom?: number, - yearTo?: number, - observe?: 'response', - reportProgress?: boolean, - options?: { - httpHeaderAccept?: 'application/json'; - context?: HttpContext; - transferCache?: boolean; - }, - ): Observable>; - public listNews_3( - page?: number, - pageSize?: number, - sortOrder?: string, - relevance?: string, - yearFrom?: number, - yearTo?: number, - observe?: 'events', - reportProgress?: boolean, - options?: { - httpHeaderAccept?: 'application/json'; - context?: HttpContext; - transferCache?: boolean; - }, - ): Observable>; - public listNews_3( - page?: number, - pageSize?: number, - sortOrder?: string, - relevance?: string, - yearFrom?: number, - yearTo?: number, - observe: any = 'body', - reportProgress: boolean = false, - options?: { - httpHeaderAccept?: 'application/json'; - context?: HttpContext; - transferCache?: boolean; - }, - ): Observable { - let localVarQueryParameters = new HttpParams({ encoder: this.encoder }); - localVarQueryParameters = this.addToHttpParams( - localVarQueryParameters, - page, - 'page', - ); - localVarQueryParameters = this.addToHttpParams( - localVarQueryParameters, - pageSize, - 'pageSize', - ); - localVarQueryParameters = this.addToHttpParams( - localVarQueryParameters, - sortOrder, - 'sortOrder', - ); - localVarQueryParameters = this.addToHttpParams( - localVarQueryParameters, - relevance, - 'relevance', - ); - localVarQueryParameters = this.addToHttpParams( - localVarQueryParameters, - yearFrom, - 'yearFrom', - ); - localVarQueryParameters = this.addToHttpParams( - localVarQueryParameters, - yearTo, - 'yearTo', - ); - - let localVarHeaders = this.defaultHeaders; - - const localVarHttpHeaderAcceptSelected: string | undefined = - options?.httpHeaderAccept ?? - this.configuration.selectHeaderAccept(['application/json']); - if (localVarHttpHeaderAcceptSelected !== undefined) { - localVarHeaders = localVarHeaders.set( - 'Accept', - localVarHttpHeaderAcceptSelected, - ); - } - - const localVarHttpContext: HttpContext = - options?.context ?? new HttpContext(); - - const localVarTransferCache: boolean = options?.transferCache ?? true; - - let responseType_: 'text' | 'json' | 'blob' = 'json'; - if (localVarHttpHeaderAcceptSelected) { - if (localVarHttpHeaderAcceptSelected.startsWith('text')) { - responseType_ = 'text'; - } else if ( - this.configuration.isJsonMime(localVarHttpHeaderAcceptSelected) - ) { - responseType_ = 'json'; - } else { - responseType_ = 'blob'; - } - } - - let localVarPath = `/api/news`; - const { basePath, withCredentials } = this.configuration; - return this.httpClient.request( - 'get', - `${basePath}${localVarPath}`, - { - context: localVarHttpContext, - params: localVarQueryParameters, - responseType: responseType_, - ...(withCredentials ? { withCredentials } : {}), - headers: localVarHeaders, - observe: observe, - ...(localVarTransferCache !== undefined - ? { transferCache: localVarTransferCache } - : {}), - reportProgress: reportProgress, - }, - ); - } - - /** - * Searches news articles by full text (full_content). - * @endpoint get /api/news/search - * @param query Search term, matched against the full text (full_content). - * @param page Page number (1-based). - * @param pageSize Articles per page. - * @param relevance Comma-separated relevance filter: \'relevant\', \'not_relevant\'. - * @param yearFrom Earliest publication year (inclusive). - * @param yearTo Latest publication year (inclusive). - * @param observe set whether or not to return the data Observable as the body, response or events. defaults to returning the body. - * @param reportProgress flag to report request and response progress. - */ - public searchNews( - query: string, - page?: number, - pageSize?: number, - relevance?: string, - yearFrom?: number, - yearTo?: number, - observe?: 'body', - reportProgress?: boolean, - options?: { - httpHeaderAccept?: 'application/json'; - context?: HttpContext; - transferCache?: boolean; - }, - ): Observable; - public searchNews( - query: string, - page?: number, - pageSize?: number, - relevance?: string, - yearFrom?: number, - yearTo?: number, - observe?: 'response', - reportProgress?: boolean, - options?: { - httpHeaderAccept?: 'application/json'; - context?: HttpContext; - transferCache?: boolean; - }, - ): Observable>; - public searchNews( - query: string, - page?: number, - pageSize?: number, - relevance?: string, - yearFrom?: number, - yearTo?: number, - observe?: 'events', - reportProgress?: boolean, - options?: { - httpHeaderAccept?: 'application/json'; - context?: HttpContext; - transferCache?: boolean; - }, - ): Observable>; - public searchNews( - query: string, - page?: number, - pageSize?: number, - relevance?: string, - yearFrom?: number, - yearTo?: number, - observe: any = 'body', - reportProgress: boolean = false, - options?: { - httpHeaderAccept?: 'application/json'; - context?: HttpContext; - transferCache?: boolean; - }, - ): Observable { - if (query === null || query === undefined) { - throw new Error( - 'Required parameter query was null or undefined when calling searchNews.', - ); - } - - let localVarQueryParameters = new HttpParams({ encoder: this.encoder }); - localVarQueryParameters = this.addToHttpParams( - localVarQueryParameters, - query, - 'query', - ); - localVarQueryParameters = this.addToHttpParams( - localVarQueryParameters, - page, - 'page', - ); - localVarQueryParameters = this.addToHttpParams( - localVarQueryParameters, - pageSize, - 'pageSize', - ); - localVarQueryParameters = this.addToHttpParams( - localVarQueryParameters, - relevance, - 'relevance', - ); - localVarQueryParameters = this.addToHttpParams( - localVarQueryParameters, - yearFrom, - 'yearFrom', - ); - localVarQueryParameters = this.addToHttpParams( - localVarQueryParameters, - yearTo, - 'yearTo', - ); - - let localVarHeaders = this.defaultHeaders; - - const localVarHttpHeaderAcceptSelected: string | undefined = - options?.httpHeaderAccept ?? - this.configuration.selectHeaderAccept(['application/json']); - if (localVarHttpHeaderAcceptSelected !== undefined) { - localVarHeaders = localVarHeaders.set( - 'Accept', - localVarHttpHeaderAcceptSelected, - ); - } - - const localVarHttpContext: HttpContext = - options?.context ?? new HttpContext(); - - const localVarTransferCache: boolean = options?.transferCache ?? true; - - let responseType_: 'text' | 'json' | 'blob' = 'json'; - if (localVarHttpHeaderAcceptSelected) { - if (localVarHttpHeaderAcceptSelected.startsWith('text')) { - responseType_ = 'text'; - } else if ( - this.configuration.isJsonMime(localVarHttpHeaderAcceptSelected) - ) { - responseType_ = 'json'; - } else { - responseType_ = 'blob'; - } - } - - let localVarPath = `/api/news/search`; - const { basePath, withCredentials } = this.configuration; - return this.httpClient.request( - 'get', - `${basePath}${localVarPath}`, - { - context: localVarHttpContext, - params: localVarQueryParameters, - responseType: responseType_, - ...(withCredentials ? { withCredentials } : {}), - headers: localVarHeaders, - observe: observe, - ...(localVarTransferCache !== undefined - ? { transferCache: localVarTransferCache } - : {}), - reportProgress: reportProgress, - }, - ); - } - - /** - * Searches news articles by full text (full_content). - * @endpoint get /api/news/search - * @param query Search term, matched against the full text (full_content). - * @param page Page number (1-based). - * @param pageSize Articles per page. - * @param relevance Comma-separated relevance filter: \'relevant\', \'not_relevant\'. - * @param yearFrom Earliest publication year (inclusive). - * @param yearTo Latest publication year (inclusive). - * @param observe set whether or not to return the data Observable as the body, response or events. defaults to returning the body. - * @param reportProgress flag to report request and response progress. - */ - public searchNews_4( - query: string, - page?: number, - pageSize?: number, - relevance?: string, - yearFrom?: number, - yearTo?: number, - observe?: 'body', - reportProgress?: boolean, - options?: { - httpHeaderAccept?: 'application/json'; - context?: HttpContext; - transferCache?: boolean; - }, - ): Observable; - public searchNews_4( - query: string, - page?: number, - pageSize?: number, - relevance?: string, - yearFrom?: number, - yearTo?: number, - observe?: 'response', - reportProgress?: boolean, - options?: { - httpHeaderAccept?: 'application/json'; - context?: HttpContext; - transferCache?: boolean; - }, - ): Observable>; - public searchNews_4( - query: string, - page?: number, - pageSize?: number, - relevance?: string, - yearFrom?: number, - yearTo?: number, - observe?: 'events', - reportProgress?: boolean, - options?: { - httpHeaderAccept?: 'application/json'; - context?: HttpContext; - transferCache?: boolean; - }, - ): Observable>; - public searchNews_4( - query: string, - page?: number, - pageSize?: number, - relevance?: string, - yearFrom?: number, - yearTo?: number, - observe: any = 'body', - reportProgress: boolean = false, - options?: { - httpHeaderAccept?: 'application/json'; - context?: HttpContext; - transferCache?: boolean; - }, - ): Observable { - if (query === null || query === undefined) { - throw new Error( - 'Required parameter query was null or undefined when calling searchNews_4.', - ); - } - - let localVarQueryParameters = new HttpParams({ encoder: this.encoder }); - localVarQueryParameters = this.addToHttpParams( - localVarQueryParameters, - query, - 'query', - ); - localVarQueryParameters = this.addToHttpParams( - localVarQueryParameters, - page, - 'page', - ); - localVarQueryParameters = this.addToHttpParams( - localVarQueryParameters, - pageSize, - 'pageSize', - ); - localVarQueryParameters = this.addToHttpParams( - localVarQueryParameters, - relevance, - 'relevance', - ); - localVarQueryParameters = this.addToHttpParams( - localVarQueryParameters, - yearFrom, - 'yearFrom', - ); - localVarQueryParameters = this.addToHttpParams( - localVarQueryParameters, - yearTo, - 'yearTo', - ); - - let localVarHeaders = this.defaultHeaders; - - const localVarHttpHeaderAcceptSelected: string | undefined = - options?.httpHeaderAccept ?? - this.configuration.selectHeaderAccept(['application/json']); - if (localVarHttpHeaderAcceptSelected !== undefined) { - localVarHeaders = localVarHeaders.set( - 'Accept', - localVarHttpHeaderAcceptSelected, - ); - } - - const localVarHttpContext: HttpContext = - options?.context ?? new HttpContext(); - - const localVarTransferCache: boolean = options?.transferCache ?? true; - - let responseType_: 'text' | 'json' | 'blob' = 'json'; - if (localVarHttpHeaderAcceptSelected) { - if (localVarHttpHeaderAcceptSelected.startsWith('text')) { - responseType_ = 'text'; - } else if ( - this.configuration.isJsonMime(localVarHttpHeaderAcceptSelected) - ) { - responseType_ = 'json'; - } else { - responseType_ = 'blob'; - } - } - - let localVarPath = `/api/news/search`; - const { basePath, withCredentials } = this.configuration; - return this.httpClient.request( - 'get', - `${basePath}${localVarPath}`, - { - context: localVarHttpContext, - params: localVarQueryParameters, - responseType: responseType_, - ...(withCredentials ? { withCredentials } : {}), - headers: localVarHeaders, - observe: observe, - ...(localVarTransferCache !== undefined - ? { transferCache: localVarTransferCache } - : {}), - reportProgress: reportProgress, - }, - ); - } } diff --git a/webapp/src/app/api/api/organization.service.ts b/webapp/src/app/api/api/organization.service.ts index 4315e7c1..14fb942d 100644 --- a/webapp/src/app/api/api/organization.service.ts +++ b/webapp/src/app/api/api/organization.service.ts @@ -1,7 +1,7 @@ /** * Innovation Search Engine API * - * + * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech @@ -9,18 +9,12 @@ */ /* tslint:disable:no-unused-variable member-ordering */ -import { Inject, Injectable, Optional } from '@angular/core'; -import { - HttpClient, - HttpHeaders, - HttpParams, - HttpResponse, - HttpEvent, - HttpParameterCodec, - HttpContext, -} from '@angular/common/http'; -import { CustomHttpParameterCodec } from '../encoder'; -import { Observable } from 'rxjs'; +import { Inject, Injectable, Optional } from '@angular/core'; +import { HttpClient, HttpHeaders, HttpParams, + HttpResponse, HttpEvent, HttpParameterCodec, HttpContext + } from '@angular/common/http'; +import { CustomHttpParameterCodec } from '../encoder'; +import { Observable } from 'rxjs'; // @ts-ignore import { CreateOrganizationRequest } from '../model/createOrganizationRequest'; @@ -34,545 +28,287 @@ import { OrganizationPage } from '../model/organizationPage'; import { UpdateOrganizationRequest } from '../model/updateOrganizationRequest'; // @ts-ignore -import { BASE_PATH, COLLECTION_FORMATS } from '../variables'; -import { Configuration } from '../configuration'; +import { BASE_PATH, COLLECTION_FORMATS } from '../variables'; +import { Configuration } from '../configuration'; import { BaseService } from '../api.base.service'; + + @Injectable({ - providedIn: 'root', + providedIn: 'root' }) export class OrganizationService extends BaseService { - constructor( - protected httpClient: HttpClient, - @Optional() @Inject(BASE_PATH) basePath: string | string[], - @Optional() configuration?: Configuration, - ) { - super(basePath, configuration); - } - /** - * Create Organization - * @endpoint post /api/organizations - * @param createOrganizationRequest - * @param secureFgpAcc - * @param observe set whether or not to return the data Observable as the body, response or events. defaults to returning the body. - * @param reportProgress flag to report request and response progress. - */ - public createOrganisation( - createOrganizationRequest: CreateOrganizationRequest, - secureFgpAcc?: string, - observe?: 'body', - reportProgress?: boolean, - options?: { - httpHeaderAccept?: 'application/json'; - context?: HttpContext; - transferCache?: boolean; - }, - ): Observable; - public createOrganisation( - createOrganizationRequest: CreateOrganizationRequest, - secureFgpAcc?: string, - observe?: 'response', - reportProgress?: boolean, - options?: { - httpHeaderAccept?: 'application/json'; - context?: HttpContext; - transferCache?: boolean; - }, - ): Observable< - HttpResponse - >; - public createOrganisation( - createOrganizationRequest: CreateOrganizationRequest, - secureFgpAcc?: string, - observe?: 'events', - reportProgress?: boolean, - options?: { - httpHeaderAccept?: 'application/json'; - context?: HttpContext; - transferCache?: boolean; - }, - ): Observable>; - public createOrganisation( - createOrganizationRequest: CreateOrganizationRequest, - secureFgpAcc?: string, - observe: any = 'body', - reportProgress: boolean = false, - options?: { - httpHeaderAccept?: 'application/json'; - context?: HttpContext; - transferCache?: boolean; - }, - ): Observable { - if ( - createOrganizationRequest === null || - createOrganizationRequest === undefined - ) { - throw new Error( - 'Required parameter createOrganizationRequest was null or undefined when calling createOrganisation.', - ); + constructor(protected httpClient: HttpClient, @Optional() @Inject(BASE_PATH) basePath: string|string[], @Optional() configuration?: Configuration) { + super(basePath, configuration); } - let localVarHeaders = this.defaultHeaders; + /** + * Create Organization + * @endpoint post /api/organizations + * @param createOrganizationRequest + * @param secureFgpAcc + * @param observe set whether or not to return the data Observable as the body, response or events. defaults to returning the body. + * @param reportProgress flag to report request and response progress. + */ + public createOrganisation(createOrganizationRequest: CreateOrganizationRequest, secureFgpAcc?: string, observe?: 'body', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable; + public createOrganisation(createOrganizationRequest: CreateOrganizationRequest, secureFgpAcc?: string, observe?: 'response', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable>; + public createOrganisation(createOrganizationRequest: CreateOrganizationRequest, secureFgpAcc?: string, observe?: 'events', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable>; + public createOrganisation(createOrganizationRequest: CreateOrganizationRequest, secureFgpAcc?: string, observe: any = 'body', reportProgress: boolean = false, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable { + if (createOrganizationRequest === null || createOrganizationRequest === undefined) { + throw new Error('Required parameter createOrganizationRequest was null or undefined when calling createOrganisation.'); + } - // authentication (HTTPBearer) required - localVarHeaders = this.configuration.addCredentialToHeaders( - 'HTTPBearer', - 'Authorization', - localVarHeaders, - 'Bearer ', - ); + let localVarHeaders = this.defaultHeaders; - const localVarHttpHeaderAcceptSelected: string | undefined = - options?.httpHeaderAccept ?? - this.configuration.selectHeaderAccept(['application/json']); - if (localVarHttpHeaderAcceptSelected !== undefined) { - localVarHeaders = localVarHeaders.set( - 'Accept', - localVarHttpHeaderAcceptSelected, - ); + // authentication (HTTPBearer) required + localVarHeaders = this.configuration.addCredentialToHeaders('HTTPBearer', 'Authorization', localVarHeaders, 'Bearer '); + + const localVarHttpHeaderAcceptSelected: string | undefined = options?.httpHeaderAccept ?? this.configuration.selectHeaderAccept([ + 'application/json' + ]); + if (localVarHttpHeaderAcceptSelected !== undefined) { + localVarHeaders = localVarHeaders.set('Accept', localVarHttpHeaderAcceptSelected); + } + + const localVarHttpContext: HttpContext = options?.context ?? new HttpContext(); + + const localVarTransferCache: boolean = options?.transferCache ?? true; + + + // to determine the Content-Type header + const consumes: string[] = [ + 'application/json' + ]; + const httpContentTypeSelected: string | undefined = this.configuration.selectHeaderContentType(consumes); + if (httpContentTypeSelected !== undefined) { + localVarHeaders = localVarHeaders.set('Content-Type', httpContentTypeSelected); + } + + let responseType_: 'text' | 'json' | 'blob' = 'json'; + if (localVarHttpHeaderAcceptSelected) { + if (localVarHttpHeaderAcceptSelected.startsWith('text')) { + responseType_ = 'text'; + } else if (this.configuration.isJsonMime(localVarHttpHeaderAcceptSelected)) { + responseType_ = 'json'; + } else { + responseType_ = 'blob'; + } + } + + let localVarPath = `/api/organizations`; + const { basePath, withCredentials } = this.configuration; + return this.httpClient.request('post', `${basePath}${localVarPath}`, + { + context: localVarHttpContext, + body: createOrganizationRequest, + responseType: responseType_, + ...(withCredentials ? { withCredentials } : {}), + headers: localVarHeaders, + observe: observe, + ...(localVarTransferCache !== undefined ? { transferCache: localVarTransferCache } : {}), + reportProgress: reportProgress + } + ); } - const localVarHttpContext: HttpContext = - options?.context ?? new HttpContext(); + /** + * Delete Organization + * @endpoint delete /api/organizations/{organization_id} + * @param organizationId + * @param secureFgpAcc + * @param observe set whether or not to return the data Observable as the body, response or events. defaults to returning the body. + * @param reportProgress flag to report request and response progress. + */ + public deleteOrganisation(organizationId: string, secureFgpAcc?: string, observe?: 'body', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable; + public deleteOrganisation(organizationId: string, secureFgpAcc?: string, observe?: 'response', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable>; + public deleteOrganisation(organizationId: string, secureFgpAcc?: string, observe?: 'events', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable>; + public deleteOrganisation(organizationId: string, secureFgpAcc?: string, observe: any = 'body', reportProgress: boolean = false, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable { + if (organizationId === null || organizationId === undefined) { + throw new Error('Required parameter organizationId was null or undefined when calling deleteOrganisation.'); + } - const localVarTransferCache: boolean = options?.transferCache ?? true; + let localVarHeaders = this.defaultHeaders; - // to determine the Content-Type header - const consumes: string[] = ['application/json']; - const httpContentTypeSelected: string | undefined = - this.configuration.selectHeaderContentType(consumes); - if (httpContentTypeSelected !== undefined) { - localVarHeaders = localVarHeaders.set( - 'Content-Type', - httpContentTypeSelected, - ); + // authentication (HTTPBearer) required + localVarHeaders = this.configuration.addCredentialToHeaders('HTTPBearer', 'Authorization', localVarHeaders, 'Bearer '); + + const localVarHttpHeaderAcceptSelected: string | undefined = options?.httpHeaderAccept ?? this.configuration.selectHeaderAccept([ + 'application/json' + ]); + if (localVarHttpHeaderAcceptSelected !== undefined) { + localVarHeaders = localVarHeaders.set('Accept', localVarHttpHeaderAcceptSelected); + } + + const localVarHttpContext: HttpContext = options?.context ?? new HttpContext(); + + const localVarTransferCache: boolean = options?.transferCache ?? true; + + + let responseType_: 'text' | 'json' | 'blob' = 'json'; + if (localVarHttpHeaderAcceptSelected) { + if (localVarHttpHeaderAcceptSelected.startsWith('text')) { + responseType_ = 'text'; + } else if (this.configuration.isJsonMime(localVarHttpHeaderAcceptSelected)) { + responseType_ = 'json'; + } else { + responseType_ = 'blob'; + } + } + + let localVarPath = `/api/organizations/${this.configuration.encodeParam({name: "organizationId", value: organizationId, in: "path", style: "simple", explode: false, dataType: "string", dataFormat: "uuid"})}`; + const { basePath, withCredentials } = this.configuration; + return this.httpClient.request('delete', `${basePath}${localVarPath}`, + { + context: localVarHttpContext, + responseType: responseType_, + ...(withCredentials ? { withCredentials } : {}), + headers: localVarHeaders, + observe: observe, + ...(localVarTransferCache !== undefined ? { transferCache: localVarTransferCache } : {}), + reportProgress: reportProgress + } + ); } - let responseType_: 'text' | 'json' | 'blob' = 'json'; - if (localVarHttpHeaderAcceptSelected) { - if (localVarHttpHeaderAcceptSelected.startsWith('text')) { - responseType_ = 'text'; - } else if ( - this.configuration.isJsonMime(localVarHttpHeaderAcceptSelected) - ) { - responseType_ = 'json'; - } else { - responseType_ = 'blob'; - } + /** + * Get Organizations + * @endpoint get /api/organizations + * @param page + * @param pageSize + * @param offset + * @param secureFgpAcc + * @param observe set whether or not to return the data Observable as the body, response or events. defaults to returning the body. + * @param reportProgress flag to report request and response progress. + */ + public getOrganisations(page?: number, pageSize?: number, offset?: number, secureFgpAcc?: string, observe?: 'body', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable; + public getOrganisations(page?: number, pageSize?: number, offset?: number, secureFgpAcc?: string, observe?: 'response', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable>; + public getOrganisations(page?: number, pageSize?: number, offset?: number, secureFgpAcc?: string, observe?: 'events', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable>; + public getOrganisations(page?: number, pageSize?: number, offset?: number, secureFgpAcc?: string, observe: any = 'body', reportProgress: boolean = false, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable { + + let localVarQueryParameters = new HttpParams({encoder: this.encoder}); + localVarQueryParameters = this.addToHttpParams(localVarQueryParameters, + page, 'page'); + localVarQueryParameters = this.addToHttpParams(localVarQueryParameters, + pageSize, 'page_size'); + localVarQueryParameters = this.addToHttpParams(localVarQueryParameters, + offset, 'offset'); + + let localVarHeaders = this.defaultHeaders; + + // authentication (HTTPBearer) required + localVarHeaders = this.configuration.addCredentialToHeaders('HTTPBearer', 'Authorization', localVarHeaders, 'Bearer '); + + const localVarHttpHeaderAcceptSelected: string | undefined = options?.httpHeaderAccept ?? this.configuration.selectHeaderAccept([ + 'application/json' + ]); + if (localVarHttpHeaderAcceptSelected !== undefined) { + localVarHeaders = localVarHeaders.set('Accept', localVarHttpHeaderAcceptSelected); + } + + const localVarHttpContext: HttpContext = options?.context ?? new HttpContext(); + + const localVarTransferCache: boolean = options?.transferCache ?? true; + + + let responseType_: 'text' | 'json' | 'blob' = 'json'; + if (localVarHttpHeaderAcceptSelected) { + if (localVarHttpHeaderAcceptSelected.startsWith('text')) { + responseType_ = 'text'; + } else if (this.configuration.isJsonMime(localVarHttpHeaderAcceptSelected)) { + responseType_ = 'json'; + } else { + responseType_ = 'blob'; + } + } + + let localVarPath = `/api/organizations`; + const { basePath, withCredentials } = this.configuration; + return this.httpClient.request('get', `${basePath}${localVarPath}`, + { + context: localVarHttpContext, + params: localVarQueryParameters, + responseType: responseType_, + ...(withCredentials ? { withCredentials } : {}), + headers: localVarHeaders, + observe: observe, + ...(localVarTransferCache !== undefined ? { transferCache: localVarTransferCache } : {}), + reportProgress: reportProgress + } + ); } - let localVarPath = `/api/organizations`; - const { basePath, withCredentials } = this.configuration; - return this.httpClient.request( - 'post', - `${basePath}${localVarPath}`, - { - context: localVarHttpContext, - body: createOrganizationRequest, - responseType: responseType_, - ...(withCredentials ? { withCredentials } : {}), - headers: localVarHeaders, - observe: observe, - ...(localVarTransferCache !== undefined - ? { transferCache: localVarTransferCache } - : {}), - reportProgress: reportProgress, - }, - ); - } + /** + * Update Organization + * @endpoint put /api/organizations/{organization_id} + * @param organizationId + * @param updateOrganizationRequest + * @param secureFgpAcc + * @param observe set whether or not to return the data Observable as the body, response or events. defaults to returning the body. + * @param reportProgress flag to report request and response progress. + */ + public updateOrganisation(organizationId: string, updateOrganizationRequest: UpdateOrganizationRequest, secureFgpAcc?: string, observe?: 'body', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable; + public updateOrganisation(organizationId: string, updateOrganizationRequest: UpdateOrganizationRequest, secureFgpAcc?: string, observe?: 'response', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable>; + public updateOrganisation(organizationId: string, updateOrganizationRequest: UpdateOrganizationRequest, secureFgpAcc?: string, observe?: 'events', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable>; + public updateOrganisation(organizationId: string, updateOrganizationRequest: UpdateOrganizationRequest, secureFgpAcc?: string, observe: any = 'body', reportProgress: boolean = false, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable { + if (organizationId === null || organizationId === undefined) { + throw new Error('Required parameter organizationId was null or undefined when calling updateOrganisation.'); + } + if (updateOrganizationRequest === null || updateOrganizationRequest === undefined) { + throw new Error('Required parameter updateOrganizationRequest was null or undefined when calling updateOrganisation.'); + } - /** - * Delete Organization - * @endpoint delete /api/organizations/{organization_id} - * @param organizationId - * @param secureFgpAcc - * @param observe set whether or not to return the data Observable as the body, response or events. defaults to returning the body. - * @param reportProgress flag to report request and response progress. - */ - public deleteOrganisation( - organizationId: string, - secureFgpAcc?: string, - observe?: 'body', - reportProgress?: boolean, - options?: { - httpHeaderAccept?: 'application/json'; - context?: HttpContext; - transferCache?: boolean; - }, - ): Observable; - public deleteOrganisation( - organizationId: string, - secureFgpAcc?: string, - observe?: 'response', - reportProgress?: boolean, - options?: { - httpHeaderAccept?: 'application/json'; - context?: HttpContext; - transferCache?: boolean; - }, - ): Observable>; - public deleteOrganisation( - organizationId: string, - secureFgpAcc?: string, - observe?: 'events', - reportProgress?: boolean, - options?: { - httpHeaderAccept?: 'application/json'; - context?: HttpContext; - transferCache?: boolean; - }, - ): Observable>; - public deleteOrganisation( - organizationId: string, - secureFgpAcc?: string, - observe: any = 'body', - reportProgress: boolean = false, - options?: { - httpHeaderAccept?: 'application/json'; - context?: HttpContext; - transferCache?: boolean; - }, - ): Observable { - if (organizationId === null || organizationId === undefined) { - throw new Error( - 'Required parameter organizationId was null or undefined when calling deleteOrganisation.', - ); + let localVarHeaders = this.defaultHeaders; + + // authentication (HTTPBearer) required + localVarHeaders = this.configuration.addCredentialToHeaders('HTTPBearer', 'Authorization', localVarHeaders, 'Bearer '); + + const localVarHttpHeaderAcceptSelected: string | undefined = options?.httpHeaderAccept ?? this.configuration.selectHeaderAccept([ + 'application/json' + ]); + if (localVarHttpHeaderAcceptSelected !== undefined) { + localVarHeaders = localVarHeaders.set('Accept', localVarHttpHeaderAcceptSelected); + } + + const localVarHttpContext: HttpContext = options?.context ?? new HttpContext(); + + const localVarTransferCache: boolean = options?.transferCache ?? true; + + + // to determine the Content-Type header + const consumes: string[] = [ + 'application/json' + ]; + const httpContentTypeSelected: string | undefined = this.configuration.selectHeaderContentType(consumes); + if (httpContentTypeSelected !== undefined) { + localVarHeaders = localVarHeaders.set('Content-Type', httpContentTypeSelected); + } + + let responseType_: 'text' | 'json' | 'blob' = 'json'; + if (localVarHttpHeaderAcceptSelected) { + if (localVarHttpHeaderAcceptSelected.startsWith('text')) { + responseType_ = 'text'; + } else if (this.configuration.isJsonMime(localVarHttpHeaderAcceptSelected)) { + responseType_ = 'json'; + } else { + responseType_ = 'blob'; + } + } + + let localVarPath = `/api/organizations/${this.configuration.encodeParam({name: "organizationId", value: organizationId, in: "path", style: "simple", explode: false, dataType: "string", dataFormat: "uuid"})}`; + const { basePath, withCredentials } = this.configuration; + return this.httpClient.request('put', `${basePath}${localVarPath}`, + { + context: localVarHttpContext, + body: updateOrganizationRequest, + responseType: responseType_, + ...(withCredentials ? { withCredentials } : {}), + headers: localVarHeaders, + observe: observe, + ...(localVarTransferCache !== undefined ? { transferCache: localVarTransferCache } : {}), + reportProgress: reportProgress + } + ); } - let localVarHeaders = this.defaultHeaders; - - // authentication (HTTPBearer) required - localVarHeaders = this.configuration.addCredentialToHeaders( - 'HTTPBearer', - 'Authorization', - localVarHeaders, - 'Bearer ', - ); - - const localVarHttpHeaderAcceptSelected: string | undefined = - options?.httpHeaderAccept ?? - this.configuration.selectHeaderAccept(['application/json']); - if (localVarHttpHeaderAcceptSelected !== undefined) { - localVarHeaders = localVarHeaders.set( - 'Accept', - localVarHttpHeaderAcceptSelected, - ); - } - - const localVarHttpContext: HttpContext = - options?.context ?? new HttpContext(); - - const localVarTransferCache: boolean = options?.transferCache ?? true; - - let responseType_: 'text' | 'json' | 'blob' = 'json'; - if (localVarHttpHeaderAcceptSelected) { - if (localVarHttpHeaderAcceptSelected.startsWith('text')) { - responseType_ = 'text'; - } else if ( - this.configuration.isJsonMime(localVarHttpHeaderAcceptSelected) - ) { - responseType_ = 'json'; - } else { - responseType_ = 'blob'; - } - } - - let localVarPath = `/api/organizations/${this.configuration.encodeParam({ name: 'organizationId', value: organizationId, in: 'path', style: 'simple', explode: false, dataType: 'string', dataFormat: 'uuid' })}`; - const { basePath, withCredentials } = this.configuration; - return this.httpClient.request( - 'delete', - `${basePath}${localVarPath}`, - { - context: localVarHttpContext, - responseType: responseType_, - ...(withCredentials ? { withCredentials } : {}), - headers: localVarHeaders, - observe: observe, - ...(localVarTransferCache !== undefined - ? { transferCache: localVarTransferCache } - : {}), - reportProgress: reportProgress, - }, - ); - } - - /** - * Get Organizations - * @endpoint get /api/organizations - * @param page - * @param pageSize - * @param offset - * @param secureFgpAcc - * @param observe set whether or not to return the data Observable as the body, response or events. defaults to returning the body. - * @param reportProgress flag to report request and response progress. - */ - public getOrganisations( - page?: number, - pageSize?: number, - offset?: number, - secureFgpAcc?: string, - observe?: 'body', - reportProgress?: boolean, - options?: { - httpHeaderAccept?: 'application/json'; - context?: HttpContext; - transferCache?: boolean; - }, - ): Observable; - public getOrganisations( - page?: number, - pageSize?: number, - offset?: number, - secureFgpAcc?: string, - observe?: 'response', - reportProgress?: boolean, - options?: { - httpHeaderAccept?: 'application/json'; - context?: HttpContext; - transferCache?: boolean; - }, - ): Observable>; - public getOrganisations( - page?: number, - pageSize?: number, - offset?: number, - secureFgpAcc?: string, - observe?: 'events', - reportProgress?: boolean, - options?: { - httpHeaderAccept?: 'application/json'; - context?: HttpContext; - transferCache?: boolean; - }, - ): Observable>; - public getOrganisations( - page?: number, - pageSize?: number, - offset?: number, - secureFgpAcc?: string, - observe: any = 'body', - reportProgress: boolean = false, - options?: { - httpHeaderAccept?: 'application/json'; - context?: HttpContext; - transferCache?: boolean; - }, - ): Observable { - let localVarQueryParameters = new HttpParams({ encoder: this.encoder }); - localVarQueryParameters = this.addToHttpParams( - localVarQueryParameters, - page, - 'page', - ); - localVarQueryParameters = this.addToHttpParams( - localVarQueryParameters, - pageSize, - 'page_size', - ); - localVarQueryParameters = this.addToHttpParams( - localVarQueryParameters, - offset, - 'offset', - ); - - let localVarHeaders = this.defaultHeaders; - - // authentication (HTTPBearer) required - localVarHeaders = this.configuration.addCredentialToHeaders( - 'HTTPBearer', - 'Authorization', - localVarHeaders, - 'Bearer ', - ); - - const localVarHttpHeaderAcceptSelected: string | undefined = - options?.httpHeaderAccept ?? - this.configuration.selectHeaderAccept(['application/json']); - if (localVarHttpHeaderAcceptSelected !== undefined) { - localVarHeaders = localVarHeaders.set( - 'Accept', - localVarHttpHeaderAcceptSelected, - ); - } - - const localVarHttpContext: HttpContext = - options?.context ?? new HttpContext(); - - const localVarTransferCache: boolean = options?.transferCache ?? true; - - let responseType_: 'text' | 'json' | 'blob' = 'json'; - if (localVarHttpHeaderAcceptSelected) { - if (localVarHttpHeaderAcceptSelected.startsWith('text')) { - responseType_ = 'text'; - } else if ( - this.configuration.isJsonMime(localVarHttpHeaderAcceptSelected) - ) { - responseType_ = 'json'; - } else { - responseType_ = 'blob'; - } - } - - let localVarPath = `/api/organizations`; - const { basePath, withCredentials } = this.configuration; - return this.httpClient.request( - 'get', - `${basePath}${localVarPath}`, - { - context: localVarHttpContext, - params: localVarQueryParameters, - responseType: responseType_, - ...(withCredentials ? { withCredentials } : {}), - headers: localVarHeaders, - observe: observe, - ...(localVarTransferCache !== undefined - ? { transferCache: localVarTransferCache } - : {}), - reportProgress: reportProgress, - }, - ); - } - - /** - * Update Organization - * @endpoint put /api/organizations/{organization_id} - * @param organizationId - * @param updateOrganizationRequest - * @param secureFgpAcc - * @param observe set whether or not to return the data Observable as the body, response or events. defaults to returning the body. - * @param reportProgress flag to report request and response progress. - */ - public updateOrganisation( - organizationId: string, - updateOrganizationRequest: UpdateOrganizationRequest, - secureFgpAcc?: string, - observe?: 'body', - reportProgress?: boolean, - options?: { - httpHeaderAccept?: 'application/json'; - context?: HttpContext; - transferCache?: boolean; - }, - ): Observable; - public updateOrganisation( - organizationId: string, - updateOrganizationRequest: UpdateOrganizationRequest, - secureFgpAcc?: string, - observe?: 'response', - reportProgress?: boolean, - options?: { - httpHeaderAccept?: 'application/json'; - context?: HttpContext; - transferCache?: boolean; - }, - ): Observable< - HttpResponse - >; - public updateOrganisation( - organizationId: string, - updateOrganizationRequest: UpdateOrganizationRequest, - secureFgpAcc?: string, - observe?: 'events', - reportProgress?: boolean, - options?: { - httpHeaderAccept?: 'application/json'; - context?: HttpContext; - transferCache?: boolean; - }, - ): Observable>; - public updateOrganisation( - organizationId: string, - updateOrganizationRequest: UpdateOrganizationRequest, - secureFgpAcc?: string, - observe: any = 'body', - reportProgress: boolean = false, - options?: { - httpHeaderAccept?: 'application/json'; - context?: HttpContext; - transferCache?: boolean; - }, - ): Observable { - if (organizationId === null || organizationId === undefined) { - throw new Error( - 'Required parameter organizationId was null or undefined when calling updateOrganisation.', - ); - } - if ( - updateOrganizationRequest === null || - updateOrganizationRequest === undefined - ) { - throw new Error( - 'Required parameter updateOrganizationRequest was null or undefined when calling updateOrganisation.', - ); - } - - let localVarHeaders = this.defaultHeaders; - - // authentication (HTTPBearer) required - localVarHeaders = this.configuration.addCredentialToHeaders( - 'HTTPBearer', - 'Authorization', - localVarHeaders, - 'Bearer ', - ); - - const localVarHttpHeaderAcceptSelected: string | undefined = - options?.httpHeaderAccept ?? - this.configuration.selectHeaderAccept(['application/json']); - if (localVarHttpHeaderAcceptSelected !== undefined) { - localVarHeaders = localVarHeaders.set( - 'Accept', - localVarHttpHeaderAcceptSelected, - ); - } - - const localVarHttpContext: HttpContext = - options?.context ?? new HttpContext(); - - const localVarTransferCache: boolean = options?.transferCache ?? true; - - // to determine the Content-Type header - const consumes: string[] = ['application/json']; - const httpContentTypeSelected: string | undefined = - this.configuration.selectHeaderContentType(consumes); - if (httpContentTypeSelected !== undefined) { - localVarHeaders = localVarHeaders.set( - 'Content-Type', - httpContentTypeSelected, - ); - } - - let responseType_: 'text' | 'json' | 'blob' = 'json'; - if (localVarHttpHeaderAcceptSelected) { - if (localVarHttpHeaderAcceptSelected.startsWith('text')) { - responseType_ = 'text'; - } else if ( - this.configuration.isJsonMime(localVarHttpHeaderAcceptSelected) - ) { - responseType_ = 'json'; - } else { - responseType_ = 'blob'; - } - } - - let localVarPath = `/api/organizations/${this.configuration.encodeParam({ name: 'organizationId', value: organizationId, in: 'path', style: 'simple', explode: false, dataType: 'string', dataFormat: 'uuid' })}`; - const { basePath, withCredentials } = this.configuration; - return this.httpClient.request( - 'put', - `${basePath}${localVarPath}`, - { - context: localVarHttpContext, - body: updateOrganizationRequest, - responseType: responseType_, - ...(withCredentials ? { withCredentials } : {}), - headers: localVarHeaders, - observe: observe, - ...(localVarTransferCache !== undefined - ? { transferCache: localVarTransferCache } - : {}), - reportProgress: reportProgress, - }, - ); - } } diff --git a/webapp/src/app/api/api/patents.service.ts b/webapp/src/app/api/api/patents.service.ts index 5e69dc9e..ec6e9280 100644 --- a/webapp/src/app/api/api/patents.service.ts +++ b/webapp/src/app/api/api/patents.service.ts @@ -1,7 +1,7 @@ /** * Innovation Search Engine API * - * + * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech @@ -9,18 +9,12 @@ */ /* tslint:disable:no-unused-variable member-ordering */ -import { Inject, Injectable, Optional } from '@angular/core'; -import { - HttpClient, - HttpHeaders, - HttpParams, - HttpResponse, - HttpEvent, - HttpParameterCodec, - HttpContext, -} from '@angular/common/http'; -import { CustomHttpParameterCodec } from '../encoder'; -import { Observable } from 'rxjs'; +import { Inject, Injectable, Optional } from '@angular/core'; +import { HttpClient, HttpHeaders, HttpParams, + HttpResponse, HttpEvent, HttpParameterCodec, HttpContext + } from '@angular/common/http'; +import { CustomHttpParameterCodec } from '../encoder'; +import { Observable } from 'rxjs'; // @ts-ignore import { AllPatentsResponse } from '../model/allPatentsResponse'; @@ -38,779 +32,399 @@ import { PatentsByInstitutionResponse } from '../model/patentsByInstitutionRespo import { RebuildResponse } from '../model/rebuildResponse'; // @ts-ignore -import { BASE_PATH, COLLECTION_FORMATS } from '../variables'; -import { Configuration } from '../configuration'; +import { BASE_PATH, COLLECTION_FORMATS } from '../variables'; +import { Configuration } from '../configuration'; import { BaseService } from '../api.base.service'; + + @Injectable({ - providedIn: 'root', + providedIn: 'root' }) export class PatentsService extends BaseService { - constructor( - protected httpClient: HttpClient, - @Optional() @Inject(BASE_PATH) basePath: string | string[], - @Optional() configuration?: Configuration, - ) { - super(basePath, configuration); - } - /** - * Get all patents with pagination and search. - * @endpoint get /api/inse-service/patents - * @param page - * @param size - * @param search - * @param source - * @param sortBy - * @param sortDirection - * @param yearFrom - * @param yearTo - * @param observe set whether or not to return the data Observable as the body, response or events. defaults to returning the body. - * @param reportProgress flag to report request and response progress. - */ - public getAllPatents( - page?: number, - size?: number, - search?: string, - source?: string, - sortBy?: string, - sortDirection?: string, - yearFrom?: number, - yearTo?: number, - observe?: 'body', - reportProgress?: boolean, - options?: { - httpHeaderAccept?: 'application/json'; - context?: HttpContext; - transferCache?: boolean; - }, - ): Observable; - public getAllPatents( - page?: number, - size?: number, - search?: string, - source?: string, - sortBy?: string, - sortDirection?: string, - yearFrom?: number, - yearTo?: number, - observe?: 'response', - reportProgress?: boolean, - options?: { - httpHeaderAccept?: 'application/json'; - context?: HttpContext; - transferCache?: boolean; - }, - ): Observable>; - public getAllPatents( - page?: number, - size?: number, - search?: string, - source?: string, - sortBy?: string, - sortDirection?: string, - yearFrom?: number, - yearTo?: number, - observe?: 'events', - reportProgress?: boolean, - options?: { - httpHeaderAccept?: 'application/json'; - context?: HttpContext; - transferCache?: boolean; - }, - ): Observable>; - public getAllPatents( - page?: number, - size?: number, - search?: string, - source?: string, - sortBy?: string, - sortDirection?: string, - yearFrom?: number, - yearTo?: number, - observe: any = 'body', - reportProgress: boolean = false, - options?: { - httpHeaderAccept?: 'application/json'; - context?: HttpContext; - transferCache?: boolean; - }, - ): Observable { - let localVarQueryParameters = new HttpParams({ encoder: this.encoder }); - localVarQueryParameters = this.addToHttpParams( - localVarQueryParameters, - page, - 'page', - ); - localVarQueryParameters = this.addToHttpParams( - localVarQueryParameters, - size, - 'size', - ); - localVarQueryParameters = this.addToHttpParams( - localVarQueryParameters, - search, - 'search', - ); - localVarQueryParameters = this.addToHttpParams( - localVarQueryParameters, - source, - 'source', - ); - localVarQueryParameters = this.addToHttpParams( - localVarQueryParameters, - sortBy, - 'sort_by', - ); - localVarQueryParameters = this.addToHttpParams( - localVarQueryParameters, - sortDirection, - 'sort_direction', - ); - localVarQueryParameters = this.addToHttpParams( - localVarQueryParameters, - yearFrom, - 'year_from', - ); - localVarQueryParameters = this.addToHttpParams( - localVarQueryParameters, - yearTo, - 'year_to', - ); - - let localVarHeaders = this.defaultHeaders; - - const localVarHttpHeaderAcceptSelected: string | undefined = - options?.httpHeaderAccept ?? - this.configuration.selectHeaderAccept(['application/json']); - if (localVarHttpHeaderAcceptSelected !== undefined) { - localVarHeaders = localVarHeaders.set( - 'Accept', - localVarHttpHeaderAcceptSelected, - ); + constructor(protected httpClient: HttpClient, @Optional() @Inject(BASE_PATH) basePath: string|string[], @Optional() configuration?: Configuration) { + super(basePath, configuration); } - const localVarHttpContext: HttpContext = - options?.context ?? new HttpContext(); + /** + * Get all patents with pagination and search. + * @endpoint get /api/inse-service/patents + * @param page + * @param size + * @param search + * @param source + * @param sortBy + * @param sortDirection + * @param yearFrom + * @param yearTo + * @param observe set whether or not to return the data Observable as the body, response or events. defaults to returning the body. + * @param reportProgress flag to report request and response progress. + */ + public getAllPatents(page?: number, size?: number, search?: string, source?: string, sortBy?: string, sortDirection?: string, yearFrom?: number, yearTo?: number, observe?: 'body', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable; + public getAllPatents(page?: number, size?: number, search?: string, source?: string, sortBy?: string, sortDirection?: string, yearFrom?: number, yearTo?: number, observe?: 'response', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable>; + public getAllPatents(page?: number, size?: number, search?: string, source?: string, sortBy?: string, sortDirection?: string, yearFrom?: number, yearTo?: number, observe?: 'events', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable>; + public getAllPatents(page?: number, size?: number, search?: string, source?: string, sortBy?: string, sortDirection?: string, yearFrom?: number, yearTo?: number, observe: any = 'body', reportProgress: boolean = false, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable { - const localVarTransferCache: boolean = options?.transferCache ?? true; + let localVarQueryParameters = new HttpParams({encoder: this.encoder}); + localVarQueryParameters = this.addToHttpParams(localVarQueryParameters, + page, 'page'); + localVarQueryParameters = this.addToHttpParams(localVarQueryParameters, + size, 'size'); + localVarQueryParameters = this.addToHttpParams(localVarQueryParameters, + search, 'search'); + localVarQueryParameters = this.addToHttpParams(localVarQueryParameters, + source, 'source'); + localVarQueryParameters = this.addToHttpParams(localVarQueryParameters, + sortBy, 'sort_by'); + localVarQueryParameters = this.addToHttpParams(localVarQueryParameters, + sortDirection, 'sort_direction'); + localVarQueryParameters = this.addToHttpParams(localVarQueryParameters, + yearFrom, 'year_from'); + localVarQueryParameters = this.addToHttpParams(localVarQueryParameters, + yearTo, 'year_to'); - let responseType_: 'text' | 'json' | 'blob' = 'json'; - if (localVarHttpHeaderAcceptSelected) { - if (localVarHttpHeaderAcceptSelected.startsWith('text')) { - responseType_ = 'text'; - } else if ( - this.configuration.isJsonMime(localVarHttpHeaderAcceptSelected) - ) { - responseType_ = 'json'; - } else { - responseType_ = 'blob'; - } + let localVarHeaders = this.defaultHeaders; + + const localVarHttpHeaderAcceptSelected: string | undefined = options?.httpHeaderAccept ?? this.configuration.selectHeaderAccept([ + 'application/json' + ]); + if (localVarHttpHeaderAcceptSelected !== undefined) { + localVarHeaders = localVarHeaders.set('Accept', localVarHttpHeaderAcceptSelected); + } + + const localVarHttpContext: HttpContext = options?.context ?? new HttpContext(); + + const localVarTransferCache: boolean = options?.transferCache ?? true; + + + let responseType_: 'text' | 'json' | 'blob' = 'json'; + if (localVarHttpHeaderAcceptSelected) { + if (localVarHttpHeaderAcceptSelected.startsWith('text')) { + responseType_ = 'text'; + } else if (this.configuration.isJsonMime(localVarHttpHeaderAcceptSelected)) { + responseType_ = 'json'; + } else { + responseType_ = 'blob'; + } + } + + let localVarPath = `/api/inse-service/patents`; + const { basePath, withCredentials } = this.configuration; + return this.httpClient.request('get', `${basePath}${localVarPath}`, + { + context: localVarHttpContext, + params: localVarQueryParameters, + responseType: responseType_, + ...(withCredentials ? { withCredentials } : {}), + headers: localVarHeaders, + observe: observe, + ...(localVarTransferCache !== undefined ? { transferCache: localVarTransferCache } : {}), + reportProgress: reportProgress + } + ); } - let localVarPath = `/api/inse-service/patents`; - const { basePath, withCredentials } = this.configuration; - return this.httpClient.request( - 'get', - `${basePath}${localVarPath}`, - { - context: localVarHttpContext, - params: localVarQueryParameters, - responseType: responseType_, - ...(withCredentials ? { withCredentials } : {}), - headers: localVarHeaders, - observe: observe, - ...(localVarTransferCache !== undefined - ? { transferCache: localVarTransferCache } - : {}), - reportProgress: reportProgress, - }, - ); - } + /** + * Get pre-indexed org patents for an institution. + * @endpoint get /api/inse-service/institutions/{id}/org-patents + * @param id + * @param matchType Filter patents by match type. + * @param page + * @param size + * @param source + * @param observe set whether or not to return the data Observable as the body, response or events. defaults to returning the body. + * @param reportProgress flag to report request and response progress. + */ + public getOrgPatentsByInstitution(id: string, matchType?: 'institution' | 'name' | 'both' | 'all', page?: number, size?: number, source?: string, observe?: 'body', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable; + public getOrgPatentsByInstitution(id: string, matchType?: 'institution' | 'name' | 'both' | 'all', page?: number, size?: number, source?: string, observe?: 'response', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable>; + public getOrgPatentsByInstitution(id: string, matchType?: 'institution' | 'name' | 'both' | 'all', page?: number, size?: number, source?: string, observe?: 'events', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable>; + public getOrgPatentsByInstitution(id: string, matchType?: 'institution' | 'name' | 'both' | 'all', page?: number, size?: number, source?: string, observe: any = 'body', reportProgress: boolean = false, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable { + if (id === null || id === undefined) { + throw new Error('Required parameter id was null or undefined when calling getOrgPatentsByInstitution.'); + } - /** - * Get pre-indexed org patents for an institution. - * @endpoint get /api/inse-service/institutions/{id}/org-patents - * @param id - * @param matchType Filter patents by match type. - * @param page - * @param size - * @param source - * @param observe set whether or not to return the data Observable as the body, response or events. defaults to returning the body. - * @param reportProgress flag to report request and response progress. - */ - public getOrgPatentsByInstitution( - id: string, - matchType?: 'institution' | 'name' | 'both' | 'all', - page?: number, - size?: number, - source?: string, - observe?: 'body', - reportProgress?: boolean, - options?: { - httpHeaderAccept?: 'application/json'; - context?: HttpContext; - transferCache?: boolean; - }, - ): Observable; - public getOrgPatentsByInstitution( - id: string, - matchType?: 'institution' | 'name' | 'both' | 'all', - page?: number, - size?: number, - source?: string, - observe?: 'response', - reportProgress?: boolean, - options?: { - httpHeaderAccept?: 'application/json'; - context?: HttpContext; - transferCache?: boolean; - }, - ): Observable>; - public getOrgPatentsByInstitution( - id: string, - matchType?: 'institution' | 'name' | 'both' | 'all', - page?: number, - size?: number, - source?: string, - observe?: 'events', - reportProgress?: boolean, - options?: { - httpHeaderAccept?: 'application/json'; - context?: HttpContext; - transferCache?: boolean; - }, - ): Observable>; - public getOrgPatentsByInstitution( - id: string, - matchType?: 'institution' | 'name' | 'both' | 'all', - page?: number, - size?: number, - source?: string, - observe: any = 'body', - reportProgress: boolean = false, - options?: { - httpHeaderAccept?: 'application/json'; - context?: HttpContext; - transferCache?: boolean; - }, - ): Observable { - if (id === null || id === undefined) { - throw new Error( - 'Required parameter id was null or undefined when calling getOrgPatentsByInstitution.', - ); + let localVarQueryParameters = new HttpParams({encoder: this.encoder}); + localVarQueryParameters = this.addToHttpParams(localVarQueryParameters, + matchType, 'match_type'); + localVarQueryParameters = this.addToHttpParams(localVarQueryParameters, + page, 'page'); + localVarQueryParameters = this.addToHttpParams(localVarQueryParameters, + size, 'size'); + localVarQueryParameters = this.addToHttpParams(localVarQueryParameters, + source, 'source'); + + let localVarHeaders = this.defaultHeaders; + + const localVarHttpHeaderAcceptSelected: string | undefined = options?.httpHeaderAccept ?? this.configuration.selectHeaderAccept([ + 'application/json' + ]); + if (localVarHttpHeaderAcceptSelected !== undefined) { + localVarHeaders = localVarHeaders.set('Accept', localVarHttpHeaderAcceptSelected); + } + + const localVarHttpContext: HttpContext = options?.context ?? new HttpContext(); + + const localVarTransferCache: boolean = options?.transferCache ?? true; + + + let responseType_: 'text' | 'json' | 'blob' = 'json'; + if (localVarHttpHeaderAcceptSelected) { + if (localVarHttpHeaderAcceptSelected.startsWith('text')) { + responseType_ = 'text'; + } else if (this.configuration.isJsonMime(localVarHttpHeaderAcceptSelected)) { + responseType_ = 'json'; + } else { + responseType_ = 'blob'; + } + } + + let localVarPath = `/api/inse-service/institutions/${this.configuration.encodeParam({name: "id", value: id, in: "path", style: "simple", explode: false, dataType: "string", dataFormat: undefined})}/org-patents`; + const { basePath, withCredentials } = this.configuration; + return this.httpClient.request('get', `${basePath}${localVarPath}`, + { + context: localVarHttpContext, + params: localVarQueryParameters, + responseType: responseType_, + ...(withCredentials ? { withCredentials } : {}), + headers: localVarHeaders, + observe: observe, + ...(localVarTransferCache !== undefined ? { transferCache: localVarTransferCache } : {}), + reportProgress: reportProgress + } + ); } - let localVarQueryParameters = new HttpParams({ encoder: this.encoder }); - localVarQueryParameters = this.addToHttpParams( - localVarQueryParameters, - matchType, - 'match_type', - ); - localVarQueryParameters = this.addToHttpParams( - localVarQueryParameters, - page, - 'page', - ); - localVarQueryParameters = this.addToHttpParams( - localVarQueryParameters, - size, - 'size', - ); - localVarQueryParameters = this.addToHttpParams( - localVarQueryParameters, - source, - 'source', - ); + /** + * Get a single patent by identifier with optional title fallback. + * @endpoint get /api/inse-service/patents/{identifier} + * @param identifier + * @param prefix + * @param title + * @param fillingDate + * @param observe set whether or not to return the data Observable as the body, response or events. defaults to returning the body. + * @param reportProgress flag to report request and response progress. + */ + public getPatentByIdOrTitle(identifier: string, prefix?: string, title?: string, fillingDate?: string, observe?: 'body', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable; + public getPatentByIdOrTitle(identifier: string, prefix?: string, title?: string, fillingDate?: string, observe?: 'response', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable>; + public getPatentByIdOrTitle(identifier: string, prefix?: string, title?: string, fillingDate?: string, observe?: 'events', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable>; + public getPatentByIdOrTitle(identifier: string, prefix?: string, title?: string, fillingDate?: string, observe: any = 'body', reportProgress: boolean = false, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable { + if (identifier === null || identifier === undefined) { + throw new Error('Required parameter identifier was null or undefined when calling getPatentByIdOrTitle.'); + } - let localVarHeaders = this.defaultHeaders; + let localVarQueryParameters = new HttpParams({encoder: this.encoder}); + localVarQueryParameters = this.addToHttpParams(localVarQueryParameters, + prefix, 'prefix'); + localVarQueryParameters = this.addToHttpParams(localVarQueryParameters, + title, 'title'); + localVarQueryParameters = this.addToHttpParams(localVarQueryParameters, + fillingDate, 'filling_date'); - const localVarHttpHeaderAcceptSelected: string | undefined = - options?.httpHeaderAccept ?? - this.configuration.selectHeaderAccept(['application/json']); - if (localVarHttpHeaderAcceptSelected !== undefined) { - localVarHeaders = localVarHeaders.set( - 'Accept', - localVarHttpHeaderAcceptSelected, - ); + let localVarHeaders = this.defaultHeaders; + + const localVarHttpHeaderAcceptSelected: string | undefined = options?.httpHeaderAccept ?? this.configuration.selectHeaderAccept([ + 'application/json' + ]); + if (localVarHttpHeaderAcceptSelected !== undefined) { + localVarHeaders = localVarHeaders.set('Accept', localVarHttpHeaderAcceptSelected); + } + + const localVarHttpContext: HttpContext = options?.context ?? new HttpContext(); + + const localVarTransferCache: boolean = options?.transferCache ?? true; + + + let responseType_: 'text' | 'json' | 'blob' = 'json'; + if (localVarHttpHeaderAcceptSelected) { + if (localVarHttpHeaderAcceptSelected.startsWith('text')) { + responseType_ = 'text'; + } else if (this.configuration.isJsonMime(localVarHttpHeaderAcceptSelected)) { + responseType_ = 'json'; + } else { + responseType_ = 'blob'; + } + } + + let localVarPath = `/api/inse-service/patents/${this.configuration.encodeParam({name: "identifier", value: identifier, in: "path", style: "simple", explode: false, dataType: "string", dataFormat: undefined})}`; + const { basePath, withCredentials } = this.configuration; + return this.httpClient.request('get', `${basePath}${localVarPath}`, + { + context: localVarHttpContext, + params: localVarQueryParameters, + responseType: responseType_, + ...(withCredentials ? { withCredentials } : {}), + headers: localVarHeaders, + observe: observe, + ...(localVarTransferCache !== undefined ? { transferCache: localVarTransferCache } : {}), + reportProgress: reportProgress + } + ); } - const localVarHttpContext: HttpContext = - options?.context ?? new HttpContext(); + /** + * Get patents matched to an author by name. + * @endpoint get /api/inse-service/authors/{author_id}/patents + * @param authorId + * @param observe set whether or not to return the data Observable as the body, response or events. defaults to returning the body. + * @param reportProgress flag to report request and response progress. + */ + public getPatentsByAuthor(authorId: string, observe?: 'body', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable; + public getPatentsByAuthor(authorId: string, observe?: 'response', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable>; + public getPatentsByAuthor(authorId: string, observe?: 'events', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable>; + public getPatentsByAuthor(authorId: string, observe: any = 'body', reportProgress: boolean = false, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable { + if (authorId === null || authorId === undefined) { + throw new Error('Required parameter authorId was null or undefined when calling getPatentsByAuthor.'); + } - const localVarTransferCache: boolean = options?.transferCache ?? true; + let localVarHeaders = this.defaultHeaders; - let responseType_: 'text' | 'json' | 'blob' = 'json'; - if (localVarHttpHeaderAcceptSelected) { - if (localVarHttpHeaderAcceptSelected.startsWith('text')) { - responseType_ = 'text'; - } else if ( - this.configuration.isJsonMime(localVarHttpHeaderAcceptSelected) - ) { - responseType_ = 'json'; - } else { - responseType_ = 'blob'; - } + const localVarHttpHeaderAcceptSelected: string | undefined = options?.httpHeaderAccept ?? this.configuration.selectHeaderAccept([ + 'application/json' + ]); + if (localVarHttpHeaderAcceptSelected !== undefined) { + localVarHeaders = localVarHeaders.set('Accept', localVarHttpHeaderAcceptSelected); + } + + const localVarHttpContext: HttpContext = options?.context ?? new HttpContext(); + + const localVarTransferCache: boolean = options?.transferCache ?? true; + + + let responseType_: 'text' | 'json' | 'blob' = 'json'; + if (localVarHttpHeaderAcceptSelected) { + if (localVarHttpHeaderAcceptSelected.startsWith('text')) { + responseType_ = 'text'; + } else if (this.configuration.isJsonMime(localVarHttpHeaderAcceptSelected)) { + responseType_ = 'json'; + } else { + responseType_ = 'blob'; + } + } + + let localVarPath = `/api/inse-service/authors/${this.configuration.encodeParam({name: "authorId", value: authorId, in: "path", style: "simple", explode: false, dataType: "string", dataFormat: undefined})}/patents`; + const { basePath, withCredentials } = this.configuration; + return this.httpClient.request('get', `${basePath}${localVarPath}`, + { + context: localVarHttpContext, + responseType: responseType_, + ...(withCredentials ? { withCredentials } : {}), + headers: localVarHeaders, + observe: observe, + ...(localVarTransferCache !== undefined ? { transferCache: localVarTransferCache } : {}), + reportProgress: reportProgress + } + ); } - let localVarPath = `/api/inse-service/institutions/${this.configuration.encodeParam({ name: 'id', value: id, in: 'path', style: 'simple', explode: false, dataType: 'string', dataFormat: undefined })}/org-patents`; - const { basePath, withCredentials } = this.configuration; - return this.httpClient.request( - 'get', - `${basePath}${localVarPath}`, - { - context: localVarHttpContext, - params: localVarQueryParameters, - responseType: responseType_, - ...(withCredentials ? { withCredentials } : {}), - headers: localVarHeaders, - observe: observe, - ...(localVarTransferCache !== undefined - ? { transferCache: localVarTransferCache } - : {}), - reportProgress: reportProgress, - }, - ); - } + /** + * Get patents matched to an institution by assignee name. + * @endpoint get /api/inse-service/institutions/{id}/patents + * @param id + * @param observe set whether or not to return the data Observable as the body, response or events. defaults to returning the body. + * @param reportProgress flag to report request and response progress. + */ + public getPatentsByInstitution(id: string, observe?: 'body', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable; + public getPatentsByInstitution(id: string, observe?: 'response', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable>; + public getPatentsByInstitution(id: string, observe?: 'events', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable>; + public getPatentsByInstitution(id: string, observe: any = 'body', reportProgress: boolean = false, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable { + if (id === null || id === undefined) { + throw new Error('Required parameter id was null or undefined when calling getPatentsByInstitution.'); + } - /** - * Get a single patent by identifier with optional title fallback. - * @endpoint get /api/inse-service/patents/{identifier} - * @param identifier - * @param prefix - * @param title - * @param fillingDate - * @param observe set whether or not to return the data Observable as the body, response or events. defaults to returning the body. - * @param reportProgress flag to report request and response progress. - */ - public getPatentByIdOrTitle( - identifier: string, - prefix?: string, - title?: string, - fillingDate?: string, - observe?: 'body', - reportProgress?: boolean, - options?: { - httpHeaderAccept?: 'application/json'; - context?: HttpContext; - transferCache?: boolean; - }, - ): Observable; - public getPatentByIdOrTitle( - identifier: string, - prefix?: string, - title?: string, - fillingDate?: string, - observe?: 'response', - reportProgress?: boolean, - options?: { - httpHeaderAccept?: 'application/json'; - context?: HttpContext; - transferCache?: boolean; - }, - ): Observable>; - public getPatentByIdOrTitle( - identifier: string, - prefix?: string, - title?: string, - fillingDate?: string, - observe?: 'events', - reportProgress?: boolean, - options?: { - httpHeaderAccept?: 'application/json'; - context?: HttpContext; - transferCache?: boolean; - }, - ): Observable>; - public getPatentByIdOrTitle( - identifier: string, - prefix?: string, - title?: string, - fillingDate?: string, - observe: any = 'body', - reportProgress: boolean = false, - options?: { - httpHeaderAccept?: 'application/json'; - context?: HttpContext; - transferCache?: boolean; - }, - ): Observable { - if (identifier === null || identifier === undefined) { - throw new Error( - 'Required parameter identifier was null or undefined when calling getPatentByIdOrTitle.', - ); + let localVarHeaders = this.defaultHeaders; + + const localVarHttpHeaderAcceptSelected: string | undefined = options?.httpHeaderAccept ?? this.configuration.selectHeaderAccept([ + 'application/json' + ]); + if (localVarHttpHeaderAcceptSelected !== undefined) { + localVarHeaders = localVarHeaders.set('Accept', localVarHttpHeaderAcceptSelected); + } + + const localVarHttpContext: HttpContext = options?.context ?? new HttpContext(); + + const localVarTransferCache: boolean = options?.transferCache ?? true; + + + let responseType_: 'text' | 'json' | 'blob' = 'json'; + if (localVarHttpHeaderAcceptSelected) { + if (localVarHttpHeaderAcceptSelected.startsWith('text')) { + responseType_ = 'text'; + } else if (this.configuration.isJsonMime(localVarHttpHeaderAcceptSelected)) { + responseType_ = 'json'; + } else { + responseType_ = 'blob'; + } + } + + let localVarPath = `/api/inse-service/institutions/${this.configuration.encodeParam({name: "id", value: id, in: "path", style: "simple", explode: false, dataType: "string", dataFormat: undefined})}/patents`; + const { basePath, withCredentials } = this.configuration; + return this.httpClient.request('get', `${basePath}${localVarPath}`, + { + context: localVarHttpContext, + responseType: responseType_, + ...(withCredentials ? { withCredentials } : {}), + headers: localVarHeaders, + observe: observe, + ...(localVarTransferCache !== undefined ? { transferCache: localVarTransferCache } : {}), + reportProgress: reportProgress + } + ); } - let localVarQueryParameters = new HttpParams({ encoder: this.encoder }); - localVarQueryParameters = this.addToHttpParams( - localVarQueryParameters, - prefix, - 'prefix', - ); - localVarQueryParameters = this.addToHttpParams( - localVarQueryParameters, - title, - 'title', - ); - localVarQueryParameters = this.addToHttpParams( - localVarQueryParameters, - fillingDate, - 'filling_date', - ); + /** + * Trigger a background rebuild of the org_patents index for an institution. + * @endpoint post /api/inse-service/institutions/{id}/org-patents/rebuild + * @param id + * @param observe set whether or not to return the data Observable as the body, response or events. defaults to returning the body. + * @param reportProgress flag to report request and response progress. + */ + public rebuildOrgPatents(id: string, observe?: 'body', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable; + public rebuildOrgPatents(id: string, observe?: 'response', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable>; + public rebuildOrgPatents(id: string, observe?: 'events', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable>; + public rebuildOrgPatents(id: string, observe: any = 'body', reportProgress: boolean = false, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable { + if (id === null || id === undefined) { + throw new Error('Required parameter id was null or undefined when calling rebuildOrgPatents.'); + } - let localVarHeaders = this.defaultHeaders; + let localVarHeaders = this.defaultHeaders; - const localVarHttpHeaderAcceptSelected: string | undefined = - options?.httpHeaderAccept ?? - this.configuration.selectHeaderAccept(['application/json']); - if (localVarHttpHeaderAcceptSelected !== undefined) { - localVarHeaders = localVarHeaders.set( - 'Accept', - localVarHttpHeaderAcceptSelected, - ); + const localVarHttpHeaderAcceptSelected: string | undefined = options?.httpHeaderAccept ?? this.configuration.selectHeaderAccept([ + 'application/json' + ]); + if (localVarHttpHeaderAcceptSelected !== undefined) { + localVarHeaders = localVarHeaders.set('Accept', localVarHttpHeaderAcceptSelected); + } + + const localVarHttpContext: HttpContext = options?.context ?? new HttpContext(); + + const localVarTransferCache: boolean = options?.transferCache ?? true; + + + let responseType_: 'text' | 'json' | 'blob' = 'json'; + if (localVarHttpHeaderAcceptSelected) { + if (localVarHttpHeaderAcceptSelected.startsWith('text')) { + responseType_ = 'text'; + } else if (this.configuration.isJsonMime(localVarHttpHeaderAcceptSelected)) { + responseType_ = 'json'; + } else { + responseType_ = 'blob'; + } + } + + let localVarPath = `/api/inse-service/institutions/${this.configuration.encodeParam({name: "id", value: id, in: "path", style: "simple", explode: false, dataType: "string", dataFormat: undefined})}/org-patents/rebuild`; + const { basePath, withCredentials } = this.configuration; + return this.httpClient.request('post', `${basePath}${localVarPath}`, + { + context: localVarHttpContext, + responseType: responseType_, + ...(withCredentials ? { withCredentials } : {}), + headers: localVarHeaders, + observe: observe, + ...(localVarTransferCache !== undefined ? { transferCache: localVarTransferCache } : {}), + reportProgress: reportProgress + } + ); } - const localVarHttpContext: HttpContext = - options?.context ?? new HttpContext(); - - const localVarTransferCache: boolean = options?.transferCache ?? true; - - let responseType_: 'text' | 'json' | 'blob' = 'json'; - if (localVarHttpHeaderAcceptSelected) { - if (localVarHttpHeaderAcceptSelected.startsWith('text')) { - responseType_ = 'text'; - } else if ( - this.configuration.isJsonMime(localVarHttpHeaderAcceptSelected) - ) { - responseType_ = 'json'; - } else { - responseType_ = 'blob'; - } - } - - let localVarPath = `/api/inse-service/patents/${this.configuration.encodeParam({ name: 'identifier', value: identifier, in: 'path', style: 'simple', explode: false, dataType: 'string', dataFormat: undefined })}`; - const { basePath, withCredentials } = this.configuration; - return this.httpClient.request( - 'get', - `${basePath}${localVarPath}`, - { - context: localVarHttpContext, - params: localVarQueryParameters, - responseType: responseType_, - ...(withCredentials ? { withCredentials } : {}), - headers: localVarHeaders, - observe: observe, - ...(localVarTransferCache !== undefined - ? { transferCache: localVarTransferCache } - : {}), - reportProgress: reportProgress, - }, - ); - } - - /** - * Get patents matched to an author by name. - * @endpoint get /api/inse-service/authors/{author_id}/patents - * @param authorId - * @param observe set whether or not to return the data Observable as the body, response or events. defaults to returning the body. - * @param reportProgress flag to report request and response progress. - */ - public getPatentsByAuthor( - authorId: string, - observe?: 'body', - reportProgress?: boolean, - options?: { - httpHeaderAccept?: 'application/json'; - context?: HttpContext; - transferCache?: boolean; - }, - ): Observable; - public getPatentsByAuthor( - authorId: string, - observe?: 'response', - reportProgress?: boolean, - options?: { - httpHeaderAccept?: 'application/json'; - context?: HttpContext; - transferCache?: boolean; - }, - ): Observable>; - public getPatentsByAuthor( - authorId: string, - observe?: 'events', - reportProgress?: boolean, - options?: { - httpHeaderAccept?: 'application/json'; - context?: HttpContext; - transferCache?: boolean; - }, - ): Observable>; - public getPatentsByAuthor( - authorId: string, - observe: any = 'body', - reportProgress: boolean = false, - options?: { - httpHeaderAccept?: 'application/json'; - context?: HttpContext; - transferCache?: boolean; - }, - ): Observable { - if (authorId === null || authorId === undefined) { - throw new Error( - 'Required parameter authorId was null or undefined when calling getPatentsByAuthor.', - ); - } - - let localVarHeaders = this.defaultHeaders; - - const localVarHttpHeaderAcceptSelected: string | undefined = - options?.httpHeaderAccept ?? - this.configuration.selectHeaderAccept(['application/json']); - if (localVarHttpHeaderAcceptSelected !== undefined) { - localVarHeaders = localVarHeaders.set( - 'Accept', - localVarHttpHeaderAcceptSelected, - ); - } - - const localVarHttpContext: HttpContext = - options?.context ?? new HttpContext(); - - const localVarTransferCache: boolean = options?.transferCache ?? true; - - let responseType_: 'text' | 'json' | 'blob' = 'json'; - if (localVarHttpHeaderAcceptSelected) { - if (localVarHttpHeaderAcceptSelected.startsWith('text')) { - responseType_ = 'text'; - } else if ( - this.configuration.isJsonMime(localVarHttpHeaderAcceptSelected) - ) { - responseType_ = 'json'; - } else { - responseType_ = 'blob'; - } - } - - let localVarPath = `/api/inse-service/authors/${this.configuration.encodeParam({ name: 'authorId', value: authorId, in: 'path', style: 'simple', explode: false, dataType: 'string', dataFormat: undefined })}/patents`; - const { basePath, withCredentials } = this.configuration; - return this.httpClient.request( - 'get', - `${basePath}${localVarPath}`, - { - context: localVarHttpContext, - responseType: responseType_, - ...(withCredentials ? { withCredentials } : {}), - headers: localVarHeaders, - observe: observe, - ...(localVarTransferCache !== undefined - ? { transferCache: localVarTransferCache } - : {}), - reportProgress: reportProgress, - }, - ); - } - - /** - * Get patents matched to an institution by assignee name. - * @endpoint get /api/inse-service/institutions/{id}/patents - * @param id - * @param observe set whether or not to return the data Observable as the body, response or events. defaults to returning the body. - * @param reportProgress flag to report request and response progress. - */ - public getPatentsByInstitution( - id: string, - observe?: 'body', - reportProgress?: boolean, - options?: { - httpHeaderAccept?: 'application/json'; - context?: HttpContext; - transferCache?: boolean; - }, - ): Observable; - public getPatentsByInstitution( - id: string, - observe?: 'response', - reportProgress?: boolean, - options?: { - httpHeaderAccept?: 'application/json'; - context?: HttpContext; - transferCache?: boolean; - }, - ): Observable>; - public getPatentsByInstitution( - id: string, - observe?: 'events', - reportProgress?: boolean, - options?: { - httpHeaderAccept?: 'application/json'; - context?: HttpContext; - transferCache?: boolean; - }, - ): Observable>; - public getPatentsByInstitution( - id: string, - observe: any = 'body', - reportProgress: boolean = false, - options?: { - httpHeaderAccept?: 'application/json'; - context?: HttpContext; - transferCache?: boolean; - }, - ): Observable { - if (id === null || id === undefined) { - throw new Error( - 'Required parameter id was null or undefined when calling getPatentsByInstitution.', - ); - } - - let localVarHeaders = this.defaultHeaders; - - const localVarHttpHeaderAcceptSelected: string | undefined = - options?.httpHeaderAccept ?? - this.configuration.selectHeaderAccept(['application/json']); - if (localVarHttpHeaderAcceptSelected !== undefined) { - localVarHeaders = localVarHeaders.set( - 'Accept', - localVarHttpHeaderAcceptSelected, - ); - } - - const localVarHttpContext: HttpContext = - options?.context ?? new HttpContext(); - - const localVarTransferCache: boolean = options?.transferCache ?? true; - - let responseType_: 'text' | 'json' | 'blob' = 'json'; - if (localVarHttpHeaderAcceptSelected) { - if (localVarHttpHeaderAcceptSelected.startsWith('text')) { - responseType_ = 'text'; - } else if ( - this.configuration.isJsonMime(localVarHttpHeaderAcceptSelected) - ) { - responseType_ = 'json'; - } else { - responseType_ = 'blob'; - } - } - - let localVarPath = `/api/inse-service/institutions/${this.configuration.encodeParam({ name: 'id', value: id, in: 'path', style: 'simple', explode: false, dataType: 'string', dataFormat: undefined })}/patents`; - const { basePath, withCredentials } = this.configuration; - return this.httpClient.request( - 'get', - `${basePath}${localVarPath}`, - { - context: localVarHttpContext, - responseType: responseType_, - ...(withCredentials ? { withCredentials } : {}), - headers: localVarHeaders, - observe: observe, - ...(localVarTransferCache !== undefined - ? { transferCache: localVarTransferCache } - : {}), - reportProgress: reportProgress, - }, - ); - } - - /** - * Trigger a background rebuild of the org_patents index for an institution. - * @endpoint post /api/inse-service/institutions/{id}/org-patents/rebuild - * @param id - * @param observe set whether or not to return the data Observable as the body, response or events. defaults to returning the body. - * @param reportProgress flag to report request and response progress. - */ - public rebuildOrgPatents( - id: string, - observe?: 'body', - reportProgress?: boolean, - options?: { - httpHeaderAccept?: 'application/json'; - context?: HttpContext; - transferCache?: boolean; - }, - ): Observable; - public rebuildOrgPatents( - id: string, - observe?: 'response', - reportProgress?: boolean, - options?: { - httpHeaderAccept?: 'application/json'; - context?: HttpContext; - transferCache?: boolean; - }, - ): Observable>; - public rebuildOrgPatents( - id: string, - observe?: 'events', - reportProgress?: boolean, - options?: { - httpHeaderAccept?: 'application/json'; - context?: HttpContext; - transferCache?: boolean; - }, - ): Observable>; - public rebuildOrgPatents( - id: string, - observe: any = 'body', - reportProgress: boolean = false, - options?: { - httpHeaderAccept?: 'application/json'; - context?: HttpContext; - transferCache?: boolean; - }, - ): Observable { - if (id === null || id === undefined) { - throw new Error( - 'Required parameter id was null or undefined when calling rebuildOrgPatents.', - ); - } - - let localVarHeaders = this.defaultHeaders; - - const localVarHttpHeaderAcceptSelected: string | undefined = - options?.httpHeaderAccept ?? - this.configuration.selectHeaderAccept(['application/json']); - if (localVarHttpHeaderAcceptSelected !== undefined) { - localVarHeaders = localVarHeaders.set( - 'Accept', - localVarHttpHeaderAcceptSelected, - ); - } - - const localVarHttpContext: HttpContext = - options?.context ?? new HttpContext(); - - const localVarTransferCache: boolean = options?.transferCache ?? true; - - let responseType_: 'text' | 'json' | 'blob' = 'json'; - if (localVarHttpHeaderAcceptSelected) { - if (localVarHttpHeaderAcceptSelected.startsWith('text')) { - responseType_ = 'text'; - } else if ( - this.configuration.isJsonMime(localVarHttpHeaderAcceptSelected) - ) { - responseType_ = 'json'; - } else { - responseType_ = 'blob'; - } - } - - let localVarPath = `/api/inse-service/institutions/${this.configuration.encodeParam({ name: 'id', value: id, in: 'path', style: 'simple', explode: false, dataType: 'string', dataFormat: undefined })}/org-patents/rebuild`; - const { basePath, withCredentials } = this.configuration; - return this.httpClient.request( - 'post', - `${basePath}${localVarPath}`, - { - context: localVarHttpContext, - responseType: responseType_, - ...(withCredentials ? { withCredentials } : {}), - headers: localVarHeaders, - observe: observe, - ...(localVarTransferCache !== undefined - ? { transferCache: localVarTransferCache } - : {}), - reportProgress: reportProgress, - }, - ); - } } diff --git a/webapp/src/app/api/api/personNetwork.service.ts b/webapp/src/app/api/api/personNetwork.service.ts index 5b468938..b1183ff6 100644 --- a/webapp/src/app/api/api/personNetwork.service.ts +++ b/webapp/src/app/api/api/personNetwork.service.ts @@ -1,7 +1,7 @@ /** * Innovation Search Engine API * - * + * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech @@ -9,18 +9,12 @@ */ /* tslint:disable:no-unused-variable member-ordering */ -import { Inject, Injectable, Optional } from '@angular/core'; -import { - HttpClient, - HttpHeaders, - HttpParams, - HttpResponse, - HttpEvent, - HttpParameterCodec, - HttpContext, -} from '@angular/common/http'; -import { CustomHttpParameterCodec } from '../encoder'; -import { Observable } from 'rxjs'; +import { Inject, Injectable, Optional } from '@angular/core'; +import { HttpClient, HttpHeaders, HttpParams, + HttpResponse, HttpEvent, HttpParameterCodec, HttpContext + } from '@angular/common/http'; +import { CustomHttpParameterCodec } from '../encoder'; +import { Observable } from 'rxjs'; // @ts-ignore import { CollaborationNetwork } from '../model/collaborationNetwork'; @@ -30,139 +24,86 @@ import { FilterProperties } from '../model/filterProperties'; import { HTTPValidationError } from '../model/hTTPValidationError'; // @ts-ignore -import { BASE_PATH, COLLECTION_FORMATS } from '../variables'; -import { Configuration } from '../configuration'; +import { BASE_PATH, COLLECTION_FORMATS } from '../variables'; +import { Configuration } from '../configuration'; import { BaseService } from '../api.base.service'; + + @Injectable({ - providedIn: 'root', + providedIn: 'root' }) export class PersonNetworkService extends BaseService { - constructor( - protected httpClient: HttpClient, - @Optional() @Inject(BASE_PATH) basePath: string | string[], - @Optional() configuration?: Configuration, - ) { - super(basePath, configuration); - } - /** - * Get a person\'s collaboration network. - * Returns a person\'s collaboration network based on their works and co-authors. - * @endpoint post /api/person/network/{raw_user_id} - * @param rawUserId The raw user ID of the person. - * @param filterProperties - * @param observe set whether or not to return the data Observable as the body, response or events. defaults to returning the body. - * @param reportProgress flag to report request and response progress. - */ - public getCollaborationNetwork( - rawUserId: string, - filterProperties?: FilterProperties, - observe?: 'body', - reportProgress?: boolean, - options?: { - httpHeaderAccept?: 'application/json'; - context?: HttpContext; - transferCache?: boolean; - }, - ): Observable; - public getCollaborationNetwork( - rawUserId: string, - filterProperties?: FilterProperties, - observe?: 'response', - reportProgress?: boolean, - options?: { - httpHeaderAccept?: 'application/json'; - context?: HttpContext; - transferCache?: boolean; - }, - ): Observable>; - public getCollaborationNetwork( - rawUserId: string, - filterProperties?: FilterProperties, - observe?: 'events', - reportProgress?: boolean, - options?: { - httpHeaderAccept?: 'application/json'; - context?: HttpContext; - transferCache?: boolean; - }, - ): Observable>; - public getCollaborationNetwork( - rawUserId: string, - filterProperties?: FilterProperties, - observe: any = 'body', - reportProgress: boolean = false, - options?: { - httpHeaderAccept?: 'application/json'; - context?: HttpContext; - transferCache?: boolean; - }, - ): Observable { - if (rawUserId === null || rawUserId === undefined) { - throw new Error( - 'Required parameter rawUserId was null or undefined when calling getCollaborationNetwork.', - ); + constructor(protected httpClient: HttpClient, @Optional() @Inject(BASE_PATH) basePath: string|string[], @Optional() configuration?: Configuration) { + super(basePath, configuration); } - let localVarHeaders = this.defaultHeaders; + /** + * Get a person\'s collaboration network. + * Returns a person\'s collaboration network based on their works and co-authors. + * @endpoint post /api/person/network/{raw_user_id} + * @param rawUserId The raw user ID of the person. + * @param filterProperties + * @param observe set whether or not to return the data Observable as the body, response or events. defaults to returning the body. + * @param reportProgress flag to report request and response progress. + */ + public getCollaborationNetwork(rawUserId: string, filterProperties?: FilterProperties, observe?: 'body', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable; + public getCollaborationNetwork(rawUserId: string, filterProperties?: FilterProperties, observe?: 'response', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable>; + public getCollaborationNetwork(rawUserId: string, filterProperties?: FilterProperties, observe?: 'events', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable>; + public getCollaborationNetwork(rawUserId: string, filterProperties?: FilterProperties, observe: any = 'body', reportProgress: boolean = false, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable { + if (rawUserId === null || rawUserId === undefined) { + throw new Error('Required parameter rawUserId was null or undefined when calling getCollaborationNetwork.'); + } - const localVarHttpHeaderAcceptSelected: string | undefined = - options?.httpHeaderAccept ?? - this.configuration.selectHeaderAccept(['application/json']); - if (localVarHttpHeaderAcceptSelected !== undefined) { - localVarHeaders = localVarHeaders.set( - 'Accept', - localVarHttpHeaderAcceptSelected, - ); + let localVarHeaders = this.defaultHeaders; + + const localVarHttpHeaderAcceptSelected: string | undefined = options?.httpHeaderAccept ?? this.configuration.selectHeaderAccept([ + 'application/json' + ]); + if (localVarHttpHeaderAcceptSelected !== undefined) { + localVarHeaders = localVarHeaders.set('Accept', localVarHttpHeaderAcceptSelected); + } + + const localVarHttpContext: HttpContext = options?.context ?? new HttpContext(); + + const localVarTransferCache: boolean = options?.transferCache ?? true; + + + // to determine the Content-Type header + const consumes: string[] = [ + 'application/json' + ]; + const httpContentTypeSelected: string | undefined = this.configuration.selectHeaderContentType(consumes); + if (httpContentTypeSelected !== undefined) { + localVarHeaders = localVarHeaders.set('Content-Type', httpContentTypeSelected); + } + + let responseType_: 'text' | 'json' | 'blob' = 'json'; + if (localVarHttpHeaderAcceptSelected) { + if (localVarHttpHeaderAcceptSelected.startsWith('text')) { + responseType_ = 'text'; + } else if (this.configuration.isJsonMime(localVarHttpHeaderAcceptSelected)) { + responseType_ = 'json'; + } else { + responseType_ = 'blob'; + } + } + + let localVarPath = `/api/person/network/${this.configuration.encodeParam({name: "rawUserId", value: rawUserId, in: "path", style: "simple", explode: false, dataType: "string", dataFormat: undefined})}`; + const { basePath, withCredentials } = this.configuration; + return this.httpClient.request('post', `${basePath}${localVarPath}`, + { + context: localVarHttpContext, + body: filterProperties, + responseType: responseType_, + ...(withCredentials ? { withCredentials } : {}), + headers: localVarHeaders, + observe: observe, + ...(localVarTransferCache !== undefined ? { transferCache: localVarTransferCache } : {}), + reportProgress: reportProgress + } + ); } - const localVarHttpContext: HttpContext = - options?.context ?? new HttpContext(); - - const localVarTransferCache: boolean = options?.transferCache ?? true; - - // to determine the Content-Type header - const consumes: string[] = ['application/json']; - const httpContentTypeSelected: string | undefined = - this.configuration.selectHeaderContentType(consumes); - if (httpContentTypeSelected !== undefined) { - localVarHeaders = localVarHeaders.set( - 'Content-Type', - httpContentTypeSelected, - ); - } - - let responseType_: 'text' | 'json' | 'blob' = 'json'; - if (localVarHttpHeaderAcceptSelected) { - if (localVarHttpHeaderAcceptSelected.startsWith('text')) { - responseType_ = 'text'; - } else if ( - this.configuration.isJsonMime(localVarHttpHeaderAcceptSelected) - ) { - responseType_ = 'json'; - } else { - responseType_ = 'blob'; - } - } - - let localVarPath = `/api/person/network/${this.configuration.encodeParam({ name: 'rawUserId', value: rawUserId, in: 'path', style: 'simple', explode: false, dataType: 'string', dataFormat: undefined })}`; - const { basePath, withCredentials } = this.configuration; - return this.httpClient.request( - 'post', - `${basePath}${localVarPath}`, - { - context: localVarHttpContext, - body: filterProperties, - responseType: responseType_, - ...(withCredentials ? { withCredentials } : {}), - headers: localVarHeaders, - observe: observe, - ...(localVarTransferCache !== undefined - ? { transferCache: localVarTransferCache } - : {}), - reportProgress: reportProgress, - }, - ); - } } diff --git a/webapp/src/app/api/api/persons.service.ts b/webapp/src/app/api/api/persons.service.ts index cef36fc4..03222a4c 100644 --- a/webapp/src/app/api/api/persons.service.ts +++ b/webapp/src/app/api/api/persons.service.ts @@ -1,7 +1,7 @@ /** * Innovation Search Engine API * - * + * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech @@ -9,18 +9,12 @@ */ /* tslint:disable:no-unused-variable member-ordering */ -import { Inject, Injectable, Optional } from '@angular/core'; -import { - HttpClient, - HttpHeaders, - HttpParams, - HttpResponse, - HttpEvent, - HttpParameterCodec, - HttpContext, -} from '@angular/common/http'; -import { CustomHttpParameterCodec } from '../encoder'; -import { Observable } from 'rxjs'; +import { Inject, Injectable, Optional } from '@angular/core'; +import { HttpClient, HttpHeaders, HttpParams, + HttpResponse, HttpEvent, HttpParameterCodec, HttpContext + } from '@angular/common/http'; +import { CustomHttpParameterCodec } from '../encoder'; +import { Observable } from 'rxjs'; // @ts-ignore import { AuthorsListResponse } from '../model/authorsListResponse'; @@ -32,1739 +26,869 @@ import { HTTPValidationError } from '../model/hTTPValidationError'; import { PersonBio } from '../model/personBio'; // @ts-ignore -import { BASE_PATH, COLLECTION_FORMATS } from '../variables'; -import { Configuration } from '../configuration'; +import { BASE_PATH, COLLECTION_FORMATS } from '../variables'; +import { Configuration } from '../configuration'; import { BaseService } from '../api.base.service'; + + @Injectable({ - providedIn: 'root', + providedIn: 'root' }) export class PersonsService extends BaseService { - constructor( - protected httpClient: HttpClient, - @Optional() @Inject(BASE_PATH) basePath: string | string[], - @Optional() configuration?: Configuration, - ) { - super(basePath, configuration); - } - /** - * Generates a bio for a person by author ID. - * @endpoint get /api/inse-service/persons/bio - * @param authorId OpenAlex author ID (e.g., A5093075883) - * @param include Comma-separated list to include tags - * @param observe set whether or not to return the data Observable as the body, response or events. defaults to returning the body. - * @param reportProgress flag to report request and response progress. - */ - public generatePersonBio( - authorId: string, - include?: string, - observe?: 'body', - reportProgress?: boolean, - options?: { - httpHeaderAccept?: 'application/json'; - context?: HttpContext; - transferCache?: boolean; - }, - ): Observable; - public generatePersonBio( - authorId: string, - include?: string, - observe?: 'response', - reportProgress?: boolean, - options?: { - httpHeaderAccept?: 'application/json'; - context?: HttpContext; - transferCache?: boolean; - }, - ): Observable>; - public generatePersonBio( - authorId: string, - include?: string, - observe?: 'events', - reportProgress?: boolean, - options?: { - httpHeaderAccept?: 'application/json'; - context?: HttpContext; - transferCache?: boolean; - }, - ): Observable>; - public generatePersonBio( - authorId: string, - include?: string, - observe: any = 'body', - reportProgress: boolean = false, - options?: { - httpHeaderAccept?: 'application/json'; - context?: HttpContext; - transferCache?: boolean; - }, - ): Observable { - if (authorId === null || authorId === undefined) { - throw new Error( - 'Required parameter authorId was null or undefined when calling generatePersonBio.', - ); + constructor(protected httpClient: HttpClient, @Optional() @Inject(BASE_PATH) basePath: string|string[], @Optional() configuration?: Configuration) { + super(basePath, configuration); } - let localVarQueryParameters = new HttpParams({ encoder: this.encoder }); - localVarQueryParameters = this.addToHttpParams( - localVarQueryParameters, - authorId, - 'author_id', - ); - localVarQueryParameters = this.addToHttpParams( - localVarQueryParameters, - include, - 'include', - ); - - let localVarHeaders = this.defaultHeaders; - - const localVarHttpHeaderAcceptSelected: string | undefined = - options?.httpHeaderAccept ?? - this.configuration.selectHeaderAccept(['application/json']); - if (localVarHttpHeaderAcceptSelected !== undefined) { - localVarHeaders = localVarHeaders.set( - 'Accept', - localVarHttpHeaderAcceptSelected, - ); - } - - const localVarHttpContext: HttpContext = - options?.context ?? new HttpContext(); - - const localVarTransferCache: boolean = options?.transferCache ?? true; - - let responseType_: 'text' | 'json' | 'blob' = 'json'; - if (localVarHttpHeaderAcceptSelected) { - if (localVarHttpHeaderAcceptSelected.startsWith('text')) { - responseType_ = 'text'; - } else if ( - this.configuration.isJsonMime(localVarHttpHeaderAcceptSelected) - ) { - responseType_ = 'json'; - } else { - responseType_ = 'blob'; - } - } - - let localVarPath = `/api/inse-service/persons/bio`; - const { basePath, withCredentials } = this.configuration; - return this.httpClient.request( - 'get', - `${basePath}${localVarPath}`, - { - context: localVarHttpContext, - params: localVarQueryParameters, - responseType: responseType_, - ...(withCredentials ? { withCredentials } : {}), - headers: localVarHeaders, - observe: observe, - ...(localVarTransferCache !== undefined - ? { transferCache: localVarTransferCache } - : {}), - reportProgress: reportProgress, - }, - ); - } - - /** - * Searches for person by ID. - * @endpoint get /api/inse-service/person/{id} - * @param id OpenAlex author ID - * @param include Which data do we require? include tags: topics_full, topic_share, summary_stats, ids, last_known_institutions, ... - * @param observe set whether or not to return the data Observable as the body, response or events. defaults to returning the body. - * @param reportProgress flag to report request and response progress. - */ - public getPersonByID( - id: string, - include?: string, - observe?: 'body', - reportProgress?: boolean, - options?: { - httpHeaderAccept?: 'application/json'; - context?: HttpContext; - transferCache?: boolean; - }, - ): Observable; - public getPersonByID( - id: string, - include?: string, - observe?: 'response', - reportProgress?: boolean, - options?: { - httpHeaderAccept?: 'application/json'; - context?: HttpContext; - transferCache?: boolean; - }, - ): Observable>; - public getPersonByID( - id: string, - include?: string, - observe?: 'events', - reportProgress?: boolean, - options?: { - httpHeaderAccept?: 'application/json'; - context?: HttpContext; - transferCache?: boolean; - }, - ): Observable>; - public getPersonByID( - id: string, - include?: string, - observe: any = 'body', - reportProgress: boolean = false, - options?: { - httpHeaderAccept?: 'application/json'; - context?: HttpContext; - transferCache?: boolean; - }, - ): Observable { - if (id === null || id === undefined) { - throw new Error( - 'Required parameter id was null or undefined when calling getPersonByID.', - ); - } - - let localVarQueryParameters = new HttpParams({ encoder: this.encoder }); - localVarQueryParameters = this.addToHttpParams( - localVarQueryParameters, - include, - 'include', - ); - - let localVarHeaders = this.defaultHeaders; - - const localVarHttpHeaderAcceptSelected: string | undefined = - options?.httpHeaderAccept ?? - this.configuration.selectHeaderAccept(['application/json']); - if (localVarHttpHeaderAcceptSelected !== undefined) { - localVarHeaders = localVarHeaders.set( - 'Accept', - localVarHttpHeaderAcceptSelected, - ); - } - - const localVarHttpContext: HttpContext = - options?.context ?? new HttpContext(); - - const localVarTransferCache: boolean = options?.transferCache ?? true; - - let responseType_: 'text' | 'json' | 'blob' = 'json'; - if (localVarHttpHeaderAcceptSelected) { - if (localVarHttpHeaderAcceptSelected.startsWith('text')) { - responseType_ = 'text'; - } else if ( - this.configuration.isJsonMime(localVarHttpHeaderAcceptSelected) - ) { - responseType_ = 'json'; - } else { - responseType_ = 'blob'; - } - } - - let localVarPath = `/api/inse-service/person/${this.configuration.encodeParam({ name: 'id', value: id, in: 'path', style: 'simple', explode: false, dataType: 'string', dataFormat: undefined })}`; - const { basePath, withCredentials } = this.configuration; - return this.httpClient.request( - 'get', - `${basePath}${localVarPath}`, - { - context: localVarHttpContext, - params: localVarQueryParameters, - responseType: responseType_, - ...(withCredentials ? { withCredentials } : {}), - headers: localVarHeaders, - observe: observe, - ...(localVarTransferCache !== undefined - ? { transferCache: localVarTransferCache } - : {}), - reportProgress: reportProgress, - }, - ); - } - - /** - * Searches for person by ID. - * @endpoint get /api/inse-service/person/{id} - * @param id OpenAlex author ID - * @param include Which data do we require? include tags: topics_full, topic_share, summary_stats, ids, last_known_institutions, ... - * @param observe set whether or not to return the data Observable as the body, response or events. defaults to returning the body. - * @param reportProgress flag to report request and response progress. - */ - public getPersonByID_1( - id: string, - include?: string, - observe?: 'body', - reportProgress?: boolean, - options?: { - httpHeaderAccept?: 'application/json'; - context?: HttpContext; - transferCache?: boolean; - }, - ): Observable; - public getPersonByID_1( - id: string, - include?: string, - observe?: 'response', - reportProgress?: boolean, - options?: { - httpHeaderAccept?: 'application/json'; - context?: HttpContext; - transferCache?: boolean; - }, - ): Observable>; - public getPersonByID_1( - id: string, - include?: string, - observe?: 'events', - reportProgress?: boolean, - options?: { - httpHeaderAccept?: 'application/json'; - context?: HttpContext; - transferCache?: boolean; - }, - ): Observable>; - public getPersonByID_1( - id: string, - include?: string, - observe: any = 'body', - reportProgress: boolean = false, - options?: { - httpHeaderAccept?: 'application/json'; - context?: HttpContext; - transferCache?: boolean; - }, - ): Observable { - if (id === null || id === undefined) { - throw new Error( - 'Required parameter id was null or undefined when calling getPersonByID_1.', - ); - } - - let localVarQueryParameters = new HttpParams({ encoder: this.encoder }); - localVarQueryParameters = this.addToHttpParams( - localVarQueryParameters, - include, - 'include', - ); - - let localVarHeaders = this.defaultHeaders; - - const localVarHttpHeaderAcceptSelected: string | undefined = - options?.httpHeaderAccept ?? - this.configuration.selectHeaderAccept(['application/json']); - if (localVarHttpHeaderAcceptSelected !== undefined) { - localVarHeaders = localVarHeaders.set( - 'Accept', - localVarHttpHeaderAcceptSelected, - ); - } - - const localVarHttpContext: HttpContext = - options?.context ?? new HttpContext(); - - const localVarTransferCache: boolean = options?.transferCache ?? true; - - let responseType_: 'text' | 'json' | 'blob' = 'json'; - if (localVarHttpHeaderAcceptSelected) { - if (localVarHttpHeaderAcceptSelected.startsWith('text')) { - responseType_ = 'text'; - } else if ( - this.configuration.isJsonMime(localVarHttpHeaderAcceptSelected) - ) { - responseType_ = 'json'; - } else { - responseType_ = 'blob'; - } - } - - let localVarPath = `/api/inse-service/person/${this.configuration.encodeParam({ name: 'id', value: id, in: 'path', style: 'simple', explode: false, dataType: 'string', dataFormat: undefined })}`; - const { basePath, withCredentials } = this.configuration; - return this.httpClient.request( - 'get', - `${basePath}${localVarPath}`, - { - context: localVarHttpContext, - params: localVarQueryParameters, - responseType: responseType_, - ...(withCredentials ? { withCredentials } : {}), - headers: localVarHeaders, - observe: observe, - ...(localVarTransferCache !== undefined - ? { transferCache: localVarTransferCache } - : {}), - reportProgress: reportProgress, - }, - ); - } - - /** - * Searches for persons by ID or name. - * @endpoint get /api/inse-service/persons/search - * @param authorId OpenAlex author ID (e.g., A5093075883) - * @param query Search query (e.g., Arman AND Arzani) - * @param include Comma-separated include tags: topics_full, topic_share, summary_stats, ids, last_known_institutions, sources, counts_by_year, works_api_url, dates, cited_by_count_boost - * @param observe set whether or not to return the data Observable as the body, response or events. defaults to returning the body. - * @param reportProgress flag to report request and response progress. - */ - public searchPersons( - authorId?: string, - query?: string, - include?: string, - observe?: 'body', - reportProgress?: boolean, - options?: { - httpHeaderAccept?: 'application/json'; - context?: HttpContext; - transferCache?: boolean; - }, - ): Observable; - public searchPersons( - authorId?: string, - query?: string, - include?: string, - observe?: 'response', - reportProgress?: boolean, - options?: { - httpHeaderAccept?: 'application/json'; - context?: HttpContext; - transferCache?: boolean; - }, - ): Observable>; - public searchPersons( - authorId?: string, - query?: string, - include?: string, - observe?: 'events', - reportProgress?: boolean, - options?: { - httpHeaderAccept?: 'application/json'; - context?: HttpContext; - transferCache?: boolean; - }, - ): Observable>; - public searchPersons( - authorId?: string, - query?: string, - include?: string, - observe: any = 'body', - reportProgress: boolean = false, - options?: { - httpHeaderAccept?: 'application/json'; - context?: HttpContext; - transferCache?: boolean; - }, - ): Observable { - let localVarQueryParameters = new HttpParams({ encoder: this.encoder }); - localVarQueryParameters = this.addToHttpParams( - localVarQueryParameters, - authorId, - 'author_id', - ); - localVarQueryParameters = this.addToHttpParams( - localVarQueryParameters, - query, - 'query', - ); - localVarQueryParameters = this.addToHttpParams( - localVarQueryParameters, - include, - 'include', - ); - - let localVarHeaders = this.defaultHeaders; - - const localVarHttpHeaderAcceptSelected: string | undefined = - options?.httpHeaderAccept ?? - this.configuration.selectHeaderAccept(['application/json']); - if (localVarHttpHeaderAcceptSelected !== undefined) { - localVarHeaders = localVarHeaders.set( - 'Accept', - localVarHttpHeaderAcceptSelected, - ); - } - - const localVarHttpContext: HttpContext = - options?.context ?? new HttpContext(); - - const localVarTransferCache: boolean = options?.transferCache ?? true; - - let responseType_: 'text' | 'json' | 'blob' = 'json'; - if (localVarHttpHeaderAcceptSelected) { - if (localVarHttpHeaderAcceptSelected.startsWith('text')) { - responseType_ = 'text'; - } else if ( - this.configuration.isJsonMime(localVarHttpHeaderAcceptSelected) - ) { - responseType_ = 'json'; - } else { - responseType_ = 'blob'; - } - } - - let localVarPath = `/api/inse-service/persons/search`; - const { basePath, withCredentials } = this.configuration; - return this.httpClient.request( - 'get', - `${basePath}${localVarPath}`, - { - context: localVarHttpContext, - params: localVarQueryParameters, - responseType: responseType_, - ...(withCredentials ? { withCredentials } : {}), - headers: localVarHeaders, - observe: observe, - ...(localVarTransferCache !== undefined - ? { transferCache: localVarTransferCache } - : {}), - reportProgress: reportProgress, - }, - ); - } - - /** - * Searches for person by name. - * @endpoint get /api/inse-service/persons/autocomplete - * @param authorName Authors name (e.g., Arman Arzani) - * @param include Which data do we require? include tags: topics_full, topic_share, summary_stats, ids, last_known_institutions, ... - * @param observe set whether or not to return the data Observable as the body, response or events. defaults to returning the body. - * @param reportProgress flag to report request and response progress. - */ - public searchPersonsAutocomplete( - authorName: string, - include: string, - observe?: 'body', - reportProgress?: boolean, - options?: { - httpHeaderAccept?: 'application/json'; - context?: HttpContext; - transferCache?: boolean; - }, - ): Observable; - public searchPersonsAutocomplete( - authorName: string, - include: string, - observe?: 'response', - reportProgress?: boolean, - options?: { - httpHeaderAccept?: 'application/json'; - context?: HttpContext; - transferCache?: boolean; - }, - ): Observable>; - public searchPersonsAutocomplete( - authorName: string, - include: string, - observe?: 'events', - reportProgress?: boolean, - options?: { - httpHeaderAccept?: 'application/json'; - context?: HttpContext; - transferCache?: boolean; - }, - ): Observable>; - public searchPersonsAutocomplete( - authorName: string, - include: string, - observe: any = 'body', - reportProgress: boolean = false, - options?: { - httpHeaderAccept?: 'application/json'; - context?: HttpContext; - transferCache?: boolean; - }, - ): Observable { - if (authorName === null || authorName === undefined) { - throw new Error( - 'Required parameter authorName was null or undefined when calling searchPersonsAutocomplete.', - ); - } - if (include === null || include === undefined) { - throw new Error( - 'Required parameter include was null or undefined when calling searchPersonsAutocomplete.', - ); - } - - let localVarQueryParameters = new HttpParams({ encoder: this.encoder }); - localVarQueryParameters = this.addToHttpParams( - localVarQueryParameters, - authorName, - 'author_name', - ); - localVarQueryParameters = this.addToHttpParams( - localVarQueryParameters, - include, - 'include', - ); - - let localVarHeaders = this.defaultHeaders; - - const localVarHttpHeaderAcceptSelected: string | undefined = - options?.httpHeaderAccept ?? - this.configuration.selectHeaderAccept(['application/json']); - if (localVarHttpHeaderAcceptSelected !== undefined) { - localVarHeaders = localVarHeaders.set( - 'Accept', - localVarHttpHeaderAcceptSelected, - ); - } - - const localVarHttpContext: HttpContext = - options?.context ?? new HttpContext(); - - const localVarTransferCache: boolean = options?.transferCache ?? true; - - let responseType_: 'text' | 'json' | 'blob' = 'json'; - if (localVarHttpHeaderAcceptSelected) { - if (localVarHttpHeaderAcceptSelected.startsWith('text')) { - responseType_ = 'text'; - } else if ( - this.configuration.isJsonMime(localVarHttpHeaderAcceptSelected) - ) { - responseType_ = 'json'; - } else { - responseType_ = 'blob'; - } - } - - let localVarPath = `/api/inse-service/persons/autocomplete`; - const { basePath, withCredentials } = this.configuration; - return this.httpClient.request( - 'get', - `${basePath}${localVarPath}`, - { - context: localVarHttpContext, - params: localVarQueryParameters, - responseType: responseType_, - ...(withCredentials ? { withCredentials } : {}), - headers: localVarHeaders, - observe: observe, - ...(localVarTransferCache !== undefined - ? { transferCache: localVarTransferCache } - : {}), - reportProgress: reportProgress, - }, - ); - } - - /** - * Searches for person by name. - * @endpoint get /api/inse-service/persons/autocomplete - * @param authorName Authors name (e.g., Arman Arzani) - * @param include Which data do we require? include tags: topics_full, topic_share, summary_stats, ids, last_known_institutions, ... - * @param observe set whether or not to return the data Observable as the body, response or events. defaults to returning the body. - * @param reportProgress flag to report request and response progress. - */ - public searchPersonsAutocomplete_2( - authorName: string, - include: string, - observe?: 'body', - reportProgress?: boolean, - options?: { - httpHeaderAccept?: 'application/json'; - context?: HttpContext; - transferCache?: boolean; - }, - ): Observable; - public searchPersonsAutocomplete_2( - authorName: string, - include: string, - observe?: 'response', - reportProgress?: boolean, - options?: { - httpHeaderAccept?: 'application/json'; - context?: HttpContext; - transferCache?: boolean; - }, - ): Observable>; - public searchPersonsAutocomplete_2( - authorName: string, - include: string, - observe?: 'events', - reportProgress?: boolean, - options?: { - httpHeaderAccept?: 'application/json'; - context?: HttpContext; - transferCache?: boolean; - }, - ): Observable>; - public searchPersonsAutocomplete_2( - authorName: string, - include: string, - observe: any = 'body', - reportProgress: boolean = false, - options?: { - httpHeaderAccept?: 'application/json'; - context?: HttpContext; - transferCache?: boolean; - }, - ): Observable { - if (authorName === null || authorName === undefined) { - throw new Error( - 'Required parameter authorName was null or undefined when calling searchPersonsAutocomplete_2.', - ); - } - if (include === null || include === undefined) { - throw new Error( - 'Required parameter include was null or undefined when calling searchPersonsAutocomplete_2.', - ); - } - - let localVarQueryParameters = new HttpParams({ encoder: this.encoder }); - localVarQueryParameters = this.addToHttpParams( - localVarQueryParameters, - authorName, - 'author_name', - ); - localVarQueryParameters = this.addToHttpParams( - localVarQueryParameters, - include, - 'include', - ); - - let localVarHeaders = this.defaultHeaders; - - const localVarHttpHeaderAcceptSelected: string | undefined = - options?.httpHeaderAccept ?? - this.configuration.selectHeaderAccept(['application/json']); - if (localVarHttpHeaderAcceptSelected !== undefined) { - localVarHeaders = localVarHeaders.set( - 'Accept', - localVarHttpHeaderAcceptSelected, - ); - } - - const localVarHttpContext: HttpContext = - options?.context ?? new HttpContext(); - - const localVarTransferCache: boolean = options?.transferCache ?? true; - - let responseType_: 'text' | 'json' | 'blob' = 'json'; - if (localVarHttpHeaderAcceptSelected) { - if (localVarHttpHeaderAcceptSelected.startsWith('text')) { - responseType_ = 'text'; - } else if ( - this.configuration.isJsonMime(localVarHttpHeaderAcceptSelected) - ) { - responseType_ = 'json'; - } else { - responseType_ = 'blob'; - } - } - - let localVarPath = `/api/inse-service/persons/autocomplete`; - const { basePath, withCredentials } = this.configuration; - return this.httpClient.request( - 'get', - `${basePath}${localVarPath}`, - { - context: localVarHttpContext, - params: localVarQueryParameters, - responseType: responseType_, - ...(withCredentials ? { withCredentials } : {}), - headers: localVarHeaders, - observe: observe, - ...(localVarTransferCache !== undefined - ? { transferCache: localVarTransferCache } - : {}), - reportProgress: reportProgress, - }, - ); - } - - /** - * Searches for persons by institution name. - * @endpoint get /api/inse-service/persons/searchByInstitution - * @param institutionName Institution name (e.g., MIT, Oxford University) - * @param include Which data do we require? include tags: topics_full, topic_share, summary_stats, ids, last_known_institutions, ... - * @param limit Limit of search page results - * @param pageOffset Offset of the result page - * @param observe set whether or not to return the data Observable as the body, response or events. defaults to returning the body. - * @param reportProgress flag to report request and response progress. - */ - public searchPersonsByInstitution( - institutionName: string, - include: string, - limit?: number, - pageOffset?: number, - observe?: 'body', - reportProgress?: boolean, - options?: { - httpHeaderAccept?: 'application/json'; - context?: HttpContext; - transferCache?: boolean; - }, - ): Observable; - public searchPersonsByInstitution( - institutionName: string, - include: string, - limit?: number, - pageOffset?: number, - observe?: 'response', - reportProgress?: boolean, - options?: { - httpHeaderAccept?: 'application/json'; - context?: HttpContext; - transferCache?: boolean; - }, - ): Observable>; - public searchPersonsByInstitution( - institutionName: string, - include: string, - limit?: number, - pageOffset?: number, - observe?: 'events', - reportProgress?: boolean, - options?: { - httpHeaderAccept?: 'application/json'; - context?: HttpContext; - transferCache?: boolean; - }, - ): Observable>; - public searchPersonsByInstitution( - institutionName: string, - include: string, - limit?: number, - pageOffset?: number, - observe: any = 'body', - reportProgress: boolean = false, - options?: { - httpHeaderAccept?: 'application/json'; - context?: HttpContext; - transferCache?: boolean; - }, - ): Observable { - if (institutionName === null || institutionName === undefined) { - throw new Error( - 'Required parameter institutionName was null or undefined when calling searchPersonsByInstitution.', - ); - } - if (include === null || include === undefined) { - throw new Error( - 'Required parameter include was null or undefined when calling searchPersonsByInstitution.', - ); - } - - let localVarQueryParameters = new HttpParams({ encoder: this.encoder }); - localVarQueryParameters = this.addToHttpParams( - localVarQueryParameters, - institutionName, - 'institution_name', - ); - localVarQueryParameters = this.addToHttpParams( - localVarQueryParameters, - include, - 'include', - ); - localVarQueryParameters = this.addToHttpParams( - localVarQueryParameters, - limit, - 'limit', - ); - localVarQueryParameters = this.addToHttpParams( - localVarQueryParameters, - pageOffset, - 'page_offset', - ); - - let localVarHeaders = this.defaultHeaders; - - const localVarHttpHeaderAcceptSelected: string | undefined = - options?.httpHeaderAccept ?? - this.configuration.selectHeaderAccept(['application/json']); - if (localVarHttpHeaderAcceptSelected !== undefined) { - localVarHeaders = localVarHeaders.set( - 'Accept', - localVarHttpHeaderAcceptSelected, - ); - } - - const localVarHttpContext: HttpContext = - options?.context ?? new HttpContext(); - - const localVarTransferCache: boolean = options?.transferCache ?? true; - - let responseType_: 'text' | 'json' | 'blob' = 'json'; - if (localVarHttpHeaderAcceptSelected) { - if (localVarHttpHeaderAcceptSelected.startsWith('text')) { - responseType_ = 'text'; - } else if ( - this.configuration.isJsonMime(localVarHttpHeaderAcceptSelected) - ) { - responseType_ = 'json'; - } else { - responseType_ = 'blob'; - } - } - - let localVarPath = `/api/inse-service/persons/searchByInstitution`; - const { basePath, withCredentials } = this.configuration; - return this.httpClient.request( - 'get', - `${basePath}${localVarPath}`, - { - context: localVarHttpContext, - params: localVarQueryParameters, - responseType: responseType_, - ...(withCredentials ? { withCredentials } : {}), - headers: localVarHeaders, - observe: observe, - ...(localVarTransferCache !== undefined - ? { transferCache: localVarTransferCache } - : {}), - reportProgress: reportProgress, - }, - ); - } - - /** - * Searches for persons by institution name. - * @endpoint get /api/inse-service/persons/searchByInstitution - * @param institutionName Institution name (e.g., MIT, Oxford University) - * @param include Which data do we require? include tags: topics_full, topic_share, summary_stats, ids, last_known_institutions, ... - * @param limit Limit of search page results - * @param pageOffset Offset of the result page - * @param observe set whether or not to return the data Observable as the body, response or events. defaults to returning the body. - * @param reportProgress flag to report request and response progress. - */ - public searchPersonsByInstitution_3( - institutionName: string, - include: string, - limit?: number, - pageOffset?: number, - observe?: 'body', - reportProgress?: boolean, - options?: { - httpHeaderAccept?: 'application/json'; - context?: HttpContext; - transferCache?: boolean; - }, - ): Observable; - public searchPersonsByInstitution_3( - institutionName: string, - include: string, - limit?: number, - pageOffset?: number, - observe?: 'response', - reportProgress?: boolean, - options?: { - httpHeaderAccept?: 'application/json'; - context?: HttpContext; - transferCache?: boolean; - }, - ): Observable>; - public searchPersonsByInstitution_3( - institutionName: string, - include: string, - limit?: number, - pageOffset?: number, - observe?: 'events', - reportProgress?: boolean, - options?: { - httpHeaderAccept?: 'application/json'; - context?: HttpContext; - transferCache?: boolean; - }, - ): Observable>; - public searchPersonsByInstitution_3( - institutionName: string, - include: string, - limit?: number, - pageOffset?: number, - observe: any = 'body', - reportProgress: boolean = false, - options?: { - httpHeaderAccept?: 'application/json'; - context?: HttpContext; - transferCache?: boolean; - }, - ): Observable { - if (institutionName === null || institutionName === undefined) { - throw new Error( - 'Required parameter institutionName was null or undefined when calling searchPersonsByInstitution_3.', - ); - } - if (include === null || include === undefined) { - throw new Error( - 'Required parameter include was null or undefined when calling searchPersonsByInstitution_3.', - ); - } - - let localVarQueryParameters = new HttpParams({ encoder: this.encoder }); - localVarQueryParameters = this.addToHttpParams( - localVarQueryParameters, - institutionName, - 'institution_name', - ); - localVarQueryParameters = this.addToHttpParams( - localVarQueryParameters, - include, - 'include', - ); - localVarQueryParameters = this.addToHttpParams( - localVarQueryParameters, - limit, - 'limit', - ); - localVarQueryParameters = this.addToHttpParams( - localVarQueryParameters, - pageOffset, - 'page_offset', - ); - - let localVarHeaders = this.defaultHeaders; - - const localVarHttpHeaderAcceptSelected: string | undefined = - options?.httpHeaderAccept ?? - this.configuration.selectHeaderAccept(['application/json']); - if (localVarHttpHeaderAcceptSelected !== undefined) { - localVarHeaders = localVarHeaders.set( - 'Accept', - localVarHttpHeaderAcceptSelected, - ); - } - - const localVarHttpContext: HttpContext = - options?.context ?? new HttpContext(); - - const localVarTransferCache: boolean = options?.transferCache ?? true; - - let responseType_: 'text' | 'json' | 'blob' = 'json'; - if (localVarHttpHeaderAcceptSelected) { - if (localVarHttpHeaderAcceptSelected.startsWith('text')) { - responseType_ = 'text'; - } else if ( - this.configuration.isJsonMime(localVarHttpHeaderAcceptSelected) - ) { - responseType_ = 'json'; - } else { - responseType_ = 'blob'; - } - } - - let localVarPath = `/api/inse-service/persons/searchByInstitution`; - const { basePath, withCredentials } = this.configuration; - return this.httpClient.request( - 'get', - `${basePath}${localVarPath}`, - { - context: localVarHttpContext, - params: localVarQueryParameters, - responseType: responseType_, - ...(withCredentials ? { withCredentials } : {}), - headers: localVarHeaders, - observe: observe, - ...(localVarTransferCache !== undefined - ? { transferCache: localVarTransferCache } - : {}), - reportProgress: reportProgress, - }, - ); - } - - /** - * Searches for person by name. - * @endpoint get /api/inse-service/persons/searchByName - * @param authorName Authors name (e.g., Arman Arzani) - * @param include Which data do we require? include tags: topics_full, topic_share, summary_stats, ids, last_known_institutions, ... - * @param limit Limit of search page results - * @param pageOffset Offset of the result page - * @param observe set whether or not to return the data Observable as the body, response or events. defaults to returning the body. - * @param reportProgress flag to report request and response progress. - */ - public searchPersonsByName( - authorName: string, - include: string, - limit?: number, - pageOffset?: number, - observe?: 'body', - reportProgress?: boolean, - options?: { - httpHeaderAccept?: 'application/json'; - context?: HttpContext; - transferCache?: boolean; - }, - ): Observable; - public searchPersonsByName( - authorName: string, - include: string, - limit?: number, - pageOffset?: number, - observe?: 'response', - reportProgress?: boolean, - options?: { - httpHeaderAccept?: 'application/json'; - context?: HttpContext; - transferCache?: boolean; - }, - ): Observable>; - public searchPersonsByName( - authorName: string, - include: string, - limit?: number, - pageOffset?: number, - observe?: 'events', - reportProgress?: boolean, - options?: { - httpHeaderAccept?: 'application/json'; - context?: HttpContext; - transferCache?: boolean; - }, - ): Observable>; - public searchPersonsByName( - authorName: string, - include: string, - limit?: number, - pageOffset?: number, - observe: any = 'body', - reportProgress: boolean = false, - options?: { - httpHeaderAccept?: 'application/json'; - context?: HttpContext; - transferCache?: boolean; - }, - ): Observable { - if (authorName === null || authorName === undefined) { - throw new Error( - 'Required parameter authorName was null or undefined when calling searchPersonsByName.', - ); - } - if (include === null || include === undefined) { - throw new Error( - 'Required parameter include was null or undefined when calling searchPersonsByName.', - ); - } - - let localVarQueryParameters = new HttpParams({ encoder: this.encoder }); - localVarQueryParameters = this.addToHttpParams( - localVarQueryParameters, - authorName, - 'author_name', - ); - localVarQueryParameters = this.addToHttpParams( - localVarQueryParameters, - include, - 'include', - ); - localVarQueryParameters = this.addToHttpParams( - localVarQueryParameters, - limit, - 'limit', - ); - localVarQueryParameters = this.addToHttpParams( - localVarQueryParameters, - pageOffset, - 'page_offset', - ); - - let localVarHeaders = this.defaultHeaders; - - const localVarHttpHeaderAcceptSelected: string | undefined = - options?.httpHeaderAccept ?? - this.configuration.selectHeaderAccept(['application/json']); - if (localVarHttpHeaderAcceptSelected !== undefined) { - localVarHeaders = localVarHeaders.set( - 'Accept', - localVarHttpHeaderAcceptSelected, - ); - } - - const localVarHttpContext: HttpContext = - options?.context ?? new HttpContext(); - - const localVarTransferCache: boolean = options?.transferCache ?? true; - - let responseType_: 'text' | 'json' | 'blob' = 'json'; - if (localVarHttpHeaderAcceptSelected) { - if (localVarHttpHeaderAcceptSelected.startsWith('text')) { - responseType_ = 'text'; - } else if ( - this.configuration.isJsonMime(localVarHttpHeaderAcceptSelected) - ) { - responseType_ = 'json'; - } else { - responseType_ = 'blob'; - } - } - - let localVarPath = `/api/inse-service/persons/searchByName`; - const { basePath, withCredentials } = this.configuration; - return this.httpClient.request( - 'get', - `${basePath}${localVarPath}`, - { - context: localVarHttpContext, - params: localVarQueryParameters, - responseType: responseType_, - ...(withCredentials ? { withCredentials } : {}), - headers: localVarHeaders, - observe: observe, - ...(localVarTransferCache !== undefined - ? { transferCache: localVarTransferCache } - : {}), - reportProgress: reportProgress, - }, - ); - } - - /** - * Searches for person by name. - * @endpoint get /api/inse-service/persons/searchByName - * @param authorName Authors name (e.g., Arman Arzani) - * @param include Which data do we require? include tags: topics_full, topic_share, summary_stats, ids, last_known_institutions, ... - * @param limit Limit of search page results - * @param pageOffset Offset of the result page - * @param observe set whether or not to return the data Observable as the body, response or events. defaults to returning the body. - * @param reportProgress flag to report request and response progress. - */ - public searchPersonsByName_4( - authorName: string, - include: string, - limit?: number, - pageOffset?: number, - observe?: 'body', - reportProgress?: boolean, - options?: { - httpHeaderAccept?: 'application/json'; - context?: HttpContext; - transferCache?: boolean; - }, - ): Observable; - public searchPersonsByName_4( - authorName: string, - include: string, - limit?: number, - pageOffset?: number, - observe?: 'response', - reportProgress?: boolean, - options?: { - httpHeaderAccept?: 'application/json'; - context?: HttpContext; - transferCache?: boolean; - }, - ): Observable>; - public searchPersonsByName_4( - authorName: string, - include: string, - limit?: number, - pageOffset?: number, - observe?: 'events', - reportProgress?: boolean, - options?: { - httpHeaderAccept?: 'application/json'; - context?: HttpContext; - transferCache?: boolean; - }, - ): Observable>; - public searchPersonsByName_4( - authorName: string, - include: string, - limit?: number, - pageOffset?: number, - observe: any = 'body', - reportProgress: boolean = false, - options?: { - httpHeaderAccept?: 'application/json'; - context?: HttpContext; - transferCache?: boolean; - }, - ): Observable { - if (authorName === null || authorName === undefined) { - throw new Error( - 'Required parameter authorName was null or undefined when calling searchPersonsByName_4.', - ); - } - if (include === null || include === undefined) { - throw new Error( - 'Required parameter include was null or undefined when calling searchPersonsByName_4.', - ); - } - - let localVarQueryParameters = new HttpParams({ encoder: this.encoder }); - localVarQueryParameters = this.addToHttpParams( - localVarQueryParameters, - authorName, - 'author_name', - ); - localVarQueryParameters = this.addToHttpParams( - localVarQueryParameters, - include, - 'include', - ); - localVarQueryParameters = this.addToHttpParams( - localVarQueryParameters, - limit, - 'limit', - ); - localVarQueryParameters = this.addToHttpParams( - localVarQueryParameters, - pageOffset, - 'page_offset', - ); - - let localVarHeaders = this.defaultHeaders; - - const localVarHttpHeaderAcceptSelected: string | undefined = - options?.httpHeaderAccept ?? - this.configuration.selectHeaderAccept(['application/json']); - if (localVarHttpHeaderAcceptSelected !== undefined) { - localVarHeaders = localVarHeaders.set( - 'Accept', - localVarHttpHeaderAcceptSelected, - ); - } - - const localVarHttpContext: HttpContext = - options?.context ?? new HttpContext(); - - const localVarTransferCache: boolean = options?.transferCache ?? true; - - let responseType_: 'text' | 'json' | 'blob' = 'json'; - if (localVarHttpHeaderAcceptSelected) { - if (localVarHttpHeaderAcceptSelected.startsWith('text')) { - responseType_ = 'text'; - } else if ( - this.configuration.isJsonMime(localVarHttpHeaderAcceptSelected) - ) { - responseType_ = 'json'; - } else { - responseType_ = 'blob'; - } - } - - let localVarPath = `/api/inse-service/persons/searchByName`; - const { basePath, withCredentials } = this.configuration; - return this.httpClient.request( - 'get', - `${basePath}${localVarPath}`, - { - context: localVarHttpContext, - params: localVarQueryParameters, - responseType: responseType_, - ...(withCredentials ? { withCredentials } : {}), - headers: localVarHeaders, - observe: observe, - ...(localVarTransferCache !== undefined - ? { transferCache: localVarTransferCache } - : {}), - reportProgress: reportProgress, - }, - ); - } - - /** - * Searches for persons with advanced filters (Topic & Institution) and pagination. - * @endpoint get /api/inse-service/persons/search-list - * @param query Search query (e.g., Arman AND Arzani) - * @param institutionName Filter by institution name - * @param sortBy Value to sort by - * @param sortOrder asc or desc? - * @param topic Filter by topic display names - * @param page Page number (1-indexed) - * @param pageSize Results per page - * @param include Comma-separated include tags - * @param strict Strict institution search by target year - * @param filterMode Filter mode: \'in\' or \'from\' - * @param filterYear Filter year - * @param observe set whether or not to return the data Observable as the body, response or events. defaults to returning the body. - * @param reportProgress flag to report request and response progress. - */ - public searchPersonsList( - query?: string, - institutionName?: string, - sortBy?: string, - sortOrder?: string, - topic?: Array, - page?: number, - pageSize?: number, - include?: string, - strict?: boolean, - filterMode?: string, - filterYear?: number, - observe?: 'body', - reportProgress?: boolean, - options?: { - httpHeaderAccept?: 'application/json'; - context?: HttpContext; - transferCache?: boolean; - }, - ): Observable; - public searchPersonsList( - query?: string, - institutionName?: string, - sortBy?: string, - sortOrder?: string, - topic?: Array, - page?: number, - pageSize?: number, - include?: string, - strict?: boolean, - filterMode?: string, - filterYear?: number, - observe?: 'response', - reportProgress?: boolean, - options?: { - httpHeaderAccept?: 'application/json'; - context?: HttpContext; - transferCache?: boolean; - }, - ): Observable>; - public searchPersonsList( - query?: string, - institutionName?: string, - sortBy?: string, - sortOrder?: string, - topic?: Array, - page?: number, - pageSize?: number, - include?: string, - strict?: boolean, - filterMode?: string, - filterYear?: number, - observe?: 'events', - reportProgress?: boolean, - options?: { - httpHeaderAccept?: 'application/json'; - context?: HttpContext; - transferCache?: boolean; - }, - ): Observable>; - public searchPersonsList( - query?: string, - institutionName?: string, - sortBy?: string, - sortOrder?: string, - topic?: Array, - page?: number, - pageSize?: number, - include?: string, - strict?: boolean, - filterMode?: string, - filterYear?: number, - observe: any = 'body', - reportProgress: boolean = false, - options?: { - httpHeaderAccept?: 'application/json'; - context?: HttpContext; - transferCache?: boolean; - }, - ): Observable { - let localVarQueryParameters = new HttpParams({ encoder: this.encoder }); - localVarQueryParameters = this.addToHttpParams( - localVarQueryParameters, - query, - 'query', - ); - localVarQueryParameters = this.addToHttpParams( - localVarQueryParameters, - institutionName, - 'institutionName', - ); - localVarQueryParameters = this.addToHttpParams( - localVarQueryParameters, - sortBy, - 'sortBy', - ); - localVarQueryParameters = this.addToHttpParams( - localVarQueryParameters, - sortOrder, - 'sortOrder', - ); - if (topic) { - topic.forEach((element) => { - localVarQueryParameters = this.addToHttpParams( - localVarQueryParameters, - element, - 'topic', + /** + * Generates a bio for a person by author ID. + * @endpoint get /api/inse-service/persons/bio + * @param authorId OpenAlex author ID (e.g., A5093075883) + * @param include Comma-separated list to include tags + * @param observe set whether or not to return the data Observable as the body, response or events. defaults to returning the body. + * @param reportProgress flag to report request and response progress. + */ + public generatePersonBio(authorId: string, include?: string, observe?: 'body', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable; + public generatePersonBio(authorId: string, include?: string, observe?: 'response', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable>; + public generatePersonBio(authorId: string, include?: string, observe?: 'events', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable>; + public generatePersonBio(authorId: string, include?: string, observe: any = 'body', reportProgress: boolean = false, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable { + if (authorId === null || authorId === undefined) { + throw new Error('Required parameter authorId was null or undefined when calling generatePersonBio.'); + } + + let localVarQueryParameters = new HttpParams({encoder: this.encoder}); + localVarQueryParameters = this.addToHttpParams(localVarQueryParameters, + authorId, 'author_id'); + localVarQueryParameters = this.addToHttpParams(localVarQueryParameters, + include, 'include'); + + let localVarHeaders = this.defaultHeaders; + + const localVarHttpHeaderAcceptSelected: string | undefined = options?.httpHeaderAccept ?? this.configuration.selectHeaderAccept([ + 'application/json' + ]); + if (localVarHttpHeaderAcceptSelected !== undefined) { + localVarHeaders = localVarHeaders.set('Accept', localVarHttpHeaderAcceptSelected); + } + + const localVarHttpContext: HttpContext = options?.context ?? new HttpContext(); + + const localVarTransferCache: boolean = options?.transferCache ?? true; + + + let responseType_: 'text' | 'json' | 'blob' = 'json'; + if (localVarHttpHeaderAcceptSelected) { + if (localVarHttpHeaderAcceptSelected.startsWith('text')) { + responseType_ = 'text'; + } else if (this.configuration.isJsonMime(localVarHttpHeaderAcceptSelected)) { + responseType_ = 'json'; + } else { + responseType_ = 'blob'; + } + } + + let localVarPath = `/api/inse-service/persons/bio`; + const { basePath, withCredentials } = this.configuration; + return this.httpClient.request('get', `${basePath}${localVarPath}`, + { + context: localVarHttpContext, + params: localVarQueryParameters, + responseType: responseType_, + ...(withCredentials ? { withCredentials } : {}), + headers: localVarHeaders, + observe: observe, + ...(localVarTransferCache !== undefined ? { transferCache: localVarTransferCache } : {}), + reportProgress: reportProgress + } ); - }); - } - localVarQueryParameters = this.addToHttpParams( - localVarQueryParameters, - page, - 'page', - ); - localVarQueryParameters = this.addToHttpParams( - localVarQueryParameters, - pageSize, - 'pageSize', - ); - localVarQueryParameters = this.addToHttpParams( - localVarQueryParameters, - include, - 'include', - ); - localVarQueryParameters = this.addToHttpParams( - localVarQueryParameters, - strict, - 'strict', - ); - localVarQueryParameters = this.addToHttpParams( - localVarQueryParameters, - filterMode, - 'filterMode', - ); - localVarQueryParameters = this.addToHttpParams( - localVarQueryParameters, - filterYear, - 'filterYear', - ); - - let localVarHeaders = this.defaultHeaders; - - const localVarHttpHeaderAcceptSelected: string | undefined = - options?.httpHeaderAccept ?? - this.configuration.selectHeaderAccept(['application/json']); - if (localVarHttpHeaderAcceptSelected !== undefined) { - localVarHeaders = localVarHeaders.set( - 'Accept', - localVarHttpHeaderAcceptSelected, - ); } - const localVarHttpContext: HttpContext = - options?.context ?? new HttpContext(); + /** + * Searches for person by ID. + * @endpoint get /api/inse-service/person/{id} + * @param id OpenAlex author ID + * @param include Which data do we require? include tags: topics_full, topic_share, summary_stats, ids, last_known_institutions, ... + * @param observe set whether or not to return the data Observable as the body, response or events. defaults to returning the body. + * @param reportProgress flag to report request and response progress. + */ + public getPersonByID(id: string, include?: string, observe?: 'body', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable; + public getPersonByID(id: string, include?: string, observe?: 'response', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable>; + public getPersonByID(id: string, include?: string, observe?: 'events', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable>; + public getPersonByID(id: string, include?: string, observe: any = 'body', reportProgress: boolean = false, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable { + if (id === null || id === undefined) { + throw new Error('Required parameter id was null or undefined when calling getPersonByID.'); + } - const localVarTransferCache: boolean = options?.transferCache ?? true; + let localVarQueryParameters = new HttpParams({encoder: this.encoder}); + localVarQueryParameters = this.addToHttpParams(localVarQueryParameters, + include, 'include'); - let responseType_: 'text' | 'json' | 'blob' = 'json'; - if (localVarHttpHeaderAcceptSelected) { - if (localVarHttpHeaderAcceptSelected.startsWith('text')) { - responseType_ = 'text'; - } else if ( - this.configuration.isJsonMime(localVarHttpHeaderAcceptSelected) - ) { - responseType_ = 'json'; - } else { - responseType_ = 'blob'; - } - } + let localVarHeaders = this.defaultHeaders; - let localVarPath = `/api/inse-service/persons/search-list`; - const { basePath, withCredentials } = this.configuration; - return this.httpClient.request( - 'get', - `${basePath}${localVarPath}`, - { - context: localVarHttpContext, - params: localVarQueryParameters, - responseType: responseType_, - ...(withCredentials ? { withCredentials } : {}), - headers: localVarHeaders, - observe: observe, - ...(localVarTransferCache !== undefined - ? { transferCache: localVarTransferCache } - : {}), - reportProgress: reportProgress, - }, - ); - } + const localVarHttpHeaderAcceptSelected: string | undefined = options?.httpHeaderAccept ?? this.configuration.selectHeaderAccept([ + 'application/json' + ]); + if (localVarHttpHeaderAcceptSelected !== undefined) { + localVarHeaders = localVarHeaders.set('Accept', localVarHttpHeaderAcceptSelected); + } - /** - * Searches for persons with advanced filters (Topic & Institution) and pagination. - * @endpoint get /api/inse-service/persons/search-list - * @param query Search query (e.g., Arman AND Arzani) - * @param institutionName Filter by institution name - * @param sortBy Value to sort by - * @param sortOrder asc or desc? - * @param topic Filter by topic display names - * @param page Page number (1-indexed) - * @param pageSize Results per page - * @param include Comma-separated include tags - * @param strict Strict institution search by target year - * @param filterMode Filter mode: \'in\' or \'from\' - * @param filterYear Filter year - * @param observe set whether or not to return the data Observable as the body, response or events. defaults to returning the body. - * @param reportProgress flag to report request and response progress. - */ - public searchPersonsList_5( - query?: string, - institutionName?: string, - sortBy?: string, - sortOrder?: string, - topic?: Array, - page?: number, - pageSize?: number, - include?: string, - strict?: boolean, - filterMode?: string, - filterYear?: number, - observe?: 'body', - reportProgress?: boolean, - options?: { - httpHeaderAccept?: 'application/json'; - context?: HttpContext; - transferCache?: boolean; - }, - ): Observable; - public searchPersonsList_5( - query?: string, - institutionName?: string, - sortBy?: string, - sortOrder?: string, - topic?: Array, - page?: number, - pageSize?: number, - include?: string, - strict?: boolean, - filterMode?: string, - filterYear?: number, - observe?: 'response', - reportProgress?: boolean, - options?: { - httpHeaderAccept?: 'application/json'; - context?: HttpContext; - transferCache?: boolean; - }, - ): Observable>; - public searchPersonsList_5( - query?: string, - institutionName?: string, - sortBy?: string, - sortOrder?: string, - topic?: Array, - page?: number, - pageSize?: number, - include?: string, - strict?: boolean, - filterMode?: string, - filterYear?: number, - observe?: 'events', - reportProgress?: boolean, - options?: { - httpHeaderAccept?: 'application/json'; - context?: HttpContext; - transferCache?: boolean; - }, - ): Observable>; - public searchPersonsList_5( - query?: string, - institutionName?: string, - sortBy?: string, - sortOrder?: string, - topic?: Array, - page?: number, - pageSize?: number, - include?: string, - strict?: boolean, - filterMode?: string, - filterYear?: number, - observe: any = 'body', - reportProgress: boolean = false, - options?: { - httpHeaderAccept?: 'application/json'; - context?: HttpContext; - transferCache?: boolean; - }, - ): Observable { - let localVarQueryParameters = new HttpParams({ encoder: this.encoder }); - localVarQueryParameters = this.addToHttpParams( - localVarQueryParameters, - query, - 'query', - ); - localVarQueryParameters = this.addToHttpParams( - localVarQueryParameters, - institutionName, - 'institutionName', - ); - localVarQueryParameters = this.addToHttpParams( - localVarQueryParameters, - sortBy, - 'sortBy', - ); - localVarQueryParameters = this.addToHttpParams( - localVarQueryParameters, - sortOrder, - 'sortOrder', - ); - if (topic) { - topic.forEach((element) => { - localVarQueryParameters = this.addToHttpParams( - localVarQueryParameters, - element, - 'topic', + const localVarHttpContext: HttpContext = options?.context ?? new HttpContext(); + + const localVarTransferCache: boolean = options?.transferCache ?? true; + + + let responseType_: 'text' | 'json' | 'blob' = 'json'; + if (localVarHttpHeaderAcceptSelected) { + if (localVarHttpHeaderAcceptSelected.startsWith('text')) { + responseType_ = 'text'; + } else if (this.configuration.isJsonMime(localVarHttpHeaderAcceptSelected)) { + responseType_ = 'json'; + } else { + responseType_ = 'blob'; + } + } + + let localVarPath = `/api/inse-service/person/${this.configuration.encodeParam({name: "id", value: id, in: "path", style: "simple", explode: false, dataType: "string", dataFormat: undefined})}`; + const { basePath, withCredentials } = this.configuration; + return this.httpClient.request('get', `${basePath}${localVarPath}`, + { + context: localVarHttpContext, + params: localVarQueryParameters, + responseType: responseType_, + ...(withCredentials ? { withCredentials } : {}), + headers: localVarHeaders, + observe: observe, + ...(localVarTransferCache !== undefined ? { transferCache: localVarTransferCache } : {}), + reportProgress: reportProgress + } ); - }); - } - localVarQueryParameters = this.addToHttpParams( - localVarQueryParameters, - page, - 'page', - ); - localVarQueryParameters = this.addToHttpParams( - localVarQueryParameters, - pageSize, - 'pageSize', - ); - localVarQueryParameters = this.addToHttpParams( - localVarQueryParameters, - include, - 'include', - ); - localVarQueryParameters = this.addToHttpParams( - localVarQueryParameters, - strict, - 'strict', - ); - localVarQueryParameters = this.addToHttpParams( - localVarQueryParameters, - filterMode, - 'filterMode', - ); - localVarQueryParameters = this.addToHttpParams( - localVarQueryParameters, - filterYear, - 'filterYear', - ); - - let localVarHeaders = this.defaultHeaders; - - const localVarHttpHeaderAcceptSelected: string | undefined = - options?.httpHeaderAccept ?? - this.configuration.selectHeaderAccept(['application/json']); - if (localVarHttpHeaderAcceptSelected !== undefined) { - localVarHeaders = localVarHeaders.set( - 'Accept', - localVarHttpHeaderAcceptSelected, - ); } - const localVarHttpContext: HttpContext = - options?.context ?? new HttpContext(); + /** + * Searches for person by ID. + * @endpoint get /api/inse-service/person/{id} + * @param id OpenAlex author ID + * @param include Which data do we require? include tags: topics_full, topic_share, summary_stats, ids, last_known_institutions, ... + * @param observe set whether or not to return the data Observable as the body, response or events. defaults to returning the body. + * @param reportProgress flag to report request and response progress. + */ + public getPersonByID_1(id: string, include?: string, observe?: 'body', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable; + public getPersonByID_1(id: string, include?: string, observe?: 'response', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable>; + public getPersonByID_1(id: string, include?: string, observe?: 'events', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable>; + public getPersonByID_1(id: string, include?: string, observe: any = 'body', reportProgress: boolean = false, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable { + if (id === null || id === undefined) { + throw new Error('Required parameter id was null or undefined when calling getPersonByID_1.'); + } - const localVarTransferCache: boolean = options?.transferCache ?? true; + let localVarQueryParameters = new HttpParams({encoder: this.encoder}); + localVarQueryParameters = this.addToHttpParams(localVarQueryParameters, + include, 'include'); - let responseType_: 'text' | 'json' | 'blob' = 'json'; - if (localVarHttpHeaderAcceptSelected) { - if (localVarHttpHeaderAcceptSelected.startsWith('text')) { - responseType_ = 'text'; - } else if ( - this.configuration.isJsonMime(localVarHttpHeaderAcceptSelected) - ) { - responseType_ = 'json'; - } else { - responseType_ = 'blob'; - } + let localVarHeaders = this.defaultHeaders; + + const localVarHttpHeaderAcceptSelected: string | undefined = options?.httpHeaderAccept ?? this.configuration.selectHeaderAccept([ + 'application/json' + ]); + if (localVarHttpHeaderAcceptSelected !== undefined) { + localVarHeaders = localVarHeaders.set('Accept', localVarHttpHeaderAcceptSelected); + } + + const localVarHttpContext: HttpContext = options?.context ?? new HttpContext(); + + const localVarTransferCache: boolean = options?.transferCache ?? true; + + + let responseType_: 'text' | 'json' | 'blob' = 'json'; + if (localVarHttpHeaderAcceptSelected) { + if (localVarHttpHeaderAcceptSelected.startsWith('text')) { + responseType_ = 'text'; + } else if (this.configuration.isJsonMime(localVarHttpHeaderAcceptSelected)) { + responseType_ = 'json'; + } else { + responseType_ = 'blob'; + } + } + + let localVarPath = `/api/inse-service/person/${this.configuration.encodeParam({name: "id", value: id, in: "path", style: "simple", explode: false, dataType: "string", dataFormat: undefined})}`; + const { basePath, withCredentials } = this.configuration; + return this.httpClient.request('get', `${basePath}${localVarPath}`, + { + context: localVarHttpContext, + params: localVarQueryParameters, + responseType: responseType_, + ...(withCredentials ? { withCredentials } : {}), + headers: localVarHeaders, + observe: observe, + ...(localVarTransferCache !== undefined ? { transferCache: localVarTransferCache } : {}), + reportProgress: reportProgress + } + ); + } + + /** + * Searches for persons by ID or name. + * @endpoint get /api/inse-service/persons/search + * @param authorId OpenAlex author ID (e.g., A5093075883) + * @param query Search query (e.g., Arman AND Arzani) + * @param include Comma-separated include tags: topics_full, topic_share, summary_stats, ids, last_known_institutions, sources, counts_by_year, works_api_url, dates, cited_by_count_boost + * @param observe set whether or not to return the data Observable as the body, response or events. defaults to returning the body. + * @param reportProgress flag to report request and response progress. + */ + public searchPersons(authorId?: string, query?: string, include?: string, observe?: 'body', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable; + public searchPersons(authorId?: string, query?: string, include?: string, observe?: 'response', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable>; + public searchPersons(authorId?: string, query?: string, include?: string, observe?: 'events', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable>; + public searchPersons(authorId?: string, query?: string, include?: string, observe: any = 'body', reportProgress: boolean = false, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable { + + let localVarQueryParameters = new HttpParams({encoder: this.encoder}); + localVarQueryParameters = this.addToHttpParams(localVarQueryParameters, + authorId, 'author_id'); + localVarQueryParameters = this.addToHttpParams(localVarQueryParameters, + query, 'query'); + localVarQueryParameters = this.addToHttpParams(localVarQueryParameters, + include, 'include'); + + let localVarHeaders = this.defaultHeaders; + + const localVarHttpHeaderAcceptSelected: string | undefined = options?.httpHeaderAccept ?? this.configuration.selectHeaderAccept([ + 'application/json' + ]); + if (localVarHttpHeaderAcceptSelected !== undefined) { + localVarHeaders = localVarHeaders.set('Accept', localVarHttpHeaderAcceptSelected); + } + + const localVarHttpContext: HttpContext = options?.context ?? new HttpContext(); + + const localVarTransferCache: boolean = options?.transferCache ?? true; + + + let responseType_: 'text' | 'json' | 'blob' = 'json'; + if (localVarHttpHeaderAcceptSelected) { + if (localVarHttpHeaderAcceptSelected.startsWith('text')) { + responseType_ = 'text'; + } else if (this.configuration.isJsonMime(localVarHttpHeaderAcceptSelected)) { + responseType_ = 'json'; + } else { + responseType_ = 'blob'; + } + } + + let localVarPath = `/api/inse-service/persons/search`; + const { basePath, withCredentials } = this.configuration; + return this.httpClient.request('get', `${basePath}${localVarPath}`, + { + context: localVarHttpContext, + params: localVarQueryParameters, + responseType: responseType_, + ...(withCredentials ? { withCredentials } : {}), + headers: localVarHeaders, + observe: observe, + ...(localVarTransferCache !== undefined ? { transferCache: localVarTransferCache } : {}), + reportProgress: reportProgress + } + ); + } + + /** + * Searches for person by name. + * @endpoint get /api/inse-service/persons/autocomplete + * @param authorName Authors name (e.g., Arman Arzani) + * @param include Which data do we require? include tags: topics_full, topic_share, summary_stats, ids, last_known_institutions, ... + * @param observe set whether or not to return the data Observable as the body, response or events. defaults to returning the body. + * @param reportProgress flag to report request and response progress. + */ + public searchPersonsAutocomplete(authorName: string, include: string, observe?: 'body', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable; + public searchPersonsAutocomplete(authorName: string, include: string, observe?: 'response', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable>; + public searchPersonsAutocomplete(authorName: string, include: string, observe?: 'events', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable>; + public searchPersonsAutocomplete(authorName: string, include: string, observe: any = 'body', reportProgress: boolean = false, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable { + if (authorName === null || authorName === undefined) { + throw new Error('Required parameter authorName was null or undefined when calling searchPersonsAutocomplete.'); + } + if (include === null || include === undefined) { + throw new Error('Required parameter include was null or undefined when calling searchPersonsAutocomplete.'); + } + + let localVarQueryParameters = new HttpParams({encoder: this.encoder}); + localVarQueryParameters = this.addToHttpParams(localVarQueryParameters, + authorName, 'author_name'); + localVarQueryParameters = this.addToHttpParams(localVarQueryParameters, + include, 'include'); + + let localVarHeaders = this.defaultHeaders; + + const localVarHttpHeaderAcceptSelected: string | undefined = options?.httpHeaderAccept ?? this.configuration.selectHeaderAccept([ + 'application/json' + ]); + if (localVarHttpHeaderAcceptSelected !== undefined) { + localVarHeaders = localVarHeaders.set('Accept', localVarHttpHeaderAcceptSelected); + } + + const localVarHttpContext: HttpContext = options?.context ?? new HttpContext(); + + const localVarTransferCache: boolean = options?.transferCache ?? true; + + + let responseType_: 'text' | 'json' | 'blob' = 'json'; + if (localVarHttpHeaderAcceptSelected) { + if (localVarHttpHeaderAcceptSelected.startsWith('text')) { + responseType_ = 'text'; + } else if (this.configuration.isJsonMime(localVarHttpHeaderAcceptSelected)) { + responseType_ = 'json'; + } else { + responseType_ = 'blob'; + } + } + + let localVarPath = `/api/inse-service/persons/autocomplete`; + const { basePath, withCredentials } = this.configuration; + return this.httpClient.request('get', `${basePath}${localVarPath}`, + { + context: localVarHttpContext, + params: localVarQueryParameters, + responseType: responseType_, + ...(withCredentials ? { withCredentials } : {}), + headers: localVarHeaders, + observe: observe, + ...(localVarTransferCache !== undefined ? { transferCache: localVarTransferCache } : {}), + reportProgress: reportProgress + } + ); + } + + /** + * Searches for person by name. + * @endpoint get /api/inse-service/persons/autocomplete + * @param authorName Authors name (e.g., Arman Arzani) + * @param include Which data do we require? include tags: topics_full, topic_share, summary_stats, ids, last_known_institutions, ... + * @param observe set whether or not to return the data Observable as the body, response or events. defaults to returning the body. + * @param reportProgress flag to report request and response progress. + */ + public searchPersonsAutocomplete_2(authorName: string, include: string, observe?: 'body', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable; + public searchPersonsAutocomplete_2(authorName: string, include: string, observe?: 'response', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable>; + public searchPersonsAutocomplete_2(authorName: string, include: string, observe?: 'events', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable>; + public searchPersonsAutocomplete_2(authorName: string, include: string, observe: any = 'body', reportProgress: boolean = false, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable { + if (authorName === null || authorName === undefined) { + throw new Error('Required parameter authorName was null or undefined when calling searchPersonsAutocomplete_2.'); + } + if (include === null || include === undefined) { + throw new Error('Required parameter include was null or undefined when calling searchPersonsAutocomplete_2.'); + } + + let localVarQueryParameters = new HttpParams({encoder: this.encoder}); + localVarQueryParameters = this.addToHttpParams(localVarQueryParameters, + authorName, 'author_name'); + localVarQueryParameters = this.addToHttpParams(localVarQueryParameters, + include, 'include'); + + let localVarHeaders = this.defaultHeaders; + + const localVarHttpHeaderAcceptSelected: string | undefined = options?.httpHeaderAccept ?? this.configuration.selectHeaderAccept([ + 'application/json' + ]); + if (localVarHttpHeaderAcceptSelected !== undefined) { + localVarHeaders = localVarHeaders.set('Accept', localVarHttpHeaderAcceptSelected); + } + + const localVarHttpContext: HttpContext = options?.context ?? new HttpContext(); + + const localVarTransferCache: boolean = options?.transferCache ?? true; + + + let responseType_: 'text' | 'json' | 'blob' = 'json'; + if (localVarHttpHeaderAcceptSelected) { + if (localVarHttpHeaderAcceptSelected.startsWith('text')) { + responseType_ = 'text'; + } else if (this.configuration.isJsonMime(localVarHttpHeaderAcceptSelected)) { + responseType_ = 'json'; + } else { + responseType_ = 'blob'; + } + } + + let localVarPath = `/api/inse-service/persons/autocomplete`; + const { basePath, withCredentials } = this.configuration; + return this.httpClient.request('get', `${basePath}${localVarPath}`, + { + context: localVarHttpContext, + params: localVarQueryParameters, + responseType: responseType_, + ...(withCredentials ? { withCredentials } : {}), + headers: localVarHeaders, + observe: observe, + ...(localVarTransferCache !== undefined ? { transferCache: localVarTransferCache } : {}), + reportProgress: reportProgress + } + ); + } + + /** + * Searches for persons by institution name. + * @endpoint get /api/inse-service/persons/searchByInstitution + * @param institutionName Institution name (e.g., MIT, Oxford University) + * @param include Which data do we require? include tags: topics_full, topic_share, summary_stats, ids, last_known_institutions, ... + * @param limit Limit of search page results + * @param pageOffset Offset of the result page + * @param observe set whether or not to return the data Observable as the body, response or events. defaults to returning the body. + * @param reportProgress flag to report request and response progress. + */ + public searchPersonsByInstitution(institutionName: string, include: string, limit?: number, pageOffset?: number, observe?: 'body', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable; + public searchPersonsByInstitution(institutionName: string, include: string, limit?: number, pageOffset?: number, observe?: 'response', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable>; + public searchPersonsByInstitution(institutionName: string, include: string, limit?: number, pageOffset?: number, observe?: 'events', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable>; + public searchPersonsByInstitution(institutionName: string, include: string, limit?: number, pageOffset?: number, observe: any = 'body', reportProgress: boolean = false, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable { + if (institutionName === null || institutionName === undefined) { + throw new Error('Required parameter institutionName was null or undefined when calling searchPersonsByInstitution.'); + } + if (include === null || include === undefined) { + throw new Error('Required parameter include was null or undefined when calling searchPersonsByInstitution.'); + } + + let localVarQueryParameters = new HttpParams({encoder: this.encoder}); + localVarQueryParameters = this.addToHttpParams(localVarQueryParameters, + institutionName, 'institution_name'); + localVarQueryParameters = this.addToHttpParams(localVarQueryParameters, + include, 'include'); + localVarQueryParameters = this.addToHttpParams(localVarQueryParameters, + limit, 'limit'); + localVarQueryParameters = this.addToHttpParams(localVarQueryParameters, + pageOffset, 'page_offset'); + + let localVarHeaders = this.defaultHeaders; + + const localVarHttpHeaderAcceptSelected: string | undefined = options?.httpHeaderAccept ?? this.configuration.selectHeaderAccept([ + 'application/json' + ]); + if (localVarHttpHeaderAcceptSelected !== undefined) { + localVarHeaders = localVarHeaders.set('Accept', localVarHttpHeaderAcceptSelected); + } + + const localVarHttpContext: HttpContext = options?.context ?? new HttpContext(); + + const localVarTransferCache: boolean = options?.transferCache ?? true; + + + let responseType_: 'text' | 'json' | 'blob' = 'json'; + if (localVarHttpHeaderAcceptSelected) { + if (localVarHttpHeaderAcceptSelected.startsWith('text')) { + responseType_ = 'text'; + } else if (this.configuration.isJsonMime(localVarHttpHeaderAcceptSelected)) { + responseType_ = 'json'; + } else { + responseType_ = 'blob'; + } + } + + let localVarPath = `/api/inse-service/persons/searchByInstitution`; + const { basePath, withCredentials } = this.configuration; + return this.httpClient.request('get', `${basePath}${localVarPath}`, + { + context: localVarHttpContext, + params: localVarQueryParameters, + responseType: responseType_, + ...(withCredentials ? { withCredentials } : {}), + headers: localVarHeaders, + observe: observe, + ...(localVarTransferCache !== undefined ? { transferCache: localVarTransferCache } : {}), + reportProgress: reportProgress + } + ); + } + + /** + * Searches for persons by institution name. + * @endpoint get /api/inse-service/persons/searchByInstitution + * @param institutionName Institution name (e.g., MIT, Oxford University) + * @param include Which data do we require? include tags: topics_full, topic_share, summary_stats, ids, last_known_institutions, ... + * @param limit Limit of search page results + * @param pageOffset Offset of the result page + * @param observe set whether or not to return the data Observable as the body, response or events. defaults to returning the body. + * @param reportProgress flag to report request and response progress. + */ + public searchPersonsByInstitution_3(institutionName: string, include: string, limit?: number, pageOffset?: number, observe?: 'body', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable; + public searchPersonsByInstitution_3(institutionName: string, include: string, limit?: number, pageOffset?: number, observe?: 'response', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable>; + public searchPersonsByInstitution_3(institutionName: string, include: string, limit?: number, pageOffset?: number, observe?: 'events', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable>; + public searchPersonsByInstitution_3(institutionName: string, include: string, limit?: number, pageOffset?: number, observe: any = 'body', reportProgress: boolean = false, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable { + if (institutionName === null || institutionName === undefined) { + throw new Error('Required parameter institutionName was null or undefined when calling searchPersonsByInstitution_3.'); + } + if (include === null || include === undefined) { + throw new Error('Required parameter include was null or undefined when calling searchPersonsByInstitution_3.'); + } + + let localVarQueryParameters = new HttpParams({encoder: this.encoder}); + localVarQueryParameters = this.addToHttpParams(localVarQueryParameters, + institutionName, 'institution_name'); + localVarQueryParameters = this.addToHttpParams(localVarQueryParameters, + include, 'include'); + localVarQueryParameters = this.addToHttpParams(localVarQueryParameters, + limit, 'limit'); + localVarQueryParameters = this.addToHttpParams(localVarQueryParameters, + pageOffset, 'page_offset'); + + let localVarHeaders = this.defaultHeaders; + + const localVarHttpHeaderAcceptSelected: string | undefined = options?.httpHeaderAccept ?? this.configuration.selectHeaderAccept([ + 'application/json' + ]); + if (localVarHttpHeaderAcceptSelected !== undefined) { + localVarHeaders = localVarHeaders.set('Accept', localVarHttpHeaderAcceptSelected); + } + + const localVarHttpContext: HttpContext = options?.context ?? new HttpContext(); + + const localVarTransferCache: boolean = options?.transferCache ?? true; + + + let responseType_: 'text' | 'json' | 'blob' = 'json'; + if (localVarHttpHeaderAcceptSelected) { + if (localVarHttpHeaderAcceptSelected.startsWith('text')) { + responseType_ = 'text'; + } else if (this.configuration.isJsonMime(localVarHttpHeaderAcceptSelected)) { + responseType_ = 'json'; + } else { + responseType_ = 'blob'; + } + } + + let localVarPath = `/api/inse-service/persons/searchByInstitution`; + const { basePath, withCredentials } = this.configuration; + return this.httpClient.request('get', `${basePath}${localVarPath}`, + { + context: localVarHttpContext, + params: localVarQueryParameters, + responseType: responseType_, + ...(withCredentials ? { withCredentials } : {}), + headers: localVarHeaders, + observe: observe, + ...(localVarTransferCache !== undefined ? { transferCache: localVarTransferCache } : {}), + reportProgress: reportProgress + } + ); + } + + /** + * Searches for person by name. + * @endpoint get /api/inse-service/persons/searchByName + * @param authorName Authors name (e.g., Arman Arzani) + * @param include Which data do we require? include tags: topics_full, topic_share, summary_stats, ids, last_known_institutions, ... + * @param limit Limit of search page results + * @param pageOffset Offset of the result page + * @param observe set whether or not to return the data Observable as the body, response or events. defaults to returning the body. + * @param reportProgress flag to report request and response progress. + */ + public searchPersonsByName(authorName: string, include: string, limit?: number, pageOffset?: number, observe?: 'body', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable; + public searchPersonsByName(authorName: string, include: string, limit?: number, pageOffset?: number, observe?: 'response', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable>; + public searchPersonsByName(authorName: string, include: string, limit?: number, pageOffset?: number, observe?: 'events', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable>; + public searchPersonsByName(authorName: string, include: string, limit?: number, pageOffset?: number, observe: any = 'body', reportProgress: boolean = false, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable { + if (authorName === null || authorName === undefined) { + throw new Error('Required parameter authorName was null or undefined when calling searchPersonsByName.'); + } + if (include === null || include === undefined) { + throw new Error('Required parameter include was null or undefined when calling searchPersonsByName.'); + } + + let localVarQueryParameters = new HttpParams({encoder: this.encoder}); + localVarQueryParameters = this.addToHttpParams(localVarQueryParameters, + authorName, 'author_name'); + localVarQueryParameters = this.addToHttpParams(localVarQueryParameters, + include, 'include'); + localVarQueryParameters = this.addToHttpParams(localVarQueryParameters, + limit, 'limit'); + localVarQueryParameters = this.addToHttpParams(localVarQueryParameters, + pageOffset, 'page_offset'); + + let localVarHeaders = this.defaultHeaders; + + const localVarHttpHeaderAcceptSelected: string | undefined = options?.httpHeaderAccept ?? this.configuration.selectHeaderAccept([ + 'application/json' + ]); + if (localVarHttpHeaderAcceptSelected !== undefined) { + localVarHeaders = localVarHeaders.set('Accept', localVarHttpHeaderAcceptSelected); + } + + const localVarHttpContext: HttpContext = options?.context ?? new HttpContext(); + + const localVarTransferCache: boolean = options?.transferCache ?? true; + + + let responseType_: 'text' | 'json' | 'blob' = 'json'; + if (localVarHttpHeaderAcceptSelected) { + if (localVarHttpHeaderAcceptSelected.startsWith('text')) { + responseType_ = 'text'; + } else if (this.configuration.isJsonMime(localVarHttpHeaderAcceptSelected)) { + responseType_ = 'json'; + } else { + responseType_ = 'blob'; + } + } + + let localVarPath = `/api/inse-service/persons/searchByName`; + const { basePath, withCredentials } = this.configuration; + return this.httpClient.request('get', `${basePath}${localVarPath}`, + { + context: localVarHttpContext, + params: localVarQueryParameters, + responseType: responseType_, + ...(withCredentials ? { withCredentials } : {}), + headers: localVarHeaders, + observe: observe, + ...(localVarTransferCache !== undefined ? { transferCache: localVarTransferCache } : {}), + reportProgress: reportProgress + } + ); + } + + /** + * Searches for person by name. + * @endpoint get /api/inse-service/persons/searchByName + * @param authorName Authors name (e.g., Arman Arzani) + * @param include Which data do we require? include tags: topics_full, topic_share, summary_stats, ids, last_known_institutions, ... + * @param limit Limit of search page results + * @param pageOffset Offset of the result page + * @param observe set whether or not to return the data Observable as the body, response or events. defaults to returning the body. + * @param reportProgress flag to report request and response progress. + */ + public searchPersonsByName_4(authorName: string, include: string, limit?: number, pageOffset?: number, observe?: 'body', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable; + public searchPersonsByName_4(authorName: string, include: string, limit?: number, pageOffset?: number, observe?: 'response', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable>; + public searchPersonsByName_4(authorName: string, include: string, limit?: number, pageOffset?: number, observe?: 'events', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable>; + public searchPersonsByName_4(authorName: string, include: string, limit?: number, pageOffset?: number, observe: any = 'body', reportProgress: boolean = false, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable { + if (authorName === null || authorName === undefined) { + throw new Error('Required parameter authorName was null or undefined when calling searchPersonsByName_4.'); + } + if (include === null || include === undefined) { + throw new Error('Required parameter include was null or undefined when calling searchPersonsByName_4.'); + } + + let localVarQueryParameters = new HttpParams({encoder: this.encoder}); + localVarQueryParameters = this.addToHttpParams(localVarQueryParameters, + authorName, 'author_name'); + localVarQueryParameters = this.addToHttpParams(localVarQueryParameters, + include, 'include'); + localVarQueryParameters = this.addToHttpParams(localVarQueryParameters, + limit, 'limit'); + localVarQueryParameters = this.addToHttpParams(localVarQueryParameters, + pageOffset, 'page_offset'); + + let localVarHeaders = this.defaultHeaders; + + const localVarHttpHeaderAcceptSelected: string | undefined = options?.httpHeaderAccept ?? this.configuration.selectHeaderAccept([ + 'application/json' + ]); + if (localVarHttpHeaderAcceptSelected !== undefined) { + localVarHeaders = localVarHeaders.set('Accept', localVarHttpHeaderAcceptSelected); + } + + const localVarHttpContext: HttpContext = options?.context ?? new HttpContext(); + + const localVarTransferCache: boolean = options?.transferCache ?? true; + + + let responseType_: 'text' | 'json' | 'blob' = 'json'; + if (localVarHttpHeaderAcceptSelected) { + if (localVarHttpHeaderAcceptSelected.startsWith('text')) { + responseType_ = 'text'; + } else if (this.configuration.isJsonMime(localVarHttpHeaderAcceptSelected)) { + responseType_ = 'json'; + } else { + responseType_ = 'blob'; + } + } + + let localVarPath = `/api/inse-service/persons/searchByName`; + const { basePath, withCredentials } = this.configuration; + return this.httpClient.request('get', `${basePath}${localVarPath}`, + { + context: localVarHttpContext, + params: localVarQueryParameters, + responseType: responseType_, + ...(withCredentials ? { withCredentials } : {}), + headers: localVarHeaders, + observe: observe, + ...(localVarTransferCache !== undefined ? { transferCache: localVarTransferCache } : {}), + reportProgress: reportProgress + } + ); + } + + /** + * Searches for persons with advanced filters (Topic & Institution) and pagination. + * @endpoint get /api/inse-service/persons/search-list + * @param query Search query (e.g., Arman AND Arzani) + * @param institutionName Filter by institution name + * @param sortBy Value to sort by + * @param sortOrder asc or desc? + * @param topic Filter by topic display names + * @param page Page number (1-indexed) + * @param pageSize Results per page + * @param include Comma-separated include tags + * @param strict Strict institution search by target year + * @param filterMode Filter mode: \'in\' or \'from\' + * @param filterYear Filter year + * @param observe set whether or not to return the data Observable as the body, response or events. defaults to returning the body. + * @param reportProgress flag to report request and response progress. + */ + public searchPersonsList(query?: string, institutionName?: string, sortBy?: string, sortOrder?: string, topic?: Array, page?: number, pageSize?: number, include?: string, strict?: boolean, filterMode?: string, filterYear?: number, observe?: 'body', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable; + public searchPersonsList(query?: string, institutionName?: string, sortBy?: string, sortOrder?: string, topic?: Array, page?: number, pageSize?: number, include?: string, strict?: boolean, filterMode?: string, filterYear?: number, observe?: 'response', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable>; + public searchPersonsList(query?: string, institutionName?: string, sortBy?: string, sortOrder?: string, topic?: Array, page?: number, pageSize?: number, include?: string, strict?: boolean, filterMode?: string, filterYear?: number, observe?: 'events', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable>; + public searchPersonsList(query?: string, institutionName?: string, sortBy?: string, sortOrder?: string, topic?: Array, page?: number, pageSize?: number, include?: string, strict?: boolean, filterMode?: string, filterYear?: number, observe: any = 'body', reportProgress: boolean = false, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable { + + let localVarQueryParameters = new HttpParams({encoder: this.encoder}); + localVarQueryParameters = this.addToHttpParams(localVarQueryParameters, + query, 'query'); + localVarQueryParameters = this.addToHttpParams(localVarQueryParameters, + institutionName, 'institutionName'); + localVarQueryParameters = this.addToHttpParams(localVarQueryParameters, + sortBy, 'sortBy'); + localVarQueryParameters = this.addToHttpParams(localVarQueryParameters, + sortOrder, 'sortOrder'); + if (topic) { + topic.forEach((element) => { + localVarQueryParameters = this.addToHttpParams(localVarQueryParameters, + element, 'topic'); + }) + } + localVarQueryParameters = this.addToHttpParams(localVarQueryParameters, + page, 'page'); + localVarQueryParameters = this.addToHttpParams(localVarQueryParameters, + pageSize, 'pageSize'); + localVarQueryParameters = this.addToHttpParams(localVarQueryParameters, + include, 'include'); + localVarQueryParameters = this.addToHttpParams(localVarQueryParameters, + strict, 'strict'); + localVarQueryParameters = this.addToHttpParams(localVarQueryParameters, + filterMode, 'filterMode'); + localVarQueryParameters = this.addToHttpParams(localVarQueryParameters, + filterYear, 'filterYear'); + + let localVarHeaders = this.defaultHeaders; + + const localVarHttpHeaderAcceptSelected: string | undefined = options?.httpHeaderAccept ?? this.configuration.selectHeaderAccept([ + 'application/json' + ]); + if (localVarHttpHeaderAcceptSelected !== undefined) { + localVarHeaders = localVarHeaders.set('Accept', localVarHttpHeaderAcceptSelected); + } + + const localVarHttpContext: HttpContext = options?.context ?? new HttpContext(); + + const localVarTransferCache: boolean = options?.transferCache ?? true; + + + let responseType_: 'text' | 'json' | 'blob' = 'json'; + if (localVarHttpHeaderAcceptSelected) { + if (localVarHttpHeaderAcceptSelected.startsWith('text')) { + responseType_ = 'text'; + } else if (this.configuration.isJsonMime(localVarHttpHeaderAcceptSelected)) { + responseType_ = 'json'; + } else { + responseType_ = 'blob'; + } + } + + let localVarPath = `/api/inse-service/persons/search-list`; + const { basePath, withCredentials } = this.configuration; + return this.httpClient.request('get', `${basePath}${localVarPath}`, + { + context: localVarHttpContext, + params: localVarQueryParameters, + responseType: responseType_, + ...(withCredentials ? { withCredentials } : {}), + headers: localVarHeaders, + observe: observe, + ...(localVarTransferCache !== undefined ? { transferCache: localVarTransferCache } : {}), + reportProgress: reportProgress + } + ); + } + + /** + * Searches for persons with advanced filters (Topic & Institution) and pagination. + * @endpoint get /api/inse-service/persons/search-list + * @param query Search query (e.g., Arman AND Arzani) + * @param institutionName Filter by institution name + * @param sortBy Value to sort by + * @param sortOrder asc or desc? + * @param topic Filter by topic display names + * @param page Page number (1-indexed) + * @param pageSize Results per page + * @param include Comma-separated include tags + * @param strict Strict institution search by target year + * @param filterMode Filter mode: \'in\' or \'from\' + * @param filterYear Filter year + * @param observe set whether or not to return the data Observable as the body, response or events. defaults to returning the body. + * @param reportProgress flag to report request and response progress. + */ + public searchPersonsList_5(query?: string, institutionName?: string, sortBy?: string, sortOrder?: string, topic?: Array, page?: number, pageSize?: number, include?: string, strict?: boolean, filterMode?: string, filterYear?: number, observe?: 'body', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable; + public searchPersonsList_5(query?: string, institutionName?: string, sortBy?: string, sortOrder?: string, topic?: Array, page?: number, pageSize?: number, include?: string, strict?: boolean, filterMode?: string, filterYear?: number, observe?: 'response', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable>; + public searchPersonsList_5(query?: string, institutionName?: string, sortBy?: string, sortOrder?: string, topic?: Array, page?: number, pageSize?: number, include?: string, strict?: boolean, filterMode?: string, filterYear?: number, observe?: 'events', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable>; + public searchPersonsList_5(query?: string, institutionName?: string, sortBy?: string, sortOrder?: string, topic?: Array, page?: number, pageSize?: number, include?: string, strict?: boolean, filterMode?: string, filterYear?: number, observe: any = 'body', reportProgress: boolean = false, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable { + + let localVarQueryParameters = new HttpParams({encoder: this.encoder}); + localVarQueryParameters = this.addToHttpParams(localVarQueryParameters, + query, 'query'); + localVarQueryParameters = this.addToHttpParams(localVarQueryParameters, + institutionName, 'institutionName'); + localVarQueryParameters = this.addToHttpParams(localVarQueryParameters, + sortBy, 'sortBy'); + localVarQueryParameters = this.addToHttpParams(localVarQueryParameters, + sortOrder, 'sortOrder'); + if (topic) { + topic.forEach((element) => { + localVarQueryParameters = this.addToHttpParams(localVarQueryParameters, + element, 'topic'); + }) + } + localVarQueryParameters = this.addToHttpParams(localVarQueryParameters, + page, 'page'); + localVarQueryParameters = this.addToHttpParams(localVarQueryParameters, + pageSize, 'pageSize'); + localVarQueryParameters = this.addToHttpParams(localVarQueryParameters, + include, 'include'); + localVarQueryParameters = this.addToHttpParams(localVarQueryParameters, + strict, 'strict'); + localVarQueryParameters = this.addToHttpParams(localVarQueryParameters, + filterMode, 'filterMode'); + localVarQueryParameters = this.addToHttpParams(localVarQueryParameters, + filterYear, 'filterYear'); + + let localVarHeaders = this.defaultHeaders; + + const localVarHttpHeaderAcceptSelected: string | undefined = options?.httpHeaderAccept ?? this.configuration.selectHeaderAccept([ + 'application/json' + ]); + if (localVarHttpHeaderAcceptSelected !== undefined) { + localVarHeaders = localVarHeaders.set('Accept', localVarHttpHeaderAcceptSelected); + } + + const localVarHttpContext: HttpContext = options?.context ?? new HttpContext(); + + const localVarTransferCache: boolean = options?.transferCache ?? true; + + + let responseType_: 'text' | 'json' | 'blob' = 'json'; + if (localVarHttpHeaderAcceptSelected) { + if (localVarHttpHeaderAcceptSelected.startsWith('text')) { + responseType_ = 'text'; + } else if (this.configuration.isJsonMime(localVarHttpHeaderAcceptSelected)) { + responseType_ = 'json'; + } else { + responseType_ = 'blob'; + } + } + + let localVarPath = `/api/inse-service/persons/search-list`; + const { basePath, withCredentials } = this.configuration; + return this.httpClient.request('get', `${basePath}${localVarPath}`, + { + context: localVarHttpContext, + params: localVarQueryParameters, + responseType: responseType_, + ...(withCredentials ? { withCredentials } : {}), + headers: localVarHeaders, + observe: observe, + ...(localVarTransferCache !== undefined ? { transferCache: localVarTransferCache } : {}), + reportProgress: reportProgress + } + ); } - let localVarPath = `/api/inse-service/persons/search-list`; - const { basePath, withCredentials } = this.configuration; - return this.httpClient.request( - 'get', - `${basePath}${localVarPath}`, - { - context: localVarHttpContext, - params: localVarQueryParameters, - responseType: responseType_, - ...(withCredentials ? { withCredentials } : {}), - headers: localVarHeaders, - observe: observe, - ...(localVarTransferCache !== undefined - ? { transferCache: localVarTransferCache } - : {}), - reportProgress: reportProgress, - }, - ); - } } diff --git a/webapp/src/app/api/api/projects.service.ts b/webapp/src/app/api/api/projects.service.ts index ae7d70cd..34ed25af 100644 --- a/webapp/src/app/api/api/projects.service.ts +++ b/webapp/src/app/api/api/projects.service.ts @@ -86,8 +86,8 @@ export class ProjectsService extends BaseService { * @param reportProgress flag to report request and response progress. */ public getDfgProjects( - authorId: string, - authorFilterIds: Array, + authorId?: string, + authorFilterIds?: Array, institutionIds?: Array, title?: string, topics?: Array, @@ -105,8 +105,8 @@ export class ProjectsService extends BaseService { }, ): Observable; public getDfgProjects( - authorId: string, - authorFilterIds: Array, + authorId?: string, + authorFilterIds?: Array, institutionIds?: Array, title?: string, topics?: Array, @@ -124,8 +124,8 @@ export class ProjectsService extends BaseService { }, ): Observable>; public getDfgProjects( - authorId: string, - authorFilterIds: Array, + authorId?: string, + authorFilterIds?: Array, institutionIds?: Array, title?: string, topics?: Array, @@ -143,8 +143,8 @@ export class ProjectsService extends BaseService { }, ): Observable>; public getDfgProjects( - authorId: string, - authorFilterIds: Array, + authorId?: string, + authorFilterIds?: Array, institutionIds?: Array, title?: string, topics?: Array, @@ -161,17 +161,6 @@ export class ProjectsService extends BaseService { transferCache?: boolean; }, ): Observable { - if (authorId === null || authorId === undefined) { - throw new Error( - 'Required parameter authorId was null or undefined when calling getDfgProjects.', - ); - } - if (authorFilterIds === null || authorFilterIds === undefined) { - throw new Error( - 'Required parameter authorFilterIds was null or undefined when calling getDfgProjects.', - ); - } - let localVarQueryParameters = new HttpParams({ encoder: this.encoder }); localVarQueryParameters = this.addToHttpParams( localVarQueryParameters, diff --git a/webapp/src/app/api/api/topics.service.ts b/webapp/src/app/api/api/topics.service.ts index 5a51e233..ef7b0c7f 100644 --- a/webapp/src/app/api/api/topics.service.ts +++ b/webapp/src/app/api/api/topics.service.ts @@ -1,7 +1,7 @@ /** * Innovation Search Engine API * - * + * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech @@ -9,18 +9,12 @@ */ /* tslint:disable:no-unused-variable member-ordering */ -import { Inject, Injectable, Optional } from '@angular/core'; -import { - HttpClient, - HttpHeaders, - HttpParams, - HttpResponse, - HttpEvent, - HttpParameterCodec, - HttpContext, -} from '@angular/common/http'; -import { CustomHttpParameterCodec } from '../encoder'; -import { Observable } from 'rxjs'; +import { Inject, Injectable, Optional } from '@angular/core'; +import { HttpClient, HttpHeaders, HttpParams, + HttpResponse, HttpEvent, HttpParameterCodec, HttpContext + } from '@angular/common/http'; +import { CustomHttpParameterCodec } from '../encoder'; +import { Observable } from 'rxjs'; // @ts-ignore import { AutocompleteResponse } from '../model/autocompleteResponse'; @@ -34,929 +28,484 @@ import { KeywordsTopicsResponse } from '../model/keywordsTopicsResponse'; import { TopicsListResponse } from '../model/topicsListResponse'; // @ts-ignore -import { BASE_PATH, COLLECTION_FORMATS } from '../variables'; -import { Configuration } from '../configuration'; +import { BASE_PATH, COLLECTION_FORMATS } from '../variables'; +import { Configuration } from '../configuration'; import { BaseService } from '../api.base.service'; + + @Injectable({ - providedIn: 'root', + providedIn: 'root' }) export class TopicsService extends BaseService { - constructor( - protected httpClient: HttpClient, - @Optional() @Inject(BASE_PATH) basePath: string | string[], - @Optional() configuration?: Configuration, - ) { - super(basePath, configuration); - } - /** - * Returns topic options for autocomplete inputs. - * @endpoint get /api/topics/autocomplete - * @param query Topic search text, for example \'machine learning\'. - * @param domainId Optional OpenAlex domain id filter. - * @param fieldId Optional OpenAlex field id filter. - * @param subfieldId Optional OpenAlex subfield id filter. - * @param limit Maximum number of autocomplete options. - * @param observe set whether or not to return the data Observable as the body, response or events. defaults to returning the body. - * @param reportProgress flag to report request and response progress. - */ - public autocompleteTopics( - query: string, - domainId?: string, - fieldId?: string, - subfieldId?: string, - limit?: number, - observe?: 'body', - reportProgress?: boolean, - options?: { - httpHeaderAccept?: 'application/json'; - context?: HttpContext; - transferCache?: boolean; - }, - ): Observable; - public autocompleteTopics( - query: string, - domainId?: string, - fieldId?: string, - subfieldId?: string, - limit?: number, - observe?: 'response', - reportProgress?: boolean, - options?: { - httpHeaderAccept?: 'application/json'; - context?: HttpContext; - transferCache?: boolean; - }, - ): Observable>; - public autocompleteTopics( - query: string, - domainId?: string, - fieldId?: string, - subfieldId?: string, - limit?: number, - observe?: 'events', - reportProgress?: boolean, - options?: { - httpHeaderAccept?: 'application/json'; - context?: HttpContext; - transferCache?: boolean; - }, - ): Observable>; - public autocompleteTopics( - query: string, - domainId?: string, - fieldId?: string, - subfieldId?: string, - limit?: number, - observe: any = 'body', - reportProgress: boolean = false, - options?: { - httpHeaderAccept?: 'application/json'; - context?: HttpContext; - transferCache?: boolean; - }, - ): Observable { - if (query === null || query === undefined) { - throw new Error( - 'Required parameter query was null or undefined when calling autocompleteTopics.', - ); + constructor(protected httpClient: HttpClient, @Optional() @Inject(BASE_PATH) basePath: string|string[], @Optional() configuration?: Configuration) { + super(basePath, configuration); } - let localVarQueryParameters = new HttpParams({ encoder: this.encoder }); - localVarQueryParameters = this.addToHttpParams( - localVarQueryParameters, - query, - 'query', - ); - localVarQueryParameters = this.addToHttpParams( - localVarQueryParameters, - domainId, - 'domainId', - ); - localVarQueryParameters = this.addToHttpParams( - localVarQueryParameters, - fieldId, - 'fieldId', - ); - localVarQueryParameters = this.addToHttpParams( - localVarQueryParameters, - subfieldId, - 'subfieldId', - ); - localVarQueryParameters = this.addToHttpParams( - localVarQueryParameters, - limit, - 'limit', - ); + /** + * Returns topic options for autocomplete inputs. + * @endpoint get /api/topics/autocomplete + * @param query Topic search text, for example \'machine learning\'. + * @param domainId Optional OpenAlex domain id filter. + * @param fieldId Optional OpenAlex field id filter. + * @param subfieldId Optional OpenAlex subfield id filter. + * @param limit Maximum number of autocomplete options. + * @param observe set whether or not to return the data Observable as the body, response or events. defaults to returning the body. + * @param reportProgress flag to report request and response progress. + */ + public autocompleteTopics(query: string, domainId?: string, fieldId?: string, subfieldId?: string, limit?: number, observe?: 'body', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable; + public autocompleteTopics(query: string, domainId?: string, fieldId?: string, subfieldId?: string, limit?: number, observe?: 'response', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable>; + public autocompleteTopics(query: string, domainId?: string, fieldId?: string, subfieldId?: string, limit?: number, observe?: 'events', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable>; + public autocompleteTopics(query: string, domainId?: string, fieldId?: string, subfieldId?: string, limit?: number, observe: any = 'body', reportProgress: boolean = false, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable { + if (query === null || query === undefined) { + throw new Error('Required parameter query was null or undefined when calling autocompleteTopics.'); + } - let localVarHeaders = this.defaultHeaders; + let localVarQueryParameters = new HttpParams({encoder: this.encoder}); + localVarQueryParameters = this.addToHttpParams(localVarQueryParameters, + query, 'query'); + localVarQueryParameters = this.addToHttpParams(localVarQueryParameters, + domainId, 'domainId'); + localVarQueryParameters = this.addToHttpParams(localVarQueryParameters, + fieldId, 'fieldId'); + localVarQueryParameters = this.addToHttpParams(localVarQueryParameters, + subfieldId, 'subfieldId'); + localVarQueryParameters = this.addToHttpParams(localVarQueryParameters, + limit, 'limit'); - const localVarHttpHeaderAcceptSelected: string | undefined = - options?.httpHeaderAccept ?? - this.configuration.selectHeaderAccept(['application/json']); - if (localVarHttpHeaderAcceptSelected !== undefined) { - localVarHeaders = localVarHeaders.set( - 'Accept', - localVarHttpHeaderAcceptSelected, - ); - } + let localVarHeaders = this.defaultHeaders; - const localVarHttpContext: HttpContext = - options?.context ?? new HttpContext(); + const localVarHttpHeaderAcceptSelected: string | undefined = options?.httpHeaderAccept ?? this.configuration.selectHeaderAccept([ + 'application/json' + ]); + if (localVarHttpHeaderAcceptSelected !== undefined) { + localVarHeaders = localVarHeaders.set('Accept', localVarHttpHeaderAcceptSelected); + } - const localVarTransferCache: boolean = options?.transferCache ?? true; + const localVarHttpContext: HttpContext = options?.context ?? new HttpContext(); - let responseType_: 'text' | 'json' | 'blob' = 'json'; - if (localVarHttpHeaderAcceptSelected) { - if (localVarHttpHeaderAcceptSelected.startsWith('text')) { - responseType_ = 'text'; - } else if ( - this.configuration.isJsonMime(localVarHttpHeaderAcceptSelected) - ) { - responseType_ = 'json'; - } else { - responseType_ = 'blob'; - } - } + const localVarTransferCache: boolean = options?.transferCache ?? true; - let localVarPath = `/api/topics/autocomplete`; - const { basePath, withCredentials } = this.configuration; - return this.httpClient.request( - 'get', - `${basePath}${localVarPath}`, - { - context: localVarHttpContext, - params: localVarQueryParameters, - responseType: responseType_, - ...(withCredentials ? { withCredentials } : {}), - headers: localVarHeaders, - observe: observe, - ...(localVarTransferCache !== undefined - ? { transferCache: localVarTransferCache } - : {}), - reportProgress: reportProgress, - }, - ); - } - /** - * Builds the topic hierarchy cache. - * @endpoint get /api/inse-service/topics/cache - * @param pageSize Page size for each search page. - * @param saveJson Persist cache JSON to data folder. - * @param observe set whether or not to return the data Observable as the body, response or events. defaults to returning the body. - * @param reportProgress flag to report request and response progress. - */ - public buildTopicCache( - pageSize?: number, - saveJson?: boolean, - observe?: 'body', - reportProgress?: boolean, - options?: { - httpHeaderAccept?: 'application/json'; - context?: HttpContext; - transferCache?: boolean; - }, - ): Observable; - public buildTopicCache( - pageSize?: number, - saveJson?: boolean, - observe?: 'response', - reportProgress?: boolean, - options?: { - httpHeaderAccept?: 'application/json'; - context?: HttpContext; - transferCache?: boolean; - }, - ): Observable>; - public buildTopicCache( - pageSize?: number, - saveJson?: boolean, - observe?: 'events', - reportProgress?: boolean, - options?: { - httpHeaderAccept?: 'application/json'; - context?: HttpContext; - transferCache?: boolean; - }, - ): Observable>; - public buildTopicCache( - pageSize?: number, - saveJson?: boolean, - observe: any = 'body', - reportProgress: boolean = false, - options?: { - httpHeaderAccept?: 'application/json'; - context?: HttpContext; - transferCache?: boolean; - }, - ): Observable { - let localVarQueryParameters = new HttpParams({ encoder: this.encoder }); - localVarQueryParameters = this.addToHttpParams( - localVarQueryParameters, - pageSize, - 'page_size', - ); - localVarQueryParameters = this.addToHttpParams( - localVarQueryParameters, - saveJson, - 'save_json', - ); + let responseType_: 'text' | 'json' | 'blob' = 'json'; + if (localVarHttpHeaderAcceptSelected) { + if (localVarHttpHeaderAcceptSelected.startsWith('text')) { + responseType_ = 'text'; + } else if (this.configuration.isJsonMime(localVarHttpHeaderAcceptSelected)) { + responseType_ = 'json'; + } else { + responseType_ = 'blob'; + } + } - let localVarHeaders = this.defaultHeaders; - - const localVarHttpHeaderAcceptSelected: string | undefined = - options?.httpHeaderAccept ?? - this.configuration.selectHeaderAccept(['application/json']); - if (localVarHttpHeaderAcceptSelected !== undefined) { - localVarHeaders = localVarHeaders.set( - 'Accept', - localVarHttpHeaderAcceptSelected, - ); - } - - const localVarHttpContext: HttpContext = - options?.context ?? new HttpContext(); - - const localVarTransferCache: boolean = options?.transferCache ?? true; - - let responseType_: 'text' | 'json' | 'blob' = 'json'; - if (localVarHttpHeaderAcceptSelected) { - if (localVarHttpHeaderAcceptSelected.startsWith('text')) { - responseType_ = 'text'; - } else if ( - this.configuration.isJsonMime(localVarHttpHeaderAcceptSelected) - ) { - responseType_ = 'json'; - } else { - responseType_ = 'blob'; - } - } - - let localVarPath = `/api/inse-service/topics/cache`; - const { basePath, withCredentials } = this.configuration; - return this.httpClient.request( - 'get', - `${basePath}${localVarPath}`, - { - context: localVarHttpContext, - params: localVarQueryParameters, - responseType: responseType_, - ...(withCredentials ? { withCredentials } : {}), - headers: localVarHeaders, - observe: observe, - ...(localVarTransferCache !== undefined - ? { transferCache: localVarTransferCache } - : {}), - reportProgress: reportProgress, - }, - ); - } - - /** - * Counts topic hierarchy occurrences from cache. - * @endpoint get /api/inse-service/topics/count - * @param topic Topic names (repeat parameter). - * @param observe set whether or not to return the data Observable as the body, response or events. defaults to returning the body. - * @param reportProgress flag to report request and response progress. - */ - public countTopicHierarchy( - topic: Array, - observe?: 'body', - reportProgress?: boolean, - options?: { - httpHeaderAccept?: 'application/json'; - context?: HttpContext; - transferCache?: boolean; - }, - ): Observable; - public countTopicHierarchy( - topic: Array, - observe?: 'response', - reportProgress?: boolean, - options?: { - httpHeaderAccept?: 'application/json'; - context?: HttpContext; - transferCache?: boolean; - }, - ): Observable>; - public countTopicHierarchy( - topic: Array, - observe?: 'events', - reportProgress?: boolean, - options?: { - httpHeaderAccept?: 'application/json'; - context?: HttpContext; - transferCache?: boolean; - }, - ): Observable>; - public countTopicHierarchy( - topic: Array, - observe: any = 'body', - reportProgress: boolean = false, - options?: { - httpHeaderAccept?: 'application/json'; - context?: HttpContext; - transferCache?: boolean; - }, - ): Observable { - if (topic === null || topic === undefined) { - throw new Error( - 'Required parameter topic was null or undefined when calling countTopicHierarchy.', - ); - } - - let localVarQueryParameters = new HttpParams({ encoder: this.encoder }); - if (topic) { - topic.forEach((element) => { - localVarQueryParameters = this.addToHttpParams( - localVarQueryParameters, - element, - 'topic', + let localVarPath = `/api/topics/autocomplete`; + const { basePath, withCredentials } = this.configuration; + return this.httpClient.request('get', `${basePath}${localVarPath}`, + { + context: localVarHttpContext, + params: localVarQueryParameters, + responseType: responseType_, + ...(withCredentials ? { withCredentials } : {}), + headers: localVarHeaders, + observe: observe, + ...(localVarTransferCache !== undefined ? { transferCache: localVarTransferCache } : {}), + reportProgress: reportProgress + } ); - }); } - let localVarHeaders = this.defaultHeaders; + /** + * Builds the topic hierarchy cache. + * @endpoint get /api/inse-service/topics/cache + * @param pageSize Page size for each search page. + * @param saveJson Persist cache JSON to data folder. + * @param observe set whether or not to return the data Observable as the body, response or events. defaults to returning the body. + * @param reportProgress flag to report request and response progress. + */ + public buildTopicCache(pageSize?: number, saveJson?: boolean, observe?: 'body', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable; + public buildTopicCache(pageSize?: number, saveJson?: boolean, observe?: 'response', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable>; + public buildTopicCache(pageSize?: number, saveJson?: boolean, observe?: 'events', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable>; + public buildTopicCache(pageSize?: number, saveJson?: boolean, observe: any = 'body', reportProgress: boolean = false, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable { - const localVarHttpHeaderAcceptSelected: string | undefined = - options?.httpHeaderAccept ?? - this.configuration.selectHeaderAccept(['application/json']); - if (localVarHttpHeaderAcceptSelected !== undefined) { - localVarHeaders = localVarHeaders.set( - 'Accept', - localVarHttpHeaderAcceptSelected, - ); + let localVarQueryParameters = new HttpParams({encoder: this.encoder}); + localVarQueryParameters = this.addToHttpParams(localVarQueryParameters, + pageSize, 'page_size'); + localVarQueryParameters = this.addToHttpParams(localVarQueryParameters, + saveJson, 'save_json'); + + let localVarHeaders = this.defaultHeaders; + + const localVarHttpHeaderAcceptSelected: string | undefined = options?.httpHeaderAccept ?? this.configuration.selectHeaderAccept([ + 'application/json' + ]); + if (localVarHttpHeaderAcceptSelected !== undefined) { + localVarHeaders = localVarHeaders.set('Accept', localVarHttpHeaderAcceptSelected); + } + + const localVarHttpContext: HttpContext = options?.context ?? new HttpContext(); + + const localVarTransferCache: boolean = options?.transferCache ?? true; + + + let responseType_: 'text' | 'json' | 'blob' = 'json'; + if (localVarHttpHeaderAcceptSelected) { + if (localVarHttpHeaderAcceptSelected.startsWith('text')) { + responseType_ = 'text'; + } else if (this.configuration.isJsonMime(localVarHttpHeaderAcceptSelected)) { + responseType_ = 'json'; + } else { + responseType_ = 'blob'; + } + } + + let localVarPath = `/api/inse-service/topics/cache`; + const { basePath, withCredentials } = this.configuration; + return this.httpClient.request('get', `${basePath}${localVarPath}`, + { + context: localVarHttpContext, + params: localVarQueryParameters, + responseType: responseType_, + ...(withCredentials ? { withCredentials } : {}), + headers: localVarHeaders, + observe: observe, + ...(localVarTransferCache !== undefined ? { transferCache: localVarTransferCache } : {}), + reportProgress: reportProgress + } + ); } - const localVarHttpContext: HttpContext = - options?.context ?? new HttpContext(); + /** + * Counts topic hierarchy occurrences from cache. + * @endpoint get /api/inse-service/topics/count + * @param topic Topic names (repeat parameter). + * @param observe set whether or not to return the data Observable as the body, response or events. defaults to returning the body. + * @param reportProgress flag to report request and response progress. + */ + public countTopicHierarchy(topic: Array, observe?: 'body', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable; + public countTopicHierarchy(topic: Array, observe?: 'response', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable>; + public countTopicHierarchy(topic: Array, observe?: 'events', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable>; + public countTopicHierarchy(topic: Array, observe: any = 'body', reportProgress: boolean = false, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable { + if (topic === null || topic === undefined) { + throw new Error('Required parameter topic was null or undefined when calling countTopicHierarchy.'); + } - const localVarTransferCache: boolean = options?.transferCache ?? true; + let localVarQueryParameters = new HttpParams({encoder: this.encoder}); + if (topic) { + topic.forEach((element) => { + localVarQueryParameters = this.addToHttpParams(localVarQueryParameters, + element, 'topic'); + }) + } - let responseType_: 'text' | 'json' | 'blob' = 'json'; - if (localVarHttpHeaderAcceptSelected) { - if (localVarHttpHeaderAcceptSelected.startsWith('text')) { - responseType_ = 'text'; - } else if ( - this.configuration.isJsonMime(localVarHttpHeaderAcceptSelected) - ) { - responseType_ = 'json'; - } else { - responseType_ = 'blob'; - } + let localVarHeaders = this.defaultHeaders; + + const localVarHttpHeaderAcceptSelected: string | undefined = options?.httpHeaderAccept ?? this.configuration.selectHeaderAccept([ + 'application/json' + ]); + if (localVarHttpHeaderAcceptSelected !== undefined) { + localVarHeaders = localVarHeaders.set('Accept', localVarHttpHeaderAcceptSelected); + } + + const localVarHttpContext: HttpContext = options?.context ?? new HttpContext(); + + const localVarTransferCache: boolean = options?.transferCache ?? true; + + + let responseType_: 'text' | 'json' | 'blob' = 'json'; + if (localVarHttpHeaderAcceptSelected) { + if (localVarHttpHeaderAcceptSelected.startsWith('text')) { + responseType_ = 'text'; + } else if (this.configuration.isJsonMime(localVarHttpHeaderAcceptSelected)) { + responseType_ = 'json'; + } else { + responseType_ = 'blob'; + } + } + + let localVarPath = `/api/inse-service/topics/count`; + const { basePath, withCredentials } = this.configuration; + return this.httpClient.request('get', `${basePath}${localVarPath}`, + { + context: localVarHttpContext, + params: localVarQueryParameters, + responseType: responseType_, + ...(withCredentials ? { withCredentials } : {}), + headers: localVarHeaders, + observe: observe, + ...(localVarTransferCache !== undefined ? { transferCache: localVarTransferCache } : {}), + reportProgress: reportProgress + } + ); } - let localVarPath = `/api/inse-service/topics/count`; - const { basePath, withCredentials } = this.configuration; - return this.httpClient.request( - 'get', - `${basePath}${localVarPath}`, - { - context: localVarHttpContext, - params: localVarQueryParameters, - responseType: responseType_, - ...(withCredentials ? { withCredentials } : {}), - headers: localVarHeaders, - observe: observe, - ...(localVarTransferCache !== undefined - ? { transferCache: localVarTransferCache } - : {}), - reportProgress: reportProgress, - }, - ); - } + /** + * Returns the nested topic hierarchy (Domains -> Fields -> Subfields -> Topics). + * @endpoint get /api/inse-service/topics/hierarchy + * @param observe set whether or not to return the data Observable as the body, response or events. defaults to returning the body. + * @param reportProgress flag to report request and response progress. + */ + public getTopicHierarchy(observe?: 'body', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable; + public getTopicHierarchy(observe?: 'response', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable>; + public getTopicHierarchy(observe?: 'events', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable>; + public getTopicHierarchy(observe: any = 'body', reportProgress: boolean = false, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable { - /** - * Returns the nested topic hierarchy (Domains -> Fields -> Subfields -> Topics). - * @endpoint get /api/inse-service/topics/hierarchy - * @param observe set whether or not to return the data Observable as the body, response or events. defaults to returning the body. - * @param reportProgress flag to report request and response progress. - */ - public getTopicHierarchy( - observe?: 'body', - reportProgress?: boolean, - options?: { - httpHeaderAccept?: 'application/json'; - context?: HttpContext; - transferCache?: boolean; - }, - ): Observable; - public getTopicHierarchy( - observe?: 'response', - reportProgress?: boolean, - options?: { - httpHeaderAccept?: 'application/json'; - context?: HttpContext; - transferCache?: boolean; - }, - ): Observable>; - public getTopicHierarchy( - observe?: 'events', - reportProgress?: boolean, - options?: { - httpHeaderAccept?: 'application/json'; - context?: HttpContext; - transferCache?: boolean; - }, - ): Observable>; - public getTopicHierarchy( - observe: any = 'body', - reportProgress: boolean = false, - options?: { - httpHeaderAccept?: 'application/json'; - context?: HttpContext; - transferCache?: boolean; - }, - ): Observable { - let localVarHeaders = this.defaultHeaders; + let localVarHeaders = this.defaultHeaders; - const localVarHttpHeaderAcceptSelected: string | undefined = - options?.httpHeaderAccept ?? - this.configuration.selectHeaderAccept(['application/json']); - if (localVarHttpHeaderAcceptSelected !== undefined) { - localVarHeaders = localVarHeaders.set( - 'Accept', - localVarHttpHeaderAcceptSelected, - ); + const localVarHttpHeaderAcceptSelected: string | undefined = options?.httpHeaderAccept ?? this.configuration.selectHeaderAccept([ + 'application/json' + ]); + if (localVarHttpHeaderAcceptSelected !== undefined) { + localVarHeaders = localVarHeaders.set('Accept', localVarHttpHeaderAcceptSelected); + } + + const localVarHttpContext: HttpContext = options?.context ?? new HttpContext(); + + const localVarTransferCache: boolean = options?.transferCache ?? true; + + + let responseType_: 'text' | 'json' | 'blob' = 'json'; + if (localVarHttpHeaderAcceptSelected) { + if (localVarHttpHeaderAcceptSelected.startsWith('text')) { + responseType_ = 'text'; + } else if (this.configuration.isJsonMime(localVarHttpHeaderAcceptSelected)) { + responseType_ = 'json'; + } else { + responseType_ = 'blob'; + } + } + + let localVarPath = `/api/inse-service/topics/hierarchy`; + const { basePath, withCredentials } = this.configuration; + return this.httpClient.request('get', `${basePath}${localVarPath}`, + { + context: localVarHttpContext, + responseType: responseType_, + ...(withCredentials ? { withCredentials } : {}), + headers: localVarHeaders, + observe: observe, + ...(localVarTransferCache !== undefined ? { transferCache: localVarTransferCache } : {}), + reportProgress: reportProgress + } + ); } - const localVarHttpContext: HttpContext = - options?.context ?? new HttpContext(); + /** + * Returns a list of OpenAlex topics. + * @endpoint get /api/topics + * @param search Full-text search, for example \'machine learning\'. + * @param filter OpenAlex filter, for example \'domain.id:1,works_count:>1000\'. + * @param sort Sort field, for example \'works_count:desc\'. + * @param groupBy OpenAlex group_by field, for example \'domain.id\'. + * @param perPage Results per page. + * @param page Page number. Use cursor for deep pagination. + * @param cursor Cursor pagination token. Use \'*\' to start. + * @param sample Random sample size. Cannot be combined with sort or page. + * @param select Comma-separated fields to return. + * @param observe set whether or not to return the data Observable as the body, response or events. defaults to returning the body. + * @param reportProgress flag to report request and response progress. + */ + public listTopics(search?: string, filter?: string, sort?: string, groupBy?: string, perPage?: number, page?: number, cursor?: string, sample?: number, select?: string, observe?: 'body', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable; + public listTopics(search?: string, filter?: string, sort?: string, groupBy?: string, perPage?: number, page?: number, cursor?: string, sample?: number, select?: string, observe?: 'response', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable>; + public listTopics(search?: string, filter?: string, sort?: string, groupBy?: string, perPage?: number, page?: number, cursor?: string, sample?: number, select?: string, observe?: 'events', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable>; + public listTopics(search?: string, filter?: string, sort?: string, groupBy?: string, perPage?: number, page?: number, cursor?: string, sample?: number, select?: string, observe: any = 'body', reportProgress: boolean = false, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable { - const localVarTransferCache: boolean = options?.transferCache ?? true; + let localVarQueryParameters = new HttpParams({encoder: this.encoder}); + localVarQueryParameters = this.addToHttpParams(localVarQueryParameters, + search, 'search'); + localVarQueryParameters = this.addToHttpParams(localVarQueryParameters, + filter, 'filter'); + localVarQueryParameters = this.addToHttpParams(localVarQueryParameters, + sort, 'sort'); + localVarQueryParameters = this.addToHttpParams(localVarQueryParameters, + groupBy, 'group_by'); + localVarQueryParameters = this.addToHttpParams(localVarQueryParameters, + perPage, 'per_page'); + localVarQueryParameters = this.addToHttpParams(localVarQueryParameters, + page, 'page'); + localVarQueryParameters = this.addToHttpParams(localVarQueryParameters, + cursor, 'cursor'); + localVarQueryParameters = this.addToHttpParams(localVarQueryParameters, + sample, 'sample'); + localVarQueryParameters = this.addToHttpParams(localVarQueryParameters, + select, 'select'); - let responseType_: 'text' | 'json' | 'blob' = 'json'; - if (localVarHttpHeaderAcceptSelected) { - if (localVarHttpHeaderAcceptSelected.startsWith('text')) { - responseType_ = 'text'; - } else if ( - this.configuration.isJsonMime(localVarHttpHeaderAcceptSelected) - ) { - responseType_ = 'json'; - } else { - responseType_ = 'blob'; - } + let localVarHeaders = this.defaultHeaders; + + const localVarHttpHeaderAcceptSelected: string | undefined = options?.httpHeaderAccept ?? this.configuration.selectHeaderAccept([ + 'application/json' + ]); + if (localVarHttpHeaderAcceptSelected !== undefined) { + localVarHeaders = localVarHeaders.set('Accept', localVarHttpHeaderAcceptSelected); + } + + const localVarHttpContext: HttpContext = options?.context ?? new HttpContext(); + + const localVarTransferCache: boolean = options?.transferCache ?? true; + + + let responseType_: 'text' | 'json' | 'blob' = 'json'; + if (localVarHttpHeaderAcceptSelected) { + if (localVarHttpHeaderAcceptSelected.startsWith('text')) { + responseType_ = 'text'; + } else if (this.configuration.isJsonMime(localVarHttpHeaderAcceptSelected)) { + responseType_ = 'json'; + } else { + responseType_ = 'blob'; + } + } + + let localVarPath = `/api/topics`; + const { basePath, withCredentials } = this.configuration; + return this.httpClient.request('get', `${basePath}${localVarPath}`, + { + context: localVarHttpContext, + params: localVarQueryParameters, + responseType: responseType_, + ...(withCredentials ? { withCredentials } : {}), + headers: localVarHeaders, + observe: observe, + ...(localVarTransferCache !== undefined ? { transferCache: localVarTransferCache } : {}), + reportProgress: reportProgress + } + ); } - let localVarPath = `/api/inse-service/topics/hierarchy`; - const { basePath, withCredentials } = this.configuration; - return this.httpClient.request( - 'get', - `${basePath}${localVarPath}`, - { - context: localVarHttpContext, - responseType: responseType_, - ...(withCredentials ? { withCredentials } : {}), - headers: localVarHeaders, - observe: observe, - ...(localVarTransferCache !== undefined - ? { transferCache: localVarTransferCache } - : {}), - reportProgress: reportProgress, - }, - ); - } + /** + * Semantic / vector search for topics using a keyword/sentence. + * @endpoint get /api/topics/vector-search + * @param query Word or sentence to search by similarity. + * @param limit Maximum number of topics to return. + * @param searchType Search approach: \'hybrid\' or \'semantic\'. + * @param observe set whether or not to return the data Observable as the body, response or events. defaults to returning the body. + * @param reportProgress flag to report request and response progress. + */ + public vectorSearchTopics(query: string, limit?: number, searchType?: string, observe?: 'body', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable; + public vectorSearchTopics(query: string, limit?: number, searchType?: string, observe?: 'response', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable>; + public vectorSearchTopics(query: string, limit?: number, searchType?: string, observe?: 'events', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable>; + public vectorSearchTopics(query: string, limit?: number, searchType?: string, observe: any = 'body', reportProgress: boolean = false, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable { + if (query === null || query === undefined) { + throw new Error('Required parameter query was null or undefined when calling vectorSearchTopics.'); + } - /** - * Returns a list of OpenAlex topics. - * @endpoint get /api/topics - * @param search Full-text search, for example \'machine learning\'. - * @param filter OpenAlex filter, for example \'domain.id:1,works_count:>1000\'. - * @param sort Sort field, for example \'works_count:desc\'. - * @param groupBy OpenAlex group_by field, for example \'domain.id\'. - * @param perPage Results per page. - * @param page Page number. Use cursor for deep pagination. - * @param cursor Cursor pagination token. Use \'*\' to start. - * @param sample Random sample size. Cannot be combined with sort or page. - * @param select Comma-separated fields to return. - * @param observe set whether or not to return the data Observable as the body, response or events. defaults to returning the body. - * @param reportProgress flag to report request and response progress. - */ - public listTopics( - search?: string, - filter?: string, - sort?: string, - groupBy?: string, - perPage?: number, - page?: number, - cursor?: string, - sample?: number, - select?: string, - observe?: 'body', - reportProgress?: boolean, - options?: { - httpHeaderAccept?: 'application/json'; - context?: HttpContext; - transferCache?: boolean; - }, - ): Observable; - public listTopics( - search?: string, - filter?: string, - sort?: string, - groupBy?: string, - perPage?: number, - page?: number, - cursor?: string, - sample?: number, - select?: string, - observe?: 'response', - reportProgress?: boolean, - options?: { - httpHeaderAccept?: 'application/json'; - context?: HttpContext; - transferCache?: boolean; - }, - ): Observable>; - public listTopics( - search?: string, - filter?: string, - sort?: string, - groupBy?: string, - perPage?: number, - page?: number, - cursor?: string, - sample?: number, - select?: string, - observe?: 'events', - reportProgress?: boolean, - options?: { - httpHeaderAccept?: 'application/json'; - context?: HttpContext; - transferCache?: boolean; - }, - ): Observable>; - public listTopics( - search?: string, - filter?: string, - sort?: string, - groupBy?: string, - perPage?: number, - page?: number, - cursor?: string, - sample?: number, - select?: string, - observe: any = 'body', - reportProgress: boolean = false, - options?: { - httpHeaderAccept?: 'application/json'; - context?: HttpContext; - transferCache?: boolean; - }, - ): Observable { - let localVarQueryParameters = new HttpParams({ encoder: this.encoder }); - localVarQueryParameters = this.addToHttpParams( - localVarQueryParameters, - search, - 'search', - ); - localVarQueryParameters = this.addToHttpParams( - localVarQueryParameters, - filter, - 'filter', - ); - localVarQueryParameters = this.addToHttpParams( - localVarQueryParameters, - sort, - 'sort', - ); - localVarQueryParameters = this.addToHttpParams( - localVarQueryParameters, - groupBy, - 'group_by', - ); - localVarQueryParameters = this.addToHttpParams( - localVarQueryParameters, - perPage, - 'per_page', - ); - localVarQueryParameters = this.addToHttpParams( - localVarQueryParameters, - page, - 'page', - ); - localVarQueryParameters = this.addToHttpParams( - localVarQueryParameters, - cursor, - 'cursor', - ); - localVarQueryParameters = this.addToHttpParams( - localVarQueryParameters, - sample, - 'sample', - ); - localVarQueryParameters = this.addToHttpParams( - localVarQueryParameters, - select, - 'select', - ); + let localVarQueryParameters = new HttpParams({encoder: this.encoder}); + localVarQueryParameters = this.addToHttpParams(localVarQueryParameters, + query, 'query'); + localVarQueryParameters = this.addToHttpParams(localVarQueryParameters, + limit, 'limit'); + localVarQueryParameters = this.addToHttpParams(localVarQueryParameters, + searchType, 'searchType'); - let localVarHeaders = this.defaultHeaders; + let localVarHeaders = this.defaultHeaders; - const localVarHttpHeaderAcceptSelected: string | undefined = - options?.httpHeaderAccept ?? - this.configuration.selectHeaderAccept(['application/json']); - if (localVarHttpHeaderAcceptSelected !== undefined) { - localVarHeaders = localVarHeaders.set( - 'Accept', - localVarHttpHeaderAcceptSelected, - ); + const localVarHttpHeaderAcceptSelected: string | undefined = options?.httpHeaderAccept ?? this.configuration.selectHeaderAccept([ + 'application/json' + ]); + if (localVarHttpHeaderAcceptSelected !== undefined) { + localVarHeaders = localVarHeaders.set('Accept', localVarHttpHeaderAcceptSelected); + } + + const localVarHttpContext: HttpContext = options?.context ?? new HttpContext(); + + const localVarTransferCache: boolean = options?.transferCache ?? true; + + + let responseType_: 'text' | 'json' | 'blob' = 'json'; + if (localVarHttpHeaderAcceptSelected) { + if (localVarHttpHeaderAcceptSelected.startsWith('text')) { + responseType_ = 'text'; + } else if (this.configuration.isJsonMime(localVarHttpHeaderAcceptSelected)) { + responseType_ = 'json'; + } else { + responseType_ = 'blob'; + } + } + + let localVarPath = `/api/topics/vector-search`; + const { basePath, withCredentials } = this.configuration; + return this.httpClient.request('get', `${basePath}${localVarPath}`, + { + context: localVarHttpContext, + params: localVarQueryParameters, + responseType: responseType_, + ...(withCredentials ? { withCredentials } : {}), + headers: localVarHeaders, + observe: observe, + ...(localVarTransferCache !== undefined ? { transferCache: localVarTransferCache } : {}), + reportProgress: reportProgress + } + ); } - const localVarHttpContext: HttpContext = - options?.context ?? new HttpContext(); + /** + * Batch semantic / vector search for multiple keywords. + * @endpoint post /api/topics/vector-search/batch + * @param keywordsTopicsRequest + * @param searchType Search approach: \'hybrid\' or \'semantic\'. + * @param observe set whether or not to return the data Observable as the body, response or events. defaults to returning the body. + * @param reportProgress flag to report request and response progress. + */ + public vectorSearchTopicsBatch(keywordsTopicsRequest: KeywordsTopicsRequest, searchType?: string, observe?: 'body', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable; + public vectorSearchTopicsBatch(keywordsTopicsRequest: KeywordsTopicsRequest, searchType?: string, observe?: 'response', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable>; + public vectorSearchTopicsBatch(keywordsTopicsRequest: KeywordsTopicsRequest, searchType?: string, observe?: 'events', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable>; + public vectorSearchTopicsBatch(keywordsTopicsRequest: KeywordsTopicsRequest, searchType?: string, observe: any = 'body', reportProgress: boolean = false, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable { + if (keywordsTopicsRequest === null || keywordsTopicsRequest === undefined) { + throw new Error('Required parameter keywordsTopicsRequest was null or undefined when calling vectorSearchTopicsBatch.'); + } - const localVarTransferCache: boolean = options?.transferCache ?? true; + let localVarQueryParameters = new HttpParams({encoder: this.encoder}); + localVarQueryParameters = this.addToHttpParams(localVarQueryParameters, + searchType, 'searchType'); - let responseType_: 'text' | 'json' | 'blob' = 'json'; - if (localVarHttpHeaderAcceptSelected) { - if (localVarHttpHeaderAcceptSelected.startsWith('text')) { - responseType_ = 'text'; - } else if ( - this.configuration.isJsonMime(localVarHttpHeaderAcceptSelected) - ) { - responseType_ = 'json'; - } else { - responseType_ = 'blob'; - } + let localVarHeaders = this.defaultHeaders; + + const localVarHttpHeaderAcceptSelected: string | undefined = options?.httpHeaderAccept ?? this.configuration.selectHeaderAccept([ + 'application/json' + ]); + if (localVarHttpHeaderAcceptSelected !== undefined) { + localVarHeaders = localVarHeaders.set('Accept', localVarHttpHeaderAcceptSelected); + } + + const localVarHttpContext: HttpContext = options?.context ?? new HttpContext(); + + const localVarTransferCache: boolean = options?.transferCache ?? true; + + + // to determine the Content-Type header + const consumes: string[] = [ + 'application/json' + ]; + const httpContentTypeSelected: string | undefined = this.configuration.selectHeaderContentType(consumes); + if (httpContentTypeSelected !== undefined) { + localVarHeaders = localVarHeaders.set('Content-Type', httpContentTypeSelected); + } + + let responseType_: 'text' | 'json' | 'blob' = 'json'; + if (localVarHttpHeaderAcceptSelected) { + if (localVarHttpHeaderAcceptSelected.startsWith('text')) { + responseType_ = 'text'; + } else if (this.configuration.isJsonMime(localVarHttpHeaderAcceptSelected)) { + responseType_ = 'json'; + } else { + responseType_ = 'blob'; + } + } + + let localVarPath = `/api/topics/vector-search/batch`; + const { basePath, withCredentials } = this.configuration; + return this.httpClient.request('post', `${basePath}${localVarPath}`, + { + context: localVarHttpContext, + body: keywordsTopicsRequest, + params: localVarQueryParameters, + responseType: responseType_, + ...(withCredentials ? { withCredentials } : {}), + headers: localVarHeaders, + observe: observe, + ...(localVarTransferCache !== undefined ? { transferCache: localVarTransferCache } : {}), + reportProgress: reportProgress + } + ); } - let localVarPath = `/api/topics`; - const { basePath, withCredentials } = this.configuration; - return this.httpClient.request( - 'get', - `${basePath}${localVarPath}`, - { - context: localVarHttpContext, - params: localVarQueryParameters, - responseType: responseType_, - ...(withCredentials ? { withCredentials } : {}), - headers: localVarHeaders, - observe: observe, - ...(localVarTransferCache !== undefined - ? { transferCache: localVarTransferCache } - : {}), - reportProgress: reportProgress, - }, - ); - } - - /** - * Semantic / vector search for topics using a keyword/sentence. - * @endpoint get /api/topics/vector-search - * @param query Word or sentence to search by similarity. - * @param limit Maximum number of topics to return. - * @param searchType Search approach: \'hybrid\' or \'semantic\'. - * @param observe set whether or not to return the data Observable as the body, response or events. defaults to returning the body. - * @param reportProgress flag to report request and response progress. - */ - public vectorSearchTopics( - query: string, - limit?: number, - searchType?: string, - observe?: 'body', - reportProgress?: boolean, - options?: { - httpHeaderAccept?: 'application/json'; - context?: HttpContext; - transferCache?: boolean; - }, - ): Observable; - public vectorSearchTopics( - query: string, - limit?: number, - searchType?: string, - observe?: 'response', - reportProgress?: boolean, - options?: { - httpHeaderAccept?: 'application/json'; - context?: HttpContext; - transferCache?: boolean; - }, - ): Observable>; - public vectorSearchTopics( - query: string, - limit?: number, - searchType?: string, - observe?: 'events', - reportProgress?: boolean, - options?: { - httpHeaderAccept?: 'application/json'; - context?: HttpContext; - transferCache?: boolean; - }, - ): Observable>; - public vectorSearchTopics( - query: string, - limit?: number, - searchType?: string, - observe: any = 'body', - reportProgress: boolean = false, - options?: { - httpHeaderAccept?: 'application/json'; - context?: HttpContext; - transferCache?: boolean; - }, - ): Observable { - if (query === null || query === undefined) { - throw new Error( - 'Required parameter query was null or undefined when calling vectorSearchTopics.', - ); - } - - let localVarQueryParameters = new HttpParams({ encoder: this.encoder }); - localVarQueryParameters = this.addToHttpParams( - localVarQueryParameters, - query, - 'query', - ); - localVarQueryParameters = this.addToHttpParams( - localVarQueryParameters, - limit, - 'limit', - ); - localVarQueryParameters = this.addToHttpParams( - localVarQueryParameters, - searchType, - 'searchType', - ); - - let localVarHeaders = this.defaultHeaders; - - const localVarHttpHeaderAcceptSelected: string | undefined = - options?.httpHeaderAccept ?? - this.configuration.selectHeaderAccept(['application/json']); - if (localVarHttpHeaderAcceptSelected !== undefined) { - localVarHeaders = localVarHeaders.set( - 'Accept', - localVarHttpHeaderAcceptSelected, - ); - } - - const localVarHttpContext: HttpContext = - options?.context ?? new HttpContext(); - - const localVarTransferCache: boolean = options?.transferCache ?? true; - - let responseType_: 'text' | 'json' | 'blob' = 'json'; - if (localVarHttpHeaderAcceptSelected) { - if (localVarHttpHeaderAcceptSelected.startsWith('text')) { - responseType_ = 'text'; - } else if ( - this.configuration.isJsonMime(localVarHttpHeaderAcceptSelected) - ) { - responseType_ = 'json'; - } else { - responseType_ = 'blob'; - } - } - - let localVarPath = `/api/topics/vector-search`; - const { basePath, withCredentials } = this.configuration; - return this.httpClient.request( - 'get', - `${basePath}${localVarPath}`, - { - context: localVarHttpContext, - params: localVarQueryParameters, - responseType: responseType_, - ...(withCredentials ? { withCredentials } : {}), - headers: localVarHeaders, - observe: observe, - ...(localVarTransferCache !== undefined - ? { transferCache: localVarTransferCache } - : {}), - reportProgress: reportProgress, - }, - ); - } - - /** - * Batch semantic / vector search for multiple keywords. - * @endpoint post /api/topics/vector-search/batch - * @param keywordsTopicsRequest - * @param searchType Search approach: \'hybrid\' or \'semantic\'. - * @param observe set whether or not to return the data Observable as the body, response or events. defaults to returning the body. - * @param reportProgress flag to report request and response progress. - */ - public vectorSearchTopicsBatch( - keywordsTopicsRequest: KeywordsTopicsRequest, - searchType?: string, - observe?: 'body', - reportProgress?: boolean, - options?: { - httpHeaderAccept?: 'application/json'; - context?: HttpContext; - transferCache?: boolean; - }, - ): Observable; - public vectorSearchTopicsBatch( - keywordsTopicsRequest: KeywordsTopicsRequest, - searchType?: string, - observe?: 'response', - reportProgress?: boolean, - options?: { - httpHeaderAccept?: 'application/json'; - context?: HttpContext; - transferCache?: boolean; - }, - ): Observable>; - public vectorSearchTopicsBatch( - keywordsTopicsRequest: KeywordsTopicsRequest, - searchType?: string, - observe?: 'events', - reportProgress?: boolean, - options?: { - httpHeaderAccept?: 'application/json'; - context?: HttpContext; - transferCache?: boolean; - }, - ): Observable>; - public vectorSearchTopicsBatch( - keywordsTopicsRequest: KeywordsTopicsRequest, - searchType?: string, - observe: any = 'body', - reportProgress: boolean = false, - options?: { - httpHeaderAccept?: 'application/json'; - context?: HttpContext; - transferCache?: boolean; - }, - ): Observable { - if (keywordsTopicsRequest === null || keywordsTopicsRequest === undefined) { - throw new Error( - 'Required parameter keywordsTopicsRequest was null or undefined when calling vectorSearchTopicsBatch.', - ); - } - - let localVarQueryParameters = new HttpParams({ encoder: this.encoder }); - localVarQueryParameters = this.addToHttpParams( - localVarQueryParameters, - searchType, - 'searchType', - ); - - let localVarHeaders = this.defaultHeaders; - - const localVarHttpHeaderAcceptSelected: string | undefined = - options?.httpHeaderAccept ?? - this.configuration.selectHeaderAccept(['application/json']); - if (localVarHttpHeaderAcceptSelected !== undefined) { - localVarHeaders = localVarHeaders.set( - 'Accept', - localVarHttpHeaderAcceptSelected, - ); - } - - const localVarHttpContext: HttpContext = - options?.context ?? new HttpContext(); - - const localVarTransferCache: boolean = options?.transferCache ?? true; - - // to determine the Content-Type header - const consumes: string[] = ['application/json']; - const httpContentTypeSelected: string | undefined = - this.configuration.selectHeaderContentType(consumes); - if (httpContentTypeSelected !== undefined) { - localVarHeaders = localVarHeaders.set( - 'Content-Type', - httpContentTypeSelected, - ); - } - - let responseType_: 'text' | 'json' | 'blob' = 'json'; - if (localVarHttpHeaderAcceptSelected) { - if (localVarHttpHeaderAcceptSelected.startsWith('text')) { - responseType_ = 'text'; - } else if ( - this.configuration.isJsonMime(localVarHttpHeaderAcceptSelected) - ) { - responseType_ = 'json'; - } else { - responseType_ = 'blob'; - } - } - - let localVarPath = `/api/topics/vector-search/batch`; - const { basePath, withCredentials } = this.configuration; - return this.httpClient.request( - 'post', - `${basePath}${localVarPath}`, - { - context: localVarHttpContext, - body: keywordsTopicsRequest, - params: localVarQueryParameters, - responseType: responseType_, - ...(withCredentials ? { withCredentials } : {}), - headers: localVarHeaders, - observe: observe, - ...(localVarTransferCache !== undefined - ? { transferCache: localVarTransferCache } - : {}), - reportProgress: reportProgress, - }, - ); - } } diff --git a/webapp/src/app/api/api/topicsV2.service.ts b/webapp/src/app/api/api/topicsV2.service.ts new file mode 100644 index 00000000..f082e67b --- /dev/null +++ b/webapp/src/app/api/api/topicsV2.service.ts @@ -0,0 +1,158 @@ +/** + * Innovation Search Engine API + * + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ +/* tslint:disable:no-unused-variable member-ordering */ + +import { Inject, Injectable, Optional } from '@angular/core'; +import { HttpClient, HttpHeaders, HttpParams, + HttpResponse, HttpEvent, HttpParameterCodec, HttpContext + } from '@angular/common/http'; +import { CustomHttpParameterCodec } from '../encoder'; +import { Observable } from 'rxjs'; + +// @ts-ignore +import { HTTPValidationError } from '../model/hTTPValidationError'; +// @ts-ignore +import { TopicPageV2 } from '../model/topicPageV2'; + +// @ts-ignore +import { BASE_PATH, COLLECTION_FORMATS } from '../variables'; +import { Configuration } from '../configuration'; +import { BaseService } from '../api.base.service'; + + + +@Injectable({ + providedIn: 'root' +}) +export class TopicsV2Service extends BaseService { + + constructor(protected httpClient: HttpClient, @Optional() @Inject(BASE_PATH) basePath: string|string[], @Optional() configuration?: Configuration) { + super(basePath, configuration); + } + + /** + * Returns a paginated list of topics for a given search term based on their display name. + * @endpoint get /api/v2/topics/autocomplete/selector + * @param query A search term to filter topics by (partial matches allowed). + * @param observe set whether or not to return the data Observable as the body, response or events. defaults to returning the body. + * @param reportProgress flag to report request and response progress. + */ + public autocompleteTopicsForSelector(query?: string, observe?: 'body', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable; + public autocompleteTopicsForSelector(query?: string, observe?: 'response', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable>; + public autocompleteTopicsForSelector(query?: string, observe?: 'events', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable>; + public autocompleteTopicsForSelector(query?: string, observe: any = 'body', reportProgress: boolean = false, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable { + + let localVarQueryParameters = new HttpParams({encoder: this.encoder}); + localVarQueryParameters = this.addToHttpParams(localVarQueryParameters, + query, 'query'); + + let localVarHeaders = this.defaultHeaders; + + const localVarHttpHeaderAcceptSelected: string | undefined = options?.httpHeaderAccept ?? this.configuration.selectHeaderAccept([ + 'application/json' + ]); + if (localVarHttpHeaderAcceptSelected !== undefined) { + localVarHeaders = localVarHeaders.set('Accept', localVarHttpHeaderAcceptSelected); + } + + const localVarHttpContext: HttpContext = options?.context ?? new HttpContext(); + + const localVarTransferCache: boolean = options?.transferCache ?? true; + + + let responseType_: 'text' | 'json' | 'blob' = 'json'; + if (localVarHttpHeaderAcceptSelected) { + if (localVarHttpHeaderAcceptSelected.startsWith('text')) { + responseType_ = 'text'; + } else if (this.configuration.isJsonMime(localVarHttpHeaderAcceptSelected)) { + responseType_ = 'json'; + } else { + responseType_ = 'blob'; + } + } + + let localVarPath = `/api/v2/topics/autocomplete/selector`; + const { basePath, withCredentials } = this.configuration; + return this.httpClient.request('get', `${basePath}${localVarPath}`, + { + context: localVarHttpContext, + params: localVarQueryParameters, + responseType: responseType_, + ...(withCredentials ? { withCredentials } : {}), + headers: localVarHeaders, + observe: observe, + ...(localVarTransferCache !== undefined ? { transferCache: localVarTransferCache } : {}), + reportProgress: reportProgress + } + ); + } + + /** + * Returns a paginated list of topics for a given list of topic IDs. + * @endpoint get /api/v2/topics/topics/id + * @param topicIds A list of topic IDs to retrieve. + * @param observe set whether or not to return the data Observable as the body, response or events. defaults to returning the body. + * @param reportProgress flag to report request and response progress. + */ + public getTopicsByIds(topicIds?: Array, observe?: 'body', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable; + public getTopicsByIds(topicIds?: Array, observe?: 'response', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable>; + public getTopicsByIds(topicIds?: Array, observe?: 'events', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable>; + public getTopicsByIds(topicIds?: Array, observe: any = 'body', reportProgress: boolean = false, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable { + + let localVarQueryParameters = new HttpParams({encoder: this.encoder}); + if (topicIds) { + topicIds.forEach((element) => { + localVarQueryParameters = this.addToHttpParams(localVarQueryParameters, + element, 'topic_ids'); + }) + } + + let localVarHeaders = this.defaultHeaders; + + const localVarHttpHeaderAcceptSelected: string | undefined = options?.httpHeaderAccept ?? this.configuration.selectHeaderAccept([ + 'application/json' + ]); + if (localVarHttpHeaderAcceptSelected !== undefined) { + localVarHeaders = localVarHeaders.set('Accept', localVarHttpHeaderAcceptSelected); + } + + const localVarHttpContext: HttpContext = options?.context ?? new HttpContext(); + + const localVarTransferCache: boolean = options?.transferCache ?? true; + + + let responseType_: 'text' | 'json' | 'blob' = 'json'; + if (localVarHttpHeaderAcceptSelected) { + if (localVarHttpHeaderAcceptSelected.startsWith('text')) { + responseType_ = 'text'; + } else if (this.configuration.isJsonMime(localVarHttpHeaderAcceptSelected)) { + responseType_ = 'json'; + } else { + responseType_ = 'blob'; + } + } + + let localVarPath = `/api/v2/topics/topics/id`; + const { basePath, withCredentials } = this.configuration; + return this.httpClient.request('get', `${basePath}${localVarPath}`, + { + context: localVarHttpContext, + params: localVarQueryParameters, + responseType: responseType_, + ...(withCredentials ? { withCredentials } : {}), + headers: localVarHeaders, + observe: observe, + ...(localVarTransferCache !== undefined ? { transferCache: localVarTransferCache } : {}), + reportProgress: reportProgress + } + ); + } + +} diff --git a/webapp/src/app/api/api/universityRankings.service.ts b/webapp/src/app/api/api/universityRankings.service.ts index a7aba880..82bcee4c 100644 --- a/webapp/src/app/api/api/universityRankings.service.ts +++ b/webapp/src/app/api/api/universityRankings.service.ts @@ -1,7 +1,7 @@ /** * Innovation Search Engine API * - * + * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech @@ -9,18 +9,12 @@ */ /* tslint:disable:no-unused-variable member-ordering */ -import { Inject, Injectable, Optional } from '@angular/core'; -import { - HttpClient, - HttpHeaders, - HttpParams, - HttpResponse, - HttpEvent, - HttpParameterCodec, - HttpContext, -} from '@angular/common/http'; -import { CustomHttpParameterCodec } from '../encoder'; -import { Observable } from 'rxjs'; +import { Inject, Injectable, Optional } from '@angular/core'; +import { HttpClient, HttpHeaders, HttpParams, + HttpResponse, HttpEvent, HttpParameterCodec, HttpContext + } from '@angular/common/http'; +import { CustomHttpParameterCodec } from '../encoder'; +import { Observable } from 'rxjs'; // @ts-ignore import { AutocompleteLocationItem } from '../model/autocompleteLocationItem'; @@ -38,748 +32,391 @@ import { TrendResponse } from '../model/trendResponse'; import { TrendSearchType } from '../model/trendSearchType'; // @ts-ignore -import { BASE_PATH, COLLECTION_FORMATS } from '../variables'; -import { Configuration } from '../configuration'; +import { BASE_PATH, COLLECTION_FORMATS } from '../variables'; +import { Configuration } from '../configuration'; import { BaseService } from '../api.base.service'; + + @Injectable({ - providedIn: 'root', + providedIn: 'root' }) export class UniversityRankingsService extends BaseService { - constructor( - protected httpClient: HttpClient, - @Optional() @Inject(BASE_PATH) basePath: string | string[], - @Optional() configuration?: Configuration, - ) { - super(basePath, configuration); - } - /** - * Returns country and continent options for autocomplete inputs. - * @endpoint get /api/inse-service/university-rankings/autocomplete-locations - * @param query Query text to search for countries/continents - * @param observe set whether or not to return the data Observable as the body, response or events. defaults to returning the body. - * @param reportProgress flag to report request and response progress. - */ - public getAutocompleteLocationsApiInseServiceUniversityRankingsAutocompleteLocationsGet( - query: string, - observe?: 'body', - reportProgress?: boolean, - options?: { - httpHeaderAccept?: 'application/json'; - context?: HttpContext; - transferCache?: boolean; - }, - ): Observable>; - public getAutocompleteLocationsApiInseServiceUniversityRankingsAutocompleteLocationsGet( - query: string, - observe?: 'response', - reportProgress?: boolean, - options?: { - httpHeaderAccept?: 'application/json'; - context?: HttpContext; - transferCache?: boolean; - }, - ): Observable>>; - public getAutocompleteLocationsApiInseServiceUniversityRankingsAutocompleteLocationsGet( - query: string, - observe?: 'events', - reportProgress?: boolean, - options?: { - httpHeaderAccept?: 'application/json'; - context?: HttpContext; - transferCache?: boolean; - }, - ): Observable>>; - public getAutocompleteLocationsApiInseServiceUniversityRankingsAutocompleteLocationsGet( - query: string, - observe: any = 'body', - reportProgress: boolean = false, - options?: { - httpHeaderAccept?: 'application/json'; - context?: HttpContext; - transferCache?: boolean; - }, - ): Observable { - if (query === null || query === undefined) { - throw new Error( - 'Required parameter query was null or undefined when calling getAutocompleteLocationsApiInseServiceUniversityRankingsAutocompleteLocationsGet.', - ); + constructor(protected httpClient: HttpClient, @Optional() @Inject(BASE_PATH) basePath: string|string[], @Optional() configuration?: Configuration) { + super(basePath, configuration); } - let localVarQueryParameters = new HttpParams({ encoder: this.encoder }); - localVarQueryParameters = this.addToHttpParams( - localVarQueryParameters, - query, - 'query', - ); + /** + * Returns country and continent options for autocomplete inputs. + * @endpoint get /api/inse-service/university-rankings/autocomplete-locations + * @param query Query text to search for countries/continents + * @param observe set whether or not to return the data Observable as the body, response or events. defaults to returning the body. + * @param reportProgress flag to report request and response progress. + */ + public getAutocompleteLocationsApiInseServiceUniversityRankingsAutocompleteLocationsGet(query: string, observe?: 'body', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable>; + public getAutocompleteLocationsApiInseServiceUniversityRankingsAutocompleteLocationsGet(query: string, observe?: 'response', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable>>; + public getAutocompleteLocationsApiInseServiceUniversityRankingsAutocompleteLocationsGet(query: string, observe?: 'events', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable>>; + public getAutocompleteLocationsApiInseServiceUniversityRankingsAutocompleteLocationsGet(query: string, observe: any = 'body', reportProgress: boolean = false, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable { + if (query === null || query === undefined) { + throw new Error('Required parameter query was null or undefined when calling getAutocompleteLocationsApiInseServiceUniversityRankingsAutocompleteLocationsGet.'); + } - let localVarHeaders = this.defaultHeaders; + let localVarQueryParameters = new HttpParams({encoder: this.encoder}); + localVarQueryParameters = this.addToHttpParams(localVarQueryParameters, + query, 'query'); - const localVarHttpHeaderAcceptSelected: string | undefined = - options?.httpHeaderAccept ?? - this.configuration.selectHeaderAccept(['application/json']); - if (localVarHttpHeaderAcceptSelected !== undefined) { - localVarHeaders = localVarHeaders.set( - 'Accept', - localVarHttpHeaderAcceptSelected, - ); - } + let localVarHeaders = this.defaultHeaders; - const localVarHttpContext: HttpContext = - options?.context ?? new HttpContext(); + const localVarHttpHeaderAcceptSelected: string | undefined = options?.httpHeaderAccept ?? this.configuration.selectHeaderAccept([ + 'application/json' + ]); + if (localVarHttpHeaderAcceptSelected !== undefined) { + localVarHeaders = localVarHeaders.set('Accept', localVarHttpHeaderAcceptSelected); + } - const localVarTransferCache: boolean = options?.transferCache ?? true; + const localVarHttpContext: HttpContext = options?.context ?? new HttpContext(); - let responseType_: 'text' | 'json' | 'blob' = 'json'; - if (localVarHttpHeaderAcceptSelected) { - if (localVarHttpHeaderAcceptSelected.startsWith('text')) { - responseType_ = 'text'; - } else if ( - this.configuration.isJsonMime(localVarHttpHeaderAcceptSelected) - ) { - responseType_ = 'json'; - } else { - responseType_ = 'blob'; - } - } + const localVarTransferCache: boolean = options?.transferCache ?? true; - let localVarPath = `/api/inse-service/university-rankings/autocomplete-locations`; - const { basePath, withCredentials } = this.configuration; - return this.httpClient.request>( - 'get', - `${basePath}${localVarPath}`, - { - context: localVarHttpContext, - params: localVarQueryParameters, - responseType: responseType_, - ...(withCredentials ? { withCredentials } : {}), - headers: localVarHeaders, - observe: observe, - ...(localVarTransferCache !== undefined - ? { transferCache: localVarTransferCache } - : {}), - reportProgress: reportProgress, - }, - ); - } - /** - * Returns data for the University Ranking Dashboard. - * @endpoint get /api/inse-service/university-rankings - * @param topic Research topic display name or OpenAlex ID (e.g., \'Artificial Intelligence\') - * @param metric Metric to rank by - * @param observe set whether or not to return the data Observable as the body, response or events. defaults to returning the body. - * @param reportProgress flag to report request and response progress. - */ - public getRankingsApiInseServiceUniversityRankingsGet( - topic: string, - metric?: 'publications' | 'citations', - observe?: 'body', - reportProgress?: boolean, - options?: { - httpHeaderAccept?: 'application/json'; - context?: HttpContext; - transferCache?: boolean; - }, - ): Observable; - public getRankingsApiInseServiceUniversityRankingsGet( - topic: string, - metric?: 'publications' | 'citations', - observe?: 'response', - reportProgress?: boolean, - options?: { - httpHeaderAccept?: 'application/json'; - context?: HttpContext; - transferCache?: boolean; - }, - ): Observable>; - public getRankingsApiInseServiceUniversityRankingsGet( - topic: string, - metric?: 'publications' | 'citations', - observe?: 'events', - reportProgress?: boolean, - options?: { - httpHeaderAccept?: 'application/json'; - context?: HttpContext; - transferCache?: boolean; - }, - ): Observable>; - public getRankingsApiInseServiceUniversityRankingsGet( - topic: string, - metric?: 'publications' | 'citations', - observe: any = 'body', - reportProgress: boolean = false, - options?: { - httpHeaderAccept?: 'application/json'; - context?: HttpContext; - transferCache?: boolean; - }, - ): Observable { - if (topic === null || topic === undefined) { - throw new Error( - 'Required parameter topic was null or undefined when calling getRankingsApiInseServiceUniversityRankingsGet.', - ); - } + let responseType_: 'text' | 'json' | 'blob' = 'json'; + if (localVarHttpHeaderAcceptSelected) { + if (localVarHttpHeaderAcceptSelected.startsWith('text')) { + responseType_ = 'text'; + } else if (this.configuration.isJsonMime(localVarHttpHeaderAcceptSelected)) { + responseType_ = 'json'; + } else { + responseType_ = 'blob'; + } + } - let localVarQueryParameters = new HttpParams({ encoder: this.encoder }); - localVarQueryParameters = this.addToHttpParams( - localVarQueryParameters, - topic, - 'topic', - ); - localVarQueryParameters = this.addToHttpParams( - localVarQueryParameters, - metric, - 'metric', - ); - - let localVarHeaders = this.defaultHeaders; - - const localVarHttpHeaderAcceptSelected: string | undefined = - options?.httpHeaderAccept ?? - this.configuration.selectHeaderAccept(['application/json']); - if (localVarHttpHeaderAcceptSelected !== undefined) { - localVarHeaders = localVarHeaders.set( - 'Accept', - localVarHttpHeaderAcceptSelected, - ); - } - - const localVarHttpContext: HttpContext = - options?.context ?? new HttpContext(); - - const localVarTransferCache: boolean = options?.transferCache ?? true; - - let responseType_: 'text' | 'json' | 'blob' = 'json'; - if (localVarHttpHeaderAcceptSelected) { - if (localVarHttpHeaderAcceptSelected.startsWith('text')) { - responseType_ = 'text'; - } else if ( - this.configuration.isJsonMime(localVarHttpHeaderAcceptSelected) - ) { - responseType_ = 'json'; - } else { - responseType_ = 'blob'; - } - } - - let localVarPath = `/api/inse-service/university-rankings`; - const { basePath, withCredentials } = this.configuration; - return this.httpClient.request( - 'get', - `${basePath}${localVarPath}`, - { - context: localVarHttpContext, - params: localVarQueryParameters, - responseType: responseType_, - ...(withCredentials ? { withCredentials } : {}), - headers: localVarHeaders, - observe: observe, - ...(localVarTransferCache !== undefined - ? { transferCache: localVarTransferCache } - : {}), - reportProgress: reportProgress, - }, - ); - } - - /** - * Returns top institutions filtered by country/region and sorted by topic-level publications count. - * @endpoint get /api/inse-service/university-rankings/top-institutions - * @param topic Research topic - * @param region Region identifier (e.g. EU) - * @param country Country code (e.g. DE) - * @param limit Max suggestions to return - * @param observe set whether or not to return the data Observable as the body, response or events. defaults to returning the body. - * @param reportProgress flag to report request and response progress. - */ - public getTopInstitutionsApiInseServiceUniversityRankingsTopInstitutionsGet( - topic: string, - region?: string, - country?: string, - limit?: number, - observe?: 'body', - reportProgress?: boolean, - options?: { - httpHeaderAccept?: 'application/json'; - context?: HttpContext; - transferCache?: boolean; - }, - ): Observable>; - public getTopInstitutionsApiInseServiceUniversityRankingsTopInstitutionsGet( - topic: string, - region?: string, - country?: string, - limit?: number, - observe?: 'response', - reportProgress?: boolean, - options?: { - httpHeaderAccept?: 'application/json'; - context?: HttpContext; - transferCache?: boolean; - }, - ): Observable>>; - public getTopInstitutionsApiInseServiceUniversityRankingsTopInstitutionsGet( - topic: string, - region?: string, - country?: string, - limit?: number, - observe?: 'events', - reportProgress?: boolean, - options?: { - httpHeaderAccept?: 'application/json'; - context?: HttpContext; - transferCache?: boolean; - }, - ): Observable>>; - public getTopInstitutionsApiInseServiceUniversityRankingsTopInstitutionsGet( - topic: string, - region?: string, - country?: string, - limit?: number, - observe: any = 'body', - reportProgress: boolean = false, - options?: { - httpHeaderAccept?: 'application/json'; - context?: HttpContext; - transferCache?: boolean; - }, - ): Observable { - if (topic === null || topic === undefined) { - throw new Error( - 'Required parameter topic was null or undefined when calling getTopInstitutionsApiInseServiceUniversityRankingsTopInstitutionsGet.', - ); - } - - let localVarQueryParameters = new HttpParams({ encoder: this.encoder }); - localVarQueryParameters = this.addToHttpParams( - localVarQueryParameters, - topic, - 'topic', - ); - localVarQueryParameters = this.addToHttpParams( - localVarQueryParameters, - region, - 'region', - ); - localVarQueryParameters = this.addToHttpParams( - localVarQueryParameters, - country, - 'country', - ); - localVarQueryParameters = this.addToHttpParams( - localVarQueryParameters, - limit, - 'limit', - ); - - let localVarHeaders = this.defaultHeaders; - - const localVarHttpHeaderAcceptSelected: string | undefined = - options?.httpHeaderAccept ?? - this.configuration.selectHeaderAccept(['application/json']); - if (localVarHttpHeaderAcceptSelected !== undefined) { - localVarHeaders = localVarHeaders.set( - 'Accept', - localVarHttpHeaderAcceptSelected, - ); - } - - const localVarHttpContext: HttpContext = - options?.context ?? new HttpContext(); - - const localVarTransferCache: boolean = options?.transferCache ?? true; - - let responseType_: 'text' | 'json' | 'blob' = 'json'; - if (localVarHttpHeaderAcceptSelected) { - if (localVarHttpHeaderAcceptSelected.startsWith('text')) { - responseType_ = 'text'; - } else if ( - this.configuration.isJsonMime(localVarHttpHeaderAcceptSelected) - ) { - responseType_ = 'json'; - } else { - responseType_ = 'blob'; - } - } - - let localVarPath = `/api/inse-service/university-rankings/top-institutions`; - const { basePath, withCredentials } = this.configuration; - return this.httpClient.request>( - 'get', - `${basePath}${localVarPath}`, - { - context: localVarHttpContext, - params: localVarQueryParameters, - responseType: responseType_, - ...(withCredentials ? { withCredentials } : {}), - headers: localVarHeaders, - observe: observe, - ...(localVarTransferCache !== undefined - ? { transferCache: localVarTransferCache } - : {}), - reportProgress: reportProgress, - }, - ); - } - - /** - * Returns top 10 research topics for a selected entity. - * @endpoint get /api/inse-service/university-rankings/top-topics - * @param entityId Entity ID - * @param entityType Entity type: institution, author, country, region - * @param startYear Start year - * @param endYear End year - * @param searchType Search strategy type - * @param observe set whether or not to return the data Observable as the body, response or events. defaults to returning the body. - * @param reportProgress flag to report request and response progress. - */ - public getTopTopicsApiInseServiceUniversityRankingsTopTopicsGet( - entityId: string, - entityType: string, - startYear?: number, - endYear?: number, - searchType?: string, - observe?: 'body', - reportProgress?: boolean, - options?: { - httpHeaderAccept?: 'application/json'; - context?: HttpContext; - transferCache?: boolean; - }, - ): Observable; - public getTopTopicsApiInseServiceUniversityRankingsTopTopicsGet( - entityId: string, - entityType: string, - startYear?: number, - endYear?: number, - searchType?: string, - observe?: 'response', - reportProgress?: boolean, - options?: { - httpHeaderAccept?: 'application/json'; - context?: HttpContext; - transferCache?: boolean; - }, - ): Observable>; - public getTopTopicsApiInseServiceUniversityRankingsTopTopicsGet( - entityId: string, - entityType: string, - startYear?: number, - endYear?: number, - searchType?: string, - observe?: 'events', - reportProgress?: boolean, - options?: { - httpHeaderAccept?: 'application/json'; - context?: HttpContext; - transferCache?: boolean; - }, - ): Observable>; - public getTopTopicsApiInseServiceUniversityRankingsTopTopicsGet( - entityId: string, - entityType: string, - startYear?: number, - endYear?: number, - searchType?: string, - observe: any = 'body', - reportProgress: boolean = false, - options?: { - httpHeaderAccept?: 'application/json'; - context?: HttpContext; - transferCache?: boolean; - }, - ): Observable { - if (entityId === null || entityId === undefined) { - throw new Error( - 'Required parameter entityId was null or undefined when calling getTopTopicsApiInseServiceUniversityRankingsTopTopicsGet.', - ); - } - if (entityType === null || entityType === undefined) { - throw new Error( - 'Required parameter entityType was null or undefined when calling getTopTopicsApiInseServiceUniversityRankingsTopTopicsGet.', - ); - } - - let localVarQueryParameters = new HttpParams({ encoder: this.encoder }); - localVarQueryParameters = this.addToHttpParams( - localVarQueryParameters, - entityId, - 'entity_id', - ); - localVarQueryParameters = this.addToHttpParams( - localVarQueryParameters, - entityType, - 'entity_type', - ); - localVarQueryParameters = this.addToHttpParams( - localVarQueryParameters, - startYear, - 'start_year', - ); - localVarQueryParameters = this.addToHttpParams( - localVarQueryParameters, - endYear, - 'end_year', - ); - localVarQueryParameters = this.addToHttpParams( - localVarQueryParameters, - searchType, - 'search_type', - ); - - let localVarHeaders = this.defaultHeaders; - - const localVarHttpHeaderAcceptSelected: string | undefined = - options?.httpHeaderAccept ?? - this.configuration.selectHeaderAccept(['application/json']); - if (localVarHttpHeaderAcceptSelected !== undefined) { - localVarHeaders = localVarHeaders.set( - 'Accept', - localVarHttpHeaderAcceptSelected, - ); - } - - const localVarHttpContext: HttpContext = - options?.context ?? new HttpContext(); - - const localVarTransferCache: boolean = options?.transferCache ?? true; - - let responseType_: 'text' | 'json' | 'blob' = 'json'; - if (localVarHttpHeaderAcceptSelected) { - if (localVarHttpHeaderAcceptSelected.startsWith('text')) { - responseType_ = 'text'; - } else if ( - this.configuration.isJsonMime(localVarHttpHeaderAcceptSelected) - ) { - responseType_ = 'json'; - } else { - responseType_ = 'blob'; - } - } - - let localVarPath = `/api/inse-service/university-rankings/top-topics`; - const { basePath, withCredentials } = this.configuration; - return this.httpClient.request( - 'get', - `${basePath}${localVarPath}`, - { - context: localVarHttpContext, - params: localVarQueryParameters, - responseType: responseType_, - ...(withCredentials ? { withCredentials } : {}), - headers: localVarHeaders, - observe: observe, - ...(localVarTransferCache !== undefined - ? { transferCache: localVarTransferCache } - : {}), - reportProgress: reportProgress, - }, - ); - } - - /** - * Returns timeseries publication data for compared institutions, countries, and regions. - * @endpoint get /api/inse-service/university-rankings/trend - * @param topics List of topics to analyze - * @param keywords List of raw keywords corresponding to topics - * @param fuzzy True if using mapped topics, False if using raw keywords - * @param institutions List of OpenAlex Institution IDs - * @param countries List of country codes - * @param regions List of region identifiers - * @param authors List of OpenAlex Author IDs - * @param searchType - * @param observe set whether or not to return the data Observable as the body, response or events. defaults to returning the body. - * @param reportProgress flag to report request and response progress. - */ - public getTrendApiInseServiceUniversityRankingsTrendGet( - topics: Array, - keywords?: Array, - fuzzy?: boolean, - institutions?: Array, - countries?: Array, - regions?: Array, - authors?: Array, - searchType?: TrendSearchType, - observe?: 'body', - reportProgress?: boolean, - options?: { - httpHeaderAccept?: 'application/json'; - context?: HttpContext; - transferCache?: boolean; - }, - ): Observable; - public getTrendApiInseServiceUniversityRankingsTrendGet( - topics: Array, - keywords?: Array, - fuzzy?: boolean, - institutions?: Array, - countries?: Array, - regions?: Array, - authors?: Array, - searchType?: TrendSearchType, - observe?: 'response', - reportProgress?: boolean, - options?: { - httpHeaderAccept?: 'application/json'; - context?: HttpContext; - transferCache?: boolean; - }, - ): Observable>; - public getTrendApiInseServiceUniversityRankingsTrendGet( - topics: Array, - keywords?: Array, - fuzzy?: boolean, - institutions?: Array, - countries?: Array, - regions?: Array, - authors?: Array, - searchType?: TrendSearchType, - observe?: 'events', - reportProgress?: boolean, - options?: { - httpHeaderAccept?: 'application/json'; - context?: HttpContext; - transferCache?: boolean; - }, - ): Observable>; - public getTrendApiInseServiceUniversityRankingsTrendGet( - topics: Array, - keywords?: Array, - fuzzy?: boolean, - institutions?: Array, - countries?: Array, - regions?: Array, - authors?: Array, - searchType?: TrendSearchType, - observe: any = 'body', - reportProgress: boolean = false, - options?: { - httpHeaderAccept?: 'application/json'; - context?: HttpContext; - transferCache?: boolean; - }, - ): Observable { - if (topics === null || topics === undefined) { - throw new Error( - 'Required parameter topics was null or undefined when calling getTrendApiInseServiceUniversityRankingsTrendGet.', - ); - } - - let localVarQueryParameters = new HttpParams({ encoder: this.encoder }); - if (topics) { - topics.forEach((element) => { - localVarQueryParameters = this.addToHttpParams( - localVarQueryParameters, - element, - 'topics', + let localVarPath = `/api/inse-service/university-rankings/autocomplete-locations`; + const { basePath, withCredentials } = this.configuration; + return this.httpClient.request>('get', `${basePath}${localVarPath}`, + { + context: localVarHttpContext, + params: localVarQueryParameters, + responseType: responseType_, + ...(withCredentials ? { withCredentials } : {}), + headers: localVarHeaders, + observe: observe, + ...(localVarTransferCache !== undefined ? { transferCache: localVarTransferCache } : {}), + reportProgress: reportProgress + } ); - }); } - if (keywords) { - keywords.forEach((element) => { - localVarQueryParameters = this.addToHttpParams( - localVarQueryParameters, - element, - 'keywords', + + /** + * Returns data for the University Ranking Dashboard. + * @endpoint get /api/inse-service/university-rankings + * @param topic Research topic display name or OpenAlex ID (e.g., \'Artificial Intelligence\') + * @param metric Metric to rank by + * @param observe set whether or not to return the data Observable as the body, response or events. defaults to returning the body. + * @param reportProgress flag to report request and response progress. + */ + public getRankingsApiInseServiceUniversityRankingsGet(topic: string, metric?: 'publications' | 'citations', observe?: 'body', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable; + public getRankingsApiInseServiceUniversityRankingsGet(topic: string, metric?: 'publications' | 'citations', observe?: 'response', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable>; + public getRankingsApiInseServiceUniversityRankingsGet(topic: string, metric?: 'publications' | 'citations', observe?: 'events', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable>; + public getRankingsApiInseServiceUniversityRankingsGet(topic: string, metric?: 'publications' | 'citations', observe: any = 'body', reportProgress: boolean = false, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable { + if (topic === null || topic === undefined) { + throw new Error('Required parameter topic was null or undefined when calling getRankingsApiInseServiceUniversityRankingsGet.'); + } + + let localVarQueryParameters = new HttpParams({encoder: this.encoder}); + localVarQueryParameters = this.addToHttpParams(localVarQueryParameters, + topic, 'topic'); + localVarQueryParameters = this.addToHttpParams(localVarQueryParameters, + metric, 'metric'); + + let localVarHeaders = this.defaultHeaders; + + const localVarHttpHeaderAcceptSelected: string | undefined = options?.httpHeaderAccept ?? this.configuration.selectHeaderAccept([ + 'application/json' + ]); + if (localVarHttpHeaderAcceptSelected !== undefined) { + localVarHeaders = localVarHeaders.set('Accept', localVarHttpHeaderAcceptSelected); + } + + const localVarHttpContext: HttpContext = options?.context ?? new HttpContext(); + + const localVarTransferCache: boolean = options?.transferCache ?? true; + + + let responseType_: 'text' | 'json' | 'blob' = 'json'; + if (localVarHttpHeaderAcceptSelected) { + if (localVarHttpHeaderAcceptSelected.startsWith('text')) { + responseType_ = 'text'; + } else if (this.configuration.isJsonMime(localVarHttpHeaderAcceptSelected)) { + responseType_ = 'json'; + } else { + responseType_ = 'blob'; + } + } + + let localVarPath = `/api/inse-service/university-rankings`; + const { basePath, withCredentials } = this.configuration; + return this.httpClient.request('get', `${basePath}${localVarPath}`, + { + context: localVarHttpContext, + params: localVarQueryParameters, + responseType: responseType_, + ...(withCredentials ? { withCredentials } : {}), + headers: localVarHeaders, + observe: observe, + ...(localVarTransferCache !== undefined ? { transferCache: localVarTransferCache } : {}), + reportProgress: reportProgress + } ); - }); } - localVarQueryParameters = this.addToHttpParams( - localVarQueryParameters, - fuzzy, - 'fuzzy', - ); - if (institutions) { - institutions.forEach((element) => { - localVarQueryParameters = this.addToHttpParams( - localVarQueryParameters, - element, - 'institutions', + + /** + * Returns top institutions filtered by country/region and sorted by topic-level publications count. + * @endpoint get /api/inse-service/university-rankings/top-institutions + * @param topic Research topic + * @param region Region identifier (e.g. EU) + * @param country Country code (e.g. DE) + * @param limit Max suggestions to return + * @param observe set whether or not to return the data Observable as the body, response or events. defaults to returning the body. + * @param reportProgress flag to report request and response progress. + */ + public getTopInstitutionsApiInseServiceUniversityRankingsTopInstitutionsGet(topic: string, region?: string, country?: string, limit?: number, observe?: 'body', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable>; + public getTopInstitutionsApiInseServiceUniversityRankingsTopInstitutionsGet(topic: string, region?: string, country?: string, limit?: number, observe?: 'response', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable>>; + public getTopInstitutionsApiInseServiceUniversityRankingsTopInstitutionsGet(topic: string, region?: string, country?: string, limit?: number, observe?: 'events', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable>>; + public getTopInstitutionsApiInseServiceUniversityRankingsTopInstitutionsGet(topic: string, region?: string, country?: string, limit?: number, observe: any = 'body', reportProgress: boolean = false, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable { + if (topic === null || topic === undefined) { + throw new Error('Required parameter topic was null or undefined when calling getTopInstitutionsApiInseServiceUniversityRankingsTopInstitutionsGet.'); + } + + let localVarQueryParameters = new HttpParams({encoder: this.encoder}); + localVarQueryParameters = this.addToHttpParams(localVarQueryParameters, + topic, 'topic'); + localVarQueryParameters = this.addToHttpParams(localVarQueryParameters, + region, 'region'); + localVarQueryParameters = this.addToHttpParams(localVarQueryParameters, + country, 'country'); + localVarQueryParameters = this.addToHttpParams(localVarQueryParameters, + limit, 'limit'); + + let localVarHeaders = this.defaultHeaders; + + const localVarHttpHeaderAcceptSelected: string | undefined = options?.httpHeaderAccept ?? this.configuration.selectHeaderAccept([ + 'application/json' + ]); + if (localVarHttpHeaderAcceptSelected !== undefined) { + localVarHeaders = localVarHeaders.set('Accept', localVarHttpHeaderAcceptSelected); + } + + const localVarHttpContext: HttpContext = options?.context ?? new HttpContext(); + + const localVarTransferCache: boolean = options?.transferCache ?? true; + + + let responseType_: 'text' | 'json' | 'blob' = 'json'; + if (localVarHttpHeaderAcceptSelected) { + if (localVarHttpHeaderAcceptSelected.startsWith('text')) { + responseType_ = 'text'; + } else if (this.configuration.isJsonMime(localVarHttpHeaderAcceptSelected)) { + responseType_ = 'json'; + } else { + responseType_ = 'blob'; + } + } + + let localVarPath = `/api/inse-service/university-rankings/top-institutions`; + const { basePath, withCredentials } = this.configuration; + return this.httpClient.request>('get', `${basePath}${localVarPath}`, + { + context: localVarHttpContext, + params: localVarQueryParameters, + responseType: responseType_, + ...(withCredentials ? { withCredentials } : {}), + headers: localVarHeaders, + observe: observe, + ...(localVarTransferCache !== undefined ? { transferCache: localVarTransferCache } : {}), + reportProgress: reportProgress + } ); - }); } - if (countries) { - countries.forEach((element) => { - localVarQueryParameters = this.addToHttpParams( - localVarQueryParameters, - element, - 'countries', + + /** + * Returns top 10 research topics for a selected entity. + * @endpoint get /api/inse-service/university-rankings/top-topics + * @param entityId Entity ID + * @param entityType Entity type: institution, author, country, region + * @param startYear Start year + * @param endYear End year + * @param searchType Search strategy type + * @param observe set whether or not to return the data Observable as the body, response or events. defaults to returning the body. + * @param reportProgress flag to report request and response progress. + */ + public getTopTopicsApiInseServiceUniversityRankingsTopTopicsGet(entityId: string, entityType: string, startYear?: number, endYear?: number, searchType?: string, observe?: 'body', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable; + public getTopTopicsApiInseServiceUniversityRankingsTopTopicsGet(entityId: string, entityType: string, startYear?: number, endYear?: number, searchType?: string, observe?: 'response', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable>; + public getTopTopicsApiInseServiceUniversityRankingsTopTopicsGet(entityId: string, entityType: string, startYear?: number, endYear?: number, searchType?: string, observe?: 'events', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable>; + public getTopTopicsApiInseServiceUniversityRankingsTopTopicsGet(entityId: string, entityType: string, startYear?: number, endYear?: number, searchType?: string, observe: any = 'body', reportProgress: boolean = false, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable { + if (entityId === null || entityId === undefined) { + throw new Error('Required parameter entityId was null or undefined when calling getTopTopicsApiInseServiceUniversityRankingsTopTopicsGet.'); + } + if (entityType === null || entityType === undefined) { + throw new Error('Required parameter entityType was null or undefined when calling getTopTopicsApiInseServiceUniversityRankingsTopTopicsGet.'); + } + + let localVarQueryParameters = new HttpParams({encoder: this.encoder}); + localVarQueryParameters = this.addToHttpParams(localVarQueryParameters, + entityId, 'entity_id'); + localVarQueryParameters = this.addToHttpParams(localVarQueryParameters, + entityType, 'entity_type'); + localVarQueryParameters = this.addToHttpParams(localVarQueryParameters, + startYear, 'start_year'); + localVarQueryParameters = this.addToHttpParams(localVarQueryParameters, + endYear, 'end_year'); + localVarQueryParameters = this.addToHttpParams(localVarQueryParameters, + searchType, 'search_type'); + + let localVarHeaders = this.defaultHeaders; + + const localVarHttpHeaderAcceptSelected: string | undefined = options?.httpHeaderAccept ?? this.configuration.selectHeaderAccept([ + 'application/json' + ]); + if (localVarHttpHeaderAcceptSelected !== undefined) { + localVarHeaders = localVarHeaders.set('Accept', localVarHttpHeaderAcceptSelected); + } + + const localVarHttpContext: HttpContext = options?.context ?? new HttpContext(); + + const localVarTransferCache: boolean = options?.transferCache ?? true; + + + let responseType_: 'text' | 'json' | 'blob' = 'json'; + if (localVarHttpHeaderAcceptSelected) { + if (localVarHttpHeaderAcceptSelected.startsWith('text')) { + responseType_ = 'text'; + } else if (this.configuration.isJsonMime(localVarHttpHeaderAcceptSelected)) { + responseType_ = 'json'; + } else { + responseType_ = 'blob'; + } + } + + let localVarPath = `/api/inse-service/university-rankings/top-topics`; + const { basePath, withCredentials } = this.configuration; + return this.httpClient.request('get', `${basePath}${localVarPath}`, + { + context: localVarHttpContext, + params: localVarQueryParameters, + responseType: responseType_, + ...(withCredentials ? { withCredentials } : {}), + headers: localVarHeaders, + observe: observe, + ...(localVarTransferCache !== undefined ? { transferCache: localVarTransferCache } : {}), + reportProgress: reportProgress + } ); - }); } - if (regions) { - regions.forEach((element) => { - localVarQueryParameters = this.addToHttpParams( - localVarQueryParameters, - element, - 'regions', + + /** + * Returns timeseries publication data for compared institutions, countries, and regions. + * @endpoint get /api/inse-service/university-rankings/trend + * @param topics List of topics to analyze + * @param keywords List of raw keywords corresponding to topics + * @param fuzzy True if using mapped topics, False if using raw keywords + * @param institutions List of OpenAlex Institution IDs + * @param countries List of country codes + * @param regions List of region identifiers + * @param authors List of OpenAlex Author IDs + * @param searchType + * @param observe set whether or not to return the data Observable as the body, response or events. defaults to returning the body. + * @param reportProgress flag to report request and response progress. + */ + public getTrendApiInseServiceUniversityRankingsTrendGet(topics: Array, keywords?: Array, fuzzy?: boolean, institutions?: Array, countries?: Array, regions?: Array, authors?: Array, searchType?: TrendSearchType, observe?: 'body', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable; + public getTrendApiInseServiceUniversityRankingsTrendGet(topics: Array, keywords?: Array, fuzzy?: boolean, institutions?: Array, countries?: Array, regions?: Array, authors?: Array, searchType?: TrendSearchType, observe?: 'response', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable>; + public getTrendApiInseServiceUniversityRankingsTrendGet(topics: Array, keywords?: Array, fuzzy?: boolean, institutions?: Array, countries?: Array, regions?: Array, authors?: Array, searchType?: TrendSearchType, observe?: 'events', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable>; + public getTrendApiInseServiceUniversityRankingsTrendGet(topics: Array, keywords?: Array, fuzzy?: boolean, institutions?: Array, countries?: Array, regions?: Array, authors?: Array, searchType?: TrendSearchType, observe: any = 'body', reportProgress: boolean = false, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable { + if (topics === null || topics === undefined) { + throw new Error('Required parameter topics was null or undefined when calling getTrendApiInseServiceUniversityRankingsTrendGet.'); + } + + let localVarQueryParameters = new HttpParams({encoder: this.encoder}); + if (topics) { + topics.forEach((element) => { + localVarQueryParameters = this.addToHttpParams(localVarQueryParameters, + element, 'topics'); + }) + } + if (keywords) { + keywords.forEach((element) => { + localVarQueryParameters = this.addToHttpParams(localVarQueryParameters, + element, 'keywords'); + }) + } + localVarQueryParameters = this.addToHttpParams(localVarQueryParameters, + fuzzy, 'fuzzy'); + if (institutions) { + institutions.forEach((element) => { + localVarQueryParameters = this.addToHttpParams(localVarQueryParameters, + element, 'institutions'); + }) + } + if (countries) { + countries.forEach((element) => { + localVarQueryParameters = this.addToHttpParams(localVarQueryParameters, + element, 'countries'); + }) + } + if (regions) { + regions.forEach((element) => { + localVarQueryParameters = this.addToHttpParams(localVarQueryParameters, + element, 'regions'); + }) + } + if (authors) { + authors.forEach((element) => { + localVarQueryParameters = this.addToHttpParams(localVarQueryParameters, + element, 'authors'); + }) + } + localVarQueryParameters = this.addToHttpParams(localVarQueryParameters, + searchType, 'search_type'); + + let localVarHeaders = this.defaultHeaders; + + const localVarHttpHeaderAcceptSelected: string | undefined = options?.httpHeaderAccept ?? this.configuration.selectHeaderAccept([ + 'application/json' + ]); + if (localVarHttpHeaderAcceptSelected !== undefined) { + localVarHeaders = localVarHeaders.set('Accept', localVarHttpHeaderAcceptSelected); + } + + const localVarHttpContext: HttpContext = options?.context ?? new HttpContext(); + + const localVarTransferCache: boolean = options?.transferCache ?? true; + + + let responseType_: 'text' | 'json' | 'blob' = 'json'; + if (localVarHttpHeaderAcceptSelected) { + if (localVarHttpHeaderAcceptSelected.startsWith('text')) { + responseType_ = 'text'; + } else if (this.configuration.isJsonMime(localVarHttpHeaderAcceptSelected)) { + responseType_ = 'json'; + } else { + responseType_ = 'blob'; + } + } + + let localVarPath = `/api/inse-service/university-rankings/trend`; + const { basePath, withCredentials } = this.configuration; + return this.httpClient.request('get', `${basePath}${localVarPath}`, + { + context: localVarHttpContext, + params: localVarQueryParameters, + responseType: responseType_, + ...(withCredentials ? { withCredentials } : {}), + headers: localVarHeaders, + observe: observe, + ...(localVarTransferCache !== undefined ? { transferCache: localVarTransferCache } : {}), + reportProgress: reportProgress + } ); - }); - } - if (authors) { - authors.forEach((element) => { - localVarQueryParameters = this.addToHttpParams( - localVarQueryParameters, - element, - 'authors', - ); - }); - } - localVarQueryParameters = this.addToHttpParams( - localVarQueryParameters, - searchType, - 'search_type', - ); - - let localVarHeaders = this.defaultHeaders; - - const localVarHttpHeaderAcceptSelected: string | undefined = - options?.httpHeaderAccept ?? - this.configuration.selectHeaderAccept(['application/json']); - if (localVarHttpHeaderAcceptSelected !== undefined) { - localVarHeaders = localVarHeaders.set( - 'Accept', - localVarHttpHeaderAcceptSelected, - ); } - const localVarHttpContext: HttpContext = - options?.context ?? new HttpContext(); - - const localVarTransferCache: boolean = options?.transferCache ?? true; - - let responseType_: 'text' | 'json' | 'blob' = 'json'; - if (localVarHttpHeaderAcceptSelected) { - if (localVarHttpHeaderAcceptSelected.startsWith('text')) { - responseType_ = 'text'; - } else if ( - this.configuration.isJsonMime(localVarHttpHeaderAcceptSelected) - ) { - responseType_ = 'json'; - } else { - responseType_ = 'blob'; - } - } - - let localVarPath = `/api/inse-service/university-rankings/trend`; - const { basePath, withCredentials } = this.configuration; - return this.httpClient.request( - 'get', - `${basePath}${localVarPath}`, - { - context: localVarHttpContext, - params: localVarQueryParameters, - responseType: responseType_, - ...(withCredentials ? { withCredentials } : {}), - headers: localVarHeaders, - observe: observe, - ...(localVarTransferCache !== undefined - ? { transferCache: localVarTransferCache } - : {}), - reportProgress: reportProgress, - }, - ); - } } diff --git a/webapp/src/app/api/api/works.service.ts b/webapp/src/app/api/api/works.service.ts index 04abc649..186ae663 100644 --- a/webapp/src/app/api/api/works.service.ts +++ b/webapp/src/app/api/api/works.service.ts @@ -1,7 +1,7 @@ /** * Innovation Search Engine API * - * + * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech @@ -9,701 +9,380 @@ */ /* tslint:disable:no-unused-variable member-ordering */ -import { Inject, Injectable, Optional } from '@angular/core'; -import { - HttpClient, - HttpHeaders, - HttpParams, - HttpResponse, - HttpEvent, - HttpParameterCodec, - HttpContext, -} from '@angular/common/http'; -import { CustomHttpParameterCodec } from '../encoder'; -import { Observable } from 'rxjs'; +import { Inject, Injectable, Optional } from '@angular/core'; +import { HttpClient, HttpHeaders, HttpParams, + HttpResponse, HttpEvent, HttpParameterCodec, HttpContext + } from '@angular/common/http'; +import { CustomHttpParameterCodec } from '../encoder'; +import { Observable } from 'rxjs'; // @ts-ignore import { HTTPValidationError } from '../model/hTTPValidationError'; // @ts-ignore -import { InseModelsOpenalexWorkPageWorkPage } from '../model/inseModelsOpenalexWorkPageWorkPage'; -// @ts-ignore import { TopicCount } from '../model/topicCount'; // @ts-ignore import { TopicsByTime } from '../model/topicsByTime'; // @ts-ignore import { Work } from '../model/work'; // @ts-ignore +import { WorkPage } from '../model/workPage'; +// @ts-ignore import { WorksListResponse } from '../model/worksListResponse'; // @ts-ignore -import { BASE_PATH, COLLECTION_FORMATS } from '../variables'; -import { Configuration } from '../configuration'; +import { BASE_PATH, COLLECTION_FORMATS } from '../variables'; +import { Configuration } from '../configuration'; import { BaseService } from '../api.base.service'; + + @Injectable({ - providedIn: 'root', + providedIn: 'root' }) export class WorksService extends BaseService { - constructor( - protected httpClient: HttpClient, - @Optional() @Inject(BASE_PATH) basePath: string | string[], - @Optional() configuration?: Configuration, - ) { - super(basePath, configuration); - } - /** - * Returns all works for an author. - * @endpoint get /api/works/{author_id}/all - * @param authorId The author id, for example A5023888391. - * @param observe set whether or not to return the data Observable as the body, response or events. defaults to returning the body. - * @param reportProgress flag to report request and response progress. - */ - public getAllAuthorWorks( - authorId: string, - observe?: 'body', - reportProgress?: boolean, - options?: { - httpHeaderAccept?: 'application/json'; - context?: HttpContext; - transferCache?: boolean; - }, - ): Observable; - public getAllAuthorWorks( - authorId: string, - observe?: 'response', - reportProgress?: boolean, - options?: { - httpHeaderAccept?: 'application/json'; - context?: HttpContext; - transferCache?: boolean; - }, - ): Observable>; - public getAllAuthorWorks( - authorId: string, - observe?: 'events', - reportProgress?: boolean, - options?: { - httpHeaderAccept?: 'application/json'; - context?: HttpContext; - transferCache?: boolean; - }, - ): Observable>; - public getAllAuthorWorks( - authorId: string, - observe: any = 'body', - reportProgress: boolean = false, - options?: { - httpHeaderAccept?: 'application/json'; - context?: HttpContext; - transferCache?: boolean; - }, - ): Observable { - if (authorId === null || authorId === undefined) { - throw new Error( - 'Required parameter authorId was null or undefined when calling getAllAuthorWorks.', - ); + constructor(protected httpClient: HttpClient, @Optional() @Inject(BASE_PATH) basePath: string|string[], @Optional() configuration?: Configuration) { + super(basePath, configuration); } - let localVarHeaders = this.defaultHeaders; + /** + * Returns all works for an author. + * @endpoint get /api/works/{author_id}/all + * @param authorId The author id, for example A5023888391. + * @param observe set whether or not to return the data Observable as the body, response or events. defaults to returning the body. + * @param reportProgress flag to report request and response progress. + */ + public getAllAuthorWorks(authorId: string, observe?: 'body', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable; + public getAllAuthorWorks(authorId: string, observe?: 'response', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable>; + public getAllAuthorWorks(authorId: string, observe?: 'events', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable>; + public getAllAuthorWorks(authorId: string, observe: any = 'body', reportProgress: boolean = false, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable { + if (authorId === null || authorId === undefined) { + throw new Error('Required parameter authorId was null or undefined when calling getAllAuthorWorks.'); + } - const localVarHttpHeaderAcceptSelected: string | undefined = - options?.httpHeaderAccept ?? - this.configuration.selectHeaderAccept(['application/json']); - if (localVarHttpHeaderAcceptSelected !== undefined) { - localVarHeaders = localVarHeaders.set( - 'Accept', - localVarHttpHeaderAcceptSelected, - ); - } + let localVarHeaders = this.defaultHeaders; - const localVarHttpContext: HttpContext = - options?.context ?? new HttpContext(); + const localVarHttpHeaderAcceptSelected: string | undefined = options?.httpHeaderAccept ?? this.configuration.selectHeaderAccept([ + 'application/json' + ]); + if (localVarHttpHeaderAcceptSelected !== undefined) { + localVarHeaders = localVarHeaders.set('Accept', localVarHttpHeaderAcceptSelected); + } - const localVarTransferCache: boolean = options?.transferCache ?? true; + const localVarHttpContext: HttpContext = options?.context ?? new HttpContext(); - let responseType_: 'text' | 'json' | 'blob' = 'json'; - if (localVarHttpHeaderAcceptSelected) { - if (localVarHttpHeaderAcceptSelected.startsWith('text')) { - responseType_ = 'text'; - } else if ( - this.configuration.isJsonMime(localVarHttpHeaderAcceptSelected) - ) { - responseType_ = 'json'; - } else { - responseType_ = 'blob'; - } - } + const localVarTransferCache: boolean = options?.transferCache ?? true; - let localVarPath = `/api/works/${this.configuration.encodeParam({ name: 'authorId', value: authorId, in: 'path', style: 'simple', explode: false, dataType: 'string', dataFormat: undefined })}/all`; - const { basePath, withCredentials } = this.configuration; - return this.httpClient.request( - 'get', - `${basePath}${localVarPath}`, - { - context: localVarHttpContext, - responseType: responseType_, - ...(withCredentials ? { withCredentials } : {}), - headers: localVarHeaders, - observe: observe, - ...(localVarTransferCache !== undefined - ? { transferCache: localVarTransferCache } - : {}), - reportProgress: reportProgress, - }, - ); - } - /** - * Returns a page of works for an author. - * @endpoint get /api/works/{author_id} - * @param authorId The author id, for example A5023888391. - * @param page The page number. - * @param size The page size. - * @param publicationYear Filter by publication year. Can be repeated. - * @param type Filter by publication type. Can be repeated. - * @param language Filter by language code. Can be repeated. - * @param institutionId Filter by OpenAlex institution id. Can be repeated. - * @param topicId Filter by OpenAlex topic id. Can be repeated. - * @param sort Sort order: by publication year or by citation count. - * @param observe set whether or not to return the data Observable as the body, response or events. defaults to returning the body. - * @param reportProgress flag to report request and response progress. - */ - public getAuthorWorks( - authorId: string, - page?: number, - size?: number, - publicationYear?: Array, - type?: Array, - language?: Array, - institutionId?: Array, - topicId?: Array, - sort?: 'year' | 'citations', - observe?: 'body', - reportProgress?: boolean, - options?: { - httpHeaderAccept?: 'application/json'; - context?: HttpContext; - transferCache?: boolean; - }, - ): Observable; - public getAuthorWorks( - authorId: string, - page?: number, - size?: number, - publicationYear?: Array, - type?: Array, - language?: Array, - institutionId?: Array, - topicId?: Array, - sort?: 'year' | 'citations', - observe?: 'response', - reportProgress?: boolean, - options?: { - httpHeaderAccept?: 'application/json'; - context?: HttpContext; - transferCache?: boolean; - }, - ): Observable>; - public getAuthorWorks( - authorId: string, - page?: number, - size?: number, - publicationYear?: Array, - type?: Array, - language?: Array, - institutionId?: Array, - topicId?: Array, - sort?: 'year' | 'citations', - observe?: 'events', - reportProgress?: boolean, - options?: { - httpHeaderAccept?: 'application/json'; - context?: HttpContext; - transferCache?: boolean; - }, - ): Observable>; - public getAuthorWorks( - authorId: string, - page?: number, - size?: number, - publicationYear?: Array, - type?: Array, - language?: Array, - institutionId?: Array, - topicId?: Array, - sort?: 'year' | 'citations', - observe: any = 'body', - reportProgress: boolean = false, - options?: { - httpHeaderAccept?: 'application/json'; - context?: HttpContext; - transferCache?: boolean; - }, - ): Observable { - if (authorId === null || authorId === undefined) { - throw new Error( - 'Required parameter authorId was null or undefined when calling getAuthorWorks.', - ); - } + let responseType_: 'text' | 'json' | 'blob' = 'json'; + if (localVarHttpHeaderAcceptSelected) { + if (localVarHttpHeaderAcceptSelected.startsWith('text')) { + responseType_ = 'text'; + } else if (this.configuration.isJsonMime(localVarHttpHeaderAcceptSelected)) { + responseType_ = 'json'; + } else { + responseType_ = 'blob'; + } + } - let localVarQueryParameters = new HttpParams({ encoder: this.encoder }); - localVarQueryParameters = this.addToHttpParams( - localVarQueryParameters, - page, - 'page', - ); - localVarQueryParameters = this.addToHttpParams( - localVarQueryParameters, - size, - 'size', - ); - if (publicationYear) { - publicationYear.forEach((element) => { - localVarQueryParameters = this.addToHttpParams( - localVarQueryParameters, - element, - 'publication_year', + let localVarPath = `/api/works/${this.configuration.encodeParam({name: "authorId", value: authorId, in: "path", style: "simple", explode: false, dataType: "string", dataFormat: undefined})}/all`; + const { basePath, withCredentials } = this.configuration; + return this.httpClient.request('get', `${basePath}${localVarPath}`, + { + context: localVarHttpContext, + responseType: responseType_, + ...(withCredentials ? { withCredentials } : {}), + headers: localVarHeaders, + observe: observe, + ...(localVarTransferCache !== undefined ? { transferCache: localVarTransferCache } : {}), + reportProgress: reportProgress + } ); - }); } - if (type) { - type.forEach((element) => { - localVarQueryParameters = this.addToHttpParams( - localVarQueryParameters, - element, - 'type', + + /** + * Returns a page of works for an author. + * @endpoint get /api/works/{author_id} + * @param authorId The author id, for example A5023888391. + * @param page The page number. + * @param size The page size. + * @param publicationYear Filter by publication year. Can be repeated. + * @param type Filter by publication type. Can be repeated. + * @param language Filter by language code. Can be repeated. + * @param institutionId Filter by OpenAlex institution id. Can be repeated. + * @param topicId Filter by OpenAlex topic id. Can be repeated. + * @param sort Sort order: by publication year or by citation count. + * @param observe set whether or not to return the data Observable as the body, response or events. defaults to returning the body. + * @param reportProgress flag to report request and response progress. + */ + public getAuthorWorks(authorId: string, page?: number, size?: number, publicationYear?: Array, type?: Array, language?: Array, institutionId?: Array, topicId?: Array, sort?: 'year' | 'citations', observe?: 'body', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable; + public getAuthorWorks(authorId: string, page?: number, size?: number, publicationYear?: Array, type?: Array, language?: Array, institutionId?: Array, topicId?: Array, sort?: 'year' | 'citations', observe?: 'response', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable>; + public getAuthorWorks(authorId: string, page?: number, size?: number, publicationYear?: Array, type?: Array, language?: Array, institutionId?: Array, topicId?: Array, sort?: 'year' | 'citations', observe?: 'events', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable>; + public getAuthorWorks(authorId: string, page?: number, size?: number, publicationYear?: Array, type?: Array, language?: Array, institutionId?: Array, topicId?: Array, sort?: 'year' | 'citations', observe: any = 'body', reportProgress: boolean = false, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable { + if (authorId === null || authorId === undefined) { + throw new Error('Required parameter authorId was null or undefined when calling getAuthorWorks.'); + } + + let localVarQueryParameters = new HttpParams({encoder: this.encoder}); + localVarQueryParameters = this.addToHttpParams(localVarQueryParameters, + page, 'page'); + localVarQueryParameters = this.addToHttpParams(localVarQueryParameters, + size, 'size'); + if (publicationYear) { + publicationYear.forEach((element) => { + localVarQueryParameters = this.addToHttpParams(localVarQueryParameters, + element, 'publication_year'); + }) + } + if (type) { + type.forEach((element) => { + localVarQueryParameters = this.addToHttpParams(localVarQueryParameters, + element, 'type'); + }) + } + if (language) { + language.forEach((element) => { + localVarQueryParameters = this.addToHttpParams(localVarQueryParameters, + element, 'language'); + }) + } + if (institutionId) { + institutionId.forEach((element) => { + localVarQueryParameters = this.addToHttpParams(localVarQueryParameters, + element, 'institution_id'); + }) + } + if (topicId) { + topicId.forEach((element) => { + localVarQueryParameters = this.addToHttpParams(localVarQueryParameters, + element, 'topic_id'); + }) + } + localVarQueryParameters = this.addToHttpParams(localVarQueryParameters, + sort, 'sort'); + + let localVarHeaders = this.defaultHeaders; + + const localVarHttpHeaderAcceptSelected: string | undefined = options?.httpHeaderAccept ?? this.configuration.selectHeaderAccept([ + 'application/json' + ]); + if (localVarHttpHeaderAcceptSelected !== undefined) { + localVarHeaders = localVarHeaders.set('Accept', localVarHttpHeaderAcceptSelected); + } + + const localVarHttpContext: HttpContext = options?.context ?? new HttpContext(); + + const localVarTransferCache: boolean = options?.transferCache ?? true; + + + let responseType_: 'text' | 'json' | 'blob' = 'json'; + if (localVarHttpHeaderAcceptSelected) { + if (localVarHttpHeaderAcceptSelected.startsWith('text')) { + responseType_ = 'text'; + } else if (this.configuration.isJsonMime(localVarHttpHeaderAcceptSelected)) { + responseType_ = 'json'; + } else { + responseType_ = 'blob'; + } + } + + let localVarPath = `/api/works/${this.configuration.encodeParam({name: "authorId", value: authorId, in: "path", style: "simple", explode: false, dataType: "string", dataFormat: undefined})}`; + const { basePath, withCredentials } = this.configuration; + return this.httpClient.request('get', `${basePath}${localVarPath}`, + { + context: localVarHttpContext, + params: localVarQueryParameters, + responseType: responseType_, + ...(withCredentials ? { withCredentials } : {}), + headers: localVarHeaders, + observe: observe, + ...(localVarTransferCache !== undefined ? { transferCache: localVarTransferCache } : {}), + reportProgress: reportProgress + } ); - }); } - if (language) { - language.forEach((element) => { - localVarQueryParameters = this.addToHttpParams( - localVarQueryParameters, - element, - 'language', + + /** + * Returns work counts per primary topic for an author. + * @endpoint get /api/works/{author_id}/primary-topic-counts + * @param authorId The author id, for example A5023888391. + * @param observe set whether or not to return the data Observable as the body, response or events. defaults to returning the body. + * @param reportProgress flag to report request and response progress. + */ + public getPrimaryTopicCountsByAuthor(authorId: string, observe?: 'body', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable>; + public getPrimaryTopicCountsByAuthor(authorId: string, observe?: 'response', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable>>; + public getPrimaryTopicCountsByAuthor(authorId: string, observe?: 'events', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable>>; + public getPrimaryTopicCountsByAuthor(authorId: string, observe: any = 'body', reportProgress: boolean = false, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable { + if (authorId === null || authorId === undefined) { + throw new Error('Required parameter authorId was null or undefined when calling getPrimaryTopicCountsByAuthor.'); + } + + let localVarHeaders = this.defaultHeaders; + + const localVarHttpHeaderAcceptSelected: string | undefined = options?.httpHeaderAccept ?? this.configuration.selectHeaderAccept([ + 'application/json' + ]); + if (localVarHttpHeaderAcceptSelected !== undefined) { + localVarHeaders = localVarHeaders.set('Accept', localVarHttpHeaderAcceptSelected); + } + + const localVarHttpContext: HttpContext = options?.context ?? new HttpContext(); + + const localVarTransferCache: boolean = options?.transferCache ?? true; + + + let responseType_: 'text' | 'json' | 'blob' = 'json'; + if (localVarHttpHeaderAcceptSelected) { + if (localVarHttpHeaderAcceptSelected.startsWith('text')) { + responseType_ = 'text'; + } else if (this.configuration.isJsonMime(localVarHttpHeaderAcceptSelected)) { + responseType_ = 'json'; + } else { + responseType_ = 'blob'; + } + } + + let localVarPath = `/api/works/${this.configuration.encodeParam({name: "authorId", value: authorId, in: "path", style: "simple", explode: false, dataType: "string", dataFormat: undefined})}/primary-topic-counts`; + const { basePath, withCredentials } = this.configuration; + return this.httpClient.request>('get', `${basePath}${localVarPath}`, + { + context: localVarHttpContext, + responseType: responseType_, + ...(withCredentials ? { withCredentials } : {}), + headers: localVarHeaders, + observe: observe, + ...(localVarTransferCache !== undefined ? { transferCache: localVarTransferCache } : {}), + reportProgress: reportProgress + } ); - }); } - if (institutionId) { - institutionId.forEach((element) => { - localVarQueryParameters = this.addToHttpParams( - localVarQueryParameters, - element, - 'institution_id', + + /** + * Returns topics grouped by publication year for an author. + * @endpoint get /api/works/{author_id}/topics-by-time + * @param authorId The author id, for example A5023888391. + * @param maxTopicsPerYear The maximum number of topics per year. + * @param targetPublications Target number of publications used for the timeline. Complete years are always included. + * @param includeAll If true, all publications are used for the timeline. + * @param observe set whether or not to return the data Observable as the body, response or events. defaults to returning the body. + * @param reportProgress flag to report request and response progress. + */ + public getTopicsByTimeByAuthor(authorId: string, maxTopicsPerYear?: number, targetPublications?: number, includeAll?: boolean, observe?: 'body', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable; + public getTopicsByTimeByAuthor(authorId: string, maxTopicsPerYear?: number, targetPublications?: number, includeAll?: boolean, observe?: 'response', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable>; + public getTopicsByTimeByAuthor(authorId: string, maxTopicsPerYear?: number, targetPublications?: number, includeAll?: boolean, observe?: 'events', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable>; + public getTopicsByTimeByAuthor(authorId: string, maxTopicsPerYear?: number, targetPublications?: number, includeAll?: boolean, observe: any = 'body', reportProgress: boolean = false, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable { + if (authorId === null || authorId === undefined) { + throw new Error('Required parameter authorId was null or undefined when calling getTopicsByTimeByAuthor.'); + } + + let localVarQueryParameters = new HttpParams({encoder: this.encoder}); + localVarQueryParameters = this.addToHttpParams(localVarQueryParameters, + maxTopicsPerYear, 'max_topics_per_year'); + localVarQueryParameters = this.addToHttpParams(localVarQueryParameters, + targetPublications, 'target_publications'); + localVarQueryParameters = this.addToHttpParams(localVarQueryParameters, + includeAll, 'include_all'); + + let localVarHeaders = this.defaultHeaders; + + const localVarHttpHeaderAcceptSelected: string | undefined = options?.httpHeaderAccept ?? this.configuration.selectHeaderAccept([ + 'application/json' + ]); + if (localVarHttpHeaderAcceptSelected !== undefined) { + localVarHeaders = localVarHeaders.set('Accept', localVarHttpHeaderAcceptSelected); + } + + const localVarHttpContext: HttpContext = options?.context ?? new HttpContext(); + + const localVarTransferCache: boolean = options?.transferCache ?? true; + + + let responseType_: 'text' | 'json' | 'blob' = 'json'; + if (localVarHttpHeaderAcceptSelected) { + if (localVarHttpHeaderAcceptSelected.startsWith('text')) { + responseType_ = 'text'; + } else if (this.configuration.isJsonMime(localVarHttpHeaderAcceptSelected)) { + responseType_ = 'json'; + } else { + responseType_ = 'blob'; + } + } + + let localVarPath = `/api/works/${this.configuration.encodeParam({name: "authorId", value: authorId, in: "path", style: "simple", explode: false, dataType: "string", dataFormat: undefined})}/topics-by-time`; + const { basePath, withCredentials } = this.configuration; + return this.httpClient.request('get', `${basePath}${localVarPath}`, + { + context: localVarHttpContext, + params: localVarQueryParameters, + responseType: responseType_, + ...(withCredentials ? { withCredentials } : {}), + headers: localVarHeaders, + observe: observe, + ...(localVarTransferCache !== undefined ? { transferCache: localVarTransferCache } : {}), + reportProgress: reportProgress + } ); - }); } - if (topicId) { - topicId.forEach((element) => { - localVarQueryParameters = this.addToHttpParams( - localVarQueryParameters, - element, - 'topic_id', + + /** + * Returns one publication by OpenAlex ID or DOI. + * @endpoint get /api/works/detail/{identifier} + * @param identifier The OpenAlex work id (e.g., W2741809807) or DOI number of the publication. + * @param title Do we want to fallback to title search if ID and DOI dont work? + * @param observe set whether or not to return the data Observable as the body, response or events. defaults to returning the body. + * @param reportProgress flag to report request and response progress. + */ + public getWork(identifier: string, title?: string, observe?: 'body', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable; + public getWork(identifier: string, title?: string, observe?: 'response', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable>; + public getWork(identifier: string, title?: string, observe?: 'events', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable>; + public getWork(identifier: string, title?: string, observe: any = 'body', reportProgress: boolean = false, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable { + if (identifier === null || identifier === undefined) { + throw new Error('Required parameter identifier was null or undefined when calling getWork.'); + } + + let localVarQueryParameters = new HttpParams({encoder: this.encoder}); + localVarQueryParameters = this.addToHttpParams(localVarQueryParameters, + title, 'title'); + + let localVarHeaders = this.defaultHeaders; + + const localVarHttpHeaderAcceptSelected: string | undefined = options?.httpHeaderAccept ?? this.configuration.selectHeaderAccept([ + 'application/json' + ]); + if (localVarHttpHeaderAcceptSelected !== undefined) { + localVarHeaders = localVarHeaders.set('Accept', localVarHttpHeaderAcceptSelected); + } + + const localVarHttpContext: HttpContext = options?.context ?? new HttpContext(); + + const localVarTransferCache: boolean = options?.transferCache ?? true; + + + let responseType_: 'text' | 'json' | 'blob' = 'json'; + if (localVarHttpHeaderAcceptSelected) { + if (localVarHttpHeaderAcceptSelected.startsWith('text')) { + responseType_ = 'text'; + } else if (this.configuration.isJsonMime(localVarHttpHeaderAcceptSelected)) { + responseType_ = 'json'; + } else { + responseType_ = 'blob'; + } + } + + let localVarPath = `/api/works/detail/${this.configuration.encodeParam({name: "identifier", value: identifier, in: "path", style: "simple", explode: false, dataType: "string", dataFormat: undefined})}`; + const { basePath, withCredentials } = this.configuration; + return this.httpClient.request('get', `${basePath}${localVarPath}`, + { + context: localVarHttpContext, + params: localVarQueryParameters, + responseType: responseType_, + ...(withCredentials ? { withCredentials } : {}), + headers: localVarHeaders, + observe: observe, + ...(localVarTransferCache !== undefined ? { transferCache: localVarTransferCache } : {}), + reportProgress: reportProgress + } ); - }); - } - localVarQueryParameters = this.addToHttpParams( - localVarQueryParameters, - sort, - 'sort', - ); - - let localVarHeaders = this.defaultHeaders; - - const localVarHttpHeaderAcceptSelected: string | undefined = - options?.httpHeaderAccept ?? - this.configuration.selectHeaderAccept(['application/json']); - if (localVarHttpHeaderAcceptSelected !== undefined) { - localVarHeaders = localVarHeaders.set( - 'Accept', - localVarHttpHeaderAcceptSelected, - ); } - const localVarHttpContext: HttpContext = - options?.context ?? new HttpContext(); - - const localVarTransferCache: boolean = options?.transferCache ?? true; - - let responseType_: 'text' | 'json' | 'blob' = 'json'; - if (localVarHttpHeaderAcceptSelected) { - if (localVarHttpHeaderAcceptSelected.startsWith('text')) { - responseType_ = 'text'; - } else if ( - this.configuration.isJsonMime(localVarHttpHeaderAcceptSelected) - ) { - responseType_ = 'json'; - } else { - responseType_ = 'blob'; - } - } - - let localVarPath = `/api/works/${this.configuration.encodeParam({ name: 'authorId', value: authorId, in: 'path', style: 'simple', explode: false, dataType: 'string', dataFormat: undefined })}`; - const { basePath, withCredentials } = this.configuration; - return this.httpClient.request( - 'get', - `${basePath}${localVarPath}`, - { - context: localVarHttpContext, - params: localVarQueryParameters, - responseType: responseType_, - ...(withCredentials ? { withCredentials } : {}), - headers: localVarHeaders, - observe: observe, - ...(localVarTransferCache !== undefined - ? { transferCache: localVarTransferCache } - : {}), - reportProgress: reportProgress, - }, - ); - } - - /** - * Returns work counts per primary topic for an author. - * @endpoint get /api/works/{author_id}/primary-topic-counts - * @param authorId The author id, for example A5023888391. - * @param observe set whether or not to return the data Observable as the body, response or events. defaults to returning the body. - * @param reportProgress flag to report request and response progress. - */ - public getPrimaryTopicCountsByAuthor( - authorId: string, - observe?: 'body', - reportProgress?: boolean, - options?: { - httpHeaderAccept?: 'application/json'; - context?: HttpContext; - transferCache?: boolean; - }, - ): Observable>; - public getPrimaryTopicCountsByAuthor( - authorId: string, - observe?: 'response', - reportProgress?: boolean, - options?: { - httpHeaderAccept?: 'application/json'; - context?: HttpContext; - transferCache?: boolean; - }, - ): Observable>>; - public getPrimaryTopicCountsByAuthor( - authorId: string, - observe?: 'events', - reportProgress?: boolean, - options?: { - httpHeaderAccept?: 'application/json'; - context?: HttpContext; - transferCache?: boolean; - }, - ): Observable>>; - public getPrimaryTopicCountsByAuthor( - authorId: string, - observe: any = 'body', - reportProgress: boolean = false, - options?: { - httpHeaderAccept?: 'application/json'; - context?: HttpContext; - transferCache?: boolean; - }, - ): Observable { - if (authorId === null || authorId === undefined) { - throw new Error( - 'Required parameter authorId was null or undefined when calling getPrimaryTopicCountsByAuthor.', - ); - } - - let localVarHeaders = this.defaultHeaders; - - const localVarHttpHeaderAcceptSelected: string | undefined = - options?.httpHeaderAccept ?? - this.configuration.selectHeaderAccept(['application/json']); - if (localVarHttpHeaderAcceptSelected !== undefined) { - localVarHeaders = localVarHeaders.set( - 'Accept', - localVarHttpHeaderAcceptSelected, - ); - } - - const localVarHttpContext: HttpContext = - options?.context ?? new HttpContext(); - - const localVarTransferCache: boolean = options?.transferCache ?? true; - - let responseType_: 'text' | 'json' | 'blob' = 'json'; - if (localVarHttpHeaderAcceptSelected) { - if (localVarHttpHeaderAcceptSelected.startsWith('text')) { - responseType_ = 'text'; - } else if ( - this.configuration.isJsonMime(localVarHttpHeaderAcceptSelected) - ) { - responseType_ = 'json'; - } else { - responseType_ = 'blob'; - } - } - - let localVarPath = `/api/works/${this.configuration.encodeParam({ name: 'authorId', value: authorId, in: 'path', style: 'simple', explode: false, dataType: 'string', dataFormat: undefined })}/primary-topic-counts`; - const { basePath, withCredentials } = this.configuration; - return this.httpClient.request>( - 'get', - `${basePath}${localVarPath}`, - { - context: localVarHttpContext, - responseType: responseType_, - ...(withCredentials ? { withCredentials } : {}), - headers: localVarHeaders, - observe: observe, - ...(localVarTransferCache !== undefined - ? { transferCache: localVarTransferCache } - : {}), - reportProgress: reportProgress, - }, - ); - } - - /** - * Returns topics grouped by publication year for an author. - * @endpoint get /api/works/{author_id}/topics-by-time - * @param authorId The author id, for example A5023888391. - * @param maxTopicsPerYear The maximum number of topics per year. - * @param targetPublications Target number of publications used for the timeline. Complete years are always included. - * @param includeAll If true, all publications are used for the timeline. - * @param observe set whether or not to return the data Observable as the body, response or events. defaults to returning the body. - * @param reportProgress flag to report request and response progress. - */ - public getTopicsByTimeByAuthor( - authorId: string, - maxTopicsPerYear?: number, - targetPublications?: number, - includeAll?: boolean, - observe?: 'body', - reportProgress?: boolean, - options?: { - httpHeaderAccept?: 'application/json'; - context?: HttpContext; - transferCache?: boolean; - }, - ): Observable; - public getTopicsByTimeByAuthor( - authorId: string, - maxTopicsPerYear?: number, - targetPublications?: number, - includeAll?: boolean, - observe?: 'response', - reportProgress?: boolean, - options?: { - httpHeaderAccept?: 'application/json'; - context?: HttpContext; - transferCache?: boolean; - }, - ): Observable>; - public getTopicsByTimeByAuthor( - authorId: string, - maxTopicsPerYear?: number, - targetPublications?: number, - includeAll?: boolean, - observe?: 'events', - reportProgress?: boolean, - options?: { - httpHeaderAccept?: 'application/json'; - context?: HttpContext; - transferCache?: boolean; - }, - ): Observable>; - public getTopicsByTimeByAuthor( - authorId: string, - maxTopicsPerYear?: number, - targetPublications?: number, - includeAll?: boolean, - observe: any = 'body', - reportProgress: boolean = false, - options?: { - httpHeaderAccept?: 'application/json'; - context?: HttpContext; - transferCache?: boolean; - }, - ): Observable { - if (authorId === null || authorId === undefined) { - throw new Error( - 'Required parameter authorId was null or undefined when calling getTopicsByTimeByAuthor.', - ); - } - - let localVarQueryParameters = new HttpParams({ encoder: this.encoder }); - localVarQueryParameters = this.addToHttpParams( - localVarQueryParameters, - maxTopicsPerYear, - 'max_topics_per_year', - ); - localVarQueryParameters = this.addToHttpParams( - localVarQueryParameters, - targetPublications, - 'target_publications', - ); - localVarQueryParameters = this.addToHttpParams( - localVarQueryParameters, - includeAll, - 'include_all', - ); - - let localVarHeaders = this.defaultHeaders; - - const localVarHttpHeaderAcceptSelected: string | undefined = - options?.httpHeaderAccept ?? - this.configuration.selectHeaderAccept(['application/json']); - if (localVarHttpHeaderAcceptSelected !== undefined) { - localVarHeaders = localVarHeaders.set( - 'Accept', - localVarHttpHeaderAcceptSelected, - ); - } - - const localVarHttpContext: HttpContext = - options?.context ?? new HttpContext(); - - const localVarTransferCache: boolean = options?.transferCache ?? true; - - let responseType_: 'text' | 'json' | 'blob' = 'json'; - if (localVarHttpHeaderAcceptSelected) { - if (localVarHttpHeaderAcceptSelected.startsWith('text')) { - responseType_ = 'text'; - } else if ( - this.configuration.isJsonMime(localVarHttpHeaderAcceptSelected) - ) { - responseType_ = 'json'; - } else { - responseType_ = 'blob'; - } - } - - let localVarPath = `/api/works/${this.configuration.encodeParam({ name: 'authorId', value: authorId, in: 'path', style: 'simple', explode: false, dataType: 'string', dataFormat: undefined })}/topics-by-time`; - const { basePath, withCredentials } = this.configuration; - return this.httpClient.request( - 'get', - `${basePath}${localVarPath}`, - { - context: localVarHttpContext, - params: localVarQueryParameters, - responseType: responseType_, - ...(withCredentials ? { withCredentials } : {}), - headers: localVarHeaders, - observe: observe, - ...(localVarTransferCache !== undefined - ? { transferCache: localVarTransferCache } - : {}), - reportProgress: reportProgress, - }, - ); - } - - /** - * Returns one publication by OpenAlex ID or DOI. - * @endpoint get /api/works/detail/{identifier} - * @param identifier The OpenAlex work id (e.g., W2741809807) or DOI number of the publication. - * @param title Do we want to fallback to title search if ID and DOI dont work? - * @param observe set whether or not to return the data Observable as the body, response or events. defaults to returning the body. - * @param reportProgress flag to report request and response progress. - */ - public getWork( - identifier: string, - title?: string, - observe?: 'body', - reportProgress?: boolean, - options?: { - httpHeaderAccept?: 'application/json'; - context?: HttpContext; - transferCache?: boolean; - }, - ): Observable; - public getWork( - identifier: string, - title?: string, - observe?: 'response', - reportProgress?: boolean, - options?: { - httpHeaderAccept?: 'application/json'; - context?: HttpContext; - transferCache?: boolean; - }, - ): Observable>; - public getWork( - identifier: string, - title?: string, - observe?: 'events', - reportProgress?: boolean, - options?: { - httpHeaderAccept?: 'application/json'; - context?: HttpContext; - transferCache?: boolean; - }, - ): Observable>; - public getWork( - identifier: string, - title?: string, - observe: any = 'body', - reportProgress: boolean = false, - options?: { - httpHeaderAccept?: 'application/json'; - context?: HttpContext; - transferCache?: boolean; - }, - ): Observable { - if (identifier === null || identifier === undefined) { - throw new Error( - 'Required parameter identifier was null or undefined when calling getWork.', - ); - } - - let localVarQueryParameters = new HttpParams({ encoder: this.encoder }); - localVarQueryParameters = this.addToHttpParams( - localVarQueryParameters, - title, - 'title', - ); - - let localVarHeaders = this.defaultHeaders; - - const localVarHttpHeaderAcceptSelected: string | undefined = - options?.httpHeaderAccept ?? - this.configuration.selectHeaderAccept(['application/json']); - if (localVarHttpHeaderAcceptSelected !== undefined) { - localVarHeaders = localVarHeaders.set( - 'Accept', - localVarHttpHeaderAcceptSelected, - ); - } - - const localVarHttpContext: HttpContext = - options?.context ?? new HttpContext(); - - const localVarTransferCache: boolean = options?.transferCache ?? true; - - let responseType_: 'text' | 'json' | 'blob' = 'json'; - if (localVarHttpHeaderAcceptSelected) { - if (localVarHttpHeaderAcceptSelected.startsWith('text')) { - responseType_ = 'text'; - } else if ( - this.configuration.isJsonMime(localVarHttpHeaderAcceptSelected) - ) { - responseType_ = 'json'; - } else { - responseType_ = 'blob'; - } - } - - let localVarPath = `/api/works/detail/${this.configuration.encodeParam({ name: 'identifier', value: identifier, in: 'path', style: 'simple', explode: false, dataType: 'string', dataFormat: undefined })}`; - const { basePath, withCredentials } = this.configuration; - return this.httpClient.request('get', `${basePath}${localVarPath}`, { - context: localVarHttpContext, - params: localVarQueryParameters, - responseType: responseType_, - ...(withCredentials ? { withCredentials } : {}), - headers: localVarHeaders, - observe: observe, - ...(localVarTransferCache !== undefined - ? { transferCache: localVarTransferCache } - : {}), - reportProgress: reportProgress, - }); - } } diff --git a/webapp/src/app/api/api/worksV2.service.ts b/webapp/src/app/api/api/worksV2.service.ts index 8d6568f7..336ad96c 100644 --- a/webapp/src/app/api/api/worksV2.service.ts +++ b/webapp/src/app/api/api/worksV2.service.ts @@ -22,26 +22,20 @@ import { import { CustomHttpParameterCodec } from '../encoder'; import { Observable } from 'rxjs'; -// @ts-ignore -import { Author } from '../model/author'; // @ts-ignore import { HTTPValidationError } from '../model/hTTPValidationError'; // @ts-ignore -import { InseWorksV2ModelWorkPage } from '../model/inseWorksV2ModelWorkPage'; -// @ts-ignore -import { Institution } from '../model/institution'; -// @ts-ignore import { SortDirection } from '../model/sortDirection'; // @ts-ignore -import { Topic } from '../model/topic'; -// @ts-ignore import { WorkClassification } from '../model/workClassification'; // @ts-ignore +import { WorkClassificationMergePage } from '../model/workClassificationMergePage'; +// @ts-ignore import { WorkClassificationPage } from '../model/workClassificationPage'; // @ts-ignore -import { WorkSortBy } from '../model/workSortBy'; +import { WorkPageV2 } from '../model/workPageV2'; // @ts-ignore -import { WorkTopic } from '../model/workTopic'; +import { WorkSortBy } from '../model/workSortBy'; // @ts-ignore import { BASE_PATH, COLLECTION_FORMATS } from '../variables'; @@ -60,212 +54,6 @@ export class WorksV2Service extends BaseService { super(basePath, configuration); } - /** - * Returns a list of authors based on a search term for autocomplete functionality. - * @endpoint get /api/v2/works/authors/autocomplete - * @param query A search term to filter authors by (partial matches allowed). - * @param observe set whether or not to return the data Observable as the body, response or events. defaults to returning the body. - * @param reportProgress flag to report request and response progress. - */ - public getAuthorAutocomplete( - query?: string, - observe?: 'body', - reportProgress?: boolean, - options?: { - httpHeaderAccept?: 'application/json'; - context?: HttpContext; - transferCache?: boolean; - }, - ): Observable>; - public getAuthorAutocomplete( - query?: string, - observe?: 'response', - reportProgress?: boolean, - options?: { - httpHeaderAccept?: 'application/json'; - context?: HttpContext; - transferCache?: boolean; - }, - ): Observable>>; - public getAuthorAutocomplete( - query?: string, - observe?: 'events', - reportProgress?: boolean, - options?: { - httpHeaderAccept?: 'application/json'; - context?: HttpContext; - transferCache?: boolean; - }, - ): Observable>>; - public getAuthorAutocomplete( - query?: string, - observe: any = 'body', - reportProgress: boolean = false, - options?: { - httpHeaderAccept?: 'application/json'; - context?: HttpContext; - transferCache?: boolean; - }, - ): Observable { - let localVarQueryParameters = new HttpParams({ encoder: this.encoder }); - localVarQueryParameters = this.addToHttpParams( - localVarQueryParameters, - query, - 'query', - ); - - let localVarHeaders = this.defaultHeaders; - - const localVarHttpHeaderAcceptSelected: string | undefined = - options?.httpHeaderAccept ?? - this.configuration.selectHeaderAccept(['application/json']); - if (localVarHttpHeaderAcceptSelected !== undefined) { - localVarHeaders = localVarHeaders.set( - 'Accept', - localVarHttpHeaderAcceptSelected, - ); - } - - const localVarHttpContext: HttpContext = - options?.context ?? new HttpContext(); - - const localVarTransferCache: boolean = options?.transferCache ?? true; - - let responseType_: 'text' | 'json' | 'blob' = 'json'; - if (localVarHttpHeaderAcceptSelected) { - if (localVarHttpHeaderAcceptSelected.startsWith('text')) { - responseType_ = 'text'; - } else if ( - this.configuration.isJsonMime(localVarHttpHeaderAcceptSelected) - ) { - responseType_ = 'json'; - } else { - responseType_ = 'blob'; - } - } - - let localVarPath = `/api/v2/works/authors/autocomplete`; - const { basePath, withCredentials } = this.configuration; - return this.httpClient.request>( - 'get', - `${basePath}${localVarPath}`, - { - context: localVarHttpContext, - params: localVarQueryParameters, - responseType: responseType_, - ...(withCredentials ? { withCredentials } : {}), - headers: localVarHeaders, - observe: observe, - ...(localVarTransferCache !== undefined - ? { transferCache: localVarTransferCache } - : {}), - reportProgress: reportProgress, - }, - ); - } - - /** - * Returns the classifications of an author\'s works based on their ID. - * @endpoint get /api/v2/works/classification/author/{raw_oa_author_id} - * @param rawOaAuthorId The raw OpenAlex author id. - * @param observe set whether or not to return the data Observable as the body, response or events. defaults to returning the body. - * @param reportProgress flag to report request and response progress. - */ - public getAuthorWorkClassifications( - rawOaAuthorId: string, - observe?: 'body', - reportProgress?: boolean, - options?: { - httpHeaderAccept?: 'application/json'; - context?: HttpContext; - transferCache?: boolean; - }, - ): Observable; - public getAuthorWorkClassifications( - rawOaAuthorId: string, - observe?: 'response', - reportProgress?: boolean, - options?: { - httpHeaderAccept?: 'application/json'; - context?: HttpContext; - transferCache?: boolean; - }, - ): Observable>; - public getAuthorWorkClassifications( - rawOaAuthorId: string, - observe?: 'events', - reportProgress?: boolean, - options?: { - httpHeaderAccept?: 'application/json'; - context?: HttpContext; - transferCache?: boolean; - }, - ): Observable>; - public getAuthorWorkClassifications( - rawOaAuthorId: string, - observe: any = 'body', - reportProgress: boolean = false, - options?: { - httpHeaderAccept?: 'application/json'; - context?: HttpContext; - transferCache?: boolean; - }, - ): Observable { - if (rawOaAuthorId === null || rawOaAuthorId === undefined) { - throw new Error( - 'Required parameter rawOaAuthorId was null or undefined when calling getAuthorWorkClassifications.', - ); - } - - let localVarHeaders = this.defaultHeaders; - - const localVarHttpHeaderAcceptSelected: string | undefined = - options?.httpHeaderAccept ?? - this.configuration.selectHeaderAccept(['application/json']); - if (localVarHttpHeaderAcceptSelected !== undefined) { - localVarHeaders = localVarHeaders.set( - 'Accept', - localVarHttpHeaderAcceptSelected, - ); - } - - const localVarHttpContext: HttpContext = - options?.context ?? new HttpContext(); - - const localVarTransferCache: boolean = options?.transferCache ?? true; - - let responseType_: 'text' | 'json' | 'blob' = 'json'; - if (localVarHttpHeaderAcceptSelected) { - if (localVarHttpHeaderAcceptSelected.startsWith('text')) { - responseType_ = 'text'; - } else if ( - this.configuration.isJsonMime(localVarHttpHeaderAcceptSelected) - ) { - responseType_ = 'json'; - } else { - responseType_ = 'blob'; - } - } - - let localVarPath = `/api/v2/works/classification/author/${this.configuration.encodeParam({ name: 'rawOaAuthorId', value: rawOaAuthorId, in: 'path', style: 'simple', explode: false, dataType: 'string', dataFormat: undefined })}`; - const { basePath, withCredentials } = this.configuration; - return this.httpClient.request( - 'get', - `${basePath}${localVarPath}`, - { - context: localVarHttpContext, - responseType: responseType_, - ...(withCredentials ? { withCredentials } : {}), - headers: localVarHeaders, - observe: observe, - ...(localVarTransferCache !== undefined - ? { transferCache: localVarTransferCache } - : {}), - reportProgress: reportProgress, - }, - ); - } - /** * Returns a paginated list of works for a given author based on their ID. * @endpoint get /api/v2/works/author/{raw_oa_author_id} @@ -302,7 +90,7 @@ export class WorksV2Service extends BaseService { context?: HttpContext; transferCache?: boolean; }, - ): Observable; + ): Observable; public getAuthorWorkPage( rawOaAuthorId: string, page?: number, @@ -322,7 +110,7 @@ export class WorksV2Service extends BaseService { context?: HttpContext; transferCache?: boolean; }, - ): Observable>; + ): Observable>; public getAuthorWorkPage( rawOaAuthorId: string, page?: number, @@ -342,7 +130,7 @@ export class WorksV2Service extends BaseService { context?: HttpContext; transferCache?: boolean; }, - ): Observable>; + ): Observable>; public getAuthorWorkPage( rawOaAuthorId: string, page?: number, @@ -473,219 +261,7 @@ export class WorksV2Service extends BaseService { let localVarPath = `/api/v2/works/author/${this.configuration.encodeParam({ name: 'rawOaAuthorId', value: rawOaAuthorId, in: 'path', style: 'simple', explode: false, dataType: 'string', dataFormat: undefined })}`; const { basePath, withCredentials } = this.configuration; - return this.httpClient.request( - 'get', - `${basePath}${localVarPath}`, - { - context: localVarHttpContext, - params: localVarQueryParameters, - responseType: responseType_, - ...(withCredentials ? { withCredentials } : {}), - headers: localVarHeaders, - observe: observe, - ...(localVarTransferCache !== undefined - ? { transferCache: localVarTransferCache } - : {}), - reportProgress: reportProgress, - }, - ); - } - - /** - * Returns a list of authors based on their IDs. - * @endpoint get /api/v2/works/authors/search - * @param authorIds A list of author IDs to retrieve. - * @param observe set whether or not to return the data Observable as the body, response or events. defaults to returning the body. - * @param reportProgress flag to report request and response progress. - */ - public getAuthorsByIds( - authorIds?: Array, - observe?: 'body', - reportProgress?: boolean, - options?: { - httpHeaderAccept?: 'application/json'; - context?: HttpContext; - transferCache?: boolean; - }, - ): Observable>; - public getAuthorsByIds( - authorIds?: Array, - observe?: 'response', - reportProgress?: boolean, - options?: { - httpHeaderAccept?: 'application/json'; - context?: HttpContext; - transferCache?: boolean; - }, - ): Observable>>; - public getAuthorsByIds( - authorIds?: Array, - observe?: 'events', - reportProgress?: boolean, - options?: { - httpHeaderAccept?: 'application/json'; - context?: HttpContext; - transferCache?: boolean; - }, - ): Observable>>; - public getAuthorsByIds( - authorIds?: Array, - observe: any = 'body', - reportProgress: boolean = false, - options?: { - httpHeaderAccept?: 'application/json'; - context?: HttpContext; - transferCache?: boolean; - }, - ): Observable { - let localVarQueryParameters = new HttpParams({ encoder: this.encoder }); - if (authorIds) { - authorIds.forEach((element) => { - localVarQueryParameters = this.addToHttpParams( - localVarQueryParameters, - element, - 'author_ids', - ); - }); - } - - let localVarHeaders = this.defaultHeaders; - - const localVarHttpHeaderAcceptSelected: string | undefined = - options?.httpHeaderAccept ?? - this.configuration.selectHeaderAccept(['application/json']); - if (localVarHttpHeaderAcceptSelected !== undefined) { - localVarHeaders = localVarHeaders.set( - 'Accept', - localVarHttpHeaderAcceptSelected, - ); - } - - const localVarHttpContext: HttpContext = - options?.context ?? new HttpContext(); - - const localVarTransferCache: boolean = options?.transferCache ?? true; - - let responseType_: 'text' | 'json' | 'blob' = 'json'; - if (localVarHttpHeaderAcceptSelected) { - if (localVarHttpHeaderAcceptSelected.startsWith('text')) { - responseType_ = 'text'; - } else if ( - this.configuration.isJsonMime(localVarHttpHeaderAcceptSelected) - ) { - responseType_ = 'json'; - } else { - responseType_ = 'blob'; - } - } - - let localVarPath = `/api/v2/works/authors/search`; - const { basePath, withCredentials } = this.configuration; - return this.httpClient.request>( - 'get', - `${basePath}${localVarPath}`, - { - context: localVarHttpContext, - params: localVarQueryParameters, - responseType: responseType_, - ...(withCredentials ? { withCredentials } : {}), - headers: localVarHeaders, - observe: observe, - ...(localVarTransferCache !== undefined - ? { transferCache: localVarTransferCache } - : {}), - reportProgress: reportProgress, - }, - ); - } - - /** - * Returns a list of institutions based on a search term for autocomplete functionality. - * @endpoint get /api/v2/works/institutions/autocomplete - * @param query A search term to filter institutions by (partial matches allowed). - * @param observe set whether or not to return the data Observable as the body, response or events. defaults to returning the body. - * @param reportProgress flag to report request and response progress. - */ - public getInstitutionAutocomplete( - query?: string, - observe?: 'body', - reportProgress?: boolean, - options?: { - httpHeaderAccept?: 'application/json'; - context?: HttpContext; - transferCache?: boolean; - }, - ): Observable>; - public getInstitutionAutocomplete( - query?: string, - observe?: 'response', - reportProgress?: boolean, - options?: { - httpHeaderAccept?: 'application/json'; - context?: HttpContext; - transferCache?: boolean; - }, - ): Observable>>; - public getInstitutionAutocomplete( - query?: string, - observe?: 'events', - reportProgress?: boolean, - options?: { - httpHeaderAccept?: 'application/json'; - context?: HttpContext; - transferCache?: boolean; - }, - ): Observable>>; - public getInstitutionAutocomplete( - query?: string, - observe: any = 'body', - reportProgress: boolean = false, - options?: { - httpHeaderAccept?: 'application/json'; - context?: HttpContext; - transferCache?: boolean; - }, - ): Observable { - let localVarQueryParameters = new HttpParams({ encoder: this.encoder }); - localVarQueryParameters = this.addToHttpParams( - localVarQueryParameters, - query, - 'query', - ); - - let localVarHeaders = this.defaultHeaders; - - const localVarHttpHeaderAcceptSelected: string | undefined = - options?.httpHeaderAccept ?? - this.configuration.selectHeaderAccept(['application/json']); - if (localVarHttpHeaderAcceptSelected !== undefined) { - localVarHeaders = localVarHeaders.set( - 'Accept', - localVarHttpHeaderAcceptSelected, - ); - } - - const localVarHttpContext: HttpContext = - options?.context ?? new HttpContext(); - - const localVarTransferCache: boolean = options?.transferCache ?? true; - - let responseType_: 'text' | 'json' | 'blob' = 'json'; - if (localVarHttpHeaderAcceptSelected) { - if (localVarHttpHeaderAcceptSelected.startsWith('text')) { - responseType_ = 'text'; - } else if ( - this.configuration.isJsonMime(localVarHttpHeaderAcceptSelected) - ) { - responseType_ = 'json'; - } else { - responseType_ = 'blob'; - } - } - - let localVarPath = `/api/v2/works/institutions/autocomplete`; - const { basePath, withCredentials } = this.configuration; - return this.httpClient.request>( + return this.httpClient.request( 'get', `${basePath}${localVarPath}`, { @@ -739,7 +315,7 @@ export class WorksV2Service extends BaseService { context?: HttpContext; transferCache?: boolean; }, - ): Observable; + ): Observable; public getInstitutionWorkPage( rawOaInstitutionId: string, page?: number, @@ -759,7 +335,7 @@ export class WorksV2Service extends BaseService { context?: HttpContext; transferCache?: boolean; }, - ): Observable>; + ): Observable>; public getInstitutionWorkPage( rawOaInstitutionId: string, page?: number, @@ -779,7 +355,7 @@ export class WorksV2Service extends BaseService { context?: HttpContext; transferCache?: boolean; }, - ): Observable>; + ): Observable>; public getInstitutionWorkPage( rawOaInstitutionId: string, page?: number, @@ -910,219 +486,7 @@ export class WorksV2Service extends BaseService { let localVarPath = `/api/v2/works/institution/${this.configuration.encodeParam({ name: 'rawOaInstitutionId', value: rawOaInstitutionId, in: 'path', style: 'simple', explode: false, dataType: 'string', dataFormat: undefined })}`; const { basePath, withCredentials } = this.configuration; - return this.httpClient.request( - 'get', - `${basePath}${localVarPath}`, - { - context: localVarHttpContext, - params: localVarQueryParameters, - responseType: responseType_, - ...(withCredentials ? { withCredentials } : {}), - headers: localVarHeaders, - observe: observe, - ...(localVarTransferCache !== undefined - ? { transferCache: localVarTransferCache } - : {}), - reportProgress: reportProgress, - }, - ); - } - - /** - * Returns a list of institutions based on their IDs. - * @endpoint get /api/v2/works/institutions/search - * @param institutionIds A list of institution IDs to retrieve. - * @param observe set whether or not to return the data Observable as the body, response or events. defaults to returning the body. - * @param reportProgress flag to report request and response progress. - */ - public getInstitutionsByIds( - institutionIds?: Array, - observe?: 'body', - reportProgress?: boolean, - options?: { - httpHeaderAccept?: 'application/json'; - context?: HttpContext; - transferCache?: boolean; - }, - ): Observable>; - public getInstitutionsByIds( - institutionIds?: Array, - observe?: 'response', - reportProgress?: boolean, - options?: { - httpHeaderAccept?: 'application/json'; - context?: HttpContext; - transferCache?: boolean; - }, - ): Observable>>; - public getInstitutionsByIds( - institutionIds?: Array, - observe?: 'events', - reportProgress?: boolean, - options?: { - httpHeaderAccept?: 'application/json'; - context?: HttpContext; - transferCache?: boolean; - }, - ): Observable>>; - public getInstitutionsByIds( - institutionIds?: Array, - observe: any = 'body', - reportProgress: boolean = false, - options?: { - httpHeaderAccept?: 'application/json'; - context?: HttpContext; - transferCache?: boolean; - }, - ): Observable { - let localVarQueryParameters = new HttpParams({ encoder: this.encoder }); - if (institutionIds) { - institutionIds.forEach((element) => { - localVarQueryParameters = this.addToHttpParams( - localVarQueryParameters, - element, - 'institution_ids', - ); - }); - } - - let localVarHeaders = this.defaultHeaders; - - const localVarHttpHeaderAcceptSelected: string | undefined = - options?.httpHeaderAccept ?? - this.configuration.selectHeaderAccept(['application/json']); - if (localVarHttpHeaderAcceptSelected !== undefined) { - localVarHeaders = localVarHeaders.set( - 'Accept', - localVarHttpHeaderAcceptSelected, - ); - } - - const localVarHttpContext: HttpContext = - options?.context ?? new HttpContext(); - - const localVarTransferCache: boolean = options?.transferCache ?? true; - - let responseType_: 'text' | 'json' | 'blob' = 'json'; - if (localVarHttpHeaderAcceptSelected) { - if (localVarHttpHeaderAcceptSelected.startsWith('text')) { - responseType_ = 'text'; - } else if ( - this.configuration.isJsonMime(localVarHttpHeaderAcceptSelected) - ) { - responseType_ = 'json'; - } else { - responseType_ = 'blob'; - } - } - - let localVarPath = `/api/v2/works/institutions/search`; - const { basePath, withCredentials } = this.configuration; - return this.httpClient.request>( - 'get', - `${basePath}${localVarPath}`, - { - context: localVarHttpContext, - params: localVarQueryParameters, - responseType: responseType_, - ...(withCredentials ? { withCredentials } : {}), - headers: localVarHeaders, - observe: observe, - ...(localVarTransferCache !== undefined - ? { transferCache: localVarTransferCache } - : {}), - reportProgress: reportProgress, - }, - ); - } - - /** - * Returns a list of work topics based on a search term for autocomplete functionality. - * @endpoint get /api/v2/works/topics/autocomplete - * @param query A search term to filter topics by (partial matches allowed). - * @param observe set whether or not to return the data Observable as the body, response or events. defaults to returning the body. - * @param reportProgress flag to report request and response progress. - */ - public getTopicAutocomplete( - query?: string, - observe?: 'body', - reportProgress?: boolean, - options?: { - httpHeaderAccept?: 'application/json'; - context?: HttpContext; - transferCache?: boolean; - }, - ): Observable>; - public getTopicAutocomplete( - query?: string, - observe?: 'response', - reportProgress?: boolean, - options?: { - httpHeaderAccept?: 'application/json'; - context?: HttpContext; - transferCache?: boolean; - }, - ): Observable>>; - public getTopicAutocomplete( - query?: string, - observe?: 'events', - reportProgress?: boolean, - options?: { - httpHeaderAccept?: 'application/json'; - context?: HttpContext; - transferCache?: boolean; - }, - ): Observable>>; - public getTopicAutocomplete( - query?: string, - observe: any = 'body', - reportProgress: boolean = false, - options?: { - httpHeaderAccept?: 'application/json'; - context?: HttpContext; - transferCache?: boolean; - }, - ): Observable { - let localVarQueryParameters = new HttpParams({ encoder: this.encoder }); - localVarQueryParameters = this.addToHttpParams( - localVarQueryParameters, - query, - 'query', - ); - - let localVarHeaders = this.defaultHeaders; - - const localVarHttpHeaderAcceptSelected: string | undefined = - options?.httpHeaderAccept ?? - this.configuration.selectHeaderAccept(['application/json']); - if (localVarHttpHeaderAcceptSelected !== undefined) { - localVarHeaders = localVarHeaders.set( - 'Accept', - localVarHttpHeaderAcceptSelected, - ); - } - - const localVarHttpContext: HttpContext = - options?.context ?? new HttpContext(); - - const localVarTransferCache: boolean = options?.transferCache ?? true; - - let responseType_: 'text' | 'json' | 'blob' = 'json'; - if (localVarHttpHeaderAcceptSelected) { - if (localVarHttpHeaderAcceptSelected.startsWith('text')) { - responseType_ = 'text'; - } else if ( - this.configuration.isJsonMime(localVarHttpHeaderAcceptSelected) - ) { - responseType_ = 'json'; - } else { - responseType_ = 'blob'; - } - } - - let localVarPath = `/api/v2/works/topics/autocomplete`; - const { basePath, withCredentials } = this.configuration; - return this.httpClient.request>( + return this.httpClient.request( 'get', `${basePath}${localVarPath}`, { @@ -1142,13 +506,15 @@ export class WorksV2Service extends BaseService { /** * Returns the classifications of a work based on its ID. - * @endpoint get /api/v2/works/classification/work/{work_id} - * @param workId The OpenAlex work id. + * @endpoint get /api/v2/works/classification/work/{raw_oa_work_id} + * @param rawOaWorkId The raw OpenAlex work id. + * @param secureFgpAcc * @param observe set whether or not to return the data Observable as the body, response or events. defaults to returning the body. * @param reportProgress flag to report request and response progress. */ public getWorkClassificationByWorkId( - workId: string, + rawOaWorkId: string, + secureFgpAcc?: string, observe?: 'body', reportProgress?: boolean, options?: { @@ -1158,7 +524,8 @@ export class WorksV2Service extends BaseService { }, ): Observable; public getWorkClassificationByWorkId( - workId: string, + rawOaWorkId: string, + secureFgpAcc?: string, observe?: 'response', reportProgress?: boolean, options?: { @@ -1168,7 +535,8 @@ export class WorksV2Service extends BaseService { }, ): Observable>; public getWorkClassificationByWorkId( - workId: string, + rawOaWorkId: string, + secureFgpAcc?: string, observe?: 'events', reportProgress?: boolean, options?: { @@ -1178,7 +546,8 @@ export class WorksV2Service extends BaseService { }, ): Observable>; public getWorkClassificationByWorkId( - workId: string, + rawOaWorkId: string, + secureFgpAcc?: string, observe: any = 'body', reportProgress: boolean = false, options?: { @@ -1187,14 +556,22 @@ export class WorksV2Service extends BaseService { transferCache?: boolean; }, ): Observable { - if (workId === null || workId === undefined) { + if (rawOaWorkId === null || rawOaWorkId === undefined) { throw new Error( - 'Required parameter workId was null or undefined when calling getWorkClassificationByWorkId.', + 'Required parameter rawOaWorkId was null or undefined when calling getWorkClassificationByWorkId.', ); } let localVarHeaders = this.defaultHeaders; + // authentication (HTTPBearer) required + localVarHeaders = this.configuration.addCredentialToHeaders( + 'HTTPBearer', + 'Authorization', + localVarHeaders, + 'Bearer ', + ); + const localVarHttpHeaderAcceptSelected: string | undefined = options?.httpHeaderAccept ?? this.configuration.selectHeaderAccept(['application/json']); @@ -1223,7 +600,7 @@ export class WorksV2Service extends BaseService { } } - let localVarPath = `/api/v2/works/classification/work/${this.configuration.encodeParam({ name: 'workId', value: workId, in: 'path', style: 'simple', explode: false, dataType: 'string', dataFormat: undefined })}`; + let localVarPath = `/api/v2/works/classification/work/${this.configuration.encodeParam({ name: 'rawOaWorkId', value: rawOaWorkId, in: 'path', style: 'simple', explode: false, dataType: 'string', dataFormat: undefined })}`; const { basePath, withCredentials } = this.configuration; return this.httpClient.request( 'get', @@ -1242,12 +619,128 @@ export class WorksV2Service extends BaseService { ); } + /** + * Returns the classifications of an author\'s works based on their ID. + * @endpoint get /api/v2/works/classification/author/{raw_oa_author_id} + * @param rawOaAuthorId The raw OpenAlex author id. + * @param secureFgpAcc + * @param observe set whether or not to return the data Observable as the body, response or events. defaults to returning the body. + * @param reportProgress flag to report request and response progress. + */ + public getWorkClassificationsByAuthorId( + rawOaAuthorId: string, + secureFgpAcc?: string, + observe?: 'body', + reportProgress?: boolean, + options?: { + httpHeaderAccept?: 'application/json'; + context?: HttpContext; + transferCache?: boolean; + }, + ): Observable; + public getWorkClassificationsByAuthorId( + rawOaAuthorId: string, + secureFgpAcc?: string, + observe?: 'response', + reportProgress?: boolean, + options?: { + httpHeaderAccept?: 'application/json'; + context?: HttpContext; + transferCache?: boolean; + }, + ): Observable>; + public getWorkClassificationsByAuthorId( + rawOaAuthorId: string, + secureFgpAcc?: string, + observe?: 'events', + reportProgress?: boolean, + options?: { + httpHeaderAccept?: 'application/json'; + context?: HttpContext; + transferCache?: boolean; + }, + ): Observable>; + public getWorkClassificationsByAuthorId( + rawOaAuthorId: string, + secureFgpAcc?: string, + observe: any = 'body', + reportProgress: boolean = false, + options?: { + httpHeaderAccept?: 'application/json'; + context?: HttpContext; + transferCache?: boolean; + }, + ): Observable { + if (rawOaAuthorId === null || rawOaAuthorId === undefined) { + throw new Error( + 'Required parameter rawOaAuthorId was null or undefined when calling getWorkClassificationsByAuthorId.', + ); + } + + let localVarHeaders = this.defaultHeaders; + + // authentication (HTTPBearer) required + localVarHeaders = this.configuration.addCredentialToHeaders( + 'HTTPBearer', + 'Authorization', + localVarHeaders, + 'Bearer ', + ); + + const localVarHttpHeaderAcceptSelected: string | undefined = + options?.httpHeaderAccept ?? + this.configuration.selectHeaderAccept(['application/json']); + if (localVarHttpHeaderAcceptSelected !== undefined) { + localVarHeaders = localVarHeaders.set( + 'Accept', + localVarHttpHeaderAcceptSelected, + ); + } + + const localVarHttpContext: HttpContext = + options?.context ?? new HttpContext(); + + const localVarTransferCache: boolean = options?.transferCache ?? true; + + let responseType_: 'text' | 'json' | 'blob' = 'json'; + if (localVarHttpHeaderAcceptSelected) { + if (localVarHttpHeaderAcceptSelected.startsWith('text')) { + responseType_ = 'text'; + } else if ( + this.configuration.isJsonMime(localVarHttpHeaderAcceptSelected) + ) { + responseType_ = 'json'; + } else { + responseType_ = 'blob'; + } + } + + let localVarPath = `/api/v2/works/classification/author/${this.configuration.encodeParam({ name: 'rawOaAuthorId', value: rawOaAuthorId, in: 'path', style: 'simple', explode: false, dataType: 'string', dataFormat: undefined })}`; + const { basePath, withCredentials } = this.configuration; + return this.httpClient.request( + 'get', + `${basePath}${localVarPath}`, + { + context: localVarHttpContext, + responseType: responseType_, + ...(withCredentials ? { withCredentials } : {}), + headers: localVarHeaders, + observe: observe, + ...(localVarTransferCache !== undefined + ? { transferCache: localVarTransferCache } + : {}), + reportProgress: reportProgress, + }, + ); + } + /** * Returns the classifications of works based on their IDs. * @endpoint get /api/v2/works/classification/works/search * @param workIds A list of OpenAlex work IDs to retrieve classifications for. * @param page The page number to retrieve. (0-based) * @param size The number of classifications to retrieve per page. + * @param secureFgpAcc * @param observe set whether or not to return the data Observable as the body, response or events. defaults to returning the body. * @param reportProgress flag to report request and response progress. */ @@ -1255,6 +748,7 @@ export class WorksV2Service extends BaseService { workIds?: Array, page?: number, size?: number, + secureFgpAcc?: string, observe?: 'body', reportProgress?: boolean, options?: { @@ -1267,6 +761,7 @@ export class WorksV2Service extends BaseService { workIds?: Array, page?: number, size?: number, + secureFgpAcc?: string, observe?: 'response', reportProgress?: boolean, options?: { @@ -1279,6 +774,7 @@ export class WorksV2Service extends BaseService { workIds?: Array, page?: number, size?: number, + secureFgpAcc?: string, observe?: 'events', reportProgress?: boolean, options?: { @@ -1291,6 +787,7 @@ export class WorksV2Service extends BaseService { workIds?: Array, page?: number, size?: number, + secureFgpAcc?: string, observe: any = 'body', reportProgress: boolean = false, options?: { @@ -1322,6 +819,14 @@ export class WorksV2Service extends BaseService { let localVarHeaders = this.defaultHeaders; + // authentication (HTTPBearer) required + localVarHeaders = this.configuration.addCredentialToHeaders( + 'HTTPBearer', + 'Authorization', + localVarHeaders, + 'Bearer ', + ); + const localVarHttpHeaderAcceptSelected: string | undefined = options?.httpHeaderAccept ?? this.configuration.selectHeaderAccept(['application/json']); @@ -1370,114 +875,6 @@ export class WorksV2Service extends BaseService { ); } - /** - * Returns a list of work topics based on their IDs. - * @endpoint get /api/v2/works/topics/search - * @param topicIds A list of topic IDs to retrieve. - * @param observe set whether or not to return the data Observable as the body, response or events. defaults to returning the body. - * @param reportProgress flag to report request and response progress. - */ - public getWorkTopicsByIds( - topicIds?: Array, - observe?: 'body', - reportProgress?: boolean, - options?: { - httpHeaderAccept?: 'application/json'; - context?: HttpContext; - transferCache?: boolean; - }, - ): Observable>; - public getWorkTopicsByIds( - topicIds?: Array, - observe?: 'response', - reportProgress?: boolean, - options?: { - httpHeaderAccept?: 'application/json'; - context?: HttpContext; - transferCache?: boolean; - }, - ): Observable>>; - public getWorkTopicsByIds( - topicIds?: Array, - observe?: 'events', - reportProgress?: boolean, - options?: { - httpHeaderAccept?: 'application/json'; - context?: HttpContext; - transferCache?: boolean; - }, - ): Observable>>; - public getWorkTopicsByIds( - topicIds?: Array, - observe: any = 'body', - reportProgress: boolean = false, - options?: { - httpHeaderAccept?: 'application/json'; - context?: HttpContext; - transferCache?: boolean; - }, - ): Observable { - let localVarQueryParameters = new HttpParams({ encoder: this.encoder }); - if (topicIds) { - topicIds.forEach((element) => { - localVarQueryParameters = this.addToHttpParams( - localVarQueryParameters, - element, - 'topic_ids', - ); - }); - } - - let localVarHeaders = this.defaultHeaders; - - const localVarHttpHeaderAcceptSelected: string | undefined = - options?.httpHeaderAccept ?? - this.configuration.selectHeaderAccept(['application/json']); - if (localVarHttpHeaderAcceptSelected !== undefined) { - localVarHeaders = localVarHeaders.set( - 'Accept', - localVarHttpHeaderAcceptSelected, - ); - } - - const localVarHttpContext: HttpContext = - options?.context ?? new HttpContext(); - - const localVarTransferCache: boolean = options?.transferCache ?? true; - - let responseType_: 'text' | 'json' | 'blob' = 'json'; - if (localVarHttpHeaderAcceptSelected) { - if (localVarHttpHeaderAcceptSelected.startsWith('text')) { - responseType_ = 'text'; - } else if ( - this.configuration.isJsonMime(localVarHttpHeaderAcceptSelected) - ) { - responseType_ = 'json'; - } else { - responseType_ = 'blob'; - } - } - - let localVarPath = `/api/v2/works/topics/search`; - const { basePath, withCredentials } = this.configuration; - return this.httpClient.request>( - 'get', - `${basePath}${localVarPath}`, - { - context: localVarHttpContext, - params: localVarQueryParameters, - responseType: responseType_, - ...(withCredentials ? { withCredentials } : {}), - headers: localVarHeaders, - observe: observe, - ...(localVarTransferCache !== undefined - ? { transferCache: localVarTransferCache } - : {}), - reportProgress: reportProgress, - }, - ); - } - /** * Search works by topics or raw keywords with filters. * @endpoint get /api/v2/works/keyword/search @@ -1522,7 +919,7 @@ export class WorksV2Service extends BaseService { context?: HttpContext; transferCache?: boolean; }, - ): Observable; + ): Observable; public getWorksByKeywords( topics?: Array, topicIds?: Array, @@ -1546,7 +943,7 @@ export class WorksV2Service extends BaseService { context?: HttpContext; transferCache?: boolean; }, - ): Observable>; + ): Observable>; public getWorksByKeywords( topics?: Array, topicIds?: Array, @@ -1570,7 +967,7 @@ export class WorksV2Service extends BaseService { context?: HttpContext; transferCache?: boolean; }, - ): Observable>; + ): Observable>; public getWorksByKeywords( topics?: Array, topicIds?: Array, @@ -1740,7 +1137,7 @@ export class WorksV2Service extends BaseService { let localVarPath = `/api/v2/works/keyword/search`; const { basePath, withCredentials } = this.configuration; - return this.httpClient.request( + return this.httpClient.request( 'get', `${basePath}${localVarPath}`, { diff --git a/webapp/src/app/api/configuration.ts b/webapp/src/app/api/configuration.ts index 17a7070e..2b8c80f7 100644 --- a/webapp/src/app/api/configuration.ts +++ b/webapp/src/app/api/configuration.ts @@ -1,219 +1,193 @@ -import { - HttpHeaders, - HttpParams, - HttpParameterCodec, -} from '@angular/common/http'; +import { HttpHeaders, HttpParams, HttpParameterCodec } from '@angular/common/http'; import { Param } from './param'; export interface ConfigurationParameters { - /** - * @deprecated Since 5.0. Use credentials instead - */ - apiKeys?: { [key: string]: string }; - username?: string; - password?: string; - /** - * @deprecated Since 5.0. Use credentials instead - */ - accessToken?: string | (() => string); - basePath?: string; - withCredentials?: boolean; - /** - * Takes care of encoding query- and form-parameters. - */ - encoder?: HttpParameterCodec; - /** - * Override the default method for encoding path parameters in various - * styles. - *

- * See {@link README.md} for more details - *

- */ - encodeParam?: (param: Param) => string; - /** - * The keys are the names in the securitySchemes section of the OpenAPI - * document. They should map to the value used for authentication - * minus any standard prefixes such as 'Basic' or 'Bearer'. - */ - credentials?: { [key: string]: string | (() => string | undefined) }; + /** + * @deprecated Since 5.0. Use credentials instead + */ + apiKeys?: {[ key: string ]: string}; + username?: string; + password?: string; + /** + * @deprecated Since 5.0. Use credentials instead + */ + accessToken?: string | (() => string); + basePath?: string; + withCredentials?: boolean; + /** + * Takes care of encoding query- and form-parameters. + */ + encoder?: HttpParameterCodec; + /** + * Override the default method for encoding path parameters in various + * styles. + *

+ * See {@link README.md} for more details + *

+ */ + encodeParam?: (param: Param) => string; + /** + * The keys are the names in the securitySchemes section of the OpenAPI + * document. They should map to the value used for authentication + * minus any standard prefixes such as 'Basic' or 'Bearer'. + */ + credentials?: {[ key: string ]: string | (() => string | undefined)}; } export class Configuration { - /** - * @deprecated Since 5.0. Use credentials instead - */ - apiKeys?: { [key: string]: string }; - username?: string; - password?: string; - /** - * @deprecated Since 5.0. Use credentials instead - */ - accessToken?: string | (() => string); - basePath?: string; - withCredentials?: boolean; - /** - * Takes care of encoding query- and form-parameters. - */ - encoder?: HttpParameterCodec; - /** - * Encoding of various path parameter - * styles. - *

- * See {@link README.md} for more details - *

- */ - encodeParam: (param: Param) => string; - /** - * The keys are the names in the securitySchemes section of the OpenAPI - * document. They should map to the value used for authentication - * minus any standard prefixes such as 'Basic' or 'Bearer'. - */ - credentials: { [key: string]: string | (() => string | undefined) }; + /** + * @deprecated Since 5.0. Use credentials instead + */ + apiKeys?: {[ key: string ]: string}; + username?: string; + password?: string; + /** + * @deprecated Since 5.0. Use credentials instead + */ + accessToken?: string | (() => string); + basePath?: string; + withCredentials?: boolean; + /** + * Takes care of encoding query- and form-parameters. + */ + encoder?: HttpParameterCodec; + /** + * Encoding of various path parameter + * styles. + *

+ * See {@link README.md} for more details + *

+ */ + encodeParam: (param: Param) => string; + /** + * The keys are the names in the securitySchemes section of the OpenAPI + * document. They should map to the value used for authentication + * minus any standard prefixes such as 'Basic' or 'Bearer'. + */ + credentials: {[ key: string ]: string | (() => string | undefined)}; - constructor({ - accessToken, - apiKeys, - basePath, - credentials, - encodeParam, - encoder, - password, - username, - withCredentials, - }: ConfigurationParameters = {}) { - if (apiKeys) { - this.apiKeys = apiKeys; - } - if (username !== undefined) { - this.username = username; - } - if (password !== undefined) { - this.password = password; - } - if (accessToken !== undefined) { - this.accessToken = accessToken; - } - if (basePath !== undefined) { - this.basePath = basePath; - } - if (withCredentials !== undefined) { - this.withCredentials = withCredentials; - } - if (encoder) { - this.encoder = encoder; - } - this.encodeParam = - encodeParam ?? ((param) => this.defaultEncodeParam(param)); - this.credentials = credentials ?? {}; +constructor({ accessToken, apiKeys, basePath, credentials, encodeParam, encoder, password, username, withCredentials }: ConfigurationParameters = {}) { + if (apiKeys) { + this.apiKeys = apiKeys; + } + if (username !== undefined) { + this.username = username; + } + if (password !== undefined) { + this.password = password; + } + if (accessToken !== undefined) { + this.accessToken = accessToken; + } + if (basePath !== undefined) { + this.basePath = basePath; + } + if (withCredentials !== undefined) { + this.withCredentials = withCredentials; + } + if (encoder) { + this.encoder = encoder; + } + this.encodeParam = encodeParam ?? (param => this.defaultEncodeParam(param)); + this.credentials = credentials ?? {}; - // init default HTTPBearer credential - if (!this.credentials['HTTPBearer']) { - this.credentials['HTTPBearer'] = () => { - return typeof this.accessToken === 'function' - ? this.accessToken() - : this.accessToken; - }; - } - } - - /** - * Select the correct content-type to use for a request. - * Uses {@link Configuration#isJsonMime} to determine the correct content-type. - * If no content type is found return the first found type if the contentTypes is not empty - * @param contentTypes - the array of content types that are available for selection - * @returns the selected content-type or undefined if no selection could be made. - */ - public selectHeaderContentType(contentTypes: string[]): string | undefined { - if (contentTypes.length === 0) { - return undefined; + // init default HTTPBearer credential + if (!this.credentials['HTTPBearer']) { + this.credentials['HTTPBearer'] = () => { + return typeof this.accessToken === 'function' + ? this.accessToken() + : this.accessToken; + }; + } } - const type = contentTypes.find((x: string) => this.isJsonMime(x)); - if (type === undefined) { - return contentTypes[0]; - } - return type; - } + /** + * Select the correct content-type to use for a request. + * Uses {@link Configuration#isJsonMime} to determine the correct content-type. + * If no content type is found return the first found type if the contentTypes is not empty + * @param contentTypes - the array of content types that are available for selection + * @returns the selected content-type or undefined if no selection could be made. + */ + public selectHeaderContentType (contentTypes: string[]): string | undefined { + if (contentTypes.length === 0) { + return undefined; + } - /** - * Select the correct accept content-type to use for a request. - * Uses {@link Configuration#isJsonMime} to determine the correct accept content-type. - * If no content type is found return the first found type if the contentTypes is not empty - * @param accepts - the array of content types that are available for selection. - * @returns the selected content-type or undefined if no selection could be made. - */ - public selectHeaderAccept(accepts: string[]): string | undefined { - if (accepts.length === 0) { - return undefined; + const type = contentTypes.find((x: string) => this.isJsonMime(x)); + if (type === undefined) { + return contentTypes[0]; + } + return type; } - const type = accepts.find((x: string) => this.isJsonMime(x)); - if (type === undefined) { - return accepts[0]; + /** + * Select the correct accept content-type to use for a request. + * Uses {@link Configuration#isJsonMime} to determine the correct accept content-type. + * If no content type is found return the first found type if the contentTypes is not empty + * @param accepts - the array of content types that are available for selection. + * @returns the selected content-type or undefined if no selection could be made. + */ + public selectHeaderAccept(accepts: string[]): string | undefined { + if (accepts.length === 0) { + return undefined; + } + + const type = accepts.find((x: string) => this.isJsonMime(x)); + if (type === undefined) { + return accepts[0]; + } + return type; } - return type; - } - /** - * Check if the given MIME is a JSON MIME. - * JSON MIME examples: - * application/json - * application/json; charset=UTF8 - * APPLICATION/JSON - * application/vnd.company+json - * @param mime - MIME (Multipurpose Internet Mail Extensions) - * @return True if the given MIME is JSON, false otherwise. - */ - public isJsonMime(mime: string): boolean { - const jsonMime: RegExp = new RegExp( - '^(application\/json|[^;/ \t]+\/[^;/ \t]+[+]json)[ \t]*(;.*)?$', - 'i', - ); - return ( - mime !== null && - (jsonMime.test(mime) || - mime.toLowerCase() === 'application/json-patch+json') - ); - } + /** + * Check if the given MIME is a JSON MIME. + * JSON MIME examples: + * application/json + * application/json; charset=UTF8 + * APPLICATION/JSON + * application/vnd.company+json + * @param mime - MIME (Multipurpose Internet Mail Extensions) + * @return True if the given MIME is JSON, false otherwise. + */ + public isJsonMime(mime: string): boolean { + const jsonMime: RegExp = new RegExp('^(application\/json|[^;/ \t]+\/[^;/ \t]+[+]json)[ \t]*(;.*)?$', 'i'); + return mime !== null && (jsonMime.test(mime) || mime.toLowerCase() === 'application/json-patch+json'); + } - public lookupCredential(key: string): string | undefined { - const value = this.credentials[key]; - return typeof value === 'function' ? value() : value; - } + public lookupCredential(key: string): string | undefined { + const value = this.credentials[key]; + return typeof value === 'function' + ? value() + : value; + } - public addCredentialToHeaders( - credentialKey: string, - headerName: string, - headers: HttpHeaders, - prefix?: string, - ): HttpHeaders { - const value = this.lookupCredential(credentialKey); - return value ? headers.set(headerName, (prefix ?? '') + value) : headers; - } + public addCredentialToHeaders(credentialKey: string, headerName: string, headers: HttpHeaders, prefix?: string): HttpHeaders { + const value = this.lookupCredential(credentialKey); + return value + ? headers.set(headerName, (prefix ?? '') + value) + : headers; + } - public addCredentialToQuery( - credentialKey: string, - paramName: string, - query: HttpParams, - ): HttpParams { - const value = this.lookupCredential(credentialKey); - return value ? query.set(paramName, value) : query; - } + public addCredentialToQuery(credentialKey: string, paramName: string, query: HttpParams): HttpParams { + const value = this.lookupCredential(credentialKey); + return value + ? query.set(paramName, value) + : query; + } - private defaultEncodeParam(param: Param): string { - // This implementation exists as fallback for missing configuration - // and for backwards compatibility to older typescript-angular generator versions. - // It only works for the 'simple' parameter style. - // Date-handling only works for the 'date-time' format. - // All other styles and Date-formats are probably handled incorrectly. - // - // But: if that's all you need (i.e.: the most common use-case): no need for customization! + private defaultEncodeParam(param: Param): string { + // This implementation exists as fallback for missing configuration + // and for backwards compatibility to older typescript-angular generator versions. + // It only works for the 'simple' parameter style. + // Date-handling only works for the 'date-time' format. + // All other styles and Date-formats are probably handled incorrectly. + // + // But: if that's all you need (i.e.: the most common use-case): no need for customization! - const value = - param.dataFormat === 'date-time' && param.value instanceof Date - ? (param.value as Date).toISOString() - : param.value; + const value = param.dataFormat === 'date-time' && param.value instanceof Date + ? (param.value as Date).toISOString() + : param.value; - return encodeURIComponent(String(value)); - } + return encodeURIComponent(String(value)); + } } diff --git a/webapp/src/app/api/encoder.ts b/webapp/src/app/api/encoder.ts index 889ef00d..138c4d5c 100644 --- a/webapp/src/app/api/encoder.ts +++ b/webapp/src/app/api/encoder.ts @@ -5,16 +5,16 @@ import { HttpParameterCodec } from '@angular/common/http'; * Workaround for https://github.com/angular/angular/issues/18261 */ export class CustomHttpParameterCodec implements HttpParameterCodec { - encodeKey(k: string): string { - return encodeURIComponent(k); - } - encodeValue(v: string): string { - return encodeURIComponent(v); - } - decodeKey(k: string): string { - return decodeURIComponent(k); - } - decodeValue(v: string): string { - return decodeURIComponent(v); - } + encodeKey(k: string): string { + return encodeURIComponent(k); + } + encodeValue(v: string): string { + return encodeURIComponent(v); + } + decodeKey(k: string): string { + return decodeURIComponent(k); + } + decodeValue(v: string): string { + return decodeURIComponent(v); + } } diff --git a/webapp/src/app/api/model/accessResponse.ts b/webapp/src/app/api/model/accessResponse.ts index 2a188f73..6a36e872 100644 --- a/webapp/src/app/api/model/accessResponse.ts +++ b/webapp/src/app/api/model/accessResponse.ts @@ -1,7 +1,7 @@ /** * Innovation Search Engine API * - * + * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech @@ -9,9 +9,11 @@ */ import { AccessToken } from './accessToken'; -export interface AccessResponse { - /** - * The access token issued upon successful authentication. - */ - access_token: AccessToken; + +export interface AccessResponse { + /** + * The access token issued upon successful authentication. + */ + access_token: AccessToken; } + diff --git a/webapp/src/app/api/model/accessToken.ts b/webapp/src/app/api/model/accessToken.ts index 9505d3c6..74c4d45a 100644 --- a/webapp/src/app/api/model/accessToken.ts +++ b/webapp/src/app/api/model/accessToken.ts @@ -1,7 +1,7 @@ /** * Innovation Search Engine API * - * + * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech @@ -10,46 +10,51 @@ import { TokenType } from './tokenType'; import { UserRole } from './userRole'; -export interface AccessToken { - /** - * The unique identifier of the real account associated with this token. - */ - real_account_id: string; - /** - * The timestamp indicating when the token will expire. - */ - expires_at: string; - /** - * The epoch value for the token. Used for versioning of tokens. - */ - epoch?: number; - /** - * The type of the token, which is always ACCESS_TOKEN for this class. - */ - token_type?: TokenType; - /** - * A unique fingerprint of the user, used for additional security checks. - */ - user_fingerprint_hash: string; - /** - * The unique identifier of the effective account associated with this access token. This may differ from the real account ID due to account impersonation. - */ - effective_account_id: string; - /** - * The specific role this access token grants within its organization. - */ - effective_role?: UserRole; - /** - * The roles this access token grants within its organization. - */ - effective_roles?: Array; - /** - * The unique identifier of the organization associated with this access token. - */ - effective_organization_id: string; - /** - * The raw string representation of the access token. This is the actual token that can be used for authentication and authorization purposes. - */ - raw_token: string; + +export interface AccessToken { + /** + * The unique identifier of the real account associated with this token. + */ + real_account_id: string; + /** + * The timestamp indicating when the token will expire. + */ + expires_at: string; + /** + * The epoch value for the token. Used for versioning of tokens. + */ + epoch?: number; + /** + * The type of the token, which is always ACCESS_TOKEN for this class. + */ + token_type?: TokenType; + /** + * A unique fingerprint of the user, used for additional security checks. + */ + user_fingerprint_hash: string; + /** + * The unique identifier of the effective account associated with this access token. This may differ from the real account ID due to account impersonation. + */ + effective_account_id: string; + /** + * The specific role this access token grants within its organization. + */ + effective_role?: UserRole; + /** + * The roles this access token grants within its organization. + */ + effective_roles?: Array; + /** + * The unique identifier of the organization associated with this access token. + */ + effective_organization_id: string; + effective_institution_id?: string | null; + /** + * The raw string representation of the access token. This is the actual token that can be used for authentication and authorization purposes. + */ + raw_token: string; } -export namespace AccessToken {} +export namespace AccessToken { +} + + diff --git a/webapp/src/app/api/model/accountPage.ts b/webapp/src/app/api/model/accountPage.ts index 64c7f969..c92c4ba3 100644 --- a/webapp/src/app/api/model/accountPage.ts +++ b/webapp/src/app/api/model/accountPage.ts @@ -1,7 +1,7 @@ /** * Innovation Search Engine API * - * + * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech @@ -9,9 +9,11 @@ */ import { AccountProfile } from './accountProfile'; -export interface AccountPage { - items: Array; - total: number; - page: number; - page_size: number; + +export interface AccountPage { + items: Array; + total: number; + page: number; + page_size: number; } + diff --git a/webapp/src/app/api/model/accountProfile.ts b/webapp/src/app/api/model/accountProfile.ts index a61b98ae..a7d7afa5 100644 --- a/webapp/src/app/api/model/accountProfile.ts +++ b/webapp/src/app/api/model/accountProfile.ts @@ -1,7 +1,7 @@ /** * Innovation Search Engine API * - * + * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech @@ -9,16 +9,18 @@ */ import { UserRole } from './userRole'; -export interface AccountProfile { - id: string; - email: string; - name: string; - roles: Array; - organization_id: string; - organization_name: string; - deleted: boolean; - activated: boolean; - is_current?: boolean; - is_real_account?: boolean; - is_impersonating?: boolean; + +export interface AccountProfile { + id: string; + email: string; + name: string; + roles: Array; + organization_id: string; + organization_name: string; + deleted: boolean; + activated: boolean; + is_current?: boolean; + is_real_account?: boolean; + is_impersonating?: boolean; } + diff --git a/webapp/src/app/api/model/allPatentsResponse.ts b/webapp/src/app/api/model/allPatentsResponse.ts index f9b5e8ad..dfe6fb24 100644 --- a/webapp/src/app/api/model/allPatentsResponse.ts +++ b/webapp/src/app/api/model/allPatentsResponse.ts @@ -1,7 +1,7 @@ /** * Innovation Search Engine API * - * + * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech @@ -9,9 +9,11 @@ */ import { PatentEntry } from './patentEntry'; -export interface AllPatentsResponse { - total: number; - page: number; - size: number; - patents: Array; + +export interface AllPatentsResponse { + total: number; + page: number; + size: number; + patents: Array; } + diff --git a/webapp/src/app/api/model/author.ts b/webapp/src/app/api/model/author.ts index 0a050590..9ba12273 100644 --- a/webapp/src/app/api/model/author.ts +++ b/webapp/src/app/api/model/author.ts @@ -1,7 +1,7 @@ /** * Innovation Search Engine API * - * + * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech @@ -15,25 +15,27 @@ import { AuthorIds } from './authorIds'; import { AuthorSummaryStats } from './authorSummaryStats'; import { WorkTopic } from './workTopic'; + /** * A person who creates scholarly works */ -export interface Author { - id?: string | null; - orcid?: string | null; - display_name?: string | null; - display_name_alternatives?: Array | null; - longest_name?: string | null; - parsed_longest_name?: AuthorParsedLongestName | null; - works_count?: number | null; - cited_by_count?: number | null; - summary_stats?: AuthorSummaryStats | null; - affiliations?: Array | null; - last_known_institutions?: Array | null; - topics?: Array | null; - counts_by_year?: Array | null; - ids?: AuthorIds | null; - works_api_url?: string | null; - created_date?: string | null; - updated_date?: string | null; +export interface Author { + id?: string | null; + orcid?: string | null; + display_name?: string | null; + display_name_alternatives?: Array | null; + longest_name?: string | null; + parsed_longest_name?: AuthorParsedLongestName | null; + works_count?: number | null; + cited_by_count?: number | null; + summary_stats?: AuthorSummaryStats | null; + affiliations?: Array | null; + last_known_institutions?: Array | null; + topics?: Array | null; + counts_by_year?: Array | null; + ids?: AuthorIds | null; + works_api_url?: string | null; + created_date?: string | null; + updated_date?: string | null; } + diff --git a/webapp/src/app/api/model/authorAffiliationsInner.ts b/webapp/src/app/api/model/authorAffiliationsInner.ts index d1e8f764..270443ff 100644 --- a/webapp/src/app/api/model/authorAffiliationsInner.ts +++ b/webapp/src/app/api/model/authorAffiliationsInner.ts @@ -1,7 +1,7 @@ /** * Innovation Search Engine API * - * + * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech @@ -9,10 +9,12 @@ */ import { DehydratedInstitution } from './dehydratedInstitution'; + /** * AuthorAffiliationsInner */ -export interface AuthorAffiliationsInner { - institution?: DehydratedInstitution | null; - years?: Array | null; +export interface AuthorAffiliationsInner { + institution?: DehydratedInstitution | null; + years?: Array | null; } + diff --git a/webapp/src/app/api/model/authorCountsByYearInner.ts b/webapp/src/app/api/model/authorCountsByYearInner.ts index 1fac5b45..d16c7c21 100644 --- a/webapp/src/app/api/model/authorCountsByYearInner.ts +++ b/webapp/src/app/api/model/authorCountsByYearInner.ts @@ -1,18 +1,20 @@ /** * Innovation Search Engine API * - * + * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech * Do not edit the class manually. */ + /** * AuthorCountsByYearInner */ -export interface AuthorCountsByYearInner { - year?: number | null; - works_count?: number | null; - cited_by_count?: number | null; +export interface AuthorCountsByYearInner { + year?: number | null; + works_count?: number | null; + cited_by_count?: number | null; } + diff --git a/webapp/src/app/api/model/authorIds.ts b/webapp/src/app/api/model/authorIds.ts index 0b079d33..9235a207 100644 --- a/webapp/src/app/api/model/authorIds.ts +++ b/webapp/src/app/api/model/authorIds.ts @@ -1,18 +1,20 @@ /** * Innovation Search Engine API * - * + * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech * Do not edit the class manually. */ + /** * External identifiers: */ -export interface AuthorIds { - openalex?: string | null; - orcid?: string | null; - scopus?: string | null; +export interface AuthorIds { + openalex?: string | null; + orcid?: string | null; + scopus?: string | null; } + diff --git a/webapp/src/app/api/model/authorNetworkNode.ts b/webapp/src/app/api/model/authorNetworkNode.ts index f67c7148..aee98d47 100644 --- a/webapp/src/app/api/model/authorNetworkNode.ts +++ b/webapp/src/app/api/model/authorNetworkNode.ts @@ -1,7 +1,7 @@ /** * Innovation Search Engine API * - * + * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech @@ -9,18 +9,22 @@ */ import { CollaborationNetworkNodeType } from './collaborationNetworkNodeType'; -export interface AuthorNetworkNode { - /** - * The raw ID of the node. For an author node, this is the raw person ID. For an institution node, this is the raw institution ID. For a work node, this is the raw work ID. - */ - raw_id: string; - /** - * The display name of the node. - */ - display_name: string; - /** - * The category of the node, either \'author\', \'institution\', or \'work\'. - */ - category: CollaborationNetworkNodeType; + +export interface AuthorNetworkNode { + /** + * The raw ID of the node. For an author node, this is the raw person ID. For an institution node, this is the raw institution ID. For a work node, this is the raw work ID. + */ + raw_id: string; + /** + * The display name of the node. + */ + display_name: string; + /** + * The category of the node, either \'author\', \'institution\', or \'work\'. + */ + category: CollaborationNetworkNodeType; } -export namespace AuthorNetworkNode {} +export namespace AuthorNetworkNode { +} + + diff --git a/webapp/src/app/api/model/authorPage.ts b/webapp/src/app/api/model/authorPage.ts new file mode 100644 index 00000000..456cadbc --- /dev/null +++ b/webapp/src/app/api/model/authorPage.ts @@ -0,0 +1,31 @@ +/** + * Innovation Search Engine API + * + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ +import { Author } from './author'; + + +export interface AuthorPage { + /** + * The elements of the page. + */ + elements?: Array; + /** + * The page number. (0-based) + */ + page?: number; + /** + * The page size in elements. + */ + size?: number; + /** + * The total number of elements. + */ + total?: number; +} + diff --git a/webapp/src/app/api/model/authorParsedLongestName.ts b/webapp/src/app/api/model/authorParsedLongestName.ts index f08df27d..f49e04be 100644 --- a/webapp/src/app/api/model/authorParsedLongestName.ts +++ b/webapp/src/app/api/model/authorParsedLongestName.ts @@ -1,20 +1,22 @@ /** * Innovation Search Engine API * - * + * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech * Do not edit the class manually. */ + /** * The longest name parsed into its component parts. */ -export interface AuthorParsedLongestName { - first?: string | null; - middle?: string | null; - last?: string | null; - suffix?: string | null; - nickname?: string | null; +export interface AuthorParsedLongestName { + first?: string | null; + middle?: string | null; + last?: string | null; + suffix?: string | null; + nickname?: string | null; } + diff --git a/webapp/src/app/api/model/authorPositionCount.ts b/webapp/src/app/api/model/authorPositionCount.ts index 989d2c18..a02e3749 100644 --- a/webapp/src/app/api/model/authorPositionCount.ts +++ b/webapp/src/app/api/model/authorPositionCount.ts @@ -1,16 +1,18 @@ /** * Innovation Search Engine API * - * + * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech * Do not edit the class manually. */ -export interface AuthorPositionCount { - first?: number; - middle?: number; - last?: number; - unknown?: number; + +export interface AuthorPositionCount { + first?: number; + middle?: number; + last?: number; + unknown?: number; } + diff --git a/webapp/src/app/api/model/authorSummaryStats.ts b/webapp/src/app/api/model/authorSummaryStats.ts index 63c35c31..1cfc0bdb 100644 --- a/webapp/src/app/api/model/authorSummaryStats.ts +++ b/webapp/src/app/api/model/authorSummaryStats.ts @@ -1,7 +1,7 @@ /** * Innovation Search Engine API * - * + * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech @@ -9,11 +9,13 @@ */ import { Model2YrMeanCitedness } from './model2YrMeanCitedness'; + /** * Citation metrics: */ -export interface AuthorSummaryStats { - '2yr_mean_citedness'?: Model2YrMeanCitedness | null; - h_index?: number | null; - i10_index?: number | null; +export interface AuthorSummaryStats { + '2yr_mean_citedness'?: Model2YrMeanCitedness | null; + h_index?: number | null; + i10_index?: number | null; } + diff --git a/webapp/src/app/api/model/authorsFilterProperties.ts b/webapp/src/app/api/model/authorsFilterProperties.ts index 50795f2a..7312558f 100644 --- a/webapp/src/app/api/model/authorsFilterProperties.ts +++ b/webapp/src/app/api/model/authorsFilterProperties.ts @@ -1,24 +1,26 @@ /** * Innovation Search Engine API * - * + * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech * Do not edit the class manually. */ -export interface AuthorsFilterProperties { - /** - * The list of raw institution IDs to include in the collaboration network. If empty, all institutions will be included. - */ - allowed_institutions?: Array; - /** - * The minimum number of collaborations required for an author to be included in the collaboration network. - */ - min_collaborations?: number; - /** - * The maximum number of collaborations allowed for an author to be included in the collaboration network. - */ - max_collaborations?: number; + +export interface AuthorsFilterProperties { + /** + * The list of raw institution IDs to include in the collaboration network. If empty, all institutions will be included. + */ + allowed_institutions?: Array; + /** + * The minimum number of collaborations required for an author to be included in the collaboration network. + */ + min_collaborations?: number; + /** + * The maximum number of collaborations allowed for an author to be included in the collaboration network. + */ + max_collaborations?: number; } + diff --git a/webapp/src/app/api/model/authorsListResponse.ts b/webapp/src/app/api/model/authorsListResponse.ts index bb1a602c..d309ae43 100644 --- a/webapp/src/app/api/model/authorsListResponse.ts +++ b/webapp/src/app/api/model/authorsListResponse.ts @@ -1,7 +1,7 @@ /** * Innovation Search Engine API * - * + * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech @@ -11,11 +11,13 @@ import { Meta } from './meta'; import { Author } from './author'; import { GroupByResult } from './groupByResult'; + /** * AuthorsListResponse */ -export interface AuthorsListResponse { - meta?: Meta | null; - results?: Array | null; - group_by?: Array | null; +export interface AuthorsListResponse { + meta?: Meta | null; + results?: Array | null; + group_by?: Array | null; } + diff --git a/webapp/src/app/api/model/authorship.ts b/webapp/src/app/api/model/authorship.ts index f1b9d48e..db3a0bf0 100644 --- a/webapp/src/app/api/model/authorship.ts +++ b/webapp/src/app/api/model/authorship.ts @@ -1,7 +1,7 @@ /** * Innovation Search Engine API * - * + * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech @@ -10,15 +10,17 @@ import { DehydratedInstitution } from './dehydratedInstitution'; import { DehydratedAuthor } from './dehydratedAuthor'; + /** * Author and their affiliation for a work */ -export interface Authorship { - author_position?: string | null; - author?: DehydratedAuthor | null; - institutions?: Array | null; - countries?: Array | null; - is_corresponding?: boolean | null; - raw_author_name?: string | null; - raw_affiliation_strings?: Array | null; +export interface Authorship { + author_position?: string | null; + author?: DehydratedAuthor | null; + institutions?: Array | null; + countries?: Array | null; + is_corresponding?: boolean | null; + raw_author_name?: string | null; + raw_affiliation_strings?: Array | null; } + diff --git a/webapp/src/app/api/model/autocompleteLocationItem.ts b/webapp/src/app/api/model/autocompleteLocationItem.ts index b07e699e..56a10e09 100644 --- a/webapp/src/app/api/model/autocompleteLocationItem.ts +++ b/webapp/src/app/api/model/autocompleteLocationItem.ts @@ -1,23 +1,26 @@ /** * Innovation Search Engine API * - * + * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech * Do not edit the class manually. */ -export interface AutocompleteLocationItem { - id: string; - display_name: string; - code: string; - type: AutocompleteLocationItem.TypeEnum; + +export interface AutocompleteLocationItem { + id: string; + display_name: string; + code: string; + type: AutocompleteLocationItem.TypeEnum; } export namespace AutocompleteLocationItem { - export const TypeEnum = { - Country: 'country', - Continent: 'continent', - } as const; - export type TypeEnum = (typeof TypeEnum)[keyof typeof TypeEnum]; + export const TypeEnum = { + Country: 'country', + Continent: 'continent' + } as const; + export type TypeEnum = typeof TypeEnum[keyof typeof TypeEnum]; } + + diff --git a/webapp/src/app/api/model/autocompleteResponse.ts b/webapp/src/app/api/model/autocompleteResponse.ts index 8b52b300..e220f57b 100644 --- a/webapp/src/app/api/model/autocompleteResponse.ts +++ b/webapp/src/app/api/model/autocompleteResponse.ts @@ -1,7 +1,7 @@ /** * Innovation Search Engine API * - * + * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech @@ -10,10 +10,12 @@ import { AutocompleteResponseMeta } from './autocompleteResponseMeta'; import { AutocompleteResponseResultsInner } from './autocompleteResponseResultsInner'; + /** * AutocompleteResponse */ -export interface AutocompleteResponse { - meta?: AutocompleteResponseMeta | null; - results?: Array | null; +export interface AutocompleteResponse { + meta?: AutocompleteResponseMeta | null; + results?: Array | null; } + diff --git a/webapp/src/app/api/model/autocompleteResponseMeta.ts b/webapp/src/app/api/model/autocompleteResponseMeta.ts index 5bf94a57..2e080d39 100644 --- a/webapp/src/app/api/model/autocompleteResponseMeta.ts +++ b/webapp/src/app/api/model/autocompleteResponseMeta.ts @@ -1,17 +1,19 @@ /** * Innovation Search Engine API * - * + * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech * Do not edit the class manually. */ + /** * AutocompleteResponseMeta */ -export interface AutocompleteResponseMeta { - count?: number | null; - db_response_time_ms?: number | null; +export interface AutocompleteResponseMeta { + count?: number | null; + db_response_time_ms?: number | null; } + diff --git a/webapp/src/app/api/model/autocompleteResponseResultsInner.ts b/webapp/src/app/api/model/autocompleteResponseResultsInner.ts index 0fa956b7..99ba71fe 100644 --- a/webapp/src/app/api/model/autocompleteResponseResultsInner.ts +++ b/webapp/src/app/api/model/autocompleteResponseResultsInner.ts @@ -1,22 +1,24 @@ /** * Innovation Search Engine API * - * + * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech * Do not edit the class manually. */ + /** * AutocompleteResponseResultsInner */ -export interface AutocompleteResponseResultsInner { - id?: string | null; - display_name?: string | null; - hint?: string | null; - cited_by_count?: number | null; - works_count?: number | null; - entity_type?: string | null; - external_id?: string | null; +export interface AutocompleteResponseResultsInner { + id?: string | null; + display_name?: string | null; + hint?: string | null; + cited_by_count?: number | null; + works_count?: number | null; + entity_type?: string | null; + external_id?: string | null; } + diff --git a/webapp/src/app/api/model/award.ts b/webapp/src/app/api/model/award.ts index a461c971..4e3b5cc9 100644 --- a/webapp/src/app/api/model/award.ts +++ b/webapp/src/app/api/model/award.ts @@ -1,21 +1,23 @@ /** * Innovation Search Engine API * - * + * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech * Do not edit the class manually. */ + /** * Award */ -export interface Award { - id?: string | null; - display_name?: string | null; - funder_award_id?: string | null; - funder_id?: string | null; - funder_display_name?: string | null; - doi?: string | null; +export interface Award { + id?: string | null; + display_name?: string | null; + funder_award_id?: string | null; + funder_id?: string | null; + funder_display_name?: string | null; + doi?: string | null; } + diff --git a/webapp/src/app/api/model/bodyChangePassword.ts b/webapp/src/app/api/model/bodyChangePassword.ts index c76bafc4..b6454f0e 100644 --- a/webapp/src/app/api/model/bodyChangePassword.ts +++ b/webapp/src/app/api/model/bodyChangePassword.ts @@ -1,20 +1,22 @@ /** * Innovation Search Engine API * - * + * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech * Do not edit the class manually. */ -export interface BodyChangePassword { - /** - * Current password - */ - current_password: string; - /** - * New password - */ - new_password: string; + +export interface BodyChangePassword { + /** + * Current password + */ + current_password: string; + /** + * New password + */ + new_password: string; } + diff --git a/webapp/src/app/api/model/bodyGetAccessToken.ts b/webapp/src/app/api/model/bodyGetAccessToken.ts index 3314146a..8e5df2ed 100644 --- a/webapp/src/app/api/model/bodyGetAccessToken.ts +++ b/webapp/src/app/api/model/bodyGetAccessToken.ts @@ -1,20 +1,22 @@ /** * Innovation Search Engine API * - * + * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech * Do not edit the class manually. */ -export interface BodyGetAccessToken { - /** - * User\'s account ID - */ - real_account_id: string; - /** - * Effective account ID for the access token - */ - effective_account_id: string; + +export interface BodyGetAccessToken { + /** + * User\'s account ID + */ + real_account_id: string; + /** + * Effective account ID for the access token + */ + effective_account_id: string; } + diff --git a/webapp/src/app/api/model/bodyLogin.ts b/webapp/src/app/api/model/bodyLogin.ts index e4e8efd6..f4022b0b 100644 --- a/webapp/src/app/api/model/bodyLogin.ts +++ b/webapp/src/app/api/model/bodyLogin.ts @@ -1,20 +1,22 @@ /** * Innovation Search Engine API * - * + * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech * Do not edit the class manually. */ -export interface BodyLogin { - /** - * User\'s account ID - */ - account_id: string; - /** - * One-time code sent to user\'s email - */ - email_code: string; + +export interface BodyLogin { + /** + * User\'s account ID + */ + account_id: string; + /** + * One-time code sent to user\'s email + */ + email_code: string; } + diff --git a/webapp/src/app/api/model/bodyRequestOtk.ts b/webapp/src/app/api/model/bodyRequestOtk.ts index 1600a002..ba1a396d 100644 --- a/webapp/src/app/api/model/bodyRequestOtk.ts +++ b/webapp/src/app/api/model/bodyRequestOtk.ts @@ -1,20 +1,22 @@ /** * Innovation Search Engine API * - * + * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech * Do not edit the class manually. */ -export interface BodyRequestOtk { - /** - * User\'s email address - */ - email: string; - /** - * User\'s password - */ - password: string; + +export interface BodyRequestOtk { + /** + * User\'s email address + */ + email: string; + /** + * User\'s password + */ + password: string; } + diff --git a/webapp/src/app/api/model/bodyRequestPasswordReset.ts b/webapp/src/app/api/model/bodyRequestPasswordReset.ts index ec3222b5..2c9b4b13 100644 --- a/webapp/src/app/api/model/bodyRequestPasswordReset.ts +++ b/webapp/src/app/api/model/bodyRequestPasswordReset.ts @@ -1,16 +1,18 @@ /** * Innovation Search Engine API * - * + * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech * Do not edit the class manually. */ -export interface BodyRequestPasswordReset { - /** - * User\'s email address - */ - email: string; + +export interface BodyRequestPasswordReset { + /** + * User\'s email address + */ + email: string; } + diff --git a/webapp/src/app/api/model/bodyResetPassword.ts b/webapp/src/app/api/model/bodyResetPassword.ts index 0e3b74aa..03e63c44 100644 --- a/webapp/src/app/api/model/bodyResetPassword.ts +++ b/webapp/src/app/api/model/bodyResetPassword.ts @@ -1,20 +1,22 @@ /** * Innovation Search Engine API * - * + * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech * Do not edit the class manually. */ -export interface BodyResetPassword { - /** - * Password reset token from the reset link - */ - reset_token: string; - /** - * New password - */ - new_password: string; + +export interface BodyResetPassword { + /** + * Password reset token from the reset link + */ + reset_token: string; + /** + * New password + */ + new_password: string; } + diff --git a/webapp/src/app/api/model/bundProject.ts b/webapp/src/app/api/model/bundProject.ts index 9f291399..3463aa78 100644 --- a/webapp/src/app/api/model/bundProject.ts +++ b/webapp/src/app/api/model/bundProject.ts @@ -1,40 +1,42 @@ /** * Innovation Search Engine API * - * + * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech * Do not edit the class manually. */ -export interface BundProject { - funding_code?: string | null; - department?: string | null; - department_fullname?: string | null; - referat?: string | null; - project_sponsor?: string | null; - project_sponsor_fullname?: string | null; - work_unit?: string | null; - recipient?: string | null; - municipal_code?: string | null; - municipality?: string | null; - place?: string | null; - state?: string | null; - country?: string | null; - implementing_agency?: string | null; - topic?: string | null; - performance_plan_system?: string | null; - performance_plan_system_text?: string | null; - funding_start?: string | null; - funding_end?: string | null; - grant_amount?: number | null; - funding_profile?: string | null; - joint_project?: string | null; - funding_type?: string | null; - publication_date?: string | null; - unix_timestamp?: number | null; - date?: string | null; - new?: boolean | null; - duration?: string | null; + +export interface BundProject { + funding_code?: string | null; + department?: string | null; + department_fullname?: string | null; + referat?: string | null; + project_sponsor?: string | null; + project_sponsor_fullname?: string | null; + work_unit?: string | null; + recipient?: string | null; + municipal_code?: string | null; + municipality?: string | null; + place?: string | null; + state?: string | null; + country?: string | null; + implementing_agency?: string | null; + topic?: string | null; + performance_plan_system?: string | null; + performance_plan_system_text?: string | null; + funding_start?: string | null; + funding_end?: string | null; + grant_amount?: number | null; + funding_profile?: string | null; + joint_project?: string | null; + funding_type?: string | null; + publication_date?: string | null; + unix_timestamp?: number | null; + date?: string | null; + 'new'?: boolean | null; + duration?: string | null; } + diff --git a/webapp/src/app/api/model/bundProjectDetails.ts b/webapp/src/app/api/model/bundProjectDetails.ts index b61df06b..2193563c 100644 --- a/webapp/src/app/api/model/bundProjectDetails.ts +++ b/webapp/src/app/api/model/bundProjectDetails.ts @@ -1,55 +1,57 @@ /** * Innovation Search Engine API * - * + * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech * Do not edit the class manually. */ + /** * Clean summary model for a Bund (federal) project, consolidating all fields into semantic English names with proper native types. */ -export interface BundProjectDetails { - /** - * The ID of the Bund project - */ - id: string; - funding_reference?: string | null; - title?: string | null; - description?: string | null; - joint_project?: string | null; - funding_type?: string | null; - funding_profile?: string | null; - funding_amount?: number | null; - funding_start_date?: string | null; - funding_end_date?: string | null; - duration?: string | null; - performance_plan_code?: string | null; - performance_plan_fullname?: string | null; - executing_agency?: string | null; - funding_recipient?: string | null; - project_agency?: string | null; - project_agency_fullname?: string | null; - department?: string | null; - department_fullname?: string | null; - division?: string | null; - location?: string | null; - municipality?: string | null; - state?: string | null; - country?: string | null; - municipality_code?: string | null; - publication_date?: string | null; - is_new?: boolean | null; - record_date?: string | null; - unix_timestamp?: number | null; - /** - * All persons associated with the Bund project (from nested Arb object) - */ - associated_persons?: Array; - /** - * All institutions associated with the Bund project - */ - institutions?: Array; +export interface BundProjectDetails { + /** + * The ID of the Bund project + */ + id: string; + funding_reference?: string | null; + title?: string | null; + description?: string | null; + joint_project?: string | null; + funding_type?: string | null; + funding_profile?: string | null; + funding_amount?: number | null; + funding_start_date?: string | null; + funding_end_date?: string | null; + duration?: string | null; + performance_plan_code?: string | null; + performance_plan_fullname?: string | null; + executing_agency?: string | null; + funding_recipient?: string | null; + project_agency?: string | null; + project_agency_fullname?: string | null; + department?: string | null; + department_fullname?: string | null; + division?: string | null; + location?: string | null; + municipality?: string | null; + state?: string | null; + country?: string | null; + municipality_code?: string | null; + publication_date?: string | null; + is_new?: boolean | null; + record_date?: string | null; + unix_timestamp?: number | null; + /** + * All persons associated with the Bund project (from nested Arb object) + */ + associated_persons?: Array; + /** + * All institutions associated with the Bund project + */ + institutions?: Array; } + diff --git a/webapp/src/app/api/model/bundProjectPage.ts b/webapp/src/app/api/model/bundProjectPage.ts index 6c38e7a6..10514bce 100644 --- a/webapp/src/app/api/model/bundProjectPage.ts +++ b/webapp/src/app/api/model/bundProjectPage.ts @@ -1,7 +1,7 @@ /** * Innovation Search Engine API * - * + * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech @@ -9,21 +9,23 @@ */ import { BundProject } from './bundProject'; -export interface BundProjectPage { - /** - * The current page number. - */ - page?: number; - /** - * The requested page size. - */ - size?: number; - /** - * The total number of items. - */ - total?: number; - /** - * The bund projects on this page. - */ - elements?: Array; + +export interface BundProjectPage { + /** + * The current page number. + */ + page?: number; + /** + * The requested page size. + */ + size?: number; + /** + * The total number of items. + */ + total?: number; + /** + * The bund projects on this page. + */ + elements?: Array; } + diff --git a/webapp/src/app/api/model/careerMetrics.ts b/webapp/src/app/api/model/careerMetrics.ts index eb84c19f..abb58689 100644 --- a/webapp/src/app/api/model/careerMetrics.ts +++ b/webapp/src/app/api/model/careerMetrics.ts @@ -1,32 +1,34 @@ /** * Innovation Search Engine API * - * + * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech * Do not edit the class manually. */ -export interface CareerMetrics { - first_publication_year?: number | null; - last_publication_year?: number | null; - career_age?: number | null; - career_span?: number | null; - career_stage?: string | null; - /** - * Number of distinct years with at least one publication. - */ - active_years?: number; - /** - * Number of publications used for career metrics. - */ - publication_count?: number; - publications_per_active_year?: number | null; - publications_per_career_year?: number | null; - years_since_last_publication?: number | null; - /** - * True if publication years look suspicious. - */ - has_suspicious_publication_years?: boolean; + +export interface CareerMetrics { + first_publication_year?: number | null; + last_publication_year?: number | null; + career_age?: number | null; + career_span?: number | null; + career_stage?: string | null; + /** + * Number of distinct years with at least one publication. + */ + active_years?: number; + /** + * Number of publications used for career metrics. + */ + publication_count?: number; + publications_per_active_year?: number | null; + publications_per_career_year?: number | null; + years_since_last_publication?: number | null; + /** + * True if publication years look suspicious. + */ + has_suspicious_publication_years?: boolean; } + diff --git a/webapp/src/app/api/model/collaborationNetwork.ts b/webapp/src/app/api/model/collaborationNetwork.ts index a2fbdc5b..e439c061 100644 --- a/webapp/src/app/api/model/collaborationNetwork.ts +++ b/webapp/src/app/api/model/collaborationNetwork.ts @@ -1,7 +1,7 @@ /** * Innovation Search Engine API * - * + * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech @@ -13,29 +13,31 @@ import { CollaborationNetworkEdge } from './collaborationNetworkEdge'; import { InstitutionNetworkNode } from './institutionNetworkNode'; import { AuthorNetworkNode } from './authorNetworkNode'; -export interface CollaborationNetwork { - /** - * The raw person ID of the person whose collaboration network this is. - */ - raw_person_id: string; - /** - * The work nodes in the collaboration network. - */ - work_nodes: Array; - /** - * The author nodes in the collaboration network. - */ - author_nodes: Array; - /** - * The institution nodes in the collaboration network. - */ - institution_nodes: Array; - /** - * The collaboration edges in the collaboration network. A collaboration edge represents a collaboration between two nodes. A -> W and A -> I - */ - collaboration_edges: Array; - /** - * The filter information for the collaboration network, including the minimum and maximum publication years of the works in the collaboration network. - */ - filter_information: FilterInformation; + +export interface CollaborationNetwork { + /** + * The raw person ID of the person whose collaboration network this is. + */ + raw_person_id: string; + /** + * The work nodes in the collaboration network. + */ + work_nodes: Array; + /** + * The author nodes in the collaboration network. + */ + author_nodes: Array; + /** + * The institution nodes in the collaboration network. + */ + institution_nodes: Array; + /** + * The collaboration edges in the collaboration network. A collaboration edge represents a collaboration between two nodes. A -> W and A -> I + */ + collaboration_edges: Array; + /** + * The filter information for the collaboration network, including the minimum and maximum publication years of the works in the collaboration network. + */ + filter_information: FilterInformation; } + diff --git a/webapp/src/app/api/model/collaborationNetworkEdge.ts b/webapp/src/app/api/model/collaborationNetworkEdge.ts index baffb178..16fb5fc6 100644 --- a/webapp/src/app/api/model/collaborationNetworkEdge.ts +++ b/webapp/src/app/api/model/collaborationNetworkEdge.ts @@ -1,20 +1,22 @@ /** * Innovation Search Engine API * - * + * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech * Do not edit the class manually. */ -export interface CollaborationNetworkEdge { - /** - * The raw ID of the source node. - */ - raw_source_id: string; - /** - * The raw ID of the target node. - */ - raw_target_id: string; + +export interface CollaborationNetworkEdge { + /** + * The raw ID of the source node. + */ + raw_source_id: string; + /** + * The raw ID of the target node. + */ + raw_target_id: string; } + diff --git a/webapp/src/app/api/model/collaborationNetworkNodeType.ts b/webapp/src/app/api/model/collaborationNetworkNodeType.ts index 3e673f35..752e35b0 100644 --- a/webapp/src/app/api/model/collaborationNetworkNodeType.ts +++ b/webapp/src/app/api/model/collaborationNetworkNodeType.ts @@ -1,17 +1,18 @@ /** * Innovation Search Engine API * - * + * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech * Do not edit the class manually. */ + export const CollaborationNetworkNodeType = { - Author: 'author', - Institution: 'institution', - Work: 'work', + Author: 'author', + Institution: 'institution', + Work: 'work' } as const; -export type CollaborationNetworkNodeType = - (typeof CollaborationNetworkNodeType)[keyof typeof CollaborationNetworkNodeType]; +export type CollaborationNetworkNodeType = typeof CollaborationNetworkNodeType[keyof typeof CollaborationNetworkNodeType]; + diff --git a/webapp/src/app/api/model/companyConnection.ts b/webapp/src/app/api/model/companyConnection.ts index 2824c543..4ce31814 100644 --- a/webapp/src/app/api/model/companyConnection.ts +++ b/webapp/src/app/api/model/companyConnection.ts @@ -1,7 +1,7 @@ /** * Innovation Search Engine API * - * + * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech @@ -9,17 +9,19 @@ */ import { MatchedOfficer } from './matchedOfficer'; -export interface CompanyConnection { - company_number?: string | null; - company_name?: string | null; - company_status?: string | null; - register_art?: string | null; - register_nummer?: string | null; - native_company_number?: string | null; - registrar?: string | null; - registered_office?: string | null; - registered_address?: string | null; - retrieved_at?: string | null; - matched_officers?: Array; - officers?: Array; + +export interface CompanyConnection { + company_number?: string | null; + company_name?: string | null; + company_status?: string | null; + register_art?: string | null; + register_nummer?: string | null; + native_company_number?: string | null; + registrar?: string | null; + registered_office?: string | null; + registered_address?: string | null; + retrieved_at?: string | null; + matched_officers?: Array; + officers?: Array; } + diff --git a/webapp/src/app/api/model/companyConnectionsResponse.ts b/webapp/src/app/api/model/companyConnectionsResponse.ts index f4f5f42f..9beabd1e 100644 --- a/webapp/src/app/api/model/companyConnectionsResponse.ts +++ b/webapp/src/app/api/model/companyConnectionsResponse.ts @@ -1,7 +1,7 @@ /** * Innovation Search Engine API * - * + * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech @@ -9,15 +9,17 @@ */ import { CompanyConnection } from './companyConnection'; -export interface CompanyConnectionsResponse { - author_id: string; - display_name?: string | null; - is_ude_author: boolean; - institution_scope?: string | null; - matching_institutions?: Array; - matching_method?: string | null; - company_count: number; - has_more_results: boolean; - common_name_warning: boolean; - connections?: Array; + +export interface CompanyConnectionsResponse { + author_id: string; + display_name?: string | null; + is_ude_author: boolean; + institution_scope?: string | null; + matching_institutions?: Array; + matching_method?: string | null; + company_count: number; + has_more_results: boolean; + common_name_warning: boolean; + connections?: Array; } + diff --git a/webapp/src/app/api/model/cordisEuProject.ts b/webapp/src/app/api/model/cordisEuProject.ts index 8d408ad6..f18dd3d4 100644 --- a/webapp/src/app/api/model/cordisEuProject.ts +++ b/webapp/src/app/api/model/cordisEuProject.ts @@ -1,7 +1,7 @@ /** * Innovation Search Engine API * - * + * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech @@ -10,30 +10,32 @@ import { Keywords } from './keywords'; import { Topics } from './topics'; -export interface CordisEuProject { - /** - * Unique identifier for the project, typically the CORDIS ID - */ - id: string; - rcn?: string | null; - acronym?: string | null; - title?: string | null; - objective?: string | null; - frameworkProgramme?: string | null; - fundingScheme?: string | null; - legalBasis?: string | null; - masterCall?: string | null; - subCall?: string | null; - topics?: Topics | null; - nature?: string | null; - status?: string | null; - ecMaxContribution?: number | null; - totalCost?: number | null; - startDate?: string | null; - endDate?: string | null; - ecSignatureDate?: string | null; - contentUpdateDate?: string | null; - grantDoi?: string | null; - humanValidated?: boolean | null; - keywords?: Keywords | null; + +export interface CordisEuProject { + /** + * Unique identifier for the project, typically the CORDIS ID + */ + id: string; + rcn?: string | null; + acronym?: string | null; + title?: string | null; + objective?: string | null; + frameworkProgramme?: string | null; + fundingScheme?: string | null; + legalBasis?: string | null; + masterCall?: string | null; + subCall?: string | null; + topics?: Topics | null; + nature?: string | null; + status?: string | null; + ecMaxContribution?: number | null; + totalCost?: number | null; + startDate?: string | null; + endDate?: string | null; + ecSignatureDate?: string | null; + contentUpdateDate?: string | null; + grantDoi?: string | null; + humanValidated?: boolean | null; + keywords?: Keywords | null; } + diff --git a/webapp/src/app/api/model/cordisEuProjectPage.ts b/webapp/src/app/api/model/cordisEuProjectPage.ts index 8dc900f7..393f6db8 100644 --- a/webapp/src/app/api/model/cordisEuProjectPage.ts +++ b/webapp/src/app/api/model/cordisEuProjectPage.ts @@ -1,7 +1,7 @@ /** * Innovation Search Engine API * - * + * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech @@ -9,21 +9,23 @@ */ import { CordisEuProject } from './cordisEuProject'; -export interface CordisEuProjectPage { - /** - * The current page number. - */ - page?: number; - /** - * The requested page size. - */ - size?: number; - /** - * The total number of items. - */ - total?: number; - /** - * The CORDIS EU projects on this page. - */ - elements?: Array; + +export interface CordisEuProjectPage { + /** + * The current page number. + */ + page?: number; + /** + * The requested page size. + */ + size?: number; + /** + * The total number of items. + */ + total?: number; + /** + * The CORDIS EU projects on this page. + */ + elements?: Array; } + diff --git a/webapp/src/app/api/model/costUsd.ts b/webapp/src/app/api/model/costUsd.ts index 494cb094..c7bcbee8 100644 --- a/webapp/src/app/api/model/costUsd.ts +++ b/webapp/src/app/api/model/costUsd.ts @@ -1,14 +1,17 @@ /** * Innovation Search Engine API * - * + * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech * Do not edit the class manually. */ + /** * Cost of this request in USD */ -export interface CostUsd {} +export interface CostUsd { +} + diff --git a/webapp/src/app/api/model/createAccountRequest.ts b/webapp/src/app/api/model/createAccountRequest.ts index c38fce15..b2393cc2 100644 --- a/webapp/src/app/api/model/createAccountRequest.ts +++ b/webapp/src/app/api/model/createAccountRequest.ts @@ -1,7 +1,7 @@ /** * Innovation Search Engine API * - * + * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech @@ -9,11 +9,13 @@ */ import { UserRole } from './userRole'; -export interface CreateAccountRequest { - email: string; - name: string; - roles?: Array; - organization_id: string; - password: string; - openalex_person_id?: string | null; + +export interface CreateAccountRequest { + email: string; + name: string; + roles?: Array; + organization_id: string; + password: string; + openalex_person_id?: string | null; } + diff --git a/webapp/src/app/api/model/createOrganizationRequest.ts b/webapp/src/app/api/model/createOrganizationRequest.ts index 94aacb80..fffb5457 100644 --- a/webapp/src/app/api/model/createOrganizationRequest.ts +++ b/webapp/src/app/api/model/createOrganizationRequest.ts @@ -1,14 +1,16 @@ /** * Innovation Search Engine API * - * + * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech * Do not edit the class manually. */ -export interface CreateOrganizationRequest { - name: string; - other_inst_id?: string | null; + +export interface CreateOrganizationRequest { + name: string; + other_inst_id?: string | null; } + diff --git a/webapp/src/app/api/model/createPersonBookmark.ts b/webapp/src/app/api/model/createPersonBookmark.ts index d9d69bea..e2e196dd 100644 --- a/webapp/src/app/api/model/createPersonBookmark.ts +++ b/webapp/src/app/api/model/createPersonBookmark.ts @@ -1,13 +1,15 @@ /** * Innovation Search Engine API * - * + * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech * Do not edit the class manually. */ -export interface CreatePersonBookmark { - person_name?: string | null; + +export interface CreatePersonBookmark { + person_name?: string | null; } + diff --git a/webapp/src/app/api/model/customAuthor.ts b/webapp/src/app/api/model/customAuthor.ts index 6fd54c51..0cf7eb21 100644 --- a/webapp/src/app/api/model/customAuthor.ts +++ b/webapp/src/app/api/model/customAuthor.ts @@ -1,7 +1,7 @@ /** * Innovation Search Engine API * - * + * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech @@ -16,24 +16,26 @@ import { AuthorIds } from './authorIds'; import { AuthorSummaryStats } from './authorSummaryStats'; import { WorkTopic } from './workTopic'; -export interface CustomAuthor { - id?: string | null; - orcid?: string | null; - display_name?: string | null; - display_name_alternatives?: Array | null; - longest_name?: string | null; - parsed_longest_name?: AuthorParsedLongestName | null; - works_count?: number | null; - cited_by_count?: number | null; - summary_stats?: AuthorSummaryStats | null; - affiliations?: Array | null; - last_known_institutions?: Array | null; - topics?: Array | null; - counts_by_year?: Array | null; - ids?: AuthorIds | null; - works_api_url?: string | null; - created_date?: string | null; - updated_date?: string | null; - relevance_rating?: string | null; - career_metrics?: CareerMetrics | null; + +export interface CustomAuthor { + id?: string | null; + orcid?: string | null; + display_name?: string | null; + display_name_alternatives?: Array | null; + longest_name?: string | null; + parsed_longest_name?: AuthorParsedLongestName | null; + works_count?: number | null; + cited_by_count?: number | null; + summary_stats?: AuthorSummaryStats | null; + affiliations?: Array | null; + last_known_institutions?: Array | null; + topics?: Array | null; + counts_by_year?: Array | null; + ids?: AuthorIds | null; + works_api_url?: string | null; + created_date?: string | null; + updated_date?: string | null; + relevance_rating?: string | null; + career_metrics?: CareerMetrics | null; } + diff --git a/webapp/src/app/api/model/customAuthorsListResponse.ts b/webapp/src/app/api/model/customAuthorsListResponse.ts index 71f691a2..3c80ddf5 100644 --- a/webapp/src/app/api/model/customAuthorsListResponse.ts +++ b/webapp/src/app/api/model/customAuthorsListResponse.ts @@ -1,7 +1,7 @@ /** * Innovation Search Engine API * - * + * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech @@ -11,9 +11,11 @@ import { Meta } from './meta'; import { CustomAuthor } from './customAuthor'; import { GroupByResult } from './groupByResult'; -export interface CustomAuthorsListResponse { - meta?: Meta | null; - results?: Array | null; - group_by?: Array | null; - placeholder?: CustomAuthor | null; + +export interface CustomAuthorsListResponse { + meta?: Meta | null; + results?: Array | null; + group_by?: Array | null; + placeholder?: CustomAuthor | null; } + diff --git a/webapp/src/app/api/model/dashboardStatisticValue.ts b/webapp/src/app/api/model/dashboardStatisticValue.ts index 7666aee8..928bdd76 100644 --- a/webapp/src/app/api/model/dashboardStatisticValue.ts +++ b/webapp/src/app/api/model/dashboardStatisticValue.ts @@ -1,15 +1,17 @@ /** * Innovation Search Engine API * - * + * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech * Do not edit the class manually. */ -export interface DashboardStatisticValue { - institution_id: string; - organization_name: string; - value: number; + +export interface DashboardStatisticValue { + institution_id: string; + organization_name: string; + value: number; } + diff --git a/webapp/src/app/api/model/dashboardStatistics.ts b/webapp/src/app/api/model/dashboardStatistics.ts index 28d2527c..ba33382d 100644 --- a/webapp/src/app/api/model/dashboardStatistics.ts +++ b/webapp/src/app/api/model/dashboardStatistics.ts @@ -1,20 +1,22 @@ /** * Innovation Search Engine API * - * + * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech * Do not edit the class manually. */ -export interface DashboardStatistics { - institution_id: string; - organization_name: string; - publications: number; - persons: number; - projects: number; - dfg_projects: number; - eu_projects: number; - bmbf_projects: number; + +export interface DashboardStatistics { + institution_id: string; + organization_name: string; + publications: number; + persons: number; + projects: number; + dfg_projects: number; + eu_projects: number; + bmbf_projects: number; } + diff --git a/webapp/src/app/api/model/dehydratedAuthor.ts b/webapp/src/app/api/model/dehydratedAuthor.ts index 350718ef..4d3817f1 100644 --- a/webapp/src/app/api/model/dehydratedAuthor.ts +++ b/webapp/src/app/api/model/dehydratedAuthor.ts @@ -1,18 +1,20 @@ /** * Innovation Search Engine API * - * + * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech * Do not edit the class manually. */ + /** * [Dehydrated Author](/api-reference/authors#the-dehydratedauthor-object) — reduced-field version used in nested contexts */ -export interface DehydratedAuthor { - id?: string | null; - display_name?: string | null; - orcid?: string | null; +export interface DehydratedAuthor { + id?: string | null; + display_name?: string | null; + orcid?: string | null; } + diff --git a/webapp/src/app/api/model/dehydratedFunder.ts b/webapp/src/app/api/model/dehydratedFunder.ts index c4231c13..b134bbb1 100644 --- a/webapp/src/app/api/model/dehydratedFunder.ts +++ b/webapp/src/app/api/model/dehydratedFunder.ts @@ -1,18 +1,20 @@ /** * Innovation Search Engine API * - * + * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech * Do not edit the class manually. */ + /** * [Dehydrated Funder](/api-reference/funders) — reduced-field version used in nested contexts */ -export interface DehydratedFunder { - id?: string | null; - display_name?: string | null; - ror?: string | null; +export interface DehydratedFunder { + id?: string | null; + display_name?: string | null; + ror?: string | null; } + diff --git a/webapp/src/app/api/model/dehydratedInstitution.ts b/webapp/src/app/api/model/dehydratedInstitution.ts index 956fc03e..7b6c9824 100644 --- a/webapp/src/app/api/model/dehydratedInstitution.ts +++ b/webapp/src/app/api/model/dehydratedInstitution.ts @@ -1,21 +1,23 @@ /** * Innovation Search Engine API * - * + * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech * Do not edit the class manually. */ + /** * [Dehydrated Institution](/api-reference/institutions#the-dehydratedinstitution-object) — reduced-field version used in nested contexts */ -export interface DehydratedInstitution { - id?: string | null; - display_name?: string | null; - ror?: string | null; - country_code?: string | null; - type?: string | null; - lineage?: Array | null; +export interface DehydratedInstitution { + id?: string | null; + display_name?: string | null; + ror?: string | null; + country_code?: string | null; + type?: string | null; + lineage?: Array | null; } + diff --git a/webapp/src/app/api/model/dehydratedSource.ts b/webapp/src/app/api/model/dehydratedSource.ts index b672b5dd..ae714846 100644 --- a/webapp/src/app/api/model/dehydratedSource.ts +++ b/webapp/src/app/api/model/dehydratedSource.ts @@ -1,26 +1,28 @@ /** * Innovation Search Engine API * - * + * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech * Do not edit the class manually. */ + /** * [Dehydrated Source](/api-reference/sources#the-dehydratedsource-object) — reduced-field version used in nested contexts */ -export interface DehydratedSource { - id?: string | null; - display_name?: string | null; - issn_l?: string | null; - issn?: Array | null; - is_oa?: boolean | null; - is_in_doaj?: boolean | null; - is_core?: boolean | null; - host_organization?: string | null; - host_organization_name?: string | null; - host_organization_lineage?: Array | null; - type?: string | null; +export interface DehydratedSource { + id?: string | null; + display_name?: string | null; + issn_l?: string | null; + issn?: Array | null; + is_oa?: boolean | null; + is_in_doaj?: boolean | null; + is_core?: boolean | null; + host_organization?: string | null; + host_organization_name?: string | null; + host_organization_lineage?: Array | null; + type?: string | null; } + diff --git a/webapp/src/app/api/model/dfgProjectDetails.ts b/webapp/src/app/api/model/dfgProjectDetails.ts index 58ece5f7..5fe29ff9 100644 --- a/webapp/src/app/api/model/dfgProjectDetails.ts +++ b/webapp/src/app/api/model/dfgProjectDetails.ts @@ -1,39 +1,41 @@ /** * Innovation Search Engine API * - * + * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech * Do not edit the class manually. */ + /** * Clean summary model for a DFG project, consolidating all person roles and institution references into unified lists. */ -export interface DfgProjectDetails { - /** - * The ID of the DFG project - */ - id: string; - link?: string | null; - title?: string | null; - description?: string | null; - project_identifier?: string | null; - funding_start_date?: string | null; - funding_end_date?: string | null; - dfg_procedure?: string | null; - subject_area?: string | null; - funding_type?: string | null; - international_reference?: string | null; - website?: string | null; - /** - * All persons associated with the DFG project (any role) - */ - associated_persons?: Array; - /** - * All institutions associated with the DFG project - */ - institutions?: Array; - subproject_of?: string | null; +export interface DfgProjectDetails { + /** + * The ID of the DFG project + */ + id: string; + link?: string | null; + title?: string | null; + description?: string | null; + project_identifier?: string | null; + funding_start_date?: string | null; + funding_end_date?: string | null; + dfg_procedure?: string | null; + subject_area?: string | null; + funding_type?: string | null; + international_reference?: string | null; + website?: string | null; + /** + * All persons associated with the DFG project (any role) + */ + associated_persons?: Array; + /** + * All institutions associated with the DFG project + */ + institutions?: Array; + subproject_of?: string | null; } + diff --git a/webapp/src/app/api/model/dfgProjectPage.ts b/webapp/src/app/api/model/dfgProjectPage.ts index a05d81d2..8f67e170 100644 --- a/webapp/src/app/api/model/dfgProjectPage.ts +++ b/webapp/src/app/api/model/dfgProjectPage.ts @@ -1,7 +1,7 @@ /** * Innovation Search Engine API * - * + * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech @@ -9,21 +9,23 @@ */ import { DfgProjectSummary } from './dfgProjectSummary'; -export interface DfgProjectPage { - /** - * The current page number. - */ - page?: number; - /** - * The requested page size. - */ - size?: number; - /** - * The total number of items. - */ - total?: number; - /** - * The DFG projects on this page. - */ - elements?: Array; + +export interface DfgProjectPage { + /** + * The current page number. + */ + page?: number; + /** + * The requested page size. + */ + size?: number; + /** + * The total number of items. + */ + total?: number; + /** + * The DFG projects on this page. + */ + elements?: Array; } + diff --git a/webapp/src/app/api/model/dfgProjectSummary.ts b/webapp/src/app/api/model/dfgProjectSummary.ts index e9be0c8c..80392042 100644 --- a/webapp/src/app/api/model/dfgProjectSummary.ts +++ b/webapp/src/app/api/model/dfgProjectSummary.ts @@ -1,7 +1,7 @@ /** * Innovation Search Engine API * - * + * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech @@ -10,30 +10,32 @@ import { DfgInstitutionSummary } from './dfgInstitutionSummary'; import { DfgPersonSummary } from './dfgPersonSummary'; -export interface DfgProjectSummary { - /** - * The unique identifier of the DFG project. - */ - id: string; - link?: string | null; - title?: string | null; - professional_classification?: string | null; - funding_start?: string | null; - funding_end?: string | null; - /** - * Root institutions associated with the project (e.g. universities or umbrella organizations). - */ - root_institutions?: Array; - /** - * Institutions associated with the project. - */ - institutions?: Array; - /** - * The names of the persons involved in the DFG project. - */ - names?: Array; - /** - * The persons involved in the DFG project. - */ - persons?: Array; + +export interface DfgProjectSummary { + /** + * The unique identifier of the DFG project. + */ + id: string; + link?: string | null; + title?: string | null; + professional_classification?: string | null; + funding_start?: string | null; + funding_end?: string | null; + /** + * Root institutions associated with the project (e.g. universities or umbrella organizations). + */ + root_institutions?: Array; + /** + * Institutions associated with the project. + */ + institutions?: Array; + /** + * The names of the persons involved in the DFG project. + */ + names?: Array; + /** + * The persons involved in the DFG project. + */ + persons?: Array; } + diff --git a/webapp/src/app/api/model/euCordisProjectResponse.ts b/webapp/src/app/api/model/euCordisProjectResponse.ts index f0dc272a..63e9084d 100644 --- a/webapp/src/app/api/model/euCordisProjectResponse.ts +++ b/webapp/src/app/api/model/euCordisProjectResponse.ts @@ -1,7 +1,7 @@ /** * Innovation Search Engine API * - * + * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech @@ -9,15 +9,17 @@ */ import { EuProjectData } from './euProjectData'; + /** * Response model for EU Cordis project endpoints. */ -export interface EuCordisProjectResponse { - /** - * Indicates if the request was successful - */ - success: boolean; - project_type?: string | null; - eu_project_data?: EuProjectData | null; - error?: string | null; +export interface EuCordisProjectResponse { + /** + * Indicates if the request was successful + */ + success: boolean; + project_type?: string | null; + eu_project_data?: EuProjectData | null; + error?: string | null; } + diff --git a/webapp/src/app/api/model/euOrganizationProjectSummary.ts b/webapp/src/app/api/model/euOrganizationProjectSummary.ts index af085ff3..3cc10f0a 100644 --- a/webapp/src/app/api/model/euOrganizationProjectSummary.ts +++ b/webapp/src/app/api/model/euOrganizationProjectSummary.ts @@ -1,25 +1,27 @@ /** * Innovation Search Engine API * - * + * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech * Do not edit the class manually. */ -export interface EuOrganizationProjectSummary { - /** - * The unique identifier of the organization. - */ - organization_id: string; - /** - * The unique identifier of the project. - */ - project_id: string; - title?: string | null; - start_date?: string | null; - end_date?: string | null; - acronym?: string | null; - ec_contribution?: number | null; + +export interface EuOrganizationProjectSummary { + /** + * The unique identifier of the organization. + */ + organization_id: string; + /** + * The unique identifier of the project. + */ + project_id: string; + title?: string | null; + start_date?: string | null; + end_date?: string | null; + acronym?: string | null; + ec_contribution?: number | null; } + diff --git a/webapp/src/app/api/model/euOrganizationProjectSummaryPage.ts b/webapp/src/app/api/model/euOrganizationProjectSummaryPage.ts index 90166a7e..9d57d5b4 100644 --- a/webapp/src/app/api/model/euOrganizationProjectSummaryPage.ts +++ b/webapp/src/app/api/model/euOrganizationProjectSummaryPage.ts @@ -1,7 +1,7 @@ /** * Innovation Search Engine API * - * + * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech @@ -9,21 +9,23 @@ */ import { EuOrganizationProjectSummary } from './euOrganizationProjectSummary'; -export interface EuOrganizationProjectSummaryPage { - /** - * The current page number. - */ - page?: number; - /** - * The requested page size. - */ - size?: number; - /** - * The total number of items. - */ - total?: number; - /** - * The organization project summaries on this page. - */ - elements?: Array; + +export interface EuOrganizationProjectSummaryPage { + /** + * The current page number. + */ + page?: number; + /** + * The requested page size. + */ + size?: number; + /** + * The total number of items. + */ + total?: number; + /** + * The organization project summaries on this page. + */ + elements?: Array; } + diff --git a/webapp/src/app/api/model/euProjectData.ts b/webapp/src/app/api/model/euProjectData.ts index 34639d19..6acedaf5 100644 --- a/webapp/src/app/api/model/euProjectData.ts +++ b/webapp/src/app/api/model/euProjectData.ts @@ -1,7 +1,7 @@ /** * Innovation Search Engine API * - * + * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech @@ -23,47 +23,49 @@ import { Fp7ReportSummary } from './fp7ReportSummary'; import { HEUReportSummary } from './hEUReportSummary'; import { HEUProjectDetails } from './hEUProjectDetails'; + /** * The project data */ -export interface EuProjectData { - acronym?: string; - contentUpdateDate?: string; - ecMaxContribution?: number; - ecSignatureDate?: string; - endDate?: string; - frameworkProgramme?: string; - fundingScheme?: string; - grantDoi?: string; - humanValidated?: boolean; - id?: string; - keywords?: string; - legalBasis?: string; - masterCall?: string; - nature?: string; - objective?: string; - rcn?: string; - startDate?: string; - status?: string; - subCall?: string; - title?: string; - topics?: string; - totalCost?: number; - organizations?: Array; - publications?: Array; - iprs?: Array; - report_summaries?: Array; - topicsList?: Array; - web_links?: Array; - eurosciVoc?: Array; - legalBasisList?: Array; - organizationCount?: number; - publicationCount?: number; - iprCount?: number; - deliverables?: Array; - reportSummaries?: Array; - webLinks?: Array; - ercPrincipalInvestigators?: Array; - deliverableCount?: number; - ercPiCount?: number; +export interface EuProjectData { + acronym?: string; + contentUpdateDate?: string; + ecMaxContribution?: number; + ecSignatureDate?: string; + endDate?: string; + frameworkProgramme?: string; + fundingScheme?: string; + grantDoi?: string; + humanValidated?: boolean; + id?: string; + keywords?: string; + legalBasis?: string; + masterCall?: string; + nature?: string; + objective?: string; + rcn?: string; + startDate?: string; + status?: string; + subCall?: string; + title?: string; + topics?: string; + totalCost?: number; + organizations?: Array; + publications?: Array; + iprs?: Array; + report_summaries?: Array; + topicsList?: Array; + web_links?: Array; + eurosciVoc?: Array; + legalBasisList?: Array; + organizationCount?: number; + publicationCount?: number; + iprCount?: number; + deliverables?: Array; + reportSummaries?: Array; + webLinks?: Array; + ercPrincipalInvestigators?: Array; + deliverableCount?: number; + ercPiCount?: number; } + diff --git a/webapp/src/app/api/model/extractedKeywords.ts b/webapp/src/app/api/model/extractedKeywords.ts index 4038c211..8e74c6e0 100644 --- a/webapp/src/app/api/model/extractedKeywords.ts +++ b/webapp/src/app/api/model/extractedKeywords.ts @@ -1,7 +1,7 @@ /** * Innovation Search Engine API * - * + * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech @@ -9,17 +9,19 @@ */ import { KeywordEntryWithTopic } from './keywordEntryWithTopic'; -export interface ExtractedKeywords { - /** - * The extracted broad keywords from text. - */ - broad_keywords: Array; - /** - * The extracted coarse-grained keywords from text. - */ - coarse_grained: Array; - /** - * The extracted fine-grained keywords from text. - */ - fine_grained: Array; + +export interface ExtractedKeywords { + /** + * The extracted broad keywords from text. + */ + broad_keywords: Array; + /** + * The extracted coarse-grained keywords from text. + */ + coarse_grained: Array; + /** + * The extracted fine-grained keywords from text. + */ + fine_grained: Array; } + diff --git a/webapp/src/app/api/model/extractedKeywordsLLM.ts b/webapp/src/app/api/model/extractedKeywordsLLM.ts index b49b98d7..b12957f6 100644 --- a/webapp/src/app/api/model/extractedKeywordsLLM.ts +++ b/webapp/src/app/api/model/extractedKeywordsLLM.ts @@ -1,7 +1,7 @@ /** * Innovation Search Engine API * - * + * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech @@ -9,17 +9,19 @@ */ import { KeywordEntry } from './keywordEntry'; -export interface ExtractedKeywordsLLM { - /** - * The extracted broad keywords from text. - */ - broad_keywords: Array; - /** - * The extracted coarse-grained keywords from text. - */ - coarse_grained: Array; - /** - * The extracted fine-grained keywords from text. - */ - fine_grained: Array; + +export interface ExtractedKeywordsLLM { + /** + * The extracted broad keywords from text. + */ + broad_keywords: Array; + /** + * The extracted coarse-grained keywords from text. + */ + coarse_grained: Array; + /** + * The extracted fine-grained keywords from text. + */ + fine_grained: Array; } + diff --git a/webapp/src/app/api/model/extractedKeywordsResponse.ts b/webapp/src/app/api/model/extractedKeywordsResponse.ts index 8fe10a5f..43731b7c 100644 --- a/webapp/src/app/api/model/extractedKeywordsResponse.ts +++ b/webapp/src/app/api/model/extractedKeywordsResponse.ts @@ -1,7 +1,7 @@ /** * Innovation Search Engine API * - * + * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech @@ -10,17 +10,19 @@ import { ExtractedKeywordsLLM } from './extractedKeywordsLLM'; import { ExtractedKeywords } from './extractedKeywords'; -export interface ExtractedKeywordsResponse { - results_llm?: ExtractedKeywordsLLM | null; - results?: ExtractedKeywords | null; - /** - * The source of the input text, e.g., \'url\', \'text\', or \'keywords\'. - */ - source: string; - source_url?: string | null; - /** - * The actual content from which keywords were extracted. - */ - source_content: string; - duration?: number | null; + +export interface ExtractedKeywordsResponse { + results_llm?: ExtractedKeywordsLLM | null; + results?: ExtractedKeywords | null; + /** + * The source of the input text, e.g., \'url\', \'text\', or \'keywords\'. + */ + source: string; + source_url?: string | null; + /** + * The actual content from which keywords were extracted. + */ + source_content: string; + duration?: number | null; } + diff --git a/webapp/src/app/api/model/fileUpload.ts b/webapp/src/app/api/model/fileUpload.ts index 921db4c3..61722b2f 100644 --- a/webapp/src/app/api/model/fileUpload.ts +++ b/webapp/src/app/api/model/fileUpload.ts @@ -1,24 +1,26 @@ /** * Innovation Search Engine API * - * + * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech * Do not edit the class manually. */ -export interface FileUpload { - /** - * The name of the uploaded file. - */ - filename: string; - /** - * The base64-encoded content of the uploaded file. - */ - content_base64: string; - /** - * The MIME type of the uploaded file, e.g., \'application/pdf\', \'image/png\', etc. - */ - mime_type: string; + +export interface FileUpload { + /** + * The name of the uploaded file. + */ + filename: string; + /** + * The base64-encoded content of the uploaded file. + */ + content_base64: string; + /** + * The MIME type of the uploaded file, e.g., \'application/pdf\', \'image/png\', etc. + */ + mime_type: string; } + diff --git a/webapp/src/app/api/model/filterInformation.ts b/webapp/src/app/api/model/filterInformation.ts index 1c4af66d..b2078376 100644 --- a/webapp/src/app/api/model/filterInformation.ts +++ b/webapp/src/app/api/model/filterInformation.ts @@ -1,7 +1,7 @@ /** * Innovation Search Engine API * - * + * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech @@ -10,21 +10,23 @@ import { InstitutionInformation } from './institutionInformation'; import { WorkTopicInformation } from './workTopicInformation'; -export interface FilterInformation { - /** - * The minimum publication year of the works in the collaboration network. - */ - min_possible_year: number; - /** - * The maximum publication year of the works in the collaboration network. - */ - max_possible_year: number; - /** - * The list of institutions associated with the works in the collaboration network. - */ - institutions: Array; - /** - * The list of topics associated with the works in the collaboration network. - */ - topics: Array; + +export interface FilterInformation { + /** + * The minimum publication year of the works in the collaboration network. + */ + min_possible_year: number; + /** + * The maximum publication year of the works in the collaboration network. + */ + max_possible_year: number; + /** + * The list of institutions associated with the works in the collaboration network. + */ + institutions: Array; + /** + * The list of topics associated with the works in the collaboration network. + */ + topics: Array; } + diff --git a/webapp/src/app/api/model/filterProperties.ts b/webapp/src/app/api/model/filterProperties.ts index 7caac0b6..608acab4 100644 --- a/webapp/src/app/api/model/filterProperties.ts +++ b/webapp/src/app/api/model/filterProperties.ts @@ -1,7 +1,7 @@ /** * Innovation Search Engine API * - * + * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech @@ -10,11 +10,13 @@ import { WorksFilterProperties } from './worksFilterProperties'; import { AuthorsFilterProperties } from './authorsFilterProperties'; -export interface FilterProperties { - /** - * The type of filter to apply when generating the collaboration network. Can be either \'works\' or \'authors\'. If \'works\', the filter properties in the \'works_filter_properties\' field will be used. If \'authors\', the filter properties in the \'authors_filter_properties\' field will be used. - */ - filter_by?: string; - works_filter_properties: WorksFilterProperties | null; - authors_filter_properties: AuthorsFilterProperties | null; + +export interface FilterProperties { + /** + * The type of filter to apply when generating the collaboration network. Can be either \'works\' or \'authors\'. If \'works\', the filter properties in the \'works_filter_properties\' field will be used. If \'authors\', the filter properties in the \'authors_filter_properties\' field will be used. + */ + filter_by?: string; + works_filter_properties: WorksFilterProperties | null; + authors_filter_properties: AuthorsFilterProperties | null; } + diff --git a/webapp/src/app/api/model/fp7EurosciVoc.ts b/webapp/src/app/api/model/fp7EurosciVoc.ts index 14ae95bc..fb7e8deb 100644 --- a/webapp/src/app/api/model/fp7EurosciVoc.ts +++ b/webapp/src/app/api/model/fp7EurosciVoc.ts @@ -1,21 +1,23 @@ /** * Innovation Search Engine API * - * + * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech * Do not edit the class manually. */ + /** * Fp7EurosciVoc */ -export interface Fp7EurosciVoc { - code?: string | null; - description?: string | null; - id?: string | null; - path?: string | null; - projectID?: string | null; - title?: string | null; +export interface Fp7EurosciVoc { + code?: string | null; + description?: string | null; + id?: string | null; + path?: string | null; + projectID?: string | null; + title?: string | null; } + diff --git a/webapp/src/app/api/model/fp7LegalBasis.ts b/webapp/src/app/api/model/fp7LegalBasis.ts index bf5ef53e..89a05742 100644 --- a/webapp/src/app/api/model/fp7LegalBasis.ts +++ b/webapp/src/app/api/model/fp7LegalBasis.ts @@ -1,20 +1,22 @@ /** * Innovation Search Engine API * - * + * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech * Do not edit the class manually. */ + /** * Fp7LegalBasis */ -export interface Fp7LegalBasis { - id?: string | null; - legalBasis?: string | null; - projectID?: string | null; - title?: string | null; - uniqueProgrammePart?: string | null; +export interface Fp7LegalBasis { + id?: string | null; + legalBasis?: string | null; + projectID?: string | null; + title?: string | null; + uniqueProgrammePart?: string | null; } + diff --git a/webapp/src/app/api/model/fp7Organization.ts b/webapp/src/app/api/model/fp7Organization.ts index a46d9d02..2989a873 100644 --- a/webapp/src/app/api/model/fp7Organization.ts +++ b/webapp/src/app/api/model/fp7Organization.ts @@ -1,41 +1,43 @@ /** * Innovation Search Engine API * - * + * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech * Do not edit the class manually. */ + /** * Fp7Organization */ -export interface Fp7Organization { - SME?: boolean | null; - active?: boolean | null; - activityType?: string | null; - city?: string | null; - contactForm?: string | null; - contentUpdateDate?: string | null; - country?: string | null; - ecContribution?: number | null; - endOfParticipation?: boolean | null; - geolocation?: string | null; - id?: string | null; - name?: string | null; - netEcContribution?: number | null; - nutsCode?: string | null; - order?: number | null; - organisationID?: string | null; - organizationURL?: string | null; - postCode?: string | null; - projectAcronym?: string | null; - projectID?: string | null; - rcn?: string | null; - role?: string | null; - shortName?: string | null; - street?: string | null; - totalCost?: number | null; - vatNumber?: string | null; +export interface Fp7Organization { + SME?: boolean | null; + active?: boolean | null; + activityType?: string | null; + city?: string | null; + contactForm?: string | null; + contentUpdateDate?: string | null; + country?: string | null; + ecContribution?: number | null; + endOfParticipation?: boolean | null; + geolocation?: string | null; + id?: string | null; + name?: string | null; + netEcContribution?: number | null; + nutsCode?: string | null; + order?: number | null; + organisationID?: string | null; + organizationURL?: string | null; + postCode?: string | null; + projectAcronym?: string | null; + projectID?: string | null; + rcn?: string | null; + role?: string | null; + shortName?: string | null; + street?: string | null; + totalCost?: number | null; + vatNumber?: string | null; } + diff --git a/webapp/src/app/api/model/fp7ProjectDetails.ts b/webapp/src/app/api/model/fp7ProjectDetails.ts index 034a986d..a7dce634 100644 --- a/webapp/src/app/api/model/fp7ProjectDetails.ts +++ b/webapp/src/app/api/model/fp7ProjectDetails.ts @@ -1,7 +1,7 @@ /** * Innovation Search Engine API * - * + * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech @@ -16,41 +16,43 @@ import { Fp7ProjectIPR } from './fp7ProjectIPR'; import { Fp7Organization } from './fp7Organization'; import { Fp7LegalBasis } from './fp7LegalBasis'; + /** * Comprehensive FP7 Project model combining all related entities. This model extends the base Fp7Project with all associated data. */ -export interface Fp7ProjectDetails { - acronym?: string | null; - contentUpdateDate?: string | null; - ecMaxContribution?: number | null; - ecSignatureDate?: string | null; - endDate?: string | null; - frameworkProgramme?: string | null; - fundingScheme?: string | null; - grantDoi?: string | null; - humanValidated?: boolean | null; - id?: string | null; - keywords?: string | null; - legalBasis?: string | null; - masterCall?: string | null; - nature?: string | null; - objective?: string | null; - rcn?: string | null; - startDate?: string | null; - status?: string | null; - subCall?: string | null; - title?: string | null; - topics?: string | null; - totalCost?: number | null; - organizations?: Array | null; - publications?: Array | null; - iprs?: Array | null; - report_summaries?: Array | null; - topicsList?: Array | null; - web_links?: Array | null; - eurosciVoc?: Array | null; - legalBasisList?: Array | null; - organizationCount?: number | null; - publicationCount?: number | null; - iprCount?: number | null; +export interface Fp7ProjectDetails { + acronym?: string | null; + contentUpdateDate?: string | null; + ecMaxContribution?: number | null; + ecSignatureDate?: string | null; + endDate?: string | null; + frameworkProgramme?: string | null; + fundingScheme?: string | null; + grantDoi?: string | null; + humanValidated?: boolean | null; + id?: string | null; + keywords?: string | null; + legalBasis?: string | null; + masterCall?: string | null; + nature?: string | null; + objective?: string | null; + rcn?: string | null; + startDate?: string | null; + status?: string | null; + subCall?: string | null; + title?: string | null; + topics?: string | null; + totalCost?: number | null; + organizations?: Array | null; + publications?: Array | null; + iprs?: Array | null; + report_summaries?: Array | null; + topicsList?: Array | null; + web_links?: Array | null; + eurosciVoc?: Array | null; + legalBasisList?: Array | null; + organizationCount?: number | null; + publicationCount?: number | null; + iprCount?: number | null; } + diff --git a/webapp/src/app/api/model/fp7ProjectIPR.ts b/webapp/src/app/api/model/fp7ProjectIPR.ts index 37040026..f35487c4 100644 --- a/webapp/src/app/api/model/fp7ProjectIPR.ts +++ b/webapp/src/app/api/model/fp7ProjectIPR.ts @@ -1,34 +1,36 @@ /** * Innovation Search Engine API * - * + * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech * Do not edit the class manually. */ + /** * Fp7ProjectIPR */ -export interface Fp7ProjectIPR { - applicantName?: string | null; - applicationDate?: string | null; - applicationIdentifier?: string | null; - applicationKind?: string | null; - applicationPrefix?: string | null; - awardDate?: string | null; - awardIdentifier?: string | null; - awardKind?: string | null; - awardPrefix?: string | null; - epoAppUrl?: string | null; - epoPubUrl?: string | null; - id?: string | null; - organisationID?: string | null; - patentFamilyIdentifier?: string | null; - patentType?: string | null; - priorityDate?: string | null; - projectID?: string | null; - title?: string | null; - type?: string | null; +export interface Fp7ProjectIPR { + applicantName?: string | null; + applicationDate?: string | null; + applicationIdentifier?: string | null; + applicationKind?: string | null; + applicationPrefix?: string | null; + awardDate?: string | null; + awardIdentifier?: string | null; + awardKind?: string | null; + awardPrefix?: string | null; + epoAppUrl?: string | null; + epoPubUrl?: string | null; + id?: string | null; + organisationID?: string | null; + patentFamilyIdentifier?: string | null; + patentType?: string | null; + priorityDate?: string | null; + projectID?: string | null; + title?: string | null; + type?: string | null; } + diff --git a/webapp/src/app/api/model/fp7Publication.ts b/webapp/src/app/api/model/fp7Publication.ts index 34fba260..fd0e2491 100644 --- a/webapp/src/app/api/model/fp7Publication.ts +++ b/webapp/src/app/api/model/fp7Publication.ts @@ -1,33 +1,35 @@ /** * Innovation Search Engine API * - * + * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech * Do not edit the class manually. */ + /** * Fp7Publication */ -export interface Fp7Publication { - authors?: string | null; - collection?: string | null; - contentUpdateDate?: string | null; - doi?: string | null; - id?: string | null; - isPublishedAs?: string | null; - journalNumber?: string | null; - journalTitle?: string | null; - projectAcronym?: string | null; - projectID?: string | null; - publishedPages?: string | null; - publishedYear?: number | null; - publisher?: string | null; - qaProcessedDoi?: string | null; - rcn?: string | null; - repositoryUrl?: string | null; - title?: string | null; - volume?: string | null; +export interface Fp7Publication { + authors?: string | null; + collection?: string | null; + contentUpdateDate?: string | null; + doi?: string | null; + id?: string | null; + isPublishedAs?: string | null; + journalNumber?: string | null; + journalTitle?: string | null; + projectAcronym?: string | null; + projectID?: string | null; + publishedPages?: string | null; + publishedYear?: number | null; + publisher?: string | null; + qaProcessedDoi?: string | null; + rcn?: string | null; + repositoryUrl?: string | null; + title?: string | null; + volume?: string | null; } + diff --git a/webapp/src/app/api/model/fp7ReportSummary.ts b/webapp/src/app/api/model/fp7ReportSummary.ts index 084d2ba8..f0413439 100644 --- a/webapp/src/app/api/model/fp7ReportSummary.ts +++ b/webapp/src/app/api/model/fp7ReportSummary.ts @@ -1,22 +1,24 @@ /** * Innovation Search Engine API * - * + * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech * Do not edit the class manually. */ + /** * Fp7ReportSummary */ -export interface Fp7ReportSummary { - attachments?: string | null; - contentUpdateDate?: string | null; - id?: string | null; - projectAcronym?: string | null; - projectID?: string | null; - rcn?: string | null; - title?: string | null; +export interface Fp7ReportSummary { + attachments?: string | null; + contentUpdateDate?: string | null; + id?: string | null; + projectAcronym?: string | null; + projectID?: string | null; + rcn?: string | null; + title?: string | null; } + diff --git a/webapp/src/app/api/model/fp7Topic.ts b/webapp/src/app/api/model/fp7Topic.ts index 4202cdb0..f39a021e 100644 --- a/webapp/src/app/api/model/fp7Topic.ts +++ b/webapp/src/app/api/model/fp7Topic.ts @@ -1,19 +1,21 @@ /** * Innovation Search Engine API * - * + * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech * Do not edit the class manually. */ + /** * Fp7Topic */ -export interface Fp7Topic { - id?: string | null; - projectID?: string | null; - title?: string | null; - topic?: string | null; +export interface Fp7Topic { + id?: string | null; + projectID?: string | null; + title?: string | null; + topic?: string | null; } + diff --git a/webapp/src/app/api/model/fp7WebLink.ts b/webapp/src/app/api/model/fp7WebLink.ts index 67071bb8..eeaff7ab 100644 --- a/webapp/src/app/api/model/fp7WebLink.ts +++ b/webapp/src/app/api/model/fp7WebLink.ts @@ -1,25 +1,27 @@ /** * Innovation Search Engine API * - * + * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech * Do not edit the class manually. */ + /** * Fp7WebLink */ -export interface Fp7WebLink { - archivedDate?: string | null; - availableLanguages?: string | null; - id?: string | null; - linkId?: string | null; - projectID?: string | null; - represents?: string | null; - source?: string | null; - status?: string | null; - type?: string | null; - url?: string | null; +export interface Fp7WebLink { + archivedDate?: string | null; + availableLanguages?: string | null; + id?: string | null; + linkId?: string | null; + projectID?: string | null; + represents?: string | null; + source?: string | null; + status?: string | null; + type?: string | null; + url?: string | null; } + diff --git a/webapp/src/app/api/model/funderByAuthor.ts b/webapp/src/app/api/model/funderByAuthor.ts index c62110e7..247e5629 100644 --- a/webapp/src/app/api/model/funderByAuthor.ts +++ b/webapp/src/app/api/model/funderByAuthor.ts @@ -1,7 +1,7 @@ /** * Innovation Search Engine API * - * + * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech @@ -11,13 +11,15 @@ import { PublicationIdsByAuthorPosition } from './publicationIdsByAuthorPosition import { AuthorPositionCount } from './authorPositionCount'; import { PublicationDetailByFunder } from './publicationDetailByFunder'; -export interface FunderByAuthor { - funder_id?: string | null; - funder_name?: string | null; - publication_count: number; - author_position_count: AuthorPositionCount; - publication_ids: PublicationIdsByAuthorPosition; - publication_urls?: { [key: string]: string }; - publication_titles?: { [key: string]: string }; - publication_details?: { [key: string]: PublicationDetailByFunder }; + +export interface FunderByAuthor { + funder_id?: string | null; + funder_name?: string | null; + publication_count: number; + author_position_count: AuthorPositionCount; + publication_ids: PublicationIdsByAuthorPosition; + publication_urls?: { [key: string]: string; }; + publication_titles?: { [key: string]: string; }; + publication_details?: { [key: string]: PublicationDetailByFunder; }; } + diff --git a/webapp/src/app/api/model/fundersByAuthorResponse.ts b/webapp/src/app/api/model/fundersByAuthorResponse.ts index d6e0e02f..1286429e 100644 --- a/webapp/src/app/api/model/fundersByAuthorResponse.ts +++ b/webapp/src/app/api/model/fundersByAuthorResponse.ts @@ -1,7 +1,7 @@ /** * Innovation Search Engine API * - * + * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech @@ -9,9 +9,11 @@ */ import { FunderByAuthor } from './funderByAuthor'; -export interface FundersByAuthorResponse { - author_id: string; - author_name?: string | null; - funder_count: number; - funders: Array; + +export interface FundersByAuthorResponse { + author_id: string; + author_name?: string | null; + funder_count: number; + funders: Array; } + diff --git a/webapp/src/app/api/model/fundingProject.ts b/webapp/src/app/api/model/fundingProject.ts index fb8204e3..a53c64f1 100644 --- a/webapp/src/app/api/model/fundingProject.ts +++ b/webapp/src/app/api/model/fundingProject.ts @@ -1,7 +1,7 @@ /** * Innovation Search Engine API * - * + * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech @@ -9,19 +9,23 @@ */ import { ProjectType } from './projectType'; -export interface FundingProject { - /** - * The type of the project. - */ - type: ProjectType; - /** - * The unique identifier of the project. - */ - id: string; - title?: string | null; - acronym?: string | null; - start_date?: string | null; - end_date?: string | null; - funding_amount?: number | null; + +export interface FundingProject { + /** + * The type of the project. + */ + type: ProjectType; + /** + * The unique identifier of the project. + */ + id: string; + title?: string | null; + acronym?: string | null; + start_date?: string | null; + end_date?: string | null; + funding_amount?: number | null; } -export namespace FundingProject {} +export namespace FundingProject { +} + + diff --git a/webapp/src/app/api/model/fundingProjectPage.ts b/webapp/src/app/api/model/fundingProjectPage.ts index e0996525..db43c9c4 100644 --- a/webapp/src/app/api/model/fundingProjectPage.ts +++ b/webapp/src/app/api/model/fundingProjectPage.ts @@ -1,7 +1,7 @@ /** * Innovation Search Engine API * - * + * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech @@ -9,21 +9,23 @@ */ import { FundingProject } from './fundingProject'; -export interface FundingProjectPage { - /** - * The current page number. - */ - page?: number; - /** - * The requested page size. - */ - size?: number; - /** - * The total number of items. - */ - total?: number; - /** - * The funding projects on this page. - */ - elements?: Array; + +export interface FundingProjectPage { + /** + * The current page number. + */ + page?: number; + /** + * The requested page size. + */ + size?: number; + /** + * The total number of items. + */ + total?: number; + /** + * The funding projects on this page. + */ + elements?: Array; } + diff --git a/webapp/src/app/api/model/fwci.ts b/webapp/src/app/api/model/fwci.ts index bd7eea69..0c0cf8de 100644 --- a/webapp/src/app/api/model/fwci.ts +++ b/webapp/src/app/api/model/fwci.ts @@ -1,14 +1,17 @@ /** * Innovation Search Engine API * - * + * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech * Do not edit the class manually. */ + /** * Field-weighted Citation Impact, calculated as citations received / citations expected. */ -export interface Fwci {} +export interface Fwci { +} + diff --git a/webapp/src/app/api/model/groupByResult.ts b/webapp/src/app/api/model/groupByResult.ts index 98580663..68c51855 100644 --- a/webapp/src/app/api/model/groupByResult.ts +++ b/webapp/src/app/api/model/groupByResult.ts @@ -1,18 +1,20 @@ /** * Innovation Search Engine API * - * + * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech * Do not edit the class manually. */ + /** * GroupByResult */ -export interface GroupByResult { - key?: string | null; - key_display_name?: string | null; - count?: number | null; +export interface GroupByResult { + key?: string | null; + key_display_name?: string | null; + count?: number | null; } + diff --git a/webapp/src/app/api/model/h2020Deliverable.ts b/webapp/src/app/api/model/h2020Deliverable.ts index ccb837a1..390d2c7a 100644 --- a/webapp/src/app/api/model/h2020Deliverable.ts +++ b/webapp/src/app/api/model/h2020Deliverable.ts @@ -1,23 +1,25 @@ /** * Innovation Search Engine API * - * + * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech * Do not edit the class manually. */ + /** * H2020Deliverable */ -export interface H2020Deliverable { - collection?: string | null; - contentUpdateDate?: string | null; - deliverableType?: string | null; - description?: string | null; - projectAcronym?: string | null; - projectID?: string | null; - rcn?: string | null; - url?: string | null; +export interface H2020Deliverable { + collection?: string | null; + contentUpdateDate?: string | null; + deliverableType?: string | null; + description?: string | null; + projectAcronym?: string | null; + projectID?: string | null; + rcn?: string | null; + url?: string | null; } + diff --git a/webapp/src/app/api/model/h2020ErcPI.ts b/webapp/src/app/api/model/h2020ErcPI.ts index d6e2324e..48ae3ff0 100644 --- a/webapp/src/app/api/model/h2020ErcPI.ts +++ b/webapp/src/app/api/model/h2020ErcPI.ts @@ -1,23 +1,25 @@ /** * Innovation Search Engine API * - * + * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech * Do not edit the class manually. */ + /** * H2020ErcPI */ -export interface H2020ErcPI { - firstName?: string | null; - fundingScheme?: string | null; - id?: string | null; - lastName?: string | null; - organisationID?: string | null; - projectAcronym?: string | null; - projectID?: string | null; - title?: string | null; +export interface H2020ErcPI { + firstName?: string | null; + fundingScheme?: string | null; + id?: string | null; + lastName?: string | null; + organisationID?: string | null; + projectAcronym?: string | null; + projectID?: string | null; + title?: string | null; } + diff --git a/webapp/src/app/api/model/h2020EurosciVoc.ts b/webapp/src/app/api/model/h2020EurosciVoc.ts index b275e94e..7d1ea931 100644 --- a/webapp/src/app/api/model/h2020EurosciVoc.ts +++ b/webapp/src/app/api/model/h2020EurosciVoc.ts @@ -1,21 +1,23 @@ /** * Innovation Search Engine API * - * + * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech * Do not edit the class manually. */ + /** * H2020EurosciVoc */ -export interface H2020EurosciVoc { - code?: string | null; - description?: string | null; - id?: string | null; - path?: string | null; - projectID?: string | null; - title?: string | null; +export interface H2020EurosciVoc { + code?: string | null; + description?: string | null; + id?: string | null; + path?: string | null; + projectID?: string | null; + title?: string | null; } + diff --git a/webapp/src/app/api/model/h2020LegalBasis.ts b/webapp/src/app/api/model/h2020LegalBasis.ts index e5846466..d247488d 100644 --- a/webapp/src/app/api/model/h2020LegalBasis.ts +++ b/webapp/src/app/api/model/h2020LegalBasis.ts @@ -1,20 +1,22 @@ /** * Innovation Search Engine API * - * + * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech * Do not edit the class manually. */ + /** * H2020LegalBasis */ -export interface H2020LegalBasis { - id?: string | null; - legalBasis?: string | null; - projectID?: string | null; - title?: string | null; - uniqueProgrammePart?: string | null; +export interface H2020LegalBasis { + id?: string | null; + legalBasis?: string | null; + projectID?: string | null; + title?: string | null; + uniqueProgrammePart?: string | null; } + diff --git a/webapp/src/app/api/model/h2020Organization.ts b/webapp/src/app/api/model/h2020Organization.ts index 26a5acb9..003a00ed 100644 --- a/webapp/src/app/api/model/h2020Organization.ts +++ b/webapp/src/app/api/model/h2020Organization.ts @@ -1,41 +1,43 @@ /** * Innovation Search Engine API * - * + * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech * Do not edit the class manually. */ + /** * H2020Organization */ -export interface H2020Organization { - SME?: boolean | null; - active?: boolean | null; - activityType?: string | null; - city?: string | null; - contactForm?: string | null; - contentUpdateDate?: string | null; - country?: string | null; - ecContribution?: number | null; - endOfParticipation?: boolean | null; - geolocation?: string | null; - id?: string | null; - name?: string | null; - netEcContribution?: number | null; - nutsCode?: string | null; - order?: number | null; - organisationID?: string | null; - organizationURL?: string | null; - postCode?: string | null; - projectAcronym?: string | null; - projectID?: string | null; - rcn?: string | null; - role?: string | null; - shortName?: string | null; - street?: string | null; - totalCost?: number | null; - vatNumber?: string | null; +export interface H2020Organization { + SME?: boolean | null; + active?: boolean | null; + activityType?: string | null; + city?: string | null; + contactForm?: string | null; + contentUpdateDate?: string | null; + country?: string | null; + ecContribution?: number | null; + endOfParticipation?: boolean | null; + geolocation?: string | null; + id?: string | null; + name?: string | null; + netEcContribution?: number | null; + nutsCode?: string | null; + order?: number | null; + organisationID?: string | null; + organizationURL?: string | null; + postCode?: string | null; + projectAcronym?: string | null; + projectID?: string | null; + rcn?: string | null; + role?: string | null; + shortName?: string | null; + street?: string | null; + totalCost?: number | null; + vatNumber?: string | null; } + diff --git a/webapp/src/app/api/model/h2020ProjectDetails.ts b/webapp/src/app/api/model/h2020ProjectDetails.ts index f06b2fe5..7d08134e 100644 --- a/webapp/src/app/api/model/h2020ProjectDetails.ts +++ b/webapp/src/app/api/model/h2020ProjectDetails.ts @@ -1,7 +1,7 @@ /** * Innovation Search Engine API * - * + * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech @@ -17,43 +17,45 @@ import { H2020Topic } from './h2020Topic'; import { H2020EurosciVoc } from './h2020EurosciVoc'; import { H2020Organization } from './h2020Organization'; + /** * Comprehensive Horizon 2020 Project model combining all related entities. This model extends the base H2020Project with all associated data. */ -export interface H2020ProjectDetails { - acronym?: string | null; - contentUpdateDate?: string | null; - ecMaxContribution?: number | null; - ecSignatureDate?: string | null; - endDate?: string | null; - frameworkProgramme?: string | null; - fundingScheme?: string | null; - grantDoi?: string | null; - humanValidated?: boolean | null; - id?: string | null; - keywords?: string | null; - legalBasis?: string | null; - masterCall?: string | null; - nature?: string | null; - objective?: string | null; - rcn?: string | null; - startDate?: string | null; - status?: string | null; - subCall?: string | null; - title?: string | null; - topics?: string | null; - totalCost?: number | null; - organizations?: Array | null; - publications?: Array | null; - deliverables?: Array | null; - reportSummaries?: Array | null; - topicsList?: Array | null; - webLinks?: Array | null; - eurosciVoc?: Array | null; - legalBasisList?: Array | null; - ercPrincipalInvestigators?: Array | null; - organizationCount?: number | null; - publicationCount?: number | null; - deliverableCount?: number | null; - ercPiCount?: number | null; +export interface H2020ProjectDetails { + acronym?: string | null; + contentUpdateDate?: string | null; + ecMaxContribution?: number | null; + ecSignatureDate?: string | null; + endDate?: string | null; + frameworkProgramme?: string | null; + fundingScheme?: string | null; + grantDoi?: string | null; + humanValidated?: boolean | null; + id?: string | null; + keywords?: string | null; + legalBasis?: string | null; + masterCall?: string | null; + nature?: string | null; + objective?: string | null; + rcn?: string | null; + startDate?: string | null; + status?: string | null; + subCall?: string | null; + title?: string | null; + topics?: string | null; + totalCost?: number | null; + organizations?: Array | null; + publications?: Array | null; + deliverables?: Array | null; + reportSummaries?: Array | null; + topicsList?: Array | null; + webLinks?: Array | null; + eurosciVoc?: Array | null; + legalBasisList?: Array | null; + ercPrincipalInvestigators?: Array | null; + organizationCount?: number | null; + publicationCount?: number | null; + deliverableCount?: number | null; + ercPiCount?: number | null; } + diff --git a/webapp/src/app/api/model/h2020Publication.ts b/webapp/src/app/api/model/h2020Publication.ts index bb84dd6e..945e22d2 100644 --- a/webapp/src/app/api/model/h2020Publication.ts +++ b/webapp/src/app/api/model/h2020Publication.ts @@ -1,33 +1,35 @@ /** * Innovation Search Engine API * - * + * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech * Do not edit the class manually. */ + /** * H2020Publication */ -export interface H2020Publication { - authors?: string | null; - collection?: string | null; - contentUpdateDate?: string | null; - doi?: string | null; - id?: string | null; - isPublishedAs?: string | null; - journalNumber?: string | null; - journalTitle?: string | null; - projectAcronym?: string | null; - projectID?: string | null; - publishedPages?: string | null; - publishedYear?: number | null; - publisher?: string | null; - qaProcessedDoi?: string | null; - rcn?: string | null; - repositoryUrl?: string | null; - title?: string | null; - volume?: string | null; +export interface H2020Publication { + authors?: string | null; + collection?: string | null; + contentUpdateDate?: string | null; + doi?: string | null; + id?: string | null; + isPublishedAs?: string | null; + journalNumber?: string | null; + journalTitle?: string | null; + projectAcronym?: string | null; + projectID?: string | null; + publishedPages?: string | null; + publishedYear?: number | null; + publisher?: string | null; + qaProcessedDoi?: string | null; + rcn?: string | null; + repositoryUrl?: string | null; + title?: string | null; + volume?: string | null; } + diff --git a/webapp/src/app/api/model/h2020ReportSummary.ts b/webapp/src/app/api/model/h2020ReportSummary.ts index 2a9989c8..a5975ffb 100644 --- a/webapp/src/app/api/model/h2020ReportSummary.ts +++ b/webapp/src/app/api/model/h2020ReportSummary.ts @@ -1,22 +1,24 @@ /** * Innovation Search Engine API * - * + * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech * Do not edit the class manually. */ + /** * H2020ReportSummary */ -export interface H2020ReportSummary { - attachments?: string | null; - contentUpdateDate?: string | null; - id?: string | null; - projectAcronym?: string | null; - projectID?: string | null; - rcn?: string | null; - title?: string | null; +export interface H2020ReportSummary { + attachments?: string | null; + contentUpdateDate?: string | null; + id?: string | null; + projectAcronym?: string | null; + projectID?: string | null; + rcn?: string | null; + title?: string | null; } + diff --git a/webapp/src/app/api/model/h2020Topic.ts b/webapp/src/app/api/model/h2020Topic.ts index 8573a661..8ddb1991 100644 --- a/webapp/src/app/api/model/h2020Topic.ts +++ b/webapp/src/app/api/model/h2020Topic.ts @@ -1,19 +1,21 @@ /** * Innovation Search Engine API * - * + * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech * Do not edit the class manually. */ + /** * H2020Topic */ -export interface H2020Topic { - id?: string | null; - projectID?: string | null; - title?: string | null; - topic?: string | null; +export interface H2020Topic { + id?: string | null; + projectID?: string | null; + title?: string | null; + topic?: string | null; } + diff --git a/webapp/src/app/api/model/h2020WebLink.ts b/webapp/src/app/api/model/h2020WebLink.ts index ce8e8f93..26d54599 100644 --- a/webapp/src/app/api/model/h2020WebLink.ts +++ b/webapp/src/app/api/model/h2020WebLink.ts @@ -1,25 +1,27 @@ /** * Innovation Search Engine API * - * + * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech * Do not edit the class manually. */ + /** * H2020WebLink */ -export interface H2020WebLink { - archivedDate?: string | null; - availableLanguages?: string | null; - id?: string | null; - linkId?: string | null; - projectID?: string | null; - represents?: string | null; - source?: string | null; - status?: string | null; - type?: string | null; - url?: string | null; +export interface H2020WebLink { + archivedDate?: string | null; + availableLanguages?: string | null; + id?: string | null; + linkId?: string | null; + projectID?: string | null; + represents?: string | null; + source?: string | null; + status?: string | null; + type?: string | null; + url?: string | null; } + diff --git a/webapp/src/app/api/model/hEUDeliverable.ts b/webapp/src/app/api/model/hEUDeliverable.ts index 4645913d..05d8c5ba 100644 --- a/webapp/src/app/api/model/hEUDeliverable.ts +++ b/webapp/src/app/api/model/hEUDeliverable.ts @@ -1,23 +1,25 @@ /** * Innovation Search Engine API * - * + * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech * Do not edit the class manually. */ + /** * HEUDeliverable */ -export interface HEUDeliverable { - collection?: string | null; - contentUpdateDate?: string | null; - deliverableType?: string | null; - description?: string | null; - projectAcronym?: string | null; - projectID?: string | null; - rcn?: string | null; - url?: string | null; +export interface HEUDeliverable { + collection?: string | null; + contentUpdateDate?: string | null; + deliverableType?: string | null; + description?: string | null; + projectAcronym?: string | null; + projectID?: string | null; + rcn?: string | null; + url?: string | null; } + diff --git a/webapp/src/app/api/model/hEUEurosciVoc.ts b/webapp/src/app/api/model/hEUEurosciVoc.ts index 38fe125e..93921ab7 100644 --- a/webapp/src/app/api/model/hEUEurosciVoc.ts +++ b/webapp/src/app/api/model/hEUEurosciVoc.ts @@ -1,21 +1,23 @@ /** * Innovation Search Engine API * - * + * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech * Do not edit the class manually. */ + /** * HEUEurosciVoc */ -export interface HEUEurosciVoc { - code?: string | null; - description?: string | null; - id?: string | null; - path?: string | null; - projectID?: string | null; - title?: string | null; +export interface HEUEurosciVoc { + code?: string | null; + description?: string | null; + id?: string | null; + path?: string | null; + projectID?: string | null; + title?: string | null; } + diff --git a/webapp/src/app/api/model/hEULegalBasis.ts b/webapp/src/app/api/model/hEULegalBasis.ts index a02eebd0..e3cb66ca 100644 --- a/webapp/src/app/api/model/hEULegalBasis.ts +++ b/webapp/src/app/api/model/hEULegalBasis.ts @@ -1,20 +1,22 @@ /** * Innovation Search Engine API * - * + * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech * Do not edit the class manually. */ + /** * HEULegalBasis */ -export interface HEULegalBasis { - id?: string | null; - legalBasis?: string | null; - projectID?: string | null; - title?: string | null; - uniqueProgrammePart?: string | null; +export interface HEULegalBasis { + id?: string | null; + legalBasis?: string | null; + projectID?: string | null; + title?: string | null; + uniqueProgrammePart?: string | null; } + diff --git a/webapp/src/app/api/model/hEUOrganization.ts b/webapp/src/app/api/model/hEUOrganization.ts index 1dcd1615..6bb193ef 100644 --- a/webapp/src/app/api/model/hEUOrganization.ts +++ b/webapp/src/app/api/model/hEUOrganization.ts @@ -1,41 +1,43 @@ /** * Innovation Search Engine API * - * + * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech * Do not edit the class manually. */ + /** * HEUOrganization */ -export interface HEUOrganization { - SME?: boolean | null; - active?: boolean | null; - activityType?: string | null; - city?: string | null; - contactForm?: string | null; - contentUpdateDate?: string | null; - country?: string | null; - ecContribution?: number | null; - endOfParticipation?: boolean | null; - geolocation?: string | null; - id?: string | null; - name?: string | null; - netEcContribution?: number | null; - nutsCode?: string | null; - order?: number | null; - organisationID?: string | null; - organizationURL?: string | null; - postCode?: string | null; - projectAcronym?: string | null; - projectID?: string | null; - rcn?: string | null; - role?: string | null; - shortName?: string | null; - street?: string | null; - totalCost?: number | null; - vatNumber?: string | null; +export interface HEUOrganization { + SME?: boolean | null; + active?: boolean | null; + activityType?: string | null; + city?: string | null; + contactForm?: string | null; + contentUpdateDate?: string | null; + country?: string | null; + ecContribution?: number | null; + endOfParticipation?: boolean | null; + geolocation?: string | null; + id?: string | null; + name?: string | null; + netEcContribution?: number | null; + nutsCode?: string | null; + order?: number | null; + organisationID?: string | null; + organizationURL?: string | null; + postCode?: string | null; + projectAcronym?: string | null; + projectID?: string | null; + rcn?: string | null; + role?: string | null; + shortName?: string | null; + street?: string | null; + totalCost?: number | null; + vatNumber?: string | null; } + diff --git a/webapp/src/app/api/model/hEUProjectDetails.ts b/webapp/src/app/api/model/hEUProjectDetails.ts index f7a46271..8a897435 100644 --- a/webapp/src/app/api/model/hEUProjectDetails.ts +++ b/webapp/src/app/api/model/hEUProjectDetails.ts @@ -1,7 +1,7 @@ /** * Innovation Search Engine API * - * + * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech @@ -16,41 +16,43 @@ import { HEUReportSummary } from './hEUReportSummary'; import { HEUDeliverable } from './hEUDeliverable'; import { HEUEurosciVoc } from './hEUEurosciVoc'; + /** * Comprehensive Horizon Europe Project model combining all related entities. This model extends the base HEUProject with all associated data. */ -export interface HEUProjectDetails { - acronym?: string | null; - contentUpdateDate?: string | null; - ecMaxContribution?: number | null; - ecSignatureDate?: string | null; - endDate?: string | null; - frameworkProgramme?: string | null; - fundingScheme?: string | null; - grantDoi?: string | null; - humanValidated?: boolean | null; - id?: string | null; - keywords?: string | null; - legalBasis?: string | null; - masterCall?: string | null; - nature?: string | null; - objective?: string | null; - rcn?: string | null; - startDate?: string | null; - status?: string | null; - subCall?: string | null; - title?: string | null; - topics?: string | null; - totalCost?: number | null; - organizations?: Array | null; - publications?: Array | null; - deliverables?: Array | null; - reportSummaries?: Array | null; - topicsList?: Array | null; - webLinks?: Array | null; - eurosciVoc?: Array | null; - legalBasisList?: Array | null; - organizationCount?: number | null; - publicationCount?: number | null; - deliverableCount?: number | null; +export interface HEUProjectDetails { + acronym?: string | null; + contentUpdateDate?: string | null; + ecMaxContribution?: number | null; + ecSignatureDate?: string | null; + endDate?: string | null; + frameworkProgramme?: string | null; + fundingScheme?: string | null; + grantDoi?: string | null; + humanValidated?: boolean | null; + id?: string | null; + keywords?: string | null; + legalBasis?: string | null; + masterCall?: string | null; + nature?: string | null; + objective?: string | null; + rcn?: string | null; + startDate?: string | null; + status?: string | null; + subCall?: string | null; + title?: string | null; + topics?: string | null; + totalCost?: number | null; + organizations?: Array | null; + publications?: Array | null; + deliverables?: Array | null; + reportSummaries?: Array | null; + topicsList?: Array | null; + webLinks?: Array | null; + eurosciVoc?: Array | null; + legalBasisList?: Array | null; + organizationCount?: number | null; + publicationCount?: number | null; + deliverableCount?: number | null; } + diff --git a/webapp/src/app/api/model/hEUPublication.ts b/webapp/src/app/api/model/hEUPublication.ts index 86d59473..4d067177 100644 --- a/webapp/src/app/api/model/hEUPublication.ts +++ b/webapp/src/app/api/model/hEUPublication.ts @@ -1,33 +1,35 @@ /** * Innovation Search Engine API * - * + * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech * Do not edit the class manually. */ + /** * HEUPublication */ -export interface HEUPublication { - authors?: string | null; - collection?: string | null; - contentUpdateDate?: string | null; - doi?: string | null; - id?: string | null; - isPublishedAs?: string | null; - journalNumber?: string | null; - journalTitle?: string | null; - projectAcronym?: string | null; - projectID?: string | null; - publishedPages?: string | null; - publishedYear?: number | null; - publisher?: string | null; - qaProcessedDoi?: string | null; - rcn?: string | null; - repositoryUrl?: string | null; - title?: string | null; - volume?: string | null; +export interface HEUPublication { + authors?: string | null; + collection?: string | null; + contentUpdateDate?: string | null; + doi?: string | null; + id?: string | null; + isPublishedAs?: string | null; + journalNumber?: string | null; + journalTitle?: string | null; + projectAcronym?: string | null; + projectID?: string | null; + publishedPages?: string | null; + publishedYear?: number | null; + publisher?: string | null; + qaProcessedDoi?: string | null; + rcn?: string | null; + repositoryUrl?: string | null; + title?: string | null; + volume?: string | null; } + diff --git a/webapp/src/app/api/model/hEUReportSummary.ts b/webapp/src/app/api/model/hEUReportSummary.ts index 94f58b4c..b9e1a299 100644 --- a/webapp/src/app/api/model/hEUReportSummary.ts +++ b/webapp/src/app/api/model/hEUReportSummary.ts @@ -1,22 +1,24 @@ /** * Innovation Search Engine API * - * + * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech * Do not edit the class manually. */ + /** * HEUReportSummary */ -export interface HEUReportSummary { - attachments?: string | null; - contentUpdateDate?: string | null; - id?: string | null; - projectAcronym?: string | null; - projectID?: string | null; - rcn?: string | null; - title?: string | null; +export interface HEUReportSummary { + attachments?: string | null; + contentUpdateDate?: string | null; + id?: string | null; + projectAcronym?: string | null; + projectID?: string | null; + rcn?: string | null; + title?: string | null; } + diff --git a/webapp/src/app/api/model/hEUTopic.ts b/webapp/src/app/api/model/hEUTopic.ts index ccd60c27..a0a5e764 100644 --- a/webapp/src/app/api/model/hEUTopic.ts +++ b/webapp/src/app/api/model/hEUTopic.ts @@ -1,19 +1,21 @@ /** * Innovation Search Engine API * - * + * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech * Do not edit the class manually. */ + /** * HEUTopic */ -export interface HEUTopic { - id?: string | null; - projectID?: string | null; - title?: string | null; - topic?: string | null; +export interface HEUTopic { + id?: string | null; + projectID?: string | null; + title?: string | null; + topic?: string | null; } + diff --git a/webapp/src/app/api/model/hEUWebLink.ts b/webapp/src/app/api/model/hEUWebLink.ts index 1159d2a6..81c5d60f 100644 --- a/webapp/src/app/api/model/hEUWebLink.ts +++ b/webapp/src/app/api/model/hEUWebLink.ts @@ -1,25 +1,27 @@ /** * Innovation Search Engine API * - * + * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech * Do not edit the class manually. */ + /** * HEUWebLink */ -export interface HEUWebLink { - archivedDate?: string | null; - availableLanguages?: string | null; - id?: string | null; - linkId?: string | null; - projectID?: string | null; - represents?: string | null; - source?: string | null; - status?: string | null; - type?: string | null; - url?: string | null; +export interface HEUWebLink { + archivedDate?: string | null; + availableLanguages?: string | null; + id?: string | null; + linkId?: string | null; + projectID?: string | null; + represents?: string | null; + source?: string | null; + status?: string | null; + type?: string | null; + url?: string | null; } + diff --git a/webapp/src/app/api/model/hTTPValidationError.ts b/webapp/src/app/api/model/hTTPValidationError.ts index c8e65c3e..f624be37 100644 --- a/webapp/src/app/api/model/hTTPValidationError.ts +++ b/webapp/src/app/api/model/hTTPValidationError.ts @@ -1,7 +1,7 @@ /** * Innovation Search Engine API * - * + * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech @@ -9,6 +9,8 @@ */ import { ValidationError } from './validationError'; -export interface HTTPValidationError { - detail?: Array; + +export interface HTTPValidationError { + detail?: Array; } + diff --git a/webapp/src/app/api/model/idTokenMetadata.ts b/webapp/src/app/api/model/idTokenMetadata.ts index ab99fb1c..5398083d 100644 --- a/webapp/src/app/api/model/idTokenMetadata.ts +++ b/webapp/src/app/api/model/idTokenMetadata.ts @@ -1,7 +1,7 @@ /** * Innovation Search Engine API * - * + * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech @@ -9,22 +9,26 @@ */ import { TokenType } from './tokenType'; -export interface IdTokenMetadata { - /** - * The unique identifier of the real account associated with this token. - */ - real_account_id: string; - /** - * The timestamp indicating when the token will expire. - */ - expires_at: string; - /** - * The epoch value for the token. Used for versioning of tokens. - */ - epoch?: number; - /** - * The type of the token, which is always ID_TOKEN for this class. - */ - token_type?: TokenType; + +export interface IdTokenMetadata { + /** + * The unique identifier of the real account associated with this token. + */ + real_account_id: string; + /** + * The timestamp indicating when the token will expire. + */ + expires_at: string; + /** + * The epoch value for the token. Used for versioning of tokens. + */ + epoch?: number; + /** + * The type of the token, which is always ID_TOKEN for this class. + */ + token_type?: TokenType; } -export namespace IdTokenMetadata {} +export namespace IdTokenMetadata { +} + + diff --git a/webapp/src/app/api/model/inseAccountManagementModelOrganizationProfile.ts b/webapp/src/app/api/model/inseAccountManagementModelOrganizationProfile.ts index 47235351..c67acc71 100644 --- a/webapp/src/app/api/model/inseAccountManagementModelOrganizationProfile.ts +++ b/webapp/src/app/api/model/inseAccountManagementModelOrganizationProfile.ts @@ -1,15 +1,17 @@ /** * Innovation Search Engine API * - * + * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech * Do not edit the class manually. */ -export interface InseAccountManagementModelOrganizationProfile { - id: string; - name: string; - openalex_institution_id?: string | null; + +export interface InseAccountManagementModelOrganizationProfile { + id: string; + name: string; + openalex_institution_id?: string | null; } + diff --git a/webapp/src/app/api/model/inseModelsOpenalexWorkPageWorkPage.ts b/webapp/src/app/api/model/inseModelsOpenalexWorkPageWorkPage.ts deleted file mode 100644 index b9639318..00000000 --- a/webapp/src/app/api/model/inseModelsOpenalexWorkPageWorkPage.ts +++ /dev/null @@ -1,33 +0,0 @@ -/** - * Innovation Search Engine API - * - * - * - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * https://openapi-generator.tech - * Do not edit the class manually. - */ -import { Work } from './work'; - -export interface InseModelsOpenalexWorkPageWorkPage { - /** - * Total number of works matching the query - */ - total: number; - /** - * List of works on the current page - */ - elements: Array; - /** - * Offset of the current page - */ - offset: number; - /** - * Size of the current page - */ - size: number; - /** - * Indicates if the current page is the last page - */ - last_page: boolean; -} diff --git a/webapp/src/app/api/model/inseOrganizationManagementModelOrganizationProfile.ts b/webapp/src/app/api/model/inseOrganizationManagementModelOrganizationProfile.ts index 8f9f0e6b..404df0f9 100644 --- a/webapp/src/app/api/model/inseOrganizationManagementModelOrganizationProfile.ts +++ b/webapp/src/app/api/model/inseOrganizationManagementModelOrganizationProfile.ts @@ -1,17 +1,19 @@ /** * Innovation Search Engine API * - * + * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech * Do not edit the class manually. */ -export interface InseOrganizationManagementModelOrganizationProfile { - id: string; - name: string; - other_inst_id?: string | null; - deleted: boolean; - member_count: number; + +export interface InseOrganizationManagementModelOrganizationProfile { + id: string; + name: string; + other_inst_id?: string | null; + deleted: boolean; + member_count: number; } + diff --git a/webapp/src/app/api/model/inseWorksV2ModelWorkPage.ts b/webapp/src/app/api/model/inseWorksV2ModelWorkPage.ts deleted file mode 100644 index 36512985..00000000 --- a/webapp/src/app/api/model/inseWorksV2ModelWorkPage.ts +++ /dev/null @@ -1,29 +0,0 @@ -/** - * Innovation Search Engine API - * - * - * - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * https://openapi-generator.tech - * Do not edit the class manually. - */ -import { Work } from './work'; - -export interface InseWorksV2ModelWorkPage { - /** - * The elements of the page. - */ - elements?: Array; - /** - * The page number. (0-based) - */ - page?: number; - /** - * The page size in elements. - */ - size?: number; - /** - * The total number of elements. - */ - total?: number; -} diff --git a/webapp/src/app/api/model/institution.ts b/webapp/src/app/api/model/institution.ts index c099fc57..6b1a5778 100644 --- a/webapp/src/app/api/model/institution.ts +++ b/webapp/src/app/api/model/institution.ts @@ -1,7 +1,7 @@ /** * Innovation Search Engine API * - * + * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech @@ -12,28 +12,30 @@ import { AuthorCountsByYearInner } from './authorCountsByYearInner'; import { AuthorSummaryStats } from './authorSummaryStats'; import { InstitutionGeo } from './institutionGeo'; + /** * A university, research organization, or other affiliation */ -export interface Institution { - id?: string | null; - ror?: string | null; - display_name?: string | null; - country_code?: string | null; - type?: string | null; - homepage_url?: string | null; - image_url?: string | null; - image_thumbnail_url?: string | null; - display_name_acronyms?: Array | null; - display_name_alternatives?: Array | null; - works_count?: number | null; - cited_by_count?: number | null; - summary_stats?: AuthorSummaryStats | null; - geo?: InstitutionGeo | null; - lineage?: Array | null; - ids?: InstitutionIds | null; - counts_by_year?: Array | null; - works_api_url?: string | null; - created_date?: string | null; - updated_date?: string | null; +export interface Institution { + id?: string | null; + ror?: string | null; + display_name?: string | null; + country_code?: string | null; + type?: string | null; + homepage_url?: string | null; + image_url?: string | null; + image_thumbnail_url?: string | null; + display_name_acronyms?: Array | null; + display_name_alternatives?: Array | null; + works_count?: number | null; + cited_by_count?: number | null; + summary_stats?: AuthorSummaryStats | null; + geo?: InstitutionGeo | null; + lineage?: Array | null; + ids?: InstitutionIds | null; + counts_by_year?: Array | null; + works_api_url?: string | null; + created_date?: string | null; + updated_date?: string | null; } + diff --git a/webapp/src/app/api/model/institutionFunderSummary.ts b/webapp/src/app/api/model/institutionFunderSummary.ts index cf15754a..48d147b2 100644 --- a/webapp/src/app/api/model/institutionFunderSummary.ts +++ b/webapp/src/app/api/model/institutionFunderSummary.ts @@ -1,7 +1,7 @@ /** * Innovation Search Engine API * - * + * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech @@ -9,18 +9,22 @@ */ import { ProjectType } from './projectType'; -export interface InstitutionFunderSummary { - /** - * The type of funding data (e.g., \'bund\', \'eu\', \'dfg\'). - */ - type: ProjectType; - /** - * A dictionary mapping years to total funding amounts for that year. - */ - funding_per_year?: object; - /** - * The average annual funding over the continuous period covered by the data. - */ - annual_average_over_period?: number; + +export interface InstitutionFunderSummary { + /** + * The type of funding data (e.g., \'bund\', \'eu\', \'dfg\'). + */ + type: ProjectType; + /** + * A dictionary mapping years to total funding amounts for that year. + */ + funding_per_year?: object; + /** + * The average annual funding over the continuous period covered by the data. + */ + annual_average_over_period?: number; } -export namespace InstitutionFunderSummary {} +export namespace InstitutionFunderSummary { +} + + diff --git a/webapp/src/app/api/model/institutionGeo.ts b/webapp/src/app/api/model/institutionGeo.ts index b438d37c..949b73f4 100644 --- a/webapp/src/app/api/model/institutionGeo.ts +++ b/webapp/src/app/api/model/institutionGeo.ts @@ -1,7 +1,7 @@ /** * Innovation Search Engine API * - * + * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech @@ -10,15 +10,17 @@ import { Latitude } from './latitude'; import { Longitude } from './longitude'; + /** * Location information: */ -export interface InstitutionGeo { - city?: string | null; - geonames_city_id?: string | null; - region?: string | null; - country_code?: string | null; - country?: string | null; - latitude?: Latitude | null; - longitude?: Longitude | null; +export interface InstitutionGeo { + city?: string | null; + geonames_city_id?: string | null; + region?: string | null; + country_code?: string | null; + country?: string | null; + latitude?: Latitude | null; + longitude?: Longitude | null; } + diff --git a/webapp/src/app/api/model/institutionIds.ts b/webapp/src/app/api/model/institutionIds.ts index fd952098..93d801e1 100644 --- a/webapp/src/app/api/model/institutionIds.ts +++ b/webapp/src/app/api/model/institutionIds.ts @@ -1,21 +1,23 @@ /** * Innovation Search Engine API * - * + * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech * Do not edit the class manually. */ + /** * External identifiers: */ -export interface InstitutionIds { - openalex?: string | null; - ror?: string | null; - mag?: number | null; - grid?: string | null; - wikipedia?: string | null; - wikidata?: string | null; +export interface InstitutionIds { + openalex?: string | null; + ror?: string | null; + mag?: number | null; + grid?: string | null; + wikipedia?: string | null; + wikidata?: string | null; } + diff --git a/webapp/src/app/api/model/institutionInformation.ts b/webapp/src/app/api/model/institutionInformation.ts index 9e12986d..e287b0fa 100644 --- a/webapp/src/app/api/model/institutionInformation.ts +++ b/webapp/src/app/api/model/institutionInformation.ts @@ -1,20 +1,22 @@ /** * Innovation Search Engine API * - * + * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech * Do not edit the class manually. */ -export interface InstitutionInformation { - /** - * The raw institution ID of the institution. - */ - raw_id: string; - /** - * The display name of the institution. - */ - display_name: string; + +export interface InstitutionInformation { + /** + * The raw institution ID of the institution. + */ + raw_id: string; + /** + * The display name of the institution. + */ + display_name: string; } + diff --git a/webapp/src/app/api/model/institutionNetworkNode.ts b/webapp/src/app/api/model/institutionNetworkNode.ts index 791645b7..a558a8cf 100644 --- a/webapp/src/app/api/model/institutionNetworkNode.ts +++ b/webapp/src/app/api/model/institutionNetworkNode.ts @@ -1,7 +1,7 @@ /** * Innovation Search Engine API * - * + * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech @@ -9,18 +9,22 @@ */ import { CollaborationNetworkNodeType } from './collaborationNetworkNodeType'; -export interface InstitutionNetworkNode { - /** - * The raw ID of the node. For an author node, this is the raw person ID. For an institution node, this is the raw institution ID. For a work node, this is the raw work ID. - */ - raw_id: string; - /** - * The display name of the node. - */ - display_name: string; - /** - * The category of the node, either \'author\', \'institution\', or \'work\'. - */ - category: CollaborationNetworkNodeType; + +export interface InstitutionNetworkNode { + /** + * The raw ID of the node. For an author node, this is the raw person ID. For an institution node, this is the raw institution ID. For a work node, this is the raw work ID. + */ + raw_id: string; + /** + * The display name of the node. + */ + display_name: string; + /** + * The category of the node, either \'author\', \'institution\', or \'work\'. + */ + category: CollaborationNetworkNodeType; } -export namespace InstitutionNetworkNode {} +export namespace InstitutionNetworkNode { +} + + diff --git a/webapp/src/app/api/model/institutionPage.ts b/webapp/src/app/api/model/institutionPage.ts index b7640651..01267ee3 100644 --- a/webapp/src/app/api/model/institutionPage.ts +++ b/webapp/src/app/api/model/institutionPage.ts @@ -1,7 +1,7 @@ /** * Innovation Search Engine API * - * + * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech @@ -9,21 +9,23 @@ */ import { Institution } from './institution'; -export interface InstitutionPage { - /** - * List of institutions in the current page. - */ - elements?: Array; - /** - * Current page number. (0-indexed) - */ - page?: number; - /** - * Number of institutions per page. - */ - size?: number; - /** - * Total number of institutions matching the search criteria. - */ - total?: number; + +export interface InstitutionPage { + /** + * List of institutions in the current page. + */ + elements?: Array; + /** + * Current page number. (0-indexed) + */ + page?: number; + /** + * Number of institutions per page. + */ + size?: number; + /** + * Total number of institutions matching the search criteria. + */ + total?: number; } + diff --git a/webapp/src/app/api/model/institutionPageV2.ts b/webapp/src/app/api/model/institutionPageV2.ts new file mode 100644 index 00000000..8fe4ca78 --- /dev/null +++ b/webapp/src/app/api/model/institutionPageV2.ts @@ -0,0 +1,31 @@ +/** + * Innovation Search Engine API + * + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ +import { Institution } from './institution'; + + +export interface InstitutionPageV2 { + /** + * The elements of the page. + */ + elements?: Array; + /** + * The page number. (0-based) + */ + page?: number; + /** + * The page size in elements. + */ + size?: number; + /** + * The total number of elements. + */ + total?: number; +} + diff --git a/webapp/src/app/api/model/institutionsListResponse.ts b/webapp/src/app/api/model/institutionsListResponse.ts index 0ac2c185..908d72fe 100644 --- a/webapp/src/app/api/model/institutionsListResponse.ts +++ b/webapp/src/app/api/model/institutionsListResponse.ts @@ -1,7 +1,7 @@ /** * Innovation Search Engine API * - * + * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech @@ -11,11 +11,13 @@ import { Meta } from './meta'; import { Institution } from './institution'; import { GroupByResult } from './groupByResult'; + /** * InstitutionsListResponse */ -export interface InstitutionsListResponse { - meta?: Meta | null; - results?: Array | null; - group_by?: Array | null; +export interface InstitutionsListResponse { + meta?: Meta | null; + results?: Array | null; + group_by?: Array | null; } + diff --git a/webapp/src/app/api/model/ipcClassification.ts b/webapp/src/app/api/model/ipcClassification.ts index b7e65c0d..74805329 100644 --- a/webapp/src/app/api/model/ipcClassification.ts +++ b/webapp/src/app/api/model/ipcClassification.ts @@ -1,18 +1,20 @@ /** * Innovation Search Engine API * - * + * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech * Do not edit the class manually. */ -export interface IpcClassification { - symbol: string; - section?: string | null; - class?: string | null; - subclass?: string | null; - main_group?: string | null; - subgroup?: string | null; + +export interface IpcClassification { + symbol: string; + section?: string | null; + 'class'?: string | null; + subclass?: string | null; + main_group?: string | null; + subgroup?: string | null; } + diff --git a/webapp/src/app/api/model/keywordEntry.ts b/webapp/src/app/api/model/keywordEntry.ts index 94dd6e18..e8e9cc5c 100644 --- a/webapp/src/app/api/model/keywordEntry.ts +++ b/webapp/src/app/api/model/keywordEntry.ts @@ -1,20 +1,22 @@ /** * Innovation Search Engine API * - * + * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech * Do not edit the class manually. */ -export interface KeywordEntry { - /** - * The extracted keyword. - */ - keyword: string; - /** - * The relevance score of the keyword. - */ - relevance_score: number; + +export interface KeywordEntry { + /** + * The extracted keyword. + */ + keyword: string; + /** + * The relevance score of the keyword. + */ + relevance_score: number; } + diff --git a/webapp/src/app/api/model/keywordEntryWithTopic.ts b/webapp/src/app/api/model/keywordEntryWithTopic.ts index 4670f554..6680e773 100644 --- a/webapp/src/app/api/model/keywordEntryWithTopic.ts +++ b/webapp/src/app/api/model/keywordEntryWithTopic.ts @@ -1,7 +1,7 @@ /** * Innovation Search Engine API * - * + * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech @@ -10,10 +10,12 @@ import { KeywordEntry } from './keywordEntry'; import { KeywordTopicMatch } from './keywordTopicMatch'; -export interface KeywordEntryWithTopic { - /** - * The keyword extracted by the LLM. - */ - llm_keyword: KeywordEntry; - topic_mapping?: KeywordTopicMatch | null; + +export interface KeywordEntryWithTopic { + /** + * The keyword extracted by the LLM. + */ + llm_keyword: KeywordEntry; + topic_mapping?: KeywordTopicMatch | null; } + diff --git a/webapp/src/app/api/model/keywordEvidence.ts b/webapp/src/app/api/model/keywordEvidence.ts new file mode 100644 index 00000000..a8a78209 --- /dev/null +++ b/webapp/src/app/api/model/keywordEvidence.ts @@ -0,0 +1,28 @@ +/** + * Innovation Search Engine API + * + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +/** + * Traceable title/abstract evidence for keyword text retrieval. + */ +export interface KeywordEvidence { + phrase_in_title?: boolean; + phrase_in_abstract?: boolean; + full_token_match?: boolean; + partial_token_match?: boolean; + word_match_score?: number; + matched_phrases?: Array; + matched_words?: Array; + /** + * phrase_title | phrase_abstract | full_token | partial_token | none + */ + text_match_kind?: string; +} + diff --git a/webapp/src/app/api/model/keywordPatentLevel.ts b/webapp/src/app/api/model/keywordPatentLevel.ts new file mode 100644 index 00000000..3522ae9e --- /dev/null +++ b/webapp/src/app/api/model/keywordPatentLevel.ts @@ -0,0 +1,19 @@ +/** + * Innovation Search Engine API + * + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +export const KeywordPatentLevel = { + Broad: 'broad', + Coarse: 'coarse', + Fine: 'fine', + Custom: 'custom' +} as const; +export type KeywordPatentLevel = typeof KeywordPatentLevel[keyof typeof KeywordPatentLevel]; + diff --git a/webapp/src/app/api/model/keywordPatentMappingStatus.ts b/webapp/src/app/api/model/keywordPatentMappingStatus.ts new file mode 100644 index 00000000..a820fed5 --- /dev/null +++ b/webapp/src/app/api/model/keywordPatentMappingStatus.ts @@ -0,0 +1,20 @@ +/** + * Innovation Search Engine API + * + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +export const KeywordPatentMappingStatus = { + Mapped: 'mapped', + Uncertain: 'uncertain', + NoMapping: 'no_mapping', + NoPatentsFound: 'no_patents_found', + SearchError: 'search_error' +} as const; +export type KeywordPatentMappingStatus = typeof KeywordPatentMappingStatus[keyof typeof KeywordPatentMappingStatus]; + diff --git a/webapp/src/app/api/model/keywordPatentMatch.ts b/webapp/src/app/api/model/keywordPatentMatch.ts index 59dfeaae..5b7c4068 100644 --- a/webapp/src/app/api/model/keywordPatentMatch.ts +++ b/webapp/src/app/api/model/keywordPatentMatch.ts @@ -1,32 +1,41 @@ /** * Innovation Search Engine API * - * + * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech * Do not edit the class manually. */ +import { KeywordEvidence } from './keywordEvidence'; import { PatentEntry } from './patentEntry'; -export interface KeywordPatentMatch { - patent: PatentEntry; - /** - * Combined match quality score. - */ - match_score: number; - /** - * IPC/CPC classification match score. - */ - ipc_score: number; - /** - * OpenAlex topic overlap score (0 or 1). - */ - topic_score: number; - /** - * Title/abstract keyword overlap score. - */ - text_score: number; - matched_keywords?: Array; - matched_ipc_symbols?: Array; + +export interface KeywordPatentMatch { + patent: PatentEntry; + /** + * Combined match quality score. + */ + match_score: number; + /** + * IPC/CPC classification match score. + */ + ipc_score: number; + /** + * Graded OpenAlex topic overlap: 1.0 topic_id, 0.7 subfield, 0.3 compatible field, 0.0 none. + */ + topic_score: number; + /** + * Title/abstract keyword overlap score. + */ + text_score: number; + matched_keywords?: Array; + matched_ipc_symbols?: Array; + /** + * True when the patent was retrieved via title/abstract keyword search because IPC mapping was uncertain, missing, or yielded no hits. + */ + text_retrieval?: boolean; + keyword_evidence?: KeywordEvidence | null; + topic_match_kind?: string | null; } + diff --git a/webapp/src/app/api/model/keywordPatentSearchDiagnostics.ts b/webapp/src/app/api/model/keywordPatentSearchDiagnostics.ts new file mode 100644 index 00000000..753ef4dd --- /dev/null +++ b/webapp/src/app/api/model/keywordPatentSearchDiagnostics.ts @@ -0,0 +1,32 @@ +/** + * Innovation Search Engine API + * + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +/** + * Pipeline counters for evaluation (no effect on ranking thresholds). + */ +export interface KeywordPatentSearchDiagnostics { + /** + * ipc | text | none + */ + search_path: string; + es_query_size_per_index?: number; + raw_patents_after_dedupe?: number; + filtered_by_ipc?: number; + filtered_by_relevance_gate?: number; + filtered_by_min_score?: number; + passed_relevance_gate?: number; + scored_before_cap?: number; + returned?: number; + max_patents_cap?: number; + hit_return_cap?: boolean; + ipc_cluster_selections?: Array; +} + diff --git a/webapp/src/app/api/model/keywordPatentSearchItem.ts b/webapp/src/app/api/model/keywordPatentSearchItem.ts index ef706532..c7521f63 100644 --- a/webapp/src/app/api/model/keywordPatentSearchItem.ts +++ b/webapp/src/app/api/model/keywordPatentSearchItem.ts @@ -1,35 +1,31 @@ /** * Innovation Search Engine API * - * + * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech * Do not edit the class manually. */ +import { KeywordPatentLevel } from './keywordPatentLevel'; -export interface KeywordPatentSearchItem { - /** - * Extracted keyword text. - */ - keyword: string; - keyword_level?: KeywordPatentSearchItem.KeywordLevelEnum | null; - topic_id?: string | null; - topic_display_name?: string | null; - subfield_name?: string | null; - field_name?: string | null; - /** - * LLM relevance score for the keyword. - */ - relevance_score?: number; + +export interface KeywordPatentSearchItem { + /** + * Extracted keyword text. + */ + keyword: string; + keyword_level?: KeywordPatentLevel | null; + topic_id?: string | null; + topic_display_name?: string | null; + subfield_name?: string | null; + field_name?: string | null; + /** + * LLM relevance score for the keyword. + */ + relevance_score?: number; } export namespace KeywordPatentSearchItem { - export const KeywordLevelEnum = { - Broad: 'broad', - Coarse: 'coarse', - Fine: 'fine', - Custom: 'custom', - } as const; - export type KeywordLevelEnum = - (typeof KeywordLevelEnum)[keyof typeof KeywordLevelEnum]; } + + diff --git a/webapp/src/app/api/model/keywordTopicMatch.ts b/webapp/src/app/api/model/keywordTopicMatch.ts index ee4c8326..f9c2ab49 100644 --- a/webapp/src/app/api/model/keywordTopicMatch.ts +++ b/webapp/src/app/api/model/keywordTopicMatch.ts @@ -1,7 +1,7 @@ /** * Innovation Search Engine API * - * + * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech @@ -9,7 +9,9 @@ */ import { Topic } from './topic'; -export interface KeywordTopicMatch { - keyword: string; - topic?: Topic | null; + +export interface KeywordTopicMatch { + keyword: string; + topic?: Topic | null; } + diff --git a/webapp/src/app/api/model/keywords.ts b/webapp/src/app/api/model/keywords.ts index d93b5fe0..c65c7600 100644 --- a/webapp/src/app/api/model/keywords.ts +++ b/webapp/src/app/api/model/keywords.ts @@ -1,14 +1,17 @@ /** * Innovation Search Engine API * - * + * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech * Do not edit the class manually. */ + /** * Keywords associated with the project */ -export interface Keywords {} +export interface Keywords { +} + diff --git a/webapp/src/app/api/model/keywordsRequest.ts b/webapp/src/app/api/model/keywordsRequest.ts index 094ed97b..8acb7082 100644 --- a/webapp/src/app/api/model/keywordsRequest.ts +++ b/webapp/src/app/api/model/keywordsRequest.ts @@ -1,7 +1,7 @@ /** * Innovation Search Engine API * - * + * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech @@ -9,18 +9,20 @@ */ import { FileUpload } from './fileUpload'; -export interface KeywordsRequest { - /** - * The input text from which to extract keywords. - */ - query: string; - files?: Array | null; - /** - * The mode of keyword extraction, e.g., \'url\', \'text\', or \'keywords\'. - */ - mode: string; - /** - * The maximum number of keywords to extract. - */ - limit?: number; + +export interface KeywordsRequest { + /** + * The input text from which to extract keywords. + */ + query: string; + files?: Array | null; + /** + * The mode of keyword extraction, e.g., \'url\', \'text\', or \'keywords\'. + */ + mode: string; + /** + * The maximum number of keywords to extract. + */ + limit?: number; } + diff --git a/webapp/src/app/api/model/keywordsTopicsRequest.ts b/webapp/src/app/api/model/keywordsTopicsRequest.ts index 883ed079..8810bf5f 100644 --- a/webapp/src/app/api/model/keywordsTopicsRequest.ts +++ b/webapp/src/app/api/model/keywordsTopicsRequest.ts @@ -1,16 +1,18 @@ /** * Innovation Search Engine API * - * + * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech * Do not edit the class manually. */ -export interface KeywordsTopicsRequest { - /** - * List of keywords/sentences to query by similarity. - */ - keywords: Array; + +export interface KeywordsTopicsRequest { + /** + * List of keywords/sentences to query by similarity. + */ + keywords: Array; } + diff --git a/webapp/src/app/api/model/keywordsTopicsResponse.ts b/webapp/src/app/api/model/keywordsTopicsResponse.ts index 78a2f9d2..4aee622f 100644 --- a/webapp/src/app/api/model/keywordsTopicsResponse.ts +++ b/webapp/src/app/api/model/keywordsTopicsResponse.ts @@ -1,7 +1,7 @@ /** * Innovation Search Engine API * - * + * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech @@ -9,9 +9,11 @@ */ import { KeywordTopicMatch } from './keywordTopicMatch'; -export interface KeywordsTopicsResponse { - /** - * Top matching topics for each keyword in the requested list. - */ - results: Array; + +export interface KeywordsTopicsResponse { + /** + * Top matching topics for each keyword in the requested list. + */ + results: Array; } + diff --git a/webapp/src/app/api/model/latitude.ts b/webapp/src/app/api/model/latitude.ts index 8fb58a9b..fe6b49aa 100644 --- a/webapp/src/app/api/model/latitude.ts +++ b/webapp/src/app/api/model/latitude.ts @@ -1,11 +1,14 @@ /** * Innovation Search Engine API * - * + * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech * Do not edit the class manually. */ -export interface Latitude {} + +export interface Latitude { +} + diff --git a/webapp/src/app/api/model/location.ts b/webapp/src/app/api/model/location.ts index f92e2ffb..f207d751 100644 --- a/webapp/src/app/api/model/location.ts +++ b/webapp/src/app/api/model/location.ts @@ -1,7 +1,7 @@ /** * Innovation Search Engine API * - * + * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech @@ -9,17 +9,19 @@ */ import { DehydratedSource } from './dehydratedSource'; + /** * Where a work is hosted */ -export interface Location { - is_oa?: boolean | null; - landing_page_url?: string | null; - pdf_url?: string | null; - source?: DehydratedSource | null; - license?: string | null; - license_id?: string | null; - version?: string | null; - is_accepted?: boolean | null; - is_published?: boolean | null; +export interface Location { + is_oa?: boolean | null; + landing_page_url?: string | null; + pdf_url?: string | null; + source?: DehydratedSource | null; + license?: string | null; + license_id?: string | null; + version?: string | null; + is_accepted?: boolean | null; + is_published?: boolean | null; } + diff --git a/webapp/src/app/api/model/loginResponse.ts b/webapp/src/app/api/model/loginResponse.ts index b0ccb902..c91eb493 100644 --- a/webapp/src/app/api/model/loginResponse.ts +++ b/webapp/src/app/api/model/loginResponse.ts @@ -1,7 +1,7 @@ /** * Innovation Search Engine API * - * + * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech @@ -9,9 +9,11 @@ */ import { IdTokenMetadata } from './idTokenMetadata'; -export interface LoginResponse { - /** - * The ID token issued upon successful login. - */ - id_token: IdTokenMetadata; + +export interface LoginResponse { + /** + * The ID token issued upon successful login. + */ + id_token: IdTokenMetadata; } + diff --git a/webapp/src/app/api/model/longitude.ts b/webapp/src/app/api/model/longitude.ts index d222a6ff..b0d39fce 100644 --- a/webapp/src/app/api/model/longitude.ts +++ b/webapp/src/app/api/model/longitude.ts @@ -1,11 +1,14 @@ /** * Innovation Search Engine API * - * + * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech * Do not edit the class manually. */ -export interface Longitude {} + +export interface Longitude { +} + diff --git a/webapp/src/app/api/model/matchedAuthor.ts b/webapp/src/app/api/model/matchedAuthor.ts index 311e2184..6194df94 100644 --- a/webapp/src/app/api/model/matchedAuthor.ts +++ b/webapp/src/app/api/model/matchedAuthor.ts @@ -1,14 +1,16 @@ /** * Innovation Search Engine API * - * + * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech * Do not edit the class manually. */ -export interface MatchedAuthor { - openalex_author_id: string; - author_name: string; + +export interface MatchedAuthor { + openalex_author_id: string; + author_name: string; } + diff --git a/webapp/src/app/api/model/matchedOfficer.ts b/webapp/src/app/api/model/matchedOfficer.ts index a9f00939..4ad5c354 100644 --- a/webapp/src/app/api/model/matchedOfficer.ts +++ b/webapp/src/app/api/model/matchedOfficer.ts @@ -1,21 +1,23 @@ /** * Innovation Search Engine API * - * + * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech * Do not edit the class manually. */ -export interface MatchedOfficer { - name?: string | null; - firstname?: string | null; - lastname?: string | null; - city?: string | null; - position?: string | null; - start_date?: string | null; - type?: string | null; - flag?: string | null; - is_matched_person?: boolean; + +export interface MatchedOfficer { + name?: string | null; + firstname?: string | null; + lastname?: string | null; + city?: string | null; + position?: string | null; + start_date?: string | null; + type?: string | null; + flag?: string | null; + is_matched_person?: boolean; } + diff --git a/webapp/src/app/api/model/matchedTopic.ts b/webapp/src/app/api/model/matchedTopic.ts index 52de9018..64e54ab3 100644 --- a/webapp/src/app/api/model/matchedTopic.ts +++ b/webapp/src/app/api/model/matchedTopic.ts @@ -1,18 +1,20 @@ /** * Innovation Search Engine API * - * + * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech * Do not edit the class manually. */ -export interface MatchedTopic { - id?: string | null; - display_name?: string | null; - subfield_name?: string | null; - field_name?: string | null; - domain_name?: string | null; - source_keyword?: string | null; + +export interface MatchedTopic { + id?: string | null; + display_name?: string | null; + subfield_name?: string | null; + field_name?: string | null; + domain_name?: string | null; + source_keyword?: string | null; } + diff --git a/webapp/src/app/api/model/mentionedPerson.ts b/webapp/src/app/api/model/mentionedPerson.ts index dad21357..6141b12a 100644 --- a/webapp/src/app/api/model/mentionedPerson.ts +++ b/webapp/src/app/api/model/mentionedPerson.ts @@ -1,15 +1,17 @@ /** * Innovation Search Engine API * - * + * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech * Do not edit the class manually. */ -export interface MentionedPerson { - name: string; - is_ude?: boolean; - person_id?: string | null; + +export interface MentionedPerson { + name: string; + is_ude?: boolean; + person_id?: string | null; } + diff --git a/webapp/src/app/api/model/meta.ts b/webapp/src/app/api/model/meta.ts index f9f56443..8481062a 100644 --- a/webapp/src/app/api/model/meta.ts +++ b/webapp/src/app/api/model/meta.ts @@ -1,7 +1,7 @@ /** * Innovation Search Engine API * - * + * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech @@ -9,15 +9,17 @@ */ import { CostUsd } from './costUsd'; + /** * Metadata about the query results */ -export interface Meta { - count?: number | null; - db_response_time_ms?: number | null; - page?: number | null; - per_page?: number | null; - next_cursor?: string | null; - groups_count?: number | null; - cost_usd?: CostUsd | null; +export interface Meta { + count?: number | null; + db_response_time_ms?: number | null; + page?: number | null; + per_page?: number | null; + next_cursor?: string | null; + groups_count?: number | null; + cost_usd?: CostUsd | null; } + diff --git a/webapp/src/app/api/model/model2YrMeanCitedness.ts b/webapp/src/app/api/model/model2YrMeanCitedness.ts index d9c3d9df..67ec623c 100644 --- a/webapp/src/app/api/model/model2YrMeanCitedness.ts +++ b/webapp/src/app/api/model/model2YrMeanCitedness.ts @@ -1,11 +1,14 @@ /** * Innovation Search Engine API * - * + * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech * Do not edit the class manually. */ -export interface Model2YrMeanCitedness {} + +export interface Model2YrMeanCitedness { +} + diff --git a/webapp/src/app/api/model/models.ts b/webapp/src/app/api/model/models.ts index cabeb96f..3b2a21f5 100644 --- a/webapp/src/app/api/model/models.ts +++ b/webapp/src/app/api/model/models.ts @@ -8,6 +8,7 @@ export * from './authorAffiliationsInner'; export * from './authorCountsByYearInner'; export * from './authorIds'; export * from './authorNetworkNode'; +export * from './authorPage'; export * from './authorParsedLongestName'; export * from './authorPositionCount'; export * from './authorSummaryStats'; @@ -48,6 +49,8 @@ export * from './dehydratedAuthor'; export * from './dehydratedFunder'; export * from './dehydratedInstitution'; export * from './dehydratedSource'; +export * from './dfgInstitutionSummary'; +export * from './dfgPersonSummary'; export * from './dfgProjectDetails'; export * from './dfgProjectPage'; export * from './dfgProjectSummary'; @@ -98,9 +101,7 @@ export * from './hEUWebLink'; export * from './hTTPValidationError'; export * from './idTokenMetadata'; export * from './inseAccountManagementModelOrganizationProfile'; -export * from './inseModelsOpenalexWorkPageWorkPage'; export * from './inseOrganizationManagementModelOrganizationProfile'; -export * from './inseWorksV2ModelWorkPage'; export * from './institution'; export * from './institutionFunderSummary'; export * from './institutionGeo'; @@ -108,11 +109,16 @@ export * from './institutionIds'; export * from './institutionInformation'; export * from './institutionNetworkNode'; export * from './institutionPage'; +export * from './institutionPageV2'; export * from './institutionsListResponse'; export * from './ipcClassification'; export * from './keywordEntry'; export * from './keywordEntryWithTopic'; +export * from './keywordEvidence'; +export * from './keywordPatentLevel'; +export * from './keywordPatentMappingStatus'; export * from './keywordPatentMatch'; +export * from './keywordPatentSearchDiagnostics'; export * from './keywordPatentSearchItem'; export * from './keywordTopicMatch'; export * from './keywords'; @@ -169,6 +175,7 @@ export * from './topicHeatmap'; export * from './topicHeatmapField'; export * from './topicHeatmapValue'; export * from './topicIds'; +export * from './topicPageV2'; export * from './topicSubfield'; export * from './topicYearlyData'; export * from './topics'; @@ -194,6 +201,8 @@ export * from './workClassification'; export * from './workClassificationAuthor'; export * from './workClassificationDetails'; export * from './workClassificationInstitution'; +export * from './workClassificationMerge'; +export * from './workClassificationMergePage'; export * from './workClassificationMeta'; export * from './workClassificationPage'; export * from './workClassificationTopic'; @@ -205,6 +214,8 @@ export * from './workIds'; export * from './workKeyword'; export * from './workMeshInner'; export * from './workNetworkNode'; +export * from './workPage'; +export * from './workPageV2'; export * from './workPrimaryCategory'; export * from './workSortBy'; export * from './workSustainableDevelopmentGoalsInner'; diff --git a/webapp/src/app/api/model/newsArticle.ts b/webapp/src/app/api/model/newsArticle.ts index e04f0029..ab48810d 100644 --- a/webapp/src/app/api/model/newsArticle.ts +++ b/webapp/src/app/api/model/newsArticle.ts @@ -1,20 +1,22 @@ /** * Innovation Search Engine API * - * + * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech * Do not edit the class manually. */ -export interface NewsArticle { - id: string; - date?: string | null; - maintitle?: string | null; - author?: string | null; - url?: string | null; - relevant?: boolean | null; - snippet?: string | null; - related?: boolean | null; + +export interface NewsArticle { + id: string; + date?: string | null; + maintitle?: string | null; + author?: string | null; + url?: string | null; + relevant?: boolean | null; + snippet?: string | null; + related?: boolean | null; } + diff --git a/webapp/src/app/api/model/newsArticleDetail.ts b/webapp/src/app/api/model/newsArticleDetail.ts index 09962000..171a14ff 100644 --- a/webapp/src/app/api/model/newsArticleDetail.ts +++ b/webapp/src/app/api/model/newsArticleDetail.ts @@ -1,7 +1,7 @@ /** * Innovation Search Engine API * - * + * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech @@ -10,17 +10,19 @@ import { MatchedTopic } from './matchedTopic'; import { MentionedPerson } from './mentionedPerson'; -export interface NewsArticleDetail { - id: string; - date?: string | null; - maintitle?: string | null; - author?: string | null; - url?: string | null; - relevant?: boolean | null; - snippet?: string | null; - related?: boolean | null; - full_content?: string | null; - authors?: Array; - keywords?: Array; - topics?: Array; + +export interface NewsArticleDetail { + id: string; + date?: string | null; + maintitle?: string | null; + author?: string | null; + url?: string | null; + relevant?: boolean | null; + snippet?: string | null; + related?: boolean | null; + full_content?: string | null; + authors?: Array; + keywords?: Array; + topics?: Array; } + diff --git a/webapp/src/app/api/model/newsPage.ts b/webapp/src/app/api/model/newsPage.ts index bbb74122..da7f26ab 100644 --- a/webapp/src/app/api/model/newsPage.ts +++ b/webapp/src/app/api/model/newsPage.ts @@ -1,7 +1,7 @@ /** * Innovation Search Engine API * - * + * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech @@ -9,9 +9,11 @@ */ import { NewsArticle } from './newsArticle'; -export interface NewsPage { - total: number; - page: number; - page_size: number; - results: Array; + +export interface NewsPage { + total: number; + page: number; + page_size: number; + results: Array; } + diff --git a/webapp/src/app/api/model/openAccess.ts b/webapp/src/app/api/model/openAccess.ts index 40d7b1d0..32a4ddd9 100644 --- a/webapp/src/app/api/model/openAccess.ts +++ b/webapp/src/app/api/model/openAccess.ts @@ -1,19 +1,21 @@ /** * Innovation Search Engine API * - * + * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech * Do not edit the class manually. */ + /** * Open access information */ -export interface OpenAccess { - is_oa?: boolean | null; - oa_status?: string | null; - oa_url?: string | null; - any_repository_has_fulltext?: boolean | null; +export interface OpenAccess { + is_oa?: boolean | null; + oa_status?: string | null; + oa_url?: string | null; + any_repository_has_fulltext?: boolean | null; } + diff --git a/webapp/src/app/api/model/openAlexTopicTag.ts b/webapp/src/app/api/model/openAlexTopicTag.ts index 0e6f538a..dece79c5 100644 --- a/webapp/src/app/api/model/openAlexTopicTag.ts +++ b/webapp/src/app/api/model/openAlexTopicTag.ts @@ -1,16 +1,18 @@ /** * Innovation Search Engine API * - * + * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech * Do not edit the class manually. */ -export interface OpenAlexTopicTag { - topic_id?: string | null; - topic_display_name: string; - field_name?: string | null; - domain_name?: string | null; + +export interface OpenAlexTopicTag { + topic_id?: string | null; + topic_display_name: string; + field_name?: string | null; + domain_name?: string | null; } + diff --git a/webapp/src/app/api/model/orgPatentEntry.ts b/webapp/src/app/api/model/orgPatentEntry.ts index e26782e4..762e1968 100644 --- a/webapp/src/app/api/model/orgPatentEntry.ts +++ b/webapp/src/app/api/model/orgPatentEntry.ts @@ -1,7 +1,7 @@ /** * Innovation Search Engine API * - * + * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech @@ -11,38 +11,40 @@ import { MatchedAuthor } from './matchedAuthor'; import { OpenAlexTopicTag } from './openAlexTopicTag'; import { IpcClassification } from './ipcClassification'; -export interface OrgPatentEntry { - patent_id: string; - source: string; - title?: string | null; - abstract?: string | null; - publication_date?: string | null; - publication_year?: string | null; - application_number?: string | null; - application_date?: string | null; - kind?: string | null; - application_type?: string | null; - number_of_claims?: number | null; - status?: string | null; - inventors?: Array; - assignees?: Array; - ipc?: Array; - ipc_descriptions?: Array; - cpc?: Array; - cpc_descriptions?: Array; - country?: string | null; - openalex_topics?: Array; - institution_id: string; - institution_name?: string | null; - match_type: OrgPatentEntry.MatchTypeEnum; - matched_authors?: Array; + +export interface OrgPatentEntry { + patent_id: string; + source: string; + title?: string | null; + 'abstract'?: string | null; + publication_date?: string | null; + publication_year?: string | null; + application_number?: string | null; + application_date?: string | null; + kind?: string | null; + application_type?: string | null; + number_of_claims?: number | null; + status?: string | null; + inventors?: Array; + assignees?: Array; + ipc?: Array; + ipc_descriptions?: Array; + cpc?: Array; + cpc_descriptions?: Array; + country?: string | null; + openalex_topics?: Array; + institution_id: string; + institution_name?: string | null; + match_type: OrgPatentEntry.MatchTypeEnum; + matched_authors?: Array; } export namespace OrgPatentEntry { - export const MatchTypeEnum = { - Institution: 'institution', - Name: 'name', - Both: 'both', - } as const; - export type MatchTypeEnum = - (typeof MatchTypeEnum)[keyof typeof MatchTypeEnum]; + export const MatchTypeEnum = { + Institution: 'institution', + Name: 'name', + Both: 'both' + } as const; + export type MatchTypeEnum = typeof MatchTypeEnum[keyof typeof MatchTypeEnum]; } + + diff --git a/webapp/src/app/api/model/orgPatentsResponse.ts b/webapp/src/app/api/model/orgPatentsResponse.ts index 68b2be7a..96697088 100644 --- a/webapp/src/app/api/model/orgPatentsResponse.ts +++ b/webapp/src/app/api/model/orgPatentsResponse.ts @@ -1,7 +1,7 @@ /** * Innovation Search Engine API * - * + * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech @@ -9,11 +9,13 @@ */ import { OrgPatentEntry } from './orgPatentEntry'; -export interface OrgPatentsResponse { - institution_id: string; - institution_name?: string | null; - patent_count: number; - page?: number; - size?: number; - patents: Array; + +export interface OrgPatentsResponse { + institution_id: string; + institution_name?: string | null; + patent_count: number; + page?: number; + size?: number; + patents: Array; } + diff --git a/webapp/src/app/api/model/organizationPage.ts b/webapp/src/app/api/model/organizationPage.ts index fccb1081..5b8294b1 100644 --- a/webapp/src/app/api/model/organizationPage.ts +++ b/webapp/src/app/api/model/organizationPage.ts @@ -1,7 +1,7 @@ /** * Innovation Search Engine API * - * + * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech @@ -9,9 +9,11 @@ */ import { InseOrganizationManagementModelOrganizationProfile } from './inseOrganizationManagementModelOrganizationProfile'; -export interface OrganizationPage { - items: Array; - total: number; - page: number; - page_size: number; + +export interface OrganizationPage { + items: Array; + total: number; + page: number; + page_size: number; } + diff --git a/webapp/src/app/api/model/otkResponse.ts b/webapp/src/app/api/model/otkResponse.ts index 3b69c11d..7d956289 100644 --- a/webapp/src/app/api/model/otkResponse.ts +++ b/webapp/src/app/api/model/otkResponse.ts @@ -1,20 +1,22 @@ /** * Innovation Search Engine API * - * + * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech * Do not edit the class manually. */ -export interface OtkResponse { - /** - * The status of the one-time code (OTC) request. - */ - status: string; - /** - * The unique identifier of the account for which the OTC was requested. - */ - account_id: string; + +export interface OtkResponse { + /** + * The status of the one-time code (OTC) request. + */ + status: string; + /** + * The unique identifier of the account for which the OTC was requested. + */ + account_id: string; } + diff --git a/webapp/src/app/api/model/patentEntry.ts b/webapp/src/app/api/model/patentEntry.ts index 809c558b..7f6d7809 100644 --- a/webapp/src/app/api/model/patentEntry.ts +++ b/webapp/src/app/api/model/patentEntry.ts @@ -1,7 +1,7 @@ /** * Innovation Search Engine API * - * + * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech @@ -10,25 +10,27 @@ import { OpenAlexTopicTag } from './openAlexTopicTag'; import { IpcClassification } from './ipcClassification'; -export interface PatentEntry { - patent_id: string; - source: string; - title?: string | null; - abstract?: string | null; - publication_date?: string | null; - publication_year?: string | null; - application_number?: string | null; - application_date?: string | null; - kind?: string | null; - application_type?: string | null; - number_of_claims?: number | null; - status?: string | null; - inventors?: Array; - assignees?: Array; - ipc?: Array; - ipc_descriptions?: Array; - cpc?: Array; - cpc_descriptions?: Array; - country?: string | null; - openalex_topics?: Array; + +export interface PatentEntry { + patent_id: string; + source: string; + title?: string | null; + 'abstract'?: string | null; + publication_date?: string | null; + publication_year?: string | null; + application_number?: string | null; + application_date?: string | null; + kind?: string | null; + application_type?: string | null; + number_of_claims?: number | null; + status?: string | null; + inventors?: Array; + assignees?: Array; + ipc?: Array; + ipc_descriptions?: Array; + cpc?: Array; + cpc_descriptions?: Array; + country?: string | null; + openalex_topics?: Array; } + diff --git a/webapp/src/app/api/model/patentsByAuthorResponse.ts b/webapp/src/app/api/model/patentsByAuthorResponse.ts index ed970c7a..eca819ed 100644 --- a/webapp/src/app/api/model/patentsByAuthorResponse.ts +++ b/webapp/src/app/api/model/patentsByAuthorResponse.ts @@ -1,7 +1,7 @@ /** * Innovation Search Engine API * - * + * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech @@ -9,9 +9,11 @@ */ import { PatentEntry } from './patentEntry'; -export interface PatentsByAuthorResponse { - author_id: string; - author_name?: string | null; - patent_count: number; - patents: Array; + +export interface PatentsByAuthorResponse { + author_id: string; + author_name?: string | null; + patent_count: number; + patents: Array; } + diff --git a/webapp/src/app/api/model/patentsByInstitutionResponse.ts b/webapp/src/app/api/model/patentsByInstitutionResponse.ts index d80972d0..b167c48b 100644 --- a/webapp/src/app/api/model/patentsByInstitutionResponse.ts +++ b/webapp/src/app/api/model/patentsByInstitutionResponse.ts @@ -1,7 +1,7 @@ /** * Innovation Search Engine API * - * + * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech @@ -9,9 +9,11 @@ */ import { PatentEntry } from './patentEntry'; -export interface PatentsByInstitutionResponse { - institution_id: string; - institution_name?: string | null; - patent_count: number; - patents: Array; + +export interface PatentsByInstitutionResponse { + institution_id: string; + institution_name?: string | null; + patent_count: number; + patents: Array; } + diff --git a/webapp/src/app/api/model/patentsByKeywordsRequest.ts b/webapp/src/app/api/model/patentsByKeywordsRequest.ts index fcafaee0..1e9d3021 100644 --- a/webapp/src/app/api/model/patentsByKeywordsRequest.ts +++ b/webapp/src/app/api/model/patentsByKeywordsRequest.ts @@ -1,7 +1,7 @@ /** * Innovation Search Engine API * - * + * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech @@ -9,9 +9,11 @@ */ import { KeywordPatentSearchItem } from './keywordPatentSearchItem'; -export interface PatentsByKeywordsRequest { - /** - * Keywords to match against patents_openalex_keywords. - */ - keywords: Array; + +export interface PatentsByKeywordsRequest { + /** + * Keywords to match against patents_openalex_keywords. + */ + keywords: Array; } + diff --git a/webapp/src/app/api/model/patentsByKeywordsResponse.ts b/webapp/src/app/api/model/patentsByKeywordsResponse.ts index fe9bec64..d9f28a8e 100644 --- a/webapp/src/app/api/model/patentsByKeywordsResponse.ts +++ b/webapp/src/app/api/model/patentsByKeywordsResponse.ts @@ -1,15 +1,27 @@ /** * Innovation Search Engine API * - * + * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech * Do not edit the class manually. */ +import { KeywordPatentMappingStatus } from './keywordPatentMappingStatus'; +import { KeywordPatentSearchDiagnostics } from './keywordPatentSearchDiagnostics'; import { KeywordPatentMatch } from './keywordPatentMatch'; -export interface PatentsByKeywordsResponse { - patent_count: number; - patents: Array; + +export interface PatentsByKeywordsResponse { + patent_count: number; + patents: Array; + /** + * IPC mapping outcome: mapped (IPC used), uncertain (fragmented evidence; may include text-retrieved patents), no_mapping (no usable IPC evidence; may include text-retrieved patents), no_patents_found (neither IPC nor keyword text search produced relevant patents), or search_error (technical failure talking to the search backend). + */ + mapping_status: KeywordPatentMappingStatus; + diagnostics?: KeywordPatentSearchDiagnostics | null; } +export namespace PatentsByKeywordsResponse { +} + + diff --git a/webapp/src/app/api/model/personBio.ts b/webapp/src/app/api/model/personBio.ts index b060c9a9..f7291e6f 100644 --- a/webapp/src/app/api/model/personBio.ts +++ b/webapp/src/app/api/model/personBio.ts @@ -1,16 +1,18 @@ /** * Innovation Search Engine API * - * + * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech * Do not edit the class manually. */ -export interface PersonBio { - /** - * The generated biography. - */ - bio: string; + +export interface PersonBio { + /** + * The generated biography. + */ + bio: string; } + diff --git a/webapp/src/app/api/model/personBookmarkResponse.ts b/webapp/src/app/api/model/personBookmarkResponse.ts index b40bdc71..5227060a 100644 --- a/webapp/src/app/api/model/personBookmarkResponse.ts +++ b/webapp/src/app/api/model/personBookmarkResponse.ts @@ -1,15 +1,17 @@ /** * Innovation Search Engine API * - * + * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech * Do not edit the class manually. */ -export interface PersonBookmarkResponse { - person_id: string; - person_name: string | null; - created_at: string; + +export interface PersonBookmarkResponse { + person_id: string; + person_name: string | null; + created_at: string; } + diff --git a/webapp/src/app/api/model/projectType.ts b/webapp/src/app/api/model/projectType.ts index 08df30c4..a01a743c 100644 --- a/webapp/src/app/api/model/projectType.ts +++ b/webapp/src/app/api/model/projectType.ts @@ -1,16 +1,18 @@ /** * Innovation Search Engine API * - * + * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech * Do not edit the class manually. */ + export const ProjectType = { - Bund: 'bund', - Eu: 'eu', - Dfg: 'dfg', + Bund: 'bund', + Eu: 'eu', + Dfg: 'dfg' } as const; -export type ProjectType = (typeof ProjectType)[keyof typeof ProjectType]; +export type ProjectType = typeof ProjectType[keyof typeof ProjectType]; + diff --git a/webapp/src/app/api/model/projectsFilteringProperties.ts b/webapp/src/app/api/model/projectsFilteringProperties.ts index c0cebe63..7ce7cfc2 100644 --- a/webapp/src/app/api/model/projectsFilteringProperties.ts +++ b/webapp/src/app/api/model/projectsFilteringProperties.ts @@ -1,7 +1,7 @@ /** * Innovation Search Engine API * - * + * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech @@ -11,28 +11,32 @@ import { SortDirection } from './sortDirection'; import { ProjectsSortBy } from './projectsSortBy'; import { ProjectType } from './projectType'; -export interface ProjectsFilteringProperties { - /** - * The type of projects to filter by. - */ - project_type: ProjectType; - /** - * The page number for pagination. - */ - page: number; - /** - * The page size for pagination. - */ - size: number; - raw_oa_institution_id?: string | null; - query?: string | null; - /** - * The field to sort by. - */ - sort_by?: ProjectsSortBy; - /** - * The sort direction (asc or desc). - */ - sort_direction?: SortDirection; + +export interface ProjectsFilteringProperties { + /** + * The type of projects to filter by. + */ + project_type: ProjectType; + /** + * The page number for pagination. + */ + page: number; + /** + * The page size for pagination. + */ + size: number; + raw_oa_institution_id?: string | null; + query?: string | null; + /** + * The field to sort by. + */ + sort_by?: ProjectsSortBy; + /** + * The sort direction (asc or desc). + */ + sort_direction?: SortDirection; } -export namespace ProjectsFilteringProperties {} +export namespace ProjectsFilteringProperties { +} + + diff --git a/webapp/src/app/api/model/projectsSortBy.ts b/webapp/src/app/api/model/projectsSortBy.ts index 26400b22..79824096 100644 --- a/webapp/src/app/api/model/projectsSortBy.ts +++ b/webapp/src/app/api/model/projectsSortBy.ts @@ -1,18 +1,19 @@ /** * Innovation Search Engine API * - * + * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech * Do not edit the class manually. */ + export const ProjectsSortBy = { - Title: 'title', - FundingStart: 'funding_start', - FundingEnd: 'funding_end', - FundingAmount: 'funding_amount', + Title: 'title', + FundingStart: 'funding_start', + FundingEnd: 'funding_end', + FundingAmount: 'funding_amount' } as const; -export type ProjectsSortBy = - (typeof ProjectsSortBy)[keyof typeof ProjectsSortBy]; +export type ProjectsSortBy = typeof ProjectsSortBy[keyof typeof ProjectsSortBy]; + diff --git a/webapp/src/app/api/model/publicationDetailByFunder.ts b/webapp/src/app/api/model/publicationDetailByFunder.ts index 0fd6b7c5..123ded7e 100644 --- a/webapp/src/app/api/model/publicationDetailByFunder.ts +++ b/webapp/src/app/api/model/publicationDetailByFunder.ts @@ -1,43 +1,45 @@ /** * Innovation Search Engine API * - * + * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech * Do not edit the class manually. */ -export interface PublicationDetailByFunder { - id: string; - title: string; - abstract?: string | null; - doi?: string | null; - publication_year?: number | null; - publication_date?: string | null; - publication_type?: string | null; - language?: string | null; - publication_url?: string | null; - pdf_url?: string | null; - source_name?: string | null; - source_type?: string | null; - is_open_access?: boolean | null; - open_access_status?: string | null; - has_fulltext?: boolean | null; - license?: string | null; - cited_by_count?: number | null; - is_retracted?: boolean | null; - primary_topic?: string | null; - topic_field?: string | null; - topic_subfield?: string | null; - topic_domain?: string | null; - author_position?: string | null; - authors?: Array; - funder_names?: Array; - institutions?: Array; - countries?: Array; - topics?: Array; - keywords?: Array; - grant_labels?: Array; - counts_by_year?: Array; + +export interface PublicationDetailByFunder { + id: string; + title: string; + 'abstract'?: string | null; + doi?: string | null; + publication_year?: number | null; + publication_date?: string | null; + publication_type?: string | null; + language?: string | null; + publication_url?: string | null; + pdf_url?: string | null; + source_name?: string | null; + source_type?: string | null; + is_open_access?: boolean | null; + open_access_status?: string | null; + has_fulltext?: boolean | null; + license?: string | null; + cited_by_count?: number | null; + is_retracted?: boolean | null; + primary_topic?: string | null; + topic_field?: string | null; + topic_subfield?: string | null; + topic_domain?: string | null; + author_position?: string | null; + authors?: Array; + funder_names?: Array; + institutions?: Array; + countries?: Array; + topics?: Array; + keywords?: Array; + grant_labels?: Array; + counts_by_year?: Array; } + diff --git a/webapp/src/app/api/model/publicationIdsByAuthorPosition.ts b/webapp/src/app/api/model/publicationIdsByAuthorPosition.ts index d549f8ed..c35050ef 100644 --- a/webapp/src/app/api/model/publicationIdsByAuthorPosition.ts +++ b/webapp/src/app/api/model/publicationIdsByAuthorPosition.ts @@ -1,16 +1,18 @@ /** * Innovation Search Engine API * - * + * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech * Do not edit the class manually. */ -export interface PublicationIdsByAuthorPosition { - first?: Array; - middle?: Array; - last?: Array; - unknown?: Array; + +export interface PublicationIdsByAuthorPosition { + first?: Array; + middle?: Array; + last?: Array; + unknown?: Array; } + diff --git a/webapp/src/app/api/model/publicationsByAuthorResponse.ts b/webapp/src/app/api/model/publicationsByAuthorResponse.ts index 35333880..5176fe39 100644 --- a/webapp/src/app/api/model/publicationsByAuthorResponse.ts +++ b/webapp/src/app/api/model/publicationsByAuthorResponse.ts @@ -1,19 +1,21 @@ /** * Innovation Search Engine API * - * + * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech * Do not edit the class manually. */ -export interface PublicationsByAuthorResponse { - author_id: string; - page: number; - page_size: number; - total_works: number; - total: number; - results_count: number; - results: Array; + +export interface PublicationsByAuthorResponse { + author_id: string; + page: number; + page_size: number; + total_works: number; + total: number; + results_count: number; + results: Array; } + diff --git a/webapp/src/app/api/model/rankingResponse.ts b/webapp/src/app/api/model/rankingResponse.ts index 5be090a2..099ec660 100644 --- a/webapp/src/app/api/model/rankingResponse.ts +++ b/webapp/src/app/api/model/rankingResponse.ts @@ -1,7 +1,7 @@ /** * Innovation Search Engine API * - * + * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech @@ -10,7 +10,9 @@ import { UniversityRanking } from './universityRanking'; import { UniversityTopicData } from './universityTopicData'; -export interface RankingResponse { - timeseries: Array; - rankings: Array; + +export interface RankingResponse { + timeseries: Array; + rankings: Array; } + diff --git a/webapp/src/app/api/model/rebuildResponse.ts b/webapp/src/app/api/model/rebuildResponse.ts index d2f002fb..13e6c910 100644 --- a/webapp/src/app/api/model/rebuildResponse.ts +++ b/webapp/src/app/api/model/rebuildResponse.ts @@ -1,15 +1,17 @@ /** * Innovation Search Engine API * - * + * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech * Do not edit the class manually. */ -export interface RebuildResponse { - status: string; - institution_id: string; - message: string; + +export interface RebuildResponse { + status: string; + institution_id: string; + message: string; } + diff --git a/webapp/src/app/api/model/score.ts b/webapp/src/app/api/model/score.ts index 5b0b5935..fac39735 100644 --- a/webapp/src/app/api/model/score.ts +++ b/webapp/src/app/api/model/score.ts @@ -1,11 +1,14 @@ /** * Innovation Search Engine API * - * + * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech * Do not edit the class manually. */ -export interface Score {} + +export interface Score { +} + diff --git a/webapp/src/app/api/model/sortDirection.ts b/webapp/src/app/api/model/sortDirection.ts index 49933995..4f9362f2 100644 --- a/webapp/src/app/api/model/sortDirection.ts +++ b/webapp/src/app/api/model/sortDirection.ts @@ -1,15 +1,17 @@ /** * Innovation Search Engine API * - * + * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech * Do not edit the class manually. */ + export const SortDirection = { - Asc: 'asc', - Desc: 'desc', + Asc: 'asc', + Desc: 'desc' } as const; -export type SortDirection = (typeof SortDirection)[keyof typeof SortDirection]; +export type SortDirection = typeof SortDirection[keyof typeof SortDirection]; + diff --git a/webapp/src/app/api/model/tokenType.ts b/webapp/src/app/api/model/tokenType.ts index 88512eb6..a0efdc46 100644 --- a/webapp/src/app/api/model/tokenType.ts +++ b/webapp/src/app/api/model/tokenType.ts @@ -1,16 +1,18 @@ /** * Innovation Search Engine API * - * + * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech * Do not edit the class manually. */ + export const TokenType = { - IdToken: 'ID_TOKEN', - RefreshToken: 'REFRESH_TOKEN', - AccessToken: 'ACCESS_TOKEN', + IdToken: 'ID_TOKEN', + RefreshToken: 'REFRESH_TOKEN', + AccessToken: 'ACCESS_TOKEN' } as const; -export type TokenType = (typeof TokenType)[keyof typeof TokenType]; +export type TokenType = typeof TokenType[keyof typeof TokenType]; + diff --git a/webapp/src/app/api/model/topAuthor.ts b/webapp/src/app/api/model/topAuthor.ts index bc431723..6a74fa91 100644 --- a/webapp/src/app/api/model/topAuthor.ts +++ b/webapp/src/app/api/model/topAuthor.ts @@ -1,15 +1,17 @@ /** * Innovation Search Engine API * - * + * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech * Do not edit the class manually. */ -export interface TopAuthor { - id?: string | null; - name: string; - count: number; + +export interface TopAuthor { + id?: string | null; + name: string; + count: number; } + diff --git a/webapp/src/app/api/model/topAuthorStatistics.ts b/webapp/src/app/api/model/topAuthorStatistics.ts index 1c912edb..6ea5990a 100644 --- a/webapp/src/app/api/model/topAuthorStatistics.ts +++ b/webapp/src/app/api/model/topAuthorStatistics.ts @@ -1,7 +1,7 @@ /** * Innovation Search Engine API * - * + * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech @@ -9,10 +9,12 @@ */ import { TopAuthor } from './topAuthor'; -export interface TopAuthorStatistics { - institution_id: string; - works: Array; - projects: Array; - patents: Array; - news: Array; + +export interface TopAuthorStatistics { + institution_id: string; + works: Array; + projects: Array; + patents: Array; + news: Array; } + diff --git a/webapp/src/app/api/model/topInstitutionItem.ts b/webapp/src/app/api/model/topInstitutionItem.ts index a98f52b8..a9367bae 100644 --- a/webapp/src/app/api/model/topInstitutionItem.ts +++ b/webapp/src/app/api/model/topInstitutionItem.ts @@ -1,20 +1,22 @@ /** * Innovation Search Engine API * - * + * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech * Do not edit the class manually. */ -export interface TopInstitutionItem { - id?: string | null; - display_name?: string | null; - ror?: string | null; - country_code?: string | null; - type?: string | null; - lineage?: Array | null; - works_count?: number | null; - exact_topic_count?: number | null; + +export interface TopInstitutionItem { + id?: string | null; + display_name?: string | null; + ror?: string | null; + country_code?: string | null; + type?: string | null; + lineage?: Array | null; + works_count?: number | null; + exact_topic_count?: number | null; } + diff --git a/webapp/src/app/api/model/topTopicItem.ts b/webapp/src/app/api/model/topTopicItem.ts index e6a151d4..2ae026c1 100644 --- a/webapp/src/app/api/model/topTopicItem.ts +++ b/webapp/src/app/api/model/topTopicItem.ts @@ -1,14 +1,16 @@ /** * Innovation Search Engine API * - * + * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech * Do not edit the class manually. */ -export interface TopTopicItem { - name: string; - count: number; + +export interface TopTopicItem { + name: string; + count: number; } + diff --git a/webapp/src/app/api/model/topTopicsResponse.ts b/webapp/src/app/api/model/topTopicsResponse.ts index 4bac3de8..7f109033 100644 --- a/webapp/src/app/api/model/topTopicsResponse.ts +++ b/webapp/src/app/api/model/topTopicsResponse.ts @@ -1,7 +1,7 @@ /** * Innovation Search Engine API * - * + * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech @@ -9,6 +9,8 @@ */ import { TopTopicItem } from './topTopicItem'; -export interface TopTopicsResponse { - items: Array; + +export interface TopTopicsResponse { + items: Array; } + diff --git a/webapp/src/app/api/model/topic.ts b/webapp/src/app/api/model/topic.ts index eaac16f6..9fc0ee63 100644 --- a/webapp/src/app/api/model/topic.ts +++ b/webapp/src/app/api/model/topic.ts @@ -1,7 +1,7 @@ /** * Innovation Search Engine API * - * + * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech @@ -12,21 +12,23 @@ import { TopicIds } from './topicIds'; import { TopicSubfield } from './topicSubfield'; import { TopicField } from './topicField'; + /** * A research topic automatically assigned to works */ -export interface Topic { - id?: string | null; - display_name?: string | null; - description?: string | null; - keywords?: Array | null; - subfield?: TopicSubfield | null; - field?: TopicField | null; - domain?: TopicDomain | null; - works_count?: number | null; - cited_by_count?: number | null; - ids?: TopicIds | null; - works_api_url?: string | null; - created_date?: string | null; - updated_date?: string | null; +export interface Topic { + id?: string | null; + display_name?: string | null; + description?: string | null; + keywords?: Array | null; + subfield?: TopicSubfield | null; + field?: TopicField | null; + domain?: TopicDomain | null; + works_count?: number | null; + cited_by_count?: number | null; + ids?: TopicIds | null; + works_api_url?: string | null; + created_date?: string | null; + updated_date?: string | null; } + diff --git a/webapp/src/app/api/model/topicCount.ts b/webapp/src/app/api/model/topicCount.ts index 1d2abe90..b929a51d 100644 --- a/webapp/src/app/api/model/topicCount.ts +++ b/webapp/src/app/api/model/topicCount.ts @@ -1,31 +1,33 @@ /** * Innovation Search Engine API * - * + * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech * Do not edit the class manually. */ -export interface TopicCount { - id?: string | null; - /** - * The topic display name. - */ - name: string; - /** - * The number of occurrences. - */ - count?: number; - description?: string | null; - subfield_id?: string | null; - subfield_name?: string | null; - subfield_description?: string | null; - field_id?: string | null; - field_name?: string | null; - field_description?: string | null; - domain_id?: string | null; - domain_name?: string | null; - domain_description?: string | null; + +export interface TopicCount { + id?: string | null; + /** + * The topic display name. + */ + name: string; + /** + * The number of occurrences. + */ + count?: number; + description?: string | null; + subfield_id?: string | null; + subfield_name?: string | null; + subfield_description?: string | null; + field_id?: string | null; + field_name?: string | null; + field_description?: string | null; + domain_id?: string | null; + domain_name?: string | null; + domain_description?: string | null; } + diff --git a/webapp/src/app/api/model/topicDomain.ts b/webapp/src/app/api/model/topicDomain.ts index 573bef0d..652b1bca 100644 --- a/webapp/src/app/api/model/topicDomain.ts +++ b/webapp/src/app/api/model/topicDomain.ts @@ -1,17 +1,19 @@ /** * Innovation Search Engine API * - * + * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech * Do not edit the class manually. */ + /** * The domain (highest level) containing this topic: */ -export interface TopicDomain { - id?: string | null; - display_name?: string | null; +export interface TopicDomain { + id?: string | null; + display_name?: string | null; } + diff --git a/webapp/src/app/api/model/topicField.ts b/webapp/src/app/api/model/topicField.ts index cd7d08c8..c7351675 100644 --- a/webapp/src/app/api/model/topicField.ts +++ b/webapp/src/app/api/model/topicField.ts @@ -1,17 +1,19 @@ /** * Innovation Search Engine API * - * + * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech * Do not edit the class manually. */ + /** * The field (second level) containing this topic: */ -export interface TopicField { - id?: string | null; - display_name?: string | null; +export interface TopicField { + id?: string | null; + display_name?: string | null; } + diff --git a/webapp/src/app/api/model/topicHeatmap.ts b/webapp/src/app/api/model/topicHeatmap.ts index 64e915a5..be36dc40 100644 --- a/webapp/src/app/api/model/topicHeatmap.ts +++ b/webapp/src/app/api/model/topicHeatmap.ts @@ -1,7 +1,7 @@ /** * Innovation Search Engine API * - * + * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech @@ -9,9 +9,11 @@ */ import { TopicHeatmapField } from './topicHeatmapField'; -export interface TopicHeatmap { - institution_id: string; - organization_name: string; - years: Array; - fields: Array; + +export interface TopicHeatmap { + institution_id: string; + organization_name: string; + years: Array; + fields: Array; } + diff --git a/webapp/src/app/api/model/topicHeatmapField.ts b/webapp/src/app/api/model/topicHeatmapField.ts index 4c35a17e..1687c6d9 100644 --- a/webapp/src/app/api/model/topicHeatmapField.ts +++ b/webapp/src/app/api/model/topicHeatmapField.ts @@ -1,7 +1,7 @@ /** * Innovation Search Engine API * - * + * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech @@ -9,9 +9,11 @@ */ import { TopicHeatmapValue } from './topicHeatmapValue'; -export interface TopicHeatmapField { - id: string; - name: string; - total: number; - values: Array; + +export interface TopicHeatmapField { + id: string; + name: string; + total: number; + values: Array; } + diff --git a/webapp/src/app/api/model/topicHeatmapValue.ts b/webapp/src/app/api/model/topicHeatmapValue.ts index 2f5a01d9..f840b938 100644 --- a/webapp/src/app/api/model/topicHeatmapValue.ts +++ b/webapp/src/app/api/model/topicHeatmapValue.ts @@ -1,15 +1,17 @@ /** * Innovation Search Engine API * - * + * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech * Do not edit the class manually. */ -export interface TopicHeatmapValue { - year: number; - count: number; - share: number; + +export interface TopicHeatmapValue { + year: number; + count: number; + share: number; } + diff --git a/webapp/src/app/api/model/topicIds.ts b/webapp/src/app/api/model/topicIds.ts index 22ca3343..4aa6738f 100644 --- a/webapp/src/app/api/model/topicIds.ts +++ b/webapp/src/app/api/model/topicIds.ts @@ -1,17 +1,19 @@ /** * Innovation Search Engine API * - * + * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech * Do not edit the class manually. */ + /** * External identifiers: */ -export interface TopicIds { - openalex?: string | null; - wikipedia?: string | null; +export interface TopicIds { + openalex?: string | null; + wikipedia?: string | null; } + diff --git a/webapp/src/app/api/model/topicPageV2.ts b/webapp/src/app/api/model/topicPageV2.ts new file mode 100644 index 00000000..67f1272b --- /dev/null +++ b/webapp/src/app/api/model/topicPageV2.ts @@ -0,0 +1,31 @@ +/** + * Innovation Search Engine API + * + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ +import { Topic } from './topic'; + + +export interface TopicPageV2 { + /** + * The elements of the page. + */ + elements?: Array; + /** + * The page number. (0-based) + */ + page?: number; + /** + * The page size in elements. + */ + size?: number; + /** + * The total number of elements. + */ + total?: number; +} + diff --git a/webapp/src/app/api/model/topicSubfield.ts b/webapp/src/app/api/model/topicSubfield.ts index 79f3c9c7..53d37842 100644 --- a/webapp/src/app/api/model/topicSubfield.ts +++ b/webapp/src/app/api/model/topicSubfield.ts @@ -1,17 +1,19 @@ /** * Innovation Search Engine API * - * + * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech * Do not edit the class manually. */ + /** * The subfield (third level) containing this topic: */ -export interface TopicSubfield { - id?: string | null; - display_name?: string | null; +export interface TopicSubfield { + id?: string | null; + display_name?: string | null; } + diff --git a/webapp/src/app/api/model/topicYearlyData.ts b/webapp/src/app/api/model/topicYearlyData.ts index a1fdbdc2..7dc05940 100644 --- a/webapp/src/app/api/model/topicYearlyData.ts +++ b/webapp/src/app/api/model/topicYearlyData.ts @@ -1,17 +1,19 @@ /** * Innovation Search Engine API * - * + * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech * Do not edit the class manually. */ -export interface TopicYearlyData { - year: number; - raw: number; - normalized: number; - cumulative: number; - institutions_count: number; + +export interface TopicYearlyData { + year: number; + raw: number; + normalized: number; + cumulative: number; + institutions_count: number; } + diff --git a/webapp/src/app/api/model/topics.ts b/webapp/src/app/api/model/topics.ts index cf40ff1d..44f0eb98 100644 --- a/webapp/src/app/api/model/topics.ts +++ b/webapp/src/app/api/model/topics.ts @@ -1,11 +1,14 @@ /** * Innovation Search Engine API * - * + * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech * Do not edit the class manually. */ -export interface Topics {} + +export interface Topics { +} + diff --git a/webapp/src/app/api/model/topicsByTime.ts b/webapp/src/app/api/model/topicsByTime.ts index 007dc43d..8af7c9bb 100644 --- a/webapp/src/app/api/model/topicsByTime.ts +++ b/webapp/src/app/api/model/topicsByTime.ts @@ -1,7 +1,7 @@ /** * Innovation Search Engine API * - * + * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech @@ -9,25 +9,27 @@ */ import { TopicsByYear } from './topicsByYear'; -export interface TopicsByTime { - /** - * Topics grouped by year. - */ - elements?: Array; - /** - * The number of years. - */ - total?: number; - /** - * True if the timeline contains only a limited subset of the author\'s publications. - */ - is_limited?: boolean; - /** - * The number of publications used to build the timeline. - */ - used_publications?: number; - /** - * The total number of publications found for this author. - */ - total_publications?: number; + +export interface TopicsByTime { + /** + * Topics grouped by year. + */ + elements?: Array; + /** + * The number of years. + */ + total?: number; + /** + * True if the timeline contains only a limited subset of the author\'s publications. + */ + is_limited?: boolean; + /** + * The number of publications used to build the timeline. + */ + used_publications?: number; + /** + * The total number of publications found for this author. + */ + total_publications?: number; } + diff --git a/webapp/src/app/api/model/topicsByYear.ts b/webapp/src/app/api/model/topicsByYear.ts index bb2f1820..fded8da0 100644 --- a/webapp/src/app/api/model/topicsByYear.ts +++ b/webapp/src/app/api/model/topicsByYear.ts @@ -1,7 +1,7 @@ /** * Innovation Search Engine API * - * + * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech @@ -9,21 +9,23 @@ */ import { TopicCount } from './topicCount'; -export interface TopicsByYear { - /** - * The publication year. - */ - year: number; - /** - * The number of works in this year. - */ - publication_count?: number; - /** - * The topics in this year. - */ - topics?: Array; - /** - * The primary topics in this year. - */ - primary_topics?: Array; + +export interface TopicsByYear { + /** + * The publication year. + */ + year: number; + /** + * The number of works in this year. + */ + publication_count?: number; + /** + * The topics in this year. + */ + topics?: Array; + /** + * The primary topics in this year. + */ + primary_topics?: Array; } + diff --git a/webapp/src/app/api/model/topicsListResponse.ts b/webapp/src/app/api/model/topicsListResponse.ts index 058b45fd..43f21226 100644 --- a/webapp/src/app/api/model/topicsListResponse.ts +++ b/webapp/src/app/api/model/topicsListResponse.ts @@ -1,7 +1,7 @@ /** * Innovation Search Engine API * - * + * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech @@ -11,11 +11,13 @@ import { Meta } from './meta'; import { GroupByResult } from './groupByResult'; import { Topic } from './topic'; + /** * TopicsListResponse */ -export interface TopicsListResponse { - meta?: Meta | null; - results?: Array | null; - group_by?: Array | null; +export interface TopicsListResponse { + meta?: Meta | null; + results?: Array | null; + group_by?: Array | null; } + diff --git a/webapp/src/app/api/model/trendResponse.ts b/webapp/src/app/api/model/trendResponse.ts index e6b291c9..c7819dd7 100644 --- a/webapp/src/app/api/model/trendResponse.ts +++ b/webapp/src/app/api/model/trendResponse.ts @@ -1,7 +1,7 @@ /** * Innovation Search Engine API * - * + * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech @@ -9,8 +9,10 @@ */ import { TrendSeries } from './trendSeries'; -export interface TrendResponse { - series: Array; - years: Array; - location_mappings?: { [key: string]: Array } | null; + +export interface TrendResponse { + series: Array; + years: Array; + location_mappings?: { [key: string]: Array; } | null; } + diff --git a/webapp/src/app/api/model/trendSearchType.ts b/webapp/src/app/api/model/trendSearchType.ts index bde11a52..5495800e 100644 --- a/webapp/src/app/api/model/trendSearchType.ts +++ b/webapp/src/app/api/model/trendSearchType.ts @@ -1,20 +1,21 @@ /** * Innovation Search Engine API * - * + * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech * Do not edit the class manually. */ + export const TrendSearchType = { - Publications: 'publications', - Authors: 'authors', - Patents: 'patents', - Projects: 'projects', - News: 'news', - All: 'all', + Publications: 'publications', + Authors: 'authors', + Patents: 'patents', + Projects: 'projects', + News: 'news', + All: 'all' } as const; -export type TrendSearchType = - (typeof TrendSearchType)[keyof typeof TrendSearchType]; +export type TrendSearchType = typeof TrendSearchType[keyof typeof TrendSearchType]; + diff --git a/webapp/src/app/api/model/trendSeries.ts b/webapp/src/app/api/model/trendSeries.ts index b8ce939f..312dee1c 100644 --- a/webapp/src/app/api/model/trendSeries.ts +++ b/webapp/src/app/api/model/trendSeries.ts @@ -1,7 +1,7 @@ /** * Innovation Search Engine API * - * + * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech @@ -9,20 +9,22 @@ */ import { TopicYearlyData } from './topicYearlyData'; -export interface TrendSeries { - entity_id: string; - entity_name: string; - entity_type: TrendSeries.EntityTypeEnum; - country_code?: string | null; - topic_data: { [key: string]: Array }; + +export interface TrendSeries { + entity_id: string; + entity_name: string; + entity_type: TrendSeries.EntityTypeEnum; + country_code?: string | null; + topic_data: { [key: string]: Array; }; } export namespace TrendSeries { - export const EntityTypeEnum = { - Institution: 'institution', - Country: 'country', - Region: 'region', - Author: 'author', - } as const; - export type EntityTypeEnum = - (typeof EntityTypeEnum)[keyof typeof EntityTypeEnum]; + export const EntityTypeEnum = { + Institution: 'institution', + Country: 'country', + Region: 'region', + Author: 'author' + } as const; + export type EntityTypeEnum = typeof EntityTypeEnum[keyof typeof EntityTypeEnum]; } + + diff --git a/webapp/src/app/api/model/universityRanking.ts b/webapp/src/app/api/model/universityRanking.ts index 5c9d0d05..3099e73e 100644 --- a/webapp/src/app/api/model/universityRanking.ts +++ b/webapp/src/app/api/model/universityRanking.ts @@ -1,27 +1,30 @@ /** * Innovation Search Engine API * - * + * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech * Do not edit the class manually. */ -export interface UniversityRanking { - rank: number; - university: string; - publications: number; - citations: number; - growth_rate: number; - trend: UniversityRanking.TrendEnum; - is_top_mover: boolean; + +export interface UniversityRanking { + rank: number; + university: string; + publications: number; + citations: number; + growth_rate: number; + trend: UniversityRanking.TrendEnum; + is_top_mover: boolean; } export namespace UniversityRanking { - export const TrendEnum = { - Up: 'up', - Down: 'down', - Stable: 'stable', - } as const; - export type TrendEnum = (typeof TrendEnum)[keyof typeof TrendEnum]; + export const TrendEnum = { + Up: 'up', + Down: 'down', + Stable: 'stable' + } as const; + export type TrendEnum = typeof TrendEnum[keyof typeof TrendEnum]; } + + diff --git a/webapp/src/app/api/model/universityTopicData.ts b/webapp/src/app/api/model/universityTopicData.ts index 3bf43088..ea31291d 100644 --- a/webapp/src/app/api/model/universityTopicData.ts +++ b/webapp/src/app/api/model/universityTopicData.ts @@ -1,7 +1,7 @@ /** * Innovation Search Engine API * - * + * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech @@ -10,8 +10,10 @@ import { YearlyData } from './yearlyData'; import { Topic } from './topic'; -export interface UniversityTopicData { - university: string; - topic: Topic; - yearly_data: Array; + +export interface UniversityTopicData { + university: string; + topic: Topic; + yearly_data: Array; } + diff --git a/webapp/src/app/api/model/updateAccountRequest.ts b/webapp/src/app/api/model/updateAccountRequest.ts index db502fd9..574f5d0d 100644 --- a/webapp/src/app/api/model/updateAccountRequest.ts +++ b/webapp/src/app/api/model/updateAccountRequest.ts @@ -1,7 +1,7 @@ /** * Innovation Search Engine API * - * + * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech @@ -9,13 +9,15 @@ */ import { UserRole } from './userRole'; -export interface UpdateAccountRequest { - email?: string | null; - name?: string | null; - roles?: Array | null; - organization_id?: string | null; - password?: string | null; - openalex_person_id?: string | null; - deleted?: boolean | null; - activated?: boolean | null; + +export interface UpdateAccountRequest { + email?: string | null; + name?: string | null; + roles?: Array | null; + organization_id?: string | null; + password?: string | null; + openalex_person_id?: string | null; + deleted?: boolean | null; + activated?: boolean | null; } + diff --git a/webapp/src/app/api/model/updateOrganizationRequest.ts b/webapp/src/app/api/model/updateOrganizationRequest.ts index a56b51e7..e12063b6 100644 --- a/webapp/src/app/api/model/updateOrganizationRequest.ts +++ b/webapp/src/app/api/model/updateOrganizationRequest.ts @@ -1,15 +1,17 @@ /** * Innovation Search Engine API * - * + * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech * Do not edit the class manually. */ -export interface UpdateOrganizationRequest { - name?: string | null; - other_inst_id?: string | null; - deleted?: boolean | null; + +export interface UpdateOrganizationRequest { + name?: string | null; + other_inst_id?: string | null; + deleted?: boolean | null; } + diff --git a/webapp/src/app/api/model/userRole.ts b/webapp/src/app/api/model/userRole.ts index f6d08b53..83b5c595 100644 --- a/webapp/src/app/api/model/userRole.ts +++ b/webapp/src/app/api/model/userRole.ts @@ -1,17 +1,19 @@ /** * Innovation Search Engine API * - * + * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech * Do not edit the class manually. */ + export const UserRole = { - SuperAdmin: 'SUPER_ADMIN', - Admin: 'ADMIN', - Manager: 'MANAGER', - User: 'USER', + SuperAdmin: 'SUPER_ADMIN', + Admin: 'ADMIN', + Manager: 'MANAGER', + User: 'USER' } as const; -export type UserRole = (typeof UserRole)[keyof typeof UserRole]; +export type UserRole = typeof UserRole[keyof typeof UserRole]; + diff --git a/webapp/src/app/api/model/validationError.ts b/webapp/src/app/api/model/validationError.ts index 18cd1b61..bdbd57ad 100644 --- a/webapp/src/app/api/model/validationError.ts +++ b/webapp/src/app/api/model/validationError.ts @@ -1,7 +1,7 @@ /** * Innovation Search Engine API * - * + * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech @@ -9,8 +9,10 @@ */ import { ValidationErrorLocInner } from './validationErrorLocInner'; -export interface ValidationError { - loc: Array; - msg: string; - type: string; + +export interface ValidationError { + loc: Array; + msg: string; + type: string; } + diff --git a/webapp/src/app/api/model/validationErrorLocInner.ts b/webapp/src/app/api/model/validationErrorLocInner.ts index 3c1ffa29..d248a9b7 100644 --- a/webapp/src/app/api/model/validationErrorLocInner.ts +++ b/webapp/src/app/api/model/validationErrorLocInner.ts @@ -1,11 +1,14 @@ /** * Innovation Search Engine API * - * + * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech * Do not edit the class manually. */ -export interface ValidationErrorLocInner {} + +export interface ValidationErrorLocInner { +} + diff --git a/webapp/src/app/api/model/value.ts b/webapp/src/app/api/model/value.ts index 016b21cb..a9fc79ba 100644 --- a/webapp/src/app/api/model/value.ts +++ b/webapp/src/app/api/model/value.ts @@ -1,11 +1,14 @@ /** * Innovation Search Engine API * - * + * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech * Do not edit the class manually. */ -export interface Value {} + +export interface Value { +} + diff --git a/webapp/src/app/api/model/work.ts b/webapp/src/app/api/model/work.ts index 6c6ae99b..07d94a1c 100644 --- a/webapp/src/app/api/model/work.ts +++ b/webapp/src/app/api/model/work.ts @@ -1,7 +1,7 @@ /** * Innovation Search Engine API * - * + * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech @@ -24,46 +24,48 @@ import { WorkHasContent } from './workHasContent'; import { Location } from './location'; import { WorkBiblio } from './workBiblio'; + /** * A scholarly document (article, book, dataset, thesis, etc.) */ -export interface Work { - id?: string | null; - doi?: string | null; - title?: string | null; - display_name?: string | null; - publication_year?: number | null; - publication_date?: string | null; - type?: string | null; - language?: string | null; - cited_by_count?: number | null; - is_retracted?: boolean | null; - is_paratext?: boolean | null; - primary_location?: Location | null; - locations?: Array | null; - best_oa_location?: Location | null; - open_access?: OpenAccess | null; - authorships?: Array | null; - ids?: WorkIds | null; - biblio?: WorkBiblio | null; - abstract_inverted_index?: object | null; - referenced_works?: Array | null; - referenced_works_count?: number | null; - related_works?: Array | null; - topics?: Array | null; - primary_topic?: WorkTopic | null; - keywords?: Array | null; - funders?: Array | null; - awards?: Array | null; - fwci?: Fwci | null; - citation_normalized_percentile?: WorkCitationNormalizedPercentile | null; - cited_by_percentile_year?: WorkCitedByPercentileYear | null; - counts_by_year?: Array | null; - sustainable_development_goals?: Array | null; - mesh?: Array | null; - indexed_in?: Array | null; - has_content?: WorkHasContent | null; - content_url?: string | null; - created_date?: string | null; - updated_date?: string | null; +export interface Work { + id?: string | null; + doi?: string | null; + title?: string | null; + display_name?: string | null; + publication_year?: number | null; + publication_date?: string | null; + type?: string | null; + language?: string | null; + cited_by_count?: number | null; + is_retracted?: boolean | null; + is_paratext?: boolean | null; + primary_location?: Location | null; + locations?: Array | null; + best_oa_location?: Location | null; + open_access?: OpenAccess | null; + authorships?: Array | null; + ids?: WorkIds | null; + biblio?: WorkBiblio | null; + abstract_inverted_index?: object | null; + referenced_works?: Array | null; + referenced_works_count?: number | null; + related_works?: Array | null; + topics?: Array | null; + primary_topic?: WorkTopic | null; + keywords?: Array | null; + funders?: Array | null; + awards?: Array | null; + fwci?: Fwci | null; + citation_normalized_percentile?: WorkCitationNormalizedPercentile | null; + cited_by_percentile_year?: WorkCitedByPercentileYear | null; + counts_by_year?: Array | null; + sustainable_development_goals?: Array | null; + mesh?: Array | null; + indexed_in?: Array | null; + has_content?: WorkHasContent | null; + content_url?: string | null; + created_date?: string | null; + updated_date?: string | null; } + diff --git a/webapp/src/app/api/model/workBiblio.ts b/webapp/src/app/api/model/workBiblio.ts index 65c0a34b..f6d7079b 100644 --- a/webapp/src/app/api/model/workBiblio.ts +++ b/webapp/src/app/api/model/workBiblio.ts @@ -1,19 +1,21 @@ /** * Innovation Search Engine API * - * + * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech * Do not edit the class manually. */ + /** * Bibliographic info: `volume`, `issue`, `first_page`, `last_page`. */ -export interface WorkBiblio { - volume?: string | null; - issue?: string | null; - first_page?: string | null; - last_page?: string | null; +export interface WorkBiblio { + volume?: string | null; + issue?: string | null; + first_page?: string | null; + last_page?: string | null; } + diff --git a/webapp/src/app/api/model/workCitationNormalizedPercentile.ts b/webapp/src/app/api/model/workCitationNormalizedPercentile.ts index 4a2bc6d4..a587ddf6 100644 --- a/webapp/src/app/api/model/workCitationNormalizedPercentile.ts +++ b/webapp/src/app/api/model/workCitationNormalizedPercentile.ts @@ -1,7 +1,7 @@ /** * Innovation Search Engine API * - * + * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech @@ -9,11 +9,13 @@ */ import { Value } from './value'; + /** * Percentile of citation count normalized by work type, year, and subfield. Includes `value`, `is_in_top_1_percent`, `is_in_top_10_percent`. */ -export interface WorkCitationNormalizedPercentile { - value?: Value | null; - is_in_top_1_percent?: boolean | null; - is_in_top_10_percent?: boolean | null; +export interface WorkCitationNormalizedPercentile { + value?: Value | null; + is_in_top_1_percent?: boolean | null; + is_in_top_10_percent?: boolean | null; } + diff --git a/webapp/src/app/api/model/workCitedByPercentileYear.ts b/webapp/src/app/api/model/workCitedByPercentileYear.ts index 7bcd3c85..5257eb3b 100644 --- a/webapp/src/app/api/model/workCitedByPercentileYear.ts +++ b/webapp/src/app/api/model/workCitedByPercentileYear.ts @@ -1,17 +1,19 @@ /** * Innovation Search Engine API * - * + * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech * Do not edit the class manually. */ + /** * Percentile rank compared to other works published in the same year. Contains `min` and `max`. */ -export interface WorkCitedByPercentileYear { - min?: number | null; - max?: number | null; +export interface WorkCitedByPercentileYear { + min?: number | null; + max?: number | null; } + diff --git a/webapp/src/app/api/model/workClassification.ts b/webapp/src/app/api/model/workClassification.ts index ff62bec2..12885922 100644 --- a/webapp/src/app/api/model/workClassification.ts +++ b/webapp/src/app/api/model/workClassification.ts @@ -1,7 +1,7 @@ /** * Innovation Search Engine API * - * + * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech @@ -14,30 +14,32 @@ import { WorkClassificationMeta } from './workClassificationMeta'; import { WorkClassificationValidation } from './workClassificationValidation'; import { WorkClassificationAuthor } from './workClassificationAuthor'; + /** * Represents a full work-classification document. */ -export interface WorkClassification { - /** - * The full OpenAlex work id/URL. - */ - work_id: string; - doi?: string | null; - title?: string | null; - publication_year?: number | null; - /** - * The authors of the work. - */ - authors?: Array; - /** - * The institutions associated with the work. - */ - institutions?: Array; - /** - * The topics associated with the work. - */ - topics?: Array; - classification?: WorkClassificationDetails | null; - classification_meta?: WorkClassificationMeta | null; - validation?: WorkClassificationValidation | null; +export interface WorkClassification { + /** + * The full OpenAlex work id/URL. + */ + work_id: string; + doi?: string | null; + title?: string | null; + publication_year?: number | null; + /** + * The authors of the work. + */ + authors?: Array; + /** + * The institutions associated with the work. + */ + institutions?: Array; + /** + * The topics associated with the work. + */ + topics?: Array; + classification?: WorkClassificationDetails | null; + classification_meta?: WorkClassificationMeta | null; + validation?: WorkClassificationValidation | null; } + diff --git a/webapp/src/app/api/model/workClassificationAuthor.ts b/webapp/src/app/api/model/workClassificationAuthor.ts index aef36e2b..a28e37de 100644 --- a/webapp/src/app/api/model/workClassificationAuthor.ts +++ b/webapp/src/app/api/model/workClassificationAuthor.ts @@ -1,18 +1,20 @@ /** * Innovation Search Engine API * - * + * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech * Do not edit the class manually. */ + /** * An author entry within a work classification document. */ -export interface WorkClassificationAuthor { - id?: string | null; - display_name?: string | null; - orcid?: string | null; +export interface WorkClassificationAuthor { + id?: string | null; + display_name?: string | null; + orcid?: string | null; } + diff --git a/webapp/src/app/api/model/workClassificationDetails.ts b/webapp/src/app/api/model/workClassificationDetails.ts index 20593e72..e096423b 100644 --- a/webapp/src/app/api/model/workClassificationDetails.ts +++ b/webapp/src/app/api/model/workClassificationDetails.ts @@ -1,7 +1,7 @@ /** * Innovation Search Engine API * - * + * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech @@ -9,16 +9,20 @@ */ import { WorkPrimaryCategory } from './workPrimaryCategory'; + /** * The core classification result for a work. */ -export interface WorkClassificationDetails { - primary_category?: WorkPrimaryCategory | null; - confidence?: string | null; - pasteur_quadrant?: string | null; - applied_orientation_score?: number | null; - insufficient_context?: boolean | null; - signals_used?: Array | null; - classification_reason?: string | null; +export interface WorkClassificationDetails { + primary_category?: WorkPrimaryCategory | null; + confidence?: string | null; + pasteur_quadrant?: string | null; + applied_orientation_score?: number | null; + insufficient_context?: boolean | null; + signals_used?: Array | null; + classification_reason?: string | null; } -export namespace WorkClassificationDetails {} +export namespace WorkClassificationDetails { +} + + diff --git a/webapp/src/app/api/model/workClassificationInstitution.ts b/webapp/src/app/api/model/workClassificationInstitution.ts index 754b1eb8..db2eae24 100644 --- a/webapp/src/app/api/model/workClassificationInstitution.ts +++ b/webapp/src/app/api/model/workClassificationInstitution.ts @@ -1,18 +1,20 @@ /** * Innovation Search Engine API * - * + * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech * Do not edit the class manually. */ + /** * An institution entry within a work classification document. */ -export interface WorkClassificationInstitution { - id?: string | null; - display_name?: string | null; - ror?: string | null; +export interface WorkClassificationInstitution { + id?: string | null; + display_name?: string | null; + ror?: string | null; } + diff --git a/webapp/src/app/api/model/workClassificationMerge.ts b/webapp/src/app/api/model/workClassificationMerge.ts new file mode 100644 index 00000000..e47a5880 --- /dev/null +++ b/webapp/src/app/api/model/workClassificationMerge.ts @@ -0,0 +1,21 @@ +/** + * Innovation Search Engine API + * + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ +import { WorkClassification } from './workClassification'; +import { Work } from './work'; + + +export interface WorkClassificationMerge { + /** + * The OpenAlex work object. + */ + work: Work; + classification?: WorkClassification | null; +} + diff --git a/webapp/src/app/api/model/workClassificationMergePage.ts b/webapp/src/app/api/model/workClassificationMergePage.ts new file mode 100644 index 00000000..b32d7e95 --- /dev/null +++ b/webapp/src/app/api/model/workClassificationMergePage.ts @@ -0,0 +1,31 @@ +/** + * Innovation Search Engine API + * + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ +import { WorkClassificationMerge } from './workClassificationMerge'; + + +export interface WorkClassificationMergePage { + /** + * The elements of the page. + */ + elements?: Array; + /** + * The page number. (0-based) + */ + page?: number; + /** + * The page size in elements. + */ + size?: number; + /** + * The total number of elements. + */ + total?: number; +} + diff --git a/webapp/src/app/api/model/workClassificationMeta.ts b/webapp/src/app/api/model/workClassificationMeta.ts index 9e6619d5..eb67e185 100644 --- a/webapp/src/app/api/model/workClassificationMeta.ts +++ b/webapp/src/app/api/model/workClassificationMeta.ts @@ -1,18 +1,20 @@ /** * Innovation Search Engine API * - * + * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech * Do not edit the class manually. */ + /** * Metadata about how and when a classification was produced. */ -export interface WorkClassificationMeta { - model?: string | null; - prompt_version?: string | null; - classified_at?: string | null; +export interface WorkClassificationMeta { + model?: string | null; + prompt_version?: string | null; + classified_at?: string | null; } + diff --git a/webapp/src/app/api/model/workClassificationPage.ts b/webapp/src/app/api/model/workClassificationPage.ts index db7e3e0d..22b71991 100644 --- a/webapp/src/app/api/model/workClassificationPage.ts +++ b/webapp/src/app/api/model/workClassificationPage.ts @@ -1,7 +1,7 @@ /** * Innovation Search Engine API * - * + * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech @@ -9,21 +9,23 @@ */ import { WorkClassification } from './workClassification'; -export interface WorkClassificationPage { - /** - * The elements of the page. - */ - elements?: Array; - /** - * The page number. (0-based) - */ - page?: number; - /** - * The page size in elements. - */ - size?: number; - /** - * The total number of elements. - */ - total?: number; + +export interface WorkClassificationPage { + /** + * The elements of the page. + */ + elements?: Array; + /** + * The page number. (0-based) + */ + page?: number; + /** + * The page size in elements. + */ + size?: number; + /** + * The total number of elements. + */ + total?: number; } + diff --git a/webapp/src/app/api/model/workClassificationTopic.ts b/webapp/src/app/api/model/workClassificationTopic.ts index 34f8c96a..5ea5b9f9 100644 --- a/webapp/src/app/api/model/workClassificationTopic.ts +++ b/webapp/src/app/api/model/workClassificationTopic.ts @@ -1,7 +1,7 @@ /** * Innovation Search Engine API * - * + * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech @@ -9,14 +9,16 @@ */ import { WorkClassificationTopicGroup } from './workClassificationTopicGroup'; + /** * A topic entry within a work classification document. */ -export interface WorkClassificationTopic { - id?: string | null; - display_name?: string | null; - score?: number | null; - domain?: WorkClassificationTopicGroup | null; - field?: WorkClassificationTopicGroup | null; - subfield?: WorkClassificationTopicGroup | null; +export interface WorkClassificationTopic { + id?: string | null; + display_name?: string | null; + score?: number | null; + domain?: WorkClassificationTopicGroup | null; + field?: WorkClassificationTopicGroup | null; + subfield?: WorkClassificationTopicGroup | null; } + diff --git a/webapp/src/app/api/model/workClassificationTopicGroup.ts b/webapp/src/app/api/model/workClassificationTopicGroup.ts index 8e574397..58ce3fe6 100644 --- a/webapp/src/app/api/model/workClassificationTopicGroup.ts +++ b/webapp/src/app/api/model/workClassificationTopicGroup.ts @@ -1,17 +1,19 @@ /** * Innovation Search Engine API * - * + * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech * Do not edit the class manually. */ + /** * A domain/field/subfield group referenced within a classification topic. */ -export interface WorkClassificationTopicGroup { - id?: string | null; - display_name?: string | null; +export interface WorkClassificationTopicGroup { + id?: string | null; + display_name?: string | null; } + diff --git a/webapp/src/app/api/model/workClassificationValidation.ts b/webapp/src/app/api/model/workClassificationValidation.ts index 46c91824..da1db647 100644 --- a/webapp/src/app/api/model/workClassificationValidation.ts +++ b/webapp/src/app/api/model/workClassificationValidation.ts @@ -1,18 +1,20 @@ /** * Innovation Search Engine API * - * + * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech * Do not edit the class manually. */ + /** * Validation results for a classification. */ -export interface WorkClassificationValidation { - valid?: boolean | null; - errors?: Array | null; - corrections?: Array | null; +export interface WorkClassificationValidation { + valid?: boolean | null; + errors?: Array | null; + corrections?: Array | null; } + diff --git a/webapp/src/app/api/model/workCountsByYearInner.ts b/webapp/src/app/api/model/workCountsByYearInner.ts index 496a11db..76d97d77 100644 --- a/webapp/src/app/api/model/workCountsByYearInner.ts +++ b/webapp/src/app/api/model/workCountsByYearInner.ts @@ -1,17 +1,19 @@ /** * Innovation Search Engine API * - * + * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech * Do not edit the class manually. */ + /** * WorkCountsByYearInner */ -export interface WorkCountsByYearInner { - year?: number | null; - cited_by_count?: number | null; +export interface WorkCountsByYearInner { + year?: number | null; + cited_by_count?: number | null; } + diff --git a/webapp/src/app/api/model/workHasContent.ts b/webapp/src/app/api/model/workHasContent.ts index 76871238..44fbe446 100644 --- a/webapp/src/app/api/model/workHasContent.ts +++ b/webapp/src/app/api/model/workHasContent.ts @@ -1,17 +1,19 @@ /** * Innovation Search Engine API * - * + * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech * Do not edit the class manually. */ + /** * Information about downloadable full-text content: */ -export interface WorkHasContent { - pdf?: boolean | null; - grobid_xml?: boolean | null; +export interface WorkHasContent { + pdf?: boolean | null; + grobid_xml?: boolean | null; } + diff --git a/webapp/src/app/api/model/workIds.ts b/webapp/src/app/api/model/workIds.ts index fe562e40..e8315250 100644 --- a/webapp/src/app/api/model/workIds.ts +++ b/webapp/src/app/api/model/workIds.ts @@ -1,20 +1,22 @@ /** * Innovation Search Engine API * - * + * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech * Do not edit the class manually. */ + /** * External identifiers: `openalex`, `doi`, `mag`, `pmid`, `pmcid`. */ -export interface WorkIds { - openalex?: string | null; - doi?: string | null; - mag?: number | null; - pmid?: string | null; - pmcid?: string | null; +export interface WorkIds { + openalex?: string | null; + doi?: string | null; + mag?: number | null; + pmid?: string | null; + pmcid?: string | null; } + diff --git a/webapp/src/app/api/model/workKeyword.ts b/webapp/src/app/api/model/workKeyword.ts index 7270db25..c9c99afb 100644 --- a/webapp/src/app/api/model/workKeyword.ts +++ b/webapp/src/app/api/model/workKeyword.ts @@ -1,7 +1,7 @@ /** * Innovation Search Engine API * - * + * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech @@ -9,11 +9,13 @@ */ import { Score } from './score'; + /** * WorkKeyword */ -export interface WorkKeyword { - id?: string | null; - display_name?: string | null; - score?: Score | null; +export interface WorkKeyword { + id?: string | null; + display_name?: string | null; + score?: Score | null; } + diff --git a/webapp/src/app/api/model/workMeshInner.ts b/webapp/src/app/api/model/workMeshInner.ts index 36a0c569..40633524 100644 --- a/webapp/src/app/api/model/workMeshInner.ts +++ b/webapp/src/app/api/model/workMeshInner.ts @@ -1,20 +1,22 @@ /** * Innovation Search Engine API * - * + * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech * Do not edit the class manually. */ + /** * WorkMeshInner */ -export interface WorkMeshInner { - descriptor_ui?: string | null; - descriptor_name?: string | null; - qualifier_ui?: string | null; - qualifier_name?: string | null; - is_major_topic?: boolean | null; +export interface WorkMeshInner { + descriptor_ui?: string | null; + descriptor_name?: string | null; + qualifier_ui?: string | null; + qualifier_name?: string | null; + is_major_topic?: boolean | null; } + diff --git a/webapp/src/app/api/model/workNetworkNode.ts b/webapp/src/app/api/model/workNetworkNode.ts index 445cd8ad..abc04a69 100644 --- a/webapp/src/app/api/model/workNetworkNode.ts +++ b/webapp/src/app/api/model/workNetworkNode.ts @@ -1,7 +1,7 @@ /** * Innovation Search Engine API * - * + * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech @@ -10,20 +10,24 @@ import { WorkTopicInformation } from './workTopicInformation'; import { CollaborationNetworkNodeType } from './collaborationNetworkNodeType'; -export interface WorkNetworkNode { - /** - * The raw ID of the node. For an author node, this is the raw person ID. For an institution node, this is the raw institution ID. For a work node, this is the raw work ID. - */ - raw_id: string; - /** - * The display name of the node. - */ - display_name: string; - /** - * The category of the node, either \'author\', \'institution\', or \'work\'. - */ - category: CollaborationNetworkNodeType; - publication_year: number | null; - work_topics_information: Set | null; + +export interface WorkNetworkNode { + /** + * The raw ID of the node. For an author node, this is the raw person ID. For an institution node, this is the raw institution ID. For a work node, this is the raw work ID. + */ + raw_id: string; + /** + * The display name of the node. + */ + display_name: string; + /** + * The category of the node, either \'author\', \'institution\', or \'work\'. + */ + category: CollaborationNetworkNodeType; + publication_year: number | null; + work_topics_information: Set | null; } -export namespace WorkNetworkNode {} +export namespace WorkNetworkNode { +} + + diff --git a/webapp/src/app/api/model/workPage.ts b/webapp/src/app/api/model/workPage.ts new file mode 100644 index 00000000..8490c3ab --- /dev/null +++ b/webapp/src/app/api/model/workPage.ts @@ -0,0 +1,35 @@ +/** + * Innovation Search Engine API + * + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ +import { Work } from './work'; + + +export interface WorkPage { + /** + * Total number of works matching the query + */ + total: number; + /** + * List of works on the current page + */ + elements: Array; + /** + * Offset of the current page + */ + offset: number; + /** + * Size of the current page + */ + size: number; + /** + * Indicates if the current page is the last page + */ + last_page: boolean; +} + diff --git a/webapp/src/app/api/model/workPageV2.ts b/webapp/src/app/api/model/workPageV2.ts new file mode 100644 index 00000000..a22b6855 --- /dev/null +++ b/webapp/src/app/api/model/workPageV2.ts @@ -0,0 +1,31 @@ +/** + * Innovation Search Engine API + * + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ +import { Work } from './work'; + + +export interface WorkPageV2 { + /** + * The elements of the page. + */ + elements?: Array; + /** + * The page number. (0-based) + */ + page?: number; + /** + * The page size in elements. + */ + size?: number; + /** + * The total number of elements. + */ + total?: number; +} + diff --git a/webapp/src/app/api/model/workPrimaryCategory.ts b/webapp/src/app/api/model/workPrimaryCategory.ts index 563359d3..ddbbde75 100644 --- a/webapp/src/app/api/model/workPrimaryCategory.ts +++ b/webapp/src/app/api/model/workPrimaryCategory.ts @@ -1,22 +1,23 @@ /** * Innovation Search Engine API * - * + * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech * Do not edit the class manually. */ + /** * Represents the primary category of a work. */ export const WorkPrimaryCategory = { - BasicResearch: 'basic_research', - AppliedResearch: 'applied_research', - NonResearch: 'non_research', - ExperimentalDevelopment: 'experimental_development', - NotClassified: 'not_classified', + BasicResearch: 'basic_research', + AppliedResearch: 'applied_research', + NonResearch: 'non_research', + ExperimentalDevelopment: 'experimental_development', + NotClassified: 'not_classified' } as const; -export type WorkPrimaryCategory = - (typeof WorkPrimaryCategory)[keyof typeof WorkPrimaryCategory]; +export type WorkPrimaryCategory = typeof WorkPrimaryCategory[keyof typeof WorkPrimaryCategory]; + diff --git a/webapp/src/app/api/model/workSortBy.ts b/webapp/src/app/api/model/workSortBy.ts index 56f89162..7580ac82 100644 --- a/webapp/src/app/api/model/workSortBy.ts +++ b/webapp/src/app/api/model/workSortBy.ts @@ -1,18 +1,20 @@ /** * Innovation Search Engine API * - * + * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech * Do not edit the class manually. */ + export const WorkSortBy = { - Title: 'title', - Type: 'type', - PublicationYear: 'publication_year', - Language: 'language', - CitedByCount: 'cited_by_count', + Title: 'title', + Type: 'type', + PublicationYear: 'publication_year', + Language: 'language', + CitedByCount: 'cited_by_count' } as const; -export type WorkSortBy = (typeof WorkSortBy)[keyof typeof WorkSortBy]; +export type WorkSortBy = typeof WorkSortBy[keyof typeof WorkSortBy]; + diff --git a/webapp/src/app/api/model/workSustainableDevelopmentGoalsInner.ts b/webapp/src/app/api/model/workSustainableDevelopmentGoalsInner.ts index 8bc67292..c9ecd00f 100644 --- a/webapp/src/app/api/model/workSustainableDevelopmentGoalsInner.ts +++ b/webapp/src/app/api/model/workSustainableDevelopmentGoalsInner.ts @@ -1,7 +1,7 @@ /** * Innovation Search Engine API * - * + * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech @@ -9,11 +9,13 @@ */ import { Score } from './score'; + /** * WorkSustainableDevelopmentGoalsInner */ -export interface WorkSustainableDevelopmentGoalsInner { - id?: string | null; - display_name?: string | null; - score?: Score | null; +export interface WorkSustainableDevelopmentGoalsInner { + id?: string | null; + display_name?: string | null; + score?: Score | null; } + diff --git a/webapp/src/app/api/model/workTopic.ts b/webapp/src/app/api/model/workTopic.ts index 4b365f33..f938cb25 100644 --- a/webapp/src/app/api/model/workTopic.ts +++ b/webapp/src/app/api/model/workTopic.ts @@ -1,7 +1,7 @@ /** * Innovation Search Engine API * - * + * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech @@ -12,15 +12,17 @@ import { WorkTopicDomain } from './workTopicDomain'; import { WorkTopicSubfield } from './workTopicSubfield'; import { WorkTopicField } from './workTopicField'; + /** * WorkTopic */ -export interface WorkTopic { - id?: string | null; - display_name?: string | null; - description?: string | null; - score?: Score | null; - subfield?: WorkTopicSubfield | null; - field?: WorkTopicField | null; - domain?: WorkTopicDomain | null; +export interface WorkTopic { + id?: string | null; + display_name?: string | null; + description?: string | null; + score?: Score | null; + subfield?: WorkTopicSubfield | null; + field?: WorkTopicField | null; + domain?: WorkTopicDomain | null; } + diff --git a/webapp/src/app/api/model/workTopicDomain.ts b/webapp/src/app/api/model/workTopicDomain.ts index 13b227df..1a9879d4 100644 --- a/webapp/src/app/api/model/workTopicDomain.ts +++ b/webapp/src/app/api/model/workTopicDomain.ts @@ -1,17 +1,19 @@ /** * Innovation Search Engine API * - * + * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech * Do not edit the class manually. */ + /** * The parent [domain](/api-reference/domains) */ -export interface WorkTopicDomain { - id?: string | null; - display_name?: string | null; +export interface WorkTopicDomain { + id?: string | null; + display_name?: string | null; } + diff --git a/webapp/src/app/api/model/workTopicField.ts b/webapp/src/app/api/model/workTopicField.ts index 432b993e..1807cfc1 100644 --- a/webapp/src/app/api/model/workTopicField.ts +++ b/webapp/src/app/api/model/workTopicField.ts @@ -1,17 +1,19 @@ /** * Innovation Search Engine API * - * + * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech * Do not edit the class manually. */ + /** * The parent [field](/api-reference/fields) */ -export interface WorkTopicField { - id?: string | null; - display_name?: string | null; +export interface WorkTopicField { + id?: string | null; + display_name?: string | null; } + diff --git a/webapp/src/app/api/model/workTopicInformation.ts b/webapp/src/app/api/model/workTopicInformation.ts index 5dbbfc78..ca3b9454 100644 --- a/webapp/src/app/api/model/workTopicInformation.ts +++ b/webapp/src/app/api/model/workTopicInformation.ts @@ -1,20 +1,22 @@ /** * Innovation Search Engine API * - * + * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech * Do not edit the class manually. */ -export interface WorkTopicInformation { - /** - * The ID of the topic. - */ - raw_topic_id: string; - /** - * The name of the topic. - */ - display_name: string; + +export interface WorkTopicInformation { + /** + * The ID of the topic. + */ + raw_topic_id: string; + /** + * The name of the topic. + */ + display_name: string; } + diff --git a/webapp/src/app/api/model/workTopicSubfield.ts b/webapp/src/app/api/model/workTopicSubfield.ts index 49c1155b..b6e7278a 100644 --- a/webapp/src/app/api/model/workTopicSubfield.ts +++ b/webapp/src/app/api/model/workTopicSubfield.ts @@ -1,17 +1,19 @@ /** * Innovation Search Engine API * - * + * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech * Do not edit the class manually. */ + /** * The parent [subfield](/api-reference/subfields) */ -export interface WorkTopicSubfield { - id?: string | null; - display_name?: string | null; +export interface WorkTopicSubfield { + id?: string | null; + display_name?: string | null; } + diff --git a/webapp/src/app/api/model/worksFilterProperties.ts b/webapp/src/app/api/model/worksFilterProperties.ts index fd25fd26..bd6cc9a4 100644 --- a/webapp/src/app/api/model/worksFilterProperties.ts +++ b/webapp/src/app/api/model/worksFilterProperties.ts @@ -1,32 +1,34 @@ /** * Innovation Search Engine API * - * + * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech * Do not edit the class manually. */ -export interface WorksFilterProperties { - /** - * The start publication year for the works to include in the collaboration network. - */ - start_year?: number; - /** - * The end publication year for the works to include in the collaboration network. - */ - end_year?: number; - /** - * The list of raw topic IDs to include in the collaboration network. If empty, all topics will be included. - */ - allowed_topics?: Array; - /** - * The minimum number of contributors required for a work to be included in the collaboration network. - */ - min_contributors?: number; - /** - * The maximum number of contributors allowed for a work to be included in the collaboration network. - */ - max_contributors?: number; + +export interface WorksFilterProperties { + /** + * The start publication year for the works to include in the collaboration network. + */ + start_year?: number; + /** + * The end publication year for the works to include in the collaboration network. + */ + end_year?: number; + /** + * The list of raw topic IDs to include in the collaboration network. If empty, all topics will be included. + */ + allowed_topics?: Array; + /** + * The minimum number of contributors required for a work to be included in the collaboration network. + */ + min_contributors?: number; + /** + * The maximum number of contributors allowed for a work to be included in the collaboration network. + */ + max_contributors?: number; } + diff --git a/webapp/src/app/api/model/worksListResponse.ts b/webapp/src/app/api/model/worksListResponse.ts index bc21a41b..a65d3849 100644 --- a/webapp/src/app/api/model/worksListResponse.ts +++ b/webapp/src/app/api/model/worksListResponse.ts @@ -1,7 +1,7 @@ /** * Innovation Search Engine API * - * + * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech @@ -11,11 +11,13 @@ import { Meta } from './meta'; import { Work } from './work'; import { GroupByResult } from './groupByResult'; + /** * WorksListResponse */ -export interface WorksListResponse { - meta?: Meta | null; - results?: Array | null; - group_by?: Array | null; +export interface WorksListResponse { + meta?: Meta | null; + results?: Array | null; + group_by?: Array | null; } + diff --git a/webapp/src/app/api/model/yearlyData.ts b/webapp/src/app/api/model/yearlyData.ts index d473f13e..3272805e 100644 --- a/webapp/src/app/api/model/yearlyData.ts +++ b/webapp/src/app/api/model/yearlyData.ts @@ -1,15 +1,17 @@ /** * Innovation Search Engine API * - * + * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech * Do not edit the class manually. */ -export interface YearlyData { - year: number; - publications: number; - citations: number; + +export interface YearlyData { + year: number; + publications: number; + citations: number; } + diff --git a/webapp/src/app/api/param.ts b/webapp/src/app/api/param.ts index 486c804e..78a2d20a 100644 --- a/webapp/src/app/api/param.ts +++ b/webapp/src/app/api/param.ts @@ -8,7 +8,8 @@ export type StandardParamStyle = | 'simple' | 'spaceDelimited' | 'pipeDelimited' - | 'deepObject'; + | 'deepObject' + ; /** * The OpenAPI standard {@link StandardParamStyle}s may be extended by custom styles by the user. @@ -24,12 +25,13 @@ export type ParamLocation = 'query' | 'header' | 'path' | 'cookie'; * Standard types as defined in OpenAPI Specification: Data Types */ export type StandardDataType = - | 'integer' - | 'number' - | 'boolean' - | 'string' - | 'object' - | 'array'; + | "integer" + | "number" + | "boolean" + | "string" + | "object" + | "array" + ; /** * Standard {@link DataType}s plus your own types/classes. @@ -40,15 +42,16 @@ export type DataType = StandardDataType | string; * Standard formats as defined in OpenAPI Specification: Data Types */ export type StandardDataFormat = - | 'int32' - | 'int64' - | 'float' - | 'double' - | 'byte' - | 'binary' - | 'date' - | 'date-time' - | 'password'; + | "int32" + | "int64" + | "float" + | "double" + | "byte" + | "binary" + | "date" + | "date-time" + | "password" + ; export type DataFormat = StandardDataFormat | string; @@ -59,7 +62,7 @@ export interface Param { name: string; value: unknown; in: ParamLocation; - style: ParamStyle; + style: ParamStyle, explode: boolean; dataType: DataType; dataFormat: DataFormat | undefined; diff --git a/webapp/src/app/api/provide-api.ts b/webapp/src/app/api/provide-api.ts index 960132f8..19c762ac 100644 --- a/webapp/src/app/api/provide-api.ts +++ b/webapp/src/app/api/provide-api.ts @@ -1,17 +1,15 @@ -import { EnvironmentProviders, makeEnvironmentProviders } from '@angular/core'; +import { EnvironmentProviders, makeEnvironmentProviders } from "@angular/core"; import { Configuration, ConfigurationParameters } from './configuration'; import { BASE_PATH } from './variables'; // Returns the service class providers, to be used in the [ApplicationConfig](https://angular.dev/api/core/ApplicationConfig). -export function provideApi( - configOrBasePath: string | ConfigurationParameters, -): EnvironmentProviders { - return makeEnvironmentProviders([ - typeof configOrBasePath === 'string' - ? { provide: BASE_PATH, useValue: configOrBasePath } - : { - provide: Configuration, - useValue: new Configuration({ ...configOrBasePath }), - }, - ]); -} +export function provideApi(configOrBasePath: string | ConfigurationParameters): EnvironmentProviders { + return makeEnvironmentProviders([ + typeof configOrBasePath === "string" + ? { provide: BASE_PATH, useValue: configOrBasePath } + : { + provide: Configuration, + useValue: new Configuration({ ...configOrBasePath }), + }, + ]); +} \ No newline at end of file diff --git a/webapp/src/app/api/variables.ts b/webapp/src/app/api/variables.ts index 2277a9cc..6fe58549 100644 --- a/webapp/src/app/api/variables.ts +++ b/webapp/src/app/api/variables.ts @@ -2,8 +2,8 @@ import { InjectionToken } from '@angular/core'; export const BASE_PATH = new InjectionToken('basePath'); export const COLLECTION_FORMATS = { - csv: ',', - tsv: ' ', - ssv: ' ', - pipes: '|', -}; + 'csv': ',', + 'tsv': ' ', + 'ssv': ' ', + 'pipes': '|' +} diff --git a/webapp/src/app/app.routes.ts b/webapp/src/app/app.routes.ts index 4ab25cfa..459f5e12 100644 --- a/webapp/src/app/app.routes.ts +++ b/webapp/src/app/app.routes.ts @@ -40,6 +40,7 @@ import { UserRole } from './api'; import { personCordisEuProjectPageResolver } from './resolvers/person-cordis-eu-project-page.resolver'; import { selectedAuthorsResolver } from './resolvers/selected-authors.resolver'; import { authorWorkClassificationPageResolver } from './resolvers/author-work-classification-page.resolver'; +import { workClassificationResolver } from './resolvers/work-classification.resolver'; export const routes: Routes = [ { path: '', @@ -166,7 +167,16 @@ export const routes: Routes = [ { path: 'persons', component: KeywordsToPersonsResultsComponent }, { path: 'projects', component: KeywordsToProjectsResultsComponent }, { path: 'patents', component: KeywordsToPatentsResultsComponent }, - { path: 'works', component: KeywordsToWorksResultsComponent }, + { + path: 'works', + component: KeywordsToWorksResultsComponent, + runGuardsAndResolvers: 'always', + resolve: { + selectedTopicsPage: selectedTopicsResolver, + selectedAuthorsPage: selectedAuthorsResolver, + selectedInstitutionsPage: selectedInstitutionsResolver, + }, + }, { path: 'news', component: KeywordsToNewsResultsComponent }, { path: 'trends', component: UniTrendParentComponent }, ], @@ -261,6 +271,7 @@ export const routes: Routes = [ ), resolve: { publication: publicationResolver, + workClassification: workClassificationResolver, }, }, { @@ -384,10 +395,11 @@ export const routes: Routes = [ ), runGuardsAndResolvers: 'always', resolve: { - selectedTopics: selectedTopicsResolver, - selectedInstitutions: selectedInstitutionsResolver, + selectedTopicsPage: selectedTopicsResolver, + selectedInstitutionsPage: selectedInstitutionsResolver, authorWorkPage: workPageResolver, - authorWorkClassificationPage: authorWorkClassificationPageResolver, + authorWorkClassificationMergePage: + authorWorkClassificationPageResolver, }, data: { resolvingFor: RESOLVING_WORK_PAGE_FOR.PERSON, @@ -510,8 +522,8 @@ export const routes: Routes = [ (mod) => mod.InstitutionPublicationsComponent, ), resolve: { - selectedAuthors: selectedAuthorsResolver, - selectedTopics: selectedTopicsResolver, + selectedAuthorsPage: selectedAuthorsResolver, + selectedTopicsPage: selectedTopicsResolver, institutionWorkPage: workPageResolver, }, data: { diff --git a/webapp/src/app/modules/institution-publications/institution-publications.component.html b/webapp/src/app/modules/institution-publications/institution-publications.component.html index 73037c00..a3c99e51 100644 --- a/webapp/src/app/modules/institution-publications/institution-publications.component.html +++ b/webapp/src/app/modules/institution-publications/institution-publications.component.html @@ -1,7 +1,7 @@
(); - selectedAuthors = input.required>(); - selectedTopics = input.required>(); + institutionWorkPage = input.required(); + selectedAuthorsPage = input.required(); + selectedTopicsPage = input.required(); total = computed(() => this.institutionWorkPage().total ?? 0); } diff --git a/webapp/src/app/modules/institution/institution.component.ts b/webapp/src/app/modules/institution/institution.component.ts index 61d0d938..3bc06ee1 100644 --- a/webapp/src/app/modules/institution/institution.component.ts +++ b/webapp/src/app/modules/institution/institution.component.ts @@ -1,4 +1,4 @@ -import { Component, OnInit } from '@angular/core'; +import { Component, OnInit, inject } from '@angular/core'; import { ActivatedRoute, RouterLink, @@ -6,9 +6,12 @@ import { RouterLinkActive, } from '@angular/router'; import { Institution } from '../../api'; +import { PatentsService } from '../../api/api/patents.service'; import { MatCardModule } from '@angular/material/card'; import { MatTabsModule } from '@angular/material/tabs'; +const PATENTS_LINK = { label: 'Patente', path: 'patents', disabled: false }; + @Component({ selector: 'app-institution', imports: [ @@ -22,6 +25,8 @@ import { MatTabsModule } from '@angular/material/tabs'; styleUrl: './institution.component.scss', }) export class InstitutionComponent implements OnInit { + private readonly patentsApi = inject(PatentsService); + institution!: Institution; links = [ @@ -40,7 +45,6 @@ export class InstitutionComponent implements OnInit { sort_direction: 'asc', }, }, - { label: 'Patente', path: 'patents', disabled: false }, ]; constructor(private readonly activatedRoute: ActivatedRoute) {} @@ -49,5 +53,19 @@ export class InstitutionComponent implements OnInit { this.activatedRoute.data.subscribe(({ institution }) => { this.institution = institution; }); + + const institutionId = this.activatedRoute.snapshot.paramMap.get('institutionId'); + if (!institutionId) return; + + // The "Patente" tab only makes sense once org_patents has been indexed for + // this institution (currently a manual, ~30-40 min-per-institution process), + // so only show it once we know there is actually data behind it. + this.patentsApi.getOrgPatentsByInstitution(institutionId, undefined, 0, 0).subscribe({ + next: (result) => { + if ((result.patent_count ?? 0) > 0) { + this.links = [...this.links, PATENTS_LINK]; + } + }, + }); } } diff --git a/webapp/src/app/modules/institutions/institutions.component.html b/webapp/src/app/modules/institutions/institutions.component.html index 26fe07c3..42df50d1 100644 --- a/webapp/src/app/modules/institutions/institutions.component.html +++ b/webapp/src/app/modules/institutions/institutions.component.html @@ -75,17 +75,19 @@ work Projekte - - verified - Patente - + @if (hasPatents(institution)) { + + verified + Patente + + } diff --git a/webapp/src/app/modules/institutions/institutions.component.ts b/webapp/src/app/modules/institutions/institutions.component.ts index 57c734df..a8735d33 100644 --- a/webapp/src/app/modules/institutions/institutions.component.ts +++ b/webapp/src/app/modules/institutions/institutions.component.ts @@ -1,5 +1,6 @@ -import { Component, computed, input } from '@angular/core'; +import { Component, computed, effect, inject, input } from '@angular/core'; import { Institution, InstitutionPage } from '../../api'; +import { PatentsService } from '../../api/api/patents.service'; import { MatButtonModule } from '@angular/material/button'; import { MatCardModule } from '@angular/material/card'; import { RouterModule } from '@angular/router'; @@ -27,6 +28,8 @@ import { FilterObserver } from '../../shared/ui/selected-filters/selected-filter styleUrl: './institutions.component.scss', }) export class InstitutionsComponent { + private readonly patentsApi = inject(PatentsService); + institutionPage = input.required(); observers: FilterObserver[] = [ @@ -44,6 +47,31 @@ export class InstitutionsComponent { elements: this.institutionPage().elements || [], })); + // The "Patente" action only makes sense once org_patents has been indexed + // for that institution (currently a manual, per-institution process), so + // it's hidden by default and only shown once a cheap count check confirms + // there is actually data behind it. + private readonly patentsAvailable = new Map(); + + constructor() { + effect(() => { + for (const institution of this.page().elements) { + const id = this.extractInstitutionId(institution); + if (!id || this.patentsAvailable.has(id)) continue; + this.patentsAvailable.set(id, false); + this.patentsApi.getOrgPatentsByInstitution(id, undefined, 0, 0).subscribe({ + next: (result) => { + this.patentsAvailable.set(id, (result.patent_count ?? 0) > 0); + }, + }); + } + }); + } + + hasPatents(institution: Institution): boolean { + return this.patentsAvailable.get(this.extractInstitutionId(institution)) ?? false; + } + sortingOptions: SelectorOption[] = [ { value: 'relevance', display_name: 'Relevanz' }, { value: 'name', display_name: 'Name' }, diff --git a/webapp/src/app/modules/keywords-search/keywords-patents/keywords-patents.component.html b/webapp/src/app/modules/keywords-search/keywords-patents/keywords-patents.component.html index e9fecdf1..7f3312ef 100644 --- a/webapp/src/app/modules/keywords-search/keywords-patents/keywords-patents.component.html +++ b/webapp/src/app/modules/keywords-search/keywords-patents/keywords-patents.component.html @@ -1,7 +1,11 @@ @if (loading()) {
-

Lade passende Patente...

+
} @else if (error()) {
@@ -11,7 +15,7 @@ } @else if (matches().length === 0) {
-

Keine passenden Patente gefunden.

+

{{ emptyMessage() }}

} @else {
diff --git a/webapp/src/app/modules/keywords-search/keywords-patents/keywords-patents.component.scss b/webapp/src/app/modules/keywords-search/keywords-patents/keywords-patents.component.scss index ae2481f3..18059791 100644 --- a/webapp/src/app/modules/keywords-search/keywords-patents/keywords-patents.component.scss +++ b/webapp/src/app/modules/keywords-search/keywords-patents/keywords-patents.component.scss @@ -3,6 +3,15 @@ color: #666; } +.fallback-notice { + margin: 0 0 12px; + padding: 10px 12px; + border-radius: 8px; + background: #f4f7fb; + color: #3d4f63; + font-size: 0.9rem; +} + .section-title { margin: 0; font-size: 1.25rem; diff --git a/webapp/src/app/modules/keywords-search/keywords-patents/keywords-patents.component.ts b/webapp/src/app/modules/keywords-search/keywords-patents/keywords-patents.component.ts index 1fe27272..42af4436 100644 --- a/webapp/src/app/modules/keywords-search/keywords-patents/keywords-patents.component.ts +++ b/webapp/src/app/modules/keywords-search/keywords-patents/keywords-patents.component.ts @@ -5,21 +5,24 @@ import { MatIconModule } from '@angular/material/icon'; import { Router } from '@angular/router'; import { PatentEntry } from '../../../api/model/patentEntry'; import { KeywordPatentMatch } from '../../../api/model/keywordPatentMatch'; +import { LoadingComponent } from '../../../shared/ui/loading/loading.component'; import { formatPatentDate, getPublicationStageLabel, } from '../../patent-detail/patent-detail.utils'; +import { KeywordPatentMappingStatus } from '../../../api'; type SourceFilter = 'all' | 'EPO' | 'USPTO'; @Component({ selector: 'app-keywords-patents', - imports: [NgTemplateOutlet, MatButtonModule, MatIconModule], + imports: [NgTemplateOutlet, MatButtonModule, MatIconModule, LoadingComponent], templateUrl: './keywords-patents.component.html', styleUrl: './keywords-patents.component.scss', }) export class KeywordsPatentsComponent { readonly matches = input([]); + readonly mappingStatus = input(null); readonly loading = input(false); readonly error = input(false); readonly showReload = input(false); @@ -33,6 +36,15 @@ export class KeywordsPatentsComponent { constructor(private readonly router: Router) {} + emptyMessage(): string { + switch (this.mappingStatus()) { + case 'search_error': + return 'Die Patentrecherche ist technisch fehlgeschlagen. Bitte später erneut versuchen.'; + default: + return 'Keine passenden Patente gefunden'; + } + } + filteredMatches(): KeywordPatentMatch[] { const filter = this.activeFilter(); const items = this.matches(); diff --git a/webapp/src/app/modules/keywords-search/patent-search.utils.ts b/webapp/src/app/modules/keywords-search/patent-search.utils.ts index 25496431..13224bb1 100644 --- a/webapp/src/app/modules/keywords-search/patent-search.utils.ts +++ b/webapp/src/app/modules/keywords-search/patent-search.utils.ts @@ -1,3 +1,4 @@ +import { KeywordPatentMappingStatus } from '../../api'; import { KeywordEntryWithTopic } from '../../api/model/keywordEntryWithTopic'; import { KeywordPatentMatch } from '../../api/model/keywordPatentMatch'; import { KeywordPatentSearchItem } from '../../api/model/keywordPatentSearchItem'; @@ -11,6 +12,12 @@ export const PATENTS_CACHE_KEY = 'keywords-patents-cache'; export interface PatentsCache { keywords: string[]; matches: KeywordPatentMatch[]; + mappingStatus?: KeywordPatentMappingStatus | null; +} + +export interface PatentsCacheResult { + matches: KeywordPatentMatch[]; + mappingStatus: KeywordPatentMappingStatus | null; } export function buildPatentSearchItems( @@ -58,14 +65,17 @@ export function buildPatentSearchItemsFromPayload( export function readPatentsCache( keywords: string[], -): KeywordPatentMatch[] | null { +): PatentsCacheResult | null { const raw = sessionStorage.getItem(PATENTS_CACHE_KEY); if (!raw) return null; try { const cache = JSON.parse(raw) as PatentsCache; if (!sameKeywordSet(cache.keywords, keywords)) return null; - return cache.matches ?? []; + return { + matches: cache.matches ?? [], + mappingStatus: cache.mappingStatus ?? null, + }; } catch { sessionStorage.removeItem(PATENTS_CACHE_KEY); return null; @@ -75,9 +85,10 @@ export function readPatentsCache( export function writePatentsCache( keywords: string[], matches: KeywordPatentMatch[], + mappingStatus: KeywordPatentMappingStatus | null = null, ): void { try { - const cache: PatentsCache = { keywords, matches }; + const cache: PatentsCache = { keywords, matches, mappingStatus }; sessionStorage.setItem(PATENTS_CACHE_KEY, JSON.stringify(cache)); } catch (error) { console.error('Failed to cache patent results:', error); diff --git a/webapp/src/app/modules/keywords-search/search-results/patents-results/patents-results.component.html b/webapp/src/app/modules/keywords-search/search-results/patents-results/patents-results.component.html index 87d668f6..3e0cb344 100644 --- a/webapp/src/app/modules/keywords-search/search-results/patents-results/patents-results.component.html +++ b/webapp/src/app/modules/keywords-search/search-results/patents-results/patents-results.component.html @@ -22,6 +22,7 @@
([]); + readonly mappingStatus = signal(null); readonly loadingPatents = signal(false); readonly patentsError = signal(false); @@ -91,7 +93,7 @@ export class KeywordsToPatentsResultsComponent implements OnInit { ngOnInit(): void { const cached = readPatentsCache(this.state.keywords()); if (cached) { - this.setPatentMatches(cached); + this.setPatentMatches(cached.matches, cached.mappingStatus); return; } @@ -119,7 +121,7 @@ export class KeywordsToPatentsResultsComponent implements OnInit { private loadMatchingPatents(): void { const keywords = buildPatentSearchItemsFromPayload(this.state.payload()); if (keywords.length === 0) { - this.setPatentMatches([]); + this.setPatentMatches([], 'no_mapping'); return; } @@ -128,22 +130,33 @@ export class KeywordsToPatentsResultsComponent implements OnInit { this.keywordsService.getPatentsByKeywords({ keywords }).subscribe({ next: (response: PatentsByKeywordsResponse) => { - this.setPatentMatches(response.patents ?? []); + this.setPatentMatches( + response.patents ?? [], + response.mapping_status ?? null, + ); this.loadingPatents.set(false); }, error: (error: unknown) => { console.error('Patent search failed:', error); - this.setPatentMatches([]); + this.setPatentMatches([], null); this.patentsError.set(true); this.loadingPatents.set(false); }, }); } - private setPatentMatches(matches: KeywordPatentMatch[]): void { + private setPatentMatches( + matches: KeywordPatentMatch[], + mappingStatus: KeywordPatentMappingStatus | null = null, + ): void { this.patentMatchesBase.set(matches); + this.mappingStatus.set(mappingStatus); this.updateDisplayedMatches(); - writePatentsCache(this.state.keywords(), this.patentMatchesBase()); + writePatentsCache( + this.state.keywords(), + this.patentMatchesBase(), + mappingStatus, + ); } private updateDisplayedMatches(): void { diff --git a/webapp/src/app/modules/keywords-search/search-results/works-results/works-results.component.html b/webapp/src/app/modules/keywords-search/search-results/works-results/works-results.component.html index 4d0a78cf..0edb91db 100644 --- a/webapp/src/app/modules/keywords-search/search-results/works-results/works-results.component.html +++ b/webapp/src/app/modules/keywords-search/search-results/works-results/works-results.component.html @@ -1,8 +1,8 @@
@if (loading()) { diff --git a/webapp/src/app/modules/keywords-search/search-results/works-results/works-results.component.ts b/webapp/src/app/modules/keywords-search/search-results/works-results/works-results.component.ts index a295d423..078e73c5 100644 --- a/webapp/src/app/modules/keywords-search/search-results/works-results/works-results.component.ts +++ b/webapp/src/app/modules/keywords-search/search-results/works-results/works-results.component.ts @@ -5,6 +5,7 @@ import { inject, signal, computed, + input, } from '@angular/core'; import { ActivatedRoute, ParamMap, Router } from '@angular/router'; import { takeUntilDestroyed, toSignal } from '@angular/core/rxjs-interop'; @@ -17,14 +18,27 @@ import { catchError, finalize, of, switchMap } from 'rxjs'; import { PublicationTableComponent } from '../../../../shared/ui/publication-table/publication-table.component'; import { LoadingComponent } from '../../../../shared/ui/loading/loading.component'; -import { InseWorksV2ModelWorkPage as WorkPage } from '../../../../api/model/inseWorksV2ModelWorkPage'; +import { WorkPageV2 } from '../../../../api/model/workPageV2'; import { PaginationService } from '../../../../shared/services/pagination.service'; import { QueryParamPaginatorComponent } from '../../../../shared/ui/query-param-paginator/query-param-paginator.component'; -import { Author, Institution, Topic, WorkTopic } from '../../../../api'; +import { + Author, + AuthorPage, + Institution, + InstitutionPageV2, + Topic, + TopicPageV2, + WorkTopic, +} from '../../../../api'; import { SortDirection, WorkSortBy, WorksV2Service } from '../../../../api'; import { SearchResultsStateService } from '../search-results-state.service'; -const EMPTY_WORK_PAGE: WorkPage = { elements: [], total: 0, page: 0, size: 10 }; +const EMPTY_WORK_PAGE: WorkPageV2 = { + elements: [], + total: 0, + page: 0, + size: 10, +}; @Component({ selector: 'app-works-results', @@ -78,18 +92,6 @@ export class KeywordsToWorksResultsComponent implements OnInit { elements = computed(() => this.works()?.elements ?? []); fuzzySearch = computed(() => this.queryParamMap().get('fuzzy') === 'true'); - // --- Data loading --- - // Driven declaratively off route.queryParamMap via switchMap, instead of - // a manual subscribe-per-change. This fixes two real bugs from the - // original version: - // 1. `loading` could get stuck `true` forever, because it was only ever - // reset from the `complete` callback — which RxJS never calls after - // an `error`. - // 2. Rapid filter changes opened a new subscription without cancelling - // the previous in-flight request, so a slower response for an older - // filter combination could arrive after a newer one and silently - // overwrite the correct results. `switchMap` cancels the stale - // request automatically. readonly works = toSignal( this.route.queryParamMap.pipe( switchMap((params) => this.fetchWorks(params)), @@ -131,53 +133,14 @@ export class KeywordsToWorksResultsComponent implements OnInit { }); selectedAuthors = computed(() => { const byId = this.authorsFromWorks(); - console.log(byId); return this.selectedAuthorIdsQueryParams() .map((id) => byId.get(id)) .filter((author): author is Author => !!author); }); - selectedInstitutions = computed(() => { - const byId = this.institutionsFromWorks(); - return this.selectedInstitutionIdsQueryParams() - .map((id) => byId.get(id)) - .filter((inst): inst is Institution => !!inst); - - // TODO(institution-fallback): if an institution id from the URL isn't - // present in the currently loaded page's works (e.g. deep link to page - // 2 of a differently-sorted result, or a stale/removed id), it's - // silently dropped here and the filter chip/dropdown will show the - // raw id instead of a name. If that turns out to happen in practice, - // add a real by-id InstitutionsService lookup as a secondary fallback - // for just the unresolved ids, the same way `works` topics could also - // be backed by a topics-by-id call if needed. - }); - - selectedTopics = computed(() => { - const stateTopics = this.state.topics(); - const stateTopicIds = new Set(stateTopics.map((t) => t.id)); - const fromWorks = this.topicsFromWorks(); - - const extra = this.selectedTopicIdsQueryParams() - .filter((id) => !stateTopicIds.has(id)) - .map((id) => fromWorks.get(id)) - .filter((t): t is WorkTopic => !!t) - .map((t) => ({ id: t.id, display_name: t.display_name }) as Topic); - - return [...stateTopics, ...extra]; - }); - - // TODO(institutions-chip): PublicationFilterComponent.observers has no - // 'institutions' entry (only search/types/years/languages/authors/topics), - // so the institution filter chip won't render via - // 's internal , even - // though [showInstitutionFilter] exists as an input and we now pass - // resolved [selectedInstitutions] in above. Fix this upstream in - // PublicationFilterComponent.observers (add an 'institutions' entry - // using its own selectedInstitutions() input for the label) rather than - // patching around it here — person-publications.component doesn't work - // around it locally either, implying this is the intended single point - // of the fix. + selectedInstitutionsPage = input.required(); + selectedTopicsPage = input.required(); + selectedAuthorsPage = input.required(); ngOnInit(): void {} diff --git a/webapp/src/app/modules/patent-detail/patent-detail.component.ts b/webapp/src/app/modules/patent-detail/patent-detail.component.ts index 08af8d7d..18816a39 100644 --- a/webapp/src/app/modules/patent-detail/patent-detail.component.ts +++ b/webapp/src/app/modules/patent-detail/patent-detail.component.ts @@ -11,7 +11,10 @@ import { PatentsService } from '../../api/api/patents.service'; import { PatentEntry } from '../../api/model/patentEntry'; import { OpenAlexTopicTag } from '../../api/model/openAlexTopicTag'; import { TopicChipComponent } from '../../shared/ui/topic-chip/topic-chip.component'; -import { topicHierarchyColor } from '../../resolvers/utils/topic-colors'; +import { + classificationSectionColor, + topicHierarchyColor, +} from '../../resolvers/utils/topic-colors'; import { ClassificationCard, ClassificationSystem, @@ -105,7 +108,7 @@ export class PatentDetailComponent implements OnInit { } sectionColor(card: ClassificationCard): string { - return topicHierarchyColor({ field_name: card.sectionName }); + return classificationSectionColor(card.sectionName ?? card.symbols[0]); } toggleClassificationExpanded(key: string): void { diff --git a/webapp/src/app/modules/patents/patents.component.ts b/webapp/src/app/modules/patents/patents.component.ts index d1c99016..bbf90d41 100644 --- a/webapp/src/app/modules/patents/patents.component.ts +++ b/webapp/src/app/modules/patents/patents.component.ts @@ -17,7 +17,10 @@ import { IpcClassification } from '../../api'; import { OpenAlexTopicTag } from '../../api/model/openAlexTopicTag'; import { TopicChipComponent } from '../../shared/ui/topic-chip/topic-chip.component'; import { LoadingComponent } from '../../shared/ui/loading/loading.component'; -import { topicHierarchyColor } from '../../resolvers/utils/topic-colors'; +import { + classificationSectionColor, + topicHierarchyColor, +} from '../../resolvers/utils/topic-colors'; type SourceFilter = 'all' | 'EPO' | 'USPTO'; @@ -404,7 +407,7 @@ export class PatentsComponent implements OnInit { } sectionColor(card: ClassificationCard): string { - return topicHierarchyColor({ field_name: card.sectionName }); + return classificationSectionColor(card.sectionName ?? card.symbols[0]); } private getClassificationLevel(entry: IpcClassification): { diff --git a/webapp/src/app/modules/person-funding/person-funding.component.html b/webapp/src/app/modules/person-funding/person-funding.component.html index 119b3a5a..2051dd59 100644 --- a/webapp/src/app/modules/person-funding/person-funding.component.html +++ b/webapp/src/app/modules/person-funding/person-funding.component.html @@ -307,37 +307,17 @@
-
+
+ +