Compare commits

...
Author SHA1 Message Date
Mats Paul Tončik 5f71a4b56c Merge remote-tracking branch 'origin/dev' into work-purpose
LocationBasedServices/smartguide/pipeline/head This commit looks good
2026-07-11 21:16:58 +02:00
Mats Paul Tončik 77c7eeef8b fix(person/publications): changed publications to generic data table
LocationBasedServices/smartguide/pipeline/head This commit looks good
2026-07-10 17:02:19 +02:00
Mats Paul Tončik 5b894d8927 fix(person/publications): moved work purposes and publications table to new expansion panel 2026-07-10 15:23:56 +02:00
Mats Paul Tončik b352e5288a feat(frontend/work-purpose): added work purpose bar chart for author publications 2026-07-10 14:58:46 +02:00
Louis 7bbfe1761d reduce publications: reduce .scss below budget
LocationBasedServices/smartguide/pipeline/head This commit looks good
2026-07-10 14:08:20 +02:00
Louis 09cb54109a person: remove dummy contact data in profile header 2026-07-10 13:52:29 +02:00
Louis 010e1c7f21 publications: sort author publications by citations or year
LocationBasedServices/smartguide/pipeline/head There was a failure building this commit
2026-07-10 13:43:08 +02:00
Louis d1802fa1f8 publication detail: paginate authors and institutions lists 2026-07-10 13:12:27 +02:00
Louis 4d0a6db3c3 Merge remote-tracking branch 'origin/dev' into publications-and-topics 2026-07-10 12:39:46 +02:00
genja db604feb37 Merge pull request 'feature/keywords-analysis' (#200) from feature/keywords-analysis into dev
LocationBasedServices/smartguide/pipeline/head This commit looks good
Reviewed-on: #200
2026-07-08 12:57:47 +02:00
genja cd0e98ec5f Merge branch 'dev' of nes.uni-due.de:lbs/smartguide into feature/keywords-analysis
LocationBasedServices/smartguide/pipeline/head This commit looks good
LocationBasedServices/smartguide/pipeline/pr-dev Build queued...
2026-07-08 12:55:20 +02:00
genja 42685ae44f ui and navigation adjustments 2026-07-08 12:53:58 +02:00
genja 9be024bb13 used sessionStorage for keywords handoff from keywords extraction to search results 2026-07-08 12:53:26 +02:00
genja 87b7e207e3 added publications and news tabs for keyword search 2026-07-08 12:51:23 +02:00
genja 8eaa9c2420 Merge pull request 'feature/keywords-analysis' (#199) from feature/keywords-analysis into dev
LocationBasedServices/smartguide/pipeline/head This commit looks good
Reviewed-on: #199
2026-07-08 03:36:21 +02:00
genja 87b02ed0a4 added reusable weights sliders component
LocationBasedServices/smartguide/pipeline/head This commit looks good
LocationBasedServices/smartguide/pipeline/pr-dev Build queued...
2026-07-08 03:31:43 +02:00
genja a6d30dd897 added navigate event to keywords-search on keyword click 2026-07-08 03:30:55 +02:00
genja 134055b8b9 created a template for projects results for keyword search 2026-07-08 03:29:26 +02:00
genja be72d28bda created a template component for persons results for keyword search 2026-07-08 03:29:04 +02:00
genja 2bfb877e77 created a template for patents results for keyword search 2026-07-08 03:28:16 +02:00
genja 48e33e7fe5 added search-results parent component 2026-07-08 03:27:29 +02:00
genja f469594c17 added topic mapping toggle logic 2026-07-08 03:25:56 +02:00
genja 3e115619a6 added topic mapping toggle 2026-07-08 03:25:37 +02:00
genja 13b2fb3350 added new routes for keywords search components 2026-07-08 03:19:43 +02:00
Mats Paul Tončik d26ddb8cb4 fix(frontend/auth): fixed change password form
LocationBasedServices/smartguide/pipeline/head This commit looks good
2026-07-07 10:58:10 +02:00
Louis a8e582cf23 publication-detail: make external links section collapsible 2026-07-07 09:46:53 +02:00
Louis 940c050cd7 publication-detail: make sources and funding sections collapsible 2026-07-07 09:44:17 +02:00
Louis e470b65b5a publication-detail: make authors and institutions collapsible like news sidebar 2026-07-07 09:38:06 +02:00
Louis 383c77134a publication-detail: link topic chips to person search topic filter 2026-07-07 09:19:34 +02:00
Louis bb941361a1 publication-detail: link topic chips to keywords topic mapping 2026-07-07 09:04:43 +02:00
Louis 5d22b201e9 publications/persons: add open-institution shortcut to institution tags and filter chips 2026-07-07 08:50:48 +02:00
Louis 1c6dbb540f Merge remote-tracking branch 'origin/dev' into publications-and-topics
LocationBasedServices/smartguide/pipeline/head This commit looks good
2026-07-07 01:08:55 +02:00
Louis cf9a5df4e9 works: count interesting-for topics like the publications filter 2026-07-07 01:08:14 +02:00
Louis 213edf8a5f works: report exact publication totals beyond 10k 2026-07-07 00:43:28 +02:00
Louis c277fcfece person: add publication and citation icons to stats line 2026-07-07 00:33:59 +02:00
Louis 8efbbf1f1a person-publication: show topic hierarchy tooltip on active filter chip 2026-07-07 00:21:06 +02:00
Louis 9ad6d5cd8c person overview: show topic hierarchy tooltip on active filter chip 2026-07-07 00:17:30 +02:00
Louis 77540e4002 person overview: enrich person search topics with descriptions 2026-07-07 00:12:38 +02:00
genja fd3ceb54aa Merge pull request 'feature/keywords-analysis' (#196) from feature/keywords-analysis into dev
LocationBasedServices/smartguide/pipeline/head This commit looks good
Reviewed-on: #196
2026-07-07 00:07:37 +02:00
genja 7baeab92c2 fixed borders issues
LocationBasedServices/smartguide/pipeline/pr-dev Build queued...
LocationBasedServices/smartguide/pipeline/head This commit looks good
2026-07-07 00:06:49 +02:00
Louis 0c526be983 person: pass topic field/domain to publications filter for consistent chip colors 2026-07-07 00:05:19 +02:00
Louis 53f5440d01 works: enrich publication topics with descriptions from topics index 2026-07-06 23:54:38 +02:00
Louis e86a19f800 person: add apartment icon to institution line for consistency
LocationBasedServices/smartguide/pipeline/head This commit looks good
2026-07-06 23:43:51 +02:00
genja 61fd920a9f Merge branch 'dev' of nes.uni-due.de:lbs/smartguide into feature/keywords-analysis
LocationBasedServices/smartguide/pipeline/head This commit looks good
2026-07-06 23:38:51 +02:00
genja 7eed7e6614 tooltip added for select all button
LocationBasedServices/smartguide/pipeline/head This commit looks good
2026-07-06 23:37:44 +02:00
Roman e34e1fe3d5 Merge branch 'reset-password&forgot-password' into dev
LocationBasedServices/smartguide/pipeline/head This commit looks good
2026-07-06 23:35:12 +02:00
Roman 2418821691 fix tests
LocationBasedServices/smartguide/pipeline/head This commit looks good
2026-07-06 23:29:31 +02:00
Louis 058c92227a person-interesting: reduce card height while topics are loading 2026-07-06 23:27:15 +02:00
kallweit bf38147acc Merge pull request 'feat/news_keyword_extraction' (#195) from feat/news_keyword_extraction into dev
LocationBasedServices/smartguide/pipeline/head This commit looks good
Reviewed-on: #195
2026-07-06 23:25:10 +02:00
genja 3f23845c89 enriched autocomplete options with data 2026-07-06 23:21:36 +02:00
genja 52e70a5b24 regenerated tests 2026-07-06 23:21:14 +02:00
genja d502431102 replaced old httpx requests and openalex_api with elastic wrapper and own indices 2026-07-06 23:21:04 +02:00
genja 5d22f4831a added topic indicies to global enum 2026-07-06 23:19:07 +02:00
Louis 8130192a44 person: link institution to detail page and show country flag 2026-07-06 23:16:24 +02:00
Roman bda7aff447 fix(login): re-enable forms after failed auth requests
LocationBasedServices/smartguide/pipeline/head There was a failure building this commit
2026-07-06 23:15:52 +02:00
Roman 82421c1040 reset-password and forgot-password 2026-07-06 23:13:30 +02:00
Louis 0723bb5c5b publication detail: link institutions to their detail page 2026-07-06 23:06:54 +02:00
Louis e4dbe07436 publication detail:
show country flags for institutions
2026-07-06 22:54:39 +02:00
Louis 78a8e5d919 publication detail: split topics and keywords into separate sections 2026-07-06 22:42:22 +02:00
Louis c3ec93fba1 show loading spinner for interesting-topics instead of empty state 2026-07-06 22:35:45 +02:00
genja 169b825195 Merge branch 'dev' of nes.uni-due.de:lbs/smartguide into ts-82-author-overview-and-description 2026-07-06 22:01:13 +02:00
genja 1cf80ae074 added highlighted source text of extracted keywords
LocationBasedServices/smartguide/pipeline/head This commit looks good
2026-07-06 18:49:49 +02:00
306 changed files with 15126 additions and 14316 deletions
+26 -1
View File
@@ -4,6 +4,7 @@ from enum import StrEnum
from typing import List
from pydantic import BaseModel
from sqlalchemy import UniqueConstraint
from sqlmodel import Field, Relationship, SQLModel
@@ -20,6 +21,11 @@ class TokenType(StrEnum):
ACCESS_TOKEN = "ACCESS_TOKEN"
class SecretPurpose(StrEnum):
LOGIN_OTK = "LOGIN_OTK"
PASSWORD_RESET = "PASSWORD_RESET"
class Durable(SQLModel):
deleted: bool = Field(
default=False,
@@ -106,6 +112,9 @@ class Account(Durable, table=True):
class Secret(SQLModel, table=True):
__table_args__ = (
UniqueConstraint("account_id", "purpose", name="uq_secret_account_purpose"),
)
id: uuid.UUID | None = Field(
default_factory=uuid.uuid4,
primary_key=True,
@@ -113,10 +122,16 @@ class Secret(SQLModel, table=True):
)
account_id: uuid.UUID = Field(
foreign_key="account.id",
unique=True, # Ensure that each account can have only one associated secret
index=True,
nullable=False,
description="The unique identifier of the account associated with this secret.",
)
purpose: SecretPurpose = Field(
default=SecretPurpose.LOGIN_OTK,
index=True,
nullable=False,
description="The purpose of the secret, such as login OTK or password reset.",
)
secret_value: str = Field(
index=False,
nullable=False,
@@ -127,6 +142,16 @@ class Secret(SQLModel, table=True):
nullable=False,
description="The timestamp indicating when the secret will expire.",
)
request_count: int = Field(
default=0,
nullable=False,
description="The number of password reset requests in the current rate-limit window.",
)
request_window_started_at: datetime | None = Field(
default=None,
index=True,
description="The start timestamp of the current password reset request window.",
)
class BaseTokenData(BaseModel):
+40
View File
@@ -46,6 +46,46 @@ async def request_otk(
return auth_service.request_otk(session=session, email=email, password=password)
@router.post(
"/request-password-reset",
summary="Request Password Reset",
description="Request a one-time password reset link for the given email address.",
operation_id="requestPasswordReset",
responses={
status.HTTP_200_OK: {"description": "Password reset requested successfully."}
},
)
async def request_password_reset(
session: SessionDep,
email: Annotated[str, Body(embed=True, description="User's email address")],
):
return auth_service.request_password_reset(session=session, email=email)
@router.post(
"/reset-password",
summary="Reset Password",
description="Reset the user's password using a one-time password reset token.",
operation_id="resetPassword",
responses={status.HTTP_200_OK: {"description": "Password reset successfully."}},
)
async def reset_password(
session: SessionDep,
reset_token: Annotated[
str, Body(description="Password reset token from the reset link")
],
new_password: Annotated[
str,
Body(description="New password", min_length=8, example="NewPassword123"),
],
):
return auth_service.reset_password(
session=session,
reset_token=reset_token,
new_password=new_password,
)
@router.post(
"/login",
summary="Login with One-Time Key",
+245 -4
View File
@@ -11,6 +11,9 @@ from argon2 import PasswordHasher
from argon2.exceptions import InvalidHashError, VerificationError, VerifyMismatchError
from fastapi import Cookie, Depends, HTTPException, Response, status
from fastapi.security import HTTPAuthorizationCredentials, HTTPBearer
from sqlmodel import Session, func, select
from inse.auth.email_service import send_email
from inse.auth.model import (
AccessResponse,
AccessToken,
@@ -22,19 +25,21 @@ from inse.auth.model import (
OtkResponse,
RefreshTokenMetadata,
Secret,
SecretPurpose,
TokenType,
UserRole,
)
from inse.config import get_settings
from inse.database import get_session
from sqlmodel import Session, select, func
from inse.auth.email_service import send_email
ID_TOKEN_EXPIRATION_MINUTES = 30 * 24 * 60 # 30 days
REFRESH_TOKEN_EXPIRATION_MINUTES = 1 * 24 * 60 # 1 day
ACCESS_TOKEN_EXPIRATION_MINUTES = 30 # 30 minutes
OTK_EXPIRATION_MINUTES = 15 # 15 minutes
PASSWORD_RESET_EXPIRATION_MINUTES = 5 # 5 minutes
PASSWORD_RESET_RATE_LIMIT_WINDOW_MINUTES = 5 # 5 minutes
PASSWORD_RESET_MAX_REQUESTS_PER_WINDOW = 3 # 3 minutes
REAL_ACCOUNT_ID_KEY = "real_account_id"
EFFECTIVE_ACCOUNT_ID_KEY = "effective_account_id"
@@ -160,7 +165,32 @@ def _verify_password(password: str, password_hash: str) -> bool:
return False
def request_otk(session: Session, email: str, password: str) -> OtkResponse:
def _hash_reset_token(reset_token: str) -> str:
"""Hashes a high-entropy password reset token for storage.
Args:
reset_token (str): The raw reset token sent to the user.
Returns:
str: SHA-256 hash of the reset token.
"""
return hashlib.sha256(reset_token.encode("utf-8")).hexdigest()
def _build_password_reset_link(reset_token: str) -> str:
"""Builds the password reset link that will be sent to the user.
Args:
reset_token (str): The raw reset token to include in the link.
Returns:
str: The full password reset link.
"""
separator = "&" if "?" in settings.password_reset_url else "?"
return f"{settings.password_reset_url}{separator}token={reset_token}"
def request_otk(session: Session, email: str, password: str):
"""Requests a one-time key (OTK) for authentication using email and password. Validates the provided credentials and generates a one-time key if valid.
Args:
@@ -211,7 +241,12 @@ def request_otk(session: Session, email: str, password: str) -> OtkResponse:
otk_code = f"{secrets.randbelow(1_000_000):06d}"
print(otk_code)
secret = session.exec(select(Secret).where(Secret.account_id == account.id)).first()
secret = session.exec(
select(Secret).where(
Secret.account_id == account.id,
Secret.purpose == SecretPurpose.LOGIN_OTK,
)
).first()
expires_at = datetime.datetime.now(datetime.timezone.utc) + datetime.timedelta(
minutes=OTK_EXPIRATION_MINUTES
@@ -220,6 +255,7 @@ def request_otk(session: Session, email: str, password: str) -> OtkResponse:
if secret is None:
secret = Secret(
account_id=account.id,
purpose=SecretPurpose.LOGIN_OTK,
secret_value=otk_code,
expires_at=expires_at,
)
@@ -251,6 +287,210 @@ def request_otk(session: Session, email: str, password: str) -> OtkResponse:
return OtkResponse(status="success", account_id=account.id)
def request_password_reset(session: Session, email: str) -> Dict[str, Any]:
"""Requests a one-time password reset link for the given email address.
For security reasons, this function always returns a successful response and
does not reveal whether the email address belongs to an active account.
"""
email = email.lower().strip()
now = datetime.datetime.now(datetime.timezone.utc)
account = session.exec(
select(Account).where(
Account.email == email,
Account.deleted == False, # noqa: E712
)
).first()
if account is None or account.deleted or account.id is None:
logger.info("Password reset requested for unknown email %s", email)
return {
"status": "ok",
"reset_link_created": False,
"rate_limited": False,
}
secret = session.exec(
select(Secret).where(
Secret.account_id == account.id,
Secret.purpose == SecretPurpose.PASSWORD_RESET,
)
).first()
if secret is not None:
if secret.request_window_started_at is not None:
window_started_at = secret.request_window_started_at
if getattr(window_started_at, "tzinfo", None) is None:
window_started_at = window_started_at.replace(
tzinfo=datetime.timezone.utc
)
window_ends_at = window_started_at + datetime.timedelta(
minutes=PASSWORD_RESET_RATE_LIMIT_WINDOW_MINUTES
)
if window_ends_at > now:
if secret.request_count >= PASSWORD_RESET_MAX_REQUESTS_PER_WINDOW:
retry_after_seconds = max(
0,
int((window_ends_at - now).total_seconds()),
)
logger.info(
"Password reset request rate-limited for account %s.",
account.id,
)
return {
"status": "ok",
"reset_link_created": False,
"rate_limited": True,
"retry_after_seconds": retry_after_seconds,
}
else:
secret.request_count = 0
secret.request_window_started_at = now
else:
secret.request_count = 0
secret.request_window_started_at = now
reset_token = secrets.token_urlsafe(32)
reset_token_hash = _hash_reset_token(reset_token)
expires_at = now + datetime.timedelta(minutes=PASSWORD_RESET_EXPIRATION_MINUTES)
if secret is None:
secret = Secret(
account_id=account.id,
purpose=SecretPurpose.PASSWORD_RESET,
secret_value=reset_token_hash,
expires_at=expires_at,
request_count=1,
request_window_started_at=now,
)
session.add(secret)
else:
secret.secret_value = reset_token_hash
secret.expires_at = expires_at
secret.request_count += 1
if secret.request_window_started_at is None:
secret.request_window_started_at = now
session.commit()
reset_link = _build_password_reset_link(reset_token)
if settings.send_password_reset_email:
try:
send_email(
recipient=account.email,
subject="Reset your SmartGUIDE password",
body=(
"Use the following link to reset your SmartGUIDE password:\n"
f"{reset_link}\n\n"
f"This link expires in {PASSWORD_RESET_EXPIRATION_MINUTES} minutes."
),
smtp_server=settings.smtp_server,
smtp_port=settings.smtp_port,
sender=settings.smtp_sender,
username=settings.smtp_username,
password=settings.smtp_password,
use_tls=settings.smtp_use_tls,
)
logger.info("Sent password reset email for account %s", account.id)
except Exception:
if settings.environment == "dev":
logger.exception(
"Failed to send password reset email for account %s. "
"Falling back to console reset link.",
account.id,
)
logger.info(
"Password reset link for account %s: %s",
account.id,
reset_link,
)
else:
raise
elif settings.environment == "dev":
logger.info("Password reset link for account %s: %s", account.id, reset_link)
else:
logger.info("Password reset token generated for account %s", account.id)
return {
"status": "ok",
"reset_link_created": True,
"rate_limited": False,
}
def reset_password(
session: Session,
reset_token: str,
new_password: str,
) -> Dict[str, str]:
"""Resets an account password using a one-time password reset token.
Args:
session (Session): The database session used to query the account and secret.
reset_token (str): The raw reset token from the password reset link.
new_password (str): The new password to store for the account.
Raises:
HTTPException: If the reset token is invalid or expired.
Returns:
Dict[str, str]: A status response.
"""
now = datetime.datetime.now(datetime.timezone.utc)
reset_token_hash = _hash_reset_token(reset_token.strip())
secret = session.exec(
select(Secret).where(
Secret.purpose == SecretPurpose.PASSWORD_RESET,
Secret.secret_value == reset_token_hash,
)
).first()
if secret is None:
raise HTTPException(
status_code=status.HTTP_401_UNAUTHORIZED,
detail="Invalid or expired password reset token",
)
secret_expires = secret.expires_at
if getattr(secret_expires, "tzinfo", None) is None:
secret_expires = secret_expires.replace(tzinfo=datetime.timezone.utc)
if secret_expires <= now:
session.delete(secret)
session.commit()
raise HTTPException(
status_code=status.HTTP_401_UNAUTHORIZED,
detail="Invalid or expired password reset token",
)
account = session.get(Account, secret.account_id)
if account is None or account.deleted or account.id is None:
session.delete(secret)
session.commit()
raise HTTPException(
status_code=status.HTTP_401_UNAUTHORIZED,
detail="Invalid or expired password reset token",
)
account.password_hash = _hash_password(new_password)
account.epoch += 1
session.add(account)
session.delete(secret)
session.commit()
return {"status": "ok"}
def login(
session: Session, response: Response, account_id: uuid.UUID, email_code: str
) -> LoginResponse:
@@ -274,6 +514,7 @@ def login(
secret = session.exec(
select(Secret).where(
Secret.account_id == account_id,
Secret.purpose == SecretPurpose.LOGIN_OTK,
Secret.secret_value == email_code,
# Validating the code and ensuring it matches the account ID
)
+204 -6
View File
@@ -14,6 +14,7 @@ from inse.auth.model import (
Account,
Organization,
Secret,
SecretPurpose,
AccessToken,
IdTokenMetadata,
AccessTokenMetadata,
@@ -98,7 +99,10 @@ def test_request_otk_and_login_flow(in_memory_session, settings_backup):
assert resp.account_id == acc.id
secret = in_memory_session.exec(
select(Secret).where(Secret.account_id == acc.id)
select(Secret).where(
Secret.account_id == acc.id,
Secret.purpose == SecretPurpose.LOGIN_OTK,
)
).first()
assert secret is not None
@@ -281,7 +285,12 @@ def test_login_with_expired_secret(in_memory_session, settings_backup):
assert acc.id is not None
expired_at = _dt.datetime.now(_dt.timezone.utc) - timedelta(minutes=10)
secret = Secret(account_id=acc.id, secret_value="000000", expires_at=expired_at)
secret = Secret(
account_id=acc.id,
purpose=SecretPurpose.LOGIN_OTK,
secret_value="000000",
expires_at=expired_at,
)
in_memory_session.add(secret)
in_memory_session.commit()
@@ -426,14 +435,20 @@ def test_otk_regeneration_and_reuse(in_memory_session, settings_backup):
auth_service.request_otk(in_memory_session, email, password)
secret1 = in_memory_session.exec(
select(Secret).where(Secret.account_id == acc.id)
select(Secret).where(
Secret.account_id == acc.id,
Secret.purpose == SecretPurpose.LOGIN_OTK,
)
).first()
assert secret1 is not None
first_value = secret1.secret_value
auth_service.request_otk(in_memory_session, email, password)
secret2 = in_memory_session.exec(
select(Secret).where(Secret.account_id == acc.id)
select(Secret).where(
Secret.account_id == acc.id,
Secret.purpose == SecretPurpose.LOGIN_OTK,
)
).first()
assert secret2 is not None
@@ -460,13 +475,19 @@ def test_otk_deleted_after_login(in_memory_session, settings_backup):
auth_service.request_otk(in_memory_session, email, password)
secret = in_memory_session.exec(
select(Secret).where(Secret.account_id == acc.id)
select(Secret).where(
Secret.account_id == acc.id,
Secret.purpose == SecretPurpose.LOGIN_OTK,
)
).first()
assert secret is not None
auth_service.login(in_memory_session, Response(), acc.id, secret.secret_value)
post = in_memory_session.exec(
select(Secret).where(Secret.account_id == acc.id)
select(Secret).where(
Secret.account_id == acc.id,
Secret.purpose == SecretPurpose.LOGIN_OTK,
)
).first()
assert post is None
@@ -551,3 +572,180 @@ def test_get_account_epoch_not_found(in_memory_session):
random_id = uuid.uuid4()
with pytest.raises(Exception):
auth_service._get_account_epoch(in_memory_session, random_id)
def test_request_password_reset_creates_secret(in_memory_session, settings_backup):
email = "reset@example.com"
password = "oldpw123"
org, acc = create_org_and_account(in_memory_session, email, password)
assert acc.id is not None
result = auth_service.request_password_reset(in_memory_session, email)
assert result["status"] == "ok"
secret = in_memory_session.exec(
select(Secret).where(
Secret.account_id == acc.id,
Secret.purpose == SecretPurpose.PASSWORD_RESET,
)
).first()
assert secret is not None
assert secret.secret_value is not None
assert secret.secret_value != ""
assert secret.secret_value != password
def test_request_password_reset_unknown_email_is_safe(
in_memory_session, settings_backup, monkeypatch
):
sent_emails = []
def fake_send_email(**kwargs):
sent_emails.append(kwargs)
monkeypatch.setattr(auth_service, "send_email", fake_send_email)
config_module.settings.send_password_reset_email = True
result = auth_service.request_password_reset(
in_memory_session, "missing@example.com"
)
assert result["status"] == "ok"
assert sent_emails == []
def test_request_password_reset_sends_email(
in_memory_session, settings_backup, monkeypatch
):
email = "mail-reset@example.com"
password = "oldpw123"
org, acc = create_org_and_account(in_memory_session, email, password)
assert acc.id is not None
sent_emails = []
def fake_send_email(**kwargs):
sent_emails.append(kwargs)
monkeypatch.setattr(auth_service, "send_email", fake_send_email)
config_module.settings.send_password_reset_email = True
config_module.settings.password_reset_url = "http://localhost/reset-password"
result = auth_service.request_password_reset(in_memory_session, email)
assert result["status"] == "ok"
assert len(sent_emails) == 1
assert sent_emails[0]["recipient"] == email
assert "token=" in sent_emails[0]["body"]
def test_reset_password_changes_password_and_increments_epoch(in_memory_session):
email = "do-reset@example.com"
password = "oldpw123"
new_password = "NewPassword123"
org, acc = create_org_and_account(in_memory_session, email, password)
assert acc.id is not None
reset_token = "valid-reset-token"
secret = Secret(
account_id=acc.id,
purpose=SecretPurpose.PASSWORD_RESET,
secret_value=auth_service._hash_reset_token(reset_token),
expires_at=_dt.datetime.now(_dt.timezone.utc) + timedelta(minutes=5),
)
in_memory_session.add(secret)
in_memory_session.commit()
old_epoch = acc.epoch
result = auth_service.reset_password(
in_memory_session,
reset_token=reset_token,
new_password=new_password,
)
assert result["status"] == "ok"
in_memory_session.refresh(acc)
assert auth_service._verify_password(new_password, acc.password_hash)
assert acc.epoch == old_epoch + 1
deleted_secret = in_memory_session.exec(
select(Secret).where(
Secret.account_id == acc.id,
Secret.purpose == SecretPurpose.PASSWORD_RESET,
)
).first()
assert deleted_secret is None
def test_reset_password_rejects_reused_token(in_memory_session):
email = "reuse-reset@example.com"
password = "oldpw123"
org, acc = create_org_and_account(in_memory_session, email, password)
assert acc.id is not None
reset_token = "single-use-token"
secret = Secret(
account_id=acc.id,
purpose=SecretPurpose.PASSWORD_RESET,
secret_value=auth_service._hash_reset_token(reset_token),
expires_at=_dt.datetime.now(_dt.timezone.utc) + timedelta(minutes=5),
)
in_memory_session.add(secret)
in_memory_session.commit()
auth_service.reset_password(
in_memory_session,
reset_token=reset_token,
new_password="NewPassword123",
)
with pytest.raises(HTTPException):
auth_service.reset_password(
in_memory_session,
reset_token=reset_token,
new_password="AnotherPassword123",
)
def test_reset_password_rejects_invalid_token(in_memory_session):
with pytest.raises(HTTPException):
auth_service.reset_password(
in_memory_session,
reset_token="invalid-token",
new_password="NewPassword123",
)
def test_reset_password_rejects_expired_token(in_memory_session):
email = "expired-reset@example.com"
password = "oldpw123"
org, acc = create_org_and_account(in_memory_session, email, password)
assert acc.id is not None
reset_token = "expired-token"
secret = Secret(
account_id=acc.id,
purpose=SecretPurpose.PASSWORD_RESET,
secret_value=auth_service._hash_reset_token(reset_token),
expires_at=_dt.datetime.now(_dt.timezone.utc) - timedelta(minutes=1),
)
in_memory_session.add(secret)
in_memory_session.commit()
with pytest.raises(HTTPException):
auth_service.reset_password(
in_memory_session,
reset_token=reset_token,
new_password="NewPassword123",
)
deleted_secret = in_memory_session.exec(
select(Secret).where(
Secret.account_id == acc.id,
Secret.purpose == SecretPurpose.PASSWORD_RESET,
)
).first()
assert deleted_secret is None
+2
View File
@@ -70,6 +70,8 @@ class Settings(BaseSettings):
skip_otk_validation: bool = True
# SMTP / email config
send_otk_email: bool = False
send_password_reset_email: bool = True
password_reset_url: str = "http://localhost:4200/inse-webapp/reset-password"
smtp_server: str = "localhost"
smtp_port: int = 25
smtp_sender: str = "no-reply@smartguide.local"
@@ -23,6 +23,7 @@ def get_client() -> httpx.AsyncClient:
global _client, _loop
try:
import asyncio
current_loop = asyncio.get_running_loop()
except RuntimeError:
current_loop = None
@@ -45,7 +46,7 @@ def _cluster_credentials(cluster: ESCluster) -> Tuple[str, str]:
Returns:
Tuple[str, str]: The Elasticsearch URL and API key for the specified cluster.
"""
if cluster == ESCluster.NES:
if (
not config.settings.elasticsearch_url
@@ -54,7 +55,7 @@ def _cluster_credentials(cluster: ESCluster) -> Tuple[str, str]:
raise MissingApiKeyError(
"Elasticsearch URL and API key must be set in the configuration for cluster 'nes'"
)
return config.settings.elasticsearch_url, config.settings.elasticsearch_api_key
elif cluster == ESCluster.INSE:
if (
@@ -108,8 +109,12 @@ def _index_to_cluster(index: ESIndex) -> Optional[ESCluster]:
def _wrap_exception(e: Exception) -> Exception:
if isinstance(e, httpx.HTTPStatusError):
if e.response.status_code == 404:
return ElasticsearchNotFoundException(f"Elasticsearch resource not found: {e}")
return ElasticsearchException(f"Elasticsearch returned status {e.response.status_code}: {e}")
return ElasticsearchNotFoundException(
f"Elasticsearch resource not found: {e}"
)
return ElasticsearchException(
f"Elasticsearch returned status {e.response.status_code}: {e}"
)
elif isinstance(e, httpx.RequestError):
return ElasticsearchConnectionException(f"Elasticsearch connection error: {e}")
return ElasticsearchException(f"Unexpected Elasticsearch error: {e}")
@@ -211,7 +216,9 @@ async def search(
raise _wrap_exception(exc) from exc
async def open_point_in_time(index: str, keep_alive: str = "1m", cluster: str = "nes") -> str:
async def open_point_in_time(
index: str, keep_alive: str = "1m", cluster: str = "nes"
) -> str:
"""Opens a point-in-time on the given index and returns its id."""
elasticsearch_url, api_key = _cluster_credentials(cluster)
headers = {"Authorization": f"ApiKey {api_key}", "Content-Type": "application/json"}
@@ -256,7 +263,7 @@ async def scan(
cluster: str = "nes",
) -> AsyncIterator[Dict[str, Any]]:
"""Yields every hit matching ``query`` using a point-in-time + ``search_after``.
Unlike ``from``/``size`` pagination, this is not bounded by
``index.max_result_window``, so it can stream result sets larger than 10k.
"""
@@ -316,6 +323,9 @@ async def get(
cluster: ESCluster = ESCluster.NES,
) -> dict[str, Any]:
if isinstance(index, ESIndex):
cluster = _index_to_cluster(index) or cluster
elasticsearch_url, api_key = _cluster_credentials(cluster)
headers = {"Authorization": f"ApiKey {api_key}", "Content-Type": "application/json"}
+12 -2
View File
@@ -53,6 +53,8 @@ from inse.patents.service import (
router as patents_service_router,
)
from inse.works.purpose_router import router as works_purpose_router
logger = logging.getLogger(__name__)
### startup
@@ -83,6 +85,7 @@ app.include_router(institution_patents_router)
app.include_router(org_patents_router)
app.include_router(institutions_router)
app.include_router(topics_service_router)
app.include_router(works_purpose_router)
app.include_router(works_service_router)
app.include_router(persons_service_router)
app.include_router(funders_service_router)
@@ -100,6 +103,7 @@ app.include_router(auth_router)
app.include_router(account_management_router)
app.include_router(organization_management_router)
app.add_middleware(
ETagCacheMiddleware,
ttl=300, # 5 minutes expiration time
@@ -116,6 +120,7 @@ app.add_middleware(
# exception handlers
@app.exception_handler(NotFoundException)
async def handle_not_found(request: Request, exc: NotFoundException):
return JSONResponse(status_code=404, content={"message": str(exc)})
@@ -124,13 +129,18 @@ async def handle_not_found(request: Request, exc: NotFoundException):
@app.exception_handler(ElasticsearchException)
async def handle_elasticsearch_error(request: Request, exc: ElasticsearchException):
logger.error("Elasticsearch integration error: %s", str(exc))
return JSONResponse(status_code=502, content={"message": "Search service temporarily unavailable"})
return JSONResponse(
status_code=502, content={"message": "Search service temporarily unavailable"}
)
@app.exception_handler(MissingApiKeyError)
async def handle_missing_api_key(request: Request, exc: MissingApiKeyError):
logger.error("Configuration error: %s", str(exc))
return JSONResponse(status_code=503, content={"message": str(exc) or "Search service is not configured"})
return JSONResponse(
status_code=503,
content={"message": str(exc) or "Search service is not configured"},
)
@app.exception_handler(UpstreamAPIException)
+2
View File
@@ -36,6 +36,8 @@ class ESIndex(StrEnum):
OPENALEX_PUBLICATIONS = "openalex-publications"
OPENALEX_COUNTRIES = "openalex-countries"
OPENALEX_CONTINENTS = "openalex-continents"
OPENALEX_TOPICS = "openalex-topics"
OPENALEX_TOPIC_VECTORS = "topicvectors"
EPO_INDEX = "epo_index_1.0"
USPTO_INDEX = "uspto_patents_3.0"
Binary file not shown.
+5
View File
@@ -32,6 +32,7 @@ from inse.persons.model import (
CustomAuthorsListResponse,
CareerMetrics,
)
from inse.works.logic import enrich_topic_descriptions
logger = logging.getLogger(__name__)
INDEX_NAME = "openalex-authors"
@@ -728,6 +729,10 @@ async def advanced_search_persons(
)
results.append(custom_author)
await enrich_topic_descriptions(
[topic for author in results for topic in author.topics or []]
)
return CustomAuthorsListResponse(
results=results, meta=Meta(count=total_count, page=page, per_page=page_size)
)
+116 -26
View File
@@ -4,13 +4,12 @@
Business logic for OpenAlex topics.
"""
import asyncio
import logging
from copy import deepcopy
from typing import Any
import httpx
import asyncio
from pydantic import ValidationError
from inse.exceptions import (
UpstreamAPIException,
BadRequestException,
@@ -23,8 +22,8 @@ from inse.models.openalex.autocomplete_response_results_inner import (
AutocompleteResponseResultsInner,
)
from inse.models.openalex.topics_list_response import TopicsListResponse
from inse.model import ESCluster
from .search_client import OpenAlexTopicsClient
from inse.model import ESCluster, ESIndex
from .search_client import TopicsSearchClient
logger = logging.getLogger(__name__)
@@ -40,15 +39,15 @@ async def list_topics(
cursor: str | None = None,
sample: int | None = None,
select: str | None = None,
client: OpenAlexTopicsClient | None = None,
client: TopicsSearchClient | None = None,
) -> TopicsListResponse:
if sample is not None and (sort or page not in (None, 1)):
raise BadRequestException("sample cannot be combined with sort or page.")
openalex_client = client or OpenAlexTopicsClient()
topics_client = client or TopicsSearchClient()
try:
data = await openalex_client.list_topics(
data = await topics_client.list_topics(
search=search,
filter=filter,
sort=sort,
@@ -59,25 +58,24 @@ async def list_topics(
sample=sample,
select=select,
)
except httpx.HTTPStatusError as exc:
status_code = exc.response.status_code
detail = "OpenAlex topics request failed."
try:
error_body = exc.response.json()
detail = error_body.get("message") or error_body.get("error") or detail
except ValueError:
if exc.response.text:
detail = exc.response.text
raise UpstreamAPIException(message=detail, status_code=status_code) from exc
except httpx.HTTPError as exc:
logger.exception("OpenAlex topics request failed.")
except ValueError as exc:
raise BadRequestException(str(exc)) from exc
except ElasticsearchException as exc:
logger.exception("OpenAlex topics Elasticsearch request failed.")
raise UpstreamAPIException(
message="OpenAlex topics request failed.",
message="OpenAlex topics Elasticsearch request failed.",
status_code=502,
) from exc
try:
normalized_data = _normalize_topics_response(data)
openalex_style_data = _elasticsearch_to_topics_response(
data,
per_page=per_page,
page=page,
cursor=cursor,
group_by=group_by,
)
normalized_data = _normalize_topics_response(openalex_style_data)
return TopicsListResponse.from_dict(normalized_data) or TopicsListResponse()
except ValidationError as exc:
logger.exception("OpenAlex topics response could not be parsed.")
@@ -94,7 +92,7 @@ async def autocomplete_topics(
field_id: str | None = None,
subfield_id: str | None = None,
limit: int = 10,
client: OpenAlexTopicsClient | None = None,
client: TopicsSearchClient | None = None,
) -> AutocompleteResponse:
filters = []
if domain_id:
@@ -153,6 +151,99 @@ async def autocomplete_topics(
)
def _elasticsearch_to_topics_response(
data: dict[str, Any],
*,
per_page: int,
page: int | None,
cursor: str | None,
group_by: str | None,
) -> dict[str, Any]:
"""
Converts an Elasticsearch search response into the OpenAlex-style topics
response expected by TopicsListResponse.
Elasticsearch response shape:
{
"took": 12,
"hits": {
"total": {"value": 123},
"hits": [
{"_source": {...}, "sort": [...]}
]
},
"aggregations": {...}
}
OpenAlex-style response shape:
{
"meta": {...},
"results": [...],
"group_by": [...]
}
"""
hits_root = data.get("hits") or {}
raw_hits = hits_root.get("hits") or []
total = hits_root.get("total")
if isinstance(total, dict):
count = total.get("value")
else:
count = total
results: list[dict[str, Any]] = []
for hit in raw_hits:
if not isinstance(hit, dict):
continue
source = hit.get("_source")
if isinstance(source, dict):
results.append(source)
groups = _extract_group_by_results(data) if group_by else []
meta = {
"count": count,
"db_response_time_ms": data.get("took"),
"page": page if cursor is None else None,
"per_page": per_page,
"groups_count": len(groups) if group_by else None,
"next_cursor": (data.get("meta") or {}).get("next_cursor"),
"cost_usd": None,
}
return {
"meta": meta,
"results": results,
"group_by": groups,
}
def _extract_group_by_results(data: dict[str, Any]) -> list[dict[str, Any]]:
aggregations = data.get("aggregations") or {}
group_by_agg = aggregations.get("group_by") or {}
buckets = group_by_agg.get("buckets") or []
groups: list[dict[str, Any]] = []
for bucket in buckets:
if not isinstance(bucket, dict):
continue
key = bucket.get("key")
groups.append(
{
"key": key,
"key_display_name": bucket.get("key_as_string") or key,
"count": bucket.get("doc_count"),
}
)
return groups
def _normalize_topics_response(data: dict[str, Any]) -> dict[str, Any]:
normalized = deepcopy(data)
@@ -264,7 +355,6 @@ def _datetime_str_or_none(value: Any) -> str | None:
return f"{text}T00:00:00Z"
return text
# Configuration for vector search similarity thresholds and boosts
SIMILARITY_THRESHOLD = (
0.8 # intfloat/multilingual-e5-base uses cosine similarity between 0.7 - 1
@@ -388,7 +478,7 @@ async def vector_search_topics(
try:
raw_results = await elasticsearch.search(
index="topicvectors", body=body, cluster=ESCluster.NES
index=ESIndex.OPENALEX_TOPIC_VECTORS, body=body, cluster=ESCluster.NES
)
except Exception as exc:
logger.exception("Elasticsearch vector search failed with unexpected error.")
@@ -458,7 +548,7 @@ async def vector_search_topics_batch(
)
tasks.append(
elasticsearch.search(
index="topicvectors", body=body, cluster=ESCluster.NES
index=ESIndex.OPENALEX_TOPIC_VECTORS, body=body, cluster=ESCluster.NES
)
)
+306 -56
View File
@@ -1,33 +1,200 @@
#!/usr/bin/env python
# -*- coding: utf-8 -*-
"""
HTTP client for OpenAlex topics.
Elasticsearch search client for OpenAlex topics.
"""
from __future__ import annotations
import base64
import json
from typing import Any
import httpx
from inse.model import ESCluster, ESIndex
from .. import config
from inse.integrations.elasticsearch import search as elasticsearch_search
class OpenAlexTopicsClient:
class TopicsSearchClient:
"""
Search client for OpenAlex topics backed by Elasticsearch.
This replaces the old OpenAlex HTTP API client and uses the internal
Elasticsearch wrapper instead.
"""
DEFAULT_SEARCH_FIELDS = [
"display_name^5",
"description^3",
"keywords",
"domain.display_name^2",
"field.display_name^2",
"subfield.display_name^2",
]
def __init__(
self,
base_url: str | None = None,
api_key: str | None = None,
timeout: float | None = None,
transport: httpx.AsyncBaseTransport | None = None,
*,
index: ESIndex | str | None = None,
cluster: ESCluster = ESCluster.NES,
):
self.base_url = (base_url or config.settings.openalex_api_base_url).rstrip("/")
self.api_key = api_key if api_key is not None else config.settings.openalex_api_key
self.timeout = (
timeout
if timeout is not None
else config.settings.openalex_api_timeout_seconds
)
self.transport = transport
self.index = index or self._default_index()
self.cluster = cluster
def list_topics_params(
@staticmethod
def _default_index() -> str:
"""
Resolve the OpenAlex topics index name.
Prefer a configured value if present, otherwise fall back to a sensible
default string index name.
"""
return (
ESIndex.OPENALEX_TOPICS.value
)
@staticmethod
def _split_csv(value: str | None) -> list[str]:
if not value:
return []
return [part.strip() for part in value.split(",") if part.strip()]
@staticmethod
def _encode_cursor(sort_values: list[Any]) -> str:
raw = json.dumps(sort_values).encode("utf-8")
return base64.urlsafe_b64encode(raw).decode("ascii").rstrip("=")
@staticmethod
def _decode_cursor(cursor: str | None) -> list[Any] | None:
if not cursor or cursor == "*":
return None
padding = "=" * (-len(cursor) % 4)
raw = base64.urlsafe_b64decode(cursor + padding)
return json.loads(raw.decode("utf-8"))
@staticmethod
def _parse_select(select: str | None) -> list[str] | None:
fields = TopicsSearchClient._split_csv(select)
return fields or None
@staticmethod
def _parse_sort(sort: str | None) -> list[dict[str, Any]] | None:
"""
Parses OpenAlex-style sort syntax into Elasticsearch sort syntax.
Examples:
"works_count:desc"
"cited_by_count:desc,display_name:asc"
"-works_count"
"""
parts = TopicsSearchClient._split_csv(sort)
if not parts:
return None
parsed: list[dict[str, Any]] = []
for part in parts:
direction = "asc"
field = part
if part.startswith("-"):
direction = "desc"
field = part[1:]
elif ":" in part:
field, direction = part.split(":", 1)
field = field.strip()
direction = direction.strip().lower()
if direction not in {"asc", "desc"}:
direction = "asc"
if field in {"score", "_score", "relevance_score"}:
parsed.append({"_score": {"order": direction}})
else:
parsed.append({field: {"order": direction, "missing": "_last"}})
return parsed
@staticmethod
def _parse_filter_clause(expression: str) -> tuple[dict[str, Any] | None, bool]:
"""
Parses a single simple OpenAlex-style filter expression.
Supported examples:
"works_count:>100"
"works_count:>=100"
"display_name:Physics"
"ids.openalex:T123"
"field.id:F1|F2"
"is_active:true"
"is_active:!true"
Returns:
tuple[clause, is_negative]
"""
if ":" not in expression:
return None, False
field, value = expression.split(":", 1)
field = field.strip()
value = value.strip()
if not field or not value:
return None, False
is_negative = False
if value.startswith("!"):
is_negative = True
value = value[1:].strip()
range_ops = {
">=": "gte",
"<=": "lte",
">": "gt",
"<": "lt",
}
for prefix, op in range_ops.items():
if value.startswith(prefix):
range_value = value[len(prefix):].strip()
return {"range": {field: {op: range_value}}}, is_negative
if "|" in value:
values = [v.strip() for v in value.split("|") if v.strip()]
return {"terms": {field: values}}, is_negative
lowered = value.lower()
if lowered == "true":
typed_value: Any = True
elif lowered == "false":
typed_value = False
else:
typed_value = value
return {"term": {field: typed_value}}, is_negative
@classmethod
def _parse_filters(
cls,
filter: str | None,
) -> tuple[list[dict[str, Any]], list[dict[str, Any]]]:
filter_clauses: list[dict[str, Any]] = []
must_not_clauses: list[dict[str, Any]] = []
for expression in cls._split_csv(filter):
clause, is_negative = cls._parse_filter_clause(expression)
if clause is None:
continue
if is_negative:
must_not_clauses.append(clause)
else:
filter_clauses.append(clause)
return filter_clauses, must_not_clauses
def build_search_body(
self,
*,
search: str | None = None,
@@ -40,28 +207,118 @@ class OpenAlexTopicsClient:
sample: int | None = None,
select: str | None = None,
) -> dict[str, Any]:
params: dict[str, Any] = {"per_page": per_page}
"""
Build the Elasticsearch search body from the previous OpenAlex-style API
parameters.
"""
filter_clauses, must_not_clauses = self._parse_filters(filter)
must_clauses: list[dict[str, Any]] = []
if search:
params["search"] = search
if filter:
params["filter"] = filter
if sort:
params["sort"] = sort
if group_by:
params["group_by"] = group_by
if cursor:
params["cursor"] = cursor
elif page is not None:
params["page"] = page
if sample is not None:
params["sample"] = sample
if select:
params["select"] = select
if self.api_key:
params["api_key"] = self.api_key
must_clauses.append(
{
"multi_match": {
"query": search,
"fields": self.DEFAULT_SEARCH_FIELDS,
"type": "best_fields",
"operator": "and",
}
}
)
return params
if must_clauses or filter_clauses or must_not_clauses:
query: dict[str, Any] = {
"bool": {
"must": must_clauses or [{"match_all": {}}],
"filter": filter_clauses,
"must_not": must_not_clauses,
}
}
else:
query = {"match_all": {}}
if sample is not None:
query = {
"function_score": {
"query": query,
"random_score": {},
}
}
size = sample if sample is not None else per_page
body: dict[str, Any] = {
"query": query,
"size": size,
"track_total_hits": True,
}
source = self._parse_select(select)
if source is not None:
body["_source"] = source
sort_clause = self._parse_sort(sort)
if sort_clause is not None:
body["sort"] = sort_clause
search_after = self._decode_cursor(cursor)
if search_after is not None:
body["search_after"] = search_after
elif cursor is None and page is not None:
body["from"] = max(page - 1, 0) * per_page
if group_by:
body["size"] = 0
body["aggs"] = {
"group_by": {
"terms": {
"field": group_by,
"size": per_page,
}
}
}
return body
async def search_topics(
self,
*,
search: str | None = None,
filter: str | None = None,
sort: str | None = None,
group_by: str | None = None,
per_page: int = 25,
page: int | None = 1,
cursor: str | None = None,
sample: int | None = None,
select: str | None = None,
) -> dict[str, Any]:
body = self.build_search_body(
search=search,
filter=filter,
sort=sort,
group_by=group_by,
per_page=per_page,
page=page,
cursor=cursor,
sample=sample,
select=select,
)
result = await elasticsearch_search(
index=self.index,
body=body,
cluster=self.cluster,
)
hits = result.get("hits", {}).get("hits", [])
if hits:
last_sort = hits[-1].get("sort")
if last_sort is not None:
result.setdefault("meta", {})["next_cursor"] = self._encode_cursor(last_sort)
return result
async def list_topics(
self,
@@ -76,24 +333,17 @@ class OpenAlexTopicsClient:
sample: int | None = None,
select: str | None = None,
) -> dict[str, Any]:
async with httpx.AsyncClient(
base_url=self.base_url,
timeout=self.timeout,
transport=self.transport,
) as client:
response = await client.get(
"/topics",
params=self.list_topics_params(
search=search,
filter=filter,
sort=sort,
group_by=group_by,
per_page=per_page,
page=page,
cursor=cursor,
sample=sample,
select=select,
),
)
response.raise_for_status()
return response.json()
"""
Backwards-compatible alias for the old OpenAlex client method name.
"""
return await self.search_topics(
search=search,
filter=filter,
sort=sort,
group_by=group_by,
per_page=per_page,
page=page,
cursor=cursor,
sample=sample,
select=select,
)
+146 -106
View File
@@ -1,9 +1,7 @@
import httpx
import pytest
from inse.exceptions import BadRequestException
from inse.exceptions import BadRequestException
from inse.topics import logic
from inse.topics.search_client import OpenAlexTopicsClient
@pytest.fixture
@@ -11,108 +9,144 @@ def anyio_backend():
return "asyncio"
class FakeTopicsSearchClient:
def __init__(self, response: dict):
self.response = response
self.calls: list[dict] = []
async def list_topics(self, **kwargs):
self.calls.append(kwargs)
return self.response
@pytest.mark.anyio
async def test_list_topics_maps_openalex_response_to_model():
def handler(_: httpx.Request) -> httpx.Response:
return httpx.Response(
200,
json={
"meta": {"count": 1, "page": 1, "per_page": 25},
"results": [
async def test_list_topics_maps_elasticsearch_response_to_model():
client = FakeTopicsSearchClient(
{
"took": 12,
"hits": {
"total": {"value": 1, "relation": "eq"},
"hits": [
{
"id": "https://openalex.org/T12419",
"display_name": "Machine learning",
"description": "Methods that learn from data.",
"keywords": ["machine learning", "classification"],
"subfield": {
"id": "https://openalex.org/subfields/1702",
"display_name": "Artificial Intelligence",
"_id": "https://openalex.org/T12419",
"_source": {
"id": "https://openalex.org/T12419",
"display_name": "Machine learning",
"description": "Methods that learn from data.",
"keywords": ["machine learning", "classification"],
"subfield": {
"id": "https://openalex.org/subfields/1702",
"display_name": "Artificial Intelligence",
},
"field": {
"id": "https://openalex.org/fields/17",
"display_name": "Computer Science",
},
"domain": {
"id": "https://openalex.org/domains/4",
"display_name": "Physical Sciences",
},
"works_count": 123,
"cited_by_count": 456,
"ids": {
"openalex": "https://openalex.org/T12419",
"wikipedia": "https://en.wikipedia.org/wiki/Machine_learning",
},
"works_api_url": (
"https://api.openalex.org/works?"
"filter=topics.id:T12419"
),
"created_date": "2023-12-25",
"updated_date": "2023-11-07T05:31:56Z",
},
"field": {
"id": "https://openalex.org/fields/17",
"display_name": "Computer Science",
},
"domain": {
"id": "https://openalex.org/domains/4",
"display_name": "Physical Sciences",
},
"works_count": 123,
"cited_by_count": 456,
"ids": {
"openalex": "https://openalex.org/T12419",
"wikipedia": "https://en.wikipedia.org/wiki/Machine_learning",
},
"works_api_url": "https://api.openalex.org/works?filter=topics.id:T12419",
"created_date": "2023-12-25",
"updated_date": "2023-11-07T05:31:56Z",
}
],
"group_by": [
{
"key": "https://openalex.org/domains/4",
"key_display_name": "Physical Sciences",
"count": 1,
}
],
},
)
client = OpenAlexTopicsClient(
api_key="test-key",
transport=httpx.MockTransport(handler),
"aggregations": {
"group_by": {
"buckets": [
{
"key": "https://openalex.org/domains/4",
"key_as_string": "Physical Sciences",
"doc_count": 1,
}
]
}
},
}
)
result = await logic.list_topics(search="machine learning", client=client)
result = await logic.list_topics(
search="machine learning",
group_by="domain.id",
client=client,
)
assert client.calls[0]["search"] == "machine learning"
assert client.calls[0]["group_by"] == "domain.id"
assert result.meta.count == 1
assert result.meta.db_response_time_ms == 12
topic = result.results[0]
assert topic.display_name == "Machine learning"
assert topic.var_field.display_name == "Computer Science"
assert topic.subfield.display_name == "Artificial Intelligence"
assert topic.domain.display_name == "Physical Sciences"
assert topic.ids.openalex == "https://openalex.org/T12419"
assert result.group_by[0].key == "https://openalex.org/domains/4"
assert result.group_by[0].key_display_name == "Physical Sciences"
assert result.group_by[0].count == 1
@pytest.mark.anyio
async def test_list_topics_rejects_sample_with_sort():
with pytest.raises(BadRequestException) as exc_info:
with pytest.raises(BadRequestException):
await logic.list_topics(sample=10, sort="works_count:desc")
@pytest.mark.anyio
async def test_list_topics_accepts_practical_openalex_type_variants():
def handler(_: httpx.Request) -> httpx.Response:
return httpx.Response(
200,
json={
"meta": {"count": "1", "page": "1", "per_page": "25"},
"results": [
client = FakeTopicsSearchClient(
{
"took": "10",
"hits": {
"total": {"value": "1", "relation": "eq"},
"hits": [
{
"id": 123,
"display_name": 456,
"description": True,
"keywords": ["topic", 123],
"subfield": {"id": 1, "display_name": 2},
"field": {"id": 3, "display_name": 4},
"domain": {"id": 5, "display_name": 6},
"works_count": "12.0",
"cited_by_count": False,
"ids": {"openalex": 123, "wikipedia": 456},
"created_date": "2023-12-25T10:11:12Z",
"updated_date": "2023-12-25",
"_id": "123",
"_source": {
"id": 123,
"display_name": 456,
"description": True,
"keywords": ["topic", 123],
"subfield": {"id": 1, "display_name": 2},
"field": {"id": 3, "display_name": 4},
"domain": {"id": 5, "display_name": 6},
"works_count": "12.0",
"cited_by_count": False,
"ids": {"openalex": 123, "wikipedia": 456},
"created_date": "2023-12-25T10:11:12Z",
"updated_date": "2023-12-25",
},
}
],
"group_by": [{"key": True, "count": "1"}],
},
)
client = OpenAlexTopicsClient(
api_key="test-key",
transport=httpx.MockTransport(handler),
"aggregations": {
"group_by": {
"buckets": [
{
"key": True,
"doc_count": "1",
}
]
}
},
}
)
result = await logic.list_topics(client=client)
result = await logic.list_topics(group_by="domain.id", client=client)
topic = result.results[0]
assert topic.id == "123"
@@ -131,42 +165,33 @@ async def test_list_topics_accepts_practical_openalex_type_variants():
@pytest.mark.anyio
async def test_autocomplete_topics_returns_frontend_options():
def handler(request: httpx.Request) -> httpx.Response:
assert request.url.params["search"] == "machine learning"
assert request.url.params["filter"] == (
"domain.id:https://openalex.org/domains/4,"
"field.id:https://openalex.org/fields/17,"
"subfield.id:https://openalex.org/subfields/1702"
)
assert request.url.params["sort"] == "works_count:desc"
assert request.url.params["per_page"] == "5"
assert request.url.params["select"] == (
"id,display_name,description,keywords,subfield,field,domain,"
"works_count,cited_by_count,ids"
)
return httpx.Response(
200,
json={
"meta": {"count": 1, "db_response_time_ms": 12},
"results": [
client = FakeTopicsSearchClient(
{
"took": 12,
"hits": {
"total": {"value": 1, "relation": "eq"},
"hits": [
{
"id": "https://openalex.org/T12419",
"display_name": "Machine learning",
"description": "Methods that learn from data.",
"field": {"display_name": "Computer Science"},
"subfield": {"display_name": "Artificial Intelligence"},
"domain": {"display_name": "Physical Sciences"},
"works_count": 123,
"cited_by_count": 456,
"ids": {"openalex": "https://openalex.org/T12419"},
"_id": "https://openalex.org/T12419",
"_source": {
"id": "https://openalex.org/T12419",
"display_name": "Machine learning",
"description": "Methods that learn from data.",
"field": {"display_name": "Computer Science"},
"subfield": {
"display_name": "Artificial Intelligence",
},
"domain": {"display_name": "Physical Sciences"},
"works_count": 123,
"cited_by_count": 456,
"ids": {
"openalex": "https://openalex.org/T12419",
},
},
}
],
},
)
client = OpenAlexTopicsClient(
api_key="test-key",
transport=httpx.MockTransport(handler),
}
)
result = await logic.autocomplete_topics(
@@ -178,9 +203,24 @@ async def test_autocomplete_topics_returns_frontend_options():
client=client,
)
assert client.calls[0]["search"] == "machine learning"
assert client.calls[0]["filter"] == (
"domain.id:https://openalex.org/domains/4,"
"field.id:https://openalex.org/fields/17,"
"subfield.id:https://openalex.org/subfields/1702"
)
assert client.calls[0]["sort"] == "works_count:desc"
assert client.calls[0]["per_page"] == 5
assert client.calls[0]["page"] == 1
assert client.calls[0]["select"] == (
"id,display_name,description,keywords,subfield,field,domain,"
"works_count,cited_by_count,ids"
)
assert result.meta.count == 1
assert result.meta.db_response_time_ms == 12
assert len(result.results) == 1
option = result.results[0]
assert option.id == "https://openalex.org/T12419"
assert option.display_name == "Machine learning"
@@ -190,4 +230,4 @@ async def test_autocomplete_topics_returns_frontend_options():
assert option.works_count == 123
assert option.cited_by_count == 456
assert option.entity_type == "topic"
assert option.external_id == "https://openalex.org/T12419"
assert option.external_id == "https://openalex.org/T12419"
@@ -1,7 +1,7 @@
import httpx
import pytest
from inse.topics.search_client import OpenAlexTopicsClient
from inse.model import ESCluster, ESIndex
from inse.topics.search_client import TopicsSearchClient
@pytest.fixture
@@ -9,10 +9,10 @@ def anyio_backend():
return "asyncio"
def test_list_topics_params_include_openalex_query_parameters():
client = OpenAlexTopicsClient(api_key="test-key")
def test_build_search_body_includes_openalex_query_parameters():
client = TopicsSearchClient(index=ESIndex.OPENALEX_TOPICS, cluster=ESCluster.NES)
params = client.list_topics_params(
body = client.build_search_body(
search="machine learning",
filter="domain.id:4,works_count:>1000",
sort="works_count:desc",
@@ -22,54 +22,128 @@ def test_list_topics_params_include_openalex_query_parameters():
select="id,display_name",
)
assert params == {
"search": "machine learning",
"filter": "domain.id:4,works_count:>1000",
"sort": "works_count:desc",
"group_by": "domain.id",
"per_page": 10,
"page": 2,
"select": "id,display_name",
"api_key": "test-key",
assert body["query"] == {
"bool": {
"must": [
{
"multi_match": {
"query": "machine learning",
"fields": client.DEFAULT_SEARCH_FIELDS,
"type": "best_fields",
"operator": "and",
}
}
],
"filter": [
{"term": {"domain.id": "4"}},
{"range": {"works_count": {"gt": "1000"}}},
],
"must_not": [],
}
}
assert body["_source"] == ["id", "display_name"]
assert body["sort"] == [
{"works_count": {"order": "desc", "missing": "_last"}}
]
# group_by queries use aggregations and no regular hits
assert body["size"] == 0
assert body["from"] == 10
assert body["track_total_hits"] is True
assert body["aggs"] == {
"group_by": {
"terms": {
"field": "domain.id",
"size": 10,
}
}
}
def test_list_topics_params_prefers_cursor_over_page():
client = OpenAlexTopicsClient(api_key="test-key")
def test_build_search_body_prefers_cursor_over_page():
client = TopicsSearchClient(index=ESIndex.OPENALEX_TOPICS, cluster=ESCluster.NES)
params = client.list_topics_params(cursor="*", page=3)
cursor = client._encode_cursor(["Machine learning", "https://openalex.org/T12419"])
assert params["cursor"] == "*"
assert "page" not in params
body = client.build_search_body(
cursor=cursor,
page=3,
per_page=25,
)
assert body["search_after"] == [
"Machine learning",
"https://openalex.org/T12419",
]
assert "from" not in body
def test_build_search_body_with_plain_cursor_star_does_not_use_page_offset():
client = TopicsSearchClient(index=ESIndex.OPENALEX_TOPICS, cluster=ESCluster.NES)
body = client.build_search_body(
cursor="*",
page=3,
per_page=25,
)
assert "search_after" not in body
assert "from" not in body
@pytest.mark.anyio
async def test_list_topics_calls_openalex_topics_endpoint():
def handler(request: httpx.Request) -> httpx.Response:
assert request.method == "GET"
assert request.url.path == "/topics"
assert request.url.params["search"] == "machine learning"
assert request.url.params["api_key"] == "test-key"
return httpx.Response(
200,
json={
"meta": {"count": 1, "page": 1, "per_page": 25},
"results": [
async def test_list_topics_calls_elasticsearch_search_wrapper(monkeypatch):
captured = {}
async def fake_elasticsearch_search(*, index, body, cluster):
captured["index"] = index
captured["body"] = body
captured["cluster"] = cluster
return {
"took": 3,
"hits": {
"total": {"value": 1, "relation": "eq"},
"hits": [
{
"id": "https://openalex.org/T12419",
"display_name": "Machine learning",
"_id": "https://openalex.org/T12419",
"_source": {
"id": "https://openalex.org/T12419",
"display_name": "Machine learning",
},
"sort": [1000, "https://openalex.org/T12419"],
}
],
},
)
}
client = OpenAlexTopicsClient(
base_url="https://api.openalex.org",
api_key="test-key",
transport=httpx.MockTransport(handler),
monkeypatch.setattr(
"inse.topics.search_client.elasticsearch_search",
fake_elasticsearch_search,
)
client = TopicsSearchClient(index=ESIndex.OPENALEX_TOPICS, cluster=ESCluster.NES)
result = await client.list_topics(search="machine learning")
assert result["meta"]["count"] == 1
assert result["results"][0]["display_name"] == "Machine learning"
assert captured["index"] == ESIndex.OPENALEX_TOPICS
assert captured["cluster"] == ESCluster.NES
assert captured["body"]["query"]["bool"]["must"] == [
{
"multi_match": {
"query": "machine learning",
"fields": client.DEFAULT_SEARCH_FIELDS,
"type": "best_fields",
"operator": "and",
}
}
]
assert captured["body"]["size"] == 25
assert captured["body"]["from"] == 0
assert captured["body"]["track_total_hits"] is True
assert result["hits"]["total"]["value"] == 1
assert result["hits"]["hits"][0]["_source"]["display_name"] == "Machine learning"
assert result["meta"]["next_cursor"] is not None
+65 -1
View File
@@ -55,6 +55,7 @@ async def get_author_works(
language: list[str] | None = None,
institution_id: list[str] | None = None,
topic_id: list[str] | None = None,
sort: str = "year",
client: OpenAlexWorksSearchClient | None = None,
) -> WorkPage:
search_client = client or OpenAlexWorksSearchClient()
@@ -68,9 +69,11 @@ async def get_author_works(
language=language,
institution_id=institution_id,
topic_id=topic_id,
sort=sort,
)
elements, total = _parse_full_work_search_response(data)
await _enrich_work_topic_descriptions(elements)
offset = (page - 1) * size
last_page = offset + len(elements) >= total
@@ -166,6 +169,15 @@ async def _get_primary_topic_counts_from_es(author_id: str) -> list[dict]:
"primary_topics": {
"terms": {"field": "primary_topic.id", "size": 1000},
},
"all_topics": {
"nested": {"path": "topics"},
"aggs": {
"topic_ids": {
"terms": {"field": "topics.id", "size": 1000},
"aggs": {"works": {"reverse_nested": {}}},
},
},
},
},
}
@@ -180,10 +192,25 @@ async def _get_primary_topic_counts_from_es(author_id: str) -> list[dict]:
aggregations = response.get("aggregations", {})
buckets = aggregations.get("primary_topics", {}).get("buckets", [])
topic_buckets = (
aggregations.get("all_topics", {}).get("topic_ids", {}).get("buckets", [])
)
broad_counts = {
bucket["key"]: bucket.get("works", {}).get("doc_count", bucket["doc_count"])
for bucket in topic_buckets
}
counts = []
for bucket in buckets:
counts.append({"id": bucket["key"], "count": bucket["doc_count"]})
topic_id = bucket["key"]
counts.append(
{
"id": topic_id,
"count": max(broad_counts.get(topic_id, 0), bucket["doc_count"]),
}
)
return counts
@@ -202,9 +229,44 @@ async def get_work(
elements, _ = _parse_full_work_search_response(response_by_title)
if not elements:
return None
await _enrich_work_topic_descriptions(elements[:1])
return elements[0]
async def enrich_topic_descriptions(topics: List) -> None:
"""Batch-fill missing descriptions on dehydrated topics.
OpenAlex work and author documents carry dehydrated topics without a
description, so we batch-load the details from the openalex-topics index.
"""
pending = [topic for topic in topics if topic.id and not topic.description]
if not pending:
return
details = await _get_topic_details(list({topic.id for topic in pending}))
if not details:
return
for topic in pending:
info = details.get(topic.id)
if info:
topic.description = info.get("description")
async def _enrich_work_topic_descriptions(works: List[Work]) -> None:
topics = []
for work in works:
topics.extend(work.topics or [])
if work.primary_topic:
topics.append(work.primary_topic)
await enrich_topic_descriptions(topics)
async def _get_topic_details(topic_ids: List[str]) -> dict[str, dict]:
if not topic_ids:
return {}
@@ -869,6 +931,7 @@ async def _search_author_works_data(
language: list[str] | None = None,
institution_id: list[str] | None = None,
topic_id: list[str] | None = None,
sort: str = "year",
) -> dict:
return await search_client.search_author_works(
author_id,
@@ -879,6 +942,7 @@ async def _search_author_works_data(
language=language,
institution_id=institution_id,
topic_id=topic_id,
sort=sort,
)
+33
View File
@@ -4,6 +4,7 @@
Pydantic models for publication works.
"""
from enum import StrEnum
from typing import List
from typing import Optional
@@ -41,3 +42,35 @@ class WorkPage(BaseModel):
class WorkList(BaseModel):
elements: List[Work] = Field(default_factory=list, description="All works.")
total: int = Field(default=0, description="The total number of works.")
class WorkPurpose(StrEnum):
"""Represents the purpose of a work. Either a foundation work or an application work."""
FOUNDATION = "Foundation"
APPLICATION = "Application"
class SpecificWorkPurpose(BaseModel):
"""Represents the purpose of a specific work, including its ID, purpose, and optional reasoning."""
raw_oa_work_id: str = Field(description="The raw OpenAlex work id.")
publication_year: Optional[int] = Field(
default=None, description="The publication year of the work."
)
purpose: WorkPurpose = Field(description="The purpose of the work.")
reasoning: Optional[str] = Field(
default=None, description="The reasoning behind the purpose determination."
)
class AuthorWorkPurposes(BaseModel):
"""Represents the purposes of an author, including their ID and a list of specific work purposes."""
raw_oa_author_id: str = Field(description="The raw OpenAlex author id.")
total: int = Field(
default=0, description="The total number of works for the author."
)
purposes: List[SpecificWorkPurpose] = Field(
default_factory=list, description="The list of specific work purposes."
)
@@ -0,0 +1,34 @@
from typing import Annotated
from fastapi import APIRouter, Path
from inse.tags import Tags
from inse.works.model import AuthorWorkPurposes, SpecificWorkPurpose
from inse.works import purpose_service
WORKS_PREFIX = "/api/purpose"
router = APIRouter(prefix=WORKS_PREFIX, tags=[Tags.WORKS])
@router.get(
"/{raw_oa_work_id}/purpose",
operation_id="getWorkPurpose",
summary="Returns the purpose of a work based on its ID.",
)
async def get_work_purpose(
raw_oa_work_id: Annotated[str, Path(description="The raw OpenAlex work id.")],
) -> SpecificWorkPurpose:
return await purpose_service.get_work_purpose(raw_oa_work_id)
@router.get(
"/{raw_oa_author_id}/purposes",
operation_id="getAuthorWorkPurposes",
summary="Returns the purposes of an author based on their ID.",
)
async def get_author_work_purposes(
raw_oa_author_id: Annotated[str, Path(description="The raw OpenAlex author id.")],
) -> AuthorWorkPurposes:
return await purpose_service.get_author_work_purposes(raw_oa_author_id)
@@ -0,0 +1,101 @@
import logging
import random
from typing import List
from fastapi import HTTPException, status
from inse.exceptions import NotFoundException
from inse.integrations import elasticsearch
from inse.model import ESIndex
from inse.works.model import AuthorWorkPurposes, SpecificWorkPurpose, WorkPurpose
logger = logging.getLogger(__name__)
async def get_work_purpose(raw_oa_work_id: str) -> SpecificWorkPurpose:
raw_oa_work_id = raw_oa_work_id.strip().upper()
response = await elasticsearch.get(
index=ESIndex.OPENALEX_WORKS,
doc_id=raw_oa_work_id,
source=["title", "abstract"],
)
logger.debug(f"Elasticsearch response for work id {raw_oa_work_id}: {response}")
source = response.get("_source", {})
if not source:
raise NotFoundException(f"Work with id {raw_oa_work_id} not found.")
logger.debug(f"Found work source for id {raw_oa_work_id}: {source}")
return SpecificWorkPurpose(
raw_oa_work_id=raw_oa_work_id,
publication_year=source.get("publication_year"),
purpose=WorkPurpose.FOUNDATION, # TODO: Replace with actual purpose determination logic
reasoning="This is a placeholder reasoning for the purpose determination.",
)
async def get_author_work_purposes(raw_oa_author_id: str) -> AuthorWorkPurposes:
raw_oa_author_id = raw_oa_author_id.strip().upper()
response = await elasticsearch.search(
index=ESIndex.OPENALEX_WORKS,
source=["id", "publication_year"],
query={
"nested": {
"path": "authorships",
"query": {
"bool": {
"filter": [
{
"term": {
"authorships.author.id": f"https://openalex.org/{raw_oa_author_id}"
}
},
],
},
},
},
},
size=10000,
)
logger.debug(f"Elasticsearch response for author id {raw_oa_author_id}: {response}")
purposes: List[SpecificWorkPurpose] = []
# TODO: implement actual retrieval of previously determined purposes for the author's works
hits_block = response.get("hits", {})
hits = hits_block.get("hits", [])
total_hits = hits_block.get("total", {}).get("value", 0)
for hit in hits:
source = hit.get("_source", {})
work_id = source.get("id")
publication_year = source.get("publication_year")
if work_id:
# TODO: Remove random based purpose assignment
if random.choice([True, False]):
purpose = SpecificWorkPurpose(
raw_oa_work_id=work_id,
publication_year=publication_year,
purpose=WorkPurpose.FOUNDATION,
reasoning=f"Placeholder reasoning for work {work_id}.",
)
else:
purpose = SpecificWorkPurpose(
raw_oa_work_id=work_id,
publication_year=publication_year,
purpose=WorkPurpose.APPLICATION,
reasoning=f"Placeholder reasoning for work {work_id}.",
)
purposes.append(purpose)
else:
logger.warning(f"Work hit without id for author {raw_oa_author_id}: {hit}")
return AuthorWorkPurposes(
raw_oa_author_id=raw_oa_author_id, total=total_hits, purposes=purposes
)
+15 -4
View File
@@ -35,6 +35,7 @@ class OpenAlexWorksSearchClient:
language: list[str] | None = None,
institution_id: list[str] | None = None,
topic_id: list[str] | None = None,
sort: str = "year",
) -> dict[str, Any]:
indexed_author_id = f"https://openalex.org/{author_id.strip()}"
filters = self._work_filters(
@@ -73,19 +74,27 @@ class OpenAlexWorksSearchClient:
},
},
})
if sort == "citations":
sort_clauses = [
{"cited_by_count": {"order": "desc", "missing": "_last"}},
{"publication_year": {"order": "desc", "missing": "_last"}},
]
else:
sort_clauses = [
{"publication_year": {"order": "desc", "missing": "_last"}},
{"cited_by_count": {"order": "desc", "missing": "_last"}},
]
return {
"from": (page - 1) * size,
"size": size,
"track_total_hits": True,
"query": {
"bool": {
"must": must_clauses,
"filter": filters,
},
},
"sort": [
{"publication_year": {"order": "desc", "missing": "_last"}},
{"cited_by_count": {"order": "desc", "missing": "_last"}},
],
"sort": sort_clauses,
}
def _work_filters(
@@ -129,6 +138,7 @@ class OpenAlexWorksSearchClient:
language: list[str] | None = None,
institution_id: list[str] | None = None,
topic_id: list[str] | None = None,
sort: str = "year",
) -> dict[str, Any]:
if not self.api_key:
raise MissingApiKeyError("OpenAlex works Elasticsearch API key is not configured.")
@@ -142,6 +152,7 @@ class OpenAlexWorksSearchClient:
language=language,
institution_id=institution_id,
topic_id=topic_id,
sort=sort,
)
return await elasticsearch.search(index=self.index,body=body,cluster=ESCluster.NES,)
+6 -1
View File
@@ -4,7 +4,7 @@
REST API for publication works.
"""
from typing import Annotated, Optional
from typing import Annotated, Literal, Optional
from fastapi import APIRouter
from fastapi import Path
@@ -54,6 +54,10 @@ async def get_author_works(
list[str] | None,
Query(description="Filter by OpenAlex topic id. Can be repeated."),
] = None,
sort: Annotated[
Literal["year", "citations"],
Query(description="Sort order: by publication year or by citation count."),
] = "year",
):
return await logic.get_author_works(
author_id,
@@ -64,6 +68,7 @@ async def get_author_works(
language=language,
institution_id=institution_id,
topic_id=topic_id,
sort=sort,
)
@@ -26,6 +26,28 @@ def test_author_works_query_searches_authorship_author_id():
assert query["query"]["bool"]["filter"] == []
def test_author_works_query_sorts_by_year_by_default():
client = OpenAlexWorksSearchClient(api_key="test-key")
query = client.author_works_query("A5023888391", page=1, size=20)
assert query["sort"] == [
{"publication_year": {"order": "desc", "missing": "_last"}},
{"cited_by_count": {"order": "desc", "missing": "_last"}},
]
def test_author_works_query_sorts_by_citations():
client = OpenAlexWorksSearchClient(api_key="test-key")
query = client.author_works_query("A5023888391", page=1, size=20, sort="citations")
assert query["sort"] == [
{"cited_by_count": {"order": "desc", "missing": "_last"}},
{"publication_year": {"order": "desc", "missing": "_last"}},
]
def test_author_works_query_adds_publication_filters():
client = OpenAlexWorksSearchClient(api_key="test-key")
+5
View File
@@ -1195,6 +1195,11 @@ Content-Type: application/json
###
GET https://project.nes.uni-due.de/elastic/openalex-works/_mapping
Authorization: ApiKey am1wWXBaMEJEVWJoZkE5MnBaUlk6TWlvbW1LRlMzNjdDUHgzYmVkUmI5UQ==
###
GET https://project.nes.uni-due.de/elastic/openalex-works/_search
Authorization: ApiKey am1wWXBaMEJEVWJoZkE5MnBaUlk6TWlvbW1LRlMzNjdDUHgzYmVkUmI5UQ==
Content-Type: application/json
@@ -36,6 +36,7 @@ model/authorNetworkNode.ts
model/authorParsedLongestName.ts
model/authorPositionCount.ts
model/authorSummaryStats.ts
model/authorWorkPurposes.ts
model/authorsFilterProperties.ts
model/authorsListResponse.ts
model/authorship.ts
@@ -48,6 +49,8 @@ model/bodyChangePassword.ts
model/bodyGetAccessToken.ts
model/bodyLogin.ts
model/bodyRequestOtk.ts
model/bodyRequestPasswordReset.ts
model/bodyResetPassword.ts
model/bundProject.ts
model/bundProjectDetails.ts
model/bundProjectPage.ts
@@ -140,6 +143,7 @@ model/loginResponse.ts
model/longitude.ts
model/matchedAuthor.ts
model/matchedOfficer.ts
model/matchedTopic.ts
model/mentionedPerson.ts
model/meta.ts
model/model2YrMeanCitedness.ts
@@ -165,6 +169,7 @@ model/publicationsByAuthorResponse.ts
model/rankingResponse.ts
model/score.ts
model/sortDirection.ts
model/specificWorkPurpose.ts
model/tokenType.ts
model/topInstitutionItem.ts
model/topic.ts
@@ -199,6 +204,7 @@ model/workKeyword.ts
model/workMeshInner.ts
model/workNetworkNode.ts
model/workPage.ts
model/workPurpose.ts
model/workSustainableDevelopmentGoalsInner.ts
model/workTopic.ts
model/workTopicDomain.ts
+45 -46
View File
@@ -46,10 +46,10 @@ npm link
In your project:
```console
npm link
npm link
```
**Note for Windows users:** The Angular CLI has troubles to use linked npm packages.
__Note for Windows users:__ The Angular CLI has troubles to use linked npm packages.
Please refer to this issue <https://github.com/angular/angular-cli/issues/8284> for a solution / workaround.
Published packages are not effected by this issue.
@@ -58,22 +58,22 @@ Published packages are not effected by this issue.
In your Angular project:
```typescript
import { ApplicationConfig } from '@angular/core';
import { provideHttpClient } from '@angular/common/http';
import { provideApi } from '';
export const appConfig: ApplicationConfig = {
providers: [
// ...
provideHttpClient(),
provideApi(),
],
providers: [
// ...
provideHttpClient(),
provideApi()
],
};
```
**NOTE**
If you're still using `AppModule` and haven't [migrated](https://angular.dev/reference/migrations/standalone) yet, you can still import an Angular module:
```typescript
import { ApiModule } from '';
```
@@ -86,11 +86,11 @@ import { provideHttpClient } from '@angular/common/http';
import { provideApi } from '';
export const appConfig: ApplicationConfig = {
providers: [
// ...
provideHttpClient(),
provideApi('http://localhost:9999'),
],
providers: [
// ...
provideHttpClient(),
provideApi('http://localhost:9999')
],
};
```
@@ -101,15 +101,15 @@ import { provideHttpClient } from '@angular/common/http';
import { provideApi } from '';
export const appConfig: ApplicationConfig = {
providers: [
// ...
provideHttpClient(),
provideApi({
withCredentials: true,
username: 'user',
password: 'password',
}),
],
providers: [
// ...
provideHttpClient(),
provideApi({
withCredentials: true,
username: 'user',
password: 'password'
})
],
};
```
@@ -120,22 +120,21 @@ import { provideHttpClient } from '@angular/common/http';
import { provideApi, Configuration } from '';
export const appConfig: ApplicationConfig = {
providers: [
// ...
provideHttpClient(),
{
provide: Configuration,
useFactory: (authService: AuthService) =>
new Configuration({
basePath: 'http://localhost:9999',
withCredentials: true,
username: authService.getUsername(),
password: authService.getPassword(),
}),
deps: [AuthService],
multi: false,
},
],
providers: [
// ...
provideHttpClient(),
{
provide: Configuration,
useFactory: (authService: AuthService) => new Configuration({
basePath: 'http://localhost:9999',
withCredentials: true,
username: authService.getUsername(),
password: authService.getPassword(),
}),
deps: [AuthService],
multi: false
}
],
};
```
@@ -152,12 +151,12 @@ import { HttpClientModule } from '@angular/common/http';
import { environment } from '../environments/environment';
export const appConfig: ApplicationConfig = {
providers: [
// ...
provideHttpClient(),
provideUserApi(environment.basePath),
provideAdminApi(environment.basePath),
],
providers: [
// ...
provideHttpClient(),
provideUserApi(environment.basePath),
provideAdminApi(environment.basePath),
],
};
```
@@ -177,8 +176,8 @@ Example value for use in your Configuration-Provider:
```typescript
new Configuration({
encodeParam: (param: Param) => myFancyParamEncoder(param),
});
encodeParam: (param: Param) => myFancyParamEncoder(param),
})
```
[parameter-locations-url]: https://github.com/OAI/OpenAPI-Specification/blob/main/versions/3.1.0.md#parameter-locations
+66 -92
View File
@@ -1,109 +1,83 @@
/**
* Innovation Search Engine API
*
*
*
*
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
* https://openapi-generator.tech
* Do not edit the class manually.
*/
import {
HttpHeaders,
HttpParams,
HttpParameterCodec,
} from '@angular/common/http';
import { HttpHeaders, HttpParams, HttpParameterCodec } from '@angular/common/http';
import { CustomHttpParameterCodec } from './encoder';
import { Configuration } from './configuration';
export class BaseService {
protected basePath = 'http://localhost:8000';
public defaultHeaders = new HttpHeaders();
public configuration: Configuration;
public encoder: HttpParameterCodec;
protected basePath = 'http://localhost:8000';
public defaultHeaders = new HttpHeaders();
public configuration: Configuration;
public encoder: HttpParameterCodec;
constructor(basePath?: string | string[], configuration?: Configuration) {
this.configuration = configuration || new Configuration();
if (typeof this.configuration.basePath !== 'string') {
const firstBasePath = Array.isArray(basePath) ? basePath[0] : undefined;
if (firstBasePath != undefined) {
basePath = firstBasePath;
}
constructor(basePath?: string|string[], configuration?: Configuration) {
this.configuration = configuration || new Configuration();
if (typeof this.configuration.basePath !== 'string') {
const firstBasePath = Array.isArray(basePath) ? basePath[0] : undefined;
if (firstBasePath != undefined) {
basePath = firstBasePath;
}
if (typeof basePath !== 'string') {
basePath = this.basePath;
}
this.configuration.basePath = basePath;
}
this.encoder = this.configuration.encoder || new CustomHttpParameterCodec();
}
protected canConsumeForm(consumes: string[]): boolean {
return consumes.indexOf('multipart/form-data') !== -1;
}
protected addToHttpParams(
httpParams: HttpParams,
value: any,
key?: string,
isDeep: boolean = false,
): HttpParams {
// If the value is an object (but not a Date), recursively add its keys.
if (typeof value === 'object' && !(value instanceof Date)) {
return this.addToHttpParamsRecursive(
httpParams,
value,
isDeep ? key : undefined,
isDeep,
);
}
return this.addToHttpParamsRecursive(httpParams, value, key);
}
protected addToHttpParamsRecursive(
httpParams: HttpParams,
value?: any,
key?: string,
isDeep: boolean = false,
): HttpParams {
if (value === null || value === undefined) {
return httpParams;
}
if (typeof value === 'object') {
// If JSON format is preferred, key must be provided.
if (key != null) {
return isDeep
? Object.keys(value as Record<string, any>).reduce(
(hp, k) => hp.append(`${key}[${k}]`, value[k]),
httpParams,
)
: httpParams.append(key, JSON.stringify(value));
}
// Otherwise, if it's an array, add each element.
if (Array.isArray(value)) {
value.forEach(
(elem) =>
(httpParams = this.addToHttpParamsRecursive(httpParams, elem, key)),
);
} else if (value instanceof Date) {
if (key != null) {
httpParams = httpParams.append(key, value.toISOString());
} else {
throw Error('key may not be null if value is Date');
if (typeof basePath !== 'string') {
basePath = this.basePath;
}
this.configuration.basePath = basePath;
}
} else {
Object.keys(value).forEach((k) => {
const paramKey = key ? `${key}.${k}` : k;
httpParams = this.addToHttpParamsRecursive(
httpParams,
value[k],
paramKey,
);
});
}
return httpParams;
} else if (key != null) {
return httpParams.append(key, value);
this.encoder = this.configuration.encoder || new CustomHttpParameterCodec();
}
protected canConsumeForm(consumes: string[]): boolean {
return consumes.indexOf('multipart/form-data') !== -1;
}
protected addToHttpParams(httpParams: HttpParams, value: any, key?: string, isDeep: boolean = false): HttpParams {
// If the value is an object (but not a Date), recursively add its keys.
if (typeof value === 'object' && !(value instanceof Date)) {
return this.addToHttpParamsRecursive(httpParams, value, isDeep ? key : undefined, isDeep);
}
return this.addToHttpParamsRecursive(httpParams, value, key);
}
protected addToHttpParamsRecursive(httpParams: HttpParams, value?: any, key?: string, isDeep: boolean = false): HttpParams {
if (value === null || value === undefined) {
return httpParams;
}
if (typeof value === 'object') {
// If JSON format is preferred, key must be provided.
if (key != null) {
return isDeep
? Object.keys(value as Record<string, any>).reduce(
(hp, k) => hp.append(`${key}[${k}]`, value[k]),
httpParams,
)
: httpParams.append(key, JSON.stringify(value));
}
// Otherwise, if it's an array, add each element.
if (Array.isArray(value)) {
value.forEach(elem => httpParams = this.addToHttpParamsRecursive(httpParams, elem, key));
} else if (value instanceof Date) {
if (key != null) {
httpParams = httpParams.append(key, value.toISOString());
} else {
throw Error("key may not be null if value is Date");
}
} else {
Object.keys(value).forEach(k => {
const paramKey = key ? `${key}.${k}` : k;
httpParams = this.addToHttpParamsRecursive(httpParams, value[k], paramKey);
});
}
return httpParams;
} else if (key != null) {
return httpParams.append(key, value);
}
throw Error("key may not be null if value is not object or array");
}
throw Error('key may not be null if value is not object or array');
}
}
+20 -32
View File
@@ -1,42 +1,30 @@
import {
NgModule,
ModuleWithProviders,
SkipSelf,
Optional,
} from '@angular/core';
import { NgModule, ModuleWithProviders, SkipSelf, Optional } from '@angular/core';
import { Configuration } from './configuration';
import { HttpClient } from '@angular/common/http';
@NgModule({
imports: [],
imports: [],
declarations: [],
exports: [],
providers: [],
exports: [],
providers: []
})
export class ApiModule {
public static forRoot(
configurationFactory: () => Configuration,
): ModuleWithProviders<ApiModule> {
return {
ngModule: ApiModule,
providers: [{ provide: Configuration, useFactory: configurationFactory }],
};
}
public static forRoot(configurationFactory: () => Configuration): ModuleWithProviders<ApiModule> {
return {
ngModule: ApiModule,
providers: [ { provide: Configuration, useFactory: configurationFactory } ]
};
}
constructor(
@Optional() @SkipSelf() parentModule: ApiModule,
@Optional() http: HttpClient,
) {
if (parentModule) {
throw new Error(
'ApiModule is already loaded. Import in your base AppModule only.',
);
constructor( @Optional() @SkipSelf() parentModule: ApiModule,
@Optional() http: HttpClient) {
if (parentModule) {
throw new Error('ApiModule is already loaded. Import in your base AppModule only.');
}
if (!http) {
throw new Error('You need to import the HttpClientModule in your AppModule! \n' +
'See also https://github.com/angular/angular/issues/20575');
}
}
if (!http) {
throw new Error(
'You need to import the HttpClientModule in your AppModule! \n' +
'See also https://github.com/angular/angular/issues/20575',
);
}
}
}
+1 -17
View File
@@ -28,20 +28,4 @@ export * from './universityRankings.service';
import { UniversityRankingsService } from './universityRankings.service';
export * from './works.service';
import { WorksService } from './works.service';
export const APIS = [
AuthService,
CompanyConnectionsService,
FundingService,
INSEServiceService,
InstitutionsService,
KeywordsService,
NewsService,
OrganizationService,
PatentsService,
PersonNetworkService,
PersonsService,
ProjectsService,
TopicsService,
UniversityRankingsService,
WorksService,
];
export const APIS = [AuthService, CompanyConnectionsService, FundingService, INSEServiceService, InstitutionsService, KeywordsService, NewsService, OrganizationService, PatentsService, PersonNetworkService, PersonsService, ProjectsService, TopicsService, UniversityRankingsService, WorksService];
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,18 +9,12 @@
*/
/* tslint:disable:no-unused-variable member-ordering */
import { Inject, Injectable, Optional } from '@angular/core';
import {
HttpClient,
HttpHeaders,
HttpParams,
HttpResponse,
HttpEvent,
HttpParameterCodec,
HttpContext,
} from '@angular/common/http';
import { CustomHttpParameterCodec } from '../encoder';
import { Observable } from 'rxjs';
import { Inject, Injectable, Optional } from '@angular/core';
import { HttpClient, HttpHeaders, HttpParams,
HttpResponse, HttpEvent, HttpParameterCodec, HttpContext
} from '@angular/common/http';
import { CustomHttpParameterCodec } from '../encoder';
import { Observable } from 'rxjs';
// @ts-ignore
import { CompanyConnectionsResponse } from '../model/companyConnectionsResponse';
@@ -28,121 +22,74 @@ import { CompanyConnectionsResponse } from '../model/companyConnectionsResponse'
import { HTTPValidationError } from '../model/hTTPValidationError';
// @ts-ignore
import { BASE_PATH, COLLECTION_FORMATS } from '../variables';
import { Configuration } from '../configuration';
import { BASE_PATH, COLLECTION_FORMATS } from '../variables';
import { Configuration } from '../configuration';
import { BaseService } from '../api.base.service';
@Injectable({
providedIn: 'root',
providedIn: 'root'
})
export class CompanyConnectionsService extends BaseService {
constructor(
protected httpClient: HttpClient,
@Optional() @Inject(BASE_PATH) basePath: string | string[],
@Optional() configuration?: Configuration,
) {
super(basePath, configuration);
}
/**
* Get possible company connections by OpenAlex author ID.
* @endpoint get /api/inse-service/authors/{author_id}/company-connections
* @param authorId
* @param observe set whether or not to return the data Observable as the body, response or events. defaults to returning the body.
* @param reportProgress flag to report request and response progress.
*/
public getCompanyConnectionsByAuthor(
authorId: string,
observe?: 'body',
reportProgress?: boolean,
options?: {
httpHeaderAccept?: 'application/json';
context?: HttpContext;
transferCache?: boolean;
},
): Observable<CompanyConnectionsResponse>;
public getCompanyConnectionsByAuthor(
authorId: string,
observe?: 'response',
reportProgress?: boolean,
options?: {
httpHeaderAccept?: 'application/json';
context?: HttpContext;
transferCache?: boolean;
},
): Observable<HttpResponse<CompanyConnectionsResponse>>;
public getCompanyConnectionsByAuthor(
authorId: string,
observe?: 'events',
reportProgress?: boolean,
options?: {
httpHeaderAccept?: 'application/json';
context?: HttpContext;
transferCache?: boolean;
},
): Observable<HttpEvent<CompanyConnectionsResponse>>;
public getCompanyConnectionsByAuthor(
authorId: 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.',
);
constructor(protected httpClient: HttpClient, @Optional() @Inject(BASE_PATH) basePath: string|string[], @Optional() configuration?: Configuration) {
super(basePath, configuration);
}
let localVarHeaders = this.defaultHeaders;
/**
* Get possible company connections by OpenAlex author ID.
* @endpoint get /api/inse-service/authors/{author_id}/company-connections
* @param authorId
* @param observe set whether or not to return the data Observable as the body, response or events. defaults to returning the body.
* @param reportProgress flag to report request and response progress.
*/
public getCompanyConnectionsByAuthor(authorId: string, observe?: 'body', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable<CompanyConnectionsResponse>;
public getCompanyConnectionsByAuthor(authorId: string, observe?: 'response', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable<HttpResponse<CompanyConnectionsResponse>>;
public getCompanyConnectionsByAuthor(authorId: string, observe?: 'events', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable<HttpEvent<CompanyConnectionsResponse>>;
public getCompanyConnectionsByAuthor(authorId: 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 localVarHttpHeaderAcceptSelected: string | undefined =
options?.httpHeaderAccept ??
this.configuration.selectHeaderAccept(['application/json']);
if (localVarHttpHeaderAcceptSelected !== undefined) {
localVarHeaders = localVarHeaders.set(
'Accept',
localVarHttpHeaderAcceptSelected,
);
let localVarHeaders = this.defaultHeaders;
const localVarHttpHeaderAcceptSelected: string | undefined = options?.httpHeaderAccept ?? this.configuration.selectHeaderAccept([
'application/json'
]);
if (localVarHttpHeaderAcceptSelected !== undefined) {
localVarHeaders = localVarHeaders.set('Accept', localVarHttpHeaderAcceptSelected);
}
const localVarHttpContext: HttpContext = options?.context ?? new HttpContext();
const localVarTransferCache: boolean = options?.transferCache ?? true;
let responseType_: 'text' | 'json' | 'blob' = 'json';
if (localVarHttpHeaderAcceptSelected) {
if (localVarHttpHeaderAcceptSelected.startsWith('text')) {
responseType_ = 'text';
} else if (this.configuration.isJsonMime(localVarHttpHeaderAcceptSelected)) {
responseType_ = 'json';
} else {
responseType_ = 'blob';
}
}
let localVarPath = `/api/inse-service/authors/${this.configuration.encodeParam({name: "authorId", value: authorId, in: "path", style: "simple", explode: false, dataType: "string", dataFormat: undefined})}/company-connections`;
const { basePath, withCredentials } = this.configuration;
return this.httpClient.request<CompanyConnectionsResponse>('get', `${basePath}${localVarPath}`,
{
context: localVarHttpContext,
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/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,
},
);
}
}
+126 -240
View File
@@ -1,7 +1,7 @@
/**
* Innovation Search Engine API
*
*
*
*
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
* https://openapi-generator.tech
@@ -9,18 +9,12 @@
*/
/* tslint:disable:no-unused-variable member-ordering */
import { Inject, Injectable, Optional } from '@angular/core';
import {
HttpClient,
HttpHeaders,
HttpParams,
HttpResponse,
HttpEvent,
HttpParameterCodec,
HttpContext,
} from '@angular/common/http';
import { CustomHttpParameterCodec } from '../encoder';
import { Observable } from 'rxjs';
import { Inject, Injectable, Optional } from '@angular/core';
import { HttpClient, HttpHeaders, HttpParams,
HttpResponse, HttpEvent, HttpParameterCodec, HttpContext
} from '@angular/common/http';
import { CustomHttpParameterCodec } from '../encoder';
import { Observable } from 'rxjs';
// @ts-ignore
import { FundersByAuthorResponse } from '../model/fundersByAuthorResponse';
@@ -30,246 +24,138 @@ import { HTTPValidationError } from '../model/hTTPValidationError';
import { PublicationsByAuthorResponse } from '../model/publicationsByAuthorResponse';
// @ts-ignore
import { BASE_PATH, COLLECTION_FORMATS } from '../variables';
import { Configuration } from '../configuration';
import { BASE_PATH, COLLECTION_FORMATS } from '../variables';
import { Configuration } from '../configuration';
import { BaseService } from '../api.base.service';
@Injectable({
providedIn: 'root',
providedIn: 'root'
})
export class FundingService extends BaseService {
constructor(
protected httpClient: HttpClient,
@Optional() @Inject(BASE_PATH) basePath: string | string[],
@Optional() configuration?: Configuration,
) {
super(basePath, configuration);
}
/**
* Get funding organizations by author.
* @endpoint get /api/inse-service/authors/{author_id}/funders
* @param authorId
* @param observe set whether or not to return the data Observable as the body, response or events. defaults to returning the body.
* @param reportProgress flag to report request and response progress.
*/
public getFundersByAuthor(
authorId: string,
observe?: 'body',
reportProgress?: boolean,
options?: {
httpHeaderAccept?: 'application/json';
context?: HttpContext;
transferCache?: boolean;
},
): Observable<FundersByAuthorResponse>;
public getFundersByAuthor(
authorId: string,
observe?: 'response',
reportProgress?: boolean,
options?: {
httpHeaderAccept?: 'application/json';
context?: HttpContext;
transferCache?: boolean;
},
): Observable<HttpResponse<FundersByAuthorResponse>>;
public getFundersByAuthor(
authorId: string,
observe?: 'events',
reportProgress?: boolean,
options?: {
httpHeaderAccept?: 'application/json';
context?: HttpContext;
transferCache?: boolean;
},
): Observable<HttpEvent<FundersByAuthorResponse>>;
public getFundersByAuthor(
authorId: 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 getFundersByAuthor.',
);
constructor(protected httpClient: HttpClient, @Optional() @Inject(BASE_PATH) basePath: string|string[], @Optional() configuration?: Configuration) {
super(basePath, configuration);
}
let localVarHeaders = this.defaultHeaders;
/**
* Get funding organizations by author.
* @endpoint get /api/inse-service/authors/{author_id}/funders
* @param authorId
* @param observe set whether or not to return the data Observable as the body, response or events. defaults to returning the body.
* @param reportProgress flag to report request and response progress.
*/
public getFundersByAuthor(authorId: string, observe?: 'body', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable<FundersByAuthorResponse>;
public getFundersByAuthor(authorId: string, observe?: 'response', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable<HttpResponse<FundersByAuthorResponse>>;
public getFundersByAuthor(authorId: string, observe?: 'events', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable<HttpEvent<FundersByAuthorResponse>>;
public getFundersByAuthor(authorId: 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 getFundersByAuthor.');
}
const localVarHttpHeaderAcceptSelected: string | undefined =
options?.httpHeaderAccept ??
this.configuration.selectHeaderAccept(['application/json']);
if (localVarHttpHeaderAcceptSelected !== undefined) {
localVarHeaders = localVarHeaders.set(
'Accept',
localVarHttpHeaderAcceptSelected,
);
let localVarHeaders = this.defaultHeaders;
const localVarHttpHeaderAcceptSelected: string | undefined = options?.httpHeaderAccept ?? this.configuration.selectHeaderAccept([
'application/json'
]);
if (localVarHttpHeaderAcceptSelected !== undefined) {
localVarHeaders = localVarHeaders.set('Accept', localVarHttpHeaderAcceptSelected);
}
const localVarHttpContext: HttpContext = options?.context ?? new HttpContext();
const localVarTransferCache: boolean = options?.transferCache ?? true;
let responseType_: 'text' | 'json' | 'blob' = 'json';
if (localVarHttpHeaderAcceptSelected) {
if (localVarHttpHeaderAcceptSelected.startsWith('text')) {
responseType_ = 'text';
} else if (this.configuration.isJsonMime(localVarHttpHeaderAcceptSelected)) {
responseType_ = 'json';
} else {
responseType_ = 'blob';
}
}
let localVarPath = `/api/inse-service/authors/${this.configuration.encodeParam({name: "authorId", value: authorId, in: "path", style: "simple", explode: false, dataType: "string", dataFormat: undefined})}/funders`;
const { basePath, withCredentials } = this.configuration;
return this.httpClient.request<FundersByAuthorResponse>('get', `${basePath}${localVarPath}`,
{
context: localVarHttpContext,
responseType: <any>responseType_,
...(withCredentials ? { withCredentials } : {}),
headers: localVarHeaders,
observe: observe,
...(localVarTransferCache !== undefined ? { transferCache: localVarTransferCache } : {}),
reportProgress: reportProgress
}
);
}
const localVarHttpContext: HttpContext =
options?.context ?? new HttpContext();
/**
* Get funded publications by author.
* @endpoint get /api/inse-service/authors/{author_id}/publications
* @param authorId
* @param page
* @param pageSize
* @param observe set whether or not to return the data Observable as the body, response or events. defaults to returning the body.
* @param reportProgress flag to report request and response progress.
*/
public getPublicationsByAuthor(authorId: string, page?: number, pageSize?: number, observe?: 'body', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable<PublicationsByAuthorResponse>;
public getPublicationsByAuthor(authorId: string, page?: number, pageSize?: number, observe?: 'response', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable<HttpResponse<PublicationsByAuthorResponse>>;
public getPublicationsByAuthor(authorId: string, page?: number, pageSize?: number, observe?: 'events', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable<HttpEvent<PublicationsByAuthorResponse>>;
public getPublicationsByAuthor(authorId: string, page?: number, pageSize?: number, 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 getPublicationsByAuthor.');
}
const localVarTransferCache: boolean = options?.transferCache ?? true;
let localVarQueryParameters = new HttpParams({encoder: this.encoder});
localVarQueryParameters = this.addToHttpParams(localVarQueryParameters,
<any>page, 'page');
localVarQueryParameters = this.addToHttpParams(localVarQueryParameters,
<any>pageSize, 'page_size');
let responseType_: 'text' | 'json' | 'blob' = 'json';
if (localVarHttpHeaderAcceptSelected) {
if (localVarHttpHeaderAcceptSelected.startsWith('text')) {
responseType_ = 'text';
} else if (
this.configuration.isJsonMime(localVarHttpHeaderAcceptSelected)
) {
responseType_ = 'json';
} else {
responseType_ = 'blob';
}
let localVarHeaders = this.defaultHeaders;
const localVarHttpHeaderAcceptSelected: string | undefined = options?.httpHeaderAccept ?? this.configuration.selectHeaderAccept([
'application/json'
]);
if (localVarHttpHeaderAcceptSelected !== undefined) {
localVarHeaders = localVarHeaders.set('Accept', localVarHttpHeaderAcceptSelected);
}
const localVarHttpContext: HttpContext = options?.context ?? new HttpContext();
const localVarTransferCache: boolean = options?.transferCache ?? true;
let responseType_: 'text' | 'json' | 'blob' = 'json';
if (localVarHttpHeaderAcceptSelected) {
if (localVarHttpHeaderAcceptSelected.startsWith('text')) {
responseType_ = 'text';
} else if (this.configuration.isJsonMime(localVarHttpHeaderAcceptSelected)) {
responseType_ = 'json';
} else {
responseType_ = 'blob';
}
}
let localVarPath = `/api/inse-service/authors/${this.configuration.encodeParam({name: "authorId", value: authorId, in: "path", style: "simple", explode: false, dataType: "string", dataFormat: undefined})}/publications`;
const { basePath, withCredentials } = this.configuration;
return this.httpClient.request<PublicationsByAuthorResponse>('get', `${basePath}${localVarPath}`,
{
context: localVarHttpContext,
params: localVarQueryParameters,
responseType: <any>responseType_,
...(withCredentials ? { withCredentials } : {}),
headers: localVarHeaders,
observe: observe,
...(localVarTransferCache !== undefined ? { transferCache: localVarTransferCache } : {}),
reportProgress: reportProgress
}
);
}
let localVarPath = `/api/inse-service/authors/${this.configuration.encodeParam({ name: 'authorId', value: authorId, in: 'path', style: 'simple', explode: false, dataType: 'string', dataFormat: undefined })}/funders`;
const { basePath, withCredentials } = this.configuration;
return this.httpClient.request<FundersByAuthorResponse>(
'get',
`${basePath}${localVarPath}`,
{
context: localVarHttpContext,
responseType: <any>responseType_,
...(withCredentials ? { withCredentials } : {}),
headers: localVarHeaders,
observe: observe,
...(localVarTransferCache !== undefined
? { transferCache: localVarTransferCache }
: {}),
reportProgress: reportProgress,
},
);
}
/**
* Get funded publications by author.
* @endpoint get /api/inse-service/authors/{author_id}/publications
* @param authorId
* @param page
* @param pageSize
* @param observe set whether or not to return the data Observable as the body, response or events. defaults to returning the body.
* @param reportProgress flag to report request and response progress.
*/
public getPublicationsByAuthor(
authorId: string,
page?: number,
pageSize?: number,
observe?: 'body',
reportProgress?: boolean,
options?: {
httpHeaderAccept?: 'application/json';
context?: HttpContext;
transferCache?: boolean;
},
): Observable<PublicationsByAuthorResponse>;
public getPublicationsByAuthor(
authorId: string,
page?: number,
pageSize?: number,
observe?: 'response',
reportProgress?: boolean,
options?: {
httpHeaderAccept?: 'application/json';
context?: HttpContext;
transferCache?: boolean;
},
): Observable<HttpResponse<PublicationsByAuthorResponse>>;
public getPublicationsByAuthor(
authorId: string,
page?: number,
pageSize?: number,
observe?: 'events',
reportProgress?: boolean,
options?: {
httpHeaderAccept?: 'application/json';
context?: HttpContext;
transferCache?: boolean;
},
): Observable<HttpEvent<PublicationsByAuthorResponse>>;
public getPublicationsByAuthor(
authorId: string,
page?: number,
pageSize?: number,
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 getPublicationsByAuthor.',
);
}
let localVarQueryParameters = new HttpParams({ encoder: this.encoder });
localVarQueryParameters = this.addToHttpParams(
localVarQueryParameters,
<any>page,
'page',
);
localVarQueryParameters = this.addToHttpParams(
localVarQueryParameters,
<any>pageSize,
'page_size',
);
let localVarHeaders = this.defaultHeaders;
const localVarHttpHeaderAcceptSelected: string | undefined =
options?.httpHeaderAccept ??
this.configuration.selectHeaderAccept(['application/json']);
if (localVarHttpHeaderAcceptSelected !== undefined) {
localVarHeaders = localVarHeaders.set(
'Accept',
localVarHttpHeaderAcceptSelected,
);
}
const localVarHttpContext: HttpContext =
options?.context ?? new HttpContext();
const localVarTransferCache: boolean = options?.transferCache ?? true;
let responseType_: 'text' | 'json' | 'blob' = 'json';
if (localVarHttpHeaderAcceptSelected) {
if (localVarHttpHeaderAcceptSelected.startsWith('text')) {
responseType_ = 'text';
} else if (
this.configuration.isJsonMime(localVarHttpHeaderAcceptSelected)
) {
responseType_ = 'json';
} else {
responseType_ = 'blob';
}
}
let localVarPath = `/api/inse-service/authors/${this.configuration.encodeParam({ name: 'authorId', value: authorId, in: 'path', style: 'simple', explode: false, dataType: 'string', dataFormat: undefined })}/publications`;
const { basePath, withCredentials } = this.configuration;
return this.httpClient.request<PublicationsByAuthorResponse>(
'get',
`${basePath}${localVarPath}`,
{
context: localVarHttpContext,
params: localVarQueryParameters,
responseType: <any>responseType_,
...(withCredentials ? { withCredentials } : {}),
headers: localVarHeaders,
observe: observe,
...(localVarTransferCache !== undefined
? { transferCache: localVarTransferCache }
: {}),
reportProgress: reportProgress,
},
);
}
}
+174 -324
View File
@@ -1,7 +1,7 @@
/**
* Innovation Search Engine API
*
*
*
*
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
* https://openapi-generator.tech
@@ -9,355 +9,205 @@
*/
/* tslint:disable:no-unused-variable member-ordering */
import { Inject, Injectable, Optional } from '@angular/core';
import {
HttpClient,
HttpHeaders,
HttpParams,
HttpResponse,
HttpEvent,
HttpParameterCodec,
HttpContext,
} from '@angular/common/http';
import { CustomHttpParameterCodec } from '../encoder';
import { Observable } from 'rxjs';
import { Inject, Injectable, Optional } from '@angular/core';
import { HttpClient, HttpHeaders, HttpParams,
HttpResponse, HttpEvent, HttpParameterCodec, HttpContext
} from '@angular/common/http';
import { CustomHttpParameterCodec } from '../encoder';
import { Observable } from 'rxjs';
// @ts-ignore
import { HTTPValidationError } from '../model/hTTPValidationError';
// @ts-ignore
import { BASE_PATH, COLLECTION_FORMATS } from '../variables';
import { Configuration } from '../configuration';
import { BASE_PATH, COLLECTION_FORMATS } from '../variables';
import { Configuration } from '../configuration';
import { BaseService } from '../api.base.service';
@Injectable({
providedIn: 'root',
providedIn: 'root'
})
export class INSEServiceService extends BaseService {
constructor(
protected httpClient: HttpClient,
@Optional() @Inject(BASE_PATH) basePath: string | string[],
@Optional() configuration?: Configuration,
) {
super(basePath, configuration);
}
/**
* Builds the topic hierarchy cache.
* @endpoint get /api/inse-service/topics/cache
* @param pageSize Page size for each search page.
* @param saveJson Persist cache JSON to data folder.
* @param observe set whether or not to return the data Observable as the body, response or events. defaults to returning the body.
* @param reportProgress flag to report request and response progress.
*/
public buildTopicCache(
pageSize?: number,
saveJson?: boolean,
observe?: 'body',
reportProgress?: boolean,
options?: {
httpHeaderAccept?: 'application/json';
context?: HttpContext;
transferCache?: boolean;
},
): Observable<object>;
public buildTopicCache(
pageSize?: number,
saveJson?: boolean,
observe?: 'response',
reportProgress?: boolean,
options?: {
httpHeaderAccept?: 'application/json';
context?: HttpContext;
transferCache?: boolean;
},
): Observable<HttpResponse<object>>;
public buildTopicCache(
pageSize?: number,
saveJson?: boolean,
observe?: 'events',
reportProgress?: boolean,
options?: {
httpHeaderAccept?: 'application/json';
context?: HttpContext;
transferCache?: boolean;
},
): Observable<HttpEvent<object>>;
public buildTopicCache(
pageSize?: number,
saveJson?: boolean,
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>pageSize,
'page_size',
);
localVarQueryParameters = this.addToHttpParams(
localVarQueryParameters,
<any>saveJson,
'save_json',
);
let localVarHeaders = this.defaultHeaders;
const localVarHttpHeaderAcceptSelected: string | undefined =
options?.httpHeaderAccept ??
this.configuration.selectHeaderAccept(['application/json']);
if (localVarHttpHeaderAcceptSelected !== undefined) {
localVarHeaders = localVarHeaders.set(
'Accept',
localVarHttpHeaderAcceptSelected,
);
constructor(protected httpClient: HttpClient, @Optional() @Inject(BASE_PATH) basePath: string|string[], @Optional() configuration?: Configuration) {
super(basePath, configuration);
}
const localVarHttpContext: HttpContext =
options?.context ?? new HttpContext();
/**
* Builds the topic hierarchy cache.
* @endpoint get /api/inse-service/topics/cache
* @param pageSize Page size for each search page.
* @param saveJson Persist cache JSON to data folder.
* @param observe set whether or not to return the data Observable as the body, response or events. defaults to returning the body.
* @param reportProgress flag to report request and response progress.
*/
public buildTopicCache(pageSize?: number, saveJson?: boolean, observe?: 'body', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable<object>;
public buildTopicCache(pageSize?: number, saveJson?: boolean, observe?: 'response', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable<HttpResponse<object>>;
public buildTopicCache(pageSize?: number, saveJson?: boolean, observe?: 'events', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable<HttpEvent<object>>;
public buildTopicCache(pageSize?: number, saveJson?: boolean, observe: any = 'body', reportProgress: boolean = false, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable<any> {
const localVarTransferCache: boolean = options?.transferCache ?? true;
let localVarQueryParameters = new HttpParams({encoder: this.encoder});
localVarQueryParameters = this.addToHttpParams(localVarQueryParameters,
<any>pageSize, 'page_size');
localVarQueryParameters = this.addToHttpParams(localVarQueryParameters,
<any>saveJson, 'save_json');
let responseType_: 'text' | 'json' | 'blob' = 'json';
if (localVarHttpHeaderAcceptSelected) {
if (localVarHttpHeaderAcceptSelected.startsWith('text')) {
responseType_ = 'text';
} else if (
this.configuration.isJsonMime(localVarHttpHeaderAcceptSelected)
) {
responseType_ = 'json';
} else {
responseType_ = 'blob';
}
}
let localVarHeaders = this.defaultHeaders;
let localVarPath = `/api/inse-service/topics/cache`;
const { basePath, withCredentials } = this.configuration;
return this.httpClient.request<object>(
'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);
}
/**
* Counts topic hierarchy occurrences from cache.
* @endpoint get /api/inse-service/topics/count
* @param topic Topic names (repeat parameter).
* @param observe set whether or not to return the data Observable as the body, response or events. defaults to returning the body.
* @param reportProgress flag to report request and response progress.
*/
public countTopicHierarchy(
topic: Array<string>,
observe?: 'body',
reportProgress?: boolean,
options?: {
httpHeaderAccept?: 'application/json';
context?: HttpContext;
transferCache?: boolean;
},
): Observable<object>;
public countTopicHierarchy(
topic: Array<string>,
observe?: 'response',
reportProgress?: boolean,
options?: {
httpHeaderAccept?: 'application/json';
context?: HttpContext;
transferCache?: boolean;
},
): Observable<HttpResponse<object>>;
public countTopicHierarchy(
topic: Array<string>,
observe?: 'events',
reportProgress?: boolean,
options?: {
httpHeaderAccept?: 'application/json';
context?: HttpContext;
transferCache?: boolean;
},
): Observable<HttpEvent<object>>;
public countTopicHierarchy(
topic: Array<string>,
observe: any = 'body',
reportProgress: boolean = false,
options?: {
httpHeaderAccept?: 'application/json';
context?: HttpContext;
transferCache?: boolean;
},
): Observable<any> {
if (topic === null || topic === undefined) {
throw new Error(
'Required parameter topic was null or undefined when calling countTopicHierarchy.',
);
}
const localVarHttpContext: HttpContext = options?.context ?? new HttpContext();
let localVarQueryParameters = new HttpParams({ encoder: this.encoder });
if (topic) {
topic.forEach((element) => {
localVarQueryParameters = this.addToHttpParams(
localVarQueryParameters,
<any>element,
'topic',
const localVarTransferCache: boolean = options?.transferCache ?? true;
let responseType_: 'text' | 'json' | 'blob' = 'json';
if (localVarHttpHeaderAcceptSelected) {
if (localVarHttpHeaderAcceptSelected.startsWith('text')) {
responseType_ = 'text';
} else if (this.configuration.isJsonMime(localVarHttpHeaderAcceptSelected)) {
responseType_ = 'json';
} else {
responseType_ = 'blob';
}
}
let localVarPath = `/api/inse-service/topics/cache`;
const { basePath, withCredentials } = this.configuration;
return this.httpClient.request<object>('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;
/**
* Counts topic hierarchy occurrences from cache.
* @endpoint get /api/inse-service/topics/count
* @param topic Topic names (repeat parameter).
* @param observe set whether or not to return the data Observable as the body, response or events. defaults to returning the body.
* @param reportProgress flag to report request and response progress.
*/
public countTopicHierarchy(topic: Array<string>, observe?: 'body', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable<object>;
public countTopicHierarchy(topic: Array<string>, observe?: 'response', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable<HttpResponse<object>>;
public countTopicHierarchy(topic: Array<string>, observe?: 'events', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable<HttpEvent<object>>;
public countTopicHierarchy(topic: Array<string>, observe: any = 'body', reportProgress: boolean = false, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable<any> {
if (topic === null || topic === undefined) {
throw new Error('Required parameter topic was null or undefined when calling countTopicHierarchy.');
}
const localVarHttpHeaderAcceptSelected: string | undefined =
options?.httpHeaderAccept ??
this.configuration.selectHeaderAccept(['application/json']);
if (localVarHttpHeaderAcceptSelected !== undefined) {
localVarHeaders = localVarHeaders.set(
'Accept',
localVarHttpHeaderAcceptSelected,
);
let localVarQueryParameters = new HttpParams({encoder: this.encoder});
if (topic) {
topic.forEach((element) => {
localVarQueryParameters = this.addToHttpParams(localVarQueryParameters,
<any>element, 'topic');
})
}
let localVarHeaders = this.defaultHeaders;
const localVarHttpHeaderAcceptSelected: string | undefined = options?.httpHeaderAccept ?? this.configuration.selectHeaderAccept([
'application/json'
]);
if (localVarHttpHeaderAcceptSelected !== undefined) {
localVarHeaders = localVarHeaders.set('Accept', localVarHttpHeaderAcceptSelected);
}
const localVarHttpContext: HttpContext = options?.context ?? new HttpContext();
const localVarTransferCache: boolean = options?.transferCache ?? true;
let responseType_: 'text' | 'json' | 'blob' = 'json';
if (localVarHttpHeaderAcceptSelected) {
if (localVarHttpHeaderAcceptSelected.startsWith('text')) {
responseType_ = 'text';
} else if (this.configuration.isJsonMime(localVarHttpHeaderAcceptSelected)) {
responseType_ = 'json';
} else {
responseType_ = 'blob';
}
}
let localVarPath = `/api/inse-service/topics/count`;
const { basePath, withCredentials } = this.configuration;
return this.httpClient.request<object>('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 the nested topic hierarchy (Domains -&gt; Fields -&gt; Subfields -&gt; Topics).
* @endpoint get /api/inse-service/topics/hierarchy
* @param observe set whether or not to return the data Observable as the body, response or events. defaults to returning the body.
* @param reportProgress flag to report request and response progress.
*/
public getTopicHierarchy(observe?: 'body', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable<object>;
public getTopicHierarchy(observe?: 'response', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable<HttpResponse<object>>;
public getTopicHierarchy(observe?: 'events', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable<HttpEvent<object>>;
public getTopicHierarchy(observe: any = 'body', reportProgress: boolean = false, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable<any> {
const localVarTransferCache: boolean = options?.transferCache ?? true;
let localVarHeaders = this.defaultHeaders;
let responseType_: 'text' | 'json' | 'blob' = 'json';
if (localVarHttpHeaderAcceptSelected) {
if (localVarHttpHeaderAcceptSelected.startsWith('text')) {
responseType_ = 'text';
} else if (
this.configuration.isJsonMime(localVarHttpHeaderAcceptSelected)
) {
responseType_ = 'json';
} else {
responseType_ = 'blob';
}
const localVarHttpHeaderAcceptSelected: string | undefined = options?.httpHeaderAccept ?? this.configuration.selectHeaderAccept([
'application/json'
]);
if (localVarHttpHeaderAcceptSelected !== undefined) {
localVarHeaders = localVarHeaders.set('Accept', localVarHttpHeaderAcceptSelected);
}
const localVarHttpContext: HttpContext = options?.context ?? new HttpContext();
const localVarTransferCache: boolean = options?.transferCache ?? true;
let responseType_: 'text' | 'json' | 'blob' = 'json';
if (localVarHttpHeaderAcceptSelected) {
if (localVarHttpHeaderAcceptSelected.startsWith('text')) {
responseType_ = 'text';
} else if (this.configuration.isJsonMime(localVarHttpHeaderAcceptSelected)) {
responseType_ = 'json';
} else {
responseType_ = 'blob';
}
}
let localVarPath = `/api/inse-service/topics/hierarchy`;
const { basePath, withCredentials } = this.configuration;
return this.httpClient.request<object>('get', `${basePath}${localVarPath}`,
{
context: localVarHttpContext,
responseType: <any>responseType_,
...(withCredentials ? { withCredentials } : {}),
headers: localVarHeaders,
observe: observe,
...(localVarTransferCache !== undefined ? { transferCache: localVarTransferCache } : {}),
reportProgress: reportProgress
}
);
}
let localVarPath = `/api/inse-service/topics/count`;
const { basePath, withCredentials } = this.configuration;
return this.httpClient.request<object>(
'get',
`${basePath}${localVarPath}`,
{
context: localVarHttpContext,
params: localVarQueryParameters,
responseType: <any>responseType_,
...(withCredentials ? { withCredentials } : {}),
headers: localVarHeaders,
observe: observe,
...(localVarTransferCache !== undefined
? { transferCache: localVarTransferCache }
: {}),
reportProgress: reportProgress,
},
);
}
/**
* Returns the nested topic hierarchy (Domains -&gt; Fields -&gt; Subfields -&gt; Topics).
* @endpoint get /api/inse-service/topics/hierarchy
* @param observe set whether or not to return the data Observable as the body, response or events. defaults to returning the body.
* @param reportProgress flag to report request and response progress.
*/
public getTopicHierarchy(
observe?: 'body',
reportProgress?: boolean,
options?: {
httpHeaderAccept?: 'application/json';
context?: HttpContext;
transferCache?: boolean;
},
): Observable<object>;
public getTopicHierarchy(
observe?: 'response',
reportProgress?: boolean,
options?: {
httpHeaderAccept?: 'application/json';
context?: HttpContext;
transferCache?: boolean;
},
): Observable<HttpResponse<object>>;
public getTopicHierarchy(
observe?: 'events',
reportProgress?: boolean,
options?: {
httpHeaderAccept?: 'application/json';
context?: HttpContext;
transferCache?: boolean;
},
): Observable<HttpEvent<object>>;
public getTopicHierarchy(
observe: any = 'body',
reportProgress: boolean = false,
options?: {
httpHeaderAccept?: 'application/json';
context?: HttpContext;
transferCache?: boolean;
},
): Observable<any> {
let localVarHeaders = this.defaultHeaders;
const localVarHttpHeaderAcceptSelected: string | undefined =
options?.httpHeaderAccept ??
this.configuration.selectHeaderAccept(['application/json']);
if (localVarHttpHeaderAcceptSelected !== undefined) {
localVarHeaders = localVarHeaders.set(
'Accept',
localVarHttpHeaderAcceptSelected,
);
}
const localVarHttpContext: HttpContext =
options?.context ?? new HttpContext();
const localVarTransferCache: boolean = options?.transferCache ?? true;
let responseType_: 'text' | 'json' | 'blob' = 'json';
if (localVarHttpHeaderAcceptSelected) {
if (localVarHttpHeaderAcceptSelected.startsWith('text')) {
responseType_ = 'text';
} else if (
this.configuration.isJsonMime(localVarHttpHeaderAcceptSelected)
) {
responseType_ = 'json';
} else {
responseType_ = 'blob';
}
}
let localVarPath = `/api/inse-service/topics/hierarchy`;
const { basePath, withCredentials } = this.configuration;
return this.httpClient.request<object>(
'get',
`${basePath}${localVarPath}`,
{
context: localVarHttpContext,
responseType: <any>responseType_,
...(withCredentials ? { withCredentials } : {}),
headers: localVarHeaders,
observe: observe,
...(localVarTransferCache !== undefined
? { transferCache: localVarTransferCache }
: {}),
reportProgress: reportProgress,
},
);
}
}
+276 -578
View File
@@ -1,7 +1,7 @@
/**
* Innovation Search Engine API
*
*
*
*
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
* https://openapi-generator.tech
@@ -9,18 +9,12 @@
*/
/* tslint:disable:no-unused-variable member-ordering */
import { Inject, Injectable, Optional } from '@angular/core';
import {
HttpClient,
HttpHeaders,
HttpParams,
HttpResponse,
HttpEvent,
HttpParameterCodec,
HttpContext,
} from '@angular/common/http';
import { CustomHttpParameterCodec } from '../encoder';
import { Observable } from 'rxjs';
import { Inject, Injectable, Optional } from '@angular/core';
import { HttpClient, HttpHeaders, HttpParams,
HttpResponse, HttpEvent, HttpParameterCodec, HttpContext
} from '@angular/common/http';
import { CustomHttpParameterCodec } from '../encoder';
import { Observable } from 'rxjs';
// @ts-ignore
import { AutocompleteResponse } from '../model/autocompleteResponse';
@@ -34,591 +28,295 @@ import { InstitutionPage } from '../model/institutionPage';
import { InstitutionsListResponse } from '../model/institutionsListResponse';
// @ts-ignore
import { BASE_PATH, COLLECTION_FORMATS } from '../variables';
import { Configuration } from '../configuration';
import { BASE_PATH, COLLECTION_FORMATS } from '../variables';
import { Configuration } from '../configuration';
import { BaseService } from '../api.base.service';
@Injectable({
providedIn: 'root',
providedIn: 'root'
})
export class InstitutionsService extends BaseService {
constructor(
protected httpClient: HttpClient,
@Optional() @Inject(BASE_PATH) basePath: string | string[],
@Optional() configuration?: Configuration,
) {
super(basePath, configuration);
}
/**
* Returns institution options for autocomplete inputs.
* @endpoint get /api/inse-service/institutions/autocomplete
* @param query Institution search text, for example \&#39;Duisburg Essen\&#39;.
* @param countryCode Optional ISO country code filter.
* @param type Optional institution type filter.
* @param limit Maximum number of autocomplete options.
* @param observe set whether or not to return the data Observable as the body, response or events. defaults to returning the body.
* @param reportProgress flag to report request and response progress.
*/
public autocompleteInstitutions(
query: string,
countryCode?: string,
type?: string,
limit?: number,
observe?: 'body',
reportProgress?: boolean,
options?: {
httpHeaderAccept?: 'application/json';
context?: HttpContext;
transferCache?: boolean;
},
): Observable<AutocompleteResponse>;
public autocompleteInstitutions(
query: string,
countryCode?: string,
type?: string,
limit?: number,
observe?: 'response',
reportProgress?: boolean,
options?: {
httpHeaderAccept?: 'application/json';
context?: HttpContext;
transferCache?: boolean;
},
): Observable<HttpResponse<AutocompleteResponse>>;
public autocompleteInstitutions(
query: string,
countryCode?: string,
type?: string,
limit?: number,
observe?: 'events',
reportProgress?: boolean,
options?: {
httpHeaderAccept?: 'application/json';
context?: HttpContext;
transferCache?: boolean;
},
): Observable<HttpEvent<AutocompleteResponse>>;
public autocompleteInstitutions(
query: string,
countryCode?: string,
type?: string,
limit?: number,
observe: any = 'body',
reportProgress: boolean = false,
options?: {
httpHeaderAccept?: 'application/json';
context?: HttpContext;
transferCache?: boolean;
},
): Observable<any> {
if (query === null || query === undefined) {
throw new Error(
'Required parameter query was null or undefined when calling autocompleteInstitutions.',
);
constructor(protected httpClient: HttpClient, @Optional() @Inject(BASE_PATH) basePath: string|string[], @Optional() configuration?: Configuration) {
super(basePath, configuration);
}
let localVarQueryParameters = new HttpParams({ encoder: this.encoder });
localVarQueryParameters = this.addToHttpParams(
localVarQueryParameters,
<any>query,
'query',
);
localVarQueryParameters = this.addToHttpParams(
localVarQueryParameters,
<any>countryCode,
'countryCode',
);
localVarQueryParameters = this.addToHttpParams(
localVarQueryParameters,
<any>type,
'type',
);
localVarQueryParameters = this.addToHttpParams(
localVarQueryParameters,
<any>limit,
'limit',
);
/**
* Returns institution options for autocomplete inputs.
* @endpoint get /api/inse-service/institutions/autocomplete
* @param query Institution search text, for example \&#39;Duisburg Essen\&#39;.
* @param countryCode Optional ISO country code filter.
* @param type Optional institution type filter.
* @param limit Maximum number of autocomplete options.
* @param observe set whether or not to return the data Observable as the body, response or events. defaults to returning the body.
* @param reportProgress flag to report request and response progress.
*/
public autocompleteInstitutions(query: string, countryCode?: string, type?: string, limit?: number, observe?: 'body', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable<AutocompleteResponse>;
public autocompleteInstitutions(query: string, countryCode?: string, type?: string, limit?: number, observe?: 'response', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable<HttpResponse<AutocompleteResponse>>;
public autocompleteInstitutions(query: string, countryCode?: string, type?: string, limit?: number, observe?: 'events', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable<HttpEvent<AutocompleteResponse>>;
public autocompleteInstitutions(query: string, countryCode?: string, type?: string, limit?: number, observe: any = 'body', reportProgress: boolean = false, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable<any> {
if (query === null || query === undefined) {
throw new Error('Required parameter query was null or undefined when calling autocompleteInstitutions.');
}
let localVarHeaders = this.defaultHeaders;
let localVarQueryParameters = new HttpParams({encoder: this.encoder});
localVarQueryParameters = this.addToHttpParams(localVarQueryParameters,
<any>query, 'query');
localVarQueryParameters = this.addToHttpParams(localVarQueryParameters,
<any>countryCode, 'countryCode');
localVarQueryParameters = this.addToHttpParams(localVarQueryParameters,
<any>type, 'type');
localVarQueryParameters = this.addToHttpParams(localVarQueryParameters,
<any>limit, 'limit');
const localVarHttpHeaderAcceptSelected: string | undefined =
options?.httpHeaderAccept ??
this.configuration.selectHeaderAccept(['application/json']);
if (localVarHttpHeaderAcceptSelected !== undefined) {
localVarHeaders = localVarHeaders.set(
'Accept',
localVarHttpHeaderAcceptSelected,
);
let localVarHeaders = this.defaultHeaders;
const localVarHttpHeaderAcceptSelected: string | undefined = options?.httpHeaderAccept ?? this.configuration.selectHeaderAccept([
'application/json'
]);
if (localVarHttpHeaderAcceptSelected !== undefined) {
localVarHeaders = localVarHeaders.set('Accept', localVarHttpHeaderAcceptSelected);
}
const localVarHttpContext: HttpContext = options?.context ?? new HttpContext();
const localVarTransferCache: boolean = options?.transferCache ?? true;
let responseType_: 'text' | 'json' | 'blob' = 'json';
if (localVarHttpHeaderAcceptSelected) {
if (localVarHttpHeaderAcceptSelected.startsWith('text')) {
responseType_ = 'text';
} else if (this.configuration.isJsonMime(localVarHttpHeaderAcceptSelected)) {
responseType_ = 'json';
} else {
responseType_ = 'blob';
}
}
let localVarPath = `/api/inse-service/institutions/autocomplete`;
const { basePath, withCredentials } = this.configuration;
return this.httpClient.request<AutocompleteResponse>('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 a single institution by ID.
* Returns a single institution by its OpenAlex ID.
* @endpoint get /api/inse-service/institutions/{id}
* @param id
* @param observe set whether or not to return the data Observable as the body, response or events. defaults to returning the body.
* @param reportProgress flag to report request and response progress.
*/
public getInstitutionById(id: string, observe?: 'body', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable<Institution>;
public getInstitutionById(id: string, observe?: 'response', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable<HttpResponse<Institution>>;
public getInstitutionById(id: string, observe?: 'events', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable<HttpEvent<Institution>>;
public getInstitutionById(id: string, observe: any = 'body', reportProgress: boolean = false, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable<any> {
if (id === null || id === undefined) {
throw new Error('Required parameter id was null or undefined when calling getInstitutionById.');
}
const localVarTransferCache: boolean = options?.transferCache ?? true;
let localVarHeaders = this.defaultHeaders;
let responseType_: 'text' | 'json' | 'blob' = 'json';
if (localVarHttpHeaderAcceptSelected) {
if (localVarHttpHeaderAcceptSelected.startsWith('text')) {
responseType_ = 'text';
} else if (
this.configuration.isJsonMime(localVarHttpHeaderAcceptSelected)
) {
responseType_ = 'json';
} else {
responseType_ = 'blob';
}
const localVarHttpHeaderAcceptSelected: string | undefined = options?.httpHeaderAccept ?? this.configuration.selectHeaderAccept([
'application/json'
]);
if (localVarHttpHeaderAcceptSelected !== undefined) {
localVarHeaders = localVarHeaders.set('Accept', localVarHttpHeaderAcceptSelected);
}
const localVarHttpContext: HttpContext = options?.context ?? new HttpContext();
const localVarTransferCache: boolean = options?.transferCache ?? true;
let responseType_: 'text' | 'json' | 'blob' = 'json';
if (localVarHttpHeaderAcceptSelected) {
if (localVarHttpHeaderAcceptSelected.startsWith('text')) {
responseType_ = 'text';
} else if (this.configuration.isJsonMime(localVarHttpHeaderAcceptSelected)) {
responseType_ = 'json';
} else {
responseType_ = 'blob';
}
}
let localVarPath = `/api/inse-service/institutions/${this.configuration.encodeParam({name: "id", value: id, in: "path", style: "simple", explode: false, dataType: "string", dataFormat: undefined})}`;
const { basePath, withCredentials } = this.configuration;
return this.httpClient.request<Institution>('get', `${basePath}${localVarPath}`,
{
context: localVarHttpContext,
responseType: <any>responseType_,
...(withCredentials ? { withCredentials } : {}),
headers: localVarHeaders,
observe: observe,
...(localVarTransferCache !== undefined ? { transferCache: localVarTransferCache } : {}),
reportProgress: reportProgress
}
);
}
let localVarPath = `/api/inse-service/institutions/autocomplete`;
const { basePath, withCredentials } = this.configuration;
return this.httpClient.request<AutocompleteResponse>(
'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 OpenAlex institutions.
* @endpoint get /api/inse-service/institutions
* @param search Full-text search, for example \&#39;Duisburg Essen\&#39;.
* @param filter OpenAlex filter, for example \&#39;country_code:DE,type:education\&#39;.
* @param sort Sort field, for example \&#39;works_count:desc\&#39;.
* @param groupBy OpenAlex group_by field, for example \&#39;country_code\&#39;.
* @param perPage Results per page.
* @param page Page number. Use cursor for deep pagination.
* @param cursor Cursor pagination token. Use \&#39;*\&#39; to start.
* @param sample Random sample size. Cannot be combined with sort or page.
* @param select Comma-separated fields to return.
* @param observe set whether or not to return the data Observable as the body, response or events. defaults to returning the body.
* @param reportProgress flag to report request and response progress.
*/
public listInstitutions(search?: string, filter?: string, sort?: string, groupBy?: string, perPage?: number, page?: number, cursor?: string, sample?: number, select?: string, observe?: 'body', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable<InstitutionsListResponse>;
public listInstitutions(search?: string, filter?: string, sort?: string, groupBy?: string, perPage?: number, page?: number, cursor?: string, sample?: number, select?: string, observe?: 'response', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable<HttpResponse<InstitutionsListResponse>>;
public listInstitutions(search?: string, filter?: string, sort?: string, groupBy?: string, perPage?: number, page?: number, cursor?: string, sample?: number, select?: string, observe?: 'events', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable<HttpEvent<InstitutionsListResponse>>;
public listInstitutions(search?: string, filter?: string, sort?: string, groupBy?: string, perPage?: number, page?: number, cursor?: string, sample?: number, select?: string, observe: any = 'body', reportProgress: boolean = false, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable<any> {
/**
* Returns a single institution by ID.
* Returns a single institution by its OpenAlex ID.
* @endpoint get /api/inse-service/institutions/{id}
* @param id
* @param observe set whether or not to return the data Observable as the body, response or events. defaults to returning the body.
* @param reportProgress flag to report request and response progress.
*/
public getInstitutionById(
id: string,
observe?: 'body',
reportProgress?: boolean,
options?: {
httpHeaderAccept?: 'application/json';
context?: HttpContext;
transferCache?: boolean;
},
): Observable<Institution>;
public getInstitutionById(
id: string,
observe?: 'response',
reportProgress?: boolean,
options?: {
httpHeaderAccept?: 'application/json';
context?: HttpContext;
transferCache?: boolean;
},
): Observable<HttpResponse<Institution>>;
public getInstitutionById(
id: string,
observe?: 'events',
reportProgress?: boolean,
options?: {
httpHeaderAccept?: 'application/json';
context?: HttpContext;
transferCache?: boolean;
},
): Observable<HttpEvent<Institution>>;
public getInstitutionById(
id: string,
observe: any = 'body',
reportProgress: boolean = false,
options?: {
httpHeaderAccept?: 'application/json';
context?: HttpContext;
transferCache?: boolean;
},
): Observable<any> {
if (id === null || id === undefined) {
throw new Error(
'Required parameter id was null or undefined when calling getInstitutionById.',
);
let localVarQueryParameters = new HttpParams({encoder: this.encoder});
localVarQueryParameters = this.addToHttpParams(localVarQueryParameters,
<any>search, 'search');
localVarQueryParameters = this.addToHttpParams(localVarQueryParameters,
<any>filter, 'filter');
localVarQueryParameters = this.addToHttpParams(localVarQueryParameters,
<any>sort, 'sort');
localVarQueryParameters = this.addToHttpParams(localVarQueryParameters,
<any>groupBy, 'group_by');
localVarQueryParameters = this.addToHttpParams(localVarQueryParameters,
<any>perPage, 'per_page');
localVarQueryParameters = this.addToHttpParams(localVarQueryParameters,
<any>page, 'page');
localVarQueryParameters = this.addToHttpParams(localVarQueryParameters,
<any>cursor, 'cursor');
localVarQueryParameters = this.addToHttpParams(localVarQueryParameters,
<any>sample, 'sample');
localVarQueryParameters = this.addToHttpParams(localVarQueryParameters,
<any>select, 'select');
let localVarHeaders = this.defaultHeaders;
const localVarHttpHeaderAcceptSelected: string | undefined = options?.httpHeaderAccept ?? this.configuration.selectHeaderAccept([
'application/json'
]);
if (localVarHttpHeaderAcceptSelected !== undefined) {
localVarHeaders = localVarHeaders.set('Accept', localVarHttpHeaderAcceptSelected);
}
const localVarHttpContext: HttpContext = options?.context ?? new HttpContext();
const localVarTransferCache: boolean = options?.transferCache ?? true;
let responseType_: 'text' | 'json' | 'blob' = 'json';
if (localVarHttpHeaderAcceptSelected) {
if (localVarHttpHeaderAcceptSelected.startsWith('text')) {
responseType_ = 'text';
} else if (this.configuration.isJsonMime(localVarHttpHeaderAcceptSelected)) {
responseType_ = 'json';
} else {
responseType_ = 'blob';
}
}
let localVarPath = `/api/inse-service/institutions`;
const { basePath, withCredentials } = this.configuration;
return this.httpClient.request<InstitutionsListResponse>('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;
/**
* Searches for institutions by name.
* Searches for institutions by name with pagination.
* @endpoint get /api/inse-service/institutions/search
* @param name Institution name to search for, for example \&#39;University of Duisburg Essen\&#39;.
* @param page Page number (0-indexed).
* @param size Number of institutions per page.
* @param sortBy Field to sort by, either \&#39;relevance\&#39;, \&#39;name\&#39;, \&#39;works_count\&#39;, or \&#39;citations_count\&#39;.
* @param sortingDirection Sorting direction, either \&#39;asc\&#39; or \&#39;desc\&#39;.
* @param observe set whether or not to return the data Observable as the body, response or events. defaults to returning the body.
* @param reportProgress flag to report request and response progress.
*/
public searchInstitutionsByName(name?: string, page?: number, size?: number, sortBy?: 'relevance' | 'name' | 'works_count' | 'citations_count', sortingDirection?: 'asc' | 'desc', observe?: 'body', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable<InstitutionPage>;
public searchInstitutionsByName(name?: string, page?: number, size?: number, sortBy?: 'relevance' | 'name' | 'works_count' | 'citations_count', sortingDirection?: 'asc' | 'desc', observe?: 'response', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable<HttpResponse<InstitutionPage>>;
public searchInstitutionsByName(name?: string, page?: number, size?: number, sortBy?: 'relevance' | 'name' | 'works_count' | 'citations_count', sortingDirection?: 'asc' | 'desc', observe?: 'events', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable<HttpEvent<InstitutionPage>>;
public searchInstitutionsByName(name?: string, page?: number, size?: number, sortBy?: 'relevance' | 'name' | 'works_count' | 'citations_count', sortingDirection?: 'asc' | 'desc', observe: any = 'body', reportProgress: boolean = false, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable<any> {
const localVarHttpHeaderAcceptSelected: string | undefined =
options?.httpHeaderAccept ??
this.configuration.selectHeaderAccept(['application/json']);
if (localVarHttpHeaderAcceptSelected !== undefined) {
localVarHeaders = localVarHeaders.set(
'Accept',
localVarHttpHeaderAcceptSelected,
);
let localVarQueryParameters = new HttpParams({encoder: this.encoder});
localVarQueryParameters = this.addToHttpParams(localVarQueryParameters,
<any>name, 'name');
localVarQueryParameters = this.addToHttpParams(localVarQueryParameters,
<any>page, 'page');
localVarQueryParameters = this.addToHttpParams(localVarQueryParameters,
<any>size, 'size');
localVarQueryParameters = this.addToHttpParams(localVarQueryParameters,
<any>sortBy, 'sort_by');
localVarQueryParameters = this.addToHttpParams(localVarQueryParameters,
<any>sortingDirection, 'sorting_direction');
let localVarHeaders = this.defaultHeaders;
const localVarHttpHeaderAcceptSelected: string | undefined = options?.httpHeaderAccept ?? this.configuration.selectHeaderAccept([
'application/json'
]);
if (localVarHttpHeaderAcceptSelected !== undefined) {
localVarHeaders = localVarHeaders.set('Accept', localVarHttpHeaderAcceptSelected);
}
const localVarHttpContext: HttpContext = options?.context ?? new HttpContext();
const localVarTransferCache: boolean = options?.transferCache ?? true;
let responseType_: 'text' | 'json' | 'blob' = 'json';
if (localVarHttpHeaderAcceptSelected) {
if (localVarHttpHeaderAcceptSelected.startsWith('text')) {
responseType_ = 'text';
} else if (this.configuration.isJsonMime(localVarHttpHeaderAcceptSelected)) {
responseType_ = 'json';
} else {
responseType_ = 'blob';
}
}
let localVarPath = `/api/inse-service/institutions/search`;
const { basePath, withCredentials } = this.configuration;
return this.httpClient.request<InstitutionPage>('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/inse-service/institutions/${this.configuration.encodeParam({ name: 'id', value: id, in: 'path', style: 'simple', explode: false, dataType: 'string', dataFormat: undefined })}`;
const { basePath, withCredentials } = this.configuration;
return this.httpClient.request<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 OpenAlex institutions.
* @endpoint get /api/inse-service/institutions
* @param search Full-text search, for example \&#39;Duisburg Essen\&#39;.
* @param filter OpenAlex filter, for example \&#39;country_code:DE,type:education\&#39;.
* @param sort Sort field, for example \&#39;works_count:desc\&#39;.
* @param groupBy OpenAlex group_by field, for example \&#39;country_code\&#39;.
* @param perPage Results per page.
* @param page Page number. Use cursor for deep pagination.
* @param cursor Cursor pagination token. Use \&#39;*\&#39; to start.
* @param sample Random sample size. Cannot be combined with sort or page.
* @param select Comma-separated fields to return.
* @param observe set whether or not to return the data Observable as the body, response or events. defaults to returning the body.
* @param reportProgress flag to report request and response progress.
*/
public listInstitutions(
search?: string,
filter?: string,
sort?: string,
groupBy?: string,
perPage?: number,
page?: number,
cursor?: string,
sample?: number,
select?: string,
observe?: 'body',
reportProgress?: boolean,
options?: {
httpHeaderAccept?: 'application/json';
context?: HttpContext;
transferCache?: boolean;
},
): Observable<InstitutionsListResponse>;
public listInstitutions(
search?: string,
filter?: string,
sort?: string,
groupBy?: string,
perPage?: number,
page?: number,
cursor?: string,
sample?: number,
select?: string,
observe?: 'response',
reportProgress?: boolean,
options?: {
httpHeaderAccept?: 'application/json';
context?: HttpContext;
transferCache?: boolean;
},
): Observable<HttpResponse<InstitutionsListResponse>>;
public listInstitutions(
search?: string,
filter?: string,
sort?: string,
groupBy?: string,
perPage?: number,
page?: number,
cursor?: string,
sample?: number,
select?: string,
observe?: 'events',
reportProgress?: boolean,
options?: {
httpHeaderAccept?: 'application/json';
context?: HttpContext;
transferCache?: boolean;
},
): Observable<HttpEvent<InstitutionsListResponse>>;
public listInstitutions(
search?: string,
filter?: string,
sort?: string,
groupBy?: string,
perPage?: number,
page?: number,
cursor?: string,
sample?: number,
select?: string,
observe: any = 'body',
reportProgress: boolean = false,
options?: {
httpHeaderAccept?: 'application/json';
context?: HttpContext;
transferCache?: boolean;
},
): Observable<any> {
let localVarQueryParameters = new HttpParams({ encoder: this.encoder });
localVarQueryParameters = this.addToHttpParams(
localVarQueryParameters,
<any>search,
'search',
);
localVarQueryParameters = this.addToHttpParams(
localVarQueryParameters,
<any>filter,
'filter',
);
localVarQueryParameters = this.addToHttpParams(
localVarQueryParameters,
<any>sort,
'sort',
);
localVarQueryParameters = this.addToHttpParams(
localVarQueryParameters,
<any>groupBy,
'group_by',
);
localVarQueryParameters = this.addToHttpParams(
localVarQueryParameters,
<any>perPage,
'per_page',
);
localVarQueryParameters = this.addToHttpParams(
localVarQueryParameters,
<any>page,
'page',
);
localVarQueryParameters = this.addToHttpParams(
localVarQueryParameters,
<any>cursor,
'cursor',
);
localVarQueryParameters = this.addToHttpParams(
localVarQueryParameters,
<any>sample,
'sample',
);
localVarQueryParameters = this.addToHttpParams(
localVarQueryParameters,
<any>select,
'select',
);
let localVarHeaders = this.defaultHeaders;
const localVarHttpHeaderAcceptSelected: string | undefined =
options?.httpHeaderAccept ??
this.configuration.selectHeaderAccept(['application/json']);
if (localVarHttpHeaderAcceptSelected !== undefined) {
localVarHeaders = localVarHeaders.set(
'Accept',
localVarHttpHeaderAcceptSelected,
);
}
const localVarHttpContext: HttpContext =
options?.context ?? new HttpContext();
const localVarTransferCache: boolean = options?.transferCache ?? true;
let responseType_: 'text' | 'json' | 'blob' = 'json';
if (localVarHttpHeaderAcceptSelected) {
if (localVarHttpHeaderAcceptSelected.startsWith('text')) {
responseType_ = 'text';
} else if (
this.configuration.isJsonMime(localVarHttpHeaderAcceptSelected)
) {
responseType_ = 'json';
} else {
responseType_ = 'blob';
}
}
let localVarPath = `/api/inse-service/institutions`;
const { basePath, withCredentials } = this.configuration;
return this.httpClient.request<InstitutionsListResponse>(
'get',
`${basePath}${localVarPath}`,
{
context: localVarHttpContext,
params: localVarQueryParameters,
responseType: <any>responseType_,
...(withCredentials ? { withCredentials } : {}),
headers: localVarHeaders,
observe: observe,
...(localVarTransferCache !== undefined
? { transferCache: localVarTransferCache }
: {}),
reportProgress: reportProgress,
},
);
}
/**
* Searches for institutions by name.
* Searches for institutions by name with pagination.
* @endpoint get /api/inse-service/institutions/search
* @param name Institution name to search for, for example \&#39;University of Duisburg Essen\&#39;.
* @param page Page number (0-indexed).
* @param size Number of institutions per page.
* @param sortBy Field to sort by, either \&#39;relevance\&#39;, \&#39;name\&#39;, \&#39;works_count\&#39;, or \&#39;citations_count\&#39;.
* @param sortingDirection Sorting direction, either \&#39;asc\&#39; or \&#39;desc\&#39;.
* @param observe set whether or not to return the data Observable as the body, response or events. defaults to returning the body.
* @param reportProgress flag to report request and response progress.
*/
public searchInstitutionsByName(
name?: string,
page?: number,
size?: number,
sortBy?: 'relevance' | 'name' | 'works_count' | 'citations_count',
sortingDirection?: 'asc' | 'desc',
observe?: 'body',
reportProgress?: boolean,
options?: {
httpHeaderAccept?: 'application/json';
context?: HttpContext;
transferCache?: boolean;
},
): Observable<InstitutionPage>;
public searchInstitutionsByName(
name?: string,
page?: number,
size?: number,
sortBy?: 'relevance' | 'name' | 'works_count' | 'citations_count',
sortingDirection?: 'asc' | 'desc',
observe?: 'response',
reportProgress?: boolean,
options?: {
httpHeaderAccept?: 'application/json';
context?: HttpContext;
transferCache?: boolean;
},
): Observable<HttpResponse<InstitutionPage>>;
public searchInstitutionsByName(
name?: string,
page?: number,
size?: number,
sortBy?: 'relevance' | 'name' | 'works_count' | 'citations_count',
sortingDirection?: 'asc' | 'desc',
observe?: 'events',
reportProgress?: boolean,
options?: {
httpHeaderAccept?: 'application/json';
context?: HttpContext;
transferCache?: boolean;
},
): Observable<HttpEvent<InstitutionPage>>;
public searchInstitutionsByName(
name?: string,
page?: number,
size?: number,
sortBy?: 'relevance' | 'name' | 'works_count' | 'citations_count',
sortingDirection?: 'asc' | 'desc',
observe: any = 'body',
reportProgress: boolean = false,
options?: {
httpHeaderAccept?: 'application/json';
context?: HttpContext;
transferCache?: boolean;
},
): Observable<any> {
let localVarQueryParameters = new HttpParams({ encoder: this.encoder });
localVarQueryParameters = this.addToHttpParams(
localVarQueryParameters,
<any>name,
'name',
);
localVarQueryParameters = this.addToHttpParams(
localVarQueryParameters,
<any>page,
'page',
);
localVarQueryParameters = this.addToHttpParams(
localVarQueryParameters,
<any>size,
'size',
);
localVarQueryParameters = this.addToHttpParams(
localVarQueryParameters,
<any>sortBy,
'sort_by',
);
localVarQueryParameters = this.addToHttpParams(
localVarQueryParameters,
<any>sortingDirection,
'sorting_direction',
);
let localVarHeaders = this.defaultHeaders;
const localVarHttpHeaderAcceptSelected: string | undefined =
options?.httpHeaderAccept ??
this.configuration.selectHeaderAccept(['application/json']);
if (localVarHttpHeaderAcceptSelected !== undefined) {
localVarHeaders = localVarHeaders.set(
'Accept',
localVarHttpHeaderAcceptSelected,
);
}
const localVarHttpContext: HttpContext =
options?.context ?? new HttpContext();
const localVarTransferCache: boolean = options?.transferCache ?? true;
let responseType_: 'text' | 'json' | 'blob' = 'json';
if (localVarHttpHeaderAcceptSelected) {
if (localVarHttpHeaderAcceptSelected.startsWith('text')) {
responseType_ = 'text';
} else if (
this.configuration.isJsonMime(localVarHttpHeaderAcceptSelected)
) {
responseType_ = 'json';
} else {
responseType_ = 'blob';
}
}
let localVarPath = `/api/inse-service/institutions/search`;
const { basePath, withCredentials } = this.configuration;
return this.httpClient.request<InstitutionPage>(
'get',
`${basePath}${localVarPath}`,
{
context: localVarHttpContext,
params: localVarQueryParameters,
responseType: <any>responseType_,
...(withCredentials ? { withCredentials } : {}),
headers: localVarHeaders,
observe: observe,
...(localVarTransferCache !== undefined
? { transferCache: localVarTransferCache }
: {}),
reportProgress: reportProgress,
},
);
}
}
+76 -131
View File
@@ -1,7 +1,7 @@
/**
* Innovation Search Engine API
*
*
*
*
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
* https://openapi-generator.tech
@@ -9,18 +9,12 @@
*/
/* tslint:disable:no-unused-variable member-ordering */
import { Inject, Injectable, Optional } from '@angular/core';
import {
HttpClient,
HttpHeaders,
HttpParams,
HttpResponse,
HttpEvent,
HttpParameterCodec,
HttpContext,
} from '@angular/common/http';
import { CustomHttpParameterCodec } from '../encoder';
import { Observable } from 'rxjs';
import { Inject, Injectable, Optional } from '@angular/core';
import { HttpClient, HttpHeaders, HttpParams,
HttpResponse, HttpEvent, HttpParameterCodec, HttpContext
} from '@angular/common/http';
import { CustomHttpParameterCodec } from '../encoder';
import { Observable } from 'rxjs';
// @ts-ignore
import { ExtractedKeywordsResponse } from '../model/extractedKeywordsResponse';
@@ -30,133 +24,84 @@ import { HTTPValidationError } from '../model/hTTPValidationError';
import { KeywordsRequest } from '../model/keywordsRequest';
// @ts-ignore
import { BASE_PATH, COLLECTION_FORMATS } from '../variables';
import { Configuration } from '../configuration';
import { BASE_PATH, COLLECTION_FORMATS } from '../variables';
import { Configuration } from '../configuration';
import { BaseService } from '../api.base.service';
@Injectable({
providedIn: 'root',
providedIn: 'root'
})
export class KeywordsService extends BaseService {
constructor(
protected httpClient: HttpClient,
@Optional() @Inject(BASE_PATH) basePath: string | string[],
@Optional() configuration?: Configuration,
) {
super(basePath, configuration);
}
/**
* Extracts keywords from text.
* @endpoint post /api/inse-service/keywords/extract
* @param keywordsRequest
* @param observe set whether or not to return the data Observable as the body, response or events. defaults to returning the body.
* @param reportProgress flag to report request and response progress.
*/
public extractKeywords(
keywordsRequest: KeywordsRequest,
observe?: 'body',
reportProgress?: boolean,
options?: {
httpHeaderAccept?: 'application/json';
context?: HttpContext;
transferCache?: boolean;
},
): Observable<ExtractedKeywordsResponse>;
public extractKeywords(
keywordsRequest: KeywordsRequest,
observe?: 'response',
reportProgress?: boolean,
options?: {
httpHeaderAccept?: 'application/json';
context?: HttpContext;
transferCache?: boolean;
},
): Observable<HttpResponse<ExtractedKeywordsResponse>>;
public extractKeywords(
keywordsRequest: KeywordsRequest,
observe?: 'events',
reportProgress?: boolean,
options?: {
httpHeaderAccept?: 'application/json';
context?: HttpContext;
transferCache?: boolean;
},
): Observable<HttpEvent<ExtractedKeywordsResponse>>;
public extractKeywords(
keywordsRequest: KeywordsRequest,
observe: any = 'body',
reportProgress: boolean = false,
options?: {
httpHeaderAccept?: 'application/json';
context?: HttpContext;
transferCache?: boolean;
},
): Observable<any> {
if (keywordsRequest === null || keywordsRequest === undefined) {
throw new Error(
'Required parameter keywordsRequest was null or undefined when calling extractKeywords.',
);
constructor(protected httpClient: HttpClient, @Optional() @Inject(BASE_PATH) basePath: string|string[], @Optional() configuration?: Configuration) {
super(basePath, configuration);
}
let localVarHeaders = this.defaultHeaders;
/**
* Extracts keywords from text.
* @endpoint post /api/inse-service/keywords/extract
* @param keywordsRequest
* @param observe set whether or not to return the data Observable as the body, response or events. defaults to returning the body.
* @param reportProgress flag to report request and response progress.
*/
public extractKeywords(keywordsRequest: KeywordsRequest, observe?: 'body', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable<ExtractedKeywordsResponse>;
public extractKeywords(keywordsRequest: KeywordsRequest, observe?: 'response', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable<HttpResponse<ExtractedKeywordsResponse>>;
public extractKeywords(keywordsRequest: KeywordsRequest, observe?: 'events', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable<HttpEvent<ExtractedKeywordsResponse>>;
public extractKeywords(keywordsRequest: KeywordsRequest, observe: any = 'body', reportProgress: boolean = false, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable<any> {
if (keywordsRequest === null || keywordsRequest === undefined) {
throw new Error('Required parameter keywordsRequest was null or undefined when calling extractKeywords.');
}
const localVarHttpHeaderAcceptSelected: string | undefined =
options?.httpHeaderAccept ??
this.configuration.selectHeaderAccept(['application/json']);
if (localVarHttpHeaderAcceptSelected !== undefined) {
localVarHeaders = localVarHeaders.set(
'Accept',
localVarHttpHeaderAcceptSelected,
);
let localVarHeaders = this.defaultHeaders;
const localVarHttpHeaderAcceptSelected: string | undefined = options?.httpHeaderAccept ?? this.configuration.selectHeaderAccept([
'application/json'
]);
if (localVarHttpHeaderAcceptSelected !== undefined) {
localVarHeaders = localVarHeaders.set('Accept', localVarHttpHeaderAcceptSelected);
}
const localVarHttpContext: HttpContext = options?.context ?? new HttpContext();
const localVarTransferCache: boolean = options?.transferCache ?? true;
// to determine the Content-Type header
const consumes: string[] = [
'application/json'
];
const httpContentTypeSelected: string | undefined = this.configuration.selectHeaderContentType(consumes);
if (httpContentTypeSelected !== undefined) {
localVarHeaders = localVarHeaders.set('Content-Type', httpContentTypeSelected);
}
let responseType_: 'text' | 'json' | 'blob' = 'json';
if (localVarHttpHeaderAcceptSelected) {
if (localVarHttpHeaderAcceptSelected.startsWith('text')) {
responseType_ = 'text';
} else if (this.configuration.isJsonMime(localVarHttpHeaderAcceptSelected)) {
responseType_ = 'json';
} else {
responseType_ = 'blob';
}
}
let localVarPath = `/api/inse-service/keywords/extract`;
const { basePath, withCredentials } = this.configuration;
return this.httpClient.request<ExtractedKeywordsResponse>('post', `${basePath}${localVarPath}`,
{
context: localVarHttpContext,
body: keywordsRequest,
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;
// to determine the Content-Type header
const consumes: string[] = ['application/json'];
const httpContentTypeSelected: string | undefined =
this.configuration.selectHeaderContentType(consumes);
if (httpContentTypeSelected !== undefined) {
localVarHeaders = localVarHeaders.set(
'Content-Type',
httpContentTypeSelected,
);
}
let responseType_: 'text' | 'json' | 'blob' = 'json';
if (localVarHttpHeaderAcceptSelected) {
if (localVarHttpHeaderAcceptSelected.startsWith('text')) {
responseType_ = 'text';
} else if (
this.configuration.isJsonMime(localVarHttpHeaderAcceptSelected)
) {
responseType_ = 'json';
} else {
responseType_ = 'blob';
}
}
let localVarPath = `/api/inse-service/keywords/extract`;
const { basePath, withCredentials } = this.configuration;
return this.httpClient.request<ExtractedKeywordsResponse>(
'post',
`${basePath}${localVarPath}`,
{
context: localVarHttpContext,
body: keywordsRequest,
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
+269 -533
View File
@@ -1,7 +1,7 @@
/**
* Innovation Search Engine API
*
*
*
*
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
* https://openapi-generator.tech
@@ -9,18 +9,12 @@
*/
/* tslint:disable:no-unused-variable member-ordering */
import { Inject, Injectable, Optional } from '@angular/core';
import {
HttpClient,
HttpHeaders,
HttpParams,
HttpResponse,
HttpEvent,
HttpParameterCodec,
HttpContext,
} from '@angular/common/http';
import { CustomHttpParameterCodec } from '../encoder';
import { Observable } from 'rxjs';
import { Inject, Injectable, Optional } from '@angular/core';
import { HttpClient, HttpHeaders, HttpParams,
HttpResponse, HttpEvent, HttpParameterCodec, HttpContext
} from '@angular/common/http';
import { CustomHttpParameterCodec } from '../encoder';
import { Observable } from 'rxjs';
// @ts-ignore
import { CreateOrganizationRequest } from '../model/createOrganizationRequest';
@@ -34,545 +28,287 @@ import { OrganizationPage } from '../model/organizationPage';
import { UpdateOrganizationRequest } from '../model/updateOrganizationRequest';
// @ts-ignore
import { BASE_PATH, COLLECTION_FORMATS } from '../variables';
import { Configuration } from '../configuration';
import { BASE_PATH, COLLECTION_FORMATS } from '../variables';
import { Configuration } from '../configuration';
import { BaseService } from '../api.base.service';
@Injectable({
providedIn: 'root',
providedIn: 'root'
})
export class OrganizationService extends BaseService {
constructor(
protected httpClient: HttpClient,
@Optional() @Inject(BASE_PATH) basePath: string | string[],
@Optional() configuration?: Configuration,
) {
super(basePath, configuration);
}
/**
* Create Organization
* @endpoint post /api/organizations
* @param createOrganizationRequest
* @param secureFgpAcc
* @param observe set whether or not to return the data Observable as the body, response or events. defaults to returning the body.
* @param reportProgress flag to report request and response progress.
*/
public createOrganisation(
createOrganizationRequest: CreateOrganizationRequest,
secureFgpAcc?: string,
observe?: 'body',
reportProgress?: boolean,
options?: {
httpHeaderAccept?: 'application/json';
context?: HttpContext;
transferCache?: boolean;
},
): Observable<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.',
);
constructor(protected httpClient: HttpClient, @Optional() @Inject(BASE_PATH) basePath: string|string[], @Optional() configuration?: Configuration) {
super(basePath, configuration);
}
let localVarHeaders = this.defaultHeaders;
/**
* Create Organization
* @endpoint post /api/organizations
* @param createOrganizationRequest
* @param secureFgpAcc
* @param observe set whether or not to return the data Observable as the body, response or events. defaults to returning the body.
* @param reportProgress flag to report request and response progress.
*/
public createOrganisation(createOrganizationRequest: CreateOrganizationRequest, secureFgpAcc?: string, observe?: 'body', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable<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.');
}
// authentication (HTTPBearer) required
localVarHeaders = this.configuration.addCredentialToHeaders(
'HTTPBearer',
'Authorization',
localVarHeaders,
'Bearer ',
);
let localVarHeaders = this.defaultHeaders;
const localVarHttpHeaderAcceptSelected: string | undefined =
options?.httpHeaderAccept ??
this.configuration.selectHeaderAccept(['application/json']);
if (localVarHttpHeaderAcceptSelected !== undefined) {
localVarHeaders = localVarHeaders.set(
'Accept',
localVarHttpHeaderAcceptSelected,
);
// authentication (HTTPBearer) required
localVarHeaders = this.configuration.addCredentialToHeaders('HTTPBearer', 'Authorization', localVarHeaders, 'Bearer ');
const localVarHttpHeaderAcceptSelected: string | undefined = options?.httpHeaderAccept ?? this.configuration.selectHeaderAccept([
'application/json'
]);
if (localVarHttpHeaderAcceptSelected !== undefined) {
localVarHeaders = localVarHeaders.set('Accept', localVarHttpHeaderAcceptSelected);
}
const localVarHttpContext: HttpContext = options?.context ?? new HttpContext();
const localVarTransferCache: boolean = options?.transferCache ?? true;
// to determine the Content-Type header
const consumes: string[] = [
'application/json'
];
const httpContentTypeSelected: string | undefined = this.configuration.selectHeaderContentType(consumes);
if (httpContentTypeSelected !== undefined) {
localVarHeaders = localVarHeaders.set('Content-Type', httpContentTypeSelected);
}
let responseType_: 'text' | 'json' | 'blob' = 'json';
if (localVarHttpHeaderAcceptSelected) {
if (localVarHttpHeaderAcceptSelected.startsWith('text')) {
responseType_ = 'text';
} else if (this.configuration.isJsonMime(localVarHttpHeaderAcceptSelected)) {
responseType_ = 'json';
} else {
responseType_ = 'blob';
}
}
let localVarPath = `/api/organizations`;
const { basePath, withCredentials } = this.configuration;
return this.httpClient.request<InseOrganizationManagementModelOrganizationProfile>('post', `${basePath}${localVarPath}`,
{
context: localVarHttpContext,
body: createOrganizationRequest,
responseType: <any>responseType_,
...(withCredentials ? { withCredentials } : {}),
headers: localVarHeaders,
observe: observe,
...(localVarTransferCache !== undefined ? { transferCache: localVarTransferCache } : {}),
reportProgress: reportProgress
}
);
}
const localVarHttpContext: HttpContext =
options?.context ?? new HttpContext();
/**
* Delete Organization
* @endpoint delete /api/organizations/{organization_id}
* @param organizationId
* @param secureFgpAcc
* @param observe set whether or not to return the data Observable as the body, response or events. defaults to returning the body.
* @param reportProgress flag to report request and response progress.
*/
public deleteOrganisation(organizationId: string, secureFgpAcc?: string, observe?: 'body', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable<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.');
}
const localVarTransferCache: boolean = options?.transferCache ?? true;
let localVarHeaders = this.defaultHeaders;
// to determine the Content-Type header
const consumes: string[] = ['application/json'];
const httpContentTypeSelected: string | undefined =
this.configuration.selectHeaderContentType(consumes);
if (httpContentTypeSelected !== undefined) {
localVarHeaders = localVarHeaders.set(
'Content-Type',
httpContentTypeSelected,
);
// authentication (HTTPBearer) required
localVarHeaders = this.configuration.addCredentialToHeaders('HTTPBearer', 'Authorization', localVarHeaders, 'Bearer ');
const localVarHttpHeaderAcceptSelected: string | undefined = options?.httpHeaderAccept ?? this.configuration.selectHeaderAccept([
'application/json'
]);
if (localVarHttpHeaderAcceptSelected !== undefined) {
localVarHeaders = localVarHeaders.set('Accept', localVarHttpHeaderAcceptSelected);
}
const localVarHttpContext: HttpContext = options?.context ?? new HttpContext();
const localVarTransferCache: boolean = options?.transferCache ?? true;
let responseType_: 'text' | 'json' | 'blob' = 'json';
if (localVarHttpHeaderAcceptSelected) {
if (localVarHttpHeaderAcceptSelected.startsWith('text')) {
responseType_ = 'text';
} else if (this.configuration.isJsonMime(localVarHttpHeaderAcceptSelected)) {
responseType_ = 'json';
} else {
responseType_ = 'blob';
}
}
let localVarPath = `/api/organizations/${this.configuration.encodeParam({name: "organizationId", value: organizationId, in: "path", style: "simple", explode: false, dataType: "string", dataFormat: "uuid"})}`;
const { basePath, withCredentials } = this.configuration;
return this.httpClient.request<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';
}
/**
* 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
}
);
}
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,
},
);
}
/**
* 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.');
}
/**
* 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;
// 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
}
);
}
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,
},
);
}
/**
* 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,
},
);
}
}
+315 -640
View File
@@ -1,7 +1,7 @@
/**
* Innovation Search Engine API
*
*
*
*
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
* https://openapi-generator.tech
@@ -9,18 +9,12 @@
*/
/* tslint:disable:no-unused-variable member-ordering */
import { Inject, Injectable, Optional } from '@angular/core';
import {
HttpClient,
HttpHeaders,
HttpParams,
HttpResponse,
HttpEvent,
HttpParameterCodec,
HttpContext,
} from '@angular/common/http';
import { CustomHttpParameterCodec } from '../encoder';
import { Observable } from 'rxjs';
import { Inject, Injectable, Optional } from '@angular/core';
import { HttpClient, HttpHeaders, HttpParams,
HttpResponse, HttpEvent, HttpParameterCodec, HttpContext
} from '@angular/common/http';
import { CustomHttpParameterCodec } from '../encoder';
import { Observable } from 'rxjs';
// @ts-ignore
import { AllPatentsResponse } from '../model/allPatentsResponse';
@@ -36,657 +30,338 @@ import { PatentsByAuthorResponse } from '../model/patentsByAuthorResponse';
import { PatentsByInstitutionResponse } from '../model/patentsByInstitutionResponse';
// @ts-ignore
import { BASE_PATH, COLLECTION_FORMATS } from '../variables';
import { Configuration } from '../configuration';
import { BASE_PATH, COLLECTION_FORMATS } from '../variables';
import { Configuration } from '../configuration';
import { BaseService } from '../api.base.service';
@Injectable({
providedIn: 'root',
providedIn: 'root'
})
export class PatentsService extends BaseService {
constructor(
protected httpClient: HttpClient,
@Optional() @Inject(BASE_PATH) basePath: string | string[],
@Optional() configuration?: Configuration,
) {
super(basePath, configuration);
}
/**
* Get all patents with pagination and search.
* @endpoint get /api/inse-service/patents
* @param page
* @param size
* @param search
* @param source
* @param sortBy
* @param sortDirection
* @param observe set whether or not to return the data Observable as the body, response or events. defaults to returning the body.
* @param reportProgress flag to report request and response progress.
*/
public getAllPatents(
page?: number,
size?: number,
search?: string,
source?: string,
sortBy?: string,
sortDirection?: string,
observe?: 'body',
reportProgress?: boolean,
options?: {
httpHeaderAccept?: 'application/json';
context?: HttpContext;
transferCache?: boolean;
},
): Observable<AllPatentsResponse>;
public getAllPatents(
page?: number,
size?: number,
search?: string,
source?: string,
sortBy?: string,
sortDirection?: string,
observe?: 'response',
reportProgress?: boolean,
options?: {
httpHeaderAccept?: 'application/json';
context?: HttpContext;
transferCache?: boolean;
},
): Observable<HttpResponse<AllPatentsResponse>>;
public getAllPatents(
page?: number,
size?: number,
search?: string,
source?: string,
sortBy?: string,
sortDirection?: string,
observe?: 'events',
reportProgress?: boolean,
options?: {
httpHeaderAccept?: 'application/json';
context?: HttpContext;
transferCache?: boolean;
},
): Observable<HttpEvent<AllPatentsResponse>>;
public getAllPatents(
page?: number,
size?: number,
search?: string,
source?: string,
sortBy?: string,
sortDirection?: 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>size,
'size',
);
localVarQueryParameters = this.addToHttpParams(
localVarQueryParameters,
<any>search,
'search',
);
localVarQueryParameters = this.addToHttpParams(
localVarQueryParameters,
<any>source,
'source',
);
localVarQueryParameters = this.addToHttpParams(
localVarQueryParameters,
<any>sortBy,
'sort_by',
);
localVarQueryParameters = this.addToHttpParams(
localVarQueryParameters,
<any>sortDirection,
'sort_direction',
);
let localVarHeaders = this.defaultHeaders;
const localVarHttpHeaderAcceptSelected: string | undefined =
options?.httpHeaderAccept ??
this.configuration.selectHeaderAccept(['application/json']);
if (localVarHttpHeaderAcceptSelected !== undefined) {
localVarHeaders = localVarHeaders.set(
'Accept',
localVarHttpHeaderAcceptSelected,
);
constructor(protected httpClient: HttpClient, @Optional() @Inject(BASE_PATH) basePath: string|string[], @Optional() configuration?: Configuration) {
super(basePath, configuration);
}
const localVarHttpContext: HttpContext =
options?.context ?? new HttpContext();
/**
* Get all patents with pagination and search.
* @endpoint get /api/inse-service/patents
* @param page
* @param size
* @param search
* @param source
* @param sortBy
* @param sortDirection
* @param observe set whether or not to return the data Observable as the body, response or events. defaults to returning the body.
* @param reportProgress flag to report request and response progress.
*/
public getAllPatents(page?: number, size?: number, search?: string, source?: string, sortBy?: string, sortDirection?: string, observe?: 'body', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable<AllPatentsResponse>;
public getAllPatents(page?: number, size?: number, search?: string, source?: string, sortBy?: string, sortDirection?: string, observe?: 'response', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable<HttpResponse<AllPatentsResponse>>;
public getAllPatents(page?: number, size?: number, search?: string, source?: string, sortBy?: string, sortDirection?: string, observe?: 'events', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable<HttpEvent<AllPatentsResponse>>;
public getAllPatents(page?: number, size?: number, search?: string, source?: string, sortBy?: string, sortDirection?: string, observe: any = 'body', reportProgress: boolean = false, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable<any> {
const localVarTransferCache: boolean = options?.transferCache ?? true;
let localVarQueryParameters = new HttpParams({encoder: this.encoder});
localVarQueryParameters = this.addToHttpParams(localVarQueryParameters,
<any>page, 'page');
localVarQueryParameters = this.addToHttpParams(localVarQueryParameters,
<any>size, 'size');
localVarQueryParameters = this.addToHttpParams(localVarQueryParameters,
<any>search, 'search');
localVarQueryParameters = this.addToHttpParams(localVarQueryParameters,
<any>source, 'source');
localVarQueryParameters = this.addToHttpParams(localVarQueryParameters,
<any>sortBy, 'sort_by');
localVarQueryParameters = this.addToHttpParams(localVarQueryParameters,
<any>sortDirection, 'sort_direction');
let responseType_: 'text' | 'json' | 'blob' = 'json';
if (localVarHttpHeaderAcceptSelected) {
if (localVarHttpHeaderAcceptSelected.startsWith('text')) {
responseType_ = 'text';
} else if (
this.configuration.isJsonMime(localVarHttpHeaderAcceptSelected)
) {
responseType_ = 'json';
} else {
responseType_ = 'blob';
}
let localVarHeaders = this.defaultHeaders;
const localVarHttpHeaderAcceptSelected: string | undefined = options?.httpHeaderAccept ?? this.configuration.selectHeaderAccept([
'application/json'
]);
if (localVarHttpHeaderAcceptSelected !== undefined) {
localVarHeaders = localVarHeaders.set('Accept', localVarHttpHeaderAcceptSelected);
}
const localVarHttpContext: HttpContext = options?.context ?? new HttpContext();
const localVarTransferCache: boolean = options?.transferCache ?? true;
let responseType_: 'text' | 'json' | 'blob' = 'json';
if (localVarHttpHeaderAcceptSelected) {
if (localVarHttpHeaderAcceptSelected.startsWith('text')) {
responseType_ = 'text';
} else if (this.configuration.isJsonMime(localVarHttpHeaderAcceptSelected)) {
responseType_ = 'json';
} else {
responseType_ = 'blob';
}
}
let localVarPath = `/api/inse-service/patents`;
const { basePath, withCredentials } = this.configuration;
return this.httpClient.request<AllPatentsResponse>('get', `${basePath}${localVarPath}`,
{
context: localVarHttpContext,
params: localVarQueryParameters,
responseType: <any>responseType_,
...(withCredentials ? { withCredentials } : {}),
headers: localVarHeaders,
observe: observe,
...(localVarTransferCache !== undefined ? { transferCache: localVarTransferCache } : {}),
reportProgress: reportProgress
}
);
}
let localVarPath = `/api/inse-service/patents`;
const { basePath, withCredentials } = this.configuration;
return this.httpClient.request<AllPatentsResponse>(
'get',
`${basePath}${localVarPath}`,
{
context: localVarHttpContext,
params: localVarQueryParameters,
responseType: <any>responseType_,
...(withCredentials ? { withCredentials } : {}),
headers: localVarHeaders,
observe: observe,
...(localVarTransferCache !== undefined
? { transferCache: localVarTransferCache }
: {}),
reportProgress: reportProgress,
},
);
}
/**
* Get pre-indexed org patents for an institution.
* @endpoint get /api/inse-service/institutions/{id}/org-patents
* @param id
* @param matchType Filter patents by match type.
* @param page
* @param size
* @param source
* @param observe set whether or not to return the data Observable as the body, response or events. defaults to returning the body.
* @param reportProgress flag to report request and response progress.
*/
public getOrgPatentsByInstitution(id: string, matchType?: 'institution' | 'name' | 'both' | 'all', page?: number, size?: number, source?: string, observe?: 'body', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable<OrgPatentsResponse>;
public getOrgPatentsByInstitution(id: string, matchType?: 'institution' | 'name' | 'both' | 'all', page?: number, size?: number, source?: string, observe?: 'response', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable<HttpResponse<OrgPatentsResponse>>;
public getOrgPatentsByInstitution(id: string, matchType?: 'institution' | 'name' | 'both' | 'all', page?: number, size?: number, source?: string, observe?: 'events', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable<HttpEvent<OrgPatentsResponse>>;
public getOrgPatentsByInstitution(id: string, matchType?: 'institution' | 'name' | 'both' | 'all', page?: number, size?: number, source?: string, observe: any = 'body', reportProgress: boolean = false, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable<any> {
if (id === null || id === undefined) {
throw new Error('Required parameter id was null or undefined when calling getOrgPatentsByInstitution.');
}
/**
* Get pre-indexed org patents for an institution.
* @endpoint get /api/inse-service/institutions/{id}/org-patents
* @param id
* @param matchType Filter patents by match type.
* @param page
* @param size
* @param source
* @param observe set whether or not to return the data Observable as the body, response or events. defaults to returning the body.
* @param reportProgress flag to report request and response progress.
*/
public getOrgPatentsByInstitution(
id: string,
matchType?: 'institution' | 'name' | 'both' | 'all',
page?: number,
size?: number,
source?: string,
observe?: 'body',
reportProgress?: boolean,
options?: {
httpHeaderAccept?: 'application/json';
context?: HttpContext;
transferCache?: boolean;
},
): Observable<OrgPatentsResponse>;
public getOrgPatentsByInstitution(
id: string,
matchType?: 'institution' | 'name' | 'both' | 'all',
page?: number,
size?: number,
source?: string,
observe?: 'response',
reportProgress?: boolean,
options?: {
httpHeaderAccept?: 'application/json';
context?: HttpContext;
transferCache?: boolean;
},
): Observable<HttpResponse<OrgPatentsResponse>>;
public getOrgPatentsByInstitution(
id: string,
matchType?: 'institution' | 'name' | 'both' | 'all',
page?: number,
size?: number,
source?: string,
observe?: 'events',
reportProgress?: boolean,
options?: {
httpHeaderAccept?: 'application/json';
context?: HttpContext;
transferCache?: boolean;
},
): Observable<HttpEvent<OrgPatentsResponse>>;
public getOrgPatentsByInstitution(
id: string,
matchType?: 'institution' | 'name' | 'both' | 'all',
page?: number,
size?: number,
source?: string,
observe: any = 'body',
reportProgress: boolean = false,
options?: {
httpHeaderAccept?: 'application/json';
context?: HttpContext;
transferCache?: boolean;
},
): Observable<any> {
if (id === null || id === undefined) {
throw new Error(
'Required parameter id was null or undefined when calling getOrgPatentsByInstitution.',
);
let localVarQueryParameters = new HttpParams({encoder: this.encoder});
localVarQueryParameters = this.addToHttpParams(localVarQueryParameters,
<any>matchType, 'match_type');
localVarQueryParameters = this.addToHttpParams(localVarQueryParameters,
<any>page, 'page');
localVarQueryParameters = this.addToHttpParams(localVarQueryParameters,
<any>size, 'size');
localVarQueryParameters = this.addToHttpParams(localVarQueryParameters,
<any>source, 'source');
let localVarHeaders = this.defaultHeaders;
const localVarHttpHeaderAcceptSelected: string | undefined = options?.httpHeaderAccept ?? this.configuration.selectHeaderAccept([
'application/json'
]);
if (localVarHttpHeaderAcceptSelected !== undefined) {
localVarHeaders = localVarHeaders.set('Accept', localVarHttpHeaderAcceptSelected);
}
const localVarHttpContext: HttpContext = options?.context ?? new HttpContext();
const localVarTransferCache: boolean = options?.transferCache ?? true;
let responseType_: 'text' | 'json' | 'blob' = 'json';
if (localVarHttpHeaderAcceptSelected) {
if (localVarHttpHeaderAcceptSelected.startsWith('text')) {
responseType_ = 'text';
} else if (this.configuration.isJsonMime(localVarHttpHeaderAcceptSelected)) {
responseType_ = 'json';
} else {
responseType_ = 'blob';
}
}
let localVarPath = `/api/inse-service/institutions/${this.configuration.encodeParam({name: "id", value: id, in: "path", style: "simple", explode: false, dataType: "string", dataFormat: undefined})}/org-patents`;
const { basePath, withCredentials } = this.configuration;
return this.httpClient.request<OrgPatentsResponse>('get', `${basePath}${localVarPath}`,
{
context: localVarHttpContext,
params: localVarQueryParameters,
responseType: <any>responseType_,
...(withCredentials ? { withCredentials } : {}),
headers: localVarHeaders,
observe: observe,
...(localVarTransferCache !== undefined ? { transferCache: localVarTransferCache } : {}),
reportProgress: reportProgress
}
);
}
let localVarQueryParameters = new HttpParams({ encoder: this.encoder });
localVarQueryParameters = this.addToHttpParams(
localVarQueryParameters,
<any>matchType,
'match_type',
);
localVarQueryParameters = this.addToHttpParams(
localVarQueryParameters,
<any>page,
'page',
);
localVarQueryParameters = this.addToHttpParams(
localVarQueryParameters,
<any>size,
'size',
);
localVarQueryParameters = this.addToHttpParams(
localVarQueryParameters,
<any>source,
'source',
);
/**
* Returns one publication by OpenAlex ID or DOI.
* @endpoint get /api/inse-service/patents/{identifier}
* @param identifier
* @param prefix Application Prefix (EP or US)
* @param title Do we want to fallback to title search if ID and DOI dont work?
* @param fillingDate Filling date in YYYY-MM-DD format
* @param observe set whether or not to return the data Observable as the body, response or events. defaults to returning the body.
* @param reportProgress flag to report request and response progress.
*/
public getPatentByIdOrTitle(identifier: string, prefix?: string, title?: string, fillingDate?: string, observe?: 'body', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable<PatentEntry>;
public getPatentByIdOrTitle(identifier: string, prefix?: string, title?: string, fillingDate?: string, observe?: 'response', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable<HttpResponse<PatentEntry>>;
public getPatentByIdOrTitle(identifier: string, prefix?: string, title?: string, fillingDate?: string, observe?: 'events', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable<HttpEvent<PatentEntry>>;
public getPatentByIdOrTitle(identifier: string, prefix?: string, title?: string, fillingDate?: string, observe: any = 'body', reportProgress: boolean = false, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable<any> {
if (identifier === null || identifier === undefined) {
throw new Error('Required parameter identifier was null or undefined when calling getPatentByIdOrTitle.');
}
let localVarHeaders = this.defaultHeaders;
let localVarQueryParameters = new HttpParams({encoder: this.encoder});
localVarQueryParameters = this.addToHttpParams(localVarQueryParameters,
<any>prefix, 'prefix');
localVarQueryParameters = this.addToHttpParams(localVarQueryParameters,
<any>title, 'title');
localVarQueryParameters = this.addToHttpParams(localVarQueryParameters,
<any>fillingDate, 'filling_date');
const localVarHttpHeaderAcceptSelected: string | undefined =
options?.httpHeaderAccept ??
this.configuration.selectHeaderAccept(['application/json']);
if (localVarHttpHeaderAcceptSelected !== undefined) {
localVarHeaders = localVarHeaders.set(
'Accept',
localVarHttpHeaderAcceptSelected,
);
let localVarHeaders = this.defaultHeaders;
const localVarHttpHeaderAcceptSelected: string | undefined = options?.httpHeaderAccept ?? this.configuration.selectHeaderAccept([
'application/json'
]);
if (localVarHttpHeaderAcceptSelected !== undefined) {
localVarHeaders = localVarHeaders.set('Accept', localVarHttpHeaderAcceptSelected);
}
const localVarHttpContext: HttpContext = options?.context ?? new HttpContext();
const localVarTransferCache: boolean = options?.transferCache ?? true;
let responseType_: 'text' | 'json' | 'blob' = 'json';
if (localVarHttpHeaderAcceptSelected) {
if (localVarHttpHeaderAcceptSelected.startsWith('text')) {
responseType_ = 'text';
} else if (this.configuration.isJsonMime(localVarHttpHeaderAcceptSelected)) {
responseType_ = 'json';
} else {
responseType_ = 'blob';
}
}
let localVarPath = `/api/inse-service/patents/${this.configuration.encodeParam({name: "identifier", value: identifier, in: "path", style: "simple", explode: false, dataType: "string", dataFormat: undefined})}`;
const { basePath, withCredentials } = this.configuration;
return this.httpClient.request<PatentEntry>('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();
/**
* Get patents matched to an author by name.
* @endpoint get /api/inse-service/authors/{author_id}/patents
* @param authorId
* @param observe set whether or not to return the data Observable as the body, response or events. defaults to returning the body.
* @param reportProgress flag to report request and response progress.
*/
public getPatentsByAuthor(authorId: string, observe?: 'body', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable<PatentsByAuthorResponse>;
public getPatentsByAuthor(authorId: string, observe?: 'response', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable<HttpResponse<PatentsByAuthorResponse>>;
public getPatentsByAuthor(authorId: string, observe?: 'events', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable<HttpEvent<PatentsByAuthorResponse>>;
public getPatentsByAuthor(authorId: 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 getPatentsByAuthor.');
}
const localVarTransferCache: boolean = options?.transferCache ?? true;
let localVarHeaders = this.defaultHeaders;
let responseType_: 'text' | 'json' | 'blob' = 'json';
if (localVarHttpHeaderAcceptSelected) {
if (localVarHttpHeaderAcceptSelected.startsWith('text')) {
responseType_ = 'text';
} else if (
this.configuration.isJsonMime(localVarHttpHeaderAcceptSelected)
) {
responseType_ = 'json';
} else {
responseType_ = 'blob';
}
const localVarHttpHeaderAcceptSelected: string | undefined = options?.httpHeaderAccept ?? this.configuration.selectHeaderAccept([
'application/json'
]);
if (localVarHttpHeaderAcceptSelected !== undefined) {
localVarHeaders = localVarHeaders.set('Accept', localVarHttpHeaderAcceptSelected);
}
const localVarHttpContext: HttpContext = options?.context ?? new HttpContext();
const localVarTransferCache: boolean = options?.transferCache ?? true;
let responseType_: 'text' | 'json' | 'blob' = 'json';
if (localVarHttpHeaderAcceptSelected) {
if (localVarHttpHeaderAcceptSelected.startsWith('text')) {
responseType_ = 'text';
} else if (this.configuration.isJsonMime(localVarHttpHeaderAcceptSelected)) {
responseType_ = 'json';
} else {
responseType_ = 'blob';
}
}
let localVarPath = `/api/inse-service/authors/${this.configuration.encodeParam({name: "authorId", value: authorId, in: "path", style: "simple", explode: false, dataType: "string", dataFormat: undefined})}/patents`;
const { basePath, withCredentials } = this.configuration;
return this.httpClient.request<PatentsByAuthorResponse>('get', `${basePath}${localVarPath}`,
{
context: localVarHttpContext,
responseType: <any>responseType_,
...(withCredentials ? { withCredentials } : {}),
headers: localVarHeaders,
observe: observe,
...(localVarTransferCache !== undefined ? { transferCache: localVarTransferCache } : {}),
reportProgress: reportProgress
}
);
}
let localVarPath = `/api/inse-service/institutions/${this.configuration.encodeParam({ name: 'id', value: id, in: 'path', style: 'simple', explode: false, dataType: 'string', dataFormat: undefined })}/org-patents`;
const { basePath, withCredentials } = this.configuration;
return this.httpClient.request<OrgPatentsResponse>(
'get',
`${basePath}${localVarPath}`,
{
context: localVarHttpContext,
params: localVarQueryParameters,
responseType: <any>responseType_,
...(withCredentials ? { withCredentials } : {}),
headers: localVarHeaders,
observe: observe,
...(localVarTransferCache !== undefined
? { transferCache: localVarTransferCache }
: {}),
reportProgress: reportProgress,
},
);
}
/**
* Get patents matched to an institution by assignee name.
* @endpoint get /api/inse-service/institutions/{id}/patents
* @param id
* @param observe set whether or not to return the data Observable as the body, response or events. defaults to returning the body.
* @param reportProgress flag to report request and response progress.
*/
public getPatentsByInstitution(id: string, observe?: 'body', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable<PatentsByInstitutionResponse>;
public getPatentsByInstitution(id: string, observe?: 'response', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable<HttpResponse<PatentsByInstitutionResponse>>;
public getPatentsByInstitution(id: string, observe?: 'events', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable<HttpEvent<PatentsByInstitutionResponse>>;
public getPatentsByInstitution(id: string, observe: any = 'body', reportProgress: boolean = false, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable<any> {
if (id === null || id === undefined) {
throw new Error('Required parameter id was null or undefined when calling getPatentsByInstitution.');
}
/**
* Returns one publication by OpenAlex ID or DOI.
* @endpoint get /api/inse-service/patents/{identifier}
* @param identifier
* @param prefix Application Prefix (EP or US)
* @param title Do we want to fallback to title search if ID and DOI dont work?
* @param fillingDate Filling date in YYYY-MM-DD format
* @param observe set whether or not to return the data Observable as the body, response or events. defaults to returning the body.
* @param reportProgress flag to report request and response progress.
*/
public getPatentByIdOrTitle(
identifier: string,
prefix?: string,
title?: string,
fillingDate?: string,
observe?: 'body',
reportProgress?: boolean,
options?: {
httpHeaderAccept?: 'application/json';
context?: HttpContext;
transferCache?: boolean;
},
): Observable<PatentEntry>;
public getPatentByIdOrTitle(
identifier: string,
prefix?: string,
title?: string,
fillingDate?: string,
observe?: 'response',
reportProgress?: boolean,
options?: {
httpHeaderAccept?: 'application/json';
context?: HttpContext;
transferCache?: boolean;
},
): Observable<HttpResponse<PatentEntry>>;
public getPatentByIdOrTitle(
identifier: string,
prefix?: string,
title?: string,
fillingDate?: string,
observe?: 'events',
reportProgress?: boolean,
options?: {
httpHeaderAccept?: 'application/json';
context?: HttpContext;
transferCache?: boolean;
},
): Observable<HttpEvent<PatentEntry>>;
public getPatentByIdOrTitle(
identifier: string,
prefix?: string,
title?: string,
fillingDate?: string,
observe: any = 'body',
reportProgress: boolean = false,
options?: {
httpHeaderAccept?: 'application/json';
context?: HttpContext;
transferCache?: boolean;
},
): Observable<any> {
if (identifier === null || identifier === undefined) {
throw new Error(
'Required parameter identifier was null or undefined when calling getPatentByIdOrTitle.',
);
let localVarHeaders = this.defaultHeaders;
const localVarHttpHeaderAcceptSelected: string | undefined = options?.httpHeaderAccept ?? this.configuration.selectHeaderAccept([
'application/json'
]);
if (localVarHttpHeaderAcceptSelected !== undefined) {
localVarHeaders = localVarHeaders.set('Accept', localVarHttpHeaderAcceptSelected);
}
const localVarHttpContext: HttpContext = options?.context ?? new HttpContext();
const localVarTransferCache: boolean = options?.transferCache ?? true;
let responseType_: 'text' | 'json' | 'blob' = 'json';
if (localVarHttpHeaderAcceptSelected) {
if (localVarHttpHeaderAcceptSelected.startsWith('text')) {
responseType_ = 'text';
} else if (this.configuration.isJsonMime(localVarHttpHeaderAcceptSelected)) {
responseType_ = 'json';
} else {
responseType_ = 'blob';
}
}
let localVarPath = `/api/inse-service/institutions/${this.configuration.encodeParam({name: "id", value: id, in: "path", style: "simple", explode: false, dataType: "string", dataFormat: undefined})}/patents`;
const { basePath, withCredentials } = this.configuration;
return this.httpClient.request<PatentsByInstitutionResponse>('get', `${basePath}${localVarPath}`,
{
context: localVarHttpContext,
responseType: <any>responseType_,
...(withCredentials ? { withCredentials } : {}),
headers: localVarHeaders,
observe: observe,
...(localVarTransferCache !== undefined ? { transferCache: localVarTransferCache } : {}),
reportProgress: reportProgress
}
);
}
let localVarQueryParameters = new HttpParams({ encoder: this.encoder });
localVarQueryParameters = this.addToHttpParams(
localVarQueryParameters,
<any>prefix,
'prefix',
);
localVarQueryParameters = this.addToHttpParams(
localVarQueryParameters,
<any>title,
'title',
);
localVarQueryParameters = this.addToHttpParams(
localVarQueryParameters,
<any>fillingDate,
'filling_date',
);
let localVarHeaders = this.defaultHeaders;
const localVarHttpHeaderAcceptSelected: string | undefined =
options?.httpHeaderAccept ??
this.configuration.selectHeaderAccept(['application/json']);
if (localVarHttpHeaderAcceptSelected !== undefined) {
localVarHeaders = localVarHeaders.set(
'Accept',
localVarHttpHeaderAcceptSelected,
);
}
const localVarHttpContext: HttpContext =
options?.context ?? new HttpContext();
const localVarTransferCache: boolean = options?.transferCache ?? true;
let responseType_: 'text' | 'json' | 'blob' = 'json';
if (localVarHttpHeaderAcceptSelected) {
if (localVarHttpHeaderAcceptSelected.startsWith('text')) {
responseType_ = 'text';
} else if (
this.configuration.isJsonMime(localVarHttpHeaderAcceptSelected)
) {
responseType_ = 'json';
} else {
responseType_ = 'blob';
}
}
let localVarPath = `/api/inse-service/patents/${this.configuration.encodeParam({ name: 'identifier', value: identifier, in: 'path', style: 'simple', explode: false, dataType: 'string', dataFormat: undefined })}`;
const { basePath, withCredentials } = this.configuration;
return this.httpClient.request<PatentEntry>(
'get',
`${basePath}${localVarPath}`,
{
context: localVarHttpContext,
params: localVarQueryParameters,
responseType: <any>responseType_,
...(withCredentials ? { withCredentials } : {}),
headers: localVarHeaders,
observe: observe,
...(localVarTransferCache !== undefined
? { transferCache: localVarTransferCache }
: {}),
reportProgress: reportProgress,
},
);
}
/**
* Get patents matched to an author by name.
* @endpoint get /api/inse-service/authors/{author_id}/patents
* @param authorId
* @param observe set whether or not to return the data Observable as the body, response or events. defaults to returning the body.
* @param reportProgress flag to report request and response progress.
*/
public getPatentsByAuthor(
authorId: string,
observe?: 'body',
reportProgress?: boolean,
options?: {
httpHeaderAccept?: 'application/json';
context?: HttpContext;
transferCache?: boolean;
},
): Observable<PatentsByAuthorResponse>;
public getPatentsByAuthor(
authorId: string,
observe?: 'response',
reportProgress?: boolean,
options?: {
httpHeaderAccept?: 'application/json';
context?: HttpContext;
transferCache?: boolean;
},
): Observable<HttpResponse<PatentsByAuthorResponse>>;
public getPatentsByAuthor(
authorId: string,
observe?: 'events',
reportProgress?: boolean,
options?: {
httpHeaderAccept?: 'application/json';
context?: HttpContext;
transferCache?: boolean;
},
): Observable<HttpEvent<PatentsByAuthorResponse>>;
public getPatentsByAuthor(
authorId: 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 getPatentsByAuthor.',
);
}
let localVarHeaders = this.defaultHeaders;
const localVarHttpHeaderAcceptSelected: string | undefined =
options?.httpHeaderAccept ??
this.configuration.selectHeaderAccept(['application/json']);
if (localVarHttpHeaderAcceptSelected !== undefined) {
localVarHeaders = localVarHeaders.set(
'Accept',
localVarHttpHeaderAcceptSelected,
);
}
const localVarHttpContext: HttpContext =
options?.context ?? new HttpContext();
const localVarTransferCache: boolean = options?.transferCache ?? true;
let responseType_: 'text' | 'json' | 'blob' = 'json';
if (localVarHttpHeaderAcceptSelected) {
if (localVarHttpHeaderAcceptSelected.startsWith('text')) {
responseType_ = 'text';
} else if (
this.configuration.isJsonMime(localVarHttpHeaderAcceptSelected)
) {
responseType_ = 'json';
} else {
responseType_ = 'blob';
}
}
let localVarPath = `/api/inse-service/authors/${this.configuration.encodeParam({ name: 'authorId', value: authorId, in: 'path', style: 'simple', explode: false, dataType: 'string', dataFormat: undefined })}/patents`;
const { basePath, withCredentials } = this.configuration;
return this.httpClient.request<PatentsByAuthorResponse>(
'get',
`${basePath}${localVarPath}`,
{
context: localVarHttpContext,
responseType: <any>responseType_,
...(withCredentials ? { withCredentials } : {}),
headers: localVarHeaders,
observe: observe,
...(localVarTransferCache !== undefined
? { transferCache: localVarTransferCache }
: {}),
reportProgress: reportProgress,
},
);
}
/**
* Get patents matched to an institution by assignee name.
* @endpoint get /api/inse-service/institutions/{id}/patents
* @param id
* @param observe set whether or not to return the data Observable as the body, response or events. defaults to returning the body.
* @param reportProgress flag to report request and response progress.
*/
public getPatentsByInstitution(
id: string,
observe?: 'body',
reportProgress?: boolean,
options?: {
httpHeaderAccept?: 'application/json';
context?: HttpContext;
transferCache?: boolean;
},
): Observable<PatentsByInstitutionResponse>;
public getPatentsByInstitution(
id: string,
observe?: 'response',
reportProgress?: boolean,
options?: {
httpHeaderAccept?: 'application/json';
context?: HttpContext;
transferCache?: boolean;
},
): Observable<HttpResponse<PatentsByInstitutionResponse>>;
public getPatentsByInstitution(
id: string,
observe?: 'events',
reportProgress?: boolean,
options?: {
httpHeaderAccept?: 'application/json';
context?: HttpContext;
transferCache?: boolean;
},
): Observable<HttpEvent<PatentsByInstitutionResponse>>;
public getPatentsByInstitution(
id: string,
observe: any = 'body',
reportProgress: boolean = false,
options?: {
httpHeaderAccept?: 'application/json';
context?: HttpContext;
transferCache?: boolean;
},
): Observable<any> {
if (id === null || id === undefined) {
throw new Error(
'Required parameter id was null or undefined when calling getPatentsByInstitution.',
);
}
let localVarHeaders = this.defaultHeaders;
const localVarHttpHeaderAcceptSelected: string | undefined =
options?.httpHeaderAccept ??
this.configuration.selectHeaderAccept(['application/json']);
if (localVarHttpHeaderAcceptSelected !== undefined) {
localVarHeaders = localVarHeaders.set(
'Accept',
localVarHttpHeaderAcceptSelected,
);
}
const localVarHttpContext: HttpContext =
options?.context ?? new HttpContext();
const localVarTransferCache: boolean = options?.transferCache ?? true;
let responseType_: 'text' | 'json' | 'blob' = 'json';
if (localVarHttpHeaderAcceptSelected) {
if (localVarHttpHeaderAcceptSelected.startsWith('text')) {
responseType_ = 'text';
} else if (
this.configuration.isJsonMime(localVarHttpHeaderAcceptSelected)
) {
responseType_ = 'json';
} else {
responseType_ = 'blob';
}
}
let localVarPath = `/api/inse-service/institutions/${this.configuration.encodeParam({ name: 'id', value: id, in: 'path', style: 'simple', explode: false, dataType: 'string', dataFormat: undefined })}/patents`;
const { basePath, withCredentials } = this.configuration;
return this.httpClient.request<PatentsByInstitutionResponse>(
'get',
`${basePath}${localVarPath}`,
{
context: localVarHttpContext,
responseType: <any>responseType_,
...(withCredentials ? { withCredentials } : {}),
headers: localVarHeaders,
observe: observe,
...(localVarTransferCache !== undefined
? { transferCache: localVarTransferCache }
: {}),
reportProgress: reportProgress,
},
);
}
}
+78 -137
View File
@@ -1,7 +1,7 @@
/**
* Innovation Search Engine API
*
*
*
*
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
* https://openapi-generator.tech
@@ -9,18 +9,12 @@
*/
/* tslint:disable:no-unused-variable member-ordering */
import { Inject, Injectable, Optional } from '@angular/core';
import {
HttpClient,
HttpHeaders,
HttpParams,
HttpResponse,
HttpEvent,
HttpParameterCodec,
HttpContext,
} from '@angular/common/http';
import { CustomHttpParameterCodec } from '../encoder';
import { Observable } from 'rxjs';
import { Inject, Injectable, Optional } from '@angular/core';
import { HttpClient, HttpHeaders, HttpParams,
HttpResponse, HttpEvent, HttpParameterCodec, HttpContext
} from '@angular/common/http';
import { CustomHttpParameterCodec } from '../encoder';
import { Observable } from 'rxjs';
// @ts-ignore
import { CollaborationNetwork } from '../model/collaborationNetwork';
@@ -30,139 +24,86 @@ import { FilterProperties } from '../model/filterProperties';
import { HTTPValidationError } from '../model/hTTPValidationError';
// @ts-ignore
import { BASE_PATH, COLLECTION_FORMATS } from '../variables';
import { Configuration } from '../configuration';
import { BASE_PATH, COLLECTION_FORMATS } from '../variables';
import { Configuration } from '../configuration';
import { BaseService } from '../api.base.service';
@Injectable({
providedIn: 'root',
providedIn: 'root'
})
export class PersonNetworkService extends BaseService {
constructor(
protected httpClient: HttpClient,
@Optional() @Inject(BASE_PATH) basePath: string | string[],
@Optional() configuration?: Configuration,
) {
super(basePath, configuration);
}
/**
* Get a person\&#39;s collaboration network.
* Returns a person\&#39;s collaboration network based on their works and co-authors.
* @endpoint post /api/person/network/{raw_user_id}
* @param rawUserId The raw user ID of the person.
* @param filterProperties
* @param observe set whether or not to return the data Observable as the body, response or events. defaults to returning the body.
* @param reportProgress flag to report request and response progress.
*/
public getCollaborationNetwork(
rawUserId: string,
filterProperties?: FilterProperties,
observe?: 'body',
reportProgress?: boolean,
options?: {
httpHeaderAccept?: 'application/json';
context?: HttpContext;
transferCache?: boolean;
},
): Observable<CollaborationNetwork>;
public getCollaborationNetwork(
rawUserId: string,
filterProperties?: FilterProperties,
observe?: 'response',
reportProgress?: boolean,
options?: {
httpHeaderAccept?: 'application/json';
context?: HttpContext;
transferCache?: boolean;
},
): Observable<HttpResponse<CollaborationNetwork>>;
public getCollaborationNetwork(
rawUserId: string,
filterProperties?: FilterProperties,
observe?: 'events',
reportProgress?: boolean,
options?: {
httpHeaderAccept?: 'application/json';
context?: HttpContext;
transferCache?: boolean;
},
): Observable<HttpEvent<CollaborationNetwork>>;
public getCollaborationNetwork(
rawUserId: string,
filterProperties?: FilterProperties,
observe: any = 'body',
reportProgress: boolean = false,
options?: {
httpHeaderAccept?: 'application/json';
context?: HttpContext;
transferCache?: boolean;
},
): Observable<any> {
if (rawUserId === null || rawUserId === undefined) {
throw new Error(
'Required parameter rawUserId was null or undefined when calling getCollaborationNetwork.',
);
constructor(protected httpClient: HttpClient, @Optional() @Inject(BASE_PATH) basePath: string|string[], @Optional() configuration?: Configuration) {
super(basePath, configuration);
}
let localVarHeaders = this.defaultHeaders;
/**
* Get a person\&#39;s collaboration network.
* Returns a person\&#39;s collaboration network based on their works and co-authors.
* @endpoint post /api/person/network/{raw_user_id}
* @param rawUserId The raw user ID of the person.
* @param filterProperties
* @param observe set whether or not to return the data Observable as the body, response or events. defaults to returning the body.
* @param reportProgress flag to report request and response progress.
*/
public getCollaborationNetwork(rawUserId: string, filterProperties?: FilterProperties, observe?: 'body', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable<CollaborationNetwork>;
public getCollaborationNetwork(rawUserId: string, filterProperties?: FilterProperties, observe?: 'response', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable<HttpResponse<CollaborationNetwork>>;
public getCollaborationNetwork(rawUserId: string, filterProperties?: FilterProperties, observe?: 'events', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable<HttpEvent<CollaborationNetwork>>;
public getCollaborationNetwork(rawUserId: string, filterProperties?: FilterProperties, observe: any = 'body', reportProgress: boolean = false, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable<any> {
if (rawUserId === null || rawUserId === undefined) {
throw new Error('Required parameter rawUserId was null or undefined when calling getCollaborationNetwork.');
}
const localVarHttpHeaderAcceptSelected: string | undefined =
options?.httpHeaderAccept ??
this.configuration.selectHeaderAccept(['application/json']);
if (localVarHttpHeaderAcceptSelected !== undefined) {
localVarHeaders = localVarHeaders.set(
'Accept',
localVarHttpHeaderAcceptSelected,
);
let localVarHeaders = this.defaultHeaders;
const localVarHttpHeaderAcceptSelected: string | undefined = options?.httpHeaderAccept ?? this.configuration.selectHeaderAccept([
'application/json'
]);
if (localVarHttpHeaderAcceptSelected !== undefined) {
localVarHeaders = localVarHeaders.set('Accept', localVarHttpHeaderAcceptSelected);
}
const localVarHttpContext: HttpContext = options?.context ?? new HttpContext();
const localVarTransferCache: boolean = options?.transferCache ?? true;
// to determine the Content-Type header
const consumes: string[] = [
'application/json'
];
const httpContentTypeSelected: string | undefined = this.configuration.selectHeaderContentType(consumes);
if (httpContentTypeSelected !== undefined) {
localVarHeaders = localVarHeaders.set('Content-Type', httpContentTypeSelected);
}
let responseType_: 'text' | 'json' | 'blob' = 'json';
if (localVarHttpHeaderAcceptSelected) {
if (localVarHttpHeaderAcceptSelected.startsWith('text')) {
responseType_ = 'text';
} else if (this.configuration.isJsonMime(localVarHttpHeaderAcceptSelected)) {
responseType_ = 'json';
} else {
responseType_ = 'blob';
}
}
let localVarPath = `/api/person/network/${this.configuration.encodeParam({name: "rawUserId", value: rawUserId, in: "path", style: "simple", explode: false, dataType: "string", dataFormat: undefined})}`;
const { basePath, withCredentials } = this.configuration;
return this.httpClient.request<CollaborationNetwork>('post', `${basePath}${localVarPath}`,
{
context: localVarHttpContext,
body: filterProperties,
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;
// to determine the Content-Type header
const consumes: string[] = ['application/json'];
const httpContentTypeSelected: string | undefined =
this.configuration.selectHeaderContentType(consumes);
if (httpContentTypeSelected !== undefined) {
localVarHeaders = localVarHeaders.set(
'Content-Type',
httpContentTypeSelected,
);
}
let responseType_: 'text' | 'json' | 'blob' = 'json';
if (localVarHttpHeaderAcceptSelected) {
if (localVarHttpHeaderAcceptSelected.startsWith('text')) {
responseType_ = 'text';
} else if (
this.configuration.isJsonMime(localVarHttpHeaderAcceptSelected)
) {
responseType_ = 'json';
} else {
responseType_ = 'blob';
}
}
let localVarPath = `/api/person/network/${this.configuration.encodeParam({ name: 'rawUserId', value: rawUserId, in: 'path', style: 'simple', explode: false, dataType: 'string', dataFormat: undefined })}`;
const { basePath, withCredentials } = this.configuration;
return this.httpClient.request<CollaborationNetwork>(
'post',
`${basePath}${localVarPath}`,
{
context: localVarHttpContext,
body: filterProperties,
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
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,18 +9,12 @@
*/
/* tslint:disable:no-unused-variable member-ordering */
import { Inject, Injectable, Optional } from '@angular/core';
import {
HttpClient,
HttpHeaders,
HttpParams,
HttpResponse,
HttpEvent,
HttpParameterCodec,
HttpContext,
} from '@angular/common/http';
import { CustomHttpParameterCodec } from '../encoder';
import { Observable } from 'rxjs';
import { Inject, Injectable, Optional } from '@angular/core';
import { HttpClient, HttpHeaders, HttpParams,
HttpResponse, HttpEvent, HttpParameterCodec, HttpContext
} from '@angular/common/http';
import { CustomHttpParameterCodec } from '../encoder';
import { Observable } from 'rxjs';
// @ts-ignore
import { AutocompleteLocationItem } from '../model/autocompleteLocationItem';
@@ -34,545 +28,296 @@ import { TopInstitutionItem } from '../model/topInstitutionItem';
import { TrendResponse } from '../model/trendResponse';
// @ts-ignore
import { BASE_PATH, COLLECTION_FORMATS } from '../variables';
import { Configuration } from '../configuration';
import { BASE_PATH, COLLECTION_FORMATS } from '../variables';
import { Configuration } from '../configuration';
import { BaseService } from '../api.base.service';
@Injectable({
providedIn: 'root',
providedIn: 'root'
})
export class UniversityRankingsService extends BaseService {
constructor(
protected httpClient: HttpClient,
@Optional() @Inject(BASE_PATH) basePath: string | string[],
@Optional() configuration?: Configuration,
) {
super(basePath, configuration);
}
/**
* Returns country and continent options for autocomplete inputs.
* @endpoint get /api/inse-service/university-rankings/autocomplete-locations
* @param query Query text to search for countries/continents
* @param observe set whether or not to return the data Observable as the body, response or events. defaults to returning the body.
* @param reportProgress flag to report request and response progress.
*/
public getAutocompleteLocationsApiInseServiceUniversityRankingsAutocompleteLocationsGet(
query: string,
observe?: 'body',
reportProgress?: boolean,
options?: {
httpHeaderAccept?: 'application/json';
context?: HttpContext;
transferCache?: boolean;
},
): Observable<Array<AutocompleteLocationItem>>;
public getAutocompleteLocationsApiInseServiceUniversityRankingsAutocompleteLocationsGet(
query: string,
observe?: 'response',
reportProgress?: boolean,
options?: {
httpHeaderAccept?: 'application/json';
context?: HttpContext;
transferCache?: boolean;
},
): Observable<HttpResponse<Array<AutocompleteLocationItem>>>;
public getAutocompleteLocationsApiInseServiceUniversityRankingsAutocompleteLocationsGet(
query: string,
observe?: 'events',
reportProgress?: boolean,
options?: {
httpHeaderAccept?: 'application/json';
context?: HttpContext;
transferCache?: boolean;
},
): Observable<HttpEvent<Array<AutocompleteLocationItem>>>;
public getAutocompleteLocationsApiInseServiceUniversityRankingsAutocompleteLocationsGet(
query: string,
observe: any = 'body',
reportProgress: boolean = false,
options?: {
httpHeaderAccept?: 'application/json';
context?: HttpContext;
transferCache?: boolean;
},
): Observable<any> {
if (query === null || query === undefined) {
throw new Error(
'Required parameter query was null or undefined when calling getAutocompleteLocationsApiInseServiceUniversityRankingsAutocompleteLocationsGet.',
);
constructor(protected httpClient: HttpClient, @Optional() @Inject(BASE_PATH) basePath: string|string[], @Optional() configuration?: Configuration) {
super(basePath, configuration);
}
let localVarQueryParameters = new HttpParams({ encoder: this.encoder });
localVarQueryParameters = this.addToHttpParams(
localVarQueryParameters,
<any>query,
'query',
);
/**
* Returns country and continent options for autocomplete inputs.
* @endpoint get /api/inse-service/university-rankings/autocomplete-locations
* @param query Query text to search for countries/continents
* @param observe set whether or not to return the data Observable as the body, response or events. defaults to returning the body.
* @param reportProgress flag to report request and response progress.
*/
public getAutocompleteLocationsApiInseServiceUniversityRankingsAutocompleteLocationsGet(query: string, observe?: 'body', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable<Array<AutocompleteLocationItem>>;
public getAutocompleteLocationsApiInseServiceUniversityRankingsAutocompleteLocationsGet(query: string, observe?: 'response', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable<HttpResponse<Array<AutocompleteLocationItem>>>;
public getAutocompleteLocationsApiInseServiceUniversityRankingsAutocompleteLocationsGet(query: string, observe?: 'events', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable<HttpEvent<Array<AutocompleteLocationItem>>>;
public getAutocompleteLocationsApiInseServiceUniversityRankingsAutocompleteLocationsGet(query: string, observe: any = 'body', reportProgress: boolean = false, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable<any> {
if (query === null || query === undefined) {
throw new Error('Required parameter query was null or undefined when calling getAutocompleteLocationsApiInseServiceUniversityRankingsAutocompleteLocationsGet.');
}
let localVarHeaders = this.defaultHeaders;
let localVarQueryParameters = new HttpParams({encoder: this.encoder});
localVarQueryParameters = this.addToHttpParams(localVarQueryParameters,
<any>query, 'query');
const localVarHttpHeaderAcceptSelected: string | undefined =
options?.httpHeaderAccept ??
this.configuration.selectHeaderAccept(['application/json']);
if (localVarHttpHeaderAcceptSelected !== undefined) {
localVarHeaders = localVarHeaders.set(
'Accept',
localVarHttpHeaderAcceptSelected,
);
}
let localVarHeaders = this.defaultHeaders;
const localVarHttpContext: HttpContext =
options?.context ?? new HttpContext();
const localVarHttpHeaderAcceptSelected: string | undefined = options?.httpHeaderAccept ?? this.configuration.selectHeaderAccept([
'application/json'
]);
if (localVarHttpHeaderAcceptSelected !== undefined) {
localVarHeaders = localVarHeaders.set('Accept', localVarHttpHeaderAcceptSelected);
}
const localVarTransferCache: boolean = options?.transferCache ?? true;
const localVarHttpContext: HttpContext = options?.context ?? new HttpContext();
let responseType_: 'text' | 'json' | 'blob' = 'json';
if (localVarHttpHeaderAcceptSelected) {
if (localVarHttpHeaderAcceptSelected.startsWith('text')) {
responseType_ = 'text';
} else if (
this.configuration.isJsonMime(localVarHttpHeaderAcceptSelected)
) {
responseType_ = 'json';
} else {
responseType_ = 'blob';
}
}
const localVarTransferCache: boolean = options?.transferCache ?? true;
let localVarPath = `/api/inse-service/university-rankings/autocomplete-locations`;
const { basePath, withCredentials } = this.configuration;
return this.httpClient.request<Array<AutocompleteLocationItem>>(
'get',
`${basePath}${localVarPath}`,
{
context: localVarHttpContext,
params: localVarQueryParameters,
responseType: <any>responseType_,
...(withCredentials ? { withCredentials } : {}),
headers: localVarHeaders,
observe: observe,
...(localVarTransferCache !== undefined
? { transferCache: localVarTransferCache }
: {}),
reportProgress: reportProgress,
},
);
}
/**
* Returns data for the University Ranking Dashboard.
* @endpoint get /api/inse-service/university-rankings
* @param topic Research topic display name or OpenAlex ID (e.g., \&#39;Artificial Intelligence\&#39;)
* @param metric Metric to rank by
* @param observe set whether or not to return the data Observable as the body, response or events. defaults to returning the body.
* @param reportProgress flag to report request and response progress.
*/
public getRankingsApiInseServiceUniversityRankingsGet(
topic: string,
metric?: 'publications' | 'citations',
observe?: 'body',
reportProgress?: boolean,
options?: {
httpHeaderAccept?: 'application/json';
context?: HttpContext;
transferCache?: boolean;
},
): Observable<RankingResponse>;
public getRankingsApiInseServiceUniversityRankingsGet(
topic: string,
metric?: 'publications' | 'citations',
observe?: 'response',
reportProgress?: boolean,
options?: {
httpHeaderAccept?: 'application/json';
context?: HttpContext;
transferCache?: boolean;
},
): Observable<HttpResponse<RankingResponse>>;
public getRankingsApiInseServiceUniversityRankingsGet(
topic: string,
metric?: 'publications' | 'citations',
observe?: 'events',
reportProgress?: boolean,
options?: {
httpHeaderAccept?: 'application/json';
context?: HttpContext;
transferCache?: boolean;
},
): Observable<HttpEvent<RankingResponse>>;
public getRankingsApiInseServiceUniversityRankingsGet(
topic: string,
metric?: 'publications' | 'citations',
observe: any = 'body',
reportProgress: boolean = false,
options?: {
httpHeaderAccept?: 'application/json';
context?: HttpContext;
transferCache?: boolean;
},
): Observable<any> {
if (topic === null || topic === undefined) {
throw new Error(
'Required parameter topic was null or undefined when calling getRankingsApiInseServiceUniversityRankingsGet.',
);
}
let responseType_: 'text' | 'json' | 'blob' = 'json';
if (localVarHttpHeaderAcceptSelected) {
if (localVarHttpHeaderAcceptSelected.startsWith('text')) {
responseType_ = 'text';
} else if (this.configuration.isJsonMime(localVarHttpHeaderAcceptSelected)) {
responseType_ = 'json';
} else {
responseType_ = 'blob';
}
}
let localVarQueryParameters = new HttpParams({ encoder: this.encoder });
localVarQueryParameters = this.addToHttpParams(
localVarQueryParameters,
<any>topic,
'topic',
);
localVarQueryParameters = this.addToHttpParams(
localVarQueryParameters,
<any>metric,
'metric',
);
let localVarHeaders = this.defaultHeaders;
const localVarHttpHeaderAcceptSelected: string | undefined =
options?.httpHeaderAccept ??
this.configuration.selectHeaderAccept(['application/json']);
if (localVarHttpHeaderAcceptSelected !== undefined) {
localVarHeaders = localVarHeaders.set(
'Accept',
localVarHttpHeaderAcceptSelected,
);
}
const localVarHttpContext: HttpContext =
options?.context ?? new HttpContext();
const localVarTransferCache: boolean = options?.transferCache ?? true;
let responseType_: 'text' | 'json' | 'blob' = 'json';
if (localVarHttpHeaderAcceptSelected) {
if (localVarHttpHeaderAcceptSelected.startsWith('text')) {
responseType_ = 'text';
} else if (
this.configuration.isJsonMime(localVarHttpHeaderAcceptSelected)
) {
responseType_ = 'json';
} else {
responseType_ = 'blob';
}
}
let localVarPath = `/api/inse-service/university-rankings`;
const { basePath, withCredentials } = this.configuration;
return this.httpClient.request<RankingResponse>(
'get',
`${basePath}${localVarPath}`,
{
context: localVarHttpContext,
params: localVarQueryParameters,
responseType: <any>responseType_,
...(withCredentials ? { withCredentials } : {}),
headers: localVarHeaders,
observe: observe,
...(localVarTransferCache !== undefined
? { transferCache: localVarTransferCache }
: {}),
reportProgress: reportProgress,
},
);
}
/**
* Returns top institutions filtered by country/region and sorted by topic-level publications count.
* @endpoint get /api/inse-service/university-rankings/top-institutions
* @param topic Research topic
* @param region Region identifier (e.g. EU)
* @param country Country code (e.g. DE)
* @param limit Max suggestions to return
* @param observe set whether or not to return the data Observable as the body, response or events. defaults to returning the body.
* @param reportProgress flag to report request and response progress.
*/
public getTopInstitutionsApiInseServiceUniversityRankingsTopInstitutionsGet(
topic: string,
region?: string,
country?: string,
limit?: number,
observe?: 'body',
reportProgress?: boolean,
options?: {
httpHeaderAccept?: 'application/json';
context?: HttpContext;
transferCache?: boolean;
},
): Observable<Array<TopInstitutionItem>>;
public getTopInstitutionsApiInseServiceUniversityRankingsTopInstitutionsGet(
topic: string,
region?: string,
country?: string,
limit?: number,
observe?: 'response',
reportProgress?: boolean,
options?: {
httpHeaderAccept?: 'application/json';
context?: HttpContext;
transferCache?: boolean;
},
): Observable<HttpResponse<Array<TopInstitutionItem>>>;
public getTopInstitutionsApiInseServiceUniversityRankingsTopInstitutionsGet(
topic: string,
region?: string,
country?: string,
limit?: number,
observe?: 'events',
reportProgress?: boolean,
options?: {
httpHeaderAccept?: 'application/json';
context?: HttpContext;
transferCache?: boolean;
},
): Observable<HttpEvent<Array<TopInstitutionItem>>>;
public getTopInstitutionsApiInseServiceUniversityRankingsTopInstitutionsGet(
topic: string,
region?: string,
country?: string,
limit?: number,
observe: any = 'body',
reportProgress: boolean = false,
options?: {
httpHeaderAccept?: 'application/json';
context?: HttpContext;
transferCache?: boolean;
},
): Observable<any> {
if (topic === null || topic === undefined) {
throw new Error(
'Required parameter topic was null or undefined when calling getTopInstitutionsApiInseServiceUniversityRankingsTopInstitutionsGet.',
);
}
let localVarQueryParameters = new HttpParams({ encoder: this.encoder });
localVarQueryParameters = this.addToHttpParams(
localVarQueryParameters,
<any>topic,
'topic',
);
localVarQueryParameters = this.addToHttpParams(
localVarQueryParameters,
<any>region,
'region',
);
localVarQueryParameters = this.addToHttpParams(
localVarQueryParameters,
<any>country,
'country',
);
localVarQueryParameters = this.addToHttpParams(
localVarQueryParameters,
<any>limit,
'limit',
);
let localVarHeaders = this.defaultHeaders;
const localVarHttpHeaderAcceptSelected: string | undefined =
options?.httpHeaderAccept ??
this.configuration.selectHeaderAccept(['application/json']);
if (localVarHttpHeaderAcceptSelected !== undefined) {
localVarHeaders = localVarHeaders.set(
'Accept',
localVarHttpHeaderAcceptSelected,
);
}
const localVarHttpContext: HttpContext =
options?.context ?? new HttpContext();
const localVarTransferCache: boolean = options?.transferCache ?? true;
let responseType_: 'text' | 'json' | 'blob' = 'json';
if (localVarHttpHeaderAcceptSelected) {
if (localVarHttpHeaderAcceptSelected.startsWith('text')) {
responseType_ = 'text';
} else if (
this.configuration.isJsonMime(localVarHttpHeaderAcceptSelected)
) {
responseType_ = 'json';
} else {
responseType_ = 'blob';
}
}
let localVarPath = `/api/inse-service/university-rankings/top-institutions`;
const { basePath, withCredentials } = this.configuration;
return this.httpClient.request<Array<TopInstitutionItem>>(
'get',
`${basePath}${localVarPath}`,
{
context: localVarHttpContext,
params: localVarQueryParameters,
responseType: <any>responseType_,
...(withCredentials ? { withCredentials } : {}),
headers: localVarHeaders,
observe: observe,
...(localVarTransferCache !== undefined
? { transferCache: localVarTransferCache }
: {}),
reportProgress: reportProgress,
},
);
}
/**
* Returns timeseries publication data for compared institutions, countries and regions.
* @endpoint get /api/inse-service/university-rankings/trend
* @param topics List of topics to analyze
* @param institutions List of OpenAlex Institution IDs
* @param countries List of country codes
* @param regions List of region identifiers
* @param observe set whether or not to return the data Observable as the body, response or events. defaults to returning the body.
* @param reportProgress flag to report request and response progress.
*/
public getTrendApiInseServiceUniversityRankingsTrendGet(
topics: Array<string>,
institutions?: Array<string>,
countries?: Array<string>,
regions?: Array<string>,
observe?: 'body',
reportProgress?: boolean,
options?: {
httpHeaderAccept?: 'application/json';
context?: HttpContext;
transferCache?: boolean;
},
): Observable<TrendResponse>;
public getTrendApiInseServiceUniversityRankingsTrendGet(
topics: Array<string>,
institutions?: Array<string>,
countries?: Array<string>,
regions?: Array<string>,
observe?: 'response',
reportProgress?: boolean,
options?: {
httpHeaderAccept?: 'application/json';
context?: HttpContext;
transferCache?: boolean;
},
): Observable<HttpResponse<TrendResponse>>;
public getTrendApiInseServiceUniversityRankingsTrendGet(
topics: Array<string>,
institutions?: Array<string>,
countries?: Array<string>,
regions?: Array<string>,
observe?: 'events',
reportProgress?: boolean,
options?: {
httpHeaderAccept?: 'application/json';
context?: HttpContext;
transferCache?: boolean;
},
): Observable<HttpEvent<TrendResponse>>;
public getTrendApiInseServiceUniversityRankingsTrendGet(
topics: Array<string>,
institutions?: Array<string>,
countries?: Array<string>,
regions?: Array<string>,
observe: any = 'body',
reportProgress: boolean = false,
options?: {
httpHeaderAccept?: 'application/json';
context?: HttpContext;
transferCache?: boolean;
},
): Observable<any> {
if (topics === null || topics === undefined) {
throw new Error(
'Required parameter topics was null or undefined when calling getTrendApiInseServiceUniversityRankingsTrendGet.',
);
}
let localVarQueryParameters = new HttpParams({ encoder: this.encoder });
if (topics) {
topics.forEach((element) => {
localVarQueryParameters = this.addToHttpParams(
localVarQueryParameters,
<any>element,
'topics',
let localVarPath = `/api/inse-service/university-rankings/autocomplete-locations`;
const { basePath, withCredentials } = this.configuration;
return this.httpClient.request<Array<AutocompleteLocationItem>>('get', `${basePath}${localVarPath}`,
{
context: localVarHttpContext,
params: localVarQueryParameters,
responseType: <any>responseType_,
...(withCredentials ? { withCredentials } : {}),
headers: localVarHeaders,
observe: observe,
...(localVarTransferCache !== undefined ? { transferCache: localVarTransferCache } : {}),
reportProgress: reportProgress
}
);
});
}
if (institutions) {
institutions.forEach((element) => {
localVarQueryParameters = this.addToHttpParams(
localVarQueryParameters,
<any>element,
'institutions',
/**
* Returns data for the University Ranking Dashboard.
* @endpoint get /api/inse-service/university-rankings
* @param topic Research topic display name or OpenAlex ID (e.g., \&#39;Artificial Intelligence\&#39;)
* @param metric Metric to rank by
* @param observe set whether or not to return the data Observable as the body, response or events. defaults to returning the body.
* @param reportProgress flag to report request and response progress.
*/
public getRankingsApiInseServiceUniversityRankingsGet(topic: string, metric?: 'publications' | 'citations', observe?: 'body', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable<RankingResponse>;
public getRankingsApiInseServiceUniversityRankingsGet(topic: string, metric?: 'publications' | 'citations', observe?: 'response', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable<HttpResponse<RankingResponse>>;
public getRankingsApiInseServiceUniversityRankingsGet(topic: string, metric?: 'publications' | 'citations', observe?: 'events', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable<HttpEvent<RankingResponse>>;
public getRankingsApiInseServiceUniversityRankingsGet(topic: string, metric?: 'publications' | 'citations', observe: any = 'body', reportProgress: boolean = false, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable<any> {
if (topic === null || topic === undefined) {
throw new Error('Required parameter topic was null or undefined when calling getRankingsApiInseServiceUniversityRankingsGet.');
}
let localVarQueryParameters = new HttpParams({encoder: this.encoder});
localVarQueryParameters = this.addToHttpParams(localVarQueryParameters,
<any>topic, 'topic');
localVarQueryParameters = this.addToHttpParams(localVarQueryParameters,
<any>metric, 'metric');
let localVarHeaders = this.defaultHeaders;
const localVarHttpHeaderAcceptSelected: string | undefined = options?.httpHeaderAccept ?? this.configuration.selectHeaderAccept([
'application/json'
]);
if (localVarHttpHeaderAcceptSelected !== undefined) {
localVarHeaders = localVarHeaders.set('Accept', localVarHttpHeaderAcceptSelected);
}
const localVarHttpContext: HttpContext = options?.context ?? new HttpContext();
const localVarTransferCache: boolean = options?.transferCache ?? true;
let responseType_: 'text' | 'json' | 'blob' = 'json';
if (localVarHttpHeaderAcceptSelected) {
if (localVarHttpHeaderAcceptSelected.startsWith('text')) {
responseType_ = 'text';
} else if (this.configuration.isJsonMime(localVarHttpHeaderAcceptSelected)) {
responseType_ = 'json';
} else {
responseType_ = 'blob';
}
}
let localVarPath = `/api/inse-service/university-rankings`;
const { basePath, withCredentials } = this.configuration;
return this.httpClient.request<RankingResponse>('get', `${basePath}${localVarPath}`,
{
context: localVarHttpContext,
params: localVarQueryParameters,
responseType: <any>responseType_,
...(withCredentials ? { withCredentials } : {}),
headers: localVarHeaders,
observe: observe,
...(localVarTransferCache !== undefined ? { transferCache: localVarTransferCache } : {}),
reportProgress: reportProgress
}
);
});
}
if (countries) {
countries.forEach((element) => {
localVarQueryParameters = this.addToHttpParams(
localVarQueryParameters,
<any>element,
'countries',
/**
* Returns top institutions filtered by country/region and sorted by topic-level publications count.
* @endpoint get /api/inse-service/university-rankings/top-institutions
* @param topic Research topic
* @param region Region identifier (e.g. EU)
* @param country Country code (e.g. DE)
* @param limit Max suggestions to return
* @param observe set whether or not to return the data Observable as the body, response or events. defaults to returning the body.
* @param reportProgress flag to report request and response progress.
*/
public getTopInstitutionsApiInseServiceUniversityRankingsTopInstitutionsGet(topic: string, region?: string, country?: string, limit?: number, observe?: 'body', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable<Array<TopInstitutionItem>>;
public getTopInstitutionsApiInseServiceUniversityRankingsTopInstitutionsGet(topic: string, region?: string, country?: string, limit?: number, observe?: 'response', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable<HttpResponse<Array<TopInstitutionItem>>>;
public getTopInstitutionsApiInseServiceUniversityRankingsTopInstitutionsGet(topic: string, region?: string, country?: string, limit?: number, observe?: 'events', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable<HttpEvent<Array<TopInstitutionItem>>>;
public getTopInstitutionsApiInseServiceUniversityRankingsTopInstitutionsGet(topic: string, region?: string, country?: string, limit?: number, observe: any = 'body', reportProgress: boolean = false, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable<any> {
if (topic === null || topic === undefined) {
throw new Error('Required parameter topic was null or undefined when calling getTopInstitutionsApiInseServiceUniversityRankingsTopInstitutionsGet.');
}
let localVarQueryParameters = new HttpParams({encoder: this.encoder});
localVarQueryParameters = this.addToHttpParams(localVarQueryParameters,
<any>topic, 'topic');
localVarQueryParameters = this.addToHttpParams(localVarQueryParameters,
<any>region, 'region');
localVarQueryParameters = this.addToHttpParams(localVarQueryParameters,
<any>country, 'country');
localVarQueryParameters = this.addToHttpParams(localVarQueryParameters,
<any>limit, 'limit');
let localVarHeaders = this.defaultHeaders;
const localVarHttpHeaderAcceptSelected: string | undefined = options?.httpHeaderAccept ?? this.configuration.selectHeaderAccept([
'application/json'
]);
if (localVarHttpHeaderAcceptSelected !== undefined) {
localVarHeaders = localVarHeaders.set('Accept', localVarHttpHeaderAcceptSelected);
}
const localVarHttpContext: HttpContext = options?.context ?? new HttpContext();
const localVarTransferCache: boolean = options?.transferCache ?? true;
let responseType_: 'text' | 'json' | 'blob' = 'json';
if (localVarHttpHeaderAcceptSelected) {
if (localVarHttpHeaderAcceptSelected.startsWith('text')) {
responseType_ = 'text';
} else if (this.configuration.isJsonMime(localVarHttpHeaderAcceptSelected)) {
responseType_ = 'json';
} else {
responseType_ = 'blob';
}
}
let localVarPath = `/api/inse-service/university-rankings/top-institutions`;
const { basePath, withCredentials } = this.configuration;
return this.httpClient.request<Array<TopInstitutionItem>>('get', `${basePath}${localVarPath}`,
{
context: localVarHttpContext,
params: localVarQueryParameters,
responseType: <any>responseType_,
...(withCredentials ? { withCredentials } : {}),
headers: localVarHeaders,
observe: observe,
...(localVarTransferCache !== undefined ? { transferCache: localVarTransferCache } : {}),
reportProgress: reportProgress
}
);
});
}
if (regions) {
regions.forEach((element) => {
localVarQueryParameters = this.addToHttpParams(
localVarQueryParameters,
<any>element,
'regions',
/**
* Returns timeseries publication data for compared institutions, countries and regions.
* @endpoint get /api/inse-service/university-rankings/trend
* @param topics List of topics to analyze
* @param institutions List of OpenAlex Institution IDs
* @param countries List of country codes
* @param regions List of region identifiers
* @param observe set whether or not to return the data Observable as the body, response or events. defaults to returning the body.
* @param reportProgress flag to report request and response progress.
*/
public getTrendApiInseServiceUniversityRankingsTrendGet(topics: Array<string>, institutions?: Array<string>, countries?: Array<string>, regions?: Array<string>, observe?: 'body', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable<TrendResponse>;
public getTrendApiInseServiceUniversityRankingsTrendGet(topics: Array<string>, institutions?: Array<string>, countries?: Array<string>, regions?: Array<string>, observe?: 'response', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable<HttpResponse<TrendResponse>>;
public getTrendApiInseServiceUniversityRankingsTrendGet(topics: Array<string>, institutions?: Array<string>, countries?: Array<string>, regions?: Array<string>, observe?: 'events', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable<HttpEvent<TrendResponse>>;
public getTrendApiInseServiceUniversityRankingsTrendGet(topics: Array<string>, institutions?: Array<string>, countries?: Array<string>, regions?: Array<string>, observe: any = 'body', reportProgress: boolean = false, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable<any> {
if (topics === null || topics === undefined) {
throw new Error('Required parameter topics was null or undefined when calling getTrendApiInseServiceUniversityRankingsTrendGet.');
}
let localVarQueryParameters = new HttpParams({encoder: this.encoder});
if (topics) {
topics.forEach((element) => {
localVarQueryParameters = this.addToHttpParams(localVarQueryParameters,
<any>element, 'topics');
})
}
if (institutions) {
institutions.forEach((element) => {
localVarQueryParameters = this.addToHttpParams(localVarQueryParameters,
<any>element, 'institutions');
})
}
if (countries) {
countries.forEach((element) => {
localVarQueryParameters = this.addToHttpParams(localVarQueryParameters,
<any>element, 'countries');
})
}
if (regions) {
regions.forEach((element) => {
localVarQueryParameters = this.addToHttpParams(localVarQueryParameters,
<any>element, 'regions');
})
}
let localVarHeaders = this.defaultHeaders;
const localVarHttpHeaderAcceptSelected: string | undefined = options?.httpHeaderAccept ?? this.configuration.selectHeaderAccept([
'application/json'
]);
if (localVarHttpHeaderAcceptSelected !== undefined) {
localVarHeaders = localVarHeaders.set('Accept', localVarHttpHeaderAcceptSelected);
}
const localVarHttpContext: HttpContext = options?.context ?? new HttpContext();
const localVarTransferCache: boolean = options?.transferCache ?? true;
let responseType_: 'text' | 'json' | 'blob' = 'json';
if (localVarHttpHeaderAcceptSelected) {
if (localVarHttpHeaderAcceptSelected.startsWith('text')) {
responseType_ = 'text';
} else if (this.configuration.isJsonMime(localVarHttpHeaderAcceptSelected)) {
responseType_ = 'json';
} else {
responseType_ = 'blob';
}
}
let localVarPath = `/api/inse-service/university-rankings/trend`;
const { basePath, withCredentials } = this.configuration;
return this.httpClient.request<TrendResponse>('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;
const localVarHttpHeaderAcceptSelected: string | undefined =
options?.httpHeaderAccept ??
this.configuration.selectHeaderAccept(['application/json']);
if (localVarHttpHeaderAcceptSelected !== undefined) {
localVarHeaders = localVarHeaders.set(
'Accept',
localVarHttpHeaderAcceptSelected,
);
}
const localVarHttpContext: HttpContext =
options?.context ?? new HttpContext();
const localVarTransferCache: boolean = options?.transferCache ?? true;
let responseType_: 'text' | 'json' | 'blob' = 'json';
if (localVarHttpHeaderAcceptSelected) {
if (localVarHttpHeaderAcceptSelected.startsWith('text')) {
responseType_ = 'text';
} else if (
this.configuration.isJsonMime(localVarHttpHeaderAcceptSelected)
) {
responseType_ = 'json';
} else {
responseType_ = 'blob';
}
}
let localVarPath = `/api/inse-service/university-rankings/trend`;
const { basePath, withCredentials } = this.configuration;
return this.httpClient.request<TrendResponse>(
'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
+171 -197
View File
@@ -1,219 +1,193 @@
import {
HttpHeaders,
HttpParams,
HttpParameterCodec,
} from '@angular/common/http';
import { HttpHeaders, HttpParams, HttpParameterCodec } from '@angular/common/http';
import { Param } from './param';
export interface ConfigurationParameters {
/**
* @deprecated Since 5.0. Use credentials instead
*/
apiKeys?: { [key: string]: string };
username?: string;
password?: string;
/**
* @deprecated Since 5.0. Use credentials instead
*/
accessToken?: string | (() => string);
basePath?: string;
withCredentials?: boolean;
/**
* Takes care of encoding query- and form-parameters.
*/
encoder?: HttpParameterCodec;
/**
* Override the default method for encoding path parameters in various
* <a href="https://github.com/OAI/OpenAPI-Specification/blob/main/versions/3.1.0.md#style-values">styles</a>.
* <p>
* See {@link README.md} for more details
* </p>
*/
encodeParam?: (param: Param) => string;
/**
* The keys are the names in the securitySchemes section of the OpenAPI
* document. They should map to the value used for authentication
* minus any standard prefixes such as 'Basic' or 'Bearer'.
*/
credentials?: { [key: string]: string | (() => string | undefined) };
/**
* @deprecated Since 5.0. Use credentials instead
*/
apiKeys?: {[ key: string ]: string};
username?: string;
password?: string;
/**
* @deprecated Since 5.0. Use credentials instead
*/
accessToken?: string | (() => string);
basePath?: string;
withCredentials?: boolean;
/**
* Takes care of encoding query- and form-parameters.
*/
encoder?: HttpParameterCodec;
/**
* Override the default method for encoding path parameters in various
* <a href="https://github.com/OAI/OpenAPI-Specification/blob/main/versions/3.1.0.md#style-values">styles</a>.
* <p>
* See {@link README.md} for more details
* </p>
*/
encodeParam?: (param: Param) => string;
/**
* The keys are the names in the securitySchemes section of the OpenAPI
* document. They should map to the value used for authentication
* minus any standard prefixes such as 'Basic' or 'Bearer'.
*/
credentials?: {[ key: string ]: string | (() => string | undefined)};
}
export class Configuration {
/**
* @deprecated Since 5.0. Use credentials instead
*/
apiKeys?: { [key: string]: string };
username?: string;
password?: string;
/**
* @deprecated Since 5.0. Use credentials instead
*/
accessToken?: string | (() => string);
basePath?: string;
withCredentials?: boolean;
/**
* Takes care of encoding query- and form-parameters.
*/
encoder?: HttpParameterCodec;
/**
* Encoding of various path parameter
* <a href="https://github.com/OAI/OpenAPI-Specification/blob/main/versions/3.1.0.md#style-values">styles</a>.
* <p>
* See {@link README.md} for more details
* </p>
*/
encodeParam: (param: Param) => string;
/**
* The keys are the names in the securitySchemes section of the OpenAPI
* document. They should map to the value used for authentication
* minus any standard prefixes such as 'Basic' or 'Bearer'.
*/
credentials: { [key: string]: string | (() => string | undefined) };
/**
* @deprecated Since 5.0. Use credentials instead
*/
apiKeys?: {[ key: string ]: string};
username?: string;
password?: string;
/**
* @deprecated Since 5.0. Use credentials instead
*/
accessToken?: string | (() => string);
basePath?: string;
withCredentials?: boolean;
/**
* Takes care of encoding query- and form-parameters.
*/
encoder?: HttpParameterCodec;
/**
* Encoding of various path parameter
* <a href="https://github.com/OAI/OpenAPI-Specification/blob/main/versions/3.1.0.md#style-values">styles</a>.
* <p>
* See {@link README.md} for more details
* </p>
*/
encodeParam: (param: Param) => string;
/**
* The keys are the names in the securitySchemes section of the OpenAPI
* document. They should map to the value used for authentication
* minus any standard prefixes such as 'Basic' or 'Bearer'.
*/
credentials: {[ key: string ]: string | (() => string | undefined)};
constructor({
accessToken,
apiKeys,
basePath,
credentials,
encodeParam,
encoder,
password,
username,
withCredentials,
}: ConfigurationParameters = {}) {
if (apiKeys) {
this.apiKeys = apiKeys;
}
if (username !== undefined) {
this.username = username;
}
if (password !== undefined) {
this.password = password;
}
if (accessToken !== undefined) {
this.accessToken = accessToken;
}
if (basePath !== undefined) {
this.basePath = basePath;
}
if (withCredentials !== undefined) {
this.withCredentials = withCredentials;
}
if (encoder) {
this.encoder = encoder;
}
this.encodeParam =
encodeParam ?? ((param) => this.defaultEncodeParam(param));
this.credentials = credentials ?? {};
constructor({ accessToken, apiKeys, basePath, credentials, encodeParam, encoder, password, username, withCredentials }: ConfigurationParameters = {}) {
if (apiKeys) {
this.apiKeys = apiKeys;
}
if (username !== undefined) {
this.username = username;
}
if (password !== undefined) {
this.password = password;
}
if (accessToken !== undefined) {
this.accessToken = accessToken;
}
if (basePath !== undefined) {
this.basePath = basePath;
}
if (withCredentials !== undefined) {
this.withCredentials = withCredentials;
}
if (encoder) {
this.encoder = encoder;
}
this.encodeParam = encodeParam ?? (param => this.defaultEncodeParam(param));
this.credentials = credentials ?? {};
// init default HTTPBearer credential
if (!this.credentials['HTTPBearer']) {
this.credentials['HTTPBearer'] = () => {
return typeof this.accessToken === 'function'
? this.accessToken()
: this.accessToken;
};
}
}
/**
* Select the correct content-type to use for a request.
* Uses {@link Configuration#isJsonMime} to determine the correct content-type.
* If no content type is found return the first found type if the contentTypes is not empty
* @param contentTypes - the array of content types that are available for selection
* @returns the selected content-type or <code>undefined</code> if no selection could be made.
*/
public selectHeaderContentType(contentTypes: string[]): string | undefined {
if (contentTypes.length === 0) {
return undefined;
// init default HTTPBearer credential
if (!this.credentials['HTTPBearer']) {
this.credentials['HTTPBearer'] = () => {
return typeof this.accessToken === 'function'
? this.accessToken()
: this.accessToken;
};
}
}
const type = contentTypes.find((x: string) => this.isJsonMime(x));
if (type === undefined) {
return contentTypes[0];
}
return type;
}
/**
* Select the correct content-type to use for a request.
* Uses {@link Configuration#isJsonMime} to determine the correct content-type.
* If no content type is found return the first found type if the contentTypes is not empty
* @param contentTypes - the array of content types that are available for selection
* @returns the selected content-type or <code>undefined</code> if no selection could be made.
*/
public selectHeaderContentType (contentTypes: string[]): string | undefined {
if (contentTypes.length === 0) {
return undefined;
}
/**
* Select the correct accept content-type to use for a request.
* Uses {@link Configuration#isJsonMime} to determine the correct accept content-type.
* If no content type is found return the first found type if the contentTypes is not empty
* @param accepts - the array of content types that are available for selection.
* @returns the selected content-type or <code>undefined</code> if no selection could be made.
*/
public selectHeaderAccept(accepts: string[]): string | undefined {
if (accepts.length === 0) {
return undefined;
const type = contentTypes.find((x: string) => this.isJsonMime(x));
if (type === undefined) {
return contentTypes[0];
}
return type;
}
const type = accepts.find((x: string) => this.isJsonMime(x));
if (type === undefined) {
return accepts[0];
/**
* Select the correct accept content-type to use for a request.
* Uses {@link Configuration#isJsonMime} to determine the correct accept content-type.
* If no content type is found return the first found type if the contentTypes is not empty
* @param accepts - the array of content types that are available for selection.
* @returns the selected content-type or <code>undefined</code> if no selection could be made.
*/
public selectHeaderAccept(accepts: string[]): string | undefined {
if (accepts.length === 0) {
return undefined;
}
const type = accepts.find((x: string) => this.isJsonMime(x));
if (type === undefined) {
return accepts[0];
}
return type;
}
return type;
}
/**
* Check if the given MIME is a JSON MIME.
* JSON MIME examples:
* application/json
* application/json; charset=UTF8
* APPLICATION/JSON
* application/vnd.company+json
* @param mime - MIME (Multipurpose Internet Mail Extensions)
* @return True if the given MIME is JSON, false otherwise.
*/
public isJsonMime(mime: string): boolean {
const jsonMime: RegExp = new RegExp(
'^(application\/json|[^;/ \t]+\/[^;/ \t]+[+]json)[ \t]*(;.*)?$',
'i',
);
return (
mime !== null &&
(jsonMime.test(mime) ||
mime.toLowerCase() === 'application/json-patch+json')
);
}
/**
* Check if the given MIME is a JSON MIME.
* JSON MIME examples:
* application/json
* application/json; charset=UTF8
* APPLICATION/JSON
* application/vnd.company+json
* @param mime - MIME (Multipurpose Internet Mail Extensions)
* @return True if the given MIME is JSON, false otherwise.
*/
public isJsonMime(mime: string): boolean {
const jsonMime: RegExp = new RegExp('^(application\/json|[^;/ \t]+\/[^;/ \t]+[+]json)[ \t]*(;.*)?$', 'i');
return mime !== null && (jsonMime.test(mime) || mime.toLowerCase() === 'application/json-patch+json');
}
public lookupCredential(key: string): string | undefined {
const value = this.credentials[key];
return typeof value === 'function' ? value() : value;
}
public lookupCredential(key: string): string | undefined {
const value = this.credentials[key];
return typeof value === 'function'
? value()
: value;
}
public addCredentialToHeaders(
credentialKey: string,
headerName: string,
headers: HttpHeaders,
prefix?: string,
): HttpHeaders {
const value = this.lookupCredential(credentialKey);
return value ? headers.set(headerName, (prefix ?? '') + value) : headers;
}
public addCredentialToHeaders(credentialKey: string, headerName: string, headers: HttpHeaders, prefix?: string): HttpHeaders {
const value = this.lookupCredential(credentialKey);
return value
? headers.set(headerName, (prefix ?? '') + value)
: headers;
}
public addCredentialToQuery(
credentialKey: string,
paramName: string,
query: HttpParams,
): HttpParams {
const value = this.lookupCredential(credentialKey);
return value ? query.set(paramName, value) : query;
}
public addCredentialToQuery(credentialKey: string, paramName: string, query: HttpParams): HttpParams {
const value = this.lookupCredential(credentialKey);
return value
? query.set(paramName, value)
: query;
}
private defaultEncodeParam(param: Param): string {
// This implementation exists as fallback for missing configuration
// and for backwards compatibility to older typescript-angular generator versions.
// It only works for the 'simple' parameter style.
// Date-handling only works for the 'date-time' format.
// All other styles and Date-formats are probably handled incorrectly.
//
// But: if that's all you need (i.e.: the most common use-case): no need for customization!
private defaultEncodeParam(param: Param): string {
// This implementation exists as fallback for missing configuration
// and for backwards compatibility to older typescript-angular generator versions.
// It only works for the 'simple' parameter style.
// Date-handling only works for the 'date-time' format.
// All other styles and Date-formats are probably handled incorrectly.
//
// But: if that's all you need (i.e.: the most common use-case): no need for customization!
const value =
param.dataFormat === 'date-time' && param.value instanceof Date
? (param.value as Date).toISOString()
: param.value;
const value = param.dataFormat === 'date-time' && param.value instanceof Date
? (param.value as Date).toISOString()
: param.value;
return encodeURIComponent(String(value));
}
return encodeURIComponent(String(value));
}
}
+12 -12
View File
@@ -5,16 +5,16 @@ import { HttpParameterCodec } from '@angular/common/http';
* Workaround for https://github.com/angular/angular/issues/18261
*/
export class CustomHttpParameterCodec implements HttpParameterCodec {
encodeKey(k: string): string {
return encodeURIComponent(k);
}
encodeValue(v: string): string {
return encodeURIComponent(v);
}
decodeKey(k: string): string {
return decodeURIComponent(k);
}
decodeValue(v: string): string {
return decodeURIComponent(v);
}
encodeKey(k: string): string {
return encodeURIComponent(k);
}
encodeValue(v: string): string {
return encodeURIComponent(v);
}
decodeKey(k: string): string {
return decodeURIComponent(k);
}
decodeValue(v: string): string {
return decodeURIComponent(v);
}
}
+8 -6
View File
@@ -1,7 +1,7 @@
/**
* Innovation Search Engine API
*
*
*
*
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
* https://openapi-generator.tech
@@ -9,9 +9,11 @@
*/
import { AccessToken } from './accessToken';
export interface AccessResponse {
/**
* The access token issued upon successful authentication.
*/
access_token: AccessToken;
export interface AccessResponse {
/**
* The access token issued upon successful authentication.
*/
access_token: AccessToken;
}
+43 -39
View File
@@ -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,42 +10,46 @@
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 unique identifier of the organization associated with this access token.
*/
effective_organization_id: string;
/**
* The raw string representation of the access token. This is the actual token that can be used for authentication and authorization purposes.
*/
raw_token: string;
export interface AccessToken {
/**
* The unique identifier of the real account associated with this token.
*/
real_account_id: string;
/**
* The timestamp indicating when the token will expire.
*/
expires_at: string;
/**
* The epoch value for the token. Used for versioning of tokens.
*/
epoch?: number;
/**
* The type of the token, which is always ACCESS_TOKEN for this class.
*/
token_type?: TokenType;
/**
* A unique fingerprint of the user, used for additional security checks.
*/
user_fingerprint_hash: string;
/**
* The unique identifier of the effective account associated with this access token. This may differ from the real account ID due to account impersonation.
*/
effective_account_id: string;
/**
* The specific role this access token grants within its organization.
*/
effective_role?: UserRole;
/**
* The unique identifier of the organization associated with this access token.
*/
effective_organization_id: string;
/**
* The raw string representation of the access token. This is the actual token that can be used for authentication and authorization purposes.
*/
raw_token: string;
}
export namespace AccessToken {}
export namespace AccessToken {
}
+8 -6
View File
@@ -1,7 +1,7 @@
/**
* Innovation Search Engine API
*
*
*
*
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
* https://openapi-generator.tech
@@ -9,9 +9,11 @@
*/
import { AccountProfile } from './accountProfile';
export interface AccountPage {
items: Array<AccountProfile>;
total: number;
page: number;
page_size: number;
export interface AccountPage {
items: Array<AccountProfile>;
total: number;
page: number;
page_size: number;
}
+18 -14
View File
@@ -1,7 +1,7 @@
/**
* Innovation Search Engine API
*
*
*
*
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
* https://openapi-generator.tech
@@ -9,17 +9,21 @@
*/
import { UserRole } from './userRole';
export interface AccountProfile {
id: string;
email: string;
name: string;
role: 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;
role: UserRole;
organization_id: string;
organization_name: string;
deleted: boolean;
activated: boolean;
is_current?: boolean;
is_real_account?: boolean;
is_impersonating?: boolean;
}
export namespace AccountProfile {}
export namespace AccountProfile {
}
@@ -1,7 +1,7 @@
/**
* Innovation Search Engine API
*
*
*
*
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
* https://openapi-generator.tech
@@ -9,9 +9,11 @@
*/
import { PatentEntry } from './patentEntry';
export interface AllPatentsResponse {
total: number;
page: number;
size: number;
patents: Array<PatentEntry>;
export interface AllPatentsResponse {
total: number;
page: number;
size: number;
patents: Array<PatentEntry>;
}
+21 -19
View File
@@ -1,7 +1,7 @@
/**
* Innovation Search Engine API
*
*
*
*
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
* https://openapi-generator.tech
@@ -15,25 +15,27 @@ import { AuthorIds } from './authorIds';
import { AuthorSummaryStats } from './authorSummaryStats';
import { WorkTopic } from './workTopic';
/**
* A person who creates scholarly works
*/
export interface Author {
id?: string | null;
orcid?: string | null;
display_name?: string | null;
display_name_alternatives?: Array<string> | null;
longest_name?: string | null;
parsed_longest_name?: AuthorParsedLongestName | null;
works_count?: number | null;
cited_by_count?: number | null;
summary_stats?: AuthorSummaryStats | null;
affiliations?: Array<AuthorAffiliationsInner> | null;
last_known_institutions?: Array<DehydratedInstitution> | null;
topics?: Array<WorkTopic> | null;
counts_by_year?: Array<AuthorCountsByYearInner> | null;
ids?: AuthorIds | null;
works_api_url?: string | null;
created_date?: string | null;
updated_date?: string | null;
export interface Author {
id?: string | null;
orcid?: string | null;
display_name?: string | null;
display_name_alternatives?: Array<string> | null;
longest_name?: string | null;
parsed_longest_name?: AuthorParsedLongestName | null;
works_count?: number | null;
cited_by_count?: number | null;
summary_stats?: AuthorSummaryStats | null;
affiliations?: Array<AuthorAffiliationsInner> | null;
last_known_institutions?: Array<DehydratedInstitution> | null;
topics?: Array<WorkTopic> | null;
counts_by_year?: Array<AuthorCountsByYearInner> | null;
ids?: AuthorIds | null;
works_api_url?: string | null;
created_date?: string | null;
updated_date?: 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,10 +9,12 @@
*/
import { DehydratedInstitution } from './dehydratedInstitution';
/**
* AuthorAffiliationsInner
*/
export interface AuthorAffiliationsInner {
institution?: DehydratedInstitution | null;
years?: Array<number> | null;
export interface AuthorAffiliationsInner {
institution?: DehydratedInstitution | null;
years?: Array<number> | null;
}
@@ -1,18 +1,20 @@
/**
* Innovation Search Engine API
*
*
*
*
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
* https://openapi-generator.tech
* Do not edit the class manually.
*/
/**
* AuthorCountsByYearInner
*/
export interface AuthorCountsByYearInner {
year?: number | null;
works_count?: number | null;
cited_by_count?: number | null;
export interface AuthorCountsByYearInner {
year?: number | null;
works_count?: number | null;
cited_by_count?: number | null;
}
+7 -5
View File
@@ -1,18 +1,20 @@
/**
* Innovation Search Engine API
*
*
*
*
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
* https://openapi-generator.tech
* Do not edit the class manually.
*/
/**
* External identifiers:
*/
export interface AuthorIds {
openalex?: string | null;
orcid?: string | null;
scopus?: string | null;
export interface AuthorIds {
openalex?: string | null;
orcid?: string | null;
scopus?: string | null;
}
+19 -15
View File
@@ -1,7 +1,7 @@
/**
* Innovation Search Engine API
*
*
*
*
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
* https://openapi-generator.tech
@@ -9,18 +9,22 @@
*/
import { CollaborationNetworkNodeType } from './collaborationNetworkNodeType';
export interface AuthorNetworkNode {
/**
* The raw ID of the node. For an author node, this is the raw person ID. For an institution node, this is the raw institution ID. For a work node, this is the raw work ID.
*/
raw_id: string;
/**
* The display name of the node.
*/
display_name: string;
/**
* The category of the node, either \'author\', \'institution\', or \'work\'.
*/
category: CollaborationNetworkNodeType;
export interface AuthorNetworkNode {
/**
* The raw ID of the node. For an author node, this is the raw person ID. For an institution node, this is the raw institution ID. For a work node, this is the raw work ID.
*/
raw_id: string;
/**
* The display name of the node.
*/
display_name: string;
/**
* The category of the node, either \'author\', \'institution\', or \'work\'.
*/
category: CollaborationNetworkNodeType;
}
export namespace AuthorNetworkNode {}
export namespace AuthorNetworkNode {
}
@@ -1,20 +1,22 @@
/**
* Innovation Search Engine API
*
*
*
*
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
* https://openapi-generator.tech
* Do not edit the class manually.
*/
/**
* The longest name parsed into its component parts.
*/
export interface AuthorParsedLongestName {
first?: string | null;
middle?: string | null;
last?: string | null;
suffix?: string | null;
nickname?: string | null;
export interface AuthorParsedLongestName {
first?: string | null;
middle?: string | null;
last?: string | null;
suffix?: string | null;
nickname?: string | null;
}
@@ -1,16 +1,18 @@
/**
* Innovation Search Engine API
*
*
*
*
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
* https://openapi-generator.tech
* Do not edit the class manually.
*/
export interface AuthorPositionCount {
first?: number;
middle?: number;
last?: number;
unknown?: number;
export interface AuthorPositionCount {
first?: number;
middle?: number;
last?: number;
unknown?: number;
}
@@ -1,7 +1,7 @@
/**
* Innovation Search Engine API
*
*
*
*
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
* https://openapi-generator.tech
@@ -9,11 +9,13 @@
*/
import { Model2YrMeanCitedness } from './model2YrMeanCitedness';
/**
* Citation metrics:
*/
export interface AuthorSummaryStats {
'2yr_mean_citedness'?: Model2YrMeanCitedness | null;
h_index?: number | null;
i10_index?: number | null;
export interface AuthorSummaryStats {
'2yr_mean_citedness'?: Model2YrMeanCitedness | null;
h_index?: number | null;
i10_index?: number | null;
}
@@ -0,0 +1,30 @@
/**
* Innovation Search Engine API
*
*
*
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
* https://openapi-generator.tech
* Do not edit the class manually.
*/
import { SpecificWorkPurpose } from './specificWorkPurpose';
/**
* Represents the purposes of an author, including their ID and a list of specific work purposes.
*/
export interface AuthorWorkPurposes {
/**
* The raw OpenAlex author id.
*/
raw_oa_author_id: string;
/**
* The total number of works for the author.
*/
total?: number;
/**
* The list of specific work purposes.
*/
purposes?: Array<SpecificWorkPurpose>;
}
@@ -1,24 +1,26 @@
/**
* Innovation Search Engine API
*
*
*
*
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
* https://openapi-generator.tech
* Do not edit the class manually.
*/
export interface AuthorsFilterProperties {
/**
* The list of raw institution IDs to include in the collaboration network. If empty, all institutions will be included.
*/
allowed_institutions?: Array<string>;
/**
* The minimum number of collaborations required for an author to be included in the collaboration network.
*/
min_collaborations?: number;
/**
* The maximum number of collaborations allowed for an author to be included in the collaboration network.
*/
max_collaborations?: number;
export interface AuthorsFilterProperties {
/**
* The list of raw institution IDs to include in the collaboration network. If empty, all institutions will be included.
*/
allowed_institutions?: Array<string>;
/**
* The minimum number of collaborations required for an author to be included in the collaboration network.
*/
min_collaborations?: number;
/**
* The maximum number of collaborations allowed for an author to be included in the collaboration network.
*/
max_collaborations?: number;
}
@@ -1,7 +1,7 @@
/**
* Innovation Search Engine API
*
*
*
*
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
* https://openapi-generator.tech
@@ -11,11 +11,13 @@ import { Meta } from './meta';
import { Author } from './author';
import { GroupByResult } from './groupByResult';
/**
* AuthorsListResponse
*/
export interface AuthorsListResponse {
meta?: Meta | null;
results?: Array<Author> | null;
group_by?: Array<GroupByResult> | null;
export interface AuthorsListResponse {
meta?: Meta | null;
results?: Array<Author> | null;
group_by?: Array<GroupByResult> | null;
}
+11 -9
View File
@@ -1,7 +1,7 @@
/**
* Innovation Search Engine API
*
*
*
*
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
* https://openapi-generator.tech
@@ -10,15 +10,17 @@
import { DehydratedInstitution } from './dehydratedInstitution';
import { DehydratedAuthor } from './dehydratedAuthor';
/**
* Author and their affiliation for a work
*/
export interface Authorship {
author_position?: string | null;
author?: DehydratedAuthor | null;
institutions?: Array<DehydratedInstitution> | null;
countries?: Array<string> | null;
is_corresponding?: boolean | null;
raw_author_name?: string | null;
raw_affiliation_strings?: Array<string> | null;
export interface Authorship {
author_position?: string | null;
author?: DehydratedAuthor | null;
institutions?: Array<DehydratedInstitution> | null;
countries?: Array<string> | null;
is_corresponding?: boolean | null;
raw_author_name?: string | null;
raw_affiliation_strings?: Array<string> | null;
}
@@ -1,23 +1,26 @@
/**
* Innovation Search Engine API
*
*
*
*
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
* https://openapi-generator.tech
* Do not edit the class manually.
*/
export interface AutocompleteLocationItem {
id: string;
display_name: string;
code: string;
type: AutocompleteLocationItem.TypeEnum;
export interface AutocompleteLocationItem {
id: string;
display_name: string;
code: string;
type: AutocompleteLocationItem.TypeEnum;
}
export namespace AutocompleteLocationItem {
export const TypeEnum = {
Country: 'country',
Continent: 'continent',
} as const;
export type TypeEnum = (typeof TypeEnum)[keyof typeof TypeEnum];
export const TypeEnum = {
Country: 'country',
Continent: 'continent'
} as const;
export type TypeEnum = typeof TypeEnum[keyof typeof TypeEnum];
}
@@ -1,7 +1,7 @@
/**
* Innovation Search Engine API
*
*
*
*
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
* https://openapi-generator.tech
@@ -10,10 +10,12 @@
import { AutocompleteResponseMeta } from './autocompleteResponseMeta';
import { AutocompleteResponseResultsInner } from './autocompleteResponseResultsInner';
/**
* AutocompleteResponse
*/
export interface AutocompleteResponse {
meta?: AutocompleteResponseMeta | null;
results?: Array<AutocompleteResponseResultsInner> | null;
export interface AutocompleteResponse {
meta?: AutocompleteResponseMeta | null;
results?: Array<AutocompleteResponseResultsInner> | null;
}
@@ -1,17 +1,19 @@
/**
* Innovation Search Engine API
*
*
*
*
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
* https://openapi-generator.tech
* Do not edit the class manually.
*/
/**
* AutocompleteResponseMeta
*/
export interface AutocompleteResponseMeta {
count?: number | null;
db_response_time_ms?: number | null;
export interface AutocompleteResponseMeta {
count?: number | null;
db_response_time_ms?: number | null;
}
@@ -1,22 +1,24 @@
/**
* Innovation Search Engine API
*
*
*
*
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
* https://openapi-generator.tech
* Do not edit the class manually.
*/
/**
* AutocompleteResponseResultsInner
*/
export interface AutocompleteResponseResultsInner {
id?: string | null;
display_name?: string | null;
hint?: string | null;
cited_by_count?: number | null;
works_count?: number | null;
entity_type?: string | null;
external_id?: string | null;
export interface AutocompleteResponseResultsInner {
id?: string | null;
display_name?: string | null;
hint?: string | null;
cited_by_count?: number | null;
works_count?: number | null;
entity_type?: string | null;
external_id?: string | null;
}
+10 -8
View File
@@ -1,21 +1,23 @@
/**
* Innovation Search Engine API
*
*
*
*
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
* https://openapi-generator.tech
* Do not edit the class manually.
*/
/**
* Award
*/
export interface Award {
id?: string | null;
display_name?: string | null;
funder_award_id?: string | null;
funder_id?: string | null;
funder_display_name?: string | null;
doi?: string | null;
export interface Award {
id?: string | null;
display_name?: string | null;
funder_award_id?: string | null;
funder_id?: string | null;
funder_display_name?: string | null;
doi?: string | null;
}
+12 -10
View File
@@ -1,20 +1,22 @@
/**
* Innovation Search Engine API
*
*
*
*
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
* https://openapi-generator.tech
* Do not edit the class manually.
*/
export interface BodyChangePassword {
/**
* Current password
*/
current_password: string;
/**
* New password
*/
new_password: string;
export interface BodyChangePassword {
/**
* Current password
*/
current_password: string;
/**
* New password
*/
new_password: string;
}
+12 -10
View File
@@ -1,20 +1,22 @@
/**
* Innovation Search Engine API
*
*
*
*
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
* https://openapi-generator.tech
* Do not edit the class manually.
*/
export interface BodyGetAccessToken {
/**
* User\'s account ID
*/
real_account_id: string;
/**
* Effective account ID for the access token
*/
effective_account_id: string;
export interface BodyGetAccessToken {
/**
* User\'s account ID
*/
real_account_id: string;
/**
* Effective account ID for the access token
*/
effective_account_id: string;
}
+12 -10
View File
@@ -1,20 +1,22 @@
/**
* Innovation Search Engine API
*
*
*
*
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
* https://openapi-generator.tech
* Do not edit the class manually.
*/
export interface BodyLogin {
/**
* User\'s account ID
*/
account_id: string;
/**
* One-time code sent to user\'s email
*/
email_code: string;
export interface BodyLogin {
/**
* User\'s account ID
*/
account_id: string;
/**
* One-time code sent to user\'s email
*/
email_code: string;
}
+12 -10
View File
@@ -1,20 +1,22 @@
/**
* Innovation Search Engine API
*
*
*
*
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
* https://openapi-generator.tech
* Do not edit the class manually.
*/
export interface BodyRequestOtk {
/**
* User\'s email address
*/
email: string;
/**
* User\'s password
*/
password: string;
export interface BodyRequestOtk {
/**
* User\'s email address
*/
email: string;
/**
* User\'s password
*/
password: string;
}
@@ -0,0 +1,18 @@
/**
* Innovation Search Engine API
*
*
*
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
* https://openapi-generator.tech
* Do not edit the class manually.
*/
export interface BodyRequestPasswordReset {
/**
* User\'s email address
*/
email: string;
}
@@ -0,0 +1,22 @@
/**
* Innovation Search Engine API
*
*
*
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
* https://openapi-generator.tech
* Do not edit the class manually.
*/
export interface BodyResetPassword {
/**
* Password reset token from the reset link
*/
reset_token: string;
/**
* New password
*/
new_password: string;
}
+32 -30
View File
@@ -1,40 +1,42 @@
/**
* Innovation Search Engine API
*
*
*
*
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
* https://openapi-generator.tech
* Do not edit the class manually.
*/
export interface BundProject {
funding_code?: string | null;
department?: string | null;
department_fullname?: string | null;
referat?: string | null;
project_sponsor?: string | null;
project_sponsor_fullname?: string | null;
work_unit?: string | null;
recipient?: string | null;
municipal_code?: string | null;
municipality?: string | null;
place?: string | null;
state?: string | null;
country?: string | null;
implementing_agency?: string | null;
topic?: string | null;
performance_plan_system?: string | null;
performance_plan_system_text?: string | null;
funding_start?: string | null;
funding_end?: string | null;
grant_amount?: number | null;
funding_profile?: string | null;
joint_project?: string | null;
funding_type?: string | null;
publication_date?: string | null;
unix_timestamp?: number | null;
date?: string | null;
new?: boolean | null;
duration?: string | null;
export interface BundProject {
funding_code?: string | null;
department?: string | null;
department_fullname?: string | null;
referat?: string | null;
project_sponsor?: string | null;
project_sponsor_fullname?: string | null;
work_unit?: string | null;
recipient?: string | null;
municipal_code?: string | null;
municipality?: string | null;
place?: string | null;
state?: string | null;
country?: string | null;
implementing_agency?: string | null;
topic?: string | null;
performance_plan_system?: string | null;
performance_plan_system_text?: string | null;
funding_start?: string | null;
funding_end?: string | null;
grant_amount?: number | null;
funding_profile?: string | null;
joint_project?: string | null;
funding_type?: string | null;
publication_date?: string | null;
unix_timestamp?: number | null;
date?: string | null;
'new'?: boolean | null;
duration?: string | null;
}
+44 -42
View File
@@ -1,55 +1,57 @@
/**
* Innovation Search Engine API
*
*
*
*
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
* https://openapi-generator.tech
* Do not edit the class manually.
*/
/**
* Clean summary model for a Bund (federal) project, consolidating all fields into semantic English names with proper native types.
*/
export interface BundProjectDetails {
/**
* The ID of the Bund project
*/
id: string;
funding_reference?: string | null;
title?: string | null;
description?: string | null;
joint_project?: string | null;
funding_type?: string | null;
funding_profile?: string | null;
funding_amount?: number | null;
funding_start_date?: string | null;
funding_end_date?: string | null;
duration?: string | null;
performance_plan_code?: string | null;
performance_plan_fullname?: string | null;
executing_agency?: string | null;
funding_recipient?: string | null;
project_agency?: string | null;
project_agency_fullname?: string | null;
department?: string | null;
department_fullname?: string | null;
division?: string | null;
location?: string | null;
municipality?: string | null;
state?: string | null;
country?: string | null;
municipality_code?: string | null;
publication_date?: string | null;
is_new?: boolean | null;
record_date?: string | null;
unix_timestamp?: number | null;
/**
* All persons associated with the Bund project (from nested Arb object)
*/
associated_persons?: Array<string>;
/**
* All institutions associated with the Bund project
*/
institutions?: Array<string>;
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>;
}
+20 -18
View File
@@ -1,7 +1,7 @@
/**
* Innovation Search Engine API
*
*
*
*
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
* https://openapi-generator.tech
@@ -9,21 +9,23 @@
*/
import { BundProject } from './bundProject';
export interface BundProjectPage {
/**
* The current page number.
*/
page?: number;
/**
* The requested page size.
*/
size?: number;
/**
* The total number of items.
*/
total?: number;
/**
* The bund projects on this page.
*/
elements?: Array<BundProject>;
export interface BundProjectPage {
/**
* The current page number.
*/
page?: number;
/**
* The requested page size.
*/
size?: number;
/**
* The total number of items.
*/
total?: number;
/**
* The bund projects on this page.
*/
elements?: Array<BundProject>;
}
+24 -22
View File
@@ -1,32 +1,34 @@
/**
* Innovation Search Engine API
*
*
*
*
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
* https://openapi-generator.tech
* Do not edit the class manually.
*/
export interface CareerMetrics {
first_publication_year?: number | null;
last_publication_year?: number | null;
career_age?: number | null;
career_span?: number | null;
career_stage?: string | null;
/**
* Number of distinct years with at least one publication.
*/
active_years?: number;
/**
* Number of publications used for career metrics.
*/
publication_count?: number;
publications_per_active_year?: number | null;
publications_per_career_year?: number | null;
years_since_last_publication?: number | null;
/**
* True if publication years look suspicious.
*/
has_suspicious_publication_years?: boolean;
export interface CareerMetrics {
first_publication_year?: number | null;
last_publication_year?: number | null;
career_age?: number | null;
career_span?: number | null;
career_stage?: string | null;
/**
* Number of distinct years with at least one publication.
*/
active_years?: number;
/**
* Number of publications used for career metrics.
*/
publication_count?: number;
publications_per_active_year?: number | null;
publications_per_career_year?: number | null;
years_since_last_publication?: number | null;
/**
* True if publication years look suspicious.
*/
has_suspicious_publication_years?: boolean;
}
@@ -1,7 +1,7 @@
/**
* Innovation Search Engine API
*
*
*
*
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
* https://openapi-generator.tech
@@ -13,29 +13,31 @@ import { CollaborationNetworkEdge } from './collaborationNetworkEdge';
import { InstitutionNetworkNode } from './institutionNetworkNode';
import { AuthorNetworkNode } from './authorNetworkNode';
export interface CollaborationNetwork {
/**
* The raw person ID of the person whose collaboration network this is.
*/
raw_person_id: string;
/**
* The work nodes in the collaboration network.
*/
work_nodes: Array<WorkNetworkNode>;
/**
* The author nodes in the collaboration network.
*/
author_nodes: Array<AuthorNetworkNode>;
/**
* The institution nodes in the collaboration network.
*/
institution_nodes: Array<InstitutionNetworkNode>;
/**
* The collaboration edges in the collaboration network. A collaboration edge represents a collaboration between two nodes. A -> W and A -> I
*/
collaboration_edges: Array<CollaborationNetworkEdge>;
/**
* The filter information for the collaboration network, including the minimum and maximum publication years of the works in the collaboration network.
*/
filter_information: FilterInformation;
export interface CollaborationNetwork {
/**
* The raw person ID of the person whose collaboration network this is.
*/
raw_person_id: string;
/**
* The work nodes in the collaboration network.
*/
work_nodes: Array<WorkNetworkNode>;
/**
* The author nodes in the collaboration network.
*/
author_nodes: Array<AuthorNetworkNode>;
/**
* The institution nodes in the collaboration network.
*/
institution_nodes: Array<InstitutionNetworkNode>;
/**
* The collaboration edges in the collaboration network. A collaboration edge represents a collaboration between two nodes. A -> W and A -> I
*/
collaboration_edges: Array<CollaborationNetworkEdge>;
/**
* The filter information for the collaboration network, including the minimum and maximum publication years of the works in the collaboration network.
*/
filter_information: FilterInformation;
}
@@ -1,20 +1,22 @@
/**
* Innovation Search Engine API
*
*
*
*
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
* https://openapi-generator.tech
* Do not edit the class manually.
*/
export interface CollaborationNetworkEdge {
/**
* The raw ID of the source node.
*/
raw_source_id: string;
/**
* The raw ID of the target node.
*/
raw_target_id: string;
export interface CollaborationNetworkEdge {
/**
* The raw ID of the source node.
*/
raw_source_id: string;
/**
* The raw ID of the target node.
*/
raw_target_id: string;
}
@@ -1,17 +1,18 @@
/**
* Innovation Search Engine API
*
*
*
*
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
* https://openapi-generator.tech
* Do not edit the class manually.
*/
export const CollaborationNetworkNodeType = {
Author: 'author',
Institution: 'institution',
Work: 'work',
Author: 'author',
Institution: 'institution',
Work: 'work'
} as const;
export type CollaborationNetworkNodeType =
(typeof CollaborationNetworkNodeType)[keyof typeof CollaborationNetworkNodeType];
export type CollaborationNetworkNodeType = typeof CollaborationNetworkNodeType[keyof typeof CollaborationNetworkNodeType];
+16 -14
View File
@@ -1,7 +1,7 @@
/**
* Innovation Search Engine API
*
*
*
*
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
* https://openapi-generator.tech
@@ -9,17 +9,19 @@
*/
import { MatchedOfficer } from './matchedOfficer';
export interface CompanyConnection {
company_number?: string | null;
company_name?: string | null;
company_status?: string | null;
register_art?: string | null;
register_nummer?: string | null;
native_company_number?: string | null;
registrar?: string | null;
registered_office?: string | null;
registered_address?: string | null;
retrieved_at?: string | null;
matched_officers?: Array<MatchedOfficer>;
officers?: Array<MatchedOfficer>;
export interface CompanyConnection {
company_number?: string | null;
company_name?: string | null;
company_status?: string | null;
register_art?: string | null;
register_nummer?: string | null;
native_company_number?: string | null;
registrar?: string | null;
registered_office?: string | null;
registered_address?: string | null;
retrieved_at?: string | null;
matched_officers?: Array<MatchedOfficer>;
officers?: Array<MatchedOfficer>;
}
@@ -1,7 +1,7 @@
/**
* Innovation Search Engine API
*
*
*
*
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
* https://openapi-generator.tech
@@ -9,15 +9,17 @@
*/
import { CompanyConnection } from './companyConnection';
export interface CompanyConnectionsResponse {
author_id: string;
display_name?: string | null;
is_ude_author: boolean;
institution_scope?: string | null;
matching_institutions?: Array<string>;
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;
is_ude_author: boolean;
institution_scope?: string | null;
matching_institutions?: Array<string>;
matching_method?: string | null;
company_count: number;
has_more_results: boolean;
common_name_warning: boolean;
connections?: Array<CompanyConnection>;
}
+29 -27
View File
@@ -1,7 +1,7 @@
/**
* Innovation Search Engine API
*
*
*
*
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
* https://openapi-generator.tech
@@ -10,30 +10,32 @@
import { Keywords } from './keywords';
import { Topics } from './topics';
export interface CordisEuProject {
/**
* Unique identifier for the project, typically the CORDIS ID
*/
id: string;
rcn?: string | null;
acronym?: string | null;
title?: string | null;
objective?: string | null;
frameworkProgramme?: string | null;
fundingScheme?: string | null;
legalBasis?: string | null;
masterCall?: string | null;
subCall?: string | null;
topics?: Topics | null;
nature?: string | null;
status?: string | null;
ecMaxContribution?: number | null;
totalCost?: number | null;
startDate?: string | null;
endDate?: string | null;
ecSignatureDate?: string | null;
contentUpdateDate?: string | null;
grantDoi?: string | null;
humanValidated?: boolean | null;
keywords?: Keywords | null;
export interface CordisEuProject {
/**
* Unique identifier for the project, typically the CORDIS ID
*/
id: string;
rcn?: string | null;
acronym?: string | null;
title?: string | null;
objective?: string | null;
frameworkProgramme?: string | null;
fundingScheme?: string | null;
legalBasis?: string | null;
masterCall?: string | null;
subCall?: string | null;
topics?: Topics | null;
nature?: string | null;
status?: string | null;
ecMaxContribution?: number | null;
totalCost?: number | null;
startDate?: string | null;
endDate?: string | null;
ecSignatureDate?: string | null;
contentUpdateDate?: string | null;
grantDoi?: string | null;
humanValidated?: boolean | null;
keywords?: Keywords | null;
}
+20 -18
View File
@@ -1,7 +1,7 @@
/**
* Innovation Search Engine API
*
*
*
*
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
* https://openapi-generator.tech
@@ -9,21 +9,23 @@
*/
import { CordisEuProject } from './cordisEuProject';
export interface CordisEuProjectPage {
/**
* The current page number.
*/
page?: number;
/**
* The requested page size.
*/
size?: number;
/**
* The total number of items.
*/
total?: number;
/**
* The CORDIS EU projects on this page.
*/
elements?: Array<CordisEuProject>;
export interface CordisEuProjectPage {
/**
* The current page number.
*/
page?: number;
/**
* The requested page size.
*/
size?: number;
/**
* The total number of items.
*/
total?: number;
/**
* The CORDIS EU projects on this page.
*/
elements?: Array<CordisEuProject>;
}
+5 -2
View File
@@ -1,14 +1,17 @@
/**
* Innovation Search Engine API
*
*
*
*
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
* https://openapi-generator.tech
* Do not edit the class manually.
*/
/**
* Cost of this request in USD
*/
export interface CostUsd {}
export interface CostUsd {
}
@@ -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,16 @@
*/
import { UserRole } from './userRole';
export interface CreateAccountRequest {
email: string;
name: string;
role?: UserRole;
organization_id: string;
password: string;
openalex_person_id?: string | null;
export interface CreateAccountRequest {
email: string;
name: string;
role?: UserRole;
organization_id: string;
password: string;
openalex_person_id?: string | null;
}
export namespace CreateAccountRequest {}
export namespace CreateAccountRequest {
}
@@ -1,14 +1,16 @@
/**
* Innovation Search Engine API
*
*
*
*
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
* https://openapi-generator.tech
* Do not edit the class manually.
*/
export interface CreateOrganizationRequest {
name: string;
other_inst_id?: string | null;
export interface CreateOrganizationRequest {
name: string;
other_inst_id?: string | null;
}
+23 -21
View File
@@ -1,7 +1,7 @@
/**
* Innovation Search Engine API
*
*
*
*
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
* https://openapi-generator.tech
@@ -16,24 +16,26 @@ import { AuthorIds } from './authorIds';
import { AuthorSummaryStats } from './authorSummaryStats';
import { WorkTopic } from './workTopic';
export interface CustomAuthor {
id?: string | null;
orcid?: string | null;
display_name?: string | null;
display_name_alternatives?: Array<string> | null;
longest_name?: string | null;
parsed_longest_name?: AuthorParsedLongestName | null;
works_count?: number | null;
cited_by_count?: number | null;
summary_stats?: AuthorSummaryStats | null;
affiliations?: Array<AuthorAffiliationsInner> | null;
last_known_institutions?: Array<DehydratedInstitution> | null;
topics?: Array<WorkTopic> | null;
counts_by_year?: Array<AuthorCountsByYearInner> | null;
ids?: AuthorIds | null;
works_api_url?: string | null;
created_date?: string | null;
updated_date?: string | null;
relevance_rating?: string | null;
career_metrics?: CareerMetrics | null;
export interface CustomAuthor {
id?: string | null;
orcid?: string | null;
display_name?: string | null;
display_name_alternatives?: Array<string> | null;
longest_name?: string | null;
parsed_longest_name?: AuthorParsedLongestName | null;
works_count?: number | null;
cited_by_count?: number | null;
summary_stats?: AuthorSummaryStats | null;
affiliations?: Array<AuthorAffiliationsInner> | null;
last_known_institutions?: Array<DehydratedInstitution> | null;
topics?: Array<WorkTopic> | null;
counts_by_year?: Array<AuthorCountsByYearInner> | null;
ids?: AuthorIds | null;
works_api_url?: string | null;
created_date?: string | null;
updated_date?: string | null;
relevance_rating?: string | null;
career_metrics?: CareerMetrics | null;
}
@@ -1,7 +1,7 @@
/**
* Innovation Search Engine API
*
*
*
*
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
* https://openapi-generator.tech
@@ -11,9 +11,11 @@ import { Meta } from './meta';
import { CustomAuthor } from './customAuthor';
import { GroupByResult } from './groupByResult';
export interface CustomAuthorsListResponse {
meta?: Meta | null;
results?: Array<CustomAuthor> | null;
group_by?: Array<GroupByResult> | null;
placeholder?: CustomAuthor | null;
export interface CustomAuthorsListResponse {
meta?: Meta | null;
results?: Array<CustomAuthor> | null;
group_by?: Array<GroupByResult> | null;
placeholder?: CustomAuthor | null;
}
+7 -5
View File
@@ -1,18 +1,20 @@
/**
* Innovation Search Engine API
*
*
*
*
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
* https://openapi-generator.tech
* Do not edit the class manually.
*/
/**
* [Dehydrated Author](/api-reference/authors#the-dehydratedauthor-object) — reduced-field version used in nested contexts
*/
export interface DehydratedAuthor {
id?: string | null;
display_name?: string | null;
orcid?: string | null;
export interface DehydratedAuthor {
id?: string | null;
display_name?: string | null;
orcid?: string | null;
}
+7 -5
View File
@@ -1,18 +1,20 @@
/**
* Innovation Search Engine API
*
*
*
*
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
* https://openapi-generator.tech
* Do not edit the class manually.
*/
/**
* [Dehydrated Funder](/api-reference/funders) — reduced-field version used in nested contexts
*/
export interface DehydratedFunder {
id?: string | null;
display_name?: string | null;
ror?: string | null;
export interface DehydratedFunder {
id?: string | null;
display_name?: string | null;
ror?: string | null;
}
@@ -1,21 +1,23 @@
/**
* Innovation Search Engine API
*
*
*
*
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
* https://openapi-generator.tech
* Do not edit the class manually.
*/
/**
* [Dehydrated Institution](/api-reference/institutions#the-dehydratedinstitution-object) — reduced-field version used in nested contexts
*/
export interface DehydratedInstitution {
id?: string | null;
display_name?: string | null;
ror?: string | null;
country_code?: string | null;
type?: string | null;
lineage?: Array<string> | null;
export interface DehydratedInstitution {
id?: string | null;
display_name?: string | null;
ror?: string | null;
country_code?: string | null;
type?: string | null;
lineage?: Array<string> | null;
}
+15 -13
View File
@@ -1,26 +1,28 @@
/**
* Innovation Search Engine API
*
*
*
*
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
* https://openapi-generator.tech
* Do not edit the class manually.
*/
/**
* [Dehydrated Source](/api-reference/sources#the-dehydratedsource-object) — reduced-field version used in nested contexts
*/
export interface DehydratedSource {
id?: string | null;
display_name?: string | null;
issn_l?: string | null;
issn?: Array<string> | null;
is_oa?: boolean | null;
is_in_doaj?: boolean | null;
is_core?: boolean | null;
host_organization?: string | null;
host_organization_name?: string | null;
host_organization_lineage?: Array<string> | null;
type?: string | null;
export interface DehydratedSource {
id?: string | null;
display_name?: string | null;
issn_l?: string | null;
issn?: Array<string> | null;
is_oa?: boolean | null;
is_in_doaj?: boolean | null;
is_core?: boolean | null;
host_organization?: string | null;
host_organization_name?: string | null;
host_organization_lineage?: Array<string> | null;
type?: string | null;
}
+28 -26
View File
@@ -1,39 +1,41 @@
/**
* Innovation Search Engine API
*
*
*
*
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
* https://openapi-generator.tech
* Do not edit the class manually.
*/
/**
* Clean summary model for a DFG project, consolidating all person roles and institution references into unified lists.
*/
export interface DfgProjectDetails {
/**
* The ID of the DFG project
*/
id: string;
link?: string | null;
title?: string | null;
description?: string | null;
project_identifier?: string | null;
funding_start_date?: string | null;
funding_end_date?: string | null;
dfg_procedure?: string | null;
subject_area?: string | null;
funding_type?: string | null;
international_reference?: string | null;
website?: string | null;
/**
* All persons associated with the DFG project (any role)
*/
associated_persons?: Array<string>;
/**
* All institutions associated with the DFG project
*/
institutions?: Array<string>;
subproject_of?: string | null;
export interface DfgProjectDetails {
/**
* The ID of the DFG project
*/
id: string;
link?: string | null;
title?: string | null;
description?: string | null;
project_identifier?: string | null;
funding_start_date?: string | null;
funding_end_date?: string | null;
dfg_procedure?: string | null;
subject_area?: string | null;
funding_type?: string | null;
international_reference?: string | null;
website?: string | null;
/**
* All persons associated with the DFG project (any role)
*/
associated_persons?: Array<string>;
/**
* All institutions associated with the DFG project
*/
institutions?: Array<string>;
subproject_of?: string | null;
}
+20 -18
View File
@@ -1,7 +1,7 @@
/**
* Innovation Search Engine API
*
*
*
*
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
* https://openapi-generator.tech
@@ -9,21 +9,23 @@
*/
import { DfgProjectSummary } from './dfgProjectSummary';
export interface DfgProjectPage {
/**
* The current page number.
*/
page?: number;
/**
* The requested page size.
*/
size?: number;
/**
* The total number of items.
*/
total?: number;
/**
* The DFG projects on this page.
*/
elements?: Array<DfgProjectSummary>;
export interface DfgProjectPage {
/**
* The current page number.
*/
page?: number;
/**
* The requested page size.
*/
size?: number;
/**
* The total number of items.
*/
total?: number;
/**
* The DFG projects on this page.
*/
elements?: Array<DfgProjectSummary>;
}
+17 -15
View File
@@ -1,25 +1,27 @@
/**
* Innovation Search Engine API
*
*
*
*
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
* https://openapi-generator.tech
* Do not edit the class manually.
*/
export interface DfgProjectSummary {
/**
* The unique identifier of the DFG project.
*/
id: string;
link?: string | null;
title?: string | null;
professional_classification?: string | null;
funding_start?: string | null;
funding_end?: string | null;
/**
* The names of the researchers involved in the DFG project.
*/
names?: Array<string>;
export interface DfgProjectSummary {
/**
* The unique identifier of the DFG project.
*/
id: string;
link?: string | null;
title?: string | null;
professional_classification?: string | null;
funding_start?: string | null;
funding_end?: string | null;
/**
* The names of the researchers involved in the DFG project.
*/
names?: 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,15 +9,17 @@
*/
import { EuProjectData } from './euProjectData';
/**
* Response model for EU Cordis project endpoints.
*/
export interface EuCordisProjectResponse {
/**
* Indicates if the request was successful
*/
success: boolean;
project_type?: string | null;
eu_project_data?: EuProjectData | null;
error?: string | null;
export interface EuCordisProjectResponse {
/**
* Indicates if the request was successful
*/
success: boolean;
project_type?: string | null;
eu_project_data?: EuProjectData | null;
error?: string | null;
}
@@ -1,25 +1,27 @@
/**
* Innovation Search Engine API
*
*
*
*
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
* https://openapi-generator.tech
* Do not edit the class manually.
*/
export interface EuOrganizationProjectSummary {
/**
* The unique identifier of the organization.
*/
organization_id: string;
/**
* The unique identifier of the project.
*/
project_id: string;
title?: string | null;
start_date?: string | null;
end_date?: string | null;
acronym?: string | null;
ec_contribution?: number | null;
export interface EuOrganizationProjectSummary {
/**
* The unique identifier of the organization.
*/
organization_id: string;
/**
* The unique identifier of the project.
*/
project_id: string;
title?: string | null;
start_date?: string | null;
end_date?: string | null;
acronym?: string | null;
ec_contribution?: number | null;
}
@@ -1,7 +1,7 @@
/**
* Innovation Search Engine API
*
*
*
*
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
* https://openapi-generator.tech
@@ -9,21 +9,23 @@
*/
import { EuOrganizationProjectSummary } from './euOrganizationProjectSummary';
export interface EuOrganizationProjectSummaryPage {
/**
* The current page number.
*/
page?: number;
/**
* The requested page size.
*/
size?: number;
/**
* The total number of items.
*/
total?: number;
/**
* The organization project summaries on this page.
*/
elements?: Array<EuOrganizationProjectSummary>;
export interface EuOrganizationProjectSummaryPage {
/**
* The current page number.
*/
page?: number;
/**
* The requested page size.
*/
size?: number;
/**
* The total number of items.
*/
total?: number;
/**
* The organization project summaries on this page.
*/
elements?: Array<EuOrganizationProjectSummary>;
}
+43 -41
View File
@@ -1,7 +1,7 @@
/**
* Innovation Search Engine API
*
*
*
*
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
* https://openapi-generator.tech
@@ -23,47 +23,49 @@ import { Fp7ReportSummary } from './fp7ReportSummary';
import { HEUReportSummary } from './hEUReportSummary';
import { HEUProjectDetails } from './hEUProjectDetails';
/**
* The project data
*/
export interface EuProjectData {
acronym?: string;
contentUpdateDate?: string;
ecMaxContribution?: number;
ecSignatureDate?: string;
endDate?: string;
frameworkProgramme?: string;
fundingScheme?: string;
grantDoi?: string;
humanValidated?: boolean;
id?: string;
keywords?: string;
legalBasis?: string;
masterCall?: string;
nature?: string;
objective?: string;
rcn?: string;
startDate?: string;
status?: string;
subCall?: string;
title?: string;
topics?: string;
totalCost?: number;
organizations?: Array<HEUOrganization>;
publications?: Array<HEUPublication>;
iprs?: Array<Fp7ProjectIPR>;
report_summaries?: Array<Fp7ReportSummary>;
topicsList?: Array<HEUTopic>;
web_links?: Array<Fp7WebLink>;
eurosciVoc?: Array<HEUEurosciVoc>;
legalBasisList?: Array<HEULegalBasis>;
organizationCount?: number;
publicationCount?: number;
iprCount?: number;
deliverables?: Array<HEUDeliverable>;
reportSummaries?: Array<HEUReportSummary>;
webLinks?: Array<HEUWebLink>;
ercPrincipalInvestigators?: Array<H2020ErcPI>;
deliverableCount?: number;
ercPiCount?: number;
export interface EuProjectData {
acronym?: string;
contentUpdateDate?: string;
ecMaxContribution?: number;
ecSignatureDate?: string;
endDate?: string;
frameworkProgramme?: string;
fundingScheme?: string;
grantDoi?: string;
humanValidated?: boolean;
id?: string;
keywords?: string;
legalBasis?: string;
masterCall?: string;
nature?: string;
objective?: string;
rcn?: string;
startDate?: string;
status?: string;
subCall?: string;
title?: string;
topics?: string;
totalCost?: number;
organizations?: Array<HEUOrganization>;
publications?: Array<HEUPublication>;
iprs?: Array<Fp7ProjectIPR>;
report_summaries?: Array<Fp7ReportSummary>;
topicsList?: Array<HEUTopic>;
web_links?: Array<Fp7WebLink>;
eurosciVoc?: Array<HEUEurosciVoc>;
legalBasisList?: Array<HEULegalBasis>;
organizationCount?: number;
publicationCount?: number;
iprCount?: number;
deliverables?: Array<HEUDeliverable>;
reportSummaries?: Array<HEUReportSummary>;
webLinks?: Array<HEUWebLink>;
ercPrincipalInvestigators?: Array<H2020ErcPI>;
deliverableCount?: number;
ercPiCount?: number;
}
+16 -14
View File
@@ -1,7 +1,7 @@
/**
* Innovation Search Engine API
*
*
*
*
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
* https://openapi-generator.tech
@@ -9,17 +9,19 @@
*/
import { KeywordEntryWithTopic } from './keywordEntryWithTopic';
export interface ExtractedKeywords {
/**
* The extracted broad keywords from text.
*/
broad_keywords: Array<KeywordEntryWithTopic>;
/**
* The extracted coarse-grained keywords from text.
*/
coarse_grained: Array<KeywordEntryWithTopic>;
/**
* The extracted fine-grained keywords from text.
*/
fine_grained: Array<KeywordEntryWithTopic>;
export interface ExtractedKeywords {
/**
* The extracted broad keywords from text.
*/
broad_keywords: Array<KeywordEntryWithTopic>;
/**
* The extracted coarse-grained keywords from text.
*/
coarse_grained: Array<KeywordEntryWithTopic>;
/**
* The extracted fine-grained keywords from text.
*/
fine_grained: Array<KeywordEntryWithTopic>;
}

Some files were not shown because too many files have changed in this diff Show More