From a3783aecd3a28b02761afba3f22f5448af352173 Mon Sep 17 00:00:00 2001 From: Farajollahi Date: Tue, 26 May 2026 20:51:28 +0200 Subject: [PATCH 01/16] Add backend endpoint for author works search --- service/build.gradle | 2 +- service/src/main/inse/config.py | 7 +- service/src/main/inse/service.py | 2 + service/src/main/inse/works/__init__.py | 5 + service/src/main/inse/works/logic.py | 76 +++++++ service/src/main/inse/works/model.py | 213 ++++++++++++++++++ service/src/main/inse/works/search_client.py | 68 ++++++ service/src/main/inse/works/service.py | 31 +++ .../main/inse/works/test_openalex_logic.py | 103 +++++++++ .../src/main/inse/works/test_search_client.py | 49 ++++ service/src/main/inse/works/test_service.py | 53 +++++ 11 files changed, 607 insertions(+), 2 deletions(-) create mode 100644 service/src/main/inse/works/__init__.py create mode 100644 service/src/main/inse/works/logic.py create mode 100644 service/src/main/inse/works/model.py create mode 100644 service/src/main/inse/works/search_client.py create mode 100644 service/src/main/inse/works/service.py create mode 100644 service/src/main/inse/works/test_openalex_logic.py create mode 100644 service/src/main/inse/works/test_search_client.py create mode 100644 service/src/main/inse/works/test_service.py diff --git a/service/build.gradle b/service/build.gradle index 1c3844ba..5ec0515b 100644 --- a/service/build.gradle +++ b/service/build.gradle @@ -14,7 +14,7 @@ task test(type: Exec) { task runServeContainer(type: Exec) { dependsOn createImage - commandLine 'docker', 'run', '--rm', '-v', "${projectDir}/src/main:/home", '-v', "${projectDir}/src/data:/data", '-p', '8000:8000', '-e', "DOCKER_DEFAULT_PLATFORM='${targetPlatform}'", '-e', "INSE_AUTH_STANDALONE=true", '--name', "${imageName}-service-serve", '--detach', "${imagePrefix}-service:${imageVersion}", 'run', '--reload', '--reload-dir', './inse' + commandLine 'docker', 'run', '--rm', '-v', "${projectDir}/src/main:/home", '-v', "${projectDir}/src/data:/data", '-p', '8000:8000', '-e', "DOCKER_DEFAULT_PLATFORM='${targetPlatform}'", '-e', "INSE_AUTH_STANDALONE=true", '-e', 'INSE_OPENALEX_WORKS_API_KEY', '--name', "${imageName}-service-serve", '--detach', "${imagePrefix}-service:${imageVersion}", 'run', '--reload', '--reload-dir', './inse' } task stopServeContainer(type: Exec) { diff --git a/service/src/main/inse/config.py b/service/src/main/inse/config.py index df1ed72f..0b0fbe1f 100644 --- a/service/src/main/inse/config.py +++ b/service/src/main/inse/config.py @@ -19,6 +19,11 @@ class Settings(BaseSettings): auth_disabled: bool = False auth_standalone: bool = True auth_secret: str = 'change-me-to-a-secure-secret-key' + # OpenAlex works search config + openalex_works_search_base_url: str = 'https://project.nes.uni-due.de/elastic' + openalex_works_search_index: str = 'openalex-works' + openalex_works_api_key: str = 'am1wWXBaMEJEVWJoZkE5MnBaUlk6TWlvbW1LRlMzNjdDUHgzYmVkUmI5UQ==' + openalex_works_search_timeout_seconds: float = 30.0 settings = Settings() -logger.info(f"Database URL: {settings.database_url}.") \ No newline at end of file +logger.info(f"Database URL: {settings.database_url}.") diff --git a/service/src/main/inse/service.py b/service/src/main/inse/service.py index abaf5816..a6d5ad4d 100644 --- a/service/src/main/inse/service.py +++ b/service/src/main/inse/service.py @@ -22,6 +22,7 @@ from . import schema from . import database from . import security from . import util +from .works import service as works_service logger = logging.getLogger(__name__) @@ -32,6 +33,7 @@ app = FastAPI(redoc_url=None, title='My App Service', summary='My App Service API', version='1.0.0') +app.include_router(works_service.router) @app.get("/", include_in_schema=False) async def show_api(): diff --git a/service/src/main/inse/works/__init__.py b/service/src/main/inse/works/__init__.py new file mode 100644 index 00000000..fe9a01ed --- /dev/null +++ b/service/src/main/inse/works/__init__.py @@ -0,0 +1,5 @@ +#!/usr/bin/env python +# -*- coding: utf-8 -*- +""" + Works domain package. +""" diff --git a/service/src/main/inse/works/logic.py b/service/src/main/inse/works/logic.py new file mode 100644 index 00000000..bdf9962e --- /dev/null +++ b/service/src/main/inse/works/logic.py @@ -0,0 +1,76 @@ +#!/usr/bin/env python +# -*- coding: utf-8 -*- +""" + Business logic for publication works. +""" +import logging + +import httpx +from fastapi import HTTPException +from pydantic import ValidationError +from starlette.status import HTTP_502_BAD_GATEWAY +from starlette.status import HTTP_503_SERVICE_UNAVAILABLE + +from . import model +from .search_client import MissingApiKeyError +from .search_client import OpenAlexWorksSearchClient + +logger = logging.getLogger(__name__) + + +async def get_author_works( + author_id: str, + page: int, + size: int, + client: OpenAlexWorksSearchClient | None = None, +) -> model.WorkPage: + search_client = client or OpenAlexWorksSearchClient() + try: + data = await search_client.search_author_works(author_id, page, size) + except MissingApiKeyError as exc: + logger.error("OpenAlex works Elasticsearch API key is not configured.") + raise HTTPException( + status_code=HTTP_503_SERVICE_UNAVAILABLE, + detail="OpenAlex works search is not configured.", + ) from exc + except httpx.HTTPError as exc: + logger.exception("OpenAlex works search request failed.") + raise HTTPException( + status_code=HTTP_502_BAD_GATEWAY, + detail="OpenAlex works search request failed.", + ) from exc + + hits = data.get("hits", {}) + total = hits.get("total", 0) + if isinstance(total, dict): + total = total.get("value", 0) + + try: + elements = [ + model.WorkSummary.model_validate(_to_work_summary(hit.get("_source", {}))) + for hit in hits.get("hits", []) + ] + except ValidationError as exc: + logger.exception("OpenAlex works search response could not be parsed.") + raise HTTPException( + status_code=HTTP_502_BAD_GATEWAY, + detail="OpenAlex works search response could not be parsed.", + ) from exc + + return model.WorkPage(elements=elements, page=page, size=size, total=total) + + +def _to_work_summary(source: dict) -> dict: + return { + "doi": source.get("doi"), + "title": source.get("title") or source.get("display_name"), + "type": source.get("type"), + "language": source.get("language"), + "publication_year": source.get("publication_year"), + "cited_by_count": source.get("cited_by_count") or 0, + "topics": [ + topic["display_name"] + for topic in source.get("topics") or [] + if topic.get("display_name") + ], + } diff --git a/service/src/main/inse/works/model.py b/service/src/main/inse/works/model.py new file mode 100644 index 00000000..a65c4cc5 --- /dev/null +++ b/service/src/main/inse/works/model.py @@ -0,0 +1,213 @@ +#!/usr/bin/env python +# -*- coding: utf-8 -*- +""" + Pydantic models for publication works. +""" +from typing import List +from typing import Optional + +from pydantic import BaseModel +from pydantic import ConfigDict +from pydantic import Field + + +class OpenAlexModel(BaseModel): + model_config = ConfigDict(extra="allow") + + +class Source(OpenAlexModel): + id: Optional[str] = Field(default=None, description="The source id.") + display_name: Optional[str] = Field(default=None, description="The source display name.") + issn_l: Optional[str] = Field(default=None, description="The linking ISSN.") + issn: Optional[List[str]] = Field(default=None, description="The ISSNs of the source.") + is_oa: Optional[bool] = Field(default=None, description="Whether the source is open access.") + is_in_doaj: Optional[bool] = Field(default=None, description="Whether the source is in DOAJ.") + is_core: Optional[bool] = Field(default=None, description="Whether the source is a core source.") + host_organization: Optional[str] = Field(default=None, description="The host organization id.") + host_organization_name: Optional[str] = Field(default=None, description="The host organization name.") + host_organization_lineage: Optional[List[str]] = Field(default=None, description="The host organization lineage.") + type: Optional[str] = Field(default=None, description="The source type.") + + +class Location(OpenAlexModel): + is_oa: Optional[bool] = Field(default=None, description="Whether this location is open access.") + landing_page_url: Optional[str] = Field(default=None, description="The landing page URL.") + pdf_url: Optional[str] = Field(default=None, description="The PDF URL.") + source: Optional[Source] = Field(default=None, description="The publication source.") + license: Optional[str] = Field(default=None, description="The license label.") + license_id: Optional[str] = Field(default=None, description="The license id.") + is_accepted: Optional[bool] = Field(default=None, description="Whether this manuscript is accepted.") + is_published: Optional[bool] = Field(default=None, description="Whether this manuscript is published.") + + +class OpenAccess(OpenAlexModel): + is_oa: Optional[bool] = Field(default=None, description="Whether the work is open access.") + oa_url: Optional[str] = Field(default=None, description="The open access URL.") + any_repository_has_fulltext: Optional[bool] = Field(default=None, description="Whether a repository has full text.") + + +class Author(OpenAlexModel): + id: Optional[str] = Field(default=None, description="The author id.") + display_name: Optional[str] = Field(default=None, description="The display name of the author.") + orcid: Optional[str] = Field(default=None, description="The optional ORCID of the author.") + + +class Institution(OpenAlexModel): + id: Optional[str] = Field(default=None, description="The institution id.") + display_name: Optional[str] = Field(default=None, description="The institution display name.") + ror: Optional[str] = Field(default=None, description="The ROR id.") + country_code: Optional[str] = Field(default=None, description="The country code.") + type: Optional[str] = Field(default=None, description="The institution type.") + lineage: Optional[List[str]] = Field(default=None, description="The institution lineage.") + + +class Authorship(OpenAlexModel): + author: Optional[Author] = Field(default=None, description="The author.") + institutions: List[Institution] = Field(default_factory=list, description="The author's institutions.") + countries: List[str] = Field(default_factory=list, description="The author's countries.") + is_corresponding: Optional[bool] = Field(default=None, description="Whether this author is corresponding.") + raw_author_name: Optional[str] = Field(default=None, description="The raw author name.") + raw_affiliation_strings: List[str] = Field(default_factory=list, description="The raw affiliation strings.") + + +class WorkIds(OpenAlexModel): + openalex: Optional[str] = Field(default=None, description="The OpenAlex id.") + doi: Optional[str] = Field(default=None, description="The DOI.") + mag: Optional[int] = Field(default=None, description="The MAG id.") + pmid: Optional[str] = Field(default=None, description="The PubMed id.") + pmcid: Optional[str] = Field(default=None, description="The PubMed Central id.") + + +class Biblio(OpenAlexModel): + volume: Optional[str] = Field(default=None, description="The volume.") + issue: Optional[str] = Field(default=None, description="The issue.") + first_page: Optional[str] = Field(default=None, description="The first page.") + last_page: Optional[str] = Field(default=None, description="The last page.") + + +class TopicLevel(OpenAlexModel): + id: Optional[str] = Field(default=None, description="The topic level id.") + display_name: Optional[str] = Field(default=None, description="The topic level display name.") + + +class Topic(OpenAlexModel): + id: Optional[str] = Field(default=None, description="The topic id.") + display_name: Optional[str] = Field(default=None, description="The topic display name.") + score: Optional[float] = Field(default=None, description="The topic score.") + subfield: Optional[TopicLevel] = Field(default=None, description="The topic subfield.") + field: Optional[TopicLevel] = Field(default=None, description="The topic field.") + domain: Optional[TopicLevel] = Field(default=None, description="The topic domain.") + + +class Keyword(OpenAlexModel): + id: Optional[str] = Field(default=None, description="The keyword id.") + display_name: Optional[str] = Field(default=None, description="The keyword display name.") + score: Optional[float] = Field(default=None, description="The keyword score.") + + +class Funder(OpenAlexModel): + id: Optional[str] = Field(default=None, description="The funder id.") + display_name: Optional[str] = Field(default=None, description="The funder display name.") + ror: Optional[str] = Field(default=None, description="The ROR id.") + + +class Award(OpenAlexModel): + id: Optional[str] = Field(default=None, description="The award id.") + display_name: Optional[str] = Field(default=None, description="The award display name.") + funder_award_id: Optional[str] = Field(default=None, description="The funder award id.") + funder_id: Optional[str] = Field(default=None, description="The funder id.") + funder_display_name: Optional[str] = Field(default=None, description="The funder display name.") + doi: Optional[str] = Field(default=None, description="The award DOI.") + + +class CitationNormalizedPercentile(OpenAlexModel): + value: Optional[float] = Field(default=None, description="The normalized citation percentile.") + is_in_top_1_percent: Optional[bool] = Field(default=None, description="Whether the work is in the top 1 percent.") + is_in_top_10_percent: Optional[bool] = Field(default=None, description="Whether the work is in the top 10 percent.") + + +class CitedByPercentileYear(OpenAlexModel): + min: Optional[int] = Field(default=None, description="The minimum percentile year.") + max: Optional[int] = Field(default=None, description="The maximum percentile year.") + + +class CountByYear(OpenAlexModel): + year: Optional[int] = Field(default=None, description="The year.") + cited_by_count: int = Field(default=0, description="The citation count for the year.") + + +class SustainableDevelopmentGoal(OpenAlexModel): + id: Optional[str] = Field(default=None, description="The sustainable development goal id.") + display_name: Optional[str] = Field(default=None, description="The sustainable development goal display name.") + score: Optional[float] = Field(default=None, description="The sustainable development goal score.") + + +class Mesh(OpenAlexModel): + descriptor_ui: Optional[str] = Field(default=None, description="The descriptor UI.") + descriptor_name: Optional[str] = Field(default=None, description="The descriptor name.") + qualifier_ui: Optional[str] = Field(default=None, description="The qualifier UI.") + qualifier_name: Optional[str] = Field(default=None, description="The qualifier name.") + is_major_topic: Optional[bool] = Field(default=None, description="Whether this is a major topic.") + + +class HasContent(OpenAlexModel): + pdf: Optional[bool] = Field(default=None, description="Whether PDF content exists.") + grobid_xml: Optional[bool] = Field(default=None, description="Whether GROBID XML content exists.") + + +class Work(OpenAlexModel): + id: str = Field(description="The external id of the work.") + doi: Optional[str] = Field(default=None, description="The optional DOI of the work.") + title: Optional[str] = Field(default=None, description="The title of the work.") + display_name: Optional[str] = Field(default=None, description="The display name of the work.") + publication_year: Optional[int] = Field(default=None, description="The publication year.") + publication_date: Optional[str] = Field(default=None, description="The publication date.") + type: Optional[str] = Field(default=None, description="The work type.") + language: Optional[str] = Field(default=None, description="The work language.") + cited_by_count: int = Field(default=0, description="The number of citations.") + is_retracted: Optional[bool] = Field(default=None, description="Whether the work is retracted.") + is_paratext: Optional[bool] = Field(default=None, description="Whether the work is paratext.") + primary_location: Optional[Location] = Field(default=None, description="The primary location.") + locations: List[Location] = Field(default_factory=list, description="The work locations.") + best_oa_location: Optional[Location] = Field(default=None, description="The best open access location.") + open_access: Optional[OpenAccess] = Field(default=None, description="Open access information.") + authorships: List[Authorship] = Field(default_factory=list, description="The authorships.") + ids: Optional[WorkIds] = Field(default=None, description="External ids.") + biblio: Optional[Biblio] = Field(default=None, description="Bibliographic information.") + abstract_inverted_index: dict[str, List[int]] = Field(default_factory=dict, description="The inverted abstract index.") + referenced_works: List[str] = Field(default_factory=list, description="Referenced work ids.") + referenced_works_count: int = Field(default=0, description="The number of referenced works.") + related_works: List[str] = Field(default_factory=list, description="Related work ids.") + topics: List[Topic] = Field(default_factory=list, description="The topics.") + primary_topic: Optional[Topic] = Field(default=None, description="The primary topic.") + keywords: List[Keyword] = Field(default_factory=list, description="The keywords.") + funders: List[Funder] = Field(default_factory=list, description="The funders.") + awards: List[Award] = Field(default_factory=list, description="The awards.") + fwci: Optional[float] = Field(default=None, description="The field weighted citation impact.") + citation_normalized_percentile: Optional[CitationNormalizedPercentile] = Field(default=None, description="The normalized citation percentile.") + cited_by_percentile_year: Optional[CitedByPercentileYear] = Field(default=None, description="The cited by percentile year.") + counts_by_year: List[CountByYear] = Field(default_factory=list, description="Citation counts by year.") + sustainable_development_goals: List[SustainableDevelopmentGoal] = Field(default_factory=list, description="Sustainable development goals.") + mesh: List[Mesh] = Field(default_factory=list, description="MeSH terms.") + indexed_in: List[str] = Field(default_factory=list, description="Indexes containing the work.") + has_content: Optional[HasContent] = Field(default=None, description="Available content flags.") + content_url: Optional[str] = Field(default=None, description="The content URL.") + created_date: Optional[str] = Field(default=None, description="The creation date.") + updated_date: Optional[str] = Field(default=None, description="The last update timestamp.") + + +class WorkSummary(BaseModel): + doi: Optional[str] = Field(default=None, description="The optional DOI of the work.") + title: Optional[str] = Field(default=None, description="The title of the work.") + type: Optional[str] = Field(default=None, description="The work type.") + language: Optional[str] = Field(default=None, description="The work language.") + publication_year: Optional[int] = Field(default=None, description="The publication year.") + cited_by_count: int = Field(default=0, description="The number of citations.") + topics: List[str] = Field(default_factory=list, description="The display names of the work topics.") + + +class WorkPage(BaseModel): + elements: List[WorkSummary] = Field(default_factory=list, description="The works on this page.") + page: int = Field(default=1, description="The current page number.") + size: int = Field(default=20, description="The requested page size.") + total: int = Field(default=0, description="The total number of works.") diff --git a/service/src/main/inse/works/search_client.py b/service/src/main/inse/works/search_client.py new file mode 100644 index 00000000..3f44c810 --- /dev/null +++ b/service/src/main/inse/works/search_client.py @@ -0,0 +1,68 @@ +#!/usr/bin/env python +# -*- coding: utf-8 -*- +""" + HTTP client for the OpenAlex works Elasticsearch index. +""" +from typing import Any + +import httpx + +from .. import config + + +class MissingApiKeyError(Exception): + pass + + +class OpenAlexWorksSearchClient: + def __init__( + self, + base_url: str | None = None, + index: str | None = None, + api_key: str | None = None, + timeout: float | None = None, + transport: httpx.AsyncBaseTransport | None = None, + ): + self.base_url = (base_url or config.settings.openalex_works_search_base_url).rstrip("/") + self.index = index or config.settings.openalex_works_search_index + self.api_key = api_key if api_key is not None else config.settings.openalex_works_api_key + self.timeout = timeout if timeout is not None else config.settings.openalex_works_search_timeout_seconds + self.transport = transport + + def author_works_query(self, author_id: str, page: int, size: int) -> dict[str, Any]: + indexed_author_id = f"https://openalex.org/{author_id.strip()}" + return { + "from": (page - 1) * size, + "size": size, + "query": { + "nested": { + "path": "authorships", + "query": { + "term": { + "authorships.author.id": indexed_author_id, + }, + }, + }, + }, + "sort": [ + {"publication_year": {"order": "desc", "missing": "_last"}}, + {"cited_by_count": {"order": "desc", "missing": "_last"}}, + ], + } + + async def search_author_works(self, author_id: str, page: int, size: int) -> dict[str, Any]: + if not self.api_key: + raise MissingApiKeyError("OpenAlex works Elasticsearch API key is not configured.") + + async with httpx.AsyncClient( + base_url=self.base_url, + timeout=self.timeout, + transport=self.transport, + ) as client: + response = await client.post( + f"/{self.index}/_search", + headers={"Authorization": f"ApiKey {self.api_key}"}, + json=self.author_works_query(author_id, page, size), + ) + response.raise_for_status() + return response.json() diff --git a/service/src/main/inse/works/service.py b/service/src/main/inse/works/service.py new file mode 100644 index 00000000..98f1df0c --- /dev/null +++ b/service/src/main/inse/works/service.py @@ -0,0 +1,31 @@ +#!/usr/bin/env python +# -*- coding: utf-8 -*- +""" + REST API for publication works. +""" +from typing import Annotated + +from fastapi import APIRouter +from fastapi import Depends +from fastapi import Path +from fastapi import Query + +from .. import security +from . import logic +from . import model + + +router = APIRouter(prefix="/authors", tags=["Works"]) + + +@router.get("/{author_id}/works", + operation_id="getAuthorWorks", + response_model=model.WorkPage, + summary="Returns a page of works for an author.") +async def get_author_works( + author_id: Annotated[str, Path(description="The author id, for example A5023888391.")], + page: Annotated[int, Query(description="The page number.", ge=1)] = 1, + size: Annotated[int, Query(description="The page size.", ge=1, le=100)] = 20, + principal: security.Principal = Depends(security.roles_allowed(["SUPER_ADMIN", "UNI_ADMIN"])), +): + return await logic.get_author_works(author_id, page, size) diff --git a/service/src/main/inse/works/test_openalex_logic.py b/service/src/main/inse/works/test_openalex_logic.py new file mode 100644 index 00000000..646be283 --- /dev/null +++ b/service/src/main/inse/works/test_openalex_logic.py @@ -0,0 +1,103 @@ +import httpx +import pytest +from fastapi import HTTPException + +from inse.works import logic +from inse.works.search_client import OpenAlexWorksSearchClient + + +@pytest.fixture +def anyio_backend(): + return "asyncio" + + +@pytest.mark.anyio +async def test_get_author_works_maps_elasticsearch_response_to_work_page(): + def handler(request: httpx.Request) -> httpx.Response: + return httpx.Response( + 200, + json={ + "hits": { + "total": {"value": 1}, + "hits": [ + { + "_source": { + "id": "https://openalex.org/W2741809807", + "doi": "https://doi.org/10.7717/peerj.4375", + "display_name": "Example work", + "type": "article", + "language": "en", + "publication_year": 2023, + "cited_by_count": 42, + "topics": [ + { + "id": "https://openalex.org/T10102", + "display_name": "Machine learning", + "score": 0.91, + } + ], + "primary_location": { + "source": { + "id": "https://openalex.org/S123", + "display_name": "Example Source", + "issn": None, + } + }, + "authorships": [ + { + "author": { + "id": "https://openalex.org/A5023888391", + "display_name": "Example Author", + } + } + ], + } + } + ], + }, + }, + ) + + client = OpenAlexWorksSearchClient( + base_url="https://project.nes.uni-due.de/elastic", + api_key="test-key", + transport=httpx.MockTransport(handler), + ) + + page = await logic.get_author_works("A5023888391", page=1, size=20, client=client) + + assert page.total == 1 + assert page.elements[0].doi == "https://doi.org/10.7717/peerj.4375" + assert page.elements[0].title == "Example work" + assert page.elements[0].type == "article" + assert page.elements[0].language == "en" + assert page.elements[0].publication_year == 2023 + assert page.elements[0].cited_by_count == 42 + assert page.elements[0].topics == ["Machine learning"] + + +@pytest.mark.anyio +async def test_get_author_works_maps_missing_api_key_to_service_unavailable(): + client = OpenAlexWorksSearchClient(api_key="") + + with pytest.raises(HTTPException) as exc: + await logic.get_author_works("A5023888391", page=1, size=20, client=client) + + assert exc.value.status_code == 503 + + +@pytest.mark.anyio +async def test_get_author_works_maps_elasticsearch_errors_to_bad_gateway(): + def handler(request: httpx.Request) -> httpx.Response: + return httpx.Response(500, json={"error": "upstream failed"}) + + client = OpenAlexWorksSearchClient( + base_url="https://project.nes.uni-due.de/elastic", + api_key="test-key", + transport=httpx.MockTransport(handler), + ) + + with pytest.raises(HTTPException) as exc: + await logic.get_author_works("A5023888391", page=1, size=20, client=client) + + assert exc.value.status_code == 502 diff --git a/service/src/main/inse/works/test_search_client.py b/service/src/main/inse/works/test_search_client.py new file mode 100644 index 00000000..79d8b332 --- /dev/null +++ b/service/src/main/inse/works/test_search_client.py @@ -0,0 +1,49 @@ +import httpx +import pytest + +from inse.works.search_client import MissingApiKeyError +from inse.works.search_client import OpenAlexWorksSearchClient + + +@pytest.fixture +def anyio_backend(): + return "asyncio" + + +def test_author_works_query_searches_authorship_author_id(): + client = OpenAlexWorksSearchClient(api_key="test-key") + + query = client.author_works_query("A5023888391", page=2, size=25) + + assert query["from"] == 25 + assert query["size"] == 25 + assert query["query"]["nested"]["path"] == "authorships" + assert query["query"]["nested"]["query"]["term"]["authorships.author.id"] == "https://openalex.org/A5023888391" + + +@pytest.mark.anyio +async def test_search_author_works_calls_elasticsearch_index_with_api_key(): + def handler(request: httpx.Request) -> httpx.Response: + assert request.method == "POST" + assert request.url.path == "/elastic/openalex-works/_search" + assert request.headers["Authorization"] == "ApiKey test-key" + return httpx.Response(200, json={"hits": {"total": {"value": 0}, "hits": []}}) + + client = OpenAlexWorksSearchClient( + base_url="https://project.nes.uni-due.de/elastic", + index="openalex-works", + api_key="test-key", + transport=httpx.MockTransport(handler), + ) + + result = await client.search_author_works("A5023888391", page=1, size=20) + + assert result == {"hits": {"total": {"value": 0}, "hits": []}} + + +@pytest.mark.anyio +async def test_search_author_works_requires_api_key(): + client = OpenAlexWorksSearchClient(api_key="") + + with pytest.raises(MissingApiKeyError): + await client.search_author_works("A5023888391", page=1, size=20) diff --git a/service/src/main/inse/works/test_service.py b/service/src/main/inse/works/test_service.py new file mode 100644 index 00000000..4435d36f --- /dev/null +++ b/service/src/main/inse/works/test_service.py @@ -0,0 +1,53 @@ +from fastapi.testclient import TestClient + +from inse import config +from inse.works import logic +from inse.works import model +from inse.main import app + + +client = TestClient(app) + + +def test_get_author_works_returns_page(monkeypatch): + config.settings.auth_disabled = True + + async def fake_get_author_works(author_id: str, page: int, size: int): + assert author_id == "A5023888391" + assert page == 2 + assert size == 5 + return model.WorkPage( + elements=[ + model.WorkSummary( + doi="https://doi.org/10.7717/peerj.4375", + title="Example work", + type="article", + language="en", + publication_year=2023, + cited_by_count=42, + topics=["Machine learning"], + ) + ], + page=page, + size=size, + total=1, + ) + + monkeypatch.setattr(logic, "get_author_works", fake_get_author_works) + + response = client.get("/inse-service/authors/A5023888391/works?page=2&size=5") + + assert response.status_code == 200 + data = response.json() + assert data["page"] == 2 + assert data["size"] == 5 + assert data["total"] == 1 + assert data["elements"][0] == { + "doi": "https://doi.org/10.7717/peerj.4375", + "title": "Example work", + "type": "article", + "language": "en", + "publication_year": 2023, + "cited_by_count": 42, + "topics": ["Machine learning"], + } From 48c5c376bcc7e4b45f7fc47b9556b1cc3ab2f75e Mon Sep 17 00:00:00 2001 From: Farajollahi Date: Wed, 27 May 2026 19:21:05 +0200 Subject: [PATCH 02/16] implement openapi --- service/build.gradle | 24 +- webapp/README.md | 18 + webapp/build.gradle | 7 +- webapp/openapi-generator-ignore | 8 + webapp/openapitools.json | 22 + webapp/package-lock.json | 1462 +++++++++++++++++ webapp/package.json | 2 + webapp/src/app/api/.gitignore | 4 + webapp/src/app/api/.openapi-generator-ignore | 23 + webapp/src/app/api/.openapi-generator/FILES | 31 + webapp/src/app/api/.openapi-generator/VERSION | 1 + webapp/src/app/api/README.md | 185 +++ webapp/src/app/api/api.base.service.ts | 83 + webapp/src/app/api/api.module.ts | 30 + webapp/src/app/api/api/api.ts | 10 + webapp/src/app/api/api/items.service.ts | 366 +++++ .../src/app/api/api/items.serviceInterface.ts | 70 + webapp/src/app/api/api/persons.service.ts | 165 ++ .../app/api/api/persons.serviceInterface.ts | 44 + webapp/src/app/api/api/works.service.ts | 110 ++ .../src/app/api/api/works.serviceInterface.ts | 36 + webapp/src/app/api/configuration.ts | 193 +++ webapp/src/app/api/encoder.ts | 20 + webapp/src/app/api/git_push.sh | 57 + webapp/src/app/api/index.ts | 7 + webapp/src/app/api/model/affiliation.ts | 19 + .../app/api/model/http-validation-error.ts | 16 + webapp/src/app/api/model/item-create.ts | 22 + webapp/src/app/api/model/item-page.ts | 31 + webapp/src/app/api/model/item.ts | 26 + webapp/src/app/api/model/models.ts | 12 + webapp/src/app/api/model/person-bio.ts | 18 + .../src/app/api/model/person-search-result.ts | 19 + webapp/src/app/api/model/person.ts | 39 + .../api/model/validation-error-loc-inner.ts | 14 + webapp/src/app/api/model/validation-error.ts | 18 + webapp/src/app/api/model/work-page.ts | 31 + webapp/src/app/api/model/work-summary.ts | 27 + webapp/src/app/api/param.ts | 69 + webapp/src/app/api/provide-api.ts | 15 + webapp/src/app/api/variables.ts | 9 + webapp/src/app/app.config.ts | 3 +- .../person-publications.component.html | 4 +- .../person-publications.component.ts | 9 +- .../src/app/services/publications.service.ts | 33 +- 45 files changed, 3376 insertions(+), 36 deletions(-) create mode 100644 webapp/openapi-generator-ignore create mode 100644 webapp/openapitools.json create mode 100644 webapp/src/app/api/.gitignore create mode 100644 webapp/src/app/api/.openapi-generator-ignore create mode 100644 webapp/src/app/api/.openapi-generator/FILES create mode 100644 webapp/src/app/api/.openapi-generator/VERSION create mode 100644 webapp/src/app/api/README.md create mode 100644 webapp/src/app/api/api.base.service.ts create mode 100644 webapp/src/app/api/api.module.ts create mode 100644 webapp/src/app/api/api/api.ts create mode 100644 webapp/src/app/api/api/items.service.ts create mode 100644 webapp/src/app/api/api/items.serviceInterface.ts create mode 100644 webapp/src/app/api/api/persons.service.ts create mode 100644 webapp/src/app/api/api/persons.serviceInterface.ts create mode 100644 webapp/src/app/api/api/works.service.ts create mode 100644 webapp/src/app/api/api/works.serviceInterface.ts create mode 100644 webapp/src/app/api/configuration.ts create mode 100644 webapp/src/app/api/encoder.ts create mode 100644 webapp/src/app/api/git_push.sh create mode 100644 webapp/src/app/api/index.ts create mode 100644 webapp/src/app/api/model/affiliation.ts create mode 100644 webapp/src/app/api/model/http-validation-error.ts create mode 100644 webapp/src/app/api/model/item-create.ts create mode 100644 webapp/src/app/api/model/item-page.ts create mode 100644 webapp/src/app/api/model/item.ts create mode 100644 webapp/src/app/api/model/models.ts create mode 100644 webapp/src/app/api/model/person-bio.ts create mode 100644 webapp/src/app/api/model/person-search-result.ts create mode 100644 webapp/src/app/api/model/person.ts create mode 100644 webapp/src/app/api/model/validation-error-loc-inner.ts create mode 100644 webapp/src/app/api/model/validation-error.ts create mode 100644 webapp/src/app/api/model/work-page.ts create mode 100644 webapp/src/app/api/model/work-summary.ts create mode 100644 webapp/src/app/api/param.ts create mode 100644 webapp/src/app/api/provide-api.ts create mode 100644 webapp/src/app/api/variables.ts diff --git a/service/build.gradle b/service/build.gradle index 5ec0515b..f05e4027 100644 --- a/service/build.gradle +++ b/service/build.gradle @@ -12,6 +12,28 @@ task test(type: Exec) { ignoreExitValue false } +task exportOpenApiSpec(type: Exec) { + dependsOn createImage + def openApiDir = layout.buildDirectory.dir('openapi').get().asFile + def openApiFile = new File(openApiDir, 'inse-service.openapi.json') + inputs.dir file('src/main/inse') + outputs.file openApiFile + doFirst { + openApiDir.mkdirs() + } + commandLine 'docker', 'run', '--rm', + '--platform', "${targetPlatform}", + '-w', '/home', + '-v', "${projectDir}/src/main:/home", + '-v', "${openApiDir}:/mnt/openapi", + '-e', "DOCKER_DEFAULT_PLATFORM='${targetPlatform}'", + '--name', "${imageName}-service-openapi", + '--entrypoint', 'python', + "${imagePrefix}-service:${imageVersion}", + '-c', + 'import json; from inse.service import app; open("/mnt/openapi/inse-service.openapi.json", "w").write(json.dumps(app.openapi(), indent=2))' +} + task runServeContainer(type: Exec) { dependsOn createImage commandLine 'docker', 'run', '--rm', '-v', "${projectDir}/src/main:/home", '-v', "${projectDir}/src/data:/data", '-p', '8000:8000', '-e', "DOCKER_DEFAULT_PLATFORM='${targetPlatform}'", '-e', "INSE_AUTH_STANDALONE=true", '-e', 'INSE_OPENALEX_WORKS_API_KEY', '--name', "${imageName}-service-serve", '--detach', "${imagePrefix}-service:${imageVersion}", 'run', '--reload', '--reload-dir', './inse' @@ -47,5 +69,5 @@ task serve(type: Task) { } build { - dependsOn createImage, test + dependsOn createImage, exportOpenApiSpec, test } diff --git a/webapp/README.md b/webapp/README.md index a912690b..f1a13348 100644 --- a/webapp/README.md +++ b/webapp/README.md @@ -6,6 +6,24 @@ Angular 18 single-page application with Angular Material. Run `npm start` for a dev server at `http://localhost:4200/`. The application will automatically reload on file changes. +## OpenAPI Client + +Gradle exports the backend OpenAPI schema from the FastAPI app and generates the Angular client from that schema: + +```bash +../gradlew :webapp:generateOpenApiClient +``` + +The generated client is written to `src/app/api`. The schema file is written to `../service/build/openapi/inse-service.openapi.json`. + +If the schema was already exported, the npm script can regenerate only the frontend client: + +```bash +npm run generate:api +``` + +Use the generated services for new backend endpoints so request models, response models, and operation names stay aligned with the FastAPI OpenAPI schema. + ## Build Run `ng build` to build the project. The build artifacts will be stored in the `dist/` directory. diff --git a/webapp/build.gradle b/webapp/build.gradle index 1e2e658d..7c3a7eea 100644 --- a/webapp/build.gradle +++ b/webapp/build.gradle @@ -25,6 +25,12 @@ task serve(type: NodeTask) { args = ['serve', '--configuration', 'development', '--proxy-config', 'src/proxy.conf.json', '--open'] workingDir = projectDir } + +task generateOpenApiClient(type: Exec) { + dependsOn ':service:exportOpenApiSpec' + commandLine 'npm', 'run', 'generate:api' + workingDir = projectDir +} build { dependsOn ngBuild @@ -33,4 +39,3 @@ build { clean { dependsOn cleanNgBuild } - diff --git a/webapp/openapi-generator-ignore b/webapp/openapi-generator-ignore new file mode 100644 index 00000000..44ab4450 --- /dev/null +++ b/webapp/openapi-generator-ignore @@ -0,0 +1,8 @@ +.gitignore +.npmignore +.openapi-generator-ignore +README.md +git_push.sh +package.json +ng-package.json +tsconfig.json diff --git a/webapp/openapitools.json b/webapp/openapitools.json new file mode 100644 index 00000000..061602d3 --- /dev/null +++ b/webapp/openapitools.json @@ -0,0 +1,22 @@ +{ + "$schema": "node_modules/@openapitools/openapi-generator-cli/config.schema.json", + "generator-cli": { + "version": "7.17.0", + "generators": { + "inse-service": { + "generatorName": "typescript-angular", + "inputSpec": "../service/build/openapi/inse-service.openapi.json", + "output": "src/app/api", + "ignoreFileOverride": "openapi-generator-ignore", + "additionalProperties": { + "ngVersion": "21.2.14", + "providedInRoot": true, + "serviceSuffix": "OpenApiService", + "withInterfaces": true, + "enumPropertyNaming": "original", + "fileNaming": "kebab-case" + } + } + } + } +} diff --git a/webapp/package-lock.json b/webapp/package-lock.json index 3426a8fe..b22aea70 100644 --- a/webapp/package-lock.json +++ b/webapp/package-lock.json @@ -28,6 +28,7 @@ "@angular/build": "^21.2.12", "@angular/cli": "^21.2.12", "@angular/compiler-cli": "^21.2.14", + "@openapitools/openapi-generator-cli": "^2.34.0", "@types/jasmine": "~5.1.0", "jasmine-core": "~5.1.0", "karma": "~6.4.0", @@ -1243,6 +1244,17 @@ "node": ">=6.9.0" } }, + "node_modules/@borewit/text-codec": { + "version": "0.2.2", + "resolved": "https://registry.npmjs.org/@borewit/text-codec/-/text-codec-0.2.2.tgz", + "integrity": "sha512-DDaRehssg1aNrH4+2hnj1B7vnUGEjU6OIlyRdkMd0aUdIUvKXrJfXsy8LVtXAy7DRvYVluWbMspsRhz2lcW0mQ==", + "dev": true, + "license": "MIT", + "funding": { + "type": "github", + "url": "https://github.com/sponsors/Borewit" + } + }, "node_modules/@colors/colors": { "version": "1.5.0", "resolved": "https://registry.npmjs.org/@colors/colors/-/colors-1.5.0.tgz", @@ -2315,6 +2327,16 @@ "win32" ] }, + "node_modules/@lukeed/csprng": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/@lukeed/csprng/-/csprng-1.1.0.tgz", + "integrity": "sha512-Z7C/xXCiGWsg0KuKsHTKJxbWhpI3Vs5GwLfOean7MGyVFGqdRgBbAjOCh6u4bbjPc/8MJ2pZmK/0DLdCbivLDA==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=8" + } + }, "node_modules/@modelcontextprotocol/sdk": { "version": "1.26.0", "resolved": "https://registry.npmjs.org/@modelcontextprotocol/sdk/-/sdk-1.26.0.tgz", @@ -2815,6 +2837,92 @@ "@emnapi/runtime": "^1.7.1" } }, + "node_modules/@nestjs/axios": { + "version": "4.0.1", + "resolved": "https://registry.npmjs.org/@nestjs/axios/-/axios-4.0.1.tgz", + "integrity": "sha512-68pFJgu+/AZbWkGu65Z3r55bTsCPlgyKaV4BSG8yUAD72q1PPuyVRgUwFv6BxdnibTUHlyxm06FmYWNC+bjN7A==", + "dev": true, + "license": "MIT", + "peerDependencies": { + "@nestjs/common": "^10.0.0 || ^11.0.0", + "axios": "^1.3.1", + "rxjs": "^7.0.0" + } + }, + "node_modules/@nestjs/common": { + "version": "11.1.21", + "resolved": "https://registry.npmjs.org/@nestjs/common/-/common-11.1.21.tgz", + "integrity": "sha512-YV1HYDGsm2rnR0vrLKidtrG6jYX5yqiIjeur1j8++dKGqhhsJ6cjMs0RfQRSTUH7IjgDemA59/znQ8nRrE0D9g==", + "dev": true, + "license": "MIT", + "dependencies": { + "file-type": "21.3.4", + "iterare": "1.2.1", + "load-esm": "1.0.3", + "tslib": "2.8.1", + "uid": "2.0.2" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/nest" + }, + "peerDependencies": { + "class-transformer": ">=0.4.1", + "class-validator": ">=0.13.2", + "reflect-metadata": "^0.1.12 || ^0.2.0", + "rxjs": "^7.1.0" + }, + "peerDependenciesMeta": { + "class-transformer": { + "optional": true + }, + "class-validator": { + "optional": true + } + } + }, + "node_modules/@nestjs/core": { + "version": "11.1.21", + "resolved": "https://registry.npmjs.org/@nestjs/core/-/core-11.1.21.tgz", + "integrity": "sha512-fqo0BHgny3MOuAL8GSfG3ZUKFVVBaBQD/0iyibnwTONT5vPexjQxJzu+945iloVvBDmrnAaRWxC1gqCDEs/AXQ==", + "dev": true, + "hasInstallScript": true, + "license": "MIT", + "dependencies": { + "@nuxt/opencollective": "0.4.1", + "fast-safe-stringify": "2.1.1", + "iterare": "1.2.1", + "path-to-regexp": "8.4.2", + "tslib": "2.8.1", + "uid": "2.0.2" + }, + "engines": { + "node": ">= 20" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/nest" + }, + "peerDependencies": { + "@nestjs/common": "^11.0.0", + "@nestjs/microservices": "^11.0.0", + "@nestjs/platform-express": "^11.0.0", + "@nestjs/websockets": "^11.0.0", + "reflect-metadata": "^0.1.12 || ^0.2.0", + "rxjs": "^7.1.0" + }, + "peerDependenciesMeta": { + "@nestjs/microservices": { + "optional": true + }, + "@nestjs/platform-express": { + "optional": true + }, + "@nestjs/websockets": { + "optional": true + } + } + }, "node_modules/@npmcli/agent": { "version": "4.0.0", "resolved": "https://registry.npmjs.org/@npmcli/agent/-/agent-4.0.0.tgz", @@ -3080,6 +3188,385 @@ "node": "^20.17.0 || >=22.9.0" } }, + "node_modules/@nuxt/opencollective": { + "version": "0.4.1", + "resolved": "https://registry.npmjs.org/@nuxt/opencollective/-/opencollective-0.4.1.tgz", + "integrity": "sha512-GXD3wy50qYbxCJ652bDrDzgMr3NFEkIS374+IgFQKkCvk9yiYcLvX2XDYr7UyQxf4wK0e+yqDYRubZ0DtOxnmQ==", + "dev": true, + "license": "MIT", + "dependencies": { + "consola": "^3.2.3" + }, + "bin": { + "opencollective": "bin/opencollective.js" + }, + "engines": { + "node": "^14.18.0 || >=16.10.0", + "npm": ">=5.10.0" + } + }, + "node_modules/@nuxtjs/opencollective": { + "version": "0.3.2", + "resolved": "https://registry.npmjs.org/@nuxtjs/opencollective/-/opencollective-0.3.2.tgz", + "integrity": "sha512-um0xL3fO7Mf4fDxcqx9KryrB7zgRM5JSlvGN5AGkP6JLM5XEKyjeAiPbNxdXVXQ16isuAhYpvP88NgL2BGd6aA==", + "dev": true, + "license": "MIT", + "dependencies": { + "chalk": "^4.1.0", + "consola": "^2.15.0", + "node-fetch": "^2.6.1" + }, + "bin": { + "opencollective": "bin/opencollective.js" + }, + "engines": { + "node": ">=8.0.0", + "npm": ">=5.0.0" + } + }, + "node_modules/@nuxtjs/opencollective/node_modules/ansi-styles": { + "version": "4.3.0", + "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-4.3.0.tgz", + "integrity": "sha512-zbB9rCJAT1rbjiVDb2hqKFHNYLxgtk8NURxZ3IZwD3F6NtxbXZQCnnSi1Lkx+IDohdPlFp222wVALIheZJQSEg==", + "dev": true, + "license": "MIT", + "dependencies": { + "color-convert": "^2.0.1" + }, + "engines": { + "node": ">=8" + }, + "funding": { + "url": "https://github.com/chalk/ansi-styles?sponsor=1" + } + }, + "node_modules/@nuxtjs/opencollective/node_modules/chalk": { + "version": "4.1.2", + "resolved": "https://registry.npmjs.org/chalk/-/chalk-4.1.2.tgz", + "integrity": "sha512-oKnbhFyRIXpUuez8iBMmyEa4nbj4IOQyuhc/wy9kY7/WVPcwIO9VA668Pu8RkO7+0G76SLROeyw9CpQ061i4mA==", + "dev": true, + "license": "MIT", + "dependencies": { + "ansi-styles": "^4.1.0", + "supports-color": "^7.1.0" + }, + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/chalk/chalk?sponsor=1" + } + }, + "node_modules/@nuxtjs/opencollective/node_modules/consola": { + "version": "2.15.3", + "resolved": "https://registry.npmjs.org/consola/-/consola-2.15.3.tgz", + "integrity": "sha512-9vAdYbHj6x2fLKC4+oPH0kFzY/orMZyG2Aj+kNylHxKGJ/Ed4dpNyAQYwJOdqO4zdM7XpVHmyejQDcQHrnuXbw==", + "dev": true, + "license": "MIT" + }, + "node_modules/@nuxtjs/opencollective/node_modules/supports-color": { + "version": "7.2.0", + "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-7.2.0.tgz", + "integrity": "sha512-qpCAvRl9stuOHveKsn7HncJRvv501qIacKzQlO/+Lwxc9+0q2wLyv4Dfvt80/DPn2pqOBsJdDiogXGR9+OvwRw==", + "dev": true, + "license": "MIT", + "dependencies": { + "has-flag": "^4.0.0" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/@openapitools/openapi-generator-cli": { + "version": "2.34.0", + "resolved": "https://registry.npmjs.org/@openapitools/openapi-generator-cli/-/openapi-generator-cli-2.34.0.tgz", + "integrity": "sha512-Z6400REeiq16xkRrdKgtv8nY3xy0DhUnc42DIT5rWjzoj7l4qn+MwqsOqUVJ5UwOF9VUBQGKN7jrDaEkKfj3kQ==", + "dev": true, + "hasInstallScript": true, + "license": "Apache-2.0", + "dependencies": { + "@inquirer/select": "1.3.3", + "@nestjs/axios": "4.0.1", + "@nestjs/common": "11.1.21", + "@nestjs/core": "11.1.21", + "@nuxtjs/opencollective": "0.3.2", + "axios": "^1.16.1", + "chalk": "4.1.2", + "commander": "8.3.0", + "compare-versions": "6.1.1", + "concurrently": "9.2.1", + "console.table": "0.10.0", + "fs-extra": "11.3.5", + "glob": "13.0.6", + "proxy-agent": "8.0.1", + "reflect-metadata": "0.2.2", + "rxjs": "7.8.2", + "tslib": "2.8.1" + }, + "bin": { + "openapi-generator-cli": "main.js" + }, + "engines": { + "node": ">=20.19.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/openapi_generator" + } + }, + "node_modules/@openapitools/openapi-generator-cli/node_modules/@inquirer/core": { + "version": "6.0.0", + "resolved": "https://registry.npmjs.org/@inquirer/core/-/core-6.0.0.tgz", + "integrity": "sha512-fKi63Khkisgda3ohnskNf5uZJj+zXOaBvOllHsOkdsXRA/ubQLJQrZchFFi57NKbZzkTunXiBMdvWOv71alonw==", + "dev": true, + "license": "MIT", + "dependencies": { + "@inquirer/type": "^1.1.6", + "@types/mute-stream": "^0.0.4", + "@types/node": "^20.10.7", + "@types/wrap-ansi": "^3.0.0", + "ansi-escapes": "^4.3.2", + "chalk": "^4.1.2", + "cli-spinners": "^2.9.2", + "cli-width": "^4.1.0", + "figures": "^3.2.0", + "mute-stream": "^1.0.0", + "run-async": "^3.0.0", + "signal-exit": "^4.1.0", + "strip-ansi": "^6.0.1", + "wrap-ansi": "^6.2.0" + }, + "engines": { + "node": ">=14.18.0" + } + }, + "node_modules/@openapitools/openapi-generator-cli/node_modules/@inquirer/select": { + "version": "1.3.3", + "resolved": "https://registry.npmjs.org/@inquirer/select/-/select-1.3.3.tgz", + "integrity": "sha512-RzlRISXWqIKEf83FDC9ZtJ3JvuK1l7aGpretf41BCWYrvla2wU8W8MTRNMiPrPJ+1SIqrRC1nZdZ60hD9hRXLg==", + "dev": true, + "license": "MIT", + "dependencies": { + "@inquirer/core": "^6.0.0", + "@inquirer/type": "^1.1.6", + "ansi-escapes": "^4.3.2", + "chalk": "^4.1.2", + "figures": "^3.2.0" + }, + "engines": { + "node": ">=14.18.0" + } + }, + "node_modules/@openapitools/openapi-generator-cli/node_modules/@inquirer/type": { + "version": "1.5.5", + "resolved": "https://registry.npmjs.org/@inquirer/type/-/type-1.5.5.tgz", + "integrity": "sha512-MzICLu4yS7V8AA61sANROZ9vT1H3ooca5dSmI1FjZkzq7o/koMsRfQSzRtFo+F3Ao4Sf1C0bpLKejpKB/+j6MA==", + "dev": true, + "license": "MIT", + "dependencies": { + "mute-stream": "^1.0.0" + }, + "engines": { + "node": ">=18" + } + }, + "node_modules/@openapitools/openapi-generator-cli/node_modules/@types/node": { + "version": "20.19.41", + "resolved": "https://registry.npmjs.org/@types/node/-/node-20.19.41.tgz", + "integrity": "sha512-ECymXOukMnOoVkC2bb1Vc/w/836DXncOg5m8Xj1RH7xSHZJWNYY6Zh7EH477vcnD5egKNNfy2RpNOmuChhFPgQ==", + "dev": true, + "license": "MIT", + "dependencies": { + "undici-types": "~6.21.0" + } + }, + "node_modules/@openapitools/openapi-generator-cli/node_modules/ansi-escapes": { + "version": "4.3.2", + "resolved": "https://registry.npmjs.org/ansi-escapes/-/ansi-escapes-4.3.2.tgz", + "integrity": "sha512-gKXj5ALrKWQLsYG9jlTRmR/xKluxHV+Z9QEwNIgCfM1/uwPMCuzVVnh5mwTd+OuBZcwSIMbqssNWRm1lE51QaQ==", + "dev": true, + "license": "MIT", + "dependencies": { + "type-fest": "^0.21.3" + }, + "engines": { + "node": ">=8" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/@openapitools/openapi-generator-cli/node_modules/ansi-styles": { + "version": "4.3.0", + "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-4.3.0.tgz", + "integrity": "sha512-zbB9rCJAT1rbjiVDb2hqKFHNYLxgtk8NURxZ3IZwD3F6NtxbXZQCnnSi1Lkx+IDohdPlFp222wVALIheZJQSEg==", + "dev": true, + "license": "MIT", + "dependencies": { + "color-convert": "^2.0.1" + }, + "engines": { + "node": ">=8" + }, + "funding": { + "url": "https://github.com/chalk/ansi-styles?sponsor=1" + } + }, + "node_modules/@openapitools/openapi-generator-cli/node_modules/balanced-match": { + "version": "4.0.4", + "resolved": "https://registry.npmjs.org/balanced-match/-/balanced-match-4.0.4.tgz", + "integrity": "sha512-BLrgEcRTwX2o6gGxGOCNyMvGSp35YofuYzw9h1IMTRmKqttAZZVU67bdb9Pr2vUHA8+j3i2tJfjO6C6+4myGTA==", + "dev": true, + "license": "MIT", + "engines": { + "node": "18 || 20 || >=22" + } + }, + "node_modules/@openapitools/openapi-generator-cli/node_modules/brace-expansion": { + "version": "5.0.6", + "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-5.0.6.tgz", + "integrity": "sha512-kLpxurY4Z4r9sgMsyG0Z9uzsBlgiU/EFKhj/h91/8yHu0edo7XuixOIH3VcJ8kkxs6/jPzoI6U9Vj3WqbMQ94g==", + "dev": true, + "license": "MIT", + "dependencies": { + "balanced-match": "^4.0.2" + }, + "engines": { + "node": "18 || 20 || >=22" + } + }, + "node_modules/@openapitools/openapi-generator-cli/node_modules/chalk": { + "version": "4.1.2", + "resolved": "https://registry.npmjs.org/chalk/-/chalk-4.1.2.tgz", + "integrity": "sha512-oKnbhFyRIXpUuez8iBMmyEa4nbj4IOQyuhc/wy9kY7/WVPcwIO9VA668Pu8RkO7+0G76SLROeyw9CpQ061i4mA==", + "dev": true, + "license": "MIT", + "dependencies": { + "ansi-styles": "^4.1.0", + "supports-color": "^7.1.0" + }, + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/chalk/chalk?sponsor=1" + } + }, + "node_modules/@openapitools/openapi-generator-cli/node_modules/cli-spinners": { + "version": "2.9.2", + "resolved": "https://registry.npmjs.org/cli-spinners/-/cli-spinners-2.9.2.tgz", + "integrity": "sha512-ywqV+5MmyL4E7ybXgKys4DugZbX0FC6LnwrhjuykIjnK9k8OQacQ7axGKnjDXWNhns0xot3bZI5h55H8yo9cJg==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=6" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/@openapitools/openapi-generator-cli/node_modules/fs-extra": { + "version": "11.3.5", + "resolved": "https://registry.npmjs.org/fs-extra/-/fs-extra-11.3.5.tgz", + "integrity": "sha512-eKpRKAovdpZtR1WopLHxlBWvAgPny3c4gX1G5Jhwmmw4XJj0ifSD5qB5TOo8hmA0wlRKDAOAhEE1yVPgs6Fgcg==", + "dev": true, + "license": "MIT", + "dependencies": { + "graceful-fs": "^4.2.0", + "jsonfile": "^6.0.1", + "universalify": "^2.0.0" + }, + "engines": { + "node": ">=14.14" + } + }, + "node_modules/@openapitools/openapi-generator-cli/node_modules/glob": { + "version": "13.0.6", + "resolved": "https://registry.npmjs.org/glob/-/glob-13.0.6.tgz", + "integrity": "sha512-Wjlyrolmm8uDpm/ogGyXZXb1Z+Ca2B8NbJwqBVg0axK9GbBeoS7yGV6vjXnYdGm6X53iehEuxxbyiKp8QmN4Vw==", + "dev": true, + "license": "BlueOak-1.0.0", + "dependencies": { + "minimatch": "^10.2.2", + "minipass": "^7.1.3", + "path-scurry": "^2.0.2" + }, + "engines": { + "node": "18 || 20 || >=22" + }, + "funding": { + "url": "https://github.com/sponsors/isaacs" + } + }, + "node_modules/@openapitools/openapi-generator-cli/node_modules/jsonfile": { + "version": "6.2.1", + "resolved": "https://registry.npmjs.org/jsonfile/-/jsonfile-6.2.1.tgz", + "integrity": "sha512-zwOTdL3rFQ/lRdBnntKVOX6k5cKJwEc1HdilT71BWEu7J41gXIB2MRp+vxduPSwZJPWBxEzv4yH1wYLJGUHX4Q==", + "dev": true, + "license": "MIT", + "dependencies": { + "universalify": "^2.0.0" + }, + "optionalDependencies": { + "graceful-fs": "^4.1.6" + } + }, + "node_modules/@openapitools/openapi-generator-cli/node_modules/minimatch": { + "version": "10.2.5", + "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-10.2.5.tgz", + "integrity": "sha512-MULkVLfKGYDFYejP07QOurDLLQpcjk7Fw+7jXS2R2czRQzR56yHRveU5NDJEOviH+hETZKSkIk5c+T23GjFUMg==", + "dev": true, + "license": "BlueOak-1.0.0", + "dependencies": { + "brace-expansion": "^5.0.5" + }, + "engines": { + "node": "18 || 20 || >=22" + }, + "funding": { + "url": "https://github.com/sponsors/isaacs" + } + }, + "node_modules/@openapitools/openapi-generator-cli/node_modules/mute-stream": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/mute-stream/-/mute-stream-1.0.0.tgz", + "integrity": "sha512-avsJQhyd+680gKXyG/sQc0nXaC6rBkPOfyHYcFb9+hdkqQkR9bdnkJ0AMZhke0oesPqIO+mFFJ+IdBc7mst4IA==", + "dev": true, + "license": "ISC", + "engines": { + "node": "^14.17.0 || ^16.13.0 || >=18.0.0" + } + }, + "node_modules/@openapitools/openapi-generator-cli/node_modules/supports-color": { + "version": "7.2.0", + "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-7.2.0.tgz", + "integrity": "sha512-qpCAvRl9stuOHveKsn7HncJRvv501qIacKzQlO/+Lwxc9+0q2wLyv4Dfvt80/DPn2pqOBsJdDiogXGR9+OvwRw==", + "dev": true, + "license": "MIT", + "dependencies": { + "has-flag": "^4.0.0" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/@openapitools/openapi-generator-cli/node_modules/undici-types": { + "version": "6.21.0", + "resolved": "https://registry.npmjs.org/undici-types/-/undici-types-6.21.0.tgz", + "integrity": "sha512-iwDZqg0QAGrg9Rav5H4n0M64c3mkR59cJ6wQp+7C4nI0gsmExaedaYLNO44eT4AtBBwjbTiGPMlt2Md0T9H9JQ==", + "dev": true, + "license": "MIT" + }, + "node_modules/@openapitools/openapi-generator-cli/node_modules/universalify": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/universalify/-/universalify-2.0.1.tgz", + "integrity": "sha512-gptHNQghINnc/vTGIk0SOFGFNXw7JVrlRUtConJRlvaw6DuX0wO5Jeko9sWrMBhh+PsYAZ7oXAiOnf/UKogyiw==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">= 10.0.0" + } + }, "node_modules/@oxc-project/types": { "version": "0.113.0", "resolved": "https://registry.npmjs.org/@oxc-project/types/-/types-0.113.0.tgz", @@ -4182,6 +4669,31 @@ "integrity": "sha512-l2aFy5jALhniG5HgqrD6jXLi/rUWrKvqN/qJx6yoJsgKhblVd+iqqU4RCXavm/jPityDo5TCvKMnpjKnOriy0w==", "license": "MIT" }, + "node_modules/@tokenizer/inflate": { + "version": "0.4.1", + "resolved": "https://registry.npmjs.org/@tokenizer/inflate/-/inflate-0.4.1.tgz", + "integrity": "sha512-2mAv+8pkG6GIZiF1kNg1jAjh27IDxEPKwdGul3snfztFerfPGI1LjDezZp3i7BElXompqEtPmoPx6c2wgtWsOA==", + "dev": true, + "license": "MIT", + "dependencies": { + "debug": "^4.4.3", + "token-types": "^6.1.1" + }, + "engines": { + "node": ">=18" + }, + "funding": { + "type": "github", + "url": "https://github.com/sponsors/Borewit" + } + }, + "node_modules/@tokenizer/token": { + "version": "0.3.0", + "resolved": "https://registry.npmjs.org/@tokenizer/token/-/token-0.3.0.tgz", + "integrity": "sha512-OvjF+z51L3ov0OyAU0duzsYuvO01PH7x4t6DJx+guahgTnBHkhJdG7soQeTSFLWN3efnHyibZ4Z8l2EuWwJN3A==", + "dev": true, + "license": "MIT" + }, "node_modules/@tufjs/canonical-json": { "version": "2.0.0", "resolved": "https://registry.npmjs.org/@tufjs/canonical-json/-/canonical-json-2.0.0.tgz", @@ -4279,6 +4791,16 @@ "integrity": "sha512-px7OMFO/ncXxixDe1zR13V1iycqWae0MxTaw62RpFlksUi5QuNWgQJFkTQjIOvrmutJbI7Fp2Y2N1F6D2R4G6w==", "dev": true }, + "node_modules/@types/mute-stream": { + "version": "0.0.4", + "resolved": "https://registry.npmjs.org/@types/mute-stream/-/mute-stream-0.0.4.tgz", + "integrity": "sha512-CPM9nzrCPPJHQNA9keH9CVkVI+WR5kMa+7XEs5jcGQ0VoAGnLv242w8lIVgwAEfmE4oufJRaTc9PNLQl0ioAow==", + "dev": true, + "license": "MIT", + "dependencies": { + "@types/node": "*" + } + }, "node_modules/@types/node": { "version": "25.9.1", "resolved": "https://registry.npmjs.org/@types/node/-/node-25.9.1.tgz", @@ -4289,6 +4811,13 @@ "undici-types": ">=7.24.0 <7.24.7" } }, + "node_modules/@types/wrap-ansi": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/@types/wrap-ansi/-/wrap-ansi-3.0.0.tgz", + "integrity": "sha512-ltIpx+kM7g/MLRZfkbL7EsCEjfzCcScLpkg37eXEtx5kmrAKBkTJwd1GIAjDSL8wTpM6Hzn5YO4pSb91BEwu1g==", + "dev": true, + "license": "MIT" + }, "node_modules/@types/ws": { "version": "8.18.1", "resolved": "https://registry.npmjs.org/@types/ws/-/ws-8.18.1.tgz", @@ -4477,6 +5006,66 @@ "url": "https://github.com/sponsors/jonschlinkert" } }, + "node_modules/ast-types": { + "version": "0.13.4", + "resolved": "https://registry.npmjs.org/ast-types/-/ast-types-0.13.4.tgz", + "integrity": "sha512-x1FCFnFifvYDDzTaLII71vG5uvDwgtmDTEVWAxrgeiR8VjMONcCXJx7E+USjDtHlwFmt9MysbqgF9b9Vjr6w+w==", + "dev": true, + "license": "MIT", + "dependencies": { + "tslib": "^2.0.1" + }, + "engines": { + "node": ">=4" + } + }, + "node_modules/asynckit": { + "version": "0.4.0", + "resolved": "https://registry.npmjs.org/asynckit/-/asynckit-0.4.0.tgz", + "integrity": "sha512-Oei9OH4tRh0YqU3GxhX79dM/mwVgvbZJaSNaRk+bshkj0S5cfHcgYakreBjrHwatXKbz+IoIdYLxrKim2MjW0Q==", + "dev": true, + "license": "MIT" + }, + "node_modules/axios": { + "version": "1.16.1", + "resolved": "https://registry.npmjs.org/axios/-/axios-1.16.1.tgz", + "integrity": "sha512-caYkukvroVPO8KrzuJEb50Hm07KwfBZPEC3VeFHTsqWHvKTsy54hjJz9BS/cdaypROE2rH6xvm9mHX4fgWkr3A==", + "dev": true, + "license": "MIT", + "dependencies": { + "follow-redirects": "^1.16.0", + "form-data": "^4.0.5", + "https-proxy-agent": "^5.0.1", + "proxy-from-env": "^2.1.0" + } + }, + "node_modules/axios/node_modules/agent-base": { + "version": "6.0.2", + "resolved": "https://registry.npmjs.org/agent-base/-/agent-base-6.0.2.tgz", + "integrity": "sha512-RZNwNclF7+MS/8bDg70amg32dyeZGZxiDuQmZxKLAlQjr3jGyLx+4Kkk58UO7D2QdgFIQCovuSuZESne6RG6XQ==", + "dev": true, + "license": "MIT", + "dependencies": { + "debug": "4" + }, + "engines": { + "node": ">= 6.0.0" + } + }, + "node_modules/axios/node_modules/https-proxy-agent": { + "version": "5.0.1", + "resolved": "https://registry.npmjs.org/https-proxy-agent/-/https-proxy-agent-5.0.1.tgz", + "integrity": "sha512-dFcAjpTQFgoLMzC2VwU+C/CbS7uRL0lWmxDITmqm7C+7F0Odmj6s9l6alZc6AELXhrnggM2CeWSXHGOdX2YtwA==", + "dev": true, + "license": "MIT", + "dependencies": { + "agent-base": "6", + "debug": "4" + }, + "engines": { + "node": ">= 6" + } + }, "node_modules/balanced-match": { "version": "1.0.2", "resolved": "https://registry.npmjs.org/balanced-match/-/balanced-match-1.0.2.tgz", @@ -4506,6 +5095,16 @@ "node": ">=6.0.0" } }, + "node_modules/basic-ftp": { + "version": "5.3.1", + "resolved": "https://registry.npmjs.org/basic-ftp/-/basic-ftp-5.3.1.tgz", + "integrity": "sha512-bopVNp6ugyA150DDuZfPFdt1KZ5a94ZDiwX4hMgZDzF+GttD80lEy8kj98kbyhLXnPvhtIo93mdnLIjpCAeeOw==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=10.0.0" + } + }, "node_modules/beasties": { "version": "0.4.1", "resolved": "https://registry.npmjs.org/beasties/-/beasties-0.4.1.tgz", @@ -5042,6 +5641,17 @@ "url": "https://github.com/chalk/wrap-ansi?sponsor=1" } }, + "node_modules/clone": { + "version": "1.0.4", + "resolved": "https://registry.npmjs.org/clone/-/clone-1.0.4.tgz", + "integrity": "sha512-JQHZ2QMW6l3aH/j6xCqQThY/9OH4D/9ls34cgkUBiEeocRTU04tHfKPBsUK1PqZCUQM7GiA0IIXJSuXHI64Kbg==", + "dev": true, + "license": "MIT", + "optional": true, + "engines": { + "node": ">=0.8" + } + }, "node_modules/color-convert": { "version": "2.0.1", "resolved": "https://registry.npmjs.org/color-convert/-/color-convert-2.0.1.tgz", @@ -5069,12 +5679,175 @@ "dev": true, "license": "MIT" }, + "node_modules/combined-stream": { + "version": "1.0.8", + "resolved": "https://registry.npmjs.org/combined-stream/-/combined-stream-1.0.8.tgz", + "integrity": "sha512-FQN4MRfuJeHf7cBbBMJFXhKSDq+2kAArBlmRBvcvFE5BB1HZKXtSFASDhdlz9zOYwxh8lDdnvmMOe/+5cdoEdg==", + "dev": true, + "license": "MIT", + "dependencies": { + "delayed-stream": "~1.0.0" + }, + "engines": { + "node": ">= 0.8" + } + }, + "node_modules/commander": { + "version": "8.3.0", + "resolved": "https://registry.npmjs.org/commander/-/commander-8.3.0.tgz", + "integrity": "sha512-OkTL9umf+He2DZkUq8f8J9of7yL6RJKI24dVITBmNfZBmri9zYZQrKkuXiKhyfPSu8tUhnVBB1iKXevvnlR4Ww==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">= 12" + } + }, + "node_modules/compare-versions": { + "version": "6.1.1", + "resolved": "https://registry.npmjs.org/compare-versions/-/compare-versions-6.1.1.tgz", + "integrity": "sha512-4hm4VPpIecmlg59CHXnRDnqGplJFrbLG4aFEl5vl6cK1u76ws3LLvX7ikFnTDl5vo39sjWD6AaDPYodJp/NNHg==", + "dev": true, + "license": "MIT" + }, "node_modules/concat-map": { "version": "0.0.1", "resolved": "https://registry.npmjs.org/concat-map/-/concat-map-0.0.1.tgz", "integrity": "sha512-/Srv4dswyQNBfohGpz9o6Yb3Gz3SrUDqBH5rTuhGR7ahtlbYKnVxw2bCFMRljaA7EXHaXZ8wsHdodFvbkhKmqg==", "dev": true }, + "node_modules/concurrently": { + "version": "9.2.1", + "resolved": "https://registry.npmjs.org/concurrently/-/concurrently-9.2.1.tgz", + "integrity": "sha512-fsfrO0MxV64Znoy8/l1vVIjjHa29SZyyqPgQBwhiDcaW8wJc2W3XWVOGx4M3oJBnv/zdUZIIp1gDeS98GzP8Ng==", + "dev": true, + "license": "MIT", + "dependencies": { + "chalk": "4.1.2", + "rxjs": "7.8.2", + "shell-quote": "1.8.3", + "supports-color": "8.1.1", + "tree-kill": "1.2.2", + "yargs": "17.7.2" + }, + "bin": { + "conc": "dist/bin/concurrently.js", + "concurrently": "dist/bin/concurrently.js" + }, + "engines": { + "node": ">=18" + }, + "funding": { + "url": "https://github.com/open-cli-tools/concurrently?sponsor=1" + } + }, + "node_modules/concurrently/node_modules/ansi-styles": { + "version": "4.3.0", + "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-4.3.0.tgz", + "integrity": "sha512-zbB9rCJAT1rbjiVDb2hqKFHNYLxgtk8NURxZ3IZwD3F6NtxbXZQCnnSi1Lkx+IDohdPlFp222wVALIheZJQSEg==", + "dev": true, + "license": "MIT", + "dependencies": { + "color-convert": "^2.0.1" + }, + "engines": { + "node": ">=8" + }, + "funding": { + "url": "https://github.com/chalk/ansi-styles?sponsor=1" + } + }, + "node_modules/concurrently/node_modules/chalk": { + "version": "4.1.2", + "resolved": "https://registry.npmjs.org/chalk/-/chalk-4.1.2.tgz", + "integrity": "sha512-oKnbhFyRIXpUuez8iBMmyEa4nbj4IOQyuhc/wy9kY7/WVPcwIO9VA668Pu8RkO7+0G76SLROeyw9CpQ061i4mA==", + "dev": true, + "license": "MIT", + "dependencies": { + "ansi-styles": "^4.1.0", + "supports-color": "^7.1.0" + }, + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/chalk/chalk?sponsor=1" + } + }, + "node_modules/concurrently/node_modules/chalk/node_modules/supports-color": { + "version": "7.2.0", + "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-7.2.0.tgz", + "integrity": "sha512-qpCAvRl9stuOHveKsn7HncJRvv501qIacKzQlO/+Lwxc9+0q2wLyv4Dfvt80/DPn2pqOBsJdDiogXGR9+OvwRw==", + "dev": true, + "license": "MIT", + "dependencies": { + "has-flag": "^4.0.0" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/concurrently/node_modules/cliui": { + "version": "8.0.1", + "resolved": "https://registry.npmjs.org/cliui/-/cliui-8.0.1.tgz", + "integrity": "sha512-BSeNnyus75C4//NQ9gQt1/csTXyo/8Sb+afLAkzAptFuMsod9HFokGNudZpi/oQV73hnVK+sR+5PVRMd+Dr7YQ==", + "dev": true, + "license": "ISC", + "dependencies": { + "string-width": "^4.2.0", + "strip-ansi": "^6.0.1", + "wrap-ansi": "^7.0.0" + }, + "engines": { + "node": ">=12" + } + }, + "node_modules/concurrently/node_modules/wrap-ansi": { + "version": "7.0.0", + "resolved": "https://registry.npmjs.org/wrap-ansi/-/wrap-ansi-7.0.0.tgz", + "integrity": "sha512-YVGIj2kamLSTxw6NsZjoBxfSwsn0ycdesmc4p+Q21c5zPuZ1pl+NfxVdxPtdHvmNVOQ6XSYG4AUtyt/Fi7D16Q==", + "dev": true, + "license": "MIT", + "dependencies": { + "ansi-styles": "^4.0.0", + "string-width": "^4.1.0", + "strip-ansi": "^6.0.0" + }, + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/chalk/wrap-ansi?sponsor=1" + } + }, + "node_modules/concurrently/node_modules/yargs": { + "version": "17.7.2", + "resolved": "https://registry.npmjs.org/yargs/-/yargs-17.7.2.tgz", + "integrity": "sha512-7dSzzRQ++CKnNI/krKnYRV7JKKPUXMEh61soaHKg9mrWEhzFWhFnxPxGl+69cD1Ou63C13NUPCnmIcrvqCuM6w==", + "dev": true, + "license": "MIT", + "dependencies": { + "cliui": "^8.0.1", + "escalade": "^3.1.1", + "get-caller-file": "^2.0.5", + "require-directory": "^2.1.1", + "string-width": "^4.2.3", + "y18n": "^5.0.5", + "yargs-parser": "^21.1.1" + }, + "engines": { + "node": ">=12" + } + }, + "node_modules/concurrently/node_modules/yargs-parser": { + "version": "21.1.1", + "resolved": "https://registry.npmjs.org/yargs-parser/-/yargs-parser-21.1.1.tgz", + "integrity": "sha512-tVpsJW7DdjecAiFpbIB1e3qxIQsE6NoPc5/eTdrbbIC4h0LVsWhnoa3g+m2HclBIujHzsxZ4VJVA+GUuc2/LBw==", + "dev": true, + "license": "ISC", + "engines": { + "node": ">=12" + } + }, "node_modules/connect": { "version": "3.7.0", "resolved": "https://registry.npmjs.org/connect/-/connect-3.7.0.tgz", @@ -5105,6 +5878,29 @@ "integrity": "sha512-Tpp60P6IUJDTuOq/5Z8cdskzJujfwqfOTkrwIwj7IRISpnkJnT6SyJ4PCPnGMoFjC9ddhal5KVIYtAt97ix05A==", "dev": true }, + "node_modules/consola": { + "version": "3.4.2", + "resolved": "https://registry.npmjs.org/consola/-/consola-3.4.2.tgz", + "integrity": "sha512-5IKcdX0nnYavi6G7TtOhwkYzyjfJlatbjMjuLSfE2kYT5pMDOilZ4OvMhi637CcDICTmz3wARPoyhqyX1Y+XvA==", + "dev": true, + "license": "MIT", + "engines": { + "node": "^14.18.0 || >=16.10.0" + } + }, + "node_modules/console.table": { + "version": "0.10.0", + "resolved": "https://registry.npmjs.org/console.table/-/console.table-0.10.0.tgz", + "integrity": "sha512-dPyZofqggxuvSf7WXvNjuRfnsOk1YazkVP8FdxH4tcH2c37wc79/Yl6Bhr7Lsu00KMgy2ql/qCMuNu8xctZM8g==", + "dev": true, + "license": "MIT", + "dependencies": { + "easy-table": "1.1.0" + }, + "engines": { + "node": "> 0.10" + } + }, "node_modules/content-disposition": { "version": "1.1.0", "resolved": "https://registry.npmjs.org/content-disposition/-/content-disposition-1.1.0.tgz", @@ -5235,6 +6031,16 @@ "integrity": "sha512-GAj5FOq0Hd+RsCGVJxZuKaIDXDf3h6GQoNEjFgbLLI/trgtavwUbSnZ5pVfg27DVCaWjIohryS0JFwIJyT2cMg==", "dev": true }, + "node_modules/data-uri-to-buffer": { + "version": "8.0.0", + "resolved": "https://registry.npmjs.org/data-uri-to-buffer/-/data-uri-to-buffer-8.0.0.tgz", + "integrity": "sha512-6UHfyCux51b8PTGDgveqtz1tvphBku5DrMKKJbFAZAJOI2zsjDpDoYE1+QGj7FOMS4BdTFNJsJiR3zEB0xH0yQ==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">= 20" + } + }, "node_modules/date-format": { "version": "4.0.14", "resolved": "https://registry.npmjs.org/date-format/-/date-format-4.0.14.tgz", @@ -5262,6 +6068,48 @@ } } }, + "node_modules/defaults": { + "version": "1.0.4", + "resolved": "https://registry.npmjs.org/defaults/-/defaults-1.0.4.tgz", + "integrity": "sha512-eFuaLoy/Rxalv2kr+lqMlUnrDWV+3j4pljOIJgLIhI058IQfWJ7vXhyEIHu+HtC738klGALYxOKDO0bQP3tg8A==", + "dev": true, + "license": "MIT", + "optional": true, + "dependencies": { + "clone": "^1.0.2" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/degenerator": { + "version": "7.0.1", + "resolved": "https://registry.npmjs.org/degenerator/-/degenerator-7.0.1.tgz", + "integrity": "sha512-ABErK0IefDSyHjlPH7WUEenIAX2rPPnrDcDM+TS3z3+zu9TfyKKi07BQM+8rmxpdE2y1v5fjjdoAS/x4D2U60w==", + "dev": true, + "license": "MIT", + "dependencies": { + "ast-types": "^0.13.4", + "escodegen": "^2.1.0", + "esprima": "^4.0.1" + }, + "engines": { + "node": ">= 20" + }, + "peerDependencies": { + "quickjs-wasi": "^2.2.0" + } + }, + "node_modules/delayed-stream": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/delayed-stream/-/delayed-stream-1.0.0.tgz", + "integrity": "sha512-ZySD7Nf91aLB0RxL4KGrKHBXl7Eds1DAmEdcoVawXnLD7SDhpNgtuII2aAkg7a7QS41jxPSZ17p4VdGnMHk3MQ==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=0.4.0" + } + }, "node_modules/depd": { "version": "2.0.0", "resolved": "https://registry.npmjs.org/depd/-/depd-2.0.0.tgz", @@ -5384,6 +6232,16 @@ "node": ">= 0.4" } }, + "node_modules/easy-table": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/easy-table/-/easy-table-1.1.0.tgz", + "integrity": "sha512-oq33hWOSSnl2Hoh00tZWaIPi1ievrD9aFG82/IgjlycAnW9hHx5PkJiXpxPsgEE+H7BsbVQXFVFST8TEXS6/pA==", + "dev": true, + "license": "MIT", + "optionalDependencies": { + "wcwidth": ">=1.0.1" + } + }, "node_modules/echarts": { "version": "6.1.0", "resolved": "https://registry.npmjs.org/echarts/-/echarts-6.1.0.tgz", @@ -5541,6 +6399,22 @@ "node": ">= 0.4" } }, + "node_modules/es-set-tostringtag": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/es-set-tostringtag/-/es-set-tostringtag-2.1.0.tgz", + "integrity": "sha512-j6vWzfrGVfyXxge+O0x5sh6cvxAog0a/4Rdd2K36zCMV5eJ+/+tOAngRO8cODMNWbVRdVlmGZQL2YS3yR8bIUA==", + "dev": true, + "license": "MIT", + "dependencies": { + "es-errors": "^1.3.0", + "get-intrinsic": "^1.2.6", + "has-tostringtag": "^1.0.2", + "hasown": "^2.0.2" + }, + "engines": { + "node": ">= 0.4" + } + }, "node_modules/esbuild": { "version": "0.27.3", "resolved": "https://registry.npmjs.org/esbuild/-/esbuild-0.27.3.tgz", @@ -5599,6 +6473,72 @@ "integrity": "sha512-NiSupZ4OeuGwr68lGIeym/ksIZMJodUGOSCZ/FSnTxcrekbvqrgdUxlJOMpijaKZVjAJrWrGs/6Jy8OMuyj9ow==", "dev": true }, + "node_modules/escape-string-regexp": { + "version": "1.0.5", + "resolved": "https://registry.npmjs.org/escape-string-regexp/-/escape-string-regexp-1.0.5.tgz", + "integrity": "sha512-vbRorB5FUQWvla16U8R/qgaFIya2qGzwDrNmCZuYKrbdSUMG6I1ZCGQRefkRVhuOkIGVne7BQ35DSfo1qvJqFg==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=0.8.0" + } + }, + "node_modules/escodegen": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/escodegen/-/escodegen-2.1.0.tgz", + "integrity": "sha512-2NlIDTwUWJN0mRPQOdtQBzbUHvdGY2P1VXSyU83Q3xKxM7WHX2Ql8dKq782Q9TgQUNOLEzEYu9bzLNj1q88I5w==", + "dev": true, + "license": "BSD-2-Clause", + "dependencies": { + "esprima": "^4.0.1", + "estraverse": "^5.2.0", + "esutils": "^2.0.2" + }, + "bin": { + "escodegen": "bin/escodegen.js", + "esgenerate": "bin/esgenerate.js" + }, + "engines": { + "node": ">=6.0" + }, + "optionalDependencies": { + "source-map": "~0.6.1" + } + }, + "node_modules/esprima": { + "version": "4.0.1", + "resolved": "https://registry.npmjs.org/esprima/-/esprima-4.0.1.tgz", + "integrity": "sha512-eGuFFw7Upda+g4p+QHvnW0RyTX/SVeJBDM/gCtMARO0cLuT2HcEKnTPvhjV6aGeqrCB/sbNop0Kszm0jsaWU4A==", + "dev": true, + "license": "BSD-2-Clause", + "bin": { + "esparse": "bin/esparse.js", + "esvalidate": "bin/esvalidate.js" + }, + "engines": { + "node": ">=4" + } + }, + "node_modules/estraverse": { + "version": "5.3.0", + "resolved": "https://registry.npmjs.org/estraverse/-/estraverse-5.3.0.tgz", + "integrity": "sha512-MMdARuVEQziNTeJD8DgMqmhwR11BRQ/cBP+pLtYdSTnf3MIO8fFeiINEbX36ZdNlfU/7A9f3gUw49B3oQsvwBA==", + "dev": true, + "license": "BSD-2-Clause", + "engines": { + "node": ">=4.0" + } + }, + "node_modules/esutils": { + "version": "2.0.3", + "resolved": "https://registry.npmjs.org/esutils/-/esutils-2.0.3.tgz", + "integrity": "sha512-kVscqXk4OCp68SZ0dkgEKVi6/8ij300KBWTJq32P/dYeWTSwK41WyTxalN1eRmA5Z9UU/LX9D7FWSmV9SAYx6g==", + "dev": true, + "license": "BSD-2-Clause", + "engines": { + "node": ">=0.10.0" + } + }, "node_modules/etag": { "version": "1.8.1", "resolved": "https://registry.npmjs.org/etag/-/etag-1.8.1.tgz", @@ -5915,6 +6855,13 @@ "dev": true, "license": "MIT" }, + "node_modules/fast-safe-stringify": { + "version": "2.1.1", + "resolved": "https://registry.npmjs.org/fast-safe-stringify/-/fast-safe-stringify-2.1.1.tgz", + "integrity": "sha512-W+KJc2dmILlPplD/H4K9l9LcAHAfPtP6BY84uVLXQ6Evcz9Lcg33Y2z1IVblT6xdY54PXYVHEv+0Wpq8Io6zkA==", + "dev": true, + "license": "MIT" + }, "node_modules/fast-uri": { "version": "3.1.2", "resolved": "https://registry.npmjs.org/fast-uri/-/fast-uri-3.1.2.tgz", @@ -5950,6 +6897,41 @@ } } }, + "node_modules/figures": { + "version": "3.2.0", + "resolved": "https://registry.npmjs.org/figures/-/figures-3.2.0.tgz", + "integrity": "sha512-yaduQFRKLXYOGgEn6AZau90j3ggSOyiqXU0F9JZfeXYhNa+Jk4X+s45A2zg5jns87GAFa34BBm2kXw4XpNcbdg==", + "dev": true, + "license": "MIT", + "dependencies": { + "escape-string-regexp": "^1.0.5" + }, + "engines": { + "node": ">=8" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/file-type": { + "version": "21.3.4", + "resolved": "https://registry.npmjs.org/file-type/-/file-type-21.3.4.tgz", + "integrity": "sha512-Ievi/yy8DS3ygGvT47PjSfdFoX+2isQueoYP1cntFW1JLYAuS4GD7NUPGg4zv2iZfV52uDyk5w5Z0TdpRS6Q1g==", + "dev": true, + "license": "MIT", + "dependencies": { + "@tokenizer/inflate": "^0.4.1", + "strtok3": "^10.3.4", + "token-types": "^6.1.1", + "uint8array-extras": "^1.4.0" + }, + "engines": { + "node": ">=20" + }, + "funding": { + "url": "https://github.com/sindresorhus/file-type?sponsor=1" + } + }, "node_modules/fill-range": { "version": "7.1.1", "resolved": "https://registry.npmjs.org/fill-range/-/fill-range-7.1.1.tgz", @@ -6035,6 +7017,23 @@ } } }, + "node_modules/form-data": { + "version": "4.0.5", + "resolved": "https://registry.npmjs.org/form-data/-/form-data-4.0.5.tgz", + "integrity": "sha512-8RipRLol37bNs2bhoV67fiTEvdTrbMUYcFTiy3+wuuOnUog2QBHCZWXDRijWQfAkhBj2Uf5UnVaiWwA5vdd82w==", + "dev": true, + "license": "MIT", + "dependencies": { + "asynckit": "^0.4.0", + "combined-stream": "^1.0.8", + "es-set-tostringtag": "^2.1.0", + "hasown": "^2.0.2", + "mime-types": "^2.1.12" + }, + "engines": { + "node": ">= 6" + } + }, "node_modules/forwarded": { "version": "0.2.0", "resolved": "https://registry.npmjs.org/forwarded/-/forwarded-0.2.0.tgz", @@ -6181,6 +7180,21 @@ "node": ">= 0.4" } }, + "node_modules/get-uri": { + "version": "8.0.0", + "resolved": "https://registry.npmjs.org/get-uri/-/get-uri-8.0.0.tgz", + "integrity": "sha512-CqtZlMKvfJeY0Zxv8wazDwXmSKmnMnsmNy8j8+wudi8EyG/pMUB1NqHc+Tv1QaNtpYsK9nOYjb7r7Ufu32RPSw==", + "dev": true, + "license": "MIT", + "dependencies": { + "basic-ftp": "^5.2.0", + "data-uri-to-buffer": "8.0.0", + "debug": "^4.3.4" + }, + "engines": { + "node": ">= 20" + } + }, "node_modules/glob": { "version": "7.2.3", "resolved": "https://registry.npmjs.org/glob/-/glob-7.2.3.tgz", @@ -6262,6 +7276,22 @@ "url": "https://github.com/sponsors/ljharb" } }, + "node_modules/has-tostringtag": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/has-tostringtag/-/has-tostringtag-1.0.2.tgz", + "integrity": "sha512-NqADB8VjPFLM2V0VvHUewwwsw0ZWBaIdgo+ieHtK3hasLz4qeCRjYcqfB6AQrBggRKppKF8L52/VqdVsO47Dlw==", + "dev": true, + "license": "MIT", + "dependencies": { + "has-symbols": "^1.0.3" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, "node_modules/hasown": { "version": "2.0.3", "resolved": "https://registry.npmjs.org/hasown/-/hasown-2.0.3.tgz", @@ -6440,6 +7470,27 @@ "node": ">=0.10.0" } }, + "node_modules/ieee754": { + "version": "1.2.1", + "resolved": "https://registry.npmjs.org/ieee754/-/ieee754-1.2.1.tgz", + "integrity": "sha512-dcyqhDvX1C46lXZcVqCpK+FtMRQVdIMN6/Df5js2zouUsqG7I6sFxitIC+7KYK29KdXOLHdu9zL4sFnoVQnqaA==", + "dev": true, + "funding": [ + { + "type": "github", + "url": "https://github.com/sponsors/feross" + }, + { + "type": "patreon", + "url": "https://www.patreon.com/feross" + }, + { + "type": "consulting", + "url": "https://feross.org/support" + } + ], + "license": "BSD-3-Clause" + }, "node_modules/ignore-walk": { "version": "8.0.0", "resolved": "https://registry.npmjs.org/ignore-walk/-/ignore-walk-8.0.0.tgz", @@ -6734,6 +7785,16 @@ "node": ">=8" } }, + "node_modules/iterare": { + "version": "1.2.1", + "resolved": "https://registry.npmjs.org/iterare/-/iterare-1.2.1.tgz", + "integrity": "sha512-RKYVTCjAnRthyJes037NX/IiqeidgN1xc3j1RjFfECFp28A1GVwK9nA+i0rJPaHqSZwygLzRnFlzUuHFoWWy+Q==", + "dev": true, + "license": "ISC", + "engines": { + "node": ">=6" + } + }, "node_modules/jasmine-core": { "version": "5.1.2", "resolved": "https://registry.npmjs.org/jasmine-core/-/jasmine-core-5.1.2.tgz", @@ -7124,6 +8185,26 @@ "@lmdb/lmdb-win32-x64": "3.5.1" } }, + "node_modules/load-esm": { + "version": "1.0.3", + "resolved": "https://registry.npmjs.org/load-esm/-/load-esm-1.0.3.tgz", + "integrity": "sha512-v5xlu8eHD1+6r8EHTg6hfmO97LN8ugKtiXcy5e6oN72iD2r6u0RPfLl6fxM+7Wnh2ZRq15o0russMst44WauPA==", + "dev": true, + "funding": [ + { + "type": "github", + "url": "https://github.com/sponsors/Borewit" + }, + { + "type": "buymeacoffee", + "url": "https://buymeacoffee.com/borewit" + } + ], + "license": "MIT", + "engines": { + "node": ">=13.2.0" + } + }, "node_modules/lodash": { "version": "4.18.1", "resolved": "https://registry.npmjs.org/lodash/-/lodash-4.18.1.tgz", @@ -7711,6 +8792,16 @@ "node": ">= 0.6" } }, + "node_modules/netmask": { + "version": "2.1.1", + "resolved": "https://registry.npmjs.org/netmask/-/netmask-2.1.1.tgz", + "integrity": "sha512-eonl3sLUha+S1GzTPxychyhnUzKyeQkZ7jLjKrBagJgPla13F+uQ71HgpFefyHgqrjEbCPkDArxYsjY8/+gLKA==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">= 0.4.0" + } + }, "node_modules/ngx-echarts": { "version": "21.0.0", "resolved": "https://registry.npmjs.org/ngx-echarts/-/ngx-echarts-21.0.0.tgz", @@ -7732,6 +8823,27 @@ "license": "MIT", "optional": true }, + "node_modules/node-fetch": { + "version": "2.7.0", + "resolved": "https://registry.npmjs.org/node-fetch/-/node-fetch-2.7.0.tgz", + "integrity": "sha512-c4FRfUm/dbcWZ7U+1Wq0AwCyFL+3nt2bEw05wfxSz+DWpWsitgmSgYmy2dQdWyKC1694ELPqMs/YzUSNozLt8A==", + "dev": true, + "license": "MIT", + "dependencies": { + "whatwg-url": "^5.0.0" + }, + "engines": { + "node": "4.x || >=6.0.0" + }, + "peerDependencies": { + "encoding": "^0.1.0" + }, + "peerDependenciesMeta": { + "encoding": { + "optional": true + } + } + }, "node_modules/node-gyp": { "version": "12.3.0", "resolved": "https://registry.npmjs.org/node-gyp/-/node-gyp-12.3.0.tgz", @@ -8108,6 +9220,96 @@ "url": "https://github.com/sponsors/sindresorhus" } }, + "node_modules/pac-proxy-agent": { + "version": "9.0.1", + "resolved": "https://registry.npmjs.org/pac-proxy-agent/-/pac-proxy-agent-9.0.1.tgz", + "integrity": "sha512-3ZOSpLboOlpW4yp8Cuv21KlTULRqyJ5Uuad3wXpSKFrxdNgcHEyoa22GRaZ2UlgCVuR6z+5BiavtYVvbajL/Yw==", + "dev": true, + "license": "MIT", + "dependencies": { + "agent-base": "9.0.0", + "debug": "^4.3.4", + "get-uri": "8.0.0", + "http-proxy-agent": "9.0.0", + "https-proxy-agent": "9.0.0", + "pac-resolver": "9.0.1", + "quickjs-wasi": "^2.2.0", + "socks-proxy-agent": "10.0.0" + }, + "engines": { + "node": ">= 20" + } + }, + "node_modules/pac-proxy-agent/node_modules/agent-base": { + "version": "9.0.0", + "resolved": "https://registry.npmjs.org/agent-base/-/agent-base-9.0.0.tgz", + "integrity": "sha512-TQf59BsZnytt8GdJKLPfUZ54g/iaUL2OWDSFCCvMOhsHduDQxO8xC4PNeyIkVcA5KwL2phPSv0douC0fgWzmnA==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">= 20" + } + }, + "node_modules/pac-proxy-agent/node_modules/http-proxy-agent": { + "version": "9.0.0", + "resolved": "https://registry.npmjs.org/http-proxy-agent/-/http-proxy-agent-9.0.0.tgz", + "integrity": "sha512-FcF8VhXYLQcxWCnt/cCpT2apKsRDUGeVEeMqGu4HSTu29U8Yw0TLOjdYIlDsYk3IkUh+taX4IDWpPcCqKDhCjA==", + "dev": true, + "license": "MIT", + "dependencies": { + "agent-base": "9.0.0", + "debug": "^4.3.4" + }, + "engines": { + "node": ">= 20" + } + }, + "node_modules/pac-proxy-agent/node_modules/https-proxy-agent": { + "version": "9.0.0", + "resolved": "https://registry.npmjs.org/https-proxy-agent/-/https-proxy-agent-9.0.0.tgz", + "integrity": "sha512-/MVmHp58WkOypgFhCLk4fzpPcFQvTJ/e6LBI7irpIO2HfxUbpmYoHF+KzipzJpxxzJu7aJNWQ0xojJ/dzV2G5g==", + "dev": true, + "license": "MIT", + "dependencies": { + "agent-base": "9.0.0", + "debug": "^4.3.4" + }, + "engines": { + "node": ">= 20" + } + }, + "node_modules/pac-proxy-agent/node_modules/socks-proxy-agent": { + "version": "10.0.0", + "resolved": "https://registry.npmjs.org/socks-proxy-agent/-/socks-proxy-agent-10.0.0.tgz", + "integrity": "sha512-pyp2YR3mNxAMu0mGLtzs4g7O3uT4/9sQOLAKcViAkaS9fJWkud7nmaf6ZREFqQEi24IPkBcjfHjXhPTUWjo3uA==", + "dev": true, + "license": "MIT", + "dependencies": { + "agent-base": "9.0.0", + "debug": "^4.3.4", + "socks": "^2.8.3" + }, + "engines": { + "node": ">= 20" + } + }, + "node_modules/pac-resolver": { + "version": "9.0.1", + "resolved": "https://registry.npmjs.org/pac-resolver/-/pac-resolver-9.0.1.tgz", + "integrity": "sha512-lJbS008tmkj08VhoM8Hzuv/VE5tK9MS0OIQ/7+s0lIF+BYhiQWFYzkSpML7lXs9iBu2jfmzBTLzhe9n6BX+dYw==", + "dev": true, + "license": "MIT", + "dependencies": { + "degenerator": "7.0.1", + "netmask": "^2.0.2" + }, + "engines": { + "node": ">= 20" + }, + "peerDependencies": { + "quickjs-wasi": "^2.2.0" + } + }, "node_modules/pacote": { "version": "21.3.1", "resolved": "https://registry.npmjs.org/pacote/-/pacote-21.3.1.tgz", @@ -8415,6 +9617,99 @@ "node": ">= 0.10" } }, + "node_modules/proxy-agent": { + "version": "8.0.1", + "resolved": "https://registry.npmjs.org/proxy-agent/-/proxy-agent-8.0.1.tgz", + "integrity": "sha512-kccqGBqHZXR8onQhY/ganJjoO8QIKKRiFBhPOzbTZK16attzSZ/0XSmp9H7jrRxPKHjhGyx1q32lMPrJ3uLFgA==", + "dev": true, + "license": "MIT", + "dependencies": { + "agent-base": "9.0.0", + "debug": "^4.3.4", + "http-proxy-agent": "9.0.0", + "https-proxy-agent": "9.0.0", + "lru-cache": "^7.14.1", + "pac-proxy-agent": "9.0.1", + "proxy-from-env": "^2.0.0", + "socks-proxy-agent": "10.0.0" + }, + "engines": { + "node": ">= 20" + } + }, + "node_modules/proxy-agent/node_modules/agent-base": { + "version": "9.0.0", + "resolved": "https://registry.npmjs.org/agent-base/-/agent-base-9.0.0.tgz", + "integrity": "sha512-TQf59BsZnytt8GdJKLPfUZ54g/iaUL2OWDSFCCvMOhsHduDQxO8xC4PNeyIkVcA5KwL2phPSv0douC0fgWzmnA==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">= 20" + } + }, + "node_modules/proxy-agent/node_modules/http-proxy-agent": { + "version": "9.0.0", + "resolved": "https://registry.npmjs.org/http-proxy-agent/-/http-proxy-agent-9.0.0.tgz", + "integrity": "sha512-FcF8VhXYLQcxWCnt/cCpT2apKsRDUGeVEeMqGu4HSTu29U8Yw0TLOjdYIlDsYk3IkUh+taX4IDWpPcCqKDhCjA==", + "dev": true, + "license": "MIT", + "dependencies": { + "agent-base": "9.0.0", + "debug": "^4.3.4" + }, + "engines": { + "node": ">= 20" + } + }, + "node_modules/proxy-agent/node_modules/https-proxy-agent": { + "version": "9.0.0", + "resolved": "https://registry.npmjs.org/https-proxy-agent/-/https-proxy-agent-9.0.0.tgz", + "integrity": "sha512-/MVmHp58WkOypgFhCLk4fzpPcFQvTJ/e6LBI7irpIO2HfxUbpmYoHF+KzipzJpxxzJu7aJNWQ0xojJ/dzV2G5g==", + "dev": true, + "license": "MIT", + "dependencies": { + "agent-base": "9.0.0", + "debug": "^4.3.4" + }, + "engines": { + "node": ">= 20" + } + }, + "node_modules/proxy-agent/node_modules/lru-cache": { + "version": "7.18.3", + "resolved": "https://registry.npmjs.org/lru-cache/-/lru-cache-7.18.3.tgz", + "integrity": "sha512-jumlc0BIUrS3qJGgIkWZsyfAM7NCWiBcCDhnd+3NNM5KbBmLTgHVfWBcg6W+rLUsIpzpERPsvwUP7CckAQSOoA==", + "dev": true, + "license": "ISC", + "engines": { + "node": ">=12" + } + }, + "node_modules/proxy-agent/node_modules/socks-proxy-agent": { + "version": "10.0.0", + "resolved": "https://registry.npmjs.org/socks-proxy-agent/-/socks-proxy-agent-10.0.0.tgz", + "integrity": "sha512-pyp2YR3mNxAMu0mGLtzs4g7O3uT4/9sQOLAKcViAkaS9fJWkud7nmaf6ZREFqQEi24IPkBcjfHjXhPTUWjo3uA==", + "dev": true, + "license": "MIT", + "dependencies": { + "agent-base": "9.0.0", + "debug": "^4.3.4", + "socks": "^2.8.3" + }, + "engines": { + "node": ">= 20" + } + }, + "node_modules/proxy-from-env": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/proxy-from-env/-/proxy-from-env-2.1.0.tgz", + "integrity": "sha512-cJ+oHTW1VAEa8cJslgmUZrc+sjRKgAKl3Zyse6+PV38hZe/V6Z14TbCuXcan9F9ghlz4QrFr2c92TNF82UkYHA==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=10" + } + }, "node_modules/qjobs": { "version": "1.2.0", "resolved": "https://registry.npmjs.org/qjobs/-/qjobs-1.2.0.tgz", @@ -8440,6 +9735,13 @@ "url": "https://github.com/sponsors/ljharb" } }, + "node_modules/quickjs-wasi": { + "version": "2.2.0", + "resolved": "https://registry.npmjs.org/quickjs-wasi/-/quickjs-wasi-2.2.0.tgz", + "integrity": "sha512-zQxXmQMrEoD3S+jQdYsloq4qAuaxKFHZj6hHqOYGwB2iQZH+q9e/lf5zQPXCKOk0WJuAjzRFbO4KwHIp2D05Iw==", + "dev": true, + "license": "MIT" + }, "node_modules/range-parser": { "version": "1.2.1", "resolved": "https://registry.npmjs.org/range-parser/-/range-parser-1.2.1.tgz", @@ -8665,6 +9967,16 @@ "node": ">= 18" } }, + "node_modules/run-async": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/run-async/-/run-async-3.0.0.tgz", + "integrity": "sha512-540WwVDOMxA6dN6We19EcT9sc3hkXPw5mzRNGM3FkdN/vtE9NFvj5lFAPNwUDmJjXidm3v7TC1cTE7t17Ulm1Q==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=0.12.0" + } + }, "node_modules/rxjs": { "version": "7.8.2", "resolved": "https://registry.npmjs.org/rxjs/-/rxjs-7.8.2.tgz", @@ -8877,6 +10189,19 @@ "node": ">=8" } }, + "node_modules/shell-quote": { + "version": "1.8.3", + "resolved": "https://registry.npmjs.org/shell-quote/-/shell-quote-1.8.3.tgz", + "integrity": "sha512-ObmnIF4hXNg1BqhnHmgbDETF8dLPCggZWBjkQfhZpbszZnYur5DUljTcCHii5LC3J5E0yeO/1LIMyH+UvHQgyw==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, "node_modules/side-channel": { "version": "1.1.0", "resolved": "https://registry.npmjs.org/side-channel/-/side-channel-1.1.0.tgz", @@ -9232,6 +10557,39 @@ "node": ">=8" } }, + "node_modules/strtok3": { + "version": "10.3.5", + "resolved": "https://registry.npmjs.org/strtok3/-/strtok3-10.3.5.tgz", + "integrity": "sha512-ki4hZQfh5rX0QDLLkOCj+h+CVNkqmp/CMf8v8kZpkNVK6jGQooMytqzLZYUVYIZcFZ6yDB70EfD8POcFXiF5oA==", + "dev": true, + "license": "MIT", + "dependencies": { + "@tokenizer/token": "^0.3.0" + }, + "engines": { + "node": ">=18" + }, + "funding": { + "type": "github", + "url": "https://github.com/sponsors/Borewit" + } + }, + "node_modules/supports-color": { + "version": "8.1.1", + "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-8.1.1.tgz", + "integrity": "sha512-MpUEN2OodtUzxvKQl72cUF7RQ5EiHsGvSsVG0ia9c5RbWGL2CI4C7EpPS8UTBIplnlzZiNuV56w+FuNxy3ty2Q==", + "dev": true, + "license": "MIT", + "dependencies": { + "has-flag": "^4.0.0" + }, + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/chalk/supports-color?sponsor=1" + } + }, "node_modules/tar": { "version": "7.5.15", "resolved": "https://registry.npmjs.org/tar/-/tar-7.5.15.tgz", @@ -9307,6 +10665,42 @@ "node": ">=0.6" } }, + "node_modules/token-types": { + "version": "6.1.2", + "resolved": "https://registry.npmjs.org/token-types/-/token-types-6.1.2.tgz", + "integrity": "sha512-dRXchy+C0IgK8WPC6xvCHFRIWYUbqqdEIKPaKo/AcTUNzwLTK6AH7RjdLWsEZcAN/TBdtfUw3PYEgPr5VPr6ww==", + "dev": true, + "license": "MIT", + "dependencies": { + "@borewit/text-codec": "^0.2.1", + "@tokenizer/token": "^0.3.0", + "ieee754": "^1.2.1" + }, + "engines": { + "node": ">=14.16" + }, + "funding": { + "type": "github", + "url": "https://github.com/sponsors/Borewit" + } + }, + "node_modules/tr46": { + "version": "0.0.3", + "resolved": "https://registry.npmjs.org/tr46/-/tr46-0.0.3.tgz", + "integrity": "sha512-N3WMsuqV66lT30CrXNbEjx4GEwlow3v6rr4mCcv6prnfwhS01rkgyFdjPNBYd9br7LpXV1+Emh01fHnq2Gdgrw==", + "dev": true, + "license": "MIT" + }, + "node_modules/tree-kill": { + "version": "1.2.2", + "resolved": "https://registry.npmjs.org/tree-kill/-/tree-kill-1.2.2.tgz", + "integrity": "sha512-L0Orpi8qGpRG//Nd+H90vFB+3iHnue1zSSGmNOOCh1GLJ7rUKVwV2HvijphGQS2UmhUZewS9VgvxYIdgr+fG1A==", + "dev": true, + "license": "MIT", + "bin": { + "tree-kill": "cli.js" + } + }, "node_modules/tslib": { "version": "2.8.1", "resolved": "https://registry.npmjs.org/tslib/-/tslib-2.8.1.tgz", @@ -9328,6 +10722,19 @@ "node": "^20.17.0 || >=22.9.0" } }, + "node_modules/type-fest": { + "version": "0.21.3", + "resolved": "https://registry.npmjs.org/type-fest/-/type-fest-0.21.3.tgz", + "integrity": "sha512-t0rzBq87m3fVcduHDUFhKmyyX+9eo6WQjZvf51Ea/M0Q7+T374Jp1aUiyUl0GKxp8M/OETVHSDvmkyPgvX+X2w==", + "dev": true, + "license": "(MIT OR CC0-1.0)", + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, "node_modules/type-is": { "version": "1.6.18", "resolved": "https://registry.npmjs.org/type-is/-/type-is-1.6.18.tgz", @@ -9378,6 +10785,32 @@ "node": "*" } }, + "node_modules/uid": { + "version": "2.0.2", + "resolved": "https://registry.npmjs.org/uid/-/uid-2.0.2.tgz", + "integrity": "sha512-u3xV3X7uzvi5b1MncmZo3i2Aw222Zk1keqLA1YkHldREkAhAqi65wuPfe7lHx8H/Wzy+8CE7S7uS3jekIM5s8g==", + "dev": true, + "license": "MIT", + "dependencies": { + "@lukeed/csprng": "^1.0.0" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/uint8array-extras": { + "version": "1.5.0", + "resolved": "https://registry.npmjs.org/uint8array-extras/-/uint8array-extras-1.5.0.tgz", + "integrity": "sha512-rvKSBiC5zqCCiDZ9kAOszZcDvdAHwwIKJG33Ykj43OKcWsnmcBRL09YTU4nOeHZ8Y2a7l1MgTd08SBe9A8Qj6A==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=18" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, "node_modules/undici": { "version": "7.24.4", "resolved": "https://registry.npmjs.org/undici/-/undici-7.24.4.tgz", @@ -9570,6 +11003,17 @@ "node": ">=10.13.0" } }, + "node_modules/wcwidth": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/wcwidth/-/wcwidth-1.0.1.tgz", + "integrity": "sha512-XHPEwS0q6TaxcvG85+8EYkbiCux2XtWG2mkc47Ng2A77BQu9+DqIOJldST4HgPkuea7dvKSj5VgX3P1d4rW8Tg==", + "dev": true, + "license": "MIT", + "optional": true, + "dependencies": { + "defaults": "^1.0.3" + } + }, "node_modules/weak-lru-cache": { "version": "1.2.2", "resolved": "https://registry.npmjs.org/weak-lru-cache/-/weak-lru-cache-1.2.2.tgz", @@ -9578,6 +11022,24 @@ "license": "MIT", "optional": true }, + "node_modules/webidl-conversions": { + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/webidl-conversions/-/webidl-conversions-3.0.1.tgz", + "integrity": "sha512-2JAn3z8AR6rjK8Sm8orRC0h/bcl/DqL7tRPdGZ4I1CjdF+EaMLmYxBHyXuKL849eucPFhvBoxMsflfOb8kxaeQ==", + "dev": true, + "license": "BSD-2-Clause" + }, + "node_modules/whatwg-url": { + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/whatwg-url/-/whatwg-url-5.0.0.tgz", + "integrity": "sha512-saE57nupxk6v3HY35+jzBwYa0rKSy0XR8JSxZPwgLr7ys0IBzhGviA1/TUGJLmSVqs8pb9AnvICXEuOHLprYTw==", + "dev": true, + "license": "MIT", + "dependencies": { + "tr46": "~0.0.3", + "webidl-conversions": "^3.0.0" + } + }, "node_modules/which": { "version": "1.3.1", "resolved": "https://registry.npmjs.org/which/-/which-1.3.1.tgz", diff --git a/webapp/package.json b/webapp/package.json index 5e211de0..3c83c9ca 100644 --- a/webapp/package.json +++ b/webapp/package.json @@ -5,6 +5,7 @@ "ng": "ng", "start": "ng serve", "build": "ng build", + "generate:api": "openapi-generator-cli generate --generator-key inse-service", "watch": "ng build --watch --configuration development", "test": "ng test" }, @@ -30,6 +31,7 @@ "@angular/build": "^21.2.12", "@angular/cli": "^21.2.12", "@angular/compiler-cli": "^21.2.14", + "@openapitools/openapi-generator-cli": "^2.34.0", "@types/jasmine": "~5.1.0", "jasmine-core": "~5.1.0", "karma": "~6.4.0", diff --git a/webapp/src/app/api/.gitignore b/webapp/src/app/api/.gitignore new file mode 100644 index 00000000..149b5765 --- /dev/null +++ b/webapp/src/app/api/.gitignore @@ -0,0 +1,4 @@ +wwwroot/*.js +node_modules +typings +dist diff --git a/webapp/src/app/api/.openapi-generator-ignore b/webapp/src/app/api/.openapi-generator-ignore new file mode 100644 index 00000000..7484ee59 --- /dev/null +++ b/webapp/src/app/api/.openapi-generator-ignore @@ -0,0 +1,23 @@ +# OpenAPI Generator Ignore +# Generated by openapi-generator https://github.com/openapitools/openapi-generator + +# Use this file to prevent files from being overwritten by the generator. +# The patterns follow closely to .gitignore or .dockerignore. + +# As an example, the C# client generator defines ApiClient.cs. +# You can make changes and tell OpenAPI Generator to ignore just this file by uncommenting the following line: +#ApiClient.cs + +# You can match any string of characters against a directory, file or extension with a single asterisk (*): +#foo/*/qux +# The above matches foo/bar/qux and foo/baz/qux, but not foo/bar/baz/qux + +# You can recursively match patterns against a directory, file or extension with a double asterisk (**): +#foo/**/qux +# This matches foo/bar/qux, foo/baz/qux, and foo/bar/baz/qux + +# You can also negate patterns with an exclamation (!). +# For example, you can ignore all files in a docs folder with the file extension .md: +#docs/*.md +# Then explicitly reverse the ignore rule for a single file: +#!docs/README.md diff --git a/webapp/src/app/api/.openapi-generator/FILES b/webapp/src/app/api/.openapi-generator/FILES new file mode 100644 index 00000000..f3f08591 --- /dev/null +++ b/webapp/src/app/api/.openapi-generator/FILES @@ -0,0 +1,31 @@ +.gitignore +README.md +api.base.service.ts +api.module.ts +api/api.ts +api/items.service.ts +api/items.serviceInterface.ts +api/persons.service.ts +api/persons.serviceInterface.ts +api/works.service.ts +api/works.serviceInterface.ts +configuration.ts +encoder.ts +git_push.sh +index.ts +model/affiliation.ts +model/http-validation-error.ts +model/item-create.ts +model/item-page.ts +model/item.ts +model/models.ts +model/person-bio.ts +model/person-search-result.ts +model/person.ts +model/validation-error-loc-inner.ts +model/validation-error.ts +model/work-page.ts +model/work-summary.ts +param.ts +provide-api.ts +variables.ts diff --git a/webapp/src/app/api/.openapi-generator/VERSION b/webapp/src/app/api/.openapi-generator/VERSION new file mode 100644 index 00000000..6328c542 --- /dev/null +++ b/webapp/src/app/api/.openapi-generator/VERSION @@ -0,0 +1 @@ +7.17.0 diff --git a/webapp/src/app/api/README.md b/webapp/src/app/api/README.md new file mode 100644 index 00000000..c2ba935a --- /dev/null +++ b/webapp/src/app/api/README.md @@ -0,0 +1,185 @@ +# @ + +No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + +The version of the OpenAPI document: 1.0.0 + +## Building + +To install the required dependencies and to build the typescript sources run: + +```console +npm install +npm run build +``` + +## Publishing + +First build the package then run `npm publish dist` (don't forget to specify the `dist` folder!) + +## Consuming + +Navigate to the folder of your consuming project and run one of next commands. + +_published:_ + +```console +npm install @ --save +``` + +_without publishing (not recommended):_ + +```console +npm install PATH_TO_GENERATED_PACKAGE/dist.tgz --save +``` + +_It's important to take the tgz file, otherwise you'll get trouble with links on windows_ + +_using `npm link`:_ + +In PATH_TO_GENERATED_PACKAGE/dist: + +```console +npm link +``` + +In your project: + +```console +npm link +``` + +__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. + +### General usage + +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() + ], +}; +``` + +**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 ''; +``` + +If different from the generated base path, during app bootstrap, you can provide the base path to your service. + +```typescript +import { ApplicationConfig } from '@angular/core'; +import { provideHttpClient } from '@angular/common/http'; +import { provideApi } from ''; + +export const appConfig: ApplicationConfig = { + providers: [ + // ... + provideHttpClient(), + provideApi('http://localhost:9999') + ], +}; +``` + +```typescript +// with a custom configuration +import { ApplicationConfig } from '@angular/core'; +import { provideHttpClient } from '@angular/common/http'; +import { provideApi } from ''; + +export const appConfig: ApplicationConfig = { + providers: [ + // ... + provideHttpClient(), + provideApi({ + withCredentials: true, + username: 'user', + password: 'password' + }) + ], +}; +``` + +```typescript +// with factory building a custom configuration +import { ApplicationConfig } from '@angular/core'; +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 + } + ], +}; +``` + +### Using multiple OpenAPI files / APIs + +In order to use multiple APIs generated from different OpenAPI files, +you can create an alias name when importing the modules +in order to avoid naming conflicts: + +```typescript +import { provideApi as provideUserApi } from 'my-user-api-path'; +import { provideApi as provideAdminApi } from 'my-admin-api-path'; +import { HttpClientModule } from '@angular/common/http'; +import { environment } from '../environments/environment'; + +export const appConfig: ApplicationConfig = { + providers: [ + // ... + provideHttpClient(), + provideUserApi(environment.basePath), + provideAdminApi(environment.basePath), + ], +}; +``` + +### Customizing path parameter encoding + +Without further customization, only [path-parameters][parameter-locations-url] of [style][style-values-url] 'simple' +and Dates for format 'date-time' are encoded correctly. + +Other styles (e.g. "matrix") are not that easy to encode +and thus are best delegated to other libraries (e.g.: [@honoluluhenk/http-param-expander]). + +To implement your own parameter encoding (or call another library), +pass an arrow-function or method-reference to the `encodeParam` property of the Configuration-object +(see [General Usage](#general-usage) above). + +Example value for use in your Configuration-Provider: + +```typescript +new Configuration({ + encodeParam: (param: Param) => myFancyParamEncoder(param), +}) +``` + +[parameter-locations-url]: https://github.com/OAI/OpenAPI-Specification/blob/main/versions/3.1.0.md#parameter-locations +[style-values-url]: https://github.com/OAI/OpenAPI-Specification/blob/main/versions/3.1.0.md#style-values +[@honoluluhenk/http-param-expander]: https://www.npmjs.com/package/@honoluluhenk/http-param-expander diff --git a/webapp/src/app/api/api.base.service.ts b/webapp/src/app/api/api.base.service.ts new file mode 100644 index 00000000..210d0c5b --- /dev/null +++ b/webapp/src/app/api/api.base.service.ts @@ -0,0 +1,83 @@ +/** + * My App Service + * + * + * + * 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 { CustomHttpParameterCodec } from './encoder'; +import { Configuration } from './configuration'; + +export class BaseService { + protected basePath = 'http://localhost'; + 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; + } + + if (typeof basePath !== 'string') { + basePath = this.basePath; + } + this.configuration.basePath = basePath; + } + this.encoder = this.configuration.encoder || new CustomHttpParameterCodec(); + } + + protected canConsumeForm(consumes: string[]): boolean { + return consumes.indexOf('multipart/form-data') !== -1; + } + + protected addToHttpParams(httpParams: HttpParams, value: any, key?: string, isDeep: boolean = false): HttpParams { + // If the value is an object (but not a Date), recursively add its keys. + if (typeof value === 'object' && !(value instanceof Date)) { + return this.addToHttpParamsRecursive(httpParams, value, isDeep ? key : undefined, isDeep); + } + return this.addToHttpParamsRecursive(httpParams, value, key); + } + + protected addToHttpParamsRecursive(httpParams: HttpParams, value?: any, key?: string, isDeep: boolean = false): HttpParams { + if (value === null || value === undefined) { + return httpParams; + } + if (typeof value === 'object') { + // If JSON format is preferred, key must be provided. + if (key != null) { + return isDeep + ? Object.keys(value as Record).reduce( + (hp, k) => hp.append(`${key}[${k}]`, value[k]), + httpParams, + ) + : httpParams.append(key, JSON.stringify(value)); + } + // Otherwise, if it's an array, add each element. + if (Array.isArray(value)) { + value.forEach(elem => httpParams = this.addToHttpParamsRecursive(httpParams, elem, key)); + } else if (value instanceof Date) { + if (key != null) { + httpParams = httpParams.append(key, value.toISOString()); + } else { + throw Error("key may not be null if value is Date"); + } + } 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 new file mode 100644 index 00000000..58d341fb --- /dev/null +++ b/webapp/src/app/api/api.module.ts @@ -0,0 +1,30 @@ +import { NgModule, ModuleWithProviders, SkipSelf, Optional } from '@angular/core'; +import { Configuration } from './configuration'; +import { HttpClient } from '@angular/common/http'; + + +@NgModule({ + imports: [], + declarations: [], + exports: [], + providers: [] +}) +export class ApiModule { + 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'); + } + } +} diff --git a/webapp/src/app/api/api/api.ts b/webapp/src/app/api/api/api.ts new file mode 100644 index 00000000..06cb77df --- /dev/null +++ b/webapp/src/app/api/api/api.ts @@ -0,0 +1,10 @@ +export * from './items.service'; +import { ItemsOpenApiService } from './items.service'; +export * from './items.serviceInterface'; +export * from './persons.service'; +import { PersonsOpenApiService } from './persons.service'; +export * from './persons.serviceInterface'; +export * from './works.service'; +import { WorksOpenApiService } from './works.service'; +export * from './works.serviceInterface'; +export const APIS = [ItemsOpenApiService, PersonsOpenApiService, WorksOpenApiService]; diff --git a/webapp/src/app/api/api/items.service.ts b/webapp/src/app/api/api/items.service.ts new file mode 100644 index 00000000..d887f000 --- /dev/null +++ b/webapp/src/app/api/api/items.service.ts @@ -0,0 +1,366 @@ +/** + * My App Service + * + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ +/* tslint:disable:no-unused-variable member-ordering */ + +import { Inject, Injectable, Optional } from '@angular/core'; +import { HttpClient, HttpHeaders, HttpParams, + HttpResponse, HttpEvent, HttpParameterCodec, HttpContext + } from '@angular/common/http'; +import { CustomHttpParameterCodec } from '../encoder'; +import { Observable } from 'rxjs'; + +// @ts-ignore +import { HTTPValidationError } from '../model/http-validation-error'; +// @ts-ignore +import { Item } from '../model/item'; +// @ts-ignore +import { ItemCreate } from '../model/item-create'; +// @ts-ignore +import { ItemPage } from '../model/item-page'; + +// @ts-ignore +import { BASE_PATH, COLLECTION_FORMATS } from '../variables'; +import { Configuration } from '../configuration'; +import { BaseService } from '../api.base.service'; +import { + ItemsOpenApiServiceInterface +} from './items.serviceInterface'; + + + +@Injectable({ + providedIn: 'root' +}) +export class ItemsOpenApiService extends BaseService implements ItemsOpenApiServiceInterface { + + constructor(protected httpClient: HttpClient, @Optional() @Inject(BASE_PATH) basePath: string|string[], @Optional() configuration?: Configuration) { + super(basePath, configuration); + } + + /** + * Adds a new item. + * @endpoint post /items + * @param itemCreate + * @param observe set whether or not to return the data Observable as the body, response or events. defaults to returning the body. + * @param reportProgress flag to report request and response progress. + */ + public addItem(itemCreate: ItemCreate, observe?: 'body', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable; + public addItem(itemCreate: ItemCreate, observe?: 'response', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable>; + public addItem(itemCreate: ItemCreate, observe?: 'events', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable>; + public addItem(itemCreate: ItemCreate, observe: any = 'body', reportProgress: boolean = false, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable { + if (itemCreate === null || itemCreate === undefined) { + throw new Error('Required parameter itemCreate was null or undefined when calling addItem.'); + } + + let localVarHeaders = this.defaultHeaders; + + // authentication (bearer) required + localVarHeaders = this.configuration.addCredentialToHeaders('bearer', '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 = `/items`; + const { basePath, withCredentials } = this.configuration; + return this.httpClient.request('post', `${basePath}${localVarPath}`, + { + context: localVarHttpContext, + body: itemCreate, + responseType: responseType_, + ...(withCredentials ? { withCredentials } : {}), + headers: localVarHeaders, + observe: observe, + ...(localVarTransferCache !== undefined ? { transferCache: localVarTransferCache } : {}), + reportProgress: reportProgress + } + ); + } + + /** + * Deletes the item with the id. + * @endpoint delete /items/{id} + * @param id The item 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 deleteItem(id: number, observe?: 'body', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable; + public deleteItem(id: number, observe?: 'response', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable>; + public deleteItem(id: number, observe?: 'events', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable>; + public deleteItem(id: number, 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 deleteItem.'); + } + + let localVarHeaders = this.defaultHeaders; + + // authentication (bearer) required + localVarHeaders = this.configuration.addCredentialToHeaders('bearer', '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 = `/items/${this.configuration.encodeParam({name: "id", value: id, in: "path", style: "simple", explode: false, dataType: "number", dataFormat: undefined})}`; + const { basePath, withCredentials } = this.configuration; + return this.httpClient.request('delete', `${basePath}${localVarPath}`, + { + context: localVarHttpContext, + responseType: responseType_, + ...(withCredentials ? { withCredentials } : {}), + headers: localVarHeaders, + observe: observe, + ...(localVarTransferCache !== undefined ? { transferCache: localVarTransferCache } : {}), + reportProgress: reportProgress + } + ); + } + + /** + * Returns the item with the id. + * @endpoint get /items/{id} + * @param id The item 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 getItem(id: number, observe?: 'body', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable; + public getItem(id: number, observe?: 'response', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable>; + public getItem(id: number, observe?: 'events', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable>; + public getItem(id: number, 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 getItem.'); + } + + let localVarHeaders = this.defaultHeaders; + + // authentication (bearer) required + localVarHeaders = this.configuration.addCredentialToHeaders('bearer', '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 = `/items/${this.configuration.encodeParam({name: "id", value: id, in: "path", style: "simple", explode: false, dataType: "number", 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 items. + * @endpoint get /items + * @param pageOffset The page offset. + * @param pageSize The page size. + * @param observe set whether or not to return the data Observable as the body, response or events. defaults to returning the body. + * @param reportProgress flag to report request and response progress. + */ + public getItems(pageOffset?: number, pageSize?: number, observe?: 'body', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable; + public getItems(pageOffset?: number, pageSize?: number, observe?: 'response', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable>; + public getItems(pageOffset?: number, pageSize?: number, observe?: 'events', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable>; + public getItems(pageOffset?: number, pageSize?: 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, + pageOffset, 'pageOffset'); + localVarQueryParameters = this.addToHttpParams(localVarQueryParameters, + pageSize, 'pageSize'); + + let localVarHeaders = this.defaultHeaders; + + // authentication (bearer) required + localVarHeaders = this.configuration.addCredentialToHeaders('bearer', '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 = `/items`; + 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 + } + ); + } + + /** + * Updates the item with the id. + * @endpoint put /items/{id} + * @param id The item id. + * @param itemCreate + * @param observe set whether or not to return the data Observable as the body, response or events. defaults to returning the body. + * @param reportProgress flag to report request and response progress. + */ + public updateItem(id: number, itemCreate: ItemCreate, observe?: 'body', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable; + public updateItem(id: number, itemCreate: ItemCreate, observe?: 'response', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable>; + public updateItem(id: number, itemCreate: ItemCreate, observe?: 'events', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable>; + public updateItem(id: number, itemCreate: ItemCreate, 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 updateItem.'); + } + if (itemCreate === null || itemCreate === undefined) { + throw new Error('Required parameter itemCreate was null or undefined when calling updateItem.'); + } + + let localVarHeaders = this.defaultHeaders; + + // authentication (bearer) required + localVarHeaders = this.configuration.addCredentialToHeaders('bearer', '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 = `/items/${this.configuration.encodeParam({name: "id", value: id, in: "path", style: "simple", explode: false, dataType: "number", dataFormat: undefined})}`; + const { basePath, withCredentials } = this.configuration; + return this.httpClient.request('put', `${basePath}${localVarPath}`, + { + context: localVarHttpContext, + body: itemCreate, + responseType: responseType_, + ...(withCredentials ? { withCredentials } : {}), + headers: localVarHeaders, + observe: observe, + ...(localVarTransferCache !== undefined ? { transferCache: localVarTransferCache } : {}), + reportProgress: reportProgress + } + ); + } + +} diff --git a/webapp/src/app/api/api/items.serviceInterface.ts b/webapp/src/app/api/api/items.serviceInterface.ts new file mode 100644 index 00000000..14d623a4 --- /dev/null +++ b/webapp/src/app/api/api/items.serviceInterface.ts @@ -0,0 +1,70 @@ +/** + * My App Service + * + * + * + * 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 } from '@angular/common/http'; + +import { Observable } from 'rxjs'; + +import { HTTPValidationError } from '../model/models'; +import { Item } from '../model/models'; +import { ItemCreate } from '../model/models'; +import { ItemPage } from '../model/models'; + + +import { Configuration } from '../configuration'; + + + +export interface ItemsOpenApiServiceInterface { + defaultHeaders: HttpHeaders; + configuration: Configuration; + + /** + * Adds a new item. + * + * @endpoint post /items + * @param itemCreate + */ + addItem(itemCreate: ItemCreate, extraHttpRequestParams?: any): Observable; + + /** + * Deletes the item with the id. + * + * @endpoint delete /items/{id} + * @param id The item id. + */ + deleteItem(id: number, extraHttpRequestParams?: any): Observable; + + /** + * Returns the item with the id. + * + * @endpoint get /items/{id} + * @param id The item id. + */ + getItem(id: number, extraHttpRequestParams?: any): Observable; + + /** + * Returns a page of items. + * + * @endpoint get /items + * @param pageOffset The page offset. + * @param pageSize The page size. + */ + getItems(pageOffset?: number, pageSize?: number, extraHttpRequestParams?: any): Observable; + + /** + * Updates the item with the id. + * + * @endpoint put /items/{id} + * @param id The item id. + * @param itemCreate + */ + updateItem(id: number, itemCreate: ItemCreate, extraHttpRequestParams?: any): Observable; + +} diff --git a/webapp/src/app/api/api/persons.service.ts b/webapp/src/app/api/api/persons.service.ts new file mode 100644 index 00000000..f1c1c23e --- /dev/null +++ b/webapp/src/app/api/api/persons.service.ts @@ -0,0 +1,165 @@ +/** + * My App Service + * + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ +/* tslint:disable:no-unused-variable member-ordering */ + +import { Inject, Injectable, Optional } from '@angular/core'; +import { HttpClient, HttpHeaders, HttpParams, + HttpResponse, HttpEvent, HttpParameterCodec, HttpContext + } from '@angular/common/http'; +import { CustomHttpParameterCodec } from '../encoder'; +import { Observable } from 'rxjs'; + +// @ts-ignore +import { HTTPValidationError } from '../model/http-validation-error'; +// @ts-ignore +import { PersonBio } from '../model/person-bio'; +// @ts-ignore +import { PersonSearchResult } from '../model/person-search-result'; + +// @ts-ignore +import { BASE_PATH, COLLECTION_FORMATS } from '../variables'; +import { Configuration } from '../configuration'; +import { BaseService } from '../api.base.service'; +import { + PersonsOpenApiServiceInterface +} from './persons.serviceInterface'; + + + +@Injectable({ + providedIn: 'root' +}) +export class PersonsOpenApiService extends BaseService implements PersonsOpenApiServiceInterface { + + 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 /persons/bio + * @param authorId OpenAlex author ID (e.g., A5093075883) + * @param observe set whether or not to return 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, observe?: 'body', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable; + public generatePersonBio(authorId: string, observe?: 'response', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable>; + public generatePersonBio(authorId: string, observe?: 'events', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable>; + public generatePersonBio(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 generatePersonBio.'); + } + + let localVarQueryParameters = new HttpParams({encoder: this.encoder}); + localVarQueryParameters = this.addToHttpParams(localVarQueryParameters, + authorId, 'author_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 = `/persons/bio`; + const { basePath, withCredentials } = this.configuration; + return this.httpClient.request('get', `${basePath}${localVarPath}`, + { + context: localVarHttpContext, + params: localVarQueryParameters, + responseType: responseType_, + ...(withCredentials ? { withCredentials } : {}), + headers: localVarHeaders, + observe: observe, + ...(localVarTransferCache !== undefined ? { transferCache: localVarTransferCache } : {}), + reportProgress: reportProgress + } + ); + } + + /** + * Searches for persons by ID or name. + * @endpoint get /persons/search + * @param authorId OpenAlex author ID (e.g., A5093075883) + * @param query Search query (e.g., Arman AND Arzani) + * @param observe set whether or not to return 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, observe?: 'body', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable; + public searchPersons(authorId?: string, query?: string, observe?: 'response', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable>; + public searchPersons(authorId?: string, query?: string, observe?: 'events', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable>; + public searchPersons(authorId?: string, query?: string, observe: any = 'body', reportProgress: boolean = false, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable { + + let localVarQueryParameters = new HttpParams({encoder: this.encoder}); + localVarQueryParameters = this.addToHttpParams(localVarQueryParameters, + authorId, 'author_id'); + localVarQueryParameters = this.addToHttpParams(localVarQueryParameters, + query, 'query'); + + let localVarHeaders = this.defaultHeaders; + + const localVarHttpHeaderAcceptSelected: string | undefined = options?.httpHeaderAccept ?? this.configuration.selectHeaderAccept([ + 'application/json' + ]); + if (localVarHttpHeaderAcceptSelected !== undefined) { + localVarHeaders = localVarHeaders.set('Accept', localVarHttpHeaderAcceptSelected); + } + + const localVarHttpContext: HttpContext = options?.context ?? new HttpContext(); + + const localVarTransferCache: boolean = options?.transferCache ?? true; + + + let responseType_: 'text' | 'json' | 'blob' = 'json'; + if (localVarHttpHeaderAcceptSelected) { + if (localVarHttpHeaderAcceptSelected.startsWith('text')) { + responseType_ = 'text'; + } else if (this.configuration.isJsonMime(localVarHttpHeaderAcceptSelected)) { + responseType_ = 'json'; + } else { + responseType_ = 'blob'; + } + } + + let localVarPath = `/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 + } + ); + } + +} diff --git a/webapp/src/app/api/api/persons.serviceInterface.ts b/webapp/src/app/api/api/persons.serviceInterface.ts new file mode 100644 index 00000000..ad0fcf59 --- /dev/null +++ b/webapp/src/app/api/api/persons.serviceInterface.ts @@ -0,0 +1,44 @@ +/** + * My App Service + * + * + * + * 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 } from '@angular/common/http'; + +import { Observable } from 'rxjs'; + +import { HTTPValidationError } from '../model/models'; +import { PersonBio } from '../model/models'; +import { PersonSearchResult } from '../model/models'; + + +import { Configuration } from '../configuration'; + + + +export interface PersonsOpenApiServiceInterface { + defaultHeaders: HttpHeaders; + configuration: Configuration; + + /** + * Generates a bio for a person by author ID. + * + * @endpoint get /persons/bio + * @param authorId OpenAlex author ID (e.g., A5093075883) + */ + generatePersonBio(authorId: string, extraHttpRequestParams?: any): Observable; + + /** + * Searches for persons by ID or name. + * + * @endpoint get /persons/search + * @param authorId OpenAlex author ID (e.g., A5093075883) + * @param query Search query (e.g., Arman AND Arzani) + */ + searchPersons(authorId?: string, query?: string, extraHttpRequestParams?: any): Observable; + +} diff --git a/webapp/src/app/api/api/works.service.ts b/webapp/src/app/api/api/works.service.ts new file mode 100644 index 00000000..f7993e7a --- /dev/null +++ b/webapp/src/app/api/api/works.service.ts @@ -0,0 +1,110 @@ +/** + * My App Service + * + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ +/* tslint:disable:no-unused-variable member-ordering */ + +import { Inject, Injectable, Optional } from '@angular/core'; +import { HttpClient, HttpHeaders, HttpParams, + HttpResponse, HttpEvent, HttpParameterCodec, HttpContext + } from '@angular/common/http'; +import { CustomHttpParameterCodec } from '../encoder'; +import { Observable } from 'rxjs'; + +// @ts-ignore +import { HTTPValidationError } from '../model/http-validation-error'; +// @ts-ignore +import { WorkPage } from '../model/work-page'; + +// @ts-ignore +import { BASE_PATH, COLLECTION_FORMATS } from '../variables'; +import { Configuration } from '../configuration'; +import { BaseService } from '../api.base.service'; +import { + WorksOpenApiServiceInterface +} from './works.serviceInterface'; + + + +@Injectable({ + providedIn: 'root' +}) +export class WorksOpenApiService extends BaseService implements WorksOpenApiServiceInterface { + + constructor(protected httpClient: HttpClient, @Optional() @Inject(BASE_PATH) basePath: string|string[], @Optional() configuration?: Configuration) { + super(basePath, configuration); + } + + /** + * Returns a page of works for an author. + * @endpoint get /authors/{author_id}/works + * @param authorId The author id, for example A5023888391. + * @param page The page number. + * @param size The page size. + * @param observe set whether or not to return the data Observable as the body, response or events. defaults to returning the body. + * @param reportProgress flag to report request and response progress. + */ + public getAuthorWorks(authorId: string, page?: number, size?: number, observe?: 'body', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable; + public getAuthorWorks(authorId: string, page?: number, size?: number, observe?: 'response', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable>; + public getAuthorWorks(authorId: string, page?: number, size?: number, observe?: 'events', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable>; + public getAuthorWorks(authorId: string, page?: number, size?: 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 getAuthorWorks.'); + } + + let localVarQueryParameters = new HttpParams({encoder: this.encoder}); + localVarQueryParameters = this.addToHttpParams(localVarQueryParameters, + page, 'page'); + localVarQueryParameters = this.addToHttpParams(localVarQueryParameters, + size, 'size'); + + let localVarHeaders = this.defaultHeaders; + + // authentication (bearer) required + localVarHeaders = this.configuration.addCredentialToHeaders('bearer', '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 = `/authors/${this.configuration.encodeParam({name: "authorId", value: authorId, in: "path", style: "simple", explode: false, dataType: "string", dataFormat: undefined})}/works`; + const { basePath, withCredentials } = this.configuration; + return this.httpClient.request('get', `${basePath}${localVarPath}`, + { + context: localVarHttpContext, + params: localVarQueryParameters, + responseType: responseType_, + ...(withCredentials ? { withCredentials } : {}), + headers: localVarHeaders, + observe: observe, + ...(localVarTransferCache !== undefined ? { transferCache: localVarTransferCache } : {}), + reportProgress: reportProgress + } + ); + } + +} diff --git a/webapp/src/app/api/api/works.serviceInterface.ts b/webapp/src/app/api/api/works.serviceInterface.ts new file mode 100644 index 00000000..c739cc78 --- /dev/null +++ b/webapp/src/app/api/api/works.serviceInterface.ts @@ -0,0 +1,36 @@ +/** + * My App Service + * + * + * + * 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 } from '@angular/common/http'; + +import { Observable } from 'rxjs'; + +import { HTTPValidationError } from '../model/models'; +import { WorkPage } from '../model/models'; + + +import { Configuration } from '../configuration'; + + + +export interface WorksOpenApiServiceInterface { + defaultHeaders: HttpHeaders; + configuration: Configuration; + + /** + * Returns a page of works for an author. + * + * @endpoint get /authors/{author_id}/works + * @param authorId The author id, for example A5023888391. + * @param page The page number. + * @param size The page size. + */ + getAuthorWorks(authorId: string, page?: number, size?: number, extraHttpRequestParams?: any): Observable; + +} diff --git a/webapp/src/app/api/configuration.ts b/webapp/src/app/api/configuration.ts new file mode 100644 index 00000000..c39ce2d6 --- /dev/null +++ b/webapp/src/app/api/configuration.ts @@ -0,0 +1,193 @@ +import { HttpHeaders, HttpParams, HttpParameterCodec } from '@angular/common/http'; +import { Param } from './param'; + +export interface ConfigurationParameters { + /** + * @deprecated Since 5.0. Use credentials instead + */ + apiKeys?: {[ key: string ]: string}; + username?: string; + password?: string; + /** + * @deprecated Since 5.0. Use credentials instead + */ + accessToken?: string | (() => string); + basePath?: string; + withCredentials?: boolean; + /** + * Takes care of encoding query- and form-parameters. + */ + encoder?: HttpParameterCodec; + /** + * Override the default method for encoding path parameters in various + * styles. + *

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

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

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

+ */ + encodeParam: (param: Param) => string; + /** + * The keys are the names in the securitySchemes section of the OpenAPI + * document. They should map to the value used for authentication + * minus any standard prefixes such as 'Basic' or 'Bearer'. + */ + credentials: {[ key: string ]: string | (() => string | undefined)}; + +constructor({ accessToken, apiKeys, basePath, credentials, encodeParam, encoder, password, username, withCredentials }: ConfigurationParameters = {}) { + if (apiKeys) { + this.apiKeys = apiKeys; + } + if (username !== undefined) { + this.username = username; + } + if (password !== undefined) { + this.password = password; + } + if (accessToken !== undefined) { + this.accessToken = accessToken; + } + if (basePath !== undefined) { + this.basePath = basePath; + } + if (withCredentials !== undefined) { + this.withCredentials = withCredentials; + } + if (encoder) { + this.encoder = encoder; + } + this.encodeParam = encodeParam ?? (param => this.defaultEncodeParam(param)); + this.credentials = credentials ?? {}; + + // init default bearer credential + if (!this.credentials['bearer']) { + this.credentials['bearer'] = () => { + return typeof this.accessToken === 'function' + ? this.accessToken() + : this.accessToken; + }; + } + } + + /** + * Select the correct content-type to use for a request. + * Uses {@link Configuration#isJsonMime} to determine the correct content-type. + * If no content type is found return the first found type if the contentTypes is not empty + * @param contentTypes - the array of content types that are available for selection + * @returns the selected content-type or undefined if no selection could be made. + */ + public selectHeaderContentType (contentTypes: string[]): string | undefined { + if (contentTypes.length === 0) { + return undefined; + } + + const type = contentTypes.find((x: string) => this.isJsonMime(x)); + if (type === undefined) { + return contentTypes[0]; + } + return type; + } + + /** + * Select the correct accept content-type to use for a request. + * Uses {@link Configuration#isJsonMime} to determine the correct accept content-type. + * If no content type is found return the first found type if the contentTypes is not empty + * @param accepts - the array of content types that are available for selection. + * @returns the selected content-type or undefined if no selection could be made. + */ + public selectHeaderAccept(accepts: string[]): string | undefined { + if (accepts.length === 0) { + return undefined; + } + + const type = accepts.find((x: string) => this.isJsonMime(x)); + if (type === undefined) { + return accepts[0]; + } + return type; + } + + /** + * Check if the given MIME is a JSON MIME. + * JSON MIME examples: + * application/json + * application/json; charset=UTF8 + * APPLICATION/JSON + * application/vnd.company+json + * @param mime - MIME (Multipurpose Internet Mail Extensions) + * @return True if the given MIME is JSON, false otherwise. + */ + public isJsonMime(mime: string): boolean { + const jsonMime: RegExp = new RegExp('^(application\/json|[^;/ \t]+\/[^;/ \t]+[+]json)[ \t]*(;.*)?$', 'i'); + return mime !== null && (jsonMime.test(mime) || mime.toLowerCase() === 'application/json-patch+json'); + } + + public lookupCredential(key: string): string | undefined { + const value = this.credentials[key]; + return typeof value === 'function' + ? value() + : value; + } + + public addCredentialToHeaders(credentialKey: string, headerName: string, headers: HttpHeaders, prefix?: string): HttpHeaders { + const value = this.lookupCredential(credentialKey); + return value + ? headers.set(headerName, (prefix ?? '') + value) + : headers; + } + + public addCredentialToQuery(credentialKey: string, paramName: string, query: HttpParams): HttpParams { + const value = this.lookupCredential(credentialKey); + return value + ? query.set(paramName, value) + : query; + } + + private defaultEncodeParam(param: Param): string { + // This implementation exists as fallback for missing configuration + // and for backwards compatibility to older typescript-angular generator versions. + // It only works for the 'simple' parameter style. + // Date-handling only works for the 'date-time' format. + // All other styles and Date-formats are probably handled incorrectly. + // + // But: if that's all you need (i.e.: the most common use-case): no need for customization! + + const value = param.dataFormat === 'date-time' && param.value instanceof Date + ? (param.value as Date).toISOString() + : param.value; + + return encodeURIComponent(String(value)); + } +} diff --git a/webapp/src/app/api/encoder.ts b/webapp/src/app/api/encoder.ts new file mode 100644 index 00000000..138c4d5c --- /dev/null +++ b/webapp/src/app/api/encoder.ts @@ -0,0 +1,20 @@ +import { HttpParameterCodec } from '@angular/common/http'; + +/** + * Custom HttpParameterCodec + * 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); + } +} diff --git a/webapp/src/app/api/git_push.sh b/webapp/src/app/api/git_push.sh new file mode 100644 index 00000000..f53a75d4 --- /dev/null +++ b/webapp/src/app/api/git_push.sh @@ -0,0 +1,57 @@ +#!/bin/sh +# ref: https://help.github.com/articles/adding-an-existing-project-to-github-using-the-command-line/ +# +# Usage example: /bin/sh ./git_push.sh wing328 openapi-petstore-perl "minor update" "gitlab.com" + +git_user_id=$1 +git_repo_id=$2 +release_note=$3 +git_host=$4 + +if [ "$git_host" = "" ]; then + git_host="github.com" + echo "[INFO] No command line input provided. Set \$git_host to $git_host" +fi + +if [ "$git_user_id" = "" ]; then + git_user_id="GIT_USER_ID" + echo "[INFO] No command line input provided. Set \$git_user_id to $git_user_id" +fi + +if [ "$git_repo_id" = "" ]; then + git_repo_id="GIT_REPO_ID" + echo "[INFO] No command line input provided. Set \$git_repo_id to $git_repo_id" +fi + +if [ "$release_note" = "" ]; then + release_note="Minor update" + echo "[INFO] No command line input provided. Set \$release_note to $release_note" +fi + +# Initialize the local directory as a Git repository +git init + +# Adds the files in the local repository and stages them for commit. +git add . + +# Commits the tracked changes and prepares them to be pushed to a remote repository. +git commit -m "$release_note" + +# Sets the new remote +git_remote=$(git remote) +if [ "$git_remote" = "" ]; then # git remote not defined + + if [ "$GIT_TOKEN" = "" ]; then + echo "[INFO] \$GIT_TOKEN (environment variable) is not set. Using the git credential in your environment." + git remote add origin https://${git_host}/${git_user_id}/${git_repo_id}.git + else + git remote add origin https://${git_user_id}:"${GIT_TOKEN}"@${git_host}/${git_user_id}/${git_repo_id}.git + fi + +fi + +git pull origin master + +# Pushes (Forces) the changes in the local repository up to the remote repository +echo "Git pushing to https://${git_host}/${git_user_id}/${git_repo_id}.git" +git push origin master 2>&1 | grep -v 'To https' diff --git a/webapp/src/app/api/index.ts b/webapp/src/app/api/index.ts new file mode 100644 index 00000000..02cb7d43 --- /dev/null +++ b/webapp/src/app/api/index.ts @@ -0,0 +1,7 @@ +export * from './api/api'; +export * from './model/models'; +export * from './variables'; +export * from './configuration'; +export * from './api.module'; +export * from './provide-api'; +export * from './param'; diff --git a/webapp/src/app/api/model/affiliation.ts b/webapp/src/app/api/model/affiliation.ts new file mode 100644 index 00000000..3144e9da --- /dev/null +++ b/webapp/src/app/api/model/affiliation.ts @@ -0,0 +1,19 @@ +/** + * My App Service + * + * + * + * 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 Affiliation { + /** + * Institution name. + */ + institution: string; + country_code?: string | null; +} + diff --git a/webapp/src/app/api/model/http-validation-error.ts b/webapp/src/app/api/model/http-validation-error.ts new file mode 100644 index 00000000..187aef43 --- /dev/null +++ b/webapp/src/app/api/model/http-validation-error.ts @@ -0,0 +1,16 @@ +/** + * My App Service + * + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ +import { ValidationError } from './validation-error'; + + +export interface HTTPValidationError { + detail?: Array; +} + diff --git a/webapp/src/app/api/model/item-create.ts b/webapp/src/app/api/model/item-create.ts new file mode 100644 index 00000000..c4240c54 --- /dev/null +++ b/webapp/src/app/api/model/item-create.ts @@ -0,0 +1,22 @@ +/** + * My App Service + * + * + * + * 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 ItemCreate { + /** + * The name of the item. + */ + name: string; + /** + * The description of the item. + */ + description: string; +} + diff --git a/webapp/src/app/api/model/item-page.ts b/webapp/src/app/api/model/item-page.ts new file mode 100644 index 00000000..d5f2f2d2 --- /dev/null +++ b/webapp/src/app/api/model/item-page.ts @@ -0,0 +1,31 @@ +/** + * My App Service + * + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ +import { Item } from './item'; + + +export interface ItemPage { + /** + * The elements of the page. + */ + elements?: Array; + /** + * The page offset in elements. + */ + offset?: number; + /** + * The total number of elements. + */ + total?: number; + /** + * The page size in elements. + */ + size?: number; +} + diff --git a/webapp/src/app/api/model/item.ts b/webapp/src/app/api/model/item.ts new file mode 100644 index 00000000..09b4e861 --- /dev/null +++ b/webapp/src/app/api/model/item.ts @@ -0,0 +1,26 @@ +/** + * My App Service + * + * + * + * 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 Item { + /** + * The id of the entity. + */ + id: number; + /** + * The name of the item. + */ + name: string; + /** + * The description of the item. + */ + description: string; +} + diff --git a/webapp/src/app/api/model/models.ts b/webapp/src/app/api/model/models.ts new file mode 100644 index 00000000..89152744 --- /dev/null +++ b/webapp/src/app/api/model/models.ts @@ -0,0 +1,12 @@ +export * from './affiliation'; +export * from './http-validation-error'; +export * from './item'; +export * from './item-create'; +export * from './item-page'; +export * from './person'; +export * from './person-bio'; +export * from './person-search-result'; +export * from './validation-error'; +export * from './validation-error-loc-inner'; +export * from './work-page'; +export * from './work-summary'; diff --git a/webapp/src/app/api/model/person-bio.ts b/webapp/src/app/api/model/person-bio.ts new file mode 100644 index 00000000..e1294605 --- /dev/null +++ b/webapp/src/app/api/model/person-bio.ts @@ -0,0 +1,18 @@ +/** + * My App Service + * + * + * + * 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; +} + diff --git a/webapp/src/app/api/model/person-search-result.ts b/webapp/src/app/api/model/person-search-result.ts new file mode 100644 index 00000000..f5fcfdd7 --- /dev/null +++ b/webapp/src/app/api/model/person-search-result.ts @@ -0,0 +1,19 @@ +/** + * My App Service + * + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ +import { Person } from './person'; + + +export interface PersonSearchResult { + /** + * List of found persons. + */ + persons?: Array; +} + diff --git a/webapp/src/app/api/model/person.ts b/webapp/src/app/api/model/person.ts new file mode 100644 index 00000000..4ca23fdc --- /dev/null +++ b/webapp/src/app/api/model/person.ts @@ -0,0 +1,39 @@ +/** + * My App Service + * + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ +import { Affiliation } from './affiliation'; + + +export interface Person { + /** + * The person id. + */ + id: string; + /** + * The person name. + */ + name: string; + /** + * Number of works. + */ + works_count: number; + /** + * Number of citations. + */ + cited_by_count: number; + /** + * Affiliations. + */ + affiliations?: Array; + /** + * Research topics. + */ + topics?: Array; +} + diff --git a/webapp/src/app/api/model/validation-error-loc-inner.ts b/webapp/src/app/api/model/validation-error-loc-inner.ts new file mode 100644 index 00000000..4c504818 --- /dev/null +++ b/webapp/src/app/api/model/validation-error-loc-inner.ts @@ -0,0 +1,14 @@ +/** + * My App Service + * + * + * + * 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 { +} + diff --git a/webapp/src/app/api/model/validation-error.ts b/webapp/src/app/api/model/validation-error.ts new file mode 100644 index 00000000..74299d17 --- /dev/null +++ b/webapp/src/app/api/model/validation-error.ts @@ -0,0 +1,18 @@ +/** + * My App Service + * + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ +import { ValidationErrorLocInner } from './validation-error-loc-inner'; + + +export interface ValidationError { + loc: Array; + msg: string; + type: string; +} + diff --git a/webapp/src/app/api/model/work-page.ts b/webapp/src/app/api/model/work-page.ts new file mode 100644 index 00000000..a9073803 --- /dev/null +++ b/webapp/src/app/api/model/work-page.ts @@ -0,0 +1,31 @@ +/** + * My App Service + * + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ +import { WorkSummary } from './work-summary'; + + +export interface WorkPage { + /** + * The works on this page. + */ + elements?: Array; + /** + * The current page number. + */ + page?: number; + /** + * The requested page size. + */ + size?: number; + /** + * The total number of works. + */ + total?: number; +} + diff --git a/webapp/src/app/api/model/work-summary.ts b/webapp/src/app/api/model/work-summary.ts new file mode 100644 index 00000000..f0360ba0 --- /dev/null +++ b/webapp/src/app/api/model/work-summary.ts @@ -0,0 +1,27 @@ +/** + * My App Service + * + * + * + * 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 WorkSummary { + doi?: string | null; + title?: string | null; + type?: string | null; + language?: string | null; + publication_year?: number | null; + /** + * The number of citations. + */ + cited_by_count?: number; + /** + * The display names of the work topics. + */ + topics?: Array; +} + diff --git a/webapp/src/app/api/param.ts b/webapp/src/app/api/param.ts new file mode 100644 index 00000000..78a2d20a --- /dev/null +++ b/webapp/src/app/api/param.ts @@ -0,0 +1,69 @@ +/** + * Standard parameter styles defined by OpenAPI spec + */ +export type StandardParamStyle = + | 'matrix' + | 'label' + | 'form' + | 'simple' + | 'spaceDelimited' + | 'pipeDelimited' + | 'deepObject' + ; + +/** + * The OpenAPI standard {@link StandardParamStyle}s may be extended by custom styles by the user. + */ +export type ParamStyle = StandardParamStyle | string; + +/** + * Standard parameter locations defined by OpenAPI spec + */ +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" + ; + +/** + * Standard {@link DataType}s plus your own types/classes. + */ +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" + ; + +export type DataFormat = StandardDataFormat | string; + +/** + * The parameter to encode. + */ +export interface Param { + name: string; + value: unknown; + in: ParamLocation; + 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 new file mode 100644 index 00000000..19c762ac --- /dev/null +++ b/webapp/src/app/api/provide-api.ts @@ -0,0 +1,15 @@ +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 diff --git a/webapp/src/app/api/variables.ts b/webapp/src/app/api/variables.ts new file mode 100644 index 00000000..6fe58549 --- /dev/null +++ b/webapp/src/app/api/variables.ts @@ -0,0 +1,9 @@ +import { InjectionToken } from '@angular/core'; + +export const BASE_PATH = new InjectionToken('basePath'); +export const COLLECTION_FORMATS = { + 'csv': ',', + 'tsv': ' ', + 'ssv': ' ', + 'pipes': '|' +} diff --git a/webapp/src/app/app.config.ts b/webapp/src/app/app.config.ts index c67b3296..86968aed 100644 --- a/webapp/src/app/app.config.ts +++ b/webapp/src/app/app.config.ts @@ -10,6 +10,7 @@ import { authenticationInterceptor } from './interceptors/authentication.interce import { MAT_FORM_FIELD_DEFAULT_OPTIONS } from '@angular/material/form-field'; import { MatPaginatorIntl } from '@angular/material/paginator'; import { PaginatorIntl } from './utils/paginatorIntl'; +import { provideApi } from './api/provide-api'; registerLocaleData(locale); @@ -20,10 +21,10 @@ export const appConfig: ApplicationConfig = { { provide: MatPaginatorIntl, useClass: PaginatorIntl }, provideRouter(routes), provideHttpClient(withInterceptors([authenticationInterceptor])), + provideApi('/inse-service'), provideAnimationsAsync(), ] }; - diff --git a/webapp/src/app/person-publications/person-publications.component.html b/webapp/src/app/person-publications/person-publications.component.html index a4a48060..588ebb8b 100644 --- a/webapp/src/app/person-publications/person-publications.component.html +++ b/webapp/src/app/person-publications/person-publications.component.html @@ -39,14 +39,14 @@ Zitationen - {{ publication.cited_by_count }} + {{ publication.cited_by_count ?? 0 }} Themen - @for (topic of publication.topics.slice(0, 3); track topic) { + @for (topic of (publication.topics ?? []).slice(0, 3); track topic) { {{ topic }} } @empty { - diff --git a/webapp/src/app/person-publications/person-publications.component.ts b/webapp/src/app/person-publications/person-publications.component.ts index 948483a4..f7eaf029 100644 --- a/webapp/src/app/person-publications/person-publications.component.ts +++ b/webapp/src/app/person-publications/person-publications.component.ts @@ -7,8 +7,9 @@ import { MatProgressSpinnerModule } from '@angular/material/progress-spinner'; import { MatSnackBar, MatSnackBarModule } from '@angular/material/snack-bar'; import { MatTableModule } from '@angular/material/table'; +import { WorkSummary } from '../api'; import { PaginationService } from '../services/pagination.service'; -import { PublicationsService, WorkSummary } from '../services/publications.service'; +import { PublicationsService } from '../services/publications.service'; import { createLoadError } from '../utils/errorHandler'; @Component({ @@ -51,8 +52,8 @@ export class PersonPublicationsComponent implements OnInit { this.loading = true; this.publicationsService.getAuthorWorks(this.authorId, pageIndex + 1, pageSize).subscribe({ next: (page) => { - this.publications = page.elements; - this.total = page.total; + this.publications = page.elements ?? []; + this.total = page.total ?? 0; this.loading = false; }, error: (error) => { @@ -67,7 +68,7 @@ export class PersonPublicationsComponent implements OnInit { this.load(event.pageIndex, event.pageSize); } - doiUrl(doi: string | null): string | null { + doiUrl(doi: string | null | undefined): string | null { if (!doi) return null; return doi.startsWith('http') ? doi : `https://doi.org/${doi}`; } diff --git a/webapp/src/app/services/publications.service.ts b/webapp/src/app/services/publications.service.ts index 4ea0ab7c..be2ef7bf 100644 --- a/webapp/src/app/services/publications.service.ts +++ b/webapp/src/app/services/publications.service.ts @@ -1,43 +1,22 @@ import { Injectable } from '@angular/core'; -import { HttpClient, HttpParams } from '@angular/common/http'; import { Observable } from 'rxjs'; -export interface WorkSummary { - doi: string | null; - title: string | null; - type: string | null; - language: string | null; - publication_year: number | null; - cited_by_count: number; - topics: string[]; -} - -export interface WorkPage { - elements: WorkSummary[]; - page: number; - total: number; - size: number; -} +import { + WorkPage, + WorksOpenApiService, +} from '../api'; @Injectable({ providedIn: 'root', }) export class PublicationsService { - private readonly basePath = '/inse-service'; - - constructor(private http: HttpClient) {} + constructor(private worksApi: WorksOpenApiService) {} getAuthorWorks( authorId: string, page: number = 1, size: number = 10, ): Observable { - const params = new HttpParams() - .set('page', page.toString()) - .set('size', size.toString()); - return this.http.get( - `${this.basePath}/authors/${authorId}/works`, - { params }, - ); + return this.worksApi.getAuthorWorks(authorId, page, size); } } From 26d8caf05cd1ea67544872e7924e7f38425b4592 Mon Sep 17 00:00:00 2001 From: Farajollahi Date: Wed, 27 May 2026 19:43:05 +0200 Subject: [PATCH 03/16] config overall styles --- .../app/app-layout/app-layout.component.html | 89 ++++---- .../app/app-layout/app-layout.component.scss | 154 +++++++++++--- .../src/app/app-menu/app-menu.component.html | 63 +++++- .../src/app/app-menu/app-menu.component.scss | 181 ++++++++++++++++- webapp/src/app/app-menu/app-menu.component.ts | 25 ++- .../person-publications.component.html | 51 ++++- .../person-publications.component.scss | 135 +++++++++++-- .../person-publications.component.ts | 21 +- webapp/src/app/person/person.component.html | 45 ++++- webapp/src/app/person/person.component.scss | 191 ++++++++++++++++++ webapp/src/app/person/person.component.ts | 3 +- webapp/src/styles.scss | 69 +++++++ 12 files changed, 894 insertions(+), 133 deletions(-) diff --git a/webapp/src/app/app-layout/app-layout.component.html b/webapp/src/app/app-layout/app-layout.component.html index 2d6ff8fa..8f21ec4a 100644 --- a/webapp/src/app/app-layout/app-layout.component.html +++ b/webapp/src/app/app-layout/app-layout.component.html @@ -1,49 +1,6 @@ -
- -
- -
- - -
+
- + @if ( (credentialService.authenticated | async) && ((credentialService.superadmin | async) || @@ -58,13 +15,43 @@ } - - + + +
+ @if ( + mediaQuery.matches && (credentialService.authenticated | async) + ) { + + } + +
+ + + +
+ +
+
+ +
+ +
-
diff --git a/webapp/src/app/app-layout/app-layout.component.scss b/webapp/src/app/app-layout/app-layout.component.scss index a95d6680..7d5601cc 100644 --- a/webapp/src/app/app-layout/app-layout.component.scss +++ b/webapp/src/app/app-layout/app-layout.component.scss @@ -1,56 +1,146 @@ @use '@angular/material' as mat; @import '../../m3-theme.scss'; -.footer, .footer a { - font-size: 12px; - color: rgba(255, 255, 255, 0.85); - text-decoration: none; - letter-spacing: 0.02em; +.app-shell { + height: 100svh; + overflow: hidden; + background: var(--sg-background); } -.large { - display: block; -} -.small { - display: none; +.container, +.drawer-container { + width: 100%; + height: 100%; + background: var(--sg-background); } .container { - height: calc(100svh - 84px); - overflow: auto; - background-color: #ffffff; + overflow: hidden; +} + +.content-shell { + min-height: 100%; + background: var(--sg-background); } mat-toolbar.main { - background: linear-gradient(135deg, #1a3a6e 0%, #2259a8 60%, #4072c2 100%); - color: white; - @include mat.elevation(4); + position: sticky; + top: 0; z-index: 10; + display: grid; + grid-template-columns: minmax(190px, 1fr) minmax(320px, 560px) minmax(130px, 1fr); + gap: 24px; + height: 76px; + padding: 0 32px; + background: rgba(255, 255, 255, 0.92); + border-bottom: 1px solid var(--sg-border); + color: var(--sg-text); + backdrop-filter: blur(16px); + box-shadow: none; +} + +.topbar-left, +.topbar-actions { + display: flex; + align-items: center; + gap: 10px; +} + +.topbar-actions { + justify-content: flex-end; +} + +.topbar-actions button { + color: var(--sg-text); +} + +.back-link { + display: inline-flex; + align-items: center; + gap: 10px; + min-height: 42px; + border: 0; + background: transparent; + color: var(--sg-text-muted); + font-size: 13px; + cursor: pointer; +} + +.back-link mat-icon { + font-size: 20px; + width: 20px; + height: 20px; +} + +.search-box { + display: flex; + align-items: center; + gap: 12px; + height: 44px; + align-self: center; + padding: 0 18px; + background: var(--sg-surface-muted); + border: 1px solid var(--sg-border); + border-radius: var(--sg-radius-sm); + color: var(--sg-text-soft); + font-size: 13px; + box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.8); +} + +.search-box input { + width: 100%; + min-width: 0; + border: 0; + outline: 0; + background: transparent; + color: var(--sg-text); +} + +.search-box input::placeholder { + color: var(--sg-text-muted); } .drawer { - width: 230px; - @include mat.elevation(3); - border-right: 1px solid rgba(0,0,0,0.06); + width: var(--sg-sidebar-width); + background: var(--sg-surface); + border-right: 1px solid var(--sg-border); + box-shadow: none; } -.footer-container { - display: flex; - flex-direction: row; - justify-content: center; - align-items: center; - height: 28px; - background: linear-gradient(135deg, #1a3a6e 0%, #2259a8 100%); +.content { + min-height: calc(100svh - 76px); + background: var(--sg-background); +} + +@media (max-width: 900px) { + mat-toolbar.main { + grid-template-columns: auto 1fr auto; + height: auto; + min-height: 72px; + padding: 12px 16px; + gap: 12px; + } + + .back-link span { + display: none; + } + + .search-box { + height: 44px; + } } @media (max-width: 600px) { - .large { - display: none; + mat-toolbar.main { + grid-template-columns: 1fr auto; } - .small { - display: block; + + .search-box { + grid-column: 1 / -1; + order: 3; } - .container { - height: calc(100svh - 76px); + + .content { + min-height: calc(100svh - 124px); } } diff --git a/webapp/src/app/app-menu/app-menu.component.html b/webapp/src/app/app-menu/app-menu.component.html index f30186e0..4f958719 100644 --- a/webapp/src/app/app-menu/app-menu.component.html +++ b/webapp/src/app/app-menu/app-menu.component.html @@ -1,11 +1,52 @@ - -
Navigation
- - list -
Elemente
-
- - person -
Person 0
-
-
+ diff --git a/webapp/src/app/app-menu/app-menu.component.scss b/webapp/src/app/app-menu/app-menu.component.scss index 0796cbf0..b06a1f09 100644 --- a/webapp/src/app/app-menu/app-menu.component.scss +++ b/webapp/src/app/app-menu/app-menu.component.scss @@ -1,7 +1,182 @@ @use '@angular/material' as mat; @import '../../m3-theme.scss'; -.active { - background-color: mat.get-theme-color($light-theme, primary-container); - border-radius: 8px; +.sidebar { + display: flex; + flex-direction: column; + height: 100%; + padding: 28px 16px 22px; + color: var(--sg-text); +} + +.brand { + display: flex; + align-items: center; + gap: 14px; + min-height: 58px; + padding: 0 12px; + color: var(--sg-text); + text-decoration: none; +} + +.brand-mark { + position: relative; + display: block; + width: 42px; + height: 42px; +} + +.brand-mark::before, +.brand-mark::after { + content: ''; + position: absolute; + inset: 10px 8px; + border: 2px solid rgba(0, 87, 255, 0.22); + border-radius: 50%; +} + +.brand-mark::after { + transform: rotate(60deg); +} + +.brand-mark span { + position: absolute; + width: 10px; + height: 10px; + background: var(--sg-primary); + border-radius: 999px; +} + +.brand-mark span:nth-child(1) { left: 16px; top: 0; } +.brand-mark span:nth-child(2) { right: 0; top: 9px; } +.brand-mark span:nth-child(3) { right: 0; bottom: 9px; } +.brand-mark span:nth-child(4) { left: 16px; bottom: 0; } +.brand-mark span:nth-child(5) { left: 0; bottom: 9px; } +.brand-mark span:nth-child(6) { left: 0; top: 9px; } + +.brand-text { + display: flex; + flex-direction: column; + gap: 3px; +} + +.brand-text strong { + font-family: 'Montserrat', 'Open Sans', Arial, sans-serif; + font-size: 24px; + line-height: 1; + font-weight: 700; +} + +.brand-text small { + color: var(--sg-text-muted); + font-size: 11px; + line-height: 1.2; +} + +.nav-list { + display: grid; + gap: 8px; + margin-top: 42px; + padding: 0; +} + +.nav-list a { + height: 46px; + border-radius: var(--sg-radius-sm); + color: var(--sg-text); + font-size: 14px; +} + +.nav-list a.active { + background: var(--sg-primary-soft); + color: var(--sg-primary); +} + +.nav-list a.disabled { + opacity: 0.72; + pointer-events: none; +} + +.nav-list mat-icon, +.utility-link mat-icon { + color: var(--sg-text-soft); +} + +.nav-list a.active mat-icon { + color: var(--sg-primary); +} + +.sidebar-spacer { + flex: 1; + min-height: 28px; +} + +.account-card { + display: grid; + grid-template-columns: 40px 1fr 20px; + align-items: center; + gap: 12px; + min-height: 68px; + padding: 10px 12px; + border: 1px solid var(--sg-border); + border-radius: var(--sg-radius-sm); + background: var(--sg-surface); +} + +.account-card .avatar { + display: grid; + place-items: center; + width: 40px; + height: 40px; + border-radius: 50%; + background: linear-gradient(135deg, #dce8ff, #ffffff); + color: var(--sg-primary); + font-weight: 700; +} + +.account-card strong, +.account-card span { + display: block; +} + +.account-card strong { + font-size: 13px; + font-weight: 600; +} + +.account-card span { + margin-top: 2px; + color: var(--sg-text-muted); + font-size: 11px; +} + +.account-card mat-icon { + color: var(--sg-text-muted); +} + +.sidebar-actions { + display: grid; + gap: 8px; + margin-top: 26px; +} + +.utility-link { + display: flex; + align-items: center; + gap: 18px; + height: 40px; + width: 100%; + padding: 0 12px; + border: 0; + background: transparent; + border-radius: var(--sg-radius-sm); + color: var(--sg-text); + text-align: left; + text-decoration: none; + cursor: pointer; + font-size: 14px; +} + +.utility-link:hover { + background: var(--sg-surface-muted); } diff --git a/webapp/src/app/app-menu/app-menu.component.ts b/webapp/src/app/app-menu/app-menu.component.ts index b206c3dd..15f20024 100644 --- a/webapp/src/app/app-menu/app-menu.component.ts +++ b/webapp/src/app/app-menu/app-menu.component.ts @@ -1,19 +1,28 @@ - import { Component } from '@angular/core'; +import { CommonModule } from '@angular/common'; import { RouterLink, RouterLinkActive } from '@angular/router'; import { MatIconModule } from '@angular/material/icon'; import { MatListModule } from '@angular/material/list'; import { CredentialService } from '../services/credential.service'; @Component({ - selector: 'app-menu', - imports: [RouterLink, MatIconModule, MatListModule, RouterLinkActive], - templateUrl: './app-menu.component.html', - styleUrl: './app-menu.component.scss', - standalone: true, + selector: 'app-menu', + imports: [ + CommonModule, + RouterLink, + MatIconModule, + MatListModule, + RouterLinkActive, + ], + templateUrl: './app-menu.component.html', + styleUrl: './app-menu.component.scss', + standalone: true, }) export class AppMenuComponent { + navItems = [ + { label: 'Dashboard', icon: 'dashboard', route: '/items', disabled: false }, + { label: 'Personen', icon: 'groups', route: '/person/0', disabled: false }, + ]; - constructor(public credentialService: CredentialService) { } - + constructor(public credentialService: CredentialService) {} } diff --git a/webapp/src/app/person-publications/person-publications.component.html b/webapp/src/app/person-publications/person-publications.component.html index 588ebb8b..50956385 100644 --- a/webapp/src/app/person-publications/person-publications.component.html +++ b/webapp/src/app/person-publications/person-publications.component.html @@ -1,5 +1,21 @@
-

Publikationen

+
+
+

Publikationen

+

Übersicht der wissenschaftlichen Veröffentlichungen.

+
+
+ + +
+
@if (loading) { @@ -9,10 +25,20 @@ } + + + + + @@ -25,7 +51,7 @@ + @@ -59,8 +85,8 @@
+ + + + Titel
{{ publication.title || 'Ohne Titel' }}
+
Becker, A.; Müller, T.; Zhang, L.
Typ @if (publication.type) { - {{ publication.type }} + {{ publication.type }} } @else { - } @@ -33,7 +59,7 @@ - SpracheSprache / Quelle {{ publication.language || '-' }} DOI @if (doiUrl(publication.doi); as url) { - - open_in_new + + chevron_right } @else { - @@ -77,10 +103,13 @@ } - - + diff --git a/webapp/src/app/person-publications/person-publications.component.scss b/webapp/src/app/person-publications/person-publications.component.scss index 1d06aa96..98bdec37 100644 --- a/webapp/src/app/person-publications/person-publications.component.scss +++ b/webapp/src/app/person-publications/person-publications.component.scss @@ -1,30 +1,73 @@ .page { - padding: 28px 32px; - max-width: 1200px; + padding: 28px 32px 42px; + max-width: 100%; margin: 0 auto; } +.section-heading { + display: flex; + align-items: flex-start; + justify-content: space-between; + gap: 24px; + margin-bottom: 22px; +} + h2 { - margin: 0 0 20px; - font-weight: 600; + margin: 0 0 6px; + font-size: 22px; + line-height: 1.2; + font-weight: 700; +} + +.section-heading p { + margin: 0; + color: var(--sg-text-muted); + font-size: 14px; +} + +.table-actions { + display: flex; + flex-wrap: wrap; + justify-content: flex-end; + gap: 12px; +} + +.table-actions button { + height: 42px; + border-color: var(--sg-border); + border-radius: var(--sg-radius-sm); + color: var(--sg-text); + background: var(--sg-surface); } .table-wrap { position: relative; overflow-x: auto; + border: 1px solid var(--sg-border); + border-radius: var(--sg-radius-sm) var(--sg-radius-sm) 0 0; + background: var(--sg-surface); } table { width: 100%; - min-width: 920px; - border-radius: 8px; + min-width: 980px; + border-radius: 0; overflow: hidden; + box-shadow: none; } .title { - max-width: 420px; + max-width: 520px; line-height: 1.35; - font-weight: 600; + color: var(--sg-primary); + font-size: 14px; + font-weight: 700; +} + +.authors { + margin-top: 7px; + color: var(--sg-text-muted); + font-size: 12px; } .loading { @@ -57,24 +100,90 @@ mat-chip, --mdc-chip-elevated-container-color: #e3f2fd; --mdc-chip-label-text-color: #0d47a1; --mdc-chip-outline-color: #bbdefb; - max-width: 140px; + max-width: 170px; + min-height: 30px; + font-weight: 700; } -a { +.type-chip.success { + --mdc-chip-elevated-container-color: var(--sg-success-soft); + --mdc-chip-label-text-color: var(--sg-success); + --mdc-chip-outline-color: #b9ebcb; +} + +.type-chip.warning { + --mdc-chip-elevated-container-color: var(--sg-warning-soft); + --mdc-chip-label-text-color: var(--sg-warning); + --mdc-chip-outline-color: #d8c5ff; +} + +.row-link { display: inline-flex; - color: inherit; + align-items: center; + justify-content: center; + width: 36px; + height: 36px; + color: var(--sg-text); + text-decoration: none; } ::ng-deep .mat-mdc-header-row { - background-color: #eaf0ff; + height: 48px; + background-color: var(--sg-surface-muted); + color: var(--sg-text-muted); +} + +::ng-deep .mat-mdc-header-cell { + color: var(--sg-text-muted); + font-size: 12px; + font-weight: 700; +} + +::ng-deep .mat-mdc-row { + height: 86px; +} + +::ng-deep .mat-mdc-cell { + color: var(--sg-text); + border-bottom-color: var(--sg-border); + font-size: 13px; +} + +::ng-deep .mat-column-select { + width: 58px; + padding-left: 22px; } mat-paginator { - margin-top: 8px; + background: transparent; +} + +.table-footer { + display: flex; + align-items: center; + justify-content: space-between; + min-height: 66px; + padding: 0 22px 0 28px; + border: 1px solid var(--sg-border); + border-top: 0; + border-radius: 0 0 var(--sg-radius-sm) var(--sg-radius-sm); + background: var(--sg-surface); + color: var(--sg-text-muted); + font-size: 13px; } @media (max-width: 600px) { .page { padding: 16px; } + + .section-heading, + .table-footer { + align-items: stretch; + flex-direction: column; + } + + .table-actions { + justify-content: stretch; + } } diff --git a/webapp/src/app/person-publications/person-publications.component.ts b/webapp/src/app/person-publications/person-publications.component.ts index f7eaf029..7905e1de 100644 --- a/webapp/src/app/person-publications/person-publications.component.ts +++ b/webapp/src/app/person-publications/person-publications.component.ts @@ -6,6 +6,8 @@ import { MatPaginatorModule, PageEvent } from '@angular/material/paginator'; import { MatProgressSpinnerModule } from '@angular/material/progress-spinner'; import { MatSnackBar, MatSnackBarModule } from '@angular/material/snack-bar'; import { MatTableModule } from '@angular/material/table'; +import { MatCheckboxModule } from '@angular/material/checkbox'; +import { MatButtonModule } from '@angular/material/button'; import { WorkSummary } from '../api'; import { PaginationService } from '../services/pagination.service'; @@ -16,6 +18,8 @@ import { createLoadError } from '../utils/errorHandler'; selector: 'app-person-publications', imports: [ MatChipsModule, + MatButtonModule, + MatCheckboxModule, MatIconModule, MatPaginatorModule, MatProgressSpinnerModule, @@ -26,7 +30,7 @@ import { createLoadError } from '../utils/errorHandler'; styleUrl: './person-publications.component.scss', }) export class PersonPublicationsComponent implements OnInit { - displayedColumns: string[] = ['title', 'year', 'type', 'language', 'citations', 'topics', 'doi']; + displayedColumns: string[] = ['select', 'title', 'type', 'year', 'language', 'citations', 'doi']; publications: WorkSummary[] = []; total = 0; loading = false; @@ -72,4 +76,19 @@ export class PersonPublicationsComponent implements OnInit { if (!doi) return null; return doi.startsWith('http') ? doi : `https://doi.org/${doi}`; } + + publicationRange(): string { + if (this.total === 0 || this.publications.length === 0) { + return 'Keine Publikationen'; + } + + return `Zeige 1 bis ${this.publications.length} von ${this.total} Publikationen`; + } + + typeClass(type: string | null | undefined): string { + const normalized = (type ?? '').toLowerCase(); + if (normalized.includes('conference')) return 'type-chip success'; + if (normalized.includes('book')) return 'type-chip warning'; + return 'type-chip'; + } } diff --git a/webapp/src/app/person/person.component.html b/webapp/src/app/person/person.component.html index e801c2c8..a937e2a5 100644 --- a/webapp/src/app/person/person.component.html +++ b/webapp/src/app/person/person.component.html @@ -1,4 +1,44 @@ -