diff --git a/service/src/main/inse/account_management/router.py b/service/src/main/inse/account_management/router.py index 82781fb0..81b22593 100644 --- a/service/src/main/inse/account_management/router.py +++ b/service/src/main/inse/account_management/router.py @@ -1,12 +1,11 @@ import uuid -from typing import Optional +from typing import Annotated, Optional -from fastapi import APIRouter, Depends, Query, Response, status -from sqlmodel import Session +from fastapi import APIRouter, Query, Response, status from inse.auth import service as auth_service -from inse.auth.model import AccessToken -from inse.database import get_session +from inse.auth.model import AccessTokenMetadata +from inse.database import SessionDep from inse.tags import Tags from . import service @@ -24,11 +23,10 @@ router = APIRouter(prefix="/api/accounts", tags=[Tags.AUTH]) @router.get( "/me", operation_id="getCurrentAccount", - response_model=AccountProfile, ) async def get_current_account( - session: Session = Depends(get_session), - access_token: AccessToken = auth_service.CurrentUserAccessTokenPayloadDep, + session: SessionDep, + access_token: AccessTokenMetadata = auth_service.CurrentUserAccessTokenPayloadDep, ) -> AccountProfile: return service.get_current_account(session=session, access_token=access_token) @@ -36,16 +34,15 @@ async def get_current_account( @router.get( "", operation_id="listAccounts", - response_model=AccountPage, ) async def list_accounts( - page: int = Query(default=0, ge=0), - page_size: int = Query(default=25, ge=1, le=100), - offset: Optional[int] = Query(default=None, ge=0), - search: Optional[str] = Query(default=None), - organization_id: Optional[uuid.UUID] = Query(default=None), - session: Session = Depends(get_session), - access_token: AccessToken = auth_service.CurrentUserAccessTokenPayloadDep, + session: SessionDep, + page: Annotated[int, Query(ge=0)] = 0, + page_size: Annotated[int, Query(ge=1, le=100)] = 10, + offset: Annotated[int, Query(ge=0)] = 0, + search: Annotated[Optional[str], Query()] = None, + organization_id: Annotated[Optional[uuid.UUID], Query()] = None, + access_token: AccessTokenMetadata = auth_service.CurrentUserAccessTokenPayloadDep, ) -> AccountPage: return service.list_accounts( session=session, @@ -61,13 +58,12 @@ async def list_accounts( @router.post( "", operation_id="createAccount", - response_model=AccountProfile, status_code=status.HTTP_201_CREATED, ) async def create_account( payload: CreateAccountRequest, - session: Session = Depends(get_session), - access_token: AccessToken = auth_service.CurrentUserAccessTokenPayloadDep, + session: SessionDep, + access_token: AccessTokenMetadata = auth_service.CurrentUserAccessTokenPayloadDep, ) -> AccountProfile: return service.create_account( session=session, @@ -79,11 +75,10 @@ async def create_account( @router.get( "/organizations", operation_id="listAccountOrganizations", - response_model=list[OrganizationProfile], ) async def list_organizations( - session: Session = Depends(get_session), - access_token: AccessToken = auth_service.CurrentUserAccessTokenPayloadDep, + session: SessionDep, + access_token: AccessTokenMetadata = auth_service.CurrentUserAccessTokenPayloadDep, ) -> list[OrganizationProfile]: return service.list_organizations(session=session, access_token=access_token) @@ -91,13 +86,12 @@ async def list_organizations( @router.put( "/{account_id}", operation_id="updateAccount", - response_model=AccountProfile, ) async def update_account( account_id: uuid.UUID, payload: UpdateAccountRequest, - session: Session = Depends(get_session), - access_token: AccessToken = auth_service.CurrentUserAccessTokenPayloadDep, + session: SessionDep, + access_token: AccessTokenMetadata = auth_service.CurrentUserAccessTokenPayloadDep, ) -> AccountProfile: return service.update_account( session=session, @@ -114,8 +108,8 @@ async def update_account( ) async def delete_account( account_id: uuid.UUID, - session: Session = Depends(get_session), - access_token: AccessToken = auth_service.CurrentUserAccessTokenPayloadDep, + session: SessionDep, + access_token: AccessTokenMetadata = auth_service.CurrentUserAccessTokenPayloadDep, ) -> Response: service.delete_account( session=session, diff --git a/service/src/main/inse/account_management/service.py b/service/src/main/inse/account_management/service.py index 9e0362ad..b9d9dfda 100644 --- a/service/src/main/inse/account_management/service.py +++ b/service/src/main/inse/account_management/service.py @@ -5,7 +5,7 @@ from fastapi import HTTPException, status from sqlmodel import Session, func, or_, select from inse.auth import service as auth_service -from inse.auth.model import AccessToken, Account, Organization, UserRole +from inse.auth.model import AccessTokenMetadata, Account, Organization, UserRole from .model import ( AccountPage, @@ -28,7 +28,7 @@ def _role_allowed_for_editor(editor_role: UserRole, role: UserRole) -> bool: return False -def _account_to_profile(account: Account, token: AccessToken) -> AccountProfile: +def _account_to_profile(account: Account, token: AccessTokenMetadata) -> AccountProfile: organization_name = account.organization.name if account.organization else "" return AccountProfile( id=account.id, @@ -55,7 +55,7 @@ def _get_account_or_404(session: Session, account_id: uuid.UUID) -> Account: return account -def _ensure_account_in_editor_scope(account: Account, token: AccessToken) -> None: +def _ensure_account_in_editor_scope(account: Account, token: AccessTokenMetadata) -> None: if token.effective_role == UserRole.SUPER_ADMIN: return if ( @@ -95,14 +95,14 @@ def _ensure_email_available( ) -def get_current_account(session: Session, access_token: AccessToken) -> AccountProfile: +def get_current_account(session: Session, access_token: AccessTokenMetadata) -> AccountProfile: account = _get_account_or_404(session, access_token.effective_account_id) return _account_to_profile(account, access_token) def list_accounts( session: Session, - access_token: AccessToken, + access_token: AccessTokenMetadata, page: int, page_size: int, offset: Optional[int] = None, @@ -157,7 +157,7 @@ def list_accounts( def create_account( session: Session, - access_token: AccessToken, + access_token: AccessTokenMetadata, payload: CreateAccountRequest, ) -> AccountProfile: if not _is_admin(access_token.effective_role): @@ -207,7 +207,7 @@ def create_account( def list_organizations( session: Session, - access_token: AccessToken, + access_token: AccessTokenMetadata, ) -> list[OrganizationProfile]: if access_token.effective_role == UserRole.SUPER_ADMIN: organizations = session.exec( @@ -233,7 +233,7 @@ def list_organizations( def update_account( session: Session, - access_token: AccessToken, + access_token: AccessTokenMetadata, account_id: uuid.UUID, payload: UpdateAccountRequest, ) -> AccountProfile: @@ -307,7 +307,7 @@ def update_account( def delete_account( session: Session, - access_token: AccessToken, + access_token: AccessTokenMetadata, account_id: uuid.UUID, ) -> None: account = _get_account_or_404(session, account_id) diff --git a/service/src/main/inse/auth/model.py b/service/src/main/inse/auth/model.py index bd519058..fdd687a2 100644 --- a/service/src/main/inse/auth/model.py +++ b/service/src/main/inse/auth/model.py @@ -15,9 +15,9 @@ class UserRole(StrEnum): class TokenType(StrEnum): - ID_TOKEN = "ID" - REFRESH_TOKEN = "REFRESH" - ACCESS_TOKEN = "ACCESS" + ID_TOKEN = "ID_TOKEN" + REFRESH_TOKEN = "REFRESH_TOKEN" + ACCESS_TOKEN = "ACCESS_TOKEN" class Durable(SQLModel): @@ -129,37 +129,20 @@ class Secret(SQLModel, table=True): ) -class Token(BaseModel): - token_type: TokenType = Field( - description="The type of the token (ID, Refresh, or Access).", - ) +class BaseTokenData(BaseModel): real_account_id: uuid.UUID = Field( - nullable=False, description="The unique identifier of the real account associated with this token.", ) expires_at: datetime = Field( - index=True, - nullable=False, description="The timestamp indicating when the token will expire.", ) epoch: int = Field( default=0, - nullable=False, description="The epoch value for the token. Used for versioning of tokens.", ) - user_fingerprint_hash: str = Field( - index=True, - nullable=False, - description="A hash of the user's fingerprint to ensure the token is used by the same user.", - ) - raw_token: str = Field( - index=False, - nullable=False, - description="The raw token string.", - ) -class IdToken(Token): +class IdTokenMetadata(BaseTokenData): token_type: TokenType = Field( default=TokenType.ID_TOKEN, const=True, @@ -167,24 +150,23 @@ class IdToken(Token): ) -class AccessToken(Token): +class AccessTokenMetadata(BaseTokenData): token_type: TokenType = Field( default=TokenType.ACCESS_TOKEN, const=True, description="The type of the token, which is always ACCESS_TOKEN for this class.", ) + user_fingerprint_hash: str = Field( + description="A unique fingerprint of the user, used for additional security checks.", + ) effective_account_id: uuid.UUID = Field( - nullable=False, description="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_role: UserRole = Field( default=UserRole.USER, - index=True, - nullable=False, description="The specific role this access token grants within its organization.", ) effective_organization_id: uuid.UUID = Field( - nullable=False, description="The unique identifier of the organization associated with this access token.", ) @@ -197,22 +179,50 @@ class AccessToken(Token): return self.effective_account_id != self.real_account_id -class RefreshToken(AccessToken): +class AccessToken(AccessTokenMetadata): + raw_token: str = Field( + description="The raw string representation of the access token. This is the actual token that can be used for authentication and authorization purposes.", + ) + + +class RefreshTokenMetadata(BaseTokenData): token_type: TokenType = Field( default=TokenType.REFRESH_TOKEN, const=True, description="The type of the token, which is always REFRESH_TOKEN for this class.", ) + effective_account_id: uuid.UUID = Field( + description="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_role: UserRole = Field( + default=UserRole.USER, + description="The specific role this access token grants within its organization.", + ) + effective_organization_id: uuid.UUID = Field( + description="The unique identifier of the organization associated with this access token.", + ) + + +class RefreshToken(RefreshTokenMetadata): + raw_token: str = Field( + description="The raw string representation of the refresh token. This is the actual token that can be used to obtain new access tokens.", + ) class LoginResponse(BaseModel): - id_token: IdToken = Field(description="The ID token issued upon successful login.") + id_token: IdTokenMetadata = Field( + description="The ID token issued upon successful login." + ) class AccessResponse(BaseModel): access_token: AccessToken = Field( description="The access token issued upon successful authentication." ) - refresh_token: RefreshToken = Field( - description="The refresh token issued alongside the access token for obtaining new access tokens." + + +class OtkResponse(BaseModel): + status: str = Field(description="The status of the one-time code (OTC) request.") + account_id: uuid.UUID = Field( + description="The unique identifier of the account for which the OTC was requested." ) diff --git a/service/src/main/inse/auth/router.py b/service/src/main/inse/auth/router.py index 2ce4f52a..9c15079f 100644 --- a/service/src/main/inse/auth/router.py +++ b/service/src/main/inse/auth/router.py @@ -12,9 +12,11 @@ from inse.database import SessionDep, get_session from inse.auth.model import ( AccessResponse, AccessToken, - IdToken, + AccessTokenMetadata, + IdTokenMetadata, LoginResponse, - RefreshToken, + OtkResponse, + RefreshTokenMetadata, ) logger = logging.getLogger(__name__) @@ -40,7 +42,7 @@ async def request_otk( session: SessionDep, email: Annotated[str, Body(description="User's email address")], password: Annotated[str, Body(description="User's password")], -): +) -> OtkResponse: return auth_service.request_otk(session=session, email=email, password=password) @@ -80,7 +82,7 @@ async def get_action_tokens( effective_account_id: Annotated[ uuid.UUID, Body(description="Effective account ID for the access token") ], - id_token: Annotated[IdToken, auth_service.CurrentUserIdTokenPayloadDep], + id_token: Annotated[IdTokenMetadata, auth_service.CurrentUserIdTokenPayloadDep], ) -> AccessResponse: logger.debug( "Generating access token for real_account_id=%s, effective_account_id=%s, id_token=%s", @@ -108,11 +110,14 @@ async def get_action_tokens( }, ) async def refresh_access_token( + response: Response, refresh_token: Annotated[ - RefreshToken, auth_service.CurrentUserRefreshTokenPayloadDep + RefreshTokenMetadata, auth_service.CurrentUserRefreshTokenPayloadDep ], ) -> AccessToken: - return auth_service.refresh_access_token(refresh_token=refresh_token) + return auth_service.refresh_access_token( + response=response, refresh_token=refresh_token + ) @router.post( @@ -125,7 +130,7 @@ async def refresh_access_token( async def logout( session: Annotated[Session, Depends(get_session)], access_token: Annotated[ - AccessToken, + AccessTokenMetadata, auth_service.CurrentUserAccessTokenPayloadDep, ], ): @@ -150,7 +155,7 @@ async def change_password( Body(description="New password", min_length=8), ], access_token: Annotated[ - AccessToken, + AccessTokenMetadata, auth_service.CurrentUserAccessTokenPayloadDep, ], ): diff --git a/service/src/main/inse/auth/service.py b/service/src/main/inse/auth/service.py index 61626236..604085ab 100644 --- a/service/src/main/inse/auth/service.py +++ b/service/src/main/inse/auth/service.py @@ -4,21 +4,23 @@ import json import logging import secrets import uuid -from typing import Annotated, Any, Dict, Literal, Optional +from typing import Annotated, Any, Dict, Optional import jwt from argon2 import PasswordHasher from argon2.exceptions import InvalidHashError, VerificationError, VerifyMismatchError -from fastapi import Depends, HTTPException, Request, Response, status +from fastapi import Cookie, Depends, HTTPException, Response, status from fastapi.security import HTTPAuthorizationCredentials, HTTPBearer from inse.auth.model import ( AccessResponse, AccessToken, + AccessTokenMetadata, Account, - IdToken, + IdTokenMetadata, LoginResponse, Organization, - RefreshToken, + OtkResponse, + RefreshTokenMetadata, Secret, TokenType, UserRole, @@ -28,9 +30,9 @@ from inse.database import get_session from sqlmodel import Session, select, func from inse.auth.email_service import send_email -ID_TOKEN_EXPIRATION_MINUTES = 60 * 24 * 30 # 30 days -REFRESH_TOKEN_EXPIRATION_MINUTES = 15 # 15 minutes -ACCESS_TOKEN_EXPIRATION_MINUTES = 5 # 5 minutes +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 @@ -41,8 +43,11 @@ EFFECTIVE_ORGANIZATION_ID_KEY = "effective_organization_id" EPOCH_KEY = "epoch" USER_FINGERPRINT_HASH_KEY = "user_fingerprint_hash" -ID_FP_COOKIE_KEY = "_Secure-Fgp-ID" -ACT_FP_COOKIE_KEY = "_Secure-Fgp-Act" + +ACCESS_FP_COOKIE_KEY = "_Secure-Fgp-Acc" +ID_TOKEN_COOKIE_KEY = "id_token" +REFRESH_TOKEN_COOKIE_KEY = "refresh_token" + settings = get_settings() @@ -155,7 +160,7 @@ def _verify_password(password: str, password_hash: str) -> bool: return False -def request_otk(session: Session, email: str, password: str): +def request_otk(session: Session, email: str, password: str) -> OtkResponse: """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: @@ -180,11 +185,7 @@ def request_otk(session: Session, email: str, password: str): logger.debug("OTK request for email %s: account found: %s", email, account) - if ( - account is None - or account.deleted - or account.id is None - ): + if account is None or account.deleted or account.id is None: logger.warning("OTK request failed for email %s: account not found", email) raise HTTPException( status_code=status.HTTP_401_UNAUTHORIZED, @@ -247,7 +248,7 @@ def request_otk(session: Session, email: str, password: str): else: logger.info("OTK generated for account %s", account.id) - return {"status": "ok", "account_id": str(account.id)} + return OtkResponse(status="success", account_id=account.id) def login( @@ -331,9 +332,9 @@ def login( def _get_current_user_access_token_payload( session: Annotated[Session, Depends(get_session)], - request: Request, credentials: Annotated[HTTPAuthorizationCredentials, Depends(security_scheme)], -) -> AccessToken: + secure_fgp: Annotated[str | None, Cookie(alias=ACCESS_FP_COOKIE_KEY)] = None, +) -> AccessTokenMetadata: """Extracts and verifies the current user's access token payload from the request, ensuring that the token's fingerprint matches the one stored in the cookies. Args: @@ -344,18 +345,22 @@ def _get_current_user_access_token_payload( Returns: AccessToken: The verified access token payload. """ + if secure_fgp is None: + raise HTTPException( + status_code=status.HTTP_401_UNAUTHORIZED, + detail="Access fingerprint cookie is missing", + ) token = credentials.credentials - access_token_payload = _verify_fp_token( - request=request, - cookie_key=ACT_FP_COOKIE_KEY, - token=token, + access_token_payload = _verify_access_token_fp( + secure_fgp=secure_fgp, + raw_access_token=token, session=session, ) # If reaches here, the access token is valid and the fingerprint matches - return AccessToken( + return AccessTokenMetadata( real_account_id=uuid.UUID(access_token_payload[REAL_ACCOUNT_ID_KEY]), effective_account_id=uuid.UUID(access_token_payload[EFFECTIVE_ACCOUNT_ID_KEY]), expires_at=datetime.datetime.fromtimestamp( @@ -367,15 +372,13 @@ def _get_current_user_access_token_payload( access_token_payload[EFFECTIVE_ORGANIZATION_ID_KEY] ), user_fingerprint_hash=access_token_payload[USER_FINGERPRINT_HASH_KEY], - raw_token=token, ) def _get_current_user_refresh_token_payload( session: Annotated[Session, Depends(get_session)], - request: Request, - credentials: Annotated[HTTPAuthorizationCredentials, Depends(security_scheme)], -) -> RefreshToken: + token: Annotated[str | None, Cookie(alias=REFRESH_TOKEN_COOKIE_KEY)] = None, +) -> RefreshTokenMetadata: """Extracts and verifies the current user's refresh token payload from the request, ensuring that the token's fingerprint matches the one stored in the cookies. Args: @@ -384,18 +387,20 @@ def _get_current_user_refresh_token_payload( credentials (Annotated[HTTPAuthorizationCredentials, Depends): The HTTP authorization credentials containing the refresh token. Returns: - RefreshToken: The verified refresh token payload. + RefreshTokenData: The verified refresh token payload. """ - token = credentials.credentials + if token is None: + raise HTTPException( + status_code=status.HTTP_401_UNAUTHORIZED, + detail="Refresh token cookie is missing", + ) - refresh_token_payload = _verify_fp_token( - request=request, - cookie_key=ACT_FP_COOKIE_KEY, - token=token, + refresh_token_payload = _verify_refresh_token( + raw_refresh_token=token, session=session, ) # If reaches here, the refresh token is valid and the fingerprint matches - refresh_token = RefreshToken( + refresh_token = RefreshTokenMetadata( real_account_id=uuid.UUID(refresh_token_payload[REAL_ACCOUNT_ID_KEY]), effective_account_id=uuid.UUID(refresh_token_payload[EFFECTIVE_ACCOUNT_ID_KEY]), expires_at=datetime.datetime.fromtimestamp( @@ -406,8 +411,6 @@ def _get_current_user_refresh_token_payload( effective_organization_id=uuid.UUID( refresh_token_payload[EFFECTIVE_ORGANIZATION_ID_KEY] ), - user_fingerprint_hash=refresh_token_payload[USER_FINGERPRINT_HASH_KEY], - raw_token=token, ) logger.debug("Extracted refresh token payload: %s", refresh_token) @@ -417,9 +420,8 @@ def _get_current_user_refresh_token_payload( def _get_current_user_id_token_payload( session: Annotated[Session, Depends(get_session)], - request: Request, - credentials: Annotated[HTTPAuthorizationCredentials, Depends(security_scheme)], -) -> IdToken: + token: Annotated[str | None, Cookie(alias=ID_TOKEN_COOKIE_KEY)] = None, +) -> IdTokenMetadata: """Extracts and verifies the current user's ID token payload from the request, ensuring that the token's fingerprint matches the one stored in the cookies. Args: @@ -430,30 +432,24 @@ def _get_current_user_id_token_payload( Returns: IdToken: The verified ID token payload. """ - logger.debug( - "Verifying ID token for request %s with credentials %s", - request.url, - credentials, - ) - token = credentials.credentials - logger.debug("Verifying ID token for request %s with token %s", request.url, token) + if token is None: + raise HTTPException( + status_code=status.HTTP_401_UNAUTHORIZED, + detail="ID token cookie is missing", + ) - id_token_payload = _verify_fp_token( - request=request, - cookie_key=ID_FP_COOKIE_KEY, - token=token, + id_token_payload = _verify_id_token( + raw_id_token=token, session=session, ) # If reaches here, the ID token is valid and the fingerprint matches - return IdToken( + return IdTokenMetadata( real_account_id=uuid.UUID(id_token_payload[REAL_ACCOUNT_ID_KEY]), expires_at=datetime.datetime.fromtimestamp( id_token_payload["exp"], tz=datetime.timezone.utc ), epoch=id_token_payload[EPOCH_KEY], - user_fingerprint_hash=id_token_payload[USER_FINGERPRINT_HASH_KEY], - raw_token=token, ) @@ -582,26 +578,10 @@ def _is_valid_impersonation( def get_access_token( response: Response, session: Session, - id_token: IdToken, + id_token: IdTokenMetadata, real_account_id: uuid.UUID, effective_account_id: Optional[uuid.UUID] = None, ) -> AccessResponse: - """Generates access and refresh tokens for the specified real and effective account IDs, verifying the provided ID token and ensuring that the fingerprint matches the one stored in the cookies. - - Args: - request (Request): The FastAPI request object containing the cookies. - response (Response): The FastAPI response object to which the cookies will be added. - id_token (str): The ID token to verify. - real_account_id (uuid.UUID): The unique identifier of the real account associated with this token. - effective_account_id (Optional[uuid.UUID], optional): The unique identifier of the effective account associated with this token. If not provided, it defaults to the real account ID. - - Raises: - HTTPException: If the ID token is invalid, expired, or does not match the real account ID. - HTTPException: If impersonation is not allowed. - - Returns: - AccessResponse: An object containing the generated access and refresh tokens. - """ # IMPORTANT: The ID token has already been verified by the dependency injection system, so we can trust its payload here. if real_account_id != id_token.real_account_id: @@ -616,16 +596,15 @@ def get_access_token( if effective_account_id is None: effective_account_id = real_account_id - elif effective_account_id != real_account_id: - if not _is_valid_impersonation( - session=session, - real_account_id=real_account_id, - effective_account_id=effective_account_id, - ): - raise HTTPException( - status_code=status.HTTP_403_FORBIDDEN, - detail="Impersonation not allowed", - ) + elif effective_account_id != real_account_id and not _is_valid_impersonation( + session=session, + real_account_id=real_account_id, + effective_account_id=effective_account_id, + ): + raise HTTPException( + status_code=status.HTTP_403_FORBIDDEN, + detail="Impersonation not allowed", + ) role = _get_account_role(session=session, account_id=effective_account_id) epoch = _get_account_epoch(account_id=effective_account_id, session=session) @@ -633,7 +612,7 @@ def get_access_token( session=session, account_id=effective_account_id ) - user_fingerprint_hash = _set_act_fp_cookie(response=response) + user_fingerprint_hash = _set_access_fp_cookie(response=response) access_token = _build_access_token( real_account_id=real_account_id, @@ -643,77 +622,96 @@ def get_access_token( epoch=epoch, user_fingerprint_hash=user_fingerprint_hash, ) - refresh_token = _build_refresh_token( + _set_refresh_token( + response=response, real_account_id=real_account_id, effective_account_id=effective_account_id, effective_role=role, effective_organization_id=organization_id, epoch=epoch, - user_fingerprint_hash=user_fingerprint_hash, ) return AccessResponse( access_token=access_token, - refresh_token=refresh_token, ) -def _set_id_fp_cookie(response: Response) -> str: - """Sets a secure fingerprint cookie for ID tokens and returns the hashed value of the fingerprint. +def _set_id_token_cookie(response: Response, raw_id_token: str) -> None: + """Sets a secure cookie for the ID token. Args: response (Response): The FastAPI response object to which the cookie will be added. - - Returns: - str: The hashed value of the fingerprint. + raw_id_token (str): The raw string representation of the ID token. """ - return _set_fingerprint_cookie( - response, ID_FP_COOKIE_KEY, max_age=ID_TOKEN_EXPIRATION_MINUTES * 60 + _set_token_cookie( + response=response, + cookie_name=ID_TOKEN_COOKIE_KEY, + token=raw_id_token, + max_age=ID_TOKEN_EXPIRATION_MINUTES * 60, ) -def _set_act_fp_cookie(response: Response) -> str: +def _set_refresh_token_cookie(response: Response, raw_refresh_token: str) -> None: + """Sets a secure cookie for the refresh token. + + Args: + response (Response): The FastAPI response object to which the cookie will be added. + raw_refresh_token (str): The raw string representation of the refresh token. + """ + _set_token_cookie( + response=response, + cookie_name=REFRESH_TOKEN_COOKIE_KEY, + token=raw_refresh_token, + max_age=REFRESH_TOKEN_EXPIRATION_MINUTES * 60, + ) + + +def _set_token_cookie( + response: Response, cookie_name: str, token: str, max_age: int +) -> None: + """Sets a secure cookie for the specified token. + + Args: + response (Response): The FastAPI response object to which the cookie will be added. + cookie_name (str): The name of the cookie to set. + token (str): The raw string representation of the token. + max_age (int): The maximum age of the cookie in seconds. + """ + secure = False if settings.environment == "dev" else True + response.set_cookie( + key=cookie_name, + value=token, + httponly=True, + secure=secure, + samesite="strict", + max_age=max_age, + ) + + +def _set_access_fp_cookie(response: Response) -> str: """Sets a secure fingerprint cookie for access tokens and returns the hashed value of the fingerprint. Args: response (Response): The FastAPI response object to which the cookie will be added. - Returns: - str: The hashed value of the fingerprint. - """ - return _set_fingerprint_cookie( - response, ACT_FP_COOKIE_KEY - ) # Setting no max age to make it a session cookie, which will be deleted when the browser is closed. - - -def _set_fingerprint_cookie( - response: Response, - key: Literal["__Secure-Fgp-ID", "__Secure-Fgp-Act"], - max_age: Optional[int] = None, -) -> str: - """Sets a secure fingerprint cookie and returns the hashed value of the fingerprint. - - Args: - response (Response): The FastAPI response object to which the cookie will be added. - key (Literal["__Secure-Fgp-ID", "__Secure-Fgp-Act"]): The name of the cookie to set. - max_age (Optional[int], optional): The maximum age of the cookie in seconds. Defaults to None. - Returns: str: The hashed value of the fingerprint. """ user_fingerprint = secrets.token_hex(50) secure = False if settings.environment == "dev" else True response.set_cookie( - key=key, + key=ACCESS_FP_COOKIE_KEY, value=user_fingerprint, httponly=True, secure=secure, samesite="strict", - max_age=max_age, + max_age=None, # Setting no max age to make it a session cookie, which will be deleted when the browser is closed. ) return hashlib.sha256(user_fingerprint.encode("utf-8")).hexdigest() -def refresh_access_token(refresh_token: RefreshToken) -> AccessToken: +def refresh_access_token( + response: Response, refresh_token: RefreshTokenMetadata +) -> AccessToken: """Refreshes the access token using the provided refresh token and verifies the fingerprint from the request cookies. Args: @@ -726,25 +724,7 @@ def refresh_access_token(refresh_token: RefreshToken) -> AccessToken: """ # IMPORTANT: The refresh token has already been verified by the dependency injection system, so we can trust its payload here. - return _refresh_access_token( - refresh_token=refresh_token, - ) - - -def _refresh_access_token( - refresh_token: RefreshToken, -) -> AccessToken: - """Refreshes the access token using the provided refresh token and verifies the fingerprint from the request cookies. - - Args: - request (Request): The FastAPI request object containing the cookies. - refresh_token (RefreshToken): The refresh token to verify. - current_user_epoch (int): The epoch value for the tokens. - - Returns: - AccessToken: The refreshed access token. - """ - # IMPORTANT: The refresh token has already been verified by the dependency injection system, so we can trust its payload here. + user_fingerprint_hash = _set_access_fp_cookie(response=response) return _build_access_token( real_account_id=refresh_token.real_account_id, @@ -752,7 +732,7 @@ def _refresh_access_token( effective_role=refresh_token.effective_role, effective_organization_id=refresh_token.effective_organization_id, epoch=refresh_token.epoch, - user_fingerprint_hash=refresh_token.user_fingerprint_hash, + user_fingerprint_hash=user_fingerprint_hash, ) @@ -760,7 +740,7 @@ def _build_id_token( response: Response, real_account_id: uuid.UUID, epoch: int, -) -> IdToken: +) -> IdTokenMetadata: """Builds an ID token for the specified real account ID, expiration time, and epoch, and sets the appropriate fingerprint cookie. Args: @@ -775,34 +755,31 @@ def _build_id_token( expires_at = datetime.datetime.now(datetime.timezone.utc) + datetime.timedelta( minutes=ID_TOKEN_EXPIRATION_MINUTES ) - user_fingerprint_hash = _set_id_fp_cookie(response) payload = { REAL_ACCOUNT_ID_KEY: str(real_account_id), EPOCH_KEY: epoch, - USER_FINGERPRINT_HASH_KEY: user_fingerprint_hash, } raw_token = _build_token( payload=payload, expiration_datetime=expires_at, token_type=TokenType.ID_TOKEN, ) - return IdToken( + _set_id_token_cookie(response=response, raw_id_token=raw_token) + return IdTokenMetadata( real_account_id=real_account_id, expires_at=expires_at, epoch=epoch, - user_fingerprint_hash=user_fingerprint_hash, - raw_token=raw_token, ) -def _build_refresh_token( +def _set_refresh_token( + response: Response, real_account_id: uuid.UUID, effective_account_id: uuid.UUID, effective_role: UserRole, effective_organization_id: uuid.UUID, epoch: int, - user_fingerprint_hash: str, -) -> RefreshToken: +) -> RefreshTokenMetadata: """Builds a refresh token for the specified account IDs, role, organization ID, epoch, and fingerprint hash. Args: @@ -815,7 +792,7 @@ def _build_refresh_token( user_fingerprint_hash (str): The hashed value of the user's fingerprint. Returns: - RefreshToken: The generated refresh token object. + RefreshTokenMetadata: The generated refresh token object. """ expires_at = datetime.datetime.now(datetime.timezone.utc) + datetime.timedelta( minutes=REFRESH_TOKEN_EXPIRATION_MINUTES @@ -826,7 +803,6 @@ def _build_refresh_token( EFFECTIVE_ROLE_KEY: effective_role.value, EFFECTIVE_ORGANIZATION_ID_KEY: str(effective_organization_id), EPOCH_KEY: epoch, - USER_FINGERPRINT_HASH_KEY: user_fingerprint_hash, } raw_token = _build_token( @@ -834,16 +810,14 @@ def _build_refresh_token( expiration_datetime=expires_at, token_type=TokenType.REFRESH_TOKEN, ) - - return RefreshToken( + _set_refresh_token_cookie(response=response, raw_refresh_token=raw_token) + return RefreshTokenMetadata( real_account_id=real_account_id, effective_account_id=effective_account_id, expires_at=expires_at, epoch=epoch, effective_role=effective_role, effective_organization_id=effective_organization_id, - user_fingerprint_hash=user_fingerprint_hash, - raw_token=raw_token, ) @@ -930,18 +904,57 @@ def _build_token( return token -def _verify_fp_token( - request: Request, - cookie_key: str, - token: str, - session: Session, -) -> Dict[str, Any]: - """Verifies the provided token against the fingerprint stored in the specified cookie and returns the decoded payload if valid. +def _verify_id_token(raw_id_token: str, session: Session) -> Dict[str, Any]: + """Verifies the provided ID token and returns the decoded payload if valid. Args: - request (Request): The FastAPI request object containing the cookies. - cookie_key (str): The name of the cookie that contains the fingerprint. - token (str): The JWT token to verify. + raw_id_token (str): The JWT ID token to verify. + session (Session): The database session. + + Raises: + ValueError: If the token HMAC key is not set in the configuration. + HTTPException: If the token has expired. + HTTPException: If the token is invalid. + HTTPException: If the token's epoch does not match the current user epoch. + + Returns: + Dict[str, Any]: The decoded payload of the JWT ID token if verification is successful. + """ + payload = _extract_valid_token_payload(session, raw_id_token) + return payload + + +def _verify_refresh_token(raw_refresh_token: str, session: Session) -> Dict[str, Any]: + """Verifies the provided refresh token and returns the decoded payload if valid. + + Args: + raw_refresh_token (str): The JWT refresh token to verify. + session (Session): The database session. + + Raises: + ValueError: If the token HMAC key is not set in the configuration. + HTTPException: If the token has expired. + HTTPException: If the token is invalid. + HTTPException: If the token's epoch does not match the current user epoch. + + Returns: + Dict[str, Any]: The decoded payload of the JWT refresh token if verification is successful. + """ + payload = _extract_valid_token_payload(session, raw_refresh_token) + return payload + + +def _verify_access_token_fp( + secure_fgp: str, + raw_access_token: str, + session: Session, +) -> Dict[str, Any]: + """Verifies the provided accesstoken against the fingerprint stored in the specified cookie and returns the decoded payload if valid. + + Args: + secure_fgp (str): The secure fingerprint value. + raw_access_token (str): The JWT token to verify. + session (Session): The database session. Raises: ValueError: If the token HMAC key is not set in the configuration. @@ -953,19 +966,29 @@ def _verify_fp_token( Returns: Dict[str, Any]: The decoded payload of the JWT token if verification is successful. """ - if not settings.token_hmac_key: - raise ValueError("Token HMAC key is not set in the configuration.") - - secure_fgp = request.cookies.get(cookie_key) - if not secure_fgp: - raise HTTPException( - status_code=status.HTTP_401_UNAUTHORIZED, - detail="Fingerprint cookie missing", - ) fingerprint_bytes = secure_fgp.encode("utf-8") expected_fingerprint_hash = hashlib.sha256(fingerprint_bytes).hexdigest() + payload = _extract_valid_token_payload(session, raw_access_token) + + token_fingerprint_hash = payload.get(USER_FINGERPRINT_HASH_KEY) + if ( + not token_fingerprint_hash + or token_fingerprint_hash != expected_fingerprint_hash + ): + raise HTTPException( + status_code=status.HTTP_401_UNAUTHORIZED, + detail="Invalid context fingerprint", + ) + + return payload + + +def _extract_valid_token_payload(session: Session, token: str): + if not settings.token_hmac_key: + raise ValueError("Token HMAC key is not set in the configuration.") + try: payload = jwt.decode( token, @@ -974,23 +997,12 @@ def _verify_fp_token( issuer=settings.token_issuer_id, ) - token_fingerprint_hash = payload.get(USER_FINGERPRINT_HASH_KEY) - if ( - not token_fingerprint_hash - or token_fingerprint_hash != expected_fingerprint_hash - ): - raise HTTPException( - status_code=status.HTTP_401_UNAUTHORIZED, - detail="Invalid context fingerprint", - ) - real_account_id = payload.get(REAL_ACCOUNT_ID_KEY) if not real_account_id: raise HTTPException( status_code=status.HTTP_401_UNAUTHORIZED, detail="Token missing real account ID", ) - epoch_account_id = uuid.UUID(real_account_id) effective_account_id = payload.get(EFFECTIVE_ACCOUNT_ID_KEY) @@ -1013,7 +1025,6 @@ def _verify_fp_token( ) return payload - except jwt.ExpiredSignatureError: raise HTTPException( status_code=status.HTTP_401_UNAUTHORIZED, @@ -1055,7 +1066,7 @@ def _get_active_account(session: Session, account_id: uuid.UUID) -> Account: return account -def logout(session: Session, access_token: AccessToken) -> Dict[str, str]: +def logout(session: Session, access_token: AccessTokenMetadata) -> Dict[str, str]: """Logout the user by incrementing the epoch of the account associated with the provided access token, effectively invalidating all existing tokens for that account. Args: @@ -1079,7 +1090,7 @@ def logout(session: Session, access_token: AccessToken) -> Dict[str, str]: def change_password( session: Session, - access_token: AccessToken, + access_token: AccessTokenMetadata, current_password: str, new_password: str, ) -> Dict[str, str]: diff --git a/service/src/main/inse/auth/test_auth_service.py b/service/src/main/inse/auth/test_auth_service.py index 0e61130c..728a61ee 100644 --- a/service/src/main/inse/auth/test_auth_service.py +++ b/service/src/main/inse/auth/test_auth_service.py @@ -14,9 +14,10 @@ from inse.auth.model import ( Account, Organization, Secret, - IdToken, AccessToken, - RefreshToken, + IdTokenMetadata, + AccessTokenMetadata, + RefreshTokenMetadata, UserRole, ) @@ -61,6 +62,19 @@ def create_org_and_account( return org, acc +def _get_cookie_value(response: Response, cookie_name: str) -> str: + for header_name, header_value in getattr(response, "raw_headers", []): + if header_name.lower() == b"set-cookie": + cookie_header = header_value.decode("latin-1") + if cookie_header.startswith(f"{cookie_name}="): + return cookie_header.split(";", 1)[0].split("=", 1)[1] + + header = response.headers.get("set-cookie") + assert header is not None + assert header.startswith(f"{cookie_name}=") + return header.split(";", 1)[0].split("=", 1)[1] + + def test_hash_and_verify_password(): pw = "s3cret-password" h = auth_service._hash_password(pw) @@ -80,8 +94,8 @@ def test_request_otk_and_login_flow(in_memory_session, settings_backup): assert acc.id is not None resp = auth_service.request_otk(in_memory_session, email, password) - assert resp["status"] == "ok" - assert resp["account_id"] == str(acc.id) + assert resp.status == "success" + assert resp.account_id == acc.id secret = in_memory_session.exec( select(Secret).where(Secret.account_id == acc.id) @@ -93,9 +107,12 @@ def test_request_otk_and_login_flow(in_memory_session, settings_backup): login_result = auth_service.login( in_memory_session, response, acc.id, secret.secret_value ) - assert isinstance(login_result.id_token, IdToken) + assert isinstance(login_result.id_token, IdTokenMetadata) assert login_result.id_token.real_account_id == acc.id - assert login_result.id_token.user_fingerprint_hash is not None + + raw_id_token = _get_cookie_value(response, auth_service.ID_TOKEN_COOKIE_KEY) + payload = auth_service._verify_id_token(raw_id_token=raw_id_token, session=in_memory_session) + assert payload[auth_service.REAL_ACCOUNT_ID_KEY] == str(acc.id) def test_token_build_verify_and_fp_checks(in_memory_session, settings_backup): @@ -108,35 +125,29 @@ def test_token_build_verify_and_fp_checks(in_memory_session, settings_backup): assert acc.id is not None response = Response() - id_token = auth_service._build_id_token(response, acc.id, acc.epoch) - assert isinstance(id_token, IdToken) + secure_fgp_hash = auth_service._set_access_fp_cookie(response) + secure_fgp = _get_cookie_value(response, auth_service.ACCESS_FP_COOKIE_KEY) + access_token = auth_service._build_access_token( + real_account_id=acc.id, + effective_account_id=acc.id, + effective_role=acc.role, + effective_organization_id=acc.organization_id, + epoch=acc.epoch, + user_fingerprint_hash=secure_fgp_hash, + ) + assert isinstance(access_token, AccessToken) - cookie_header = None - for header, value in response.headers.items(): - if header.lower() == "set-cookie": - cookie_header = value - break - assert cookie_header is not None - cookie_value = cookie_header.split("=")[1].split(";")[0] - - class DummyReq: - def __init__(self, cookies): - self.cookies = cookies - - req = DummyReq({auth_service.ID_FP_COOKIE_KEY: cookie_value}) - payload = auth_service._verify_fp_token( - request=req, - cookie_key=auth_service.ID_FP_COOKIE_KEY, - token=id_token.raw_token, + payload = auth_service._verify_access_token_fp( + secure_fgp=secure_fgp, + raw_access_token=access_token.raw_token, session=in_memory_session, ) assert payload[auth_service.REAL_ACCOUNT_ID_KEY] == str(acc.id) with pytest.raises(Exception): - auth_service._verify_fp_token( - request=DummyReq({}), - cookie_key=auth_service.ID_FP_COOKIE_KEY, - token=id_token.raw_token, + auth_service._verify_access_token_fp( + secure_fgp="bad-fingerprint", + raw_access_token=access_token.raw_token, session=in_memory_session, ) @@ -158,11 +169,30 @@ def test_access_and_refresh_token_flow(in_memory_session, settings_backup): access_response = auth_service.get_access_token( response, in_memory_session, id_token, acc.id ) - assert isinstance(access_response.access_token, AccessToken) - assert isinstance(access_response.refresh_token, RefreshToken) + assert isinstance(access_response.access_token, AccessTokenMetadata) - refreshed = auth_service.refresh_access_token(access_response.refresh_token) - assert isinstance(refreshed, AccessToken) + raw_refresh_token = _get_cookie_value(response, auth_service.REFRESH_TOKEN_COOKIE_KEY) + refresh_payload = auth_service._verify_refresh_token( + raw_refresh_token=raw_refresh_token, + session=in_memory_session, + ) + refresh_token = RefreshTokenMetadata( + real_account_id=uuid.UUID(refresh_payload[auth_service.REAL_ACCOUNT_ID_KEY]), + effective_account_id=uuid.UUID( + refresh_payload[auth_service.EFFECTIVE_ACCOUNT_ID_KEY] + ), + expires_at=_dt.datetime.fromtimestamp( + refresh_payload["exp"], tz=_dt.timezone.utc + ), + epoch=refresh_payload[auth_service.EPOCH_KEY], + effective_role=UserRole(refresh_payload[auth_service.EFFECTIVE_ROLE_KEY]), + effective_organization_id=uuid.UUID( + refresh_payload[auth_service.EFFECTIVE_ORGANIZATION_ID_KEY] + ), + ) + + refreshed = auth_service.refresh_access_token(Response(), refresh_token) + assert isinstance(refreshed, AccessTokenMetadata) assert refreshed.real_account_id == access_response.access_token.real_account_id @@ -233,6 +263,7 @@ def test_deactivated_account_is_rejected_by_active_account_lookup(in_memory_sess in_memory_session.add(account) in_memory_session.commit() + assert account.id is not None with pytest.raises(HTTPException) as error: auth_service._get_active_account(in_memory_session, account.id) @@ -268,24 +299,20 @@ def test_verify_fp_token_cookie_mismatch(in_memory_session, settings_backup): assert acc.id is not None response = Response() - id_token = auth_service._build_id_token(response, acc.id, acc.epoch) - - cookie_header = None - for header, value in response.headers.items(): - if header.lower() == "set-cookie": - cookie_header = value - break - cookie_value = cookie_header.split("=")[1].split(";")[0] # type: ignore - - class DummyReq: - def __init__(self, cookies): - self.cookies = cookies + secure_fgp_hash = auth_service._set_access_fp_cookie(response) + access_token = auth_service._build_access_token( + real_account_id=acc.id, + effective_account_id=acc.id, + effective_role=acc.role, + effective_organization_id=acc.organization_id, + epoch=acc.epoch, + user_fingerprint_hash=secure_fgp_hash, + ) with pytest.raises(HTTPException): - auth_service._verify_fp_token( - request=DummyReq({auth_service.ID_FP_COOKIE_KEY: "badcookie"}), # type: ignore - cookie_key=auth_service.ID_FP_COOKIE_KEY, - token=id_token.raw_token, + auth_service._verify_access_token_fp( + secure_fgp="badcookie", + raw_access_token=access_token.raw_token, session=in_memory_session, ) @@ -300,28 +327,25 @@ def test_token_epoch_mismatch(in_memory_session, settings_backup): assert acc.id is not None response = Response() - id_token = auth_service._build_id_token(response, acc.id, acc.epoch) - - cookie_header = None - for header, value in response.headers.items(): - if header.lower() == "set-cookie": - cookie_header = value - break - cookie_value = cookie_header.split("=")[1].split(";")[0] # type: ignore - - class DummyReq: - def __init__(self, cookies): - self.cookies = cookies + secure_fgp_hash = auth_service._set_access_fp_cookie(response) + secure_fgp = _get_cookie_value(response, auth_service.ACCESS_FP_COOKIE_KEY) + access_token = auth_service._build_access_token( + real_account_id=acc.id, + effective_account_id=acc.id, + effective_role=acc.role, + effective_organization_id=acc.organization_id, + epoch=acc.epoch, + user_fingerprint_hash=secure_fgp_hash, + ) acc.epoch += 1 in_memory_session.add(acc) in_memory_session.commit() with pytest.raises(HTTPException): - auth_service._verify_fp_token( - request=DummyReq({auth_service.ID_FP_COOKIE_KEY: cookie_value}), # type: ignore - cookie_key=auth_service.ID_FP_COOKIE_KEY, - token=id_token.raw_token, + auth_service._verify_access_token_fp( + secure_fgp=secure_fgp, + raw_access_token=access_token.raw_token, session=in_memory_session, ) @@ -336,25 +360,21 @@ def test_invalid_token_signature_raises(in_memory_session, settings_backup): assert acc.id is not None response = Response() - id_token = auth_service._build_id_token(response, acc.id, acc.epoch) + secure_fgp = auth_service._set_access_fp_cookie(response) + access_token = auth_service._build_access_token( + real_account_id=acc.id, + effective_account_id=acc.id, + effective_role=acc.role, + effective_organization_id=acc.organization_id, + epoch=acc.epoch, + user_fingerprint_hash=secure_fgp, + ) - cookie_header = None - for header, value in response.headers.items(): - if header.lower() == "set-cookie": - cookie_header = value - break - cookie_value = cookie_header.split("=")[1].split(";")[0] # type: ignore - - class DummyReq: - def __init__(self, cookies): - self.cookies = cookies - - bad_token = id_token.raw_token + "x" + bad_token = access_token.raw_token + "x" with pytest.raises(HTTPException): - auth_service._verify_fp_token( - request=DummyReq({auth_service.ID_FP_COOKIE_KEY: cookie_value}), # type: ignore - cookie_key=auth_service.ID_FP_COOKIE_KEY, - token=bad_token, + auth_service._verify_access_token_fp( + secure_fgp=secure_fgp, + raw_access_token=bad_token, session=in_memory_session, ) @@ -391,7 +411,7 @@ def test_impersonation_rules(in_memory_session, settings_backup): real_acc.id, effective_account_id=eff_acc.id, ) - assert isinstance(access_resp.access_token, AccessToken) + assert isinstance(access_resp.access_token, AccessTokenMetadata) def test_otk_regeneration_and_reuse(in_memory_session, settings_backup): @@ -425,7 +445,7 @@ def test_otk_regeneration_and_reuse(in_memory_session, settings_backup): login_res = auth_service.login( in_memory_session, Response(), acc.id, secret2.secret_value ) - assert isinstance(login_res.id_token, IdToken) + assert isinstance(login_res.id_token, IdTokenMetadata) def test_otk_deleted_after_login(in_memory_session, settings_backup): @@ -461,7 +481,7 @@ def test_access_token_fp_mismatch(in_memory_session, settings_backup): assert acc.id is not None response = Response() - raw = auth_service._set_act_fp_cookie(response) + raw_hash = auth_service._set_access_fp_cookie(response) access_token = auth_service._build_access_token( real_account_id=acc.id, @@ -469,18 +489,13 @@ def test_access_token_fp_mismatch(in_memory_session, settings_backup): effective_role=acc.role, effective_organization_id=acc.organization_id, epoch=acc.epoch, - user_fingerprint_hash=raw, + user_fingerprint_hash=raw_hash, ) - class DummyReq: - def __init__(self, cookies): - self.cookies = cookies - with pytest.raises(HTTPException): - auth_service._verify_fp_token( - request=DummyReq({auth_service.ACT_FP_COOKIE_KEY: "wrongcookie"}), # type: ignore - cookie_key=auth_service.ACT_FP_COOKIE_KEY, - token=access_token.raw_token, + auth_service._verify_access_token_fp( + secure_fgp="wrongcookie", + raw_access_token=access_token.raw_token, session=in_memory_session, ) @@ -495,34 +510,26 @@ def test_expired_jwt_token_raises(in_memory_session, settings_backup): assert acc.id is not None response = Response() - cookie_raw = auth_service._set_id_fp_cookie(response) past = _dt.datetime.now(_dt.timezone.utc) - timedelta(minutes=5) + access_fingerprint_hash = auth_service._set_access_fp_cookie(response) payload = { auth_service.REAL_ACCOUNT_ID_KEY: str(acc.id), + auth_service.EFFECTIVE_ACCOUNT_ID_KEY: str(acc.id), + auth_service.EFFECTIVE_ROLE_KEY: acc.role.value, + auth_service.EFFECTIVE_ORGANIZATION_ID_KEY: str(acc.organization_id), auth_service.EPOCH_KEY: acc.epoch, - auth_service.USER_FINGERPRINT_HASH_KEY: cookie_raw, + auth_service.USER_FINGERPRINT_HASH_KEY: access_fingerprint_hash, } bad_token = auth_service._build_token( payload=payload, expiration_datetime=past, - token_type=auth_service.TokenType.ID_TOKEN, + token_type=auth_service.TokenType.ACCESS_TOKEN, ) - class DummyReq: - def __init__(self, cookies): - self.cookies = cookies - with pytest.raises(HTTPException): - auth_service._verify_fp_token( - request=DummyReq( - { - auth_service.ID_FP_COOKIE_KEY: response.headers["set-cookie"] - .split("=")[1] - .split(";")[0] - } - ), # type: ignore - cookie_key=auth_service.ID_FP_COOKIE_KEY, - token=bad_token, + auth_service._verify_access_token_fp( + secure_fgp=_get_cookie_value(response, auth_service.ACCESS_FP_COOKIE_KEY), + raw_access_token=bad_token, session=in_memory_session, ) diff --git a/service/src/main/inse/integrations/llm.py b/service/src/main/inse/integrations/llm.py index 39924953..180edfbc 100644 --- a/service/src/main/inse/integrations/llm.py +++ b/service/src/main/inse/integrations/llm.py @@ -2,7 +2,7 @@ from openai import OpenAI, APIConnectionError from openai import AsyncOpenAI from .. import config from typing import Optional, Dict, Any - +import asyncio def call( system_prompt: str, user_prompt: str, @@ -62,7 +62,7 @@ def _get_response_format(schema, schema_name: Optional[str] = None) -> Dict[str, async def call_stream( system_prompt: str, user_prompt: str, - emit, # EventCallback + emit, model: str = None, json_schema=None, schema_name=None, @@ -98,15 +98,26 @@ async def call_stream( stream=True, ) - async for chunk in stream: - delta = chunk.choices[0].delta.content - if delta: - full_content += delta - await emit({"type": "llm_chunk", "content": delta}) + try: + async for chunk in stream: + delta = chunk.choices[0].delta.content + if delta: + full_content += delta + await emit({"type": "llm_chunk", "content": delta}) + finally: + # Always release the underlying HTTP connection, whether we + # finished normally, timed out, were cancelled, or emit() + # failed because the client disconnected. This is what + # actually tells the backend to stop generating. + await stream.close() except APIConnectionError as e: print(f"Connection error: {e}") return "" + except asyncio.CancelledError: + # Real cancellation (e.g. asyncio.wait_for timeout, or task.cancel() + # from the router) + raise except Exception as e: import traceback print(f"LLM streaming failed: {type(e).__name__}: {e}") diff --git a/service/src/main/inse/keywords/logic.py b/service/src/main/inse/keywords/logic.py index d6ae4c97..e329fb56 100644 --- a/service/src/main/inse/keywords/logic.py +++ b/service/src/main/inse/keywords/logic.py @@ -126,141 +126,6 @@ async def _get_text_content(url: str) -> str: logger.error(f"Error processing {url}: {e}") -async def extract_keywords_stream( - query: str, - mode: str, - limit: int, - emit: EventCallback, -) -> ExtractedKeywordsResponse: - start_time = time.time() - timeout_seconds = 60 # configurable - await emit(KeywordsWsEvent(type="status", step="started", message="Starte Keyword-Extraktion").model_dump()) - - if mode == "url": - await emit(KeywordsWsEvent(type="status", step="fetching_url", message=f"Extrahiere Inhalt von {query}").model_dump()) - text = await _get_text_content(query) - await emit(KeywordsWsEvent(type="status", step="content_extracted", message=f"Extrahiert {len(text)} Zeichen").model_dump()) - system_prompt = KeywordsPrompt.EXTRACT_WEBSITE_KEYWORDS_PROMPT - else: - text = query - await emit(KeywordsWsEvent(type="status", step="text_received", message=f"Empfangen {len(text)} Zeichen").model_dump()) - system_prompt = KeywordsPrompt.EXTRACT_KEYWORDS_TEXT_PROMPT - user_prompt = "\nNow analyze the following text and return ONLY the JSON object.\n" - if limit: - user_prompt += f"\nExtract exactly {limit} keywords for each level (broad, coarse, fine).\n" - user_prompt += f"\nInput:\n{text}" - - await emit(KeywordsWsEvent(type="status", step="calling_llm", message="Extrahiere Keywords...").model_dump()) - - LEVELS = ("broad_keywords", "coarse_grained", "fine_grained") - - # Holds only fully validated KeywordEntry dicts for each level - confirmed: Dict[str, List[Dict[str, Any]]] = {level: [] for level in LEVELS} - - async def emit_full_results() -> None: - """Attempt to build and validate the full ExtractedKeywordsLLM model and emit it.""" - # Build a dict with all three fields, using empty lists for missing ones - data = {level: confirmed.get(level, []) for level in LEVELS} - try: - validated = ExtractedKeywordsLLM.model_validate(data) - except ValidationError: - # Should not happen if all items are valid, but guard against it - return - await emit(KeywordsWsEvent(type="keywords", keywords=validated.model_dump()).model_dump()) - - # adds completed keyword chunks to the confirmed dict and emits the full results when new valid items are found - async def on_chunk(event: Dict[str, Any]) -> None: - if event["type"] != "llm_chunk": - await emit(event) - return - - try: - partial = partial_json_parser.loads(event.get("_full_content", "")) - except Exception: - return - - if not isinstance(partial, dict): - return - - grew = False - - for level in LEVELS: - current = partial.get(level) or [] - idx = len(confirmed[level]) - - while idx < len(current): - raw_item = current[idx] - try: - validated_item = KeywordEntry.model_validate(raw_item) - except ValidationError: - break # item not complete yet - confirmed[level].append(validated_item.model_dump()) - idx += 1 - grew = True - - if grew: - await emit_full_results() - - # Accumulate full_content for incremental parsing - full_content_holder = {"value": ""} - - async def emit_wrapper(event: Dict[str, Any]) -> None: - if event["type"] == "llm_chunk": - full_content_holder["value"] += event["content"] - event = {**event, "_full_content": full_content_holder["value"]} - await on_chunk(event) - - try: - keywords = await asyncio.wait_for( - llm.call_stream( - system_prompt=system_prompt, - user_prompt=user_prompt, - json_schema=ExtractedKeywordsLLM.model_json_schema(), - schema_name="extracted_keywords", - temperature=0.8, - top_p=0.95, - emit=emit_wrapper, - ), - timeout=timeout_seconds, - ) - except asyncio.TimeoutError: - await emit(KeywordsWsEvent(type="error", message=f"LLM call timed out after {timeout_seconds}s").model_dump()) - raise RuntimeError("LLM streaming call timed out") - except asyncio.CancelledError: - await emit(KeywordsWsEvent(type="error", message="Request cancelled").model_dump()) - raise - - if not keywords: - await emit(KeywordsWsEvent(type="error", message="LLM call failed or returned no content").model_dump()) - raise RuntimeError("LLM streaming call returned empty content") - - await emit(KeywordsWsEvent(type="status", step="parsing_response", message="Bearbeite Ergebnisse").model_dump()) - - try: - keywords_json = json.loads(keywords) - except json.JSONDecodeError as e: - await emit(KeywordsWsEvent(type="error", message=f"Invalid JSON in LLM response: {e}").model_dump()) - raise RuntimeError("LLM response is not valid JSON") - - # Final emission of the full results (in case the last chunk didn't trigger it) - final_data = {level: confirmed.get(level, []) for level in LEVELS} - try: - final_validated = ExtractedKeywordsLLM.model_validate(keywords_json) - except ValidationError: - # Fallback: use our confirmed data - final_validated = ExtractedKeywordsLLM.model_validate(final_data) - - elapsed_time = time.time() - start_time - result = ExtractedKeywordsResponse( - results=final_validated, - source=mode, - source_url=query if mode == "url" else None, - source_content=text, - duration=elapsed_time, - ) - - return result - async def extract_keywords_stream_enriched( query: str, @@ -275,13 +140,17 @@ async def extract_keywords_stream_enriched( if mode == "url": await emit(KeywordsWsEvent(type="status", step="fetching_url", message=f"Extrahiere Inhalt von {query}").model_dump()) text = await _get_text_content(query) - await emit(KeywordsWsEvent(type="status", step="content_extracted", message=f"Extrahiert {len(text)} Zeichen").model_dump()) + if text: + await emit(KeywordsWsEvent(type="status", step="content_extracted", message=f"Extrahiert {len(text)} Zeichen").model_dump()) + else: + await emit(KeywordsWsEvent(type="error", message=f"Fehler beim Abrufen des Inhalts von {query}").model_dump()) + raise RuntimeError(f"Failed to fetch content from {query}") system_prompt = KeywordsPrompt.EXTRACT_WEBSITE_KEYWORDS_PROMPT else: text = query await emit(KeywordsWsEvent(type="status", step="text_received", message=f"Empfangen {len(text)} Zeichen").model_dump()) system_prompt = KeywordsPrompt.EXTRACT_KEYWORDS_TEXT_PROMPT - + user_prompt = "\nNow analyze the following text.\n" if limit: user_prompt += f"\nExtract exactly {limit} keywords for each level.\n" @@ -290,15 +159,10 @@ async def extract_keywords_stream_enriched( await emit(KeywordsWsEvent(type="status", step="calling_llm", message="Extrahiere Keywords...").model_dump()) LEVELS = ("broad_keywords", "coarse_grained", "fine_grained") - - # Holds enriched keyword wrappers for each level confirmed: Dict[str, List[KeywordEntryWithTopic]] = {level: [] for level in LEVELS} - - # Track background enrichment tasks enrichment_tasks: List[asyncio.Task] = [] async def emit_full_results() -> None: - """Attempt to build and emit the full enriched keyword model.""" try: validated = _build_enriched_snapshot(confirmed) except ValidationError: @@ -306,29 +170,19 @@ async def extract_keywords_stream_enriched( await emit(KeywordsWsEvent(type="keywords", keywords=validated.model_dump()).model_dump()) async def get_openalex_topic(level: str, idx: int, item: KeywordEntry) -> None: - """ - Fetch/enrich metadata for a single keyword. - Runs concurrently without blocking the LLM stream. - """ try: topic = await vector_search_topics_batch( keywords=[item.keyword], search_type="hybrid", ) - # Update the shared confirmed list in-place (safe in asyncio) confirmed[level][idx].topic_mapping = topic.results[0] if topic.results else None - - # Emit the full updated set after each enrichment so the frontend sees progress. await emit_full_results() - except asyncio.CancelledError: - # If the whole request is cancelled, we can just re-raise raise except Exception as e: logger.error(f"Error fetching OpenAlex topic for keyword '{item.keyword}': {e}") await emit_full_results() - # ---------- on_chunk: parses LLM stream and appends new keywords ---------- async def on_chunk(event: Dict[str, Any]) -> None: if event["type"] != "llm_chunk": await emit(event) @@ -338,7 +192,6 @@ async def extract_keywords_stream_enriched( partial = partial_json_parser.loads(event.get("_full_content", "")) except Exception: return - if not isinstance(partial, dict): return @@ -346,19 +199,18 @@ async def extract_keywords_stream_enriched( for level in LEVELS: current = partial.get(level) or [] - start_idx = len(confirmed[level]) # Where we start appending + start_idx = len(confirmed[level]) while len(confirmed[level]) < len(current): raw_item = current[len(confirmed[level])] try: validated_item = KeywordEntry.model_validate(raw_item) except ValidationError: - break # item not complete yet + break confirmed[level].append(KeywordEntryWithTopic(llm_keyword=validated_item)) grew = True - # Launch openalex topic mapping for idx in range(start_idx, len(confirmed[level])): keyword_text = confirmed[level][idx].llm_keyword.keyword await emit( @@ -374,7 +226,6 @@ async def extract_keywords_stream_enriched( if grew: await emit_full_results() - # ---------- Accumulate full_content for incremental parsing ---------- full_content_holder = {"value": ""} async def emit_wrapper(event: Dict[str, Any]) -> None: @@ -384,6 +235,7 @@ async def extract_keywords_stream_enriched( await on_chunk(event) # ---------- Call the LLM ---------- + keywords = "" try: keywords = await asyncio.wait_for( llm.call_stream( @@ -401,14 +253,24 @@ async def extract_keywords_stream_enriched( await emit(KeywordsWsEvent(type="error", message=f"LLM call timed out after {timeout_seconds}s").model_dump()) raise RuntimeError("LLM streaming call timed out") except asyncio.CancelledError: - # Cancel all pending enrichment tasks to avoid dangling background work - for task in enrichment_tasks: - task.cancel() - if enrichment_tasks: - await asyncio.gather(*enrichment_tasks, return_exceptions=True) await emit(KeywordsWsEvent(type="error", message="Request cancelled").model_dump()) raise + finally: + if enrichment_tasks: + done, pending = await asyncio.wait(enrichment_tasks, timeout=10) + for task in pending: + task.cancel() + if pending: + await asyncio.gather(*pending, return_exceptions=True) + + if not keywords: + # Empty string covers: real empty completion, APIConnectionError, + # and disconnect-during-emit (call_stream currently swallows all + # three the same way). Treat as a failed extraction. + await emit(KeywordsWsEvent(type="error", message="LLM call failed or returned no content").model_dump()) + raise RuntimeError("LLM streaming call returned empty content") + # ---------- Finalize ---------- await emit(KeywordsWsEvent(type="status", step="parsing_response", message="Bearbeite Ergebnisse").model_dump()) @@ -418,13 +280,8 @@ async def extract_keywords_stream_enriched( await emit(KeywordsWsEvent(type="error", message=f"Invalid JSON in LLM response: {e}").model_dump()) raise RuntimeError("LLM response is not valid JSON") - # ---------- Wait for ALL pending enrichments to complete ---------- - if enrichment_tasks: - await asyncio.gather(*enrichment_tasks, return_exceptions=True) - await emit_full_results() - # Build final response try: final_validated = _build_enriched_snapshot(confirmed) except ValidationError: diff --git a/service/src/main/inse/keywords/prompts.py b/service/src/main/inse/keywords/prompts.py index f60c8fc3..adcf9a08 100644 --- a/service/src/main/inse/keywords/prompts.py +++ b/service/src/main/inse/keywords/prompts.py @@ -35,13 +35,118 @@ class KeywordsPrompt(StrEnum): --- + # STRICT GROUNDING GUARDRAIL (HIGHEST PRIORITY) + + The output must be strictly extractive and grounded in the input text. + + ## Mandatory Rules + + 1. Extract ONLY keywords, terms, entities, concepts, technologies, methods, materials, standards, diseases, applications, sectors, or noun phrases that explicitly appear in the input text. + + 2. Do NOT introduce, infer, generalize, expand, normalize, summarize, classify, enrich, or extrapolate concepts beyond what is directly present in the text. + + 3. Do NOT generate parent categories, broader domains, scientific disciplines, industries, or technology areas unless those exact terms appear in the input text. + + Example: + + Input contains: + + "transformer-based machine learning framework" + + Allowed: + + * transformer-based machine learning framework + * machine learning + * transformer + + Not allowed: + + * Artificial Intelligence + * Deep Learning + * Neural Networks + + unless those exact terms appear in the text. + + 4. Do NOT generate synonyms, abbreviations, alternate phrasings, normalized forms, or related concepts that do not explicitly appear in the source text. + + Example: + + Input: + + "large language models" + + Allowed: + + * large language models + + Not allowed: + + * LLMs + * Generative AI + * Artificial Intelligence + + unless explicitly present. + + 5. Do NOT generate implied concepts. + + Example: + + Input: + + "patient records" + + Not allowed: + + * Healthcare + * Medical Informatics + * Clinical Documentation + + unless explicitly mentioned. + + 6. Every keyword must have direct textual evidence in the input. + + 7. If a keyword cannot be highlighted verbatim or as a contiguous phrase in the source text, it must NOT appear in the output. + + 8. Prefer exact surface forms from the text. + + 9. Preserve original capitalization when possible. + + 10. Do not invent keywords to satisfy target counts. + + 11. When insufficient keywords exist for a level, return fewer keywords. + + 12. Grounding accuracy is more important than completeness. + + 13. Any keyword not directly supported by the text is considered an extraction error. + + ## Hierarchy Assignment Rules + + The hierarchy is only an organizational grouping. + + Do NOT create broader concepts to populate broad_keywords. + + If the source text contains only specific concepts, place those concepts into the most appropriate level while remaining faithful to the text. + + Do not create abstraction layers that are not explicitly present in the document. + + ## Self-Validation Before Output + + Before returning the final JSON, verify every keyword: + + * Can this exact phrase be found in the input text? + * Can a user highlight the phrase directly in the source text? + + If the answer is NO, remove the keyword. + + --- + # Keyword Hierarchy ## 1. broad_keywords - High-level domains, disciplines, industries, or technology areas. + High-level domains, disciplines, industries, technology areas, or major themes explicitly present in the text. - Examples: + Examples (only if explicitly mentioned): * Artificial Intelligence * Healthcare @@ -50,15 +155,15 @@ class KeywordsPrompt(StrEnum): * Materials Science * Robotics - These should represent the major themes of the document. + These should represent the major themes of the document when those themes are explicitly stated. --- ## 2. coarse_grained - Mid-level concepts, technologies, research areas, methods, or applications. + Mid-level concepts, technologies, research areas, methods, applications, or technical topics explicitly present in the text. - Examples: + Examples (only if explicitly mentioned): * Machine Learning * Drug Discovery @@ -73,9 +178,9 @@ class KeywordsPrompt(StrEnum): ## 3. fine_grained - Highly specific technical concepts, algorithms, materials, protocols, standards, tools, products, datasets, biomarkers, or specialized terminology. + Highly specific technical concepts, algorithms, materials, protocols, standards, tools, products, datasets, biomarkers, or specialized terminology explicitly present in the text. - Examples: + Examples (only if explicitly mentioned): * Transformer Architecture * CRISPR-Cas9 @@ -114,21 +219,56 @@ class KeywordsPrompt(StrEnum): # Extraction Rules - * Extract only concepts explicitly mentioned or strongly implied. + * Extract only concepts explicitly mentioned in the text. + * Do not use concepts that are merely implied, inferred, generalized, or derived. + * Every keyword must be directly traceable to text spans in the input. * Prefer noun phrases. * Avoid complete sentences. * Avoid duplicates across levels whenever possible. * Do not invent technologies not supported by the text. * Prefer terminology that can be searched in scientific literature databases such as OpenAlex. * Return between 5 and 15 keywords per level when sufficient information exists. + * If fewer valid keywords exist, return fewer. --- # Output Schema - Return ONLY valid JSON. + Return ONLY valid JSON using the following structure: + { + "broad_keywords": [ + { + "keyword": "string", + "relevance_score": 0.0 + } + ], + "coarse_grained": [ + { + "keyword": "string", + "relevance_score": 0.0 + } + ], + "fine_grained": [ + { + "keyword": "string", + "relevance_score": 0.0 + } + ] + } + Requirements: + + * Return ONLY valid JSON. + * Do not include explanations. + * Do not include markdown. + * Do not include comments. + * Do not include reasoning. + * Do not include any text outside the JSON object. + * Every keyword must be directly supported by the input text. + * Any keyword not explicitly present in the source text must be excluded. + + Return ONLY valid JSON matching the schema provided by the API. --- # Example 1 @@ -136,269 +276,277 @@ class KeywordsPrompt(StrEnum): Input: Researchers developed a transformer-based machine learning framework for predictive maintenance in industrial manufacturing. The system uses sensor fusion, anomaly detection, and time-series forecasting to reduce downtime in smart factories. - Output: - {"broad_keywords":[{"keyword":"ArtificialIntelligence","relevance_score":0.98},{"keyword":"Manufacturing","relevance_score":0.94},{"keyword":"IndustrialAutomation","relevance_score":0.90}],"coarse_grained":[{"keyword":"MachineLearning","relevance_score":0.96},{"keyword":"PredictiveMaintenance","relevance_score":0.95},{"keyword":"SmartFactories","relevance_score":0.88},{"keyword":"SensorFusion","relevance_score":0.86},{"keyword":"AnomalyDetection","relevance_score":0.85},{"keyword":"Time-SeriesForecasting","relevance_score":0.83}],"fine_grained":[{"keyword":"TransformerArchitecture","relevance_score":0.95},{"keyword":"IndustrialSensors","relevance_score":0.84},{"keyword":"MultimodalDataFusion","relevance_score":0.82},{"keyword":"PredictiveAnalytics","relevance_score":0.80}]} - + broad_keywords":[{"keyword":"Industrial manufacturing","relevance_score":0.94}],"coarse_grained":[{"keyword":"Machine learning","relevance_score":0.97},{"keyword":"Predictive maintenance","relevance_score":0.95},{"keyword":"Sensor fusion","relevance_score":0.89},{"keyword":"Anomaly detection","relevance_score":0.88},{"keyword":"Time-series forecasting","relevance_score":0.87},{"keyword":"Smart factories","relevance_score":0.85}],"fine_grained":[{"keyword":"Transformer-based machine learning framework","relevance_score":0.96}]} --- # Example 2 Input: - A healthcare platform uses large language models and retrieval-augmented generation to automatically summarize patient records and support clinical decision-making. - + A healthcare platform uses large language models and retrieval-augmented generation to automatically summarize patient records and support clinical decision-making. Output: - {"broad_keywords":[{"keyword":"Healthcare","relevance_score":0.97},{"keyword":"ArtificialIntelligence","relevance_score":0.95},{"keyword":"DigitalHealth","relevance_score":0.89}],"coarse_grained":[{"keyword":"LargeLanguageModels","relevance_score":0.96},{"keyword":"ClinicalDecisionSupport","relevance_score":0.92},{"keyword":"MedicalRecordAnalysis","relevance_score":0.90},{"keyword":"NaturalLanguageProcessing","relevance_score":0.88}],"fine_grained":[{"keyword":"Retrieval-AugmentedGeneration","relevance_score":0.95},{"keyword":"PatientRecordSummarization","relevance_score":0.91},{"keyword":"ClinicalDocumentation","relevance_score":0.86},{"keyword":"MedicalTextProcessing","relevance_score":0.84}]} + {"broad_keywords":[{"keyword":"Healthcare","relevance_score":0.96}],"coarse_grained":[{"keyword":"Large language models","relevance_score":0.95},{"keyword":"Clinical decision-making","relevance_score":0.91},{"keyword":"Patient records","relevance_score":0.90}],"fine_grained":[{"keyword":"Retrieval-augmented generation","relevance_score":0.94}]} Return ONLY valid JSON matching the schema provided by the API. """ EXTRACT_WEBSITE_KEYWORDS_PROMPT = """ - You are an expert technology scout, scientific analyst, and innovation intelligence specialist. + You are an expert technology scout, scientific analyst, and innovation intelligence specialist. - The input text was extracted automatically from a webpage using BeautifulSoup or a similar HTML parser. + The input text was extracted automatically from a webpage using BeautifulSoup or a similar HTML parser. - The extracted text may contain: + The extracted text may contain: - * Navigation menus - * Headers and footers - * Cookie notices - * Marketing language - * Contact information - * Repeated sections - * Calls to action - * Legal disclaimers - * Product pages - * Blog articles - * News articles - * Landing pages + * Navigation menus + * Headers and footers + * Cookie notices + * Marketing language + * Contact information + * Repeated sections + * Calls to action + * Legal disclaimers + * Product pages + * Blog articles + * News articles + * Landing pages - Your first task is to identify the actual content and purpose of the webpage. + Your first task is to identify the actual content and purpose of the webpage. - Ignore: + Ignore: - * Navigation elements - * Cookie banners - * Legal notices - * Copyright text - * Generic marketing statements - * Contact information - * Login/signup content - * Careers pages unless they contain relevant technical information - * Repeated website boilerplate + * Navigation elements + * Cookie banners + * Legal notices + * Copyright text + * Generic marketing statements + * Contact information + * Login/signup content + * Careers pages unless they contain relevant technical information + * Repeated website boilerplate - Focus only on content that helps identify: + Focus only on the primary informational content of the webpage. - * Technologies - * Scientific concepts - * Research areas - * Technical methods - * Products - * Applications - * Industrial sectors - * Materials - * Standards - * Diseases - * Engineering disciplines - * Innovation domains + --- - --- + # STRICT GROUNDING GUARDRAIL (HIGHEST PRIORITY) - # Step 1: Determine Page Type + The output must be strictly extractive and grounded in the webpage text. - Determine which type of page is represented: + ## Mandatory Rules - * Technology/Product Page - * Company Page - * Research Article - * Scientific Blog Post - * News Article - * Technical Documentation - * White Paper - * Industry Report - * Other + 1. Extract ONLY keywords, entities, concepts, technologies, methods, products, materials, standards, diseases, applications, sectors, or noun phrases that explicitly appear in the webpage text. - Use this classification internally only. + 2. Do NOT introduce, infer, generalize, normalize, classify, enrich, expand, summarize, or extrapolate concepts beyond what is directly present in the text. - Do not include it in the output. + 3. Do NOT generate broader domains, scientific disciplines, industries, technology areas, research fields, or categories unless those exact terms appear in the webpage text. - --- + Example: - # Step 2: Extract Searchable Concepts + Input: - Prioritize concepts that are useful for: + "The platform uses large language models and retrieval-augmented generation." - * OpenAlex retrieval - * Scientific literature discovery - * Patent scouting - * Technology scouting - * Innovation monitoring + Allowed: - Prefer canonical scientific terminology over marketing language. + * large language models + * retrieval-augmented generation - Examples: + Not allowed: - Prefer: + * Artificial Intelligence + * Generative AI + * Natural Language Processing - * Large Language Models + unless explicitly present. - Instead of: + 4. Do NOT generate synonyms. - * AI Assistant + Example: - Prefer: + Input: - * Smart Manufacturing + "AI assistant" - Instead of: + Allowed: - * Factory Optimization Solution + * AI assistant - Prefer: + Not allowed: - * Retrieval-Augmented Generation + * large language models + * conversational AI + * generative AI - Instead of: + unless those exact terms appear. - * Intelligent Knowledge Assistant + 5. Do NOT generate canonical scientific terminology when it does not appear in the source text. - Prefer: + 6. Do NOT rewrite marketing terms into technical terms. - * Predictive Maintenance + 7. Every keyword must have direct textual evidence in the webpage content. - Instead of: + 8. If a keyword cannot be highlighted directly in the source text, it must NOT appear in the output. - * Equipment Performance Optimization + 9. Preserve original wording whenever possible. - --- + 10. Do not invent keywords to satisfy target counts. - # Keyword Hierarchy + 11. When insufficient keywords exist, return fewer keywords. - ## broad_keywords + 12. Grounding accuracy is more important than completeness. - High-level domains, industries, disciplines, or technology areas. + 13. Any keyword not directly supported by the webpage text is considered an extraction error. - Examples: + --- - * Artificial Intelligence - * Healthcare - * Manufacturing - * Energy Storage - * Biotechnology - * Robotics + # Step 1: Determine Page Type - --- + Determine internally whether the page is: - ## coarse_grained + * Technology/Product Page + * Company Page + * Research Article + * Scientific Blog Post + * News Article + * Technical Documentation + * White Paper + * Industry Report + * Other - Technologies, methods, research fields, and applications. + Use this classification only to identify the relevant content and remove boilerplate. - Examples: + Do NOT include the classification in the output. - * Machine Learning - * Predictive Maintenance - * Drug Discovery - * Smart Manufacturing - * Computer Vision - * Clinical Decision Support + --- - --- + # Step 2: Extract Searchable Concepts - ## fine_grained + Extract concepts directly present in the page that are useful for: - Specific technical concepts, algorithms, materials, standards, tools, products, datasets, biomarkers, or protocols. + * OpenAlex retrieval + * Scientific literature discovery + * Patent scouting + * Technology scouting + * Innovation monitoring - Examples: + The extracted concepts must remain faithful to the wording used in the webpage. - * Transformer Architecture - * CRISPR-Cas9 - * OPC UA - * Retrieval-Augmented Generation - * YOLOv8 - * Lithium Iron Phosphate + Do NOT replace webpage terminology with your own preferred terminology. - --- + --- - # Relevance Score + # Keyword Hierarchy - Assign a relevance score between 0.0 and 1.0. + ## broad_keywords - Guidelines: + High-level domains, industries, disciplines, technology areas, products, services, or major themes that explicitly appear in the webpage. - * 1.00 = central topic of the webpage - * 0.90 = major topic - * 0.80 = highly relevant - * 0.70 = supporting concept - * 0.60 = secondary concept + Only use this level when such broad concepts are explicitly present. - Avoid scores below 0.60 unless necessary. + Examples: - --- + * Healthcare + * Biotechnology + * Manufacturing + * Robotics + * Financial Technology - # Additional Rules + only if those exact concepts appear in the webpage. - * Extract only concepts supported by the page content. - * Do not hallucinate technologies. - * Avoid generic company descriptions. - * Avoid generic business terminology. - * Prefer terminology suitable for scientific literature search. - * Prefer concepts that could appear in OpenAlex, patents, technical reports, or academic publications. - * Remove duplicates across hierarchy levels whenever possible. - * Rank keywords by importance. + --- - --- - # Example 3 — News Article + ## coarse_grained - ## Input + Technologies, methods, research fields, applications, products, services, or technical topics explicitly present in the webpage. - Apple announced a new generation of custom AI chips designed for on-device inference. The chips will power future iPhone and Mac devices, improving privacy, latency, and energy efficiency for generative AI applications. + Examples: - ## Output + * Machine Learning + * Predictive Maintenance + * Drug Discovery + * Smart Manufacturing + * Clinical Decision Support - ```json{"broad_keywords":[{"keyword":"Technology","relevance_score":0.98},{"keyword":"ArtificialIntelligence","relevance_score":0.97},{"keyword":"ConsumerElectronics","relevance_score":0.92}],"coarse_grained":[{"keyword":"AIHardware","relevance_score":0.96},{"keyword":"SemiconductorDesign","relevance_score":0.93},{"keyword":"EdgeComputing","relevance_score":0.90},{"keyword":"GenerativeAI","relevance_score":0.88}],"fine_grained":[{"keyword":"On-DeviceInference","relevance_score":0.95},{"keyword":"CustomAIChips","relevance_score":0.94},{"keyword":"InferenceAcceleration","relevance_score":0.89},{"keyword":"Low-LatencyProcessing","relevance_score":0.86}]}``` + only if explicitly present. - --- + --- - # Example 4 — Product Page + ## fine_grained - ## Input + Highly specific technical concepts, algorithms, materials, standards, tools, products, datasets, biomarkers, protocols, model names, framework names, software packages, or specialized terminology explicitly present in the webpage. - The Sony WH-1000XM6 wireless headphones feature adaptive noise cancellation, Bluetooth 5.4 connectivity, 40-hour battery life, multipoint device pairing, and spatial audio support. + Examples: - ## Output + * FastAPI + * OpenAPI + * Pydantic + * CRISPR-Cas9 + * Retrieval-Augmented Generation + * OPC UA - ```json{"broad_keywords":[{"keyword":"ConsumerElectronics","relevance_score":0.98},{"keyword":"AudioTechnology","relevance_score":0.95}],"coarse_grained":[{"keyword":"WirelessHeadphones","relevance_score":0.97},{"keyword":"NoiseCancellation","relevance_score":0.95},{"keyword":"BluetoothAudio","relevance_score":0.92}],"fine_grained":[{"keyword":"AdaptiveNoiseCancellation","relevance_score":0.96},{"keyword":"Bluetooth5.4","relevance_score":0.94},{"keyword":"MultipointPairing","relevance_score":0.89},{"keyword":"SpatialAudio","relevance_score":0.87}]}``` + only if explicitly present. - --- + --- - # Example 5 — Technical Documentation + # Relevance Score - ## Input + Assign a relevance score between 0.0 and 1.0. - FastAPI is a modern Python web framework for building APIs. It provides automatic OpenAPI schema generation, dependency injection, asynchronous request handling, and data validation through Pydantic models. + Guidelines: - ## Output + * 1.00 = central topic of the webpage + * 0.90 = major topic + * 0.80 = highly relevant + * 0.70 = supporting concept + * 0.60 = secondary concept - ```json{"broad_keywords":[{"keyword":"SoftwareDevelopment","relevance_score":0.98},{"keyword":"WebDevelopment","relevance_score":0.95}],"coarse_grained":[{"keyword":"PythonFrameworks","relevance_score":0.97},{"keyword":"APIDevelopment","relevance_score":0.95},{"keyword":"BackendEngineering","relevance_score":0.91}],"fine_grained":[{"keyword":"FastAPI","relevance_score":0.99},{"keyword":"OpenAPI","relevance_score":0.95},{"keyword":"DependencyInjection","relevance_score":0.90},{"keyword":"Pydantic","relevance_score":0.89},{"keyword":"AsynchronousRequestHandling","relevance_score":0.87}]}``` + Avoid scores below 0.60 unless necessary. - --- + Rank keywords by importance. - # Example 6 — Company Website + --- - ## Input + # Extraction Rules - Stripe provides online payment infrastructure for businesses. Its platform supports payment processing, subscription billing, fraud prevention, financial reporting, and global commerce operations. + * Extract only concepts explicitly mentioned in the webpage text. + * Do not use concepts that are merely implied, inferred, generalized, or derived. + * Every keyword must be directly traceable to text spans in the webpage. + * Prefer noun phrases. + * Avoid complete sentences. + * Avoid duplicates across hierarchy levels whenever possible. + * Preserve original wording. + * Rank keywords by importance. + * Return between 5 and 15 keywords per level when sufficient information exists. + * If fewer valid keywords exist, return fewer. - ## Output + --- - ```json{"broad_keywords":[{"keyword":"FinancialTechnology","relevance_score":0.98},{"keyword":"BusinessServices","relevance_score":0.91}],"coarse_grained":[{"keyword":"PaymentProcessing","relevance_score":0.97},{"keyword":"DigitalPayments","relevance_score":0.95},{"keyword":"SubscriptionManagement","relevance_score":0.90}],"fine_grained":[{"keyword":"StripePlatform","relevance_score":0.99},{"keyword":"FraudPrevention","relevance_score":0.91},{"keyword":"RecurringBilling","relevance_score":0.89},{"keyword":"GlobalPaymentInfrastructure","relevance_score":0.87}]}``` + # Self-Validation Before Output - --- + For every keyword, verify: + + * Can this exact phrase be found in the webpage text? + * Can a user highlight the phrase directly in the extracted content? + + If the answer is NO, remove the keyword. + + --- + + # Example — Technical Documentation + + Input: + + FastAPI is a modern Python web framework for building APIs. It provides automatic OpenAPI schema generation, dependency injection, asynchronous request handling, and data validation through Pydantic models. + + Output: + + {"broad_keywords":[{"keyword":"Python web framework","relevance_score":0.95}],"coarse_grained":[{"keyword":"building APIs","relevance_score":0.93},{"keyword":"Data validation","relevance_score":0.90}],"fine_grained":[{"keyword":"FastAPI","relevance_score":0.99},{"keyword":"OpenAPI","relevance_score":0.95},{"keyword":"Dependency Injection","relevance_score":0.91},{"keyword":"Asynchronous Request Handling","relevance_score":0.89},{"keyword":"Pydantic","relevance_score":0.88}]} + +Return ONLY valid JSON matching the schema provided by the API. - Return ONLY valid JSON matching the schema provided by the API. """ SIMPLE_TEXT_PROMPT = """ diff --git a/service/src/main/inse/keywords/service.py b/service/src/main/inse/keywords/service.py index ae207f1c..f4de6cf5 100644 --- a/service/src/main/inse/keywords/service.py +++ b/service/src/main/inse/keywords/service.py @@ -8,10 +8,13 @@ import asyncio from typing import Annotated from fastapi import APIRouter, Body, WebSocket, WebSocketDisconnect +from uvicorn.protocols.utils import ClientDisconnected from . import logic from inse.keywords.model import ExtractedKeywordsResponse, KeywordsRequest +import logging +logger = logging.getLogger(__name__) router = APIRouter( prefix="/api/inse-service", @@ -19,26 +22,35 @@ router = APIRouter( responses={404: {"description": "Not found"}}, ) + + + @router.websocket("/keywords/extract/ws") async def extract_keywords_ws(websocket: WebSocket): - print("WebSocket connection established for keyword extraction.") await websocket.accept() + + disconnected = asyncio.Event() + extraction_task: asyncio.Task | None = None + + async def emit(event: dict): + if disconnected.is_set(): + return + try: + await websocket.send_json(event) + except (WebSocketDisconnect, ClientDisconnected): + disconnected.set() + + async def safe_send(payload: dict): + if disconnected.is_set(): + return + try: + await websocket.send_json(payload) + except (WebSocketDisconnect, ClientDisconnected): + disconnected.set() + try: raw = await websocket.receive_json() - request = KeywordsRequest(**raw) - disconnected = asyncio.Event() - - async def emit(event: dict): - if disconnected.is_set(): - return - await websocket.send_json(event) - - async def watch_disconnect() -> None: - while True: - message = await websocket.receive() - if message["type"] == "websocket.disconnect": - disconnected.set() - return + request = KeywordsRequest(**raw) extraction_task = asyncio.create_task( logic.extract_keywords_stream_enriched( @@ -48,60 +60,37 @@ async def extract_keywords_ws(websocket: WebSocket): emit=emit, ) ) - disconnect_task = asyncio.create_task(watch_disconnect()) - done, pending = await asyncio.wait( - {extraction_task, disconnect_task}, - return_when=asyncio.FIRST_COMPLETED, - ) + result = await extraction_task - if disconnect_task in done: - disconnected.set() + await safe_send({ + "type": "completed", + "result": result.model_dump(), + }) + + except (WebSocketDisconnect, ClientDisconnected): + disconnected.set() + logger.info("Client disconnected from keyword extraction ws") + print("Client disconnected from keyword extraction ws") + + except Exception as e: + disconnected.set() + logger.exception("Error in keyword extraction ws") + await safe_send({ + "type": "error", + "message": str(e), + }) + + finally: + if extraction_task is not None and not extraction_task.done(): extraction_task.cancel() try: await extraction_task - except asyncio.CancelledError: + except (asyncio.CancelledError, Exception): pass - return - disconnect_task.cancel() - try: - await disconnect_task - except asyncio.CancelledError: - pass - result = extraction_task.result() - - await websocket.send_json({"type": "completed", "result": result.model_dump()}) - - except WebSocketDisconnect: - print("WebSocket disconnected.") - pass - except Exception as e: - await websocket.send_json({"type": "error", "message": str(e)}) - finally: if websocket.application_state.name != "DISCONNECTED": await websocket.close() - -# @router.post( -# "/keywords/extract", -# operation_id="extractKeywords", -# response_model=ExtractedKeywordsResponse, -# ) -# async def extract_keywords( -# request: Annotated[ -# KeywordsRequest, -# Body(description="Input text for keyword extraction"), -# ], -# ): -# async def noop(_: dict): -# pass - -# return await logic.extract_keywords_stream( -# query=request.query, -# mode=request.mode, -# limit=request.limit, -# emit=noop, -# ) @router.post( "/keywords/extract", diff --git a/service/src/main/inse/models/openalex/topic.py b/service/src/main/inse/models/openalex/topic.py index da547b58..2085a784 100644 --- a/service/src/main/inse/models/openalex/topic.py +++ b/service/src/main/inse/models/openalex/topic.py @@ -39,6 +39,7 @@ class Topic(BaseModel): keywords: Optional[List[StrictStr]] = Field(default=None, description="Keywords representing the content of papers in the topic.") subfield: Optional[TopicSubfield] = None var_field: Optional[TopicField] = Field(default=None, alias="field") + field: Optional[TopicField] = Field(default=None) domain: Optional[TopicDomain] = None works_count: Optional[StrictInt] = Field(default=None, description="The number of works tagged with this topic.") cited_by_count: Optional[StrictInt] = None diff --git a/service/src/main/inse/models/openalex/work_topic.py b/service/src/main/inse/models/openalex/work_topic.py index c4c6fce6..e780d369 100644 --- a/service/src/main/inse/models/openalex/work_topic.py +++ b/service/src/main/inse/models/openalex/work_topic.py @@ -33,11 +33,12 @@ class WorkTopic(BaseModel): """ # noqa: E501 id: Optional[StrictStr] = None display_name: Optional[StrictStr] = None + description: Optional[StrictStr] = None score: Optional[Union[StrictFloat, StrictInt]] = None subfield: Optional[WorkTopicSubfield] = None var_field: Optional[WorkTopicField] = Field(default=None, alias="field") domain: Optional[WorkTopicDomain] = None - __properties: ClassVar[List[str]] = ["id", "display_name", "score", "subfield", "field", "domain"] + __properties: ClassVar[List[str]] = ["id", "display_name", "description", "score", "subfield", "field", "domain"] model_config = ConfigDict( validate_by_name=True, @@ -101,6 +102,7 @@ class WorkTopic(BaseModel): _obj = cls.model_validate({ "id": obj.get("id"), "display_name": obj.get("display_name"), + "description": obj.get("description"), "score": obj.get("score"), "subfield": WorkTopicSubfield.from_dict(obj["subfield"]) if obj.get("subfield") is not None else None, "field": WorkTopicField.from_dict(obj["field"]) if obj.get("field") is not None else None, diff --git a/service/src/main/inse/organization_management/router.py b/service/src/main/inse/organization_management/router.py index 0a8b82ca..5a2db2bd 100644 --- a/service/src/main/inse/organization_management/router.py +++ b/service/src/main/inse/organization_management/router.py @@ -5,7 +5,7 @@ from fastapi import APIRouter, Depends, Query, Response, status from sqlmodel import Session from inse.auth import service as auth_service -from inse.auth.model import AccessToken +from inse.auth.model import AccessTokenMetadata from inse.database import get_session from inse.tags import Tags @@ -26,7 +26,7 @@ async def get_organizations( page_size: int = Query(default=25, ge=1, le=100), offset: Optional[int] = Query(default=None, ge=0), session: Session = Depends(get_session), - access_token: AccessToken = auth_service.CurrentUserAccessTokenPayloadDep, + access_token: AccessTokenMetadata = auth_service.CurrentUserAccessTokenPayloadDep, ) -> OrganizationPage: return service.get_organizations( session=session, @@ -46,7 +46,7 @@ async def get_organizations( async def create_organization( payload: CreateOrganizationRequest, session: Session = Depends(get_session), - access_token: AccessToken = auth_service.CurrentUserAccessTokenPayloadDep, + access_token: AccessTokenMetadata = auth_service.CurrentUserAccessTokenPayloadDep, ) -> OrganizationProfile: return service.create_organization(session, access_token, payload) @@ -60,7 +60,7 @@ async def update_organization( organization_id: uuid.UUID, payload: UpdateOrganizationRequest, session: Session = Depends(get_session), - access_token: AccessToken = auth_service.CurrentUserAccessTokenPayloadDep, + access_token: AccessTokenMetadata = auth_service.CurrentUserAccessTokenPayloadDep, ) -> OrganizationProfile: return service.update_organization( session, access_token, organization_id, payload @@ -75,7 +75,7 @@ async def update_organization( async def delete_organization( organization_id: uuid.UUID, session: Session = Depends(get_session), - access_token: AccessToken = auth_service.CurrentUserAccessTokenPayloadDep, + access_token: AccessTokenMetadata = auth_service.CurrentUserAccessTokenPayloadDep, ) -> Response: service.delete_organization(session, access_token, organization_id) return Response(status_code=status.HTTP_204_NO_CONTENT) diff --git a/service/src/main/inse/organization_management/service.py b/service/src/main/inse/organization_management/service.py index 80dd88c9..528bcf35 100644 --- a/service/src/main/inse/organization_management/service.py +++ b/service/src/main/inse/organization_management/service.py @@ -4,7 +4,7 @@ from typing import Optional from fastapi import HTTPException, status from sqlmodel import Session, func, select -from inse.auth.model import AccessToken, Account, Organization, UserRole +from inse.auth.model import AccessTokenMetadata, Account, Organization, UserRole from .model import ( CreateOrganizationRequest, @@ -14,7 +14,7 @@ from .model import ( ) -def _require_super_admin(access_token: AccessToken) -> None: +def _require_super_admin(access_token: AccessTokenMetadata) -> None: if access_token.effective_role != UserRole.SUPER_ADMIN: raise HTTPException( status_code=status.HTTP_403_FORBIDDEN, @@ -109,7 +109,7 @@ def _deactivate_organization_accounts( def get_organizations( session: Session, - access_token: AccessToken, + access_token: AccessTokenMetadata, page: int, page_size: int, offset: Optional[int] = None, @@ -145,7 +145,7 @@ def get_organizations( def create_organization( session: Session, - access_token: AccessToken, + access_token: AccessTokenMetadata, payload: CreateOrganizationRequest, ) -> OrganizationProfile: _require_super_admin(access_token) @@ -164,7 +164,7 @@ def create_organization( def update_organization( session: Session, - access_token: AccessToken, + access_token: AccessTokenMetadata, organization_id: uuid.UUID, payload: UpdateOrganizationRequest, ) -> OrganizationProfile: @@ -191,7 +191,7 @@ def update_organization( def delete_organization( session: Session, - access_token: AccessToken, + access_token: AccessTokenMetadata, organization_id: uuid.UUID, ) -> None: _require_super_admin(access_token) diff --git a/webapp/src/app/api/.openapi-generator/FILES b/webapp/src/app/api/.openapi-generator/FILES index 28dbd8c3..16c53b86 100644 --- a/webapp/src/app/api/.openapi-generator/FILES +++ b/webapp/src/app/api/.openapi-generator/FILES @@ -115,7 +115,7 @@ model/hEUReportSummary.ts model/hEUTopic.ts model/hEUWebLink.ts model/hTTPValidationError.ts -model/idToken.ts +model/idTokenMetadata.ts model/inseAccountManagementModelOrganizationProfile.ts model/inseOrganizationManagementModelOrganizationProfile.ts model/institution.ts @@ -151,6 +151,7 @@ model/openAccess.ts model/orgPatentEntry.ts model/orgPatentsResponse.ts model/organizationPage.ts +model/otkResponse.ts model/patentEntry.ts model/patentsByAuthorResponse.ts model/patentsByInstitutionResponse.ts @@ -162,7 +163,6 @@ model/publicationDetailByFunder.ts model/publicationIdsByAuthorPosition.ts model/publicationsByAuthorResponse.ts model/rankingResponse.ts -model/refreshToken.ts model/score.ts model/sortDirection.ts model/tokenType.ts diff --git a/webapp/src/app/api/README.md b/webapp/src/app/api/README.md index dfa7b6e7..2df9da7b 100644 --- a/webapp/src/app/api/README.md +++ b/webapp/src/app/api/README.md @@ -46,10 +46,10 @@ npm link In your project: ```console -npm link +npm link ``` -__Note for Windows users:__ The Angular CLI has troubles to use linked npm packages. +**Note for Windows users:** The Angular CLI has troubles to use linked npm packages. Please refer to this issue for a solution / workaround. Published packages are not effected by this issue. @@ -58,22 +58,22 @@ Published packages are not effected by this issue. In your Angular project: ```typescript - import { ApplicationConfig } from '@angular/core'; import { provideHttpClient } from '@angular/common/http'; import { provideApi } from ''; export const appConfig: ApplicationConfig = { - providers: [ - // ... - provideHttpClient(), - provideApi() - ], + providers: [ + // ... + provideHttpClient(), + provideApi(), + ], }; ``` **NOTE** If you're still using `AppModule` and haven't [migrated](https://angular.dev/reference/migrations/standalone) yet, you can still import an Angular module: + ```typescript import { ApiModule } from ''; ``` @@ -86,11 +86,11 @@ import { provideHttpClient } from '@angular/common/http'; import { provideApi } from ''; export const appConfig: ApplicationConfig = { - providers: [ - // ... - provideHttpClient(), - provideApi('http://localhost:9999') - ], + providers: [ + // ... + provideHttpClient(), + provideApi('http://localhost:9999'), + ], }; ``` @@ -101,15 +101,15 @@ import { provideHttpClient } from '@angular/common/http'; import { provideApi } from ''; export const appConfig: ApplicationConfig = { - providers: [ - // ... - provideHttpClient(), - provideApi({ - withCredentials: true, - username: 'user', - password: 'password' - }) - ], + providers: [ + // ... + provideHttpClient(), + provideApi({ + withCredentials: true, + username: 'user', + password: 'password', + }), + ], }; ``` @@ -120,21 +120,22 @@ 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, + }, + ], }; ``` @@ -151,12 +152,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), + ], }; ``` @@ -176,8 +177,8 @@ Example value for use in your Configuration-Provider: ```typescript new Configuration({ - encodeParam: (param: Param) => myFancyParamEncoder(param), -}) + encodeParam: (param: Param) => myFancyParamEncoder(param), +}); ``` [parameter-locations-url]: https://github.com/OAI/OpenAPI-Specification/blob/main/versions/3.1.0.md#parameter-locations diff --git a/webapp/src/app/api/api.base.service.ts b/webapp/src/app/api/api.base.service.ts index dcf56358..d9ec8f2e 100644 --- a/webapp/src/app/api/api.base.service.ts +++ b/webapp/src/app/api/api.base.service.ts @@ -1,83 +1,109 @@ /** * 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(); + 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 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 addToHttpParams( + httpParams: HttpParams, + value: any, + key?: string, + isDeep: boolean = false, + ): HttpParams { + // If the value is an object (but not a Date), recursively add its keys. + if (typeof value === 'object' && !(value instanceof Date)) { + return this.addToHttpParamsRecursive( + httpParams, + value, + isDeep ? key : undefined, + isDeep, + ); } + return this.addToHttpParamsRecursive(httpParams, value, key); + } - protected addToHttpParamsRecursive(httpParams: HttpParams, value?: any, key?: string, isDeep: boolean = false): HttpParams { - if (value === null || value === undefined) { - return httpParams; - } - if (typeof value === 'object') { - // If JSON format is preferred, key must be provided. - if (key != null) { - return isDeep - ? Object.keys(value as Record).reduce( - (hp, k) => hp.append(`${key}[${k}]`, value[k]), - httpParams, - ) - : httpParams.append(key, JSON.stringify(value)); - } - // Otherwise, if it's an array, add each element. - if (Array.isArray(value)) { - value.forEach(elem => httpParams = this.addToHttpParamsRecursive(httpParams, elem, key)); - } else if (value instanceof Date) { - if (key != null) { - httpParams = httpParams.append(key, value.toISOString()); - } else { - throw Error("key may not be null if value is Date"); - } - } else { - Object.keys(value).forEach(k => { - const paramKey = key ? `${key}.${k}` : k; - httpParams = this.addToHttpParamsRecursive(httpParams, value[k], paramKey); - }); - } - return httpParams; - } else if (key != null) { - return httpParams.append(key, value); - } - throw Error("key may not be null if value is not object or array"); + protected addToHttpParamsRecursive( + httpParams: HttpParams, + value?: any, + key?: string, + isDeep: boolean = false, + ): HttpParams { + if (value === null || value === undefined) { + return httpParams; } + if (typeof value === 'object') { + // If JSON format is preferred, key must be provided. + if (key != null) { + return isDeep + ? Object.keys(value as Record).reduce( + (hp, k) => hp.append(`${key}[${k}]`, value[k]), + httpParams, + ) + : httpParams.append(key, JSON.stringify(value)); + } + // Otherwise, if it's an array, add each element. + if (Array.isArray(value)) { + value.forEach( + (elem) => + (httpParams = this.addToHttpParamsRecursive(httpParams, elem, key)), + ); + } else if (value instanceof Date) { + if (key != null) { + httpParams = httpParams.append(key, value.toISOString()); + } else { + throw Error('key may not be null if value is Date'); + } + } else { + Object.keys(value).forEach((k) => { + const paramKey = key ? `${key}.${k}` : k; + httpParams = this.addToHttpParamsRecursive( + httpParams, + value[k], + paramKey, + ); + }); + } + return httpParams; + } else if (key != null) { + return httpParams.append(key, value); + } + throw Error('key may not be null if value is not object or array'); + } } diff --git a/webapp/src/app/api/api.module.ts b/webapp/src/app/api/api.module.ts index 58d341fb..e29250f2 100644 --- a/webapp/src/app/api/api.module.ts +++ b/webapp/src/app/api/api.module.ts @@ -1,30 +1,42 @@ -import { NgModule, ModuleWithProviders, SkipSelf, Optional } from '@angular/core'; +import { + NgModule, + ModuleWithProviders, + SkipSelf, + Optional, +} from '@angular/core'; import { Configuration } from './configuration'; import { HttpClient } from '@angular/common/http'; - @NgModule({ - imports: [], + imports: [], declarations: [], - exports: [], - providers: [] + exports: [], + providers: [], }) export class ApiModule { - public static forRoot(configurationFactory: () => Configuration): ModuleWithProviders { - return { - ngModule: ApiModule, - providers: [ { provide: Configuration, useFactory: configurationFactory } ] - }; - } + public static forRoot( + configurationFactory: () => Configuration, + ): ModuleWithProviders { + return { + ngModule: ApiModule, + providers: [{ provide: Configuration, useFactory: configurationFactory }], + }; + } - constructor( @Optional() @SkipSelf() parentModule: ApiModule, - @Optional() http: HttpClient) { - if (parentModule) { - throw new Error('ApiModule is already loaded. Import in your base AppModule only.'); - } - if (!http) { - throw new Error('You need to import the HttpClientModule in your AppModule! \n' + - 'See also https://github.com/angular/angular/issues/20575'); - } + 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', + ); + } + } } diff --git a/webapp/src/app/api/api/auth.service.ts b/webapp/src/app/api/api/auth.service.ts index 6beb60cc..7fe92c42 100644 --- a/webapp/src/app/api/api/auth.service.ts +++ b/webapp/src/app/api/api/auth.service.ts @@ -1,7 +1,7 @@ /** * Innovation Search Engine API * - * + * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech @@ -9,12 +9,18 @@ */ /* tslint:disable:no-unused-variable member-ordering */ -import { Inject, Injectable, Optional } from '@angular/core'; -import { HttpClient, HttpHeaders, HttpParams, - HttpResponse, HttpEvent, HttpParameterCodec, HttpContext - } from '@angular/common/http'; -import { CustomHttpParameterCodec } from '../encoder'; -import { Observable } from 'rxjs'; +import { Inject, Injectable, Optional } from '@angular/core'; +import { + HttpClient, + HttpHeaders, + HttpParams, + HttpResponse, + HttpEvent, + HttpParameterCodec, + HttpContext, +} from '@angular/common/http'; +import { CustomHttpParameterCodec } from '../encoder'; +import { Observable } from 'rxjs'; // @ts-ignore import { AccessResponse } from '../model/accessResponse'; @@ -41,831 +47,1529 @@ import { InseAccountManagementModelOrganizationProfile } from '../model/inseAcco // @ts-ignore import { LoginResponse } from '../model/loginResponse'; // @ts-ignore +import { OtkResponse } from '../model/otkResponse'; +// @ts-ignore import { UpdateAccountRequest } from '../model/updateAccountRequest'; // @ts-ignore -import { BASE_PATH, COLLECTION_FORMATS } from '../variables'; -import { Configuration } from '../configuration'; +import { BASE_PATH, COLLECTION_FORMATS } from '../variables'; +import { Configuration } from '../configuration'; import { BaseService } from '../api.base.service'; - - @Injectable({ - providedIn: 'root' + providedIn: 'root', }) export class AuthService extends BaseService { + constructor( + protected httpClient: HttpClient, + @Optional() @Inject(BASE_PATH) basePath: string | string[], + @Optional() configuration?: Configuration, + ) { + super(basePath, configuration); + } - constructor(protected httpClient: HttpClient, @Optional() @Inject(BASE_PATH) basePath: string|string[], @Optional() configuration?: Configuration) { - super(basePath, configuration); + /** + * Change Password + * Change the user\'s password and invalidate existing tokens. + * @endpoint post /api/auth/v2/change-password + * @param bodyChangePassword + * @param secureFgpAcc + * @param observe set whether or not to return the data Observable as the body, response or events. defaults to returning the body. + * @param reportProgress flag to report request and response progress. + */ + public changePassword( + bodyChangePassword: BodyChangePassword, + secureFgpAcc?: string, + observe?: 'body', + reportProgress?: boolean, + options?: { + httpHeaderAccept?: 'application/json'; + context?: HttpContext; + transferCache?: boolean; + }, + ): Observable; + public changePassword( + bodyChangePassword: BodyChangePassword, + secureFgpAcc?: string, + observe?: 'response', + reportProgress?: boolean, + options?: { + httpHeaderAccept?: 'application/json'; + context?: HttpContext; + transferCache?: boolean; + }, + ): Observable>; + public changePassword( + bodyChangePassword: BodyChangePassword, + secureFgpAcc?: string, + observe?: 'events', + reportProgress?: boolean, + options?: { + httpHeaderAccept?: 'application/json'; + context?: HttpContext; + transferCache?: boolean; + }, + ): Observable>; + public changePassword( + bodyChangePassword: BodyChangePassword, + secureFgpAcc?: string, + observe: any = 'body', + reportProgress: boolean = false, + options?: { + httpHeaderAccept?: 'application/json'; + context?: HttpContext; + transferCache?: boolean; + }, + ): Observable { + if (bodyChangePassword === null || bodyChangePassword === undefined) { + throw new Error( + 'Required parameter bodyChangePassword was null or undefined when calling changePassword.', + ); } - /** - * Change Password - * Change the user\'s password and invalidate existing tokens. - * @endpoint post /api/auth/v2/change-password - * @param bodyChangePassword - * @param observe set whether or not to return the data Observable as the body, response or events. defaults to returning the body. - * @param reportProgress flag to report request and response progress. - */ - public changePassword(bodyChangePassword: BodyChangePassword, observe?: 'body', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable; - public changePassword(bodyChangePassword: BodyChangePassword, observe?: 'response', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable>; - public changePassword(bodyChangePassword: BodyChangePassword, observe?: 'events', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable>; - public changePassword(bodyChangePassword: BodyChangePassword, observe: any = 'body', reportProgress: boolean = false, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable { - if (bodyChangePassword === null || bodyChangePassword === undefined) { - throw new Error('Required parameter bodyChangePassword was null or undefined when calling changePassword.'); - } + let localVarHeaders = this.defaultHeaders; - let localVarHeaders = this.defaultHeaders; + // authentication (HTTPBearer) required + localVarHeaders = this.configuration.addCredentialToHeaders( + 'HTTPBearer', + 'Authorization', + localVarHeaders, + 'Bearer ', + ); - // authentication (HTTPBearer) required - localVarHeaders = this.configuration.addCredentialToHeaders('HTTPBearer', 'Authorization', localVarHeaders, 'Bearer '); - - const localVarHttpHeaderAcceptSelected: string | undefined = options?.httpHeaderAccept ?? this.configuration.selectHeaderAccept([ - 'application/json' - ]); - if (localVarHttpHeaderAcceptSelected !== undefined) { - localVarHeaders = localVarHeaders.set('Accept', localVarHttpHeaderAcceptSelected); - } - - const localVarHttpContext: HttpContext = options?.context ?? new HttpContext(); - - const localVarTransferCache: boolean = options?.transferCache ?? true; - - - // to determine the Content-Type header - const consumes: string[] = [ - 'application/json' - ]; - const httpContentTypeSelected: string | undefined = this.configuration.selectHeaderContentType(consumes); - if (httpContentTypeSelected !== undefined) { - localVarHeaders = localVarHeaders.set('Content-Type', httpContentTypeSelected); - } - - let responseType_: 'text' | 'json' | 'blob' = 'json'; - if (localVarHttpHeaderAcceptSelected) { - if (localVarHttpHeaderAcceptSelected.startsWith('text')) { - responseType_ = 'text'; - } else if (this.configuration.isJsonMime(localVarHttpHeaderAcceptSelected)) { - responseType_ = 'json'; - } else { - responseType_ = 'blob'; - } - } - - let localVarPath = `/api/auth/v2/change-password`; - const { basePath, withCredentials } = this.configuration; - return this.httpClient.request('post', `${basePath}${localVarPath}`, - { - context: localVarHttpContext, - body: bodyChangePassword, - responseType: responseType_, - ...(withCredentials ? { withCredentials } : {}), - headers: localVarHeaders, - observe: observe, - ...(localVarTransferCache !== undefined ? { transferCache: localVarTransferCache } : {}), - reportProgress: reportProgress - } - ); + const localVarHttpHeaderAcceptSelected: string | undefined = + options?.httpHeaderAccept ?? + this.configuration.selectHeaderAccept(['application/json']); + if (localVarHttpHeaderAcceptSelected !== undefined) { + localVarHeaders = localVarHeaders.set( + 'Accept', + localVarHttpHeaderAcceptSelected, + ); } - /** - * Create Account - * @endpoint post /api/accounts - * @param createAccountRequest - * @param observe set whether or not to return the data Observable as the body, response or events. defaults to returning the body. - * @param reportProgress flag to report request and response progress. - */ - public createAccount(createAccountRequest: CreateAccountRequest, observe?: 'body', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable; - public createAccount(createAccountRequest: CreateAccountRequest, observe?: 'response', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable>; - public createAccount(createAccountRequest: CreateAccountRequest, observe?: 'events', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable>; - public createAccount(createAccountRequest: CreateAccountRequest, observe: any = 'body', reportProgress: boolean = false, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable { - if (createAccountRequest === null || createAccountRequest === undefined) { - throw new Error('Required parameter createAccountRequest was null or undefined when calling createAccount.'); - } + const localVarHttpContext: HttpContext = + options?.context ?? new HttpContext(); - let localVarHeaders = this.defaultHeaders; + const localVarTransferCache: boolean = options?.transferCache ?? true; - // authentication (HTTPBearer) required - localVarHeaders = this.configuration.addCredentialToHeaders('HTTPBearer', 'Authorization', localVarHeaders, 'Bearer '); - - const localVarHttpHeaderAcceptSelected: string | undefined = options?.httpHeaderAccept ?? this.configuration.selectHeaderAccept([ - 'application/json' - ]); - if (localVarHttpHeaderAcceptSelected !== undefined) { - localVarHeaders = localVarHeaders.set('Accept', localVarHttpHeaderAcceptSelected); - } - - const localVarHttpContext: HttpContext = options?.context ?? new HttpContext(); - - const localVarTransferCache: boolean = options?.transferCache ?? true; - - - // to determine the Content-Type header - const consumes: string[] = [ - 'application/json' - ]; - const httpContentTypeSelected: string | undefined = this.configuration.selectHeaderContentType(consumes); - if (httpContentTypeSelected !== undefined) { - localVarHeaders = localVarHeaders.set('Content-Type', httpContentTypeSelected); - } - - let responseType_: 'text' | 'json' | 'blob' = 'json'; - if (localVarHttpHeaderAcceptSelected) { - if (localVarHttpHeaderAcceptSelected.startsWith('text')) { - responseType_ = 'text'; - } else if (this.configuration.isJsonMime(localVarHttpHeaderAcceptSelected)) { - responseType_ = 'json'; - } else { - responseType_ = 'blob'; - } - } - - let localVarPath = `/api/accounts`; - const { basePath, withCredentials } = this.configuration; - return this.httpClient.request('post', `${basePath}${localVarPath}`, - { - context: localVarHttpContext, - body: createAccountRequest, - responseType: responseType_, - ...(withCredentials ? { withCredentials } : {}), - headers: localVarHeaders, - observe: observe, - ...(localVarTransferCache !== undefined ? { transferCache: localVarTransferCache } : {}), - reportProgress: reportProgress - } - ); + // 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, + ); } - /** - * Delete Account - * @endpoint delete /api/accounts/{account_id} - * @param accountId - * @param observe set whether or not to return the data Observable as the body, response or events. defaults to returning the body. - * @param reportProgress flag to report request and response progress. - */ - public deleteAccount(accountId: string, observe?: 'body', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable; - public deleteAccount(accountId: string, observe?: 'response', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable>; - public deleteAccount(accountId: string, observe?: 'events', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable>; - public deleteAccount(accountId: string, observe: any = 'body', reportProgress: boolean = false, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable { - if (accountId === null || accountId === undefined) { - throw new Error('Required parameter accountId was null or undefined when calling deleteAccount.'); - } - - let localVarHeaders = this.defaultHeaders; - - // authentication (HTTPBearer) required - localVarHeaders = this.configuration.addCredentialToHeaders('HTTPBearer', 'Authorization', localVarHeaders, 'Bearer '); - - const localVarHttpHeaderAcceptSelected: string | undefined = options?.httpHeaderAccept ?? this.configuration.selectHeaderAccept([ - 'application/json' - ]); - if (localVarHttpHeaderAcceptSelected !== undefined) { - localVarHeaders = localVarHeaders.set('Accept', localVarHttpHeaderAcceptSelected); - } - - const localVarHttpContext: HttpContext = options?.context ?? new HttpContext(); - - const localVarTransferCache: boolean = options?.transferCache ?? true; - - - let responseType_: 'text' | 'json' | 'blob' = 'json'; - if (localVarHttpHeaderAcceptSelected) { - if (localVarHttpHeaderAcceptSelected.startsWith('text')) { - responseType_ = 'text'; - } else if (this.configuration.isJsonMime(localVarHttpHeaderAcceptSelected)) { - responseType_ = 'json'; - } else { - responseType_ = 'blob'; - } - } - - let localVarPath = `/api/accounts/${this.configuration.encodeParam({name: "accountId", value: accountId, in: "path", style: "simple", explode: false, dataType: "string", dataFormat: "uuid"})}`; - const { basePath, withCredentials } = this.configuration; - return this.httpClient.request('delete', `${basePath}${localVarPath}`, - { - context: localVarHttpContext, - responseType: responseType_, - ...(withCredentials ? { withCredentials } : {}), - headers: localVarHeaders, - observe: observe, - ...(localVarTransferCache !== undefined ? { transferCache: localVarTransferCache } : {}), - reportProgress: reportProgress - } - ); + let 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 Access Token - * Retrieve an access token for the authenticated user. - * @endpoint post /api/auth/v2/access - * @param bodyGetAccessToken - * @param observe set whether or not to return the data Observable as the body, response or events. defaults to returning the body. - * @param reportProgress flag to report request and response progress. - */ - public getAccessToken(bodyGetAccessToken: BodyGetAccessToken, observe?: 'body', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable; - public getAccessToken(bodyGetAccessToken: BodyGetAccessToken, observe?: 'response', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable>; - public getAccessToken(bodyGetAccessToken: BodyGetAccessToken, observe?: 'events', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable>; - public getAccessToken(bodyGetAccessToken: BodyGetAccessToken, observe: any = 'body', reportProgress: boolean = false, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable { - if (bodyGetAccessToken === null || bodyGetAccessToken === undefined) { - throw new Error('Required parameter bodyGetAccessToken was null or undefined when calling getAccessToken.'); - } + let localVarPath = `/api/auth/v2/change-password`; + const { basePath, withCredentials } = this.configuration; + return this.httpClient.request('post', `${basePath}${localVarPath}`, { + context: localVarHttpContext, + body: bodyChangePassword, + responseType: responseType_, + ...(withCredentials ? { withCredentials } : {}), + headers: localVarHeaders, + observe: observe, + ...(localVarTransferCache !== undefined + ? { transferCache: localVarTransferCache } + : {}), + reportProgress: reportProgress, + }); + } - 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/auth/v2/access`; - const { basePath, withCredentials } = this.configuration; - return this.httpClient.request('post', `${basePath}${localVarPath}`, - { - context: localVarHttpContext, - body: bodyGetAccessToken, - responseType: responseType_, - ...(withCredentials ? { withCredentials } : {}), - headers: localVarHeaders, - observe: observe, - ...(localVarTransferCache !== undefined ? { transferCache: localVarTransferCache } : {}), - reportProgress: reportProgress - } - ); + /** + * Create Account + * @endpoint post /api/accounts + * @param createAccountRequest + * @param secureFgpAcc + * @param observe set whether or not to return the data Observable as the body, response or events. defaults to returning the body. + * @param reportProgress flag to report request and response progress. + */ + public createAccount( + createAccountRequest: CreateAccountRequest, + secureFgpAcc?: string, + observe?: 'body', + reportProgress?: boolean, + options?: { + httpHeaderAccept?: 'application/json'; + context?: HttpContext; + transferCache?: boolean; + }, + ): Observable; + public createAccount( + createAccountRequest: CreateAccountRequest, + secureFgpAcc?: string, + observe?: 'response', + reportProgress?: boolean, + options?: { + httpHeaderAccept?: 'application/json'; + context?: HttpContext; + transferCache?: boolean; + }, + ): Observable>; + public createAccount( + createAccountRequest: CreateAccountRequest, + secureFgpAcc?: string, + observe?: 'events', + reportProgress?: boolean, + options?: { + httpHeaderAccept?: 'application/json'; + context?: HttpContext; + transferCache?: boolean; + }, + ): Observable>; + public createAccount( + createAccountRequest: CreateAccountRequest, + secureFgpAcc?: string, + observe: any = 'body', + reportProgress: boolean = false, + options?: { + httpHeaderAccept?: 'application/json'; + context?: HttpContext; + transferCache?: boolean; + }, + ): Observable { + if (createAccountRequest === null || createAccountRequest === undefined) { + throw new Error( + 'Required parameter createAccountRequest was null or undefined when calling createAccount.', + ); } - /** - * Get Current Account - * @endpoint get /api/accounts/me - * @param observe set whether or not to return the data Observable as the body, response or events. defaults to returning the body. - * @param reportProgress flag to report request and response progress. - */ - public getCurrentAccount(observe?: 'body', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable; - public getCurrentAccount(observe?: 'response', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable>; - public getCurrentAccount(observe?: 'events', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable>; - public getCurrentAccount(observe: any = 'body', reportProgress: boolean = false, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable { + let localVarHeaders = this.defaultHeaders; - let localVarHeaders = this.defaultHeaders; + // authentication (HTTPBearer) required + localVarHeaders = this.configuration.addCredentialToHeaders( + 'HTTPBearer', + 'Authorization', + localVarHeaders, + 'Bearer ', + ); - // authentication (HTTPBearer) required - localVarHeaders = this.configuration.addCredentialToHeaders('HTTPBearer', 'Authorization', localVarHeaders, 'Bearer '); - - const localVarHttpHeaderAcceptSelected: string | undefined = options?.httpHeaderAccept ?? this.configuration.selectHeaderAccept([ - 'application/json' - ]); - if (localVarHttpHeaderAcceptSelected !== undefined) { - localVarHeaders = localVarHeaders.set('Accept', localVarHttpHeaderAcceptSelected); - } - - const localVarHttpContext: HttpContext = options?.context ?? new HttpContext(); - - const localVarTransferCache: boolean = options?.transferCache ?? true; - - - let responseType_: 'text' | 'json' | 'blob' = 'json'; - if (localVarHttpHeaderAcceptSelected) { - if (localVarHttpHeaderAcceptSelected.startsWith('text')) { - responseType_ = 'text'; - } else if (this.configuration.isJsonMime(localVarHttpHeaderAcceptSelected)) { - responseType_ = 'json'; - } else { - responseType_ = 'blob'; - } - } - - let localVarPath = `/api/accounts/me`; - const { basePath, withCredentials } = this.configuration; - return this.httpClient.request('get', `${basePath}${localVarPath}`, - { - context: localVarHttpContext, - responseType: responseType_, - ...(withCredentials ? { withCredentials } : {}), - headers: localVarHeaders, - observe: observe, - ...(localVarTransferCache !== undefined ? { transferCache: localVarTransferCache } : {}), - reportProgress: reportProgress - } - ); + const localVarHttpHeaderAcceptSelected: string | undefined = + options?.httpHeaderAccept ?? + this.configuration.selectHeaderAccept(['application/json']); + if (localVarHttpHeaderAcceptSelected !== undefined) { + localVarHeaders = localVarHeaders.set( + 'Accept', + localVarHttpHeaderAcceptSelected, + ); } - /** - * Health Check - * @endpoint get /api/auth/v2/health - * @param observe set whether or not to return the data Observable as the body, response or events. defaults to returning the body. - * @param reportProgress flag to report request and response progress. - */ - public healthCheckApiAuthV2HealthGet(observe?: 'body', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable; - public healthCheckApiAuthV2HealthGet(observe?: 'response', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable>; - public healthCheckApiAuthV2HealthGet(observe?: 'events', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable>; - public healthCheckApiAuthV2HealthGet(observe: any = 'body', reportProgress: boolean = false, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable { + const localVarHttpContext: HttpContext = + options?.context ?? new HttpContext(); - let localVarHeaders = this.defaultHeaders; + const localVarTransferCache: boolean = options?.transferCache ?? true; - const localVarHttpHeaderAcceptSelected: string | undefined = options?.httpHeaderAccept ?? this.configuration.selectHeaderAccept([ - 'application/json' - ]); - if (localVarHttpHeaderAcceptSelected !== undefined) { - localVarHeaders = localVarHeaders.set('Accept', localVarHttpHeaderAcceptSelected); - } - - const localVarHttpContext: HttpContext = options?.context ?? new HttpContext(); - - const localVarTransferCache: boolean = options?.transferCache ?? true; - - - let responseType_: 'text' | 'json' | 'blob' = 'json'; - if (localVarHttpHeaderAcceptSelected) { - if (localVarHttpHeaderAcceptSelected.startsWith('text')) { - responseType_ = 'text'; - } else if (this.configuration.isJsonMime(localVarHttpHeaderAcceptSelected)) { - responseType_ = 'json'; - } else { - responseType_ = 'blob'; - } - } - - let localVarPath = `/api/auth/v2/health`; - const { basePath, withCredentials } = this.configuration; - return this.httpClient.request('get', `${basePath}${localVarPath}`, - { - context: localVarHttpContext, - responseType: responseType_, - ...(withCredentials ? { withCredentials } : {}), - headers: localVarHeaders, - observe: observe, - ...(localVarTransferCache !== undefined ? { transferCache: localVarTransferCache } : {}), - reportProgress: reportProgress - } - ); + // 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, + ); } - /** - * List Organizations - * @endpoint get /api/accounts/organizations - * @param observe set whether or not to return the data Observable as the body, response or events. defaults to returning the body. - * @param reportProgress flag to report request and response progress. - */ - public listAccountOrganizations(observe?: 'body', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable>; - public listAccountOrganizations(observe?: 'response', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable>>; - public listAccountOrganizations(observe?: 'events', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable>>; - public listAccountOrganizations(observe: any = 'body', reportProgress: boolean = false, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable { - - let localVarHeaders = this.defaultHeaders; - - // authentication (HTTPBearer) required - localVarHeaders = this.configuration.addCredentialToHeaders('HTTPBearer', 'Authorization', localVarHeaders, 'Bearer '); - - const localVarHttpHeaderAcceptSelected: string | undefined = options?.httpHeaderAccept ?? this.configuration.selectHeaderAccept([ - 'application/json' - ]); - if (localVarHttpHeaderAcceptSelected !== undefined) { - localVarHeaders = localVarHeaders.set('Accept', localVarHttpHeaderAcceptSelected); - } - - const localVarHttpContext: HttpContext = options?.context ?? new HttpContext(); - - const localVarTransferCache: boolean = options?.transferCache ?? true; - - - let responseType_: 'text' | 'json' | 'blob' = 'json'; - if (localVarHttpHeaderAcceptSelected) { - if (localVarHttpHeaderAcceptSelected.startsWith('text')) { - responseType_ = 'text'; - } else if (this.configuration.isJsonMime(localVarHttpHeaderAcceptSelected)) { - responseType_ = 'json'; - } else { - responseType_ = 'blob'; - } - } - - let localVarPath = `/api/accounts/organizations`; - const { basePath, withCredentials } = this.configuration; - return this.httpClient.request>('get', `${basePath}${localVarPath}`, - { - context: localVarHttpContext, - responseType: responseType_, - ...(withCredentials ? { withCredentials } : {}), - headers: localVarHeaders, - observe: observe, - ...(localVarTransferCache !== undefined ? { transferCache: localVarTransferCache } : {}), - reportProgress: reportProgress - } - ); + let responseType_: 'text' | 'json' | 'blob' = 'json'; + if (localVarHttpHeaderAcceptSelected) { + if (localVarHttpHeaderAcceptSelected.startsWith('text')) { + responseType_ = 'text'; + } else if ( + this.configuration.isJsonMime(localVarHttpHeaderAcceptSelected) + ) { + responseType_ = 'json'; + } else { + responseType_ = 'blob'; + } } - /** - * List Accounts - * @endpoint get /api/accounts - * @param page - * @param pageSize - * @param offset - * @param search - * @param organizationId - * @param observe set whether or not to return the data Observable as the body, response or events. defaults to returning the body. - * @param reportProgress flag to report request and response progress. - */ - public listAccounts(page?: number, pageSize?: number, offset?: number, search?: string, organizationId?: string, observe?: 'body', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable; - public listAccounts(page?: number, pageSize?: number, offset?: number, search?: string, organizationId?: string, observe?: 'response', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable>; - public listAccounts(page?: number, pageSize?: number, offset?: number, search?: string, organizationId?: string, observe?: 'events', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable>; - public listAccounts(page?: number, pageSize?: number, offset?: number, search?: string, organizationId?: string, observe: any = 'body', reportProgress: boolean = false, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable { + let localVarPath = `/api/accounts`; + const { basePath, withCredentials } = this.configuration; + return this.httpClient.request( + 'post', + `${basePath}${localVarPath}`, + { + context: localVarHttpContext, + body: createAccountRequest, + responseType: responseType_, + ...(withCredentials ? { withCredentials } : {}), + headers: localVarHeaders, + observe: observe, + ...(localVarTransferCache !== undefined + ? { transferCache: localVarTransferCache } + : {}), + reportProgress: reportProgress, + }, + ); + } - let localVarQueryParameters = new HttpParams({encoder: this.encoder}); - localVarQueryParameters = this.addToHttpParams(localVarQueryParameters, - page, 'page'); - localVarQueryParameters = this.addToHttpParams(localVarQueryParameters, - pageSize, 'page_size'); - localVarQueryParameters = this.addToHttpParams(localVarQueryParameters, - offset, 'offset'); - localVarQueryParameters = this.addToHttpParams(localVarQueryParameters, - search, 'search'); - localVarQueryParameters = this.addToHttpParams(localVarQueryParameters, - organizationId, 'organization_id'); - - let localVarHeaders = this.defaultHeaders; - - // authentication (HTTPBearer) required - localVarHeaders = this.configuration.addCredentialToHeaders('HTTPBearer', 'Authorization', localVarHeaders, 'Bearer '); - - const localVarHttpHeaderAcceptSelected: string | undefined = options?.httpHeaderAccept ?? this.configuration.selectHeaderAccept([ - 'application/json' - ]); - if (localVarHttpHeaderAcceptSelected !== undefined) { - localVarHeaders = localVarHeaders.set('Accept', localVarHttpHeaderAcceptSelected); - } - - const localVarHttpContext: HttpContext = options?.context ?? new HttpContext(); - - const localVarTransferCache: boolean = options?.transferCache ?? true; - - - let responseType_: 'text' | 'json' | 'blob' = 'json'; - if (localVarHttpHeaderAcceptSelected) { - if (localVarHttpHeaderAcceptSelected.startsWith('text')) { - responseType_ = 'text'; - } else if (this.configuration.isJsonMime(localVarHttpHeaderAcceptSelected)) { - responseType_ = 'json'; - } else { - responseType_ = 'blob'; - } - } - - let localVarPath = `/api/accounts`; - const { basePath, withCredentials } = this.configuration; - return this.httpClient.request('get', `${basePath}${localVarPath}`, - { - context: localVarHttpContext, - params: localVarQueryParameters, - responseType: responseType_, - ...(withCredentials ? { withCredentials } : {}), - headers: localVarHeaders, - observe: observe, - ...(localVarTransferCache !== undefined ? { transferCache: localVarTransferCache } : {}), - reportProgress: reportProgress - } - ); + /** + * Delete Account + * @endpoint delete /api/accounts/{account_id} + * @param accountId + * @param secureFgpAcc + * @param observe set whether or not to return the data Observable as the body, response or events. defaults to returning the body. + * @param reportProgress flag to report request and response progress. + */ + public deleteAccount( + accountId: string, + secureFgpAcc?: string, + observe?: 'body', + reportProgress?: boolean, + options?: { + httpHeaderAccept?: 'application/json'; + context?: HttpContext; + transferCache?: boolean; + }, + ): Observable; + public deleteAccount( + accountId: string, + secureFgpAcc?: string, + observe?: 'response', + reportProgress?: boolean, + options?: { + httpHeaderAccept?: 'application/json'; + context?: HttpContext; + transferCache?: boolean; + }, + ): Observable>; + public deleteAccount( + accountId: string, + secureFgpAcc?: string, + observe?: 'events', + reportProgress?: boolean, + options?: { + httpHeaderAccept?: 'application/json'; + context?: HttpContext; + transferCache?: boolean; + }, + ): Observable>; + public deleteAccount( + accountId: string, + secureFgpAcc?: string, + observe: any = 'body', + reportProgress: boolean = false, + options?: { + httpHeaderAccept?: 'application/json'; + context?: HttpContext; + transferCache?: boolean; + }, + ): Observable { + if (accountId === null || accountId === undefined) { + throw new Error( + 'Required parameter accountId was null or undefined when calling deleteAccount.', + ); } - /** - * Login with One-Time Key - * Login using a one-time key (OTK) sent to the user\'s email. - * @endpoint post /api/auth/v2/login - * @param bodyLogin - * @param observe set whether or not to return the data Observable as the body, response or events. defaults to returning the body. - * @param reportProgress flag to report request and response progress. - */ - public login(bodyLogin: BodyLogin, observe?: 'body', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable; - public login(bodyLogin: BodyLogin, observe?: 'response', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable>; - public login(bodyLogin: BodyLogin, observe?: 'events', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable>; - public login(bodyLogin: BodyLogin, observe: any = 'body', reportProgress: boolean = false, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable { - if (bodyLogin === null || bodyLogin === undefined) { - throw new Error('Required parameter bodyLogin was null or undefined when calling login.'); - } + let localVarHeaders = this.defaultHeaders; - 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/auth/v2/login`; - const { basePath, withCredentials } = this.configuration; - return this.httpClient.request('post', `${basePath}${localVarPath}`, - { - context: localVarHttpContext, - body: bodyLogin, - responseType: responseType_, - ...(withCredentials ? { withCredentials } : {}), - headers: localVarHeaders, - observe: observe, - ...(localVarTransferCache !== undefined ? { transferCache: localVarTransferCache } : {}), - reportProgress: reportProgress - } - ); + const localVarHttpHeaderAcceptSelected: string | undefined = + options?.httpHeaderAccept ?? + this.configuration.selectHeaderAccept(['application/json']); + if (localVarHttpHeaderAcceptSelected !== undefined) { + localVarHeaders = localVarHeaders.set( + 'Accept', + localVarHttpHeaderAcceptSelected, + ); } - /** - * Logout - * Logout the authenticated user. - * @endpoint post /api/auth/v2/logout - * @param observe set whether or not to return the data Observable as the body, response or events. defaults to returning the body. - * @param reportProgress flag to report request and response progress. - */ - public logout(observe?: 'body', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable; - public logout(observe?: 'response', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable>; - public logout(observe?: 'events', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable>; - public logout(observe: any = 'body', reportProgress: boolean = false, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable { + const localVarHttpContext: HttpContext = + options?.context ?? new HttpContext(); - let localVarHeaders = this.defaultHeaders; + const localVarTransferCache: boolean = options?.transferCache ?? true; - // authentication (HTTPBearer) required - localVarHeaders = this.configuration.addCredentialToHeaders('HTTPBearer', 'Authorization', localVarHeaders, 'Bearer '); - - const localVarHttpHeaderAcceptSelected: string | undefined = options?.httpHeaderAccept ?? this.configuration.selectHeaderAccept([ - 'application/json' - ]); - if (localVarHttpHeaderAcceptSelected !== undefined) { - localVarHeaders = localVarHeaders.set('Accept', localVarHttpHeaderAcceptSelected); - } - - const localVarHttpContext: HttpContext = options?.context ?? new HttpContext(); - - const localVarTransferCache: boolean = options?.transferCache ?? true; - - - let responseType_: 'text' | 'json' | 'blob' = 'json'; - if (localVarHttpHeaderAcceptSelected) { - if (localVarHttpHeaderAcceptSelected.startsWith('text')) { - responseType_ = 'text'; - } else if (this.configuration.isJsonMime(localVarHttpHeaderAcceptSelected)) { - responseType_ = 'json'; - } else { - responseType_ = 'blob'; - } - } - - let localVarPath = `/api/auth/v2/logout`; - const { basePath, withCredentials } = this.configuration; - return this.httpClient.request('post', `${basePath}${localVarPath}`, - { - context: localVarHttpContext, - responseType: responseType_, - ...(withCredentials ? { withCredentials } : {}), - headers: localVarHeaders, - observe: observe, - ...(localVarTransferCache !== undefined ? { transferCache: localVarTransferCache } : {}), - reportProgress: reportProgress - } - ); + let responseType_: 'text' | 'json' | 'blob' = 'json'; + if (localVarHttpHeaderAcceptSelected) { + if (localVarHttpHeaderAcceptSelected.startsWith('text')) { + responseType_ = 'text'; + } else if ( + this.configuration.isJsonMime(localVarHttpHeaderAcceptSelected) + ) { + responseType_ = 'json'; + } else { + responseType_ = 'blob'; + } } - /** - * Refresh Access Token - * Refresh the access token using a valid refresh token. - * @endpoint post /api/auth/v2/refresh - * @param observe set whether or not to return the data Observable as the body, response or events. defaults to returning the body. - * @param reportProgress flag to report request and response progress. - */ - public refreshAccessToken(observe?: 'body', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable; - public refreshAccessToken(observe?: 'response', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable>; - public refreshAccessToken(observe?: 'events', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable>; - public refreshAccessToken(observe: any = 'body', reportProgress: boolean = false, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable { + let localVarPath = `/api/accounts/${this.configuration.encodeParam({ name: 'accountId', value: accountId, in: 'path', style: 'simple', explode: false, dataType: 'string', dataFormat: 'uuid' })}`; + const { basePath, withCredentials } = this.configuration; + return this.httpClient.request( + 'delete', + `${basePath}${localVarPath}`, + { + context: localVarHttpContext, + responseType: responseType_, + ...(withCredentials ? { withCredentials } : {}), + headers: localVarHeaders, + observe: observe, + ...(localVarTransferCache !== undefined + ? { transferCache: localVarTransferCache } + : {}), + reportProgress: reportProgress, + }, + ); + } - let localVarHeaders = this.defaultHeaders; - - // authentication (HTTPBearer) required - localVarHeaders = this.configuration.addCredentialToHeaders('HTTPBearer', 'Authorization', localVarHeaders, 'Bearer '); - - const localVarHttpHeaderAcceptSelected: string | undefined = options?.httpHeaderAccept ?? this.configuration.selectHeaderAccept([ - 'application/json' - ]); - if (localVarHttpHeaderAcceptSelected !== undefined) { - localVarHeaders = localVarHeaders.set('Accept', localVarHttpHeaderAcceptSelected); - } - - const localVarHttpContext: HttpContext = options?.context ?? new HttpContext(); - - const localVarTransferCache: boolean = options?.transferCache ?? true; - - - let responseType_: 'text' | 'json' | 'blob' = 'json'; - if (localVarHttpHeaderAcceptSelected) { - if (localVarHttpHeaderAcceptSelected.startsWith('text')) { - responseType_ = 'text'; - } else if (this.configuration.isJsonMime(localVarHttpHeaderAcceptSelected)) { - responseType_ = 'json'; - } else { - responseType_ = 'blob'; - } - } - - let localVarPath = `/api/auth/v2/refresh`; - const { basePath, withCredentials } = this.configuration; - return this.httpClient.request('post', `${basePath}${localVarPath}`, - { - context: localVarHttpContext, - responseType: responseType_, - ...(withCredentials ? { withCredentials } : {}), - headers: localVarHeaders, - observe: observe, - ...(localVarTransferCache !== undefined ? { transferCache: localVarTransferCache } : {}), - reportProgress: reportProgress - } - ); + /** + * Get Access Token + * Retrieve an access token for the authenticated user. + * @endpoint post /api/auth/v2/access + * @param bodyGetAccessToken + * @param idToken + * @param observe set whether or not to return the data Observable as the body, response or events. defaults to returning the body. + * @param reportProgress flag to report request and response progress. + */ + public getAccessToken( + bodyGetAccessToken: BodyGetAccessToken, + idToken?: string, + observe?: 'body', + reportProgress?: boolean, + options?: { + httpHeaderAccept?: 'application/json'; + context?: HttpContext; + transferCache?: boolean; + }, + ): Observable; + public getAccessToken( + bodyGetAccessToken: BodyGetAccessToken, + idToken?: string, + observe?: 'response', + reportProgress?: boolean, + options?: { + httpHeaderAccept?: 'application/json'; + context?: HttpContext; + transferCache?: boolean; + }, + ): Observable>; + public getAccessToken( + bodyGetAccessToken: BodyGetAccessToken, + idToken?: string, + observe?: 'events', + reportProgress?: boolean, + options?: { + httpHeaderAccept?: 'application/json'; + context?: HttpContext; + transferCache?: boolean; + }, + ): Observable>; + public getAccessToken( + bodyGetAccessToken: BodyGetAccessToken, + idToken?: string, + observe: any = 'body', + reportProgress: boolean = false, + options?: { + httpHeaderAccept?: 'application/json'; + context?: HttpContext; + transferCache?: boolean; + }, + ): Observable { + if (bodyGetAccessToken === null || bodyGetAccessToken === undefined) { + throw new Error( + 'Required parameter bodyGetAccessToken was null or undefined when calling getAccessToken.', + ); } - /** - * Request One-Time Key - * Request a one-time key (OTK) for authentication using email and password. - * @endpoint post /api/auth/v2/request-otk - * @param bodyRequestOtk - * @param observe set whether or not to return the data Observable as the body, response or events. defaults to returning the body. - * @param reportProgress flag to report request and response progress. - */ - public requestOtk(bodyRequestOtk: BodyRequestOtk, observe?: 'body', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable; - public requestOtk(bodyRequestOtk: BodyRequestOtk, observe?: 'response', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable>; - public requestOtk(bodyRequestOtk: BodyRequestOtk, observe?: 'events', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable>; - public requestOtk(bodyRequestOtk: BodyRequestOtk, observe: any = 'body', reportProgress: boolean = false, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable { - if (bodyRequestOtk === null || bodyRequestOtk === undefined) { - throw new Error('Required parameter bodyRequestOtk was null or undefined when calling requestOtk.'); - } + let localVarHeaders = this.defaultHeaders; - let localVarHeaders = this.defaultHeaders; - - const localVarHttpHeaderAcceptSelected: string | undefined = options?.httpHeaderAccept ?? this.configuration.selectHeaderAccept([ - 'application/json' - ]); - if (localVarHttpHeaderAcceptSelected !== undefined) { - localVarHeaders = localVarHeaders.set('Accept', localVarHttpHeaderAcceptSelected); - } - - const localVarHttpContext: HttpContext = options?.context ?? new HttpContext(); - - const localVarTransferCache: boolean = options?.transferCache ?? true; - - - // to determine the Content-Type header - const consumes: string[] = [ - 'application/json' - ]; - const httpContentTypeSelected: string | undefined = this.configuration.selectHeaderContentType(consumes); - if (httpContentTypeSelected !== undefined) { - localVarHeaders = localVarHeaders.set('Content-Type', httpContentTypeSelected); - } - - let responseType_: 'text' | 'json' | 'blob' = 'json'; - if (localVarHttpHeaderAcceptSelected) { - if (localVarHttpHeaderAcceptSelected.startsWith('text')) { - responseType_ = 'text'; - } else if (this.configuration.isJsonMime(localVarHttpHeaderAcceptSelected)) { - responseType_ = 'json'; - } else { - responseType_ = 'blob'; - } - } - - let localVarPath = `/api/auth/v2/request-otk`; - const { basePath, withCredentials } = this.configuration; - return this.httpClient.request('post', `${basePath}${localVarPath}`, - { - context: localVarHttpContext, - body: bodyRequestOtk, - responseType: responseType_, - ...(withCredentials ? { withCredentials } : {}), - headers: localVarHeaders, - observe: observe, - ...(localVarTransferCache !== undefined ? { transferCache: localVarTransferCache } : {}), - reportProgress: reportProgress - } - ); + const localVarHttpHeaderAcceptSelected: string | undefined = + options?.httpHeaderAccept ?? + this.configuration.selectHeaderAccept(['application/json']); + if (localVarHttpHeaderAcceptSelected !== undefined) { + localVarHeaders = localVarHeaders.set( + 'Accept', + localVarHttpHeaderAcceptSelected, + ); } - /** - * Update Account - * @endpoint put /api/accounts/{account_id} - * @param accountId - * @param updateAccountRequest - * @param observe set whether or not to return the data Observable as the body, response or events. defaults to returning the body. - * @param reportProgress flag to report request and response progress. - */ - public updateAccount(accountId: string, updateAccountRequest: UpdateAccountRequest, observe?: 'body', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable; - public updateAccount(accountId: string, updateAccountRequest: UpdateAccountRequest, observe?: 'response', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable>; - public updateAccount(accountId: string, updateAccountRequest: UpdateAccountRequest, observe?: 'events', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable>; - public updateAccount(accountId: string, updateAccountRequest: UpdateAccountRequest, observe: any = 'body', reportProgress: boolean = false, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable { - if (accountId === null || accountId === undefined) { - throw new Error('Required parameter accountId was null or undefined when calling updateAccount.'); - } - if (updateAccountRequest === null || updateAccountRequest === undefined) { - throw new Error('Required parameter updateAccountRequest was null or undefined when calling updateAccount.'); - } + const localVarHttpContext: HttpContext = + options?.context ?? new HttpContext(); - let localVarHeaders = this.defaultHeaders; + const localVarTransferCache: boolean = options?.transferCache ?? true; - // authentication (HTTPBearer) required - localVarHeaders = this.configuration.addCredentialToHeaders('HTTPBearer', 'Authorization', localVarHeaders, 'Bearer '); - - const localVarHttpHeaderAcceptSelected: string | undefined = options?.httpHeaderAccept ?? this.configuration.selectHeaderAccept([ - 'application/json' - ]); - if (localVarHttpHeaderAcceptSelected !== undefined) { - localVarHeaders = localVarHeaders.set('Accept', localVarHttpHeaderAcceptSelected); - } - - const localVarHttpContext: HttpContext = options?.context ?? new HttpContext(); - - const localVarTransferCache: boolean = options?.transferCache ?? true; - - - // to determine the Content-Type header - const consumes: string[] = [ - 'application/json' - ]; - const httpContentTypeSelected: string | undefined = this.configuration.selectHeaderContentType(consumes); - if (httpContentTypeSelected !== undefined) { - localVarHeaders = localVarHeaders.set('Content-Type', httpContentTypeSelected); - } - - let responseType_: 'text' | 'json' | 'blob' = 'json'; - if (localVarHttpHeaderAcceptSelected) { - if (localVarHttpHeaderAcceptSelected.startsWith('text')) { - responseType_ = 'text'; - } else if (this.configuration.isJsonMime(localVarHttpHeaderAcceptSelected)) { - responseType_ = 'json'; - } else { - responseType_ = 'blob'; - } - } - - let localVarPath = `/api/accounts/${this.configuration.encodeParam({name: "accountId", value: accountId, in: "path", style: "simple", explode: false, dataType: "string", dataFormat: "uuid"})}`; - const { basePath, withCredentials } = this.configuration; - return this.httpClient.request('put', `${basePath}${localVarPath}`, - { - context: localVarHttpContext, - body: updateAccountRequest, - responseType: responseType_, - ...(withCredentials ? { withCredentials } : {}), - headers: localVarHeaders, - observe: observe, - ...(localVarTransferCache !== undefined ? { transferCache: localVarTransferCache } : {}), - reportProgress: reportProgress - } - ); + // to determine the Content-Type header + const consumes: string[] = ['application/json']; + const httpContentTypeSelected: string | undefined = + this.configuration.selectHeaderContentType(consumes); + if (httpContentTypeSelected !== undefined) { + localVarHeaders = localVarHeaders.set( + 'Content-Type', + httpContentTypeSelected, + ); } + let responseType_: 'text' | 'json' | 'blob' = 'json'; + if (localVarHttpHeaderAcceptSelected) { + if (localVarHttpHeaderAcceptSelected.startsWith('text')) { + responseType_ = 'text'; + } else if ( + this.configuration.isJsonMime(localVarHttpHeaderAcceptSelected) + ) { + responseType_ = 'json'; + } else { + responseType_ = 'blob'; + } + } + + let localVarPath = `/api/auth/v2/access`; + const { basePath, withCredentials } = this.configuration; + return this.httpClient.request( + 'post', + `${basePath}${localVarPath}`, + { + context: localVarHttpContext, + body: bodyGetAccessToken, + responseType: responseType_, + ...(withCredentials ? { withCredentials } : {}), + headers: localVarHeaders, + observe: observe, + ...(localVarTransferCache !== undefined + ? { transferCache: localVarTransferCache } + : {}), + reportProgress: reportProgress, + }, + ); + } + + /** + * Get Current Account + * @endpoint get /api/accounts/me + * @param secureFgpAcc + * @param observe set whether or not to return the data Observable as the body, response or events. defaults to returning the body. + * @param reportProgress flag to report request and response progress. + */ + public getCurrentAccount( + secureFgpAcc?: string, + observe?: 'body', + reportProgress?: boolean, + options?: { + httpHeaderAccept?: 'application/json'; + context?: HttpContext; + transferCache?: boolean; + }, + ): Observable; + public getCurrentAccount( + secureFgpAcc?: string, + observe?: 'response', + reportProgress?: boolean, + options?: { + httpHeaderAccept?: 'application/json'; + context?: HttpContext; + transferCache?: boolean; + }, + ): Observable>; + public getCurrentAccount( + secureFgpAcc?: string, + observe?: 'events', + reportProgress?: boolean, + options?: { + httpHeaderAccept?: 'application/json'; + context?: HttpContext; + transferCache?: boolean; + }, + ): Observable>; + public getCurrentAccount( + secureFgpAcc?: string, + observe: any = 'body', + reportProgress: boolean = false, + options?: { + httpHeaderAccept?: 'application/json'; + context?: HttpContext; + transferCache?: boolean; + }, + ): Observable { + let localVarHeaders = this.defaultHeaders; + + // authentication (HTTPBearer) required + localVarHeaders = this.configuration.addCredentialToHeaders( + 'HTTPBearer', + 'Authorization', + localVarHeaders, + 'Bearer ', + ); + + const localVarHttpHeaderAcceptSelected: string | undefined = + options?.httpHeaderAccept ?? + this.configuration.selectHeaderAccept(['application/json']); + if (localVarHttpHeaderAcceptSelected !== undefined) { + localVarHeaders = localVarHeaders.set( + 'Accept', + localVarHttpHeaderAcceptSelected, + ); + } + + const localVarHttpContext: HttpContext = + options?.context ?? new HttpContext(); + + const localVarTransferCache: boolean = options?.transferCache ?? true; + + let responseType_: 'text' | 'json' | 'blob' = 'json'; + if (localVarHttpHeaderAcceptSelected) { + if (localVarHttpHeaderAcceptSelected.startsWith('text')) { + responseType_ = 'text'; + } else if ( + this.configuration.isJsonMime(localVarHttpHeaderAcceptSelected) + ) { + responseType_ = 'json'; + } else { + responseType_ = 'blob'; + } + } + + let localVarPath = `/api/accounts/me`; + const { basePath, withCredentials } = this.configuration; + return this.httpClient.request( + 'get', + `${basePath}${localVarPath}`, + { + context: localVarHttpContext, + responseType: responseType_, + ...(withCredentials ? { withCredentials } : {}), + headers: localVarHeaders, + observe: observe, + ...(localVarTransferCache !== undefined + ? { transferCache: localVarTransferCache } + : {}), + reportProgress: reportProgress, + }, + ); + } + + /** + * Health Check + * @endpoint get /api/auth/v2/health + * @param observe set whether or not to return the data Observable as the body, response or events. defaults to returning the body. + * @param reportProgress flag to report request and response progress. + */ + public healthCheckApiAuthV2HealthGet( + observe?: 'body', + reportProgress?: boolean, + options?: { + httpHeaderAccept?: 'application/json'; + context?: HttpContext; + transferCache?: boolean; + }, + ): Observable; + public healthCheckApiAuthV2HealthGet( + observe?: 'response', + reportProgress?: boolean, + options?: { + httpHeaderAccept?: 'application/json'; + context?: HttpContext; + transferCache?: boolean; + }, + ): Observable>; + public healthCheckApiAuthV2HealthGet( + observe?: 'events', + reportProgress?: boolean, + options?: { + httpHeaderAccept?: 'application/json'; + context?: HttpContext; + transferCache?: boolean; + }, + ): Observable>; + public healthCheckApiAuthV2HealthGet( + observe: any = 'body', + reportProgress: boolean = false, + options?: { + httpHeaderAccept?: 'application/json'; + context?: HttpContext; + transferCache?: boolean; + }, + ): Observable { + let localVarHeaders = this.defaultHeaders; + + const localVarHttpHeaderAcceptSelected: string | undefined = + options?.httpHeaderAccept ?? + this.configuration.selectHeaderAccept(['application/json']); + if (localVarHttpHeaderAcceptSelected !== undefined) { + localVarHeaders = localVarHeaders.set( + 'Accept', + localVarHttpHeaderAcceptSelected, + ); + } + + const localVarHttpContext: HttpContext = + options?.context ?? new HttpContext(); + + const localVarTransferCache: boolean = options?.transferCache ?? true; + + let responseType_: 'text' | 'json' | 'blob' = 'json'; + if (localVarHttpHeaderAcceptSelected) { + if (localVarHttpHeaderAcceptSelected.startsWith('text')) { + responseType_ = 'text'; + } else if ( + this.configuration.isJsonMime(localVarHttpHeaderAcceptSelected) + ) { + responseType_ = 'json'; + } else { + responseType_ = 'blob'; + } + } + + let localVarPath = `/api/auth/v2/health`; + const { basePath, withCredentials } = this.configuration; + return this.httpClient.request('get', `${basePath}${localVarPath}`, { + context: localVarHttpContext, + responseType: responseType_, + ...(withCredentials ? { withCredentials } : {}), + headers: localVarHeaders, + observe: observe, + ...(localVarTransferCache !== undefined + ? { transferCache: localVarTransferCache } + : {}), + reportProgress: reportProgress, + }); + } + + /** + * List Organizations + * @endpoint get /api/accounts/organizations + * @param secureFgpAcc + * @param observe set whether or not to return the data Observable as the body, response or events. defaults to returning the body. + * @param reportProgress flag to report request and response progress. + */ + public listAccountOrganizations( + secureFgpAcc?: string, + observe?: 'body', + reportProgress?: boolean, + options?: { + httpHeaderAccept?: 'application/json'; + context?: HttpContext; + transferCache?: boolean; + }, + ): Observable>; + public listAccountOrganizations( + secureFgpAcc?: string, + observe?: 'response', + reportProgress?: boolean, + options?: { + httpHeaderAccept?: 'application/json'; + context?: HttpContext; + transferCache?: boolean; + }, + ): Observable< + HttpResponse> + >; + public listAccountOrganizations( + secureFgpAcc?: string, + observe?: 'events', + reportProgress?: boolean, + options?: { + httpHeaderAccept?: 'application/json'; + context?: HttpContext; + transferCache?: boolean; + }, + ): Observable< + HttpEvent> + >; + public listAccountOrganizations( + secureFgpAcc?: string, + observe: any = 'body', + reportProgress: boolean = false, + options?: { + httpHeaderAccept?: 'application/json'; + context?: HttpContext; + transferCache?: boolean; + }, + ): Observable { + let localVarHeaders = this.defaultHeaders; + + // authentication (HTTPBearer) required + localVarHeaders = this.configuration.addCredentialToHeaders( + 'HTTPBearer', + 'Authorization', + localVarHeaders, + 'Bearer ', + ); + + const localVarHttpHeaderAcceptSelected: string | undefined = + options?.httpHeaderAccept ?? + this.configuration.selectHeaderAccept(['application/json']); + if (localVarHttpHeaderAcceptSelected !== undefined) { + localVarHeaders = localVarHeaders.set( + 'Accept', + localVarHttpHeaderAcceptSelected, + ); + } + + const localVarHttpContext: HttpContext = + options?.context ?? new HttpContext(); + + const localVarTransferCache: boolean = options?.transferCache ?? true; + + let responseType_: 'text' | 'json' | 'blob' = 'json'; + if (localVarHttpHeaderAcceptSelected) { + if (localVarHttpHeaderAcceptSelected.startsWith('text')) { + responseType_ = 'text'; + } else if ( + this.configuration.isJsonMime(localVarHttpHeaderAcceptSelected) + ) { + responseType_ = 'json'; + } else { + responseType_ = 'blob'; + } + } + + let localVarPath = `/api/accounts/organizations`; + const { basePath, withCredentials } = this.configuration; + return this.httpClient.request< + Array + >('get', `${basePath}${localVarPath}`, { + context: localVarHttpContext, + responseType: responseType_, + ...(withCredentials ? { withCredentials } : {}), + headers: localVarHeaders, + observe: observe, + ...(localVarTransferCache !== undefined + ? { transferCache: localVarTransferCache } + : {}), + reportProgress: reportProgress, + }); + } + + /** + * List Accounts + * @endpoint get /api/accounts + * @param page + * @param pageSize + * @param offset + * @param search + * @param organizationId + * @param secureFgpAcc + * @param observe set whether or not to return the data Observable as the body, response or events. defaults to returning the body. + * @param reportProgress flag to report request and response progress. + */ + public listAccounts( + page?: number, + pageSize?: number, + offset?: number, + search?: string, + organizationId?: string, + secureFgpAcc?: string, + observe?: 'body', + reportProgress?: boolean, + options?: { + httpHeaderAccept?: 'application/json'; + context?: HttpContext; + transferCache?: boolean; + }, + ): Observable; + public listAccounts( + page?: number, + pageSize?: number, + offset?: number, + search?: string, + organizationId?: string, + secureFgpAcc?: string, + observe?: 'response', + reportProgress?: boolean, + options?: { + httpHeaderAccept?: 'application/json'; + context?: HttpContext; + transferCache?: boolean; + }, + ): Observable>; + public listAccounts( + page?: number, + pageSize?: number, + offset?: number, + search?: string, + organizationId?: string, + secureFgpAcc?: string, + observe?: 'events', + reportProgress?: boolean, + options?: { + httpHeaderAccept?: 'application/json'; + context?: HttpContext; + transferCache?: boolean; + }, + ): Observable>; + public listAccounts( + page?: number, + pageSize?: number, + offset?: number, + search?: string, + organizationId?: string, + secureFgpAcc?: string, + observe: any = 'body', + reportProgress: boolean = false, + options?: { + httpHeaderAccept?: 'application/json'; + context?: HttpContext; + transferCache?: boolean; + }, + ): Observable { + let localVarQueryParameters = new HttpParams({ encoder: this.encoder }); + localVarQueryParameters = this.addToHttpParams( + localVarQueryParameters, + page, + 'page', + ); + localVarQueryParameters = this.addToHttpParams( + localVarQueryParameters, + pageSize, + 'page_size', + ); + localVarQueryParameters = this.addToHttpParams( + localVarQueryParameters, + offset, + 'offset', + ); + localVarQueryParameters = this.addToHttpParams( + localVarQueryParameters, + search, + 'search', + ); + localVarQueryParameters = this.addToHttpParams( + localVarQueryParameters, + organizationId, + 'organization_id', + ); + + let localVarHeaders = this.defaultHeaders; + + // authentication (HTTPBearer) required + localVarHeaders = this.configuration.addCredentialToHeaders( + 'HTTPBearer', + 'Authorization', + localVarHeaders, + 'Bearer ', + ); + + const localVarHttpHeaderAcceptSelected: string | undefined = + options?.httpHeaderAccept ?? + this.configuration.selectHeaderAccept(['application/json']); + if (localVarHttpHeaderAcceptSelected !== undefined) { + localVarHeaders = localVarHeaders.set( + 'Accept', + localVarHttpHeaderAcceptSelected, + ); + } + + const localVarHttpContext: HttpContext = + options?.context ?? new HttpContext(); + + const localVarTransferCache: boolean = options?.transferCache ?? true; + + let responseType_: 'text' | 'json' | 'blob' = 'json'; + if (localVarHttpHeaderAcceptSelected) { + if (localVarHttpHeaderAcceptSelected.startsWith('text')) { + responseType_ = 'text'; + } else if ( + this.configuration.isJsonMime(localVarHttpHeaderAcceptSelected) + ) { + responseType_ = 'json'; + } else { + responseType_ = 'blob'; + } + } + + let localVarPath = `/api/accounts`; + const { basePath, withCredentials } = this.configuration; + return this.httpClient.request( + 'get', + `${basePath}${localVarPath}`, + { + context: localVarHttpContext, + params: localVarQueryParameters, + responseType: responseType_, + ...(withCredentials ? { withCredentials } : {}), + headers: localVarHeaders, + observe: observe, + ...(localVarTransferCache !== undefined + ? { transferCache: localVarTransferCache } + : {}), + reportProgress: reportProgress, + }, + ); + } + + /** + * Login with One-Time Key + * Login using a one-time key (OTK) sent to the user\'s email. + * @endpoint post /api/auth/v2/login + * @param bodyLogin + * @param observe set whether or not to return the data Observable as the body, response or events. defaults to returning the body. + * @param reportProgress flag to report request and response progress. + */ + public login( + bodyLogin: BodyLogin, + observe?: 'body', + reportProgress?: boolean, + options?: { + httpHeaderAccept?: 'application/json'; + context?: HttpContext; + transferCache?: boolean; + }, + ): Observable; + public login( + bodyLogin: BodyLogin, + observe?: 'response', + reportProgress?: boolean, + options?: { + httpHeaderAccept?: 'application/json'; + context?: HttpContext; + transferCache?: boolean; + }, + ): Observable>; + public login( + bodyLogin: BodyLogin, + observe?: 'events', + reportProgress?: boolean, + options?: { + httpHeaderAccept?: 'application/json'; + context?: HttpContext; + transferCache?: boolean; + }, + ): Observable>; + public login( + bodyLogin: BodyLogin, + observe: any = 'body', + reportProgress: boolean = false, + options?: { + httpHeaderAccept?: 'application/json'; + context?: HttpContext; + transferCache?: boolean; + }, + ): Observable { + if (bodyLogin === null || bodyLogin === undefined) { + throw new Error( + 'Required parameter bodyLogin was null or undefined when calling login.', + ); + } + + let localVarHeaders = this.defaultHeaders; + + const localVarHttpHeaderAcceptSelected: string | undefined = + options?.httpHeaderAccept ?? + this.configuration.selectHeaderAccept(['application/json']); + if (localVarHttpHeaderAcceptSelected !== undefined) { + localVarHeaders = localVarHeaders.set( + 'Accept', + localVarHttpHeaderAcceptSelected, + ); + } + + const localVarHttpContext: HttpContext = + options?.context ?? new HttpContext(); + + const localVarTransferCache: boolean = options?.transferCache ?? true; + + // to determine the Content-Type header + const consumes: string[] = ['application/json']; + const httpContentTypeSelected: string | undefined = + this.configuration.selectHeaderContentType(consumes); + if (httpContentTypeSelected !== undefined) { + localVarHeaders = localVarHeaders.set( + 'Content-Type', + httpContentTypeSelected, + ); + } + + let responseType_: 'text' | 'json' | 'blob' = 'json'; + if (localVarHttpHeaderAcceptSelected) { + if (localVarHttpHeaderAcceptSelected.startsWith('text')) { + responseType_ = 'text'; + } else if ( + this.configuration.isJsonMime(localVarHttpHeaderAcceptSelected) + ) { + responseType_ = 'json'; + } else { + responseType_ = 'blob'; + } + } + + let localVarPath = `/api/auth/v2/login`; + const { basePath, withCredentials } = this.configuration; + return this.httpClient.request( + 'post', + `${basePath}${localVarPath}`, + { + context: localVarHttpContext, + body: bodyLogin, + responseType: responseType_, + ...(withCredentials ? { withCredentials } : {}), + headers: localVarHeaders, + observe: observe, + ...(localVarTransferCache !== undefined + ? { transferCache: localVarTransferCache } + : {}), + reportProgress: reportProgress, + }, + ); + } + + /** + * Logout + * Logout the authenticated user. + * @endpoint post /api/auth/v2/logout + * @param secureFgpAcc + * @param observe set whether or not to return the data Observable as the body, response or events. defaults to returning the body. + * @param reportProgress flag to report request and response progress. + */ + public logout( + secureFgpAcc?: string, + observe?: 'body', + reportProgress?: boolean, + options?: { + httpHeaderAccept?: 'application/json'; + context?: HttpContext; + transferCache?: boolean; + }, + ): Observable; + public logout( + secureFgpAcc?: string, + observe?: 'response', + reportProgress?: boolean, + options?: { + httpHeaderAccept?: 'application/json'; + context?: HttpContext; + transferCache?: boolean; + }, + ): Observable>; + public logout( + secureFgpAcc?: string, + observe?: 'events', + reportProgress?: boolean, + options?: { + httpHeaderAccept?: 'application/json'; + context?: HttpContext; + transferCache?: boolean; + }, + ): Observable>; + public logout( + secureFgpAcc?: string, + observe: any = 'body', + reportProgress: boolean = false, + options?: { + httpHeaderAccept?: 'application/json'; + context?: HttpContext; + transferCache?: boolean; + }, + ): Observable { + let localVarHeaders = this.defaultHeaders; + + // authentication (HTTPBearer) required + localVarHeaders = this.configuration.addCredentialToHeaders( + 'HTTPBearer', + 'Authorization', + localVarHeaders, + 'Bearer ', + ); + + const localVarHttpHeaderAcceptSelected: string | undefined = + options?.httpHeaderAccept ?? + this.configuration.selectHeaderAccept(['application/json']); + if (localVarHttpHeaderAcceptSelected !== undefined) { + localVarHeaders = localVarHeaders.set( + 'Accept', + localVarHttpHeaderAcceptSelected, + ); + } + + const localVarHttpContext: HttpContext = + options?.context ?? new HttpContext(); + + const localVarTransferCache: boolean = options?.transferCache ?? true; + + let responseType_: 'text' | 'json' | 'blob' = 'json'; + if (localVarHttpHeaderAcceptSelected) { + if (localVarHttpHeaderAcceptSelected.startsWith('text')) { + responseType_ = 'text'; + } else if ( + this.configuration.isJsonMime(localVarHttpHeaderAcceptSelected) + ) { + responseType_ = 'json'; + } else { + responseType_ = 'blob'; + } + } + + let localVarPath = `/api/auth/v2/logout`; + const { basePath, withCredentials } = this.configuration; + return this.httpClient.request('post', `${basePath}${localVarPath}`, { + context: localVarHttpContext, + responseType: responseType_, + ...(withCredentials ? { withCredentials } : {}), + headers: localVarHeaders, + observe: observe, + ...(localVarTransferCache !== undefined + ? { transferCache: localVarTransferCache } + : {}), + reportProgress: reportProgress, + }); + } + + /** + * Refresh Access Token + * Refresh the access token using a valid refresh token. + * @endpoint post /api/auth/v2/refresh + * @param refreshToken + * @param observe set whether or not to return the data Observable as the body, response or events. defaults to returning the body. + * @param reportProgress flag to report request and response progress. + */ + public refreshAccessToken( + refreshToken?: string, + observe?: 'body', + reportProgress?: boolean, + options?: { + httpHeaderAccept?: 'application/json'; + context?: HttpContext; + transferCache?: boolean; + }, + ): Observable; + public refreshAccessToken( + refreshToken?: string, + observe?: 'response', + reportProgress?: boolean, + options?: { + httpHeaderAccept?: 'application/json'; + context?: HttpContext; + transferCache?: boolean; + }, + ): Observable>; + public refreshAccessToken( + refreshToken?: string, + observe?: 'events', + reportProgress?: boolean, + options?: { + httpHeaderAccept?: 'application/json'; + context?: HttpContext; + transferCache?: boolean; + }, + ): Observable>; + public refreshAccessToken( + refreshToken?: string, + observe: any = 'body', + reportProgress: boolean = false, + options?: { + httpHeaderAccept?: 'application/json'; + context?: HttpContext; + transferCache?: boolean; + }, + ): Observable { + let localVarHeaders = this.defaultHeaders; + + const localVarHttpHeaderAcceptSelected: string | undefined = + options?.httpHeaderAccept ?? + this.configuration.selectHeaderAccept(['application/json']); + if (localVarHttpHeaderAcceptSelected !== undefined) { + localVarHeaders = localVarHeaders.set( + 'Accept', + localVarHttpHeaderAcceptSelected, + ); + } + + const localVarHttpContext: HttpContext = + options?.context ?? new HttpContext(); + + const localVarTransferCache: boolean = options?.transferCache ?? true; + + let responseType_: 'text' | 'json' | 'blob' = 'json'; + if (localVarHttpHeaderAcceptSelected) { + if (localVarHttpHeaderAcceptSelected.startsWith('text')) { + responseType_ = 'text'; + } else if ( + this.configuration.isJsonMime(localVarHttpHeaderAcceptSelected) + ) { + responseType_ = 'json'; + } else { + responseType_ = 'blob'; + } + } + + let localVarPath = `/api/auth/v2/refresh`; + const { basePath, withCredentials } = this.configuration; + return this.httpClient.request( + 'post', + `${basePath}${localVarPath}`, + { + context: localVarHttpContext, + responseType: responseType_, + ...(withCredentials ? { withCredentials } : {}), + headers: localVarHeaders, + observe: observe, + ...(localVarTransferCache !== undefined + ? { transferCache: localVarTransferCache } + : {}), + reportProgress: reportProgress, + }, + ); + } + + /** + * Request One-Time Key + * Request a one-time key (OTK) for authentication using email and password. + * @endpoint post /api/auth/v2/request-otk + * @param bodyRequestOtk + * @param observe set whether or not to return the data Observable as the body, response or events. defaults to returning the body. + * @param reportProgress flag to report request and response progress. + */ + public requestOtk( + bodyRequestOtk: BodyRequestOtk, + observe?: 'body', + reportProgress?: boolean, + options?: { + httpHeaderAccept?: 'application/json'; + context?: HttpContext; + transferCache?: boolean; + }, + ): Observable; + public requestOtk( + bodyRequestOtk: BodyRequestOtk, + observe?: 'response', + reportProgress?: boolean, + options?: { + httpHeaderAccept?: 'application/json'; + context?: HttpContext; + transferCache?: boolean; + }, + ): Observable>; + public requestOtk( + bodyRequestOtk: BodyRequestOtk, + observe?: 'events', + reportProgress?: boolean, + options?: { + httpHeaderAccept?: 'application/json'; + context?: HttpContext; + transferCache?: boolean; + }, + ): Observable>; + public requestOtk( + bodyRequestOtk: BodyRequestOtk, + observe: any = 'body', + reportProgress: boolean = false, + options?: { + httpHeaderAccept?: 'application/json'; + context?: HttpContext; + transferCache?: boolean; + }, + ): Observable { + if (bodyRequestOtk === null || bodyRequestOtk === undefined) { + throw new Error( + 'Required parameter bodyRequestOtk was null or undefined when calling requestOtk.', + ); + } + + let localVarHeaders = this.defaultHeaders; + + const localVarHttpHeaderAcceptSelected: string | undefined = + options?.httpHeaderAccept ?? + this.configuration.selectHeaderAccept(['application/json']); + if (localVarHttpHeaderAcceptSelected !== undefined) { + localVarHeaders = localVarHeaders.set( + 'Accept', + localVarHttpHeaderAcceptSelected, + ); + } + + const localVarHttpContext: HttpContext = + options?.context ?? new HttpContext(); + + const localVarTransferCache: boolean = options?.transferCache ?? true; + + // to determine the Content-Type header + const consumes: string[] = ['application/json']; + const httpContentTypeSelected: string | undefined = + this.configuration.selectHeaderContentType(consumes); + if (httpContentTypeSelected !== undefined) { + localVarHeaders = localVarHeaders.set( + 'Content-Type', + httpContentTypeSelected, + ); + } + + let responseType_: 'text' | 'json' | 'blob' = 'json'; + if (localVarHttpHeaderAcceptSelected) { + if (localVarHttpHeaderAcceptSelected.startsWith('text')) { + responseType_ = 'text'; + } else if ( + this.configuration.isJsonMime(localVarHttpHeaderAcceptSelected) + ) { + responseType_ = 'json'; + } else { + responseType_ = 'blob'; + } + } + + let localVarPath = `/api/auth/v2/request-otk`; + const { basePath, withCredentials } = this.configuration; + return this.httpClient.request( + 'post', + `${basePath}${localVarPath}`, + { + context: localVarHttpContext, + body: bodyRequestOtk, + responseType: responseType_, + ...(withCredentials ? { withCredentials } : {}), + headers: localVarHeaders, + observe: observe, + ...(localVarTransferCache !== undefined + ? { transferCache: localVarTransferCache } + : {}), + reportProgress: reportProgress, + }, + ); + } + + /** + * Update Account + * @endpoint put /api/accounts/{account_id} + * @param accountId + * @param updateAccountRequest + * @param secureFgpAcc + * @param observe set whether or not to return the data Observable as the body, response or events. defaults to returning the body. + * @param reportProgress flag to report request and response progress. + */ + public updateAccount( + accountId: string, + updateAccountRequest: UpdateAccountRequest, + secureFgpAcc?: string, + observe?: 'body', + reportProgress?: boolean, + options?: { + httpHeaderAccept?: 'application/json'; + context?: HttpContext; + transferCache?: boolean; + }, + ): Observable; + public updateAccount( + accountId: string, + updateAccountRequest: UpdateAccountRequest, + secureFgpAcc?: string, + observe?: 'response', + reportProgress?: boolean, + options?: { + httpHeaderAccept?: 'application/json'; + context?: HttpContext; + transferCache?: boolean; + }, + ): Observable>; + public updateAccount( + accountId: string, + updateAccountRequest: UpdateAccountRequest, + secureFgpAcc?: string, + observe?: 'events', + reportProgress?: boolean, + options?: { + httpHeaderAccept?: 'application/json'; + context?: HttpContext; + transferCache?: boolean; + }, + ): Observable>; + public updateAccount( + accountId: string, + updateAccountRequest: UpdateAccountRequest, + secureFgpAcc?: string, + observe: any = 'body', + reportProgress: boolean = false, + options?: { + httpHeaderAccept?: 'application/json'; + context?: HttpContext; + transferCache?: boolean; + }, + ): Observable { + if (accountId === null || accountId === undefined) { + throw new Error( + 'Required parameter accountId was null or undefined when calling updateAccount.', + ); + } + if (updateAccountRequest === null || updateAccountRequest === undefined) { + throw new Error( + 'Required parameter updateAccountRequest was null or undefined when calling updateAccount.', + ); + } + + let localVarHeaders = this.defaultHeaders; + + // authentication (HTTPBearer) required + localVarHeaders = this.configuration.addCredentialToHeaders( + 'HTTPBearer', + 'Authorization', + localVarHeaders, + 'Bearer ', + ); + + const localVarHttpHeaderAcceptSelected: string | undefined = + options?.httpHeaderAccept ?? + this.configuration.selectHeaderAccept(['application/json']); + if (localVarHttpHeaderAcceptSelected !== undefined) { + localVarHeaders = localVarHeaders.set( + 'Accept', + localVarHttpHeaderAcceptSelected, + ); + } + + const localVarHttpContext: HttpContext = + options?.context ?? new HttpContext(); + + const localVarTransferCache: boolean = options?.transferCache ?? true; + + // to determine the Content-Type header + const consumes: string[] = ['application/json']; + const httpContentTypeSelected: string | undefined = + this.configuration.selectHeaderContentType(consumes); + if (httpContentTypeSelected !== undefined) { + localVarHeaders = localVarHeaders.set( + 'Content-Type', + httpContentTypeSelected, + ); + } + + let responseType_: 'text' | 'json' | 'blob' = 'json'; + if (localVarHttpHeaderAcceptSelected) { + if (localVarHttpHeaderAcceptSelected.startsWith('text')) { + responseType_ = 'text'; + } else if ( + this.configuration.isJsonMime(localVarHttpHeaderAcceptSelected) + ) { + responseType_ = 'json'; + } else { + responseType_ = 'blob'; + } + } + + let localVarPath = `/api/accounts/${this.configuration.encodeParam({ name: 'accountId', value: accountId, in: 'path', style: 'simple', explode: false, dataType: 'string', dataFormat: 'uuid' })}`; + const { basePath, withCredentials } = this.configuration; + return this.httpClient.request( + 'put', + `${basePath}${localVarPath}`, + { + context: localVarHttpContext, + body: updateAccountRequest, + responseType: responseType_, + ...(withCredentials ? { withCredentials } : {}), + headers: localVarHeaders, + observe: observe, + ...(localVarTransferCache !== undefined + ? { transferCache: localVarTransferCache } + : {}), + reportProgress: reportProgress, + }, + ); + } } diff --git a/webapp/src/app/api/api/companyConnections.service.ts b/webapp/src/app/api/api/companyConnections.service.ts index cbc5f803..6ad850ea 100644 --- a/webapp/src/app/api/api/companyConnections.service.ts +++ b/webapp/src/app/api/api/companyConnections.service.ts @@ -1,7 +1,7 @@ /** * Innovation Search Engine API * - * + * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech @@ -9,12 +9,18 @@ */ /* tslint:disable:no-unused-variable member-ordering */ -import { Inject, Injectable, Optional } from '@angular/core'; -import { HttpClient, HttpHeaders, HttpParams, - HttpResponse, HttpEvent, HttpParameterCodec, HttpContext - } from '@angular/common/http'; -import { CustomHttpParameterCodec } from '../encoder'; -import { Observable } from 'rxjs'; +import { Inject, Injectable, Optional } from '@angular/core'; +import { + HttpClient, + HttpHeaders, + HttpParams, + HttpResponse, + HttpEvent, + HttpParameterCodec, + HttpContext, +} from '@angular/common/http'; +import { CustomHttpParameterCodec } from '../encoder'; +import { Observable } from 'rxjs'; // @ts-ignore import { CompanyConnectionsResponse } from '../model/companyConnectionsResponse'; @@ -22,74 +28,121 @@ import { CompanyConnectionsResponse } from '../model/companyConnectionsResponse' import { HTTPValidationError } from '../model/hTTPValidationError'; // @ts-ignore -import { BASE_PATH, COLLECTION_FORMATS } from '../variables'; -import { Configuration } from '../configuration'; +import { BASE_PATH, COLLECTION_FORMATS } from '../variables'; +import { Configuration } from '../configuration'; import { BaseService } from '../api.base.service'; - - @Injectable({ - providedIn: 'root' + providedIn: 'root', }) export class CompanyConnectionsService extends BaseService { + constructor( + protected httpClient: HttpClient, + @Optional() @Inject(BASE_PATH) basePath: string | string[], + @Optional() configuration?: Configuration, + ) { + super(basePath, configuration); + } - constructor(protected httpClient: HttpClient, @Optional() @Inject(BASE_PATH) basePath: string|string[], @Optional() configuration?: Configuration) { - super(basePath, configuration); + /** + * Get possible company connections by OpenAlex author ID. + * @endpoint get /api/inse-service/authors/{author_id}/company-connections + * @param authorId + * @param observe set whether or not to return the data Observable as the body, response or events. defaults to returning the body. + * @param reportProgress flag to report request and response progress. + */ + public getCompanyConnectionsByAuthor( + authorId: string, + observe?: 'body', + reportProgress?: boolean, + options?: { + httpHeaderAccept?: 'application/json'; + context?: HttpContext; + transferCache?: boolean; + }, + ): Observable; + public getCompanyConnectionsByAuthor( + authorId: string, + observe?: 'response', + reportProgress?: boolean, + options?: { + httpHeaderAccept?: 'application/json'; + context?: HttpContext; + transferCache?: boolean; + }, + ): Observable>; + public getCompanyConnectionsByAuthor( + authorId: string, + observe?: 'events', + reportProgress?: boolean, + options?: { + httpHeaderAccept?: 'application/json'; + context?: HttpContext; + transferCache?: boolean; + }, + ): Observable>; + public getCompanyConnectionsByAuthor( + authorId: string, + observe: any = 'body', + reportProgress: boolean = false, + options?: { + httpHeaderAccept?: 'application/json'; + context?: HttpContext; + transferCache?: boolean; + }, + ): Observable { + if (authorId === null || authorId === undefined) { + throw new Error( + 'Required parameter authorId was null or undefined when calling getCompanyConnectionsByAuthor.', + ); } - /** - * Get possible company connections by OpenAlex author ID. - * @endpoint get /api/inse-service/authors/{author_id}/company-connections - * @param authorId - * @param observe set whether or not to return the data Observable as the body, response or events. defaults to returning the body. - * @param reportProgress flag to report request and response progress. - */ - public getCompanyConnectionsByAuthor(authorId: string, observe?: 'body', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable; - public getCompanyConnectionsByAuthor(authorId: string, observe?: 'response', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable>; - public getCompanyConnectionsByAuthor(authorId: string, observe?: 'events', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable>; - public getCompanyConnectionsByAuthor(authorId: string, observe: any = 'body', reportProgress: boolean = false, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable { - if (authorId === null || authorId === undefined) { - throw new Error('Required parameter authorId was null or undefined when calling getCompanyConnectionsByAuthor.'); - } + let localVarHeaders = this.defaultHeaders; - let localVarHeaders = this.defaultHeaders; - - const localVarHttpHeaderAcceptSelected: string | undefined = options?.httpHeaderAccept ?? this.configuration.selectHeaderAccept([ - 'application/json' - ]); - if (localVarHttpHeaderAcceptSelected !== undefined) { - localVarHeaders = localVarHeaders.set('Accept', localVarHttpHeaderAcceptSelected); - } - - const localVarHttpContext: HttpContext = options?.context ?? new HttpContext(); - - const localVarTransferCache: boolean = options?.transferCache ?? true; - - - let responseType_: 'text' | 'json' | 'blob' = 'json'; - if (localVarHttpHeaderAcceptSelected) { - if (localVarHttpHeaderAcceptSelected.startsWith('text')) { - responseType_ = 'text'; - } else if (this.configuration.isJsonMime(localVarHttpHeaderAcceptSelected)) { - responseType_ = 'json'; - } else { - responseType_ = 'blob'; - } - } - - let localVarPath = `/api/inse-service/authors/${this.configuration.encodeParam({name: "authorId", value: authorId, in: "path", style: "simple", explode: false, dataType: "string", dataFormat: undefined})}/company-connections`; - const { basePath, withCredentials } = this.configuration; - return this.httpClient.request('get', `${basePath}${localVarPath}`, - { - context: localVarHttpContext, - responseType: responseType_, - ...(withCredentials ? { withCredentials } : {}), - headers: localVarHeaders, - observe: observe, - ...(localVarTransferCache !== undefined ? { transferCache: localVarTransferCache } : {}), - reportProgress: reportProgress - } - ); + const localVarHttpHeaderAcceptSelected: string | undefined = + options?.httpHeaderAccept ?? + this.configuration.selectHeaderAccept(['application/json']); + if (localVarHttpHeaderAcceptSelected !== undefined) { + localVarHeaders = localVarHeaders.set( + 'Accept', + localVarHttpHeaderAcceptSelected, + ); } + const localVarHttpContext: HttpContext = + options?.context ?? new HttpContext(); + + const localVarTransferCache: boolean = options?.transferCache ?? true; + + let responseType_: 'text' | 'json' | 'blob' = 'json'; + if (localVarHttpHeaderAcceptSelected) { + if (localVarHttpHeaderAcceptSelected.startsWith('text')) { + responseType_ = 'text'; + } else if ( + this.configuration.isJsonMime(localVarHttpHeaderAcceptSelected) + ) { + responseType_ = 'json'; + } else { + responseType_ = 'blob'; + } + } + + let localVarPath = `/api/inse-service/authors/${this.configuration.encodeParam({ name: 'authorId', value: authorId, in: 'path', style: 'simple', explode: false, dataType: 'string', dataFormat: undefined })}/company-connections`; + const { basePath, withCredentials } = this.configuration; + return this.httpClient.request( + 'get', + `${basePath}${localVarPath}`, + { + context: localVarHttpContext, + responseType: responseType_, + ...(withCredentials ? { withCredentials } : {}), + headers: localVarHeaders, + observe: observe, + ...(localVarTransferCache !== undefined + ? { transferCache: localVarTransferCache } + : {}), + reportProgress: reportProgress, + }, + ); + } } diff --git a/webapp/src/app/api/api/funding.service.ts b/webapp/src/app/api/api/funding.service.ts index 46772768..f1f0a1a7 100644 --- a/webapp/src/app/api/api/funding.service.ts +++ b/webapp/src/app/api/api/funding.service.ts @@ -1,7 +1,7 @@ /** * Innovation Search Engine API * - * + * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech @@ -9,12 +9,18 @@ */ /* tslint:disable:no-unused-variable member-ordering */ -import { Inject, Injectable, Optional } from '@angular/core'; -import { HttpClient, HttpHeaders, HttpParams, - HttpResponse, HttpEvent, HttpParameterCodec, HttpContext - } from '@angular/common/http'; -import { CustomHttpParameterCodec } from '../encoder'; -import { Observable } from 'rxjs'; +import { Inject, Injectable, Optional } from '@angular/core'; +import { + HttpClient, + HttpHeaders, + HttpParams, + HttpResponse, + HttpEvent, + HttpParameterCodec, + HttpContext, +} from '@angular/common/http'; +import { CustomHttpParameterCodec } from '../encoder'; +import { Observable } from 'rxjs'; // @ts-ignore import { FundersByAuthorResponse } from '../model/fundersByAuthorResponse'; @@ -24,138 +30,246 @@ 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); + } - constructor(protected httpClient: HttpClient, @Optional() @Inject(BASE_PATH) basePath: string|string[], @Optional() configuration?: Configuration) { - super(basePath, configuration); + /** + * Get funding organizations by author. + * @endpoint get /api/inse-service/authors/{author_id}/funders + * @param authorId + * @param observe set whether or not to return the data Observable as the body, response or events. defaults to returning the body. + * @param reportProgress flag to report request and response progress. + */ + public getFundersByAuthor( + authorId: string, + observe?: 'body', + reportProgress?: boolean, + options?: { + httpHeaderAccept?: 'application/json'; + context?: HttpContext; + transferCache?: boolean; + }, + ): Observable; + public getFundersByAuthor( + authorId: string, + observe?: 'response', + reportProgress?: boolean, + options?: { + httpHeaderAccept?: 'application/json'; + context?: HttpContext; + transferCache?: boolean; + }, + ): Observable>; + public getFundersByAuthor( + authorId: string, + observe?: 'events', + reportProgress?: boolean, + options?: { + httpHeaderAccept?: 'application/json'; + context?: HttpContext; + transferCache?: boolean; + }, + ): Observable>; + public getFundersByAuthor( + authorId: string, + observe: any = 'body', + reportProgress: boolean = false, + options?: { + httpHeaderAccept?: 'application/json'; + context?: HttpContext; + transferCache?: boolean; + }, + ): Observable { + if (authorId === null || authorId === undefined) { + throw new Error( + 'Required parameter authorId was null or undefined when calling getFundersByAuthor.', + ); } - /** - * Get funding organizations by author. - * @endpoint get /api/inse-service/authors/{author_id}/funders - * @param authorId - * @param observe set whether or not to return the data Observable as the body, response or events. defaults to returning the body. - * @param reportProgress flag to report request and response progress. - */ - public getFundersByAuthor(authorId: string, observe?: 'body', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable; - public getFundersByAuthor(authorId: string, observe?: 'response', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable>; - public getFundersByAuthor(authorId: string, observe?: 'events', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable>; - public getFundersByAuthor(authorId: string, observe: any = 'body', reportProgress: boolean = false, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable { - if (authorId === null || authorId === undefined) { - throw new Error('Required parameter authorId was null or undefined when calling getFundersByAuthor.'); - } + let localVarHeaders = this.defaultHeaders; - let localVarHeaders = this.defaultHeaders; - - const localVarHttpHeaderAcceptSelected: string | undefined = options?.httpHeaderAccept ?? this.configuration.selectHeaderAccept([ - 'application/json' - ]); - if (localVarHttpHeaderAcceptSelected !== undefined) { - localVarHeaders = localVarHeaders.set('Accept', localVarHttpHeaderAcceptSelected); - } - - const localVarHttpContext: HttpContext = options?.context ?? new HttpContext(); - - const localVarTransferCache: boolean = options?.transferCache ?? true; - - - let responseType_: 'text' | 'json' | 'blob' = 'json'; - if (localVarHttpHeaderAcceptSelected) { - if (localVarHttpHeaderAcceptSelected.startsWith('text')) { - responseType_ = 'text'; - } else if (this.configuration.isJsonMime(localVarHttpHeaderAcceptSelected)) { - responseType_ = 'json'; - } else { - responseType_ = 'blob'; - } - } - - let localVarPath = `/api/inse-service/authors/${this.configuration.encodeParam({name: "authorId", value: authorId, in: "path", style: "simple", explode: false, dataType: "string", dataFormat: undefined})}/funders`; - const { basePath, withCredentials } = this.configuration; - return this.httpClient.request('get', `${basePath}${localVarPath}`, - { - context: localVarHttpContext, - responseType: responseType_, - ...(withCredentials ? { withCredentials } : {}), - headers: localVarHeaders, - observe: observe, - ...(localVarTransferCache !== undefined ? { transferCache: localVarTransferCache } : {}), - reportProgress: reportProgress - } - ); + const localVarHttpHeaderAcceptSelected: string | undefined = + options?.httpHeaderAccept ?? + this.configuration.selectHeaderAccept(['application/json']); + if (localVarHttpHeaderAcceptSelected !== undefined) { + localVarHeaders = localVarHeaders.set( + 'Accept', + localVarHttpHeaderAcceptSelected, + ); } - /** - * Get funded publications by author. - * @endpoint get /api/inse-service/authors/{author_id}/publications - * @param authorId - * @param page - * @param pageSize - * @param observe set whether or not to return the data Observable as the body, response or events. defaults to returning the body. - * @param reportProgress flag to report request and response progress. - */ - public getPublicationsByAuthor(authorId: string, page?: number, pageSize?: number, observe?: 'body', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable; - public getPublicationsByAuthor(authorId: string, page?: number, pageSize?: number, observe?: 'response', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable>; - public getPublicationsByAuthor(authorId: string, page?: number, pageSize?: number, observe?: 'events', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable>; - public getPublicationsByAuthor(authorId: string, page?: number, pageSize?: number, observe: any = 'body', reportProgress: boolean = false, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable { - if (authorId === null || authorId === undefined) { - throw new Error('Required parameter authorId was null or undefined when calling getPublicationsByAuthor.'); - } + const localVarHttpContext: HttpContext = + options?.context ?? new HttpContext(); - let localVarQueryParameters = new HttpParams({encoder: this.encoder}); - localVarQueryParameters = this.addToHttpParams(localVarQueryParameters, - page, 'page'); - localVarQueryParameters = this.addToHttpParams(localVarQueryParameters, - pageSize, 'page_size'); + const localVarTransferCache: boolean = options?.transferCache ?? true; - let localVarHeaders = this.defaultHeaders; - - const localVarHttpHeaderAcceptSelected: string | undefined = options?.httpHeaderAccept ?? this.configuration.selectHeaderAccept([ - 'application/json' - ]); - if (localVarHttpHeaderAcceptSelected !== undefined) { - localVarHeaders = localVarHeaders.set('Accept', localVarHttpHeaderAcceptSelected); - } - - const localVarHttpContext: HttpContext = options?.context ?? new HttpContext(); - - const localVarTransferCache: boolean = options?.transferCache ?? true; - - - let responseType_: 'text' | 'json' | 'blob' = 'json'; - if (localVarHttpHeaderAcceptSelected) { - if (localVarHttpHeaderAcceptSelected.startsWith('text')) { - responseType_ = 'text'; - } else if (this.configuration.isJsonMime(localVarHttpHeaderAcceptSelected)) { - responseType_ = 'json'; - } else { - responseType_ = 'blob'; - } - } - - let localVarPath = `/api/inse-service/authors/${this.configuration.encodeParam({name: "authorId", value: authorId, in: "path", style: "simple", explode: false, dataType: "string", dataFormat: undefined})}/publications`; - const { basePath, withCredentials } = this.configuration; - return this.httpClient.request('get', `${basePath}${localVarPath}`, - { - context: localVarHttpContext, - params: localVarQueryParameters, - responseType: responseType_, - ...(withCredentials ? { withCredentials } : {}), - headers: localVarHeaders, - observe: observe, - ...(localVarTransferCache !== undefined ? { transferCache: localVarTransferCache } : {}), - reportProgress: reportProgress - } - ); + let responseType_: 'text' | 'json' | 'blob' = 'json'; + if (localVarHttpHeaderAcceptSelected) { + if (localVarHttpHeaderAcceptSelected.startsWith('text')) { + responseType_ = 'text'; + } else if ( + this.configuration.isJsonMime(localVarHttpHeaderAcceptSelected) + ) { + responseType_ = 'json'; + } else { + responseType_ = 'blob'; + } } + let localVarPath = `/api/inse-service/authors/${this.configuration.encodeParam({ name: 'authorId', value: authorId, in: 'path', style: 'simple', explode: false, dataType: 'string', dataFormat: undefined })}/funders`; + const { basePath, withCredentials } = this.configuration; + return this.httpClient.request( + 'get', + `${basePath}${localVarPath}`, + { + context: localVarHttpContext, + responseType: responseType_, + ...(withCredentials ? { withCredentials } : {}), + headers: localVarHeaders, + observe: observe, + ...(localVarTransferCache !== undefined + ? { transferCache: localVarTransferCache } + : {}), + reportProgress: reportProgress, + }, + ); + } + + /** + * Get funded publications by author. + * @endpoint get /api/inse-service/authors/{author_id}/publications + * @param authorId + * @param page + * @param pageSize + * @param observe set whether or not to return the data Observable as the body, response or events. defaults to returning the body. + * @param reportProgress flag to report request and response progress. + */ + public getPublicationsByAuthor( + authorId: string, + page?: number, + pageSize?: number, + observe?: 'body', + reportProgress?: boolean, + options?: { + httpHeaderAccept?: 'application/json'; + context?: HttpContext; + transferCache?: boolean; + }, + ): Observable; + public getPublicationsByAuthor( + authorId: string, + page?: number, + pageSize?: number, + observe?: 'response', + reportProgress?: boolean, + options?: { + httpHeaderAccept?: 'application/json'; + context?: HttpContext; + transferCache?: boolean; + }, + ): Observable>; + public getPublicationsByAuthor( + authorId: string, + page?: number, + pageSize?: number, + observe?: 'events', + reportProgress?: boolean, + options?: { + httpHeaderAccept?: 'application/json'; + context?: HttpContext; + transferCache?: boolean; + }, + ): Observable>; + public getPublicationsByAuthor( + authorId: string, + page?: number, + pageSize?: number, + observe: any = 'body', + reportProgress: boolean = false, + options?: { + httpHeaderAccept?: 'application/json'; + context?: HttpContext; + transferCache?: boolean; + }, + ): Observable { + if (authorId === null || authorId === undefined) { + throw new Error( + 'Required parameter authorId was null or undefined when calling getPublicationsByAuthor.', + ); + } + + let localVarQueryParameters = new HttpParams({ encoder: this.encoder }); + localVarQueryParameters = this.addToHttpParams( + localVarQueryParameters, + page, + 'page', + ); + localVarQueryParameters = this.addToHttpParams( + localVarQueryParameters, + pageSize, + 'page_size', + ); + + let localVarHeaders = this.defaultHeaders; + + const localVarHttpHeaderAcceptSelected: string | undefined = + options?.httpHeaderAccept ?? + this.configuration.selectHeaderAccept(['application/json']); + if (localVarHttpHeaderAcceptSelected !== undefined) { + localVarHeaders = localVarHeaders.set( + 'Accept', + localVarHttpHeaderAcceptSelected, + ); + } + + const localVarHttpContext: HttpContext = + options?.context ?? new HttpContext(); + + const localVarTransferCache: boolean = options?.transferCache ?? true; + + let responseType_: 'text' | 'json' | 'blob' = 'json'; + if (localVarHttpHeaderAcceptSelected) { + if (localVarHttpHeaderAcceptSelected.startsWith('text')) { + responseType_ = 'text'; + } else if ( + this.configuration.isJsonMime(localVarHttpHeaderAcceptSelected) + ) { + responseType_ = 'json'; + } else { + responseType_ = 'blob'; + } + } + + let localVarPath = `/api/inse-service/authors/${this.configuration.encodeParam({ name: 'authorId', value: authorId, in: 'path', style: 'simple', explode: false, dataType: 'string', dataFormat: undefined })}/publications`; + const { basePath, withCredentials } = this.configuration; + return this.httpClient.request( + 'get', + `${basePath}${localVarPath}`, + { + context: localVarHttpContext, + params: localVarQueryParameters, + responseType: responseType_, + ...(withCredentials ? { withCredentials } : {}), + headers: localVarHeaders, + observe: observe, + ...(localVarTransferCache !== undefined + ? { transferCache: localVarTransferCache } + : {}), + reportProgress: reportProgress, + }, + ); + } } diff --git a/webapp/src/app/api/api/news.service.ts b/webapp/src/app/api/api/news.service.ts index 8ff477cf..eb6e0f11 100644 --- a/webapp/src/app/api/api/news.service.ts +++ b/webapp/src/app/api/api/news.service.ts @@ -1,7 +1,7 @@ /** * Innovation Search Engine API * - * + * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech @@ -9,12 +9,18 @@ */ /* tslint:disable:no-unused-variable member-ordering */ -import { Inject, Injectable, Optional } from '@angular/core'; -import { HttpClient, HttpHeaders, HttpParams, - HttpResponse, HttpEvent, HttpParameterCodec, HttpContext - } from '@angular/common/http'; -import { CustomHttpParameterCodec } from '../encoder'; -import { Observable } from 'rxjs'; +import { Inject, Injectable, Optional } from '@angular/core'; +import { + HttpClient, + HttpHeaders, + HttpParams, + HttpResponse, + HttpEvent, + HttpParameterCodec, + HttpContext, +} from '@angular/common/http'; +import { CustomHttpParameterCodec } from '../encoder'; +import { Observable } from 'rxjs'; // @ts-ignore import { HTTPValidationError } from '../model/hTTPValidationError'; @@ -24,567 +30,1151 @@ import { NewsArticleDetail } from '../model/newsArticleDetail'; import { NewsPage } from '../model/newsPage'; // @ts-ignore -import { BASE_PATH, COLLECTION_FORMATS } from '../variables'; -import { Configuration } from '../configuration'; +import { BASE_PATH, COLLECTION_FORMATS } from '../variables'; +import { Configuration } from '../configuration'; import { BaseService } from '../api.base.service'; - - @Injectable({ - providedIn: 'root' + providedIn: 'root', }) export class NewsService extends BaseService { + constructor( + protected httpClient: HttpClient, + @Optional() @Inject(BASE_PATH) basePath: string | string[], + @Optional() configuration?: Configuration, + ) { + super(basePath, configuration); + } - constructor(protected httpClient: HttpClient, @Optional() @Inject(BASE_PATH) basePath: string|string[], @Optional() configuration?: Configuration) { - super(basePath, configuration); + /** + * Returns news articles in which the given person is mentioned. + * @endpoint get /api/news/by-author + * @param authorId OpenAlex author id, e.g. A5034365278. + * @param page Page number (1-based). + * @param pageSize Articles per page. + * @param sortOrder Sort order: \'desc\' (newest first) or \'asc\' (oldest first). + * @param query Optional search term, matched against title/author. + * @param observe set whether or not to return the data Observable as the body, response or events. defaults to returning the body. + * @param reportProgress flag to report request and response progress. + */ + public getNewsByAuthor( + authorId: string, + page?: number, + pageSize?: number, + sortOrder?: string, + query?: string, + observe?: 'body', + reportProgress?: boolean, + options?: { + httpHeaderAccept?: 'application/json'; + context?: HttpContext; + transferCache?: boolean; + }, + ): Observable; + public getNewsByAuthor( + authorId: string, + page?: number, + pageSize?: number, + sortOrder?: string, + query?: string, + observe?: 'response', + reportProgress?: boolean, + options?: { + httpHeaderAccept?: 'application/json'; + context?: HttpContext; + transferCache?: boolean; + }, + ): Observable>; + public getNewsByAuthor( + authorId: string, + page?: number, + pageSize?: number, + sortOrder?: string, + query?: string, + observe?: 'events', + reportProgress?: boolean, + options?: { + httpHeaderAccept?: 'application/json'; + context?: HttpContext; + transferCache?: boolean; + }, + ): Observable>; + public getNewsByAuthor( + authorId: string, + page?: number, + pageSize?: number, + sortOrder?: string, + query?: string, + observe: any = 'body', + reportProgress: boolean = false, + options?: { + httpHeaderAccept?: 'application/json'; + context?: HttpContext; + transferCache?: boolean; + }, + ): Observable { + if (authorId === null || authorId === undefined) { + throw new Error( + 'Required parameter authorId was null or undefined when calling getNewsByAuthor.', + ); } - /** - * Returns news articles in which the given person is mentioned. - * @endpoint get /api/news/by-author - * @param authorId OpenAlex author id, e.g. A5034365278. - * @param page Page number (1-based). - * @param pageSize Articles per page. - * @param sortOrder Sort order: \'desc\' (newest first) or \'asc\' (oldest first). - * @param query Optional search term, matched against title/author. - * @param observe set whether or not to return the data Observable as the body, response or events. defaults to returning the body. - * @param reportProgress flag to report request and response progress. - */ - public getNewsByAuthor(authorId: string, page?: number, pageSize?: number, sortOrder?: string, query?: string, observe?: 'body', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable; - public getNewsByAuthor(authorId: string, page?: number, pageSize?: number, sortOrder?: string, query?: string, observe?: 'response', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable>; - public getNewsByAuthor(authorId: string, page?: number, pageSize?: number, sortOrder?: string, query?: string, observe?: 'events', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable>; - public getNewsByAuthor(authorId: string, page?: number, pageSize?: number, sortOrder?: string, query?: string, observe: any = 'body', reportProgress: boolean = false, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable { - if (authorId === null || authorId === undefined) { - throw new Error('Required parameter authorId was null or undefined when calling getNewsByAuthor.'); - } + let localVarQueryParameters = new HttpParams({ encoder: this.encoder }); + localVarQueryParameters = this.addToHttpParams( + localVarQueryParameters, + authorId, + 'authorId', + ); + localVarQueryParameters = this.addToHttpParams( + localVarQueryParameters, + page, + 'page', + ); + localVarQueryParameters = this.addToHttpParams( + localVarQueryParameters, + pageSize, + 'pageSize', + ); + localVarQueryParameters = this.addToHttpParams( + localVarQueryParameters, + sortOrder, + 'sortOrder', + ); + localVarQueryParameters = this.addToHttpParams( + localVarQueryParameters, + query, + 'query', + ); - let localVarQueryParameters = new HttpParams({encoder: this.encoder}); - localVarQueryParameters = this.addToHttpParams(localVarQueryParameters, - authorId, 'authorId'); - localVarQueryParameters = this.addToHttpParams(localVarQueryParameters, - page, 'page'); - localVarQueryParameters = this.addToHttpParams(localVarQueryParameters, - pageSize, 'pageSize'); - localVarQueryParameters = this.addToHttpParams(localVarQueryParameters, - sortOrder, 'sortOrder'); - localVarQueryParameters = this.addToHttpParams(localVarQueryParameters, - query, 'query'); + let localVarHeaders = this.defaultHeaders; - let localVarHeaders = this.defaultHeaders; - - const localVarHttpHeaderAcceptSelected: string | undefined = options?.httpHeaderAccept ?? this.configuration.selectHeaderAccept([ - 'application/json' - ]); - if (localVarHttpHeaderAcceptSelected !== undefined) { - localVarHeaders = localVarHeaders.set('Accept', localVarHttpHeaderAcceptSelected); - } - - const localVarHttpContext: HttpContext = options?.context ?? new HttpContext(); - - const localVarTransferCache: boolean = options?.transferCache ?? true; - - - let responseType_: 'text' | 'json' | 'blob' = 'json'; - if (localVarHttpHeaderAcceptSelected) { - if (localVarHttpHeaderAcceptSelected.startsWith('text')) { - responseType_ = 'text'; - } else if (this.configuration.isJsonMime(localVarHttpHeaderAcceptSelected)) { - responseType_ = 'json'; - } else { - responseType_ = 'blob'; - } - } - - let localVarPath = `/api/news/by-author`; - const { basePath, withCredentials } = this.configuration; - return this.httpClient.request('get', `${basePath}${localVarPath}`, - { - context: localVarHttpContext, - params: localVarQueryParameters, - responseType: responseType_, - ...(withCredentials ? { withCredentials } : {}), - headers: localVarHeaders, - observe: observe, - ...(localVarTransferCache !== undefined ? { transferCache: localVarTransferCache } : {}), - reportProgress: reportProgress - } - ); + const localVarHttpHeaderAcceptSelected: string | undefined = + options?.httpHeaderAccept ?? + this.configuration.selectHeaderAccept(['application/json']); + if (localVarHttpHeaderAcceptSelected !== undefined) { + localVarHeaders = localVarHeaders.set( + 'Accept', + localVarHttpHeaderAcceptSelected, + ); } - /** - * Returns news articles in which the given person is mentioned. - * @endpoint get /api/news/by-author - * @param authorId OpenAlex author id, e.g. A5034365278. - * @param page Page number (1-based). - * @param pageSize Articles per page. - * @param sortOrder Sort order: \'desc\' (newest first) or \'asc\' (oldest first). - * @param query Optional search term, matched against title/author. - * @param observe set whether or not to return the data Observable as the body, response or events. defaults to returning the body. - * @param reportProgress flag to report request and response progress. - */ - public getNewsByAuthor_1(authorId: string, page?: number, pageSize?: number, sortOrder?: string, query?: string, observe?: 'body', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable; - public getNewsByAuthor_1(authorId: string, page?: number, pageSize?: number, sortOrder?: string, query?: string, observe?: 'response', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable>; - public getNewsByAuthor_1(authorId: string, page?: number, pageSize?: number, sortOrder?: string, query?: string, observe?: 'events', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable>; - public getNewsByAuthor_1(authorId: string, page?: number, pageSize?: number, sortOrder?: string, query?: string, observe: any = 'body', reportProgress: boolean = false, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable { - if (authorId === null || authorId === undefined) { - throw new Error('Required parameter authorId was null or undefined when calling getNewsByAuthor_1.'); - } + const localVarHttpContext: HttpContext = + options?.context ?? new HttpContext(); - let localVarQueryParameters = new HttpParams({encoder: this.encoder}); - localVarQueryParameters = this.addToHttpParams(localVarQueryParameters, - authorId, 'authorId'); - localVarQueryParameters = this.addToHttpParams(localVarQueryParameters, - page, 'page'); - localVarQueryParameters = this.addToHttpParams(localVarQueryParameters, - pageSize, 'pageSize'); - localVarQueryParameters = this.addToHttpParams(localVarQueryParameters, - sortOrder, 'sortOrder'); - localVarQueryParameters = this.addToHttpParams(localVarQueryParameters, - query, 'query'); + const localVarTransferCache: boolean = options?.transferCache ?? true; - let localVarHeaders = this.defaultHeaders; - - const localVarHttpHeaderAcceptSelected: string | undefined = options?.httpHeaderAccept ?? this.configuration.selectHeaderAccept([ - 'application/json' - ]); - if (localVarHttpHeaderAcceptSelected !== undefined) { - localVarHeaders = localVarHeaders.set('Accept', localVarHttpHeaderAcceptSelected); - } - - const localVarHttpContext: HttpContext = options?.context ?? new HttpContext(); - - const localVarTransferCache: boolean = options?.transferCache ?? true; - - - let responseType_: 'text' | 'json' | 'blob' = 'json'; - if (localVarHttpHeaderAcceptSelected) { - if (localVarHttpHeaderAcceptSelected.startsWith('text')) { - responseType_ = 'text'; - } else if (this.configuration.isJsonMime(localVarHttpHeaderAcceptSelected)) { - responseType_ = 'json'; - } else { - responseType_ = 'blob'; - } - } - - let localVarPath = `/api/news/by-author`; - const { basePath, withCredentials } = this.configuration; - return this.httpClient.request('get', `${basePath}${localVarPath}`, - { - context: localVarHttpContext, - params: localVarQueryParameters, - responseType: responseType_, - ...(withCredentials ? { withCredentials } : {}), - headers: localVarHeaders, - observe: observe, - ...(localVarTransferCache !== undefined ? { transferCache: localVarTransferCache } : {}), - reportProgress: reportProgress - } - ); + let responseType_: 'text' | 'json' | 'blob' = 'json'; + if (localVarHttpHeaderAcceptSelected) { + if (localVarHttpHeaderAcceptSelected.startsWith('text')) { + responseType_ = 'text'; + } else if ( + this.configuration.isJsonMime(localVarHttpHeaderAcceptSelected) + ) { + responseType_ = 'json'; + } else { + responseType_ = 'blob'; + } } - /** - * Returns a single news article including its full content. - * @endpoint get /api/news/{news_id} - * @param newsId The unique id of the news article (Elasticsearch _id). - * @param observe set whether or not to return the data Observable as the body, response or events. defaults to returning the body. - * @param reportProgress flag to report request and response progress. - */ - public getNewsById(newsId: string, observe?: 'body', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable; - public getNewsById(newsId: string, observe?: 'response', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable>; - public getNewsById(newsId: string, observe?: 'events', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable>; - public getNewsById(newsId: string, observe: any = 'body', reportProgress: boolean = false, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable { - if (newsId === null || newsId === undefined) { - throw new Error('Required parameter newsId was null or undefined when calling getNewsById.'); - } + let localVarPath = `/api/news/by-author`; + const { basePath, withCredentials } = this.configuration; + return this.httpClient.request( + 'get', + `${basePath}${localVarPath}`, + { + context: localVarHttpContext, + params: localVarQueryParameters, + responseType: responseType_, + ...(withCredentials ? { withCredentials } : {}), + headers: localVarHeaders, + observe: observe, + ...(localVarTransferCache !== undefined + ? { transferCache: localVarTransferCache } + : {}), + reportProgress: reportProgress, + }, + ); + } - let localVarHeaders = this.defaultHeaders; - - const localVarHttpHeaderAcceptSelected: string | undefined = options?.httpHeaderAccept ?? this.configuration.selectHeaderAccept([ - 'application/json' - ]); - if (localVarHttpHeaderAcceptSelected !== undefined) { - localVarHeaders = localVarHeaders.set('Accept', localVarHttpHeaderAcceptSelected); - } - - const localVarHttpContext: HttpContext = options?.context ?? new HttpContext(); - - const localVarTransferCache: boolean = options?.transferCache ?? true; - - - let responseType_: 'text' | 'json' | 'blob' = 'json'; - if (localVarHttpHeaderAcceptSelected) { - if (localVarHttpHeaderAcceptSelected.startsWith('text')) { - responseType_ = 'text'; - } else if (this.configuration.isJsonMime(localVarHttpHeaderAcceptSelected)) { - responseType_ = 'json'; - } else { - responseType_ = 'blob'; - } - } - - let localVarPath = `/api/news/${this.configuration.encodeParam({name: "newsId", value: newsId, in: "path", style: "simple", explode: false, dataType: "string", dataFormat: undefined})}`; - const { basePath, withCredentials } = this.configuration; - return this.httpClient.request('get', `${basePath}${localVarPath}`, - { - context: localVarHttpContext, - responseType: responseType_, - ...(withCredentials ? { withCredentials } : {}), - headers: localVarHeaders, - observe: observe, - ...(localVarTransferCache !== undefined ? { transferCache: localVarTransferCache } : {}), - reportProgress: reportProgress - } - ); + /** + * Returns news articles in which the given person is mentioned. + * @endpoint get /api/news/by-author + * @param authorId OpenAlex author id, e.g. A5034365278. + * @param page Page number (1-based). + * @param pageSize Articles per page. + * @param sortOrder Sort order: \'desc\' (newest first) or \'asc\' (oldest first). + * @param query Optional search term, matched against title/author. + * @param observe set whether or not to return the data Observable as the body, response or events. defaults to returning the body. + * @param reportProgress flag to report request and response progress. + */ + public getNewsByAuthor_1( + authorId: string, + page?: number, + pageSize?: number, + sortOrder?: string, + query?: string, + observe?: 'body', + reportProgress?: boolean, + options?: { + httpHeaderAccept?: 'application/json'; + context?: HttpContext; + transferCache?: boolean; + }, + ): Observable; + public getNewsByAuthor_1( + authorId: string, + page?: number, + pageSize?: number, + sortOrder?: string, + query?: string, + observe?: 'response', + reportProgress?: boolean, + options?: { + httpHeaderAccept?: 'application/json'; + context?: HttpContext; + transferCache?: boolean; + }, + ): Observable>; + public getNewsByAuthor_1( + authorId: string, + page?: number, + pageSize?: number, + sortOrder?: string, + query?: string, + observe?: 'events', + reportProgress?: boolean, + options?: { + httpHeaderAccept?: 'application/json'; + context?: HttpContext; + transferCache?: boolean; + }, + ): Observable>; + public getNewsByAuthor_1( + authorId: string, + page?: number, + pageSize?: number, + sortOrder?: string, + query?: string, + observe: any = 'body', + reportProgress: boolean = false, + options?: { + httpHeaderAccept?: 'application/json'; + context?: HttpContext; + transferCache?: boolean; + }, + ): Observable { + if (authorId === null || authorId === undefined) { + throw new Error( + 'Required parameter authorId was null or undefined when calling getNewsByAuthor_1.', + ); } - /** - * Returns a single news article including its full content. - * @endpoint get /api/news/{news_id} - * @param newsId The unique id of the news article (Elasticsearch _id). - * @param observe set whether or not to return the data Observable as the body, response or events. defaults to returning the body. - * @param reportProgress flag to report request and response progress. - */ - public getNewsById_2(newsId: string, observe?: 'body', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable; - public getNewsById_2(newsId: string, observe?: 'response', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable>; - public getNewsById_2(newsId: string, observe?: 'events', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable>; - public getNewsById_2(newsId: string, observe: any = 'body', reportProgress: boolean = false, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable { - if (newsId === null || newsId === undefined) { - throw new Error('Required parameter newsId was null or undefined when calling getNewsById_2.'); - } + let localVarQueryParameters = new HttpParams({ encoder: this.encoder }); + localVarQueryParameters = this.addToHttpParams( + localVarQueryParameters, + authorId, + 'authorId', + ); + localVarQueryParameters = this.addToHttpParams( + localVarQueryParameters, + page, + 'page', + ); + localVarQueryParameters = this.addToHttpParams( + localVarQueryParameters, + pageSize, + 'pageSize', + ); + localVarQueryParameters = this.addToHttpParams( + localVarQueryParameters, + sortOrder, + 'sortOrder', + ); + localVarQueryParameters = this.addToHttpParams( + localVarQueryParameters, + query, + 'query', + ); - let localVarHeaders = this.defaultHeaders; + let localVarHeaders = this.defaultHeaders; - const localVarHttpHeaderAcceptSelected: string | undefined = options?.httpHeaderAccept ?? this.configuration.selectHeaderAccept([ - 'application/json' - ]); - if (localVarHttpHeaderAcceptSelected !== undefined) { - localVarHeaders = localVarHeaders.set('Accept', localVarHttpHeaderAcceptSelected); - } - - const localVarHttpContext: HttpContext = options?.context ?? new HttpContext(); - - const localVarTransferCache: boolean = options?.transferCache ?? true; - - - let responseType_: 'text' | 'json' | 'blob' = 'json'; - if (localVarHttpHeaderAcceptSelected) { - if (localVarHttpHeaderAcceptSelected.startsWith('text')) { - responseType_ = 'text'; - } else if (this.configuration.isJsonMime(localVarHttpHeaderAcceptSelected)) { - responseType_ = 'json'; - } else { - responseType_ = 'blob'; - } - } - - let localVarPath = `/api/news/${this.configuration.encodeParam({name: "newsId", value: newsId, in: "path", style: "simple", explode: false, dataType: "string", dataFormat: undefined})}`; - const { basePath, withCredentials } = this.configuration; - return this.httpClient.request('get', `${basePath}${localVarPath}`, - { - context: localVarHttpContext, - responseType: responseType_, - ...(withCredentials ? { withCredentials } : {}), - headers: localVarHeaders, - observe: observe, - ...(localVarTransferCache !== undefined ? { transferCache: localVarTransferCache } : {}), - reportProgress: reportProgress - } - ); + const localVarHttpHeaderAcceptSelected: string | undefined = + options?.httpHeaderAccept ?? + this.configuration.selectHeaderAccept(['application/json']); + if (localVarHttpHeaderAcceptSelected !== undefined) { + localVarHeaders = localVarHeaders.set( + 'Accept', + localVarHttpHeaderAcceptSelected, + ); } - /** - * Returns a page of news articles, newest first. - * @endpoint get /api/news - * @param page Page number (1-based). - * @param pageSize Articles per page. - * @param sortOrder Sort order: \'desc\' (newest first) or \'asc\' (oldest first). - * @param relevance Comma-separated relevance filter: \'relevant\', \'not_relevant\'. - * @param yearFrom Earliest publication year (inclusive). - * @param yearTo Latest publication year (inclusive). - * @param observe set whether or not to return the data Observable as the body, response or events. defaults to returning the body. - * @param reportProgress flag to report request and response progress. - */ - public listNews(page?: number, pageSize?: number, sortOrder?: string, relevance?: string, yearFrom?: number, yearTo?: number, observe?: 'body', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable; - public listNews(page?: number, pageSize?: number, sortOrder?: string, relevance?: string, yearFrom?: number, yearTo?: number, observe?: 'response', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable>; - public listNews(page?: number, pageSize?: number, sortOrder?: string, relevance?: string, yearFrom?: number, yearTo?: number, observe?: 'events', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable>; - public listNews(page?: number, pageSize?: number, sortOrder?: string, relevance?: string, yearFrom?: number, yearTo?: number, observe: any = 'body', reportProgress: boolean = false, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable { + const localVarHttpContext: HttpContext = + options?.context ?? new HttpContext(); - let localVarQueryParameters = new HttpParams({encoder: this.encoder}); - localVarQueryParameters = this.addToHttpParams(localVarQueryParameters, - page, 'page'); - localVarQueryParameters = this.addToHttpParams(localVarQueryParameters, - pageSize, 'pageSize'); - localVarQueryParameters = this.addToHttpParams(localVarQueryParameters, - sortOrder, 'sortOrder'); - localVarQueryParameters = this.addToHttpParams(localVarQueryParameters, - relevance, 'relevance'); - localVarQueryParameters = this.addToHttpParams(localVarQueryParameters, - yearFrom, 'yearFrom'); - localVarQueryParameters = this.addToHttpParams(localVarQueryParameters, - yearTo, 'yearTo'); + const localVarTransferCache: boolean = options?.transferCache ?? true; - let localVarHeaders = this.defaultHeaders; - - const localVarHttpHeaderAcceptSelected: string | undefined = options?.httpHeaderAccept ?? this.configuration.selectHeaderAccept([ - 'application/json' - ]); - if (localVarHttpHeaderAcceptSelected !== undefined) { - localVarHeaders = localVarHeaders.set('Accept', localVarHttpHeaderAcceptSelected); - } - - const localVarHttpContext: HttpContext = options?.context ?? new HttpContext(); - - const localVarTransferCache: boolean = options?.transferCache ?? true; - - - let responseType_: 'text' | 'json' | 'blob' = 'json'; - if (localVarHttpHeaderAcceptSelected) { - if (localVarHttpHeaderAcceptSelected.startsWith('text')) { - responseType_ = 'text'; - } else if (this.configuration.isJsonMime(localVarHttpHeaderAcceptSelected)) { - responseType_ = 'json'; - } else { - responseType_ = 'blob'; - } - } - - let localVarPath = `/api/news`; - const { basePath, withCredentials } = this.configuration; - return this.httpClient.request('get', `${basePath}${localVarPath}`, - { - context: localVarHttpContext, - params: localVarQueryParameters, - responseType: responseType_, - ...(withCredentials ? { withCredentials } : {}), - headers: localVarHeaders, - observe: observe, - ...(localVarTransferCache !== undefined ? { transferCache: localVarTransferCache } : {}), - reportProgress: reportProgress - } - ); + let responseType_: 'text' | 'json' | 'blob' = 'json'; + if (localVarHttpHeaderAcceptSelected) { + if (localVarHttpHeaderAcceptSelected.startsWith('text')) { + responseType_ = 'text'; + } else if ( + this.configuration.isJsonMime(localVarHttpHeaderAcceptSelected) + ) { + responseType_ = 'json'; + } else { + responseType_ = 'blob'; + } } - /** - * Returns a page of news articles, newest first. - * @endpoint get /api/news - * @param page Page number (1-based). - * @param pageSize Articles per page. - * @param sortOrder Sort order: \'desc\' (newest first) or \'asc\' (oldest first). - * @param relevance Comma-separated relevance filter: \'relevant\', \'not_relevant\'. - * @param yearFrom Earliest publication year (inclusive). - * @param yearTo Latest publication year (inclusive). - * @param observe set whether or not to return the data Observable as the body, response or events. defaults to returning the body. - * @param reportProgress flag to report request and response progress. - */ - public listNews_3(page?: number, pageSize?: number, sortOrder?: string, relevance?: string, yearFrom?: number, yearTo?: number, observe?: 'body', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable; - public listNews_3(page?: number, pageSize?: number, sortOrder?: string, relevance?: string, yearFrom?: number, yearTo?: number, observe?: 'response', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable>; - public listNews_3(page?: number, pageSize?: number, sortOrder?: string, relevance?: string, yearFrom?: number, yearTo?: number, observe?: 'events', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable>; - public listNews_3(page?: number, pageSize?: number, sortOrder?: string, relevance?: string, yearFrom?: number, yearTo?: number, observe: any = 'body', reportProgress: boolean = false, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable { + let localVarPath = `/api/news/by-author`; + const { basePath, withCredentials } = this.configuration; + return this.httpClient.request( + 'get', + `${basePath}${localVarPath}`, + { + context: localVarHttpContext, + params: localVarQueryParameters, + responseType: responseType_, + ...(withCredentials ? { withCredentials } : {}), + headers: localVarHeaders, + observe: observe, + ...(localVarTransferCache !== undefined + ? { transferCache: localVarTransferCache } + : {}), + reportProgress: reportProgress, + }, + ); + } - let localVarQueryParameters = new HttpParams({encoder: this.encoder}); - localVarQueryParameters = this.addToHttpParams(localVarQueryParameters, - page, 'page'); - localVarQueryParameters = this.addToHttpParams(localVarQueryParameters, - pageSize, 'pageSize'); - localVarQueryParameters = this.addToHttpParams(localVarQueryParameters, - sortOrder, 'sortOrder'); - localVarQueryParameters = this.addToHttpParams(localVarQueryParameters, - relevance, 'relevance'); - localVarQueryParameters = this.addToHttpParams(localVarQueryParameters, - yearFrom, 'yearFrom'); - localVarQueryParameters = this.addToHttpParams(localVarQueryParameters, - yearTo, 'yearTo'); - - let localVarHeaders = this.defaultHeaders; - - const localVarHttpHeaderAcceptSelected: string | undefined = options?.httpHeaderAccept ?? this.configuration.selectHeaderAccept([ - 'application/json' - ]); - if (localVarHttpHeaderAcceptSelected !== undefined) { - localVarHeaders = localVarHeaders.set('Accept', localVarHttpHeaderAcceptSelected); - } - - const localVarHttpContext: HttpContext = options?.context ?? new HttpContext(); - - const localVarTransferCache: boolean = options?.transferCache ?? true; - - - let responseType_: 'text' | 'json' | 'blob' = 'json'; - if (localVarHttpHeaderAcceptSelected) { - if (localVarHttpHeaderAcceptSelected.startsWith('text')) { - responseType_ = 'text'; - } else if (this.configuration.isJsonMime(localVarHttpHeaderAcceptSelected)) { - responseType_ = 'json'; - } else { - responseType_ = 'blob'; - } - } - - let localVarPath = `/api/news`; - const { basePath, withCredentials } = this.configuration; - return this.httpClient.request('get', `${basePath}${localVarPath}`, - { - context: localVarHttpContext, - params: localVarQueryParameters, - responseType: responseType_, - ...(withCredentials ? { withCredentials } : {}), - headers: localVarHeaders, - observe: observe, - ...(localVarTransferCache !== undefined ? { transferCache: localVarTransferCache } : {}), - reportProgress: reportProgress - } - ); + /** + * Returns a single news article including its full content. + * @endpoint get /api/news/{news_id} + * @param newsId The unique id of the news article (Elasticsearch _id). + * @param observe set whether or not to return the data Observable as the body, response or events. defaults to returning the body. + * @param reportProgress flag to report request and response progress. + */ + public getNewsById( + newsId: string, + observe?: 'body', + reportProgress?: boolean, + options?: { + httpHeaderAccept?: 'application/json'; + context?: HttpContext; + transferCache?: boolean; + }, + ): Observable; + public getNewsById( + newsId: string, + observe?: 'response', + reportProgress?: boolean, + options?: { + httpHeaderAccept?: 'application/json'; + context?: HttpContext; + transferCache?: boolean; + }, + ): Observable>; + public getNewsById( + newsId: string, + observe?: 'events', + reportProgress?: boolean, + options?: { + httpHeaderAccept?: 'application/json'; + context?: HttpContext; + transferCache?: boolean; + }, + ): Observable>; + public getNewsById( + newsId: string, + observe: any = 'body', + reportProgress: boolean = false, + options?: { + httpHeaderAccept?: 'application/json'; + context?: HttpContext; + transferCache?: boolean; + }, + ): Observable { + if (newsId === null || newsId === undefined) { + throw new Error( + 'Required parameter newsId was null or undefined when calling getNewsById.', + ); } - /** - * Searches news articles by full text (full_content). - * @endpoint get /api/news/search - * @param query Search term, matched against the full text (full_content). - * @param page Page number (1-based). - * @param pageSize Articles per page. - * @param relevance Comma-separated relevance filter: \'relevant\', \'not_relevant\'. - * @param yearFrom Earliest publication year (inclusive). - * @param yearTo Latest publication year (inclusive). - * @param observe set whether or not to return the data Observable as the body, response or events. defaults to returning the body. - * @param reportProgress flag to report request and response progress. - */ - public searchNews(query: string, page?: number, pageSize?: number, relevance?: string, yearFrom?: number, yearTo?: number, observe?: 'body', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable; - public searchNews(query: string, page?: number, pageSize?: number, relevance?: string, yearFrom?: number, yearTo?: number, observe?: 'response', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable>; - public searchNews(query: string, page?: number, pageSize?: number, relevance?: string, yearFrom?: number, yearTo?: number, observe?: 'events', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable>; - public searchNews(query: string, page?: number, pageSize?: number, relevance?: string, yearFrom?: number, yearTo?: number, observe: any = 'body', reportProgress: boolean = false, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable { - if (query === null || query === undefined) { - throw new Error('Required parameter query was null or undefined when calling searchNews.'); - } + let localVarHeaders = this.defaultHeaders; - let localVarQueryParameters = new HttpParams({encoder: this.encoder}); - localVarQueryParameters = this.addToHttpParams(localVarQueryParameters, - query, 'query'); - localVarQueryParameters = this.addToHttpParams(localVarQueryParameters, - page, 'page'); - localVarQueryParameters = this.addToHttpParams(localVarQueryParameters, - pageSize, 'pageSize'); - localVarQueryParameters = this.addToHttpParams(localVarQueryParameters, - relevance, 'relevance'); - localVarQueryParameters = this.addToHttpParams(localVarQueryParameters, - yearFrom, 'yearFrom'); - localVarQueryParameters = this.addToHttpParams(localVarQueryParameters, - yearTo, 'yearTo'); - - let localVarHeaders = this.defaultHeaders; - - const localVarHttpHeaderAcceptSelected: string | undefined = options?.httpHeaderAccept ?? this.configuration.selectHeaderAccept([ - 'application/json' - ]); - if (localVarHttpHeaderAcceptSelected !== undefined) { - localVarHeaders = localVarHeaders.set('Accept', localVarHttpHeaderAcceptSelected); - } - - const localVarHttpContext: HttpContext = options?.context ?? new HttpContext(); - - const localVarTransferCache: boolean = options?.transferCache ?? true; - - - let responseType_: 'text' | 'json' | 'blob' = 'json'; - if (localVarHttpHeaderAcceptSelected) { - if (localVarHttpHeaderAcceptSelected.startsWith('text')) { - responseType_ = 'text'; - } else if (this.configuration.isJsonMime(localVarHttpHeaderAcceptSelected)) { - responseType_ = 'json'; - } else { - responseType_ = 'blob'; - } - } - - let localVarPath = `/api/news/search`; - const { basePath, withCredentials } = this.configuration; - return this.httpClient.request('get', `${basePath}${localVarPath}`, - { - context: localVarHttpContext, - params: localVarQueryParameters, - responseType: responseType_, - ...(withCredentials ? { withCredentials } : {}), - headers: localVarHeaders, - observe: observe, - ...(localVarTransferCache !== undefined ? { transferCache: localVarTransferCache } : {}), - reportProgress: reportProgress - } - ); + const localVarHttpHeaderAcceptSelected: string | undefined = + options?.httpHeaderAccept ?? + this.configuration.selectHeaderAccept(['application/json']); + if (localVarHttpHeaderAcceptSelected !== undefined) { + localVarHeaders = localVarHeaders.set( + 'Accept', + localVarHttpHeaderAcceptSelected, + ); } - /** - * Searches news articles by full text (full_content). - * @endpoint get /api/news/search - * @param query Search term, matched against the full text (full_content). - * @param page Page number (1-based). - * @param pageSize Articles per page. - * @param relevance Comma-separated relevance filter: \'relevant\', \'not_relevant\'. - * @param yearFrom Earliest publication year (inclusive). - * @param yearTo Latest publication year (inclusive). - * @param observe set whether or not to return the data Observable as the body, response or events. defaults to returning the body. - * @param reportProgress flag to report request and response progress. - */ - public searchNews_4(query: string, page?: number, pageSize?: number, relevance?: string, yearFrom?: number, yearTo?: number, observe?: 'body', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable; - public searchNews_4(query: string, page?: number, pageSize?: number, relevance?: string, yearFrom?: number, yearTo?: number, observe?: 'response', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable>; - public searchNews_4(query: string, page?: number, pageSize?: number, relevance?: string, yearFrom?: number, yearTo?: number, observe?: 'events', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable>; - public searchNews_4(query: string, page?: number, pageSize?: number, relevance?: string, yearFrom?: number, yearTo?: number, observe: any = 'body', reportProgress: boolean = false, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable { - if (query === null || query === undefined) { - throw new Error('Required parameter query was null or undefined when calling searchNews_4.'); - } + const localVarHttpContext: HttpContext = + options?.context ?? new HttpContext(); - let localVarQueryParameters = new HttpParams({encoder: this.encoder}); - localVarQueryParameters = this.addToHttpParams(localVarQueryParameters, - query, 'query'); - localVarQueryParameters = this.addToHttpParams(localVarQueryParameters, - page, 'page'); - localVarQueryParameters = this.addToHttpParams(localVarQueryParameters, - pageSize, 'pageSize'); - localVarQueryParameters = this.addToHttpParams(localVarQueryParameters, - relevance, 'relevance'); - localVarQueryParameters = this.addToHttpParams(localVarQueryParameters, - yearFrom, 'yearFrom'); - localVarQueryParameters = this.addToHttpParams(localVarQueryParameters, - yearTo, 'yearTo'); + const localVarTransferCache: boolean = options?.transferCache ?? true; - let localVarHeaders = this.defaultHeaders; - - const localVarHttpHeaderAcceptSelected: string | undefined = options?.httpHeaderAccept ?? this.configuration.selectHeaderAccept([ - 'application/json' - ]); - if (localVarHttpHeaderAcceptSelected !== undefined) { - localVarHeaders = localVarHeaders.set('Accept', localVarHttpHeaderAcceptSelected); - } - - const localVarHttpContext: HttpContext = options?.context ?? new HttpContext(); - - const localVarTransferCache: boolean = options?.transferCache ?? true; - - - let responseType_: 'text' | 'json' | 'blob' = 'json'; - if (localVarHttpHeaderAcceptSelected) { - if (localVarHttpHeaderAcceptSelected.startsWith('text')) { - responseType_ = 'text'; - } else if (this.configuration.isJsonMime(localVarHttpHeaderAcceptSelected)) { - responseType_ = 'json'; - } else { - responseType_ = 'blob'; - } - } - - let localVarPath = `/api/news/search`; - const { basePath, withCredentials } = this.configuration; - return this.httpClient.request('get', `${basePath}${localVarPath}`, - { - context: localVarHttpContext, - params: localVarQueryParameters, - responseType: responseType_, - ...(withCredentials ? { withCredentials } : {}), - headers: localVarHeaders, - observe: observe, - ...(localVarTransferCache !== undefined ? { transferCache: localVarTransferCache } : {}), - reportProgress: reportProgress - } - ); + let responseType_: 'text' | 'json' | 'blob' = 'json'; + if (localVarHttpHeaderAcceptSelected) { + if (localVarHttpHeaderAcceptSelected.startsWith('text')) { + responseType_ = 'text'; + } else if ( + this.configuration.isJsonMime(localVarHttpHeaderAcceptSelected) + ) { + responseType_ = 'json'; + } else { + responseType_ = 'blob'; + } } + let localVarPath = `/api/news/${this.configuration.encodeParam({ name: 'newsId', value: newsId, in: 'path', style: 'simple', explode: false, dataType: 'string', dataFormat: undefined })}`; + const { basePath, withCredentials } = this.configuration; + return this.httpClient.request( + 'get', + `${basePath}${localVarPath}`, + { + context: localVarHttpContext, + responseType: responseType_, + ...(withCredentials ? { withCredentials } : {}), + headers: localVarHeaders, + observe: observe, + ...(localVarTransferCache !== undefined + ? { transferCache: localVarTransferCache } + : {}), + reportProgress: reportProgress, + }, + ); + } + + /** + * Returns a single news article including its full content. + * @endpoint get /api/news/{news_id} + * @param newsId The unique id of the news article (Elasticsearch _id). + * @param observe set whether or not to return the data Observable as the body, response or events. defaults to returning the body. + * @param reportProgress flag to report request and response progress. + */ + public getNewsById_2( + newsId: string, + observe?: 'body', + reportProgress?: boolean, + options?: { + httpHeaderAccept?: 'application/json'; + context?: HttpContext; + transferCache?: boolean; + }, + ): Observable; + public getNewsById_2( + newsId: string, + observe?: 'response', + reportProgress?: boolean, + options?: { + httpHeaderAccept?: 'application/json'; + context?: HttpContext; + transferCache?: boolean; + }, + ): Observable>; + public getNewsById_2( + newsId: string, + observe?: 'events', + reportProgress?: boolean, + options?: { + httpHeaderAccept?: 'application/json'; + context?: HttpContext; + transferCache?: boolean; + }, + ): Observable>; + public getNewsById_2( + newsId: string, + observe: any = 'body', + reportProgress: boolean = false, + options?: { + httpHeaderAccept?: 'application/json'; + context?: HttpContext; + transferCache?: boolean; + }, + ): Observable { + if (newsId === null || newsId === undefined) { + throw new Error( + 'Required parameter newsId was null or undefined when calling getNewsById_2.', + ); + } + + let localVarHeaders = this.defaultHeaders; + + const localVarHttpHeaderAcceptSelected: string | undefined = + options?.httpHeaderAccept ?? + this.configuration.selectHeaderAccept(['application/json']); + if (localVarHttpHeaderAcceptSelected !== undefined) { + localVarHeaders = localVarHeaders.set( + 'Accept', + localVarHttpHeaderAcceptSelected, + ); + } + + const localVarHttpContext: HttpContext = + options?.context ?? new HttpContext(); + + const localVarTransferCache: boolean = options?.transferCache ?? true; + + let responseType_: 'text' | 'json' | 'blob' = 'json'; + if (localVarHttpHeaderAcceptSelected) { + if (localVarHttpHeaderAcceptSelected.startsWith('text')) { + responseType_ = 'text'; + } else if ( + this.configuration.isJsonMime(localVarHttpHeaderAcceptSelected) + ) { + responseType_ = 'json'; + } else { + responseType_ = 'blob'; + } + } + + let localVarPath = `/api/news/${this.configuration.encodeParam({ name: 'newsId', value: newsId, in: 'path', style: 'simple', explode: false, dataType: 'string', dataFormat: undefined })}`; + const { basePath, withCredentials } = this.configuration; + return this.httpClient.request( + 'get', + `${basePath}${localVarPath}`, + { + context: localVarHttpContext, + responseType: responseType_, + ...(withCredentials ? { withCredentials } : {}), + headers: localVarHeaders, + observe: observe, + ...(localVarTransferCache !== undefined + ? { transferCache: localVarTransferCache } + : {}), + reportProgress: reportProgress, + }, + ); + } + + /** + * Returns a page of news articles, newest first. + * @endpoint get /api/news + * @param page Page number (1-based). + * @param pageSize Articles per page. + * @param sortOrder Sort order: \'desc\' (newest first) or \'asc\' (oldest first). + * @param relevance Comma-separated relevance filter: \'relevant\', \'not_relevant\'. + * @param yearFrom Earliest publication year (inclusive). + * @param yearTo Latest publication year (inclusive). + * @param observe set whether or not to return the data Observable as the body, response or events. defaults to returning the body. + * @param reportProgress flag to report request and response progress. + */ + public listNews( + page?: number, + pageSize?: number, + sortOrder?: string, + relevance?: string, + yearFrom?: number, + yearTo?: number, + observe?: 'body', + reportProgress?: boolean, + options?: { + httpHeaderAccept?: 'application/json'; + context?: HttpContext; + transferCache?: boolean; + }, + ): Observable; + public listNews( + page?: number, + pageSize?: number, + sortOrder?: string, + relevance?: string, + yearFrom?: number, + yearTo?: number, + observe?: 'response', + reportProgress?: boolean, + options?: { + httpHeaderAccept?: 'application/json'; + context?: HttpContext; + transferCache?: boolean; + }, + ): Observable>; + public listNews( + page?: number, + pageSize?: number, + sortOrder?: string, + relevance?: string, + yearFrom?: number, + yearTo?: number, + observe?: 'events', + reportProgress?: boolean, + options?: { + httpHeaderAccept?: 'application/json'; + context?: HttpContext; + transferCache?: boolean; + }, + ): Observable>; + public listNews( + page?: number, + pageSize?: number, + sortOrder?: string, + relevance?: string, + yearFrom?: number, + yearTo?: number, + observe: any = 'body', + reportProgress: boolean = false, + options?: { + httpHeaderAccept?: 'application/json'; + context?: HttpContext; + transferCache?: boolean; + }, + ): Observable { + let localVarQueryParameters = new HttpParams({ encoder: this.encoder }); + localVarQueryParameters = this.addToHttpParams( + localVarQueryParameters, + page, + 'page', + ); + localVarQueryParameters = this.addToHttpParams( + localVarQueryParameters, + pageSize, + 'pageSize', + ); + localVarQueryParameters = this.addToHttpParams( + localVarQueryParameters, + sortOrder, + 'sortOrder', + ); + localVarQueryParameters = this.addToHttpParams( + localVarQueryParameters, + relevance, + 'relevance', + ); + localVarQueryParameters = this.addToHttpParams( + localVarQueryParameters, + yearFrom, + 'yearFrom', + ); + localVarQueryParameters = this.addToHttpParams( + localVarQueryParameters, + yearTo, + 'yearTo', + ); + + let localVarHeaders = this.defaultHeaders; + + const localVarHttpHeaderAcceptSelected: string | undefined = + options?.httpHeaderAccept ?? + this.configuration.selectHeaderAccept(['application/json']); + if (localVarHttpHeaderAcceptSelected !== undefined) { + localVarHeaders = localVarHeaders.set( + 'Accept', + localVarHttpHeaderAcceptSelected, + ); + } + + const localVarHttpContext: HttpContext = + options?.context ?? new HttpContext(); + + const localVarTransferCache: boolean = options?.transferCache ?? true; + + let responseType_: 'text' | 'json' | 'blob' = 'json'; + if (localVarHttpHeaderAcceptSelected) { + if (localVarHttpHeaderAcceptSelected.startsWith('text')) { + responseType_ = 'text'; + } else if ( + this.configuration.isJsonMime(localVarHttpHeaderAcceptSelected) + ) { + responseType_ = 'json'; + } else { + responseType_ = 'blob'; + } + } + + let localVarPath = `/api/news`; + const { basePath, withCredentials } = this.configuration; + return this.httpClient.request( + 'get', + `${basePath}${localVarPath}`, + { + context: localVarHttpContext, + params: localVarQueryParameters, + responseType: responseType_, + ...(withCredentials ? { withCredentials } : {}), + headers: localVarHeaders, + observe: observe, + ...(localVarTransferCache !== undefined + ? { transferCache: localVarTransferCache } + : {}), + reportProgress: reportProgress, + }, + ); + } + + /** + * Returns a page of news articles, newest first. + * @endpoint get /api/news + * @param page Page number (1-based). + * @param pageSize Articles per page. + * @param sortOrder Sort order: \'desc\' (newest first) or \'asc\' (oldest first). + * @param relevance Comma-separated relevance filter: \'relevant\', \'not_relevant\'. + * @param yearFrom Earliest publication year (inclusive). + * @param yearTo Latest publication year (inclusive). + * @param observe set whether or not to return the data Observable as the body, response or events. defaults to returning the body. + * @param reportProgress flag to report request and response progress. + */ + public listNews_3( + page?: number, + pageSize?: number, + sortOrder?: string, + relevance?: string, + yearFrom?: number, + yearTo?: number, + observe?: 'body', + reportProgress?: boolean, + options?: { + httpHeaderAccept?: 'application/json'; + context?: HttpContext; + transferCache?: boolean; + }, + ): Observable; + public listNews_3( + page?: number, + pageSize?: number, + sortOrder?: string, + relevance?: string, + yearFrom?: number, + yearTo?: number, + observe?: 'response', + reportProgress?: boolean, + options?: { + httpHeaderAccept?: 'application/json'; + context?: HttpContext; + transferCache?: boolean; + }, + ): Observable>; + public listNews_3( + page?: number, + pageSize?: number, + sortOrder?: string, + relevance?: string, + yearFrom?: number, + yearTo?: number, + observe?: 'events', + reportProgress?: boolean, + options?: { + httpHeaderAccept?: 'application/json'; + context?: HttpContext; + transferCache?: boolean; + }, + ): Observable>; + public listNews_3( + page?: number, + pageSize?: number, + sortOrder?: string, + relevance?: string, + yearFrom?: number, + yearTo?: number, + observe: any = 'body', + reportProgress: boolean = false, + options?: { + httpHeaderAccept?: 'application/json'; + context?: HttpContext; + transferCache?: boolean; + }, + ): Observable { + let localVarQueryParameters = new HttpParams({ encoder: this.encoder }); + localVarQueryParameters = this.addToHttpParams( + localVarQueryParameters, + page, + 'page', + ); + localVarQueryParameters = this.addToHttpParams( + localVarQueryParameters, + pageSize, + 'pageSize', + ); + localVarQueryParameters = this.addToHttpParams( + localVarQueryParameters, + sortOrder, + 'sortOrder', + ); + localVarQueryParameters = this.addToHttpParams( + localVarQueryParameters, + relevance, + 'relevance', + ); + localVarQueryParameters = this.addToHttpParams( + localVarQueryParameters, + yearFrom, + 'yearFrom', + ); + localVarQueryParameters = this.addToHttpParams( + localVarQueryParameters, + yearTo, + 'yearTo', + ); + + let localVarHeaders = this.defaultHeaders; + + const localVarHttpHeaderAcceptSelected: string | undefined = + options?.httpHeaderAccept ?? + this.configuration.selectHeaderAccept(['application/json']); + if (localVarHttpHeaderAcceptSelected !== undefined) { + localVarHeaders = localVarHeaders.set( + 'Accept', + localVarHttpHeaderAcceptSelected, + ); + } + + const localVarHttpContext: HttpContext = + options?.context ?? new HttpContext(); + + const localVarTransferCache: boolean = options?.transferCache ?? true; + + let responseType_: 'text' | 'json' | 'blob' = 'json'; + if (localVarHttpHeaderAcceptSelected) { + if (localVarHttpHeaderAcceptSelected.startsWith('text')) { + responseType_ = 'text'; + } else if ( + this.configuration.isJsonMime(localVarHttpHeaderAcceptSelected) + ) { + responseType_ = 'json'; + } else { + responseType_ = 'blob'; + } + } + + let localVarPath = `/api/news`; + const { basePath, withCredentials } = this.configuration; + return this.httpClient.request( + 'get', + `${basePath}${localVarPath}`, + { + context: localVarHttpContext, + params: localVarQueryParameters, + responseType: responseType_, + ...(withCredentials ? { withCredentials } : {}), + headers: localVarHeaders, + observe: observe, + ...(localVarTransferCache !== undefined + ? { transferCache: localVarTransferCache } + : {}), + reportProgress: reportProgress, + }, + ); + } + + /** + * Searches news articles by full text (full_content). + * @endpoint get /api/news/search + * @param query Search term, matched against the full text (full_content). + * @param page Page number (1-based). + * @param pageSize Articles per page. + * @param relevance Comma-separated relevance filter: \'relevant\', \'not_relevant\'. + * @param yearFrom Earliest publication year (inclusive). + * @param yearTo Latest publication year (inclusive). + * @param observe set whether or not to return the data Observable as the body, response or events. defaults to returning the body. + * @param reportProgress flag to report request and response progress. + */ + public searchNews( + query: string, + page?: number, + pageSize?: number, + relevance?: string, + yearFrom?: number, + yearTo?: number, + observe?: 'body', + reportProgress?: boolean, + options?: { + httpHeaderAccept?: 'application/json'; + context?: HttpContext; + transferCache?: boolean; + }, + ): Observable; + public searchNews( + query: string, + page?: number, + pageSize?: number, + relevance?: string, + yearFrom?: number, + yearTo?: number, + observe?: 'response', + reportProgress?: boolean, + options?: { + httpHeaderAccept?: 'application/json'; + context?: HttpContext; + transferCache?: boolean; + }, + ): Observable>; + public searchNews( + query: string, + page?: number, + pageSize?: number, + relevance?: string, + yearFrom?: number, + yearTo?: number, + observe?: 'events', + reportProgress?: boolean, + options?: { + httpHeaderAccept?: 'application/json'; + context?: HttpContext; + transferCache?: boolean; + }, + ): Observable>; + public searchNews( + query: string, + page?: number, + pageSize?: number, + relevance?: string, + yearFrom?: number, + yearTo?: number, + observe: any = 'body', + reportProgress: boolean = false, + options?: { + httpHeaderAccept?: 'application/json'; + context?: HttpContext; + transferCache?: boolean; + }, + ): Observable { + if (query === null || query === undefined) { + throw new Error( + 'Required parameter query was null or undefined when calling searchNews.', + ); + } + + let localVarQueryParameters = new HttpParams({ encoder: this.encoder }); + localVarQueryParameters = this.addToHttpParams( + localVarQueryParameters, + query, + 'query', + ); + localVarQueryParameters = this.addToHttpParams( + localVarQueryParameters, + page, + 'page', + ); + localVarQueryParameters = this.addToHttpParams( + localVarQueryParameters, + pageSize, + 'pageSize', + ); + localVarQueryParameters = this.addToHttpParams( + localVarQueryParameters, + relevance, + 'relevance', + ); + localVarQueryParameters = this.addToHttpParams( + localVarQueryParameters, + yearFrom, + 'yearFrom', + ); + localVarQueryParameters = this.addToHttpParams( + localVarQueryParameters, + yearTo, + 'yearTo', + ); + + let localVarHeaders = this.defaultHeaders; + + const localVarHttpHeaderAcceptSelected: string | undefined = + options?.httpHeaderAccept ?? + this.configuration.selectHeaderAccept(['application/json']); + if (localVarHttpHeaderAcceptSelected !== undefined) { + localVarHeaders = localVarHeaders.set( + 'Accept', + localVarHttpHeaderAcceptSelected, + ); + } + + const localVarHttpContext: HttpContext = + options?.context ?? new HttpContext(); + + const localVarTransferCache: boolean = options?.transferCache ?? true; + + let responseType_: 'text' | 'json' | 'blob' = 'json'; + if (localVarHttpHeaderAcceptSelected) { + if (localVarHttpHeaderAcceptSelected.startsWith('text')) { + responseType_ = 'text'; + } else if ( + this.configuration.isJsonMime(localVarHttpHeaderAcceptSelected) + ) { + responseType_ = 'json'; + } else { + responseType_ = 'blob'; + } + } + + let localVarPath = `/api/news/search`; + const { basePath, withCredentials } = this.configuration; + return this.httpClient.request( + 'get', + `${basePath}${localVarPath}`, + { + context: localVarHttpContext, + params: localVarQueryParameters, + responseType: responseType_, + ...(withCredentials ? { withCredentials } : {}), + headers: localVarHeaders, + observe: observe, + ...(localVarTransferCache !== undefined + ? { transferCache: localVarTransferCache } + : {}), + reportProgress: reportProgress, + }, + ); + } + + /** + * Searches news articles by full text (full_content). + * @endpoint get /api/news/search + * @param query Search term, matched against the full text (full_content). + * @param page Page number (1-based). + * @param pageSize Articles per page. + * @param relevance Comma-separated relevance filter: \'relevant\', \'not_relevant\'. + * @param yearFrom Earliest publication year (inclusive). + * @param yearTo Latest publication year (inclusive). + * @param observe set whether or not to return the data Observable as the body, response or events. defaults to returning the body. + * @param reportProgress flag to report request and response progress. + */ + public searchNews_4( + query: string, + page?: number, + pageSize?: number, + relevance?: string, + yearFrom?: number, + yearTo?: number, + observe?: 'body', + reportProgress?: boolean, + options?: { + httpHeaderAccept?: 'application/json'; + context?: HttpContext; + transferCache?: boolean; + }, + ): Observable; + public searchNews_4( + query: string, + page?: number, + pageSize?: number, + relevance?: string, + yearFrom?: number, + yearTo?: number, + observe?: 'response', + reportProgress?: boolean, + options?: { + httpHeaderAccept?: 'application/json'; + context?: HttpContext; + transferCache?: boolean; + }, + ): Observable>; + public searchNews_4( + query: string, + page?: number, + pageSize?: number, + relevance?: string, + yearFrom?: number, + yearTo?: number, + observe?: 'events', + reportProgress?: boolean, + options?: { + httpHeaderAccept?: 'application/json'; + context?: HttpContext; + transferCache?: boolean; + }, + ): Observable>; + public searchNews_4( + query: string, + page?: number, + pageSize?: number, + relevance?: string, + yearFrom?: number, + yearTo?: number, + observe: any = 'body', + reportProgress: boolean = false, + options?: { + httpHeaderAccept?: 'application/json'; + context?: HttpContext; + transferCache?: boolean; + }, + ): Observable { + if (query === null || query === undefined) { + throw new Error( + 'Required parameter query was null or undefined when calling searchNews_4.', + ); + } + + let localVarQueryParameters = new HttpParams({ encoder: this.encoder }); + localVarQueryParameters = this.addToHttpParams( + localVarQueryParameters, + query, + 'query', + ); + localVarQueryParameters = this.addToHttpParams( + localVarQueryParameters, + page, + 'page', + ); + localVarQueryParameters = this.addToHttpParams( + localVarQueryParameters, + pageSize, + 'pageSize', + ); + localVarQueryParameters = this.addToHttpParams( + localVarQueryParameters, + relevance, + 'relevance', + ); + localVarQueryParameters = this.addToHttpParams( + localVarQueryParameters, + yearFrom, + 'yearFrom', + ); + localVarQueryParameters = this.addToHttpParams( + localVarQueryParameters, + yearTo, + 'yearTo', + ); + + let localVarHeaders = this.defaultHeaders; + + const localVarHttpHeaderAcceptSelected: string | undefined = + options?.httpHeaderAccept ?? + this.configuration.selectHeaderAccept(['application/json']); + if (localVarHttpHeaderAcceptSelected !== undefined) { + localVarHeaders = localVarHeaders.set( + 'Accept', + localVarHttpHeaderAcceptSelected, + ); + } + + const localVarHttpContext: HttpContext = + options?.context ?? new HttpContext(); + + const localVarTransferCache: boolean = options?.transferCache ?? true; + + let responseType_: 'text' | 'json' | 'blob' = 'json'; + if (localVarHttpHeaderAcceptSelected) { + if (localVarHttpHeaderAcceptSelected.startsWith('text')) { + responseType_ = 'text'; + } else if ( + this.configuration.isJsonMime(localVarHttpHeaderAcceptSelected) + ) { + responseType_ = 'json'; + } else { + responseType_ = 'blob'; + } + } + + let localVarPath = `/api/news/search`; + const { basePath, withCredentials } = this.configuration; + return this.httpClient.request( + 'get', + `${basePath}${localVarPath}`, + { + context: localVarHttpContext, + params: localVarQueryParameters, + responseType: responseType_, + ...(withCredentials ? { withCredentials } : {}), + headers: localVarHeaders, + observe: observe, + ...(localVarTransferCache !== undefined + ? { transferCache: localVarTransferCache } + : {}), + reportProgress: reportProgress, + }, + ); + } } diff --git a/webapp/src/app/api/api/organization.service.ts b/webapp/src/app/api/api/organization.service.ts index 2af0ed8b..4315e7c1 100644 --- a/webapp/src/app/api/api/organization.service.ts +++ b/webapp/src/app/api/api/organization.service.ts @@ -1,7 +1,7 @@ /** * Innovation Search Engine API * - * + * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech @@ -9,12 +9,18 @@ */ /* tslint:disable:no-unused-variable member-ordering */ -import { Inject, Injectable, Optional } from '@angular/core'; -import { HttpClient, HttpHeaders, HttpParams, - HttpResponse, HttpEvent, HttpParameterCodec, HttpContext - } from '@angular/common/http'; -import { CustomHttpParameterCodec } from '../encoder'; -import { Observable } from 'rxjs'; +import { Inject, Injectable, Optional } from '@angular/core'; +import { + HttpClient, + HttpHeaders, + HttpParams, + HttpResponse, + HttpEvent, + HttpParameterCodec, + HttpContext, +} from '@angular/common/http'; +import { CustomHttpParameterCodec } from '../encoder'; +import { Observable } from 'rxjs'; // @ts-ignore import { CreateOrganizationRequest } from '../model/createOrganizationRequest'; @@ -28,283 +34,545 @@ 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); + } - constructor(protected httpClient: HttpClient, @Optional() @Inject(BASE_PATH) basePath: string|string[], @Optional() configuration?: Configuration) { - super(basePath, configuration); + /** + * Create Organization + * @endpoint post /api/organizations + * @param createOrganizationRequest + * @param secureFgpAcc + * @param observe set whether or not to return the data Observable as the body, response or events. defaults to returning the body. + * @param reportProgress flag to report request and response progress. + */ + public createOrganisation( + createOrganizationRequest: CreateOrganizationRequest, + secureFgpAcc?: string, + observe?: 'body', + reportProgress?: boolean, + options?: { + httpHeaderAccept?: 'application/json'; + context?: HttpContext; + transferCache?: boolean; + }, + ): Observable; + public createOrganisation( + createOrganizationRequest: CreateOrganizationRequest, + secureFgpAcc?: string, + observe?: 'response', + reportProgress?: boolean, + options?: { + httpHeaderAccept?: 'application/json'; + context?: HttpContext; + transferCache?: boolean; + }, + ): Observable< + HttpResponse + >; + public createOrganisation( + createOrganizationRequest: CreateOrganizationRequest, + secureFgpAcc?: string, + observe?: 'events', + reportProgress?: boolean, + options?: { + httpHeaderAccept?: 'application/json'; + context?: HttpContext; + transferCache?: boolean; + }, + ): Observable>; + public createOrganisation( + createOrganizationRequest: CreateOrganizationRequest, + secureFgpAcc?: string, + observe: any = 'body', + reportProgress: boolean = false, + options?: { + httpHeaderAccept?: 'application/json'; + context?: HttpContext; + transferCache?: boolean; + }, + ): Observable { + if ( + createOrganizationRequest === null || + createOrganizationRequest === undefined + ) { + throw new Error( + 'Required parameter createOrganizationRequest was null or undefined when calling createOrganisation.', + ); } - /** - * Create Organization - * @endpoint post /api/organizations - * @param createOrganizationRequest - * @param observe set whether or not to return 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, observe?: 'body', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable; - public createOrganisation(createOrganizationRequest: CreateOrganizationRequest, observe?: 'response', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable>; - public createOrganisation(createOrganizationRequest: CreateOrganizationRequest, observe?: 'events', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable>; - public createOrganisation(createOrganizationRequest: CreateOrganizationRequest, observe: any = 'body', reportProgress: boolean = false, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable { - if (createOrganizationRequest === null || createOrganizationRequest === undefined) { - throw new Error('Required parameter createOrganizationRequest was null or undefined when calling createOrganisation.'); - } + let localVarHeaders = this.defaultHeaders; - let localVarHeaders = this.defaultHeaders; + // authentication (HTTPBearer) required + localVarHeaders = this.configuration.addCredentialToHeaders( + 'HTTPBearer', + 'Authorization', + localVarHeaders, + 'Bearer ', + ); - // authentication (HTTPBearer) required - localVarHeaders = this.configuration.addCredentialToHeaders('HTTPBearer', 'Authorization', localVarHeaders, 'Bearer '); - - const localVarHttpHeaderAcceptSelected: string | undefined = options?.httpHeaderAccept ?? this.configuration.selectHeaderAccept([ - 'application/json' - ]); - if (localVarHttpHeaderAcceptSelected !== undefined) { - localVarHeaders = localVarHeaders.set('Accept', localVarHttpHeaderAcceptSelected); - } - - const localVarHttpContext: HttpContext = options?.context ?? new HttpContext(); - - const localVarTransferCache: boolean = options?.transferCache ?? true; - - - // to determine the Content-Type header - const consumes: string[] = [ - 'application/json' - ]; - const httpContentTypeSelected: string | undefined = this.configuration.selectHeaderContentType(consumes); - if (httpContentTypeSelected !== undefined) { - localVarHeaders = localVarHeaders.set('Content-Type', httpContentTypeSelected); - } - - let responseType_: 'text' | 'json' | 'blob' = 'json'; - if (localVarHttpHeaderAcceptSelected) { - if (localVarHttpHeaderAcceptSelected.startsWith('text')) { - responseType_ = 'text'; - } else if (this.configuration.isJsonMime(localVarHttpHeaderAcceptSelected)) { - responseType_ = 'json'; - } else { - responseType_ = 'blob'; - } - } - - let localVarPath = `/api/organizations`; - const { basePath, withCredentials } = this.configuration; - return this.httpClient.request('post', `${basePath}${localVarPath}`, - { - context: localVarHttpContext, - body: createOrganizationRequest, - responseType: responseType_, - ...(withCredentials ? { withCredentials } : {}), - headers: localVarHeaders, - observe: observe, - ...(localVarTransferCache !== undefined ? { transferCache: localVarTransferCache } : {}), - reportProgress: reportProgress - } - ); + const localVarHttpHeaderAcceptSelected: string | undefined = + options?.httpHeaderAccept ?? + this.configuration.selectHeaderAccept(['application/json']); + if (localVarHttpHeaderAcceptSelected !== undefined) { + localVarHeaders = localVarHeaders.set( + 'Accept', + localVarHttpHeaderAcceptSelected, + ); } - /** - * Delete Organization - * @endpoint delete /api/organizations/{organization_id} - * @param organizationId - * @param observe set whether or not to return 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, observe?: 'body', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable; - public deleteOrganisation(organizationId: string, observe?: 'response', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable>; - public deleteOrganisation(organizationId: string, observe?: 'events', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable>; - public deleteOrganisation(organizationId: string, observe: any = 'body', reportProgress: boolean = false, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable { - if (organizationId === null || organizationId === undefined) { - throw new Error('Required parameter organizationId was null or undefined when calling deleteOrganisation.'); - } + const localVarHttpContext: HttpContext = + options?.context ?? new HttpContext(); - let localVarHeaders = this.defaultHeaders; + const localVarTransferCache: boolean = options?.transferCache ?? true; - // authentication (HTTPBearer) required - localVarHeaders = this.configuration.addCredentialToHeaders('HTTPBearer', 'Authorization', localVarHeaders, 'Bearer '); - - const localVarHttpHeaderAcceptSelected: string | undefined = options?.httpHeaderAccept ?? this.configuration.selectHeaderAccept([ - 'application/json' - ]); - if (localVarHttpHeaderAcceptSelected !== undefined) { - localVarHeaders = localVarHeaders.set('Accept', localVarHttpHeaderAcceptSelected); - } - - const localVarHttpContext: HttpContext = options?.context ?? new HttpContext(); - - const localVarTransferCache: boolean = options?.transferCache ?? true; - - - let responseType_: 'text' | 'json' | 'blob' = 'json'; - if (localVarHttpHeaderAcceptSelected) { - if (localVarHttpHeaderAcceptSelected.startsWith('text')) { - responseType_ = 'text'; - } else if (this.configuration.isJsonMime(localVarHttpHeaderAcceptSelected)) { - responseType_ = 'json'; - } else { - responseType_ = 'blob'; - } - } - - let localVarPath = `/api/organizations/${this.configuration.encodeParam({name: "organizationId", value: organizationId, in: "path", style: "simple", explode: false, dataType: "string", dataFormat: "uuid"})}`; - const { basePath, withCredentials } = this.configuration; - return this.httpClient.request('delete', `${basePath}${localVarPath}`, - { - context: localVarHttpContext, - responseType: responseType_, - ...(withCredentials ? { withCredentials } : {}), - headers: localVarHeaders, - observe: observe, - ...(localVarTransferCache !== undefined ? { transferCache: localVarTransferCache } : {}), - reportProgress: reportProgress - } - ); + // 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, + ); } - /** - * Get Organizations - * @endpoint get /api/organizations - * @param page - * @param pageSize - * @param offset - * @param observe set whether or not to return 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, observe?: 'body', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable; - public getOrganisations(page?: number, pageSize?: number, offset?: number, observe?: 'response', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable>; - public getOrganisations(page?: number, pageSize?: number, offset?: number, observe?: 'events', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable>; - public getOrganisations(page?: number, pageSize?: number, offset?: number, observe: any = 'body', reportProgress: boolean = false, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable { - - let localVarQueryParameters = new HttpParams({encoder: this.encoder}); - localVarQueryParameters = this.addToHttpParams(localVarQueryParameters, - page, 'page'); - localVarQueryParameters = this.addToHttpParams(localVarQueryParameters, - pageSize, 'page_size'); - localVarQueryParameters = this.addToHttpParams(localVarQueryParameters, - offset, 'offset'); - - let localVarHeaders = this.defaultHeaders; - - // authentication (HTTPBearer) required - localVarHeaders = this.configuration.addCredentialToHeaders('HTTPBearer', 'Authorization', localVarHeaders, 'Bearer '); - - const localVarHttpHeaderAcceptSelected: string | undefined = options?.httpHeaderAccept ?? this.configuration.selectHeaderAccept([ - 'application/json' - ]); - if (localVarHttpHeaderAcceptSelected !== undefined) { - localVarHeaders = localVarHeaders.set('Accept', localVarHttpHeaderAcceptSelected); - } - - const localVarHttpContext: HttpContext = options?.context ?? new HttpContext(); - - const localVarTransferCache: boolean = options?.transferCache ?? true; - - - let responseType_: 'text' | 'json' | 'blob' = 'json'; - if (localVarHttpHeaderAcceptSelected) { - if (localVarHttpHeaderAcceptSelected.startsWith('text')) { - responseType_ = 'text'; - } else if (this.configuration.isJsonMime(localVarHttpHeaderAcceptSelected)) { - responseType_ = 'json'; - } else { - responseType_ = 'blob'; - } - } - - let localVarPath = `/api/organizations`; - const { basePath, withCredentials } = this.configuration; - return this.httpClient.request('get', `${basePath}${localVarPath}`, - { - context: localVarHttpContext, - params: localVarQueryParameters, - responseType: responseType_, - ...(withCredentials ? { withCredentials } : {}), - headers: localVarHeaders, - observe: observe, - ...(localVarTransferCache !== undefined ? { transferCache: localVarTransferCache } : {}), - reportProgress: reportProgress - } - ); + let responseType_: 'text' | 'json' | 'blob' = 'json'; + if (localVarHttpHeaderAcceptSelected) { + if (localVarHttpHeaderAcceptSelected.startsWith('text')) { + responseType_ = 'text'; + } else if ( + this.configuration.isJsonMime(localVarHttpHeaderAcceptSelected) + ) { + responseType_ = 'json'; + } else { + responseType_ = 'blob'; + } } - /** - * Update Organization - * @endpoint put /api/organizations/{organization_id} - * @param organizationId - * @param updateOrganizationRequest - * @param observe set whether or not to return 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, observe?: 'body', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable; - public updateOrganisation(organizationId: string, updateOrganizationRequest: UpdateOrganizationRequest, observe?: 'response', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable>; - public updateOrganisation(organizationId: string, updateOrganizationRequest: UpdateOrganizationRequest, observe?: 'events', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable>; - public updateOrganisation(organizationId: string, updateOrganizationRequest: UpdateOrganizationRequest, observe: any = 'body', reportProgress: boolean = false, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable { - if (organizationId === null || organizationId === undefined) { - throw new Error('Required parameter organizationId was null or undefined when calling updateOrganisation.'); - } - if (updateOrganizationRequest === null || updateOrganizationRequest === undefined) { - throw new Error('Required parameter updateOrganizationRequest was null or undefined when calling updateOrganisation.'); - } + let localVarPath = `/api/organizations`; + const { basePath, withCredentials } = this.configuration; + return this.httpClient.request( + 'post', + `${basePath}${localVarPath}`, + { + context: localVarHttpContext, + body: createOrganizationRequest, + responseType: responseType_, + ...(withCredentials ? { withCredentials } : {}), + headers: localVarHeaders, + observe: observe, + ...(localVarTransferCache !== undefined + ? { transferCache: localVarTransferCache } + : {}), + reportProgress: reportProgress, + }, + ); + } - let localVarHeaders = this.defaultHeaders; - - // authentication (HTTPBearer) required - localVarHeaders = this.configuration.addCredentialToHeaders('HTTPBearer', 'Authorization', localVarHeaders, 'Bearer '); - - const localVarHttpHeaderAcceptSelected: string | undefined = options?.httpHeaderAccept ?? this.configuration.selectHeaderAccept([ - 'application/json' - ]); - if (localVarHttpHeaderAcceptSelected !== undefined) { - localVarHeaders = localVarHeaders.set('Accept', localVarHttpHeaderAcceptSelected); - } - - const localVarHttpContext: HttpContext = options?.context ?? new HttpContext(); - - const localVarTransferCache: boolean = options?.transferCache ?? true; - - - // to determine the Content-Type header - const consumes: string[] = [ - 'application/json' - ]; - const httpContentTypeSelected: string | undefined = this.configuration.selectHeaderContentType(consumes); - if (httpContentTypeSelected !== undefined) { - localVarHeaders = localVarHeaders.set('Content-Type', httpContentTypeSelected); - } - - let responseType_: 'text' | 'json' | 'blob' = 'json'; - if (localVarHttpHeaderAcceptSelected) { - if (localVarHttpHeaderAcceptSelected.startsWith('text')) { - responseType_ = 'text'; - } else if (this.configuration.isJsonMime(localVarHttpHeaderAcceptSelected)) { - responseType_ = 'json'; - } else { - responseType_ = 'blob'; - } - } - - let localVarPath = `/api/organizations/${this.configuration.encodeParam({name: "organizationId", value: organizationId, in: "path", style: "simple", explode: false, dataType: "string", dataFormat: "uuid"})}`; - const { basePath, withCredentials } = this.configuration; - return this.httpClient.request('put', `${basePath}${localVarPath}`, - { - context: localVarHttpContext, - body: updateOrganizationRequest, - responseType: responseType_, - ...(withCredentials ? { withCredentials } : {}), - headers: localVarHeaders, - observe: observe, - ...(localVarTransferCache !== undefined ? { transferCache: localVarTransferCache } : {}), - reportProgress: reportProgress - } - ); + /** + * Delete Organization + * @endpoint delete /api/organizations/{organization_id} + * @param organizationId + * @param secureFgpAcc + * @param observe set whether or not to return the data Observable as the body, response or events. defaults to returning the body. + * @param reportProgress flag to report request and response progress. + */ + public deleteOrganisation( + organizationId: string, + secureFgpAcc?: string, + observe?: 'body', + reportProgress?: boolean, + options?: { + httpHeaderAccept?: 'application/json'; + context?: HttpContext; + transferCache?: boolean; + }, + ): Observable; + public deleteOrganisation( + organizationId: string, + secureFgpAcc?: string, + observe?: 'response', + reportProgress?: boolean, + options?: { + httpHeaderAccept?: 'application/json'; + context?: HttpContext; + transferCache?: boolean; + }, + ): Observable>; + public deleteOrganisation( + organizationId: string, + secureFgpAcc?: string, + observe?: 'events', + reportProgress?: boolean, + options?: { + httpHeaderAccept?: 'application/json'; + context?: HttpContext; + transferCache?: boolean; + }, + ): Observable>; + public deleteOrganisation( + organizationId: string, + secureFgpAcc?: string, + observe: any = 'body', + reportProgress: boolean = false, + options?: { + httpHeaderAccept?: 'application/json'; + context?: HttpContext; + transferCache?: boolean; + }, + ): Observable { + if (organizationId === null || organizationId === undefined) { + throw new Error( + 'Required parameter organizationId was null or undefined when calling deleteOrganisation.', + ); } + let localVarHeaders = this.defaultHeaders; + + // authentication (HTTPBearer) required + localVarHeaders = this.configuration.addCredentialToHeaders( + 'HTTPBearer', + 'Authorization', + localVarHeaders, + 'Bearer ', + ); + + const localVarHttpHeaderAcceptSelected: string | undefined = + options?.httpHeaderAccept ?? + this.configuration.selectHeaderAccept(['application/json']); + if (localVarHttpHeaderAcceptSelected !== undefined) { + localVarHeaders = localVarHeaders.set( + 'Accept', + localVarHttpHeaderAcceptSelected, + ); + } + + const localVarHttpContext: HttpContext = + options?.context ?? new HttpContext(); + + const localVarTransferCache: boolean = options?.transferCache ?? true; + + let responseType_: 'text' | 'json' | 'blob' = 'json'; + if (localVarHttpHeaderAcceptSelected) { + if (localVarHttpHeaderAcceptSelected.startsWith('text')) { + responseType_ = 'text'; + } else if ( + this.configuration.isJsonMime(localVarHttpHeaderAcceptSelected) + ) { + responseType_ = 'json'; + } else { + responseType_ = 'blob'; + } + } + + let localVarPath = `/api/organizations/${this.configuration.encodeParam({ name: 'organizationId', value: organizationId, in: 'path', style: 'simple', explode: false, dataType: 'string', dataFormat: 'uuid' })}`; + const { basePath, withCredentials } = this.configuration; + return this.httpClient.request( + 'delete', + `${basePath}${localVarPath}`, + { + context: localVarHttpContext, + responseType: responseType_, + ...(withCredentials ? { withCredentials } : {}), + headers: localVarHeaders, + observe: observe, + ...(localVarTransferCache !== undefined + ? { transferCache: localVarTransferCache } + : {}), + reportProgress: reportProgress, + }, + ); + } + + /** + * Get Organizations + * @endpoint get /api/organizations + * @param page + * @param pageSize + * @param offset + * @param secureFgpAcc + * @param observe set whether or not to return the data Observable as the body, response or events. defaults to returning the body. + * @param reportProgress flag to report request and response progress. + */ + public getOrganisations( + page?: number, + pageSize?: number, + offset?: number, + secureFgpAcc?: string, + observe?: 'body', + reportProgress?: boolean, + options?: { + httpHeaderAccept?: 'application/json'; + context?: HttpContext; + transferCache?: boolean; + }, + ): Observable; + public getOrganisations( + page?: number, + pageSize?: number, + offset?: number, + secureFgpAcc?: string, + observe?: 'response', + reportProgress?: boolean, + options?: { + httpHeaderAccept?: 'application/json'; + context?: HttpContext; + transferCache?: boolean; + }, + ): Observable>; + public getOrganisations( + page?: number, + pageSize?: number, + offset?: number, + secureFgpAcc?: string, + observe?: 'events', + reportProgress?: boolean, + options?: { + httpHeaderAccept?: 'application/json'; + context?: HttpContext; + transferCache?: boolean; + }, + ): Observable>; + public getOrganisations( + page?: number, + pageSize?: number, + offset?: number, + secureFgpAcc?: string, + observe: any = 'body', + reportProgress: boolean = false, + options?: { + httpHeaderAccept?: 'application/json'; + context?: HttpContext; + transferCache?: boolean; + }, + ): Observable { + let localVarQueryParameters = new HttpParams({ encoder: this.encoder }); + localVarQueryParameters = this.addToHttpParams( + localVarQueryParameters, + page, + 'page', + ); + localVarQueryParameters = this.addToHttpParams( + localVarQueryParameters, + pageSize, + 'page_size', + ); + localVarQueryParameters = this.addToHttpParams( + localVarQueryParameters, + offset, + 'offset', + ); + + let localVarHeaders = this.defaultHeaders; + + // authentication (HTTPBearer) required + localVarHeaders = this.configuration.addCredentialToHeaders( + 'HTTPBearer', + 'Authorization', + localVarHeaders, + 'Bearer ', + ); + + const localVarHttpHeaderAcceptSelected: string | undefined = + options?.httpHeaderAccept ?? + this.configuration.selectHeaderAccept(['application/json']); + if (localVarHttpHeaderAcceptSelected !== undefined) { + localVarHeaders = localVarHeaders.set( + 'Accept', + localVarHttpHeaderAcceptSelected, + ); + } + + const localVarHttpContext: HttpContext = + options?.context ?? new HttpContext(); + + const localVarTransferCache: boolean = options?.transferCache ?? true; + + let responseType_: 'text' | 'json' | 'blob' = 'json'; + if (localVarHttpHeaderAcceptSelected) { + if (localVarHttpHeaderAcceptSelected.startsWith('text')) { + responseType_ = 'text'; + } else if ( + this.configuration.isJsonMime(localVarHttpHeaderAcceptSelected) + ) { + responseType_ = 'json'; + } else { + responseType_ = 'blob'; + } + } + + let localVarPath = `/api/organizations`; + const { basePath, withCredentials } = this.configuration; + return this.httpClient.request( + 'get', + `${basePath}${localVarPath}`, + { + context: localVarHttpContext, + params: localVarQueryParameters, + responseType: responseType_, + ...(withCredentials ? { withCredentials } : {}), + headers: localVarHeaders, + observe: observe, + ...(localVarTransferCache !== undefined + ? { transferCache: localVarTransferCache } + : {}), + reportProgress: reportProgress, + }, + ); + } + + /** + * Update Organization + * @endpoint put /api/organizations/{organization_id} + * @param organizationId + * @param updateOrganizationRequest + * @param secureFgpAcc + * @param observe set whether or not to return the data Observable as the body, response or events. defaults to returning the body. + * @param reportProgress flag to report request and response progress. + */ + public updateOrganisation( + organizationId: string, + updateOrganizationRequest: UpdateOrganizationRequest, + secureFgpAcc?: string, + observe?: 'body', + reportProgress?: boolean, + options?: { + httpHeaderAccept?: 'application/json'; + context?: HttpContext; + transferCache?: boolean; + }, + ): Observable; + public updateOrganisation( + organizationId: string, + updateOrganizationRequest: UpdateOrganizationRequest, + secureFgpAcc?: string, + observe?: 'response', + reportProgress?: boolean, + options?: { + httpHeaderAccept?: 'application/json'; + context?: HttpContext; + transferCache?: boolean; + }, + ): Observable< + HttpResponse + >; + public updateOrganisation( + organizationId: string, + updateOrganizationRequest: UpdateOrganizationRequest, + secureFgpAcc?: string, + observe?: 'events', + reportProgress?: boolean, + options?: { + httpHeaderAccept?: 'application/json'; + context?: HttpContext; + transferCache?: boolean; + }, + ): Observable>; + public updateOrganisation( + organizationId: string, + updateOrganizationRequest: UpdateOrganizationRequest, + secureFgpAcc?: string, + observe: any = 'body', + reportProgress: boolean = false, + options?: { + httpHeaderAccept?: 'application/json'; + context?: HttpContext; + transferCache?: boolean; + }, + ): Observable { + if (organizationId === null || organizationId === undefined) { + throw new Error( + 'Required parameter organizationId was null or undefined when calling updateOrganisation.', + ); + } + if ( + updateOrganizationRequest === null || + updateOrganizationRequest === undefined + ) { + throw new Error( + 'Required parameter updateOrganizationRequest was null or undefined when calling updateOrganisation.', + ); + } + + let localVarHeaders = this.defaultHeaders; + + // authentication (HTTPBearer) required + localVarHeaders = this.configuration.addCredentialToHeaders( + 'HTTPBearer', + 'Authorization', + localVarHeaders, + 'Bearer ', + ); + + const localVarHttpHeaderAcceptSelected: string | undefined = + options?.httpHeaderAccept ?? + this.configuration.selectHeaderAccept(['application/json']); + if (localVarHttpHeaderAcceptSelected !== undefined) { + localVarHeaders = localVarHeaders.set( + 'Accept', + localVarHttpHeaderAcceptSelected, + ); + } + + const localVarHttpContext: HttpContext = + options?.context ?? new HttpContext(); + + const localVarTransferCache: boolean = options?.transferCache ?? true; + + // to determine the Content-Type header + const consumes: string[] = ['application/json']; + const httpContentTypeSelected: string | undefined = + this.configuration.selectHeaderContentType(consumes); + if (httpContentTypeSelected !== undefined) { + localVarHeaders = localVarHeaders.set( + 'Content-Type', + httpContentTypeSelected, + ); + } + + let responseType_: 'text' | 'json' | 'blob' = 'json'; + if (localVarHttpHeaderAcceptSelected) { + if (localVarHttpHeaderAcceptSelected.startsWith('text')) { + responseType_ = 'text'; + } else if ( + this.configuration.isJsonMime(localVarHttpHeaderAcceptSelected) + ) { + responseType_ = 'json'; + } else { + responseType_ = 'blob'; + } + } + + let localVarPath = `/api/organizations/${this.configuration.encodeParam({ name: 'organizationId', value: organizationId, in: 'path', style: 'simple', explode: false, dataType: 'string', dataFormat: 'uuid' })}`; + const { basePath, withCredentials } = this.configuration; + return this.httpClient.request( + 'put', + `${basePath}${localVarPath}`, + { + context: localVarHttpContext, + body: updateOrganizationRequest, + responseType: responseType_, + ...(withCredentials ? { withCredentials } : {}), + headers: localVarHeaders, + observe: observe, + ...(localVarTransferCache !== undefined + ? { transferCache: localVarTransferCache } + : {}), + reportProgress: reportProgress, + }, + ); + } } diff --git a/webapp/src/app/api/api/personNetwork.service.ts b/webapp/src/app/api/api/personNetwork.service.ts index b1183ff6..5b468938 100644 --- a/webapp/src/app/api/api/personNetwork.service.ts +++ b/webapp/src/app/api/api/personNetwork.service.ts @@ -1,7 +1,7 @@ /** * Innovation Search Engine API * - * + * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech @@ -9,12 +9,18 @@ */ /* tslint:disable:no-unused-variable member-ordering */ -import { Inject, Injectable, Optional } from '@angular/core'; -import { HttpClient, HttpHeaders, HttpParams, - HttpResponse, HttpEvent, HttpParameterCodec, HttpContext - } from '@angular/common/http'; -import { CustomHttpParameterCodec } from '../encoder'; -import { Observable } from 'rxjs'; +import { Inject, Injectable, Optional } from '@angular/core'; +import { + HttpClient, + HttpHeaders, + HttpParams, + HttpResponse, + HttpEvent, + HttpParameterCodec, + HttpContext, +} from '@angular/common/http'; +import { CustomHttpParameterCodec } from '../encoder'; +import { Observable } from 'rxjs'; // @ts-ignore import { CollaborationNetwork } from '../model/collaborationNetwork'; @@ -24,86 +30,139 @@ 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); + } - constructor(protected httpClient: HttpClient, @Optional() @Inject(BASE_PATH) basePath: string|string[], @Optional() configuration?: Configuration) { - super(basePath, configuration); + /** + * Get a person\'s collaboration network. + * Returns a person\'s collaboration network based on their works and co-authors. + * @endpoint post /api/person/network/{raw_user_id} + * @param rawUserId The raw user ID of the person. + * @param filterProperties + * @param observe set whether or not to return the data Observable as the body, response or events. defaults to returning the body. + * @param reportProgress flag to report request and response progress. + */ + public getCollaborationNetwork( + rawUserId: string, + filterProperties?: FilterProperties, + observe?: 'body', + reportProgress?: boolean, + options?: { + httpHeaderAccept?: 'application/json'; + context?: HttpContext; + transferCache?: boolean; + }, + ): Observable; + public getCollaborationNetwork( + rawUserId: string, + filterProperties?: FilterProperties, + observe?: 'response', + reportProgress?: boolean, + options?: { + httpHeaderAccept?: 'application/json'; + context?: HttpContext; + transferCache?: boolean; + }, + ): Observable>; + public getCollaborationNetwork( + rawUserId: string, + filterProperties?: FilterProperties, + observe?: 'events', + reportProgress?: boolean, + options?: { + httpHeaderAccept?: 'application/json'; + context?: HttpContext; + transferCache?: boolean; + }, + ): Observable>; + public getCollaborationNetwork( + rawUserId: string, + filterProperties?: FilterProperties, + observe: any = 'body', + reportProgress: boolean = false, + options?: { + httpHeaderAccept?: 'application/json'; + context?: HttpContext; + transferCache?: boolean; + }, + ): Observable { + if (rawUserId === null || rawUserId === undefined) { + throw new Error( + 'Required parameter rawUserId was null or undefined when calling getCollaborationNetwork.', + ); } - /** - * Get a person\'s collaboration network. - * Returns a person\'s collaboration network based on their works and co-authors. - * @endpoint post /api/person/network/{raw_user_id} - * @param rawUserId The raw user ID of the person. - * @param filterProperties - * @param observe set whether or not to return the data Observable as the body, response or events. defaults to returning the body. - * @param reportProgress flag to report request and response progress. - */ - public getCollaborationNetwork(rawUserId: string, filterProperties?: FilterProperties, observe?: 'body', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable; - public getCollaborationNetwork(rawUserId: string, filterProperties?: FilterProperties, observe?: 'response', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable>; - public getCollaborationNetwork(rawUserId: string, filterProperties?: FilterProperties, observe?: 'events', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable>; - public getCollaborationNetwork(rawUserId: string, filterProperties?: FilterProperties, observe: any = 'body', reportProgress: boolean = false, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable { - if (rawUserId === null || rawUserId === undefined) { - throw new Error('Required parameter rawUserId was null or undefined when calling getCollaborationNetwork.'); - } + let localVarHeaders = this.defaultHeaders; - let localVarHeaders = this.defaultHeaders; - - const localVarHttpHeaderAcceptSelected: string | undefined = options?.httpHeaderAccept ?? this.configuration.selectHeaderAccept([ - 'application/json' - ]); - if (localVarHttpHeaderAcceptSelected !== undefined) { - localVarHeaders = localVarHeaders.set('Accept', localVarHttpHeaderAcceptSelected); - } - - const localVarHttpContext: HttpContext = options?.context ?? new HttpContext(); - - const localVarTransferCache: boolean = options?.transferCache ?? true; - - - // to determine the Content-Type header - const consumes: string[] = [ - 'application/json' - ]; - const httpContentTypeSelected: string | undefined = this.configuration.selectHeaderContentType(consumes); - if (httpContentTypeSelected !== undefined) { - localVarHeaders = localVarHeaders.set('Content-Type', httpContentTypeSelected); - } - - let responseType_: 'text' | 'json' | 'blob' = 'json'; - if (localVarHttpHeaderAcceptSelected) { - if (localVarHttpHeaderAcceptSelected.startsWith('text')) { - responseType_ = 'text'; - } else if (this.configuration.isJsonMime(localVarHttpHeaderAcceptSelected)) { - responseType_ = 'json'; - } else { - responseType_ = 'blob'; - } - } - - let localVarPath = `/api/person/network/${this.configuration.encodeParam({name: "rawUserId", value: rawUserId, in: "path", style: "simple", explode: false, dataType: "string", dataFormat: undefined})}`; - const { basePath, withCredentials } = this.configuration; - return this.httpClient.request('post', `${basePath}${localVarPath}`, - { - context: localVarHttpContext, - body: filterProperties, - responseType: responseType_, - ...(withCredentials ? { withCredentials } : {}), - headers: localVarHeaders, - observe: observe, - ...(localVarTransferCache !== undefined ? { transferCache: localVarTransferCache } : {}), - reportProgress: reportProgress - } - ); + const localVarHttpHeaderAcceptSelected: string | undefined = + options?.httpHeaderAccept ?? + this.configuration.selectHeaderAccept(['application/json']); + if (localVarHttpHeaderAcceptSelected !== undefined) { + localVarHeaders = localVarHeaders.set( + 'Accept', + localVarHttpHeaderAcceptSelected, + ); } + const localVarHttpContext: HttpContext = + options?.context ?? new HttpContext(); + + const localVarTransferCache: boolean = options?.transferCache ?? true; + + // to determine the Content-Type header + const consumes: string[] = ['application/json']; + const httpContentTypeSelected: string | undefined = + this.configuration.selectHeaderContentType(consumes); + if (httpContentTypeSelected !== undefined) { + localVarHeaders = localVarHeaders.set( + 'Content-Type', + httpContentTypeSelected, + ); + } + + let responseType_: 'text' | 'json' | 'blob' = 'json'; + if (localVarHttpHeaderAcceptSelected) { + if (localVarHttpHeaderAcceptSelected.startsWith('text')) { + responseType_ = 'text'; + } else if ( + this.configuration.isJsonMime(localVarHttpHeaderAcceptSelected) + ) { + responseType_ = 'json'; + } else { + responseType_ = 'blob'; + } + } + + let localVarPath = `/api/person/network/${this.configuration.encodeParam({ name: 'rawUserId', value: rawUserId, in: 'path', style: 'simple', explode: false, dataType: 'string', dataFormat: undefined })}`; + const { basePath, withCredentials } = this.configuration; + return this.httpClient.request( + 'post', + `${basePath}${localVarPath}`, + { + context: localVarHttpContext, + body: filterProperties, + responseType: responseType_, + ...(withCredentials ? { withCredentials } : {}), + headers: localVarHeaders, + observe: observe, + ...(localVarTransferCache !== undefined + ? { transferCache: localVarTransferCache } + : {}), + reportProgress: reportProgress, + }, + ); + } } diff --git a/webapp/src/app/api/api/persons.service.ts b/webapp/src/app/api/api/persons.service.ts index 03222a4c..cef36fc4 100644 --- a/webapp/src/app/api/api/persons.service.ts +++ b/webapp/src/app/api/api/persons.service.ts @@ -1,7 +1,7 @@ /** * Innovation Search Engine API * - * + * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech @@ -9,12 +9,18 @@ */ /* tslint:disable:no-unused-variable member-ordering */ -import { Inject, Injectable, Optional } from '@angular/core'; -import { HttpClient, HttpHeaders, HttpParams, - HttpResponse, HttpEvent, HttpParameterCodec, HttpContext - } from '@angular/common/http'; -import { CustomHttpParameterCodec } from '../encoder'; -import { Observable } from 'rxjs'; +import { Inject, Injectable, Optional } from '@angular/core'; +import { + HttpClient, + HttpHeaders, + HttpParams, + HttpResponse, + HttpEvent, + HttpParameterCodec, + HttpContext, +} from '@angular/common/http'; +import { CustomHttpParameterCodec } from '../encoder'; +import { Observable } from 'rxjs'; // @ts-ignore import { AuthorsListResponse } from '../model/authorsListResponse'; @@ -26,869 +32,1739 @@ import { HTTPValidationError } from '../model/hTTPValidationError'; import { PersonBio } from '../model/personBio'; // @ts-ignore -import { BASE_PATH, COLLECTION_FORMATS } from '../variables'; -import { Configuration } from '../configuration'; +import { BASE_PATH, COLLECTION_FORMATS } from '../variables'; +import { Configuration } from '../configuration'; import { BaseService } from '../api.base.service'; - - @Injectable({ - providedIn: 'root' + providedIn: 'root', }) export class PersonsService extends BaseService { + constructor( + protected httpClient: HttpClient, + @Optional() @Inject(BASE_PATH) basePath: string | string[], + @Optional() configuration?: Configuration, + ) { + super(basePath, configuration); + } - constructor(protected httpClient: HttpClient, @Optional() @Inject(BASE_PATH) basePath: string|string[], @Optional() configuration?: Configuration) { - super(basePath, configuration); + /** + * Generates a bio for a person by author ID. + * @endpoint get /api/inse-service/persons/bio + * @param authorId OpenAlex author ID (e.g., A5093075883) + * @param include Comma-separated list to include tags + * @param observe set whether or not to return the data Observable as the body, response or events. defaults to returning the body. + * @param reportProgress flag to report request and response progress. + */ + public generatePersonBio( + authorId: string, + include?: string, + observe?: 'body', + reportProgress?: boolean, + options?: { + httpHeaderAccept?: 'application/json'; + context?: HttpContext; + transferCache?: boolean; + }, + ): Observable; + public generatePersonBio( + authorId: string, + include?: string, + observe?: 'response', + reportProgress?: boolean, + options?: { + httpHeaderAccept?: 'application/json'; + context?: HttpContext; + transferCache?: boolean; + }, + ): Observable>; + public generatePersonBio( + authorId: string, + include?: string, + observe?: 'events', + reportProgress?: boolean, + options?: { + httpHeaderAccept?: 'application/json'; + context?: HttpContext; + transferCache?: boolean; + }, + ): Observable>; + public generatePersonBio( + authorId: string, + include?: string, + observe: any = 'body', + reportProgress: boolean = false, + options?: { + httpHeaderAccept?: 'application/json'; + context?: HttpContext; + transferCache?: boolean; + }, + ): Observable { + if (authorId === null || authorId === undefined) { + throw new Error( + 'Required parameter authorId was null or undefined when calling generatePersonBio.', + ); } - /** - * Generates a bio for a person by author ID. - * @endpoint get /api/inse-service/persons/bio - * @param authorId OpenAlex author ID (e.g., A5093075883) - * @param include Comma-separated list to include tags - * @param observe set whether or not to return the data Observable as the body, response or events. defaults to returning the body. - * @param reportProgress flag to report request and response progress. - */ - public generatePersonBio(authorId: string, include?: string, observe?: 'body', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable; - public generatePersonBio(authorId: string, include?: string, observe?: 'response', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable>; - public generatePersonBio(authorId: string, include?: string, observe?: 'events', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable>; - public generatePersonBio(authorId: string, include?: string, observe: any = 'body', reportProgress: boolean = false, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable { - if (authorId === null || authorId === undefined) { - throw new Error('Required parameter authorId was null or undefined when calling generatePersonBio.'); - } + let localVarQueryParameters = new HttpParams({ encoder: this.encoder }); + localVarQueryParameters = this.addToHttpParams( + localVarQueryParameters, + authorId, + 'author_id', + ); + localVarQueryParameters = this.addToHttpParams( + localVarQueryParameters, + include, + 'include', + ); - let localVarQueryParameters = new HttpParams({encoder: this.encoder}); - localVarQueryParameters = this.addToHttpParams(localVarQueryParameters, - authorId, 'author_id'); - localVarQueryParameters = this.addToHttpParams(localVarQueryParameters, - include, 'include'); + let localVarHeaders = this.defaultHeaders; - let localVarHeaders = this.defaultHeaders; + const localVarHttpHeaderAcceptSelected: string | undefined = + options?.httpHeaderAccept ?? + this.configuration.selectHeaderAccept(['application/json']); + if (localVarHttpHeaderAcceptSelected !== undefined) { + localVarHeaders = localVarHeaders.set( + 'Accept', + localVarHttpHeaderAcceptSelected, + ); + } - const localVarHttpHeaderAcceptSelected: string | undefined = options?.httpHeaderAccept ?? this.configuration.selectHeaderAccept([ - 'application/json' - ]); - if (localVarHttpHeaderAcceptSelected !== undefined) { - localVarHeaders = localVarHeaders.set('Accept', localVarHttpHeaderAcceptSelected); - } + const localVarHttpContext: HttpContext = + options?.context ?? new HttpContext(); - const localVarHttpContext: HttpContext = options?.context ?? new HttpContext(); + const localVarTransferCache: boolean = options?.transferCache ?? true; - const localVarTransferCache: boolean = options?.transferCache ?? true; + let responseType_: 'text' | 'json' | 'blob' = 'json'; + if (localVarHttpHeaderAcceptSelected) { + if (localVarHttpHeaderAcceptSelected.startsWith('text')) { + responseType_ = 'text'; + } else if ( + this.configuration.isJsonMime(localVarHttpHeaderAcceptSelected) + ) { + responseType_ = 'json'; + } else { + responseType_ = 'blob'; + } + } + let localVarPath = `/api/inse-service/persons/bio`; + const { basePath, withCredentials } = this.configuration; + return this.httpClient.request( + 'get', + `${basePath}${localVarPath}`, + { + context: localVarHttpContext, + params: localVarQueryParameters, + responseType: responseType_, + ...(withCredentials ? { withCredentials } : {}), + headers: localVarHeaders, + observe: observe, + ...(localVarTransferCache !== undefined + ? { transferCache: localVarTransferCache } + : {}), + reportProgress: reportProgress, + }, + ); + } - let responseType_: 'text' | 'json' | 'blob' = 'json'; - if (localVarHttpHeaderAcceptSelected) { - if (localVarHttpHeaderAcceptSelected.startsWith('text')) { - responseType_ = 'text'; - } else if (this.configuration.isJsonMime(localVarHttpHeaderAcceptSelected)) { - responseType_ = 'json'; - } else { - responseType_ = 'blob'; - } - } + /** + * Searches for person by ID. + * @endpoint get /api/inse-service/person/{id} + * @param id OpenAlex author ID + * @param include Which data do we require? include tags: topics_full, topic_share, summary_stats, ids, last_known_institutions, ... + * @param observe set whether or not to return the data Observable as the body, response or events. defaults to returning the body. + * @param reportProgress flag to report request and response progress. + */ + public getPersonByID( + id: string, + include?: string, + observe?: 'body', + reportProgress?: boolean, + options?: { + httpHeaderAccept?: 'application/json'; + context?: HttpContext; + transferCache?: boolean; + }, + ): Observable; + public getPersonByID( + id: string, + include?: string, + observe?: 'response', + reportProgress?: boolean, + options?: { + httpHeaderAccept?: 'application/json'; + context?: HttpContext; + transferCache?: boolean; + }, + ): Observable>; + public getPersonByID( + id: string, + include?: string, + observe?: 'events', + reportProgress?: boolean, + options?: { + httpHeaderAccept?: 'application/json'; + context?: HttpContext; + transferCache?: boolean; + }, + ): Observable>; + public getPersonByID( + id: string, + include?: string, + observe: any = 'body', + reportProgress: boolean = false, + options?: { + httpHeaderAccept?: 'application/json'; + context?: HttpContext; + transferCache?: boolean; + }, + ): Observable { + if (id === null || id === undefined) { + throw new Error( + 'Required parameter id was null or undefined when calling getPersonByID.', + ); + } - let localVarPath = `/api/inse-service/persons/bio`; - const { basePath, withCredentials } = this.configuration; - return this.httpClient.request('get', `${basePath}${localVarPath}`, - { - context: localVarHttpContext, - params: localVarQueryParameters, - responseType: responseType_, - ...(withCredentials ? { withCredentials } : {}), - headers: localVarHeaders, - observe: observe, - ...(localVarTransferCache !== undefined ? { transferCache: localVarTransferCache } : {}), - reportProgress: reportProgress - } + let localVarQueryParameters = new HttpParams({ encoder: this.encoder }); + localVarQueryParameters = this.addToHttpParams( + localVarQueryParameters, + include, + 'include', + ); + + let localVarHeaders = this.defaultHeaders; + + const localVarHttpHeaderAcceptSelected: string | undefined = + options?.httpHeaderAccept ?? + this.configuration.selectHeaderAccept(['application/json']); + if (localVarHttpHeaderAcceptSelected !== undefined) { + localVarHeaders = localVarHeaders.set( + 'Accept', + localVarHttpHeaderAcceptSelected, + ); + } + + const localVarHttpContext: HttpContext = + options?.context ?? new HttpContext(); + + const localVarTransferCache: boolean = options?.transferCache ?? true; + + let responseType_: 'text' | 'json' | 'blob' = 'json'; + if (localVarHttpHeaderAcceptSelected) { + if (localVarHttpHeaderAcceptSelected.startsWith('text')) { + responseType_ = 'text'; + } else if ( + this.configuration.isJsonMime(localVarHttpHeaderAcceptSelected) + ) { + responseType_ = 'json'; + } else { + responseType_ = 'blob'; + } + } + + let localVarPath = `/api/inse-service/person/${this.configuration.encodeParam({ name: 'id', value: id, in: 'path', style: 'simple', explode: false, dataType: 'string', dataFormat: undefined })}`; + const { basePath, withCredentials } = this.configuration; + return this.httpClient.request( + 'get', + `${basePath}${localVarPath}`, + { + context: localVarHttpContext, + params: localVarQueryParameters, + responseType: responseType_, + ...(withCredentials ? { withCredentials } : {}), + headers: localVarHeaders, + observe: observe, + ...(localVarTransferCache !== undefined + ? { transferCache: localVarTransferCache } + : {}), + reportProgress: reportProgress, + }, + ); + } + + /** + * Searches for person by ID. + * @endpoint get /api/inse-service/person/{id} + * @param id OpenAlex author ID + * @param include Which data do we require? include tags: topics_full, topic_share, summary_stats, ids, last_known_institutions, ... + * @param observe set whether or not to return the data Observable as the body, response or events. defaults to returning the body. + * @param reportProgress flag to report request and response progress. + */ + public getPersonByID_1( + id: string, + include?: string, + observe?: 'body', + reportProgress?: boolean, + options?: { + httpHeaderAccept?: 'application/json'; + context?: HttpContext; + transferCache?: boolean; + }, + ): Observable; + public getPersonByID_1( + id: string, + include?: string, + observe?: 'response', + reportProgress?: boolean, + options?: { + httpHeaderAccept?: 'application/json'; + context?: HttpContext; + transferCache?: boolean; + }, + ): Observable>; + public getPersonByID_1( + id: string, + include?: string, + observe?: 'events', + reportProgress?: boolean, + options?: { + httpHeaderAccept?: 'application/json'; + context?: HttpContext; + transferCache?: boolean; + }, + ): Observable>; + public getPersonByID_1( + id: string, + include?: string, + observe: any = 'body', + reportProgress: boolean = false, + options?: { + httpHeaderAccept?: 'application/json'; + context?: HttpContext; + transferCache?: boolean; + }, + ): Observable { + if (id === null || id === undefined) { + throw new Error( + 'Required parameter id was null or undefined when calling getPersonByID_1.', + ); + } + + let localVarQueryParameters = new HttpParams({ encoder: this.encoder }); + localVarQueryParameters = this.addToHttpParams( + localVarQueryParameters, + include, + 'include', + ); + + let localVarHeaders = this.defaultHeaders; + + const localVarHttpHeaderAcceptSelected: string | undefined = + options?.httpHeaderAccept ?? + this.configuration.selectHeaderAccept(['application/json']); + if (localVarHttpHeaderAcceptSelected !== undefined) { + localVarHeaders = localVarHeaders.set( + 'Accept', + localVarHttpHeaderAcceptSelected, + ); + } + + const localVarHttpContext: HttpContext = + options?.context ?? new HttpContext(); + + const localVarTransferCache: boolean = options?.transferCache ?? true; + + let responseType_: 'text' | 'json' | 'blob' = 'json'; + if (localVarHttpHeaderAcceptSelected) { + if (localVarHttpHeaderAcceptSelected.startsWith('text')) { + responseType_ = 'text'; + } else if ( + this.configuration.isJsonMime(localVarHttpHeaderAcceptSelected) + ) { + responseType_ = 'json'; + } else { + responseType_ = 'blob'; + } + } + + let localVarPath = `/api/inse-service/person/${this.configuration.encodeParam({ name: 'id', value: id, in: 'path', style: 'simple', explode: false, dataType: 'string', dataFormat: undefined })}`; + const { basePath, withCredentials } = this.configuration; + return this.httpClient.request( + 'get', + `${basePath}${localVarPath}`, + { + context: localVarHttpContext, + params: localVarQueryParameters, + responseType: responseType_, + ...(withCredentials ? { withCredentials } : {}), + headers: localVarHeaders, + observe: observe, + ...(localVarTransferCache !== undefined + ? { transferCache: localVarTransferCache } + : {}), + reportProgress: reportProgress, + }, + ); + } + + /** + * Searches for persons by ID or name. + * @endpoint get /api/inse-service/persons/search + * @param authorId OpenAlex author ID (e.g., A5093075883) + * @param query Search query (e.g., Arman AND Arzani) + * @param include Comma-separated include tags: topics_full, topic_share, summary_stats, ids, last_known_institutions, sources, counts_by_year, works_api_url, dates, cited_by_count_boost + * @param observe set whether or not to return the data Observable as the body, response or events. defaults to returning the body. + * @param reportProgress flag to report request and response progress. + */ + public searchPersons( + authorId?: string, + query?: string, + include?: string, + observe?: 'body', + reportProgress?: boolean, + options?: { + httpHeaderAccept?: 'application/json'; + context?: HttpContext; + transferCache?: boolean; + }, + ): Observable; + public searchPersons( + authorId?: string, + query?: string, + include?: string, + observe?: 'response', + reportProgress?: boolean, + options?: { + httpHeaderAccept?: 'application/json'; + context?: HttpContext; + transferCache?: boolean; + }, + ): Observable>; + public searchPersons( + authorId?: string, + query?: string, + include?: string, + observe?: 'events', + reportProgress?: boolean, + options?: { + httpHeaderAccept?: 'application/json'; + context?: HttpContext; + transferCache?: boolean; + }, + ): Observable>; + public searchPersons( + authorId?: string, + query?: string, + include?: string, + observe: any = 'body', + reportProgress: boolean = false, + options?: { + httpHeaderAccept?: 'application/json'; + context?: HttpContext; + transferCache?: boolean; + }, + ): Observable { + let localVarQueryParameters = new HttpParams({ encoder: this.encoder }); + localVarQueryParameters = this.addToHttpParams( + localVarQueryParameters, + authorId, + 'author_id', + ); + localVarQueryParameters = this.addToHttpParams( + localVarQueryParameters, + query, + 'query', + ); + localVarQueryParameters = this.addToHttpParams( + localVarQueryParameters, + include, + 'include', + ); + + let localVarHeaders = this.defaultHeaders; + + const localVarHttpHeaderAcceptSelected: string | undefined = + options?.httpHeaderAccept ?? + this.configuration.selectHeaderAccept(['application/json']); + if (localVarHttpHeaderAcceptSelected !== undefined) { + localVarHeaders = localVarHeaders.set( + 'Accept', + localVarHttpHeaderAcceptSelected, + ); + } + + const localVarHttpContext: HttpContext = + options?.context ?? new HttpContext(); + + const localVarTransferCache: boolean = options?.transferCache ?? true; + + let responseType_: 'text' | 'json' | 'blob' = 'json'; + if (localVarHttpHeaderAcceptSelected) { + if (localVarHttpHeaderAcceptSelected.startsWith('text')) { + responseType_ = 'text'; + } else if ( + this.configuration.isJsonMime(localVarHttpHeaderAcceptSelected) + ) { + responseType_ = 'json'; + } else { + responseType_ = 'blob'; + } + } + + let localVarPath = `/api/inse-service/persons/search`; + const { basePath, withCredentials } = this.configuration; + return this.httpClient.request( + 'get', + `${basePath}${localVarPath}`, + { + context: localVarHttpContext, + params: localVarQueryParameters, + responseType: responseType_, + ...(withCredentials ? { withCredentials } : {}), + headers: localVarHeaders, + observe: observe, + ...(localVarTransferCache !== undefined + ? { transferCache: localVarTransferCache } + : {}), + reportProgress: reportProgress, + }, + ); + } + + /** + * Searches for person by name. + * @endpoint get /api/inse-service/persons/autocomplete + * @param authorName Authors name (e.g., Arman Arzani) + * @param include Which data do we require? include tags: topics_full, topic_share, summary_stats, ids, last_known_institutions, ... + * @param observe set whether or not to return the data Observable as the body, response or events. defaults to returning the body. + * @param reportProgress flag to report request and response progress. + */ + public searchPersonsAutocomplete( + authorName: string, + include: string, + observe?: 'body', + reportProgress?: boolean, + options?: { + httpHeaderAccept?: 'application/json'; + context?: HttpContext; + transferCache?: boolean; + }, + ): Observable; + public searchPersonsAutocomplete( + authorName: string, + include: string, + observe?: 'response', + reportProgress?: boolean, + options?: { + httpHeaderAccept?: 'application/json'; + context?: HttpContext; + transferCache?: boolean; + }, + ): Observable>; + public searchPersonsAutocomplete( + authorName: string, + include: string, + observe?: 'events', + reportProgress?: boolean, + options?: { + httpHeaderAccept?: 'application/json'; + context?: HttpContext; + transferCache?: boolean; + }, + ): Observable>; + public searchPersonsAutocomplete( + authorName: string, + include: string, + observe: any = 'body', + reportProgress: boolean = false, + options?: { + httpHeaderAccept?: 'application/json'; + context?: HttpContext; + transferCache?: boolean; + }, + ): Observable { + if (authorName === null || authorName === undefined) { + throw new Error( + 'Required parameter authorName was null or undefined when calling searchPersonsAutocomplete.', + ); + } + if (include === null || include === undefined) { + throw new Error( + 'Required parameter include was null or undefined when calling searchPersonsAutocomplete.', + ); + } + + let localVarQueryParameters = new HttpParams({ encoder: this.encoder }); + localVarQueryParameters = this.addToHttpParams( + localVarQueryParameters, + authorName, + 'author_name', + ); + localVarQueryParameters = this.addToHttpParams( + localVarQueryParameters, + include, + 'include', + ); + + let localVarHeaders = this.defaultHeaders; + + const localVarHttpHeaderAcceptSelected: string | undefined = + options?.httpHeaderAccept ?? + this.configuration.selectHeaderAccept(['application/json']); + if (localVarHttpHeaderAcceptSelected !== undefined) { + localVarHeaders = localVarHeaders.set( + 'Accept', + localVarHttpHeaderAcceptSelected, + ); + } + + const localVarHttpContext: HttpContext = + options?.context ?? new HttpContext(); + + const localVarTransferCache: boolean = options?.transferCache ?? true; + + let responseType_: 'text' | 'json' | 'blob' = 'json'; + if (localVarHttpHeaderAcceptSelected) { + if (localVarHttpHeaderAcceptSelected.startsWith('text')) { + responseType_ = 'text'; + } else if ( + this.configuration.isJsonMime(localVarHttpHeaderAcceptSelected) + ) { + responseType_ = 'json'; + } else { + responseType_ = 'blob'; + } + } + + let localVarPath = `/api/inse-service/persons/autocomplete`; + const { basePath, withCredentials } = this.configuration; + return this.httpClient.request( + 'get', + `${basePath}${localVarPath}`, + { + context: localVarHttpContext, + params: localVarQueryParameters, + responseType: responseType_, + ...(withCredentials ? { withCredentials } : {}), + headers: localVarHeaders, + observe: observe, + ...(localVarTransferCache !== undefined + ? { transferCache: localVarTransferCache } + : {}), + reportProgress: reportProgress, + }, + ); + } + + /** + * Searches for person by name. + * @endpoint get /api/inse-service/persons/autocomplete + * @param authorName Authors name (e.g., Arman Arzani) + * @param include Which data do we require? include tags: topics_full, topic_share, summary_stats, ids, last_known_institutions, ... + * @param observe set whether or not to return the data Observable as the body, response or events. defaults to returning the body. + * @param reportProgress flag to report request and response progress. + */ + public searchPersonsAutocomplete_2( + authorName: string, + include: string, + observe?: 'body', + reportProgress?: boolean, + options?: { + httpHeaderAccept?: 'application/json'; + context?: HttpContext; + transferCache?: boolean; + }, + ): Observable; + public searchPersonsAutocomplete_2( + authorName: string, + include: string, + observe?: 'response', + reportProgress?: boolean, + options?: { + httpHeaderAccept?: 'application/json'; + context?: HttpContext; + transferCache?: boolean; + }, + ): Observable>; + public searchPersonsAutocomplete_2( + authorName: string, + include: string, + observe?: 'events', + reportProgress?: boolean, + options?: { + httpHeaderAccept?: 'application/json'; + context?: HttpContext; + transferCache?: boolean; + }, + ): Observable>; + public searchPersonsAutocomplete_2( + authorName: string, + include: string, + observe: any = 'body', + reportProgress: boolean = false, + options?: { + httpHeaderAccept?: 'application/json'; + context?: HttpContext; + transferCache?: boolean; + }, + ): Observable { + if (authorName === null || authorName === undefined) { + throw new Error( + 'Required parameter authorName was null or undefined when calling searchPersonsAutocomplete_2.', + ); + } + if (include === null || include === undefined) { + throw new Error( + 'Required parameter include was null or undefined when calling searchPersonsAutocomplete_2.', + ); + } + + let localVarQueryParameters = new HttpParams({ encoder: this.encoder }); + localVarQueryParameters = this.addToHttpParams( + localVarQueryParameters, + authorName, + 'author_name', + ); + localVarQueryParameters = this.addToHttpParams( + localVarQueryParameters, + include, + 'include', + ); + + let localVarHeaders = this.defaultHeaders; + + const localVarHttpHeaderAcceptSelected: string | undefined = + options?.httpHeaderAccept ?? + this.configuration.selectHeaderAccept(['application/json']); + if (localVarHttpHeaderAcceptSelected !== undefined) { + localVarHeaders = localVarHeaders.set( + 'Accept', + localVarHttpHeaderAcceptSelected, + ); + } + + const localVarHttpContext: HttpContext = + options?.context ?? new HttpContext(); + + const localVarTransferCache: boolean = options?.transferCache ?? true; + + let responseType_: 'text' | 'json' | 'blob' = 'json'; + if (localVarHttpHeaderAcceptSelected) { + if (localVarHttpHeaderAcceptSelected.startsWith('text')) { + responseType_ = 'text'; + } else if ( + this.configuration.isJsonMime(localVarHttpHeaderAcceptSelected) + ) { + responseType_ = 'json'; + } else { + responseType_ = 'blob'; + } + } + + let localVarPath = `/api/inse-service/persons/autocomplete`; + const { basePath, withCredentials } = this.configuration; + return this.httpClient.request( + 'get', + `${basePath}${localVarPath}`, + { + context: localVarHttpContext, + params: localVarQueryParameters, + responseType: responseType_, + ...(withCredentials ? { withCredentials } : {}), + headers: localVarHeaders, + observe: observe, + ...(localVarTransferCache !== undefined + ? { transferCache: localVarTransferCache } + : {}), + reportProgress: reportProgress, + }, + ); + } + + /** + * Searches for persons by institution name. + * @endpoint get /api/inse-service/persons/searchByInstitution + * @param institutionName Institution name (e.g., MIT, Oxford University) + * @param include Which data do we require? include tags: topics_full, topic_share, summary_stats, ids, last_known_institutions, ... + * @param limit Limit of search page results + * @param pageOffset Offset of the result page + * @param observe set whether or not to return the data Observable as the body, response or events. defaults to returning the body. + * @param reportProgress flag to report request and response progress. + */ + public searchPersonsByInstitution( + institutionName: string, + include: string, + limit?: number, + pageOffset?: number, + observe?: 'body', + reportProgress?: boolean, + options?: { + httpHeaderAccept?: 'application/json'; + context?: HttpContext; + transferCache?: boolean; + }, + ): Observable; + public searchPersonsByInstitution( + institutionName: string, + include: string, + limit?: number, + pageOffset?: number, + observe?: 'response', + reportProgress?: boolean, + options?: { + httpHeaderAccept?: 'application/json'; + context?: HttpContext; + transferCache?: boolean; + }, + ): Observable>; + public searchPersonsByInstitution( + institutionName: string, + include: string, + limit?: number, + pageOffset?: number, + observe?: 'events', + reportProgress?: boolean, + options?: { + httpHeaderAccept?: 'application/json'; + context?: HttpContext; + transferCache?: boolean; + }, + ): Observable>; + public searchPersonsByInstitution( + institutionName: string, + include: string, + limit?: number, + pageOffset?: number, + observe: any = 'body', + reportProgress: boolean = false, + options?: { + httpHeaderAccept?: 'application/json'; + context?: HttpContext; + transferCache?: boolean; + }, + ): Observable { + if (institutionName === null || institutionName === undefined) { + throw new Error( + 'Required parameter institutionName was null or undefined when calling searchPersonsByInstitution.', + ); + } + if (include === null || include === undefined) { + throw new Error( + 'Required parameter include was null or undefined when calling searchPersonsByInstitution.', + ); + } + + let localVarQueryParameters = new HttpParams({ encoder: this.encoder }); + localVarQueryParameters = this.addToHttpParams( + localVarQueryParameters, + institutionName, + 'institution_name', + ); + localVarQueryParameters = this.addToHttpParams( + localVarQueryParameters, + include, + 'include', + ); + localVarQueryParameters = this.addToHttpParams( + localVarQueryParameters, + limit, + 'limit', + ); + localVarQueryParameters = this.addToHttpParams( + localVarQueryParameters, + pageOffset, + 'page_offset', + ); + + let localVarHeaders = this.defaultHeaders; + + const localVarHttpHeaderAcceptSelected: string | undefined = + options?.httpHeaderAccept ?? + this.configuration.selectHeaderAccept(['application/json']); + if (localVarHttpHeaderAcceptSelected !== undefined) { + localVarHeaders = localVarHeaders.set( + 'Accept', + localVarHttpHeaderAcceptSelected, + ); + } + + const localVarHttpContext: HttpContext = + options?.context ?? new HttpContext(); + + const localVarTransferCache: boolean = options?.transferCache ?? true; + + let responseType_: 'text' | 'json' | 'blob' = 'json'; + if (localVarHttpHeaderAcceptSelected) { + if (localVarHttpHeaderAcceptSelected.startsWith('text')) { + responseType_ = 'text'; + } else if ( + this.configuration.isJsonMime(localVarHttpHeaderAcceptSelected) + ) { + responseType_ = 'json'; + } else { + responseType_ = 'blob'; + } + } + + let localVarPath = `/api/inse-service/persons/searchByInstitution`; + const { basePath, withCredentials } = this.configuration; + return this.httpClient.request( + 'get', + `${basePath}${localVarPath}`, + { + context: localVarHttpContext, + params: localVarQueryParameters, + responseType: responseType_, + ...(withCredentials ? { withCredentials } : {}), + headers: localVarHeaders, + observe: observe, + ...(localVarTransferCache !== undefined + ? { transferCache: localVarTransferCache } + : {}), + reportProgress: reportProgress, + }, + ); + } + + /** + * Searches for persons by institution name. + * @endpoint get /api/inse-service/persons/searchByInstitution + * @param institutionName Institution name (e.g., MIT, Oxford University) + * @param include Which data do we require? include tags: topics_full, topic_share, summary_stats, ids, last_known_institutions, ... + * @param limit Limit of search page results + * @param pageOffset Offset of the result page + * @param observe set whether or not to return the data Observable as the body, response or events. defaults to returning the body. + * @param reportProgress flag to report request and response progress. + */ + public searchPersonsByInstitution_3( + institutionName: string, + include: string, + limit?: number, + pageOffset?: number, + observe?: 'body', + reportProgress?: boolean, + options?: { + httpHeaderAccept?: 'application/json'; + context?: HttpContext; + transferCache?: boolean; + }, + ): Observable; + public searchPersonsByInstitution_3( + institutionName: string, + include: string, + limit?: number, + pageOffset?: number, + observe?: 'response', + reportProgress?: boolean, + options?: { + httpHeaderAccept?: 'application/json'; + context?: HttpContext; + transferCache?: boolean; + }, + ): Observable>; + public searchPersonsByInstitution_3( + institutionName: string, + include: string, + limit?: number, + pageOffset?: number, + observe?: 'events', + reportProgress?: boolean, + options?: { + httpHeaderAccept?: 'application/json'; + context?: HttpContext; + transferCache?: boolean; + }, + ): Observable>; + public searchPersonsByInstitution_3( + institutionName: string, + include: string, + limit?: number, + pageOffset?: number, + observe: any = 'body', + reportProgress: boolean = false, + options?: { + httpHeaderAccept?: 'application/json'; + context?: HttpContext; + transferCache?: boolean; + }, + ): Observable { + if (institutionName === null || institutionName === undefined) { + throw new Error( + 'Required parameter institutionName was null or undefined when calling searchPersonsByInstitution_3.', + ); + } + if (include === null || include === undefined) { + throw new Error( + 'Required parameter include was null or undefined when calling searchPersonsByInstitution_3.', + ); + } + + let localVarQueryParameters = new HttpParams({ encoder: this.encoder }); + localVarQueryParameters = this.addToHttpParams( + localVarQueryParameters, + institutionName, + 'institution_name', + ); + localVarQueryParameters = this.addToHttpParams( + localVarQueryParameters, + include, + 'include', + ); + localVarQueryParameters = this.addToHttpParams( + localVarQueryParameters, + limit, + 'limit', + ); + localVarQueryParameters = this.addToHttpParams( + localVarQueryParameters, + pageOffset, + 'page_offset', + ); + + let localVarHeaders = this.defaultHeaders; + + const localVarHttpHeaderAcceptSelected: string | undefined = + options?.httpHeaderAccept ?? + this.configuration.selectHeaderAccept(['application/json']); + if (localVarHttpHeaderAcceptSelected !== undefined) { + localVarHeaders = localVarHeaders.set( + 'Accept', + localVarHttpHeaderAcceptSelected, + ); + } + + const localVarHttpContext: HttpContext = + options?.context ?? new HttpContext(); + + const localVarTransferCache: boolean = options?.transferCache ?? true; + + let responseType_: 'text' | 'json' | 'blob' = 'json'; + if (localVarHttpHeaderAcceptSelected) { + if (localVarHttpHeaderAcceptSelected.startsWith('text')) { + responseType_ = 'text'; + } else if ( + this.configuration.isJsonMime(localVarHttpHeaderAcceptSelected) + ) { + responseType_ = 'json'; + } else { + responseType_ = 'blob'; + } + } + + let localVarPath = `/api/inse-service/persons/searchByInstitution`; + const { basePath, withCredentials } = this.configuration; + return this.httpClient.request( + 'get', + `${basePath}${localVarPath}`, + { + context: localVarHttpContext, + params: localVarQueryParameters, + responseType: responseType_, + ...(withCredentials ? { withCredentials } : {}), + headers: localVarHeaders, + observe: observe, + ...(localVarTransferCache !== undefined + ? { transferCache: localVarTransferCache } + : {}), + reportProgress: reportProgress, + }, + ); + } + + /** + * Searches for person by name. + * @endpoint get /api/inse-service/persons/searchByName + * @param authorName Authors name (e.g., Arman Arzani) + * @param include Which data do we require? include tags: topics_full, topic_share, summary_stats, ids, last_known_institutions, ... + * @param limit Limit of search page results + * @param pageOffset Offset of the result page + * @param observe set whether or not to return the data Observable as the body, response or events. defaults to returning the body. + * @param reportProgress flag to report request and response progress. + */ + public searchPersonsByName( + authorName: string, + include: string, + limit?: number, + pageOffset?: number, + observe?: 'body', + reportProgress?: boolean, + options?: { + httpHeaderAccept?: 'application/json'; + context?: HttpContext; + transferCache?: boolean; + }, + ): Observable; + public searchPersonsByName( + authorName: string, + include: string, + limit?: number, + pageOffset?: number, + observe?: 'response', + reportProgress?: boolean, + options?: { + httpHeaderAccept?: 'application/json'; + context?: HttpContext; + transferCache?: boolean; + }, + ): Observable>; + public searchPersonsByName( + authorName: string, + include: string, + limit?: number, + pageOffset?: number, + observe?: 'events', + reportProgress?: boolean, + options?: { + httpHeaderAccept?: 'application/json'; + context?: HttpContext; + transferCache?: boolean; + }, + ): Observable>; + public searchPersonsByName( + authorName: string, + include: string, + limit?: number, + pageOffset?: number, + observe: any = 'body', + reportProgress: boolean = false, + options?: { + httpHeaderAccept?: 'application/json'; + context?: HttpContext; + transferCache?: boolean; + }, + ): Observable { + if (authorName === null || authorName === undefined) { + throw new Error( + 'Required parameter authorName was null or undefined when calling searchPersonsByName.', + ); + } + if (include === null || include === undefined) { + throw new Error( + 'Required parameter include was null or undefined when calling searchPersonsByName.', + ); + } + + let localVarQueryParameters = new HttpParams({ encoder: this.encoder }); + localVarQueryParameters = this.addToHttpParams( + localVarQueryParameters, + authorName, + 'author_name', + ); + localVarQueryParameters = this.addToHttpParams( + localVarQueryParameters, + include, + 'include', + ); + localVarQueryParameters = this.addToHttpParams( + localVarQueryParameters, + limit, + 'limit', + ); + localVarQueryParameters = this.addToHttpParams( + localVarQueryParameters, + pageOffset, + 'page_offset', + ); + + let localVarHeaders = this.defaultHeaders; + + const localVarHttpHeaderAcceptSelected: string | undefined = + options?.httpHeaderAccept ?? + this.configuration.selectHeaderAccept(['application/json']); + if (localVarHttpHeaderAcceptSelected !== undefined) { + localVarHeaders = localVarHeaders.set( + 'Accept', + localVarHttpHeaderAcceptSelected, + ); + } + + const localVarHttpContext: HttpContext = + options?.context ?? new HttpContext(); + + const localVarTransferCache: boolean = options?.transferCache ?? true; + + let responseType_: 'text' | 'json' | 'blob' = 'json'; + if (localVarHttpHeaderAcceptSelected) { + if (localVarHttpHeaderAcceptSelected.startsWith('text')) { + responseType_ = 'text'; + } else if ( + this.configuration.isJsonMime(localVarHttpHeaderAcceptSelected) + ) { + responseType_ = 'json'; + } else { + responseType_ = 'blob'; + } + } + + let localVarPath = `/api/inse-service/persons/searchByName`; + const { basePath, withCredentials } = this.configuration; + return this.httpClient.request( + 'get', + `${basePath}${localVarPath}`, + { + context: localVarHttpContext, + params: localVarQueryParameters, + responseType: responseType_, + ...(withCredentials ? { withCredentials } : {}), + headers: localVarHeaders, + observe: observe, + ...(localVarTransferCache !== undefined + ? { transferCache: localVarTransferCache } + : {}), + reportProgress: reportProgress, + }, + ); + } + + /** + * Searches for person by name. + * @endpoint get /api/inse-service/persons/searchByName + * @param authorName Authors name (e.g., Arman Arzani) + * @param include Which data do we require? include tags: topics_full, topic_share, summary_stats, ids, last_known_institutions, ... + * @param limit Limit of search page results + * @param pageOffset Offset of the result page + * @param observe set whether or not to return the data Observable as the body, response or events. defaults to returning the body. + * @param reportProgress flag to report request and response progress. + */ + public searchPersonsByName_4( + authorName: string, + include: string, + limit?: number, + pageOffset?: number, + observe?: 'body', + reportProgress?: boolean, + options?: { + httpHeaderAccept?: 'application/json'; + context?: HttpContext; + transferCache?: boolean; + }, + ): Observable; + public searchPersonsByName_4( + authorName: string, + include: string, + limit?: number, + pageOffset?: number, + observe?: 'response', + reportProgress?: boolean, + options?: { + httpHeaderAccept?: 'application/json'; + context?: HttpContext; + transferCache?: boolean; + }, + ): Observable>; + public searchPersonsByName_4( + authorName: string, + include: string, + limit?: number, + pageOffset?: number, + observe?: 'events', + reportProgress?: boolean, + options?: { + httpHeaderAccept?: 'application/json'; + context?: HttpContext; + transferCache?: boolean; + }, + ): Observable>; + public searchPersonsByName_4( + authorName: string, + include: string, + limit?: number, + pageOffset?: number, + observe: any = 'body', + reportProgress: boolean = false, + options?: { + httpHeaderAccept?: 'application/json'; + context?: HttpContext; + transferCache?: boolean; + }, + ): Observable { + if (authorName === null || authorName === undefined) { + throw new Error( + 'Required parameter authorName was null or undefined when calling searchPersonsByName_4.', + ); + } + if (include === null || include === undefined) { + throw new Error( + 'Required parameter include was null or undefined when calling searchPersonsByName_4.', + ); + } + + let localVarQueryParameters = new HttpParams({ encoder: this.encoder }); + localVarQueryParameters = this.addToHttpParams( + localVarQueryParameters, + authorName, + 'author_name', + ); + localVarQueryParameters = this.addToHttpParams( + localVarQueryParameters, + include, + 'include', + ); + localVarQueryParameters = this.addToHttpParams( + localVarQueryParameters, + limit, + 'limit', + ); + localVarQueryParameters = this.addToHttpParams( + localVarQueryParameters, + pageOffset, + 'page_offset', + ); + + let localVarHeaders = this.defaultHeaders; + + const localVarHttpHeaderAcceptSelected: string | undefined = + options?.httpHeaderAccept ?? + this.configuration.selectHeaderAccept(['application/json']); + if (localVarHttpHeaderAcceptSelected !== undefined) { + localVarHeaders = localVarHeaders.set( + 'Accept', + localVarHttpHeaderAcceptSelected, + ); + } + + const localVarHttpContext: HttpContext = + options?.context ?? new HttpContext(); + + const localVarTransferCache: boolean = options?.transferCache ?? true; + + let responseType_: 'text' | 'json' | 'blob' = 'json'; + if (localVarHttpHeaderAcceptSelected) { + if (localVarHttpHeaderAcceptSelected.startsWith('text')) { + responseType_ = 'text'; + } else if ( + this.configuration.isJsonMime(localVarHttpHeaderAcceptSelected) + ) { + responseType_ = 'json'; + } else { + responseType_ = 'blob'; + } + } + + let localVarPath = `/api/inse-service/persons/searchByName`; + const { basePath, withCredentials } = this.configuration; + return this.httpClient.request( + 'get', + `${basePath}${localVarPath}`, + { + context: localVarHttpContext, + params: localVarQueryParameters, + responseType: responseType_, + ...(withCredentials ? { withCredentials } : {}), + headers: localVarHeaders, + observe: observe, + ...(localVarTransferCache !== undefined + ? { transferCache: localVarTransferCache } + : {}), + reportProgress: reportProgress, + }, + ); + } + + /** + * Searches for persons with advanced filters (Topic & Institution) and pagination. + * @endpoint get /api/inse-service/persons/search-list + * @param query Search query (e.g., Arman AND Arzani) + * @param institutionName Filter by institution name + * @param sortBy Value to sort by + * @param sortOrder asc or desc? + * @param topic Filter by topic display names + * @param page Page number (1-indexed) + * @param pageSize Results per page + * @param include Comma-separated include tags + * @param strict Strict institution search by target year + * @param filterMode Filter mode: \'in\' or \'from\' + * @param filterYear Filter year + * @param observe set whether or not to return the data Observable as the body, response or events. defaults to returning the body. + * @param reportProgress flag to report request and response progress. + */ + public searchPersonsList( + query?: string, + institutionName?: string, + sortBy?: string, + sortOrder?: string, + topic?: Array, + page?: number, + pageSize?: number, + include?: string, + strict?: boolean, + filterMode?: string, + filterYear?: number, + observe?: 'body', + reportProgress?: boolean, + options?: { + httpHeaderAccept?: 'application/json'; + context?: HttpContext; + transferCache?: boolean; + }, + ): Observable; + public searchPersonsList( + query?: string, + institutionName?: string, + sortBy?: string, + sortOrder?: string, + topic?: Array, + page?: number, + pageSize?: number, + include?: string, + strict?: boolean, + filterMode?: string, + filterYear?: number, + observe?: 'response', + reportProgress?: boolean, + options?: { + httpHeaderAccept?: 'application/json'; + context?: HttpContext; + transferCache?: boolean; + }, + ): Observable>; + public searchPersonsList( + query?: string, + institutionName?: string, + sortBy?: string, + sortOrder?: string, + topic?: Array, + page?: number, + pageSize?: number, + include?: string, + strict?: boolean, + filterMode?: string, + filterYear?: number, + observe?: 'events', + reportProgress?: boolean, + options?: { + httpHeaderAccept?: 'application/json'; + context?: HttpContext; + transferCache?: boolean; + }, + ): Observable>; + public searchPersonsList( + query?: string, + institutionName?: string, + sortBy?: string, + sortOrder?: string, + topic?: Array, + page?: number, + pageSize?: number, + include?: string, + strict?: boolean, + filterMode?: string, + filterYear?: number, + observe: any = 'body', + reportProgress: boolean = false, + options?: { + httpHeaderAccept?: 'application/json'; + context?: HttpContext; + transferCache?: boolean; + }, + ): Observable { + let localVarQueryParameters = new HttpParams({ encoder: this.encoder }); + localVarQueryParameters = this.addToHttpParams( + localVarQueryParameters, + query, + 'query', + ); + localVarQueryParameters = this.addToHttpParams( + localVarQueryParameters, + institutionName, + 'institutionName', + ); + localVarQueryParameters = this.addToHttpParams( + localVarQueryParameters, + sortBy, + 'sortBy', + ); + localVarQueryParameters = this.addToHttpParams( + localVarQueryParameters, + sortOrder, + 'sortOrder', + ); + if (topic) { + topic.forEach((element) => { + localVarQueryParameters = this.addToHttpParams( + localVarQueryParameters, + element, + 'topic', ); + }); + } + localVarQueryParameters = this.addToHttpParams( + localVarQueryParameters, + page, + 'page', + ); + localVarQueryParameters = this.addToHttpParams( + localVarQueryParameters, + pageSize, + 'pageSize', + ); + localVarQueryParameters = this.addToHttpParams( + localVarQueryParameters, + include, + 'include', + ); + localVarQueryParameters = this.addToHttpParams( + localVarQueryParameters, + strict, + 'strict', + ); + localVarQueryParameters = this.addToHttpParams( + localVarQueryParameters, + filterMode, + 'filterMode', + ); + localVarQueryParameters = this.addToHttpParams( + localVarQueryParameters, + filterYear, + 'filterYear', + ); + + let localVarHeaders = this.defaultHeaders; + + const localVarHttpHeaderAcceptSelected: string | undefined = + options?.httpHeaderAccept ?? + this.configuration.selectHeaderAccept(['application/json']); + if (localVarHttpHeaderAcceptSelected !== undefined) { + localVarHeaders = localVarHeaders.set( + 'Accept', + localVarHttpHeaderAcceptSelected, + ); } - /** - * Searches for person by ID. - * @endpoint get /api/inse-service/person/{id} - * @param id OpenAlex author ID - * @param include Which data do we require? include tags: topics_full, topic_share, summary_stats, ids, last_known_institutions, ... - * @param observe set whether or not to return the data Observable as the body, response or events. defaults to returning the body. - * @param reportProgress flag to report request and response progress. - */ - public getPersonByID(id: string, include?: string, observe?: 'body', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable; - public getPersonByID(id: string, include?: string, observe?: 'response', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable>; - public getPersonByID(id: string, include?: string, observe?: 'events', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable>; - public getPersonByID(id: string, include?: string, observe: any = 'body', reportProgress: boolean = false, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable { - if (id === null || id === undefined) { - throw new Error('Required parameter id was null or undefined when calling getPersonByID.'); - } + const localVarHttpContext: HttpContext = + options?.context ?? new HttpContext(); - let localVarQueryParameters = new HttpParams({encoder: this.encoder}); - localVarQueryParameters = this.addToHttpParams(localVarQueryParameters, - include, 'include'); + const localVarTransferCache: boolean = options?.transferCache ?? true; - let localVarHeaders = this.defaultHeaders; + let responseType_: 'text' | 'json' | 'blob' = 'json'; + if (localVarHttpHeaderAcceptSelected) { + if (localVarHttpHeaderAcceptSelected.startsWith('text')) { + responseType_ = 'text'; + } else if ( + this.configuration.isJsonMime(localVarHttpHeaderAcceptSelected) + ) { + responseType_ = 'json'; + } else { + responseType_ = 'blob'; + } + } - const localVarHttpHeaderAcceptSelected: string | undefined = options?.httpHeaderAccept ?? this.configuration.selectHeaderAccept([ - 'application/json' - ]); - if (localVarHttpHeaderAcceptSelected !== undefined) { - localVarHeaders = localVarHeaders.set('Accept', localVarHttpHeaderAcceptSelected); - } + let localVarPath = `/api/inse-service/persons/search-list`; + const { basePath, withCredentials } = this.configuration; + return this.httpClient.request( + 'get', + `${basePath}${localVarPath}`, + { + context: localVarHttpContext, + params: localVarQueryParameters, + responseType: responseType_, + ...(withCredentials ? { withCredentials } : {}), + headers: localVarHeaders, + observe: observe, + ...(localVarTransferCache !== undefined + ? { transferCache: localVarTransferCache } + : {}), + reportProgress: reportProgress, + }, + ); + } - const localVarHttpContext: HttpContext = options?.context ?? new HttpContext(); - - const localVarTransferCache: boolean = options?.transferCache ?? true; - - - let responseType_: 'text' | 'json' | 'blob' = 'json'; - if (localVarHttpHeaderAcceptSelected) { - if (localVarHttpHeaderAcceptSelected.startsWith('text')) { - responseType_ = 'text'; - } else if (this.configuration.isJsonMime(localVarHttpHeaderAcceptSelected)) { - responseType_ = 'json'; - } else { - responseType_ = 'blob'; - } - } - - let localVarPath = `/api/inse-service/person/${this.configuration.encodeParam({name: "id", value: id, in: "path", style: "simple", explode: false, dataType: "string", dataFormat: undefined})}`; - const { basePath, withCredentials } = this.configuration; - return this.httpClient.request('get', `${basePath}${localVarPath}`, - { - context: localVarHttpContext, - params: localVarQueryParameters, - responseType: responseType_, - ...(withCredentials ? { withCredentials } : {}), - headers: localVarHeaders, - observe: observe, - ...(localVarTransferCache !== undefined ? { transferCache: localVarTransferCache } : {}), - reportProgress: reportProgress - } + /** + * Searches for persons with advanced filters (Topic & Institution) and pagination. + * @endpoint get /api/inse-service/persons/search-list + * @param query Search query (e.g., Arman AND Arzani) + * @param institutionName Filter by institution name + * @param sortBy Value to sort by + * @param sortOrder asc or desc? + * @param topic Filter by topic display names + * @param page Page number (1-indexed) + * @param pageSize Results per page + * @param include Comma-separated include tags + * @param strict Strict institution search by target year + * @param filterMode Filter mode: \'in\' or \'from\' + * @param filterYear Filter year + * @param observe set whether or not to return the data Observable as the body, response or events. defaults to returning the body. + * @param reportProgress flag to report request and response progress. + */ + public searchPersonsList_5( + query?: string, + institutionName?: string, + sortBy?: string, + sortOrder?: string, + topic?: Array, + page?: number, + pageSize?: number, + include?: string, + strict?: boolean, + filterMode?: string, + filterYear?: number, + observe?: 'body', + reportProgress?: boolean, + options?: { + httpHeaderAccept?: 'application/json'; + context?: HttpContext; + transferCache?: boolean; + }, + ): Observable; + public searchPersonsList_5( + query?: string, + institutionName?: string, + sortBy?: string, + sortOrder?: string, + topic?: Array, + page?: number, + pageSize?: number, + include?: string, + strict?: boolean, + filterMode?: string, + filterYear?: number, + observe?: 'response', + reportProgress?: boolean, + options?: { + httpHeaderAccept?: 'application/json'; + context?: HttpContext; + transferCache?: boolean; + }, + ): Observable>; + public searchPersonsList_5( + query?: string, + institutionName?: string, + sortBy?: string, + sortOrder?: string, + topic?: Array, + page?: number, + pageSize?: number, + include?: string, + strict?: boolean, + filterMode?: string, + filterYear?: number, + observe?: 'events', + reportProgress?: boolean, + options?: { + httpHeaderAccept?: 'application/json'; + context?: HttpContext; + transferCache?: boolean; + }, + ): Observable>; + public searchPersonsList_5( + query?: string, + institutionName?: string, + sortBy?: string, + sortOrder?: string, + topic?: Array, + page?: number, + pageSize?: number, + include?: string, + strict?: boolean, + filterMode?: string, + filterYear?: number, + observe: any = 'body', + reportProgress: boolean = false, + options?: { + httpHeaderAccept?: 'application/json'; + context?: HttpContext; + transferCache?: boolean; + }, + ): Observable { + let localVarQueryParameters = new HttpParams({ encoder: this.encoder }); + localVarQueryParameters = this.addToHttpParams( + localVarQueryParameters, + query, + 'query', + ); + localVarQueryParameters = this.addToHttpParams( + localVarQueryParameters, + institutionName, + 'institutionName', + ); + localVarQueryParameters = this.addToHttpParams( + localVarQueryParameters, + sortBy, + 'sortBy', + ); + localVarQueryParameters = this.addToHttpParams( + localVarQueryParameters, + sortOrder, + 'sortOrder', + ); + if (topic) { + topic.forEach((element) => { + localVarQueryParameters = this.addToHttpParams( + localVarQueryParameters, + element, + 'topic', ); + }); + } + localVarQueryParameters = this.addToHttpParams( + localVarQueryParameters, + page, + 'page', + ); + localVarQueryParameters = this.addToHttpParams( + localVarQueryParameters, + pageSize, + 'pageSize', + ); + localVarQueryParameters = this.addToHttpParams( + localVarQueryParameters, + include, + 'include', + ); + localVarQueryParameters = this.addToHttpParams( + localVarQueryParameters, + strict, + 'strict', + ); + localVarQueryParameters = this.addToHttpParams( + localVarQueryParameters, + filterMode, + 'filterMode', + ); + localVarQueryParameters = this.addToHttpParams( + localVarQueryParameters, + filterYear, + 'filterYear', + ); + + let localVarHeaders = this.defaultHeaders; + + const localVarHttpHeaderAcceptSelected: string | undefined = + options?.httpHeaderAccept ?? + this.configuration.selectHeaderAccept(['application/json']); + if (localVarHttpHeaderAcceptSelected !== undefined) { + localVarHeaders = localVarHeaders.set( + 'Accept', + localVarHttpHeaderAcceptSelected, + ); } - /** - * Searches for person by ID. - * @endpoint get /api/inse-service/person/{id} - * @param id OpenAlex author ID - * @param include Which data do we require? include tags: topics_full, topic_share, summary_stats, ids, last_known_institutions, ... - * @param observe set whether or not to return the data Observable as the body, response or events. defaults to returning the body. - * @param reportProgress flag to report request and response progress. - */ - public getPersonByID_1(id: string, include?: string, observe?: 'body', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable; - public getPersonByID_1(id: string, include?: string, observe?: 'response', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable>; - public getPersonByID_1(id: string, include?: string, observe?: 'events', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable>; - public getPersonByID_1(id: string, include?: string, observe: any = 'body', reportProgress: boolean = false, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable { - if (id === null || id === undefined) { - throw new Error('Required parameter id was null or undefined when calling getPersonByID_1.'); - } + const localVarHttpContext: HttpContext = + options?.context ?? new HttpContext(); - let localVarQueryParameters = new HttpParams({encoder: this.encoder}); - localVarQueryParameters = this.addToHttpParams(localVarQueryParameters, - include, 'include'); + const localVarTransferCache: boolean = options?.transferCache ?? true; - let localVarHeaders = this.defaultHeaders; - - const localVarHttpHeaderAcceptSelected: string | undefined = options?.httpHeaderAccept ?? this.configuration.selectHeaderAccept([ - 'application/json' - ]); - if (localVarHttpHeaderAcceptSelected !== undefined) { - localVarHeaders = localVarHeaders.set('Accept', localVarHttpHeaderAcceptSelected); - } - - const localVarHttpContext: HttpContext = options?.context ?? new HttpContext(); - - const localVarTransferCache: boolean = options?.transferCache ?? true; - - - let responseType_: 'text' | 'json' | 'blob' = 'json'; - if (localVarHttpHeaderAcceptSelected) { - if (localVarHttpHeaderAcceptSelected.startsWith('text')) { - responseType_ = 'text'; - } else if (this.configuration.isJsonMime(localVarHttpHeaderAcceptSelected)) { - responseType_ = 'json'; - } else { - responseType_ = 'blob'; - } - } - - let localVarPath = `/api/inse-service/person/${this.configuration.encodeParam({name: "id", value: id, in: "path", style: "simple", explode: false, dataType: "string", dataFormat: undefined})}`; - const { basePath, withCredentials } = this.configuration; - return this.httpClient.request('get', `${basePath}${localVarPath}`, - { - context: localVarHttpContext, - params: localVarQueryParameters, - responseType: responseType_, - ...(withCredentials ? { withCredentials } : {}), - headers: localVarHeaders, - observe: observe, - ...(localVarTransferCache !== undefined ? { transferCache: localVarTransferCache } : {}), - reportProgress: reportProgress - } - ); - } - - /** - * Searches for persons by ID or name. - * @endpoint get /api/inse-service/persons/search - * @param authorId OpenAlex author ID (e.g., A5093075883) - * @param query Search query (e.g., Arman AND Arzani) - * @param include Comma-separated include tags: topics_full, topic_share, summary_stats, ids, last_known_institutions, sources, counts_by_year, works_api_url, dates, cited_by_count_boost - * @param observe set whether or not to return the data Observable as the body, response or events. defaults to returning the body. - * @param reportProgress flag to report request and response progress. - */ - public searchPersons(authorId?: string, query?: string, include?: string, observe?: 'body', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable; - public searchPersons(authorId?: string, query?: string, include?: string, observe?: 'response', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable>; - public searchPersons(authorId?: string, query?: string, include?: string, observe?: 'events', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable>; - public searchPersons(authorId?: string, query?: string, include?: string, observe: any = 'body', reportProgress: boolean = false, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable { - - let localVarQueryParameters = new HttpParams({encoder: this.encoder}); - localVarQueryParameters = this.addToHttpParams(localVarQueryParameters, - authorId, 'author_id'); - localVarQueryParameters = this.addToHttpParams(localVarQueryParameters, - query, 'query'); - localVarQueryParameters = this.addToHttpParams(localVarQueryParameters, - include, 'include'); - - let localVarHeaders = this.defaultHeaders; - - const localVarHttpHeaderAcceptSelected: string | undefined = options?.httpHeaderAccept ?? this.configuration.selectHeaderAccept([ - 'application/json' - ]); - if (localVarHttpHeaderAcceptSelected !== undefined) { - localVarHeaders = localVarHeaders.set('Accept', localVarHttpHeaderAcceptSelected); - } - - const localVarHttpContext: HttpContext = options?.context ?? new HttpContext(); - - const localVarTransferCache: boolean = options?.transferCache ?? true; - - - let responseType_: 'text' | 'json' | 'blob' = 'json'; - if (localVarHttpHeaderAcceptSelected) { - if (localVarHttpHeaderAcceptSelected.startsWith('text')) { - responseType_ = 'text'; - } else if (this.configuration.isJsonMime(localVarHttpHeaderAcceptSelected)) { - responseType_ = 'json'; - } else { - responseType_ = 'blob'; - } - } - - let localVarPath = `/api/inse-service/persons/search`; - const { basePath, withCredentials } = this.configuration; - return this.httpClient.request('get', `${basePath}${localVarPath}`, - { - context: localVarHttpContext, - params: localVarQueryParameters, - responseType: responseType_, - ...(withCredentials ? { withCredentials } : {}), - headers: localVarHeaders, - observe: observe, - ...(localVarTransferCache !== undefined ? { transferCache: localVarTransferCache } : {}), - reportProgress: reportProgress - } - ); - } - - /** - * Searches for person by name. - * @endpoint get /api/inse-service/persons/autocomplete - * @param authorName Authors name (e.g., Arman Arzani) - * @param include Which data do we require? include tags: topics_full, topic_share, summary_stats, ids, last_known_institutions, ... - * @param observe set whether or not to return the data Observable as the body, response or events. defaults to returning the body. - * @param reportProgress flag to report request and response progress. - */ - public searchPersonsAutocomplete(authorName: string, include: string, observe?: 'body', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable; - public searchPersonsAutocomplete(authorName: string, include: string, observe?: 'response', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable>; - public searchPersonsAutocomplete(authorName: string, include: string, observe?: 'events', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable>; - public searchPersonsAutocomplete(authorName: string, include: string, observe: any = 'body', reportProgress: boolean = false, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable { - if (authorName === null || authorName === undefined) { - throw new Error('Required parameter authorName was null or undefined when calling searchPersonsAutocomplete.'); - } - if (include === null || include === undefined) { - throw new Error('Required parameter include was null or undefined when calling searchPersonsAutocomplete.'); - } - - let localVarQueryParameters = new HttpParams({encoder: this.encoder}); - localVarQueryParameters = this.addToHttpParams(localVarQueryParameters, - authorName, 'author_name'); - localVarQueryParameters = this.addToHttpParams(localVarQueryParameters, - include, 'include'); - - let localVarHeaders = this.defaultHeaders; - - const localVarHttpHeaderAcceptSelected: string | undefined = options?.httpHeaderAccept ?? this.configuration.selectHeaderAccept([ - 'application/json' - ]); - if (localVarHttpHeaderAcceptSelected !== undefined) { - localVarHeaders = localVarHeaders.set('Accept', localVarHttpHeaderAcceptSelected); - } - - const localVarHttpContext: HttpContext = options?.context ?? new HttpContext(); - - const localVarTransferCache: boolean = options?.transferCache ?? true; - - - let responseType_: 'text' | 'json' | 'blob' = 'json'; - if (localVarHttpHeaderAcceptSelected) { - if (localVarHttpHeaderAcceptSelected.startsWith('text')) { - responseType_ = 'text'; - } else if (this.configuration.isJsonMime(localVarHttpHeaderAcceptSelected)) { - responseType_ = 'json'; - } else { - responseType_ = 'blob'; - } - } - - let localVarPath = `/api/inse-service/persons/autocomplete`; - const { basePath, withCredentials } = this.configuration; - return this.httpClient.request('get', `${basePath}${localVarPath}`, - { - context: localVarHttpContext, - params: localVarQueryParameters, - responseType: responseType_, - ...(withCredentials ? { withCredentials } : {}), - headers: localVarHeaders, - observe: observe, - ...(localVarTransferCache !== undefined ? { transferCache: localVarTransferCache } : {}), - reportProgress: reportProgress - } - ); - } - - /** - * Searches for person by name. - * @endpoint get /api/inse-service/persons/autocomplete - * @param authorName Authors name (e.g., Arman Arzani) - * @param include Which data do we require? include tags: topics_full, topic_share, summary_stats, ids, last_known_institutions, ... - * @param observe set whether or not to return the data Observable as the body, response or events. defaults to returning the body. - * @param reportProgress flag to report request and response progress. - */ - public searchPersonsAutocomplete_2(authorName: string, include: string, observe?: 'body', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable; - public searchPersonsAutocomplete_2(authorName: string, include: string, observe?: 'response', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable>; - public searchPersonsAutocomplete_2(authorName: string, include: string, observe?: 'events', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable>; - public searchPersonsAutocomplete_2(authorName: string, include: string, observe: any = 'body', reportProgress: boolean = false, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable { - if (authorName === null || authorName === undefined) { - throw new Error('Required parameter authorName was null or undefined when calling searchPersonsAutocomplete_2.'); - } - if (include === null || include === undefined) { - throw new Error('Required parameter include was null or undefined when calling searchPersonsAutocomplete_2.'); - } - - let localVarQueryParameters = new HttpParams({encoder: this.encoder}); - localVarQueryParameters = this.addToHttpParams(localVarQueryParameters, - authorName, 'author_name'); - localVarQueryParameters = this.addToHttpParams(localVarQueryParameters, - include, 'include'); - - let localVarHeaders = this.defaultHeaders; - - const localVarHttpHeaderAcceptSelected: string | undefined = options?.httpHeaderAccept ?? this.configuration.selectHeaderAccept([ - 'application/json' - ]); - if (localVarHttpHeaderAcceptSelected !== undefined) { - localVarHeaders = localVarHeaders.set('Accept', localVarHttpHeaderAcceptSelected); - } - - const localVarHttpContext: HttpContext = options?.context ?? new HttpContext(); - - const localVarTransferCache: boolean = options?.transferCache ?? true; - - - let responseType_: 'text' | 'json' | 'blob' = 'json'; - if (localVarHttpHeaderAcceptSelected) { - if (localVarHttpHeaderAcceptSelected.startsWith('text')) { - responseType_ = 'text'; - } else if (this.configuration.isJsonMime(localVarHttpHeaderAcceptSelected)) { - responseType_ = 'json'; - } else { - responseType_ = 'blob'; - } - } - - let localVarPath = `/api/inse-service/persons/autocomplete`; - const { basePath, withCredentials } = this.configuration; - return this.httpClient.request('get', `${basePath}${localVarPath}`, - { - context: localVarHttpContext, - params: localVarQueryParameters, - responseType: responseType_, - ...(withCredentials ? { withCredentials } : {}), - headers: localVarHeaders, - observe: observe, - ...(localVarTransferCache !== undefined ? { transferCache: localVarTransferCache } : {}), - reportProgress: reportProgress - } - ); - } - - /** - * Searches for persons by institution name. - * @endpoint get /api/inse-service/persons/searchByInstitution - * @param institutionName Institution name (e.g., MIT, Oxford University) - * @param include Which data do we require? include tags: topics_full, topic_share, summary_stats, ids, last_known_institutions, ... - * @param limit Limit of search page results - * @param pageOffset Offset of the result page - * @param observe set whether or not to return the data Observable as the body, response or events. defaults to returning the body. - * @param reportProgress flag to report request and response progress. - */ - public searchPersonsByInstitution(institutionName: string, include: string, limit?: number, pageOffset?: number, observe?: 'body', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable; - public searchPersonsByInstitution(institutionName: string, include: string, limit?: number, pageOffset?: number, observe?: 'response', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable>; - public searchPersonsByInstitution(institutionName: string, include: string, limit?: number, pageOffset?: number, observe?: 'events', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable>; - public searchPersonsByInstitution(institutionName: string, include: string, limit?: number, pageOffset?: number, observe: any = 'body', reportProgress: boolean = false, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable { - if (institutionName === null || institutionName === undefined) { - throw new Error('Required parameter institutionName was null or undefined when calling searchPersonsByInstitution.'); - } - if (include === null || include === undefined) { - throw new Error('Required parameter include was null or undefined when calling searchPersonsByInstitution.'); - } - - let localVarQueryParameters = new HttpParams({encoder: this.encoder}); - localVarQueryParameters = this.addToHttpParams(localVarQueryParameters, - institutionName, 'institution_name'); - localVarQueryParameters = this.addToHttpParams(localVarQueryParameters, - include, 'include'); - localVarQueryParameters = this.addToHttpParams(localVarQueryParameters, - limit, 'limit'); - localVarQueryParameters = this.addToHttpParams(localVarQueryParameters, - pageOffset, 'page_offset'); - - let localVarHeaders = this.defaultHeaders; - - const localVarHttpHeaderAcceptSelected: string | undefined = options?.httpHeaderAccept ?? this.configuration.selectHeaderAccept([ - 'application/json' - ]); - if (localVarHttpHeaderAcceptSelected !== undefined) { - localVarHeaders = localVarHeaders.set('Accept', localVarHttpHeaderAcceptSelected); - } - - const localVarHttpContext: HttpContext = options?.context ?? new HttpContext(); - - const localVarTransferCache: boolean = options?.transferCache ?? true; - - - let responseType_: 'text' | 'json' | 'blob' = 'json'; - if (localVarHttpHeaderAcceptSelected) { - if (localVarHttpHeaderAcceptSelected.startsWith('text')) { - responseType_ = 'text'; - } else if (this.configuration.isJsonMime(localVarHttpHeaderAcceptSelected)) { - responseType_ = 'json'; - } else { - responseType_ = 'blob'; - } - } - - let localVarPath = `/api/inse-service/persons/searchByInstitution`; - const { basePath, withCredentials } = this.configuration; - return this.httpClient.request('get', `${basePath}${localVarPath}`, - { - context: localVarHttpContext, - params: localVarQueryParameters, - responseType: responseType_, - ...(withCredentials ? { withCredentials } : {}), - headers: localVarHeaders, - observe: observe, - ...(localVarTransferCache !== undefined ? { transferCache: localVarTransferCache } : {}), - reportProgress: reportProgress - } - ); - } - - /** - * Searches for persons by institution name. - * @endpoint get /api/inse-service/persons/searchByInstitution - * @param institutionName Institution name (e.g., MIT, Oxford University) - * @param include Which data do we require? include tags: topics_full, topic_share, summary_stats, ids, last_known_institutions, ... - * @param limit Limit of search page results - * @param pageOffset Offset of the result page - * @param observe set whether or not to return the data Observable as the body, response or events. defaults to returning the body. - * @param reportProgress flag to report request and response progress. - */ - public searchPersonsByInstitution_3(institutionName: string, include: string, limit?: number, pageOffset?: number, observe?: 'body', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable; - public searchPersonsByInstitution_3(institutionName: string, include: string, limit?: number, pageOffset?: number, observe?: 'response', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable>; - public searchPersonsByInstitution_3(institutionName: string, include: string, limit?: number, pageOffset?: number, observe?: 'events', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable>; - public searchPersonsByInstitution_3(institutionName: string, include: string, limit?: number, pageOffset?: number, observe: any = 'body', reportProgress: boolean = false, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable { - if (institutionName === null || institutionName === undefined) { - throw new Error('Required parameter institutionName was null or undefined when calling searchPersonsByInstitution_3.'); - } - if (include === null || include === undefined) { - throw new Error('Required parameter include was null or undefined when calling searchPersonsByInstitution_3.'); - } - - let localVarQueryParameters = new HttpParams({encoder: this.encoder}); - localVarQueryParameters = this.addToHttpParams(localVarQueryParameters, - institutionName, 'institution_name'); - localVarQueryParameters = this.addToHttpParams(localVarQueryParameters, - include, 'include'); - localVarQueryParameters = this.addToHttpParams(localVarQueryParameters, - limit, 'limit'); - localVarQueryParameters = this.addToHttpParams(localVarQueryParameters, - pageOffset, 'page_offset'); - - let localVarHeaders = this.defaultHeaders; - - const localVarHttpHeaderAcceptSelected: string | undefined = options?.httpHeaderAccept ?? this.configuration.selectHeaderAccept([ - 'application/json' - ]); - if (localVarHttpHeaderAcceptSelected !== undefined) { - localVarHeaders = localVarHeaders.set('Accept', localVarHttpHeaderAcceptSelected); - } - - const localVarHttpContext: HttpContext = options?.context ?? new HttpContext(); - - const localVarTransferCache: boolean = options?.transferCache ?? true; - - - let responseType_: 'text' | 'json' | 'blob' = 'json'; - if (localVarHttpHeaderAcceptSelected) { - if (localVarHttpHeaderAcceptSelected.startsWith('text')) { - responseType_ = 'text'; - } else if (this.configuration.isJsonMime(localVarHttpHeaderAcceptSelected)) { - responseType_ = 'json'; - } else { - responseType_ = 'blob'; - } - } - - let localVarPath = `/api/inse-service/persons/searchByInstitution`; - const { basePath, withCredentials } = this.configuration; - return this.httpClient.request('get', `${basePath}${localVarPath}`, - { - context: localVarHttpContext, - params: localVarQueryParameters, - responseType: responseType_, - ...(withCredentials ? { withCredentials } : {}), - headers: localVarHeaders, - observe: observe, - ...(localVarTransferCache !== undefined ? { transferCache: localVarTransferCache } : {}), - reportProgress: reportProgress - } - ); - } - - /** - * Searches for person by name. - * @endpoint get /api/inse-service/persons/searchByName - * @param authorName Authors name (e.g., Arman Arzani) - * @param include Which data do we require? include tags: topics_full, topic_share, summary_stats, ids, last_known_institutions, ... - * @param limit Limit of search page results - * @param pageOffset Offset of the result page - * @param observe set whether or not to return the data Observable as the body, response or events. defaults to returning the body. - * @param reportProgress flag to report request and response progress. - */ - public searchPersonsByName(authorName: string, include: string, limit?: number, pageOffset?: number, observe?: 'body', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable; - public searchPersonsByName(authorName: string, include: string, limit?: number, pageOffset?: number, observe?: 'response', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable>; - public searchPersonsByName(authorName: string, include: string, limit?: number, pageOffset?: number, observe?: 'events', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable>; - public searchPersonsByName(authorName: string, include: string, limit?: number, pageOffset?: number, observe: any = 'body', reportProgress: boolean = false, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable { - if (authorName === null || authorName === undefined) { - throw new Error('Required parameter authorName was null or undefined when calling searchPersonsByName.'); - } - if (include === null || include === undefined) { - throw new Error('Required parameter include was null or undefined when calling searchPersonsByName.'); - } - - let localVarQueryParameters = new HttpParams({encoder: this.encoder}); - localVarQueryParameters = this.addToHttpParams(localVarQueryParameters, - authorName, 'author_name'); - localVarQueryParameters = this.addToHttpParams(localVarQueryParameters, - include, 'include'); - localVarQueryParameters = this.addToHttpParams(localVarQueryParameters, - limit, 'limit'); - localVarQueryParameters = this.addToHttpParams(localVarQueryParameters, - pageOffset, 'page_offset'); - - let localVarHeaders = this.defaultHeaders; - - const localVarHttpHeaderAcceptSelected: string | undefined = options?.httpHeaderAccept ?? this.configuration.selectHeaderAccept([ - 'application/json' - ]); - if (localVarHttpHeaderAcceptSelected !== undefined) { - localVarHeaders = localVarHeaders.set('Accept', localVarHttpHeaderAcceptSelected); - } - - const localVarHttpContext: HttpContext = options?.context ?? new HttpContext(); - - const localVarTransferCache: boolean = options?.transferCache ?? true; - - - let responseType_: 'text' | 'json' | 'blob' = 'json'; - if (localVarHttpHeaderAcceptSelected) { - if (localVarHttpHeaderAcceptSelected.startsWith('text')) { - responseType_ = 'text'; - } else if (this.configuration.isJsonMime(localVarHttpHeaderAcceptSelected)) { - responseType_ = 'json'; - } else { - responseType_ = 'blob'; - } - } - - let localVarPath = `/api/inse-service/persons/searchByName`; - const { basePath, withCredentials } = this.configuration; - return this.httpClient.request('get', `${basePath}${localVarPath}`, - { - context: localVarHttpContext, - params: localVarQueryParameters, - responseType: responseType_, - ...(withCredentials ? { withCredentials } : {}), - headers: localVarHeaders, - observe: observe, - ...(localVarTransferCache !== undefined ? { transferCache: localVarTransferCache } : {}), - reportProgress: reportProgress - } - ); - } - - /** - * Searches for person by name. - * @endpoint get /api/inse-service/persons/searchByName - * @param authorName Authors name (e.g., Arman Arzani) - * @param include Which data do we require? include tags: topics_full, topic_share, summary_stats, ids, last_known_institutions, ... - * @param limit Limit of search page results - * @param pageOffset Offset of the result page - * @param observe set whether or not to return the data Observable as the body, response or events. defaults to returning the body. - * @param reportProgress flag to report request and response progress. - */ - public searchPersonsByName_4(authorName: string, include: string, limit?: number, pageOffset?: number, observe?: 'body', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable; - public searchPersonsByName_4(authorName: string, include: string, limit?: number, pageOffset?: number, observe?: 'response', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable>; - public searchPersonsByName_4(authorName: string, include: string, limit?: number, pageOffset?: number, observe?: 'events', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable>; - public searchPersonsByName_4(authorName: string, include: string, limit?: number, pageOffset?: number, observe: any = 'body', reportProgress: boolean = false, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable { - if (authorName === null || authorName === undefined) { - throw new Error('Required parameter authorName was null or undefined when calling searchPersonsByName_4.'); - } - if (include === null || include === undefined) { - throw new Error('Required parameter include was null or undefined when calling searchPersonsByName_4.'); - } - - let localVarQueryParameters = new HttpParams({encoder: this.encoder}); - localVarQueryParameters = this.addToHttpParams(localVarQueryParameters, - authorName, 'author_name'); - localVarQueryParameters = this.addToHttpParams(localVarQueryParameters, - include, 'include'); - localVarQueryParameters = this.addToHttpParams(localVarQueryParameters, - limit, 'limit'); - localVarQueryParameters = this.addToHttpParams(localVarQueryParameters, - pageOffset, 'page_offset'); - - let localVarHeaders = this.defaultHeaders; - - const localVarHttpHeaderAcceptSelected: string | undefined = options?.httpHeaderAccept ?? this.configuration.selectHeaderAccept([ - 'application/json' - ]); - if (localVarHttpHeaderAcceptSelected !== undefined) { - localVarHeaders = localVarHeaders.set('Accept', localVarHttpHeaderAcceptSelected); - } - - const localVarHttpContext: HttpContext = options?.context ?? new HttpContext(); - - const localVarTransferCache: boolean = options?.transferCache ?? true; - - - let responseType_: 'text' | 'json' | 'blob' = 'json'; - if (localVarHttpHeaderAcceptSelected) { - if (localVarHttpHeaderAcceptSelected.startsWith('text')) { - responseType_ = 'text'; - } else if (this.configuration.isJsonMime(localVarHttpHeaderAcceptSelected)) { - responseType_ = 'json'; - } else { - responseType_ = 'blob'; - } - } - - let localVarPath = `/api/inse-service/persons/searchByName`; - const { basePath, withCredentials } = this.configuration; - return this.httpClient.request('get', `${basePath}${localVarPath}`, - { - context: localVarHttpContext, - params: localVarQueryParameters, - responseType: responseType_, - ...(withCredentials ? { withCredentials } : {}), - headers: localVarHeaders, - observe: observe, - ...(localVarTransferCache !== undefined ? { transferCache: localVarTransferCache } : {}), - reportProgress: reportProgress - } - ); - } - - /** - * Searches for persons with advanced filters (Topic & Institution) and pagination. - * @endpoint get /api/inse-service/persons/search-list - * @param query Search query (e.g., Arman AND Arzani) - * @param institutionName Filter by institution name - * @param sortBy Value to sort by - * @param sortOrder asc or desc? - * @param topic Filter by topic display names - * @param page Page number (1-indexed) - * @param pageSize Results per page - * @param include Comma-separated include tags - * @param strict Strict institution search by target year - * @param filterMode Filter mode: \'in\' or \'from\' - * @param filterYear Filter year - * @param observe set whether or not to return the data Observable as the body, response or events. defaults to returning the body. - * @param reportProgress flag to report request and response progress. - */ - public searchPersonsList(query?: string, institutionName?: string, sortBy?: string, sortOrder?: string, topic?: Array, page?: number, pageSize?: number, include?: string, strict?: boolean, filterMode?: string, filterYear?: number, observe?: 'body', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable; - public searchPersonsList(query?: string, institutionName?: string, sortBy?: string, sortOrder?: string, topic?: Array, page?: number, pageSize?: number, include?: string, strict?: boolean, filterMode?: string, filterYear?: number, observe?: 'response', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable>; - public searchPersonsList(query?: string, institutionName?: string, sortBy?: string, sortOrder?: string, topic?: Array, page?: number, pageSize?: number, include?: string, strict?: boolean, filterMode?: string, filterYear?: number, observe?: 'events', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable>; - public searchPersonsList(query?: string, institutionName?: string, sortBy?: string, sortOrder?: string, topic?: Array, page?: number, pageSize?: number, include?: string, strict?: boolean, filterMode?: string, filterYear?: number, observe: any = 'body', reportProgress: boolean = false, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable { - - let localVarQueryParameters = new HttpParams({encoder: this.encoder}); - localVarQueryParameters = this.addToHttpParams(localVarQueryParameters, - query, 'query'); - localVarQueryParameters = this.addToHttpParams(localVarQueryParameters, - institutionName, 'institutionName'); - localVarQueryParameters = this.addToHttpParams(localVarQueryParameters, - sortBy, 'sortBy'); - localVarQueryParameters = this.addToHttpParams(localVarQueryParameters, - sortOrder, 'sortOrder'); - if (topic) { - topic.forEach((element) => { - localVarQueryParameters = this.addToHttpParams(localVarQueryParameters, - element, 'topic'); - }) - } - localVarQueryParameters = this.addToHttpParams(localVarQueryParameters, - page, 'page'); - localVarQueryParameters = this.addToHttpParams(localVarQueryParameters, - pageSize, 'pageSize'); - localVarQueryParameters = this.addToHttpParams(localVarQueryParameters, - include, 'include'); - localVarQueryParameters = this.addToHttpParams(localVarQueryParameters, - strict, 'strict'); - localVarQueryParameters = this.addToHttpParams(localVarQueryParameters, - filterMode, 'filterMode'); - localVarQueryParameters = this.addToHttpParams(localVarQueryParameters, - filterYear, 'filterYear'); - - let localVarHeaders = this.defaultHeaders; - - const localVarHttpHeaderAcceptSelected: string | undefined = options?.httpHeaderAccept ?? this.configuration.selectHeaderAccept([ - 'application/json' - ]); - if (localVarHttpHeaderAcceptSelected !== undefined) { - localVarHeaders = localVarHeaders.set('Accept', localVarHttpHeaderAcceptSelected); - } - - const localVarHttpContext: HttpContext = options?.context ?? new HttpContext(); - - const localVarTransferCache: boolean = options?.transferCache ?? true; - - - let responseType_: 'text' | 'json' | 'blob' = 'json'; - if (localVarHttpHeaderAcceptSelected) { - if (localVarHttpHeaderAcceptSelected.startsWith('text')) { - responseType_ = 'text'; - } else if (this.configuration.isJsonMime(localVarHttpHeaderAcceptSelected)) { - responseType_ = 'json'; - } else { - responseType_ = 'blob'; - } - } - - let localVarPath = `/api/inse-service/persons/search-list`; - const { basePath, withCredentials } = this.configuration; - return this.httpClient.request('get', `${basePath}${localVarPath}`, - { - context: localVarHttpContext, - params: localVarQueryParameters, - responseType: responseType_, - ...(withCredentials ? { withCredentials } : {}), - headers: localVarHeaders, - observe: observe, - ...(localVarTransferCache !== undefined ? { transferCache: localVarTransferCache } : {}), - reportProgress: reportProgress - } - ); - } - - /** - * Searches for persons with advanced filters (Topic & Institution) and pagination. - * @endpoint get /api/inse-service/persons/search-list - * @param query Search query (e.g., Arman AND Arzani) - * @param institutionName Filter by institution name - * @param sortBy Value to sort by - * @param sortOrder asc or desc? - * @param topic Filter by topic display names - * @param page Page number (1-indexed) - * @param pageSize Results per page - * @param include Comma-separated include tags - * @param strict Strict institution search by target year - * @param filterMode Filter mode: \'in\' or \'from\' - * @param filterYear Filter year - * @param observe set whether or not to return the data Observable as the body, response or events. defaults to returning the body. - * @param reportProgress flag to report request and response progress. - */ - public searchPersonsList_5(query?: string, institutionName?: string, sortBy?: string, sortOrder?: string, topic?: Array, page?: number, pageSize?: number, include?: string, strict?: boolean, filterMode?: string, filterYear?: number, observe?: 'body', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable; - public searchPersonsList_5(query?: string, institutionName?: string, sortBy?: string, sortOrder?: string, topic?: Array, page?: number, pageSize?: number, include?: string, strict?: boolean, filterMode?: string, filterYear?: number, observe?: 'response', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable>; - public searchPersonsList_5(query?: string, institutionName?: string, sortBy?: string, sortOrder?: string, topic?: Array, page?: number, pageSize?: number, include?: string, strict?: boolean, filterMode?: string, filterYear?: number, observe?: 'events', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable>; - public searchPersonsList_5(query?: string, institutionName?: string, sortBy?: string, sortOrder?: string, topic?: Array, page?: number, pageSize?: number, include?: string, strict?: boolean, filterMode?: string, filterYear?: number, observe: any = 'body', reportProgress: boolean = false, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable { - - let localVarQueryParameters = new HttpParams({encoder: this.encoder}); - localVarQueryParameters = this.addToHttpParams(localVarQueryParameters, - query, 'query'); - localVarQueryParameters = this.addToHttpParams(localVarQueryParameters, - institutionName, 'institutionName'); - localVarQueryParameters = this.addToHttpParams(localVarQueryParameters, - sortBy, 'sortBy'); - localVarQueryParameters = this.addToHttpParams(localVarQueryParameters, - sortOrder, 'sortOrder'); - if (topic) { - topic.forEach((element) => { - localVarQueryParameters = this.addToHttpParams(localVarQueryParameters, - element, 'topic'); - }) - } - localVarQueryParameters = this.addToHttpParams(localVarQueryParameters, - page, 'page'); - localVarQueryParameters = this.addToHttpParams(localVarQueryParameters, - pageSize, 'pageSize'); - localVarQueryParameters = this.addToHttpParams(localVarQueryParameters, - include, 'include'); - localVarQueryParameters = this.addToHttpParams(localVarQueryParameters, - strict, 'strict'); - localVarQueryParameters = this.addToHttpParams(localVarQueryParameters, - filterMode, 'filterMode'); - localVarQueryParameters = this.addToHttpParams(localVarQueryParameters, - filterYear, 'filterYear'); - - let localVarHeaders = this.defaultHeaders; - - const localVarHttpHeaderAcceptSelected: string | undefined = options?.httpHeaderAccept ?? this.configuration.selectHeaderAccept([ - 'application/json' - ]); - if (localVarHttpHeaderAcceptSelected !== undefined) { - localVarHeaders = localVarHeaders.set('Accept', localVarHttpHeaderAcceptSelected); - } - - const localVarHttpContext: HttpContext = options?.context ?? new HttpContext(); - - const localVarTransferCache: boolean = options?.transferCache ?? true; - - - let responseType_: 'text' | 'json' | 'blob' = 'json'; - if (localVarHttpHeaderAcceptSelected) { - if (localVarHttpHeaderAcceptSelected.startsWith('text')) { - responseType_ = 'text'; - } else if (this.configuration.isJsonMime(localVarHttpHeaderAcceptSelected)) { - responseType_ = 'json'; - } else { - responseType_ = 'blob'; - } - } - - let localVarPath = `/api/inse-service/persons/search-list`; - const { basePath, withCredentials } = this.configuration; - return this.httpClient.request('get', `${basePath}${localVarPath}`, - { - context: localVarHttpContext, - params: localVarQueryParameters, - responseType: responseType_, - ...(withCredentials ? { withCredentials } : {}), - headers: localVarHeaders, - observe: observe, - ...(localVarTransferCache !== undefined ? { transferCache: localVarTransferCache } : {}), - reportProgress: reportProgress - } - ); + let responseType_: 'text' | 'json' | 'blob' = 'json'; + if (localVarHttpHeaderAcceptSelected) { + if (localVarHttpHeaderAcceptSelected.startsWith('text')) { + responseType_ = 'text'; + } else if ( + this.configuration.isJsonMime(localVarHttpHeaderAcceptSelected) + ) { + responseType_ = 'json'; + } else { + responseType_ = 'blob'; + } } + let localVarPath = `/api/inse-service/persons/search-list`; + const { basePath, withCredentials } = this.configuration; + return this.httpClient.request( + 'get', + `${basePath}${localVarPath}`, + { + context: localVarHttpContext, + params: localVarQueryParameters, + responseType: responseType_, + ...(withCredentials ? { withCredentials } : {}), + headers: localVarHeaders, + observe: observe, + ...(localVarTransferCache !== undefined + ? { transferCache: localVarTransferCache } + : {}), + reportProgress: reportProgress, + }, + ); + } } diff --git a/webapp/src/app/api/api/projects.service.ts b/webapp/src/app/api/api/projects.service.ts index 95efc1f2..c69e39c9 100644 --- a/webapp/src/app/api/api/projects.service.ts +++ b/webapp/src/app/api/api/projects.service.ts @@ -1,7 +1,7 @@ /** * Innovation Search Engine API * - * + * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech @@ -9,12 +9,18 @@ */ /* tslint:disable:no-unused-variable member-ordering */ -import { Inject, Injectable, Optional } from '@angular/core'; -import { HttpClient, HttpHeaders, HttpParams, - HttpResponse, HttpEvent, HttpParameterCodec, HttpContext - } from '@angular/common/http'; -import { CustomHttpParameterCodec } from '../encoder'; -import { Observable } from 'rxjs'; +import { Inject, Injectable, Optional } from '@angular/core'; +import { + HttpClient, + HttpHeaders, + HttpParams, + HttpResponse, + HttpEvent, + HttpParameterCodec, + HttpContext, +} from '@angular/common/http'; +import { CustomHttpParameterCodec } from '../encoder'; +import { Observable } from 'rxjs'; // @ts-ignore import { BundProjectDetails } from '../model/bundProjectDetails'; @@ -46,650 +52,1209 @@ import { ProjectsSortBy } from '../model/projectsSortBy'; import { SortDirection } from '../model/sortDirection'; // @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 ProjectsService extends BaseService { + constructor( + protected httpClient: HttpClient, + @Optional() @Inject(BASE_PATH) basePath: string | string[], + @Optional() configuration?: Configuration, + ) { + super(basePath, configuration); + } - constructor(protected httpClient: HttpClient, @Optional() @Inject(BASE_PATH) basePath: string|string[], @Optional() configuration?: Configuration) { - super(basePath, configuration); + /** + * Get DFG projects. + * Returns a page of DFG projects based on the provided pagination parameters and optional institution filter. + * @endpoint get /api/projects/person/dfg/search + * @param authorId The author ID to filter by. + * @param topic The topic to filter by. + * @param page The page number. + * @param size The page size. + * @param sortBy The field to sort by. + * @param sortDirection The sort direction (asc or desc). + * @param observe set whether or not to return the data Observable as the body, response or events. defaults to returning the body. + * @param reportProgress flag to report request and response progress. + */ + public getDfgProjects( + authorId: string, + topic?: string, + page?: number, + size?: number, + sortBy?: string, + sortDirection?: string, + observe?: 'body', + reportProgress?: boolean, + options?: { + httpHeaderAccept?: 'application/json'; + context?: HttpContext; + transferCache?: boolean; + }, + ): Observable; + public getDfgProjects( + authorId: string, + topic?: string, + page?: number, + size?: number, + sortBy?: string, + sortDirection?: string, + observe?: 'response', + reportProgress?: boolean, + options?: { + httpHeaderAccept?: 'application/json'; + context?: HttpContext; + transferCache?: boolean; + }, + ): Observable>; + public getDfgProjects( + authorId: string, + topic?: string, + page?: number, + size?: number, + sortBy?: string, + sortDirection?: string, + observe?: 'events', + reportProgress?: boolean, + options?: { + httpHeaderAccept?: 'application/json'; + context?: HttpContext; + transferCache?: boolean; + }, + ): Observable>; + public getDfgProjects( + authorId: string, + topic?: string, + page?: number, + size?: number, + sortBy?: string, + sortDirection?: string, + observe: any = 'body', + reportProgress: boolean = false, + options?: { + httpHeaderAccept?: 'application/json'; + context?: HttpContext; + transferCache?: boolean; + }, + ): Observable { + if (authorId === null || authorId === undefined) { + throw new Error( + 'Required parameter authorId was null or undefined when calling getDfgProjects.', + ); } - /** - * Get DFG projects. - * Returns a page of DFG projects based on the provided pagination parameters and optional institution filter. - * @endpoint get /api/projects/person/dfg/search - * @param authorId The author ID to filter by. - * @param topic The topic to filter by. - * @param page The page number. - * @param size The page size. - * @param sortBy The field to sort by. - * @param sortDirection The sort direction (asc or desc). - * @param observe set whether or not to return the data Observable as the body, response or events. defaults to returning the body. - * @param reportProgress flag to report request and response progress. - */ - public getDfgProjects(authorId: string, topic?: string, page?: number, size?: number, sortBy?: string, sortDirection?: string, observe?: 'body', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable; - public getDfgProjects(authorId: string, topic?: string, page?: number, size?: number, sortBy?: string, sortDirection?: string, observe?: 'response', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable>; - public getDfgProjects(authorId: string, topic?: string, page?: number, size?: number, sortBy?: string, sortDirection?: string, observe?: 'events', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable>; - public getDfgProjects(authorId: string, topic?: string, page?: number, size?: number, sortBy?: string, sortDirection?: string, observe: any = 'body', reportProgress: boolean = false, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable { - if (authorId === null || authorId === undefined) { - throw new Error('Required parameter authorId was null or undefined when calling getDfgProjects.'); - } + let localVarQueryParameters = new HttpParams({ encoder: this.encoder }); + localVarQueryParameters = this.addToHttpParams( + localVarQueryParameters, + authorId, + 'author_id', + ); + localVarQueryParameters = this.addToHttpParams( + localVarQueryParameters, + topic, + 'topic', + ); + localVarQueryParameters = this.addToHttpParams( + localVarQueryParameters, + page, + 'page', + ); + localVarQueryParameters = this.addToHttpParams( + localVarQueryParameters, + size, + 'size', + ); + localVarQueryParameters = this.addToHttpParams( + localVarQueryParameters, + sortBy, + 'sort_by', + ); + localVarQueryParameters = this.addToHttpParams( + localVarQueryParameters, + sortDirection, + 'sort_direction', + ); - let localVarQueryParameters = new HttpParams({encoder: this.encoder}); - localVarQueryParameters = this.addToHttpParams(localVarQueryParameters, - authorId, 'author_id'); - localVarQueryParameters = this.addToHttpParams(localVarQueryParameters, - topic, 'topic'); - localVarQueryParameters = this.addToHttpParams(localVarQueryParameters, - page, 'page'); - localVarQueryParameters = this.addToHttpParams(localVarQueryParameters, - size, 'size'); - localVarQueryParameters = this.addToHttpParams(localVarQueryParameters, - sortBy, 'sort_by'); - localVarQueryParameters = this.addToHttpParams(localVarQueryParameters, - sortDirection, 'sort_direction'); + let localVarHeaders = this.defaultHeaders; - let localVarHeaders = this.defaultHeaders; + const localVarHttpHeaderAcceptSelected: string | undefined = + options?.httpHeaderAccept ?? + this.configuration.selectHeaderAccept(['application/json']); + if (localVarHttpHeaderAcceptSelected !== undefined) { + localVarHeaders = localVarHeaders.set( + 'Accept', + localVarHttpHeaderAcceptSelected, + ); + } - const localVarHttpHeaderAcceptSelected: string | undefined = options?.httpHeaderAccept ?? this.configuration.selectHeaderAccept([ - 'application/json' - ]); - if (localVarHttpHeaderAcceptSelected !== undefined) { - localVarHeaders = localVarHeaders.set('Accept', localVarHttpHeaderAcceptSelected); - } + const localVarHttpContext: HttpContext = + options?.context ?? new HttpContext(); - const localVarHttpContext: HttpContext = options?.context ?? new HttpContext(); + const localVarTransferCache: boolean = options?.transferCache ?? true; - const localVarTransferCache: boolean = options?.transferCache ?? true; + let responseType_: 'text' | 'json' | 'blob' = 'json'; + if (localVarHttpHeaderAcceptSelected) { + if (localVarHttpHeaderAcceptSelected.startsWith('text')) { + responseType_ = 'text'; + } else if ( + this.configuration.isJsonMime(localVarHttpHeaderAcceptSelected) + ) { + responseType_ = 'json'; + } else { + responseType_ = 'blob'; + } + } + let localVarPath = `/api/projects/person/dfg/search`; + const { basePath, withCredentials } = this.configuration; + return this.httpClient.request( + 'get', + `${basePath}${localVarPath}`, + { + context: localVarHttpContext, + params: localVarQueryParameters, + responseType: responseType_, + ...(withCredentials ? { withCredentials } : {}), + headers: localVarHeaders, + observe: observe, + ...(localVarTransferCache !== undefined + ? { transferCache: localVarTransferCache } + : {}), + reportProgress: reportProgress, + }, + ); + } - let 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 EU projects for an author. + * Returns a list of EU projects associated with the specified author ID. + * @endpoint get /api/projects/author/{raw_oa_author_id}/eu + * @param rawOaAuthorId The author ID to filter 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 getEuProjectsForAuthor( + rawOaAuthorId: string, + observe?: 'body', + reportProgress?: boolean, + options?: { + httpHeaderAccept?: 'application/json'; + context?: HttpContext; + transferCache?: boolean; + }, + ): Observable; + public getEuProjectsForAuthor( + rawOaAuthorId: string, + observe?: 'response', + reportProgress?: boolean, + options?: { + httpHeaderAccept?: 'application/json'; + context?: HttpContext; + transferCache?: boolean; + }, + ): Observable>; + public getEuProjectsForAuthor( + rawOaAuthorId: string, + observe?: 'events', + reportProgress?: boolean, + options?: { + httpHeaderAccept?: 'application/json'; + context?: HttpContext; + transferCache?: boolean; + }, + ): Observable>; + public getEuProjectsForAuthor( + rawOaAuthorId: string, + observe: any = 'body', + reportProgress: boolean = false, + options?: { + httpHeaderAccept?: 'application/json'; + context?: HttpContext; + transferCache?: boolean; + }, + ): Observable { + if (rawOaAuthorId === null || rawOaAuthorId === undefined) { + throw new Error( + 'Required parameter rawOaAuthorId was null or undefined when calling getEuProjectsForAuthor.', + ); + } - let localVarPath = `/api/projects/person/dfg/search`; - const { basePath, withCredentials } = this.configuration; - return this.httpClient.request('get', `${basePath}${localVarPath}`, - { - context: localVarHttpContext, - params: localVarQueryParameters, - responseType: responseType_, - ...(withCredentials ? { withCredentials } : {}), - headers: localVarHeaders, - observe: observe, - ...(localVarTransferCache !== undefined ? { transferCache: localVarTransferCache } : {}), - reportProgress: reportProgress - } + let 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/projects/author/${this.configuration.encodeParam({ name: 'rawOaAuthorId', value: rawOaAuthorId, in: 'path', style: 'simple', explode: false, dataType: 'string', dataFormat: undefined })}/eu`; + const { basePath, withCredentials } = this.configuration; + return this.httpClient.request( + 'get', + `${basePath}${localVarPath}`, + { + context: localVarHttpContext, + responseType: responseType_, + ...(withCredentials ? { withCredentials } : {}), + headers: localVarHeaders, + observe: observe, + ...(localVarTransferCache !== undefined + ? { transferCache: localVarTransferCache } + : {}), + reportProgress: reportProgress, + }, + ); + } + + /** + * Get funding over time for bund projects. + * Returns the funding over time for bund projects associated with the specified institution. + * @endpoint get /api/projects/institution/bund/funding-over-time + * @param rawOaInstitutionId The institution ID to filter 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 getInstitutionBundProjectsFundingOverTime( + rawOaInstitutionId: string, + observe?: 'body', + reportProgress?: boolean, + options?: { + httpHeaderAccept?: 'application/json'; + context?: HttpContext; + transferCache?: boolean; + }, + ): Observable; + public getInstitutionBundProjectsFundingOverTime( + rawOaInstitutionId: string, + observe?: 'response', + reportProgress?: boolean, + options?: { + httpHeaderAccept?: 'application/json'; + context?: HttpContext; + transferCache?: boolean; + }, + ): Observable>; + public getInstitutionBundProjectsFundingOverTime( + rawOaInstitutionId: string, + observe?: 'events', + reportProgress?: boolean, + options?: { + httpHeaderAccept?: 'application/json'; + context?: HttpContext; + transferCache?: boolean; + }, + ): Observable>; + public getInstitutionBundProjectsFundingOverTime( + rawOaInstitutionId: string, + observe: any = 'body', + reportProgress: boolean = false, + options?: { + httpHeaderAccept?: 'application/json'; + context?: HttpContext; + transferCache?: boolean; + }, + ): Observable { + if (rawOaInstitutionId === null || rawOaInstitutionId === undefined) { + throw new Error( + 'Required parameter rawOaInstitutionId was null or undefined when calling getInstitutionBundProjectsFundingOverTime.', + ); + } + + let localVarQueryParameters = new HttpParams({ encoder: this.encoder }); + localVarQueryParameters = this.addToHttpParams( + localVarQueryParameters, + rawOaInstitutionId, + 'raw_oa_institution_id', + ); + + 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/projects/institution/bund/funding-over-time`; + const { basePath, withCredentials } = this.configuration; + return this.httpClient.request( + 'get', + `${basePath}${localVarPath}`, + { + context: localVarHttpContext, + params: localVarQueryParameters, + responseType: responseType_, + ...(withCredentials ? { withCredentials } : {}), + headers: localVarHeaders, + observe: observe, + ...(localVarTransferCache !== undefined + ? { transferCache: localVarTransferCache } + : {}), + reportProgress: reportProgress, + }, + ); + } + + /** + * Get funding over time for EU projects. + * Returns the funding over time for EU projects associated with the specified institution. + * @endpoint get /api/projects/institution/eu/funding-over-time + * @param rawOaInstitutionId The institution ID to filter 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 getInstitutionCordisEuProjectsFundingOverTime( + rawOaInstitutionId: string, + observe?: 'body', + reportProgress?: boolean, + options?: { + httpHeaderAccept?: 'application/json'; + context?: HttpContext; + transferCache?: boolean; + }, + ): Observable; + public getInstitutionCordisEuProjectsFundingOverTime( + rawOaInstitutionId: string, + observe?: 'response', + reportProgress?: boolean, + options?: { + httpHeaderAccept?: 'application/json'; + context?: HttpContext; + transferCache?: boolean; + }, + ): Observable>; + public getInstitutionCordisEuProjectsFundingOverTime( + rawOaInstitutionId: string, + observe?: 'events', + reportProgress?: boolean, + options?: { + httpHeaderAccept?: 'application/json'; + context?: HttpContext; + transferCache?: boolean; + }, + ): Observable>; + public getInstitutionCordisEuProjectsFundingOverTime( + rawOaInstitutionId: string, + observe: any = 'body', + reportProgress: boolean = false, + options?: { + httpHeaderAccept?: 'application/json'; + context?: HttpContext; + transferCache?: boolean; + }, + ): Observable { + if (rawOaInstitutionId === null || rawOaInstitutionId === undefined) { + throw new Error( + 'Required parameter rawOaInstitutionId was null or undefined when calling getInstitutionCordisEuProjectsFundingOverTime.', + ); + } + + let localVarQueryParameters = new HttpParams({ encoder: this.encoder }); + localVarQueryParameters = this.addToHttpParams( + localVarQueryParameters, + rawOaInstitutionId, + 'raw_oa_institution_id', + ); + + 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/projects/institution/eu/funding-over-time`; + const { basePath, withCredentials } = this.configuration; + return this.httpClient.request( + 'get', + `${basePath}${localVarPath}`, + { + context: localVarHttpContext, + params: localVarQueryParameters, + responseType: responseType_, + ...(withCredentials ? { withCredentials } : {}), + headers: localVarHeaders, + observe: observe, + ...(localVarTransferCache !== undefined + ? { transferCache: localVarTransferCache } + : {}), + reportProgress: reportProgress, + }, + ); + } + + /** + * Get a single BUND project. + * Returns a single BUND project based on its ID. + * @endpoint get /api/projects/bund/{id} + * @param id The ID of the BUND project to retrieve. + * @param observe set whether or not to return the data Observable as the body, response or events. defaults to returning the body. + * @param reportProgress flag to report request and response progress. + */ + public getSingleBundProject( + id: string, + observe?: 'body', + reportProgress?: boolean, + options?: { + httpHeaderAccept?: 'application/json'; + context?: HttpContext; + transferCache?: boolean; + }, + ): Observable; + public getSingleBundProject( + id: string, + observe?: 'response', + reportProgress?: boolean, + options?: { + httpHeaderAccept?: 'application/json'; + context?: HttpContext; + transferCache?: boolean; + }, + ): Observable>; + public getSingleBundProject( + id: string, + observe?: 'events', + reportProgress?: boolean, + options?: { + httpHeaderAccept?: 'application/json'; + context?: HttpContext; + transferCache?: boolean; + }, + ): Observable>; + public getSingleBundProject( + id: string, + observe: any = 'body', + reportProgress: boolean = false, + options?: { + httpHeaderAccept?: 'application/json'; + context?: HttpContext; + transferCache?: boolean; + }, + ): Observable { + if (id === null || id === undefined) { + throw new Error( + 'Required parameter id was null or undefined when calling getSingleBundProject.', + ); + } + + 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/projects/bund/${this.configuration.encodeParam({ name: 'id', value: id, in: 'path', style: 'simple', explode: false, dataType: 'string', dataFormat: undefined })}`; + const { basePath, withCredentials } = this.configuration; + return this.httpClient.request( + 'get', + `${basePath}${localVarPath}`, + { + context: localVarHttpContext, + responseType: responseType_, + ...(withCredentials ? { withCredentials } : {}), + headers: localVarHeaders, + observe: observe, + ...(localVarTransferCache !== undefined + ? { transferCache: localVarTransferCache } + : {}), + reportProgress: reportProgress, + }, + ); + } + + /** + * Get a single DFG project. + * Returns a single DFG project based on its ID. + * @endpoint get /api/projects/dfg/{id} + * @param id The ID of the DFG project to retrieve. + * @param observe set whether or not to return the data Observable as the body, response or events. defaults to returning the body. + * @param reportProgress flag to report request and response progress. + */ + public getSingleDfgProject( + id: string, + observe?: 'body', + reportProgress?: boolean, + options?: { + httpHeaderAccept?: 'application/json'; + context?: HttpContext; + transferCache?: boolean; + }, + ): Observable; + public getSingleDfgProject( + id: string, + observe?: 'response', + reportProgress?: boolean, + options?: { + httpHeaderAccept?: 'application/json'; + context?: HttpContext; + transferCache?: boolean; + }, + ): Observable>; + public getSingleDfgProject( + id: string, + observe?: 'events', + reportProgress?: boolean, + options?: { + httpHeaderAccept?: 'application/json'; + context?: HttpContext; + transferCache?: boolean; + }, + ): Observable>; + public getSingleDfgProject( + id: string, + observe: any = 'body', + reportProgress: boolean = false, + options?: { + httpHeaderAccept?: 'application/json'; + context?: HttpContext; + transferCache?: boolean; + }, + ): Observable { + if (id === null || id === undefined) { + throw new Error( + 'Required parameter id was null or undefined when calling getSingleDfgProject.', + ); + } + + 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/projects/dfg/${this.configuration.encodeParam({ name: 'id', value: id, in: 'path', style: 'simple', explode: false, dataType: 'string', dataFormat: undefined })}`; + const { basePath, withCredentials } = this.configuration; + return this.httpClient.request( + 'get', + `${basePath}${localVarPath}`, + { + context: localVarHttpContext, + responseType: responseType_, + ...(withCredentials ? { withCredentials } : {}), + headers: localVarHeaders, + observe: observe, + ...(localVarTransferCache !== undefined + ? { transferCache: localVarTransferCache } + : {}), + reportProgress: reportProgress, + }, + ); + } + + /** + * Get a single EU Cordis project. + * Returns a single EU Cordis project based on its ID. + * @endpoint get /api/projects/eu/{id} + * @param id The ID of the EU Cordis project to retrieve. + * @param observe set whether or not to return the data Observable as the body, response or events. defaults to returning the body. + * @param reportProgress flag to report request and response progress. + */ + public getSingleEuCordisProject( + id: string, + observe?: 'body', + reportProgress?: boolean, + options?: { + httpHeaderAccept?: 'application/json'; + context?: HttpContext; + transferCache?: boolean; + }, + ): Observable; + public getSingleEuCordisProject( + id: string, + observe?: 'response', + reportProgress?: boolean, + options?: { + httpHeaderAccept?: 'application/json'; + context?: HttpContext; + transferCache?: boolean; + }, + ): Observable>; + public getSingleEuCordisProject( + id: string, + observe?: 'events', + reportProgress?: boolean, + options?: { + httpHeaderAccept?: 'application/json'; + context?: HttpContext; + transferCache?: boolean; + }, + ): Observable>; + public getSingleEuCordisProject( + id: string, + observe: any = 'body', + reportProgress: boolean = false, + options?: { + httpHeaderAccept?: 'application/json'; + context?: HttpContext; + transferCache?: boolean; + }, + ): Observable { + if (id === null || id === undefined) { + throw new Error( + 'Required parameter id was null or undefined when calling getSingleEuCordisProject.', + ); + } + + 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/projects/eu/${this.configuration.encodeParam({ name: 'id', value: id, in: 'path', style: 'simple', explode: false, dataType: 'string', dataFormat: undefined })}`; + const { basePath, withCredentials } = this.configuration; + return this.httpClient.request( + 'get', + `${basePath}${localVarPath}`, + { + context: localVarHttpContext, + responseType: responseType_, + ...(withCredentials ? { withCredentials } : {}), + headers: localVarHeaders, + observe: observe, + ...(localVarTransferCache !== undefined + ? { transferCache: localVarTransferCache } + : {}), + reportProgress: reportProgress, + }, + ); + } + + /** + * Get bund projects. + * Returns a page of bund projects based on the provided pagination parameters and optional institution filter. + * @endpoint post /api/projects/institution/bund/search + * @param projectsFilteringProperties + * @param observe set whether or not to return the data Observable as the body, response or events. defaults to returning the body. + * @param reportProgress flag to report request and response progress. + */ + public searchBundProjects( + projectsFilteringProperties: ProjectsFilteringProperties, + observe?: 'body', + reportProgress?: boolean, + options?: { + httpHeaderAccept?: 'application/json'; + context?: HttpContext; + transferCache?: boolean; + }, + ): Observable; + public searchBundProjects( + projectsFilteringProperties: ProjectsFilteringProperties, + observe?: 'response', + reportProgress?: boolean, + options?: { + httpHeaderAccept?: 'application/json'; + context?: HttpContext; + transferCache?: boolean; + }, + ): Observable>; + public searchBundProjects( + projectsFilteringProperties: ProjectsFilteringProperties, + observe?: 'events', + reportProgress?: boolean, + options?: { + httpHeaderAccept?: 'application/json'; + context?: HttpContext; + transferCache?: boolean; + }, + ): Observable>; + public searchBundProjects( + projectsFilteringProperties: ProjectsFilteringProperties, + observe: any = 'body', + reportProgress: boolean = false, + options?: { + httpHeaderAccept?: 'application/json'; + context?: HttpContext; + transferCache?: boolean; + }, + ): Observable { + if ( + projectsFilteringProperties === null || + projectsFilteringProperties === undefined + ) { + throw new Error( + 'Required parameter projectsFilteringProperties was null or undefined when calling searchBundProjects.', + ); + } + + 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/projects/institution/bund/search`; + const { basePath, withCredentials } = this.configuration; + return this.httpClient.request( + 'post', + `${basePath}${localVarPath}`, + { + context: localVarHttpContext, + body: projectsFilteringProperties, + responseType: responseType_, + ...(withCredentials ? { withCredentials } : {}), + headers: localVarHeaders, + observe: observe, + ...(localVarTransferCache !== undefined + ? { transferCache: localVarTransferCache } + : {}), + reportProgress: reportProgress, + }, + ); + } + + /** + * Get EU projects. + * Returns a page of EU projects based on the provided pagination parameters and optional institution filter. + * @endpoint post /api/projects/institution/eu/search + * @param projectsFilteringProperties + * @param observe set whether or not to return the data Observable as the body, response or events. defaults to returning the body. + * @param reportProgress flag to report request and response progress. + */ + public searchCordisEuProjects( + projectsFilteringProperties: ProjectsFilteringProperties, + observe?: 'body', + reportProgress?: boolean, + options?: { + httpHeaderAccept?: 'application/json'; + context?: HttpContext; + transferCache?: boolean; + }, + ): Observable; + public searchCordisEuProjects( + projectsFilteringProperties: ProjectsFilteringProperties, + observe?: 'response', + reportProgress?: boolean, + options?: { + httpHeaderAccept?: 'application/json'; + context?: HttpContext; + transferCache?: boolean; + }, + ): Observable>; + public searchCordisEuProjects( + projectsFilteringProperties: ProjectsFilteringProperties, + observe?: 'events', + reportProgress?: boolean, + options?: { + httpHeaderAccept?: 'application/json'; + context?: HttpContext; + transferCache?: boolean; + }, + ): Observable>; + public searchCordisEuProjects( + projectsFilteringProperties: ProjectsFilteringProperties, + observe: any = 'body', + reportProgress: boolean = false, + options?: { + httpHeaderAccept?: 'application/json'; + context?: HttpContext; + transferCache?: boolean; + }, + ): Observable { + if ( + projectsFilteringProperties === null || + projectsFilteringProperties === undefined + ) { + throw new Error( + 'Required parameter projectsFilteringProperties was null or undefined when calling searchCordisEuProjects.', + ); + } + + 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/projects/institution/eu/search`; + const { basePath, withCredentials } = this.configuration; + return this.httpClient.request( + 'post', + `${basePath}${localVarPath}`, + { + context: localVarHttpContext, + body: projectsFilteringProperties, + responseType: responseType_, + ...(withCredentials ? { withCredentials } : {}), + headers: localVarHeaders, + observe: observe, + ...(localVarTransferCache !== undefined + ? { transferCache: localVarTransferCache } + : {}), + reportProgress: reportProgress, + }, + ); + } + + /** + * Search projects across all funders. + * Returns a page of projects across all funders based on the provided pagination parameters and optional institution filter. + * @endpoint get /api/projects/search + * @param page The page number. + * @param size The page size. + * @param selectedProjectTypes The set of project types to filter by (e.g., \'bund\', \'eu\', \'dfg\'). If not provided, projects of all types will be included. + * @param title The title to filter by. + * @param sortBy The field to sort by. + * @param sortDirection The sort direction (asc or desc). + * @param observe set whether or not to return the data Observable as the body, response or events. defaults to returning the body. + * @param reportProgress flag to report request and response progress. + */ + public searchProjects( + page?: number, + size?: number, + selectedProjectTypes?: Set, + title?: string, + sortBy?: ProjectsSortBy, + sortDirection?: SortDirection, + observe?: 'body', + reportProgress?: boolean, + options?: { + httpHeaderAccept?: 'application/json'; + context?: HttpContext; + transferCache?: boolean; + }, + ): Observable; + public searchProjects( + page?: number, + size?: number, + selectedProjectTypes?: Set, + title?: string, + sortBy?: ProjectsSortBy, + sortDirection?: SortDirection, + observe?: 'response', + reportProgress?: boolean, + options?: { + httpHeaderAccept?: 'application/json'; + context?: HttpContext; + transferCache?: boolean; + }, + ): Observable>; + public searchProjects( + page?: number, + size?: number, + selectedProjectTypes?: Set, + title?: string, + sortBy?: ProjectsSortBy, + sortDirection?: SortDirection, + observe?: 'events', + reportProgress?: boolean, + options?: { + httpHeaderAccept?: 'application/json'; + context?: HttpContext; + transferCache?: boolean; + }, + ): Observable>; + public searchProjects( + page?: number, + size?: number, + selectedProjectTypes?: Set, + title?: string, + sortBy?: ProjectsSortBy, + sortDirection?: SortDirection, + observe: any = 'body', + reportProgress: boolean = false, + options?: { + httpHeaderAccept?: 'application/json'; + context?: HttpContext; + transferCache?: boolean; + }, + ): Observable { + let localVarQueryParameters = new HttpParams({ encoder: this.encoder }); + localVarQueryParameters = this.addToHttpParams( + localVarQueryParameters, + page, + 'page', + ); + localVarQueryParameters = this.addToHttpParams( + localVarQueryParameters, + size, + 'size', + ); + if (selectedProjectTypes) { + selectedProjectTypes.forEach((element) => { + localVarQueryParameters = this.addToHttpParams( + localVarQueryParameters, + element, + 'selected_project_types', ); + }); + } + localVarQueryParameters = this.addToHttpParams( + localVarQueryParameters, + title, + 'title', + ); + localVarQueryParameters = this.addToHttpParams( + localVarQueryParameters, + sortBy, + 'sort_by', + ); + localVarQueryParameters = this.addToHttpParams( + localVarQueryParameters, + 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, + ); } - /** - * Get EU projects for an author. - * Returns a list of EU projects associated with the specified author ID. - * @endpoint get /api/projects/author/{raw_oa_author_id}/eu - * @param rawOaAuthorId The author ID to filter 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 getEuProjectsForAuthor(rawOaAuthorId: string, observe?: 'body', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable; - public getEuProjectsForAuthor(rawOaAuthorId: string, observe?: 'response', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable>; - public getEuProjectsForAuthor(rawOaAuthorId: string, observe?: 'events', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable>; - public getEuProjectsForAuthor(rawOaAuthorId: string, observe: any = 'body', reportProgress: boolean = false, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable { - if (rawOaAuthorId === null || rawOaAuthorId === undefined) { - throw new Error('Required parameter rawOaAuthorId was null or undefined when calling getEuProjectsForAuthor.'); - } + const localVarHttpContext: HttpContext = + options?.context ?? new HttpContext(); - let localVarHeaders = this.defaultHeaders; + const localVarTransferCache: boolean = options?.transferCache ?? true; - 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/projects/author/${this.configuration.encodeParam({name: "rawOaAuthorId", value: rawOaAuthorId, in: "path", style: "simple", explode: false, dataType: "string", dataFormat: undefined})}/eu`; - const { basePath, withCredentials } = this.configuration; - return this.httpClient.request('get', `${basePath}${localVarPath}`, - { - context: localVarHttpContext, - responseType: responseType_, - ...(withCredentials ? { withCredentials } : {}), - headers: localVarHeaders, - observe: observe, - ...(localVarTransferCache !== undefined ? { transferCache: localVarTransferCache } : {}), - reportProgress: reportProgress - } - ); - } - - /** - * Get funding over time for bund projects. - * Returns the funding over time for bund projects associated with the specified institution. - * @endpoint get /api/projects/institution/bund/funding-over-time - * @param rawOaInstitutionId The institution ID to filter 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 getInstitutionBundProjectsFundingOverTime(rawOaInstitutionId: string, observe?: 'body', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable; - public getInstitutionBundProjectsFundingOverTime(rawOaInstitutionId: string, observe?: 'response', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable>; - public getInstitutionBundProjectsFundingOverTime(rawOaInstitutionId: string, observe?: 'events', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable>; - public getInstitutionBundProjectsFundingOverTime(rawOaInstitutionId: string, observe: any = 'body', reportProgress: boolean = false, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable { - if (rawOaInstitutionId === null || rawOaInstitutionId === undefined) { - throw new Error('Required parameter rawOaInstitutionId was null or undefined when calling getInstitutionBundProjectsFundingOverTime.'); - } - - let localVarQueryParameters = new HttpParams({encoder: this.encoder}); - localVarQueryParameters = this.addToHttpParams(localVarQueryParameters, - rawOaInstitutionId, 'raw_oa_institution_id'); - - 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/projects/institution/bund/funding-over-time`; - const { basePath, withCredentials } = this.configuration; - return this.httpClient.request('get', `${basePath}${localVarPath}`, - { - context: localVarHttpContext, - params: localVarQueryParameters, - responseType: responseType_, - ...(withCredentials ? { withCredentials } : {}), - headers: localVarHeaders, - observe: observe, - ...(localVarTransferCache !== undefined ? { transferCache: localVarTransferCache } : {}), - reportProgress: reportProgress - } - ); - } - - /** - * Get funding over time for EU projects. - * Returns the funding over time for EU projects associated with the specified institution. - * @endpoint get /api/projects/institution/eu/funding-over-time - * @param rawOaInstitutionId The institution ID to filter 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 getInstitutionCordisEuProjectsFundingOverTime(rawOaInstitutionId: string, observe?: 'body', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable; - public getInstitutionCordisEuProjectsFundingOverTime(rawOaInstitutionId: string, observe?: 'response', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable>; - public getInstitutionCordisEuProjectsFundingOverTime(rawOaInstitutionId: string, observe?: 'events', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable>; - public getInstitutionCordisEuProjectsFundingOverTime(rawOaInstitutionId: string, observe: any = 'body', reportProgress: boolean = false, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable { - if (rawOaInstitutionId === null || rawOaInstitutionId === undefined) { - throw new Error('Required parameter rawOaInstitutionId was null or undefined when calling getInstitutionCordisEuProjectsFundingOverTime.'); - } - - let localVarQueryParameters = new HttpParams({encoder: this.encoder}); - localVarQueryParameters = this.addToHttpParams(localVarQueryParameters, - rawOaInstitutionId, 'raw_oa_institution_id'); - - 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/projects/institution/eu/funding-over-time`; - const { basePath, withCredentials } = this.configuration; - return this.httpClient.request('get', `${basePath}${localVarPath}`, - { - context: localVarHttpContext, - params: localVarQueryParameters, - responseType: responseType_, - ...(withCredentials ? { withCredentials } : {}), - headers: localVarHeaders, - observe: observe, - ...(localVarTransferCache !== undefined ? { transferCache: localVarTransferCache } : {}), - reportProgress: reportProgress - } - ); - } - - /** - * Get a single BUND project. - * Returns a single BUND project based on its ID. - * @endpoint get /api/projects/bund/{id} - * @param id The ID of the BUND project to retrieve. - * @param observe set whether or not to return the data Observable as the body, response or events. defaults to returning the body. - * @param reportProgress flag to report request and response progress. - */ - public getSingleBundProject(id: string, observe?: 'body', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable; - public getSingleBundProject(id: string, observe?: 'response', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable>; - public getSingleBundProject(id: string, observe?: 'events', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable>; - public getSingleBundProject(id: string, observe: any = 'body', reportProgress: boolean = false, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable { - if (id === null || id === undefined) { - throw new Error('Required parameter id was null or undefined when calling getSingleBundProject.'); - } - - 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/projects/bund/${this.configuration.encodeParam({name: "id", value: id, in: "path", style: "simple", explode: false, dataType: "string", dataFormat: undefined})}`; - const { basePath, withCredentials } = this.configuration; - return this.httpClient.request('get', `${basePath}${localVarPath}`, - { - context: localVarHttpContext, - responseType: responseType_, - ...(withCredentials ? { withCredentials } : {}), - headers: localVarHeaders, - observe: observe, - ...(localVarTransferCache !== undefined ? { transferCache: localVarTransferCache } : {}), - reportProgress: reportProgress - } - ); - } - - /** - * Get a single DFG project. - * Returns a single DFG project based on its ID. - * @endpoint get /api/projects/dfg/{id} - * @param id The ID of the DFG project to retrieve. - * @param observe set whether or not to return the data Observable as the body, response or events. defaults to returning the body. - * @param reportProgress flag to report request and response progress. - */ - public getSingleDfgProject(id: string, observe?: 'body', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable; - public getSingleDfgProject(id: string, observe?: 'response', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable>; - public getSingleDfgProject(id: string, observe?: 'events', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable>; - public getSingleDfgProject(id: string, observe: any = 'body', reportProgress: boolean = false, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable { - if (id === null || id === undefined) { - throw new Error('Required parameter id was null or undefined when calling getSingleDfgProject.'); - } - - 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/projects/dfg/${this.configuration.encodeParam({name: "id", value: id, in: "path", style: "simple", explode: false, dataType: "string", dataFormat: undefined})}`; - const { basePath, withCredentials } = this.configuration; - return this.httpClient.request('get', `${basePath}${localVarPath}`, - { - context: localVarHttpContext, - responseType: responseType_, - ...(withCredentials ? { withCredentials } : {}), - headers: localVarHeaders, - observe: observe, - ...(localVarTransferCache !== undefined ? { transferCache: localVarTransferCache } : {}), - reportProgress: reportProgress - } - ); - } - - /** - * Get a single EU Cordis project. - * Returns a single EU Cordis project based on its ID. - * @endpoint get /api/projects/eu/{id} - * @param id The ID of the EU Cordis project to retrieve. - * @param observe set whether or not to return the data Observable as the body, response or events. defaults to returning the body. - * @param reportProgress flag to report request and response progress. - */ - public getSingleEuCordisProject(id: string, observe?: 'body', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable; - public getSingleEuCordisProject(id: string, observe?: 'response', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable>; - public getSingleEuCordisProject(id: string, observe?: 'events', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable>; - public getSingleEuCordisProject(id: string, observe: any = 'body', reportProgress: boolean = false, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable { - if (id === null || id === undefined) { - throw new Error('Required parameter id was null or undefined when calling getSingleEuCordisProject.'); - } - - 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/projects/eu/${this.configuration.encodeParam({name: "id", value: id, in: "path", style: "simple", explode: false, dataType: "string", dataFormat: undefined})}`; - const { basePath, withCredentials } = this.configuration; - return this.httpClient.request('get', `${basePath}${localVarPath}`, - { - context: localVarHttpContext, - responseType: responseType_, - ...(withCredentials ? { withCredentials } : {}), - headers: localVarHeaders, - observe: observe, - ...(localVarTransferCache !== undefined ? { transferCache: localVarTransferCache } : {}), - reportProgress: reportProgress - } - ); - } - - /** - * Get bund projects. - * Returns a page of bund projects based on the provided pagination parameters and optional institution filter. - * @endpoint post /api/projects/institution/bund/search - * @param projectsFilteringProperties - * @param observe set whether or not to return the data Observable as the body, response or events. defaults to returning the body. - * @param reportProgress flag to report request and response progress. - */ - public searchBundProjects(projectsFilteringProperties: ProjectsFilteringProperties, observe?: 'body', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable; - public searchBundProjects(projectsFilteringProperties: ProjectsFilteringProperties, observe?: 'response', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable>; - public searchBundProjects(projectsFilteringProperties: ProjectsFilteringProperties, observe?: 'events', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable>; - public searchBundProjects(projectsFilteringProperties: ProjectsFilteringProperties, observe: any = 'body', reportProgress: boolean = false, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable { - if (projectsFilteringProperties === null || projectsFilteringProperties === undefined) { - throw new Error('Required parameter projectsFilteringProperties was null or undefined when calling searchBundProjects.'); - } - - 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/projects/institution/bund/search`; - const { basePath, withCredentials } = this.configuration; - return this.httpClient.request('post', `${basePath}${localVarPath}`, - { - context: localVarHttpContext, - body: projectsFilteringProperties, - responseType: responseType_, - ...(withCredentials ? { withCredentials } : {}), - headers: localVarHeaders, - observe: observe, - ...(localVarTransferCache !== undefined ? { transferCache: localVarTransferCache } : {}), - reportProgress: reportProgress - } - ); - } - - /** - * Get EU projects. - * Returns a page of EU projects based on the provided pagination parameters and optional institution filter. - * @endpoint post /api/projects/institution/eu/search - * @param projectsFilteringProperties - * @param observe set whether or not to return the data Observable as the body, response or events. defaults to returning the body. - * @param reportProgress flag to report request and response progress. - */ - public searchCordisEuProjects(projectsFilteringProperties: ProjectsFilteringProperties, observe?: 'body', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable; - public searchCordisEuProjects(projectsFilteringProperties: ProjectsFilteringProperties, observe?: 'response', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable>; - public searchCordisEuProjects(projectsFilteringProperties: ProjectsFilteringProperties, observe?: 'events', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable>; - public searchCordisEuProjects(projectsFilteringProperties: ProjectsFilteringProperties, observe: any = 'body', reportProgress: boolean = false, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable { - if (projectsFilteringProperties === null || projectsFilteringProperties === undefined) { - throw new Error('Required parameter projectsFilteringProperties was null or undefined when calling searchCordisEuProjects.'); - } - - 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/projects/institution/eu/search`; - const { basePath, withCredentials } = this.configuration; - return this.httpClient.request('post', `${basePath}${localVarPath}`, - { - context: localVarHttpContext, - body: projectsFilteringProperties, - responseType: responseType_, - ...(withCredentials ? { withCredentials } : {}), - headers: localVarHeaders, - observe: observe, - ...(localVarTransferCache !== undefined ? { transferCache: localVarTransferCache } : {}), - reportProgress: reportProgress - } - ); - } - - /** - * Search projects across all funders. - * Returns a page of projects across all funders based on the provided pagination parameters and optional institution filter. - * @endpoint get /api/projects/search - * @param page The page number. - * @param size The page size. - * @param selectedProjectTypes The set of project types to filter by (e.g., \'bund\', \'eu\', \'dfg\'). If not provided, projects of all types will be included. - * @param title The title to filter by. - * @param sortBy The field to sort by. - * @param sortDirection The sort direction (asc or desc). - * @param observe set whether or not to return the data Observable as the body, response or events. defaults to returning the body. - * @param reportProgress flag to report request and response progress. - */ - public searchProjects(page?: number, size?: number, selectedProjectTypes?: Set, title?: string, sortBy?: ProjectsSortBy, sortDirection?: SortDirection, observe?: 'body', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable; - public searchProjects(page?: number, size?: number, selectedProjectTypes?: Set, title?: string, sortBy?: ProjectsSortBy, sortDirection?: SortDirection, observe?: 'response', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable>; - public searchProjects(page?: number, size?: number, selectedProjectTypes?: Set, title?: string, sortBy?: ProjectsSortBy, sortDirection?: SortDirection, observe?: 'events', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable>; - public searchProjects(page?: number, size?: number, selectedProjectTypes?: Set, title?: string, sortBy?: ProjectsSortBy, sortDirection?: SortDirection, observe: any = 'body', reportProgress: boolean = false, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable { - - let localVarQueryParameters = new HttpParams({encoder: this.encoder}); - localVarQueryParameters = this.addToHttpParams(localVarQueryParameters, - page, 'page'); - localVarQueryParameters = this.addToHttpParams(localVarQueryParameters, - size, 'size'); - if (selectedProjectTypes) { - selectedProjectTypes.forEach((element) => { - localVarQueryParameters = this.addToHttpParams(localVarQueryParameters, - element, 'selected_project_types'); - }) - } - localVarQueryParameters = this.addToHttpParams(localVarQueryParameters, - title, 'title'); - localVarQueryParameters = this.addToHttpParams(localVarQueryParameters, - sortBy, 'sort_by'); - localVarQueryParameters = this.addToHttpParams(localVarQueryParameters, - 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); - } - - 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/projects/search`; - const { basePath, withCredentials } = this.configuration; - return this.httpClient.request('get', `${basePath}${localVarPath}`, - { - context: localVarHttpContext, - params: localVarQueryParameters, - responseType: responseType_, - ...(withCredentials ? { withCredentials } : {}), - headers: localVarHeaders, - observe: observe, - ...(localVarTransferCache !== undefined ? { transferCache: localVarTransferCache } : {}), - reportProgress: reportProgress - } - ); + let 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/projects/search`; + const { basePath, withCredentials } = this.configuration; + return this.httpClient.request( + 'get', + `${basePath}${localVarPath}`, + { + context: localVarHttpContext, + params: localVarQueryParameters, + responseType: responseType_, + ...(withCredentials ? { withCredentials } : {}), + headers: localVarHeaders, + observe: observe, + ...(localVarTransferCache !== undefined + ? { transferCache: localVarTransferCache } + : {}), + reportProgress: reportProgress, + }, + ); + } } diff --git a/webapp/src/app/api/encoder.ts b/webapp/src/app/api/encoder.ts index 138c4d5c..889ef00d 100644 --- a/webapp/src/app/api/encoder.ts +++ b/webapp/src/app/api/encoder.ts @@ -5,16 +5,16 @@ import { HttpParameterCodec } from '@angular/common/http'; * Workaround for https://github.com/angular/angular/issues/18261 */ export class CustomHttpParameterCodec implements HttpParameterCodec { - encodeKey(k: string): string { - return encodeURIComponent(k); - } - encodeValue(v: string): string { - return encodeURIComponent(v); - } - decodeKey(k: string): string { - return decodeURIComponent(k); - } - decodeValue(v: string): string { - return decodeURIComponent(v); - } + encodeKey(k: string): string { + return encodeURIComponent(k); + } + encodeValue(v: string): string { + return encodeURIComponent(v); + } + decodeKey(k: string): string { + return decodeURIComponent(k); + } + decodeValue(v: string): string { + return decodeURIComponent(v); + } } diff --git a/webapp/src/app/api/model/accessResponse.ts b/webapp/src/app/api/model/accessResponse.ts index f1610895..2a188f73 100644 --- a/webapp/src/app/api/model/accessResponse.ts +++ b/webapp/src/app/api/model/accessResponse.ts @@ -1,24 +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. */ -import { RefreshToken } from './refreshToken'; import { AccessToken } from './accessToken'; - -export interface AccessResponse { - /** - * The access token issued upon successful authentication. - */ - access_token: AccessToken; - /** - * The refresh token issued alongside the access token for obtaining new access tokens. - */ - refresh_token: RefreshToken; +export interface AccessResponse { + /** + * The access token issued upon successful authentication. + */ + access_token: AccessToken; } - diff --git a/webapp/src/app/api/model/accessToken.ts b/webapp/src/app/api/model/accessToken.ts index ce3ea930..405d3521 100644 --- a/webapp/src/app/api/model/accessToken.ts +++ b/webapp/src/app/api/model/accessToken.ts @@ -1,7 +1,7 @@ /** * Innovation Search Engine API * - * + * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech @@ -10,46 +10,42 @@ import { TokenType } from './tokenType'; import { UserRole } from './userRole'; - -export interface AccessToken { - /** - * The type of the token, which is always ACCESS_TOKEN for this class. - */ - token_type?: TokenType; - /** - * 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; - /** - * A hash of the user\'s fingerprint to ensure the token is used by the same user. - */ - user_fingerprint_hash: string; - /** - * The raw token string. - */ - raw_token: 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; +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 {} diff --git a/webapp/src/app/api/model/accountPage.ts b/webapp/src/app/api/model/accountPage.ts index c92c4ba3..64c7f969 100644 --- a/webapp/src/app/api/model/accountPage.ts +++ b/webapp/src/app/api/model/accountPage.ts @@ -1,7 +1,7 @@ /** * Innovation Search Engine API * - * + * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech @@ -9,11 +9,9 @@ */ import { AccountProfile } from './accountProfile'; - -export interface AccountPage { - items: Array; - total: number; - page: number; - page_size: number; +export interface AccountPage { + items: Array; + total: number; + page: number; + page_size: number; } - diff --git a/webapp/src/app/api/model/allPatentsResponse.ts b/webapp/src/app/api/model/allPatentsResponse.ts index dfe6fb24..f9b5e8ad 100644 --- a/webapp/src/app/api/model/allPatentsResponse.ts +++ b/webapp/src/app/api/model/allPatentsResponse.ts @@ -1,7 +1,7 @@ /** * Innovation Search Engine API * - * + * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech @@ -9,11 +9,9 @@ */ import { PatentEntry } from './patentEntry'; - -export interface AllPatentsResponse { - total: number; - page: number; - size: number; - patents: Array; +export interface AllPatentsResponse { + total: number; + page: number; + size: number; + patents: Array; } - diff --git a/webapp/src/app/api/model/author.ts b/webapp/src/app/api/model/author.ts index 9ba12273..0a050590 100644 --- a/webapp/src/app/api/model/author.ts +++ b/webapp/src/app/api/model/author.ts @@ -1,7 +1,7 @@ /** * Innovation Search Engine API * - * + * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech @@ -15,27 +15,25 @@ import { AuthorIds } from './authorIds'; import { AuthorSummaryStats } from './authorSummaryStats'; import { WorkTopic } from './workTopic'; - /** * A person who creates scholarly works */ -export interface Author { - id?: string | null; - orcid?: string | null; - display_name?: string | null; - display_name_alternatives?: Array | null; - longest_name?: string | null; - parsed_longest_name?: AuthorParsedLongestName | null; - works_count?: number | null; - cited_by_count?: number | null; - summary_stats?: AuthorSummaryStats | null; - affiliations?: Array | null; - last_known_institutions?: Array | null; - topics?: Array | null; - counts_by_year?: Array | null; - ids?: AuthorIds | null; - works_api_url?: string | null; - created_date?: string | null; - updated_date?: string | null; +export interface Author { + id?: string | null; + orcid?: string | null; + display_name?: string | null; + display_name_alternatives?: Array | null; + longest_name?: string | null; + parsed_longest_name?: AuthorParsedLongestName | null; + works_count?: number | null; + cited_by_count?: number | null; + summary_stats?: AuthorSummaryStats | null; + affiliations?: Array | null; + last_known_institutions?: Array | null; + topics?: Array | null; + counts_by_year?: Array | null; + ids?: AuthorIds | null; + works_api_url?: string | null; + created_date?: string | null; + updated_date?: string | null; } - diff --git a/webapp/src/app/api/model/authorAffiliationsInner.ts b/webapp/src/app/api/model/authorAffiliationsInner.ts index 270443ff..d1e8f764 100644 --- a/webapp/src/app/api/model/authorAffiliationsInner.ts +++ b/webapp/src/app/api/model/authorAffiliationsInner.ts @@ -1,7 +1,7 @@ /** * Innovation Search Engine API * - * + * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech @@ -9,12 +9,10 @@ */ import { DehydratedInstitution } from './dehydratedInstitution'; - /** * AuthorAffiliationsInner */ -export interface AuthorAffiliationsInner { - institution?: DehydratedInstitution | null; - years?: Array | null; +export interface AuthorAffiliationsInner { + institution?: DehydratedInstitution | null; + years?: Array | null; } - diff --git a/webapp/src/app/api/model/authorCountsByYearInner.ts b/webapp/src/app/api/model/authorCountsByYearInner.ts index d16c7c21..1fac5b45 100644 --- a/webapp/src/app/api/model/authorCountsByYearInner.ts +++ b/webapp/src/app/api/model/authorCountsByYearInner.ts @@ -1,20 +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. */ - /** * AuthorCountsByYearInner */ -export interface AuthorCountsByYearInner { - year?: number | null; - works_count?: number | null; - cited_by_count?: number | null; +export interface AuthorCountsByYearInner { + year?: number | null; + works_count?: number | null; + cited_by_count?: number | null; } - diff --git a/webapp/src/app/api/model/authorIds.ts b/webapp/src/app/api/model/authorIds.ts index 9235a207..0b079d33 100644 --- a/webapp/src/app/api/model/authorIds.ts +++ b/webapp/src/app/api/model/authorIds.ts @@ -1,20 +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. */ - /** * External identifiers: */ -export interface AuthorIds { - openalex?: string | null; - orcid?: string | null; - scopus?: string | null; +export interface AuthorIds { + openalex?: string | null; + orcid?: string | null; + scopus?: string | null; } - diff --git a/webapp/src/app/api/model/authorNetworkNode.ts b/webapp/src/app/api/model/authorNetworkNode.ts index aee98d47..f67c7148 100644 --- a/webapp/src/app/api/model/authorNetworkNode.ts +++ b/webapp/src/app/api/model/authorNetworkNode.ts @@ -1,7 +1,7 @@ /** * Innovation Search Engine API * - * + * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech @@ -9,22 +9,18 @@ */ import { CollaborationNetworkNodeType } from './collaborationNetworkNodeType'; - -export interface AuthorNetworkNode { - /** - * The raw ID of the node. For an author node, this is the raw person ID. For an institution node, this is the raw institution ID. For a work node, this is the raw work ID. - */ - raw_id: string; - /** - * The display name of the node. - */ - display_name: string; - /** - * The category of the node, either \'author\', \'institution\', or \'work\'. - */ - category: CollaborationNetworkNodeType; +export interface AuthorNetworkNode { + /** + * The raw ID of the node. For an author node, this is the raw person ID. For an institution node, this is the raw institution ID. For a work node, this is the raw work ID. + */ + raw_id: string; + /** + * The display name of the node. + */ + display_name: string; + /** + * The category of the node, either \'author\', \'institution\', or \'work\'. + */ + category: CollaborationNetworkNodeType; } -export namespace AuthorNetworkNode { -} - - +export namespace AuthorNetworkNode {} diff --git a/webapp/src/app/api/model/authorParsedLongestName.ts b/webapp/src/app/api/model/authorParsedLongestName.ts index f49e04be..f08df27d 100644 --- a/webapp/src/app/api/model/authorParsedLongestName.ts +++ b/webapp/src/app/api/model/authorParsedLongestName.ts @@ -1,22 +1,20 @@ /** * Innovation Search Engine API * - * + * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech * Do not edit the class manually. */ - /** * The longest name parsed into its component parts. */ -export interface AuthorParsedLongestName { - first?: string | null; - middle?: string | null; - last?: string | null; - suffix?: string | null; - nickname?: string | null; +export interface AuthorParsedLongestName { + first?: string | null; + middle?: string | null; + last?: string | null; + suffix?: string | null; + nickname?: string | null; } - diff --git a/webapp/src/app/api/model/authorPositionCount.ts b/webapp/src/app/api/model/authorPositionCount.ts index a02e3749..989d2c18 100644 --- a/webapp/src/app/api/model/authorPositionCount.ts +++ b/webapp/src/app/api/model/authorPositionCount.ts @@ -1,18 +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 AuthorPositionCount { - first?: number; - middle?: number; - last?: number; - unknown?: number; +export interface AuthorPositionCount { + first?: number; + middle?: number; + last?: number; + unknown?: number; } - diff --git a/webapp/src/app/api/model/authorSummaryStats.ts b/webapp/src/app/api/model/authorSummaryStats.ts index 1cfc0bdb..63c35c31 100644 --- a/webapp/src/app/api/model/authorSummaryStats.ts +++ b/webapp/src/app/api/model/authorSummaryStats.ts @@ -1,7 +1,7 @@ /** * Innovation Search Engine API * - * + * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech @@ -9,13 +9,11 @@ */ import { Model2YrMeanCitedness } from './model2YrMeanCitedness'; - /** * Citation metrics: */ -export interface AuthorSummaryStats { - '2yr_mean_citedness'?: Model2YrMeanCitedness | null; - h_index?: number | null; - i10_index?: number | null; +export interface AuthorSummaryStats { + '2yr_mean_citedness'?: Model2YrMeanCitedness | null; + h_index?: number | null; + i10_index?: number | null; } - diff --git a/webapp/src/app/api/model/authorsFilterProperties.ts b/webapp/src/app/api/model/authorsFilterProperties.ts index 7312558f..50795f2a 100644 --- a/webapp/src/app/api/model/authorsFilterProperties.ts +++ b/webapp/src/app/api/model/authorsFilterProperties.ts @@ -1,26 +1,24 @@ /** * Innovation Search Engine API * - * + * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech * Do not edit the class manually. */ - -export interface AuthorsFilterProperties { - /** - * The list of raw institution IDs to include in the collaboration network. If empty, all institutions will be included. - */ - allowed_institutions?: Array; - /** - * The minimum number of collaborations required for an author to be included in the collaboration network. - */ - min_collaborations?: number; - /** - * The maximum number of collaborations allowed for an author to be included in the collaboration network. - */ - max_collaborations?: number; +export interface AuthorsFilterProperties { + /** + * The list of raw institution IDs to include in the collaboration network. If empty, all institutions will be included. + */ + allowed_institutions?: Array; + /** + * The minimum number of collaborations required for an author to be included in the collaboration network. + */ + min_collaborations?: number; + /** + * The maximum number of collaborations allowed for an author to be included in the collaboration network. + */ + max_collaborations?: number; } - diff --git a/webapp/src/app/api/model/authorsListResponse.ts b/webapp/src/app/api/model/authorsListResponse.ts index d309ae43..bb1a602c 100644 --- a/webapp/src/app/api/model/authorsListResponse.ts +++ b/webapp/src/app/api/model/authorsListResponse.ts @@ -1,7 +1,7 @@ /** * Innovation Search Engine API * - * + * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech @@ -11,13 +11,11 @@ import { Meta } from './meta'; import { Author } from './author'; import { GroupByResult } from './groupByResult'; - /** * AuthorsListResponse */ -export interface AuthorsListResponse { - meta?: Meta | null; - results?: Array | null; - group_by?: Array | null; +export interface AuthorsListResponse { + meta?: Meta | null; + results?: Array | null; + group_by?: Array | null; } - diff --git a/webapp/src/app/api/model/authorship.ts b/webapp/src/app/api/model/authorship.ts index db3a0bf0..f1b9d48e 100644 --- a/webapp/src/app/api/model/authorship.ts +++ b/webapp/src/app/api/model/authorship.ts @@ -1,7 +1,7 @@ /** * Innovation Search Engine API * - * + * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech @@ -10,17 +10,15 @@ import { DehydratedInstitution } from './dehydratedInstitution'; import { DehydratedAuthor } from './dehydratedAuthor'; - /** * Author and their affiliation for a work */ -export interface Authorship { - author_position?: string | null; - author?: DehydratedAuthor | null; - institutions?: Array | null; - countries?: Array | null; - is_corresponding?: boolean | null; - raw_author_name?: string | null; - raw_affiliation_strings?: Array | null; +export interface Authorship { + author_position?: string | null; + author?: DehydratedAuthor | null; + institutions?: Array | null; + countries?: Array | null; + is_corresponding?: boolean | null; + raw_author_name?: string | null; + raw_affiliation_strings?: Array | null; } - diff --git a/webapp/src/app/api/model/autocompleteResponse.ts b/webapp/src/app/api/model/autocompleteResponse.ts index e220f57b..8b52b300 100644 --- a/webapp/src/app/api/model/autocompleteResponse.ts +++ b/webapp/src/app/api/model/autocompleteResponse.ts @@ -1,7 +1,7 @@ /** * Innovation Search Engine API * - * + * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech @@ -10,12 +10,10 @@ import { AutocompleteResponseMeta } from './autocompleteResponseMeta'; import { AutocompleteResponseResultsInner } from './autocompleteResponseResultsInner'; - /** * AutocompleteResponse */ -export interface AutocompleteResponse { - meta?: AutocompleteResponseMeta | null; - results?: Array | null; +export interface AutocompleteResponse { + meta?: AutocompleteResponseMeta | null; + results?: Array | null; } - diff --git a/webapp/src/app/api/model/autocompleteResponseMeta.ts b/webapp/src/app/api/model/autocompleteResponseMeta.ts index 2e080d39..5bf94a57 100644 --- a/webapp/src/app/api/model/autocompleteResponseMeta.ts +++ b/webapp/src/app/api/model/autocompleteResponseMeta.ts @@ -1,19 +1,17 @@ /** * Innovation Search Engine API * - * + * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech * Do not edit the class manually. */ - /** * AutocompleteResponseMeta */ -export interface AutocompleteResponseMeta { - count?: number | null; - db_response_time_ms?: number | null; +export interface AutocompleteResponseMeta { + count?: number | null; + db_response_time_ms?: number | null; } - diff --git a/webapp/src/app/api/model/autocompleteResponseResultsInner.ts b/webapp/src/app/api/model/autocompleteResponseResultsInner.ts index 99ba71fe..0fa956b7 100644 --- a/webapp/src/app/api/model/autocompleteResponseResultsInner.ts +++ b/webapp/src/app/api/model/autocompleteResponseResultsInner.ts @@ -1,24 +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. */ - /** * AutocompleteResponseResultsInner */ -export interface AutocompleteResponseResultsInner { - id?: string | null; - display_name?: string | null; - hint?: string | null; - cited_by_count?: number | null; - works_count?: number | null; - entity_type?: string | null; - external_id?: string | null; +export interface AutocompleteResponseResultsInner { + id?: string | null; + display_name?: string | null; + hint?: string | null; + cited_by_count?: number | null; + works_count?: number | null; + entity_type?: string | null; + external_id?: string | null; } - diff --git a/webapp/src/app/api/model/award.ts b/webapp/src/app/api/model/award.ts index 4e3b5cc9..a461c971 100644 --- a/webapp/src/app/api/model/award.ts +++ b/webapp/src/app/api/model/award.ts @@ -1,23 +1,21 @@ /** * Innovation Search Engine API * - * + * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech * Do not edit the class manually. */ - /** * Award */ -export interface Award { - id?: string | null; - display_name?: string | null; - funder_award_id?: string | null; - funder_id?: string | null; - funder_display_name?: string | null; - doi?: string | null; +export interface Award { + id?: string | null; + display_name?: string | null; + funder_award_id?: string | null; + funder_id?: string | null; + funder_display_name?: string | null; + doi?: string | null; } - diff --git a/webapp/src/app/api/model/bodyChangePassword.ts b/webapp/src/app/api/model/bodyChangePassword.ts index b6454f0e..c76bafc4 100644 --- a/webapp/src/app/api/model/bodyChangePassword.ts +++ b/webapp/src/app/api/model/bodyChangePassword.ts @@ -1,22 +1,20 @@ /** * Innovation Search Engine API * - * + * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech * Do not edit the class manually. */ - -export interface BodyChangePassword { - /** - * Current password - */ - current_password: string; - /** - * New password - */ - new_password: string; +export interface BodyChangePassword { + /** + * Current password + */ + current_password: string; + /** + * New password + */ + new_password: string; } - diff --git a/webapp/src/app/api/model/bodyGetAccessToken.ts b/webapp/src/app/api/model/bodyGetAccessToken.ts index 8e5df2ed..3314146a 100644 --- a/webapp/src/app/api/model/bodyGetAccessToken.ts +++ b/webapp/src/app/api/model/bodyGetAccessToken.ts @@ -1,22 +1,20 @@ /** * Innovation Search Engine API * - * + * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech * Do not edit the class manually. */ - -export interface BodyGetAccessToken { - /** - * User\'s account ID - */ - real_account_id: string; - /** - * Effective account ID for the access token - */ - effective_account_id: string; +export interface BodyGetAccessToken { + /** + * User\'s account ID + */ + real_account_id: string; + /** + * Effective account ID for the access token + */ + effective_account_id: string; } - diff --git a/webapp/src/app/api/model/bodyLogin.ts b/webapp/src/app/api/model/bodyLogin.ts index f4022b0b..e4e8efd6 100644 --- a/webapp/src/app/api/model/bodyLogin.ts +++ b/webapp/src/app/api/model/bodyLogin.ts @@ -1,22 +1,20 @@ /** * Innovation Search Engine API * - * + * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech * Do not edit the class manually. */ - -export interface BodyLogin { - /** - * User\'s account ID - */ - account_id: string; - /** - * One-time code sent to user\'s email - */ - email_code: string; +export interface BodyLogin { + /** + * User\'s account ID + */ + account_id: string; + /** + * One-time code sent to user\'s email + */ + email_code: string; } - diff --git a/webapp/src/app/api/model/bundProject.ts b/webapp/src/app/api/model/bundProject.ts index 3463aa78..9f291399 100644 --- a/webapp/src/app/api/model/bundProject.ts +++ b/webapp/src/app/api/model/bundProject.ts @@ -1,42 +1,40 @@ /** * Innovation Search Engine API * - * + * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech * Do not edit the class manually. */ - -export interface BundProject { - funding_code?: string | null; - department?: string | null; - department_fullname?: string | null; - referat?: string | null; - project_sponsor?: string | null; - project_sponsor_fullname?: string | null; - work_unit?: string | null; - recipient?: string | null; - municipal_code?: string | null; - municipality?: string | null; - place?: string | null; - state?: string | null; - country?: string | null; - implementing_agency?: string | null; - topic?: string | null; - performance_plan_system?: string | null; - performance_plan_system_text?: string | null; - funding_start?: string | null; - funding_end?: string | null; - grant_amount?: number | null; - funding_profile?: string | null; - joint_project?: string | null; - funding_type?: string | null; - publication_date?: string | null; - unix_timestamp?: number | null; - date?: string | null; - 'new'?: boolean | null; - duration?: string | null; +export interface BundProject { + funding_code?: string | null; + department?: string | null; + department_fullname?: string | null; + referat?: string | null; + project_sponsor?: string | null; + project_sponsor_fullname?: string | null; + work_unit?: string | null; + recipient?: string | null; + municipal_code?: string | null; + municipality?: string | null; + place?: string | null; + state?: string | null; + country?: string | null; + implementing_agency?: string | null; + topic?: string | null; + performance_plan_system?: string | null; + performance_plan_system_text?: string | null; + funding_start?: string | null; + funding_end?: string | null; + grant_amount?: number | null; + funding_profile?: string | null; + joint_project?: string | null; + funding_type?: string | null; + publication_date?: string | null; + unix_timestamp?: number | null; + date?: string | null; + new?: boolean | null; + duration?: string | null; } - diff --git a/webapp/src/app/api/model/bundProjectDetails.ts b/webapp/src/app/api/model/bundProjectDetails.ts index 2193563c..b61df06b 100644 --- a/webapp/src/app/api/model/bundProjectDetails.ts +++ b/webapp/src/app/api/model/bundProjectDetails.ts @@ -1,57 +1,55 @@ /** * Innovation Search Engine API * - * + * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech * Do not edit the class manually. */ - /** * Clean summary model for a Bund (federal) project, consolidating all fields into semantic English names with proper native types. */ -export interface BundProjectDetails { - /** - * The ID of the Bund project - */ - id: string; - funding_reference?: string | null; - title?: string | null; - description?: string | null; - joint_project?: string | null; - funding_type?: string | null; - funding_profile?: string | null; - funding_amount?: number | null; - funding_start_date?: string | null; - funding_end_date?: string | null; - duration?: string | null; - performance_plan_code?: string | null; - performance_plan_fullname?: string | null; - executing_agency?: string | null; - funding_recipient?: string | null; - project_agency?: string | null; - project_agency_fullname?: string | null; - department?: string | null; - department_fullname?: string | null; - division?: string | null; - location?: string | null; - municipality?: string | null; - state?: string | null; - country?: string | null; - municipality_code?: string | null; - publication_date?: string | null; - is_new?: boolean | null; - record_date?: string | null; - unix_timestamp?: number | null; - /** - * All persons associated with the Bund project (from nested Arb object) - */ - associated_persons?: Array; - /** - * All institutions associated with the Bund project - */ - institutions?: Array; +export interface BundProjectDetails { + /** + * The ID of the Bund project + */ + id: string; + funding_reference?: string | null; + title?: string | null; + description?: string | null; + joint_project?: string | null; + funding_type?: string | null; + funding_profile?: string | null; + funding_amount?: number | null; + funding_start_date?: string | null; + funding_end_date?: string | null; + duration?: string | null; + performance_plan_code?: string | null; + performance_plan_fullname?: string | null; + executing_agency?: string | null; + funding_recipient?: string | null; + project_agency?: string | null; + project_agency_fullname?: string | null; + department?: string | null; + department_fullname?: string | null; + division?: string | null; + location?: string | null; + municipality?: string | null; + state?: string | null; + country?: string | null; + municipality_code?: string | null; + publication_date?: string | null; + is_new?: boolean | null; + record_date?: string | null; + unix_timestamp?: number | null; + /** + * All persons associated with the Bund project (from nested Arb object) + */ + associated_persons?: Array; + /** + * All institutions associated with the Bund project + */ + institutions?: Array; } - diff --git a/webapp/src/app/api/model/bundProjectPage.ts b/webapp/src/app/api/model/bundProjectPage.ts index 10514bce..6c38e7a6 100644 --- a/webapp/src/app/api/model/bundProjectPage.ts +++ b/webapp/src/app/api/model/bundProjectPage.ts @@ -1,7 +1,7 @@ /** * Innovation Search Engine API * - * + * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech @@ -9,23 +9,21 @@ */ import { BundProject } from './bundProject'; - -export interface BundProjectPage { - /** - * The current page number. - */ - page?: number; - /** - * The requested page size. - */ - size?: number; - /** - * The total number of items. - */ - total?: number; - /** - * The bund projects on this page. - */ - elements?: Array; +export interface BundProjectPage { + /** + * The current page number. + */ + page?: number; + /** + * The requested page size. + */ + size?: number; + /** + * The total number of items. + */ + total?: number; + /** + * The bund projects on this page. + */ + elements?: Array; } - diff --git a/webapp/src/app/api/model/careerMetrics.ts b/webapp/src/app/api/model/careerMetrics.ts index abb58689..eb84c19f 100644 --- a/webapp/src/app/api/model/careerMetrics.ts +++ b/webapp/src/app/api/model/careerMetrics.ts @@ -1,34 +1,32 @@ /** * Innovation Search Engine API * - * + * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech * Do not edit the class manually. */ - -export interface CareerMetrics { - first_publication_year?: number | null; - last_publication_year?: number | null; - career_age?: number | null; - career_span?: number | null; - career_stage?: string | null; - /** - * Number of distinct years with at least one publication. - */ - active_years?: number; - /** - * Number of publications used for career metrics. - */ - publication_count?: number; - publications_per_active_year?: number | null; - publications_per_career_year?: number | null; - years_since_last_publication?: number | null; - /** - * True if publication years look suspicious. - */ - has_suspicious_publication_years?: boolean; +export interface CareerMetrics { + first_publication_year?: number | null; + last_publication_year?: number | null; + career_age?: number | null; + career_span?: number | null; + career_stage?: string | null; + /** + * Number of distinct years with at least one publication. + */ + active_years?: number; + /** + * Number of publications used for career metrics. + */ + publication_count?: number; + publications_per_active_year?: number | null; + publications_per_career_year?: number | null; + years_since_last_publication?: number | null; + /** + * True if publication years look suspicious. + */ + has_suspicious_publication_years?: boolean; } - diff --git a/webapp/src/app/api/model/collaborationNetwork.ts b/webapp/src/app/api/model/collaborationNetwork.ts index e439c061..a2fbdc5b 100644 --- a/webapp/src/app/api/model/collaborationNetwork.ts +++ b/webapp/src/app/api/model/collaborationNetwork.ts @@ -1,7 +1,7 @@ /** * Innovation Search Engine API * - * + * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech @@ -13,31 +13,29 @@ import { CollaborationNetworkEdge } from './collaborationNetworkEdge'; import { InstitutionNetworkNode } from './institutionNetworkNode'; import { AuthorNetworkNode } from './authorNetworkNode'; - -export interface CollaborationNetwork { - /** - * The raw person ID of the person whose collaboration network this is. - */ - raw_person_id: string; - /** - * The work nodes in the collaboration network. - */ - work_nodes: Array; - /** - * The author nodes in the collaboration network. - */ - author_nodes: Array; - /** - * The institution nodes in the collaboration network. - */ - institution_nodes: Array; - /** - * The collaboration edges in the collaboration network. A collaboration edge represents a collaboration between two nodes. A -> W and A -> I - */ - collaboration_edges: Array; - /** - * The filter information for the collaboration network, including the minimum and maximum publication years of the works in the collaboration network. - */ - filter_information: FilterInformation; +export interface CollaborationNetwork { + /** + * The raw person ID of the person whose collaboration network this is. + */ + raw_person_id: string; + /** + * The work nodes in the collaboration network. + */ + work_nodes: Array; + /** + * The author nodes in the collaboration network. + */ + author_nodes: Array; + /** + * The institution nodes in the collaboration network. + */ + institution_nodes: Array; + /** + * The collaboration edges in the collaboration network. A collaboration edge represents a collaboration between two nodes. A -> W and A -> I + */ + collaboration_edges: Array; + /** + * The filter information for the collaboration network, including the minimum and maximum publication years of the works in the collaboration network. + */ + filter_information: FilterInformation; } - diff --git a/webapp/src/app/api/model/collaborationNetworkEdge.ts b/webapp/src/app/api/model/collaborationNetworkEdge.ts index 16fb5fc6..baffb178 100644 --- a/webapp/src/app/api/model/collaborationNetworkEdge.ts +++ b/webapp/src/app/api/model/collaborationNetworkEdge.ts @@ -1,22 +1,20 @@ /** * Innovation Search Engine API * - * + * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech * Do not edit the class manually. */ - -export interface CollaborationNetworkEdge { - /** - * The raw ID of the source node. - */ - raw_source_id: string; - /** - * The raw ID of the target node. - */ - raw_target_id: string; +export interface CollaborationNetworkEdge { + /** + * The raw ID of the source node. + */ + raw_source_id: string; + /** + * The raw ID of the target node. + */ + raw_target_id: string; } - diff --git a/webapp/src/app/api/model/collaborationNetworkNodeType.ts b/webapp/src/app/api/model/collaborationNetworkNodeType.ts index 752e35b0..3e673f35 100644 --- a/webapp/src/app/api/model/collaborationNetworkNodeType.ts +++ b/webapp/src/app/api/model/collaborationNetworkNodeType.ts @@ -1,18 +1,17 @@ /** * Innovation Search Engine API * - * + * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech * Do not edit the class manually. */ - export const CollaborationNetworkNodeType = { - Author: 'author', - Institution: 'institution', - Work: 'work' + Author: 'author', + Institution: 'institution', + Work: 'work', } as const; -export type CollaborationNetworkNodeType = typeof CollaborationNetworkNodeType[keyof typeof CollaborationNetworkNodeType]; - +export type CollaborationNetworkNodeType = + (typeof CollaborationNetworkNodeType)[keyof typeof CollaborationNetworkNodeType]; diff --git a/webapp/src/app/api/model/companyConnection.ts b/webapp/src/app/api/model/companyConnection.ts index 4ce31814..2824c543 100644 --- a/webapp/src/app/api/model/companyConnection.ts +++ b/webapp/src/app/api/model/companyConnection.ts @@ -1,7 +1,7 @@ /** * Innovation Search Engine API * - * + * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech @@ -9,19 +9,17 @@ */ import { MatchedOfficer } from './matchedOfficer'; - -export interface CompanyConnection { - company_number?: string | null; - company_name?: string | null; - company_status?: string | null; - register_art?: string | null; - register_nummer?: string | null; - native_company_number?: string | null; - registrar?: string | null; - registered_office?: string | null; - registered_address?: string | null; - retrieved_at?: string | null; - matched_officers?: Array; - officers?: Array; +export interface CompanyConnection { + company_number?: string | null; + company_name?: string | null; + company_status?: string | null; + register_art?: string | null; + register_nummer?: string | null; + native_company_number?: string | null; + registrar?: string | null; + registered_office?: string | null; + registered_address?: string | null; + retrieved_at?: string | null; + matched_officers?: Array; + officers?: Array; } - diff --git a/webapp/src/app/api/model/companyConnectionsResponse.ts b/webapp/src/app/api/model/companyConnectionsResponse.ts index 9beabd1e..f4f5f42f 100644 --- a/webapp/src/app/api/model/companyConnectionsResponse.ts +++ b/webapp/src/app/api/model/companyConnectionsResponse.ts @@ -1,7 +1,7 @@ /** * Innovation Search Engine API * - * + * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech @@ -9,17 +9,15 @@ */ import { CompanyConnection } from './companyConnection'; - -export interface CompanyConnectionsResponse { - author_id: string; - display_name?: string | null; - is_ude_author: boolean; - institution_scope?: string | null; - matching_institutions?: Array; - matching_method?: string | null; - company_count: number; - has_more_results: boolean; - common_name_warning: boolean; - connections?: Array; +export interface CompanyConnectionsResponse { + author_id: string; + display_name?: string | null; + is_ude_author: boolean; + institution_scope?: string | null; + matching_institutions?: Array; + matching_method?: string | null; + company_count: number; + has_more_results: boolean; + common_name_warning: boolean; + connections?: Array; } - diff --git a/webapp/src/app/api/model/cordisEuProject.ts b/webapp/src/app/api/model/cordisEuProject.ts index f18dd3d4..8d408ad6 100644 --- a/webapp/src/app/api/model/cordisEuProject.ts +++ b/webapp/src/app/api/model/cordisEuProject.ts @@ -1,7 +1,7 @@ /** * Innovation Search Engine API * - * + * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech @@ -10,32 +10,30 @@ import { Keywords } from './keywords'; import { Topics } from './topics'; - -export interface CordisEuProject { - /** - * Unique identifier for the project, typically the CORDIS ID - */ - id: string; - rcn?: string | null; - acronym?: string | null; - title?: string | null; - objective?: string | null; - frameworkProgramme?: string | null; - fundingScheme?: string | null; - legalBasis?: string | null; - masterCall?: string | null; - subCall?: string | null; - topics?: Topics | null; - nature?: string | null; - status?: string | null; - ecMaxContribution?: number | null; - totalCost?: number | null; - startDate?: string | null; - endDate?: string | null; - ecSignatureDate?: string | null; - contentUpdateDate?: string | null; - grantDoi?: string | null; - humanValidated?: boolean | null; - keywords?: Keywords | null; +export interface CordisEuProject { + /** + * Unique identifier for the project, typically the CORDIS ID + */ + id: string; + rcn?: string | null; + acronym?: string | null; + title?: string | null; + objective?: string | null; + frameworkProgramme?: string | null; + fundingScheme?: string | null; + legalBasis?: string | null; + masterCall?: string | null; + subCall?: string | null; + topics?: Topics | null; + nature?: string | null; + status?: string | null; + ecMaxContribution?: number | null; + totalCost?: number | null; + startDate?: string | null; + endDate?: string | null; + ecSignatureDate?: string | null; + contentUpdateDate?: string | null; + grantDoi?: string | null; + humanValidated?: boolean | null; + keywords?: Keywords | null; } - diff --git a/webapp/src/app/api/model/cordisEuProjectPage.ts b/webapp/src/app/api/model/cordisEuProjectPage.ts index 393f6db8..8dc900f7 100644 --- a/webapp/src/app/api/model/cordisEuProjectPage.ts +++ b/webapp/src/app/api/model/cordisEuProjectPage.ts @@ -1,7 +1,7 @@ /** * Innovation Search Engine API * - * + * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech @@ -9,23 +9,21 @@ */ import { CordisEuProject } from './cordisEuProject'; - -export interface CordisEuProjectPage { - /** - * The current page number. - */ - page?: number; - /** - * The requested page size. - */ - size?: number; - /** - * The total number of items. - */ - total?: number; - /** - * The CORDIS EU projects on this page. - */ - elements?: Array; +export interface CordisEuProjectPage { + /** + * The current page number. + */ + page?: number; + /** + * The requested page size. + */ + size?: number; + /** + * The total number of items. + */ + total?: number; + /** + * The CORDIS EU projects on this page. + */ + elements?: Array; } - diff --git a/webapp/src/app/api/model/costUsd.ts b/webapp/src/app/api/model/costUsd.ts index c7bcbee8..494cb094 100644 --- a/webapp/src/app/api/model/costUsd.ts +++ b/webapp/src/app/api/model/costUsd.ts @@ -1,17 +1,14 @@ /** * Innovation Search Engine API * - * + * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech * Do not edit the class manually. */ - /** * Cost of this request in USD */ -export interface CostUsd { -} - +export interface CostUsd {} diff --git a/webapp/src/app/api/model/createAccountRequest.ts b/webapp/src/app/api/model/createAccountRequest.ts index 3be9003b..320029cf 100644 --- a/webapp/src/app/api/model/createAccountRequest.ts +++ b/webapp/src/app/api/model/createAccountRequest.ts @@ -1,7 +1,7 @@ /** * Innovation Search Engine API * - * + * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech @@ -9,16 +9,12 @@ */ 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 {} diff --git a/webapp/src/app/api/model/customAuthor.ts b/webapp/src/app/api/model/customAuthor.ts index 0cf7eb21..6fd54c51 100644 --- a/webapp/src/app/api/model/customAuthor.ts +++ b/webapp/src/app/api/model/customAuthor.ts @@ -1,7 +1,7 @@ /** * Innovation Search Engine API * - * + * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech @@ -16,26 +16,24 @@ import { AuthorIds } from './authorIds'; import { AuthorSummaryStats } from './authorSummaryStats'; import { WorkTopic } from './workTopic'; - -export interface CustomAuthor { - id?: string | null; - orcid?: string | null; - display_name?: string | null; - display_name_alternatives?: Array | null; - longest_name?: string | null; - parsed_longest_name?: AuthorParsedLongestName | null; - works_count?: number | null; - cited_by_count?: number | null; - summary_stats?: AuthorSummaryStats | null; - affiliations?: Array | null; - last_known_institutions?: Array | null; - topics?: Array | null; - counts_by_year?: Array | null; - ids?: AuthorIds | null; - works_api_url?: string | null; - created_date?: string | null; - updated_date?: string | null; - relevance_rating?: string | null; - career_metrics?: CareerMetrics | null; +export interface CustomAuthor { + id?: string | null; + orcid?: string | null; + display_name?: string | null; + display_name_alternatives?: Array | null; + longest_name?: string | null; + parsed_longest_name?: AuthorParsedLongestName | null; + works_count?: number | null; + cited_by_count?: number | null; + summary_stats?: AuthorSummaryStats | null; + affiliations?: Array | null; + last_known_institutions?: Array | null; + topics?: Array | null; + counts_by_year?: Array | null; + ids?: AuthorIds | null; + works_api_url?: string | null; + created_date?: string | null; + updated_date?: string | null; + relevance_rating?: string | null; + career_metrics?: CareerMetrics | null; } - diff --git a/webapp/src/app/api/model/customAuthorsListResponse.ts b/webapp/src/app/api/model/customAuthorsListResponse.ts index 3c80ddf5..71f691a2 100644 --- a/webapp/src/app/api/model/customAuthorsListResponse.ts +++ b/webapp/src/app/api/model/customAuthorsListResponse.ts @@ -1,7 +1,7 @@ /** * Innovation Search Engine API * - * + * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech @@ -11,11 +11,9 @@ import { Meta } from './meta'; import { CustomAuthor } from './customAuthor'; import { GroupByResult } from './groupByResult'; - -export interface CustomAuthorsListResponse { - meta?: Meta | null; - results?: Array | null; - group_by?: Array | null; - placeholder?: CustomAuthor | null; +export interface CustomAuthorsListResponse { + meta?: Meta | null; + results?: Array | null; + group_by?: Array | null; + placeholder?: CustomAuthor | null; } - diff --git a/webapp/src/app/api/model/dehydratedAuthor.ts b/webapp/src/app/api/model/dehydratedAuthor.ts index 4d3817f1..350718ef 100644 --- a/webapp/src/app/api/model/dehydratedAuthor.ts +++ b/webapp/src/app/api/model/dehydratedAuthor.ts @@ -1,20 +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. */ - /** * [Dehydrated Author](/api-reference/authors#the-dehydratedauthor-object) — reduced-field version used in nested contexts */ -export interface DehydratedAuthor { - id?: string | null; - display_name?: string | null; - orcid?: string | null; +export interface DehydratedAuthor { + id?: string | null; + display_name?: string | null; + orcid?: string | null; } - diff --git a/webapp/src/app/api/model/dehydratedFunder.ts b/webapp/src/app/api/model/dehydratedFunder.ts index b134bbb1..c4231c13 100644 --- a/webapp/src/app/api/model/dehydratedFunder.ts +++ b/webapp/src/app/api/model/dehydratedFunder.ts @@ -1,20 +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. */ - /** * [Dehydrated Funder](/api-reference/funders) — reduced-field version used in nested contexts */ -export interface DehydratedFunder { - id?: string | null; - display_name?: string | null; - ror?: string | null; +export interface DehydratedFunder { + id?: string | null; + display_name?: string | null; + ror?: string | null; } - diff --git a/webapp/src/app/api/model/dehydratedInstitution.ts b/webapp/src/app/api/model/dehydratedInstitution.ts index 7b6c9824..956fc03e 100644 --- a/webapp/src/app/api/model/dehydratedInstitution.ts +++ b/webapp/src/app/api/model/dehydratedInstitution.ts @@ -1,23 +1,21 @@ /** * Innovation Search Engine API * - * + * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech * Do not edit the class manually. */ - /** * [Dehydrated Institution](/api-reference/institutions#the-dehydratedinstitution-object) — reduced-field version used in nested contexts */ -export interface DehydratedInstitution { - id?: string | null; - display_name?: string | null; - ror?: string | null; - country_code?: string | null; - type?: string | null; - lineage?: Array | null; +export interface DehydratedInstitution { + id?: string | null; + display_name?: string | null; + ror?: string | null; + country_code?: string | null; + type?: string | null; + lineage?: Array | null; } - diff --git a/webapp/src/app/api/model/dehydratedSource.ts b/webapp/src/app/api/model/dehydratedSource.ts index ae714846..b672b5dd 100644 --- a/webapp/src/app/api/model/dehydratedSource.ts +++ b/webapp/src/app/api/model/dehydratedSource.ts @@ -1,28 +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. */ - /** * [Dehydrated Source](/api-reference/sources#the-dehydratedsource-object) — reduced-field version used in nested contexts */ -export interface DehydratedSource { - id?: string | null; - display_name?: string | null; - issn_l?: string | null; - issn?: Array | null; - is_oa?: boolean | null; - is_in_doaj?: boolean | null; - is_core?: boolean | null; - host_organization?: string | null; - host_organization_name?: string | null; - host_organization_lineage?: Array | null; - type?: string | null; +export interface DehydratedSource { + id?: string | null; + display_name?: string | null; + issn_l?: string | null; + issn?: Array | null; + is_oa?: boolean | null; + is_in_doaj?: boolean | null; + is_core?: boolean | null; + host_organization?: string | null; + host_organization_name?: string | null; + host_organization_lineage?: Array | null; + type?: string | null; } - diff --git a/webapp/src/app/api/model/dfgProjectDetails.ts b/webapp/src/app/api/model/dfgProjectDetails.ts index 5fe29ff9..58ece5f7 100644 --- a/webapp/src/app/api/model/dfgProjectDetails.ts +++ b/webapp/src/app/api/model/dfgProjectDetails.ts @@ -1,41 +1,39 @@ /** * Innovation Search Engine API * - * + * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech * Do not edit the class manually. */ - /** * Clean summary model for a DFG project, consolidating all person roles and institution references into unified lists. */ -export interface DfgProjectDetails { - /** - * The ID of the DFG project - */ - id: string; - link?: string | null; - title?: string | null; - description?: string | null; - project_identifier?: string | null; - funding_start_date?: string | null; - funding_end_date?: string | null; - dfg_procedure?: string | null; - subject_area?: string | null; - funding_type?: string | null; - international_reference?: string | null; - website?: string | null; - /** - * All persons associated with the DFG project (any role) - */ - associated_persons?: Array; - /** - * All institutions associated with the DFG project - */ - institutions?: Array; - subproject_of?: string | null; +export interface DfgProjectDetails { + /** + * The ID of the DFG project + */ + id: string; + link?: string | null; + title?: string | null; + description?: string | null; + project_identifier?: string | null; + funding_start_date?: string | null; + funding_end_date?: string | null; + dfg_procedure?: string | null; + subject_area?: string | null; + funding_type?: string | null; + international_reference?: string | null; + website?: string | null; + /** + * All persons associated with the DFG project (any role) + */ + associated_persons?: Array; + /** + * All institutions associated with the DFG project + */ + institutions?: Array; + subproject_of?: string | null; } - diff --git a/webapp/src/app/api/model/dfgProjectPage.ts b/webapp/src/app/api/model/dfgProjectPage.ts index 8f67e170..a05d81d2 100644 --- a/webapp/src/app/api/model/dfgProjectPage.ts +++ b/webapp/src/app/api/model/dfgProjectPage.ts @@ -1,7 +1,7 @@ /** * Innovation Search Engine API * - * + * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech @@ -9,23 +9,21 @@ */ import { DfgProjectSummary } from './dfgProjectSummary'; - -export interface DfgProjectPage { - /** - * The current page number. - */ - page?: number; - /** - * The requested page size. - */ - size?: number; - /** - * The total number of items. - */ - total?: number; - /** - * The DFG projects on this page. - */ - elements?: Array; +export interface DfgProjectPage { + /** + * The current page number. + */ + page?: number; + /** + * The requested page size. + */ + size?: number; + /** + * The total number of items. + */ + total?: number; + /** + * The DFG projects on this page. + */ + elements?: Array; } - diff --git a/webapp/src/app/api/model/dfgProjectSummary.ts b/webapp/src/app/api/model/dfgProjectSummary.ts index 145dba4a..10c05a08 100644 --- a/webapp/src/app/api/model/dfgProjectSummary.ts +++ b/webapp/src/app/api/model/dfgProjectSummary.ts @@ -1,27 +1,25 @@ /** * Innovation Search Engine API * - * + * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech * Do not edit the class manually. */ - -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; +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; } - diff --git a/webapp/src/app/api/model/euCordisProjectResponse.ts b/webapp/src/app/api/model/euCordisProjectResponse.ts index 63e9084d..f0dc272a 100644 --- a/webapp/src/app/api/model/euCordisProjectResponse.ts +++ b/webapp/src/app/api/model/euCordisProjectResponse.ts @@ -1,7 +1,7 @@ /** * Innovation Search Engine API * - * + * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech @@ -9,17 +9,15 @@ */ import { EuProjectData } from './euProjectData'; - /** * Response model for EU Cordis project endpoints. */ -export interface EuCordisProjectResponse { - /** - * Indicates if the request was successful - */ - success: boolean; - project_type?: string | null; - eu_project_data?: EuProjectData | null; - error?: string | null; +export interface EuCordisProjectResponse { + /** + * Indicates if the request was successful + */ + success: boolean; + project_type?: string | null; + eu_project_data?: EuProjectData | null; + error?: string | null; } - diff --git a/webapp/src/app/api/model/euOrganizationProjectSummary.ts b/webapp/src/app/api/model/euOrganizationProjectSummary.ts index 3cc10f0a..af085ff3 100644 --- a/webapp/src/app/api/model/euOrganizationProjectSummary.ts +++ b/webapp/src/app/api/model/euOrganizationProjectSummary.ts @@ -1,27 +1,25 @@ /** * Innovation Search Engine API * - * + * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech * Do not edit the class manually. */ - -export interface EuOrganizationProjectSummary { - /** - * The unique identifier of the organization. - */ - organization_id: string; - /** - * The unique identifier of the project. - */ - project_id: string; - title?: string | null; - start_date?: string | null; - end_date?: string | null; - acronym?: string | null; - ec_contribution?: number | null; +export interface EuOrganizationProjectSummary { + /** + * The unique identifier of the organization. + */ + organization_id: string; + /** + * The unique identifier of the project. + */ + project_id: string; + title?: string | null; + start_date?: string | null; + end_date?: string | null; + acronym?: string | null; + ec_contribution?: number | null; } - diff --git a/webapp/src/app/api/model/euOrganizationProjectSummaryPage.ts b/webapp/src/app/api/model/euOrganizationProjectSummaryPage.ts index 9d57d5b4..90166a7e 100644 --- a/webapp/src/app/api/model/euOrganizationProjectSummaryPage.ts +++ b/webapp/src/app/api/model/euOrganizationProjectSummaryPage.ts @@ -1,7 +1,7 @@ /** * Innovation Search Engine API * - * + * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech @@ -9,23 +9,21 @@ */ import { EuOrganizationProjectSummary } from './euOrganizationProjectSummary'; - -export interface EuOrganizationProjectSummaryPage { - /** - * The current page number. - */ - page?: number; - /** - * The requested page size. - */ - size?: number; - /** - * The total number of items. - */ - total?: number; - /** - * The organization project summaries on this page. - */ - elements?: Array; +export interface EuOrganizationProjectSummaryPage { + /** + * The current page number. + */ + page?: number; + /** + * The requested page size. + */ + size?: number; + /** + * The total number of items. + */ + total?: number; + /** + * The organization project summaries on this page. + */ + elements?: Array; } - diff --git a/webapp/src/app/api/model/euProjectData.ts b/webapp/src/app/api/model/euProjectData.ts index 6acedaf5..34639d19 100644 --- a/webapp/src/app/api/model/euProjectData.ts +++ b/webapp/src/app/api/model/euProjectData.ts @@ -1,7 +1,7 @@ /** * Innovation Search Engine API * - * + * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech @@ -23,49 +23,47 @@ import { Fp7ReportSummary } from './fp7ReportSummary'; import { HEUReportSummary } from './hEUReportSummary'; import { HEUProjectDetails } from './hEUProjectDetails'; - /** * The project data */ -export interface EuProjectData { - acronym?: string; - contentUpdateDate?: string; - ecMaxContribution?: number; - ecSignatureDate?: string; - endDate?: string; - frameworkProgramme?: string; - fundingScheme?: string; - grantDoi?: string; - humanValidated?: boolean; - id?: string; - keywords?: string; - legalBasis?: string; - masterCall?: string; - nature?: string; - objective?: string; - rcn?: string; - startDate?: string; - status?: string; - subCall?: string; - title?: string; - topics?: string; - totalCost?: number; - organizations?: Array; - publications?: Array; - iprs?: Array; - report_summaries?: Array; - topicsList?: Array; - web_links?: Array; - eurosciVoc?: Array; - legalBasisList?: Array; - organizationCount?: number; - publicationCount?: number; - iprCount?: number; - deliverables?: Array; - reportSummaries?: Array; - webLinks?: Array; - ercPrincipalInvestigators?: Array; - deliverableCount?: number; - ercPiCount?: number; +export interface EuProjectData { + acronym?: string; + contentUpdateDate?: string; + ecMaxContribution?: number; + ecSignatureDate?: string; + endDate?: string; + frameworkProgramme?: string; + fundingScheme?: string; + grantDoi?: string; + humanValidated?: boolean; + id?: string; + keywords?: string; + legalBasis?: string; + masterCall?: string; + nature?: string; + objective?: string; + rcn?: string; + startDate?: string; + status?: string; + subCall?: string; + title?: string; + topics?: string; + totalCost?: number; + organizations?: Array; + publications?: Array; + iprs?: Array; + report_summaries?: Array; + topicsList?: Array; + web_links?: Array; + eurosciVoc?: Array; + legalBasisList?: Array; + organizationCount?: number; + publicationCount?: number; + iprCount?: number; + deliverables?: Array; + reportSummaries?: Array; + webLinks?: Array; + ercPrincipalInvestigators?: Array; + deliverableCount?: number; + ercPiCount?: number; } - diff --git a/webapp/src/app/api/model/filterInformation.ts b/webapp/src/app/api/model/filterInformation.ts index b2078376..1c4af66d 100644 --- a/webapp/src/app/api/model/filterInformation.ts +++ b/webapp/src/app/api/model/filterInformation.ts @@ -1,7 +1,7 @@ /** * Innovation Search Engine API * - * + * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech @@ -10,23 +10,21 @@ import { InstitutionInformation } from './institutionInformation'; import { WorkTopicInformation } from './workTopicInformation'; - -export interface FilterInformation { - /** - * The minimum publication year of the works in the collaboration network. - */ - min_possible_year: number; - /** - * The maximum publication year of the works in the collaboration network. - */ - max_possible_year: number; - /** - * The list of institutions associated with the works in the collaboration network. - */ - institutions: Array; - /** - * The list of topics associated with the works in the collaboration network. - */ - topics: Array; +export interface FilterInformation { + /** + * The minimum publication year of the works in the collaboration network. + */ + min_possible_year: number; + /** + * The maximum publication year of the works in the collaboration network. + */ + max_possible_year: number; + /** + * The list of institutions associated with the works in the collaboration network. + */ + institutions: Array; + /** + * The list of topics associated with the works in the collaboration network. + */ + topics: Array; } - diff --git a/webapp/src/app/api/model/filterProperties.ts b/webapp/src/app/api/model/filterProperties.ts index 608acab4..7caac0b6 100644 --- a/webapp/src/app/api/model/filterProperties.ts +++ b/webapp/src/app/api/model/filterProperties.ts @@ -1,7 +1,7 @@ /** * Innovation Search Engine API * - * + * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech @@ -10,13 +10,11 @@ import { WorksFilterProperties } from './worksFilterProperties'; import { AuthorsFilterProperties } from './authorsFilterProperties'; - -export interface FilterProperties { - /** - * The type of filter to apply when generating the collaboration network. Can be either \'works\' or \'authors\'. If \'works\', the filter properties in the \'works_filter_properties\' field will be used. If \'authors\', the filter properties in the \'authors_filter_properties\' field will be used. - */ - filter_by?: string; - works_filter_properties: WorksFilterProperties | null; - authors_filter_properties: AuthorsFilterProperties | null; +export interface FilterProperties { + /** + * The type of filter to apply when generating the collaboration network. Can be either \'works\' or \'authors\'. If \'works\', the filter properties in the \'works_filter_properties\' field will be used. If \'authors\', the filter properties in the \'authors_filter_properties\' field will be used. + */ + filter_by?: string; + works_filter_properties: WorksFilterProperties | null; + authors_filter_properties: AuthorsFilterProperties | null; } - diff --git a/webapp/src/app/api/model/fp7EurosciVoc.ts b/webapp/src/app/api/model/fp7EurosciVoc.ts index fb7e8deb..14ae95bc 100644 --- a/webapp/src/app/api/model/fp7EurosciVoc.ts +++ b/webapp/src/app/api/model/fp7EurosciVoc.ts @@ -1,23 +1,21 @@ /** * Innovation Search Engine API * - * + * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech * Do not edit the class manually. */ - /** * Fp7EurosciVoc */ -export interface Fp7EurosciVoc { - code?: string | null; - description?: string | null; - id?: string | null; - path?: string | null; - projectID?: string | null; - title?: string | null; +export interface Fp7EurosciVoc { + code?: string | null; + description?: string | null; + id?: string | null; + path?: string | null; + projectID?: string | null; + title?: string | null; } - diff --git a/webapp/src/app/api/model/fp7LegalBasis.ts b/webapp/src/app/api/model/fp7LegalBasis.ts index 89a05742..bf5ef53e 100644 --- a/webapp/src/app/api/model/fp7LegalBasis.ts +++ b/webapp/src/app/api/model/fp7LegalBasis.ts @@ -1,22 +1,20 @@ /** * Innovation Search Engine API * - * + * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech * Do not edit the class manually. */ - /** * Fp7LegalBasis */ -export interface Fp7LegalBasis { - id?: string | null; - legalBasis?: string | null; - projectID?: string | null; - title?: string | null; - uniqueProgrammePart?: string | null; +export interface Fp7LegalBasis { + id?: string | null; + legalBasis?: string | null; + projectID?: string | null; + title?: string | null; + uniqueProgrammePart?: string | null; } - diff --git a/webapp/src/app/api/model/fp7Organization.ts b/webapp/src/app/api/model/fp7Organization.ts index 2989a873..a46d9d02 100644 --- a/webapp/src/app/api/model/fp7Organization.ts +++ b/webapp/src/app/api/model/fp7Organization.ts @@ -1,43 +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. */ - /** * Fp7Organization */ -export interface Fp7Organization { - SME?: boolean | null; - active?: boolean | null; - activityType?: string | null; - city?: string | null; - contactForm?: string | null; - contentUpdateDate?: string | null; - country?: string | null; - ecContribution?: number | null; - endOfParticipation?: boolean | null; - geolocation?: string | null; - id?: string | null; - name?: string | null; - netEcContribution?: number | null; - nutsCode?: string | null; - order?: number | null; - organisationID?: string | null; - organizationURL?: string | null; - postCode?: string | null; - projectAcronym?: string | null; - projectID?: string | null; - rcn?: string | null; - role?: string | null; - shortName?: string | null; - street?: string | null; - totalCost?: number | null; - vatNumber?: string | null; +export interface Fp7Organization { + SME?: boolean | null; + active?: boolean | null; + activityType?: string | null; + city?: string | null; + contactForm?: string | null; + contentUpdateDate?: string | null; + country?: string | null; + ecContribution?: number | null; + endOfParticipation?: boolean | null; + geolocation?: string | null; + id?: string | null; + name?: string | null; + netEcContribution?: number | null; + nutsCode?: string | null; + order?: number | null; + organisationID?: string | null; + organizationURL?: string | null; + postCode?: string | null; + projectAcronym?: string | null; + projectID?: string | null; + rcn?: string | null; + role?: string | null; + shortName?: string | null; + street?: string | null; + totalCost?: number | null; + vatNumber?: string | null; } - diff --git a/webapp/src/app/api/model/fp7ProjectDetails.ts b/webapp/src/app/api/model/fp7ProjectDetails.ts index a7dce634..034a986d 100644 --- a/webapp/src/app/api/model/fp7ProjectDetails.ts +++ b/webapp/src/app/api/model/fp7ProjectDetails.ts @@ -1,7 +1,7 @@ /** * Innovation Search Engine API * - * + * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech @@ -16,43 +16,41 @@ import { Fp7ProjectIPR } from './fp7ProjectIPR'; import { Fp7Organization } from './fp7Organization'; import { Fp7LegalBasis } from './fp7LegalBasis'; - /** * Comprehensive FP7 Project model combining all related entities. This model extends the base Fp7Project with all associated data. */ -export interface Fp7ProjectDetails { - acronym?: string | null; - contentUpdateDate?: string | null; - ecMaxContribution?: number | null; - ecSignatureDate?: string | null; - endDate?: string | null; - frameworkProgramme?: string | null; - fundingScheme?: string | null; - grantDoi?: string | null; - humanValidated?: boolean | null; - id?: string | null; - keywords?: string | null; - legalBasis?: string | null; - masterCall?: string | null; - nature?: string | null; - objective?: string | null; - rcn?: string | null; - startDate?: string | null; - status?: string | null; - subCall?: string | null; - title?: string | null; - topics?: string | null; - totalCost?: number | null; - organizations?: Array | null; - publications?: Array | null; - iprs?: Array | null; - report_summaries?: Array | null; - topicsList?: Array | null; - web_links?: Array | null; - eurosciVoc?: Array | null; - legalBasisList?: Array | null; - organizationCount?: number | null; - publicationCount?: number | null; - iprCount?: number | null; +export interface Fp7ProjectDetails { + acronym?: string | null; + contentUpdateDate?: string | null; + ecMaxContribution?: number | null; + ecSignatureDate?: string | null; + endDate?: string | null; + frameworkProgramme?: string | null; + fundingScheme?: string | null; + grantDoi?: string | null; + humanValidated?: boolean | null; + id?: string | null; + keywords?: string | null; + legalBasis?: string | null; + masterCall?: string | null; + nature?: string | null; + objective?: string | null; + rcn?: string | null; + startDate?: string | null; + status?: string | null; + subCall?: string | null; + title?: string | null; + topics?: string | null; + totalCost?: number | null; + organizations?: Array | null; + publications?: Array | null; + iprs?: Array | null; + report_summaries?: Array | null; + topicsList?: Array | null; + web_links?: Array | null; + eurosciVoc?: Array | null; + legalBasisList?: Array | null; + organizationCount?: number | null; + publicationCount?: number | null; + iprCount?: number | null; } - diff --git a/webapp/src/app/api/model/fp7ProjectIPR.ts b/webapp/src/app/api/model/fp7ProjectIPR.ts index f35487c4..37040026 100644 --- a/webapp/src/app/api/model/fp7ProjectIPR.ts +++ b/webapp/src/app/api/model/fp7ProjectIPR.ts @@ -1,36 +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. */ - /** * Fp7ProjectIPR */ -export interface Fp7ProjectIPR { - applicantName?: string | null; - applicationDate?: string | null; - applicationIdentifier?: string | null; - applicationKind?: string | null; - applicationPrefix?: string | null; - awardDate?: string | null; - awardIdentifier?: string | null; - awardKind?: string | null; - awardPrefix?: string | null; - epoAppUrl?: string | null; - epoPubUrl?: string | null; - id?: string | null; - organisationID?: string | null; - patentFamilyIdentifier?: string | null; - patentType?: string | null; - priorityDate?: string | null; - projectID?: string | null; - title?: string | null; - type?: string | null; +export interface Fp7ProjectIPR { + applicantName?: string | null; + applicationDate?: string | null; + applicationIdentifier?: string | null; + applicationKind?: string | null; + applicationPrefix?: string | null; + awardDate?: string | null; + awardIdentifier?: string | null; + awardKind?: string | null; + awardPrefix?: string | null; + epoAppUrl?: string | null; + epoPubUrl?: string | null; + id?: string | null; + organisationID?: string | null; + patentFamilyIdentifier?: string | null; + patentType?: string | null; + priorityDate?: string | null; + projectID?: string | null; + title?: string | null; + type?: string | null; } - diff --git a/webapp/src/app/api/model/fp7Publication.ts b/webapp/src/app/api/model/fp7Publication.ts index fd0e2491..34fba260 100644 --- a/webapp/src/app/api/model/fp7Publication.ts +++ b/webapp/src/app/api/model/fp7Publication.ts @@ -1,35 +1,33 @@ /** * Innovation Search Engine API * - * + * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech * Do not edit the class manually. */ - /** * Fp7Publication */ -export interface Fp7Publication { - authors?: string | null; - collection?: string | null; - contentUpdateDate?: string | null; - doi?: string | null; - id?: string | null; - isPublishedAs?: string | null; - journalNumber?: string | null; - journalTitle?: string | null; - projectAcronym?: string | null; - projectID?: string | null; - publishedPages?: string | null; - publishedYear?: number | null; - publisher?: string | null; - qaProcessedDoi?: string | null; - rcn?: string | null; - repositoryUrl?: string | null; - title?: string | null; - volume?: string | null; +export interface Fp7Publication { + authors?: string | null; + collection?: string | null; + contentUpdateDate?: string | null; + doi?: string | null; + id?: string | null; + isPublishedAs?: string | null; + journalNumber?: string | null; + journalTitle?: string | null; + projectAcronym?: string | null; + projectID?: string | null; + publishedPages?: string | null; + publishedYear?: number | null; + publisher?: string | null; + qaProcessedDoi?: string | null; + rcn?: string | null; + repositoryUrl?: string | null; + title?: string | null; + volume?: string | null; } - diff --git a/webapp/src/app/api/model/fp7ReportSummary.ts b/webapp/src/app/api/model/fp7ReportSummary.ts index f0413439..084d2ba8 100644 --- a/webapp/src/app/api/model/fp7ReportSummary.ts +++ b/webapp/src/app/api/model/fp7ReportSummary.ts @@ -1,24 +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. */ - /** * Fp7ReportSummary */ -export interface Fp7ReportSummary { - attachments?: string | null; - contentUpdateDate?: string | null; - id?: string | null; - projectAcronym?: string | null; - projectID?: string | null; - rcn?: string | null; - title?: string | null; +export interface Fp7ReportSummary { + attachments?: string | null; + contentUpdateDate?: string | null; + id?: string | null; + projectAcronym?: string | null; + projectID?: string | null; + rcn?: string | null; + title?: string | null; } - diff --git a/webapp/src/app/api/model/fp7Topic.ts b/webapp/src/app/api/model/fp7Topic.ts index f39a021e..4202cdb0 100644 --- a/webapp/src/app/api/model/fp7Topic.ts +++ b/webapp/src/app/api/model/fp7Topic.ts @@ -1,21 +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. */ - /** * Fp7Topic */ -export interface Fp7Topic { - id?: string | null; - projectID?: string | null; - title?: string | null; - topic?: string | null; +export interface Fp7Topic { + id?: string | null; + projectID?: string | null; + title?: string | null; + topic?: string | null; } - diff --git a/webapp/src/app/api/model/fp7WebLink.ts b/webapp/src/app/api/model/fp7WebLink.ts index eeaff7ab..67071bb8 100644 --- a/webapp/src/app/api/model/fp7WebLink.ts +++ b/webapp/src/app/api/model/fp7WebLink.ts @@ -1,27 +1,25 @@ /** * Innovation Search Engine API * - * + * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech * Do not edit the class manually. */ - /** * Fp7WebLink */ -export interface Fp7WebLink { - archivedDate?: string | null; - availableLanguages?: string | null; - id?: string | null; - linkId?: string | null; - projectID?: string | null; - represents?: string | null; - source?: string | null; - status?: string | null; - type?: string | null; - url?: string | null; +export interface Fp7WebLink { + archivedDate?: string | null; + availableLanguages?: string | null; + id?: string | null; + linkId?: string | null; + projectID?: string | null; + represents?: string | null; + source?: string | null; + status?: string | null; + type?: string | null; + url?: string | null; } - diff --git a/webapp/src/app/api/model/funderByAuthor.ts b/webapp/src/app/api/model/funderByAuthor.ts index 247e5629..c62110e7 100644 --- a/webapp/src/app/api/model/funderByAuthor.ts +++ b/webapp/src/app/api/model/funderByAuthor.ts @@ -1,7 +1,7 @@ /** * Innovation Search Engine API * - * + * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech @@ -11,15 +11,13 @@ import { PublicationIdsByAuthorPosition } from './publicationIdsByAuthorPosition import { AuthorPositionCount } from './authorPositionCount'; import { PublicationDetailByFunder } from './publicationDetailByFunder'; - -export interface FunderByAuthor { - funder_id?: string | null; - funder_name?: string | null; - publication_count: number; - author_position_count: AuthorPositionCount; - publication_ids: PublicationIdsByAuthorPosition; - publication_urls?: { [key: string]: string; }; - publication_titles?: { [key: string]: string; }; - publication_details?: { [key: string]: PublicationDetailByFunder; }; +export interface FunderByAuthor { + funder_id?: string | null; + funder_name?: string | null; + publication_count: number; + author_position_count: AuthorPositionCount; + publication_ids: PublicationIdsByAuthorPosition; + publication_urls?: { [key: string]: string }; + publication_titles?: { [key: string]: string }; + publication_details?: { [key: string]: PublicationDetailByFunder }; } - diff --git a/webapp/src/app/api/model/fundersByAuthorResponse.ts b/webapp/src/app/api/model/fundersByAuthorResponse.ts index 1286429e..d6e0e02f 100644 --- a/webapp/src/app/api/model/fundersByAuthorResponse.ts +++ b/webapp/src/app/api/model/fundersByAuthorResponse.ts @@ -1,7 +1,7 @@ /** * Innovation Search Engine API * - * + * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech @@ -9,11 +9,9 @@ */ import { FunderByAuthor } from './funderByAuthor'; - -export interface FundersByAuthorResponse { - author_id: string; - author_name?: string | null; - funder_count: number; - funders: Array; +export interface FundersByAuthorResponse { + author_id: string; + author_name?: string | null; + funder_count: number; + funders: Array; } - diff --git a/webapp/src/app/api/model/fundingProject.ts b/webapp/src/app/api/model/fundingProject.ts index a53c64f1..fb8204e3 100644 --- a/webapp/src/app/api/model/fundingProject.ts +++ b/webapp/src/app/api/model/fundingProject.ts @@ -1,7 +1,7 @@ /** * Innovation Search Engine API * - * + * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech @@ -9,23 +9,19 @@ */ import { ProjectType } from './projectType'; - -export interface FundingProject { - /** - * The type of the project. - */ - type: ProjectType; - /** - * The unique identifier of the project. - */ - id: string; - title?: string | null; - acronym?: string | null; - start_date?: string | null; - end_date?: string | null; - funding_amount?: number | null; +export interface FundingProject { + /** + * The type of the project. + */ + type: ProjectType; + /** + * The unique identifier of the project. + */ + id: string; + title?: string | null; + acronym?: string | null; + start_date?: string | null; + end_date?: string | null; + funding_amount?: number | null; } -export namespace FundingProject { -} - - +export namespace FundingProject {} diff --git a/webapp/src/app/api/model/fundingProjectPage.ts b/webapp/src/app/api/model/fundingProjectPage.ts index db43c9c4..e0996525 100644 --- a/webapp/src/app/api/model/fundingProjectPage.ts +++ b/webapp/src/app/api/model/fundingProjectPage.ts @@ -1,7 +1,7 @@ /** * Innovation Search Engine API * - * + * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech @@ -9,23 +9,21 @@ */ import { FundingProject } from './fundingProject'; - -export interface FundingProjectPage { - /** - * The current page number. - */ - page?: number; - /** - * The requested page size. - */ - size?: number; - /** - * The total number of items. - */ - total?: number; - /** - * The funding projects on this page. - */ - elements?: Array; +export interface FundingProjectPage { + /** + * The current page number. + */ + page?: number; + /** + * The requested page size. + */ + size?: number; + /** + * The total number of items. + */ + total?: number; + /** + * The funding projects on this page. + */ + elements?: Array; } - diff --git a/webapp/src/app/api/model/fwci.ts b/webapp/src/app/api/model/fwci.ts index 0c0cf8de..bd7eea69 100644 --- a/webapp/src/app/api/model/fwci.ts +++ b/webapp/src/app/api/model/fwci.ts @@ -1,17 +1,14 @@ /** * Innovation Search Engine API * - * + * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech * Do not edit the class manually. */ - /** * Field-weighted Citation Impact, calculated as citations received / citations expected. */ -export interface Fwci { -} - +export interface Fwci {} diff --git a/webapp/src/app/api/model/groupByResult.ts b/webapp/src/app/api/model/groupByResult.ts index 68c51855..98580663 100644 --- a/webapp/src/app/api/model/groupByResult.ts +++ b/webapp/src/app/api/model/groupByResult.ts @@ -1,20 +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. */ - /** * GroupByResult */ -export interface GroupByResult { - key?: string | null; - key_display_name?: string | null; - count?: number | null; +export interface GroupByResult { + key?: string | null; + key_display_name?: string | null; + count?: number | null; } - diff --git a/webapp/src/app/api/model/h2020Deliverable.ts b/webapp/src/app/api/model/h2020Deliverable.ts index 390d2c7a..ccb837a1 100644 --- a/webapp/src/app/api/model/h2020Deliverable.ts +++ b/webapp/src/app/api/model/h2020Deliverable.ts @@ -1,25 +1,23 @@ /** * Innovation Search Engine API * - * + * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech * Do not edit the class manually. */ - /** * H2020Deliverable */ -export interface H2020Deliverable { - collection?: string | null; - contentUpdateDate?: string | null; - deliverableType?: string | null; - description?: string | null; - projectAcronym?: string | null; - projectID?: string | null; - rcn?: string | null; - url?: string | null; +export interface H2020Deliverable { + collection?: string | null; + contentUpdateDate?: string | null; + deliverableType?: string | null; + description?: string | null; + projectAcronym?: string | null; + projectID?: string | null; + rcn?: string | null; + url?: string | null; } - diff --git a/webapp/src/app/api/model/h2020ErcPI.ts b/webapp/src/app/api/model/h2020ErcPI.ts index 48ae3ff0..d6e2324e 100644 --- a/webapp/src/app/api/model/h2020ErcPI.ts +++ b/webapp/src/app/api/model/h2020ErcPI.ts @@ -1,25 +1,23 @@ /** * Innovation Search Engine API * - * + * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech * Do not edit the class manually. */ - /** * H2020ErcPI */ -export interface H2020ErcPI { - firstName?: string | null; - fundingScheme?: string | null; - id?: string | null; - lastName?: string | null; - organisationID?: string | null; - projectAcronym?: string | null; - projectID?: string | null; - title?: string | null; +export interface H2020ErcPI { + firstName?: string | null; + fundingScheme?: string | null; + id?: string | null; + lastName?: string | null; + organisationID?: string | null; + projectAcronym?: string | null; + projectID?: string | null; + title?: string | null; } - diff --git a/webapp/src/app/api/model/h2020EurosciVoc.ts b/webapp/src/app/api/model/h2020EurosciVoc.ts index 7d1ea931..b275e94e 100644 --- a/webapp/src/app/api/model/h2020EurosciVoc.ts +++ b/webapp/src/app/api/model/h2020EurosciVoc.ts @@ -1,23 +1,21 @@ /** * Innovation Search Engine API * - * + * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech * Do not edit the class manually. */ - /** * H2020EurosciVoc */ -export interface H2020EurosciVoc { - code?: string | null; - description?: string | null; - id?: string | null; - path?: string | null; - projectID?: string | null; - title?: string | null; +export interface H2020EurosciVoc { + code?: string | null; + description?: string | null; + id?: string | null; + path?: string | null; + projectID?: string | null; + title?: string | null; } - diff --git a/webapp/src/app/api/model/h2020LegalBasis.ts b/webapp/src/app/api/model/h2020LegalBasis.ts index d247488d..e5846466 100644 --- a/webapp/src/app/api/model/h2020LegalBasis.ts +++ b/webapp/src/app/api/model/h2020LegalBasis.ts @@ -1,22 +1,20 @@ /** * Innovation Search Engine API * - * + * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech * Do not edit the class manually. */ - /** * H2020LegalBasis */ -export interface H2020LegalBasis { - id?: string | null; - legalBasis?: string | null; - projectID?: string | null; - title?: string | null; - uniqueProgrammePart?: string | null; +export interface H2020LegalBasis { + id?: string | null; + legalBasis?: string | null; + projectID?: string | null; + title?: string | null; + uniqueProgrammePart?: string | null; } - diff --git a/webapp/src/app/api/model/h2020Organization.ts b/webapp/src/app/api/model/h2020Organization.ts index 003a00ed..26a5acb9 100644 --- a/webapp/src/app/api/model/h2020Organization.ts +++ b/webapp/src/app/api/model/h2020Organization.ts @@ -1,43 +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. */ - /** * H2020Organization */ -export interface H2020Organization { - SME?: boolean | null; - active?: boolean | null; - activityType?: string | null; - city?: string | null; - contactForm?: string | null; - contentUpdateDate?: string | null; - country?: string | null; - ecContribution?: number | null; - endOfParticipation?: boolean | null; - geolocation?: string | null; - id?: string | null; - name?: string | null; - netEcContribution?: number | null; - nutsCode?: string | null; - order?: number | null; - organisationID?: string | null; - organizationURL?: string | null; - postCode?: string | null; - projectAcronym?: string | null; - projectID?: string | null; - rcn?: string | null; - role?: string | null; - shortName?: string | null; - street?: string | null; - totalCost?: number | null; - vatNumber?: string | null; +export interface H2020Organization { + SME?: boolean | null; + active?: boolean | null; + activityType?: string | null; + city?: string | null; + contactForm?: string | null; + contentUpdateDate?: string | null; + country?: string | null; + ecContribution?: number | null; + endOfParticipation?: boolean | null; + geolocation?: string | null; + id?: string | null; + name?: string | null; + netEcContribution?: number | null; + nutsCode?: string | null; + order?: number | null; + organisationID?: string | null; + organizationURL?: string | null; + postCode?: string | null; + projectAcronym?: string | null; + projectID?: string | null; + rcn?: string | null; + role?: string | null; + shortName?: string | null; + street?: string | null; + totalCost?: number | null; + vatNumber?: string | null; } - diff --git a/webapp/src/app/api/model/h2020ProjectDetails.ts b/webapp/src/app/api/model/h2020ProjectDetails.ts index 7d08134e..f06b2fe5 100644 --- a/webapp/src/app/api/model/h2020ProjectDetails.ts +++ b/webapp/src/app/api/model/h2020ProjectDetails.ts @@ -1,7 +1,7 @@ /** * Innovation Search Engine API * - * + * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech @@ -17,45 +17,43 @@ import { H2020Topic } from './h2020Topic'; import { H2020EurosciVoc } from './h2020EurosciVoc'; import { H2020Organization } from './h2020Organization'; - /** * Comprehensive Horizon 2020 Project model combining all related entities. This model extends the base H2020Project with all associated data. */ -export interface H2020ProjectDetails { - acronym?: string | null; - contentUpdateDate?: string | null; - ecMaxContribution?: number | null; - ecSignatureDate?: string | null; - endDate?: string | null; - frameworkProgramme?: string | null; - fundingScheme?: string | null; - grantDoi?: string | null; - humanValidated?: boolean | null; - id?: string | null; - keywords?: string | null; - legalBasis?: string | null; - masterCall?: string | null; - nature?: string | null; - objective?: string | null; - rcn?: string | null; - startDate?: string | null; - status?: string | null; - subCall?: string | null; - title?: string | null; - topics?: string | null; - totalCost?: number | null; - organizations?: Array | null; - publications?: Array | null; - deliverables?: Array | null; - reportSummaries?: Array | null; - topicsList?: Array | null; - webLinks?: Array | null; - eurosciVoc?: Array | null; - legalBasisList?: Array | null; - ercPrincipalInvestigators?: Array | null; - organizationCount?: number | null; - publicationCount?: number | null; - deliverableCount?: number | null; - ercPiCount?: number | null; +export interface H2020ProjectDetails { + acronym?: string | null; + contentUpdateDate?: string | null; + ecMaxContribution?: number | null; + ecSignatureDate?: string | null; + endDate?: string | null; + frameworkProgramme?: string | null; + fundingScheme?: string | null; + grantDoi?: string | null; + humanValidated?: boolean | null; + id?: string | null; + keywords?: string | null; + legalBasis?: string | null; + masterCall?: string | null; + nature?: string | null; + objective?: string | null; + rcn?: string | null; + startDate?: string | null; + status?: string | null; + subCall?: string | null; + title?: string | null; + topics?: string | null; + totalCost?: number | null; + organizations?: Array | null; + publications?: Array | null; + deliverables?: Array | null; + reportSummaries?: Array | null; + topicsList?: Array | null; + webLinks?: Array | null; + eurosciVoc?: Array | null; + legalBasisList?: Array | null; + ercPrincipalInvestigators?: Array | null; + organizationCount?: number | null; + publicationCount?: number | null; + deliverableCount?: number | null; + ercPiCount?: number | null; } - diff --git a/webapp/src/app/api/model/h2020Publication.ts b/webapp/src/app/api/model/h2020Publication.ts index 945e22d2..bb84dd6e 100644 --- a/webapp/src/app/api/model/h2020Publication.ts +++ b/webapp/src/app/api/model/h2020Publication.ts @@ -1,35 +1,33 @@ /** * Innovation Search Engine API * - * + * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech * Do not edit the class manually. */ - /** * H2020Publication */ -export interface H2020Publication { - authors?: string | null; - collection?: string | null; - contentUpdateDate?: string | null; - doi?: string | null; - id?: string | null; - isPublishedAs?: string | null; - journalNumber?: string | null; - journalTitle?: string | null; - projectAcronym?: string | null; - projectID?: string | null; - publishedPages?: string | null; - publishedYear?: number | null; - publisher?: string | null; - qaProcessedDoi?: string | null; - rcn?: string | null; - repositoryUrl?: string | null; - title?: string | null; - volume?: string | null; +export interface H2020Publication { + authors?: string | null; + collection?: string | null; + contentUpdateDate?: string | null; + doi?: string | null; + id?: string | null; + isPublishedAs?: string | null; + journalNumber?: string | null; + journalTitle?: string | null; + projectAcronym?: string | null; + projectID?: string | null; + publishedPages?: string | null; + publishedYear?: number | null; + publisher?: string | null; + qaProcessedDoi?: string | null; + rcn?: string | null; + repositoryUrl?: string | null; + title?: string | null; + volume?: string | null; } - diff --git a/webapp/src/app/api/model/h2020ReportSummary.ts b/webapp/src/app/api/model/h2020ReportSummary.ts index a5975ffb..2a9989c8 100644 --- a/webapp/src/app/api/model/h2020ReportSummary.ts +++ b/webapp/src/app/api/model/h2020ReportSummary.ts @@ -1,24 +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. */ - /** * H2020ReportSummary */ -export interface H2020ReportSummary { - attachments?: string | null; - contentUpdateDate?: string | null; - id?: string | null; - projectAcronym?: string | null; - projectID?: string | null; - rcn?: string | null; - title?: string | null; +export interface H2020ReportSummary { + attachments?: string | null; + contentUpdateDate?: string | null; + id?: string | null; + projectAcronym?: string | null; + projectID?: string | null; + rcn?: string | null; + title?: string | null; } - diff --git a/webapp/src/app/api/model/h2020Topic.ts b/webapp/src/app/api/model/h2020Topic.ts index 8ddb1991..8573a661 100644 --- a/webapp/src/app/api/model/h2020Topic.ts +++ b/webapp/src/app/api/model/h2020Topic.ts @@ -1,21 +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. */ - /** * H2020Topic */ -export interface H2020Topic { - id?: string | null; - projectID?: string | null; - title?: string | null; - topic?: string | null; +export interface H2020Topic { + id?: string | null; + projectID?: string | null; + title?: string | null; + topic?: string | null; } - diff --git a/webapp/src/app/api/model/h2020WebLink.ts b/webapp/src/app/api/model/h2020WebLink.ts index 26d54599..ce8e8f93 100644 --- a/webapp/src/app/api/model/h2020WebLink.ts +++ b/webapp/src/app/api/model/h2020WebLink.ts @@ -1,27 +1,25 @@ /** * Innovation Search Engine API * - * + * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech * Do not edit the class manually. */ - /** * H2020WebLink */ -export interface H2020WebLink { - archivedDate?: string | null; - availableLanguages?: string | null; - id?: string | null; - linkId?: string | null; - projectID?: string | null; - represents?: string | null; - source?: string | null; - status?: string | null; - type?: string | null; - url?: string | null; +export interface H2020WebLink { + archivedDate?: string | null; + availableLanguages?: string | null; + id?: string | null; + linkId?: string | null; + projectID?: string | null; + represents?: string | null; + source?: string | null; + status?: string | null; + type?: string | null; + url?: string | null; } - diff --git a/webapp/src/app/api/model/hEUDeliverable.ts b/webapp/src/app/api/model/hEUDeliverable.ts index 05d8c5ba..4645913d 100644 --- a/webapp/src/app/api/model/hEUDeliverable.ts +++ b/webapp/src/app/api/model/hEUDeliverable.ts @@ -1,25 +1,23 @@ /** * Innovation Search Engine API * - * + * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech * Do not edit the class manually. */ - /** * HEUDeliverable */ -export interface HEUDeliverable { - collection?: string | null; - contentUpdateDate?: string | null; - deliverableType?: string | null; - description?: string | null; - projectAcronym?: string | null; - projectID?: string | null; - rcn?: string | null; - url?: string | null; +export interface HEUDeliverable { + collection?: string | null; + contentUpdateDate?: string | null; + deliverableType?: string | null; + description?: string | null; + projectAcronym?: string | null; + projectID?: string | null; + rcn?: string | null; + url?: string | null; } - diff --git a/webapp/src/app/api/model/hEUEurosciVoc.ts b/webapp/src/app/api/model/hEUEurosciVoc.ts index 93921ab7..38fe125e 100644 --- a/webapp/src/app/api/model/hEUEurosciVoc.ts +++ b/webapp/src/app/api/model/hEUEurosciVoc.ts @@ -1,23 +1,21 @@ /** * Innovation Search Engine API * - * + * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech * Do not edit the class manually. */ - /** * HEUEurosciVoc */ -export interface HEUEurosciVoc { - code?: string | null; - description?: string | null; - id?: string | null; - path?: string | null; - projectID?: string | null; - title?: string | null; +export interface HEUEurosciVoc { + code?: string | null; + description?: string | null; + id?: string | null; + path?: string | null; + projectID?: string | null; + title?: string | null; } - diff --git a/webapp/src/app/api/model/hEULegalBasis.ts b/webapp/src/app/api/model/hEULegalBasis.ts index e3cb66ca..a02eebd0 100644 --- a/webapp/src/app/api/model/hEULegalBasis.ts +++ b/webapp/src/app/api/model/hEULegalBasis.ts @@ -1,22 +1,20 @@ /** * Innovation Search Engine API * - * + * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech * Do not edit the class manually. */ - /** * HEULegalBasis */ -export interface HEULegalBasis { - id?: string | null; - legalBasis?: string | null; - projectID?: string | null; - title?: string | null; - uniqueProgrammePart?: string | null; +export interface HEULegalBasis { + id?: string | null; + legalBasis?: string | null; + projectID?: string | null; + title?: string | null; + uniqueProgrammePart?: string | null; } - diff --git a/webapp/src/app/api/model/hEUOrganization.ts b/webapp/src/app/api/model/hEUOrganization.ts index 6bb193ef..1dcd1615 100644 --- a/webapp/src/app/api/model/hEUOrganization.ts +++ b/webapp/src/app/api/model/hEUOrganization.ts @@ -1,43 +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. */ - /** * HEUOrganization */ -export interface HEUOrganization { - SME?: boolean | null; - active?: boolean | null; - activityType?: string | null; - city?: string | null; - contactForm?: string | null; - contentUpdateDate?: string | null; - country?: string | null; - ecContribution?: number | null; - endOfParticipation?: boolean | null; - geolocation?: string | null; - id?: string | null; - name?: string | null; - netEcContribution?: number | null; - nutsCode?: string | null; - order?: number | null; - organisationID?: string | null; - organizationURL?: string | null; - postCode?: string | null; - projectAcronym?: string | null; - projectID?: string | null; - rcn?: string | null; - role?: string | null; - shortName?: string | null; - street?: string | null; - totalCost?: number | null; - vatNumber?: string | null; +export interface HEUOrganization { + SME?: boolean | null; + active?: boolean | null; + activityType?: string | null; + city?: string | null; + contactForm?: string | null; + contentUpdateDate?: string | null; + country?: string | null; + ecContribution?: number | null; + endOfParticipation?: boolean | null; + geolocation?: string | null; + id?: string | null; + name?: string | null; + netEcContribution?: number | null; + nutsCode?: string | null; + order?: number | null; + organisationID?: string | null; + organizationURL?: string | null; + postCode?: string | null; + projectAcronym?: string | null; + projectID?: string | null; + rcn?: string | null; + role?: string | null; + shortName?: string | null; + street?: string | null; + totalCost?: number | null; + vatNumber?: string | null; } - diff --git a/webapp/src/app/api/model/hEUProjectDetails.ts b/webapp/src/app/api/model/hEUProjectDetails.ts index 8a897435..f7a46271 100644 --- a/webapp/src/app/api/model/hEUProjectDetails.ts +++ b/webapp/src/app/api/model/hEUProjectDetails.ts @@ -1,7 +1,7 @@ /** * Innovation Search Engine API * - * + * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech @@ -16,43 +16,41 @@ import { HEUReportSummary } from './hEUReportSummary'; import { HEUDeliverable } from './hEUDeliverable'; import { HEUEurosciVoc } from './hEUEurosciVoc'; - /** * Comprehensive Horizon Europe Project model combining all related entities. This model extends the base HEUProject with all associated data. */ -export interface HEUProjectDetails { - acronym?: string | null; - contentUpdateDate?: string | null; - ecMaxContribution?: number | null; - ecSignatureDate?: string | null; - endDate?: string | null; - frameworkProgramme?: string | null; - fundingScheme?: string | null; - grantDoi?: string | null; - humanValidated?: boolean | null; - id?: string | null; - keywords?: string | null; - legalBasis?: string | null; - masterCall?: string | null; - nature?: string | null; - objective?: string | null; - rcn?: string | null; - startDate?: string | null; - status?: string | null; - subCall?: string | null; - title?: string | null; - topics?: string | null; - totalCost?: number | null; - organizations?: Array | null; - publications?: Array | null; - deliverables?: Array | null; - reportSummaries?: Array | null; - topicsList?: Array | null; - webLinks?: Array | null; - eurosciVoc?: Array | null; - legalBasisList?: Array | null; - organizationCount?: number | null; - publicationCount?: number | null; - deliverableCount?: number | null; +export interface HEUProjectDetails { + acronym?: string | null; + contentUpdateDate?: string | null; + ecMaxContribution?: number | null; + ecSignatureDate?: string | null; + endDate?: string | null; + frameworkProgramme?: string | null; + fundingScheme?: string | null; + grantDoi?: string | null; + humanValidated?: boolean | null; + id?: string | null; + keywords?: string | null; + legalBasis?: string | null; + masterCall?: string | null; + nature?: string | null; + objective?: string | null; + rcn?: string | null; + startDate?: string | null; + status?: string | null; + subCall?: string | null; + title?: string | null; + topics?: string | null; + totalCost?: number | null; + organizations?: Array | null; + publications?: Array | null; + deliverables?: Array | null; + reportSummaries?: Array | null; + topicsList?: Array | null; + webLinks?: Array | null; + eurosciVoc?: Array | null; + legalBasisList?: Array | null; + organizationCount?: number | null; + publicationCount?: number | null; + deliverableCount?: number | null; } - diff --git a/webapp/src/app/api/model/hEUPublication.ts b/webapp/src/app/api/model/hEUPublication.ts index 4d067177..86d59473 100644 --- a/webapp/src/app/api/model/hEUPublication.ts +++ b/webapp/src/app/api/model/hEUPublication.ts @@ -1,35 +1,33 @@ /** * Innovation Search Engine API * - * + * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech * Do not edit the class manually. */ - /** * HEUPublication */ -export interface HEUPublication { - authors?: string | null; - collection?: string | null; - contentUpdateDate?: string | null; - doi?: string | null; - id?: string | null; - isPublishedAs?: string | null; - journalNumber?: string | null; - journalTitle?: string | null; - projectAcronym?: string | null; - projectID?: string | null; - publishedPages?: string | null; - publishedYear?: number | null; - publisher?: string | null; - qaProcessedDoi?: string | null; - rcn?: string | null; - repositoryUrl?: string | null; - title?: string | null; - volume?: string | null; +export interface HEUPublication { + authors?: string | null; + collection?: string | null; + contentUpdateDate?: string | null; + doi?: string | null; + id?: string | null; + isPublishedAs?: string | null; + journalNumber?: string | null; + journalTitle?: string | null; + projectAcronym?: string | null; + projectID?: string | null; + publishedPages?: string | null; + publishedYear?: number | null; + publisher?: string | null; + qaProcessedDoi?: string | null; + rcn?: string | null; + repositoryUrl?: string | null; + title?: string | null; + volume?: string | null; } - diff --git a/webapp/src/app/api/model/hEUReportSummary.ts b/webapp/src/app/api/model/hEUReportSummary.ts index b9e1a299..94f58b4c 100644 --- a/webapp/src/app/api/model/hEUReportSummary.ts +++ b/webapp/src/app/api/model/hEUReportSummary.ts @@ -1,24 +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. */ - /** * HEUReportSummary */ -export interface HEUReportSummary { - attachments?: string | null; - contentUpdateDate?: string | null; - id?: string | null; - projectAcronym?: string | null; - projectID?: string | null; - rcn?: string | null; - title?: string | null; +export interface HEUReportSummary { + attachments?: string | null; + contentUpdateDate?: string | null; + id?: string | null; + projectAcronym?: string | null; + projectID?: string | null; + rcn?: string | null; + title?: string | null; } - diff --git a/webapp/src/app/api/model/hEUTopic.ts b/webapp/src/app/api/model/hEUTopic.ts index a0a5e764..ccd60c27 100644 --- a/webapp/src/app/api/model/hEUTopic.ts +++ b/webapp/src/app/api/model/hEUTopic.ts @@ -1,21 +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. */ - /** * HEUTopic */ -export interface HEUTopic { - id?: string | null; - projectID?: string | null; - title?: string | null; - topic?: string | null; +export interface HEUTopic { + id?: string | null; + projectID?: string | null; + title?: string | null; + topic?: string | null; } - diff --git a/webapp/src/app/api/model/hEUWebLink.ts b/webapp/src/app/api/model/hEUWebLink.ts index 81c5d60f..1159d2a6 100644 --- a/webapp/src/app/api/model/hEUWebLink.ts +++ b/webapp/src/app/api/model/hEUWebLink.ts @@ -1,27 +1,25 @@ /** * Innovation Search Engine API * - * + * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech * Do not edit the class manually. */ - /** * HEUWebLink */ -export interface HEUWebLink { - archivedDate?: string | null; - availableLanguages?: string | null; - id?: string | null; - linkId?: string | null; - projectID?: string | null; - represents?: string | null; - source?: string | null; - status?: string | null; - type?: string | null; - url?: string | null; +export interface HEUWebLink { + archivedDate?: string | null; + availableLanguages?: string | null; + id?: string | null; + linkId?: string | null; + projectID?: string | null; + represents?: string | null; + source?: string | null; + status?: string | null; + type?: string | null; + url?: string | null; } - diff --git a/webapp/src/app/api/model/hTTPValidationError.ts b/webapp/src/app/api/model/hTTPValidationError.ts index f624be37..c8e65c3e 100644 --- a/webapp/src/app/api/model/hTTPValidationError.ts +++ b/webapp/src/app/api/model/hTTPValidationError.ts @@ -1,7 +1,7 @@ /** * Innovation Search Engine API * - * + * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech @@ -9,8 +9,6 @@ */ import { ValidationError } from './validationError'; - -export interface HTTPValidationError { - detail?: Array; +export interface HTTPValidationError { + detail?: Array; } - diff --git a/webapp/src/app/api/model/idToken.ts b/webapp/src/app/api/model/idToken.ts deleted file mode 100644 index e6a88cd3..00000000 --- a/webapp/src/app/api/model/idToken.ts +++ /dev/null @@ -1,42 +0,0 @@ -/** - * Innovation Search Engine API - * - * - * - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * https://openapi-generator.tech - * Do not edit the class manually. - */ -import { TokenType } from './tokenType'; - - -export interface IdToken { - /** - * The type of the token, which is always ID_TOKEN for this class. - */ - token_type?: TokenType; - /** - * 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; - /** - * A hash of the user\'s fingerprint to ensure the token is used by the same user. - */ - user_fingerprint_hash: string; - /** - * The raw token string. - */ - raw_token: string; -} -export namespace IdToken { -} - - diff --git a/webapp/src/app/api/model/idTokenMetadata.ts b/webapp/src/app/api/model/idTokenMetadata.ts new file mode 100644 index 00000000..ab99fb1c --- /dev/null +++ b/webapp/src/app/api/model/idTokenMetadata.ts @@ -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 { TokenType } from './tokenType'; + +export interface IdTokenMetadata { + /** + * The unique identifier of the real account associated with this token. + */ + real_account_id: string; + /** + * The timestamp indicating when the token will expire. + */ + expires_at: string; + /** + * The epoch value for the token. Used for versioning of tokens. + */ + epoch?: number; + /** + * The type of the token, which is always ID_TOKEN for this class. + */ + token_type?: TokenType; +} +export namespace IdTokenMetadata {} diff --git a/webapp/src/app/api/model/institution.ts b/webapp/src/app/api/model/institution.ts index 6b1a5778..c099fc57 100644 --- a/webapp/src/app/api/model/institution.ts +++ b/webapp/src/app/api/model/institution.ts @@ -1,7 +1,7 @@ /** * Innovation Search Engine API * - * + * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech @@ -12,30 +12,28 @@ import { AuthorCountsByYearInner } from './authorCountsByYearInner'; import { AuthorSummaryStats } from './authorSummaryStats'; import { InstitutionGeo } from './institutionGeo'; - /** * A university, research organization, or other affiliation */ -export interface Institution { - id?: string | null; - ror?: string | null; - display_name?: string | null; - country_code?: string | null; - type?: string | null; - homepage_url?: string | null; - image_url?: string | null; - image_thumbnail_url?: string | null; - display_name_acronyms?: Array | null; - display_name_alternatives?: Array | null; - works_count?: number | null; - cited_by_count?: number | null; - summary_stats?: AuthorSummaryStats | null; - geo?: InstitutionGeo | null; - lineage?: Array | null; - ids?: InstitutionIds | null; - counts_by_year?: Array | null; - works_api_url?: string | null; - created_date?: string | null; - updated_date?: string | null; +export interface Institution { + id?: string | null; + ror?: string | null; + display_name?: string | null; + country_code?: string | null; + type?: string | null; + homepage_url?: string | null; + image_url?: string | null; + image_thumbnail_url?: string | null; + display_name_acronyms?: Array | null; + display_name_alternatives?: Array | null; + works_count?: number | null; + cited_by_count?: number | null; + summary_stats?: AuthorSummaryStats | null; + geo?: InstitutionGeo | null; + lineage?: Array | null; + ids?: InstitutionIds | null; + counts_by_year?: Array | null; + works_api_url?: string | null; + created_date?: string | null; + updated_date?: string | null; } - diff --git a/webapp/src/app/api/model/institutionFunderSummary.ts b/webapp/src/app/api/model/institutionFunderSummary.ts index 48d147b2..cf15754a 100644 --- a/webapp/src/app/api/model/institutionFunderSummary.ts +++ b/webapp/src/app/api/model/institutionFunderSummary.ts @@ -1,7 +1,7 @@ /** * Innovation Search Engine API * - * + * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech @@ -9,22 +9,18 @@ */ import { ProjectType } from './projectType'; - -export interface InstitutionFunderSummary { - /** - * The type of funding data (e.g., \'bund\', \'eu\', \'dfg\'). - */ - type: ProjectType; - /** - * A dictionary mapping years to total funding amounts for that year. - */ - funding_per_year?: object; - /** - * The average annual funding over the continuous period covered by the data. - */ - annual_average_over_period?: number; +export interface InstitutionFunderSummary { + /** + * The type of funding data (e.g., \'bund\', \'eu\', \'dfg\'). + */ + type: ProjectType; + /** + * A dictionary mapping years to total funding amounts for that year. + */ + funding_per_year?: object; + /** + * The average annual funding over the continuous period covered by the data. + */ + annual_average_over_period?: number; } -export namespace InstitutionFunderSummary { -} - - +export namespace InstitutionFunderSummary {} diff --git a/webapp/src/app/api/model/institutionGeo.ts b/webapp/src/app/api/model/institutionGeo.ts index 949b73f4..b438d37c 100644 --- a/webapp/src/app/api/model/institutionGeo.ts +++ b/webapp/src/app/api/model/institutionGeo.ts @@ -1,7 +1,7 @@ /** * Innovation Search Engine API * - * + * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech @@ -10,17 +10,15 @@ import { Latitude } from './latitude'; import { Longitude } from './longitude'; - /** * Location information: */ -export interface InstitutionGeo { - city?: string | null; - geonames_city_id?: string | null; - region?: string | null; - country_code?: string | null; - country?: string | null; - latitude?: Latitude | null; - longitude?: Longitude | null; +export interface InstitutionGeo { + city?: string | null; + geonames_city_id?: string | null; + region?: string | null; + country_code?: string | null; + country?: string | null; + latitude?: Latitude | null; + longitude?: Longitude | null; } - diff --git a/webapp/src/app/api/model/institutionIds.ts b/webapp/src/app/api/model/institutionIds.ts index 93d801e1..fd952098 100644 --- a/webapp/src/app/api/model/institutionIds.ts +++ b/webapp/src/app/api/model/institutionIds.ts @@ -1,23 +1,21 @@ /** * Innovation Search Engine API * - * + * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech * Do not edit the class manually. */ - /** * External identifiers: */ -export interface InstitutionIds { - openalex?: string | null; - ror?: string | null; - mag?: number | null; - grid?: string | null; - wikipedia?: string | null; - wikidata?: string | null; +export interface InstitutionIds { + openalex?: string | null; + ror?: string | null; + mag?: number | null; + grid?: string | null; + wikipedia?: string | null; + wikidata?: string | null; } - diff --git a/webapp/src/app/api/model/institutionInformation.ts b/webapp/src/app/api/model/institutionInformation.ts index e287b0fa..9e12986d 100644 --- a/webapp/src/app/api/model/institutionInformation.ts +++ b/webapp/src/app/api/model/institutionInformation.ts @@ -1,22 +1,20 @@ /** * Innovation Search Engine API * - * + * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech * Do not edit the class manually. */ - -export interface InstitutionInformation { - /** - * The raw institution ID of the institution. - */ - raw_id: string; - /** - * The display name of the institution. - */ - display_name: string; +export interface InstitutionInformation { + /** + * The raw institution ID of the institution. + */ + raw_id: string; + /** + * The display name of the institution. + */ + display_name: string; } - diff --git a/webapp/src/app/api/model/institutionNetworkNode.ts b/webapp/src/app/api/model/institutionNetworkNode.ts index a558a8cf..791645b7 100644 --- a/webapp/src/app/api/model/institutionNetworkNode.ts +++ b/webapp/src/app/api/model/institutionNetworkNode.ts @@ -1,7 +1,7 @@ /** * Innovation Search Engine API * - * + * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech @@ -9,22 +9,18 @@ */ import { CollaborationNetworkNodeType } from './collaborationNetworkNodeType'; - -export interface InstitutionNetworkNode { - /** - * The raw ID of the node. For an author node, this is the raw person ID. For an institution node, this is the raw institution ID. For a work node, this is the raw work ID. - */ - raw_id: string; - /** - * The display name of the node. - */ - display_name: string; - /** - * The category of the node, either \'author\', \'institution\', or \'work\'. - */ - category: CollaborationNetworkNodeType; +export interface InstitutionNetworkNode { + /** + * The raw ID of the node. For an author node, this is the raw person ID. For an institution node, this is the raw institution ID. For a work node, this is the raw work ID. + */ + raw_id: string; + /** + * The display name of the node. + */ + display_name: string; + /** + * The category of the node, either \'author\', \'institution\', or \'work\'. + */ + category: CollaborationNetworkNodeType; } -export namespace InstitutionNetworkNode { -} - - +export namespace InstitutionNetworkNode {} diff --git a/webapp/src/app/api/model/institutionPage.ts b/webapp/src/app/api/model/institutionPage.ts index 01267ee3..b7640651 100644 --- a/webapp/src/app/api/model/institutionPage.ts +++ b/webapp/src/app/api/model/institutionPage.ts @@ -1,7 +1,7 @@ /** * Innovation Search Engine API * - * + * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech @@ -9,23 +9,21 @@ */ import { Institution } from './institution'; - -export interface InstitutionPage { - /** - * List of institutions in the current page. - */ - elements?: Array; - /** - * Current page number. (0-indexed) - */ - page?: number; - /** - * Number of institutions per page. - */ - size?: number; - /** - * Total number of institutions matching the search criteria. - */ - total?: number; +export interface InstitutionPage { + /** + * List of institutions in the current page. + */ + elements?: Array; + /** + * Current page number. (0-indexed) + */ + page?: number; + /** + * Number of institutions per page. + */ + size?: number; + /** + * Total number of institutions matching the search criteria. + */ + total?: number; } - diff --git a/webapp/src/app/api/model/institutionsListResponse.ts b/webapp/src/app/api/model/institutionsListResponse.ts index 908d72fe..0ac2c185 100644 --- a/webapp/src/app/api/model/institutionsListResponse.ts +++ b/webapp/src/app/api/model/institutionsListResponse.ts @@ -1,7 +1,7 @@ /** * Innovation Search Engine API * - * + * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech @@ -11,13 +11,11 @@ import { Meta } from './meta'; import { Institution } from './institution'; import { GroupByResult } from './groupByResult'; - /** * InstitutionsListResponse */ -export interface InstitutionsListResponse { - meta?: Meta | null; - results?: Array | null; - group_by?: Array | null; +export interface InstitutionsListResponse { + meta?: Meta | null; + results?: Array | null; + group_by?: Array | null; } - diff --git a/webapp/src/app/api/model/ipcClassification.ts b/webapp/src/app/api/model/ipcClassification.ts index 74805329..b7e65c0d 100644 --- a/webapp/src/app/api/model/ipcClassification.ts +++ b/webapp/src/app/api/model/ipcClassification.ts @@ -1,20 +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 IpcClassification { - symbol: string; - section?: string | null; - 'class'?: string | null; - subclass?: string | null; - main_group?: string | null; - subgroup?: string | null; +export interface IpcClassification { + symbol: string; + section?: string | null; + class?: string | null; + subclass?: string | null; + main_group?: string | null; + subgroup?: string | null; } - diff --git a/webapp/src/app/api/model/keywords.ts b/webapp/src/app/api/model/keywords.ts index c65c7600..d93b5fe0 100644 --- a/webapp/src/app/api/model/keywords.ts +++ b/webapp/src/app/api/model/keywords.ts @@ -1,17 +1,14 @@ /** * Innovation Search Engine API * - * + * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech * Do not edit the class manually. */ - /** * Keywords associated with the project */ -export interface Keywords { -} - +export interface Keywords {} diff --git a/webapp/src/app/api/model/latitude.ts b/webapp/src/app/api/model/latitude.ts index fe6b49aa..8fb58a9b 100644 --- a/webapp/src/app/api/model/latitude.ts +++ b/webapp/src/app/api/model/latitude.ts @@ -1,14 +1,11 @@ /** * Innovation Search Engine API * - * + * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech * Do not edit the class manually. */ - -export interface Latitude { -} - +export interface Latitude {} diff --git a/webapp/src/app/api/model/location.ts b/webapp/src/app/api/model/location.ts index f207d751..f92e2ffb 100644 --- a/webapp/src/app/api/model/location.ts +++ b/webapp/src/app/api/model/location.ts @@ -1,7 +1,7 @@ /** * Innovation Search Engine API * - * + * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech @@ -9,19 +9,17 @@ */ import { DehydratedSource } from './dehydratedSource'; - /** * Where a work is hosted */ -export interface Location { - is_oa?: boolean | null; - landing_page_url?: string | null; - pdf_url?: string | null; - source?: DehydratedSource | null; - license?: string | null; - license_id?: string | null; - version?: string | null; - is_accepted?: boolean | null; - is_published?: boolean | null; +export interface Location { + is_oa?: boolean | null; + landing_page_url?: string | null; + pdf_url?: string | null; + source?: DehydratedSource | null; + license?: string | null; + license_id?: string | null; + version?: string | null; + is_accepted?: boolean | null; + is_published?: boolean | null; } - diff --git a/webapp/src/app/api/model/loginResponse.ts b/webapp/src/app/api/model/loginResponse.ts index 216d0fb0..b0ccb902 100644 --- a/webapp/src/app/api/model/loginResponse.ts +++ b/webapp/src/app/api/model/loginResponse.ts @@ -7,11 +7,11 @@ * https://openapi-generator.tech * Do not edit the class manually. */ -import { IdToken } from './idToken'; +import { IdTokenMetadata } from './idTokenMetadata'; export interface LoginResponse { /** * The ID token issued upon successful login. */ - id_token: IdToken; + id_token: IdTokenMetadata; } diff --git a/webapp/src/app/api/model/longitude.ts b/webapp/src/app/api/model/longitude.ts index b0d39fce..d222a6ff 100644 --- a/webapp/src/app/api/model/longitude.ts +++ b/webapp/src/app/api/model/longitude.ts @@ -1,14 +1,11 @@ /** * Innovation Search Engine API * - * + * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech * Do not edit the class manually. */ - -export interface Longitude { -} - +export interface Longitude {} diff --git a/webapp/src/app/api/model/matchedOfficer.ts b/webapp/src/app/api/model/matchedOfficer.ts index 4ad5c354..a9f00939 100644 --- a/webapp/src/app/api/model/matchedOfficer.ts +++ b/webapp/src/app/api/model/matchedOfficer.ts @@ -1,23 +1,21 @@ /** * Innovation Search Engine API * - * + * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech * Do not edit the class manually. */ - -export interface MatchedOfficer { - name?: string | null; - firstname?: string | null; - lastname?: string | null; - city?: string | null; - position?: string | null; - start_date?: string | null; - type?: string | null; - flag?: string | null; - is_matched_person?: boolean; +export interface MatchedOfficer { + name?: string | null; + firstname?: string | null; + lastname?: string | null; + city?: string | null; + position?: string | null; + start_date?: string | null; + type?: string | null; + flag?: string | null; + is_matched_person?: boolean; } - diff --git a/webapp/src/app/api/model/mentionedPerson.ts b/webapp/src/app/api/model/mentionedPerson.ts index 6141b12a..dad21357 100644 --- a/webapp/src/app/api/model/mentionedPerson.ts +++ b/webapp/src/app/api/model/mentionedPerson.ts @@ -1,17 +1,15 @@ /** * Innovation Search Engine API * - * + * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech * Do not edit the class manually. */ - -export interface MentionedPerson { - name: string; - is_ude?: boolean; - person_id?: string | null; +export interface MentionedPerson { + name: string; + is_ude?: boolean; + person_id?: string | null; } - diff --git a/webapp/src/app/api/model/meta.ts b/webapp/src/app/api/model/meta.ts index 8481062a..f9f56443 100644 --- a/webapp/src/app/api/model/meta.ts +++ b/webapp/src/app/api/model/meta.ts @@ -1,7 +1,7 @@ /** * Innovation Search Engine API * - * + * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech @@ -9,17 +9,15 @@ */ import { CostUsd } from './costUsd'; - /** * Metadata about the query results */ -export interface Meta { - count?: number | null; - db_response_time_ms?: number | null; - page?: number | null; - per_page?: number | null; - next_cursor?: string | null; - groups_count?: number | null; - cost_usd?: CostUsd | null; +export interface Meta { + count?: number | null; + db_response_time_ms?: number | null; + page?: number | null; + per_page?: number | null; + next_cursor?: string | null; + groups_count?: number | null; + cost_usd?: CostUsd | null; } - diff --git a/webapp/src/app/api/model/model2YrMeanCitedness.ts b/webapp/src/app/api/model/model2YrMeanCitedness.ts index 67ec623c..d9c3d9df 100644 --- a/webapp/src/app/api/model/model2YrMeanCitedness.ts +++ b/webapp/src/app/api/model/model2YrMeanCitedness.ts @@ -1,14 +1,11 @@ /** * Innovation Search Engine API * - * + * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech * Do not edit the class manually. */ - -export interface Model2YrMeanCitedness { -} - +export interface Model2YrMeanCitedness {} diff --git a/webapp/src/app/api/model/models.ts b/webapp/src/app/api/model/models.ts index 2077ece1..a99176b9 100644 --- a/webapp/src/app/api/model/models.ts +++ b/webapp/src/app/api/model/models.ts @@ -90,7 +90,7 @@ export * from './hEUReportSummary'; export * from './hEUTopic'; export * from './hEUWebLink'; export * from './hTTPValidationError'; -export * from './idToken'; +export * from './idTokenMetadata'; export * from './inseAccountManagementModelOrganizationProfile'; export * from './inseOrganizationManagementModelOrganizationProfile'; export * from './institution'; @@ -125,6 +125,7 @@ export * from './openAccess'; export * from './orgPatentEntry'; export * from './orgPatentsResponse'; export * from './organizationPage'; +export * from './otkResponse'; export * from './patentEntry'; export * from './patentsByAuthorResponse'; export * from './patentsByInstitutionResponse'; @@ -136,7 +137,6 @@ export * from './publicationDetailByFunder'; export * from './publicationIdsByAuthorPosition'; export * from './publicationsByAuthorResponse'; export * from './rankingResponse'; -export * from './refreshToken'; export * from './score'; export * from './sortDirection'; export * from './tokenType'; diff --git a/webapp/src/app/api/model/newsArticle.ts b/webapp/src/app/api/model/newsArticle.ts index ab48810d..e04f0029 100644 --- a/webapp/src/app/api/model/newsArticle.ts +++ b/webapp/src/app/api/model/newsArticle.ts @@ -1,22 +1,20 @@ /** * Innovation Search Engine API * - * + * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech * Do not edit the class manually. */ - -export interface NewsArticle { - id: string; - date?: string | null; - maintitle?: string | null; - author?: string | null; - url?: string | null; - relevant?: boolean | null; - snippet?: string | null; - related?: boolean | null; +export interface NewsArticle { + id: string; + date?: string | null; + maintitle?: string | null; + author?: string | null; + url?: string | null; + relevant?: boolean | null; + snippet?: string | null; + related?: boolean | null; } - diff --git a/webapp/src/app/api/model/newsArticleDetail.ts b/webapp/src/app/api/model/newsArticleDetail.ts index 0240903f..ac51097c 100644 --- a/webapp/src/app/api/model/newsArticleDetail.ts +++ b/webapp/src/app/api/model/newsArticleDetail.ts @@ -1,7 +1,7 @@ /** * Innovation Search Engine API * - * + * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech @@ -9,19 +9,17 @@ */ import { MentionedPerson } from './mentionedPerson'; - -export interface NewsArticleDetail { - id: string; - date?: string | null; - maintitle?: string | null; - author?: string | null; - url?: string | null; - relevant?: boolean | null; - snippet?: string | null; - related?: boolean | null; - full_content?: string | null; - authors?: Array; - topics?: Array; - keywords?: Array; +export interface NewsArticleDetail { + id: string; + date?: string | null; + maintitle?: string | null; + author?: string | null; + url?: string | null; + relevant?: boolean | null; + snippet?: string | null; + related?: boolean | null; + full_content?: string | null; + authors?: Array; + topics?: Array; + keywords?: Array; } - diff --git a/webapp/src/app/api/model/newsPage.ts b/webapp/src/app/api/model/newsPage.ts index da7f26ab..bbb74122 100644 --- a/webapp/src/app/api/model/newsPage.ts +++ b/webapp/src/app/api/model/newsPage.ts @@ -1,7 +1,7 @@ /** * Innovation Search Engine API * - * + * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech @@ -9,11 +9,9 @@ */ import { NewsArticle } from './newsArticle'; - -export interface NewsPage { - total: number; - page: number; - page_size: number; - results: Array; +export interface NewsPage { + total: number; + page: number; + page_size: number; + results: Array; } - diff --git a/webapp/src/app/api/model/openAccess.ts b/webapp/src/app/api/model/openAccess.ts index 32a4ddd9..40d7b1d0 100644 --- a/webapp/src/app/api/model/openAccess.ts +++ b/webapp/src/app/api/model/openAccess.ts @@ -1,21 +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. */ - /** * Open access information */ -export interface OpenAccess { - is_oa?: boolean | null; - oa_status?: string | null; - oa_url?: string | null; - any_repository_has_fulltext?: boolean | null; +export interface OpenAccess { + is_oa?: boolean | null; + oa_status?: string | null; + oa_url?: string | null; + any_repository_has_fulltext?: boolean | null; } - diff --git a/webapp/src/app/api/model/organizationPage.ts b/webapp/src/app/api/model/organizationPage.ts index 5b8294b1..fccb1081 100644 --- a/webapp/src/app/api/model/organizationPage.ts +++ b/webapp/src/app/api/model/organizationPage.ts @@ -1,7 +1,7 @@ /** * Innovation Search Engine API * - * + * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech @@ -9,11 +9,9 @@ */ import { InseOrganizationManagementModelOrganizationProfile } from './inseOrganizationManagementModelOrganizationProfile'; - -export interface OrganizationPage { - items: Array; - total: number; - page: number; - page_size: number; +export interface OrganizationPage { + items: Array; + total: number; + page: number; + page_size: number; } - diff --git a/webapp/src/app/api/model/otkResponse.ts b/webapp/src/app/api/model/otkResponse.ts new file mode 100644 index 00000000..3b69c11d --- /dev/null +++ b/webapp/src/app/api/model/otkResponse.ts @@ -0,0 +1,20 @@ +/** + * Innovation Search Engine API + * + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +export interface OtkResponse { + /** + * The status of the one-time code (OTC) request. + */ + status: string; + /** + * The unique identifier of the account for which the OTC was requested. + */ + account_id: string; +} diff --git a/webapp/src/app/api/model/patentEntry.ts b/webapp/src/app/api/model/patentEntry.ts index 5565ab9a..7a0339b1 100644 --- a/webapp/src/app/api/model/patentEntry.ts +++ b/webapp/src/app/api/model/patentEntry.ts @@ -1,7 +1,7 @@ /** * Innovation Search Engine API * - * + * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech @@ -9,26 +9,24 @@ */ import { IpcClassification } from './ipcClassification'; - -export interface PatentEntry { - patent_id: string; - source: string; - title?: string | null; - 'abstract'?: string | null; - publication_date?: string | null; - publication_year?: string | null; - application_number?: string | null; - application_date?: string | null; - kind?: string | null; - application_type?: string | null; - number_of_claims?: number | null; - status?: string | null; - inventors?: Array; - assignees?: Array; - ipc?: Array; - ipc_descriptions?: Array; - cpc?: Array; - cpc_descriptions?: Array; - country?: string | null; +export interface PatentEntry { + patent_id: string; + source: string; + title?: string | null; + abstract?: string | null; + publication_date?: string | null; + publication_year?: string | null; + application_number?: string | null; + application_date?: string | null; + kind?: string | null; + application_type?: string | null; + number_of_claims?: number | null; + status?: string | null; + inventors?: Array; + assignees?: Array; + ipc?: Array; + ipc_descriptions?: Array; + cpc?: Array; + cpc_descriptions?: Array; + country?: string | null; } - diff --git a/webapp/src/app/api/model/patentsByAuthorResponse.ts b/webapp/src/app/api/model/patentsByAuthorResponse.ts index eca819ed..ed970c7a 100644 --- a/webapp/src/app/api/model/patentsByAuthorResponse.ts +++ b/webapp/src/app/api/model/patentsByAuthorResponse.ts @@ -1,7 +1,7 @@ /** * Innovation Search Engine API * - * + * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech @@ -9,11 +9,9 @@ */ import { PatentEntry } from './patentEntry'; - -export interface PatentsByAuthorResponse { - author_id: string; - author_name?: string | null; - patent_count: number; - patents: Array; +export interface PatentsByAuthorResponse { + author_id: string; + author_name?: string | null; + patent_count: number; + patents: Array; } - diff --git a/webapp/src/app/api/model/personBio.ts b/webapp/src/app/api/model/personBio.ts index f7291e6f..b060c9a9 100644 --- a/webapp/src/app/api/model/personBio.ts +++ b/webapp/src/app/api/model/personBio.ts @@ -1,18 +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 PersonBio { - /** - * The generated biography. - */ - bio: string; +export interface PersonBio { + /** + * The generated biography. + */ + bio: string; } - diff --git a/webapp/src/app/api/model/projectType.ts b/webapp/src/app/api/model/projectType.ts index a01a743c..08df30c4 100644 --- a/webapp/src/app/api/model/projectType.ts +++ b/webapp/src/app/api/model/projectType.ts @@ -1,18 +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 const ProjectType = { - Bund: 'bund', - Eu: 'eu', - Dfg: 'dfg' + Bund: 'bund', + Eu: 'eu', + Dfg: 'dfg', } as const; -export type ProjectType = typeof ProjectType[keyof typeof ProjectType]; - +export type ProjectType = (typeof ProjectType)[keyof typeof ProjectType]; diff --git a/webapp/src/app/api/model/projectsFilteringProperties.ts b/webapp/src/app/api/model/projectsFilteringProperties.ts index 7ce7cfc2..c0cebe63 100644 --- a/webapp/src/app/api/model/projectsFilteringProperties.ts +++ b/webapp/src/app/api/model/projectsFilteringProperties.ts @@ -1,7 +1,7 @@ /** * Innovation Search Engine API * - * + * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech @@ -11,32 +11,28 @@ import { SortDirection } from './sortDirection'; import { ProjectsSortBy } from './projectsSortBy'; import { ProjectType } from './projectType'; - -export interface ProjectsFilteringProperties { - /** - * The type of projects to filter by. - */ - project_type: ProjectType; - /** - * The page number for pagination. - */ - page: number; - /** - * The page size for pagination. - */ - size: number; - raw_oa_institution_id?: string | null; - query?: string | null; - /** - * The field to sort by. - */ - sort_by?: ProjectsSortBy; - /** - * The sort direction (asc or desc). - */ - sort_direction?: SortDirection; +export interface ProjectsFilteringProperties { + /** + * The type of projects to filter by. + */ + project_type: ProjectType; + /** + * The page number for pagination. + */ + page: number; + /** + * The page size for pagination. + */ + size: number; + raw_oa_institution_id?: string | null; + query?: string | null; + /** + * The field to sort by. + */ + sort_by?: ProjectsSortBy; + /** + * The sort direction (asc or desc). + */ + sort_direction?: SortDirection; } -export namespace ProjectsFilteringProperties { -} - - +export namespace ProjectsFilteringProperties {} diff --git a/webapp/src/app/api/model/projectsSortBy.ts b/webapp/src/app/api/model/projectsSortBy.ts index 79824096..26400b22 100644 --- a/webapp/src/app/api/model/projectsSortBy.ts +++ b/webapp/src/app/api/model/projectsSortBy.ts @@ -1,19 +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 ProjectsSortBy = { - Title: 'title', - FundingStart: 'funding_start', - FundingEnd: 'funding_end', - FundingAmount: 'funding_amount' + Title: 'title', + FundingStart: 'funding_start', + FundingEnd: 'funding_end', + FundingAmount: 'funding_amount', } as const; -export type ProjectsSortBy = typeof ProjectsSortBy[keyof typeof ProjectsSortBy]; - +export type ProjectsSortBy = + (typeof ProjectsSortBy)[keyof typeof ProjectsSortBy]; diff --git a/webapp/src/app/api/model/publicationDetailByFunder.ts b/webapp/src/app/api/model/publicationDetailByFunder.ts index 123ded7e..0fd6b7c5 100644 --- a/webapp/src/app/api/model/publicationDetailByFunder.ts +++ b/webapp/src/app/api/model/publicationDetailByFunder.ts @@ -1,45 +1,43 @@ /** * Innovation Search Engine API * - * + * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech * Do not edit the class manually. */ - -export interface PublicationDetailByFunder { - id: string; - title: string; - 'abstract'?: string | null; - doi?: string | null; - publication_year?: number | null; - publication_date?: string | null; - publication_type?: string | null; - language?: string | null; - publication_url?: string | null; - pdf_url?: string | null; - source_name?: string | null; - source_type?: string | null; - is_open_access?: boolean | null; - open_access_status?: string | null; - has_fulltext?: boolean | null; - license?: string | null; - cited_by_count?: number | null; - is_retracted?: boolean | null; - primary_topic?: string | null; - topic_field?: string | null; - topic_subfield?: string | null; - topic_domain?: string | null; - author_position?: string | null; - authors?: Array; - funder_names?: Array; - institutions?: Array; - countries?: Array; - topics?: Array; - keywords?: Array; - grant_labels?: Array; - counts_by_year?: Array; +export interface PublicationDetailByFunder { + id: string; + title: string; + abstract?: string | null; + doi?: string | null; + publication_year?: number | null; + publication_date?: string | null; + publication_type?: string | null; + language?: string | null; + publication_url?: string | null; + pdf_url?: string | null; + source_name?: string | null; + source_type?: string | null; + is_open_access?: boolean | null; + open_access_status?: string | null; + has_fulltext?: boolean | null; + license?: string | null; + cited_by_count?: number | null; + is_retracted?: boolean | null; + primary_topic?: string | null; + topic_field?: string | null; + topic_subfield?: string | null; + topic_domain?: string | null; + author_position?: string | null; + authors?: Array; + funder_names?: Array; + institutions?: Array; + countries?: Array; + topics?: Array; + keywords?: Array; + grant_labels?: Array; + counts_by_year?: Array; } - diff --git a/webapp/src/app/api/model/publicationIdsByAuthorPosition.ts b/webapp/src/app/api/model/publicationIdsByAuthorPosition.ts index c35050ef..d549f8ed 100644 --- a/webapp/src/app/api/model/publicationIdsByAuthorPosition.ts +++ b/webapp/src/app/api/model/publicationIdsByAuthorPosition.ts @@ -1,18 +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 PublicationIdsByAuthorPosition { - first?: Array; - middle?: Array; - last?: Array; - unknown?: Array; +export interface PublicationIdsByAuthorPosition { + first?: Array; + middle?: Array; + last?: Array; + unknown?: Array; } - diff --git a/webapp/src/app/api/model/publicationsByAuthorResponse.ts b/webapp/src/app/api/model/publicationsByAuthorResponse.ts index 5176fe39..35333880 100644 --- a/webapp/src/app/api/model/publicationsByAuthorResponse.ts +++ b/webapp/src/app/api/model/publicationsByAuthorResponse.ts @@ -1,21 +1,19 @@ /** * Innovation Search Engine API * - * + * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech * Do not edit the class manually. */ - -export interface PublicationsByAuthorResponse { - author_id: string; - page: number; - page_size: number; - total_works: number; - total: number; - results_count: number; - results: Array; +export interface PublicationsByAuthorResponse { + author_id: string; + page: number; + page_size: number; + total_works: number; + total: number; + results_count: number; + results: Array; } - diff --git a/webapp/src/app/api/model/rankingResponse.ts b/webapp/src/app/api/model/rankingResponse.ts index 099ec660..5be090a2 100644 --- a/webapp/src/app/api/model/rankingResponse.ts +++ b/webapp/src/app/api/model/rankingResponse.ts @@ -1,7 +1,7 @@ /** * Innovation Search Engine API * - * + * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech @@ -10,9 +10,7 @@ import { UniversityRanking } from './universityRanking'; import { UniversityTopicData } from './universityTopicData'; - -export interface RankingResponse { - timeseries: Array; - rankings: Array; +export interface RankingResponse { + timeseries: Array; + rankings: Array; } - diff --git a/webapp/src/app/api/model/refreshToken.ts b/webapp/src/app/api/model/refreshToken.ts deleted file mode 100644 index 89506b70..00000000 --- a/webapp/src/app/api/model/refreshToken.ts +++ /dev/null @@ -1,55 +0,0 @@ -/** - * Innovation Search Engine API - * - * - * - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * https://openapi-generator.tech - * Do not edit the class manually. - */ -import { TokenType } from './tokenType'; -import { UserRole } from './userRole'; - - -export interface RefreshToken { - /** - * The type of the token, which is always REFRESH_TOKEN for this class. - */ - token_type?: TokenType; - /** - * 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; - /** - * A hash of the user\'s fingerprint to ensure the token is used by the same user. - */ - user_fingerprint_hash: string; - /** - * The raw token string. - */ - raw_token: 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; -} -export namespace RefreshToken { -} - - diff --git a/webapp/src/app/api/model/score.ts b/webapp/src/app/api/model/score.ts index fac39735..5b0b5935 100644 --- a/webapp/src/app/api/model/score.ts +++ b/webapp/src/app/api/model/score.ts @@ -1,14 +1,11 @@ /** * Innovation Search Engine API * - * + * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech * Do not edit the class manually. */ - -export interface Score { -} - +export interface Score {} diff --git a/webapp/src/app/api/model/sortDirection.ts b/webapp/src/app/api/model/sortDirection.ts index 4f9362f2..49933995 100644 --- a/webapp/src/app/api/model/sortDirection.ts +++ b/webapp/src/app/api/model/sortDirection.ts @@ -1,17 +1,15 @@ /** * Innovation Search Engine API * - * + * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech * Do not edit the class manually. */ - export const SortDirection = { - Asc: 'asc', - Desc: 'desc' + Asc: 'asc', + Desc: 'desc', } as const; -export type SortDirection = typeof SortDirection[keyof typeof SortDirection]; - +export type SortDirection = (typeof SortDirection)[keyof typeof SortDirection]; diff --git a/webapp/src/app/api/model/tokenType.ts b/webapp/src/app/api/model/tokenType.ts index 06231c11..88512eb6 100644 --- a/webapp/src/app/api/model/tokenType.ts +++ b/webapp/src/app/api/model/tokenType.ts @@ -1,18 +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 const TokenType = { - Id: 'ID', - Refresh: 'REFRESH', - Access: 'ACCESS' + IdToken: 'ID_TOKEN', + RefreshToken: 'REFRESH_TOKEN', + AccessToken: 'ACCESS_TOKEN', } as const; -export type TokenType = typeof TokenType[keyof typeof TokenType]; - +export type TokenType = (typeof TokenType)[keyof typeof TokenType]; diff --git a/webapp/src/app/api/model/topic.ts b/webapp/src/app/api/model/topic.ts index 9fc0ee63..eaac16f6 100644 --- a/webapp/src/app/api/model/topic.ts +++ b/webapp/src/app/api/model/topic.ts @@ -1,7 +1,7 @@ /** * Innovation Search Engine API * - * + * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech @@ -12,23 +12,21 @@ import { TopicIds } from './topicIds'; import { TopicSubfield } from './topicSubfield'; import { TopicField } from './topicField'; - /** * A research topic automatically assigned to works */ -export interface Topic { - id?: string | null; - display_name?: string | null; - description?: string | null; - keywords?: Array | null; - subfield?: TopicSubfield | null; - field?: TopicField | null; - domain?: TopicDomain | null; - works_count?: number | null; - cited_by_count?: number | null; - ids?: TopicIds | null; - works_api_url?: string | null; - created_date?: string | null; - updated_date?: string | null; +export interface Topic { + id?: string | null; + display_name?: string | null; + description?: string | null; + keywords?: Array | null; + subfield?: TopicSubfield | null; + field?: TopicField | null; + domain?: TopicDomain | null; + works_count?: number | null; + cited_by_count?: number | null; + ids?: TopicIds | null; + works_api_url?: string | null; + created_date?: string | null; + updated_date?: string | null; } - diff --git a/webapp/src/app/api/model/topicCount.ts b/webapp/src/app/api/model/topicCount.ts index b929a51d..1d2abe90 100644 --- a/webapp/src/app/api/model/topicCount.ts +++ b/webapp/src/app/api/model/topicCount.ts @@ -1,33 +1,31 @@ /** * Innovation Search Engine API * - * + * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech * Do not edit the class manually. */ - -export interface TopicCount { - id?: string | null; - /** - * The topic display name. - */ - name: string; - /** - * The number of occurrences. - */ - count?: number; - description?: string | null; - subfield_id?: string | null; - subfield_name?: string | null; - subfield_description?: string | null; - field_id?: string | null; - field_name?: string | null; - field_description?: string | null; - domain_id?: string | null; - domain_name?: string | null; - domain_description?: string | null; +export interface TopicCount { + id?: string | null; + /** + * The topic display name. + */ + name: string; + /** + * The number of occurrences. + */ + count?: number; + description?: string | null; + subfield_id?: string | null; + subfield_name?: string | null; + subfield_description?: string | null; + field_id?: string | null; + field_name?: string | null; + field_description?: string | null; + domain_id?: string | null; + domain_name?: string | null; + domain_description?: string | null; } - diff --git a/webapp/src/app/api/model/topicDomain.ts b/webapp/src/app/api/model/topicDomain.ts index 652b1bca..573bef0d 100644 --- a/webapp/src/app/api/model/topicDomain.ts +++ b/webapp/src/app/api/model/topicDomain.ts @@ -1,19 +1,17 @@ /** * Innovation Search Engine API * - * + * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech * Do not edit the class manually. */ - /** * The domain (highest level) containing this topic: */ -export interface TopicDomain { - id?: string | null; - display_name?: string | null; +export interface TopicDomain { + id?: string | null; + display_name?: string | null; } - diff --git a/webapp/src/app/api/model/topicField.ts b/webapp/src/app/api/model/topicField.ts index c7351675..cd7d08c8 100644 --- a/webapp/src/app/api/model/topicField.ts +++ b/webapp/src/app/api/model/topicField.ts @@ -1,19 +1,17 @@ /** * Innovation Search Engine API * - * + * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech * Do not edit the class manually. */ - /** * The field (second level) containing this topic: */ -export interface TopicField { - id?: string | null; - display_name?: string | null; +export interface TopicField { + id?: string | null; + display_name?: string | null; } - diff --git a/webapp/src/app/api/model/topicIds.ts b/webapp/src/app/api/model/topicIds.ts index 4aa6738f..22ca3343 100644 --- a/webapp/src/app/api/model/topicIds.ts +++ b/webapp/src/app/api/model/topicIds.ts @@ -1,19 +1,17 @@ /** * Innovation Search Engine API * - * + * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech * Do not edit the class manually. */ - /** * External identifiers: */ -export interface TopicIds { - openalex?: string | null; - wikipedia?: string | null; +export interface TopicIds { + openalex?: string | null; + wikipedia?: string | null; } - diff --git a/webapp/src/app/api/model/topicSubfield.ts b/webapp/src/app/api/model/topicSubfield.ts index 53d37842..79f3c9c7 100644 --- a/webapp/src/app/api/model/topicSubfield.ts +++ b/webapp/src/app/api/model/topicSubfield.ts @@ -1,19 +1,17 @@ /** * Innovation Search Engine API * - * + * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech * Do not edit the class manually. */ - /** * The subfield (third level) containing this topic: */ -export interface TopicSubfield { - id?: string | null; - display_name?: string | null; +export interface TopicSubfield { + id?: string | null; + display_name?: string | null; } - diff --git a/webapp/src/app/api/model/topics.ts b/webapp/src/app/api/model/topics.ts index 44f0eb98..cf40ff1d 100644 --- a/webapp/src/app/api/model/topics.ts +++ b/webapp/src/app/api/model/topics.ts @@ -1,14 +1,11 @@ /** * Innovation Search Engine API * - * + * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech * Do not edit the class manually. */ - -export interface Topics { -} - +export interface Topics {} diff --git a/webapp/src/app/api/model/topicsByTime.ts b/webapp/src/app/api/model/topicsByTime.ts index 8af7c9bb..007dc43d 100644 --- a/webapp/src/app/api/model/topicsByTime.ts +++ b/webapp/src/app/api/model/topicsByTime.ts @@ -1,7 +1,7 @@ /** * Innovation Search Engine API * - * + * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech @@ -9,27 +9,25 @@ */ import { TopicsByYear } from './topicsByYear'; - -export interface TopicsByTime { - /** - * Topics grouped by year. - */ - elements?: Array; - /** - * The number of years. - */ - total?: number; - /** - * True if the timeline contains only a limited subset of the author\'s publications. - */ - is_limited?: boolean; - /** - * The number of publications used to build the timeline. - */ - used_publications?: number; - /** - * The total number of publications found for this author. - */ - total_publications?: number; +export interface TopicsByTime { + /** + * Topics grouped by year. + */ + elements?: Array; + /** + * The number of years. + */ + total?: number; + /** + * True if the timeline contains only a limited subset of the author\'s publications. + */ + is_limited?: boolean; + /** + * The number of publications used to build the timeline. + */ + used_publications?: number; + /** + * The total number of publications found for this author. + */ + total_publications?: number; } - diff --git a/webapp/src/app/api/model/topicsByYear.ts b/webapp/src/app/api/model/topicsByYear.ts index fded8da0..bb2f1820 100644 --- a/webapp/src/app/api/model/topicsByYear.ts +++ b/webapp/src/app/api/model/topicsByYear.ts @@ -1,7 +1,7 @@ /** * Innovation Search Engine API * - * + * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech @@ -9,23 +9,21 @@ */ import { TopicCount } from './topicCount'; - -export interface TopicsByYear { - /** - * The publication year. - */ - year: number; - /** - * The number of works in this year. - */ - publication_count?: number; - /** - * The topics in this year. - */ - topics?: Array; - /** - * The primary topics in this year. - */ - primary_topics?: Array; +export interface TopicsByYear { + /** + * The publication year. + */ + year: number; + /** + * The number of works in this year. + */ + publication_count?: number; + /** + * The topics in this year. + */ + topics?: Array; + /** + * The primary topics in this year. + */ + primary_topics?: Array; } - diff --git a/webapp/src/app/api/model/topicsListResponse.ts b/webapp/src/app/api/model/topicsListResponse.ts index 43f21226..058b45fd 100644 --- a/webapp/src/app/api/model/topicsListResponse.ts +++ b/webapp/src/app/api/model/topicsListResponse.ts @@ -1,7 +1,7 @@ /** * Innovation Search Engine API * - * + * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech @@ -11,13 +11,11 @@ import { Meta } from './meta'; import { GroupByResult } from './groupByResult'; import { Topic } from './topic'; - /** * TopicsListResponse */ -export interface TopicsListResponse { - meta?: Meta | null; - results?: Array | null; - group_by?: Array | null; +export interface TopicsListResponse { + meta?: Meta | null; + results?: Array | null; + group_by?: Array | null; } - diff --git a/webapp/src/app/api/model/universityRanking.ts b/webapp/src/app/api/model/universityRanking.ts index 3099e73e..5c9d0d05 100644 --- a/webapp/src/app/api/model/universityRanking.ts +++ b/webapp/src/app/api/model/universityRanking.ts @@ -1,30 +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 UniversityRanking { - rank: number; - university: string; - publications: number; - citations: number; - growth_rate: number; - trend: UniversityRanking.TrendEnum; - is_top_mover: boolean; +export interface UniversityRanking { + rank: number; + university: string; + publications: number; + citations: number; + growth_rate: number; + trend: UniversityRanking.TrendEnum; + is_top_mover: boolean; } export namespace UniversityRanking { - export const TrendEnum = { - Up: 'up', - Down: 'down', - Stable: 'stable' - } as const; - export type TrendEnum = typeof TrendEnum[keyof typeof TrendEnum]; + export const TrendEnum = { + Up: 'up', + Down: 'down', + Stable: 'stable', + } as const; + export type TrendEnum = (typeof TrendEnum)[keyof typeof TrendEnum]; } - - diff --git a/webapp/src/app/api/model/userRole.ts b/webapp/src/app/api/model/userRole.ts index 83b5c595..f6d08b53 100644 --- a/webapp/src/app/api/model/userRole.ts +++ b/webapp/src/app/api/model/userRole.ts @@ -1,19 +1,17 @@ /** * Innovation Search Engine API * - * + * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech * Do not edit the class manually. */ - export const UserRole = { - SuperAdmin: 'SUPER_ADMIN', - Admin: 'ADMIN', - Manager: 'MANAGER', - User: 'USER' + SuperAdmin: 'SUPER_ADMIN', + Admin: 'ADMIN', + Manager: 'MANAGER', + User: 'USER', } as const; -export type UserRole = typeof UserRole[keyof typeof UserRole]; - +export type UserRole = (typeof UserRole)[keyof typeof UserRole]; diff --git a/webapp/src/app/api/model/validationError.ts b/webapp/src/app/api/model/validationError.ts index bdbd57ad..18cd1b61 100644 --- a/webapp/src/app/api/model/validationError.ts +++ b/webapp/src/app/api/model/validationError.ts @@ -1,7 +1,7 @@ /** * Innovation Search Engine API * - * + * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech @@ -9,10 +9,8 @@ */ import { ValidationErrorLocInner } from './validationErrorLocInner'; - -export interface ValidationError { - loc: Array; - msg: string; - type: string; +export interface ValidationError { + loc: Array; + msg: string; + type: string; } - diff --git a/webapp/src/app/api/model/validationErrorLocInner.ts b/webapp/src/app/api/model/validationErrorLocInner.ts index d248a9b7..3c1ffa29 100644 --- a/webapp/src/app/api/model/validationErrorLocInner.ts +++ b/webapp/src/app/api/model/validationErrorLocInner.ts @@ -1,14 +1,11 @@ /** * Innovation Search Engine API * - * + * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech * Do not edit the class manually. */ - -export interface ValidationErrorLocInner { -} - +export interface ValidationErrorLocInner {} diff --git a/webapp/src/app/api/model/value.ts b/webapp/src/app/api/model/value.ts index a9fc79ba..016b21cb 100644 --- a/webapp/src/app/api/model/value.ts +++ b/webapp/src/app/api/model/value.ts @@ -1,14 +1,11 @@ /** * Innovation Search Engine API * - * + * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech * Do not edit the class manually. */ - -export interface Value { -} - +export interface Value {} diff --git a/webapp/src/app/api/model/work.ts b/webapp/src/app/api/model/work.ts index 07d94a1c..6c6ae99b 100644 --- a/webapp/src/app/api/model/work.ts +++ b/webapp/src/app/api/model/work.ts @@ -1,7 +1,7 @@ /** * Innovation Search Engine API * - * + * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech @@ -24,48 +24,46 @@ import { WorkHasContent } from './workHasContent'; import { Location } from './location'; import { WorkBiblio } from './workBiblio'; - /** * A scholarly document (article, book, dataset, thesis, etc.) */ -export interface Work { - id?: string | null; - doi?: string | null; - title?: string | null; - display_name?: string | null; - publication_year?: number | null; - publication_date?: string | null; - type?: string | null; - language?: string | null; - cited_by_count?: number | null; - is_retracted?: boolean | null; - is_paratext?: boolean | null; - primary_location?: Location | null; - locations?: Array | null; - best_oa_location?: Location | null; - open_access?: OpenAccess | null; - authorships?: Array | null; - ids?: WorkIds | null; - biblio?: WorkBiblio | null; - abstract_inverted_index?: object | null; - referenced_works?: Array | null; - referenced_works_count?: number | null; - related_works?: Array | null; - topics?: Array | null; - primary_topic?: WorkTopic | null; - keywords?: Array | null; - funders?: Array | null; - awards?: Array | null; - fwci?: Fwci | null; - citation_normalized_percentile?: WorkCitationNormalizedPercentile | null; - cited_by_percentile_year?: WorkCitedByPercentileYear | null; - counts_by_year?: Array | null; - sustainable_development_goals?: Array | null; - mesh?: Array | null; - indexed_in?: Array | null; - has_content?: WorkHasContent | null; - content_url?: string | null; - created_date?: string | null; - updated_date?: string | null; +export interface Work { + id?: string | null; + doi?: string | null; + title?: string | null; + display_name?: string | null; + publication_year?: number | null; + publication_date?: string | null; + type?: string | null; + language?: string | null; + cited_by_count?: number | null; + is_retracted?: boolean | null; + is_paratext?: boolean | null; + primary_location?: Location | null; + locations?: Array | null; + best_oa_location?: Location | null; + open_access?: OpenAccess | null; + authorships?: Array | null; + ids?: WorkIds | null; + biblio?: WorkBiblio | null; + abstract_inverted_index?: object | null; + referenced_works?: Array | null; + referenced_works_count?: number | null; + related_works?: Array | null; + topics?: Array | null; + primary_topic?: WorkTopic | null; + keywords?: Array | null; + funders?: Array | null; + awards?: Array | null; + fwci?: Fwci | null; + citation_normalized_percentile?: WorkCitationNormalizedPercentile | null; + cited_by_percentile_year?: WorkCitedByPercentileYear | null; + counts_by_year?: Array | null; + sustainable_development_goals?: Array | null; + mesh?: Array | null; + indexed_in?: Array | null; + has_content?: WorkHasContent | null; + content_url?: string | null; + created_date?: string | null; + updated_date?: string | null; } - diff --git a/webapp/src/app/api/model/workBiblio.ts b/webapp/src/app/api/model/workBiblio.ts index f6d7079b..65c0a34b 100644 --- a/webapp/src/app/api/model/workBiblio.ts +++ b/webapp/src/app/api/model/workBiblio.ts @@ -1,21 +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. */ - /** * Bibliographic info: `volume`, `issue`, `first_page`, `last_page`. */ -export interface WorkBiblio { - volume?: string | null; - issue?: string | null; - first_page?: string | null; - last_page?: string | null; +export interface WorkBiblio { + volume?: string | null; + issue?: string | null; + first_page?: string | null; + last_page?: string | null; } - diff --git a/webapp/src/app/api/model/workCitationNormalizedPercentile.ts b/webapp/src/app/api/model/workCitationNormalizedPercentile.ts index a587ddf6..4a2bc6d4 100644 --- a/webapp/src/app/api/model/workCitationNormalizedPercentile.ts +++ b/webapp/src/app/api/model/workCitationNormalizedPercentile.ts @@ -1,7 +1,7 @@ /** * Innovation Search Engine API * - * + * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech @@ -9,13 +9,11 @@ */ import { Value } from './value'; - /** * Percentile of citation count normalized by work type, year, and subfield. Includes `value`, `is_in_top_1_percent`, `is_in_top_10_percent`. */ -export interface WorkCitationNormalizedPercentile { - value?: Value | null; - is_in_top_1_percent?: boolean | null; - is_in_top_10_percent?: boolean | null; +export interface WorkCitationNormalizedPercentile { + value?: Value | null; + is_in_top_1_percent?: boolean | null; + is_in_top_10_percent?: boolean | null; } - diff --git a/webapp/src/app/api/model/workCitedByPercentileYear.ts b/webapp/src/app/api/model/workCitedByPercentileYear.ts index 5257eb3b..7bcd3c85 100644 --- a/webapp/src/app/api/model/workCitedByPercentileYear.ts +++ b/webapp/src/app/api/model/workCitedByPercentileYear.ts @@ -1,19 +1,17 @@ /** * Innovation Search Engine API * - * + * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech * Do not edit the class manually. */ - /** * Percentile rank compared to other works published in the same year. Contains `min` and `max`. */ -export interface WorkCitedByPercentileYear { - min?: number | null; - max?: number | null; +export interface WorkCitedByPercentileYear { + min?: number | null; + max?: number | null; } - diff --git a/webapp/src/app/api/model/workCountsByYearInner.ts b/webapp/src/app/api/model/workCountsByYearInner.ts index 76d97d77..496a11db 100644 --- a/webapp/src/app/api/model/workCountsByYearInner.ts +++ b/webapp/src/app/api/model/workCountsByYearInner.ts @@ -1,19 +1,17 @@ /** * Innovation Search Engine API * - * + * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech * Do not edit the class manually. */ - /** * WorkCountsByYearInner */ -export interface WorkCountsByYearInner { - year?: number | null; - cited_by_count?: number | null; +export interface WorkCountsByYearInner { + year?: number | null; + cited_by_count?: number | null; } - diff --git a/webapp/src/app/api/model/workHasContent.ts b/webapp/src/app/api/model/workHasContent.ts index 44fbe446..76871238 100644 --- a/webapp/src/app/api/model/workHasContent.ts +++ b/webapp/src/app/api/model/workHasContent.ts @@ -1,19 +1,17 @@ /** * Innovation Search Engine API * - * + * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech * Do not edit the class manually. */ - /** * Information about downloadable full-text content: */ -export interface WorkHasContent { - pdf?: boolean | null; - grobid_xml?: boolean | null; +export interface WorkHasContent { + pdf?: boolean | null; + grobid_xml?: boolean | null; } - diff --git a/webapp/src/app/api/model/workIds.ts b/webapp/src/app/api/model/workIds.ts index e8315250..fe562e40 100644 --- a/webapp/src/app/api/model/workIds.ts +++ b/webapp/src/app/api/model/workIds.ts @@ -1,22 +1,20 @@ /** * Innovation Search Engine API * - * + * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech * Do not edit the class manually. */ - /** * External identifiers: `openalex`, `doi`, `mag`, `pmid`, `pmcid`. */ -export interface WorkIds { - openalex?: string | null; - doi?: string | null; - mag?: number | null; - pmid?: string | null; - pmcid?: string | null; +export interface WorkIds { + openalex?: string | null; + doi?: string | null; + mag?: number | null; + pmid?: string | null; + pmcid?: string | null; } - diff --git a/webapp/src/app/api/model/workKeyword.ts b/webapp/src/app/api/model/workKeyword.ts index c9c99afb..7270db25 100644 --- a/webapp/src/app/api/model/workKeyword.ts +++ b/webapp/src/app/api/model/workKeyword.ts @@ -1,7 +1,7 @@ /** * Innovation Search Engine API * - * + * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech @@ -9,13 +9,11 @@ */ import { Score } from './score'; - /** * WorkKeyword */ -export interface WorkKeyword { - id?: string | null; - display_name?: string | null; - score?: Score | null; +export interface WorkKeyword { + id?: string | null; + display_name?: string | null; + score?: Score | null; } - diff --git a/webapp/src/app/api/model/workMeshInner.ts b/webapp/src/app/api/model/workMeshInner.ts index 40633524..36a0c569 100644 --- a/webapp/src/app/api/model/workMeshInner.ts +++ b/webapp/src/app/api/model/workMeshInner.ts @@ -1,22 +1,20 @@ /** * Innovation Search Engine API * - * + * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech * Do not edit the class manually. */ - /** * WorkMeshInner */ -export interface WorkMeshInner { - descriptor_ui?: string | null; - descriptor_name?: string | null; - qualifier_ui?: string | null; - qualifier_name?: string | null; - is_major_topic?: boolean | null; +export interface WorkMeshInner { + descriptor_ui?: string | null; + descriptor_name?: string | null; + qualifier_ui?: string | null; + qualifier_name?: string | null; + is_major_topic?: boolean | null; } - diff --git a/webapp/src/app/api/model/workNetworkNode.ts b/webapp/src/app/api/model/workNetworkNode.ts index abc04a69..445cd8ad 100644 --- a/webapp/src/app/api/model/workNetworkNode.ts +++ b/webapp/src/app/api/model/workNetworkNode.ts @@ -1,7 +1,7 @@ /** * Innovation Search Engine API * - * + * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech @@ -10,24 +10,20 @@ import { WorkTopicInformation } from './workTopicInformation'; import { CollaborationNetworkNodeType } from './collaborationNetworkNodeType'; - -export interface WorkNetworkNode { - /** - * The raw ID of the node. For an author node, this is the raw person ID. For an institution node, this is the raw institution ID. For a work node, this is the raw work ID. - */ - raw_id: string; - /** - * The display name of the node. - */ - display_name: string; - /** - * The category of the node, either \'author\', \'institution\', or \'work\'. - */ - category: CollaborationNetworkNodeType; - publication_year: number | null; - work_topics_information: Set | null; +export interface WorkNetworkNode { + /** + * The raw ID of the node. For an author node, this is the raw person ID. For an institution node, this is the raw institution ID. For a work node, this is the raw work ID. + */ + raw_id: string; + /** + * The display name of the node. + */ + display_name: string; + /** + * The category of the node, either \'author\', \'institution\', or \'work\'. + */ + category: CollaborationNetworkNodeType; + publication_year: number | null; + work_topics_information: Set | null; } -export namespace WorkNetworkNode { -} - - +export namespace WorkNetworkNode {} diff --git a/webapp/src/app/api/model/workPage.ts b/webapp/src/app/api/model/workPage.ts index 8490c3ab..285d2065 100644 --- a/webapp/src/app/api/model/workPage.ts +++ b/webapp/src/app/api/model/workPage.ts @@ -1,7 +1,7 @@ /** * Innovation Search Engine API * - * + * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech @@ -9,27 +9,25 @@ */ import { Work } from './work'; - -export interface WorkPage { - /** - * Total number of works matching the query - */ - total: number; - /** - * List of works on the current page - */ - elements: Array; - /** - * Offset of the current page - */ - offset: number; - /** - * Size of the current page - */ - size: number; - /** - * Indicates if the current page is the last page - */ - last_page: boolean; +export interface WorkPage { + /** + * Total number of works matching the query + */ + total: number; + /** + * List of works on the current page + */ + elements: Array; + /** + * Offset of the current page + */ + offset: number; + /** + * Size of the current page + */ + size: number; + /** + * Indicates if the current page is the last page + */ + last_page: boolean; } - diff --git a/webapp/src/app/api/model/workSustainableDevelopmentGoalsInner.ts b/webapp/src/app/api/model/workSustainableDevelopmentGoalsInner.ts index c9ecd00f..8bc67292 100644 --- a/webapp/src/app/api/model/workSustainableDevelopmentGoalsInner.ts +++ b/webapp/src/app/api/model/workSustainableDevelopmentGoalsInner.ts @@ -1,7 +1,7 @@ /** * Innovation Search Engine API * - * + * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech @@ -9,13 +9,11 @@ */ import { Score } from './score'; - /** * WorkSustainableDevelopmentGoalsInner */ -export interface WorkSustainableDevelopmentGoalsInner { - id?: string | null; - display_name?: string | null; - score?: Score | null; +export interface WorkSustainableDevelopmentGoalsInner { + id?: string | null; + display_name?: string | null; + score?: Score | null; } - diff --git a/webapp/src/app/api/model/workTopic.ts b/webapp/src/app/api/model/workTopic.ts index 925ead4f..4b365f33 100644 --- a/webapp/src/app/api/model/workTopic.ts +++ b/webapp/src/app/api/model/workTopic.ts @@ -1,7 +1,7 @@ /** * Innovation Search Engine API * - * + * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech @@ -12,16 +12,15 @@ import { WorkTopicDomain } from './workTopicDomain'; import { WorkTopicSubfield } from './workTopicSubfield'; import { WorkTopicField } from './workTopicField'; - /** * WorkTopic */ -export interface WorkTopic { - id?: string | null; - display_name?: string | null; - score?: Score | null; - subfield?: WorkTopicSubfield | null; - field?: WorkTopicField | null; - domain?: WorkTopicDomain | null; +export interface WorkTopic { + id?: string | null; + display_name?: string | null; + description?: string | null; + score?: Score | null; + subfield?: WorkTopicSubfield | null; + field?: WorkTopicField | null; + domain?: WorkTopicDomain | null; } - diff --git a/webapp/src/app/api/model/workTopicDomain.ts b/webapp/src/app/api/model/workTopicDomain.ts index 1a9879d4..13b227df 100644 --- a/webapp/src/app/api/model/workTopicDomain.ts +++ b/webapp/src/app/api/model/workTopicDomain.ts @@ -1,19 +1,17 @@ /** * Innovation Search Engine API * - * + * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech * Do not edit the class manually. */ - /** * The parent [domain](/api-reference/domains) */ -export interface WorkTopicDomain { - id?: string | null; - display_name?: string | null; +export interface WorkTopicDomain { + id?: string | null; + display_name?: string | null; } - diff --git a/webapp/src/app/api/model/workTopicField.ts b/webapp/src/app/api/model/workTopicField.ts index 1807cfc1..432b993e 100644 --- a/webapp/src/app/api/model/workTopicField.ts +++ b/webapp/src/app/api/model/workTopicField.ts @@ -1,19 +1,17 @@ /** * Innovation Search Engine API * - * + * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech * Do not edit the class manually. */ - /** * The parent [field](/api-reference/fields) */ -export interface WorkTopicField { - id?: string | null; - display_name?: string | null; +export interface WorkTopicField { + id?: string | null; + display_name?: string | null; } - diff --git a/webapp/src/app/api/model/workTopicInformation.ts b/webapp/src/app/api/model/workTopicInformation.ts index ca3b9454..5dbbfc78 100644 --- a/webapp/src/app/api/model/workTopicInformation.ts +++ b/webapp/src/app/api/model/workTopicInformation.ts @@ -1,22 +1,20 @@ /** * Innovation Search Engine API * - * + * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech * Do not edit the class manually. */ - -export interface WorkTopicInformation { - /** - * The ID of the topic. - */ - raw_topic_id: string; - /** - * The name of the topic. - */ - display_name: string; +export interface WorkTopicInformation { + /** + * The ID of the topic. + */ + raw_topic_id: string; + /** + * The name of the topic. + */ + display_name: string; } - diff --git a/webapp/src/app/api/model/workTopicSubfield.ts b/webapp/src/app/api/model/workTopicSubfield.ts index b6e7278a..49c1155b 100644 --- a/webapp/src/app/api/model/workTopicSubfield.ts +++ b/webapp/src/app/api/model/workTopicSubfield.ts @@ -1,19 +1,17 @@ /** * Innovation Search Engine API * - * + * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech * Do not edit the class manually. */ - /** * The parent [subfield](/api-reference/subfields) */ -export interface WorkTopicSubfield { - id?: string | null; - display_name?: string | null; +export interface WorkTopicSubfield { + id?: string | null; + display_name?: string | null; } - diff --git a/webapp/src/app/api/model/worksFilterProperties.ts b/webapp/src/app/api/model/worksFilterProperties.ts index bd6cc9a4..fd25fd26 100644 --- a/webapp/src/app/api/model/worksFilterProperties.ts +++ b/webapp/src/app/api/model/worksFilterProperties.ts @@ -1,34 +1,32 @@ /** * Innovation Search Engine API * - * + * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech * Do not edit the class manually. */ - -export interface WorksFilterProperties { - /** - * The start publication year for the works to include in the collaboration network. - */ - start_year?: number; - /** - * The end publication year for the works to include in the collaboration network. - */ - end_year?: number; - /** - * The list of raw topic IDs to include in the collaboration network. If empty, all topics will be included. - */ - allowed_topics?: Array; - /** - * The minimum number of contributors required for a work to be included in the collaboration network. - */ - min_contributors?: number; - /** - * The maximum number of contributors allowed for a work to be included in the collaboration network. - */ - max_contributors?: number; +export interface WorksFilterProperties { + /** + * The start publication year for the works to include in the collaboration network. + */ + start_year?: number; + /** + * The end publication year for the works to include in the collaboration network. + */ + end_year?: number; + /** + * The list of raw topic IDs to include in the collaboration network. If empty, all topics will be included. + */ + allowed_topics?: Array; + /** + * The minimum number of contributors required for a work to be included in the collaboration network. + */ + min_contributors?: number; + /** + * The maximum number of contributors allowed for a work to be included in the collaboration network. + */ + max_contributors?: number; } - diff --git a/webapp/src/app/api/model/worksListResponse.ts b/webapp/src/app/api/model/worksListResponse.ts index a65d3849..bc21a41b 100644 --- a/webapp/src/app/api/model/worksListResponse.ts +++ b/webapp/src/app/api/model/worksListResponse.ts @@ -1,7 +1,7 @@ /** * Innovation Search Engine API * - * + * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech @@ -11,13 +11,11 @@ import { Meta } from './meta'; import { Work } from './work'; import { GroupByResult } from './groupByResult'; - /** * WorksListResponse */ -export interface WorksListResponse { - meta?: Meta | null; - results?: Array | null; - group_by?: Array | null; +export interface WorksListResponse { + meta?: Meta | null; + results?: Array | null; + group_by?: Array | null; } - diff --git a/webapp/src/app/api/model/yearlyData.ts b/webapp/src/app/api/model/yearlyData.ts index 3272805e..d473f13e 100644 --- a/webapp/src/app/api/model/yearlyData.ts +++ b/webapp/src/app/api/model/yearlyData.ts @@ -1,17 +1,15 @@ /** * Innovation Search Engine API * - * + * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech * Do not edit the class manually. */ - -export interface YearlyData { - year: number; - publications: number; - citations: number; +export interface YearlyData { + year: number; + publications: number; + citations: number; } - diff --git a/webapp/src/app/api/param.ts b/webapp/src/app/api/param.ts index 78a2d20a..486c804e 100644 --- a/webapp/src/app/api/param.ts +++ b/webapp/src/app/api/param.ts @@ -8,8 +8,7 @@ export type StandardParamStyle = | 'simple' | 'spaceDelimited' | 'pipeDelimited' - | 'deepObject' - ; + | 'deepObject'; /** * The OpenAPI standard {@link StandardParamStyle}s may be extended by custom styles by the user. @@ -25,13 +24,12 @@ export type ParamLocation = 'query' | 'header' | 'path' | 'cookie'; * Standard types as defined in OpenAPI Specification: Data Types */ export type StandardDataType = - | "integer" - | "number" - | "boolean" - | "string" - | "object" - | "array" - ; + | 'integer' + | 'number' + | 'boolean' + | 'string' + | 'object' + | 'array'; /** * Standard {@link DataType}s plus your own types/classes. @@ -42,16 +40,15 @@ export type DataType = StandardDataType | string; * Standard formats as defined in OpenAPI Specification: Data Types */ export type StandardDataFormat = - | "int32" - | "int64" - | "float" - | "double" - | "byte" - | "binary" - | "date" - | "date-time" - | "password" - ; + | 'int32' + | 'int64' + | 'float' + | 'double' + | 'byte' + | 'binary' + | 'date' + | 'date-time' + | 'password'; export type DataFormat = StandardDataFormat | string; @@ -62,7 +59,7 @@ export interface Param { name: string; value: unknown; in: ParamLocation; - style: ParamStyle, + style: ParamStyle; explode: boolean; dataType: DataType; dataFormat: DataFormat | undefined; diff --git a/webapp/src/app/api/provide-api.ts b/webapp/src/app/api/provide-api.ts index 19c762ac..960132f8 100644 --- a/webapp/src/app/api/provide-api.ts +++ b/webapp/src/app/api/provide-api.ts @@ -1,15 +1,17 @@ -import { EnvironmentProviders, makeEnvironmentProviders } from "@angular/core"; +import { EnvironmentProviders, makeEnvironmentProviders } from '@angular/core'; import { Configuration, ConfigurationParameters } from './configuration'; import { BASE_PATH } from './variables'; // Returns the service class providers, to be used in the [ApplicationConfig](https://angular.dev/api/core/ApplicationConfig). -export function provideApi(configOrBasePath: string | ConfigurationParameters): EnvironmentProviders { - return makeEnvironmentProviders([ - typeof configOrBasePath === "string" - ? { provide: BASE_PATH, useValue: configOrBasePath } - : { - provide: Configuration, - useValue: new Configuration({ ...configOrBasePath }), - }, - ]); -} \ No newline at end of file +export function provideApi( + configOrBasePath: string | ConfigurationParameters, +): EnvironmentProviders { + return makeEnvironmentProviders([ + typeof configOrBasePath === 'string' + ? { provide: BASE_PATH, useValue: configOrBasePath } + : { + provide: Configuration, + useValue: new Configuration({ ...configOrBasePath }), + }, + ]); +} diff --git a/webapp/src/app/api/variables.ts b/webapp/src/app/api/variables.ts index 6fe58549..2277a9cc 100644 --- a/webapp/src/app/api/variables.ts +++ b/webapp/src/app/api/variables.ts @@ -2,8 +2,8 @@ import { InjectionToken } from '@angular/core'; export const BASE_PATH = new InjectionToken('basePath'); export const COLLECTION_FORMATS = { - 'csv': ',', - 'tsv': ' ', - 'ssv': ' ', - 'pipes': '|' -} + csv: ',', + tsv: ' ', + ssv: ' ', + pipes: '|', +}; diff --git a/webapp/src/app/app.config.ts b/webapp/src/app/app.config.ts index 3b700752..0d7f746c 100644 --- a/webapp/src/app/app.config.ts +++ b/webapp/src/app/app.config.ts @@ -5,6 +5,7 @@ import { Router, withComponentInputBinding, withNavigationErrorHandler, + withRouterConfig, } from '@angular/router'; import { routes } from './app.routes'; @@ -37,6 +38,7 @@ export const appConfig: ApplicationConfig = { provideRouter( routes, withComponentInputBinding(), + withRouterConfig({ onSameUrlNavigation: 'reload' }), withNavigationErrorHandler((navigationError: NavigationError) => { const router = inject(Router); const errorService = inject(ErrorService); diff --git a/webapp/src/app/app.routes.ts b/webapp/src/app/app.routes.ts index 4f8758d7..ac603aae 100644 --- a/webapp/src/app/app.routes.ts +++ b/webapp/src/app/app.routes.ts @@ -8,7 +8,6 @@ import { personResolver } from './resolvers/person.resolver'; import { institutionResolver } from './resolvers/institution.resolver'; import { bundProjectPageResolver } from './resolvers/bund-project-page.resolver'; import { dfgProjectsResolver } from './resolvers/dfg-projects.resolver'; -import { personNewsResolver } from './resolvers/person-news.resolver'; import { institutionsResolver } from './resolvers/institutions.resolver'; import { bundProjectsFundingResolver } from './resolvers/bund-projects-funding.resolver'; import { dfgSingleProjectResolver } from './resolvers/dfg-single-project-resolver'; @@ -20,6 +19,9 @@ import { euSingleProjectResolver } from './resolvers/eu-single-project-resolver' import { publicationResolver } from './resolvers/publication-resolver'; import { accountResolver } from './resolvers/account.resolver'; import { accountViewerGuard } from './shared/guards/account-viewer.guard'; +import { accountsPageResolver } from './resolvers/accounts-page.resolver'; +import { accountsOrganizationResolver } from './resolvers/accounts-organizations.resolver'; +import { organizationsOrganizationsResolver } from './resolvers/organizations-organizations.resolver'; export const routes: Routes = [ { @@ -114,6 +116,11 @@ export const routes: Routes = [ import('./modules/accounts/accounts.component').then( (mod) => mod.AccountsComponent, ), + resolve: { + accountPage: accountsPageResolver, + organizations: accountsOrganizationResolver, + }, + runGuardsAndResolvers: 'always', }, { path: 'organizations', @@ -122,7 +129,12 @@ export const routes: Routes = [ import('./modules/organizations/organizations.component').then( (mod) => mod.OrganizationsComponent, ), + resolve: { + organizationPage: organizationsOrganizationsResolver, + }, + runGuardsAndResolvers: 'always', }, + { path: 'news/:id', canActivate: [userGuard], diff --git a/webapp/src/app/custom-directives/sk-text.directive.ts b/webapp/src/app/custom-directives/sk-text.directive.ts index ade9c10b..e7173238 100644 --- a/webapp/src/app/custom-directives/sk-text.directive.ts +++ b/webapp/src/app/custom-directives/sk-text.directive.ts @@ -35,6 +35,7 @@ export class SkTextDirective implements OnChanges { // measure natural width before blanking text const width = Math.min(Math.max(this.originalText.length * 7.5, 48), 60); const height = 20; + this.renderer.addClass(el, 'sk-text-loading'); this.renderer.setStyle(el, 'color', 'transparent'); this.renderer.setStyle( el, @@ -47,10 +48,17 @@ export class SkTextDirective implements OnChanges { this.renderer.setStyle(el, 'min-width', `${width}px`); this.renderer.setStyle(el, 'max-height', `${height}px`); this.renderer.setStyle(el, 'display', 'inline-block'); + this.renderer.setStyle(el, 'overflow', 'hidden'); + this.renderer.setStyle(el, 'pointer-events', 'none'); + + Array.from(el.children).forEach((child) => { + this.renderer.setStyle(child, 'visibility', 'hidden'); + }); } private hideSkeleton() { const el: HTMLElement = this.el.nativeElement; + this.renderer.removeClass(el, 'sk-text-loading'); this.renderer.removeStyle(el, 'color'); this.renderer.removeStyle(el, 'background'); this.renderer.removeStyle(el, 'background-size'); @@ -59,5 +67,11 @@ export class SkTextDirective implements OnChanges { this.renderer.removeStyle(el, 'min-width'); this.renderer.removeStyle(el, 'max-height'); this.renderer.removeStyle(el, 'display'); + this.renderer.removeStyle(el, 'overflow'); + this.renderer.removeStyle(el, 'pointer-events'); + + Array.from(el.children).forEach((child) => { + this.renderer.removeStyle(child, 'visibility'); + }); } } diff --git a/webapp/src/app/modules/account/account.component.ts b/webapp/src/app/modules/account/account.component.ts index 8b3eec70..647e5a99 100644 --- a/webapp/src/app/modules/account/account.component.ts +++ b/webapp/src/app/modules/account/account.component.ts @@ -145,18 +145,19 @@ export class AccountComponent { if (!oldPassword || !newPassword) { return; } - this._credentialService - .changePassword(oldPassword, newPassword) - .subscribe({ - error: (error) => { - console.error('Error changing password:', error); - this._snackBar.open( - 'Das alte Passwort ist nicht korrekt. Bitte versuchen Sie es erneut.', - 'OK', - { duration: 7000 }, - ); - }, - }); + try { + await this._credentialService.changePassword( + oldPassword, + newPassword, + ); + } catch (error) { + console.error('Error changing password:', error); + this._snackBar.open( + 'Fehler beim Ändern des Passworts. Bitte versuchen Sie es erneut.', + 'OK', + { duration: 7000 }, + ); + } }, }, }, diff --git a/webapp/src/app/modules/accounts/account-dialog.component.html b/webapp/src/app/modules/accounts/account-dialog.component.html index 0e08dbc8..bb6d674d 100644 --- a/webapp/src/app/modules/accounts/account-dialog.component.html +++ b/webapp/src/app/modules/accounts/account-dialog.component.html @@ -46,11 +46,7 @@ - {{ - data.mode === 'create' - ? 'Initiales Passwort' - : 'Neues Passwort' - }} + {{ data.mode === 'create' ? 'Initiales Passwort' : 'Neues Passwort' }} @if (form.controls.password.hasError('required')) { diff --git a/webapp/src/app/modules/accounts/account-dialog.component.ts b/webapp/src/app/modules/accounts/account-dialog.component.ts index a10cff43..87fb87f2 100644 --- a/webapp/src/app/modules/accounts/account-dialog.component.ts +++ b/webapp/src/app/modules/accounts/account-dialog.component.ts @@ -16,22 +16,38 @@ import { MatFormFieldModule } from '@angular/material/form-field'; import { MatIconModule } from '@angular/material/icon'; import { MatInputModule } from '@angular/material/input'; import { MatSelectModule } from '@angular/material/select'; -import type { - AccountPayload, +import { AccountProfile, - AccountRole, - CreateAccountPayload, - OrganizationProfile, -} from '../../shared/services/account-management.service'; + InseAccountManagementModelOrganizationProfile, + UserRole, +} from '../../api'; export type AccountDialogMode = 'create' | 'edit'; export interface AccountDialogData { mode: AccountDialogMode; account?: AccountProfile; - organizations: OrganizationProfile[]; + organizations: InseAccountManagementModelOrganizationProfile[]; canSelectOrganization: boolean; - roles: AccountRole[]; + roles: UserRole[]; +} + +export interface AccountPayload { + email?: string; + name?: string; + role?: UserRole; + organization_id?: string; + password?: string; + deleted?: boolean; + activated?: boolean; +} + +export interface CreateAccountPayload { + email: string; + name: string; + role: UserRole; + organization_id: string; + password: string; } export type AccountDialogResult = @@ -69,7 +85,7 @@ export class AccountDialogComponent { name: new FormControl(this.data.account?.name ?? '', [ Validators.required, ]), - role: new FormControl(this.data.account?.role ?? 'USER', [ + role: new FormControl(this.data.account?.role ?? 'USER', [ Validators.required, ]), organizationId: new FormControl( @@ -148,6 +164,6 @@ export class AccountDialogComponent { } protected close(): void { - this.dialogRef.close(undefined); + this.dialogRef.close(); } } diff --git a/webapp/src/app/modules/accounts/accounts.component.html b/webapp/src/app/modules/accounts/accounts.component.html index c4629090..7e1f45e0 100644 --- a/webapp/src/app/modules/accounts/accounts.component.html +++ b/webapp/src/app/modules/accounts/accounts.component.html @@ -23,189 +23,73 @@ } -
- - Name oder E-Mail - - - - @if (credentialService.isEffectiveSuperAdmin()) { - - Organisation - - Alle Organisationen - @for (organization of organizations; track organization.id) { - - {{ organization.name }} - - } - - - } - -
- - -
-
- -
-
- {{ total }} Accounts - @if (isLoading) { - Wird geladen... - } -
- -
- - - - - - - - - @if (!isReadOnly) { - - } - - - - @for (account of accounts; track account.id) { - - - - - - - @if (!isReadOnly) { - - } - - } @empty { - - - - } - -
NameE-MailOrganisationRolleStatusAktionen
- @if (isReadOnly) { - {{ account.name }} - } @else { - - } - {{ account.email }}{{ account.organization_name }} - {{ account.role | role }} - - - {{ - account.deleted - ? 'deleted' - : account.activated - ? 'active' - : 'inactive' - }} - - -
- - - @if (credentialService.isEffectiveSuperAdmin()) { - - } - -
-
- Keine Accounts gefunden. -
-
- - +
+ +
+ + + + + +
+ + + {{ row.role | role }} + + + + + {{ + (row.deleted ? 'deleted' : row.activated ? 'active' : 'inactive') | status + }} + + + + +
+ + + + +
+
diff --git a/webapp/src/app/modules/accounts/accounts.component.scss b/webapp/src/app/modules/accounts/accounts.component.scss index 58c2be4a..dc24d512 100644 --- a/webapp/src/app/modules/accounts/accounts.component.scss +++ b/webapp/src/app/modules/accounts/accounts.component.scss @@ -155,3 +155,8 @@ tr.deactivated:not(.deleted) { flex-direction: column; } } + +mat-card, +mat-paginator { + background-color: var(--sg-background); +} diff --git a/webapp/src/app/modules/accounts/accounts.component.ts b/webapp/src/app/modules/accounts/accounts.component.ts index da287d1c..127d259c 100644 --- a/webapp/src/app/modules/accounts/accounts.component.ts +++ b/webapp/src/app/modules/accounts/accounts.component.ts @@ -1,6 +1,14 @@ import { CommonModule } from '@angular/common'; -import { Component, OnInit, inject } from '@angular/core'; -import { FormControl, FormGroup, ReactiveFormsModule } from '@angular/forms'; +import { + Component, + OnInit, + TemplateRef, + computed, + inject, + input, + viewChild, +} from '@angular/core'; +import { ReactiveFormsModule } from '@angular/forms'; import { MatButtonModule } from '@angular/material/button'; import { MatFormFieldModule } from '@angular/material/form-field'; import { MatIconModule } from '@angular/material/icon'; @@ -10,19 +18,32 @@ import { MatSnackBar, MatSnackBarModule } from '@angular/material/snack-bar'; import { MatTooltipModule } from '@angular/material/tooltip'; import { MatDialog, MatDialogModule } from '@angular/material/dialog'; import { Router } from '@angular/router'; -import { finalize } from 'rxjs'; -import { AccountManagementService } from '../../shared/services/account-management.service'; -import type { - AccountProfile, - AccountRole, - OrganizationProfile, -} from '../../shared/services/account-management.service'; + import { CredentialService } from '../../shared/services/credential.service'; import type { AccountDialogComponent, AccountDialogResult, } from './account-dialog.component'; import { RolePipe } from '../../shared/pipes/role.pipe'; +import { + GenericColumn, + DataTableComponent, +} from '../../shared/ui/data-table/data-table.component'; +import { QueryParamPaginatorComponent } from '../../shared/ui/query-param-paginator/query-param-paginator.component'; +import { QueryParamInputComponent } from '../../shared/ui/query-param-input/query-param-input.component'; +import { + QueryParamSelectorComponent, + SelectorOption, +} from '../../shared/ui/query-param-selector/query-param-selector.component'; +import { MatCardModule } from '@angular/material/card'; +import { + AccountPage, + AccountProfile, + AuthService, + InseAccountManagementModelOrganizationProfile, + UserRole, +} from '../../api'; +import { StatusPipe } from '../../shared/pipes/status.pipe'; @Component({ selector: 'app-accounts', @@ -38,95 +59,92 @@ import { RolePipe } from '../../shared/pipes/role.pipe'; MatTooltipModule, MatDialogModule, RolePipe, + DataTableComponent, + QueryParamPaginatorComponent, + QueryParamInputComponent, + QueryParamSelectorComponent, + MatCardModule, + StatusPipe, ], templateUrl: './accounts.component.html', styleUrl: './accounts.component.scss', standalone: true, }) export class AccountsComponent implements OnInit { - private readonly accountService = inject(AccountManagementService); protected readonly credentialService = inject(CredentialService); private readonly snackBar = inject(MatSnackBar); private readonly router = inject(Router); private readonly dialog = inject(MatDialog); + private readonly authService = inject(AuthService); protected get isReadOnly(): boolean { return this.credentialService.isEffectiveManager(); } - protected get availableRoles(): AccountRole[] { + accountColumns: GenericColumn[] = []; + accountRoleTmp = viewChild.required>('accountRoleTmp'); + accountStatusTmp = viewChild.required>('accountStatusTmp'); + accountActionsTmp = viewChild.required>('accountActionsTmp'); + + availableRoles = computed(() => { if (this.credentialService.isEffectiveSuperAdmin()) { return ['SUPER_ADMIN', 'ADMIN', 'MANAGER', 'USER']; } return ['MANAGER', 'USER']; - } - protected accounts: AccountProfile[] = []; - protected organizations: OrganizationProfile[] = []; - protected total = 0; - protected page = 0; - protected readonly pageSize = 10; - protected isLoading = false; - - protected filterForm = new FormGroup({ - search: new FormControl(''), - organizationId: new FormControl(''), }); + selectorOptions = computed(() => { + return this.organizations().map((org) => ({ + value: org.id, + display_name: org.name, + })); + }); + + accountPage = input.required(); + organizations = + input.required(); + ngOnInit(): void { - if (!this.isReadOnly) { - this.loadOrganizations(); - } - this.loadAccounts(); - } - - protected loadAccounts(page = this.page): void { - this.page = page; - this.isLoading = true; - this.accountService - .listAccounts({ - page: this.page, - pageSize: this.pageSize, - search: this.filterForm.controls.search.value?.trim() || undefined, - organizationId: - this.filterForm.controls.organizationId.value || undefined, - }) - .pipe(finalize(() => (this.isLoading = false))) - .subscribe({ - next: (result) => { - this.accounts = result.items; - this.total = result.total; - }, - error: () => { - this.snackBar.open('Accounts konnten nicht geladen werden.', 'OK', { - duration: 5000, - }); - }, - }); - } - - protected loadOrganizations(): void { - this.accountService.listOrganizations().subscribe({ - next: (organizations) => { - this.organizations = organizations; + this.accountColumns = [ + { + id: 'name', + header: 'Name', + type: 'accessor', + accessorKey: 'name', }, - error: () => { - this.snackBar.open( - 'Organisationen konnten nicht geladen werden.', - 'OK', - { duration: 5000 }, - ); + { + id: 'email', + header: 'E-Mail', + type: 'accessor', + accessorKey: 'email', }, - }); - } - - protected applyFilters(): void { - this.loadAccounts(0); - } - - protected resetFilters(): void { - this.filterForm.reset({ search: '', organizationId: '' }); - this.loadAccounts(0); + { + id: 'organization_name', + header: 'Organisation', + type: 'accessor', + accessorKey: 'organization_name', + }, + { + id: 'role', + header: 'Rolle', + type: 'accessor', + accessorKey: 'role', + cellTemplate: this.accountRoleTmp(), + }, + { + id: 'status', + header: 'Status', + type: 'display', + cellTemplate: this.accountStatusTmp(), + }, + { + id: 'actions', + header: 'Aktionen', + type: 'display', + cellTemplate: this.accountActionsTmp(), + }, + ]; } protected startCreate(): void { @@ -140,15 +158,18 @@ export class AccountsComponent implements OnInit { private saveDialogResult(result: AccountDialogResult): void { const request = result.mode === 'create' - ? this.accountService.createAccount(result.payload) - : this.accountService.updateAccount(result.accountId, result.payload); + ? this.authService.createAccount(result.payload) + : this.authService.updateAccount(result.accountId, result.payload); request.subscribe({ next: () => { this.snackBar.open('Account wurde gespeichert.', 'OK', { duration: 3000, }); - this.loadAccounts(0); + this.router.navigate([], { + queryParams: { page: 0 }, + queryParamsHandling: 'merge', + }); }, error: (error) => { const message = @@ -170,9 +191,9 @@ export class AccountsComponent implements OnInit { { mode: 'create' | 'edit'; account?: AccountProfile; - organizations: OrganizationProfile[]; + organizations: InseAccountManagementModelOrganizationProfile[]; canSelectOrganization: boolean; - roles: AccountRole[]; + roles: UserRole[]; }, AccountDialogResult | undefined >(AccountDialogComponent, { @@ -180,9 +201,9 @@ export class AccountsComponent implements OnInit { maxWidth: 'calc(100vw - 32px)', data: { ...data, - organizations: this.organizations, + organizations: this.organizations(), canSelectOrganization: this.credentialService.isEffectiveSuperAdmin(), - roles: this.availableRoles, + roles: this.availableRoles(), }, }); @@ -199,12 +220,15 @@ export class AccountsComponent implements OnInit { return; } - this.accountService.deleteAccount(account.id).subscribe({ + this.authService.deleteAccount(account.id).subscribe({ next: () => { this.snackBar.open('Account wurde deaktiviert.', 'OK', { duration: 3000, }); - this.loadAccounts(); + this.router.navigate([], { + queryParams: { page: 0 }, + queryParamsHandling: 'merge', + }); }, error: () => { this.snackBar.open('Account konnte nicht deaktiviert werden.', 'OK', { @@ -248,14 +272,17 @@ export class AccountsComponent implements OnInit { account: AccountProfile, activated: boolean, ): void { - this.accountService.updateAccount(account.id, { activated }).subscribe({ + this.authService.updateAccount(account.id, { activated }).subscribe({ next: () => { this.snackBar.open( activated ? 'Account wurde aktiviert.' : 'Account wurde deaktiviert.', 'OK', { duration: 3000 }, ); - this.loadAccounts(); + this.router.navigate([], { + queryParams: { page: 0 }, + queryParamsHandling: 'merge', + }); }, error: () => { this.snackBar.open( @@ -267,36 +294,24 @@ export class AccountsComponent implements OnInit { }); } - protected impersonate(account: AccountProfile): void { + protected async impersonate(account: AccountProfile): Promise { if (!this.canImpersonate(account)) { return; } - this.credentialService.impersonateAccount(account.id).subscribe({ - next: () => { - this.snackBar.open(`Impersonation aktiv: ${account.name}`, 'OK', { - duration: 4000, - }); - this.router.navigate(['/dashboard']); - }, - error: () => { - this.snackBar.open( - 'Impersonation konnte nicht gestartet werden.', - 'OK', - { - duration: 5000, - }, - ); - }, - }); - } - - protected get canPageBack(): boolean { - return this.page > 0; - } - - protected get canPageForward(): boolean { - return (this.page + 1) * this.pageSize < this.total; + try { + await this.credentialService.impersonateAccount(account.id); + this.snackBar.open(`Impersonation aktiv: ${account.name}`, 'OK', { + duration: 4000, + }); + this.router.navigate(['/dashboard']); + } catch (error) { + console.error('Impersonation failed:', error); + this.snackBar.open('Impersonation konnte nicht gestartet werden.', 'OK', { + duration: 5000, + }); + return; + } } protected canImpersonate(account: AccountProfile): boolean { diff --git a/webapp/src/app/modules/app-login/app-login.component.html b/webapp/src/app/modules/app-login/app-login.component.html index 35a4fc3e..2e090a55 100644 --- a/webapp/src/app/modules/app-login/app-login.component.html +++ b/webapp/src/app/modules/app-login/app-login.component.html @@ -53,9 +53,13 @@ mat-icon-button matSuffix type="button" - [attr.aria-label]="showPassword ? 'Passwort verbergen' : 'Passwort anzeigen'" + [attr.aria-label]=" + showPassword ? 'Passwort verbergen' : 'Passwort anzeigen' + " (click)="showPassword = !showPassword"> - {{ showPassword ? 'visibility' : 'visibility_off' }} + {{ + showPassword ? 'visibility' : 'visibility_off' + }} @if (credentialsForm.controls.password.hasError('required')) { Passwort ist erforderlich. @@ -90,7 +94,9 @@ Code eingeben Wir haben den Code an - {{ credentialsForm.controls.email.value || 'Deine E-Mail-Adresse' }} + {{ + credentialsForm.controls.email.value || 'Deine E-Mail-Adresse' + }} gesendet. diff --git a/webapp/src/app/modules/app-login/app-login.component.scss b/webapp/src/app/modules/app-login/app-login.component.scss index e5cdaf91..c09190d7 100644 --- a/webapp/src/app/modules/app-login/app-login.component.scss +++ b/webapp/src/app/modules/app-login/app-login.component.scss @@ -4,7 +4,11 @@ place-items: center; padding: 48px 20px; background: - radial-gradient(circle at top left, rgba(61, 124, 255, 0.12), transparent 34%), + radial-gradient( + circle at top left, + rgba(61, 124, 255, 0.12), + transparent 34% + ), linear-gradient(160deg, #f7f9ff 0%, #ffffff 64%); } diff --git a/webapp/src/app/modules/app-login/app-login.component.ts b/webapp/src/app/modules/app-login/app-login.component.ts index b7bca239..a8bd7fea 100644 --- a/webapp/src/app/modules/app-login/app-login.component.ts +++ b/webapp/src/app/modules/app-login/app-login.component.ts @@ -1,4 +1,4 @@ -import { Component, OnDestroy, OnInit } from '@angular/core'; +import { Component, effect, OnDestroy } from '@angular/core'; import { FormControl, FormGroup, @@ -11,7 +11,7 @@ import { MatInputModule } from '@angular/material/input'; import { CredentialService } from '../../shared/services/credential.service'; import { MatIconModule } from '@angular/material/icon'; import { CommonModule } from '@angular/common'; -import { finalize, Subscription } from 'rxjs'; +import { Subscription } from 'rxjs'; import { MatSnackBar, MatSnackBarModule } from '@angular/material/snack-bar'; import { Router, RouterLink } from '@angular/router'; import { HttpErrorResponse } from '@angular/common/http'; @@ -34,7 +34,7 @@ type LoginStep = 'credentials' | 'otk'; styleUrl: './app-login.component.scss', standalone: true, }) -export class AppLoginComponent implements OnInit, OnDestroy { +export class AppLoginComponent implements OnDestroy { credentialsForm = new FormGroup({ email: new FormControl('', [Validators.required, Validators.email]), password: new FormControl('', [ @@ -64,28 +64,21 @@ export class AppLoginComponent implements OnInit, OnDestroy { protected credentialService: CredentialService, protected router: Router, protected snackBar: MatSnackBar, - ) {} - - ngOnInit(): void { - this.subscription = this.credentialService.validating.subscribe( - (validating) => { - if (validating) { - this.credentialsForm.disable(); - this.otkForm.disable(); - } else { - this.credentialsForm.enable(); - this.otkForm.enable(); - this.checkEnter(); - } - }, - ); - if (!this.credentialService.validating.value) { - this.checkEnter(); - } + ) { + effect(() => { + if (this.credentialService.isValidating()) { + this.credentialsForm.disable(); + this.otkForm.disable(); + } else { + this.credentialsForm.enable(); + this.otkForm.enable(); + this.checkEnter(); + } + }); } checkEnter(): void { - if (this.credentialService.isAuthenticated.value) { + if (this.credentialService.isAuthenticated()) { this.router.navigate(['/dashboard']); } } @@ -110,39 +103,35 @@ export class AppLoginComponent implements OnInit, OnDestroy { const email = this.credentialsForm.controls.email.value ?? ''; const password = this.credentialsForm.controls.password.value ?? ''; - this.credentialService - .requestOtk(email, password) - .pipe( - finalize(() => { - this.isSubmitting = false; - this.credentialsForm.enable(); - }), - ) - .subscribe({ - next: (accountId) => { - if (!accountId) { - return; - } - - this.accountId = accountId; - this.currentStep = 'otk'; - this.otkForm.reset(); - this.startCountdown(); - this.snackBar.open( - 'OTK-Code wurde an die E-Mail-Adresse gesendet.', - 'OK', - { - duration: 4000, - }, - ); - }, - error: (error: HttpErrorResponse) => { - this.credentialService.clearLocalAuthState(); - this.snackBar.open(this.getLoginErrorMessage(error), 'OK', { + this.credentialService.requestOtk(email, password).subscribe({ + next: (otkResponse) => { + const accountId = otkResponse.account_id; + this.accountId = accountId; + this.currentStep = 'otk'; + this.otkForm.reset(); + this.startCountdown(); + this.snackBar.open( + 'OTK-Code wurde an die E-Mail-Adresse gesendet.', + 'OK', + { + duration: 4000, + }, + ); + }, + error: (error: unknown) => { + this.snackBar.open( + this.getLoginErrorMessage(error as HttpErrorResponse), + 'OK', + { duration: 5000, - }); - }, - }); + }, + ); + }, + complete: () => { + this.isSubmitting = false; + this.credentialsForm.enable(); + }, + }); } resendCode() { @@ -178,29 +167,32 @@ export class AppLoginComponent implements OnInit, OnDestroy { this.isSubmitting = true; this.otkForm.disable(); - const email = this.credentialsForm.controls.email.value ?? ''; const code = this.otkForm.controls.code.value ?? ''; - this.credentialService - .loginWithOtk(this.accountId, email, code) - .pipe( - finalize(() => { - this.isSubmitting = false; - this.otkForm.enable(); - }), - ) - .subscribe({ - next: () => { - this.stopCountdown(); - this.router.navigate(['/dashboard']); - }, - error: (error: HttpErrorResponse) => { - this.credentialService.clearLocalAuthState(); - this.snackBar.open(this.getLoginErrorMessage(error), 'OK', { + this.credentialService.loginWithOtk(this.accountId, code).subscribe({ + next: () => { + this.credentialService.reauthenticateViaIdToken().subscribe({ + next: () => { + this.checkEnter(); + this.stopCountdown(); + this.router.navigate(['/dashboard']); + }, + }); + }, + error: (error: unknown) => { + this.snackBar.open( + this.getLoginErrorMessage(error as HttpErrorResponse), + 'OK', + { duration: 5000, - }); - }, - }); + }, + ); + }, + complete: () => { + this.isSubmitting = false; + this.otkForm.enable(); + }, + }); } editCredentials() { @@ -240,6 +232,7 @@ export class AppLoginComponent implements OnInit, OnDestroy { } private getLoginErrorMessage(error: HttpErrorResponse): string { + console.error('Login error:', error); if (error.status === 401) { return 'E-Mail, Passwort oder OTK-Code ist ungültig.'; } diff --git a/webapp/src/app/modules/app-register/app-register.component.html b/webapp/src/app/modules/app-register/app-register.component.html index e6349bc5..a9e758c6 100644 --- a/webapp/src/app/modules/app-register/app-register.component.html +++ b/webapp/src/app/modules/app-register/app-register.component.html @@ -84,9 +84,7 @@ mat-raised-button class="button" (click)="submit()" - [disabled]=" - !registerForm.valid || (credentialService.validating | async) - "> + [disabled]="!registerForm.valid || credentialService.isValidating()"> Registrieren diff --git a/webapp/src/app/modules/app-register/app-register.component.ts b/webapp/src/app/modules/app-register/app-register.component.ts index d4169732..a2341a1a 100644 --- a/webapp/src/app/modules/app-register/app-register.component.ts +++ b/webapp/src/app/modules/app-register/app-register.component.ts @@ -4,7 +4,7 @@ import { OnDestroy, signal, DestroyRef, - OnInit, + effect, } from '@angular/core'; import { CommonModule } from '@angular/common'; import { takeUntilDestroyed } from '@angular/core/rxjs-interop'; @@ -54,7 +54,7 @@ import { InstitutionsService } from '../../api'; templateUrl: './app-register.component.html', styleUrl: './app-register.component.scss', }) -export class AppRegisterComponent implements OnDestroy, OnInit { +export class AppRegisterComponent implements OnDestroy { private readonly fb = inject(FormBuilder); protected readonly credentialService = inject(CredentialService); private readonly router = inject(Router); @@ -73,42 +73,37 @@ export class AppRegisterComponent implements OnDestroy, OnInit { showPassword = false; constructor() { + effect(() => { + if (this.credentialService.isValidating()) { + this.registerForm.disable(); + } else { + this.registerForm.enable(); + this.checkEnter(); + } + }); + this.setupInstitutionAutocomplete(); } - ngOnInit(): void { - this.subscription = this.credentialService.validating.subscribe( - (validating) => { - if (validating) { - this.registerForm.disable(); - } else { - this.registerForm.enable(); - this.checkEnter(); - } - }, - ); - if (!this.credentialService.validating) { - this.checkEnter(); - } - } + ngOnDestroy(): void { this.subscription?.unsubscribe(); } checkEnter(): void { - if (this.credentialService.isAuthenticated.value) { + if (this.credentialService.isAuthenticated()) { this.router.navigate(['/dashboard']); } } submit() { if (this.registerForm.valid) { - this.credentialService.validating.next(true); + this.credentialService.isValidating.set(true); this.registerForm.disable(); this.subscription = this.credentialService .registerAccount(this.registerForm.value) .subscribe({ next: () => { - this.credentialService.validating.next(false); + this.credentialService.isValidating.set(false); this.snackBar.open( 'Konto erfolgreich erstellt! Du kannst Dich jetzt anmelden.', 'OK', @@ -117,7 +112,7 @@ export class AppRegisterComponent implements OnDestroy, OnInit { this.router.navigate(['/login']); }, error: (err) => { - this.credentialService.validating.next(false); + this.credentialService.isValidating.set(false); this.registerForm.enable(); const message = err.error?.message || diff --git a/webapp/src/app/modules/institutions/institutions.component.html b/webapp/src/app/modules/institutions/institutions.component.html index 0ec24397..b722948c 100644 --- a/webapp/src/app/modules/institutions/institutions.component.html +++ b/webapp/src/app/modules/institutions/institutions.component.html @@ -3,102 +3,89 @@ -
- - -
- - - -
-
- - - - @let institutionPageValue = institutionPage(); - - @if ( - institutionPageValue.elements && institutionPageValue.elements.length > 0 - ) { -
- @for (institution of institutionPageValue.elements; track $index) { - @let institutionId = extractInstitutionId(institution); - - - {{ getDisplayName(institution) }} - {{ institution.geo?.city }}, - {{ institution.geo?.country }} - - - - - - - - - - - - info - Übersicht - - - article - Publikationen - - - work - Projekte - - - verified - Patente - - - - - } -
- } @else { -
-

Keine passenden Institutionen gefunden.

-
- } - - - - + + + + + + {{ getDisplayName(institution) }} + {{ institution.geo?.city }}, + {{ institution.geo?.country }} + + + + + + + + + + + + info + Übersicht + + + article + Publikationen + + + work + Projekte + + + verified + Patente + + + + + diff --git a/webapp/src/app/modules/institutions/institutions.component.scss b/webapp/src/app/modules/institutions/institutions.component.scss index 7303fdd7..ce9afb83 100644 --- a/webapp/src/app/modules/institutions/institutions.component.scss +++ b/webapp/src/app/modules/institutions/institutions.component.scss @@ -5,27 +5,10 @@ padding: 1rem; } -.sorting { - display: flex; - justify-content: flex-end; - gap: 0.5rem; -} - -.sorting select { - padding: 0.75rem; - border: 1px solid var(--sg-border); - border-radius: var(--sg-radius-sm); - font-size: 1rem; -} - -.sorting select:hover { - cursor: pointer; -} - .cards { display: grid; gap: 1.5rem; - grid-template-columns: repeat(auto-fit, minmax(380px, 1fr)); + grid-template-columns: repeat(auto-fit, minmax(550px, 1fr)); padding: 0 1rem; } @@ -71,13 +54,3 @@ mat-card-actions a { border: 1px solid var(--sg-border); border-radius: var(--sg-radius-sm); } - -.no-results { - text-align: center; - padding: 2rem; - color: var(--sg-text-secondary); -} - -.search-and-sorting { - padding: 0 1rem; -} diff --git a/webapp/src/app/modules/institutions/institutions.component.ts b/webapp/src/app/modules/institutions/institutions.component.ts index 18eea25f..48abc772 100644 --- a/webapp/src/app/modules/institutions/institutions.component.ts +++ b/webapp/src/app/modules/institutions/institutions.component.ts @@ -1,16 +1,16 @@ -import { Component, input } from '@angular/core'; +import { Component, computed, input } from '@angular/core'; import { Institution, InstitutionPage } from '../../api'; import { MatButtonModule } from '@angular/material/button'; import { MatCardModule } from '@angular/material/card'; import { RouterModule } from '@angular/router'; import { MatIconModule } from '@angular/material/icon'; import { MatDividerModule } from '@angular/material/divider'; -import { QueryParamPaginatorComponent } from '../../shared/ui/query-param-paginator/query-param-paginator.component'; + +import { SelectorOption } from '../../shared/ui/query-param-selector/query-param-selector.component'; import { - QueryParamSelectorComponent, - SelectorOption, -} from '../../shared/ui/query-param-selector/query-param-selector.component'; -import { QueryParamInputComponent } from '../../shared/ui/query-param-input/query-param-input.component'; + Page, + CardSearchComponent, +} from '../../shared/ui/card-search/card-search.component'; @Component({ selector: 'app-institutions', @@ -20,9 +20,7 @@ import { QueryParamInputComponent } from '../../shared/ui/query-param-input/quer MatIconModule, MatDividerModule, RouterModule, - QueryParamPaginatorComponent, - QueryParamSelectorComponent, - QueryParamInputComponent, + CardSearchComponent, ], templateUrl: './institutions.component.html', styleUrl: './institutions.component.scss', @@ -30,6 +28,13 @@ import { QueryParamInputComponent } from '../../shared/ui/query-param-input/quer export class InstitutionsComponent { institutionPage = input.required(); + page = computed(() => ({ + page: this.institutionPage().page || 0, + size: this.institutionPage().size || 10, + total: this.institutionPage().total || 0, + elements: this.institutionPage().elements || [], + })); + sortingOptions: SelectorOption[] = [ { value: 'relevance', display_name: 'Relevanz' }, { value: 'name', display_name: 'Name' }, diff --git a/webapp/src/app/modules/keywords-search/keywords-search.component.html b/webapp/src/app/modules/keywords-search/keywords-search.component.html index f9abedb9..e313d794 100644 --- a/webapp/src/app/modules/keywords-search/keywords-search.component.html +++ b/webapp/src/app/modules/keywords-search/keywords-search.component.html @@ -16,6 +16,7 @@ @@ -52,191 +56,356 @@ + @if (isExtracting()) { +
+ + +
{{ statusMessage() }}
+
+ } -
- - - -
- -
-
Breite Keywords
-
Coarse Keywords
-
Fine Keywords
-
Eigene Keywords
-
- - -
-
- @if (broadKeywords().length > 0) { - - @for (keyword of broadKeywords(); track keyword) { - - {{ keyword }} - - } - - } @else { -

–

- } -
- -
- @if (coarseKeywords().length > 0) { - - @for (keyword of coarseKeywords(); track keyword) { - - {{ keyword }} - - } - - } @else { -

–

- } -
- -
- @if (fineKeywords().length > 0) { - - @for (keyword of fineKeywords(); track keyword) { - - {{ keyword }} - - } - - } @else { -

–

- } -
- -
- - - @if (manualKeywords().length > 0) { - @for (keyword of manualKeywords(); track keyword) { - - {{ keyword }} - cancel - - } - } - -
-
-
- - - @if (extractedKeywordsExist()) { -
- @if (areAllExtractedSelected()) { - - } @else { - + @if (keywordsExist()) { +
+ + + +
+ @if (topicLegendGroups.length > 0) { + + } - -
- } - @if (isExtracting()) { -
- - -
{{ statusMessage() }}
-
- } @else if ( - !extractedKeywordsExist() && manualKeywords().length === 0 - ) { -

- Keine Keywords vorhanden. Extrahiere Keywords oder füge eigene - hinzu. -

- } - - @if (sourceContent().length > 0) { - - - - Quellentext: {{ sourceUrl() }} - -
{{ sourceContent() }}
-
- } -
-
-
+ +
+ @if (!isExtracting()) { +
+
+ @if (areAllSelected()) { + + } @else { + + } +
+
- -
- - -
+ + + text_fields + Extrahierte Keywords + + + account_tree + Topic Mapping + + +
+ +
+ +
+
+ } @else { + +
+ } + +
+ +
+
+
+ + + + @if (keywords.length > 0) { +
+ @for ( + keyword of keywords; + track keyword.llm_keyword.keyword + ) { + + + } +
+ } @else { +

{{ emptyText }}

+ } +
+ + +
+ @if (manualKeywords().length > 0) { + @for ( + keyword of manualKeywords(); + track keyword.llm_keyword.keyword + ) { +
+ + + +
+ } + } @else { +

Nichts hinzugefügt

+ } + @if (loadingNewKeyword()) { +
+ + + +
+ } +
+
+ + + @if (!isMobile()) { +
+
+
+ Breite Keywords +
+
+ Coarse Keywords +
+
+ Fine Keywords +
+
+ Eigene Keywords +
+
+ +
+
+ +
+ +
+ +
+ +
+ +
+ +
+ +
+
+
+ } @else { + + + + + Breit + {{ broadKeywords().length }} + +
+ +
+
+ + + + Coarse + {{ coarseKeywords().length }} + +
+ +
+
+ + + + Fine + {{ fineKeywords().length }} + +
+ +
+
+ + + + Eigene + {{ manualKeywords().length }} + +
+ +
+
+
+ } + + + @if (sourceContent().length > 0) { + + + + Quellentext: {{ sourceUrl() }} + +
{{ sourceContent() }}
+
+ } +
+
+
+ + +
+ + +
+ } @if (showVisualization() && selectedKeywords().length > 0) { diff --git a/webapp/src/app/modules/keywords-search/keywords-search.component.scss b/webapp/src/app/modules/keywords-search/keywords-search.component.scss index 3162536f..15e6e6c5 100644 --- a/webapp/src/app/modules/keywords-search/keywords-search.component.scss +++ b/webapp/src/app/modules/keywords-search/keywords-search.component.scss @@ -1,30 +1,192 @@ +/* ============================================================ + DESIGN TOKENS / LOCAL VARIABLES + ============================================================ */ +$phone: 599px; +$tablet: 900px; +$touch-target: 44px; + +/* ============================================================ + BASE LAYOUT — container becomes the responsive anchor + ============================================================ */ .content { + container-type: inline-size; + container-name: keyword-tool; + display: flex; flex-direction: column; - gap: 0.75rem; - padding: 1rem; + gap: clamp(0.5rem, 1.5vw, 0.75rem); + padding: clamp(0.5rem, 2vw, 1rem); } .tab-content { - padding: 0.5rem 0; - display: grid; - grid-template-columns: 5fr 1fr; + display: flex; + flex-direction: column; + margin-top: 0.5rem; gap: 0.5rem; + align-items: center; } .full-width { width: 100%; } +.extract-btn { + white-space: nowrap; + min-width: 240px; + min-height: $touch-target; +} + .actions { display: flex; justify-content: center; } +/* ============================================================ + TOOLBAR + ============================================================ */ +.keywords-toolbar { + display: flex; + flex-direction: column; + background: var(--sg-background-muted, #f4f5f7); + + ::ng-deep app-topic-legend .topic-legend { + width: 100%; + margin: 0; + } +} + +.toolbar-controls { + display: flex; + align-items: center; + justify-content: center; + gap: 0.75rem; + flex-wrap: nowrap; /* fixed: was invalid "no-wrap" */ + padding: 0.5rem 0.75rem; + background: var(--sg-background-muted, #f4f5f7); +} +.toolbar-wrapper { + display: grid; + grid-template-columns: 3fr 1.3fr; + border-left: 1px solid var(--sg-divider, rgba(0, 0, 0, 0.08)); +} + +.toolbar-controls--placeholder { + /* invisible spacer, preserves grid column width/position */ + visibility: hidden; + pointer-events: none; +} + +.manual-input-controls { + min-width: 0; +} + +@container keyword-tool (max-width: #{$tablet}) { + .toolbar-wrapper { + grid-template-columns: 1fr; + border-left: none; + } + + .toolbar-controls--placeholder { + display: none; /* no need for a spacer once stacked */ + } +} + +.toolbar-group { + display: flex; + align-items: center; + gap: 0.6rem; +} + +.toolbar-group button { + display: flex; + align-items: center; + gap: 0.35rem; + font-size: 0.8rem; + line-height: 30px; + border-radius: 20px; + padding: 0 14px; + min-height: $touch-target; + + mat-icon { + font-size: 20px; + width: 20px; + height: 20px; + } +} + +.toolbar-divider { + width: 1px; + align-self: stretch; + background: var(--sg-divider, rgba(0, 0, 0, 0.12)); +} + +mat-button-toggle-group { + border-radius: 20px; + overflow: hidden; + justify-content: space-around; + + ::ng-deep .mat-button-toggle-label-content { + line-height: $touch-target; + } + ::ng-deep mat-button-toggle { + width: 100%; + } +} + +/* Container-query driven toolbar collapse (tablet/phone) */ +@container keyword-tool (min-width: #{$phone + 1}) { + .toolbar-divider { + display: block; + } +} + +@container keyword-tool (max-width: #{$tablet}) { + .toolbar-controls { + flex-direction: column; + align-items: stretch; + } + + .toolbar-group { + justify-content: center; + } + + .toolbar-group button { + width: 100%; + justify-content: center; + } + + .toolbar-wrapper { + grid-template-columns: 1fr; + border-left: none; + } + + .toolbar-wrapper .spacer { + width: 100%; + } +} + +/* Phone: icon-only toolbar buttons to save space */ +@container keyword-tool (max-width: #{$phone}) { + .btn-label { + display: none; + } + + .toolbar-group button { + width: auto; + padding: 0; + min-width: $touch-target; + justify-content: center; + } +} + +/* ============================================================ + EXTRACTION GRID / CARD + ============================================================ */ .extraction-grid { display: grid; grid-template-columns: 1fr; gap: 1rem; + border: 0; } .keyword-card { @@ -40,137 +202,38 @@ } } -/* === Table-like keyword grid === */ +/* ============================================================ + DESKTOP TABLE-LIKE KEYWORD GRID + ============================================================ */ .keyword-table { display: flex; flex-direction: column; - gap: 0.5rem; - margin: 0.5rem 0; } .table-head { + border-top: 2px solid var(--sg-divider, rgba(0, 0, 0, 0.12)); + padding-top: 0.5rem; display: grid; grid-template-columns: repeat(3, 1fr) 1.3fr; - grid-template-rows: auto; column-gap: 1rem; border-bottom: 2px solid var(--sg-divider, rgba(0, 0, 0, 0.12)); padding-bottom: 0.5rem; + background: var(--sg-background-muted, #f4f5f7); } .head-cell { min-width: 0; - text-align: center; /* Center header text */ -} - -.extracted-header { - grid-column: 1 / span 3; - grid-row: 0; - font-size: 0.95rem; - font-weight: 600; - color: var(--sg-text-primary); - align-self: end; -} - -.own-header { - grid-column: 4; - grid-row: 1 / span 2; - display: flex; - flex-direction: column; - gap: 0.35rem; -} - -.own-header-title { - font-size: 0.95rem; - font-weight: 600; - color: var(--sg-text-primary); - text-align: center; /* Center own header title */ + text-align: center; } .sub-cell { font-weight: 500; color: var(--sg-text-secondary); - font-size: 1rem; + font-size: clamp(0.8rem, 1.2vw, 1rem); text-transform: uppercase; letter-spacing: 0.05em; align-self: end; - grid-row: 2; - text-align: center; /* Center sub-cell text */ -} - -.broad-sub { - grid-column: 1; -} -.coarse-sub { - grid-column: 2; -} -.fine-sub { - grid-column: 3; -} -.manual-sub { - grid-column: 4; -} -.keyword-input-row { - margin-left: 0.5rem; - width: 100%; - display: grid; - grid-column: 1 / span 4; - display: flex; - align-items: center; - gap: 0.35rem; - - &.compact { - .small-field { - flex: 10; - // collapse the outline field to a compact, chip-like height - ::ng-deep .mat-mdc-text-field-wrapper { - padding: 0 0.6rem; - } - - ::ng-deep .mat-mdc-form-field-flex { - min-height: 8px; - align-items: center; - } - - ::ng-deep .mat-mdc-form-field-infix { - min-height: 8px; - padding: 1rem 0; - } - - // hide the hint/error subscript strip to remove extra height - ::ng-deep .mat-mdc-form-field-subscript-wrapper { - display: none; - } - - ::ng-deep input.mat-mdc-input-element { - font-size: 0.8rem; - } - - ::ng-deep .mat-mdc-form-field-label, - ::ng-deep mat-label { - font-size: 1rem; - } - } - - button.mat-mdc-icon-button { - width: 28px; - height: 28px; - padding: 0; - line-height: 28px; - flex: 1; - - .mat-icon { - font-size: 18px; - width: 18px; - height: 18px; - line-height: 18px; - } - - ::ng-deep .mat-mdc-button-touch-target { - width: 28px; - height: 28px; - } - } - } + text-align: center; } .table-body { @@ -179,10 +242,9 @@ column-gap: 1rem; row-gap: 0.4rem; align-items: start; - border-left: 1px solid var(--sg-divider, rgba(0, 0, 0, 0.08)); /* Left border for columns */ + border-left: 1px solid var(--sg-divider, rgba(0, 0, 0, 0.08)); } -/* Add vertical separators between columns */ .table-col { display: flex; flex-direction: column; @@ -194,17 +256,94 @@ &:last-child { border-right: none; } - &:nth-child(3) { - border-right: 5px solid var(--sg-divider, rgba(0, 0, 0, 0.08)); + + ::ng-deep app-topic-chip { + width: 100%; } - mat-chip-listbox { + ::ng-deep app-topic-chip:not(.topic-chip--active) { width: 100%; - margin-top: 0.5rem; + opacity: 0.4; + } +} + +.thick-border { + border-right: 5px solid var(--sg-divider, rgba(0, 0, 0, 0.1)) !important; +} + +@container keyword-tool (max-width: #{$tablet}) { + .table-head, + .table-body { + column-gap: 0.5rem; + } + + .table-col { + padding: 0.4rem; + } +} + +/* ============================================================ + MOBILE KEYWORD TABS (structural replacement for stacked table) + ============================================================ */ +.mobile-keyword-tabs { + margin-top: 0.5rem; + + ::ng-deep .mat-mdc-tab-labels { + justify-content: stretch; + } + + ::ng-deep .mat-mdc-tab { + flex: 1; + min-height: $touch-target; + } +} + +.tab-count { + margin-left: 0.35rem; + font-size: 0.75rem; + font-weight: 600; + color: var(--sg-text-secondary); + background: var(--sg-background-muted, #eceff1); + border-radius: 10px; + padding: 0 6px; + min-width: 18px; + display: inline-block; + text-align: center; +} + +.mobile-tab-panel { + padding: 0.75rem 0.25rem; +} + +/* ============================================================ + CHIP STACKS + ============================================================ */ +.keyword-chip-stack { + display: flex; + flex-direction: column; + gap: 0.5rem; + margin-top: 0.5rem; + width: 100%; +} + +.manual-chip-row { + display: flex; + align-items: center; + width: 100%; + gap: 0.25rem; + + app-topic-chip { + flex: 1 1 auto; + min-width: 0; + } + + button[mat-icon-button] { + flex: 0 0 auto; + min-width: $touch-target; + min-height: $touch-target; } } -/* Make chips removable and add hover effect */ .compact-chip { font-size: 1rem; padding: 0.2rem 0.6rem; @@ -215,11 +354,9 @@ animation: popIn 0.2s ease-in-out; cursor: default; - // Add removable indicator and hover effect &.mat-mdc-chip-option { .mat-mdc-chip-action { padding: 0 4px; - .mat-mdc-chip-action-label { padding: 0 4px; display: flex; @@ -227,8 +364,6 @@ gap: 4px; } } - - // Show remove button on hover for removable chips &:hover { ::ng-deep .mat-mdc-chip-remove { opacity: 1; @@ -236,7 +371,6 @@ } } - // Style for removable chips ::ng-deep .mat-mdc-chip-remove { opacity: 0; transition: opacity 0.2s ease; @@ -262,12 +396,9 @@ } } -::ng-deep .mat-mdc-chip-option.compact-chip { - .mat-mdc-chip-action-label { - padding: 0 4px; - } - .mat-mdc-chip-action { - padding: 0 4px; +@container keyword-tool (max-width: #{$tablet}) { + .compact-chip { + width: 100%; } } @@ -283,80 +414,95 @@ } } -.select-all-container { +/* ============================================================ + SEARCH BUTTON (sticky on mobile — improves conversion/UX) + ============================================================ */ +.search-container { display: flex; - flex-wrap: wrap; - gap: 0.5rem; - justify-content: flex-end; + justify-content: center; margin-top: 0.5rem; +} - button { - font-size: 0.75rem; - padding: 0 12px; - line-height: 30px; - mat-icon { - font-size: 18px; - width: 18px; - height: 18px; - } +.search-btn { + min-width: 240px; + align-self: center; + min-height: $touch-target; +} + +@media (max-width: $phone) { + .search-container { + position: sticky; + bottom: 0; + z-index: 5; + background: var(--sg-background); + padding: 0.75rem 0.5rem; + box-shadow: 0 -2px 8px rgba(0, 0, 0, 0.08); + } + + .search-btn { + width: 100%; } } -.search-container { - display: flex; - justify-content: flex-end; - margin-top: 0.5rem; -} +/* ============================================================ + TABS (URL / Text) — stretch on smaller containers + ============================================================ */ +@container keyword-tool (max-width: #{$tablet}) { + .content ::ng-deep .mat-mdc-tab-labels { + justify-content: stretch; + } -/* Responsive: stack columns on small screens */ -@media (max-width: 768px) { - .table-head, - .table-body { + .content ::ng-deep .mat-mdc-tab { + flex: 1; + } + + .tab-content { + display: grid; grid-template-columns: 1fr; } - .extracted-header { - grid-column: 1; - grid-row: 1; + .extract-btn { + width: 100%; + justify-content: center; } - - .own-header { - grid-column: 1; - grid-row: 2; - } - - .broad-sub { - grid-column: 1; - grid-row: 3; - } - .coarse-sub { - grid-column: 1; - grid-row: 4; - } - .fine-sub { - grid-column: 1; - grid-row: 5; - } - - .actions { - align-self: center; - justify-content: flex-start; - } - - .search-container { - justify-content: flex-start; - } - - .table-col { - border-right: none; /* Remove column borders on mobile */ - border-bottom: 1px solid var(--sg-divider, rgba(0, 0, 0, 0.08)); - - &:last-child { - border-bottom: none; - } + .search-btn { + width: 100%; } } -/* Source expansion panel */ + +/* ============================================================ + PHONE-SPECIFIC FINE-TUNING + ============================================================ */ +@container keyword-tool (max-width: #{$phone}) { + .content { + gap: 0.5rem; + } + + .keyword-card { + padding: 0.35rem; + } + + .sub-cell { + font-size: 0.8rem; + } + + .compact-chip { + font-size: 0.85rem; + min-height: 24px; + } + + .empty-state { + font-size: 0.8rem; + } + + .status-message { + font-size: 0.8rem; + } +} + +/* ============================================================ + SOURCE EXPANSION PANEL + ============================================================ */ .source-expansion { margin: 0.75rem 0; background: var(--sg-background-muted, #f5f5f5); @@ -406,30 +552,27 @@ background: rgba(0, 0, 0, 0.03); } } + +/* ============================================================ + PROGRESS BAR + ============================================================ */ .progress-container { margin-top: 1rem; padding: 0.5rem 0; - // Make the progress bar container relative for the shimmer overlay mat-progress-bar { position: relative; - overflow: hidden; // keeps the shimmer inside the bar + overflow: hidden; - // --- Set the bar fill to a constant blue --- - // Using the primary blue (adjust to your preferred "hell blue") ::ng-deep .mat-progress-bar-fill::after { - background-color: #2196f3; // bright blue + background-color: #2196f3; } - // --- Shimmer overlay (a moving highlight) --- &::after { content: ''; position: absolute; - top: 0; - left: 0; - width: 100%; - height: 100%; - pointer-events: none; // allow clicks to pass through + inset: 0; + pointer-events: none; background: linear-gradient( 105deg, transparent 0%, @@ -457,3 +600,21 @@ transform: translateX(100%); } } + +/* ============================================================ + ACCESSIBILITY + ============================================================ */ +@media (prefers-reduced-motion: reduce) { + .compact-chip, + .progress-container mat-progress-bar::after { + animation: none !important; + transition: none !important; + } +} + +button:focus-visible, +.mat-button-toggle:focus-visible, +::ng-deep .mat-mdc-tab:focus-visible { + outline: 2px solid var(--sg-primary, #1976d2); + outline-offset: 2px; +} diff --git a/webapp/src/app/modules/keywords-search/keywords-search.component.ts b/webapp/src/app/modules/keywords-search/keywords-search.component.ts index bdb253f8..2697f79b 100644 --- a/webapp/src/app/modules/keywords-search/keywords-search.component.ts +++ b/webapp/src/app/modules/keywords-search/keywords-search.component.ts @@ -1,15 +1,9 @@ -import { - Component, - computed, - signal, - Signal, - WritableSignal, -} from '@angular/core'; +import { Component, computed, signal, inject } from '@angular/core'; +import { BreakpointObserver } from '@angular/cdk/layout'; import { takeUntilDestroyed } from '@angular/core/rxjs-interop'; import { FormBuilder, ReactiveFormsModule } from '@angular/forms'; import { MatButtonModule } from '@angular/material/button'; import { MatCardModule } from '@angular/material/card'; -import { MatChipListboxChange, MatChipsModule } from '@angular/material/chips'; import { MatDividerModule } from '@angular/material/divider'; import { MatFormFieldModule } from '@angular/material/form-field'; import { MatIconModule } from '@angular/material/icon'; @@ -30,9 +24,30 @@ import { KeywordEntryWithTopic } from '../../api/model/keywordEntryWithTopic'; import { TopicAutocompleteComponent } from '../../shared/ui/topic-autocomplete/topic-autocomplete.component'; import { UniTrendParentComponent } from '../university-ranking/uni-trend-parent/uni-trend-parent.component'; +import { TopicChipComponent } from '../../shared/ui/topic-chip/topic-chip.component'; +import { TopicLegendComponent } from '../../shared/ui/topic-legend/topic-legend.component'; +import { Topic } from '../../api/model/topic'; +import { NgTemplateOutlet } from '@angular/common'; +import { map } from 'rxjs/operators'; +import { toSignal } from '@angular/core/rxjs-interop'; +import { + MatButtonToggleModule, + MatButtonToggleGroup, +} from '@angular/material/button-toggle'; +import { + topicHierarchyColor, + TopicHierarchyColorInput, +} from '../../resolvers/utils/topic-colors'; +import { + buildTopicLegendGroups, + TopicLegendGroup, + TopicLegendTopic, +} from '../../resolvers/utils/topic-legend'; +import { MatTooltipModule } from '@angular/material/tooltip'; +import { A11yModule } from '@angular/cdk/a11y'; type InputMode = 'url' | 'text'; type KeywordCategory = 'broad' | 'coarse' | 'fine' | 'manual'; - +type KeywordView = 'llm' | 'topic'; @Component({ selector: 'app-keywords-search', imports: [ @@ -42,13 +57,19 @@ type KeywordCategory = 'broad' | 'coarse' | 'fine' | 'manual'; MatInputModule, MatButtonModule, MatIconModule, - MatChipsModule, MatDividerModule, MatCardModule, MatExpansionModule, MatProgressBarModule, TopicAutocompleteComponent, UniTrendParentComponent, + TopicChipComponent, + TopicLegendComponent, + MatButtonToggleModule, + MatButtonToggleGroup, + MatTooltipModule, + A11yModule, + NgTemplateOutlet, ], templateUrl: './keywords-search.component.html', styleUrl: './keywords-search.component.scss', @@ -61,7 +82,15 @@ export class KeywordsSearchComponent { }); private readonly SESSION_KEY = 'keywords-search-source'; + // in component class: + private breakpointObserver = inject(BreakpointObserver); + isMobile = toSignal( + this.breakpointObserver + .observe('(max-width: 768px)') + .pipe(map((r) => r.matches)), + { initialValue: false }, + ); // Category signals - the full backend entries are the source of truth; // the *Keywords() computed signals below just project the label out of them. private readonly broadKeywordEntries = signal([]); @@ -69,56 +98,23 @@ export class KeywordsSearchComponent { private readonly fineKeywordEntries = signal([]); private readonly manualKeywordEntries = signal([]); - readonly broadKeywords = computed(() => - this.broadKeywordEntries().map((item) => this.getKeywordLabel(item)), - ); - readonly coarseKeywords = computed(() => - this.coarseKeywordEntries().map((item) => this.getKeywordLabel(item)), - ); - readonly fineKeywords = computed(() => - this.fineKeywordEntries().map((item) => this.getKeywordLabel(item)), - ); - readonly manualKeywords = computed(() => - this.manualKeywordEntries().map((item) => this.getKeywordLabel(item)), - ); + readonly broadKeywords = computed(() => this.broadKeywordEntries()); + readonly coarseKeywords = computed(() => this.coarseKeywordEntries()); + readonly fineKeywords = computed(() => this.fineKeywordEntries()); + readonly manualKeywords = computed(() => this.manualKeywordEntries()); readonly selectedKeywords = signal([]); readonly isExtracting = signal(false); + readonly loadingNewKeyword = signal(false); readonly extractionSource = signal(null); readonly showVisualization = signal(false); - // Single place mapping a category name to its label signal and its - // backing entries signal. Replaces four near-identical computed()s and - // a category switch statement that used to live below. - private readonly categoryKeywordsMap: Record< - KeywordCategory, - Signal - > = { - broad: this.broadKeywords, - coarse: this.coarseKeywords, - fine: this.fineKeywords, - manual: this.manualKeywords, - }; - private readonly categoryEntriesMap: Record< - KeywordCategory, - WritableSignal - > = { - broad: this.broadKeywordEntries, - coarse: this.coarseKeywordEntries, - fine: this.fineKeywordEntries, - manual: this.manualKeywordEntries, - }; - - readonly selectedBroadKeywords = this.selectedInCategory('broad'); - readonly selectedCoarseKeywords = this.selectedInCategory('coarse'); - readonly selectedFineKeywords = this.selectedInCategory('fine'); - readonly selectedManualKeywords = this.selectedInCategory('manual'); - - readonly extractedKeywordsExist = computed( + readonly keywordsExist = computed( () => this.broadKeywords().length > 0 || this.coarseKeywords().length > 0 || - this.fineKeywords().length > 0, + this.fineKeywords().length > 0 || + this.manualKeywords().length > 0, ); readonly sourceContent = signal(''); @@ -136,6 +132,23 @@ export class KeywordsSearchComponent { readonly progress = signal(0); readonly statusMessage = signal(''); + readonly keywordView = signal('llm'); + readonly subfieldLegendVisible = signal(true); + readonly subfieldLegendExpanded = signal(false); + + get topicLegendGroups(): TopicLegendGroup[] { + const topics = [ + ...this.broadKeywordEntries(), + ...this.coarseKeywordEntries(), + ...this.fineKeywordEntries(), + ...this.manualKeywordEntries(), + ] + .map((entry) => entry.topic_mapping?.topic) + .filter((topic): topic is Topic => Boolean(topic)) + .map((topic) => this.toTopicLegendTopic(topic)); + + return buildTopicLegendGroups(topics); + } constructor( private readonly formBuilder: FormBuilder, @@ -223,9 +236,12 @@ export class KeywordsSearchComponent { this.fineKeywordEntries.set([]); this.websocketService.close(); this.isExtracting.set(false); + this.loadingNewKeyword.set(false); // Keep manual, but remove selected that are not in manual this.selectedKeywords.set( - this.selectedKeywords().filter((k) => this.manualKeywords().includes(k)), + this.selectedKeywords().filter((k) => + this.getKeywordLabels(this.manualKeywords()).includes(k), + ), ); this.updateQueryParams(); } @@ -298,16 +314,14 @@ export class KeywordsSearchComponent { private keywordExists(keyword: string): boolean { const normalized = this.normalizeKeyword(keyword); return [ - ...this.broadKeywords(), - ...this.coarseKeywords(), - ...this.fineKeywords(), - ...this.manualKeywords(), + ...this.getKeywordLabels(this.broadKeywords()), + ...this.getKeywordLabels(this.coarseKeywords()), + ...this.getKeywordLabels(this.fineKeywords()), + ...this.getKeywordLabels(this.manualKeywords()), ].some((k) => this.normalizeKeyword(k) === normalized); } - - // Add manually from Keywords tab - addKeywordFromInput(keyword: string): void { - const normalizedKeyword = keyword.trim(); + addKeywordFromInput(keyword: Topic): void { + const normalizedKeyword = keyword.display_name?.trim() ?? ''; if (!normalizedKeyword) return; if (this.keywordExists(normalizedKeyword)) { @@ -315,35 +329,54 @@ export class KeywordsSearchComponent { return; } - this.topicsService.vectorSearchTopics(normalizedKeyword).subscribe({ - next: ({ results }) => { - const newEntry: KeywordEntryWithTopic = { - llm_keyword: { - keyword: normalizedKeyword, - relevance_score: 1, - }, - topic_mapping: { - keyword: normalizedKeyword, - topic: results?.[0], - }, - }; + this.loadingNewKeyword.set(true); - const updated = this.uniqueKeywordEntries([ - ...this.manualKeywordEntries(), - newEntry, - ]); + if (keyword.id === null) { + console.log('Adding new keyword without topic:', normalizedKeyword); + this.topicsService.vectorSearchTopics(normalizedKeyword).subscribe({ + next: ({ results }) => { + const newEntry: KeywordEntryWithTopic = { + llm_keyword: { keyword: normalizedKeyword, relevance_score: 1 }, + topic_mapping: { keyword: normalizedKeyword, topic: results?.[0] }, + }; - this.manualKeywordEntries.set(updated); - this.selectedKeywords.set([ - ...this.selectedKeywords(), - normalizedKeyword, - ]); - - // Explicit enrichment trigger for new keywords - this.enrichManualKeywordsWithTopics([normalizedKeyword]); - this.updateQueryParams(); - }, - }); + this.manualKeywordEntries.set( + this.uniqueKeywordEntries([ + ...this.manualKeywordEntries(), + newEntry, + ]), + ); + this.selectedKeywords.set([ + ...this.selectedKeywords(), + normalizedKeyword, + ]); + this.loadingNewKeyword.set(false); + this.updateQueryParams(); // now fires after state is actually updated + }, + error: (err) => { + console.error('vectorSearchTopics failed', err); + this.loadingNewKeyword.set(false); + this.statusMessage.set( + `Fehler beim Hinzufügen von "${normalizedKeyword}".`, + ); + }, + }); + } else { + console.log('topic was already there', keyword); + const newEntry: KeywordEntryWithTopic = { + llm_keyword: { keyword: normalizedKeyword, relevance_score: 1 }, + topic_mapping: { keyword: normalizedKeyword, topic: keyword }, + }; + this.manualKeywordEntries.set( + this.uniqueKeywordEntries([...this.manualKeywordEntries(), newEntry]), + ); + this.selectedKeywords.set([ + ...this.selectedKeywords(), + normalizedKeyword, + ]); + this.loadingNewKeyword.set(false); + this.updateQueryParams(); + } } removeSelectedKeyword(keyword: string): void { @@ -353,50 +386,72 @@ export class KeywordsSearchComponent { this.updateQueryParams(); } - onCategoryChange( - category: KeywordCategory, - event: MatChipListboxChange, - ): void { - const newSelection = (event.value as string[]) || []; - const otherCategories = ( - Object.keys(this.categoryKeywordsMap) as KeywordCategory[] - ).filter((c) => c !== category); - const otherSelected = otherCategories.flatMap((c) => { - const keywords = this.categoryKeywordsMap[c](); - return this.selectedKeywords().filter((k) => keywords.includes(k)); - }); - const updated = [...otherSelected, ...newSelection]; - this.selectedKeywords.set(this.uniqueKeywords(updated)); + toggleKeywordSelection(keyword: KeywordEntryWithTopic): void { + const label = this.getKeywordLabel(keyword); + const nextSelection = this.selectedKeywords().includes(label) + ? this.selectedKeywords().filter((value) => value !== label) + : [...this.selectedKeywords(), label]; + + this.selectedKeywords.set(this.uniqueKeywords(nextSelection)); this.updateQueryParams(); } - selectAllExtracted(): void { - const all = [ - ...this.selectedManualKeywords(), - ...this.broadKeywords(), - ...this.coarseKeywords(), - ...this.fineKeywords(), - ]; - this.selectedKeywords.set(this.uniqueKeywords(all)); - this.updateQueryParams(); + isKeywordSelected(keyword: KeywordEntryWithTopic): boolean { + const normalized = this.normalizeKeyword(this.getKeywordLabel(keyword)); + return this.selectedKeywords().some( + (value) => this.normalizeKeyword(value) === normalized, + ); } - deselectAllExtracted(): void { + removeManualKeyword(keyword: KeywordEntryWithTopic): void { + const label = this.getKeywordLabel(keyword); + this.manualKeywordEntries.set( + this.filterKeywordEntries(this.manualKeywordEntries(), label), + ); this.selectedKeywords.set( - this.uniqueKeywords(this.selectedManualKeywords()), + this.selectedKeywords().filter((value) => value !== label), ); this.updateQueryParams(); } + allKeywordEntries = computed(() => [ + ...this.manualKeywords(), + ...this.broadKeywords(), + ...this.coarseKeywords(), + ...this.fineKeywords(), + ]); - clearExtractedKeywords(): void { + selectAll(): void { + const seen = new Set(); + const result: string[] = []; + + for (const entry of this.allKeywordEntries()) { + const label = entry.llm_keyword.keyword; + const normalized = this.normalizeKeyword(label); + if (!seen.has(normalized)) { + seen.add(normalized); + result.push(label); + } + } + + this.selectedKeywords.set(result); + this.updateQueryParams(); + } + + deselectAll(): void { + this.selectedKeywords.set([]); + this.updateQueryParams(); + } + + clearKeywords(): void { this.broadKeywordEntries.set([]); this.coarseKeywordEntries.set([]); this.fineKeywordEntries.set([]); + this.manualKeywordEntries.set([]); this.sourceContent.set(''); this.sourceUrl.set(null); // Keep only selected keywords that are in the manual list - const manualSet = new Set(this.manualKeywords()); + const manualSet = new Set(this.getKeywordLabels(this.manualKeywords())); this.selectedKeywords.set( this.selectedKeywords().filter((k) => manualSet.has(k)), ); @@ -410,11 +465,12 @@ export class KeywordsSearchComponent { this.updateQueryParams(); } - areAllExtractedSelected(): boolean { + areAllSelected(): boolean { const allExtracted = [ - ...this.broadKeywords(), - ...this.coarseKeywords(), - ...this.fineKeywords(), + ...this.getKeywordLabels(this.broadKeywords()), + ...this.getKeywordLabels(this.coarseKeywords()), + ...this.getKeywordLabels(this.fineKeywords()), + ...this.getKeywordLabels(this.manualKeywords()), ]; return allExtracted.every((k) => this.selectedKeywords().includes(k)); } @@ -435,16 +491,6 @@ export class KeywordsSearchComponent { this.applyExtractedKeywords(keywords); } - onKeywordRemoved(category: KeywordCategory, keyword: string): void { - const entries = this.categoryEntriesMap[category]; - entries.set(this.filterKeywordEntries(entries(), keyword)); - - this.selectedKeywords.set( - this.selectedKeywords().filter((k) => k !== keyword), - ); - this.updateQueryParams(); - } - processExtractedKeywords(result: ExtractedKeywordsResponse): void { if (result === undefined || !result.results) return; @@ -457,10 +503,10 @@ export class KeywordsSearchComponent { // Keep only selected keywords that still exist in any category (including manual) const allExtracted = [ - ...this.broadKeywords(), - ...this.coarseKeywords(), - ...this.fineKeywords(), - ...this.manualKeywords(), + ...this.getKeywordLabels(this.broadKeywords()), + ...this.getKeywordLabels(this.coarseKeywords()), + ...this.getKeywordLabels(this.fineKeywords()), + ...this.getKeywordLabels(this.manualKeywords()), ]; this.selectedKeywords.set( this.selectedKeywords().filter((k) => allExtracted.includes(k)), @@ -472,7 +518,7 @@ export class KeywordsSearchComponent { } async extractKeywords(): Promise { - this.clearExtractedKeywords(); + this.clearKeywords(); const query = this.getCurrentExtractionQuery(); if (!query) return; @@ -524,17 +570,11 @@ export class KeywordsSearchComponent { // --- Helpers -------------------------------------------------------------- - private selectedInCategory(category: KeywordCategory): Signal { - return computed(() => - this.selectedKeywords().filter((k) => - this.categoryKeywordsMap[category]().includes(k), - ), - ); - } - private applyExtractedKeywords(keywords: ExtractedKeywords): void { const seenKeywords = new Set( - this.manualKeywords().map((keyword) => this.normalizeKeyword(keyword)), + this.getKeywordLabels(this.manualKeywords()).map((keyword) => + this.normalizeKeyword(keyword), + ), ); this.broadKeywordEntries.set( this.uniqueKeywordEntries(keywords.broad_keywords, seenKeywords), @@ -545,6 +585,7 @@ export class KeywordsSearchComponent { this.fineKeywordEntries.set( this.uniqueKeywordEntries(keywords.fine_grained, seenKeywords), ); + this.selectAll(); } private getSelectedExtractedKeywordEntries(): KeywordEntryWithTopic[] { @@ -580,8 +621,93 @@ export class KeywordsSearchComponent { ); } + onViewToggleChange(value: KeywordView): void { + if (this.keywordView() !== value) { + this.keywordView.set(value); + } + this.updateQueryParams(); + } + + onSubfieldLegendVisibleChange(visible: boolean): void { + this.subfieldLegendVisible.set(visible); + this.updateQueryParams(); + } + + onSubfieldLegendExpandedChange(expanded: boolean): void { + this.subfieldLegendExpanded.set(expanded); + this.updateQueryParams(); + } + + // Use this instead of directly binding keyword.topic_mapping?.topic?.display_name + getChipLabel(keyword: KeywordEntryWithTopic): string { + if (this.keywordView() == 'llm') { + return keyword.llm_keyword?.keyword ?? ''; + } + return ( + keyword.topic_mapping?.topic?.display_name ?? + keyword.llm_keyword?.keyword ?? + '' + ); + } private getKeywordLabel(item: KeywordEntryWithTopic): string { - return item.llm_keyword.keyword.trim(); + return item.llm_keyword.keyword; + } + + private getKeywordLabels(items: KeywordEntryWithTopic[]): string[] { + return items.map((item) => this.getKeywordLabel(item)); + } + + private getTopic(item: KeywordEntryWithTopic) { + return item.topic_mapping?.topic ?? null; + } + + getChipDescription(item: KeywordEntryWithTopic): string | null { + return this.getTopic(item)?.description ?? null; + } + + getChipSubfieldName(item: KeywordEntryWithTopic): string | null { + return this.getTopic(item)?.subfield?.display_name ?? null; + } + + getChipFieldName(item: KeywordEntryWithTopic): string | null { + return this.getTopic(item)?.field?.display_name ?? null; + } + + getChipDomainName(item: KeywordEntryWithTopic): string | null { + return this.getTopic(item)?.domain?.display_name ?? null; + } + + getChipCount(item: KeywordEntryWithTopic): number | null { + const topic = this.getTopic(item); + return topic?.works_count ?? null; + } + + private toTopicLegendTopic(topic: Topic): TopicLegendTopic { + return { + id: topic.id ?? topic.display_name ?? '', + name: topic.display_name ?? '', + field_id: topic.field?.id ?? null, + field_name: topic.field?.display_name ?? null, + field_description: null, + domain_id: topic.domain?.id ?? null, + domain_name: topic.domain?.display_name ?? null, + domain_description: null, + subfield_id: topic.subfield?.id ?? null, + subfield_name: topic.subfield?.display_name ?? null, + subfield_description: null, + }; + } + + getTopicColor(topic: Topic | undefined | null): string { + const topicInput: TopicHierarchyColorInput = { + id: topic?.id ?? null, + name: topic?.display_name ?? null, + field_id: topic?.field?.id ?? null, + field_name: topic?.field?.display_name ?? null, + domain_id: topic?.domain?.id ?? null, + domain_name: topic?.domain?.display_name ?? null, + }; + return topicHierarchyColor(topicInput); } private keywordEntriesFromStrings( @@ -629,6 +755,9 @@ export class KeywordsSearchComponent { const manual = this.parseKeywordList(queryParams.get('manual')); const selected = this.parseKeywordList(queryParams.get('selected')); const source = queryParams.get('source') ?? ''; + const view = queryParams.get('view') ?? 'llm'; + const legend = queryParams.get('legend') ?? 'on'; + const legendExpanded = queryParams.get('legendExpanded') ?? 'off'; this.isRestoringState = true; @@ -636,7 +765,9 @@ export class KeywordsSearchComponent { { selectedInputType: mode, urlInput, textInput }, { emitEvent: false }, ); - + this.keywordView.set(view as KeywordView); + this.subfieldLegendVisible.set(legend === 'on'); + this.subfieldLegendExpanded.set(legendExpanded === 'on'); this.extractionSource.set(source as InputMode); this.restoreSourceFromSession(); @@ -657,16 +788,24 @@ export class KeywordsSearchComponent { // clean up the selection to only include keywords that actually exist in const manualKeywordSet = new Set( - this.manualKeywords().map((k) => this.normalizeKeyword(k)), + this.getKeywordLabels(this.manualKeywords()).map((k) => + this.normalizeKeyword(k), + ), ); const broadKeywordSet = new Set( - this.broadKeywords().map((k) => this.normalizeKeyword(k)), + this.getKeywordLabels(this.broadKeywords()).map((k) => + this.normalizeKeyword(k), + ), ); const coarseKeywordSet = new Set( - this.coarseKeywords().map((k) => this.normalizeKeyword(k)), + this.getKeywordLabels(this.coarseKeywords()).map((k) => + this.normalizeKeyword(k), + ), ); const fineKeywordSet = new Set( - this.fineKeywords().map((k) => this.normalizeKeyword(k)), + this.getKeywordLabels(this.fineKeywords()).map((k) => + this.normalizeKeyword(k), + ), ); const validSelected = selected.filter( (k) => @@ -694,10 +833,19 @@ export class KeywordsSearchComponent { mode: this.form.controls.selectedInputType.value, url: this.toNullableParam(this.form.controls.urlInput.value), text: this.toNullableParam(this.form.controls.textInput.value), - broad: this.serializeKeywords(this.broadKeywords()), - coarse: this.serializeKeywords(this.coarseKeywords()), - fine: this.serializeKeywords(this.fineKeywords()), - manual: this.serializeKeywords(this.manualKeywords()), + view: this.keywordView(), + legend: this.subfieldLegendVisible() ? 'on' : 'off', + legendExpanded: this.subfieldLegendExpanded() ? 'on' : 'off', + broad: this.serializeKeywords( + this.getKeywordLabels(this.broadKeywords()), + ), + coarse: this.serializeKeywords( + this.getKeywordLabels(this.coarseKeywords()), + ), + fine: this.serializeKeywords(this.getKeywordLabels(this.fineKeywords())), + manual: this.serializeKeywords( + this.getKeywordLabels(this.manualKeywords()), + ), selected: this.serializeKeywords(this.selectedKeywords()), }; diff --git a/webapp/src/app/modules/organizations/organization-dialog/organization-dialog.component.ts b/webapp/src/app/modules/organizations/organization-dialog/organization-dialog.component.ts index 6348c11f..a192c306 100644 --- a/webapp/src/app/modules/organizations/organization-dialog/organization-dialog.component.ts +++ b/webapp/src/app/modules/organizations/organization-dialog/organization-dialog.component.ts @@ -16,15 +16,22 @@ import { import { MatFormFieldModule } from '@angular/material/form-field'; import { MatIconModule } from '@angular/material/icon'; import { MatInputModule } from '@angular/material/input'; -import type { - CreateOrganizationPayload, - OrganizationProfile, - UpdateOrganizationPayload, -} from '../../../shared/services/organization-management.service'; +import { InseOrganizationManagementModelOrganizationProfile } from '../../../api'; + +export interface CreateOrganizationPayload { + name: string; + other_inst_id?: string | null; +} + +export interface UpdateOrganizationPayload { + name?: string; + other_inst_id?: string | null; + deleted?: boolean; +} export interface OrganizationDialogData { mode: 'create' | 'edit'; - organization?: OrganizationProfile; + organization?: InseOrganizationManagementModelOrganizationProfile; } export type OrganizationDialogResult = @@ -66,10 +73,9 @@ export class OrganizationDialogComponent { nonNullable: true, validators: [Validators.required], }), - otherInstId: new FormControl( - this.data.organization?.other_inst_id ?? '', - { nonNullable: true }, - ), + otherInstId: new FormControl(this.data.organization?.other_inst_id ?? '', { + nonNullable: true, + }), deleted: new FormControl(this.data.organization?.deleted ?? false, { nonNullable: true, }), @@ -100,6 +106,6 @@ export class OrganizationDialogComponent { } protected close(): void { - this.dialogRef.close(undefined); + this.dialogRef.close(); } } diff --git a/webapp/src/app/modules/organizations/organizations.component.html b/webapp/src/app/modules/organizations/organizations.component.html index a6486b74..14853ec0 100644 --- a/webapp/src/app/modules/organizations/organizations.component.html +++ b/webapp/src/app/modules/organizations/organizations.component.html @@ -3,6 +3,7 @@

Organisationen

Mandanten, externe Institutions-IDs und Status verwalten.

+
- Seite {{ page + 1 }} - - - + + + + + + + + + + {{ (row.deleted ? 'inactive' : 'active') | status }} + + + + +
+ + +
+
diff --git a/webapp/src/app/modules/organizations/organizations.component.scss b/webapp/src/app/modules/organizations/organizations.component.scss index b558f858..e455d7e3 100644 --- a/webapp/src/app/modules/organizations/organizations.component.scss +++ b/webapp/src/app/modules/organizations/organizations.component.scss @@ -5,15 +5,9 @@ padding: 24px; } -.page-header, -.table-header, -.pagination, -.row-actions { +.page-header { display: flex; align-items: center; -} - -.page-header { justify-content: space-between; gap: 16px; } @@ -32,60 +26,6 @@ p { margin-top: 6px; } -.table-panel { - overflow: hidden; - border: 1px solid #d7dde6; - border-radius: 8px; - background: #fff; -} - -.table-header { - justify-content: space-between; - padding: 16px; - border-bottom: 1px solid #e5e7eb; -} - -.table-wrap { - overflow-x: auto; -} - -table { - width: 100%; - border-collapse: collapse; -} - -th, -td { - padding: 12px 16px; - text-align: left; - border-bottom: 1px solid #edf1f7; - white-space: nowrap; -} - -th { - color: #475569; - font-weight: 700; - background: #f8fafc; -} - -tr.deleted { - color: #94a3b8; -} - -.identifier { - font-family: monospace; - font-size: 12px; -} - -.link-button { - border: 0; - background: transparent; - color: #1d4ed8; - padding: 0; - font: inherit; - cursor: pointer; -} - .status { display: inline-flex; align-items: center; @@ -103,21 +43,6 @@ tr.deleted { color: #991b1b; } -.row-actions { - gap: 4px; -} - -.empty { - color: #64748b; - text-align: center; -} - -.pagination { - justify-content: flex-end; - gap: 8px; - padding: 12px 16px; -} - @media (max-width: 640px) { .organizations-page { padding: 16px; @@ -128,3 +53,8 @@ tr.deleted { flex-direction: column; } } + +mat-card, +mat-paginator { + background-color: var(--sg-background); +} diff --git a/webapp/src/app/modules/organizations/organizations.component.ts b/webapp/src/app/modules/organizations/organizations.component.ts index 0d061c50..6cbaecb4 100644 --- a/webapp/src/app/modules/organizations/organizations.component.ts +++ b/webapp/src/app/modules/organizations/organizations.component.ts @@ -1,19 +1,34 @@ import { CommonModule } from '@angular/common'; -import { Component, OnInit, inject } from '@angular/core'; +import { + Component, + inject, + input, + OnInit, + TemplateRef, + viewChild, +} from '@angular/core'; import { MatButtonModule } from '@angular/material/button'; import { MatDialog, MatDialogModule } from '@angular/material/dialog'; import { MatIconModule } from '@angular/material/icon'; import { MatSnackBar, MatSnackBarModule } from '@angular/material/snack-bar'; -import { finalize } from 'rxjs'; -import { - OrganizationManagementService, - OrganizationProfile, -} from '../../shared/services/organization-management.service'; import type { OrganizationDialogComponent, OrganizationDialogData, OrganizationDialogResult, } from './organization-dialog/organization-dialog.component'; +import { + InseOrganizationManagementModelOrganizationProfile, + OrganizationPage, + OrganizationService, +} from '../../api'; +import { + GenericColumn, + DataTableComponent, +} from '../../shared/ui/data-table/data-table.component'; +import { MatCardModule } from '@angular/material/card'; +import { StatusPipe } from '../../shared/pipes/status.pipe'; +import { QueryParamPaginatorComponent } from '../../shared/ui/query-param-paginator/query-param-paginator.component'; +import { Router } from '@angular/router'; @Component({ selector: 'app-organizations', @@ -23,50 +38,81 @@ import type { MatDialogModule, MatIconModule, MatSnackBarModule, + DataTableComponent, + MatCardModule, + StatusPipe, + QueryParamPaginatorComponent, ], templateUrl: './organizations.component.html', styleUrl: './organizations.component.scss', standalone: true, }) export class OrganizationsComponent implements OnInit { - private readonly organizationService = inject(OrganizationManagementService); + private readonly router = inject(Router); private readonly dialog = inject(MatDialog); private readonly snackBar = inject(MatSnackBar); + private readonly organizationService = inject(OrganizationService); - protected organizations: OrganizationProfile[] = []; - protected total = 0; - protected page = 0; - protected readonly pageSize = 10; - protected isLoading = false; + organizationPage = input.required(); + organizationColumns: GenericColumn[] = + []; + + organizationStatusTmp = viewChild.required>( + 'organizationStatusTmp', + ); + organizationActionsTmp = viewChild.required>( + 'organizationActionsTmp', + ); ngOnInit(): void { - this.loadOrganizations(); - } - - protected loadOrganizations(page = this.page): void { - this.page = page; - this.isLoading = true; - this.organizationService - .getOrganizations(page, this.pageSize) - .pipe(finalize(() => (this.isLoading = false))) - .subscribe({ - next: (result) => { - this.organizations = result.items; - this.total = result.total; - }, - error: () => this.showError('Organisationen konnten nicht geladen werden.'), - }); + this.organizationColumns = [ + { + id: 'name', + header: 'Name', + type: 'accessor', + accessorKey: 'name', + }, + { + id: 'other_inst_id', + header: 'Externe ID', + type: 'accessor', + accessorKey: 'other_inst_id', + }, + { + id: 'member_count', + header: 'Mitglieder', + type: 'accessor', + accessorKey: 'member_count', + }, + { + id: 'deleted', + header: 'Status', + type: 'accessor', + accessorKey: 'deleted', + cellTemplate: this.organizationStatusTmp(), + }, + { + id: 'actions', + header: 'Aktionen', + type: 'display', + cellTemplate: this.organizationActionsTmp(), + }, + ]; } protected startCreate(): void { this.openDialog({ mode: 'create' }); } - protected startEdit(organization: OrganizationProfile): void { + protected startEdit( + organization: InseOrganizationManagementModelOrganizationProfile, + ): void { this.openDialog({ mode: 'edit', organization }); } - protected deleteOrganization(organization: OrganizationProfile): void { + protected deleteOrganization( + organization: InseOrganizationManagementModelOrganizationProfile, + ): void { if (organization.deleted) return; import('../../shared/ui/confirmation-dialog/confirmation-dialog.component').then( @@ -87,26 +133,24 @@ export class OrganizationsComponent implements OnInit { ); } - private softDeleteOrganization(organization: OrganizationProfile): void { - this.organizationService.deleteOrganization(organization.id).subscribe({ + private softDeleteOrganization( + organization: InseOrganizationManagementModelOrganizationProfile, + ): void { + this.organizationService.deleteOrganisation(organization.id).subscribe({ next: () => { this.snackBar.open('Organisation wurde deaktiviert.', 'OK', { duration: 3000, }); - this.loadOrganizations(); + this.router.navigate([], { + queryParams: { page: 0 }, + queryParamsHandling: 'merge', + }); }, - error: () => this.showError('Organisation konnte nicht deaktiviert werden.'), + error: () => + this.showError('Organisation konnte nicht deaktiviert werden.'), }); } - protected get canPageBack(): boolean { - return this.page > 0; - } - - protected get canPageForward(): boolean { - return (this.page + 1) * this.pageSize < this.total; - } - private openDialog(data: OrganizationDialogData): void { import('./organization-dialog/organization-dialog.component').then( ({ OrganizationDialogComponent }) => { @@ -130,8 +174,8 @@ export class OrganizationsComponent implements OnInit { private save(result: OrganizationDialogResult): void { const request = result.mode === 'create' - ? this.organizationService.createOrganization(result.payload) - : this.organizationService.updateOrganization( + ? this.organizationService.createOrganisation(result.payload) + : this.organizationService.updateOrganisation( result.organizationId, result.payload, ); @@ -141,7 +185,10 @@ export class OrganizationsComponent implements OnInit { this.snackBar.open('Organisation wurde gespeichert.', 'OK', { duration: 3000, }); - this.loadOrganizations(0); + this.router.navigate([], { + queryParams: { page: 0 }, + queryParamsHandling: 'merge', + }); }, error: (error) => this.showError( diff --git a/webapp/src/app/modules/patents/patents.component.html b/webapp/src/app/modules/patents/patents.component.html index 14a37666..92d02cec 100644 --- a/webapp/src/app/modules/patents/patents.component.html +++ b/webapp/src/app/modules/patents/patents.component.html @@ -1,316 +1,313 @@ -
-

Patente

- - - -
- - Suche nach Titel oder Patent-Nr. - - search - - - -
- - Alle - EPO - USPTO - - -
- -
-
-
- - - - @if (loading) { -
- - Lade Patente... -
- } @else if (error) { -

Fehler beim Laden der Patente.

- } @else if (showDetail && selectedPatent) { -
- - -

{{ selectedPatent.title ?? selectedPatent.patent_id }}

- -
- @for (row of getPatentMetadataRows(selectedPatent); track row.label) { -
-
{{ row.label }}
-
- @if (row.variant === 'source') { - {{ row.value }} - } @else { - {{ row.value }} - } -
-
- } -
- - @if (selectedPatent.abstract) { -
-

Abstract

-

{{ selectedPatent.abstract }}

-
- } - -
-

Erfinder

-
    - @for (inv of selectedPatent.inventors; track inv) { -
  • {{ inv }}
  • - } -
-
- - @if ((selectedPatent.assignees?.length ?? 0) > 0) { -
-

Anmelder

-
    - @for (a of selectedPatent.assignees; track a) { -
  • {{ a }}
  • - } -
-
- } - - @if ((selectedPatent.ipc_descriptions?.length ?? 0) > 0) { -
-

Klassifikation (IPC)

-
- @for ( - card of getClassificationCards( - selectedPatent.ipc_descriptions, - 'IPC' - ); - track card.key - ) { -
-
-
- @for (sym of card.symbols; track sym) { - {{ sym }} - } -
-
- {{ card.system }} - {{ card.levelLabel }} -
-
- @if (card.primaryDescription) { -

- {{ - isClassificationExpanded(card.key) - ? card.primaryDescription - : getDescriptionPreview(card.primaryDescription) - }} -

- @if (isLongDescription(card.primaryDescription)) { - - } - } - @if (card.hierarchy.length > 0) { -
- @for (row of card.hierarchy; track row.label) { -
-
{{ row.label }}
-
{{ row.value }}
-
- } -
- } -
- } -
-
- } @else if ((selectedPatent.ipc?.length ?? 0) > 0) { -
-

Klassifikation (IPC)

-
    - @for (ipc of selectedPatent.ipc; track ipc) { -
  • {{ ipc }}
  • - } -
-
- } - - @if ((selectedPatent.cpc_descriptions?.length ?? 0) > 0) { -
-

Klassifikation (CPC)

-
- @for ( - card of getClassificationCards( - selectedPatent.cpc_descriptions, - 'CPC' - ); - track card.key - ) { -
-
-
- @for (sym of card.symbols; track sym) { - {{ sym }} - } -
-
- {{ card.system }} - {{ card.levelLabel }} -
-
- @if (card.primaryDescription) { -

- {{ - isClassificationExpanded(card.key) - ? card.primaryDescription - : getDescriptionPreview(card.primaryDescription) - }} -

- @if (isLongDescription(card.primaryDescription)) { - - } - } - @if (card.hierarchy.length > 0) { -
- @for (row of card.hierarchy; track row.label) { -
-
{{ row.label }}
-
{{ row.value }}
-
- } -
- } -
- } -
-
- } @else if ((selectedPatent.cpc?.length ?? 0) > 0) { -
-

Klassifikation (CPC)

-
    - @for (cpc of selectedPatent.cpc; track cpc) { -
  • {{ cpc }}
  • - } -
-
- } -
- } @else if (patents.length === 0) { -
-

Keine Patente gefunden.

-
- } @else { -
- @for ( - patent of patents; - track patent.patent_id + (patent.publication_date ?? '') - ) { - - - {{ - patent.title ?? patent.patent_id - }} - - {{ patent.source }} - - - - - - - - - - - - - - } -
- } - - - - @if (!showDetail) { - - } -
+
+

Patente

+ + + +
+ + Suche nach Titel oder Patent-Nr. + + search + + + +
+ + Alle + EPO + USPTO + + + +
+
+ + + + @if (loading) { +
+ + Lade Patente... +
+ } @else if (error) { +

Fehler beim Laden der Patente.

+ } @else if (showDetail && selectedPatent) { +
+ + +

{{ selectedPatent.title ?? selectedPatent.patent_id }}

+ +
+ @for (row of getPatentMetadataRows(selectedPatent); track row.label) { +
+
{{ row.label }}
+
+ @if (row.variant === 'source') { + {{ row.value }} + } @else { + {{ row.value }} + } +
+
+ } +
+ + @if (selectedPatent.abstract) { +
+

Abstract

+

{{ selectedPatent.abstract }}

+
+ } + +
+

Erfinder

+
    + @for (inv of selectedPatent.inventors; track inv) { +
  • {{ inv }}
  • + } +
+
+ + @if ((selectedPatent.assignees?.length ?? 0) > 0) { +
+

Anmelder

+
    + @for (a of selectedPatent.assignees; track a) { +
  • {{ a }}
  • + } +
+
+ } + + @if ((selectedPatent.ipc_descriptions?.length ?? 0) > 0) { +
+

Klassifikation (IPC)

+
+ @for ( + card of getClassificationCards( + selectedPatent.ipc_descriptions, + 'IPC' + ); + track card.key + ) { +
+
+
+ @for (sym of card.symbols; track sym) { + {{ sym }} + } +
+
+ {{ card.system }} + {{ card.levelLabel }} +
+
+ @if (card.primaryDescription) { +

+ {{ + isClassificationExpanded(card.key) + ? card.primaryDescription + : getDescriptionPreview(card.primaryDescription) + }} +

+ @if (isLongDescription(card.primaryDescription)) { + + } + } + @if (card.hierarchy.length > 0) { +
+ @for (row of card.hierarchy; track row.label) { +
+
{{ row.label }}
+
{{ row.value }}
+
+ } +
+ } +
+ } +
+
+ } @else if ((selectedPatent.ipc?.length ?? 0) > 0) { +
+

Klassifikation (IPC)

+
    + @for (ipc of selectedPatent.ipc; track ipc) { +
  • {{ ipc }}
  • + } +
+
+ } + + @if ((selectedPatent.cpc_descriptions?.length ?? 0) > 0) { +
+

Klassifikation (CPC)

+
+ @for ( + card of getClassificationCards( + selectedPatent.cpc_descriptions, + 'CPC' + ); + track card.key + ) { +
+
+
+ @for (sym of card.symbols; track sym) { + {{ sym }} + } +
+
+ {{ card.system }} + {{ card.levelLabel }} +
+
+ @if (card.primaryDescription) { +

+ {{ + isClassificationExpanded(card.key) + ? card.primaryDescription + : getDescriptionPreview(card.primaryDescription) + }} +

+ @if (isLongDescription(card.primaryDescription)) { + + } + } + @if (card.hierarchy.length > 0) { +
+ @for (row of card.hierarchy; track row.label) { +
+
{{ row.label }}
+
{{ row.value }}
+
+ } +
+ } +
+ } +
+
+ } @else if ((selectedPatent.cpc?.length ?? 0) > 0) { +
+

Klassifikation (CPC)

+
    + @for (cpc of selectedPatent.cpc; track cpc) { +
  • {{ cpc }}
  • + } +
+
+ } +
+ } @else if (patents.length === 0) { +
+

Keine Patente gefunden.

+
+ } @else { +
+ @for ( + patent of patents; + track patent.patent_id + (patent.publication_date ?? '') + ) { + + + {{ + patent.title ?? patent.patent_id + }} + + {{ patent.source }} + + + + + + + + + + + + + + } +
+ } + + + + @if (!showDetail) { + + } +
diff --git a/webapp/src/app/modules/patents/patents.component.ts b/webapp/src/app/modules/patents/patents.component.ts index 3a0dd94b..e6af3264 100644 --- a/webapp/src/app/modules/patents/patents.component.ts +++ b/webapp/src/app/modules/patents/patents.component.ts @@ -15,6 +15,10 @@ import { debounceTime, distinctUntilChanged, Subject } from 'rxjs'; import { PatentsService } from '../../api/api/patents.service'; import { PatentEntry } from '../../api/model/patentEntry'; import { IpcClassification } from '../../api'; +import { + QueryParamSelectorComponent, + SelectorOption, +} from '../../shared/ui/query-param-selector/query-param-selector.component'; type SourceFilter = 'all' | 'EPO' | 'USPTO'; type ClassificationSystem = 'IPC' | 'CPC'; @@ -44,6 +48,7 @@ const DESCRIPTION_PREVIEW_LENGTH = 140; MatProgressSpinnerModule, MatChipsModule, MatDividerModule, + QueryParamSelectorComponent, ], templateUrl: './patents.component.html', styleUrl: './patents.component.scss', @@ -71,6 +76,12 @@ export class PatentsComponent implements OnInit { private searchSubject = new Subject(); + sortingDirectionOptions: SelectorOption[] = [ + { value: '', display_name: '' }, + { value: 'asc', display_name: 'Aufsteigend' }, + { value: 'desc', display_name: 'Absteigend' }, + ]; + constructor() { this.searchSubject .pipe(debounceTime(300), distinctUntilChanged(), takeUntilDestroyed()) diff --git a/webapp/src/app/modules/person-card/person-card.component.html b/webapp/src/app/modules/person-card/person-card.component.html index e07bb800..946430ae 100644 --- a/webapp/src/app/modules/person-card/person-card.component.html +++ b/webapp/src/app/modules/person-card/person-card.component.html @@ -57,7 +57,10 @@ + class="person-topic-chip" + size="mini" + [label]="topic.display_name || ''" + [description]="topic.description" + [subfieldName]="topic.subfield?.display_name" + [fieldName]="topic.field?.display_name" + [domainName]="topic.domain?.display_name" + [color]="getTopicColor(topic)" + [active]="isTopicSelected(topic)" + (chipClick)="handleTopicClick(topic)"> + } diff --git a/webapp/src/app/modules/person-card/person-card.component.scss b/webapp/src/app/modules/person-card/person-card.component.scss index 5dd6b14c..75f0ed69 100644 --- a/webapp/src/app/modules/person-card/person-card.component.scss +++ b/webapp/src/app/modules/person-card/person-card.component.scss @@ -172,6 +172,27 @@ 0 0 0 2px var(--sg-background), 0 0 0 4px var(--sg-primary); } + + &.active { + border-color: var(--sg-primary); + box-shadow: + 0 0 0 1px #ffffff, + 0 0 0 3px var(--sg-primary); + } + + &.active:hover, + &.active:focus-visible { + background: var(--sg-primary); + color: #fff; + } + + &.is-loading { + pointer-events: none; + background: var(--sg-surface-soft); + border-color: var(--sg-border); + color: var(--sg-text-soft); + box-shadow: none; + } } .flag-img { @@ -246,55 +267,25 @@ .topic-row { display: flex; flex-wrap: wrap; - gap: 4px; + gap: 5px; } -.topic-tag { - background: var(--sg-surface-soft); - border: 1px solid var(--sg-border); - color: var(--sg-text-muted); - font-size: 10px; - font-weight: 600; - padding: 2px 6px; - border-radius: 4px; - cursor: pointer; - transition: all 0.2s ease; +app-topic-chip.person-topic-chip { + min-width: 0; max-width: 100%; +} + +:host ::ng-deep app-topic-chip.person-topic-chip .topic-chip__button { + max-width: 100%; +} + +:host ::ng-deep app-topic-chip.person-topic-chip .topic-chip__label { + justify-self: stretch; + min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; - box-sizing: border-box; - margin: 0; - line-height: normal; - font-family: inherit; - display: inline-flex; - align-items: center; - - &:hover, - &:focus-visible { - background: var(--sg-primary-soft); - border-color: var(--sg-primary); - color: var(--sg-primary); - outline: none; - box-shadow: - 0 0 0 2px var(--sg-background), - 0 0 0 4px var(--sg-primary); - } - - &.active { - background: var(--sg-primary-soft); - border-color: var(--sg-primary); - color: var(--sg-primary); - font-weight: 700; - box-shadow: 0 0 0 1.5px var(--sg-primary); - - &:hover, - &:focus-visible { - box-shadow: - 0 0 0 2px var(--sg-background), - 0 0 0 4px var(--sg-primary); - } - } + overflow-wrap: normal; } .card-footer { diff --git a/webapp/src/app/modules/person-card/person-card.component.ts b/webapp/src/app/modules/person-card/person-card.component.ts index 02e5a109..e8a50711 100644 --- a/webapp/src/app/modules/person-card/person-card.component.ts +++ b/webapp/src/app/modules/person-card/person-card.component.ts @@ -5,6 +5,8 @@ import { MatIconModule } from '@angular/material/icon'; import { MatTooltipModule } from '@angular/material/tooltip'; import { CustomAuthor, DehydratedInstitution, WorkTopic } from '../../api'; import { SkTextDirective } from '../../custom-directives/sk-text.directive'; +import { TopicChipComponent } from '../../shared/ui/topic-chip/topic-chip.component'; +import { topicHierarchyColor } from '../../resolvers/utils/topic-colors'; @Component({ selector: 'app-person-card', @@ -15,6 +17,7 @@ import { SkTextDirective } from '../../custom-directives/sk-text.directive'; MatIconModule, SkTextDirective, MatTooltipModule, + TopicChipComponent, ], templateUrl: './person-card.component.html', styleUrl: './person-card.component.scss', @@ -24,6 +27,7 @@ export class PersonCardComponent { isBookmarked = input(false); loading = input(false); selectedTopics = input>(new Set()); + activeInstitutionName = input(''); bookmarkToggle = output(); topicClick = output(); @@ -62,6 +66,14 @@ export class PersonCardComponent { return newestInstitution; }); + isInstitutionActive = computed(() => { + const active = this.activeInstitutionName().trim().toLowerCase(); + if (!active) return false; + return ( + (this.institution()?.display_name ?? '').trim().toLowerCase() === active + ); + }); + topics = computed(() => { return (this.person().topics ?? []) .filter((t): t is WorkTopic => !!t.display_name) @@ -117,17 +129,29 @@ export class PersonCardComponent { return 'possible'; } - getTopicTooltip(topic: WorkTopic): string { - const parts: string[] = []; - if (topic.domain?.display_name) parts.push(topic.domain.display_name); - if (topic.field?.display_name) parts.push(topic.field.display_name); - if (topic.subfield?.display_name) parts.push(topic.subfield.display_name); + isTopicSelected(topic: WorkTopic): boolean { + return this.selectedTopics().has(topic.display_name || ''); + } - const path = parts.join(' - '); - if (topic.display_name) { - return path ? `${topic.display_name}\n(${path})` : topic.display_name; + getTopicColor(topic: WorkTopic): string { + return topicHierarchyColor({ + id: topic.id, + name: topic.display_name, + field_id: topic.field?.id, + field_name: topic.field?.display_name, + domain_id: topic.domain?.id, + domain_name: topic.domain?.display_name, + }); + } + + handleTopicClick(topic: WorkTopic): void { + const topicName = topic.display_name || ''; + + if (!topicName) { + return; } - return path; + + this.topicClick.emit(topicName); } getCareerStageTooltip(careerStage: string): string { diff --git a/webapp/src/app/modules/person-interesting/person-interesting.component.html b/webapp/src/app/modules/person-interesting/person-interesting.component.html index bc015605..18999c00 100644 --- a/webapp/src/app/modules/person-interesting/person-interesting.component.html +++ b/webapp/src/app/modules/person-interesting/person-interesting.component.html @@ -11,10 +11,15 @@
@@ -29,6 +34,7 @@ [domainName]="tag.domainName" [color]="tag.color" [disabled]="!tag.id" + [active]="isTagActive(tag)" countIcon="article" descriptionTooltipTarget="button" (chipClick)="onTagClick(tag)"> diff --git a/webapp/src/app/modules/person-interesting/person-interesting.component.ts b/webapp/src/app/modules/person-interesting/person-interesting.component.ts index e8ca3988..aa61f6f0 100644 --- a/webapp/src/app/modules/person-interesting/person-interesting.component.ts +++ b/webapp/src/app/modules/person-interesting/person-interesting.component.ts @@ -17,7 +17,15 @@ import { TopicCount } from '../../api'; import { TopicChipComponent } from '../../shared/ui/topic-chip/topic-chip.component'; import { TopicLegendComponent } from '../../shared/ui/topic-legend/topic-legend.component'; import { topicHierarchyColor } from '../../resolvers/utils/topic-colors'; -import { buildTopicLegendGroups } from '../../resolvers/utils/topic-legend'; +import { + buildTopicLegendGroups, + getTopicLegendFieldId, + getTopicLegendSubfieldId, + TopicLegendGroup, + TopicLegendSubfieldSelection, + toggleTopicLegendFieldSelection, + toggleTopicLegendSubfieldSelection, +} from '../../resolvers/utils/topic-legend'; interface InterestTag { id: string; @@ -59,6 +67,8 @@ export class PersonInterestingComponent implements OnInit { readonly topics = input(null); readonly legendExpanded = signal(false); + readonly activeLegendFieldIds = signal>(new Set()); + readonly activeLegendSubfieldIds = signal>(new Set()); readonly tagClick = output<{ id: string; name: string }>(); @@ -144,6 +154,45 @@ export class PersonInterestingComponent implements OnInit { }); } + onLegendFieldToggle(group: TopicLegendGroup): void { + const selection = toggleTopicLegendFieldSelection( + this.activeLegendFieldIds(), + this.activeLegendSubfieldIds(), + group, + ); + + this.activeLegendFieldIds.set(selection.fieldIds); + this.activeLegendSubfieldIds.set(selection.subfieldIds); + } + + onLegendSubfieldToggle(selection: TopicLegendSubfieldSelection): void { + const nextSelection = toggleTopicLegendSubfieldSelection( + this.activeLegendFieldIds(), + this.activeLegendSubfieldIds(), + selection, + ); + + this.activeLegendFieldIds.set(nextSelection.fieldIds); + this.activeLegendSubfieldIds.set(nextSelection.subfieldIds); + } + + isTagActive(tag: InterestTag): boolean { + const fieldLegendId = getTopicLegendFieldId({ + field_id: tag.fieldId, + field_name: tag.fieldName, + }); + const subfieldLegendId = getTopicLegendSubfieldId({ + subfield_id: tag.subfieldId, + subfield_name: tag.subfieldName, + }); + + return ( + this.activeLegendFieldIds().has(fieldLegendId) || + (subfieldLegendId.length > 0 && + this.activeLegendSubfieldIds().has(subfieldLegendId)) + ); + } + private parseBooleanQueryParam( value: string | null, fallback: boolean, diff --git a/webapp/src/app/modules/person-list/person-list.component.html b/webapp/src/app/modules/person-list/person-list.component.html index 3dba668f..8f3b0f37 100644 --- a/webapp/src/app/modules/person-list/person-list.component.html +++ b/webapp/src/app/modules/person-list/person-list.component.html @@ -32,16 +32,74 @@
Aktive Filter:
- @for (filter of activeFilters; track filter.value) { - - {{ filter.label }} - - + @for ( + filter of activeFilters; + track filter.category + filter.value + ) { + @if (filter.category === 'topic') { + + + label + {{ + filter.value + }} + + + + } @else if (filter.category === 'institutionName') { + + + apartment + {{ + institutionFilterLabel(filter) + }} + @if (filter.countryCode) { + + {{ + filter.countryCode.toUpperCase() + }} + } + + + + } @else { + + {{ filter.label }} + + + } }
-
- {{ selectedStartYear }} - bis - {{ selectedEndYear }} -
-
@@ -354,6 +359,7 @@ [countTooltip]="getPhaseTopicCountTooltip(topic, phase)" [color]="getTopicColor(topic)" [disabled]="!topic.id" + [active]="isTopicActiveByLegend(topic)" (chipClick)="selectTopic(topic, getPhaseYears(phase))"> @@ -431,6 +437,7 @@ [countTooltip]="getYearTopicCountTooltip(topic, year)" [color]="getTopicColor(topic)" [disabled]="!topic.id" + [active]="isTopicActiveByLegend(topic)" (chipClick)="selectTopic(topic, [year.year])"> diff --git a/webapp/src/app/modules/person-overview/components/research-timeline/research-timeline.component.scss b/webapp/src/app/modules/person-overview/components/research-timeline/research-timeline.component.scss index b31867e2..98072adf 100644 --- a/webapp/src/app/modules/person-overview/components/research-timeline/research-timeline.component.scss +++ b/webapp/src/app/modules/person-overview/components/research-timeline/research-timeline.component.scss @@ -34,14 +34,18 @@ } .timeline-header { + --year-filter-width: 285px; + --header-gap: 24px; display: grid; grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr); align-items: flex-start; - gap: 24px; + gap: 10px var(--header-gap); margin-bottom: 28px; } .timeline-title { + grid-column: 1; + grid-row: 1; min-width: 0; h2 { @@ -64,7 +68,20 @@ } } +.timeline-legend { + grid-column: 1 / -1; + grid-row: 2; + min-width: 0; + + ::ng-deep .topic-legend { + width: 100%; + margin-top: 0; + } +} + .view-toggle { + grid-column: 2; + grid-row: 1; justify-self: center; display: flex; gap: 4px; @@ -94,9 +111,11 @@ } .year-filter { + grid-column: 3; + grid-row: 1; justify-self: end; - width: min(285px, 100%); - padding: 8px 10px; + width: min(var(--year-filter-width), 100%); + padding: 5px 10px; border: 1px solid #dbe5f6; border-radius: 10px; background: #fbfdff; @@ -137,17 +156,16 @@ } .year-filter-values { - justify-content: center; - gap: 7px; - margin-bottom: 5px; + gap: 5px; color: #40506f; font-size: 12px; font-weight: 600; + white-space: nowrap; } .year-filter-bounds { justify-content: space-between; - margin-top: 1px; + margin-top: 0; color: #7c88a3; font-size: 10px; } @@ -157,7 +175,7 @@ --range-end: 100%; position: relative; - height: 22px; + height: 16px; } .range-track { @@ -586,6 +604,18 @@ app-topic-chip.timeline-topic-chip { grid-template-columns: 1fr; } + .timeline-title, + .timeline-legend, + .view-toggle, + .year-filter { + grid-column: auto; + grid-row: auto; + } + + .timeline-legend { + margin-right: 0; + } + .view-toggle { justify-self: start; } diff --git a/webapp/src/app/modules/person-overview/components/research-timeline/research-timeline.component.ts b/webapp/src/app/modules/person-overview/components/research-timeline/research-timeline.component.ts index d6ee5d30..f879586a 100644 --- a/webapp/src/app/modules/person-overview/components/research-timeline/research-timeline.component.ts +++ b/webapp/src/app/modules/person-overview/components/research-timeline/research-timeline.component.ts @@ -14,9 +14,18 @@ import { } from '@angular/core'; import { TopicChipComponent } from '../../../../shared/ui/topic-chip/topic-chip.component'; import { TopicLegendComponent } from '../../../../shared/ui/topic-legend/topic-legend.component'; -import { buildTopicLegendGroups, TopicLegendGroup, TopicLegendTopic } from '../../../../resolvers/utils/topic-legend'; -import { buildTopicHierarchyTooltip } from '../../../../resolvers/utils/topic-tooltip'; import { topicHierarchyColor } from '../../../../resolvers/utils/topic-colors'; +import { + buildTopicLegendGroups, + getTopicLegendFieldId, + getTopicLegendSubfieldId, + TopicLegendGroup, + TopicLegendSubfieldSelection, + TopicLegendTopic, + toggleTopicLegendFieldSelection, + toggleTopicLegendSubfieldSelection, +} from '../../../../resolvers/utils/topic-legend'; +import { buildTopicHierarchyTooltip } from '../../../../resolvers/utils/topic-tooltip'; export interface TopicTimelineTopic { id?: string; @@ -128,6 +137,8 @@ export class ResearchTimelineComponent implements OnChanges, AfterViewChecked { private readonly displayedPhaseTopicLimit = 4; private readonly scrollRestoreThreshold = 24; private readonly expandedPhaseIds = new Set(); + activeLegendFieldIds: ReadonlySet = new Set(); + activeLegendSubfieldIds: ReadonlySet = new Set(); private pendingTimelineScrollAnchor: TimelineScrollAnchor | undefined; @@ -421,6 +432,39 @@ export class ResearchTimelineComponent implements OnChanges, AfterViewChecked { this.subfieldLegendVisibleChange.emit(this.subfieldLegendVisible); } + onLegendFieldToggle(group: TopicLegendGroup): void { + const selection = toggleTopicLegendFieldSelection( + this.activeLegendFieldIds, + this.activeLegendSubfieldIds, + group, + ); + + this.activeLegendFieldIds = selection.fieldIds; + this.activeLegendSubfieldIds = selection.subfieldIds; + } + + onLegendSubfieldToggle(selection: TopicLegendSubfieldSelection): void { + const nextSelection = toggleTopicLegendSubfieldSelection( + this.activeLegendFieldIds, + this.activeLegendSubfieldIds, + selection, + ); + + this.activeLegendFieldIds = nextSelection.fieldIds; + this.activeLegendSubfieldIds = nextSelection.subfieldIds; + } + + isTopicActiveByLegend(topic: TopicTimelineTopic): boolean { + const fieldLegendId = getTopicLegendFieldId(topic); + const subfieldLegendId = getTopicLegendSubfieldId(topic); + + return ( + this.activeLegendFieldIds.has(fieldLegendId) || + (subfieldLegendId.length > 0 && + this.activeLegendSubfieldIds.has(subfieldLegendId)) + ); + } + trackByYear(_: number, item: TopicTimelineElement): number { return item.year; } @@ -556,7 +600,6 @@ export class ResearchTimelineComponent implements OnChanges, AfterViewChecked { return `im Zeitraum ${this.getPhaseYearLabel(phase)}`; } - private get earlierYearsColumnCount(): number { return this.showEarlierYearsControl ? 1 : 0; } diff --git a/webapp/src/app/modules/person-patents/person-patents.component.scss b/webapp/src/app/modules/person-patents/person-patents.component.scss index 37cac10f..654363da 100644 --- a/webapp/src/app/modules/person-patents/person-patents.component.scss +++ b/webapp/src/app/modules/person-patents/person-patents.component.scss @@ -1,564 +1,567 @@ -.message { - padding: 16px; - color: #666; -} - -.patents-container { - padding: 16px; - display: flex; - flex-direction: column; - gap: 16px; -} - -.sort-control { - display: inline-flex; - align-items: center; - gap: 6px; - width: fit-content; - padding: 10px 14px; - border-radius: 20px; - background: #f2f2f2; - color: #333; - font-size: 14px; - - span { - color: #555; - } - - select { - border: 0; - background: transparent; - color: #111827; - font: inherit; - cursor: pointer; - outline: none; - } -} - -.patents-content { - display: flex; - gap: 24px; - align-items: flex-start; -} - -.patents-list { - flex: 1; - - &.hidden { - display: none; - } - - .patents-list-toolbar { - display: flex; - align-items: center; - justify-content: space-between; - gap: 16px; - margin-bottom: 18px; - flex-wrap: wrap; - } - - table { - width: 100%; - border-collapse: collapse; - - th { - text-align: left; - padding: 10px 12px; - border-bottom: 2px solid #e0e0e0; - font-weight: 600; - color: #333; - } - - tr { - cursor: pointer; - - &:hover { - background: #f5f5f5; - } - - &.selected { - background: #f0f0f0; - } - } - - td { - padding: 10px 12px; - border-bottom: 1px solid #f0f0f0; - } - - .patent-title { - color: #333; - font-weight: 500; - max-width: 400px; - white-space: nowrap; - overflow: hidden; - text-overflow: ellipsis; - } - } -} - -.source-badge { - display: inline-flex; - align-items: center; - padding: 3px 10px; - border-radius: 999px; - font-size: 0.75rem; - font-weight: 700; - - &--epo { - background: #effaf3; - color: #24834f; - border: 1px solid #bdebcf; - } - - &--uspto { - background: #f0f6ff; - color: #0b63ce; - border: 1px solid #bdd4ff; - } -} - -.patent-detail { - width: 440px; - border: 1px solid #e0e0e0; - border-radius: 8px; - padding: 20px; - background: #fafafa; - - &.empty { - display: flex; - align-items: center; - justify-content: center; - color: #999; - min-height: 200px; - } - - &.overview { - display: flex; - flex-direction: column; - gap: 12px; - - .overview-title { - font-size: 15px; - font-weight: 600; - color: #333; - margin: 0; - } - - .overview-subtitle { - font-size: 13px; - color: #888; - margin: 0; - } - - .overview-stats { - display: grid; - grid-template-columns: 1fr 1fr 1fr; - gap: 10px; - margin-top: 4px; - } - - .overview-stat { - background: white; - border: 1px solid #e0e0e0; - border-radius: 8px; - padding: 12px 8px; - text-align: center; - - .overview-value { - display: block; - font-size: 22px; - font-weight: 700; - color: #333; - } - - .overview-label { - display: block; - font-size: 12px; - color: #888; - margin-top: 4px; - } - } - - .overview-hint { - font-size: 12px; - color: #aaa; - margin: 0; - } - } - - h3 { - margin: 0 0 16px 0; - font-size: 16px; - color: #333; - line-height: 1.4; - } -} - -.detail-stats { - display: grid; - grid-template-columns: 1fr 1fr; - gap: 10px; - - .stat { - background: white; - border: 1px solid #e0e0e0; - border-radius: 8px; - padding: 10px; - text-align: center; - - .stat-label { - display: block; - font-size: 11px; - color: #666; - margin-bottom: 4px; - text-transform: uppercase; - letter-spacing: 0.03em; - } - - .stat-value { - display: block; - font-size: 15px; - font-weight: bold; - color: #333; - } - } -} - -.patent-detail-preview { - margin: 14px 0 0; - font-size: 13px; - line-height: 1.55; - color: #555; -} - -.patent-detail-action { - display: flex; - align-items: center; - justify-content: space-between; - gap: 8px; - width: 100%; - margin-top: 16px; - padding: 12px 14px; - border: 1px solid #bdd4ff; - border-radius: 10px; - background: linear-gradient(180deg, #f8fbff 0%, #eef4ff 100%); - color: #0b63ce; - font-size: 14px; - font-weight: 600; - cursor: pointer; - transition: border-color 0.15s, background 0.15s, box-shadow 0.15s; - - &:hover { - border-color: #0b63ce; - background: #f0f6ff; - box-shadow: 0 2px 8px rgba(11, 99, 206, 0.12); - } - - .material-icons { - font-size: 20px; - } -} - -.patent-detail-hint { - margin: 8px 0 0; - font-size: 12px; - line-height: 1.4; - color: #888; - text-align: center; -} - -.patent-full-detail { - flex: 1; - border: 1px solid #e0e0e0; - border-radius: 8px; - padding: 20px; - background: #fafafa; - - h3 { - margin: 0 0 4px 0; - font-size: 16px; - color: #333; - line-height: 1.4; - } - - h4 { - margin: 16px 0 8px 0; - font-size: 14px; - color: #555; - font-weight: 600; - } - - p { - font-size: 13px; - color: #444; - line-height: 1.6; - margin: 0; - } -} - -.back-btn { - display: inline-flex; - align-items: center; - gap: 0.4rem; - - width: auto; - margin-bottom: 1rem; - padding: 0.5rem 0.85rem; - - border: 1px solid #d6e3f8; - border-radius: 999px; - - background: #f8fbff; - color: #2563eb; - - font-size: 0.9rem; - font-weight: 600; - - cursor: pointer; - transition: - background-color 0.15s ease, - border-color 0.15s ease, - color 0.15s ease, - box-shadow 0.15s ease; - - &:hover { - background: #eef5ff; - border-color: #bcd3f7; - color: #1d4ed8; - box-shadow: 0 1px 4px rgba(37, 99, 235, 0.12); - } - - &:focus-visible { - outline: 2px solid #93c5fd; - outline-offset: 2px; - } -} - -.detail-section { - margin-top: 12px; - padding-top: 12px; - border-top: 1px solid #eee; -} - -.patent-meta { - &--inline { - margin: 12px 0 20px; - } - - &__list { - margin: 0; - border: 1px solid #e2e8f4; - border-radius: 12px; - background: linear-gradient(180deg, #fff 0%, #f8faff 100%); - box-shadow: 0 1px 3px rgba(15, 23, 42, 0.04); - overflow: hidden; - } - - &__row { - display: grid; - grid-template-columns: minmax(130px, 38%) 1fr; - gap: 12px 16px; - align-items: center; - padding: 11px 16px; - border-top: 1px solid #eef2f8; - - &:first-child { - border-top: 0; - } - - dt { - margin: 0; - font-size: 12px; - font-weight: 500; - color: #64748b; - line-height: 1.35; - } - - dd { - margin: 0; - font-size: 14px; - font-weight: 600; - color: #1e293b; - line-height: 1.35; - word-break: break-word; - } - } -} - -.tag-list { - display: flex; - flex-wrap: wrap; - gap: 6px; - margin: 0; - padding: 0; - list-style: none; - - &--compact .tag { - font-size: 0.75rem; - padding: 3px 8px; - } -} - -.tag { - padding: 4px 10px; - border-radius: 999px; - background: #f0f6ff; - border: 1px solid #dbeafe; - color: #1e40af; - font-size: 0.8rem; - line-height: 1.3; -} - -.classification-section { - &--ipc .classification-card { - background: #f0f6ff; - border-color: #bfdbfe; - } - - &--ipc .classification-badge--system { - background: #dbeafe; - color: #1d4ed8; - } - - &--cpc .classification-card { - background: #f0fdf4; - border-color: #bbf7d0; - } - - &--cpc .classification-badge--system { - background: #dcfce7; - color: #15803d; - } -} - -.classification-cards { - display: flex; - flex-direction: column; - gap: 10px; -} - -.classification-card { - padding: 12px 14px; - border-radius: 10px; - border: 1px solid #dbeafe; -} - -.classification-card__header { - display: flex; - align-items: flex-start; - justify-content: space-between; - gap: 12px; - flex-wrap: wrap; -} - -.classification-card__codes { - display: flex; - flex-wrap: wrap; - gap: 6px; -} - -.classification-card__badges { - display: flex; - flex-wrap: wrap; - gap: 6px; -} - -.classification-code { - font-size: 0.9rem; - font-weight: 700; - color: #0f172a; -} - -.classification-badge { - display: inline-flex; - align-items: center; - padding: 2px 8px; - border-radius: 999px; - font-size: 0.68rem; - font-weight: 700; - letter-spacing: 0.02em; - text-transform: uppercase; -} - -.classification-badge--level { - background: #e2e8f0; - color: #475569; -} - -.classification-summary { - margin: 10px 0 0; - font-size: 0.84rem; - line-height: 1.5; - color: #334155; -} - -.classification-toggle { - margin-top: 6px; - padding: 0; - border: 0; - background: none; - color: #2563eb; - font-size: 0.78rem; - cursor: pointer; - - &:hover { - text-decoration: underline; - } -} - -.classification-hierarchy { - margin: 10px 0 0; - padding-top: 10px; - border-top: 1px solid rgba(15, 23, 42, 0.08); -} - -.classification-hierarchy__row { - display: grid; - grid-template-columns: 88px 1fr; - gap: 8px; - margin-bottom: 6px; - - dt { - margin: 0; - font-size: 0.72rem; - font-weight: 700; - color: #64748b; - text-transform: uppercase; - letter-spacing: 0.03em; - } - - dd { - margin: 0; - font-size: 0.8rem; - line-height: 1.45; - color: #334155; - } -} - -.pagination { - display: flex; - align-items: center; - justify-content: space-between; - gap: 8px; - margin-top: 12px; - - button { - padding: 4px 10px; - border: 1px solid #d0d0d0; - border-radius: 6px; - background: white; - cursor: pointer; - font-size: 12px; - - &:disabled { - opacity: 0.5; - cursor: default; - } - } - - span { - font-size: 12px; - color: #666; - } -} +.message { + padding: 16px; + color: #666; +} + +.patents-container { + padding: 16px; + display: flex; + flex-direction: column; + gap: 16px; +} + +.sort-control { + display: inline-flex; + align-items: center; + gap: 6px; + width: fit-content; + padding: 10px 14px; + border-radius: 20px; + background: #f2f2f2; + color: #333; + font-size: 14px; + + span { + color: #555; + } + + select { + border: 0; + background: transparent; + color: #111827; + font: inherit; + cursor: pointer; + outline: none; + } +} + +.patents-content { + display: flex; + gap: 24px; + align-items: flex-start; +} + +.patents-list { + flex: 1; + + &.hidden { + display: none; + } + + .patents-list-toolbar { + display: flex; + align-items: center; + justify-content: space-between; + gap: 16px; + margin-bottom: 18px; + flex-wrap: wrap; + } + + table { + width: 100%; + border-collapse: collapse; + + th { + text-align: left; + padding: 10px 12px; + border-bottom: 2px solid #e0e0e0; + font-weight: 600; + color: #333; + } + + tr { + cursor: pointer; + + &:hover { + background: #f5f5f5; + } + + &.selected { + background: #f0f0f0; + } + } + + td { + padding: 10px 12px; + border-bottom: 1px solid #f0f0f0; + } + + .patent-title { + color: #333; + font-weight: 500; + max-width: 400px; + white-space: nowrap; + overflow: hidden; + text-overflow: ellipsis; + } + } +} + +.source-badge { + display: inline-flex; + align-items: center; + padding: 3px 10px; + border-radius: 999px; + font-size: 0.75rem; + font-weight: 700; + + &--epo { + background: #effaf3; + color: #24834f; + border: 1px solid #bdebcf; + } + + &--uspto { + background: #f0f6ff; + color: #0b63ce; + border: 1px solid #bdd4ff; + } +} + +.patent-detail { + width: 440px; + border: 1px solid #e0e0e0; + border-radius: 8px; + padding: 20px; + background: #fafafa; + + &.empty { + display: flex; + align-items: center; + justify-content: center; + color: #999; + min-height: 200px; + } + + &.overview { + display: flex; + flex-direction: column; + gap: 12px; + + .overview-title { + font-size: 15px; + font-weight: 600; + color: #333; + margin: 0; + } + + .overview-subtitle { + font-size: 13px; + color: #888; + margin: 0; + } + + .overview-stats { + display: grid; + grid-template-columns: 1fr 1fr 1fr; + gap: 10px; + margin-top: 4px; + } + + .overview-stat { + background: white; + border: 1px solid #e0e0e0; + border-radius: 8px; + padding: 12px 8px; + text-align: center; + + .overview-value { + display: block; + font-size: 22px; + font-weight: 700; + color: #333; + } + + .overview-label { + display: block; + font-size: 12px; + color: #888; + margin-top: 4px; + } + } + + .overview-hint { + font-size: 12px; + color: #aaa; + margin: 0; + } + } + + h3 { + margin: 0 0 16px 0; + font-size: 16px; + color: #333; + line-height: 1.4; + } +} + +.detail-stats { + display: grid; + grid-template-columns: 1fr 1fr; + gap: 10px; + + .stat { + background: white; + border: 1px solid #e0e0e0; + border-radius: 8px; + padding: 10px; + text-align: center; + + .stat-label { + display: block; + font-size: 11px; + color: #666; + margin-bottom: 4px; + text-transform: uppercase; + letter-spacing: 0.03em; + } + + .stat-value { + display: block; + font-size: 15px; + font-weight: bold; + color: #333; + } + } +} + +.patent-detail-preview { + margin: 14px 0 0; + font-size: 13px; + line-height: 1.55; + color: #555; +} + +.patent-detail-action { + display: flex; + align-items: center; + justify-content: space-between; + gap: 8px; + width: 100%; + margin-top: 16px; + padding: 12px 14px; + border: 1px solid #bdd4ff; + border-radius: 10px; + background: linear-gradient(180deg, #f8fbff 0%, #eef4ff 100%); + color: #0b63ce; + font-size: 14px; + font-weight: 600; + cursor: pointer; + transition: + border-color 0.15s, + background 0.15s, + box-shadow 0.15s; + + &:hover { + border-color: #0b63ce; + background: #f0f6ff; + box-shadow: 0 2px 8px rgba(11, 99, 206, 0.12); + } + + .material-icons { + font-size: 20px; + } +} + +.patent-detail-hint { + margin: 8px 0 0; + font-size: 12px; + line-height: 1.4; + color: #888; + text-align: center; +} + +.patent-full-detail { + flex: 1; + border: 1px solid #e0e0e0; + border-radius: 8px; + padding: 20px; + background: #fafafa; + + h3 { + margin: 0 0 4px 0; + font-size: 16px; + color: #333; + line-height: 1.4; + } + + h4 { + margin: 16px 0 8px 0; + font-size: 14px; + color: #555; + font-weight: 600; + } + + p { + font-size: 13px; + color: #444; + line-height: 1.6; + margin: 0; + } +} + +.back-btn { + display: inline-flex; + align-items: center; + gap: 0.4rem; + + width: auto; + margin-bottom: 1rem; + padding: 0.5rem 0.85rem; + + border: 1px solid #d6e3f8; + border-radius: 999px; + + background: #f8fbff; + color: #2563eb; + + font-size: 0.9rem; + font-weight: 600; + + cursor: pointer; + transition: + background-color 0.15s ease, + border-color 0.15s ease, + color 0.15s ease, + box-shadow 0.15s ease; + + &:hover { + background: #eef5ff; + border-color: #bcd3f7; + color: #1d4ed8; + box-shadow: 0 1px 4px rgba(37, 99, 235, 0.12); + } + + &:focus-visible { + outline: 2px solid #93c5fd; + outline-offset: 2px; + } +} + +.detail-section { + margin-top: 12px; + padding-top: 12px; + border-top: 1px solid #eee; +} + +.patent-meta { + &--inline { + margin: 12px 0 20px; + } + + &__list { + margin: 0; + border: 1px solid #e2e8f4; + border-radius: 12px; + background: linear-gradient(180deg, #fff 0%, #f8faff 100%); + box-shadow: 0 1px 3px rgba(15, 23, 42, 0.04); + overflow: hidden; + } + + &__row { + display: grid; + grid-template-columns: minmax(130px, 38%) 1fr; + gap: 12px 16px; + align-items: center; + padding: 11px 16px; + border-top: 1px solid #eef2f8; + + &:first-child { + border-top: 0; + } + + dt { + margin: 0; + font-size: 12px; + font-weight: 500; + color: #64748b; + line-height: 1.35; + } + + dd { + margin: 0; + font-size: 14px; + font-weight: 600; + color: #1e293b; + line-height: 1.35; + word-break: break-word; + } + } +} + +.tag-list { + display: flex; + flex-wrap: wrap; + gap: 6px; + margin: 0; + padding: 0; + list-style: none; + + &--compact .tag { + font-size: 0.75rem; + padding: 3px 8px; + } +} + +.tag { + padding: 4px 10px; + border-radius: 999px; + background: #f0f6ff; + border: 1px solid #dbeafe; + color: #1e40af; + font-size: 0.8rem; + line-height: 1.3; +} + +.classification-section { + &--ipc .classification-card { + background: #f0f6ff; + border-color: #bfdbfe; + } + + &--ipc .classification-badge--system { + background: #dbeafe; + color: #1d4ed8; + } + + &--cpc .classification-card { + background: #f0fdf4; + border-color: #bbf7d0; + } + + &--cpc .classification-badge--system { + background: #dcfce7; + color: #15803d; + } +} + +.classification-cards { + display: flex; + flex-direction: column; + gap: 10px; +} + +.classification-card { + padding: 12px 14px; + border-radius: 10px; + border: 1px solid #dbeafe; +} + +.classification-card__header { + display: flex; + align-items: flex-start; + justify-content: space-between; + gap: 12px; + flex-wrap: wrap; +} + +.classification-card__codes { + display: flex; + flex-wrap: wrap; + gap: 6px; +} + +.classification-card__badges { + display: flex; + flex-wrap: wrap; + gap: 6px; +} + +.classification-code { + font-size: 0.9rem; + font-weight: 700; + color: #0f172a; +} + +.classification-badge { + display: inline-flex; + align-items: center; + padding: 2px 8px; + border-radius: 999px; + font-size: 0.68rem; + font-weight: 700; + letter-spacing: 0.02em; + text-transform: uppercase; +} + +.classification-badge--level { + background: #e2e8f0; + color: #475569; +} + +.classification-summary { + margin: 10px 0 0; + font-size: 0.84rem; + line-height: 1.5; + color: #334155; +} + +.classification-toggle { + margin-top: 6px; + padding: 0; + border: 0; + background: none; + color: #2563eb; + font-size: 0.78rem; + cursor: pointer; + + &:hover { + text-decoration: underline; + } +} + +.classification-hierarchy { + margin: 10px 0 0; + padding-top: 10px; + border-top: 1px solid rgba(15, 23, 42, 0.08); +} + +.classification-hierarchy__row { + display: grid; + grid-template-columns: 88px 1fr; + gap: 8px; + margin-bottom: 6px; + + dt { + margin: 0; + font-size: 0.72rem; + font-weight: 700; + color: #64748b; + text-transform: uppercase; + letter-spacing: 0.03em; + } + + dd { + margin: 0; + font-size: 0.8rem; + line-height: 1.45; + color: #334155; + } +} + +.pagination { + display: flex; + align-items: center; + justify-content: space-between; + gap: 8px; + margin-top: 12px; + + button { + padding: 4px 10px; + border: 1px solid #d0d0d0; + border-radius: 6px; + background: white; + cursor: pointer; + font-size: 12px; + + &:disabled { + opacity: 0.5; + cursor: default; + } + } + + span { + font-size: 12px; + color: #666; + } +} diff --git a/webapp/src/app/modules/person-patents/person-patents.component.ts b/webapp/src/app/modules/person-patents/person-patents.component.ts index 24d40578..b29d1dda 100644 --- a/webapp/src/app/modules/person-patents/person-patents.component.ts +++ b/webapp/src/app/modules/person-patents/person-patents.component.ts @@ -1,434 +1,434 @@ -import { Component, OnInit, inject } from '@angular/core'; -import { CommonModule } from '@angular/common'; -import { ActivatedRoute, Router } from '@angular/router'; -import { PatentsService } from '../../api/api/patents.service'; -import { PatentEntry } from '../../api/model/patentEntry'; -import { IpcClassification } from '../../api'; - -type SortMode = 'date' | 'title'; -type SourceFilter = 'all' | 'EPO' | 'USPTO'; -type ClassificationSystem = 'IPC' | 'CPC'; - -interface ClassificationCard { - key: string; - symbols: string[]; - system: ClassificationSystem; - levelLabel: string; - primaryDescription: string | null; - hierarchy: { label: string; value: string }[]; -} - -interface PatentMetadataRow { - label: string; - value: string; - variant?: 'source'; -} - -const DESCRIPTION_PREVIEW_LENGTH = 140; - -@Component({ - selector: 'app-person-patents', - imports: [CommonModule], - templateUrl: './person-patents.component.html', - styleUrl: './person-patents.component.scss', -}) -export class PersonPatentsComponent implements OnInit { - private route = inject(ActivatedRoute); - private router = inject(Router); - private patentsApi = inject(PatentsService); - - patents: PatentEntry[] = []; - filteredPatents: PatentEntry[] = []; - authorName: string | null = null; - selectedPatent: PatentEntry | null = null; - showDetail = false; - - loading = true; - error = false; - - activeFilter: SourceFilter = 'all'; - sortMode: SortMode = 'date'; - - selectedPage = 1; - readonly pageSize = 10; - private expandedClassificationKeys = new Set(); - - ngOnInit(): void { - this.route.parent?.paramMap.subscribe((params) => { - const authorId = params.get('id') ?? ''; - - const filterFromUrl = this.route.snapshot.queryParamMap.get('filter'); - const sortFromUrl = this.route.snapshot.queryParamMap.get('sortBy'); - - if (this.isValidFilter(filterFromUrl)) { - this.activeFilter = filterFromUrl; - } - if (this.isValidSortMode(sortFromUrl)) { - this.sortMode = sortFromUrl; - } - - if (authorId) { - this.patentsApi.getPatentsByAuthor(authorId, 'body').subscribe({ - next: (result) => { - this.patents = result.patents ?? []; - this.authorName = result.author_name ?? null; - this.applyFilter(); - this.loading = false; - }, - error: () => { - this.error = true; - this.loading = false; - }, - }); - } - }); - } - - setFilter(filter: SourceFilter): void { - this.activeFilter = filter; - this.selectedPage = 1; - this.selectedPatent = null; - this.showDetail = false; - this.applyFilter(); - this.updateQueryParams(); - } - - setSortMode(sortMode: SortMode): void { - this.sortMode = sortMode; - this.applyFilter(); - this.updateQueryParams(); - } - - selectPatent(patent: PatentEntry): void { - this.selectedPatent = patent; - this.showDetail = false; - this.expandedClassificationKeys.clear(); - this.updateQueryParams(); - } - - openDetail(): void { - this.showDetail = true; - this.expandedClassificationKeys.clear(); - } - - closeDetail(): void { - this.showDetail = false; - this.expandedClassificationKeys.clear(); - } - - private applyFilter(): void { - let patents = this.patents; - - if (this.activeFilter !== 'all') { - patents = patents.filter((p) => p.source === this.activeFilter); - } - - this.filteredPatents = this.sortPatents(patents); - } - - private sortPatents(patents: PatentEntry[]): PatentEntry[] { - return [...patents].sort((a, b) => { - if (this.sortMode === 'date') { - return (b.publication_date ?? '').localeCompare( - a.publication_date ?? '', - ); - } - return (a.title ?? '').localeCompare(b.title ?? '', 'de', { - sensitivity: 'base', - }); - }); - } - - private updateQueryParams(): void { - this.router.navigate([], { - relativeTo: this.route, - queryParams: { - filter: this.activeFilter, - sortBy: this.sortMode, - }, - queryParamsHandling: 'merge', - replaceUrl: true, - }); - } - - private isValidFilter(value: string | null): value is SourceFilter { - return value === 'all' || value === 'EPO' || value === 'USPTO'; - } - - private isValidSortMode(value: string | null): value is SortMode { - return value === 'date' || value === 'title'; - } - - getPagedPatents(): PatentEntry[] { - const start = (this.selectedPage - 1) * this.pageSize; - return this.filteredPatents.slice(start, start + this.pageSize); - } - - getPageCount(): number { - return Math.max(1, Math.ceil(this.filteredPatents.length / this.pageSize)); - } - - hasPagination(): boolean { - return this.getPageCount() > 1; - } - - setPage(page: number): void { - this.selectedPage = Math.min(Math.max(page, 1), this.getPageCount()); - this.updateQueryParams(); - } - - formatDate(date: string | null | undefined): string { - if (!date) return '-'; - const d = date.replace(/(\d{4})(\d{2})(\d{2})/, '$1-$2-$3'); - return new Intl.DateTimeFormat('de-DE').format(new Date(d)); - } - - getEpoCount(): number { - return this.patents.filter((p) => p.source === 'EPO').length; - } - - getUsptoCount(): number { - return this.patents.filter((p) => p.source === 'USPTO').length; - } - - trackPatent(_index: number, patent: PatentEntry): string { - return [ - patent.source, - patent.patent_id, - patent.publication_date ?? '', - patent.kind ?? patent.application_type ?? '', - ].join('|'); - } - - getAbstractPreview(abstract: string | null | undefined): string | null { - if (!abstract?.trim()) { - return null; - } - const text = abstract.trim(); - if (text.length <= 160) { - return text; - } - return `${text.slice(0, 160).trimEnd()}…`; - } - - getPublicationStageLabel(patent: PatentEntry): string | null { - if (patent.kind) { - return patent.kind; - } - if (patent.application_type) { - return patent.application_type; - } - return null; - } - - hasPatentMetadata(_patent: PatentEntry): boolean { - return true; - } - - getPatentMetadataRows(patent: PatentEntry): PatentMetadataRow[] { - const rows: PatentMetadataRow[] = []; - - rows.push({ label: 'Quelle', value: patent.source, variant: 'source' }); - rows.push({ label: 'Patent-Nr.', value: patent.patent_id }); - - if (patent.publication_date) { - rows.push({ - label: 'Veröffentlichungsdatum', - value: this.formatDate(patent.publication_date), - }); - } - if (patent.application_number) { - rows.push({ - label: 'Anmeldungsnummer', - value: patent.application_number, - }); - } - if (patent.application_date) { - rows.push({ - label: 'Anmeldedatum', - value: this.formatDate(patent.application_date), - }); - } - - const stageLabel = this.getPublicationStageLabel(patent); - if (stageLabel) { - rows.push({ - label: patent.kind ? 'Publikationsstufe' : 'Anmeldungstyp', - value: patent.kind ? stageLabel : this.formatMetadataLabel(stageLabel), - }); - } - if (patent.number_of_claims != null) { - rows.push({ label: 'Ansprüche', value: String(patent.number_of_claims) }); - } - if (patent.status) { - rows.push({ - label: 'Status', - value: this.formatMetadataLabel(patent.status), - }); - } - - return rows; - } - - private formatMetadataLabel(value: string): string { - return value - .replace(/_/g, ' ') - .toLowerCase() - .replace(/\b\w/g, (char) => char.toUpperCase()); - } - - getClassificationCards( - entries: IpcClassification[] | undefined, - system: ClassificationSystem, - ): ClassificationCard[] { - if (!entries?.length) { - return []; - } - - const merged = new Map(); - - for (const entry of entries) { - const card = this.buildClassificationCard(entry, system); - const mergeKey = - card.primaryDescription?.toLocaleLowerCase('en') ?? - card.symbols[0] ?? - card.key; - - const existing = merged.get(mergeKey); - if (existing) { - for (const symbol of card.symbols) { - if (!existing.symbols.includes(symbol)) { - existing.symbols.push(symbol); - } - } - continue; - } - - merged.set(mergeKey, card); - } - - return [...merged.values()]; - } - - toggleClassificationExpanded(key: string): void { - if (this.expandedClassificationKeys.has(key)) { - this.expandedClassificationKeys.delete(key); - return; - } - this.expandedClassificationKeys.add(key); - } - - isClassificationExpanded(key: string): boolean { - return this.expandedClassificationKeys.has(key); - } - - isLongDescription(text: string | null): boolean { - return !!text && text.length > DESCRIPTION_PREVIEW_LENGTH; - } - - getDescriptionPreview(text: string | null): string { - if (!text) { - return ''; - } - if (text.length <= DESCRIPTION_PREVIEW_LENGTH) { - return text; - } - return `${text.slice(0, DESCRIPTION_PREVIEW_LENGTH).trimEnd()}…`; - } - - private buildClassificationCard( - entry: IpcClassification, - system: ClassificationSystem, - ): ClassificationCard { - const level = this.getClassificationLevel(entry); - const primaryDescription = this.extractDescriptionText(entry[level.field]); - - return { - key: `${system}-${entry.symbol}`, - symbols: [entry.symbol], - system, - levelLabel: level.label, - primaryDescription, - hierarchy: this.buildHierarchyRows(entry, primaryDescription), - }; - } - - private getClassificationLevel(entry: IpcClassification): { - label: string; - field: keyof IpcClassification; - } { - if (entry.subgroup) { - return { label: 'Untergruppe', field: 'subgroup' }; - } - if (entry.main_group) { - return { label: 'Hauptgruppe', field: 'main_group' }; - } - if (entry.subclass) { - return { label: 'Unterklasse', field: 'subclass' }; - } - if (entry.section) { - return { label: 'Sektion', field: 'section' }; - } - return { label: 'Code', field: 'symbol' }; - } - - private buildHierarchyRows( - entry: IpcClassification, - primaryDescription: string | null, - ): { label: string; value: string }[] { - const rows: { label: string; value: string }[] = []; - const seen = new Set(); - - const addRow = (label: string, raw: string | null) => { - const value = this.extractDescriptionText(raw); - if (!value) { - return; - } - const normalized = value.toLocaleLowerCase('en'); - if ( - seen.has(normalized) || - normalized === primaryDescription?.toLocaleLowerCase('en') - ) { - return; - } - seen.add(normalized); - rows.push({ label, value }); - }; - if (entry.section) { - addRow('Sektion', entry.section); - } - if (entry.class) { - addRow('Klasse', entry.class); - } - if (entry.subclass) { - addRow('Unterklasse', entry.subclass); - } - - return rows; - } - - private extractDescriptionText( - value: string | null | undefined, - ): string | null { - if (!value?.trim()) { - return null; - } - - const text = value.includes(' - ') - ? value.split(' - ').slice(1).join(' - ').trim() - : value.trim(); - if (!text) { - return null; - } - - const firstSentence = text.split(/[;|]/)[0]?.trim() ?? text; - return this.normalizeDescriptionCase(firstSentence); - } - - private normalizeDescriptionCase(text: string): string { - if (text !== text.toUpperCase()) { - return text; - } - return text.charAt(0) + text.slice(1).toLowerCase(); - } -} +import { Component, OnInit, inject } from '@angular/core'; +import { CommonModule } from '@angular/common'; +import { ActivatedRoute, Router } from '@angular/router'; +import { PatentsService } from '../../api/api/patents.service'; +import { PatentEntry } from '../../api/model/patentEntry'; +import { IpcClassification } from '../../api'; + +type SortMode = 'date' | 'title'; +type SourceFilter = 'all' | 'EPO' | 'USPTO'; +type ClassificationSystem = 'IPC' | 'CPC'; + +interface ClassificationCard { + key: string; + symbols: string[]; + system: ClassificationSystem; + levelLabel: string; + primaryDescription: string | null; + hierarchy: { label: string; value: string }[]; +} + +interface PatentMetadataRow { + label: string; + value: string; + variant?: 'source'; +} + +const DESCRIPTION_PREVIEW_LENGTH = 140; + +@Component({ + selector: 'app-person-patents', + imports: [CommonModule], + templateUrl: './person-patents.component.html', + styleUrl: './person-patents.component.scss', +}) +export class PersonPatentsComponent implements OnInit { + private route = inject(ActivatedRoute); + private router = inject(Router); + private patentsApi = inject(PatentsService); + + patents: PatentEntry[] = []; + filteredPatents: PatentEntry[] = []; + authorName: string | null = null; + selectedPatent: PatentEntry | null = null; + showDetail = false; + + loading = true; + error = false; + + activeFilter: SourceFilter = 'all'; + sortMode: SortMode = 'date'; + + selectedPage = 1; + readonly pageSize = 10; + private expandedClassificationKeys = new Set(); + + ngOnInit(): void { + this.route.parent?.paramMap.subscribe((params) => { + const authorId = params.get('id') ?? ''; + + const filterFromUrl = this.route.snapshot.queryParamMap.get('filter'); + const sortFromUrl = this.route.snapshot.queryParamMap.get('sortBy'); + + if (this.isValidFilter(filterFromUrl)) { + this.activeFilter = filterFromUrl; + } + if (this.isValidSortMode(sortFromUrl)) { + this.sortMode = sortFromUrl; + } + + if (authorId) { + this.patentsApi.getPatentsByAuthor(authorId, 'body').subscribe({ + next: (result) => { + this.patents = result.patents ?? []; + this.authorName = result.author_name ?? null; + this.applyFilter(); + this.loading = false; + }, + error: () => { + this.error = true; + this.loading = false; + }, + }); + } + }); + } + + setFilter(filter: SourceFilter): void { + this.activeFilter = filter; + this.selectedPage = 1; + this.selectedPatent = null; + this.showDetail = false; + this.applyFilter(); + this.updateQueryParams(); + } + + setSortMode(sortMode: SortMode): void { + this.sortMode = sortMode; + this.applyFilter(); + this.updateQueryParams(); + } + + selectPatent(patent: PatentEntry): void { + this.selectedPatent = patent; + this.showDetail = false; + this.expandedClassificationKeys.clear(); + this.updateQueryParams(); + } + + openDetail(): void { + this.showDetail = true; + this.expandedClassificationKeys.clear(); + } + + closeDetail(): void { + this.showDetail = false; + this.expandedClassificationKeys.clear(); + } + + private applyFilter(): void { + let patents = this.patents; + + if (this.activeFilter !== 'all') { + patents = patents.filter((p) => p.source === this.activeFilter); + } + + this.filteredPatents = this.sortPatents(patents); + } + + private sortPatents(patents: PatentEntry[]): PatentEntry[] { + return [...patents].sort((a, b) => { + if (this.sortMode === 'date') { + return (b.publication_date ?? '').localeCompare( + a.publication_date ?? '', + ); + } + return (a.title ?? '').localeCompare(b.title ?? '', 'de', { + sensitivity: 'base', + }); + }); + } + + private updateQueryParams(): void { + this.router.navigate([], { + relativeTo: this.route, + queryParams: { + filter: this.activeFilter, + sortBy: this.sortMode, + }, + queryParamsHandling: 'merge', + replaceUrl: true, + }); + } + + private isValidFilter(value: string | null): value is SourceFilter { + return value === 'all' || value === 'EPO' || value === 'USPTO'; + } + + private isValidSortMode(value: string | null): value is SortMode { + return value === 'date' || value === 'title'; + } + + getPagedPatents(): PatentEntry[] { + const start = (this.selectedPage - 1) * this.pageSize; + return this.filteredPatents.slice(start, start + this.pageSize); + } + + getPageCount(): number { + return Math.max(1, Math.ceil(this.filteredPatents.length / this.pageSize)); + } + + hasPagination(): boolean { + return this.getPageCount() > 1; + } + + setPage(page: number): void { + this.selectedPage = Math.min(Math.max(page, 1), this.getPageCount()); + this.updateQueryParams(); + } + + formatDate(date: string | null | undefined): string { + if (!date) return '-'; + const d = date.replace(/(\d{4})(\d{2})(\d{2})/, '$1-$2-$3'); + return new Intl.DateTimeFormat('de-DE').format(new Date(d)); + } + + getEpoCount(): number { + return this.patents.filter((p) => p.source === 'EPO').length; + } + + getUsptoCount(): number { + return this.patents.filter((p) => p.source === 'USPTO').length; + } + + trackPatent(_index: number, patent: PatentEntry): string { + return [ + patent.source, + patent.patent_id, + patent.publication_date ?? '', + patent.kind ?? patent.application_type ?? '', + ].join('|'); + } + + getAbstractPreview(abstract: string | null | undefined): string | null { + if (!abstract?.trim()) { + return null; + } + const text = abstract.trim(); + if (text.length <= 160) { + return text; + } + return `${text.slice(0, 160).trimEnd()}…`; + } + + getPublicationStageLabel(patent: PatentEntry): string | null { + if (patent.kind) { + return patent.kind; + } + if (patent.application_type) { + return patent.application_type; + } + return null; + } + + hasPatentMetadata(_patent: PatentEntry): boolean { + return true; + } + + getPatentMetadataRows(patent: PatentEntry): PatentMetadataRow[] { + const rows: PatentMetadataRow[] = []; + + rows.push({ label: 'Quelle', value: patent.source, variant: 'source' }); + rows.push({ label: 'Patent-Nr.', value: patent.patent_id }); + + if (patent.publication_date) { + rows.push({ + label: 'Veröffentlichungsdatum', + value: this.formatDate(patent.publication_date), + }); + } + if (patent.application_number) { + rows.push({ + label: 'Anmeldungsnummer', + value: patent.application_number, + }); + } + if (patent.application_date) { + rows.push({ + label: 'Anmeldedatum', + value: this.formatDate(patent.application_date), + }); + } + + const stageLabel = this.getPublicationStageLabel(patent); + if (stageLabel) { + rows.push({ + label: patent.kind ? 'Publikationsstufe' : 'Anmeldungstyp', + value: patent.kind ? stageLabel : this.formatMetadataLabel(stageLabel), + }); + } + if (patent.number_of_claims != null) { + rows.push({ label: 'Ansprüche', value: String(patent.number_of_claims) }); + } + if (patent.status) { + rows.push({ + label: 'Status', + value: this.formatMetadataLabel(patent.status), + }); + } + + return rows; + } + + private formatMetadataLabel(value: string): string { + return value + .replace(/_/g, ' ') + .toLowerCase() + .replace(/\b\w/g, (char) => char.toUpperCase()); + } + + getClassificationCards( + entries: IpcClassification[] | undefined, + system: ClassificationSystem, + ): ClassificationCard[] { + if (!entries?.length) { + return []; + } + + const merged = new Map(); + + for (const entry of entries) { + const card = this.buildClassificationCard(entry, system); + const mergeKey = + card.primaryDescription?.toLocaleLowerCase('en') ?? + card.symbols[0] ?? + card.key; + + const existing = merged.get(mergeKey); + if (existing) { + for (const symbol of card.symbols) { + if (!existing.symbols.includes(symbol)) { + existing.symbols.push(symbol); + } + } + continue; + } + + merged.set(mergeKey, card); + } + + return [...merged.values()]; + } + + toggleClassificationExpanded(key: string): void { + if (this.expandedClassificationKeys.has(key)) { + this.expandedClassificationKeys.delete(key); + return; + } + this.expandedClassificationKeys.add(key); + } + + isClassificationExpanded(key: string): boolean { + return this.expandedClassificationKeys.has(key); + } + + isLongDescription(text: string | null): boolean { + return !!text && text.length > DESCRIPTION_PREVIEW_LENGTH; + } + + getDescriptionPreview(text: string | null): string { + if (!text) { + return ''; + } + if (text.length <= DESCRIPTION_PREVIEW_LENGTH) { + return text; + } + return `${text.slice(0, DESCRIPTION_PREVIEW_LENGTH).trimEnd()}…`; + } + + private buildClassificationCard( + entry: IpcClassification, + system: ClassificationSystem, + ): ClassificationCard { + const level = this.getClassificationLevel(entry); + const primaryDescription = this.extractDescriptionText(entry[level.field]); + + return { + key: `${system}-${entry.symbol}`, + symbols: [entry.symbol], + system, + levelLabel: level.label, + primaryDescription, + hierarchy: this.buildHierarchyRows(entry, primaryDescription), + }; + } + + private getClassificationLevel(entry: IpcClassification): { + label: string; + field: keyof IpcClassification; + } { + if (entry.subgroup) { + return { label: 'Untergruppe', field: 'subgroup' }; + } + if (entry.main_group) { + return { label: 'Hauptgruppe', field: 'main_group' }; + } + if (entry.subclass) { + return { label: 'Unterklasse', field: 'subclass' }; + } + if (entry.section) { + return { label: 'Sektion', field: 'section' }; + } + return { label: 'Code', field: 'symbol' }; + } + + private buildHierarchyRows( + entry: IpcClassification, + primaryDescription: string | null, + ): { label: string; value: string }[] { + const rows: { label: string; value: string }[] = []; + const seen = new Set(); + + const addRow = (label: string, raw: string | null) => { + const value = this.extractDescriptionText(raw); + if (!value) { + return; + } + const normalized = value.toLocaleLowerCase('en'); + if ( + seen.has(normalized) || + normalized === primaryDescription?.toLocaleLowerCase('en') + ) { + return; + } + seen.add(normalized); + rows.push({ label, value }); + }; + if (entry.section) { + addRow('Sektion', entry.section); + } + if (entry.class) { + addRow('Klasse', entry.class); + } + if (entry.subclass) { + addRow('Unterklasse', entry.subclass); + } + + return rows; + } + + private extractDescriptionText( + value: string | null | undefined, + ): string | null { + if (!value?.trim()) { + return null; + } + + const text = value.includes(' - ') + ? value.split(' - ').slice(1).join(' - ').trim() + : value.trim(); + if (!text) { + return null; + } + + const firstSentence = text.split(/[;|]/)[0]?.trim() ?? text; + return this.normalizeDescriptionCase(firstSentence); + } + + private normalizeDescriptionCase(text: string): string { + if (text !== text.toUpperCase()) { + return text; + } + return text.charAt(0) + text.slice(1).toLowerCase(); + } +} diff --git a/webapp/src/app/modules/person-publications/person-publications.component.html b/webapp/src/app/modules/person-publications/person-publications.component.html index 6da7971d..f93d0a76 100644 --- a/webapp/src/app/modules/person-publications/person-publications.component.html +++ b/webapp/src/app/modules/person-publications/person-publications.component.html @@ -6,44 +6,98 @@
+ calendar_today - @for (year of publicationYearOptions; track year) { + [panelWidth]="null" + (selectionChange)="applyFilters()" + (opened)="focusSelectSearch(yearSearchInput)" + (closed)="yearSearchControl.setValue('')"> + {{ yearSelectionSummary() }} + + @for (year of filteredYearOptions(); track year) { {{ year }} + } @empty { +
Keine Treffer
}
+ category - @for (type of typeOptions; track type.value) { + [panelWidth]="null" + (selectionChange)="applyFilters()" + (opened)="focusSelectSearch(typeSearchInput)" + (closed)="typeSearchControl.setValue('')"> + {{ typeSelectionSummary() }} + + @for (type of filteredTypeOptions(); track type.value) { {{ type.label }} + } @empty { +
Keine Treffer
}
+ translate - @for (language of languageOptions; track language.value) { + [panelWidth]="null" + (selectionChange)="applyFilters()" + (opened)="focusSelectSearch(languageSearchInput)" + (closed)="languageSearchControl.setValue('')"> + {{ + languageSelectionSummary() + }} + + @for (language of filteredLanguageOptions(); track language.value) { {{ language.label }} + } @empty { +
Keine Treffer
}
+ apartment + label + placeholder="Thema suchen" /> Kein Topic gefunden + Kein Thema gefunden } @@ -112,42 +167,141 @@ - @if (selectedInstitutions.length || selectedTopics.length) { -
- @for (institution of selectedInstitutions; track institution.id) { - - {{ institution.display_name }} - - - } - @for (topic of selectedTopics; track topic.id) { - - {{ topic.display_name }} - - - } + @let selectedYears = filterForm.controls.publicationYears.value; + @let selectedTypes = filterForm.controls.types.value; + @let selectedLanguages = filterForm.controls.languages.value; + @if ( + selectedInstitutions.length || + selectedTopics.length || + selectedYears.length || + selectedTypes.length || + selectedLanguages.length + ) { +
+ Aktive Filter: +
+ @for (year of selectedYears; track year) { + + + calendar_today + {{ year }} + + + + } + @for (type of selectedTypes; track type) { + + + category + {{ type }} + + + + } + @for (language of selectedLanguages; track language) { + + + translate + {{ + languageLabel(language) + }} + + + + } + @for (topic of selectedTopics; track topic.id) { + + + label + {{ + topic.display_name + }} + + + + } + @for (institution of selectedInstitutions; track institution.id) { + @let instCountry = selectedInstitutionCountry(institution); + + + apartment + {{ + institution.display_name + }} + @if (instCountry) { + + {{ + instCountry.toUpperCase() + }} + } + + + + } +
}
@if (loading) { -
+
+ Publikationen werden geladen …
+ } @else if (publications.length === 0) { +
Keine Publikationen gefunden.
} - +
@@ -170,9 +336,17 @@ @@ -190,23 +376,55 @@ @@ -223,18 +441,38 @@ @@ -243,10 +481,6 @@
Titel @@ -162,7 +316,19 @@ Jahr - {{ publication.publication_year || '-' }} + @if (publication.publication_year) { + + } @else { + - + } Typ @if (publication.type) { - - {{ publication.type }} - + } @else { - } @@ -182,7 +356,19 @@ Sprache / Quelle - {{ publication.language || '-' }} + @if (publication.language) { + + } @else { + - + } Institutionen @let publicationInstitutions = institutions(publication); + @let institutionsExpanded = isInstitutionsExpanded(publication); + @let visibleInstitutions = + institutionsExpanded + ? publicationInstitutions + : publicationInstitutions.slice(0, 3);
- @for ( - institution of publicationInstitutions.slice(0, 3); - track institution.id - ) { - - {{ institution.name }} - + [class.active]="isInstitutionActive(institution.id)" + [matTooltip]="institution.name" + matTooltipPosition="above" + [attr.aria-label]=" + 'Nach Institution ' + institution.name + ' filtern' + " + (click)="filterByInstitution(institution)"> + apartment + {{ institution.name }} + @if (institution.country) { + + {{ + institution.country.toUpperCase() + }} + } + } @empty { - } @if (publicationInstitutions.length > 3) { - - +{{ publicationInstitutions.length - 3 }} - + }
Themen @let publicationTopics = publication.topics ?? []; + @let topicsExpanded = isTopicsExpanded(publication); + @let visibleTopics = + topicsExpanded ? publicationTopics : publicationTopics.slice(0, 3);
- @for (topic of publicationTopics.slice(0, 3); track topic.id) { - - {{ topic.display_name }} - + @for (topic of visibleTopics; track topic.id) { + + } @empty { - } @if (publicationTopics.length > 3) { - - +{{ publicationTopics.length - 3 }} - + }
- - @if (!loading && publications.length === 0) { -
Keine Publikationen gefunden.
- }
+ + + + + {{ element.title }} + {{ element.type | uppercase }} + + + + + + + + + + + + info + Übersicht + + + + + + + + + EU + BUND + DFG + + diff --git a/webapp/src/app/modules/projects/projects.component.scss b/webapp/src/app/modules/projects/projects.component.scss index 32a0f31e..55063bd0 100644 --- a/webapp/src/app/modules/projects/projects.component.scss +++ b/webapp/src/app/modules/projects/projects.component.scss @@ -5,23 +5,6 @@ padding: 1rem; } -.sorting { - display: flex; - justify-content: flex-end; - gap: 0.5rem; -} - -.sorting select { - padding: 0.75rem; - border: 1px solid var(--sg-border); - border-radius: var(--sg-radius-sm); - font-size: 1rem; -} - -.sorting select:hover { - cursor: pointer; -} - .cards { display: grid; gap: 1.5rem; @@ -29,10 +12,6 @@ padding: 0 1rem; } -mat-paginator { - background-color: var(--sg-background); -} - .card { padding: 0.5rem; background-color: var(--sg-background); @@ -76,12 +55,6 @@ mat-card-actions a { border-radius: var(--sg-radius-sm); } -.no-results { - text-align: center; - padding: 2rem; - color: var(--sg-text-secondary); -} - .mat-mdc-standard-chip { border-radius: var(--sg-radius-sm); } diff --git a/webapp/src/app/modules/projects/projects.component.ts b/webapp/src/app/modules/projects/projects.component.ts index 4361c9bb..984ee116 100644 --- a/webapp/src/app/modules/projects/projects.component.ts +++ b/webapp/src/app/modules/projects/projects.component.ts @@ -1,4 +1,4 @@ -import { Component, input, signal } from '@angular/core'; +import { Component, computed, input, signal } from '@angular/core'; import { FundingProject, FundingProjectPage, ProjectType } from '../../api'; import { MatDividerModule } from '@angular/material/divider'; import { MatIconModule } from '@angular/material/icon'; @@ -8,12 +8,12 @@ import { takeUntilDestroyed } from '@angular/core/rxjs-interop'; import { MatButtonModule } from '@angular/material/button'; import { DatePipe, UpperCasePipe } from '@angular/common'; import { MatChipListboxChange, MatChipsModule } from '@angular/material/chips'; -import { QueryParamInputComponent } from '../../shared/ui/query-param-input/query-param-input.component'; -import { QueryParamPaginatorComponent } from '../../shared/ui/query-param-paginator/query-param-paginator.component'; + +import { SelectorOption } from '../../shared/ui/query-param-selector/query-param-selector.component'; import { - QueryParamSelectorComponent, - SelectorOption, -} from '../../shared/ui/query-param-selector/query-param-selector.component'; + CardSearchComponent, + Page, +} from '../../shared/ui/card-search/card-search.component'; @Component({ selector: 'app-projects', @@ -26,9 +26,7 @@ import { UpperCasePipe, DatePipe, MatChipsModule, - QueryParamInputComponent, - QueryParamPaginatorComponent, - QueryParamSelectorComponent, + CardSearchComponent, ], templateUrl: './projects.component.html', styleUrl: './projects.component.scss', @@ -36,6 +34,13 @@ import { export class ProjectsComponent { fundingProjectPage = input.required(); + page = computed(() => ({ + page: this.fundingProjectPage().page || 0, + size: this.fundingProjectPage().size || 10, + total: this.fundingProjectPage().total || 0, + elements: this.fundingProjectPage().elements || [], + })); + urlChips = signal(['eu', 'bund', 'dfg']); sortingOptions: SelectorOption[] = [{ value: 'title', display_name: 'Name' }]; @@ -72,13 +77,14 @@ export class ProjectsComponent { getDetaiLink(fundingProject: FundingProject): string | null { if (fundingProject.type === 'bund') { - const encodedId = encodeURIComponent(fundingProject.id) + const encodedId = encodeURIComponent(fundingProject.id); return '/projects/bund/' + encodedId; } else if (fundingProject.type === 'dfg') { return '/projects/dfg/' + fundingProject.id; } else if (fundingProject.type === 'eu') { return '/projects/eu/' + fundingProject.id; - } else + } else { return null; } + } } diff --git a/webapp/src/app/modules/publication-detail/publication-detail.component.html b/webapp/src/app/modules/publication-detail/publication-detail.component.html index 7e9001cb..84b11692 100644 --- a/webapp/src/app/modules/publication-detail/publication-detail.component.html +++ b/webapp/src/app/modules/publication-detail/publication-detail.component.html @@ -176,11 +176,14 @@
@for (topic of publication.topics ?? []; track topic.id) { - - {{ topic.display_name }} - + + } @for (keyword of publication.keywords ?? []; track keyword.id) { {{ keyword.display_name }} diff --git a/webapp/src/app/modules/publication-detail/publication-detail.component.scss b/webapp/src/app/modules/publication-detail/publication-detail.component.scss index ae20315b..a5238714 100644 --- a/webapp/src/app/modules/publication-detail/publication-detail.component.scss +++ b/webapp/src/app/modules/publication-detail/publication-detail.component.scss @@ -268,12 +268,6 @@ aside { font-size: 11px; } -.tags .topic-tag { - border-color: #cbd8f1; - background: #f5f8ff; - color: var(--sg-text); -} - .source-list, .compact-list, .link-list { diff --git a/webapp/src/app/modules/publication-detail/publication-detail.component.ts b/webapp/src/app/modules/publication-detail/publication-detail.component.ts index c2850656..b377543b 100644 --- a/webapp/src/app/modules/publication-detail/publication-detail.component.ts +++ b/webapp/src/app/modules/publication-detail/publication-detail.component.ts @@ -13,7 +13,10 @@ import { Location as ApiLocation, Work, WorksService, + WorkTopic, } from '../../api'; +import { TopicChipComponent } from '../../shared/ui/topic-chip/topic-chip.component'; +import { topicHierarchyColor } from '../../resolvers/utils/topic-colors'; interface DetailLink { label: string; @@ -36,6 +39,7 @@ interface InstitutionDetail { MatIconModule, MatProgressSpinnerModule, RouterLink, + TopicChipComponent, UpperCasePipe, ], templateUrl: './publication-detail.component.html', @@ -71,6 +75,17 @@ export class PublicationDetailComponent implements OnInit { this.location.back(); } + getTopicColor(topic: WorkTopic): string { + return topicHierarchyColor({ + id: topic.id, + name: topic.display_name, + field_id: topic.field?.id, + field_name: topic.field?.display_name, + domain_id: topic.domain?.id, + domain_name: topic.domain?.display_name, + }); + } + abstractText(): string | null { const index = this.publication?.abstract_inverted_index; if (!index || typeof index !== 'object') return null; diff --git a/webapp/src/app/modules/topic-hierarchy/topic-hierarchy.component.html b/webapp/src/app/modules/topic-hierarchy/topic-hierarchy.component.html index 330b076f..3df414de 100644 --- a/webapp/src/app/modules/topic-hierarchy/topic-hierarchy.component.html +++ b/webapp/src/app/modules/topic-hierarchy/topic-hierarchy.component.html @@ -67,6 +67,10 @@ matTooltipPosition="above" (focusin)="tooltip.show()" (focusout)="tooltip.hide()"> + {{ topic.name }} {{ @@ -112,7 +116,10 @@ : 'chevron_right' }} - folder + {{ field.name }} diff --git a/webapp/src/app/modules/topic-hierarchy/topic-hierarchy.component.scss b/webapp/src/app/modules/topic-hierarchy/topic-hierarchy.component.scss index abfa99bc..c42fbac7 100644 --- a/webapp/src/app/modules/topic-hierarchy/topic-hierarchy.component.scss +++ b/webapp/src/app/modules/topic-hierarchy/topic-hierarchy.component.scss @@ -93,6 +93,18 @@ flex-direction: column; } +.field-dot { + flex: 0 0 auto; + display: inline-block; + vertical-align: middle; + width: 9px; + height: 9px; + margin-right: 7px; + border-radius: 50%; + border: 1px solid rgba(255, 255, 255, 0.85); + box-shadow: 0 0 0 1px rgba(15, 23, 42, 0.2); +} + .node-header { display: flex; align-items: center; diff --git a/webapp/src/app/modules/topic-hierarchy/topic-hierarchy.component.ts b/webapp/src/app/modules/topic-hierarchy/topic-hierarchy.component.ts index eb7af86a..f7bfc203 100644 --- a/webapp/src/app/modules/topic-hierarchy/topic-hierarchy.component.ts +++ b/webapp/src/app/modules/topic-hierarchy/topic-hierarchy.component.ts @@ -6,6 +6,7 @@ import { MatProgressSpinnerModule } from '@angular/material/progress-spinner'; import { MatRadioModule } from '@angular/material/radio'; import { MatTooltipModule } from '@angular/material/tooltip'; import { TopicsService } from '../../api/api/topics.service'; +import { topicHierarchyColor } from '../../resolvers/utils/topic-colors'; import { combineLatest, of } from 'rxjs'; import { toObservable } from '@angular/core/rxjs-interop'; import { @@ -39,6 +40,7 @@ interface FlatTopic { id: string; name: string; path: string; + fieldName: string; } @Component({ @@ -120,6 +122,7 @@ export class TopicHierarchyComponent implements OnInit { name: topic.display_name || '', path: parts.length > 0 ? parts.join(' > ') : topic.description || '', + fieldName: topic.field?.display_name || '', }; }); } @@ -151,6 +154,7 @@ export class TopicHierarchyComponent implements OnInit { id: topic.id, name: topic.name, path: `${domain.name} > ${field.name} > ${subfield.name}`, + fieldName: field.name, }); } }); @@ -164,6 +168,10 @@ export class TopicHierarchyComponent implements OnInit { this.searchType.set(type); } + getFieldColor(fieldName: string | null | undefined): string { + return topicHierarchyColor({ field_name: fieldName }); + } + toggleTopic(name: string): void { const nextSelection = new Set(this.selectedTopics()); if (nextSelection.has(name)) { diff --git a/webapp/src/app/resolvers/account.resolver.ts b/webapp/src/app/resolvers/account.resolver.ts index 9a2b7936..13b005b4 100644 --- a/webapp/src/app/resolvers/account.resolver.ts +++ b/webapp/src/app/resolvers/account.resolver.ts @@ -1,8 +1,7 @@ import { ResolveFn } from '@angular/router'; -import { AccountProfile } from '../api'; +import { AccountProfile, AuthService } from '../api'; import { inject } from '@angular/core'; -import { AccountManagementService } from '../shared/services/account-management.service'; export const accountResolver: ResolveFn = (route, state) => { - return inject(AccountManagementService).getCurrentAccount(); + return inject(AuthService).getCurrentAccount(); }; diff --git a/webapp/src/app/resolvers/accounts-organizations.resolver.ts b/webapp/src/app/resolvers/accounts-organizations.resolver.ts new file mode 100644 index 00000000..8fb026c9 --- /dev/null +++ b/webapp/src/app/resolvers/accounts-organizations.resolver.ts @@ -0,0 +1,12 @@ +import { inject } from '@angular/core'; +import { ResolveFn } from '@angular/router'; +import { + AuthService, + InseAccountManagementModelOrganizationProfile, +} from '../api'; + +export const accountsOrganizationResolver: ResolveFn< + InseAccountManagementModelOrganizationProfile[] +> = (route, state) => { + return inject(AuthService).listAccountOrganizations(); +}; diff --git a/webapp/src/app/resolvers/accounts-page.resolver.ts b/webapp/src/app/resolvers/accounts-page.resolver.ts new file mode 100644 index 00000000..1d4be85d --- /dev/null +++ b/webapp/src/app/resolvers/accounts-page.resolver.ts @@ -0,0 +1,19 @@ +import { ResolveFn } from '@angular/router'; +import { inject } from '@angular/core'; +import { AccountPage, AuthService } from '../api'; + +export const accountsPageResolver: ResolveFn = (route, state) => { + const page = Number(route.queryParamMap.get('page') ?? '0'); + const size = Number(route.queryParamMap.get('size') ?? '10'); + const search = route.queryParamMap.get('search') || undefined; + const organizationId = + route.queryParamMap.get('organization_id') || undefined; + + return inject(AuthService).listAccounts( + page, + size, + undefined, + search, + organizationId, + ); +}; diff --git a/webapp/src/app/resolvers/organizations-organizations.resolver.ts b/webapp/src/app/resolvers/organizations-organizations.resolver.ts new file mode 100644 index 00000000..c1db1abd --- /dev/null +++ b/webapp/src/app/resolvers/organizations-organizations.resolver.ts @@ -0,0 +1,13 @@ +import { inject } from '@angular/core'; +import { ResolveFn } from '@angular/router'; +import { OrganizationPage, OrganizationService } from '../api'; + +export const organizationsOrganizationsResolver: ResolveFn = ( + route, + state, +) => { + const page = Number(route.queryParamMap.get('page') ?? '0'); + const size = Number(route.queryParamMap.get('size') ?? '10'); + + return inject(OrganizationService).getOrganisations(page, size); +}; diff --git a/webapp/src/app/resolvers/publication-resolver.ts b/webapp/src/app/resolvers/publication-resolver.ts index d0e1111e..e42a602c 100644 --- a/webapp/src/app/resolvers/publication-resolver.ts +++ b/webapp/src/app/resolvers/publication-resolver.ts @@ -1,9 +1,8 @@ import { ResolveFn } from '@angular/router'; import { inject } from '@angular/core'; -import { WorksService,Work } from '../api'; +import { WorksService, Work } from '../api'; export const publicationResolver: ResolveFn = (route) => { - const id = route.paramMap.get('publicationId'); const title = route.queryParamMap.get('title') ?? ''; const worksService = inject(WorksService); diff --git a/webapp/src/app/resolvers/utils/topic-legend.ts b/webapp/src/app/resolvers/utils/topic-legend.ts index a54779c3..ba0f7c43 100644 --- a/webapp/src/app/resolvers/utils/topic-legend.ts +++ b/webapp/src/app/resolvers/utils/topic-legend.ts @@ -26,6 +26,80 @@ export interface TopicLegendGroup { items: TopicLegendItem[]; } +export interface TopicLegendSubfieldSelection { + group: TopicLegendGroup; + item: TopicLegendItem; +} + +export interface TopicLegendSelectionState { + fieldIds: Set; + subfieldIds: Set; +} + +export function getTopicLegendFieldId(topic: TopicLegendTopic): string { + const fieldName = normalizeLegendValue(topic.field_name) ?? 'Ohne Fachgebiet'; + + return topic.field_id ?? normalizeLegendKey(fieldName); +} + +export function getTopicLegendSubfieldId(topic: TopicLegendTopic): string { + const subfieldName = normalizeLegendValue(topic.subfield_name); + + return ( + topic.subfield_id ?? (subfieldName ? normalizeLegendKey(subfieldName) : '') + ); +} + +export function toggleTopicLegendSelection( + currentSelection: ReadonlySet, + id: string, +): Set { + const nextSelection = new Set(currentSelection); + + if (nextSelection.has(id)) { + nextSelection.delete(id); + return nextSelection; + } + + nextSelection.add(id); + return nextSelection; +} + +export function toggleTopicLegendFieldSelection( + currentFieldIds: ReadonlySet, + currentSubfieldIds: ReadonlySet, + group: TopicLegendGroup, +): TopicLegendSelectionState { + const fieldIds = toggleTopicLegendSelection(currentFieldIds, group.id); + const subfieldIds = new Set(currentSubfieldIds); + + if (fieldIds.has(group.id)) { + for (const item of group.items) { + subfieldIds.delete(item.id); + } + } + + return { fieldIds, subfieldIds }; +} + +export function toggleTopicLegendSubfieldSelection( + currentFieldIds: ReadonlySet, + currentSubfieldIds: ReadonlySet, + selection: TopicLegendSubfieldSelection, +): TopicLegendSelectionState { + const fieldIds = new Set(currentFieldIds); + const subfieldIds = toggleTopicLegendSelection( + currentSubfieldIds, + selection.item.id, + ); + + if (subfieldIds.has(selection.item.id)) { + fieldIds.delete(selection.group.id); + } + + return { fieldIds, subfieldIds }; +} + export function buildTopicLegendGroups( topics: readonly TopicLegendTopic[], ): TopicLegendGroup[] { @@ -47,8 +121,8 @@ export function buildTopicLegendGroups( normalizeLegendValue(topic.domain_description) ?? ''; const subfieldDescription = normalizeLegendValue(topic.subfield_description) ?? ''; - const fieldKey = topic.field_id ?? normalizeLegendKey(fieldName); - const subfieldKey = topic.subfield_id ?? normalizeLegendKey(subfieldName); + const fieldKey = getTopicLegendFieldId(topic); + const subfieldKey = getTopicLegendSubfieldId(topic); if (!groups.has(fieldKey)) { groups.set(fieldKey, { diff --git a/webapp/src/app/shared/guards/account-viewer.guard.ts b/webapp/src/app/shared/guards/account-viewer.guard.ts index 1cc8e9ee..9eeac48d 100644 --- a/webapp/src/app/shared/guards/account-viewer.guard.ts +++ b/webapp/src/app/shared/guards/account-viewer.guard.ts @@ -1,36 +1,41 @@ -import { inject } from '@angular/core'; +import { effect, inject, Injector } from '@angular/core'; import { CanActivateFn, Router } from '@angular/router'; -import { catchError, filter, of, switchMap, take } from 'rxjs'; import { CredentialService } from '../services/credential.service'; export const accountViewerGuard: CanActivateFn = () => { const credentialService = inject(CredentialService); const router = inject(Router); + const injector = inject(Injector); - return credentialService.validating.pipe( - filter((validating) => !validating), - take(1), - switchMap(() => { - if (!credentialService.isAuthenticated.value) { - void router.navigate(['/login']); - return of(false); - } + return new Promise((resolve) => { + const ref = effect( + () => { + if (credentialService.isValidating()) { + return; + } - return credentialService.validateCurrentSession().pipe( - switchMap(() => { - const mayViewAccounts = - credentialService.isEffectiveSuperAdmin() || - credentialService.isEffectiveAdmin() || - credentialService.isEffectiveManager(); + ref.destroy(); - if (!mayViewAccounts) { - void router.navigate(['/dashboard']); - } + if (!credentialService.isAuthenticated()) { + void router.navigate(['/login']); + resolve(false); + return; + } - return of(mayViewAccounts); - }), - catchError(() => of(false)), - ); - }), - ); + const mayViewAccounts = + credentialService.isEffectiveSuperAdmin() || + credentialService.isEffectiveAdmin() || + credentialService.isEffectiveManager(); + + if (!mayViewAccounts) { + void router.navigate(['/dashboard']); + resolve(false); + return; + } + + resolve(true); + }, + { injector }, + ); + }); }; diff --git a/webapp/src/app/shared/guards/admin.guard.ts b/webapp/src/app/shared/guards/admin.guard.ts index 55e18ca8..a8876ced 100644 --- a/webapp/src/app/shared/guards/admin.guard.ts +++ b/webapp/src/app/shared/guards/admin.guard.ts @@ -1,35 +1,36 @@ -import { inject } from '@angular/core'; +import { effect, inject, Injector } from '@angular/core'; import { CanActivateFn, Router } from '@angular/router'; -import { catchError, filter, of, switchMap, take } from 'rxjs'; import { CredentialService } from '../services/credential.service'; export const adminGuard: CanActivateFn = () => { const credentialService = inject(CredentialService); const router = inject(Router); + const injector = inject(Injector); - return credentialService.validating.pipe( - filter((validating) => !validating), - take(1), - switchMap(() => { - if (!credentialService.isAuthenticated.value) { - void router.navigate(['/login']); - return of(false); - } + return new Promise((resolve) => { + const ref = effect( + () => { + if (credentialService.isValidating()) { + return; + } - return credentialService.validateCurrentSession().pipe( - switchMap(() => { - if ( - !credentialService.isEffectiveSuperAdmin() && - !credentialService.isEffectiveAdmin() - ) { - void router.navigate(['/dashboard']); - return of(false); - } + ref.destroy(); - return of(true); - }), - catchError(() => of(false)), - ); - }), - ); + if (!credentialService.isAuthenticated()) { + void router.navigate(['/login']); + resolve(false); + return; + } + + if (!credentialService.isEffectiveAdmin()) { + void router.navigate(['/dashboard']); + resolve(false); + return; + } + + resolve(true); + }, + { injector }, + ); + }); }; diff --git a/webapp/src/app/shared/guards/super-admin.guard.ts b/webapp/src/app/shared/guards/super-admin.guard.ts index b1936483..993f00a5 100644 --- a/webapp/src/app/shared/guards/super-admin.guard.ts +++ b/webapp/src/app/shared/guards/super-admin.guard.ts @@ -1,31 +1,36 @@ -import { inject } from '@angular/core'; +import { effect, inject, Injector } from '@angular/core'; import { CanActivateFn, Router } from '@angular/router'; -import { catchError, filter, of, switchMap, take } from 'rxjs'; import { CredentialService } from '../services/credential.service'; export const superAdminGuard: CanActivateFn = () => { const credentialService = inject(CredentialService); const router = inject(Router); + const injector = inject(Injector); - return credentialService.validating.pipe( - filter((validating) => !validating), - take(1), - switchMap(() => { - if (!credentialService.isAuthenticated.value) { - void router.navigate(['/login']); - return of(false); - } + return new Promise((resolve) => { + const ref = effect( + () => { + if (credentialService.isValidating()) { + return; + } - return credentialService.validateCurrentSession().pipe( - switchMap(() => { - if (!credentialService.isEffectiveSuperAdmin()) { - void router.navigate(['/dashboard']); - return of(false); - } - return of(true); - }), - catchError(() => of(false)), - ); - }), - ); + ref.destroy(); + + if (!credentialService.isAuthenticated()) { + void router.navigate(['/login']); + resolve(false); + return; + } + + if (!credentialService.isEffectiveSuperAdmin()) { + void router.navigate(['/dashboard']); + resolve(false); + return; + } + + resolve(true); + }, + { injector }, + ); + }); }; diff --git a/webapp/src/app/shared/guards/user.guard.ts b/webapp/src/app/shared/guards/user.guard.ts index 190780ae..7145e5ea 100644 --- a/webapp/src/app/shared/guards/user.guard.ts +++ b/webapp/src/app/shared/guards/user.guard.ts @@ -1,25 +1,30 @@ -import { inject } from '@angular/core'; +import { effect, inject, Injector } from '@angular/core'; import { CanActivateFn, Router } from '@angular/router'; -import { catchError, filter, map, of, switchMap, take } from 'rxjs'; import { CredentialService } from '../services/credential.service'; export const userGuard: CanActivateFn = () => { const credentialService = inject(CredentialService); const router = inject(Router); + const injector = inject(Injector); - return credentialService.validating.pipe( - filter((validating) => !validating), - take(1), - switchMap(() => { - if (!credentialService.isAuthenticated.value) { - void router.navigate(['/login']); - return of(false); - } + return new Promise((resolve) => { + const ref = effect( + () => { + if (credentialService.isValidating()) { + return; + } - return credentialService.validateCurrentSession().pipe( - map(() => true), - catchError(() => of(false)), - ); - }), - ); + ref.destroy(); + + if (!credentialService.isAuthenticated()) { + void router.navigate(['/login']); + resolve(false); + return; + } + + resolve(true); + }, + { injector }, + ); + }); }; diff --git a/webapp/src/app/shared/interceptors/authentication.interceptor.ts b/webapp/src/app/shared/interceptors/authentication.interceptor.ts index 130e6c94..08113260 100644 --- a/webapp/src/app/shared/interceptors/authentication.interceptor.ts +++ b/webapp/src/app/shared/interceptors/authentication.interceptor.ts @@ -1,86 +1,104 @@ -import { HttpErrorResponse, HttpInterceptorFn } from '@angular/common/http'; +import { + HttpErrorResponse, + HttpInterceptorFn, + HttpRequest, +} from '@angular/common/http'; import { inject } from '@angular/core'; import { Router } from '@angular/router'; -import { MatSnackBar } from '@angular/material/snack-bar'; -import { catchError, switchMap, tap, throwError } from 'rxjs'; -import { CredentialService } from '../services/credential.service'; -import { UiFocusService } from '../services/ui-focus.service'; +import { catchError, switchMap, throwError } from 'rxjs'; +import { + CredentialService, + clearStoredAuthState, + REQUIRED_TOKEN_TYPE, + TOKEN_TYPE, +} from '../services/credential.service'; -export const authenticationInterceptor: HttpInterceptorFn = (req, next) => { - const url = req.url.split('?')[0]; - const uiFocusService = inject(UiFocusService); +const attachBearer = ( + req: HttpRequest, + token: string, +): HttpRequest => { + if (!token) { + return req; + } + return req.clone({ + headers: req.headers.set('Authorization', 'Bearer ' + token), + }); +}; - const isPublicAuthRequest = - req.method === 'POST' && - (url.endsWith('/api/auth/v2/request-otk') || - url.endsWith('/api/auth/v2/login') || - url.endsWith('/api/auth/v2/access') || - url.endsWith('/api/auth/v2/refresh')); - - if (isPublicAuthRequest || url.endsWith('/institutions/autocomplete')) { - return next(req); +const handleAccessTokenError = ( + error: unknown, + req: HttpRequest, + next: Parameters[1], + credentialService: CredentialService, + router: Router, +) => { + if (!(error instanceof HttpErrorResponse) || error.status !== 401) { + return throwError(() => error); } - const credentialService = inject(CredentialService); - const router = inject(Router); - const snackBar = inject(MatSnackBar); - const tokenProvider = credentialService.getBearerToken(); - const isLogoutRequest = url.endsWith('/api/auth/v2/logout'); + if (!credentialService.getRawAccessToken()) { + credentialService.logout(); + router.navigate(['/login'], { replaceUrl: true }); + return throwError(() => error); + } - return tokenProvider.pipe( - switchMap((response) => { - if (response == undefined) { - credentialService.clearLocalAuthState(); - - snackBar.open( - 'Ihre Sitzung ist abgelaufen oder wurde beendet. Bitte melden Sie sich erneut an.', - 'OK', - { duration: 7000 }, - ); - - void router.navigate(['/login']); - - return throwError( - () => new HttpErrorResponse({ status: 403, statusText: 'Forbidden' }), - ); - } - - const authorizedRequest = req.clone({ - headers: req.headers.set('Authorization', 'Bearer ' + response), - }); - - return next(authorizedRequest).pipe( - catchError((error: HttpErrorResponse) => { - if (error.status === 401 && !isLogoutRequest) { - return credentialService.handleUnauthorized().pipe( - tap((result) => { - uiFocusService.blurActiveElement(); - - if (result === 'stopped-impersonating') { - snackBar.open( - 'Die Impersonation wurde beendet, weil die Sitzung nicht mehr gültig ist.', - 'OK', - { duration: 7000 }, - ); - - void router.navigate(['/accounts']); - } else if (result === 'logged-out') { - snackBar.open( - 'Ihre Sitzung ist abgelaufen oder wurde beendet. Bitte melden Sie sich erneut an.', - 'OK', - { duration: 7000 }, - ); - - void router.navigate(['/login']); - } - }), - switchMap(() => throwError(() => error)), - ); - } - - return throwError(() => error); - }), - ); + return credentialService.refreshAccessToken().pipe( + switchMap((accessToken) => next(attachBearer(req, accessToken.raw_token))), + catchError((refreshError) => { + credentialService.logout(); + router.navigate(['/login'], { replaceUrl: true }); + return throwError(() => refreshError); }), ); }; + +export const authenticationInterceptor: HttpInterceptorFn = (req, next) => { + const router = inject(Router); + + const requiredType = req.context.get(REQUIRED_TOKEN_TYPE); + + if (requiredType === TOKEN_TYPE.NONE) { + return next(req); + } + + if (requiredType === TOKEN_TYPE.ID_TOKEN_COOKIE) { + return next(req.clone({ withCredentials: true })).pipe( + catchError((err) => { + if (err instanceof HttpErrorResponse && err.status === 401) { + clearStoredAuthState(); + router.navigate(['/login'], { replaceUrl: true }); + } + return throwError(() => err); + }), + ); + } + + if (requiredType === TOKEN_TYPE.REFRESH_TOKEN_COOKIE) { + return next(req.clone({ withCredentials: true })); + } + + const credentialService = inject(CredentialService); + + const rawAccessToken = credentialService.getRawAccessToken(); + + if (rawAccessToken && credentialService.accessTokenIsExpired()) { + return credentialService.refreshAccessToken().pipe( + switchMap((accessToken) => + next(attachBearer(req, accessToken.raw_token)), + ), + catchError(() => { + credentialService.logout(); + router.navigate(['/login'], { replaceUrl: true }); + return throwError( + () => new Error('Sitzung abgelaufen. Bitte erneut anmelden.'), + ); + }), + ); + } + + return next(rawAccessToken ? attachBearer(req, rawAccessToken) : req).pipe( + catchError((err) => + handleAccessTokenError(err, req, next, credentialService, router), + ), + ); +}; diff --git a/webapp/src/app/shared/pipes/status.pipe.ts b/webapp/src/app/shared/pipes/status.pipe.ts new file mode 100644 index 00000000..5ba35960 --- /dev/null +++ b/webapp/src/app/shared/pipes/status.pipe.ts @@ -0,0 +1,18 @@ +import { Pipe, PipeTransform } from '@angular/core'; + +@Pipe({ + name: 'status', +}) +export class StatusPipe implements PipeTransform { + transform(value: string, ...args: unknown[]): string { + value = value?.toUpperCase() ?? ''; + switch (value) { + case 'ACTIVE': + return 'Aktiv'; + case 'INACTIVE': + return 'Inaktiv'; + default: + return value; + } + } +} diff --git a/webapp/src/app/shared/services/account-management.service.ts b/webapp/src/app/shared/services/account-management.service.ts deleted file mode 100644 index e86179ef..00000000 --- a/webapp/src/app/shared/services/account-management.service.ts +++ /dev/null @@ -1,124 +0,0 @@ -import { HttpClient, HttpParams } from '@angular/common/http'; -import { Injectable, inject } from '@angular/core'; -import { Observable } from 'rxjs'; -import { Configuration } from '../../api'; - -export type AccountRole = 'SUPER_ADMIN' | 'ADMIN' | 'MANAGER' | 'USER'; - -export interface AccountProfile { - id: string; - email: string; - name: string; - role: AccountRole; - organization_id: string; - organization_name: string; - deleted: boolean; - activated: boolean; - is_current: boolean; - is_real_account: boolean; - is_impersonating: boolean; -} - -export interface AccountPage { - items: AccountProfile[]; - total: number; - page: number; - page_size: number; -} - -export interface OrganizationProfile { - id: string; - name: string; - openalex_institution_id?: string | null; -} - -export interface AccountPayload { - email?: string; - name?: string; - role?: AccountRole; - organization_id?: string; - password?: string; - deleted?: boolean; - activated?: boolean; -} - -export interface CreateAccountPayload { - email: string; - name: string; - role: AccountRole; - organization_id: string; - password: string; -} - -@Injectable({ - providedIn: 'root', -}) -export class AccountManagementService { - private readonly httpClient = inject(HttpClient); - private readonly apiConfiguration = inject(Configuration, { optional: true }); - - getCurrentAccount(): Observable { - return this.httpClient.get( - `${this.apiBasePath}/api/accounts/me`, - ); - } - - listAccounts(options: { - page: number; - pageSize: number; - search?: string; - organizationId?: string; - }): Observable { - let params = new HttpParams() - .set('page', options.page) - .set('page_size', options.pageSize); - - if (options.search) { - params = params.set('search', options.search); - } - - if (options.organizationId) { - params = params.set('organization_id', options.organizationId); - } - - return this.httpClient.get( - `${this.apiBasePath}/api/accounts`, - { - params, - }, - ); - } - - createAccount(payload: CreateAccountPayload): Observable { - return this.httpClient.post( - `${this.apiBasePath}/api/accounts`, - payload, - ); - } - - updateAccount( - accountId: string, - payload: AccountPayload, - ): Observable { - return this.httpClient.put( - `${this.apiBasePath}/api/accounts/${accountId}`, - payload, - ); - } - - deleteAccount(accountId: string): Observable { - return this.httpClient.delete( - `${this.apiBasePath}/api/accounts/${accountId}`, - ); - } - - listOrganizations(): Observable { - return this.httpClient.get( - `${this.apiBasePath}/api/accounts/organizations`, - ); - } - - private get apiBasePath(): string { - return this.apiConfiguration?.basePath ?? ''; - } -} diff --git a/webapp/src/app/shared/services/credential.service.ts b/webapp/src/app/shared/services/credential.service.ts index efc16734..e70311a2 100644 --- a/webapp/src/app/shared/services/credential.service.ts +++ b/webapp/src/app/shared/services/credential.service.ts @@ -1,49 +1,73 @@ -import { Injectable, computed, inject, signal } from '@angular/core'; -import { filter, take, map, catchError, finalize } from 'rxjs/operators'; +import { Injectable, computed, effect, inject, signal } from '@angular/core'; +import { toObservable, toSignal } from '@angular/core/rxjs-interop'; import { - BehaviorSubject, + catchError, + finalize, + firstValueFrom, + map, Observable, of, + shareReplay, switchMap, tap, throwError, } from 'rxjs'; import { AccessResponse, - AccessToken, AuthService, - Configuration, - IdToken, - LoginResponse, AccountProfile, + OtkResponse, + IdTokenMetadata, + AccessToken, + LoginResponse, } from '../../api'; -import { HttpClient, HttpHeaders } from '@angular/common/http'; -import { Router } from '@angular/router'; -type LogoutResult = 'logged-out' | 'stopped-impersonating'; -type UnauthorizedRecoveryResult = - | 'logged-out' - | 'stopped-impersonating' - | 'already-handling'; +import { Router } from '@angular/router'; +import { HttpContext, HttpContextToken } from '@angular/common/http'; + +export const TOKEN_TYPE = { + ACCESS_TOKEN: 'ACCESS_TOKEN', + ID_TOKEN_COOKIE: 'ID_TOKEN_COOKIE', + REFRESH_TOKEN_COOKIE: 'REFRESH_TOKEN_COOKIE', + NONE: 'NONE', +} as const; + +export type TokenContextType = (typeof TOKEN_TYPE)[keyof typeof TOKEN_TYPE]; + +export const REQUIRED_TOKEN_TYPE = new HttpContextToken( + () => TOKEN_TYPE.ACCESS_TOKEN, +); + +const STORAGE_KEY = 'auth_state'; + +export const clearStoredAuthState = (): void => { + localStorage.removeItem(STORAGE_KEY); +}; + +export interface StoredAuthState { + idTokenMetadata: IdTokenMetadata | null; + accessToken: AccessToken | null; +} + +const EXPIRY_SKEW_MS = 10 * 1000; // 10 seconds @Injectable({ providedIn: 'root', }) export class CredentialService { private readonly authService = inject(AuthService); - private readonly httpClient = inject(HttpClient); - private readonly apiConfiguration = inject(Configuration, { optional: true }); - private handlingUnauthorized = false; - private static readonly KEY_GRANT = 'grant'; - - public readonly validating = new BehaviorSubject(false); - public readonly isAuthenticated = new BehaviorSubject(false); + public readonly isValidating = signal(false); + public readonly isAuthenticated = computed( + () => this.accessToken() !== undefined, + ); public readonly isEffectiveSuperAdmin = computed( () => this.accessToken()?.effective_role === 'SUPER_ADMIN', ); public readonly isEffectiveAdmin = computed( - () => this.accessToken()?.effective_role === 'ADMIN', + () => + this.accessToken()?.effective_role === 'ADMIN' || + this.isEffectiveSuperAdmin(), ); public readonly isEffectiveManager = computed( () => this.accessToken()?.effective_role === 'MANAGER', @@ -51,9 +75,13 @@ export class CredentialService { public readonly effectiveOrganizationId = computed( () => this.accessToken()?.effective_organization_id, ); - public readonly login = new BehaviorSubject(''); - public readonly email = new BehaviorSubject(''); - public readonly organizationName = new BehaviorSubject(''); + public readonly login = computed( + () => this.accountProfile()?.name ?? this.accountProfile()?.email ?? '', + ); + public readonly email = computed(() => this.accountProfile()?.email ?? ''); + public readonly organizationName = computed( + () => this.accountProfile()?.organization_name ?? '', + ); public readonly realAccountId = computed( () => this.accessToken()?.real_account_id ?? '', @@ -65,298 +93,283 @@ export class CredentialService { () => this.realAccountId() !== this.effectiveAccountId(), ); - private readonly identityToken = signal(undefined); - private readonly accessToken = signal(undefined); + public readonly accessToken = signal(undefined); + + public readonly isActiveAccessToken = computed(() => { + const accessToken = this.accessToken(); + return ( + accessToken !== undefined && + new Date(accessToken.expires_at).getTime() >= Date.now() + ); + }); + + public readonly accountProfile = toSignal( + toObservable(this.accessToken).pipe( + switchMap((accessToken) => + accessToken + ? this.authService.getCurrentAccount() + : of(undefined), + ), + ), + { initialValue: undefined }, + ); + + private refreshInFlight$: Observable | null = null; private request = 0; constructor(private readonly router: Router) { - const data = localStorage.getItem(CredentialService.KEY_GRANT); - const id = data ? (JSON.parse(data) as AccessToken) : undefined; - if (id && new Date(id.expires_at).getTime() >= Date.now()) { - this.identityToken.set(id); - this.validating.next(true); - setTimeout(() => this.refreshAccessToken(id), 0); + this.restoreAuthState(); + + effect(() => { + console.log('Access token changed:', this.accessToken()); + }); + + const storedAccessToken = this.getStoredAccessToken(); + if (storedAccessToken && this.isExpired(storedAccessToken)) { + this.refreshAccessToken().subscribe({ + error: (err) => { + console.error('Error refreshing access token on init:', err); + this.logout(); + this.router.navigate(['/login'], { replaceUrl: true }); + }, + }); } } - public validateCurrentSession(): Observable { - return this.loadCurrentProfile(); + private restoreAuthState(): void { + this.accessToken.set(this.getStoredAccessToken() ?? undefined); } - public requestOtk(email: string, password: string): Observable { - const request = ++this.request; - this.validating.next(true); - this.isAuthenticated.next(false); - this.identityToken.set(undefined); + private readAuthState(): StoredAuthState { + const raw = localStorage.getItem(STORAGE_KEY); + if (!raw) { + return { idTokenMetadata: null, accessToken: null }; + } + try { + return JSON.parse(raw) as StoredAuthState; + } catch { + return { idTokenMetadata: null, accessToken: null }; + } + } + + private writeAuthState(patch: Partial): void { + const next: StoredAuthState = { + ...this.readAuthState(), + ...patch, + }; + localStorage.setItem(STORAGE_KEY, JSON.stringify(next)); + } + + private persistAccessToken(accessToken: AccessToken | null): void { + this.writeAuthState({ accessToken }); + this.accessToken.set(accessToken ?? undefined); + } + + private getStoredIdTokenMetadata(): IdTokenMetadata | null { + return this.readAuthState().idTokenMetadata; + } + + private getStoredAccessToken(): AccessToken | null { + return this.readAuthState().accessToken; + } + + private isExpired(token: { expires_at: string }): boolean { + return new Date(token.expires_at).getTime() < Date.now() + EXPIRY_SKEW_MS; + } + + public accessTokenIsExpired(): boolean { + const accessToken = this.getStoredAccessToken(); + return !accessToken || this.isExpired(accessToken); + } + + public logout() { + clearStoredAuthState(); this.accessToken.set(undefined); + this.refreshInFlight$ = null; + } - return this.authService - .requestOtk({ email: email.trim().toLowerCase(), password }) - .pipe( - map((response: { account_id?: string }) => { - if (this.request !== request) { - return ''; - } - - return response.account_id ?? ''; - }), - finalize(() => { - if (this.request === request) { - this.validating.next(false); - } - }), - ); + public requestOtk(email: string, password: string): Observable { + return this.authService.requestOtk( + { + email: email.trim(), + password: password.trim(), + }, + undefined, + undefined, + { context: new HttpContext().set(REQUIRED_TOKEN_TYPE, TOKEN_TYPE.NONE) }, + ); } public loginWithOtk( accountId: string, - email: string, emailCode: string, - ): Observable { - const request = ++this.request; - this.validating.next(true); - this.isAuthenticated.next(false); - + ): Observable { return this.authService - .login({ account_id: accountId, email_code: emailCode.trim() }) + .login( + { + account_id: accountId, + email_code: emailCode.trim(), + }, + undefined, + undefined, + { + context: new HttpContext().set(REQUIRED_TOKEN_TYPE, TOKEN_TYPE.NONE), + }, + ) .pipe( - switchMap((response: LoginResponse) => { - if (this.request != request) return of(undefined); - - const idToken = response.id_token; - - this.identityToken.set(idToken); - localStorage.setItem( - CredentialService.KEY_GRANT, - JSON.stringify(idToken), - ); - return this.getAccessGrantForIdentity(idToken, request); - }), + tap(({ id_token }) => + this.writeAuthState({ idTokenMetadata: id_token }), + ), ); } - public refreshAccessToken(identityToken: IdToken) { - const request = ++this.request; - this.validating.next(true); - this.accessToken.set(undefined); - this.getAccessGrantForIdentity(identityToken, request).subscribe({ - error: () => { - if (this.request != request) return; - this.clearLocalAuthState(); - }, - }); - } - - public impersonateAccount(accountId: string): Observable { - const idToken = this.identityToken(); - - if (!idToken) { - return throwError(() => new Error('No identity token available.')); - } - - const request = ++this.request; - this.validating.next(true); - this.accessToken.set(undefined); - return this.getAccessGrantForIdentity(idToken, request, accountId).pipe( - tap({ error: () => this.validating.next(false) }), - ); - } - - public stopImpersonating(): Observable { - const idToken = this.identityToken(); - - if (!idToken) { - return throwError(() => new Error('No identity token available.')); - } - - const request = ++this.request; - this.validating.next(true); - this.accessToken.set(undefined); - return this.getAccessGrantForIdentity(idToken, request).pipe( - tap({ error: () => this.validating.next(false) }), - ); - } - - public logoutAccount(): Observable { - const wasImpersonating = this.isImpersonating(); - + public requestAccess( + realAccountId: string, + effectiveAccountId?: string, + ): Observable { return this.authService - .logout('body', false, { transferCache: false }) + .getAccessToken( + { + real_account_id: realAccountId, + effective_account_id: effectiveAccountId ?? realAccountId, + }, + undefined, + 'body', + undefined, + { + context: new HttpContext().set( + REQUIRED_TOKEN_TYPE, + TOKEN_TYPE.ID_TOKEN_COOKIE, + ), + }, + ) .pipe( - catchError((error) => { - console.error('Backend logout failed', error); - return of(null); - }), - switchMap(() => { - if (!wasImpersonating) { - this.clearLocalAuthState(); - return of('logged-out' as const); - } - - return this.stopImpersonating().pipe( - map(() => 'stopped-impersonating' as const), - catchError((error) => { - console.error('Stop impersonating after logout failed', error); - this.clearLocalAuthState(); - return of('logged-out' as const); - }), - ); + tap(({ access_token }) => { + this.persistAccessToken(access_token); }), ); } - public clearLocalAuthState(): void { - this.request += 1; - localStorage.removeItem(CredentialService.KEY_GRANT); - this.identityToken.set(undefined); - this.accessToken.set(undefined); - this.isAuthenticated.next(false); - this.validating.next(false); - this.login.next(''); - this.email.next(''); - this.organizationName.next(''); - this.router.navigate(['/login'], { replaceUrl: true }); - } - - public handleUnauthorized(): Observable { - if (this.handlingUnauthorized) { - return of('already-handling' as const); - } - - this.handlingUnauthorized = true; - - const isImpersonating = this.isImpersonating(); - const identityToken = this.identityToken(); - - const recovery$ = - isImpersonating && identityToken - ? this.stopImpersonating().pipe( - map(() => 'stopped-impersonating' as const), - catchError((error) => { - console.error('Failed to stop impersonation after 401', error); - this.clearLocalAuthState(); - return of('logged-out' as const); - }), - ) - : of(null).pipe( - tap(() => this.clearLocalAuthState()), - map(() => 'logged-out' as const), - ); - - return recovery$.pipe( - finalize(() => { - this.handlingUnauthorized = false; - }), - ); - } - public changePassword( currentPassword: string, newPassword: string, ): Observable { - return this.httpClient - .post( - `${this.apiBasePath}/api/auth/v2/change-password`, - { - current_password: currentPassword, - new_password: newPassword, - }, - { withCredentials: true }, - ) + this.isValidating.set(true); + return this.authService + .changePassword({ + current_password: currentPassword, + new_password: newPassword, + }) .pipe( - tap(() => { - this.clearLocalAuthState(); - }), - map(() => undefined), + tap(() => this.isValidating.set(false)), catchError((err) => { - throw err; + this.isValidating.set(false); + return throwError(() => err); }), ); } + public refreshAccessToken(): Observable { + if (this.refreshInFlight$) { + return this.refreshInFlight$; + } + + this.refreshInFlight$ = this.authService + .refreshAccessToken(undefined, 'body', undefined, { + context: new HttpContext().set( + REQUIRED_TOKEN_TYPE, + TOKEN_TYPE.REFRESH_TOKEN_COOKIE, // 'REFRESH_TOKEN_COOKIE' and NOT 'REFRESH_COOKIE', + 30 Minutes debugging this shit, changed to types + ), + }) + .pipe( + tap((accessToken) => { + this.persistAccessToken(accessToken); + }), + catchError(() => this.reauthenticateViaIdToken()), + finalize(() => { + this.refreshInFlight$ = null; + }), + shareReplay(1), + ); + + return this.refreshInFlight$; + } + + reauthenticateViaIdToken(): Observable { + const idTokenMetadata = this.getStoredIdTokenMetadata(); + + if (!idTokenMetadata || this.isExpired(idTokenMetadata)) { + this.logout(); + return throwError( + () => new Error('No valid ID token metadata available.'), + ); + } + + return this.requestAccess( + idTokenMetadata.real_account_id, + idTokenMetadata.real_account_id, + ).pipe( + map(({ access_token }) => access_token), + catchError((err) => { + console.error('Error reauthenticating via ID token:', err); + this.logout(); + return throwError(() => err); + }), + ); + } + + public getRawAccessToken(): string | undefined { + return this.getStoredAccessToken()?.raw_token; + } + + public async impersonateAccount(effectiveAccountId: string): Promise { + const realAccountId = this.getStoredIdTokenMetadata()?.real_account_id; + if (!realAccountId) { + throw new Error('No real account ID available.'); + } + + const request = ++this.request; + this.isValidating.set(true); + + try { + await firstValueFrom( + this.requestAccess(realAccountId, effectiveAccountId), + ); + } finally { + if (request === this.request) { + this.isValidating.set(false); + } + } + } + + public async stopImpersonating(): Promise { + this.isValidating.set(true); + + const realAccountId = this.getStoredIdTokenMetadata()?.real_account_id; + if (!realAccountId) { + throw new Error('No real account ID available.'); + } + + try { + await firstValueFrom(this.requestAccess(realAccountId, realAccountId)); + } finally { + this.isValidating.set(false); + } + } + + public async logoutAccount(): Promise { + try { + await firstValueFrom(this.authService.logout()); + } catch (err) { + console.error('Error logging out on the server:', err); + } finally { + this.logout(); + await this.router.navigate(['/login'], { replaceUrl: true }); + } + } + public registerAccount(_data: unknown): Observable { return throwError(() => new Error('Registration is temporarily disabled.')); } - - //review: arman (generated fix) - public getBearerToken(): Observable { - const accessToken = this.accessToken(); - const identityToken = this.identityToken(); - - // 1. If we have a valid access token, return it immediately and complete. - if ( - accessToken && - Date.now() < new Date(accessToken.expires_at).getTime() - ) { - return of(accessToken.raw_token); - } - - // 2. If we don't have a token, and we ARE NOT currently validating, trigger a refresh. - if (!this.validating.value) { - if (!identityToken) { - return of(undefined); // No identity token to refresh with. - } - this.refreshAccessToken(identityToken); - } - - // 3. Wait for the validation to finish, then return the resulting token. - return this.validating.pipe( - filter((isValidating) => !isValidating), // Wait until validating becomes false - take(1), // Take exactly 1 emission and then automatically complete() - map(() => this.accessToken()?.raw_token), - ); - } - - private getAccessGrantForIdentity( - idToken: IdToken, - request: number, - effectiveAccountId?: string, - ): Observable { - const realAccountId = idToken.real_account_id; - const headers = new HttpHeaders({ - Authorization: `Bearer ${idToken.raw_token}`, - }); - const payload = { - real_account_id: realAccountId, - effective_account_id: effectiveAccountId ?? realAccountId, - }; - - return this.httpClient - .post(`${this.apiBasePath}/api/auth/v2/access`, payload, { - headers, - withCredentials: true, - }) - .pipe( - tap((result: AccessResponse) => { - if (this.request != request) return; - - const accessToken = result.access_token; - - this.accessToken.set(accessToken); - this.isAuthenticated.next(true); - this.validating.next(false); - }), - map(() => undefined), - ); - } - - private get apiBasePath(): string { - return this.apiConfiguration?.basePath ?? ''; - } - - private loadCurrentProfile(): Observable { - return this.httpClient - .get(`${this.apiBasePath}/api/accounts/me`, { - withCredentials: true, - }) - .pipe( - tap((profile) => { - this.login.next(profile.name ?? profile.email ?? ''); - this.email.next(profile.email ?? ''); - this.organizationName.next(profile.organization_name ?? ''); - }), - map(() => undefined), - ); - } } diff --git a/webapp/src/app/shared/services/organization-management.service.ts b/webapp/src/app/shared/services/organization-management.service.ts deleted file mode 100644 index 9597a005..00000000 --- a/webapp/src/app/shared/services/organization-management.service.ts +++ /dev/null @@ -1,75 +0,0 @@ -import { HttpClient, HttpParams } from '@angular/common/http'; -import { Injectable, inject } from '@angular/core'; -import { Observable } from 'rxjs'; -import { Configuration } from '../../api'; - -export interface OrganizationProfile { - id: string; - name: string; - other_inst_id?: string | null; - deleted: boolean; - member_count: number; -} - -export interface OrganizationPage { - items: OrganizationProfile[]; - total: number; - page: number; - page_size: number; -} - -export interface CreateOrganizationPayload { - name: string; - other_inst_id?: string | null; -} - -export interface UpdateOrganizationPayload { - name?: string; - other_inst_id?: string | null; - deleted?: boolean; -} - -@Injectable({ providedIn: 'root' }) -export class OrganizationManagementService { - private readonly httpClient = inject(HttpClient); - private readonly apiConfiguration = inject(Configuration, { optional: true }); - - getOrganizations(page: number, pageSize: number): Observable { - const params = new HttpParams() - .set('page', page) - .set('page_size', pageSize); - return this.httpClient.get( - `${this.apiBasePath}/api/organizations`, - { params }, - ); - } - - createOrganization( - payload: CreateOrganizationPayload, - ): Observable { - return this.httpClient.post( - `${this.apiBasePath}/api/organizations`, - payload, - ); - } - - updateOrganization( - organizationId: string, - payload: UpdateOrganizationPayload, - ): Observable { - return this.httpClient.put( - `${this.apiBasePath}/api/organizations/${organizationId}`, - payload, - ); - } - - deleteOrganization(organizationId: string): Observable { - return this.httpClient.delete( - `${this.apiBasePath}/api/organizations/${organizationId}`, - ); - } - - private get apiBasePath(): string { - return this.apiConfiguration?.basePath ?? ''; - } -} diff --git a/webapp/src/app/shared/ui/app-layout/app-layout.component.html b/webapp/src/app/shared/ui/app-layout/app-layout.component.html index f4ae841c..7be187a0 100644 --- a/webapp/src/app/shared/ui/app-layout/app-layout.component.html +++ b/webapp/src/app/shared/ui/app-layout/app-layout.component.html @@ -3,7 +3,7 @@ - @if (credentialService.isAuthenticated | async) { + @if (credentialService.isAuthenticated()) { } - @if (credentialService.isAuthenticated | async) { + @if (credentialService.isAuthenticated()) { @if (credentialService.isImpersonating()) {
switch_account diff --git a/webapp/src/app/shared/ui/app-layout/app-layout.component.ts b/webapp/src/app/shared/ui/app-layout/app-layout.component.ts index 127f842d..abd2f2ec 100644 --- a/webapp/src/app/shared/ui/app-layout/app-layout.component.ts +++ b/webapp/src/app/shared/ui/app-layout/app-layout.component.ts @@ -102,22 +102,20 @@ export class AppLayoutComponent implements OnInit, OnDestroy { this.mediaQuery.removeEventListener('change', this.mediaQueryListener); } - logout() { - this.credentialService.logoutAccount().subscribe({ - next: (result) => { - if (result === 'stopped-impersonating') { - this.router.navigate(['/accounts']); - } else { - this.router.navigate(['/login']); - } - }, - }); + async logout() { + const isImpersonating = this.credentialService.isImpersonating(); + + if (isImpersonating) { + await this.credentialService.stopImpersonating(); + this.router.navigate(['/accounts']); + } else { + await this.credentialService.logoutAccount(); + } } - stopImpersonating(): void { - this.credentialService.stopImpersonating().subscribe({ - next: () => this.router.navigate(['/accounts']), - }); + async stopImpersonating(): Promise { + await this.credentialService.stopImpersonating(); + this.router.navigate(['/accounts']); } navigateBack() { diff --git a/webapp/src/app/shared/ui/app-menu/app-menu.component.html b/webapp/src/app/shared/ui/app-menu/app-menu.component.html index bb0b8f36..5b913d11 100644 --- a/webapp/src/app/shared/ui/app-menu/app-menu.component.html +++ b/webapp/src/app/shared/ui/app-menu/app-menu.component.html @@ -105,13 +105,13 @@ } @else { @@ -119,13 +119,11 @@ diff --git a/webapp/src/app/shared/ui/app-menu/app-menu.component.ts b/webapp/src/app/shared/ui/app-menu/app-menu.component.ts index acd07982..f39ff565 100644 --- a/webapp/src/app/shared/ui/app-menu/app-menu.component.ts +++ b/webapp/src/app/shared/ui/app-menu/app-menu.component.ts @@ -70,7 +70,7 @@ export class AppMenuComponent { icon: 'groups', route: '/persons', queryParams: { - institutionName: this.credentialService.organizationName.value, + institutionName: this.credentialService.organizationName(), }, disabled: false, }, @@ -179,15 +179,7 @@ export class AppMenuComponent { }); dialogRef.componentInstance.confirmDelete.subscribe(() => { - this.credentialService.logoutAccount().subscribe({ - next: (result) => { - if (result === 'stopped-impersonating') { - this.router.navigate(['/accounts']); - } else { - this.router.navigate(['/login']); - } - }, - }); + void this.credentialService.logoutAccount(); }); } } diff --git a/webapp/src/app/shared/ui/card-search/card-search.component.html b/webapp/src/app/shared/ui/card-search/card-search.component.html new file mode 100644 index 00000000..c06d03a6 --- /dev/null +++ b/webapp/src/app/shared/ui/card-search/card-search.component.html @@ -0,0 +1,54 @@ + diff --git a/webapp/src/app/shared/ui/card-search/card-search.component.scss b/webapp/src/app/shared/ui/card-search/card-search.component.scss new file mode 100644 index 00000000..521dda4c --- /dev/null +++ b/webapp/src/app/shared/ui/card-search/card-search.component.scss @@ -0,0 +1,31 @@ +.card-search { + display: flex; + flex-direction: column; + gap: 1rem; +} + +.card-search-filter { + display: flex; + flex-direction: row; + gap: 1rem; + padding: 0rem 1rem; +} + +.cards { + display: grid; + gap: 1.5rem; + grid-template-columns: repeat(auto-fit, minmax(var(--card-min-width), 1fr)); + padding: 0 1rem; +} + +.pagination { + display: flex; + justify-content: end; + padding: 0rem 1rem; +} + +.no-results { + text-align: center; + padding: 2rem; + color: var(--sg-text-secondary); +} diff --git a/webapp/src/app/shared/ui/card-search/card-search.component.ts b/webapp/src/app/shared/ui/card-search/card-search.component.ts new file mode 100644 index 00000000..d0ac7f07 --- /dev/null +++ b/webapp/src/app/shared/ui/card-search/card-search.component.ts @@ -0,0 +1,49 @@ +import { Component, input, TemplateRef } from '@angular/core'; +import { QueryParamInputComponent } from '../query-param-input/query-param-input.component'; +import { + QueryParamSelectorComponent, + SelectorOption, +} from '../query-param-selector/query-param-selector.component'; +import { MatDivider } from '@angular/material/divider'; +import { QueryParamPaginatorComponent } from '../query-param-paginator/query-param-paginator.component'; +import { NgTemplateOutlet } from '@angular/common'; + +export type Page = { + page: number; + size: number; + total: number; + elements: any[]; +}; + +@Component({ + selector: 'app-card-search', + imports: [ + QueryParamInputComponent, + QueryParamSelectorComponent, + MatDivider, + QueryParamPaginatorComponent, + NgTemplateOutlet, + ], + templateUrl: './card-search.component.html', + styleUrl: './card-search.component.scss', +}) +export class CardSearchComponent { + cardTmp = input.required>(); + additionalFiltersTmp = input>(); + noResultsTmp = input>(); + + cardMinWidth = input(300); + + page = input.required(); + + withSearch = input(true); + searchLabel = input('Suchen'); + searchQueryParamKey = input('search'); + + sortingOptions = input(); + sortByQueryParamKey = input('sort_by'); + sortByLabel = input('Sortieren nach'); + sortingDirectionOptions = input(); + sortingDirectionQueryParamKey = input('sorting_order'); + sortingDirectionLabel = input('Sortierreihenfolge'); +} diff --git a/webapp/src/app/shared/ui/query-param-selector/query-param-selector.component.html b/webapp/src/app/shared/ui/query-param-selector/query-param-selector.component.html index 0f6dcd9b..2ce167fe 100644 --- a/webapp/src/app/shared/ui/query-param-selector/query-param-selector.component.html +++ b/webapp/src/app/shared/ui/query-param-selector/query-param-selector.component.html @@ -1,5 +1,12 @@ - + + @for (option of _options(); track $index) { + {{ option.display_name }} + } + + diff --git a/webapp/src/app/shared/ui/query-param-selector/query-param-selector.component.ts b/webapp/src/app/shared/ui/query-param-selector/query-param-selector.component.ts index caa3f7bf..2b51fdd4 100644 --- a/webapp/src/app/shared/ui/query-param-selector/query-param-selector.component.ts +++ b/webapp/src/app/shared/ui/query-param-selector/query-param-selector.component.ts @@ -1,6 +1,7 @@ import { Component, computed, inject, input, output } from '@angular/core'; import { takeUntilDestroyed, toSignal } from '@angular/core/rxjs-interop'; import { FormsModule } from '@angular/forms'; +import { MatSelectChange, MatSelectModule } from '@angular/material/select'; import { ActivatedRoute, Router } from '@angular/router'; export type SelectorOption = { @@ -10,14 +11,30 @@ export type SelectorOption = { @Component({ selector: 'app-query-param-selector', - imports: [FormsModule], + imports: [FormsModule, MatSelectModule], templateUrl: './query-param-selector.component.html', styleUrl: './query-param-selector.component.scss', }) export class QueryParamSelectorComponent { options = input.required(); queryParamKey = input.required(); - handleSelectionChange = output(); + handleSelectionChange = output(); + allowEmptyValue = input(false); + label = input(''); + + _options = computed(() => { + const options = this.options(); + + if (!options) { + return []; + } + + if (this.allowEmptyValue()) { + return [{ value: '', display_name: '' }, ...options]; + } + + return options; + }); private readonly activatedRoute = inject(ActivatedRoute); private readonly router = inject(Router); @@ -33,8 +50,8 @@ export class QueryParamSelectorComponent { return params && key ? params[key] || '' : ''; }); - _handleSelectionChange(event: Event): void { - const newValue = (event.target as HTMLSelectElement).value; + _handleSelectionChange(event: MatSelectChange): void { + const newValue = event.value; this.router.navigate([], { queryParams: { [this.queryParamKey()]: newValue }, diff --git a/webapp/src/app/shared/ui/topic-autocomplete/topic-autocomplete.component.html b/webapp/src/app/shared/ui/topic-autocomplete/topic-autocomplete.component.html index e7a2f20f..91a2bdcc 100644 --- a/webapp/src/app/shared/ui/topic-autocomplete/topic-autocomplete.component.html +++ b/webapp/src/app/shared/ui/topic-autocomplete/topic-autocomplete.component.html @@ -9,6 +9,7 @@ (click)="$event.preventDefault()" (keydown.enter)="submitCurrentValue(); $event.preventDefault()" (keydown.tab)="onKeydownTab($any($event))" /> + Füge ein Keyword hinzu @if (searchControl.value.trim()) { - + matTooltipPosition="above" + (click)="toggleSubfield(group, item)"> {{ item.name }} - +
diff --git a/webapp/src/app/shared/ui/topic-legend/topic-legend.component.scss b/webapp/src/app/shared/ui/topic-legend/topic-legend.component.scss index fa9fca76..666ca903 100644 --- a/webapp/src/app/shared/ui/topic-legend/topic-legend.component.scss +++ b/webapp/src/app/shared/ui/topic-legend/topic-legend.component.scss @@ -110,11 +110,39 @@ background: #fbfdff; } +.topic-legend-group-active { + border-color: var(--legend-color, var(--topic-legend-accent)); + background: color-mix( + in srgb, + var(--legend-color, var(--topic-legend-accent)) 10%, + #fbfdff + ); + box-shadow: + inset 0 0 0 1px + color-mix( + in srgb, + var(--legend-color, var(--topic-legend-accent)) 55%, + transparent + ), + 0 0 0 2px + color-mix( + in srgb, + var(--legend-color, var(--topic-legend-accent)) 22%, + transparent + ); +} + .topic-legend-field { flex: 0 1 auto; min-width: 0; gap: 5px; + padding: 2px 4px; + appearance: none; + border: 0; + border-radius: 999px; + background: transparent; color: #07163d; + font-family: inherit; font-size: 11px; font-weight: 800; line-height: 1.2; @@ -143,13 +171,87 @@ } .topic-legend-item { + display: inline-flex; + align-items: center; + padding: 2px 4px; + appearance: none; + border: 0; + border-radius: 999px; + background: transparent; color: #53617e; + font-family: inherit; font-size: 11px; font-weight: 600; line-height: 1.25; cursor: help; } +.topic-legend-selectable { + .topic-legend-field, + .topic-legend-item { + cursor: pointer; + } + + .topic-legend-field:hover, + .topic-legend-item:hover { + background: color-mix( + in srgb, + var(--legend-color, var(--topic-legend-accent)) 8%, + #ffffff + ); + } +} + +.topic-legend-field:focus-visible, +.topic-legend-item:focus-visible { + outline: 2px solid var(--topic-legend-accent); + outline-offset: 2px; +} + +.topic-legend-entry-active { + background: color-mix( + in srgb, + var(--legend-color, var(--topic-legend-accent)) 24%, + #ffffff + ); + box-shadow: + inset 0 0 0 1px + color-mix( + in srgb, + var(--legend-color, var(--topic-legend-accent)) 75%, + transparent + ), + 0 1px 3px rgba(15, 23, 42, 0.12); +} + +.topic-legend-field.topic-legend-entry-active { + color: color-mix( + in srgb, + var(--legend-color, var(--topic-legend-accent)) 34%, + #07163d + ); +} + +.topic-legend-field.topic-legend-entry-active .topic-legend-dot { + box-shadow: + 0 0 0 2px #ffffff, + 0 0 0 4px + color-mix( + in srgb, + var(--legend-color, var(--topic-legend-accent)) 82%, + transparent + ); +} + +.topic-legend-item.topic-legend-entry-active { + color: color-mix( + in srgb, + var(--legend-color, var(--topic-legend-accent)) 34%, + #07163d + ); + font-weight: 800; +} + .topic-legend-more-toggle { flex: 0 0 auto; padding: 0; diff --git a/webapp/src/app/shared/ui/topic-legend/topic-legend.component.ts b/webapp/src/app/shared/ui/topic-legend/topic-legend.component.ts index f5a5e0d0..ec776260 100644 --- a/webapp/src/app/shared/ui/topic-legend/topic-legend.component.ts +++ b/webapp/src/app/shared/ui/topic-legend/topic-legend.component.ts @@ -2,7 +2,11 @@ import { CommonModule } from '@angular/common'; import { Component, EventEmitter, Input, Output } from '@angular/core'; import { MatIconModule } from '@angular/material/icon'; import { MatTooltipModule } from '@angular/material/tooltip'; -import { TopicLegendGroup, TopicLegendItem } from '../../../resolvers/utils/topic-legend'; +import { + TopicLegendGroup, + TopicLegendItem, + TopicLegendSubfieldSelection, +} from '../../../resolvers/utils/topic-legend'; export type TopicLegendVariant = 'default' | 'compact'; @@ -17,16 +21,21 @@ export class TopicLegendComponent { @Input() groups: TopicLegendGroup[] = []; @Input() title = 'Farben nach Fachgebiet'; @Input() infoTooltip = - 'Fachgebiete bestimmen die Farbe. Themenbereiche werden darunter gruppiert.'; + 'Fachgebiete bestimmen die Farbe. Themenbereiche werden darunter gruppiert. Fachgebiete oder Themenbereiche können angeklickt werden, um die passenden Themen zu markieren.'; @Input() visible = true; @Input() expanded = false; @Input() showTitle = true; @Input() showVisibilityToggle = true; @Input() collapsedGroupLimit = 3; @Input() variant: TopicLegendVariant = 'default'; + @Input() selectable = false; + @Input() activeFieldIds: ReadonlySet | readonly string[] = []; + @Input() activeSubfieldIds: ReadonlySet | readonly string[] = []; @Output() visibleChange = new EventEmitter(); @Output() expandedChange = new EventEmitter(); + @Output() fieldToggle = new EventEmitter(); + @Output() subfieldToggle = new EventEmitter(); get hasGroups(): boolean { return this.groups.length > 0; @@ -66,6 +75,30 @@ export class TopicLegendComponent { this.expandedChange.emit(!this.expanded); } + toggleField(group: TopicLegendGroup): void { + if (!this.selectable) { + return; + } + + this.fieldToggle.emit(group); + } + + toggleSubfield(group: TopicLegendGroup, item: TopicLegendItem): void { + if (!this.selectable) { + return; + } + + this.subfieldToggle.emit({ group, item }); + } + + isFieldActive(group: TopicLegendGroup): boolean { + return this.isActiveLegendId(this.activeFieldIds, group.id); + } + + isSubfieldActive(item: TopicLegendItem): boolean { + return this.isActiveLegendId(this.activeSubfieldIds, item.id); + } + trackByGroup(_: number, group: TopicLegendGroup): string { return group.id; } @@ -73,4 +106,15 @@ export class TopicLegendComponent { trackByItem(_: number, item: TopicLegendItem): string { return item.id; } + + private isActiveLegendId( + activeIds: ReadonlySet | readonly string[], + id: string, + ): boolean { + if ('has' in activeIds) { + return activeIds.has(id); + } + + return activeIds.includes(id); + } } diff --git a/webapp/src/styles.scss b/webapp/src/styles.scss index 3a14b039..71643900 100644 --- a/webapp/src/styles.scss +++ b/webapp/src/styles.scss @@ -232,3 +232,48 @@ h3 { max-width: 360px; white-space: pre-line; } + +.cdk-overlay-pane .mat-mdc-option small { + display: block; + color: var(--sg-text-muted); + font-size: 11px; + line-height: 1.2; +} + +.cdk-overlay-pane .select-search { + position: sticky; + top: 0; + z-index: 1; + display: flex; + align-items: center; + gap: 6px; + min-width: 200px; + padding: 8px 12px; + background: var(--sg-surface, #fff); + border-bottom: 1px solid var(--sg-border); +} + +.cdk-overlay-pane .select-search__icon { + flex-shrink: 0; + width: 16px; + height: 16px; + font-size: 16px; + color: var(--sg-text-soft); +} + +.cdk-overlay-pane .select-search__input { + flex: 1; + min-width: 0; + border: none; + outline: none; + background: transparent; + color: var(--sg-text); + font-family: inherit; + font-size: 13px; +} + +.cdk-overlay-pane .select-search__empty { + padding: 10px 14px; + color: var(--sg-text-muted); + font-size: 13px; +}