Compare commits
125
Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
014364ec03 | ||
|
|
9cb01cab45 | ||
|
|
fc30865f34 | ||
|
|
b2a8af532d | ||
|
|
bee9b6e8fd | ||
|
|
cbd2e902a7 | ||
|
|
2cb6d1f660 | ||
|
|
ae2230ff0e | ||
|
|
12914208cd | ||
|
|
abb11077de | ||
|
|
ef1a5ad7a1 | ||
|
|
ed919832d8 | ||
|
|
ef2ea46882 | ||
|
|
da9516331e | ||
|
|
bd581e6004 | ||
|
|
e37f636236 | ||
|
|
0ec47e42e4 | ||
|
|
1369a2bf29 | ||
|
|
e0704bc8a5 | ||
|
|
d8041751c5 | ||
|
|
87b283ccfb | ||
|
|
16d44a0b88 | ||
|
|
07f8e8bcca | ||
|
|
cbfa60ae46 | ||
|
|
89ce894066 | ||
|
|
66487c20e7 | ||
|
|
08bc87e764 | ||
|
|
22afd0fbb5 | ||
|
|
5633b412d4 | ||
|
|
bd030ccb9f | ||
|
|
41037efd6f | ||
|
|
81c4094708 | ||
|
|
6382987990 | ||
|
|
3276bf46a7 | ||
|
|
da1a5b732d | ||
|
|
5702223716 | ||
|
|
21da33be11 | ||
|
|
92e421a61c | ||
|
|
15f55af4c4 | ||
|
|
8b150a81a0 | ||
|
|
91efbdffeb | ||
|
|
934c49bf49 | ||
|
|
70d6b3d698 | ||
|
|
e6e9628837 | ||
|
|
0dd2a5743d | ||
|
|
f8678af87e | ||
|
|
5e7f968808 | ||
|
|
e1b3318e68 | ||
|
|
4d8a7405ca | ||
|
|
f1a6c32e0c | ||
|
|
cf5a3e7d3d | ||
|
|
89f45082fb | ||
|
|
0ad6ac70ff | ||
|
|
e8e0decc6c | ||
|
|
57aaf77162 | ||
|
|
a3eebedb02 | ||
|
|
f8e5cd90a5 | ||
|
|
07ce24143b | ||
|
|
3d092b02f3 | ||
|
|
bf5e065520 | ||
|
|
08178e74d2 | ||
|
|
c66fcff906 | ||
|
|
b0dd0e509d | ||
|
|
719da6e921 | ||
|
|
e4b3d0a9a9 | ||
|
|
c0e231a32b | ||
|
|
af9f9a25da | ||
|
|
0a465bc7e1 | ||
|
|
aec735e09e | ||
|
|
9ce6d5f26e | ||
|
|
f4b4fb0562 | ||
|
|
aa22fad67d | ||
|
|
548bb4ce70 | ||
|
|
b6871b3618 | ||
|
|
fe5e816551 | ||
|
|
20d2a281b1 | ||
|
|
e2ae0c660a | ||
|
|
9e8ae16597 | ||
|
|
e5284a79c9 | ||
|
|
79dad5dfb0 | ||
|
|
a511c16fb1 | ||
|
|
98a1214a4d | ||
|
|
be459c45cf | ||
|
|
328ef2938c | ||
|
|
21f3f49078 | ||
|
|
882ad3b8cf | ||
|
|
d8b7d8bc2e | ||
|
|
c1692535a5 | ||
|
|
af0e326747 | ||
|
|
6cdaa9738a | ||
|
|
1e5d0c4517 | ||
|
|
127f5ca287 | ||
|
|
f51b775fd9 | ||
|
|
0015b92591 | ||
|
|
37e1f1811f | ||
|
|
deb6448739 | ||
|
|
bfb3224684 | ||
|
|
aed1f33935 | ||
|
|
33192efa33 | ||
|
|
d48435b948 | ||
|
|
daa4f79ea0 | ||
|
|
567b5ecd4f | ||
|
|
b21d8d3e88 | ||
|
|
727c3fde67 | ||
|
|
de880fb9f0 | ||
|
|
c054cf99fe | ||
|
|
98a742f024 | ||
|
|
bb791138cd | ||
|
|
0b6a74a8e3 | ||
|
|
da59e8137f | ||
|
|
103b6180d0 | ||
|
|
6edca93c1c | ||
|
|
a7548d59c0 | ||
|
|
8b1f7d6eb3 | ||
|
|
ff3ac03520 | ||
|
|
e51d3095bc | ||
|
|
d19003d531 | ||
|
|
6d5dd88e50 | ||
|
|
de70973296 | ||
|
|
2a5f104739 | ||
|
|
71bd10b303 | ||
|
|
97b7fe6a6f | ||
|
|
eb84d3014f | ||
|
|
2bdee21169 | ||
|
|
a278ad300f |
+3
-1
@@ -19,4 +19,6 @@ angular-app/.angular
|
||||
# Ignore sentence-transformer local model cache
|
||||
service/sentence_transformer/models/
|
||||
|
||||
llm_evaluations/bio_generation/.venv
|
||||
llm_evaluations/bio_generation/.venv
|
||||
|
||||
.devcontainer
|
||||
|
||||
@@ -88,6 +88,25 @@ class Organization(Durable, table=True):
|
||||
accounts: list["Account"] = Relationship(back_populates="organization")
|
||||
|
||||
|
||||
class OrganizationInstitution(SQLModel, table=True):
|
||||
__tablename__ = "organization_institution"
|
||||
__table_args__ = (
|
||||
UniqueConstraint(
|
||||
"organization_id",
|
||||
"position",
|
||||
name="uq_organization_institution_position",
|
||||
),
|
||||
)
|
||||
|
||||
organization_id: uuid.UUID = Field(
|
||||
foreign_key="organization.id",
|
||||
primary_key=True,
|
||||
index=True,
|
||||
)
|
||||
openalex_institution_id: str = Field(primary_key=True, index=True)
|
||||
position: int = Field(nullable=False)
|
||||
|
||||
|
||||
class Account(Durable, table=True):
|
||||
@model_validator(mode="before")
|
||||
@classmethod
|
||||
|
||||
@@ -22,6 +22,7 @@ from inse.auth.model import (
|
||||
IdTokenMetadata,
|
||||
LoginResponse,
|
||||
Organization,
|
||||
OrganizationInstitution,
|
||||
OtkResponse,
|
||||
RefreshTokenMetadata,
|
||||
Secret,
|
||||
@@ -98,9 +99,12 @@ def create_predefined_accounts(session: Session, file_path: str):
|
||||
with open(file_path, "r") as file:
|
||||
data: dict[str, Any] = json.loads(file.read())
|
||||
for organization_data in data.get("organizations", []):
|
||||
organization_id = organization_data.get("id")
|
||||
if organization_id is not None:
|
||||
organization_id = uuid.UUID(organization_id)
|
||||
organization_id_value = organization_data.get("id")
|
||||
organization_id = (
|
||||
uuid.UUID(organization_id_value)
|
||||
if organization_id_value is not None
|
||||
else uuid.uuid4()
|
||||
)
|
||||
organization_name = organization_data["name"]
|
||||
openalex_institution_id = organization_data.get(
|
||||
"openalex_institution_id"
|
||||
@@ -113,6 +117,14 @@ def create_predefined_accounts(session: Session, file_path: str):
|
||||
openalex_institution_id=openalex_institution_id,
|
||||
)
|
||||
session.add(organization)
|
||||
if openalex_institution_id:
|
||||
session.add(
|
||||
OrganizationInstitution(
|
||||
organization_id=organization.id,
|
||||
openalex_institution_id=openalex_institution_id,
|
||||
position=0,
|
||||
)
|
||||
)
|
||||
for account_data in data.get("accounts", []):
|
||||
organization_id = uuid.UUID(account_data["organization_id"])
|
||||
roles = normalize_roles(
|
||||
|
||||
@@ -0,0 +1,142 @@
|
||||
import hashlib
|
||||
from collections import defaultdict
|
||||
from typing import Any
|
||||
|
||||
from inse.institutions.institutions_search_client import InstitutionsSearchClient
|
||||
from inse.integrations import elasticsearch
|
||||
from inse.model import ESCluster, ESIndex
|
||||
from inse.projects import service as projects_service
|
||||
|
||||
from .model import BundProjectTopics, DfgProjectKeyword, DfgProjectTopic
|
||||
from .common import (
|
||||
dashboard_period as _dashboard_period,
|
||||
normalize_institution_id as _normalize_institution_id,
|
||||
raw_institution_id as _raw_institution_id,
|
||||
)
|
||||
|
||||
|
||||
async def get_dashboard_bund_topics(
|
||||
institution_id: str,
|
||||
organization_name: str,
|
||||
from_year: int | None = None,
|
||||
to_year: int | None = None,
|
||||
) -> BundProjectTopics:
|
||||
normalized_id = _normalize_institution_id(institution_id)
|
||||
period = _dashboard_period(from_year, to_year)
|
||||
page_size = 1000
|
||||
page_number = 0
|
||||
project_ids: set[str] = set()
|
||||
|
||||
while True:
|
||||
projects = await projects_service.search_bund_projects_with_filters(
|
||||
institutions_search_client=InstitutionsSearchClient(),
|
||||
executing_agency=None,
|
||||
raw_oa_institution_id=_raw_institution_id(normalized_id),
|
||||
title=None,
|
||||
keywords=None,
|
||||
funding_arts=None,
|
||||
topic_ids=None,
|
||||
filter_topic_ids=None,
|
||||
funding_start_years=None,
|
||||
funding_end_years=None,
|
||||
active_from_year=period[0],
|
||||
active_to_year=period[1],
|
||||
countries=None,
|
||||
page=page_number,
|
||||
size=page_size,
|
||||
sort_by="id",
|
||||
sort_direction="asc",
|
||||
fuzzy=False,
|
||||
)
|
||||
project_ids.update(
|
||||
project.funding_code
|
||||
for project in projects.elements
|
||||
if project.funding_code
|
||||
)
|
||||
if len(project_ids) >= projects.total or not projects.elements:
|
||||
break
|
||||
page_number += 1
|
||||
|
||||
topics: dict[str, dict[str, Any]] = {}
|
||||
matched_project_ids: set[str] = set()
|
||||
if project_ids:
|
||||
mapping_project_ids = sorted(
|
||||
hashlib.sha256(project_id.encode("utf-8")).hexdigest()
|
||||
for project_id in project_ids
|
||||
)
|
||||
async for hit in elasticsearch.scan(
|
||||
index=str(ESIndex.PROJECTS_BUND_TOPICS),
|
||||
query={"terms": {"project_id": mapping_project_ids}},
|
||||
source=["project_id", "keyword", "topic_matches"],
|
||||
page_size=1000,
|
||||
cluster=ESCluster.INSE,
|
||||
):
|
||||
source = hit.get("_source", {})
|
||||
project_id = str(source.get("project_id") or "")
|
||||
if not project_id:
|
||||
continue
|
||||
keyword = str(source.get("keyword") or "").strip()
|
||||
matched_project_ids.add(project_id)
|
||||
for match in source.get("topic_matches", []):
|
||||
topic_id = str(match.get("topic_id") or "")
|
||||
if not topic_id:
|
||||
continue
|
||||
topic = topics.setdefault(
|
||||
topic_id,
|
||||
{
|
||||
"id": topic_id,
|
||||
"name": str(match.get("topic_display_name") or topic_id),
|
||||
"subfield": match.get("subfield"),
|
||||
"field": match.get("field"),
|
||||
"domain": match.get("domain"),
|
||||
"project_ids": set(),
|
||||
"keywords": {},
|
||||
},
|
||||
)
|
||||
topic["project_ids"].add(project_id)
|
||||
if keyword:
|
||||
topic["keywords"].setdefault(keyword, set()).add(project_id)
|
||||
|
||||
field_project_ids: dict[str, set[str]] = defaultdict(set)
|
||||
subfield_project_ids: dict[tuple[str, str], set[str]] = defaultdict(set)
|
||||
for topic in topics.values():
|
||||
field_name = str(topic["field"] or "")
|
||||
subfield_name = str(topic["subfield"] or "")
|
||||
field_project_ids[field_name].update(topic["project_ids"])
|
||||
subfield_project_ids[(field_name, subfield_name)].update(topic["project_ids"])
|
||||
|
||||
topic_list = [
|
||||
DfgProjectTopic(
|
||||
id=topic["id"],
|
||||
name=topic["name"],
|
||||
subfield=topic["subfield"],
|
||||
field=topic["field"],
|
||||
domain=topic["domain"],
|
||||
project_count=len(topic["project_ids"]),
|
||||
field_project_count=len(field_project_ids[str(topic["field"] or "")]),
|
||||
subfield_project_count=len(
|
||||
subfield_project_ids[
|
||||
(str(topic["field"] or ""), str(topic["subfield"] or ""))
|
||||
]
|
||||
),
|
||||
keywords=sorted(
|
||||
[
|
||||
DfgProjectKeyword(
|
||||
name=keyword,
|
||||
project_count=len(keyword_project_ids),
|
||||
)
|
||||
for keyword, keyword_project_ids in topic["keywords"].items()
|
||||
],
|
||||
key=lambda entry: (-entry.project_count, entry.name),
|
||||
),
|
||||
)
|
||||
for topic in topics.values()
|
||||
]
|
||||
topic_list.sort(key=lambda topic: (-topic.project_count, topic.name, topic.id))
|
||||
return BundProjectTopics(
|
||||
institution_id=normalized_id,
|
||||
organization_name=organization_name,
|
||||
project_count=len(project_ids),
|
||||
matched_project_count=len(matched_project_ids),
|
||||
topics=topic_list,
|
||||
)
|
||||
@@ -0,0 +1,92 @@
|
||||
from typing import Any, Literal
|
||||
|
||||
from fastapi import HTTPException, status
|
||||
|
||||
DashboardPeriod = tuple[int | None, int | None]
|
||||
|
||||
|
||||
def dashboard_period(
|
||||
from_year: int | None = None,
|
||||
to_year: int | None = None,
|
||||
) -> DashboardPeriod:
|
||||
if from_year is not None and to_year is not None and from_year > to_year:
|
||||
raise HTTPException(
|
||||
status_code=status.HTTP_422_UNPROCESSABLE_ENTITY,
|
||||
detail="from_year must be less than or equal to to_year.",
|
||||
)
|
||||
return from_year, to_year
|
||||
|
||||
|
||||
def project_overlap_filter(
|
||||
start_field: str,
|
||||
end_field: str,
|
||||
period: DashboardPeriod,
|
||||
*,
|
||||
missing_end_is_ongoing: bool = False,
|
||||
) -> dict[str, Any] | None:
|
||||
from_year, to_year = period
|
||||
filters: list[dict[str, Any]] = []
|
||||
if to_year is not None:
|
||||
filters.append({"range": {start_field: {"lte": to_year}}})
|
||||
if from_year is not None:
|
||||
end_filter: dict[str, Any] = {"range": {end_field: {"gte": from_year}}}
|
||||
if missing_end_is_ongoing:
|
||||
end_filter = {
|
||||
"bool": {
|
||||
"should": [
|
||||
end_filter,
|
||||
{"bool": {"must_not": {"exists": {"field": end_field}}}},
|
||||
],
|
||||
"minimum_should_match": 1,
|
||||
}
|
||||
}
|
||||
filters.append(end_filter)
|
||||
return {"bool": {"filter": filters}} if filters else None
|
||||
|
||||
|
||||
def project_boundary_year_filter(
|
||||
start_field: str,
|
||||
end_field: str,
|
||||
period: DashboardPeriod,
|
||||
date_format: Literal["iso", "de", "year"],
|
||||
) -> dict[str, Any] | None:
|
||||
from_year, to_year = period
|
||||
filters: list[dict[str, Any]] = []
|
||||
if to_year is not None:
|
||||
if date_format == "year":
|
||||
filters.append({"range": {start_field: {"lte": to_year}}})
|
||||
else:
|
||||
last_day = (
|
||||
f"{to_year}-12-31" if date_format == "iso" else f"31.12.{to_year}"
|
||||
)
|
||||
filters.append({"range": {start_field: {"lte": last_day}}})
|
||||
if from_year is not None:
|
||||
if date_format == "year":
|
||||
filters.append({"range": {end_field: {"gte": from_year}}})
|
||||
else:
|
||||
first_day = (
|
||||
f"{from_year}-01-01" if date_format == "iso" else f"01.01.{from_year}"
|
||||
)
|
||||
filters.append({"range": {end_field: {"gte": first_day}}})
|
||||
return {"bool": {"filter": filters}} if filters else None
|
||||
|
||||
|
||||
def normalize_institution_id(value: str) -> str:
|
||||
return (
|
||||
value
|
||||
if value.startswith("https://openalex.org/")
|
||||
else f"https://openalex.org/{value}"
|
||||
)
|
||||
|
||||
|
||||
def raw_institution_id(value: str) -> str:
|
||||
return normalize_institution_id(value).removeprefix("https://openalex.org/")
|
||||
|
||||
|
||||
def institution_works_query(institution_id: str) -> dict[str, Any]:
|
||||
return {
|
||||
"nested": {
|
||||
"path": "authorships.institutions",
|
||||
"query": {"term": {"authorships.institutions.id": institution_id}},
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,103 @@
|
||||
from collections import defaultdict
|
||||
from typing import Any
|
||||
|
||||
from inse.integrations import elasticsearch
|
||||
from inse.model import ESCluster, ESIndex
|
||||
|
||||
from .model import DfgProjectKeyword, DfgProjectTopic, DfgProjectTopics
|
||||
from .common import normalize_institution_id as _normalize_institution_id
|
||||
from .project_ids_service import _get_dfg_project_ids_from_projects_service
|
||||
|
||||
|
||||
async def get_dashboard_dfg_topics(
|
||||
institution_id: str,
|
||||
organization_name: str,
|
||||
from_year: int | None = None,
|
||||
to_year: int | None = None,
|
||||
) -> DfgProjectTopics:
|
||||
normalized_id = _normalize_institution_id(institution_id)
|
||||
project_ids = await _get_dfg_project_ids_from_projects_service(
|
||||
normalized_id,
|
||||
from_year=from_year,
|
||||
to_year=to_year,
|
||||
)
|
||||
topics: dict[str, dict[str, Any]] = {}
|
||||
matched_project_ids: set[str] = set()
|
||||
|
||||
if project_ids:
|
||||
async for hit in elasticsearch.scan(
|
||||
index=str(ESIndex.PROJECTS_DFG_OPENALEX_TOPICS),
|
||||
query={"terms": {"project_id": project_ids}},
|
||||
source=["project_id", "keyword", "topic_matches"],
|
||||
page_size=1000,
|
||||
cluster=ESCluster.INSE,
|
||||
):
|
||||
source = hit.get("_source", {})
|
||||
project_id = str(source.get("project_id") or "")
|
||||
if not project_id:
|
||||
continue
|
||||
keyword = str(source.get("keyword") or "").strip()
|
||||
matched_project_ids.add(project_id)
|
||||
for match in source.get("topic_matches", []):
|
||||
topic_id = str(match.get("topic_id") or "")
|
||||
if not topic_id:
|
||||
continue
|
||||
topic = topics.setdefault(
|
||||
topic_id,
|
||||
{
|
||||
"id": topic_id,
|
||||
"name": str(match.get("topic_display_name") or topic_id),
|
||||
"subfield": match.get("subfield"),
|
||||
"field": match.get("field"),
|
||||
"domain": match.get("domain"),
|
||||
"project_ids": set(),
|
||||
"keywords": {},
|
||||
},
|
||||
)
|
||||
topic["project_ids"].add(project_id)
|
||||
if keyword:
|
||||
topic["keywords"].setdefault(keyword, set()).add(project_id)
|
||||
|
||||
field_project_ids: dict[str, set[str]] = defaultdict(set)
|
||||
subfield_project_ids: dict[tuple[str, str], set[str]] = defaultdict(set)
|
||||
for topic in topics.values():
|
||||
field_name = str(topic["field"] or "")
|
||||
subfield_name = str(topic["subfield"] or "")
|
||||
field_project_ids[field_name].update(topic["project_ids"])
|
||||
subfield_project_ids[(field_name, subfield_name)].update(topic["project_ids"])
|
||||
|
||||
topic_list = [
|
||||
DfgProjectTopic(
|
||||
id=topic["id"],
|
||||
name=topic["name"],
|
||||
subfield=topic["subfield"],
|
||||
field=topic["field"],
|
||||
domain=topic["domain"],
|
||||
project_count=len(topic["project_ids"]),
|
||||
field_project_count=len(field_project_ids[str(topic["field"] or "")]),
|
||||
subfield_project_count=len(
|
||||
subfield_project_ids[
|
||||
(str(topic["field"] or ""), str(topic["subfield"] or ""))
|
||||
]
|
||||
),
|
||||
keywords=sorted(
|
||||
[
|
||||
DfgProjectKeyword(
|
||||
name=keyword,
|
||||
project_count=len(keyword_project_ids),
|
||||
)
|
||||
for keyword, keyword_project_ids in topic["keywords"].items()
|
||||
],
|
||||
key=lambda entry: (-entry.project_count, entry.name),
|
||||
),
|
||||
)
|
||||
for topic in topics.values()
|
||||
]
|
||||
topic_list.sort(key=lambda topic: (-topic.project_count, topic.name, topic.id))
|
||||
return DfgProjectTopics(
|
||||
institution_id=normalized_id,
|
||||
organization_name=organization_name,
|
||||
project_count=len(project_ids),
|
||||
matched_project_count=len(matched_project_ids),
|
||||
topics=topic_list,
|
||||
)
|
||||
@@ -0,0 +1,109 @@
|
||||
from collections import defaultdict
|
||||
from typing import Any
|
||||
|
||||
from inse.integrations import elasticsearch
|
||||
from inse.model import ESCluster, ESIndex
|
||||
|
||||
from .model import DfgProjectKeyword, DfgProjectTopic, EuProjectTopics
|
||||
from .common import normalize_institution_id as _normalize_institution_id
|
||||
from .project_ids_service import _get_eu_project_ids_from_projects_service
|
||||
|
||||
|
||||
async def get_dashboard_eu_topics(
|
||||
institution_id: str,
|
||||
organization_name: str,
|
||||
from_year: int | None = None,
|
||||
to_year: int | None = None,
|
||||
) -> EuProjectTopics:
|
||||
normalized_id = _normalize_institution_id(institution_id)
|
||||
project_ids = await _get_eu_project_ids_from_projects_service(
|
||||
normalized_id,
|
||||
from_year=from_year,
|
||||
to_year=to_year,
|
||||
)
|
||||
topics: dict[str, dict[str, Any]] = {}
|
||||
matched_project_ids: set[str] = set()
|
||||
|
||||
if project_ids:
|
||||
mapping_indices = (
|
||||
ESIndex.PROJECTS_CORDIS_EU_FP7_TOPICS_MAPPING,
|
||||
ESIndex.PROJECTS_CORDIS_EU_H2020_TOPICS,
|
||||
ESIndex.PROJECTS_CORDIS_EU_HEUROPE_TOPICS,
|
||||
)
|
||||
for mapping_index in mapping_indices:
|
||||
async for hit in elasticsearch.scan(
|
||||
index=str(mapping_index),
|
||||
query={"terms": {"project_id": project_ids}},
|
||||
source=["project_id", "keyword", "topic_matches"],
|
||||
page_size=1000,
|
||||
cluster=ESCluster.INSE,
|
||||
):
|
||||
source = hit.get("_source", {})
|
||||
project_id = str(source.get("project_id") or "")
|
||||
if not project_id:
|
||||
continue
|
||||
keyword = str(source.get("keyword") or "").strip()
|
||||
matched_project_ids.add(project_id)
|
||||
for match in source.get("topic_matches", []):
|
||||
topic_id = str(match.get("topic_id") or "")
|
||||
if not topic_id:
|
||||
continue
|
||||
topic = topics.setdefault(
|
||||
topic_id,
|
||||
{
|
||||
"id": topic_id,
|
||||
"name": str(match.get("topic_display_name") or topic_id),
|
||||
"subfield": match.get("subfield"),
|
||||
"field": match.get("field"),
|
||||
"domain": match.get("domain"),
|
||||
"project_ids": set(),
|
||||
"keywords": {},
|
||||
},
|
||||
)
|
||||
topic["project_ids"].add(project_id)
|
||||
if keyword:
|
||||
topic["keywords"].setdefault(keyword, set()).add(project_id)
|
||||
|
||||
field_project_ids: dict[str, set[str]] = defaultdict(set)
|
||||
subfield_project_ids: dict[tuple[str, str], set[str]] = defaultdict(set)
|
||||
for topic in topics.values():
|
||||
field_name = str(topic["field"] or "")
|
||||
subfield_name = str(topic["subfield"] or "")
|
||||
field_project_ids[field_name].update(topic["project_ids"])
|
||||
subfield_project_ids[(field_name, subfield_name)].update(topic["project_ids"])
|
||||
|
||||
topic_list = [
|
||||
DfgProjectTopic(
|
||||
id=topic["id"],
|
||||
name=topic["name"],
|
||||
subfield=topic["subfield"],
|
||||
field=topic["field"],
|
||||
domain=topic["domain"],
|
||||
project_count=len(topic["project_ids"]),
|
||||
field_project_count=len(field_project_ids[str(topic["field"] or "")]),
|
||||
subfield_project_count=len(
|
||||
subfield_project_ids[
|
||||
(str(topic["field"] or ""), str(topic["subfield"] or ""))
|
||||
]
|
||||
),
|
||||
keywords=sorted(
|
||||
[
|
||||
DfgProjectKeyword(
|
||||
name=keyword,
|
||||
project_count=len(keyword_project_ids),
|
||||
)
|
||||
for keyword, keyword_project_ids in topic["keywords"].items()
|
||||
],
|
||||
key=lambda entry: (-entry.project_count, entry.name),
|
||||
),
|
||||
)
|
||||
for topic in topics.values()
|
||||
]
|
||||
topic_list.sort(key=lambda topic: (-topic.project_count, topic.name, topic.id))
|
||||
return EuProjectTopics(
|
||||
institution_id=normalized_id,
|
||||
organization_name=organization_name,
|
||||
project_count=len(project_ids),
|
||||
matched_project_count=len(matched_project_ids),
|
||||
topics=topic_list,
|
||||
)
|
||||
@@ -54,6 +54,8 @@ class DfgProjectTopic(BaseModel):
|
||||
field: str | None = None
|
||||
domain: str | None = None
|
||||
project_count: int
|
||||
field_project_count: int
|
||||
subfield_project_count: int
|
||||
keywords: list[DfgProjectKeyword]
|
||||
|
||||
|
||||
@@ -65,6 +67,22 @@ class DfgProjectTopics(BaseModel):
|
||||
topics: list[DfgProjectTopic]
|
||||
|
||||
|
||||
class EuProjectTopics(BaseModel):
|
||||
institution_id: str
|
||||
organization_name: str
|
||||
project_count: int
|
||||
matched_project_count: int
|
||||
topics: list[DfgProjectTopic]
|
||||
|
||||
|
||||
class BundProjectTopics(BaseModel):
|
||||
institution_id: str
|
||||
organization_name: str
|
||||
project_count: int
|
||||
matched_project_count: int
|
||||
topics: list[DfgProjectTopic]
|
||||
|
||||
|
||||
class TopAuthor(BaseModel):
|
||||
id: str | None = None
|
||||
name: str
|
||||
@@ -80,6 +98,11 @@ class TopAuthorStatistics(BaseModel):
|
||||
news: list[TopAuthor]
|
||||
|
||||
|
||||
class TopAuthorAnalysis(BaseModel):
|
||||
institution_id: str
|
||||
authors: list[TopAuthor]
|
||||
|
||||
|
||||
class TopicHeatmapValue(BaseModel):
|
||||
year: int
|
||||
count: int
|
||||
|
||||
@@ -0,0 +1,102 @@
|
||||
from inse.institutions.institutions_search_client import InstitutionsSearchClient
|
||||
from inse.projects import service as projects_service
|
||||
from inse.projects.model import EuCordisProjectType
|
||||
|
||||
from .common import (
|
||||
dashboard_period as _dashboard_period,
|
||||
raw_institution_id as _raw_institution_id,
|
||||
)
|
||||
|
||||
|
||||
async def _get_dfg_project_ids_from_projects_service(
|
||||
institution_id: str,
|
||||
from_year: int | None = None,
|
||||
to_year: int | None = None,
|
||||
) -> list[str]:
|
||||
"""Returns every matching DFG project ID through the canonical project service."""
|
||||
period = _dashboard_period(from_year, to_year)
|
||||
page_size = 1000
|
||||
page_number = 0
|
||||
project_ids: set[str] = set()
|
||||
|
||||
while True:
|
||||
projects = await projects_service.get_dfg_projects(
|
||||
institutions_search_client=InstitutionsSearchClient(),
|
||||
raw_oa_institution_id=_raw_institution_id(institution_id),
|
||||
author_id=None,
|
||||
author_filter_ids=None,
|
||||
institution_ids=None,
|
||||
keywords=None,
|
||||
topic_ids=None,
|
||||
filter_topic_ids=None,
|
||||
title=None,
|
||||
funding_start_years=(
|
||||
[str(year) for year in range(1900, period[1] + 1)]
|
||||
if period[1] is not None
|
||||
else None
|
||||
),
|
||||
funding_end_years=(
|
||||
[str(year) for year in range(period[0], 2101)]
|
||||
if period[0] is not None
|
||||
else None
|
||||
),
|
||||
page=page_number,
|
||||
size=page_size,
|
||||
sort_by="id",
|
||||
sort_direction="asc",
|
||||
fuzzy=False,
|
||||
skip_enrichment=True,
|
||||
)
|
||||
project_ids.update(project.id for project in projects.elements if project.id)
|
||||
if len(project_ids) >= projects.total or not projects.elements:
|
||||
break
|
||||
page_number += 1
|
||||
|
||||
return sorted(project_ids)
|
||||
|
||||
|
||||
async def _get_eu_project_ids_from_projects_service(
|
||||
institution_id: str,
|
||||
from_year: int | None = None,
|
||||
to_year: int | None = None,
|
||||
) -> list[str]:
|
||||
"""Loads all organization EU project IDs from the canonical project service."""
|
||||
period = _dashboard_period(from_year, to_year)
|
||||
page_size = 1000
|
||||
page_number = 0
|
||||
project_ids: set[str] = set()
|
||||
|
||||
while True:
|
||||
projects = await projects_service.search_eu_cordis_projects(
|
||||
institutions_search_client=InstitutionsSearchClient(),
|
||||
raw_oa_institution_id=_raw_institution_id(institution_id),
|
||||
author_id=None,
|
||||
author_ids=None,
|
||||
organization_ids=None,
|
||||
organization_names=None,
|
||||
project_types=list(EuCordisProjectType),
|
||||
keywords=None,
|
||||
topic_ids=None,
|
||||
filter_topic_ids=None,
|
||||
title=None,
|
||||
funding_start_years=None,
|
||||
funding_end_years=None,
|
||||
active_from_year=period[0],
|
||||
active_to_year=period[1],
|
||||
countries=None,
|
||||
framework_programmes=None,
|
||||
funding_schemes=None,
|
||||
statuses=None,
|
||||
page=page_number,
|
||||
size=page_size,
|
||||
sort_by="id",
|
||||
sort_direction="asc",
|
||||
fuzzy=False,
|
||||
skip_enrichment=True,
|
||||
)
|
||||
project_ids.update(project.id for project in projects.elements if project.id)
|
||||
if len(project_ids) >= projects.total or not projects.elements:
|
||||
break
|
||||
page_number += 1
|
||||
|
||||
return sorted(project_ids)
|
||||
@@ -0,0 +1,122 @@
|
||||
from inse.institutions.institutions_search_client import InstitutionsSearchClient
|
||||
from inse.projects import service as projects_service
|
||||
from inse.projects.model import EuCordisProjectType
|
||||
|
||||
from .common import (
|
||||
dashboard_period as _dashboard_period,
|
||||
normalize_institution_id as _normalize_institution_id,
|
||||
raw_institution_id as _raw_institution_id,
|
||||
)
|
||||
from .model import DashboardStatisticValue
|
||||
|
||||
|
||||
async def get_dashboard_eu_projects(
|
||||
institution_id: str,
|
||||
organization_name: str,
|
||||
from_year: int | None = None,
|
||||
to_year: int | None = None,
|
||||
) -> DashboardStatisticValue:
|
||||
normalized_id = _normalize_institution_id(institution_id)
|
||||
period = _dashboard_period(from_year, to_year)
|
||||
projects = await projects_service.search_eu_cordis_projects(
|
||||
institutions_search_client=InstitutionsSearchClient(),
|
||||
raw_oa_institution_id=_raw_institution_id(normalized_id),
|
||||
author_id=None,
|
||||
author_ids=None,
|
||||
organization_ids=None,
|
||||
organization_names=None,
|
||||
project_types=list(EuCordisProjectType),
|
||||
keywords=None,
|
||||
topic_ids=None,
|
||||
filter_topic_ids=None,
|
||||
title=None,
|
||||
funding_start_years=None,
|
||||
funding_end_years=None,
|
||||
active_from_year=period[0],
|
||||
active_to_year=period[1],
|
||||
countries=None,
|
||||
framework_programmes=None,
|
||||
funding_schemes=None,
|
||||
statuses=None,
|
||||
page=0,
|
||||
size=1,
|
||||
sort_by="id",
|
||||
sort_direction="asc",
|
||||
fuzzy=False,
|
||||
)
|
||||
return DashboardStatisticValue(
|
||||
institution_id=normalized_id,
|
||||
organization_name=organization_name,
|
||||
value=projects.total,
|
||||
)
|
||||
|
||||
|
||||
async def get_dashboard_bmbf_projects(
|
||||
institution_id: str,
|
||||
organization_name: str,
|
||||
from_year: int | None = None,
|
||||
to_year: int | None = None,
|
||||
) -> DashboardStatisticValue:
|
||||
normalized_id = _normalize_institution_id(institution_id)
|
||||
period = _dashboard_period(from_year, to_year)
|
||||
projects = await projects_service.search_bund_projects_with_filters(
|
||||
institutions_search_client=InstitutionsSearchClient(),
|
||||
executing_agency=None,
|
||||
raw_oa_institution_id=_raw_institution_id(normalized_id),
|
||||
title=None,
|
||||
keywords=None,
|
||||
funding_arts=None,
|
||||
topic_ids=None,
|
||||
filter_topic_ids=None,
|
||||
funding_start_years=None,
|
||||
funding_end_years=None,
|
||||
active_from_year=period[0],
|
||||
active_to_year=period[1],
|
||||
countries=None,
|
||||
page=0,
|
||||
size=1,
|
||||
sort_by="id",
|
||||
sort_direction="asc",
|
||||
fuzzy=False,
|
||||
)
|
||||
return DashboardStatisticValue(
|
||||
institution_id=normalized_id,
|
||||
organization_name=organization_name,
|
||||
value=projects.total,
|
||||
)
|
||||
|
||||
|
||||
async def get_dashboard_dfg_projects(
|
||||
institution_id: str,
|
||||
organization_name: str,
|
||||
from_year: int | None = None,
|
||||
to_year: int | None = None,
|
||||
) -> DashboardStatisticValue:
|
||||
normalized_id = _normalize_institution_id(institution_id)
|
||||
period = _dashboard_period(from_year, to_year)
|
||||
projects = await projects_service.get_dfg_projects(
|
||||
institutions_search_client=InstitutionsSearchClient(),
|
||||
raw_oa_institution_id=_raw_institution_id(normalized_id),
|
||||
author_id=None,
|
||||
author_filter_ids=None,
|
||||
institution_ids=None,
|
||||
keywords=None,
|
||||
topic_ids=None,
|
||||
filter_topic_ids=None,
|
||||
title=None,
|
||||
funding_start_years=None,
|
||||
funding_end_years=None,
|
||||
active_from_year=period[0],
|
||||
active_to_year=period[1],
|
||||
page=0,
|
||||
size=1,
|
||||
sort_by="id",
|
||||
sort_direction="asc",
|
||||
fuzzy=False,
|
||||
skip_enrichment=True,
|
||||
)
|
||||
return DashboardStatisticValue(
|
||||
institution_id=normalized_id,
|
||||
organization_name=organization_name,
|
||||
value=projects.total,
|
||||
)
|
||||
@@ -0,0 +1,513 @@
|
||||
from datetime import datetime
|
||||
from typing import Any
|
||||
|
||||
from inse.institutions.institutions_search_client import InstitutionsSearchClient
|
||||
|
||||
from inse.integrations import elasticsearch
|
||||
from inse.model import ESCluster, ESIndex
|
||||
|
||||
from .common import (
|
||||
DashboardPeriod,
|
||||
dashboard_period as _dashboard_period,
|
||||
normalize_institution_id as _normalize_institution_id,
|
||||
project_boundary_year_filter as _project_boundary_year_filter,
|
||||
project_overlap_filter as _project_overlap_filter,
|
||||
raw_institution_id as _raw_institution_id,
|
||||
)
|
||||
from .institute_helper import get_openalex_institution
|
||||
from .model import (
|
||||
BmbfProjectStatusStatistics,
|
||||
DfgProjectStatusStatistics,
|
||||
EuProjectStatusStatistics,
|
||||
)
|
||||
from .project_statistics_service import (
|
||||
get_dashboard_bmbf_projects,
|
||||
get_dashboard_dfg_projects,
|
||||
get_dashboard_eu_projects,
|
||||
)
|
||||
|
||||
|
||||
def _status_count(aggregations: dict[str, Any], status_name: str) -> int:
|
||||
return int(aggregations.get(status_name, {}).get("projects", {}).get("value", 0))
|
||||
|
||||
|
||||
def reconcile_status_counts(
|
||||
total: int, ongoing: int, upcoming: int, completed: int
|
||||
) -> tuple[int, int, int]:
|
||||
"""Make status buckets add up to the authoritative project-service total."""
|
||||
counts = [max(0, ongoing), max(0, upcoming), max(0, completed)]
|
||||
difference = total - sum(counts)
|
||||
if difference >= 0:
|
||||
counts[0] += difference
|
||||
return counts[0], counts[1], counts[2]
|
||||
|
||||
excess = -difference
|
||||
for index in (0, 1, 2):
|
||||
reduction = min(counts[index], excess)
|
||||
counts[index] -= reduction
|
||||
excess -= reduction
|
||||
if excess == 0:
|
||||
break
|
||||
return counts[0], counts[1], counts[2]
|
||||
|
||||
|
||||
def _status_filter_aggregations(
|
||||
start_field: str, end_field: str, today: str
|
||||
) -> dict[str, Any]:
|
||||
return {
|
||||
"ongoing": {
|
||||
"filter": {
|
||||
"bool": {
|
||||
"filter": [
|
||||
{"range": {start_field: {"lte": today}}},
|
||||
{"range": {end_field: {"gte": today}}},
|
||||
]
|
||||
}
|
||||
}
|
||||
},
|
||||
"upcoming": {"filter": {"range": {start_field: {"gt": today}}}},
|
||||
"completed": {"filter": {"range": {end_field: {"lt": today}}}},
|
||||
}
|
||||
|
||||
|
||||
async def get_dashboard_eu_project_statuses(
|
||||
institution_id: str,
|
||||
organization_name: str,
|
||||
from_year: int | None = None,
|
||||
to_year: int | None = None,
|
||||
) -> EuProjectStatusStatistics:
|
||||
normalized_id = _normalize_institution_id(institution_id)
|
||||
aliases = await _institution_aliases(normalized_id, organization_name)
|
||||
project_ids = await _eu_project_ids_for_aliases(aliases)
|
||||
total = (
|
||||
await get_dashboard_eu_projects(
|
||||
normalized_id, organization_name, from_year=from_year, to_year=to_year
|
||||
)
|
||||
).value
|
||||
if not project_ids:
|
||||
return EuProjectStatusStatistics(
|
||||
institution_id=normalized_id,
|
||||
organization_name=organization_name,
|
||||
ongoing=total,
|
||||
upcoming=0,
|
||||
completed=0,
|
||||
)
|
||||
|
||||
today = datetime.now().date().isoformat()
|
||||
period = _dashboard_period(from_year, to_year)
|
||||
filters: list[dict[str, Any]] = [{"terms": {"id": sorted(project_ids)}}]
|
||||
if period_filter := _project_boundary_year_filter(
|
||||
"startDate", "endDate", period, "iso"
|
||||
):
|
||||
filters.append(period_filter)
|
||||
response = await elasticsearch.search(
|
||||
index=ESIndex.CORDIS_EU_PROJECTS_WILDCARD,
|
||||
body={
|
||||
"size": 0,
|
||||
"query": filters[0] if len(filters) == 1 else {"bool": {"filter": filters}},
|
||||
"aggs": {
|
||||
"ongoing": {
|
||||
"filter": {
|
||||
"bool": {
|
||||
"filter": [
|
||||
{"range": {"startDate": {"lte": today}}},
|
||||
{"range": {"endDate": {"gte": today}}},
|
||||
]
|
||||
}
|
||||
},
|
||||
"aggs": {"projects": {"cardinality": {"field": "id"}}},
|
||||
},
|
||||
"upcoming": {
|
||||
"filter": {"range": {"startDate": {"gt": today}}},
|
||||
"aggs": {"projects": {"cardinality": {"field": "id"}}},
|
||||
},
|
||||
"completed": {
|
||||
"filter": {"range": {"endDate": {"lt": today}}},
|
||||
"aggs": {"projects": {"cardinality": {"field": "id"}}},
|
||||
},
|
||||
},
|
||||
},
|
||||
cluster=ESCluster.INSE,
|
||||
)
|
||||
aggregations = response.get("aggregations", {})
|
||||
ongoing, upcoming, completed = reconcile_status_counts(
|
||||
total,
|
||||
_status_count(aggregations, "ongoing"),
|
||||
_status_count(aggregations, "upcoming"),
|
||||
_status_count(aggregations, "completed"),
|
||||
)
|
||||
return EuProjectStatusStatistics(
|
||||
institution_id=normalized_id,
|
||||
organization_name=organization_name,
|
||||
ongoing=ongoing,
|
||||
upcoming=upcoming,
|
||||
completed=completed,
|
||||
)
|
||||
|
||||
|
||||
async def get_dashboard_bmbf_project_statuses(
|
||||
institution_id: str,
|
||||
organization_name: str,
|
||||
from_year: int | None = None,
|
||||
to_year: int | None = None,
|
||||
) -> BmbfProjectStatusStatistics:
|
||||
normalized_id = _normalize_institution_id(institution_id)
|
||||
aliases = await _institution_aliases(normalized_id, organization_name)
|
||||
period = _dashboard_period(from_year, to_year)
|
||||
filters = [_alias_match_query("Zuwendungsempfänger", aliases)]
|
||||
if period_filter := _project_boundary_year_filter(
|
||||
"funding_start", "funding_end", period, "de"
|
||||
):
|
||||
filters.append(period_filter)
|
||||
response = await elasticsearch.search(
|
||||
index=ESIndex.PROJECTS_BUND_V1,
|
||||
body={
|
||||
"size": 0,
|
||||
"query": filters[0] if len(filters) == 1 else {"bool": {"filter": filters}},
|
||||
"aggs": _status_filter_aggregations(
|
||||
"funding_start", "funding_end", datetime.now().strftime("%d.%m.%Y")
|
||||
),
|
||||
},
|
||||
cluster=ESCluster.INSE,
|
||||
)
|
||||
aggregations = response.get("aggregations", {})
|
||||
total = (
|
||||
await get_dashboard_bmbf_projects(
|
||||
normalized_id, organization_name, from_year=from_year, to_year=to_year
|
||||
)
|
||||
).value
|
||||
ongoing, upcoming, completed = reconcile_status_counts(
|
||||
total,
|
||||
int(aggregations.get("ongoing", {}).get("doc_count", 0)),
|
||||
int(aggregations.get("upcoming", {}).get("doc_count", 0)),
|
||||
int(aggregations.get("completed", {}).get("doc_count", 0)),
|
||||
)
|
||||
return BmbfProjectStatusStatistics(
|
||||
institution_id=normalized_id,
|
||||
organization_name=organization_name,
|
||||
ongoing=ongoing,
|
||||
upcoming=upcoming,
|
||||
completed=completed,
|
||||
)
|
||||
|
||||
|
||||
async def get_dashboard_dfg_project_statuses(
|
||||
institution_id: str,
|
||||
organization_name: str,
|
||||
from_year: int | None = None,
|
||||
to_year: int | None = None,
|
||||
) -> DfgProjectStatusStatistics:
|
||||
normalized_id = _normalize_institution_id(institution_id)
|
||||
period = _dashboard_period(from_year, to_year)
|
||||
project_ids = await _get_dfg_project_ids_for_institution(normalized_id)
|
||||
total = (
|
||||
await get_dashboard_dfg_projects(
|
||||
normalized_id, organization_name, from_year=from_year, to_year=to_year
|
||||
)
|
||||
).value
|
||||
if not project_ids:
|
||||
return DfgProjectStatusStatistics(
|
||||
institution_id=normalized_id,
|
||||
organization_name=organization_name,
|
||||
ongoing=total,
|
||||
upcoming=0,
|
||||
completed=0,
|
||||
)
|
||||
|
||||
filters: list[dict[str, Any]] = [
|
||||
{
|
||||
"terms": {
|
||||
"projects.project_id": [int(project_id) for project_id in project_ids]
|
||||
}
|
||||
}
|
||||
]
|
||||
if period_filter := _project_boundary_year_filter(
|
||||
"projects.funding_start", "projects.funding_end", period, "year"
|
||||
):
|
||||
filters.append(period_filter)
|
||||
response = await elasticsearch.search(
|
||||
index=ESIndex.DFG_INSTITUTES_V2,
|
||||
body={
|
||||
"size": 0,
|
||||
"aggs": {
|
||||
"projects_nested": {
|
||||
"nested": {"path": "projects"},
|
||||
"aggs": {
|
||||
"selected_projects": {
|
||||
"filter": filters[0]
|
||||
if len(filters) == 1
|
||||
else {"bool": {"filter": filters}},
|
||||
"aggs": {
|
||||
"ongoing": {
|
||||
"filter": {
|
||||
"match_phrase": {
|
||||
"projects.status_de": "laufend"
|
||||
}
|
||||
},
|
||||
"aggs": {
|
||||
"projects": {
|
||||
"cardinality": {
|
||||
"field": "projects.project_id"
|
||||
}
|
||||
}
|
||||
},
|
||||
},
|
||||
"completed": {
|
||||
"filter": {
|
||||
"match_phrase": {
|
||||
"projects.status_de": "abgeschlossen"
|
||||
}
|
||||
},
|
||||
"aggs": {
|
||||
"projects": {
|
||||
"cardinality": {
|
||||
"field": "projects.project_id"
|
||||
}
|
||||
}
|
||||
},
|
||||
},
|
||||
},
|
||||
}
|
||||
},
|
||||
}
|
||||
},
|
||||
},
|
||||
cluster=ESCluster.INSE,
|
||||
)
|
||||
aggregations = (
|
||||
response.get("aggregations", {})
|
||||
.get("projects_nested", {})
|
||||
.get("selected_projects", {})
|
||||
)
|
||||
ongoing, upcoming, completed = reconcile_status_counts(
|
||||
total,
|
||||
_status_count(aggregations, "ongoing"),
|
||||
0,
|
||||
_status_count(aggregations, "completed"),
|
||||
)
|
||||
return DfgProjectStatusStatistics(
|
||||
institution_id=normalized_id,
|
||||
organization_name=organization_name,
|
||||
ongoing=ongoing,
|
||||
upcoming=upcoming,
|
||||
completed=completed,
|
||||
)
|
||||
|
||||
|
||||
async def _get_dfg_project_ids_for_institution(
|
||||
institution_id: str,
|
||||
from_year: int | None = None,
|
||||
to_year: int | None = None,
|
||||
) -> list[str]:
|
||||
period = _dashboard_period(from_year, to_year)
|
||||
institution = await get_openalex_institution(institution_id)
|
||||
institution_names = _openalex_institution_names(institution)
|
||||
|
||||
institutes_response = await elasticsearch.search(
|
||||
index=ESIndex.DFG_INSTITUTES_V2,
|
||||
body={
|
||||
"size": 0,
|
||||
"query": _dfg_institute_name_query(institution_names),
|
||||
"aggs": {
|
||||
"institute_ids": {"terms": {"field": "institute_id", "size": 1000}}
|
||||
},
|
||||
},
|
||||
cluster=ESCluster.INSE,
|
||||
)
|
||||
institute_ids = [
|
||||
bucket["key"]
|
||||
for bucket in (
|
||||
institutes_response.get("aggregations", {})
|
||||
.get("institute_ids", {})
|
||||
.get("buckets", [])
|
||||
)
|
||||
if bucket.get("key") is not None
|
||||
]
|
||||
if not institute_ids:
|
||||
return []
|
||||
|
||||
projects_response = await elasticsearch.search(
|
||||
index=ESIndex.DFG_INSTITUTES_V2,
|
||||
body={
|
||||
"size": 0,
|
||||
"query": {"terms": {"institute_id": institute_ids}},
|
||||
"aggs": {
|
||||
"projects_nested": {
|
||||
"nested": {"path": "projects"},
|
||||
"aggs": {
|
||||
"project_ids": {
|
||||
"filter": {
|
||||
"terms": {"projects.institute_ref_id": institute_ids}
|
||||
},
|
||||
"aggs": {
|
||||
"values": {
|
||||
"terms": {
|
||||
"field": "projects.project_id",
|
||||
"size": 10000,
|
||||
}
|
||||
}
|
||||
},
|
||||
}
|
||||
},
|
||||
}
|
||||
},
|
||||
},
|
||||
cluster=ESCluster.INSE,
|
||||
)
|
||||
project_ids = [
|
||||
str(bucket["key"])
|
||||
for bucket in (
|
||||
projects_response.get("aggregations", {})
|
||||
.get("projects_nested", {})
|
||||
.get("project_ids", {})
|
||||
.get("values", {})
|
||||
.get("buckets", [])
|
||||
)
|
||||
if bucket.get("key") is not None
|
||||
]
|
||||
return await _filter_dfg_project_ids_by_period(project_ids, period)
|
||||
|
||||
|
||||
async def _eu_project_ids_for_aliases(aliases: list[str]) -> set[str]:
|
||||
project_ids: set[str] = set()
|
||||
async for hit in elasticsearch.scan(
|
||||
index=str(ESIndex.CORDIS_EU_ORGANIZATIONS_WILDCARD),
|
||||
query=_eu_organization_query(aliases),
|
||||
source=["projectID"],
|
||||
page_size=1000,
|
||||
cluster=ESCluster.INSE,
|
||||
):
|
||||
project_id = hit.get("_source", {}).get("projectID")
|
||||
if project_id is not None:
|
||||
project_ids.add(str(project_id))
|
||||
return project_ids
|
||||
|
||||
|
||||
async def _filter_dfg_project_ids_by_period(
|
||||
project_ids: list[str],
|
||||
period: DashboardPeriod,
|
||||
) -> list[str]:
|
||||
period_filter = _project_overlap_filter(
|
||||
"funding_start",
|
||||
"funding_end",
|
||||
period,
|
||||
missing_end_is_ongoing=True,
|
||||
)
|
||||
if not project_ids or not period_filter:
|
||||
return project_ids
|
||||
|
||||
numeric_project_ids = [
|
||||
int(project_id) for project_id in project_ids if str(project_id).isdigit()
|
||||
]
|
||||
if not numeric_project_ids:
|
||||
return []
|
||||
|
||||
response = await elasticsearch.search(
|
||||
index=ESIndex.DFG_PROJECTS,
|
||||
body={
|
||||
"size": 0,
|
||||
"query": {
|
||||
"bool": {
|
||||
"filter": [
|
||||
{"terms": {"id": numeric_project_ids}},
|
||||
period_filter,
|
||||
]
|
||||
}
|
||||
},
|
||||
"aggs": {
|
||||
"project_ids": {
|
||||
"terms": {
|
||||
"field": "id",
|
||||
"size": len(numeric_project_ids),
|
||||
}
|
||||
}
|
||||
},
|
||||
},
|
||||
cluster=ESCluster.INSE,
|
||||
)
|
||||
return [
|
||||
str(bucket["key"])
|
||||
for bucket in (
|
||||
response.get("aggregations", {}).get("project_ids", {}).get("buckets", [])
|
||||
)
|
||||
if bucket.get("key") is not None
|
||||
]
|
||||
|
||||
|
||||
async def _institution_aliases(
|
||||
institution_id: str,
|
||||
organization_name: str,
|
||||
) -> list[str]:
|
||||
aliases = (
|
||||
await InstitutionsSearchClient().get_institution_aliases_by_oa_institution_id(
|
||||
_raw_institution_id(institution_id)
|
||||
)
|
||||
)
|
||||
return sorted(
|
||||
{
|
||||
alias.strip()
|
||||
for alias in [organization_name, *aliases]
|
||||
if alias and alias.strip()
|
||||
}
|
||||
)
|
||||
|
||||
|
||||
def _eu_organization_query(aliases: list[str]) -> dict[str, Any]:
|
||||
return {
|
||||
"terms": {
|
||||
"name.keyword": [alias.upper() for alias in aliases],
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
def _alias_match_query(field: str, aliases: list[str]) -> dict[str, Any]:
|
||||
return {
|
||||
"bool": {
|
||||
"should": [
|
||||
{
|
||||
"match": {
|
||||
field: {
|
||||
"query": alias,
|
||||
"operator": "and",
|
||||
}
|
||||
}
|
||||
}
|
||||
for alias in aliases
|
||||
],
|
||||
"minimum_should_match": 1,
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
def _openalex_institution_names(institution: Any) -> list[str]:
|
||||
return sorted(
|
||||
{
|
||||
name.strip()
|
||||
for name in [
|
||||
institution.display_name,
|
||||
*(institution.display_name_alternatives or []),
|
||||
*(institution.display_name_acronyms or []),
|
||||
]
|
||||
if name and name.strip()
|
||||
}
|
||||
)
|
||||
|
||||
|
||||
def _dfg_institute_name_query(institution_names: list[str]) -> dict[str, Any]:
|
||||
return {
|
||||
"bool": {
|
||||
"should": [
|
||||
{
|
||||
"terms": {
|
||||
"institute_name_de.keyword": institution_names,
|
||||
}
|
||||
},
|
||||
{
|
||||
"terms": {
|
||||
"institute_name_en.keyword": institution_names,
|
||||
}
|
||||
},
|
||||
],
|
||||
"minimum_should_match": 1,
|
||||
}
|
||||
}
|
||||
@@ -10,32 +10,48 @@ from inse.tags import Tags
|
||||
|
||||
from .model import (
|
||||
BmbfProjectStatusStatistics,
|
||||
BundProjectTopics,
|
||||
DashboardStatistics,
|
||||
DashboardStatisticValue,
|
||||
DfgProjectStatusStatistics,
|
||||
DfgProjectTopics,
|
||||
EuProjectTopics,
|
||||
EuProjectStatusStatistics,
|
||||
TopAuthorStatistics,
|
||||
TopAuthorAnalysis,
|
||||
TopicHeatmap,
|
||||
TopicWordCloud,
|
||||
)
|
||||
from .service import (
|
||||
get_dashboard_bmbf_project_statuses,
|
||||
get_dashboard_bmbf_projects,
|
||||
get_dashboard_dfg_project_statuses,
|
||||
get_dashboard_dfg_projects,
|
||||
get_dashboard_dfg_topics,
|
||||
get_dashboard_eu_project_statuses,
|
||||
get_dashboard_eu_projects,
|
||||
get_dashboard_organization,
|
||||
get_dashboard_patents,
|
||||
get_dashboard_persons,
|
||||
get_dashboard_publications,
|
||||
get_dashboard_statistics,
|
||||
get_top_authors,
|
||||
get_topic_heatmap,
|
||||
get_topic_word_cloud,
|
||||
)
|
||||
from .project_statistics_service import (
|
||||
get_dashboard_bmbf_projects,
|
||||
get_dashboard_dfg_projects,
|
||||
get_dashboard_eu_projects,
|
||||
)
|
||||
from .bund_topics_service import get_dashboard_bund_topics
|
||||
from .dfg_topics_service import get_dashboard_dfg_topics
|
||||
from .eu_topics_service import get_dashboard_eu_topics
|
||||
from .project_status_service import (
|
||||
get_dashboard_bmbf_project_statuses,
|
||||
get_dashboard_dfg_project_statuses,
|
||||
get_dashboard_eu_project_statuses,
|
||||
)
|
||||
from .top_authors_service import (
|
||||
get_top_authors,
|
||||
get_top_eu_project_authors,
|
||||
get_top_news_authors,
|
||||
get_top_patent_authors,
|
||||
get_top_project_authors,
|
||||
get_top_work_authors,
|
||||
)
|
||||
|
||||
router = APIRouter(prefix="/api/dashboard", tags=[Tags.DASHBOARD])
|
||||
|
||||
@@ -256,6 +272,46 @@ async def dashboard_dfg_project_topics(
|
||||
)
|
||||
|
||||
|
||||
@router.get(
|
||||
"/projects/eu/topics",
|
||||
operation_id="getDashboardEuProjectTopics",
|
||||
response_model=EuProjectTopics,
|
||||
)
|
||||
async def dashboard_eu_project_topics(
|
||||
from_year: int | None = Query(default=None, ge=1900, le=2100),
|
||||
to_year: int | None = Query(default=None, ge=1900, le=2100),
|
||||
session: Session = Depends(get_session),
|
||||
access_token: AccessToken = auth_service.CurrentUserAccessTokenPayloadDep,
|
||||
) -> EuProjectTopics:
|
||||
organization = get_dashboard_organization(session, access_token)
|
||||
return await get_dashboard_eu_topics(
|
||||
organization.openalex_institution_id,
|
||||
organization.name,
|
||||
from_year=from_year,
|
||||
to_year=to_year,
|
||||
)
|
||||
|
||||
|
||||
@router.get(
|
||||
"/projects/bund/topics",
|
||||
operation_id="getDashboardBundProjectTopics",
|
||||
response_model=BundProjectTopics,
|
||||
)
|
||||
async def dashboard_bund_project_topics(
|
||||
from_year: int | None = Query(default=None, ge=1900, le=2100),
|
||||
to_year: int | None = Query(default=None, ge=1900, le=2100),
|
||||
session: Session = Depends(get_session),
|
||||
access_token: AccessToken = auth_service.CurrentUserAccessTokenPayloadDep,
|
||||
) -> BundProjectTopics:
|
||||
organization = get_dashboard_organization(session, access_token)
|
||||
return await get_dashboard_bund_topics(
|
||||
organization.openalex_institution_id,
|
||||
organization.name,
|
||||
from_year=from_year,
|
||||
to_year=to_year,
|
||||
)
|
||||
|
||||
|
||||
@router.get(
|
||||
"/top-authors",
|
||||
operation_id="getDashboardTopAuthors",
|
||||
@@ -281,6 +337,94 @@ async def dashboard_top_authors(
|
||||
)
|
||||
|
||||
|
||||
@router.get(
|
||||
"/top-authors/works",
|
||||
operation_id="getDashboardTopWorkAuthors",
|
||||
response_model=TopAuthorAnalysis,
|
||||
)
|
||||
async def dashboard_top_work_authors(
|
||||
works_period: Literal["all_time", "last_5_years"] = Query(
|
||||
default="all_time", pattern="^(all_time|last_5_years)$"
|
||||
),
|
||||
from_year: int | None = Query(default=None, ge=1900, le=2100),
|
||||
to_year: int | None = Query(default=None, ge=1900, le=2100),
|
||||
session: Session = Depends(get_session),
|
||||
access_token: AccessToken = auth_service.CurrentUserAccessTokenPayloadDep,
|
||||
) -> TopAuthorAnalysis:
|
||||
organization = get_dashboard_organization(session, access_token)
|
||||
return await get_top_work_authors(
|
||||
organization.openalex_institution_id, works_period, from_year, to_year
|
||||
)
|
||||
|
||||
|
||||
@router.get(
|
||||
"/top-authors/projects",
|
||||
operation_id="getDashboardTopProjectAuthors",
|
||||
response_model=TopAuthorAnalysis,
|
||||
)
|
||||
async def dashboard_top_project_authors(
|
||||
from_year: int | None = Query(default=None, ge=1900, le=2100),
|
||||
to_year: int | None = Query(default=None, ge=1900, le=2100),
|
||||
session: Session = Depends(get_session),
|
||||
access_token: AccessToken = auth_service.CurrentUserAccessTokenPayloadDep,
|
||||
) -> TopAuthorAnalysis:
|
||||
organization = get_dashboard_organization(session, access_token)
|
||||
return await get_top_project_authors(
|
||||
organization.openalex_institution_id, organization.name, from_year, to_year
|
||||
)
|
||||
|
||||
|
||||
@router.get(
|
||||
"/top-authors/eu-projects",
|
||||
operation_id="getDashboardTopEuProjectAuthors",
|
||||
response_model=TopAuthorAnalysis,
|
||||
)
|
||||
async def dashboard_top_eu_project_authors(
|
||||
from_year: int | None = Query(default=None, ge=1900, le=2100),
|
||||
to_year: int | None = Query(default=None, ge=1900, le=2100),
|
||||
session: Session = Depends(get_session),
|
||||
access_token: AccessToken = auth_service.CurrentUserAccessTokenPayloadDep,
|
||||
) -> TopAuthorAnalysis:
|
||||
organization = get_dashboard_organization(session, access_token)
|
||||
return await get_top_eu_project_authors(
|
||||
organization.openalex_institution_id, from_year, to_year
|
||||
)
|
||||
|
||||
|
||||
@router.get(
|
||||
"/top-authors/patents",
|
||||
operation_id="getDashboardTopPatentAuthors",
|
||||
response_model=TopAuthorAnalysis,
|
||||
)
|
||||
async def dashboard_top_patent_authors(
|
||||
from_year: int | None = Query(default=None, ge=1900, le=2100),
|
||||
to_year: int | None = Query(default=None, ge=1900, le=2100),
|
||||
session: Session = Depends(get_session),
|
||||
access_token: AccessToken = auth_service.CurrentUserAccessTokenPayloadDep,
|
||||
) -> TopAuthorAnalysis:
|
||||
organization = get_dashboard_organization(session, access_token)
|
||||
return await get_top_patent_authors(
|
||||
organization.openalex_institution_id, from_year, to_year
|
||||
)
|
||||
|
||||
|
||||
@router.get(
|
||||
"/top-authors/news",
|
||||
operation_id="getDashboardTopNewsAuthors",
|
||||
response_model=TopAuthorAnalysis,
|
||||
)
|
||||
async def dashboard_top_news_authors(
|
||||
from_year: int | None = Query(default=None, ge=1900, le=2100),
|
||||
to_year: int | None = Query(default=None, ge=1900, le=2100),
|
||||
session: Session = Depends(get_session),
|
||||
access_token: AccessToken = auth_service.CurrentUserAccessTokenPayloadDep,
|
||||
) -> TopAuthorAnalysis:
|
||||
organization = get_dashboard_organization(session, access_token)
|
||||
return await get_top_news_authors(
|
||||
organization.openalex_institution_id, from_year, to_year
|
||||
)
|
||||
|
||||
|
||||
@router.get(
|
||||
"/topic-heatmap",
|
||||
operation_id="getDashboardTopicHeatmap",
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
@@ -107,6 +107,30 @@ def create_db_and_tables():
|
||||
)
|
||||
)
|
||||
|
||||
# Preserve the former single institution as the first manually selected
|
||||
# institution.
|
||||
# The legacy column remains synchronized for portal sections that have not yet
|
||||
# been migrated to organization-wide institution lists.
|
||||
with engine.begin() as connection:
|
||||
connection.execute(
|
||||
text(
|
||||
"""
|
||||
INSERT INTO organization_institution (
|
||||
organization_id, openalex_institution_id, position
|
||||
)
|
||||
SELECT id, openalex_institution_id, 0
|
||||
FROM organization
|
||||
WHERE openalex_institution_id IS NOT NULL
|
||||
AND TRIM(openalex_institution_id) != ''
|
||||
AND NOT EXISTS (
|
||||
SELECT 1
|
||||
FROM organization_institution oi
|
||||
WHERE oi.organization_id = organization.id
|
||||
)
|
||||
"""
|
||||
)
|
||||
)
|
||||
|
||||
|
||||
def get_session():
|
||||
"""Yields a database session for use in FastAPI endpoints.
|
||||
|
||||
@@ -261,11 +261,10 @@ async def search(
|
||||
payload["sort"] = sort
|
||||
if aggs is not None:
|
||||
payload["aggs"] = aggs
|
||||
if track_total_hits:
|
||||
payload["track_total_hits"] = True
|
||||
if highlight is not None:
|
||||
payload["highlight"] = highlight
|
||||
|
||||
|
||||
payload["track_total_hits"] = True # always track total hits for accurate pagination and counts
|
||||
if len(payload) == 0:
|
||||
raise ValueError(
|
||||
"At least one of 'query', 'body', 'source', 'size', 'offset', 'sort', 'aggs' must be provided"
|
||||
|
||||
@@ -52,6 +52,9 @@ class ESIndex(StrEnum):
|
||||
OPENALEX_CONTINENTS = "openalex-continents"
|
||||
OPENALEX_TOPICS = "openalex-topics"
|
||||
OPENALEX_TOPIC_VECTORS = "topicvectors"
|
||||
OPENALEX_DOMAINS = "openalex-domains"
|
||||
OPENALEX_FIELDS = "openalex-fields"
|
||||
OPENALEX_SUBFIELDS = "openalex-subfields"
|
||||
|
||||
EPO_INDEX = "epo_index_1.0"
|
||||
USPTO_INDEX = "uspto_patents_3.0"
|
||||
|
||||
@@ -27,7 +27,6 @@ TOPIC_NUM_CANDIDATES = 100
|
||||
TOPIC_SIMILARITY = 0.5
|
||||
|
||||
TOPICS_INDEX = "aktuell_openalex_topics"
|
||||
TOPICS_INDEX_MAX_PAIRS = 100
|
||||
|
||||
_SESSION_TOPIC_CACHE: dict[str, list] = {}
|
||||
|
||||
@@ -48,6 +47,11 @@ RELATED_BLOCK_SIZE = 5
|
||||
RELATED_TOPIC_K = 1
|
||||
EXACT_ID_CAP = 1000
|
||||
|
||||
KEYWORD_SEARCH_FIELDS = ["maintitle^3", "intro_content^2", "tags^2", "full_content"]
|
||||
KEYWORD_SEARCH_SCAN_CAP = 50000
|
||||
KEYWORD_SEARCH_ID_CAP = 2000
|
||||
TOPIC_DOCS_PER_ARTICLE = 25
|
||||
|
||||
|
||||
async def get_news_page(
|
||||
page: int,
|
||||
@@ -127,6 +131,206 @@ async def search_news(
|
||||
return news_page
|
||||
|
||||
|
||||
async def search_news_by_keywords(
|
||||
keywords: list | None = None,
|
||||
topic_ids: list | None = None,
|
||||
filter_topic_ids: list | None = None,
|
||||
fuzzy: bool = False,
|
||||
page: int = 1,
|
||||
page_size: int = 10,
|
||||
year_from: int | None = None,
|
||||
year_to: int | None = None,
|
||||
relevance_values: list | None = None,
|
||||
sort_order: str | None = None,
|
||||
) -> NewsPage:
|
||||
"""Searches the news for the keywords of a keywords-search run.
|
||||
|
||||
`fuzzy` resolves the keywords to OpenAlex topics (via the aktuell_openalex_topics index),
|
||||
otherwise the raw keywords are matched as phrases against the article
|
||||
text. The individual keywords are OR-ed rather than AND-ed.
|
||||
An article carries at most KEYWORD_LIMIT keywords, so requiring all of them
|
||||
would leave every multi-keyword search empty.
|
||||
Articles matching more of them simply rank higher.
|
||||
|
||||
A fuzzy search without any resolved topic ids falls back to the raw
|
||||
keywords. Once there are topic ids the fallback is off: a topic search that matches no article
|
||||
stays empty instead of silently returning keyword hits.
|
||||
|
||||
By default results stay ranked by match strength (Elasticsearch's
|
||||
`_score`). Passing `sort_order` ('asc'/'desc') overrides that with a
|
||||
plain date sort, same as the plain news list.
|
||||
"""
|
||||
wanted_topic_ids: set = set()
|
||||
if fuzzy:
|
||||
wanted_topic_ids = {
|
||||
topic_id
|
||||
for topic_id in (topic_ids or []) + (filter_topic_ids or [])
|
||||
if topic_id
|
||||
}
|
||||
|
||||
if wanted_topic_ids:
|
||||
should = await _topic_id_should_clauses(wanted_topic_ids)
|
||||
else:
|
||||
should = _keyword_should_clauses(keywords)
|
||||
|
||||
if not should:
|
||||
return _empty_page(page, page_size)
|
||||
|
||||
clauses = await _filter_clauses(year_from, year_to, relevance_values)
|
||||
query = {
|
||||
"bool": {
|
||||
"should": should,
|
||||
"minimum_should_match": 1,
|
||||
"filter": clauses,
|
||||
}
|
||||
}
|
||||
|
||||
highlight = {
|
||||
"fields": {"full_content": {"fragment_size": 200, "number_of_fragments": 1}},
|
||||
"pre_tags": ["<em>"],
|
||||
"post_tags": ["</em>"],
|
||||
"encoder": "html",
|
||||
}
|
||||
|
||||
sort = [{"date_full": sort_order}] if sort_order in ("asc", "desc") else None
|
||||
|
||||
response = await _run_search(
|
||||
query=query,
|
||||
source=["date", "maintitle", "author", "url", "intro_content", "full_content"],
|
||||
size=page_size,
|
||||
offset=(page - 1) * page_size,
|
||||
sort=sort,
|
||||
highlight=None if wanted_topic_ids else highlight,
|
||||
)
|
||||
|
||||
news_page = await _build_page(response, page, page_size)
|
||||
await _attach_topics(news_page.results)
|
||||
|
||||
return news_page
|
||||
|
||||
|
||||
def _keyword_should_clauses(keywords: list | None) -> list:
|
||||
return [
|
||||
{
|
||||
"multi_match": {
|
||||
"query": keyword.strip(),
|
||||
"fields": KEYWORD_SEARCH_FIELDS,
|
||||
"type": "phrase",
|
||||
}
|
||||
}
|
||||
for keyword in (keywords or [])
|
||||
if keyword and keyword.strip()
|
||||
]
|
||||
|
||||
|
||||
async def _topic_id_should_clauses(topic_ids: set) -> list:
|
||||
"""Turns matched OpenAlex topics into id clauses, boosted by hit count.
|
||||
|
||||
Articles that match several of the searched topics get a higher boost, so
|
||||
Elasticsearch ranks them above articles that only match one.
|
||||
"""
|
||||
topics_per_article = await _news_ids_by_topic_ids(topic_ids)
|
||||
if not topics_per_article:
|
||||
return []
|
||||
|
||||
ranked = sorted(topics_per_article.items(), key=lambda item: -len(item[1]))
|
||||
ids_by_hit_count: dict[int, list] = {}
|
||||
for news_id, matched_topics in ranked[:KEYWORD_SEARCH_ID_CAP]:
|
||||
ids_by_hit_count.setdefault(len(matched_topics), []).append(news_id)
|
||||
|
||||
return [
|
||||
{"ids": {"values": news_ids, "boost": float(hit_count)}}
|
||||
for hit_count, news_ids in ids_by_hit_count.items()
|
||||
]
|
||||
|
||||
|
||||
async def _news_ids_by_topic_ids(topic_ids: set) -> dict:
|
||||
"""Returns news_id -> set of searched topic ids the article was mapped to."""
|
||||
query = {"terms": {"topic_matches.topic_id.keyword": sorted(topic_ids)}}
|
||||
|
||||
topics_per_article: dict[str, set] = {}
|
||||
scanned = 0
|
||||
try:
|
||||
async for hit in elasticsearch.scan(
|
||||
index=TOPICS_INDEX,
|
||||
query=query,
|
||||
source=["news_id", "topic_matches.topic_id"],
|
||||
cluster="inse",
|
||||
):
|
||||
scanned += 1
|
||||
source = hit.get("_source", {})
|
||||
news_id = source.get("news_id")
|
||||
if news_id:
|
||||
matched = topics_per_article.setdefault(news_id, set())
|
||||
for match in source.get("topic_matches") or []:
|
||||
topic_id = match.get("topic_id")
|
||||
if topic_id in topic_ids:
|
||||
matched.add(topic_id)
|
||||
if scanned >= KEYWORD_SEARCH_SCAN_CAP:
|
||||
logger.warning(
|
||||
f"Topic lookup hit the scan cap of {KEYWORD_SEARCH_SCAN_CAP} documents."
|
||||
)
|
||||
break
|
||||
except Exception:
|
||||
logger.exception("Topic lookup for the keyword news search failed.")
|
||||
return {}
|
||||
|
||||
return {news_id: matched for news_id, matched in topics_per_article.items() if matched}
|
||||
|
||||
|
||||
async def _attach_topics(articles: list) -> None:
|
||||
news_ids = [article.id for article in articles if article.id]
|
||||
if not news_ids:
|
||||
return
|
||||
|
||||
topics_per_article = await _topics_for_news_ids(news_ids)
|
||||
for article in articles:
|
||||
article.topics = topics_per_article.get(article.id, [])
|
||||
|
||||
|
||||
async def _topics_for_news_ids(news_ids: list) -> dict[str, list[MatchedTopic]]:
|
||||
"""Reads the indexed OpenAlex topic matches for the given articles."""
|
||||
try:
|
||||
response = await elasticsearch.search(
|
||||
index=TOPICS_INDEX,
|
||||
query={"terms": {"news_id.keyword": news_ids}},
|
||||
source=["news_id", "keyword", "topic_matches"],
|
||||
size=min(len(news_ids) * TOPIC_DOCS_PER_ARTICLE, 10000),
|
||||
cluster="inse",
|
||||
)
|
||||
except Exception:
|
||||
logger.exception("Batched topic lookup for the news result page failed.")
|
||||
return {}
|
||||
|
||||
topics_per_article: dict[str, list[MatchedTopic]] = {}
|
||||
seen_per_article: dict[str, set] = {}
|
||||
for hit in response.get("hits", {}).get("hits", []):
|
||||
source = hit.get("_source", {})
|
||||
news_id = source.get("news_id")
|
||||
if not news_id:
|
||||
continue
|
||||
keyword = source.get("keyword")
|
||||
matched = topics_per_article.setdefault(news_id, [])
|
||||
seen_ids = seen_per_article.setdefault(news_id, set())
|
||||
for match in source.get("topic_matches") or []:
|
||||
topic_id = match.get("topic_id")
|
||||
if not topic_id or topic_id in seen_ids:
|
||||
continue
|
||||
seen_ids.add(topic_id)
|
||||
matched.append(
|
||||
MatchedTopic(
|
||||
id=topic_id,
|
||||
display_name=match.get("topic_display_name"),
|
||||
subfield_name=match.get("subfield"),
|
||||
field_name=match.get("field"),
|
||||
domain_name=match.get("domain"),
|
||||
source_keyword=keyword,
|
||||
)
|
||||
)
|
||||
|
||||
return topics_per_article
|
||||
|
||||
|
||||
async def get_news_by_author(
|
||||
author_id: str,
|
||||
page: int = 1,
|
||||
@@ -321,7 +525,7 @@ async def _get_article_keywords(
|
||||
|
||||
|
||||
async def _get_article_topics(news_id: str, keywords: list) -> list:
|
||||
indexed = await get_article_topics_from_index(news_id)
|
||||
indexed = (await _topics_for_news_ids([news_id])).get(news_id, [])
|
||||
if indexed:
|
||||
return indexed
|
||||
|
||||
@@ -336,42 +540,6 @@ async def _get_article_topics(news_id: str, keywords: list) -> list:
|
||||
return topics
|
||||
|
||||
|
||||
async def get_article_topics_from_index(news_id: str) -> list:
|
||||
try:
|
||||
response = await elasticsearch.search(
|
||||
index=TOPICS_INDEX,
|
||||
query={"term": {"news_id.keyword": news_id}},
|
||||
source=["keyword", "topic_matches"],
|
||||
size=TOPICS_INDEX_MAX_PAIRS,
|
||||
cluster="inse",
|
||||
)
|
||||
except Exception:
|
||||
logger.exception(f"Topic-index lookup for {news_id} failed.")
|
||||
return []
|
||||
|
||||
matched = []
|
||||
seen_ids = set()
|
||||
for hit in response.get("hits", {}).get("hits", []):
|
||||
source = hit.get("_source", {})
|
||||
keyword = source.get("keyword")
|
||||
for match in source.get("topic_matches") or []:
|
||||
topic_id = match.get("topic_id")
|
||||
if not topic_id or topic_id in seen_ids:
|
||||
continue
|
||||
seen_ids.add(topic_id)
|
||||
matched.append(
|
||||
MatchedTopic(
|
||||
id=topic_id,
|
||||
display_name=match.get("topic_display_name"),
|
||||
subfield_name=match.get("subfield"),
|
||||
field_name=match.get("field"),
|
||||
domain_name=match.get("domain"),
|
||||
source_keyword=keyword,
|
||||
)
|
||||
)
|
||||
return matched
|
||||
|
||||
|
||||
def _normalize_keywords(candidates: list) -> list:
|
||||
"""Trims, dedups (case-insensitive) and caps the keywords from the LLM."""
|
||||
seen = set()
|
||||
@@ -516,7 +684,7 @@ async def _get_postproc_labels(news_id: str) -> tuple[bool | None, list, list, s
|
||||
return relevant, authors, keywords, hit.get("_id")
|
||||
|
||||
|
||||
async def _run_search(query: dict, source: list, size: int, offset: int, sort, highlight: dict = None) -> dict:
|
||||
async def _run_search(query: dict, source: list, size: int, offset: int, sort, highlight: dict | None = None) -> dict:
|
||||
try:
|
||||
return await elasticsearch.search(
|
||||
index="aktuell",
|
||||
|
||||
@@ -8,17 +8,6 @@ class NewsKeywords(BaseModel):
|
||||
keywords: list[str] = Field(description="The extracted keywords from the article.")
|
||||
|
||||
|
||||
class NewsArticle(BaseModel):
|
||||
id: str
|
||||
date: str | None = None
|
||||
maintitle: str | None = None
|
||||
author: str | None = None
|
||||
url: str | None = None
|
||||
relevant: bool | None = None
|
||||
snippet: str | None = None
|
||||
related: bool | None = None
|
||||
|
||||
|
||||
class MentionedPerson(BaseModel):
|
||||
name: str
|
||||
is_ude: bool = False
|
||||
@@ -34,6 +23,18 @@ class MatchedTopic(BaseModel):
|
||||
source_keyword: str | None = None
|
||||
|
||||
|
||||
class NewsArticle(BaseModel):
|
||||
id: str
|
||||
date: str | None = None
|
||||
maintitle: str | None = None
|
||||
author: str | None = None
|
||||
url: str | None = None
|
||||
relevant: bool | None = None
|
||||
snippet: str | None = None
|
||||
related: bool | None = None
|
||||
topics: list[MatchedTopic] | None = None
|
||||
|
||||
|
||||
class NewsArticleDetail(NewsArticle):
|
||||
full_content: str | None = None
|
||||
relevant: bool | None = None
|
||||
|
||||
@@ -100,6 +100,68 @@ async def search_news(
|
||||
)
|
||||
|
||||
|
||||
@router.get(
|
||||
"/keyword/search",
|
||||
operation_id="getNewsByKeywords",
|
||||
response_model=NewsPage,
|
||||
response_model_exclude_none=True,
|
||||
summary="Searches news articles by the keywords or matched topics of a keywords search.",
|
||||
tags=[Tags.NEWS],
|
||||
)
|
||||
async def search_news_by_keywords(
|
||||
keywords: Annotated[
|
||||
list[str] | None, Query(description="Raw keywords to match against title/content.")
|
||||
] = None,
|
||||
topic_ids: Annotated[
|
||||
list[str] | None,
|
||||
Query(alias="topicIds", description="OpenAlex topic ids the keywords resolved to."),
|
||||
] = None,
|
||||
filter_topic_ids: Annotated[
|
||||
list[str] | None,
|
||||
Query(alias="filterTopicIds", description="Additional topic ids to narrow the results by."),
|
||||
] = None,
|
||||
fuzzy: Annotated[
|
||||
bool,
|
||||
Query(description="Search by resolved topics if True, otherwise by raw keywords."),
|
||||
] = False,
|
||||
page: Annotated[
|
||||
int, Query(description="Page number (1-based).", ge=1)
|
||||
] = 1,
|
||||
page_size: Annotated[
|
||||
int, Query(alias="pageSize", description="Articles per page.", ge=1, le=100)
|
||||
] = 10,
|
||||
relevance: Annotated[
|
||||
str | None, Query(description="Comma-separated relevance filter: 'relevant', 'not_relevant'.")
|
||||
] = None,
|
||||
year_from: Annotated[
|
||||
int | None, Query(alias="yearFrom", description="Earliest publication year (inclusive).", ge=0)
|
||||
] = None,
|
||||
year_to: Annotated[
|
||||
int | None, Query(alias="yearTo", description="Latest publication year (inclusive).", ge=0)
|
||||
] = None,
|
||||
sort_order: Annotated[
|
||||
str | None,
|
||||
Query(
|
||||
alias="sortOrder",
|
||||
description="Overrides relevance ranking with a date sort: 'desc' (newest first) or 'asc' (oldest first).",
|
||||
pattern="^(asc|desc)$",
|
||||
),
|
||||
] = None,
|
||||
):
|
||||
return await logic.search_news_by_keywords(
|
||||
keywords=keywords or [],
|
||||
topic_ids=topic_ids or [],
|
||||
filter_topic_ids=filter_topic_ids or [],
|
||||
fuzzy=fuzzy,
|
||||
page=page,
|
||||
page_size=page_size,
|
||||
sort_order=sort_order,
|
||||
year_from=year_from,
|
||||
year_to=year_to,
|
||||
relevance_values=_parse_relevance(relevance),
|
||||
)
|
||||
|
||||
|
||||
@router.get(
|
||||
"/by-author",
|
||||
operation_id="getNewsByAuthor",
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
import uuid
|
||||
from typing import Literal
|
||||
|
||||
from pydantic import BaseModel, Field
|
||||
|
||||
@@ -7,6 +8,7 @@ class OrganizationProfile(BaseModel):
|
||||
id: uuid.UUID
|
||||
name: str
|
||||
other_inst_id: str | None = None
|
||||
selected_openalex_institution_ids: list[str] = Field(default_factory=list)
|
||||
deleted: bool
|
||||
member_count: int
|
||||
|
||||
@@ -21,9 +23,25 @@ class OrganizationPage(BaseModel):
|
||||
class CreateOrganizationRequest(BaseModel):
|
||||
name: str = Field(min_length=1)
|
||||
other_inst_id: str | None = None
|
||||
selected_openalex_institution_ids: list[str] | None = None
|
||||
|
||||
|
||||
class UpdateOrganizationRequest(BaseModel):
|
||||
name: str | None = Field(default=None, min_length=1)
|
||||
other_inst_id: str | None = None
|
||||
selected_openalex_institution_ids: list[str] | None = None
|
||||
deleted: bool | None = None
|
||||
|
||||
|
||||
class InstitutionAssociation(BaseModel):
|
||||
id: str
|
||||
display_name: str
|
||||
relationship: Literal["child", "related"]
|
||||
|
||||
|
||||
class InstitutionAssociationsResponse(BaseModel):
|
||||
id: str
|
||||
display_name: str
|
||||
associated_institutions: list[InstitutionAssociation] = Field(
|
||||
default_factory=list
|
||||
)
|
||||
|
||||
@@ -11,6 +11,7 @@ from inse.tags import Tags
|
||||
from . import service
|
||||
from .model import (
|
||||
CreateOrganizationRequest,
|
||||
InstitutionAssociationsResponse,
|
||||
OrganizationPage,
|
||||
OrganizationProfile,
|
||||
UpdateOrganizationRequest,
|
||||
@@ -19,6 +20,18 @@ from .model import (
|
||||
router = APIRouter(prefix="/api/organizations", tags=[Tags.ORGANIZATION])
|
||||
|
||||
|
||||
@router.get(
|
||||
"/institutions/associations",
|
||||
operation_id="getOrganizationInstitutionAssociations",
|
||||
response_model=list[InstitutionAssociationsResponse],
|
||||
)
|
||||
async def get_organization_institution_associations(
|
||||
institution_ids: list[str] = Query(),
|
||||
access_token: AccessTokenMetadata = auth_service.CurrentUserAccessTokenPayloadDep,
|
||||
) -> list[InstitutionAssociationsResponse]:
|
||||
return await service.get_institution_associations(access_token, institution_ids)
|
||||
|
||||
|
||||
@router.get("", operation_id="getOrganisations", response_model=OrganizationPage)
|
||||
async def get_organizations(
|
||||
page: int = Query(default=0, ge=0),
|
||||
|
||||
@@ -1,18 +1,43 @@
|
||||
import logging
|
||||
import re
|
||||
import uuid
|
||||
|
||||
from fastapi import HTTPException, status
|
||||
from sqlmodel import Session, func, select
|
||||
|
||||
from inse.auth.model import AccessTokenMetadata, Account, Organization, UserRole
|
||||
from inse.auth.model import (
|
||||
AccessTokenMetadata,
|
||||
Account,
|
||||
Organization,
|
||||
OrganizationInstitution,
|
||||
UserRole,
|
||||
)
|
||||
from inse.integrations import elasticsearch
|
||||
from inse.model import ESIndex
|
||||
|
||||
from .model import (
|
||||
CreateOrganizationRequest,
|
||||
InstitutionAssociation,
|
||||
InstitutionAssociationsResponse,
|
||||
OrganizationPage,
|
||||
OrganizationProfile,
|
||||
UpdateOrganizationRequest,
|
||||
)
|
||||
|
||||
|
||||
logger = logging.getLogger(__name__)
|
||||
OPENALEX_INSTITUTION_ID_PATTERN = re.compile(
|
||||
r"^(?:https?://openalex\.org/)?(I\d+)/?$", re.IGNORECASE
|
||||
)
|
||||
KNOWN_ASSOCIATION_TYPES = {
|
||||
"parent",
|
||||
"child",
|
||||
"related",
|
||||
"predecessor",
|
||||
"successor",
|
||||
}
|
||||
|
||||
|
||||
def _require_super_admin(access_token: AccessTokenMetadata) -> None:
|
||||
if access_token.effective_role != UserRole.SUPER_ADMIN:
|
||||
raise HTTPException(
|
||||
@@ -31,6 +56,27 @@ def _normalize_name(name: str) -> str:
|
||||
return normalized_name
|
||||
|
||||
|
||||
def _normalize_institution_id(institution_id: str) -> str:
|
||||
match = OPENALEX_INSTITUTION_ID_PATTERN.fullmatch(institution_id.strip())
|
||||
if match is None:
|
||||
raise HTTPException(
|
||||
status_code=status.HTTP_422_UNPROCESSABLE_ENTITY,
|
||||
detail=f"Invalid OpenAlex institution ID: {institution_id}",
|
||||
)
|
||||
return f"I{match.group(1)[1:]}"
|
||||
|
||||
|
||||
def _normalize_institution_ids(institution_ids: list[str]) -> list[str]:
|
||||
normalized: list[str] = []
|
||||
seen: set[str] = set()
|
||||
for institution_id in institution_ids:
|
||||
clean_id = _normalize_institution_id(institution_id)
|
||||
if clean_id not in seen:
|
||||
normalized.append(clean_id)
|
||||
seen.add(clean_id)
|
||||
return normalized
|
||||
|
||||
|
||||
def _ensure_name_available(
|
||||
session: Session,
|
||||
name: str,
|
||||
@@ -79,18 +125,76 @@ def _member_counts(
|
||||
return {organization_id: count for organization_id, count in rows}
|
||||
|
||||
|
||||
def _institution_data(
|
||||
session: Session, organization_ids: list[uuid.UUID]
|
||||
) -> dict[uuid.UUID, list[str]]:
|
||||
ids_by_organization: dict[uuid.UUID, list[str]] = {
|
||||
organization_id: [] for organization_id in organization_ids
|
||||
}
|
||||
if not organization_ids:
|
||||
return ids_by_organization
|
||||
|
||||
institution_rows = session.exec(
|
||||
select(OrganizationInstitution)
|
||||
.where(OrganizationInstitution.organization_id.in_(organization_ids))
|
||||
.order_by(
|
||||
OrganizationInstitution.organization_id,
|
||||
OrganizationInstitution.position,
|
||||
)
|
||||
).all()
|
||||
for row in institution_rows:
|
||||
ids_by_organization[row.organization_id].append(
|
||||
row.openalex_institution_id
|
||||
)
|
||||
|
||||
return ids_by_organization
|
||||
|
||||
|
||||
def _to_profile(
|
||||
organization: Organization, member_count: int
|
||||
organization: Organization,
|
||||
member_count: int,
|
||||
institution_ids: list[str],
|
||||
) -> OrganizationProfile:
|
||||
if not institution_ids and organization.openalex_institution_id:
|
||||
legacy_id = _normalize_institution_id(organization.openalex_institution_id)
|
||||
institution_ids = [legacy_id]
|
||||
return OrganizationProfile(
|
||||
id=organization.id,
|
||||
name=organization.name,
|
||||
other_inst_id=organization.openalex_institution_id,
|
||||
other_inst_id=institution_ids[0] if institution_ids else None,
|
||||
selected_openalex_institution_ids=institution_ids,
|
||||
deleted=organization.deleted,
|
||||
member_count=member_count,
|
||||
)
|
||||
|
||||
|
||||
def _replace_organization_institutions(
|
||||
session: Session,
|
||||
organization: Organization,
|
||||
institution_ids: list[str],
|
||||
) -> None:
|
||||
normalized_ids = _normalize_institution_ids(institution_ids)
|
||||
for row in session.exec(
|
||||
select(OrganizationInstitution).where(
|
||||
OrganizationInstitution.organization_id == organization.id
|
||||
)
|
||||
).all():
|
||||
session.delete(row)
|
||||
session.flush()
|
||||
|
||||
for position, institution_id in enumerate(normalized_ids):
|
||||
session.add(
|
||||
OrganizationInstitution(
|
||||
organization_id=organization.id,
|
||||
openalex_institution_id=institution_id,
|
||||
position=position,
|
||||
)
|
||||
)
|
||||
organization.openalex_institution_id = (
|
||||
normalized_ids[0] if normalized_ids else None
|
||||
)
|
||||
|
||||
|
||||
def _deactivate_organization_accounts(
|
||||
session: Session, organization_id: uuid.UUID
|
||||
) -> None:
|
||||
@@ -106,6 +210,27 @@ def _deactivate_organization_accounts(
|
||||
session.add(account)
|
||||
|
||||
|
||||
def _ensure_not_current_organization(
|
||||
session: Session,
|
||||
access_token: AccessTokenMetadata,
|
||||
organization_id: uuid.UUID,
|
||||
) -> None:
|
||||
protected_organization_ids = {access_token.effective_organization_id}
|
||||
if access_token.real_account_id is not None:
|
||||
real_account = session.get(Account, access_token.real_account_id)
|
||||
if real_account is not None:
|
||||
protected_organization_ids.add(real_account.organization_id)
|
||||
|
||||
if organization_id in protected_organization_ids:
|
||||
raise HTTPException(
|
||||
status_code=status.HTTP_409_CONFLICT,
|
||||
detail=(
|
||||
"The organization of the real or effective account "
|
||||
"cannot be deleted."
|
||||
),
|
||||
)
|
||||
|
||||
|
||||
def get_organizations(
|
||||
session: Session,
|
||||
access_token: AccessTokenMetadata,
|
||||
@@ -130,10 +255,15 @@ def get_organizations(
|
||||
).all()
|
||||
organization_ids = [organization.id for organization in organizations]
|
||||
counts = _member_counts(session, organization_ids)
|
||||
institution_ids = _institution_data(session, organization_ids)
|
||||
|
||||
return OrganizationPage(
|
||||
items=[
|
||||
_to_profile(organization, counts.get(organization.id, 0))
|
||||
_to_profile(
|
||||
organization,
|
||||
counts.get(organization.id, 0),
|
||||
institution_ids.get(organization.id, []),
|
||||
)
|
||||
for organization in organizations
|
||||
],
|
||||
total=total,
|
||||
@@ -153,12 +283,25 @@ def create_organization(
|
||||
|
||||
organization = Organization(
|
||||
name=name,
|
||||
openalex_institution_id=(payload.other_inst_id or '').strip() or None,
|
||||
)
|
||||
session.add(organization)
|
||||
session.flush()
|
||||
requested_ids = payload.selected_openalex_institution_ids
|
||||
if requested_ids is None:
|
||||
requested_ids = [payload.other_inst_id] if payload.other_inst_id else []
|
||||
_replace_organization_institutions(
|
||||
session,
|
||||
organization,
|
||||
requested_ids,
|
||||
)
|
||||
session.commit()
|
||||
session.refresh(organization)
|
||||
return _to_profile(organization, 0)
|
||||
institution_ids = _institution_data(session, [organization.id])
|
||||
return _to_profile(
|
||||
organization,
|
||||
0,
|
||||
institution_ids[organization.id],
|
||||
)
|
||||
|
||||
|
||||
def update_organization(
|
||||
@@ -174,10 +317,21 @@ def update_organization(
|
||||
name = _normalize_name(payload.name)
|
||||
_ensure_name_available(session, name, organization.id)
|
||||
organization.name = name
|
||||
if payload.other_inst_id is not None:
|
||||
organization.openalex_institution_id = payload.other_inst_id.strip() or None
|
||||
if payload.selected_openalex_institution_ids is not None:
|
||||
_replace_organization_institutions(
|
||||
session,
|
||||
organization,
|
||||
payload.selected_openalex_institution_ids,
|
||||
)
|
||||
elif payload.other_inst_id is not None:
|
||||
_replace_organization_institutions(
|
||||
session,
|
||||
organization,
|
||||
[payload.other_inst_id] if payload.other_inst_id.strip() else [],
|
||||
)
|
||||
if payload.deleted is not None:
|
||||
if payload.deleted and not organization.deleted:
|
||||
_ensure_not_current_organization(session, access_token, organization.id)
|
||||
_deactivate_organization_accounts(session, organization.id)
|
||||
organization.deleted = payload.deleted
|
||||
|
||||
@@ -185,7 +339,107 @@ def update_organization(
|
||||
session.commit()
|
||||
session.refresh(organization)
|
||||
counts = _member_counts(session, [organization.id])
|
||||
return _to_profile(organization, counts.get(organization.id, 0))
|
||||
institution_ids = _institution_data(session, [organization.id])
|
||||
return _to_profile(
|
||||
organization,
|
||||
counts.get(organization.id, 0),
|
||||
institution_ids[organization.id],
|
||||
)
|
||||
|
||||
|
||||
async def get_institution_associations(
|
||||
access_token: AccessTokenMetadata,
|
||||
institution_ids: list[str],
|
||||
) -> list[InstitutionAssociationsResponse]:
|
||||
_require_super_admin(access_token)
|
||||
clean_ids = _normalize_institution_ids(institution_ids)
|
||||
if not clean_ids:
|
||||
return []
|
||||
|
||||
response = await elasticsearch.search(
|
||||
index=ESIndex.OPENALEX_INSTITUTIONS,
|
||||
query={
|
||||
"terms": {
|
||||
"id": [
|
||||
f"https://openalex.org/{institution_id}"
|
||||
for institution_id in clean_ids
|
||||
]
|
||||
}
|
||||
},
|
||||
source=["id", "display_name", "associated_institutions"],
|
||||
size=len(clean_ids),
|
||||
)
|
||||
sources_by_id: dict[str, dict] = {}
|
||||
for hit in response.get("hits", {}).get("hits", []):
|
||||
source = hit.get("_source") or {}
|
||||
raw_id = source.get("id")
|
||||
if isinstance(raw_id, str):
|
||||
sources_by_id[_normalize_institution_id(raw_id)] = source
|
||||
|
||||
missing_id = next(
|
||||
(
|
||||
institution_id
|
||||
for institution_id in clean_ids
|
||||
if institution_id not in sources_by_id
|
||||
),
|
||||
None,
|
||||
)
|
||||
if missing_id is not None:
|
||||
raise HTTPException(
|
||||
status_code=status.HTTP_404_NOT_FOUND,
|
||||
detail=f"OpenAlex institution {missing_id} not found.",
|
||||
)
|
||||
|
||||
results: list[InstitutionAssociationsResponse] = []
|
||||
for clean_id in clean_ids:
|
||||
source = sources_by_id[clean_id]
|
||||
display_name = source.get("display_name")
|
||||
if not isinstance(display_name, str) or not display_name.strip():
|
||||
raise HTTPException(
|
||||
status_code=status.HTTP_502_BAD_GATEWAY,
|
||||
detail=f"OpenAlex institution {clean_id} has no display name.",
|
||||
)
|
||||
|
||||
associations_by_id: dict[str, InstitutionAssociation] = {}
|
||||
for association in source.get("associated_institutions") or []:
|
||||
if not isinstance(association, dict):
|
||||
continue
|
||||
relationship = str(association.get("relationship") or "").lower()
|
||||
if relationship not in KNOWN_ASSOCIATION_TYPES:
|
||||
logger.warning(
|
||||
"Ignoring unknown OpenAlex institution relationship %r for %s",
|
||||
relationship,
|
||||
clean_id,
|
||||
)
|
||||
continue
|
||||
if relationship not in {"child", "related"}:
|
||||
continue
|
||||
raw_association_id = association.get("id")
|
||||
association_name = association.get("display_name")
|
||||
if not isinstance(raw_association_id, str) or not isinstance(
|
||||
association_name, str
|
||||
):
|
||||
continue
|
||||
associated_id = _normalize_institution_id(raw_association_id)
|
||||
candidate = InstitutionAssociation(
|
||||
id=associated_id,
|
||||
display_name=association_name,
|
||||
relationship=relationship,
|
||||
)
|
||||
existing = associations_by_id.get(associated_id)
|
||||
if existing is None or (
|
||||
existing.relationship == "related" and relationship == "child"
|
||||
):
|
||||
associations_by_id[associated_id] = candidate
|
||||
|
||||
results.append(
|
||||
InstitutionAssociationsResponse(
|
||||
id=clean_id,
|
||||
display_name=display_name,
|
||||
associated_institutions=list(associations_by_id.values()),
|
||||
)
|
||||
)
|
||||
return results
|
||||
|
||||
|
||||
def delete_organization(
|
||||
@@ -196,6 +450,7 @@ def delete_organization(
|
||||
_require_super_admin(access_token)
|
||||
organization = _get_organization_or_404(session, organization_id)
|
||||
if not organization.deleted:
|
||||
_ensure_not_current_organization(session, access_token, organization.id)
|
||||
_deactivate_organization_accounts(session, organization.id)
|
||||
organization.deleted = True
|
||||
session.add(organization)
|
||||
|
||||
@@ -1,10 +1,16 @@
|
||||
import asyncio
|
||||
from types import SimpleNamespace
|
||||
|
||||
import pytest
|
||||
from fastapi import HTTPException
|
||||
from sqlmodel import Session, SQLModel, create_engine
|
||||
from sqlmodel import Session, SQLModel, create_engine, select
|
||||
|
||||
from inse.auth.model import Account, Organization, UserRole
|
||||
from inse.auth.model import (
|
||||
Account,
|
||||
Organization,
|
||||
OrganizationInstitution,
|
||||
UserRole,
|
||||
)
|
||||
from inse.organization_management import service
|
||||
from inse.organization_management.model import (
|
||||
CreateOrganizationRequest,
|
||||
@@ -22,10 +28,11 @@ def session():
|
||||
yield database_session
|
||||
|
||||
|
||||
def token(role: UserRole, organization_id):
|
||||
def token(role: UserRole, organization_id, real_account_id=None):
|
||||
return SimpleNamespace(
|
||||
effective_role=role,
|
||||
effective_organization_id=organization_id,
|
||||
real_account_id=real_account_id,
|
||||
)
|
||||
|
||||
|
||||
@@ -105,8 +112,115 @@ def test_superadmin_can_create_update_and_soft_delete(session):
|
||||
assert session.get(Organization, created.id).deleted is True
|
||||
|
||||
|
||||
def test_organization_stores_ordered_selected_institution_ids(session):
|
||||
scope = Organization(name="Scope")
|
||||
session.add(scope)
|
||||
session.commit()
|
||||
|
||||
created = service.create_organization(
|
||||
session,
|
||||
token(UserRole.SUPER_ADMIN, scope.id),
|
||||
CreateOrganizationRequest(
|
||||
name="Institution list",
|
||||
selected_openalex_institution_ids=[
|
||||
"https://openalex.org/I123",
|
||||
"I456",
|
||||
"I123",
|
||||
],
|
||||
),
|
||||
)
|
||||
|
||||
assert created.selected_openalex_institution_ids == ["I123", "I456"]
|
||||
assert created.other_inst_id == "I123"
|
||||
assert session.get(Organization, created.id).openalex_institution_id == "I123"
|
||||
rows = session.exec(
|
||||
select(OrganizationInstitution)
|
||||
.where(OrganizationInstitution.organization_id == created.id)
|
||||
.order_by(OrganizationInstitution.position)
|
||||
).all()
|
||||
assert [row.openalex_institution_id for row in rows] == ["I123", "I456"]
|
||||
|
||||
|
||||
def test_empty_institution_list_clears_legacy_primary_institution(session):
|
||||
organization = Organization(name="Organization", openalex_institution_id="I123")
|
||||
session.add(organization)
|
||||
session.commit()
|
||||
|
||||
updated = service.update_organization(
|
||||
session,
|
||||
token(UserRole.SUPER_ADMIN, organization.id),
|
||||
organization.id,
|
||||
UpdateOrganizationRequest(selected_openalex_institution_ids=[]),
|
||||
)
|
||||
|
||||
assert updated.selected_openalex_institution_ids == []
|
||||
assert updated.other_inst_id is None
|
||||
assert session.get(Organization, organization.id).openalex_institution_id is None
|
||||
|
||||
|
||||
def test_association_expansion_adds_only_child_and_related_with_child_priority(
|
||||
monkeypatch,
|
||||
):
|
||||
async def fake_search(**kwargs):
|
||||
return {
|
||||
"hits": {
|
||||
"hits": [
|
||||
{
|
||||
"_source": {
|
||||
"id": "https://openalex.org/I100",
|
||||
"display_name": "Selected institution",
|
||||
"associated_institutions": [
|
||||
{
|
||||
"id": "https://openalex.org/I200",
|
||||
"display_name": "Duplicate",
|
||||
"relationship": "related",
|
||||
},
|
||||
{
|
||||
"id": "https://openalex.org/I200",
|
||||
"display_name": "Duplicate",
|
||||
"relationship": "child",
|
||||
},
|
||||
{
|
||||
"id": "https://openalex.org/I300",
|
||||
"display_name": "Related",
|
||||
"relationship": "related",
|
||||
},
|
||||
{
|
||||
"id": "https://openalex.org/I400",
|
||||
"display_name": "Parent",
|
||||
"relationship": "parent",
|
||||
},
|
||||
{
|
||||
"id": "https://openalex.org/I500",
|
||||
"display_name": "Successor",
|
||||
"relationship": "successor",
|
||||
},
|
||||
],
|
||||
},
|
||||
}
|
||||
],
|
||||
},
|
||||
}
|
||||
|
||||
monkeypatch.setattr(service.elasticsearch, "search", fake_search)
|
||||
|
||||
result = asyncio.run(
|
||||
service.get_institution_associations(
|
||||
token(UserRole.SUPER_ADMIN, None), ["https://openalex.org/I100"]
|
||||
)
|
||||
)
|
||||
|
||||
assert result[0].id == "I100"
|
||||
assert [
|
||||
(association.id, association.relationship)
|
||||
for association in result[0].associated_institutions
|
||||
] == [("I200", "child"), ("I300", "related")]
|
||||
|
||||
|
||||
def test_deleting_organization_deactivates_all_its_accounts(session):
|
||||
admin_scope = Organization(name="Admin scope for delete")
|
||||
organization = Organization(name="Organization to delete")
|
||||
session.add(admin_scope)
|
||||
session.add(organization)
|
||||
session.flush()
|
||||
active_account = Account(
|
||||
@@ -129,7 +243,7 @@ def test_deleting_organization_deactivates_all_its_accounts(session):
|
||||
session.commit()
|
||||
|
||||
service.delete_organization(
|
||||
session, token(UserRole.SUPER_ADMIN, organization.id), organization.id
|
||||
session, token(UserRole.SUPER_ADMIN, admin_scope.id), organization.id
|
||||
)
|
||||
|
||||
session.refresh(active_account)
|
||||
@@ -141,7 +255,9 @@ def test_deleting_organization_deactivates_all_its_accounts(session):
|
||||
|
||||
|
||||
def test_marking_organization_deleted_deactivates_its_accounts(session):
|
||||
admin_scope = Organization(name="Admin scope for update")
|
||||
organization = Organization(name="Organization to update")
|
||||
session.add(admin_scope)
|
||||
session.add(organization)
|
||||
session.flush()
|
||||
account = Account(
|
||||
@@ -155,7 +271,7 @@ def test_marking_organization_deleted_deactivates_its_accounts(session):
|
||||
|
||||
service.update_organization(
|
||||
session,
|
||||
token(UserRole.SUPER_ADMIN, organization.id),
|
||||
token(UserRole.SUPER_ADMIN, admin_scope.id),
|
||||
organization.id,
|
||||
UpdateOrganizationRequest(deleted=True),
|
||||
)
|
||||
@@ -165,6 +281,61 @@ def test_marking_organization_deleted_deactivates_its_accounts(session):
|
||||
assert account.epoch == 1
|
||||
|
||||
|
||||
@pytest.mark.parametrize("delete_via_update", [False, True])
|
||||
def test_current_organization_cannot_be_deleted(session, delete_via_update):
|
||||
organization = Organization(name="Current organization")
|
||||
session.add(organization)
|
||||
session.commit()
|
||||
access_token = token(UserRole.SUPER_ADMIN, organization.id)
|
||||
|
||||
with pytest.raises(HTTPException) as error:
|
||||
if delete_via_update:
|
||||
service.update_organization(
|
||||
session,
|
||||
access_token,
|
||||
organization.id,
|
||||
UpdateOrganizationRequest(deleted=True),
|
||||
)
|
||||
else:
|
||||
service.delete_organization(session, access_token, organization.id)
|
||||
|
||||
assert error.value.status_code == 409
|
||||
assert session.get(Organization, organization.id).deleted is False
|
||||
|
||||
|
||||
def test_real_account_organization_cannot_be_deleted_while_impersonating(session):
|
||||
real_organization = Organization(name="Real organization")
|
||||
effective_organization = Organization(name="Effective organization")
|
||||
session.add(real_organization)
|
||||
session.add(effective_organization)
|
||||
session.flush()
|
||||
real_account = Account(
|
||||
email="real-superadmin@example.org",
|
||||
name="Real superadmin",
|
||||
password_hash="hash",
|
||||
organization_id=real_organization.id,
|
||||
roles=[UserRole.SUPER_ADMIN],
|
||||
)
|
||||
session.add(real_account)
|
||||
session.commit()
|
||||
|
||||
access_token = token(
|
||||
UserRole.SUPER_ADMIN,
|
||||
effective_organization.id,
|
||||
real_account.id,
|
||||
)
|
||||
with pytest.raises(HTTPException) as error:
|
||||
service.delete_organization(
|
||||
session,
|
||||
access_token,
|
||||
real_organization.id,
|
||||
)
|
||||
|
||||
assert error.value.status_code == 409
|
||||
assert session.get(Organization, real_organization.id).deleted is False
|
||||
assert session.get(Account, real_account.id).activated is True
|
||||
|
||||
|
||||
@pytest.mark.parametrize("role", [UserRole.ADMIN, UserRole.MANAGER, UserRole.USER])
|
||||
def test_only_superadmin_can_create_organizations(session, role):
|
||||
organization = Organization(name="Scope")
|
||||
|
||||
@@ -741,6 +741,8 @@ async def _build_eu_cordis_search_query(
|
||||
title: str | None = None,
|
||||
funding_start_years: list[str] | None = None,
|
||||
funding_end_years: list[str] | None = None,
|
||||
active_from_year: int | None = None,
|
||||
active_to_year: int | None = None,
|
||||
countries: list[str] | None = None,
|
||||
framework_programmes: list[str] | None = None,
|
||||
funding_schemes: list[str] | None = None,
|
||||
@@ -876,6 +878,18 @@ async def _build_eu_cordis_search_query(
|
||||
if funding_end_years:
|
||||
must_clauses.append(_eu_year_filters("endDate", funding_end_years))
|
||||
|
||||
# Period-overlap filter: a project was active in the selected interval when
|
||||
# it started no later than the interval end and ended no earlier than the
|
||||
# interval start. This is intentionally separate from exact-year filters.
|
||||
if active_to_year is not None:
|
||||
must_clauses.append(
|
||||
{"range": {"startDate": {"lte": f"{active_to_year}-12-31"}}}
|
||||
)
|
||||
if active_from_year is not None:
|
||||
must_clauses.append(
|
||||
{"range": {"endDate": {"gte": f"{active_from_year}-01-01"}}}
|
||||
)
|
||||
|
||||
# === Project core filters ===
|
||||
if framework_programmes:
|
||||
must_clauses.append({"terms": {"frameworkProgramme": framework_programmes}})
|
||||
@@ -937,6 +951,8 @@ async def search_eu_cordis_projects(
|
||||
title: str | None = None,
|
||||
funding_start_years: list[str] | None = None,
|
||||
funding_end_years: list[str] | None = None,
|
||||
active_from_year: int | None = None,
|
||||
active_to_year: int | None = None,
|
||||
countries: list[str] | None = None,
|
||||
framework_programmes: list[str] | None = None,
|
||||
funding_schemes: list[str] | None = None,
|
||||
@@ -965,6 +981,8 @@ async def search_eu_cordis_projects(
|
||||
title=title,
|
||||
funding_start_years=funding_start_years,
|
||||
funding_end_years=funding_end_years,
|
||||
active_from_year=active_from_year,
|
||||
active_to_year=active_to_year,
|
||||
countries=countries,
|
||||
framework_programmes=framework_programmes,
|
||||
funding_schemes=funding_schemes,
|
||||
@@ -985,13 +1003,13 @@ async def search_eu_cordis_projects(
|
||||
body={
|
||||
"size": size,
|
||||
"from": page * size,
|
||||
"track_total_hits": True,
|
||||
"_source": [
|
||||
"id",
|
||||
"title",
|
||||
"acronym",
|
||||
"objective",
|
||||
"keywords",
|
||||
"topics",
|
||||
"frameworkProgramme",
|
||||
"fundingScheme",
|
||||
"status",
|
||||
@@ -1001,12 +1019,28 @@ async def search_eu_cordis_projects(
|
||||
"totalCost",
|
||||
],
|
||||
"query": query,
|
||||
"highlight": {
|
||||
"fields": {
|
||||
"title": {},
|
||||
"acronym": {},
|
||||
"objective": {},
|
||||
"keywords": {},
|
||||
"topics": {},
|
||||
},
|
||||
"pre_tags": ["<em>"],
|
||||
"post_tags": ["</em>"],
|
||||
"require_field_match": True,
|
||||
},
|
||||
"sort": [
|
||||
{
|
||||
sort_field: {
|
||||
"order": sort_direction,
|
||||
"missing": "_last",
|
||||
"unmapped_type": "keyword" if sort_field.endswith(".keyword") else "date",
|
||||
"unmapped_type": (
|
||||
"keyword"
|
||||
if sort_field.endswith(".keyword")
|
||||
else "date"
|
||||
),
|
||||
}
|
||||
}
|
||||
],
|
||||
@@ -1130,7 +1164,6 @@ async def get_eu_cordis_projects_funding_data(
|
||||
while True:
|
||||
body: dict[str, Any] = {
|
||||
"size": page_size,
|
||||
"track_total_hits": False,
|
||||
"_source": ["id", "startDate", "endDate", "ecMaxContribution"],
|
||||
"query": query,
|
||||
"sort": [{"id": {"order": "asc", "unmapped_type": "keyword"}}],
|
||||
|
||||
@@ -9,41 +9,6 @@ from inse.projects.model import EuCordisProjectType
|
||||
|
||||
logger = logging.getLogger(__name__)
|
||||
|
||||
|
||||
async def is_projects_access_forbidden(
|
||||
access_token_metadata: AccessTokenMetadata,
|
||||
raw_oa_institution_id: str | None,
|
||||
raw_oa_author_id: str | None,
|
||||
) -> bool:
|
||||
"""
|
||||
Determines if access to projects is forbidden based on the provided access token metadata
|
||||
and the raw OpenAlex institution and author IDs.
|
||||
|
||||
Args:
|
||||
access_token_metadata (AccessTokenMetadata): Metadata from the access token.
|
||||
raw_oa_institution_id (str | None): The raw OpenAlex institution ID.
|
||||
raw_oa_author_id (str | None): The raw OpenAlex author ID.
|
||||
|
||||
Returns:
|
||||
bool: True if access is forbidden, False otherwise.
|
||||
"""
|
||||
effective_institution_id = access_token_metadata.effective_institution_id
|
||||
|
||||
if raw_oa_institution_id and effective_institution_id != raw_oa_institution_id:
|
||||
return True
|
||||
|
||||
if raw_oa_author_id:
|
||||
authors_profile = await author_service.get_author_by_id(raw_oa_author_id)
|
||||
if not authors_profile:
|
||||
return True # Author not found, access forbidden
|
||||
|
||||
authors_last_known_institution_ids = [inst.id.split("/")[-1] for inst in authors_profile.last_known_institutions]
|
||||
print(f"Author's last known institution IDs: {authors_last_known_institution_ids}")
|
||||
if effective_institution_id not in authors_last_known_institution_ids:
|
||||
return True # Effective institution ID does not match any of the author's last known institutions
|
||||
|
||||
return False
|
||||
|
||||
async def get_dfg_author_names_by_ids(author_ids: list[int]) -> list[str] | None:
|
||||
try:
|
||||
body = {
|
||||
@@ -163,51 +128,42 @@ async def get_bund_project_ids_by_topic_ids(topic_ids: list[str]) -> list[str]:
|
||||
|
||||
project_topics: dict[str, set[str]] = defaultdict(set)
|
||||
|
||||
page_size = 1000
|
||||
from_ = 0
|
||||
body = {
|
||||
"size": 10000,
|
||||
"_source": ["project_id", "topic_matches"],
|
||||
"query": {
|
||||
"terms": {
|
||||
"topic_matches.topic_id.keyword": topic_ids
|
||||
}
|
||||
},
|
||||
}
|
||||
|
||||
while True:
|
||||
body = {
|
||||
"size": page_size,
|
||||
"from": from_,
|
||||
"_source": ["project_id", "topic_matches"],
|
||||
"query": {
|
||||
"terms": {
|
||||
"topic_matches.topic_id.keyword": topic_ids
|
||||
}
|
||||
},
|
||||
}
|
||||
response = await elasticsearch.search(
|
||||
index=ESIndex.PROJECTS_BUND_TOPICS,
|
||||
cluster=ESCluster.INSE,
|
||||
body=body,
|
||||
)
|
||||
hits = response.get("hits", {}).get("hits", [])
|
||||
|
||||
response = await elasticsearch.search(
|
||||
index=ESIndex.PROJECTS_BUND_TOPICS,
|
||||
cluster=ESCluster.INSE,
|
||||
body=body,
|
||||
)
|
||||
hits = response.get("hits", {}).get("hits", [])
|
||||
if not hits:
|
||||
break
|
||||
|
||||
for hit in hits:
|
||||
source = hit["_source"]
|
||||
for hit in hits:
|
||||
source = hit["_source"]
|
||||
|
||||
project_id = source.get("project_id")
|
||||
if not project_id:
|
||||
continue
|
||||
project_id = source.get("project_id")
|
||||
if not project_id:
|
||||
continue
|
||||
|
||||
topic_matches = source.get("topic_matches") or []
|
||||
topic_matches = source.get("topic_matches") or []
|
||||
|
||||
if isinstance(topic_matches, dict):
|
||||
topic_matches = [topic_matches]
|
||||
if isinstance(topic_matches, dict):
|
||||
topic_matches = [topic_matches]
|
||||
|
||||
for match in topic_matches:
|
||||
topic_id = match.get("topic_id")
|
||||
if topic_id in required_topics:
|
||||
project_topics[project_id].add(topic_id)
|
||||
for match in topic_matches:
|
||||
topic_id = match.get("topic_id")
|
||||
if topic_id in required_topics:
|
||||
project_topics[project_id].add(topic_id)
|
||||
|
||||
if len(hits) < page_size:
|
||||
break
|
||||
|
||||
from_ += page_size
|
||||
|
||||
return [
|
||||
project_id
|
||||
@@ -226,52 +182,43 @@ async def get_dfg_project_ids_by_topic_ids(topic_ids: list[str]) -> list[str]:
|
||||
|
||||
project_topics: dict[str, set[str]] = defaultdict(set)
|
||||
|
||||
page_size = 1000
|
||||
from_ = 0
|
||||
|
||||
while True:
|
||||
body = {
|
||||
"size": page_size,
|
||||
"from": from_,
|
||||
"_source": ["project_id", "topic_matches"],
|
||||
"query": {
|
||||
"terms": {
|
||||
"topic_matches.topic_id.keyword": topic_ids
|
||||
}
|
||||
},
|
||||
}
|
||||
body = {
|
||||
"size": 10000,
|
||||
"_source": ["project_id", "topic_matches"],
|
||||
"query": {
|
||||
"terms": {
|
||||
"topic_matches.topic_id.keyword": topic_ids
|
||||
}
|
||||
},
|
||||
}
|
||||
print("BODY", body)
|
||||
response = await elasticsearch.search(
|
||||
index=ESIndex.PROJECTS_DFG_TOPICS,
|
||||
cluster=ESCluster.INSE,
|
||||
body=body,
|
||||
)
|
||||
|
||||
response = await elasticsearch.search(
|
||||
index=ESIndex.PROJECTS_DFG_TOPICS,
|
||||
cluster=ESCluster.INSE,
|
||||
body=body,
|
||||
)
|
||||
hits = response.get("hits", {}).get("hits", [])
|
||||
|
||||
hits = response.get("hits", {}).get("hits", [])
|
||||
if not hits:
|
||||
break
|
||||
|
||||
for hit in hits:
|
||||
source = hit["_source"]
|
||||
for hit in hits:
|
||||
source = hit["_source"]
|
||||
|
||||
project_id = source.get("project_id")
|
||||
if not project_id:
|
||||
continue
|
||||
project_id = source.get("project_id")
|
||||
if not project_id:
|
||||
continue
|
||||
|
||||
topic_matches = source.get("topic_matches") or []
|
||||
topic_matches = source.get("topic_matches") or []
|
||||
|
||||
if isinstance(topic_matches, dict):
|
||||
topic_matches = [topic_matches]
|
||||
if isinstance(topic_matches, dict):
|
||||
topic_matches = [topic_matches]
|
||||
|
||||
for match in topic_matches:
|
||||
topic_id = match.get("topic_id")
|
||||
if topic_id in required_topics:
|
||||
project_topics[project_id].add(topic_id)
|
||||
for match in topic_matches:
|
||||
topic_id = match.get("topic_id")
|
||||
if topic_id in required_topics:
|
||||
project_topics[project_id].add(topic_id)
|
||||
|
||||
if len(hits) < page_size:
|
||||
break
|
||||
|
||||
from_ += page_size
|
||||
|
||||
return [
|
||||
project_id
|
||||
@@ -306,17 +253,34 @@ async def get_openalex_topics_for_bund_projects(project_ids: list[str]) -> dict[
|
||||
|
||||
lookup: dict[str, list[dict]] = {}
|
||||
for hit in response.get("hits", {}).get("hits", []):
|
||||
src = hit["_source"]
|
||||
pid = src.get("project_id")
|
||||
if pid:
|
||||
lookup[pid] = src.get("topic_matches", [])
|
||||
return lookup
|
||||
src = hit["_source"]
|
||||
pid = src.get("project_id")
|
||||
|
||||
if not pid:
|
||||
continue
|
||||
|
||||
pid = str(pid)
|
||||
|
||||
if pid not in lookup:
|
||||
lookup[pid] = {}
|
||||
|
||||
for topic in src.get("topic_matches", []):
|
||||
topic_id = topic.get("topic_id")
|
||||
|
||||
if topic_id:
|
||||
lookup[pid][str(topic_id)] = topic
|
||||
|
||||
result = {
|
||||
pid: list(topics.values())
|
||||
for pid, topics in lookup.items()
|
||||
}
|
||||
return result
|
||||
async def get_openalex_topics_for_dfg_projects(
|
||||
project_ids: list[str],
|
||||
) -> dict[str, list[dict]]:
|
||||
"""
|
||||
Retrieve OpenAlex topic details for a list of DFG project IDs.
|
||||
Returns a dict mapping `project_id` -> list of topic_match objects.
|
||||
Retrieve unique OpenAlex topic details for a list of DFG project IDs.
|
||||
Returns a dict mapping `project_id` -> unique list of topic_match objects.
|
||||
"""
|
||||
if not project_ids:
|
||||
return {}
|
||||
@@ -328,23 +292,41 @@ async def get_openalex_topics_for_dfg_projects(
|
||||
"project_id.keyword": project_ids
|
||||
}
|
||||
},
|
||||
"_source": ["project_id", "topic_matches"]
|
||||
"_source": ["project_id", "topic_matches"],
|
||||
}
|
||||
|
||||
response = await elasticsearch.search(
|
||||
index=ESIndex.PROJECTS_DFG_TOPICS,
|
||||
body=body,
|
||||
cluster=ESCluster.INSE
|
||||
cluster=ESCluster.INSE,
|
||||
)
|
||||
|
||||
lookup: dict[str, list[dict]] = {}
|
||||
lookup: dict[str, dict[str, dict]] = {}
|
||||
|
||||
for hit in response.get("hits", {}).get("hits", []):
|
||||
src = hit["_source"]
|
||||
pid = src.get("project_id")
|
||||
if pid:
|
||||
lookup[str(pid)] = src.get("topic_matches", [])
|
||||
|
||||
return lookup
|
||||
if not pid:
|
||||
continue
|
||||
|
||||
pid = str(pid)
|
||||
|
||||
if pid not in lookup:
|
||||
lookup[pid] = {}
|
||||
|
||||
for topic in src.get("topic_matches", []):
|
||||
topic_id = topic.get("topic_id")
|
||||
|
||||
if topic_id:
|
||||
lookup[pid][str(topic_id)] = topic
|
||||
|
||||
result = {
|
||||
pid: list(topics.values())
|
||||
for pid, topics in lookup.items()
|
||||
}
|
||||
|
||||
return result
|
||||
|
||||
async def get_person_institutes(
|
||||
person_ids: list[int],
|
||||
|
||||
@@ -73,7 +73,25 @@ class Page(BaseModel):
|
||||
page: int = Field(default=0, description="The current page number.")
|
||||
size: int = Field(default=20, description="The requested page size.")
|
||||
total: int = Field(default=0, description="The total number of items.")
|
||||
class BundProjectHighlight(BaseModel):
|
||||
"""Highlighted matching fragments from a BUND project search."""
|
||||
|
||||
joint_project: list[str] = Field(
|
||||
default_factory=list,
|
||||
description='Highlights from the Elasticsearch field "Verbundprojekt".',
|
||||
)
|
||||
topic: list[str] = Field(
|
||||
default_factory=list,
|
||||
description='Highlights from the Elasticsearch field "Thema".',
|
||||
)
|
||||
recipient: list[str] = Field(
|
||||
default_factory=list,
|
||||
description='Highlights from the Elasticsearch field "Zuwendungsempfänger".',
|
||||
)
|
||||
implementing_agency: list[str] = Field(
|
||||
default_factory=list,
|
||||
description='Highlights from the Elasticsearch field "Ausführende Stelle".',
|
||||
)
|
||||
class BundProjectSummary(BundProject):
|
||||
oa_topics: list[Topic] | None = Field(
|
||||
default=None,
|
||||
@@ -86,22 +104,34 @@ class BundProjectSummary(BundProject):
|
||||
description="The executing agency / recipient institution for this project, "
|
||||
"derived from the project's own agency fields.",
|
||||
)
|
||||
highlight: BundProjectHighlight | None = Field(
|
||||
default=None,
|
||||
description="Highlighted matching fragments from the project search.",
|
||||
)
|
||||
|
||||
@classmethod
|
||||
def from_hit(cls, hit: dict) -> "BundProjectSummary":
|
||||
def from_hit(cls, hit: dict[str, Any]) -> "BundProjectSummary":
|
||||
"""Create a BundProjectSummary from an Elasticsearch hit."""
|
||||
|
||||
source = hit.get("_source", {})
|
||||
|
||||
|
||||
|
||||
topics_raw = source.get("oa_topics") or []
|
||||
oa_topics = None
|
||||
if isinstance(topics_raw, list) and topics_raw:
|
||||
|
||||
if isinstance(topics_raw, list) and topics_raw:
|
||||
sorted_topics_raw = sorted(
|
||||
(t for t in topics_raw if isinstance(t, dict)),
|
||||
key=lambda t: t.get("rank") if t.get("rank") is not None else float("inf"),
|
||||
(topic for topic in topics_raw if isinstance(topic, dict)),
|
||||
key=lambda topic: (
|
||||
topic.get("rank")
|
||||
if topic.get("rank") is not None
|
||||
else float("inf")
|
||||
),
|
||||
)
|
||||
oa_topics = [cls._topic_from_match(t) for t in sorted_topics_raw]
|
||||
oa_topics = [
|
||||
cls._topic_from_match(topic)
|
||||
for topic in sorted_topics_raw
|
||||
]
|
||||
|
||||
return cls(
|
||||
funding_code=source.get("Förderkennzeichen"),
|
||||
department=source.get("Ressort"),
|
||||
@@ -119,7 +149,9 @@ class BundProjectSummary(BundProject):
|
||||
implementing_agency=source.get("Ausführende Stelle"),
|
||||
topic=source.get("Thema"),
|
||||
performance_plan_system=source.get("Leistungsplansystematik"),
|
||||
performance_plan_system_text=source.get("Klartext Leistungsplansystematik"),
|
||||
performance_plan_system_text=source.get(
|
||||
"Klartext Leistungsplansystematik"
|
||||
),
|
||||
funding_start=source.get("funding_start"),
|
||||
funding_end=source.get("funding_end"),
|
||||
grant_amount=source.get("Fördersumme"),
|
||||
@@ -133,8 +165,61 @@ class BundProjectSummary(BundProject):
|
||||
duration=source.get("Laufzeit"),
|
||||
oa_topics=oa_topics,
|
||||
institution=BundInstitutionSummary.from_source(source),
|
||||
highlight=cls._highlight_from_hit(hit),
|
||||
)
|
||||
|
||||
@staticmethod
|
||||
def _highlight_fragments(value: Any) -> list[str]:
|
||||
"""Normalize an Elasticsearch highlight value to a list of strings."""
|
||||
|
||||
if isinstance(value, str):
|
||||
return [value]
|
||||
|
||||
if isinstance(value, list):
|
||||
return [
|
||||
fragment
|
||||
for fragment in value
|
||||
if isinstance(fragment, str)
|
||||
]
|
||||
|
||||
return []
|
||||
|
||||
|
||||
@classmethod
|
||||
def _highlight_from_hit(
|
||||
cls,
|
||||
hit: dict[str, Any],
|
||||
) -> BundProjectHighlight | None:
|
||||
"""Extract BUND project highlights from an Elasticsearch hit."""
|
||||
|
||||
raw_highlight = hit.get("highlight")
|
||||
if not isinstance(raw_highlight, dict):
|
||||
return None
|
||||
|
||||
highlight = BundProjectHighlight(
|
||||
joint_project=cls._highlight_fragments(
|
||||
raw_highlight.get("Verbundprojekt")
|
||||
),
|
||||
topic=cls._highlight_fragments(
|
||||
raw_highlight.get("Thema")
|
||||
),
|
||||
recipient=cls._highlight_fragments(
|
||||
raw_highlight.get("Zuwendungsempfänger")
|
||||
),
|
||||
implementing_agency=cls._highlight_fragments(
|
||||
raw_highlight.get("Ausführende Stelle")
|
||||
),
|
||||
)
|
||||
|
||||
has_highlights = any(
|
||||
(
|
||||
highlight.joint_project,
|
||||
highlight.topic,
|
||||
highlight.recipient,
|
||||
highlight.implementing_agency,
|
||||
)
|
||||
)
|
||||
|
||||
return highlight if has_highlights else None
|
||||
@staticmethod
|
||||
def _topic_from_match(match: dict[str, Any]) -> Topic:
|
||||
"""Builds a Topic model from a flattened topic_match dict.
|
||||
@@ -163,16 +248,42 @@ class BundProjectPage(Page):
|
||||
default_factory=list, description="The bund projects on this page."
|
||||
)
|
||||
|
||||
|
||||
|
||||
|
||||
class BundProjectList(BaseModel):
|
||||
elements: list[BundProjectSummary] = Field(
|
||||
default_factory=list, description="All bund projects."
|
||||
)
|
||||
total: int = Field(default=0, description="The total number of bund projects.")
|
||||
class DfgSubjectClassificationHighlight(BaseModel):
|
||||
"""A highlighted nested subject classification."""
|
||||
|
||||
|
||||
query: str = Field(
|
||||
description="The keyword/inner_hits group which produced this match.",
|
||||
)
|
||||
|
||||
offset: int | None = Field(
|
||||
default=None,
|
||||
description="Index of the matched item in subject_classifications.",
|
||||
)
|
||||
|
||||
fach: list[str] = Field(default_factory=list)
|
||||
fachkollegium: list[str] = Field(default_factory=list)
|
||||
fachgebiet: list[str] = Field(default_factory=list)
|
||||
fachgebiet_de: list[str] = Field(default_factory=list)
|
||||
wissenschaftsbereich: list[str] = Field(default_factory=list)
|
||||
|
||||
|
||||
class DfgProjectHighlight(BaseModel):
|
||||
"""Highlighted fragments returned for a DFG project."""
|
||||
|
||||
title_de: list[str] = Field(default_factory=list)
|
||||
title_en: list[str] = Field(default_factory=list)
|
||||
|
||||
abstract_de: list[str] = Field(default_factory=list)
|
||||
abstract_en: list[str] = Field(default_factory=list)
|
||||
|
||||
subject_classifications: list[DfgSubjectClassificationHighlight] = Field(
|
||||
default_factory=list,
|
||||
)
|
||||
class DfgInstitutionSummary(BaseModel):
|
||||
"""A summary of a DFG institution."""
|
||||
id: int
|
||||
@@ -205,16 +316,22 @@ class DfgProjectSummary(BaseModel):
|
||||
description="The link to the DFG project details."
|
||||
)
|
||||
|
||||
title: str | None = Field(
|
||||
title_de: str | None = Field(
|
||||
default=None,
|
||||
description="The title of the DFG project."
|
||||
description="The title of the DFG project in German."
|
||||
)
|
||||
|
||||
professional_classification: str | None = Field(
|
||||
title_en: str | None = Field(
|
||||
default=None,
|
||||
description="The professional classification of the DFG project."
|
||||
description="The title of the DFG project in English."
|
||||
)
|
||||
|
||||
|
||||
subject_classifications_raw: str | None = Field(
|
||||
default=None,
|
||||
description="The subject classifications of the DFG project."
|
||||
)
|
||||
abstract_de: str | None = Field( default=None, description="The abstract of the DFG project in German.")
|
||||
abstract_en: str | None = Field( default=None, description="The abstract of the DFG project in English.")
|
||||
|
||||
funding_start: str | None = Field(
|
||||
default=None,
|
||||
@@ -246,11 +363,17 @@ class DfgProjectSummary(BaseModel):
|
||||
default=None,
|
||||
description="The topics associated with the DFG project.",
|
||||
)
|
||||
highlight: DfgProjectHighlight | None = Field(
|
||||
default=None,
|
||||
description="Highlighted matching fragments.",
|
||||
)
|
||||
@classmethod
|
||||
def from_hit(cls, hit: dict) -> "DfgProjectSummary":
|
||||
source = hit.get("_source", {})
|
||||
fields = hit.get("fields", {})
|
||||
|
||||
|
||||
source_id = source.get("id")
|
||||
project_id = source_id if source_id is not None else hit.get("_id", "")
|
||||
|
||||
names = []
|
||||
institutions = {}
|
||||
project_persons = []
|
||||
@@ -338,7 +461,6 @@ class DfgProjectSummary(BaseModel):
|
||||
)
|
||||
)
|
||||
topics_raw = source.get("topics") or []
|
||||
print(f"Raw topics for DFG project {hit.get('_id', '')}: {topics_raw}")
|
||||
topics = None
|
||||
if isinstance(topics_raw, list) and topics_raw:
|
||||
# Sort by rank if present, so the most relevant topic comes first
|
||||
@@ -348,34 +470,51 @@ class DfgProjectSummary(BaseModel):
|
||||
)
|
||||
topics = [cls._topic_from_match(t) for t in sorted_topics_raw]
|
||||
|
||||
|
||||
subject_classifications = source.get("subject_classifications")
|
||||
if not isinstance(subject_classifications, list):
|
||||
subject_classifications = []
|
||||
|
||||
return cls(
|
||||
id=hit.get("_id", ""),
|
||||
id=str(project_id),
|
||||
|
||||
link=source.get("link") or source.get("page_url"),
|
||||
title=(
|
||||
source.get("title")
|
||||
or source.get("title_de")
|
||||
or source.get("title_en")
|
||||
),
|
||||
professional_classification=(
|
||||
source.get("Fachliche Zuordnung")
|
||||
or source.get("subject_area_de")
|
||||
page_url=source.get("page_url"),
|
||||
|
||||
title_de=source.get("title_de"),
|
||||
title_en=source.get("title_en"),
|
||||
|
||||
abstract_de=source.get("abstract_de"),
|
||||
abstract_en=source.get("abstract_en"),
|
||||
|
||||
subject_classifications_raw=(
|
||||
source.get("subject_area_de")
|
||||
or source.get("subject_area_en")
|
||||
),
|
||||
|
||||
funding_start=(
|
||||
str(source.get("funding_start"))
|
||||
str(source["funding_start"])
|
||||
if source.get("funding_start") is not None
|
||||
else None
|
||||
),
|
||||
funding_end=(
|
||||
str(source.get("funding_end"))
|
||||
str(source["funding_end"])
|
||||
if source.get("funding_end") is not None
|
||||
else None
|
||||
),
|
||||
|
||||
institutions=list(institutions.values()),
|
||||
names=names,
|
||||
persons=project_persons,
|
||||
subject_classifications=[DFGProjectFachgebieteInner.from_dict(cls) for cls in source.get('subject_classifications', [])],
|
||||
topics=topics
|
||||
|
||||
subject_classifications=[
|
||||
DFGProjectFachgebieteInner.from_dict(classification)
|
||||
for classification in subject_classifications
|
||||
if isinstance(classification, dict)
|
||||
],
|
||||
|
||||
topics=topics or [],
|
||||
highlight=cls._highlight_from_hit(hit),
|
||||
)
|
||||
@staticmethod
|
||||
def _topic_from_match(match: dict[str, Any]) -> Topic:
|
||||
@@ -412,13 +551,146 @@ class DfgProjectSummary(BaseModel):
|
||||
field=field,
|
||||
subfield=subfield,
|
||||
)
|
||||
@staticmethod
|
||||
def _highlight_fragments(value: Any) -> list[str]:
|
||||
"""Normalize an Elasticsearch highlight value."""
|
||||
|
||||
if isinstance(value, str):
|
||||
return [value]
|
||||
|
||||
if isinstance(value, list):
|
||||
return [
|
||||
fragment
|
||||
for fragment in value
|
||||
if isinstance(fragment, str)
|
||||
]
|
||||
|
||||
return []
|
||||
|
||||
|
||||
@classmethod
|
||||
def _highlight_from_hit(
|
||||
cls,
|
||||
hit: dict[str, Any],
|
||||
) -> DfgProjectHighlight | None:
|
||||
"""Parse top-level and nested highlights from an Elasticsearch hit."""
|
||||
|
||||
raw_highlight = hit.get("highlight")
|
||||
if not isinstance(raw_highlight, dict):
|
||||
raw_highlight = {}
|
||||
|
||||
result = DfgProjectHighlight(
|
||||
title_de=cls._highlight_fragments(
|
||||
raw_highlight.get("title_de")
|
||||
),
|
||||
title_en=cls._highlight_fragments(
|
||||
raw_highlight.get("title_en")
|
||||
),
|
||||
abstract_de=cls._highlight_fragments(
|
||||
raw_highlight.get("abstract_de")
|
||||
),
|
||||
abstract_en=cls._highlight_fragments(
|
||||
raw_highlight.get("abstract_en")
|
||||
),
|
||||
)
|
||||
|
||||
raw_inner_hits = hit.get("inner_hits")
|
||||
|
||||
if isinstance(raw_inner_hits, dict):
|
||||
for query_name, inner_hit_group in raw_inner_hits.items():
|
||||
if not isinstance(inner_hit_group, dict):
|
||||
continue
|
||||
|
||||
inner_hits_block = inner_hit_group.get("hits")
|
||||
if not isinstance(inner_hits_block, dict):
|
||||
continue
|
||||
|
||||
nested_hits = inner_hits_block.get("hits", [])
|
||||
if not isinstance(nested_hits, list):
|
||||
continue
|
||||
|
||||
for nested_hit in nested_hits:
|
||||
if not isinstance(nested_hit, dict):
|
||||
continue
|
||||
|
||||
nested_highlight = nested_hit.get("highlight")
|
||||
if not isinstance(nested_highlight, dict):
|
||||
continue
|
||||
|
||||
nested_metadata = nested_hit.get("_nested")
|
||||
offset = None
|
||||
|
||||
if isinstance(nested_metadata, dict):
|
||||
raw_offset = nested_metadata.get("offset")
|
||||
if isinstance(raw_offset, int):
|
||||
offset = raw_offset
|
||||
|
||||
parsed_nested_highlight = (
|
||||
DfgSubjectClassificationHighlight(
|
||||
query=str(query_name),
|
||||
offset=offset,
|
||||
fach=cls._highlight_fragments(
|
||||
nested_highlight.get(
|
||||
"subject_classifications.fach"
|
||||
)
|
||||
),
|
||||
fachkollegium=cls._highlight_fragments(
|
||||
nested_highlight.get(
|
||||
"subject_classifications.fachkollegium"
|
||||
)
|
||||
),
|
||||
fachgebiet=cls._highlight_fragments(
|
||||
nested_highlight.get(
|
||||
"subject_classifications.fachgebiet"
|
||||
)
|
||||
),
|
||||
fachgebiet_de=cls._highlight_fragments(
|
||||
nested_highlight.get(
|
||||
"subject_classifications.fachgebiet_de"
|
||||
)
|
||||
),
|
||||
wissenschaftsbereich=cls._highlight_fragments(
|
||||
nested_highlight.get(
|
||||
"subject_classifications."
|
||||
"wissenschaftsbereich"
|
||||
)
|
||||
),
|
||||
)
|
||||
)
|
||||
|
||||
# Do not expose empty nested highlight objects.
|
||||
has_nested_fragments = any(
|
||||
(
|
||||
parsed_nested_highlight.fach,
|
||||
parsed_nested_highlight.fachkollegium,
|
||||
parsed_nested_highlight.fachgebiet,
|
||||
parsed_nested_highlight.fachgebiet_de,
|
||||
parsed_nested_highlight.wissenschaftsbereich,
|
||||
)
|
||||
)
|
||||
|
||||
if has_nested_fragments:
|
||||
result.subject_classifications.append(
|
||||
parsed_nested_highlight
|
||||
)
|
||||
|
||||
has_highlights = any(
|
||||
(
|
||||
result.title_de,
|
||||
result.title_en,
|
||||
result.abstract_de,
|
||||
result.abstract_en,
|
||||
result.subject_classifications,
|
||||
)
|
||||
)
|
||||
|
||||
return result if has_highlights else None
|
||||
|
||||
class DfgProjectPage(Page):
|
||||
elements: list[DfgProjectSummary] = Field(
|
||||
default_factory=list, description="The DFG projects on this page."
|
||||
)
|
||||
|
||||
|
||||
class InstitutionFunderSummary(BaseModel):
|
||||
type: ProjectType = Field(
|
||||
description="The type of funding data (e.g., 'bund', 'eu', 'dfg')."
|
||||
@@ -706,7 +978,20 @@ class EuCordisEurosciVocSummary(BaseModel):
|
||||
description=source.get("description"),
|
||||
path=source.get("path"),
|
||||
)
|
||||
class EuCordisProjectHighlight(BaseModel):
|
||||
"""Highlighted fragments returned by Elasticsearch."""
|
||||
|
||||
title: list[str] = Field(default_factory=list)
|
||||
acronym: list[str] = Field(default_factory=list)
|
||||
objective: list[str] = Field(default_factory=list)
|
||||
keywords: list[str] = Field(default_factory=list)
|
||||
|
||||
# Elasticsearch source/highlight field is "topics", but "topics" is already
|
||||
# used by the API model for mapped OpenAlex Topic objects.
|
||||
cordis_topic_text: list[str] = Field(
|
||||
default_factory=list,
|
||||
description="Highlighted fragments from the CORDIS topics text field.",
|
||||
)
|
||||
|
||||
class EuCordisProjectSummary(BaseModel):
|
||||
id: str
|
||||
@@ -731,7 +1016,18 @@ class EuCordisProjectSummary(BaseModel):
|
||||
cordis_topics: list[EuCordisTopicSummary] = Field(default_factory=list)
|
||||
eurosci_voc: list[EuCordisEurosciVocSummary] = Field(default_factory=list)
|
||||
topics: list[Topic] = Field(default_factory=list, description="Mapped OpenAlex topics.")
|
||||
|
||||
cordis_topic_text: str | None = Field(
|
||||
default=None,
|
||||
description=(
|
||||
"Original CORDIS topics text from the Elasticsearch project "
|
||||
"document, for example 'MSCA-IF-2018'."
|
||||
),
|
||||
)
|
||||
highlight: EuCordisProjectHighlight | None = Field(
|
||||
default=None,
|
||||
description="Highlighted matching fragments from the project search.",
|
||||
)
|
||||
@classmethod
|
||||
@classmethod
|
||||
def from_hit(
|
||||
cls,
|
||||
@@ -743,16 +1039,23 @@ class EuCordisProjectSummary(BaseModel):
|
||||
topics: list[Topic] | None = None,
|
||||
) -> "EuCordisProjectSummary":
|
||||
source = hit.get("_source", {})
|
||||
project_type = EuCordisProjectType.from_index_name(hit.get("_index", ""))
|
||||
project_type = EuCordisProjectType.from_index_name(
|
||||
hit.get("_index", "")
|
||||
)
|
||||
|
||||
project_id = source.get("id")
|
||||
if project_id is None:
|
||||
project_id = hit.get("_id", "")
|
||||
|
||||
return cls(
|
||||
id=source.get("id") or hit.get("_id", ""),
|
||||
id=str(project_id),
|
||||
project_type=project_type,
|
||||
|
||||
title=source.get("title"),
|
||||
acronym=source.get("acronym"),
|
||||
objective=source.get("objective"),
|
||||
keywords=source.get("keywords"),
|
||||
cordis_topic_text=source.get("topics"),
|
||||
|
||||
framework_programme=source.get("frameworkProgramme"),
|
||||
funding_scheme=source.get("fundingScheme"),
|
||||
@@ -764,13 +1067,71 @@ class EuCordisProjectSummary(BaseModel):
|
||||
ec_max_contribution=source.get("ecMaxContribution"),
|
||||
total_cost=source.get("totalCost"),
|
||||
|
||||
authors=authors or None,
|
||||
authors=authors,
|
||||
organizations=organizations or [],
|
||||
cordis_topics=cordis_topics or [],
|
||||
eurosci_voc=eurosci_voc or [],
|
||||
topics=topics or [],
|
||||
|
||||
highlight=cls._highlight_from_hit(hit),
|
||||
)
|
||||
@staticmethod
|
||||
def _highlight_fragments(value: Any) -> list[str]:
|
||||
"""Normalize an Elasticsearch highlight value to a list of strings."""
|
||||
|
||||
if isinstance(value, str):
|
||||
return [value]
|
||||
|
||||
if isinstance(value, list):
|
||||
return [
|
||||
fragment
|
||||
for fragment in value
|
||||
if isinstance(fragment, str)
|
||||
]
|
||||
|
||||
return []
|
||||
|
||||
|
||||
@classmethod
|
||||
def _highlight_from_hit(
|
||||
cls,
|
||||
hit: dict[str, Any],
|
||||
) -> EuCordisProjectHighlight | None:
|
||||
"""Extract project highlights from an Elasticsearch hit."""
|
||||
|
||||
raw_highlight = hit.get("highlight")
|
||||
if not isinstance(raw_highlight, dict):
|
||||
return None
|
||||
|
||||
highlight = EuCordisProjectHighlight(
|
||||
title=cls._highlight_fragments(
|
||||
raw_highlight.get("title")
|
||||
),
|
||||
acronym=cls._highlight_fragments(
|
||||
raw_highlight.get("acronym")
|
||||
),
|
||||
objective=cls._highlight_fragments(
|
||||
raw_highlight.get("objective")
|
||||
),
|
||||
keywords=cls._highlight_fragments(
|
||||
raw_highlight.get("keywords")
|
||||
),
|
||||
cordis_topic_text=cls._highlight_fragments(
|
||||
raw_highlight.get("topics")
|
||||
),
|
||||
)
|
||||
|
||||
has_highlights = any(
|
||||
(
|
||||
highlight.title,
|
||||
highlight.acronym,
|
||||
highlight.objective,
|
||||
highlight.keywords,
|
||||
highlight.cordis_topic_text,
|
||||
)
|
||||
)
|
||||
|
||||
return highlight if has_highlights else None
|
||||
@staticmethod
|
||||
def topic_from_match(match: dict[str, Any]) -> Topic:
|
||||
domain_name = match.get("domain")
|
||||
|
||||
@@ -100,7 +100,6 @@ async def search_bund_projects(
|
||||
|
||||
response = await elasticsearch.search(
|
||||
index=ESIndex.PROJECTS_BUND_V1,
|
||||
track_total_hits=True,
|
||||
query=query,
|
||||
sort=sort,
|
||||
size=filter_properties.size,
|
||||
@@ -369,6 +368,8 @@ async def search_dfg_projects(
|
||||
sort_direction: str = "asc",
|
||||
fuzzy: bool = False,
|
||||
skip_enrichment: bool = False,
|
||||
active_from_year: int | None = None,
|
||||
active_to_year: int | None = None,
|
||||
) -> DfgProjectPage:
|
||||
"""Searches for DFG projects based on the provided filtering and sorting criteria.
|
||||
|
||||
@@ -399,7 +400,6 @@ async def search_dfg_projects(
|
||||
body: dict[str, Any] = {
|
||||
"size": size,
|
||||
"from": from_,
|
||||
"track_total_hits": True,
|
||||
"_source": [
|
||||
"id",
|
||||
"link",
|
||||
@@ -407,9 +407,10 @@ async def search_dfg_projects(
|
||||
"title",
|
||||
"title_de",
|
||||
"title_en",
|
||||
"abstract_de",
|
||||
"abstract_en",
|
||||
"funding_start",
|
||||
"funding_end",
|
||||
"Fachliche Zuordnung",
|
||||
"subject_area_de",
|
||||
"subject_area_en",
|
||||
"persons",
|
||||
@@ -439,23 +440,57 @@ async def search_dfg_projects(
|
||||
if keyword.strip() == "":
|
||||
continue
|
||||
keyword_clauses.append(
|
||||
{
|
||||
"multi_match": {
|
||||
"query": keyword,
|
||||
"fields": [
|
||||
"title", "title_de", "title_en",
|
||||
"abstract_de", "abstract_en",
|
||||
"subject_area_de", "subject_area_en",
|
||||
"subject_classifications.fach",
|
||||
"subject_classifications.fachkollegium",
|
||||
"subject_classifications.fachgebiet",
|
||||
"subject_classifications.fachgebiet_de",
|
||||
"subject_classifications.wissenschaftsbereich",
|
||||
],
|
||||
"type": "phrase_prefix",
|
||||
"max_expansions": 100,
|
||||
}
|
||||
{
|
||||
"bool": {
|
||||
"should": [
|
||||
{
|
||||
"multi_match": {
|
||||
"query": keyword,
|
||||
"fields": [
|
||||
"title_de",
|
||||
"title_en",
|
||||
"abstract_de",
|
||||
"abstract_en",
|
||||
],
|
||||
"type": "phrase_prefix",
|
||||
"max_expansions": 100,
|
||||
}
|
||||
},
|
||||
{
|
||||
"nested": {
|
||||
"path": "subject_classifications",
|
||||
"query": {
|
||||
"multi_match": {
|
||||
"query": keyword,
|
||||
"fields": [
|
||||
"subject_classifications.fach",
|
||||
"subject_classifications.fachkollegium",
|
||||
"subject_classifications.fachgebiet",
|
||||
"subject_classifications.fachgebiet_de",
|
||||
"subject_classifications.wissenschaftsbereich",
|
||||
],
|
||||
"type": "phrase_prefix",
|
||||
"max_expansions": 100,
|
||||
}
|
||||
},
|
||||
"inner_hits": {
|
||||
"name": keyword,
|
||||
"highlight": {
|
||||
"fields": {
|
||||
"subject_classifications.fach": {},
|
||||
"subject_classifications.fachkollegium": {},
|
||||
"subject_classifications.fachgebiet": {},
|
||||
"subject_classifications.fachgebiet_de": {},
|
||||
"subject_classifications.wissenschaftsbereich": {},
|
||||
}
|
||||
}
|
||||
},
|
||||
}
|
||||
},
|
||||
],
|
||||
"minimum_should_match": 1,
|
||||
}
|
||||
}
|
||||
)
|
||||
if keyword_clauses:
|
||||
must_clauses.append({"bool": {"must": keyword_clauses}})
|
||||
@@ -489,6 +524,11 @@ async def search_dfg_projects(
|
||||
if funding_end_years:
|
||||
must_clauses.append({"terms": {"funding_end": funding_end_years}})
|
||||
|
||||
if active_to_year is not None:
|
||||
must_clauses.append({"range": {"funding_start": {"lte": str(active_to_year)}}})
|
||||
if active_from_year is not None:
|
||||
must_clauses.append({"range": {"funding_end": {"gte": str(active_from_year)}}})
|
||||
|
||||
if names:
|
||||
name_must_clauses = []
|
||||
for full_name in names:
|
||||
@@ -546,7 +586,7 @@ async def search_dfg_projects(
|
||||
}
|
||||
}
|
||||
)
|
||||
print("MATCHING_INSTITUTION_IDS", matching_institution_ids)
|
||||
#print("MATCHING_INSTITUTION_IDS", matching_institution_ids)
|
||||
|
||||
if institution_ids:
|
||||
#prevously we were filtering by person_ids, but now we are filtering by institution_ids directly
|
||||
@@ -598,20 +638,36 @@ async def search_dfg_projects(
|
||||
sort_config = {"id": {"order": sort_direction}}
|
||||
|
||||
body["sort"] = [sort_config]
|
||||
|
||||
#Add highlighting for the title and abstract fields
|
||||
body["highlight"] = {
|
||||
"fields": {
|
||||
"title_de": {},
|
||||
"title_en": {},
|
||||
"abstract_de": {},
|
||||
"abstract_en": {},
|
||||
},
|
||||
"pre_tags": ["<em>"],
|
||||
"post_tags": ["</em>"],
|
||||
"require_field_match": True,
|
||||
}
|
||||
# print(f"Executing DFG project search with body: {json.dumps(body, indent=2)}")
|
||||
# === Execute Search ===
|
||||
print(f"Executing DFG project search with body: {json.dumps(body, indent=2)}")
|
||||
# print(f"Executing DFG project search with body: {body}")
|
||||
response = await elasticsearch.search(
|
||||
index=ESIndex.DFG_PROJECTS,
|
||||
body=body,
|
||||
cluster=ESCluster.INSE,
|
||||
)
|
||||
|
||||
# print(f"Received DFG project search response: {response}")
|
||||
hits = response.get("hits", {}).get("hits", [])
|
||||
|
||||
if skip_enrichment:
|
||||
return _complete_response_to_dfg_project_page(response, page, size)
|
||||
|
||||
if not hits:
|
||||
return _complete_response_to_dfg_project_page(response, page, size)
|
||||
|
||||
project_ids = [hit["_source"]["id"] for hit in hits]
|
||||
topic_lookup = await get_openalex_topics_for_dfg_projects(project_ids=project_ids)
|
||||
|
||||
@@ -648,7 +704,7 @@ async def search_dfg_projects(
|
||||
# person["institute_name_en"] = institute.get("institute_name_en")
|
||||
# person["address_country_de"] = institute.get("address_country_de")
|
||||
# person["address_country_en"] = institute.get("address_country_en")
|
||||
print("ENRIECHED",source.get("institutions", []))
|
||||
|
||||
return _complete_response_to_dfg_project_page(response, page, size)
|
||||
|
||||
def _complete_response_to_dfg_project_page(
|
||||
@@ -858,6 +914,8 @@ async def search_bund_projects_with_filters(
|
||||
sort_direction: str = "asc",
|
||||
fuzzy: bool = False,
|
||||
skip_topic_enrichment: bool = False,
|
||||
active_from_year: int | None = None,
|
||||
active_to_year: int | None = None,
|
||||
) -> BundProjectPage:
|
||||
"""
|
||||
Main search function for BUND projects, analogous to the DFG search.
|
||||
@@ -999,6 +1057,15 @@ async def search_bund_projects_with_filters(
|
||||
if funding_end_years:
|
||||
must_clauses.append(_bund_year_filters("funding_end", funding_end_years))
|
||||
|
||||
if active_to_year is not None:
|
||||
must_clauses.append(
|
||||
{"range": {"funding_start": {"lte": f"31.12.{active_to_year}"}}}
|
||||
)
|
||||
if active_from_year is not None:
|
||||
must_clauses.append(
|
||||
{"range": {"funding_end": {"gte": f"01.01.{active_from_year}"}}}
|
||||
)
|
||||
|
||||
body["query"] = {"bool": {"must": must_clauses}} if must_clauses else {"match_all": {}}
|
||||
# === Sorting ===
|
||||
sort_by = sort_by.strip().lower()
|
||||
@@ -1017,13 +1084,24 @@ async def search_bund_projects_with_filters(
|
||||
sort_config = {"Förderkennzeichen.keyword": {"order": sort_direction}}
|
||||
|
||||
body["sort"] = [sort_config]
|
||||
#Add highlighting for the title and abstract fields
|
||||
body["highlight"] = {
|
||||
"fields": {
|
||||
"Verbundprojekt": {},
|
||||
"Thema": {},
|
||||
"Zuwendungsempfänger": {},
|
||||
"Ausführende Stelle": {},
|
||||
},
|
||||
"pre_tags": ["<em>"],
|
||||
"post_tags": ["</em>"],
|
||||
"require_field_match": True,
|
||||
}
|
||||
# print(f"Executing BUND project search with body: {json.dumps(body, indent=2)}")
|
||||
# === Execute Search ===
|
||||
response = await elasticsearch.search(
|
||||
index=ESIndex.PROJECTS_BUND_V1,
|
||||
body=body,
|
||||
cluster=ESCluster.INSE,
|
||||
track_total_hits=True,
|
||||
)
|
||||
|
||||
hits = response.get("hits", {}).get("hits", [])
|
||||
@@ -1151,6 +1229,7 @@ async def search_all_projects(
|
||||
page = projects_filtering_properties.page
|
||||
offset = page * size
|
||||
response = await elasticsearch.search(
|
||||
|
||||
index=index,
|
||||
size=size,
|
||||
offset=offset,
|
||||
|
||||
@@ -7,9 +7,6 @@ from inse.auth.service import CurrentUserAccessTokenPayloadDep
|
||||
from inse.institutions.institutions_search_client import (
|
||||
InstitutionsSearchClient,
|
||||
)
|
||||
from inse.projects.logic import (
|
||||
is_projects_access_forbidden
|
||||
)
|
||||
from inse.institutions.router import get_institutions_search_client
|
||||
from inse.models.bund_project_details import BundProjectDetails
|
||||
from inse.models.dfg_project_details import DfgProjectDetails
|
||||
@@ -33,6 +30,7 @@ from inse.projects.model import (
|
||||
SortDirection,
|
||||
)
|
||||
from inse.tags import Tags
|
||||
from inse.auth.service import can_fetch_gdpr_relevant_data
|
||||
from fastapi import HTTPException as HttpException
|
||||
|
||||
logger = logging.getLogger(__name__)
|
||||
@@ -146,12 +144,13 @@ async def get_dfg_projects(
|
||||
sort_direction,
|
||||
fuzzy,
|
||||
)
|
||||
is_forbidden = await is_projects_access_forbidden(access_token_metadata, raw_oa_institution_id, author_id)
|
||||
if is_forbidden:
|
||||
raise HttpException(
|
||||
status_code=403,
|
||||
detail="Access denied for the provided author ID or institution ID",
|
||||
)
|
||||
if (author_id or raw_oa_institution_id):
|
||||
is_allowed = await can_fetch_gdpr_relevant_data(access_token = access_token_metadata, raw_oa_author_id = author_id, raw_oa_institution_id = raw_oa_institution_id)
|
||||
if not is_allowed:
|
||||
raise HttpException(
|
||||
status_code=403,
|
||||
detail="Access denied for the provided author ID or institution ID",
|
||||
)
|
||||
return await projects_service.get_dfg_projects(
|
||||
institutions_search_client=institutions_search_client,
|
||||
raw_oa_institution_id=raw_oa_institution_id,
|
||||
@@ -266,14 +265,14 @@ async def search_bund_projects(
|
||||
Query(description="Use OpenAlex topic-id resolution if true, otherwise raw keyword search."),
|
||||
] = False,
|
||||
) -> BundProjectPage:
|
||||
is_forbidden = await is_projects_access_forbidden(access_token_metadata, raw_oa_institution_id, None)
|
||||
if is_forbidden:
|
||||
raise HttpException(
|
||||
status_code=403,
|
||||
detail="Access denied for the provided author ID or institution ID",
|
||||
)
|
||||
if (raw_oa_institution_id):
|
||||
is_allowed = await can_fetch_gdpr_relevant_data(access_token = access_token_metadata, raw_oa_author_id = None, raw_oa_institution_id = raw_oa_institution_id)
|
||||
if not is_allowed:
|
||||
raise HttpException(
|
||||
status_code=403,
|
||||
detail="Access denied for the provided author ID or institution ID",
|
||||
)
|
||||
return await projects_service.search_bund_projects_with_filters(
|
||||
access_token_metadata=access_token_metadata,
|
||||
institutions_search_client=institutions_search_client,
|
||||
executing_agency=executing_agency,
|
||||
funding_arts=funding_arts,
|
||||
@@ -451,12 +450,13 @@ async def search_eu_cordis_projects_endpoint(
|
||||
sort_direction,
|
||||
fuzzy,
|
||||
)
|
||||
is_forbidden = await is_projects_access_forbidden(access_token_metadata, raw_oa_institution_id, author_id)
|
||||
if is_forbidden:
|
||||
raise HttpException(
|
||||
status_code=403,
|
||||
detail="Access denied for the provided author ID or institution ID",
|
||||
)
|
||||
if (author_id or raw_oa_institution_id):
|
||||
is_allowed = await can_fetch_gdpr_relevant_data(access_token = access_token_metadata, raw_oa_author_id = author_id, raw_oa_institution_id = raw_oa_institution_id)
|
||||
if not is_allowed:
|
||||
raise HttpException(
|
||||
status_code=403,
|
||||
detail="Access denied for the provided author ID or institution ID",
|
||||
)
|
||||
return await search_eu_cordis_projects(
|
||||
institutions_search_client=institutions_search_client,
|
||||
raw_oa_institution_id=raw_oa_institution_id,
|
||||
|
||||
@@ -188,6 +188,8 @@ async def get_dfg_projects(
|
||||
sort_direction: str = "asc",
|
||||
fuzzy: bool = False,
|
||||
skip_enrichment: bool = False,
|
||||
active_from_year: int | None = None,
|
||||
active_to_year: int | None = None,
|
||||
) -> DfgProjectPage:
|
||||
logger.debug(
|
||||
"Fetching DFG projects for author_id=%s, author_filter_ids=%s, "
|
||||
@@ -284,6 +286,8 @@ async def get_dfg_projects(
|
||||
sort_direction=sort_direction,
|
||||
fuzzy=fuzzy,
|
||||
skip_enrichment=skip_enrichment,
|
||||
active_from_year=active_from_year,
|
||||
active_to_year=active_to_year,
|
||||
)
|
||||
|
||||
async def get_institution_cordis_eu_projects_funding_over_time(
|
||||
@@ -459,6 +463,8 @@ async def search_bund_projects_with_filters(
|
||||
sort_by: str = "title",
|
||||
sort_direction: str = "asc",
|
||||
fuzzy: bool = False,
|
||||
active_from_year: int | None = None,
|
||||
active_to_year: int | None = None,
|
||||
) -> BundProjectPage:
|
||||
institution_aliases = []
|
||||
if raw_oa_institution_id:
|
||||
@@ -494,7 +500,9 @@ async def search_bund_projects_with_filters(
|
||||
size=size,
|
||||
sort_by=sort_by,
|
||||
sort_direction=sort_direction,
|
||||
fuzzy=fuzzy
|
||||
fuzzy=fuzzy,
|
||||
active_from_year=active_from_year,
|
||||
active_to_year=active_to_year,
|
||||
)
|
||||
|
||||
def _calculate_funding_over_time(
|
||||
@@ -656,6 +664,8 @@ async def search_eu_cordis_projects(
|
||||
title: str | None = None,
|
||||
funding_start_years: list[str] | None = None,
|
||||
funding_end_years: list[str] | None = None,
|
||||
active_from_year: int | None = None,
|
||||
active_to_year: int | None = None,
|
||||
countries: list[str] | None = None,
|
||||
framework_programmes: list[str] | None = None,
|
||||
funding_schemes: list[str] | None = None,
|
||||
@@ -716,6 +726,8 @@ async def search_eu_cordis_projects(
|
||||
title=title,
|
||||
funding_start_years=funding_start_years,
|
||||
funding_end_years=funding_end_years,
|
||||
active_from_year=active_from_year,
|
||||
active_to_year=active_to_year,
|
||||
countries=countries,
|
||||
framework_programmes=framework_programmes,
|
||||
funding_schemes=funding_schemes,
|
||||
|
||||
@@ -2,6 +2,21 @@ import pytest
|
||||
from inse.projects import eu_cordis_projects_client as eu_cordis_search_client
|
||||
|
||||
|
||||
@pytest.mark.anyio
|
||||
async def test_active_period_filter_matches_projects_overlapping_interval():
|
||||
query, _, _ = await eu_cordis_search_client._build_eu_cordis_search_query(
|
||||
active_from_year=2022,
|
||||
active_to_year=2026,
|
||||
)
|
||||
|
||||
assert {"range": {"startDate": {"lte": "2026-12-31"}}} in query["bool"][
|
||||
"must"
|
||||
]
|
||||
assert {"range": {"endDate": {"gte": "2022-01-01"}}} in query["bool"][
|
||||
"must"
|
||||
]
|
||||
|
||||
|
||||
@pytest.mark.anyio
|
||||
async def test_search_eu_cordis_projects_by_title():
|
||||
"""Test searching EU CORDIS projects by title."""
|
||||
@@ -362,4 +377,4 @@ async def test_search_eu_cordis_projects_with_fuzzy_topic_search():
|
||||
# Note: This may return 0 results if the topic ID doesn't exist
|
||||
# The important thing is that it doesn't crash
|
||||
assert isinstance(res.total, int)
|
||||
assert isinstance(res.elements, list)
|
||||
assert isinstance(res.elements, list)
|
||||
|
||||
@@ -1,4 +1,7 @@
|
||||
from unittest.mock import AsyncMock, patch
|
||||
|
||||
import pytest
|
||||
|
||||
from inse.projects import projects_search_client
|
||||
|
||||
|
||||
@@ -20,6 +23,33 @@ async def test_search_dfg_projects():
|
||||
for name in element.names
|
||||
)
|
||||
|
||||
|
||||
@pytest.mark.anyio
|
||||
async def test_search_dfg_projects_returns_empty_page_without_enrichment_crash():
|
||||
response = {
|
||||
"hits": {
|
||||
"total": {"value": 0},
|
||||
"hits": [],
|
||||
}
|
||||
}
|
||||
with patch(
|
||||
"inse.projects.projects_search_client.elasticsearch.search",
|
||||
new=AsyncMock(return_value=response),
|
||||
) as mocked_search:
|
||||
result = await projects_search_client.search_dfg_projects(
|
||||
page=0,
|
||||
size=1,
|
||||
funding_start_years=["2022"],
|
||||
funding_end_years=["2026"],
|
||||
)
|
||||
|
||||
assert result.total == 0
|
||||
assert result.elements == []
|
||||
query = mocked_search.await_args.kwargs["body"]["query"]
|
||||
assert {"terms": {"funding_start": ["2022"]}} in query["bool"]["must"]
|
||||
assert {"terms": {"funding_end": ["2026"]}} in query["bool"]["must"]
|
||||
|
||||
|
||||
@pytest.mark.anyio
|
||||
async def test_get_dfg_project_by_id():
|
||||
# Get by ID of the project we found or a known one
|
||||
|
||||
@@ -24,10 +24,14 @@ from .model import (
|
||||
FilterType,
|
||||
KeywordOperator,
|
||||
PublicationType,
|
||||
PublicationTypeCount,
|
||||
RankedAuthor,
|
||||
RankingWeights,
|
||||
SubfieldShare,
|
||||
Timespan,
|
||||
FieldNode,
|
||||
SubfieldNode,
|
||||
TopicNode,
|
||||
)
|
||||
|
||||
logger = logging.getLogger(__name__)
|
||||
@@ -487,6 +491,49 @@ def _topic_profile_query(
|
||||
"size": 10,
|
||||
},
|
||||
},
|
||||
# topic treemap
|
||||
"by_field": {
|
||||
"terms": {
|
||||
"field": "primary_topic.field.id",
|
||||
"size": 30,
|
||||
},
|
||||
"aggs": {
|
||||
"field_name": {
|
||||
"terms": {
|
||||
"field": "primary_topic.field.display_name.keyword",
|
||||
"size": 1,
|
||||
},
|
||||
},
|
||||
"by_subfield": {
|
||||
"terms": {
|
||||
"field": "primary_topic.subfield.id",
|
||||
"size": 30,
|
||||
},
|
||||
"aggs": {
|
||||
"subfield_name": {
|
||||
"terms": {
|
||||
"field": "primary_topic.subfield.display_name.keyword",
|
||||
"size": 1,
|
||||
},
|
||||
},
|
||||
"by_topic": {
|
||||
"terms": {
|
||||
"field": "primary_topic.id",
|
||||
"size": 30,
|
||||
},
|
||||
"aggs": {
|
||||
"topic_name": {
|
||||
"terms": {
|
||||
"field": "primary_topic.display_name.keyword",
|
||||
"size": 1,
|
||||
},
|
||||
},
|
||||
},
|
||||
},
|
||||
},
|
||||
},
|
||||
},
|
||||
},
|
||||
"distinct_topics": {
|
||||
"cardinality": {"field": "primary_topic.id"},
|
||||
},
|
||||
@@ -549,6 +596,30 @@ async def topic_profile_for_authors(
|
||||
)
|
||||
for bucket in to_work.get("by_subfield", {}).get("buckets", [])
|
||||
]
|
||||
field_tree = [
|
||||
FieldNode(
|
||||
id=field_bucket.get("key", ""),
|
||||
name=_bucket_name(field_bucket, "field_name", field_bucket.get("key", "")),
|
||||
count=field_bucket.get("doc_count", 0),
|
||||
subfields=[
|
||||
SubfieldNode(
|
||||
id=subfield_bucket.get("key", ""),
|
||||
name=_bucket_name(subfield_bucket, "subfield_name", subfield_bucket.get("key", "")),
|
||||
count=subfield_bucket.get("doc_count", 0),
|
||||
topics=[
|
||||
TopicNode(
|
||||
id=topic_bucket.get("key", ""),
|
||||
name=_bucket_name(topic_bucket, "topic_name", topic_bucket.get("key", "")),
|
||||
count=topic_bucket.get("doc_count", 0),
|
||||
)
|
||||
for topic_bucket in subfield_bucket.get("by_topic", {}).get("buckets", [])
|
||||
],
|
||||
)
|
||||
for subfield_bucket in field_bucket.get("by_subfield", {}).get("buckets", [])
|
||||
],
|
||||
)
|
||||
for field_bucket in to_work.get("by_field", {}).get("buckets", [])
|
||||
]
|
||||
results.append(
|
||||
AuthorTopicProfile(
|
||||
author_id=author_bucket.get("key", ""),
|
||||
@@ -560,6 +631,7 @@ async def topic_profile_for_authors(
|
||||
distinct_subfields=to_work.get("distinct_subfields", {}).get("value", 0),
|
||||
distinct_fields=to_work.get("distinct_fields", {}).get("value", 0),
|
||||
subfields=subfields,
|
||||
field_tree=field_tree,
|
||||
)
|
||||
)
|
||||
|
||||
@@ -717,6 +789,84 @@ def _build_query(
|
||||
}
|
||||
|
||||
|
||||
def _build_publication_type_counts_query(
|
||||
keywords: list[str],
|
||||
operator: KeywordOperator,
|
||||
author_ids: list[str],
|
||||
timespan: Timespan | None,
|
||||
config: MatchConfig = _KEYWORD_MATCH,
|
||||
) -> dict:
|
||||
"""Builds the query that counts matching works per publication type.
|
||||
|
||||
Mirrors _build_query's work filters but leaves out the publication_types
|
||||
filter itself, since it aggregates over all types instead of one score.
|
||||
"""
|
||||
work_filters = [
|
||||
_build_keyword_query(keywords, operator, config),
|
||||
_author_filter(author_ids),
|
||||
]
|
||||
if timespan is not None:
|
||||
work_filters.append(_timespan_filter(timespan))
|
||||
|
||||
return {
|
||||
"size": 0,
|
||||
"query": {
|
||||
"bool": {
|
||||
"filter": work_filters,
|
||||
},
|
||||
},
|
||||
"aggs": {
|
||||
"by_type": {
|
||||
"terms": {
|
||||
"field": "type",
|
||||
"size": len(PublicationType),
|
||||
},
|
||||
},
|
||||
},
|
||||
}
|
||||
|
||||
|
||||
async def publication_type_counts_for_keywords(
|
||||
keywords: list[str],
|
||||
operator: KeywordOperator,
|
||||
institution_id: str,
|
||||
career_stages: list[CareerStage],
|
||||
timespan: Timespan | None,
|
||||
filter_type: FilterType = FilterType.KEYWORD,
|
||||
) -> list[PublicationTypeCount]:
|
||||
"""Counts the university's matching works per publication type, largest first."""
|
||||
author_ids = await _get_author_ids_from_institution(institution_id)
|
||||
|
||||
if not author_ids:
|
||||
return []
|
||||
|
||||
if career_stages:
|
||||
author_ids = await _filter_author_ids_by_career_stage(author_ids, career_stages)
|
||||
|
||||
query_body = _build_publication_type_counts_query(
|
||||
keywords, operator, author_ids, timespan, _match_config(filter_type),
|
||||
)
|
||||
|
||||
response: dict[str, Any] = await elasticsearch.search(
|
||||
index=config.settings.openalex_works_search_index,
|
||||
body=query_body,
|
||||
cluster=ESCluster.NES,
|
||||
)
|
||||
|
||||
type_buckets = response.get("aggregations", {}).get("by_type", {}).get("buckets", [])
|
||||
|
||||
counts = []
|
||||
for bucket in type_buckets:
|
||||
try:
|
||||
publication_type = PublicationType(bucket["key"])
|
||||
except ValueError:
|
||||
continue
|
||||
counts.append(PublicationTypeCount(type=publication_type, count=bucket["doc_count"]))
|
||||
|
||||
counts.sort(key=lambda c: c.count, reverse=True)
|
||||
return counts
|
||||
|
||||
|
||||
def _display_name_from_bucket(author_bucket: dict) -> str:
|
||||
"""Reads the authors display name out of the name sub-aggregation."""
|
||||
name_buckets = author_bucket.get("author_name", {}).get("buckets", [])
|
||||
@@ -725,6 +875,14 @@ def _display_name_from_bucket(author_bucket: dict) -> str:
|
||||
return ""
|
||||
|
||||
|
||||
def _bucket_name(bucket: dict, name_agg_key: str, fallback: str) -> str:
|
||||
"""Reads a display name out of a bucket's name sub-aggregation, falling back to its id."""
|
||||
name_buckets = bucket.get(name_agg_key, {}).get("buckets", [])
|
||||
if name_buckets and name_buckets[0].get("key"):
|
||||
return str(name_buckets[0]["key"])
|
||||
return fallback
|
||||
|
||||
|
||||
def _citations_from_bucket(author_bucket: dict) -> int:
|
||||
"""Reads the summed citations out of the reverse_nested sub-aggregation."""
|
||||
citations_value = (
|
||||
|
||||
@@ -195,6 +195,42 @@ class AuthorMetricsRequest(BaseModel):
|
||||
)
|
||||
|
||||
|
||||
class PublicationTypeCountsRequest(BaseModel):
|
||||
keywords: list[str] = Field(
|
||||
min_length=1,
|
||||
description="One or more keywords to match works against.",
|
||||
)
|
||||
operator: KeywordOperator = Field(
|
||||
default=KeywordOperator.AND,
|
||||
description="How to combine the keywords: 'and' or 'or'. Defaults to 'and'.",
|
||||
)
|
||||
filter_type: FilterType = Field(
|
||||
default=FilterType.KEYWORD,
|
||||
description="What the 'keywords' values match against: 'keyword' (OpenAlex "
|
||||
"keyword display names) or 'topic' (OpenAlex topic display names). Defaults to 'keyword'.",
|
||||
)
|
||||
career_stages: list[CareerStage] = Field(
|
||||
default_factory=list,
|
||||
description="Optional filter: only count works of authors in one of these career stages. Empty = no filter.",
|
||||
)
|
||||
timespan: Timespan | None = Field(
|
||||
default=None,
|
||||
description="Optional filter: only count works whose publication_year is within [from, to].",
|
||||
)
|
||||
|
||||
@field_validator("operator", "filter_type", mode="before")
|
||||
@classmethod
|
||||
def operator_case_insensitive(cls, value):
|
||||
if isinstance(value, str):
|
||||
return value.lower()
|
||||
return value
|
||||
|
||||
|
||||
class PublicationTypeCount(BaseModel):
|
||||
type: PublicationType = Field(description="The OpenAlex work type.")
|
||||
count: int = Field(description="Number of matching works of this type.")
|
||||
|
||||
|
||||
class AuthorTopicStats(BaseModel):
|
||||
"""Section 1: combined stats over an author's works that match the topic filter."""
|
||||
|
||||
@@ -282,6 +318,32 @@ class SubfieldShare(BaseModel):
|
||||
count: int = Field(description="Number of works whose primary topic belongs to this subfield.")
|
||||
|
||||
|
||||
class TopicNode(BaseModel):
|
||||
id: str = Field(description="The OpenAlex ID of the primary topic.")
|
||||
name: str = Field(description="The primary-topic display name.")
|
||||
count: int = Field(description="Number of works whose primary topic is this topic.")
|
||||
|
||||
|
||||
class SubfieldNode(BaseModel):
|
||||
id: str = Field(description="The OpenAlex ID of the subfield.")
|
||||
name: str = Field(description="The subfield display name.")
|
||||
count: int = Field(description="Number of works whose primary topic belongs to this subfield.")
|
||||
topics: list[TopicNode] = Field(
|
||||
default_factory=list,
|
||||
description="Primary topics within this subfield, largest first.",
|
||||
)
|
||||
|
||||
|
||||
class FieldNode(BaseModel):
|
||||
id: str = Field(description="The OpenAlex ID of the field.")
|
||||
name: str = Field(description="The field display name.")
|
||||
count: int = Field(description="Number of works whose primary topic belongs to this field.")
|
||||
subfields: list[SubfieldNode] = Field(
|
||||
default_factory=list,
|
||||
description="Subfields within this field, largest first.",
|
||||
)
|
||||
|
||||
|
||||
class AuthorTopicProfile(BaseModel):
|
||||
author_id: str = Field(description="The OpenAlex ID of the author.")
|
||||
display_name: str = Field(description="The name of the author.")
|
||||
@@ -308,6 +370,11 @@ class AuthorTopicProfile(BaseModel):
|
||||
default_factory=list,
|
||||
description="Top subfields over all works, by primary topic, largest first.",
|
||||
)
|
||||
field_tree: list[FieldNode] = Field(
|
||||
default_factory=list,
|
||||
description="Field -> subfield -> topic hierarchy over all works, by primary "
|
||||
"topic, each level largest first. Drives the interactive topic treemap.",
|
||||
)
|
||||
|
||||
|
||||
class AuthorStaticStats(BaseModel):
|
||||
|
||||
@@ -116,6 +116,16 @@ Content-Type: application/json
|
||||
"timespan": { "from": 2018, "to": 2025 }
|
||||
}
|
||||
|
||||
###
|
||||
POST http://localhost:8000/api/rank/topic-profile
|
||||
Content-Type: application/json
|
||||
|
||||
{
|
||||
"author_ids": ["https://openalex.org/A504035360", "https://openalex.org/A5019137844"],
|
||||
"keywords": ["Augmented Reality Applications"],
|
||||
"operator": "or"
|
||||
}
|
||||
|
||||
###
|
||||
GET https://project.nes.uni-due.de/elastic/_aliases
|
||||
Authorization: ApiKey am1wWXBaMEJEVWJoZkE5MnBaUlk6TWlvbW1LRlMzNjdDUHgzYmVkUmI5UQ==
|
||||
|
||||
@@ -14,6 +14,8 @@ from .model import (
|
||||
AuthorTopicProfile,
|
||||
AuthorTopicStats,
|
||||
KeywordToAuthorRequest,
|
||||
PublicationTypeCount,
|
||||
PublicationTypeCountsRequest,
|
||||
RankedAuthor,
|
||||
SelectedAuthorsRequest,
|
||||
)
|
||||
@@ -68,6 +70,40 @@ async def rank_author(
|
||||
filter_type=request.filter_type,
|
||||
)
|
||||
|
||||
# Publication-type facet counts for the "Art der Work" filter
|
||||
@router.post("/publication-type-counts", response_model=list[PublicationTypeCount])
|
||||
async def publication_type_counts(
|
||||
request: PublicationTypeCountsRequest,
|
||||
access_token_metadata: Annotated[
|
||||
AccessTokenMetadata, CurrentUserAccessTokenPayloadDep
|
||||
],
|
||||
):
|
||||
institution_id = access_token_metadata.effective_institution_id
|
||||
if not institution_id:
|
||||
raise HTTPException(
|
||||
status_code=status.HTTP_403_FORBIDDEN,
|
||||
detail="No OpenAlex institution is assigned to the current organization.",
|
||||
)
|
||||
|
||||
logger.info(
|
||||
"publication-type-counts keywords=%s operator=%s filter_type=%s institution_id=%s "
|
||||
"career_stages=%s timespan=%s",
|
||||
request.keywords,
|
||||
request.operator,
|
||||
request.filter_type,
|
||||
institution_id,
|
||||
request.career_stages,
|
||||
request.timespan,
|
||||
)
|
||||
return await logic.publication_type_counts_for_keywords(
|
||||
keywords=request.keywords,
|
||||
operator=request.operator,
|
||||
institution_id=institution_id,
|
||||
career_stages=request.career_stages,
|
||||
timespan=request.timespan,
|
||||
filter_type=request.filter_type,
|
||||
)
|
||||
|
||||
# Compare authors table 1 (topic stats)
|
||||
@router.post("/topic-stats", response_model=list[AuthorTopicStats])
|
||||
async def topic_stats(request: SelectedAuthorsRequest):
|
||||
|
||||
@@ -4,6 +4,9 @@ from typing import Annotated
|
||||
import inse.topics.v2.service as topics_service
|
||||
from fastapi import APIRouter, Path, Query
|
||||
from inse.model import SortDirection
|
||||
from inse.models.openalex.domain import Domain
|
||||
from inse.models.openalex.model_field import ModelField
|
||||
from inse.models.openalex.subfield import Subfield
|
||||
from inse.models.openalex.topic import Topic
|
||||
from inse.router_prefixes import RouterPrefixes
|
||||
from inse.tags import Tags
|
||||
@@ -78,6 +81,48 @@ async def get_topic_by_id(
|
||||
)
|
||||
|
||||
|
||||
@router.get(
|
||||
"/domains/single/{domain_id}",
|
||||
operation_id="getDomainById",
|
||||
summary="Returns a domain for a given domain ID.",
|
||||
)
|
||||
async def get_domain_by_id(
|
||||
domain_id: Annotated[
|
||||
str,
|
||||
Path(description="The ID of the domain to retrieve."),
|
||||
],
|
||||
) -> Domain:
|
||||
return await topics_service.get_domain_by_id_or_raise(domain_id=domain_id)
|
||||
|
||||
|
||||
@router.get(
|
||||
"/fields/single/{field_id}",
|
||||
operation_id="getFieldById",
|
||||
summary="Returns a field for a given field ID.",
|
||||
)
|
||||
async def get_field_by_id(
|
||||
field_id: Annotated[
|
||||
str,
|
||||
Path(description="The ID of the field to retrieve."),
|
||||
],
|
||||
) -> ModelField:
|
||||
return await topics_service.get_field_by_id_or_raise(field_id=field_id)
|
||||
|
||||
|
||||
@router.get(
|
||||
"/subfields/single/{subfield_id}",
|
||||
operation_id="getSubfieldById",
|
||||
summary="Returns a subfield for a given subfield ID.",
|
||||
)
|
||||
async def get_subfield_by_id(
|
||||
subfield_id: Annotated[
|
||||
str,
|
||||
Path(description="The ID of the subfield to retrieve."),
|
||||
],
|
||||
) -> Subfield:
|
||||
return await topics_service.get_subfield_by_id_or_raise(subfield_id=subfield_id)
|
||||
|
||||
|
||||
@router.get(
|
||||
"/topics/id",
|
||||
operation_id="getTopicsByIds",
|
||||
|
||||
@@ -1,6 +1,9 @@
|
||||
from inse.exceptions import NotFoundException
|
||||
from inse.integrations import elasticsearch
|
||||
from inse.model import ESIndex, SortDirection
|
||||
from inse.models.openalex.domain import Domain
|
||||
from inse.models.openalex.model_field import ModelField
|
||||
from inse.models.openalex.subfield import Subfield
|
||||
from inse.models.openalex.topic import Topic
|
||||
from inse.topics.v2.model import TopicPageV2, TopicSortBy
|
||||
|
||||
@@ -184,6 +187,117 @@ async def get_topic_by_id_or_raise(raw_oa_topic_id: str) -> Topic:
|
||||
return topic
|
||||
|
||||
|
||||
async def get_domain_by_id(domain_id: str) -> Domain | None:
|
||||
"""Retrieves a domain based on its ID.
|
||||
|
||||
Args:
|
||||
domain_id (str): The numeric OpenAlex ID of the domain to retrieve (e.g. "4").
|
||||
|
||||
Returns:
|
||||
Domain | None: The domain matching the provided ID, or None if not found.
|
||||
"""
|
||||
response = await elasticsearch.get(
|
||||
index=ESIndex.OPENALEX_DOMAINS,
|
||||
doc_id=domain_id,
|
||||
source=["id", "display_name", "description"],
|
||||
)
|
||||
if response.get("found"):
|
||||
return Domain.from_dict(response.get("_source", {}))
|
||||
return None
|
||||
|
||||
|
||||
async def get_domain_by_id_or_raise(domain_id: str) -> Domain:
|
||||
"""Retrieves a domain based on its ID, raising an exception if not found.
|
||||
|
||||
Args:
|
||||
domain_id (str): The ID of the domain to retrieve.
|
||||
|
||||
Raises:
|
||||
NotFoundException: If the domain with the specified ID is not found.
|
||||
|
||||
Returns:
|
||||
Domain: The domain matching the provided ID.
|
||||
"""
|
||||
domain = await get_domain_by_id(domain_id)
|
||||
if domain is None:
|
||||
raise NotFoundException(f"Domain with ID {domain_id} not found.")
|
||||
return domain
|
||||
|
||||
|
||||
async def get_field_by_id(field_id: str) -> ModelField | None:
|
||||
"""Retrieves a field based on its ID.
|
||||
|
||||
Args:
|
||||
field_id (str): The numeric OpenAlex ID of the field to retrieve (e.g. "27").
|
||||
|
||||
Returns:
|
||||
ModelField | None: The field matching the provided ID, or None if not found.
|
||||
"""
|
||||
response = await elasticsearch.get(
|
||||
index=ESIndex.OPENALEX_FIELDS,
|
||||
doc_id=field_id,
|
||||
source=["id", "display_name", "description"],
|
||||
)
|
||||
if response.get("found"):
|
||||
return ModelField.from_dict(response.get("_source", {}))
|
||||
return None
|
||||
|
||||
|
||||
async def get_field_by_id_or_raise(field_id: str) -> ModelField:
|
||||
"""Retrieves a field based on its ID, raising an exception if not found.
|
||||
|
||||
Args:
|
||||
field_id (str): The ID of the field to retrieve.
|
||||
|
||||
Raises:
|
||||
NotFoundException: If the field with the specified ID is not found.
|
||||
|
||||
Returns:
|
||||
ModelField: The field matching the provided ID.
|
||||
"""
|
||||
field = await get_field_by_id(field_id)
|
||||
if field is None:
|
||||
raise NotFoundException(f"Field with ID {field_id} not found.")
|
||||
return field
|
||||
|
||||
|
||||
async def get_subfield_by_id(subfield_id: str) -> Subfield | None:
|
||||
"""Retrieves a subfield based on its ID.
|
||||
|
||||
Args:
|
||||
subfield_id (str): The numeric OpenAlex ID of the subfield to retrieve (e.g. "2743").
|
||||
|
||||
Returns:
|
||||
Subfield | None: The subfield matching the provided ID, or None if not found.
|
||||
"""
|
||||
response = await elasticsearch.get(
|
||||
index=ESIndex.OPENALEX_SUBFIELDS,
|
||||
doc_id=subfield_id,
|
||||
source=["id", "display_name", "description"],
|
||||
)
|
||||
if response.get("found"):
|
||||
return Subfield.from_dict(response.get("_source", {}))
|
||||
return None
|
||||
|
||||
|
||||
async def get_subfield_by_id_or_raise(subfield_id: str) -> Subfield:
|
||||
"""Retrieves a subfield based on its ID, raising an exception if not found.
|
||||
|
||||
Args:
|
||||
subfield_id (str): The ID of the subfield to retrieve.
|
||||
|
||||
Raises:
|
||||
NotFoundException: If the subfield with the specified ID is not found.
|
||||
|
||||
Returns:
|
||||
Subfield: The subfield matching the provided ID.
|
||||
"""
|
||||
subfield = await get_subfield_by_id(subfield_id)
|
||||
if subfield is None:
|
||||
raise NotFoundException(f"Subfield with ID {subfield_id} not found.")
|
||||
return subfield
|
||||
|
||||
|
||||
async def get_topics_by_ids(topic_ids: list[str]) -> TopicPageV2:
|
||||
"""Retrieves topics based on a list of topic IDs.
|
||||
|
||||
|
||||
@@ -73,8 +73,10 @@ model/bodyResetPassword.ts
|
||||
model/bundInstitutionSummary.ts
|
||||
model/bundInstitutionSummaryPage.ts
|
||||
model/bundProjectDetails.ts
|
||||
model/bundProjectHighlight.ts
|
||||
model/bundProjectPage.ts
|
||||
model/bundProjectSummary.ts
|
||||
model/bundProjectTopics.ts
|
||||
model/careerMetrics.ts
|
||||
model/careerStage.ts
|
||||
model/collaborationGraph.ts
|
||||
@@ -102,6 +104,7 @@ model/dfgInstitutionSummaryPage.ts
|
||||
model/dfgPersonSummary.ts
|
||||
model/dfgPersonSummaryPage.ts
|
||||
model/dfgProjectDetails.ts
|
||||
model/dfgProjectHighlight.ts
|
||||
model/dfgProjectInstitutionRole.ts
|
||||
model/dfgProjectKeyword.ts
|
||||
model/dfgProjectPage.ts
|
||||
@@ -112,12 +115,17 @@ model/dfgProjectSubprojectSummary.ts
|
||||
model/dfgProjectSummary.ts
|
||||
model/dfgProjectTopic.ts
|
||||
model/dfgProjectTopics.ts
|
||||
model/dfgSubjectClassificationHighlight.ts
|
||||
model/dockerHealth.ts
|
||||
model/domain.ts
|
||||
model/domainFieldsInner.ts
|
||||
model/domainIds.ts
|
||||
model/edge.ts
|
||||
model/euCordisEurosciVocSummary.ts
|
||||
model/euCordisOrganizationSelectorPage.ts
|
||||
model/euCordisOrganizationSelectorSummary.ts
|
||||
model/euCordisOrganizationSummary.ts
|
||||
model/euCordisProjectHighlight.ts
|
||||
model/euCordisProjectResponse.ts
|
||||
model/euCordisProjectSearchPage.ts
|
||||
model/euCordisProjectSummary.ts
|
||||
@@ -125,6 +133,7 @@ model/euCordisProjectType.ts
|
||||
model/euCordisTopicSummary.ts
|
||||
model/euProjectData.ts
|
||||
model/euProjectStatusStatistics.ts
|
||||
model/euProjectTopics.ts
|
||||
model/extractedKeywords.ts
|
||||
model/extractedKeywordsLLM.ts
|
||||
model/extractedKeywordsResponse.ts
|
||||
@@ -169,6 +178,8 @@ model/idTokenMetadata.ts
|
||||
model/inseAccountManagementModelOrganizationProfile.ts
|
||||
model/inseOrganizationManagementModelOrganizationProfile.ts
|
||||
model/institution.ts
|
||||
model/institutionAssociation.ts
|
||||
model/institutionAssociationsResponse.ts
|
||||
model/institutionFunderSummary.ts
|
||||
model/institutionGeo.ts
|
||||
model/institutionIds.ts
|
||||
@@ -207,6 +218,7 @@ model/matchedTopic.ts
|
||||
model/mentionedPerson.ts
|
||||
model/meta.ts
|
||||
model/model2YrMeanCitedness.ts
|
||||
model/modelField.ts
|
||||
model/models.ts
|
||||
model/newsArticle.ts
|
||||
model/newsArticleDetail.ts
|
||||
@@ -242,10 +254,14 @@ model/score.ts
|
||||
model/selectedAuthorsRequest.ts
|
||||
model/sortDirection.ts
|
||||
model/startCollaborationGraphResponse.ts
|
||||
model/subfield.ts
|
||||
model/subfieldDomain.ts
|
||||
model/subfieldField.ts
|
||||
model/subfieldShare.ts
|
||||
model/timespan.ts
|
||||
model/tokenType.ts
|
||||
model/topAuthor.ts
|
||||
model/topAuthorAnalysis.ts
|
||||
model/topAuthorStatistics.ts
|
||||
model/topInstitutionItem.ts
|
||||
model/topTopicItem.ts
|
||||
|
||||
@@ -48,4 +48,30 @@ export * from './works.service';
|
||||
import { WorksService } from './works.service';
|
||||
export * from './worksV2.service';
|
||||
import { WorksV2Service } from './worksV2.service';
|
||||
export const APIS = [AuthService, AuthorsV2Service, BUNDInstitutionsService, BackgroundJobsService, BookmarksService, CompanyConnectionsService, DFGInstitutionsService, DFGPersonsService, DashboardService, FundingService, INSEServiceService, InstitutionsService, InstitutionsV2Service, KeywordsService, NewsService, OrganizationService, PatentsService, PersonsService, ProjectsService, RankingService, TopicsService, TopicsV2Service, UniversityRankingsService, WorksService, WorksV2Service];
|
||||
export const APIS = [
|
||||
AuthService,
|
||||
AuthorsV2Service,
|
||||
BUNDInstitutionsService,
|
||||
BackgroundJobsService,
|
||||
BookmarksService,
|
||||
CompanyConnectionsService,
|
||||
DFGInstitutionsService,
|
||||
DFGPersonsService,
|
||||
DashboardService,
|
||||
FundingService,
|
||||
INSEServiceService,
|
||||
InstitutionsService,
|
||||
InstitutionsV2Service,
|
||||
KeywordsService,
|
||||
NewsService,
|
||||
OrganizationService,
|
||||
PatentsService,
|
||||
PersonsService,
|
||||
ProjectsService,
|
||||
RankingService,
|
||||
TopicsService,
|
||||
TopicsV2Service,
|
||||
UniversityRankingsService,
|
||||
WorksService,
|
||||
WorksV2Service,
|
||||
];
|
||||
|
||||
+1825
-971
File diff suppressed because it is too large
Load Diff
@@ -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,12 +9,18 @@
|
||||
*/
|
||||
/* 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 { Author } from '../model/author';
|
||||
@@ -28,333 +34,613 @@ import { HTTPValidationError } from '../model/hTTPValidationError';
|
||||
import { StartCollaborationGraphResponse } from '../model/startCollaborationGraphResponse';
|
||||
|
||||
// @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 AuthorsV2Service extends BaseService {
|
||||
constructor(
|
||||
protected httpClient: HttpClient,
|
||||
@Optional() @Inject(BASE_PATH) basePath: string | string[],
|
||||
@Optional() configuration?: Configuration,
|
||||
) {
|
||||
super(basePath, configuration);
|
||||
}
|
||||
|
||||
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/authors/v2/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<AuthorPage>;
|
||||
public autocompleteAuthorsForSelector(
|
||||
query?: string,
|
||||
observe?: 'response',
|
||||
reportProgress?: boolean,
|
||||
options?: {
|
||||
httpHeaderAccept?: 'application/json';
|
||||
context?: HttpContext;
|
||||
transferCache?: boolean;
|
||||
},
|
||||
): Observable<HttpResponse<AuthorPage>>;
|
||||
public autocompleteAuthorsForSelector(
|
||||
query?: string,
|
||||
observe?: 'events',
|
||||
reportProgress?: boolean,
|
||||
options?: {
|
||||
httpHeaderAccept?: 'application/json';
|
||||
context?: HttpContext;
|
||||
transferCache?: boolean;
|
||||
},
|
||||
): Observable<HttpEvent<AuthorPage>>;
|
||||
public autocompleteAuthorsForSelector(
|
||||
query?: string,
|
||||
observe: any = 'body',
|
||||
reportProgress: boolean = false,
|
||||
options?: {
|
||||
httpHeaderAccept?: 'application/json';
|
||||
context?: HttpContext;
|
||||
transferCache?: boolean;
|
||||
},
|
||||
): Observable<any> {
|
||||
let localVarQueryParameters = new HttpParams({ encoder: this.encoder });
|
||||
localVarQueryParameters = this.addToHttpParams(
|
||||
localVarQueryParameters,
|
||||
<any>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,
|
||||
);
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns a paginated list of authors for a given search term based on their display name.
|
||||
* @endpoint get /api/authors/v2/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<AuthorPage>;
|
||||
public autocompleteAuthorsForSelector(query?: string, observe?: 'response', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable<HttpResponse<AuthorPage>>;
|
||||
public autocompleteAuthorsForSelector(query?: string, observe?: 'events', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable<HttpEvent<AuthorPage>>;
|
||||
public autocompleteAuthorsForSelector(query?: string, observe: any = 'body', reportProgress: boolean = false, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable<any> {
|
||||
const localVarHttpContext: HttpContext =
|
||||
options?.context ?? new HttpContext();
|
||||
|
||||
let localVarQueryParameters = new HttpParams({encoder: this.encoder});
|
||||
localVarQueryParameters = this.addToHttpParams(localVarQueryParameters,
|
||||
<any>query, 'query');
|
||||
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);
|
||||
}
|
||||
let localVarPath = `/api/authors/v2/autocomplete/selector`;
|
||||
const { basePath, withCredentials } = this.configuration;
|
||||
return this.httpClient.request<AuthorPage>(
|
||||
'get',
|
||||
`${basePath}${localVarPath}`,
|
||||
{
|
||||
context: localVarHttpContext,
|
||||
params: localVarQueryParameters,
|
||||
responseType: <any>responseType_,
|
||||
...(withCredentials ? { withCredentials } : {}),
|
||||
headers: localVarHeaders,
|
||||
observe: observe,
|
||||
...(localVarTransferCache !== undefined
|
||||
? { transferCache: localVarTransferCache }
|
||||
: {}),
|
||||
reportProgress: reportProgress,
|
||||
},
|
||||
);
|
||||
}
|
||||
|
||||
const localVarHttpContext: HttpContext = options?.context ?? new HttpContext();
|
||||
/**
|
||||
* Returns an author for a given author ID.
|
||||
* @endpoint get /api/authors/v2/{raw_oa_author_id}
|
||||
* @param rawOaAuthorId The ID of the author 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 getAuthorById(
|
||||
rawOaAuthorId: string,
|
||||
observe?: 'body',
|
||||
reportProgress?: boolean,
|
||||
options?: {
|
||||
httpHeaderAccept?: 'application/json';
|
||||
context?: HttpContext;
|
||||
transferCache?: boolean;
|
||||
},
|
||||
): Observable<Author>;
|
||||
public getAuthorById(
|
||||
rawOaAuthorId: string,
|
||||
observe?: 'response',
|
||||
reportProgress?: boolean,
|
||||
options?: {
|
||||
httpHeaderAccept?: 'application/json';
|
||||
context?: HttpContext;
|
||||
transferCache?: boolean;
|
||||
},
|
||||
): Observable<HttpResponse<Author>>;
|
||||
public getAuthorById(
|
||||
rawOaAuthorId: string,
|
||||
observe?: 'events',
|
||||
reportProgress?: boolean,
|
||||
options?: {
|
||||
httpHeaderAccept?: 'application/json';
|
||||
context?: HttpContext;
|
||||
transferCache?: boolean;
|
||||
},
|
||||
): Observable<HttpEvent<Author>>;
|
||||
public getAuthorById(
|
||||
rawOaAuthorId: string,
|
||||
observe: any = 'body',
|
||||
reportProgress: boolean = false,
|
||||
options?: {
|
||||
httpHeaderAccept?: 'application/json';
|
||||
context?: HttpContext;
|
||||
transferCache?: boolean;
|
||||
},
|
||||
): Observable<any> {
|
||||
if (rawOaAuthorId === null || rawOaAuthorId === undefined) {
|
||||
throw new Error(
|
||||
'Required parameter rawOaAuthorId was null or undefined when calling getAuthorById.',
|
||||
);
|
||||
}
|
||||
|
||||
const localVarTransferCache: boolean = options?.transferCache ?? true;
|
||||
let localVarHeaders = this.defaultHeaders;
|
||||
|
||||
const localVarHttpHeaderAcceptSelected: string | undefined =
|
||||
options?.httpHeaderAccept ??
|
||||
this.configuration.selectHeaderAccept(['application/json']);
|
||||
if (localVarHttpHeaderAcceptSelected !== undefined) {
|
||||
localVarHeaders = localVarHeaders.set(
|
||||
'Accept',
|
||||
localVarHttpHeaderAcceptSelected,
|
||||
);
|
||||
}
|
||||
|
||||
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 localVarHttpContext: HttpContext =
|
||||
options?.context ?? new HttpContext();
|
||||
|
||||
let localVarPath = `/api/authors/v2/autocomplete/selector`;
|
||||
const { basePath, withCredentials } = this.configuration;
|
||||
return this.httpClient.request<AuthorPage>('get', `${basePath}${localVarPath}`,
|
||||
{
|
||||
context: localVarHttpContext,
|
||||
params: localVarQueryParameters,
|
||||
responseType: <any>responseType_,
|
||||
...(withCredentials ? { withCredentials } : {}),
|
||||
headers: localVarHeaders,
|
||||
observe: observe,
|
||||
...(localVarTransferCache !== undefined ? { transferCache: localVarTransferCache } : {}),
|
||||
reportProgress: reportProgress
|
||||
}
|
||||
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/authors/v2/${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<Author>(
|
||||
'get',
|
||||
`${basePath}${localVarPath}`,
|
||||
{
|
||||
context: localVarHttpContext,
|
||||
responseType: <any>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/authors/v2/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<string>,
|
||||
observe?: 'body',
|
||||
reportProgress?: boolean,
|
||||
options?: {
|
||||
httpHeaderAccept?: 'application/json';
|
||||
context?: HttpContext;
|
||||
transferCache?: boolean;
|
||||
},
|
||||
): Observable<AuthorPage>;
|
||||
public getAuthorsByIds(
|
||||
authorIds?: Array<string>,
|
||||
observe?: 'response',
|
||||
reportProgress?: boolean,
|
||||
options?: {
|
||||
httpHeaderAccept?: 'application/json';
|
||||
context?: HttpContext;
|
||||
transferCache?: boolean;
|
||||
},
|
||||
): Observable<HttpResponse<AuthorPage>>;
|
||||
public getAuthorsByIds(
|
||||
authorIds?: Array<string>,
|
||||
observe?: 'events',
|
||||
reportProgress?: boolean,
|
||||
options?: {
|
||||
httpHeaderAccept?: 'application/json';
|
||||
context?: HttpContext;
|
||||
transferCache?: boolean;
|
||||
},
|
||||
): Observable<HttpEvent<AuthorPage>>;
|
||||
public getAuthorsByIds(
|
||||
authorIds?: Array<string>,
|
||||
observe: any = 'body',
|
||||
reportProgress: boolean = false,
|
||||
options?: {
|
||||
httpHeaderAccept?: 'application/json';
|
||||
context?: HttpContext;
|
||||
transferCache?: boolean;
|
||||
},
|
||||
): Observable<any> {
|
||||
let localVarQueryParameters = new HttpParams({ encoder: this.encoder });
|
||||
if (authorIds) {
|
||||
authorIds.forEach((element) => {
|
||||
localVarQueryParameters = this.addToHttpParams(
|
||||
localVarQueryParameters,
|
||||
<any>element,
|
||||
'author_ids',
|
||||
);
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns an author for a given author ID.
|
||||
* @endpoint get /api/authors/v2/{raw_oa_author_id}
|
||||
* @param rawOaAuthorId The ID of the author 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 getAuthorById(rawOaAuthorId: string, observe?: 'body', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable<Author>;
|
||||
public getAuthorById(rawOaAuthorId: string, observe?: 'response', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable<HttpResponse<Author>>;
|
||||
public getAuthorById(rawOaAuthorId: string, observe?: 'events', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable<HttpEvent<Author>>;
|
||||
public getAuthorById(rawOaAuthorId: string, observe: any = 'body', reportProgress: boolean = false, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable<any> {
|
||||
if (rawOaAuthorId === null || rawOaAuthorId === undefined) {
|
||||
throw new Error('Required parameter rawOaAuthorId was null or undefined when calling getAuthorById.');
|
||||
}
|
||||
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 localVarHttpContext: HttpContext = options?.context ?? new HttpContext();
|
||||
const localVarTransferCache: boolean = options?.transferCache ?? true;
|
||||
|
||||
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/authors/v2/authors/id`;
|
||||
const { basePath, withCredentials } = this.configuration;
|
||||
return this.httpClient.request<AuthorPage>(
|
||||
'get',
|
||||
`${basePath}${localVarPath}`,
|
||||
{
|
||||
context: localVarHttpContext,
|
||||
params: localVarQueryParameters,
|
||||
responseType: <any>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';
|
||||
}
|
||||
}
|
||||
/**
|
||||
* Returns the status of a collaboration graph generation task.
|
||||
* @endpoint get /api/authors/v2/collaboration-graph/{graph_id}/status
|
||||
* @param graphId The ID of the collaboration graph generation task.
|
||||
* @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 getCollaborationGraphStatus(
|
||||
graphId: string,
|
||||
observe?: 'body',
|
||||
reportProgress?: boolean,
|
||||
options?: {
|
||||
httpHeaderAccept?: 'application/json';
|
||||
context?: HttpContext;
|
||||
transferCache?: boolean;
|
||||
},
|
||||
): Observable<CollaborationGraphStatusResponse>;
|
||||
public getCollaborationGraphStatus(
|
||||
graphId: string,
|
||||
observe?: 'response',
|
||||
reportProgress?: boolean,
|
||||
options?: {
|
||||
httpHeaderAccept?: 'application/json';
|
||||
context?: HttpContext;
|
||||
transferCache?: boolean;
|
||||
},
|
||||
): Observable<HttpResponse<CollaborationGraphStatusResponse>>;
|
||||
public getCollaborationGraphStatus(
|
||||
graphId: string,
|
||||
observe?: 'events',
|
||||
reportProgress?: boolean,
|
||||
options?: {
|
||||
httpHeaderAccept?: 'application/json';
|
||||
context?: HttpContext;
|
||||
transferCache?: boolean;
|
||||
},
|
||||
): Observable<HttpEvent<CollaborationGraphStatusResponse>>;
|
||||
public getCollaborationGraphStatus(
|
||||
graphId: string,
|
||||
observe: any = 'body',
|
||||
reportProgress: boolean = false,
|
||||
options?: {
|
||||
httpHeaderAccept?: 'application/json';
|
||||
context?: HttpContext;
|
||||
transferCache?: boolean;
|
||||
},
|
||||
): Observable<any> {
|
||||
if (graphId === null || graphId === undefined) {
|
||||
throw new Error(
|
||||
'Required parameter graphId was null or undefined when calling getCollaborationGraphStatus.',
|
||||
);
|
||||
}
|
||||
|
||||
let localVarPath = `/api/authors/v2/${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<Author>('get', `${basePath}${localVarPath}`,
|
||||
{
|
||||
context: localVarHttpContext,
|
||||
responseType: <any>responseType_,
|
||||
...(withCredentials ? { withCredentials } : {}),
|
||||
headers: localVarHeaders,
|
||||
observe: observe,
|
||||
...(localVarTransferCache !== undefined ? { transferCache: localVarTransferCache } : {}),
|
||||
reportProgress: reportProgress
|
||||
}
|
||||
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/authors/v2/collaboration-graph/${this.configuration.encodeParam({ name: 'graphId', value: graphId, in: 'path', style: 'simple', explode: false, dataType: 'string', dataFormat: undefined })}/status`;
|
||||
const { basePath, withCredentials } = this.configuration;
|
||||
return this.httpClient.request<CollaborationGraphStatusResponse>(
|
||||
'get',
|
||||
`${basePath}${localVarPath}`,
|
||||
{
|
||||
context: localVarHttpContext,
|
||||
responseType: <any>responseType_,
|
||||
...(withCredentials ? { withCredentials } : {}),
|
||||
headers: localVarHeaders,
|
||||
observe: observe,
|
||||
...(localVarTransferCache !== undefined
|
||||
? { transferCache: localVarTransferCache }
|
||||
: {}),
|
||||
reportProgress: reportProgress,
|
||||
},
|
||||
);
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns a collaboration graph for a given author ID.
|
||||
* @endpoint post /api/authors/v2/collaboration-graph
|
||||
* @param rawOaAuthorId The raw OpenAlex author ID for which to retrieve the collaboration graph.
|
||||
* @param yearFrom The starting year to filter the works by (optional).
|
||||
* @param yearTo The ending year to filter the works by (optional).
|
||||
* @param minCollaborators The minimum number of collaborators to filter the works by (optional).
|
||||
* @param maxCollaborators The maximum number of collaborators to filter the works by (optional).
|
||||
* @param topicIds A list of topic IDs to filter the works by (optional).
|
||||
* @param institutionIds A list of institution IDs to filter the works by (optional).
|
||||
* @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 startCollaborationGraph(
|
||||
rawOaAuthorId: string,
|
||||
yearFrom?: number,
|
||||
yearTo?: number,
|
||||
minCollaborators?: number,
|
||||
maxCollaborators?: number,
|
||||
topicIds?: Array<string>,
|
||||
institutionIds?: Array<string>,
|
||||
observe?: 'body',
|
||||
reportProgress?: boolean,
|
||||
options?: {
|
||||
httpHeaderAccept?: 'application/json';
|
||||
context?: HttpContext;
|
||||
transferCache?: boolean;
|
||||
},
|
||||
): Observable<StartCollaborationGraphResponse>;
|
||||
public startCollaborationGraph(
|
||||
rawOaAuthorId: string,
|
||||
yearFrom?: number,
|
||||
yearTo?: number,
|
||||
minCollaborators?: number,
|
||||
maxCollaborators?: number,
|
||||
topicIds?: Array<string>,
|
||||
institutionIds?: Array<string>,
|
||||
observe?: 'response',
|
||||
reportProgress?: boolean,
|
||||
options?: {
|
||||
httpHeaderAccept?: 'application/json';
|
||||
context?: HttpContext;
|
||||
transferCache?: boolean;
|
||||
},
|
||||
): Observable<HttpResponse<StartCollaborationGraphResponse>>;
|
||||
public startCollaborationGraph(
|
||||
rawOaAuthorId: string,
|
||||
yearFrom?: number,
|
||||
yearTo?: number,
|
||||
minCollaborators?: number,
|
||||
maxCollaborators?: number,
|
||||
topicIds?: Array<string>,
|
||||
institutionIds?: Array<string>,
|
||||
observe?: 'events',
|
||||
reportProgress?: boolean,
|
||||
options?: {
|
||||
httpHeaderAccept?: 'application/json';
|
||||
context?: HttpContext;
|
||||
transferCache?: boolean;
|
||||
},
|
||||
): Observable<HttpEvent<StartCollaborationGraphResponse>>;
|
||||
public startCollaborationGraph(
|
||||
rawOaAuthorId: string,
|
||||
yearFrom?: number,
|
||||
yearTo?: number,
|
||||
minCollaborators?: number,
|
||||
maxCollaborators?: number,
|
||||
topicIds?: Array<string>,
|
||||
institutionIds?: Array<string>,
|
||||
observe: any = 'body',
|
||||
reportProgress: boolean = false,
|
||||
options?: {
|
||||
httpHeaderAccept?: 'application/json';
|
||||
context?: HttpContext;
|
||||
transferCache?: boolean;
|
||||
},
|
||||
): Observable<any> {
|
||||
if (rawOaAuthorId === null || rawOaAuthorId === undefined) {
|
||||
throw new Error(
|
||||
'Required parameter rawOaAuthorId was null or undefined when calling startCollaborationGraph.',
|
||||
);
|
||||
}
|
||||
|
||||
let localVarQueryParameters = new HttpParams({ encoder: this.encoder });
|
||||
localVarQueryParameters = this.addToHttpParams(
|
||||
localVarQueryParameters,
|
||||
<any>rawOaAuthorId,
|
||||
'raw_oa_author_id',
|
||||
);
|
||||
localVarQueryParameters = this.addToHttpParams(
|
||||
localVarQueryParameters,
|
||||
<any>yearFrom,
|
||||
'year_from',
|
||||
);
|
||||
localVarQueryParameters = this.addToHttpParams(
|
||||
localVarQueryParameters,
|
||||
<any>yearTo,
|
||||
'year_to',
|
||||
);
|
||||
localVarQueryParameters = this.addToHttpParams(
|
||||
localVarQueryParameters,
|
||||
<any>minCollaborators,
|
||||
'min_collaborators',
|
||||
);
|
||||
localVarQueryParameters = this.addToHttpParams(
|
||||
localVarQueryParameters,
|
||||
<any>maxCollaborators,
|
||||
'max_collaborators',
|
||||
);
|
||||
if (topicIds) {
|
||||
topicIds.forEach((element) => {
|
||||
localVarQueryParameters = this.addToHttpParams(
|
||||
localVarQueryParameters,
|
||||
<any>element,
|
||||
'topic_ids',
|
||||
);
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns a paginated list of authors for a given list of author IDs.
|
||||
* @endpoint get /api/authors/v2/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<string>, observe?: 'body', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable<AuthorPage>;
|
||||
public getAuthorsByIds(authorIds?: Array<string>, observe?: 'response', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable<HttpResponse<AuthorPage>>;
|
||||
public getAuthorsByIds(authorIds?: Array<string>, observe?: 'events', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable<HttpEvent<AuthorPage>>;
|
||||
public getAuthorsByIds(authorIds?: Array<string>, observe: any = 'body', reportProgress: boolean = false, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable<any> {
|
||||
|
||||
let localVarQueryParameters = new HttpParams({encoder: this.encoder});
|
||||
if (authorIds) {
|
||||
authorIds.forEach((element) => {
|
||||
localVarQueryParameters = this.addToHttpParams(localVarQueryParameters,
|
||||
<any>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/authors/v2/authors/id`;
|
||||
const { basePath, withCredentials } = this.configuration;
|
||||
return this.httpClient.request<AuthorPage>('get', `${basePath}${localVarPath}`,
|
||||
{
|
||||
context: localVarHttpContext,
|
||||
params: localVarQueryParameters,
|
||||
responseType: <any>responseType_,
|
||||
...(withCredentials ? { withCredentials } : {}),
|
||||
headers: localVarHeaders,
|
||||
observe: observe,
|
||||
...(localVarTransferCache !== undefined ? { transferCache: localVarTransferCache } : {}),
|
||||
reportProgress: reportProgress
|
||||
}
|
||||
if (institutionIds) {
|
||||
institutionIds.forEach((element) => {
|
||||
localVarQueryParameters = this.addToHttpParams(
|
||||
localVarQueryParameters,
|
||||
<any>element,
|
||||
'institution_ids',
|
||||
);
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns the status of a collaboration graph generation task.
|
||||
* @endpoint get /api/authors/v2/collaboration-graph/{graph_id}/status
|
||||
* @param graphId The ID of the collaboration graph generation task.
|
||||
* @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 getCollaborationGraphStatus(graphId: string, observe?: 'body', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable<CollaborationGraphStatusResponse>;
|
||||
public getCollaborationGraphStatus(graphId: string, observe?: 'response', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable<HttpResponse<CollaborationGraphStatusResponse>>;
|
||||
public getCollaborationGraphStatus(graphId: string, observe?: 'events', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable<HttpEvent<CollaborationGraphStatusResponse>>;
|
||||
public getCollaborationGraphStatus(graphId: string, observe: any = 'body', reportProgress: boolean = false, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable<any> {
|
||||
if (graphId === null || graphId === undefined) {
|
||||
throw new Error('Required parameter graphId was null or undefined when calling getCollaborationGraphStatus.');
|
||||
}
|
||||
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 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/authors/v2/collaboration-graph/${this.configuration.encodeParam({name: "graphId", value: graphId, in: "path", style: "simple", explode: false, dataType: "string", dataFormat: undefined})}/status`;
|
||||
const { basePath, withCredentials } = this.configuration;
|
||||
return this.httpClient.request<CollaborationGraphStatusResponse>('get', `${basePath}${localVarPath}`,
|
||||
{
|
||||
context: localVarHttpContext,
|
||||
responseType: <any>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,
|
||||
);
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns a collaboration graph for a given author ID.
|
||||
* @endpoint post /api/authors/v2/collaboration-graph
|
||||
* @param rawOaAuthorId The raw OpenAlex author ID for which to retrieve the collaboration graph.
|
||||
* @param yearFrom The starting year to filter the works by (optional).
|
||||
* @param yearTo The ending year to filter the works by (optional).
|
||||
* @param minCollaborators The minimum number of collaborators to filter the works by (optional).
|
||||
* @param maxCollaborators The maximum number of collaborators to filter the works by (optional).
|
||||
* @param topicIds A list of topic IDs to filter the works by (optional).
|
||||
* @param institutionIds A list of institution IDs to filter the works by (optional).
|
||||
* @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 startCollaborationGraph(rawOaAuthorId: string, yearFrom?: number, yearTo?: number, minCollaborators?: number, maxCollaborators?: number, topicIds?: Array<string>, institutionIds?: Array<string>, observe?: 'body', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable<StartCollaborationGraphResponse>;
|
||||
public startCollaborationGraph(rawOaAuthorId: string, yearFrom?: number, yearTo?: number, minCollaborators?: number, maxCollaborators?: number, topicIds?: Array<string>, institutionIds?: Array<string>, observe?: 'response', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable<HttpResponse<StartCollaborationGraphResponse>>;
|
||||
public startCollaborationGraph(rawOaAuthorId: string, yearFrom?: number, yearTo?: number, minCollaborators?: number, maxCollaborators?: number, topicIds?: Array<string>, institutionIds?: Array<string>, observe?: 'events', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable<HttpEvent<StartCollaborationGraphResponse>>;
|
||||
public startCollaborationGraph(rawOaAuthorId: string, yearFrom?: number, yearTo?: number, minCollaborators?: number, maxCollaborators?: number, topicIds?: Array<string>, institutionIds?: Array<string>, observe: any = 'body', reportProgress: boolean = false, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable<any> {
|
||||
if (rawOaAuthorId === null || rawOaAuthorId === undefined) {
|
||||
throw new Error('Required parameter rawOaAuthorId was null or undefined when calling startCollaborationGraph.');
|
||||
}
|
||||
const localVarHttpContext: HttpContext =
|
||||
options?.context ?? new HttpContext();
|
||||
|
||||
let localVarQueryParameters = new HttpParams({encoder: this.encoder});
|
||||
localVarQueryParameters = this.addToHttpParams(localVarQueryParameters,
|
||||
<any>rawOaAuthorId, 'raw_oa_author_id');
|
||||
localVarQueryParameters = this.addToHttpParams(localVarQueryParameters,
|
||||
<any>yearFrom, 'year_from');
|
||||
localVarQueryParameters = this.addToHttpParams(localVarQueryParameters,
|
||||
<any>yearTo, 'year_to');
|
||||
localVarQueryParameters = this.addToHttpParams(localVarQueryParameters,
|
||||
<any>minCollaborators, 'min_collaborators');
|
||||
localVarQueryParameters = this.addToHttpParams(localVarQueryParameters,
|
||||
<any>maxCollaborators, 'max_collaborators');
|
||||
if (topicIds) {
|
||||
topicIds.forEach((element) => {
|
||||
localVarQueryParameters = this.addToHttpParams(localVarQueryParameters,
|
||||
<any>element, 'topic_ids');
|
||||
})
|
||||
}
|
||||
if (institutionIds) {
|
||||
institutionIds.forEach((element) => {
|
||||
localVarQueryParameters = this.addToHttpParams(localVarQueryParameters,
|
||||
<any>element, 'institution_ids');
|
||||
})
|
||||
}
|
||||
const localVarTransferCache: boolean = options?.transferCache ?? true;
|
||||
|
||||
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/authors/v2/collaboration-graph`;
|
||||
const { basePath, withCredentials } = this.configuration;
|
||||
return this.httpClient.request<StartCollaborationGraphResponse>('post', `${basePath}${localVarPath}`,
|
||||
{
|
||||
context: localVarHttpContext,
|
||||
params: localVarQueryParameters,
|
||||
responseType: <any>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/authors/v2/collaboration-graph`;
|
||||
const { basePath, withCredentials } = this.configuration;
|
||||
return this.httpClient.request<StartCollaborationGraphResponse>(
|
||||
'post',
|
||||
`${basePath}${localVarPath}`,
|
||||
{
|
||||
context: localVarHttpContext,
|
||||
params: localVarQueryParameters,
|
||||
responseType: <any>responseType_,
|
||||
...(withCredentials ? { withCredentials } : {}),
|
||||
headers: localVarHeaders,
|
||||
observe: observe,
|
||||
...(localVarTransferCache !== undefined
|
||||
? { transferCache: localVarTransferCache }
|
||||
: {}),
|
||||
reportProgress: reportProgress,
|
||||
},
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -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,12 +9,18 @@
|
||||
*/
|
||||
/* 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 { BundInstitutionSummaryPage } from '../model/bundInstitutionSummaryPage';
|
||||
@@ -22,137 +28,231 @@ import { BundInstitutionSummaryPage } from '../model/bundInstitutionSummaryPage'
|
||||
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 BUNDInstitutionsService extends BaseService {
|
||||
constructor(
|
||||
protected httpClient: HttpClient,
|
||||
@Optional() @Inject(BASE_PATH) basePath: string | string[],
|
||||
@Optional() configuration?: Configuration,
|
||||
) {
|
||||
super(basePath, configuration);
|
||||
}
|
||||
|
||||
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/bund/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 getBundInstitutionAutocompleteForSelector(
|
||||
query?: string,
|
||||
observe?: 'body',
|
||||
reportProgress?: boolean,
|
||||
options?: {
|
||||
httpHeaderAccept?: 'application/json';
|
||||
context?: HttpContext;
|
||||
transferCache?: boolean;
|
||||
},
|
||||
): Observable<BundInstitutionSummaryPage>;
|
||||
public getBundInstitutionAutocompleteForSelector(
|
||||
query?: string,
|
||||
observe?: 'response',
|
||||
reportProgress?: boolean,
|
||||
options?: {
|
||||
httpHeaderAccept?: 'application/json';
|
||||
context?: HttpContext;
|
||||
transferCache?: boolean;
|
||||
},
|
||||
): Observable<HttpResponse<BundInstitutionSummaryPage>>;
|
||||
public getBundInstitutionAutocompleteForSelector(
|
||||
query?: string,
|
||||
observe?: 'events',
|
||||
reportProgress?: boolean,
|
||||
options?: {
|
||||
httpHeaderAccept?: 'application/json';
|
||||
context?: HttpContext;
|
||||
transferCache?: boolean;
|
||||
},
|
||||
): Observable<HttpEvent<BundInstitutionSummaryPage>>;
|
||||
public getBundInstitutionAutocompleteForSelector(
|
||||
query?: string,
|
||||
observe: any = 'body',
|
||||
reportProgress: boolean = false,
|
||||
options?: {
|
||||
httpHeaderAccept?: 'application/json';
|
||||
context?: HttpContext;
|
||||
transferCache?: boolean;
|
||||
},
|
||||
): Observable<any> {
|
||||
let localVarQueryParameters = new HttpParams({ encoder: this.encoder });
|
||||
localVarQueryParameters = this.addToHttpParams(
|
||||
localVarQueryParameters,
|
||||
<any>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,
|
||||
);
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns a list of institutions based on a search term for autocomplete functionality.
|
||||
* @endpoint get /api/bund/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 getBundInstitutionAutocompleteForSelector(query?: string, observe?: 'body', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable<BundInstitutionSummaryPage>;
|
||||
public getBundInstitutionAutocompleteForSelector(query?: string, observe?: 'response', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable<HttpResponse<BundInstitutionSummaryPage>>;
|
||||
public getBundInstitutionAutocompleteForSelector(query?: string, observe?: 'events', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable<HttpEvent<BundInstitutionSummaryPage>>;
|
||||
public getBundInstitutionAutocompleteForSelector(query?: string, observe: any = 'body', reportProgress: boolean = false, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable<any> {
|
||||
const localVarHttpContext: HttpContext =
|
||||
options?.context ?? new HttpContext();
|
||||
|
||||
let localVarQueryParameters = new HttpParams({encoder: this.encoder});
|
||||
localVarQueryParameters = this.addToHttpParams(localVarQueryParameters,
|
||||
<any>query, 'query');
|
||||
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);
|
||||
}
|
||||
let localVarPath = `/api/bund/institutions/autocomplete/selector`;
|
||||
const { basePath, withCredentials } = this.configuration;
|
||||
return this.httpClient.request<BundInstitutionSummaryPage>(
|
||||
'get',
|
||||
`${basePath}${localVarPath}`,
|
||||
{
|
||||
context: localVarHttpContext,
|
||||
params: localVarQueryParameters,
|
||||
responseType: <any>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/bund/institutions/autocomplete/selector`;
|
||||
const { basePath, withCredentials } = this.configuration;
|
||||
return this.httpClient.request<BundInstitutionSummaryPage>('get', `${basePath}${localVarPath}`,
|
||||
{
|
||||
context: localVarHttpContext,
|
||||
params: localVarQueryParameters,
|
||||
responseType: <any>responseType_,
|
||||
...(withCredentials ? { withCredentials } : {}),
|
||||
headers: localVarHeaders,
|
||||
observe: observe,
|
||||
...(localVarTransferCache !== undefined ? { transferCache: localVarTransferCache } : {}),
|
||||
reportProgress: reportProgress
|
||||
}
|
||||
/**
|
||||
* Returns a list of institutions based on their names.
|
||||
* @endpoint get /api/bund/institutions/names
|
||||
* @param institutionNames A list of institution names 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 getBundInstitutionsByName(
|
||||
institutionNames?: Array<string>,
|
||||
observe?: 'body',
|
||||
reportProgress?: boolean,
|
||||
options?: {
|
||||
httpHeaderAccept?: 'application/json';
|
||||
context?: HttpContext;
|
||||
transferCache?: boolean;
|
||||
},
|
||||
): Observable<BundInstitutionSummaryPage>;
|
||||
public getBundInstitutionsByName(
|
||||
institutionNames?: Array<string>,
|
||||
observe?: 'response',
|
||||
reportProgress?: boolean,
|
||||
options?: {
|
||||
httpHeaderAccept?: 'application/json';
|
||||
context?: HttpContext;
|
||||
transferCache?: boolean;
|
||||
},
|
||||
): Observable<HttpResponse<BundInstitutionSummaryPage>>;
|
||||
public getBundInstitutionsByName(
|
||||
institutionNames?: Array<string>,
|
||||
observe?: 'events',
|
||||
reportProgress?: boolean,
|
||||
options?: {
|
||||
httpHeaderAccept?: 'application/json';
|
||||
context?: HttpContext;
|
||||
transferCache?: boolean;
|
||||
},
|
||||
): Observable<HttpEvent<BundInstitutionSummaryPage>>;
|
||||
public getBundInstitutionsByName(
|
||||
institutionNames?: Array<string>,
|
||||
observe: any = 'body',
|
||||
reportProgress: boolean = false,
|
||||
options?: {
|
||||
httpHeaderAccept?: 'application/json';
|
||||
context?: HttpContext;
|
||||
transferCache?: boolean;
|
||||
},
|
||||
): Observable<any> {
|
||||
let localVarQueryParameters = new HttpParams({ encoder: this.encoder });
|
||||
if (institutionNames) {
|
||||
institutionNames.forEach((element) => {
|
||||
localVarQueryParameters = this.addToHttpParams(
|
||||
localVarQueryParameters,
|
||||
<any>element,
|
||||
'institution_names',
|
||||
);
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns a list of institutions based on their names.
|
||||
* @endpoint get /api/bund/institutions/names
|
||||
* @param institutionNames A list of institution names 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 getBundInstitutionsByName(institutionNames?: Array<string>, observe?: 'body', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable<BundInstitutionSummaryPage>;
|
||||
public getBundInstitutionsByName(institutionNames?: Array<string>, observe?: 'response', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable<HttpResponse<BundInstitutionSummaryPage>>;
|
||||
public getBundInstitutionsByName(institutionNames?: Array<string>, observe?: 'events', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable<HttpEvent<BundInstitutionSummaryPage>>;
|
||||
public getBundInstitutionsByName(institutionNames?: Array<string>, observe: any = 'body', reportProgress: boolean = false, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable<any> {
|
||||
let localVarHeaders = this.defaultHeaders;
|
||||
|
||||
let localVarQueryParameters = new HttpParams({encoder: this.encoder});
|
||||
if (institutionNames) {
|
||||
institutionNames.forEach((element) => {
|
||||
localVarQueryParameters = this.addToHttpParams(localVarQueryParameters,
|
||||
<any>element, 'institution_names');
|
||||
})
|
||||
}
|
||||
|
||||
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/bund/institutions/names`;
|
||||
const { basePath, withCredentials } = this.configuration;
|
||||
return this.httpClient.request<BundInstitutionSummaryPage>('get', `${basePath}${localVarPath}`,
|
||||
{
|
||||
context: localVarHttpContext,
|
||||
params: localVarQueryParameters,
|
||||
responseType: <any>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,
|
||||
);
|
||||
}
|
||||
|
||||
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/bund/institutions/names`;
|
||||
const { basePath, withCredentials } = this.configuration;
|
||||
return this.httpClient.request<BundInstitutionSummaryPage>(
|
||||
'get',
|
||||
`${basePath}${localVarPath}`,
|
||||
{
|
||||
context: localVarHttpContext,
|
||||
params: localVarQueryParameters,
|
||||
responseType: <any>responseType_,
|
||||
...(withCredentials ? { withCredentials } : {}),
|
||||
headers: localVarHeaders,
|
||||
observe: observe,
|
||||
...(localVarTransferCache !== undefined
|
||||
? { transferCache: localVarTransferCache }
|
||||
: {}),
|
||||
reportProgress: reportProgress,
|
||||
},
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
@@ -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,12 +9,18 @@
|
||||
*/
|
||||
/* 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';
|
||||
@@ -24,206 +30,375 @@ 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);
|
||||
}
|
||||
|
||||
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<PersonBookmarkResponse>;
|
||||
public bookmarkPerson(
|
||||
personId: string,
|
||||
createPersonBookmark: CreatePersonBookmark,
|
||||
secureFgpAcc?: string,
|
||||
observe?: 'response',
|
||||
reportProgress?: boolean,
|
||||
options?: {
|
||||
httpHeaderAccept?: 'application/json';
|
||||
context?: HttpContext;
|
||||
transferCache?: boolean;
|
||||
},
|
||||
): Observable<HttpResponse<PersonBookmarkResponse>>;
|
||||
public bookmarkPerson(
|
||||
personId: string,
|
||||
createPersonBookmark: CreatePersonBookmark,
|
||||
secureFgpAcc?: string,
|
||||
observe?: 'events',
|
||||
reportProgress?: boolean,
|
||||
options?: {
|
||||
httpHeaderAccept?: 'application/json';
|
||||
context?: HttpContext;
|
||||
transferCache?: boolean;
|
||||
},
|
||||
): Observable<HttpEvent<PersonBookmarkResponse>>;
|
||||
public bookmarkPerson(
|
||||
personId: string,
|
||||
createPersonBookmark: CreatePersonBookmark,
|
||||
secureFgpAcc?: string,
|
||||
observe: any = 'body',
|
||||
reportProgress: boolean = false,
|
||||
options?: {
|
||||
httpHeaderAccept?: 'application/json';
|
||||
context?: HttpContext;
|
||||
transferCache?: boolean;
|
||||
},
|
||||
): Observable<any> {
|
||||
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.',
|
||||
);
|
||||
}
|
||||
|
||||
/**
|
||||
* 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<PersonBookmarkResponse>;
|
||||
public bookmarkPerson(personId: string, createPersonBookmark: CreatePersonBookmark, secureFgpAcc?: string, observe?: 'response', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable<HttpResponse<PersonBookmarkResponse>>;
|
||||
public bookmarkPerson(personId: string, createPersonBookmark: CreatePersonBookmark, secureFgpAcc?: string, observe?: 'events', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable<HttpEvent<PersonBookmarkResponse>>;
|
||||
public bookmarkPerson(personId: string, createPersonBookmark: CreatePersonBookmark, secureFgpAcc?: string, observe: any = 'body', reportProgress: boolean = false, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable<any> {
|
||||
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.');
|
||||
}
|
||||
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 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<PersonBookmarkResponse>('put', `${basePath}${localVarPath}`,
|
||||
{
|
||||
context: localVarHttpContext,
|
||||
body: createPersonBookmark,
|
||||
responseType: <any>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,
|
||||
);
|
||||
}
|
||||
|
||||
/**
|
||||
* 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<Array<PersonBookmarkResponse>>;
|
||||
public listPersonBookmarks(secureFgpAcc?: string, observe?: 'response', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable<HttpResponse<Array<PersonBookmarkResponse>>>;
|
||||
public listPersonBookmarks(secureFgpAcc?: string, observe?: 'events', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable<HttpEvent<Array<PersonBookmarkResponse>>>;
|
||||
public listPersonBookmarks(secureFgpAcc?: string, observe: any = 'body', reportProgress: boolean = false, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable<any> {
|
||||
const localVarHttpContext: HttpContext =
|
||||
options?.context ?? new HttpContext();
|
||||
|
||||
let localVarHeaders = this.defaultHeaders;
|
||||
const localVarTransferCache: boolean = options?.transferCache ?? true;
|
||||
|
||||
// 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<Array<PersonBookmarkResponse>>('get', `${basePath}${localVarPath}`,
|
||||
{
|
||||
context: localVarHttpContext,
|
||||
responseType: <any>responseType_,
|
||||
...(withCredentials ? { withCredentials } : {}),
|
||||
headers: localVarHeaders,
|
||||
observe: observe,
|
||||
...(localVarTransferCache !== undefined ? { transferCache: localVarTransferCache } : {}),
|
||||
reportProgress: reportProgress
|
||||
}
|
||||
);
|
||||
// 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,
|
||||
);
|
||||
}
|
||||
|
||||
/**
|
||||
* 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<any>;
|
||||
public removePersonBookmark(personId: string, secureFgpAcc?: string, observe?: 'response', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable<HttpResponse<any>>;
|
||||
public removePersonBookmark(personId: string, secureFgpAcc?: string, observe?: 'events', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable<HttpEvent<any>>;
|
||||
public removePersonBookmark(personId: string, secureFgpAcc?: string, observe: any = 'body', reportProgress: boolean = false, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable<any> {
|
||||
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<any>('delete', `${basePath}${localVarPath}`,
|
||||
{
|
||||
context: localVarHttpContext,
|
||||
responseType: <any>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/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<PersonBookmarkResponse>(
|
||||
'put',
|
||||
`${basePath}${localVarPath}`,
|
||||
{
|
||||
context: localVarHttpContext,
|
||||
body: createPersonBookmark,
|
||||
responseType: <any>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<Array<PersonBookmarkResponse>>;
|
||||
public listPersonBookmarks(
|
||||
secureFgpAcc?: string,
|
||||
observe?: 'response',
|
||||
reportProgress?: boolean,
|
||||
options?: {
|
||||
httpHeaderAccept?: 'application/json';
|
||||
context?: HttpContext;
|
||||
transferCache?: boolean;
|
||||
},
|
||||
): Observable<HttpResponse<Array<PersonBookmarkResponse>>>;
|
||||
public listPersonBookmarks(
|
||||
secureFgpAcc?: string,
|
||||
observe?: 'events',
|
||||
reportProgress?: boolean,
|
||||
options?: {
|
||||
httpHeaderAccept?: 'application/json';
|
||||
context?: HttpContext;
|
||||
transferCache?: boolean;
|
||||
},
|
||||
): Observable<HttpEvent<Array<PersonBookmarkResponse>>>;
|
||||
public listPersonBookmarks(
|
||||
secureFgpAcc?: string,
|
||||
observe: any = 'body',
|
||||
reportProgress: boolean = false,
|
||||
options?: {
|
||||
httpHeaderAccept?: 'application/json';
|
||||
context?: HttpContext;
|
||||
transferCache?: boolean;
|
||||
},
|
||||
): Observable<any> {
|
||||
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<Array<PersonBookmarkResponse>>(
|
||||
'get',
|
||||
`${basePath}${localVarPath}`,
|
||||
{
|
||||
context: localVarHttpContext,
|
||||
responseType: <any>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<any>;
|
||||
public removePersonBookmark(
|
||||
personId: string,
|
||||
secureFgpAcc?: string,
|
||||
observe?: 'response',
|
||||
reportProgress?: boolean,
|
||||
options?: {
|
||||
httpHeaderAccept?: 'application/json';
|
||||
context?: HttpContext;
|
||||
transferCache?: boolean;
|
||||
},
|
||||
): Observable<HttpResponse<any>>;
|
||||
public removePersonBookmark(
|
||||
personId: string,
|
||||
secureFgpAcc?: string,
|
||||
observe?: 'events',
|
||||
reportProgress?: boolean,
|
||||
options?: {
|
||||
httpHeaderAccept?: 'application/json';
|
||||
context?: HttpContext;
|
||||
transferCache?: boolean;
|
||||
},
|
||||
): Observable<HttpEvent<any>>;
|
||||
public removePersonBookmark(
|
||||
personId: string,
|
||||
secureFgpAcc?: string,
|
||||
observe: any = 'body',
|
||||
reportProgress: boolean = false,
|
||||
options?: {
|
||||
httpHeaderAccept?: 'application/json';
|
||||
context?: HttpContext;
|
||||
transferCache?: boolean;
|
||||
},
|
||||
): Observable<any> {
|
||||
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<any>(
|
||||
'delete',
|
||||
`${basePath}${localVarPath}`,
|
||||
{
|
||||
context: localVarHttpContext,
|
||||
responseType: <any>responseType_,
|
||||
...(withCredentials ? { withCredentials } : {}),
|
||||
headers: localVarHeaders,
|
||||
observe: observe,
|
||||
...(localVarTransferCache !== undefined
|
||||
? { transferCache: localVarTransferCache }
|
||||
: {}),
|
||||
reportProgress: reportProgress,
|
||||
},
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -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,12 +9,18 @@
|
||||
*/
|
||||
/* 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 { CompanyConnectionsAvailability } from '../model/companyConnectionsAvailability';
|
||||
@@ -24,137 +30,249 @@ 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);
|
||||
}
|
||||
|
||||
constructor(protected httpClient: HttpClient, @Optional() @Inject(BASE_PATH) basePath: string|string[], @Optional() configuration?: Configuration) {
|
||||
super(basePath, configuration);
|
||||
/**
|
||||
* Check whether company connections are available for an author.
|
||||
* @endpoint get /api/inse-service/authors/{author_id}/company-connections/availability
|
||||
* @param authorId
|
||||
* @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 getCompanyConnectionsAvailability(
|
||||
authorId: string,
|
||||
secureFgpAcc?: string,
|
||||
observe?: 'body',
|
||||
reportProgress?: boolean,
|
||||
options?: {
|
||||
httpHeaderAccept?: 'application/json';
|
||||
context?: HttpContext;
|
||||
transferCache?: boolean;
|
||||
},
|
||||
): Observable<CompanyConnectionsAvailability>;
|
||||
public getCompanyConnectionsAvailability(
|
||||
authorId: string,
|
||||
secureFgpAcc?: string,
|
||||
observe?: 'response',
|
||||
reportProgress?: boolean,
|
||||
options?: {
|
||||
httpHeaderAccept?: 'application/json';
|
||||
context?: HttpContext;
|
||||
transferCache?: boolean;
|
||||
},
|
||||
): Observable<HttpResponse<CompanyConnectionsAvailability>>;
|
||||
public getCompanyConnectionsAvailability(
|
||||
authorId: string,
|
||||
secureFgpAcc?: string,
|
||||
observe?: 'events',
|
||||
reportProgress?: boolean,
|
||||
options?: {
|
||||
httpHeaderAccept?: 'application/json';
|
||||
context?: HttpContext;
|
||||
transferCache?: boolean;
|
||||
},
|
||||
): Observable<HttpEvent<CompanyConnectionsAvailability>>;
|
||||
public getCompanyConnectionsAvailability(
|
||||
authorId: string,
|
||||
secureFgpAcc?: string,
|
||||
observe: any = 'body',
|
||||
reportProgress: boolean = false,
|
||||
options?: {
|
||||
httpHeaderAccept?: 'application/json';
|
||||
context?: HttpContext;
|
||||
transferCache?: boolean;
|
||||
},
|
||||
): Observable<any> {
|
||||
if (authorId === null || authorId === undefined) {
|
||||
throw new Error(
|
||||
'Required parameter authorId was null or undefined when calling getCompanyConnectionsAvailability.',
|
||||
);
|
||||
}
|
||||
|
||||
/**
|
||||
* Check whether company connections are available for an author.
|
||||
* @endpoint get /api/inse-service/authors/{author_id}/company-connections/availability
|
||||
* @param authorId
|
||||
* @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 getCompanyConnectionsAvailability(authorId: string, secureFgpAcc?: string, observe?: 'body', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable<CompanyConnectionsAvailability>;
|
||||
public getCompanyConnectionsAvailability(authorId: string, secureFgpAcc?: string, observe?: 'response', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable<HttpResponse<CompanyConnectionsAvailability>>;
|
||||
public getCompanyConnectionsAvailability(authorId: string, secureFgpAcc?: string, observe?: 'events', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable<HttpEvent<CompanyConnectionsAvailability>>;
|
||||
public getCompanyConnectionsAvailability(authorId: string, secureFgpAcc?: string, observe: any = 'body', reportProgress: boolean = false, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable<any> {
|
||||
if (authorId === null || authorId === undefined) {
|
||||
throw new Error('Required parameter authorId was null or undefined when calling getCompanyConnectionsAvailability.');
|
||||
}
|
||||
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 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/availability`;
|
||||
const { basePath, withCredentials } = this.configuration;
|
||||
return this.httpClient.request<CompanyConnectionsAvailability>('get', `${basePath}${localVarPath}`,
|
||||
{
|
||||
context: localVarHttpContext,
|
||||
responseType: <any>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,
|
||||
);
|
||||
}
|
||||
|
||||
/**
|
||||
* Get possible company connections by OpenAlex author ID.
|
||||
* @endpoint get /api/inse-service/authors/{author_id}/company-connections
|
||||
* @param authorId
|
||||
* @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 getCompanyConnectionsByAuthor(authorId: string, secureFgpAcc?: string, observe?: 'body', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable<CompanyConnectionsResponse>;
|
||||
public getCompanyConnectionsByAuthor(authorId: string, secureFgpAcc?: string, observe?: 'response', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable<HttpResponse<CompanyConnectionsResponse>>;
|
||||
public getCompanyConnectionsByAuthor(authorId: string, secureFgpAcc?: string, observe?: 'events', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable<HttpEvent<CompanyConnectionsResponse>>;
|
||||
public getCompanyConnectionsByAuthor(authorId: string, secureFgpAcc?: string, observe: any = 'body', reportProgress: boolean = false, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable<any> {
|
||||
if (authorId === null || authorId === undefined) {
|
||||
throw new Error('Required parameter authorId was null or undefined when calling getCompanyConnectionsByAuthor.');
|
||||
}
|
||||
const localVarHttpContext: HttpContext =
|
||||
options?.context ?? new HttpContext();
|
||||
|
||||
let localVarHeaders = this.defaultHeaders;
|
||||
const localVarTransferCache: boolean = options?.transferCache ?? true;
|
||||
|
||||
// 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/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<CompanyConnectionsResponse>('get', `${basePath}${localVarPath}`,
|
||||
{
|
||||
context: localVarHttpContext,
|
||||
responseType: <any>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/authors/${this.configuration.encodeParam({ name: 'authorId', value: authorId, in: 'path', style: 'simple', explode: false, dataType: 'string', dataFormat: undefined })}/company-connections/availability`;
|
||||
const { basePath, withCredentials } = this.configuration;
|
||||
return this.httpClient.request<CompanyConnectionsAvailability>(
|
||||
'get',
|
||||
`${basePath}${localVarPath}`,
|
||||
{
|
||||
context: localVarHttpContext,
|
||||
responseType: <any>responseType_,
|
||||
...(withCredentials ? { withCredentials } : {}),
|
||||
headers: localVarHeaders,
|
||||
observe: observe,
|
||||
...(localVarTransferCache !== undefined
|
||||
? { transferCache: localVarTransferCache }
|
||||
: {}),
|
||||
reportProgress: reportProgress,
|
||||
},
|
||||
);
|
||||
}
|
||||
|
||||
/**
|
||||
* Get possible company connections by OpenAlex author ID.
|
||||
* @endpoint get /api/inse-service/authors/{author_id}/company-connections
|
||||
* @param authorId
|
||||
* @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 getCompanyConnectionsByAuthor(
|
||||
authorId: string,
|
||||
secureFgpAcc?: string,
|
||||
observe?: 'body',
|
||||
reportProgress?: boolean,
|
||||
options?: {
|
||||
httpHeaderAccept?: 'application/json';
|
||||
context?: HttpContext;
|
||||
transferCache?: boolean;
|
||||
},
|
||||
): Observable<CompanyConnectionsResponse>;
|
||||
public getCompanyConnectionsByAuthor(
|
||||
authorId: string,
|
||||
secureFgpAcc?: string,
|
||||
observe?: 'response',
|
||||
reportProgress?: boolean,
|
||||
options?: {
|
||||
httpHeaderAccept?: 'application/json';
|
||||
context?: HttpContext;
|
||||
transferCache?: boolean;
|
||||
},
|
||||
): Observable<HttpResponse<CompanyConnectionsResponse>>;
|
||||
public getCompanyConnectionsByAuthor(
|
||||
authorId: string,
|
||||
secureFgpAcc?: string,
|
||||
observe?: 'events',
|
||||
reportProgress?: boolean,
|
||||
options?: {
|
||||
httpHeaderAccept?: 'application/json';
|
||||
context?: HttpContext;
|
||||
transferCache?: boolean;
|
||||
},
|
||||
): Observable<HttpEvent<CompanyConnectionsResponse>>;
|
||||
public getCompanyConnectionsByAuthor(
|
||||
authorId: string,
|
||||
secureFgpAcc?: string,
|
||||
observe: any = 'body',
|
||||
reportProgress: boolean = false,
|
||||
options?: {
|
||||
httpHeaderAccept?: 'application/json';
|
||||
context?: HttpContext;
|
||||
transferCache?: boolean;
|
||||
},
|
||||
): Observable<any> {
|
||||
if (authorId === null || authorId === undefined) {
|
||||
throw new Error(
|
||||
'Required parameter authorId was null or undefined when calling getCompanyConnectionsByAuthor.',
|
||||
);
|
||||
}
|
||||
|
||||
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/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<CompanyConnectionsResponse>(
|
||||
'get',
|
||||
`${basePath}${localVarPath}`,
|
||||
{
|
||||
context: localVarHttpContext,
|
||||
responseType: <any>responseType_,
|
||||
...(withCredentials ? { withCredentials } : {}),
|
||||
headers: localVarHeaders,
|
||||
observe: observe,
|
||||
...(localVarTransferCache !== undefined
|
||||
? { transferCache: localVarTransferCache }
|
||||
: {}),
|
||||
reportProgress: reportProgress,
|
||||
},
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -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,12 +9,18 @@
|
||||
*/
|
||||
/* 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 { DfgInstitutionSummaryPage } from '../model/dfgInstitutionSummaryPage';
|
||||
@@ -22,137 +28,231 @@ import { DfgInstitutionSummaryPage } from '../model/dfgInstitutionSummaryPage';
|
||||
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 DFGInstitutionsService extends BaseService {
|
||||
constructor(
|
||||
protected httpClient: HttpClient,
|
||||
@Optional() @Inject(BASE_PATH) basePath: string | string[],
|
||||
@Optional() configuration?: Configuration,
|
||||
) {
|
||||
super(basePath, configuration);
|
||||
}
|
||||
|
||||
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/dfg/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 getDfgInstitutionAutocompleteForSelector(
|
||||
query?: string,
|
||||
observe?: 'body',
|
||||
reportProgress?: boolean,
|
||||
options?: {
|
||||
httpHeaderAccept?: 'application/json';
|
||||
context?: HttpContext;
|
||||
transferCache?: boolean;
|
||||
},
|
||||
): Observable<DfgInstitutionSummaryPage>;
|
||||
public getDfgInstitutionAutocompleteForSelector(
|
||||
query?: string,
|
||||
observe?: 'response',
|
||||
reportProgress?: boolean,
|
||||
options?: {
|
||||
httpHeaderAccept?: 'application/json';
|
||||
context?: HttpContext;
|
||||
transferCache?: boolean;
|
||||
},
|
||||
): Observable<HttpResponse<DfgInstitutionSummaryPage>>;
|
||||
public getDfgInstitutionAutocompleteForSelector(
|
||||
query?: string,
|
||||
observe?: 'events',
|
||||
reportProgress?: boolean,
|
||||
options?: {
|
||||
httpHeaderAccept?: 'application/json';
|
||||
context?: HttpContext;
|
||||
transferCache?: boolean;
|
||||
},
|
||||
): Observable<HttpEvent<DfgInstitutionSummaryPage>>;
|
||||
public getDfgInstitutionAutocompleteForSelector(
|
||||
query?: string,
|
||||
observe: any = 'body',
|
||||
reportProgress: boolean = false,
|
||||
options?: {
|
||||
httpHeaderAccept?: 'application/json';
|
||||
context?: HttpContext;
|
||||
transferCache?: boolean;
|
||||
},
|
||||
): Observable<any> {
|
||||
let localVarQueryParameters = new HttpParams({ encoder: this.encoder });
|
||||
localVarQueryParameters = this.addToHttpParams(
|
||||
localVarQueryParameters,
|
||||
<any>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,
|
||||
);
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns a list of institutions based on a search term for autocomplete functionality.
|
||||
* @endpoint get /api/dfg/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 getDfgInstitutionAutocompleteForSelector(query?: string, observe?: 'body', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable<DfgInstitutionSummaryPage>;
|
||||
public getDfgInstitutionAutocompleteForSelector(query?: string, observe?: 'response', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable<HttpResponse<DfgInstitutionSummaryPage>>;
|
||||
public getDfgInstitutionAutocompleteForSelector(query?: string, observe?: 'events', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable<HttpEvent<DfgInstitutionSummaryPage>>;
|
||||
public getDfgInstitutionAutocompleteForSelector(query?: string, observe: any = 'body', reportProgress: boolean = false, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable<any> {
|
||||
const localVarHttpContext: HttpContext =
|
||||
options?.context ?? new HttpContext();
|
||||
|
||||
let localVarQueryParameters = new HttpParams({encoder: this.encoder});
|
||||
localVarQueryParameters = this.addToHttpParams(localVarQueryParameters,
|
||||
<any>query, 'query');
|
||||
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);
|
||||
}
|
||||
let localVarPath = `/api/dfg/institutions/autocomplete/selector`;
|
||||
const { basePath, withCredentials } = this.configuration;
|
||||
return this.httpClient.request<DfgInstitutionSummaryPage>(
|
||||
'get',
|
||||
`${basePath}${localVarPath}`,
|
||||
{
|
||||
context: localVarHttpContext,
|
||||
params: localVarQueryParameters,
|
||||
responseType: <any>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/dfg/institutions/autocomplete/selector`;
|
||||
const { basePath, withCredentials } = this.configuration;
|
||||
return this.httpClient.request<DfgInstitutionSummaryPage>('get', `${basePath}${localVarPath}`,
|
||||
{
|
||||
context: localVarHttpContext,
|
||||
params: localVarQueryParameters,
|
||||
responseType: <any>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/dfg/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 getDfgInstitutionsByIds(
|
||||
institutionIds?: Array<string>,
|
||||
observe?: 'body',
|
||||
reportProgress?: boolean,
|
||||
options?: {
|
||||
httpHeaderAccept?: 'application/json';
|
||||
context?: HttpContext;
|
||||
transferCache?: boolean;
|
||||
},
|
||||
): Observable<DfgInstitutionSummaryPage>;
|
||||
public getDfgInstitutionsByIds(
|
||||
institutionIds?: Array<string>,
|
||||
observe?: 'response',
|
||||
reportProgress?: boolean,
|
||||
options?: {
|
||||
httpHeaderAccept?: 'application/json';
|
||||
context?: HttpContext;
|
||||
transferCache?: boolean;
|
||||
},
|
||||
): Observable<HttpResponse<DfgInstitutionSummaryPage>>;
|
||||
public getDfgInstitutionsByIds(
|
||||
institutionIds?: Array<string>,
|
||||
observe?: 'events',
|
||||
reportProgress?: boolean,
|
||||
options?: {
|
||||
httpHeaderAccept?: 'application/json';
|
||||
context?: HttpContext;
|
||||
transferCache?: boolean;
|
||||
},
|
||||
): Observable<HttpEvent<DfgInstitutionSummaryPage>>;
|
||||
public getDfgInstitutionsByIds(
|
||||
institutionIds?: Array<string>,
|
||||
observe: any = 'body',
|
||||
reportProgress: boolean = false,
|
||||
options?: {
|
||||
httpHeaderAccept?: 'application/json';
|
||||
context?: HttpContext;
|
||||
transferCache?: boolean;
|
||||
},
|
||||
): Observable<any> {
|
||||
let localVarQueryParameters = new HttpParams({ encoder: this.encoder });
|
||||
if (institutionIds) {
|
||||
institutionIds.forEach((element) => {
|
||||
localVarQueryParameters = this.addToHttpParams(
|
||||
localVarQueryParameters,
|
||||
<any>element,
|
||||
'institution_ids',
|
||||
);
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns a list of institutions based on their IDs.
|
||||
* @endpoint get /api/dfg/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 getDfgInstitutionsByIds(institutionIds?: Array<string>, observe?: 'body', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable<DfgInstitutionSummaryPage>;
|
||||
public getDfgInstitutionsByIds(institutionIds?: Array<string>, observe?: 'response', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable<HttpResponse<DfgInstitutionSummaryPage>>;
|
||||
public getDfgInstitutionsByIds(institutionIds?: Array<string>, observe?: 'events', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable<HttpEvent<DfgInstitutionSummaryPage>>;
|
||||
public getDfgInstitutionsByIds(institutionIds?: Array<string>, observe: any = 'body', reportProgress: boolean = false, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable<any> {
|
||||
let localVarHeaders = this.defaultHeaders;
|
||||
|
||||
let localVarQueryParameters = new HttpParams({encoder: this.encoder});
|
||||
if (institutionIds) {
|
||||
institutionIds.forEach((element) => {
|
||||
localVarQueryParameters = this.addToHttpParams(localVarQueryParameters,
|
||||
<any>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/dfg/institutions/ids`;
|
||||
const { basePath, withCredentials } = this.configuration;
|
||||
return this.httpClient.request<DfgInstitutionSummaryPage>('get', `${basePath}${localVarPath}`,
|
||||
{
|
||||
context: localVarHttpContext,
|
||||
params: localVarQueryParameters,
|
||||
responseType: <any>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,
|
||||
);
|
||||
}
|
||||
|
||||
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/dfg/institutions/ids`;
|
||||
const { basePath, withCredentials } = this.configuration;
|
||||
return this.httpClient.request<DfgInstitutionSummaryPage>(
|
||||
'get',
|
||||
`${basePath}${localVarPath}`,
|
||||
{
|
||||
context: localVarHttpContext,
|
||||
params: localVarQueryParameters,
|
||||
responseType: <any>responseType_,
|
||||
...(withCredentials ? { withCredentials } : {}),
|
||||
headers: localVarHeaders,
|
||||
observe: observe,
|
||||
...(localVarTransferCache !== undefined
|
||||
? { transferCache: localVarTransferCache }
|
||||
: {}),
|
||||
reportProgress: reportProgress,
|
||||
},
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -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,12 +9,18 @@
|
||||
*/
|
||||
/* 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 { DfgPersonSummaryPage } from '../model/dfgPersonSummaryPage';
|
||||
@@ -22,137 +28,231 @@ import { DfgPersonSummaryPage } from '../model/dfgPersonSummaryPage';
|
||||
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 DFGPersonsService extends BaseService {
|
||||
constructor(
|
||||
protected httpClient: HttpClient,
|
||||
@Optional() @Inject(BASE_PATH) basePath: string | string[],
|
||||
@Optional() configuration?: Configuration,
|
||||
) {
|
||||
super(basePath, configuration);
|
||||
}
|
||||
|
||||
constructor(protected httpClient: HttpClient, @Optional() @Inject(BASE_PATH) basePath: string|string[], @Optional() configuration?: Configuration) {
|
||||
super(basePath, configuration);
|
||||
/**
|
||||
* Returns a list of persons based on a search term for autocomplete functionality.
|
||||
* @endpoint get /api/dfg/persons/autocomplete/selector
|
||||
* @param query A search term to filter persons 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 getDfgPersonAutocompleteForSelector(
|
||||
query?: string,
|
||||
observe?: 'body',
|
||||
reportProgress?: boolean,
|
||||
options?: {
|
||||
httpHeaderAccept?: 'application/json';
|
||||
context?: HttpContext;
|
||||
transferCache?: boolean;
|
||||
},
|
||||
): Observable<DfgPersonSummaryPage>;
|
||||
public getDfgPersonAutocompleteForSelector(
|
||||
query?: string,
|
||||
observe?: 'response',
|
||||
reportProgress?: boolean,
|
||||
options?: {
|
||||
httpHeaderAccept?: 'application/json';
|
||||
context?: HttpContext;
|
||||
transferCache?: boolean;
|
||||
},
|
||||
): Observable<HttpResponse<DfgPersonSummaryPage>>;
|
||||
public getDfgPersonAutocompleteForSelector(
|
||||
query?: string,
|
||||
observe?: 'events',
|
||||
reportProgress?: boolean,
|
||||
options?: {
|
||||
httpHeaderAccept?: 'application/json';
|
||||
context?: HttpContext;
|
||||
transferCache?: boolean;
|
||||
},
|
||||
): Observable<HttpEvent<DfgPersonSummaryPage>>;
|
||||
public getDfgPersonAutocompleteForSelector(
|
||||
query?: string,
|
||||
observe: any = 'body',
|
||||
reportProgress: boolean = false,
|
||||
options?: {
|
||||
httpHeaderAccept?: 'application/json';
|
||||
context?: HttpContext;
|
||||
transferCache?: boolean;
|
||||
},
|
||||
): Observable<any> {
|
||||
let localVarQueryParameters = new HttpParams({ encoder: this.encoder });
|
||||
localVarQueryParameters = this.addToHttpParams(
|
||||
localVarQueryParameters,
|
||||
<any>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,
|
||||
);
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns a list of persons based on a search term for autocomplete functionality.
|
||||
* @endpoint get /api/dfg/persons/autocomplete/selector
|
||||
* @param query A search term to filter persons 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 getDfgPersonAutocompleteForSelector(query?: string, observe?: 'body', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable<DfgPersonSummaryPage>;
|
||||
public getDfgPersonAutocompleteForSelector(query?: string, observe?: 'response', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable<HttpResponse<DfgPersonSummaryPage>>;
|
||||
public getDfgPersonAutocompleteForSelector(query?: string, observe?: 'events', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable<HttpEvent<DfgPersonSummaryPage>>;
|
||||
public getDfgPersonAutocompleteForSelector(query?: string, observe: any = 'body', reportProgress: boolean = false, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable<any> {
|
||||
const localVarHttpContext: HttpContext =
|
||||
options?.context ?? new HttpContext();
|
||||
|
||||
let localVarQueryParameters = new HttpParams({encoder: this.encoder});
|
||||
localVarQueryParameters = this.addToHttpParams(localVarQueryParameters,
|
||||
<any>query, 'query');
|
||||
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);
|
||||
}
|
||||
let localVarPath = `/api/dfg/persons/autocomplete/selector`;
|
||||
const { basePath, withCredentials } = this.configuration;
|
||||
return this.httpClient.request<DfgPersonSummaryPage>(
|
||||
'get',
|
||||
`${basePath}${localVarPath}`,
|
||||
{
|
||||
context: localVarHttpContext,
|
||||
params: localVarQueryParameters,
|
||||
responseType: <any>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/dfg/persons/autocomplete/selector`;
|
||||
const { basePath, withCredentials } = this.configuration;
|
||||
return this.httpClient.request<DfgPersonSummaryPage>('get', `${basePath}${localVarPath}`,
|
||||
{
|
||||
context: localVarHttpContext,
|
||||
params: localVarQueryParameters,
|
||||
responseType: <any>responseType_,
|
||||
...(withCredentials ? { withCredentials } : {}),
|
||||
headers: localVarHeaders,
|
||||
observe: observe,
|
||||
...(localVarTransferCache !== undefined ? { transferCache: localVarTransferCache } : {}),
|
||||
reportProgress: reportProgress
|
||||
}
|
||||
/**
|
||||
* Returns a list of persons based on their IDs.
|
||||
* @endpoint get /api/dfg/persons/ids
|
||||
* @param personIds A list of person 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 getDfgPersonsByIds(
|
||||
personIds?: Array<string>,
|
||||
observe?: 'body',
|
||||
reportProgress?: boolean,
|
||||
options?: {
|
||||
httpHeaderAccept?: 'application/json';
|
||||
context?: HttpContext;
|
||||
transferCache?: boolean;
|
||||
},
|
||||
): Observable<DfgPersonSummaryPage>;
|
||||
public getDfgPersonsByIds(
|
||||
personIds?: Array<string>,
|
||||
observe?: 'response',
|
||||
reportProgress?: boolean,
|
||||
options?: {
|
||||
httpHeaderAccept?: 'application/json';
|
||||
context?: HttpContext;
|
||||
transferCache?: boolean;
|
||||
},
|
||||
): Observable<HttpResponse<DfgPersonSummaryPage>>;
|
||||
public getDfgPersonsByIds(
|
||||
personIds?: Array<string>,
|
||||
observe?: 'events',
|
||||
reportProgress?: boolean,
|
||||
options?: {
|
||||
httpHeaderAccept?: 'application/json';
|
||||
context?: HttpContext;
|
||||
transferCache?: boolean;
|
||||
},
|
||||
): Observable<HttpEvent<DfgPersonSummaryPage>>;
|
||||
public getDfgPersonsByIds(
|
||||
personIds?: Array<string>,
|
||||
observe: any = 'body',
|
||||
reportProgress: boolean = false,
|
||||
options?: {
|
||||
httpHeaderAccept?: 'application/json';
|
||||
context?: HttpContext;
|
||||
transferCache?: boolean;
|
||||
},
|
||||
): Observable<any> {
|
||||
let localVarQueryParameters = new HttpParams({ encoder: this.encoder });
|
||||
if (personIds) {
|
||||
personIds.forEach((element) => {
|
||||
localVarQueryParameters = this.addToHttpParams(
|
||||
localVarQueryParameters,
|
||||
<any>element,
|
||||
'person_ids',
|
||||
);
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns a list of persons based on their IDs.
|
||||
* @endpoint get /api/dfg/persons/ids
|
||||
* @param personIds A list of person 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 getDfgPersonsByIds(personIds?: Array<string>, observe?: 'body', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable<DfgPersonSummaryPage>;
|
||||
public getDfgPersonsByIds(personIds?: Array<string>, observe?: 'response', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable<HttpResponse<DfgPersonSummaryPage>>;
|
||||
public getDfgPersonsByIds(personIds?: Array<string>, observe?: 'events', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable<HttpEvent<DfgPersonSummaryPage>>;
|
||||
public getDfgPersonsByIds(personIds?: Array<string>, observe: any = 'body', reportProgress: boolean = false, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable<any> {
|
||||
let localVarHeaders = this.defaultHeaders;
|
||||
|
||||
let localVarQueryParameters = new HttpParams({encoder: this.encoder});
|
||||
if (personIds) {
|
||||
personIds.forEach((element) => {
|
||||
localVarQueryParameters = this.addToHttpParams(localVarQueryParameters,
|
||||
<any>element, 'person_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/dfg/persons/ids`;
|
||||
const { basePath, withCredentials } = this.configuration;
|
||||
return this.httpClient.request<DfgPersonSummaryPage>('get', `${basePath}${localVarPath}`,
|
||||
{
|
||||
context: localVarHttpContext,
|
||||
params: localVarQueryParameters,
|
||||
responseType: <any>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,
|
||||
);
|
||||
}
|
||||
|
||||
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/dfg/persons/ids`;
|
||||
const { basePath, withCredentials } = this.configuration;
|
||||
return this.httpClient.request<DfgPersonSummaryPage>(
|
||||
'get',
|
||||
`${basePath}${localVarPath}`,
|
||||
{
|
||||
context: localVarHttpContext,
|
||||
params: localVarQueryParameters,
|
||||
responseType: <any>responseType_,
|
||||
...(withCredentials ? { withCredentials } : {}),
|
||||
headers: localVarHeaders,
|
||||
observe: observe,
|
||||
...(localVarTransferCache !== undefined
|
||||
? { transferCache: localVarTransferCache }
|
||||
: {}),
|
||||
reportProgress: reportProgress,
|
||||
},
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
@@ -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,12 +9,18 @@
|
||||
*/
|
||||
/* 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';
|
||||
@@ -24,192 +30,333 @@ import { Institution } from '../model/institution';
|
||||
import { InstitutionPageV2 } from '../model/institutionPageV2';
|
||||
|
||||
// @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 InstitutionsV2Service extends BaseService {
|
||||
constructor(
|
||||
protected httpClient: HttpClient,
|
||||
@Optional() @Inject(BASE_PATH) basePath: string | string[],
|
||||
@Optional() configuration?: Configuration,
|
||||
) {
|
||||
super(basePath, configuration);
|
||||
}
|
||||
|
||||
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/institutions/v2/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<InstitutionPageV2>;
|
||||
public getInstitutionAutocompleteForSelector(
|
||||
query?: string,
|
||||
observe?: 'response',
|
||||
reportProgress?: boolean,
|
||||
options?: {
|
||||
httpHeaderAccept?: 'application/json';
|
||||
context?: HttpContext;
|
||||
transferCache?: boolean;
|
||||
},
|
||||
): Observable<HttpResponse<InstitutionPageV2>>;
|
||||
public getInstitutionAutocompleteForSelector(
|
||||
query?: string,
|
||||
observe?: 'events',
|
||||
reportProgress?: boolean,
|
||||
options?: {
|
||||
httpHeaderAccept?: 'application/json';
|
||||
context?: HttpContext;
|
||||
transferCache?: boolean;
|
||||
},
|
||||
): Observable<HttpEvent<InstitutionPageV2>>;
|
||||
public getInstitutionAutocompleteForSelector(
|
||||
query?: string,
|
||||
observe: any = 'body',
|
||||
reportProgress: boolean = false,
|
||||
options?: {
|
||||
httpHeaderAccept?: 'application/json';
|
||||
context?: HttpContext;
|
||||
transferCache?: boolean;
|
||||
},
|
||||
): Observable<any> {
|
||||
let localVarQueryParameters = new HttpParams({ encoder: this.encoder });
|
||||
localVarQueryParameters = this.addToHttpParams(
|
||||
localVarQueryParameters,
|
||||
<any>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,
|
||||
);
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns a list of institutions based on a search term for autocomplete functionality.
|
||||
* @endpoint get /api/institutions/v2/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<InstitutionPageV2>;
|
||||
public getInstitutionAutocompleteForSelector(query?: string, observe?: 'response', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable<HttpResponse<InstitutionPageV2>>;
|
||||
public getInstitutionAutocompleteForSelector(query?: string, observe?: 'events', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable<HttpEvent<InstitutionPageV2>>;
|
||||
public getInstitutionAutocompleteForSelector(query?: string, observe: any = 'body', reportProgress: boolean = false, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable<any> {
|
||||
const localVarHttpContext: HttpContext =
|
||||
options?.context ?? new HttpContext();
|
||||
|
||||
let localVarQueryParameters = new HttpParams({encoder: this.encoder});
|
||||
localVarQueryParameters = this.addToHttpParams(localVarQueryParameters,
|
||||
<any>query, 'query');
|
||||
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);
|
||||
}
|
||||
let localVarPath = `/api/institutions/v2/autocomplete/selector`;
|
||||
const { basePath, withCredentials } = this.configuration;
|
||||
return this.httpClient.request<InstitutionPageV2>(
|
||||
'get',
|
||||
`${basePath}${localVarPath}`,
|
||||
{
|
||||
context: localVarHttpContext,
|
||||
params: localVarQueryParameters,
|
||||
responseType: <any>responseType_,
|
||||
...(withCredentials ? { withCredentials } : {}),
|
||||
headers: localVarHeaders,
|
||||
observe: observe,
|
||||
...(localVarTransferCache !== undefined
|
||||
? { transferCache: localVarTransferCache }
|
||||
: {}),
|
||||
reportProgress: reportProgress,
|
||||
},
|
||||
);
|
||||
}
|
||||
|
||||
const localVarHttpContext: HttpContext = options?.context ?? new HttpContext();
|
||||
/**
|
||||
* Returns an institution based on its ID.
|
||||
* @endpoint get /api/institutions/v2/single/{institution_id}
|
||||
* @param institutionId The ID of the institution 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 getInstitutionById2(
|
||||
institutionId: string,
|
||||
observe?: 'body',
|
||||
reportProgress?: boolean,
|
||||
options?: {
|
||||
httpHeaderAccept?: 'application/json';
|
||||
context?: HttpContext;
|
||||
transferCache?: boolean;
|
||||
},
|
||||
): Observable<Institution>;
|
||||
public getInstitutionById2(
|
||||
institutionId: string,
|
||||
observe?: 'response',
|
||||
reportProgress?: boolean,
|
||||
options?: {
|
||||
httpHeaderAccept?: 'application/json';
|
||||
context?: HttpContext;
|
||||
transferCache?: boolean;
|
||||
},
|
||||
): Observable<HttpResponse<Institution>>;
|
||||
public getInstitutionById2(
|
||||
institutionId: string,
|
||||
observe?: 'events',
|
||||
reportProgress?: boolean,
|
||||
options?: {
|
||||
httpHeaderAccept?: 'application/json';
|
||||
context?: HttpContext;
|
||||
transferCache?: boolean;
|
||||
},
|
||||
): Observable<HttpEvent<Institution>>;
|
||||
public getInstitutionById2(
|
||||
institutionId: string,
|
||||
observe: any = 'body',
|
||||
reportProgress: boolean = false,
|
||||
options?: {
|
||||
httpHeaderAccept?: 'application/json';
|
||||
context?: HttpContext;
|
||||
transferCache?: boolean;
|
||||
},
|
||||
): Observable<any> {
|
||||
if (institutionId === null || institutionId === undefined) {
|
||||
throw new Error(
|
||||
'Required parameter institutionId was null or undefined when calling getInstitutionById2.',
|
||||
);
|
||||
}
|
||||
|
||||
const localVarTransferCache: boolean = options?.transferCache ?? true;
|
||||
let localVarHeaders = this.defaultHeaders;
|
||||
|
||||
const localVarHttpHeaderAcceptSelected: string | undefined =
|
||||
options?.httpHeaderAccept ??
|
||||
this.configuration.selectHeaderAccept(['application/json']);
|
||||
if (localVarHttpHeaderAcceptSelected !== undefined) {
|
||||
localVarHeaders = localVarHeaders.set(
|
||||
'Accept',
|
||||
localVarHttpHeaderAcceptSelected,
|
||||
);
|
||||
}
|
||||
|
||||
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 localVarHttpContext: HttpContext =
|
||||
options?.context ?? new HttpContext();
|
||||
|
||||
let localVarPath = `/api/institutions/v2/autocomplete/selector`;
|
||||
const { basePath, withCredentials } = this.configuration;
|
||||
return this.httpClient.request<InstitutionPageV2>('get', `${basePath}${localVarPath}`,
|
||||
{
|
||||
context: localVarHttpContext,
|
||||
params: localVarQueryParameters,
|
||||
responseType: <any>responseType_,
|
||||
...(withCredentials ? { withCredentials } : {}),
|
||||
headers: localVarHeaders,
|
||||
observe: observe,
|
||||
...(localVarTransferCache !== undefined ? { transferCache: localVarTransferCache } : {}),
|
||||
reportProgress: reportProgress
|
||||
}
|
||||
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/institutions/v2/single/${this.configuration.encodeParam({ name: 'institutionId', value: institutionId, in: 'path', style: 'simple', explode: false, dataType: 'string', dataFormat: undefined })}`;
|
||||
const { basePath, withCredentials } = this.configuration;
|
||||
return this.httpClient.request<Institution>(
|
||||
'get',
|
||||
`${basePath}${localVarPath}`,
|
||||
{
|
||||
context: localVarHttpContext,
|
||||
responseType: <any>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/institutions/v2/multiple/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<string>,
|
||||
observe?: 'body',
|
||||
reportProgress?: boolean,
|
||||
options?: {
|
||||
httpHeaderAccept?: 'application/json';
|
||||
context?: HttpContext;
|
||||
transferCache?: boolean;
|
||||
},
|
||||
): Observable<InstitutionPageV2>;
|
||||
public getInstitutionsByIds(
|
||||
institutionIds?: Array<string>,
|
||||
observe?: 'response',
|
||||
reportProgress?: boolean,
|
||||
options?: {
|
||||
httpHeaderAccept?: 'application/json';
|
||||
context?: HttpContext;
|
||||
transferCache?: boolean;
|
||||
},
|
||||
): Observable<HttpResponse<InstitutionPageV2>>;
|
||||
public getInstitutionsByIds(
|
||||
institutionIds?: Array<string>,
|
||||
observe?: 'events',
|
||||
reportProgress?: boolean,
|
||||
options?: {
|
||||
httpHeaderAccept?: 'application/json';
|
||||
context?: HttpContext;
|
||||
transferCache?: boolean;
|
||||
},
|
||||
): Observable<HttpEvent<InstitutionPageV2>>;
|
||||
public getInstitutionsByIds(
|
||||
institutionIds?: Array<string>,
|
||||
observe: any = 'body',
|
||||
reportProgress: boolean = false,
|
||||
options?: {
|
||||
httpHeaderAccept?: 'application/json';
|
||||
context?: HttpContext;
|
||||
transferCache?: boolean;
|
||||
},
|
||||
): Observable<any> {
|
||||
let localVarQueryParameters = new HttpParams({ encoder: this.encoder });
|
||||
if (institutionIds) {
|
||||
institutionIds.forEach((element) => {
|
||||
localVarQueryParameters = this.addToHttpParams(
|
||||
localVarQueryParameters,
|
||||
<any>element,
|
||||
'institution_ids',
|
||||
);
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns an institution based on its ID.
|
||||
* @endpoint get /api/institutions/v2/single/{institution_id}
|
||||
* @param institutionId The ID of the institution 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 getInstitutionById2(institutionId: string, observe?: 'body', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable<Institution>;
|
||||
public getInstitutionById2(institutionId: string, observe?: 'response', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable<HttpResponse<Institution>>;
|
||||
public getInstitutionById2(institutionId: string, observe?: 'events', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable<HttpEvent<Institution>>;
|
||||
public getInstitutionById2(institutionId: string, observe: any = 'body', reportProgress: boolean = false, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable<any> {
|
||||
if (institutionId === null || institutionId === undefined) {
|
||||
throw new Error('Required parameter institutionId was null or undefined when calling getInstitutionById2.');
|
||||
}
|
||||
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 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/institutions/v2/single/${this.configuration.encodeParam({name: "institutionId", value: institutionId, in: "path", style: "simple", explode: false, dataType: "string", dataFormat: undefined})}`;
|
||||
const { basePath, withCredentials } = this.configuration;
|
||||
return this.httpClient.request<Institution>('get', `${basePath}${localVarPath}`,
|
||||
{
|
||||
context: localVarHttpContext,
|
||||
responseType: <any>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,
|
||||
);
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns a list of institutions based on their IDs.
|
||||
* @endpoint get /api/institutions/v2/multiple/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<string>, observe?: 'body', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable<InstitutionPageV2>;
|
||||
public getInstitutionsByIds(institutionIds?: Array<string>, observe?: 'response', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable<HttpResponse<InstitutionPageV2>>;
|
||||
public getInstitutionsByIds(institutionIds?: Array<string>, observe?: 'events', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable<HttpEvent<InstitutionPageV2>>;
|
||||
public getInstitutionsByIds(institutionIds?: Array<string>, observe: any = 'body', reportProgress: boolean = false, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable<any> {
|
||||
const localVarHttpContext: HttpContext =
|
||||
options?.context ?? new HttpContext();
|
||||
|
||||
let localVarQueryParameters = new HttpParams({encoder: this.encoder});
|
||||
if (institutionIds) {
|
||||
institutionIds.forEach((element) => {
|
||||
localVarQueryParameters = this.addToHttpParams(localVarQueryParameters,
|
||||
<any>element, 'institution_ids');
|
||||
})
|
||||
}
|
||||
const localVarTransferCache: boolean = options?.transferCache ?? true;
|
||||
|
||||
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/institutions/v2/multiple/ids`;
|
||||
const { basePath, withCredentials } = this.configuration;
|
||||
return this.httpClient.request<InstitutionPageV2>('get', `${basePath}${localVarPath}`,
|
||||
{
|
||||
context: localVarHttpContext,
|
||||
params: localVarQueryParameters,
|
||||
responseType: <any>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/institutions/v2/multiple/ids`;
|
||||
const { basePath, withCredentials } = this.configuration;
|
||||
return this.httpClient.request<InstitutionPageV2>(
|
||||
'get',
|
||||
`${basePath}${localVarPath}`,
|
||||
{
|
||||
context: localVarHttpContext,
|
||||
params: localVarQueryParameters,
|
||||
responseType: <any>responseType_,
|
||||
...(withCredentials ? { withCredentials } : {}),
|
||||
headers: localVarHeaders,
|
||||
observe: observe,
|
||||
...(localVarTransferCache !== undefined
|
||||
? { transferCache: localVarTransferCache }
|
||||
: {}),
|
||||
reportProgress: reportProgress,
|
||||
},
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
+1529
-527
File diff suppressed because it is too large
Load Diff
@@ -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,12 +9,18 @@
|
||||
*/
|
||||
/* 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';
|
||||
@@ -23,292 +29,679 @@ import { HTTPValidationError } from '../model/hTTPValidationError';
|
||||
// @ts-ignore
|
||||
import { InseOrganizationManagementModelOrganizationProfile } from '../model/inseOrganizationManagementModelOrganizationProfile';
|
||||
// @ts-ignore
|
||||
import { InstitutionAssociationsResponse } from '../model/institutionAssociationsResponse';
|
||||
// @ts-ignore
|
||||
import { OrganizationPage } from '../model/organizationPage';
|
||||
// @ts-ignore
|
||||
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);
|
||||
}
|
||||
|
||||
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<InseOrganizationManagementModelOrganizationProfile>;
|
||||
public createOrganisation(
|
||||
createOrganizationRequest: CreateOrganizationRequest,
|
||||
secureFgpAcc?: string,
|
||||
observe?: 'response',
|
||||
reportProgress?: boolean,
|
||||
options?: {
|
||||
httpHeaderAccept?: 'application/json';
|
||||
context?: HttpContext;
|
||||
transferCache?: boolean;
|
||||
},
|
||||
): Observable<
|
||||
HttpResponse<InseOrganizationManagementModelOrganizationProfile>
|
||||
>;
|
||||
public createOrganisation(
|
||||
createOrganizationRequest: CreateOrganizationRequest,
|
||||
secureFgpAcc?: string,
|
||||
observe?: 'events',
|
||||
reportProgress?: boolean,
|
||||
options?: {
|
||||
httpHeaderAccept?: 'application/json';
|
||||
context?: HttpContext;
|
||||
transferCache?: boolean;
|
||||
},
|
||||
): Observable<HttpEvent<InseOrganizationManagementModelOrganizationProfile>>;
|
||||
public createOrganisation(
|
||||
createOrganizationRequest: CreateOrganizationRequest,
|
||||
secureFgpAcc?: string,
|
||||
observe: any = 'body',
|
||||
reportProgress: boolean = false,
|
||||
options?: {
|
||||
httpHeaderAccept?: 'application/json';
|
||||
context?: HttpContext;
|
||||
transferCache?: boolean;
|
||||
},
|
||||
): Observable<any> {
|
||||
if (
|
||||
createOrganizationRequest === null ||
|
||||
createOrganizationRequest === undefined
|
||||
) {
|
||||
throw new Error(
|
||||
'Required parameter createOrganizationRequest was null or undefined when calling createOrganisation.',
|
||||
);
|
||||
}
|
||||
|
||||
/**
|
||||
* 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<InseOrganizationManagementModelOrganizationProfile>;
|
||||
public createOrganisation(createOrganizationRequest: CreateOrganizationRequest, secureFgpAcc?: string, observe?: 'response', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable<HttpResponse<InseOrganizationManagementModelOrganizationProfile>>;
|
||||
public createOrganisation(createOrganizationRequest: CreateOrganizationRequest, secureFgpAcc?: string, observe?: 'events', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable<HttpEvent<InseOrganizationManagementModelOrganizationProfile>>;
|
||||
public createOrganisation(createOrganizationRequest: CreateOrganizationRequest, secureFgpAcc?: string, observe: any = 'body', reportProgress: boolean = false, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable<any> {
|
||||
if (createOrganizationRequest === null || createOrganizationRequest === undefined) {
|
||||
throw new Error('Required parameter createOrganizationRequest was null or undefined when calling createOrganisation.');
|
||||
}
|
||||
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 localVarHttpContext: HttpContext = options?.context ?? new HttpContext();
|
||||
const localVarTransferCache: boolean = options?.transferCache ?? true;
|
||||
|
||||
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';
|
||||
}
|
||||
}
|
||||
|
||||
// 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 localVarPath = `/api/organizations`;
|
||||
const { basePath, withCredentials } = this.configuration;
|
||||
return this.httpClient.request<InseOrganizationManagementModelOrganizationProfile>(
|
||||
'post',
|
||||
`${basePath}${localVarPath}`,
|
||||
{
|
||||
context: localVarHttpContext,
|
||||
body: createOrganizationRequest,
|
||||
responseType: <any>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 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<any>;
|
||||
public deleteOrganisation(
|
||||
organizationId: string,
|
||||
secureFgpAcc?: string,
|
||||
observe?: 'response',
|
||||
reportProgress?: boolean,
|
||||
options?: {
|
||||
httpHeaderAccept?: 'application/json';
|
||||
context?: HttpContext;
|
||||
transferCache?: boolean;
|
||||
},
|
||||
): Observable<HttpResponse<any>>;
|
||||
public deleteOrganisation(
|
||||
organizationId: string,
|
||||
secureFgpAcc?: string,
|
||||
observe?: 'events',
|
||||
reportProgress?: boolean,
|
||||
options?: {
|
||||
httpHeaderAccept?: 'application/json';
|
||||
context?: HttpContext;
|
||||
transferCache?: boolean;
|
||||
},
|
||||
): Observable<HttpEvent<any>>;
|
||||
public deleteOrganisation(
|
||||
organizationId: string,
|
||||
secureFgpAcc?: string,
|
||||
observe: any = 'body',
|
||||
reportProgress: boolean = false,
|
||||
options?: {
|
||||
httpHeaderAccept?: 'application/json';
|
||||
context?: HttpContext;
|
||||
transferCache?: boolean;
|
||||
},
|
||||
): Observable<any> {
|
||||
if (organizationId === null || organizationId === undefined) {
|
||||
throw new Error(
|
||||
'Required parameter organizationId was null or undefined when calling deleteOrganisation.',
|
||||
);
|
||||
}
|
||||
|
||||
let localVarPath = `/api/organizations`;
|
||||
const { basePath, withCredentials } = this.configuration;
|
||||
return this.httpClient.request<InseOrganizationManagementModelOrganizationProfile>('post', `${basePath}${localVarPath}`,
|
||||
{
|
||||
context: localVarHttpContext,
|
||||
body: createOrganizationRequest,
|
||||
responseType: <any>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<any>(
|
||||
'delete',
|
||||
`${basePath}${localVarPath}`,
|
||||
{
|
||||
context: localVarHttpContext,
|
||||
responseType: <any>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<OrganizationPage>;
|
||||
public getOrganisations(
|
||||
page?: number,
|
||||
pageSize?: number,
|
||||
offset?: number,
|
||||
secureFgpAcc?: string,
|
||||
observe?: 'response',
|
||||
reportProgress?: boolean,
|
||||
options?: {
|
||||
httpHeaderAccept?: 'application/json';
|
||||
context?: HttpContext;
|
||||
transferCache?: boolean;
|
||||
},
|
||||
): Observable<HttpResponse<OrganizationPage>>;
|
||||
public getOrganisations(
|
||||
page?: number,
|
||||
pageSize?: number,
|
||||
offset?: number,
|
||||
secureFgpAcc?: string,
|
||||
observe?: 'events',
|
||||
reportProgress?: boolean,
|
||||
options?: {
|
||||
httpHeaderAccept?: 'application/json';
|
||||
context?: HttpContext;
|
||||
transferCache?: boolean;
|
||||
},
|
||||
): Observable<HttpEvent<OrganizationPage>>;
|
||||
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<any> {
|
||||
let localVarQueryParameters = new HttpParams({ encoder: this.encoder });
|
||||
localVarQueryParameters = this.addToHttpParams(
|
||||
localVarQueryParameters,
|
||||
<any>page,
|
||||
'page',
|
||||
);
|
||||
localVarQueryParameters = this.addToHttpParams(
|
||||
localVarQueryParameters,
|
||||
<any>pageSize,
|
||||
'page_size',
|
||||
);
|
||||
localVarQueryParameters = this.addToHttpParams(
|
||||
localVarQueryParameters,
|
||||
<any>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<OrganizationPage>(
|
||||
'get',
|
||||
`${basePath}${localVarPath}`,
|
||||
{
|
||||
context: localVarHttpContext,
|
||||
params: localVarQueryParameters,
|
||||
responseType: <any>responseType_,
|
||||
...(withCredentials ? { withCredentials } : {}),
|
||||
headers: localVarHeaders,
|
||||
observe: observe,
|
||||
...(localVarTransferCache !== undefined
|
||||
? { transferCache: localVarTransferCache }
|
||||
: {}),
|
||||
reportProgress: reportProgress,
|
||||
},
|
||||
);
|
||||
}
|
||||
|
||||
/**
|
||||
* Get Organization Institution Associations
|
||||
* @endpoint get /api/organizations/institutions/associations
|
||||
* @param institutionIds
|
||||
* @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 getOrganizationInstitutionAssociations(
|
||||
institutionIds: Array<string>,
|
||||
secureFgpAcc?: string,
|
||||
observe?: 'body',
|
||||
reportProgress?: boolean,
|
||||
options?: {
|
||||
httpHeaderAccept?: 'application/json';
|
||||
context?: HttpContext;
|
||||
transferCache?: boolean;
|
||||
},
|
||||
): Observable<Array<InstitutionAssociationsResponse>>;
|
||||
public getOrganizationInstitutionAssociations(
|
||||
institutionIds: Array<string>,
|
||||
secureFgpAcc?: string,
|
||||
observe?: 'response',
|
||||
reportProgress?: boolean,
|
||||
options?: {
|
||||
httpHeaderAccept?: 'application/json';
|
||||
context?: HttpContext;
|
||||
transferCache?: boolean;
|
||||
},
|
||||
): Observable<HttpResponse<Array<InstitutionAssociationsResponse>>>;
|
||||
public getOrganizationInstitutionAssociations(
|
||||
institutionIds: Array<string>,
|
||||
secureFgpAcc?: string,
|
||||
observe?: 'events',
|
||||
reportProgress?: boolean,
|
||||
options?: {
|
||||
httpHeaderAccept?: 'application/json';
|
||||
context?: HttpContext;
|
||||
transferCache?: boolean;
|
||||
},
|
||||
): Observable<HttpEvent<Array<InstitutionAssociationsResponse>>>;
|
||||
public getOrganizationInstitutionAssociations(
|
||||
institutionIds: Array<string>,
|
||||
secureFgpAcc?: string,
|
||||
observe: any = 'body',
|
||||
reportProgress: boolean = false,
|
||||
options?: {
|
||||
httpHeaderAccept?: 'application/json';
|
||||
context?: HttpContext;
|
||||
transferCache?: boolean;
|
||||
},
|
||||
): Observable<any> {
|
||||
if (institutionIds === null || institutionIds === undefined) {
|
||||
throw new Error(
|
||||
'Required parameter institutionIds was null or undefined when calling getOrganizationInstitutionAssociations.',
|
||||
);
|
||||
}
|
||||
|
||||
let localVarQueryParameters = new HttpParams({ encoder: this.encoder });
|
||||
if (institutionIds) {
|
||||
institutionIds.forEach((element) => {
|
||||
localVarQueryParameters = this.addToHttpParams(
|
||||
localVarQueryParameters,
|
||||
<any>element,
|
||||
'institution_ids',
|
||||
);
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* 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<any>;
|
||||
public deleteOrganisation(organizationId: string, secureFgpAcc?: string, observe?: 'response', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable<HttpResponse<any>>;
|
||||
public deleteOrganisation(organizationId: string, secureFgpAcc?: string, observe?: 'events', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable<HttpEvent<any>>;
|
||||
public deleteOrganisation(organizationId: string, secureFgpAcc?: string, observe: any = 'body', reportProgress: boolean = false, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable<any> {
|
||||
if (organizationId === null || organizationId === undefined) {
|
||||
throw new Error('Required parameter organizationId was null or undefined when calling deleteOrganisation.');
|
||||
}
|
||||
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 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<any>('delete', `${basePath}${localVarPath}`,
|
||||
{
|
||||
context: localVarHttpContext,
|
||||
responseType: <any>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,
|
||||
);
|
||||
}
|
||||
|
||||
/**
|
||||
* 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<OrganizationPage>;
|
||||
public getOrganisations(page?: number, pageSize?: number, offset?: number, secureFgpAcc?: string, observe?: 'response', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable<HttpResponse<OrganizationPage>>;
|
||||
public getOrganisations(page?: number, pageSize?: number, offset?: number, secureFgpAcc?: string, observe?: 'events', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable<HttpEvent<OrganizationPage>>;
|
||||
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<any> {
|
||||
const localVarHttpContext: HttpContext =
|
||||
options?.context ?? new HttpContext();
|
||||
|
||||
let localVarQueryParameters = new HttpParams({encoder: this.encoder});
|
||||
localVarQueryParameters = this.addToHttpParams(localVarQueryParameters,
|
||||
<any>page, 'page');
|
||||
localVarQueryParameters = this.addToHttpParams(localVarQueryParameters,
|
||||
<any>pageSize, 'page_size');
|
||||
localVarQueryParameters = this.addToHttpParams(localVarQueryParameters,
|
||||
<any>offset, 'offset');
|
||||
const localVarTransferCache: boolean = options?.transferCache ?? true;
|
||||
|
||||
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<OrganizationPage>('get', `${basePath}${localVarPath}`,
|
||||
{
|
||||
context: localVarHttpContext,
|
||||
params: localVarQueryParameters,
|
||||
responseType: <any>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';
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 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<InseOrganizationManagementModelOrganizationProfile>;
|
||||
public updateOrganisation(organizationId: string, updateOrganizationRequest: UpdateOrganizationRequest, secureFgpAcc?: string, observe?: 'response', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable<HttpResponse<InseOrganizationManagementModelOrganizationProfile>>;
|
||||
public updateOrganisation(organizationId: string, updateOrganizationRequest: UpdateOrganizationRequest, secureFgpAcc?: string, observe?: 'events', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable<HttpEvent<InseOrganizationManagementModelOrganizationProfile>>;
|
||||
public updateOrganisation(organizationId: string, updateOrganizationRequest: UpdateOrganizationRequest, secureFgpAcc?: string, observe: any = 'body', reportProgress: boolean = false, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable<any> {
|
||||
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 localVarPath = `/api/organizations/institutions/associations`;
|
||||
const { basePath, withCredentials } = this.configuration;
|
||||
return this.httpClient.request<Array<InstitutionAssociationsResponse>>(
|
||||
'get',
|
||||
`${basePath}${localVarPath}`,
|
||||
{
|
||||
context: localVarHttpContext,
|
||||
params: localVarQueryParameters,
|
||||
responseType: <any>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;
|
||||
|
||||
|
||||
// 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<InseOrganizationManagementModelOrganizationProfile>('put', `${basePath}${localVarPath}`,
|
||||
{
|
||||
context: localVarHttpContext,
|
||||
body: updateOrganizationRequest,
|
||||
responseType: <any>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<InseOrganizationManagementModelOrganizationProfile>;
|
||||
public updateOrganisation(
|
||||
organizationId: string,
|
||||
updateOrganizationRequest: UpdateOrganizationRequest,
|
||||
secureFgpAcc?: string,
|
||||
observe?: 'response',
|
||||
reportProgress?: boolean,
|
||||
options?: {
|
||||
httpHeaderAccept?: 'application/json';
|
||||
context?: HttpContext;
|
||||
transferCache?: boolean;
|
||||
},
|
||||
): Observable<
|
||||
HttpResponse<InseOrganizationManagementModelOrganizationProfile>
|
||||
>;
|
||||
public updateOrganisation(
|
||||
organizationId: string,
|
||||
updateOrganizationRequest: UpdateOrganizationRequest,
|
||||
secureFgpAcc?: string,
|
||||
observe?: 'events',
|
||||
reportProgress?: boolean,
|
||||
options?: {
|
||||
httpHeaderAccept?: 'application/json';
|
||||
context?: HttpContext;
|
||||
transferCache?: boolean;
|
||||
},
|
||||
): Observable<HttpEvent<InseOrganizationManagementModelOrganizationProfile>>;
|
||||
public updateOrganisation(
|
||||
organizationId: string,
|
||||
updateOrganizationRequest: UpdateOrganizationRequest,
|
||||
secureFgpAcc?: string,
|
||||
observe: any = 'body',
|
||||
reportProgress: boolean = false,
|
||||
options?: {
|
||||
httpHeaderAccept?: 'application/json';
|
||||
context?: HttpContext;
|
||||
transferCache?: boolean;
|
||||
},
|
||||
): Observable<any> {
|
||||
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<InseOrganizationManagementModelOrganizationProfile>(
|
||||
'put',
|
||||
`${basePath}${localVarPath}`,
|
||||
{
|
||||
context: localVarHttpContext,
|
||||
body: updateOrganizationRequest,
|
||||
responseType: <any>responseType_,
|
||||
...(withCredentials ? { withCredentials } : {}),
|
||||
headers: localVarHeaders,
|
||||
observe: observe,
|
||||
...(localVarTransferCache !== undefined
|
||||
? { transferCache: localVarTransferCache }
|
||||
: {}),
|
||||
reportProgress: reportProgress,
|
||||
},
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
+2261
-1131
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
@@ -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,51 +10,47 @@
|
||||
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<UserRole>;
|
||||
/**
|
||||
* 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 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<UserRole>;
|
||||
/**
|
||||
* 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 {}
|
||||
|
||||
@@ -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,16 @@
|
||||
*/
|
||||
import { UserRole } from './userRole';
|
||||
|
||||
|
||||
export interface AccountProfile {
|
||||
id: string;
|
||||
email: string;
|
||||
name: string;
|
||||
roles: Array<UserRole>;
|
||||
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<UserRole>;
|
||||
organization_id: string;
|
||||
organization_name: string;
|
||||
deleted: boolean;
|
||||
activated: boolean;
|
||||
is_current?: boolean;
|
||||
is_real_account?: boolean;
|
||||
is_impersonating?: boolean;
|
||||
}
|
||||
|
||||
|
||||
@@ -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,14 @@
|
||||
*/
|
||||
import { CompanyStatusFilter } from './companyStatusFilter';
|
||||
|
||||
|
||||
export interface AuthorMetricsRequest {
|
||||
/**
|
||||
* OpenAlex IDs of the authors.
|
||||
*/
|
||||
author_ids: Array<string>;
|
||||
/**
|
||||
* Which companies to count for the company-foundations metric: \'all\', only \'active\' (non-deleted), or only \'deleted\'.
|
||||
*/
|
||||
company_status?: CompanyStatusFilter;
|
||||
export interface AuthorMetricsRequest {
|
||||
/**
|
||||
* OpenAlex IDs of the authors.
|
||||
*/
|
||||
author_ids: Array<string>;
|
||||
/**
|
||||
* Which companies to count for the company-foundations metric: \'all\', only \'active\' (non-deleted), or only \'deleted\'.
|
||||
*/
|
||||
company_status?: CompanyStatusFilter;
|
||||
}
|
||||
export namespace AuthorMetricsRequest {
|
||||
}
|
||||
|
||||
|
||||
export namespace AuthorMetricsRequest {}
|
||||
|
||||
@@ -1,26 +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.
|
||||
*/
|
||||
|
||||
|
||||
export interface AuthorNode {
|
||||
/**
|
||||
* The ID of the author.
|
||||
*/
|
||||
id: string;
|
||||
/**
|
||||
* The display name of the author.
|
||||
*/
|
||||
display_name: string;
|
||||
/**
|
||||
* IDs of institutions this author is affiliated with.
|
||||
*/
|
||||
institution_ids?: Array<string>;
|
||||
export interface AuthorNode {
|
||||
/**
|
||||
* The ID of the author.
|
||||
*/
|
||||
id: string;
|
||||
/**
|
||||
* The display name of the author.
|
||||
*/
|
||||
display_name: string;
|
||||
/**
|
||||
* IDs of institutions this author is affiliated with.
|
||||
*/
|
||||
institution_ids?: Array<string>;
|
||||
}
|
||||
|
||||
|
||||
@@ -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,18 @@
|
||||
*/
|
||||
import { AuthorOrientationProfileStatus } from './authorOrientationProfileStatus';
|
||||
|
||||
|
||||
/**
|
||||
* Aggregated research-orientation result for one selected author.
|
||||
*/
|
||||
export interface AuthorOrientationProfile {
|
||||
/**
|
||||
* The full OpenAlex author ID.
|
||||
*/
|
||||
author_id: string;
|
||||
status: AuthorOrientationProfileStatus;
|
||||
orientation_score?: number | null;
|
||||
primary_category_counts?: { [key: string]: number; } | null;
|
||||
classified_work_count?: number | null;
|
||||
scored_work_count?: number | null;
|
||||
export interface AuthorOrientationProfile {
|
||||
/**
|
||||
* The full OpenAlex author ID.
|
||||
*/
|
||||
author_id: string;
|
||||
status: AuthorOrientationProfileStatus;
|
||||
orientation_score?: number | null;
|
||||
primary_category_counts?: { [key: string]: number } | null;
|
||||
classified_work_count?: number | null;
|
||||
scored_work_count?: number | null;
|
||||
}
|
||||
export namespace AuthorOrientationProfile {
|
||||
}
|
||||
|
||||
|
||||
export namespace AuthorOrientationProfile {}
|
||||
|
||||
@@ -1,20 +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 AuthorOrientationProfileStatus = {
|
||||
Available: 'available',
|
||||
InsufficientScoredPublications: 'insufficient_scored_publications',
|
||||
NoClassifiedPublications: 'no_classified_publications',
|
||||
NoOrientationScore: 'no_orientation_score',
|
||||
Restricted: 'restricted'
|
||||
Available: 'available',
|
||||
InsufficientScoredPublications: 'insufficient_scored_publications',
|
||||
NoClassifiedPublications: 'no_classified_publications',
|
||||
NoOrientationScore: 'no_orientation_score',
|
||||
Restricted: 'restricted',
|
||||
} as const;
|
||||
export type AuthorOrientationProfileStatus = typeof AuthorOrientationProfileStatus[keyof typeof AuthorOrientationProfileStatus];
|
||||
|
||||
export type AuthorOrientationProfileStatus =
|
||||
(typeof AuthorOrientationProfileStatus)[keyof typeof AuthorOrientationProfileStatus];
|
||||
|
||||
@@ -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,19 +10,17 @@
|
||||
import { Timespan } from './timespan';
|
||||
import { PublicationType } from './publicationType';
|
||||
|
||||
|
||||
/**
|
||||
* Filters used to compare the research orientation of selected authors.
|
||||
*/
|
||||
export interface AuthorOrientationProfilesRequest {
|
||||
/**
|
||||
* One to four unique OpenAlex author IDs.
|
||||
*/
|
||||
author_ids: Array<string>;
|
||||
/**
|
||||
* Optional publication-type filter. Empty means all types.
|
||||
*/
|
||||
publication_types?: Array<PublicationType>;
|
||||
timespan?: Timespan | null;
|
||||
export interface AuthorOrientationProfilesRequest {
|
||||
/**
|
||||
* One to four unique OpenAlex author IDs.
|
||||
*/
|
||||
author_ids: Array<string>;
|
||||
/**
|
||||
* Optional publication-type filter. Empty means all types.
|
||||
*/
|
||||
publication_types?: Array<PublicationType>;
|
||||
timespan?: Timespan | null;
|
||||
}
|
||||
|
||||
|
||||
@@ -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,26 +9,24 @@
|
||||
*/
|
||||
import { Author } from './author';
|
||||
|
||||
|
||||
/**
|
||||
* A paginated response containing a list of authors.
|
||||
*/
|
||||
export interface AuthorPage {
|
||||
/**
|
||||
* The elements of the page.
|
||||
*/
|
||||
elements?: Array<Author>;
|
||||
/**
|
||||
* The page number. (0-based)
|
||||
*/
|
||||
page?: number;
|
||||
/**
|
||||
* The page size in elements.
|
||||
*/
|
||||
size?: number;
|
||||
/**
|
||||
* The total number of elements.
|
||||
*/
|
||||
total?: number;
|
||||
export interface AuthorPage {
|
||||
/**
|
||||
* The elements of the page.
|
||||
*/
|
||||
elements?: Array<Author>;
|
||||
/**
|
||||
* The page number. (0-based)
|
||||
*/
|
||||
page?: number;
|
||||
/**
|
||||
* The page size in elements.
|
||||
*/
|
||||
size?: number;
|
||||
/**
|
||||
* The total number of elements.
|
||||
*/
|
||||
total?: number;
|
||||
}
|
||||
|
||||
|
||||
@@ -1,37 +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.
|
||||
*/
|
||||
|
||||
|
||||
/**
|
||||
* Section 2: author-level stats independent of any keyword/topic/time filter.
|
||||
*/
|
||||
export interface AuthorStaticStats {
|
||||
/**
|
||||
* The OpenAlex ID of the author.
|
||||
*/
|
||||
author_id: string;
|
||||
/**
|
||||
* The name of the author.
|
||||
*/
|
||||
display_name: string;
|
||||
/**
|
||||
* Number of Handelsregister company connections matched by the author\'s name.
|
||||
*/
|
||||
companies_count: number;
|
||||
/**
|
||||
* Number of news articles that mention the author by exact name.
|
||||
*/
|
||||
news_count: number;
|
||||
/**
|
||||
* Number of patents matched to the author (from the org_patents index).
|
||||
*/
|
||||
patents_count: number;
|
||||
export interface AuthorStaticStats {
|
||||
/**
|
||||
* The OpenAlex ID of the author.
|
||||
*/
|
||||
author_id: string;
|
||||
/**
|
||||
* The name of the author.
|
||||
*/
|
||||
display_name: string;
|
||||
/**
|
||||
* Number of Handelsregister company connections matched by the author\'s name.
|
||||
*/
|
||||
companies_count: number;
|
||||
/**
|
||||
* Number of news articles that mention the author by exact name.
|
||||
*/
|
||||
news_count: number;
|
||||
/**
|
||||
* Number of patents matched to the author (from the org_patents index).
|
||||
*/
|
||||
patents_count: number;
|
||||
}
|
||||
|
||||
|
||||
@@ -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,43 +9,108 @@
|
||||
*/
|
||||
import { SubfieldShare } from './subfieldShare';
|
||||
|
||||
|
||||
export interface AuthorTopicProfile {
|
||||
/**
|
||||
* The OpenAlex ID of the author.
|
||||
*/
|
||||
author_id: string;
|
||||
/**
|
||||
* The name of the author.
|
||||
*/
|
||||
display_name: string;
|
||||
/**
|
||||
* All works of the author in the timespan, regardless of the topic filter.
|
||||
*/
|
||||
works_total: number;
|
||||
/**
|
||||
* Works matching the topic filter (same subset as Section 1).
|
||||
*/
|
||||
matched_works: number;
|
||||
/**
|
||||
* Matched works where one of the searched topics is the work\'s primary topic (only meaningful for filter_type \'topic\').
|
||||
*/
|
||||
primary_topic_matches: number;
|
||||
/**
|
||||
* Number of distinct primary topics across all works.
|
||||
*/
|
||||
distinct_topics: number;
|
||||
/**
|
||||
* Number of distinct primary-topic subfields across all works.
|
||||
*/
|
||||
distinct_subfields: number;
|
||||
/**
|
||||
* Number of distinct primary-topic fields across all works.
|
||||
*/
|
||||
distinct_fields: number;
|
||||
/**
|
||||
* Top subfields over all works, by primary topic, largest first.
|
||||
*/
|
||||
subfields?: Array<SubfieldShare>;
|
||||
/**
|
||||
* A primary topic within a subfield.
|
||||
*/
|
||||
export interface TopicNode {
|
||||
/**
|
||||
* The OpenAlex ID of the primary topic.
|
||||
*/
|
||||
id: string;
|
||||
/**
|
||||
* The primary-topic display name.
|
||||
*/
|
||||
name: string;
|
||||
/**
|
||||
* Number of works whose primary topic is this topic.
|
||||
*/
|
||||
count: number;
|
||||
}
|
||||
|
||||
/**
|
||||
* A subfield within a field, with its primary topics.
|
||||
*/
|
||||
export interface SubfieldNode {
|
||||
/**
|
||||
* The OpenAlex ID of the subfield.
|
||||
*/
|
||||
id: string;
|
||||
/**
|
||||
* The subfield display name.
|
||||
*/
|
||||
name: string;
|
||||
/**
|
||||
* Number of works whose primary topic belongs to this subfield.
|
||||
*/
|
||||
count: number;
|
||||
/**
|
||||
* Primary topics within this subfield, largest first.
|
||||
*/
|
||||
topics: Array<TopicNode>;
|
||||
}
|
||||
|
||||
/**
|
||||
* A field with its subfields, top of the primary-topic hierarchy.
|
||||
*/
|
||||
export interface FieldNode {
|
||||
/**
|
||||
* The OpenAlex ID of the field.
|
||||
*/
|
||||
id: string;
|
||||
/**
|
||||
* The field display name.
|
||||
*/
|
||||
name: string;
|
||||
/**
|
||||
* Number of works whose primary topic belongs to this field.
|
||||
*/
|
||||
count: number;
|
||||
/**
|
||||
* Subfields within this field, largest first.
|
||||
*/
|
||||
subfields: Array<SubfieldNode>;
|
||||
}
|
||||
|
||||
export interface AuthorTopicProfile {
|
||||
/**
|
||||
* The OpenAlex ID of the author.
|
||||
*/
|
||||
author_id: string;
|
||||
/**
|
||||
* The name of the author.
|
||||
*/
|
||||
display_name: string;
|
||||
/**
|
||||
* All works of the author in the timespan, regardless of the topic filter.
|
||||
*/
|
||||
works_total: number;
|
||||
/**
|
||||
* Works matching the topic filter (same subset as Section 1).
|
||||
*/
|
||||
matched_works: number;
|
||||
/**
|
||||
* Matched works where one of the searched topics is the work\'s primary topic (only meaningful for filter_type \'topic\').
|
||||
*/
|
||||
primary_topic_matches: number;
|
||||
/**
|
||||
* Number of distinct primary topics across all works.
|
||||
*/
|
||||
distinct_topics: number;
|
||||
/**
|
||||
* Number of distinct primary-topic subfields across all works.
|
||||
*/
|
||||
distinct_subfields: number;
|
||||
/**
|
||||
* Number of distinct primary-topic fields across all works.
|
||||
*/
|
||||
distinct_fields: number;
|
||||
/**
|
||||
* Top subfields over all works, by primary topic, largest first.
|
||||
*/
|
||||
subfields?: Array<SubfieldShare>;
|
||||
/**
|
||||
* Field -> subfield -> topic hierarchy over all works, by primary topic,
|
||||
* each level largest first. Drives the interactive topic treemap.
|
||||
*/
|
||||
field_tree: Array<FieldNode>;
|
||||
}
|
||||
|
||||
@@ -1,95 +1,93 @@
|
||||
/**
|
||||
* 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.
|
||||
*/
|
||||
|
||||
|
||||
/**
|
||||
* Section 1: combined stats over an author\'s works that match the topic filter.
|
||||
*/
|
||||
export interface AuthorTopicStats {
|
||||
/**
|
||||
* The OpenAlex ID of the author.
|
||||
*/
|
||||
author_id: string;
|
||||
/**
|
||||
* The name of the author.
|
||||
*/
|
||||
display_name: string;
|
||||
/**
|
||||
* Number of the author\'s works matching the topic filter.
|
||||
*/
|
||||
works_total: number;
|
||||
/**
|
||||
* Number of the author\'s topic works where they are the corresponding author.
|
||||
*/
|
||||
corresponding_count: number;
|
||||
/**
|
||||
* Average field-normalized citation percentile (0-1) over the author\'s topic works.
|
||||
*/
|
||||
avg_percentile: number;
|
||||
/**
|
||||
* Number of the author\'s topic works in the top 1% most-cited.
|
||||
*/
|
||||
top1_count: number;
|
||||
/**
|
||||
* Number of the author\'s topic works in the top 10% most-cited.
|
||||
*/
|
||||
top10_count: number;
|
||||
/**
|
||||
* Number of the author\'s topic works with a field-weighted citation impact (FWCI) above 1 (cited more than the field/year/type average).
|
||||
*/
|
||||
fwci_above_one_count?: number;
|
||||
/**
|
||||
* Total citations across the author\'s topic works.
|
||||
*/
|
||||
citations_total?: number;
|
||||
/**
|
||||
* Average citations per topic work.
|
||||
*/
|
||||
avg_citations?: number;
|
||||
/**
|
||||
* Citations of the author\'s most-cited topic work.
|
||||
*/
|
||||
max_citations?: number;
|
||||
/**
|
||||
* h-index over the author\'s topic works (capped at 100).
|
||||
*/
|
||||
h_index?: number;
|
||||
/**
|
||||
* Average field-weighted citation impact (FWCI) over the author\'s topic works; works without an FWCI value are excluded.
|
||||
*/
|
||||
avg_fwci?: number;
|
||||
/**
|
||||
* Number of the author\'s topic works with at least one co-author institution of type \'company\'.
|
||||
*/
|
||||
industry_works_count?: number;
|
||||
first_year?: number | null;
|
||||
last_year?: number | null;
|
||||
/**
|
||||
* Number of the author\'s topic works where the matched keyword\'s relevance score is above 0.8.
|
||||
*/
|
||||
relevance_above_80_count?: number;
|
||||
/**
|
||||
* Average matched-keyword relevance score (0-1) over the author\'s topic works.
|
||||
*/
|
||||
avg_relevance?: number;
|
||||
/**
|
||||
* Number of the author\'s topic works where they are the first author.
|
||||
*/
|
||||
first_author_count?: number;
|
||||
/**
|
||||
* Number of the author\'s topic works where they are a middle author.
|
||||
*/
|
||||
middle_author_count?: number;
|
||||
/**
|
||||
* Number of the author\'s topic works where they are the last author.
|
||||
*/
|
||||
last_author_count?: number;
|
||||
export interface AuthorTopicStats {
|
||||
/**
|
||||
* The OpenAlex ID of the author.
|
||||
*/
|
||||
author_id: string;
|
||||
/**
|
||||
* The name of the author.
|
||||
*/
|
||||
display_name: string;
|
||||
/**
|
||||
* Number of the author\'s works matching the topic filter.
|
||||
*/
|
||||
works_total: number;
|
||||
/**
|
||||
* Number of the author\'s topic works where they are the corresponding author.
|
||||
*/
|
||||
corresponding_count: number;
|
||||
/**
|
||||
* Average field-normalized citation percentile (0-1) over the author\'s topic works.
|
||||
*/
|
||||
avg_percentile: number;
|
||||
/**
|
||||
* Number of the author\'s topic works in the top 1% most-cited.
|
||||
*/
|
||||
top1_count: number;
|
||||
/**
|
||||
* Number of the author\'s topic works in the top 10% most-cited.
|
||||
*/
|
||||
top10_count: number;
|
||||
/**
|
||||
* Number of the author\'s topic works with a field-weighted citation impact (FWCI) above 1 (cited more than the field/year/type average).
|
||||
*/
|
||||
fwci_above_one_count?: number;
|
||||
/**
|
||||
* Total citations across the author\'s topic works.
|
||||
*/
|
||||
citations_total?: number;
|
||||
/**
|
||||
* Average citations per topic work.
|
||||
*/
|
||||
avg_citations?: number;
|
||||
/**
|
||||
* Citations of the author\'s most-cited topic work.
|
||||
*/
|
||||
max_citations?: number;
|
||||
/**
|
||||
* h-index over the author\'s topic works (capped at 100).
|
||||
*/
|
||||
h_index?: number;
|
||||
/**
|
||||
* Average field-weighted citation impact (FWCI) over the author\'s topic works; works without an FWCI value are excluded.
|
||||
*/
|
||||
avg_fwci?: number;
|
||||
/**
|
||||
* Number of the author\'s topic works with at least one co-author institution of type \'company\'.
|
||||
*/
|
||||
industry_works_count?: number;
|
||||
first_year?: number | null;
|
||||
last_year?: number | null;
|
||||
/**
|
||||
* Number of the author\'s topic works where the matched keyword\'s relevance score is above 0.8.
|
||||
*/
|
||||
relevance_above_80_count?: number;
|
||||
/**
|
||||
* Average matched-keyword relevance score (0-1) over the author\'s topic works.
|
||||
*/
|
||||
avg_relevance?: number;
|
||||
/**
|
||||
* Number of the author\'s topic works where they are the first author.
|
||||
*/
|
||||
first_author_count?: number;
|
||||
/**
|
||||
* Number of the author\'s topic works where they are a middle author.
|
||||
*/
|
||||
middle_author_count?: number;
|
||||
/**
|
||||
* Number of the author\'s topic works where they are the last author.
|
||||
*/
|
||||
last_author_count?: number;
|
||||
}
|
||||
|
||||
|
||||
@@ -1,16 +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 AvailableImages {
|
||||
images: Array<string>;
|
||||
detail?: string;
|
||||
export interface AvailableImages {
|
||||
images: Array<string>;
|
||||
detail?: string;
|
||||
}
|
||||
|
||||
|
||||
@@ -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,17 @@
|
||||
*/
|
||||
import { JobRun } from './jobRun';
|
||||
|
||||
|
||||
export interface BackgroundJobTask {
|
||||
id: number;
|
||||
name: string;
|
||||
description: string;
|
||||
target_index: string;
|
||||
image: string | null;
|
||||
command: string | null;
|
||||
env: { [key: string]: string; };
|
||||
schedule: string | null;
|
||||
enabled: boolean;
|
||||
next_run_at: string | null;
|
||||
last_run: JobRun | null;
|
||||
status: string;
|
||||
export interface BackgroundJobTask {
|
||||
id: number;
|
||||
name: string;
|
||||
description: string;
|
||||
target_index: string;
|
||||
image: string | null;
|
||||
command: string | null;
|
||||
env: { [key: string]: string };
|
||||
schedule: string | null;
|
||||
enabled: boolean;
|
||||
next_run_at: string | null;
|
||||
last_run: JobRun | null;
|
||||
status: string;
|
||||
}
|
||||
|
||||
|
||||
@@ -1,19 +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 BmbfProjectStatusStatistics {
|
||||
institution_id: string;
|
||||
organization_name: string;
|
||||
ongoing: number;
|
||||
upcoming: number;
|
||||
completed: number;
|
||||
export interface BmbfProjectStatusStatistics {
|
||||
institution_id: string;
|
||||
organization_name: string;
|
||||
ongoing: number;
|
||||
upcoming: number;
|
||||
completed: number;
|
||||
}
|
||||
|
||||
|
||||
@@ -1,25 +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.
|
||||
*/
|
||||
|
||||
|
||||
/**
|
||||
* A single institution entry derived from a BUND project record. Note: this index has no dedicated institution entity — each entry is reconstructed from the agency/recipient fields on a single project hit, so the same institution may appear multiple times (once per project).
|
||||
*/
|
||||
export interface BundInstitutionSummary {
|
||||
department?: string | null;
|
||||
department_fullname?: string | null;
|
||||
name?: string | null;
|
||||
recepient?: string | null;
|
||||
municipality?: string | null;
|
||||
place?: string | null;
|
||||
state?: string | null;
|
||||
country?: string | null;
|
||||
export interface BundInstitutionSummary {
|
||||
department?: string | null;
|
||||
department_fullname?: string | null;
|
||||
name?: string | null;
|
||||
recepient?: string | null;
|
||||
municipality?: string | null;
|
||||
place?: string | null;
|
||||
state?: string | null;
|
||||
country?: string | null;
|
||||
}
|
||||
|
||||
|
||||
@@ -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,26 +9,24 @@
|
||||
*/
|
||||
import { BundInstitutionSummary } from './bundInstitutionSummary';
|
||||
|
||||
|
||||
/**
|
||||
* A paginated response containing a list of institutions.
|
||||
*/
|
||||
export interface BundInstitutionSummaryPage {
|
||||
/**
|
||||
* The elements of the page.
|
||||
*/
|
||||
elements?: Array<BundInstitutionSummary>;
|
||||
/**
|
||||
* The page number. (0-based)
|
||||
*/
|
||||
page?: number;
|
||||
/**
|
||||
* The page size in elements.
|
||||
*/
|
||||
size?: number;
|
||||
/**
|
||||
* The total number of elements.
|
||||
*/
|
||||
total?: number;
|
||||
export interface BundInstitutionSummaryPage {
|
||||
/**
|
||||
* The elements of the page.
|
||||
*/
|
||||
elements?: Array<BundInstitutionSummary>;
|
||||
/**
|
||||
* The page number. (0-based)
|
||||
*/
|
||||
page?: number;
|
||||
/**
|
||||
* The page size in elements.
|
||||
*/
|
||||
size?: number;
|
||||
/**
|
||||
* The total number of elements.
|
||||
*/
|
||||
total?: number;
|
||||
}
|
||||
|
||||
|
||||
@@ -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,51 +9,49 @@
|
||||
*/
|
||||
import { Topic } from './topic';
|
||||
|
||||
|
||||
/**
|
||||
* 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<string>;
|
||||
/**
|
||||
* All institutions associated with the Bund project
|
||||
*/
|
||||
institutions?: Array<string>;
|
||||
oa_topics?: Array<Topic> | null;
|
||||
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<string>;
|
||||
/**
|
||||
* All institutions associated with the Bund project
|
||||
*/
|
||||
institutions?: Array<string>;
|
||||
oa_topics?: Array<Topic> | null;
|
||||
}
|
||||
|
||||
|
||||
@@ -0,0 +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.
|
||||
*/
|
||||
|
||||
|
||||
/**
|
||||
* Highlighted matching fragments from a BUND project search.
|
||||
*/
|
||||
export interface BundProjectHighlight {
|
||||
/**
|
||||
* Highlights from the Elasticsearch field \"Verbundprojekt\".
|
||||
*/
|
||||
joint_project?: Array<string>;
|
||||
/**
|
||||
* Highlights from the Elasticsearch field \"Thema\".
|
||||
*/
|
||||
topic?: Array<string>;
|
||||
/**
|
||||
* Highlights from the Elasticsearch field \"Zuwendungsempfänger\".
|
||||
*/
|
||||
recipient?: Array<string>;
|
||||
/**
|
||||
* Highlights from the Elasticsearch field \"Ausführende Stelle\".
|
||||
*/
|
||||
implementing_agency?: Array<string>;
|
||||
}
|
||||
|
||||
@@ -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,23 +9,21 @@
|
||||
*/
|
||||
import { BundProjectSummary } from './bundProjectSummary';
|
||||
|
||||
|
||||
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<BundProjectSummary>;
|
||||
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<BundProjectSummary>;
|
||||
}
|
||||
|
||||
|
||||
@@ -1,46 +1,46 @@
|
||||
/**
|
||||
* 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 { BundProjectHighlight } from './bundProjectHighlight';
|
||||
import { Topic } from './topic';
|
||||
import { BundInstitutionSummary } from './bundInstitutionSummary';
|
||||
|
||||
|
||||
export interface BundProjectSummary {
|
||||
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;
|
||||
oa_topics?: Array<Topic> | null;
|
||||
institution?: BundInstitutionSummary | null;
|
||||
export interface BundProjectSummary {
|
||||
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;
|
||||
oa_topics?: Array<Topic> | null;
|
||||
institution?: BundInstitutionSummary | null;
|
||||
highlight?: BundProjectHighlight | null;
|
||||
}
|
||||
|
||||
|
||||
@@ -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.
|
||||
*/
|
||||
import { DfgProjectTopic } from './dfgProjectTopic';
|
||||
|
||||
|
||||
export interface BundProjectTopics {
|
||||
institution_id: string;
|
||||
organization_name: string;
|
||||
project_count: number;
|
||||
matched_project_count: number;
|
||||
topics: Array<DfgProjectTopic>;
|
||||
}
|
||||
|
||||
@@ -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,27 +12,25 @@ import { Edge } from './edge';
|
||||
import { InstitutionNode } from './institutionNode';
|
||||
import { AuthorNode } from './authorNode';
|
||||
|
||||
|
||||
export interface CollaborationGraph {
|
||||
/**
|
||||
* The ID of the root author.
|
||||
*/
|
||||
root_author_id: string;
|
||||
/**
|
||||
* A list of author nodes.
|
||||
*/
|
||||
authors?: Array<AuthorNode>;
|
||||
/**
|
||||
* A list of institution nodes.
|
||||
*/
|
||||
institutions?: Array<InstitutionNode>;
|
||||
/**
|
||||
* A list of work nodes.
|
||||
*/
|
||||
works?: Array<WorkNode>;
|
||||
/**
|
||||
* A list of edges in the collaboration graph.
|
||||
*/
|
||||
edges?: Array<Edge>;
|
||||
export interface CollaborationGraph {
|
||||
/**
|
||||
* The ID of the root author.
|
||||
*/
|
||||
root_author_id: string;
|
||||
/**
|
||||
* A list of author nodes.
|
||||
*/
|
||||
authors?: Array<AuthorNode>;
|
||||
/**
|
||||
* A list of institution nodes.
|
||||
*/
|
||||
institutions?: Array<InstitutionNode>;
|
||||
/**
|
||||
* A list of work nodes.
|
||||
*/
|
||||
works?: Array<WorkNode>;
|
||||
/**
|
||||
* A list of edges in the collaboration graph.
|
||||
*/
|
||||
edges?: Array<Edge>;
|
||||
}
|
||||
|
||||
|
||||
@@ -1,18 +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 CollaborationGraphStatus = {
|
||||
Pending: 'pending',
|
||||
Completed: 'completed',
|
||||
Failed: 'failed'
|
||||
Pending: 'pending',
|
||||
Completed: 'completed',
|
||||
Failed: 'failed',
|
||||
} as const;
|
||||
export type CollaborationGraphStatus = typeof CollaborationGraphStatus[keyof typeof CollaborationGraphStatus];
|
||||
|
||||
export type CollaborationGraphStatus =
|
||||
(typeof CollaborationGraphStatus)[keyof typeof CollaborationGraphStatus];
|
||||
|
||||
@@ -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,16 +10,12 @@
|
||||
import { CollaborationGraph } from './collaborationGraph';
|
||||
import { CollaborationGraphStatus } from './collaborationGraphStatus';
|
||||
|
||||
|
||||
export interface CollaborationGraphStatusResponse {
|
||||
/**
|
||||
* The status of the collaboration graph.
|
||||
*/
|
||||
status: CollaborationGraphStatus;
|
||||
result?: CollaborationGraph | null;
|
||||
error_message?: string | null;
|
||||
export interface CollaborationGraphStatusResponse {
|
||||
/**
|
||||
* The status of the collaboration graph.
|
||||
*/
|
||||
status: CollaborationGraphStatus;
|
||||
result?: CollaborationGraph | null;
|
||||
error_message?: string | null;
|
||||
}
|
||||
export namespace CollaborationGraphStatusResponse {
|
||||
}
|
||||
|
||||
|
||||
export namespace CollaborationGraphStatusResponse {}
|
||||
|
||||
@@ -1,15 +1,13 @@
|
||||
/**
|
||||
* 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 CompanyConnectionsAvailability {
|
||||
available: boolean;
|
||||
export interface CompanyConnectionsAvailability {
|
||||
available: boolean;
|
||||
}
|
||||
|
||||
|
||||
@@ -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,12 @@
|
||||
*/
|
||||
import { CompanyConnection } from './companyConnection';
|
||||
|
||||
|
||||
export interface CompanyConnectionsResponse {
|
||||
author_id: string;
|
||||
display_name?: string | null;
|
||||
matching_method?: string | null;
|
||||
company_count: number;
|
||||
has_more_results: boolean;
|
||||
common_name_warning: boolean;
|
||||
connections?: Array<CompanyConnection>;
|
||||
export interface CompanyConnectionsResponse {
|
||||
author_id: string;
|
||||
display_name?: string | null;
|
||||
matching_method?: string | null;
|
||||
company_count: number;
|
||||
has_more_results: boolean;
|
||||
common_name_warning: boolean;
|
||||
connections?: Array<CompanyConnection>;
|
||||
}
|
||||
|
||||
|
||||
@@ -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,11 @@
|
||||
*/
|
||||
import { UserRole } from './userRole';
|
||||
|
||||
|
||||
export interface CreateAccountRequest {
|
||||
email: string;
|
||||
name: string;
|
||||
roles?: Array<UserRole>;
|
||||
organization_id: string;
|
||||
password: string;
|
||||
openalex_person_id?: string | null;
|
||||
export interface CreateAccountRequest {
|
||||
email: string;
|
||||
name: string;
|
||||
roles?: Array<UserRole>;
|
||||
organization_id: string;
|
||||
password: string;
|
||||
openalex_person_id?: string | null;
|
||||
}
|
||||
|
||||
|
||||
@@ -1,16 +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 CreateOrganizationRequest {
|
||||
name: string;
|
||||
other_inst_id?: string | null;
|
||||
export interface CreateOrganizationRequest {
|
||||
name: string;
|
||||
other_inst_id?: string | null;
|
||||
selected_openalex_institution_ids?: Array<string> | null;
|
||||
}
|
||||
|
||||
|
||||
@@ -1,15 +1,13 @@
|
||||
/**
|
||||
* 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;
|
||||
}
|
||||
|
||||
|
||||
@@ -1,25 +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.
|
||||
*/
|
||||
|
||||
|
||||
/**
|
||||
* DFGProjectFachgebieteInner
|
||||
*/
|
||||
export interface DFGProjectFachgebieteInner {
|
||||
fach?: string | null;
|
||||
fach_code?: string | null;
|
||||
fachgebiet?: string | null;
|
||||
fachgebiet_code?: string | null;
|
||||
fachkollegium?: string | null;
|
||||
fachkollegium_code?: string | null;
|
||||
wissenschaftsbereich?: string | null;
|
||||
wissenschaftsbereich_code?: string | null;
|
||||
export interface DFGProjectFachgebieteInner {
|
||||
fach?: string | null;
|
||||
fach_code?: string | null;
|
||||
fachgebiet?: string | null;
|
||||
fachgebiet_code?: string | null;
|
||||
fachkollegium?: string | null;
|
||||
fachkollegium_code?: string | null;
|
||||
wissenschaftsbereich?: string | null;
|
||||
wissenschaftsbereich_code?: string | null;
|
||||
}
|
||||
|
||||
|
||||
@@ -1,17 +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 DashboardStatisticValue {
|
||||
institution_id: string;
|
||||
organization_name: string;
|
||||
value: number;
|
||||
export interface DashboardStatisticValue {
|
||||
institution_id: string;
|
||||
organization_name: string;
|
||||
value: number;
|
||||
}
|
||||
|
||||
|
||||
@@ -1,22 +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 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;
|
||||
}
|
||||
|
||||
|
||||
@@ -1,25 +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.
|
||||
*/
|
||||
|
||||
|
||||
/**
|
||||
* A summary of a DFG institution.
|
||||
*/
|
||||
export interface DfgInstitutionSummary {
|
||||
id: number;
|
||||
institute_name_de?: string | null;
|
||||
institute_name_en?: string | null;
|
||||
root_id?: number | null;
|
||||
root_name_de?: string | null;
|
||||
root_name_en?: string | null;
|
||||
address_country_de?: string | null;
|
||||
address_country_en?: string | null;
|
||||
export interface DfgInstitutionSummary {
|
||||
id: number;
|
||||
institute_name_de?: string | null;
|
||||
institute_name_en?: string | null;
|
||||
root_id?: number | null;
|
||||
root_name_de?: string | null;
|
||||
root_name_en?: string | null;
|
||||
address_country_de?: string | null;
|
||||
address_country_en?: string | null;
|
||||
}
|
||||
|
||||
|
||||
@@ -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,26 +9,24 @@
|
||||
*/
|
||||
import { DfgInstitutionSummary } from './dfgInstitutionSummary';
|
||||
|
||||
|
||||
/**
|
||||
* A paginated response containing a list of institutions.
|
||||
*/
|
||||
export interface DfgInstitutionSummaryPage {
|
||||
/**
|
||||
* The elements of the page.
|
||||
*/
|
||||
elements?: Array<DfgInstitutionSummary>;
|
||||
/**
|
||||
* The page number. (0-based)
|
||||
*/
|
||||
page?: number;
|
||||
/**
|
||||
* The page size in elements.
|
||||
*/
|
||||
size?: number;
|
||||
/**
|
||||
* The total number of elements.
|
||||
*/
|
||||
total?: number;
|
||||
export interface DfgInstitutionSummaryPage {
|
||||
/**
|
||||
* The elements of the page.
|
||||
*/
|
||||
elements?: Array<DfgInstitutionSummary>;
|
||||
/**
|
||||
* The page number. (0-based)
|
||||
*/
|
||||
page?: number;
|
||||
/**
|
||||
* The page size in elements.
|
||||
*/
|
||||
size?: number;
|
||||
/**
|
||||
* The total number of elements.
|
||||
*/
|
||||
total?: number;
|
||||
}
|
||||
|
||||
|
||||
@@ -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,12 @@
|
||||
*/
|
||||
import { DfgInstitutionSummary } from './dfgInstitutionSummary';
|
||||
|
||||
|
||||
export interface DfgPersonSummary {
|
||||
person_id: number;
|
||||
orcid_id?: string | null;
|
||||
project_ref_id?: number | null;
|
||||
full_name?: string | null;
|
||||
role_label_en?: string | null;
|
||||
role_label_de?: string | null;
|
||||
institution?: DfgInstitutionSummary | null;
|
||||
export interface DfgPersonSummary {
|
||||
person_id: number;
|
||||
orcid_id?: string | null;
|
||||
project_ref_id?: number | null;
|
||||
full_name?: string | null;
|
||||
role_label_en?: string | null;
|
||||
role_label_de?: string | null;
|
||||
institution?: DfgInstitutionSummary | null;
|
||||
}
|
||||
|
||||
|
||||
@@ -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,26 +9,24 @@
|
||||
*/
|
||||
import { DfgPersonSummary } from './dfgPersonSummary';
|
||||
|
||||
|
||||
/**
|
||||
* A paginated response containing a list of persons.
|
||||
*/
|
||||
export interface DfgPersonSummaryPage {
|
||||
/**
|
||||
* The elements of the page.
|
||||
*/
|
||||
elements?: Array<DfgPersonSummary>;
|
||||
/**
|
||||
* The page number. (0-based)
|
||||
*/
|
||||
page?: number;
|
||||
/**
|
||||
* The page size in elements.
|
||||
*/
|
||||
size?: number;
|
||||
/**
|
||||
* The total number of elements.
|
||||
*/
|
||||
total?: number;
|
||||
export interface DfgPersonSummaryPage {
|
||||
/**
|
||||
* The elements of the page.
|
||||
*/
|
||||
elements?: Array<DfgPersonSummary>;
|
||||
/**
|
||||
* The page number. (0-based)
|
||||
*/
|
||||
page?: number;
|
||||
/**
|
||||
* The page size in elements.
|
||||
*/
|
||||
size?: number;
|
||||
/**
|
||||
* The total number of elements.
|
||||
*/
|
||||
total?: number;
|
||||
}
|
||||
|
||||
|
||||
@@ -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,71 +14,69 @@ import { DFGProjectFachgebieteInner } from './dFGProjectFachgebieteInner';
|
||||
import { Topic } from './topic';
|
||||
import { DfgProjectPublicationSummary } from './dfgProjectPublicationSummary';
|
||||
|
||||
|
||||
/**
|
||||
* Clean, enriched summary model for a DFG project.
|
||||
*/
|
||||
export interface DfgProjectDetails {
|
||||
id?: number | null;
|
||||
link?: string | null;
|
||||
page_url?: string | null;
|
||||
external_link?: string | null;
|
||||
title_de?: string | null;
|
||||
title_en?: string | null;
|
||||
description_de?: string | null;
|
||||
description_en?: string | null;
|
||||
final_report_abstract_de?: string | null;
|
||||
final_report_abstract_en?: string | null;
|
||||
project_identifier_de?: string | null;
|
||||
project_identifier_en?: string | null;
|
||||
funding_start?: number | null;
|
||||
funding_end?: number | null;
|
||||
funding_period_de?: string | null;
|
||||
funding_period_en?: string | null;
|
||||
funding_type_de?: string | null;
|
||||
funding_type_en?: string | null;
|
||||
funding_type_key?: string | null;
|
||||
dfg_procedure?: string | null;
|
||||
is_transfer_project?: boolean | null;
|
||||
website_html_de?: string | null;
|
||||
website_html_en?: string | null;
|
||||
equipment_group?: string | null;
|
||||
equipment_name?: string | null;
|
||||
subject_area_de?: string | null;
|
||||
subject_area_en?: string | null;
|
||||
/**
|
||||
* Detailed DFG subject-area classification entries (Fachsystematik)
|
||||
*/
|
||||
subject_classifications?: Array<DFGProjectFachgebieteInner>;
|
||||
international_relation_de?: string | null;
|
||||
international_relation_en?: string | null;
|
||||
/**
|
||||
* All persons associated with the project, each with their role
|
||||
*/
|
||||
persons?: Array<DfgProjectPersonRole>;
|
||||
/**
|
||||
* All institutions associated with the project, each with their role
|
||||
*/
|
||||
institutions?: Array<DfgProjectInstitutionRole>;
|
||||
/**
|
||||
* Flat, de-duplicated list of all person full names (convenience view)
|
||||
*/
|
||||
associated_persons?: Array<string>;
|
||||
/**
|
||||
* Flat, de-duplicated list of all institution names (convenience view)
|
||||
*/
|
||||
associated_institutions?: Array<string>;
|
||||
parent_project_id?: number | null;
|
||||
parent_title_de?: string | null;
|
||||
parent_title_en?: string | null;
|
||||
/**
|
||||
* Sub-projects of this project, if any
|
||||
*/
|
||||
subprojects?: Array<DfgProjectSubprojectSummary>;
|
||||
/**
|
||||
* Publications resulting from the project
|
||||
*/
|
||||
publications?: Array<DfgProjectPublicationSummary>;
|
||||
topics?: Array<Topic> | null;
|
||||
export interface DfgProjectDetails {
|
||||
id?: number | null;
|
||||
link?: string | null;
|
||||
page_url?: string | null;
|
||||
external_link?: string | null;
|
||||
title_de?: string | null;
|
||||
title_en?: string | null;
|
||||
description_de?: string | null;
|
||||
description_en?: string | null;
|
||||
final_report_abstract_de?: string | null;
|
||||
final_report_abstract_en?: string | null;
|
||||
project_identifier_de?: string | null;
|
||||
project_identifier_en?: string | null;
|
||||
funding_start?: number | null;
|
||||
funding_end?: number | null;
|
||||
funding_period_de?: string | null;
|
||||
funding_period_en?: string | null;
|
||||
funding_type_de?: string | null;
|
||||
funding_type_en?: string | null;
|
||||
funding_type_key?: string | null;
|
||||
dfg_procedure?: string | null;
|
||||
is_transfer_project?: boolean | null;
|
||||
website_html_de?: string | null;
|
||||
website_html_en?: string | null;
|
||||
equipment_group?: string | null;
|
||||
equipment_name?: string | null;
|
||||
subject_area_de?: string | null;
|
||||
subject_area_en?: string | null;
|
||||
/**
|
||||
* Detailed DFG subject-area classification entries (Fachsystematik)
|
||||
*/
|
||||
subject_classifications?: Array<DFGProjectFachgebieteInner>;
|
||||
international_relation_de?: string | null;
|
||||
international_relation_en?: string | null;
|
||||
/**
|
||||
* All persons associated with the project, each with their role
|
||||
*/
|
||||
persons?: Array<DfgProjectPersonRole>;
|
||||
/**
|
||||
* All institutions associated with the project, each with their role
|
||||
*/
|
||||
institutions?: Array<DfgProjectInstitutionRole>;
|
||||
/**
|
||||
* Flat, de-duplicated list of all person full names (convenience view)
|
||||
*/
|
||||
associated_persons?: Array<string>;
|
||||
/**
|
||||
* Flat, de-duplicated list of all institution names (convenience view)
|
||||
*/
|
||||
associated_institutions?: Array<string>;
|
||||
parent_project_id?: number | null;
|
||||
parent_title_de?: string | null;
|
||||
parent_title_en?: string | null;
|
||||
/**
|
||||
* Sub-projects of this project, if any
|
||||
*/
|
||||
subprojects?: Array<DfgProjectSubprojectSummary>;
|
||||
/**
|
||||
* Publications resulting from the project
|
||||
*/
|
||||
publications?: Array<DfgProjectPublicationSummary>;
|
||||
topics?: Array<Topic> | null;
|
||||
}
|
||||
|
||||
|
||||
@@ -0,0 +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.
|
||||
*/
|
||||
import { DfgSubjectClassificationHighlight } from './dfgSubjectClassificationHighlight';
|
||||
|
||||
|
||||
/**
|
||||
* Highlighted fragments returned for a DFG project.
|
||||
*/
|
||||
export interface DfgProjectHighlight {
|
||||
title_de?: Array<string>;
|
||||
title_en?: Array<string>;
|
||||
abstract_de?: Array<string>;
|
||||
abstract_en?: Array<string>;
|
||||
subject_classifications?: Array<DfgSubjectClassificationHighlight>;
|
||||
}
|
||||
|
||||
@@ -1,25 +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.
|
||||
*/
|
||||
|
||||
|
||||
/**
|
||||
* An institution associated with the project, together with its role.
|
||||
*/
|
||||
export interface DfgProjectInstitutionRole {
|
||||
institute_id?: number | null;
|
||||
name_de?: string | null;
|
||||
name_en?: string | null;
|
||||
role_key?: string | null;
|
||||
role_label_de?: string | null;
|
||||
role_label_en?: string | null;
|
||||
is_dissolved?: boolean | null;
|
||||
is_head?: boolean | null;
|
||||
export interface DfgProjectInstitutionRole {
|
||||
institute_id?: number | null;
|
||||
name_de?: string | null;
|
||||
name_en?: string | null;
|
||||
role_key?: string | null;
|
||||
role_label_de?: string | null;
|
||||
role_label_en?: string | null;
|
||||
is_dissolved?: boolean | null;
|
||||
is_head?: boolean | null;
|
||||
}
|
||||
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user